Yu-Gi-Oh! Duel Monsters 4: Kaiba Deck/RAM map

From Data Crystal
Jump to navigation Jump to search

Chip tiny.png The following article is a RAM map for Yu-Gi-Oh! Duel Monsters 4: Kaiba Deck.

SRAM

Address Size    Description
------- ----    -----------
 A4B7     2     Deck Capacity (SRAM) (Copy)
 B1AF     2     Deck Capacity (SRAM)

WRAM

Address Size    Description
------- ----    -----------
 C428     2     Pointer to the Music data being read
 C42A     1     ROM Bank to the Music data being read
 C42C     2     Music pointer
 C42E     2     Music ROM Bank
 C5A0     2     ? (00'd by function 0:0207)
 C5A4     1     ? (used in func_0:1ADE)
 C5A6     1     ? (used in func_0:1ADE)
 C5AD     1     ? (func_0:0F87)
 C5AE     1     ? (func_0:0F87)
 C5D9     1     Field ID
 C5B8     2     Life Points (Player)
 C5BB     2     Life Points (CPU)
 C5D5     1     # of characters to display
 C5DD     1     ? (set to 0 by Card display function)
 C5ED     2     Current Card ID ? (used in func_1:473B)
 C5F8     1     Number of cards in Player's deck
 C5F9    80     Player's deck
 C649    80     CPU's deck
 C69B     1     Versus menu cursor position
 C69E     2     Current card ID displayed
 C6A3     2     Current card ID displayed (copy)
 C6A5     1     Current Column
 C6A6     1     Current Row
 C6A7     2     Current ATK displayed
 C6A9     2     Current DEF displayed
 C6AB     1     Current Type displayed
 C6AC     1     Current Cost displayed
 C6AD     1     Current Level displayed
 C6AE     1     Current Alignment displayed
 C6AF     1     Card Effect IDs (Magic Ritual Trap)
 C6B0     1     Card Effect IDs (Monster)
 C732     1     Character ID
 C733     1     Text ID
 C73A     1     ? (stores previous Row in some functions, maybe it stores other things as well)
 C73E     1     ? (used during Duel screen refresh)
 C78F     1     ? (retrieved in func_3:44E1)
 C793    15     CPU's Hand + cards status
 C7BA    15     Player's cards on the Field + card status
 C7C9     3     Player's Trap + card status
 C7CC    15     Player's Hand + cards status
 C7DB     1     Current Column
 C7DC     1     Current Row
 C7DD    15     Current card + card status (wC7DF and every 3)
                 Bit 0: Card position
                 Bit 1: Is there a card in this zone
                 Bit 2: Card frozen (more than 1 turn)
                 Bit 3: Card frozen
                 Bit 4: Monster Level
                 Bit 5: Monster Level
                 Bit 6: SET status
                 Bit 7: Card stolen for a turn (returns to the opponent at end of turn)
 C7E6     1     ? (used in func_0:1ADE)
 C7EB     1     ? (used during Battle textbox display)
 C7FF     1     ? (or'd by all the subroutines starting from func_3:5AA2)
 C8AA     2     ? (00'd at func_0:1DF1)
 C8AC     1     ? (func_3:61A1, prolly whether card is Monster Spell Trap or Ritual)
 C8AD     5     PRNG
 C8B3     1     PRNG output
 C8B4     1     Menu ID (main menu)
                0x00: Campaign
                0x01: Versus
                0x02: Password
                0x03: Duel Records
                0x04: Trade
                0x05: Sound Test
                0x06: Character Viewer
 C8D7     1     ?
 C8D8     1     ?
 C8D9     1     ?
 C8DA     1     ?
 C8DB     1     ?
 C8DC     1     ?
 C8F6     2     current_card_id 1
 C8F8     2     current_card_id 2
 C8FA     2     current_card_id 3
 C904     1     Current CPU opponent
 C905     1     Pre-Duel music to be played
 C906     1     Duel music to be played
 C943    50     Duel Records (battles)
 C975    50     Duel Records (wins)
 CA55     1     Debug Character Viewer - Character ID
 CA5F     1     Did the player play a monster this turn ?
 CA64     1     ? (used in func_9:5564)
 CADC     1     ?
 CADD     2     Player's Graveyard
 CADF     2     CPU's Graveyard
 D529     1     AI - ? (func_14:5B9C)
 D52A     1     AI - ? (func_14:5BBB)
 D52B     1     AI - ? (func_14:5BC0)
 D52C     2     AI - ? (func_14:5BA0)
 D52E     2     AI - Healing and Damage amount
 D530     1     AI - ? (func_14:5BB6)
2:D000  901     Cards in chest / trunk

HRAM

Address Size    Description
------- ----    -----------
  FFD7     2     Deck Capacity (HRAM)
  FFDA     1     Dark Stage opponent
                   0x00 - Mai Valentine
                   0x01 - Bandit Keith
                   0x02 - Yami Yugi
                   0x03 - Yami Marik
                   Yami Bakura is exclusive to the two other versions; to make it appear in Kaiba's version, you have to move the dark stage array somewhere else, add 0x13 (Yami Bakura's id) as the 5th value, and change the control on the dark stage opponent ID to have carry if it's 5 or more, instead of 4 or more
  FFDD     1     System running the game
                   0x01 - Game Boy / Super Game Boy 1
                   0x11 - Game Boy Color
  FFDF     1     ?