From: anon Date: Sun, 29 Jun 2008 02:07:15 +0000 (+0800) Subject: nagra: fix partial cpu instr cycle count X-Git-Tag: 0.9.1~52 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=23029e883eb440e32c3aaf9c29dee9a0d4ebd28d;p=sasc-ng.git nagra: fix partial cpu instr cycle count --- diff --git a/systems/nagra/cpu.c b/systems/nagra/cpu.c index a740dce..5afd70e 100644 --- a/systems/nagra/cpu.c +++ b/systems/nagra/cpu.c @@ -543,9 +543,9 @@ int c6805::Run(int max_count) ins=Get(pc++); break; } - int postCycles=0; -//XXX if(ins<=0x1F) postCycles=2; // btjt/btjf/bres/bset - AddCycles(cycles+clock_cycles[ins]-postCycles); + cycles+=clock_cycles[ins]; + int readCycles=clock_cycles[ins]>=2 ? 2:0; + AddCycles(readCycles); if(doDisAsm) { char str[8]; @@ -691,7 +691,7 @@ int c6805::Run(int max_count) } } - if(postCycles) AddCycles(postCycles); + AddCycles(cycles-readCycles); // command decoding stats[ins]++;