/***********************************************\ ??? dkprof.c ? profiling functions ? also see perf.asm and pentium.asm \***********************************************/ #include "duck_mem.h" #include "dkprof.h" #define MAX_PROFILE 15 int profStarted = 0; enum PROFILESECTION { LOSSLESSDX = 0, PLANARDX, BLITME, RD_FRAME_DESC, RASTER_CONFIG, DELTA_TABLES, HANDLER_CONFIG, STRING_DECODER, STRING_DATA, TSC0, TSC1, TSC2, TSC3 }; PSECTION pSectionArray[MAX_PROFILE]; unsigned long pentiumKiloCycles(void); #if 1 /***********************************************/ void tscStart(enum PROFILESECTION sel) { PSECTION *pSection; if(profStarted) { pSection = &pSectionArray[sel]; pSection->pkc1 = pentiumKiloCycles(); } } /***********************************************/ void tscEnd(enum PROFILESECTION sel) { PSECTION *pSection; if(profStarted) { pSection = &pSectionArray[sel]; pSection->pkc2 = pentiumKiloCycles(); pSection->pkc2 = (pSection->pkc2 - pSection->pkc1); pSection->avgKc += pSection->pkc2; pSection->numTimes += 1; if(pSection->pkc2 < pSection->minKc) pSection->minKc = pSection->pkc2; if(pSection->pkc2 > pSection->maxKc) pSection->maxKc = pSection->pkc2; } } /***********************************************/ void tscInit() { int i; for(i=0; i