# START END CLASS NOTE (hex VRAM, END exclusive). handwritten: reviewed
# assembly that is not recoverable game C, original hand-written code. The
# evidence is code GCC 2.6.3/2.7.2 does not emit (docs/matching.md): trapping
# add/addi, callee saves below $sp without a frame, GTE instructions in branch
# delay slots (reorg never puts an asm there) and branch targets inside them,
# the $k0/$k1/$sp context switch, a return that leaves $sp lowered, and $t
# temporaries with unfilled jr slots where a plain-C probe compile under both
# allocates $v0/$v1 first and fills the slot. Raw cop2 moves are no evidence.
# Each routine's .s file names its own. asset: game data embedded in the image
# in a format the game parses.
# text_data NAME: a data object a C unit places in .text, with the evidence
# that the original keeps it there; it counts as bytes, never as C code.
# included NAME: an object a C unit links from the original image, with the
# reason it stays original.
80072d18 800732cc handwritten scratchpad ground-map triangle batch (80072D18: callee saves below $sp without a frame, trapping `add`, GTE stores in delay slots) and GTE vector/colour/matrix helpers 80073064-800732AC ($t temporaries and unfilled `jr` slots a plain-C probe does not produce, trapping add/addi in the colour filter, a word-copy loop on $t0)
80088bfc 80088c00 text_data arena_mode_tasks arena_mode_entry's mode-task table: the pointer to arena_mode_task that arena_mode_main loads by the resident mode word mode_arena_task (80088ECC). The original keeps it in .text: the word lies between arena_progress_set_flag_and_check's return and arena_debug_draw_sync_callback, inside the overlay's code (800707a8-80090f38), which the original linker filled only with its units' .text
8008bb00 8008bcc8 handwritten task context switch: context save/restore to arena_task_caller_stack/arena_current_task in $t0/$t1 (a plain-C probe uses $v0/$v1), and full register-file save/resume through $at including $k0/$k1/$gp/$sp/$fp, with caller saves below $sp
8008c3a8 8008c7c0 handwritten GTE mesh shadow projection (a leaf on $t registers that never uses $v0/$v1, unlike a plain-C probe) and two flat packet builders with GTE moves and commands in branch delay slots and branch targets inside delay slots
8008ddfc 8008df30 handwritten GTE vector transform ($t0-$t2 temporaries a plain-C probe does not use) and a separate packet stub, which builds its stack vector through $t0/$t1, reads the existing projection FIFO without RTPS, overwrites an offset it computes and returns without restoring $sp
80090f38 8009105b asset Arena scene scripts in arena_camera_and_scenes.c's data (INCLUDE_ASSET): byte commands run by arena_scene_run_script (a switch, cases 1-34 with one to three unsigned byte operands, 0 ends), started by arena_scene_start_script: the opening arena_scene_opening_script (arena_scene_start_tutorial), the ten scene scripts of arena_scene_scripts (arena_scene_enter) and arena_scene_unreferenced_script, which nothing starts (docs/scripts/arena-scene.md; tools/analysis/overlay_scripts.py)
800910c4 800910f0 asset Arena setup script arena_scene_bout_end_script in arena_camera_and_scenes.c's data (INCLUDE_ASSET), started by arena_scene_start_bout_end, the format above
80091fb0 800925a4 asset sprite model arena_actor_extra_model (1524 bytes; resident SpriteModel format, src/decomp/include/resident/model.h): header with self-relative offsets (41 vertices, 70 primitives in one group, texture coordinate block), relocated by resident 8002C59C and attached to the actor model by arena_stage_views_and_hud 80084BEC
800925a4 800925d4 included arena_actor_combo_inputs u8[15][3] each combo's command inputs (actor.h), ending arena_scene_graph_and_opponent's data (INCLUDE_ORIGINAL) before arena_camera_and_scenes's .sbss; then the stray bytes "ind", which nothing reads (docs/matching.md)
80096d88 80096d90 handwritten the task context switch's storage (8008bb00-8008bcc8), an explicit .bss in arena_task_save_scheduler.s past the file (NOLOAD, no image bytes): the suspended caller's sp while a task runs (arena_task_caller_stack) and the running TaskContext * (arena_current_task), which only these routines address; as a section of its own, not a compiler .lcomm, it lay outside the menu assembler's small-data rule and opens arena_scene_graph_and_opponent's larger variables
