diff --git a/Source/Project64/N64 System/Mips/Mempak.cpp b/Source/Project64/N64 System/Mips/Mempak.cpp index 17ddc9f86..1e793b988 100644 --- a/Source/Project64/N64 System/Mips/Mempak.cpp +++ b/Source/Project64/N64 System/Mips/Mempak.cpp @@ -119,14 +119,7 @@ BYTE Mempak::CalculateCrc(BYTE * DataToCrc) { } void Mempak::ReadFrom(int Control, int Address, BYTE * Buffer) { - if (Address == 0x8001) { - memset(Buffer, 0, 0x20); - Buffer[0x20] = CalculateCrc(Buffer); - return; - } - Address &= 0xFFE0; - - if (Address <= 0x7FE0) { + if (Address < 0x8000) { if (hMempakFile[Control] == NULL) { LoadMempak(Control); } @@ -142,10 +135,7 @@ void Mempak::ReadFrom(int Control, int Address, BYTE * Buffer) { void Mempak::WriteTo(int Control, int Address, BYTE * Buffer) { DWORD dwWritten; - if (Address == 0x8001) { Buffer[0x20] = CalculateCrc(Buffer); return; } - - Address &= 0xFFE0; - if (Address <= 0x7FE0) { + if (Address < 0x8000) { if (hMempakFile[Control] == NULL) { LoadMempak(Control); } diff --git a/Source/Project64/N64 System/Mips/Pif Ram.cpp b/Source/Project64/N64 System/Mips/Pif Ram.cpp index 24cb47199..ab6a875db 100644 --- a/Source/Project64/N64 System/Mips/Pif Ram.cpp +++ b/Source/Project64/N64 System/Mips/Pif Ram.cpp @@ -445,7 +445,7 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command) if (Command[1] != 33) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); } } if (Controllers[Control].Present == TRUE) { - DWORD address = ((Command[3] << 8) | Command[4]); + DWORD address = ((Command[3] << 8) | Command[4] & 0xE0); switch (Controllers[Control].Plugin) { case PLUGIN_RUMBLE_PAK: @@ -471,7 +471,7 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command) if (Command[1] != 1) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); } } if (Controllers[Control].Present == TRUE) { - DWORD address = ((Command[3] << 8) | Command[4]); + DWORD address = ((Command[3] << 8) | Command[4] & 0xE0 ); switch (Controllers[Control].Plugin) { case PLUGIN_MEMPAK: Mempak::WriteTo(Control, address, &Command[5]); break; case PLUGIN_RAW: if (g_Plugins->Control()->ControllerCommand) { g_Plugins->Control()->ControllerCommand(Control, Command); } break;