void asm_APU_EXECUTE2(void) { if(CPU.APU_APUExecuting != 1) return; ICPU.CPUExecuting = FALSE; do { APU_EXECUTE1(); } while (CPU.APU_Cycles < CPU.NextEvent); ICPU.CPUExecuting = TRUE; }
void asm_APU_EXECUTE(void) { #ifdef __debug_c_apuex__ printf("apuexec\n"); #endif if(CPU.APU_APUExecuting != 1) return; while (CPU.APU_Cycles <= CPU.Cycles) { APU_EXECUTE1(); } }
/* get samples ---------------------------------------------------------------- */ void SPC_update(unsigned char *buf) { // APU_LOOP int c, ic; #if 1 for (c = 0; c < 2048000 / 32 / RATE; c ++) { for (ic = 0; ic < 32; ic ++) APU_EXECUTE1(); IAPU.TimerErrorCounter ++; DoTimer(); } #else for (APU.Cycles = 0; APU.Cycles < 204800 / RATE; APU.Cycles ++) { APU_EXECUTE1(); ++ IAPU.TimerErrorCounter; if ((IAPU.TimerErrorCounter & 31) == 0) DoTimer(); APURegisters.PC = IAPU.PC - IAPU.RAM; S9xAPUPackStatus(); } #endif S9xMixSamples ((unsigned char *)buf, samples_per_mix); }