1 // ============================================================================================
3 // Copyright (C) 2002 Jeroen Janssen
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2 of the License, or (at your option) any later version.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // ============================================================================================
21 // This VBE is part of the VGA Bios specific to the plex86/bochs Emulated VGA card.
22 // You can NOT drive any physical vga card with it.
24 // ============================================================================================
26 // This VBE Bios is based on information taken from :
27 // - VESA BIOS EXTENSION (VBE) Core Functions Standard Version 3.0 located at www.vesa.org
29 // ============================================================================================
33 // enable LFB support (depends upon bochs-vbe-lfb patch)
36 // disable VESA/VBE2 check in vbe info
37 //#define VBE2_NO_VESA_CHECK
39 // dynamicly generate a mode_info list
44 #include "vbetables.h"
47 // The current OEM Software Revision of this VBE Bios
48 #define VBE_OEM_SOFTWARE_REV 0x0002;
50 extern char vbebios_copyright
;
51 extern char vbebios_vendor_name
;
52 extern char vbebios_product_name
;
53 extern char vbebios_product_revision
;
56 extern Bit16u vbebios_mode_list
;
60 // FIXME: 'merge' these (c) etc strings with the vgabios.c strings?
62 .ascii
"Bochs/Plex86 VBE(C) 2003 Jeroen Janssen <japj@darius.demon.nl>"
66 .ascii
"Bochs/Plex86 Developers"
69 _vbebios_product_name
:
70 .ascii
"Bochs/Plex86 VBE Adapter"
73 _vbebios_product_revision
:
78 .ascii
"Bochs VBE Display Adapter enabled"
83 _no_vbebios_info_string
:
84 .ascii
"NO Bochs VBE Support available!"
91 // FIXME: for each new mode add a statement here
92 // at least until dynamic list creation is working
95 .word VBE_VESA_MODE_640X400X8
96 .word VBE_VESA_MODE_640X480X8
97 .word VBE_VESA_MODE_800X600X4
98 .word VBE_VESA_MODE_800X600X8
99 .word VBE_VESA_MODE_1024X768X8
100 .word VBE_VESA_MODE_640X480X1555
101 .word VBE_VESA_MODE_640X480X565
102 .word VBE_VESA_MODE_640X480X888
103 .word VBE_VESA_MODE_800X600X1555
104 .word VBE_VESA_MODE_800X600X565
105 .word VBE_VESA_MODE_800X600X888
106 .word VBE_VESA_MODE_1024X768X1555
107 .word VBE_VESA_MODE_1024X768X565
108 .word VBE_VESA_MODE_1024X768X888
109 .word VBE_OWN_MODE_640X480X8888
110 .word VBE_OWN_MODE_800X600X8888
111 .word VBE_OWN_MODE_1024X768X8888
112 .word VBE_OWN_MODE_320X200X8
113 .word VBE_VESA_MODE_END_OF_LIST
119 #define PANIC_PORT 0x501
123 ;; the HALT macro is called with the line number of the HALT call
.
124 ;; The line number is then sent to the PANIC_PORT
, causing Bochs to
125 ;; print a BX_PANIC message
. This will normally halt the simulation
126 ;; with a message such as
"BIOS panic at rombios.c, line 4091".
127 ;; However
, users can choose to make panics non
-fatal
and continue.
134 // DISPI ioport functions
135 // FIXME: what if no VBE host side code?
136 static Bit16u
dispi_get_id()
138 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_ID
);
139 return inw(VBE_DISPI_IOPORT_DATA
);
142 static void dispi_set_id(id
)
145 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_ID
);
146 outw(VBE_DISPI_IOPORT_DATA
,id
);
149 static void dispi_set_xres(xres
)
152 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_XRES
);
153 outw(VBE_DISPI_IOPORT_DATA
,xres
);
156 static void dispi_set_yres(yres
)
159 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_YRES
);
160 outw(VBE_DISPI_IOPORT_DATA
,yres
);
163 static void dispi_set_bpp(bpp
)
166 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_BPP
);
167 outw(VBE_DISPI_IOPORT_DATA
,bpp
);
170 static Bit16u
dispi_get_bpp()
172 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_BPP
);
173 return inw(VBE_DISPI_IOPORT_DATA
);
176 static Bit16u
dispi_get_max_bpp()
178 Bit16u max_bpp
, vbe_enable
;
180 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_ENABLE
);
181 vbe_enable
= inw(VBE_DISPI_IOPORT_DATA
);
182 outw(VBE_DISPI_IOPORT_DATA
,vbe_enable
|VBE_DISPI_GETCAPS
);
183 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_BPP
);
184 max_bpp
= inw(VBE_DISPI_IOPORT_DATA
);
185 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_ENABLE
);
186 outw(VBE_DISPI_IOPORT_DATA
,vbe_enable
);
190 static Bit16u
dispi_get_enable()
192 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_ENABLE
);
193 return inw(VBE_DISPI_IOPORT_DATA
);
196 void dispi_set_enable(enable
)
199 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_ENABLE
);
200 outw(VBE_DISPI_IOPORT_DATA
,enable
);
203 static void dispi_set_bank(bank
)
206 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_BANK
);
207 outw(VBE_DISPI_IOPORT_DATA
,bank
);
210 static Bit16u
dispi_get_bank()
212 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_BANK
);
213 return inw(VBE_DISPI_IOPORT_DATA
);
216 static void dispi_set_bank_farcall()
220 je dispi_set_bank_farcall_get
222 jnz dispi_set_bank_farcall_error
224 mov ax
,# VBE_DISPI_INDEX_BANK
225 mov dx
,# VBE_DISPI_IOPORT_INDEX
228 mov dx
,# VBE_DISPI_IOPORT_DATA
231 dispi_set_bank_farcall_get
:
232 mov ax
,# VBE_DISPI_INDEX_BANK
233 mov dx
,# VBE_DISPI_IOPORT_INDEX
235 mov dx
,# VBE_DISPI_IOPORT_DATA
239 dispi_set_bank_farcall_error
:
245 static void dispi_set_x_offset(offset
)
248 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_X_OFFSET
);
249 outw(VBE_DISPI_IOPORT_DATA
,offset
);
252 static Bit16u
dispi_get_x_offset()
254 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_X_OFFSET
);
255 return inw(VBE_DISPI_IOPORT_DATA
);
258 static void dispi_set_y_offset(offset
)
261 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_Y_OFFSET
);
262 outw(VBE_DISPI_IOPORT_DATA
,offset
);
265 static Bit16u
dispi_get_y_offset()
267 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_Y_OFFSET
);
268 return inw(VBE_DISPI_IOPORT_DATA
);
271 static void dispi_set_virt_width(width
)
274 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_VIRT_WIDTH
);
275 outw(VBE_DISPI_IOPORT_DATA
,width
);
278 static Bit16u
dispi_get_virt_width()
280 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_VIRT_WIDTH
);
281 return inw(VBE_DISPI_IOPORT_DATA
);
284 static void dispi_set_virt_height(height)
287 outw(VBE_DISPI_IOPORT_INDEX,VBE_DISPI_INDEX_VIRT_HEIGHT);
288 outw(VBE_DISPI_IOPORT_DATA,height);
291 static Bit16u
dispi_get_virt_height()
293 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_VIRT_HEIGHT
);
294 return inw(VBE_DISPI_IOPORT_DATA
);
298 // ModeInfo helper function
299 static ModeInfoListItem
* mode_info_find_mode(mode
, using_lfb
)
300 Bit16u mode
; Boolean using_lfb
;
302 ModeInfoListItem
*cur_info
=&mode_info_list
;
304 while (cur_info
->mode
!= VBE_VESA_MODE_END_OF_LIST
)
306 if (cur_info
->mode
== mode
)
312 else if (cur_info
->info
.ModeAttributes
& VBE_MODE_ATTRIBUTE_LINEAR_FRAME_BUFFER_MODE
)
330 /** Has VBE display - Returns true if VBE display detected
333 Boolean
vbe_has_vbe_display()
335 return read_byte(BIOSMEM_SEG
,BIOSMEM_VBE_FLAG
);
338 /** VBE Init - Initialise the Vesa Bios Extension Code
340 * This function does a sanity check on the host side display code interface.
346 outw(VBE_DISPI_IOPORT_INDEX
,VBE_DISPI_INDEX_ID
);
347 outw(VBE_DISPI_IOPORT_DATA
,VBE_DISPI_ID0
);
349 dispi_id
=inw(VBE_DISPI_IOPORT_DATA
);
351 if (dispi_id
==VBE_DISPI_ID0
)
353 write_byte(BIOSMEM_SEG
,BIOSMEM_VBE_FLAG
,0x01);
354 dispi_set_id(VBE_DISPI_ID3
);
356 printf("VBE Bios $Id$\n");
359 /** VBE Display Info - Display information on screen about the VBE
361 void vbe_display_info()
363 // Check for VBE display extension in Bochs
364 if (vbe_has_vbe_display())
369 mov si
,#_vbebios_info_string
378 mov si
,#_no_vbebios_info_string
385 /** Function 00h - Return VBE Controller Information
389 * ES:DI = Pointer to buffer in which to place VbeInfoBlock structure
390 * (VbeSignature should be VBE2 when VBE 2.0 information is desired and
391 * the info block is 512 bytes in size)
393 * AX = VBE Return Status
396 void vbe_biosfn_return_controller_information(AX
, ES
, DI
)
397 Bit16u
*AX
;Bit16u ES
;Bit16u DI
;
400 VbeInfoBlock vbe_info_block
;
406 ModeInfoListItem
*cur_info
=&mode_info_list
;
408 status
= read_word(ss
, AX
);
411 printf("VBE vbe_biosfn_return_vbe_info ES%x DI%x AX%x\n",ES
,DI
,status
);
415 #ifdef VBE2_NO_VESA_CHECK
417 // get vbe_info_block into local variable
418 memcpyb(ss
, &vbe_info_block
, ES
, DI
, sizeof(vbe_info_block
));
420 // check for VBE2 signature
421 if (((vbe_info_block
.VbeSignature
[0] == 'V') &&
422 (vbe_info_block
.VbeSignature
[1] == 'B') &&
423 (vbe_info_block
.VbeSignature
[2] == 'E') &&
424 (vbe_info_block
.VbeSignature
[3] == '2')) ||
426 ((vbe_info_block
.VbeSignature
[0] == 'V') &&
427 (vbe_info_block
.VbeSignature
[1] == 'E') &&
428 (vbe_info_block
.VbeSignature
[2] == 'S') &&
429 (vbe_info_block
.VbeSignature
[3] == 'A')) )
433 printf("VBE correct VESA/VBE2 signature found\n");
439 vbe_info_block
.VbeSignature
[0] = 'V';
440 vbe_info_block
.VbeSignature
[1] = 'E';
441 vbe_info_block
.VbeSignature
[2] = 'S';
442 vbe_info_block
.VbeSignature
[3] = 'A';
444 // VBE Version supported
445 vbe_info_block
.VbeVersion
= 0x0200;
448 vbe_info_block
.OemStringPtr_Seg
= 0xc000;
449 vbe_info_block
.OemStringPtr_Off
= &vbebios_copyright
;
452 vbe_info_block
.Capabilities
[0] = 0;
453 vbe_info_block
.Capabilities
[1] = 0;
454 vbe_info_block
.Capabilities
[2] = 0;
455 vbe_info_block
.Capabilities
[3] = 0;
458 // VBE Video Mode Pointer (dynamicly generated from the mode_info_list)
459 vbe_info_block
.VideoModePtr_Seg
= ES
;
460 vbe_info_block
.VideoModePtr_Off
= DI
+ 34;
462 // VBE Video Mode Pointer (staticly in rom)
463 vbe_info_block
.VideoModePtr_Seg
= 0xc000;
464 vbe_info_block
.VideoModePtr_Off
= &vbebios_mode_list
;
467 // VBE Total Memory (in 64b blocks)
468 vbe_info_block
.TotalMemory
= VBE_TOTAL_VIDEO_MEMORY_DIV_64K
;
473 vbe_info_block
.OemSoftwareRev
= VBE_OEM_SOFTWARE_REV
;
474 vbe_info_block
.OemVendorNamePtr_Seg
= 0xc000;
475 vbe_info_block
.OemVendorNamePtr_Off
= &vbebios_vendor_name
;
476 vbe_info_block
.OemProductNamePtr_Seg
= 0xc000;
477 vbe_info_block
.OemProductNamePtr_Off
= &vbebios_product_name
;
478 vbe_info_block
.OemProductRevPtr_Seg
= 0xc000;
479 vbe_info_block
.OemProductRevPtr_Off
= &vbebios_product_revision
;
481 // copy updates in vbe_info_block back
482 memcpyb(ES
, DI
, ss
, &vbe_info_block
, sizeof(vbe_info_block
));
486 // copy updates in vbe_info_block back (VBE 1.x compatibility)
487 memcpyb(ES
, DI
, ss
, &vbe_info_block
, 256);
493 if (cur_info
->info
.BitsPerPixel
<= dispi_get_max_bpp()) {
495 printf("VBE found mode %x => %x\n", cur_info
->mode
,cur_mode
);
497 write_word(ES
, DI
+ cur_ptr
, cur_info
->mode
);
502 } while (cur_info
->mode
!= VBE_VESA_MODE_END_OF_LIST
);
504 // Add vesa mode list terminator
505 write_word(ES
, DI
+ cur_ptr
, cur_info
->mode
);
510 write_word(ss
, AX
, result
);
514 /** Function 01h - Return VBE Mode Information
519 * ES:DI = Pointer to buffer in which to place ModeInfoBlock structure
521 * AX = VBE Return Status
524 void vbe_biosfn_return_mode_information(AX
, CX
, ES
, DI
)
525 Bit16u
*AX
;Bit16u CX
; Bit16u ES
;Bit16u DI
;
527 Bit16u result
=0x0100;
530 ModeInfoListItem
*cur_info
;
534 printf("VBE vbe_biosfn_return_mode_information ES%x DI%x CX%x\n",ES
,DI
,CX
);
537 using_lfb
=((CX
& VBE_MODE_LINEAR_FRAME_BUFFER
) == VBE_MODE_LINEAR_FRAME_BUFFER
);
541 cur_info
= mode_info_find_mode(CX
, using_lfb
, &cur_info
);
546 printf("VBE found mode %x\n",CX
);
548 memsetb(ss
, &info
, 0, sizeof(ModeInfoBlock
));
549 memcpyb(ss
, &info
, 0xc000, &(cur_info
->info
), sizeof(ModeInfoBlockCompact
));
550 if (info
.WinAAttributes
& VBE_WINDOW_ATTRIBUTE_RELOCATABLE
) {
551 info
.WinFuncPtr
= 0xC0000000UL
;
552 *(Bit16u
*)&(info
.WinFuncPtr
) = (Bit16u
)(dispi_set_bank_farcall
);
560 printf("VBE *NOT* found mode %x\n",CX
);
567 // copy updates in mode_info_block back
568 memcpyb(ES
, DI
, ss
, &info
, sizeof(info
));
571 write_word(ss
, AX
, result
);
574 /** Function 02h - Set VBE Mode
578 * BX = Desired Mode to set
579 * ES:DI = Pointer to CRTCInfoBlock structure
581 * AX = VBE Return Status
584 void vbe_biosfn_set_mode(AX
, BX
, ES
, DI
)
585 Bit16u
*AX
;Bit16u BX
; Bit16u ES
;Bit16u DI
;
587 Bit16u ss
= get_SS();
589 ModeInfoListItem
*cur_info
;
594 using_lfb
=((BX
& VBE_MODE_LINEAR_FRAME_BUFFER
) == VBE_MODE_LINEAR_FRAME_BUFFER
);
595 lfb_flag
=using_lfb
?VBE_DISPI_LFB_ENABLED
:0;
596 no_clear
=((BX
& VBE_MODE_PRESERVE_DISPLAY_MEMORY
) == VBE_MODE_PRESERVE_DISPLAY_MEMORY
)?VBE_DISPI_NOCLEARMEM
:0;
600 //result=read_word(ss,AX);
602 // check for non vesa mode
603 if (BX
<VBE_MODE_VESA_DEFINED
)
607 dispi_set_enable(VBE_DISPI_DISABLED
);
608 // call the vgabios in order to set the video mode
609 // this allows for going back to textmode with a VBE call (some applications expect that to work)
612 biosfn_set_video_mode(mode
);
616 cur_info
= mode_info_find_mode(BX
, using_lfb
, &cur_info
);
621 printf("VBE found mode %x, setting:\n", BX
);
622 printf("\txres%x yres%x bpp%x\n",
623 cur_info
->info
.XResolution
,
624 cur_info
->info
.YResolution
,
625 cur_info
->info
.BitsPerPixel
);
628 // first disable current mode (when switching between vesa modi)
629 dispi_set_enable(VBE_DISPI_DISABLED
);
631 if (cur_info
->mode
== VBE_VESA_MODE_800X600X4
)
633 biosfn_set_video_mode(0x6a);
636 dispi_set_xres(cur_info
->info
.XResolution
);
637 dispi_set_yres(cur_info
->info
.YResolution
);
638 dispi_set_bpp(cur_info
->info
.BitsPerPixel
);
640 dispi_set_enable(VBE_DISPI_ENABLED
| no_clear
| lfb_flag
);
642 write_word(BIOSMEM_SEG
,BIOSMEM_VBE_MODE
,BX
);
643 write_byte(BIOSMEM_SEG
,BIOSMEM_VIDEO_CTL
,(0x60 | no_clear
));
650 printf("VBE *NOT* found mode %x\n" , BX
);
654 // FIXME: redirect non VBE modi to normal VGA bios operation
655 // (switch back to VGA mode
660 write_word(ss
, AX
, result
);
663 /** Function 03h - Return Current VBE Mode
668 * AX = VBE Return Status
669 * BX = Current VBE Mode
672 void vbe_biosfn_return_current_mode(AX
, BX
)
673 Bit16u
*AX
;Bit16u
*BX
;
679 printf("VBE vbe_biosfn_return_current_mode\n");
682 if(dispi_get_enable())
684 mode
=read_word(BIOSMEM_SEG
,BIOSMEM_VBE_MODE
);
688 mode
=read_byte(BIOSMEM_SEG
,BIOSMEM_CURRENT_MODE
);
690 write_word(ss
, AX
, 0x4f);
691 write_word(ss
, BX
, mode
);
695 /** Function 04h - Save/Restore State
699 * DL = 00h Return Save/Restore State buffer size
702 * CX = Requested states
703 * ES:BX = Pointer to buffer (if DL <> 00h)
705 * AX = VBE Return Status
706 * BX = Number of 64-byte blocks to hold the state buffer (if DL=00h)
709 void vbe_biosfn_save_restore_state(AX
, DL
, CX
, ES
, BX
)
714 /** Function 05h - Display Window Control
718 * (16-bit) BH = 00h Set memory window
719 * = 01h Get memory window
723 * DX = Window number in video memory in window
724 * granularity units (Set Memory Window only)
726 * If this function is called while in a linear frame buffer mode,
727 * this function must fail with completion code AH=03h
730 * AX = VBE Return Status
731 * DX = Window number in window granularity units
732 * (Get Memory Window only)
734 void vbe_biosfn_display_window_control(AX
,BX
,DX
)
735 Bit16u
*AX
;Bit16u BX
;Bit16u
*DX
;
737 Bit16u ss
= get_SS();
738 Bit16u window
= read_word(ss
, DX
);
739 Bit16u result
= 0x014f;
743 dispi_set_bank(window
);
748 window
= dispi_get_bank();
749 write_word(ss
, DX
, result
);
752 write_word(ss
, AX
, result
);
756 /** Function 06h - Set/Get Logical Scan Line Length
760 * BL = 00h Set Scan Line Length in Pixels
761 * = 01h Get Scan Line Length
762 * = 02h Set Scan Line Length in Bytes
763 * = 03h Get Maximum Scan Line Length
764 * CX = If BL=00h Desired Width in Pixels
765 * If BL=02h Desired Width in Bytes
766 * (Ignored for Get Functions)
769 * AX = VBE Return Status
770 * BX = Bytes Per Scan Line
771 * CX = Actual Pixels Per Scan Line
772 * (truncated to nearest complete pixel)
773 * DX = Maximum Number of Scan Lines
775 void vbe_biosfn_set_get_logical_scan_line_length(AX
,BX
,CX
,DX
)
776 Bit16u
*AX
;Bit16u
*BX
;Bit16u
*DX
;Bit16u
*DX
;
780 Bit16u width
= read_word(ss
, CX
);
781 Bit16u cmd
= read_word(ss
, BX
);
782 Bit8u bytespp
= dispi_get_bpp()/8;
785 if ( ((cmd
& 0xff) == 0x00) || ((cmd
& 0xff) == 0x02) )
787 // set scan line lenght in pixels(0x00) or bytes (0x02)
791 if ( ((cmd
& 0xff) == 0x02) && (bytespp
> 1) )
795 dispi_set_virt_width(width
);
796 new_width
=dispi_get_virt_width();
797 new_height
=dispi_get_virt_height();
799 if (new_width
!=width
)
802 printf("* VBE width adjusted\n");
805 // notify width adjusted
813 write_word(ss
,BX
,new_width
*bytespp
);
814 write_word(ss
,CX
,new_width
);
815 write_word(ss
,DX
,new_height
);
818 write_word(ss
, AX
, result
);
822 /** Function 07h - Set/Get Display Start
826 * BH = 00h Reserved and must be 00h
827 * BL = 00h Set Display Start
828 * = 01h Get Display Start
829 * = 02h Schedule Display Start (Alternate)
830 * = 03h Schedule Stereoscopic Display Start
831 * = 04h Get Scheduled Display Start Status
832 * = 05h Enable Stereoscopic Mode
833 * = 06h Disable Stereoscopic Mode
834 * = 80h Set Display Start during Vertical Retrace
835 * = 82h Set Display Start during Vertical Retrace (Alternate)
836 * = 83h Set Stereoscopic Display Start during Vertical Retrace
837 * ECX = If BL=02h/82h Display Start Address in bytes
838 * If BL=03h/83h Left Image Start Address in bytes
839 * EDX = If BL=03h/83h Right Image Start Address in bytes
840 * CX = If BL=00h/80h First Displayed Pixel In Scan Line
841 * DX = If BL=00h/80h First Displayed Scan Line
844 * AX = VBE Return Status
845 * BH = If BL=01h Reserved and will be 0
846 * CX = If BL=01h First Displayed Pixel In Scan Line
847 * If BL=04h 0 if flip has not occurred, not 0 if it has
848 * DX = If BL=01h First Displayed Scan Line
851 * BH = 00h Reserved and must be 00h
852 * BL = 00h Set Display Start
853 * = 80h Set Display Start during Vertical Retrace
854 * CX = Bits 0-15 of display start address
855 * DX = Bits 16-31 of display start address
856 * ES = Selector for memory mapped registers
858 void vbe_biosfn_set_get_display_start(AX
,BX
,CX
,DX
)
859 Bit16u
*AX
;Bit16u BX
;Bit16u CX
;Bit16u DX
;
864 // printf("VBE vbe_biosfn_set_get_display_start\n");
867 // check for set display start
868 if ((GET_BL()==0x00) || (GET_BL()==0x80))
870 // 0x80 is during vertical retrace - is also used by sdd vbetest during multibuffering
872 // printf("VBE vbe_biosfn_set_get_display_start CX%x DX%x\n",CX,DX);
875 dispi_set_x_offset(CX
);
876 dispi_set_y_offset(DX
);
880 write_word(ss
, AX
, result
);
884 /** Function 08h - Set/Get Dac Palette Format
889 * AX = VBE Return Status
891 * FIXME: incomplete API description, Input & Output
893 void vbe_biosfn_set_get_dac_palette_format(AX
)
898 /** Function 09h - Set/Get Palette Data
903 * AX = VBE Return Status
905 * FIXME: incomplete API description, Input & Output
907 void vbe_biosfn_set_get_palette_data(AX
)
911 /** Function 0Ah - Return VBE Protected Mode Interface
916 * AX = VBE Return Status
918 * FIXME: incomplete API description, Input & Output
920 void vbe_biosfn_return_protected_mode_interface(AX
)