ff3:ff3us:doc:asm:ram:menu_ram

Menu RAM

This is a list of the RAM locations used by the menu program. The code that uses this data is in banks C3 and D4. This program also controls most of the ending cutscenes.

   +$00 Constant #$0000
   +$02 Constant #$FFFF
   +$04 Unmodified Buttons Pressed this Frame
   +$06 Buttons Pressed this Frame Modified Based on Button Config
   +$08 Buttons Pressed this Frame but not Last Frame
   +$0A Buttons in Repeat Mode
   +$0C Buttons Pressed Last Frame
        axlr----
        a: A button down
        x: X button down
        l: L button down
        r: R button down
        byetudlr
        b: B button down
        y: Y button down
        e: Select button down
        t: Start button down
        u: Up direction down
        d: Down direction down
        l: Left direction down
        r: Right direction down
   +$0E pointer to sprite data at $0300
   +$10 pointer to high sprite data at $0500
   +$12 DMA 1 Size
   +$14 DMA 1 Destination Address (VRAM)
  ++$16 DMA 1 Source Address
   +$19 DMA 2 Size
   +$1B DMA 2 Destination Address (VRAM, $0000 = no DMA occurs)
  ++$1D DMA 2 Source Address
   +$20 Wait Frame Counter (decrements Every Frame until it reaches 0)
    $22 
    $23 Frame Counter (increments every frame, never gets cleared)
    $24 Enable Interrupt
    $25 Main Menu Cursor Position
    $26 Current Menu State
    $27 Next Menu State
    $28 Current Selection (char slot, item slot, etc.)
    $29 vhopppmm High byte of BG data
        for bg1: $20 = white text, $24 = teal text, $28 = gray text, $2C = blue text, $30 = 
        for bg3: $20 = white text, $24 = gray text, $28 = yellow text, $2C = teal text
    $2A List Type (0 = item list, 1 = magic, 2 = lore, 3 = rage, 4 = esper, 5 = equip/relic item list)
   +$2B Current Thread Code Pointer
   +$2D Current Thread Data Pointer
   +$2F Number of active threads
   +$31 Current Number of Unused Sprites
    $33 Pointer to High Sprite Data Masks at $C31334
    $34 Current High Sprite Data Byte
   +$35 BG1 HScroll
   +$37 BG1 VScroll
   +$39 BG2 HScroll
   +$3B BG2 VScroll
   +$3D BG3 HScroll
   +$3F BG3 VScroll
   +$41 BG1 VScroll Speed (signed)
    $43 HDMA Enable Register (-> $420C)
    $44 Screen Display Register (-> $2100)
    $45 ??df???p
        ?: 
        ?: 
        d: disable description redraw when a direction button is pressed
        f: force description text redraw ???
        ?: 
        ?: 
        ?: 
        p: enables color palette DMA at VBlank
    $46 dus?m21f Cursor/Scrolling Flags
        d: page can scroll down
        u: page can scroll up
        s: enable bg1 text scrolling
        ?: 
        m: multi flashing cursor is active
        2: cursor 2 is active
        1: cursor 1 is active
        f: flashing cursor thread is active
    $47 ----cbba
    $48 
    $49 vertical page offset (16 lines)
    $4A current page scroll position (item), current page number (config)
    $4B cursor selected item (single number calculated from XY cursor position)
    $4C 
  + $4D XY cursor position (relative to page)
  + $4F XY cursor position (absolute)
  + $51 
  + $53 XY max cursor positions
  + $55 X position of cursor on screen (in pixels)
  + $57 Y position of cursor on screen (in pixels)
    $59 x------y
        x: disable cursor wrap in X direction
        y: disable cursor wrap in Y direction
    $5A page height
    $5B page width
    $5C max page scroll position
    $5D 
  + $5E saved XY cursor position
    $60 slot 1 portrait thread data pointer
    $61 slot 2 portrait thread data pointer
    $62 slot 3 portrait thread data pointer
    $63 slot 4 portrait thread data pointer
    $64 saved equipped item
    $65 
    $66 current saved game slot
   +$67 pointer to current character data
    $69 character in slot 1
    $6A character in slot 2
    $6B character in slot 3
    $6C character in slot 4
   +$6D pointer to character data for slot 1
   +$6F pointer to character data for slot 2
   +$71 pointer to character data for slot 3
   +$73 pointer to character data for slot 4
    $75 --rbb--- character slot 1
        r: battle row (back row if set)
        b: battle order
    $76 --rbb--- character slot 2
    $77 --rbb--- character slot 3
    $78 --rbb--- character slot 4
    $79 Text color for Espers skill ($20 = enabled, $24 = disabled)
    $7A Text color for Magic skill
    $7B Text color for SwdTech skill
    $7C Text color for Blitz skill
    $7D Text color for Lore skill
    $7E Text color for Rage skill
    $7F Text color for Dance skill
