void ScanCode(u32 pc,CodeRegion* to) { to->start=pc; InitPipeline(); bool stop=false; u32 op_count=0; u32 SOM; while(stop==false) { op_count++; u32 opcode=IReadMem16(pc); StepPipeline(opcode); if (Scanner_FindSOM(opcode,pc,&SOM)) { //log("Scanner : SOM %d\n",SOM); pc+=SOM+2; op_count+=SOM>>1; known_pl_cycles+=SOM>>1; } else {
//TODO : Check for valid delayslot instruction void ExecuteDelayslot() { u32 op=IReadMem16(next_pc); next_pc+=2; if (op!=0) ExecuteOpcode(op); }
void Sh4_int_Run() { sh4_int_bCpuRun=true; s32 l=SH4_TIMESLICE; #if !defined(TARGET_BOUNDED_EXECUTION) do #else for (int i=0; i<10000; i++) #endif { #if !defined(NO_MMU) try { #endif do { u32 addr = next_pc; next_pc += 2; u32 op = IReadMem16(addr); OpPtr[op](op); l -= CPU_RATIO; } while (l > 0); l += SH4_TIMESLICE; UpdateSystem_INTC(); #if !defined(NO_MMU) } catch (SH4ThrownException ex) { Do_Exception(ex.epc, ex.expEvn, ex.callVect); l -= CPU_RATIO * 5; } #endif #if !defined(TARGET_BOUNDED_EXECUTION) } while(sh4_int_bCpuRun); sh4_int_bCpuRun=false; #else }