Created
July 17, 2015 19:29
-
-
Save Myvar/d98720a8f9bb2d879f89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define VBE_DISPI_IOPORT_INDEX 0x01CE | |
#define VBE_DISPI_IOPORT_DATA 0x01CF | |
#define VBE_DISPI_INDEX_ID 0x0 | |
#define VBE_DISPI_INDEX_XRES 0x1 | |
#define VBE_DISPI_INDEX_YRES 0x2 | |
#define VBE_DISPI_INDEX_BPP 0x3 | |
#define VBE_DISPI_INDEX_ENABLE 0x4 | |
#define VBE_DISPI_INDEX_BANK 0x5 | |
#define VBE_DISPI_INDEX_VIRT_WIDTH 0x6 | |
#define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7 | |
#define VBE_DISPI_INDEX_X_OFFSET 0x8 | |
#define VBE_DISPI_INDEX_Y_OFFSET 0x9 | |
#define VBE_DISPI_DISABLED 0x00 | |
#define VBE_DISPI_ENABLED 0x01 | |
#define VBE_DISPI_GETCAPS 0x02 | |
#define VBE_DISPI_8BIT_DAC 0x20 | |
#define VBE_DISPI_LFB_ENABLED 0x40 | |
#define VBE_DISPI_NOCLEARMEM 0x80 | |
void vbe_write(USHORT index, USHORT value) | |
{ | |
WRITE_PORT_USHORT(VBE_DISPI_IOPORT_INDEX, index); | |
WRITE_PORT_USHORT(VBE_DISPI_IOPORT_DATA, value); | |
} | |
void vbe_set(USHORT xres, USHORT yres, USHORT bpp) | |
{ | |
vbe_write(VBE_DISPI_INDEX_ENABLE, VBE_DISPI_DISABLED); | |
vbe_write(VBE_DISPI_INDEX_XRES, xres); | |
vbe_write(VBE_DISPI_INDEX_YRES, yres); | |
vbe_write(VBE_DISPI_INDEX_BPP, bpp); | |
vbe_write(VBE_DISPI_INDEX_ENABLE, VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment