Skip to content

Instantly share code, notes, and snippets.

@shonumi
Last active February 7, 2022 18:27
Show Gist options
  • Save shonumi/348580c6bdd1ee53c90a44e1abd7be03 to your computer and use it in GitHub Desktop.
Save shonumi/348580c6bdd1ee53c90a44e1abd7be03 to your computer and use it in GitHub Desktop.
Ohenro-san Pedometer Technical Documentation 0.3
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. It can reset but does not shutdown until the battery is removed.
- 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).
- Also logs current time (by syncing with a Gamecube or Wii), and number of shrines visited.
- 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 the Joybus protocol like many other peripherals. Its commands appear very limited. They are as follows:
0x00 - Reset/ID
0x40 - Status
0x60 - Data Transfer
***************************************************
4. Command 0x00 - Reset/ID
***************************************************
This command mirrors many other Joybus devices. The pedometer returns its ID. The game software sends this command via the SI buffer. In this case the response is 3 bytes as follows: 0x080200. The Joybus ID for the pedometer is therefore 0x0802.
***************************************************
5. Command 0x40 - Status
***************************************************
This command is always sent directly to the pedometer by writing the value 0x00400300 to SIC3OUTBUF (0xCC006424) and then setting Bit 31 of SISR high. It appears to signal to the pedometer that the host device (the Gamecube or Wii) is ready to send or receive data. Without sending this command, the Data Transfer commands fail with the "No Response" and "Data Collision" errors. The pedometer does not generate a response for this command.
***************************************************
6. Command 0x60 - Data Transfer
***************************************************
This command transfers data to and from the pedometer. 80 bytes are written to the SI buffer and transferred to the pedometer. To grab the current data stored on the pedometer, the game sends the following "Ping Pattern":
0x60FFFFFF
0xFFFFFF00
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x00000000
0x0000065A
This specific pattern acts as a psuedo-command and essentially requests the pedometer to return its current data. The pedometer responds with 80 bytes representing data such as total steps taken, total meters walked, days spent on the pilgrimage, steps and calories burned over the past 7 days. If more than or less than 80 bytes are received, the game will ignore the transfer as invalid and wait indefinitely for a transfer with the correct number of bytes. The format of the data received from the pedometer is as follows:
---------------------------------------------------
Read Data Packet Format
---------------------------------------------------
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 (0 = Blank, 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
0x4E = MSB of 16-bit Checksum
0x4F = LSB of 16-bit Checksum
---------------------------------------------------
Data is stored MSB first for multi-byte entries other than the name field.
The checksum simply adds each invididual byte from 0x00 - 0x4D. Both the host and the pedometer calculate the checksum when sending data to each other. The game itself does not verify the checksum, however, and will happily accept whatever the pedometer sends back. The pedometer, however, will reject data sent from the host if the checksum is invalid.
To write new values to the pedometer, the host must send any data that does not match the Ping Pattern. If this condition is true, the pedometer will overwrite its current data with the new 80 bytes it receives. This is used during the initial profile setup, where user information entered in Ohenro-san is then copied onto the pedometer. The format of the data sent from the host to the pedometer is as follows:
---------------------------------------------------
Write Data Packet Format
---------------------------------------------------
0x00 = MUST BE 0x60
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
0x0B = Length of step in cm
0x17 = Pedometer Clock Hours
0x18 = Pedometer Clock Minutes
0x19 = Pedometer Clock Seconds
0x4E = MSB of 16-bit Checksum
0x4F = LSB of 16-bit Checksum
---------------------------------------------------
When writing data to the pedometer, the device will respond to a Data Transfer command with mostly updated data. The Pedometer Clock field will return the data for Steps Taken Today, however.
***************************************************
7. Character Map
***************************************************
The 6-byte name field stored on the pedometer uses 1 byte per character. The overall character map is as follows:
0x00 : 0x01 : あ 0x02 : い 0x03 : う 0x04 : え 0x05 : お 0x06 : か 0x07 : き
0x08 : く 0x09 : け 0x0A : こ 0x0B : さ 0x0C : し 0x0D : す 0x0E : せ 0x0F : そ
0x10 : た 0x11 : ち 0x12 : つ 0x13 : て 0x14 : と 0x15 : な 0x16 : に 0x17 : ぬ
0x18 : ね 0x19 : の 0x1A : は 0x1B : ひ 0x1C : ふ 0x1D : へ 0x1E : ほ 0x1F : ま
0x20 : み 0x21 : む 0x22 : め 0x23 : も 0x24 : や 0x25 : ゆ 0x26 : よ 0x27 : ー
0x28 : ~ 0x29 : ら 0x2A : り 0x2B : る 0x2C : れ 0x2D : ろ 0x2E : わ 0x2F : を
0x30 : ん 0x31 : ゐ 0x32 : ゑ 0x33 : が 0x34 : ぎ 0x35 : ぐ 0x36 : げ 0x37 : ご
0x38 : ざ 0x39 : じ 0x3A : ず 0x3B : ぜ 0x3C : ぞ 0x3D : だ 0x3E : ぢ 0x3F : づ
0x40 : で 0x41 : ど 0x42 : ば 0x43 : び 0x44 : ぶ 0x45 : べ 0x46 : ぼ 0x47 : ぱ
0x48 : ぴ 0x49 : ぷ 0x4A : ぺ 0x4B : ぽ 0x4C : ぁ 0x4D : ぃ 0x4E : ぅ 0x4F : ぇ
0x50 : ぉ 0x51 : っ 0x52 : ゃ 0x53 : ゅ 0x54 : ょ 0x55 : ゎ 0x56 : 一 0x57 : 二
0x58 : 三 0x59 : 四 0x5A : 五 0x5B : 六 0x5C : 七 0x5D : 八 0x5E : 九 0x5F : 十
0x60 0x61 : ア 0x62 : イ 0x63 : ウ 0x64 : エ 0x65 : オ 0x66 : カ 0x67 : キ
0x68 : ク 0x69 : ケ 0x6A : コ 0x6B : サ 0x6C : シ 0x6D : ス 0x6E : セ 0x6F : ソ
0x70 : タ 0x71 : チ 0x72 : ツ 0x73 : テ 0x74 : ト 0x75 : ナ 0x76 : ニ 0x77 : ヌ
0x78 : ネ 0x79 : ノ 0x7A : ハ 0x7B : ヒ 0x7C : フ 0x7D : ヘ 0x7E : ホ 0x7F : マ
0x80 : ミ 0x81 : ム 0x82 : メ 0x83 : モ 0x84 : ヤ 0x85 : ユ 0x86 : ヨ 0x87 : ヵ
0x88 : ヶ 0x89 : ラ 0x8A : リ 0x8B : ル 0x8C : レ 0x8D : ロ 0x8E : ガ 0x8F : ギ
0x90 : グ 0x91 : ゲ 0x92 : ゴ 0x93 : ザ 0x94 : ジ 0x95 : ズ 0x96 : ゼ 0x97 : ゾ
0x98 : ダ 0x99 : ヂ 0x9A : ヅ 0x9B : デ 0x9C : ド 0x9D : バ 0x9E : ビ 0x9F : ブ
0xA0 : ベ 0xA1 : ボ 0xA2 : パ 0xA3 : ピ 0xA4 : プ 0xA5 : ペ 0xA6 : ポ 0xA7 : ァ
0xA8 : ィ 0xA9 : ゥ 0xAA : ェ 0xAB : ォ 0xAC : ッ 0xAD : ャ 0xAE : ュ 0xAF : ョ
0xB0 : ワ 0xB1 : ヲ 0xB2 : ン 0xB3 : ヰ 0xB4 : ヱ 0xB5 : ヴ 0xB6 : ヮ / 1 0xB7 : 2
0xB8 : 3 0xB9 : 4 0xBA : 5 0xBB : 6 0xBC : 7 0xBD : 8 0xBE : 9 0xBF : 0
0xC0 : A 0xC1 : B 0xC2 : C 0xC3 : D 0xC4 : E 0xC5 : 0xC6 : F 0xC7 : G
0xC8 : H 0xC9 : I 0xCA : J 0xCB : K 0xCC : L 0xCD : M 0xCE : N 0xCF : O
0xD0 : P 0xD1 : Q 0xD2 : R 0xD3 : S 0xD4 : T 0xD5 : U 0xD6 : V 0xD7 : W
0xD8 : X 0xD9 : Y 0xDA : Z 0xDB : & 0xDC : ! 0xDD : 0xDE : a 0xDF : b
0xE0 : c 0xE1 : d 0xE2 : e 0xE3 : f 0xE4 : g 0xE5 : h 0xE6 : i 0xE7 : j
0xE8 : k 0xE9 : l 0xEA : m 0xEB : n 0xEC : o 0xED : p 0xEE : q 0xEF : r
0xF0 : s 0xF1 : t 0xF2 : u 0xF3 : v 0xF4 : w 0xF5 : x 0xF6 : y 0xF7 : z
0xF8 : % 0xF9 : = 0xFA : ( 0xFB : ) 0xFC : + 0xFD : • 0xFE : ? 0xFF :
Gaps in the character map are interpreted as spaces by the game. The entry 0xB6 may be interpreted as the katakana ヮ (Small Wa) or 1 depending on the context. For example, it should represent Small Wa when used to write the sounds "gwa" or "kwa" in a name, and in all other situations it should represent the ordinal number "one".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment