Skip to content

Instantly share code, notes, and snippets.

@shonumi
Last active May 9, 2019 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shonumi/258e71b31e8d55561001ea4f1dbe5661 to your computer and use it in GitHub Desktop.
Save shonumi/258e71b31e8d55561001ea4f1dbe5661 to your computer and use it in GitHub Desktop.
Ohenro-San Pedometer Documentation
Ohenro-san Pedometer Technical Documentation 0.2
November 27, 2018
Shonumi aka D.S. Baxter
***************************************************
1. Introduction
***************************************************
Ohenro-san: Hosshin no Dojo is a Gamecube title released on April 23, 2003 by PIN Change. It was designed to virtually simulate the Ohenro pilgrimage to various temples in the Shikoku region of Japan. Unique to this game were a special, 3-button walking pad and a pedometer nicknamed "Inro-kun". This pedometer tracks real-life steps and can transfer them back to the game to update progress. The pedometer connects to the 4th controller port.
***************************************************
2. General Hardware Information
***************************************************
- Runs on a CR2032 battery. Can reset but does not shutdown.
- Tracks data such as steps taken, estimated calories burned, and total time spent since activation.
- Internally holds other data (height, weight, name, sex, and steps taken over each day of previous week).
- Has a built-in Gamecube controller port connector. Cable is exceedingly short.
***************************************************
3. Joybus Operation
***************************************************
The pedometer communicates via the Gamecube's Serial Interface and uses Joybus protocol like many other official peripherals. Its commands appear very limited. They are as follows:
0x00 - Reset/ID
0x40 - Acknowledge Data Transfer
0x60 - Data Transfer
***************************************************
4. Command 0x00 - Reset/ID
***************************************************
This command mirrors many other Joybus devices. The pedometer returns its ID. The game software typically sends this command via the SI buffer. In this case the response is 1 word (4 bytes) as follows: 0x08020000. The Joybus ID for the pedometer is therefore 0x0802.
***************************************************
5. Command 0x40 - Acknowledge Data Transfer
***************************************************
This command is always sent directly to the pedometer by writing to 0xCC006424 and then Bit 31 of SISR. It doesn't appear to have any purpose but to acknowledge the previous 0x60 command that is normally issued. The response should be 2 words long and as follows in Big Endian: 0x80030000, 0x00000000.
***************************************************
6. Command 0x60 - Data Transfer
***************************************************
This command transfer data from the pedometer to the game. 81 bytes are written to the SI buffer and transferred to the pedometer. The data sent by the game is as follows:
0x60FFFFFF
0xFFFFFF00
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x0000065A
0x00000000
The pedometer responds with another 81 bytes. This data is then translated by the game into items such as total steps taken, total meters walked, days spent on the pilgrimage, and steps and calories burned over the past 7 days.
0x00 = MUST BE ZERO
0x01 = Name Byte 1
0x02 = Name Byte 2
0x03 = Name Byte 3
0x04 = Name Byte 4
0x05 = Name Byte 5
0x06 = Name Byte 6
0x07 = Age
0x08 = Height in cm
0x09 = Weight in kg
0x0A = Sex (1 = Male, 2 = Female)
0x0B = Length of step in cm
0x0C = Total Steps Byte 3
0x0D = Total Steps Byte 2
0x0E = Total Steps Byte 1
0x0F = Total Meters Byte 3
0x10 = Total Meters Byte 2
0x11 = Total Meters Byte 1
0x15 = Days Elapsed Byte 2
0x16 = Days Elapsed Byte 1
0x17 = Steps Taken Today Byte 3
0x18 = Steps Taken Today Byte 2
0x19 = Steps Taken Today Byte 1
0x1A = Kcal Burned Today Byte 3
0x1B = Kcal Burned Today Byte 2
0x1C = kcal Burned Today Byte 1
0x1D = Steps Taken Yesterday Byte 3
0x1E = Steps Taken Yesterday Byte 2
0x1F = Steps Taken Yesterday Byte 1
0x20 = Steps Taken 2 Days Ago Byte 3
0x21 = Steps Taken 2 Days Ago Byte 2
0x22 = Steps Taken 2 Days Ago Byte 1
0x23 = Steps Taken 3 Days Ago Byte 3
0x24 = Steps Taken 3 Days Ago Byte 2
0x25 = Steps Taken 3 Days Ago Byte 1
0x26 = Steps Taken 4 Days Ago Byte 3
0x27 = Steps Taken 4 Days Ago Byte 2
0x28 = Steps Taken 4 Days Ago Byte 1
0x29 = Steps Taken 5 Days Ago Byte 3
0x2A = Steps Taken 5 Days Ago Byte 2
0x2B = Steps Taken 5 Days Ago Byte 1
0x2C = Steps Taken 6 Days Ago Byte 3
0x2D = Steps Taken 6 Days Ago Byte 2
0x2E = Steps Taken 6 Days Ago Byte 1
0x2F = Steps Taken 7 Days Ago Byte 3
0x30 = Steps Taken 7 Days Ago Byte 2
0x31 = Steps Taken 7 Days Ago Byte 1
0x32 = Kcal Burned Yesterday Byte 3
0x33 = Kcal Burned Yesterday Byte 2
0x34 = kcal Burned Yesterday Byte 1
0x35 = Kcal Burned 2 Days Ago Byte 3
0x36 = Kcal Burned 2 Days Ago Byte 2
0x37 = kcal Burned 2 Days Ago Byte 1
0x38 = Kcal Burned 3 Days Ago Byte 3
0x39 = Kcal Burned 3 Days Ago Byte 2
0x3A = kcal Burned 3 Days Ago Byte 1
0x3B = Kcal Burned 4 Days Ago Byte 3
0x3C = Kcal Burned 4 Days Ago Byte 2
0x3D = kcal Burned 4 Days Ago Byte 1
0x3E = Kcal Burned 5 Days Ago Byte 3
0x3F = Kcal Burned 5 Days Ago Byte 2
0x40 = kcal Burned 5 Days Ago Byte 1
0x41 = Kcal Burned 6 Days Ago Byte 3
0x42 = Kcal Burned 6 Days Ago Byte 2
0x43 = kcal Burned 6 Days Ago Byte 1
0x44 = Kcal Burned 7 Days Ago Byte 3
0x45 = Kcal Burned 7 Days Ago Byte 2
0x46 = kcal Burned 7 Days Ago Byte 1
The game always sends this 0x60 command first, followed by a 0x40 command.
@shonumi
Copy link
Author

shonumi commented May 9, 2019

@Techjar - This seems to be correct for PR 8086 in Dolphin. Dunno how I managed to mangle the original order so badly :(

About the character encoding/format, it looks like a custom table or something. The kana are probably in gojuuon ordering, e.g. a value of 0x1 = あ, 0x2 = い and so on. After that, the Latin alphabetic characters likely come next. I have not gotten around to creating a full chart mapping everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment