diff --git a/src/ppu.cpp b/src/ppu.cpp index 3e971add..4feb6c8f 100644 --- a/src/ppu.cpp +++ b/src/ppu.cpp @@ -401,6 +401,8 @@ int FCEUPPU_GetAttr(int ntnum, int xt, int yt) { inline void FFCEUX_PPUWrite_Default(uint32 A, uint8 V) { uint32 tmp = A; + if(PPU_hook) PPU_hook(A); + if(tmp<0x2000) { if(PPUCHRRAM&(1<<(tmp>>10))) @@ -429,6 +431,8 @@ inline void FFCEUX_PPUWrite_Default(uint32 A, uint8 V) { uint8 FASTCALL FFCEUX_PPURead_Default(uint32 A) { uint32 tmp = A; + if(PPU_hook) PPU_hook(A); + if(tmp<0x2000) { return VPage[tmp>>10][tmp]; diff --git a/src/ppu.h b/src/ppu.h index 0af19aad..c74a31d9 100644 --- a/src/ppu.h +++ b/src/ppu.h @@ -27,6 +27,8 @@ uint8* FCEUPPU_GetCHR(uint32 vadr, uint32 refreshaddr); void PPU_ResetHooks(); extern uint8 (FASTCALL *FFCEUX_PPURead)(uint32 A); extern void (*FFCEUX_PPUWrite)(uint32 A, uint8 V); +extern uint8 FASTCALL FFCEUX_PPURead_Default(uint32 A); +void FFCEUX_PPUWrite_Default(uint32 A, uint8 V); extern int scanline; extern uint8 PPU[4];