Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implement GameCube pedometer SI device #8086

Open
wants to merge 1 commit into
base: master
from

Conversation

3 participants
@Techjar
Copy link
Contributor

commented May 8, 2019

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:

Before

After

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.

@Techjar

This comment has been minimized.

Copy link
Contributor Author

commented May 8, 2019

Upon further research, I've found that you progress through the game by taking enough steps or somesuch, so perhaps we should hook up some kind of UI for it where the user can simply enter arbitrary values.

@Techjar Techjar changed the title Implement GameCube pedometer SI device [WIP] Implement GameCube pedometer SI device May 8, 2019

@jordan-woyak

This comment has been minimized.

Copy link
Member

commented May 8, 2019

Yeah. I'm guessing the device just exposes a "number of steps"? I'd say just allow entering a static value in the UI.

@shonumi

This comment has been minimized.

Copy link
Member

commented May 8, 2019

This is all the research I managed to compile back in December:

https://gist.github.com/shonumi/258e71b31e8d55561001ea4f1dbe5661

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

This comment has been minimized.

Copy link
Contributor Author

commented May 8, 2019

@shonumi That's all helpful, but could you also provide the raw data sent by the pedometer? Some of the values don't make sense, so I need to do more reverse engineering on it.

@shonumi

This comment has been minimized.

Copy link
Member

commented May 8, 2019

@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.

@Techjar

This comment has been minimized.

Copy link
Contributor Author

commented May 8, 2019

@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 0x0C..0x0E, and the following 3 bytes (0x0F..0x11) is the meters value. The rest of the values are totally jumbled up and wrong.

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.

Hmm... Did the timestamps on these comments get messed up?

Yeah, GitHub is having some weird issues with comments right now.

@shonumi

This comment has been minimized.

Copy link
Member

commented May 8, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.