From 721e56c94c506bab35b0750cf60fa213f770d456 Mon Sep 17 00:00:00 2001 From: Emmet Young Date: Tue, 2 Oct 2012 17:40:14 +1000 Subject: [PATCH 1/2] Add a bitmask in FlashRam.cpp to resolve a potential loss of data error being caused in DOUBUTSU NO MORI (Animal Crossing) --- Source/Project64/N64 System/Mips/FlashRam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/N64 System/Mips/FlashRam.cpp b/Source/Project64/N64 System/Mips/FlashRam.cpp index 07b1205ea..b565e41a9 100644 --- a/Source/Project64/N64 System/Mips/FlashRam.cpp +++ b/Source/Project64/N64 System/Mips/FlashRam.cpp @@ -68,7 +68,7 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len) #endif } *((DWORD *)(dest)) = (DWORD)(m_FlashStatus >> 32); - *((DWORD *)(dest) + 1) = (DWORD)(m_FlashStatus); + *((DWORD *)(dest) + 1) = (DWORD)(m_FlashStatus &0xFFFFFFFF); break; #ifndef EXTERNAL_RELEASE default: From cf761b3f70157ed7ab138bf5e6952ecbee8c35f9 Mon Sep 17 00:00:00 2001 From: Emmet Young Date: Thu, 4 Oct 2012 00:22:13 +1000 Subject: [PATCH 2/2] Fix up the Load and Save as options by using direct calls to the LoadState and SaveState function, pausing the cpu stops the event queue from being processed from the looks of it so we get stuck on trying to load and save a state. Zilmar you might want to tell me if I'm wrong here XD --- .../Project64/N64 System/Mips/System Events.cpp | 1 - .../Project64/User Interface/Main Menu Class.cpp | 15 +++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Source/Project64/N64 System/Mips/System Events.cpp b/Source/Project64/N64 System/Mips/System Events.cpp index 9d607a7c3..f8793179a 100644 --- a/Source/Project64/N64 System/Mips/System Events.cpp +++ b/Source/Project64/N64 System/Mips/System Events.cpp @@ -37,7 +37,6 @@ void CSystemEvents::ExecuteEvents ( void ) EventList Events = m_Events; m_Events.clear(); bool bPause = false, bLoadedSave = false; - for (EventList::const_iterator iter = Events.begin(); !bLoadedSave && iter != Events.end(); iter++ ) { switch (*iter) diff --git a/Source/Project64/User Interface/Main Menu Class.cpp b/Source/Project64/User Interface/Main Menu Class.cpp index 93de7c8a9..ddfca82bb 100644 --- a/Source/Project64/User Interface/Main Menu Class.cpp +++ b/Source/Project64/User Interface/Main Menu Class.cpp @@ -148,10 +148,10 @@ bool CMainMenu::ProcessMessage(WND_HANDLE hWnd, DWORD FromAccelerator, DWORD Men openfilename.nMaxFile = MAX_PATH; openfilename.Flags = OFN_HIDEREADONLY; - _BaseSystem->ExternalEvent(SysEvent_PauseCPU_SaveGame); - + _BaseSystem->ExternalEvent(SysEvent_PauseCPU_SaveGame); if (GetSaveFileName (&openfilename)) { + _splitpath( SaveFile, drive, dir, fname, ext ); if (_stricmp(ext, ".pj") == 0 || _stricmp(ext, ".zip") == 0) { @@ -167,10 +167,8 @@ bool CMainMenu::ProcessMessage(WND_HANDLE hWnd, DWORD FromAccelerator, DWORD Men char SaveDir[MAX_PATH]; _makepath( SaveDir, drive, dir, NULL, NULL ); _Settings->SaveString(Directory_LastSave,SaveDir); - - _BaseSystem->ExternalEvent(SysEvent_SaveMachineState); + _System->SaveState(); } - _BaseSystem->ExternalEvent(SysEvent_ResumeCPU_SaveGame); } break; @@ -193,17 +191,14 @@ bool CMainMenu::ProcessMessage(WND_HANDLE hWnd, DWORD FromAccelerator, DWORD Men openfilename.nMaxFile = MAX_PATH; openfilename.Flags = OFN_HIDEREADONLY; - _BaseSystem->ExternalEvent(SysEvent_PauseCPU_LoadGame); - + _BaseSystem->ExternalEvent(SysEvent_PauseCPU_LoadGame); if (GetOpenFileName (&openfilename)) { _Settings->SaveString(GameRunning_InstantSaveFile,SaveFile); - char SaveDir[MAX_PATH], drive[_MAX_DRIVE] ,dir[_MAX_DIR], fname[_MAX_FNAME],ext[_MAX_EXT]; _splitpath( SaveFile, drive, dir, fname, ext ); _makepath( SaveDir, drive, dir, NULL, NULL ); _Settings->SaveString(Directory_LastSave,SaveDir); - - _BaseSystem->ExternalEvent(SysEvent_LoadMachineState); + _System->LoadState(); } _BaseSystem->ExternalEvent(SysEvent_ResumeCPU_LoadGame); }