From 655f8df08034f20ced8292aa8fbbb4beb94c29e5 Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 24 Apr 2007 18:46:37 +0000 Subject: [PATCH] debug, unbreaking castlevania 3 git-svn-id: file:///home/notaz/opt/svn/fceu@109 be3aeb3a-fb24-0410-a615-afba39da0efa --- fce.c | 12 +++++++++--- ncpu_debug.c | 27 +++++++++++++++++++-------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/fce.c b/fce.c index 79aa4be..abcf10f 100644 --- a/fce.c +++ b/fce.c @@ -1190,9 +1190,15 @@ void EmLoop(void) else if(VBlankON) TriggerNMI(); - X6502_Run(256+85-12); - for(scanline=242+1;scanline 0) { + if (pending_irq) { + if (pending_irq & 0x100) { + TriggerIRQ_c(); + TriggerIRQ_a(); + } + if (pending_irq & 0xff) { + TriggerIRQ_c(); + TriggerIRQ_a(); + X6502_IRQBegin_c(pending_irq & 0xff); + X6502_IRQBegin_a(pending_irq & 0xff); + } + pending_irq = 0; + } + nes_registers[7]=1; X.count=1; @@ -158,8 +170,6 @@ void X6502_Run_d(int32 c) compare_state(); g_cnt -= 1 - X.count; if (pending_add_cycles) { - //X6502_AddCycles_c(pending_add_cycles); - //X6502_AddCycles_a(pending_add_cycles); g_cnt -= pending_add_cycles*48; pending_add_cycles = 0; } @@ -208,8 +218,9 @@ void X6502_IRQBegin_d(int w) { printf("-- IRQBegin(%02x)\n", w); - X6502_IRQBegin_c(w); - X6502_IRQBegin_a(w); + // X6502_IRQBegin_c(w); + // X6502_IRQBegin_a(w); + pending_irq |= w; } void X6502_IRQEnd_d(int w) -- 2.39.5