data/claims/earthbound-tables.yamlEarthBound's data tables (Herringway's ebsrc)
Game: EarthBound.
Every one of the 231 enemy slots, from an empty one (no. 0) to no. 230, has 94 bytes in the enemy configuration table: its name, gender, and type (normal, insect, or metal), its battle and map sprites, HP, PP, experience, money, level, Offense, Defense, Speed, Guts, Luck, and IQ, its miss rate, its vulnerability to fire, freeze, flash, paralysis, and hypnosis (brainshock is read as the opposite of hypnosis), four actions with an argument each and a final action, how it picks among them, the item it drops and how rarely, the status it starts the battle with, its row, how many allies it can call, its chance against Mirror, its battle music, and whether it is a boss. HP runs up to 9999 (Giygas), experience up to 337738 (Diamond Dog), money up to 6968 (Diamond Dog), and level up to 99 (Flying Man); 153 enemies drop an item. earthbound-tables/enemies
src/data/battle/enemies.asm#L1-L11320
ENEMY_CONFIGURATION_TABLE:
.BYTE $00 ;The Flag
PADDEDEBTEXT "null", 25
.BYTE GENDER::MALE
.BYTE ENEMYTYPE::NORMAL
.WORD $0000 ;Battle sprite
.WORD OVERWORLD_SPRITE::NONE
.BYTE $07 ;Run flag
.WORD 0 ;HP
.WORD 0 ;PP
.DWORD 0 ;Experience
…ebsrc: Source code recreation for the game Earthbound · include/structs.asm#L141-L188.STRUCT enemy_data
.IFDEF USA
the_flag .byte ;0
name .byte 25 ;1
gender .byte ;26
.ELSE
name .byte 10 ;0
.ENDIF
type .byte ;27
battle_sprite .word ;28
overworld_sprite .word ;30
run_flag .byte ;32
…EarthBound (USA) · 0x159589-0x15ea5a — $D5:9589-$D5:EA5A: ENEMY_CONFIGURATION_TABLE, 94 bytes an enemyebsrc: Source code recreation for the game Earthbound · src/battle/init_enemy_stats.asm#L133-L171 LDY #enemy_data::fire_vulnerability
LDA [@VIRTUAL06],Y
JSL CALC_PSI_DMG_MODIFIERS
LDX @VIRTUAL02
STA a:battler::fire_resist,X
LDY #enemy_data::freeze_vulnerability
LDA [@VIRTUAL06],Y
JSL CALC_PSI_DMG_MODIFIERS
LDX @VIRTUAL02
STA a:battler::freeze_resist,X
LDY #enemy_data::flash_vulnerability
LDA [@VIRTUAL06],Y
…ebsrc: Source code recreation for the game Earthbound · src/battle/calc_psi_damage_modifiers.asm#L1-L32
CALC_PSI_DMG_MODIFIERS:
BEGIN_C_FUNCTION_FAR
STACK_RESERVE_PARAM_INT16 ;int resistLevel
END_STACK_VARS
AND #$00FF
BEQ @UNKNOWN0
CMP #1
BEQ @UNKNOWN1
CMP #2
BEQ @UNKNOWN2
CMP #3
…ebsrc: Source code recreation for the game Earthbound · src/battle/calc_psi_resistance_modifiers.asm#L1-L32
CALC_PSI_RES_MODIFIERS:
BEGIN_C_FUNCTION_FAR
STACK_RESERVE_PARAM_INT16 ;int resistLevel
END_STACK_VARS
AND #$00FF
BEQ @UNKNOWN0
CMP #1
BEQ @UNKNOWN1
CMP #2
BEQ @UNKNOWN2
CMP #3
…ebsrc: Source code recreation for the game Earthbound · include/enums.asm#L306-L310.ENUM ENEMYTYPE
NORMAL = 0
INSECT = 1
METAL = 2
.ENDENUMAs a battle is set up, the game picks one of its enemies at random and keeps that enemy's item, from the enemy table, with a chance set by the enemy's rate byte: 1 in 128 for 0, 1 in 64 for 1, 1 in 32 for 2, 1 in 16 for 3, 1 in 8 for 4, 1 in 4 for 5, 1 in 2 for 6, and always for 7. The disassembly's comments give the fractions in the opposite order (1/2 beside rate 0). When no item is kept and the battle holds a conscious Cute Li'l UFO or Beautiful UFO, the item is one of the first seven on that UFO's list in the consolation table, picked at random. CodeChecked by claude, 2026-11-08 — parsed every enemy's 48 lines on the US branch at the pinned commit and compared HP, PP, experience, money, level, Offense, Defense, Speed, Guts, Luck, IQ, the boss byte, the drop and its rate, the row, the allies called, the Mirror byte, the fire byte, and the miss rate with the ROM's 94 bytes per enemyRevised after a check by a second AI model, 2026-11-08.Names are the table's own text; the disassembly's identifier for each slot is in its own column. The five vulnerability bytes hold 0 to 3; the battle setup turns fire and freeze into a multiplier of 255, 179, 102, or 13 and flash, paralysis, and hypnosis into 255, 128, 26, or 0, and gives brainshock the value for 3 minus the hypnosis byte. An action's argument (an enemy it calls, an item it uses) follows it in brackets. The drop chance is the reading in earthbound-tables/item-drops. Miss rate is in 16 (earthbound/hit-and-dodge).
As a battle is set up, the game picks one of its enemies at random and keeps that enemy's item, from the enemy table, with a chance set by the enemy's rate byte: 1 in 128 for 0, 1 in 64 for 1, 1 in 32 for 2, 1 in 16 for 3, 1 in 8 for 4, 1 in 4 for 5, 1 in 2 for 6, and always for 7. The disassembly's comments give the fractions in the opposite order (1/2 beside rate 0). When no item is kept and the battle holds a conscious Cute Li'l UFO or Beautiful UFO, the item is one of the first seven on that UFO's list in the consolation table, picked at random. earthbound-tables/item-drops
src/battle/main_battle_routine.asm#L832-L1007 LDA ENEMIES_IN_BATTLE
JSR RAND_LIMIT
.A16
ASL
TAX
LDA ENEMIES_IN_BATTLE_IDS,X
.IF .DEFINED(JPN)
STA @LOCAL0A
.ELSE
STA @LOCAL0F
.ENDIF
LOADPTR ENEMY_CONFIGURATION_TABLE, @VIRTUAL06
…Our readingpick one of the battle's enemies at random832–842the item is that enemy's item byte843–865read the enemy's rate byte r866–877for r of 0 to 6: unless a random number's low 7 − r bits are all 0, no item878–932r of 7 or more keeps the item891if no item: for each consolation entry933–939 for each conscious enemy slot that is the entry's enemy947–972 the item is one of the entry's first seven, at random973–987ebsrc: Source code recreation for the game Earthbound · src/data/battle/consolation_item_table.asm#L1-L6
CONSOLATION_ITEM_TABLE:
.BYTE ENEMY::CUTE_LIL_UFO
.BYTE ITEM::COOKIE, ITEM::BAG_OF_FRIES, ITEM::HAMBURGER, ITEM::BOILED_EGG, ITEM::FRESH_EGG, ITEM::PICNIC_LUNCH, ITEM::PIZZA, NULL
.BYTE ENEMY::BEAUTIFUL_UFO
.BYTE ITEM::CAN_OF_FRUIT_JUICE, ITEM::ROYAL_ICED_TEA, ITEM::PROTEIN_DRINK, ITEM::KRAKEN_SOUP, ITEM::BOTTLE_OF_WATER, ITEM::COLD_REMEDY, ITEM::VIAL_OF_SERUM, NULLEarthBound (USA) · 0x23109-0x2311a — $C2:3109-$C2:311A: CONSOLATION_ITEM_TABLE, an enemy and eight items eachebsrc: Source code recreation for the game Earthbound · src/system/math/rand.asm#L2-L31RAND:
PHP
REP #PROC_FLAGS::ACCUM8
…
AND #$00FF
PLP
RTLebsrc: Source code recreation for the game Earthbound · src/battle/main_battle_routine.asm#L863-L935LDA [@VIRTUAL0A]
AND #$00FF
STA ITEM_DROPPED
.IF .DEFINED(JPN)
LDA @LOCAL0A
.ELSE
LDA @LOCAL0F
.ENDIF
CLC
ADC #enemy_data::item_drop_rate
CLC
ADC @VIRTUAL06
…ebsrc: Source code recreation for the game Earthbound · src/battle/main_battle_routine.asm#L947-L987LDA BATTLERS_TABLE+battler::consciousness,X
AND #$00FF
BEQ @ENEMY_NOT_IN_CONSOLATION_TABLE
…
LDA [@VIRTUAL0A]
AND #$00FF
CMP BATTLERS_TABLE + battler::id,X
BNE @ENEMY_NOT_IN_CONSOLATION_TABLE
LDA #7
JSR RAND_LIMIT
PHA
LDA @VIRTUAL02
…Checked by claude, 2026-11-08 — read the drop roll on the US branch: each rate masks a random number with $7F shifted right by the rate and clears the item unless the result is 0; then the consolation loop over the table's two entriesRevised after a check by a second AI model, 2026-11-08.The consolation table: Cute Li'l UFO: Cookie, Bag of fries, Hamburger, Boiled egg, Fresh Egg, Picnic lunch, Pizza; Beautiful UFO: Can of fruit juice, Royal iced tea, Protein drink, Kraken soup, Bottle of water, Cold remedy, Vial of serum. Each list ends with an eighth byte, 0, which the pick (a random number below 7, plus 1 past the enemy byte) never reaches. A later matching UFO overwrites an earlier one's pick. RAND returns a number from 0 to 255.
Cited by: Item drop table
Every one of the 254 item slots has 39 bytes in the item configuration table: its name, its type byte, its price, who can use it (Ness, Paula, Jeff, Poo) and whether it is used up, can't be given away, or transforms, the battle action it performs, four parameter bytes, and its help text. 85 items are equipment (42 weapons, 11 body, 12 arms, 20 other), told by the type byte: bits 4–5 hold 1 for equipment (the item-type routine returns 2 for that value, and the code that lists gear by slot checks for 2), and bits 2–3 give the slot (weapon, body, arms, other). On equipment the first parameter (signed) adds to Offense on a weapon and to Defense elsewhere, the second does the same for Poo instead of the first, the third adds to Guts on a weapon, Speed on body gear, and Luck on arms and other gear, and the fourth is a weapon's miss rate or the armor's resistances. The most expensive is the Diamond band at $9998. earthbound-tables/items
src/data/items.asm#L1-L3819
ITEM_CONFIGURATION_TABLE:
.IF .DEFINED(JPN)
PADDEDASCII "\xD8\xDF", 10 ; ヌル
.ELSE
PADDEDEBTEXT "Null", 25
.ENDIF
.BYTE $FF ;Type
.WORD 2 ;Cost
.BYTE $00 ;Flags
.WORD BATTLE_ACTIONS::USE_NO_EFFECT
.BYTE $00 ;Strength
…ebsrc: Source code recreation for the game Earthbound · include/structs.asm#L312-L331.STRUCT item
.IFDEF USA
name .byte 25 ;0
.ELSE
name .byte 10 ;0
.ENDIF
type .byte ;25
cost .word ;26
flags .byte ;28
effect .word ;29
params .dword ;31
help_text .dword ;35
…EarthBound (USA) · 0x155000-0x1576b1 — $D5:5000-$D5:76B1: ITEM_CONFIGURATION_TABLE, 39 bytes an itemebsrc: Source code recreation for the game Earthbound · src/misc/equip_item.asm#L29-L40 ADC #item::type
TAX
LDA f:ITEM_CONFIGURATION_TABLE,X
AND #$00FF
AND #EQUIPMENT_SLOT::ALL<<2
BEQ @UNKNOWN0
CMP #EQUIPMENT_SLOT::BODY<<2
BEQ @UNKNOWN1
CMP #EQUIPMENT_SLOT::ARMS<<2
BEQ @UNKNOWN2
CMP #EQUIPMENT_SLOT::OTHER<<2
BEQ @UNKNOWN3ebsrc: Source code recreation for the game Earthbound · src/misc/get_item_type.asm#L10-L29OPTIMIZED_MULT @VIRTUAL04, .SIZEOF(item)
CLC
ADC #item::type
TAX
LDA f:ITEM_CONFIGURATION_TABLE,X
AND #$00FF
AND #$0030
BEQ @UNKNOWN0
CMP #$0010
BEQ @UNKNOWN1
CMP #$0020
BEQ @UNKNOWN2
…ebsrc: Source code recreation for the game Earthbound · src/misc/recalc_character_postmath_offense.asm#L24-L80LDA PARTY_CHARACTERS+char_struct::equipment+EQUIPMENT_SLOT::WEAPON,X
…
LDX #0
STX @LOCAL01
LDA @VIRTUAL02
CMP #PARTY_MEMBER::POO - 1
BNE @UNKNOWN0
LDX #1
STX @LOCAL01
@UNKNOWN0:
…
LDX @LOCAL01
…ebsrc: Source code recreation for the game Earthbound · src/misc/recalc_character_postmath_defense.asm#L23-L207LDA PARTY_CHARACTERS+char_struct::equipment+EQUIPMENT_SLOT::BODY,X
…
CMP #PARTY_MEMBER::POO - 1
…
ADC #item::params + item_parameters::strength
TAX
SEP #PROC_FLAGS::ACCUM8
LDA f:ITEM_CONFIGURATION_TABLE,X
REP #PROC_FLAGS::ACCUM8
SEC
AND #$00FF
SBC #$0080
…ebsrc: Source code recreation for the game Earthbound · src/misc/recalc_character_postmath_guts.asm#L32-L47 LDA PARTY_CHARACTERS+char_struct::equipment+EQUIPMENT_SLOT::WEAPON,X
AND #$00FF
BEQ @UNKNOWN0
DEC
STA @TMP
TXA
…
OPTIMIZED_MULT @VIRTUAL04, .SIZEOF(item)
CLC
ADC #item::params + item_parameters::epebsrc: Source code recreation for the game Earthbound · src/misc/recalc_character_postmath_speed.asm#L32-L47 LDA PARTY_CHARACTERS+char_struct::equipment+EQUIPMENT_SLOT::BODY,X
AND #$00FF
BEQ @UNKNOWN0
DEC
STA @TMP
TXA
…
OPTIMIZED_MULT @VIRTUAL04, .SIZEOF(item)
CLC
ADC #item::params + item_parameters::epebsrc: Source code recreation for the game Earthbound · src/misc/recalc_character_postmath_luck.asm#L32-L47 LDA PARTY_CHARACTERS+char_struct::equipment+EQUIPMENT_SLOT::ARMS,X
AND #$00FF
BEQ @UNKNOWN0
DEC
STA @TMP
TXA
…
OPTIMIZED_MULT @VIRTUAL04, .SIZEOF(item)
CLC
ADC #item::params + item_parameters::epebsrc: Source code recreation for the game Earthbound · src/battle/recalc_character_miss_rate.asm#L16-L31 LDA PARTY_CHARACTERS+char_struct::equipment+EQUIPMENT_SLOT::WEAPON,X
AND #$00FF
BEQ @UNKNOWN0
…
CLC
ADC #item::params + item_parameters::specialebsrc: Source code recreation for the game Earthbound · src/battle/calc_resistances.asm#L18-L492LDA PARTY_CHARACTERS+char_struct::equipment+EQUIPMENT_SLOT::BODY,X
…
ADC #item::params + item_parameters::special
…
AND #$0003
…
LDA PARTY_CHARACTERS+char_struct::equipment+EQUIPMENT_SLOT::OTHER,X
…
ADC #item::params + item_parameters::special
…
AND #$0003
…
…ebsrc: Source code recreation for the game Earthbound · src/unknown/C1/C1A795.asm#L70-L75JSR GET_ITEM_TYPE
CMP #2
BNEL @UNKNOWN9
LDY @LOCAL02
TYA
JSL GET_ITEM_SUBTYPEebsrc: Source code recreation for the game Earthbound · include/enums.asm#L312-L329.ENUM ITEM_FLAGS
NESS_CAN_USE = $01
PAULA_CAN_USE = $02
JEFF_CAN_USE = $04
POO_CAN_USE = $08
TRANSFORM = $10
CANNOT_GIVE = $20
UNKNOWN = $40
CONSUMED_ON_USE = $80
.ENDENUM
.ENUM EQUIPMENT_SLOT
WEAPON = 0
…Checked by claude, 2026-11-08 — parsed every item's ten lines on the US branch at the pinned commit and compared type, price, flags, and the four parameter bytes with the ROM's 39 bytes per item; read which slot and parameter each stat routine addsRevised after a check by a second AI model, 2026-11-08.Names are the table's own text. The users column reads the flag byte's low four bits; the flags column names its high four as the disassembly's ITEM_FLAGS do (bit 6 has no name there). The fourth parameter of body and other gear packs resistance levels two bits each, fire in bits 0–1, freeze in 2–3, flash in 4–5, and paralysis in 6–7, and the body and other levels add, up to 3; arms gear's sets the hypnosis and brainshock resistance (calc_resistances.asm). The column gives the raw byte. A consumable's parameters are its action's (how much it heals, say), read by the action's code, which this claim doesn't read.
Every one of the 318 battle actions (the entries an enemy's, an item's, or a PSI power's action names) has 12 bytes: which side it picks its targets from (the direction column's party, 0, picks among the user's opponents, and enemy, 1, among the user's own side), its target (none, one, random, row, or all), its type (physical, piercing physical, PSI, item, or other), its PP cost, its text, and the routine it runs. earthbound-tables/battle-actions
src/data/battle/action_table.asm#L1-L2545
BATTLE_ACTION_TABLE:
;NO_EFFECT
.BYTE ACTION_DIRECTION::ENEMY ;Direction
.BYTE ACTION_TARGET::NONE ;Target
.BYTE ACTION_TYPE::NOTHING ;Type
.BYTE $00 ;PP Cost
.DWORD MSG_BTL_NULL
.DWORD BTLACT_NULL4
;USE_NO_EFFECT
.BYTE ACTION_DIRECTION::ENEMY ;Direction
…EarthBound (USA) · 0x157b68-0x158a4f — $D5:7B68-$D5:8A4F: BATTLE_ACTION_TABLE, 12 bytes an actionebsrc: Source code recreation for the game Earthbound · src/battle/determine_targetting.asm#L21-L34STA @LOCAL03
PHA
MOVE_INT @VIRTUAL06, @VIRTUAL0A
PLA
CLC
ADC @VIRTUAL0A
STA @VIRTUAL0A
LDA [@VIRTUAL0A]
AND #$00FF
BEQ @ENEMY_TARGETTING_PSI
CMP #ACTION_DIRECTION::ENEMY
BEQL @ALLY_TARGETTING_PSI
…ebsrc: Source code recreation for the game Earthbound · include/constants/battle.asm#L140-L168.ENUM ACTION_DIRECTION
PARTY = 0
ENEMY = 1
.ENDENUM
.ENUM ACTION_TARGET
NONE = 0
ONE = 1
RANDOM = 2
ROW = 3
ALL = 4
.ENDENUM
…
…Checked by claude, 2026-11-08 — parsed every action's six lines on the US branch at the pinned commit and compared target, type, and PP cost with the ROM's 12 bytes per actionRevised after a check by a second AI model, 2026-11-08.Action names are the disassembly's comments above each entry, which match its BATTLE_ACTIONS constants; the routine column gives its labels.
The PSI table holds 53 powers after an empty first entry, 15 bytes each: the power's name and level (α to Ω), its menu category (offense, recover, assist, other), whether it can be used on the map, in battle, or both, the battle action it runs (which sets its PP cost and target), and the level at which Ness, Paula, and Poo learn it (0 for never). Jeff learns none. The first name, PSI(????), is a placeholder. earthbound-tables/psi
src/data/battle/psi_abilities.asm#L1-L649
PSI_ABILITY_TABLE:
.BYTE $00 ;Name
.BYTE $00 ;Level
.BYTE $00 ;Type
.BYTE $00 ;Target
.WORD BATTLE_ACTIONS::NO_EFFECT
.BYTE $00 ;Level (Ness)
.BYTE $00 ;Level (Paula)
.BYTE $00 ;Level (Poo)
.BYTE $00 ;Position in PSI menu (X)
.BYTE $00 ;Position in PSI menu (Y)
…ebsrc: Source code recreation for the game Earthbound · src/data/battle/psi_names.asm#L1-L39PSI_NAME_TABLE:
.IF .DEFINED(JPN)
…
.ELSE
PADDEDEBTEXT "PSI(????)", PSI_NAME_SIZE
PADDEDEBTEXT "PSI Fire ", PSI_NAME_SIZE
PADDEDEBTEXT "PSI Freeze ", PSI_NAME_SIZEEarthBound (USA) · 0x158a50-0x158d79 — $D5:8A50-$D5:8D79: PSI_ABILITY_TABLE, 15 bytes a powerebsrc: Source code recreation for the game Earthbound · src/battle/generate_psi_list.asm#L14-L207STACK_RESERVE_PARAM_INT16 ;int character
STACK_RESERVE_PARAM_INT8 ;char usability
STACK_RESERVE_PARAM_INT8 ;char categories
END_STACK_VARS
TAX
SEP #PROC_FLAGS::ACCUM8
LDA @PARAM02
STA @LOCAL08
LDA @PARAM01
STA @VIRTUAL01
…
LDA @LOCAL07
…ebsrc: Source code recreation for the game Earthbound · include/structs.asm#L733-L745.STRUCT psi_ability
name .byte ;0
level .byte ;1
category .byte ;2
usability .byte ;3
battle_action .word ;4
ness_level .byte ;6
paula_level .byte ;7
poo_level .byte ;8
menu_x .byte ;9
menu_y .byte ;10
text .dword ;11
…ebsrc: Source code recreation for the game Earthbound · include/constants/battle.asm#L87-L131.ENUM PSI_LEVEL
ALPHA = 1
BETA = 2
GAMMA = 3
SIGMA = 4
OMEGA = 5
.ENDENUM
…
.ENUM PSI_CATEGORY
OFFENSE = 1
RECOVER = 2
ASSIST = 4
…Checked by claude, 2026-11-08 — parsed every entry's eleven lines on the US branch at the pinned commit and compared the name and level bytes and the three learn levels with the ROM's 15 bytes per entry; read the PSI menu's usability mask test and its level comparisonRevised after a check by a second AI model, 2026-11-08.PP cost and target come from each power's battle action (earthbound-tables/battle-actions). The fourth byte (offset 3), which the data's comment calls Target, is a mask the PSI menu tests against overworld (1) and battle (2), as the structure's name for it (usability) says.
The experience table gives each of the four characters the total experience at which each level from 2 to 99 begins, 4 bytes a level: Ness reaches level 99 at 8071613, Paula at 9216700, Jeff at 9905080, and Poo at 9993637. Gaining experience below level 99 reads the entry for the next level. earthbound-tables/experience
src/data/exp_table.asm#L1-L406
EXP_TABLE:
;Ness
.DWORD 0
.DWORD 0
.DWORD 4
.DWORD 17
.DWORD 44
…EarthBound (USA) · 0x158f49-0x159588 — $D5:8F49-$D5:9588: EXP_TABLE, 100 four-byte totals a characterebsrc: Source code recreation for the game Earthbound · src/misc/gain_exp.asm#L37-L59 LDA #MAX_LEVEL
CLC
SBC @VIRTUAL04
JUMPLTEQS @UNKNOWN6
MOVE_INT @VIRTUAL06, @VIRTUAL0A
LOADPTR EXP_TABLE, @VIRTUAL06
LDA @LOCAL00
OPTIMIZED_MULT @VIRTUAL04, 4
STA @VIRTUAL04
INC @VIRTUAL04
INC @VIRTUAL04
INC @VIRTUAL04
…Our readingbelow level 9937–41read entry (level + 1) of the character's 10042–59ebsrc: Source code recreation for the game Earthbound · include/config.asm#L78-L78.DEFINE MAX_LEVEL 99Checked by claude, 2026-11-08 — parsed the 400 totals on the US branch at the pinned commit; read gain_exp's lookup (4 × level + 4, plus 400 × the character)Revised after a check by a second AI model, 2026-11-08.Each character's 100 entries start with one for level 0, which is 0 and not listed; level 1's is 0 too.
Cited by: Growth rate
Each character has a growth rate for each of seven stats, which the level-up routine reads: Ness's are Offense 18, Defense 5, Speed 4, Guts 7, Vitality 5, IQ 5, Luck 6; Paula's 12, 3, 8, 5, 2, 7, 5; Jeff's 10, 6, 5, 5, 3, 9, 4; Poo's 21, 18, 7, 3, 4, 4, 3. earthbound-tables/growth
Value: character Ness, Paula, Jeff, Poo · offense 18, 12, 10, 21 · defense 5, 3, 6, 18 · speed 4, 8, 5, 7 · guts 7, 5, 5, 3 · vitality 5, 2, 3, 4 · IQ 5, 7, 9, 4 · luck 6, 5, 4, 3
Codeebsrc: Source code recreation for the game Earthbound ·src/data/stats_growth_vars.asm#L1-L6 ;Offense, Defense, Speed, Guts, Vitality, IQ, Luck
STATS_GROWTH_VARS:
.BYTE $12, $05, $04, $07, $05, $05, $06
.BYTE $0C, $03, $08, $05, $02, $07, $05
.BYTE $0A, $06, $05, $05, $03, $09, $04
.BYTE $15, $12, $07, $03, $04, $04, $03EarthBound (USA) · 0x15ea5b-0x15ea76 — $D5:EA5B-$D5:EA76: STATS_GROWTH_VARS, seven bytes a characterOn each level up, Offense, Defense, Speed, Guts, and Luck each rise by a gain worked out from the character's growth rate for the stat, the level they are leaving, and the stat itself: first growth rate × level − (stat − 2) × 10, and no gain when that is 0 or less; otherwise that times a multiplier, divided by 50, where the multiplier is 7 to 10 at random when the new level is a multiple of 4 and 3 to 6 otherwise. A stat already at or above growth rate × level ÷ 10 + 2 so gains nothing, which keeps each stat near its growth line. Vitality and IQ each take one of two rules, chosen by testing 10 against a value this reading doesn't trace: the same rule, or the gain (growth rate × level − (stat − 2) × 10) ÷ 10 with no random part. Which levels take which is a gap. CodeChecked by claude, 2026-11-08 — read the four rows on the US branch at the pinned commit and their column commentRevised after a check by a second AI model, 2026-11-08.The order of the columns is the disassembly's comment above the table; level_up_char.asm reads them in that order (offset 0 for Offense up to 6 for Luck) as it raises each stat. The rule that turns a rate into a gain is earthbound-tables/level-up-gains.
Cited by: Growth rate
The table of starting characters gives each character a level, experience, money, and items: Ness has level 1 with $20 and ATM card; Paula level 1 with Bread roll, Teddy bear; Jeff level 1 with Big bottle rocket, Boiled egg, Ruler, Protractor, Broken spray can; and Poo level 15 with 6000 experience and Tiny ruby, Bottle of water. earthbound-tables/starting-stats
Value: character Ness, Paula, Jeff, Poo · money 20, 0, 0, 0 · level 1, 1, 1, 15 · exp 0, 0, 0, 6000 · items ATM card, Bread roll, Teddy bear, Big bottle rocket, Boiled egg, Ruler, Protractor, Broken spray can, Tiny ruby, Bottle of water
Code notesebsrc: Source code recreation for the game Earthbound ·src/data/initial_stats.asm#L1-L26
INITIAL_STATS:
;Ness
.BYTE $F7, $03, $8A, $00
.WORD 20 ;money
.WORD 1 ;level
.WORD 0 ;EXP
.BYTE ITEM::ATM_CARD, ITEM::NONE, ITEM::NONE, ITEM::NONE, ITEM::NONE, ITEM::NONE, ITEM::NONE, ITEM::NONE, ITEM::NONE, ITEM::NONE
;Paula
.BYTE $00, $00, $00, $00
.WORD 0 ;money
.WORD 1 ;level
…EarthBound (USA) · 0x15f5f5-0x15f644 — $D5:F5F5-$D5:F644: INITIAL_STATSChecked by claude, 2026-11-08 — read the four entries on the US branch at the pinned commitRevised after a check by a second AI model, 2026-11-08.Each entry also opens with four bytes the disassembly leaves unnamed ($F7, $03, $8A, $00 for Ness, zeros for the rest).
On each level up, Offense, Defense, Speed, Guts, and Luck each rise by a gain worked out from the character's growth rate for the stat, the level they are leaving, and the stat itself: first growth rate × level − (stat − 2) × 10, and no gain when that is 0 or less; otherwise that times a multiplier, divided by 50, where the multiplier is 7 to 10 at random when the new level is a multiple of 4 and 3 to 6 otherwise. A stat already at or above growth rate × level ÷ 10 + 2 so gains nothing, which keeps each stat near its growth line. Vitality and IQ each take one of two rules, chosen by testing 10 against a value this reading doesn't trace: the same rule, or the gain (growth rate × level − (stat − 2) × 10) ÷ 10 with no random part. Which levels take which is a gap. earthbound-tables/level-up-gains
Value
{
"multiplier": {
"new level a multiple of 4": "7–10",
"otherwise": "3–6"
},
"divisor": 50
}src/unknown/C1/C1D08B.asm#L2-L64UNKNOWN_C1D08B:
BEGIN_C_FUNCTION
STACK_RESERVE_VARS
STACK_RESERVE_INT16
STACK_RESERVE_INT8
STACK_RESERVE_INT16
STACK_RESERVE_PARAM_INT16 "LEVEL" ;int
STACK_RESERVE_PARAM_INT8 "LEVEL_CONSTANT" ;char
STACK_RESERVE_PARAM_INT8 "BASE_VITALITY" ;char
END_STACK_VARS
TAY
STY @LOCAL02
…Our readingx = growth rate × level − (stat − 2) × 1015–33if x ≤ 0: the gain is 034–41m = a random number from 0 to 3, plus the table's byte for (level + 1) mod 4, minus 142–57the gain is x × m ÷ 5058–62ebsrc: Source code recreation for the game Earthbound · src/data/unknown/C3F2B1.asm#L1-L3
UNKNOWN_C3F2B1:
.BYTE $08, $04, $04, $04ebsrc: Source code recreation for the game Earthbound · src/system/math/rand_mod.asm#L1-L15
RAND_MOD:
BEGIN_C_FUNCTION_FAR
STACK_RESERVE_VARS
STACK_RESERVE_INT16
STACK_RESERVE_PARAM_INT16
END_STACK_VARS
TAX
STX @LOCAL00
JSL RAND
LDX @LOCAL00
TXY
…ebsrc: Source code recreation for the game Earthbound · src/misc/level_up_char.asm#L26-L40 ADC #.LOWORD(PARTY_CHARACTERS)+char_struct::level
STA @VIRTUAL02
LDX @VIRTUAL02
SEP #PROC_FLAGS::ACCUM8
LDA __BSS_START__,X
STA @LOCAL04
REP #PROC_FLAGS::ACCUM8
AND #$00FF
STA @VIRTUAL04
STA @LOCAL03
SEP #PROC_FLAGS::ACCUM8
LDA @LOCAL04
…Our readingread the level, keep it as the level being left, and store it plus 126–40ebsrc: Source code recreation for the game Earthbound · src/misc/level_up_char.asm#L260-L318@UNKNOWN16:
LDA #10
CLC
SBC @VIRTUAL04
BRANCHLTEQS @UNKNOWN19
LDY @LOCAL06
TYA
LDY #.SIZEOF(char_struct)
JSL MULT168
TAX
LDA PARTY_CHARACTERS+char_struct::base_vitality,X
AND #$00FF
…Our readinga test against 10 picks the rule for Vitality261–264one way: (growth rate × level − (Vitality − 2) × 10) ÷ 10265–293the other: the rule above295–318ebsrc: Source code recreation for the game Earthbound · src/misc/level_up_char.asm#L61-L460ADC #.LOWORD(PARTY_CHARACTERS)+char_struct::base_offense
…
LDA f:STATS_GROWTH_VARS,X
…
JSR UNKNOWN_C1D08B
…
ADC #.LOWORD(PARTY_CHARACTERS)+char_struct::base_defense
…
LDA f:STATS_GROWTH_VARS,X
…
JSR UNKNOWN_C1D08B
…
…Checked by claude, 2026-11-08 — read UNKNOWN_C1D08B, its table, RAND_MOD (a random number modulo n + 1), and level_up_char's calls on the US branchRevised after a check by a second AI model, 2026-11-08.The table at UNKNOWN_C3F2B1 holds 8, 4, 4, 4. Which levels take Vitality's and IQ's plain rule depends on a value this reading doesn't trace; the growth rates are earthbound-tables/growth.
Cited by: Growth rate
The store table lists 66 shops, seven item slots each; one is empty. Each slot holds an item number, which the shop menu looks up in the item table (earthbound-tables/items), where the prices are. earthbound-tables/shops
src/data/store_inventories.asm#L1-L529
STORE_TABLE:
.BYTE ITEM::NONE
.BYTE ITEM::NONE
.BYTE ITEM::NONE
.BYTE ITEM::NONE
.BYTE ITEM::NONE
.BYTE ITEM::NONE
…EarthBound (USA) · 0x1576b2-0x15787f — $D5:76B2-$D5:787F: STORE_TABLE, 7 items a shopebsrc: Source code recreation for the game Earthbound · src/unknown/C1/C19DB5.asm#L27-L51OPTIMIZED_MULT @VIRTUAL04, 7
LDX @LOCAL04
STX @VIRTUAL04
CLC
ADC @VIRTUAL04
TAX
LDA f:STORE_TABLE,X
AND #$00FF
TAY
STY @LOCAL03
BEQL @UNKNOWN2
LOADPTR ITEM_CONFIGURATION_TABLE, @VIRTUAL06
…Every one of the 254 item slots has 39 bytes in the item configuration table: its name, its type byte, its price, who can use it (Ness, Paula, Jeff, Poo) and whether it is used up, can't be given away, or transforms, the battle action it performs, four parameter bytes, and its help text. 85 items are equipment (42 weapons, 11 body, 12 arms, 20 other), told by the type byte: bits 4–5 hold 1 for equipment (the item-type routine returns 2 for that value, and the code that lists gear by slot checks for 2), and bits 2–3 give the slot (weapon, body, arms, other). On equipment the first parameter (signed) adds to Offense on a weapon and to Defense elsewhere, the second does the same for Poo instead of the first, the third adds to Guts on a weapon, Speed on body gear, and Luck on arms and other gear, and the fourth is a weapon's miss rate or the armor's resistances. The most expensive is the Diamond band at $9998. CodeChecked by claude, 2026-11-08 — parsed the 462 bytes on the US branch at the pinned commit; read the shop window's index (shop × 7 + slot) and its skip of empty slotsRevised after a check by a second AI model, 2026-11-08.Shops are numbered as the table holds them; which clerk opens which shop is in the event scripts, which this claim doesn't read.
The NPC table holds 177 NPCs of the item-box type, each with what it holds and an event flag, which checking the box copies for its script: an item, or money when the value is $100 or more (the value less $100), as 5 do. The sprite placement table puts all of them on the map, by sector (32 columns by 40 rows). earthbound-tables/gifts
src/data/map/npc_config.asm#L2-L14434NPC_CONFIG_TABLE:
.BYTE NPC_TYPE::PERSON
.WORD OVERWORLD_SPRITE::NESS
.BYTE DIRECTION::DOWN
.WORD EVENT_SCRIPT::EVENT_010
.WORD EVENT_FLAG::NONE
.BYTE TPT_FLAG::SHOW_IF_OFF
.DWORD NULL
.DWORD NULL
…ebsrc: Source code recreation for the game Earthbound · src/overworld/check.asm#L36-L90CMP #NPC_TYPE::ITEM_BOX
BEQ @UNKNOWN5
CMP #NPC_TYPE::OBJECT
BEQL @UNKNOWN8
JMP @UNKNOWN9
@UNKNOWN5:
LDA @LOCAL01
CLC
ADC #npc_config::item
MOVE_INTX @LOCAL02, @VIRTUAL06
CLC
ADC @VIRTUAL06
…Our readingan item box36read its 16-bit contents value41–49below $100: an item50–55else money: the value less $10056–77ebsrc: Source code recreation for the game Earthbound · src/data/map/sprite_placement_table.asm#L1-L12
SPRITE_PLACEMENT_TABLE:
SPRITE_PLACEMENT_ENTRY_0:
.WORD $0001
.WORD 1254
.BYTE 112, 152
SPRITE_PLACEMENT_ENTRY_1:
.WORD $0004
.WORD 1251
.BYTE 112, 208
.WORD 1267ebsrc: Source code recreation for the game Earthbound · src/overworld/try_spawn_npcs.asm#L25-L42 CMP #32
BCC @UNKNOWN0
JMP @UNKNOWN29
@UNKNOWN0:
LDA @LOCAL0C
CMP #40
BCC @UNKNOWN1
JMP @UNKNOWN29
@UNKNOWN1:
LDA @VIRTUAL04
ASL
STA @VIRTUAL02
…Checked by claude, 2026-11-08 — parsed the NPC table and the sprite placement table on the US branch at the pinned commit; read the box check's item-or-money test and the placement lookup (sector row × 32 + column, column below 32, row below 40)Revised after a check by a second AI model, 2026-11-08.NPC numbers are positions in the NPC table. The two bytes that place a sprite within its sector are in the placement table. The contents value is the byte after the box's text pointer and the next one.
The battle entry table names 484 battle groups, each a pointer to a list of enemies, an event flag, a byte for that flag's state, and a letterbox byte, as the disassembly's structure names them; what the flag and letterbox bytes do isn't read here. earthbound-tables/battle-groups
src/data/map/battle_entry_pointer_table.asm#L1-L2421
BTL_ENTRY_PTR_TABLE:
.DWORD ENEMY_GROUP_000
.WORD $0000
.BYTE $00
.BYTE 00
.DWORD ENEMY_GROUP_001
.WORD $0040
.BYTE $01
.BYTE 03
…ebsrc: Source code recreation for the game Earthbound · src/data/map/battle_groups_table.asm#L1-L2445
ENEMY_BATTLE_GROUPS_TABLE:
ENEMY_GROUP_000:
.BYTE 3
.WORD ENEMY::SPITEFUL_CROW
.BYTE $FF
UNKNOWN_D0D531:
.BYTE $01
…ebsrc: Source code recreation for the game Earthbound · include/structs.asm#L386-L391.STRUCT battle_entry_ptr_entry
pointer .dword ;0
run_away_flag .word ;4
run_away_flag_state .byte ;6
letterbox_style .byte ;7
.ENDSTRUCTEarthBound (USA) · 0x10c60d-0x10d52c — $D0:C60D-$D0:D52C: BTL_ENTRY_PTR_TABLE, 8 bytes a groupChecked by claude, 2026-11-08 — parsed both tables on the US branch at the pinned commit: each entry's pointer resolved to its enemy listRevised after a check by a second AI model, 2026-11-08.The flag and letterbox fields are named from the disassembly's structure; this claim doesn't read the code that uses them. Some enemy lists carry a label of their own inside another's (UNKNOWN_D0D531 follows ENEMY_GROUP_000's end).
The map's enemy placement grid gives each 64-pixel square of the 128 × 160 map a placement number, and the placement table gives each of its 203 numbers an event flag, a spawn chance in 100, a second chance used once the flag is set, and up to two weighted lists of battle groups, each list's weights adding to 8; the second list replaces the first once the flag is set, if the first chance isn't 0. 195 placements are used by the grid's 1640 non-zero squares; 0 means no placement (it fills the other 18,840 squares), and 7 (9, 31, 38, 52, 149, 195, 196) are used by no square. earthbound-tables/enemy-placements
src/data/map/enemy_placement_groups.asm#L1-L2658
ENEMY_PLACEMENT_GROUPS_TABLE:
ENEMY_PLACEMENT_GROUP_000:
.WORD EVENT_FLAG::NONE
.BYTE $64, $00
.BYTE $08
.WORD ENEMY_GROUP::UNKNOWN_000
ENEMY_PLACEMENT_GROUP_001:
.WORD EVENT_FLAG::FLG_INFO_XYZ
.BYTE $05, $08
…ebsrc: Source code recreation for the game Earthbound · src/data/map/enemy_placement.asm#L1-L2
MAP_ENEMY_PLACEMENT:ebsrc: Source code recreation for the game Earthbound · src/overworld/get_encounter_group_id.asm#L9-L21 CMP #MAP_WIDTH_TILES
BCS @UNKNOWN0
CPX #MAP_HEIGHT_TILES
BCS @UNKNOWN0
ASL
STA @VIRTUAL02
TXA
XBA
AND #$FF00
CLC
ADC @VIRTUAL02
TAX
…ebsrc: Source code recreation for the game Earthbound · include/enums.asm#L78-L83.DEFINE MAP_WIDTH_TILES8 1024
.DEFINE MAP_HEIGHT_TILES8 1280
; Map width and height, measured in number of 64x64 tiles
.DEFINE MAP_WIDTH_TILES MAP_WIDTH_TILES8 / 8
.DEFINE MAP_HEIGHT_TILES MAP_HEIGHT_TILES8 / 8EarthBound (USA) · 0x101880-0x10b87f — $D0:1880-$D0:B87F: MAP_ENEMY_PLACEMENT, a word a squareebsrc: Source code recreation for the game Earthbound · include/structs.asm#L374-L384.STRUCT enemy_placement
event_flag .word ;0
spawn_chance .byte ;2
spawn_chance_alt .byte ;3
groups .tag nothing ;4
.ENDSTRUCT
.STRUCT enemy_group
slots .byte ;0
group .word ;1
.ENDSTRUCTebsrc: Source code recreation for the game Earthbound · src/data/map/enemy_placement_groups_pointer_table.asm#L1-L205ENEMY_PLACEMENT_GROUPS_PTR_TABLE:
.DWORD ENEMY_PLACEMENT_GROUP_000
.DWORD ENEMY_PLACEMENT_GROUP_001
…
.DWORD ENEMY_PLACEMENT_GROUP_201
.DWORD ENEMY_PLACEMENT_GROUP_202Enemies on the map are spawned square by square, 64 pixels each, and each try first counts: every 16th try is a Magic Butterfly try instead, spawned with a chance in 100 set by the sector's type (2, 0, 1, 0, 5, or 1 for types 0 to 5). Otherwise the square's placement number is looked up; nothing spawns there if it is 0, or if the square's tileset isn't the one loaded. The placement's spawn chance is the first one, or, once its event flag is set, the second; then a roll of a random byte × 100 ÷ 256 below the chance spawns, and a random number from 0 to 7 walks the weighted list, the second list once the flag is set and the first chance isn't 0. The pick fails if one of the group's enemies from this square is already on the map; each enemy then fails if the map already holds its maximum of enemies, and a Magic Butterfly also fails while the flag the routine sets on spawning one is set; otherwise it is placed by up to 20 tries at a random free spot in the square. A debug branch at the routine's start, live only when the debug setting is on, is left out. CodeChecked by claude, 2026-11-08 — parsed the 20,480-word grid, the pointer table, and every placement group on the US branch at the pinned commit; read GET_ENCOUNTER_GROUP_ID's index (row × 256 + column × 2) and the spawn routine's use of the fields (earthbound-tables/enemy-spawns)Revised after a check by a second AI model, 2026-11-08.A list entry reads as weight/8 and the battle group it picks (earthbound-tables/battle-groups). Squares are numbered from the map's top left, x then y, 64 pixels each. The grid itself, 20,480 numbers, is in the ROM map, not here.
Cited by: Visible encounter
Enemies on the map are spawned square by square, 64 pixels each, and each try first counts: every 16th try is a Magic Butterfly try instead, spawned with a chance in 100 set by the sector's type (2, 0, 1, 0, 5, or 1 for types 0 to 5). Otherwise the square's placement number is looked up; nothing spawns there if it is 0, or if the square's tileset isn't the one loaded. The placement's spawn chance is the first one, or, once its event flag is set, the second; then a roll of a random byte × 100 ÷ 256 below the chance spawns, and a random number from 0 to 7 walks the weighted list, the second list once the flag is set and the first chance isn't 0. The pick fails if one of the group's enemies from this square is already on the map; each enemy then fails if the map already holds its maximum of enemies, and a Magic Butterfly also fails while the flag the routine sets on spawning one is set; otherwise it is placed by up to 20 tries at a random free spot in the square. A debug branch at the routine's start, live only when the debug setting is on, is left out. earthbound-tables/enemy-spawns
src/overworld/spawn_enemies_from_group.asm#L2-L430SPAWN_ENEMIES_FROM_GROUP:
BEGIN_C_FUNCTION
STACK_RESERVE_VARS
STACK_RESERVE_INT32
STACK_RESERVE_INT16
STACK_RESERVE_INT16
STACK_RESERVE_INT16
STACK_RESERVE_INT16
STACK_RESERVE_INT16
STACK_RESERVE_INT16
STACK_RESERVE_INT32
STACK_RESERVE_INT32
…Our readingcount the try; unless it is a 16th, skip the butterfly37–41the sector's type picks a butterfly chance: 2, 0, 1, 0, 5, 161–103a random number mod 100 below it spawns the Magic Butterfly104–118no placement, or the square's tileset isn't loaded: nothing119–146the chance is the placement's first148–174if its flag is set: the second chance, and the second list when the first chance isn't 0176–191spawn only if a random byte × 100 ÷ 256 is below the chance192–206r = a random number from 0 to 7, plus 8 for the second list; walk the weights to r207–238the group picked239–243if an entity from this group and square exists: nothing244–277ebsrc: Source code recreation for the game Earthbound · src/overworld/spawn_enemies_from_group.asm#L348-L387@UNKNOWN25:
JSL RAND
LDY ENEMY_SPAWN_RANGE_WIDTH
JSL MODULUS16
STA @VIRTUAL02
LDA @LOCAL0C
…
CMP #20
BNE @UNKNOWN25Our readingplace the enemy at a random spot in the square, up to 20 tries348–387ebsrc: Source code recreation for the game Earthbound · src/overworld/spawn_enemies_from_group.asm#L25-L41LDA DEBUG
BEQ @UNKNOWN0
JSL DEBUG_ENEMIES_ENABLED
CMP #0
BEQ @UNKNOWN0
JSL RAND
CMP #16
BCS @UNKNOWN0
STZ @LOCAL0B
LOADPTR ENEMY_BATTLE_GROUPS_TABLE, @VIRTUAL0A
JMP @UNKNOWN31
@UNKNOWN0:
…ebsrc: Source code recreation for the game Earthbound · src/overworld/spawn_enemies_from_group.asm#L61-L103LDA f:MAP_DATA_PER_SECTOR_ATTRIBUTES_TABLE,X
AND #$0007
BEQ @UNKNOWN2
CMP #1
BEQ @UNKNOWN3
CMP #2
BEQ @UNKNOWN4
CMP #3
BEQ @UNKNOWN5
CMP #4
BEQ @UNKNOWN6
CMP #5
…ebsrc: Source code recreation for the game Earthbound · src/overworld/spawn_enemies_from_group.asm#L119-L146@UNKNOWN10:
LDY @LOCAL0E
BEQL @UNKNOWN32
LDA @LOCAL0C
OPTIMIZED_MULT @VIRTUAL04, 8
LSR
LSR
LSR
LSR
LSR
STA @VIRTUAL02
LDA @LOCAL0D
…ebsrc: Source code recreation for the game Earthbound · src/overworld/spawn_enemies_from_group.asm#L171-L238LDA [@LOCAL07] ;enemy_placement::spawn_chance
AND #$00FF
STA ENEMY_SPAWN_CHANCE
LDX #0
STX @LOCAL06
LDA @LOCAL09
BEQ @UNKNOWN13
JSL GET_EVENT_FLAG
CMP #0
BEQ @UNKNOWN13
SEP #PROC_FLAGS::ACCUM8
LDY #enemy_placement::spawn_chance_alt
…ebsrc: Source code recreation for the game Earthbound · src/overworld/spawn_enemies_from_group.asm#L258-L277@UNKNOWN17:
TYA
ASL
TAX
LDA ENTITY_SCRIPT_TABLE,X
CMP #.LOWORD(-1)
BEQ @UNKNOWN18
LDA @LOCAL0B
CLC
ADC #$8000
CMP ENTITY_NPC_IDS,X
BNE @UNKNOWN18
…ebsrc: Source code recreation for the game Earthbound · src/overworld/spawn_enemies_from_group.asm#L322-L332LDA @LOCAL04
CMP #ENEMY::MAGIC_BUTTERFLY
BNE @UNKNOWN23
LDA MAGIC_BUTTERFLY_SPAWNED
BNEL @UNKNOWN29
@UNKNOWN23:
LDA OVERWORLD_ENEMY_COUNT
CMP OVERWORLD_ENEMY_MAXIMUM
BNE @UNKNOWN24
INC ENEMY_SPAWN_TOO_MANY_ENEMIES_FAILURE_COUNT
JMP @UNKNOWN29ebsrc: Source code recreation for the game Earthbound · src/overworld/spawn_enemies_from_group.asm#L416-L420LDA @LOCAL04
CMP #ENEMY::MAGIC_BUTTERFLY
BNE @UNKNOWN29
LDA #1
STA MAGIC_BUTTERFLY_SPAWNEDChecked by claude, 2026-11-08 — read SPAWN_ENEMIES_FROM_GROUP on the US branch at the pinned commit; the debug branch at its start, which spawns any group when a debug setting is on, is left outRevised after a check by a second AI model, 2026-11-08.Sector types 6 and 7 leave the butterfly chance unset in this routine. The piracy check, when tripped, skips the chance roll so every try spawns. When the game calls this routine (as squares come into view) isn't read here. Contact with a spawned enemy starts the battle (earthbound/contact-initiative).
Cited by: Visible encounter
The song table has 191 entries, one for each song number from 1 to 191; each is three bytes, the primary sample pack, the secondary sample pack, and the sequence pack that the sound driver loads (255 skips that load). This is the game's track listing, by song number, with where the game plays each, from every request found: the music byte of each enemy (the battle's first enemy sets the battle music), the map's music lists that the 2560 map sectors point to, the Sound Stone's list, the song each final-battle scene is passed, the calls to the music-change routine in the code, and the music control codes in the text scripts, battle messages included. 186 entries are requested; no request found reaches 10, 109, 133, 180, 189. These are candidates for unused, not findings: the debug sound menu, where it can be reached, steps through every number from 0 to 191, and a text control code with a zero argument takes its song from a value the script set earlier. earthbound-tables/tracks
About: EarthBound Music driver
Codeebsrc: Source code recreation for the game Earthbound ·src/data/music/dataset_table.asm#L1-L193
MUSIC_DATASET_TABLE:
.BYTE $00, $FF, $01
.BYTE $02, $03, $04
.BYTE $02, $03, $04
.BYTE $05, $FF, $FF
…EarthBound (USA) · 0x4f70a-0x4f946 — $C4:F70A-$C4:F946: 191 three-byte entriesebsrc: Source code recreation for the game Earthbound · src/audio/change_music.asm#L32-L115DEY
…
LDA f:MUSIC_DATASET_TABLE,X ;pack_table_entry::primary_sample_pack
…
CMP CURRENT_PRIMARY_SAMPLE_PACK
…
CMP #$00FF
…
STA CURRENT_PRIMARY_SAMPLE_PACK
…
LDA f:MUSIC_DATASET_TABLE,X ;pack_table_entry::secondary_sample_pack
…
…Our readingsong n reads entry n-132–37ebsrc: Source code recreation for the game Earthbound · include/constants/music.asm#L1-L194.ENUM MUSIC
NONE = 0
GAS_STATION = 1
NAMING_SCREEN = 2
SETUP_SCREEN = 3
…ebsrc: Source code recreation for the game Earthbound · src/unknown/C0/C068F4.asm#L19-L70ASL
ASL
ASL
ASL
ASL
CLC
ADC @VIRTUAL02
TAX
LDA f:MAP_DATA_PER_SECTOR_MUSIC,X
AND #$00FF
STA @LOCAL01
LOADPTR DOOR_DATA & $FF0000, @VIRTUAL0A
…Our readingsector music byte → OVERWORLD_EVENT_MUSIC_PTR_TABLE entry → first (flag, song) pair whose flag test passes, or the last, NULL-flagged one27–70ebsrc: Source code recreation for the game Earthbound · src/battle/main_battle_routine.asm#L329-L337 LDA ENEMIES_IN_BATTLE_IDS
LDY #.SIZEOF(enemy_data)
JSL MULT168
CLC
ADC #enemy_data::music
TAX
LDA f:ENEMY_CONFIGURATION_TABLE,X
AND #$00FF
JSL CHANGE_MUSICOur readingbattle music = enemy_data::music of ENEMIES_IN_BATTLE_IDS[0]329–337ebsrc: Source code recreation for the game Earthbound · src/data/music/sound_stone_music.asm#L1-L11SOUND_STONE_MUSIC:
.BYTE MUSIC::SOUNDSTONE_RECORDING_GIANT_STEP
.BYTE MUSIC::SOUNDSTONE_RECORDING_LILLIPUT_STEPS
.BYTE MUSIC::SOUNDSTONE_RECORDING_MILKY_WELL
.BYTE MUSIC::SOUNDSTONE_RECORDING_RAINY_CIRCLE
.BYTE MUSIC::SOUNDSTONE_RECORDING_MAGNET_HILL
.BYTE MUSIC::SOUNDSTONE_RECORDING_PINK_CLOUD
.BYTE MUSIC::SOUNDSTONE_RECORDING_LUMINE_HALL
.BYTE MUSIC::SOUNDSTONE_RECORDING_FIRE_SPRING
.BYTE MUSIC::SOUNDSTONE_BGMebsrc: Source code recreation for the game Earthbound · src/text/ccs/play_music.asm#L16-L36 LDA @LOCAL00
SEP #PROC_FLAGS::ACCUM8
LDX CC_ARGUMENT_GATHERING_LOOP_COUNTER
STA CC_ARGUMENT_STORAGE,X
REP #PROC_FLAGS::ACCUM8
INC CC_ARGUMENT_GATHERING_LOOP_COUNTER
LDA #.LOWORD(CC_1F_00)
BRA @UNKNOWN5
@UNKNOWN2:
LDA @LOCAL00
BEQ @UNKNOWN3
STORE_INT1632 @VIRTUAL06
…Our readingargument 0 → the song comes from GET_ARGUMENT_MEMORY16–36EarthBound (USA) · 0x1cd637-0x1ce036 — $DC:D637-$DC:E036: 2560 sector music bytesEarthBound (USA) · 0xf5a39-0xf61dc — $CF:5A39-$CF:61DC: 164 music listsebsrc: Source code recreation for the game Earthbound · src/system/debug/debug_sound_menu.asm#L104-L114LDA DEBUG_SOUND_MENU_SELECTED_BGM
CMP #.LOWORD(-1)
BNE @UNKNOWN14
LDA #191
STA DEBUG_SOUND_MENU_SELECTED_BGM
@UNKNOWN14:
LDA DEBUG_SOUND_MENU_SELECTED_BGM
CMP #192
BNE @UNKNOWN15
LDA #1
STA DEBUG_SOUND_MENU_SELECTED_BGMEarthBound (USA) · 0x50000-0x57fc0 — $C5:0000-$C5:7FC0: textEarthBound (USA) · 0x58000-0x5ffeb — $C5:8000-$C5:FFEB: textEarthBound (USA) · 0x60000-0x67eeb — $C6:0000-$C6:7EEB: textEarthBound (USA) · 0x68000-0x6ffe2 — $C6:8000-$C6:FFE2: textEarthBound (USA) · 0x70000-0x77eff — $C7:0000-$C7:7EFF: textEarthBound (USA) · 0x78000-0x7ff3f — $C7:8000-$C7:FF3F: textEarthBound (USA) · 0x80000-0x87f22 — $C8:0000-$C8:7F22: textEarthBound (USA) · 0x88000-0x8fff2 — $C8:8000-$C8:FFF2: text, and the compressed-text pointers at 0x8cded-0x8d9ecEarthBound (USA) · 0x90000-0x97fb2 — $C9:0000-$C9:7FB2: textEarthBound (USA) · 0x98000-0x9ff2e — $C9:8000-$C9:FF2E: textEarthBound (USA) · 0x2f4e20-0x2fa379 — $EF:4E20-$EF:A379: textChecked by claude, 2026-11-08 — Parsed src/data/music/dataset_table.asm and checked its 573 bytes against the ROM; collected every MUSIC:: reference in the 3395 files the US bank configuration includes, kept those that reach CHANGE_MUSIC or the final battle's music parameter, traced the 37 CHANGE_MUSIC calls' arguments, walked the 2560 sector bytes through the pointer table to the lists, and counted the music control codes in the text the disassembly's build extracts from this ROM (ebbinex); scratch/gen-tracks.mjs.Revised after a check by a second AI model, 2026-11-08.The disassembly names each number in include/constants/music.asm; those names are not titles. 14 songs serve as battle music. Map music lists 25, 27, 29, 32, 156 have no sector pointing to them. Song 0, no music, has no entry: the music-change routine reads entry n−1. The text control codes were counted in the text banks cited here (banks $C5 to $C9 and the dialogue block in bank $EF), as the disassembly's build tool (ebbinex) extracts them from this ROM: each music control code and the song it names. The text control code that sets song 0 is the one with a zero argument.