Changeset 74135 in vbox for trunk/src/VBox/Devices/Graphics/DevVGA.cpp
- Timestamp:
- Sep 7, 2018 8:15:19 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r73203 r74135 974 974 #endif 975 975 976 static void recalculate_data(PVGASTATE pThis , bool fVirtHeightOnly)976 static void recalculate_data(PVGASTATE pThis) 977 977 { 978 978 uint16_t cBPP = pThis->vbe_regs[VBE_DISPI_INDEX_BPP]; … … 986 986 Assert(cbLinePitch != 0); 987 987 uint32_t cVirtHeight = pThis->vram_size / cbLinePitch; 988 if (!fVirtHeightOnly) 989 { 990 uint16_t offX = pThis->vbe_regs[VBE_DISPI_INDEX_X_OFFSET]; 991 uint16_t offY = pThis->vbe_regs[VBE_DISPI_INDEX_Y_OFFSET]; 992 uint32_t offStart = cbLinePitch * offY; 993 if (cBPP == 4) 994 offStart += offX >> 1; 995 else 996 offStart += offX * ((cBPP + 7) >> 3); 997 offStart >>= 2; 998 pThis->vbe_line_offset = RT_MIN(cbLinePitch, pThis->vram_size); 999 pThis->vbe_start_addr = RT_MIN(offStart, pThis->vram_size); 1000 } 988 uint16_t offX = pThis->vbe_regs[VBE_DISPI_INDEX_X_OFFSET]; 989 uint16_t offY = pThis->vbe_regs[VBE_DISPI_INDEX_Y_OFFSET]; 990 uint32_t offStart = cbLinePitch * offY; 991 if (cBPP == 4) 992 offStart += offX >> 1; 993 else 994 offStart += offX * ((cBPP + 7) >> 3); 995 offStart >>= 2; 996 pThis->vbe_line_offset = RT_MIN(cbLinePitch, pThis->vram_size); 997 pThis->vbe_start_addr = RT_MIN(offStart, pThis->vram_size); 1001 998 1002 999 /* The VBE_DISPI_INDEX_VIRT_HEIGHT is used to prevent setting resolution bigger than … … 1230 1227 if (fRecalculate) 1231 1228 { 1232 recalculate_data(pThis , false);1229 recalculate_data(pThis); 1233 1230 } 1234 1231 } … … 2817 2814 SSMR3GetU16(pSSM, &pThis->vbe_regs[i]); 2818 2815 if (version_id <= VGA_SAVEDSTATE_VERSION_INV_VHEIGHT) 2819 recalculate_data(pThis , false);/* <- re-calculate the pThis->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] since it might be invalid */2816 recalculate_data(pThis); /* <- re-calculate the pThis->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] since it might be invalid */ 2820 2817 SSMR3GetU32(pSSM, &pThis->vbe_start_addr); 2821 2818 SSMR3GetU32(pSSM, &pThis->vbe_line_offset);
Note:
See TracChangeset
for help on using the changeset viewer.