From 72eab717f5a2ed9b57f7c87d7c1e2503e78f8832 Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 11 Aug 2009 06:15:06 +0000 Subject: [PATCH] newppu: fix mappers that used PPU_hook, a truly haphazard system. I am calling PPU_hook far more often than the old ppu for these games, but i would expect the PPU_hook handlers to be resilient against that. --- src/ppu.cpp | 4 ++++ src/ppu.h | 2 ++ 2 files changed, 6 insertions(+) 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];