Crystal Beans From Dungeon Explorer:RAM map

From Data Crystal
Revision as of 01:45, 9 June 2016 by FCandChill (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

This page documents the RAM addresses. The addresses whose function is unknown are ommited but this doesn't mean that they are necessarily free to use. Also, even if an address as a documented use, this doesn't mean that it doesn't have other unknown functions.

Core engine variables

  • 7E0000-7E0001 (2) = Buttons pressed for player 1 (BYSTudlr AXLR????)
  • 7E0002-7E0003 (2) = Buttons pressed for player 2 (BYSTudlr AXLR????)
  • 7E0004-7E0005 (2) = Buttons pressed for player 3 (BYSTudlr AXLR????)
  • 7E0008-7E0009 (2) = Copy of buttons held for player 1 (BYSTudlr AXLR????)
  • 7E000A-7E000B (2) = Copy of buttons held for player 2 (BYSTudlr AXLR????)
  • 7E000C-7E000D (2) = Copy of buttons held for player 3 (BYSTudlr AXLR????)
  • 7E000F-7E000F (1) = Base address for reading joypad data (not directly read/written)
  • 7E0010-7E0010 (1) = Multitap connect status
    • Bit 7 = Multitap connected in port 1
    • Bit 6 = Multitap connected in port 2
  • 7E0011-7E0012 (2) = Joypad 5 data (BYSTudlr AXLR????)
  • 7E0013-7E0014 (2) = Joypad 4 data (BYSTudlr AXLR????)
  • 7E0015-7E0016 (2) = Joypad 3 data (BYSTudlr AXLR????)
  • 7E0017-7E0018 (2) = Joypad 2 data (BYSTudlr AXLR????)
  • 7E0019-7E001A (2) = Joypad 1 data (BYSTudlr AXLR????)
  • 7E001A-7E001A (1) = Base address for reading joypad extended data (not directly read/written)
  • 7E001B-7E001B (1) = Joypad 5 extended data
    • bit 0: pad connected bit
    • bit 1-4: unknown bits from low byte of pad data
  • 7E001C-7E001C (1) = Joypad 4 extended data (same format as for joypad 5)
  • 7E001D-7E001D (1) = Joypad 3 extended data (same format as for joypad 5)
  • 7E001E-7E001E (1) = Joypad 2 extended data (same format as for joypad 5)
  • 7E001F-7E001F (1) = Joypad 1 extended data (same format as for joypad 5)
  • 7E0020-7E0021 (2) = Port 1 multitap detect word (0xFFFF if multitap connected in port 1)
  • 7E0022-7E0023 (2) = Port 2 multitap detect word (0xFFFF if multitap connected in port 2)
  • 7E0024-7E0025 (2) = Offset to pad data for player 1
  • 7E0026-7E0027 (2) = Offset to pad data for player 2
  • 7E0028-7E0029 (2) = Offset to pad data for player 3
  • 7E002C-7E002E (3) = Source address for cutscene decompression
  • 7E002F-7E0031 (3) = Pointer to object list when loading maps
  • 7E002F-7E0030 (2) = Destination VRAM address for cutscene decompression
  • 7E0035-7E0036 (2) = Pointer to cutscene script
  • 7E0038-7E0039 (2) = Uncompressed length for cutscene decompression
  • 7E0044-7E0046 (3) = Used to pass source address to main decompression
  • 7E0047-7E0049 (3) = Used to pass destination address to main decompression
  • 7E004A-7E004B (2) = Used to pass uncompressed length to main decompression
  • 7E004D-7E004D (1) = MDMAEN data used in the main NMI handler
  • 7E004E-7E004E (1) = Data base for HDMAEN data used in the main NMI handler
  • 7E004F-7E004F (1) = Data bits for HDMAEN data used in the main NMI handler
  • 7E005C-7E005C (1) = Current sprite index when loading objects for maps?
  • 7E005D-7E005D (1) = Current sprite palette when loading objects for maps?
  • 7E005E-7E005E (1) = Current sprite first tile when loading objects for maps?
  • 7E0067-7E0067 (1) = Room index
  • 7E0068-7E0068 (1) = Level index
  • 7E0069-7E006B (3) = Pointer to Map:GfxDataPtrs
  • 7E006C-7E006C (1) = Map left bound
  • 7E006D-7E006D (1) = Map right bound
  • 7E006E-7E006E (1) = Map top bound
  • 7E006F-7E006F (1) = Map bottom bound
  • 7E0082-7E0082 (3) = Pointer to main dialog string and place name
  • 7E0089-7E0089 (35) = array of object offsets (bytes)
  • 7E00AC-7E00AC (1) = Used in the main NMI handler (incremented if < 2)
  • 7E00AF-7E00AF (1) = Used to determine if a level is a town
  • 7E00B3-7E00B3 (1) = Cleared every main NMI (related to sound)
  • 7E00B4-7E00B5 (2) = Buttons held for player 1 (BYSTudlr AXLR????)
  • 7E00B6-7E00B7 (2) = Buttons held for player 2 (BYSTudlr AXLR????)
  • 7E00B8-7E00B9 (2) = Buttons held for player 3 (BYSTudlr AXLR????)
  • 7E00BC-7E00BE (3) = Source address for main decompression
  • 7E00BF-7E00C1 (3) = Destination address for main decompression
  • 7E00C2-7E00C2 (1) = Control byte for main decompression
  • 7E00C3-7E00C3 (1) = Bits left in control byte for main decompression
  • 7E00C4-7E00C4 (1) = Substring length for main decompression
  • 7E00C5-7E00C6 (2) = Source dictionary index for main decompression
  • 7E00C7-7E00C8 (2) = Destination dictionary index for main decompression
  • 7E00D1-7E00D3 (3) = Pointer to MagicAttackAnim
  • 7E00DF-7E00DF (1) = Current sprite Y position?
  • 7E00E1-7E00E1 (1) = Current sprite X position?
  • 7E00E2-7E00E2 (1) = Main dialog string index when loading string
  • 7E00E3-7E00E3 (1) = Main dialog section index when loading string
  • 7E00E3-7E00E3 (1) = Current sprite first tile?
  • 7E00E4-7E00E4 (1) = Length of string in PrintChoiceString
  • 7E00E7-7E00E7 (1) = Cursor blink timer in choice selection dialog
  • 7E00EE-7E00EE (1) = Cursor position in choice selection dialog
  • 7E00F0-7E00F0 (1) = Object definition index when loading objects for maps
  • 7E00F5-7E00F5 (1) = Number of players, related to CharInfoArea handling
  • 7E00F6-7E00F6 (1) = Party member offset, related to CharInfoArea handling
  • 7E00F7-7E00F7 (1) = Current character in password input
  • 7E00FA-7E00FB (2) = Destination VRAM address for object graphics
  • 7E00FC-7E00FC (1) = Destination CGRAM index for object palette
  • 7E0100-7E01FF (256) = System stack
  • 7E0200-7E041F (544) = OAM data buffer
  • 7E0420-7E0420 (1) = Frame counter, incremented every NMI
  • 7E0423-7E043A (24) = Direct HDMA table for BG1HOFS data
  • 7E043D-7E0445 (12) = Direct HDMA table for BGMODE data
  • 7E0446-7E0454 (15) = Direct HDMA table for BG1SC data
  • 7E0456-7E045E (12) = Direct HDMA table for BG12NBA data
  • 7E0461-7E0462 (2) = BG2HOFS data
  • 7E0463-7E0464 (2) = BG2VOFS data
  • 7E0465-7E0466 (2) = BG2HOFS data
  • 7E0467-7E0468 (2) = BG2VOFS data
  • 7E0469-7E0469 (1) = CGADDSUB data
  • 7E046A-7E046A (1) = CGADDSUB data
  • 7E046B-7E046C (2) = TM data
  • 7E046D-7E046E (2) = TM data
  • 7E046F-7E0470 (2) = TM data

Map and objects variables

  • 7E0471-7E0471 (1) = Current place selected on world map
  • 7E0472-7E0472 (1) = Last place unlocked on world map
  • 7E0473-7E0473 (1) = Bean room info screen timer
  • 7E0474-7E047D (10) = Array of flags for function in list (bytes)
    • bit 7: set if corresponding slot has a function
  • 7E047E-7E047E (1) = related to magic attack? (if !0, don't do it)
  • 7E04B1-7E04B1 (1) = Frame delay counter (used in NMI, decremented if > 0)
  • 7E04B9-7E04BA (2) = Screen left position?
  • 7E04BB-7E04BC (2) = Screen top position?
  • 7E04BD-7E04BE (2) = Screen left position?
  • 7E04BF-7E04C0 (2) = Screen top position?
  • 7E04C3-7E04C3 (1) = Number of players
  • 7E04C4-7E04C4 (1) = Maximum party member index
  • 7E04C5-7E04CA (6) = Stat pairs for members ItemEffects/ID
    • bit 0: was probably atk/dmg booster
    • bit 7: projectile rebound
  • 7E04CB-7E04D0 (6) = Stat pairs for members ID?/SpriteGfxBank
  • 7E04D1-7E04D6 (6) = Stat pairs for members ?/Level
  • 7E04D7-7E04DC (6) = Stat pairs for members AglGem/AtkGem
  • 7E04DD-7E04E2 (6) = Stat pairs for members StrGem/IntGem
  • 7E04E3-7E04E8 (6) = Stat pairs for members Agl/Atk
  • 7E04E9-7E04EE (6) = Stat pairs for members Str/Int
  • 7E04EF-7E04F4 (6) = Stat pairs for members White/Black
  • 7E04F5-7E04FA (6) = Word array for members SpriteGfxAddr
  • 7E04FB-7E0500 (6) = Stat pairs for members IdleTimer/?
    • Start idle sprite anim when it reaches 120 (0x78)
  • 7E0507-7E050C (6) = Stat pairs for members EffectOnEnemies?/SpriteIndex?
    • EffectOnEnemies: 0 = scared, 1 = confused, 3 = ?
  • 7E050D-7E0512 (6) = Word array for members EffectOnEnemiesStrength?
  • 7E0519-7E051E (6) = Word array for members CapeStrength (number of hp left on cape effect)
  • 7E055B-7E05A0 (70) = Word array for objects flags?
    • bit 2: set when enemy just been killed
    • bit 3: use party member sprite sheet?
    • bit 5: on screen?
    • bit 7: alive/active?
    • bit 9: immobile object?
    • bit 13: ?
    • bit 15: enemy touch player?
    • high byte == 0xF: destroyed/killed?
  • 7E05A1-7E05E6 (70) = Stat pairs for objects unknown stats
    • if Stat1 & 0x80 == 0x80 then it's an hostile object
  • 7E05E7-7E062C (70) = Stat pairs for objects IsBlocked/SmtAboutDoors|Stairs?
    • bit 0-1: blocked horizontally
    • bit 2-3: blocked vertically
    • bit 4: touching object
  • 7E06B9-7E06FE (70) = Stat pairs for objects Type/?
  • 7E06FF-7E0744 (70) = Stat pairs for objects BankIndex/?
  • 7E078B-7E07D0 (70) = Stat pairs for objects unknown stats
    • Stat1: updated when moving in the X axis
    • Stat2: updated when moving in the Y axis
  • 7E07D1-7E0816 (70) = Word array for objects XPos
  • 7E0819-7E085E (70) = Word array for objects YPos
  • 7E0861-7E08A6 (70) = Word array for objects XPos
  • 7E08A7-7E08EC (70) = Word array for objects YPos
  • 7E08ED-7E0932 (70) = Word array for objects unknown stat (updated when moving in the X axis)
  • 7E0933-7E0978 (70) = Word array for objects unknown stat (updated when moving in the X axis, same as $08ED for members)
  • 7E0979-7E09BE (70) = Word array for objects unknown stat (updated when moving in the Y axis)
  • 7E09BF-7E0A04 (70) = Word array for objects unknown stat (updated when moving in the Y axis, same as $0979 for members)
  • 7E0AD7-7E0B1C (70) = Stat pairs for objects XSize?/YSize?
  • 7E0B63-7E0BA8 (70) = Word array for objects SpriteGfxAddr
  • 7E0BEF-7E0C34 (70) = Stat pairs for objects ?/DistanceFromTop?
  • 7E0C35-7E0C7A (70) = Stat pairs for objects Subtype?/?
  • 7E0C7B-7E0CC0 (70) = Word array for objects CurHP
  • 7E0CC1-7E0D06 (70) = Stat pairs for objects unknown stats (if stat2 == 2 then it's not damaged by magic attack?)
  • 7E0D4D-7E0D92 (70) = Stat pairs for objects ItemFlags?/DirectionFacing
  • 7E0D93-7E0DD8 (70) = Stat pairs for objects Subtype/?
  • 7E0DD9-7E0E1E (70) = Stat pairs for objects ?/AffectedMemberOfs
  • 7E0E1F-7E0E64 (70) = Word array for objects PaletteNum
  • 7E0E65-7E0EAA (70) = Stat pairs for objects ?/UniqueItemLevelFlag
  • 7E0F40-7E103F (256) = HostileObjFirstTile (Contains the first 16x16 tile number of the sprite (* 2 to get real first tile number))
  • 7E1040-7E113F (256) = HostileObjCGRAMIndices
  • 7E1140-7E11BF (128) = FriendlyObjFirstTile (Contains the first 16x16 tile number of the sprite (* 2 to get real first tile number))
  • 7E11C0-7E123F (128) = FriendlyObjCGRAMIndices

Dialog variables

  • 7E128F-7E128F (1) = Dlg:ButtonsToAccept, maybe player to check (bit 0 = player 1, bit 1 = player 2, bit 2 = player 3)
  • 7E1291-7E1291 (1) = Dlg:PrintHandlerNum
    • 0 = Normal Printing
    • 1 = End Of String
    • 2 = End Of Page
    • 3 = Insert Digits
    • 4 = Insert String
  • 7E1292-7E1292 (1) = Dlg:PrintDelayTimer
  • 7E1294-7E1294 (1) = Dlg:CursorPosition
  • 7E1295-7E1295 (1) = Dlg:SavedCharacter
  • 7E1299-7E129D (5) = Dlg:DigitsToInsert
  • 7E129E-7E129E (1) = Dlg:InsDigitsIndex
  • 7E129F-7E12A0 (2) = Dlg:InsStringPtr
  • 7E12A1-7E12A1 (1) = Dlg:InsStringIndex
  • 7E12A2-7E12A2 (1) = Dlg:InsStringLen
  • 7E12A3-7E12AA (8) = Dlg:NPCGameFlags

Misc variables

  • 7E12AB-7E12AB (1) = Party lives
  • 7E133C-7E1340 (5) = Game flags
  • 7E13D4-7E1433 (96) = Levels flags (24 bits (3 bytes) per level?)
  • 7E1434-7E1439 (6) = Stat pairs for members MenuCmd/WindowSelected
  • 7E1449-7E1461 (25) = Password text
  • 7E1462-7E147A (25) = Password nibbles
  • 7E1485-7E14A7 (70) = Word array for objects index?
  • 7E14AE-7E14AE (1) = SPC:LastCommandSent
  • 7E14AF-7E14B8 (10) = Function pointers low
  • 7E14B9-7E14C2 (10) = Function pointers high
  • 7E14C3-7E14CC (10) = Function pointers bank
  • 7E14CD-7E14D6 (10) = Function pointers argument 1
  • 7E14D7-7E14E0 (10) = Function pointers argument 2
  • 7E14E1-7E14EA (10) = Function pointers argument 3
  • 7E14EB-7E14F4 (10) = Function pointers argument 4
  • 7E14F5-7E14F6 (2) = Member:CurAddressesOffset
  • 7E14F6-7E14FB (6) = Word array for members VRAM address
  • 7E14FC-7E1501 (6) = Word array for members graphic address
  • 7E1502-7E1507 (6) = Word array for members graphic bank
  • 7E15D9-7E15D9 (1) = Dlg:PlaceNamePrintHandlerNum
    • 0 = Set cursor at home position
    • 1 = Init dialog window
    • 2 = Enter place?
    • 3 = Print place name
    • 4 = NOP
    • 5 = Check A or B button press
    • 6 = NOP
    • 7 = Set cursor at home position
  • 7E15DA-7E15DA (1) = Dlg:PlaceNameCursorPos
  • 7E15DD-7E15DD (1) = Magic Attack Stage (0 = No magic attack in progress)
  • 7E15DE-7E15DE (1) = MagicAttackUploadBufIndex
  • 7E15DF-7E15DF (1) = MagicAttack?
  • 7E15E0-7E15E0 (1) = MagicAttackCharID*2
  • 7E15E1-7E15E1 (1) = MagicAttackCharID*3
  • 7E15E2-7E15E2 (1) = MagicAttackAnimFrameDelay?
  • 7E15E3-7E15E4 (2) = MagicAttackTranslationLeft
  • 7E15E5-7E15E6 (2) = MagicAttackTranslationDown
  • 7E15E7-7E15E7 (1) = PasswordWindowTilePos
  • 7E15E8-7E15ED (6) = Stat pairs for members CharIDOfs/StartCmdFlags
  • 7E1700-7E17FF (256) = Map:BlockFlags?
  • 7E1800-7E197F (384) = CharInfoAreaTilemap

Cutscene engine variables

  • 7E1A04-7E1A05 (2) = Original cutscene script command byte
  • 7E1A06-7E1A07 (2) = Cutscene index
  • 7E1A2D-7E1A2D (1) = Cutscene frame counter
  • 7E1A30-7E1A31 (2) = Not zero if palette buffer is dirty
  • 7E1A7C-7E1A7C (1) = INIDISPRegData
  • 7E1A7D-7E1A7D (1) = TMRegData
  • 7E1A7E-7E1A7E (1) = HDMAENRegData
  • 7E1A7F-7E1A7F (1) = Not zero if OAM buffer is dirty
  • 7E1CE7-7E1CE8 (2) = Number of characters on the line
  • 7E1CE9-7E1CE9 (1) = Start of line
  • 7E1CEB-7E1CEC (2) = TextOutputBufferIndex
  • 7E1CF1-7E1CF2 (2) = Number of characters left in compressed block
  • 7E1CF3-7E1CF4 (2) = Current character address
  • 7E1CF5-7E1CF6 (2) = Control byte
  • 7E1CF7-7E1CF7 (1) = Not zero if end of string
  • 7E1CFD-7E1D3C (96) = Tile buffer to convert tiles from 12x12
  • 7E1E00-7E1EFF (256) = Dictionary for cutscene decompression
  • 7E1FC0-7E1FC3 (4) = Native NMI Handler (JML instruction to jump to the installed handler)

Sound engine variables

  • 7E1FD0-7E1FD2 (3) = Source address for SPC upload
  • 7E1FD3-7E1FD3 (1) = Song index
  • 7E1FD4-7E1FD4 (1) = Number of patterns to send
  • 7E1FD6-7E1FD7 (2) = Current target address for SPC upload
  • 7E1FD8-7E1FD9 (2) = Pattern size in bytes
  • 7E1FDA-7E1FDB (2) = Target address for pattern
  • 7E1FDC-7E1FDC (1) = Current target instrument index
  • 7E1FDD-7E1FDD (1) = Number of patterns sent
  • 7E1FDE-7E1FDE (1) = Initial byte to send (0xCC for first block, block index otherwise)
  • 7E1FDF-7E1FDF (1) = Pattern to send?

Map and misc variables

  • 7E2400-7E27FF (1024) = Unknown
  • 7E2800-7E2BFF (1024) = Block tile numbers
    • Uncompressed Map:GfxDataPtrs.BlockTileData. Array of 256 array of 4 bytes containing the tile numbers for each block. Byte 0: top-left, byte 1: top-right, byte 2: bottom-left, byte 3: bottom-right
  • 7E2C00-7E2DFF (512) = Block palette numbers
    • (Uncompressed Map:GfxDataPtrs.BlockTileData) + 0x400. Array of 256 array of 4 nibbles (2 bytes) containing the palette numbers for each block. Nibble 0: top-left, nibble 1: top-right, nibble 2: bottom-left, nibble 3: bottom-right
  • 7E2E00-7E2E7F (128) = Palette?
  • 7E3000-7E4FBF (8128) = Characters projectile graphics buffer?
  • 7E7000-7E7FFF (4096) = Dictionary for main decompression
  • 7E7B00-7E7BFF (256) = SPC:SamplePtrsToSend
  • 7E7C00-7E7D7F (384) = SPC:InstrumentsToSend
  • 7E7D80-7E7DFF (128) = SPC:PatternPtrsToSend?
  • 7E7E00-7E7EFE (255) = SPC:UsedInstruments? (cells contains an index in the target instrument array or 0xFF if not used)
  • 7E7EFF-7E7FFD (255) = SPC:InstrumentIndices?
  • 7E8000-7E8FFF (32768) = Map
    • Uncompressed Map:GfxDataPtrs.Map. Contains the block numbers that make up the map BG. It is 256 blocks (bytes) wide

Misc buffers

  • 7F0000-7F3FFF (16384) = MagicAttackGfxBuf?, also generic decompression destination buffer
  • 7F4000-7F401F (32) = MagicAttackPaletteBuf?
  • 7FAE00-7FEDFD (16382) = Cutscene text output buffer
  • 7FEE00-7FEEFF (256) = Cutscene palette buffer
  • 7FF000-7FFFFF (4096) = Cutscene tilemap buffer

SRAM

  • 0000-001F (32) = File 1 password
  • 0020-003F (32) = File 2 password
  • 0040-005F (32) = File 3 password


Internal Data for Crystal Beans From Dungeon Explorer

ROM MapRAM MapText TableNotesTutorials