From f015f743b792574b410119dc70c746e3159ca607 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Fri, 27 Nov 2020 11:16:54 +0000 Subject: [PATCH] Add link General Purpose mode for FFTA. Remove code that unconditionally resets RFU on Windows in General Purpose mode, and instead remap two values necessary for Final Fantasy Tactics Advance. Thanks to @JackoboLeChocobo for this information. Signed-off-by: Rafael Kitover --- src/gba/GBALink.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gba/GBALink.cpp b/src/gba/GBALink.cpp index 0b18620e..b49798f3 100644 --- a/src/gba/GBALink.cpp +++ b/src/gba/GBALink.cpp @@ -708,10 +708,17 @@ void StartGPLink(uint16_t value) break; case GP: -#if (defined __WIN32__ || defined _WIN32) - if (GetLinkMode() == LINK_RFU_IPC) - rfu_state = RFU_INIT; -#endif + // General purpose mode, for circuit reset and Final Fantasy Tactics. + // Thanks to @JackoboLeChocobo for this info. + switch (value) { + case 0x8055: + value = 0x8052; + break; + case 0x8022: + value = 0x8025; + break; + } + UPDATE_REG(COMM_RCNT, value); break; } }