1
0
Fork 0

Add static_casts for few VGA modeinfo fields

In all cases values are stored in Bitu, but the allowed range fits
into a single byte.
This commit is contained in:
Patryk Obara 2020-04-15 14:19:57 +02:00
parent 8d33524e25
commit c040efed53

View file

@ -240,7 +240,8 @@ foundit:
} else if (pageSize) {
pages = (vga.vmemsize / pageSize)-1;
}
minfo.NumberOfImagePages = pages;
assert(pages <= 255);
minfo.NumberOfImagePages = static_cast<uint8_t>(pages);
minfo.ModeAttributes = host_to_le16(modeAttributes);
minfo.WinAAttributes = 0x7; // Exists/readable/writable
@ -260,8 +261,8 @@ foundit:
minfo.WinFuncPtr = host_to_le32(int10.rom.set_window);
minfo.NumberOfBanks = 0x1;
minfo.Reserved_page = 0x1;
minfo.XCharSize = mblock->cwidth;
minfo.YCharSize = mblock->cheight;
minfo.XCharSize = static_cast<uint8_t>(mblock->cwidth);
minfo.YCharSize = static_cast<uint8_t>(mblock->cheight);
if (!int10.vesa_nolfb)
minfo.PhysBasePtr = host_to_le32(S3_LFB_BASE);
@ -269,7 +270,6 @@ foundit:
return VESA_SUCCESS;
}
Bit8u VESA_SetSVGAMode(Bit16u mode) {
if (INT10_SetVideoMode(mode)) {
int10.vesa_setmode=mode&0x7fff;