Skip to content

Commit

Permalink
VBE correction for text modes
Browse files Browse the repository at this point in the history
  • Loading branch information
joncampbell123 committed Jan 12, 2025
1 parent f9c17c0 commit 38db734
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ints/int10_vesa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,10 @@ uint8_t VESA_GetSVGAModeInformation(uint16_t mode,uint16_t seg,uint16_t off) {
case M_TEXT:
if (!allow_vesa_tty) return VESA_FAIL;
adj = hack_lfb_xadjust / 8;
pageSize = 0;
pageSize = mblock->sheight * cwidth/8;
var_write(&minfo.BytesPerScanLine, (uint16_t)(mblock->twidth * 2));
if (!int10.vesa_oldvbe10) { /* optional in VBE 1.0 */
var_write(&minfo.NumberOfPlanes,0x4);
var_write(&minfo.NumberOfPlanes,0x1);
var_write(&minfo.BitsPerPixel,4);
var_write(&minfo.MemoryModel,0); // text
}
Expand All @@ -443,6 +443,7 @@ uint8_t VESA_GetSVGAModeInformation(uint16_t mode,uint16_t seg,uint16_t off) {
modeAttributes &= ~0x1;
} else if (pageSize) {
pages = (GetReportedVideoMemorySize() / pageSize)-1;
if (pages > 254) pages = 254;
}

/* VBE 1.0 allows fields "XResolution" and later to be optional.
Expand Down

0 comments on commit 38db734

Please sign in to comment.