diff options
author | Jeroen Janssen <japj@xs4all.nl> | 2002-03-07 20:36:08 +0000 |
---|---|---|
committer | Jeroen Janssen <japj@xs4all.nl> | 2002-03-07 20:36:08 +0000 |
commit | b6def503f054e844a7b8b0f0ff89f12c972c324f (patch) | |
tree | 9c48b640712b2b10f93ff9efed57e583592c2998 | |
parent | cf78470cc05739efdf5e43a008a67c45686a70d2 (diff) | |
download | vgabios-b6def503f054e844a7b8b0f0ff89f12c972c324f.tar.gz |
- added 1024x768xbpp support
- some more cleanups/comments
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | vbe.c | 69 | ||||
-rw-r--r-- | vbetables.h | 62 |
3 files changed, 129 insertions, 4 deletions
@@ -1,6 +1,6 @@ vgabios-0.3a (Not released yet!!) - . added 640x400x8, 640x480x8, 800x600x8 (800x600 is partly shown in bochs window) + . added 640x400x8, 640x480x8, 800x600x8, 1024x768 (>640x480 needs a special bochs patch atm) . added 320x200x8 vbe support (uses the standard 320x200x8 vga mode to display, this allows for testing & having something on screen as well, at least until bochs host side display is up & running) @@ -31,6 +31,17 @@ #include "vbe.h" #include "vbetables.h" +// defines available + +// disable VESA/VBE2 check in vbe info +//#define VBE2_NO_VESA_CHECK + +// dynamicly generate a mode_info list +//#define DYN_LIST + +// enable unsupported modi in the mode_info list (ie >8bpp) +//#define LIST_UNSUPPORTED_MODI + // The current OEM Software Revision of this VBE Bios #define VBE_OEM_SOFTWARE_REV 0x0002; @@ -70,9 +81,8 @@ _vbebios_product_revision: // FIXME: for each new mode add a statement here // at least until dynamic list creation is working _vbebios_mode_list: + #ifdef LIST_UNSUPPORTED_MODI -.word VBE_VESA_MODE_640X400X8 -.word VBE_VESA_MODE_640X480X8 .word VBE_VESA_MODE_640X480X565 .word VBE_VESA_MODE_800X600X565 .word VBE_VESA_MODE_640X480X888 @@ -80,10 +90,12 @@ _vbebios_mode_list: .word VBE_OWN_MODE_800X600X8888 .word VBE_OWN_MODE_1024X768X8888 #endif + .word VBE_OWN_MODE_320X200X8 .word VBE_VESA_MODE_640X400X8 .word VBE_VESA_MODE_640X480X8 .word VBE_VESA_MODE_800X600X8 +.word VBE_VESA_MODE_1024X768X8 .word VBE_VESA_MODE_END_OF_LIST #endif @@ -121,6 +133,8 @@ Bit16u *AX;Bit16u ES;Bit16u DI; // get vbe_info_block into local variable memcpyb(ss, &vbe_info_block, ES, DI, sizeof(vbe_info_block)); +#ifdef VBE2_NO_VESA_CHECK +#else // check for VBE2 signature if (((vbe_info_block.VbeSignature[0] == 'V') && (vbe_info_block.VbeSignature[1] == 'B') && @@ -132,6 +146,8 @@ Bit16u *AX;Bit16u ES;Bit16u DI; (vbe_info_block.VbeSignature[2] == 'S') && (vbe_info_block.VbeSignature[3] == 'A')) ) { +#endif + #ifdef DEBUG printf("VBE correct VESA/VBE2 signature found\n"); #endif @@ -203,6 +219,9 @@ Bit16u *AX;Bit16u ES;Bit16u DI; memcpyb(ES, DI, ss, &vbe_info_block, sizeof(vbe_info_block)); result = 0x4f; + +#ifdef VBE2_NO_VESA_CHECK +#else } else { @@ -211,7 +230,7 @@ Bit16u *AX;Bit16u ES;Bit16u DI; #endif result = 0x0100; } - +#endif write_word(ss, AX, result); } @@ -279,6 +298,43 @@ Bit16u *AX;Bit16u CX; Bit16u ES;Bit16u DI; } //FIXME: make a generic vbe_set function that does io port with params + +static void vbe_set_1024x768x8() +{ + #asm + // set xresolution + mov dx, #0xff80 + mov ax, #0x01 + outw dx, ax + inc dx + mov ax, #0x400 + outw dx, ax + dec dx + // set yresolution + mov ax, #0x02 + outw dx, ax + inc dx + mov ax, #0x300 + outw dx, ax + dec dx + // set bank + mov ax, #0x04 + outw dx, ax + inc dx + mov ax, #0x00 + outw dx, ax + dec dx + + // enable video mode + mov ax, #0x03 + outw dx, ax + inc dx + mov ax, #0x01 + outw dx, ax + + #endasm +} + static void vbe_set_800x600x8() { #asm @@ -495,6 +551,13 @@ Bit16u *AX;Bit16u BX; Bit16u ES;Bit16u DI; #endif vbe_set_800x600x8(); } + if (cur_info->mode == VBE_VESA_MODE_1024X768X8) + { +#ifdef DEBUG + printf("VBE VBE_VESA_MODE_1024X768X8"); +#endif + vbe_set_1024x768x8(); + } else { // FIXME: setup gfx mode with host diff --git a/vbetables.h b/vbetables.h index 2de6c56..2002dc9 100644 --- a/vbetables.h +++ b/vbetables.h @@ -268,6 +268,68 @@ static ModeInfoListItem mode_info_list[]= /*} ModeInfoBlock;*/ } }, + + { + VBE_VESA_MODE_1024X768X8, + { +/*typedef struct ModeInfoBlock +{*/ +// Mandatory information for all VBE revisions + /*Bit16u ModeAttributes*/ VBE_MODE_ATTRIBUTE_SUPPORTED | + VBE_MODE_ATTRIBUTE_GRAPHICS_MODE | + VBE_MODE_ATTRIBUTE_COLOR_MODE | + VBE_MODE_ATTRIBUTE_GRAPHICS_MODE, + /*Bit8u WinAAttributes*/ VBE_WINDOW_ATTRIBUTE_READABLE | + VBE_WINDOW_ATTRIBUTE_WRITEABLE, + /*Bit8u WinBAttributes*/ 0, + /*Bit16u WinGranularity*/ VBE_BANK_SIZE_KB, + /*Bit16u WinSize*/ VBE_BANK_SIZE_KB, + /*Bit16u WinASegment*/ VGAMEM_GRAPH, + /*Bit16u WinBSegment*/ 0, + /*Bit32u WinFuncPtr*/ 0, + /*Bit16u BytesPerScanLine*/ 1024, +// Mandatory information for VBE 1.2 and above + /*Bit16u XResolution*/ 1024, + /*Bit16u YResolution*/ 768, + /*Bit8u XCharSize*/ 8, + /*Bit8u YCharSize*/ 16, + /*Bit8u NumberOfPlanes*/ 1, + /*Bit8u BitsPerPixel*/ 8, + /*Bit8u NumberOfBanks*/ 12, // 1024x768/64kb == 12 + /*Bit8u MemoryModel*/ VBE_MEMORYMODEL_PACKED_PIXEL, + /*Bit8u BankSize*/ 0, + /*Bit8u NumberOfImagePages*/ 0, + /*Bit8u Reserved_page*/ 0, +// Direct Color fields (required for direct/6 and YUV/7 memory models) + /*Bit8u RedMaskSize*/ 0, + /*Bit8u RedFieldPosition*/ 0, + /*Bit8u GreenMaskSize*/ 0, + /*Bit8u GreenFieldPosition*/ 0, + /*Bit8u BlueMaskSize*/ 0, + /*Bit8u BlueFieldPosition*/ 0, + /*Bit8u RsvdMaskSize*/ 0, + /*Bit8u RsvdFieldPosition*/ 0, + /*Bit8u DirectColorModeInfo*/ 0, +// Mandatory information for VBE 2.0 and above + /*Bit32u PhysBasePtr*/ VGAMEM_GRAPH_PHYSICAL_ADDRESS, //FIXME: this allows this mode to be displayed using the standard 320x200x8 vga mode + /*Bit32u OffScreenMemOffset*/ 0, + /*Bit16u OffScreenMemSize*/ 0, +// Mandatory information for VBE 3.0 and above + /*Bit16u LinBytesPerScanLine*/ 1024, + /*Bit8u BnkNumberOfPages*/ 0, + /*Bit8u LinNumberOfPages*/ 0, + /*Bit8u LinRedMaskSize*/ 0, + /*Bit8u LinRedFieldPosition*/ 0, + /*Bit8u LinGreenMaskSize*/ 0, + /*Bit8u LinGreenFieldPosition*/ 0, + /*Bit8u LinBlueMaskSize*/ 0, + /*Bit8u LinBlueFieldPosition*/ 0, + /*Bit8u LinRsvdMaskSize*/ 0, + /*Bit8u LinRsvdFieldPosition*/ 0, + /*Bit32u MaxPixelClock*/ 0, +/*} ModeInfoBlock;*/ + } + }, #ifdef LIST_UNSUPPORTED_MODI { |