+@ the nasty MapIRQHook thing from FCE..
+@ test Gradius 2 (J) if you change this
+do_irq_hook:
+ @ ((cycles >> 4) * 43) >> 7; // aproximating /= 48
+ ldr r1, [REG_OP_TABLE, #OTOFFS_IRQH_CYC]
+ str REG_CYCLE, [REG_OP_TABLE, #OTOFFS_IRQH_CYC]
+ mov r0, #43
+ sub r1, r1, REG_CYCLE
+ mul r0, r1, r0
+ mov r0, r0, lsr #11
+
+#ifndef DEBUG_ASM_6502
+ @ I have reviewed all MapIRQHook functions, they only seem to cause IRQs, not messing cycles or something
+ str REG_P_REST, [REG_OP_TABLE, #(OTOFFS_NES_REGS + 0x10)] @ might set irq
+ mov REG_P_REST, lr @ r8
+
+ @ if somebody modifies MapIRQHook without calling reset, we are doomed
+ mov lr, pc
+ ldr pc, [REG_OP_TABLE, #OTOFFS_IRQ_HOOK]
+
+ ldr REG_OP_TABLE, =cpu_exec_table @ got trashed because was in r12
+ mov lr, REG_P_REST
+ ldr REG_P_REST, [REG_OP_TABLE, #(OTOFFS_NES_REGS + 0x10)] @ might set irq
+#else
+ ldr r1, =mapirq_cyc_a
+ str r0, [r1]
+ mov r1, r0
+#endif
+ bx lr
+
+