VESA Video Modes: Difference between revisions

no edit summary
[unchecked revision][unchecked revision]
m (Undo revision 25345 by Xenos1 (talk) Intel announced BIOS is obsolete by 2020 so is VESA. That's important information)
No edit summary
Line 21:
</source>
 
;INT 0x10, AX=0x4F01, CX=mode, ES:DI=256 byte buffer
: Get Mode Info. Call this for each member of the mode array to find out the details of that mode. The 256 byte buffer will be filled by the mode info block.
 
<source lang="c">
struct ModeInfoBlockvbe_mode_info_structure {
uint16 attributes; // deprecated, only bit 7 should be of interest to you, and it indicates the mode supports a linear frame buffer.
uint16_t attributes;
uint8 window_a; // deprecated
uint8_t winA,winB;
uint8 window_b; // deprecated
uint16_t granularity;
uint16 granularity; // deprecated; used while calculating bank numbers
uint16_t winsize;
uint16 window_size;
uint16_t segmentA, segmentB;
uint16 segment_a;
VBE_FAR(realFctPtr);
uint16 segment_b;
uint16_t pitch; // bytes per scanline
uint32 win_func_ptr; // deprecated; used to switch banks from protected mode without returning to real mode
 
uint16 pitch; // number of bytes per horizontal line
uint16_t Xres, Yres;
uint16 width; // width in pixels
uint8_t Wchar, Ychar, planes, bpp, banks;
uint16 height; // height in pixels
uint8_t memory_model, bank_size, image_pages;
uint8 w_char; // unused...
uint8_t reserved0;
uint8 y_char; // ...
 
uint8 planes;
uint8_t red_mask, red_position;
uint8 bpp; // bits per pixel in this mode
uint8_t green_mask, green_position;
uint8 banks; // deprecated; total number of banks in this mode
uint8_t blue_mask, blue_position;
uint8 memory_model;
uint8_t rsv_mask, rsv_position;
uint8 bank_size; // deprecated; size of a bank, almost always 64 KB but may be 16 KB...
uint8_t directcolor_attributes;
uint8 image_pages;
 
uint8_t uint8 reserved0;
uint32_t physbase; // your LFB (Linear Framebuffer) address ;)
uint32_t reserved1;
uint8 red_mask;
uint16_t reserved2;
uint8_t red_mask, uint8 red_position;
} __attribute__((packed));
uint8 green_mask;
uint8_t green_mask, uint8 green_position;
uint8 blue_mask;
uint8_t blue_mask, uint8 blue_position;
uint8 reserved_mask;
uint8 reserved_position;
uint8 direct_color_attributes;
uint32 framebuffer; // physical address of the linear frame buffer; write here to draw to the screen
uint32 off_screen_mem_off;
uint16 off_screen_mem_size; // size of memory in the framebuffer but not being displayed on the screen
uint32_t uint8 reserved1[206];
} __attribute__ ((packed));
</source>