Yu-Gi-Oh! Dark Duel Stories/RAM map: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 122: Line 122:
   C6AD    1    ?
   C6AD    1    ?
   C6AE    2    Card currently viewed
   C6AE    2    Card currently viewed
   C6B0    1    0x03 : Regular card
   C6B0    1    0x02 : ? (func_F:4F19)
                0x03 : Regular card
                 0x06 : Menus
                 0x06 : Menus
                 0x07 : Construction card (outside duels)
                 0x07 : Construction card (outside duels)

Revision as of 02:23, 8 October 2023

Chip tiny.png The following article is a RAM map for Yu-Gi-Oh! Dark Duel Stories.

VRAM

Address Size    Description
------- ----    -----------
  8800  1280    On the field: Card Illustration

SRAM

Address Size    Description
------- ----    -----------
  A7D4     2    Deck Capacity (SRAM)
  B7F1     1    ? (set to 0xAA when setting up Debug New game)
  B7FF     1    Erase save file and start Debug New Game

WRAM

Address Size    Description
------- ----    -----------
  C100     2    Pointer
  C102     8    Password digits offsets
  C10C     8    Name Entry characters
  C400     2    ?
  C426     2    Pointer to the Music data being read
  C428     2    ROM Bank of the Music data being read
  C42A     2    Music pointer
  C42C     2    Music ROM Bank
  C42E     2    Start of Music loop
  C436     1    Current ROM Bank, or Screen ID when unused for Bank switching purposes
                0x01 : Pre-duel screen
                0x02 : CPU opponent's talking
                0x03 : Player's turn in duel
                0x04 : Menus / Title Screen
                0x05 : Card display / Text box in duel
                0x06 : Monster battle end
                0x07 : CPU's turn in duel (inputs disabled)
                0x09 : Password Screen
                0x0A : "To Be Continued" Screen 
                0x0B : Monster battle
                0x0D : CPU's turn in duel
                0x10 : Character Viewer menu
                0x11 : Credits screen
                0x12 : Sound Test
  C437     1    Current WRAM Bank
  C438     1    Sound Effect playing ?
  C439     1    ?
  C43B     1    ?
  C43C     1    ?
  C43D     1    Music playing ?
  C441     1    Music loop flag
  C500   160    Illustration colors
  C5A0     1    ?
  C5A1     1    ?
  C5A2     1    ?
  C5A3     1    ? (related to Game Link)
                0x00 : ?
                0x02 : ?
                0x04 : ?
  C5A4     1    ? (related to Game Link)
  C5A5     1    ? (related to Game Link)
  C5A6     1    ? (related to Game Link)
  C5A7     1    Button pressed
                0x00 : None
                0x01 : A
                0x02 : B
                0x04 : Select
                0x08 : Start
                0x10 : →
                0x20 : ←
                0x40 : ↑
                0x80 : ↓
  C5A8     1    ?
  C5AA     1    ? (related to Joypad ?)
  C5AC     1    Indicates the game is loading graphics
  C5AD     1    Stores offset to the WRAM display array at (C100)
  C5AE     1    ? (Seems to be related to Battle Display)
  C5AF     1    OAM pointer offset
                The pointer at 0x536 + (C5AF) determines where to jump from function 0:0524 (OAM subroutine)
  C5B2     1    ? (Related to display)
  C5B3     1    ? (Related to display)
  C5B5     2    ?
  C5B7     1    ?
  C5BA     2    Construction part ID
  C5BE     2    ? (Card ID to be summoned ?)
  C5C0     1    ?
  C5C1     1    ?
  C5C6     1    ?
  C5C7     2    Player's Life Points
  C5C9     1    ? (Player) (Initialized to 0 at start of duel, when Life Points are initialized to 8000)
  C5CA     2    CPU's Life Points
  C5CC     1    ? (CPU) (Initialized to 0 at start of duel, when Life Points are initialized to 8000)
  C5CD     2    Stores duel-related values
  C5CF     1    ? (Related to text boxes ?)
  C5D0    16    Next character string to display
  C5E4     1    ? (Related to card names ?)
  C5E5     1    ? (Related to Player's Name)
  C5E6     1    ? (Related to Player's Name)
  C5E7     1    ? (Related to Player's Name)
  C5E8     1    Field ID
  C5E9     2    Current Card ID being incremented (Trunk)
  C5EC     1    ?
  C5ED     1    ?
  C5EE     1    ?
  C5EF     1    ?
  C5F0     1    ?
  C5F1     1    ?
  C5F2     1    ?
  C5F3     2    ?
  C5F5     1    Trunk : Current Card order
  C5F6     2    Card viewer : cost
                Deck viewer : last card ID displayed or last card part ID read
                Duel : Player's Life Points (temporary copy)
                Trunk : last card quantity (1 byte)
  C5F8     1    ?
  C5F9     1    ?
  C5FC     2    Current Card ID being incremented
  C602     1    Current cursor position in Deck viewer
  C605     1    Current page in Deck viewer
  C607     1    Current card position in Deck
  C609     1    Current card position -1 in Deck
  C60A    80    Player's deck
  C65A    80    CPU's shuffled deck
  C6AA     1    CPU's deck size / cards drawn
  C6AD     1    ?
  C6AE     2    Card currently viewed
  C6B0     1    0x02 : ? (func_F:4F19)
                0x03 : Regular card
                0x06 : Menus
                0x07 : Construction card (outside duels)
                0x09 : Construction card (in duels)
  C6B1     1    Current Field
  C6B2     1    Current Stat Level
  C6B3     2    Card currently selected (even by the CPU)
  C6B5     1    Current Field Column
  C6B6     1    Current Field Row
  C6B7     2    Current card ATK
  C6B9     2    Current card DEF
  C6BB     1    Current card Type
  C6BC     1    Current card Cost
  C6BD     1    Current card Level
  C6BE     1    Current card Alignment
  C6BF     1    Current card Effect ID (magic trap ritual)
  C6C0     1    Current card Effect ID (monster)
  C6C1     2    ? (card data ?)
  C6C3     2    ? (card data ?)
  C6C5     2    ? (card data ?)
  C6C7     1    ? (card data ?)
  C6EE     1    ?
  C6EF     1    ? (retrieved in subroutine 2:6C98)
  C6F0     2    Number of characters displayed in current text box (compared with text length to determine if there are any characters left to display)
  C6F4     1    ?
  C6F5     1    ?
  C6F6     1    ?
  C6F7     1    ?
  C6F8     1    ?
  C6F9     1    CPU Character ID displayed
  C6FA     1    Text ID displayed
  C6FB     1    ?
  C6FC     1    ?
  C6FD     1    ?
  C6FE     1    ?
  C700     1    Column to check
  C701     1    Row to check
  C702     1    Column (Targeted)
  C703     1    Row (Targeted)
  C704     1    ? (set to 0x01 if (C7C5)&4 ≠ 0, or (C7C5)&8 ≠ 0)
  C705    80    Player's shuffled deck
  C755     1    Cards drawn during this duel
  C759    15    CPU's hand + card status
  C768     3    CPU's Trap + card status
  C76B    18    CPU's cards on the Field + card status
  C780    18    Player's cards on the Field + card status
  C78F     3    Player's Trap + card status
  C792    15    Player's Hand + cards status
                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)
  C7A1     1    Field Column
  C7A2     1    Field Row
  C7A3     3    Card being processed + card status (Card Level, card frozen, Brain Control...)
  C7A6     2    Player's Life Points (temporary copy)
  C7A8     1    ? (Copied to wC5FB)
  C7A9     2    P1 or P2 Life Points (temporary copy)
  C7AB     1    ? (Copied to wC5FB)
  C7AD     1    ?
  C7B0     1    Current turn
                0x00: Player 2 or CPU (first turn)
                0x01: Player 1
                0x02: Player 2 or CPU
  C7B1     1    Menu ID (different from C85C)
                0x00: Title Screen
                0x01: Campaign
                0x02: Versus
                0x03: Trade
                0x04: Duel Records
                0x05: Character Viewer
                0x06: Construction
                0x07: Name entry
                0x08: Password
                0x09: Sound Test
  C7B2     1    Type of damage
                0x00 : No Damage
                0x04 : Direct Attack vs CPU
                0x09 : Spell Damage vs CPU
  C7B3     2    Card being processed by the Player
  C7B5     2    Card being processed by the CPU
  C7B7     1    Monster Alignment (Player)
  C7B8     1    Monster Alignment (CPU)
  C7B9     2    Player's Life Points (temporary copy)
  C7BB     2    CPU's Life Points (temporary copy)
  C7BD     2    Monster ATK (Player) and direct damage
  C7BF     2    Monster ATK (CPU) and direct damage
  C7C1     2    Monster DEF (Player)
  C7C3     2    Monster DEF (CPU)
  C7C5     1    ? (OR'd with 0x08 when doing more damage than CPU's remaining Life Points)
  C7C6     1    ? (related to damage calc)
  C7C7     1    ? (related to damage calc)
  C7C8     1    ? (related to damage calc)
  C7C9     1    ? (related to damage calc)
  C7CA   128    ? (Game Link data ?)
  C84A     2    ?
  C84C     1    ?
  C84D     4    Duel: Monster currently selected + copy
                Main menu: PRNG
  C851     4    Fixed PRNG (for Construction cards mainly)
  C855     4    PRNG seed
  C859     1    Min value possible for Pseudo-Random Number
  C85A     1    Max value possible for Pseudo-Random Number
  C85B     1    PRN between (C859) and (C85A)
  C85C     1    Current selected menu (main menu)
  C85D     1    Current Campaign screen
  C885     1    ROM Bank for Fusion Data (start)
  C886     1    ROM Bank for Fusion Data (end)
  C887     2    Fusion Material pointer (start)
  C889     2    Fusion Material pointer (end)
  C88B     2    Card played by CPU, OR
                Monster Card targeted by Equip Card, OR
                Fused Monster #1
  C88D     2    Card played by Player, OR
                Equip Card targeting Monster Card, OR
                Fused Monster #2
  C88F     2    Fusion Monster ID
  C891     2    Player's card ID (temporary copy while attacking)
  C893     2    Player's Life Points (temporary copy)
  C895     2    P1 or P2 Life Points (temporary copy)
  C897     2    Monster ATK (Player) (temporary copy)
  C899     2    Monster DEF (Player) (temporary copy)
  C89B     1    Monster Alignment (Player) (temporary copy)
  C89C     2    CPU's card ID (temporary copy)
  C89E     2    CPU's Life Points (temporary copy)
  C8A0     2    CPU's Life Points (temporary copy)
  C8A2     2    Monster ATK (CPU) (temporary copy)
  C8A4     2    Monster DEF (CPU) (temporary copy)
  C8A6     1    Monster Alignment (CPU) (temporary copy)
  C8A7     1    ? (Battle value)
  C8A8     1    ?
  C8A9     2    Card being processed (copy)
  C8AB     2    Monster to Special Summon (e.g. Spirit of the Book)
                Monster to target (e.g. Harpie's Pet Dragon)
  C8AD     1    ?
  C8AE     1    ?
  C8AF     1    ? (Battle value)
  C8CC     1    Current CPU opponent
  C8CD     1    Pre-Duel music to be played
  C8CE     1    Duel music to be played
  C8CF     1    ?
  C8D0     1    ?
  C8D1     1    0x00 : First turn, no attack
                0x01 : You can attack
                0x02 : Player loses
                0x03 : Player wins
  C8D2     1    Probably same as (C8D1) but for Link Duels ?
  C8D3     1    Stage 2 selected opponent
                0x00 : Espa Roba
                0x01 : Weevil Underwood
                0x02 : Rex Raptor
                0x03 : Rare Hunter
                0x04 : Pandora
                0x05 : Seto Kaiba
  C8D4     1    ? (subroutine 2:73C3)
  C8D5     1    ? (subroutine 2:73C3)
  C8D6     1    Debug New Game
  C8D7     1    ?
  C8D8     1    Set to 01 when a New Game is started
  C8D9     1    ?
  C8FF     1    Duel : ? (Related to text boxes)
  C900     1    Duel : Character to display in text box
  C901     2    Duel : ? (Related to text boxes)
  C905     1    Duel : Text Box ID
  C907     1    ?
  C90A     1    Duel : ? (Related to text boxes)
  C90C    42    Duel Records (battles)
  C93E    42    Duel Records (wins)
  C970     1    Stage 1 selected opponent
                0x00 : Tristan Taylor
                0x01 : Joey Wheeler
                0x02 : Mai Valentine
                0x03 : Mako Tsunami
                0x04 : Yugi Muto
                0x32 : Tea
  C972     1    ?
  C973     1    Stage 3 selected opponent
                0x00 : Simon Muran
                0x01 : Ishitzu Ishtar
                0x02 : Heishin
                0x03 : P. Seto
  C974     8    Player's Name (copy)
  C97C     8    Player's Name
  C984     1    ? (related to Player's Name)
  C986     4    ? (related to save management)
  C98A     1    1st character in Player's name + 5th character in Player's name
  C98B     1    2nd character in Player's name + 6th character in Player's name
  C98C     1    3rd character in Player's name + 7th character in Player's name
  C98D     1    4th character in Player's name + 8th character in Player's name
  C997     1    ?
  C998     1    ?
  C999     1    0x01 : Player no longer affected by Swords of Revealing Light
                0x02 : Player's Swords of Revealing Light active (1 turn left)
                0x03 : Player's Swords of Revealing Light active (2 turn left)
                0x04 : Player's Swords of Revealing Light active (3 turn left)
  C99A     1    0x01 : CPU no longer affected by Swords of Revealing Light
                0x02 : CPU's Swords of Revealing Light active (1 turn left)
                0x03 : CPU's Swords of Revealing Light active (2 turn left)
                0x04 : CPU's Swords of Revealing Light active (3 turn left)
  C99B     1    ? (00'd when a special text is requested from character ≥ 0xB5)
  C99C     1    Special text pointer offset
  C9B8     8    Card Color data
  CA38     1    ?
  CA3A     1    Debug Character Viewer - Character ID
  CA44     1    Did the player play a monster this turn ?
  CA47     2    ?
  CA49     ?    ? (in subroutine 9:557F)
  CAC7     1    ?
  CAC8     2    ? (Scroll X / Y ?)
  CAD2     1    Debug Sound Test
                01 : Music
                02 : Sound Effect
  CAD3     1    Debug Sound Test - Music ID
  CAD4     1    Debug Sound Test - Sound Effect ID
  CAD5     1    Numbers of monsters Tributes this turn
  CAD6     2    Card being processed (temporary copy)
  CADA     1    Column being processed (temporary copy)
  CADB     1    Row being processed (temporary copy)
  CF8B    36    Stack (push / pop)
  CFBC     8    Password - Entered password
  CFC4     8    Password - Card password
  CFC4     1    Duel - ?
  CFC5     1    Duel - Previous ROM Bank (used after rst 08)
  CFC6     2    Duel - Previous Program Counter (used after rst 08)
  CFCF     1    Password - Valid password flag
  CFD0     2    Password - Card ID being checked
  CFD2     1    Password - "Is this OK?" textbox
                00 - B returns to main menu
                01 - B returns to password input
  CFD2     1    Password - "Is this OK?" textbox
                00 - YES
                01 - NO
  D001     2    AI - ?
  D005     1    AI - ?
  D006     2    AI - ?
  D05F     2    AI - Can the CPU attack ?
  D067     1    AI - Is there a Trap card on the opponent's field ?
  D472    15    AI - CPU's hand
  D4BA     2    AI - CPU's Life Points
  D4BC     2    AI - Player's Life Points
  D4BE     1    AI - Field ID
  D4BF     1    AI - Player's SoRL
  D4C0     1    AI - CPU's SoRL
  D4C1     1    AI - (C997)
  D4C2     2    AI - ?
  D4C5     2    AI - CPU's card ATK
  D4C7     1    AI - ?
  D4CA     1    AI - Column (current)
  D4CB     1    AI - Row (current)
  D4CE     1    AI - ?
  D4D5     1    AI - Effect triggered
                0x01 : Field ?
                0x05 : Healing
                0x06 : Direct Damage ?
                0x07 : ?
                0x08 : ?
                0x09 : ?
                0x0A : Special Summon ?
                0x0C : ?
                0x0D : ?
                0x0E : ?
                0x0F : ?
  D4D6     1    AI - Column to check
  D4D7     1    AI - Row to check
  D4DE     1    AI - ?
  D4F3     1    AI - ?
  D4F4     1    AI - Field ID
  D4F5     1    AI - ?
  D4F6     2    AI - ?
  D4F8     2    AI - Direct Damage or Healing
  D4FA     1    AI - ?
  D4FD     2    AI - Attack Phase : Player's Monster ID
  D4FF     2    AI - Attack Phase : Player's Life Points
  D501     2    AI - Attack Phase : Player's Life Points
  D503     2    AI - Attack Phase : Player's Monster ATK
  D505     2    AI - Attack Phase : Player's Monster DEF
  D507     1    AI - Attack Phase : Player's Monster Alignment
  D508     2    AI - Attack Phase : CPU's Monster ID
  D50A     2    AI - Attack Phase : CPU's Life Points
  D50C     2    AI - Attack Phase : CPU's Life Points
  D50E     2    AI - Attack Phase : CPU's Monster ATK
  D510     2    AI - Attack Phase : CPU's Monster DEF
  D512     1    AI - Attack Phase : CPU's Monster Alignment
2:D000  1000    Cards in Chest / Trunk
2:D3E8   280    Card Construction parts
2:D500   400    Constructed cards in Chest / Trunk
6:D04A     8    Card Levels display

HRAM

Address Size    Description
------- ----    -----------
  FF80     2    ?
  FF82     2    ?
  FFD9     2    Deck Capacity (HRAM)
  FFDB     1    Grandpa flag ?
                0x80 - Grandpa gives a card
  FFDC     1    Flag ?
  FFDD     1    System running the game
                0x01 - Game Boy / Super Game Boy 1
                0x11 - Game Boy Color
  FFE0     5    ?