project-slippi / Ishiiruka

GNU General Public License v2.0
330 stars 142 forks source link

Send connect codes to game during playback #413

Open Walnut356 opened 1 year ago

Walnut356 commented 1 year ago

Goes hand in hand with this PR for the gecko codes.

Sends 40 additional bytes in the Game Info Block that contain connect codes.

TL;DR this allows dashboard applications that read into dolphin's memory during playback (e.g. M'Overlay) to reliably auto-grab the port# of a specific player. This is especially helpful for replay queues where the same connect code changes ports from replay to replay

I long-posted about this in the discord, but suffice it to say the alternatives all kinda suck. The only place they currently exist in dolphin's memory at all is in the metadata element [somewhere in dolphin's heap]. The location isn't quite reliable enough to narrow down search locations and keep the scanning overhead low. Trying to find the filename (and somehow match that to the currently running game) isn't much better unless you also build your app to send the replays to dolphin in the first place.

This is my first time directly modifying the ASM and dolphin so let me know if anything needs to be changed. I was able to compile and run a replay to confirm that nothing seemed immediately broken, but I'm not sure I'd even be able to tell what broke lol.

A quick pass with Cheat Engine also confirmed that the connect code showed up within spitting distance of the display names as expected.