diff --git a/Source/Project64/N64 System/Cheat Class.cpp b/Source/Project64/N64 System/Cheat Class.cpp index 9a3d0bab9..2d77f0e71 100644 --- a/Source/Project64/N64 System/Cheat Class.cpp +++ b/Source/Project64/N64 System/Cheat Class.cpp @@ -99,11 +99,6 @@ void CCheats::LoadPermCheats (CPlugins * Plugins) } for (int CheatNo = 0; CheatNo < MaxCheats; CheatNo ++ ) { - //(((*(CPlugin*)(&*((*Plugins).m_Gfx)))).m_PluginInfo).Name - //+ (((*(CPlugin*)(&*((*Plugins).m_Gfx)))).m_PluginInfo).Name 0x038830dc "Jabo's Direct3D8 1.7.0.57-ver5" char [100] - -// + Name 0x02d66d2c "Glide64 For PJ64 (Debug): 2.0.0.3" char [100] - stdstr LineEntry; if (!g_Settings->LoadStringIndex(Rdb_GameCheatFix,CheatNo,LineEntry) || LineEntry.empty()) { @@ -150,10 +145,11 @@ void CCheats::LoadPermCheats (CPlugins * Plugins) } } -void CCheats::LoadCheats(bool DisableSelected) +void CCheats::LoadCheats(bool DisableSelected, CPlugins * Plugins) { m_CheatSelectionChanged = false; m_Codes.clear(); + LoadPermCheats(Plugins); for (int CheatNo = 0; CheatNo < MaxCheats; CheatNo ++ ) { diff --git a/Source/Project64/N64 System/Cheat Class.h b/Source/Project64/N64 System/Cheat Class.h index 5221019c6..c895aa9fc 100644 --- a/Source/Project64/N64 System/Cheat Class.h +++ b/Source/Project64/N64 System/Cheat Class.h @@ -19,9 +19,8 @@ public: bool IsCheatMessage ( MSG * msg ); void ApplyCheats ( CMipsMemory * MMU ); void ApplyGSButton ( CMipsMemory * MMU ); - void LoadCheats ( bool DisableSelected ); + void LoadCheats ( bool DisableSelected, CPlugins * Plugins ); void SelectCheats ( HWND hParent, bool BlockExecution ); - void LoadPermCheats ( CPlugins * Plugins ); inline bool CheatsSlectionChanged ( void ) const { return m_CheatSelectionChanged; } private: @@ -34,8 +33,8 @@ private: typedef std::vector CODES_ARRAY; enum { MaxCheats = 50000 }; + void LoadPermCheats ( CPlugins * Plugins ); - static int CALLBACK CheatAddProc ( HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lParam ); static int CALLBACK CheatListProc ( HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lParam ); static int CALLBACK ManageCheatsProc ( HWND hDlg,DWORD uMsg,DWORD wParam, DWORD lParam ); diff --git a/Source/Project64/N64 System/Mips/System Events.cpp b/Source/Project64/N64 System/Mips/System Events.cpp index 73be96607..402e7ed8f 100644 --- a/Source/Project64/N64 System/Mips/System Events.cpp +++ b/Source/Project64/N64 System/Mips/System Events.cpp @@ -10,9 +10,10 @@ ****************************************************************************/ #include "stdafx.h" -CSystemEvents::CSystemEvents(CN64System * System) : +CSystemEvents::CSystemEvents(CN64System * System, CPlugins * Plugins) : m_bDoSomething(false), - m_System(System) + m_System(System), + m_Plugins(Plugins) { } @@ -123,7 +124,9 @@ void CSystemEvents::ExecuteEvents ( void ) break; case SysEvent_GSButtonPressed: if (m_System->m_Cheats.CheatsSlectionChanged()) - m_System->m_Cheats.LoadCheats(false); + { + m_System->m_Cheats.LoadCheats(false, m_Plugins); + } m_System->m_Cheats.ApplyGSButton(g_MMU); break; case SysEvent_PauseCPU_FromMenu: diff --git a/Source/Project64/N64 System/Mips/System Events.h b/Source/Project64/N64 System/Mips/System Events.h index 4c202bdac..07127c908 100644 --- a/Source/Project64/N64 System/Mips/System Events.h +++ b/Source/Project64/N64 System/Mips/System Events.h @@ -54,7 +54,7 @@ class CSystemEvents typedef std::vector EventList; protected: - CSystemEvents(CN64System * System); + CSystemEvents(CN64System * System, CPlugins * Plugins); virtual ~CSystemEvents(); public: @@ -71,6 +71,7 @@ private: void ChangePluginFunc( void ); CN64System * m_System; + CPlugins * m_Plugins; EventList m_Events; BOOL m_bDoSomething; CriticalSection m_CS; diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 7686e4da4..0a300b4c9 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -15,7 +15,7 @@ #include CN64System::CN64System ( CPlugins * Plugins, bool SavesReadOnly ) : - CSystemEvents(this), + CSystemEvents(this, Plugins), m_SyncPlugins(NULL), m_SyncWindow(NULL), m_Reg(this,this), @@ -51,8 +51,7 @@ CN64System::CN64System ( CPlugins * Plugins, bool SavesReadOnly ) : m_hPauseEvent = CreateEvent(NULL,true,false,NULL); m_Limitor.SetHertz(gameHertz); g_Settings->SaveDword(GameRunning_ScreenHertz,gameHertz); - m_Cheats.LoadPermCheats(Plugins); - m_Cheats.LoadCheats(!g_Settings->LoadDword(Setting_RememberCheats)); + m_Cheats.LoadCheats(!g_Settings->LoadDword(Setting_RememberCheats), Plugins); } CN64System::~CN64System ( void ) @@ -1881,9 +1880,13 @@ void CN64System::RefreshScreen ( void ) { if ((m_Reg.STATUS_REGISTER & STATUS_IE) != 0 ) { if (g_BaseSystem == NULL) + { return; + } if (g_BaseSystem->m_Cheats.CheatsSlectionChanged()) - g_BaseSystem->m_Cheats.LoadCheats(false); + { + g_BaseSystem->m_Cheats.LoadCheats(false, g_BaseSystem->m_Plugins); + } g_BaseSystem->m_Cheats.ApplyCheats(g_MMU); } // if (bProfiling) { m_Profile.StartTimer(ProfilingAddr != Timer_None ? ProfilingAddr : Timer_R4300); }