Changeset 4682 in vbox for trunk/src/VBox/Devices/Graphics
- Timestamp:
- Sep 10, 2007 5:29:10 PM (17 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r4639 r4682 1043 1043 addr = ((addr & ~1) << 1) | plane; 1044 1044 #else 1045 /* 'addr' is offset in a plane, bit 0 select the plane.1045 /* 'addr' is offset in a plane, bit 0 selects the plane. 1046 1046 * Mask the bit 0, convert plane index to vram offset, 1047 1047 * that is multiply by the number of planes, … … 1344 1344 line_offset <<= 3; 1345 1345 #ifdef VBOX 1346 if ( (s->gr[0x06] & 1) == 0)1346 if (!(s->cr[0x14] & 0x40) && !(s->cr[0x17] & 0x40)) 1347 1347 { 1348 /* Text mode. Every second byte of a plane is used. */1348 /* Word mode. Used for odd/even modes. */ 1349 1349 line_offset *= 2; 1350 1350 } … … 1979 1979 for(y = 0; y < height; y++) { 1980 1980 addr = addr1; 1981 /* CGA/MDA compatibility. Note that these addresses are all 1982 * shifted left by two compared to VGA specs. 1983 */ 1981 1984 if (!(s->cr[0x17] & 1)) { 1982 int shift; 1983 /* CGA compatibility handling */ 1984 shift = 14 + ((s->cr[0x17] >> 6) & 1); 1985 addr = (addr & ~(1 << shift)) | ((y1 & 1) << shift); 1985 addr = (addr & ~(1 << 15)) | ((y1 & 1) << 15); 1986 1986 } 1987 1987 if (!(s->cr[0x17] & 2)) { 1988 addr = (addr & ~ 0x8000) | ((y1 & 2) << 14);1988 addr = (addr & ~(1 << 16)) | ((y1 & 2) << 15); 1989 1989 } 1990 1990 #ifndef VBOX -
trunk/src/VBox/Devices/Graphics/DevVGATmpl.h
r4071 r4682 170 170 const uint8_t *s, int width) 171 171 { 172 uint32_t plane_mask, *palette, data, v ;172 uint32_t plane_mask, *palette, data, v, src_inc, dwb_mode; 173 173 int x; 174 174 175 175 palette = s1->last_palette; 176 176 plane_mask = mask16[s1->ar[0x12] & 0xf]; 177 dwb_mode = (s1->cr[0x14] & 0x40) ? 2 : (s1->cr[0x17] & 0x40) ? 0 : 1; 178 src_inc = 4 << dwb_mode; 177 179 width >>= 3; 178 180 for(x = 0; x < width; x++) { … … 193 195 ((PIXEL_TYPE *)d)[7] = palette[(v >> 0) & 0xf]; 194 196 d += BPP * 8; 195 s += 4;197 s += src_inc; 196 198 } 197 199 } … … 212 214 const uint8_t *s, int width) 213 215 { 214 uint32_t plane_mask, *palette, data, v ;216 uint32_t plane_mask, *palette, data, v, src_inc, dwb_mode; 215 217 int x; 216 218 217 219 palette = s1->last_palette; 218 220 plane_mask = mask16[s1->ar[0x12] & 0xf]; 221 dwb_mode = (s1->cr[0x14] & 0x40) ? 2 : (s1->cr[0x17] & 0x40) ? 0 : 1; 222 src_inc = 4 << dwb_mode; 219 223 width >>= 3; 220 224 for(x = 0; x < width; x++) { … … 235 239 PUT_PIXEL2(d, 7, palette[(v >> 0) & 0xf]); 236 240 d += BPP * 16; 237 s += 4;241 s += src_inc; 238 242 } 239 243 }
Note:
See TracChangeset
for help on using the changeset viewer.