If you are still using the old URL (datacrystal.romhacking.net), please update your bookmarks! The old URL may stop working soon.
The current URL is datacrystal.tcrf.net.
The current URL is datacrystal.tcrf.net.
Arcana/RAM map
< Arcana
Jump to navigation
Jump to search
(Back to Main page)
- The list corresponds to RAM variables used by the game engine. They are generally accessed by LDA and STA instructions.
Main Loop
- $1049: Pointer to indirect function calls (JMP [$1049])
- $1E10: Event pointer, used for reading most of the game's code (LDA [$10]) (long ptr)
- $1E14: Event pointer stack, stores return addresses during function calls
Temporary Arrays
Typically these are accessed i.e. LDA $09C7,x where the x register is determined at runtime.
- $0643-065B: Enemies in battle (Enemy ID + 18), set to FFFF when killed
- $09A3-09BB: ??
- $09C7-09DF: Miscellaneous return values (i.e. type of treasure contents, item/spell/enemy chosen)
- $09EB-0A03: Current selection (Attacker ID, caster ID, whose turn is it etc)
- $0A0F-0A27: Target (ID being attacked, treasure chest being opened)
- $0B9F,x: Stores function results (0=failure)
- $0CB3,x: Stores function results (0=failure)
Battle
- $0A87-$0A8E: Current selected battle command (2 bytes per character)
- #$0001: Main menu
- #$0003: Items/Magic
- #$0004: Cards
- #$0005: Weapons
- #$0008: Attack
- $1121: Attacker
- $1123: Target
- $1127: Spell ID
- $11C1: Battle state (00=not fighting/can move, 02=battle poses, )
- $11C3: Status/Condition (a series of words in the order: Rooks, Spirit, Guest1, Guest2, Enemies 1-8)
- Odd byte:
- #$00: Satisfactory
- #$01: Deceased
- #$02: Not Here
- #$03: Paralyzed
- #$04: Petrified
- #$05: Confused
- #$06: Sleeping
- Even byte: #$01 indicates a party member
- Odd byte:
- $11F3-11FA: Order that spells hit the party (2 bytes per character)
- #$0000: Upper left
- #$0001: Upper right
- #$0002: Lower left
- #$0003: Lower right
- $120B: Rooks' Element/Race
- $120D: Spirit's Element/Race
- $120F: Guest1's Element/Race
- $1212: Guest2's Element/Race
- $1214: Enemy1's Element/Race
- Bytes continue with Enemy2-8 in order
- $1223: Rooks' Strength
- $1225: Spirit's Strength
- $1227: Guest1's Strength
- $1229: Guest2's Strength
- $122B: Enemy1's Strength (table offset?)
- Bytes continue with Enemy2-8 in order
- $123B: Rooks' Intelligence (reduces magic damage taken)
- $123D: Spirit's Intelligence
- $123F: Guest1's Intelligence
- $1241: Guest2's Intelligence
- $1243: Monsters' Intelligence (affects spell damage)
- Bytes continue with Enemy2-8 in order
- $1253: Rooks' Endurance (reduces physical damage taken)
- $1255: Spirit's Endurance
- $1257: Guest1's Endurance
- $1259: Guest2's Endurance
- $125B: Enemy1's Endurance
- Bytes continue with Enemy2-8 in order
- $126B: Rooks' Alertness (affects accuracy, evasion and critical hits)
- $126D: Spirit's Alertness
- $126F: Guest1's Alertness
- $1271: Guest2's Alertness
- $1273: Enemy1's Alertness
- Bytes continue with Enemy2-8 in order
- $1283: Equipped weapons
- Two bytes each, in order of Rooks, Guest 1 and Guest 2.
- item ID / "Equipped by" flag
- "Equipped by" flags:
- #$00: Rooks
- #$05: Teefa
- #$06: Salah
- #$07: Darwin
- #$08: Axs
- Two bytes each, in order of Rooks, Guest 1 and Guest 2.
- $129B: Equipped armors
- $12B3: Equipped shields/accessories
- $12CB: Equipped rings
- $12E3: Accuracy modifier (concerns Acc. Increase All and Accuracy Impair)
- There are 3 possible states: StatDown, Normal and StatUp. StatUp and StatDown cancel each other out.
- Byte values are as follows:
- #$01: Rooks' accuracy up
- #$04: Spirit's accuracy up
- #$10: Guest1's accuracy up
- #$40: Guest2's accuracy up
- #$02: Rooks' accuracy down
- #$08: Spirit's accuracy down
- #$20: Guest1's accuracy down
- #$80: Guest2's accuracy down
- $12E5: Accuracy modifier (enemies)
- $12E7: Evasion modifier (concerns Dodge All and Offense Impair) (same flags)
- $12E9: Evasion modifier (enemies)
- $12EB: Attack modifier (concerns Stomp All and Attack Impair) (same flags)
- $12ED: Attack modifier (enemies)
- $12EF: Defense modifier (concerns Wall All and Defense Impair) (same flags)
- $12F1: Defense modifier (enemies)
- $12F3: Current HP, Rooks
- $12F5: Current HP, Spirit
- $12F7: Current HP, Guest1
- $12F9: Current HP, Guest2
- $12FB: Current HP, Enemy1
- $12FD: Current HP, Enemy2
- $12FF: Current HP, Enemy3
- $1301: Current HP, Enemy4
- $1303: Current HP, Enemy5
- $1305: Current HP, Enemy6
- $1307: Current HP, Enemy7
- $1309: Current HP, Enemy8
- $130B: Copy of Current HP, Rooks
- $130D: Copy of Current HP, Spirit
- $130F: Copy of Current HP, Guest1
- $1311: Copy of Current HP, Guest2
- $1313: Copy of Current HP, Enemy1
- $1315: Copy of Current HP, Enemy2
- $1317: Copy of Current HP, Enemy3
- $1319: Copy of Current HP, Enemy4
- $131B: Copy of Current HP, Enemy5
- $131D: Copy of Current HP, Enemy6
- $131F: Copy of Current HP, Enemy7
- $1321: Copy of Current HP, Enemy8
- $1323: Current MP (Magic Points), Rooks
- $1325: Current MP, Spirit
- $1327: Current MP, Guest1
- $1329: Current MP, Guest2
- $132B: Current MP, Enemy1 (Enemies don't actually use MP, so these values just stay at 5555)
- $132D: Current MP, Enemy2
- $132F: Current MP, Enemy3
- $1331: Current MP, Enemy4
- $1333: Current MP, Enemy5
- $1335: Current MP, Enemy6
- $1337: Current MP, Enemy7
- $1339: Current MP, Enemy8
- $133B: Copy of Current MP (Magic Points), Rooks
- $133D: Copy of Current MP, Spirit
- $133F: Copy of Current MP, Guest1
- $1341: Copy of Current MP, Guest2
- $1343: Copy of Current MP, Enemy1 (Enemies don't actually use MP, so these values just stay at 5555)
- $1345: Copy of Current MP, Enemy2
- $1347: Copy of Current MP, Enemy3
- $1349: Copy of Current MP, Enemy4
- $134B: Copy of Current MP, Enemy5
- $134D: Copy of Current MP, Enemy6
- $134F: Copy of Current MP, Enemy7
- $1351: Copy of Current MP, Enemy8
- $1353: Current HP, Sylph
- $1355: Current HP, Dao
- $1357: Current HP, Marid
- $1359: Current HP, Efrite
- $135B: Current MP, Sylph
- $135D: Current MP, Dao
- $135F: Current MP, Marid
- $1361: Current MP, Efrite
- $1363: EXP to next level, Rooks
- $1365: EXP to next level, Spirit (Unused? Seems to stay at 0258)
- $1367: EXP to next level, Guest1
- $1369: EXP to next level, Guest2
- $136B: EXP award, Enemy1 (The EXP you get for beating this enemy. Unclaimed enemy slots are FFFF)
- $136D: EXP award, Enemy2
- $136F: EXP award, Enemy3
- $1371: EXP award, Enemy4
- $1373: EXP award, Enemy5
- $1375: EXP award, Enemy6
- $1377: EXP award, Enemy7
- $1379: EXP award, Enemy8
- $137B: Level, Rooks
- $137D: Level, Spirit (Shares Rooks' level)
- $137F: Level, Guest1
- $1381: Level, Guest2
- $1383: Level, Enemy1
- $1385: Level, Enemy2
- $1387: Level, Enemy3
- $1389: Level, Enemy4
- $138B: Level, Enemy5
- $138D: Level, Enemy6
- $138F: Level, Enemy7
- $1391: Level, Enemy8
- $1393: Max HP, Rooks
- $1395: Max HP, Spirit
- $1397: Max HP, Guest1
- $1399: Max HP, Guest2
- (Next byte is Rooks' Max MP -> Enemies have no max HP/MP stat)
- $139B: Max MP, Rooks
- $139D: Max MP, Spirit
- $139F: Max MP, Guest1
- $13A1: Max MP, Guest2
- $13A3: Temp EXP (A running total collected through battle)
- $13A5: Temp GP
- $13A7: Spirits not owned (Bit flags: xxxx EMDS) (Example: 6 -> 0110 -> missing Marid/Dao)
- $13A9: Card inventory (Two bytes each, eight entries)
- (item ID / quantity)
- $13B9: Item inventory (Two bytes each, 48 entries)
- (item ID / quantity)
- $1419: Equipment inventory (Two bytes each, 48 entries)
- (item ID / quantity)
- $1459: Rooks' spell list (Two bytes each, 32 entries)
- $1499: Spirit's spell list (Two bytes each, 32 entries?)
- $14D9: Guest1's spell list (Two bytes each, 32 entries?)
- $1519: Guest2's spell list (Two bytes each, 32 entries?)
- $1559: Current GP
- $155B: Current party (Two bytes each)
- #$00: Rooks
- #$01: Sylph
- #$02: Marid
- #$03: Dao
- #$04: Efrite
- #$05: Teefa
- #$06: Salah
- #$07: Darwin
- #$08: Axs
- #$09: (Empty slot)
Inventory
- $13A9-$13B7: Card inventory (2 bytes per slot, ID then quantity)
- #$00: Empty slot
- #$01: Wind Card
- #$02: Earth Card
- #$03: Water Card
- #$04: Fire Card
- #$05: Null Card
- #$06: Fog Card
- #$07: Call Amulet
- #$08: Mirror Card (bugged)
- $13B9-$1418: Item inventory (2 bytes per slot, $30 slots: ID then #$00)
- #$01: Return Ring
- #$02: Water of Life (dummied)
- #$03: Sleeping Bag
- #$04: Tent
- #$05: Strength Honey
- #$06: Intelligence Honey
- #$07: Endurance Honey
- #$08: Agility Honey
- #$09: Restore Honey
- #$0A: MP Honey
- #$0B: Herbs
- #$0C: Medicine
- #$0D: Silver Flask
- #$0E: Gold Flask
- #$0F: Maiden's Tears
- #$10: Moon Oil
- #$11: Enchanted Jewel (dummied)
- $1419–1458: Equipment inventory (2 bytes per slot, $20 slots: ID then Equipped By)
- Equipped by flags:
- #$00: Rooks
- #$05: Teefa
- #$06: Salah
- #$07: Darwin
- #$08: Axs
- #$FF: Nobody
Actors Continued
- $1459–$1398: Rooks' spell list (2 bytes per entry, Spell ID followed by #$00)
- $1499–14D8: Spirit's spell list
- $14D9-1518: Guest1's spell list
- $1519–1558: Guest2's spell list
- $155D: Active spirit
- $01: Sylph
- $02: Dao
- $03: Marid
- $04: Efrite
- $09: none
- $155F: Guest1
- $1561: Guest2
- $05: Teefa
- $06: Salah
- $07: Darwin
- $08: Axs
- $09: none
Miscellaneous
- $0624-$0626: Active spirit's HP (Format: BCD)
- $062D: Offset*2 used with $11F3
- $06F9: X position of cursor
- $071D: Y position of cursor
- $09CB: Turn status (02: not turning, 00: turning left, 01: turning right)
- $0A7F: Compass heading (00: N, 02: NE, 04: E, 06: SE... 0E: NW) (Tracks diagonals unlike $16FB)
- $105A: Caches which H-DMA channels to run
- $1064: Current music
- $1066: Current sfx
- $10EB-C: ASCII values for number being displayed
- $1123: Used for asm x offsets
- $11B5: Tracks progress in intro crawl
- $11B9: Current page# in item list
- $1573: ?? (Checked before changing music)
- $1577: Window color (Bit depth: 0BBB B0GG GG0R RRR0)
- $1579: Encounter related
- $157B: Graphics related
- $1580–16DF: Current display buffer
- For spells, names are preceded by 06 0D (white) if usable and 06 0E (grayed) if not.
- $16DB: Temp var (Attack power, battle damage, )
- $16DD: Temp var (Defense power)
- $16F3: #$01 if in motion, #$00 if standing still
- $16F5: Current floor tile value
- $16F7: Dungeon X position
- $16F9: Dungeon Y position
- $16FB: Current direction (#$00 North, #$02 East, #$04 South, #$06 West)
- $16FD: Related to random encounters (usually 0)
- $16FF: Map progress
- $17BF: Map progress (mirror)
- $1885: Shop selection (i.e. Card shop uses values 0-6)
- $1895: Torn spirits (4 entries, 2b each: Sylph = 2)
- $18C5: Spell type
- $18C9: Temp MP
- $18CD: Current Chapter # (01-05)
- $18CF: Weather fx (Used in the intro)
- $18D5: Stage select counter (adds 2 for every correct button press until $1C)
- $18D7: Encounter layout (long ptr)
- $18DA: Encounter enemy list (long ptr)
- $18DF: Bosses defeated? (0=Ch2 start, 1=Cyclops killed)
- $18E1: Temp var for Boss encounter (6 = Cyclops)
- $18E3-$18E8: Treasure chest flags (each chest has its own bit)
- $18F3: Decompression entry (long ptr)
- $18F8: Decompression start (long ptr)
- $18FF: Event pointer
- 05: Started Chapter 2
- 0A: Started Chapter 3
- 0E: Started Chapter 4
- 18: Started Chapter 5
Internal Data for Arcana
| |
---|---|