X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=ncpu_debug.c;h=9736204b4382d8b6d3f90ecedd4776aca5033c02;hp=cc78ae6da9825f3cead4e78c9b99973787dfccb1;hb=c4980f9edd806014286d57aee1cbe5e73b803e46;hpb=0b65fdb3548fd54670265adfb80706e63da6b641 diff --git a/ncpu_debug.c b/ncpu_debug.c index cc78ae6..9736204 100644 --- a/ncpu_debug.c +++ b/ncpu_debug.c @@ -11,6 +11,7 @@ extern uint32 pc_base; extern uint8 nes_internal_ram[0x800]; extern uint32 timestamp_a; extern uint32 framecount; +extern X6502 X_; static uint32 framecount_d; uint32 PC_prev = 0xcccccc, OP_prev = 0xcccccc; int32 g_cnt = 0; @@ -22,11 +23,14 @@ uint32 dwrites_c[2], dwrites_a[2]; int dread_count_c, dread_count_a, dwrite_count_c, dwrite_count_a; int mapirq_cyc_c, mapirq_cyc_a; +extern void DumpEmptyCartMapping(void); + static void leave(void) { printf("\nA: %02x, X: %02x, Y: %02x, S: %02x\n", X.A, X.X, X.Y, X.S); printf("PC = %04x, OP=%02X\n", PC_prev, OP_prev); printf("rest = %08x\n", nes_registers[4]); + DumpEmptyCartMapping(); exit(1); } @@ -107,6 +111,12 @@ static void compare_state(void) fail = 1; } +/* + if (X_.DB != X.DB) { + printf("DB: %02x vs %02x\n", X_.DB, X.DB); + fail = 1; + } +*/ if (fail) leave(); } @@ -170,8 +180,6 @@ void X6502_Run_d(int32 c) TriggerIRQ_a(); } if (pending_irq & 0xff) { - TriggerIRQ_c(); - TriggerIRQ_a(); X6502_IRQBegin_c(pending_irq & 0xff); X6502_IRQBegin_a(pending_irq & 0xff); }