kwartzlab makerspace

Feb
25

Tamagotchi Items

By

The one feature of Tamagotchi figures I haven’t looked at yet is items. When a figure is attached, Tamagotchis can buy items at shops and use them. Items vary vastly in what they can do, from headphones that cause your Tamagotchi to dance around in headphones until you remove the figure to refrigerators that make your Tamagotchi less hungry when they eat from them to vacations that show a clip of your Tamagotchi seeing the sights.

USA Tour Item

I took my Tamagotchi to see the statue of Lincoln. What did you do for your Tamagotchi today?

 Fortunately, the second wave of Tamagotchi figures contain flash, instead of mask ROM, so I was able to program a figure directly.

Wave Two Figure Base

Ignore the wire, these can be reprogrammed without modification

I attached wires to a Tamagotchi case, and used my Arduino to reprogram the flash.

Flash Programmer

This made testing the figure ROM format much easier, as the flash was much less finicky than my flash-simulation rig, and I could use the figure on any Tamagotchi, not just one with the lines broken out.

After _much_ testing, I figured out that items are implemented using an interpreted byte code. Each ‘instruction’ is 6 bytes long. The format is as follows:

Byte Comment
0 This byte contains the ‘address’ of what is being loaded

  • The number of the image to be loaded (starting with the first item image), for an image
  • The number of the sprite to be loaded for a sprite
  • 0xFE for a sound
1 This byte contains the type of what is being loaded. Why it isn’t at byte 0, I have no idea

  • 0×80 for an image
  • 0×00 for the sprite
  • 0xFF for a sound
2 This byte contains data based on the type

  • The sound code for a sound
  • The x co-ordinate of an image or sprite
3 This byte contains data based on the type

  • 0×00 for a sound
  • The y co-ordinate of an image or sprite
4 This byte contains data based on the type

  • 0×00 for a sound
  • Unknown (but used) for an image or sprite
5 This byte contains data based on the type

  • 0×00 for a sound
  • The amount of time an image or sprite will be displayed

This isn’t comprehensive, there are still a few functions I am not sure how to do. For example, some items will give the Tamagotchi points or make them less hungry. There are likely different types for these. That said, this info was enough to make my Tamagotchi do the Harlem Shake:

The audio on the video is a bit off, though, and this is due to limitations on the audio capabilities of the bytecode format (but not that Tamagotchi hardware). I’ll explore this further in a future post.