Final Fantasy I & II: Dawn of Souls/RAM map

From Data Crystal
Jump to navigation Jump to search

Chip tiny.png The following article is a RAM map for Final Fantasy I & II: Dawn of Souls.

All addresses are given in hexadecimal.

Fixed-Offset Fields

Address   Size    Description
--------  ----    -----------
02000008  2       Keys pressed on previous frame (bitfield)
0200000A  2       Frame counter for held keys (initial)
0200000C  2       Frame counter for held keys (repeat)
02000010  12      Pointers to Item, Weapon and Armor Text Tables, respectively
02000584  4       Pointer to Variable Memory base address
02001A18  4       RNG state
02002074  32      Chest state bitfield
020026CC  48*4    Player character data
020027EC  B2*4    Out-of-battle inventory (4 bytes per item)
02002AB4  4       Party Gil

Variable-Offset Fields

Other Memory:

+$573A: Acts as routine selector for $6A9A0 routine; values 00-08
+$5978: Contains pointer to Battle Memory base offset
+$59CC: Region acts as a timer for start-of-battle messages, and others

Battle Memory:

+$0450: Animation data structs for all units in battle
+$2880: Unit ID of currently selected or active character in battle
+$28E0: PC palette cycle counter increment size
+$28E5: PC Sprite tint cycle direction; 0x0 when cycling 'up' to tint value, 0x1 when cycling 'down' to default
+$3826: Step counter; increments up to 0xF, resets when a battle happens; used for encounter rates
+$48E6: If 0x0, disable palette cycling/tinting for PCs
+$48E7: Stores if battle-to-be is normal, Ambush, or Preemptive
+$48E8: Set of halfwords used by big bosses during death animations; each hw corresponds to a horizontal pixel line's offset
+$49EA: Palette tint for every PC in battle; 2 bytes each
+$49F2: Series of halfwords for each PC; current palette tint from spell aura
+$49FC: A memory pointer to do with I/O screen effects
+$4AEC: Pointer to Player Characters' data in memory
+$4AF0: Pointer to inbattle inventory
+$4AFC: Sets of four-byte ministructs, one for each PC, that indicate item usage during a combat round:
+$4B30: Pointer to list of swappable gear (by inventory slot) when re-equipping an equip slot
+$4B70: When changing equips, refers to amount of valid equippable gear
+$4B71: When changing equips, refers to the equipment slot being changed (0-4)
+$4B72: Encounter ID to load for battle
+$4B74: Battle BG ID to use for battle
+$4B76-79: List of monster species in this battle (up to 4)
+$4B7A-7B: Number monsters in battle per monster species (also counts deads)
+$4B7E: Battle config for this encounter (9 small, 4 large, 2 Large+6 small, etc)
+$4B87: Current/Selected target (Attack)
+$4B92: Current/Selected target (Item)
+$4B96: Indicates number of living monsters
+$4C90: Base offset of player unit in-battle data
  +$4CB0: Used to index to monster unit data (monsters have smaller-sozed structs, so this helps to correct for that)
+$4E10: Monster data in battle
+$4E51: Indexes to monster battle data +$41 (Monster ID)
+$5128: Animation settings for each PC (0x14 bytes each)
+$51CD: One byte for each monster: 0x01 if monster is undergoing death animation, 0x00 otherwise
+$51D8: Pointer to halfword table, one for each possible monster in battle; death animation frame counters
+$51DF: Used as subroutine index in $77BD8 routine
+$51E0: Series of 0x14-byte structs for all 4 PCs + 9 monsters indicating what happened to them from current attack
+$535A: Monster palette cycling timer? Controls the pace of monster action palette switching
+$535C: During level up, will hold character's permanent data pointer
+$5360: During level up, holds amounts stats will increase by
+$5714: Pointer to start of player data
+$90C4: Current X Position on World Map
+$90C6: Current Y Position on World Map

+$B57C: Caster's actor ID, when casting a spell
+$B57D: Spell target's actor ID