$80-$84 Character Select Cursor Data
$85-$8C Character Select Cursor Positions
    $8D 
   +$8E previous XY cursor position
    $90 
   +$91 sram checksum (slot 1)
   +$93 sram checksum (slot 2)
   +$95 sram checksum (slot 3)
   +$97 
    $99 enable flashing page cursor direction (item details)

    $9C Current Character Slot ???
   +$9C Menu scroll speed
    $9E Previous Menu State
    $9F Menu State for ???

    $A1 Character has gauntlet bonus (2-handed weapon with no shield)

    $AE Current Sound Effect (cleared after vblank)

    $B4 0 = use inverse credits palette (color subtraction), 1 = use normal credits palette (color addition)
    $B5 Screen Mosaic Register
    $B6 
$B7-$C2 MODE7 Registers

    $CD Character has genji glove effect

   +$CF Frame Counter (increments every frame, can be cleared)

$E0-$FF Scratchpad
      $0200 Menu Type
            $00 = main menu
            $01 = name change
            $02 = restore saved game
            $03 = shop
            $04 = party select
            $05 = 
            $06 = SwdTech naming
            $07 = colosseum
            $08 = final battle order
      $0201 (main menu) s-----wx
            s: enable save/tent
            w: enable Warp (spell and item)
            x: enable X-Zone (doesn't do anything)
     +$0201 (name change) pointer to character data
      $0201 (party select menu) number of groups
      $0201 (shop) shop number
      $0201 (optimize equipment) character number
      $0201 (controller update) active character
     +$0202 (party select menu) forced characters
      $0202 (shop) showing character graphic index
      $0204 -
      $0205 menu return code ($00: none, $02: tent, $03: warp/warp stone, $04: x-zone, $05: timer ran out, $FE: rename card)
      $0205 Wagered Item (colosseum)
      $0206 Monster Number (colosseum)
     +$0206 Pointer to Character Data (rename card)
      $0207 Colosseum Item Number (prize)
      $0208 Colosseum Character Number
      $0209 Enable Colosseum Prize Display
$020A-$0212 -
      $020F Character 
     +$0213 
     +$0215 
     +$0217 
     +$0219 
   +++$021B Game Time
      $021F Save Slot to Load (0 = don't load)
      $0220 aaaabbbb
            a: A button mapping ($C3A5B4)
            b: B button mapping
      $0221 xxxxyyyy
            x: X button mapping
            y: Y button mapping
      $0222 llllrrrr
            l: top L button mapping
            r: top R button mapping
      $0223 ----ssss
            s: select button mapping
      $0224 current saved game slot
      $0225 A button repeat frame delay counter (32 frames)
      $0226 A button repeat frame counter
      $0227 direction button repeat frame delay counter
      $0228 direction button repeat frame counter
      $0229 direction button repeat frame delay (8 frames)
      $022A repeat rate for A button and direction button repeat (3 frames per repeat)

$022B-$0249 Saved Menu Cursor Positions
-----------
     +$022B Saved Main Menu Cursor Position (X,Y)
     +$022D Saved Character Select Position for Equip, Skills, Status, etc. (X,Y)
     +$022F Saved Item Cursor Position (X,Y)
      $0231 Saved Item Page Scroll Position (item number at top of page)
     +$0232 Saved Rare Item Cursor Position (X,Y)
     +$0234 Saved Item/Arrange/Rare Cursor Position (X,Y)
     +$0236 Character Slot 1 Saved Skills Cursor Position (X,Y)
     +$0238 Character Slot 2 Saved Skills Cursor Position (X,Y)
     +$023A Character Slot 3 Saved Skills Cursor Position (X,Y)
     +$023C Character Slot 4 Saved Skills Cursor Position (X,Y)
     +$023E Character Slot 1 Saved Magic Cursor Position (X,Y)
     +$0240 Character Slot 2 Saved Magic Cursor Position (X,Y)
     +$0242 Character Slot 3 Saved Magic Cursor Position (X,Y)
     +$0244 Character Slot 4 Saved Magic Cursor Position (X,Y)
     +$0246 Character Slot 1 Saved Magic Page Scroll Position (X,Y)
     +$0248 Character Slot 2 Saved Magic Page Scroll Position (X,Y)
     +$024A Character Slot 3 Saved Magic Page Scroll Position (X,Y)
     +$024C Character Slot 4 Saved Magic Page Scroll Position (X,Y)

This data gets copied directly to the SNES OAM data every frame.

Format for sprites:
        $00 x position
        $01 y position
      + $02 vhoopppm mmmmmmmm
            v: vertical flip
            h: horizontal flip
            o: layer priority
            p: palette index
            m: graphic index
     +$0600 
     +$0602 Dummy Value
$0604-$07C1 M7A & M7D HDMA Data
     +$07C2 
     +$07C4 Dummy Value
$07C6-$0985 M7B HDMA Data
     +$0984 
     +$0986 Dummy Value
$0988-$0B47 M7C HDMA Data

This region is not reserved for the menu program. All data here will get overwritten by one of the other programs.

$3000-$303F Saved Battle Stats
      $3040 High byte of BG data for vigor
      $3041 " " speed
      $3042 " " stamina
      $3043 " " mag.pwr
      $3044 " " defense
      $3045 " " evade
      $3046 " " mag.def
      $3047 " " mblock
      $3048 " " bat.pwr

$3049-$3248 Color Palettes
-----------
      $3149 Character Portrait Color Palettes (4 palettes, 16 colors each)
      $3209 Status Icon Color Palette
      $3229 Cursor Color Palette

$3249-$3848 Thread Data
-----------
     +$3249 Thread code pointer (8 priority levels, 8 threads per level)
     +$32C9 Pointer to animation data
     +$3349 Movement counter
     +$33CA X position
     +$344A Y position
     +$34CA Horizontal movement speed
     +$354A Vertical movement speed
      $35C9 
      $35CA Bank byte of pointer to animation data
      $3649 Thread state
      $364A ??????hs
            h: horizontal flip
            s: sprite doesn't scroll with bg
      $36C9 Animation data offset
      $36CA Frame counter (decrements every frame)
      $3749 ????ppp?
            p: palette ($00 = use palette from sprite thread data
      $374A Thread data pointer
     +$37C9 

$3849-$9049 BG Data (32 rows per screen, 32 tiles per row, 2 bytes per tile)
-----------
$3849-$4048 BG1 Data (top left screen)
$4049-$4848 BG1 Data (top right screen)
$4849-$5048 BG1 Data (bottom left screen)
$5049-$5848 BG1 Data (bottom right screen)
$5849-$6048 BG2 Data (top left screen)
$6049-$6848 BG2 Data (top right screen)
$6849-$7048 BG2 Data (bottom left screen)
$7049-$7848 BG2 Data (bottom right screen)
$7849-$8048 BG3 Data (top left screen)
$8049-$8848 BG3 Data (top right screen)
$8849-$9048 BG3 Data (bottom left screen)
$9049-$9848 BG3 Data (bottom right screen)

$9849-      HDMA Data
-----------
$9849-      BG1 vertical scroll hdma table -> $210E (channel #6)

$9A09-      BG1 horizontal scroll hdma table -> $210D (channel #7)

      $9D89 Length of Item List (used for other lists too)
$9D8A-$9E88 Item List (positions in inventory)
     +$9E89 Pointer to Positioned Text in BG1 Data (+$7E0000)
$9E8B-      Positioned Text Buffer

$9EC9-      Description Text Buffer

$9F51-$A0E0 Blank Portrait Graphics

$A271-$A970 Description Text Graphics VRAM Buffer (2 lines, $380 bytes per line)

$AC8D-$AD8C Attack/Defense Power of Item List

$C000-$DFFF Decompression Buffer
$0000-$1000 BG1 Data
$1000-$2000 BG2 Data
$2000-$2400 Standard Menu Cursor/Icon Graphics
      $2000 Cursor (16x16)
      $2020 Scroll Up Arrow (8x8)
      $2030 Page Down Arrow (16x16)
      $2050 Page Right Arrow (16x16)
      $2070 Equipped "E" Icon (8x8)
      $2080 Colosseum "VS" Icons (2 @ 16x16)
      $20C0 Stat Up Symbols (3 @ 8x8)
      $20F0 Stat Equal Symbol (8x8)
      $2120 Scroll Up Arrow (8x8, flashing)
      $2200 Float Icon (16x16)
      $2220 Petrify Icon (16x16)
      $2240 Imp Icon (16x16)
      $2260 Invisible Icon (16x16)
      $2280 Poison Icon (16x16)
      $22A0 Zombie Icon (16x16)
      $22C0 Dark Icon (16x16)
$2600-$2E00 Character Portrait Graphics
$3000-$4000 Character Sprite Graphics
$4000-$5000 BG3 Data
$5000-$6000 BG1 Graphics
$6000-$6800 BG3 Graphics
      $6800 Description Text Graphics (BG3, variable-width font)
      $7800 Menu Window Graphics
  • ff3/ff3us/doc/asm/ram/menu_ram.txt
  • Last modified: 5 years ago
  • (external edit)