From 643f18d28bac1d4bf671a6aca4626490345f214e Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 2 Mar 2013 22:35:10 +1100 Subject: [PATCH] Added direct GameCube controller commands to the Serial Interface emulation. Fixes the controls in MaxPlay Classic Games Volume 1 and the Action Replay disc. --- Data/User/GameConfig/GNHE5d.ini | 4 ++-- Source/Core/Core/Src/HW/SI_DeviceGCController.cpp | 15 ++++++++++++++- Source/Core/Core/Src/HW/SI_DeviceGCController.h | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Data/User/GameConfig/GNHE5d.ini b/Data/User/GameConfig/GNHE5d.ini index a9ba54d048..a1c2082fde 100644 --- a/Data/User/GameConfig/GNHE5d.ini +++ b/Data/User/GameConfig/GNHE5d.ini @@ -3,8 +3,8 @@ #Values set here will override the main dolphin settings. [EmuState] #The Emulation State. 1 is worst, 5 is best, 0 is not set. -EmulationStateId = 1 -EmulationIssues = +EmulationStateId = 4 +EmulationIssues = Enable the GameCube BIOS to allow the game to boot. [OnFrame] +$Nop Hack 0x80025BA0:dword:0x60000000 diff --git a/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp b/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp index 8c4c562b82..f6af63da53 100644 --- a/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp +++ b/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp @@ -69,6 +69,19 @@ int CSIDevice_GCController::RunBuffer(u8* _pBuffer, int _iLength) *(u32*)&_pBuffer[0] = SI_GC_CONTROLLER; break; + case CMD_DIRECT: + { + INFO_LOG(SERIALINTERFACE, "PAD - Direct (Length: %d)", _iLength); + u32 high, low; + GetData(high, low); + for (int i = 0; i < (_iLength - 1) / 2; i++) + { + _pBuffer[0 + i] = (high >> (i * 8)) & 0xff; + _pBuffer[4 + i] = (low >> (i * 8)) & 0xff; + } + } + break; + case CMD_ORIGIN: { INFO_LOG(SERIALINTERFACE, "PAD - Get Origin"); @@ -96,7 +109,7 @@ int CSIDevice_GCController::RunBuffer(u8* _pBuffer, int _iLength) default: { ERROR_LOG(SERIALINTERFACE, "unknown SI command (0x%x)", command); - PanicAlert("SI: Unknown command"); + PanicAlert("SI: Unknown command (0x%x)", command); } break; } diff --git a/Source/Core/Core/Src/HW/SI_DeviceGCController.h b/Source/Core/Core/Src/HW/SI_DeviceGCController.h index 058dde3582..b89f433331 100644 --- a/Source/Core/Core/Src/HW/SI_DeviceGCController.h +++ b/Source/Core/Core/Src/HW/SI_DeviceGCController.h @@ -31,6 +31,7 @@ private: enum EBufferCommands { CMD_RESET = 0x00, + CMD_DIRECT = 0x40, CMD_ORIGIN = 0x41, CMD_RECALIBRATE = 0x42, };