Kajar notes of ChronoRET, rebuilding Chrono Trigger one matched routine at a time

Last updated: October 9, 2026

Engine core

Bank $C0's field engine: the game loop and its per-frame calls, location loading, the map (collision, tile effects, scrolling and redraws), the field's scene changes and its hand-off to the battle and to bank $C2, window effects, the staff credits, and the object motion code. Three parts have pages of their own: Frame cycle and NMI, Field event scripts and Sprites & objects.

The field code runs with DP=$0100 (the field page, names in asm/include/ram_engine.inc) and DB=$00; the map code switches to DP=$1D00 (!DP_Map). The function table at the bottom of this page lists every routine in the "Engine" group, which also takes in the matched code of banks $C2 and $FD that has no group of its own; "Engine (unnamed)" holds the two routines still labelled Sub_: Sub_1ADF (purpose unknown) and Sub_C07F9A (no reader of its results traced).

See also: Architecture, Boot, Sprite Init Explainer, ROM Map.

The game loop

GameLoop_LoadField ($C0:007D) loads a location and falls into GameLoop_FrameBody ($C0:0097), which runs, every frame: Field_PauseAndMenuInput, Field_SceneChangeTick, Field_FrameUpdate, Field_ActionButton, Field_Unk1F87 (the message window's step; see Field event scripts), Field_EventHookDispatch, Field_ServiceUnk54, Field_EndOfFrame and Field_WaitFrame. See Architecture for the order and Frame cycle and NMI for the end of the frame.

  • Field_PauseAndMenuInput ($C0:18D9): Start pauses (the brightness halves until Start is pressed again); the menu button fades out, saves the field and calls bank $C2's menu entry ("very likely the main menu", per its header).
  • Field_FrameUpdate ($C0:881E): with DP=$1D00, the D-pad (Field_DpadDispatch and its 16-entry table), the leader's collision (Map_Unk8A6D, probably), the step limits and the layer scroll (Map_Unk91AC, Map_Unk93E1).
  • Field_ActionButton ($C0:1AAC): on the action button, looks for an object in front of the leader (Field_FindObjInFront) and starts its function 1, then checks the tile in front for treasure (Field_CheckTileInFront).

Loading a location

LoadLocation ($C0:00F4) runs ten steps and two bank-$FD vectors:

Step Does
LocLoad_Unk092B Find the location's record (LocRom) from Loc_Id
LocLoad_AudioSetup The sound step
LocLoad_Unk0960 Layers 1 and 2 graphics
LocLoad_Unk6DCF Layer 3 graphics (or none)
LocLoad_Unk7084 The location's palette rows
LocLoad_ClearPage1D00 Zero the map page
LocLoad_UnkA33B Map properties: layer sizes and screen settings, then the wrap masks and limits, the tile planes and the exit tiles
LocLoad_Unk09DD, LocLoad_Unk0A14 The layer 1/2 and layer 3 metatile tables
LocLoad_Unk56D4 Unpack and check the event data
FdVec_FFFA, FdVec_FFF4 Location animation set-up (FieldFD_LoadAnimSetA/B): records at $05B0 and $0520, probably the tile and palette animations

Then Scene_PostLoadInit ($C0:56A6) resets the object tables and runs every object's init script, and Scene_SettleFrames runs Scene_ReloadStep ($C0:286C: draw the map with LocLoad_DrawMap, reset the objects, the uploads and palettes, NMI back on) and fades in. Most steps keep Unk names because verified callers use them; NEXT.md lists the better names waiting for those callers' next review.

The map

The map is kept in WRAM as metatiles; the map code runs with DP=$1D00.

  • Collision and tile effects ($C0:8A6D–$C0:9174, $C0:9923–$C0:9DC2): Map_Unk8A6D tests the frame's step against the leader's box with probes for other objects (Map_ProbeHitsObj) and for the map tile under a point (Map_ProbeTileAttrs, Map_ProbeTileLevel, Map_ProbeLevelBlocked), and slides along walls. Map_StepTileEffects commits a kept step: an exit tile requests a warp (from the ExitRom records in bank $E5, "inferred: an exit tile"), a tile with attribute bit 4 requests a tile animation, and the tile's level and push are applied. Map_InitEntryTile is its sibling at load time.
  • Scrolling ($C0:91AC–$C0:9922): Map_Unk91AC adds up the frame's scroll amounts for three sets of layer scroll words in 1/16 pixel (with a scroll-to target and a screen shake) and splits out whole pixels; Map_Unk93E1 steps the words a pixel at a time and notes each 8-pixel boundary crossed. The 16 edge builders Map_BuildRow* / Map_BuildCol* ($C0:8243–$C0:8444) build the new row or column, and the NMI uploads it (Map_UploadRowYInc1 …).
  • Redraws ($C0:75E9–$C0:8242): whole-layer redraws into the $7E:C800 buffer (Field_BuildC800Mode1/2/4), the row and column writers, and the VRAM uploads (Map_UploadBuf*), driven by DefaultHandler's redraw request and Field_Unk885A.
  • Tile animations: the five handlers ModeE6_Handler … ModeFC_Handler ($C0:0D78–$C0:16DB) advance a map tile's state byte and queue the VRAM addresses of its 8×8 tiles for doors and switches that open over a few frames (see Architecture). The field IRQ writes the new tilemap words (see Frame cycle and NMI). TileAnimList (16 words at $7F:1CC8, $C0:28AA–$C0:29F6) remembers the tiles whose animation ran at this location, so that a reload (Scene_ReloadStep) puts their final states back into Map_TileProps before the map is drawn.

Scene changes, fades and hand-offs

Field_SceneChangeTick ($C0:0C76) and DefaultHandler ($C0:16DC) act on the scene request bits: warp, bank-$C2 call, tile animation, single tile step, map redraw and battle (see Architecture). The fades are Fade_StepBrightness and Fade_StepFixedColor ($C0:1F24, $C0:1F5A).

  • Bank $C2 round trips: Field_SaveState / Field_RestoreState ($C0:011B, $C0:01A5) save and rebuild the field around a call to BankC2_Entry8000, with Field_StashSaveBlock / Field_RestoreSaveBlock copying the $14E0-byte save block to $7F:2000 and back.
  • Battle hand-off ($C0:0283–$C0:0904): before a battle Field_Unk038F fills the hand-off block (FieldBtlPc, FieldBtlObj, FieldBtlPpu at $7E:29B0–$2C7B) with the party's positions, the objects and the PPU state; afterwards Scene_Unk0283 reads FieldBtl_Result and rebuilds in place (FieldBtl_Restore), reloads the location, or restarts the game (probably the game-over path).

Services for other banks

ReentryVectors entries 1–4 ($C0:0002–$C0:000B) are JSL targets for code in other banks (the calling sites are in banks $CD and $D1, not matched):

  • ScrollStepAccum ($C0:2C41): steps the scroll positions of layers 2 and 3 by signed per-frame speeds in 1/16 pixel and stores them into the battle hand-off's FieldBtlPpu.Scroll2 words; its header suggests the name LayerDrift_Step, "probably the battle backgrounds' drift". DefaultHandler calls it too.
  • Field_RefreshHdmaLong ($C0:0AFF, formerly the stub AudioDrvSync; it touches no sound): runs EngFD_UnkC2C1 twice, so both of its handler tables run once, sets up the HDMA channels and returns the HDMA channel mask.
  • MusicCueDispatch ($C0:1BAB): "before a battle, probably". With FieldBtl_EvtKeepMusic clear it sends sound command $14 with a track ($45 at load, "the battle music, probably"); with it set, command $70.
  • AudioFadeDispatch ($C0:1BE6): "after a battle, probably", by FieldBtl_Result. Result 1 ("the party lost, probably") sends command $14 with song $26; otherwise, unless FieldBtl_EvtKeepMusic is set, it sends command $11 with Menu_Config1E (where Evt_OpEA_PlayMusic keeps the track it starts). It restores DB and D in the wrong order, which is harmless only when the caller has D = 0 and DB = 0; kept as found.

Window effects and credits

  • Field_EventHookDispatch ($C0:21E1) runs one of 16 hooks from Field_EventHookTable: growing and shrinking window shapes on the BG or colour windows, a shape from four moving points, fixed shapes, a pulsing shape that runs its own frames, and a hook that leaves the field for good (Field_HookLeaveToBankC3).
  • Field_ServiceUnk54 ($C0:274D) builds the staff credits a line at a time from the text at $FD:A000 (the NMI sends each line with Credits_UploadLine), and passes map redraw requests on to the NMI.

Objects

The per-frame object pass Vblank_UnkA810 ($C0:A810) moves every object (Obj_MoveStep, Obj_MoveStepFree), tests it against a window a little larger than the view (Obj_UpdateInView), ticks its animation and puts it in the draw bucket for its screen position. Obj_CalcDirection, Obj_SetVelocity and Obj_SetVelocityChecked ($C0:ABA2–$C0:AF2F) set up moves for the event opcodes. The party members' objects step through Evt_OpB0_PartyControl's callees ($C0:9E29–$C0:A33A): the leader's step (Party_Unk9E29) logs each frame it moves in a 128-entry ring in bank $7F, and members 2 and 3 (Party_UnkA26B, Party_UnkA2CE) replay it $18 entries behind the one ahead ($10 when the leader stands), so they walk the leader's path. Each picks its facing and animation row (walk, run, stand or idle) from the step through Party_AnimTable ($C0:9FF7, 65 words). Positions are in 1/16 pixel; the high byte is the 16-pixel map tile. The tile-slot and palette-slot allocators (Obj_TileSlot*, Obj_PalSlot*, $C0:6F9A–$C0:7083, $C0:7170–$C0:7398) give objects VRAM and palette space by kind. See Sprites & objects for drawing.

Bank $FD field code

The field HDMA set-up (EngFD_UnkC124, Hdma_InitChannelsFD, EngFD_UnkC2C1 with its two handler tables, $FD:C124–$FD:C2EA, and EngFD_UnkD52D), and the location animation set-up (FieldFD_LoadAnimSetA / B and the vectors FdVec_FFF4 / FFF7 / FFFA).

What is not matched yet

Bank $C0 is fully matched. Its last code is the message choice cursor that the field IRQ draws (Irq_DrawChoiceCursor, $C0:F05E; see Frame cycle and NMI), and after that the bank holds only data (see the ROM Map). From NEXT.md, what is left of the field code is in bank $FD: the IRQ's other phase FdVec_FFFD, the HDMA builders behind EngFD_UnkC2C1's tables, and EngFD_UnkE39C (FdVec_FFF7's target).

2,362functions matched
135,958code bytes matched
2,362readable
2,362verified

Functions

AddressFunctionSizeStatusNotes
$C0:0000ReentryVectors14verifiedMid-game re-entry vector table at the start of the bank.
$C0:000EGameLoop79verifiedfull (cold) init, then the game loop
$C0:005DGameLoop_Main21verifiedwarm-restart entry.
$C0:0072GameLoop_NotBankC211verifiedreached when bit 15 of Loc_Id - Loc_FirstBankC2 is set.
$C0:007DGameLoop_LoadField26verifiedloads the field location Loc_Id and falls into the per-frame loop.
$C0:0097GameLoop_FrameBody40verifiedthe per-frame field loop.
$C0:00BFField_EndOfFrame31verifiedEnd-of-frame work, called once per frame just before Field_WaitFrame waits for the NMI; it is not an interrupt handler and waits for nothing itself.
$C0:00DEField_EndOfFrameShort13verifiedthe EngFD_UnkC2C1 + FdVec_FFF7 part of Field_EndOfFrame only, for the fade and idle loops.
$C0:00EBField_IdleFrame9verifiedone frame of field upkeep without game logic: Field_FrameUpdate, Field_EndOfFrameShort, Field_WaitFrame (tail jump, whose RTS returns to this routine's caller).
$C0:00F4LoadLocation39verifiedOne-time location-load called once per scene entry from GameLoop_LoadField (its only caller, JSR at $C0:0088).
$C0:011BField_SaveState138verified(was Sub_011B.) Saves the field before handing control to bank $C2 (BankC2_Entry8000), so Field_RestoreState can rebuild it after: - if Field_Unk29 is set, force it to 1 and clear Field_Unk26/27...
$C0:01A5Field_RestoreState167verified(was Sub_01A5.) Rebuilds the field after a bank-$C2 round trip: 1.
$C0:024CScene_Unk024C55verifiedThe check DefaultHandler makes before starting a battle (its SceneFlag_Battle path): C=1 means no battle after all, and DefaultHandler then clears the flag; C=0 goes on to the battle.
$C0:0283Scene_Unk0283200verifiedRebuilds the field after a battle; DefaultHandler calls it right after JSL EngCall_BattleMain.
$C0:034BField_Unk034B68verifiedScene_Unk024C's no-battle path, and the end of Scene_Unk0283's rebuild (fall-through).
$C0:038FField_Unk038F12verifiedFills the field/battle hand-off block before a battle (see the FieldBtl* structs in ram_engine.inc): FieldBtl_SaveTileAttrs, FieldBtl_SavePartyPos, FieldBtl_SaveObjs, then FieldBtl_SavePpu as a...
$C0:039BFieldBtl_SaveTileAttrs127verifiedCopies the 16 x 16-tile window of Map_TileAttrA at the screen origin (Map_TileOriginX/Y / 2, wrapped with Map_ColMask1 / Map_RowMask1) to FieldBtl_AttrA, the same window of Map_TileAttrB to...
$C0:041AFieldBtl_SavePartyPos211verifiedFor each party member present (Party_ObjSlot, Party_ObjSlot1, Party_ObjSlot2; bit 7 = none) fills its FieldBtlPc record: tile X/Y relative to FieldBtl_OriginX/Y (Map_TileOriginX/Y / 2, unmasked...
$C0:04EDFieldBtl_SaveObjs106verifiedMarks all 8 FieldBtlObj records empty (Unk05/Unk06 = FieldBtl_NoObj) and all 8 FieldBtl_ObjSlots $FF, then runs FieldBtl_SaveObj for Field_BattleObjList entries 0-5 until one has bit 7 set.
$C0:0557FieldBtl_SaveObj192verifiedSaves one object (A = its slot) in a FieldBtlObj record, unless its Obj_VramTile low byte is FieldBtl_ObjTileLimit or more (then it does nothing).
$C0:0617Field_Unk061786verifiedFills Field_BattleObjList for Scene_Unk024C: walks the object slots from Evt_ObjCount x 2 down to 2 (slot 0 is never looked at) and lists each one that has Obj_Unk1A81 bit 7 set or Obj_Unk0F00...
$C0:066DFieldBtl_SavePpu168verifiedFills FieldBtlPpu from the field's screen settings: the three tilemap bytes (each a Map_TilemapVram* high byte ORed with a size byte), the main/sub screen and colour-math values, Fade_FixedColor...
$C0:0715FieldBtl_Restore86verifiedScene_Unk0283's object rebuild after a battle: FieldBtl_RestOriginX/Y = Map_TileOriginX/Y / 2, FieldBtl_RestoreObjs, FieldBtl_RestoreParty (both with 8-bit X/Y), then Oam_BuildShadow.
$C0:076BFieldBtl_RestoreObjs129verifiedFor each of the 8 FieldBtl_ObjSlots that holds a slot (bit 7 clear): Obj_DrawUnlink the object (Obj_Cur = slot), then FieldBtl_RestoreObj with X = its record offset (n x FieldBtl_ObjRecSize).
$C0:07ECFieldBtl_RestoreObj133verifiedPuts one object (A = slot) back from its FieldBtlObj record (X = record offset).
$C0:0871FieldBtl_RestoreParty47verifiedObj_DrawUnlink then FieldBtl_RestorePc for each party member from its FieldBtlPc record.
$C0:08A0FieldBtl_RestorePc101verifiedFieldBtl_RestoreObj's restore path for a party member (A = slot, X = FieldBtlPc record offset): Obj_TileX/Y, the low bytes of Obj_PosX/Y, Obj_LastFrame, Obj_ScreenX/Y and Obj_AnimTimer = 0 from...
$C0:0905Field_RestoreSaveBlock19verified(was Sub_0905.) Copies SceneSave_Buffer ($7F:2000) back over Field_SaveBlock ($7E:0920, $14E0 bytes).
$C0:0918Field_StashSaveBlock19verified(was Sub_0918.) Copies Field_SaveBlock ($7E:0920, $14E0 bytes) to SceneSave_Buffer ($7F:2000).
$C0:092BLocLoad_Unk092B53verifiedFirst location-load step: Loc_RecOfs = (Loc_Id & $FF) x LocRom_RecSize, plus LocRom_HalfOfs when Loc_Id bit 8 is set, i.e.
$C0:0960LocLoad_Unk0960125verifiedLoads the graphics of layers 1 and 2.
$C0:09DDLocLoad_Unk09DD55verifiedUnpacks the layer 1/2 metatile table: unless LocRom.Tileset12 is LocRom_SetNone, its LocGfx_Meta12Ptrs entry is unpacked with Decomp_ToWramVec to Map_Meta12TL ($7E:B000), over the MapProps that...
$C0:0A14LocLoad_Unk0A1460verifiedUnpacks the layer-3 metatile table: unless Field_UnkBB is set (no layer 3, LocLoad_Unk6DCF) or LocRom.Tileset3 is LocRom_SetNone, its LocGfx_Meta3Ptrs entry is unpacked with Decomp_ToWramVec to...
$C0:0A50LocLoad_DrawMap175verifiedDraws the freshly loaded map: - Map_LoadTreasureTiles (DP=$1D00), Ppu_SetBgLayout and Ppu_ApplyMapScreens; - with DP=$1D00: Map_InitOrigin, LocLoad_EmptyStep, the tilemap VRAM bases...
$C0:0AFFField_RefreshHdmaLong41verified(was the stub AudioDrvSync; it touches no sound.) A JSL service for other banks (ReentryVectors [2]): with DP_Field and DB=$00, sets Field_Unk53Bit7, runs EngFD_UnkC2C1 twice (so both of its...
$C0:0B28Scene_ResumeNmi38verifiedScene_ReloadStep's last setup: EngFD_UnkC124 (writes HDMA table bytes in bank $7F from the map's tilemap settings; not traced), EngFD_UnkC2C1 (with 8-bit X/Y) and Hdma_InitChannelsFD, then waits...
$C0:0B4EInitHW22verifiedDisables interrupts, enables forced blank, clears NMI/DMA/HDMA, and sets DB=$00 (PHA/PLB), which GameLoop_Main and other callers rely on.
$C0:0B64InstallNMI17verifiedWrites JML NmiHandler ($C0:EA63) into the RAM trampoline at $7E:0500.
$C0:0B75InstallIRQ17verifiedWrites JML IrqHandler ($C0:ECCC) into the RAM trampoline at $7E:0504.
$C0:0B86Field_InitLoadState240verified(was FrameStateInit.) Called once per location load from GameLoop_LoadField, not per frame.
$C0:0C76Field_SceneChangeTick258verified(was Sub_0C76.) Runs every frame from GameLoop_FrameBody.
$C0:0D78ModeE6_Handler231verifiedTile animation for map-tile state $E6: a 1x2 column, the tile at (Field_TileAnimX, Field_TileAnimY) and the one above it.
$C0:0E5FModeEC_Handler437verifiedTile animation for map-tile state $EC: a 2x2 block, columns col..col+1, rows row-1..row.
$C0:1014ModeEE_Handler437verifiedTile animation for map-tile state $EE: a 2x2 block, columns col-1..col, rows row-1..row (ModeEC_Handler mirrored).
$C0:11C9ModeFA_Handler651verifiedTile animation for map-tile state $FA: a 2-wide, 3-tall block, columns col..col+1, rows row-2..row.
$C0:1454ModeFC_Handler648verifiedTile animation for map-tile state $FC: a 2-wide, 3-tall block, columns col-1..col, rows row-2..row (ModeFA_Handler mirrored).
$C0:16DCDefaultHandler509verifiedThe rest of Field_SceneChangeTick's request handling: reached by BRL when Field_SceneFlags bit 4 is clear or the tile mode is not one of the five Mode*_Handlers, by BRL at the end of ModeE6-FA...
$C0:18D9Field_PauseAndMenuInput172verified(was Sub_18D9.) Per-frame pause and menu input, called from GameLoop_FrameBody before Field_SceneChangeTick.
$C0:1985Field_FadeToBankC2Mode566verified(was Sub_1985.) Called from Field_PauseAndMenuInput when Pad_Unk00F6 bit 0 is set.
$C0:19C7Field_RunBankC2Mode560verified(was Sub_19C7.) Calls BankC2_Entry8000 with A = 5, X = 0 (meaning of 5 unverified; earlier notes called it "BG mode 5"), then reloads the field: restore state, re-init changed party members, move...
$C0:1A03Party_ReinitIfChanged169verified(was Sub_1A03.) After a bank-$C2 round trip: if Party_Members no longer matches the copy taken at load (Party_MembersCache), re-run the init function of every character object that exists...
$C0:1AACField_ActionButton51verified(was Field_Unk1AAC.) Per-frame check of the action button: does nothing unless Pad_Unk00F6 bit 7 (A, if Pad_Unk00F6 has the Pad_Pressed layout) is set.
$C0:1ADFSub_1ADF87verifiedPurpose unknown: every variable it touches (Field_Unk34, Field_Unk62-66, Pad_Unk00F6-F8) is still unidentified, so it keeps its address name.
$C0:1B36Bg_TilemapIndex64x3229verified(was Sub_1B36.) Word offset of an 8x8 tile in a 64x32 BG tilemap made of two 32x32 screens side by side.
$C0:1B53LocLoad_AudioSetup61verifiedLoadLocation's sound step.
$C0:1B90Audio_PlayTileSfxA2verified(was Sub_1B90.) Plays sound effect Audio_SfxTileAnimA through the sound driver: Audio_CmdId = $19 (play effect), Arg0 = effect id, Arg1 = the low byte of the party leader's Obj_ScreenX (presumably...
$C0:1B92Audio_PlaySfxAtLeader21verifiedshared tail; Audio_PlayTileSfxA falls in here and Audio_PlayTileSfxB branches here (BRA at $C0:1BA9).
$C0:1BA7Audio_PlayTileSfxB4verified(was Sub_1BA7.) Plays sound effect Audio_SfxTileAnimB: same as Audio_PlayTileSfxA with the other effect id, sharing its tail Audio_PlaySfxAtLeader.
$C0:1BABMusicCueDispatch59verifiedBefore a battle, probably: with FieldBtl_EvtKeepMusic clear, Audio_Unk1E10 = $FF and command Audio_Cmd14 with Audio_CmdArg0 = Audio_SfxUnkFA ($45 at load: the battle music, probably); with it set...
$C0:1BE6AudioFadeDispatch278verifiedAfter a battle, probably, by FieldBtl_Result: - 1 (wait for a button and restart: the party lost, probably) unless FieldBtl_EvtNoReset: Audio_Unk1E10 = 0; Audio_CmdUnk81 (0, 0, $FF); Audio_Cmd14...
$C0:1CFCField_FindObjInFront90verifiedLooks for an object the leader can act on in the facing direction.
$C0:1D56Field_ObjInReachTable8verifiedField_FindObjInFront's reach test for each facing, indexed by Obj_Facing x 2.
$C0:1D5EField_ObjInReachUp38verifiedFacing 0: the object in Field_UnkEB is in reach when it is above the leader (Obj_PosY - Field_FindLeaderY negative) by less than Field_ReachAhead and off the leader's column by less than...
$C0:1D84Field_ObjInReachDown35verifiedFacing 1: as Field_ObjInReachUp for an object below the leader (Obj_PosY - Field_FindLeaderY not negative).
$C0:1DA7Field_ObjInReach_No4verified
$C0:1DABField_ObjInReachLeft38verifiedFacing 2: as Field_ObjInReachUp with X and Y swapped: in reach when the object is left of the leader (Obj_PosX - Field_FindLeaderX negative) by less than Field_ReachAhead and off its row by less...
$C0:1DD1Field_ObjInReachRight35verifiedFacing 3: as Field_ObjInReachLeft for an object right of the leader (Obj_PosX - Field_FindLeaderX not negative).
$C0:1DF4Field_CheckTileInFront158verifiedThe action button's map check: treasure on the tile in front of the leader.
$C0:1E92Field_TileInFrontTable8verifiedField_CheckTileInFront's tile pick for each facing, indexed by Obj_Facing x 2.
$C0:1E9AField_TileInFrontUp45verifiedFacing 0: the tile one row above the leader (Obj_TileY - 1).
$C0:1EC7Field_TileInFrontDown23verifiedFacing 1: the tile one row below the leader.
$C0:1EDEField_TileInFront_No2verified
$C0:1EE0Field_TileInFrontLeft23verifiedFacing 2: the tile one column left of the leader.
$C0:1EF7Field_TileInFrontRight23verifiedFacing 3: the tile one column right of the leader.
$C0:1F0EField_CheckTileInFront_Start22verifiedField_CheckTileInFront's tail: A = the TreasureKind_* value.
$C0:1F24Fade_StepBrightness54verified(was Sub_1F24.) Brightness fade: steps Fade_Brightness one unit toward Fade_BrightnessTarget every Fade_BrightnessDelay+1 frames and clears FadeFlag_Brightness when it gets there (or reaches 0...
$C0:1F5AFade_StepFixedColor45verified(was Sub_1F5A.) Fixed-colour fade: steps Fade_FixedColor one unit toward Fade_FixedColorTarget every Fade_FixedColorDelay+1 frames and clears FadeFlag_FixedColor when it gets there.
$C0:1F87Field_Unk1F87299verifiedBy Field_Unk29 (the message state): - 0: nothing.
$C0:20B2Field_MsgClearBuf64verifiedZeroes the 1 KB text buffer Field_Unk7EF000 ($7E:F000-$7E:F3FF) as Map_ClearBufC800 does: two MVNs copy the 32 zero bytes at GfxRom_D2 to its first 64 bytes, then each MVN copies the zeroed part...
$C0:20F2Field_MsgStart52verifiedStarts the text window on the message: TextWin_StrIndex = Field_Unk2A; the string table TextWin_StrTable = FieldMsg_TreasureStrs ($DE:FF00) while Field54_WatchBox is set in Field_Unk54 (a treasure...
$C0:2126Field_MsgStep187verifiedOne step of the message text.
$C0:21E1Field_EventHookDispatch13verifiedRuns the Field_EventHook handler for this frame: entry Field_EventHook - 1 of Field_EventHookTable; nothing when it is 0.
$C0:21EEField_EventHookTable32verified16 handler addresses, indexed by (Field_EventHook - 1) x 2.
$C0:220EField_HookWinGrow091verifiedHook 1: one frame of a growing window shape.
$C0:2269Field_HookWinShrink0111verifiedHook 2: the reverse of hook 1.
$C0:22D8Field_HookWinC3E81verifiedHook 3.
$C0:2329Field_HookIdle1verified
$C0:232AField_HookWinGrow196verifiedHook 4: hook 1 with the colour window instead of BG windows: WOBJSEL enables colour window 1, CGWSEL limits colour math to inside the window (with the sub screen added), and BankC3_Entry0008 runs...
$C0:238AField_HookWinShrink188verifiedHook 5: the reverse of hook 4 (mode 1, colour window).
$C0:23E2Field_HookWinShrink1_Off39verified
$C0:2409Field_HookWinQuad267verifiedHook 6: a colour-window shape from four moving points, for WinFx_QuadTimer frames.
$C0:2514Field_HookWinFixedA117verifiedHooks 7 and 8: a fixed shape (centre WinFx_FixedX/Y, size WinFx_FixedSizeA, mode 0) on BG3's window 1, inverted; colour math outside the window only.
$C0:2589Field_HookWinFixedB133verifiedHooks 9 and 10: as hooks 7/8 with size WinFx_FixedSizeB, window 1 on BG2 and BG3 (not inverted), and different layer and colour-math bytes: Ppu_Unk0BD7/Hdma_Unk7F1520 = BG3...
$C0:260EField_HookLeaveToBankC365verifiedHook 11: leaves the field for good.
$C0:264FField_HookWinPulse214verifiedHook 12, a blocking sequence that runs its own frames (each one Field_EndOfFrameShort + Field_WaitFrame, with no Field_FrameUpdate): redraws the map (Field_BuildC800Mode1, Field_Unk74E8/74F7...
$C0:2725Field_WinPulseDraw40verifiedOne frame of Field_HookWinPulse's shape: WinFx_Size to WinFx_ArgSize, table WinFx_TableA or WinFx_TableB by Field_Unk53, then BankC3_Entry0008 in mode $80 (WinFx_ArgX/Y were set by the caller).
$C0:274DField_ServiceUnk54158verified(was Field_Unk274D.) Per-frame service of the Field_Unk54 requests, first match wins: - bit 4 (Field54_Credits): build the next line of the staff credits.
$C0:27EBField_ServiceUnk54_SendLine57verified
$C0:2824Field_FadeInAfterReload36verified(was Sub_2824.) Fade-in after a reload: unless Scene_ReloadStep returns nonzero, raises Fade_Brightness one step per frame (input disabled around Field_FrameUpdate) until it reaches full brightness.
$C0:2848Scene_SettleFrames36verifiedThe field-load fade-in: a copy of Field_FadeInAfterReload just before it, differing in one call.
$C0:286CScene_ReloadStep62verifiedRebuilds the screen after a location load or a bank-$C2 round trip, before the fade-in: TileAnimList_ApplyAll, LocLoad_DrawMap, the object resets Field_ResetUnk0B88, Field_ResetUnk0B80...
$C0:28AATileAnimList_Clear22verifiedFills TileAnimList with TileAnimList_Empty (all 16 entries).
$C0:28C0TileAnimList_AddCurrent33verifiedAdds the tile at Field_TileAnimX/Y (the 16-bit word) to TileAnimList: from the first entry on, it stops at an entry equal to it (already listed) or puts it in the first empty one.
$C0:28E1TileAnimList_ApplyAll24verifiedRuns TileAnimList_ApplyOne for each TileAnimList entry up to the first empty one (or all 16).
$C0:28F9TileAnimList_ApplyOne254verifiedPuts the animated states of one listed tile into Map_TileProps, by the state at the index A holds (only the five start states count; any other leaves the map alone): - $E6: the tile and the one...
$C0:29F7Field_Unk29F7385verifiedWrites a 32 x 10 tilemap (Field_UploadUnk1D00Bytes, $280 bytes) to Field_Unk7EF000 through the WRAM data port, DP = DP_PPU; Field_UploadUnk1D00 then sends it to VRAM $1D00.
$C0:2B78Field_Unk2B78201verifiedWrites a 32 x 8 tilemap (Field_UploadUnk1C00Bytes, $200 bytes) to Field_Unk7EF000 through the WRAM data port, DP = DP_PPU, over what Field_Unk29F7 left there; Field_UploadUnk1C00 then sends it to...
$C0:2C41ScrollStepAccum391verifiedSteps the scroll positions of layers 2 and 3 by signed per-frame speeds in 1/16 pixels, the copies of them that FieldBtlPpu.Scroll2 holds for the battle.
$C0:2DC8VramDma_Upload41verifiedCopies a block to VRAM with DMA channel 7: VMADDL = VramDma_Addr, VMAIN = increment after the high byte, DMAP7 = VramDma_Mode, B-bus target VMDATAL, source VramDma_Src/SrcBank, VramDma_Size bytes.
$C0:2DF1ClearRAMDMA45verifiedZeros a WRAM region via DMA channel 7, sourcing from MPYL (always 0 since M7A=M7B=0).
$C0:2E1ESys_HaltWithColor73verified(was the stub LoadSavePath.) Stops the game on a single colour: the first 21 bytes are InitHW's body written inline (interrupts off, forced blank, NMI/DMA/HDMA off, DB=$00), then it also clears...
$C0:2E67Evt_OpAA_SetAnimRow6verifiedEvent opcode $AA (2 bytes: $AA, row): Obj_Cur's Obj_AnimRow = row, Obj_AnimMode = Obj_AnimModeNormal (1), and Obj_AnimTimer, ObjX_AnimLoops and Obj_AnimColumn = 0 (the row starts over at once); X...
$C0:2E6DEvt_SetAnimRow7verified
$C0:2E74Evt_SetAnimMode19verified
$C0:2E87Evt_OpB3_AnimRow04verifiedEvent opcode $B3 (1 byte): Evt_SetAnimRow with row 0 (ObjAnim_RowStand, the row Obj_SetStandAnim uses); X = Y + 1, C=1.
$C0:2E8BEvt_OpB4_AnimRow14verifiedEvent opcode $B4 (1 byte): Evt_SetAnimRow with row 1 (ObjAnim_RowWalk, the row Obj_SetMoveAnim walks with); X = Y + 1, C=1.
$C0:2E8FEvt_OpAE_AnimReset11verifiedEvent opcode $AE (1 byte): Obj_Cur's Obj_AnimRow = 0 (ObjAnim_RowStand) and Obj_AnimMode = 0, then as Evt_SetAnimMode (timer, loops and column 0); X = Y + 1, C=1.
$C0:2E9AEvt_OpAB_PlayAnimOnce103verifiedEvent opcode $AB (2 bytes: $AB, row): plays animation row once in mode 2 and waits for it.
$C0:2F01Evt_OpB7_PlayAnimLoops112verifiedEvent opcode $B7 (3 bytes: $B7, row, count): as Evt_OpAB_PlayAnimOnce with ObjX_AnimLoops = count + 1 at the start (Obj_AnimTickAndQueue takes 2 off per pass of the row and stops at 1); done: X =...
$C0:2F71Evt_OpAC_ShowFrame37verifiedEvent opcode $AC (2 bytes: $AC, frame): Obj_Cur shows a fixed frame: Obj_FixedFrame = frame, column and timer 0, Obj_AnimRow = $FF when Obj_AnimMode was 0 (as in Evt_OpAB_PlayAnimOnce)...
$C0:2F96Evt_OpAD_WaitRuns48verifiedEvent opcode $AD (2 bytes: $AD, n): waits n of the object's script runs.
$C0:2FC6Evt_OpB9_Wait44verifiedEvent opcode $B9 (1 byte): Evt_WaitRuns with n = 4; X = Y + 1 when done.
$C0:2FCAEvt_OpBA_Wait84verifiedEvent opcode $BA (1 byte): Evt_WaitRuns with n = 8; X = Y + 1 when done.
$C0:2FCEEvt_OpBD_Wait324verifiedEvent opcode $BD (1 byte): Evt_WaitRuns with n = $20; X = Y + 1 when done.
$C0:2FD2Evt_OpBC_Wait162verifiedEvent opcode $BC (1 byte): Evt_WaitRuns with n = $10.
$C0:2FD4Evt_WaitRuns41verified
$C0:2FFDEvt_OpAF_PartyControlOnce5verifiedEvent opcode $AF (1 byte): one run of Evt_OpB0_PartyControl, then the script goes on: X = Y + 1 (the next opcode, for the next run), C=0.
$C0:3002Evt_OpB0_PartyControl91verifiedEvent opcode $B0 (1 byte): the script of a party member's object stays here (X = Y, C=0 on every path) and moves it each run.
$C0:3154Evt_StartTargetFunc293verifiedThe touch counterpart of Evt_StartTargetFunc1: starts function 2 of the object in Field_UnkEB.
$C0:31B1Evt_PushTarget187verifiedMoves the object in Field_UnkEB one tile on in the leader's facing, probably a push.
$C0:326CEvt_OpD9_PartyWalkToTiles494verifiedEvent opcode $D9 (7 bytes: $D9, then column, row for the leader, member 2 and member 3): walks the party members to three tiles.
$C0:345AEvt_OpDA_PartyGather229verifiedEvent opcode $DA (1 byte): party members 2 and 3 walk to the leader.
$C0:353FEvt_OpB1_Yield4verifiedEvent opcode $B1 (1 byte): ends the object's run here: X = Y + 1 (the next opcode, for the next run), C=0.
$C0:3543Evt_OpB2_Halt3verifiedEvent opcode $B2 (1 byte): stops the object on this opcode for good: X = Y (the opcode again), C=0.
$C0:3546Evt_OpB5_FollowObj9verifiedEvent opcode $B5 (2 bytes: $B5, slot): runs Evt_Op94_WalkToObj (a step toward the object in slot) and stays on this opcode for good: X = Y, C=0 whatever the walk returned.
$C0:354FEvt_OpB6_FollowPc8verifiedEvent opcode $B6 (2 bytes: $B6, p): runs Evt_Op95_WalkToPc (a step toward party member p) with X = Y returned: the opcode stays.
$C0:3557Evt_OpB8_SetMsgPtr25verifiedEvent opcode $B8 (4 bytes: $B8, ptr (3 bytes)): Field_Unk2B (word) and Field_Unk2D (bank) = ptr, the pointer the message opcodes need (probably to the location's message table); X = Y + 4, C=1.
$C0:3570Evt_OpBB_Msg69verifiedEvent opcode $BB (2 bytes: $BB, msg): shows message msg (probably; see the banner) with Field_Unk30 = 0.
$C0:35B5Evt_OpC1_MsgUnk30_171verifiedEvent opcode $C1 (2 bytes: $C1, msg): as Evt_OpBB_Msg with Field_Unk30 = 1.
$C0:35FCEvt_OpC2_MsgUnk30_271verifiedEvent opcode $C2 (2 bytes: $C2, msg): as Evt_OpBB_Msg with Field_Unk30 = 2.
$C0:3643Evt_OpC0_MsgChoice49verifiedEvent opcode $C0 (3 bytes: $C0, msg, choices): as Evt_OpBB_Msg (Field_Unk30 = 0), with a choice: on starting, Field_Unk65 = choices bits 0-1 and Field_Unk64 = bits 2-3 (Evt_ChoiceMask)...
$C0:3674Evt_MsgChoiceStart54verified
$C0:36AAEvt_OpC3_MsgChoiceUnk30_151verifiedEvent opcode $C3 (3 bytes: $C3, msg, choices): as Evt_OpC0_MsgChoice with Field_Unk30 = 1.
$C0:36DDEvt_OpC4_MsgChoiceUnk30_252verifiedEvent opcode $C4 (3 bytes: $C4, msg, choices): as Evt_OpC0_MsgChoice with Field_Unk30 = 2 (it reaches Evt_MsgChoiceStart with a BRL).
$C0:3711Evt_Op33_SetPalette70verifiedEvent opcode $33 (2 bytes: $33, slot): Obj_Cur's Obj_OamAttr = slot x 2 & ObjPal_AttrMask (the palette bits; the other attribute bits are cleared), and its 12 colours (Obj_PalSrc in bank $E4) are...
$C0:3757Evt_OpC8_EnterBankC241verifiedEvent opcode $C8 (2 bytes: $C8, arg): hands over to bank $C2 the way Field_SceneChangeTick's SceneFlag_Reload path does, with Field_BankC2Arg = arg, and goes on once the field is back...
$C0:3780Evt_OpC9_IfHasItem49verifiedEvent opcode $C9 (3 bytes: $C9, item, n): BankC1_Entry8003 service 0 (BankC1Svc_FindItem) with Y = item.
$C0:37B1Evt_OpCA_AddItem11verifiedEvent opcode $CA (2 bytes: $CA, item): BankC1_Entry8003 service 1 (BankC1Svc_AddItem, one more of item Y = item); X = Y + 2, C=1.
$C0:37BCEvt_AddItemTail11verified
$C0:37C7Evt_OpC7_AddItemVar28verifiedEvent opcode $C7 (2 bytes: $C7, a): as Evt_OpCA_AddItem with the item taken from the low byte of event word a (Evt_Unk7F0200 + a x 2): BRA to Evt_AddItemTail; X = Y + 2, C=1.
$C0:37E3Evt_OpCB_RemoveItem22verifiedEvent opcode $CB (2 bytes: $CB, item): BankC1_Entry8003 service 2 (BankC1Svc_RemoveItem: one fewer of item Y = item, the entry emptied at 0; nothing when it is not held); X = Y + 2, C=1.
$C0:37F9Evt_OpD7_GetItemCount46verifiedEvent opcode $D7 (3 bytes: $D7, item, a): BankC2_Entry8004 command $0C (BankC2Cmd_ItemCount) with X = item gives the count held (0 when none); it goes to the low byte of event word a...
$C0:3827Evt_OpCC_IfHasGold52verifiedEvent opcode $CC (4 bytes: $CC, amount (word), n): BankC1_Entry8003 service 3 (BankC1Svc_HasGold) with Y = amount.
$C0:385BEvt_OpCD_AddGold25verifiedEvent opcode $CD (3 bytes: $CD, amount (word)): BankC1_Entry8003 service 4 (BankC1Svc_AddGold) with Y = amount; X = Y + 3, C=1.
$C0:3874Evt_OpCE_RemoveGold25verifiedEvent opcode $CE (3 bytes: $CE, amount (word)): BankC1_Entry8003 service 5 (BankC1Svc_RemoveGold: takes amount off the gold when there is that much); X = Y + 3, C=1.
$C0:388DEvt_OpCF_IfCharListed49verifiedEvent opcode $CF (3 bytes: $CF, char, n): BankC2_Entry8004 command 3 (BankC2Cmd_FindListed) with Y = char.
$C0:38BEEvt_OpD0_AddCharToReserve21verifiedEvent opcode $D0 (2 bytes: $D0, char): BankC2_Entry8004 command 4 (BankC2Cmd_AddToReserve) with Y = char; X = Y + 2.
$C0:38D3Evt_OpD1_UnlistChar21verifiedEvent opcode $D1 (2 bytes: $D1, char): BankC2_Entry8004 command 5 (BankC2Cmd_Unlist: the character's place in Menu_PartyOrder is marked empty); X = Y + 2.
$C0:38E8Evt_OpD2_IfCharInParty49verifiedEvent opcode $D2 (3 bytes: $D2, char, n): BankC2_Entry8004 command 0 (BankC2Cmd_FindInParty) with Y = char.
$C0:3919Evt_OpD3_AddCharToParty53verifiedEvent opcode $D3 (2 bytes: $D3, char): BankC2_Entry8004 command 1 (BankC2Cmd_AddToParty) with Y = char, then ObjQ_Unk78 = ObjQ_Unk78Set1.
$C0:394EEvt_OpD4_MoveCharToReserve185verifiedEvent opcode $D4 (2 bytes: $D4, char): takes the character's object out of the party, by the first of Party_ObjSlot / 1 / 2 (present) whose Obj_Unk1101 is char (read as the object's character...
$C0:3A07Evt_OpD6_DropCharObj97verifiedEvent opcode $D6 (2 bytes: $D6, char): the first present party member (Party_ObjSlot, then 1, then 2) whose Obj_Unk1101 is char gets Obj_Unk1100 = 3 (Obj_Unk1100Out), and its place in...
$C0:3A68Evt_OpD5_BankC2Cmd0A27verifiedEvent opcode $D5 (3 bytes: $D5, a, b): BankC2_Entry8004 command $0A (BankC2Cmd_Unk0A) with Y = a and X = b; X = Y + 3.
$C0:3A83Evt_OpD8_StartBattle52verifiedEvent opcode $D8 (3 bytes: $D8, a, b): starts a battle and goes on after it: - SceneFlag_Battle set in Field_SceneFlags (not started yet): X = the opcode, C=0; - else FadeFlag_AfterBattle set in...
$C0:3AB7Evt_OpE0_Warp58verifiedEvent opcode $E0 (5 bytes: $E0, location (word), column, row): sets Loc_DestId / Loc_DestX (column, row) / Loc_DestFacing from the operands, SceneFlag_Warp in Field_SceneFlags and Fade_Brightness...
$C0:3AF1Evt_OpDC_SetPrevLoc42verifiedEvent opcode $DC (5 bytes: $DC, location (word), column, row): sets Loc_PrevId, Loc_PrevX (column, row) and Loc_PrevFacing from the operands, as Field_InitLoadState would have stored them for that...
$C0:3B1BEvt_OpDD_SetLoc42verifiedEvent opcode $DD (5 bytes: $DD, location (word), column, row): sets Loc_Id, Loc_EntryX (column, row) and Loc_EntryFacing from the operands without loading anything; X = Y + 5, C=1.
$C0:3B45Evt_OpDE_SetLocUnk1E6verifiedEvent opcode $DE (5 bytes, as $DD): Field_Unk1E = 1 (Field_Unk1EOn; Field_FadeInAfterReload clears it), then BRA to Evt_OpDD_SetLoc.
$C0:3B4BEvt_OpE1_WarpNow77verifiedEvent opcode $E1 (5 bytes: $E1, location (word), column, row): warps at once, without the fade-out: Loc_Dest* from the operands (as Evt_OpE0_Warp), then it waits for vblank (RDNMI bit 7), runs...
$C0:3B98Evt_OpDF_WarpNowUnk1E6verifiedEvent opcode $DF (5 bytes, as $E1): Field_Unk1E = 1 (Field_Unk1EOn), then BRA to Evt_OpE1_WarpNow (never returns).
$C0:3B9EEvt_OpE2_WarpVars103verifiedEvent opcode $E2 (5 bytes: $E2, a, b, c, d): as Evt_OpE0_Warp with the destination in event words (Evt_Unk7F0200 + n x 2): Loc_DestId = word a (all 16 bits, not masked), Loc_DestX = word b's low...
$C0:3C05Evt_OpE3_SetControl12verifiedEvent opcode $E3 (2 bytes: $E3, value): Field_ControlEnabled = value (0 stops the pause/menu paths; the Map_Unk7F3700 scripts start with E3 00 and end with E3 01 or E3 00); X = Y + 2, C=1.
$C0:3C11Evt_OpE8_SoundCmd1830verifiedEvent opcode $E8 (2 bytes: $E8, a): sends sound-driver command $18 (Audio_Cmd18, the command bank $C2 sends as C2Scene_SoundCmd18; meaning not traced) with Audio_CmdArg0 = a and Audio_CmdArg1 =...
$C0:3C2FEvt_OpEA_PlayMusic29verifiedEvent opcode $EA (2 bytes: $EA, track): Menu_Config1E = track and Audio_CmdPlayMusic sent with Audio_CmdArg0 = track, as LocLoad_AudioSetup starts a location's music (Audio_CmdArg1/2 left as they...
$C0:3C4CEvt_OpEB_SoundCmds81To8376verifiedEvent opcode $EB (3 bytes: $EB, a, b): sends three sound-driver commands through Audio_DriverCommand: Audio_CmdUnk81 with arguments a, b, Audio_Cmd81Arg; then Audio_Cmd82 and Audio_Cmd83, each...
$C0:3C98Evt_OpEC_SoundCmd36verifiedEvent opcode $EC (4 bytes: $EC, command, a, b): Audio_CmdId = command, Audio_CmdArg0 = a, Audio_CmdArg1 = b (Audio_CmdArg2 left as it was), sent through Audio_DriverCommand; X = Y + 4, C=0.
$C0:3CBCEvt_OpED_WaitApuio19verifiedEvent opcode $ED (1 byte): waits while APUIO1 (the sound CPU's port 1) reads nonzero: X = the opcode then, else X = Y + 1; C=0 either way.
$C0:3CC5Evt_OpEE_WaitApuio311verifiedEvent opcode $EE (1 byte): waits while the low nibble of APUIO3 (the sound CPU's port 3) is nonzero: X = the opcode then, else X = Y + 1; C=0 either way.
$C0:3CD0Evt_OpF0_FadeBrightness45verifiedEvent opcode $F0 (2 bytes: $F0, b): the high nibble of b is a screen brightness (0-15).
$C0:3CFDEvt_OpF2_WaitBrightness10verifiedEvent opcode $F2 (1 byte): waits while FadeFlag_Brightness is set (a brightness fade runs): X = the opcode then, else X = Y + 1; C=0 either way.
$C0:3D07Evt_OpF1_FadeFixedColor115verifiedEvent opcode $F1 (2 bytes: $F1, 0, or 3 bytes: $F1, colour, s): the fixed colour (Fade_FixedColor, COLDATA-style: bits 5-7 the channels, bits 0-4 the intensity).
$C0:3D7AEvt_OpF3_WaitFixedColor10verifiedEvent opcode $F3 (1 byte): waits while FadeFlag_FixedColor is set (a fixed-colour fade runs): X = the opcode then, else X = Y + 1; C=0 either way.
$C0:3D84Evt_OpF4_SetShake19verifiedEvent opcode $F4 (2 bytes: $F4, value): Field_UnkBC = value (nonzero: Map_Unk91AC sets Map_ShakeX/Y from Eng_Unk0400, a screen shake by that inference); with 0, Map_ShakeX and Map_ShakeY = 0 too.
$C0:3D97Evt_OpE4_CopyMapRegion46verifiedEvent opcode $E4 (8 bytes: $E4, source column, row, end column, row, destination column, row, planes): MapCopy_SrcX/Y, MapCopy_EndX/Y, MapCopy_DstX/Y and Field_Unk44 (the MapCopy_* plane bits)...
$C0:3DC5Evt_OpE5_CopyMapRegionRedraw47verifiedEvent opcode $E5 (8 bytes, as $E4): the same MapCopy_* and Field_Unk44 setup, then Field_MapRedrawSel = the plane bits 0-2 (MapCopy_L1-L3, the layers) and SceneFlag_MapRedraw set, so...
$C0:3DF4Evt_OpE6_SetDrift60verifiedEvent opcode $E6 (5 bytes: $E6, x, y, layers, frames): for each of Map_Layer1/2/3 set in layers, the word Map_Drift1X/2X/3X (with its Y byte) = x, y: the per-frame amounts Map_Unk91AC adds to that...
$C0:3E30Evt_OpE7_ScrollTo44verifiedEvent opcode $E7 (3 bytes: $E7, column, row): scrolls the view to a map tile through Map_Unk91AC's scroll-to, by Map_ScrollToMode: - 0 (start): Map_ScrollToX = column x 2, Map_ScrollToY = row x 2...
$C0:3E5CEvt_OpF8_BankC2Cmd06And0711verifiedEvent opcode $F8 (1 byte): BankC2_Entry8004 commands 6 and 7 (BankC2Cmd_Unk06, BankC2Cmd_Unk07); X = Y + 1.
$C0:3E67Evt_BankC2CmdTail7verified
$C0:3E6EEvt_OpF9_BankC2Cmd067verifiedEvent opcode $F9 (1 byte): BankC2_Entry8004 command 6 alone (see Evt_OpF8_BankC2Cmd06And07) through Evt_BankC2CmdTail; X = Y + 1, C as on entry (0: the run ends).
$C0:3E75Evt_OpFA_BankC2Cmd077verifiedEvent opcode $FA (1 byte): BankC2_Entry8004 command 7 alone (see Evt_OpF8_BankC2Cmd06And07) through Evt_BankC2CmdTail; X = Y + 1, C as on entry (0: the run ends).
$C0:3E7CEvt_OpFF9F_BankC2Cmd088verifiedOpcode $FF $9F (2 bytes): BankC2_Entry8004 command 8 (BankC2Cmd_Unk08, Menu_CmdSetSram7FE2, which stores $FF at $30:7FE2) through Evt_BankC2CmdTail; X = Y + 2.
$C0:3E84Evt_Op29_StartCredits82verifiedEvent opcode $29 (2 bytes: $29, b): sets layer 3 up for the staff credits, probably (the font load and the Credits_Text position): Map_OwnStep3 set in Map_OwnStepFlags and in Map_LayerEdgeOff...
$C0:3ED6Evt_Op2A_Field54Bit22verifiedEvent opcode $2A (1 byte): sets Field_Unk54 bit 2 (Field54_MapReq's low bit), a request Field_ServiceUnk54 serves (bits 2-3 shifted left once go to the map redraw); X = Y + 1, C=0.
$C0:3ED8Evt_SetField54Tail6verified
$C0:3EDEEvt_Op2B_Field54Bit34verifiedEvent opcode $2B (1 byte): sets Field_Unk54 bit 3 (Field54_Bit3, the other bit of Field54_MapReq) through Evt_SetField54Tail; X = Y + 1, C=0.
$C0:3EE2Evt_Op32_CreditsLine4verifiedEvent opcode $32 (1 byte): sets Field54_Credits in Field_Unk54, so Field_ServiceUnk54 writes the next staff-credits line, through Evt_SetField54Tail; X = Y + 1, C=0.
$C0:3EE6Evt_Op2C_SetLayer3Pos44verifiedEvent opcode $2C (3 bytes: $2C, x, y): Map_Acc3X/Y = 0, Map_Unk1D8F (layer 3 X) = x x 8 and Map_Unk1D91 (layer 3 Y) = y x 8, both 16-bit (8-pixel units, probably).
$C0:3F12Evt_Op2F_SetCreditsPos20verifiedEvent opcode $2F (3 bytes: $2F, column, row): Credits_Column = column, Credits_Row = row (where Field_ServiceUnk54 puts the next credits line); X = Y + 3, C=1.
$C0:3F26Evt_OpFE_WinQuad137verifiedEvent opcode $FE (18 bytes: $FE, frames, then eight pairs start, end for X0, Y0, X1, Y1, X2, Y2, X3, Y3): starts hook 6 (Field_HookWinQuad) moving four points from their starts to their ends in...
$C0:3FAFEvt_OpFF_Misc95verifiedEvent opcode $FF (2 bytes or more: $FF, sub, ...): sub is kept in EvtFF_Sub.
$C0:400EEvt_OpFFTable40verified20 handler addresses for opcode $FF's second byte $90-$A3, indexed by (sub - $90) x 2 (JSR (abs,X) at $C0:4009 in Evt_OpFF_Misc).
$C0:4036Evt_OpFF90_WinGrow031verifiedOpcode $FF $90 (5 bytes: $FF, $90, x, y, limit): WinFx_CenterX/Y = x, y, WinFx_SizeLimit = limit, WinFx_Size = 0, Field_EventHook = EventHook_WinGrow0 (hook 1 grows the window shape to the limit)...
$C0:4055Evt_OpFF91_WinShrink08verifiedOpcode $FF $91 (2 bytes): Field_EventHook = EventHook_WinShrink0 (hook 2 shrinks the shape to 0 and turns the window off); X = Y + 2 (no wait).
$C0:405DEvt_OpFF92_WinC3E186verifiedOpcode $FF $92 (2 bytes): runs hook 3 (Field_HookWinC3E, the BankC3_Entry000E effect) with mode 1 and WinFx_Size 0, and waits for it to end: - Field_EventHook 0 (start): while WinFx_C3EMode...
$C0:40B3Evt_OpFF94_WinC3E1Dark60verifiedOpcode $FF $94 (2 bytes): as Evt_OpFF92_WinC3E1 (mode 1) with WinFx_Size = 3 (WinFx_SizeBit1 | WinFx_SizeBit0), so hook 3 leaves the window on; when it is done this opcode sets Fade_Brightness = 0...
$C0:40EFEvt_OpFF93_WinC3E286verifiedOpcode $FF $93 (2 bytes): as Evt_OpFF92_WinC3E1 with mode 2 (WinFx_C3EMode2) and WinFx_Size = 1 (WinFx_SizeBit0); the window is cleared when done, X = Y + 2.
$C0:4145Evt_OpFF95_WinC3E2Dark60verifiedOpcode $FF $95 (2 bytes): as Evt_OpFF94_WinC3E1Dark with mode 2 (WinFx_C3EMode2) and WinFx_Size = 2 (WinFx_SizeBit1): when done Fade_Brightness = 0, Field_EventHook = 0, X = Y + 2.
$C0:4181Evt_OpFF96_Reset16verifiedOpcode $FF $96 (2 bytes): waits for vblank (RDNMI bit 7), InitHW, S = StackTop and JML MainInit: the game restarts from its cold init (a reset, probably the end of a game).
$C0:4191Evt_OpFF97_WinGrow131verifiedOpcode $FF $97 (5 bytes: $FF, $97, x, y, limit): as Evt_OpFF90_WinGrow0 with Field_EventHook = EventHook_WinGrow1 (hook 4, the colour-window version); X = Y + 5 (no wait).
$C0:41B0Evt_OpFF98_WinShrink14verifiedOpcode $FF $98 (2 bytes): Field_EventHook = EventHook_WinShrink1 (hook 5) through Evt_OpFF_SetHookTail; X = Y + 2 (no wait).
$C0:41B4Evt_OpFF99_WinFixedA4verifiedOpcode $FF $99 (2 bytes): Field_EventHook = EventHook_WinFixedA1 (hooks 7/8) through Evt_OpFF_SetHookTail; X = Y + 2 (no wait).
$C0:41B8Evt_OpFF9A_WinFixedB2verifiedOpcode $FF $9A (2 bytes): Field_EventHook = EventHook_WinFixedB1 (hooks 9/10); X = Y + 2 (no wait).
$C0:41BAEvt_OpFF_SetHookTail6verified
$C0:41C0Evt_OpFF9B_LeaveToBankC34verifiedOpcode $FF $9B (2 bytes): Field_EventHook = EventHook_LeaveToBankC3 (hook 11 redraws the map and leaves the field for bank $C3 on its next frame) through Evt_OpFF_SetHookTail; X = Y + 2.
$C0:41C4Evt_OpFF9C_WinShrink1Off4verifiedOpcode $FF $9C (2 bytes): Field_EventHook = EventHook_WinShrink1Off (hook 14, hook 5's shutdown: the window off at once) through Evt_OpFF_SetHookTail; X = Y + 2.
$C0:41C8Evt_OpFF9E_WinPulse20verifiedOpcode $FF $9E (2 bytes): runs hook 12 (Field_HookWinPulse, which ends by setting EventHook_Idle) and waits for it: Field_EventHook 0: it is set to EventHook_WinPulse, X = the opcode...
$C0:41DCEvt_OpFF9D_ClearPush8verifiedOpcode $FF $9D (2 bytes): clears Field54_Push in Field_Unk54, which lets Evt_PushTarget start another push; X = Y + 2.
$C0:41E4Evt_Op57_InitChar08verifiedEvent opcode $57 (1 byte): Chr_ObjSlot[0] = Obj_Cur, then Evt_InitCharTail with character 0 (see Evt_Op80_InitCharObj).
$C0:41ECEvt_Op5C_InitChar18verifiedEvent opcode $5C (1 byte): as Evt_Op57_InitChar0 for character 1.
$C0:41F4Evt_Op62_InitChar28verifiedEvent opcode $62 (1 byte): as Evt_Op57_InitChar0 for character 2.
$C0:41FCEvt_Op68_InitChar48verifiedEvent opcode $68 (1 byte): as Evt_Op57_InitChar0 for character 4.
$C0:4204Evt_Op6A_InitChar38verifiedEvent opcode $6A (1 byte): as Evt_Op57_InitChar0 for character 3.
$C0:420CEvt_Op6C_InitChar58verifiedEvent opcode $6C (1 byte): as Evt_Op57_InitChar0 for character 5.
$C0:4214Evt_Op6D_InitChar66verifiedEvent opcode $6D (1 byte): as Evt_Op57_InitChar0 for character 6, then falls into Evt_InitCharTail, which stores A (the character) in EvtChar_Id and BRAs to Evt_InitCharCommon; the other one-byte...
$C0:421AEvt_InitCharTail4verified
$C0:421EEvt_Op80_InitCharObj76verifiedEvent opcode $80 (2 bytes: $80, char): Chr_ObjSlot[char] = Obj_Cur (char 0-6; a larger one stores nothing), then Evt_InitCharCommon, which the one-byte character opcodes reach too (EvtChar_Id =...
$C0:426AEvt_InitCharCommon524verified
$C0:4476Evt_Op81_InitSprite23verifiedEvent opcode $81 (2 bytes: $81, record): Obj_Cur becomes an object with sprite record record: Obj_Unk1100 = Obj_Unk1100Kind3, Obj_Unk1B01 = Obj_Unk1B01Solid, Obj_Unk1101 = record, then...
$C0:448DEvt_LoadSpriteRec202verified
$C0:4557Evt_InitWramSprite57verifiedThe common start of Evt_Op82_InitWramSprite and Evt_Op83_InitEnemySprite (A = the Obj_Unk1100 kind, 4 or 5): Obj_Unk1100 = A, Obj_Unk1101 = the operand after the opcode (also left in WRMPYA for...
$C0:4590Evt_Op82_InitWramSprite335verifiedEvent opcode $82 (2 bytes: $82, n): Evt_InitWramSprite with kind 4 (Obj_Unk1100Kind4), then Obj_Unk1B01 = Obj_Unk1B01Solid and sprite record SprRec_FirstNpc + n of RomE4_SprRec loaded as...
$C0:46DFEvt_Op83_InitEnemySprite392verifiedEvent opcode $83 (3 bytes: $83, n, b): Evt_InitWramSprite with kind 5 (Obj_Unk1100Kind5), Obj_Unk1B01 = Obj_Unk1B01Solid, then record n of RomE4_EnemySprRec (EvtSpr_EnemyRecBytes each; its first...
$C0:4867Evt_Op84_SetUnk1B0115verifiedEvent opcode $84 (2 bytes: $84, value): Obj_Cur's Obj_Unk1B01 = value (bit 0: the object blocks the leader, Obj_Unk1B01Solid; bit 1: it can be pushed, Obj_Unk1B01Push).
$C0:4876Evt_Op87_SetScriptPeriod28verifiedEvent opcode $87 (2 bytes: $87, n): Obj_Cur's Obj_Unk1000 = (n + 1) | its old bit 7 (Obj_Unk1000Bit7 kept): the object's script runs every n + 1 frames (Vblank_Unk59D9 reloads Obj_Unk1001 from...
$C0:4892Evt_Op88_ObjPalAnim444verifiedEvent opcode $88 ($88, kind, ...): palette animations on Obj_Cur's own palette (its colour 0 is EvtPal_Base = Obj_OamAttr x 8 + EvtPal_SpriteColor0: Obj_OamAttr holds the palette slot x 2).
$C0:4A4EEvt_Op2E_PalAnim222verifiedEvent opcode $2E ($2E, kind, ...): as Evt_Op88_ObjPalAnim's kinds $4x/$5x and $8x, with absolute colour numbers instead of the object's palette.
$C0:4B2CEvt_FindFreeAnimB29verifiedFinds a free FieldAnimB record (.Unk0 = 0) among the first FieldAnimB_Searched (8) of the 12, from record 0 on; records 8-11 are never handed out here.
$C0:4B49Evt_Op89_SetSpeed15verifiedEvent opcode $89 (2 bytes: $89, speed): Obj_Cur's Obj_Speed = speed (the step the Obj_SetVelocity* routines scale the direction by).
$C0:4B58Evt_Op8A_SetSpeedVar28verifiedEvent opcode $8A (2 bytes: $8A, a): as Evt_Op89_SetSpeed with the low byte of the event word a.
$C0:4B74Evt_Op8B_PlaceAtTile79verifiedEvent opcode $8B (3 bytes: $8B, column, row): puts Obj_Cur on the tile: Obj_PosX = column << 8 | EvtChar_SubXCentre, Obj_PosY = row << 8 | EvtChar_SubYLower.
$C0:4BC3Evt_Op8C_PlaceAtTileVar100verifiedEvent opcode $8C (3 bytes: $8C, a, b): as Evt_Op8B_PlaceAtTile with the column and row from the low bytes of the event words a and b, except that Obj_PosX's low byte is not set (only Obj_TileX...
$C0:4C27Evt_Op8D_SetPos77verifiedEvent opcode $8D (5 bytes: $8D, the words x, y): Obj_Cur's Obj_PosX = x, Obj_PosY = y (16-bit: tile in the high byte); with Obj_OamFlags bit 7 set the priorities follow the new tile (Obj_TileY <<...
$C0:4C74Evt_Op8E_SetOamFlags97verifiedEvent opcode $8E (2 bytes: $8E, flags): Obj_Cur's Obj_OamFlags = flags.
$C0:4CD5Evt_Op90_SetUnk1A81On4verifiedEvent opcode $90 (1 byte): Obj_Cur's Obj_Unk1A81 = Obj_Unk1A81On (1: its frames are built, so it is probably shown).
$C0:4CD9Evt_Op90_Store7verified
$C0:4CE0Evt_Op91_ClearUnk1A816verifiedEvent opcode $91 (1 byte): Obj_Cur's Obj_Unk1A81 = 0 (no frame build: hidden, probably); X = Y + 1, C=0 through Evt_Op90_Store.
$C0:4CE6Evt_Op7E_SetUnk1A81Bit76verifiedEvent opcode $7E (1 byte): Obj_Cur's Obj_Unk1A81 = $80 (bit 7 only, FieldBtl_ObjUnk1A81Bit: outside 1..$7F, so no frame build, and the battle hand-off treats the object specially); X = Y + 1, C=0...
$C0:4CECEvt_Op7C_SetObjUnk1A81On13verifiedEvent opcode $7C (2 bytes: $7C, slot): as Evt_Op90_SetUnk1A81On for the object in slot: Obj_Unk1A81 = Obj_Unk1A81On.
$C0:4CF9Evt_Op7D_ClearObjUnk1A8113verifiedEvent opcode $7D (2 bytes: $7D, slot): as Evt_Op91_ClearUnk1A81 for the object in slot: Obj_Unk1A81 = 0.
$C0:4D06Evt_Op7A_ArcToTile287verifiedEvent opcode $7A (4 bytes: $7A, column, row, g): moves Obj_Cur along an arc (Obj_ArcMode, probably a jump) to map tile (column, row).
$C0:4E25Evt_Op7B_ArcSteps78verifiedEvent opcode $7B (5 bytes: $7B, vx, vy, g, frames): as Evt_Op7A_ArcToTile with the arc given directly: first run Obj_VelX = vx, Obj_VelY = vy, Obj_ArcGravity = g, Obj_MoveFrames = frames...
$C0:4E73Evt_Op92_WalkDir84verifiedEvent opcode $92 (3 bytes: $92, direction, frames): walks Obj_Cur in a direction for a number of frames.
$C0:4EC7Evt_Op9C_MoveDir67verifiedEvent opcode $9C (3 bytes: $9C, direction, frames): as Evt_Op92_WalkDir without the facing and the animation: Obj_Direction, ObjX_Unk7F0B00 = ObjX_Unk7F0B00Dir, Obj_MoveFrames, Obj_Unk1A80 + 1 and...
$C0:4F0AEvt_Op9D_MoveDirVar87verifiedEvent opcode $9D (3 bytes: $9D, a, b): as Evt_Op9C_MoveDir with the direction and the frames taken from the low bytes of the event words Evt_Unk7F0200 + a x 2 and + b x 2.
$C0:4F61Evt_Op96_WalkToTile137verifiedEvent opcode $96 (3 bytes: $96, column, row): walks Obj_Cur to a map tile, one step per script run.
$C0:4FEAEvt_Op9A_WalkTowardTile154verifiedEvent opcode $9A (4 bytes: $9A, column, row, frames): as Evt_Op96_WalkToTile, but a single step of the given frames (Obj_MoveFrames = ObjX_Unk7F0B00 = frames, Obj_Unk1A80 + 1); once Obj_Unk1A80 is...
$C0:5084Evt_Op97_WalkToTileVar165verifiedEvent opcode $97 (3 bytes: $97, a, b): as Evt_Op96_WalkToTile with the column and row from the low bytes of the event words Evt_Unk7F0200 + a x 2 and + b x 2.
$C0:5129Evt_OpA0_MoveToTile104verifiedEvent opcode $A0 (3 bytes: $A0, column, row): as Evt_Op96_WalkToTile without the facing and the animations (no Obj_Facing write, no Obj_SetMoveAnim / Obj_SetStandAnim): arrived (after any...
$C0:5191Evt_OpA1_MoveToTileVar132verifiedEvent opcode $A1 (3 bytes: $A1, a, b): as Evt_OpA0_MoveToTile with the column and row from the low bytes of the event words Evt_Unk7F0200 + a x 2 and + b x 2.
$C0:5215Evt_Op94_WalkToObj19verifiedEvent opcode $94 (2 bytes: $94, slot): walks Obj_Cur next to the object in slot (object x 2), one step per script run.
$C0:5228Evt_Op94_Body152verified
$C0:52C0Evt_Op9E_MoveToObj19verifiedEvent opcode $9E (2 bytes: $9E, slot): as Evt_Op94_WalkToObj without the facing and the animations; Evt_Op9E_Body (X = the target's slot) is also entered by Evt_Op9F_MoveToPc.
$C0:52D3Evt_Op9E_Body119verified
$C0:534AEvt_Op98_WalkTowardObj33verifiedEvent opcode $98 (3 bytes: $98, slot, frames): as Evt_Op94_WalkToObj but a single step of the given frames (Obj_MoveFrames = ObjX_Unk7F0B00 = frames, Obj_Unk1A80 + 1); with Obj_Unk1A80 set it...
$C0:536BEvt_Op98_Body165verified
$C0:5410Evt_Op95_WalkToPc25verifiedEvent opcode $95 (2 bytes: $95, p): Evt_Op94_WalkToObj toward a party member's object (X = Party_ObjSlot + p; p = 0, 2 or 4, the party position x 2) through Evt_Op94_Body; X = the opcode, C=0...
$C0:5429Evt_Op8F_FollowPc204verifiedEvent opcode $8F (2 bytes: $8F, p): walks Obj_Cur toward a party member's object (X = Party_ObjSlot + p; p = 0, 2 or 4, the party position x 2), one step per script run, as Evt_Op94_WalkToObj...
$C0:54F5Evt_Op9F_MoveToPc25verifiedEvent opcode $9F (2 bytes: $9F, p): Evt_Op9E_MoveToObj toward a party member's object (X = Party_ObjSlot + p; p = 0, 2 or 4, the party position x 2) through Evt_Op9E_Body; X = the opcode, C=0...
$C0:550EEvt_Op99_WalkTowardPc39verifiedEvent opcode $99 (3 bytes: $99, p, frames): Evt_Op98_WalkTowardObj toward a party member's object (X = Party_ObjSlot + p) through Evt_Op98_Body; with Obj_Unk1A80 set it waits for Obj_MoveFrames =...
$C0:5535Evt_Op0F_FaceUp4verifiedEvent opcode $0F (1 byte): Obj_Cur faces up (facing 0) through Evt_SetFacing; X = Y + 1.
$C0:5539Evt_Op17_FaceDown4verifiedEvent opcode $17 (1 byte): Obj_Cur faces down (facing 1) through Evt_SetFacing; X = Y + 1.
$C0:553DEvt_Op1B_FaceLeft4verifiedEvent opcode $1B (1 byte): Obj_Cur faces left (facing 2) through Evt_SetFacing; X = Y + 1.
$C0:5541Evt_Op1D_FaceRight4verifiedEvent opcode $1D (1 byte): Obj_Cur faces right (facing 3) through Evt_SetFacing; X = Y + 1.
$C0:5545Evt_OpA6_Face6verifiedEvent opcode $A6 (2 bytes: $A6, facing): Obj_Cur's Obj_Facing = the operand.
$C0:554BEvt_SetFacing2verified
$C0:554DEvt_SetFacingOfX10verified
$C0:5557Evt_OpA7_FaceVar21verifiedEvent opcode $A7 (2 bytes: $A7, a): Obj_Cur's Obj_Facing = the low byte of the event word Evt_Unk7F0200 + a x 2, through Evt_SetFacing.
$C0:556CEvt_Op1E_ObjFaceUp13verifiedEvent opcode $1E (2 bytes: $1E, slot): the object in slot (object x 2) faces up (facing 0) through Evt_SetFacingOfX.
$C0:5579Evt_Op1F_ObjFaceDown13verifiedEvent opcode $1F (2 bytes: $1F, slot): the object in slot (object x 2) faces down (facing 1) through Evt_SetFacingOfX.
$C0:5586Evt_Op25_ObjFaceLeft13verifiedEvent opcode $25 (2 bytes: $25, slot): the object in slot (object x 2) faces left (facing 2) through Evt_SetFacingOfX.
$C0:5593Evt_Op26_ObjFaceRight13verifiedEvent opcode $26 (2 bytes: $26, slot): the object in slot (object x 2) faces right (facing 3) through Evt_SetFacingOfX.
$C0:55A0Evt_OpA8_FaceObj9verifiedEvent opcode $A8 (2 bytes: $A8, slot): turns Obj_Cur toward the object in slot.
$C0:55A9Evt_OpA8_Body92verified
$C0:5605Evt_OpA9_FacePc15verifiedEvent opcode $A9 (2 bytes: $A9, p): Evt_OpA8_FaceObj toward a party member's object (X = Party_ObjSlot + p, p = 0, 2 or 4) through Evt_OpA8_Body.
$C0:56A6Scene_PostLoadInit46verifiedThe object side of a location load, run once by GameLoop_LoadField after LoadLocation: ObjQ_Unk69 = $0048, ObjQ_ScanlineLimit = $0078, VramQ_Valid = 0 (empty VRAM queue); then Field_ResetUnk0B88...
$C0:56D4LocLoad_Unk56D453verifiedThe last location-load step: unpacks the location's event data.
$C0:5709Evt_InitObjects544verifiedResets the object tables for the Evt_ObjCount objects of the new location and runs each one's init function: 1.
$C0:5929Evt_ClearUnk092051verifiedSets the 16 bytes Evt_Unk0920 to Evt_Unk0920Free ($FF), one STA each.
$C0:595CEvt_RunObj0Func133verified(was Sub_595C.) Runs one event-script function of object 0: the offset stored at Evt_Data+2 (object 0's second function pointer), executing opcodes through Evt_OpcodeTable until opcode $00.
$C0:597DEvt_RunObjInit92verified(was Sub_597D.) Runs object Obj_Cur's init function: the first of its 16 function offsets (Evt_Data + Obj_Cur*16, i.e. 32 bytes per object) is executed through Evt_OpcodeTable until opcode $00.
$C0:59D9Vblank_Unk59D9109verifiedWith DP=$1000 (the Obj_Unk1000 page), for each object slot below Evt_ObjSlotEnd (= Evt_ObjCount x 2, stored here) whose Obj_Unk1000 has bit 7 clear: Obj_Unk1001 is counted down (when not already...
$C0:5A46Vblank_ReadScanlineCounters77verifiedRuns the queued objects' scripts while there is time left in the frame: before each object it reads the V counter (as Field_ProcessAnimQueue does) and stops once it is at ObjQ_Unk69 or more but...
$C0:5A93Evt_RunObjScriptSteps50verifiedRuns object X's script from Obj_ScriptPos: Obj_Cur = X, then up to Field_Unk68 opcodes (Evt_StepsLeft counts them; 5 from load) through Evt_OpcodeTable, each with Y = the opcode's Evt_Data offset...
$C0:5AC5Evt_StartTargetFunc190verifiedStarts function 1 of the object in Field_UnkEB (the one the action button found).
$C0:5B1FEvt_RedirectObjScript68verifiedEvt_StartTargetFunc1's save without its target: for the object in Field_UnkEB, unless Obj_Unk1100 has bit 7 set or Obj_Unk1C00 is 0, saves Obj_ScriptPos in the ObjX_Unk7F0580 table of level...
$C0:5B63Map_LeaderPastRowMax14verifiedMap_Unk9175's test for a downward step: C=1 when the leader's Obj_TileY is past Map_Unk1D1D (TileY >= Map_Unk1D1D + 1).
$C0:5B71Map_LeaderPastRowMin8verifiedMap_Unk9175's test for an upward step: C=1 when the leader's Obj_TileY <= Map_Unk1D1C + 1.
$C0:5B79Map_LeaderPastColMax13verifiedMap_Unk9175's test for a rightward step: C=1 when the leader's Obj_TileX >= Map_Unk1D1B.
$C0:5B86Map_LeaderPastColMin7verifiedMap_Unk9175's test for a leftward step: C=1 when the leader's Obj_TileX <= Map_Unk1D1A.
$C0:5B8DEvt_HasActionTarget8verifiedC=1 when Field_UnkEB holds an object (bit 7 clear), C=0 when it is $80 (none).
$C0:5B95Evt_FindSolidObjInFront93verifiedLooks for a solid object within a tile in front of Obj_Cur.
$C0:5BF2Evt_InFrontTests8verifiedEvt_FindSolidObjInFront's tests by Obj_Facing x 2 (facings 0-3).
$C0:5BFAEvt_InFrontUp38verifiedFacing 0: C=1 when ObjFront_Other is above Obj_Cur and within a tile: its Obj_PosY - ObjFront_Y is negative with magnitude under ObjFront_Reach, and its |Obj_PosX - ObjFront_X| is under it too.
$C0:5C20Evt_InFrontDown35verifiedFacing 1: C=1 when ObjFront_Other is below Obj_Cur within a tile: Obj_PosY - ObjFront_Y from 0 to under ObjFront_Reach and |Obj_PosX - ObjFront_X| under it, with the same SBC carries as Evt_InFrontUp.
$C0:5C43Evt_InFrontNo4verified
$C0:5C47Evt_InFrontLeft38verifiedFacing 2: as Evt_InFrontUp on the other axis: C=1 when Obj_PosX - ObjFront_X is negative with magnitude under ObjFront_Reach and |Obj_PosY - ObjFront_Y| is under it (same SBC carries).
$C0:5C6DEvt_InFrontRight35verifiedFacing 3: as Evt_InFrontDown on the other axis: C=1 when Obj_PosX - ObjFront_X is from 0 to under ObjFront_Reach and |Obj_PosY - ObjFront_Y| is under it (same SBC carries).
$C0:5C90Evt_FindOrAddUnk092055verifiedLooks up Evt_Unk0920Key in the Evt_Unk0920Entries (16) bytes of Evt_Unk0920: found at n, A = Evt_Unk0930[n] (the Obj_Cur stored with it) and C=1.
$C0:5CC7LocLoad_CheckEvtData37verifiedTwo checks LocLoad_Unk56D4 makes on the event data it has just unpacked; each failure ends in Sys_HaltWithColor: - Evt_ObjCount = Evt_BadObjCount ($0D) with first Evt_Data byte Evt_BadFirstByte...
$C0:5CECLocLoad_InitUnk7F370075verifiedSeeds the 134 bytes at Map_Unk7F3700 from LocLoad_Unk7F3700Init with five MVNs: 32 bytes from the table's start to $7F:3700, then three times 32 bytes from LocLoad_Unk7F3700Init_Rec1 to $7F:3720...
$C0:5D37LocLoad_Unk7F3700Init55verifiedLocLoad_InitUnk7F3700's source: 25 bytes for $7F:3700, 24 for the three blocks at $7F:3720-$7F:3760 (Rec1; the copies take 32 and so also read Rec4 and the first two bytes of Evt_OpcodeTable) and...
$C0:5D6EEvt_OpcodeTable512verifiedThe event-script opcode handlers, one word per opcode $00-$FF (bank $C0 addresses), indexed by opcode x 2: the script runners read the opcode byte at Evt_Data + the script position, set Y = that...
$C0:5F6EEvt_UnusedOpcode6verifiedThe handler Evt_OpcodeTable gives every unused event opcode ($01, $3A, $3D, $3E, $45, $46, $6E, $70, $74, $78, $79, $85, $86, $93, $9B, $A2-$A5, $BE, $BF, $C5, $C6, $DB, $E9, $EF, $F5-$F7...
$C0:5F74Evt_Op00_Return66verifiedEvent opcode $00 (1 byte): ends the function Obj_Cur is running.
$C0:5FB6Evt_Op02_CallObjFunc8verifiedEvent opcode $02 (3 bytes: $02, slot, level/function): makes the object in slot run one of its functions, without waiting.
$C0:5FBEEvt_Op02_Body192verified
$C0:607EEvt_Op03_CallObjFuncRetry8verifiedEvent opcode $03 (3 bytes: $03, slot, level/function): as Evt_Op02_CallObjFunc, but it starts the call or waits: while the target's Obj_Unk1C01 is nonzero or the new level is not below the...
$C0:6086Evt_Op03_Body131verified
$C0:6109Evt_Op04_CallObjFuncWait25verifiedEvent opcode $04 (3 bytes: $04, slot, level/function): as Evt_Op03_CallObjFuncRetry, and then waits for the function to end.
$C0:6122Evt_Op04_Start141verified
$C0:61AFEvt_Op04_WaitSlot58verified
$C0:61E9Evt_Op05_CallPcFunc21verifiedEvent opcode $05 (3 bytes: $05, p, level/function): Evt_Op02_CallObjFunc on party member p's object (Party_ObjSlot + p).
$C0:61FEEvt_Op06_CallPcFuncRetry22verifiedEvent opcode $06 (3 bytes: $06, p, level/function): Evt_Op03_CallObjFuncRetry on party member p's object.
$C0:6214Evt_Op07_CallPcFuncWait44verifiedEvent opcode $07 (3 bytes: $07, p, level/function): Evt_Op04_CallObjFuncWait on party member p's object: with ObjX_CallWait 0 through Evt_Op04_Start (no member, bit 7 set: X = Y + 3, C=1), else...
$C0:6240Evt_Op08_BlockCalls7verifiedEvent opcode $08 (1 byte): Obj_Cur's Obj_Unk1C01 = 1.
$C0:6247Evt_Op08_Next4verified
$C0:624BEvt_Op09_AllowCalls9verifiedEvent opcode $09 (1 byte): Obj_Cur's Obj_Unk1C01 = 0 (undoes Evt_Op08_BlockCalls); X = Y + 1, C=1 through Evt_Op08_Next.
$C0:6254Evt_Op0A_RemoveObj21verifiedEvent opcode $0A (2 bytes: $0A, slot): the object in slot gets Obj_Unk1100 = $80 (bit 7: Vblank_Unk59D9 never queues its script and the call opcodes skip it) and Obj_Unk1A81 = 0 (no frame build)...
$C0:6269Evt_Op0B_StopObjScript25verifiedEvent opcode $0B (2 bytes: $0B, slot): sets bit 7 of the object's Obj_Unk1000 (Obj_Unk1000Bit7): Vblank_Unk59D9 stops counting its script timer, so its script no longer runs, and the call opcodes...
$C0:6282Evt_Op0C_StartObjScript19verifiedEvent opcode $0C (2 bytes: $0C, slot): clears bit 7 of the object's Obj_Unk1000 (undoes Evt_Op0B_StopObjScript); X = Y + 2, C=1 through Evt_Op0E_Next.
$C0:6295Evt_Op0D_SetUnk1C8015verifiedEvent opcode $0D (2 bytes: $0D, value): Obj_Cur's Obj_Unk1C80 = value (bit 0 Obj_Unk1C80Block: tile blocking in Obj_SetVelocityChecked; bit 1 Obj_Unk1C80Front: Evt_FindSolidObjInFront looks for...
$C0:62A4Evt_Op0E_SetUnk1C8113verifiedEvent opcode $0E (2 bytes: $0E, value): Obj_Cur's Obj_Unk1C81 = value (bit 0 Obj1C81_CentreOnTile, bit 1 Obj1C81_OntoObj: what the walk opcodes do on arriving).
$C0:62B1Evt_Op0E_Next4verified
$C0:62B5Evt_Op10_JumpFwd22verifiedEvent opcode $10 (2 bytes: $10, n): the script goes on n bytes after the operand byte: X = Y + 1 + n, C=1.
$C0:62CBEvt_Op11_JumpBack19verifiedEvent opcode $11 (2 bytes: $11, n): the script goes back n bytes from the operand byte: X = Y + 1 - n, C=1 (through Evt_Op10_JumpFwd's .store).
$C0:62DEEvt_Op12_IfVarByte53verifiedEvent opcode $12 (5 bytes: $12, a, value, cmp, n): EvtIf_Left = the low byte of event word a, EvtIf_Right = value; comparison cmp of Evt_CmpTable8 (0 =, 1 !=, 2 >, 3 <, 4 >=, 5 <=, 6 AND nonzero...
$C0:6313Evt_Op13_IfVarWord54verifiedEvent opcode $13 (6 bytes: $13, a, value (word), cmp, n): as Evt_Op12_IfVarByte with the whole event word a and a 16-bit value, through Evt_CmpTable16.
$C0:6349Evt_JumpFromOfsPos24verified
$C0:6361Evt_Op14_IfVarVarByte67verifiedEvent opcode $14 (5 bytes: $14, a, b, cmp, n): as Evt_Op12_IfVarByte with EvtIf_Right = the low byte of event word b.
$C0:63A4Evt_Op15_IfVarVarWord66verifiedEvent opcode $15 (5 bytes: $15, a, b, cmp, n): as Evt_Op14_IfVarVarByte with the whole event words, through Evt_CmpTable16.
$C0:63E6Evt_Op16_IfMemByte92verifiedEvent opcode $16 (5 bytes: $16, m, value, cmp, n): EvtIf_Left = the byte at Evt_Mem7F + m, or at Evt_Mem7F + $100 + m when bit 7 (EvtIf_Page1Flag) of cmp is set; EvtIf_Right = value; comparison...
$C0:6442Evt_Op18_IfUnk7F0000Below37verifiedEvent opcode $18 (3 bytes: $18, value, n): goes on (X = Y + 3) while Eng_Unk7F0000 < value; from value up it jumps n bytes on from the n byte.
$C0:6467Evt_CmpTable816verifiedThe byte comparisons of the condition opcodes $12, $14 and $16, indexed by cmp x 2 (JSR (Evt_CmpTable8,X) with 8-bit X).
$C0:6477Evt_CmpTable1616verifiedThe word comparisons of opcodes $13 and $15, in the order of Evt_CmpTable8.
$C0:6487Evt_Cmp8Eq8verifiedThe byte comparisons of Evt_CmpTable8: each compares EvtIf_Left with EvtIf_Right (unsigned) and returns C=0 when the relation holds, C=1 when not: Eq =, Ne !=, Gt >, Lt <, Ge >=, Le <=, And (Left...
$C0:648FEvt_Cmp8Ne8verified
$C0:6497Evt_Cmp8Gt10verified
$C0:64A1Evt_Cmp8Lt8verified
$C0:64A9Evt_Cmp8Ge10verified
$C0:64B3Evt_Cmp8Holds2verified
$C0:64B5Evt_Cmp8Le10verified
$C0:64BFEvt_Cmp8And8verified
$C0:64C7Evt_Cmp8Or8verified
$C0:64CFEvt_Cmp16Eq12verified
$C0:64DBEvt_Cmp16Ne12verified
$C0:64E7Evt_Cmp16Gt14verified
$C0:64F5Evt_Cmp16Lt14verified
$C0:6503Evt_Cmp16Ge14verified
$C0:6511Evt_Cmp16Le14verified
$C0:651FEvt_Cmp16Holds4verified
$C0:6523Evt_Cmp16And12verified
$C0:652FEvt_Cmp16Or12verified
$C0:653BEvt_Op19_SetUnk7F0A80Var19verifiedEvent opcode $19 (2 bytes: $19, a): Obj_Cur's ObjX_Unk7F0A80 = event word a; X = Y + 2, C=1, through the store at the end of Evt_Op1C_SetUnk7F0A80Mem (BRA Evt_Op1C_SetUnk7F0A80Mem_store).
$C0:654EEvt_Op1C_SetUnk7F0A80Mem26verifiedEvent opcode $1C (3 bytes: $1C, m (word)): Obj_Cur's ObjX_Unk7F0A80 = the word at Evt_Mem7F + m; X = Y + 3, C=1.
$C0:6568Evt_Op1A_IfUnk7F0A8039verifiedEvent opcode $1A (3 bytes: $1A, value, n): goes on (X = Y + 3) when the low byte of Obj_Cur's ObjX_Unk7F0A80 equals value, else jumps n bytes on from the n byte.
$C0:658FEvt_Op20_GetPartyMember027verifiedEvent opcode $20 (2 bytes: $20, a): event word a's low byte = the first byte of Party_Members (the character id of party member 1, probably the leader); X = Y + 2, C=1.
$C0:65AAEvt_Op21_GetObjTile8verifiedEvent opcode $21 (4 bytes: $21, slot, a, b): event word a's low byte = the object's Obj_TileX, event word b's = its Obj_TileY; X = Y + 4, C=1.
$C0:65B2Evt_Op21_Body57verified
$C0:65EBEvt_Op22_GetPcTile13verifiedEvent opcode $22 (4 bytes: $22, p, a, b): Evt_Op21_GetObjTile for party member p's object (Party_ObjSlot + p); X = Y + 4, C=1.
$C0:65F8Evt_Op23_GetObjFacing8verifiedEvent opcode $23 (3 bytes: $23, slot, a): event word a's low byte = the object's Obj_Facing; X = Y + 3, C=1.
$C0:6600Evt_Op23_Body31verified
$C0:661FEvt_Op24_GetPcFacing13verifiedEvent opcode $24 (3 bytes: $24, p, a): Evt_Op23_GetObjFacing for party member p's object; X = Y + 3, C=1.
$C0:662CEvt_Op27_IfObjUnk0F0041verifiedEvent opcode $27 (3 bytes: $27, slot, n): goes on (X = Y + 3) when the object's Obj_Unk0F00 is nonzero (it has a frame to build), else jumps n bytes on from the n byte.
$C0:6655Evt_Op28_IfObjInsideScreen80verifiedEvent opcode $28 (3 bytes: $28, slot, n): goes on (X = Y + 3) when the object is well inside the screen, by Evt_Op8F_FollowPc's test: its Obj_TileX minus EvtFollow_ScrCol (Map_TileOriginX / 2) is...
$C0:66A5Evt_Op2D_IfAnyHeld13verifiedEvent opcode $2D (2 bytes: $2D, n): goes on when Pad_Unk00F8 or Pad_Unk00F9 is nonzero (any button or D-pad direction held, through the button map), else jumps.
$C0:66B2Evt_Op30_IfMapHeldBit110verifiedEvent opcode $30 (2 bytes: $30, n): goes on when Pad_Unk00F8 bit 1 (Pad_Unk00F8Bit1, the button the D-pad handlers run with) is held, else jumps.
$C0:66BCEvt_Op31_IfMapHeldBit710verifiedEvent opcode $31 (2 bytes: $31, n): goes on when Pad_Unk00F8 bit 7 (Pad_Unk00F8Bit7) is held, else jumps.
$C0:66C6Evt_Op34_IfHeldA10verifiedEvent opcode $34 (2 bytes: $34, n): goes on when A (Pad_A) is held in Menu_PadHeld, else jumps.
$C0:66D0Evt_PadJump21verified
$C0:66E5Evt_Op35_IfHeldB10verifiedEvent opcode $35 (2 bytes: $35, n): goes on when B (Pad_B) is held in Menu_PadHeld, else jumps.
$C0:66EFEvt_Op36_IfHeldX10verifiedEvent opcode $36 (2 bytes: $36, n): goes on when X (Pad_X) is held in Menu_PadHeld, else jumps.
$C0:66F9Evt_Op37_IfHeldY8verifiedEvent opcode $37 (2 bytes: $37, n): goes on when Y (Pad_Y) is held in Menu_PadHeld, else jumps.
$C0:6701Evt_PadGoOn4verified
$C0:6705Evt_Op38_IfHeldL10verifiedEvent opcode $38 (2 bytes: $38, n): goes on when L (Pad_L) is held in Menu_PadHeld, else jumps.
$C0:670FEvt_Op39_IfHeldR10verifiedEvent opcode $39 (2 bytes: $39, n): goes on when R (Pad_R) is held in Menu_PadHeld, else jumps.
$C0:6719Evt_Op3B_IfMapPressedBit111verifiedEvent opcode $3B (2 bytes: $3B, n): when Pad_Unk00F6Latch bit 1 (Pad_Unk00F6Bit1) is set it is cleared and the script goes on, else it jumps.
$C0:6724Evt_Op3C_IfMapPressedBit714verifiedEvent opcode $3C (2 bytes: $3C, n): as Evt_Op3B_IfMapPressedBit1 with bit 7 (Pad_Unk00F6Bit7, the button Field_ActionButton acts on).
$C0:6732Evt_Op3F_IfPressedA14verifiedEvent opcode $3F (2 bytes: $3F, n): when A (Pad_A) is set in Pad_PressedLatch it is cleared and the script goes on, else it jumps.
$C0:6740Evt_Op40_IfPressedB14verifiedEvent opcode $40 (2 bytes: $40, n): as Evt_Op3F_IfPressedA with B (Pad_B); goes on through Evt_PadGoOn2.
$C0:674EEvt_Op41_IfPressedX14verifiedEvent opcode $41 (2 bytes: $41, n): as Evt_Op3F_IfPressedA with X (Pad_X); goes on through Evt_PadGoOn2.
$C0:675CEvt_Op42_IfPressedY14verifiedEvent opcode $42 (2 bytes: $42, n): as Evt_Op3F_IfPressedA with Y (Pad_Y); goes on through Evt_PadGoOn2.
$C0:676AEvt_Op43_IfPressedL14verifiedEvent opcode $43 (2 bytes: $43, n): as Evt_Op3F_IfPressedA with L (Pad_L); goes on through Evt_PadGoOn2.
$C0:6778Evt_Op44_IfPressedR12verifiedEvent opcode $44 (2 bytes: $44, n): as Evt_Op3F_IfPressedA with R (Pad_R).
$C0:6784Evt_PadGoOn24verified
$C0:6788Evt_Op47_SetScanlineLimit10verifiedEvent opcode $47 (2 bytes: $47, v): the low byte of ObjQ_ScanlineLimit = v (Field_ProcessAnimQueue stops building frames once the V counter reaches it); X = Y + 2, C=1 through Evt_PadGoOn2.
$C0:6792Evt_Op48_GetLongByte16verifiedEvent opcode $48 (5 bytes: $48, ptr, a): event word a's low byte = the byte at ptr; X = Y + 5, C=1.
$C0:67A2Evt_ReadSrcPtrAndVar37verifiedReads the operands of opcodes $48 / $49: EvtMem_Src = the 3 bytes at Y + 1 (ptr), then X = the event word index (the byte at Y + 4) x 2, with EvtMem_Pos = Y + 4.
$C0:67C7Evt_Op49_GetLongWord16verifiedEvent opcode $49 (5 bytes: $49, ptr, a): event word a = the word at ptr; X = Y + 5, C=1.
$C0:67D7Evt_Op4A_SetLongByte12verifiedEvent opcode $4A (5 bytes: $4A, ptr, value): the byte at ptr = value; X = Y + 5, C=1.
$C0:67E3Evt_ReadDstPtr24verifiedReads the pointer operand of opcodes $4A-$4D: EvtMem_Dst = the 3 bytes at Y + 1; X = Y + 4 (the next operand).
$C0:67FBEvt_Op4B_SetLongWord17verifiedEvent opcode $4B (6 bytes: $4B, ptr, value (word)): the word at ptr = value; X = Y + 6, C=1.
$C0:680CEvt_Op4C_SetLongVarByte29verifiedEvent opcode $4C (5 bytes: $4C, ptr, a): the byte at ptr = event word a's low byte; X = Y + 5, C=1.
$C0:6829Evt_Op4D_SetLongVarWord29verifiedEvent opcode $4D (5 bytes: $4D, ptr, a): the word at ptr = event word a; X = Y + 5, C=1.
$C0:6846Evt_Op4E_CopyData95verifiedEvent opcode $4E (variable: $4E, dst (word), bank, len (word), then len - 2 data bytes): copies the data bytes with MVN to dst in bank $7E when bank is $7E, else in bank $7F (any other bank byte)...
$C0:68A5Evt_Op4F_SetVarByte33verifiedEvent opcode $4F (3 bytes: $4F, value, a): event word a's low byte = value; X = Y + 3, C=1.
$C0:68C6Evt_Op50_SetVarWord35verifiedEvent opcode $50 (4 bytes: $50, value (word), a): event word a = value; X = Y + 4, C=1.
$C0:68E9Evt_Op51_CopyVarByte42verifiedEvent opcode $51 (3 bytes: $51, a, b): event word b's low byte = event word a's low byte (a is read as a word, only its low byte stored); X = Y + 3, C=1.
$C0:6913Evt_Op52_CopyVarWord42verifiedEvent opcode $52 (3 bytes: $52, a, b): event word b = event word a; X = Y + 3, C=1.
$C0:693DEvt_Op53_GetMemByte39verifiedEvent opcode $53 (4 bytes: $53, m (word), a): event word a's low byte = the byte at Evt_Mem7F + m (read as a word, its low byte stored); X = Y + 4, C=1.
$C0:6964Evt_Op54_GetMemWord39verifiedEvent opcode $54 (4 bytes: $54, m (word), a): event word a = the word at Evt_Mem7F + m; X = Y + 4, C=1.
$C0:698BEvt_Op55_GetUnk7F000027verifiedEvent opcode $55 (2 bytes: $55, a): event word a's low byte = Eng_Unk7F0000; X = Y + 2, C=1.
$C0:69A6Evt_Op56_SetMemByte30verifiedEvent opcode $56 (4 bytes: $56, value, m (word)): the byte at Evt_Mem7F + m = value; X = Y + 4, C=1.
$C0:69C4Evt_Op58_SetMemVarByte39verifiedEvent opcode $58 (4 bytes: $58, a, m (word)): the byte at Evt_Mem7F + m = event word a's low byte; X = Y + 4, C=1.
$C0:69EBEvt_Op59_SetMemVarWord39verifiedEvent opcode $59 (4 bytes: $59, a, m (word)): the word at Evt_Mem7F + m = event word a; X = Y + 4, C=1.
$C0:6A12Evt_Op5A_SetUnk7F000013verifiedEvent opcode $5A (2 bytes: $5A, value): Eng_Unk7F0000 = value; X = Y + 2, C=1.
$C0:6A1FEvt_Op5B_AddVarByte38verifiedEvent opcode $5B (3 bytes: $5B, value, a): event word a's low byte += value; X = Y + 3, C=1.
$C0:6A45Evt_Op5D_AddVarVarByte47verifiedEvent opcode $5D (3 bytes: $5D, a, b): event word b's low byte += event word a's low byte; X = Y + 3, C=1.
$C0:6A74Evt_Op5E_AddVarVarWord47verifiedEvent opcode $5E (3 bytes: $5E, a, b): event word b += event word a; X = Y + 3, C=1.
$C0:6AA3Evt_Op5F_SubVarByte38verifiedEvent opcode $5F (3 bytes: $5F, value, a): event word a's low byte -= value; X = Y + 3, C=1.
$C0:6AC9Evt_Op60_SubVarWord40verifiedEvent opcode $60 (4 bytes: $60, value (word), a): event word a -= value; X = Y + 4, C=1.
$C0:6AF1Evt_Op61_SubVarVarByte47verifiedEvent opcode $61 (3 bytes: $61, a, b): event word b's low byte -= event word a's low byte; X = Y + 3, C=1.
$C0:6B20Evt_Op63_SetVarBit43verifiedEvent opcode $63 (3 bytes: $63, bit, a): sets bit number bit (0-7, through BitSet) in event word a's low byte; X = Y + 3, C=1.
$C0:6B4BEvt_Op64_ClearVarBit43verifiedEvent opcode $64 (3 bytes: $64, bit, a): clears bit number bit (0-7, through BitClear) in event word a's low byte; X = Y + 3, C=1.
$C0:6B76Evt_Op65_SetMemBit46verifiedEvent opcode $65 (3 bytes: $65, bit, m): sets a bit of the byte at Evt_Mem7F + m, or at Evt_Mem7F + $100 + m when bit 7 of the bit operand is set; the bit number is the operand's bits 0-3...
$C0:6BA4Evt_Op66_ClearMemBit46verifiedEvent opcode $66 (3 bytes: $66, bit, m): clears a bit of the byte at Evt_Mem7F + m, or at Evt_Mem7F + $100 + m when bit 7 of the bit operand is set; the bit number is the operand's bits 0-3...
$C0:6BD2Evt_Op67_AndVarByte37verifiedEvent opcode $67 (3 bytes: $67, mask, a): ANDs event word a's low byte with mask; X = Y + 3, C=1.
$C0:6BF7Evt_Op69_OrVarByte37verifiedEvent opcode $69 (3 bytes: $69, mask, a): ORs event word a's low byte with mask; X = Y + 3, C=1.
$C0:6C1CEvt_Op6B_EorVarByte37verifiedEvent opcode $6B (3 bytes: $6B, mask, a): EORs event word a's low byte with mask; X = Y + 3, C=1.
$C0:6C41Evt_Op6F_ShrVarByte40verifiedEvent opcode $6F (3 bytes: $6F, count, a): shifts event word a's low byte right count times; X = Y + 3, C=1.
$C0:6C69Evt_Op71_IncVarByte28verifiedEvent opcode $71 (2 bytes: $71, a): adds 1 to event word a's low byte (wrapping in the byte); X = Y + 2, C=1.
$C0:6C85Evt_Op72_IncVarWord28verifiedEvent opcode $72 (2 bytes: $72, a): adds 1 to event word a; X = Y + 2, C=1.
$C0:6CA1Evt_Op73_DecVarByte28verifiedEvent opcode $73 (2 bytes: $73, a): subtracts 1 from event word a's low byte (wrapping in the byte); X = Y + 2, C=1.
$C0:6CBDEvt_Op75_SetVarByte125verifiedEvent opcode $75 (2 bytes: $75, a): event word a's low byte = 1; X = Y + 2, C=1.
$C0:6CD6Evt_Op76_SetVarWord126verifiedEvent opcode $76 (2 bytes: $76, a): event word a = 1; X = Y + 2, C=1.
$C0:6CF0Evt_Op77_ClearVarByte25verifiedEvent opcode $77 (2 bytes: $77, a): event word a's low byte = 0; X = Y + 2, C=1.
$C0:6D09Evt_Op7F_RandomVarByte38verifiedEvent opcode $7F (2 bytes: $7F, a): event word a's low byte = the next RandomTable byte: Field_Unk0400Copy is incremented and indexes it (as Obj_SetVelocityChecked does); X = Y + 2, C=1.
$C0:6D2FLocLoad_UploadPack54verifiedOne graphics pack of LocLoad_Unk0960: reads the pack number at [LocGfx_PackListPtr]; unless it is LocRom_SetNone, unpacks its LocGfx_PackPtrs entry with Decomp_ToWramVec to LocGfx_Stage and...
$C0:6D65LocLoad_UnpackPacks67106verifiedThe end of LocLoad_Unk0960: with LocGfx_PackListPtr on entry byte 6 of the LocGfx_Lists entry, unpacks pack 6 to LocGfx_Unk7F6000, steps the pointer (16-bit INX this time), and unpacks pack 7 to...
$C0:6DCFLocLoad_Unk6DCF88verifiedLoads the layer-3 graphics: if LocRom.Tileset3 is LocRom_SetNone it only sets Field_UnkBB = 1 (no layer 3; LocLoad_Unk0A14 and LocLoad_UnkA33B test it).
$C0:6E27Credits_LoadGfx53verifiedUnpacks the pack at Credits_GfxPack ($FD:0000) to LocGfx_StageL3 and uploads Credits_GfxBytes of it to VRAM LocGfx_VramL3, as LocLoad_Unk6DCF loads a location's layer-3 graphics.
$C0:6E5CField_UploadUnk1F0068verifiedUploads one of eight bank-$FF graphics sets picked, like Pal_LoadUnkRow0's colours, by Menu_Config01 bits 0-2: the set's first Field_UploadUnk1F00Bytes ($200) go to VRAM $1F00 and the next...
$C0:6EA0Field_UploadUnk1F00Srcs16verifiedField_UploadUnk1F00's eight source offsets in bank $FF, one per Menu_Config01 setting; each set is $280 bytes ($200 + $80).
$C0:6EB0Field_UploadUnk1D0027verifiedUploads Field_UploadUnk1D00Bytes ($280) from Field_Unk7EF000 to VRAM $1D00 (VramDma_Upload, word writes): the 32 x 10 tilemap Field_Unk29F7 writes there (a bordered panel, probably a window...
$C0:6ECBField_UploadUnk580038verifiedUploads Field_UploadUnk5800Bytes ($400) from Field_Unk7EF000 to VRAM word Field_UploadVram5800 + Field_Unk31 x $200 (VramDma_Upload, word writes).
$C0:6EF1Field_UploadUnk1C0027verifiedAs Field_UploadUnk1D00 with VRAM $1C00 and Field_UploadUnk1C00Bytes ($200), from the same Field_Unk7EF000: the 32 x 8 tilemap of tiles $00-$FF that Field_Unk2B78 writes there.
$C0:6F0CField_UploadUnk000082verifiedFour uploads of Field_UploadUnk0000Bytes ($40) from bank $FF to the start of VRAM: FieldRom_Unk9CF0 + 0 / $40 / $80 / $C0 to VRAM $0000, $0100, $0030 and $0130 (two 2-tile pieces in each of two...
$C0:6F5EField_UploadUnk57E027verifiedUploads Field_UploadUnk57E0Bytes ($40) from FieldRom_Unk9260 ($FF:9260) to VRAM $57E0, the last $20 words of the area LocLoad_Unk6DCF fills from LocGfx_VramL3 ($5000), so it overwrites the end of...
$C0:6F79Field_ResetUnk0B8833verifiedWith DP=$2100, writes Field_Unk0B80Empty ($80) to the Field_Unk0B88Bytes (30) bytes of Field_Unk0B88 through the WRAM port.
$C0:7084LocLoad_Unk7084101verifiedCopies the location's palette rows: LocPal_Rom entry LocRom.Palette (LocPal_SetBytes = 7 x 30 bytes, offset by the hardware multiplier) goes with seven MVNs of LocPal_RowBytes each to Pal_LocRows...
$C0:70E9Pal_LoadUnkRow069verifiedSets colours 1-15 of Pal_Buf row 0 and then copies all of Pal_Buf (Pal_BufBytes) to Pal_CgramBuf ($7E:2200): - 30 bytes from FieldRom_PalRow0Sets + 2 + n x 16, n = Menu_Config01 (Menu_Config+1)...
$C0:712EPal_UploadCgram38verifiedSends Pal_CgramBuf (Pal_BufBytes from $7E:2200) to CGRAM from colour 0 with DMA channel 7 (mode 0, B-bus CGDATA).
$C0:7154Pal_UploadCgram_Rts1verified
$C0:7155Field_ResetUnk0B8027verifiedWrites Field_Unk0B80Empty ($80) to the 8 bytes of Field_Unk0B80, one STA each (see Field_ResetUnk0B88).
$C0:7399Map_InitMasksAndLimits269verifiedTurns the six layer sizes LocLoad_UnkA33B just set into the wrap masks the row / column writers use: Map_ColMask1 from Map_Unk0BCB, Map_RowMask1 from Map_Unk0BCD, Map_ColMask2 / RowMask2 from...
$C0:74A6Map_InitOrigin46verifiedSets the scroll origin for the leader's entry point: Map_InitOriginX and Map_InitOriginY, then, when Map_Unk0BC9 has bit 7 set (layer 2 at half rate), layer 2's half-rate origin and bounds...
$C0:74D4Field_Unk74D413verifiedResets layer 1's scroll: zeroes Map_BgColBias / Map_BgRowBias and the scroll words Map_Unk1D87 / Map_Unk1D89, then runs Sub_C07F9A for the new edge addresses.
$C0:74E1Field_Unk74D4_Tail7verified
$C0:74E8Field_Unk74E815verifiedAs Field_Unk74D4 for layer 2: zeroes Map_BgColBias2 / Map_BgRowBias2, Map_Unk1D8B and Map_Unk1D8D, then Field_Unk74D4_Tail.
$C0:74F7Field_Unk74F715verifiedAs Field_Unk74D4 for layer 3: zeroes Map_BgColBias3 / Map_BgRowBias3, Map_Unk1D8F and Map_Unk1D91, then Field_Unk74D4_Tail.
$C0:7506Map_InitOriginX77verifiedPuts layer 1's left origin (Map_TileOriginX, in 8x8 tiles: metatile column x 2) so that the entry column Loc_EntryX is Map_OriginLeadX metatiles from the screen's left edge, kept inside the limits...
$C0:7553Map_InitOriginY77verifiedAs Map_InitOriginX for rows: Map_TileOriginY from Loc_EntryY and the limits Map_Unk1D1C-1D1D, the leader Map_OriginLeadY metatiles below the top edge; the bottom bound Map_Unk1D10 = origin +...
$C0:75A0Map_ClearBufC80073verified(was Map_Unk75A0.) Zeroes the 2 KB WRAM buffer Map_BufC800 ($7E:C800–$7E:CFFF) that Field_BuildC800Mode1/2/4 fill: the first MVN copies the 32 zero bytes at GfxRom_D2 to its start, and each later...
$C0:75E9Field_BuildC800Mode141verifiedMap layer redraws, row / column writers and edge VRAM addresses ($C0:75E9–$C0:8242) The map sits in WRAM as metatile numbers.
$C0:7612Map_WriteRow1466verifiedWrites one row of layer-1 tilemap words to WMDATA (WRAM at WMADD).
$C0:77E4Map_WriteCol1264verifiedWrites one column of layer-1 tilemap words to WMDATA, top to bottom.
$C0:78ECField_BuildC800Mode2227verifiedRedraws layer 2 into Map_BufC800 (WMADD = $7E:C800) with Map_WriteRow2, 16 metatiles (Map_RedrawLen) per row, one of three ways: - Map_LayerEdgeOff bit 1 clear, Map_Unk0BC9 bit 7 clear: as...
$C0:79CFMap_WriteRow2474verifiedAs Map_WriteRow1 for layer 2: masks Map_RowMask2 / Map_ColMask2, the number's low byte from Map_Layer2Tiles and bit 8 from Map_TileHiBits bit 1, Map_Meta12* words.
$C0:7BA9Map_WriteCol2268verifiedAs Map_WriteCol1 for layer 2 (Map_RowMask2 / Map_ColMask2, Map_Layer2Tiles, Map_TileHiBits bit 1, Map_Meta12*); an odd first row also gives 2 x Map_BuildLen + 1 words.
$C0:7CB5Field_BuildC800Mode4177verifiedAs Field_BuildC800Mode2 for layer 3 with Map_WriteRow3, without the half-rate path: Map_LayerEdgeOff bit 2 clear redraws 32 rows from Map_TileOriginY / Map_TileOriginX; set builds the fixed map...
$C0:7D66Map_WriteRow3250verifiedAs Map_WriteRow1 for layer 3: masks Map_RowMask3 / Map_ColMask3, an 8-bit metatile number from Map_Layer3Tiles (zero-extended), words from Map_Meta3*.
$C0:7E60Map_WriteCol3248verifiedAs Map_WriteCol1 for layer 3 (Map_RowMask3 / Map_ColMask3, Map_Layer3Tiles zero-extended, Map_Meta3*); an odd first row gives 2 x Map_BuildLen + 1 words.
$C0:7F58Map_UploadBufTo74005verifiedSends Map_BufC800 to VRAM through VramDma_Upload (VramDma_Mode 1, source $7E:C800): Map_UploadBufTo7400 ($7F58) 2 KB to VRAM word $7400; Map_UploadBufTo7000 ($7F5D) 2 KB to VRAM word $7000...
$C0:7F5DMap_UploadBufTo70003verified
$C0:7F60Map_UploadBufToX2verified
$C0:7F62Map_UploadBuf2K5verified
$C0:7F67Map_UploadBuf_Tail16verified
$C0:7F77Map_UploadBuf4K7verified
$C0:7F7ELocLoad_ClearPage1D0028verifiedZeroes the 256 bytes at $00:1D00-$1DFF (the map page !DP_Map, low WRAM) with ClearRAMDMA: DmaFill_Size = $0100, DmaFill_Dest = $1D00, DmaFill_Bank = $00.
$C0:7F9ASub_C07F9A419verifiedPurpose not established (no reader of its results traced).
$C0:813DBg_RowSpan64x32100verifiedSplits a run of 34 tilemap words (Map_EdgeRowTiles) along row Y from column A of a 64x32 tilemap (two 32x32 screens, the right one Bg_ScreenWords further on) into pieces contiguous in VRAM.
$C0:81A1Bg_RowSpan64x32Addr53verifiedThe addresses of Bg_RowSpan64x32 without the sizes, in other registers: X = word offset of (A, Y), A = offset of the start of row Y in the other screen, Y = X - 31 (the third piece's address; the...
$C0:81D6Bg_ColSpan64x3266verifiedSplits a 32-word column of the 64x32 tilemap, column A from row Y and wrapping at the screen's bottom, into two pieces: X = word offset of (A, Y), Y = offset of (A, row 0) in the same screen...
$C0:8218Bg_ColSpan64x32Addr43verifiedThe addresses of Bg_ColSpan64x32 without the sizes: X = word offset of (A, Y), A = offset of (A, row 0) in the same screen.
$C0:8243Map_BuildRowYInc132verifiedLayer-1 row for a rising Y scroll: WMADD = Map_BufC800, Map_BuildCol = Map_TileOriginX - 1, Map_BuildLen = Map_EdgeRowLen, Map_BuildRow = Map_Unk1D10; runs Map_WriteRow1 and sets bit 0 in...
$C0:8263Map_BuildRowYInc234verifiedLayer-2 row for a rising Y scroll: WMADD = Map_BufD000, Map_BuildCol = Map_TileOriginX - 1, Map_BuildLen = Map_EdgeRowLen, Map_BuildRow = Map_Unk1D10; runs Map_WriteRow2 and sets bit 1 in...
$C0:8285Map_BuildRowYInc2Half32verifiedLayer-2 row for a rising Y scroll: WMADD = Map_BufD000, Map_BuildCol = Map_Unk1D12 - 1, Map_BuildLen = Map_EdgeRowLen, Map_BuildRow = Map_Unk1D18; runs Map_WriteRow2 and sets bit 1 in...
$C0:82A5Map_BuildRowYInc332verifiedLayer-3 row for a rising Y scroll: WMADD = Map_BufD800, Map_BuildCol = Map_TileOriginX - 1, Map_BuildLen = Map_EdgeRowLen, Map_BuildRow = Map_Unk1D10; runs Map_WriteRow3 and sets bit 2 in...
$C0:82C5Map_BuildRowYDec132verifiedLayer-1 row for a falling Y scroll: WMADD = Map_BufC800, Map_BuildCol = Map_TileOriginX - 1, Map_BuildLen = Map_EdgeRowLen, Map_BuildRow = Map_TileOriginY; runs Map_WriteRow1 and sets bit 0 in...
$C0:82E5Map_BuildRowYDec232verifiedLayer-2 row for a falling Y scroll: WMADD = Map_BufD000, Map_BuildCol = Map_TileOriginX - 1, Map_BuildLen = Map_EdgeRowLen, Map_BuildRow = Map_TileOriginY; runs Map_WriteRow2 and sets bit 1 in...
$C0:8305Map_BuildRowYDec2Half32verifiedLayer-2 row for a falling Y scroll: WMADD = Map_BufD000, Map_BuildCol = Map_Unk1D12 - 1, Map_BuildLen = Map_EdgeRowLen, Map_BuildRow = Map_Unk1D16; runs Map_WriteRow2 and sets bit 1 in...
$C0:8325Map_BuildRowYDec332verifiedLayer-3 row for a falling Y scroll: WMADD = Map_BufD800, Map_BuildCol = Map_TileOriginX - 1, Map_BuildLen = Map_EdgeRowLen, Map_BuildRow = Map_TileOriginY; runs Map_WriteRow3 and sets bit 2 in...
$C0:8345Map_BuildColXInc132verifiedLayer-1 column for a rising X scroll: WMADD = Map_BufC800 + Map_BufColOfs, Map_BuildCol = Map_Unk1D0C, Map_BuildLen = Map_EdgeColLen, Map_BuildRow = Map_TileOriginY - 1; runs Map_WriteCol1 and...
$C0:8365Map_BuildColXInc232verifiedLayer-2 column for a rising X scroll: WMADD = Map_BufD000 + Map_BufColOfs, Map_BuildCol = Map_Unk1D0C, Map_BuildLen = Map_EdgeColLen, Map_BuildRow = Map_TileOriginY - 1; runs Map_WriteCol2 and...
$C0:8385Map_BuildColXInc2Half32verifiedLayer-2 column for a rising X scroll: WMADD = Map_BufD000 + Map_BufColOfs, Map_BuildCol = Map_Unk1D14, Map_BuildLen = Map_EdgeColLen, Map_BuildRow = Map_Unk1D16 - 1; runs Map_WriteCol2 and sets...
$C0:83A5Map_BuildColXInc332verifiedLayer-3 column for a rising X scroll: WMADD = Map_BufD800 + Map_BufColOfs, Map_BuildCol = Map_Unk1D0C, Map_BuildLen = Map_EdgeColLen, Map_BuildRow = Map_TileOriginY - 1; runs Map_WriteCol3 and...
$C0:83C5Map_BuildColXDec132verifiedLayer-1 column for a falling X scroll: WMADD = Map_BufC800 + Map_BufColOfs, Map_BuildCol = Map_TileOriginX, Map_BuildLen = Map_EdgeColLen, Map_BuildRow = Map_TileOriginY - 1; runs Map_WriteCol1...
$C0:83E5Map_BuildColXDec232verifiedLayer-2 column for a falling X scroll: WMADD = Map_BufD000 + Map_BufColOfs, Map_BuildCol = Map_TileOriginX, Map_BuildLen = Map_EdgeColLen, Map_BuildRow = Map_TileOriginY - 1; runs Map_WriteCol2...
$C0:8405Map_BuildColXDec2Half32verifiedLayer-2 column for a falling X scroll: WMADD = Map_BufD000 + Map_BufColOfs, Map_BuildCol = Map_Unk1D12, Map_BuildLen = Map_EdgeColLen, Map_BuildRow = Map_Unk1D16 - 1; runs Map_WriteCol2 and sets...
$C0:8425Map_BuildColXDec332verifiedLayer-3 column for a falling X scroll: WMADD = Map_BufD800 + Map_BufColOfs, Map_BuildCol = Map_TileOriginX, Map_BuildLen = Map_EdgeColLen, Map_BuildRow = Map_TileOriginY - 1; runs Map_WriteCol3...
$C0:8445Map_UploadRowYInc198verifiedLayer-1 row upload for Map_BuiltRowYInc bit 0: sends the row in Map_BufC800 to VRAM as three pieces, at most, of Map_EdgeSize1 +0/+2/+4 bytes (a piece of size 0 is skipped), each from where the...
$C0:84A7Map_EdgeDmaRow26verifiedThe shared end of the row uploads: VMAIN = increment by 1 word after the high byte, DMA channel 7 in word mode (DMAP_TwoRegs) to VMDATAL, source bank $7E, and starts it.
$C0:84C1Map_UploadRowYInc298verifiedLayer-2 row upload for Map_BuiltRowYInc bit 1: sends the row in Map_BufD000 to VRAM as three pieces, at most, of Map_EdgeSize2 +0/+2/+4 bytes (a piece of size 0 is skipped), each from where the...
$C0:8523Map_UploadRowYInc398verifiedLayer-3 row upload for Map_BuiltRowYInc bit 2: sends the row in Map_BufD800 to VRAM as three pieces, at most, of Map_EdgeSize3 +0/+2/+4 bytes (a piece of size 0 is skipped), each from where the...
$C0:8585Map_UploadRowYDec198verifiedLayer-1 row upload for Map_BuiltRowYDec bit 0: sends the row in Map_BufC800 to VRAM as three pieces, at most, of Map_EdgeSize1 +0/+2/+4 bytes (a piece of size 0 is skipped), each from where the...
$C0:85E7Map_UploadRowYDec298verifiedLayer-2 row upload for Map_BuiltRowYDec bit 1: sends the row in Map_BufD000 to VRAM as three pieces, at most, of Map_EdgeSize2 +0/+2/+4 bytes (a piece of size 0 is skipped), each from where the...
$C0:8649Map_UploadRowYDec398verifiedLayer-3 row upload for Map_BuiltRowYDec bit 2: sends the row in Map_BufD800 to VRAM as three pieces, at most, of Map_EdgeSize3 +0/+2/+4 bytes (a piece of size 0 is skipped), each from where the...
$C0:86ABMap_UploadColXInc150verifiedLayer-1 column upload for Map_BuiltColXInc bit 0: sends the column at Map_BufC800 + Map_BufColOfs to VRAM as two pieces, at most, of Map_EdgeSize1 +6/+8 bytes (a piece of size 0 is skipped), the...
$C0:86DDMap_EdgeDmaCol26verifiedAs Map_EdgeDmaRow with VMAIN = increment by 32 words after the high byte (VRAM_INC_32), so the words go down a tilemap column.
$C0:86F7Map_UploadColXInc250verifiedLayer-2 column upload for Map_BuiltColXInc bit 1: sends the column at Map_BufD000 + Map_BufColOfs to VRAM as two pieces, at most, of Map_EdgeSize2 +6/+8 bytes (a piece of size 0 is skipped), the...
$C0:8729Map_UploadColXInc350verifiedLayer-3 column upload for Map_BuiltColXInc bit 2: sends the column at Map_BufD800 + Map_BufColOfs to VRAM as two pieces, at most, of Map_EdgeSize3 +6/+8 bytes (a piece of size 0 is skipped), the...
$C0:875BMap_UploadColXDec150verifiedLayer-1 column upload for Map_BuiltColXDec bit 0: sends the column at Map_BufC800 + Map_BufColOfs to VRAM as two pieces, at most, of Map_EdgeSize1 +6/+8 bytes (a piece of size 0 is skipped), the...
$C0:878DMap_UploadColXDec250verifiedLayer-2 column upload for Map_BuiltColXDec bit 1: sends the column at Map_BufD000 + Map_BufColOfs to VRAM as two pieces, at most, of Map_EdgeSize2 +6/+8 bytes (a piece of size 0 is skipped), the...
$C0:87BFMap_UploadColXDec350verifiedLayer-3 column upload for Map_BuiltColXDec bit 2: sends the column at Map_BufD800 + Map_BufColOfs to VRAM as two pieces, at most, of Map_EdgeSize3 +6/+8 bytes (a piece of size 0 is skipped), the...
$C0:87F1Field_Unk87F145verifiedBuilds the right-hand edge column of each layer after a full redraw and recomputes the edge addresses: Map_BuildColXInc1; for layer 2, unless Map_LayerEdgeOff has Map_Layer2 set...
$C0:881EField_FrameUpdate60verifiedField work done every frame, before input-driven checks such as Field_ActionButton: resets Field_UnkEB (the action-button target) to none, then with DP=$1D00 runs Map_ResetUnk1D2E, clears...
$C0:885AField_Unk885A139verifiedA two-step job driven by Field_Unk38, run frame after frame by DefaultHandler's map-redraw path until it clears Field_Unk38: - Field_Unk38 = 1: zero Map_Unk1D2E/1D30/1D32/1D33.
$C0:88E5Map_ResetUnk1D2E9verifiedCopies Map_Unk1D2A to Map_Unk1D2E and Map_Unk1D2B to Map_Unk1D30 at the start of every Field_FrameUpdate (so those two hold per-frame values derived from a standing pair; meaning unknown).
$C0:88EEField_DpadDispatch20verifiedUnless Field_Unk38 is busy, runs the Field_DpadHandlerTable entry picked by Pad_Unk00F9 bits 0-3 (16 entries; the D-pad bits, if Pad_Unk00F9 is laid out like Pad_Pressed's high byte), with 8-bit X/Y.
$C0:8902Field_DpadHandlerTable34verifiedField_DpadDispatch's handler for each value of Pad_Unk00F9 bits 0-3, read as Right (bit 0), Left (1), Down (2) and Up (3) from what the handlers do; impossible pairs (Left+Right, Up+Down) and...
$C0:8924Field_DpadNone1verifiedNo direction (or an impossible combination): leaves Map_Unk1D2C/1D2D at the 0 Field_FrameUpdate set and Map_Unk1D2E/1D30 as they are.
$C0:8925Field_DpadRight31verifiedRight: Map_Unk1D2C = +$10 and Map_Unk1D2E += $10; $20 each instead while Pad_Unk00F8 bit 1 (Pad_Unk00F8Bit1) is set.
$C0:8944Field_DpadLeft31verifiedLeft: Map_Unk1D2C = -$10 and Map_Unk1D2E -= $10; $20 each instead while Pad_Unk00F8 bit 1 (Pad_Unk00F8Bit1) is set.
$C0:8963Field_DpadUp31verifiedUp: Map_Unk1D2D = -$10 and Map_Unk1D30 -= $10; $20 each instead while Pad_Unk00F8 bit 1 (Pad_Unk00F8Bit1) is set.
$C0:8982Field_DpadDown31verifiedDown: Map_Unk1D2D = +$10 and Map_Unk1D30 += $10; $20 each instead while Pad_Unk00F8 bit 1 (Pad_Unk00F8Bit1) is set.
$C0:89A1Field_DpadDownRight49verifiedDown+Right: both steps +$10, both sums up by $10; $20 each instead while Pad_Unk00F8 bit 1 (Pad_Unk00F8Bit1) is set.
$C0:89D2Field_DpadDownLeft53verifiedDown+Left: X step -$10 (sum down), Y step +$10 (sum up); $20 each instead while Pad_Unk00F8 bit 1 (Pad_Unk00F8Bit1) is set.
$C0:8A07Field_DpadUpRight53verifiedUp+Right: X step +$10 (sum up), Y step -$10 (sum down); $20 each instead while Pad_Unk00F8 bit 1 (Pad_Unk00F8Bit1) is set.
$C0:8A3CField_DpadUpLeft49verifiedUp+Left: both steps -$10, both sums down by $10; $20 each instead while Pad_Unk00F8 bit 1 (Pad_Unk00F8Bit1) is set.
$C0:8A6DMap_Unk8A6D1,800verifiedProbably the leader's collision with the map and with other objects (inferred: it zeroes the parts of the step whose moved box would have a corner on a blocking tile or touch a blocking object...
$C0:9175Map_Unk917555verifiedField_FrameUpdate's step after the D-pad: zeroes Map_Unk1D32/1D33, then copies Map_Unk1D2E (signed X step) into Map_Unk1D32 unless the leader is already at the limit in that direction...
$C0:91ACMap_Unk91AC565verifiedAdds up this frame's scroll amounts for three sets of layer scroll words and splits them into whole pixels for Map_Unk93E1, which runs next.
$C0:93E1Map_Unk93E1106verifiedApplies the pixels Map_Unk91AC split out this frame to the three sets of scroll words, then has the new tilemap edges built: - zeroes Map_EdgeRowYInc/YDec and Map_EdgeColXInc/XDec; - layer 1...
$C0:944BMap_Scroll1XInc50verifiedLayer 1, X rising: once per pixel in Map_Move1XPos, Map_Unk1D87 + 1 and the fine counter Map_Unk1D93 + 1 (0-$0F, wrapping).
$C0:947DMap_Scroll1XDec48verifiedLayer 1, X falling: as Map_Scroll1XInc with Map_Move1XNeg, stepping Map_Unk1D87 and Map_Unk1D93 down; the crossings are 0 to $0F and $08 to $07, and lower the low bytes of Map_Unk1D0C and...
$C0:94ADMap_Scroll1YInc50verifiedLayer 1, Y rising: as Map_Scroll1XInc with Map_Move1YPos, Map_Unk1D89 and the fine counter Map_Unk1D96; the crossings raise the low bytes of Map_TileOriginY and Map_Unk1D10 and store Map_Layer1 in...
$C0:94DFMap_Scroll1YDec48verifiedLayer 1, Y falling: as Map_Scroll1XDec with Map_Move1YNeg, Map_Unk1D89 and Map_Unk1D96; the crossings lower the low bytes of Map_TileOriginY and Map_Unk1D10 (in this order, unlike the X version)...
$C0:950FMap_Scroll2XInc54verifiedLayer 2, X rising: once per pixel in Map_Move2XPos, Map_Unk1D8B + 1 and the fine counter Map_Unk1D94 + 1 (0-$0F, wrapping).
$C0:9545Map_Scroll2XDec52verifiedLayer 2, X falling: as Map_Scroll2XInc with Map_Move2XNeg, stepping down (crossings 0 to $0F and $08 to $07; Map_EdgeColXDec).
$C0:9579Map_Scroll2YInc54verifiedLayer 2, Y rising: as Map_Scroll2XInc with Map_Move2YPos, Map_Unk1D8D and Map_Unk1D97 (Map_EdgeRowYInc).
$C0:95AFMap_Scroll2YDec52verifiedLayer 2, Y falling: as Map_Scroll2XDec with Map_Move2YNeg, Map_Unk1D8D and Map_Unk1D97 (Map_EdgeRowYDec).
$C0:95E3Map_Scroll2XIncHalf54verifiedLayer 2 at half rate, X rising (Map_Unk0BC9 bit 7): once per step in Map_Move2XPos the fine counter Map_Unk1D94 + 1, here 0-$1F (wrapping), and Map_Unk1D8B + 1 only when the new count is even, so...
$C0:9619Map_Scroll2XDecHalf52verifiedLayer 2 at half rate, X falling: as Map_Scroll2XIncHalf with Map_Move2XNeg, counting down (crossings 0 to $1F and $10 to $0F, which lower Map_Unk1D14 and Map_Unk1D12 and set Map_Layer2 in...
$C0:964DMap_Scroll2YIncHalf54verifiedLayer 2 at half rate, Y rising: as Map_Scroll2XIncHalf with Map_Move2YPos, Map_Unk1D97 and Map_Unk1D8D; the crossings raise Map_Unk1D16 and Map_Unk1D18 (Map_EdgeRowYInc).
$C0:9683Map_Scroll2YDecHalf52verifiedLayer 2 at half rate, Y falling: as Map_Scroll2XDecHalf with Map_Move2YNeg, Map_Unk1D97 and Map_Unk1D8D; the crossings lower Map_Unk1D16 and Map_Unk1D18 (Map_EdgeRowYDec).
$C0:96B7Map_Scroll3XInc54verifiedLayer 3, X rising: as Map_Scroll2XInc with Map_Move3XPos, Map_Unk1D8F, Map_Unk1D95 and the Map_Layer3 bit.
$C0:96EDMap_Scroll3XDec52verifiedLayer 3, X falling: as Map_Scroll2XDec with Map_Move3XNeg, Map_Unk1D8F, Map_Unk1D95 and the Map_Layer3 bit.
$C0:9721Map_Scroll3YInc62verifiedLayer 3, Y rising: as Map_Scroll2YInc with Map_Move3YPos, Map_Unk1D91, Map_Unk1D98 and the Map_Layer3 bit; also adds 4 to Map_Unk1DFB per pixel (four INCs; what reads it is not traced).
$C0:975FMap_Scroll3YDec60verifiedLayer 3, Y falling: as Map_Scroll2YDec with Map_Move3YNeg, Map_Unk1D91, Map_Unk1D98 and the Map_Layer3 bit; also subtracts 4 from Map_Unk1DFB per pixel.
$C0:979BMap_EdgeColsXInc49verifiedFor each layer bit set in Map_EdgeColXInc (1, 2, 3 in that order) runs that layer's column builder (Map_BuildColXInc1/2/3) and then adds 1 to the layer's column bias (Map_BgColBias...
$C0:97CCMap_EdgeColsXIncHalf49verifiedAs Map_EdgeColsXInc, with Map_BuildColXInc2Half as layer 2's builder (used while Map_Unk0BC9 bit 7 is set).
$C0:97FDMap_EdgeColsXDec49verifiedAs Map_EdgeColsXInc for Map_EdgeColXDec: builders Map_BuildColXDec1/ 2/3, and the column biases go down by 1 (wrapping at 64).
$C0:982EMap_EdgeColsXDecHalf49verifiedAs Map_EdgeColsXDec, with Map_BuildColXDec2Half for layer 2.
$C0:985FMap_EdgeRowsYInc49verifiedAs Map_EdgeColsXInc for rows: for each layer bit in Map_EdgeRowYInc runs Map_BuildRowYInc1/2/3 and adds 1 to the layer's row bias (Map_BgRowBias, Map_BgRowBias2, Map_BgRowBias3), wrapping at 32.
$C0:9890Map_EdgeRowsYIncHalf49verifiedAs Map_EdgeRowsYInc, with Map_BuildRowYInc2Half for layer 2.
$C0:98C1Map_EdgeRowsYDec49verifiedAs Map_EdgeRowsYInc for Map_EdgeRowYDec: builders Map_BuildRowYDec1/ 2/3, and the row biases go down by 1 (wrapping at 32).
$C0:98F2Map_EdgeRowsYDecHalf49verifiedAs Map_EdgeRowsYDec, with Map_BuildRowYDec2Half for layer 2.
$C0:9923Map_ProbeHitsObj187verifiedMap_Unk8A6D's object test of the point Map_ProbeX/Y.
$C0:99DEMap_Unk99DE65verifiedField_FrameUpdate's step after Map_Unk9175: may drop the frame's steps in Map_Unk1D2E (X) and Map_Unk1D30 (Y).
$C0:9A1FMap_StepStopDown30verifiedMap_Unk99DE's test for a downward step, A = n (step / 16).
$C0:9A3DMap_StepStopUp35verifiedMap_Unk99DE's test for an upward step, A = n.
$C0:9A60Map_StepStopRight30verifiedAs Map_StepStopDown for a rightward step: L = Map_Unk1D0C / 2 against Map_Unk1D1B, the leader's Obj_ScreenX against Screen_HalfX (C=1 when it is in the left half or at $80), Map_Unk1D93 + n...
$C0:9A7EMap_StepStopLeft35verifiedAs Map_StepStopUp for a leftward step: Map_Unk1D1A against T = Map_TileOriginX / 2, the leader's Obj_ScreenX against Screen_HalfX (C=1 when it is in the right half), Map_Unk1D93 - n.
$C0:9AA1Map_ProbeTileAttrs17verifiedReads the map bytes of one tile for the collision probes.
$C0:9AB2Map_ProbeTileAttrs_Load22verified
$C0:9AC8Map_ProbeTileAttrsAny11verifiedAs Map_ProbeTileAttrs without the treasure test: always reads the three bytes (branches into Map_ProbeTileAttrs_Load) and returns C=0.
$C0:9AD3Map_ProbeTileLevel290verifiedDecides which half of the probed tile the point Map_ProbeX/Y is in and loads that half's level.
$C0:9BF5Map_SlopeShift22verified/ Map_SlopeBase / Map_SlopeSide: Map_ProbeTileLevel's line for shapes 2-$17, indexed by Map_ProbeShape (shape - 2).
$C0:9C0BMap_SlopeBase22verified
$C0:9C21Map_SlopeSide22verified
$C0:9C37Map_ProbeLevelBlocked37verifiedWhether the half tile Map_ProbeTileLevel picked blocks the leader, against Field_Unk55 (looks like the level the leader stands on): - Map_ProbeNoLevel set: blocks only when Field_Unk55 is...
$C0:9C5CMap_StepTileEffects359verifiedMap_Unk8A6D's commit of a step it has kept.
$C0:9DC3Map_InitEntryTile102verifiedThe sibling of Map_StepTileEffects for a location load: it reads the entry tile (Loc_EntryX/Y) with Map_ProbeTileAttrsAny and Map_ProbeTileLevel at the bottom middle of the tile (Map_ProbeX low...
$C0:9E29Party_Unk9E2991verifiedThe leader's step (kind-0 object of Evt_OpB0_PartyControl): picks its animation (Party_LeaderAnim), then, when Map_Unk1D32 or Map_Unk1D33 (its X / Y step this frame) is nonzero, steps Field_UnkAB...
$C0:9E84Party_LeaderAnim77verifiedThe leader's facing and animation row from this frame's D-pad step (Map_Unk1D2C/1D2D) and tile flags (Map_Unk1D34): - flags with Map_ProbeShape1E (bit 2): with no Y step the animation stops...
$C0:9ED1Party_Member2Anim79verifiedAs Party_LeaderAnim from a log entry: the facing and row from PartyLog_PadX/Y and PartyLog_Flags at X (the D-pad step the leader had there).
$C0:9F20Party_Member3Anim79verifiedParty_Member2Anim again, byte for byte, for member 3.
$C0:9F6FParty_FollowerHoldAnim131verifiedA follower's animation while it holds its place (Party_UnkA26B / A2CE when it is close enough behind), from the log entry X it is at: with PartyLog_Flags 0, Party_AnimNoStep (stand / idle).
$C0:9FF2Party_AnimNoStep5verifiedParty_AnimTable's handler for no step (entry 0 and every code that is not a D-pad direction): X = Obj_Cur, then Party_AnimIdle.
$C0:9FF7Party_AnimTable130verifiedThe facing / animation handler for each step code (JSR (Party_AnimTable,X) in Party_LeaderAnim, Party_Member2Anim, Party_Member3Anim and Party_FollowerHoldAnim; X = code & $7E, so entries 0-63).
$C0:A079Party_AnimLeftWalk10verifiedParty_AnimTable handlers for the four straight directions: Obj_Cur's Obj_Facing = the direction, then Party_AnimWalk (walk row) or Party_AnimRun (run row).
$C0:A083Party_AnimRightWalk10verified
$C0:A08DParty_AnimUpWalk10verified
$C0:A097Party_AnimDownWalk10verified
$C0:A0A1Party_AnimLeftRun10verified
$C0:A0ABParty_AnimRightRun10verified
$C0:A0B5Party_AnimUpRun10verified
$C0:A0BFParty_AnimDownRun10verified
$C0:A0C9Party_AnimDownLeftWalk21verifiedParty_AnimTable handlers for the diagonals: Obj_Cur keeps its facing when it is one of the two directions, else faces the horizontal one; then Party_AnimWalk or Party_AnimRun.
$C0:A0DEParty_AnimDownRightWalk21verified
$C0:A0F3Party_AnimUpLeftWalk21verified
$C0:A108Party_AnimUpRightWalk21verified
$C0:A11DParty_AnimDownLeftRun21verified
$C0:A132Party_AnimDownRightRun21verified
$C0:A147Party_AnimUpLeftRun21verified
$C0:A15CParty_AnimUpRightRun21verified
$C0:A171Party_AnimWalk27verifiedField_Unk58 = 0 (the frames-standing count, probably: Field_WaitFrame counts it up and Party_AnimIdle tests it), then the object at Y gets Obj_AnimRow = ObjAnim_RowWalk, column 0 and Obj_AnimTimer...
$C0:A18CParty_AnimRun70verifiedField_Unk58 = 0, then the object at Y gets Obj_AnimRow = ObjAnim_RowRun (column and timer 0, unless already set); but when the leader has no step this frame (Map_Unk1D32 and 1D33 both 0), Y is the...
$C0:A1D2Party_AnimRowUnk1923verifiedThe object at Y gets Obj_AnimRow = ObjAnim_RowUnk19 (column and timer 0, unless already set).
$C0:A1E9Party_AnimIdle107verifiedNo step: the animation row while standing, for the object at Y.
$C0:A254Party_AnimRowUnk1B23verifiedThe object at Y gets Obj_AnimRow = ObjAnim_RowUnk1B (column and timer 0, unless already set): the row on a shape-$1E tile (Map_ProbeShape1E) with a Y step.
$C0:A26BParty_UnkA26B99verifiedMember 2's step (kind-1 object of Evt_OpB0_PartyControl), on Party_ObjSlot1's object: Obj_VelX = Obj_VelY = 0; then the lag is Field_UnkAB - Field_UnkAC (& $7F).
$C0:A2CEParty_UnkA2CE109verifiedMember 3's step (kind 2), as Party_UnkA26B on Party_ObjSlot2's object, following member 2: the lag is Field_UnkAC - Field_UnkAD, it replays from Field_UnkAD and ends in Party_Member3Anim.
$C0:A33BLocLoad_UnkA33B461verifiedThe map-properties step of a location load (name kept: LoadLocation and Field_RestoreState call it by it).
$C0:A508LocLoad_EmptyStep1verifiedA lone RTS: does nothing.
$C0:A509Ppu_ApplyMapScreens24verifiedWrites the screen settings LocLoad_UnkA33B took from MapProps to the PPU: Ppu_Unk0BD7 to TM, Ppu_Unk0BD8 to TS, Ppu_Unk0BDF to CGADSUB, and 0 to MOSAIC (mosaic off).
$C0:A521Map_UnpackTilePlanes330verifiedReads the rest of the unpacked MapProps (from MapProps.Planes, through the WRAM data port) into the map's per-tile planes.
$C0:A66BMap_LoadExitTiles167verifiedBuilds Map_TileExitIdx for the location: first every tile of all 64 rows gets Map_ExitNone (row 0 filled, then copied to rows 63 down to 1 with MVN, one Map_PlaneBytes row at a time), then...
$C0:A712Map_LoadTreasureTiles170verifiedAs Map_LoadExitTiles for treasure: Map_TreasureIdx gets Map_TreasureNone on every tile (row 0, then MVN copies), then Map_TreasureRec0 = the first word of TreasureRom_LocOfs and the location's...
$C0:A7BCMap_TreasureTaken45verifiedTests the Treasure_Flags bit of the record at Map_RecOfs: its number is (Map_RecOfs - Map_TreasureRec0) / 4, as in Field_CheckTileInFront.
$C0:A810Vblank_UnkA810125verifiedThe per-frame object pass.
$C0:AF4EField_UnkAF4E328verifiedCopies the rectangle MapCopy_SrcX..MapCopy_EndX x MapCopy_SrcY..
$C0:B096Map_CopyRegionPlane80verifiedCopies the MapCopy_* rectangle within one map plane, the one at $7E:MapCopy_Plane: one MVN per row of MapCopy_Width + 1 bytes, from MapCopy_SrcX/Y + MapCopy_Plane to MapCopy_DstX/Y +...
$C0:B0E6Field_UnkB0E665verifiedThe location-load counterpart of Vblank_UnkA810: for every object slot below Evt_ObjCount x 2 (Evt_ObjSlotEnd) whose Obj_Unk1100 has bit 7 clear and is not Obj_Unk1100Seven, Obj_ActivateIfInView...
$C0:B1B2VramQ_Flush82verifiedUploads every pending entry of the VRAM upload queue (VramQ_*, filled by Obj_BuildFrame4, Obj_BuildFrame8, Obj_BuildFrame8Pass1, Obj_BuildFrame12Pass2 and Obj_BuildFrame12Pass2Alt) with DMA...
$C0:B262Oam_HideFirst415verifiedParks OAM shadow sprites 0-3 below the screen: their Y bytes in Oam_LowTable = Oam_HiddenY.
$C0:B271Oam_BuildShadow55verified(was PostVBlank.) Rebuilds the OAM shadow ($0700 low table, $0900 high table) for the next frame; it runs before Field_WaitFrame's wait for the NMI, not after a VBlank.
$C0:B2A8Oam_BucketLoop10verified
$C0:B2B2Oam_CheckChain14verified
$C0:B2C0Oam_NextBucket8verified
$C0:B2C8Oam_HideRange116verified
$C0:B2D8Oam_EndRange16verified
$C0:B2DEOam_HideRange216verified
$C0:B2EEOam_EndRange26verified
$C0:B2F4Oam_HideRange316verified
$C0:B304Oam_EndRange35verified
$C0:B309Spr_AppendToOam1,016verified(was Sub_B309.) Appends object Obj_Cur's sprite to the OAM shadow.
$C0:B701Spr_PrepareTiles135verified(was Sub_B701.) Brings object Obj_Cur's SprTile records up to date before Spr_AppendToOam copies them.
$C0:B788Spr_Place4322verified(was Sub_B788.) Re-places a 4-tile (size 0) object: with DB=$7F, each SprTile record's X = Spr_BaseX + OfsX (bit 8 packed into Obj_OamHiA with the large-size bits) and Y = Spr_BaseY + OfsY...
$C0:B8CASpr_Load4411verified(was Sub_B8CA.) Builds a 4-tile (size 0) object's SprTile records from SprTileSrc (OfsX, OfsY, Tile/Attr), placing them at the object's position as Spr_Place4 does (same three Y clamps).
$C0:BA65Spr_Place8631verified(was Sub_BA65.) Re-places an 8-tile (size 1) object from its existing SprTile records: two groups of 4 records give X and the two high-table bytes (Obj_OamHiA, Obj_OamHiA+1), then all 8 Y...
$C0:BCDCSpr_Load8790verified(was Sub_BCDC.) Builds an 8-tile (size 1) object's SprTile records from SprTileSrc and places them: OfsX, OfsY and Tile/Attr are copied from SprTileSrc, then X, the two high-table bytes and Y are set.
$C0:BFF2Spr_Place12717verified(was Sub_BFF2.) Re-places a 12-tile (size 2) object from its existing SprTile records: three groups of 4 records give X and the high-table bytes (Obj_OamHiA, Obj_OamHiA+1, Obj_OamHiB), then the 12...
$C0:C2BFSpr_Load121,064verified(was Sub_C2BF.) Builds a 12-tile (size 2) object's SprTile records from SprTileSrc and places them: OfsX, OfsY and Tile/Attr are copied from SprTileSrc, then X, the three high-table bytes and Y...
$C0:C6E7Spr_PackHiBits483verified(was Sub_C6E7.) For the 4 SprTile records starting at X: X = Spr_BaseX + OfsX, and returns in A the OAM high-table byte for them (X bit 8 of each, large-size bits set).
$C0:C73ASpr_Place24592verified(was Sub_C73A.) Re-places a 24-tile (size 3) object: six Spr_PackHiBits4 groups fill Obj_OamHiA/B/C, then all 24 Y positions are rebuilt from Spr_BaseY + OfsY with the clamp variant chosen by...
$C0:CA76Field_ProcessAnimQueue99verifiedBuilds queued object frames while there is time left in the frame, called from Field_EndOfFrame ($C0:00D6).
$C0:E12ASpr_LoadLargeObj1,034verified(was Sub_E12A.) Loads a 24-tile ("large") object in one go.
$C0:E534Spr_CopyTileFlipped339verified(was Sub_E534.) Copies one 32-byte 4bpp tile, mirrored left-right, from Spr_GfxPtr + (tile number × 32) to the WRAM tile buffer through WMDATA: each byte goes through BitReverseTable ($C0:FD00)...
$C0:E687Spr_CopyTile178verified(was Sub_E687.) Copies one 32-byte 4bpp tile from Spr_GfxPtr + (tile number × 32) to Spr_WramPtr in bank $7F, then moves WMADD past it so a following Spr_CopyTileFlipped writes the next tile.
$C0:E739Spr_CopyTileD4131verifiedCopies a 32-byte tile from GfxRom_D4+X to $7F:Y (BRL from Spr_CopyTile when the graphics are in bank $D4).
$C0:E7BCSpr_CopyTileD2131verifiedCopies a 32-byte tile from GfxRom_D2+X to $7F:Y (BRL from Spr_CopyTile when the graphics are in bank $D2).
$C0:E83FSpr_CopyTileD3131verifiedCopies a 32-byte tile from GfxRom_D3+X to $7F:Y (BRL from Spr_CopyTile when the graphics are in bank $D3).
$C0:E8C2Spr_CopyTile7F115verifiedCopies a 32-byte tile from $7F:X to $7F:Y (BRL from Spr_CopyTile when the graphics are already in WRAM); abs,X reads since DB = $7F.
$C0:E935SprBuf_FreeAll29verified(was Sub_E935.) Marks all eight SprBuf_Owner entries free ($80), with DP pointed at $0B00 so each store is a 2-byte dp store.
$C0:E952SprBuf_Alloc140verified(was Sub_E952.) Gives object Obj_Cur one $200-byte chunk of the WRAM tile buffer: the first free entry n (0-3) of SprBuf_Owner gets Obj_Cur, and Obj_TileBuf = SprBuf_Base + n*$200.
$C0:E97ASprBuf_Alloc248verified(was Sub_E97A.) As SprBuf_Alloc1 for two adjacent free chunks (start entries 0-2).
$C0:E9AASprBuf_Alloc356verified(was Sub_E9AA.) As SprBuf_Alloc1 for three adjacent free chunks (start entries 0-1).
$C0:E9E2SprBuf_Free129verified(was Sub_E9E2.) Releases the SprBuf chunk owned by Obj_Cur: finds it among the first 4 SprBuf_Owner entries and marks it free.
$C0:E9FFSprBuf_Free232verified(was Sub_E9FF.) As SprBuf_Free1 for a 2-chunk object: the first of the 3 possible start entries owned by Obj_Cur and the one after it are freed.
$C0:EA1FSprBuf_Free335verified(was Sub_EA1F.) As SprBuf_Free1 for a 3-chunk object (2 possible start entries).
$C0:EA42SprBuf_FreeObj33verifiedReleases the SprBuf chunks owned by Obj_Cur whatever its size: finds the first of the SprBuf_UsedEntries SprBuf_Owner entries that holds Obj_Cur, frees it ($80 = Obj_None) and goes on freeing the...
$C0:EA63NmiHandler509verifiedThe field's vertical-blank interrupt, entered through the RAM trampoline InstallNMI writes (JML NmiHandler at $7E:0500).
$C0:EC60Field_WaitFrame23verifiedThe field's frame wait: counts Field_Unk58 up (16-bit INC, ANDed with Field_Unk58Mask), INCs Nmi_FramePending and spins until NmiHandler has done the frame's uploads and zeroed it.
$C0:EC77Credits_UploadLine44verifiedSends the staff-credits line Field_ServiceUnk54 built in Credits_LineBuf to VRAM: Credits_DmaSize bytes to VRAM word Credits_VramAddr with DMA channel 7 (word writes, VMAIN increment after the...
$C0:ECA3Oam_UploadShadow41verifiedCopies the OAM shadow (Oam_LowTable and Oam_HighTable, $00:0700, Oam_ShadowBytes = $220) to OAM from address 0 with DMA channel 7 (mode 0, B-bus target OAMDATA).
$C0:ECCCIrqHandler73verifiedReached through the RAM trampoline InstallIRQ writes (JML IrqHandler at IrqTrampoline).
$C0:ED15Irq_UploadTileAnim841verifiedWith DP = DP_Field (set here and left set; IrqHandler restores D): Irq_DrawChoiceCursor when Field_Unk63 is not negative; then one queued tilemap job, by Field_VramQueueFlags: - VramQueue_TileAnim...
$C0:F05EIrq_DrawChoiceCursor178verifiedDraws a 2x2-tile picture (tiles $0FC/$0FD over $0FE/$0FF, palette 2, priority: ChoiceCursor_TileTop / TileBottom) at choice row Field_Unk63 of the tilemap Field_UploadUnk1C00 sends to VRAM $1C00...
$C0:F110Irq_ChoiceCursorClearRow321verifiedPuts Field_Unk2B78's grid entries back where choice row 3's cursor goes: VRAM ChoiceCursor_VramRow0 + 3 x VramRowStep ($1CC2) gets ChoiceCursor_GridRow0 + 3 x GridRowStep and + 1 ($29C2, $29C3...
$C0:F125Irq_ChoiceCursorClearTail6verified
$C0:F12BIrq_ChoiceCursorClearRow223verifiedAs Irq_ChoiceCursorClearRow3 for choice row 2: VRAM $1C82 gets $2982, $2983 (tiles $182/$183), $1CA2 gets $2992, $2993 (through Irq_ChoiceCursorClearTail).
$C0:F142Irq_ChoiceCursorClearRow123verifiedAs Irq_ChoiceCursorClearRow3 for choice row 1: VRAM $1C42 gets $2942, $2943 (tiles $142/$143), $1C62 gets $2952, $2953 (through Irq_ChoiceCursorClearTail).
$C0:F159Irq_ChoiceCursorClearRow023verifiedAs Irq_ChoiceCursorClearRow3 for choice row 0: VRAM $1C02 gets $2902, $2903 (tiles $102/$103), $1C22 gets $2912, $2913 (through Irq_ChoiceCursorClearTail).
$C0:F170BankC0_OldBuildLeftovers400verifiedNot code and, as far as found, never read.
$C0:FD00BitReverseTable256verifiedByte N is N with its 8 bits in reverse order (bit 0 ↔ bit 7, 1 ↔ 6, ...): $01 → $80, $02 → $40, $03 → $C0.
$C0:FE00RandomTable256verifiedThe game's pseudo-random bytes, probably: a shuffle of 0-255 (every value appears exactly once; checked against the ROM).
$C0:FF20BitSet8verifiedBitmask lookup tables ($FF20–$FF2F) BitSet[N] = (1 << N), BitClear[N] = ~(1 << N), for N = 0..7.
$C0:FF28BitClear8verified
$C0:FF30ScrollWaveA64verifiedWave tables ($FF30–$FFAF) One period of a sine-like wave between -6 and +6 (32 signed 16-bit entries), stored twice.
$C0:FF70ScrollWaveB64verified
$C1:0000EngCall_BattleMain3verifiedThe bank's entry block: nine 3-byte JMPs, most of them reached from other banks by JSL (those targets return with RTL or never return; $0003, $0006 and $0015 are not, see the list), then the two...
$C1:0009BankC1_VecCFE3003verified
$C1:000CBankC1_VecCFE58A3verified
$C1:000FBankC1_VecCCE0003verified
$C1:0012BankC1_VecRefreshMenu3verified
$C1:0015BankC1_VecRts3verified
$C1:0018BankC1_VecLongDispatch3verified
$C1:001BBankC1_EnterBattleJml4verified
$C1:001FBankC1_ExitBattleJml4verified
$C1:0065BankC1_LongDispatch6verifiedA long-callable dispatcher (through BankC1_VecLongDispatch): runs BankC1_LongDispatchTable entry A, then RTL.
$C1:006BBankC1_LongDispatchTable2verifiedBankC1_LongDispatch's table: entry 0 only (see there).
$C1:0072BankC1_JmlCCE0004verifiedThe JMLs behind three of the entry vectors (see EngCall_BattleMain): $0072 to Battle_InitUploadStep ($CC:E000, BankC1_VecCCE000), BankC1_JmlCFE300 ($0076) to BattleCF_VblankUploads ($CF:E300...
$C1:0076BankC1_JmlCFE3004verified
$C1:007ABankC1_JmlCFE58A4verified
$C1:7C3DBankC1_OldBuildLeftovers963verifiedNot code and, as far as found, never read: xref finds no call or jump to $C1:7C3D or to any of the segment starts below, and the absolute $7C3D-$7FFF operands in bank $C1 code are WRAM reads (DB =...
$C1:8000BankC1_BattleStartVec3verifiedVector into BattleSys_Main.
$C1:8003BankC1_Entry80033verifiedLong vector into BankC1_RunService ($C1:CFC2), which pushes P, X, DP and DB itself (PHP, REP #$30, PHX, PHD, PHB), sets DB=$7E and DP=0, runs entry A (low byte) of BankC1_ServiceTable with...
$C1:CFC2BankC1_RunService39verifiedSaves P, X (16-bit), DP and DB, sets DB=$7E and DP=0, and runs entry A (low byte) of BankC1_ServiceTable with M=1, X=0, A = 0 (B too) and Y as it came; then pulls DB, DP, X and P back and returns...
$C1:CFE9BankC1_FindItem28verifiedService 0 (!BankC1Svc_FindItem): A = the item id Y when an !Battle_InvIds entry holds it (X = its index), else 0.
$C1:D005BankC1_AddItem81verifiedService 1 (!BankC1Svc_AddItem): one more of item Y.
$C1:D056BankC1_RemoveItem48verifiedService 2 (!BankC1Svc_RemoveItem): one fewer of item Y.
$C1:D086BankC1_HasGold28verifiedService 3 (!BankC1Svc_HasGold): A = $FF when the gold is at least Y (its low word not below Y, or its high byte not 0) or Y = 0, else 0.
$C1:D0A2BankC1_AddGold75verifiedService 4 (!BankC1Svc_AddGold): adds Y to the 24-bit gold.
$C1:D0EDBankC1_RemoveGold57verifiedService 5 (!BankC1Svc_RemoveGold): takes Y off the 24-bit gold.
$C1:D126BankC1_ServiceTable12verifiedBankC1_RunService's services, by its A (JSR (BankC1_ServiceTable,X) at $C1:CFE1).
$C1:FDC3BankC1_AddItemLong4verifiedJSL form of BankC1_AddItem (add one of item Y).
$C1:FDD3BankC1_OldBuildTail556verifiedand BankC1_DebugFlag ($C1:FFFF)
$C1:FFFFBankC1_DebugFlag1verifiedThe last byte of the bank, read as !BattleRom_DebugFlag (LDA.l) by BattleSys_Main: non-zero enables its pad-2 Select win.
$C2:0000BankC2_Entry00003verifiedthe bank's entry vectors, five JMPs reached from other banks by JML/JSL: $0000 BankC2_Entry0000 → BankC2_SceneBoot (JML from GameLoop_Main for Loc_Id $01F0-$81EF; it never returns) $0003...
$C2:0003BankC2_Entry00033verified
$C2:0006BankC2_Entry00063verified
$C2:0009BankC2_Entry00093verified
$C2:000CBankC2_Entry000C3verified
$C2:000FBankC2_SceneBoot52verifiedStarts the bank's scene mode (inferred name: GameLoop_Main sends Loc_Id $01F0-$81EF here; what those locations show is not traced).
$C2:0043BankC2_InitHwRegs205verifiedWrites the PPU registers from OBSEL to SETINI (all but INIDISP and the data ports OAMDATA, VMDATAL/H and CGDATA) and the CPU registers WRIO-VTIMEH with fixed values, through DP=$2100 and then...
$C2:0110C2Scene_InstallInterrupts31verifiedWrites JML C2Scene_NmiHandler and JML C2Scene_IrqHandler into the WRAM trampolines that the native NMI and IRQ stubs in bank $00 jump through, as InstallNMI/InstallIRQ ($C0:0B64/$0B75) do for the...
$C2:012FC2Scene_ClearDp47verifiedZeroes the direct page $00-$EF (an STZ of the first word, then an overlapping MVN), then sets the PPU shadows that C2Scene_NmiHandler copies out to their starting values: forced blank, mode 1 with...
$C2:015EC2Scene_NmiHandler487verifiedThe scene mode's NMI (reached through !NmiTrampoline, installed by C2Scene_InstallInterrupts).
$C2:0345C2Scene_IrqHandler1verifiedthe scene mode's IRQ, an RTI (installed by C2Scene_InstallInterrupts; nothing here enables IRQs).
$C2:0346C2Scene_WaitFrame7verifiedWaits until the next NMI: spins until C2Scene_FrameCounter changes.
$C2:034DC2Scene_HideAllSprites162verifiedParks all 128 sprites of the OAM shadow below the screen: Y = Oam_HiddenY in every low-table entry, and the high table zeroed (small size, X bit 8 clear).
$C2:03EFC2Scene_VramQInit22verifiedEmpties and unlocks the VRAM upload queue: clears C2Scene_VramQLock and C2Scene_VramQEnd, points C2Scene_VramQBufPtr at C2Scene_VramQBuf ($7E:F000) and zeroes all 16 C2Scene_VramQ entries (dp...
$C2:0405C2Scene_VramQFlush79verifiedRuns the queued VRAM uploads: for each 8-byte C2Scene_VramQ entry up to C2Scene_VramQEnd, one DMA on channel 0 (word writes to VMDATAL/H) from .Bank:.Src, .Size bytes, to VRAM word .Dest with...
$C2:0454C2Scene_WaitFrames26verifiedWaits X frames (C2Scene_WaitFrame each time).
$C2:046EC2Scene_WaitOneFrame3verifiedA JMP to C2Scene_WaitFrame: waits for the next NMI without sending a pending sound command.
$C2:0471C2Scene_TaskClearAll25verifiedFrees all 64 task records (zeroes each .Handler) and points C2Scene_TaskCur at the first record, so that tasks spawned before any task runs copy their parameters from record 0.
$C2:048AC2Scene_TaskSpawn10verifiedStarts a task with handler X in the first free record from record 4 on (records 0-3 are left to C2Scene_TaskSpawnLow, which enters at C2Scene_TaskSpawn_Search with its own range).
$C2:0494C2Scene_TaskSpawn_Search57verified
$C2:04CDC2Scene_TaskSpawnLow12verifiedC2Scene_TaskSpawn over records 0-3 only: the same search and setup (it branches into C2Scene_TaskSpawn_Search).
$C2:04D9C2Scene_TaskSpawnScript34verifiedSpawns a C2Scene_TaskRunScript task (C2Scene_TaskSpawn, records 4-63) and gives it a script: .ScriptPtr = X, .ScriptBank = A, .Unk0A = 0.
$C2:04FBC2Scene_TaskSpawnScriptLow34verifiedC2Scene_TaskSpawnScript in records 0-3 (C2Scene_TaskSpawnLow).
$C2:051DC2Scene_TaskRunAll54verifiedRuns every live task once (from the NMI, each frame): for each record of C2Scene_TaskRecords with a non-zero .Handler, sets C2Scene_TaskCur to it and calls the handler (C2Scene_TaskCallHandler)...
$C2:0553C2Scene_TaskCallHandler3verifiedJMP (C2Scene_TaskHandler): a JSR here calls the task's handler, which returns to C2Scene_TaskRunAll.
$C2:0556C2Scene_LayerMetatiles6verifiedPer BG layer 1-3 (index (layer - 1) * 2): where its metatile definitions are in bank $7E.
$C2:055CC2Scene_LayerMaps6verifiedPer layer: where its map (96 x 64 metatile numbers, C2Scene_MapBytes) is in bank $7E.
$C2:0562C2Scene_LayerVramMaps6verifiedPer layer: the VRAM word address of its tilemap.
$C2:0568C2Scene_Unk0568260verifiedScrolls BG layer C2Scene_ScrollLayer horizontally by C2Scene_ScrollPx pixels (signed: negative moves the view left), one pixel per pass.
$C2:066CC2Scene_Unk066C263verifiedC2Scene_Unk0568 for the vertical: scrolls the layer's C2Scene_Bg1VScroll + slot by C2Scene_ScrollPx pixels (negative: up), wrapping in 0-$3FF, with its tile Y (C2Scene_BgTileY + slot) in 0-127.
$C2:0773C2Scene_EdgeColLeft79verifiedBuilds one tile column of a layer edge into the buffer at C2Scene_VramQBufPtr: C2Scene_EdgeColTiles (30) tiles from the left half of metatile column C2Scene_EdgeCol, starting at metatile row...
$C2:07C2C2Scene_EdgeColRight79verifiedC2Scene_EdgeColLeft for the right half of the metatiles: .TopRight and .BottomRight.
$C2:0811C2Scene_EdgeColSetup50verifiedSets up a column build: C2Scene_EdgeMapOfs = C2Scene_EdgeRow * 96 (the row's offset in the map), C2Scene_EdgeMapPtr = the layer's map + C2Scene_EdgeCol, C2Scene_EdgeBuf = C2Scene_VramQBufPtr's...
$C2:0843C2Scene_EdgeRowTop76verifiedBuilds one tile row of a layer edge into the buffer at C2Scene_VramQBufPtr: C2Scene_EdgeRowTiles (34) tiles from the top half of metatile row C2Scene_EdgeRow, starting at metatile column...
$C2:088FC2Scene_EdgeRowBottom76verifiedC2Scene_EdgeRowTop for the bottom half of the metatiles: .BottomLeft and .BottomRight.
$C2:08DBC2Scene_EdgeRowSetup50verifiedSets up a row build: C2Scene_EdgeMapOfs = C2Scene_EdgeCol (the column), C2Scene_EdgeMapPtr = the layer's map + C2Scene_EdgeRow * 96, C2Scene_EdgeBuf = C2Scene_VramQBufPtr's address...
$C2:090DC2Scene_QueueEdgeCol84verifiedQueues the column built at C2Scene_VramQBufPtr for VRAM: one C2Scene_VramQ entry of C2Scene_ColBufHalf bytes from bank $7E, VMAIN stepping 32 words, to tile column (C2Scene_EdgeCol / 8) AND 63 of...
$C2:0961C2Scene_QueueEdgeRow100verifiedQueues the row built at C2Scene_VramQBufPtr for VRAM as two C2Scene_VramQ entries of C2Scene_RowBufHalf bytes from bank $7E, VMAIN stepping one word: the buffer's first half to tile row...
$C2:09C5C2Scene_DrawBgLayer167verifiedRedraws the visible part of BG layer C2Scene_DrawLayer (1 or 2; the value is taken AND C2Scene_LayerMask) from the layer's tile position C2Scene_BgTileX/Y (word (layer - 1)): - the layer's scroll...
$C2:0A6CC2Scene_BuildBgColumn66verifiedBuilds one tilemap column pair (two tile columns of 32 words) in the buffer at C2Scene_VramQBufPtr: C2Scene_DrawRows metatiles of map column C2Scene_DrawMapCol from row C2Scene_DrawMapRow down...
$C2:0AAEC2Scene_DrawMetatile46verifiedPuts one metatile into the column buffer: the map byte at C2Scene_DrawMapColPtr + C2Scene_DrawMapRowOfs selects an 8-byte C2Scene_Metatile record; its .TopLeft and .BottomLeft go to the left tile...
$C2:0ADCC2Scene_UploadBgColumn119verifiedDMAs the two tile columns built by C2Scene_BuildBgColumn to VRAM on channel 7, with VMAIN stepping 32 words (one tilemap row) per word: the left column to tile column C2Scene_DrawColX / 8 of the...
$C2:0B53C2Scene_SprAdd163verifiedTakes the first node off the free list and fills it from the running task (C2Scene_TaskCur): .X = .SprX, .Y = .SprY, .Tile = .SprTile, .Attr = .SprAttr, .Frame = C2Scene_SprFramePtr.
$C2:0BF6C2Scene_SprInitLinks87verifiedBuilds C2Scene_SprLinkInit, the .Prev/.Next pair of each node on a free list in address order: node 0's .Prev is C2Scene_SprFreeHead, node n's .Prev is node n-1 and its .Next node n+1, and node...
$C2:0C4DC2Scene_SprResetLists157verifiedEmpties the sprite list for the new frame (from the NMI): the active head points at itself, the free head at node 0 (.Next) and node 63 (.Prev), and every node gets its .Prev/.Next back from...
$C2:0CEAC2Scene_SprDrawList30verifiedDraws the active sprite list (from the NMI, after the tasks): calls C2Scene_SprDrawNode for each node from C2Scene_SprActiveHead's .Next until the walk comes back to the head.
$C2:0D08C2Scene_SprDrawNode261verifiedWrites the OAM entries of one sprite-list node X.
$C2:0E0DC2Scene_OamHiBitsTable16verifiedThe OAM high-table bits of one sprite, indexed by (slot AND 3) * 4 + size * 2 + X bit 8: the 2-bit value size:Xbit8 shifted to the slot's place in its byte (C2Scene_SprDrawNode).
$C2:0E1DC2Anim_Run45verifiedRuns the running task's animation script (.AnimPtr, .AnimBank) from where it stopped: calls the handler of each op from C2Anim_OpTable with C2Anim_Ptr on the opcode.
$C2:0E4AC2Anim_OpTable16verifiedThe handler of each animation opcode 0-7 (C2Anim_Run: JSR (T,X) with X = the opcode * 2).
$C2:0E5AC2Anim_OpClearByte17verifiedAnimation op 0, 2 bytes: zeroes the task's byte at offset arg 1 (any of the 64 record bytes, through C2Scene_TaskCur).
$C2:0E6BC2Anim_OpIncByte19verifiedAnimation op 1, 2 bytes: adds 1 to the task's byte at offset arg 1.
$C2:0E7EC2Anim_OpDecByte19verifiedAnimation op 2, 2 bytes: subtracts 1 from the task's byte at offset arg 1.
$C2:0E91C2Anim_OpJumpBack18verifiedAnimation op 3, 2 bytes: moves the script by the signed byte arg 1, counted from the opcode: A = the offset sign-extended.
$C2:0EA3C2Anim_OpShowFrame57verifiedAnimation op 4, 4 bytes: shows the sprite frame at arg 1-2 (an address in the script's bank) for arg 3 frames.
$C2:0EDCC2Anim_OpWait36verifiedAnimation op 5, 2 bytes: waits arg 1 calls without drawing, counting in .AnimTimer as C2Anim_OpShowFrame does (0 loads it, then -1 per call; at 0 it advances 2 at once).
$C2:0F00C2Anim_OpQueueVram53verifiedAnimation op 6, 8 bytes: adds a VRAM DMA to the queue the NMI flushes (C2Scene_VramQ at C2Scene_VramQEnd): .Bank = arg 1, .Src = arg 2-3, .Dest = arg 4-5, .Size = arg 6-7, .Vmain =...
$C2:0F35C2Anim_OpEnd3verifiedAnimation op 7: stops (A = 0, Z=1) with C=1 and does not advance, so every later call stops here again.
$C2:0F38C2Scene_TaskMove43verifiedMoves the running task by its velocity, in 16.16 fixed point: .XFrac/.SprX += .XVelFrac/.XVel and .YFrac/.SprY += .YVelFrac/.YVel (inferred from the carry chain: the fraction words are added first...
$C2:0F63C2Scene_TaskRunScript46verifiedTask handler of the script tasks (C2Scene_TaskSpawnScript and C2Scene_TaskSpawnScriptLow install it); also called by other handlers (the party leader's and members' script states).
$C2:0F91C2Script_OpTable166verifiedThe handler of each script opcode $00-$52 (C2Scene_TaskRunScript: JSR (T,X) with X = the opcode * 2); a larger opcode is not checked for and would jump through the code after the table.
$C2:1037C2Script_ResetTask90verifiedOp $00, 1 byte: zeroes the task's record from +$05 on, except the script fields +$07-$0A: .ScriptReturn, the animation, the sprite fields, position and velocity and all words up to +$3F (16-bit...
$C2:1091C2Script_SetSprPalette23verifiedOp $01, 2 bytes: .SprAttr = .SprAttr AND $F1 OR arg 1: replaces bits 1-3, which C2Scene_SprDrawNode puts in the OAM palette bits.
$C2:10A8C2Script_SetSprPriority23verifiedOp $02, 2 bytes: .SprAttr = .SprAttr AND $4F OR arg 1: replaces bits 4 and 5 (the OAM priority bits) and bit 7 (C2Scene_SprAttrScroll).
$C2:10BFC2Script_SpawnUnk1CF514verifiedOp $03, 10 bytes: starts a C2Scene_TaskUnk1CF5 task (C2Scene_TaskSpawn, records 4-63), which copies this task's record, and advances 10.
$C2:10CDC2Script_SpawnUnk1DD451verifiedOp $04, 6 bytes: puts its arguments in this task's record, .Unk35 = arg 1-2, .Unk37 = arg 3, .OpState = arg 4 (high byte 0), .OpTarget = arg 5, and starts a C2Scene_TaskUnk1DD4 task, which copies...
$C2:1100C2Script_GoToLocation105verifiedOp $05, 5 bytes: sets up a location change in the field's location block (DP_Field) and selects scene mode C2Scene_ModeUnk2: - Loc_ReturnId = the current Loc_Id; Loc_ReturnX = BG2's tile X...
$C2:1169C2Script_Halt2verifiedOp $06: stops (A = 0, Z=1) without advancing, every frame: the script ends there but its task stays (C as C2Scene_TaskRunScript left it, 0 from its ASL).
$C2:116BC2Script_SetMapCell71verifiedOp $07, 5 bytes: writes metatile number arg 4 into BG layer arg 1's map (C2Scene_LayerMaps, bank $7E) at column arg 2, row arg 3 (row * 96 + column, with the hardware multiplier).
$C2:11B2C2Script_SetMemberWord68verifiedOp $08, 4 bytes: stores the word arg 1-2 for character arg 3: at C2Scene_Unk1B41 for character 7, else at the C2Scene_MemberWords word of the party position (Party_Members) that holds that...
$C2:11F6C2Script_SpawnScript22verifiedOp $09, 4 bytes: starts another script task (C2Scene_TaskSpawnScript, records 4-63) on the script at arg 1-2 in bank arg 3.
$C2:120CC2Script_ClearTaskByte17verifiedOp $0A, 2 bytes: task byte arg 1 = 0.
$C2:121DC2Script_IncTaskByte19verifiedOp $0B, 2 bytes: task byte arg 1 + 1.
$C2:1230C2Script_DecTaskByte19verifiedOp $0C, 2 bytes: task byte arg 1 - 1.
$C2:1243C2Script_SetTaskByte20verifiedOp $0D, 3 bytes: task byte arg 1 = arg 2.
$C2:1257C2Script_OrTaskByte22verifiedOp $0E, 3 bytes: task byte arg 1 OR= arg 2 (sets those bits).
$C2:126DC2Script_ClearTaskBits24verifiedOp $0F, 3 bytes: task byte arg 1 AND= NOT arg 2 (clears those bits).
$C2:1285C2Script_ClearRamByte17verifiedOp $10, 3 bytes: RAM byte at arg 1-2 = 0.
$C2:1296C2Script_IncRamByte17verifiedOp $11, 3 bytes: RAM byte at arg 1-2 + 1.
$C2:12A7C2Script_DecRamByte17verifiedOp $12, 3 bytes: RAM byte at arg 1-2 - 1.
$C2:12B8C2Script_SetRamByte22verifiedOp $13, 4 bytes: RAM byte at arg 1-2 = arg 3.
$C2:12CEC2Script_OrRamByte25verifiedOp $14, 4 bytes: RAM byte at arg 1-2 OR= arg 3.
$C2:12E7C2Script_ClearRamBits27verifiedOp $15, 4 bytes: RAM byte at arg 1-2 AND= NOT arg 3.
$C2:1302C2Script_TaskByteToRam26verifiedOp $16, 4 bytes: RAM byte at arg 2-3 = task byte arg 1.
$C2:131CC2Script_RamByteToTask26verifiedOp $17, 4 bytes: task byte arg 1 = RAM byte at arg 2-3.
$C2:1336C2Script_CopyTaskByte26verifiedOp $18, 3 bytes: task byte arg 1 = task byte arg 2.
$C2:1350C2Script_CopyRamByte26verifiedOp $19, 5 bytes: RAM byte at arg 1-2 = RAM byte at arg 3-4.
$C2:136AC2Script_Jump11verifiedOp $1A, 3 bytes: C2Script_Ptr = arg 1-2 (an address in the script's bank), then advance 1, so the script goes on at arg 1-2 + 1.
$C2:1375C2Script_LoopTaskByte35verifiedOp $1B, 3 bytes: task byte arg 1 - 1; while it is not 0, branch by arg 2; at 0, advance 3 (a counted loop).
$C2:1398C2Script_IfTaskByteZero32verifiedOp $1C, 3 bytes: if task byte arg 1 is 0, branch by arg 2; else advance 3.
$C2:13B8C2Script_IfTaskByteNonZero32verifiedOp $1D, 3 bytes: if task byte arg 1 is not 0, branch by arg 2; else advance 3.
$C2:13D8C2Script_IfTaskByteNe36verifiedOp $1E, 4 bytes: if task byte arg 1 is not arg 2, branch by arg 3; else advance 4.
$C2:13FCC2Script_IfTaskByteEq36verifiedOp $1F, 4 bytes: if task byte arg 1 is arg 2, branch by arg 3; else advance 4.
$C2:1420C2Script_IfTaskBitsSet36verifiedOp $20, 4 bytes: if task byte arg 1 AND arg 2 is not 0, branch by arg 3; else advance 4.
$C2:1444C2Script_IfTaskBitsClear37verifiedOp $21, 4 bytes: if task byte arg 1 AND arg 2 is 0, branch by arg 3; else advance 4.
$C2:1469C2Script_IfRamByteZero34verifiedOp $22, 4 bytes: if the RAM byte at arg 1-2 is 0, branch by arg 3; else advance 4.
$C2:148BC2Script_IfRamByteNonZero34verifiedOp $23, 4 bytes: if the RAM byte at arg 1-2 is not 0, branch by arg 3; else advance 4.
$C2:14ADC2Script_IfRamByteNe37verifiedOp $24, 5 bytes: if the RAM byte at arg 1-2 is not arg 3, branch by arg 4; else advance 5.
$C2:14D2C2Script_IfRamByteEq37verifiedOp $25, 5 bytes: if the RAM byte at arg 1-2 is arg 3, branch by arg 4; else advance 5.
$C2:14F7C2Script_IfRamBitsSet37verifiedOp $26, 5 bytes: if the RAM byte at arg 1-2 AND arg 3 is not 0, branch by arg 4; else advance 5.
$C2:151CC2Script_IfRamBitsClear37verifiedOp $27, 5 bytes: if the RAM byte at arg 1-2 AND arg 3 is 0, branch by arg 4; else advance 5.
$C2:1541C2Script_IfRamByteLess37verifiedOp $4C, 5 bytes: if the RAM byte at arg 1-2 is below arg 3 (unsigned), branch by arg 4; else advance 5.
$C2:1566C2Script_IfRamByteGe37verifiedOp $4D, 5 bytes: if the RAM byte at arg 1-2 is arg 3 or more (unsigned), branch by arg 4; else advance 5.
$C2:158BC2Script_SpawnUnk20A214verifiedOp $28, 2 bytes: starts a C2Scene_TaskUnk20A2 task (C2Scene_TaskSpawn), which copies this record (and so this op's .ScriptPtr: probably it reads arg 1 from there; not traced).
$C2:1599C2Script_SpawnUnk210514verifiedOp $29, 2 bytes: as C2Script_SpawnUnk20A2 with C2Scene_TaskUnk2105.
$C2:15A7C2Script_SpawnUnk21F814verifiedOp $2A, 3 bytes: as C2Script_SpawnUnk20A2 with C2Scene_TaskUnk21F8.
$C2:15B5C2Script_SpawnUnk219414verifiedOp $2B, 3 bytes: as C2Script_SpawnUnk20A2 with C2Scene_TaskUnk2194.
$C2:15C3C2Script_SetPosition28verifiedOp $2C, 5 bytes: .SprX = arg 1-2 and .SprY = arg 3-4, both fractions 0.
$C2:15DFC2Script_Skip14verifiedOp $2D, 2 bytes: does nothing and advances 2 (the byte after the opcode is skipped).
$C2:15E3C2Script_SetXVelocity22verifiedOp $2E, 5 bytes: .XVelFrac = arg 1-2, .XVel = arg 3-4.
$C2:15F9C2Script_SetYVelocity22verifiedOp $2F, 5 bytes: .YVelFrac = arg 1-2, .YVel = arg 3-4.
$C2:160FC2Script_SetAnim14verifiedOp $30, 2 bytes: starts animation script arg 1 (C2Scene_SetAnim).
$C2:161DC2Script_MoveFrames46verifiedOp $31, 2 bytes: for arg 1 frames, each frame moves the task by its velocity (C2Scene_TaskMove), wraps the position into the map (C2Scene_WrapTaskPos), runs its animation (C2Anim_Run) and stops...
$C2:164BC2Script_ScrollFrames175verifiedOp $32, 2 bytes: scrolls BG layers 1 and 2 (and BG3) by the task's velocity for arg 1 frames, counted in .ScriptWait as C2Script_MoveFrames does.
$C2:16FAC2Script_ScrollLayerFrames95verifiedOp $51, 3 bytes: C2Script_ScrollFrames for one layer, arg 1 (passed to C2Scene_Unk0568/066C as is), for arg 2 frames, and without BG3.
$C2:1759C2Script_PanKeepFraction43verifiedDrops the whole pixels from the task's position, keeping the fraction as a value in -1..+1: .SprX = -1 if it was negative with a non-zero .XFrac, else 0; the same for .SprY with .YFrac.
$C2:1784C2Script_PanTakeX39verifiedTells whether the X accumulator (.XFrac/.SprX) holds at least one whole pixel either way: C=1 with C2Tmp_01 = the low byte of .SprX (signed pixels), else C=0.
$C2:17ABC2Script_PanTakeY39verifiedC2Script_PanTakeX for .YFrac/.SprY.
$C2:17D2C2Script_QueueVram53verifiedOp $33, 8 bytes: C2Anim_OpQueueVram's code on the script pointer: adds a VRAM DMA to the queue the NMI flushes (C2Scene_VramQ at C2Scene_VramQEnd): .Bank = arg 1, .Src = arg 2-3, .Dest = arg 4-5...
$C2:1807C2Script_CallNear21verifiedOp $34, 3 bytes: calls the routine at arg 1-2 in bank $C2 (JSR to .call, a JMP (C2Script_CallVec)) with M=1, then advances 3.
$C2:181CC2Script_CallLong29verifiedOp $4E, 4 bytes: calls the routine at the long address arg 1-3 (JSL to .call, a JML [C2Script_CallVec]) with M=1; it returns with RTL.
$C2:1839C2Script_SpawnTask15verifiedOp $35, 3 bytes: starts a task with handler arg 1-2 (an address in bank $C2) in records 4-63 (C2Scene_TaskSpawn), which copies this task's record from +$05 on.
$C2:1848C2Script_Call23verifiedOp $36, 3 bytes: a subroutine call in the script: .ScriptReturn = the address of the next op, and the script continues at arg 1-2 (same bank): C2Script_Ptr = arg - 1 and A = 1, which...
$C2:185FC2Script_Return12verifiedOp $37, 1 byte: returns from C2Script_Call: the script continues at .ScriptReturn (C2Script_Ptr = it - 1, A = 1).
$C2:186BC2Script_Wait35verifiedOp $38, 2 bytes: waits arg 1 frames, counted in .ScriptWait as C2Script_MoveFrames counts: 0 loads it with arg 1 and stops, then -1 per frame; at 0 it advances 2.
$C2:188EC2Script_WaitAnimating38verifiedOp $39, 2 bytes: C2Script_Wait, running the task's animation (C2Anim_Run) on each frame it waits.
$C2:18B4C2Script_StopIfOlder19verifiedOp $3A, 3 bytes: compares arg 1-2 with the task's age (.Frames, +1 per frame it has run).
$C2:18C7C2Script_SoundCmd189verifiedOp $3B, 3 bytes: C2Script_PlaySfx with sound command C2Scene_SoundCmd18 instead of Audio_CmdPlaySfx: it sets the command byte and branches to C2Script_PlaySfx_SetArgs.
$C2:18D0C2Script_PlaySfx7verifiedOp $3C, 3 bytes: queues sound command Audio_CmdPlaySfx with arg 1 and arg 2 as its first two argument bytes (the third is left as it was) at rank 0 (C2Scene_QueueSoundCmd: it replaces any queued...
$C2:18D7C2Script_PlaySfx_SetArgs26verified
$C2:18F1C2Script_SoundCmd10IfClear8verifiedOp $3D, 2 bytes: C2Script_SoundCmd10 unless C2Scene_Unk7F01ED is non-zero: then it branches to C2Script_SoundCmd10_Done, which only advances 2.
$C2:18F9C2Script_SoundCmd1032verifiedOp $4A, 2 bytes: queues sound command C2Scene_SoundCmd10 with arg 1 and C2Scene_SoundArgUnused ($FF) as its other two argument bytes, at rank 0 (C2Scene_QueueSoundCmd), and also stores arg 1 in...
$C2:1919C2Script_SoundCmd10_Done6verified
$C2:191FC2Script_SoundCmd40verifiedOp $4B, 5 bytes: queues the sound command arg 1 with argument bytes arg 2-4, at rank 0 (C2Scene_QueueSoundCmd).
$C2:1947C2Script_DrawLayer18verifiedOp $3E, 2 bytes: redraws BG layer arg 1 from its map (C2Scene_DrawBgLayer), e.g.
$C2:1959C2Script_MoveToX105verifiedOp $3F, 5 bytes: moves the task along X until .SprX = arg 1-2, at the speed of its X velocity.
$C2:19C2C2Script_MoveToY105verifiedOp $40, 5 bytes: C2Script_MoveToX along Y: target .SprY = arg 1-2, C2Scene_NegateYVel, animation arg 3 when going up (target above .SprY) and arg 4 when going down; .YFrac/.SprY += the Y velocity.
$C2:1A2BC2Script_Halt22verifiedOp $41, 1 byte: the same code as C2Script_Halt (op $06): stops (A = 0, Z=1) without advancing, every frame; the task stays.
$C2:1A2DC2Script_SpawnScriptLow22verifiedOp $43, 4 bytes: C2Script_SpawnScript in records 0-3: starts a script task (C2Scene_TaskSpawnScriptLow) on the script at arg 1-2 in bank arg 3.
$C2:1A43C2Script_SpawnTaskLow15verifiedOp $42, 3 bytes: C2Script_SpawnTask in records 0-3 (C2Scene_TaskSpawnLow): handler arg 1-2.
$C2:1A52C2Script_SetListBit730verifiedOp $44, 3 bytes: sets C2Scene_ListEntryBit7 in the first byte of entry arg 2 of list arg 1 (0 = C2Scene_ListA, 1 = ListB, 2 = ListC: the helper in C2Script_ListEntryTable leaves the entry's...
$C2:1A70C2Script_ListEntryTable6verifiedThe helper per list number (C2Script_SetListBit7 and C2Script_ClearListBit7: JSR (T,X) with X = the list * 2).
$C2:1A76C2Script_ListAEntry20verifiedC2Tmp_10/$11 = the 16-bit address of entry arg 2 of C2Scene_ListA (entry * 7, as entry * 8 - entry, + the list).
$C2:1A8AC2Script_ListBEntry17verifiedC2Tmp_10/$11 = the address of entry arg 2 of C2Scene_ListB (entry * 3 + the list).
$C2:1A9BC2Script_ListCEntry17verifiedC2Tmp_10/$11 = the address of entry arg 2 of C2Scene_ListC (entry * 3 + the list).
$C2:1AACC2Script_ClearListBit730verifiedOp $45, 3 bytes: C2Script_SetListBit7, clearing the bit instead.
$C2:1ACAC2Script_AddTaskByte23verifiedOp $46, 3 bytes: task byte arg 1 += arg 2 (8-bit, wrapping).
$C2:1AE1C2Script_SubTaskByte26verifiedOp $47, 3 bytes: task byte arg 1 -= arg 2 (8-bit, wrapping).
$C2:1AFBC2Script_AddRamByte26verifiedOp $48, 4 bytes: RAM byte at arg 1-2 (through DB) += arg 3.
$C2:1B15C2Script_SubRamByte26verifiedOp $49, 4 bytes: RAM byte at arg 1-2 (through DB) -= arg 3.
$C2:1B2FC2Script_CopyMapBlock177verifiedOp $4F, 9 bytes: copies a block of metatile numbers from one BG layer map to another place (C2Scene_BgMaps, bank $7E; 96 bytes per row): source layer arg 1 at column arg 2, row arg 3; destination...
$C2:1BE0C2Script_DrawMetatile161verifiedOp $50, 5 bytes: draws metatile arg 4 at cell (column arg 2, row arg 3) of BG layer arg 1's tilemap in VRAM, by queuing two VRAM DMAs of C2Scene_MetatileRowBytes each (C2Scene_VramQ): the...
$C2:1C81C2Script_End3verifiedOp $52, 1 byte: stops (A = 0, Z=1) with C=1, which ends the task when C2Scene_TaskRunScript is its handler (C2Scene_TaskRunAll frees it).
$C2:1C84C2Scene_NegateXVel26verifiedNegates the task's X velocity as one 32-bit value (.XVelFrac/.XVel: invert both words and add 1 with the carry), turning it around.
$C2:1C9EC2Scene_NegateYVel26verifiedC2Scene_NegateXVel for .YVelFrac/.YVel.
$C2:1CB8C2Scene_WrapTaskPos34verifiedWraps the task's position into the scene map: .SprX gets C2Scene_MapWidthPx (1536, the 96 metatile columns) added when it is negative or taken off when it is that or more (once, so it assumes the...
$C2:1CDAC2Scene_SetAnim27verifiedStarts animation script A (low byte) on the running task: .AnimPtr = entry A of C2SceneRom_AnimTable, .AnimBank = C2SceneRom_AnimBank (the table's own bank), .AnimTimer = 0.
$C2:1CF5C2Scene_TaskUnk1CF513verifiedTask handler: runs the state in .State (C2Scene_UploadTask; the record's .Unk02, 0 from C2Scene_TaskSpawn) through C2Scene_UploadTileStates: 0 C2Scene_UploadTilesStart, 1 C2Scene_UploadTilesStep.
$C2:1D02C2Scene_UploadTileStates4verifiedThe state handlers of C2Scene_TaskUnk1CF5 (JMP (T,X) with X = .State * 2).
$C2:1D06C2Scene_UploadTilesStart70verifiedState 0: sets .State to 1 (a 16-bit INC, so +$03 would take a carry; it never does), then copies op $03's arguments from the spawning op (.OpPtr): .Src = arg 1-2, .SrcBank = arg 3, .Dest = arg 4-5...
$C2:1D4CC2Scene_UploadTilesStep105verifiedState 1, each frame: queues the next part, min(.PerFrame, .Left) units of 32 bytes, as one VRAM DMA (C2Scene_VramQ: .Bank = .SrcBank, .Src = .Src, .Dest = .Dest, .Size = units * 32...
$C2:1DB5C2Scene_ClearPalette31verifiedZeroes C2Scene_PaletteBuf (512 B, $0920-$0B1F: every color black) and the 16 bytes after it, C2Scene_Unk0B20 ($0B20-$0B2F), a word at a time.
$C2:1DD4C2Scene_TaskUnk1DD4100verifiedTask handler (palette load).
$C2:1E38C2Scene_TaskPalFade9verifiedTask handler (palette fade, started by C2Scene_TaskUnk1DD4): runs .State through C2Scene_PalFadeStates: 0 C2Scene_PalFadeStart, 1 C2Scene_PalFadeStep, 2 C2Scene_PalFadeEnd.
$C2:1E41C2Scene_PalFadeStates6verifiedThe state handlers of C2Scene_TaskPalFade (X = .State * 2).
$C2:1E47C2Scene_PalFadeStart63verifiedState 0: .State = 1; counts itself in C2Scene_Unk0B20 for .ArgPalette; copies the arguments to .Palette, .Rate, .Src and .SrcBank (the step arrays will overwrite them); .Timer = 0, .Steps = 0...
$C2:1E86C2Scene_PalFadeStep47verifiedState 1, each frame: if C2Scene_Unk0B20 for the palette is not 1 (another palette task has started on it) it goes to C2Scene_PalFadeEnd (BNE into it) and the fade stops where it is.
$C2:1EB5C2Scene_PalFadeEnd11verifiedState 2 (and C2Scene_PalFadeStep's give-up): takes the task out of C2Scene_Unk0B20 for its palette and ends it (C=1).
$C2:1EC0C2Scene_PalFadePlan81verifiedPlans a fade: for each of the 16 colors, from the palette's current color (.Colors, through DB) to the new one (.Src/.SrcBank, long), sets the color's red, green and blue count bytes in .RedStep...
$C2:1F11C2Scene_PalFadePlanColor116verifiedFor one color: per channel (red: bits 0-4, green: bits 5-9, blue: bits 10-14), d = new - current (-31..31) gives the count byte: 0 when equal, d when rising, or C2Scene_FadeDownFlag OR (-d +...
$C2:1F85C2Scene_PalFadeApply71verifiedTakes one fade step on all 16 colors of the palette at .Colors: each color is read, stepped (C2Scene_PalFadeStepColor) and written back (through DB).
$C2:1FCCC2Scene_PalFadeStepColor150verifiedOne fade step of one color (C2Scene_FadeCur): for each channel's count byte c (red, green, blue): 0 leaves the channel; a rising count moves the channel up one when C2Scene_PalFadeStepTable[c] is...
$C2:2062C2Scene_PalFadeStepTable64verifiedIndexed by a fade count 0-63 (C2Scene_PalFadeStepColor): 1 = move the channel this step (counts 32-63), 0 = not yet (0-31).
$C2:20A2C2Scene_TaskUnk20A29verifiedTask handler (fade out, op $28): runs .State through C2Scene_FadeOutStates: 0 C2Scene_FadeOutStart, 1 C2Scene_FadeOutStep.
$C2:20ABC2Scene_FadeOutStates4verifiedThe state handlers of C2Scene_TaskUnk20A2 (X = .State * 2).
$C2:20AFC2Scene_FadeOutStart48verifiedState 0: if a fade-out already runs (C2Scene_FadeOutBusy) the task just ends.
$C2:20DFC2Scene_FadeOutStep38verifiedState 1, each frame: once .Timer reaches .Rate it zeroes .Timer's low byte and takes C2Scene_Brightness down one.
$C2:2105C2Scene_TaskUnk21059verifiedTask handler (fade in, op $29): runs .State through C2Scene_FadeInStates: 0 C2Scene_FadeInStart, 1 C2Scene_FadeInUnblank, 2 C2Scene_FadeInStep, 3 C2Scene_FadeInEnd.
$C2:210EC2Scene_FadeInStates8verifiedThe state handlers of C2Scene_TaskUnk2105 (X = .State * 2).
$C2:2116C2Scene_FadeInStart60verifiedState 0: if any fade runs (C2Scene_Unk1BF6 non-zero) it ends through C2Scene_FadeInEnd.
$C2:2152C2Scene_FadeInUnblank29verifiedState 1: ends (C2Scene_FadeInEnd) if a fade-out has started.
$C2:216FC2Scene_FadeInStep30verifiedState 2: ends (C2Scene_FadeInEnd) if a fade-out has started.
$C2:218DC2Scene_FadeInEnd7verifiedState 3, and where the other fade-in states end: clears C2Scene_FadeInBusy and ends the task (C=1).
$C2:2194C2Scene_TaskUnk219415verifiedTask handler (mosaic shrink, op $2B): runs .State through C2Scene_MosaicOutStates: 0 C2Scene_MosaicOutStart, 1 C2Scene_MosaicOutStep.
$C2:21A3C2Scene_MosaicOutStates4verifiedThe state handlers of C2Scene_TaskUnk2194 (X = .State * 2).
$C2:21A7C2Scene_MosaicOutStart47verifiedState 0: .State = 1; ORs op $2B's arg 1 into C2Scene_MosaicShadow (the BGs to apply it to, bits 0-3); arg 2 is the frames per step: 0 sets the size to 0 at once (keeping the BG bits) and ends.
$C2:21D6C2Scene_MosaicOutStep34verifiedState 1: once .Timer reaches .Rate, .Timer's low byte = 0 and the mosaic size (C2Scene_MosaicShadow bits 4-7) goes down one; when it is already 0 the task ends (C=1) instead.
$C2:21F8C2Scene_TaskUnk21F813verifiedTask handler (mosaic grow, op $2A): runs .State through C2Scene_MosaicInStates: 0 C2Scene_MosaicInStart, 1 C2Scene_MosaicInStep.
$C2:2205C2Scene_MosaicInStates4verifiedThe state handlers of C2Scene_TaskUnk21F8 (X = .State * 2).
$C2:2209C2Scene_MosaicInStart47verifiedState 0: as C2Scene_MosaicOutStart (op $2A's arg 1 ORed into C2Scene_MosaicShadow, arg 2 the frames per step), but rate 0 sets the size to the largest (C2Scene_MosaicSizeMask: 16x16 blocks) at once.
$C2:2238C2Scene_MosaicInStep34verifiedState 1: once .Timer reaches .Rate, .Timer's low byte = 0 and the mosaic size goes up one; when that makes it the largest ($F0) the task ends (C=1).
$C2:225ATrig_Cos10244verifiedSigned sine or cosine of a 16-bit angle with 1024 steps per turn, read from !Rom_SineTable: A = sin(angle) × 255 (−255..+255; the table holds |sin| as one byte per step, negated for the second...
$C2:225ETrig_Sin102421verified
$C2:2273C2Scene_Unk22734verifiedThe cosine of direction A (adds a quarter turn and falls into the sub-entry C2Scene_Unk2277, $C2:2277, the sine).
$C2:2277C2Scene_Unk227738verified
$C2:229DC2Scene_Unk229D144verifiedThe direction (0-255) from the point (C2Tmp_08, C2Tmp_0A) to the point (C2Tmp_0C, C2Tmp_0E) on the scene's wrapping map: each difference that is half the map or more (Y 512 of 1024, X 768 of 1536...
$C2:232DC2Scene_ClearUnk1B309verifiedZeroes the two bytes right after the task records, C2Scene_Unk1B30 and C2Scene_Unk1B31 (their use is not traced).
$C2:2336C2Scene_Random15verifiedReturns the next byte of RandomTable ($C0:FE00): the one at index C2Scene_Unk1B30, which then goes up by one (wrapping at 256).
$C2:2345C2Scene_BoxesOverlap99verifiedTests whether two boxes overlap.
$C2:23A8C2Scene_Main39verifiedThe scene mode's main program, entered once from BankC2_SceneBoot.
$C2:23CFC2Scene_MainLoop12verified
$C2:23DBC2Scene_ModeTable20verifiedC2Scene_MainLoop's handler for each C2Scene_Mode value 0-9.
$C2:23EFC2Scene_ModeIdle19verifiedC2Scene_Mode 0, 1 and 7: if a sound command is pending (C2Scene_SoundCmdState), sends it with Audio_DriverCommand as C2Scene_WaitFrames does; then back to C2Scene_MainLoop.
$C2:2402C2Scene_Mode3211verifiedMode 3: acts on the C2Scene_ListA entry at byte offset C2Scene_Unk1B32 (probably an exit the player has reached): - its .Loc is C2Scene_ListANoLoc: starts the script whose address is word .EntryX...
$C2:24D5C2Scene_Mode252verifiedMode 2 (set by script op $05) and the end of C2Scene_Mode3: leaves the scene.
$C2:2509C2Scene_TurnAround4verifiedFacing 0-3 -> the opposite facing (the facing EOR 1).
$C2:250DC2Scene_Mode417verifiedMode 4: interrupts, NMI, DMA and HDMA off, the flag tail copied back (C2Scene_RestoreFlagTail), and again, for good: it never leaves (probably waits for a reset; C2Scene_TrigListC sets mode 4).
$C2:251EC2Scene_Mode5111verifiedModes 5 (C2Scene_ModeMenu) and 9: run the menu over the scene.
$C2:258DC2Scene_Mode6144verifiedMode 6: runs C2Scene_MapView (it sets BG mode 7 and runs its own tasks until the mode changes from 6: probably a mode-7 view) between a mosaic fade out and in.
$C2:261DC2Scene_Mode8139verifiedMode 8: runs C2Scene_Dial (it clears VRAM and the tasks itself) over a saved scene.
$C2:26A8C2Scene_ClearVram44verifiedZeroes all of VRAM with one DMA on channel 7: word writes to VMDATAL/H from the fixed source C2Scene_ZeroWord, VRAM address 0, a byte count of 0 (= 65536 bytes).
$C2:26D4C2Scene_ZeroWord2verifiedThe fixed DMA source of C2Scene_ClearVram.
$C2:26D6C2Scene_SaveFlagTail26verifiedCopies the last 16 bytes of Menu_FlagBlock7F ($7F:01F0-$01FF) to C2Scene_FlagTailCopy and its first byte (Eng_Unk7F0000) to C2Scene_Flag0Copy.
$C2:26F0C2Scene_RestoreFlagTail19verifiedCopies C2Scene_FlagTailCopy (16 bytes) back to $7F:01F0-$01FF, the end of Menu_FlagBlock7F (C2Scene_Flag0Copy is not written back).
$C2:2703C2Scene_SetStartPos29verifiedC2Scene_StartX/Y = the field's entry tile (Loc_EntryX/Y, in the field's direct page at $0100) times 8: probably the start position in pixels (inferred only from the scaling).
$C2:2720C2Scene_SetStartScroll45verifiedPuts the entry tile (Loc_EntryX/Y) in the middle of the screen: C2Scene_BgTileX (both words) = Loc_EntryX - 16, plus 192 if that is negative; C2Scene_BgTileY (both words) = Loc_EntryY - 14, plus...
$C2:274DC2Scene_GetHeaderPtr27verifiedC2Scene_HeaderPtr = $C6:(the word of C2SceneRom_HeaderTable for scene (Loc_Id AND C2Scene_LocIdMask) - Loc_FirstBankC2).
$C2:2768C2Scene_LoadObjGfx84verifiedUnpacks the scene's C2Scene_ObjPackCount sprite graphics packs (header bytes C2Scene_HdrObjGfx..+3, C2SceneRom_ObjPacks) into C2Scene_DecompBuf, C2Scene_PackSlotSize bytes apart (C2Scene_LoadVram...
$C2:27BCC2Scene_LoadUnkC80034verifiedUnpacks entry C2Scene_UnkC800Pack of C2SceneRom_ObjPacks (the same for every scene) to C2Scene_UnkC800 ($7E:C800); what it holds is not traced.
$C2:27DEC2Scene_LoadBgGfx72verifiedUnpacks the scene's C2Scene_BgPackCount BG graphics packs (header bytes C2Scene_HdrBgGfx..+6, C2SceneRom_BgPacks) into C2Scene_DecompBuf, C2Scene_PackSlotSize bytes apart ($7F:9000-$FFFF...
$C2:2826C2Scene_LoadBg3Gfx46verifiedUnpacks header byte C2Scene_HdrBg3Gfx's C2SceneRom_BgPacks entry into C2Scene_DecompBuf (C2Scene_LoadVram DMAs it to the BG3 tiles at VRAM $7000).
$C2:2854C2Scene_LoadBg3Map46verifiedUnpacks header byte C2Scene_HdrBg3Map's C2SceneRom_Bg3MapPacks entry into C2Scene_DecompBuf (C2Scene_LoadVram DMAs it to the BG3 tilemap at VRAM $7800).
$C2:2882C2Scene_LoadPalettes107verifiedUnpacks the scene's palettes (header byte C2Scene_HdrPalettes, C2SceneRom_PalettePacks) into C2Scene_PaletteStage, then the party palettes (entry C2Scene_PartyPalPack) into C2Scene_PartyPalSrc...
$C2:28EDC2Scene_CopyPartyPalette21verifiedCopies C2Scene_PartyPalSize bytes of character A's palette (C2Scene_PartyPalSrc + 32 * A) to Y in bank $7F.
$C2:2902C2Scene_LoadUnkB80046verifiedUnpacks header byte C2Scene_HdrUnkB800's C2SceneRom_BgPacks entry into C2Scene_UnkB800 ($7E:B800); what it holds is not traced.
$C2:2930C2Scene_LoadUnkC00046verifiedUnpacks header byte C2Scene_HdrUnkC000's C2SceneRom_PalettePacks entry into C2Scene_UnkC000 ($7E:C000); what it holds is not traced (probably more palettes, from the table it uses).
$C2:295EC2Scene_LoadMetatiles46verifiedUnpacks header byte C2Scene_HdrMetatiles's C2SceneRom_MetatilePacks entry into C2Scene_Metatiles ($7E:3000), the metatile set of layer 1 (and probably of layer 2 at $7E:3800; see...
$C2:298CC2Scene_LoadBgMaps46verifiedUnpacks header byte C2Scene_HdrMaps's C2SceneRom_MapPacks entry into C2Scene_BgMaps ($7E:4000), layer 1's metatile map (and probably layer 2's at $7E:5800; see C2Scene_LayerMaps).
$C2:29BAC2Scene_LoadUnk700046verifiedUnpacks header byte C2Scene_HdrUnk7000's C2SceneRom_Unk7000Packs entry into C2Scene_Unk7000 ($7E:7000), which is where C2Scene_LayerMaps puts layer 3's map; what it holds is not traced.
$C2:29E8C2Scene_LoadUnk720046verifiedUnpacks header byte C2Scene_HdrUnk7200's C2SceneRom_Unk7200Packs entry into C2Scene_Unk7200 ($7E:7200); what it holds is not traced.
$C2:2A16C2Scene_LoadScript46verifiedUnpacks header byte C2Scene_HdrScript's C2SceneRom_ScriptPacks entry into C2Scene_ScriptBuf ($7F:0400), over the list data C2Scene_LoadLists has already split up.
$C2:2A44C2Scene_LoadLists285verifiedUnpacks header byte C2Scene_HdrLists's C2SceneRom_ListPacks entry into C2Scene_ListPack ($7F:0400), then splits it into four lists through WMADD/WMDATA (bank $7E): a count byte, then that many...
$C2:2B61C2Scene_LoadPartyGfx91verifiedUnpacks the party graphics (C2SceneRom_ObjPacks entry C2Scene_PartyObjPack, the same for every scene) into C2Scene_DecompBuf, then builds C2Scene_PartyGfx from it: for each party member...
$C2:2BBCC2Scene_CopyPartyGfx19verifiedCopies C2Scene_PartyGfxSize bytes of character A's graphics (C2Scene_DecompBuf + $400 * A) to Y in bank $7F.
$C2:2BCFC2Scene_CopyPartyGfxB44verifiedCopies character A's two C2Scene_PartyGfxBSize-byte blocks (C2Scene_PartyGfxSrcB + $40 * A, and C2Scene_PartyGfxBGap bytes further) to Y and Y + C2Scene_PartyGfxBGap in bank $7F.
$C2:2BFBC2Scene_ClearHdmaArea34verifiedZeroes C2Scene_HdmaArea ($7E:8621-$8E20, 2048 bytes) through WMADD/WMDATA, with DP = $2100 for the register stores.
$C2:2C1DC2Scene_LoadScene118verifiedThe last setup step of C2Scene_Main: loads the scene and starts its script.
$C2:2C93C2Scene_ReloadScene46verifiedLoads the scene's graphics again (scene modes 5 and 8 call it after C2Scene_RestoreState and C2Scene_VramQInit; mode 8 skips it when $7F:01F4 AND $0A or $7F:01F5 AND $02 is non-zero ($C2:265E)...
$C2:2CC1C2Scene_LoadVram175verifiedFills VRAM and CGRAM for the scene, each pack staged at C2Scene_DecompBuf and DMAed with C2Scene_DmaToVram: - the four sprite packs (C2Scene_LoadObjGfx) to VRAM $0000 ($4000 B); - the party...
$C2:2D70C2Scene_DmaToVram33verifiedDMAs A bytes from X in bank $7F to VRAM word address Y on channel 7 (word writes to VMDATAL/H, VMAIN stepping after the high byte).
$C2:2D91C2Scene_LoadLocExtraGfx146verifiedOnce Eng_Unk7F0000 has reached C2Scene_ExtraGfxFlagMin, four scenes get extra graphics: C2Scene_LoadExtraObjPack, then C2Scene_ExtraObjBytes of it DMAed to VRAM $0C00 (Loc_Id $01F0-$01F2) or $0000...
$C2:2E23C2Scene_SaveState79verifiedCopies the scene's state to bank $7F with MVN: dp $00-$EF to C2Scene_SaveDp; $0700-$1DFF (with C2Scene_PaletteBuf and the task records) to C2Scene_SaveLowRam; the sprite nodes, link table and list...
$C2:2E72C2Scene_RestoreState79verifiedThe reverse of C2Scene_SaveState: copies the six saved blocks from bank $7F back where they came from (the direct page $00-$EF included).
$C2:2EC1C2Scene_ScrFadeOut3verifiedFade out at 1 frame per step (op $28, C2Scene_TaskUnk20A2), then end.
$C2:2EC4C2Scene_ScrFadeIn3verifiedFade in at 1 frame per step (op $29, C2Scene_TaskUnk2105), then end.
$C2:2EC7C2Scene_ScrMosaicFadeOut9verifiedStarted by C2Scene_Mode6: clears the task's fields (op $00), starts a mosaic grow (op $2A) on BG1-3 (arg 1 = 7) at 2 frames per step, waits 16 frames, fades out at 1 frame per step, ends.
$C2:2ED0C2Scene_ScrMosaicFadeIn9verifiedStarted by C2Scene_Mode6 on the way back: clears the task's fields, fades in at 1 frame per step, waits 8 frames, starts a mosaic shrink (op $2B) on BG1-3 at 2 frames per step, ends.
$C2:2ED9C2Scene_QueueSoundCmd54verifiedQueues the sound command in C2Scene_SoundCmdBuf (command byte and three argument bytes) for the frame loop to send: copies it to the driver block Audio_CmdId-Audio_CmdArg2, keeps its rank...
$C2:2F0FC2Scene_ZoneSoundAtEntry63verifiedSends C2Scene_SoundCmd10 straight to the driver (Audio_DriverCommand) with the zone sound of the field's entry tile: metatile column Loc_EntryX / 2, row Loc_EntryY / 2 (C2Scene_GetSoundZone...
$C2:2F4EC2Scene_ZoneSoundAtView70verifiedQueues (C2Scene_QueueSoundCmd) C2Scene_SoundCmd10 with the zone sound of the metatile at the middle of BG1's view: column BgTileX / 2 + 8, row (BgTileY / 2 + 7) AND 63; or with Menu_Config1E's...
$C2:2F94C2Scene_TaskZoneSound9verifiedTask handler: runs .State through C2Scene_ZoneSoundStates.
$C2:2F9DC2Scene_ZoneSoundStates8verifiedC2Scene_TaskZoneSound's handler for each .State.
$C2:2FA5C2Scene_ZoneSoundInit9verifiedState 0: .State = 1, C2Scene_SoundZone = C2Scene_ZoneNone; falls into C2Scene_ZoneSoundWatch.
$C2:2FAEC2Scene_ZoneSoundWatch142verifiedState 1, every frame: - while C2Scene_Unk7F01ED is set: queues C2Scene_SoundCmd10 with Menu_Config1E's byte at rank 0 (again each frame; C2Scene_Unk02AE takes it when queued); - else, only in an...
$C2:303CC2Scene_ZoneSoundWait19verifiedState 2: once .Timer's low byte (zeroed by C2Scene_ZoneSoundWatch, then one more each frame from C2Scene_TaskRunAll) reaches C2Scene_ZoneFadeFrames: .State = 3 and the new zone's sound is queued...
$C2:304FC2Scene_ZoneSoundResume39verifiedState 3: unless a command is being sent (C2Scene_SoundCmdState negative), queues C2Scene_SoundCmd81 with 0, C2Scene_SoundArgUnused, C2Scene_SoundArgUnused at rank 0 and sets .State back to 1...
$C2:3076C2Scene_ZoneSoundQueue40verifiedQueues C2Scene_SoundCmd10 with the sound of zone C2Scene_SoundZone (C2Scene_ZoneSounds), argument bytes 2-3 C2Scene_SoundArgUnused and C2Scene_SoundArg80, at rank 0; when queued, the sound goes to...
$C2:309EC2Scene_ObjWatch35verifiedWhile C2Scene_Mode is 0 or 1 and C2Scene_TrigWatch is in its check state (C2Scene_Unk0280 = 0): copies C2Scene_Unk027E to C2Scene_Unk027F and runs its state through C2Scene_ObjWatchStates.
$C2:30C1C2Scene_ObjWatchStates12verifiedC2Scene_ObjWatch's handler for each C2Scene_Unk027E state 0-5.
$C2:30CDC2Scene_ObjWatchIdle219verifiedState 0.
$C2:31A8C2Scene_ScrGoToLoc1D810verifiedScene script (C2Scene_TaskRunScript) started by C2Scene_ObjWatchIdle: fade out, wait, then leave for location $1D8 (op $05 argument word $03D8: Loc_Id $1D8, entry facing 1) at tile (7, 8).
$C2:31B2C2Scene_ObjWatchNone2verifiedState 1, and C2Scene_ObjSel 0 and 1 in C2Scene_ObjFullTable and C2Scene_ObjEmptyTable (shared label): nothing; C=0.
$C2:31B4C2Scene_ObjWatchBusyA14verifiedStates 2 and 3: wait until object A's (C2Scene_Unk0294) or object B's (C2Scene_ObjBFlags) C2Scene_ObjBusy bit is clear, then state C2Scene_ObjWatchStEmpty.
$C2:31C2C2Scene_ObjWatchBusyB14verified
$C2:31D0C2Scene_ObjWatchFull34verifiedState 4: counts the party members in C2Scene_PartyCount (each Party_Members byte with bit 7 clear; bit 7 is taken to mean an empty slot) and runs C2Scene_ObjSel through C2Scene_ObjFullTable: for...
$C2:31F2C2Scene_ObjFullTable8verifiedC2Scene_ObjWatchFull's handler for C2Scene_ObjSel 0-3.
$C2:31FAC2Scene_ObjFullNone2verifiedNo object selected: nothing; C=0.
$C2:31FCC2Scene_ObjFullA16verifiedObject A's (C2Scene_Unk0294) or B's (C2Scene_ObjBFlags) count equal to C2Scene_PartyCount: state C2Scene_ObjWatchStBusyA or C2Scene_ObjWatchStBusyB.
$C2:320CC2Scene_ObjFullB16verified
$C2:321CC2Scene_ObjWatchEmpty8verifiedState 5: runs C2Scene_ObjSel through C2Scene_ObjEmptyTable: when the selected object's count is 0, back to state C2Scene_ObjWatchStIdle with no object selected.
$C2:3224C2Scene_ObjEmptyTable8verifiedC2Scene_ObjWatchEmpty's handler for C2Scene_ObjSel 0-3.
$C2:322CC2Scene_ObjEmptyNone2verifiedNo object selected: nothing; C=0.
$C2:322EC2Scene_ObjEmptyA15verifiedObject A's (C2Scene_Unk0294) or B's (C2Scene_ObjBFlags) count at 0: C2Scene_Unk027E = C2Scene_ObjWatchStIdle and C2Scene_ObjSel = 0.
$C2:323DC2Scene_ObjEmptyB15verified
$C2:324CC2Scene_PartyBox8verifiedC2Scene_BoxesOverlap extents (left, right, up, down) of the party in C2Scene_ObjWatchIdle: 8 each way.
$C2:3254C2Scene_ObjABox8verifiedExtents of object A: only 8 down from its position.
$C2:325CC2Scene_ObjBBox8verifiedExtents of object B: the same as object A's.
$C2:3264C2Scene_TrigWatch17verifiedCopies its state C2Scene_Unk0280 to C2Scene_Unk0281 and runs it through C2Scene_TrigWatchStates (0: C2Scene_TrigWatchCheck, C2Scene_TrigStWait: C2Scene_TrigWatchWait).
$C2:3275C2Scene_TrigWatchStates4verifiedC2Scene_TrigWatch's handler for each C2Scene_Unk0280 state.
$C2:3279C2Scene_TrigWatchCheck62verifiedState 0.
$C2:32B7C2Scene_TrigWatchWait22verifiedState C2Scene_TrigStWait (set when a ListB script starts): once C2Scene_Unk1B43 is non-zero, back to state 0 with the three C2Scene_Unk1B32 words at C2Scene_Unk1B32Init.
$C2:32CDC2Scene_FindTrigEntries124verifiedFor C2Scene_ListA, ListB and ListC in turn: the byte offset of the first entry that has C2Scene_ListEntryBit7 set and whose first word AND C2Scene_ListTileMask equals C2Scene_TrigTile, or...
$C2:3349C2Scene_TrigDispatch53verifiedZeroes C2Scene_Unk1B58, builds C2Scene_TrigFound from which of the three C2Scene_Unk1B32 words is not C2Scene_NoEntry (bit 7 of the high byte clear): C2Scene_TrigFoundA (ListA), C2Scene_TrigFoundC...
$C2:337EC2Scene_TrigActions16verifiedC2Scene_TrigDispatch's action for each C2Scene_TrigFound mask: ListB wins over ListA's task byte, ListA over ListC's mode.
$C2:338EC2Scene_TrigNone1verifiedNo entry at the tile: nothing.
$C2:338FC2Scene_TrigListA11verifiedA ListA entry (and no ListB one): the current task's .Unk02 (C2Scene_TaskCur) = C2Scene_TrigTaskState1, and the entry's .Unk02 to C2Scene_Unk1B58 (C2Scene_GetListAUnk02).
$C2:339AC2Scene_TrigListC16verifiedA ListC entry only: the current task's .Unk02 = C2Scene_TrigTaskState1, a ListC byte to C2Scene_Unk1B47 (C2Scene_GetListCUnk03), and scene mode C2Scene_ModeHalt (C2Scene_Mode4, which never leaves).
$C2:33AAC2Scene_TrigListB42verifiedA ListB entry (and no ListA one): starts its C2Scene_ListD script (C2Scene_GetListBScript; bank $7F, as C2Scene_Mode3 does), zeroes C2Scene_MemberWords, clears the entry's C2Scene_ListEntryBit7...
$C2:33D4C2Scene_TrigListAB48verifiedA ListA and a ListB entry: the ListA entry's .Unk02 to C2Scene_Unk1B58 (C2Scene_GetListAUnk02), then as C2Scene_TrigListB, and C2Scene_Unk1B43 = 0.
$C2:3404C2Scene_LeaderTask41verifiedTask handler.
$C2:342DC2Scene_LeaderStates12verifiedC2Scene_LeaderTask's handler for each C2Scene_Unk027E state 0-5.
$C2:3439C2Scene_LeaderWalk36verifiedObjWatch state 0.
$C2:345DC2Scene_LeaderWalkSteps16verifiedC2Scene_LeaderWalk's handler per C2Scene_Unk0280 state (4 words each) and .State.
$C2:346DC2Scene_LeaderOnObjA12verifiedObjWatch state 2 (C2Scene_ObjWatchStBusyA): the party's position C2Scene_StartX/Y = object A's (C2Scene_ObjAX/Y), every frame; then falls into C2Scene_LeaderNone.
$C2:3479C2Scene_LeaderNone2verifiedObjWatch state 1, and the end of C2Scene_LeaderOnObjA: nothing; C=0.
$C2:347BC2Scene_LeaderOnObjB14verifiedObjWatch state 3 (C2Scene_ObjWatchStBusyB): as C2Scene_LeaderOnObjA with object B (C2Scene_ObjBX/Y).
$C2:3489C2Scene_LeaderBoard10verifiedObjWatch state 4 (C2Scene_ObjWatchStFull): runs entry .State of C2Scene_LeaderBoardSteps (walk to the selected object, then count in).
$C2:3493C2Scene_LeaderBoardSteps8verifiedC2Scene_LeaderBoard's handler for .State 0-3.
$C2:349BC2Scene_LeaderLeave8verifiedObjWatch state 5 (C2Scene_ObjWatchStEmpty): runs entry C2Scene_ObjSel of C2Scene_LeaderLeaveTable.
$C2:34A3C2Scene_LeaderLeaveTable8verifiedC2Scene_LeaderLeave's handler for C2Scene_ObjSel 0-3.
$C2:34ABC2Scene_LeaderLeaveNone2verifiedNo object selected: nothing; C=0.
$C2:34ADC2Scene_LeaderLeaveA32verifiedLeaving object A (B): .State = 0, the sprite and C2Scene_StartX/Y at the object's position (C2Scene_ObjAX/Y, C2Scene_ObjBX/Y), one off the object's flags byte (C2Scene_Unk0294, C2Scene_ObjBFlags...
$C2:34CDC2Scene_LeaderLeaveB43verified
$C2:34F8C2Scene_LeaderInit111verifiedStep 0 of TrigWatch state 0: sets the sprite up and falls into C2Scene_LeaderInput.
$C2:3567C2Scene_LeaderInput390verifiedStep 1 of TrigWatch state 0: reads the held buttons (Pad_Unk00F8 and the D-pad in Pad_Unk00F9) in scene mode C2Scene_ModeIdle1 only (in mode 0 it only animates).
$C2:36EDC2Scene_LeaderStep133verifiedStep 2 of TrigWatch state 0, one frame of a step: moves the sprite (C2Scene_TaskMove, C2Scene_WrapTaskPos); scrolls BG layers 1 and 2 by .XVel pixels across (C2Scene_Unk0568) and by .YVel pixels...
$C2:3772C2Scene_LeaderScriptStart47verifiedStep 0 of TrigWatch state C2Scene_TrigStWait: while the first C2Scene_MemberWords word is 0, nothing.
$C2:37A1C2Scene_LeaderScriptRun26verifiedStep 1 of TrigWatch state C2Scene_TrigStWait: runs the script (C2Scene_TaskRunScript); when it ends (C=1) .State = 2 instead of the task ending.
$C2:37BBC2Scene_LeaderScriptDone2verifiedStep 2 of TrigWatch state C2Scene_TrigStWait (the script has ended): nothing until a watcher's state changes; C=0.
$C2:37BDC2Scene_LeaderBoardStart13verifiedStep 0 of ObjWatch state 4: the target (.TargetX/Y) = the selected object's position (C2Scene_ObjAX/Y or C2Scene_ObjBX/Y, by C2Scene_ObjSel through C2Scene_LeaderBoardTargets); the four velocity...
$C2:37CAC2Scene_LeaderBoardTargets8verifiedC2Scene_LeaderBoardStart's code for C2Scene_ObjSel 0-3.
$C2:37D2C2Scene_LeaderBoardSel04verified
$C2:37D6C2Scene_LeaderBoardSel12verified
$C2:37D8C2Scene_LeaderBoardObjA16verified
$C2:37E8C2Scene_LeaderBoardObjB79verified
$C2:3837C2Scene_LeaderBoardY142verifiedStep 1 of ObjWatch state 4: moves the sprite (C2Scene_TaskMove, C2Scene_WrapTaskPos); C2Scene_StartX/Y and Loc_EntryX/Y from the position (C2Scene_SetEntryTile); BG layers 1 and 2 scrolled by...
$C2:38C5C2Scene_LeaderBoardX85verifiedStep 2 of ObjWatch state 4: moves the sprite (C2Scene_TaskMove, C2Scene_WrapTaskPos); at the target's X, .State = 3 and the object's count goes up by one (C2Scene_ObjCountUp).
$C2:391AC2Scene_LeaderBoardDone2verifiedStep 3 of ObjWatch state 4 (counted in): nothing; C=0.
$C2:391CC2Scene_TrailFill24verifiedFills all C2Scene_TrailLen entries of C2Scene_TrailX/Y with C2Scene_StartX/Y.
$C2:3934C2Scene_TrailPush31verifiedStores the task's .SprX/.SprY at C2Scene_TrailPos in C2Scene_TrailX/Y and moves C2Scene_TrailPos one word on (wrapping after 16).
$C2:3953C2Scene_SetWalkAnim44verifiedStarts the walk animation of the task's facing: entry .Facing * 2 (bit 7 shifted out) + .Unk26 bit 0 of C2Scene_WalkAnims, C2Scene_AltAnimOfs further on when C2Scene_AnimChar is...
$C2:397FC2Scene_WalkAnims8verifiedWalk animation numbers (C2Scene_SetAnim), two per facing: up, down, left, right.
$C2:3987C2Scene_SetStandAnim35verifiedStarts the stand animation of the task's facing: entry .Facing AND C2Scene_FacingMask of C2Scene_StandAnims, C2Scene_AltAnimOfs further on for C2Scene_AltAnimChar, as C2Scene_SetWalkAnim.
$C2:39AAC2Scene_StandAnims4verifiedStand animation numbers per facing: up, down, left, right.
$C2:39AEC2Scene_OnTrigTiles21verifiedC=1 when both upper property nibbles (.PropUL, .PropUR) have bit 2 set (C2Scene_TilePropTrig); the leader's callers then set C2Scene_TrigRecheck and C2Scene_TrigKeep, and C2Scene_ObjBFly does not...
$C2:39C3C2Scene_TileBlocked18verifiedC=1 when either upper property nibble (.PropUL, .PropUR) has bit 0 or 1 set (C2Scene_TilePropWall): the step is not taken.
$C2:39D5C2Scene_GetTileProps129verifiedReads the property nibbles of the four 8x8 tiles around the pixel point (C2Scene_PropX, C2Scene_PropY) into the task's .PropUL-.PropDR (C2Scene_GetTileProp, with BG2's metatile map at $7E:5800 and...
$C2:3A56C2Scene_SetStepTarget57verified.TargetX/Y = the task's position, moved C2Scene_TilePx (8) pixels in the direction of each non-zero whole-pixel velocity (.XVel, .YVel; minus for a negative one).
$C2:3A8FC2Scene_WrapStepTarget34verifiedWraps .TargetX/Y into the scene map as C2Scene_WrapTaskPos does the position: X + or - C2Scene_MapWidthPx (once), Y AND C2Scene_MapHeightMask.
$C2:3AB1C2Scene_ObjCountUp9verifiedAdds one to the selected object's flags byte (its count, C2Scene_ObjCountMask): C2Scene_Unk0294 for C2Scene_ObjSelA, C2Scene_ObjBFlags for C2Scene_ObjSelB, nothing for 0 and 1.
$C2:3ABAC2Scene_ObjCountUpTable8verifiedC2Scene_ObjCountUp's handler for C2Scene_ObjSel 0-3.
$C2:3AC2C2Scene_ObjCountUpNone1verified
$C2:3AC3C2Scene_ObjCountUpA4verified
$C2:3AC7C2Scene_ObjCountUpB4verified
$C2:3ACBC2Scene_SetEntryTile23verifiedLoc_EntryX/Y = C2Scene_StartX/Y / 8 (the party's 8x8 tile; the inverse of C2Scene_SetStartPos).
$C2:3AE2C2Scene_MemberTask45verifiedTask handler.
$C2:3B0FC2Scene_MemberStates12verifiedC2Scene_MemberTask's handler for each C2Scene_Unk027E state 0-5.
$C2:3B1BC2Scene_MemberWalk61verifiedObjWatch state 0.
$C2:3B58C2Scene_MemberWalkSteps16verifiedC2Scene_MemberWalk's handler per C2Scene_Unk0280 state (4 words each) and .State.
$C2:3B68C2Scene_MemberNone2verifiedObjWatch states 1-3: nothing (the member stays where it is while the object is busy); C=0.
$C2:3B6AC2Scene_MemberBoard10verifiedObjWatch state 4 (C2Scene_ObjWatchStFull): runs entry .State of C2Scene_MemberBoardSteps.
$C2:3B74C2Scene_MemberBoardSteps8verifiedC2Scene_MemberBoard's handler for .State 0-3.
$C2:3B7CC2Scene_MemberLeave8verifiedObjWatch state 5 (C2Scene_ObjWatchStEmpty): runs entry C2Scene_ObjSel of C2Scene_MemberLeaveTable.
$C2:3B84C2Scene_MemberLeaveTable8verifiedC2Scene_MemberLeave's handler for C2Scene_ObjSel 0-3.
$C2:3B8CC2Scene_MemberLeaveNone2verifiedNo object selected: nothing; C=0.
$C2:3B8EC2Scene_MemberLeaveA26verifiedLeaving object A: .State = 0, the sprite at C2Scene_ObjAX/Y, one off C2Scene_Unk0294 (the object's count), every frame of the state, as C2Scene_LeaderLeaveA but without C2Scene_StartX/Y, .Unk26...
$C2:3BA8C2Scene_MemberLeaveB26verifiedC2Scene_MemberLeaveA for object B (C2Scene_ObjBX/Y, C2Scene_ObjBFlags).
$C2:3BC2C2Scene_MemberInit119verifiedStep 0 of TrigWatch state 0: sets the sprite up and falls into C2Scene_MemberFollow.
$C2:3C39C2Scene_MemberFollow161verifiedStep 1 of TrigWatch state 0: decides the next move.
$C2:3CDAC2Scene_MemberMoveX97verifiedStep 2 of TrigWatch state 0, a leg in X.
$C2:3D3BC2Scene_MemberMoveY97verifiedStep 3 of TrigWatch state 0: C2Scene_MemberMoveX with the axes swapped (.SprY, .TargetY; the next leg is in X: .State 2, C2Scene_MemberXLeg).
$C2:3D9CC2Scene_MemberScriptStart37verifiedStep 0 of TrigWatch state C2Scene_TrigStWait: as C2Scene_LeaderScriptStart with the member's own word, C2Scene_MemberWords + .Slot * 2 (no tile property read here).
$C2:3DC1C2Scene_MemberScriptRun34verifiedStep 1 of TrigWatch state C2Scene_TrigStWait: runs the script; when it ends, .State = 2.
$C2:3DE3C2Scene_MemberScriptDone2verifiedStep 2 of TrigWatch state C2Scene_TrigStWait: nothing; C=0.
$C2:3DE5C2Scene_MemberBoardStart50verifiedStep 0 of ObjWatch state 4: the target is the party's position on its 8x8 tile (C2Scene_MemberLeaderTarget); route, first leg, facing and walk animation as C2Scene_MemberFollow plans them; .Frames...
$C2:3E17C2Scene_MemberBoardX100verifiedStep 1 of ObjWatch state 4, a leg in X: moves until .SprX = .TargetX.
$C2:3E7BC2Scene_MemberBoardY100verifiedStep 2 of ObjWatch state 4: C2Scene_MemberBoardX with the axes swapped (.SprY, .TargetY; the next leg is in X: .State 1, C2Scene_MemberXLeg).
$C2:3EDFC2Scene_MemberBoardDone2verifiedStep 3 of ObjWatch state 4 (counted in): nothing; C=0.
$C2:3EE1C2Scene_LeaderNear1670verifiedC=1 when the party's position (C2Scene_StartX/Y) is within C2Scene_NearLo16 pixels before and C2Scene_NearHi16 - 1 after the member's .SprX/.SprY on both axes (unsigned compares, so the box does...
$C2:3F27C2Scene_LeaderNear3270verifiedC2Scene_LeaderNear16 with C2Scene_NearLo32 / C2Scene_NearHi32 (32 pixels).
$C2:3F6DC2Scene_MemberTrailTarget39verified.TargetX/Y = a trail entry: the last one C2Scene_TrailPush wrote (C2Scene_TrailPos - 2) for slot 1 (.Slot bit 0), the one before it (- 4) otherwise.
$C2:3F94C2Scene_MemberLeaderTarget19verified.TargetX/Y = C2Scene_StartX/Y AND C2Scene_TileSnapMask (the start of the party's 8x8 tile).
$C2:3FA7C2Scene_MemberDelta21verified.DeltaX/Y = .TargetX/Y - .SprX/Y.
$C2:3FBCC2Scene_MemberRoute44verifiedPlans .Route from the member's position to its target.
$C2:3FE8C2Scene_MemberRouteTable8verifiedC2Scene_MemberRoute's handler for each C2Scene_PathBlocked result 0-3.
$C2:3FF0C2Scene_MemberRouteOpen92verified
$C2:404CC2Scene_MemberRouteYFirst10verified
$C2:4056C2Scene_MemberRouteXFirst10verified
$C2:4060C2Scene_MemberRouteTrail132verified
$C2:40E4C2Scene_FaceVelocity65verified.PrevFacing = .Facing's direction; .Facing keeps only C2Scene_WalkMoving and gets the direction of the whole-pixel velocity: left / right for a negative / positive .XVel, else up / down for .YVel.
$C2:4125C2Scene_MemberFirstLeg19verifiedSets the velocity of the route's first leg: C2Scene_MemberYLeg for a C2Scene_RouteYFirst route, else C2Scene_MemberXLeg.
$C2:4138C2Scene_MemberXLeg26verifiedA leg in X: .XVel = -1 for a negative .DeltaX, else +1; .XVelFrac, .YVel and .YVelFrac 0.
$C2:4152C2Scene_MemberYLeg26verifiedC2Scene_MemberXLeg for Y: .YVel = -1 / +1 by .DeltaY, the other three velocity words 0.
$C2:416CC2Scene_MemberStand24verifiedNot moving (.Facing loses C2Scene_WalkMoving) and the stand animation of the member's character (the Party_Members byte of .Slot; C2Scene_SetStandAnim, tail call).
$C2:4184C2Scene_MemberWalkAnim49verifiedZeroes the member's idle count (C2Scene_IdleFrames + .Slot) and starts the walk animation (C2Scene_SetWalkAnim) unless it already runs for an unchanged direction (.Facing = .PrevFacing with...
$C2:41B5C2Scene_PathBlocked80verifiedTests the two one-turn paths between 8x8 tiles (C2Scene_RouteFromX, C2Scene_RouteFromY) and (C2Scene_RouteToX, C2Scene_RouteToY) for wall tiles: C2Scene_PathXYBlocked when the path along the row...
$C2:4205C2Scene_ScanRow85verifiedWalks C2Scene_ScanX one column at a time to C2Scene_ScanEnd along tile row C2Scene_ScanY - 1 (the row above the point, as the leader's .PropUL/UR), testing each new column's property nibble...
$C2:425AC2Scene_ScanCol131verifiedC2Scene_ScanRow down or up a column: C2Scene_ScanY (and C2Scene_ScanEnd) are taken one row up, then C2Scene_ScanY walks to C2Scene_ScanEnd testing the two tiles of each new row at columns...
$C2:42DDC2Scene_ObjATask9verifiedTask handler: runs the C2Scene_ObjAStates handler of .State.
$C2:42E6C2Scene_ObjAStates18verifiedC2Scene_ObjATask's handler for each .State 0-8.
$C2:42F8C2Scene_ObjAInit211verifiedState 0: puts the sprite at C2Scene_ObjAX/Y (fractions and .SprTile 0), then by C2Scene_Unk0294: - C2Scene_ObjBusy clear: .State C2Scene_ObjAStWait, .SprAttr C2Scene_ObjAttrPrio2, facing down...
$C2:43CBC2Scene_ObjAWait113verifiedState 1: runs the animation until C2Scene_ObjWatch reaches state C2Scene_ObjWatchStBusyA (the whole party is in), then sets C2Scene_ObjBusy and: - without C2Scene_ObjAFlag5: sets...
$C2:443CC2Scene_ObjARise123verifiedState 2: moves by the velocity (C2Scene_TaskMove, C2Scene_WrapTaskPos) until .Frames reaches .Duration; on frame C2Scene_RiseAttrAt the sprite gets .SprAttr C2Scene_ObjAttrPrio3.
$C2:44B7C2Scene_ObjAFly446verifiedState 3 (C2Scene_ObjAStFly): in scene mode C2Scene_ModeIdle1, with any bit of Pad_Unk00F8 (read as a word) set, the first that applies: - Pad_Unk00F8Bit7 with C2Scene_ObjAOnSpot: unless...
$C2:4675C2Scene_ObjAMove109verifiedState 4: moves by the velocity (C2Scene_TaskMove, C2Scene_WrapTaskPos) and scrolls BG layers 1 and 2 with it (C2Scene_Unk0568 by .XVel, C2Scene_Unk066C by .YVel, the low bytes), as the leader's...
$C2:46E2C2Scene_ObjALand70verifiedState 5 (C2Scene_ObjAStLand): moves by the velocity until .Frames reaches .Duration (low byte), with .SprAttr C2Scene_ObjAttrPrio2 from frame C2Scene_LandAttrAt; C2Anim_Run.
$C2:4728C2Scene_ObjAAfterMode8251verifiedState 6 (C2Scene_ObjAStMode8): waits for C2Scene_ObjANextLoc, which C2Scene_ObjAWait and C2Scene_ObjAFly zero before scene mode C2Scene_ModeUnk8 (mode 8's sub-program C2Scene_Dial sets it).
$C2:4823C2Scene_ObjAScript101verifiedState 7 (C2Scene_ObjAStScript): runs the task's own script (C2Scene_TaskRunScript on .ScriptPtr: C2Scene_ObjAScrArrive or C2Scene_ObjAScrLeave).
$C2:4888C2Scene_ObjAWaitEmpty17verifiedState 8 (C2Scene_ObjAStWaitEmpty): when C2Scene_ObjWatch reaches C2Scene_ObjWatchStEmpty (the party is getting out), .State 0; C2Anim_Run every frame.
$C2:4899C2Scene_ObjAStepVel16verifiedC2Scene_ObjAFly's step velocity per facing: .XVel then .YVel (whole pixels a frame, signed).
$C2:48A9C2Scene_ObjAFaceAnim28verifiedStarts the animation of the task's .Facing: entry .Facing of C2Scene_ObjAFaceAnims, or of C2Scene_ObjAFaceAnims5 with C2Scene_ObjAFlag5 (C2Scene_SetAnim, by JMP).
$C2:48C5C2Scene_ObjAFaceAnims4verifiedAnimation numbers per facing (up, down, left, right) of C2Scene_ObjAFaceAnim.
$C2:48C9C2Scene_ObjAFaceAnims54verifiedThe same with C2Scene_ObjAFlag5.
$C2:48CDC2Scene_ObjAJump27verifiedMoves the task C2Scene_ObjAJumpPx (512) pixels in X the way .XVel points (back when it is negative) and wraps the position (C2Scene_WrapTaskPos, by JMP).
$C2:48E8C2Scene_ObjAOverlap47verifiedC=1 when object A is active (C2Scene_ObjActive in C2Scene_Unk0294), at the current location (Loc_Id equal to C2Scene_ObjALoc, unmasked) and its box (C2Scene_ObjAFlyBox at C2Scene_ObjAX/Y) overlaps...
$C2:4917C2Scene_ObjBOverlap47verifiedC2Scene_ObjAOverlap for object B: active (C2Scene_ObjBFlags), Loc_Id C2Scene_ObjBLocId (unmasked) and C2Scene_ObjBLandBox at C2Scene_ObjBX/Y against box A.
$C2:4946C2Scene_ObjAFlyBox8verifiedC2Scene_BoxesOverlap extents (left, right, up, down) of object A in C2Scene_ObjAFly and C2Scene_ObjASpotWatch: 8 each way.
$C2:494EC2Scene_ObjBLandBox8verifiedObject B's extents for C2Scene_ObjBOverlap: 8 each way.
$C2:4956C2Scene_SpotBox8verifiedThe extents of the spot at C2Scene_SpotX/Y (C2Scene_ObjASpotWatch): 8 each way.
$C2:495EC2Scene_ObjAMarkTask9verifiedTask handler of a second sprite that goes with object A (no reference in the bank's code, as C2Scene_ObjATask): runs the C2Scene_ObjAMarkStates handler of .State.
$C2:4967C2Scene_ObjAMarkStates4verifiedC2Scene_ObjAMarkTask's handler for .State 0 and 1.
$C2:496BC2Scene_ObjAMarkInit33verifiedState 0: ends the task (C=1) unless object A is at this location (Loc_Id AND C2Scene_LocIdMask equal to C2Scene_ObjALoc).
$C2:498CC2Scene_ObjAMarkShow67verifiedState 1, every frame: with C2Scene_ObjAFlag5 and C2Scene_ObjAAloft set, animation C2Scene_AnimMarkBelow at C2Scene_ObjAX, C2Scene_ObjAY + C2Scene_Lift (24 pixels below object A: probably its...
$C2:49CFC2Scene_ObjASpotWatch91verifiedTask handler (no reference in the bank's code): while C2Scene_ObjWatch is in C2Scene_ObjWatchStBusyA (the party in object A) and C2Scene_ObjAInMode8 is clear, tests object A's box...
$C2:4A2AC2Scene_ObjASound46verifiedQueues C2Scene_SoundCmd10 with C2Scene_ObjASongArg (arguments C2Scene_SoundArgUnused, C2Scene_SoundArg80, rank 0), as C2Scene_ZoneSoundQueue does with a zone's sound; when it is queued (C=0) the...
$C2:4A58C2Scene_ObjAGetProps67verifiedAfter C2Scene_GetTileProps (C2Scene_PropX/Y = the point's 8x8 column and row): .PropBL = the property nibble of the tile below-left (column - 1, wrapping to C2Scene_MapTilesX - 1, row + 1 AND 127)...
$C2:4A9BC2Scene_ObjAScrGo1DD18verifiedScript of a task C2Scene_ObjARise starts with C2Scene_Flag0ObjAGo1DD: the new task (a copy of object A's record) puts its sprite at .SprY $198 with animation $1B, fades out and leaves for location...
$C2:4AADC2Scene_ObjAScrLeave223verifiedObject A's own script for state C2Scene_ObjAStScript after mode 8 chose a location (C2Scene_ObjAAfterMode8).
$C2:4B8CC2Scene_ObjAScrArrive108verifiedObject A's own script when the scene loads with the party in it after mode 8 (C2Scene_ObjAInit).
$C2:4BF8C2Scene_ObjAScrSlowVel35verifiedScript subroutine (C2Script_Call): the velocity half a pixel a frame in the .Facing direction (the other axis left as it is).
$C2:4C1BC2Scene_ObjAScrFastVel35verifiedC2Scene_ObjAScrSlowVel at 8 pixels a frame.
$C2:4C3EC2Scene_ObjAScrDash10verifiedScript subroutine: task byte +$22 rounds of 2 frames' movement (C2Script_MoveFrames), each starting a C2Scene_ObjAScrTrail task.
$C2:4C48C2Scene_ObjAScrTrail39verifiedScript of the tasks C2Scene_ObjAScrDash starts (each a copy of object A's record, so at its position): the animation for the copied .Facing ($33 up, $32 down, $34 left, $35 right), shown for 8...
$C2:4C6FC2Scene_ObjAScrUnk4C6F32verifiedA script with no reference found (no pointer to it in the bank): fade out, swap the low bytes of Loc_Id and Loc_ReturnId (through task byte +$22), C2Scene_ObjALoc = Loc_Id, scene mode...
$C2:4C8FC2Scene_ObjAScrSpot54verifiedScript of the task C2Scene_ObjAFly starts on the spot (C2Scene_ObjAOnSpot): fade out, Loc_Id, Loc_EntryX/Y and Loc_EntryFacing copied to Loc_ReturnId-Loc_ReturnFacing, then location $1C1 at tile...
$C2:4CC5C2Scene_ObjBTask9verifiedTask handler: runs the C2Scene_ObjBStates handler of .State.
$C2:4CCEC2Scene_ObjBStates12verifiedC2Scene_ObjBTask's handler for each .State 0-5.
$C2:4CDAC2Scene_ObjBInit93verifiedState 0: the sprite at C2Scene_ObjBX/Y (fractions and .SprTile 0), facing down (.Facing, .PrevFacing).
$C2:4D37C2Scene_ObjBWait66verifiedState 1: runs the animation until C2Scene_ObjWatch reaches C2Scene_ObjWatchStBusyB (the party is in B); then sets C2Scene_ObjBusy in C2Scene_ObjBFlags, .State 2, the property nibbles at the...
$C2:4D79C2Scene_ObjBRise86verifiedState 2: as C2Scene_ObjARise with fixed counts: moves for C2Scene_RiseFrames frames (.SprAttr C2Scene_ObjBAttrPrio3 from frame C2Scene_RiseAttrAt); then .State C2Scene_ObjBStFly, C2Scene_ObjBAloft...
$C2:4DCFC2Scene_ObjBFly431verifiedState 3 (C2Scene_ObjBStFly): in scene mode C2Scene_ModeIdle1, with any bit of Pad_Unk00F8 (a word) set: - Pad_Unk00F8Bit7 comes down when none of .PropUL-DR and .PropBL/B has a bit of...
$C2:4F7EC2Scene_ObjBMove109verifiedState 4: C2Scene_ObjAMove for object B: moves, scrolls BG layers 1 and 2, C2Scene_Unk1BF1/1BF3 = the velocity, C2Anim_Run, C2Scene_ObjBX/Y = the position, and at the target .State =...
$C2:4FEBC2Scene_ObjBLand76verifiedState 5 (C2Scene_ObjBStLand): moves for C2Scene_LandFrames frames (.SprAttr C2Scene_ObjBAttrPrio2 from frame C2Scene_LandAttrAt); then C2Scene_ObjBusy and C2Scene_ObjBLanding cleared, .State...
$C2:5037C2Scene_ObjBStepVel16verifiedC2Scene_ObjBFly's step velocity per facing (.XVel, .YVel), as C2Scene_ObjAStepVel.
$C2:5047C2Scene_ObjBFaceAnims4verifiedObject B's animation per facing (up, down, left, right).
$C2:504BC2Scene_ObjBMarkTask9verifiedTask handler of object B's second sprite (no reference in the bank's code): runs the C2Scene_ObjBMarkStates handler of .State.
$C2:5054C2Scene_ObjBMarkStates4verifiedC2Scene_ObjBMarkTask's handler for .State 0 and 1.
$C2:5058C2Scene_ObjBMarkInit16verifiedState 0: .State 1, .SprAttr C2Scene_ObjAttrPrio3, .SprTile 0; falls into C2Scene_ObjBMarkShow.
$C2:5068C2Scene_ObjBMarkShow39verifiedState 1, every frame: the C2Scene_ObjBMarkOfs entry of C2Scene_ObjBAloft (0: above B, C2Scene_AnimMarkAbove; 1: below, C2Scene_AnimMarkBelow): the sprite at C2Scene_ObjBX, C2Scene_ObjBY + the...
$C2:508FC2Scene_ObjBMarkOfs8verifiedPer C2Scene_ObjBAloft: the Y offset from object B and the animation.
$C2:5097C2Scene_ObjBMateTask9verifiedTask handler of one of object B's mates (see the banner): runs the C2Scene_ObjBMateStates handler of .State.
$C2:50A0C2Scene_ObjBMateStates12verifiedC2Scene_ObjBMateTask's handler for each .State 0-5.
$C2:50ACC2Scene_ObjBMateInit100verifiedState 0: the sprite at C2Scene_ObjBX/Y (fractions and .SprTile 0), facing down, .SprAttr C2Scene_MemberAttr with the slot's palette (C2Scene_Member1Pal for .Slot C2Scene_Slot1, else...
$C2:5110C2Scene_ObjBMateWait60verifiedState 1: nothing (C=0) until C2Scene_ObjWatch reaches C2Scene_ObjWatchStBusyB.
$C2:514CC2Scene_ObjBMateRise89verifiedState 2: moves for C2Scene_RiseFrames frames (OAM priority 3 from frame C2Scene_RiseAttrAt), saving the position (C2Scene_ObjBMateSavePos) and running the animation each frame.
$C2:51A5C2Scene_ObjBMateFollow130verifiedState 3, also re-entered from C2Scene_ObjBMateMove every C2Scene_MateAimFrames frames: - with C2Scene_ObjBLanding (object B is coming down): .State C2Scene_MateStLand, .Frames 0, +$22 = 0, .SprY...
$C2:5227C2Scene_ObjBMateMove34verifiedState 4: for C2Scene_MateAimFrames frames moves without overshooting the target (C2Scene_ObjBMateClampVel, C2Scene_TaskMove, C2Scene_WrapTaskPos), saves the position and runs the animation; then...
$C2:5249C2Scene_ObjBMateLand65verifiedState 5 (C2Scene_MateStLand): moves until .Frames passes C2Scene_LandFrames, which is $30 frames (C2Scene_TaskRunAll has already counted .Frames to 1 on the frame Follow ended), saving the...
$C2:528AC2Scene_ObjBMateClampVel147verifiedKeeps a step from going past the target: per axis, when the distance to .TargetX (.TargetY) is less than the whole pixels of the speed (|.XVel| with the fraction's borrow), the velocity becomes...
$C2:531DC2Scene_ObjBMateSpot68verified.TargetX/Y = the mate's spot beside object B: C2Scene_ObjBX/Y plus the C2Scene_ObjBMateSpots entry of (Loc_EntryFacing's facing * 2 + .Slot - 1), snapped to the 8x8 tile (C2Scene_TileSnapMask) and...
$C2:5361C2Scene_ObjBMateToObjB19verified.TargetX/Y = C2Scene_ObjBX/Y.
$C2:5374C2Scene_ObjBMateAim95verifiedVelocity 0, then the direction from the position to .TargetX/Y (C2Scene_Unk229D).
$C2:53D3C2Scene_ObjBMateGlideVel105verifiedThe velocity that reaches .TargetX/Y in C2Scene_MateGlideFrames frames: per axis the distance with its bytes swapped (XBA) divided by C2Scene_MateGlideFrames with the hardware divider, the...
$C2:543CC2Scene_ObjBMateSpots32verifiedC2Scene_ObjBMateSpot's X and Y offsets from object B per party facing (up, down, left, right) and slot (1, 2): 24 pixels across and 24 along.
$C2:545CC2Scene_ObjBMateFaceDir20verified.PrevFacing = .Facing; .Facing = Rom_DirToFacing's entry for the direction in C2Scene_AimDir (C2Scene_ObjBMateAim's).
$C2:5470C2Scene_ObjBMateFaceAnim28verifiedWhen .Facing differs from .PrevFacing: starts entry (.Slot - 1) * 4 + .Facing of C2Scene_ObjBMateFaceAnims (C2Scene_SetAnim, by JMP).
$C2:548CC2Scene_ObjBMateFaceAnims8verifiedThe mates' animation per slot (1, then 2) and facing (up, down, left, right).
$C2:5494C2Scene_ObjBMateMarkTask9verifiedTask handler of a mate's second sprite (.Slot as the mate's; no reference in the bank's code): runs the C2Scene_ObjBMateMarkStates handler of .State.
$C2:549DC2Scene_ObjBMateMarkStates10verifiedC2Scene_ObjBMateMarkTask's handler for each .State 0-4.
$C2:54A7C2Scene_ObjBMateMarkInit103verifiedState 0: .SprAttr C2Scene_ObjAttrPrio3.
$C2:550EC2Scene_ObjBMateMarkWait52verifiedState 1: nothing (C=0) until C2Scene_ObjWatch reaches C2Scene_ObjWatchStBusyB; then .State 2, .Frames 0, velocity half a pixel up and half a pixel sideways (right for slot 1, left for slot 2), and...
$C2:5542C2Scene_ObjBMateMarkRise43verifiedState 2: moves for C2Scene_RiseFrames frames with C2Anim_Run; then .State C2Scene_MateStFollow, .SprY + C2Scene_MateMarkDrop, animation C2Scene_AnimMarkBelow, and falls into...
$C2:556DC2Scene_ObjBMateMarkFollow100verifiedState 3: with C2Scene_ObjBLanding: .State C2Scene_MateMarkStLand, .Frames 0, the target C2Scene_ObjBX, C2Scene_ObjBY - C2Scene_Lift, .SprY - C2Scene_MateMarkDrop, the glide velocity to the target...
$C2:55D1C2Scene_ObjBMateMarkLand52verifiedState 4 (C2Scene_MateMarkStLand): moves until .Frames passes C2Scene_LandFrames, $30 frames (.Frames is already 1 when it starts); then .State C2Scene_MateStWait, fractions and velocity 0.
$C2:5605C2Scene_ObjBMateSavePos35verifiedCopies the task's position to C2Scene_ObjBMate1X/Y (.Slot bit 0 set: slot 1) or C2Scene_ObjBMate2X/Y, where the mark tasks read it.
$C2:5628C2Scene_LabelTask15verifiedTask handler (no reference in the bank's code, as the object tasks): draws string C2Scene_Unk1B58 of C2SceneRom_LabelStrings with the text window code into a buffer, uploads it to VRAM and shows...
$C2:5637C2Scene_LabelStates8verifiedC2Scene_LabelTask's handler for each .State 0-3.
$C2:563FC2Scene_LabelInit36verifiedState 0: .State 1, .SprAttr C2Scene_ObjAttrPrio3, .SprTile 0, the animation and frame templates copied to C2Scene_Unk8600/8604 (C2Scene_Unk5775), and the animation pointer on C2Scene_Unk8600 (its...
$C2:5663C2Scene_LabelWait54verifiedState 1: nothing (C=0) while C2Scene_Unk1B58 is 0.
$C2:5699C2Scene_LabelDraw96verifiedState 2: one TextWin_Step of one character (TextWin_StepCount 1) per frame while TextWin_Status comes back TextWin_StatusStepDone (C=0).
$C2:56F9C2Scene_LabelShow124verifiedState 3: with C2Scene_Unk1B58 0, .State C2Scene_LabelStWait and the buffer cleared (C2Scene_ClearUnk8621), and the sprite still drawn this frame; with C2Scene_Unk1B59 set (probably "the label...
$C2:5775C2Scene_Unk577535verifiedCopies C2Scene_Unk8600Init (4 bytes) to C2Scene_Unk8600 and C2Scene_Unk8604Init (C2Scene_Unk8604Size bytes, MVN) to C2Scene_Unk8604: an animation script for C2Scene_LabelTask's sprite...
$C2:5798C2Scene_ClearUnk862124verifiedZeroes the first C2Scene_Unk8621Bytes bytes of C2Scene_HdmaArea ($7E:8621-$8A20, up to C2Scene_HdmaValues): a zero word at the start, then an overlapping MVN.
$C2:57B0C2Scene_Unk57B018verifiedData with no reference found in the bank (no pointer to any of its bytes): 0, 1, 2, 3, 3, 4, 5, 6, 6, two zeros, then $F4 down to $D0 in steps of 6.
$C2:57C2C2Scene_Unk8600Init4verifiedC2Scene_Unk5775's source for C2Scene_Unk8600.
$C2:57C6C2Scene_Unk8604Init25verifiedC2Scene_Unk5775's source for C2Scene_Unk8604: a 0 word, $D0, then five groups $E0+2n,$01,$10+16n,$D0 (n = 0-4), and $EA,$01.
$C2:57DFTextWin_Init68verifiedStarts string TextWin_StrIndex: TextWin_TextPtr = the 16-bit entry TextWin_StrIndex of the table at TextWin_StrTable, in the table's bank; state 0 (TextWin_State), status TextWin_StatusStart...
$C2:5823TextWin_Step31verifiedOne step of the text box: TextWin_CheckStatus decides from TextWin_Status whether to go on (C=0); if so, the handler of TextWin_State in TextWin_StateTable runs.
$C2:5842TextWin_StateTable8verifiedTextWin_Step's handler for each TextWin_State (TextWin_State0-3).
$C2:584ATextWin_CheckStatus7verifiedJumps to TextWin_Status's handler in TextWin_StatusTable, which returns C=1 to skip this step's state handler (status 0, TextWin_StatusIdle) or C=0 to run it.
$C2:5851TextWin_StatusTable66verifiedTextWin_CheckStatus's handler for each TextWin_Status value $00-$20.
$C2:5893TextWin_StatusIdle2verifiedStatus 0: nothing to do; C=1 so TextWin_Step skips the state handler.
$C2:5895TextWin_StatusRun2verifiedTextWin_StatusRun: C=0, run the state handler.
$C2:5897TextWin_StatusPenLeft4verified
$C2:589BTextWin_StatusPenIndent23verified
$C2:58B2TextWin_State012verifiedState 0: reads the next string byte (TextWin_TextPtr + 1): - a glyph (TextWin_FirstGlyph or more): TextWin_State0_Draw puts it in TextWin_Glyph (16-bit, with B as the high byte: 0, or the prefix...
$C2:58BETextWin_State0_Draw69verified
$C2:5903TextWin_CodeTable66verifiedTextWin_State0's handler for each control code $00-$20 (Y = the code).
$C2:5945TextWin_CodeStatusArg10verifiedCode $03: the next string byte to TextWin_Code3Arg, then as TextWin_CodeSetStatus.
$C2:594FTextWin_CodeSetStatus4verified
$C2:5953TextWin_CodeNum850verifiedCode $0D: prints the byte at TextWin_Unk3D (which steps on by 1).
$C2:5985TextWin_CodeNum1667verifiedCode $0E: as TextWin_CodeNum8 for the 16-bit value at TextWin_Unk3D (steps on by 2): five decimal digits (TextWin_Dec16, TextWin_TrimZeros5), or four hex digits, high byte first.
$C2:59C8TextWin_CodeNum2452verifiedCode $0F: the 24-bit value at TextWin_Unk3D (steps on by 3) as eight decimal digits (TextWin_Dec24, TextWin_TrimZeros8); unlike codes $0D and $0E it ignores TextWin_NumHex.
$C2:59FCTextWin_StartDec21verified
$C2:5A11TextWin_StartHex21verified
$C2:5A26TextWin_CodeArgName38verifiedCode $11: the name whose TextWin_CharNamePtrs index is the byte at TextWin_Unk3D (which steps on by 1): TextWin_SubPtr at it in bank $7E, TextWin_SubLeft = its length (TextWin_CharNameLen), state...
$C2:5A4CTextWin_CodeExt62verifiedCode $12 and the next string byte b: b from TextWin_Code12Dict up is dictionary entry TextWin_Code12DictBase + (b - 8) (as TextWin_State0's dictionary bytes, also kept in TextWin_DictCode); below...
$C2:5A8ATextWin_ExtTable4verifiedTextWin_CodeExt's handler for b = 0 and 1.
$C2:5A8ETextWin_ExtTechName66verifiedCode $12 $00: name number (the byte at TextWin_Unk3D, which steps on) of TextWinRom_TechNames (TextWin_RomNameSize bytes each, by the multiplier): TextWin_SubLeft = its length up to the first...
$C2:5AD0TextWin_ExtEnemyName44verifiedCode $12 $01: name number (the byte at TextWin_Unk3D) of TextWinRom_EnemyNames, all TextWin_RomNameSize bytes of it (the padding is drawn too).
$C2:5AFCTextWin_StartSubName10verified
$C2:5B06TextWin_CodeWide14verifiedCodes $01 and $02 (TextWin_Wide1/2): the next string byte with the code as its high byte is a 16-bit glyph ($01xx or $02xx), drawn by TextWin_State0_Draw.
$C2:5B14TextWin_CodeNop1verifiedCode $10: nothing; the step ends.
$C2:5B15TextWin_CodeCharName38verifiedCodes TextWin_FirstCharName-$19: the name at TextWin_CharNamePtrs entry (code - $13), in bank $7E, its length by TextWin_CharNameLen, drawn in state TextWin_StateDict.
$C2:5B3BTextWin_CodeName027verifiedCode $1A: the first name at TextWin_CharNames (the one TextWin_CharNamePtrs entry 0 also points at), as TextWin_CodeCharName.
$C2:5B56TextWin_CodeNadia26verifiedCode $1E: the TextWin_StrNadiaLen glyphs at TextWin_StrNadia ($C2:6146, which spell "Nadia" with $A0 = "A", $BA = "a"), in state TextWin_StateDict.
$C2:5B70TextWin_CodeMemberName43verifiedCodes TextWin_FirstMemberName-$1D: the name of the character in party position (code - $1B): Party_Members gives the TextWin_CharNamePtrs index; then as TextWin_CodeCharName.
$C2:5B9BTextWin_CodeItemName59verifiedCode $1F: the name of item Treasure_ItemId (its low byte) in TextWinRom_ItemNames, from its second byte (the first is an icon), up to the first TextWin_NamePad (TextWin_NameLen10).
$C2:5BD6TextWin_CodeName731verifiedCode $20: the eighth name at TextWin_CharNames ($7E:2C4D, after the seven TextWin_CharNamePtrs points at), as TextWin_CodeCharName.
$C2:5BF5TextWin_State151verifiedState TextWin_StateDict: draws the next glyph of the sub-string at TextWin_SubPtr (a TextWin_Wide1/2 byte makes the next byte the low byte of a 16-bit glyph).
$C2:5C28TextWin_State1Next8verifiedTextWin_State1's exit by (sub-string left) + 2 * (steps left).
$C2:5C30TextWin_State1End2verified
$C2:5C32TextWin_State1Pause5verified
$C2:5C37TextWin_State1Resume5verified
$C2:5C3CTextWin_State1Loop2verified
$C2:5C3ETextWin_State235verifiedState TextWin_StateDec: draws the next decimal digit at TextWin_SubPtr as glyph TextWin_DigitGlyph0 + the digit, then exits as TextWin_State1 does (TextWin_State2Next).
$C2:5C61TextWin_State2Next8verifiedTextWin_State2's exit, as TextWin_State1Next.
$C2:5C69TextWin_State2End2verified
$C2:5C6BTextWin_State2Pause5verified
$C2:5C70TextWin_State2Resume5verified
$C2:5C75TextWin_State2Loop2verified
$C2:5C77TextWin_State351verifiedState TextWin_StateHex: the same code as TextWin_State1 (glyph bytes, with the two-byte prefixes) with its own exits (TextWin_State3Next); the hex digits TextWin_HexByte stored are drawn this way.
$C2:5CAATextWin_State3Next8verifiedTextWin_State3's exit, as TextWin_State1Next.
$C2:5CB2TextWin_State3End2verified
$C2:5CB4TextWin_State3Pause5verified
$C2:5CB9TextWin_State3Resume5verified
$C2:5CBETextWin_State3Loop2verified
$C2:5CC0TextWin_HexByte67verifiedAppends the two hex digit glyphs of TextWin_HexIn (high digit first, from TextWin_HexGlyphs) to TextWin_Digits at TextWin_HexPos, which goes up by one per glyph (by two for a TextWin_WideGlyphMin...
$C2:5D03TextWin_HexGlyphs32verifiedThe glyph of each hex digit 0-F (TextWin_HexByte): "0"-"9" are $D4-$DD, "A"-"F" $A0-$A5.
$C2:5D23TextWin_NameLen1017verifiedA = the number of bytes at TextWin_SubPtr before the first TextWin_NamePad, at most 10.
$C2:5D34TextWin_NameLen1117verifiedAs TextWin_NameLen10, at most 11 (a whole TextWinRom name).
$C2:5D45TextWin_CharNameLen17verifiedA = the number of bytes at TextWin_SubPtr before the first 0, at most TextWin_CharNameMax.
$C2:5D56TextWin_TrimZeros859verifiedDrops the leading zero digits of the 8 (5, 3) digits at TextWin_Digits, keeping at least one: while the first is 0, shifts the rest down one byte.
$C2:5D91TextWin_TrimZeros528verified
$C2:5DADTextWin_TrimZeros323verified
$C2:5DC4TextWin_DrawGlyph114verifiedDraws glyph TextWin_Glyph at TextWin_PenX into TextWin_GfxBuf and moves the pen on by the glyph's width: - TextWin_FontPtr = TextWinRom_Font + glyph * 24, TextWin_FontNibPtr = TextWinRom_FontRight...
$C2:5E36TextWin_Blit2bpp83verifiedDraws the glyph's 24 bytes with TextWin_Blit2bppRow, one per TextWin_GlyphRow: the first 8 (TextWin_GlyphTopPairs pairs) at TextWin_OutPtr on, then TextWin_OutPtr + TextWin_NextRow2bpp and the...
$C2:5E89TextWin_Blit2bppRow38verifiedOne glyph byte: A = byte TextWin_GlyphRow of TextWin_FontPtr in the high byte and of TextWin_FontNibPtr in the low (its high nibble for an even TextWin_GlyphLow, its low nibble moved up for an odd...
$C2:5EAFTextWin_Blit2bppShifts16verifiedTextWin_Blit2bppRow's entry for each pen shift 0-7.
$C2:5EBFTextWin_Blit2bppShr016verified
$C2:5ECFTextWin_Blit2bppShr41verified
$C2:5ED0TextWin_Blit2bppShr31verified
$C2:5ED1TextWin_Blit2bppShr21verified
$C2:5ED2TextWin_Blit2bppShr119verified
$C2:5EE5TextWin_Blit2bppShl33verified
$C2:5EE8TextWin_Blit2bppShl23verified
$C2:5EEBTextWin_Blit2bppShl128verified
$C2:5F07TextWin_Blit4bpp83verifiedAs TextWin_Blit2bpp with TextWin_Blit4bppRow and TextWin_NextRow4bpp: the second part goes $200 bytes on, and the tiles are TextWin_TileOfs4bpp's, $20 bytes apart (probably 4bpp tiles, the glyph...
$C2:5F5ATextWin_Blit4bppRow38verifiedTextWin_Blit2bppRow with the tile offsets of TextWin_TileOfs4bpp.
$C2:5F80TextWin_Blit4bppShifts16verifiedTextWin_Blit4bppRow's entry for each pen shift 0-7.
$C2:5F90TextWin_Blit4bppShr016verified
$C2:5FA0TextWin_Blit4bppShr41verified
$C2:5FA1TextWin_Blit4bppShr31verified
$C2:5FA2TextWin_Blit4bppShr21verified
$C2:5FA3TextWin_Blit4bppShr119verified
$C2:5FB6TextWin_Blit4bppShl33verified
$C2:5FB9TextWin_Blit4bppShl23verified
$C2:5FBCTextWin_Blit4bppShl128verified
$C2:5FD8TextWin_CharNamePtrs14verifiedThe 16-bit addresses (bank $7E) of the first 7 names at TextWin_CharNames, TextWin_CharNameSize bytes apart (codes $11 and $13-$19).
$C2:5FE6TextWin_TileOfs2bpp128verifiedTextWin_Blit2bppRow: the TextWin_GfxBuf offset of each 8-pixel tile column of the pen (index pen / 8; the glyph spans up to three, + 1 and + 2).
$C2:6066TextWin_TileOfs4bpp128verifiedAs TextWin_TileOfs2bpp for TextWin_Blit4bppRow, $20 bytes per tile: columns 0-15 from $000, 16-31 from $400, then $200 and $600.
$C2:60E6TextWin_GlyphWidths96verifiedThe pen advance in pixels of each glyph $A0-$FF (TextWin_DrawGlyph; index glyph - TextWin_FirstGlyph).
$C2:6146TextWin_StrNadia5verifiedGlyphs "Nadia" (TextWin_CodeNadia, code $1E).
$C2:614BTextWin_DivBits19verifiedOne decimal digit by shift and subtract: TextWin_DivQuot = A / divisor, A = the remainder, for a divisor that the caller put in TextWin_DivSub shifted left by Y - 1 (Y = the quotient bits).
$C2:615ETextWin_Dec834verifiedTextWin_NumValue's first byte as 3 decimal digits (0-9 each) at TextWin_DecDigits, most significant first (TextWin_DivBits by 100 and 10; the remainder is the last digit).
$C2:6180TextWin_Dec1661verifiedTextWin_NumValue's first word as 5 decimal digits at TextWin_DecDigits (TextWin_DivBits in 16 bits by 10000, 1000, 100 and 10; the remainder is the last digit, stored as a word...
$C2:61BDTextWin_Dec24116verifiedTextWin_NumValue's 24 bits as 8 decimal digits at TextWin_DecDigits (TextWin_Div24Bits by 10000000 ... 10; the last digit is what is left of TextWin_NumValue's first byte).
$C2:6231TextWin_Div24Bits50verifiedTextWin_DivBits for 24 bits, in place: TextWin_NumValue (3 bytes) is the value and becomes the remainder; TextWin_Div24Sub (3 bytes, shifted left by Y - 1) the divisor; TextWin_Div24Quot gets Y...
$C2:6263C2Scene_GetListAUnk0211verifiedC2Scene_Unk1B58 = .Unk02 of the ListA entry at offset C2Scene_Unk1B32.
$C2:626EC2Scene_GetListBScript24verifiedC2Scene_Unk1B45 = the C2Scene_ListD word (a script address in bank $7F) picked by .Script of the ListB entry at offset C2Scene_Unk1B32+2.
$C2:6286C2Scene_GetListCUnk0311verifiedC2Scene_Unk1B47 = the byte 3 past the start of the ListC entry at offset C2Scene_Unk1B32+4.
$C2:6291C2Scene_GetMapCell29verifiedA = the metatile number at column C2Scene_PropCol (0-95), row C2Scene_PropRow of the map at C2Scene_PropMap (byte row * 96 + column).
$C2:62AEC2Scene_GetTileProp63verifiedA = the property nibble of 8x8 tile C2Scene_PropCol (0-191), C2Scene_PropRow (0-127): the metatile at column / 2, row / 2 of the map at C2Scene_PropMap; its byte row bit 0 (byte metatile * 2 + row...
$C2:62EDC2Scene_GetSoundZone50verifiedReturns the 4-bit zone of metatile C2Scene_ZoneCol, C2Scene_ZoneRow from the zone map at the start of C2Scene_Unk7200 (bank $7E): byte row * 48 + column / 2 (the row product with the hardware...
$C2:631FC2Scene_MapView192verifiedMode 6's sub-program (inferred from what it builds; see the banner): BG mode 7, sprite tiles at VRAM $6000 (OBSEL), colour math adding the fixed colour on the backdrop only; clears VRAM, the VRAM...
$C2:63DFC2Scene_MapViewBuild33verifiedBuilds the mode-7 picture: unpacks the scene's BG graphics (C2Scene_LoadBgGfx) and takes one colour per tile from them (C2Scene_MapTileColors); then draws the pixels from layer 2's map...
$C2:6400C2Scene_MapTileColors83verifiedFor each of the C2Scene_MapTileCount 4bpp tiles in C2Scene_DecompBuf (32 bytes each: the seven BG packs), writes one byte to C2Scene_TileColors through WMDATA: the colour number (0-15) of the...
$C2:6453C2Scene_MapTilePixelBit9verifiedShifts bit 4 of the tile byte at C2Scene_TilePtr + Y (bank DB) into C2Scene_TileColor from the right: four ROLs bring bit 4 into the carry.
$C2:645CC2Scene_MapDrawPixels226verifiedDraws the mode-7 picture's tiles, a band of 8 pixel rows (4 metatile rows) at a time, in C2Scene_VramQBuf (C2Scene_VramQBufPtr, bank $7E): mode-7 tiles are 8 x 8 bytes, one byte per pixel, and the...
$C2:653EC2Scene_MapCellPixels80verifiedDraws one metatile cell as two pixels, at C2Scene_MapOut and 8 bytes (one pixel row) below: the colours (C2Scene_TileColors) of the metatile's top-right and bottom-right tiles, each ORed with that...
$C2:658EC2Scene_MapFilterColor36verifiedTurns some pixel colours (palette * 16 + colour) into 0, the transparent colour that shows the gradient: at Loc_Id C2Scene_MapLoc1F3 the colours $40-$4E; at any other location $0F, $2F and $24-$2B.
$C2:65B2C2Scene_MapBuildTilemap186verifiedWrites the mode-7 tilemap: a 32 x 32 tile block of bytes at C2Scene_VramQBuf, zeroed (tile 0: blank), with the picture's tiles 1-192 in 16 rows of 12 from column C2Scene_MapTileCol0, row...
$C2:666CC2Scene_TaskMapZoom9verifiedTask handler started by C2Scene_MapView: runs .State through C2Scene_MapZoomStates.
$C2:6675C2Scene_MapZoomStates8verifiedC2Scene_TaskMapZoom's handler for each .State.
$C2:667DC2Scene_MapZoomInit46verifiedState 0: .State = 1; the mode-7 centre at the leader's place in the picture: C2Scene_M7X = C2Scene_StartX / 16 + 16 (one pixel per 16-pixel metatile, the picture 2 tiles in) and C2Scene_M7Y =...
$C2:66ABC2Scene_MapZoomOut62verifiedState 1, once per frame: .DivA and .DivB = entry .Step of C2SceneRom_ZoomDivA/B ($FF/$7F down to $10/$08: the picture shrinks), .Step + 2; when it reaches $40 (all 32 entries used) .Step = $3E...
$C2:66E9C2Scene_MapZoomWait27verifiedState 2: when Pad_Unk00F6 has C2Scene_MapViewExitBtn (bit 3), .State = 3 and the script C2Scene_ScrMapViewExit starts.
$C2:6704C2Scene_MapZoomIn50verifiedState 3, once per frame: .DivA/.DivB = entry .Step of the tables, then .Step - 2, and the matrix: the zoom of C2Scene_MapZoomOut backwards (entries 31 down to 1).
$C2:6736C2Scene_MapZoomMatrix125verifiedSets the mode-7 matrix shadows from the task's .Angle, .DivA and .DivB: C2Scene_M7A = 8 cos / DivA, C2Scene_M7B = 8 sin / DivA, C2Scene_M7C = -8 sin / DivB, C2Scene_M7D = 8 cos / DivB (sine and...
$C2:67B3C2Scene_MapZoomDivide71verifiedThe four divisions of C2Scene_MapZoomMatrix on the hardware divider, each next dividend and divisor written while the previous division runs (NOPs pad the waits): C2Scene_ZoomA = Cos8 / DivA...
$C2:67FAC2Scene_TaskLeaderMarker65verifiedTask handler (started by C2Scene_ScrMapViewMarkers): a marker sprite at the leader's place on the zoomed-out picture.
$C2:683BC2Scene_TaskObjAMarker79verifiedTask handler (started by C2Scene_ScrMapViewMarkers): as C2Scene_TaskLeaderMarker for object A (C2Scene_ObjAX/Y), with C2Scene_AnimObjAMarker; but on the first call, unless Loc_Id AND...
$C2:688AC2Scene_MapMarkerPos25verifiedTurns the task's .SprX/.SprY (scene pixels) into the screen position on the zoomed-out picture: .SprX = .SprX / 8 + 32, .SprY = .SprY / 8 + 48 (the full zoom shows the picture's 1 x 2 pixels per...
$C2:68A3C2Scene_TaskLocMarker65verifiedTask handler (started by C2Scene_ScrMapViewMarkers): first call: .State = 1, .SprAttr = C2Scene_MapMarkerAttr, .SprX = the C2Scene_LocMarkerX word of this location (Loc_Id AND C2Scene_LocIdMask...
$C2:68E4C2Scene_LocMarkerX16verifiedC2Scene_TaskLocMarker's screen X for Loc_Id $1F0-$1F7 (index (location - Loc_FirstBankC2) * 2).
$C2:68F4C2Scene_MapViewGradient113verifiedSets up a blue gradient behind the picture: HDMA channel 1 in indirect mode writes COLDATA every line from C2Scene_HdmaTable record 0, two runs of 112 lines (C2Scene_MapGradRun: repeat flag and...
$C2:6965C2Scene_MapViewLabel139verifiedDraws a string into sprite tiles $20-$3F (VRAM C2Scene_MapLabelVram) with the text window code: clears the first $400 bytes of C2Scene_HdmaArea (C2Scene_ClearUnk8621) and uses them as the glyph...
$C2:69F0C2Scene_MapLabelStr8verifiedC2Scene_MapViewLabel's string number for Loc_Id $1F0-$1F7 (read as a word; only the low byte is kept).
$C2:69F8C2Scene_ScrMapViewStart7verifiedStarted by C2Scene_MapView: clears the task's fields, starts a mosaic shrink on BG1 and BG2 (op $2B, arg 1 = 3) at 2 frames per step and a fade in at 2 frames per step, ends.
$C2:69FFC2Scene_ScrMapViewExit11verifiedStarted by C2Scene_MapZoomWait: raises C2Scene_MapMarkersOff (the markers end), starts a mosaic grow on BG1 and BG2 at 2 frames per step, waits 8 frames, fades out at 2 frames per step, ends...
$C2:6A0AC2Scene_ScrMapViewMarkers14verifiedStarted by C2Scene_MapZoomOut when fully zoomed out: clears the task's fields, C2Scene_MapMarkersOff = 0, and starts the three marker tasks.
$C2:6A18C2Scene_AnimLeaderMarker8verifiedAnimation (C2Anim_Run) of C2Scene_TaskLeaderMarker: frame C2Scene_FrameMapMarkerA for 16 frames, nothing for 16, again: a blink.
$C2:6A20C2Scene_AnimObjAMarker10verifiedAnimation of C2Scene_TaskObjAMarker: 8 frames of nothing, frame C2Scene_FrameMapMarkerB for 16, 8 of nothing, again.
$C2:6A2AC2Scene_FrameMapMarkerA5verifiedSprite frame (C2Scene_SprDrawNode): one piece at (-4, -4), tile 0 (the first tile C2Scene_MapView loaded from C2SceneRom_MapMarkerTiles).
$C2:6A2FC2Scene_FrameMapMarkerB5verifiedThe same with tile 2 (the second marker tile).
$C2:6A34C2Scene_Dial148verifiedMode 8's sub-program: clears VRAM, the VRAM queue and the tasks; BG mode 7, OBSEL OBSEL_Size8And16_Base6000; BG1 scroll (C2Scene_DialBg1X, C2Scene_DialBg1Y), the BG2/BG3 scrolls, C2Scene_M7B, M7C...
$C2:6AC8C2Scene_TaskDial9verifiedTask handler started by C2Scene_DialLoad: runs .State through C2Scene_DialStates.
$C2:6AD1C2Scene_DialStates6verifiedC2Scene_TaskDial's handler for each .State.
$C2:6AD7C2Scene_DialInit135verifiedState 0: .State = 1; .Sel = the current location's entry (C2Scene_DialFindLoc).
$C2:6B5EC2Scene_DialInput182verifiedState 1: reads Pad_Unk00F8 as a word and tests, in this order (first match wins, so e.g. C2Scene_DialBtnFwd beats C2Scene_PadRight and C2Scene_PadUp): C2Scene_DialBtnBack (back)...
$C2:6C14C2Scene_DialTurn131verifiedState 2, once per frame.
$C2:6C97C2Scene_DialLocs14verifiedThe Loc_Id of each marker 0-6 (C2Scene_DialSelLoc, C2Scene_DialFindLoc).
$C2:6CA5C2Scene_DialLocsLate14verifiedThe list used once C2Scene_Flag0Copy is C2Scene_DialLateFlag or more: marker 5 is $01F6 instead of $01F4.
$C2:6CB3C2Scene_DialAngles14verifiedThe hand's angle (Trig_Sin1024 units, 1024 per turn) for marker 0-6.
$C2:6CC1C2Scene_DialDrawHand620verified
$C2:6F2DC2Scene_DialHandShape6verifiedThe hand's three points (dx, dy, signed bytes) about the centre at angle 0: the tip 40 pixels up, the base 4 pixels left and right.
$C2:6F33C2Scene_DialMul82verifiedSigned multiply: C2Scene_MulProduct (24-bit, $19-$1B) = the signed byte C2Scene_MulByte times the signed word C2Scene_MulWord, from the magnitudes on the hardware multiplier (low byte, then high...
$C2:6F85C2Scene_TaskSwirl9verifiedTask handler started by C2Scene_DialLoad: runs .State through C2Scene_SwirlStates (0: set up, 1: every frame after).
$C2:6F8EC2Scene_SwirlStates4verifiedC2Scene_TaskSwirl's handler for each .State.
$C2:6F92C2Scene_SwirlInit245verifiedState 0: .State = 1, .Angle = 0.
$C2:7087C2Scene_SwirlStep188verifiedState 1, every frame: toggles C2Scene_DialSwirlBuf and points C2Scene_HdmaValues 2-5 at the other pair of buffers (C2Scene_SwirlCosB/ SinB, or back to A); copies the shown pair one line up into it...
$C2:7143C2Scene_TaskDialMark9verifiedTask handler of the seven markers (C2Scene_DialLoad starts one per .Sel 0-6): runs .State through C2Scene_DialMarkStates.
$C2:714CC2Scene_DialMarkStates10verifiedC2Scene_TaskDialMark's handler for each .State.
$C2:7156C2Scene_DialMarkInit43verifiedState 0: .State = 1, .SprAttr = C2Scene_ObjAttrPrio3, .SprTile = 0, .SprX/.SprY = the bytes of C2Scene_DialMarkPos for .Sel (high bytes 0).
$C2:7181C2Scene_DialMarkHidden30verifiedState 1: nothing drawn until C2Scene_DialSel = .Sel; then .State = 2, the marker's select animation (C2Scene_DialMarkAnims, first byte) is started and run.
$C2:719FC2Scene_DialMarkSelect15verifiedState 2: runs the animation; once .AnimTimer is 0 at the start of a frame, .State = 3.
$C2:71AEC2Scene_DialMarkShown30verifiedState 3: runs the animation; when C2Scene_DialSel is no longer .Sel, .State = 4 and the deselect animation (C2Scene_DialMarkAnims, second byte) starts first.
$C2:71CCC2Scene_DialMarkDeselect17verifiedState 4: runs the animation; once .AnimTimer is 0 at the start of a frame, .State = 1 (hidden again).
$C2:71DDC2Scene_DialMarkPos14verifiedScreen X and Y (one byte each) of markers 0-6: around (C2Scene_DialCentreX, C2Scene_DialCentreY), marker 1 at the hand's tip for angle 0.
$C2:71EBC2Scene_DialMarkAnims14verifiedC2SceneRom_AnimTable numbers of markers 0-6: select, then deselect.
$C2:71F9C2Scene_DialUnpack39verifiedUnpacks entry C2Tmp_08 of C2Scene_DialPacks, its source in bank A, to bank $7F (Decomp_ToWramVec).
$C2:7220C2Scene_DialPacks12verifiedSource and destination (bank $7F) address of the three packs C2Scene_DialLoad unpacks (the source banks are its arguments).
$C2:722CC2Scene_DialUploadPixels40verifiedDMAs C2Scene_DialPixelBytes bytes of C2Scene_DecompBuf to VMDATAH from VRAM word 0: the pixels of mode-7 tiles 0-31.
$C2:7254C2Scene_DialUploadMap100verifiedDMAs the 32 rows of 32 words at C2Scene_DecompBuf (pack 2: tilemap low bytes, pixel high bytes) to VRAM 16 times, once at each C2Scene_DialMapBlocks address: a 4 x 4 grid of 32 x 32 blocks over...
$C2:72B8C2Scene_DialMapBlocks32verifiedVRAM word address of each 32 x 32 block of C2Scene_DialUploadMap.
$C2:72D8C2Scene_DialUploadObjTiles73verifiedFor each of C2Scene_DialObjLeft bytes of the list at C2Scene_DialList (24-bit, stepped on): DMAs 4bpp tile (byte) of the source at C2Scene_DialObjSrc (24-bit; tile * 32 added) to VRAM...
$C2:7321C2Scene_DialObjTileList64verifiedThe tiles of pack 0 that become sprite tiles 0-$3F (C2Scene_DialUploadObjTiles).
$C2:7361C2Scene_DialUnpackNibbles40verifiedSplits the C2Scene_DialNibbleBytes bytes at C2SceneRom_DialNibbles into two bytes each, high nibble first, written through WMDATA to C2Scene_DecompBuf: one byte per pixel, as mode-7 tiles take them.
$C2:7389C2Scene_DialLoad209verifiedLoads the dial and starts its tasks: - pack 0 (bank C2Scene_DialPack0Bank) into C2Scene_DecompBuf; its $800 bytes from C2Scene_DialObjSrcB to sprite tiles $40 on (VRAM C2Scene_DialObjVramB), and...
$C2:745AC2Scene_DialSelLoc32verifiedA = the Loc_Id word of marker .Sel (task X) in C2Scene_DialLocs, or in C2Scene_DialLocsLate once C2Scene_Flag0Copy is C2Scene_DialLateFlag or more.
$C2:747AC2Scene_DialFindLoc52verifiedA = the marker (0-6) whose location in the list C2Scene_DialSelLoc would use is Loc_Id AND C2Scene_LocIdMask; 6 when none is.
$C2:74AEC2Scene_ScrDialFadeIn5verifiedStarted last by C2Scene_DialLoad: fade in at 1 frame per step, wait 16 frames, end.
$C2:74B3C2Scene_ScrDialFadeOut5verifiedStarted by C2Scene_Dial when the mode changes: fade out at 1 frame per step, wait 16 frames, end.
$C2:74B8C2Scene_ScrDialCentre76verifiedStarted by C2Scene_DialLoad: a large sprite (.SprTile bit 14: C2Scene_SprTileLarge in the high byte) at (C2Scene_DialCentreX + 4, $60) with priority bits $30 and palette bits 8, animation $36...
$C2:7504C2Scene_ScrDialPalCycle73verifiedStarted by C2Scene_DialLoad: for good, palette 0 faded (12 frames per step) to the next of seven 32-byte rows of C2Scene_UnkC000 ($7E:C020 to $7E:C0C0, then $7E:C000), 384 frames apart.
$C2:754DC2Scene_PlaceBelowView40verifiedScript routine: puts the task at a random X 64-191 pixels into BG2's view (C2Scene_BgTileX+2 x 8 + a random 0-127 + 64) and 256 pixels below the view's top (C2Scene_BgTileY+2 + 32 tile rows, x 8)...
$C2:7575C2Scene_PlaceBelowViewAt17835verifiedScript routine: as C2Scene_PlaceBelowView, but X is pixel $178 (tile column C2Scene_PlaceFixedCol) + a random 0-255, not relative to the view; Y is again 256 pixels below the top of BG2's view.
$C2:7598C2Scene_RandomVelocity43verifiedScript routine: gives the task one of 16 velocities at random: the four words of entry (random AND 15) of C2SceneRom_RandVelocities go to .XVelFrac, .XVel, .YVelFrac and .YVel.
$C2:75C3C2Scene_TaskBg3Drift58verifiedTask handler (started by op $35 at $C3:8BBD): while object A is not in mode 8, counts frames in .Var22 and moves BG3 one pixel left every 4th frame and one pixel down every 8th; then adds the...
$C2:75FDC2Scene_TaskBg3DriftWave85verifiedTask handler (op $35 at $C3:980D, next to C2Scene_TaskBg3Wave's at $C3:9811): as C2Scene_TaskBg3Drift, but BG3 moves one pixel left and one down together every 4th frame, and the leader's Y move...
$C2:7652C2Scene_TaskBg3Wave176verifiedTask handler (op $35 at $C3:9811): a horizontal wave on BG3.
$C2:7702C2Scene_TaskBg3Slide87verifiedTask handler (op $35 at $C3:9F92): while object A is not in mode 8, moves BG3 by a fixed velocity, X about -3.46 and Y +2 pixels a frame (set into .XVelFrac-.YVel on the first frame, .State 0 ->...
$C2:7759C2Scene_TaskBg3LineWave153verifiedTask handler (no reference found; laid out as C2Scene_TaskBg3Wave): in forced blank only turns HDMA channel 1 off; waits while object A is in mode 8.
$C2:77F2C2Scene_TaskBg3SlideFast87verifiedTask handler (op $35 at $C3:AC92): C2Scene_TaskBg3Slide with the velocity X about -17.32 and Y -10 pixels a frame.
$C2:7849C2Scene_TaskBg1Pan23verifiedTask handler (no op $35 reference found): counts frames in .Var22 (8-bit) and every 4th frame scrolls layer 1 one pixel (C2Scene_Unk0568 with C2Scene_ScrollLayer = C2Scene_ScrollPx = 1), which...
$C2:7860C2Scene_ClearParty15verifiedScript routine: marks all three Party_Members slots empty (C2Scene_PartySlotEmpty).
$C2:786FC2Scene_SaveParty25verifiedScript routine: copies the three Party_Members bytes to C2Scene_PartySave (C2Scene_RestoreParty puts them back).
$C2:7888C2Scene_RestoreParty25verifiedScript routine: copies C2Scene_PartySave back to Party_Members.
$C2:78A1C2Scene_TaskInView66verifiedScript routine (op $34 at $C3:8E82, followed by an op $23 test of $0000): C2Tmp_00 = 1 when the task is in BG2's view with a margin, else 0.
$C2:78E3C2Scene_Win1Init46verifiedScript routine: sets up C2Scene_HdmaTable[0] (two runs of 112 lines) as HDMA channel 1 to WH0/WH1 (indirect, two registers), turns the channel on, zeroes the buffer toggle .Var24 and falls into...
$C2:7911C2Scene_Win1Step70verified
$C2:7957C2Scene_Win2Init42verifiedScript routine (op $34 at $C3:A937): sets up C2Scene_HdmaTable[1] (two runs of 112 lines) as HDMA channel 2 to WH2/WH3 (indirect, two registers) and turns the channel on.
$C2:7981C2Scene_Win2Step71verifiedScript routine (op $34 at $C3:A93E, right after C2Scene_Win2Init's): adds one to .Var24 and picks C2Scene_SwirlCosB (now odd) or C2Scene_SwirlCosA (even) as WinFx_TablePtr (bank $7E), has...
$C2:79C8C2Scene_AddGravity24verifiedScript routine: adds 1/8 pixel a frame (C2Scene_GravityFrac) to the task's Y velocity (.YVelFrac, carrying into .YVel).
$C2:79E0C2Scene_NudgeXRandom44verifiedScript routine (op $34 at $C3:B792 and $C3:CB7E): moves the task right by a random 0-48 pixels: a random byte x C2Scene_NudgeRange / 256 (WRMPYA/B), rounded up when the low byte of the product has...
$C2:7A0CC2Scene_RandPosA19verifiedScript routine: .SprX = $220 + a random 0-255, then falls into the sub-entry C2Scene_RandYA ($C2:7A1F): .SprY = $38 + a random 0-255.
$C2:7A1FC2Scene_RandYA18verified
$C2:7A31C2Scene_RandPosB19verifiedScript routine: as C2Scene_RandPosA with .SprX = $E0 + a random 0-255, falling into the sub-entry C2Scene_RandYB ($C2:7A44): .SprY = -$48 + a random 0-255.
$C2:7A44C2Scene_RandYB18verified
$C2:7A56C2Scene_NoiseInit89verifiedScript routine (op $34 at $C3:C953): sets up C2Scene_HdmaTable[0] (two runs of 112 lines) as both HDMA channel 1 to BG1HOFS and channel 2 to BG2HOFS (indirect, one register twice: both layers get...
$C2:7AAFC2Scene_NoiseStep43verifiedScript routine: moves both C2Scene_HdmaValues words 0-1 on by 32 lines (C2Scene_NoiseStep bytes), back to C2Scene_HandBufA when they reach its end ($8D16), so the screen shows the next part of the...
$C2:7ADAC2Scene_NoiseShow17verifiedScript routine (op $34 at $C3:CA30): points C2Scene_HdmaValues words 0-1 at C2Scene_HandBufA and its second half (the noise).
$C2:7AEBC2Scene_NoiseHide17verifiedScript routine (no reference found): points C2Scene_HdmaValues words 0-1 at C2Scene_HandBufB and its second half (every line the plain C2Scene_Bg1HScroll that C2Scene_NoiseInit stored).
$C2:7AFCC2Scene_UnpackBgPack36verifiedScript routine (op $34 at $C3:A130 and $C3:C16E): unpacks the C2SceneRom_BgPacks entry at byte offset C2Tmp_08 (entry x 3, a word set by the script) into C2Scene_DecompBuf.
$C2:7B20C2Scene_UnpackBg3MapPack36verifiedScript routine (op $34 in the unpacked C2SceneRom_ScriptPacks 2, $C3:9F41, at +$0286 and 6, $C3:BF7B, at +$027E, each a few ops after that pack's op $34 to C2Scene_UnpackBgPack; the bytes are...
$C2:7B44C2Scene_SetUnk7F00AABit011verifiedScript routine (op $34 at $C3:CCA3): sets bit 0 of C2Scene_Unk7F00AA (a byte of Menu_FlagBlock7F; what it means is not traced).
$C2:7B4FC2Scene_SetUnk7F019ABit311verifiedScript routine (op $34 at $C3:9238): sets bit 3 of C2Scene_Unk7F019A (Menu_FlagBlock7F; meaning not traced).
$C2:7B5AC2Scene_LoadExtraObjPack37verifiedUnpacks entry C2Scene_ExtraObjPack of C2SceneRom_ObjPacks into C2Scene_DecompBuf.
$C2:7B7FC2Scene_LoadExtraPalette32verifiedUnpacks entry C2Scene_ExtraPalPack of C2SceneRom_PalettePacks to A:X (C2Scene_LoadLocExtraGfx passes bank $00 and an address inside C2Scene_PaletteBuf).
$C2:7B9FC2Scene_LoadUnkC60037verifiedUnpacks entry C2Scene_UnkC600Pack of C2SceneRom_PalettePacks into C2Scene_UnkC600 ($7E:C600); what it holds is not traced.
$C2:7BC4C2Scene_TestUnk7F00F7Bit113verifiedScript routine (op $34 at $C3:98F4): C2Tmp_00 = 1 when bit 1 of C2Scene_Unk7F00F7 is set, else 0.
$C2:7BD1C2Scene_SetConfig1E7verifiedScript routine (op $34 at $C3:B665 and $C3:C669): Menu_Config1E (the byte LocLoad_AudioSetup keeps the music track in) = C2Tmp_00.
$C2:7BD8C2Scene_BuildPatternTiles80verifiedScript routine (no op $34 reference found): builds ten 4bpp tiles at C2Scene_PatternTiles ($7F:9000, the unpack buffer): zeroes the first eight ($100 bytes) and sets the two after them...
$C2:7C28C2Scene_PatternRows32verifiedBit plane 0 rows of the four tile pairs C2Scene_BuildPatternTiles builds, 8 rows per pair, sparse to full.
$C2:7C48C2Scene_SetUnk7F00CE7verifiedScript routine (no op $34 reference found): C2Scene_Unk7F00CE = C2Tmp_00.
$C2:7C4FC2Scene_SetUnk7F00DA7verifiedScript routine (op $34 at $C3:C448): C2Scene_Unk7F00DA = C2Tmp_00.
$C2:7C56C2Scene_Bg2HWaveInit65verifiedScript routine (op $34 at $C3:C18F): sets up C2Scene_HdmaTable[0] (two runs of 112 lines) as HDMA channel 1 to BG2HOFS (indirect, one register twice) and turns it on, zeroes the buffer toggle...
$C2:7C97C2Scene_Bg2VWaveInit65verifiedScript routine (no op $34 reference found): as C2Scene_Bg2HWaveInit for BG2VOFS: C2Scene_HdmaTable[1] as HDMA channel 2, zeroes .Var26 and $7E:9176-$7E:95D5 (C2Scene_SwirlCosA to the end of...
$C2:7CD8C2Scene_Bg2HWaveStep134verifiedScript routine (op $34 at $C3:C1A1, probably once a frame): one step of a wave that runs up BG2: adds one to .Var26 and, by its parity, shows C2Scene_HandBufA (now even) or C2Scene_HandBufB (odd)...
$C2:7D5EC2Scene_Bg2VWaveStep134verifiedScript routine (no op $34 reference found): C2Scene_Bg2HWaveStep for BG2VOFS: C2Scene_SwirlCosA (even) or C2Scene_SwirlCosB (odd) through C2Scene_HdmaValues words 2-3 (C2Scene_HdmaTable[1]).
$C2:7DE4BankC2_FreeSpace7DE4540verified$FF fill up to $C2:8000, where the menu part of the bank starts (BankC2_Entry8000).
$C2:8000BankC2_Entry80002verifiedThree BRAs, the bank's second set of fixed entry points, each reached by JSL from other banks: $8000 BankC2_Entry8000 → BankC2_MenuEntry (A = an argument chosen by the caller, 0-6: the menu) $8002...
$C2:8002BankC2_Entry80022verified
$C2:8004BankC2_Entry80042verified
$C2:8006BankC2_ReadPadLong4verifiedMenu_ReadPad as a long call (the BankC2_Entry8002 vector).
$C2:800ABankC2_CommandLong4verifiedMenu_RunCommand as a long call (the BankC2_Entry8004 vector).
$C2:800EBankC2_MenuEntry129verifiedThe menu (reached by BRA from BankC2_Entry8000).
$C2:808FMenu_EntryModes7verifiedMenu_Mode for each BankC2_MenuEntry argument 0-6 (an index into Menu_ModeLists).
$C2:8096Menu_InitSystems166verifiedThe menu's setup: DP=$0000; copies Menu_InterruptVectors (JML Menu_Nmi, JML Menu_Irq) over NmiTrampoline/IrqTrampoline ($0500-$0507; the MVN leaves DB=$7E); sends five sound-driver commands...
$C2:813CMenu_CalcUnk0D3846verified
$C2:816AMenu_BuildPartyLists38verifiedLists the characters of Menu_PartyOrder that are present (bit 7 clear) in Menu_PartyList, with their positions in Menu_PartyListPos, and counts them: Menu_PartyActive (positions 0-2) and...
$C2:8190Menu_RunThreads74verifiedThe menu's scheduler; never returns.
$C2:81DAMenu_RunThreadsNext60verified
$C2:8216Menu_ThreadEnd8verified
$C2:821EMenu_Yield13verified
$C2:822BMenu_YieldFrames11verified
$C2:8236Menu_YieldSave19verified
$C2:8249Menu_StartThread12verifiedPuts a new thread in the slot at byte offset X: .Entry = A, .State = new and .Wait = 1 (it starts on the scheduler's next pass).
$C2:8255Menu_KillThreads23verifiedFrees the slots whose bit is set in A's low byte (bit n: slot n).
$C2:826CMenu_MainThread3verifiedThread 1 (Menu_RunThreads starts it at the sub-entry Menu_MainThreadStart, $C2:826F): each frame calls handler Menu_ThreadVar of Menu_Mode's list in Menu_ModeLists (a list of 16-bit addresses in...
$C2:826FMenu_MainThreadStart34verified
$C2:8291Menu_ModeNone1verifiedAn RTS that Menu_ModeLists entries 8-10 point at as their list: read as a list it gives handler $CA60 for index 0, so modes 8-10 are probably not used.
$C2:8292Menu_ModeLists32verifiedOne 16-bit address (bank $C2) per Menu_Mode $00-$0F: the list of handler addresses Menu_MainThread indexes by Menu_ThreadVar.
$C2:82B2Menu_Exit47verifiedLeaves the menu back to the caller of BankC2_Entry8000: frees every thread (Menu_KillThreads), Menu_Unk834D, fades out (Menu_FadeOut), forced blank, NMI off (auto-joypad on), DMA and HDMA off, S =...
$C2:82E1Menu_Unk82E163verifiedZeroes Menu_Unk2857 (5 bytes), then for each of the 7 Menu_CharRecords whose Menu_CharRec.Unk2A is $AE-$B2: when the Menu_Unk04A4 byte of that value (- $AE) is non-zero, sets the Menu_Unk2857 byte...
$C2:8320Menu_ExitToGame15verifiedLeaves the menu for the game loop: frees every thread, Menu_Unk834D, fades out, then the sub-entry Menu_ExitRestart ($C2:832F; also BankC2_MenuEntry's new-game path): forced blank, NMI off...
$C2:832FMenu_ExitRestart30verified
$C2:834DMenu_Unk834D56verifiedFor each active party member (Menu_PartyOrder positions 0-2 not empty) copies the 6-byte bank-$D1 record of its weapon (Menu_WeaponRecSrc returns the MVN's source and the count - 1) into...
$C2:8385Menu_QueueVramRom9verifiedAppends the 8-byte VRAM upload (Menu_VramRec) at $C2:X to Menu_VramQueue (at Menu_VramQueueEnd, which then goes up by 8; Menu_FlushVramQueue sends them); the sub-entry Menu_QueueVramWram...
$C2:838EMenu_QueueVramWram7verified
$C2:8395Menu_QueueVramTail13verified
$C2:83A2Menu_VramQueueSlot16verifiedY = Menu_VramQueue + Menu_VramQueueEnd (the next record's address) and A = 7 (the MVN count of 8 bytes).
$C2:83B2Menu_StartFadeIn11verifiedStarts Menu_FadeInThread in slot 0.
$C2:83BDMenu_FadeInThread13verifiedThread: waits a frame, fades the brightness up by 2 a frame (Menu_Fade) and ends.
$C2:83CAMenu_FadeOut6verifiedMenu_Fade with a step of -2 (to black).
$C2:83D0Menu_Fade54verifiedFades the screen: Menu_FadeStep = A (signed), Menu_FadeFrames = 1; then repeatedly adds the step to Menu_InidispShadow's brightness (bits 0-3): past 0 or down to it the brightness is left at 0 and...
$C2:8406Menu_InterruptVectors8verifiedCopied over NmiTrampoline / IrqTrampoline ($0500-$0507) by Menu_InitSystems: JML Menu_Nmi and JML Menu_Irq, the menu's interrupt handlers.
$C2:840EMenu_Nmi100verifiedThe menu's NMI handler: saves DB, X, Y, P, then on its own stack (Menu_NmiStackTop; the old S kept in Menu_NmiSavedSp) A, D and P; DB = $00, DP = Menu_NmiDp.
$C2:8472Menu_Irq1verifiedThe menu's IRQ handler (through the JML at $C2:840A): returns at once.
$C2:8473Menu_NmiPad93verifiedThe menu NMI's pad step.
$C2:84D0Menu_RepeatDelays2verifiedMenu_PadRepeatDelay for Menu_RepeatStage 0 and 1.
$C2:84D2Menu_ReadPad26verifiedThe pad reader behind BankC2_Entry8002, run once a frame by the scene NMI and by other banks: reads joypad 1 (Menu_PollPad), maps it through the button configuration (Menu_MapButtons) and advances...
$C2:84ECMenu_PollPad89verifiedWaits for the auto-joypad read to finish and rebuilds the pad words from JOY1 (layout as Pad_Pressed: low byte A X L R B Y Select Start, high byte Up Down Left Right in bits 3-0)...
$C2:8545Menu_MapButtons16verifiedTurns the three pad words into the game's button bytes through the configured button map (Menu_ButtonMap, 8 masks in the Pad_Pressed layout Menu_PollPad builds, not JOY1's): bit n of the result is...
$C2:8555Menu_MapButtonsOne89verified
$C2:85AEMenu_TickPlayTime34verifiedAdds one frame to the play-time clock unless Menu_PlayTimePaused is set: Menu_PlayTime byte 0 counts up, and each byte that reaches its limit in Menu_PlayTimeLimits goes back to 0 and carries into...
$C2:85D0Menu_PlayTimeLimits6verifiedThe count at which each Menu_PlayTime byte wraps, lowest first: frames (60), seconds (60), minutes in two digits (10, then 6) and hours in two digits (10, 10).
$C2:85D6Menu_NmiUpload141verifiedThe menu NMI's frame upload (Menu_Nmi runs it with HDMA off when the menu loop has a frame ready): - BG1HOFS-BG3VOFS from the 12 bytes at Menu_ScrollShadow, each register written twice (low...
$C2:8663Menu_FlushVramQueue70verifiedSends Menu_VramQueue to VRAM, newest record first, each by DMA channel 7 to VMDATAL/H (two registers): VMADD = .Dest, from .SrcBank:.Src, .Size bytes (the direct page walks the records), then...
$C2:86A9Menu_UploadPalette52verifiedWhen Menu_PalDirty is non-zero: zeroes it and sends the 512 bytes of Menu_PalBuf ($7E:9480) to CGRAM from colour 0 by DMA channel 7.
$C2:86DDMenu_BuildGradient148verifiedBuilds an HDMA table of colour math lines for channel 0 (direct, two registers: CGADSUB then COLDATA, set here; the table address is set by the menu NMI from Menu_GradBufSel): copies...
$C2:8771Menu_GradientSteps32verified16 CGADSUB / COLDATA pairs for Menu_BuildGradient: add (CGADSUB $02: BG2) the fixed colour of intensity 8 down to 0 (COLDATA $E8-$E0, all three channels), then subtract ($82) intensity 1 up to 7.
$C2:8791Menu_AddItem60verifiedAdds Menu_ItemCount of item Menu_ItemId to the inventory: to its slot (Menu_FindItem) or else to the first empty one (id stored, count 0), the count capped at 99.
$C2:87CDMenu_ItemSetCount8verified
$C2:87D5Menu_RemoveItem37verifiedTakes Menu_ItemCount of item Menu_ItemId from its slot: A = Menu_ItemShort when it has fewer (nothing changed), Menu_InvFull when it is not there; else the new count is stored (Menu_ItemSetCount)...
$C2:87FAMenu_FindItem28verifiedFinds the slot of item A with a non-zero count: C=0 with X = the slot and Menu_ItemSlot = X (a word), or C=1 with X = 0 (all 256 slots looked at).
$C2:8816Menu_LoadCharRec10verifiedMenu_LoadCharRecA for character A, keeping P and X.
$C2:8820Menu_LoadPartyCharRec25verifiedLoads the character at Menu_PartyList[Menu_CurMember] (Menu_LoadCharRecA); Menu_CurIsReserve = $FF when that index is past the active members (Menu_PartyActive), else 0.
$C2:8839Menu_LoadCharRecA72verifiedCopies the Menu_CharRecords record of character A (A x $50) to Menu_CurCharRec (its address kept in Menu_CurCharRecPtr), then the 6-byte Menu_Unk2C23 entry of the record's first byte AND 7 to...
$C2:8881Menu_ItemCategory38verifiedThe category of item A by Menu_ItemCategoryBounds (0: below $5A, 1: $5A-$7A, 2: $7B-$93, 3: $94-$BB, 4: from $BC) into Menu_ItemCategory, and its index within the category (A - the category's...
$C2:88A7Menu_ItemCategoryBounds6verifiedThe first item id of categories 0-4, then the end of the ids ($F2, the slot count Menu_ListEquipItems scans; not read by Menu_ItemCategory).
$C2:88ADMenu_ItemDataPtrA43verifiedMenu_ItemCategory for item A, then X = Menu_ItemDataPtr = the address (bank $CC: the callers read the record with LDA $CC0000,X; only the pointer and size tables are in bank $FF) of the item's...
$C2:88D8Menu_ItemDataPtrB40verifiedAs Menu_ItemDataPtrA for the second set of per-category tables (MenuRom_ItemTablesB, MenuRom_ItemRecSizesB), using the Menu_ItemCategory / Menu_ItemIndex left by an earlier call; result in...
$C2:8900Menu_CountEquippedBy79verifiedFor each character of Menu_EquipChars (up to 7, stopping at the first with bit 7 set): Menu_EquipFlags[n] = 1 when the byte of its Menu_CharRecords record at the category's Menu_EquipSlotOffsets...
$C2:894FMenu_EquipSlotOffsets4verifiedThe Menu_CharRec offset of the equipped item of categories 0-3 ($29, $28, $27, $2A), as Menu_CountEquippedBy reads it (inferred from that use only).
$C2:8953Menu_ListEquipItems137verifiedLists the inventory items of Menu_ListKind's id range (Menu_EquipListRanges: 0 $00-$59, 1 $7B-$93, 2 $5A-$7A, 3 $94-$BB) that the current character can equip (Menu_CanEquip: A non-zero), from...
$C2:89DCMenu_EquipListRanges8verifiedFirst id and end id of each Menu_ListKind (Menu_ListEquipItems).
$C2:89E4Menu_StartCursorA14verifiedMenu_CursorYOfs = 0 and starts Menu_CursorThreadA in slot 6.
$C2:89F2Menu_CursorThreadA8verifiedThread: Menu_CursorStepA, wait a frame, for ever.
$C2:89FAMenu_CursorStepA55verifiedOne frame of cursor A: blinks (Menu_CursorBlink) and, in the shown phase, when row Menu_Unk0D9D - Menu_Unk0416 + Menu_CursorIndex is below 10 (probably the row on screen of a scrolled list), puts...
$C2:8A31Menu_StartCursorB20verifiedMenu_CursorTileAttr = Menu_Unk0772 and starts Menu_CursorThreadB in slot 6.
$C2:8A45Menu_CursorThreadB83verifiedThread: each frame blinks (Menu_CursorBlink) and, in its phase with bit 0 clear, puts sprite 0 at Menu_CursorIndex's Menu_CursorPos (X + 2; Y - 1) with Menu_CursorTileAttr.
$C2:8A98Menu_StartCursorC26verifiedMenu_BlinkMask = $FC, Menu_CursorTileAttr = Menu_Unk0772, and starts Menu_CursorThreadC in slot 6.
$C2:8AB2Menu_CursorThreadC8verifiedThread: Menu_CursorStepC, wait a frame, for ever.
$C2:8ABAMenu_CursorStepC27verifiedOne frame of cursor C: blinks with Menu_BlinkMask (Menu_CursorBlinkMasked) and, in its phase with bit 0 clear, puts sprite 0 at Menu_CursorIndex's Menu_CursorPos (X + 2, Y - 1) with...
$C2:8AD5Menu_StartCursorD32verifiedStarts Menu_CursorThreadD in slot 6 with the three blink timers at 3, 1 and 2 and Menu_CursorBlink = 2 (sprite 1 starts hidden).
$C2:8AF5Menu_CursorThreadD8verifiedThread: Menu_CursorStepD, wait a frame, for ever.
$C2:8AFDMenu_CursorStepD108verifiedOne frame of cursor D, one blinking cursor per active party member (Menu_PartyActive of them): tiles and attributes $3020 into all three sprites (and $20 into Menu_Unk0D9B); each of the three...
$C2:8B69Menu_CursorBlinkMasked5verifiedBlink timer 0: clears the bits of Menu_BlinkTimers[0] that A has set (Menu_CursorBlinkMasked passes Menu_BlinkMask; the sub-entry Menu_CursorBlink, $C2:8B6E, $FC, leaving a count 0-3), counts it...
$C2:8B6EMenu_CursorBlink23verified
$C2:8B85Menu_CursorPosAB14verifiedThe sprite position for cursor index A: with M=1, A = X + 2 and B = Y - 1 of its Menu_CursorPos record (X = the record offset, Menu_CursorRecOffset).
$C2:8B93Menu_StartListArrows19verifiedMenu_ArrowsOff = 0 and starts Menu_ListArrowsThread in slot 4.
$C2:8BA6Menu_Times418verifiedA = the low byte of A x 4, through the hardware multiplier (two XBAs and a NOP as the wait).
$C2:8BB8Menu_ListArrowsThread126verifiedThread (slot 4): each frame counts Menu_ArrowTimer (7..0) and toggles bit 0 of Menu_ArrowBlink when it wraps.
$C2:8C36Menu_RunCommand36verifiedRuns command A (Menu_CommandTable) with Menu_CmdChar = Y and Menu_ItemId = X (low bytes), stores its result A in Menu_CmdResult, runs Menu_Unk834D (for every command) and returns the result.
$C2:8C5AMenu_RunCommand_Return1verified
$C2:8C5BMenu_CommandTable26verifiedMenu_RunCommand's handlers by command number (BankC2Cmd_* in constants_engine.inc).
$C2:8C75Menu_CmdFindInParty4verifiedCommand 0: Menu_CmdFindListed over the 3 active positions only.
$C2:8C79Menu_CmdAddToParty26verifiedCommand 1: puts character Menu_CmdChar in the active party.
$C2:8C93Menu_CmdJoin15verifiedposition Y = Menu_CmdChar, and its bit in Menu_Unk29AF (BankFF_CharBits: $80 for character 0 ... $01 for 7) set; A = the character.
$C2:8CA2Menu_CmdPartyToReserve28verifiedCommand 2: when character Menu_CmdChar is in the active party, the members after it move up one, the third position is emptied (bit 7 set on the byte now there), and the character goes to the...
$C2:8CBEMenu_CmdPushReserve17verified
$C2:8CCFMenu_CmdFindListed2verifiedCommand 3: looks for character Menu_CmdChar in Menu_PartyOrder positions 0 to Menu_CmdLimit - 1 (all 9 here; 3 from the sub-entry Menu_CmdFindListed_Limit, A = the count, used by Menu_CmdFindInParty).
$C2:8CD1Menu_CmdFindListed_Limit20verified
$C2:8CE5Menu_CmdAddToReserve18verifiedCommand 4: unless character Menu_CmdChar is listed already, puts it in the first empty reserve position (Menu_CmdJoin, which also sets its Menu_Unk29AF bit); nothing when the reserve is full.
$C2:8CF7Menu_CmdUnlist14verifiedCommand 5: empties the Menu_PartyOrder position of character Menu_CmdChar (bit 7 set; nothing moves up).
$C2:8D05Menu_CmdRefillWord323verifiedCommand 6: Menu_RecRefillWord3 for each of the 7 Menu_CharRecords.
$C2:8D1CMenu_RecRefillWord341verifiedFor the Menu_CharRecords record at Y: word .Word3 = word .Word5 plus a bonus by .Unk2A ($A1: half of .Word5, $A0: a quarter, else none), capped at 999.
$C2:8D45Menu_CmdRefillByte730verifiedCommand 7: for each of the 7 Menu_CharRecords, byte .Word7 = byte .Word9 (low bytes only).
$C2:8D63Menu_CmdSetSram7FE27verifiedCommand 8: Menu_SramUnk7FE2 = $FF (BankC2_MenuEntry's new-game path zeroes it; meaning not traced).
$C2:8D6AMenu_CmdBootCheckSaves37verifiedCommand 9 (BankC2_BootArg, from GameLoop at boot): runs BankFF_UnkF9C4 for Menu_SaveSlot = 0, 1, 2 until one returns A = 0: the save-slot check (the slot's signature word and checksum in SRAM...
$C2:8D8FMenu_CmdEquip80verifiedCommand $0A: equipment of character record Menu_CmdChar (the Menu_CharRecords index), item Menu_ItemId: - id 0: the four equipment bytes (Menu_EquipSlotOffsets) get the "no item" ids of...
$C2:8DDFMenu_EquipNoneIds4verifiedthe "no item" id of categories 0-3.
$C2:8DE3Menu_CmdEquipItem59verifiedthe item path (Menu_ItemId non-zero).
$C2:8E1EMenu_CmdItemCount15verifiedCommand $0C: A = the count of item Menu_ItemId held (Menu_FindItem), 0 when there is none.
$C2:8E2DMenu_ApplyHeal85verifiedMenu_HealShown's six words = $FFFF (nothing to show); the amounts (Menu_CalcHealAmounts); then for member Menu_UseTarget, or with Menu_UseKind bit 3 every active member (Menu_PartyActive of them...
$C2:8E82Menu_HealHp41verifiedMember X / 2's HP amount (Menu_HealAmounts), or the record's .Unk3F (max HP) when Menu_UseAmountB bit 6 is set (the 16-bit BIT of Menu_UseAmountA: V = bit 14); at most 999; that goes to...
$C2:8EABMenu_HealMp33verifiedAs Menu_HealHp for MP: amount Menu_HealAmounts[3 + X / 2], or .Word9 (max MP) when full, to Menu_HealShown[3 + X / 2] (no cap), added to .Word7, at most .Word9.
$C2:8ECCMenu_CalcHealAmounts137verifiedThe six Menu_HealAmounts words (HP for members 0-2, then MP), with DB=$00 for the multiplier.
$C2:8F55Menu_UseHealOn23verifiedMenu_UseHealItem's confirm: Menu_ApplyHeal, colours $84-$87 = MenuRom_HealNumberPal, Menu_ShowHealNumbers.
$C2:8F6CMenu_ShowHealNumbers95verifiedShows the Menu_HealShown amounts over the members' sprites and waits for them: the digit tiles (BankFF_WidenTiles) queued (Menu_VramRecDigits); the palette flagged; Menu_HealCount and...
$C2:8FCBMenu_HealNumberHp36verifiedMember Menu_CurMember's HP amount (Menu_HealShown[member]), unless negative (none): its BCD (Menu_BinToBcd, 2 bytes) word to Menu_HealShown at Menu_Tmp00 (the packed index), Menu_HealParts = 1...
$C2:8FEFMenu_HealNumberMp39verifiedAs Menu_HealNumberHp for the MP amount (Menu_HealShown + 6, one byte to BCD), into Menu_HealShown + 6 at Menu_Tmp00, Menu_HealParts bit 1.
$C2:9016Menu_HealNumbersThread49verifiedThe thread of Menu_ShowHealNumbers (slot 7): with Menu_HealParts bit 0, the HP numbers (Menu_HealBounce from entry 0, 4 digits, values at Menu_HealShown) with sound 6 (Menu_PlaySfxNow); then with...
$C2:9047Menu_HealBounce76verifiedSound A (Menu_PlaySfxNow), then a frame at a time (a yield between): OAM high-table bytes $0908-$090A (entries 32-43) zeroed; the next byte of MenuRom_HealBounce (Menu_HealStep + 1) is the lift; a...
$C2:9093Menu_HealNumberSprites101verifiedPuts the BCD value Menu_NumBcd as digit sprites from OAM entry 32 + Y / 4 on, digit Menu_Tmp00 (the highest) down to 0: leading zeros (but not the ones digit) take an entry without writing it; at...
$C2:90F8Menu_HealNumberXOfs4verifiedBy the highest digit drawn (0-3): the first sprite's X offset, -4, -8, -12, -16 (the number centred on .ScreenX).
$C2:90FCMenu_StashInventory37verifiedWith Menu_Unk0D7E set: the inventory ($200 bytes, Menu_InvIds and Menu_InvCounts) is copied to Menu_InvStash and the ids are zeroed (the counts stay), so the item and equipment screens show none.
$C2:9121Menu_UnstashInventory22verifiedWith Menu_Unk0D7E set: Menu_InvStash is copied back over the inventory ($200 bytes).
$C2:9137Menu_CharRecalc55verifiedMenu_CharCalcStats; with accessory Menu_DoubleStat5Item, stat 5 is doubled (ASL); then the record's .Word3 = Menu_CurCharRec's (as capped by Menu_EquipStatCat3), and the 11 derived bytes...
$C2:916EMenu_CharCalcStats109verifiedMenu_StatBoosts, Menu_WeaponPower and Menu_ArmorSum ($0DAE-$0DB6) = 0; Menu_EquipSlotStats for slots 3, 2, 1, 0 (Menu_EquipSlotIdx); then for i = 6 down to 0, stat s = MenuRom_StatOrder[i]...
$C2:91DBMenu_AttackFormulas16verifiedThe attack formula by character (record byte 0 AND 7): A for 0, 3, 4, 6 and 7, B for 1 and 2, C for 5.
$C2:91EBMenu_AttackFormulaA56verifiedWRDIV = 5 x Menu_WeaponPower + 12 x stat 0; A = 9 (the divisor).
$C2:9223Menu_AttackFormulaB25verifiedWRDIV = 2 x (stat 4 + Menu_WeaponPower); A = 3.
$C2:923CMenu_AttackFormulaC37verifiedWRDIV = 16 x stat 0 + MenuRom_Char5Attack[record byte $12] (a word table; the doubled index is taken 8-bit); A = 9.
$C2:9261Menu_EquipSlotStats13verifiedAdds equipment slot Menu_EquipSlotIdx (0-3) to the sums through Menu_EquipStatTable.
$C2:926EMenu_EquipStatTable8verifiedMenu_EquipSlotStats' routine per slot: 0 the weapon byte (.Unk29), 1 .Unk28, 2 .Unk27, 3 the accessory (.Unk2A), the category order of Menu_EquipSlotOffsets.
$C2:9276Menu_EquipStatWeapon11verifiedMenu_WeaponPower = Menu_ItemSortKeys[weapon], then its boosts (Menu_AddItemBoosts, a branch).
$C2:9281Menu_EquipStatCat15verifiedX = the .Unk28 item, then Menu_EquipStatCat2's .add.
$C2:9286Menu_EquipStatCat215verifiedMenu_ArmorSum += Menu_ItemSortKeys[.Unk27 item] (from .add: the item in X), then its boosts (Menu_AddItemBoosts).
$C2:9295Menu_EquipStatCat344verifiedThe accessory: Menu_CurMaxHp = .Word5 + .Word5 / 2 (Menu_BonusHalfId) or / 4 (Menu_BonusQuarterId) or + 0, at most 999; .Word3 lowered to it when above; then the accessory's boosts (falls into...
$C2:92C1Menu_AddItemBoosts51verifiedFor item X: v = Menu_ItemInfo4[X]; when non-zero, the word MenuRom_ItemBoosts[v] gives in its low byte (bit 0 dropped) one bit per stat order entry from bit 7 down (MenuRom_StatOrder[i] for the...
$C2:92F4Menu_UnpackConfig91verifiedZeroes $0D86-$0D91, then splits the first three Menu_Config bytes into one variable per field: byte 0 bits 3-7 into Menu_CfgA3-A7 (0 or 1 each) and bits 0-2 into Menu_CfgALow; byte 1 bits 0-2 into...
$C2:934FMenu_PackConfig89verifiedThe reverse of Menu_UnpackConfig: Menu_Config byte 0 = Menu_CfgA7, A6, A5, A4, A3 (bit 0 of each) in bits 7-3 and Menu_CfgALow AND 7; byte 1 = Menu_CfgB7, B6 in bits 7-6, (Menu_CfgBMid AND 7) x 8...
$C2:93A8Menu_CanEquip23verifiedWhether the current character can equip item Menu_ItemId: A = Menu_ItemEquipChars[id] AND the character's BankFF_CharBits bit (the character id is the first byte of Menu_CurCharRec); non-zero = yes.
$C2:93BFMenu_PageScroll78verifiedPages a list on Menu_PadAction bits 1 (back) and 0 (on; bit 1 wins): the new top is Menu_PageTop - Menu_PageStep (no borrow test: a wrap is caught by the compare with Menu_PageMax, and the top...
$C2:940DMenu_InitPpuAndRam259verifiedPuts the PPU and CPU registers into the menu's starting state, then clears all of VRAM and most of bank $7E with DMA.
$C2:9510Menu_DmaZeroWord2verifiedthe fixed DMA source of Menu_InitPpuAndRam's VRAM clear and of Menu_DmaClearWram.
$C2:9512Menu_DmaClearWram48verifiedZeroes Y bytes of bank $7E from address X with DMA channel 0 (fixed source Menu_DmaZeroWord, one register: WMDATA).
$C2:9542Menu_DmaCopyFFToWram44verifiedCopies Y bytes from bank $FF (MenuRom_DmaCopyBank), address A, to bank $7E at address X with DMA channel 0 (stepping source, one register: WMDATA).
$C2:956EMenu_InitNewGameData77verifiedSets up the data of a new game (inferred from what it fills).
$C2:95BBMenu_ClearConfigAndFlags80verifiedZeroes Menu_FlagBlock7F ($7F:0000-$01FF), the page $7E:0400-$04FF (Menu_PlayTime and what follows) and Menu_Config ($2990-$29AF), then copies MenuRom_DefaultConfig (12 B) to Menu_Config and the 9...
$C2:960BMenu_Expand3bppTiles35verifiedExpands A 3bpp tiles (24 bytes: planes 0-1, then plane 2) from bank $FF at X to 4bpp tiles in bank $7E at Y: the 16 bytes of planes 0-1 are copied (MVN), then each plane-2 byte is stored with...
$C2:962EMenu_TilesOrPlane337verifiedFor Y 4bpp tiles from X: each row's plane 3 = planes 0 OR 1 OR 2, so every non-zero pixel gets colour + 8 (colours 1-7 become 9-15).
$C2:9653Menu_TilesOrPlanes2337verifiedFor Y 4bpp tiles from X: each row's planes 2 and 3 = planes 0 OR 1, so colours 1-3 become 13-15.
$C2:9678Menu_TileOrPlane221verifiedFor the 4bpp tile at X: each row's plane 2 = planes 0 OR 1 and plane 3 = 0 (one word store), so colours 1-3 become 5-7.
$C2:968DMenu_LoadGraphics445verifiedBuilds the menu's tiles in Menu_TileBuf / Menu_Bg3TileBuf and sends them to VRAM through Menu_VramQueue (forced blank: Menu_InitSystems runs it after Menu_InitPpuAndRam), then loads part of the...
$C2:984AMenu_ClearOam43verifiedHides every sprite of the OAM copy: all 128 low-table entries = X 0, Y $E0, tile 0, attributes $E0 (the word Menu_OamHidden, $E000, repeated) and the 32 high-table bytes = Menu_OamHighInit ($AA...
$C2:9875Menu_BuildItemTables275verifiedPrepares the menu's item and character data: - Menu_CleanInventory; - Menu_Unk0D7C/0D7E: 0, or $FFFF when Menu_Flag7F00BA has bit 0 set (0D7C) and also bit 1 clear (0D7E); Menu_Unk0D32/0D34 = 0...
$C2:9988Menu_CleanInventory42verifiedEmpties every inventory slot (id and count = 0) whose count is 0, or whose id is 0, a category's "no item" id ($5A, $7B, $94) or Menu_ItemIdEnd and above.
$C2:99B2Menu_RefreshAllChars24verifiedFor characters 0-6: Menu_LoadCharRec, then Menu_CharRecalc (the derived stats, written back to the record).
$C2:99CAMenu_Mode00List4verifiedMenu_ModeLists entry 0: the handlers Menu_MainThread runs by Menu_ThreadVar.
$C2:99CEMenu_MainMenuInit77verifiedHandler 0 of mode 0.
$C2:9A1BMenu_MainMenuLoop125verifiedHandler 1 of mode 0, every frame: Menu_CursorSel = Menu_MainSel, Menu_PadInput (the pad: it moves Menu_CursorSel and sets Menu_PadAction).
$C2:9A98Menu_ReturnToMainMenu21verifiedBack from a submenu to mode 0: Menu_Mode = 0, Menu_ThreadVar = 1 (Menu_MainMenuLoop), the threads of Menu_SubThreads killed, Menu_MainMenuRedraw, and a tail jump to Menu_PlaySound0.
$C2:9AADMenu_MainMenuMaps167verifiedBuilds two tilemaps in WRAM: a 16 x 6 window frame at Menu_MainFrame (tiles $3FA4-$3FAC: corners, edges and fill; row 1 copied to rows 2-4) and the background pattern of BG2 at Menu_Bg2Map (the 2...
$C2:9B54Menu_MainMenuPreview17verifiedThe preview of icon Menu_MainSel: its Menu_MainPreviewTable routine, then Menu_MainMenuIcons.
$C2:9B65Menu_MainPreviewTable12verifiedMenu_MainMenuPreview's routine per icon 0-5 (Menu_Icon0Preview to Menu_Icon3Preview for icons 0-3; Menu_UnkC9E5, the party order of mode 5, for icon 4 and Menu_UnkD065, the save slots of mode 6...
$C2:9B71Menu_MainMenuRedraw18verifiedRedraws mode 0 after a submenu: icon Menu_MainSel's Menu_MainRedrawTable routine, Menu_MainMenuIcons, then a tail jump to Menu_QueueVramRom with Menu_VramRecBg2B (VRAM $6040 = $7E:3E80, $680 bytes).
$C2:9B83Menu_MainRedrawTable12verifiedMenu_MainMenuRedraw's routine per icon 0-5 (Menu_Icon0Redraw to Menu_Icon3Redraw for icons 0-3; Menu_UnkCAE6 for icon 4 and Menu_UnkD0DB for icon 5).
$C2:9B8FMenu_MainMenuIcons79verifiedMenu_RunDrawList with MenuRom_MainIconList; Menu_HdmaenShadow |= Menu_MainHdmaBits (HDMA channels 0 and 1 and Menu_NmiMoveReq: the NMI copies Menu_NmiMoveSize = $1E bytes from $7E:9750 to...
$C2:9BDEMenu_MainIconSprites75verifiedOAM entries 0-5 = MenuRom_MainIconOam (the six icons), the selected icon's tile + $20; entries 6 and 7 = arrows (tile $22, Menu_ArrowAttr, the second flipped vertically) at the selected icon's X +...
$C2:9C29Menu_Mode01List8verifiedMenu_ModeLists entry $01: the handlers Menu_MainThread runs by Menu_ThreadVar (matched below).
$C2:9C31Menu_Mode01H08verifiedHandler 0: Menu_PlaySound0, Menu_ThreadVar + 1 (to handler 1) and a tail jump to Menu_Mode01Init.
$C2:9C39Menu_Mode01H155verifiedHandler 1, every frame: Menu_PadInput.
$C2:9C70Menu_Mode01H253verifiedHandler 2, every frame: Menu_PadInput.
$C2:9CA5Menu_Mode01H387verifiedHandler 3, every frame: Menu_PadInput.
$C2:9CFCMenu_EquipClearCharFlag27verifiedWith Menu_ListKind 0: the character id at Menu_PartyList[Menu_Unk0412] (the cursor row alone, not Menu_CurMember = row + Menu_Unk0413: with the list scrolled this is another member's id) gets its...
$C2:9D17Menu_MemberCursor68verifiedHandler 1's cursor: when the member list scrolls (Menu_MemberMaxTop non-zero), an edge move (Menu_CursorDpad bit 7) scrolls it a row (Menu_MemberListScroll).
$C2:9D5BMenu_MemberListScroll84verifiedScrolls the member list one row: without Down (an Up edge), Menu_Unk0413 - 1 unless it is 0, the new row drawn at $7E:3580, the rows copied to row $26, Menu_ScrollStep = -4, Menu_RowScrollWord =...
$C2:9DAFMenu_MemberScrollAnim199verifiedThe member list's row scroll: Menu_CurMember = Menu_CursorSel + Menu_Unk0413 is loaded and drawn at Menu_MapPtr (Menu_DrawMemberRow), its 6 x 12 tiles in both maps get attribute bit 4...
$C2:9E76Menu_HighlightMemberRow58verifiedFor the 3 member rows (6 x 12 tiles each from $7E:2E84, $180 bytes apart, and the same in the BG2 map): attribute bit 4 set (palette + 4, where Menu_Icon0Preview puts the dimmed colours) except on...
$C2:9EB0Menu_SetMemberRowAttr29verifiedMenu_SetRowsAttr on 6 rows of Y's low byte tiles from Menu_Tmp04, OR Y's high byte (attribute bits 4-7 cleared, then set), in the BG1 map and $1000 bytes on (the BG2 map); a tail jump for the second.
$C2:9ECDMenu_EquipSlotIdle56verifiedHandler 2's frame without confirm or cancel: Menu_DrawSlotName, Menu_MemberPageSwitch, Menu_PlaySound0 when Menu_CursorSel differs from Menu_Unk0FC5 (which takes it), Menu_HighlightSlot...
$C2:9F05Menu_EquipItemIdle217verifiedHandler 3's frame without confirm or cancel, on the item list (Menu_EquipList, top row Menu_EquipListTop).
$C2:9FDEMenu_ShiftItemListMap45verifiedMoves the item list's tilemap rows ($7E:4F80-$537F) by one item (two tile rows, $80 bytes) after a scroll: with Menu_ScrollStep positive (read as the high byte of the word at Menu_ScrollStep - 1)...
$C2:A00BMenu_MemberPageSwitch70verifiedOn Menu_PadAction's page bits: bit 1 the next member (Menu_Unk85 wraps to 0), bit 0 the one before (0 wraps to Menu_Unk85 - 1).
$C2:A051Menu_Icon0Preview150verifiedMenu_MainPreviewTable entry 0.
$C2:A0E7Menu_DimPalette26verifiedCopies colours 0-23 of Menu_PalBuf to Y at half brightness: each colour shifted right one bit with the bits that came down from the next channel masked off (AND $3DEF).
$C2:A101Menu_Icon0Redraw25verifiedMenu_MainRedrawTable entry 0: colours $70-$77 = MenuRom_Icon0RedrawPal, Menu_UnstashInventory, Menu_HdmaenShadow = Menu_Icon0HdmaBits.
$C2:A11AMenu_Mode01Init86verifiedMode 1's set-up (Menu_Mode01H0 jumps here): Menu_StashInventory; the tilemap $7E:3600-$3DFF zeroed; colours $70-$73 and $74-$77 both = the 4 colours at MenuRom_Mode01Pal; the draw list...
$C2:A170Menu_MemberArrows66verifiedThe list arrows of the member list, with DB=$00 for the multiplier and divider: nothing when Menu_MemberMaxTop is 0.
$C2:A1B2Menu_DrawMemberRows55verifiedDraws the member rows from Menu_Unk0413 on into the tilemap from $7E:2E00, 6 rows ($180 bytes) apart, until Menu_Unk85 members or 3 rows (the map address reaching $3280): Menu_DrawMemberRow for a...
$C2:A1E9Menu_DrawEmptyRow6verifiedRuns the draw list MenuRom_EmptyRowList (a tail jump).
$C2:A1EFMenu_MemberRowFlags39verifiedFor the loaded character (Menu_CurCharRec): Menu_Unk0D4D = its id (record byte 0 AND 7) OR $20; Menu_Unk0D5D = 4 when its Menu_Unk0D38 quotient is at least the record's word +3, else 0 (probably...
$C2:A216Menu_DrawMemberRow9verifiedMenu_MemberRowFlags, then the draw list MenuRom_MemberRowList (a tail jump).
$C2:A21FMenu_RedrawMember16verifiedMenu_DrawMemberStatus, then the member's row again at the top of the list map ($7E:2E00, Menu_DrawMemberRow).
$C2:A22FMenu_DrawMemberStatus68verifiedThe selected member: the clock (Menu_DrawClock at Menu_MainClockTile), Menu_CurMember = Menu_Unk0412 + Menu_Unk0413, Menu_LoadPartyCharRec and Menu_CharRecalc, the draw list MenuRom_StatusList...
$C2:A273Menu_DrawCharIcon83verifiedDraws a 6 x 2 tile block at $7E:2EEC / $7E:2F2C: the 12 tile words from MenuRom_CharIconTiles[e] on, e = Menu_CharIconIndex[the loaded character's id], and copies 16 colours from...
$C2:A2C6Menu_CharIconIndex7verifiedPer character id 0-6: the byte offset into MenuRom_CharIconTiles and MenuRom_CharIconPals (Menu_DrawCharIcon).
$C2:A2CDMenu_EquipSlotsClose84verifiedBack from handler 2 to handler 1: Menu_ScrollStep's low byte = 0, Menu_CursorSel = Menu_Unk0412, Menu_CurMember = it + Menu_Unk0413 and loaded (Menu_LoadPartyCharRec), Menu_DrawEquipNames (X =...
$C2:A321Menu_EquipSlotsOpen106verifiedFrom handler 1 to handler 2: the draw list MenuRom_SlotsOpenList, Menu_CurMember = Menu_Unk0412 + Menu_Unk0413 loaded and its row drawn at the top of the BG1 map ($7E:2E00, Menu_DrawMemberRow)...
$C2:A38BMenu_DrawSlotName47verifiedMenu_ListKind = Menu_CursorSel (the slot) and its name, Menu_EquipSlotNames[slot] (10 tiles, bank $C2), drawn at $7E:3086 with Menu_TextWord = 0 (Menu_DrawString); then the two tile rows at...
$C2:A3BAMenu_EquipSlotNames40verifiedThe four slot names, 10 bytes each in the menu's text encoding ($FF blank, $A0 'A', $BA 'a'): " Weapon ", " Helmet ", " Armor ", and "Accessory" followed by a 0 byte, which ends the string.
$C2:A3E2Menu_HighlightSlot11verifiedMenu_SetSlotRowsAttr from $7E:3062.
$C2:A3EDMenu_SetSlotRowsAttr45verifiedFor the 4 slot rows (two tile rows each, $80 bytes apart) from X: the attribute byte of 11 tiles in both tile rows (Menu_SetAttr2Rows) = $1C (palette 7) except on row Menu_ListKind (the selected...
$C2:A41AMenu_EquipItemsOpen67verifiedFrom handler 2 to handler 3: Menu_EquipItemsSlideIn, the draw list MenuRom_ItemsOpenList, Menu_VramRecBg2B queued, Menu_ArrowX/Y = $68 / $42, Menu_EquipListSetup, the NMI move Menu_ScrollBuild ->...
$C2:A45DMenu_EquipListRefresh6verifiedMenu_ArrowX/Y = $68 / $62, then falls into Menu_EquipListSetup.
$C2:A463Menu_EquipListSetup72verifiedThe item list of slot Menu_ListKind: Menu_ListEquipItems, WRDIVL/H = $1500 (the dividend of Menu_ListPageSetup's arrow factors), Menu_VramRecBg3 queued; Menu_EquipListTop = 0, Menu_Unk0D26 =...
$C2:A4ABMenu_EquipSlotRecOfs4verifiedPer slot (Menu_ListKind 0-3): the character record's byte that holds it (Menu_Unk0D26; Menu_Mode01H3 swaps that byte with the inventory).
$C2:A4AFMenu_EquipItemsSlideIn105verifiedHandler 2 to 3 (Menu_EquipItemsOpen): the draw list MenuRom_ItemsSlideInList; the 12 words at Menu_Unk5CC2 = Menu_ItemsSlideInWordA; the NMI move Menu_ScrollBuild -> Menu_Mode01HdmaTable...
$C2:A518Menu_EquipItemsSlideStep81verifiedOne frame of the item slides: Menu_SlideWordA += Menu_SlideStep and the 12 words at Menu_Unk5CC2 = it; Menu_SlideWordB += Menu_SlideStep and the 28 words from Menu_Unk5D42 = it...
$C2:A569Menu_DrawEquipList49verifiedDraws Menu_EquipPageRows (8) rows of the item list from entry Menu_EquipListTop of Menu_EquipList on, each with Menu_DrawEquipItem at Menu_EquipListMap ($7E:4FC6) + $80 per row (two tile rows).
$C2:A59AMenu_DrawEquipItem41verifiedDraws item Menu_ItemId at $7E:X with Menu_TextWord = Menu_ItemNameAttr (attribute byte $20) for the string: its name from Menu_ItemNamePtr, without the name's first byte (Y + 1, count 10 of the...
$C2:A5C3Menu_EquipPreviewItem36verifiedHandler 3's frame: the item under the cursor, Menu_EquipList[ Menu_EquipListTop + Menu_CursorSel - 4] (the list's first row is cursor record 4), goes to Menu_ItemId and into the slot's byte of...
$C2:A5E7Menu_EquipCompareStats91verifiedRecomputes the stats with the item tried on (Menu_CharCalcStats; stat 5 doubled with accessory Menu_DoubleStat5Item, as Menu_CharRecalc does), then compares each value with the one the record copy...
$C2:A642Menu_EquipCompareOfs11verifiedMenu_EquipCompareStats' order: Menu_CharRec offsets of attack, defence and stats 0, 2, 5, 3, 1, 4, 6 (.Derived + 7, + 8, + 0 ...); its loop reads the first 9.
$C2:A64DMenu_EquipItemsClose74verifiedBack from handler 3 to handler 2 (Menu_Mode01H3, after a confirm or a cancel): the selected member again (Menu_DrawMemberStatus, which reloads the record copy), Menu_CalcUnk0D38, the member's row...
$C2:A697Menu_EquipItemsSlideOut89verifiedThe reverse of Menu_EquipItemsSlideIn: the draw list MenuRom_ItemsSlideOutList; Menu_VramRecClock and Menu_VramRecBg2B queued; the NMI move Menu_ScrollBuild -> Menu_Mode01HdmaTable...
$C2:A6F0Menu_DrawEquipNames46verifiedThe names of the four equipped items of the record copy, in slot order (weapon .Unk29, .Unk27, .Unk28, accessory .Unk2A), one under the other from $7E:X, $80 bytes (two tile rows) apart...
$C2:A71EMenu_EquipSlotsSlideIn153verifiedHandler 1 to 2 (Menu_Mode01H1, before Menu_EquipSlotsOpen): the draw list MenuRom_SlotsSlideInList; the NMI move Menu_ScrollBuild -> Menu_EquipHdmaTable, Menu_Mode01HdmaBytesA bytes...
$C2:A7B7Menu_EquipSlotsSlideStep165verifiedOne frame of Menu_EquipSlotsSlideIn: the 12 words at Menu_Unk5CC2 = (word + 6) AND $1FF OR $6000, the 12 at Menu_Unk5D42 = (word + Menu_ScrollOfs) AND $1FF OR $6000.
$C2:A85CMenu_EquipSlotsSlideOut276verifiedHandler 2 back to 1 (Menu_Mode01H2, before Menu_EquipSlotsClose): a frame's wait; the draw list MenuRom_SlotsSlideOutList; the 12 words at $7E:3044 and at $7E:3084 (Menu_SlotsClearA/B, the slot...
$C2:A970Menu_EquipSlotsBackStep150verifiedOne frame of Menu_EquipSlotsSlideOut: the 12 words at Menu_Unk5CC2 = (word - 6) AND $1FF OR $6000, the 12 at Menu_Unk5D42 = (word - Menu_ScrollOfs) AND $1FF OR $6000; Menu_BandA + 6, and 6 off...
$C2:AA06Menu_MemberListHdma19verifiedMenu_EquipSlotsSlideOut's start table (copied to Menu_ScrollBuild): $10 lines of $FFFF, $30 lines of $01E0, three times $30 lines of $01D0 (the three member rows, 48 lines each), $10 lines of...
$C2:AA19Menu_PutHdmaEntry27verifiedWrites HDMA entries of A lines with the value Menu_Tmp00/01 through WMDATA (the caller has set WMADDL/H): one entry for A below $80; for A = $80-$FE two, A - $7F lines then $7F lines (a count byte...
$C2:AA34Menu_Mode02List12verifiedMenu_ModeLists entry $02: the handlers Menu_MainThread runs by Menu_ThreadVar (matched below: the item screen).
$C2:AA40Menu_Mode02H010verifiedHandler 0: Menu_PlaySound0, Menu_ThreadVar = 2 (handler 2, the list) and a tail jump to Menu_Mode02Init.
$C2:AA4AMenu_Mode02H160verifiedHandler 1, every frame, the row above the list: Menu_PadInput.
$C2:AA86Menu_Mode02H266verifiedHandler 2, every frame, the list: Menu_ItemsPicked = $FFFF (no slot picked), Menu_PadInput.
$C2:AAC8Menu_Mode02H3130verifiedHandler 3, every frame, with a slot picked (Menu_ItemsPicked): Menu_PadInput.
$C2:AB4AMenu_Mode02H424verifiedHandler 4, sort: Menu_SortInventory, a frame's wait, the list redrawn (Menu_DrawItemList), Menu_VramRecClock queued, Menu_CursorSel = $0A and Menu_ThreadVar = 1 (back to the row above the list).
$C2:AB62Menu_SortInventory135verifiedRebuilds the inventory sorted: Menu_SortHave (256 bytes) and Menu_SortCounts (256) zeroed, and $20 bytes from $7E:0F02 (after Menu_ItemsPicked; why is not traced); every slot's id is marked in...
$C2:ABE9Menu_SortGroup41verifiedAppends sort group X to the inventory at slot Y: the ids from Menu_SortGroupFirst[X] on, Menu_SortGroupCount[X] of them, that are marked in Menu_SortHave and lack Menu_ItemInfo0 bit 3, each with...
$C2:AC12Menu_SortGroupFirst5verifiedPer sort group 0-4: the first id.
$C2:AC17Menu_SortGroupCount6verifiedPer sort group 0-4: the number of ids.
$C2:AC1DMenu_Mode02H529verifiedHandler 5, the equipment info of Menu_ShowEquipInfo: Menu_CursorHold + 1 (the cursor does not move), Menu_PadInput; on confirm or cancel Menu_PlaySound0, Menu_HdmaenShadow bit 2 cleared (the...
$C2:AC3AMenu_ItemListCursor199verifiedHandlers 2 and 3 without confirm or cancel.
$C2:AD01Menu_ShiftInvListMap45verifiedMoves the item list's tilemap rows by one entry ($80 bytes, two tile rows) after a scroll: with Menu_ScrollStep positive (read as the high byte of the word at Menu_ScrollStep - 1), $7E:2F80-$347F...
$C2:AD2EMenu_ItemListSelect34verifiedThe slot under the list cursor: Menu_Unk0D26 = (Menu_ItemsTop + Menu_CursorSel) AND $FF (a word), Menu_Unk04CA = its count, Menu_ItemId = its id, and its description (Menu_DrawDescText).
$C2:AD50Menu_Icon1Preview115verifiedMenu_MainPreviewTable entry 1: the draw list MenuRom_Icon1List; Menu_TextWord = 0; Menu_Unk0D77 = $FF and Menu_Unk0D78 = $FF (the next Menu_DrawDescText draws); colours $50-$57 = MenuRom_Icon1PalA...
$C2:ADC3Menu_Icon1Redraw13verifiedMenu_MainRedrawTable entry 1: Menu_UnstashInventory, Menu_HdmaenShadow = Menu_Icon1HdmaBits.
$C2:ADD0Menu_Mode02Init80verifiedMode 2's set-up (Menu_Mode02H0 jumps here): Menu_StashInventory; the draw list MenuRom_Mode02List; Menu_ArrowX/Y = $E8 / $50, WRDIVL/H = Menu_ItemsArrowSpan; Menu_TextAttr = 0; the paging of the...
$C2:AE20Menu_RedrawCursorRow35verifiedRedraws the list row of Menu_ItemsCursor (Menu_DrawItemRow at Menu_InvListFirst + $80 x (Menu_ItemsCursor AND $0F)), with Menu_CursorSel = Menu_ItemsCursor for the call (the caller's word at...
$C2:AE43Menu_DrawItemList34verifiedDraws the ten list rows: Menu_DrawItemRow for Menu_CursorSel = 0 to 9 at Menu_InvListFirst + $80 x row; the caller's word at Menu_CursorSel is put back.
$C2:AE65Menu_DrawItemRow16verifiedMenu_DrawInvSlot for slot Menu_ItemsTop + Menu_CursorSel (an 8-bit sum) at $7E:X.
$C2:AE75Menu_DrawInvSlot28verifiedSlot Y: Menu_RowItemCount = its count and Menu_RowItemId = its id; an id with Menu_ItemInfo0 bit 1 (usable from the menu) gets Menu_TextAttr bit 3 set (palette + 2; Menu_DrawString clears the bit...
$C2:AE91Menu_ShowEquipInfo37verifiedThe equipment info of handler 5: Menu_ClearInfoRows, the characters who can equip Menu_ItemId (Menu_ListEquipChars), its value and label (Menu_EquipValueLabel), the draw list MenuRom_EquipInfoList...
$C2:AEB6Menu_ListEquipChars85verifiedMenu_EquipCharNames (42 bytes, seven 6-byte entries) zeroed, then for each character bit of Menu_ItemEquipChars[Menu_ItemId] AND Menu_Unk29AF (probably the recruited characters), from bit 7...
$C2:AF0BMenu_EquipValueLabel47verifiedMenu_InfoValue = Menu_ItemSortKeys[Menu_ItemId] (the weapon's power or the armour value); Menu_ItemCategory of the id (A is the word at Menu_ItemId: its low byte is used); the 11 bytes at bank $FF...
$C2:AF3AMenu_EquipLabelPtrs8verifiedPer item category 0-3: the bank-$FF address of the 11-byte label Menu_EquipValueLabel copies (categories 1 and 2 share one).
$C2:AF42Menu_UseTargetsOpen67verifiedOpens the member window of an item use: the draw list MenuRom_UseTargetsList; object 7 off (its .Id = $FF); Menu_SprResetChars; Menu_ClearInfoRows; Menu_VramRecBg3Rows62 queued; a frame's wait...
$C2:AF85Menu_HideCharSprites24verifiedSets bit 0 of .Flags18 of objects 0-6 (non-zero: Menu_SprThread does not place them).
$C2:AF9DMenu_ShowCharSprites24verifiedClears bit 0 of .Flags18 of objects 0-6 again.
$C2:AFB5Menu_ClearInfoRows56verifiedBG3 map rows 0-1 at Menu_Bg3TileBuf ($80 bytes) zeroed, then 14 words from column 15 of row 0 = Menu_InfoRowWordA and 14 from column 15 of row 1 = Menu_InfoRowWordB.
$C2:AFEDMenu_PlaceMemberSprites88verifiedThe member rows of the use window: Menu_TextWord = 0; for each active member (Menu_CurMember 0 up to Menu_PartyActive, stopping at one Menu_LoadPartyCharRec does not load, or when the word at...
$C2:B045Menu_MemberSprYX6verifiedPer member row 0-2: the word Menu_PlaceMemberSprites stores at .ScreenY: Y = $78, $A0, $C8 (40 lines apart), X low byte $E4.
$C2:B04BMenu_DrawInvEntry96verifiedOne inventory row at $7E:X: for id Menu_RowItemId 0, 24 blank bytes (Menu_Unk9B76's $FF) with Menu_DrawString after a PLP (a tail jump).
$C2:B0ABMenu_UseItem66verifiedUses item Menu_ItemId (category 4, Menu_ItemInfo0 bit 1): Menu_ItemCategory; Menu_UseKind = ((BattleRom_ItemTargetMode[index] + 1) AND 3) x 4 (bits 2-3; bit 3 = all members, as...
$C2:B0EDMenu_UseItemDone1verified
$C2:B0EEMenu_UseKindTable12verifiedMenu_UseItem's routine by Menu_FirstSetBit (bit 7, 6, 5, 4, 3, none).
$C2:B0FAMenu_FirstSetBit13verifiedX = 2 x the number of clear bits above the first set bit of A, testing bits 7 down to 3; X = $0A when none of them is set.
$C2:B107Menu_UseRandomItem6verifiedMenu_UseKindTable entry 3: Menu_RollRandomItem, then a tail jump to Menu_UseHealItem.
$C2:B10DMenu_RollRandomItem48verifiedPicks the random item's effect: r = RandomTable[Menu_NmiFrames] x 100 / 256 (0-99, the multiplier's high byte); the first Menu_RandomItemOdds entry above r gives the setter (Menu_RandomItemSets)...
$C2:B13DMenu_RandomItemOdds4verifiedMenu_RollRandomItem's bounds out of 100: 5, 20, 50 (and 100, not read).
$C2:B141Menu_RandomItemSets8verifiedMenu_RollRandomItem's setters: 5%, 15%, 30% and 50%.
$C2:B149Menu_RandomItemSetA11verifiedMenu_UseKind = $C2 (HP and MP), Menu_UseAmountB = $40 (full).
$C2:B154Menu_RandomItemSetB11verifiedMenu_UseKind = $82 (HP), Menu_UseAmountB = $40 (full).
$C2:B15FMenu_RandomItemSetC16verifiedMenu_UseKind = $41 (MP), Menu_UseAmountB = 3, Menu_UseAmountA = $8A (a fixed 10 x 3 = 30).
$C2:B16FMenu_RandomItemSetD16verifiedMenu_UseKind = $80 (HP), Menu_UseAmountB = 1, Menu_UseAmountA = $B2 (a fixed 50 x 1 = 50).
$C2:B17FMenu_UseHealItem12verifiedMenu_UseKindTable entry 0 (an HP / MP item): Menu_UseAmountA = $B2 (fixed, 50 per Menu_UseAmountB) with Menu_UseKind bit 7 (HP), else $8A (fixed, 10 per unit: MP).
$C2:B18BMenu_UseTargets60verified
$C2:B1C7Menu_UseLeave49verified
$C2:B1F8Menu_UseFullItem8verifiedMenu_UseKindTable entry 4: Menu_UseKind = $CA (HP, MP, all members) and a jump into Menu_UseHealItem's member loop (Menu_UseTargets); Menu_UseAmountA is not set here (Menu_CalcHealAmounts always...
$C2:B200Menu_UseStatItem74verifiedMenu_UseKindTable entry 5 (no effect bit): a stat item.
$C2:B24AMenu_StatTargetCursor43verifiedThe stat item's member cursor: a Menu_CursorSel off the member rows (Menu_CursorSel - Menu_UseRowFirst at least Menu_PartyActive) wraps: to the last row on Up (Menu_CursorDpad bit 3), else to the...
$C2:B275Menu_StatTargetCheck50verifiedMenu_Unk0DBC = 0; Menu_CurMember = Menu_CursorSel - Menu_UseRowFirst, Menu_PlaySound0 when it is not Menu_UseTarget (which takes it); the member loaded (Menu_LoadPartyCharRec); with Menu_UseKind...
$C2:B2A7Menu_ApplyStatItem111verifiedUses a stat item on member Menu_UseTarget: colours $84-$87 = MenuRom_Icon0Pal (the same 4 colours as icon 0's $24-$27); the six words at Menu_HealShown = $FFFF and the target's (Menu_UseTarget AND...
$C2:B316Menu_StatCountOfs6verifiedPer stat entry 1-6 (Menu_UseKind; read as Menu_StatCountOfs - 1 + X, so entry 0 would be the RTS before): the offset from record byte $2F (.StatCounts) of the count Menu_ApplyStatItem raises.
$C2:B31CMenu_AfterItemUse55verifiedAfter a use: one of the picked slot's item taken (Menu_ItemCount = 1, Menu_ItemId = Menu_InvIds[Menu_ItemsPicked]; for Menu_ItemRandom a new effect rolled first, Menu_RollRandomItem...
$C2:B353Menu_Mode03List10verifiedMenu_ModeLists entry $03: the handlers Menu_MainThread runs by Menu_ThreadVar (the tech screen, Menu_Mode03H0-H4).
$C2:B35DMenu_Mode03H08verifiedHandler 0: Menu_PlaySound0, Menu_ThreadVar + 1 (handler 1) and a tail jump to Menu_Mode03Init.
$C2:B365Menu_Mode03H18verifiedHandler 1: the draw list MenuRom_TechMembersList, Menu_ThreadVar + 1, and on into handler 2 (sub-entry Menu_Mode03H2, $C2:B36D), every frame, the member window: Menu_LastMember = Menu_Unk84 (the...
$C2:B36DMenu_Mode03H265verified
$C2:B3AEMenu_Mode03H3224verifiedHandler 3, every frame, the tech list: Menu_HdmaenShadow = Menu_TechHdmaBits, Menu_PadInput.
$C2:B48EMenu_Mode03H4139verifiedHandler 4, every frame, the target window: Menu_PadInput, Menu_TechTargetCursor.
$C2:B519Menu_TechCastLoops7verifiedPer character id 0-6 (object 7's .Id): the .LoopFrame Menu_Mode03H4 gives the caster's copy with .Anim Menu_TechCastAnim (the frame the looping animation goes back to, probably the end of the...
$C2:B520Menu_TechMemberCursor72verifiedHandler 2's frame without confirm or cancel: Left / Right (Menu_CursorDpad bits 1 / 0) step Menu_TechPage down / up, wrapping in 0-2; Menu_ListCursorEdge, then Menu_RepeatFast = 0 (STZ: the N of...
$C2:B568Menu_TechMemberScroll96verifiedScrolls the member window one row, as Menu_MemberListScroll does in mode 1: without Down (an Up edge) Menu_TechMemberTop - 1 unless it is 0, the incoming member's sprite row 3 (above the window...
$C2:B5C8Menu_TechMemberScrollAnim230verifiedThe member window's row scroll (mode 1's Menu_MemberScrollAnim, BG1 only): Menu_HdmaenShadow = Menu_TechScrollHdmaBits; the incoming member (Menu_TechMemberRow + Menu_TechMemberTop) loaded, its...
$C2:B6AEMenu_TechPageMark37verifiedThe page names' tiles: the 10 x 2 tiles at $7E:2EE4 get attribute byte $15, then the 2 x 2 at $7E:2EE4 + Menu_TechPage x 8 get $11 (Menu_SetAttr2Rows; probably the chosen page lit, the others dimmed).
$C2:B6D3Menu_TechListIdle92verifiedHandler 3's frame without confirm or cancel: the caster loaded.
$C2:B72FMenu_TechListScroll157verifiedScrolls the tech list a row (as Menu_EquipItemIdle does mode 1's item list) unless it is at that end: on row 0 with Menu_TechListTop 0, or on another row (the bottom one) with the top at...
$C2:B7CCMenu_TechShiftListMap87verifiedMoves the tech list's tilemap rows by one tech (two tile rows, $80 bytes) after a scroll, 11 tiles wide from column 18: with Menu_ScrollStep positive (read as the high byte of the word at...
$C2:B823Menu_TechTargetCursor27verifiedHandler 4's cursor: Menu_UseTargetCursor (as an item's), then the caster loaded again and Menu_Unk0DBC = 0 (nothing to do) when the caster's MP (record .Word7, low byte) is below Menu_TechUseCost.
$C2:B83EMenu_UseTargetCursor50verifiedThe member cursor of an HP / MP restore (an item's or a tech's): for a single target (Menu_UseKind bit 3 clear) a Menu_CursorSel off the member rows (Menu_CursorSel - Menu_UseRowFirst at least...
$C2:B870Menu_UseTargetCheck106verifiedMenu_Unk0DBC = 0; Menu_CurMember = Menu_CursorSel - Menu_UseRowFirst, Menu_PlaySound0 when it is not Menu_UseTarget (which takes it) and the target is single (Menu_UseKind bit 3 clear).
$C2:B8DAMenu_Icon2Preview134verifiedMenu_MainPreviewTable entry 2: the draw list MenuRom_Icon2List; Menu_TechMemberRow = 0 when it is not below Menu_PartyActive; Menu_LoadCharPalettes, a frame's wait, Menu_StartSprThread; the member...
$C2:B960Menu_Icon2Redraw25verifiedMenu_MainRedrawTable entry 2: Menu_HdmaenShadow = 1, Menu_StartSprThread, the draw list MenuRom_Icon2RedrawList, Menu_VramRecClock queued.
$C2:B979Menu_Mode03Init104verifiedMode 3's set-up (Menu_Mode03H0 jumps here): the draw list MenuRom_Mode03List; Menu_CursorSel = Menu_TechMemberRow + $0B (the member's row record); the palette flagged; Menu_Unk84 = $FF (so...
$C2:B9E1Menu_TechCasterSprite40verifiedObject 7 as the caster's copy in the list window: Menu_SprUploadMax = 2; the member (Menu_TechMemberRow + Menu_TechMemberTop) loaded; .Anim, .Kind and .Flags18 = 0, .ScreenY / .ScreenX low byte =...
$C2:BA09Menu_TechLoadCaster38verifiedObject 7's .TileAttr high byte (the palette) = that of the loaded character's own object (page Menu_Times64 of its id; the offset is read back from Menu_Unk0D2C); then, with DP = object 7's page...
$C2:BA2FMenu_TechDrawMemberRow32verifiedOne member row of the tech screen at Menu_MapPtr: Menu_MemberRowFlags; Menu_Unk0D5E = 4 when the loaded character's MP (record .Word7, low byte) is below Menu_TechCost's low byte, else 0 (probably...
$C2:BA4FMenu_TechDrawMembers173verifiedThe member window: Menu_SprResetChars, object 7's .Flags18 = $FF; rows = Menu_Unk85 (the members), at most 3, kept in Menu_TechRowsLeft; from member Menu_TechMemberTop, row by row (Menu_TechSprRow...
$C2:BAFCMenu_TechRowSprite30verifiedPuts the sprite object of character A (page Menu_Times64 of it) in member row Menu_TechSprRow: .Id = A, .Flags18 = 0, .ScreenX low byte = $1C, .ScreenY = Menu_TechRowSprY[Menu_TechSprRow].
$C2:BB1AMenu_TechRowSprY5verifiedPer Menu_TechSprRow: the .ScreenY of rows 0-2 ($38, $68, $98: 48 lines apart), 3 (above the window, $08) and 4 (below, $C8), the rows a member scrolls in from.
$C2:BB1FMenu_TechShowCost49verifiedThe list cursor's tech: Menu_TechPartners (Menu_TechId, the members it needs); its MP cost (Menu_TechMpCost, in Menu_TechCost) and the cost table index into Menu_TechCostIdx[0]; Menu_TextAttr = 4...
$C2:BB50Menu_TechListOpen60verifiedThe list window: WRDIVL/H = $1500; Menu_ListTop = Menu_TechListTop x 4; the paging of Menu_TechCount techs eight rows a page from cursor record 0 (Menu_ListPageSetup with Y = the word at...
$C2:BB8CMenu_TechDrawRows74verified
$C2:BBD6Menu_TechPartners76verifiedMenu_TechMembers[1-2] = $FF; Menu_SprResetChars; Menu_TechId = Menu_TechList[Menu_TechListRow + Menu_TechListTop] (the cursor's tech); the characters its Menu_TechShown byte needs...
$C2:BC22Menu_TechMpCost55verifiedThe MP cost of tech Menu_TechId for the loaded character: on page 0 (Menu_TechPage) X = the id; else (REP #$30) X = the byte at Menu_TechCostIdxs + 64 x (record byte 0 AND $0F, the character) +...
$C2:BC59Menu_TechCostCut22verifiedA = the MP cost in A's low byte as the loaded character's accessory (record .Unk2A) cuts it: $A2 halves it, $A3 halves it twice, each time rounded up (LSR, ADC #0); other accessories leave it...
$C2:BC6FMenu_TechPageCheck63verifiedA key of the member and page, (Menu_TechMemberRow + Menu_TechMemberTop) x 16 OR Menu_TechPage, compared with Menu_Unk84 (which takes it); nothing more when equal.
$C2:BCAEMenu_TechBuildList31verifiedMenu_TechList's first 24 bytes = $FF, then Menu_TechListBytes and Menu_TechListIds.
$C2:BCCDMenu_TechListBytes51verifiedLists in Menu_TechBytesList the tech bytes (Menu_TechShown indexes) of page Menu_TechPage (Menu_TechPages: the first byte and the count) whose MenuRom_TechByteMembers has the loaded character's...
$C2:BD00Menu_TechListIds64verifiedFor each byte n of Menu_TechBytesList (to the $FF): every set bit of Menu_TechShown[n], from bit 7, is one tech, numbered from Menu_TechFirstIds[n] up (the loop ends at Menu_TechFirstIds[n + 1])...
$C2:BD40Menu_TechFirstIds37verifiedPer tech byte 0-36 (Menu_TechShown): the id of the tech of its bit 7.
$C2:BD65Menu_TechPages6verifiedPer Menu_TechPage 0-2: the first tech byte and the count (bytes 0-6, 7-21 and 22-36: probably the single, double and triple techs).
$C2:BD6BMenu_TechDrawList46verifiedThe eight list rows from entry Menu_Tmp00 of Menu_TechList: each id goes to Menu_TechId and is drawn (Menu_TechDrawRow) at $7E:3024 on, $80 bytes a row.
$C2:BD99Menu_TechDrawRow25verifiedDraws list row Menu_TechId at $7E:X: its name (Menu_TechDrawName), or for $80 and up (the $FF after the list) 11 blank tiles: the string at Menu_Unk9B76 ($FF bytes) through Menu_DrawString, a tail...
$C2:BDB2Menu_TechDrawName57verifiedDraws the name of tech A (11 tiles at MenuRom_TechNames + 11 x A, by the hardware multiplier) at $7E:Menu_MapPtr, with Menu_TextAttr = $0C for a tech with Menu_TechInfo bit 6 (BankFF_UnkF813's...
$C2:BDEBMenu_TechNextMark22verifiedOn page 0, for a tech with Menu_TechInfo bit 6 (the one being learnt, probably), the draw list MenuRom_TechNextList.
$C2:BE01Menu_TechDescIfNew21verifiedMenu_TechDescText when Menu_TechId is not the string drawn last (Menu_Unk0D77) or Menu_Unk0D78 bit 7 is set (the same test is made again there).
$C2:BE16Menu_TechPageTitle29verifiedThe page's title string: Menu_HdmaenShadow = Menu_TechHdmaBits, Menu_TextDest = $5356, Menu_Unk0DC9 = $0A, string Menu_TechPage + $76 of the tech text table, through Menu_TechDescText's set-up...
$C2:BE33Menu_TechDescText17verifiedMenu_DrawDescText for the tech screen: Menu_TextDest = $5344, Menu_Unk0DC9 = 1, A = Menu_TechId; then (sub-entry Menu_TechTextSetup, $C2:BE44, also the tail of Menu_TechPageTitle) unless A is the...
$C2:BE44Menu_TechTextSetup53verified
$C2:BE79Menu_TechTargetsOpen85verifiedOpens (or, after a use, redraws) the target window of handler 4: the caster (Menu_TechMemberRow + Menu_TechMemberTop, a 16-bit store: the byte after Menu_CurMember = 0) loaded, its cost...
$C2:BECEMenu_VramRecTechRows7verifiedA Menu_VramRec: VRAM $5840 = $7E:2E80 (BG1 map rows 2-9), $200 bytes; its unused last byte is the first of Menu_VramRecTechLow.
$C2:BED5Menu_VramRecTechLow7verifiedA Menu_VramRec: VRAM $5C00 = $7E:3600 (the first half of what Menu_VramRecBg1Low sends), $400 bytes; its unused last byte is the PHP opcode of Menu_TechTargetRows.
$C2:BEDCMenu_TechTargetRows83verifiedThe target window's rows: for each active member from 0 (Menu_CurMember, stopping at one Menu_LoadPartyCharRec does not load, or when the word at Menu_Unk51, ORed into its result, is non-zero...
$C2:BF2FMenu_TechTargetSprYX6verifiedPer target row 0-2: the word Menu_TechTargetRows stores at .ScreenY: Y = $58, $78, $98 (32 lines apart), X low byte $E4.
$C2:BF35Menu_Mode04List8verifiedMenu_ModeLists entry $04: the handlers Menu_MainThread runs by Menu_ThreadVar (the settings screen, Menu_Mode04H0-H3).
$C2:BF3DMenu_Mode04H08verifiedHandler 0: Menu_PlaySound0, Menu_ThreadVar + 1 (handler 1) and a tail jump to Menu_Mode04Init.
$C2:BF45Menu_Mode04H140verifiedHandler 1, every frame, the entry list: Menu_HdmaenShadow = Menu_CfgHdmaBits, Menu_PadInput.
$C2:BF6DMenu_Mode04H250verifiedHandler 2, every frame, the button map: Menu_PadInput.
$C2:BF9FMenu_Mode04H353verifiedHandler 3, every frame, entry 7's choice of Menu_CfgCLow (cursor records $0C-$0F): Menu_PadInput.
$C2:BFD4Menu_CfgEntryRun43verifiedMenu_CfgCursor = Menu_CursorSel and that entry's Menu_CfgEntryTable routine (JSR (abs,X), with P saved around it); Menu_CfgPrevCursor = Menu_CfgCursor (which the routine may have changed); the...
$C2:BFFFMenu_CfgEntryTable24verifiedPer entry (cursor record) 0-11: the routine Menu_CfgEntryRun calls each frame the cursor is on it (with M=1, X=0).
$C2:C017Menu_CfgEntry033verifiedCursor entry 0: on a confirm Menu_CfgA3 = (it + 1) AND 1, also in Menu_CfgShown, and sound command $F3 with it as the argument (Audio_CmdId / Audio_CmdArg0, Audio_DriverCommand; probably the...
$C2:C038Menu_CfgEntry218verifiedCursor entry 2: on a confirm Menu_CfgA5 = (it + 1) AND 1, also in Menu_CfgShown+2.
$C2:C04AMenu_CfgEntry318verifiedCursor entry 3: on a confirm Menu_CfgB6 = (it + 1) AND 1, also in Menu_CfgShown+7.
$C2:C05CMenu_CfgEntry418verifiedCursor entry 4: on a confirm Menu_CfgB7 = (it + 1) AND 1, also in Menu_CfgShown+8.
$C2:C06EMenu_CfgEntry118verifiedCursor entry 1: on a confirm Menu_CfgA6 = (it + 1) AND 1, also in Menu_CfgShown+3.
$C2:C080Menu_CfgEntry721verifiedCursor entry 7: on a confirm Menu_CursorSel = Menu_CfgCLow + $0C (its record among $0C-$0F), Menu_CfgCLowOpen + 1 and Menu_ThreadVar = 3 (handler 3 picks the value).
$C2:C095Menu_CfgEntry918verifiedCursor entry 9: on a confirm Menu_CfgA7 = (it + 1) AND 1, also in Menu_CfgShown+9.
$C2:C0A7Menu_CfgEntry518verifiedCursor entry 5: on a confirm Menu_CursorSel and Menu_CfgCursor = $0A (entry 10) and Menu_CfgSubOpen = 1 (entries 10 and 11 lead back here).
$C2:C0B9Menu_CfgEntry1024verifiedCursor entry 10: Left / Right step Menu_CfgALow in 0-7 (Menu_CfgStepValue); confirm or cancel: Menu_CursorSel and Menu_CfgCursor = 5 (back to entry 5), Menu_CfgSubOpen = 0.
$C2:C0D1Menu_CfgEntry1124verifiedCursor entry 11: as entry 10 for Menu_CfgBMid.
$C2:C0E9Menu_CfgEntry867verifiedCursor entry 8, the button map switch: on a confirm Menu_CfgA4 = (it + 1) AND 1, also in Menu_CfgShown+1; when it becomes 1 the map opens.
$C2:C12CMenu_CfgEntry656verifiedCursor entry 6, the window style: while Menu_CfgStyleEdit is set, Left / Right step Menu_WinStyle in 0-7 (Menu_CfgStepValue), Menu_Unk0D47 = $0010 and the style's tiles and colours loaded...
$C2:C164Menu_CfgStepValue31verifiedWith Left or Right (Menu_CursorDpad bits 1 / 0) the byte at $7E:X goes down / up by 1, wrapping in 0-7; then the three selectors are redrawn (Menu_CfgDrawSelectors) and Menu_PlaySound0.
$C2:C183Menu_CfgMapCursor132verifiedHandler 2's frame without Left or cancel.
$C2:C207Menu_CfgMapButtons8verifiedThe buttons a map row cycles through, as Pad_Pressed bits: A, B, X, Y, R, L, Select, then $FF (the end).
$C2:C20FMenu_CfgMapAssign43verifiedGives map row Menu_CursorSel - $0F the button Menu_Tmp00: Menu_CfgMapEdit = Menu_CfgButtonMap again (9 bytes), Menu_Tmp04 = 0, Menu_CfgMapSet for the row; then Menu_CfgMapSet again for the entry...
$C2:C23AMenu_CfgMapSet50verifiedSets map entry Menu_CfgMapEntry[X] (X itself: the table is 0-7) of Menu_CfgMapEdit to Menu_Tmp00, with Menu_Tmp01 = that entry's old button in Menu_ButtonMap; then copies the entry's clash list (a...
$C2:C26CMenu_CfgMapSwap26verifiedFor the Menu_Tmp02 + 1 entries copied to Menu_ScrollBuild (from the last): an entry whose Menu_CfgMapEdit byte is Menu_Tmp00 (the new button) gets Menu_Tmp01 (the old one) and is kept in...
$C2:C286Menu_CfgMapFixPages55verifiedKeeps the page buttons R and L on map entries 6 and 7 unless rows 0-1 (Menu_CfgMapEdit entries 0 and 1, ORed) use them: entry 7 holding R becomes entry 6's button; without R in entries 0-1, entry...
$C2:C2BDMenu_CfgMapEntry8verifiedPer row 0-7: its Menu_CfgMapEdit / Menu_ButtonMap entry (the same number).
$C2:C2C5Menu_CfgMapClashPtrs14verifiedPer entry 0-6: the address of its clash list (see Menu_CfgMapSet).
$C2:C2D3Menu_CfgMapClash08verifiedThe clash lists: a count, then the map entries whose button the entry may take over (and so must give its old one): entry 0 all the others.
$C2:C2DBMenu_CfgMapClash17verified
$C2:C2E2Menu_CfgMapClash26verified
$C2:C2E8Menu_CfgMapClash34verified
$C2:C2ECMenu_CfgMapClash45verified
$C2:C2F1Menu_CfgMapClash56verified
$C2:C2F7Menu_CfgMapClash64verified
$C2:C2FBMenu_CfgMapClash74verified
$C2:C2FFMenu_Icon3Preview152verifiedMenu_MainPreviewTable entry 3: thread 3's .Wait + 1; the draw list MenuRom_Icon3List; the 14 words from Menu_Bg3TileBuf+$44 (row 1, tile 2 of a 32-tile map) = $21FF, then its tiles 14-15 = $21FB...
$C2:C397Menu_Icon3Redraw30verifiedMenu_MainRedrawTable entry 3: Menu_HdmaenShadow = Menu_Icon3HdmaBits, the entry icon's four tile words (Menu_CfgIconMap) zeroed, Menu_VramRecClock queued.
$C2:C3B5Menu_Mode04Init47verifiedMode 4's set-up (Menu_Mode04H0 jumps here): Menu_CursorSel and Menu_CursorMovedFrom = Menu_CfgCursor; the draw list MenuRom_Mode04List; Menu_Unk0D0E = $0189; Menu_Unk0D77 and Menu_Unk0D78 = $FF...
$C2:C3E4Menu_CfgDrawToggles55verifiedThe on / off marks: for n = 9 down to 0, a 2 x 2 block at the BG map address Menu_CfgToggleMaps[n] (tile words $1530-$1533 for 0, $1534-$1537 for 1) by bit 0 of Menu_CfgShown[n] EOR...
$C2:C41BMenu_CfgToggleMaps20verifiedPer Menu_CfgShown byte 0-9: the tilemap address of its mark.
$C2:C42FMenu_CfgToggleInvert11verifiedPer Menu_CfgShown byte 0-9: 1 shows that byte's 0 as the "1" mark (only Menu_CfgA3's); the last byte is only read as the high byte of entry 9's word.
$C2:C43AMenu_CfgCopyShown28verifiedMenu_CfgShown = the ten bytes Menu_CfgA3 ...
$C2:C456Menu_CfgDrawSelectors36verifiedThe three 0-7 selectors: Menu_CfgALow at $7E:2EA6, Menu_CfgBMid at $2F66, Menu_WinStyle at $2FE6, each through Menu_CfgDrawSelector (falling into it for the last): sub-entry Menu_CfgDrawSelector...
$C2:C47AMenu_CfgDrawSelector27verified
$C2:C495Menu_CfgDrawCLow39verifiedMenu_CfgCLow's row: the 9 x 2 tiles at $7E:3064 get attribute byte $0C, then the 3 x 2 at $3064 + 6 x (Menu_CfgCLow AND 3) get 0 (Menu_SetAttr2Rows; probably the chosen one lit).
$C2:C4BCMenu_CfgEntryIcon61verifiedThe cursor entry's icon and text: the 2 x 2 tile words at Menu_CfgIconMap from MenuRom_CfgIcons[Menu_CfgCursor] (the word, then + 1, + 2, + 3); Menu_Unk0DCE = Menu_CfgCursor and Menu_Unk0DCF =...
$C2:C4F9Menu_CfgEntryByte12verifiedPer entry 0-11: the offset from Menu_CfgA3 of its byte (entry 5's, $0B, is $0D91, and entry 11's, $0A, is $0D90 (Menu_CfgBMid): both past the ten).
$C2:C505Menu_CfgEntryStrBase12verifiedPer entry 0-11: the number added to its byte for Menu_Unk0DCF.
$C2:C511Menu_LoadWindowGfx55verifiedLoads the tiles of window style Menu_WinStyle (Menu_Config01 bits 0-2, copied by Menu_LoadGraphics): Menu_SprScratch = $3DC0 (use not traced; Menu_SprLoad uses the bytes as scratch)...
$C2:C548Menu_WindowVramRec7verifiedThe Menu_VramRec of Menu_LoadWindowGfx: VRAM $3DC0 = $7E:8800 (Menu_WinTileBuf), $280 bytes.
$C2:C54FMenu_UnkC54F43verifiedApplies and draws the button map: the local subroutine .select copies MenuRom_DefaultButtonMap (9 bytes, MVN count 8) to Menu_ButtonMap, then, when Menu_CfgA4 is non-zero, Menu_CfgButtonMap over...
$C2:C57AMenu_UnkC57A45verifiedDraws the button map's six rows from Menu_ButtonMap: for row n = 0-5 (Menu_Tmp00, 16-bit) the tile word of Menu_ButtonMap entry n's button (Menu_ButtonLetter) at Menu_CfgMapRowMap +...
$C2:C5A7Menu_CfgMapRowOfs12verifiedPer map row 0-5: the offset in Menu_CfgMapRowMap of its letter, two tile rows ($80 bytes) apart from tile row 13, column 26 on.
$C2:C5B3Menu_ButtonLetter20verifiedA = the tile word of the button in A's low byte: the highest set bit picks the entry of MenuRom_ButtonLetters (bit 7 entry 0, ... bit 1 entry 6: the font letters A, X, L, R, B, Y, S).
$C2:C5C7Menu_UnkC5C790verifiedMarks the map rows the edit changes: Menu_CfgMapOld = Menu_CfgButtonMap (8 bytes, MVN count 7), then the entry of the row under the cursor (Menu_CursorSel - Menu_CfgMapRecFirst) set to $FF there...
$C2:C621Menu_Mode05List6verifiedMenu_ModeLists entry $05: the handlers Menu_MainThread runs by Menu_ThreadVar (matched below: the party order; handler 2 is shared with mode 7).
$C2:C627Menu_Mode05H033verifiedHandler 0: with fewer than two rows to pick (Menu_XchgPartyCount + Menu_XchgReserveCount, as icon 4's preview left them) Menu_Mode = 0, Menu_ThreadVar + 1 (back to Menu_MainMenuLoop) and a tail...
$C2:C648Menu_XchgNextFree1verifiedMenu_CursorSel = the first row from X + 1 on (from X on for the sub-entry Menu_XchgFirstFree, $C2:C649, which the callers use) whose Menu_XchgRows entry has neither bit 7 (empty) nor bit 6...
$C2:C649Menu_XchgFirstFree20verified
$C2:C65DMenu_Mode05H123verifiedHandler 1, every frame, nothing picked yet: Menu_PadInput.
$C2:C674Menu_XchgPickFirst69verified
$C2:C6B9Menu_Mode05H246verifiedHandler 2 of modes 5 and 7, every frame, one row picked: Menu_PadInput; neither button as in handler 1.
$C2:C6E7Menu_XchgClearPicks37verified
$C2:C70CMenu_XchgSwap120verifiedSwaps the characters at positions Menu_XchgPick and Menu_XchgPick2 of Menu_PartyOrder (Menu_Tmp00 the go-between), Menu_BuildPartyLists, then swaps their 10 x 5 tile blocks (Menu_DrawCmdSwapBlocks...
$C2:C784Menu_XchgBlockPos34verifiedThe map position of row A's block: Menu_Tmp00 = the column (Menu_XchgPartyX for rows 0-2; Menu_XchgReserveX for rows 3 on, which count from 0 again; Menu_XchgAloneX when Menu_Unk0D36 is non-zero)...
$C2:C7A6Menu_Mode07List6verifiedMenu_ModeLists entry $07: the handlers Menu_MainThread runs by Menu_ThreadVar (matched below: the party order from BankC2_MenuEntry; handler 2 is mode 5's).
$C2:C7ACMenu_Mode07H052verifiedHandler 0: Menu_Unk0D36 (both bytes) = Menu_CurMember (the entry's X: non-zero shows only the party); Menu_XchgMusic; icon 4's preview (Menu_UnkC9E5); the cursor on the first row that can be...
$C2:C7E0Menu_Mode07H137verifiedHandler 1 of mode 7, every frame: Menu_PadInput; neither button as mode 5's handler 1.
$C2:C805Menu_XchgCursor86verifiedThe cursor step after Menu_PadInput: Menu_CursorYOfs = 0 (8-bit); with five reserve members or more and a move that hit an edge (Menu_CursorDpad bit 7) Menu_XchgEdge (the list scrolls).
$C2:C85BMenu_XchgEdge95verifiedA move off the shown reserve rows: after an Up move Menu_CursorSel = 3 (the top row) and, when Menu_Unk80 is non-zero, Menu_Unk80 - 1, Menu_CursorYOfs = Menu_XchgUpYOfs (-48), Menu_XchgScrollPos =...
$C2:C8BAMenu_XchgScroll143verifiedScrolls the reserve list by one member: Menu_CurMember = Menu_PartyActive + the reserve row coming in (Menu_CursorSel - 3 + Menu_Unk80; also in Menu_Tmp00), its record (Menu_LoadPartyCharRec) and...
$C2:C949Menu_XchgShiftSprites42verifiedFor each reserve row (Menu_XchgReserveCount down to 1): the object of its character (Menu_Times64 of the Menu_PartyOrder byte) gets .ScreenY - Menu_ScrollStep (8-bit) and .Anim = 0.
$C2:C973Menu_XchgPoses59verifiedThe sprites' poses: .Anim = Menu_XchgPoseStand for the characters at positions 8 down to 0 (Menu_Tmp00), Menu_XchgPoseCursor for the one at Menu_XchgCurEntry and, while Menu_XchgPick is set (bit 7...
$C2:C9AEMenu_XchgSkip55verifiedMoves the cursor off a row it cannot take.
$C2:C9E5Menu_UnkC9E5126verifiedMenu_MainPreviewTable entry 4 (also run by Menu_Mode07H0): thread 3's .Wait = 3; every object hidden (Menu_SprHideAll); the routine of Menu_XchgPreviewTable by Menu_Unk0D36 bit 1...
$C2:CA63Menu_XchgPreviewTable4verifiedMenu_UnkC9E5's routine by Menu_Unk0D36 bit 1: Menu_XchgPreviewA (clear), Menu_XchgPreviewB (set).
$C2:CA67Menu_XchgPreviewA114verifiedThe draw list MenuRom_XchgListA; Menu_MapPtr = Menu_XchgMap; string 4 of MenuRom_NameStrings (5 with Menu_Unk0D7C set) drawn 4bpp into Menu_TextGfxA (Menu_DrawText4bpp; TextWin_StrIndex, StrTable...
$C2:CAD9Menu_XchgTextVramRec7verifiedThe Menu_VramRec of Menu_XchgPreviewA: VRAM $1000 = Menu_TextGfxA ($7E:5E00), $1000 bytes.
$C2:CAE0Menu_XchgPreviewB6verifiedA tail jump to Menu_RunDrawList with MenuRom_XchgListB.
$C2:CAE6Menu_UnkCAE613verifiedMenu_MainRedrawTable entry 4: Menu_HdmaenShadow = Menu_XchgHdmaBits and Menu_StartSprThread.
$C2:CAF3Menu_XchgInit152verifiedThe screen of modes 5 and 7: the draw list MenuRom_XchgList; Menu_ClearOam; Menu_HdmaenShadow = Menu_XchgHdmaBits; Menu_Unk0D0E = Menu_XchgUnk0D0E; Menu_LoadCharPalettes; Menu_XchgDimLocked; the...
$C2:CB8BMenu_XchgMusic52verifiedMode 7's music: Menu_XchgMusicOn = 0; nothing more with Menu_Unk7F01CF bit 6 set.
$C2:CBBFMenu_XchgMusicThread44verifiedThread in slot 2 (Menu_XchgMusic starts it): yields until APUIO1 reads 0; then command Audio_Cmd14 with song Menu_XchgSongId and arguments $80, $80, then Audio_CmdUnk81 with $01, $FF, $FF...
$C2:CBEBMenu_XchgSendSound12verifiedSends the command already in Audio_CmdId / Audio_CmdArg0 with Audio_CmdArg1 = Audio_CmdArg2 = $80 (Audio_DriverCommand), then falls into the sub-entry Menu_XchgSound81 ($C2:CBF7): command...
$C2:CBF7Menu_XchgSound8123verified
$C2:CC0EMenu_XchgLeave65verifiedMode 7's exit: with Menu_XchgMusicOn set, Audio_CmdUnk81 with $08, $01, $01 (Menu_XchgSound81, as Menu_XchgMusic); Menu_FadeOut; then, with Menu_XchgMusicOn set, it yields until APUIO1 reads 0 and...
$C2:CC4FMenu_XchgDimLocked100verifiedDims the party rows 0-2 whose Menu_XchgRows entry has bit 7 or 6 set: sprite colours (Menu_XchgDimChar, see the quirk) and 6 map rows of its block, on Menu_XchgMap and on Menu_Bg2Map ($1000 on)...
$C2:CCB3Menu_XchgDimChar40verifiedHalves colours 1-15 of the sprite palette of the character at position A (A AND $BF: without the locked bit; nothing when bit 7 is set, which never happens from its caller): the 16-bit read at...
$C2:CCDBMenu_XchgPlaceSprites80verifiedDraws the rows and sprites of the members shown: the reserve rows first (Menu_XchgSprIdx from entry 3, Menu_XchgRowIdx from 0, Menu_CurMember = Menu_PartyActive + Menu_Unk80), each with...
$C2:CD2BMenu_XchgBuildRows112verifiedBuilds Menu_XchgRows: all nine bytes = Menu_XchgEmpty; Menu_XchgPartyCount = 0; for positions 0-2 of Menu_PartyOrder with a character, in order: + 1 to the count, and the entry = the position...
$C2:CD9BMenu_XchgAddSprite48verifiedOne member's row and sprite: Menu_LoadPartyCharRec (the character at Menu_PartyList[Menu_CurMember]); unless that had no character (its non-zero A, ORed with the Menu_Unk51 word, expected 0)...
$C2:CDCBMenu_XchgRowMaps24verifiedPer table entry 0-11 (Menu_XchgSprIdx / 2): the Menu_MapPtr of Menu_DrawMemberRow.
$C2:CDE3Menu_XchgPlaceAll71verifiedPlaces the shown members' sprites again (rows not drawn): Menu_XchgHideSprites; Menu_Tmp02 (the table entry x 2) from entry 0 (9 with only the party shown), Menu_Tmp00 (the row) from 0...
$C2:CE2AMenu_XchgHideSprites31verifiedObjects 6 down to 0: .Id = Menu_SprOff, .Anim = 0, .Flags18 = 0 (as Menu_SprHideAll, which also does object 7).
$C2:CE49Menu_XchgPlaceOne37verifiedPlaces the sprite of row Menu_Tmp00 (Menu_XchgRows entry; nothing for an empty one, bit 7): the character at the entry's position (AND Menu_XchgPosMask) gets .Id = the character and .ScreenY /...
$C2:CE6EMenu_XchgSprPos24verifiedPer table entry 0-11 (as Menu_XchgRowMaps): a sprite's .ScreenY (low byte) and .ScreenX's low byte (high byte).
$C2:CE86Menu_XchgScreenMap16verifiedBankFF_BuildScreenMap, Menu_XchgScreenVramRec queued, then a tail jump to Menu_QueueVramRom with Menu_VramRecBg3Full.
$C2:CE96Menu_XchgScreenVramRec7verifiedThe Menu_VramRec of Menu_XchgScreenMap: VRAM $7000 = $7E:B000 (BankFF_ScreenGfxDest), $600 bytes.
$C2:CE9DMenu_XchgStartWave37verifiedBG3SC = Menu_XchgBg3sc (written to the register, long); the Menu_WavePhase / Menu_WaveTick word = 0; Menu_XchgWaveThread started at Menu_XchgWaveStart in slot 2; the 12 bytes of...
$C2:CEC2Menu_XchgWaveThread12verifiedThread in slot 2, started at the sub-entry Menu_XchgWaveStart ($C2:CECE): BankFF_StepWave, then for ever: Menu_XchgWaveHdmaBit set in Menu_HdmaenShadow, two frames' wait (Menu_YieldFrames)...
$C2:CECEMenu_XchgWaveStart6verified
$C2:CED4Menu_Mode06List8verifiedMenu_ModeLists entry $06: the handlers Menu_MainThread runs by Menu_ThreadVar (matched below: the save screen; mode $0B shares handlers 2 and 3).
$C2:CEDCMenu_Mode06H033verifiedHandler 0: when bit 6 is set in the low byte of Menu_Unk0D34 ($FF when the menu was opened from a field location with bit 7 of Menu_Unk7F01CF clear) or in C2Scene_Unk0294, C2Scene_Unk0299 or...
$C2:CEFDMenu_Mode06H113verifiedHandler 1, every frame: Menu_PadInput.
$C2:CF0AMenu_Mode06H1Confirm23verified
$C2:CF21Menu_SaveRedraw15verified
$C2:CF30Menu_SaveSlotVramRec7verifiedThe Menu_VramRec of Menu_SaveRedraw: VRAM Menu_SlotTextVram ($7900) = Menu_SlotTextBufs ($7E:7000), $600 bytes (the three slots' text).
$C2:CF37Menu_SaveToSlot39verifiedSaves to slot Menu_SlotIdx: sound effect Menu_SaveSfx (Audio_CmdPlaySfx, Audio_CmdArg1 = Menu_SaveSfxArg; Audio_DriverCommand), Menu_SlotValid of the slot = $FF, BankFF_SaveSlot, a frame's wait...
$C2:CF5EMenu_Mode06Leave3verifiedHandler 1's cancel: a jump to Menu_ReturnToMainMenu.
$C2:CF61Menu_Mode06H239verifiedHandler 2 of modes 6 and $0B, every frame, the question over a slot that holds a save: Menu_PadInput; neither button: Menu_PlaySound0 when Menu_CursorSel is not Menu_Unk81.
$C2:CF88Menu_SaveAskBack10verified
$C2:CF92Menu_Mode06H316verifiedHandler 3 of modes 6 and $0B, every frame: Menu_Unk0D9B - 1 (the main cursor not drawn this frame), Menu_PadInput; either button: a branch to Menu_SaveAskBack.
$C2:CFA2Menu_UnkCFA289verifiedThe save screen's cursor step: Menu_SlotIdx = Menu_LoadHiliteRow = Menu_CursorSel (the slot; Menu_PlaySound0 when it differs from the previous one, the old Menu_LoadHiliteRow), the row's highlight...
$C2:CFFBMenu_UnkCFFB73verifiedThe highlight of row Menu_LoadHiliteRow, probably: Menu_SlotHiliteBuf = Menu_SlotHiliteData (33 bytes), Menu_ScrollBuild = Menu_ScrollSaved (16 bytes: the 3-byte entries of a line count and a...
$C2:D044Menu_SlotHiliteData33verifiedCopied to Menu_SlotHiliteBuf by Menu_UnkCFFB: 16 bytes $47, 16 bytes $C7, then $02 (the byte the highlighted entry points at).
$C2:D065Menu_UnkD065118verifiedMenu_MainPreviewTable entry 5 (also run by Menu_Mode0BH0): the load screen's draw list MenuRom_LoadList; the slot windows (Menu_DrawSlotWindows); Menu_VramRecUnkFC53 queued; the palette not...
$C2:D0DBMenu_UnkD0DB10verifiedMenu_MainRedrawTable entry 5: Menu_HdmaenShadow = Menu_SaveHdmaBits.
$C2:D0E5Menu_UnkD0E540verifiedThe save screen over icon 5's preview: Menu_CursorSel = Menu_LoadHiliteRow (the slot shown); the draw list MenuRom_SaveList; the palette flagged; Menu_HdmaenShadow = Menu_SaveHdmaBits; the row's...
$C2:D10DMenu_DrawSlotWindows36verifiedFor slots 0-2 (Menu_SlotIdx): Menu_DrawSlotWindow at Menu_MapPtr (from Menu_SlotWinMap, + $100: 4 rows, each time; the INC of its high byte is absolute, $0062, with DP $0000 and DB $7E the same...
$C2:D131Menu_DrawSlotWindow37verifiedSlot Menu_SlotIdx's window at Menu_MapPtr: its label, 2 tile words (and the row below) from attribute Menu_SlotLabelAttr and tile 2 x slot + 1 (Menu_PutTextTilesAttr); 7 tiles on (X + 10 after the...
$C2:D156Menu_LoadSlotSummaries66verifiedMenu_SlotWinStyle (3 bytes) = 0, Menu_Unk0D4C = $FF, then for slots 0-2 (Menu_SlotIdx): Menu_SlotValid[slot] = 0; BankFF_UnkF9C4; when it leaves Menu_Tmp00 = 0 the slot is valid (Menu_SlotValid =...
$C2:D198Menu_SlotLabelVramRec7verifiedMenu_VramRec: VRAM $7000 = $7E:6E00 ($200 bytes: the slot labels of Menu_DrawSlotLabel).
$C2:D19FMenu_ReadSlotSummary199verifiedCopies what the slot screen shows of slot Menu_SlotIdx from SRAM into its Menu_SlotSummaries block ($40 bytes at $7E:7600 + slot x $40).
$C2:D266Menu_SlotLocName39verifiedMenu_SlotWinStyle[slot] = the SRAM byte at +$0591 AND 7, probably the slot's copy of Menu_Config01 ($7E:2991; inferred: +$0591 is where it falls if the slot copies $7E:2400 on, as the records at...
$C2:D28DMenu_DrawEmptySlot9verifiedString Menu_StrEmptySlot, then falls into Menu_DrawSlotText.
$C2:D296Menu_DrawSlotText46verifiedDraws string TextWin_StrIndex of MenuRom_SlotStrings into slot Menu_SlotIdx's text buffer (Menu_TextDest = $7E:7000 + slot x $200, cleared first: $200 bytes) with Menu_DrawText.
$C2:D2C4Menu_DrawSlotLabel66verifiedDraws string Menu_StrSlotLabel0 + slot of MenuRom_SlotLabelStrings at Menu_SlotLabelFirst ($7E:6E10) + slot x $20 (Menu_DrawText), then shifts it right by 2 pixels Menu_SlotLabelShifts[slot] times...
$C2:D306Menu_ShiftLabelRight35verifiedShifts the 2bpp text at Menu_TextDest right by 2 pixels: two tiles side by side (+0 and +$10), and the same for the row of tiles below (+$100 and +$110); bits leave the second tile on the right.
$C2:D329Menu_SlotLabelShifts3verifiedTimes Menu_DrawSlotLabel shifts each slot's label right by 2 pixels.
$C2:D32CMenu_UnkD32C64verifiedSlot Menu_SlotIdx's window: Menu_WinStyle = its Menu_SlotWinStyle; Menu_DrawAddr = Menu_SlotWinMapA + slot x $100; a window of Menu_SlotWinSize (24 x 4 tiles) in that style and its palette row...
$C2:D36CMenu_UnkD36C243verifiedThe details of slot Menu_SlotIdx: Menu_Unk0D5D's low byte = 0 (8-bit STZ); nothing more for row 3 or a slot without a save (Menu_SlotValid 0).
$C2:D45FMenu_SlotEraVramRec7verifiedThe Menu_VramRec of Menu_UnkD36C: VRAM $7808 = Menu_TextGfxA ($7E:5E00), $1F0 bytes.
$C2:D466Menu_SlotMemberIcon78verifiedA 2 x 2 tile icon for character Menu_Tmp00 (slot member Menu_SlotMemberIdx) at Menu_MapPtr + Menu_SlotIconOfs: the attribute bytes = member x 4 OR Menu_SlotIconAttr (tile bit 8 and palette 4 +...
$C2:D4B4Menu_SlotIconTiles7verifiedPer character 0-6: the first of its icon's 4 tiles (with tile bit 8 from the attribute: tiles $1E0-$1FB).
$C2:D4BBMenu_SaveAskOpen26verifiedThe overwrite question: Menu_CursorSel = Menu_SaveRecYes, the draw list MenuRom_SaveAskList, Menu_HdmaenShadow = Menu_SaveAskHdmaBits, Menu_VramRecBg2B queued.
$C2:D4D5Menu_SaveAskClose27verifiedCloses the question: the load screen's close list MenuRom_LoadAskClose, Menu_HdmaenShadow = Menu_SaveHdmaBitsB, Menu_CursorSel = Menu_LoadSavedRow (the slot's row again), Menu_VramRecBg2B queued.
$C2:D4F0Menu_Mode0BList8verifiedMenu_ModeLists entry $0B: the handlers Menu_MainThread runs by Menu_ThreadVar (matched below; handlers 2 and 3 are mode 6's, named after it).
$C2:D4F8Menu_Mode0BH014verifiedHandler 0: the main menu's tilemaps (Menu_MainMenuMaps), mode 6's preview (Menu_UnkD065: the slot windows and the last saved slot's details) and the save screen over it (Menu_UnkD0E5), then...
$C2:D506Menu_Mode0BH119verifiedHandler 1, every frame: Menu_PadInput.
$C2:D519Menu_Mode0CList18verifiedMenu_ModeLists entry $0C: the handlers Menu_MainThread runs by Menu_ThreadVar (matched below: the shop).
$C2:D52BMenu_Mode0CH027verifiedHandler 0: the shop's set-up (Menu_ShopInit); cursor C (Menu_StartCursorC) on record Menu_ShopRecCursorC with Menu_BlinkMask = Menu_ShopBlinkMask and Menu_CursorTileAttr = Menu_ShopCursorTile (set...
$C2:D546Menu_Mode0CH169verifiedHandler 1, every frame, the top row (buy / sell): Menu_SprUploadMax = 1, Menu_PadInput.
$C2:D58BMenu_Mode0CH282verifiedHandler 2, every frame, the buy list: Menu_PadInput.
$C2:D5DDMenu_ShopListClose40verified
$C2:D605Menu_ShopResetPoses19verifiedFor sprite objects 6 down to 0: .Anim = 0 (probably the standing pose; Menu_ShopMemberInfo sets Menu_ShopAnimCanEquip on the members who can equip the item).
$C2:D618Menu_Mode0CH545verifiedHandler 5, every frame, the count to buy: Menu_CursorHold = $FF (the cursor does not move), Menu_PadInput.
$C2:D645Menu_Mode0CH375verifiedHandler 3, every frame, the sell list: Menu_PadInput.
$C2:D690Menu_Mode0CH451verifiedHandler 4, every frame, the count to sell: Menu_CursorHold = $FF, Menu_PadInput.
$C2:D6C3Menu_Mode0CH682verifiedHandler 6, every frame, the member sprites: Menu_PadInput.
$C2:D715Menu_Mode0CH799verifiedHandler 7, every frame, the member's equipment slots: Menu_PadInput.
$C2:D778Menu_Mode0CH887verifiedHandler 8, every frame, the slot's item list: Menu_PadInput.
$C2:D7CFMenu_ShopBuyMove227verifiedHandler 2's frame without confirm or cancel, on the buy list (Menu_ShopIds, top row Menu_ShopBuyTop).
$C2:D8B2Menu_ShopSellMove227verifiedMenu_ShopBuyMove for the sell list: the same steps with Menu_ShopSellTop / Menu_ShopSellRow, the list Menu_SellIds / Menu_SellCounts (Menu_Unk04CA = the slot's count), its length Menu_ShopSellLen...
$C2:D995Menu_ShopShiftMap108verifiedMoves the list's rows in the tilemap after a one-row scroll; the direction is the sign of Menu_ScrollStep's low byte (3 or -3), read as bit 15 of the word at Menu_ScrollStep - 1.
$C2:DA01Menu_ShopQtyStep52verifiedThe D-pad step of the count windows (handlers 4 and 5): Menu_ShopMulArg = Menu_ShopUnitPrice (3 bytes: the word and a 0; the 16-bit STZ also zeroes $0007), Menu_ShopMulLen = 3; Menu_CursorHold =...
$C2:DA35Menu_ShopQtyDirs8verifiedMenu_ShopQtyStep's routine by Menu_CursorDir (0 Right, 1 Left, 2 Down, 3 Up).
$C2:DA3DMenu_ShopQtyRight19verifiedThe count window's D-pad steps; the count is Menu_ItemCount, kept from 1 to Menu_Unk04CA - 1 (the most + 1, set by the handler that opened the window).
$C2:DA50Menu_ShopQtyLeft20verified
$C2:DA64Menu_ShopQtyUp31verified
$C2:DA83Menu_ShopQtyDown71verified
$C2:DACAMenu_ShopInit206verifiedMode $0C's set-up (Menu_Mode0CH0): Menu_ShopMemberSel = Menu_ShopRecMember0, Menu_CursorSel = Menu_ShopRecBuy; Menu_ClearOam; the draw list MenuRom_ShopList; the members (Menu_ShopListMembers)...
$C2:DB98Menu_ShopVramRec7verifiedMenu_VramRec queued by Menu_ShopInit: VRAM $1000 = $7E:B000 (Menu_SprUnpackBuf, where BankFF_BuildTileSets builds its tiles), $1100 bytes.
$C2:DB9FMenu_ShopCalcPrices73verifiedThe buy price of each shop item, into Menu_ShopBuyPrices[id] (a word per id): Menu_ItemInfo1[id] (probably the item's price) x the word at Menu_PriceFactor through Menu_UnkFD58 (probably...
$C2:DBE8Menu_ShopListMembers54verifiedMenu_EquipChars = the ids of Menu_PartyList without the empty ones (bit 7 set), then $FF; Menu_ShopMemberCount = how many.
$C2:DC1EMenu_ShopMemberSprites86verifiedMenu_SprHideAll, Menu_SprUploadMax = 7; then for each member of Menu_EquipChars (Menu_CurMember counting from 0, the 16-bit LDX also reading $0072; until the $FF): Menu_LoadCharRec; the sprite...
$C2:DC74Menu_ShopSprX7verifiedThe member sprites' .ScreenX, one per member 0-6 (indexed by Menu_Tmp02 in Menu_ShopMemberSprites), 32 pixels apart.
$C2:DC7BMenu_ShopBuyOpen67verifiedOpens the buy list (Menu_Mode0CH1's confirm on Menu_ShopRecBuy): Menu_Unk0D78 = $FF (the next Menu_DrawDescText draws again), Menu_CursorSel = 0, Menu_ArrowX/Y = Menu_ShopArrowXY; the draw list...
$C2:DCBEMenu_ShopCountIds28verifiedMenu_ShopBuyLen = the number of ids before the first 0 in Menu_ShopIds; the bytes from that 0 to the end of its 32 are zeroed.
$C2:DCDAMenu_ShopCountHeld40verifiedFor each shop item until the id 0: Menu_ShopHeld = the count of the first inventory slot (Menu_InvIds / Menu_InvCounts) holding that id with a count other than 0, or 0 when there is none.
$C2:DD02Menu_ShopBuyDrawRows30verifiedThe 8 rows of the buy list from Menu_ShopBuyTop (Menu_ShopBuyDrawRow for rows 0-7, Menu_MapPtr from Menu_ShopListMap down $80 bytes a row until Menu_ShopMapBelow).
$C2:DD20Menu_ShopBuyDrawRow32verifiedRow Menu_ShopRow of the buy list: Menu_ItemId = Menu_ShopIds[top + row], Menu_ShopPrice (its word) = its Menu_ShopBuyPrices entry, and Menu_ShopDrawRow at Menu_MapPtr.
$C2:DD40Menu_ShopListPaging22verifiedThe paging of a shop list of Y entries, 8 rows a page from cursor record 0 (Menu_Tmp00 = 8, Menu_PageCursorFirst = 0), with WRDIVL/H = Menu_ShopArrowSpan (the dividend of the list arrows'...
$C2:DD56Menu_ShopDrawRow38verifiedOne list row at Menu_MapPtr: for an id (Menu_ItemId) its name (Menu_DrawItemName) and after it Menu_ShopPrice's word in 5 digits (Menu_DrawNumber, flags Menu_ShopPriceDigits: leading zeros blank)...
$C2:DD7CMenu_ShopMemberInfo161verifiedWhat the members think of item Menu_ItemId (0: nothing).
$C2:DE1DMenu_ShopSlotOfsTable4verifiedThe Menu_CharRec offset of the slot of item categories 0-3 (as Menu_EquipSlotOffsets: weapon .Unk29, .Unk28, .Unk27, accessory .Unk2A).
$C2:DE21Menu_ShopMemberNums53verifiedA member's numbers in the shop: at Menu_ShopInfoMap + Y the tile byte Menu_ShopEquippedTile when it has the item equipped (Menu_EquipFlags[Menu_CurMember]); then the attack pair (the record's...
$C2:DE56Menu_ShopNumPair66verifiedDraws a member's value Menu_Tmp00 (0-255) as two tile words: tile bytes at Menu_ShopNumMap + Y and + 2, attribute bytes at + 1 and + 3.
$C2:DE98Menu_ShopSellOpen52verifiedOpens the sell list (Menu_Mode0CH1's confirm on Menu_ShopRecSell): Menu_ArrowX/Y = Menu_ShopArrowXY; the draw list MenuRom_ShopSellList; with Menu_CfgA5 clear Menu_ShopSellRow/Top = 0...
$C2:DECCMenu_ShopSellBuild101verifiedBuilds the sell list from the inventory: the first 8 bytes of Menu_SellIds zeroed; then for each of the 256 slots its count goes to Menu_SellCounts at the next list place, and the id too when it...
$C2:DF31Menu_ShopSellDrawRows32verifiedThe 8 rows of the sell list from Menu_ShopSellTop (Menu_ShopSellDrawRow for rows 0-7, Menu_MapPtr from Menu_ShopListMap down $80 bytes a row).
$C2:DF51Menu_ShopSellDrawRow37verifiedRow Menu_ShopRow of the sell list: Menu_ItemId = Menu_SellIds[top + row] (a 16-bit store: Menu_Unk04CA = 0), Menu_ShopPrice (its word) = the item's Menu_ItemInfo1 word / 2, rounded up (the LSR's...
$C2:DF76Menu_ShopQtyOpen79verifiedOpens the count window (handlers 2 and 3 on a confirm): Menu_InfoValue = Menu_ItemSortKeys[Menu_ItemId] (the weapon power or armour value); Menu_ShopListSel = Menu_CursorSel, Menu_CursorSel =...
$C2:DFC5Menu_ShopQtyLists10verifiedMenu_ShopQtyOpen's draw list (bank $FF) by item category 0-4: one for category 0, one for 1 and 2, one for 3 and 4 (what each shows is not traced; Menu_InfoValue is set just before).
$C2:DFCFMenu_ShopQtyClose50verifiedCloses the count window: Menu_CursorSel = Menu_ShopListSel; the 32 bytes from Menu_ShopQtyRowMap zeroed; Menu_ShopLast (and $0084) = $FF from the A the MVN leaves (the next list frame redraws the...
$C2:E001Menu_ShopQtyDraw17verifiedThe count window's numbers: the draw list MenuRom_ShopQtyList (probably Menu_ItemCount and Menu_ShopPrice; not traced) and Menu_VramRecBg1Low queued.
$C2:E012Menu_ShopDescNone5verifiedMenu_DrawDescText with A = Menu_Unk51 (expected 0): string 0, probably the line shown with no item (a tail jump).
$C2:E017Menu_ShopToMembers65verifiedFrom the top row to the member sprites (Menu_Mode0CH1 on Up / Down): Menu_ShopMenuSel = Menu_CursorSel, Menu_ThreadVar = 6, Menu_CursorSel = Menu_ShopMemberSel; Menu_ShopAttrArg =...
$C2:E058Menu_ShopMemberAttr26verifiedMenu_SetRowsAttr on the two tile rows at Menu_ShopMarkMap + 8 x member Menu_Tmp00 (low byte), with A = Menu_ShopAttrArg: its low byte the tiles per row, its high byte the attribute bits 4-7 to set.
$C2:E072Menu_ShopDimMembers51verifiedFor the members 0 to Menu_Unk85 - 1 (Menu_ShopRow, from Menu_Unk51): Menu_ShopMemberAttr with Menu_ShopAttrArg as given, and its palette (BankFF_LoadE4Palette of its Menu_EquipChars id, halved...
$C2:E0A5Menu_ShopEquipOpen76verifiedThe equipment of the member under the cursor (Menu_Mode0CH6's confirm): Menu_CompareAttrs (7 bytes) zeroed; Menu_CurMember = Menu_CursorSel - Menu_ShopRecMember0 and its record loaded...
$C2:E0F1Menu_ShopSlotRows23verifiedThe slot rows highlighted (Menu_ShopSlotAttr), Menu_ArrowX/Y = Menu_ShopEquipArrowXY, the slot's item list set up (Menu_EquipListSetup) and Menu_VramRecBg1Rows24 queued.
$C2:E108Menu_ShopEquipNext72verifiedChanges the member in the equipment view on Menu_PadAction's page bits: Menu_PadPageBack the next member (to 0 after the last, Menu_Unk85 - 1), Menu_PadPageOn the one before (to the last before 0).
$C2:E150Menu_ShopSlotAttr18verifiedMenu_ListKind (written absolute) = Menu_CursorSel (the slot), then Menu_SetSlotRowsAttr from Menu_ShopSlotRowsMap (the selected slot's rows keep palette 0, the others get palette 7).
$C2:E162Menu_ShopTryItem40verifiedHandler 8's item under the cursor tried on: the member's record again (Menu_LoadPartyCharRec), Menu_ItemId = Menu_EquipList[Menu_EquipListTop + Menu_CursorSel - Menu_EquipListFirstRec], stored in...
$C2:E18AMenu_ShopCompare82verifiedThe stats with the record copy as it is (Menu_CharCalcStats; stat 5 doubled with accessory Menu_DoubleStat5Item, as Menu_CharRecalc does); for the 7 stats in Menu_ShopCompareOfs order the new...
$C2:E1DCMenu_ShopCompareOfs7verifiedMenu_ShopCompare's order: the Menu_CharRec offsets of stats 0, 2, 5, 3, 1, 4, 6 in .Derived (Menu_EquipCompareOfs' entries 2-8).
$C2:E1E3Menu_Mode0DList10verifiedMenu_ModeLists entry $0D: the handlers Menu_MainThread runs by Menu_ThreadVar (matched below: the name entry).
$C2:E1EDMenu_Mode0DH020verifiedHandler 0: Menu_NamedOnce |= Menu_CurMember.
$C2:E201Menu_Mode0DH38verifiedHandler 3 (after handler 2's choice and its fade-out), also branched to by handler 0: the name screen (Menu_NameInit), Menu_ThreadVar + 1 (handler 4 from here, handler 1 from handler 0) and a tail...
$C2:E209Menu_Mode0DH421verifiedHandler 4, every frame after handler 3: waits for a button (any bit of Pad_Pressed, read as a word), then Menu_PlaySound0, Menu_HdmaenShadow = Menu_NameHdmaBits, Menu_ArrowsOff = 0 and...
$C2:E21EMenu_Mode0DH124verifiedHandler 1, every frame, the grid: Menu_PadInput, Menu_NameGridStep (D-pad, confirm and cancel); with Start newly pressed (Pad_Pressed bit 0) Menu_NameFinish, and when it took the name (A = 0) a...
$C2:E236Menu_Mode0DH249verifiedHandler 2, every frame, the choice before the first name: Menu_PadInput, the line under the cursor (Menu_NameChoiceText).
$C2:E267Menu_NameGridStep49verifiedThe grid's frame: Menu_NamePrevPos (a word) = cursor record 0's X and Y; WRMPYA = 16 (the grid's cell size, used by the steps); for a direction (Menu_CursorDir not negative) its step from...
$C2:E298Menu_NameGridDirs8verifiedMenu_NameGridStep's routine by Menu_CursorDir (0 Right, 1 Left, 2 Down, 3 Up).
$C2:E2A0Menu_NameUp10verifiedThe grid cursor's steps, wrapping: Menu_NameUp row - 1 (7 below 0), Menu_NameDown ($C2:E2AA) row + 1 (0 from 8); then (.row) Menu_NameRow = it, WRMPYB = it, Menu_NameUnk0F0A = 0, and cursor record...
$C2:E2AAMenu_NameDown34verified
$C2:E2CCMenu_NameLeft10verified
$C2:E2D6Menu_NameRight30verified
$C2:E2F4Menu_NameEdit34verifiedConfirm: Menu_NameAddChar, then Menu_PlaySound0.
$C2:E316Menu_NameAddChar52verifiedThe character under the grid cursor, MenuRom_NameChars[Menu_NameRow x 10 + Menu_NameCol], goes to Menu_NameBuf[Menu_NameLen] (at most index 4: with 5 characters the last is replaced), and...
$C2:E34AMenu_NameCursorX25verifiedThe X of the two sprites under the name (OAM entries 96 and 97, Menu_NameCursorOam) = Menu_NameCursorX0 + 8 x Menu_NameLen (at most 4): probably the mark at the next character's place.
$C2:E363Menu_NameFinish45verifiedStart on the name entry: the first byte of the character's name (Menu_NameDest, in TextWin_CharNames) = 0, so the old name is not found by the test after; the entry trimmed into Menu_NameTrimmed...
$C2:E390Menu_NameTrim80verifiedMenu_NameTrimmed (6 bytes) zeroed; Menu_NameBuf's 6 bytes copied to Menu_NameWork; from the end, the trailing spaces (Menu_NameSpace) are zeroed, zeros skipped, up to the first other byte; then...
$C2:E3E0Menu_NameTaken46verifiedCompares Menu_NameTrimmed with each of the 8 names of TextWin_CharNames (6 bytes apart), up to 5 bytes or a 0 in both: on a match Menu_PlaySound1 and A = $FF; else A = 0 (TDC).
$C2:E40EMenu_NameInit304verifiedThe name screen: Menu_CursorSel = 0; the draw list MenuRom_NameList; the grid's text built at Menu_NameGridText (Menu_NameGridBuild) and put at Menu_NameGridMap with Menu_DrawString (Menu_TextAttr...
$C2:E53EMenu_NameVramRec7verifiedMenu_VramRec queued by Menu_NameInit: VRAM $7800 = Menu_TextGfxA ($7E:5E00), $800 bytes.
$C2:E545Menu_NameGridBuild49verifiedThe grid's text at Menu_NameGridText: 8 rows, each the 10 characters of MenuRom_NameChars in turn with a byte $FF after each, then Menu_NameNewLine; a 0 at the end.
$C2:E576Menu_NameChoiceInit93verifiedThe choice screen before the first name: $480 bytes of MenuRom_NameChoiceMap to Menu_Unk3600, then 12 more blocks of 16 bytes from the ROM after it, each to every other 16 bytes of the map...
$C2:E5D3Menu_NameChoiceText56verifiedThe line of the choice under the cursor: string Menu_CursorSel + 1 of MenuRom_NameStrings, drawn (as Menu_DrawDescText does, by the text thread Menu_StartDescText starts) into Menu_NameChoiceDest...
$C2:E60BMenu_Mode0EList8verifiedMenu_ModeLists entry $0E: the handlers Menu_MainThread runs by Menu_ThreadVar (matched below: the load screen).
$C2:E613Menu_Mode0EH08verifiedHandler 0: the load screen (Menu_LoadInit), Menu_ThreadVar + 1 (handler 1) and a tail jump to Menu_StartFadeIn.
$C2:E61BMenu_Mode0EH1104verifiedHandler 1, every frame, the slot list.
$C2:E683Menu_Mode0EH1_new17verified
$C2:E694Menu_Mode0EH1_start26verified
$C2:E6AEMenu_Mode0EH287verifiedHandler 2, every frame, the slot to start from (after Menu_LoadAskSlot): Menu_PadInput.
$C2:E705Menu_Mode0EH362verifiedHandler 3, every frame, the erase question (records 4 yes, 5 no): Menu_PadInput; neither button: Menu_PlaySound0 when the cursor moved.
$C2:E743Menu_LoadCursor128verifiedThe load screen's cursor: while the row Menu_CursorSel has Menu_SlotValid 0 (row 3: Menu_Unk0D4C), it moves on, up (- 1) after an Up move (Menu_CursorDpad), else down, wrapping over rows 0-3.
$C2:E7C3Menu_LoadInit126verifiedThe load screen: the draw list MenuRom_LoadList; the slot windows (Menu_DrawSlotWindows); Menu_SlotIdx = Menu_SramLastSlot (the slot saved last), or 3 (row 3) when no slot is valid; Menu_CursorSel...
$C2:E841Menu_LoadAskSlot73verifiedThe question of handler 2: Menu_LoadMsgShown + 1 (Menu_UnkD36C then skips only $C2:D39E-$D403, after its test at $C2:D399: its draw list ($FF:C15E), Menu_DrawClock, a text line (Menu_DrawText of a...
$C2:E88AMenu_LoadMsgVramRec7verifiedMenu_VramRec queued by Menu_LoadAskSlot: VRAM $7108 = Menu_TextGfxA ($7E:5E00), $600 bytes.
$C2:E891Menu_LoadEraseOpen38verifiedThe erase question (Menu_Mode0EH1 jumps here): Menu_SlotIdx = the row (Menu_CursorSel, with B = 0 from the TDC); Menu_LoadSavedRow = it, Menu_CursorSel = Menu_LoadRecYes, Menu_HdmaenShadow =...
$C2:E8B7Menu_LoadEraseSlot93verifiedErases slot Menu_SlotIdx: Menu_SlotValid and Menu_SlotWinStyle of it = 0; the low byte of its Menu_SramSlotSign = slot x 2 (no longer BankFF_SlotSign, so the slot reads as empty).
$C2:E914Menu_VramRecUnkE9147verifiedA Menu_VramRec: VRAM $5840 = $7E:2E80, $80 bytes (the first two rows Menu_VramRecClock sends).
$C2:E91BMenu_MainCursorThread8verifiedThread 3 (Menu_RunThreads starts it): Menu_DrawMainCursor, wait a frame, for ever.
$C2:E923Menu_ResetMainCursor10verifiedMenu_ClearOam (every sprite hidden), Menu_Unk56 = 0 (no flip), then the cursor part of Menu_DrawMainCursor (its .cursor, which ends with this routine's PLP).
$C2:E92DMenu_DrawMainCursor79verifiedHides OAM entries 16-95 of the copy at $0700 (Y $E0, large) and, unless Menu_Unk0D9B was non-zero (it is cleared: one frame skipped), places the main cursor in entry 28 (Menu_OamMainCursor): X/Y...
$C2:E97CMenu_PadInputThread8verifiedMenu_PadInput, wait a frame, for ever: a thread body like Menu_MainCursorThread's.
$C2:E984Menu_PadInput85verifiedMenu_CursorMove first (with the caller's P), then rebuilds Menu_PadAction from 0: bit 7 (confirm) when Pad_Pressed has a bit of Menu_ButtonMap entry 0, bit 6 (cancel) for entry 1 (the entries...
$C2:E9D9Menu_PadActionButtons9verifiedMenu_ButtonMap entries Menu_PadInput tests for Menu_PadAction bits 7 and 6: only the first two bytes (0 and 1) are read; the other seven ($00 $00 $00 $08 $06 $07 $FF) are not read by any code...
$C2:E9E2Menu_CursorMove61verifiedMenu_Unk81 = Menu_CursorSel (the selection before this call) and Menu_CursorDpad = the D-pad bits of Menu_PadRepeat (its high byte: Up, Down, Left, Right = bits 3-0).
$C2:EA1FMenu_CursorDirTable8verifiedMenu_CursorMove's routine per Menu_CursorDir 0-3 (Right, Left, Down, Up).
$C2:EA27Menu_CursorRecOffset15verifiedX = (A AND $FF) x 6: the byte offset of a 6-byte Menu_CursorPos record.
$C2:EA36Menu_CursorToUp5verifiedMenu_CursorDirTable's routines: Menu_CursorSel = the record's .Up (here), .Down (Menu_CursorToDown, $EA3B), .Left (Menu_CursorToLeft, $EA40) or .Right (Menu_CursorToRight, $EA45) byte, each stored...
$C2:EA3BMenu_CursorToDown5verified
$C2:EA40Menu_CursorToLeft5verified
$C2:EA45Menu_CursorToRight3verified
$C2:EA48Menu_CursorStoreNeighbour11verified
$C2:EA53Menu_ListCursorEdge46verifiedAfter Menu_PadInput in a paged list.
$C2:EA81Menu_ListPageSetup57verifiedSets up the paging of a list of Y entries shown Menu_Tmp00 rows at a time: Menu_PageStep = the rows; the largest top row (Y - rows, or 0 when the list fits) goes to Menu_Tmp01, Menu_ListMaxTop...
$C2:EABAMenu_PlaySound8verifiedMenu_SendSound with the caller's A: sound command $18, argument A (probably a sound effect id: command $19 is Audio_CmdPlaySfx; what $18 does differently is not traced).
$C2:EAC2Menu_PlaySound010verifiedMenu_SendSound with id 0: the sound of a cursor move (Menu_MainMenuLoop plays it on a new icon, the mode 1 handlers when Menu_CursorSel changed) and of a return to the main menu, probably the...
$C2:EACCMenu_PlaySound110verifiedMenu_SendSound with id 1 (the mode 1 handler at $C2:9C83 plays it when Menu_EquipListLen is 0 instead of opening the list: probably the refusal sound).
$C2:EAD6Menu_PlayPendingSound35verifiedMenu_NmiTimer = 0 (so the command is sent now), then: Menu_Unk0DBC bit 1 set: it is cleared and sound 6 played; else bit 0 set: it is cleared and sound 7 played; else nothing.
$C2:EAF9Menu_PlaySfxNow10verifiedAudio_CmdPlaySfx with argument A, always sent: Menu_NmiTimer is zeroed first, then Menu_SendSoundArg.
$C2:EB03Menu_SendSound5verifiedAudio_CmdId = Audio_Cmd18, Audio_CmdArg0 = A; then (also Menu_SendSoundArg, $EB08, with the command already set) the command is sent only while Menu_NmiTimer is 0: Menu_NmiTimer = 3 (the menu NMI...
$C2:EB08Menu_SendSoundArg23verified
$C2:EB1FMenu_ListScrollStep124verifiedOne frame of a list's smooth scroll (set up by Menu_ListScrollInit): builds Menu_ScrollRows entries of an HDMA-style table (3 bytes: line count, 16-bit value) in Menu_ScrollBuild from...
$C2:EB9BMenu_ListScrollInit157verifiedSets up a one-row smooth scroll of the table at Menu_NmiMoveDest (Menu_NmiMoveSize bytes, the caller sets both; n = Menu_ScrollRows entries of 3 bytes: line count, 16-bit value): - Menu_NmiMoveSrc...
$C2:EC38Menu_DrawPortrait91verifiedDraws a 6 x 6 tile block at Menu_MapPtr (rows $40 bytes apart): the tiles MenuRom_PortraitTiles[Menu_PortraitChar] + 0 to 35 in order, each with Menu_Tmp01 as its attribute byte; then copies the...
$C2:EC93Menu_SetRowsAttr25verifiedFor X rows from Menu_MapPtr down (Menu_MapPtr += $40 each): Menu_SetRowAttr on A's low byte tiles, which keeps each attribute byte's bits 0-3 and ORs in A's high byte.
$C2:ECACMenu_SetAttr2Rows22verifiedSets the attribute byte of A's low byte tiles (0: 256) at Menu_MapPtr and of the ones a row ($40 bytes) below to A's high byte.
$C2:ECC2Menu_SetRowAttr25verifiedMenu_SetRowsAttr's row: for A's low byte tiles (0: 256) at Menu_MapPtr, attribute byte = (it AND $0F) OR the byte at 7,S: the high byte of the A that Menu_SetRowsAttr pushed (under this routine's...
$C2:ECDBMenu_LoadSlotWindowStyle45verifiedWith DB=$7E: Menu_Unk0D47 low byte = Menu_WinStyle x 20, high byte = (Menu_SlotIdx + 1) x 4 + 3 (bits 2-4 the palette row, so row slot + 1); then Menu_DrawWindowFrame, Menu_FillWindowInside and...
$C2:ED08Menu_LoadWindowPal41verifiedCopies the 8 colours of window style Menu_WinStyle (bits 0-2) from MenuRom_WindowPals (16 bytes per style) into colours 8-15 of palette row n of Menu_PalBuf, n = bits 2-4 of Menu_Unk0D47's high...
$C2:ED31Menu_RunDrawList40verifiedRuns the draw list at $FF:X: for each command byte c below $80, the MenuRom_DrawArgLens[c] + 1 bytes after it go to Menu_DrawArg0 on (an MVN, so DB = $7E while the command runs) and...
$C2:ED59Menu_DrawCmdTable22verifiedMenu_RunDrawList's command routines by byte offset: commands $00-$14 (even).
$C2:ED6FMenu_CopyDrawArgsUnused8verifiedINX, then an MVN of A + 1 bytes from $FF:X to Menu_DrawArg0: the argument copy of Menu_RunDrawList as a routine.
$C2:ED77Menu_DrawCmdFill25verifiedCommand $00 (4 argument bytes): fills Menu_DrawArg0 bytes (a word, at least 3) from Menu_MapPtr with the word Menu_DrawArg2, which is also kept in Menu_TextWord.
$C2:ED90Menu_DrawPosToAddr26verifiedMenu_DrawAddr = Menu_MapPtr + row x $40 + column x 2, from Menu_DrawArg2 (column = bits 0-4, row = the high byte).
$C2:EDAAMenu_DrawCmdWindow6verifiedCommand $04 (6 argument bytes): Menu_DrawCmdFrame (the frame), then Menu_FillWindowInside (with the inside size the frame left).
$C2:EDB0Menu_DrawCmdFrame6verifiedCommand $12 (6 argument bytes: style, attribute byte, position, width, height): Menu_DrawWindowSetup, then Menu_DrawWindowFrame.
$C2:EDB6Menu_DrawCmdInside29verifiedCommand $14 (6 argument bytes, as Menu_DrawCmdFrame): the inside of a window only: Menu_DrawWindowSetup, Menu_DrawInnerW = (width AND $1F) - 2, Menu_DrawInnerH = (height AND $3F) - 2...
$C2:EDD3Menu_DrawWindowSetup35verifiedThe window's first tile: Menu_Unk0D47 low byte = style x 20 (the style is Menu_DrawArg0 AND $3F when its bit 7 is set, else Menu_WinStyle AND 7; 20 tiles per style), high byte = Menu_DrawArg1 (its...
$C2:EDF6Menu_DrawWindowFrame45verifiedDraws the frame of a window at Menu_DrawAddr, Menu_DrawArg4 AND $1F tiles wide (w) and Menu_DrawArg5 AND $3F tall (h), from tile word t = Menu_Unk0D47: the top row (Menu_FrameEdgeRow: t, then t+1...
$C2:EE23Menu_FrameEdgeRow53verifiedOne edge row of the frame at Menu_DrawAddr2: tiles t, t+1, t+2 (t = Menu_FrameTile), the pair t+1 / t+2 repeated by an MVN up to column w - 2 (none when Menu_DrawInnerW is below 2), then t OR 3 at...
$C2:EE58Menu_FrameSides39verifiedMenu_DrawInnerH side rows from Menu_DrawAddr2: the left edge t (t = Menu_FrameTile) and the right edge t+1 (at + Menu_FrameRightOfs, an indirect store), (t+1) EOR 3 for the next row.
$C2:EE7FMenu_FillWindowInside118verifiedFills the inside of the window at Menu_DrawAddr (from one row down and one column right: + $42), Menu_DrawInnerW tiles wide and Menu_DrawInnerH tall, with the 4 x 4 pattern Menu_WinFillPattern...
$C2:EEF5Menu_WinFillPattern16verifiedTile offsets of the window inside, 4 rows of 4 (Menu_FillWindowInside adds them to the style's first tile).
$C2:EF05Menu_DrawCmdCopyBlock38verifiedCommand $02 (6 argument bytes): copies a block of Menu_DrawArg4 tiles by Menu_DrawArg5 rows from position Menu_DrawArg0 to position Menu_DrawArg2 (both through Menu_DrawPosToAddr; Menu_DrawArg2 is...
$C2:EF2BMenu_CopyMapRows29verifiedMenu_DrawInnerH times: Menu_DrawInnerW + 1 bytes from Menu_DrawAddr to Menu_DrawAddr2 (MVN in bank $7E), both moved one row ($40) down.
$C2:EF48Menu_DrawCmdString29verifiedCommand $06 (5 argument bytes): Menu_DrawString of string Menu_DrawArg0 (a word index into MenuRom_StringPtrs, strings in bank $FF) at position Menu_DrawArg2, with Menu_DrawArg4 as the count and...
$C2:EF65Menu_DrawString25verifiedDraws the string at B:Y to the tilemap at $7E:X: Menu_TextFlags = A's low byte, Menu_TextLeft = it AND $7F (tiles to put; 0: 256), Menu_DrawAddr2 = X (the line start), DB = B, Menu_DrawStringLoop...
$C2:EF7EMenu_DrawStringLoop25verifiedThe string loop: a 0 byte ends it; codes $01-$0F run their Menu_TextCtrlTable routine (Menu_TextCtrl) and do not count; other bytes are put (Menu_PutChar) and counted down in Menu_TextLeft, which...
$C2:EF97Menu_PutChar39verifiedPuts tile A with attribute Menu_TextAttr at $7E:X (long stores) and X += 2.
$C2:EFBEMenu_TextCtrl21verifiedRuns control code A's Menu_TextCtrlTable routine: JMP (Menu_TextVec) with the return address pushed by PER so that its RTS lands on Menu_TextCtrlRet, whose RTS returns to Menu_DrawStringLoop.
$C2:EFD3Menu_TextCtrlRet1verified
$C2:EFD4Menu_TextCtrlTable32verifiedMenu_TextCtrl's routine per control code $00-$0F; $00 (never dispatched: 0 ends a string) and $0D-$0F are Menu_TextCtrlRet (no effect).
$C2:EFF4Menu_TextNewLine17verifiedCode $01: Menu_DrawAddr2 (the line start) += $80 (two rows), or $40 with Menu_TextFlags bit 7 set; X = it.
$C2:F005Menu_TextSetPos9verifiedCode $02 (a word): Menu_DrawAddr2 = X = Menu_MapPtr + the word.
$C2:F00EMenu_TextSkip23verified
$C2:F011Menu_TextNumber13verifiedCode $03 (4 bytes: the value's address, then the Menu_DrawNumber word: flags, bank): Menu_DrawNumber at X.
$C2:F01EMenu_TextSkip44verified
$C2:F022Menu_TextSubString20verifiedCode $04 (a 24-bit pointer): Menu_DrawStringLoop on the string there (DB = its bank byte), sharing Menu_TextLeft.
$C2:F036Menu_TextName50verifiedCode $05 (a word): the string at $7E:word as one-row text of at most 5 tiles (Menu_TextLeft/Flags = 5 / $80 meanwhile), padded with tile $FF to 5; then Menu_TextLeft/Flags back and X = the start + 10.
$C2:F068Menu_TextSetAttr9verifiedCode $0A (a byte): Menu_TextAttr = it.
$C2:F071Menu_TextCopyTile28verifiedCode $07 (a word): the tile word at $7E:word is copied to the map at X (X += 2) and counted in Menu_TextLeft.
$C2:F08DMenu_TextBlanks21verifiedCode $08 (a byte n): n tiles $FF (Menu_PutChar; 0: 65536), not counted in Menu_TextLeft.
$C2:F0A2Menu_TextPalFrom22verifiedCode $06 (a word): Menu_TextAttr's palette bits (2-4) = those of the byte at $7E:word.
$C2:F0B8Menu_TextSetFlags9verifiedCode $09 (a byte): Menu_TextFlags = it.
$C2:F0C1Menu_TextHex16verifiedCode $0B (4 bytes, as code $03): Menu_DrawHex at X.
$C2:F0D1Menu_TextNumberOrBar67verifiedCode $0C (3 bytes: a limit index k, then a word address in bank $7E): the byte there as 2 digits with leading zeros blank (Menu_DrawNumber, flags $11) while it is below MenuRom_NumLimits[k] ($63 =...
$C2:F114Menu_DrawNumber43verifiedDraws the 1-3 byte value at B:Y (B = A's high byte) in decimal at $7E:X.
$C2:F13FMenu_BinToBcd59verifiedMenu_NumBcd (4 bytes, BCD) = the Menu_NumBytes-byte value at Y (lowest byte first): for each set bit, its value in BCD from Menu_BcdBitValues is added in decimal mode.
$C2:F17AMenu_BcdBitValues96verified2^0 to 2^23 as 4-byte BCD numbers (lowest byte first), for Menu_BinToBcd.
$C2:F1DAMenu_DrawBcdDigits49verifiedWith DB=$7E, draws Menu_NumDigits + 1 digits of Menu_NumBcd at Menu_NumPos (Y), highest first (from byte Menu_NumDigits / 2, its high nibble only when Menu_NumDigits is odd), with Menu_PutBcdDigit.
$C2:F20BMenu_PutBcdDigit28verifiedPuts digit A AND $0F at Y (tile $D4 + digit, Menu_TextAttr), Y += 2.
$C2:F227Menu_DrawHex37verifiedDraws the 4 bytes at B:Y (B = A's high byte) in hex at $7E:X: A's low byte + 1 digits (Menu_DrawHexDigits); Menu_NumDigits/Flags = A (as a word).
$C2:F24CMenu_DrawHexDigits29verifiedMenu_NumDigits + 1 hex digits of the 4 bytes at Menu_NumBcd at Y, highest first (as Menu_DrawBcdDigits, no zero blanking).
$C2:F269Menu_PutHexDigit20verifiedPuts tile Menu_HexDigitTiles[A AND $0F] with Menu_TextAttr at Y, Y += 2.
$C2:F27DMenu_HexDigitTiles16verifiedThe tiles of hex digits 0-F (Menu_PutHexDigit): $73-$7C for 0-9, then $F1 $F2 $36 $7D $38 $34 for A-F.
$C2:F28DMenu_DrawClock63verifiedDraws hours:minutes at $7E:X from the play-time digits at Y (minute ones, minute tens, hour ones, hour tens, then a maxed flag: three callers pass Menu_PlayTime+2, Menu_UnkD36C ($C2:D3AA) passes...
$C2:F2CCMenu_ClockPair16verifiedA = byte Y+1 x 10 + byte Y (tens and ones), Y += 2; Menu_NumBcd's first byte = tens x 2.
$C2:F2DCMenu_DrawItemName6verifiedMenu_ItemNamePtr for id A, then Menu_DrawString: 11 tiles of bank $CC at $7E:X (two-row text).
$C2:F2E2Menu_ItemNamePtr17verifiedY = Menu_ItemNamePtrs[A AND $FF] (a bank-$CC address), A = $CC0B (the bank and Menu_DrawString's count, 11).
$C2:F2F3Menu_DrawDescText63verifiedDraws string A of the table at $CC:2EB1 with the text-window decoder (Menu_StartDescText), unless it is the string drawn last (A = Menu_Unk0D77) and Menu_Unk0D78 bit 7 is clear: then nothing.
$C2:F332Menu_DrawCmdSetMap5verifiedCommand $08 (2 argument bytes): Menu_MapPtr = Menu_DrawArg0.
$C2:F337Menu_DrawCmdMapRec43verifiedCommand $0C (4 argument bytes): with DB=$00, fills the 8-byte record at Menu_DrawArg0 (low WRAM) as a Menu_VramRec: .Dest = Menu_DrawArg2, .Src = $9000 + (Menu_DrawArg0 AND $F0) x 8, .SrcBank and...
$C2:F362Menu_DeadF3622verifiedREP #$10 that no code reaches: Menu_DrawCmdMapRec ends with RTS before it, Menu_DrawCmdTable points at $F364, and no JSR/JMP or pointer to $F362 was found.
$C2:F364Menu_DrawCmdCopyRom20verifiedCommands $0A and $0E (2 argument bytes): copies the n bytes after the count byte n at $FF:Menu_DrawArg0 to Menu_MapPtr (MVN; n = 0: 256).
$C2:F378Menu_DrawCmdSwapBlocks82verifiedCommand $10 (6 argument bytes): swaps the block of Menu_DrawArg4 AND $1F tiles by Menu_DrawArg5 AND $3F rows at position Menu_DrawArg2 with the one at Menu_DrawArg0 (Menu_DrawArg2 is overwritten...
$C2:F3CAMenu_InitSprites88verifiedSets up objects 0-6: .Id = n, .TileAttr = Menu_SprInitAttrs[n], .Anim = 0, .Dir = 1, Menu_SprLoad and Menu_SprAnimate; then object 7 gets .TileAttr = Menu_SprInitAttrs[7] and objects 7 and 8 .Id =...
$C2:F422Menu_SprLoad294verifiedLoads the definition of the object at DP: .Flags18 = 0, .PrevAnim and .LastFrame = $FF (so the next Menu_SprAnimate starts over and uploads), the banks of .FrameListPtr/.TimeListPtr = $E4...
$C2:F548Menu_SprInitAttrs20verified.TileAttr per object (OAM tile and attribute words: tile bits 0-8, palette bits 9-11); Menu_InitSprites reads entries 0-7, entries 8 and 9 are not read in matched code.
$C2:F55CMenu_SprDefTables6verifiedBank-$E4 addresses of the definition records of kinds 0, 1 and 2 (Menu_SprLoad; $F000 and $F023 have 5-byte records, $F600 10-byte ones).
$C2:F562Menu_SprTileCounts4verified.TileCount by definition byte 4 bits 0-1: the frame size in units of 16 tiles (Menu_SprUploadTiles) and of 40 frame bytes (Menu_SprFrameBytes).
$C2:F566Menu_SprResetChars34verifiedObjects 6 down to 0: .Id = n, .Anim = 0, .Flags18 = $40 (animated by Menu_SprThread but not handed to Menu_SprPlaceOam).
$C2:F588Menu_SprHideAll31verifiedObjects 7 down to 0: .Id = $FF (off), .Anim = 0, .Flags18 = 0.
$C2:F5A7Menu_LoadCharPalettes70verifiedColours 1-12 of sprite palettes 1-7 (Menu_PalBuf colours $91 + 16n) from the first 7 entries of MenuRom_E4Palettes, then colours 13-15 of each from the bank-$D1 record of character n's weapon...
$C2:F5EDMenu_WeaponRecSrc57verifiedFor character A: its weapon (Menu_CharRec.Unk29, the category-0 byte of Menu_EquipSlotOffsets) into Menu_LastWeapon, then X = Menu_Unk21BASrc + 6 x MenuRom_WeaponUnkIdx[weapon], the source of the...
$C2:F626Menu_Times6429verifiedY = Menu_Unk0D2C = (A AND $FF) x $40 (by the hardware multiplier), P kept, A kept for a caller with M=0 (with M=1 see Exit).
$C2:F643Menu_StartSprThread20verifiedMenu_Unk0D2E = Menu_Unk0D30 = 0 and starts Menu_SprThread in slot 5 (Menu_SprSlot).
$C2:F657Menu_SprThread68verifiedThread (slot 5): each frame, Menu_SprUploads = 0, then for objects 0-8 (DP = each page; the tenth page is not visited): skipped when .Id or .Flags18 has bit 7 set; when .Anim differs from...
$C2:F69BMenu_SprNextFrame2verified
$C2:F69DMenu_SprAnimate49verifiedSteps the animation of the object at DP.
$C2:F6CEMenu_SprDir03verified
$C2:F6D1Menu_SprDir11verified
$C2:F6D2Menu_SprDir22verified
$C2:F6D4Menu_SprDir34verified
$C2:F6D8Menu_SprDirTable8verified
$C2:F6E0Menu_SprAnimEnd117verified
$C2:F755Menu_SprFrameBytes7verifiedBytes per frame record by .TileCount (40 per unit: 32 of tile list, 8 of .FrameData); entries 0, 4 and 5 are not used by the Menu_SprTileCounts values.
$C2:F75CMenu_SprUploadTiles277verifiedBuilds the frame's tiles in WRAM and queues them for VRAM: Y = Menu_SprVramRec.Src = Menu_SprTileBuf ($8000) + (Menu_Unk0D72 word x 2 AND $FF00), plus 1 when bit 7 of $0D73 is set (the ASL's carry...
$C2:F871Menu_SprPlaceOam148verifiedPlaces object n's sprites (DP = its page, n = (DP - Menu_SprPages) / $40) in the OAM copy from entry 64 + 4n (Menu_SprOam + 16n): .TileCount x 4 16x16 sprites, each at the object's .ScreenX +...
$C2:F905Menu_DrawText4bpp7verifiedMenu_DrawText with TextWin_Mode = Menu_TextWinMode4bpp (low nibble 1: TextWin_Blit4bpp) instead of Menu_TextWinMode: the BRA joins it at its store (.mode).
$C2:F90CMenu_DrawText55verifiedDraws the string set up in TextWin_StrIndex/StrTable into the buffer at $7E:Menu_TextDest with the text-window decoder: TextWin_Mode = Menu_TextWinMode, TextWin_GfxBuf = $7E:Menu_TextDest...
$C2:F943Menu_CfgEntryText111verifiedThe settings screen's text for entry Menu_Unk0DCE with value string Menu_Unk0DCF (strings of MenuRom_CfgTextTable): TextWin_Mode = 0, TextWin_GfxBuf's bank = $7E, TextWin_StrTable =...
$C2:F9B2Menu_CfgTextThread84verifiedA thread (slot 2, from Menu_CfgEntryText): Menu_Unk0DD0 = $80, Menu_TextDest = $4E0A, Menu_TextGlyphs and Menu_TextCol = 0, TextWin_GfxBuf and Menu_TextGfxSrc = $5E00, Menu_TextPenStart = 8...
$C2:FA06Menu_CfgValueThread67verified
$C2:FA49Menu_StartDescText86verifiedStarts the text-window decoder on the string the caller set up (TextWin_StrIndex / StrTable) for Menu_DescTextThread: TextWin_Mode = 0, TextWin_GfxBuf's bank = $7E, Menu_TextGlyphs and...
$C2:FA9FMenu_DescTextThread6verifiedA thread (slot 2, from Menu_StartDescText): the steps (Menu_TextStepLoop), then the thread ends (Menu_ThreadEnd).
$C2:FAA5Menu_TextStepWait3verifiedThe step loop of the text threads, entered at Menu_TextStepLoop ($C2:FAA8; Menu_TextStepWait, a frame's wait first, is where it goes on after each step): TextWin_StepCount = Menu_TextSteps...
$C2:FAA8Menu_TextStepLoop65verified
$C2:FAE9Menu_TextUpload174verifiedAfter a decoder step, when TextWin_Unk17 (glyphs drawn) is not Menu_TextGlyphs (which takes it): Menu_TextRec (at Menu_SprScratch) = VRAM Menu_TextTileDest from $7E:Menu_TextGfxSrc, $400 bytes...
$C2:FB97Menu_PutTextTiles29verifiedY tile words from $7E:X on, a row pair as Menu_TextUpload writes them: the first word = (A AND $EF) OR $3100 (A's low byte the tile, attribute byte $31), the row below ($40 bytes on) the same with...
$C2:FBB4Menu_PutTextTilesAttr26verifiedAs Menu_PutTextTiles with A's whole word: the first word = A AND $33EF (high-byte bits 2-3 and 6-7 cleared: palette bits 0-1 and both flips, and the tile's bit 4; tile bits 8-9, palette bit 2 and...
$C2:FBCEMenu_VramRecBg1Big7verifiedVRAM $5800 = $7E:2E00, $C00 bytes.
$C2:FBD5Menu_VramRecBg1High7verifiedVRAM $5800 = $7E:2E00, $800 bytes (the half before Menu_VramRecBg1Low's).
$C2:FBDCMenu_VramRecBg1Rows167verifiedVRAM $5A00 = $7E:3200, $240 bytes.
$C2:FBE3Menu_VramRecClock7verifiedVRAM $5840 = $7E:2E80, $640 bytes (queued after the clock is drawn, Menu_MainMenuLoop, and by most menu screens).
$C2:FBEAMenu_VramRecBg1Low7verifiedVRAM $5C00 = $7E:3600, $800 bytes.
$C2:FBF1Menu_VramRecBg1Rows247verifiedVRAM $5B00 = $7E:3400, $600 bytes.
$C2:FBF8Menu_VramRecBg27verifiedVRAM $6000 = $7E:3E00 (Menu_Bg2Map), $1000 bytes.
$C2:FBFFMenu_VramRecBg2B7verifiedVRAM $6040 = $7E:3E80, $680 bytes.
$C2:FC06Menu_VramRecBg2Low7verifiedVRAM $6400 = $7E:4600, $800 bytes.
$C2:FC0DMenu_VramRecBg2Rows27verifiedVRAM $6040 = $7E:3E80, $300 bytes.
$C2:FC14Menu_VramRecBg3Full7verifiedVRAM $6800 = $7E:4E00, $1000 bytes.
$C2:FC1BMenu_VramRecBg37verifiedVRAM $6800 = $7E:4E00, $680 bytes.
$C2:FC22Menu_VramRecBg3Rows47verifiedVRAM $6880 = $7E:4F00, $480 bytes.
$C2:FC29Menu_VramRecBg3Rows37verifiedVRAM $6860 = $7E:4EC0, $440 bytes.
$C2:FC30Menu_VramRecBg3Rows167verifiedVRAM $6A00 = $7E:5200, $400 bytes.
$C2:FC37Menu_VramRecBg3Rows627verifiedVRAM $6FC0 = $7E:4E00, $80 bytes.
$C2:FC3EMenu_VramRecBg3Rows607verifiedVRAM $6F80 = $7E:5D00, $100 bytes.
$C2:FC45Menu_VramRecBg3Rows587verifiedVRAM $6F40 = $7E:5C80, $100 bytes.
$C2:FC4CMenu_VramRecBg3Rows487verifiedVRAM $6E00 = $7E:4E00, $400 bytes.
$C2:FC53Menu_VramRecUnkFC537verifiedVRAM $7800 = $7E:6E00 (Menu_SlotLabelArea), $800 bytes: the slot labels and the three Menu_SlotTextBufs after them (queued by Menu_LoadInit and by Menu_UnkD065 at $C2:D071; the text threads send...
$C2:FC5AMenu_VramRecDigits7verifiedVRAM $5740 = $7E:8E80 (Menu_ShadowTiles), $140 bytes.
$C2:FC61Menu_VramRecUnkFC617verifiedVRAM $1800 = $7E:3600, $600 bytes (queued by Menu_NameChoiceInit, which builds the choice screen's map there from MenuRom_NameChoiceMap).
$C2:FC68Menu_VramRecRomTiles7verifiedVRAM $2010 = MenuRom_VramTiles ($FF:EB88), $480 bytes; its last byte ($FC6E) is .Size's high byte, so its .Unk7 (the byte after it, $FC6F) is the first of Menu_VramRecsFont.
$C2:FC6FMenu_VramRecsFont16verifiedTwo Menu_VramRec records Menu_LoadGraphics copies into Menu_VramQueue: VRAM $0000 = Menu_TileBuf ($2000 B) and VRAM $7000 = Menu_Bg3TileBuf ($1000 B).
$C2:FC7FMenu_VramRecFontB8verifiedVRAM $1000 = Menu_TileBuf, $1300 bytes (Menu_LoadGraphics step 2).
$C2:FC87Menu_VramRecObj8verifiedVRAM $4000 (the sprite tiles) = Menu_TileBuf, $800 bytes (Menu_LoadGraphics step 5).
$C2:FC8FMenu_VramRecsWin23verifiedThree records Menu_LoadGraphics copies (24 bytes: the third record's unused last byte is the first byte of MenuRom_DefaultConfig, $C2:FCA6): VRAM $2010 = $FF:0000 ($1F80 B), VRAM $3000 =...
$C2:FCA6MenuRom_DefaultConfig3verifiedThe first of the 12 bytes Menu_ClearConfigAndFlags copies to Menu_Config for a new game ($84, $A0, $01; MenuRom_DefaultButtonMap follows as bytes 3-11).
$C2:FCA9MenuRom_DefaultButtonMap9verifiedBytes 3-11 of the new game's Menu_Config: the default button map as masks in the Pad_Pressed layout that Menu_PollPad builds (low byte A X L R B Y Select Start, not JOY1's: $08 is B and $02 Select...
$C2:FCB2Menu_ShopBuyQtyInit47verifiedThe count window's start for a buy: Menu_ItemCount = 1, Menu_ShopPriceHi = 0, Menu_ShopPrice and Menu_ShopUnitPrice = Menu_ShopBuyPrices[Menu_ItemId] (a word; B = 0 from the TDC for the index)...
$C2:FCE1Menu_ShopSellQtyInit60verifiedThe same for a sale: the price is the Menu_ItemInfo1 word of Menu_ItemId halved, rounded up (the LSR's carry added with the Menu_Unk51 word, expected 0), and the dividend 9,999,999 - the gold...
$C2:FD1DMenu_ShopDivide59verifiedMenu_ShopQuot (3 bytes) = the 24-bit Menu_Tmp00-02 / the 16-bit Menu_ShopMulArg, the remainder in Menu_ShopRem: the dividend goes to Menu_ShopQuot+1 to +3 (two word stores; the second also writes...
$C2:FD58Menu_UnkFD5816verifiedMenu_ShopProduct = the Menu_Tmp00 word x the Menu_ShopMulLen bytes at Menu_ShopMulArg: Menu_UnkFD68 for the low byte, then the high byte (Menu_Tmp01 into WRMPYA) through the rest of Menu_UnkFD68...
$C2:FD68Menu_UnkFD6847verifiedMenu_ShopProduct (4 bytes) = 0, then for each of the Menu_ShopMulLen bytes of Menu_ShopMulArg (X from Menu_Unk51, expected 0; Y from the Menu_Unk51 word) its hardware product with Menu_Tmp00's low...
$C2:FD97Menu_ShopGainGold36verifiedThe gold (Menu_Unk2C53, 3 bytes) + Menu_ShopPrice (3 bytes); a carry out of the third byte sets it to Menu_GoldMax's ($98), never in practice (at most 9,999,999 + 99 x 65,535, a 16-bit unit price...
$C2:FDBBMenu_ShopPayGold36verifiedThe gold - Menu_ShopPrice (3 bytes); a borrow sets the third byte to $98 as Menu_ShopGainGold's carry does, so paying more than the gold would leave $98xxxx (then capped at 9,999,999 or not)...
$C2:FDDFMenu_ShopCapGold43verifiedCaps the gold (Menu_Unk2C53, 3 bytes) at Menu_GoldMax (9,999,999): when it is at or above it, it becomes Menu_GoldMax and X = Menu_GoldCapped (also for exactly 9,999,999, stored again); else X = 0.
$C2:FE0AMenu_Mode0FList2verifiedMenu_ModeLists entry $0F: Menu_Exit alone (it never returns, so no second entry is read; the bytes after it are not a list).
$C2:FE0CBankC2_OldBuildLeftovers500verifiedNot code and, as far as found, never read: tools/xref.py, run on every address of $C2:FE0C-$FFFF, finds no call or jump from matched code.
$C3:0000BankC3_Entry00002verifiedthe bank's entry vectors, reached from other banks by JML/JSL: $0000 BankC3_Entry0000 → C3_BootModule (JML from Field_HookLeaveToBankC3 and Evt_OpFF_Misc; never returns) $0002 Decomp_ToWramVec →...
$C3:0002Decomp_ToWramVec6verified
$C3:0008BankC3_Entry00086verified
$C3:000EBankC3_Entry000E3verified
$C3:0011BankC3_Entry00113verified
$C3:0014C3_BootModule99verifiedLeaves the field for the program packed at $C3:1313 (the bank $C3 module): points the NMI and IRQ trampolines at C3_BootNmi and C3_BootIrq, keeps the caller's A in C3_EntryArg, unpacks the module...
$C3:0077WinFx_BuildCircle326verifiedWrites a window table for a circle: one 2-byte entry per line (left edge, right edge; WinFx_EmptyEntry = nothing on that line) at WinFx_TablePtr, in bank $7F if WinFx_TableBank bit 0 is set, else $7E.
$C3:01BDWinFx_Exit9verified
$C3:01C6WinFx_FillEmpty4verifiedFills window-table entries with WinFx_EmptyEntry: stores it at X and copies it forward with an MVN of WinFx_Tmp + 1 bytes into X + 2 on (the bank by WinFx_TableBank bit 0).
$C3:01CAWinFx_FillEmptyFrom26verified
$C3:01E4WinFx_StepWipe249verifiedOne frame of a per-line wipe, run while WinFx_C3EMode is nonzero (Field_HookWinC3E calls it once a frame through BankC3_Entry000E and uses the result as HDMA data for window 2, probably one window...
$C3:02DDC3_RandomByte42verifiedReturns a new pseudo-random byte in A and keeps it in C3_RandSeed: A (with C rotated in) plus C3_RandSeed, stored; then X's low byte, the seed, C3_FrameCount, the H counter (OPHCT; the counters...
$C3:0307C3_ScaleBitmap546verifiedDraws a scaled copy of a bitmap (one byte per pixel, bits 0-3 used, 64-byte source rows from C3Scale_SrcBase) into rows of 4-bitplane bytes, 32 bytes per output row from C3Scale_Dest.
$C3:0529C3_BootIrq31verifiedIRQ handler of the bank $C3 module, during its unpacking and after: C3_BootModule points the IRQ trampoline here, and no write to the trampolines ($0500-$0507) was found in the unpacked module...
$C3:0548C3_BootNmi15verifiedNMI handler while the module is unpacked: acknowledges the NMI (RDNMI) and sets INIDISP to full brightness, display on, ending the forced blank C3_BootIrq set at line 211 of the frame before.
$C3:0557Decomp_ToWram860verifiedUnpacks the data at Decomp_SrcBank:Decomp_Src into WRAM from Decomp_Dest, writing through WMDATA, and stores the number of bytes written in Decomp_OutLen.
$C3:08B3C3_ModuleNmi22verifiedThe module's NMI handler (C3_ModuleFrame points the NMI trampoline here when it ends): saves A, X, Y, DP and DB, runs one frame (C3_ModuleFrame), sends a pending song request (C3_SongCheck), and...
$C3:08C9C3_NmiBusy7verifiedNMI handler while C3_ModuleFrame runs (it points the NMI trampoline here first): acknowledges the NMI (RDNMI) and returns, so a frame that overruns is not re-entered.
$C3:08D0C3_ModuleFrame117verifiedOne frame of the module, from its NMI: DP = DB = 0, acknowledges the NMI, HDMA off, the NMI trampoline to C3_NmiBusy, interrupts on again if C3_EntryArg has C3_BootIrqOn, forced blank; then...
$C3:0945C3_IrqAck7verifiedAn IRQ handler that only acknowledges the IRQ (TIMEUP) and returns.
$C3:094CC3_MulSigned80verifiedSigned multiply with the CPU multiplier: C3_MulA (16-bit) x C3_MulB (8-bit) into C3_MulProduct, signed.
$C3:099CC3_CopyFEto7E4verifiedMVN from ROM bank $FE (C3Rom_PackPtrs' bank) to WRAM bank $7E, then RTL: copies A + 1 bytes from $FE:X to $7E:Y.
$C3:09A0C3_CopyFEto7F4verifiedAs C3_CopyFEto7E, to WRAM bank $7F.
$C3:09A4C3_SongCheck53verifiedSends a song change to the sound driver: unless C3_SongBusy is set or C3_EntryArg has bit 5 (C3_EntryNoSong), and if C3_SongReq differs from C3_SongCur, it copies the request to C3_SongCur and...
$C3:09D9C3_CopyCodeOrder16verifiedEight source offsets for C3_BuildCopyCode's outer passes: $000, $200, $100, $300, $400, $600, $500, $700 (16-bit, indexed by the pass x 2).
$C3:09E9C3_BuildCopyCode165verifiedWrites a routine through WMDATA (WMADD set by the caller): 1,024 pairs LDA abs / STA dp (each a 16-bit word, so the routine runs with M=0), with LDA #page / TCD before every 128 pairs, and a final...
$C3:0A8EC3_ReadPad113verifiedThe module's pad handling, once a frame: waits for the auto-joypad read, keeps JOY1 in C3_Pad; L+R+Select+Start alone (C3_PadSoftReset) resets the game (forced blank, NMI and HDMA off, JML Reset)...
$C3:0AFFC3_RunScript441verifiedRuns a script of the module from C3Script_Ptr until an opcode yields.
$C3:0CB8C3_TaskListRemove21verifiedClears the first word of C3_TaskList equal to X.
$C3:0CCDC3_NmiListRemove21verifiedAs C3_TaskListRemove, for C3_NmiTaskList.
$C3:0CE2C3_TaskListAdd22verifiedStores X in the first zero word of C3_TaskList (no bound: a full list is searched past its end).
$C3:0CF8C3_NmiListAdd22verifiedAs C3_TaskListAdd, for C3_NmiTaskList (run by C3Mod_RunNmiTasks).
$C3:0D0EC3_SprListSmall80verifiedAdds a list of small sprites to the OAM shadow: the list (in bank $7E at A, read through WMDATA) is a byte n + 1, then n records of tile, attribute, X, Y.
$C3:0D5EC3_SprListLarge94verifiedAs C3_SprListSmall for large sprites with a 9-bit X: X = byte + C3_SprBaseX (16-bit); from $100 up it is replaced by $101 (off screen, through the word C3_OffscreenX: low byte $01, bit 15 set); a...
$C3:0DBCC3_SprOneSmall55verifiedAdds one small sprite from a 4-byte record in bank $7E at X (tile, attribute, X, Y; X and Y + C3_SprBaseX / C3_SprBaseY, 8-bit) at C3_OamPos; its high-table byte (through C3_OamHiPtr) is shifted...
$C3:0DF3C3_SprOneLarge54verifiedAs C3_SprOneSmall for a large sprite: the high-table byte is always shifted right by 2 with size = 1 and X bit 8 = 0.
$C3:0E29C3_FindDivisor13verifiedCounts the divisor up until the quotient falls below C3_ScratchF4: each pass waits two NOPs, adds 1 to X, reads the quotient of the division running (RDDIVL) and starts the next one with WRDIVB =...
$C3:0E36BankC3_StaffText196verifiedASCII, lines ended by $0A (the text starts with a $0A, so its first line is empty): the staff of the jet-bike race (the module), as in the ROM ("JONNY" spelt so).
$C3:0EFAWinFx_BuildQuad263verifiedWrites a window table (2 bytes per line: left edge, right edge) for the four-sided shape through WinFx_QuadPoints (X, Y bytes of points 0-3, in order) at WinFx_QuadTablePtr in bank...
$C3:1001WinFx_QuadEdgeFlat36verified
$C3:1025WinFx_QuadEdge149verifiedDraws one edge of WinFx_BuildQuad's shape into the table byte column WinFx_QuadTablePtr points at (left bytes, or right bytes once it was moved up by one): from (WinFx_QuadX0, WinFx_QuadY0) to...
$C3:10BAWinFx_QuadExit6verified
$C3:10C0BankC3_EndMarker11verifiedASCII "CODE END C3" right after the kernel's last RTL ($C3:10BF, WinFx_QuadExit's, where WinFx_QuadEdge and WinFx_BuildQuad end), probably left by the build to mark the end of the code.
$C6:E000C6Scene_Win1HdmaOn40verifiedScript routine (pack 1 +$05C3): sets up C2Scene_HdmaTable[0] (two runs of 112 lines) as HDMA channel 1 to WH0/WH1 (indirect, two registers) and turns the channel on: the set-up part of...
$C6:E028C6Scene_UnpackObjPackA37verifiedScript routine (pack 0 +$11FD, pack 2 +$0295 and +$08A0, pack 3 +$02F8, pack 4 +$0D1D and +$112C, pack 5 +$020F and +$02BA, pack 6 +$0A15): unpacks entry C6Scene_ObjPackA of C2SceneRom_ObjPacks...
$C6:E04DC6Scene_UnpackPalPackA37verifiedScript routine (pack 0 +$120D, pack 2 +$02A5 and +$08B0, pack 3 +$0308, pack 4 +$0D3D and +$113C, pack 5 +$021F and +$02CA, pack 6 +$0A25; each two script ops after an object unpack, an op $03 on...
$C6:E072C6Scene_FadeGradInit143verifiedScript routine (pack 3 +$031E): a fade from white.
$C6:E101C6Scene_PlaceOnEdgeRandom111verifiedScript routine (pack 3 +$05CB): puts the task on the edge of a shape drawn as a table of 2-byte line entries (left edge, right edge, by the use; pack 3 sets C2Tmp_10-$12 to $7E:9176 with op $13...
$C6:E170C6Scene_Grad2Init143verifiedScript routine (pack 4 +$02CE): sets up C2Scene_HdmaTable[1] (two runs of 112 lines) as HDMA channel 2 to COLDATA (indirect, one register), turns it on, points C2Scene_HdmaValues words 2-3 at...
$C6:E1FFC6Scene_Grad2Ramp56verifiedScript routine (pack 4 +$039A): writes C6Scene_Grad2Init's 48-line ramp (16 down to 9, two lines each; 8 down to 1, four each) into C6Scene_Grad2 at the byte offset .Var22 (through WMDATA, bank $7E).
$C6:E237C6Scene_GetFlagF2Bits10verifiedScript routine (pack 1 +$0184): C2Tmp_00 = bits 2-5 of the copy of $7F:01F2 (C2Scene_FlagTailCopy+2) as a number 0-15, probably for the script's next test of $0000.
$C6:E241C6Scene_WipeWinInit61verifiedScript routine (pack 0 +$0FB0, pack 2 +$0442, pack 5 +$0162, pack 7 +$094E, each followed by C6Scene_WipeWinStep): sets up C2Scene_HdmaTable[1] (two runs of 112 lines) as HDMA channel 2 to WH1...
$C6:E27EC6Scene_WipeWinStep49verified
$C6:E2AFC6Scene_ClearUnk7F00626verifiedScript routine (pack 0 +$0FE3, pack 2 +$0475, pack 3 +$0670, pack 5 +$01B2, pack 7 +$0981, each soon after a C6Scene_WipeWinStep): zeroes C6Scene_Unk7F0062 (what reads it is not traced).
$C6:E2B5C6Scene_Bg3Accel99verifiedScript routine (pack 4 +$0947 and +$0953): moves BG3 by the task's velocity, the fractions kept in .XFrac/.YFrac and the whole pixels added to C2Scene_Bg3HScroll/VScroll (as C2Scene_TaskMove does...
$C6:E318C6Scene_Win1HdmaOnB40verifiedScript routine (pack 6 +$08A1 and +$0937, each followed by C6Scene_Win1EllipseStep): a byte-identical copy of C6Scene_Win1HdmaOn (HDMA channel 1 to WH0/WH1 from C2Scene_HdmaTable[0], turned on).
$C6:E340C6Scene_Win2HdmaOn40verifiedScript routine (pack 6 +$071A and +$08DF, each followed by C6Scene_Win2EllipseStep): sets up C2Scene_HdmaTable[1] (two runs of 112 lines) as HDMA channel 2 to WH2/WH3 (indirect, two registers) and...
$C6:E368C6Scene_Win1EllipseStep41verifiedScript routine (pack 6 +$08A5, +$08B0, +$08C7, +$093B, +$0944): adds one to .Var24 (a word) and takes C2Scene_HandBufB (now odd) or C2Scene_HandBufA (even) as the table: C2Scene_HdmaValues words...
$C6:E391C6Scene_Win2EllipseStep39verified
$C6:E3B8C6Scene_EllipseBuild144verified
$C6:E448C6Scene_Win1HdmaOnC40verifiedScript routine (pack 4 +$02A3, +$1570 and +$1769, pack 5 +$0494 and +$04DE, pack 6 +$06CE, each followed by C6Scene_Win1CapsuleStep): a byte-identical copy of C6Scene_Win1HdmaOn (HDMA channel 1 to...
$C6:E470C6Scene_Win2HdmaOnB40verifiedScript routine (pack 1 +$06FA, pack 4 +$1574 and +$176D, pack 5 +$0528, each followed by C6Scene_Win2CapsuleStep): a byte-identical copy of C6Scene_Win2HdmaOn (HDMA channel 2 to WH2/WH3 from...
$C6:E498C6Scene_Win1CapsuleStep38verifiedScript routine (pack 4 +$02C2 and 14 more sites to +$17FD, pack 5 +$0498 to +$04FC (6 sites), pack 6 +$06D5 to +$06FE (4 sites)): takes C2Scene_HandBufB (.Var26 odd) or C2Scene_HandBufA (even) as...
$C6:E4BEC6Scene_Win2CapsuleStep36verified
$C6:E4E2C6Scene_CapsuleBuild134verified
$C6:E568C6Scene_FadeGradStep27verifiedScript routine (pack 3 +$0339, in a loop the script runs 58 times, op $1B, with an op $32 in each pass): moves C2Scene_HdmaValues words 0 and 1 on by C6Scene_GradStepBytes (8 lines of...
$C6:E583C6Scene_Bg2VNudge18verifiedScript routine (no op $4E site found in the unpacked scripts): moves BG2 two pixels down (.Var22 bit 0 clear) or up (set): two INC or DEC of C2Scene_Bg2VScroll, 8-bit with M=1, so only its low...
$C6:E595C6Scene_Bg1WaveInit48verifiedScript routine (pack 5 +$03A1, followed by C6Scene_Bg1WaveStep): sets up C2Scene_HdmaTable[2] (two runs of 112 lines) as HDMA channel 3 to BG1VOFS (indirect, one register written twice), turns it...
$C6:E5C5C6Scene_Bg1WaveStep120verifiedScript routine (pack 5 +$03A5 and +$03AB): writes one frame of a vertical wave on BG1: picks C2Scene_SwirlSinA (.Var24 odd) or C2Scene_SwirlSinB (even), points C2Scene_HdmaValues words 4-5...
$C6:E63DC6Scene_SetUnk7F01ED7verifiedScript routine (pack 4 +$115D): C2Scene_Unk7F01ED = 1 (script op $3D then skips its sound command).
$C6:E644C6Scene_ClearUnk7F01ED6verifiedScript routine (pack 4 +$06E9 and +$083A): C2Scene_Unk7F01ED = 0.
$C6:E64AC6Scene_UnpackObjPackB37verifiedScript routine (pack 4 +$0D2D, between C6Scene_UnpackObjPackA and C6Scene_UnpackPalPackA): as C6Scene_UnpackObjPackA with entry C6Scene_ObjPackB of C2SceneRom_ObjPacks.
$C6:E66FC6Scene_UnpackPalPackB37verifiedScript routine (pack 4 +$0D55, after C6Scene_UnpackPalPackA): as C6Scene_UnpackPalPackA with entry C6Scene_PalPackB of C2SceneRom_PalettePacks (into C2Scene_PaletteStage).
$C6:E694C6Scene_PlaceInViewRandom60verifiedScript routine (pack 4 +$0FD3 to +$1015, 7 sites): puts the task at a random point: .SprX = BG2's tile X x 8 (C2Scene_BgTileX+2) + a random 0-127 + 64, as C2Scene_PlaceBelowView; .SprY = $60 + a...
$C6:E6D0C6Scene_NudgeRandomDir126verifiedScript routine (pack 4 +$0FAA): moves the task by a random distance d (0-63) in a random direction a (0-255, C2Scene_Unk2273/Unk2277's units): .SprX + cos(a) x d / 256 and .SprY + sin(a) x d /...
$C6:E74EBankC6_UnkE74E49verifiedTests the 8x8 tile (C2Tmp_00, C2Tmp_01) against a rectangle of columns C2Tmp_04 to C2Tmp_05 - 1 and rows C2Tmp_02 to C2Tmp_03 - 1 (unsigned bytes): C2Tmp_06 = 0 when the tile is inside, else bit 0...
$C6:E77FC6Scene_AddYAccel24verifiedScript routine (pack 4 +$0ED9 and 10 more sites to +$10DF): adds the 16.16 value .Var22 (fraction) / .Var24 (whole) to the task's Y velocity (.YVelFrac, carrying into .YVel): C2Scene_AddGravity...
$C6:E797BankC6_UnkE79799verifiedObject A's landing check (the name is the stub's: verified C2Scene_ObjAFly calls it so; better: C6Scene_ObjANoLandHere).
$C6:E7FAC6Scene_MapPicture205verifiedScript routine (pack 0 +$11F0): draws the Mode 7 picture of the two maps as C2Scene_MapDrawPixels does, but whole: zeroes C2Scene_DecompBuf ($7F:9000-$BFFF, C6Scene_PicBytes), then for each of the...
$C6:E8C7C6Scene_MapCellPixels72verifiedDraws one metatile cell as two pixels, at [C6Scene_PicOut] and 8 bytes (one pixel row) below: the colours (C2Scene_TileColors) of the metatile's top-right and bottom-right tiles, each ORed with...
$C6:E90FC6Scene_PerspInit230verifiedScript routine (pack 0 +$11F7): sets up HDMA channels 2-5 to M7A, M7B, M7C and M7D (indirect, one register written twice: a word a line) from C2Scene_HdmaTable[1]-[4] (two runs of 112 lines each...
$C6:E9F5C6Scene_PerspStep294verified
$C6:EB1BC6Scene_PerspQuadrants8verifiedC6Scene_PerspStep's fill for each sign pair (index = C2Tmp_10 bits 0-1: cos < 0, sin < 0).
$C6:EB23C6Scene_PerspTiltSteps24verifiedThe depth step t per line pair (8.8, so 0 to just under 1), read by C6Scene_PerspStep at .Tilt (a byte offset; pack 0 steps it up with op $0B and down with op $0C, e.g. +$1369, +$139B, +$1481...
$C6:EB3BC6Scene_PerspQuad091verifiedThe fills of C6Scene_PerspStep, one per quadrant (C6Scene_PerspQuad0 and the sub-entries C6Scene_PerspQuad1 ($C6:EB96), C6Scene_PerspQuad2 ($C6:EC09) and C6Scene_PerspQuad3 ($C6:EC7C), reached...
$C6:EB96C6Scene_PerspQuad1115verified
$C6:EC09C6Scene_PerspQuad2115verified
$C6:EC7CC6Scene_PerspQuad3136verified
$C6:ED04C6Scene_PerspTail221verified
$C6:EDE1C6Scene_PerspDivide66verifiedThe four quotients of a line pair (WRDIV/RDDIV): C2Tmp_00 = |c| / dA, C2Tmp_02 = |s| / dA, C2Tmp_04 = -(|s| / dB), C2Tmp_06 = |c| / dB, with |c|, |s| = C2Tmp_08, C2Tmp_0A and the 8-bit divisors dA...
$C6:EE23C6Scene_AddAngle14verifiedScript routine (pack 0 +$1248 and 14 more sites to +$146F, each before C6Scene_PerspStep): .Angle (+$22) + C2Tmp_08.
$C6:EE31C6Scene_SetUnk7F00CD7verifiedScript routine (pack 2 +$09A3 and +$09AE, pack 7 +$0779, +$0A27, +$0A32, +$0A5F, +$0A6A): C2Scene_Unk7F00CD = C2Tmp_00 (8-bit; set by the script before).
$C6:EE38C6Scene_ClearUnk7F01F5Bit011verifiedScript routine (pack 2 +$08CF): clears bit 0 of C2Scene_Unk7F01F5.
$C6:EE43BankC6_CodeEndFill445verified$00 fill after the last routine, up to the data from $C6:F000 on.
$C7:0000Audio_DriverInit4verifiedThe bank's entry block: four 3-byte JMPs, each followed by a NOP.
$C7:0004Audio_DriverCommand4verified
$C7:0008Audio_VecLoadNewSamples4verified
$C7:000CAudio_VecSendSampleDir4verified
$C7:0010Audio_BootBlockPtrs12verifiedThe six blocks Audio_Boot sends through the IPL ROM, in this order, as bank $C7 addresses.
$C7:001CAudio_BootBlockAram12verifiedThe ARAM destination of each Audio_BootBlockPtrs block (sent in APUIO2/3 with the IPL ROM's transfer command).
$C7:0028Audio_TableDirectory16verifiedEight bank $C7 addresses: the tables the code below reads.
$C7:0038Audio_Boot264verifiedStarts the sound driver from nothing, through the APU's IPL ROM: 1.
$C7:0140Audio_RunCommand21verifiedRuns the command in Audio_CmdId (arguments Audio_CmdArg0-2), then clears Audio_CmdId.
$C7:0155Audio_RunCommand_Dispatch61verified
$C7:0192Audio_CommandDone15verified
$C7:01A1Audio_CmdLoadSong389verifiedCommands $10, $11, $14 and $15 (Audio_SongCmdTable): load song Audio_CmdArg0.
$C7:0326Audio_LoadNewSamples85verifiedSong load, part 2: puts each sample of Audio_NewSamples in the next free slot with Audio_UploadSample, in list order.
$C7:037BAudio_SendSampleDir325verifiedSong load, part 3: sends the song's samples' directory entries and parameter words.
$C7:04C0Audio_SendSongData348verifiedSong load, part 4, and its end: 1.
$C7:061CAudio_CmdSend57verifiedCommands $18-$2F and $80-$FF: sends the block to the APU as it is: APUIO3 = Audio_CmdArg2, APUIO2 = Arg1, APUIO1 = Arg0, then APUIO0 = Audio_CmdId, and reads APUIO0 up to !Audio_Timeout times for...
$C7:0655Audio_UploadSample200verifiedSends the sample in slot Audio_SaveX (Audio_SlotSample entry, 1-62) to ARAM at the slot's Audio_SlotAram address: a triples transfer (!Audio_XferTriples), retried after Audio_AbortXfer until...
$C7:071DAudio_CmdSongAlias23verifiedCommands $30-$3F: replaces the whole command block with entry (command & $0F) of Audio_SongAliasTable (command $10, song = the low nibble, Arg1 = Arg2 = $FF) and sorts it again from...
$C7:0734Audio_AdjustSongCmd33verifiedSets bit 2 (!Audio_CmdListedBit) of Audio_CmdId when the command is $14 or above, or when Audio_CmdArg0 is on Audio_SongBit2List (bytes up to the first one with bit 7 set).
$C7:0755Audio_CmdSwapSample398verifiedCommand $71: puts sample Audio_CmdArg0 (1-62; not range-checked) in the slot of the current song's first sample (Audio_FirstSlot), so directory entry $20 plays it.
$C7:08E3Audio_CmdBlockVariant63verifiedCommand $70: picks the $2F00 block by Audio_CmdArg0 (0 = AudioRom_Block2F00, nonzero = AudioRom_Block2F00Alt; the battle music cues send 1 before a battle and 0 after it).
$C7:0922Audio_UploadBlock2F00184verifiedSends the $1800-byte block for ARAM !AudioAram_Block2F00: AudioRom_Block2F00 while Audio_Unk1E10 is 0, AudioRom_Block2F00Alt otherwise.
$C7:09DAAudio_SendSeq16verifiedOne step of a transfer: writes A to APUIO0 and waits (no limit) until APUIO0 reads back the same value, then returns the next sequence value, (A + 1) & !Audio_SeqMask.
$C7:09EAAudio_AbortXfer19verifiedCalled when the APU did not echo a header's mode in APUIO1: sends one more step with APUIO0 = Audio_Seq (waits for the echo, no limit; APUIO1-3 as the header left them) and resets Audio_Seq to...
$C7:09FDAudio_SetEchoDelay21verifiedAudio_EchoDelay = A, Audio_EchoPage = !Audio_EchoTopPage - 8 x A, then Audio_DropEchoSlots.
$C7:0A12Audio_DropEchoSlots39verifiedFinds the first slot whose end (the next Audio_SlotAram entry; its high byte, the page) is on or above Audio_EchoPage and empties it and every slot after it: from there, byte by byte up to slot...
$C7:0A39Audio_StartSong95verifiedThe first part of a song load: sends the song command to the APU.
$C7:0A98Audio_SongAliasTable64verifiedAudio_CmdSongAlias: for command $30 + n, the command block it becomes (command, Arg0, Arg1, Arg2): $10, n, $FF, $FF.
$C7:0AD8Audio_SongBit2List1verifiedAudio_AdjustSongCmd's song list, ended by a byte with bit 7 set.
$C7:0AD9Audio_SongCmdTable16verifiedAudio_RunCommand_Dispatch's jump table for commands $10-$17 (JMP (T,X) with X = (command & $0F) x 2).
$C7:0AE9Audio_SongCount1verifiedThe number of songs (Audio_SongTable entries); Audio_CmdLoadSong ignores a song number not below it.
$C7:0AEAAudio_SampleTable186verified62 long pointers, one per sample (sample n at entry n - 1; 62 is the largest number in AudioRom_SongSamples): BRR data, probably (every length is a multiple of 9, the BRR block size), a 16-bit...
$C7:0BA4Audio_SampleLoop124verifiedOne word per sample: the loop start as an offset from the sample's ARAM start (Audio_SendSampleDir and Audio_CmdSwapSample add it to get the directory entry's second word).
$C7:0C20Audio_SampleParamA124verifiedOne word per sample, sent to !AudioAram_SongParamA for the song's samples (meaning not traced on the SPC700 side).
$C7:0C9CAudio_SampleParamB124verifiedOne word per sample, sent to !AudioAram_SongParamB: first byte $FF or $FE; second byte $E0 for most, otherwise $EA-$F4; the ADSR pair, probably (from the values only).
$C7:0D18Audio_SongTable249verifiedAudio_SongCount ($53) long pointers, one per song: its data, a 16-bit length first (Audio_SendSongData sends it to !AudioAram_Song).
$CF:F9F7BankCF_DeadShift34verifiedFour bytes between BattleCF_PlaceEnemyParts and Battle_SinLookupCF that decode as LSR A three times and RTS (A / 8).
$CF:FE85BankCF_EndFill376verified$FF fill after the last routine.
$D1:FEF4BankD1_EndFill268verified$FF fill after the last routine, to the end of the bank.
$FD:BA61RandomTableFD256verifiedA byte-identical copy of RandomTable ($C0:FE00): the same shuffle of 0-255.
$FD:BB61BankFD_RandomTableTail1,183verifiedNothing found reads it: no matched code refers to it and xref finds no call or jump into it.
$FD:C0D7Ppu_SetBgLayout77verifiedSets a fixed background layout through DP=$2100, the way MainInit writes the PPU: mode 1 with BG3 on top, BG1/BG2 tiles at VRAM word $1000 and BG3 tiles at $5000, 64x32 maps at $6800 (BG1), $7000...
$FD:C124EngFD_UnkC124202verifiedFills the HDMA data block in bank $7F (DB = $7F while it runs).
$FD:C1EEHdma_InitChannelsFD211verifiedSets up all 8 HDMA channels through DP=$4300 (saved and restored): channel 0: indirect, 4 registers from BG1SC (BG1SC-BG4SC); channels 1-3: indirect, 2 registers written twice, from BG1HOFS...
$FD:C2C1EngFD_UnkC2C130verifiedOnce a frame: runs entry !Field_Unk26 (0-2) of one of two handler tables and flips !Field_Unk53 bit 0.
$FD:C2DFEngFD_UnkC2C1Table16verifiedEngFD_UnkC2C1's handlers by !Field_Unk26 when !Field_Unk53 bit 0 is set.
$FD:C2E5EngFD_UnkC2C1Table06verifiedThe same when !Field_Unk53 bit 0 is clear.
$FD:C2EBFieldHdma_BuildPlainA334verifiedEngFD_UnkC2C1's handler for Field_Unk26 = 0 on the frames Field_Unk53 bit 0 is set; FieldHdma_BuildTopBandA/BottomBandA come here while Field_Unk27 is 0.
$FD:C439FieldHdma_SetWin2A62verifiedWrites set A's channel 7 table (WH2 or WH3, one byte a line): repeat runs of 100 and 112 lines from WinFx_TableA + WinFx_Ch7Alt ($E0) when Hdma_Unk7F0351 bit 0 is clear, from WinFx_TableA when it...
$FD:C477FieldHdma_SetWin2B62verifiedAs FieldHdma_SetWin2A for set B's channel 7, with the test inverted: WinFx_TableA + WinFx_Ch7Alt when Hdma_Unk7F0351 bit 0 is set, WinFx_TableA when it is clear (both sets read WinFx_TableA's area).
$FD:C4B5FieldHdma_SetBg2A121verifiedWrites set A's channel 2 table (BG2 H/V scroll): Map_Unk1DFD = 0: 100 + 112 lines of Hdma_Bg2Scroll; else 13 repeat runs of 16 lines, each from Hdma_WaveA, so BG2 gets BG3's wave data (Map_Unk1D8F...
$FD:C52EFieldHdma_SetBg2B121verifiedAs FieldHdma_SetBg2A for set B: Hdma_Bg2Scroll+4 or Hdma_WaveB.
$FD:C5A7FieldHdma_FillDataA336verifiedFills the data set A's tables point at: - Hdma_Bg1Scroll = Map_Unk1D87, Map_Unk1D89; Hdma_Bg2Scroll = Map_Unk1D8B, Map_Unk1D8D; - with Field_Unk1DF9 and Map_Unk1DFD both 0 (each tested as a word...
$FD:C6F7FieldHdma_FillDataB336verifiedAs FieldHdma_FillDataA for set B: Hdma_Bg1Scroll+4, Hdma_Bg2Scroll+4, Hdma_Bg3Scroll+4, Hdma_WaveB (copied to Hdma_WaveBCopy), Hdma_ColorMath+2/+3 and Hdma_Unk7F1530+2; Map_Unk1DFB is stepped here...
$FD:C847FieldHdma_BuildPlainB334verifiedAs FieldHdma_BuildPlainA for table set B (Field_Unk26 = 0 on the frames Field_Unk53 bit 0 is clear): Hdma_Bg1Scroll+4, Hdma_Bg3Scroll+4 or Hdma_WaveB, WinFx_TableB for channel 5, Hdma_ColorMath+2...
$FD:C995FieldHdma_BuildTopBandA707verifiedEngFD_UnkC2C1's handler for Field_Unk26 = 1 on the frames Field_Unk53 bit 0 is set.
$FD:CC58FieldHdma_WaveRunsStart6verifiedStarts a band builder's BG3 wave table: Y = 0 (offset of the first entry) and HdmaWave_Line = 0 (a 16-bit store, so $01EF too).
$FD:CC5EFieldHdma_AddWaveRunA84verifiedAdds A lines (8-bit) of the BG3 wave to set A's channel 3 table at offset Y: while A >= 16, an entry ($90: repeat, 16 lines) from Hdma_WaveA + 4 x (HdmaWave_Line AND $F) with HdmaWave_Line += 16...
$FD:CCB2FieldHdma_SkipWaveLines6verifiedHdmaWave_Line += A: steps the wave line count over the band's lines, which the band builders write themselves (A and B alike).
$FD:CCB8FieldHdma_AddWaveRunB84verifiedAs FieldHdma_AddWaveRunA for set B's channel 3 table, from Hdma_WaveB (and Hdma_WaveBCopy).
$FD:CD0CFieldHdma_BuildTopBandB707verifiedAs FieldHdma_BuildTopBandA for table set B (Field_Unk26 = 1 on the frames Field_Unk53 bit 0 is clear; n = 0 goes to FieldHdma_BuildPlainB): the set B pairs (Hdma_Bg1Scroll+4, Hdma_Bg3Scroll+4...
$FD:CFCFFieldHdma_BuildBottomBandA687verifiedEngFD_UnkC2C1's handler for Field_Unk26 = 2 on the frames Field_Unk53 bit 0 is set.
$FD:D27EFieldHdma_BuildBottomBandB687verifiedAs FieldHdma_BuildBottomBandA for table set B (Field_Unk26 = 2 on the frames Field_Unk53 bit 0 is clear; n = 0 goes to FieldHdma_BuildPlainB), with the set B data and helpers as in...
$FD:D52DEngFD_UnkD52D167verifiedEngFD_UnkC124's helper: builds a table of (CGADSUB, COLDATA) byte pairs at $7F:1538 (channel 6's registers in Hdma_InitChannelsFD), then copies $100 bytes from $7F:1538 to $7F:1600 (MVN; the...
$FD:D5D4FieldHdma_OldBuildLeftovers1,068verifiedNot code that runs: xref finds no call or jump to $FD:D5D4 or to the segment starts below except the one JSR inside the first segment.
$FD:DA00M7Scene_Run8095verifiedEvent $FF $80's scene, 768 frames: M7Scene_Init, then every frame: wait for the NMI, M7Scene_UpdateScroll, then by M7Scene_Frame: below $20 the iris opens (radius M7Scene_IrisRadii[frame], W12SEL...
$FD:DA5FM7Scene_Run8195verifiedEvent $FF $81's scene: as M7Scene_Run80 with a shorter schedule, 256 frames: the iris opens below $20, stays open below $A0, closes below $C0, then BG1 is masked; it ends on the frame that sees...
$FD:DABEM7Scene_Run8295verifiedEvent $FF $82's scene: as M7Scene_Run80 with a shorter schedule, 160 frames: the iris opens below $20, stays open below $40, closes below $60, then BG1 is masked; it ends on the frame that sees...
$FD:DB1DM7Scene_Run83122verifiedEvents $FF $83-$8F's scene: M7Scene_Run80's 768-frame schedule, plus a flicker: each frame, after the NMI (which sets full brightness), M7Scene_FlickerFrac += $98 and M7Scene_FlickerIdx steps by...
$FD:DB97M7Scene_Init294verifiedSets the scene up with interrupts off: DP=$0500, DB=$00, DMA and HDMA off, forced blank, NMI off; M7Scene_Zero = 0; M7Scene_SetVectors, M7Scene_InitPpu, M7Scene_SaveWram7F; copies...
$FD:DCBDM7Scene_UpdateScroll217verifiedEach frame: writes the M7Scene_Scroll records the HDMA channels 3 and 4 send.
$FD:DD96M7Scene_IrisRadii31verifiedThe iris radius for frames 0-30 of an opening or closing (indexed by M7Scene_Frame & $1F): it grows from 2 to $7F, faster and faster.
$FD:DDB5M7Scene_OamInit64verifiedOAM low-table entries (X, Y, tile, attributes) for sprites 0-15, copied by M7Scene_Init; the attributes use all four flip combinations, so the one bitmap is drawn mirrored.
$FD:DDF5M7Scene_FlickerLevels32verifiedINIDISP brightness per flicker step (M7Scene_Run83): 15 down to 1, back up to 15, then 15 for the last nine steps.
$FD:DE15M7Scene_Nmi114verifiedThe scene's NMI handler (JML from NmiTrampoline, installed by M7Scene_SetVectors).
$FD:DE87M7Scene_Irq17verifiedThe scene's IRQ handler (JML from IrqTrampoline, installed by M7Scene_SetVectors): saves and restores A, X, Y, DB and DP and does nothing else (the SEP #$20 is undone by the REP #$30 after it).
$FD:DE98FieldFD_LoadAnimSetA394verifiedFdVec_FFFA's routine.
$FD:E022FieldFD_UploadTileAnims595verifiedFdVec_FFFD's routine, run from the field's IRQ (IrqHandler, on the frames Field_Unk53 bit 0 is set) to step the FieldAnimA records and send their tiles to VRAM.
$FD:E275PalAnim_StopAll29verifiedFdVec_FFEE's routine: sets .Unk0 of all 12 FieldAnimB records to 0 (kind 0: PalAnim_TickAll still steps their .Unk4 counter but runs no kind for them), so every palette animation stops.
$FD:E292FieldFD_LoadAnimSetB266verifiedFdVec_FFF4's routine.
$FD:E39CPalAnim_TickAll155verifiedFdVec_FFF7's routine.
$FD:E437PalAnim_CopyRomFrame78verifiedKind 1: copies .Unk2 colours from PalAnimRom + .Unk6 (a word, .Unk6/.Unk7) + .Unk3 x .Unk2 x 2 (frame .Unk3; product by the multiplier) to Pal_CgramBuf from colour .Unk1 (through PalAnim_Dest).
$FD:E485PalAnim_CopyListFrame99verifiedKinds 8-15: as PalAnim_CopyRomFrame, but the frame is the byte at .Ptr + .Unk3 (the list FieldFD_LoadAnimSetB points .Ptr at), read through PalAnim_Dest before it is reused for the destination.
$FD:E4E8PalAnim_RotateUp74verifiedKind 3: rotates colours .Unk1 to .Unk1 + .Unk2 (.Unk2 + 1 colours, one more than the other kinds touch) up by one in both Pal_Buf and Pal_CgramBuf: each takes the colour below it, the top one...
$FD:E532PalAnim_RotateDown74verifiedKind 2: as PalAnim_RotateUp the other way: each of colours .Unk1 to .Unk1 + .Unk2 takes the colour above it, colour .Unk1 wraps to the top.
$FD:E57CPalAnim_Pulse40verifiedKind 7: the phase .Unk7 += .Unk3 (8-bit, wrapping); h = the high byte of 2|.Unk7| x .Unk8 (|$80| stays $80, and 2 x $80 is 0); the level is -h (8-bit), then PalAnim_ApplyLevel scales the colours...
$FD:E5A4PalAnim_Fade61verifiedKind 5: steps the level .Unk7 by .Unk3 toward .Unk8 (down when .Unk7 >= .Unk8).
$FD:E5E1PalAnim_ApplyLevel110verified
$FD:E64FPalAnim_ScaleRGB82verifiedPalAnim_ApplyLevel's routine for FieldAnimB.Unk6 = 0: for each of the .Unk2 colours from X, Pal_CgramBuf gets the Pal_Buf colour with red, green and blue scaled by the level in WRMPYA (channel x...
$FD:E6A1PalAnim_ScaleB48verifiedPalAnim_ApplyLevel's routine for FieldAnimB.Unk6 = 3: for each of the .Unk2 colours from X, Pal_CgramBuf gets the Pal_Buf colour with blue scaled by the level in WRMPYA (channel x level / 256, by...
$FD:E6D1PalAnim_ScaleG55verifiedPalAnim_ApplyLevel's routine for FieldAnimB.Unk6 = 5: for each of the .Unk2 colours from X, Pal_CgramBuf gets the Pal_Buf colour with green scaled by the level in WRMPYA (channel x level / 256, by...
$FD:E708PalAnim_ScaleR50verifiedPalAnim_ApplyLevel's routine for FieldAnimB.Unk6 = 6 or more: for each of the .Unk2 colours from X, Pal_CgramBuf gets the Pal_Buf colour with red scaled by the level in WRMPYA (channel x level /...
$FD:E73APalAnim_ScaleRB63verifiedPalAnim_ApplyLevel's routine for FieldAnimB.Unk6 = 2: for each of the .Unk2 colours from X, Pal_CgramBuf gets the Pal_Buf colour with red and blue scaled by the level in WRMPYA (channel x level /...
$FD:E779PalAnim_ScaleRG71verifiedPalAnim_ApplyLevel's routine for FieldAnimB.Unk6 = 4: for each of the .Unk2 colours from X, Pal_CgramBuf gets the Pal_Buf colour with red and green scaled by the level in WRMPYA (channel x level /...
$FD:E7C0PalAnim_ScaleGB71verifiedPalAnim_ApplyLevel's routine for FieldAnimB.Unk6 = 1: for each of the .Unk2 colours from X, Pal_CgramBuf gets the Pal_Buf colour with green and blue scaled by the level in WRMPYA (channel x level...
$FD:E807PalAnim_PulseWhite37verifiedKind 6: as PalAnim_Pulse, but toward white: the phase .Unk7 += .Unk3 (8-bit, wrapping); the level is h = the high byte of 2|.Unk7| x .Unk8 (not negated as in kind 7), then PalAnim_ApplyWhiteLevel...
$FD:E82CPalAnim_FadeWhite61verifiedKind 4: as PalAnim_Fade, but the level lightens the colours toward white (PalAnim_Whiten*: channel + (max - channel) x level / 256) instead of scaling them down, so level 0 leaves them unchanged.
$FD:E869PalAnim_ApplyWhiteLevel110verified
$FD:E8D7PalAnim_WhitenRGB94verifiedPalAnim_ApplyWhiteLevel's routine for FieldAnimB.Unk6 = 0: for each of the .Unk2 colours from X, Pal_CgramBuf gets the Pal_Buf colour with red, green and blue each lightened by the level in...
$FD:E935PalAnim_WhitenB45verifiedPalAnim_ApplyWhiteLevel's routine for FieldAnimB.Unk6 = 4: for each of the .Unk2 colours from X, blue is lightened as in PalAnim_WhitenRGB and written with Pal_Buf's green bits 3-4 to the high...
$FD:E962PalAnim_WhitenR45verifiedPalAnim_ApplyWhiteLevel's routine for FieldAnimB.Unk6 = 1: for each of the .Unk2 colours from X, red is lightened as in PalAnim_WhitenRGB and written with Pal_Buf's green bits 0-2 to the low byte...
$FD:E98FPalAnim_WhitenG59verifiedPalAnim_ApplyWhiteLevel's routine for FieldAnimB.Unk6 = 2: for each of the .Unk2 colours from X, Pal_CgramBuf gets the Pal_Buf colour with green lightened as in PalAnim_WhitenRGB and red and blue...
$FD:E9CAPalAnim_WhitenRB71verifiedPalAnim_ApplyWhiteLevel's routine for FieldAnimB.Unk6 = 5: for each of the .Unk2 colours from X, Pal_CgramBuf gets the Pal_Buf colour with red and blue lightened as in PalAnim_WhitenRGB and green...
$FD:EA11PalAnim_WhitenGB75verifiedPalAnim_ApplyWhiteLevel's routine for FieldAnimB.Unk6 = 6 or more: for each of the .Unk2 colours from X, Pal_CgramBuf gets green and blue lightened as in PalAnim_WhitenRGB.
$FD:EA5CPalAnim_WhitenRG74verifiedPalAnim_ApplyWhiteLevel's routine for FieldAnimB.Unk6 = 3: for each of the .Unk2 colours from X, Pal_CgramBuf gets red and green lightened as in PalAnim_WhitenRGB.
$FD:EAA6M7Scene_SaveWram7F17verifiedMode 7 scene, continued ($FD:EAA6–$FD:F28F): its helpers and tables (see the banner at M7Scene_Run80)
$FD:EAB7M7Scene_RestoreWram7F17verifiedCopies M7Scene_Save7F back to the 512 bytes at $7F0000.
$FD:EAC8M7Scene_ScreenOff18verifiedDMA and HDMA off, forced blank, NMI and joypad reading off, then SEI.
$FD:EADAM7Scene_ScreenOn17verifiedWaits for the start of a vertical blank (RDNMI bit 7), then NMI and joypad reading on, INIDISP = 0 (display on at brightness 0; the NMI sets full brightness), CLI.
$FD:EAEBM7Scene_WaitNmi9verifiedClears M7Scene_NmiFlag, waits until M7Scene_Nmi has incremented it, and clears it again.
$FD:EAF4M7Scene_SetVectors31verifiedPoints NmiTrampoline at M7Scene_Nmi and IrqTrampoline at M7Scene_Irq (a JML each).
$FD:EB13M7Scene_InitPpu120verifiedDMA and HDMA off; sprites 32x32/64x64 with tiles at VRAM word $4000; OAM address 0; BG mode 7, no mosaic; BG1SC $48 (unused in mode 7), BG tile bases 0; windows: BG1 window 1 on (W12SEL = 3...
$FD:EB8BM7Scene_BuildIris245verifiedBuilds the iris window (a circle of radius M7Scene_IrisR around M7Scene_IrisX, on line M7Scene_IrisY of the table) as 255 WH0/WH1 pairs in a window buffer: M7Scene_IrisX = M7Scene_IrisY = $80...
$FD:EC80M7Scene_IrisEmptyLines17verifiedWrites A (0: none) empty window lines (WH0 = $FF, WH1 = 0) through WMDATA.
$FD:EC91M7Scene_UploadSprGfx47verifiedDMA channel 0: the 8 KB sprite bitmap M7Scene_SprGfx to VRAM word $4000 (the sprite tiles), VMAIN incrementing after the high byte.
$FD:ECC0M7Scene_ClearSprGfx21verifiedZeroes the 8 KB sprite bitmap M7Scene_SprGfx through WMDATA.
$FD:ECD5M7Scene_PlotPixel164verifiedSets pixel (x, y) = (high byte of M7Scene_PosX, high byte of M7Scene_PosY), both 0-127, of the sprite bitmap to colour A (bits 0-3, one per bitplane).
$FD:ED79M7Scene_PixelMasks16verifiedA pixel's bit in a plane byte ($80 >> n, n = x & 7), then the same inverted; M7Scene_Init copies them to M7Scene_BitMasks/ClearMasks.
$FD:ED89M7Scene_InitHdma410verifiedSets up HDMA channels 1-5 (all indirect; M7Scene_Nmi enables them): 1 M7A/M7B and 2 M7C/M7D from M7Scene_M7AB / M7CD, 3 M7X/M7Y and 4 BG1HOFS/BG1VOFS from the M7Scene_Scroll records (each for two...
$FD:EF23M7Scene_WriteScale76verifiedWrites (A x q) / 64 as a word (low byte first) through WMDATA, where q is the quotient waiting in RDDIVL: A x q is built in M7Scene_Acc ($0C-$0F, from the two 8 x 8 products of the multiplier) and...
$FD:EF6FM7Scene_InitPalette146verifiedZeroes the 512 bytes of Pal_Buf, then (through WMDATA) colours 0-63: red M7Scene_PalRed[n], blue M7Scene_PalBlue[n], green 0; colours 64-127 stay black; colours 128-255 (the sprite palettes): blue...
$FD:F001M7Scene_PalRed128verifiedRed (0-$16) of BG colours 0-63 (M7Scene_InitPalette): 0 up to colour 16, a ramp up and down over 17-46, then 0.
$FD:F081M7Scene_PalBlue128verifiedBlue (0-15) of BG colours 0-63: up from 0 to 15 and back, each value twice.
$FD:F101M7Scene_PalSprBlue34verifiedBlue of the sprite colours by n & 15 (M7Scene_InitPalette): 0, 0, then up by 4 to $1F at 9 and back down to 8.
$FD:F123M7Scene_CyclePalette94verifiedEach frame, for BG colours 16-47 (n = 0-31 from colour 16): red = the high byte of ((sin f + $80) & $FF) x M7Scene_CycleAmp[n], green = the same with sin(255 - f) (f = the low byte of...
$FD:F181M7Scene_CycleAmp64verifiedWords read by their low byte (M7Scene_CyclePalette, X = n x 2): the pulse depth of colour 16 + n, a ramp 0-$16 and back.
$FD:F1C1M7Scene_UploadTilemap44verifiedDMA channel 0: the 16 KB M7Scene_Tilemap to the low bytes of VRAM words 0-$3FFF (the Mode 7 tilemap; VMAIN = 0, increment after the low byte).
$FD:F1EDM7Scene_BuildTilemap23verifiedWrites the 128 x 128 M7Scene_Tilemap through WMDATA (with DP=$2100 for the WRAM port): M7Scene_BuildTilemapHalf twice, so rows 64-127 repeat rows 0-63.
$FD:F204M7Scene_BuildTilemapHalf30verified64 rows of 128 tiles through WMDATA: row r (0-63) holds tiles (s + c) & $7F for columns c = 0-127, s = ((sin 4r + $80) & $FF) / 2.
$FD:F222M7Scene_UploadOam42verifiedDMA channel 0: the OAM shadow (Oam_LowTable and Oam_HighTable, Oam_ShadowBytes) to OAM from address 0 (OAMADDH is not written).
$FD:F24CM7Scene_InitOam26verifiedHides all 128 sprites in the OAM shadow: each Y byte of Oam_LowTable = $F0, each Oam_HighTable byte = $55 (X bit 8 set, small).
$FD:F266M7Scene_UploadPalette42verifiedDMA channel 0: the 512 bytes of Pal_Buf to CGRAM from colour 0.
$FD:F290FieldAnimListAPtrs128verified!FieldRom_AnimListAPtrs: one word per LocRom.Tileset12 & $3F ($00-$3F), the offset of its list from FieldAnimListA.
$FD:F310FieldAnimListA1,719verified!FieldRom_AnimListA: FieldFD_LoadAnimSetA's lists.
$FD:F9C7FieldAnimListBPtrs176verified!FieldRom_AnimListBPtrs: one word per LocRom.Palette ($00-$57), the offset of its list from FieldAnimListB; labels named as for FieldAnimListAPtrs.
$FD:FA77FieldAnimListB1,202verified!FieldRom_AnimListB: FieldFD_LoadAnimSetB's lists, 6 records each (one per FieldAnimB record 0-5), by the high nibble of the first byte: db $00-$0F: no animation (.Unk0 = 0); db...
$FD:FF29FieldAnimListBOldTail188verifiedNothing found reads it (no matched code refers to it, xref finds no call or jump into it), and it lies past the end of every list: the same bytes as FieldAnimListB's $FE6C-$FF27 (from the frame...
$FD:FFE5FdVec_FFE53verifiedThe bank's service vectors: JMPs at fixed addresses near the end of the bank, so code in other banks can reach them by JSL or JML.
$FD:FFE8FdVec_FFE83verifiedJMP to M7Scene_Run82 (event $FF $82; never returns).
$FD:FFEBFdVec_FFEB3verifiedJMP to M7Scene_Run81 (event $FF $81; never returns).
$FD:FFEEFdVec_FFEE3verifiedJMP to PalAnim_StopAll.
$FD:FFF1FdVec_FFF13verifiedJMP to M7Scene_Run80 (event $FF $80; never returns).
$FD:FFF4FdVec_FFF43verifiedA service vector (see FdVec_FFE5): JMP to FieldFD_LoadAnimSetB, which ends with RTL.
$FD:FFF7FdVec_FFF73verifiedJMP to PalAnim_TickAll, which runs the 12 FieldAnimB palette animation records at $0520 (Field_EndOfFrame calls it every frame).
$FD:FFFAFdVec_FFFA3verifiedJMP to FieldFD_LoadAnimSetA.
$FD:FFFDFdVec_FFFD3verifiedJMP to FieldFD_UploadTileAnims (from the field's IRQ).
$FF:F548BankFF_BuildTileSets224verifiedBuilds tile sets in WRAM from the ten 2bpp tiles of MenuRom_GlyphRows (narrow glyphs, probably the digits 0-9: the code combines their right-hand pixels into tile pairs): - copies the ten tiles...
$FF:F628BankFF_LoadE4Palette79verifiedCopies a set of 12 colours from bank $E4 into Menu_PalBuf and marks it for upload (Menu_PalDirty counted up).
$FF:F677BankFF_BuildScreenMap123verifiedUnpacks MenuRom_ScreenGfx into Menu_SprUnpackBuf (Decomp_ToWramVec), sets Menu_Unk0D0E to $01FF, and builds a map at Menu_Bg3TileBuf: six pairs of identical 32-byte rows, each row the 16 tile...
$FF:F6F2BankFF_ScreenMapTiles12verified6 tilemap words, the first entry of each row pair BankFF_BuildScreenMap writes (each next entry is one tile on).
$FF:F6FEBankFF_ScreenColoursA8verified4 words BankFF_BuildScreenMap copies to !Menu_Unk9100 (colours, probably, from the values; the reader is not traced).
$FF:F706BankFF_ScreenColoursB16verified8 colours BankFF_BuildScreenMap copies to !Menu_PalBuf + $30 (colours $18-$1F of the menu's CGRAM copy).
$FF:F716BankFF_StepWave67verifiedSteps a wave and writes it out: Menu_WavePhase and Menu_WaveTick count up; every 4th call Menu_Unk0D0C counts up, Menu_Unk0D0E down and the phase goes back by 2 (a net drift of 1 back per 4 calls).
$FF:F759ScrollWaveFF_A64verifiedWave tables ($FF:F759–$FF:F7D8) A byte-identical copy of ScrollWaveA/ScrollWaveB in bank $00 ($C0:FF30–$C0:FFAF): one period of a sine-like wave between -6 and +6 (32 signed 16-bit entries)...
$FF:F799ScrollWaveFF_B64verified
$FF:F7D9BankFF_WidenTiles58verifiedCopies the ten 2bpp tiles of MenuRom_ShadowTiles into Menu_ShadowTiles 32 bytes apart, and sets each tile's plane-2 bytes (offset $10, $12 ... $1E) to plane 0 | plane 1 of the same row, so every...
$FF:F813BankFF_UnkF813318verifiedPart of Menu_BuildItemTables' set-up of the tech data (meaning partly inferred).
$FF:F951BankFF_TechStepLimit7verified1 B per character id 0-6, read by BankFF_UnkF813: a character whose !Menu_Unk7F01E0 bit is clear gets its next single tech marked only while the count it found is below this ($FF: always; 0: never).
$FF:F958BankFF_UnkF95899verifiedSets Menu_Unk04A4 entry c (c = 0-4) to 1 when combo c is available, else 0: all the characters in its MenuRom_ComboMembers are in Menu_PartyOrder and the three techs its MenuRom_ComboNeeds names...
$FF:F9BBBankFF_CharBits9verified$80 >> n for n = 0-7, then 0: a character id's bit (as in !Menu_Unk29AF and the tech bytes).
$FF:F9C4BankFF_UnkF9C455verifiedChecks save slot DP $79 (low 2 bits): BankFF_SetSlotOfs, then with DB = $30 (SRAM): A = DP $00 (16-bit) = BankFF_SlotNoSign ($8080) when the slot's Menu_SramSlotSign is not BankFF_SlotSign...
$FF:F9FBBankFF_SaveSlot128verifiedSaves the game to slot DP $79 (Menu_SlotIdx): Menu_Unk0414 = the slot; Menu_SaveCount counts up (it stays at $FFFF); then each BankFF_SaveRecords block goes to SRAM through Menu_NmiMoveCode...
$FF:FA7BBankFF_SaveRecords40verifiedThe blocks of a save slot, in order (BankFF_SaveSlot, BankFF_LoadSlot): 8 records of 5 B: address (2 B), bank (1 B), length (2 B).
$FF:FAA3BankFF_LoadSlot74verifiedLoads slot Menu_SlotIdx back: the same BankFF_SaveRecords blocks, read from SRAM (Menu_NmiMoveCode as MVN from bank $30, destination bank patched per record), from the slot's offset on.
$FF:FAEDBankFF_LoadSlotPart212verifiedLoads part of slot Menu_SlotIdx: the BankFF_PartRecords blocks (the inventory without $2980-$29AF, and the names), then Menu_Unk7F01E0 = the slot's byte $07E3; then puts each character 6-0 back...
$FF:FBC1BankFF_PartRecords14verifiedBankFF_LoadSlotPart's blocks: 2 records of 7 B: offset in the slot (2 B), address (2 B), bank (1 B), length (2 B).
$FF:FBCFBankFF_EquipOffsets4verifiedOffsets of four equipment bytes in a character record ($27, $28, $2A, $29), read backwards by BankFF_LoadSlotPart (entry 3, the $29 byte, is left out for character 5).
$FF:FBD3BankFF_SetSlotOfs14verifiedMenu_SlotSramOfs (DP $7B) = BankFF_SlotSramOfs entry DP $79 & 3.
$FF:FBE1BankFF_SlotSramOfs6verifiedSRAM offset of save slots 0-2 ($A00 B apart).
$FF:FBE7BankFF_SlotChecksum29verifiedSums the $500 words of the slot at Menu_SlotSramOfs (DP $7B) in SRAM (bank $30, through DP $00 as a pointer), with the carry of each ADC going into the next.
$FF:FC04BankFF_BuildGradHdma83verifiedPoints DMA channel 1's table (A1T1L/H) at Menu_GradHdma and builds an HDMA table there: $60 lines with the two bytes $00, $E0, then 16 groups of three 1-line entries with the bytes $02 (groups...
$FF:FC57BankFF_GradValues16verifiedThe third byte of each BankFF_BuildGradHdma group: $E8 down to $E0, then $E1 up to $E7 (COLDATA-style values, probably; the register channel 1 feeds is not set here).
$FF:FC67BankFF_OldBuildLeftovers921verifiedNot code that runs: tools/xref.py finds no call or jump into $FF:FC67-$FFFF from code.

Generated from functions.csv. Do not edit.