Documentation:Magical Starsign

This page contains technical documentation for Magical Starsign.

Save Data
A Magical Starsign save file contains data for three file slots. This page will follow the convention of using $ as a prefix for addresses, and 0x as a prefix for values.

Overview
The SRAM is divided into banks of data. There are three types of banks:


 * Header Bank      (0x1000 bytes). Holds data general for all three save slots.
 * Amigo Bank       (0x3000 bytes). Holds data shared across the three save slots.
 * Save Slot Banks  (0x4000 bytes each). Holds  data for each specific slot.

All banks that are in use begin with the 6-byte header

01 00 4D 56 32 20

Which stands for "MV2 " in ASCII. Data is stored in Little-Endian format, as do NDS games. All banks are duplicated and stored contigously. So, a general breakdown of a save file is as follows:


 * $0000-$0FFF  = Header Bank
 * $1000-$1FFF  = Header Bank duplicate
 * $2000-$4FFF  = Amigo Bank
 * $5000-$7FFF  = Amigo Bank duplicate
 * $8000-$BFFF  = Slot 1 Bank
 * $C000-$FFFF  = Slot 1 Bank duplicate
 * $10000-$13FFF  = Slot 2 Bank
 * $14000-$17FFF  = Slot 2 Bank duplicate
 * $18000-$1BFFF </tt> = Slot 3 Bank
 * $1C000-$1FFFF </tt> = Slot 3 Bank duplicate

Checksums
Each bank that's in use has a 2-byte checksum complement, that take into account all of the other data in the bank (including the header). This is stored at the 7th and 8th byte (right after the header) for Amigo and Save Slot Banks, and at the offset $01EC for the Header Bank.

The checksum is calculated by summing each 2-byte value in the bank (not including the checksum itself), and the complementing it with 0xFFFF. If any checksum is incorrect, the game will delete the corresponding save data.

Header Bank ($0000-$0FFF)
This bank contains some general overhead data


 * 0000-0006 (006)</tt> = Standard header
 * 0006-000B  (006)</tt> = Unclassified data
 * 000C-000F (004)</tt> = Slot 1 current play time. Should be in sync with the info at Slot Bank 1.
 * 0010-0013 (004)</tt> = Slot 1 current Bira. Should be in sync with the info at Slot Bank 1.
 * 0014-0015 (002)</tt> = Unclassified data
 * 0016-0017 (002)</tt> = Slot 1 current location ID. Should be in sync with the info at Slot Bank 1.
 * 0018-0019 (002)</tt> = Unclassified data
 * 001A-001F (006)</tt> = Slot 1 current party Formation. Should be in sync with the info at Slot Bank 1.
 * 0020-0021 (002)</tt> = Slot 1 Amigo ID.
 * 0022-002B (00A)</tt> = Unclassified data
 * 002C-002C (001)</tt> = Slot 1 Main Character Name ID (0x1= Male, 0x2 = Female)
 * 002D-002D (001)</tt> = Slot 1 Main Character Portrait ID (0x1= Male, 0x2 = Female)
 * 002E-003D (010)</tt> = Slot 1 Main Character Name
 * 003E-003F (002)</tt> = Unclassified data
 * <tt>0040-0047 (008)</tt> = Slot 1 Region
 * <tt>0048-0057 (010)</tt> = Unused data
 * <tt>0058-005B (004)</tt> = Slot 1 is used (end of Slot 1. Only takes values 0x0 or 0x1)
 * <tt>0048-0057 (010)</tt> = Unused data
 * <tt>006C-00AB (050)</tt> = Slot 2 Data
 * <tt>00AC-00FB (050)</tt> = Slot 3 Data

Amigo Id
When you start a new playthrough, a secret ID is associated with your character. This ID is used when tagging in Amigo Mode to recognize previously tagged/untagged Amigos.

Play time
The play time is stored as an unsigned int representing the number of frames elapsed. Each frame is approximately 1/60th of a second; hence, where we use integer division instead of real division,


 * Hours = total frames / 216000
 * Minutes = (total frames / 3600) % 60
 * Seconds = (total frames / 60) % 60

Amigo Bank ($2000-$4FFF )
Conains data for own letter and all received letters. Notice that this is shared for all the three save slots in a file.

Save Slot 1 Bank ($8000-$BFFF)
This bank contains all the data for Save Slot 1.


 * <tt>0008-000B  (004)</tt> = Unclassified data
 * <tt>000C-0011 (006)</tt> = Current party Formation
 * <tt>0013-001F (00C)</tt> = Current party X coordinates
 * <tt>0020-002A (00C)</tt> = Current party Y coordinates
 * <tt>002C-0037 (00C)</tt> = Current party orientations
 * <tt>0038-003F (008)</tt> = Current Battle Formation
 * <tt>0040-010F (0D0)</tt> = Character Names
 * <tt>0110-0113 (004)</tt> = Current play time
 * <tt>0114-0117 (004)</tt> = Current Bira
 * <tt>011A-049D (384)</tt> = Inventory Status
 * <tt>0518-0519 (002)</tt> = Time/Hour of day (Day/Night)
 * <tt>051C-053F (024)</tt> = Planet's orbit position
 * <tt>0780-07ED (06E)</tt> = Bestiary Flags
 * <tt>056E-0574 (007)</tt> = Encyclopedia Flags
 * <tt>0574-057A (007)</tt> = Diary Flags
 * <tt>057B-058A (010)</tt> = Map Flags
 * <tt>05BB-05BC (002)</tt> = Egg Unlocked Flags
 * <tt>0BC0-0B2F (070)</tt> = Egg Status