From: Sébastien G. <kx...@us...> - 2004-09-15 22:13:04
|
Update of /cvsroot/vba/VisualBoyAdvance/src/sdl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28314/sdl Modified Files: SDL.cpp debugger.cpp Log Message: Added prefetch emulation. Fixed HuffUnComp BIOS emulation regarding the tree size (SourceForge #984608). Index: SDL.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/sdl/SDL.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SDL.cpp 21 May 2004 20:44:26 -0000 1.5 --- SDL.cpp 15 Sep 2004 22:12:54 -0000 1.6 *************** *** 2377,2397 **** if(sdlCalculateMaskWidth(surface->format->Gmask) == 6) { Init_2xSaI(565); - RGB_LOW_BITS_MASK = 0x821; } else { Init_2xSaI(555); - RGB_LOW_BITS_MASK = 0x421; - } - if(cartridgeType == 2) { - for(int i = 0; i < 0x10000; i++) { - systemColorMap16[i] = (((i >> 1) & 0x1f) << systemBlueShift) | - (((i & 0x7c0) >> 6) << systemGreenShift) | - (((i & 0xf800) >> 11) << systemRedShift); - } - } else { - for(int i = 0; i < 0x10000; i++) { - systemColorMap16[i] = ((i & 0x1f) << systemRedShift) | - (((i & 0x3e0) >> 5) << systemGreenShift) | - (((i & 0x7c00) >> 10) << systemBlueShift); - } } srcPitch = srcWidth * 2+4; --- 2377,2382 ---- *************** *** 2399,2411 **** if(systemColorDepth != 32) filterFunction = NULL; ! RGB_LOW_BITS_MASK = 0x010101; ! if(systemColorDepth == 32) { ! Init_2xSaI(32); ! } ! for(int i = 0; i < 0x10000; i++) { ! systemColorMap32[i] = ((i & 0x1f) << systemRedShift) | ! (((i & 0x3e0) >> 5) << systemGreenShift) | ! (((i & 0x7c00) >> 10) << systemBlueShift); ! } if(systemColorDepth == 32) srcPitch = srcWidth*4 + 4; --- 2384,2388 ---- if(systemColorDepth != 32) filterFunction = NULL; ! Init_2xSaI(32); if(systemColorDepth == 32) srcPitch = srcWidth*4 + 4; *************** *** 2414,2417 **** --- 2391,2396 ---- } + utilUpdateSystemColorMaps(); + if(systemColorDepth != 32) { switch(filter) { Index: debugger.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/sdl/debugger.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** debugger.cpp 13 May 2004 15:06:48 -0000 1.2 --- debugger.cpp 15 Sep 2004 22:12:54 -0000 1.3 *************** *** 140,143 **** --- 140,166 ---- int debuggerRadix = 0; + extern u32 cpuPrefetch[2]; + + #define ARM_PREFETCH \ + {\ + cpuPrefetch[0] = debuggerReadMemory(armNextPC);\ + cpuPrefetch[1] = debuggerReadMemory(armNextPC+4);\ + } + + #define THUMB_PREFETCH \ + {\ + cpuPrefetch[0] = debuggerReadHalfWord(armNextPC);\ + cpuPrefetch[1] = debuggerReadHalfWord(armNextPC+2);\ + } + + static void debuggerPrefetch() + { + if(armState) { + ARM_PREFETCH; + } else { + THUMB_PREFETCH; + } + } + void debuggerApplyBreakpoint(u32 address, int num, int size) { *************** *** 730,735 **** debuggerContinueAfterBreakpoint(); debuggerEnableBreakpoints(false); ! } else emulator.emuMain(1); } debuggerDisableBreakpoints(); --- 753,760 ---- debuggerContinueAfterBreakpoint(); debuggerEnableBreakpoints(false); ! } else { ! debuggerPrefetch(); emulator.emuMain(1); + } } debuggerDisableBreakpoints(); *************** *** 753,756 **** --- 778,782 ---- debuggerEnableBreakpoints(false); debugger = false; + debuggerPrefetch(); } *************** *** 1095,1098 **** --- 1121,1125 ---- printf("Continuing after breakpoint\n"); debuggerEnableBreakpoints(true); + debuggerPrefetch(); emulator.emuMain(1); debuggerAtBreakpoint = false; |