↫ back
Data Format
Many thanks to Studded, Cyanic, and Konky for their help and previous work on this data format info! Much is still unknown (at least to me) so this will hopefully be updated in the future as we learn more.
Patch Card Header (Firmware Only)
A 1024-byte header that lets the Smart be patched through a custom MicroSD card. If flashing the chip directly, this patch should be left off - when there's no header, 1024 bytes of 0xFF should be added to the end, so that the firmware is always the same size (16,777,216 bytes).
TamaSma Card Header
80 bytes total
- 2 bytes: Number of 0x1000 sectors after the header (128KB Card = 31, 1MB Card = 255, 2MB Card = 511)
- 2 bytes: Checksum of every 16-bit word from 0x1000 onwards (read words as ushorts and add them together, allowing overflow)
- 4 bytes: ID of Paired Device 1
- 4 bytes: ID of Paired Device 2
- 4 bytes: ID of Paired Device 3
- 16 bytes: Vendor ID, 16 ASCII chars (BANDAINTPD_0_0_0)
- 16 bytes: Product ID, 16 ASCII chars (TAMASUMA_TIM0000)
- 2 bytes: Card type (TamaSmaCard = 0, PromoTreasure = 1, PromoItem = 2)
- 2 Bytes: Card ID
- 2 bytes: [Empty]
- 2 bytes: Build Year
- 2 bytes: Build Month
- 2 bytes: Build Day
- 2 bytes: Build Revision
- 2 bytes: [Empty]
- 16 bytes: MD5 (MD5 hash of header bytes 0-63)
Padded with 0x00s or 0xFFs until 0x1000
Menu Strings (Firmware Only)
Starts at 0x14FFFC on Mint Smart, and 0x150116 on Anniversary Smart
- 2 bytes: Number of strings
-
Per String:
- 2 bytes: Offset, measured in 16-bit words from start of this data chunk
- 2 bytes: Offset to end of last string
-
Per String:
- String as series of 2-byte tama-encoded chars, terminating in 0x0000
Package Summary
- 2 bytes: 0x3232
- 2 bytes: Package Count
-
Per Package (16 bytes each):
- 4 bytes: Compression Flags (always 0x0000 on Smart)
- 4 bytes: Package Offset, in bytes (rounded for 32-bit alignment)
- 4 bytes: Compressed Package Size, in bytes (compression not used on Smart, so this is pretty much always the same as uncompressed size)
- 4 bytes: Uncompressed Package Size, in bytes (for data packs, this is sometimes two less than compressed package size for some reason)
Data Package
- 80 bytes: Table Offsets, 20 tables x 4 bytes each (each offset = number of 16-bit words from start of data package)
Table Data Follows:
Table 0: Font Offsets (Firmware Only)
Not defined on TamaSma cards
Table 1: Fonts (Firmware Only)
Not defined on TamaSma cards
Table 2: Particle Emitters
-
Per Particle Emitter (66 bytes each):
- 2 bytes x 33 bytes: [Unknown]
Table 3: Scene Offsets
- Every 2 bytes: Scene Offset, measured in 16-bit words from start of Scene Layer table
- Final 2 bytes: Length of Scene Layer table, measured in 16-bit words
Table 4: Scene Layer Offsets
-
Per Scene:
- Every 2 bytes: Layer Offset, measured in 16-bit words from start of Scene Layers table
Table 5: Scene Layers
-
Per Layer:
- 2 bytes Bitmask
- (if bit 0 set) 2 bytes: X Position
- (if bit 1 set) 2 bytes: Y Position
- (if bit 2 set) 2 bytes: Image ID
- (if bit 3 set) 2 bytes: [Unknown Property]
- (if bit 4 set) 2 bytes: [Unknown Property]
- (if bit 6 set) 2 bytes: Subimage Index
- (if bit 7 set) 2 bytes: [Unknown Property]
- (if bit 8 set) 2 bytes: [Unknown Property]
- (if bit 9 set) 2 bytes: [Unknown Property]
- (if bit 10 set) 2 bytes: [Unknown Property]
- (if bit 11 set) 2 bytes: [Unknown Property]
- (if bit 12 set) [Unknown Flag]
- (if bit 13 set) [Unknown Flag]
- (if bit 14 set) [Unknown Flag]
- (if bit 15 set) [Unknown Flag]
-
End of Layers in Scene:
Table 6: Strings
-
Per String:
- 2 bytes: ID
- 2 bytes: [Unknown]
- 2 bytes: [Unknown]
- 2 bytes: [Unknown]
- String as series of 2-byte tama-encoded chars, terminating in 0x0000
Table 7: String Offsets
- Every 2 bytes: Offset, measured in 16-bit words from start of Strings table
- Final 2 bytes: 0xFFFF
Table 8: ??? Offsets
- Every 2 bytes: Offset, measured in 16-bit words from start of ??? table
- Final 2 bytes: Length of ??? table, measured in 16-bit words
Table 9: ???
Seems to always be 10 entities, with only 2nd, 4th, and 9th entities having a nonzero bitmask)
-
Per Entity:
- 2 bytes: Bitmask
- (if bit 0 set) 2 bytes: Some Kind of ID
- (if bit 1 set) 2 bytes: Some Kind of ID
- (if bit 1 set) 2 bytes: Some Kind of ID
Table 10: Items
First item is always the game, except on 1996 VR Card
-
Per Item (42 bytes each):
- 2 bytes: ID
- 2 bytes: Type (Meal = 0, Snack = 1, Toy = 2, Head Accessory = 3, Face Accessory = 4, Body Accessory = 5, Hand Accessory = 6, Room = 7, Game = 8, ??? = 9)
- 20 bytes: Name, 10 tama-encoded chars
- 2 bytes: Image ID
- 2 bytes: Worn Image ID (for Accessories)
- 2 bytes: Close Image ID (for Accessories)
- 2 bytes: [Unknown]
- 2 bytes: Price
- 2 bytes: Fullness Increase (for Meals)
- 2 bytes: Happiness Increase (for Snacks)
- 2 bytes: [Unknown]
- 2 bytes: Unlocked Character, character index (for Non-Games) or Game Type (GuessingGame = 10, TimingGame = 11, MemoryGame = 12, DodgingGame = 13, ShakingGame = 14, SwipingGame = 15)
Table 11: Characters
First character is always NPC, not sure if it's actually used for anything
-
Per Character (96 bytes each):
- 2 bytes: ID
- 2 bytes: Type (First Entry = 6, All Others = 5)
- 20 bytes: Name, 10 tama-encoded chars (eg. いちごっち█████)
- 2 bytes: Profile Image ID
- 2 bytes: Icon Image ID
- 2 bytes: Frame Group ID
- 2 bytes: [Unknown]
- 12 bytes: Pronoun String, 6 tama-encoded chars (eg. わたし███)
- 12 bytes: Statement String, 6 tama-encoded chars (eg. んです███)
- 12 bytes: Question String 1, 6 tama-encoded chars (eg. んですか██)
- 12 bytes: Question String 2, 6 tama-encoded chars (eg. ですか███)
- 2 bytes: [Unknown]
- 2 bytes: [Unknown]
- 2 bytes: Global ID
- 2 bytes: Minutes Per Fullness/Happiness Loss
- 2 bytes: Minutes Per Happiness/Fullness Loss
- 2 bytes: [Unknown]
- 2 bytes: [Unknown]
- 2 bytes: Gender (Female = 0, Male = 1)
Table 12: Padding
What determines length of this table is unknown
Table 13: Graphics Node Offsets
- Every 2 bytes: Offset, measured in 32-bit double-words from start of Graphics Nodes table
- Final 2 bytes: Length of Graphics Nodes table, measured in 32-bit double-words
Table 14: Graphics Nodes
-
Per Graphics Node:
- 2 bytes: ID
- Remaining bytes: [Unknown]
Table 15: Frame Layers
-
Per Layer:
- 2 bytes: Bitmask
- (if bit 0 set) 2 bytes: X Position
- (if bit 1 set) 2 bytes: Y Position
- (if bit 2 set) 2 bytes: Subimage Index
- (if bit 4 set) 2 bytes: [Unknown]
- (if bit 5 set) 2 bytes: [Unknown]
- (if bit 8 set) 2 bytes: [Unknown]
- (if bit 9 set) 2 bytes: Layer Type (Face = 1, NPC = 2, Body = 3, Head Accessory = 4, Face Accessory = 6, Body Accessory = 8, Dirt Clouds = 9, Hand Accessory = 10)
- (if bit 10 set) 2 bytes: Image ID
Table 16: Frame Layer Offsets
- Every 4 bytes: Offset, measured in 16-bit words from start of Frame Layers table
- Final 4 bytes: Length of Frame Layers table, measured in 16-bit words
Table 17: Padding
What determines length of this table is unknown
Table 18: Frames
Every character (including the egg) gets 53 frames
-
Per Group (4 bytes)
- 2 bytes: First Layer Index *or* 0xFFFF (if frame is defined implicitly)
- 2 bytes: Layer Count
Table 19: Card ID
Sprite Package
- 4 bytes: Images Table Offset
- 4 bytes: Sprite Definitions Table Offset
- 4 bytes: Palettes Table Offset
- 4 bytes: Pixel Data Table Offset
Table Data Follows:
Table 0: Image Definitions
-
Per Image (6 bytes):
- 2 bytes: First Sprite Index
Image defintions can have multiple sub-images. Each sub-image is composed of multiple sprites, as determined by the image's width and height (below). The additional sub-image sprites are listed after the first set of sprites (see Table 1), which pushes out the next image definiton's First Sprite Index.
- 1 byte: Width, in sprites
- 1 byte: Height, in sprites
- 2 bytes: First Palette Index
Image definitions can have multiple alternate palette sets. For example, on-screen buttons have enabled and disabled palette sets. These alternate palettes are listed after the first set of palettes (see Table 2), which pushes out the next image definition's First Palette Index.
Table 1: Sprite Definitions
-
Per Sprite (8 bytes each):
- 2 bytes: Pixel Data Index
- 2 bytes: X Offset
- 2 bytes: Y Offset
-
2 bytes: Properties Bitmask
- 2 bits: Bits Per Pixel (2bpp/4 colors = 0, 4bpp/16 colors = 1, 6bpp/64 colors = 2, 8bpp/256 colors = 3; bpp > 4 can cause visual glitches)
- 2 bits: Flipped (Unflipped = 0, Flipped Horizontally = 1, Flipped Vertically = 2; unused on Smart)
- 2 bits: Width (8px = 0, 16px = 1, 32px = 2, 64px = 3)
- 2 bits: Height (8px = 0, 16px = 1, 32px = 2, 64px = 3)
- 4 bits: Palette Bank (unused on Smart)
- 2 bits: Depth (unused on Smart)
- 1 bits: Blend (unused on Smart)
- 1 bits: Quadruple (only used by firmware sprites 991-995)
Table 2: Palettes
Palettes are groups of four colors for purposes of indexing
-
Per Color (1 byte each):
- 1 bit: Transparent (Opaque = 0, Transparent = 1)
- 5 bits: Red
- 5 bits: Green
- 5 bits: Blue
Table 3: Pixel Data
-
Per Sprite (offset to start of data is defined by pixel data index * width * height * bpp / 8):
-
Every n bits, where n = bpp as defined by sprite definition: Color Index (where 0 = first color in first palette, as defined by image; color index can extend into following palettes)
TamaSma Card Footer
The TamaSma Card bin file be exactly 128kb (131,072 bytes), 1MB (1,048,576 bytes), or 2MB (2,097,152 bytes), for flashing on an appropriately-sized card. The file is padded with 0's until the final 16 bytes.
-
Last 16 bytes: 3284ab562211dcfe8e6b55ffb5107f33