Changeset 32978 in vbox
- Timestamp:
- Oct 7, 2010 2:11:18 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r32974 r32978 6151 6151 } 6152 6152 6153 /** 6154 * Adjust VBE mode information 6155 * 6156 * Depending on the configured VRAM size, certain parts of VBE mode 6157 * information must be updated. 6158 * 6159 * @param pThis The device instance data. 6160 * @param pMode The mode information structure. 6161 */ 6162 static void vgaAdjustModeInfo(PVGASTATE pThis, ModeInfoListItem *pMode) 6163 { 6164 int nPages; 6165 6166 /* The "number of image pages" is really the max page index... */ 6167 nPages = pThis->vram_size / (pMode->info.YResolution * pMode->info.BytesPerScanLine) - 1; 6168 Assert(nPages); 6169 if (nPages > 255) 6170 nPages = 255; /* 8-bit value. */ 6171 pMode->info.NumberOfImagePages = nPages; 6172 pMode->info.LinNumberOfPages = nPages; 6173 } 6153 6174 6154 6175 /** … … 6165 6186 uint32_t cyReduction; 6166 6187 uint32_t cbPitch; 6167 int nPages;6168 6188 PVBEHEADER pVBEDataHdr; 6169 6189 ModeInfoListItem *pCurMode; … … 6569 6589 continue; 6570 6590 *pCurMode = mode_info_list[i]; 6591 vgaAdjustModeInfo(pThis, pCurMode); 6571 6592 pCurMode++; 6572 6593 } … … 6674 6695 6675 6696 /* adjust defaults */ 6676 /* The "number of image pages" is really the max page index... */6677 nPages = pThis->vram_size / (cy * cbPitch) - 1;6678 Assert(nPages);6679 if (nPages > 255)6680 nPages = 255; /* 8-bit value. */6681 6697 pCurMode->info.XResolution = cx; 6682 6698 pCurMode->info.YResolution = cy; 6683 6699 pCurMode->info.BytesPerScanLine = cbPitch; 6684 6700 pCurMode->info.LinBytesPerScanLine = cbPitch; 6685 pCurMode->info.NumberOfImagePages = nPages; 6686 pCurMode->info.LinNumberOfPages = nPages; 6701 vgaAdjustModeInfo(pThis, pCurMode); 6687 6702 6688 6703 /* commit it */
Note:
See TracChangeset
for help on using the changeset viewer.

