Full Disassembly including:
Disassembly is 100% finished, assembles under asar and produces a fully clean ROM. Do asar/asar disassembly/assemble.asm yi.sfc
to assemble the full ROM.
Not all code is documented, however, so we would welcome any efforts in documentation including naming labels and comments, etc.
Please make sure, before you submit any changes, corrections, or documentation, that the code still assembles correctly and still produces a clean ROM (please run a diff or hash compare with a clean U 1.0 ROM to find out).
Target version: V1.0 (NTSC-US)
Clean ROM hashes:
Consult the wiki, ROM Map, RAM Map, and SRAM Map for technical information about the game that was found using this disassembly.
all_lowercase_and_underscore_delimiting
for label names.:
, sublabels don't.Example:
init_hookbill:
...
.fog_fade
...
..ret
RTS
_l
.Example:
main_loop_0F_l:
PHB
PHK
PLB
main_loop_0F:
...
.ret
for when a piece of code is primarily meant to return, including RTS
, RTL
, and any stack or other cleanup..ret
should still be used on the last one regardless.Example:
.ret_sep
SEP #$30
.ret
PLB
RTL
$hex
addresses in code with data labels, but please first check if you need to do any label arithmetic to make it correct. Often the tables will be referenced a bit off from where they actually are, due to code like PHA RTS
or the nature of $00
sometimes not being a valid index. Example: JSR (item_use_ptr-2,x)
init_
should be applied when a piece of code is meant to set something up and only runs one time for the lifespan of the operation / entity.main_
should be applied when a piece of code is meant to run every frame for a given operation / entity; it's what is driving it.check_
should be applied when a piece of code is primarily meant to check and see whether a certain operation / entity needs to be initialized, updated, or destroyed.gsu_
should be applied for all Super FX routines._ptr
for pointer tables_state_ptr
or .state_ptr
specifically for state pointer tablesPlease use !all_lowercase_and_underscore_delimiting
for variable names.
Prefix conventions:
reg_
for SNES hardware registersgsu_
for Super FX registersr_
for RAM, meaning $0000-$1FFF when data bank is $00-$3F, and $7E0000-$7FFFFFs_
for SRAM, meaning $6000-$7FFF when data bank is $00-$3F, and $700000-$71FFFFs_spr_
specifically for sprite tables in SRAMSuffix conventions:
_l
for long (24-bit) addressesUse ALL_CAPS_UNDERSCORE
for constants, example:
HOOKBILL_HEALTH = #$0003
If you come across a bug in the original code, please mark it in the comments with a bug name that begins with BUG_
. Then, somewhere above the section or routine it's found in, put the same BUG_xxxxx
name and describe it in more detail there. Example:
; BUG_wavy_column_bounds
; this should have checked > 1FC1 because the check
; aims to prevent corruption of anything outside of
; 1FC2-1FE1, but instead it checks >= 1FC1, so it
; DOES corrupt 1FC1, which is part of a different table
.wavy_column_loop
dec r11 ; $089E50 |\ wavy_column_loop exit condition:
bmi .wavy_loop_continue ; $089E51 | | wavy_width_counter has
nop ; $089E53 |/ exceeded width
iwt r0,#$1FC1 ; $089E54 |\ BUG_wavy_column_bounds
cmp r5 ; $089E57 | | screen bounds check for wavy column table
beq .flag_on_1FC2 ; $089E59 | | if wavy_column_address <= $1FC1
nop ; $089E5B | | then don't corrupt non-1FC2~1FE1 memory
bcs .check_end_of_1FC2 ; $089E5C | | so ignore flagging on
nop ; $089E5E |/ else flag on