X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=x6502.c;h=d81cdab46dfc56677216c8c14f0004a26c2a7828;hp=57f8a009280baa2e3169ea446edae887416bb64c;hb=e7f5287861e2da956537a6db8abb26f9a26255f8;hpb=e2d0dd92bfad989cce4270fc0ac5a712476c7c50 diff --git a/x6502.c b/x6502.c index 57f8a00..d81cdab 100644 --- a/x6502.c +++ b/x6502.c @@ -64,13 +64,21 @@ uint32 timestamp; static INLINE uint8 RdMem(unsigned int A) { int _DB1=ARead[A](A); - /*if (A >= 0x2000)*/ _DB=_DB1; #ifdef DEBUG_ASM_6502 + //_DB=_DB1; //printf("a == %x, pc == %x\n", A, _PC); + if (A >= 0x2000) { + if (A == _PC || A == _PC - 1 || A == _PC + 1) { + //printf("fr: %02x\n", _DB1); + } + _DB=_DB1; + } if (A >= 0x2000 && A != _PC && A != _PC - 1 && A != _PC + 1) { dreads[dread_count_c++] = _DB1; if (dread_count_c > 4) { printf("dread_count out of range\n"); exit(1); } } +#else + _DB=_DB1; #endif return _DB1; } @@ -92,7 +100,11 @@ static INLINE void WrMem(unsigned int A, uint8 V) static INLINE uint8 RdRAM(unsigned int A) { //return((_DB=RAM[A])); - return((_DB=RAM[A])); + int _DB1=RAM[A]; +#ifndef DEBUG_ASM_6502 + _DB=_DB1; +#endif + return _DB1; } static INLINE void WrRAM(unsigned int A, uint8 V)