Консультация № 178577
22.05.2010, 23:01
0.00 руб.
0 7 1
Здравствуйте!

Помогите пожалуйста с программированием видеокарты SuperVGA с помощью стандарта VESA.

Задание - вывести информацию о ЦАП.

Предпочтителен - TASM, но буду рад и другим вариантам.
Процессор - 64-битный.

Спасибо!

Обсуждение

давно
Посетитель
7438
7205
23.05.2010, 04:15
общий
Гальцов Андрей:
Требуется просто получить палитру цветов RGBA?
Об авторе:
"Если вы заметили, что вы на стороне большинства, —
это верный признак того, что пора меняться." Марк Твен
Неизвестный
23.05.2010, 12:50
общий
Лысков Игорь Витальевич:
Да...наверно
давно
Посетитель
7438
7205
23.05.2010, 18:17
общий
это ответ
Здравствуйте, Гальцов Андрей.
Даю маленькую программку вместе со справкой от Ralf Brown
Код:
comment ~
INT 10 - VESA SuperVGA BIOS (VBE) - GET SuperVGA INFORMATION
AX = 4F00h
ES:DI -> buffer for SuperVGA information (see #00077)
Return: AL = 4Fh if function supported
AH = status
00h successful
ES:DI buffer filled
01h failed
---VBE v2.0---
02h function not supported by current hardware configuration
03h function invalid in current video mode
Desc: determine whether VESA BIOS extensions are present and the capabilities
supported by the display adapter
SeeAlso: AX=4E00h,AX=4F01h,AX=7F00h"SOLLEX",AX=A00Ch
Index: installation check;VESA SuperVGA

Format of SuperVGA information:
Offset Size Description (Table 00077)
00h 4 BYTEs (ret) signature ("VESA")
(call) VESA 2.0 request signature ("VBE2"), required to receive
version 2.0 info
04h WORD VESA version number (one-digit minor version -- 0102h = v1.2)
06h DWORD pointer to OEM name
"761295520" for ATI
0Ah DWORD capabilities flags (see #00078)
0Eh DWORD pointer to list of supported VESA and OEM video modes
(list of words terminated with FFFFh)
12h WORD total amount of video memory in 64K blocks
---VBE v1.x ---
14h 236 BYTEs reserved
---VBE v2.0 ---
14h WORD OEM software version (BCD, high byte = major, low byte = minor)
16h DWORD pointer to vendor name
1Ah DWORD pointer to product name
1Eh DWORD pointer to product revision string
22h WORD (if capabilities bit 3 set) VBE/AF version (BCD)
0100h for v1.0P
24h DWORD (if capabilities bit 3 set) pointer to list of supported
accelerated video modes (list of words terminated with FFFFh)
28h 216 BYTEs reserved for VBE implementation
100h 256 BYTEs OEM scratchpad (for OEM strings, etc.)
Notes: the list of supported video modes is stored in the reserved portion of
the SuperVGA information record by some implementations, and it may
thus be necessary to either copy the mode list or use a different
buffer for all subsequent VESA calls
not all of the video modes in the list of mode numbers may be
supported, e.g. if they require more memory than currently installed
or are not supported by the attached monitor. Check any mode you
intend to use through AX=4F01h first.
the 1.1 VESA document specifies 242 reserved bytes at the end, so the
buffer should be 262 bytes to ensure that it is not overrun; for
v2.0, the buffer should be 512 bytes
the S3 specific video modes will most likely follow the FFFFh
terminator at the end of the standard modes. A search must then
be made to find them, FFFFh will also terminate this second list
in some cases, only a "stub" VBE may be present, supporting only
AX=4F00h; this case may be assumed if the list of supported video
modes is empty (consisting of a single word of FFFFh)

Bitfields for VESA capabilities:
Bit(s) Description (Table 00078)
0 DAC can be switched into 8-bit mode
1 non-VGA controller
2 programmed DAC with blank bit (i.e. only during blanking interval)
3 (VBE v3.0) controller supports hardware stereoscopic signalling
3 controller supports VBE/AF v1.0P extensions
4 (VBE v3.0) if bit 3 set:
=0 stereo signalling via external VESA stereo connector
=1 stereo signalling via VESA EVC connector
4 (VBE/AF v1.0P) must call EnableDirectAccess to access framebuffer
5 (VBE/AF v1.0P) controller supports hardware mouse cursor
6 (VBE/AF v1.0P) controller supports hardware clipping
7 (VBE/AF v1.0P) controller supports transparent BitBLT
8-31 reserved (0)

INT 10 - VESA SuperVGA BIOS v2.0+ - GET/SET PALETTE ENTRIES
AX = 4F09h
BL = subfunction
00h set (primary) palette
01h get (primary) palette
02h set secondary palette data
03h get secondary palette data
80h set palette during vertical retrace
CX = number of entries to change
DX = starting palette index
ES:DI -> palette buffer, array of DAC entries (see #00086)
Return: AL = 4Fh if function supported
AH = status
00h successful
01h failed
SeeAlso: AX=4F0Ah,AX=D000h"S3VBE"

Format of VESA VBE palette entry:
Offset Size Description (Table 00086)
00h BYTE red
01h BYTE green
02h BYTE blue
03h BYTE alpha or alignment byte
~
.model tiny
.code
.startup

;GET SuperVGA INFORMATION
mov ax, 4F00h
lea di, SuperVGABuffer ;ES:DI -> buffer for SuperVGA information (see #00077)
int 10h
cmp ax,004fh
jne SuperVGA_NotFound

;GET PALETTE ENTRIES
mov ax, 4F09h
mov bl, 1 ;get (primary) palette
xor dx, dx
lea di, SuperVGABuffer ;ES:DI -> buffer for RGBA
mov cx, 100h ;количество
int 10h
cmp ax, 004fh ;проверка на корректность
jne SuperVGA_NoPalette

;get secondary palette data
mov ax, 4F09h
mov bl, 2 ;get secondary palette data
xor dx, dx ;стартовый индекс
lea di, SuperVGABuffer ;ES:DI -> buffer for RGBA
mov cx, 100h ;количество
int 10h
cmp ax, 004fh ;проверка на корректность
jne SuperVGA_NoPalette

SuperVGA_NotFound:
SuperVGA_NoPalette:
mov ax, 4c00h
int 21h

SuperVGABuffer label byte

end
5
Спасибо!...
Об авторе:
"Если вы заметили, что вы на стороне большинства, —
это верный признак того, что пора меняться." Марк Твен
Неизвестный
23.05.2010, 18:29
общий
Лысков Игорь Витальевич:
Только что то у меня ехе файл не создаётся...
давно
Посетитель
7438
7205
24.05.2010, 02:42
общий
Гальцов Андрей:
Предполагался формат COM...
tasm name
tlink name /t
Об авторе:
"Если вы заметили, что вы на стороне большинства, —
это верный признак того, что пора меняться." Марк Твен
давно
Старший Модератор
31795
6196
25.05.2010, 11:09
общий
Гальцов Андрей:
Кулаков В. - Программирование на аппаратном уровне
Скачайте, не пожалеете.
Об авторе:
Мне безразлично, что Вы думаете о обо мне, но я рад за Вас - Вы начали думать.

Неизвестный
25.05.2010, 19:42
общий
Зенченко Константин Николаевич:
Спасибо
Форма ответа