From: Spacy <sp...@us...> - 2006-08-25 14:13:41
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8786/src Modified Files: GBA.cpp GBA.h Log Message: Applied patch [ 1044856 ] Enable profiling multiple regions of memory. by Rib Rdb - ribrdb Index: GBA.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/GBA.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** GBA.cpp 25 Aug 2006 13:30:08 -0000 1.69 --- GBA.cpp 25 Aug 2006 14:13:38 -0000 1.70 *************** *** 105,112 **** int profilingTicks = 0; int profilingTicksReload = 0; ! static char *profilBuffer = NULL; ! static int profilSize = 0; ! static u32 profilLowPC = 0; ! static int profilScale = 0; #endif --- 105,109 ---- int profilingTicks = 0; int profilingTicksReload = 0; ! static profile_segment *profilSegment = NULL; #endif *************** *** 502,511 **** #ifdef PROFILING ! void cpuProfil(char *buf, int size, u32 lowPC, int scale) { ! profilBuffer = buf; ! profilSize = size; ! profilLowPC = lowPC; ! profilScale = scale; } --- 499,505 ---- #ifdef PROFILING ! void cpuProfil(profile_segment *seg) { ! profilSegment = seg; } *************** *** 4275,4284 **** if(profilingTicks <= 0) { profilingTicks += profilingTicksReload; ! if(profilBuffer && profilSize) { ! u16 *b = (u16 *)profilBuffer; ! int pc = ((reg[15].I - profilLowPC) * profilScale)/0x10000; ! if(pc >= 0 && pc < profilSize) { b[pc]++; } } } --- 4269,4284 ---- if(profilingTicks <= 0) { profilingTicks += profilingTicksReload; ! if(profilSegment) { ! profile_segment *seg = profilSegment; ! do { ! u16 *b = (u16 *)seg->sbuf; ! int pc = ((reg[15].I - seg->s_lowpc) * seg->s_scale)/0x10000; ! if(pc >= 0 && pc < seg->ssiz) { b[pc]++; + break; } + + seg = seg->next; + } while(seg); } } Index: GBA.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/GBA.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** GBA.h 24 Jun 2006 20:21:47 -0000 1.23 --- GBA.h 25 Aug 2006 14:13:38 -0000 1.24 *************** *** 123,127 **** extern bool CPUIsZipFile(const char *); #ifdef PROFILING ! extern void cpuProfil(char *buffer, int, u32, int); extern void cpuEnableProfiling(int hz); #endif --- 123,128 ---- extern bool CPUIsZipFile(const char *); #ifdef PROFILING ! #include "prof/prof.h" ! extern void cpuProfil(profile_segment *seg); extern void cpuEnableProfiling(int hz); #endif |