From 6755343a526561326a1997b7c22dc8a401580144 Mon Sep 17 00:00:00 2001 From: jeblanchard Date: Thu, 29 May 2008 03:04:44 +0000 Subject: [PATCH] Revert #327, at least for now --- src/SConscript | 1 - src/drivers/sdl/sdl.cpp | 2 ++ src/mem-cb.cpp | 29 ----------------------------- src/mem-cb.h | 17 ----------------- src/x6502.cpp | 27 --------------------------- vc8/fceux.vcproj | 8 -------- 6 files changed, 2 insertions(+), 82 deletions(-) delete mode 100644 src/mem-cb.cpp delete mode 100644 src/mem-cb.h diff --git a/src/SConscript b/src/SConscript index 49031d28..21b4c31b 100644 --- a/src/SConscript +++ b/src/SConscript @@ -12,7 +12,6 @@ file.cpp filter.cpp ines.cpp input.cpp -mem-cb.cpp netplay.cpp nsf.cpp palette.cpp diff --git a/src/drivers/sdl/sdl.cpp b/src/drivers/sdl/sdl.cpp index 6f303c2f..9571126d 100644 --- a/src/drivers/sdl/sdl.cpp +++ b/src/drivers/sdl/sdl.cpp @@ -533,3 +533,5 @@ int FCEUD_ShowStatusIcon(void) {return 0;} int FCEUI_AviIsRecording(void) {return 0;} void FCEUI_UseInputPreset(int preset) { } bool FCEUD_PauseAfterPlayback() { return false; } +bool moviePleaseLogSavestates = false; + diff --git a/src/mem-cb.cpp b/src/mem-cb.cpp deleted file mode 100644 index 46379972..00000000 --- a/src/mem-cb.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "types.h" -#include "mem-cb.h" - -using namespace std; - -struct MEMCALLBACKS memCallbacks; -MEMCALLBACKS::~MEMCALLBACKS() -{ - delete read_cb; - delete write_cb; -} - -void FCEU_AddressReadCallback(uint32 A, readfunc cb) -{ - if (!memCallbacks. read_cb) memCallbacks. read_cb = new map; - (*memCallbacks. read_cb)[FCEU_AddressCanonicalize(A)] = cb; -} - -void FCEU_AddressWriteCallback(uint32 A, writefunc cb) -{ - if (!memCallbacks.write_cb) memCallbacks.write_cb = new map; - (*memCallbacks.write_cb)[FCEU_AddressCanonicalize(A)] = cb; -} - -uint32 FCEU_AddressCanonicalize(uint32 A) -{ - if (A >= 0x0800 && A < 0x2000) return (A & 0x07FF); - return A; -} diff --git a/src/mem-cb.h b/src/mem-cb.h deleted file mode 100644 index b777d02c..00000000 --- a/src/mem-cb.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef MEM_CB_H -#define MEM_CB_H - -#include - -void FCEU_AddressReadCallback(uint32 A, readfunc cb); -void FCEU_AddressWriteCallback(uint32 A, writefunc cb); -uint32 FCEU_AddressCanonicalize(uint32 A); - -extern struct MEMCALLBACKS -{ - std::map * read_cb; - std::map *write_cb; - ~MEMCALLBACKS(); -} memCallbacks; - -#endif diff --git a/src/x6502.cpp b/src/x6502.cpp index 7f36eaf6..367b991b 100644 --- a/src/x6502.cpp +++ b/src/x6502.cpp @@ -24,7 +24,6 @@ #include "fceu.h" #include "debug.h" #include "sound.h" -#include "mem-cb.h" X6502 X; uint32 timestamp; @@ -38,65 +37,39 @@ void FP_FASTAPASS(1) (*MapIRQHook)(int a); timestamp+=__x; \ } -static INLINE void RdRunCB(unsigned int A) -{ - if (memCallbacks.read_cb) - { - std::map::const_iterator i = - memCallbacks.read_cb->find(FCEU_AddressCanonicalize(A)); - if (i != memCallbacks.read_cb->end()) (i->second)(A); - } -} - -static INLINE void WrRunCB(unsigned int A, uint8 V) -{ - if (memCallbacks.write_cb) - { - std::map::const_iterator i = - memCallbacks.write_cb->find(FCEU_AddressCanonicalize(A)); - if (i != memCallbacks.write_cb->end()) (i->second)(A, V); - } -} - //normal memory read static INLINE uint8 RdMem(unsigned int A) { - RdRunCB(A); return(_DB=ARead[A](A)); } //normal memory write static INLINE void WrMem(unsigned int A, uint8 V) { - WrRunCB(A, V); BWrite[A](A,V); } static INLINE uint8 RdRAM(unsigned int A) { //bbit edited: this was changed so cheat substituion would work - RdRunCB(A); return(_DB=ARead[A](A)); // return(_DB=RAM[A]); } static INLINE void WrRAM(unsigned int A, uint8 V) { - WrRunCB(A, V); RAM[A]=V; } uint8 FASTAPASS(1) X6502_DMR(uint32 A) { ADDCYC(1); - RdRunCB(A); return(X.DB=ARead[A](A)); } void FASTAPASS(2) X6502_DMW(uint32 A, uint8 V) { ADDCYC(1); - WrRunCB(A, V); BWrite[A](A,V); } diff --git a/vc8/fceux.vcproj b/vc8/fceux.vcproj index 02919192..8e824892 100644 --- a/vc8/fceux.vcproj +++ b/vc8/fceux.vcproj @@ -1526,10 +1526,6 @@ RelativePath="..\src\input.h" > - - @@ -2260,10 +2256,6 @@ RelativePath="..\src\input.cpp" > - -