ot(";@ ---------- [%.4x] %s uses Op%.4x ----------\n",op,text,use);\r
}\r
\r
-void OpStart(int op, int ea)\r
+void OpStart(int op, int sea, int tea)\r
{\r
Cycles=0;\r
OpUse(op,op); // This opcode obviously uses this handler\r
ot("Op%.4x%s\n", op, ms?"":":");\r
-#if (MEMHANDLERS_NEED_PC || MEMHANDLERS_NEED_CYCLES)\r
- if (ea >= 0x10 && ea != 0x3c) {\r
-#if MEMHANDLERS_NEED_PC\r
+#if (MEMHANDLERS_NEED_PREV_PC || MEMHANDLERS_NEED_CYCLES)\r
+ if ((sea >= 0x10 && sea != 0x3c) || (tea >= 0x10 && tea != 0x3c)) {\r
+#if MEMHANDLERS_NEED_PREV_PC\r
ot(" sub r0,r4,#2\n");\r
- ot(" str r0,[r7,#0x40] ;@ Save PC\n");\r
+ ot(" str r0,[r7,#0x50] ;@ Save prev PC\n");\r
#endif\r
#if MEMHANDLERS_NEED_CYCLES\r
ot(" str r5,[r7,#0x5c] ;@ Save Cycles\n");\r
ot("\n");\r
}\r
#endif\r
+ pc_dirty = 1;\r
}\r
\r
-void OpEnd()\r
+void OpEnd(int sea, int tea)\r
{\r
+#if MEMHANDLERS_CHANGE_CYCLES\r
+ if ((sea >= 0x10 && sea != 0x3c) || (tea >= 0x10 && tea != 0x3c))\r
+ ot(" ldr r5,[r7,#0x5c] ;@ Load Cycles\n");\r
+#endif\r
ot(" ldrh r8,[r4],#2 ;@ Fetch next opcode\n");\r
ot(" subs r5,r5,#%d ;@ Subtract cycles\n",Cycles);\r
ot(" ldrge pc,[r6,r8,asl #2] ;@ Jump to opcode handler\n");\r