mapper fixes for ncpu, debug is broken atm
[fceu.git] / input.c
diff --git a/input.c b/input.c
index 40c0ff8..dc48c71 100644 (file)
--- a/input.c
+++ b/input.c
 #include "input.h"
 #include "movie.h"
 
+#ifdef DEBUG_ASM_6502
+extern int cpu_repeat;
+extern int cpu_lastval;
+#endif
+
 extern INPUTC *FCEU_InitZapper(int w);
 extern INPUTC *FCEU_InitPowerpad(int w);
 extern INPUTC *FCEU_InitArkanoid(int w);
@@ -97,6 +102,9 @@ static DECLFR(JPRead)
 {
        uint8 ret=0;
 
+#ifdef DEBUG_ASM_6502
+       if (cpu_repeat) return cpu_lastval;
+#endif
        if(JPorts[A&1]->Read)
         ret|=JPorts[A&1]->Read(A&1);
 
@@ -105,6 +113,9 @@ static DECLFR(JPRead)
          ret=FCExp->Read(A&1,ret);
 
        ret|=X.DB&0xC0;
+#ifdef DEBUG_ASM_6502
+//     cpu_lastval=ret;
+#endif
        return(ret);
 }