Lime-3DS-Emulator
Lime-3DS-Emulator copied to clipboard
SendKey & SendSignal over rpc server
Hi, I added two methods to rpc server:
SendKey: emulate a key pressSendSignal: callsystem.SendSignalto control system state. This is needed to reset the game.
I developed these features for a bot I'm building. Sorry for the bad c++ but I works mainly with C# 😊
Could you please describe what this does and how it can be tested? I am unfamiliar with the RPC side of Citra.
RPC server is a simple UDP socket opened by emulator which allows external applications to interact with games.
Before this PR only 2 methods were implemented: ReadMemory and WriteMemory.
These functions allows to read/write memory in real-time; this limits the scripting behaviour to actions where memory is involved.
I added 2 methods that cover all other cases:
SendKeyto emulate a key press event. Maybe this can be reworked to send directly the 3DS button instead of a keyboard key.SendSignalto allow emulation control. Example usage: reset game for shiny hunting in pokemon games
FYI, adding input_common as one of the target_link_libraries in src/tests/CMakeLists.txt will fix the undefined symbol errors in the failing builds, although I don't know if there's a better way to link in the missing library into the tests executable.
Edit: Or maybe not. It's certainly still failing on Android because input_common relies in part on SDL and SDL isn't used for the Android build. Guard rails may be needed to detect the type of build and whether or not to include the new code (ex. #ifndef _ANDROID_).
Edit 2: I'm also getting undefined errors on Linux using Clang 18 and no precompiled headers (i.e. the Fresh build) even after linking in input_common. Weird thing is that it doesn't happen on Linux with GCC 14 and no pch; all the builds that use pch finish successfully. I don't know how to fix this. 🤷♂️
@ProH4Ck I figured it out. Rather than linking input_common into tests, it needs to be linked into lime_core instead.
I've submitted a PR against your dev branch with the fixes. Once you merge it in, this PR will pass the build checks and it'll be ready for final review.
Marking as a draft until the issues are addressed.
Rebased for Azahar in #601