From e9effd99a53b1d278aba27c89e19ffd786158505 Mon Sep 17 00:00:00 2001 From: LuigiBlood Date: Tue, 15 Jul 2025 01:47:29 +0200 Subject: [PATCH] Finish N64 Mouse backport and make it actually recognized as a N64 Mouse peripheral in games --- .../Project64-core/N64System/Mips/PifRam.cpp | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/Source/Project64-core/N64System/Mips/PifRam.cpp b/Source/Project64-core/N64System/Mips/PifRam.cpp index ef2f6883a..bd0397c0b 100644 --- a/Source/Project64-core/N64System/Mips/PifRam.cpp +++ b/Source/Project64-core/N64System/Mips/PifRam.cpp @@ -453,18 +453,28 @@ void CPifRam::ProcessControllerCommand(int32_t Control, uint8_t * Command) g_Notify->DisplayError("What am I meant to do with this controller command?"); } } - if (Controllers[Control].Present != 0) + if (Controllers[Control].Present != PRESENT_NONE) { - Command[3] = 0x05; - Command[4] = 0x00; - switch (Controllers[Control].Plugin) + if (Controllers[Control].Present != PRESENT_MOUSE) { - case PLUGIN_TRANSFER_PAK: - case PLUGIN_RUMBLE_PAK: - case PLUGIN_MEMPAK: - case PLUGIN_RAW: - Command[5] = 1; break; - default: Command[5] = 0; break; + Command[3] = 0x05; + Command[4] = 0x00; + switch (Controllers[Control].Plugin) + { + case PLUGIN_TRANSFER_PAK: + case PLUGIN_RUMBLE_PAK: + case PLUGIN_MEMPAK: + case PLUGIN_RAW: + Command[5] = 1; break; + default: Command[5] = 0; break; + } + } + else //if (Controllers[Control].Present == PRESENT_MOUSE) + { + //N64 Mouse + Command[3] = 0x02; + Command[4] = 0x00; + Command[5] = 0x00; } } else