Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[WIP] Implement GameCube pedometer SI device #8086
This is a rebase of #7615, as the developer is no longer interested in working on it. For the sake of reference, I'll copy the information here.
The GameCube game Ohenro-san: Hosshin no Dojo came bundled with a pedometer that plugs into the 4th controller port. This implements the basics of the pedometer as an SI device. It's enough to get the game to register the emulated device:
End copied information.
It's currently not possible to interact with the device, but this at least allows the game to proceed past the opening, as it won't if it cannot detect the device. I'm not sure if any usual method of interaction (keyboard/mouse, controller, etc.) is really useful for this anyways, given that it's a pedometer. Perhaps we could hook it up to Google Fit or something?
Pinging @JMC47 to test this again to make sure it works.
This is all the research I managed to compile back in December:
It's pretty straightforward to emulate as an SI device. Just feed it values via the buffer and it'll populate them in the game when it checks. I didn't feel like continuing the old PR because I don't think I can make most of the changes I wanted to (reading settings from a .ini file, and updating them via GUI stuff).
One thing I will note: I could not get Dolphin to write data back to the pedometer. The game didn't seem to send any data after the initial reading. On real hardware though, it works just fine.
@Techjar Hmm... Did the timestamps on these comments get messed up?
Anyway, if some of the values still don't make sense, which ones are they? The notes I posted cover every category the game checks for. That is to say, in the above screenshots, you can correctly manipulate the values of every textbox. I verified them by changing each byte of the buffer individually and observing what values they affected. There shouldn't be anything left to reverse-engineer in that regard (besides making a table of values/characters for the name section). The order of the bytes in the buffer does look weird, but that's how they're set up.
@shonumi Well I can't make any sense of the name bytes, any values I put there besides zero just crash the game. I tried various possible character encodings in different byte orders, so they must be some custom encoding or something. The steps value bytes were totally wrong, and after randomly poking at it I've found that it's
Also, the integers are stored as big endian, rather than little endian as your document suggests. This makes sense given that PowerPC is a big endian architecture.
Yeah, GitHub is having some weird issues with comments right now.
Huh, that's weird, but you're right. My notes are wrong. I can make new notes on all the correct offsets (assuming you haven't done it already).
Also, about data from hardware, I thought I had correctly pulled stuff from the pedometer via some homebrew I worked on, but it appears that was probably garbage data (especially now with this). I did poke Dolphin to see what all the bytes were supposed to mean but I suppose something went horribly wrong during my testing there as well.
I'd be willing to run more hardware tests, but I'm not still not all that familiar on how to work with SI in devkitPro. Maybe someone with more experience can help?