From: <fl...@us...> - 2004-02-16 00:54:21
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4010/src Modified Files: Gfx.h Log Message: More graphics optimizations Index: Gfx.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/Gfx.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Gfx.h 16 Feb 2004 00:23:47 -0000 1.8 --- Gfx.h 16 Feb 2004 00:46:42 -0000 1.9 *************** *** 167,172 **** } if((control) & 0x80) { ! u16 *screenSource = screenBase + 0x400 * (xxx>>8) + ((xxx & 255)>>3) + ((yyy>>3)*32); for(int x = 0; x < 240; x++) { u16 data = READ16LE(screenSource); --- 167,173 ---- } + int yshift = ((yyy>>3)<<5); if((control) & 0x80) { ! u16 *screenSource = screenBase + 0x400 * (xxx>>8) + ((xxx & 255)>>3) + yshift; for(int x = 0; x < 240; x++) { u16 data = READ16LE(screenSource); *************** *** 193,209 **** if(xxx == 256) { if(sizeX > 256) ! screenSource = screenBase + 0x400 + ((yyy>>3)*32); else { ! screenSource = screenBase + ((yyy>>3)*32); xxx = 0; } } else if(xxx >= sizeX) { xxx = 0; ! screenSource = screenBase + ((yyy>>3)*32); } } } else { u16 *screenSource = screenBase + 0x400*(xxx>>8)+((xxx&255)>>3) + ! ((yyy>>3)*32); for(int x = 0; x < 240; x++) { u16 data = READ16LE(screenSource); --- 194,210 ---- if(xxx == 256) { if(sizeX > 256) ! screenSource = screenBase + 0x400 + yshift; else { ! screenSource = screenBase + yshift; xxx = 0; } } else if(xxx >= sizeX) { xxx = 0; ! screenSource = screenBase + yshift; } } } else { u16 *screenSource = screenBase + 0x400*(xxx>>8)+((xxx&255)>>3) + ! yshift; for(int x = 0; x < 240; x++) { u16 data = READ16LE(screenSource); *************** *** 218,222 **** tileY = 7 - tileY; ! u8 color = charBase[tile * 32 + tileY * 4 + (tileX>>1)]; if(tileX & 1) { --- 219,223 ---- tileY = 7 - tileY; ! u8 color = charBase[(tile<<5) + (tileY<<2) + (tileX>>1)]; if(tileX & 1) { *************** *** 237,248 **** if(xxx == 256) { if(sizeX > 256) ! screenSource = screenBase + 0x400 + (yyy>>3)*32; else { ! screenSource = screenBase + (yyy>>3)*32; xxx = 0; } } else if(xxx >= sizeX) { xxx = 0; ! screenSource = screenBase + ((yyy>>3)*32); } } --- 238,249 ---- if(xxx == 256) { if(sizeX > 256) ! screenSource = screenBase + 0x400 + yshift; else { ! screenSource = screenBase + yshift; xxx = 0; } } else if(xxx >= sizeX) { xxx = 0; ! screenSource = screenBase + yshift; } } *************** *** 354,358 **** int tileY = yyy & 7; ! u8 color = charBase[tile * 64 + tileY * 8 + tileX]; line[x] = color ? (READ16LE(&palette[color])|prio): 0x80000000; --- 355,359 ---- int tileY = yyy & 7; ! u8 color = charBase[(tile<<6) + (tileY<<3) + tileX]; line[x] = color ? (READ16LE(&palette[color])|prio): 0x80000000; *************** *** 386,390 **** int tileY = yyy & 7; ! u8 color = charBase[tile * 64 + tileY * 8 + tileX]; line[x] = color ? (READ16LE(&palette[color])|prio): 0x80000000; --- 387,391 ---- int tileY = yyy & 7; ! u8 color = charBase[(tile<<6) + (tileY<<3) + tileX]; line[x] = color ? (READ16LE(&palette[color])|prio): 0x80000000; *************** *** 823,828 **** sx >= 240); else { ! u32 color = vram[0x10000 + (((c + (yyy>>3) * inc)* ! 32 + (yyy & 7) * 8 + (xxx >> 3) * 64 + (xxx & 7))&0x7FFF)]; if ((color==0) && (((prio >> 25)&3) < --- 824,829 ---- sx >= 240); else { ! u32 color = vram[0x10000 + ((((c + (yyy>>3) * inc)<<5) ! + ((yyy & 7)<<3) + ((xxx >> 3)<<6) + (xxx & 7))&0x7FFF)]; if ((color==0) && (((prio >> 25)&3) < *************** *** 861,866 **** sx >= 240); else { ! u32 color = vram[0x10000 + (((c + (yyy>>3) * inc)* ! 32 + (yyy & 7) * 4 + (xxx >> 3) * 32 + ((xxx & 7)>>1))&0x7FFF)]; if(xxx & 1) --- 862,867 ---- sx >= 240); else { ! u32 color = vram[0x10000 + ((((c + (yyy>>3) * inc)<<5) ! + ((yyy & 7)<<2) + ((xxx >> 3)<<5) + ((xxx & 7)>>1))&0x7FFF)]; if(xxx & 1) *************** *** 982,987 **** } ! int address = 0x10000 + (((c + (t>>3) * inc) * 32 ! + (t & 7) * 4 + (xxx>>3) * 32 + ((xxx & 7) >> 1))&0x7FFF); u32 prio = (((a2 >> 10) & 3) << 25) | ((a0 & 0x0c00)<<6); int palette = (a2 >> 8) & 0xF0; --- 983,988 ---- } ! int address = 0x10000 + ((((c + (t>>3) * inc)<<5) ! + ((t & 7)<<2) + ((xxx>>3)<<5) + ((xxx & 7) >> 1))&0x7FFF); u32 prio = (((a2 >> 10) & 3) << 25) | ((a0 & 0x0c00)<<6); int palette = (a2 >> 8) & 0xF0; *************** *** 1183,1188 **** yyy < 0 || yyy >= sizeY) { } else { ! u32 color = vram[0x10000 + (((c + (yyy>>3) * inc)* ! 32 + (yyy & 7) * 8 + (xxx >> 3) * 64 + (xxx & 7))&0x7fff)]; if(color) { --- 1184,1189 ---- yyy < 0 || yyy >= sizeY) { } else { ! u32 color = vram[0x10000 + ((((c + (yyy>>3) * inc)<<5) ! + ((yyy & 7)<<3) + ((xxx >> 3)<<6) + (xxx & 7))&0x7fff)]; if(color) { *************** *** 1214,1219 **** yyy < 0 || yyy >= sizeY){ } else { ! u32 color = vram[0x10000 + (((c + (yyy>>3) * inc)* ! 32 + (yyy & 7) * 4 + (xxx >> 3) * 32 + ((xxx & 7)>>1))&0x7fff)]; if(xxx & 1) --- 1215,1220 ---- yyy < 0 || yyy >= sizeY){ } else { ! u32 color = vram[0x10000 + ((((c + (yyy>>3) * inc)<<5) ! + ((yyy & 7)<<2) + ((xxx >> 3)<<5) + ((xxx & 7)>>1))&0x7fff)]; if(xxx & 1) *************** *** 1303,1308 **** if(a1 & 0x1000) xxx = sizeX - 1; ! int address = 0x10000 + (((c + (t>>3) * inc) * 32 ! + (t & 7) * 4 + (xxx>>3) * 32 + ((xxx & 7) >> 1))&0x7fff); // u32 prio = (((a2 >> 10) & 3) << 25) | ((a0 & 0x0c00)<<6); // int palette = (a2 >> 8) & 0xF0; --- 1304,1309 ---- if(a1 & 0x1000) xxx = sizeX - 1; ! int address = 0x10000 + ((((c + (t>>3) * inc)<<5) ! + ((t & 7)<<2) + ((xxx>>3)<<5) + ((xxx & 7) >> 1))&0x7fff); // u32 prio = (((a2 >> 10) & 3) << 25) | ((a0 & 0x0c00)<<6); // int palette = (a2 >> 8) & 0xF0; |