Changeset 65345 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jan 17, 2017 12:58:46 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r65305 r65345 1172 1172 /* Note! Using last_palette rather than palette here to preserve the VGA one. */ 1173 1173 STAM_REL_COUNTER_INC(&pThis->svga.StatRegPaletteRd); 1174 *pu32 = pThis->last_palette[offReg]; 1174 uint32_t u32 = pThis->last_palette[offReg / 3]; 1175 switch (offReg % 3) 1176 { 1177 case 0: *pu32 = (u32 >> 16) & 0xff; break; /* red */ 1178 case 1: *pu32 = (u32 >> 8) & 0xff; break; /* green */ 1179 case 2: *pu32 = u32 & 0xff; break; /* blue */ 1180 } 1175 1181 } 1176 1182 else … … 1708 1714 else if ((offReg = idxReg - SVGA_PALETTE_BASE) < (uint32_t)SVGA_NUM_PALETTE_REGS) 1709 1715 { 1710 /* Note! Using last_palette rather than palette here to preserve the VGA one. */ 1716 /* Note! Using last_palette rather than palette here to preserve the VGA one. 1717 Btw, see rgb_to_pixel32. */ 1711 1718 STAM_REL_COUNTER_INC(&pThis->svga.StatRegPaletteWr); 1712 pThis->last_palette[offReg] = (uint8_t)u32; 1719 u32 &= 0xff; 1720 uint32_t uRgb = pThis->last_palette[offReg / 3]; 1721 switch (offReg % 3) 1722 { 1723 case 0: uRgb = (uRgb & UINT32_C(0x0000ffff)) | (u32 << 16); break; /* red */ 1724 case 1: uRgb = (uRgb & UINT32_C(0x00ff00ff)) | (u32 << 8); break; /* green */ 1725 case 2: uRgb = (uRgb & UINT32_C(0x00ffff00)) | u32 ; break; /* blue */ 1726 } 1727 pThis->last_palette[offReg / 3] = uRgb; 1713 1728 } 1714 1729 else … … 2457 2472 { 2458 2473 uintptr_t const idxPal = pbSrc[x] * 3; 2459 if (( pThis->last_palette[idxPal + 2]2460 | pThis->last_palette[idxPal + 1]2461 | pThis->last_palette[idxPal + 0]) > 0xfc)2474 if ((( pThis->last_palette[idxPal] 2475 | (pThis->last_palette[idxPal] >> 8) 2476 | (pThis->last_palette[idxPal] >> 16)) & 0xff) > 0xfc) 2462 2477 bDst |= fBit; 2463 2478 fBit <<= 1; … … 2581 2596 for (uint32_t x = 0; x < cx; x++) 2582 2597 { 2583 uintptr_t const idxPal = pbSrc[x] * 3; 2584 *pu32Dst++ = RT_MAKE_U32_FROM_U8(pThis->last_palette[idxPal + 2], 2585 pThis->last_palette[idxPal + 1], 2586 pThis->last_palette[idxPal + 0], 0); 2598 uint32_t u = pThis->last_palette[pbSrc[x]]; 2599 *pu32Dst++ = u;//RT_MAKE_U32_FROM_U8(RT_BYTE1(u), RT_BYTE2(u), RT_BYTE3(u), 0); 2587 2600 } 2588 2601 pbSrc += cbSrcXorLine;
Note:
See TracChangeset
for help on using the changeset viewer.