]> www.vanbest.org Git - sasc-ng.git/commitdiff
nagra: add cyclecount in disasm
authorleslie <unknown>
Tue, 1 Jan 2008 13:05:34 +0000 (14:05 +0100)
committerleslie <unknown>
Tue, 1 Jan 2008 13:05:34 +0000 (14:05 +0100)
systems/nagra/cpu.c
systems/nagra/nagra2.c

index 054920ec2ace7dfc3135562cd72993c922d334c5..c84dd4d59aadf3bed498ce27647da01b178be341 100644 (file)
@@ -259,6 +259,7 @@ void c6805::SetSp(unsigned short SpHi, unsigned short SpLow)
 void c6805::SetPc(unsigned short addr, unsigned char seg)
 {
   pc=addr; cr=seg;
+  ResetCycles();
 }
 
 void c6805::PopPc(void)
@@ -413,13 +414,14 @@ int c6805::Run(int max_count)
       }
 
     if(doDisAsm && !disAsmHeader) {
-      PRINTF(disAsmLogClass,"cr:-pc- aa xx yy dr -sp- VHINZC -mem@pc- -mem@sp-");
+      PRINTF(disAsmLogClass,"cr:-pc- aa xx yy dr -sp- VHINZC -mem@pc- -mem@sp- -cycles-");
       disAsmHeader=true;
       }
-    CCLOGLBPUT("%02x:%04x %02x %02x %02x %02x %04x %c%c%c%c%c%c %02x%02x%02x%02x %02x%02x%02x%02x ",
+    CCLOGLBPUT("%02x:%04x %02x %02x %02x %02x %04x %c%c%c%c%c%c %02x%02x%02x%02x %02x%02x%02x%02x %08x ",
                cr,pc,a,x,y,dr,sp,
                cc.v?'V':'.',cc.h?'H':'.',cc.i?'I':'.',cc.n?'N':'.',cc.z?'Z':'.',cc.c?'C':'.',
-               Get(pc),Get(pc+1),Get(pc+2),Get(pc+3),Get(sp+1),Get(sp+2),Get(sp+3),Get(sp+4));
+               Get(pc),Get(pc+1),Get(pc+2),Get(pc+3),Get(sp+1),Get(sp+2),Get(sp+3),Get(sp+4),
+               clockcycles);
 
     Stepper();
     unsigned char *ex=&x;
index 671b4a2ed7c2db5bc980fe1e6486a6f98ce52a8d..ad95ccc15f95dfbc970640f7b14d92097a27d762 100644 (file)
@@ -68,7 +68,10 @@ void cN2Timer::Ctrl(unsigned char val)
 {
   if(Running()) {
     ctrl=(ctrl&~tmRUNNING) | (val&tmRUNNING);
-    if(!Running()) Stop();
+    if(!Running()) {
+      Stop();
+      PRINTF(L_SYS_EMU,"n2timer: stopped cycles=%x ctrl=%x",cycles,ctrl);
+      }
     }
   else {
     ctrl=(ctrl&~tmMASK) | (val&tmMASK);