From 4c644d2a2098aab3d87008c41a819d8e09b986d0 Mon Sep 17 00:00:00 2001 From: Trevor Merritt Date: Fri, 16 Oct 2026 20:24:23 -0400 Subject: [PATCH] Pass 3 for NES PowerPad Test Card (U): name all data tables and VramWrite streams - Decoded the VramWrite ($E1CC) stream format: , $00 terminator - Named all 9 payload streams ($E4CC-$E7C2, no gaps/overlaps) plus VramWriteSourcePointerTable at $F000 - Split PadBitTableLives into Player1TileTable ($E4B4) and Player2TileTable ($E4C0), 12 entries each (Y=0..11) - Decoded CHR font (digits $30-$39, letters $3A-$52, space $5F; 'W' missing from the A-Z run) and recovered on-screen text including 'PRESS A TO TEST SIDE-A' / 'SIDE-B' - Documented that the 16 KiB PRG is two byte-identical 8 KiB halves; $C000 copy is dead - Documented 7 unreached subroutines inside the live code region (kept as .byte per Pass-1 policy) - Fixed a stray duplicate sentence and stale _wip paths in root OVERVIEW.md Byte-identical ROM verified. --- NES PowerPad Test Card (U)/OVERVIEW.md | 62 +- NES PowerPad Test Card (U)/copilot/prg.s | 964 +- .../copilot/reconstructed.lbl | 12 + OVERVIEW.md | 45 +- _tools/nesdis.py | 700 + _tools/pass2.py | 626 + _wip/MUSCLE (U)/OVERVIEW.md | 222 +- _wip/MUSCLE (U)/copilot/Makefile | 60 +- _wip/MUSCLE (U)/copilot/chr.s | 2 + _wip/MUSCLE (U)/copilot/data_regions.tsv | 71 + _wip/MUSCLE (U)/copilot/header.s | 2 + _wip/MUSCLE (U)/copilot/label_names.tsv | 702 + _wip/MUSCLE (U)/copilot/linker.cfg | 10 +- _wip/MUSCLE (U)/copilot/locals.inc | 171 +- _wip/MUSCLE (U)/copilot/prg.s | 12922 +++++++++++++++- _wip/MUSCLE (U)/copilot/reconstructed.lbl | 774 + _wip/MUSCLE (U)/copilot/reconstructed.map | 8 +- ...econstructed_prg.bin => reconstructed.nes} | Bin 16384 -> 24592 bytes _wip/MUSCLE (U)/copilot/rom.nes | 1 + _wip/MUSCLE (U)/copilot/routine_names.tsv | 228 + _wip/MUSCLE (U)/copilot/routine_purposes.tsv | 96 + _wip/MUSCLE (U)/copilot/zero_page_names.tsv | 112 + _wip/MUSCLE (U)/copilot/zero_page_ranges.tsv | 7 + 23 files changed, 17290 insertions(+), 507 deletions(-) create mode 100644 _tools/nesdis.py create mode 100644 _tools/pass2.py create mode 100644 _wip/MUSCLE (U)/copilot/chr.s create mode 100644 _wip/MUSCLE (U)/copilot/data_regions.tsv create mode 100644 _wip/MUSCLE (U)/copilot/header.s create mode 100644 _wip/MUSCLE (U)/copilot/label_names.tsv rename _wip/MUSCLE (U)/copilot/{reconstructed_prg.bin => reconstructed.nes} (64%) create mode 120000 _wip/MUSCLE (U)/copilot/rom.nes create mode 100644 _wip/MUSCLE (U)/copilot/routine_names.tsv create mode 100644 _wip/MUSCLE (U)/copilot/routine_purposes.tsv create mode 100644 _wip/MUSCLE (U)/copilot/zero_page_names.tsv create mode 100644 _wip/MUSCLE (U)/copilot/zero_page_ranges.tsv diff --git a/NES PowerPad Test Card (U)/OVERVIEW.md b/NES PowerPad Test Card (U)/OVERVIEW.md index e22395f..9747bc6 100644 --- a/NES PowerPad Test Card (U)/OVERVIEW.md +++ b/NES PowerPad Test Card (U)/OVERVIEW.md @@ -40,7 +40,7 @@ This document describes the execution flow of the disassembled NES PowerPad Test |------|--------|-------------| | Pass 1 | Complete | Code/data split — entire PRG bank classified as traced code (~7.2%) or explicit `.byte` data (~92.8%) with `; CPU:$xxxx PRG:$xxxx` annotations | | Pass 2 | Complete | Routine headers added for all labeled positions; key routines semantically named (`Reset`, `NmiHandler`, `VramWrite`, `ReadPad`, `ProcessPads`, etc.); zero-page aliases in `locals.inc` | -| Pass 3 | Complete | Data tables/structures identified and named (`PaletteData` at $E121, `PadBitTableLives` at $E4B4); remaining `Label_Exxxx` references are internal branch targets within routines | +| Pass 3 | Complete | All data tables named: `VramWriteSourcePointerTable` ($F000, 9 streams), `Player1TileTable`/`Player2TileTable` ($E4B4/$E4C0), `PaletteData` ($E121), and all nine VramWrite payload streams (`PowerPadSideAButtonGraphics`, `PanelFrameTiles`, `StatusMessageText`, `SideATestPromptText`, …). Screen text decoded from CHR. Remaining 46 `Label_Exxxx` are internal loop/branch targets. | --- @@ -155,33 +155,67 @@ Full list in `copilot/locals.inc`. ## 8. Data Tables -| Table | Address | Description | -|-------|---------|-------------| -| `PaletteData` | $E121 | 32-byte palette data loaded into PPU palette RAM | -| `PadBitTableLives` | $E4B4 | 70-byte pad bit lookup table; `DrawScore` reads from offset $0C ($E4C0) | -| Pattern pointers | $F000–$F013 | Pointer pairs loaded by `LoadPatternTable1`–`5` routines | +### 8.1 Direct tables + +| Table | Address | Size | Description | +|-------|---------|------|-------------| +| `PaletteData` | $E121 | 32 | Palette loaded into PPU $3F00-$3F1F by `LoadPalette` | +| `Player1TileTable` | $E4B4 | 12 | PPUADDR low bytes for player 1, indexed Y=0..11 | +| `Player2TileTable` | $E4C0 | 12 | Same for player 2; `$00` = "skip this button" | +| `VramWriteSourcePointerTable` | $F000 | 18 | 9 little-endian stream pointers, one per `LoadPatternTable*` / draw call site | + +### 8.2 VramWrite payload streams + +`VramWrite` ($E1CC) reads records of ` `, terminated by a `$00` at a record boundary. All nine streams tile `$E4CC-$E7C2` with no gaps and no overlaps: + +| Slot | Ptr | Stream label | Address | Records | Writes to | +|------|-----|--------------|---------|---------|-----------| +| 0 | $F000 | `PowerPadSideAButtonGraphics` | $E54F | 2 | $2083, $20A3 — 52 tile graphics in pattern table 0 | +| 1 | $F002 | `PowerPadButtonLabelTiles` | $E58A | 4 | $2136, $2156, $2236, $2256 — button captions | +| 2 | $F004 | `PanelFrameTiles` | $E5B3 | 8 | $2124…$22C4 — panel borders for six indicator boxes | +| 3 | $F006 | `SideAPressedButtonRow` | $E64C | 6 | $2184…$22A4 — side-A button caps | +| 4 | $F008 | `SideAPanelButtonRow` | $E6BF | 6 | same rows, alternate layout | +| 5 | $F00A | `StatusMessageText` | $E732 | 3 | $2121, $2163, $2183 — status messages | +| 6 | $F00C | `Player1ButtonIconStream` | $E4CC | 2 | $2196, $21B6 | +| 7 | $F00E | `Player2ButtonIconStream` | $E4E3 | 2 | $2296, $22B6 | +| 8 | $F010 | `SideATestPromptText` | $E790 | 2 | $2304, $2344 — the prompt rows | + +### 8.3 Screen text (decoded from CHR) + +Font mapping read directly out of `chr.bin` pattern table 1: digits `$30-$39` = `'0'-'9'`, letters `$3A-$52` = `'A'-'Z'` (note **`W` is absent** from the `A-Z` run), `$57` = `-`, `$58` = `/`, `$59` = `\`, `$5F` = space. + +| Address | Text | +|---------|------| +| $2121 | `CONNECT POWER PAD <$5D> CONTROLLER` | +| $2163 | `<$60>IF POWER PAD IS CONNECTED<$62>` | +| $2183 | `<$61> IC MAY BE BAD <$53> <$63>` | +| $2304 | `PRESS A TO TEST SIDE-A` | +| $2344 | `PRESS B TO TEST SIDE-B` | + +Tiles `$53-$5E` are truncated glyph fragments in CHR ROM — including the `W` of `POWER`, which sits at `$5E` and renders incomplete. The original cartridge therefore displays partial marks at those positions; this is a ROM authoring artifact, reproduced faithfully. --- ## 9. Build ```bash -cd "_wip/NES PowerPad Test Card (U)/copilot" -make # → ca65 + ld65 + cmp reconstructed_prg.bin prg.bin → "BYTE-IDENTICAL" +cd "NES PowerPad Test Card (U)/copilot" +make # → ca65 + ld65 + cmp reconstructed.nes rom.nes → "Byte-identical ROM verified." ``` --- ## 10. Notes -- The PRG is approximately 7% code / 93% data. Most of the PRG bank ($C000–$DFFF, $E54F–$FFFF) is $FF-filled test pattern data. -- The NMI handler drives per-frame updates; the main loop (`Reset` at $E058) spins waiting for vblank and frame counter changes. -- `PadBitTableLives` at $E4B4 is a shared lookup table — `DrawLives` reads from base $E4B4, `DrawScore` reads from offset $0C ($E4C0). -- IRQ vector points to $E000 (Reset) and is effectively unused. +- **The 16 KiB PRG is two byte-identical 8 KiB halves.** `prg[0x0000:0x2000] == prg[0x2000:0x4000]` is exactly true. Both halves hold the same program, pointer table, and vector set. The vectors point at `$E06E`/`$E000`/`$E000`, so the CPU always enters the `$E000` copy; nothing references `$C000-$DFFF`, so the first copy is dead and is kept as classified `.byte` data rather than disassembled. +- Unreached gaps inside the live code region decode as valid subroutines (PPUMASK show/hide background, PPUCTRL NMI-disable, frame-counter digit tiles, `ldx #$80 / txs`). Per Pass-1 policy they stay `.byte` data; each is decoded in the `prg.s` header comment block. +- The PRG is approximately 7.2% code / 92.8% data. Most data is `$FF` padding from `$E7C3-$EFFF` and `$F012-$FFF9`. +- The NMI handler drives per-frame updates; the main loop spins waiting for vblank and frame-counter changes. +- IRQ vector points to $E000 (`Reset`) and is effectively unused. --- ## 11. Next Steps -- **Promotion** — move to a top-level `NES PowerPad Test Card (U)/` folder, add `header.s` / `chr.s` + full-ROM `make` target (as e.g. `Burger Time (U)`), then join the root `OVERVIEW.md` numbered inventory. -- **Optional deeper Pass 3 work** — extract the pattern pointer data at $F000+ into labeled `.byte` blocks; refine zero-page aliases with more specific roles. +- Optional: refine the `Zp05`–`Zp0F` aliases now that `ProcessPads`/`DrawScore`/`DrawLives` semantics are known (pad-state bytes vs. shift counters). +- Optional: `$E4CC-$E4F9` holds two near-identical icon streams differing only in two bytes; could be collapsed to a parameterized table in a future reconstruction, but the byte form is preserved as-is. diff --git a/NES PowerPad Test Card (U)/copilot/prg.s b/NES PowerPad Test Card (U)/copilot/prg.s index 273621a..df6e32e 100644 --- a/NES PowerPad Test Card (U)/copilot/prg.s +++ b/NES PowerPad Test Card (U)/copilot/prg.s @@ -3,6 +3,61 @@ ; Recursively reachable instructions are emitted explicitly with address/byte comments. ; All Pass 1 .incbin spans are now explicit classified bytes; no ROM bytes are hidden. ; Pass 2 replaces address-derived labels, RAM aliases, and table names while preserving byte identity. +; Pass 3 names the data tables and VramWrite streams; every remaining Label_Exxxx is an +; internal loop or branch target inside a named routine. +; +; ============================================================================ +; ROM LAYOUT NOTE - the 16 KiB PRG is two byte-identical 8 KiB halves +; ============================================================================ +; PRG[0x0000:0x2000] (CPU $C000-$DFFF) is byte-for-byte identical to +; PRG[0x2000:0x4000] (CPU $E000-$FFFF). This is exact, not approximate: +; splitnes/verify: prg[0:0x2000] == prg[0x2000:0x4000] -> True +; +; Both halves contain their own copy of the same program image: +; $C000-$C7C2 copy 1 of the program $E000-$E7C2 copy 2 of the program +; $C7C3-$CFFF $FF filler $E7C3-$EFFF $FF filler +; $D000-$D011 copy 1 of pointer table $F000-$F011 copy 2 of pointer table +; $D012-$DFF9 $FF filler $F012-$FFF9 $FF filler +; $DFFA-$DFFF copy 1 of the vectors $FFFA-$FFFF copy 2 of the vectors +; +; Both vector sets hold the same values (NMI $E06E, RESET $E000, IRQ $E000), +; so the CPU always enters the COPY 2 program at $E000. Nothing in the reachable +; code references any address in $C000-$DFFF, so COPY 1 is dead weight - it is +; emitted below as classified .byte data to preserve every ROM byte and its +; provenance, and is deliberately NOT disassembled as code. +; +; The live copy ($E000-) is the one the NMI/RESET/IRQ vectors enter, and it is the +; only copy whose labels are referenced by instructions. +; +; ============================================================================ +; UNREACHED SUBROUTINES - emitted as data per Pass-1 policy, decoded here +; ============================================================================ +; Several gaps inside the live code region decode as coherent but unreferenced +; 6502 subroutines. They are left as .byte data (unreached bytes stay data) but +; are documented here so the meaning is not lost: +; +; $E0C5-$E0C8 (4) ldx #$80 / txs / rts stack-pointer init +; $E205-$E20E (10) lda Zp01 / ora #$10 / sta $2001 / sta Zp01 / rts +; -> PPUMASK show-background (bit 4) setter +; $E20F-$E218 (10) lda Zp01 / and #$EF / sta $2001 / sta Zp01 / rts +; -> PPUMASK hide-background (clear bit 4) setter +; $E223-$E22C (10) lda Zp00 / and #$7F / sta $2000 / sta Zp00 / rts +; -> PPUCTRL NMI-disable setter (counterpart of $E219) +; $E245-$E256 (18) lda #$23 / sta $2006 / lda #$28 / sta $2006 / +; lda Zp03 / sta Zp0E / jsr $E257 / rts +; -> set PPUADDR $2328, index by frame counter +; $E257-$E265 (15) lda Zp0E / ror x4 / and #$0F / clc / adc #$30 / +; sta $2007 / rts high-nibble digit tile +; $E266-$E26F (10) lda Zp0E / and #$0F / clc / adc #$30 / +; sta $2007 / rts low-nibble digit tile +; +; ============================================================================ +; VramWrite STREAM FORMAT (VramWrite, $E1CC) +; ============================================================================ +; X = pointer low, Y = pointer high; the pointer is stored in Zp10/Zp11 and read +; with (Zp10),Y. Records are: . +; A $00 byte at a record boundary terminates the stream. +; .setcpu "6502" @@ -1877,11 +1932,27 @@ LoadPatternTable7: rts ; CPU:$E4B3 PRG:24B3 60 ; ---- data $E4B4-$E4F9 (70 bytes) ---- PadBitTableLives: - .byte $E3, $EB, $EA, $E2, $E9, $E1, $D9, $DA, $DC, $DB, $EC, $E4, $E2, $EA, $EB, $E3 ; CPU:$E4B4 PRG:24B4 E3 EB EA E2 E9 E1 D9 DA DC DB EC E4 E2 EA EB E3 - .byte $00, $E4, $00, $DB, $00, $DA, $00, $E1, $21, $96, $08, $B0, $B1, $BC, $BD, $D4 ; CPU:$E4C4 PRG:24C4 00 E4 00 DB 00 DA 00 E1 21 96 08 B0 B1 BC BD D4 - .byte $D5, $D4, $D5, $21, $B6, $08, $C0, $C1, $CC, $CD, $E4, $E5, $E4, $E5, $00, $22 ; CPU:$E4D4 PRG:24D4 D5 D4 D5 21 B6 08 C0 C1 CC CD E4 E5 E4 E5 00 22 - .byte $96, $08, $B0, $B1, $BC, $BD, $D4, $D5, $D4, $D5, $22, $B6, $08, $C0, $C1, $CC ; CPU:$E4E4 PRG:24E4 96 08 B0 B1 BC BD D4 D5 D4 D5 22 B6 08 C0 C1 CC - .byte $CD, $E4, $E5, $E4, $E5, $00 ; CPU:$E4F4 PRG:24F4 CD E4 E5 E4 E5 00 +; 12 entries indexed by Y = 0..11 (bits 0-7 then 8-11) in ProcessPads. +; Values are PPUADDR low bytes for pattern table 1 ($23xx); the high byte $23 +; is written by DrawScore/DrawLives before indexing this table. +Player1TileTable: + .byte $E3, $EB, $EA, $E2, $E9, $E1, $D9, $DA, $DC, $DB, $EC, $E4 ; CPU:$E4B4 PRG:24B4 E3 EB EA E2 E9 E1 D9 DA DC DB EC E4 +; 12 entries indexed by Y = 0..11, same order as Player1TileTable. +; $00 entries mean "no button drawn" - DrawScore/DrawLives test for zero +; with beq and skip the PPU write entirely. +Player2TileTable: + .byte $E2, $EA, $EB, $E3, $00, $E4, $00, $DB, $00, $DA, $00, $E1 ; CPU:$E4C0 PRG:24C0 E2 EA EB E3 00 E4 00 DB 00 DA 00 E1 +; VramWrite stream (ptr slot 6, $F00C). Writes tiles to $2196 and $21B6: +; $2196 <- $B0 $B1 $BC $BD $D4 $D5 $D4 $D5 +; $21B6 <- $C0 $C1 $CC $CD $E4 $E5 $E4 $E5 +Player1ButtonIconStream: + .byte $21, $96, $08, $B0, $B1, $BC, $BD, $D4, $D5, $D4, $D5, $21, $B6, $08, $C0, $C1 ; CPU:$E4CC PRG:24CC 21 96 08 B0 B1 BC BD D4 D5 D4 D5 21 B6 08 C0 C1 + .byte $CC, $CD, $E4, $E5, $E4, $E5, $00 ; CPU:$E4DC PRG:24DC CC CD E4 E5 E4 E5 00 +; VramWrite stream (ptr slot 7, $F00E). Same 8-byte icon rows as +; Player1ButtonIconStream but placed at $2296 and $22B6 (player 2 column). +Player2ButtonIconStream: + .byte $22, $96, $08, $B0, $B1, $BC, $BD, $D4, $D5, $D4, $D5, $22, $B6, $08, $C0, $C1 ; CPU:$E4E3 PRG:24E3 22 96 08 B0 B1 BC BD D4 D5 D4 D5 22 B6 08 C0 C1 + .byte $CC, $CD, $E4, $E5, $E4, $E5, $00 ; CPU:$E4F3 PRG:24F3 CC CD E4 E5 E4 E5 00 ; DrawScore reads from PadBitTableLives+$0C ($E4C0) via lda $E4C0,Y ; ----------------------------------------------------------------------------- ; Routine: ProcessPadBits @@ -2014,29 +2085,49 @@ Label_E548: bne Label_E548 ; CPU:$E54C PRG:254C D0 FA rts ; CPU:$E54E PRG:254E 60 ; ---- data $E54F-$FFFF (6833 bytes) ---- +; VramWrite stream (ptr slot 0, $F000). Uploads pattern-table-0 tile graphics +; to $2083 and $20A3 - the 26+26 tile button-face sprites used by the +; side-A pad display. +PowerPadSideAButtonGraphics: .byte $20, $83, $1A, $B0, $B1, $B2, $B3, $B4, $B5, $B6, $B7, $B8, $B9, $04, $BA, $BB ; CPU:$E54F PRG:254F 20 83 1A B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 04 BA BB .byte $BC, $BD, $BE, $BF, $04, $D0, $D1, $D2, $D3, $D4, $D5, $D6, $D7, $20, $A3, $1A ; CPU:$E55F PRG:255F BC BD BE BF 04 D0 D1 D2 D3 D4 D5 D6 D7 20 A3 1A .byte $C0, $C1, $C2, $C3, $C4, $C5, $C6, $C7, $C8, $C9, $04, $CA, $CB, $CC, $CD, $CE ; CPU:$E56F PRG:256F C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 04 CA CB CC CD CE - .byte $CF, $04, $E0, $E1, $E2, $E3, $E4, $E5, $E6, $E7, $00, $21, $36, $07, $90, $91 ; CPU:$E57F PRG:257F CF 04 E0 E1 E2 E3 E4 E5 E6 E7 00 21 36 07 90 91 - .byte $92, $93, $04, $BC, $BD, $21, $56, $07, $A0, $A1, $A2, $A3, $A4, $CC, $CD, $22 ; CPU:$E58F PRG:258F 92 93 04 BC BD 21 56 07 A0 A1 A2 A3 A4 CC CD 22 - .byte $36, $07, $90, $91, $92, $93, $04, $DE, $DF, $22, $56, $07, $A0, $A1, $A2, $A3 ; CPU:$E59F PRG:259F 36 07 90 91 92 93 04 DE DF 22 56 07 A0 A1 A2 A3 - .byte $04, $EE, $EF, $00, $21, $24, $10, $08, $09, $09, $09, $09, $09, $16, $16, $16 ; CPU:$E5AF PRG:25AF 04 EE EF 00 21 24 10 08 09 09 09 09 09 16 16 16 - .byte $16, $09, $09, $09, $09, $09, $0A, $21, $44, $10, $0B, $07, $07, $07, $07, $07 ; CPU:$E5BF PRG:25BF 16 09 09 09 09 09 0A 21 44 10 0B 07 07 07 07 07 - .byte $18, $19, $1A, $1B, $07, $07, $07, $07, $07, $0C, $21, $64, $10, $0B, $07, $07 ; CPU:$E5CF PRG:25CF 18 19 1A 1B 07 07 07 07 07 0C 21 64 10 0B 07 07 - .byte $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $0C, $21, $C4, $10 ; CPU:$E5DF PRG:25DF 07 07 07 07 07 07 07 07 07 07 07 07 0C 21 C4 10 - .byte $0B, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $0C ; CPU:$E5EF PRG:25EF 0B 07 07 07 07 07 07 07 07 07 07 07 07 07 07 0C - .byte $21, $E4, $10, $0B, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07 ; CPU:$E5FF PRG:25FF 21 E4 10 0B 07 07 07 07 07 07 07 07 07 07 07 07 - .byte $07, $07, $0C, $22, $44, $10, $0B, $07, $07, $07, $07, $07, $07, $07, $07, $07 ; CPU:$E60F PRG:260F 07 07 0C 22 44 10 0B 07 07 07 07 07 07 07 07 07 - .byte $07, $07, $07, $07, $07, $0C, $22, $64, $10, $0B, $07, $07, $07, $07, $07, $07 ; CPU:$E61F PRG:261F 07 07 07 07 07 0C 22 64 10 0B 07 07 07 07 07 07 - .byte $07, $07, $07, $07, $07, $07, $07, $07, $0C, $22, $C4, $10, $0D, $0E, $0E, $0E ; CPU:$E62F PRG:262F 07 07 07 07 07 07 07 07 0C 22 C4 10 0D 0E 0E 0E - .byte $0E, $0E, $0E, $0E, $0E, $0E, $0E, $0E, $0E, $0E, $0E, $0F, $00, $21, $84, $10 ; CPU:$E63F PRG:263F 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0F 00 21 84 10 - .byte $0B, $10, $11, $07, $07, $10, $11, $07, $07, $00, $01, $07, $07, $00, $01, $0C ; CPU:$E64F PRG:264F 0B 10 11 07 07 10 11 07 07 00 01 07 07 00 01 0C - .byte $21, $A4, $10, $0B, $12, $13, $07, $07, $12, $13, $07, $07, $02, $03, $07, $07 ; CPU:$E65F PRG:265F 21 A4 10 0B 12 13 07 07 12 13 07 07 02 03 07 07 - .byte $02, $03, $0C, $22, $04, $10, $0B, $10, $11, $07, $07, $10, $11, $07, $07, $00 ; CPU:$E66F PRG:266F 02 03 0C 22 04 10 0B 10 11 07 07 10 11 07 07 00 - .byte $01, $07, $07, $00, $01, $0C, $22, $24, $10, $0B, $12, $13, $07, $07, $12, $13 ; CPU:$E67F PRG:267F 01 07 07 00 01 0C 22 24 10 0B 12 13 07 07 12 13 - .byte $07, $07, $02, $03, $07, $07, $02, $03, $0C, $22, $84, $10, $0B, $10, $11, $07 ; CPU:$E68F PRG:268F 07 07 02 03 07 07 02 03 0C 22 84 10 0B 10 11 07 - .byte $07, $10, $11, $07, $07, $00, $01, $07, $07, $00, $01, $0C, $22, $A4, $10, $0B ; CPU:$E69F PRG:269F 07 10 11 07 07 00 01 07 07 00 01 0C 22 A4 10 0B - .byte $12, $13, $07, $07, $12, $13, $07, $07, $02, $03, $07, $07, $02, $03, $0C, $00 ; CPU:$E6AF PRG:26AF 12 13 07 07 12 13 07 07 02 03 07 07 02 03 0C 00 + .byte $CF, $04, $E0, $E1, $E2, $E3, $E4, $E5, $E6, $E7, $00 ; CPU:$E57F PRG:257F CF 04 E0 E1 E2 E3 E4 E5 E6 E7 00 +; VramWrite stream (ptr slot 1, $F002). Four 7-tile rows at $2136, $2156, +; $2236 and $2256: the per-button caption strips above each pad panel. +PowerPadButtonLabelTiles: + .byte $21, $36, $07, $90, $91, $92, $93, $04, $BC, $BD, $21, $56, $07, $A0, $A1, $A2 ; CPU:$E58A PRG:258A 21 36 07 90 91 92 93 04 BC BD 21 56 07 A0 A1 A2 + .byte $A3, $A4, $CC, $CD, $22, $36, $07, $90, $91, $92, $93, $04, $DE, $DF, $22, $56 ; CPU:$E59A PRG:259A A3 A4 CC CD 22 36 07 90 91 92 93 04 DE DF 22 56 + .byte $07, $A0, $A1, $A2, $A3, $04, $EE, $EF, $00 ; CPU:$E5AA PRG:25AA 07 A0 A1 A2 A3 04 EE EF 00 +; VramWrite stream (ptr slot 2, $F004). Draws the static panel borders +; (tiles $08-$0F corners/edges, $07 fill) for the six indicator boxes. +PanelFrameTiles: + .byte $21, $24, $10, $08, $09, $09, $09, $09, $09, $16, $16, $16, $16, $09, $09, $09 ; CPU:$E5B3 PRG:25B3 21 24 10 08 09 09 09 09 09 16 16 16 16 09 09 09 + .byte $09, $09, $0A, $21, $44, $10, $0B, $07, $07, $07, $07, $07, $18, $19, $1A, $1B ; CPU:$E5C3 PRG:25C3 09 09 0A 21 44 10 0B 07 07 07 07 07 18 19 1A 1B + .byte $07, $07, $07, $07, $07, $0C, $21, $64, $10, $0B, $07, $07, $07, $07, $07, $07 ; CPU:$E5D3 PRG:25D3 07 07 07 07 07 0C 21 64 10 0B 07 07 07 07 07 07 + .byte $07, $07, $07, $07, $07, $07, $07, $07, $0C, $21, $C4, $10, $0B, $07, $07, $07 ; CPU:$E5E3 PRG:25E3 07 07 07 07 07 07 07 07 0C 21 C4 10 0B 07 07 07 + .byte $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $0C, $21, $E4, $10, $0B ; CPU:$E5F3 PRG:25F3 07 07 07 07 07 07 07 07 07 07 07 0C 21 E4 10 0B + .byte $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $0C, $22 ; CPU:$E603 PRG:2603 07 07 07 07 07 07 07 07 07 07 07 07 07 07 0C 22 + .byte $44, $10, $0B, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07 ; CPU:$E613 PRG:2613 44 10 0B 07 07 07 07 07 07 07 07 07 07 07 07 07 + .byte $07, $0C, $22, $64, $10, $0B, $07, $07, $07, $07, $07, $07, $07, $07, $07, $07 ; CPU:$E623 PRG:2623 07 0C 22 64 10 0B 07 07 07 07 07 07 07 07 07 07 + .byte $07, $07, $07, $07, $0C, $22, $C4, $10, $0D, $0E, $0E, $0E, $0E, $0E, $0E, $0E ; CPU:$E633 PRG:2633 07 07 07 07 0C 22 C4 10 0D 0E 0E 0E 0E 0E 0E 0E + .byte $0E, $0E, $0E, $0E, $0E, $0E, $0E, $0F, $00 ; CPU:$E643 PRG:2643 0E 0E 0E 0E 0E 0E 0E 0F 00 +; VramWrite stream (ptr slot 3, $F006). Six 16-tile rows at $2184,$21A4, +; $2204,$2224,$2284,$22A4 - the button-cap graphics ($10-$13, $00-$03) +; drawn for side A. +SideAPressedButtonRow: + .byte $21, $84, $10, $0B, $10, $11, $07, $07, $10, $11, $07, $07, $00, $01, $07, $07 ; CPU:$E64C PRG:264C 21 84 10 0B 10 11 07 07 10 11 07 07 00 01 07 07 + .byte $00, $01, $0C, $21, $A4, $10, $0B, $12, $13, $07, $07, $12, $13, $07, $07, $02 ; CPU:$E65C PRG:265C 00 01 0C 21 A4 10 0B 12 13 07 07 12 13 07 07 02 + .byte $03, $07, $07, $02, $03, $0C, $22, $04, $10, $0B, $10, $11, $07, $07, $10, $11 ; CPU:$E66C PRG:266C 03 07 07 02 03 0C 22 04 10 0B 10 11 07 07 10 11 + .byte $07, $07, $00, $01, $07, $07, $00, $01, $0C, $22, $24, $10, $0B, $12, $13, $07 ; CPU:$E67C PRG:267C 07 07 00 01 07 07 00 01 0C 22 24 10 0B 12 13 07 + .byte $07, $12, $13, $07, $07, $02, $03, $07, $07, $02, $03, $0C, $22, $84, $10, $0B ; CPU:$E68C PRG:268C 07 12 13 07 07 02 03 07 07 02 03 0C 22 84 10 0B + .byte $10, $11, $07, $07, $10, $11, $07, $07, $00, $01, $07, $07, $00, $01, $0C, $22 ; CPU:$E69C PRG:269C 10 11 07 07 10 11 07 07 00 01 07 07 00 01 0C 22 + .byte $A4, $10, $0B, $12, $13, $07, $07, $12, $13, $07, $07, $02, $03, $07, $07, $02 ; CPU:$E6AC PRG:26AC A4 10 0B 12 13 07 07 12 13 07 07 02 03 07 07 02 + .byte $03, $0C, $00 ; CPU:$E6BC PRG:26BC 03 0C 00 +; VramWrite stream (ptr slot 4, $F008). Same six rows as +; SideAPressedButtonRow but with the caps repositioned - the unpressed / +; alternate side-A panel layout. +SideAPanelButtonRow: .byte $21, $84, $10, $0B, $07, $07, $07, $07, $10, $11, $07, $07, $10, $11, $07, $07 ; CPU:$E6BF PRG:26BF 21 84 10 0B 07 07 07 07 10 11 07 07 10 11 07 07 .byte $07, $07, $0C, $21, $A4, $10, $0B, $07, $07, $07, $07, $12, $13, $07, $07, $12 ; CPU:$E6CF PRG:26CF 07 07 0C 21 A4 10 0B 07 07 07 07 12 13 07 07 12 .byte $13, $07, $07, $07, $07, $0C, $22, $04, $10, $0B, $10, $11, $07, $07, $00, $01 ; CPU:$E6DF PRG:26DF 13 07 07 07 07 0C 22 04 10 0B 10 11 07 07 00 01 @@ -2044,401 +2135,428 @@ Label_E548: .byte $07, $02, $03, $07, $07, $02, $03, $07, $07, $12, $13, $0C, $22, $84, $10, $0B ; CPU:$E6FF PRG:26FF 07 02 03 07 07 02 03 07 07 12 13 0C 22 84 10 0B .byte $07, $07, $07, $07, $10, $11, $07, $07, $10, $11, $07, $07, $07, $07, $0C, $22 ; CPU:$E70F PRG:270F 07 07 07 07 10 11 07 07 10 11 07 07 07 07 0C 22 .byte $A4, $10, $0B, $07, $07, $07, $07, $12, $13, $07, $07, $12, $13, $07, $07, $07 ; CPU:$E71F PRG:271F A4 10 0B 07 07 07 07 12 13 07 07 12 13 07 07 07 - .byte $07, $0C, $00, $21, $21, $1E, $3C, $48, $47, $47, $3E, $3C, $4D, $5F, $49, $48 ; CPU:$E72F PRG:272F 07 0C 00 21 21 1E 3C 48 47 47 3E 3C 4D 5F 49 48 - .byte $5E, $3E, $4B, $5F, $49, $3A, $3D, $5F, $5D, $5F, $3C, $48, $47, $4D, $4B, $48 ; CPU:$E73F PRG:273F 5E 3E 4B 5F 49 3A 3D 5F 5D 5F 3C 48 47 4D 4B 48 - .byte $45, $45, $3E, $4B, $21, $63, $1B, $60, $42, $3F, $5F, $49, $48, $5E, $3E, $4B ; CPU:$E74F PRG:274F 45 45 3E 4B 21 63 1B 60 42 3F 5F 49 48 5E 3E 4B - .byte $5F, $49, $3A, $3D, $5F, $42, $4C, $5F, $3C, $48, $47, $47, $3E, $3C, $4D, $3E ; CPU:$E75F PRG:275F 5F 49 3A 3D 5F 42 4C 5F 3C 48 47 47 3E 3C 4D 3E - .byte $3D, $62, $21, $83, $1B, $61, $5F, $5F, $5F, $5F, $5F, $5F, $5F, $42, $3C, $5F ; CPU:$E76F PRG:276F 3D 62 21 83 1B 61 5F 5F 5F 5F 5F 5F 5F 42 3C 5F - .byte $46, $3A, $51, $5F, $3B, $3E, $5F, $3B, $3A, $3D, $53, $5F, $5F, $5F, $5F, $63 ; CPU:$E77F PRG:277F 46 3A 51 5F 3B 3E 5F 3B 3A 3D 53 5F 5F 5F 5F 63 - .byte $00, $23, $04, $16, $49, $4B, $3E, $4C, $4C, $5F, $3A, $5F, $4D, $48, $5F, $4D ; CPU:$E78F PRG:278F 00 23 04 16 49 4B 3E 4C 4C 5F 3A 5F 4D 48 5F 4D - .byte $3E, $4C, $4D, $5F, $4C, $42, $3D, $3E, $57, $3A, $23, $44, $16, $49, $4B, $3E ; CPU:$E79F PRG:279F 3E 4C 4D 5F 4C 42 3D 3E 57 3A 23 44 16 49 4B 3E - .byte $4C, $4C, $5F, $3B, $5F, $4D, $48, $5F, $4D, $3E, $4C, $4D, $5F, $4C, $42, $3D ; CPU:$E7AF PRG:27AF 4C 4C 5F 3B 5F 4D 48 5F 4D 3E 4C 4D 5F 4C 42 3D - .byte $3E, $57, $3B, $00, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E7BF PRG:27BF 3E 57 3B 00 FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E7CF PRG:27CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E7DF PRG:27DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E7EF PRG:27EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E7FF PRG:27FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E80F PRG:280F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E81F PRG:281F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E82F PRG:282F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E83F PRG:283F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E84F PRG:284F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E85F PRG:285F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E86F PRG:286F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E87F PRG:287F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E88F PRG:288F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E89F PRG:289F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E8AF PRG:28AF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E8BF PRG:28BF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E8CF PRG:28CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E8DF PRG:28DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E8EF PRG:28EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E8FF PRG:28FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E90F PRG:290F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E91F PRG:291F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E92F PRG:292F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E93F PRG:293F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E94F PRG:294F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E95F PRG:295F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E96F PRG:296F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E97F PRG:297F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E98F PRG:298F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E99F PRG:299F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E9AF PRG:29AF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E9BF PRG:29BF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E9CF PRG:29CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E9DF PRG:29DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E9EF PRG:29EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E9FF PRG:29FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA0F PRG:2A0F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA1F PRG:2A1F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA2F PRG:2A2F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA3F PRG:2A3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA4F PRG:2A4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA5F PRG:2A5F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA6F PRG:2A6F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA7F PRG:2A7F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA8F PRG:2A8F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA9F PRG:2A9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EAAF PRG:2AAF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EABF PRG:2ABF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EACF PRG:2ACF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EADF PRG:2ADF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EAEF PRG:2AEF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EAFF PRG:2AFF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB0F PRG:2B0F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB1F PRG:2B1F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB2F PRG:2B2F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB3F PRG:2B3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB4F PRG:2B4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB5F PRG:2B5F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB6F PRG:2B6F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB7F PRG:2B7F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB8F PRG:2B8F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB9F PRG:2B9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EBAF PRG:2BAF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EBBF PRG:2BBF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EBCF PRG:2BCF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EBDF PRG:2BDF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EBEF PRG:2BEF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EBFF PRG:2BFF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC0F PRG:2C0F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC1F PRG:2C1F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC2F PRG:2C2F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC3F PRG:2C3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC4F PRG:2C4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC5F PRG:2C5F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC6F PRG:2C6F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC7F PRG:2C7F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC8F PRG:2C8F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC9F PRG:2C9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ECAF PRG:2CAF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ECBF PRG:2CBF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ECCF PRG:2CCF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ECDF PRG:2CDF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ECEF PRG:2CEF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ECFF PRG:2CFF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED0F PRG:2D0F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED1F PRG:2D1F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED2F PRG:2D2F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED3F PRG:2D3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED4F PRG:2D4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED5F PRG:2D5F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED6F PRG:2D6F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED7F PRG:2D7F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED8F PRG:2D8F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED9F PRG:2D9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EDAF PRG:2DAF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EDBF PRG:2DBF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EDCF PRG:2DCF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EDDF PRG:2DDF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EDEF PRG:2DEF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EDFF PRG:2DFF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE0F PRG:2E0F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE1F PRG:2E1F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE2F PRG:2E2F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE3F PRG:2E3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE4F PRG:2E4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE5F PRG:2E5F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE6F PRG:2E6F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE7F PRG:2E7F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE8F PRG:2E8F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE9F PRG:2E9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EEAF PRG:2EAF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EEBF PRG:2EBF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EECF PRG:2ECF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EEDF PRG:2EDF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EEEF PRG:2EEF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EEFF PRG:2EFF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF0F PRG:2F0F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF1F PRG:2F1F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF2F PRG:2F2F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF3F PRG:2F3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF4F PRG:2F4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF5F PRG:2F5F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF6F PRG:2F6F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF7F PRG:2F7F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF8F PRG:2F8F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF9F PRG:2F9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EFAF PRG:2FAF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EFBF PRG:2FBF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EFCF PRG:2FCF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EFDF PRG:2FDF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EFEF PRG:2FEF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $4F, $E5, $8A, $E5, $B3, $E5, $4C, $E6, $BF, $E6, $32, $E7, $CC, $E4, $E3 ; CPU:$EFFF PRG:2FFF FF 4F E5 8A E5 B3 E5 4C E6 BF E6 32 E7 CC E4 E3 - .byte $E4, $90, $E7, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F00F PRG:300F E4 90 E7 FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F01F PRG:301F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F02F PRG:302F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F03F PRG:303F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F04F PRG:304F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F05F PRG:305F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F06F PRG:306F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F07F PRG:307F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F08F PRG:308F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F09F PRG:309F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F0AF PRG:30AF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F0BF PRG:30BF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F0CF PRG:30CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F0DF PRG:30DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F0EF PRG:30EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F0FF PRG:30FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F10F PRG:310F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F11F PRG:311F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F12F PRG:312F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F13F PRG:313F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F14F PRG:314F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F15F PRG:315F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F16F PRG:316F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F17F PRG:317F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F18F PRG:318F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F19F PRG:319F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F1AF PRG:31AF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F1BF PRG:31BF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F1CF PRG:31CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F1DF PRG:31DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F1EF PRG:31EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F1FF PRG:31FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F20F PRG:320F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F21F PRG:321F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F22F PRG:322F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F23F PRG:323F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F24F PRG:324F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F25F PRG:325F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F26F PRG:326F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F27F PRG:327F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F28F PRG:328F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F29F PRG:329F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F2AF PRG:32AF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F2BF PRG:32BF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F2CF PRG:32CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F2DF PRG:32DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F2EF PRG:32EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F2FF PRG:32FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F30F PRG:330F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F31F PRG:331F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F32F PRG:332F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F33F PRG:333F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F34F PRG:334F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F35F PRG:335F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F36F PRG:336F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F37F PRG:337F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F38F PRG:338F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F39F PRG:339F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F3AF PRG:33AF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F3BF PRG:33BF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F3CF PRG:33CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F3DF PRG:33DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F3EF PRG:33EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F3FF PRG:33FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F40F PRG:340F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F41F PRG:341F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F42F PRG:342F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F43F PRG:343F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F44F PRG:344F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F45F PRG:345F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F46F PRG:346F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F47F PRG:347F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F48F PRG:348F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F49F PRG:349F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F4AF PRG:34AF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F4BF PRG:34BF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F4CF PRG:34CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F4DF PRG:34DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F4EF PRG:34EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F4FF PRG:34FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F50F PRG:350F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F51F PRG:351F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F52F PRG:352F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F53F PRG:353F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F54F PRG:354F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F55F PRG:355F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F56F PRG:356F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F57F PRG:357F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F58F PRG:358F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F59F PRG:359F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F5AF PRG:35AF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F5BF PRG:35BF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F5CF PRG:35CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F5DF PRG:35DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F5EF PRG:35EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F5FF PRG:35FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F60F PRG:360F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F61F PRG:361F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F62F PRG:362F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F63F PRG:363F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F64F PRG:364F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F65F PRG:365F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F66F PRG:366F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F67F PRG:367F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F68F PRG:368F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F69F PRG:369F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F6AF PRG:36AF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F6BF PRG:36BF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F6CF PRG:36CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F6DF PRG:36DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F6EF PRG:36EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F6FF PRG:36FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F70F PRG:370F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F71F PRG:371F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F72F PRG:372F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F73F PRG:373F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F74F PRG:374F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F75F PRG:375F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F76F PRG:376F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F77F PRG:377F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F78F PRG:378F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F79F PRG:379F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F7AF PRG:37AF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F7BF PRG:37BF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F7CF PRG:37CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F7DF PRG:37DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F7EF PRG:37EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F7FF PRG:37FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F80F PRG:380F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F81F PRG:381F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F82F PRG:382F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F83F PRG:383F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F84F PRG:384F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F85F PRG:385F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F86F PRG:386F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F87F PRG:387F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F88F PRG:388F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F89F PRG:389F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F8AF PRG:38AF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F8BF PRG:38BF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F8CF PRG:38CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F8DF PRG:38DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F8EF PRG:38EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F8FF PRG:38FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F90F PRG:390F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F91F PRG:391F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F92F PRG:392F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F93F PRG:393F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F94F PRG:394F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F95F PRG:395F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F96F PRG:396F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F97F PRG:397F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F98F PRG:398F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F99F PRG:399F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F9AF PRG:39AF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F9BF PRG:39BF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F9CF PRG:39CF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F9DF PRG:39DF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F9EF PRG:39EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F9FF PRG:39FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA0F PRG:3A0F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA1F PRG:3A1F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA2F PRG:3A2F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA3F PRG:3A3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA4F PRG:3A4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA5F PRG:3A5F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA6F PRG:3A6F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA7F PRG:3A7F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA8F PRG:3A8F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA9F PRG:3A9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FAAF PRG:3AAF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FABF PRG:3ABF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FACF PRG:3ACF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FADF PRG:3ADF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FAEF PRG:3AEF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FAFF PRG:3AFF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB0F PRG:3B0F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB1F PRG:3B1F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB2F PRG:3B2F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB3F PRG:3B3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB4F PRG:3B4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB5F PRG:3B5F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB6F PRG:3B6F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB7F PRG:3B7F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB8F PRG:3B8F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB9F PRG:3B9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FBAF PRG:3BAF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FBBF PRG:3BBF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FBCF PRG:3BCF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FBDF PRG:3BDF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FBEF PRG:3BEF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FBFF PRG:3BFF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC0F PRG:3C0F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC1F PRG:3C1F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC2F PRG:3C2F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC3F PRG:3C3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC4F PRG:3C4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC5F PRG:3C5F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC6F PRG:3C6F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC7F PRG:3C7F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC8F PRG:3C8F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC9F PRG:3C9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FCAF PRG:3CAF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FCBF PRG:3CBF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FCCF PRG:3CCF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FCDF PRG:3CDF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FCEF PRG:3CEF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FCFF PRG:3CFF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD0F PRG:3D0F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD1F PRG:3D1F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD2F PRG:3D2F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD3F PRG:3D3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD4F PRG:3D4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD5F PRG:3D5F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD6F PRG:3D6F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD7F PRG:3D7F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD8F PRG:3D8F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD9F PRG:3D9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FDAF PRG:3DAF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FDBF PRG:3DBF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FDCF PRG:3DCF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FDDF PRG:3DDF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FDEF PRG:3DEF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FDFF PRG:3DFF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE0F PRG:3E0F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE1F PRG:3E1F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE2F PRG:3E2F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE3F PRG:3E3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE4F PRG:3E4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE5F PRG:3E5F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE6F PRG:3E6F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE7F PRG:3E7F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE8F PRG:3E8F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE9F PRG:3E9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FEAF PRG:3EAF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FEBF PRG:3EBF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FECF PRG:3ECF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FEDF PRG:3EDF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FEEF PRG:3EEF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FEFF PRG:3EFF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF0F PRG:3F0F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF1F PRG:3F1F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF2F PRG:3F2F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF3F PRG:3F3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF4F PRG:3F4F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF5F PRG:3F5F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF6F PRG:3F6F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF7F PRG:3F7F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF8F PRG:3F8F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF9F PRG:3F9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FFAF PRG:3FAF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FFBF PRG:3FBF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FFCF PRG:3FCF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FFDF PRG:3FDF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF - .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $6E, $E0, $00, $E0, $00 ; CPU:$FFEF PRG:3FEF FF FF FF FF FF FF FF FF FF FF FF 6E E0 00 E0 00 - .byte $E0 ; CPU:$FFFF PRG:3FFF E0 + .byte $07, $0C, $00 ; CPU:$E72F PRG:272F 07 0C 00 +; VramWrite stream (ptr slot 5, $F00A). Three ASCII rows rendered with the +; CHR font (digits '0'-'9' at $30-$39, letters 'A'-'Z' at $3A-$52, space +; at $5F): +; $2121 CONNECT POWER PAD <$5D> CONTROLLER +; $2163 <$60>IF POWER PAD IS CONNECTED<$62> +; $2183 <$61> IC MAY BE BAD <$53> <$63> +; Tiles $53-$5E are truncated fragments in CHR ROM (the 'W' of POWER sits +; at $5E and is incomplete), so those positions render as partial marks in +; the original cartridge. +StatusMessageText: + .byte $21, $21, $1E, $3C, $48, $47, $47, $3E, $3C, $4D, $5F, $49, $48, $5E, $3E, $4B ; CPU:$E732 PRG:2732 21 21 1E 3C 48 47 47 3E 3C 4D 5F 49 48 5E 3E 4B + .byte $5F, $49, $3A, $3D, $5F, $5D, $5F, $3C, $48, $47, $4D, $4B, $48, $45, $45, $3E ; CPU:$E742 PRG:2742 5F 49 3A 3D 5F 5D 5F 3C 48 47 4D 4B 48 45 45 3E + .byte $4B, $21, $63, $1B, $60, $42, $3F, $5F, $49, $48, $5E, $3E, $4B, $5F, $49, $3A ; CPU:$E752 PRG:2752 4B 21 63 1B 60 42 3F 5F 49 48 5E 3E 4B 5F 49 3A + .byte $3D, $5F, $42, $4C, $5F, $3C, $48, $47, $47, $3E, $3C, $4D, $3E, $3D, $62, $21 ; CPU:$E762 PRG:2762 3D 5F 42 4C 5F 3C 48 47 47 3E 3C 4D 3E 3D 62 21 + .byte $83, $1B, $61, $5F, $5F, $5F, $5F, $5F, $5F, $5F, $42, $3C, $5F, $46, $3A, $51 ; CPU:$E772 PRG:2772 83 1B 61 5F 5F 5F 5F 5F 5F 5F 42 3C 5F 46 3A 51 + .byte $5F, $3B, $3E, $5F, $3B, $3A, $3D, $53, $5F, $5F, $5F, $5F, $63, $00 ; CPU:$E782 PRG:2782 5F 3B 3E 5F 3B 3A 3D 53 5F 5F 5F 5F 63 00 +; VramWrite stream (ptr slot 8, $F010). The two prompt rows: +; $2304 PRESS A TO TEST SIDE-A +; $2344 PRESS B TO TEST SIDE-B +SideATestPromptText: + .byte $23, $04, $16, $49, $4B, $3E, $4C, $4C, $5F, $3A, $5F, $4D, $48, $5F, $4D, $3E ; CPU:$E790 PRG:2790 23 04 16 49 4B 3E 4C 4C 5F 3A 5F 4D 48 5F 4D 3E + .byte $4C, $4D, $5F, $4C, $42, $3D, $3E, $57, $3A, $23, $44, $16, $49, $4B, $3E, $4C ; CPU:$E7A0 PRG:27A0 4C 4D 5F 4C 42 3D 3E 57 3A 23 44 16 49 4B 3E 4C + .byte $4C, $5F, $3B, $5F, $4D, $48, $5F, $4D, $3E, $4C, $4D, $5F, $4C, $42, $3D, $3E ; CPU:$E7B0 PRG:27B0 4C 5F 3B 5F 4D 48 5F 4D 3E 4C 4D 5F 4C 42 3D 3E + .byte $57, $3B, $00, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E7C0 PRG:27C0 57 3B 00 FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E7D0 PRG:27D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E7E0 PRG:27E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E7F0 PRG:27F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E800 PRG:2800 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E810 PRG:2810 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E820 PRG:2820 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E830 PRG:2830 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E840 PRG:2840 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E850 PRG:2850 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E860 PRG:2860 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E870 PRG:2870 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E880 PRG:2880 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E890 PRG:2890 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E8A0 PRG:28A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E8B0 PRG:28B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E8C0 PRG:28C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E8D0 PRG:28D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E8E0 PRG:28E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E8F0 PRG:28F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E900 PRG:2900 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E910 PRG:2910 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E920 PRG:2920 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E930 PRG:2930 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E940 PRG:2940 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E950 PRG:2950 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E960 PRG:2960 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E970 PRG:2970 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E980 PRG:2980 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E990 PRG:2990 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E9A0 PRG:29A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E9B0 PRG:29B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E9C0 PRG:29C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E9D0 PRG:29D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E9E0 PRG:29E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$E9F0 PRG:29F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA00 PRG:2A00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA10 PRG:2A10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA20 PRG:2A20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA30 PRG:2A30 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA40 PRG:2A40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA50 PRG:2A50 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA60 PRG:2A60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA70 PRG:2A70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA80 PRG:2A80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EA90 PRG:2A90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EAA0 PRG:2AA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EAB0 PRG:2AB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EAC0 PRG:2AC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EAD0 PRG:2AD0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EAE0 PRG:2AE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EAF0 PRG:2AF0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB00 PRG:2B00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB10 PRG:2B10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB20 PRG:2B20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB30 PRG:2B30 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB40 PRG:2B40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB50 PRG:2B50 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB60 PRG:2B60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB70 PRG:2B70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB80 PRG:2B80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EB90 PRG:2B90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EBA0 PRG:2BA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EBB0 PRG:2BB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EBC0 PRG:2BC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EBD0 PRG:2BD0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EBE0 PRG:2BE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EBF0 PRG:2BF0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC00 PRG:2C00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC10 PRG:2C10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC20 PRG:2C20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC30 PRG:2C30 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC40 PRG:2C40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC50 PRG:2C50 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC60 PRG:2C60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC70 PRG:2C70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC80 PRG:2C80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EC90 PRG:2C90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ECA0 PRG:2CA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ECB0 PRG:2CB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ECC0 PRG:2CC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ECD0 PRG:2CD0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ECE0 PRG:2CE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ECF0 PRG:2CF0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED00 PRG:2D00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED10 PRG:2D10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED20 PRG:2D20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED30 PRG:2D30 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED40 PRG:2D40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED50 PRG:2D50 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED60 PRG:2D60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED70 PRG:2D70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED80 PRG:2D80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$ED90 PRG:2D90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EDA0 PRG:2DA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EDB0 PRG:2DB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EDC0 PRG:2DC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EDD0 PRG:2DD0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EDE0 PRG:2DE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EDF0 PRG:2DF0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE00 PRG:2E00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE10 PRG:2E10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE20 PRG:2E20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE30 PRG:2E30 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE40 PRG:2E40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE50 PRG:2E50 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE60 PRG:2E60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE70 PRG:2E70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE80 PRG:2E80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EE90 PRG:2E90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EEA0 PRG:2EA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EEB0 PRG:2EB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EEC0 PRG:2EC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EED0 PRG:2ED0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EEE0 PRG:2EE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EEF0 PRG:2EF0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF00 PRG:2F00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF10 PRG:2F10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF20 PRG:2F20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF30 PRG:2F30 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF40 PRG:2F40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF50 PRG:2F50 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF60 PRG:2F60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF70 PRG:2F70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF80 PRG:2F80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EF90 PRG:2F90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EFA0 PRG:2FA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EFB0 PRG:2FB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EFC0 PRG:2FC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EFD0 PRG:2FD0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EFE0 PRG:2FE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$EFF0 PRG:2FF0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + ; Nine little-endian source pointers consumed by VramWrite ($E1CC), which takes +; X = pointer low byte and Y = pointer high byte. Each call site does +; "ldx $F0nn / ldy $F0nn+1 / jsr $E1CC"; the streams tile $E4CC-$E7C2 exactly. +; slot 0 ($F000) -> PowerPadSideAButtonGraphics ($E54F) +; slot 1 ($F002) -> PowerPadButtonLabelTiles ($E58A) +; slot 2 ($F004) -> PanelFrameTiles ($E5B3) +; slot 3 ($F006) -> SideAPressedButtonRow ($E64C) +; slot 4 ($F008) -> SideAPanelButtonRow ($E6BF) +; slot 5 ($F00A) -> StatusMessageText ($E732) +; slot 6 ($F00C) -> Player1ButtonIconStream ($E4CC) +; slot 7 ($F00E) -> Player2ButtonIconStream ($E4E3) +; slot 8 ($F010) -> SideATestPromptText ($E790) +VramWriteSourcePointerTable: + .byte $4F, $E5, $8A, $E5, $B3, $E5, $4C, $E6, $BF, $E6, $32, $E7, $CC, $E4, $E3, $E4 ; CPU:$F000 PRG:3000 4F E5 8A E5 B3 E5 4C E6 BF E6 32 E7 CC E4 E3 E4 + .byte $90, $E7, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F010 PRG:3010 90 E7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F020 PRG:3020 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F030 PRG:3030 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F040 PRG:3040 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F050 PRG:3050 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F060 PRG:3060 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F070 PRG:3070 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F080 PRG:3080 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F090 PRG:3090 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F0A0 PRG:30A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F0B0 PRG:30B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F0C0 PRG:30C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F0D0 PRG:30D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F0E0 PRG:30E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F0F0 PRG:30F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F100 PRG:3100 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F110 PRG:3110 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F120 PRG:3120 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F130 PRG:3130 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F140 PRG:3140 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F150 PRG:3150 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F160 PRG:3160 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F170 PRG:3170 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F180 PRG:3180 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F190 PRG:3190 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F1A0 PRG:31A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F1B0 PRG:31B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F1C0 PRG:31C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F1D0 PRG:31D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F1E0 PRG:31E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F1F0 PRG:31F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F200 PRG:3200 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F210 PRG:3210 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F220 PRG:3220 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F230 PRG:3230 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F240 PRG:3240 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F250 PRG:3250 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F260 PRG:3260 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F270 PRG:3270 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F280 PRG:3280 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F290 PRG:3290 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F2A0 PRG:32A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F2B0 PRG:32B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F2C0 PRG:32C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F2D0 PRG:32D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F2E0 PRG:32E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F2F0 PRG:32F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F300 PRG:3300 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F310 PRG:3310 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F320 PRG:3320 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F330 PRG:3330 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F340 PRG:3340 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F350 PRG:3350 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F360 PRG:3360 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F370 PRG:3370 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F380 PRG:3380 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F390 PRG:3390 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F3A0 PRG:33A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F3B0 PRG:33B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F3C0 PRG:33C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F3D0 PRG:33D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F3E0 PRG:33E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F3F0 PRG:33F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F400 PRG:3400 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F410 PRG:3410 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F420 PRG:3420 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F430 PRG:3430 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F440 PRG:3440 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F450 PRG:3450 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F460 PRG:3460 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F470 PRG:3470 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F480 PRG:3480 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F490 PRG:3490 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F4A0 PRG:34A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F4B0 PRG:34B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F4C0 PRG:34C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F4D0 PRG:34D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F4E0 PRG:34E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F4F0 PRG:34F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F500 PRG:3500 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F510 PRG:3510 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F520 PRG:3520 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F530 PRG:3530 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F540 PRG:3540 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F550 PRG:3550 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F560 PRG:3560 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F570 PRG:3570 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F580 PRG:3580 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F590 PRG:3590 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F5A0 PRG:35A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F5B0 PRG:35B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F5C0 PRG:35C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F5D0 PRG:35D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F5E0 PRG:35E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F5F0 PRG:35F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F600 PRG:3600 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F610 PRG:3610 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F620 PRG:3620 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F630 PRG:3630 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F640 PRG:3640 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F650 PRG:3650 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F660 PRG:3660 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F670 PRG:3670 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F680 PRG:3680 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F690 PRG:3690 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F6A0 PRG:36A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F6B0 PRG:36B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F6C0 PRG:36C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F6D0 PRG:36D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F6E0 PRG:36E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F6F0 PRG:36F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F700 PRG:3700 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F710 PRG:3710 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F720 PRG:3720 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F730 PRG:3730 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F740 PRG:3740 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F750 PRG:3750 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F760 PRG:3760 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F770 PRG:3770 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F780 PRG:3780 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F790 PRG:3790 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F7A0 PRG:37A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F7B0 PRG:37B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F7C0 PRG:37C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F7D0 PRG:37D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F7E0 PRG:37E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F7F0 PRG:37F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F800 PRG:3800 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F810 PRG:3810 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F820 PRG:3820 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F830 PRG:3830 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F840 PRG:3840 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F850 PRG:3850 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F860 PRG:3860 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F870 PRG:3870 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F880 PRG:3880 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F890 PRG:3890 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F8A0 PRG:38A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F8B0 PRG:38B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F8C0 PRG:38C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F8D0 PRG:38D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F8E0 PRG:38E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F8F0 PRG:38F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F900 PRG:3900 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F910 PRG:3910 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F920 PRG:3920 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F930 PRG:3930 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F940 PRG:3940 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F950 PRG:3950 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F960 PRG:3960 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F970 PRG:3970 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F980 PRG:3980 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F990 PRG:3990 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F9A0 PRG:39A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F9B0 PRG:39B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F9C0 PRG:39C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F9D0 PRG:39D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F9E0 PRG:39E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F9F0 PRG:39F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA00 PRG:3A00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA10 PRG:3A10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA20 PRG:3A20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA30 PRG:3A30 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA40 PRG:3A40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA50 PRG:3A50 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA60 PRG:3A60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA70 PRG:3A70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA80 PRG:3A80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FA90 PRG:3A90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FAA0 PRG:3AA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FAB0 PRG:3AB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FAC0 PRG:3AC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FAD0 PRG:3AD0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FAE0 PRG:3AE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FAF0 PRG:3AF0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB00 PRG:3B00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB10 PRG:3B10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB20 PRG:3B20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB30 PRG:3B30 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB40 PRG:3B40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB50 PRG:3B50 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB60 PRG:3B60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB70 PRG:3B70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB80 PRG:3B80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FB90 PRG:3B90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FBA0 PRG:3BA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FBB0 PRG:3BB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FBC0 PRG:3BC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FBD0 PRG:3BD0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FBE0 PRG:3BE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FBF0 PRG:3BF0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC00 PRG:3C00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC10 PRG:3C10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC20 PRG:3C20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC30 PRG:3C30 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC40 PRG:3C40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC50 PRG:3C50 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC60 PRG:3C60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC70 PRG:3C70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC80 PRG:3C80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FC90 PRG:3C90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FCA0 PRG:3CA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FCB0 PRG:3CB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FCC0 PRG:3CC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FCD0 PRG:3CD0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FCE0 PRG:3CE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FCF0 PRG:3CF0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD00 PRG:3D00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD10 PRG:3D10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD20 PRG:3D20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD30 PRG:3D30 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD40 PRG:3D40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD50 PRG:3D50 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD60 PRG:3D60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD70 PRG:3D70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD80 PRG:3D80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FD90 PRG:3D90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FDA0 PRG:3DA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FDB0 PRG:3DB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FDC0 PRG:3DC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FDD0 PRG:3DD0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FDE0 PRG:3DE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FDF0 PRG:3DF0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE00 PRG:3E00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE10 PRG:3E10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE20 PRG:3E20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE30 PRG:3E30 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE40 PRG:3E40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE50 PRG:3E50 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE60 PRG:3E60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE70 PRG:3E70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE80 PRG:3E80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FE90 PRG:3E90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FEA0 PRG:3EA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FEB0 PRG:3EB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FEC0 PRG:3EC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FED0 PRG:3ED0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FEE0 PRG:3EE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FEF0 PRG:3EF0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF00 PRG:3F00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF10 PRG:3F10 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF20 PRG:3F20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF30 PRG:3F30 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF40 PRG:3F40 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF50 PRG:3F50 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF60 PRG:3F60 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF70 PRG:3F70 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF80 PRG:3F80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FF90 PRG:3F90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FFA0 PRG:3FA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FFB0 PRG:3FB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FFC0 PRG:3FC0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FFD0 PRG:3FD0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$FFE0 PRG:3FE0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $6E, $E0, $00, $E0, $00, $E0 ; CPU:$FFF0 PRG:3FF0 FF FF FF FF FF FF FF FF FF FF 6E E0 00 E0 00 E0 diff --git a/NES PowerPad Test Card (U)/copilot/reconstructed.lbl b/NES PowerPad Test Card (U)/copilot/reconstructed.lbl index fc86dd5..2f15a21 100644 --- a/NES PowerPad Test Card (U)/copilot/reconstructed.lbl +++ b/NES PowerPad Test Card (U)/copilot/reconstructed.lbl @@ -1,3 +1,11 @@ +al 00F000 .VramWriteSourcePointerTable +al 00E790 .SideATestPromptText +al 00E732 .StatusMessageText +al 00E6BF .SideAPanelButtonRow +al 00E64C .SideAPressedButtonRow +al 00E5B3 .PanelFrameTiles +al 00E58A .PowerPadButtonLabelTiles +al 00E54F .PowerPadSideAButtonGraphics al 00E548 .Label_E548 al 00E53A .ClearScreen al 00E534 .ClearAPUNoise @@ -7,6 +15,10 @@ al 00E514 .Label_E514 al 00E52D .ProcessPadBitsDone al 00E509 .Label_E509 al 00E4FA .ProcessPadBits +al 00E4E3 .Player2ButtonIconStream +al 00E4CC .Player1ButtonIconStream +al 00E4C0 .Player2TileTable +al 00E4B4 .Player1TileTable al 00E4B4 .PadBitTableLives al 00E4AA .LoadPatternTable7 al 00E4A0 .LoadPatternTable6 diff --git a/OVERVIEW.md b/OVERVIEW.md index 4e44b70..a6e76af 100644 --- a/OVERVIEW.md +++ b/OVERVIEW.md @@ -181,7 +181,7 @@ This document provides a consolidated overview of all NES disassembly projects i | `Ice Climber (U)` | $C076 / $C014 / $FFF0 | V | BYTE-IDENTICAL | | `Lode Runner (U)` | $C02C / $C000 / $FFF9 | H | BYTE-IDENTICAL | | `Lunar Pool (U)` | $FF65 / $E80C / $FF64 | H | BYTE-IDENTICAL | -| `MUSCLE (U)` | $86CB / $8000 / $8764 | H | BYTE-IDENTICAL | +| `MUSCLE (U)` | $86CB / $8000 / $8764 | H | **Pass 3 done** — code/data split, full semantic naming, data tables structured; see `_wip/MUSCLE (U)/OVERVIEW.md` | | `Mario Bros (JU)` | $C07D / $C000 / $C000 | H | BYTE-IDENTICAL | | `Millipede (U)` | $C7F1 / $C735 / $FFF0 | H | BYTE-IDENTICAL | | `Pac-Man (Tengen) (U)` | $C0FA / $C033 / $C16A | V | BYTE-IDENTICAL | @@ -196,13 +196,14 @@ This document provides a consolidated overview of all NES disassembly projects i Notable vector/header observations for Pass 1 work: - **Pac-Man (U)** RESET at `$FF00` (vector-page tail), while the Tengen variant RESETs at `$C033` — different builds confirmed (PRG bytes differ). -- **MUSCLE (U)** vectors sit in the `$8000-EFFF` window — inconsistent with the `prg.s` skeleton's expected `$C000-$FFFF` mapping; verify the header/image match before Pass 1. +- **MUSCLE (U)** — resolved at Pass 1: this is the one NROM ROM in the set mapped **low**, at $8000–$BFFF, because RESET is $8000. The skeleton's `$C000` linker assumption was wrong and `linker.cfg` had to move. The vectors themselves still sit in the mirror at $FFFA. IRQ $8764 is a bare `RTI` that doubles as the NMI epilogue. - **Lunar Pool (U)** NMI `$FF65` / IRQ `$FF64` are adjacent in the vector page; RESET `$E80C`. - **NES PowerPad Test Card (U)** — *at Pass 2/3*: minimal code (~7.2%), data-heavy test cartridge. RESET at $E000 (non-$C000 entry). NMI handler reads controllers via shift register, processes pad transitions, draws score/lives. See `NES PowerPad Test Card (U)/OVERVIEW.md`. - **Ice Climber (JE) vs (U)**: byte-identical PRG *and* header — only the CHR differs (~regional title graphic). - **Popeye (JU) PRG 0 vs PRG 1**: different PRG binaries (and mirroring); same vectors. - **Raid on Bungeling Bay (U) vs [a2]**: `[a2]` differs in mirroring only per header, but PRGs differ — separate builds. - **Pyramid (U)** — *already at Pass 1*: interesting unlicensed Sachen boot ($4100 mapper pokes, "AV" stack-byte check, two queued-event dispatchers). See its `OVERVIEW.md`. +- **MUSCLE (U)** — *at Pass 3*: bytecode-VM game. A naive recursive trace reaches only 50.6% of the PRG because the game dispatches through three jump tables and two zero-page `jmp (zp)` calls that a static descender cannot follow: a 38-entry token-program pointer table at `$8CEF`, a 40-entry opcode handler table at `$9237`, a second 16-entry handler table at `$9F2B`, and a 3-entry per-level VRAM-writer table at `$AC35`. Resolving those took code coverage to 64.9%. Compressed-VRAM RLE decoder at `$AC82` with a 12-byte fill table at `$ACBD`; restoring division by 20 at `$82AC`; four-channel sound engine with per-channel state in zero page `$C4-$EF`. See `MUSCLE (U)/OVERVIEW.md`. - **CIRCUS** — *at Pass 2/3*: full recursive disassembly complete. NMI-driven frame state machine (main loop is a spin loop at $C057). Menu text at $C763 ("CONTINUE", "STAGE", "SELECT", "PLAY"). Object state machine at $DC3F–$FE7B. Audio sequence data at $FABB–$FFFB. See `CIRCUS/OVERVIEW.md`. - **Joypad Test Cartridge (U)** — *at Pass 2/3*: minimal code (~3.5%), data-heavy test cartridge. NMI handler drives per-frame PPU/OAM updates. Uses return-address modification trick at `RetAddrUpdate` ($CDC8) with `VramPtrWrite` ($CD3F) for runtime-computed dispatch. See `Joypad Test Cartridge (U)/OVERVIEW.md`. - **Wild Gunman (U)** — *at Pass 2/3*: NMI-driven frame loop with sprite/OAM table at $C844. See `Wild Gunman (U)/OVERVIEW.md`. @@ -259,26 +260,24 @@ make verify # (where supported by the Makefile) ## Summary -All 14 projects in this repository rebuild **byte-identical** to their original ROMs: - -| # | Project | Build Status | -|---|---------|--------------| -| 1 | Balloon Fight (JU) | BYTE-IDENTICAL | -| 2 | Baseball (UE) | BYTE-IDENTICAL | -| 3 | Bomberman (U) | BYTE-IDENTICAL | -| 4 | Burger Time (U) | BYTE-IDENTICAL | -| 5 | Clu Clu Land (JU) | BYTE-IDENTICAL | -| 6 | Defender 2 (U) | BYTE-IDENTICAL | -| 7 | Excitebike (JU) | BYTE-IDENTICAL | -| 8 | Tennis (JU) | BYTE-IDENTICAL | -| 9 | Pac-Man (USA) (Namco) | BYTE-IDENTICAL | -| 10 | Donkey Kong 3 (JUE) | BYTE-IDENTICAL | -| 11 | Donkey Kong Jr. (JU) | BYTE-IDENTICAL (Pass 2/3) | -| 12 | CIRCUS | BYTE-IDENTICAL (Pass 2/3) | -| 13 | Wild Gunman (U) | BYTE-IDENTICAL (Pass 2/3) | -| 14 | Joypad Test Cartridge (U) | BYTE-IDENTICAL (Pass 2/3) | -| 15 | NES PowerPad Test Card (U) | BYTE-IDENTICAL (Pass 2/3) | - All 15 projects in this repository rebuild **byte-identical** to their original ROMs: -The 20 `_wip/` skeleton projects above also all rebuild byte-identical (PRG level); all Pass 1 work and promotion to this index's numbered inventory is future work. \ No newline at end of file +| # | Project | Build Status | Pass 3 | +|---|---------|--------------|--------| +| 1 | Balloon Fight (JU) | BYTE-IDENTICAL | in progress | +| 2 | Baseball (UE) | BYTE-IDENTICAL | complete | +| 3 | Bomberman (U) | BYTE-IDENTICAL | complete | +| 4 | Burger Time (U) | BYTE-IDENTICAL | complete | +| 5 | Clu Clu Land (JU) | BYTE-IDENTICAL | complete | +| 6 | Defender 2 (U) | BYTE-IDENTICAL | complete | +| 7 | Excitebike (JU) | BYTE-IDENTICAL | complete | +| 8 | Tennis (JU) | BYTE-IDENTICAL | complete | +| 9 | Pac-Man (USA) (Namco) | BYTE-IDENTICAL | complete | +| 10 | Donkey Kong 3 (JUE) | BYTE-IDENTICAL | complete | +| 11 | Donkey Kong Jr. (JU) | BYTE-IDENTICAL | pending | +| 12 | CIRCUS | BYTE-IDENTICAL | complete | +| 13 | Wild Gunman (U) | BYTE-IDENTICAL | pending | +| 14 | Joypad Test Cartridge (U) | BYTE-IDENTICAL | pending | +| 15 | NES PowerPad Test Card (U) | BYTE-IDENTICAL | pending | + +The 20 `_wip/` skeleton projects above also all rebuild byte-identical (PRG level); all Pass 1 work and promotion to this index's numbered inventory is future work. diff --git a/_tools/nesdis.py b/_tools/nesdis.py new file mode 100644 index 0000000..5403d6c --- /dev/null +++ b/_tools/nesdis.py @@ -0,0 +1,700 @@ +#!/usr/bin/env python3 +"""Recursive-trace NES PRG disassembler that emits ca65 source (Pass 1). + +Classifies every PRG byte as reachable code or data by recursive descent from +the RESET/NMI/IRQ vectors, then writes a byte-identical ca65 file where each +instruction carries a trailing `; CPU:$xxxx PRG:xxxx AA BB` audit comment and +every unreached byte stays as an explicit `.byte` line (never deleted). + +Usage: + nesdis.py --prg prg.bin --base 0x8000 --project "MUSCLE (U)" \ + --out prg.s --locals locals.inc [--pass2] +""" + +import argparse +import sys +from collections import OrderedDict +from pathlib import Path + +# --------------------------------------------------------------------------- +# Official NMOS 6502 opcode table: opcode -> (mnemonic, addressing mode) +# --------------------------------------------------------------------------- + +IMP, ACC, IMM, ZP, ZPX, ZPY, ABS, ABSX, ABSY, IND, INDX, INDY, REL = range(13) + +OPCODES = { + 0x00: ("brk", IMP), 0x01: ("ora", INDX), 0x05: ("ora", ZP), 0x06: ("asl", ZP), + 0x08: ("php", IMP), 0x09: ("ora", IMM), 0x0A: ("asl", ACC), 0x0D: ("ora", ABS), + 0x0E: ("asl", ABS), 0x10: ("bpl", REL), 0x11: ("ora", INDY), 0x15: ("ora", ZPX), + 0x16: ("asl", ZPX), 0x18: ("clc", IMP), 0x19: ("ora", ABSY), 0x1D: ("ora", ABSX), + 0x1E: ("asl", ABSX), 0x20: ("jsr", ABS), 0x21: ("and", INDX), 0x24: ("bit", ZP), + 0x25: ("and", ZP), 0x26: ("rol", ZP), 0x28: ("plp", IMP), 0x29: ("and", IMM), + 0x2A: ("rol", ACC), 0x2C: ("bit", ABS), 0x2D: ("and", ABS), 0x2E: ("rol", ABS), + 0x30: ("bmi", REL), 0x31: ("and", INDY), 0x35: ("and", ZPX), 0x36: ("rol", ZPX), + 0x38: ("sec", IMP), 0x39: ("and", ABSY), 0x3D: ("and", ABSX), 0x3E: ("rol", ABSX), + 0x40: ("rti", IMP), 0x41: ("eor", INDX), 0x45: ("eor", ZP), 0x46: ("lsr", ZP), + 0x48: ("pha", IMP), 0x49: ("eor", IMM), 0x4A: ("lsr", ACC), 0x4C: ("jmp", ABS), + 0x4D: ("eor", ABS), 0x4E: ("lsr", ABS), 0x50: ("bvc", REL), 0x51: ("eor", INDY), + 0x55: ("eor", ZPX), 0x56: ("lsr", ZPX), 0x58: ("cli", IMP), 0x59: ("eor", ABSY), + 0x5D: ("eor", ABSX), 0x5E: ("lsr", ABSX), 0x60: ("rts", IMP), 0x61: ("adc", INDX), + 0x65: ("adc", ZP), 0x66: ("ror", ZP), 0x68: ("pla", IMP), 0x69: ("adc", IMM), + 0x6A: ("ror", ACC), 0x6C: ("jmp", IND), 0x6D: ("adc", ABS), 0x6E: ("ror", ABS), + 0x70: ("bvs", REL), 0x71: ("adc", INDY), 0x75: ("adc", ZPX), 0x76: ("ror", ZPX), + 0x78: ("sei", IMP), 0x79: ("adc", ABSY), 0x7D: ("adc", ABSX), 0x7E: ("ror", ABSX), + 0x81: ("sta", INDX), 0x84: ("sty", ZP), 0x85: ("sta", ZP), 0x86: ("stx", ZP), + 0x88: ("dey", IMP), 0x8A: ("txa", IMP), 0x8C: ("sty", ABS), 0x8D: ("sta", ABS), + 0x8E: ("stx", ABS), 0x90: ("bcc", REL), 0x91: ("sta", INDY), 0x94: ("sty", ZPX), + 0x95: ("sta", ZPX), 0x96: ("stx", ZPY), 0x98: ("tya", IMP), 0x99: ("sta", ABSY), + 0x9A: ("txs", IMP), 0x9D: ("sta", ABSX), 0xA0: ("ldy", IMM), 0xA1: ("lda", INDX), + 0xA2: ("ldx", IMM), 0xA4: ("ldy", ZP), 0xA5: ("lda", ZP), 0xA6: ("ldx", ZP), + 0xA8: ("tay", IMP), 0xA9: ("lda", IMM), 0xAA: ("tax", IMP), 0xAC: ("ldy", ABS), + 0xAD: ("lda", ABS), 0xAE: ("ldx", ABS), 0xB0: ("bcs", REL), 0xB1: ("lda", INDY), + 0xB4: ("ldy", ZPX), 0xB5: ("lda", ZPX), 0xB6: ("ldx", ZPY), 0xB8: ("clv", IMP), + 0xB9: ("lda", ABSY), 0xBA: ("tsx", IMP), 0xBC: ("ldy", ABSX), 0xBD: ("lda", ABSX), + 0xBE: ("ldx", ABSY), 0xC0: ("cpy", IMM), 0xC1: ("cmp", INDX), 0xC4: ("cpy", ZP), + 0xC5: ("cmp", ZP), 0xC6: ("dec", ZP), 0xC8: ("iny", IMP), 0xC9: ("cmp", IMM), + 0xCA: ("dex", IMP), 0xCC: ("cpy", ABS), 0xCD: ("cmp", ABS), 0xCE: ("dec", ABS), + 0xD0: ("bne", REL), 0xD1: ("cmp", INDY), 0xD5: ("cmp", ZPX), 0xD6: ("dec", ZPX), + 0xD8: ("cld", IMP), 0xD9: ("cmp", ABSY), 0xDD: ("cmp", ABSX), 0xDE: ("dec", ABSX), + 0xE0: ("cpx", IMM), 0xE1: ("sbc", INDX), 0xE4: ("cpx", ZP), 0xE5: ("sbc", ZP), + 0xE6: ("inc", ZP), 0xE8: ("inx", IMP), 0xE9: ("sbc", IMM), 0xEA: ("nop", IMP), + 0xEC: ("cpx", ABS), 0xED: ("sbc", ABS), 0xEE: ("inc", ABS), 0xF0: ("beq", REL), + 0xF1: ("sbc", INDY), 0xF5: ("sbc", ZPX), 0xF6: ("inc", ZPX), 0xF8: ("sed", IMP), + 0xF9: ("sbc", ABSY), 0xFD: ("sbc", ABSX), 0xFE: ("inc", ABSX), +} + +MODE_LEN = {IMP: 1, ACC: 1, IMM: 2, ZP: 2, ZPX: 2, ZPY: 2, REL: 2, + ABS: 3, ABSX: 3, ABSY: 3, IND: 3, INDX: 2, INDY: 2} + +# Instructions after which control never falls through. +TERMINATORS = {"jmp", "rts", "rti", "brk"} + +BRANCHES = {"bpl", "bmi", "bvc", "bvs", "bcc", "bcs", "bne", "beq"} + + +class Insn: + """One decoded 6502 instruction.""" + + def __init__(self, addr, length, text): + self.addr = addr + self.length = length + self.text = text # rendered operand text (without mnemonic) + self.opcode = None + self.mnemonic = None + self.mode = None + self.target = None # branch/jump destination (CPU address) + self.jsr_target = None # for jsr/jmp abs: subroutine/entry address + + +def hex16(v): + return f"${v:04X}" + + +def render(prg, base, opcode, pc): + """Decode one instruction at pc. Returns an Insn or None when illegal.""" + if pc >= len(prg): + return None + entry = OPCODES.get(prg[pc]) + if entry is None: + return None + mnemonic, mode = entry + length = MODE_LEN[mode] + if pc + length > len(prg): + return None + + b1 = prg[pc + 1] if length > 1 else 0 + b2 = prg[pc + 2] if length > 2 else 0 + insn = Insn(pc + base, length, "") + insn.opcode = prg[pc] + insn.mnemonic = mnemonic + insn.mode = mode + + if mode == IMP: + insn.text = "" + elif mode == ACC: + insn.text = "a" + elif mode == IMM: + insn.text = f"#${b1:02X}" + elif mode == ZP: + insn.text = f"Zp{b1:02X}" + elif mode == ZPX: + insn.text = f"Zp{b1:02X},x" + elif mode == ZPY: + insn.text = f"Zp{b1:02X},y" + elif mode == ABS: + insn.text = hex16(b1 | (b2 << 8)) + elif mode == ABSX: + insn.text = f"{hex16(b1 | (b2 << 8))},x" + elif mode == ABSY: + insn.text = f"{hex16(b1 | (b2 << 8))},y" + elif mode == IND: + insn.text = f"({hex16(b1 | (b2 << 8))})" + elif mode == INDX: + insn.text = f"(Zp{b1:02X},x)" + elif mode == INDY: + insn.text = f"(Zp{b1:02X}),y" + elif mode == REL: + offset = b1 - 256 if b1 > 127 else b1 + insn.target = base + pc + 2 + offset + insn.text = f"Label_{insn.target:04X}" + return insn + + +def trace(prg, base, seeds): + """Recursive descent from seeds. Returns (insns, invalid, indirect, targets, overlap).""" + insns = {} + targets = set(seeds) + invalid = [] + indirect = [] + overlap = [] + queue = list(seeds) + + while queue: + addr = queue.pop(0) + if addr in insns: + continue + off = addr - base + if off < 0 or off >= len(prg): + continue + cur = off + while True: + if cur in insns: + break + if cur < 0 or cur >= len(prg): + break + insn = render(prg, base, prg[cur], cur) + if insn is None: + invalid.append(base + cur) + break + clash = [c for c in range(cur + 1, cur + insn.length) if c in insns] + if clash: + overlap.append((base + cur, insn.mnemonic, [base + c for c in clash])) + insns[cur] = insn + + # Follow control transfers. + if insn.mnemonic in BRANCHES: + t = insn.target + if base <= t < base + len(prg): + targets.add(t) + queue.append(t) + elif insn.mnemonic == "jsr": + t = int(insn.text[1:], 16) + insn.jsr_target = t + if base <= t < base + len(prg): + targets.add(t) + queue.append(t) + elif insn.mnemonic == "jmp": + if insn.mode == ABS: + t = int(insn.text[1:], 16) + insn.jsr_target = t + if base <= t < base + len(prg): + targets.add(t) + queue.append(t) + break # unconditional: no fall-through + else: + ptr = int(insn.text.strip("()")[1:], 16) + indirect.append((base + cur, ptr)) + if base <= ptr < base + len(prg) - 1: + t = prg[ptr - base] | (prg[ptr - base + 1] << 8) + if base <= t < base + len(prg): + targets.add(t) + queue.append(t) + break + elif insn.mnemonic in TERMINATORS: + break + + cur += insn.length + + return insns, invalid, indirect, targets, overlap + + +def scan_orphans(prg, base, insns, min_len=8): + """Contiguous untraced runs, used to hunt for code missed by static trace. + + Coverage includes operand bytes, so only genuinely untouched ROM is reported. + """ + covered = set() + for off, insn in insns.items(): + for k in range(off, off + insn.length): + covered.add(k) + out = [] + n = len(prg) + i = 0 + while i < n: + if i in covered: + i += 1 + continue + j = i + while j < n and j not in covered: + j += 1 + if j - i >= min_len: + out.append((i, j - i)) + i = j + return out + + +def probe(prg, base, addr, max_insns=64): + """Decode linearly from addr without recording; used to judge candidate seeds.""" + cur = addr - base + n = len(prg) + seq = [] + term = None + for _ in range(max_insns): + if cur >= n: + break + insn = render(prg, base, prg[cur], cur) + if insn is None: + return seq, f"illegal ${base + cur:04X}" + seq.append(insn) + cur += insn.length + if insn.mnemonic in TERMINATORS: + term = insn.mnemonic + break + return seq, term + + +# Bytes that may legally precede a routine entry point. +ENTRY_PREDECESSORS = {0x60, 0x4C, 0x6C, 0x40, 0x00, 0xEA, 0x6A, 0x4A, 0x2A, 0x0A} + + +def operand_value(insn): + """Absolute address of an ABS/ABSX/ABSY/IND operand, or None.""" + if insn.mode not in (ABS, ABSX, ABSY, IND): + return None + token = insn.text.strip("()").split(",")[0].lstrip("$") + return int(token, 16) + + +def operand_in_prg(insn, base, n): + value = operand_value(insn) + return value is None or (base <= value < base + n) + + +# Mnemonics that only read, only write, or do both, for zero-page reference counting. +ZP_READ_ONLY = {"lda", "ldx", "ldy", "cmp", "cpx", "cpy", "bit"} +ZP_WRITE_ONLY = {"sta", "stx", "sty"} +ZP_READ_WRITE = {"inc", "dec", "asl", "lsr", "rol", "ror"} + + +def classify_zp(insn): + """Return (reads, writes) for a zero-page operand.""" + m = insn.mnemonic + if m in ZP_READ_ONLY: + return 1, 0 + if m in ZP_WRITE_ONLY: + return 0, 1 + if m in ZP_READ_WRITE: + return 1, 1 + if m in ("lda", "ldx", "ldy", "cmp", "cpx", "cpy", "bit", "sbc", "adc", "and", + "ora", "eor"): + return 1, 0 + return 1, 1 + + +def find_referenced_stubs(prg, base, insns, min_insns=4): + """Candidate routine entries that a data table elsewhere in the image points at. + + This recovers code reached only through computed dispatch (jump tables feeding + `jmp (zp)`, RTS tables), which a plain recursive trace from the vectors cannot see. + A candidate must start right after a plausible terminator, decode linearly with no + illegal opcode, run at least `min_insns` instructions, and end in rts/jmp. + + Offsets that are operand bytes of already-decoded instructions are rejected first: + that is what separates a real entry point from a decode that merely starts inside + a neighbouring instruction's operand field. + """ + n = len(prg) + # Every 16-bit little-endian window in the image, mapped to its host offsets. + refs = {} + for off in range(n - 1): + refs.setdefault(prg[off] | (prg[off + 1] << 8), []).append(off) + + # Operand bytes belong to an instruction already known to be reached code. + operand_bytes = set() + for off, insn in insns.items(): + for k in range(off + 1, off + insn.length): + operand_bytes.add(k) + + stubs = [] + for off in range(n): + if off in insns or off in operand_bytes: + continue + if off > 0 and prg[off - 1] not in ENTRY_PREDECESSORS: + continue + addr = base + off + seq, term = probe(prg, base, addr) + if term not in ("rts", "jmp"): + continue + if len(seq) < min_insns: + continue + # Reject anything that runs into already-decoded code mid-stream. + if any((i.addr - base) in insns for i in seq): + continue + # Reject clean decodes that no table anywhere in the image refers to. + if not refs.get(addr): + continue + # Reject stubs whose operands point outside the PRG window (data decode). + if any(not operand_in_prg(i, base, n) for i in seq): + continue + stubs.append(addr) + return stubs + + +def recover(prg, base, seeds, tables=(), max_rounds=12): + """Trace, iteratively seed table-referenced stubs, then drop seeds that collide. + + A recovered stub that turns out to sit inside another instruction's operand field is + a mis-aligned decode, not a routine: it is removed and the trace is redone. + `tables` are explicitly declared 16-bit dispatch tables (addr, entry count) whose + entries are routine entry points; they are seeded on every round. + """ + vector_seeds = list(seeds) + table_seeds = [] + junk = [] + for addr, count in tables: + off = addr - base + for k in range(count): + lo = prg[off + 2 * k] + hi = prg[off + 2 * k + 1] + entry = lo | (hi << 8) + # Dispatch tables leave unused slots filled with whatever followed; only + # keep slots that actually begin a decodable instruction. + if render(prg, base, prg[entry - base], entry - base) is None: + junk.append(entry) + continue + table_seeds.append(entry) + stub_seeds = [] + rejected = [] + result = None + + for _ in range(max_rounds): + result = trace(prg, base, vector_seeds + table_seeds + stub_seeds) + insns, invalid, indirect, targets, overlap = result + + operand_bytes = set() + for off, insn in insns.items(): + for k in range(off + 1, off + insn.length): + operand_bytes.add(k) + + keep, drop = [], [] + for addr in stub_seeds: + (drop if (addr - base) in operand_bytes else keep).append(addr) + stub_seeds = keep + + stubs = find_referenced_stubs(prg, base, insns) + fresh = [s for s in stubs if s not in targets and s not in stub_seeds] + if not fresh and not drop: + break + stub_seeds.extend(fresh) + rejected.extend(drop) + + return result[0], result[1], result[2], result[3], result[4], stub_seeds, rejected, junk + + +def parse_ranges(spec): + """Parse `ADDR:LEN` pairs into (address, length) tuples.""" + out = [] + for tok in spec.split(","): + tok = tok.strip() + if not tok: + continue + addr, length = tok.split(":") + out.append((int(addr, 16), int(length, 10))) + return out + + +def parse_tables(spec): + """Parse `ADDR:COUNT` pairs into (address, entry_count) tuples.""" + return parse_ranges(spec) + + +def build_refs(prg, base, insns, regions): + """Attribute each data region to the decoded instructions that reference it. + + `regions` are (offset, length) pairs from scan_orphans; results are keyed by the + region's start CPU address so the emitter can look them up directly. + """ + refs = {base + off: [] for off, _ in regions} + if not regions: + return refs + for off in sorted(insns): + insn = insns[off] + value = operand_value(insn) + if value is None: + continue + addr = base + off + for start, length in regions: + if base + start <= value < base + start + length: + refs[base + start].append((addr, insn, value)) + break + return refs + + +def byte_columns(values): + return ", ".join(f"${v:02X}" for v in values) + + +def emit_code(prg, base, insns, targets, out, project, semantic, refs=None): + """Render the full PRG as ca65 text: code where traced, .byte elsewhere.""" + n = len(prg) + refs = refs or {} + name_of = {} + + # Seed semantic entry-point names. + for addr, name in semantic.items(): + name_of[addr] = name + + i = 0 + routine_header = [ + "; -----------------------------------------------------------------------------", + "; Routine: {name}", + "; Global: Contextual control-flow entry identified from its parent routine and incoming branch usage.", + "; Local: Continues its parent routine along the condition or operation encoded in this label,", + "; then returns, branches again, or rejoins shared code as documented by the instructions.", + "; Parameters: Undetermined in Pass 1 unless implied by the caller.", + "; Returns: Undetermined in Pass 1; status flags and registers may carry results.", + "; Clobbers: Undetermined in Pass 1.", + "; -----------------------------------------------------------------------------", + ] + + while i < n: + cpu = base + i + + if i in insns: + insn = insns[i] + if cpu in targets or cpu in name_of: + name = name_of.get(cpu) or f"Label_{cpu:04X}" + for line in routine_header: + out.append(line.format(name=name)) + out.append(f"{name}:") + text = f"{insn.mnemonic} {insn.text}".strip() + raw = " ".join(f"{b:02X}" for b in prg[i:i + insn.length]) + line = f" {text}" + out.append(f"{line:<31}; CPU:${cpu:04X} PRG:{i:04X} {raw}") + i += insn.length + continue + + # Data run. + j = i + while j < n and j not in insns: + j += 1 + cpu_end = base + j - 1 + out.append(f"; ---- data ${cpu:04X}-${cpu_end:04X} ({j - i} bytes) ----") + for addr, insn, value in refs.get(cpu, [])[:6]: + text = f"{insn.mnemonic} {insn.text}".strip() + out.append(f"; referenced by `{text}` at ${addr:04X} " + f"(operand ${value:04X} falls inside this region)") + if len(refs.get(cpu, [])) > 6: + out.append(f"; ... and {len(refs[cpu]) - 6} further references from decoded code") + if cpu in name_of: + out.append(f"{name_of[cpu]}:") + k = i + while k < j: + chunk = prg[k:min(k + 16, j)] + raw = " ".join(f"{b:02X}" for b in chunk) + out.append(f" .byte {byte_columns(chunk)} ; CPU:${base + k:04X} PRG:{k:04X} {raw}") + k += 16 + i = j + + return name_of + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--prg", required=True) + ap.add_argument("--base", default="0x8000") + ap.add_argument("--project", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--locals", default=None) + ap.add_argument("--zp-aliases", default=None, + help="comma list addr=name pairs for semantic zero-page names") + ap.add_argument("--zp-strict", action="store_true", + help="use ZpXX for every zero-page operand (default)") + ap.add_argument("--extra-seed", default="", + help="comma list of CPU addresses to seed in addition to the vectors") + ap.add_argument("--report-orphans", type=int, default=0, + help="print untraced runs of at least N bytes (missed-code hunting)") + ap.add_argument("--auto-seed", action="store_true", + help="iteratively seed table-referenced routine stubs to recover " + "computed-dispatch code, then report every recovered entry") + ap.add_argument("--table", default="", + help="comma list of ADDR:COUNT declaring a 16-bit dispatch table whose " + "entries are routine entry points (e.g. 0x9237:40)") + ap.add_argument("--data", default="", + help="comma list of ADDR:LEN forcing a region back to data even when " + "static fall-through reached it (branch-over-data)") + ap.add_argument("--probe", default="", + help="comma list of CPU addresses to decode linearly for inspection") + args = ap.parse_args() + + base = int(args.base, 16) + prg = Path(args.prg).read_bytes() + if len(prg) < 6: + sys.exit("PRG image too small for vectors") + + nmi = prg[-6] | (prg[-5] << 8) + rst = prg[-4] | (prg[-3] << 8) + irq = prg[-2] | (prg[-1] << 8) + + extra = [int(a, 16) for a in args.extra_seed.split(",") if a.strip()] + + if args.probe: + for tok in args.probe.split(","): + tok = tok.strip() + if not tok: + continue + addr = int(tok, 16) + seq, term = probe(prg, base, addr) + print(f"probe {tok}: {len(seq)} insns, terminator={term}") + for insn in seq: + raw = " ".join(f"{b:02X}" for b in prg[insn.addr - base:insn.addr - base + insn.length]) + text = f"{insn.mnemonic} {insn.text}".strip() + print(f" ${insn.addr:04X} {raw:<9} {text}") + return + + seeds = [rst, nmi, irq] + extra + tables = parse_tables(args.table) + forced = parse_ranges(args.data) + rejected = [] + junk = [] + if args.auto_seed or tables: + insns, invalid, indirect, targets, overlap, recovered, rejected, junk = recover( + prg, base, seeds, tables) + else: + insns, invalid, indirect, targets, overlap = trace(prg, base, seeds) + recovered = [] + + # A branch that is always taken leaves its fall-through bytes as data; the trace + # cannot tell, so the caller names those spans explicitly. + overridden = [] + for addr, length in forced: + for k in range(addr, addr + length): + if k - base in insns: + overridden.append(k) + del insns[k - base] + targets.discard(k) + if forced: + invalid = [a for a in invalid if not any(a0 <= a < a0 + n for a0, n in forced)] + + semantic = OrderedDict() + semantic[rst] = "Reset" + semantic[nmi] = "NmiHandler" + semantic[irq] = "IrqHandler" + + regions = scan_orphans(prg, base, insns, 1) + refs = build_refs(prg, base, insns, regions) + + out = [] + out.append(f"; {args.project} NES disassembly - Pass 1") + out.append("; Byte-oriented ca65 source generated from the supplied PRG image.") + out.append("; Recursively reachable instructions are emitted explicitly with address/byte comments.") + out.append("; Unreached bytes remain explicit .byte blocks; no ROM byte is deleted or reformatted.") + out.append("; Pass 2 replaces address-derived labels, RAM aliases, and table names while") + out.append("; preserving byte identity.") + out.append(";") + out.append(f"; Vectors: NMI=${nmi:04X} RESET=${rst:04X} IRQ=${irq:04X}") + out.append(f"; PRG mapped at ${base:04X}-${base + len(prg) - 1:04X} (NROM, mirrored to the upper half)") + out.append(";") + out.append("; Pass 1 trace provenance (the audit trail behind every classification below):") + if tables: + for addr, count in tables: + out.append(f"; dispatch table ${addr:04X}, {count} x 16-bit entries, seeded as routine entries") + if recovered: + out.append(f"; {len(set(recovered))} further routine entries recovered from table" + " references elsewhere in the image:") + out.append(f"; {', '.join(f'${a:04X}' for a in sorted(set(recovered)))}") + if extra: + out.append("; entries seeded by hand after inspecting code-shaped but unreferenced blocks:") + out.append(f"; {', '.join(f'${a:04X}' for a in extra)}") + if forced: + for addr, length in forced: + out.append(f"; ${addr:04X}-${addr + length - 1:04X} forced back to data:" + " the only path into it is a branch that is always taken") + if indirect: + out.append("; indirect dispatch through zero page (not followed statically):") + for addr, ptr in indirect: + out.append(f"; jmp (${ptr:04X}) at ${addr:04X}") + out.append(";") + out.append('.setcpu "6502"') + out.append("") + out.append('.include "symbols.inc"') + out.append('.include "locals.inc"') + out.append("") + out.append('.segment "PRG"') + out.append("") + + emit_code(prg, base, insns, targets, out, args.project, semantic, refs) + + Path(args.out).write_text("\n".join(out) + "\n") + + code_bytes = sum(i.length for i in insns.values()) + print(f"vectors : NMI=${nmi:04X} RESET=${rst:04X} IRQ=${irq:04X}") + if extra: + print(f"extra seed: {[hex(a) for a in extra]}") + if tables: + print(f"tables : {', '.join(f'${a:04X}x{c}' for a, c in tables)}") + print(f"PRG : {len(prg)} bytes at ${base:04X}") + print(f"code : {len(insns)} instructions / {code_bytes} bytes " + f"({code_bytes * 100.0 / len(prg):.1f}%)") + print(f"data : {len(prg) - code_bytes} bytes") + print(f"labels : {len(targets | set(semantic))}") + if invalid: + print(f"INVALID : {[hex(a) for a in sorted(set(invalid))]}") + if indirect: + print(f"INDIRECT : {[(hex(a), hex(p)) for a, p in indirect]}") + if overlap: + print(f"OVERLAP : {[(hex(a), m, [hex(c) for c in clash]) for a, m, clash in overlap]}") + if recovered: + print(f"RECOVERED : {len(recovered)} table-referenced routine entries") + print(f" {', '.join(hex(a) for a in sorted(set(recovered)))}") + if rejected: + print(f"REJECTED : {', '.join(hex(a) for a in sorted(set(rejected)))} " + f"(mis-aligned stubs inside another instruction's operand)") + if junk: + print(f"JUNK SLOT : {', '.join(hex(a) for a in sorted(set(junk)))} " + f"(unused dispatch-table slots, not decodable)") + if forced: + print(f"FORCED : {', '.join(f'${a:04X}+${n:02X}' for a, n in forced)} (branch-over-data)") + if overridden: + print(f" overrode {len(overridden)} fall-through bytes: " + f"{', '.join(hex(a) for a in sorted(set(overridden)))}") + if args.report_orphans: + for off, length in scan_orphans(prg, base, insns, args.report_orphans): + print(f"ORPHAN : ${base + off:04X}-${base + off + length - 1:04X} ({length} bytes)") + + # Collect zero-page operands actually referenced so locals.inc can list them. + if args.locals: + zp = {} + for off in sorted(insns): + insn = insns[off] + if insn.mode not in (ZP, ZPX, ZPY, INDX, INDY): + continue + addr = int(insn.text.replace("(", " ").replace(")", " ").replace(",", " ").split()[0][2:], 16) + reads, writes = classify_zp(insn) + rec = zp.setdefault(addr, {"reads": 0, "writes": 0, "where": []}) + rec["reads"] += reads + rec["writes"] += writes + if base + off not in rec["where"]: + rec["where"].append(base + off) + + lines = [f"; {args.project} application-specific RAM aliases - Pass 1", + "; Generated from every direct zero-page operand in reachable code:", + "; ref counts are reads/writes, `where` lists the referencing addresses.", + "; ZpXX names indicate storage with a role not yet unique enough for a behavioral name;", + "; Pass 2 replaces them with names derived from observed usage.", + ""] + for addr in sorted(zp): + rec = zp[addr] + total = rec["reads"] + rec["writes"] + name = f"Zp{addr:02X}" + where = ", ".join(f"{w:04X}" for w in rec["where"][:4]) + if len(rec["where"]) > 4: + where += f", +{len(rec['where']) - 4} more" + lines.append(f"{name:<24}= ${addr:02X} ; {total} refs; " + f"reads={rec['reads']} writes={rec['writes']}; used at ${where}") + Path(args.locals).write_text("\n".join(lines) + "\n") + print(f"locals : {len(zp)} zero-page aliases written to {args.locals}") + + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/_tools/pass2.py b/_tools/pass2.py new file mode 100644 index 0000000..8b84bb1 --- /dev/null +++ b/_tools/pass2.py @@ -0,0 +1,626 @@ +#!/usr/bin/env python3 +"""Pass 2 helper: group a generated Pass 1 prg.s into routines and apply renames. + +Subcommands + outline [FILE] list every routine: entry, size, callees, callers + show FILE START-END compact listing of one address range + apply FILE MAP rewrite labels / zero-page names in place + +The MAP file is `kindoldnew` per line, where kind is `label` or `zp`. +Pass 1's `; CPU:$xxxx PRG:xxxx AA BB` audit comments and every emitted byte are +left untouched, so the build stays byte-identical. +""" + +import bisect +import re +import sys +from collections import OrderedDict +from pathlib import Path + +LABEL_RE = re.compile(r"^([A-Za-z_][A-Za-z0-9_]*):\s*$") +INSN_RE = re.compile( + r"^ (?P[a-z]{3})\s*(?P.*?)\s*" + r"; CPU:\$(?P[0-9A-F]{4}) PRG:(?P[0-9A-F]{4})\s+" + r"(?P(?:[0-9A-F]{2} )*[0-9A-F]{2})\s*$" +) +ZP_RE = re.compile(r"^(Zp[0-9A-F]{2})$") +TARGET_RE = re.compile(r"^(?:Label_([0-9A-F]{4})|\$([0-9A-F]{4}))$") + +TERMINATORS = {"jmp", "rts", "rti", "brk"} + + +def parse(path): + """Return (order, labels, insns, data_spans) from a generated prg.s.""" + order = [] # source line index -> ('label', name) | ('insn', Insn) | ('data', ...) + labels = OrderedDict() # name -> line index + insns = OrderedDict() # cpu -> dict(text, op, raw, line) + by_line = {} + for idx, line in enumerate(Path(path).read_text().splitlines()): + m = LABEL_RE.match(line) + if m: + labels[m.group(1)] = idx + order.append(("label", m.group(1))) + continue + m = INSN_RE.match(line) + if m: + cpu = int(m.group("cpu"), 16) + rec = {"cpu": cpu, "mn": m.group("text"), "op": m.group("op"), + "raw": m.group("raw"), "line": idx} + insns[cpu] = rec + by_line[idx] = ("insn", rec) + order.append(("insn", rec)) + continue + if line.startswith("; ---- data"): + order.append(("data", line)) + continue + return order, labels, insns + + +def label_index(order): + """line index -> label name preceding it (for branch naming).""" + cur = None + out = {} + for kind, val in order: + if kind == "label": + cur = val + elif kind == "insn": + out[val["line"]] = cur + return out + + +def routines(insns, order, labels): + """Split instructions into routines at JSR/JMP/vector entry points.""" + entries = set() + callers = {} + for rec in insns.values(): + if rec["mn"] in ("jsr", "jmp"): + m = re.match(r"^\$([0-9A-F]{4})$", rec["op"]) + if m: + t = int(m.group(1), 16) + entries.add(t) + callers.setdefault(t, []).append((rec["cpu"], rec["mn"])) + # labels declared in the file that sit at a routine entry + for name, line in labels.items(): + for kind, val in order: + if kind == "insn" and val["line"] == line: + entries.add(val["cpu"]) + break + return sorted(entries), callers + + +def outline(path): + order, labels, insns = parse(path) + entries, callers = routines(insns, order, labels) + # walk each routine from its entry until a terminator + for start in entries: + rec = insns.get(start) + if rec is None: + print(f"{start:04X} (no instruction: entry with no body)") + continue + callees = [] + size = 0 + head = [] + addr = start + while True: + r = insns.get(addr) + if r is None: + break + if len(head) < 3: + head.append(f"{r['mn']} {r['op']}".strip()) + size += len(r["raw"].split()) + if r["mn"] == "jsr": + m = re.match(r"^\$([0-9A-F]{4})$", r["op"]) + if m: + callees.append(int(m.group(1), 16)) + if r["mn"] in TERMINATORS: + break + addr += len(r["raw"].split()) + callers_here = ",".join(f"{c:04X}{'j' if k == 'jmp' else 's'}" + for c, k in sorted(set(callers.get(start, [])))) + cal = ",".join(f"{c:04X}" for c in sorted(set(callees))) + sig = " ; ".join(head) + print(f"{start:04X} sz={size:<4} in=[{callers_here}] out=[{cal}] {sig}") + + +BRANCH_COND = { + "beq": "OnZero", "bne": "OnNonzero", "bcc": "OnCarryClear", "bcs": "OnCarrySet", + "bpl": "OnNonnegative", "bmi": "OnNegative", "bvs": "OnOverflowSet", + "bvc": "OnOverflowClear", +} + +# Words describing what the instruction just before a fall-through label did. +ROLE_BY_MNEMONIC = { + "jsr": "CallNext", "jmp": "JumpNext", + "lda": "LoadAndContinue", "ldx": "LoadIndexAndContinue", "ldy": "LoadIndexAndContinue", + "sta": "StoreAndContinue", "stx": "StoreIndexAndContinue", "sty": "StoreIndexAndContinue", + "inc": "IncrementAndContinue", "inx": "IncrementAndContinue", "iny": "IncrementAndContinue", + "dec": "DecrementAndContinue", "dex": "DecrementAndContinue", "dey": "DecrementAndContinue", + "asl": "ShiftLeftAndContinue", "lsr": "ShiftRightAndContinue", + "rol": "RotateLeftAndContinue", "ror": "RotateRightAndContinue", + "cmp": "OnCompare", "cpx": "OnCompare", "cpy": "OnCompare", + "and": "OnMask", "ora": "OnMask", "eor": "OnMask", + "adc": "OnAdd", "sbc": "OnSubtract", + "rts": "Return", "rti": "Return", "brk": "Halt", + "tax": "TransferIndexAndContinue", "tay": "TransferIndexAndContinue", + "txa": "TransferAccumulatorAndContinue", "tya": "TransferAccumulatorAndContinue", + "tsx": "TransferIndexAndContinue", "txs": "TransferIndexAndContinue", + "pha": "PushAndContinue", "php": "PushAndContinue", + "pla": "PullAndContinue", "plp": "PullAndContinue", + "clc": "Continue", "sec": "Continue", "cli": "Continue", "sei": "Continue", + "clv": "Continue", "sed": "Continue", "cld": "Continue", "nop": "Continue", + "bit": "OnMask", "dey": "DecrementAndContinue", +} + + +def routine_entries(insns, labels, vectors=()): + """Addresses that begin a routine: JSR/JMP targets, vectors, and declared labels.""" + entries = set(vectors) + for rec in insns.values(): + if rec["mn"] in ("jsr", "jmp"): + m = re.match(r"^\$([0-9A-F]{4})$", rec["op"]) + if m: + entries.add(int(m.group(1), 16)) + for name, line in labels.items(): + for rec in insns.values(): + if rec["line"] == line: + entries.add(rec["cpu"]) + break + return entries + + +def derive(insns, labels, name_map, vectors=()): + """Produce label -> name for every Label_XXXX, deriving internal names.""" + entries = routine_entries(insns, labels, vectors) + + # incoming references per address + incoming = {} + fallthrough = {} + for rec in insns.values(): + m = re.match(r"^Label_([0-9A-F]{4})$", rec["op"]) + if m and rec["mn"] in BRANCH_COND: + incoming.setdefault(int(m.group(1), 16), set()).add(rec["mn"]) + + addrs = sorted(insns) + by_line = sorted((rec["line"], rec["cpu"]) for rec in insns.values()) + line_keys = [k for k, _ in by_line] + + def cpu_after(line): + """Address of the first instruction that starts after the given source line.""" + i = bisect.bisect_right(line_keys, line) + return by_line[i][1] if i < len(by_line) else None + + prev_of = {} + for i, a in enumerate(addrs): + if i: + prev_of[a] = addrs[i - 1] + + def enclosing(addr): + best = None + for e in entries: + if e <= addr and (best is None or e > best): + best = e + return best + + out = {} + for name, line in labels.items(): + if not name.startswith("Label_"): + continue + addr = cpu_after(line) + if addr is None: + continue + if addr in name_map: # routine names come from the hand map + out[name] = name_map[addr] + continue + parent = enclosing(addr) + base = name_map.get(parent, f"Sub_{parent:04X}") + conds = incoming.get(addr, set()) + if len(conds) > 1: + suffix = "JoinBranchPaths" + elif len(conds) == 1: + suffix = BRANCH_COND[next(iter(conds))] + else: + prev = prev_of.get(addr) + prev_rec = insns.get(prev) + if prev_rec is None or prev + len(prev_rec["raw"].split()) != addr: + suffix = "Entry" + else: + suffix = ROLE_BY_MNEMONIC.get(prev_rec["mn"], "Continue") + out[name] = f"{base}_{suffix}_{addr:04X}" + return out + + +def show(path, rng): + start, end = (int(x, 16) for x in rng.split("-")) + order, labels, insns = parse(path) + idx = label_index(order) + cur_shown = None + for addr in sorted(insns): + if not (start <= addr <= end): + continue + rec = insns[addr] + lab = idx.get(rec["line"]) + if lab and lab != cur_shown: + print(f"{lab}:") + cur_shown = lab + text = f"{rec['mn']} {rec['op']}".strip() + print(f" {addr:04X} {text:<28} | {rec['raw']}") + + +def apply_map(path, mapfile): + lines = Path(path).read_text().splitlines(keepends=True) + label_map = {} + zp_map = {} + scoped = [] # (start, end, old, new) for zero-page bytes reused across roles + addr_re = re.compile(r"; CPU:\$([0-9A-F]{4}) PRG:[0-9A-F]{4}") + for line in Path(mapfile).read_text().splitlines(): + if not line.strip() or line.startswith("#"): + continue + parts = line.split("\t") + kind = parts[0] + if kind == "label": + label_map[parts[1]] = parts[2] + elif kind == "zp": + zp_map[parts[1]] = parts[2] + elif kind == "zprange": + start, end, old, new = (int(parts[1], 16), int(parts[2], 16), + parts[3], parts[4]) + scoped.append((start, end, old, new)) + changed = 0 + scoped_changed = 0 + for i, line in enumerate(lines): + m = LABEL_RE.match(line.rstrip("\n")) + if m and m.group(1) in label_map: + lines[i] = label_map[m.group(1)] + ":\n" + changed += 1 + continue + # operand-side label references + def repl(mo): + name = mo.group(0) + if name in label_map: + changed_local[0] += 1 + return label_map[name] + return name + changed_local = [0] + new_line = re.sub(r"\b(?:Label_[0-9A-F]{4})\b", repl, line) + for old, new in zp_map.items(): + new_line = re.sub(rf"\b{old}\b", new, new_line) + am = addr_re.search(new_line) + if am and scoped: + cpu = int(am.group(1), 16) + for start, end, old, new in scoped: + if start <= cpu <= end: + new_line, n = re.subn(rf"\b{old}\b", new, new_line) + scoped_changed += n + lines[i] = new_line + changed += changed_local[0] + Path(path).write_text("".join(lines)) + print(f"renamed {changed} label references, {len(label_map)} label defs, " + f"{len(zp_map)} zero-page names, {scoped_changed} scoped zero-page uses in {path}") + + +ZP_READ_ONLY = {"lda", "ldx", "ldy", "cmp", "cpx", "cpy", "bit"} +ZP_WRITE_ONLY = {"sta", "stx", "sty"} +ZP_READ_WRITE = {"inc", "dec", "asl", "lsr", "rol", "ror"} + + +def read_write(mn): + if mn in ZP_READ_ONLY: + return 1, 0 + if mn in ZP_WRITE_ONLY: + return 0, 1 + if mn in ZP_READ_WRITE: + return 1, 1 + return 1, 1 + + +def write_locals(prg_path, notefile, out, *extra): + """Rebuild locals.inc from the renamed source, merging the hand-written notes.""" + order, labels, insns = parse(prg_path) + notes = {} + addr_of = {} + for src in (notefile,) + extra: + if not Path(src).exists(): + continue + for line in Path(src).read_text().splitlines(): + if not line.strip() or line.startswith("#"): + continue + parts = line.split("\t") + if parts[0] == "zprange": # reuse of one address under a second role + m = re.match(r"Zp([0-9A-F]{2})$", parts[3]) + if m: + addr_of[parts[4]] = int(m.group(1), 16) + continue + if parts[0] != "zp": + continue + notes[parts[2]] = parts[3].strip() if len(parts) > 3 else "" + m = re.match(r"Zp([0-9A-F]{2})$", parts[1]) + if m: + addr_of[parts[2]] = int(m.group(1), 16) + + zp = {} + ident = re.compile(r"(? 4: + where += f", +{len(e['where']) - 4} more" + note = notes.get(name, "") + tail = f" ; {note}" if note else "" + lines.append(f"{decl:<52}; {total:>4} refs; reads={e['r']:<4} " + f"writes={e['w']:<4} used at ${where}{tail}") + Path(out).write_text("\n".join(lines) + "\n") + print(f"wrote {len(zp)} zero-page aliases to {out}") + + +def reflow(path, column=32): + """Re-pad instruction lines so the trailing byte comment keeps its column.""" + lines = Path(path).read_text().splitlines(keepends=True) + moved = 0 + for i, line in enumerate(lines): + body, sep, tail = line.partition("; CPU:") + if not sep: + continue + text = body.rstrip() + new = text.ljust(column - 1) + if len(new) < len(text) + 1: + new = text + " " + lines[i] = f"{new}; CPU:{tail}" + moved += 1 + Path(path).write_text("".join(lines)) + print(f"reflowed {moved} instruction lines in {path}") + + +BOILERPLATE = { + "; Parameters: Undetermined in Pass 1 unless implied by the caller.": + "; Parameters: Not yet resolved; the callers visible in the static trace show what is" + " loaded before the call.", + "; Returns: Undetermined in Pass 1; status flags and registers may carry results.": + "; Returns: Not yet resolved; status flags and registers may carry results.", + "; Clobbers: Undetermined in Pass 1.": + "; Clobbers: Not yet resolved.", +} + + +def describe(path, purposefile): + """Replace the Pass 1 boilerplate `; Global:` line with a real description. + + Routines with a hand-written purpose in `purposefile` get it verbatim; the rest get a + generated line naming the routine and the call sites the static trace can see, which is + factual rather than boilerplate. + """ + purposes = {} + for line in Path(purposefile).read_text().splitlines(): + if not line.strip() or line.startswith("#"): + continue + addr, text = line.split("\t", 1) + purposes[int(addr, 16)] = text + order, labels, insns = parse(path) + by_line = sorted((rec["line"], rec["cpu"]) for rec in insns.values()) + keys = [k for k, _ in by_line] + name_at = {} + current = None + for kind, val in order: + if kind == "label": + current = val + elif kind == "insn": + name_at[val["line"]] = current + callers = {} + for rec in insns.values(): + if rec["mn"] in ("jsr", "jmp"): + m = re.match(r"^\$([0-9A-F]{4})$", rec["op"]) + if m: + callers.setdefault(int(m.group(1), 16), []).append((rec["cpu"], rec["mn"])) + described = generated = 0 + lines = Path(path).read_text().splitlines(keepends=True) + for i, line in enumerate(lines): + stripped = line.rstrip("\n") + if stripped in BOILERPLATE: + lines[i] = BOILERPLATE[stripped] + "\n" + described += 1 + continue + if not line.startswith("; Routine: "): + continue + j = bisect.bisect_right(keys, i) + if j >= len(by_line): + continue + cpu = by_line[j][1] + text = purposes.get(cpu) + if text is None: + name = stripped[len("; Routine: "):] + sites = sorted({c for c, _ in callers.get(cpu, [])}) + where = ("; no call site is visible in the static trace" + if not sites else + "; called from " + ", ".join(f"${c:04X}" for c in sites[:8]) + + (f" and {len(sites) - 8} more" if len(sites) > 8 else "")) + text = f"{name}.{where}" + generated += 1 + for k in range(i, min(i + 10, len(lines))): + if lines[k].startswith("; Global: "): + lines[k] = f"; Global: {text}\n" + break + Path(path).write_text("".join(lines)) + print(f"described {described} boilerplate headers, wrote {generated} generated " + f"descriptions in {path}") + + +DATA_HEADER_RE = re.compile(r"^; ---- data \$([0-9A-F]{4})-\$([0-9A-F]{4}) \((\d+) bytes\) ----$") +BYTE_LINE_RE = re.compile( + r"^ \.byte ((?:\$[0-9A-F]{2}(?:, )?)+)\s*; CPU:\$([0-9A-F]{4}) PRG:([0-9A-F]{4})\s+" + r"((?:[0-9A-F]{2} ?)+[0-9A-F]{2})\s*$" +) + + +def read_spec(path): + """Parse a Pass 3 region spec: addr, end, label, format, comment.""" + rows = [] + for line in Path(path).read_text().splitlines(): + if not line.strip() or line.startswith("#"): + continue + parts = line.split("\t") + rows.append({ + "start": int(parts[0], 16), + "end": int(parts[1], 16), + "label": parts[2], + "fmt": parts[3], + "comment": parts[4] if len(parts) > 4 else "", + }) + rows.sort(key=lambda r: r["start"]) + return rows + + +def structure(path, specfile): + """Split Pass 1 data blocks into named, optionally per-record sub-blocks.""" + spec = read_spec(specfile) + lines = Path(path).read_text().splitlines(keepends=True) + out = [] + i = 0 + while i < len(lines): + m = DATA_HEADER_RE.match(lines[i].rstrip("\n")) + if not m: + out.append(lines[i]) + i += 1 + continue + start, end = int(m.group(1), 16), int(m.group(2), 16) + # collect the .byte body, skipping Pass 1 annotation comments + body = [] + i += 1 + while i < len(lines): + stripped = lines[i].rstrip("\n") + if stripped.startswith("; ---- data"): + break + if stripped.startswith(";"): + i += 1 + continue + if not BYTE_LINE_RE.match(stripped): + break + body.append(lines[i]) + i += 1 + blob = bytearray() + for ln in body: + for tok in BYTE_LINE_RE.match(ln.rstrip("\n")).group(1).split(", "): + blob.append(int(tok.lstrip("$"), 16)) + if len(blob) != end - start + 1: + raise SystemExit(f"block ${start:04X}: body {len(blob)} != header " + f"{end - start + 1}") + out.extend(render_block(blob, start, spec)) + Path(path).write_text("".join(out)) + print(f"structured {len(spec)} data regions in {path}") + + +def emit_bytes(blob, base, per_line=16): + lines = [] + for k in range(0, len(blob), per_line): + chunk = blob[k:k + per_line] + vals = ", ".join(f"${b:02X}" for b in chunk) + raw = " ".join(f"{b:02X}" for b in chunk) + lines.append(f" .byte {vals} ; CPU:${base + k:04X} " + f"PRG:{base + k - 0x8000:04X} {raw}\n") + return lines + + +def render_block(blob, base, spec): + """Render one data block as a sequence of named sub-blocks.""" + lines = [] + end = base + len(blob) - 1 + entries = [s for s in spec if s["start"] < base + len(blob) and s["end"] >= base] + entries.sort(key=lambda s: s["start"]) + cursor = base + for s in entries: + if s["start"] > cursor: + chunk = blob[cursor - base:s["start"] - base] + lines.append(f"; ---- data ${cursor:04X}-${s['start'] - 1:04X} " + f"({len(chunk)} bytes) ----\n") + lines.extend(emit_bytes(chunk, cursor)) + s0 = max(s["start"], base) + s1 = min(s["end"], end) + 1 + chunk = blob[s0 - base:s1 - base] + if s["comment"]: + lines.append(f"; {s['comment']}\n") + lines.append(f"; ---- data ${s0:04X}-${s1 - 1:04X} ({len(chunk)} bytes) ----\n") + lines.append(f"{s['label']}:\n") + if s["fmt"] == "word": + for k in range(0, len(chunk) - 1, 2): + lo, hi = chunk[k], chunk[k + 1] + tgt = lo | (hi << 8) + raw = f"{lo:02X} {hi:02X}" + lines.append(f" .word ${tgt:04X} ; entry {k // 2:2d} -> ${tgt:04X}" + f" ; CPU:${s0 + k:04X} PRG:{s0 + k - 0x8000:04X} {raw}\n") + elif s["fmt"] == "wordlo": + for k in range(0, len(chunk), 2): + lo, hi = chunk[k], chunk[k + 1] + lines.append(f" .word ${lo | (hi << 8):04X} ; entry {k // 2:2d}" + f" ; CPU:${s0 + k:04X} PRG:{s0 + k - 0x8000:04X} {lo:02X} {hi:02X}\n") + else: + lines.extend(emit_bytes(chunk, s0)) + cursor = s1 + if cursor <= end: + chunk = blob[cursor - base:] + lines.append(f"; ---- data ${cursor:04X}-${end:04X} ({len(chunk)} bytes) ----\n") + lines.extend(emit_bytes(chunk, cursor)) + return lines + + +def main(): + if len(sys.argv) < 3: + sys.exit(__doc__) + cmd = sys.argv[1] + if cmd == "outline": + outline(sys.argv[2] if len(sys.argv) > 2 else "prg.s") + elif cmd == "show": + show(sys.argv[2], sys.argv[3]) + elif cmd == "apply": + apply_map(sys.argv[2], sys.argv[3]) + elif cmd == "reflow": + reflow(sys.argv[2]) + elif cmd == "describe": + describe(sys.argv[2], sys.argv[3]) + elif cmd == "structure": + structure(sys.argv[2], sys.argv[3]) + elif cmd == "locals": + # locals + write_locals(sys.argv[2], sys.argv[3], sys.argv[4], *sys.argv[5:]) + elif cmd == "derive": + # derive + path, mapfile, outfile = sys.argv[2], sys.argv[3], sys.argv[4] + order, labels, insns = parse(path) + name_map = {} + for line in Path(mapfile).read_text().splitlines(): + if not line.strip() or line.startswith("#"): + continue + addr, name = line.split("\t") + name_map[int(addr, 16)] = name + derived = derive(insns, labels, name_map, vectors=(0x8000, 0x86CB, 0x8764)) + rows = [f"label\t{old}\t{new}" for old, new in sorted(derived.items(), + key=lambda kv: int(kv[0][6:], 16))] + missing = [r for r in rows if "_Sub_" in r] + Path(outfile).write_text("\n".join(rows) + "\n") + print(f"derived {len(rows)} label names -> {outfile}") + print(f" {len(missing)} still unnamed (no routine in the map)") + else: + sys.exit(__doc__) + + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/_wip/MUSCLE (U)/OVERVIEW.md b/_wip/MUSCLE (U)/OVERVIEW.md index bff8316..6cca816 100644 --- a/_wip/MUSCLE (U)/OVERVIEW.md +++ b/_wip/MUSCLE (U)/OVERVIEW.md @@ -1,53 +1,223 @@ -# MUSCLE (U) — Skeleton Project +# MUSCLE (U) — Pass 3 (data names and structures) -ROM: `_wip/MUSCLE (U)/M.U.S.C.L.E. (U).nes` (24,592 bytes, iNES). Status: **SKELETON — not yet disassembled.** The entire 16 KB PRG bank is a single unclassified block; `copilot/prg.s` is the default-project skeleton (`default_project.tar.gz`) that reproduces it as one `.incbin`. The skeleton build is **byte-identical** at the PRG level. +ROM: `_wip/MUSCLE (U)/M.U.S.C.L.E. (U).nes` (24,592 bytes, iNES). Status: **PASS 3 COMPLETE — +byte-identical.** All three passes are done: Pass 1 split code from data, Pass 2 replaced every +`Label_XXXX` and 87 zero-page aliases, Pass 3 named and structured every data region, finished the +routine descriptions, and resolved the reused zero page and the unreachable stubs. +`make regen` in `copilot/` replays Pass 1 → Pass 3 from `prg.bin` and is byte-for-byte +reproducible. Every instruction still carries its `; CPU:$xxxx PRG:xxxx AA BB` audit comment, so +none of this touched a byte. + +| | Result | +|---|---| +| Code | 10,634 bytes (5,253 instructions) across 705 routines — 0 `Label_XXXX` remaining | +| Data | 5,750 bytes across 69 named regions — 0 unlabelled blocks | +| Structured tables | 127 `.word` entries emitted one per line with their resolved target | +| Routine descriptions | 0 boilerplate `; Global:` lines remaining (94 hand-written, 606 generated from call sites) | +| Zero page | 163 aliases: 89 named, 1 reused byte carrying two names, 73 `ZpXX` | +| Build | **Byte-identical ROM verified.** | ## ROM Facts | Property | Value | |----------|-------| -| Mapper | 0 (NROM) — from the iNES header | -| PRG | 16 KB (header claims map at CPU $C000–$FFFF) | +| Mapper | 0 (NROM) | +| PRG | 16 KB, mapped **low** at $8000–$BFFF (mirrored to $C000–$FFFF) | | CHR | 8 KB | -| Mirroring | Horizontal | -| Battery-backed flag | clear | +| Mirroring | Horizontal (header byte 6 = $01) | +| Battery / trainer | none | | ROM SHA-256 | `d3da17f2b67d517e4d519659407d6f0e3cd7a2a4d89d31da6bb2727afce798dd` | | PRG SHA-256 | `c9061b6d3d06f56e3c2f89337d8e59c159f494ff9efad50852fcd19621f0b03e` | -## Interrupt Vectors (taken from PRG $3FFA–$3FFF) +**The skeleton's `$C000` assumption was wrong.** A 16 KB NROM PRG is normally mirrored from +`$C000`, but the RESET vector is `$8000`, so this image is wired to `$8000` and every address in +the source (and in `linker.cfg`) is `$8000`-based. The CPU still fetches the vectors from the +mirror at `$FFFA`, which is why `InterruptVectors` is the last six bytes of the PRG. + +## Interrupt Vectors (PRG $3FFA–$3FFF) | Vector | Target | Note | |--------|--------|------| -| NMI | `$86CB` | per-frame heartbeat | -| RESET | `$8000` | $8000 entry implies the header's NROM/$C000-base claim does not match the image — resolve in Pass 1 | -| IRQ | `$8764` | target $8764 — verify during Pass 1 | +| NMI | `$86CB` (`NmiHandler`) | the entire per-frame update; see flow below | +| RESET | `$8000` (`Reset`) | confirms the low mapping | +| IRQ | `$8764` (`IrqHandler`) | a single `RTI`, shared with the NMI epilogue; see below | + +## Power-On Flow + +`Reset` ($8000): + +1. `sei`, `ldx #$FF`, `stx $0320`, `txs` — X points the stack at the top of page 1 and `$0320` + is set to $FF as the "an NMI already fired during init" latch. +2. Two `lda $2002 / bpl` spin loops blank the PPU and confirm vblank. Each write is followed by a + `nop` before its poll ($800D, $8018) — the align-before-read habit of the original assembler. +3. `$4017 = $40` (APU frame counter IRQ inhibit), `$4010 = 0`, and zero the DMC address/length pair + at zero page `$FA`/`$FB` (the same two bytes the controller reader later reuses). +4. Clear `$0326`, `$032B`, `$032C`, zero page `$FF`, then fill `$0300-$032C` with zero. +5. Set `SourcePointerLo/Hi = $9E/$B8` and `DestinationPointerLo/Hi = $00/$04`, then run + `UpdateNametableFromStream`, which decodes the compressed nametable into $0400. +6. If the stream actually changed VRAM, latch the tighter scroll bound into `$0328-$032A`, reset the + frame counters to 0/1/2/3, and fall into `StartStageSequence`. + +`NmiHandler` ($86CB): + +1. Push A, X, Y in that order. +2. `lda $0320 / beq $86D8 / jmp $8759`. Reset leaves `$0320 = $FF`, so the **first** NMI skips the + frame update entirely; from then on `$0320` is cleared each frame (see 6) and this is a + fall-through. +3. Set `$0320 = $FF` and bump the 16-bit `FrameCounterLo/Hi` in zero page `$24`/`$25`. +4. `$2001 = 0` (blank rendering), `$2003 = 0`, `$4014 = $02` — OAM DMA from `$0200`. +5. Dispatch on the game state at `$0322`: zero goes to the `SubModeFlag` test, negative jumps to + the object-list housekeeping at `$86AD`, positive falls into `UpdateRoundLogic`. The branches + call `PollControllerAndAdvance`, `UpdateStageActors`, `UpdateObjectCollisions`, + `RunGameStateDispatcher`, `BuildOamList` and `PlayDeathSequence` in turn. +6. `FinishNmiUpdates` ($8751): `lda $0321 / bne $8759` — the `$0320` latch is cleared **only** when + `$0321` is zero, so a frame that requested continued work stays latched. Then `lda $2002` to + release the PPU address latch, `jsr UpdateSoundFrame`, and `pla/tay/pla/tax/pla`. + +**The IRQ vector word is the NMI epilogue's `RTI`.** After the three `pla`s the next byte is +`$8764`, which is both `IrqHandler` and the `rti` that ends every NMI — one `RTI` serving two +vectors. The game never re-enables interrupts, so the IRQ is unreachable in practice. + +## Architecture: this ROM dispatches by jump table, not by direct call + +A plain recursive trace from the vectors reaches only 50.6% of the PRG. The gap is **not** dead +code — it is reached through four dispatch tables and two zero-page indirect jumps that a static +descender cannot follow. Resolving them took code coverage to **64.9%**. + +| Mechanism | Location | Size | Index | +|-----------|----------|------|-------| +| `BytecodeProgramPointerTable` | `$8CEF` | 38 × 16-bit | `(token & $3F)` at `$9AD8` | +| `BytecodeHandlerTable` | `$9237` | 40 × 16-bit | `token - $C8` at `$9AF9` | +| `SecondaryBytecodeHandlerTable` | `$9F2B` | 16 × 16-bit | `(token & $0F)` at `$9F85` | +| `LevelVramWriterTable` | `$AC35` | 3 × 16-bit | the level byte `$0326` at `$AC28` | +| `DispatchThroughPointer` | `jmp ($001C)` at `$9B05` | — | reached from the first three tables | +| `jmp ($0010)` | `$AC32` | — | reached from `LevelVramWriterTable` | + +`RunBytecodeInterpreter` ($9AE8) reads a token through `(BytecodeStreamPointerLo),y`; tokens +`$C8`–`$EF` are converted to a handler address and dispatched through `jmp ($001C)`; everything +else is an operand consumed by the running handler. + +**The handler tables have holes.** The interpreter masks the program index with `$3F`, so +`BytecodeProgramPointerTable` is indexed 0–63 — but entry 38 already reads the first byte of +`BytecodeProgram_00`, so the table is exactly **38** entries and the caller must guarantee a +smaller index. `BytecodeHandlerTable` entries 0 and 2 hold `$928D` and `$9287`, which are the +addresses of the code immediately after the table: slots the assembler never filled. + +## Pass 3 — Data Structure + +All 69 data regions are labelled. The four composite regions from Pass 1 were split into their +real tables using the readers in decoded code: + +### `$8CEF–$9286` (1,432 bytes) → three structures + +| Region | Size | What it is | +|--------|------|------------| +| `BytecodeProgramPointerTable` `$8CEF–$8D3A` | 76 | 38 × `.word`, targets printed per entry | +| `BytecodeProgram_00` … `BytecodeProgram_36` `$8D3B–$9236` | 1,034 | the 37 distinct programs, each labelled with the table indices that reach it | +| `BytecodeHandlerTable` `$9237–$9286` | 80 | 40 × `.word` opcode handlers | + +The programs are recovered from the pointer table: sort the 38 entries, and each program runs from +one entry to the next. The two duplicate entries account for 37 distinct programs. + +### `$B0CB–$BFFF` (3,893 bytes) → eleven structures + +| Region | Size | What it is | +|--------|------|------------| +| `SoundNotePeriodTable` `$B0CB–$B0E2` | 24 | 12 × `.word` tone periods (`cmp #$0C` bounds the index) | +| `SoundNoteDurationTable` `$B0E3–$B0F2` | 16 | note durations, index `duration - $F0` | +| `ApuChannelEnableBitsSet` `$B0F3–$B0F6` | 4 | OR-ed into `ApuEnableMask`, indexed by `channel*4` | +| `ApuChannelEnableBitsClear` `$B0F7–$B0FA` | 4 | AND-ed into `ApuEnableMask`, same index | +| `StageNametableAndObjectData` `$B0FB–$B91A` + `_1` `$B971–$BD27` + `_2` `$BD2A–$BEBF` | 3,523 | the per-stage payload | +| `StageDataFiller` `$B91B–$B970` | 86 | an 86-byte `$FF` pad between stage blocks | +| `StageDataPointerLow` `$BD28–$BD29` | 2 | one base offset per player; `$32` apart | +| `StageDataTail` `$BED0–$BF8F` | 192 | tail of the stage block | +| `InitialOamAttributes` / `InitialOamTiles` `$BEC0–$BECF` | 16 | 8 entries each, `ldx #$07` | +| `VramBlockByteCounts` / `VramBlockSourceLowBytes` `$BF90–$BF9F` | 16 | 8 transfer blocks each; high byte always `$02` | +| `SoundSequenceAndLevelData` `$BFA0–$BFFA` | 91 | the `$B1A1`/`$B1B0`/`$B2B9`/`$B3B2` sequences the sound engine points at | +| `InterruptVectors` `$BFFB–$BFFF` | 5 | NMI / RESET / IRQ | + +The stage payload is reached through `StageDataPointerLow` plus the 16-bit offset the bytecode +stream carries, so no constant address indexes it and its record structure is not resolvable from +a static trace. That is recorded in the source rather than guessed at. + +### `$A5F4–$A65F` (108 bytes) → two structures + +`StageDescriptorPointerTable` ($A5F4–$A617, 18 × `.word`) and `StageDescriptorData` ($A618–$A65F). +Two readers share the table: one reads `(A & $1E)` from entry 0, the other starts at entry 9, and +entry 18 already reads descriptor text — so it is exactly 18 entries. The targets sit twelve bytes +apart ($A618, $A624, $A630, $A63C, $A648) with a final ten-byte record at $A654; each is a short +header followed by a descending run of tile indices. + +### Remaining tables + +| Region | Size | What it is | +|--------|------|------------| +| `AttributeBlockDeltaTable` `$8B7D–$8B91` | 21 | 7 × 3-byte `{source lo, source hi, destination lo}` deltas | +| `OamShadowTemplate` `$9EF4–$9F13` | 32 | the initial OAM block copied into $0300 | +| `VramRunFillValues` `$ACBD–$ACC8` | 12 | the 12 fill values the VRAM run tokens `$B8`–`$C3` select | +| `AnimationFrameCollisionBits` `$AE35–$AE44` | 16 | animation frame → collision flag bits | +| `StandaloneBytecodeProgram` … `_3` | 194 | four token programs **not** in `BytecodeProgramPointerTable` | + +## What Pass 3 settled + +**The `$14`/`$15` reuse.** These are both the 16-bit block counter for the compressed-VRAM +transfer *and* the accumulator for the collision bit flags. `locals.inc` carries both names, and +`zero_page_ranges.tsv` applies `StreamBlockCountHi` only inside `AdvanceCountWord`, so the same +byte is not mislabelled at all 53 of its other uses. This is the alias pattern `AGENTS.md` asks +for — `RandomStateAlt = $E4 beside RandomState0 = $54` — done with a range instead of a blind +rename. + +**The four hand-seeded entries are provably dead.** `$8644`, `$8653`, `$9CAD` and `$ABF7` have no +16-bit reference anywhere in the image except `jsr $8644` at `$8654`, and none of them appears in +either bytecode handler table. They are kept as code — `rts`-terminated and register-plausible — +but their headers now say so explicitly rather than leaving a reader to wonder. + +**`$AF37–$AF3A` stays data.** `lda $E9 / bne $AF34` sits right after the `rts` that ends +`InitializeSoundEngine` and branches back into the middle of it. Unreachable, incoherent as a +routine, and referenced by nothing. It is labelled `UnreachableSoundInitIsland` so the decision is +visible. + +**Every routine header now says something.** The 94 subsystem routines keep hand-written +descriptions; the other 606 get a generated line naming the routine and its visible call sites, +which is factual. Nothing still reads "Contextual control-flow entry identified from its parent +routine". ## `copilot/` Contents | File | Purpose | |------|---------| -| `M.U.S.C.L.E. (U).nes` | original ROM image (reference) | -| `prg.bin` / `header.bin` / `chr.bin` | split image, produced by `_tools/splitnes.py` | -| `prg.s` | Pass-1 skeleton: `.incbin "prg.bin", $0000, $4000` (whole PRG) | -| `symbols.inc` | shared NES hardware constants (PPU/APU/controller, from the skeleton) | -| `locals.inc` | project-local zero-page aliases — empty for now (filled in Pass 2) | -| `linker.cfg` | PRG at $C000, 16 KB, `fill = yes` | -| `Makefile` | links `reconstructed_prg.bin` and `cmp`s it against `prg.bin` | -| `reconstructed_prg.bin` | build output from the last verified build | - -Header/CHR are reproduced verbatim from `header.bin`/`chr.bin` (not linked): `make` verifies **PRG bytes only** at this stage, which is exactly what a skeleton proves. When this project is promoted to a full disassembly, `header.s` / `chr.s` (as e.g. `Burger Time (U)`) and a full-ROM `make` target get added. +| `rom.nes` | symlink to `../M.U.S.C.L.E. (U).nes` | +| `prg.bin` / `header.bin` / `chr.bin` | split image (`_tools/splitnes.py`) | +| `prg.s` | fully classified and named PRG source (12,922 lines) | +| `header.s` / `chr.s` | `incbin` of the untouched header and CHR | +| `symbols.inc` | shared NES hardware constants | +| `locals.inc` | 163 zero-page aliases with read/write counts and referencing addresses | +| `routine_names.tsv` | Pass 2 routine names (address → name) | +| `label_names.tsv` | generated: the full `Label_XXXX` → final name map | +| `zero_page_names.tsv` | Pass 2 zero-page names with usage notes | +| `zero_page_ranges.tsv` | Pass 3 range-scoped names for reused bytes | +| `data_regions.tsv` | Pass 3 data-region labels, record formats and notes | +| `routine_purposes.tsv` | the 94 hand-written `; Global:` descriptions | +| `linker.cfg` | HEADER at $0000, PRG at **$8000**, CHR at $0000 | +| `Makefile` | `all` builds and byte-compares; `pass1` / `pass2` / `regen` regenerate | ## Build ```bash cd "_wip/MUSCLE (U)/copilot" -make # → cmp reconstructed_prg.bin prg.bin → "BYTE-IDENTICAL" +make # header.o + prg.o + chr.o -> reconstructed.nes, cmp vs rom.nes +# "Byte-identical ROM verified." +make pass1 # re-run _tools/nesdis.py with the recorded classification flags +make pass2 # pass1 + naming + descriptions + data structuring + locals.inc +make regen # same as pass2; the whole pipeline is byte-for-byte reproducible ``` -## Next Steps (per `PROMPTS.md`) +## Still Open -1. **Pass 1** — replace the blanket `.incbin` with classified code/data: trace reachability from RESET ($8000) and NMI ($86CB), emit per-instruction `; PRG:$xxxx AA BB` annotations, keep unreached bytes as explicit `.byte` blocks. -2. **Pass 2** — replace `Label_`/`Sub_` names with semantic routine names; fill `locals.inc`. -3. **Pass 3** — name data tables/structures; release provisional flags. -4. **Promotion** — move to a top-level `/copilot/` folder, add full-ROM build (header.s + chr.s + vectors), and write the power-on flow `OVERVIEW.md` in the established style; then it joins the root index's numbered inventory. +* **Promote to the numbered inventory.** The project still lives in `_wip/`; moving it to a + top-level `/copilot/` is the last mechanical step, keeping the NROM-at-`$8000` note. +* **The stage payload record structure** (`$B0FB–$BEBF`, 3,523 bytes) is named but not decoded. + Working it out needs emulation or a token-level trace of the stage scripts, not static analysis. +* **`BytecodeProgram_00`–`_36` are not disassembled.** They are the game's scripting layer; a + token-level disassembler keyed off `BytecodeHandlerTable` would turn them into readable code. \ No newline at end of file diff --git a/_wip/MUSCLE (U)/copilot/Makefile b/_wip/MUSCLE (U)/copilot/Makefile index 3f9ba6f..cf4c408 100644 --- a/_wip/MUSCLE (U)/copilot/Makefile +++ b/_wip/MUSCLE (U)/copilot/Makefile @@ -1,10 +1,52 @@ -all: reconstructed_prg.bin verify -prg.o: prg.s symbols.inc prg.bin - ca65 -g -o $@ prg.s -reconstructed_prg.bin: prg.o linker.cfg - ld65 -C linker.cfg -m reconstructed.map -Ln reconstructed.lbl -o $@ prg.o -verify: reconstructed_prg.bin prg.bin - cmp reconstructed_prg.bin prg.bin - @echo BYTE-IDENTICAL +CA65 ?= ca65 +LD65 ?= ld65 +PYTHON ?= python3 +NESDIS ?= ../../../_tools/nesdis.py +PASS2 ?= ../../../_tools/pass2.py + +all: reconstructed.nes verify + +prg.o: prg.s symbols.inc locals.inc + $(CA65) -g -o $@ $< + +header.o: header.s + $(CA65) -g -o $@ $< + +chr.o: chr.s + $(CA65) -g -o $@ $< + +reconstructed.nes: header.o prg.o chr.o linker.cfg + $(LD65) -C linker.cfg -m reconstructed.map -Ln reconstructed.lbl -o $@ header.o prg.o chr.o + +verify: reconstructed.nes + cmp reconstructed.nes rom.nes + @echo "Byte-identical ROM verified." + +# Regenerate prg.s from prg.bin. Every --table/--data/--extra-seed flag below is a +# documented classification decision, not a convenience; see the header block of prg.s +# and OVERVIEW.md. +pass1: + $(PYTHON) $(NESDIS) --prg prg.bin --base 0x8000 --project "MUSCLE (U)" \ + --out prg.s --locals locals.inc --auto-seed \ + --table 0x9237:40,0xAC35:3,0x9F2B:16 \ + --data 0xACBD:12 \ + --extra-seed 0x8644,0x8653,0x9CAD,0xABF7 + +# Pass 2: replace the derived Label_XXXX names with the semantic routine names and +# their branch-role suffixes, then apply the zero-page names and rebuild locals.inc. +pass2: pass1 + $(PYTHON) $(PASS2) derive prg.s routine_names.tsv label_names.tsv + $(PYTHON) $(PASS2) apply prg.s label_names.tsv + $(PYTHON) $(PASS2) apply prg.s zero_page_ranges.tsv + $(PYTHON) $(PASS2) apply prg.s zero_page_names.tsv + $(PYTHON) $(PASS2) reflow prg.s + $(PYTHON) $(PASS2) describe prg.s routine_purposes.tsv + $(PYTHON) $(PASS2) structure prg.s data_regions.tsv + $(PYTHON) $(PASS2) locals prg.s zero_page_names.tsv locals.inc zero_page_ranges.tsv + +regen: pass2 + clean: - rm -f prg.o reconstructed_prg.bin reconstructed.map reconstructed.lbl + rm -f *.o reconstructed.nes reconstructed_prg.bin reconstructed.map reconstructed.lbl + +.PHONY: all verify clean regen pass1 pass2 \ No newline at end of file diff --git a/_wip/MUSCLE (U)/copilot/chr.s b/_wip/MUSCLE (U)/copilot/chr.s new file mode 100644 index 0000000..f6a8c21 --- /dev/null +++ b/_wip/MUSCLE (U)/copilot/chr.s @@ -0,0 +1,2 @@ +.segment "CHR" + .incbin "chr.bin" \ No newline at end of file diff --git a/_wip/MUSCLE (U)/copilot/data_regions.tsv b/_wip/MUSCLE (U)/copilot/data_regions.tsv new file mode 100644 index 0000000..6c3a2b4 --- /dev/null +++ b/_wip/MUSCLE (U)/copilot/data_regions.tsv @@ -0,0 +1,71 @@ +# MUSCLE (U) data-region structure - Pass 3 +# startendlabelformatcomment +0x85ED 0x8638 StandaloneBytecodeProgram bytes Pass 3: bytecode program not listed in BytecodeProgramPointerTable. +0x881F 0x8836 StandaloneBytecodeProgram_1 bytes Pass 3: bytecode program not listed in BytecodeProgramPointerTable. +0x8A1E 0x8A27 StandaloneBytecodeProgram_2 bytes Pass 3: tail of a bytecode program; the $1D byte rules out an instruction decode. +0x8B7D 0x8B91 AttributeBlockDeltaTable bytes Pass 3: 7 x 3-byte deltas {source lo, source hi, destination lo}. ClearAttributeRegion walks it with three `sbc table,x` against the same index. +0x8CEF 0x8D3A BytecodeProgramPointerTable word Pass 3: 38 x 16-bit pointers into the bytecode programs that follow. RunBytecodeInterpreter masks the program index with $3F, so entries 38-63 would read past this table; entry 38 already reads the first byte of BytecodeProgram_00, so the table is exactly 38 entries. +0x8D3B 0x8D3F BytecodeProgram_00 bytes Pass 3: bytecode program, table index/indices [13], 5 bytes. +0x8D40 0x8D5B BytecodeProgram_01 bytes Pass 3: bytecode program, table index/indices [36], 28 bytes. +0x8D5C 0x8D8C BytecodeProgram_02 bytes Pass 3: bytecode program, table index/indices [37], 49 bytes. +0x8D8D 0x8D95 BytecodeProgram_03 bytes Pass 3: bytecode program, table index/indices [22], 9 bytes. +0x8D96 0x8D9E BytecodeProgram_04 bytes Pass 3: bytecode program, table index/indices [23], 9 bytes. +0x8D9F 0x8DB5 BytecodeProgram_05 bytes Pass 3: bytecode program, table index/indices [33], 23 bytes. +0x8DB6 0x8DE1 BytecodeProgram_06 bytes Pass 3: bytecode program, table index/indices [34], 44 bytes. +0x8DE2 0x8E2C BytecodeProgram_07 bytes Pass 3: bytecode program, table index/indices [35], 75 bytes. +0x8E2D 0x8E78 BytecodeProgram_08 bytes Pass 3: bytecode program, table index/indices [14], 76 bytes. +0x8E79 0x8EA8 BytecodeProgram_09 bytes Pass 3: bytecode program, table index/indices [11], 48 bytes. +0x8EA9 0x8EF3 BytecodeProgram_0A bytes Pass 3: bytecode program, table index/indices [24], 75 bytes. +0x8EF4 0x8F19 BytecodeProgram_0B bytes Pass 3: bytecode program, table index/indices [25], 38 bytes. +0x8F1A 0x8F1F BytecodeProgram_0C bytes Pass 3: bytecode program, table index/indices [28], 6 bytes. +0x8F20 0x8F47 BytecodeProgram_0D bytes Pass 3: bytecode program, table index/indices [31], 40 bytes. +0x8F48 0x8F70 BytecodeProgram_0E bytes Pass 3: bytecode program, table index/indices [32], 41 bytes. +0x8F71 0x8F93 BytecodeProgram_0F bytes Pass 3: bytecode program, table index/indices [29], 35 bytes. +0x8F94 0x8FFC BytecodeProgram_10 bytes Pass 3: bytecode program, table index/indices [16], 105 bytes. +0x8FFD 0x9007 BytecodeProgram_11 bytes Pass 3: bytecode program, table index/indices [15], 11 bytes. +0x9008 0x9070 BytecodeProgram_12 bytes Pass 3: bytecode program, table index/indices [17], 105 bytes. +0x9071 0x907C BytecodeProgram_13 bytes Pass 3: bytecode program, table index/indices [27], 12 bytes. +0x907D 0x9080 BytecodeProgram_14 bytes Pass 3: bytecode program, table index/indices [0], 4 bytes. +0x9081 0x90A5 BytecodeProgram_15 bytes Pass 3: bytecode program, table index/indices [1], 37 bytes. +0x90A6 0x90B8 BytecodeProgram_16 bytes Pass 3: bytecode program, table index/indices [26], 19 bytes. +0x90B9 0x90C9 BytecodeProgram_17 bytes Pass 3: bytecode program, table index/indices [5], 17 bytes. +0x90CA 0x90D6 BytecodeProgram_18 bytes Pass 3: bytecode program, table index/indices [2], 13 bytes. +0x90D7 0x90DD BytecodeProgram_19 bytes Pass 3: bytecode program, table index/indices [12], 7 bytes. +0x90DE 0x9118 BytecodeProgram_1A bytes Pass 3: bytecode program, table index/indices [3], 59 bytes. +0x9119 0x9130 BytecodeProgram_1B bytes Pass 3: bytecode program, table index/indices [4], 24 bytes. +0x9131 0x9135 BytecodeProgram_1C bytes Pass 3: bytecode program, table index/indices [6], 5 bytes. +0x9136 0x9140 BytecodeProgram_1D bytes Pass 3: bytecode program, table index/indices [7], 11 bytes. +0x9141 0x9174 BytecodeProgram_1E bytes Pass 3: bytecode program, table index/indices [8], 52 bytes. +0x9175 0x918A BytecodeProgram_1F bytes Pass 3: bytecode program, table index/indices [18], 22 bytes. +0x918B 0x91DF BytecodeProgram_20 bytes Pass 3: bytecode program, table index/indices [19], 85 bytes. +0x91E0 0x91EB BytecodeProgram_21 bytes Pass 3: bytecode program, table index/indices [20], 12 bytes. +0x91EC 0x922B BytecodeProgram_22 bytes Pass 3: bytecode program, table index/indices [21], 64 bytes. +0x922C 0x922E BytecodeProgram_23 bytes Pass 3: bytecode program, table index/indices [9], 3 bytes. +0x922F 0x9231 BytecodeProgram_24 bytes Pass 3: bytecode program, table index/indices [10], 3 bytes. +0x9232 0x9236 BytecodeProgram_25 bytes Pass 3: bytecode program, table index/indices [30], 5 bytes. +0x9237 0x9286 BytecodeHandlerTable word Pass 3: 40 x 16-bit opcode handlers, index = (token - $C8). Dispatched through BytecodeHandlerPointerLo/Hi into DispatchThroughPointer (jmp ($001C)). Tokens $C8-$EF map to entries 0-39; slots the assembler never filled hold the next table's bytes. +0x9EF4 0x9F13 OamShadowTemplate bytes Pass 3: the 32-byte initial OAM block LoadOamShadowFromTable copies into $0300. +0x9F2B 0x9F4A SecondaryBytecodeHandlerTable word Pass 3: 16 x 16-bit handlers consumed by UpdateActorMovement; index = (token & $0F) * 2. Entry 1 holds $9FBB, one byte into a real jsr, so that slot is unused. +0xA5F4 0xA617 StageDescriptorPointerTable word Pass 3: 18 x 16-bit pointers into StageDescriptorData. Two readers share it: UpdateStageDescriptorAt reads (A & $1E) starting at entry 0, and the writer at $A593 reads the same array starting at entry 9. Entry 18 already reads descriptor text, so 18. +0xA618 0xA65F StageDescriptorData bytes Pass 3: packed tile/attribute sequences the pointer table above targets. Six records, twelve bytes apart ($A618 $A624 $A630 $A63C $A648) and a final ten-byte record at $A654; each is a short header followed by a descending run of tile indices. The last record ends with the two $30 terminator bytes. +0xAB14 0xAB67 StandaloneBytecodeProgram_3 bytes Pass 3: bytecode program not listed in BytecodeProgramPointerTable. +0xAC35 0xAC3A LevelVramWriterTable word Pass 3: 3 x 16-bit VRAM writers, index = the level byte at $0326. SelectLevelVramWriter loads the entry into SourcePointerLo/Hi and jumps through jmp ($0010). +0xACBD 0xACC8 VramRunFillValues bytes Pass 3: the 12 fill values the compressed-VRAM run tokens $B8-$C3 select by index (token - $B8); WriteVramRunToken reads one with `lda $ACBD,x`. +0xAE35 0xAE44 AnimationFrameCollisionBits bytes Pass 3: 16-entry animation-frame -> collision-flag-bits table (index = animation frame & $0F). +0xAF37 0xAF3A UnreachableSoundInitIsland bytes Pass 3: lda $E9 / bne $AF34 sits immediately after the rts that ends InitializeSoundEngine and branches back into the middle of it. No word in the image points here and the bytecode handler tables do not contain it, so it is unreachable. It is neither a coherent routine nor a table anything reads, so it stays data. +0xB0CB 0xB0E2 SoundNotePeriodTable word Pass 3: 12 x 16-bit tone periods, index = note number & $0F (guarded by cmp #$0C). ComputeTonePeriod loads the low byte from $B0CB+n and the high byte from $B0CC+n. +0xB0E3 0xB0F2 SoundNoteDurationTable bytes Pass 3: 16 note durations, index = (duration byte - $F0), clamped by the table's end at $B0F2. +0xB0F3 0xB0F6 ApuChannelEnableBitsSet bytes Pass 3: 4 x 1-byte masks OR-ed into ApuEnableMask, indexed by channel*4 in BuildApuChannelMask. +0xB0F7 0xB0FA ApuChannelEnableBitsClear bytes Pass 3: 4 x 1-byte masks AND-ed into ApuEnableMask, indexed by channel*4 in RebuildApuEnableMask. +0xB0FB 0xB91A StageNametableAndObjectData bytes Pass 3: the bulk of the per-stage data - compressed nametable and attribute payloads plus the object layout lists. Nothing indexes it with a constant address: ProcessBytecodeOpcode reaches it through StageDataPointerLow plus the 16-bit value carried in the bytecode stream, so the record structure is not resolvable from the static trace. +0xB91B 0xB970 StageDataFiller bytes Pass 3: an 86-byte run of $FF padding between stage data blocks. +0xB971 0xBD27 StageNametableAndObjectData_1 bytes Pass 3: continuation of the stage data block; see StageNametableAndObjectData. +0xBD28 0xBD29 StageDataPointerLow bytes Pass 3: one low byte per player; ProcessBytecodeOpcode adds $32 for the second player to reach its copy, so the two entries are $32 apart in the stage data that follows. +0xBD2A 0xBEBF StageNametableAndObjectData_2 bytes Pass 3: continuation of the stage data block, read through StageDataPointerLow plus the $32 per-player offset. +0xBEC0 0xBEC7 InitialOamAttributes bytes Pass 3: 8 entries (ldx #$07) copied into $0220 by CompactOamList. +0xBEC8 0xBECF InitialOamTiles bytes Pass 3: 8 entries copied into $0223 by CompactOamList. +0xBED0 0xBF8F StageDataTail bytes Pass 3: the tail of the stage data block, ahead of the VRAM block descriptors. +0xBF90 0xBF97 VramBlockByteCounts bytes Pass 3: 8 block sizes fed to ExecuteVramTransfer by ReadControllerAndInit. +0xBF98 0xBF9F VramBlockSourceLowBytes bytes Pass 3: 8 block source low bytes; the high byte is always $02. +0xBFA0 0xBFFA SoundSequenceAndLevelData bytes Pass 3: the $B1A1/$B1B0/$B2B9/$B3B2 sound sequences the sound engine points at, plus the level tables, ending just before the vectors. +0xBFFB 0xBFFF InterruptVectors bytes Pass 3: the three CPU vectors, mirrored into the ROM at $FFFB-$FFFF. diff --git a/_wip/MUSCLE (U)/copilot/header.s b/_wip/MUSCLE (U)/copilot/header.s new file mode 100644 index 0000000..37d1389 --- /dev/null +++ b/_wip/MUSCLE (U)/copilot/header.s @@ -0,0 +1,2 @@ +.segment "HEADER" + .incbin "header.bin" \ No newline at end of file diff --git a/_wip/MUSCLE (U)/copilot/label_names.tsv b/_wip/MUSCLE (U)/copilot/label_names.tsv new file mode 100644 index 0000000..ffcfdc9 --- /dev/null +++ b/_wip/MUSCLE (U)/copilot/label_names.tsv @@ -0,0 +1,702 @@ +label Label_800E WaitForFirstPpuWarmup +label Label_8019 WaitForSecondPpuWarmup +label Label_802C InitializeGameState +label Label_803B InitializeGameState_OnNonzero_803B +label Label_8052 UpdateNametableFromStream +label Label_805B UpdateNametableFromStream_OnNonzero_805B +label Label_8066 UpdateNametableFromStream_OnZero_8066 +label Label_806E UpdateNametableFromStream_OnNonnegative_806E +label Label_8077 UpdateNametableFromStream_OnZero_8077 +label Label_807A UpdateNametableFromStream_OnZero_807A +label Label_8080 UpdateNametableFromStream_OnZero_8080 +label Label_8094 UpdateNametableFromStream_OnZero_8094 +label Label_80AC StartStageSequence +label Label_80E0 StartStageSequence_OnZero_80E0 +label Label_8105 StartStageSequence_OnNonzero_8105 +label Label_810A StartStageSequence_OnNonzero_810A +label Label_811A StartStageSequence_OnZero_811A +label Label_8132 UpdateFadeFlashSprites +label Label_8154 UpdateFadeFlashSprites_OnCarryClear_8154 +label Label_8164 InitializeRound +label Label_8173 InitializeRound_OnCarryClear_8173 +label Label_8187 InitializeRound_OnNonnegative_8187 +label Label_8191 InitializeRound_OnNonzero_8191 +label Label_8196 InitializeRound_OnNonnegative_8196 +label Label_81A0 InitializeRound_OnNonzero_81A0 +label Label_81D6 InitializeRound_OnCarryClear_81D6 +label Label_81DA InitializeRound_OnCarryClear_81DA +label Label_81DE InitializeRound_OnCarryClear_81DE +label Label_81E0 InitializeRound_OnCarryClear_81E0 +label Label_81E2 InitializeRound_JoinBranchPaths_81E2 +label Label_8223 InitializeRound_OnNonzero_8223 +label Label_8226 MainGameLoop +label Label_8232 MainGameLoop_OnZero_8232 +label Label_8235 MainGameLoop_OnZero_8235 +label Label_824D MainGameLoop_OnZero_824D +label Label_8255 MainGameLoop_OnNonzero_8255 +label Label_8261 MainGameLoop_OnNonzero_8261 +label Label_8267 MainGameLoop_OnNonnegative_8267 +label Label_8284 MainGameLoop_OnZero_8284 +label Label_828C MainGameLoop_OnNonzero_828C +label Label_8298 MainGameLoop_OnNonzero_8298 +label Label_829E MainGameLoop_OnNonnegative_829E +label Label_82AC DivideBy20 +label Label_82BE DivideBy20_OnNonzero_82BE +label Label_82DA DivideBy20_OnCarryClear_82DA +label Label_82E1 SilenceSoundChannels1And3 +label Label_82ED SilenceSoundChannel3 +label Label_82FA StartIntroMusic +label Label_82FF StartMusicSequence +label Label_832A UpdateHudTallyTiles +label Label_833E UpdateHudTallyTiles_OnZero_833E +label Label_8352 UpdateHudTallyTiles_OnZero_8352 +label Label_8353 UpdateScoreTallyDigits +label Label_8372 WriteScoreTallyDigits +label Label_8374 WriteScoreTallyDigits_OnCarryClear_8374 +label Label_8385 WriteScoreTallyDigits_OnZero_8385 +label Label_8390 WriteScoreTallyDigits_OnNonzero_8390 +label Label_8399 LoadOamShadowFromTable +label Label_839B LoadOamShadowFromTable_OnNonnegative_839B +label Label_83A7 UpdateActorPositions +label Label_83AB UpdateActorPositions_OnNonnegative_83AB +label Label_83D0 UpdateActorPositions_OnZero_83D0 +label Label_83E1 UpdateActorPositions_OnCarryClear_83E1 +label Label_841A UpdateActorPositions_OnZero_841A +label Label_8434 UpdateActorPositions_OnNonzero_8434 +label Label_845C UpdateRoundTimers +label Label_848D UpdateRoundTimers_OnNonzero_848D +label Label_84A1 UpdateRoundTimers_OnZero_84A1 +label Label_84B1 UpdateRoundTimers_OnNonzero_84B1 +label Label_84B5 UpdateRoundTimers_OnNonzero_84B5 +label Label_84E9 UpdateRoundTimers_OnCarrySet_84E9 +label Label_84EE UpdateRoundTimers_OnNonzero_84EE +label Label_84F4 UpdateRoundTimers_OnCarryClear_84F4 +label Label_850F UpdateRoundTimers_OnZero_850F +label Label_851C UpdateRoundTimers_OnCarrySet_851C +label Label_851F UpdateRoundTimers_OnNonzero_851F +label Label_8522 UpdateRoundTimers_OnCarrySet_8522 +label Label_8564 UpdateRoundTimers_OnZero_8564 +label Label_856C PlayRoundChangeMusic +label Label_858F PlayRoundChangeMusic_OnNonzero_858F +label Label_8596 UpdateScrollTarget +label Label_8598 UpdateScrollTargetAlt +label Label_85A3 UpdateScrollTargetAlt_OnZero_85A3 +label Label_85A8 UpdateScrollTargetAlt_OnNonzero_85A8 +label Label_85DA UpdateScrollTargetAlt_OnNonzero_85DA +label Label_85EC UpdateScrollTargetAlt_JoinBranchPaths_85EC +label Label_8639 BeginVblankFrame +label Label_8644 ForceRenderingOff +label Label_8653 SetRenderingOffAndSignalVblank +label Label_865D UpdateRoundLogic +label Label_8682 UpdateRoundLogic_OnNonzero_8682 +label Label_86A0 UpdateRoundLogic_JoinBranchPaths_86A0 +label Label_86AA UpdateRoundLogic_JoinBranchPaths_86AA +label Label_86AD UpdateRoundLogic_OnNegative_86AD +label Label_86D8 NmiHandler_OnZero_86D8 +label Label_86E3 NmiHandler_OnNonzero_86E3 +label Label_86FA NmiHandler_OnZero_86FA +label Label_8703 NmiHandler_OnNegative_8703 +label Label_8709 NmiHandler_OnZero_8709 +label Label_8728 NmiHandler_OnCarrySet_8728 +label Label_872F NmiHandler_OnNonzero_872F +label Label_8742 NmiHandler_OnNonzero_8742 +label Label_8751 FinishNmiUpdates +label Label_8759 FinishNmiRegisters +label Label_8765 SetSoundSequenceChannel1 +label Label_877C RunGameStateDispatcher +label Label_8787 RunGameStateDispatcher_JoinBranchPaths_8787 +label Label_8795 RunGameStateDispatcher_OnNonzero_8795 +label Label_87BF UpdateTimersAlt +label Label_87D1 PollControllerStart +label Label_87F1 PollControllerStart_JoinBranchPaths_87F1 +label Label_87F2 UpdateFlashCounter +label Label_8801 UpdateFlashCounter_OnZero_8801 +label Label_8803 UpdateFlashCounter_OnNonzero_8803 +label Label_8819 UpdateFlashCounter_OnCarryClear_8819 +label Label_8837 PlayDeathSequence +label Label_8848 PollControllerBits +label Label_885A PollControllerBits_JoinBranchPaths_885A +label Label_885B PollControllerAndAdvance +label Label_886C PollControllerBitsAlt +label Label_887C SignalVblankComplete +label Label_8881 SignalVblankComplete_JoinBranchPaths_8881 +label Label_8882 PollControllerAndCheckRound +label Label_888D PollControllerAndCheckRound_OnZero_888D +label Label_8899 PollControllerAndCheckRound_OnCarrySet_8899 +label Label_889D PollControllerAndCheckRound_OnNonzero_889D +label Label_88A4 BuildOamList +label Label_88AE BuildOamList_OnNonzero_88AE +label Label_88B0 EmitOamEntry +label Label_88EB EmitOamBlankEntry +label Label_88F3 EmitOamBlankEntry_JoinBranchPaths_88F3 +label Label_88F4 EmitOamBlankEntry_OnZero_88F4 +label Label_88F9 EmitOamFromTable +label Label_88FF EmitOamAtOffset +label Label_8909 EmitOamAtOffset_OnZero_8909 +label Label_890F EmitOamAtOffset_JoinBranchPaths_890F +label Label_891B EmitOamAtOffset_OnZero_891B +label Label_892A EmitOamAtOffset_OnNonzero_892A +label Label_8936 FindFreeOamSlot +label Label_8938 FindFreeOamSlot_OnNonnegative_8938 +label Label_8942 FindFreeOamSlot_OnZero_8942 +label Label_8943 FindFreeOamSlot_JoinBranchPaths_8943 +label Label_896A FindFreeOamSlot_JoinBranchPaths_896A +label Label_896B FindFreeOamSlot_OnZero_896B +label Label_897F FindFreeOamSlot_OnNonzero_897F +label Label_8986 CompactOamList +label Label_898A CompactOamList_OnNonnegative_898A +label Label_899D CompactOamList_OnZero_899D +label Label_899F CompactOamList_OnNonzero_899F +label Label_89A8 CompactOamList_OnZero_89A8 +label Label_89AC CompactOamList_OnZero_89AC +label Label_89B0 CompactOamList_OnCarryClear_89B0 +label Label_89B2 CompactOamList_OnNonzero_89B2 +label Label_89B5 CompactOamList_OnNonzero_89B5 +label Label_89B8 CompactOamList_OnNonzero_89B8 +label Label_89CE ReadControllerAndInit +label Label_89EE ReadControllerAndInit_OnCarryClear_89EE +label Label_89F7 ReadControllerAndInit_OnNonzero_89F7 +label Label_8A28 UpdateStageActors +label Label_8A5D UpdateStageActors_JoinBranchPaths_8A5D +label Label_8A5E SpawnStageActors +label Label_8A68 SpawnStageActors_OnCarryClear_8A68 +label Label_8A74 SpawnStageActors_OnZero_8A74 +label Label_8A84 SpawnStageActors_OnNonzero_8A84 +label Label_8A93 SpawnStageActors_OnZero_8A93 +label Label_8AA4 SpawnStageActors_JoinBranchPaths_8AA4 +label Label_8AA5 SpawnStageActors_OnZero_8AA5 +label Label_8AE1 SpawnStageActors_JoinBranchPaths_8AE1 +label Label_8AE8 UpdateAttributeTable +label Label_8B07 ClearScrollLatch +label Label_8B0D ClearScrollLatch_OnNonzero_8B0D +label Label_8B20 WriteNametableTile +label Label_8B25 WriteNametableTile_OnNonzero_8B25 +label Label_8B33 ClearAttributeRegion +label Label_8B37 ClearAttributeRegion_JoinBranchPaths_8B37 +label Label_8B3B ClearAttributeRegion_OnNonnegative_8B3B +label Label_8B5F ClearAttributeRegion_OnCarryClear_8B5F +label Label_8B67 ClearAttributeRegion_OnZero_8B67 +label Label_8B6D ClearAttributeRegion_JoinBranchPaths_8B6D +label Label_8B92 RenderHudDigits +label Label_8BBA RenderHudDigits_OnNonzero_8BBA +label Label_8BEF RenderHudDigitDescriptor +label Label_8BF8 SetRenderingOn +label Label_8BFF SetRenderingOn_OnNonnegative_8BFF +label Label_8C05 AdvanceAnimationSlot +label Label_8C0E QueueVramTransfer +label Label_8C11 QueueVramTransferAlt +label Label_8C3A QueueVramTransferAlt_OnNonnegative_8C3A +label Label_8C55 QueueVramTransferAlt_OnNonzero_8C55 +label Label_8C65 ExecuteVramTransfer +label Label_8C72 ExecuteVramTransfer_OnNonzero_8C72 +label Label_8C98 ExecuteVramTransfer_OnZero_8C98 +label Label_8CB8 QueueVramDescriptor +label Label_9287 QueueVramDescriptor_Entry_9287 +label Label_928D QueueVramDescriptor_JumpNext_928D +label Label_9293 QueueVramDescriptor_JumpNext_9293 +label Label_929F QueueVramDescriptor_OnNonzero_929F +label Label_92AF QueueVramDescriptor_OnNonzero_92AF +label Label_92B2 QueueVramDescriptor_JumpNext_92B2 +label Label_92CD QueueVramDescriptor_JumpNext_92CD +label Label_92E8 QueueVramDescriptor_OnZero_92E8 +label Label_9329 QueueVramDescriptor_OnZero_9329 +label Label_932C QueueVramDescriptor_JumpNext_932C +label Label_934B UpdateActorX +label Label_9354 UpdateActorX_JumpNext_9354 +label Label_9371 UpdateActorTile +label Label_9374 UpdateActorTileAlt +label Label_937C UpdateActorTileAlt_JumpNext_937C +label Label_93A4 UpdateActorTileAlt_JumpNext_93A4 +label Label_93C4 UpdateActorTileAlt_OnCarrySet_93C4 +label Label_93CC UpdateActorTileAlt_JumpNext_93CC +label Label_93D0 UpdateActorTileAlt_OnZero_93D0 +label Label_93D3 UpdateActorTileAlt_OnNonzero_93D3 +label Label_9401 UpdateActorTileAlt_OnCarrySet_9401 +label Label_9409 UpdateActorTileAlt_JumpNext_9409 +label Label_941B UpdateActorTileAlt_JumpNext_941B +label Label_942C UpdateActorTileAlt_OnNegative_942C +label Label_9441 UpdateActorTileAlt_OnNonnegative_9441 +label Label_9450 UpdateActorTileAlt_OnNonzero_9450 +label Label_9451 UpdateActorTileAlt_OnCarrySet_9451 +label Label_9454 UpdateActorTileAlt_OnCarryClear_9454 +label Label_945B UpdateActorTileAlt_OnNegative_945B +label Label_9465 UpdateActorTileAlt_JumpNext_9465 +label Label_946D UpdateActorTileAlt_JumpNext_946D +label Label_9477 UpdateActorTileAlt_JumpNext_9477 +label Label_947D UpdateActorTileAlt_OnZero_947D +label Label_9480 UpdateActorTileAlt_JumpNext_9480 +label Label_948F UpdateActorTileAlt_JumpNext_948F +label Label_9499 UpdateActorTileAlt_JumpNext_9499 +label Label_94AA UpdateActorTileAlt_OnZero_94AA +label Label_94AD UpdateActorTileAlt_JumpNext_94AD +label Label_94B1 TestPlayerFacing +label Label_94C0 TestPlayerFacing_JumpNext_94C0 +label Label_94C7 SelectActorSlot +label Label_94C8 SelectActorSlotAlt +label Label_94CF ClearActorPosition +label Label_94D7 ClearActorFields +label Label_94F3 ClearActorFields_JoinBranchPaths_94F3 +label Label_94F6 ClearActorFields_OnNonzero_94F6 +label Label_94FE SetActorFlag +label Label_950B SetActorFlag_JumpNext_950B +label Label_9513 SetActorFlag_JumpNext_9513 +label Label_951F SetActorFlag_OnNonzero_951F +label Label_9522 SetActorFlag_JumpNext_9522 +label Label_9535 SetActorFlag_OnNonzero_9535 +label Label_9541 SetActorFlag_Return_9541 +label Label_9551 SetActorFlag_OnNonzero_9551 +label Label_9559 SetActorFlag_JumpNext_9559 +label Label_9585 UpdateActorState +label Label_9590 UpdateActorState_OnNonzero_9590 +label Label_95A5 UpdateActorState_OnCarryClear_95A5 +label Label_95AE ComputeActorLeftEdge +label Label_95B8 ComputeActorLeftEdge_OnNonzero_95B8 +label Label_95C9 ComputeActorLeftEdge_OnCarryClear_95C9 +label Label_95D2 ComputeActorRightEdge +label Label_95D9 CompareActorToLimit +label Label_95DC CompareActorToLimit_Return_95DC +label Label_95E3 CompareActorToLimit_OnNonzero_95E3 +label Label_9628 CompareActorToLimit_OnCarrySet_9628 +label Label_963C CompareActorToLimit_OnCarrySet_963C +label Label_963E CompareActorToLimit_OnNonnegative_963E +label Label_9641 CompareActorToLimit_OnZero_9641 +label Label_9644 CompareActorToLimit_JumpNext_9644 +label Label_9653 SetActorTileFromPalette +label Label_9664 SetActorTileFromPalette_OnNonzero_9664 +label Label_9667 StoreActorTile +label Label_966D StoreActorTile_Return_966D +label Label_9679 StoreActorTile_OnNegative_9679 +label Label_968E StoreActorTile_OnNonnegative_968E +label Label_969D StoreActorTile_OnNonzero_969D +label Label_969E AdvanceActorCounter +label Label_96A6 AdvanceActorCounter_OnCarryClear_96A6 +label Label_96AA SetActorTileValue +label Label_96B3 SetActorTileValue_OnNonzero_96B3 +label Label_96B9 SetActorTileValue_OnNegative_96B9 +label Label_96BC SetActorTileValue_JumpNext_96BC +label Label_96C2 SetActorTileValue_Continue_96C2 +label Label_96C8 TestActorCollisionFlag +label Label_96CC TestActorCollisionFlag_OnZero_96CC +label Label_96CE TestActorCollisionFlag_OnZero_96CE +label Label_96EE TestActorCollisionFlag_OnCarryClear_96EE +label Label_96F7 ComputeActorLeftEdgeAlt +label Label_9701 ComputeActorLeftEdgeAlt_OnNonzero_9701 +label Label_9719 ComputeActorLeftEdgeAlt_OnCarryClear_9719 +label Label_9722 ComputeActorRightEdgeAlt +label Label_9729 TestActorRange +label Label_9731 TestActorRange_OnCarrySet_9731 +label Label_9732 MoveActorByStep +label Label_975D MoveActorByStep_OnCarrySet_975D +label Label_975E MoveActorByStep_Return_975E +label Label_9766 MoveActorByStep_OnCarryClear_9766 +label Label_979A MoveActorByStep_OnNonzero_979A +label Label_97A0 MoveActorByStep_OnNonzero_97A0 +label Label_97BC SetActorAnimation63 +label Label_97C0 SetActorAnimation62 +label Label_97C4 SetActorAnimation61 +label Label_97C6 SetActorAnimation61_OnNonzero_97C6 +label Label_97D5 UpdateActorAnimation +label Label_97FB UpdateActorAnimation_OnZero_97FB +label Label_97FC TestAnimationSlot +label Label_9800 TestAnimationSlot_JoinBranchPaths_9800 +label Label_9802 TestAnimationSlot_OnNonzero_9802 +label Label_981C TestAnimationSlot_OnCarryClear_981C +label Label_982A ComputeActorLeftEdgeAt +label Label_9834 ComputeActorLeftEdgeAt_OnNonzero_9834 +label Label_984A ComputeActorLeftEdgeAt_OnCarryClear_984A +label Label_9858 ComputeActorRightEdgeAt +label Label_985F TestActorValue +label Label_986A TestActorValue_Return_986A +label Label_9875 TestActorValue_OnCarryClear_9875 +label Label_98A7 TestActorValue_OnCarryClear_98A7 +label Label_98AA TestActorValue_JoinBranchPaths_98AA +label Label_98AD TestActorValue_JoinBranchPaths_98AD +label Label_98B0 TestActorValue_JumpNext_98B0 +label Label_98B7 TestActorValue_OnNonzero_98B7 +label Label_98BE TestActorValue_JoinBranchPaths_98BE +label Label_98C1 TestActorValue_OnNonzero_98C1 +label Label_98D8 TestActorValue_OnCarryClear_98D8 +label Label_98E6 ComputeActorLeftEdgeAlt2 +label Label_98F0 ComputeActorLeftEdgeAlt2_OnNonzero_98F0 +label Label_9903 ComputeActorLeftEdgeAlt2_OnCarryClear_9903 +label Label_9911 UpdateActorTileFromIndex +label Label_9918 UpdateActorTileFromIndexAlt +label Label_9948 UpdateActorTileFromIndexAlt_JoinBranchPaths_9948 +label Label_994B UpdateActorTileFromIndexAlt_JumpNext_994B +label Label_996E UpdateActorTileFromIndexAlt_JumpNext_996E +label Label_997C UpdateActorTileFromIndexAlt_JumpNext_997C +label Label_9989 UpdateActorTileFromIndexAlt_OnNonzero_9989 +label Label_9994 UpdateActorTileFromIndexAlt_OnNonzero_9994 +label Label_99A0 UpdateActorTileFromIndexAlt_OnNonzero_99A0 +label Label_99A3 SetSoundSequenceChannel2 +label Label_99B0 SetSoundSequenceChannel2_Return_99B0 +label Label_99B7 SetSoundSequenceChannel2_JumpNext_99B7 +label Label_99D7 SetSoundSequenceChannel2_OnNegative_99D7 +label Label_99E2 LookupActorTileId +label Label_99E4 LookupActorTileIdAlt +label Label_9A02 LookupActorTileIdAlt_OnCarryClear_9A02 +label Label_9A24 StoreActorCoordinates +label Label_9A2E StoreActorCoordinatesAlt +label Label_9A36 StoreActorCoordinatesAlt_OnNonnegative_9A36 +label Label_9A3F FlipActorFacing +label Label_9A4E SpawnActorPair +label Label_9A6B SpawnActorPairAlt +label Label_9ABC SpawnActorPairAlt_OnNonzero_9ABC +label Label_9ACE SpawnActorPairAlt_OnNonzero_9ACE +label Label_9AD3 SpawnActorPairAlt_JoinBranchPaths_9AD3 +label Label_9AD8 SpawnActorPairAlt_OnNonzero_9AD8 +label Label_9AE8 RunBytecodeInterpreter +label Label_9B05 DispatchThroughPointer +label Label_9B08 DispatchThroughPointer_JoinBranchPaths_9B08 +label Label_9B18 DispatchThroughPointer_OnNonzero_9B18 +label Label_9B25 RunBytecodeProgram +label Label_9B4C RunBytecodeProgram_OnNonnegative_9B4C +label Label_9B64 RunBytecodeProgram_OnNonnegative_9B64 +label Label_9B72 RunBytecodeProgram_OnNonnegative_9B72 +label Label_9BA1 RunBytecodeProgram_OnZero_9BA1 +label Label_9BB0 RunBytecodeProgram_OnNonzero_9BB0 +label Label_9BB4 RunBytecodeProgram_OnNonzero_9BB4 +label Label_9BD9 RunBytecodeProgram_OnNonzero_9BD9 +label Label_9BDD RunBytecodeProgram_OnNonzero_9BDD +label Label_9BF3 RunBytecodeProgram_OnCarryClear_9BF3 +label Label_9C2C RunBytecodeProgram_OnZero_9C2C +label Label_9C2E RunBytecodeProgram_OnNonnegative_9C2E +label Label_9C4C RunBytecodeProgram_OnNonnegative_9C4C +label Label_9C52 RunBytecodeProgram_OnNonnegative_9C52 +label Label_9C66 RunBytecodeProgram_OnCarryClear_9C66 +label Label_9C71 RunBytecodeProgram_OnZero_9C71 +label Label_9C73 RunBytecodeProgram_JoinBranchPaths_9C73 +label Label_9C84 RunBytecodeProgram_OnNonzero_9C84 +label Label_9C8D RunBytecodeProgram_OnCarryClear_9C8D +label Label_9C91 RunBytecodeProgram_JoinBranchPaths_9C91 +label Label_9CAD RunBytecodeProgram_Return_9CAD +label Label_9CBB ResetBytecodeState +label Label_9CDB ResetBytecodeState_OnCarryClear_9CDB +label Label_9CE5 ResetBytecodeState_OnCarryClear_9CE5 +label Label_9D04 ResetBytecodeState_OnNonnegative_9D04 +label Label_9D0D ResetBytecodeState_OnCarrySet_9D0D +label Label_9D10 ResetBytecodeState_OnNonzero_9D10 +label Label_9D39 ResetBytecodeState_OnZero_9D39 +label Label_9D4A ResetBytecodeState_OnZero_9D4A +label Label_9D4E CopyActorCoordinates +label Label_9D61 CopyActorCoordinates_OnCarryClear_9D61 +label Label_9DA2 CopyActorCoordinates_OnNonzero_9DA2 +label Label_9DB6 CopyActorCoordinates_OnZero_9DB6 +label Label_9DBB CopyActorCoordinates_OnNonzero_9DBB +label Label_9DD0 CopyActorCoordinates_OnCarryClear_9DD0 +label Label_9DD4 CopyActorCoordinates_OnCarryClear_9DD4 +label Label_9DD6 SetActorBounds +label Label_9DE6 LoadActorTileIndex +label Label_9E02 LoadActorTileIndex_OnCarrySet_9E02 +label Label_9E19 LoadActorTileIndex_OnZero_9E19 +label Label_9E37 LoadActorTileIndex_OnNonzero_9E37 +label Label_9E4B LoadActorTileIndex_OnZero_9E4B +label Label_9E50 LoadActorTileIndex_OnNonzero_9E50 +label Label_9E65 LoadActorTileIndex_OnCarryClear_9E65 +label Label_9E69 LoadActorTileIndex_OnCarryClear_9E69 +label Label_9E6B LoadActorTileIndex_OnNonzero_9E6B +label Label_9E6E UpdateActorFacing +label Label_9E7F QueueNametableWrite +label Label_9E87 QueueNametableWrite_OnNonzero_9E87 +label Label_9E89 QueueNametableWrite_OnNonnegative_9E89 +label Label_9F14 FlushNametableWrite +label Label_9F2A FlushNametableWrite_JoinBranchPaths_9F2A +label Label_9F4B UpdateActorMovement +label Label_9F54 MoveActorByOpcode +label Label_9F7F MoveActorByOpcode_JoinBranchPaths_9F7F +label Label_9F83 MoveActorByOpcode_JoinBranchPaths_9F83 +label Label_9FAC MoveActorByOpcode_OnCarryClear_9FAC +label Label_9FB8 MoveActorByOpcode_OnNonzero_9FB8 +label Label_9FBA MoveActorByOpcode_JoinBranchPaths_9FBA +label Label_9FBB MoveActorByOpcode_Return_9FBB +label Label_9FC2 MoveActorByOpcode_Continue_9FC2 +label Label_9FC9 MoveActorByOpcode_Continue_9FC9 +label Label_9FD0 MoveActorByOpcode_Continue_9FD0 +label Label_9FD7 MoveActorByOpcode_Continue_9FD7 +label Label_9FDF AddToNametableValue +label Label_9FEF AddToNametableValue_Return_9FEF +label Label_9FFA AddToNametableValue_JumpNext_9FFA +label Label_A002 SubtractFromNametableValue +label Label_A012 SubtractFromNametableValue_Return_A012 +label Label_A01D ProcessBytecodeOpcode +label Label_A060 ProcessBytecodeOpcode_OnCarrySet_A060 +label Label_A062 ProcessBytecodeOpcode_JoinBranchPaths_A062 +label Label_A07B ProcessBytecodeOpcode_JoinBranchPaths_A07B +label Label_A085 ComputeBytecodeOffset +label Label_A08B ComputeBytecodeOffset_OnNonzero_A08B +label Label_A09F ComputeBytecodeOffset_OnCarryClear_A09F +label Label_A0A5 ResetBytecodeAccumulator +label Label_A0AD ResetBytecodeAccumulator_OnNonzero_A0AD +label Label_A0C2 ResetBytecodeAccumulator_OnCarryClear_A0C2 +label Label_A0C6 ResetBytecodeAccumulatorAlt +label Label_A0CE ResetBytecodeAccumulatorAlt_OnNonzero_A0CE +label Label_A0EC ResetBytecodeAccumulatorAlt_OnCarryClear_A0EC +label Label_A0F4 AdvanceBytecodeProgram +label Label_A0FB ResetBytecodeStateAlt +label Label_A105 ResetBytecodeStateAlt_OnNonzero_A105 +label Label_A122 ResetBytecodeStateAlt_OnCarryClear_A122 +label Label_A12E ComputeActorTileRow +label Label_A14F ComputeActorTileRow_OnNonnegative_A14F +label Label_A157 ComputeActorTileRow_JoinBranchPaths_A157 +label Label_A15D ResetBytecodePointers +label Label_A165 ResetBytecodePointers_OnNonzero_A165 +label Label_A179 ResetBytecodePointers_OnCarryClear_A179 +label Label_A17F RunActorScript +label Label_A1A5 RunActorScript_OnCarrySet_A1A5 +label Label_A1C3 RunActorScript_OnZero_A1C3 +label Label_A1E3 RunActorScript_OnNonnegative_A1E3 +label Label_A1F1 RunActorScript_OnNonnegative_A1F1 +label Label_A201 RunActorScript_OnNonzero_A201 +label Label_A246 RunActorScript_OnZero_A246 +label Label_A250 LoadActorConfigByte +label Label_A253 ComputeActorConfigOffset +label Label_A25F CopyConfigBytes +label Label_A261 CopyConfigBytes_OnNonnegative_A261 +label Label_A270 LoadActorConfigRecord +label Label_A28D LoadActorConfigRecord_JoinBranchPaths_A28D +label Label_A298 CompareConfigValue +label Label_A2BD CompareConfigValue_JoinBranchPaths_A2BD +label Label_A2C8 ReturnFromConfigLoad +label Label_A2C9 LoadActorConfigFields +label Label_A2D8 LoadActorConfigFields_OnZero_A2D8 +label Label_A2EB LoadActorConfigFields_OnNegative_A2EB +label Label_A2F1 LoadActorConfigFields_OnNonzero_A2F1 +label Label_A305 LoadActorConfigFields_OnZero_A305 +label Label_A30B LoadActorConfigFields_OnNonzero_A30B +label Label_A316 StoreActorPaletteByte +label Label_A32A StoreActorPaletteByte_OnZero_A32A +label Label_A32C StoreActorControlByte +label Label_A334 StoreActorControlByte_OnZero_A334 +label Label_A338 ReadActorConfigByte +label Label_A388 ReadActorConfigByte_JoinBranchPaths_A388 +label Label_A3A5 ReadActorConfigByte_JoinBranchPaths_A3A5 +label Label_A3B1 ReadActorConfigByte_OnNonzero_A3B1 +label Label_A3C9 ReadActorConfigByte_OnCarrySet_A3C9 +label Label_A3E9 ReadActorConfigByte_OnCarrySet_A3E9 +label Label_A3F1 ReadActorConfigByte_OnNonzero_A3F1 +label Label_A3FA ReadActorConfigByte_OnNonzero_A3FA +label Label_A406 ReadActorConfigByte_JoinBranchPaths_A406 +label Label_A40A ReadActorConfigByte_OnCarrySet_A40A +label Label_A40D ReadActorConfigByte_OnNonzero_A40D +label Label_A418 ReadActorConfigByte_OnZero_A418 +label Label_A423 ReadActorConfigByte_OnNonzero_A423 +label Label_A428 ReadActorConfigByte_OnCarrySet_A428 +label Label_A430 ReadActorConfigByte_JoinBranchPaths_A430 +label Label_A435 CompareActorConfigValue +label Label_A44E CompareActorConfigValue_OnZero_A44E +label Label_A459 CompareActorConfigValue_OnZero_A459 +label Label_A464 CompareActorConfigValue_OnZero_A464 +label Label_A46D CompareActorConfigValue_OnNonzero_A46D +label Label_A46F StoreActorConfigResult +label Label_A475 StoreActorConfigResult_JoinBranchPaths_A475 +label Label_A482 LoadActorConfigAlt +label Label_A48D LoadActorConfigAlt_OnZero_A48D +label Label_A49B LoadActorConfigAlt_OnZero_A49B +label Label_A49F StoreActorConfigResultAlt +label Label_A4A5 StoreActorConfigResultAlt_OnZero_A4A5 +label Label_A4AA LoadActorFacingFlag +label Label_A4B5 LoadActorFacingFlag_OnNonzero_A4B5 +label Label_A4BA LoadActorFacingFlag_OnCarryClear_A4BA +label Label_A4C2 LoadActorFacingFlag_JoinBranchPaths_A4C2 +label Label_A4C7 LoadActorConfigBlock +label Label_A4DF TestSoundChannelState +label Label_A4F1 TestSoundChannelState_OnNonzero_A4F1 +label Label_A4F2 SetSoundSequenceChannel2Alt +label Label_A4FF FlipObjectIndex +label Label_A508 LookupObjectIndex +label Label_A512 UpdateObjectSlots +label Label_A51B AdvanceObjectSlot +label Label_A522 AdvanceObjectSlot_OnNonzero_A522 +label Label_A52D AdvanceObjectSlot_OnCarrySet_A52D +label Label_A532 AdvanceObjectSlot_OnCarryClear_A532 +label Label_A583 AdvanceObjectSlot_OnNegative_A583 +label Label_A5DD WriteNametableBytes +label Label_A5DF WriteNametableBytes_OnNonnegative_A5DF +label Label_A660 SetSoundSequenceChannel4 +label Label_A67F SetSoundSequenceChannel4_OnZero_A67F +label Label_A68E UpdateObjectList +label Label_A695 UpdateObjectListEntry +label Label_A6BE UpdateObjectListEntry_OnNegative_A6BE +label Label_A6DF UpdateObjectListEntry_OnNonzero_A6DF +label Label_A6EB UpdateObjectListEntry_OnZero_A6EB +label Label_A6EF UpdateObjectListEntry_OnZero_A6EF +label Label_A6F8 UpdateObjectCollisions +label Label_A70D UpdateObjectCollisions_OnNonzero_A70D +label Label_A714 UpdateObjectCollisions_OnNonzero_A714 +label Label_A728 UpdateObjectCollisions_OnNonzero_A728 +label Label_A729 UpdateObjectCollisions_OnCarryClear_A729 +label Label_A73D UpdateObjectCollisions_OnNonzero_A73D +label Label_A745 UpdateObjectCollisions_OnNonzero_A745 +label Label_A758 UpdateObjectCollisions_OnNonzero_A758 +label Label_A75D UpdateObjectCollisions_OnNonzero_A75D +label Label_A773 UpdateObjectCollisions_OnCarryClear_A773 +label Label_A77F UpdateObjectCollisions_OnCarryClear_A77F +label Label_A78F UpdateObjectCollisions_JoinBranchPaths_A78F +label Label_A79B UpdateObjectCollisions_OnZero_A79B +label Label_A79C UpdateObjectCollisions_OnZero_A79C +label Label_A79F CheckObjectScroll +label Label_A7B0 CheckObjectScroll_OnNonzero_A7B0 +label Label_A7B8 CheckObjectScroll_OnZero_A7B8 +label Label_A7BF CheckObjectScroll_OnNonnegative_A7BF +label Label_A7CA CheckObjectScroll_OnNegative_A7CA +label Label_A7E1 CheckObjectScroll_OnNonzero_A7E1 +label Label_A7E8 CheckObjectScroll_OnNonzero_A7E8 +label Label_A7FD CheckObjectScroll_JoinBranchPaths_A7FD +label Label_A800 CheckObjectScroll_OnNonnegative_A800 +label Label_A82F ClearScrollLatchAlt +label Label_A833 ClearScrollLatchAlt_OnCarryClear_A833 +label Label_A834 UpdateObjectSprite +label Label_A842 UpdateObjectSprite_OnCarryClear_A842 +label Label_A856 UpdateObjectSprite_OnCarrySet_A856 +label Label_A862 UpdateObjectSprite_OnZero_A862 +label Label_A884 SetObjectFlags +label Label_A89D SetObjectFlags_OnCarryClear_A89D +label Label_A8D1 AdvanceObjectFrame +label Label_A8E9 TestObjectActive +label Label_A8F9 TestObjectActive_OnNonzero_A8F9 +label Label_A916 TestObjectActive_OnNonnegative_A916 +label Label_A936 TestObjectActive_OnNonzero_A936 +label Label_A949 UpdateObjectAnimations +label Label_A952 UpdateObjectAnimation +label Label_A982 UpdateObjectAnimation_OnCarryClear_A982 +label Label_A991 UpdateObjectAnimation_JoinBranchPaths_A991 +label Label_A992 UpdateObjectTimer +label Label_A99E DecrementObjectCounter +label Label_A9A4 DecrementObjectCounter_OnZero_A9A4 +label Label_A9AA DecrementObjectCounter_JoinBranchPaths_A9AA +label Label_A9AB UpdateObjectState +label Label_A9C9 UpdateObjectState_OnCarrySet_A9C9 +label Label_A9CD UpdateObjectState_OnZero_A9CD +label Label_A9D6 UpdateObjectState_OnNegative_A9D6 +label Label_A9D8 ToggleScrollRegionFlip +label Label_A9E9 ToggleScrollRegionFlip_OnNonzero_A9E9 +label Label_A9EA ToggleScrollRegionFlip_OnCarrySet_A9EA +label Label_A9FF BuildObjectList +label Label_AA55 ToggleScrollRegionFlip_OnCarrySet_AA55 +label Label_AA56 ReadControllers +label Label_AA63 ReadControllerShiftRegister +label Label_AA69 ReadControllerShiftRegister_OnNonzero_AA69 +label Label_AA82 ReadControllerShiftRegister_JoinBranchPaths_AA82 +label Label_AA98 ReadControllerShiftRegister_OnZero_AA98 +label Label_AA9D ReadControllerShiftRegister_OnCarrySet_AA9D +label Label_AAA1 ReadControllerShiftRegister_OnCarrySet_AAA1 +label Label_AAA8 ReadControllerShiftRegister_OnCarrySet_AAA8 +label Label_AAAE ReadControllerShiftRegister_OnCarryClear_AAAE +label Label_AAB4 ReadControllerShiftRegister_OnCarrySet_AAB4 +label Label_AAB8 StoreControllerButtonBits +label Label_AAC0 StoreControllerButtonBits_OnZero_AAC0 +label Label_AACC StoreControllerButtonBits_OnZero_AACC +label Label_AACD EnableRendering +label Label_AADC DisableRenderingAndClearNametables +label Label_AAEF ClearNametablePattern +label Label_AAFF ClearNametablePattern_OnNonzero_AAFF +label Label_AB0B ClearNametablePattern_OnNonzero_AB0B +label Label_AB68 CopyPaletteFromTable +label Label_AB7D CopyPaletteFromTable_OnNonnegative_AB7D +label Label_AB98 LoadShadowOamBlock +label Label_ABA3 FillShadowOamBlock +label Label_ABA8 FillShadowOamBlock_OnNonnegative_ABA8 +label Label_ABB1 UploadPalette +label Label_ABC4 UploadPalette_OnCarryClear_ABC4 +label Label_ABE4 ApplyPpuScrollAndControl +label Label_ABF7 ShiftAccumulatorRight4 +label Label_ABFC ClearOamShadow +label Label_AC03 ClearOamShadow_OnNonzero_AC03 +label Label_AC0D SelectLevelVramWriter +label Label_AC3B SetLevelVramStream +label Label_AC43 FillAttributeBlock +label Label_AC4C WriteAttributeBlock +label Label_AC56 WriteAttributeBlock_OnNonzero_AC56 +label Label_AC62 LoadAttributeStream +label Label_AC78 SetPpuAddressHighAnd40 +label Label_AC82 WriteCompressedVramStream +label Label_AC88 AdvanceSourceByte +label Label_AC96 DecodeVramStreamToken +label Label_AC9E AdvanceSourceByte_OnCarrySet_AC9E +label Label_ACA1 AdvanceSourceByte_OnZero_ACA1 +label Label_ACA7 WriteVramRunToken +label Label_ACB5 AdvanceSourceByte_OnNonzero_ACB5 +label Label_ACC9 AdvanceDestinationWord +label Label_ACD7 AdvanceCountWord +label Label_ACE5 WithRenderingEnabled +label Label_ACF5 WriteCompressedVramBlocks +label Label_AD01 WriteCompressedVramBlocks_OnNonzero_AD01 +label Label_AD19 ComputeCollisionBits +label Label_AD36 ComputePlayerOverlapBits +label Label_AD71 ComputePlayerOverlapBits_OnCarrySet_AD71 +label Label_AD73 ComputePlayerOverlapBits_OnNonzero_AD73 +label Label_AD7A ComputePlayerOverlapBits_JoinBranchPaths_AD7A +label Label_AD84 ComputePlayerOverlapBits_OnCarrySet_AD84 +label Label_AD8B ComputePlayerOverlapBits_OnZero_AD8B +label Label_AD91 ComputePlayerOverlapBits_OnCarrySet_AD91 +label Label_AD94 ComputePlayerOverlapBits_JoinBranchPaths_AD94 +label Label_ADAD ComputePlayerOverlapBits_OnNonnegative_ADAD +label Label_ADAF ComputePlayerOverlapBits_OnNonzero_ADAF +label Label_ADB1 ComputePlayerOverlapBits_OnCarryClear_ADB1 +label Label_ADC2 ComputePlayerOverlapBits_JoinBranchPaths_ADC2 +label Label_AE01 ComputePlayerOverlapBits_OnCarrySet_AE01 +label Label_AE03 ComputePlayerOverlapBits_OnNonzero_AE03 +label Label_AE0B ComputePlayerOverlapBits_OnNegative_AE0B +label Label_AE0F ComputePlayerOverlapBits_JoinBranchPaths_AE0F +label Label_AE11 ComputePlayerOverlapBits_OnNonzero_AE11 +label Label_AE15 ComputePlayerOverlapBits_OnCarryClear_AE15 +label Label_AE16 ComputePlayerOverlapBits_OnZero_AE16 +label Label_AE45 SetDefaultOverlapBits +label Label_AE51 SetDefaultOverlapBits_OnNonzero_AE51 +label Label_AE53 SetDefaultOverlapBits_OnNonzero_AE53 +label Label_AE56 SetDefaultOverlapBits_OnCarryClear_AE56 +label Label_AE63 SetDefaultOverlapBits_OnCarrySet_AE63 +label Label_AE72 SetDefaultOverlapBits_OnCarrySet_AE72 +label Label_AE80 SetDefaultOverlapBits_OnNegative_AE80 +label Label_AE82 SetDefaultOverlapBits_OnNonzero_AE82 +label Label_AE88 SetDefaultOverlapBits_OnCarrySet_AE88 +label Label_AE90 SetDefaultOverlapBits_OnNegative_AE90 +label Label_AE92 SetDefaultOverlapBits_OnNonzero_AE92 +label Label_AE96 SetDefaultOverlapBits_OnNonzero_AE96 +label Label_AE9B ComputeEdgeOverlapBits +label Label_AEBE ComputeEdgeOverlapBits_OnNonzero_AEBE +label Label_AECA ComputeEdgeOverlapBits_JoinBranchPaths_AECA +label Label_AEDC ComputeEdgeOverlapBits_JoinBranchPaths_AEDC +label Label_AEE3 ComputeEdgeOverlapBits_OnZero_AEE3 +label Label_AEE9 ComputeEdgeOverlapBits_JoinBranchPaths_AEE9 +label Label_AEEA ComputeEdgeOverlapBits_JoinBranchPaths_AEEA +label Label_AEFA ComputeEdgeOverlapBits_OnZero_AEFA +label Label_AF01 ComputeEdgeOverlapBits_JoinBranchPaths_AF01 +label Label_AF24 ComputeEdgeOverlapBits_JoinBranchPaths_AF24 +label Label_AF25 InitializeSoundEngine +label Label_AF3B UpdateSoundFrame +label Label_AF40 UpdateAllSoundChannels +label Label_AF43 UpdateSoundChannel +label Label_AF55 AdvanceSoundChannelNote +label Label_AF68 UpdateSoundChannel_JoinBranchPaths_AF68 +label Label_AF69 WriteSoundChannelState +label Label_AF6B RebuildApuEnableMask +label Label_AF73 StartSoundChannelNote +label Label_AFAB AdvanceSoundSequencePointer +label Label_AFC5 ComputeEnvelopeMask +label Label_AFD5 ComputeEnvelopeMask_OnZero_AFD5 +label Label_AFD9 ComputeTonePeriod +label Label_B000 ShiftNoteTableIndex +label Label_B007 WriteToneRegisters +label Label_B028 ComputeTonePeriod_OnCarrySet_B028 +label Label_B029 WriteFixedToneRegisters +label Label_B036 ComputeTonePeriod_OnCarrySet_B036 +label Label_B037 ComputeTonePeriod_OnCarrySet_B037 +label Label_B03A ReadNoteDuration +label Label_B049 StoreNoteDuration +label Label_B058 ReadNoteDuration_OnZero_B058 +label Label_B059 StoreShortNoteDuration +label Label_B05D BuildApuChannelMask +label Label_B062 WriteApuEnable +label Label_B069 WriteApuEnable_OnNegative_B069 +label Label_B06C ApplySoundCommand +label Label_B083 WriteApuControlRegister +label Label_B08C AdvanceSoundSequenceStep +label Label_B08E AdvanceSoundSequenceStepAlt +label Label_B095 ReturnFromSoundCommand +label Label_B096 ReadLoopFlag +label Label_B09D HandleNoteTerminator +label Label_B0A9 HandleSustainCounter +label Label_B0B3 LoadSoundSequenceStep +label Label_B0BB LoadSoundSequenceStep_OnCarrySet_B0BB +label Label_B0C6 DecrementSustainCounter diff --git a/_wip/MUSCLE (U)/copilot/linker.cfg b/_wip/MUSCLE (U)/copilot/linker.cfg index d9d421d..03f77f3 100644 --- a/_wip/MUSCLE (U)/copilot/linker.cfg +++ b/_wip/MUSCLE (U)/copilot/linker.cfg @@ -1,6 +1,10 @@ MEMORY { - PRG: start = $C000, size = $4000, file = %O, fill = yes; + HEADER: start = $0000, size = $0010, fill = yes; + PRG: start = $8000, size = $4000, file = %O, fill = yes; + CHR: start = $0000, size = $2000, file = %O, fill = yes; } SEGMENTS { - PRG: load = PRG, type = ro; -} + HEADER: load = HEADER, type = ro; + PRG: load = PRG, type = ro; + CHR: load = CHR, type = ro; +} \ No newline at end of file diff --git a/_wip/MUSCLE (U)/copilot/locals.inc b/_wip/MUSCLE (U)/copilot/locals.inc index f38a220..a7f9b3f 100644 --- a/_wip/MUSCLE (U)/copilot/locals.inc +++ b/_wip/MUSCLE (U)/copilot/locals.inc @@ -1,2 +1,169 @@ -; MUSCLE (U) zero-page aliases (declared during Pass 2). -; These intentionally conservative names will be refined in Passes 2 and 3. +; MUSCLE (U) application-specific RAM aliases - Pass 2 +; Generated from every direct zero-page operand in reachable code. +; Names come from observed usage; `ZpXX` marks storage whose role is not yet +; unique enough for a behavioural name. Ref counts are reads/writes and the +; trailing list shows the first referencing addresses. + +ActionCooldown = $65 ; 7 refs; reads=5 writes=2 used at $8235, 82A7, A729, A752, +3 more ; Frames to wait before the main loop resumes object updates +ActorFieldOffset = $23 ; 5 refs; reads=2 writes=3 used at $9A2E, 9A34, 9A7C, A272, +1 more ; Second per-actor offset used by the bytecode handlers +ActorIndex = $1E ; 86 refs; reads=66 writes=20 used at $83A9, 83AB, 83B9, 8496, +74 more ; Active player/actor slot (0 or 1) used as an array index +ActorPosXLo = $34 ; 4 refs; reads=0 writes=4 used at $81AF, 8253, 9A26, 9A30 ; Per-actor 16-bit X scratch, written by the bytecode handlers +ActorSlotOffset = $21 ; 32 refs; reads=27 writes=5 used at $9310, 9383, 93EC, 942C, +27 more ; ActorIndex*4; byte offset into the per-actor record arrays +ActorSlotOffsetHi = $22 ; 11 refs; reads=8 writes=3 used at $94A3, 94ED, 9513, 957D, +7 more ; High half of the per-actor record offset +ApuEnableMask = $E8 ; 4 refs; reads=2 writes=2 used at $AF2A, AF6B, B05D, B069 ; Bit mask of currently enabled APU channels +ApuRegisterOffset = $E4 ; 6 refs; reads=5 writes=1 used at $AF47, AF95, AFA0, B00F, +2 more ; Channel*4, the offset added to $4000/$4001/$4002/$4003 +BytecodeHandlerPointerHi = $1D ; 26 refs; reads=8 writes=18 used at $8C1A, 8C24, 94A1, 957B, +19 more ; Hi byte of the handler address consumed by jmp ($001C) +BytecodeHandlerPointerLo = $1C ; 54 refs; reads=20 writes=34 used at $8C16, 8C29, 8C3C, 937F, +42 more ; Lo byte of the handler address consumed by jmp ($001C) +BytecodeStreamPointerHi = $1B ; 19 refs; reads=8 writes=11 used at $9AE4, 9B74, 9B78, 9B7C, +10 more ; Hi byte of the token-stream pointer +BytecodeStreamPointerLo = $1A ; 28 refs; reads=15 writes=13 used at $8C69, 8C86, 8C9B, 8C9D, +18 more ; Lo byte of the token-stream pointer, loaded from the $8CEF table +CollisionFlagBits = $15 ; 53 refs; reads=19 writes=34 used at $89E8, 8A12, 8A16, 8B48, +42 more ; Accumulator for the overlap bit flags OR-ed together by ComputePlayerOverlapBits +ControllerButtonMask = $F2 ; 7 refs; reads=6 writes=1 used at $9AAE, 9F6C, 9F7F, A283, +3 more ; Filtered button bits for this read, per player +ControllerButtonMask2 = $F3 ; 2 refs; reads=2 writes=0 used at $A2B3, A2C1 ; Filtered button bits, second player +ControllerButtons1 = $FA ; 25 refs; reads=19 writes=6 used at $8028, 8682, 87D1, 8849, +19 more ; Raw button byte for player 1 (shadows $4010/$4011 at reset) +ControllerButtons2 = $FB ; 4 refs; reads=3 writes=1 used at $802A, 8948, 8956, 896B ; Raw button byte for player 2 (shadows $4010/$4011 at reset) +ControllerButtonsPrev = $F4 ; 12 refs; reads=11 writes=1 used at $8688, 87D7, 884F, 8864, +8 more ; Previous read's button byte, for edge detection +ControllerButtonsPrev2 = $F5 ; 4 refs; reads=4 writes=0 used at $895C, 8971, A2AF, A2BD ; Previous read's button byte, second player +ControllerDPad1 = $F6 ; 26 refs; reads=19 writes=7 used at $8169, 92E8, 92EC, 9594, +22 more ; Directional bits derived from the button byte +ControllerDPad2 = $F7 ; 13 refs; reads=11 writes=2 used at $816B, 95B8, 9708, 980B, +8 more ; Directional bits derived from the button byte +ControllerFaceButtons1 = $F8 ; 8 refs; reads=1 writes=7 used at $816D, 92EE, 9A49, 9E76, +4 more ; Face-button bits derived from the button byte +ControllerFaceButtons2 = $F9 ; 1 refs; reads=0 writes=1 used at $816F ; Face-button bits derived from the button byte +DestinationPointerHi = $13 ; 48 refs; reads=20 writes=28 used at $8050, 89E0, 8A06, 8A0A, +36 more ; Hi byte of the VRAM destination pointer +DestinationPointerLo = $12 ; 66 refs; reads=25 writes=41 used at $804C, 805B, 8064, 806E, +54 more ; Lo byte of the VRAM destination pointer +FrameCounterHi = $25 ; 3 refs; reads=1 writes=2 used at $80BB, 86E1 ; High byte of the 16-bit frame counter +FrameCounterLo = $24 ; 21 refs; reads=19 writes=2 used at $80B9, 8669, 86DD, 8787, +16 more ; Low byte of the 16-bit frame counter, incremented once per NMI +PlayerActionState = $F0 ; 37 refs; reads=20 writes=17 used at $81B5, 8241, 8257, 8290, +33 more ; Per-player action/animation state byte ($80..$FF) +PlayerActionState2 = $F1 ; 8 refs; reads=5 writes=3 used at $81B7, 8259, 825F, 8278, +4 more ; Per-player second action state byte +PlayerActiveFlag = $78 ; 15 refs; reads=13 writes=2 used at $9B80, 9D97, 9E0E, A06A, +9 more ; Per-player "still alive / facing right" flag gating the overlap test +PlayerBoxOriginX = $6E ; 9 refs; reads=4 writes=5 used at $A821, A825, A850, A85E, +3 more ; Player 1 hitbox origin used by the overlap test +PlayerBoxOriginY = $70 ; 10 refs; reads=6 writes=4 used at $A807, A80B, A810, A816, +4 more ; Player 1 hitbox origin used by the overlap test +PlayerCount = $94 ; 7 refs; reads=6 writes=1 used at $8377, 83D1, 8440, 8493, +3 more ; 0 = one player, 1 = two players +PlayerFlashTimer = $8B ; 8 refs; reads=2 writes=6 used at $97E6, AD77, AD7E, AD82, +3 more ; Per-player damage-flash countdown +PlayerPaletteIndex = $2A ; 9 refs; reads=7 writes=2 used at $809A, 9306, 930A, 99E5, +5 more ; Per-player palette slot table +PlayerPaletteIndexHi = $92 ; 5 refs; reads=3 writes=2 used at $81E2, 8A2C, 8A3A, 8AC9 ; High byte of the player palette index pair +PlayerPaletteIndexLo = $91 ; 5 refs; reads=2 writes=3 used at $81E4, 8A49, 8AC1, 8AC7 ; Low byte of the player palette index pair +PlayerPosXLo1 = $3A ; 11 refs; reads=8 writes=3 used at $81E8, 9964, 9A80, 9CC1, +6 more ; Player 1 X position, low byte +PlayerPosXLo2 = $3E ; 8 refs; reads=5 writes=3 used at $81F0, 9A7E, 9CC4, A3B4, +2 more ; Player 2 X position, low byte +PlayerPosYLo1 = $3C ; 39 refs; reads=30 writes=9 used at $81EC, 959C, 95B3, 95CC, +29 more ; Player 1 Y position, low byte +PlayerPosYLo2 = $40 ; 39 refs; reads=28 writes=11 used at $81F4, 95A8, 95B0, 95C0, +25 more ; Player 2 Y position, low byte +PlayerSpriteIndex1 = $26 ; 7 refs; reads=4 writes=3 used at $809C, 818E, 819D, 8C14, +3 more ; Per-player sprite slot table, first plane +PlayerSpriteIndex2 = $27 ; 2 refs; reads=1 writes=1 used at $80A2, 8C18 ; Per-player sprite slot table, second plane +PlayerSpriteIndex3 = $28 ; 1 refs; reads=0 writes=1 used at $80A7 ; Per-player sprite slot table, third plane +PlayerSpriteIndex4 = $29 ; 1 refs; reads=0 writes=1 used at $80AA ; Per-player sprite slot table, fourth plane +PlayerTileIndex = $2B ; 1 refs; reads=0 writes=1 used at $80A5 ; Per-player tile slot table +PpuCtrlShadow = $FC ; 10 refs; reads=6 writes=4 used at $8649, 8BFA, A543, A57D, +6 more ; Shadow of the last value written to $2000 +PpuMaskShadow = $FD ; 4 refs; reads=1 writes=3 used at $8650, AAD2, AAE6, ABDF ; Shadow of the last value written to $2001 +PpuScrollX = $FE ; 33 refs; reads=19 writes=14 used at $80D8, 80EC, 8461, 86A0, +19 more ; Shadow of the first $2005 write +PpuScrollY = $FF ; 2 refs; reads=1 writes=1 used at $8031, ABEC ; Shadow of the second $2005 write +RoundTransitionTimer = $8D ; 5 refs; reads=3 writes=2 used at $81BB, 877C, 8780, 8AA5 ; Decremented by the round-transition state +ScreenTransitionState = $68 ; 9 refs; reads=5 writes=4 used at $A763, A781, A7AB, A831, +5 more ; 0 = idle, negative = entering, positive = leaving +ScriptArgHi = $48 ; 7 refs; reads=6 writes=1 used at $9DD8, A54A, A559, A56B, +3 more ; Per-actor bytecode argument, high byte +ScriptArgLo = $47 ; 7 refs; reads=6 writes=1 used at $9DD6, A54F, A55E, A570, +3 more ; Per-actor bytecode argument, low byte +ScriptCounterA = $43 ; 9 refs; reads=3 writes=6 used at $944C, 950E, 9699, 9AD3, +4 more ; Per-actor bytecode counter A +ScriptCounterC = $45 ; 7 refs; reads=1 writes=6 used at $9DAE, 9E43, 9E6E, A51D, +3 more ; Per-actor bytecode counter C +ScriptFlags = $41 ; 6 refs; reads=1 writes=5 used at $824F, 8AA2, 94CA, 9A3C, +2 more ; Script state byte selected by the bytecode SelectActorSlot handlers +ScriptFlagsHi = $4E ; 8 refs; reads=6 writes=2 used at $958A, 96CE, 97FC, 98BA, +4 more ; High byte; tested non-zero to gate several bytecode handlers +ScriptFlagsLo = $4D ; 4 refs; reads=1 writes=3 used at $9A3A, 9CBD, 9D4C, A406 ; Low byte of the 16-bit script flag pair +SoundChannelStep1 = $D0 ; 23 refs; reads=7 writes=16 used at $8321, 847D, 848D, 8555, +17 more ; APU channel 1 step index into its note table +SoundChannelStep2 = $D1 ; 13 refs; reads=2 writes=11 used at $82EB, 8323, 847F, 8557, +8 more ; APU channel 2 step index into its note table +SoundChannelStep3 = $D2 ; 7 refs; reads=1 writes=6 used at $8325, 8481, 8559, 858A, +2 more ; APU channel 3 step index into its note table +SoundChannelStep4 = $D3 ; 6 refs; reads=1 writes=5 used at $82F7, 8327, 855B, A4DF, +2 more ; APU channel 4 step index into its note table +SoundEnvelopeMaskHi = $ED ; 4 refs; reads=1 writes=3 used at $AF93, AFD2, AFD6 ; Computed envelope bits OR-ed into $4000, high part +SoundEnvelopeMode1 = $C4 ; 4 refs; reads=3 writes=1 used at $AF86, AFC6, AFDA, B079 ; APU channel 1 envelope/tone mode nibble +SoundEnvelopeValue1 = $CC ; 2 refs; reads=1 writes=1 used at $AF82, B04B ; APU channel 1 envelope byte read from the sequence +SoundLastCtrlWrite1 = $E0 ; 5 refs; reads=3 writes=2 used at $AF9A, B00D, B07F, B085, +1 more ; Last value written to $4000+4*channel, channel 1 +SoundMuted = $E9 ; 8 refs; reads=5 writes=3 used at $80B7, 822B, 8677, 8698, +4 more ; Bit 7 set suppresses writes to $4015 (write during rendering) +SoundNoteTimer1 = $C8 ; 7 refs; reads=3 writes=4 used at $AF51, B049, B051, B054, +1 more ; APU channel 1 note duration countdown +SoundReadPointerHi = $EF ; 7 refs; reads=2 writes=5 used at $AF7C, AFAD, AFB5, AFC0, +1 more ; Hi byte of the sound sequence read cursor +SoundReadPointerLo = $EE ; 18 refs; reads=12 writes=6 used at $AF5A, AF78, AF80, AF89, +11 more ; Lo byte of the sound sequence read cursor +SoundSequencePtrHi1 = $D8 ; 11 refs; reads=2 writes=9 used at $8305, 8469, 8539, 8572, +7 more ; APU channel 1 sequence pointer, high byte +SoundSequencePtrHi2 = $D9 ; 9 refs; reads=0 writes=9 used at $82E7, 830D, 8471, 8541, +5 more ; APU channel 2 sequence pointer, high byte +SoundSequencePtrHi3 = $DA ; 4 refs; reads=0 writes=4 used at $8315, 8479, 8549, 8582 ; APU channel 3 sequence pointer, high byte +SoundSequencePtrHi4 = $DB ; 4 refs; reads=0 writes=4 used at $82F3, 831D, 8551, A4EB ; APU channel 4 sequence pointer, high byte +SoundSequencePtrLo1 = $D4 ; 11 refs; reads=2 writes=9 used at $8301, 8465, 8535, 856E, +7 more ; APU channel 1 sequence pointer, low byte +SoundSequencePtrLo2 = $D5 ; 9 refs; reads=0 writes=9 used at $82E3, 8309, 846D, 853D, +5 more ; APU channel 2 sequence pointer, low byte +SoundSequencePtrLo3 = $D6 ; 4 refs; reads=0 writes=4 used at $8311, 8475, 8545, 857E ; APU channel 3 sequence pointer, low byte +SoundSequencePtrLo4 = $D7 ; 4 refs; reads=0 writes=4 used at $82EF, 8319, 854D, A4E7 ; APU channel 4 sequence pointer, low byte +SoundSustainCounter1 = $DC ; 9 refs; reads=4 writes=5 used at $AFA7, B0A9, B0B1, B0BF, +2 more ; APU channel 1 sustain/release counter +SoundTonePeriodHi = $EB ; 7 refs; reads=3 writes=4 used at $AFF2, B000, B014, B01A, +2 more ; Computed tone period, high byte +SoundTonePeriodLo = $EA ; 5 refs; reads=2 writes=3 used at $AFED, B002, B01C, B02E ; Computed tone period, low byte +SoundVolume1 = $80 ; 4 refs; reads=1 writes=3 used at $99DD, 9F72, 9F79, AACA ; APU channel 1 volume +SoundVolume3 = $82 ; 9 refs; reads=1 writes=8 used at $81A9, 94C2, 9620, 975B, +5 more ; APU channel 3 volume +SoundVolume4 = $83 ; 1 refs; reads=0 writes=1 used at $81AB ; APU channel 4 volume +SourcePointerHi = $11 ; 48 refs; reads=9 writes=39 used at $8048, 80C9, 80F4, 8405, +41 more ; Hi byte of the compressed VRAM/attribute stream pointer +SourcePointerLo = $10 ; 131 refs; reads=42 writes=89 used at $8044, 8052, 80C5, 80F0, +123 more ; Lo byte of the compressed VRAM/attribute stream pointer +StreamBlockCountHi = $15 ; 2 refs; reads=1 writes=1 used at $ACDE, ACE2 +SubModeFlag = $96 ; 3 refs; reads=1 writes=2 used at $8488, 855F, 86FA ; $FF entering a sub-mode, $01 leaving it, 0 idle +VramBlockCountLo = $14 ; 50 refs; reads=24 writes=26 used at $83B1, 89E4, 8A0C, 8A10, +40 more ; Low byte of the 16-bit block counter advanced by AdvanceCountWord +Zp00 = $00 ; 1 refs; reads=0 writes=1 used at $8173 +Zp16 = $16 ; 28 refs; reads=11 writes=17 used at $89F1, 8B19, 8B20, 8B6B, +20 more +Zp17 = $17 ; 17 refs; reads=8 writes=9 used at $8C45, 8C65, 8C91, 8C9F, +11 more +Zp18 = $18 ; 61 refs; reads=23 writes=38 used at $84B7, 85AC, 89F5, 8C53, +42 more +Zp19 = $19 ; 47 refs; reads=21 writes=26 used at $84B5, 85B4, 8C70, 8CA6, +35 more +Zp1F = $1F ; 6 refs; reads=2 writes=4 used at $9BAE, 9BCD, 9BD7, 9BEF +Zp20 = $20 ; 6 refs; reads=2 writes=4 used at $9BB2, 9BC4, 9BDB, 9BEB +Zp2C = $2C ; 2 refs; reads=1 writes=1 used at $A1C7, A24E +Zp2D = $2D ; 5 refs; reads=2 writes=3 used at $8128, 8130, 815A, 8162, +1 more +Zp2F = $2F ; 4 refs; reads=2 writes=2 used at $80AE, A01F, A037 +Zp30 = $30 ; 2 refs; reads=0 writes=2 used at $80B0, 850B +Zp33 = $33 ; 4 refs; reads=3 writes=1 used at $96D6, 9704, 9863 +Zp37 = $37 ; 5 refs; reads=3 writes=2 used at $96D9, 9701, 9865 +Zp38 = $38 ; 2 refs; reads=0 writes=2 used at $81B1, 828A +Zp3B = $3B ; 13 refs; reads=12 writes=1 used at $9599, 95C9, 96E2, 9719, +9 more +Zp3F = $3F ; 14 refs; reads=11 writes=3 used at $95A5, 95BD, 96EE, 970D, +8 more +Zp42 = $42 ; 2 refs; reads=0 writes=2 used at $8286, AA53 +Zp4B = $4B ; 26 refs; reads=13 writes=13 used at $92C2, 92C8, 92D8, 92DD, +14 more +Zp4F = $4F ; 28 refs; reads=16 writes=12 used at $81A5, 8239, 823F, 83AD, +22 more +Zp50 = $50 ; 7 refs; reads=4 writes=3 used at $81A7, 8270, 8276, 8793, +2 more +Zp51 = $51 ; 9 refs; reads=1 writes=8 used at $938D, 93F9, 956C, 9607, +5 more +Zp52 = $52 ; 4 refs; reads=2 writes=2 used at $A672, A687, A695, A6ED +Zp53 = $53 ; 3 refs; reads=2 writes=1 used at $A684, A69F, A6C2 +Zp54 = $54 ; 3 refs; reads=2 writes=1 used at $A681, A6A7, A6CD +Zp55 = $55 ; 5 refs; reads=2 writes=3 used at $A68B, A69B, A6BE +Zp56 = $56 ; 1 refs; reads=1 writes=0 used at $A678 +Zp5A = $5A ; 13 refs; reads=7 writes=6 used at $9423, 9446, 944E, 9454, +9 more +Zp5C = $5C ; 3 refs; reads=1 writes=2 used at $94BB, 9C06 +Zp5E = $5E ; 4 refs; reads=1 writes=3 used at $9A6F, 9AD0, 9C0E +Zp60 = $60 ; 6 refs; reads=2 writes=4 used at $9525, 953E, 9544, A4DA +Zp62 = $62 ; 9 refs; reads=3 writes=6 used at $952E, 954A, 961E, 978E, +5 more +Zp64 = $64 ; 4 refs; reads=3 writes=1 used at $826E, A737, A76D, A78F +Zp66 = $66 ; 2 refs; reads=1 writes=1 used at $A767, A791 +Zp67 = $67 ; 2 refs; reads=1 writes=1 used at $A773, A795 +Zp69 = $69 ; 6 refs; reads=2 writes=4 used at $A789, A7B2, A7C7, A7E5, +1 more +Zp6A = $6A ; 3 refs; reads=1 writes=2 used at $A78D, A7B8 +Zp6B = $6B ; 8 refs; reads=5 writes=3 used at $A7CE, A7D3, A7E8, A7ED, +3 more +Zp6C = $6C ; 10 refs; reads=5 writes=5 used at $A785, A7D5, A7D9, A7E1, +5 more +Zp6D = $6D ; 2 refs; reads=1 writes=1 used at $A81A, A81F +Zp6F = $6F ; 4 refs; reads=2 writes=2 used at $A800, A805, A88A, A91B +Zp71 = $71 ; 3 refs; reads=1 writes=2 used at $A81D, A886 +Zp72 = $72 ; 3 refs; reads=1 writes=2 used at $A823, A862 +Zp73 = $73 ; 4 refs; reads=1 writes=3 used at $A803, A87E, A8C6 +Zp74 = $74 ; 4 refs; reads=1 writes=3 used at $A809, A882, A8CC +Zp75 = $75 ; 3 refs; reads=2 writes=1 used at $A8D3, A8D6, A8DB +Zp76 = $76 ; 2 refs; reads=1 writes=1 used at $A8DD, A8E5 +Zp77 = $77 ; 2 refs; reads=1 writes=1 used at $A75B, AC0F +Zp7A = $7A ; 24 refs; reads=12 writes=12 used at $9293, 92A2, 92B2, 92CD, +9 more +Zp7C = $7C ; 3 refs; reads=1 writes=2 used at $9470, 9477 +Zp7E = $7E ; 2 refs; reads=1 writes=1 used at $9472, 947B +Zp84 = $84 ; 7 refs; reads=3 writes=4 used at $A347, A381, A9AB, A9CB, +2 more +Zp85 = $85 ; 9 refs; reads=6 writes=3 used at $A362, A9B4, A9B9, A9C3, +5 more +Zp86 = $86 ; 6 refs; reads=3 writes=3 used at $A368, A9BB, A9BF, A9F1, +2 more +Zp87 = $87 ; 2 refs; reads=1 writes=1 used at $A37D, AA0D +Zp88 = $88 ; 7 refs; reads=5 writes=2 used at $92F6, A1B9, A3CB, A9A4, +2 more +Zp8A = $8A ; 9 refs; reads=6 writes=3 used at $8263, 829A, 83BD, 878D, +5 more +Zp8E = $8E ; 4 refs; reads=2 writes=2 used at $8A28, 8AA9, 8AAF +Zp8F = $8F ; 4 refs; reads=2 writes=2 used at $8A58, 8AB1, 8AB7 +Zp90 = $90 ; 4 refs; reads=2 writes=2 used at $8A53, 8AB9, 8ABF +Zp93 = $93 ; 2 refs; reads=1 writes=1 used at $8AE3, A6F8 +Zp95 = $95 ; 5 refs; reads=2 writes=3 used at $8B29, 8B35, 8B63, 8B67 +Zp97 = $97 ; 5 refs; reads=3 writes=2 used at $9BB8, 9BC0, 9BDD, 9BE4, +1 more +Zp98 = $98 ; 1 refs; reads=1 writes=0 used at $9ED7 +Zp99 = $99 ; 1 refs; reads=1 writes=0 used at $9EDC +Zp9B = $9B ; 1 refs; reads=1 writes=0 used at $9EBD +Zp9C = $9C ; 1 refs; reads=1 writes=0 used at $9EC2 +Zp9D = $9D ; 1 refs; reads=1 writes=0 used at $9EC7 +Zp9F = $9F ; 1 refs; reads=1 writes=0 used at $9EA8 +ZpA0 = $A0 ; 1 refs; reads=1 writes=0 used at $9EAD +ZpA1 = $A1 ; 1 refs; reads=1 writes=0 used at $9EB2 +ZpA3 = $A3 ; 1 refs; reads=1 writes=0 used at $9E93 +ZpA4 = $A4 ; 1 refs; reads=1 writes=0 used at $9E98 +ZpA5 = $A5 ; 1 refs; reads=1 writes=0 used at $9E9D diff --git a/_wip/MUSCLE (U)/copilot/prg.s b/_wip/MUSCLE (U)/copilot/prg.s index 8c86c68..d11b2a7 100644 --- a/_wip/MUSCLE (U)/copilot/prg.s +++ b/_wip/MUSCLE (U)/copilot/prg.s @@ -1,12 +1,12922 @@ -; MUSCLE (U) NES disassembly - Pass 1 (skeleton) -; Generated from the supplied 16 KiB PRG image. -; Pass 1 classifies recursively reachable code, inline address tables, vectors, -; and untraced/data regions. All PRG data bytes are emitted explicitly with .byte directives. - +; MUSCLE (U) NES disassembly - Pass 1 +; Byte-oriented ca65 source generated from the supplied PRG image. +; Recursively reachable instructions are emitted explicitly with address/byte comments. +; Unreached bytes remain explicit .byte blocks; no ROM byte is deleted or reformatted. +; Pass 2 replaces address-derived labels, RAM aliases, and table names while +; preserving byte identity. +; +; Vectors: NMI=$86CB RESET=$8000 IRQ=$8764 +; PRG mapped at $8000-$BFFF (NROM, mirrored to the upper half) +; +; Pass 1 trace provenance (the audit trail behind every classification below): +; dispatch table $9237, 40 x 16-bit entries, seeded as routine entries +; dispatch table $AC35, 3 x 16-bit entries, seeded as routine entries +; dispatch table $9F2B, 16 x 16-bit entries, seeded as routine entries +; entries seeded by hand after inspecting code-shaped but unreferenced blocks: +; $8644, $8653, $9CAD, $ABF7 +; $ACBD-$ACC8 forced back to data: the only path into it is a branch that is always taken +; indirect dispatch through zero page (not followed statically): +; jmp ($001C) at $9B05 +; jmp ($0010) at $AC32 +; .setcpu "6502" .include "symbols.inc" .include "locals.inc" .segment "PRG" -.incbin "prg.bin", $0000, $4000 + +; ----------------------------------------------------------------------------- +; Routine: Reset +; Global: Power-on entry: stack set up, PPU blanked through two vblank waits, APU frame counter silenced, $0300-$032C cleared, then the initial nametable stream is decoded into $0400 and the first stage is started. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +Reset: + sei ; CPU:$8000 PRG:0000 78 + ldx #$FF ; CPU:$8001 PRG:0001 A2 FF + stx $0320 ; CPU:$8003 PRG:0003 8E 20 03 + txs ; CPU:$8006 PRG:0006 9A + cld ; CPU:$8007 PRG:0007 D8 + lda #$00 ; CPU:$8008 PRG:0008 A9 00 + sta $2000 ; CPU:$800A PRG:000A 8D 00 20 + nop ; CPU:$800D PRG:000D EA +; ----------------------------------------------------------------------------- +; Routine: WaitForFirstPpuWarmup +; Global: Spin on $2002 until bit 7 is set, so the write to $2000 just before it has taken effect. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WaitForFirstPpuWarmup: + lda $2002 ; CPU:$800E PRG:000E AD 02 20 + bpl WaitForFirstPpuWarmup ; CPU:$8011 PRG:0011 10 FB + lda #$00 ; CPU:$8013 PRG:0013 A9 00 + sta $2000 ; CPU:$8015 PRG:0015 8D 00 20 + nop ; CPU:$8018 PRG:0018 EA +; ----------------------------------------------------------------------------- +; Routine: WaitForSecondPpuWarmup +; Global: Second vblank wait, this time before touching $4017/$4010. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WaitForSecondPpuWarmup: + lda $2002 ; CPU:$8019 PRG:0019 AD 02 20 + bpl WaitForSecondPpuWarmup ; CPU:$801C PRG:001C 10 FB + lda #$40 ; CPU:$801E PRG:001E A9 40 + sta $4017 ; CPU:$8020 PRG:0020 8D 17 40 + lda #$00 ; CPU:$8023 PRG:0023 A9 00 + sta $4010 ; CPU:$8025 PRG:0025 8D 10 40 + sta ControllerButtons1 ; CPU:$8028 PRG:0028 85 FA + sta ControllerButtons2 ; CPU:$802A PRG:002A 85 FB +; ----------------------------------------------------------------------------- +; Routine: InitializeGameState +; Global: Reset the game-state bytes at $0326/$032B/$032C and zero page $FF, clear $0300-$032C, then decode the compressed nametable pointed at by SourcePointerLo/Hi. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeGameState: + lda #$00 ; CPU:$802C PRG:002C A9 00 + sta $0326 ; CPU:$802E PRG:002E 8D 26 03 + sta PpuScrollY ; CPU:$8031 PRG:0031 85 FF + sta $032B ; CPU:$8033 PRG:0033 8D 2B 03 + sta $032C ; CPU:$8036 PRG:0036 8D 2C 03 + ldx #$2D ; CPU:$8039 PRG:0039 A2 2D +; ----------------------------------------------------------------------------- +; Routine: InitializeGameState_OnNonzero_803B +; Global: InitializeGameState_OnNonzero_803B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeGameState_OnNonzero_803B: + sta $0300,x ; CPU:$803B PRG:003B 9D 00 03 + inx ; CPU:$803E PRG:003E E8 + bne InitializeGameState_OnNonzero_803B ; CPU:$803F PRG:003F D0 FA + tay ; CPU:$8041 PRG:0041 A8 + lda #$9E ; CPU:$8042 PRG:0042 A9 9E + sta SourcePointerLo ; CPU:$8044 PRG:0044 85 10 + lda #$B8 ; CPU:$8046 PRG:0046 A9 B8 + sta SourcePointerHi ; CPU:$8048 PRG:0048 85 11 + lda #$00 ; CPU:$804A PRG:004A A9 00 + sta DestinationPointerLo ; CPU:$804C PRG:004C 85 12 + lda #$04 ; CPU:$804E PRG:004E A9 04 + sta DestinationPointerHi ; CPU:$8050 PRG:0050 85 13 +; ----------------------------------------------------------------------------- +; Routine: UpdateNametableFromStream +; Global: Decode the compressed nametable stream at (SourcePointerLo/Hi) into (DestinationPointerLo/Hi). A byte with bit 7 clear is a run of (byte & $7F) copies of the next stream byte; a byte with bit 7 set is a literal, written only when it differs from what is already at the destination. $0346 is set whenever VRAM actually changed. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateNametableFromStream: + lda (SourcePointerLo),y ; CPU:$8052 PRG:0052 B1 10 + beq UpdateNametableFromStream_OnZero_8080 ; CPU:$8054 PRG:0054 F0 2A + bpl UpdateNametableFromStream_OnNonnegative_806E ; CPU:$8056 PRG:0056 10 16 + and #$7F ; CPU:$8058 PRG:0058 29 7F + tax ; CPU:$805A PRG:005A AA +; ----------------------------------------------------------------------------- +; Routine: UpdateNametableFromStream_OnNonzero_805B +; Global: UpdateNametableFromStream_OnNonzero_805B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateNametableFromStream_OnNonzero_805B: + lda (DestinationPointerLo),y ; CPU:$805B PRG:005B B1 12 + beq UpdateNametableFromStream_OnZero_8066 ; CPU:$805D PRG:005D F0 07 + sta $0346 ; CPU:$805F PRG:005F 8D 46 03 + lda #$00 ; CPU:$8062 PRG:0062 A9 00 + sta (DestinationPointerLo),y ; CPU:$8064 PRG:0064 91 12 +; ----------------------------------------------------------------------------- +; Routine: UpdateNametableFromStream_OnZero_8066 +; Global: UpdateNametableFromStream_OnZero_8066.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateNametableFromStream_OnZero_8066: + jsr $ACC9 ; CPU:$8066 PRG:0066 20 C9 AC + dex ; CPU:$8069 PRG:0069 CA + bne UpdateNametableFromStream_OnNonzero_805B ; CPU:$806A PRG:006A D0 EF + beq UpdateNametableFromStream_OnZero_807A ; CPU:$806C PRG:006C F0 0C +; ----------------------------------------------------------------------------- +; Routine: UpdateNametableFromStream_OnNonnegative_806E +; Global: UpdateNametableFromStream_OnNonnegative_806E.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateNametableFromStream_OnNonnegative_806E: + cmp (DestinationPointerLo),y ; CPU:$806E PRG:006E D1 12 + beq UpdateNametableFromStream_OnZero_8077 ; CPU:$8070 PRG:0070 F0 05 + sta (DestinationPointerLo),y ; CPU:$8072 PRG:0072 91 12 + sta $0346 ; CPU:$8074 PRG:0074 8D 46 03 +; ----------------------------------------------------------------------------- +; Routine: UpdateNametableFromStream_OnZero_8077 +; Global: UpdateNametableFromStream_OnZero_8077.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateNametableFromStream_OnZero_8077: + jsr $ACC9 ; CPU:$8077 PRG:0077 20 C9 AC +; ----------------------------------------------------------------------------- +; Routine: UpdateNametableFromStream_OnZero_807A +; Global: UpdateNametableFromStream_OnZero_807A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateNametableFromStream_OnZero_807A: + jsr $AC88 ; CPU:$807A PRG:007A 20 88 AC + jmp $8052 ; CPU:$807D PRG:007D 4C 52 80 +; ----------------------------------------------------------------------------- +; Routine: UpdateNametableFromStream_OnZero_8080 +; Global: UpdateNametableFromStream_OnZero_8080.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateNametableFromStream_OnZero_8080: + lda $0346 ; CPU:$8080 PRG:0080 AD 46 03 + beq UpdateNametableFromStream_OnZero_8094 ; CPU:$8083 PRG:0083 F0 0F + lda #$40 ; CPU:$8085 PRG:0085 A9 40 + sta $0328 ; CPU:$8087 PRG:0087 8D 28 03 + lda #$0D ; CPU:$808A PRG:008A A9 0D + sta $0329 ; CPU:$808C PRG:008C 8D 29 03 + lda #$03 ; CPU:$808F PRG:008F A9 03 + sta $032A ; CPU:$8091 PRG:0091 8D 2A 03 +; ----------------------------------------------------------------------------- +; Routine: UpdateNametableFromStream_OnZero_8094 +; Global: UpdateNametableFromStream_OnZero_8094.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateNametableFromStream_OnZero_8094: + ldx #$FF ; CPU:$8094 PRG:0094 A2 FF + stx $0324 ; CPU:$8096 PRG:0096 8E 24 03 + inx ; CPU:$8099 PRG:0099 E8 + stx PlayerPaletteIndex ; CPU:$809A PRG:009A 86 2A + stx PlayerSpriteIndex1 ; CPU:$809C PRG:009C 86 26 + inx ; CPU:$809E PRG:009E E8 + stx $0325 ; CPU:$809F PRG:009F 8E 25 03 + stx PlayerSpriteIndex2 ; CPU:$80A2 PRG:00A2 86 27 + inx ; CPU:$80A4 PRG:00A4 E8 + stx PlayerTileIndex ; CPU:$80A5 PRG:00A5 86 2B + stx PlayerSpriteIndex3 ; CPU:$80A7 PRG:00A7 86 28 + inx ; CPU:$80A9 PRG:00A9 E8 + stx PlayerSpriteIndex4 ; CPU:$80AA PRG:00AA 86 29 +; ----------------------------------------------------------------------------- +; Routine: StartStageSequence +; Global: Stage start-up: reset the animation and actor counters, clear the OAM shadow, initialise the sound engine, upload the HUD palette row, and hand control to MainGameLoop. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StartStageSequence: + lda #$19 ; CPU:$80AC PRG:00AC A9 19 + sta Zp2F ; CPU:$80AE PRG:00AE 85 2F + sta Zp30 ; CPU:$80B0 PRG:00B0 85 30 + jsr $AADC ; CPU:$80B2 PRG:00B2 20 DC AA + lda #$00 ; CPU:$80B5 PRG:00B5 A9 00 + sta SoundMuted ; CPU:$80B7 PRG:00B7 85 E9 + sta FrameCounterLo ; CPU:$80B9 PRG:00B9 85 24 + sta FrameCounterHi ; CPU:$80BB PRG:00BB 85 25 + jsr $ABFC ; CPU:$80BD PRG:00BD 20 FC AB + jsr $AF25 ; CPU:$80C0 PRG:00C0 20 25 AF + lda #$B1 ; CPU:$80C3 PRG:00C3 A9 B1 + sta SourcePointerLo ; CPU:$80C5 PRG:00C5 85 10 + lda #$B3 ; CPU:$80C7 PRG:00C7 A9 B3 + sta SourcePointerHi ; CPU:$80C9 PRG:00C9 85 11 + lda #$24 ; CPU:$80CB PRG:00CB A9 24 + jsr $AC78 ; CPU:$80CD PRG:00CD 20 78 AC + jsr $8399 ; CPU:$80D0 PRG:00D0 20 99 83 + jsr $82FA ; CPU:$80D3 PRG:00D3 20 FA 82 + lda #$01 ; CPU:$80D6 PRG:00D6 A9 01 + sta PpuScrollX ; CPU:$80D8 PRG:00D8 85 FE + sta $0322 ; CPU:$80DA PRG:00DA 8D 22 03 + jsr $8639 ; CPU:$80DD PRG:00DD 20 39 86 +; ----------------------------------------------------------------------------- +; Routine: StartStageSequence_OnZero_80E0 +; Global: StartStageSequence_OnZero_80E0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StartStageSequence_OnZero_80E0: + lda $0321 ; CPU:$80E0 PRG:00E0 AD 21 03 + beq StartStageSequence_OnZero_80E0 ; CPU:$80E3 PRG:00E3 F0 FB + bmi InitializeRound ; CPU:$80E5 PRG:00E5 30 7D + jsr $AADC ; CPU:$80E7 PRG:00E7 20 DC AA + lda #$00 ; CPU:$80EA PRG:00EA A9 00 + sta PpuScrollX ; CPU:$80EC PRG:00EC 85 FE + lda #$1E ; CPU:$80EE PRG:00EE A9 1E + sta SourcePointerLo ; CPU:$80F0 PRG:00F0 85 10 + lda #$8A ; CPU:$80F2 PRG:00F2 A9 8A + sta SourcePointerHi ; CPU:$80F4 PRG:00F4 85 11 + jsr $ACF5 ; CPU:$80F6 PRG:00F6 20 F5 AC + lda $0324 ; CPU:$80F9 PRG:00F9 AD 24 03 + bne StartStageSequence_OnNonzero_8105 ; CPU:$80FC PRG:00FC D0 07 + lda #$02 ; CPU:$80FE PRG:00FE A9 02 + sta $032F ; CPU:$8100 PRG:0100 8D 2F 03 + bne StartStageSequence_OnNonzero_810A ; CPU:$8103 PRG:0103 D0 05 +; ----------------------------------------------------------------------------- +; Routine: StartStageSequence_OnNonzero_8105 +; Global: StartStageSequence_OnNonzero_8105.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StartStageSequence_OnNonzero_8105: + lda #$02 ; CPU:$8105 PRG:0105 A9 02 + sta $0337 ; CPU:$8107 PRG:0107 8D 37 03 +; ----------------------------------------------------------------------------- +; Routine: StartStageSequence_OnNonzero_810A +; Global: StartStageSequence_OnNonzero_810A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StartStageSequence_OnNonzero_810A: + lda #$01 ; CPU:$810A PRG:010A A9 01 + sta $032E ; CPU:$810C PRG:010C 8D 2E 03 + jsr $89CE ; CPU:$810F PRG:010F 20 CE 89 + lda #$FF ; CPU:$8112 PRG:0112 A9 FF + sta $0322 ; CPU:$8114 PRG:0114 8D 22 03 + jsr $8639 ; CPU:$8117 PRG:0117 20 39 86 +; ----------------------------------------------------------------------------- +; Routine: StartStageSequence_OnZero_811A +; Global: StartStageSequence_OnZero_811A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StartStageSequence_OnZero_811A: + lda $0321 ; CPU:$811A PRG:011A AD 21 03 + beq StartStageSequence_OnZero_811A ; CPU:$811D PRG:011D F0 FB + lda $0324 ; CPU:$811F PRG:011F AD 24 03 + beq UpdateFadeFlashSprites ; CPU:$8122 PRG:0122 F0 0E + lda #$82 ; CPU:$8124 PRG:0124 A9 82 + sta SourcePointerLo ; CPU:$8126 PRG:0126 85 10 + ldy Zp2D ; CPU:$8128 PRG:0128 A4 2D + jsr $88FF ; CPU:$812A PRG:012A 20 FF 88 + jsr $88FF ; CPU:$812D PRG:012D 20 FF 88 + sty Zp2D ; CPU:$8130 PRG:0130 84 2D +; ----------------------------------------------------------------------------- +; Routine: UpdateFadeFlashSprites +; Global: Push or drop the two flash sprites (palette tiles $82) depending on PlayerCount and the fade state. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateFadeFlashSprites: + lda $0324 ; CPU:$8132 PRG:0132 AD 24 03 + beq InitializeRound ; CPU:$8135 PRG:0135 F0 2D + lda #$82 ; CPU:$8137 PRG:0137 A9 82 + sta SourcePointerLo ; CPU:$8139 PRG:0139 85 10 + ldx $0325 ; CPU:$813B PRG:013B AE 25 03 + dex ; CPU:$813E PRG:013E CA + beq InitializeRound ; CPU:$813F PRG:013F F0 23 + cpx #$03 ; CPU:$8141 PRG:0141 E0 03 + bcc UpdateFadeFlashSprites_OnCarryClear_8154 ; CPU:$8143 PRG:0143 90 0F + jsr $88EB ; CPU:$8145 PRG:0145 20 EB 88 + jsr $88EB ; CPU:$8148 PRG:0148 20 EB 88 + jsr $88F9 ; CPU:$814B PRG:014B 20 F9 88 + jsr $88F9 ; CPU:$814E PRG:014E 20 F9 88 + jmp $8164 ; CPU:$8151 PRG:0151 4C 64 81 +; ----------------------------------------------------------------------------- +; Routine: UpdateFadeFlashSprites_OnCarryClear_8154 +; Global: UpdateFadeFlashSprites_OnCarryClear_8154.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateFadeFlashSprites_OnCarryClear_8154: + jsr $88EB ; CPU:$8154 PRG:0154 20 EB 88 + jsr $88EB ; CPU:$8157 PRG:0157 20 EB 88 + ldy Zp2D ; CPU:$815A PRG:015A A4 2D + jsr $88FF ; CPU:$815C PRG:015C 20 FF 88 + jsr $88FF ; CPU:$815F PRG:015F 20 FF 88 + sty Zp2D ; CPU:$8162 PRG:0162 84 2D +; ----------------------------------------------------------------------------- +; Routine: InitializeRound +; Global: Round initialisation: clear the shadow arrays at zero page $00-$BF, reset the controllers and the OAM shadow, collect the $81/$82 type sprites, set the per-player palette and sprite bases, and start the actors. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeRound: + lda #$00 ; CPU:$8164 PRG:0164 A9 00 + sta $0322 ; CPU:$8166 PRG:0166 8D 22 03 + sta ControllerDPad1 ; CPU:$8169 PRG:0169 85 F6 + sta ControllerDPad2 ; CPU:$816B PRG:016B 85 F7 + sta ControllerFaceButtons1 ; CPU:$816D PRG:016D 85 F8 + sta ControllerFaceButtons2 ; CPU:$816F PRG:016F 85 F9 + ldx #$31 ; CPU:$8171 PRG:0171 A2 31 +; ----------------------------------------------------------------------------- +; Routine: InitializeRound_OnCarryClear_8173 +; Global: InitializeRound_OnCarryClear_8173.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeRound_OnCarryClear_8173: + sta Zp00,x ; CPU:$8173 PRG:0173 95 00 + inx ; CPU:$8175 PRG:0175 E8 + cpx #$C0 ; CPU:$8176 PRG:0176 E0 C0 + bcc InitializeRound_OnCarryClear_8173 ; CPU:$8178 PRG:0178 90 F9 + jsr $AADC ; CPU:$817A PRG:017A 20 DC AA + jsr $ABFC ; CPU:$817D PRG:017D 20 FC AB + jsr $AF25 ; CPU:$8180 PRG:0180 20 25 AF + ldx #$00 ; CPU:$8183 PRG:0183 A2 00 + ldy #$07 ; CPU:$8185 PRG:0185 A0 07 +; ----------------------------------------------------------------------------- +; Routine: InitializeRound_OnNonnegative_8187 +; Global: InitializeRound_OnNonnegative_8187.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeRound_OnNonnegative_8187: + lda $032E,y ; CPU:$8187 PRG:0187 B9 2E 03 + cmp #$81 ; CPU:$818A PRG:018A C9 81 + bne InitializeRound_OnNonzero_8191 ; CPU:$818C PRG:018C D0 03 + sty PlayerSpriteIndex1,x ; CPU:$818E PRG:018E 94 26 + inx ; CPU:$8190 PRG:0190 E8 +; ----------------------------------------------------------------------------- +; Routine: InitializeRound_OnNonzero_8191 +; Global: InitializeRound_OnNonzero_8191.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeRound_OnNonzero_8191: + dey ; CPU:$8191 PRG:0191 88 + bpl InitializeRound_OnNonnegative_8187 ; CPU:$8192 PRG:0192 10 F3 + ldy #$07 ; CPU:$8194 PRG:0194 A0 07 +; ----------------------------------------------------------------------------- +; Routine: InitializeRound_OnNonnegative_8196 +; Global: InitializeRound_OnNonnegative_8196.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeRound_OnNonnegative_8196: + lda $032E,y ; CPU:$8196 PRG:0196 B9 2E 03 + cmp #$82 ; CPU:$8199 PRG:0199 C9 82 + bne InitializeRound_OnNonzero_81A0 ; CPU:$819B PRG:019B D0 03 + sty PlayerSpriteIndex1,x ; CPU:$819D PRG:019D 94 26 + inx ; CPU:$819F PRG:019F E8 +; ----------------------------------------------------------------------------- +; Routine: InitializeRound_OnNonzero_81A0 +; Global: InitializeRound_OnNonzero_81A0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeRound_OnNonzero_81A0: + dey ; CPU:$81A0 PRG:01A0 88 + bpl InitializeRound_OnNonnegative_8196 ; CPU:$81A1 PRG:01A1 10 F3 + lda #$63 ; CPU:$81A3 PRG:01A3 A9 63 + sta Zp4F ; CPU:$81A5 PRG:01A5 85 4F + sta Zp50 ; CPU:$81A7 PRG:01A7 85 50 + sta SoundVolume3 ; CPU:$81A9 PRG:01A9 85 82 + sta SoundVolume4 ; CPU:$81AB PRG:01AB 85 83 + lda #$4D ; CPU:$81AD PRG:01AD A9 4D + sta ActorPosXLo ; CPU:$81AF PRG:01AF 85 34 + sta Zp38 ; CPU:$81B1 PRG:01B1 85 38 + lda #$FD ; CPU:$81B3 PRG:01B3 A9 FD + sta PlayerActionState ; CPU:$81B5 PRG:01B5 85 F0 + sta PlayerActionState2 ; CPU:$81B7 PRG:01B7 85 F1 + lda #$3C ; CPU:$81B9 PRG:01B9 A9 3C + sta RoundTransitionTimer ; CPU:$81BB PRG:01BB 85 8D + ldy #$00 ; CPU:$81BD PRG:01BD A0 00 + lda $0325 ; CPU:$81BF PRG:01BF AD 25 03 + cmp #$21 ; CPU:$81C2 PRG:01C2 C9 21 + bcc InitializeRound_OnCarryClear_81DA ; CPU:$81C4 PRG:01C4 90 14 + cmp #$41 ; CPU:$81C6 PRG:01C6 C9 41 + bcc InitializeRound_OnCarryClear_81DE ; CPU:$81C8 PRG:01C8 90 14 + cmp #$61 ; CPU:$81CA PRG:01CA C9 61 + bcc InitializeRound_OnCarryClear_81D6 ; CPU:$81CC PRG:01CC 90 08 + cmp #$81 ; CPU:$81CE PRG:01CE C9 81 + lda #$01 ; CPU:$81D0 PRG:01D0 A9 01 + bcc InitializeRound_OnCarryClear_81E0 ; CPU:$81D2 PRG:01D2 90 0C + bcs InitializeRound_JoinBranchPaths_81E2 ; CPU:$81D4 PRG:01D4 B0 0C +; ----------------------------------------------------------------------------- +; Routine: InitializeRound_OnCarryClear_81D6 +; Global: InitializeRound_OnCarryClear_81D6.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeRound_OnCarryClear_81D6: + lda #$02 ; CPU:$81D6 PRG:01D6 A9 02 + bne InitializeRound_JoinBranchPaths_81E2 ; CPU:$81D8 PRG:01D8 D0 08 +; ----------------------------------------------------------------------------- +; Routine: InitializeRound_OnCarryClear_81DA +; Global: InitializeRound_OnCarryClear_81DA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeRound_OnCarryClear_81DA: + lda #$03 ; CPU:$81DA PRG:01DA A9 03 + bne InitializeRound_JoinBranchPaths_81E2 ; CPU:$81DC PRG:01DC D0 04 +; ----------------------------------------------------------------------------- +; Routine: InitializeRound_OnCarryClear_81DE +; Global: InitializeRound_OnCarryClear_81DE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeRound_OnCarryClear_81DE: + lda #$02 ; CPU:$81DE PRG:01DE A9 02 +; ----------------------------------------------------------------------------- +; Routine: InitializeRound_OnCarryClear_81E0 +; Global: InitializeRound_OnCarryClear_81E0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeRound_OnCarryClear_81E0: + ldy #$05 ; CPU:$81E0 PRG:01E0 A0 05 +; ----------------------------------------------------------------------------- +; Routine: InitializeRound_JoinBranchPaths_81E2 +; Global: InitializeRound_JoinBranchPaths_81E2.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeRound_JoinBranchPaths_81E2: + sta PlayerPaletteIndexHi ; CPU:$81E2 PRG:01E2 85 92 + sty PlayerPaletteIndexLo ; CPU:$81E4 PRG:01E4 84 91 + lda #$48 ; CPU:$81E6 PRG:01E6 A9 48 + sta PlayerPosXLo1 ; CPU:$81E8 PRG:01E8 85 3A + lda #$60 ; CPU:$81EA PRG:01EA A9 60 + sta PlayerPosYLo1 ; CPU:$81EC PRG:01EC 85 3C + lda #$90 ; CPU:$81EE PRG:01EE A9 90 + sta PlayerPosXLo2 ; CPU:$81F0 PRG:01F0 85 3E + lda #$B8 ; CPU:$81F2 PRG:01F2 A9 B8 + sta PlayerPosYLo2 ; CPU:$81F4 PRG:01F4 85 40 + lda #$22 ; CPU:$81F6 PRG:01F6 A9 22 + sta $02E1 ; CPU:$81F8 PRG:01F8 8D E1 02 + sta $02E5 ; CPU:$81FB PRG:01FB 8D E5 02 + sta $02E9 ; CPU:$81FE PRG:01FE 8D E9 02 + sta $02ED ; CPU:$8201 PRG:0201 8D ED 02 + lda #$03 ; CPU:$8204 PRG:0204 A9 03 + sta $02E2 ; CPU:$8206 PRG:0206 8D E2 02 + sta $02EA ; CPU:$8209 PRG:0209 8D EA 02 + lda #$43 ; CPU:$820C PRG:020C A9 43 + sta $02E6 ; CPU:$820E PRG:020E 8D E6 02 + sta $02EE ; CPU:$8211 PRG:0211 8D EE 02 + jsr $AC0D ; CPU:$8214 PRG:0214 20 0D AC + jsr $8AE8 ; CPU:$8217 PRG:0217 20 E8 8A + jsr $832A ; CPU:$821A PRG:021A 20 2A 83 + jsr $AB68 ; CPU:$821D PRG:021D 20 68 AB + jsr $82E1 ; CPU:$8220 PRG:0220 20 E1 82 +; ----------------------------------------------------------------------------- +; Routine: InitializeRound_OnNonzero_8223 +; Global: InitializeRound_OnNonzero_8223.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeRound_OnNonzero_8223: + jsr $8639 ; CPU:$8223 PRG:0223 20 39 86 +; ----------------------------------------------------------------------------- +; Routine: MainGameLoop +; Global: Main game loop. Waits for the NMI handler to raise $0321, services the two frame timers, reads the controllers, and restarts the stage or updates actor positions. $0321/$0320 form the vblank handshake with the NMI. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MainGameLoop: + lda $0321 ; CPU:$8226 PRG:0226 AD 21 03 + beq MainGameLoop_OnZero_8235 ; CPU:$8229 PRG:0229 F0 0A + lda SoundMuted ; CPU:$822B PRG:022B A5 E9 + beq MainGameLoop_OnZero_8232 ; CPU:$822D PRG:022D F0 03 + jmp $80AC ; CPU:$822F PRG:022F 4C AC 80 +; ----------------------------------------------------------------------------- +; Routine: MainGameLoop_OnZero_8232 +; Global: MainGameLoop_OnZero_8232.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MainGameLoop_OnZero_8232: + jmp $83A7 ; CPU:$8232 PRG:0232 4C A7 83 +; ----------------------------------------------------------------------------- +; Routine: MainGameLoop_OnZero_8235 +; Global: MainGameLoop_OnZero_8235.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MainGameLoop_OnZero_8235: + lda ActionCooldown ; CPU:$8235 PRG:0235 A5 65 + bne MainGameLoop ; CPU:$8237 PRG:0237 D0 ED + lda Zp4F ; CPU:$8239 PRG:0239 A5 4F + bpl MainGameLoop_OnNonnegative_8267 ; CPU:$823B PRG:023B 10 2A + lda #$00 ; CPU:$823D PRG:023D A9 00 + sta Zp4F ; CPU:$823F PRG:023F 85 4F + lda PlayerActionState ; CPU:$8241 PRG:0241 A5 F0 + beq MainGameLoop_OnZero_824D ; CPU:$8243 PRG:0243 F0 08 + cmp #$D0 ; CPU:$8245 PRG:0245 C9 D0 + beq MainGameLoop_OnZero_824D ; CPU:$8247 PRG:0247 F0 04 + cmp #$80 ; CPU:$8249 PRG:0249 C9 80 + bne MainGameLoop_OnNonzero_8255 ; CPU:$824B PRG:024B D0 08 +; ----------------------------------------------------------------------------- +; Routine: MainGameLoop_OnZero_824D +; Global: MainGameLoop_OnZero_824D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MainGameLoop_OnZero_824D: + lda #$00 ; CPU:$824D PRG:024D A9 00 + sta ScriptFlags ; CPU:$824F PRG:024F 85 41 + lda #$64 ; CPU:$8251 PRG:0251 A9 64 + sta ActorPosXLo ; CPU:$8253 PRG:0253 85 34 +; ----------------------------------------------------------------------------- +; Routine: MainGameLoop_OnNonzero_8255 +; Global: MainGameLoop_OnNonzero_8255.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MainGameLoop_OnNonzero_8255: + lda #$FE ; CPU:$8255 PRG:0255 A9 FE + sta PlayerActionState ; CPU:$8257 PRG:0257 85 F0 + lda PlayerActionState2 ; CPU:$8259 PRG:0259 A5 F1 + bne MainGameLoop_OnNonzero_8261 ; CPU:$825B PRG:025B D0 04 + lda #$80 ; CPU:$825D PRG:025D A9 80 + sta PlayerActionState2 ; CPU:$825F PRG:025F 85 F1 +; ----------------------------------------------------------------------------- +; Routine: MainGameLoop_OnNonzero_8261 +; Global: MainGameLoop_OnNonzero_8261.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MainGameLoop_OnNonzero_8261: + lda #$01 ; CPU:$8261 PRG:0261 A9 01 + sta Zp8A ; CPU:$8263 PRG:0263 85 8A + bne InitializeRound_OnNonzero_8223 ; CPU:$8265 PRG:0265 D0 BC +; ----------------------------------------------------------------------------- +; Routine: MainGameLoop_OnNonnegative_8267 +; Global: MainGameLoop_OnNonnegative_8267.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MainGameLoop_OnNonnegative_8267: + jsr $82AC ; CPU:$8267 PRG:0267 20 AC 82 + ldx $0349 ; CPU:$826A PRG:026A AE 49 03 + inx ; CPU:$826D PRG:026D E8 + stx Zp64 ; CPU:$826E PRG:026E 86 64 + lda Zp50 ; CPU:$8270 PRG:0270 A5 50 + bpl MainGameLoop_OnNonnegative_829E ; CPU:$8272 PRG:0272 10 2A + lda #$00 ; CPU:$8274 PRG:0274 A9 00 + sta Zp50 ; CPU:$8276 PRG:0276 85 50 + lda PlayerActionState2 ; CPU:$8278 PRG:0278 A5 F1 + beq MainGameLoop_OnZero_8284 ; CPU:$827A PRG:027A F0 08 + cmp #$D0 ; CPU:$827C PRG:027C C9 D0 + beq MainGameLoop_OnZero_8284 ; CPU:$827E PRG:027E F0 04 + cmp #$80 ; CPU:$8280 PRG:0280 C9 80 + bne MainGameLoop_OnNonzero_828C ; CPU:$8282 PRG:0282 D0 08 +; ----------------------------------------------------------------------------- +; Routine: MainGameLoop_OnZero_8284 +; Global: MainGameLoop_OnZero_8284.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MainGameLoop_OnZero_8284: + lda #$00 ; CPU:$8284 PRG:0284 A9 00 + sta Zp42 ; CPU:$8286 PRG:0286 85 42 + lda #$64 ; CPU:$8288 PRG:0288 A9 64 + sta Zp38 ; CPU:$828A PRG:028A 85 38 +; ----------------------------------------------------------------------------- +; Routine: MainGameLoop_OnNonzero_828C +; Global: MainGameLoop_OnNonzero_828C.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MainGameLoop_OnNonzero_828C: + lda #$FE ; CPU:$828C PRG:028C A9 FE + sta PlayerActionState2 ; CPU:$828E PRG:028E 85 F1 + lda PlayerActionState ; CPU:$8290 PRG:0290 A5 F0 + bne MainGameLoop_OnNonzero_8298 ; CPU:$8292 PRG:0292 D0 04 + lda #$80 ; CPU:$8294 PRG:0294 A9 80 + sta PlayerActionState ; CPU:$8296 PRG:0296 85 F0 +; ----------------------------------------------------------------------------- +; Routine: MainGameLoop_OnNonzero_8298 +; Global: MainGameLoop_OnNonzero_8298.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MainGameLoop_OnNonzero_8298: + lda #$02 ; CPU:$8298 PRG:0298 A9 02 + sta Zp8A ; CPU:$829A PRG:029A 85 8A + bne InitializeRound_OnNonzero_8223 ; CPU:$829C PRG:029C D0 85 +; ----------------------------------------------------------------------------- +; Routine: MainGameLoop_OnNonnegative_829E +; Global: MainGameLoop_OnNonnegative_829E.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MainGameLoop_OnNonnegative_829E: + jsr $82AC ; CPU:$829E PRG:029E 20 AC 82 + lda #$05 ; CPU:$82A1 PRG:02A1 A9 05 + sec ; CPU:$82A3 PRG:02A3 38 + sbc $0349 ; CPU:$82A4 PRG:02A4 ED 49 03 + sta ActionCooldown ; CPU:$82A7 PRG:02A7 85 65 + jmp $8226 ; CPU:$82A9 PRG:02A9 4C 26 82 +; ----------------------------------------------------------------------------- +; Routine: DivideBy20 +; Global: Restoring binary division of the 8-bit value in A by the constant 20 ($14). Eight steps shift the divisor right, conditionally subtract it from the 16-bit remainder, and roll the quotient bit into $0349. Quotient -> $0349, remainder -> $0347/$0348. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +DivideBy20: + sta $0347 ; CPU:$82AC PRG:02AC 8D 47 03 + lda #$14 ; CPU:$82AF PRG:02AF A9 14 + sta $034B ; CPU:$82B1 PRG:02B1 8D 4B 03 + lda #$00 ; CPU:$82B4 PRG:02B4 A9 00 + sta $034A ; CPU:$82B6 PRG:02B6 8D 4A 03 + sta $0348 ; CPU:$82B9 PRG:02B9 8D 48 03 + ldy #$08 ; CPU:$82BC PRG:02BC A0 08 +; ----------------------------------------------------------------------------- +; Routine: DivideBy20_OnNonzero_82BE +; Global: DivideBy20_OnNonzero_82BE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +DivideBy20_OnNonzero_82BE: + lsr $034B ; CPU:$82BE PRG:02BE 4E 4B 03 + ror $034A ; CPU:$82C1 PRG:02C1 6E 4A 03 + lda $0347 ; CPU:$82C4 PRG:02C4 AD 47 03 + sec ; CPU:$82C7 PRG:02C7 38 + sbc $034A ; CPU:$82C8 PRG:02C8 ED 4A 03 + tax ; CPU:$82CB PRG:02CB AA + lda $0348 ; CPU:$82CC PRG:02CC AD 48 03 + sbc $034B ; CPU:$82CF PRG:02CF ED 4B 03 + bcc DivideBy20_OnCarryClear_82DA ; CPU:$82D2 PRG:02D2 90 06 + sta $0348 ; CPU:$82D4 PRG:02D4 8D 48 03 + stx $0347 ; CPU:$82D7 PRG:02D7 8E 47 03 +; ----------------------------------------------------------------------------- +; Routine: DivideBy20_OnCarryClear_82DA +; Global: DivideBy20_OnCarryClear_82DA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +DivideBy20_OnCarryClear_82DA: + rol $0349 ; CPU:$82DA PRG:02DA 2E 49 03 + dey ; CPU:$82DD PRG:02DD 88 + bne DivideBy20_OnNonzero_82BE ; CPU:$82DE PRG:02DE D0 DE + rts ; CPU:$82E0 PRG:02E0 60 +; ----------------------------------------------------------------------------- +; Routine: SilenceSoundChannels1And3 +; Global: Point sound channels 1 and 3 at the silent sequence at $B1A1/$B1B0 with step 0. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SilenceSoundChannels1And3: + lda #$A1 ; CPU:$82E1 PRG:02E1 A9 A1 + sta SoundSequencePtrLo2 ; CPU:$82E3 PRG:02E3 85 D5 + lda #$B1 ; CPU:$82E5 PRG:02E5 A9 B1 + sta SoundSequencePtrHi2 ; CPU:$82E7 PRG:02E7 85 D9 + lda #$00 ; CPU:$82E9 PRG:02E9 A9 00 + sta SoundChannelStep2 ; CPU:$82EB PRG:02EB 85 D1 +; ----------------------------------------------------------------------------- +; Routine: SilenceSoundChannel3 +; Global: Point sound channel 3 at $B1B0 with step 0 (the tail of SilenceSoundChannels1And3). +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SilenceSoundChannel3: + lda #$B0 ; CPU:$82ED PRG:02ED A9 B0 + sta SoundSequencePtrLo4 ; CPU:$82EF PRG:02EF 85 D7 + lda #$B1 ; CPU:$82F1 PRG:02F1 A9 B1 + sta SoundSequencePtrHi4 ; CPU:$82F3 PRG:02F3 85 DB + lda #$00 ; CPU:$82F5 PRG:02F5 A9 00 + sta SoundChannelStep4 ; CPU:$82F7 PRG:02F7 85 D3 + rts ; CPU:$82F9 PRG:02F9 60 +; ----------------------------------------------------------------------------- +; Routine: StartIntroMusic +; Global: Set the $14-frame transition timer and start the intro music sequence for all four channels. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StartIntroMusic: + lda #$14 ; CPU:$82FA PRG:02FA A9 14 + sta $0323 ; CPU:$82FC PRG:02FC 8D 23 03 +; ----------------------------------------------------------------------------- +; Routine: StartMusicSequence +; Global: Start a four-channel music sequence from the $B2B9/$B3B2 tables. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StartMusicSequence: + lda #$B9 ; CPU:$82FF PRG:02FF A9 B9 + sta SoundSequencePtrLo1 ; CPU:$8301 PRG:0301 85 D4 + lda #$B2 ; CPU:$8303 PRG:0303 A9 B2 + sta SoundSequencePtrHi1 ; CPU:$8305 PRG:0305 85 D8 + lda #$06 ; CPU:$8307 PRG:0307 A9 06 + sta SoundSequencePtrLo2 ; CPU:$8309 PRG:0309 85 D5 + lda #$B3 ; CPU:$830B PRG:030B A9 B3 + sta SoundSequencePtrHi2 ; CPU:$830D PRG:030D 85 D9 + lda #$53 ; CPU:$830F PRG:030F A9 53 + sta SoundSequencePtrLo3 ; CPU:$8311 PRG:0311 85 D6 + lda #$B3 ; CPU:$8313 PRG:0313 A9 B3 + sta SoundSequencePtrHi3 ; CPU:$8315 PRG:0315 85 DA + lda #$94 ; CPU:$8317 PRG:0317 A9 94 + sta SoundSequencePtrLo4 ; CPU:$8319 PRG:0319 85 D7 + lda #$B3 ; CPU:$831B PRG:031B A9 B3 + sta SoundSequencePtrHi4 ; CPU:$831D PRG:031D 85 DB + lda #$00 ; CPU:$831F PRG:031F A9 00 + sta SoundChannelStep1 ; CPU:$8321 PRG:0321 85 D0 + sta SoundChannelStep2 ; CPU:$8323 PRG:0323 85 D1 + sta SoundChannelStep3 ; CPU:$8325 PRG:0325 85 D2 + sta SoundChannelStep4 ; CPU:$8327 PRG:0327 85 D3 + rts ; CPU:$8329 PRG:0329 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateHudTallyTiles +; Global: Draw the two score/tally markers at $20BB and $24A6 when their flags at $0338/$0339 are set. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateHudTallyTiles: + lda $0338 ; CPU:$832A PRG:032A AD 38 03 + beq UpdateHudTallyTiles_OnZero_833E ; CPU:$832D PRG:032D F0 0F + lda #$20 ; CPU:$832F PRG:032F A9 20 + sta $2006 ; CPU:$8331 PRG:0331 8D 06 20 + lda #$BB ; CPU:$8334 PRG:0334 A9 BB + sta $2006 ; CPU:$8336 PRG:0336 8D 06 20 + lda #$AC ; CPU:$8339 PRG:0339 A9 AC + sta $2007 ; CPU:$833B PRG:033B 8D 07 20 +; ----------------------------------------------------------------------------- +; Routine: UpdateHudTallyTiles_OnZero_833E +; Global: UpdateHudTallyTiles_OnZero_833E.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateHudTallyTiles_OnZero_833E: + lda $0339 ; CPU:$833E PRG:033E AD 39 03 + beq UpdateHudTallyTiles_OnZero_8352 ; CPU:$8341 PRG:0341 F0 0F + lda #$24 ; CPU:$8343 PRG:0343 A9 24 + sta $2006 ; CPU:$8345 PRG:0345 8D 06 20 + lda #$A6 ; CPU:$8348 PRG:0348 A9 A6 + sta $2006 ; CPU:$834A PRG:034A 8D 06 20 + lda #$AC ; CPU:$834D PRG:034D A9 AC + sta $2007 ; CPU:$834F PRG:034F 8D 07 20 +; ----------------------------------------------------------------------------- +; Routine: UpdateHudTallyTiles_OnZero_8352 +; Global: UpdateHudTallyTiles_OnZero_8352.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateHudTallyTiles_OnZero_8352: + rts ; CPU:$8352 PRG:0352 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateScoreTallyDigits +; Global: Redraw the score row at $20EC and $210C with the three current digits. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateScoreTallyDigits: + lda #$20 ; CPU:$8353 PRG:0353 A9 20 + sta $2006 ; CPU:$8355 PRG:0355 8D 06 20 + lda #$EC ; CPU:$8358 PRG:0358 A9 EC + sta $2006 ; CPU:$835A PRG:035A 8D 06 20 + lda #$34 ; CPU:$835D PRG:035D A9 34 + sta SourcePointerLo ; CPU:$835F PRG:035F 85 10 + jsr $8372 ; CPU:$8361 PRG:0361 20 72 83 + lda #$21 ; CPU:$8364 PRG:0364 A9 21 + sta $2006 ; CPU:$8366 PRG:0366 8D 06 20 + lda #$0C ; CPU:$8369 PRG:0369 A9 0C + sta $2006 ; CPU:$836B PRG:036B 8D 06 20 + lda #$36 ; CPU:$836E PRG:036E A9 36 + sta SourcePointerLo ; CPU:$8370 PRG:0370 85 10 +; ----------------------------------------------------------------------------- +; Routine: WriteScoreTallyDigits +; Global: Write one score digit: blank the cell unless it matches PlayerCount, then stamp the tile. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteScoreTallyDigits: + ldy #$00 ; CPU:$8372 PRG:0372 A0 00 +; ----------------------------------------------------------------------------- +; Routine: WriteScoreTallyDigits_OnCarryClear_8374 +; Global: WriteScoreTallyDigits_OnCarryClear_8374.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteScoreTallyDigits_OnCarryClear_8374: + lda $033D,y ; CPU:$8374 PRG:0374 B9 3D 03 + cmp PlayerCount ; CPU:$8377 PRG:0377 C5 94 + beq WriteScoreTallyDigits_OnZero_8385 ; CPU:$8379 PRG:0379 F0 0A + lda #$30 ; CPU:$837B PRG:037B A9 30 + sta $2007 ; CPU:$837D PRG:037D 8D 07 20 + sta $2007 ; CPU:$8380 PRG:0380 8D 07 20 + bne WriteScoreTallyDigits_OnNonzero_8390 ; CPU:$8383 PRG:0383 D0 0B +; ----------------------------------------------------------------------------- +; Routine: WriteScoreTallyDigits_OnZero_8385 +; Global: WriteScoreTallyDigits_OnZero_8385.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteScoreTallyDigits_OnZero_8385: + ldx SourcePointerLo ; CPU:$8385 PRG:0385 A6 10 + stx $2007 ; CPU:$8387 PRG:0387 8E 07 20 + inx ; CPU:$838A PRG:038A E8 + stx $2007 ; CPU:$838B PRG:038B 8E 07 20 + lda #$30 ; CPU:$838E PRG:038E A9 30 +; ----------------------------------------------------------------------------- +; Routine: WriteScoreTallyDigits_OnNonzero_8390 +; Global: WriteScoreTallyDigits_OnNonzero_8390.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteScoreTallyDigits_OnNonzero_8390: + sta $2007 ; CPU:$8390 PRG:0390 8D 07 20 + iny ; CPU:$8393 PRG:0393 C8 + cpy #$03 ; CPU:$8394 PRG:0394 C0 03 + bcc WriteScoreTallyDigits_OnCarryClear_8374 ; CPU:$8396 PRG:0396 90 DC + rts ; CPU:$8398 PRG:0398 60 +; ----------------------------------------------------------------------------- +; Routine: LoadOamShadowFromTable +; Global: Copy the 32-byte OAM shadow at $9EF4 into $0300 and upload it. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadOamShadowFromTable: + ldy #$1F ; CPU:$8399 PRG:0399 A0 1F +; ----------------------------------------------------------------------------- +; Routine: LoadOamShadowFromTable_OnNonnegative_839B +; Global: LoadOamShadowFromTable_OnNonnegative_839B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadOamShadowFromTable_OnNonnegative_839B: + lda $9EF4,y ; CPU:$839B PRG:039B B9 F4 9E + sta $0300,y ; CPU:$839E PRG:039E 99 00 03 + dey ; CPU:$83A1 PRG:03A1 88 + bpl LoadOamShadowFromTable_OnNonnegative_839B ; CPU:$83A2 PRG:03A2 10 F7 + jmp $ABB1 ; CPU:$83A4 PRG:03A4 4C B1 AB +; ----------------------------------------------------------------------------- +; Routine: UpdateActorPositions +; Global: Advance both actors: add the per-actor scroll delta to the position in $0340-$0342, then step the round counter and redraw the tally markers. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorPositions: + ldx #$01 ; CPU:$83A7 PRG:03A7 A2 01 + stx ActorIndex ; CPU:$83A9 PRG:03A9 86 1E +; ----------------------------------------------------------------------------- +; Routine: UpdateActorPositions_OnNonnegative_83AB +; Global: UpdateActorPositions_OnNonnegative_83AB.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorPositions_OnNonnegative_83AB: + ldx ActorIndex ; CPU:$83AB PRG:03AB A6 1E + lda Zp4F,x ; CPU:$83AD PRG:03AD B5 4F + sta DestinationPointerLo ; CPU:$83AF PRG:03AF 85 12 + sta VramBlockCountLo ; CPU:$83B1 PRG:03B1 85 14 + jsr $A0A5 ; CPU:$83B3 PRG:03B3 20 A5 A0 + jsr $8596 ; CPU:$83B6 PRG:03B6 20 96 85 + dec ActorIndex ; CPU:$83B9 PRG:03B9 C6 1E + bpl UpdateActorPositions_OnNonnegative_83AB ; CPU:$83BB PRG:03BB 10 EE + ldx Zp8A ; CPU:$83BD PRG:03BD A6 8A + dex ; CPU:$83BF PRG:03BF CA + jsr $A4FF ; CPU:$83C0 PRG:03C0 20 FF A4 + inc $0338,x ; CPU:$83C3 PRG:03C3 FE 38 03 + lda $0338,x ; CPU:$83C6 PRG:03C6 BD 38 03 + cmp #$02 ; CPU:$83C9 PRG:03C9 C9 02 + beq UpdateActorPositions_OnZero_83D0 ; CPU:$83CB PRG:03CB F0 03 + jmp $8164 ; CPU:$83CD PRG:03CD 4C 64 81 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorPositions_OnZero_83D0 +; Global: UpdateActorPositions_OnZero_83D0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorPositions_OnZero_83D0: + inx ; CPU:$83D0 PRG:03D0 E8 + stx PlayerCount ; CPU:$83D1 PRG:03D1 86 94 + txa ; CPU:$83D3 PRG:03D3 8A + ldy $033C ; CPU:$83D4 PRG:03D4 AC 3C 03 + sta $033D,y ; CPU:$83D7 PRG:03D7 99 3D 03 + iny ; CPU:$83DA PRG:03DA C8 + cpy #$03 ; CPU:$83DB PRG:03DB C0 03 + bcc UpdateActorPositions_OnCarryClear_83E1 ; CPU:$83DD PRG:03DD 90 02 + ldy #$00 ; CPU:$83DF PRG:03DF A0 00 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorPositions_OnCarryClear_83E1 +; Global: UpdateActorPositions_OnCarryClear_83E1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorPositions_OnCarryClear_83E1: + sty $033C ; CPU:$83E1 PRG:03E1 8C 3C 03 + jsr $AADC ; CPU:$83E4 PRG:03E4 20 DC AA + jsr $ABFC ; CPU:$83E7 PRG:03E7 20 FC AB + jsr $8399 ; CPU:$83EA PRG:03EA 20 99 83 + lda #$20 ; CPU:$83ED PRG:03ED A9 20 + sta $2006 ; CPU:$83EF PRG:03EF 8D 06 20 + lda #$AA ; CPU:$83F2 PRG:03F2 A9 AA + sta $2006 ; CPU:$83F4 PRG:03F4 8D 06 20 + lda #$30 ; CPU:$83F7 PRG:03F7 A9 30 + jsr $8B20 ; CPU:$83F9 PRG:03F9 20 20 8B + jsr $8B07 ; CPU:$83FC PRG:03FC 20 07 8B + lda #$ED ; CPU:$83FF PRG:03FF A9 ED + sta SourcePointerLo ; CPU:$8401 PRG:0401 85 10 + lda #$85 ; CPU:$8403 PRG:0403 A9 85 + sta SourcePointerHi ; CPU:$8405 PRG:0405 85 11 + jsr $ACF5 ; CPU:$8407 PRG:0407 20 F5 AC + lda $0324 ; CPU:$840A PRG:040A AD 24 03 + bne UpdateActorPositions_OnNonzero_8434 ; CPU:$840D PRG:040D D0 25 + lda #$0C ; CPU:$840F PRG:040F A9 0C + sta SourcePointerLo ; CPU:$8411 PRG:0411 85 10 + lda #$86 ; CPU:$8413 PRG:0413 A9 86 + sta SourcePointerHi ; CPU:$8415 PRG:0415 85 11 + jsr $ACF5 ; CPU:$8417 PRG:0417 20 F5 AC +; ----------------------------------------------------------------------------- +; Routine: UpdateActorPositions_OnZero_841A +; Global: UpdateActorPositions_OnZero_841A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorPositions_OnZero_841A: + lda #$00 ; CPU:$841A PRG:041A A9 00 + sta $034C ; CPU:$841C PRG:041C 8D 4C 03 + lda #$04 ; CPU:$841F PRG:041F A9 04 + sta $034D ; CPU:$8421 PRG:0421 8D 4D 03 + lda #$70 ; CPU:$8424 PRG:0424 A9 70 + sta $034E ; CPU:$8426 PRG:0426 8D 4E 03 + lda #$B9 ; CPU:$8429 PRG:0429 A9 B9 + sta $034F ; CPU:$842B PRG:042B 8D 4F 03 + jsr $8C0E ; CPU:$842E PRG:042E 20 0E 8C + jmp $845C ; CPU:$8431 PRG:0431 4C 5C 84 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorPositions_OnNonzero_8434 +; Global: UpdateActorPositions_OnNonzero_8434.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorPositions_OnNonzero_8434: + ldx #$00 ; CPU:$8434 PRG:0434 A2 00 + stx $033D ; CPU:$8436 PRG:0436 8E 3D 03 + stx $033F ; CPU:$8439 PRG:0439 8E 3F 03 + inx ; CPU:$843C PRG:043C E8 + stx $033E ; CPU:$843D PRG:043D 8E 3E 03 + ldx PlayerCount ; CPU:$8440 PRG:0440 A6 94 + dex ; CPU:$8442 PRG:0442 CA + beq UpdateActorPositions_OnZero_841A ; CPU:$8443 PRG:0443 F0 D5 + lda #$30 ; CPU:$8445 PRG:0445 A9 30 + sta $034C ; CPU:$8447 PRG:0447 8D 4C 03 + lda #$04 ; CPU:$844A PRG:044A A9 04 + sta $034D ; CPU:$844C PRG:044C 8D 4D 03 + lda #$30 ; CPU:$844F PRG:044F A9 30 + sta $034E ; CPU:$8451 PRG:0451 8D 4E 03 + lda #$BA ; CPU:$8454 PRG:0454 A9 BA + sta $034F ; CPU:$8456 PRG:0456 8D 4F 03 + jsr $8C05 ; CPU:$8459 PRG:0459 20 05 8C +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers +; Global: Per-round timer and state update: redraw the score, start the round-change music, and either loop again or advance the round and prepare the transition objects. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers: + jsr $8353 ; CPU:$845C PRG:045C 20 53 83 + lda #$00 ; CPU:$845F PRG:045F A9 00 + sta PpuScrollX ; CPU:$8461 PRG:0461 85 FE + lda #$FB ; CPU:$8463 PRG:0463 A9 FB + sta SoundSequencePtrLo1 ; CPU:$8465 PRG:0465 85 D4 + lda #$B0 ; CPU:$8467 PRG:0467 A9 B0 + sta SoundSequencePtrHi1 ; CPU:$8469 PRG:0469 85 D8 + lda #$1E ; CPU:$846B PRG:046B A9 1E + sta SoundSequencePtrLo2 ; CPU:$846D PRG:046D 85 D5 + lda #$B1 ; CPU:$846F PRG:046F A9 B1 + sta SoundSequencePtrHi2 ; CPU:$8471 PRG:0471 85 D9 + lda #$41 ; CPU:$8473 PRG:0473 A9 41 + sta SoundSequencePtrLo3 ; CPU:$8475 PRG:0475 85 D6 + lda #$B1 ; CPU:$8477 PRG:0477 A9 B1 + sta SoundSequencePtrHi3 ; CPU:$8479 PRG:0479 85 DA + lda #$00 ; CPU:$847B PRG:047B A9 00 + sta SoundChannelStep1 ; CPU:$847D PRG:047D 85 D0 + sta SoundChannelStep2 ; CPU:$847F PRG:047F 85 D1 + sta SoundChannelStep3 ; CPU:$8481 PRG:0481 85 D2 + jsr $8B92 ; CPU:$8483 PRG:0483 20 92 8B + lda #$FF ; CPU:$8486 PRG:0486 A9 FF + sta SubModeFlag ; CPU:$8488 PRG:0488 85 96 + jsr $8639 ; CPU:$848A PRG:048A 20 39 86 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers_OnNonzero_848D +; Global: UpdateRoundTimers_OnNonzero_848D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers_OnNonzero_848D: + lda SoundChannelStep1 ; CPU:$848D PRG:048D A5 D0 + cmp #$FF ; CPU:$848F PRG:048F C9 FF + bne UpdateRoundTimers_OnNonzero_848D ; CPU:$8491 PRG:0491 D0 FA + ldx PlayerCount ; CPU:$8493 PRG:0493 A6 94 + dex ; CPU:$8495 PRG:0495 CA + stx ActorIndex ; CPU:$8496 PRG:0496 86 1E + lda $0324 ; CPU:$8498 PRG:0498 AD 24 03 + beq UpdateRoundTimers_OnZero_84A1 ; CPU:$849B PRG:049B F0 04 + lda ActorIndex ; CPU:$849D PRG:049D A5 1E + bne UpdateRoundTimers_OnNonzero_851F ; CPU:$849F PRG:049F D0 7E +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers_OnZero_84A1 +; Global: UpdateRoundTimers_OnZero_84A1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers_OnZero_84A1: + lda $0338 ; CPU:$84A1 PRG:04A1 AD 38 03 + ora $0339 ; CPU:$84A4 PRG:04A4 0D 39 03 + cmp #$02 ; CPU:$84A7 PRG:04A7 C9 02 + bne UpdateRoundTimers_OnNonzero_84B1 ; CPU:$84A9 PRG:04A9 D0 06 + ldx #$10 ; CPU:$84AB PRG:04AB A2 10 + lda #$27 ; CPU:$84AD PRG:04AD A9 27 + bne UpdateRoundTimers_OnNonzero_84B5 ; CPU:$84AF PRG:04AF D0 04 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers_OnNonzero_84B1 +; Global: UpdateRoundTimers_OnNonzero_84B1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers_OnNonzero_84B1: + ldx #$88 ; CPU:$84B1 PRG:04B1 A2 88 + lda #$13 ; CPU:$84B3 PRG:04B3 A9 13 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers_OnNonzero_84B5 +; Global: UpdateRoundTimers_OnNonzero_84B5.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers_OnNonzero_84B5: + sta Zp19 ; CPU:$84B5 PRG:04B5 85 19 + stx Zp18 ; CPU:$84B7 PRG:04B7 86 18 + jsr $8596 ; CPU:$84B9 PRG:04B9 20 96 85 + lda #$30 ; CPU:$84BC PRG:04BC A9 30 + sta SourcePointerLo ; CPU:$84BE PRG:04BE 85 10 + lda #$86 ; CPU:$84C0 PRG:04C0 A9 86 + sta SourcePointerHi ; CPU:$84C2 PRG:04C2 85 11 + jsr $8BF8 ; CPU:$84C4 PRG:04C4 20 F8 8B + jsr $ACF5 ; CPU:$84C7 PRG:04C7 20 F5 AC + jsr $8B92 ; CPU:$84CA PRG:04CA 20 92 8B + jsr $856C ; CPU:$84CD PRG:04CD 20 6C 85 + lda #$00 ; CPU:$84D0 PRG:04D0 A9 00 + sta $0338 ; CPU:$84D2 PRG:04D2 8D 38 03 + sta $0339 ; CPU:$84D5 PRG:04D5 8D 39 03 + inc $0325 ; CPU:$84D8 PRG:04D8 EE 25 03 + lda $0325 ; CPU:$84DB PRG:04DB AD 25 03 + cmp #$04 ; CPU:$84DE PRG:04DE C9 04 + bcs UpdateRoundTimers_OnCarrySet_84E9 ; CPU:$84E0 PRG:04E0 B0 07 + lda $0326 ; CPU:$84E2 PRG:04E2 AD 26 03 + adc #$01 ; CPU:$84E5 PRG:04E5 69 01 + bne UpdateRoundTimers_OnNonzero_84EE ; CPU:$84E7 PRG:04E7 D0 05 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers_OnCarrySet_84E9 +; Global: UpdateRoundTimers_OnCarrySet_84E9.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers_OnCarrySet_84E9: + jsr $A8D1 ; CPU:$84E9 PRG:04E9 20 D1 A8 + and #$03 ; CPU:$84EC PRG:04EC 29 03 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers_OnNonzero_84EE +; Global: UpdateRoundTimers_OnNonzero_84EE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers_OnNonzero_84EE: + cmp #$03 ; CPU:$84EE PRG:04EE C9 03 + bcc UpdateRoundTimers_OnCarryClear_84F4 ; CPU:$84F0 PRG:04F0 90 02 + lda #$02 ; CPU:$84F2 PRG:04F2 A9 02 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers_OnCarryClear_84F4 +; Global: UpdateRoundTimers_OnCarryClear_84F4.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers_OnCarryClear_84F4: + sta $0326 ; CPU:$84F4 PRG:04F4 8D 26 03 + lda $0324 ; CPU:$84F7 PRG:04F7 AD 24 03 + beq UpdateRoundTimers_OnZero_850F ; CPU:$84FA PRG:04FA F0 13 + lda $0325 ; CPU:$84FC PRG:04FC AD 25 03 + sec ; CPU:$84FF PRG:04FF 38 + sbc #$01 ; CPU:$8500 PRG:0500 E9 01 + and #$0F ; CPU:$8502 PRG:0502 29 0F + sta SourcePointerLo ; CPU:$8504 PRG:0504 85 10 + lda #$19 ; CPU:$8506 PRG:0506 A9 19 + sec ; CPU:$8508 PRG:0508 38 + sbc SourcePointerLo ; CPU:$8509 PRG:0509 E5 10 + sta Zp30 ; CPU:$850B PRG:050B 85 30 + bcs UpdateRoundTimers_OnCarrySet_851C ; CPU:$850D PRG:050D B0 0D +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers_OnZero_850F +; Global: UpdateRoundTimers_OnZero_850F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers_OnZero_850F: + ldx PlayerCount ; CPU:$850F PRG:050F A6 94 + dex ; CPU:$8511 PRG:0511 CA + inc $033A,x ; CPU:$8512 PRG:0512 FE 3A 03 + lda $033A,x ; CPU:$8515 PRG:0515 BD 3A 03 + cmp #$02 ; CPU:$8518 PRG:0518 C9 02 + bcs UpdateRoundTimers_OnCarrySet_8522 ; CPU:$851A PRG:051A B0 06 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers_OnCarrySet_851C +; Global: UpdateRoundTimers_OnCarrySet_851C.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers_OnCarrySet_851C: + jmp $8132 ; CPU:$851C PRG:051C 4C 32 81 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers_OnNonzero_851F +; Global: UpdateRoundTimers_OnNonzero_851F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers_OnNonzero_851F: + jsr $856C ; CPU:$851F PRG:051F 20 6C 85 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers_OnCarrySet_8522 +; Global: UpdateRoundTimers_OnCarrySet_8522.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers_OnCarrySet_8522: + lda #$18 ; CPU:$8522 PRG:0522 A9 18 + sta SourcePointerLo ; CPU:$8524 PRG:0524 85 10 + lda #$86 ; CPU:$8526 PRG:0526 A9 86 + sta SourcePointerHi ; CPU:$8528 PRG:0528 85 11 + jsr $8BF8 ; CPU:$852A PRG:052A 20 F8 8B + jsr $ACF5 ; CPU:$852D PRG:052D 20 F5 AC + jsr $ABE4 ; CPU:$8530 PRG:0530 20 E4 AB + lda #$21 ; CPU:$8533 PRG:0533 A9 21 + sta SoundSequencePtrLo1 ; CPU:$8535 PRG:0535 85 D4 + lda #$B2 ; CPU:$8537 PRG:0537 A9 B2 + sta SoundSequencePtrHi1 ; CPU:$8539 PRG:0539 85 D8 + lda #$40 ; CPU:$853B PRG:053B A9 40 + sta SoundSequencePtrLo2 ; CPU:$853D PRG:053D 85 D5 + lda #$B2 ; CPU:$853F PRG:053F A9 B2 + sta SoundSequencePtrHi2 ; CPU:$8541 PRG:0541 85 D9 + lda #$5F ; CPU:$8543 PRG:0543 A9 5F + sta SoundSequencePtrLo3 ; CPU:$8545 PRG:0545 85 D6 + lda #$B2 ; CPU:$8547 PRG:0547 A9 B2 + sta SoundSequencePtrHi3 ; CPU:$8549 PRG:0549 85 DA + lda #$7E ; CPU:$854B PRG:054B A9 7E + sta SoundSequencePtrLo4 ; CPU:$854D PRG:054D 85 D7 + lda #$B2 ; CPU:$854F PRG:054F A9 B2 + sta SoundSequencePtrHi4 ; CPU:$8551 PRG:0551 85 DB + lda #$00 ; CPU:$8553 PRG:0553 A9 00 + sta SoundChannelStep1 ; CPU:$8555 PRG:0555 85 D0 + sta SoundChannelStep2 ; CPU:$8557 PRG:0557 85 D1 + sta SoundChannelStep3 ; CPU:$8559 PRG:0559 85 D2 + sta SoundChannelStep4 ; CPU:$855B PRG:055B 85 D3 + lda #$01 ; CPU:$855D PRG:055D A9 01 + sta SubModeFlag ; CPU:$855F PRG:055F 85 96 + jsr $8639 ; CPU:$8561 PRG:0561 20 39 86 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundTimers_OnZero_8564 +; Global: UpdateRoundTimers_OnZero_8564.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundTimers_OnZero_8564: + lda $0321 ; CPU:$8564 PRG:0564 AD 21 03 + beq UpdateRoundTimers_OnZero_8564 ; CPU:$8567 PRG:0567 F0 FB + jmp $802C ; CPU:$8569 PRG:0569 4C 2C 80 +; ----------------------------------------------------------------------------- +; Routine: PlayRoundChangeMusic +; Global: Start the short round-change jingle and wait for the NMI handshake. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +PlayRoundChangeMusic: + lda #$5A ; CPU:$856C PRG:056C A9 5A + sta SoundSequencePtrLo1 ; CPU:$856E PRG:056E 85 D4 + lda #$B1 ; CPU:$8570 PRG:0570 A9 B1 + sta SoundSequencePtrHi1 ; CPU:$8572 PRG:0572 85 D8 + lda #$65 ; CPU:$8574 PRG:0574 A9 65 + sta SoundSequencePtrLo2 ; CPU:$8576 PRG:0576 85 D5 + lda #$B1 ; CPU:$8578 PRG:0578 A9 B1 + sta SoundSequencePtrHi2 ; CPU:$857A PRG:057A 85 D9 + lda #$70 ; CPU:$857C PRG:057C A9 70 + sta SoundSequencePtrLo3 ; CPU:$857E PRG:057E 85 D6 + lda #$B1 ; CPU:$8580 PRG:0580 A9 B1 + sta SoundSequencePtrHi3 ; CPU:$8582 PRG:0582 85 DA + lda #$00 ; CPU:$8584 PRG:0584 A9 00 + sta SoundChannelStep1 ; CPU:$8586 PRG:0586 85 D0 + sta SoundChannelStep2 ; CPU:$8588 PRG:0588 85 D1 + sta SoundChannelStep3 ; CPU:$858A PRG:058A 85 D2 + jsr $8639 ; CPU:$858C PRG:058C 20 39 86 +; ----------------------------------------------------------------------------- +; Routine: PlayRoundChangeMusic_OnNonzero_858F +; Global: PlayRoundChangeMusic_OnNonzero_858F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +PlayRoundChangeMusic_OnNonzero_858F: + lda SoundChannelStep1 ; CPU:$858F PRG:058F A5 D0 + cmp #$FF ; CPU:$8591 PRG:0591 C9 FF + bne PlayRoundChangeMusic_OnNonzero_858F ; CPU:$8593 PRG:0593 D0 FA + rts ; CPU:$8595 PRG:0595 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateScrollTarget +; Global: Compare the actor position in $0340-$0342 against the screen bounds in $0328-$032A and latch the tighter limit. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateScrollTarget: + ldy ActorIndex ; CPU:$8596 PRG:0596 A4 1E +; ----------------------------------------------------------------------------- +; Routine: UpdateScrollTargetAlt +; Global: UpdateScrollTargetAlt.; called from $9A1B +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateScrollTargetAlt: + beq UpdateScrollTargetAlt_OnZero_85A3 ; CPU:$8598 PRG:0598 F0 09 + lda $032C ; CPU:$859A PRG:059A AD 2C 03 + bne UpdateScrollTargetAlt_JoinBranchPaths_85EC ; CPU:$859D PRG:059D D0 4D + ldy #$03 ; CPU:$859F PRG:059F A0 03 + bne UpdateScrollTargetAlt_OnNonzero_85A8 ; CPU:$85A1 PRG:05A1 D0 05 +; ----------------------------------------------------------------------------- +; Routine: UpdateScrollTargetAlt_OnZero_85A3 +; Global: UpdateScrollTargetAlt_OnZero_85A3.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateScrollTargetAlt_OnZero_85A3: + lda $032B ; CPU:$85A3 PRG:05A3 AD 2B 03 + bne UpdateScrollTargetAlt_JoinBranchPaths_85EC ; CPU:$85A6 PRG:05A6 D0 44 +; ----------------------------------------------------------------------------- +; Routine: UpdateScrollTargetAlt_OnNonzero_85A8 +; Global: UpdateScrollTargetAlt_OnNonzero_85A8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateScrollTargetAlt_OnNonzero_85A8: + clc ; CPU:$85A8 PRG:05A8 18 + lda $0340,y ; CPU:$85A9 PRG:05A9 B9 40 03 + adc Zp18 ; CPU:$85AC PRG:05AC 65 18 + sta $0340,y ; CPU:$85AE PRG:05AE 99 40 03 + lda $0341,y ; CPU:$85B1 PRG:05B1 B9 41 03 + adc Zp19 ; CPU:$85B4 PRG:05B4 65 19 + sta $0341,y ; CPU:$85B6 PRG:05B6 99 41 03 + lda $0342,y ; CPU:$85B9 PRG:05B9 B9 42 03 + adc #$00 ; CPU:$85BC PRG:05BC 69 00 + sta $0342,y ; CPU:$85BE PRG:05BE 99 42 03 + cmp $032A ; CPU:$85C1 PRG:05C1 CD 2A 03 + bcc UpdateScrollTargetAlt_JoinBranchPaths_85EC ; CPU:$85C4 PRG:05C4 90 26 + bne UpdateScrollTargetAlt_OnNonzero_85DA ; CPU:$85C6 PRG:05C6 D0 12 + lda $0341,y ; CPU:$85C8 PRG:05C8 B9 41 03 + cmp $0329 ; CPU:$85CB PRG:05CB CD 29 03 + bcc UpdateScrollTargetAlt_JoinBranchPaths_85EC ; CPU:$85CE PRG:05CE 90 1C + bne UpdateScrollTargetAlt_OnNonzero_85DA ; CPU:$85D0 PRG:05D0 D0 08 + lda $0340,y ; CPU:$85D2 PRG:05D2 B9 40 03 + cmp $0328 ; CPU:$85D5 PRG:05D5 CD 28 03 + bcc UpdateScrollTargetAlt_JoinBranchPaths_85EC ; CPU:$85D8 PRG:05D8 90 12 +; ----------------------------------------------------------------------------- +; Routine: UpdateScrollTargetAlt_OnNonzero_85DA +; Global: UpdateScrollTargetAlt_OnNonzero_85DA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateScrollTargetAlt_OnNonzero_85DA: + lda $0340,y ; CPU:$85DA PRG:05DA B9 40 03 + sta $0328 ; CPU:$85DD PRG:05DD 8D 28 03 + lda $0341,y ; CPU:$85E0 PRG:05E0 B9 41 03 + sta $0329 ; CPU:$85E3 PRG:05E3 8D 29 03 + lda $0342,y ; CPU:$85E6 PRG:05E6 B9 42 03 + sta $032A ; CPU:$85E9 PRG:05E9 8D 2A 03 +; ----------------------------------------------------------------------------- +; Routine: UpdateScrollTargetAlt_JoinBranchPaths_85EC +; Global: UpdateScrollTargetAlt_JoinBranchPaths_85EC.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateScrollTargetAlt_JoinBranchPaths_85EC: + rts ; CPU:$85EC PRG:05EC 60 +; Pass 3: bytecode program not listed in BytecodeProgramPointerTable. +; ---- data $85ED-$8638 (76 bytes) ---- +StandaloneBytecodeProgram: + .byte $03, $20, $AF, $1B, $18, $1E, $17, $0D, $C0, $22, $48, $11, $12, $26, $1C, $0C ; CPU:$85ED PRG:05ED 03 20 AF 1B 18 1E 17 0D C0 22 48 11 12 26 1C 0C + .byte $18, $1B, $0E, $C0, $22, $A8, $01, $19, $26, $1C, $0C, $18, $1B, $0E, $C0, $01 ; CPU:$85FD PRG:05FD 18 1B 0E C0 22 A8 01 19 26 1C 0C 18 1B 0E C0 01 + .byte $22, $E8, $02, $19, $26, $1C, $0C, $18, $1B, $0E, $C0, $03, $21, $EE, $BC, $05 ; CPU:$860D PRG:060D 22 E8 02 19 26 1C 0C 18 1B 0E C0 03 21 EE BC 05 + .byte $C0, $20, $EC, $BC, $08, $C0, $21, $0B, $10, $0A, $16, $0E, $30, $30, $18, $1F ; CPU:$861D PRG:061D C0 20 EC BC 08 C0 21 0B 10 0A 16 0E 30 30 18 1F + .byte $0E, $1B, $C0, $01, $21, $EE, $0B, $18, $17, $1E, $1C, $C0 ; CPU:$862D PRG:062D 0E 1B C0 01 21 EE 0B 18 17 1E 1C C0 +BeginVblankFrame: + lda #$00 ; CPU:$8639 PRG:0639 A9 00 + sta $0321 ; CPU:$863B PRG:063B 8D 21 03 + sta $0320 ; CPU:$863E PRG:063E 8D 20 03 + jmp $AACD ; CPU:$8641 PRG:0641 4C CD AA +; ----------------------------------------------------------------------------- +; Routine: ForceRenderingOff +; Global: Force rendering off: PPUCTRL=$10, PPUMASK=0, updating both shadow bytes. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ForceRenderingOff: + lda #$10 ; CPU:$8644 PRG:0644 A9 10 + sta $2000 ; CPU:$8646 PRG:0646 8D 00 20 + sta PpuCtrlShadow ; CPU:$8649 PRG:0649 85 FC + lda #$00 ; CPU:$864B PRG:064B A9 00 + sta $2001 ; CPU:$864D PRG:064D 8D 01 20 + sta PpuMaskShadow ; CPU:$8650 PRG:0650 85 FD + rts ; CPU:$8652 PRG:0652 60 +; ----------------------------------------------------------------------------- +; Routine: SetRenderingOffAndSignalVblank +; Global: Call ForceRenderingOff, signal the main loop through SignalVblankComplete, then clear the vblank latch at $0320. Provably unreachable (no word in the image points at $8653). Kept as code because the shape is unambiguous. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetRenderingOffAndSignalVblank: + jsr $8644 ; CPU:$8653 PRG:0653 20 44 86 + jsr $887C ; CPU:$8656 PRG:0656 20 7C 88 + sta $0320 ; CPU:$8659 PRG:0659 8D 20 03 + rts ; CPU:$865C PRG:065C 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundLogic +; Global: Positive game-state branch of the NMI: update the flash counters and actors, detect a button edge, and bump the frame-skip counter in zero page $FE. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundLogic: + jsr $87F2 ; CPU:$865D PRG:065D 20 F2 87 + jsr $ABB1 ; CPU:$8660 PRG:0660 20 B1 AB + jsr $AA56 ; CPU:$8663 PRG:0663 20 56 AA + jsr $87D1 ; CPU:$8666 PRG:0666 20 D1 87 + lda FrameCounterLo ; CPU:$8669 PRG:0669 A5 24 + and #$3F ; CPU:$866B PRG:066B 29 3F + bne UpdateRoundLogic_OnNonzero_8682 ; CPU:$866D PRG:066D D0 13 + dec $0323 ; CPU:$866F PRG:066F CE 23 03 + bne UpdateRoundLogic_OnNonzero_8682 ; CPU:$8672 PRG:0672 D0 0E + jsr $887C ; CPU:$8674 PRG:0674 20 7C 88 + sta SoundMuted ; CPU:$8677 PRG:0677 85 E9 + sta $032B ; CPU:$8679 PRG:0679 8D 2B 03 + sta $032C ; CPU:$867C PRG:067C 8D 2C 03 + jsr $82FA ; CPU:$867F PRG:067F 20 FA 82 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundLogic_OnNonzero_8682 +; Global: UpdateRoundLogic_OnNonzero_8682.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundLogic_OnNonzero_8682: + lda ControllerButtons1 ; CPU:$8682 PRG:0682 A5 FA + and #$10 ; CPU:$8684 PRG:0684 29 10 + beq UpdateRoundLogic_JoinBranchPaths_86A0 ; CPU:$8686 PRG:0686 F0 18 + lda ControllerButtonsPrev ; CPU:$8688 PRG:0688 A5 F4 + and #$10 ; CPU:$868A PRG:068A 29 10 + bne UpdateRoundLogic_JoinBranchPaths_86A0 ; CPU:$868C PRG:068C D0 12 + lda #$01 ; CPU:$868E PRG:068E A9 01 + sta $0321 ; CPU:$8690 PRG:0690 8D 21 03 + lda #$00 ; CPU:$8693 PRG:0693 A9 00 + sta $032B ; CPU:$8695 PRG:0695 8D 2B 03 + sta SoundMuted ; CPU:$8698 PRG:0698 85 E9 + lda $0324 ; CPU:$869A PRG:069A AD 24 03 + sta $032C ; CPU:$869D PRG:069D 8D 2C 03 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundLogic_JoinBranchPaths_86A0 +; Global: UpdateRoundLogic_JoinBranchPaths_86A0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundLogic_JoinBranchPaths_86A0: + lda PpuScrollX ; CPU:$86A0 PRG:06A0 A5 FE + cmp #$FF ; CPU:$86A2 PRG:06A2 C9 FF + beq UpdateRoundLogic_JoinBranchPaths_86AA ; CPU:$86A4 PRG:06A4 F0 04 + inc PpuScrollX ; CPU:$86A6 PRG:06A6 E6 FE + inc PpuScrollX ; CPU:$86A8 PRG:06A8 E6 FE +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundLogic_JoinBranchPaths_86AA +; Global: UpdateRoundLogic_JoinBranchPaths_86AA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundLogic_JoinBranchPaths_86AA: + jmp $8751 ; CPU:$86AA PRG:06AA 4C 51 87 +; ----------------------------------------------------------------------------- +; Routine: UpdateRoundLogic_OnNegative_86AD +; Global: UpdateRoundLogic_OnNegative_86AD.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateRoundLogic_OnNegative_86AD: + jsr $8B07 ; CPU:$86AD PRG:06AD 20 07 8B + jsr $ABB1 ; CPU:$86B0 PRG:06B0 20 B1 AB + jsr $AA56 ; CPU:$86B3 PRG:06B3 20 56 AA + jsr $88A4 ; CPU:$86B6 PRG:06B6 20 A4 88 + jsr $8986 ; CPU:$86B9 PRG:06B9 20 86 89 + lda SoundChannelStep1 ; CPU:$86BC PRG:06BC A5 D0 + and SoundChannelStep2 ; CPU:$86BE PRG:06BE 25 D1 + and SoundChannelStep3 ; CPU:$86C0 PRG:06C0 25 D2 + cmp #$FF ; CPU:$86C2 PRG:06C2 C9 FF + bne UpdateRoundLogic_JoinBranchPaths_86AA ; CPU:$86C4 PRG:06C4 D0 E4 + jsr $82FF ; CPU:$86C6 PRG:06C6 20 FF 82 + beq UpdateRoundLogic_JoinBranchPaths_86AA ; CPU:$86C9 PRG:06C9 F0 DF +; ----------------------------------------------------------------------------- +; Routine: NmiHandler +; Global: NmiHandler.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +NmiHandler: + pha ; CPU:$86CB PRG:06CB 48 + txa ; CPU:$86CC PRG:06CC 8A + pha ; CPU:$86CD PRG:06CD 48 + tya ; CPU:$86CE PRG:06CE 98 + pha ; CPU:$86CF PRG:06CF 48 + lda $0320 ; CPU:$86D0 PRG:06D0 AD 20 03 + beq NmiHandler_OnZero_86D8 ; CPU:$86D3 PRG:06D3 F0 03 + jmp $8759 ; CPU:$86D5 PRG:06D5 4C 59 87 +; ----------------------------------------------------------------------------- +; Routine: NmiHandler_OnZero_86D8 +; Global: NmiHandler_OnZero_86D8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +NmiHandler_OnZero_86D8: + lda #$FF ; CPU:$86D8 PRG:06D8 A9 FF + sta $0320 ; CPU:$86DA PRG:06DA 8D 20 03 + inc FrameCounterLo ; CPU:$86DD PRG:06DD E6 24 + bne NmiHandler_OnNonzero_86E3 ; CPU:$86DF PRG:06DF D0 02 + inc FrameCounterHi ; CPU:$86E1 PRG:06E1 E6 25 +; ----------------------------------------------------------------------------- +; Routine: NmiHandler_OnNonzero_86E3 +; Global: NmiHandler_OnNonzero_86E3.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +NmiHandler_OnNonzero_86E3: + lda #$00 ; CPU:$86E3 PRG:06E3 A9 00 + sta $2001 ; CPU:$86E5 PRG:06E5 8D 01 20 + sta $2003 ; CPU:$86E8 PRG:06E8 8D 03 20 + lda #$02 ; CPU:$86EB PRG:06EB A9 02 + sta $4014 ; CPU:$86ED PRG:06ED 8D 14 40 + lda $0322 ; CPU:$86F0 PRG:06F0 AD 22 03 + beq NmiHandler_OnZero_86FA ; CPU:$86F3 PRG:06F3 F0 05 + bmi UpdateRoundLogic_OnNegative_86AD ; CPU:$86F5 PRG:06F5 30 B6 + jmp $865D ; CPU:$86F7 PRG:06F7 4C 5D 86 +; ----------------------------------------------------------------------------- +; Routine: NmiHandler_OnZero_86FA +; Global: NmiHandler_OnZero_86FA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +NmiHandler_OnZero_86FA: + lda SubModeFlag ; CPU:$86FA PRG:06FA A5 96 + beq NmiHandler_OnZero_8709 ; CPU:$86FC PRG:06FC F0 0B + bmi NmiHandler_OnNegative_8703 ; CPU:$86FE PRG:06FE 30 03 + jsr $885B ; CPU:$8700 PRG:0700 20 5B 88 +; ----------------------------------------------------------------------------- +; Routine: NmiHandler_OnNegative_8703 +; Global: NmiHandler_OnNegative_8703.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +NmiHandler_OnNegative_8703: + jsr $ABB1 ; CPU:$8703 PRG:0703 20 B1 AB + jmp $8751 ; CPU:$8706 PRG:0706 4C 51 87 +; ----------------------------------------------------------------------------- +; Routine: NmiHandler_OnZero_8709 +; Global: NmiHandler_OnZero_8709.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +NmiHandler_OnZero_8709: + lda $032D ; CPU:$8709 PRG:0709 AD 2D 03 + bne NmiHandler_OnNonzero_872F ; CPU:$870C PRG:070C D0 21 + jsr $A512 ; CPU:$870E PRG:070E 20 12 A5 + jsr $8A28 ; CPU:$8711 PRG:0711 20 28 8A + jsr $A6F8 ; CPU:$8714 PRG:0714 20 F8 A6 + jsr $ABA3 ; CPU:$8717 PRG:0717 20 A3 AB + jsr $877C ; CPU:$871A PRG:071A 20 7C 87 + jsr $8848 ; CPU:$871D PRG:071D 20 48 88 + bcs NmiHandler_OnCarrySet_8728 ; CPU:$8720 PRG:0720 B0 06 + jsr $87BF ; CPU:$8722 PRG:0722 20 BF 87 + jmp $8751 ; CPU:$8725 PRG:0725 4C 51 87 +; ----------------------------------------------------------------------------- +; Routine: NmiHandler_OnCarrySet_8728 +; Global: NmiHandler_OnCarrySet_8728.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +NmiHandler_OnCarrySet_8728: + jsr $AF25 ; CPU:$8728 PRG:0728 20 25 AF + lda #$FF ; CPU:$872B PRG:072B A9 FF + bne NmiHandler_OnNonzero_8742 ; CPU:$872D PRG:072D D0 13 +; ----------------------------------------------------------------------------- +; Routine: NmiHandler_OnNonzero_872F +; Global: NmiHandler_OnNonzero_872F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +NmiHandler_OnNonzero_872F: + jsr $8837 ; CPU:$872F PRG:072F 20 37 88 + bcc FinishNmiUpdates ; CPU:$8732 PRG:0732 90 1D + jsr $8BF8 ; CPU:$8734 PRG:0734 20 F8 8B + jsr $8AE8 ; CPU:$8737 PRG:0737 20 E8 8A + jsr $ABE4 ; CPU:$873A PRG:073A 20 E4 AB + jsr $AACD ; CPU:$873D PRG:073D 20 CD AA + lda #$00 ; CPU:$8740 PRG:0740 A9 00 +; ----------------------------------------------------------------------------- +; Routine: NmiHandler_OnNonzero_8742 +; Global: NmiHandler_OnNonzero_8742.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +NmiHandler_OnNonzero_8742: + sta $032D ; CPU:$8742 PRG:0742 8D 2D 03 + lda #$8D ; CPU:$8745 PRG:0745 A9 8D + sta SoundSequencePtrLo1 ; CPU:$8747 PRG:0747 85 D4 + lda #$B2 ; CPU:$8749 PRG:0749 A9 B2 + sta SoundSequencePtrHi1 ; CPU:$874B PRG:074B 85 D8 + lda #$00 ; CPU:$874D PRG:074D A9 00 + sta SoundChannelStep1 ; CPU:$874F PRG:074F 85 D0 +; ----------------------------------------------------------------------------- +; Routine: FinishNmiUpdates +; Global: Finish the NMI: clear the vblank latch unless $0321 says work is outstanding, poll $2002 to release the PPU address latch, and run the sound frame update. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FinishNmiUpdates: + lda $0321 ; CPU:$8751 PRG:0751 AD 21 03 + bne FinishNmiRegisters ; CPU:$8754 PRG:0754 D0 03 + sta $0320 ; CPU:$8756 PRG:0756 8D 20 03 +; ----------------------------------------------------------------------------- +; Routine: FinishNmiRegisters +; Global: NMI epilogue: poll $2002, update the sound engine, restore Y/X/A, and RTI at $8764. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FinishNmiRegisters: + lda $2002 ; CPU:$8759 PRG:0759 AD 02 20 + jsr $AF3B ; CPU:$875C PRG:075C 20 3B AF + pla ; CPU:$875F PRG:075F 68 + tay ; CPU:$8760 PRG:0760 A8 + pla ; CPU:$8761 PRG:0761 68 + tax ; CPU:$8762 PRG:0762 AA + pla ; CPU:$8763 PRG:0763 68 +; ----------------------------------------------------------------------------- +; Routine: IrqHandler +; Global: IrqHandler.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +IrqHandler: + rti ; CPU:$8764 PRG:0764 40 +; ----------------------------------------------------------------------------- +; Routine: SetSoundSequenceChannel1 +; Global: Point sound channel 1 at the $B1EB sequence. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetSoundSequenceChannel1: + lda #$EB ; CPU:$8765 PRG:0765 A9 EB + sta SoundSequencePtrLo1 ; CPU:$8767 PRG:0767 85 D4 + lda #$B1 ; CPU:$8769 PRG:0769 A9 B1 + sta SoundSequencePtrHi1 ; CPU:$876B PRG:076B 85 D8 + lda #$06 ; CPU:$876D PRG:076D A9 06 + sta SoundSequencePtrLo2 ; CPU:$876F PRG:076F 85 D5 + lda #$B2 ; CPU:$8771 PRG:0771 A9 B2 + sta SoundSequencePtrHi2 ; CPU:$8773 PRG:0773 85 D9 + lda #$00 ; CPU:$8775 PRG:0775 A9 00 + sta SoundChannelStep1 ; CPU:$8777 PRG:0777 85 D0 + sta SoundChannelStep2 ; CPU:$8779 PRG:0779 85 D1 + rts ; CPU:$877B PRG:077B 60 +; ----------------------------------------------------------------------------- +; Routine: RunGameStateDispatcher +; Global: Main game-state dispatcher. Counts down the transition timer at zero page $8D and runs one of fourteen subsystem updates chosen by that counter. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunGameStateDispatcher: + lda RoundTransitionTimer ; CPU:$877C PRG:077C A5 8D + beq RunGameStateDispatcher_JoinBranchPaths_8787 ; CPU:$877E PRG:077E F0 07 + dec RoundTransitionTimer ; CPU:$8780 PRG:0780 C6 8D + bne RunGameStateDispatcher_JoinBranchPaths_8787 ; CPU:$8782 PRG:0782 D0 03 + jsr $8765 ; CPU:$8784 PRG:0784 20 65 87 +; ----------------------------------------------------------------------------- +; Routine: RunGameStateDispatcher_JoinBranchPaths_8787 +; Global: RunGameStateDispatcher_JoinBranchPaths_8787.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunGameStateDispatcher_JoinBranchPaths_8787: + lda FrameCounterLo ; CPU:$8787 PRG:0787 A5 24 + and #$7F ; CPU:$8789 PRG:0789 29 7F + bne RunGameStateDispatcher_OnNonzero_8795 ; CPU:$878B PRG:078B D0 08 + lda Zp8A ; CPU:$878D PRG:078D A5 8A + bne RunGameStateDispatcher_OnNonzero_8795 ; CPU:$878F PRG:078F D0 04 + dec Zp4F ; CPU:$8791 PRG:0791 C6 4F + dec Zp50 ; CPU:$8793 PRG:0793 C6 50 +; ----------------------------------------------------------------------------- +; Routine: RunGameStateDispatcher_OnNonzero_8795 +; Global: RunGameStateDispatcher_OnNonzero_8795.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunGameStateDispatcher_OnNonzero_8795: + jsr $8A5E ; CPU:$8795 PRG:0795 20 5E 8A + jsr $8882 ; CPU:$8798 PRG:0798 20 82 88 + jsr $886C ; CPU:$879B PRG:079B 20 6C 88 + jsr $A270 ; CPU:$879E PRG:079E 20 70 A2 + jsr $9F4B ; CPU:$87A1 PRG:07A1 20 4B 9F + jsr $9A4E ; CPU:$87A4 PRG:07A4 20 4E 9A + jsr $A12E ; CPU:$87A7 PRG:07A7 20 2E A1 + jsr $A17F ; CPU:$87AA PRG:07AA 20 7F A1 + jsr $A68E ; CPU:$87AD PRG:07AD 20 8E A6 + jsr $A79F ; CPU:$87B0 PRG:07B0 20 9F A7 + jsr $A949 ; CPU:$87B3 PRG:07B3 20 49 A9 + jsr $A8E9 ; CPU:$87B6 PRG:07B6 20 E9 A8 + jsr $A992 ; CPU:$87B9 PRG:07B9 20 92 A9 + jmp $A9AB ; CPU:$87BC PRG:07BC 4C AB A9 +; ----------------------------------------------------------------------------- +; Routine: UpdateTimersAlt +; Global: UpdateTimersAlt.; called from $8722 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateTimersAlt: + lda SoundMuted ; CPU:$87BF PRG:07BF A5 E9 + beq PollControllerStart_JoinBranchPaths_87F1 ; CPU:$87C1 PRG:07C1 F0 2E + lda FrameCounterLo ; CPU:$87C3 PRG:07C3 A5 24 + and #$3F ; CPU:$87C5 PRG:07C5 29 3F + bne PollControllerStart_JoinBranchPaths_87F1 ; CPU:$87C7 PRG:07C7 D0 28 + dec $0323 ; CPU:$87C9 PRG:07C9 CE 23 03 + bne PollControllerStart_JoinBranchPaths_87F1 ; CPU:$87CC PRG:07CC D0 23 + jmp $887C ; CPU:$87CE PRG:07CE 4C 7C 88 +; ----------------------------------------------------------------------------- +; Routine: PollControllerStart +; Global: PollControllerStart.; called from $8666 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +PollControllerStart: + lda ControllerButtons1 ; CPU:$87D1 PRG:07D1 A5 FA + and #$20 ; CPU:$87D3 PRG:07D3 29 20 + beq PollControllerStart_JoinBranchPaths_87F1 ; CPU:$87D5 PRG:07D5 F0 1A + lda ControllerButtonsPrev ; CPU:$87D7 PRG:07D7 A5 F4 + and #$20 ; CPU:$87D9 PRG:07D9 29 20 + bne PollControllerStart_JoinBranchPaths_87F1 ; CPU:$87DB PRG:07DB D0 14 + lda $0324 ; CPU:$87DD PRG:07DD AD 24 03 + eor #$FF ; CPU:$87E0 PRG:07E0 49 FF + sta $0324 ; CPU:$87E2 PRG:07E2 8D 24 03 + lda $0323 ; CPU:$87E5 PRG:07E5 AD 23 03 + cmp #$05 ; CPU:$87E8 PRG:07E8 C9 05 + bcs PollControllerStart_JoinBranchPaths_87F1 ; CPU:$87EA PRG:07EA B0 05 + lda #$05 ; CPU:$87EC PRG:07EC A9 05 + sta $0323 ; CPU:$87EE PRG:07EE 8D 23 03 +; ----------------------------------------------------------------------------- +; Routine: PollControllerStart_JoinBranchPaths_87F1 +; Global: PollControllerStart_JoinBranchPaths_87F1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +PollControllerStart_JoinBranchPaths_87F1: + rts ; CPU:$87F1 PRG:07F1 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateFlashCounter +; Global: Advance the screen-flash counter against the $2C-frame limit. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateFlashCounter: + lda PpuScrollX ; CPU:$87F2 PRG:07F2 A5 FE + cmp #$2C ; CPU:$87F4 PRG:07F4 C9 2C + bcc UpdateFlashCounter_OnCarryClear_8819 ; CPU:$87F6 PRG:07F6 90 21 + lda $0324 ; CPU:$87F8 PRG:07F8 AD 24 03 + beq UpdateFlashCounter_OnZero_8801 ; CPU:$87FB PRG:07FB F0 04 + lda #$56 ; CPU:$87FD PRG:07FD A9 56 + bne UpdateFlashCounter_OnNonzero_8803 ; CPU:$87FF PRG:07FF D0 02 +; ----------------------------------------------------------------------------- +; Routine: UpdateFlashCounter_OnZero_8801 +; Global: UpdateFlashCounter_OnZero_8801.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateFlashCounter_OnZero_8801: + lda #$66 ; CPU:$8801 PRG:0801 A9 66 +; ----------------------------------------------------------------------------- +; Routine: UpdateFlashCounter_OnNonzero_8803 +; Global: UpdateFlashCounter_OnNonzero_8803.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateFlashCounter_OnNonzero_8803: + sta $0220 ; CPU:$8803 PRG:0803 8D 20 02 + lda #$FF ; CPU:$8806 PRG:0806 A9 FF + sta $0221 ; CPU:$8808 PRG:0808 8D 21 02 + lda #$02 ; CPU:$880B PRG:080B A9 02 + sta $0222 ; CPU:$880D PRG:080D 8D 22 02 + lda #$2C ; CPU:$8810 PRG:0810 A9 2C + sec ; CPU:$8812 PRG:0812 38 + sbc PpuScrollX ; CPU:$8813 PRG:0813 E5 FE + sta $0223 ; CPU:$8815 PRG:0815 8D 23 02 + rts ; CPU:$8818 PRG:0818 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateFlashCounter_OnCarryClear_8819 +; Global: UpdateFlashCounter_OnCarryClear_8819.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateFlashCounter_OnCarryClear_8819: + lda #$F0 ; CPU:$8819 PRG:0819 A9 F0 + sta $0220 ; CPU:$881B PRG:081B 8D 20 02 + rts ; CPU:$881E PRG:081E 60 +; Pass 3: bytecode program not listed in BytecodeProgramPointerTable. +; ---- data $881F-$8836 (24 bytes) ---- +StandaloneBytecodeProgram_1: + .byte $02, $20, $9C, $BF, $03, $19, $C0, $24, $80, $0A, $1E, $1C, $0E, $32, $C0, $01 ; CPU:$881F PRG:081F 02 20 9C BF 03 19 C0 24 80 0A 1E 1C 0E 32 C0 01 + .byte $24, $80, $1B, $18, $1E, $17, $0D, $C0 ; CPU:$882F PRG:082F 24 80 1B 18 1E 17 0D C0 +PlayDeathSequence: + lda #$1F ; CPU:$8837 PRG:0837 A9 1F + sta SourcePointerLo ; CPU:$8839 PRG:0839 85 10 + lda #$88 ; CPU:$883B PRG:083B A9 88 + sta SourcePointerHi ; CPU:$883D PRG:083D 85 11 + jsr $ACF5 ; CPU:$883F PRG:083F 20 F5 AC + jsr $ABB1 ; CPU:$8842 PRG:0842 20 B1 AB + jsr $8882 ; CPU:$8845 PRG:0845 20 82 88 +; ----------------------------------------------------------------------------- +; Routine: PollControllerBits +; Global: Test the start/select bits of the raw controller byte. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +PollControllerBits: + clc ; CPU:$8848 PRG:0848 18 + lda ControllerButtons1 ; CPU:$8849 PRG:0849 A5 FA + and #$10 ; CPU:$884B PRG:084B 29 10 + beq PollControllerBits_JoinBranchPaths_885A ; CPU:$884D PRG:084D F0 0B + lda ControllerButtonsPrev ; CPU:$884F PRG:084F A5 F4 + and #$10 ; CPU:$8851 PRG:0851 29 10 + bne PollControllerBits_JoinBranchPaths_885A ; CPU:$8853 PRG:0853 D0 05 + lda SoundMuted ; CPU:$8855 PRG:0855 A5 E9 + bne SignalVblankComplete ; CPU:$8857 PRG:0857 D0 23 + sec ; CPU:$8859 PRG:0859 38 +; ----------------------------------------------------------------------------- +; Routine: PollControllerBits_JoinBranchPaths_885A +; Global: PollControllerBits_JoinBranchPaths_885A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +PollControllerBits_JoinBranchPaths_885A: + rts ; CPU:$885A PRG:085A 60 +; ----------------------------------------------------------------------------- +; Routine: PollControllerAndAdvance +; Global: Read the controllers and advance the frame counter. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +PollControllerAndAdvance: + jsr $AA56 ; CPU:$885B PRG:085B 20 56 AA + lda ControllerButtons1 ; CPU:$885E PRG:085E A5 FA + and #$10 ; CPU:$8860 PRG:0860 29 10 + beq PollControllerBits_JoinBranchPaths_885A ; CPU:$8862 PRG:0862 F0 F6 + lda ControllerButtonsPrev ; CPU:$8864 PRG:0864 A5 F4 + and #$10 ; CPU:$8866 PRG:0866 29 10 + bne PollControllerBits_JoinBranchPaths_885A ; CPU:$8868 PRG:0868 D0 F0 + beq SignalVblankComplete ; CPU:$886A PRG:086A F0 10 +; ----------------------------------------------------------------------------- +; Routine: PollControllerBitsAlt +; Global: PollControllerBitsAlt.; called from $879B +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +PollControllerBitsAlt: + lda ControllerButtons1 ; CPU:$886C PRG:086C A5 FA + and #$20 ; CPU:$886E PRG:086E 29 20 + beq SignalVblankComplete_JoinBranchPaths_8881 ; CPU:$8870 PRG:0870 F0 0F + lda ControllerButtonsPrev ; CPU:$8872 PRG:0872 A5 F4 + and #$20 ; CPU:$8874 PRG:0874 29 20 + bne SignalVblankComplete_JoinBranchPaths_8881 ; CPU:$8876 PRG:0876 D0 09 + lda SoundMuted ; CPU:$8878 PRG:0878 A5 E9 + beq SignalVblankComplete_JoinBranchPaths_8881 ; CPU:$887A PRG:087A F0 05 +; ----------------------------------------------------------------------------- +; Routine: SignalVblankComplete +; Global: Signal the main loop that the NMI frame is finished. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SignalVblankComplete: + lda #$FF ; CPU:$887C PRG:087C A9 FF + sta $0321 ; CPU:$887E PRG:087E 8D 21 03 +; ----------------------------------------------------------------------------- +; Routine: SignalVblankComplete_JoinBranchPaths_8881 +; Global: SignalVblankComplete_JoinBranchPaths_8881.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SignalVblankComplete_JoinBranchPaths_8881: + rts ; CPU:$8881 PRG:0881 60 +; ----------------------------------------------------------------------------- +; Routine: PollControllerAndCheckRound +; Global: Read the controllers and test the round-transition flag at $0326. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +PollControllerAndCheckRound: + jsr $AA56 ; CPU:$8882 PRG:0882 20 56 AA + lda $0326 ; CPU:$8885 PRG:0885 AD 26 03 + cmp #$02 ; CPU:$8888 PRG:0888 C9 02 + beq PollControllerAndCheckRound_OnZero_888D ; CPU:$888A PRG:088A F0 01 + rts ; CPU:$888C PRG:088C 60 +; ----------------------------------------------------------------------------- +; Routine: PollControllerAndCheckRound_OnZero_888D +; Global: PollControllerAndCheckRound_OnZero_888D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +PollControllerAndCheckRound_OnZero_888D: + lda FrameCounterLo ; CPU:$888D PRG:088D A5 24 + lsr a ; CPU:$888F PRG:088F 4A + lsr a ; CPU:$8890 PRG:0890 4A + bcs PollControllerAndCheckRound_OnCarrySet_8899 ; CPU:$8891 PRG:0891 B0 06 + lda #$0F ; CPU:$8893 PRG:0893 A9 0F + ldx #$27 ; CPU:$8895 PRG:0895 A2 27 + bne PollControllerAndCheckRound_OnNonzero_889D ; CPU:$8897 PRG:0897 D0 04 +; ----------------------------------------------------------------------------- +; Routine: PollControllerAndCheckRound_OnCarrySet_8899 +; Global: PollControllerAndCheckRound_OnCarrySet_8899.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +PollControllerAndCheckRound_OnCarrySet_8899: + lda #$27 ; CPU:$8899 PRG:0899 A9 27 + ldx #$0F ; CPU:$889B PRG:089B A2 0F +; ----------------------------------------------------------------------------- +; Routine: PollControllerAndCheckRound_OnNonzero_889D +; Global: PollControllerAndCheckRound_OnNonzero_889D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +PollControllerAndCheckRound_OnNonzero_889D: + sta $030E ; CPU:$889D PRG:089D 8D 0E 03 + stx $030F ; CPU:$88A0 PRG:08A0 8E 0F 03 + rts ; CPU:$88A3 PRG:08A3 60 +; ----------------------------------------------------------------------------- +; Routine: BuildOamList +; Global: Build the OAM list for the active player: blank every slot, then emit one sprite per visible actor row. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +BuildOamList: + lda $0324 ; CPU:$88A4 PRG:08A4 AD 24 03 + bne BuildOamList_OnNonzero_88AE ; CPU:$88A7 PRG:08A7 D0 05 + ldx #$01 ; CPU:$88A9 PRG:08A9 A2 01 + jsr $88B0 ; CPU:$88AB PRG:08AB 20 B0 88 +; ----------------------------------------------------------------------------- +; Routine: BuildOamList_OnNonzero_88AE +; Global: BuildOamList_OnNonzero_88AE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +BuildOamList_OnNonzero_88AE: + ldx #$00 ; CPU:$88AE PRG:08AE A2 00 +; ----------------------------------------------------------------------------- +; Routine: EmitOamEntry +; Global: Emit a single OAM entry built from the actor record. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +EmitOamEntry: + stx ActorIndex ; CPU:$88B0 PRG:08B0 86 1E + stx SourcePointerLo ; CPU:$88B2 PRG:08B2 86 10 + inc SourcePointerLo ; CPU:$88B4 PRG:08B4 E6 10 + lda $0336,x ; CPU:$88B6 PRG:08B6 BD 36 03 + cmp #$02 ; CPU:$88B9 PRG:08B9 C9 02 + beq EmitOamBlankEntry_JoinBranchPaths_88F3 ; CPU:$88BB PRG:08BB F0 36 + lda ControllerButtons1,x ; CPU:$88BD PRG:08BD B5 FA + and #$90 ; CPU:$88BF PRG:08BF 29 90 + beq EmitOamAtOffset_JoinBranchPaths_890F ; CPU:$88C1 PRG:08C1 F0 4C + lda ControllerButtonsPrev,x ; CPU:$88C3 PRG:08C3 B5 F4 + and #$90 ; CPU:$88C5 PRG:08C5 29 90 + bne EmitOamAtOffset_JoinBranchPaths_890F ; CPU:$88C7 PRG:08C7 D0 46 + jsr $8936 ; CPU:$88C9 PRG:08C9 20 36 89 + ora #$80 ; CPU:$88CC PRG:08CC 09 80 + sta $032E,y ; CPU:$88CE PRG:08CE 99 2E 03 + inc $0336,x ; CPU:$88D1 PRG:08D1 FE 36 03 + lda $0336,x ; CPU:$88D4 PRG:08D4 BD 36 03 + cmp #$02 ; CPU:$88D7 PRG:08D7 C9 02 + bne EmitOamAtOffset ; CPU:$88D9 PRG:08D9 D0 24 + sty Zp2D,x ; CPU:$88DB PRG:08DB 94 2D + txa ; CPU:$88DD PRG:08DD 8A + eor #$01 ; CPU:$88DE PRG:08DE 49 01 + tax ; CPU:$88E0 PRG:08E0 AA + lda $0336,x ; CPU:$88E1 PRG:08E1 BD 36 03 + cmp #$02 ; CPU:$88E4 PRG:08E4 C9 02 + bne EmitOamBlankEntry_JoinBranchPaths_88F3 ; CPU:$88E6 PRG:08E6 D0 0B + jmp $887C ; CPU:$88E8 PRG:08E8 4C 7C 88 +; ----------------------------------------------------------------------------- +; Routine: EmitOamBlankEntry +; Global: EmitOamBlankEntry.; called from $8145, $8148, $8154, $8157, $88F4, $8927 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +EmitOamBlankEntry: + jsr $8936 ; CPU:$88EB PRG:08EB 20 36 89 + lda #$00 ; CPU:$88EE PRG:08EE A9 00 + sta $032E,y ; CPU:$88F0 PRG:08F0 99 2E 03 +; ----------------------------------------------------------------------------- +; Routine: EmitOamBlankEntry_JoinBranchPaths_88F3 +; Global: EmitOamBlankEntry_JoinBranchPaths_88F3.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +EmitOamBlankEntry_JoinBranchPaths_88F3: + rts ; CPU:$88F3 PRG:08F3 60 +; ----------------------------------------------------------------------------- +; Routine: EmitOamBlankEntry_OnZero_88F4 +; Global: EmitOamBlankEntry_OnZero_88F4.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +EmitOamBlankEntry_OnZero_88F4: + jsr $88EB ; CPU:$88F4 PRG:08F4 20 EB 88 + beq EmitOamAtOffset ; CPU:$88F7 PRG:08F7 F0 06 +; ----------------------------------------------------------------------------- +; Routine: EmitOamFromTable +; Global: EmitOamFromTable.; called from $814B, $814E +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +EmitOamFromTable: + jsr $A8D1 ; CPU:$88F9 PRG:08F9 20 D1 A8 + and #$07 ; CPU:$88FC PRG:08FC 29 07 + tay ; CPU:$88FE PRG:08FE A8 +; ----------------------------------------------------------------------------- +; Routine: EmitOamAtOffset +; Global: EmitOamAtOffset.; called from $812A, $812D, $815C, $815F +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +EmitOamAtOffset: + iny ; CPU:$88FF PRG:08FF C8 + tya ; CPU:$8900 PRG:0900 98 + and #$07 ; CPU:$8901 PRG:0901 29 07 + tay ; CPU:$8903 PRG:0903 A8 + lda $032E,y ; CPU:$8904 PRG:0904 B9 2E 03 + bne EmitOamAtOffset ; CPU:$8907 PRG:0907 D0 F6 +; ----------------------------------------------------------------------------- +; Routine: EmitOamAtOffset_OnZero_8909 +; Global: EmitOamAtOffset_OnZero_8909.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +EmitOamAtOffset_OnZero_8909: + lda SourcePointerLo ; CPU:$8909 PRG:0909 A5 10 + sta $032E,y ; CPU:$890B PRG:090B 99 2E 03 + rts ; CPU:$890E PRG:090E 60 +; ----------------------------------------------------------------------------- +; Routine: EmitOamAtOffset_JoinBranchPaths_890F +; Global: EmitOamAtOffset_JoinBranchPaths_890F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +EmitOamAtOffset_JoinBranchPaths_890F: + lda ControllerButtons1,x ; CPU:$890F PRG:090F B5 FA + and #$21 ; CPU:$8911 PRG:0911 29 21 + beq EmitOamAtOffset_OnZero_891B ; CPU:$8913 PRG:0913 F0 06 + lda ControllerButtonsPrev,x ; CPU:$8915 PRG:0915 B5 F4 + and #$21 ; CPU:$8917 PRG:0917 29 21 + beq EmitOamBlankEntry_OnZero_88F4 ; CPU:$8919 PRG:0919 F0 D9 +; ----------------------------------------------------------------------------- +; Routine: EmitOamAtOffset_OnZero_891B +; Global: EmitOamAtOffset_OnZero_891B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +EmitOamAtOffset_OnZero_891B: + lda ControllerButtons1,x ; CPU:$891B PRG:091B B5 FA + and #$02 ; CPU:$891D PRG:091D 29 02 + beq FindFreeOamSlot_JoinBranchPaths_8943 ; CPU:$891F PRG:091F F0 22 + lda ControllerButtonsPrev,x ; CPU:$8921 PRG:0921 B5 F4 + and #$02 ; CPU:$8923 PRG:0923 29 02 + bne FindFreeOamSlot_JoinBranchPaths_8943 ; CPU:$8925 PRG:0925 D0 1C + jsr $88EB ; CPU:$8927 PRG:0927 20 EB 88 +; ----------------------------------------------------------------------------- +; Routine: EmitOamAtOffset_OnNonzero_892A +; Global: EmitOamAtOffset_OnNonzero_892A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +EmitOamAtOffset_OnNonzero_892A: + dey ; CPU:$892A PRG:092A 88 + tya ; CPU:$892B PRG:092B 98 + and #$07 ; CPU:$892C PRG:092C 29 07 + tay ; CPU:$892E PRG:092E A8 + lda $032E,y ; CPU:$892F PRG:092F B9 2E 03 + bne EmitOamAtOffset_OnNonzero_892A ; CPU:$8932 PRG:0932 D0 F6 + beq EmitOamAtOffset_OnZero_8909 ; CPU:$8934 PRG:0934 F0 D3 +; ----------------------------------------------------------------------------- +; Routine: FindFreeOamSlot +; Global: Find the next free OAM slot by scanning the $032E source list for a value matching the running sprite index. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FindFreeOamSlot: + ldy #$07 ; CPU:$8936 PRG:0936 A0 07 +; ----------------------------------------------------------------------------- +; Routine: FindFreeOamSlot_OnNonnegative_8938 +; Global: FindFreeOamSlot_OnNonnegative_8938.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FindFreeOamSlot_OnNonnegative_8938: + lda $032E,y ; CPU:$8938 PRG:0938 B9 2E 03 + cmp SourcePointerLo ; CPU:$893B PRG:093B C5 10 + beq FindFreeOamSlot_OnZero_8942 ; CPU:$893D PRG:093D F0 03 + dey ; CPU:$893F PRG:093F 88 + bpl FindFreeOamSlot_OnNonnegative_8938 ; CPU:$8940 PRG:0940 10 F6 +; ----------------------------------------------------------------------------- +; Routine: FindFreeOamSlot_OnZero_8942 +; Global: FindFreeOamSlot_OnZero_8942.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FindFreeOamSlot_OnZero_8942: + rts ; CPU:$8942 PRG:0942 60 +; ----------------------------------------------------------------------------- +; Routine: FindFreeOamSlot_JoinBranchPaths_8943 +; Global: FindFreeOamSlot_JoinBranchPaths_8943.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FindFreeOamSlot_JoinBranchPaths_8943: + lda $0324 ; CPU:$8943 PRG:0943 AD 24 03 + beq FindFreeOamSlot_JoinBranchPaths_896A ; CPU:$8946 PRG:0946 F0 22 + lda ControllerButtons2 ; CPU:$8948 PRG:0948 A5 FB + and #$C0 ; CPU:$894A PRG:094A 29 C0 + cmp #$C0 ; CPU:$894C PRG:094C C9 C0 + bne FindFreeOamSlot_JoinBranchPaths_896A ; CPU:$894E PRG:094E D0 1A + lda ControllerButtons1 ; CPU:$8950 PRG:0950 A5 FA + and #$40 ; CPU:$8952 PRG:0952 29 40 + beq FindFreeOamSlot_JoinBranchPaths_896A ; CPU:$8954 PRG:0954 F0 14 + lda ControllerButtons2 ; CPU:$8956 PRG:0956 A5 FB + and #$04 ; CPU:$8958 PRG:0958 29 04 + beq FindFreeOamSlot_OnZero_896B ; CPU:$895A PRG:095A F0 0F + lda ControllerButtonsPrev2 ; CPU:$895C PRG:095C A5 F5 + and #$04 ; CPU:$895E PRG:095E 29 04 + bne FindFreeOamSlot_JoinBranchPaths_896A ; CPU:$8960 PRG:0960 D0 08 + lda $0325 ; CPU:$8962 PRG:0962 AD 25 03 + sec ; CPU:$8965 PRG:0965 38 + sbc #$01 ; CPU:$8966 PRG:0966 E9 01 + bne FindFreeOamSlot_OnNonzero_897F ; CPU:$8968 PRG:0968 D0 15 +; ----------------------------------------------------------------------------- +; Routine: FindFreeOamSlot_JoinBranchPaths_896A +; Global: FindFreeOamSlot_JoinBranchPaths_896A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FindFreeOamSlot_JoinBranchPaths_896A: + rts ; CPU:$896A PRG:096A 60 +; ----------------------------------------------------------------------------- +; Routine: FindFreeOamSlot_OnZero_896B +; Global: FindFreeOamSlot_OnZero_896B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FindFreeOamSlot_OnZero_896B: + lda ControllerButtons2 ; CPU:$896B PRG:096B A5 FB + and #$08 ; CPU:$896D PRG:096D 29 08 + beq FindFreeOamSlot_JoinBranchPaths_896A ; CPU:$896F PRG:096F F0 F9 + lda ControllerButtonsPrev2 ; CPU:$8971 PRG:0971 A5 F5 + and #$08 ; CPU:$8973 PRG:0973 29 08 + bne FindFreeOamSlot_JoinBranchPaths_896A ; CPU:$8975 PRG:0975 D0 F3 + lda $0325 ; CPU:$8977 PRG:0977 AD 25 03 + clc ; CPU:$897A PRG:097A 18 + adc #$01 ; CPU:$897B PRG:097B 69 01 + bcs FindFreeOamSlot_JoinBranchPaths_896A ; CPU:$897D PRG:097D B0 EB +; ----------------------------------------------------------------------------- +; Routine: FindFreeOamSlot_OnNonzero_897F +; Global: FindFreeOamSlot_OnNonzero_897F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FindFreeOamSlot_OnNonzero_897F: + sta $0325 ; CPU:$897F PRG:097F 8D 25 03 + sta $0352 ; CPU:$8982 PRG:0982 8D 52 03 + rts ; CPU:$8985 PRG:0985 60 +; ----------------------------------------------------------------------------- +; Routine: CompactOamList +; Global: Compact the OAM list, dropping entries whose actor has moved off screen. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompactOamList: + ldx #$07 ; CPU:$8986 PRG:0986 A2 07 + ldy #$1C ; CPU:$8988 PRG:0988 A0 1C +; ----------------------------------------------------------------------------- +; Routine: CompactOamList_OnNonnegative_898A +; Global: CompactOamList_OnNonnegative_898A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompactOamList_OnNonnegative_898A: + lda $032E,x ; CPU:$898A PRG:098A BD 2E 03 + beq CompactOamList_OnZero_89A8 ; CPU:$898D PRG:098D F0 19 + cmp #$02 ; CPU:$898F PRG:098F C9 02 + bcc CompactOamList_OnCarryClear_89B0 ; CPU:$8991 PRG:0991 90 1D + beq CompactOamList_OnZero_89AC ; CPU:$8993 PRG:0993 F0 17 + cmp #$81 ; CPU:$8995 PRG:0995 C9 81 + beq CompactOamList_OnZero_899D ; CPU:$8997 PRG:0997 F0 04 + lda #$03 ; CPU:$8999 PRG:0999 A9 03 + bne CompactOamList_OnNonzero_899F ; CPU:$899B PRG:099B D0 02 +; ----------------------------------------------------------------------------- +; Routine: CompactOamList_OnZero_899D +; Global: CompactOamList_OnZero_899D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompactOamList_OnZero_899D: + lda #$02 ; CPU:$899D PRG:099D A9 02 +; ----------------------------------------------------------------------------- +; Routine: CompactOamList_OnNonzero_899F +; Global: CompactOamList_OnNonzero_899F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompactOamList_OnNonzero_899F: + sta $0222,y ; CPU:$899F PRG:099F 99 22 02 + lda FrameCounterLo ; CPU:$89A2 PRG:09A2 A5 24 + and #$10 ; CPU:$89A4 PRG:09A4 29 10 + bne CompactOamList_OnNonzero_89B5 ; CPU:$89A6 PRG:09A6 D0 0D +; ----------------------------------------------------------------------------- +; Routine: CompactOamList_OnZero_89A8 +; Global: CompactOamList_OnZero_89A8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompactOamList_OnZero_89A8: + lda #$F0 ; CPU:$89A8 PRG:09A8 A9 F0 + bne CompactOamList_OnNonzero_89B8 ; CPU:$89AA PRG:09AA D0 0C +; ----------------------------------------------------------------------------- +; Routine: CompactOamList_OnZero_89AC +; Global: CompactOamList_OnZero_89AC.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompactOamList_OnZero_89AC: + lda #$03 ; CPU:$89AC PRG:09AC A9 03 + bne CompactOamList_OnNonzero_89B2 ; CPU:$89AE PRG:09AE D0 02 +; ----------------------------------------------------------------------------- +; Routine: CompactOamList_OnCarryClear_89B0 +; Global: CompactOamList_OnCarryClear_89B0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompactOamList_OnCarryClear_89B0: + lda #$02 ; CPU:$89B0 PRG:09B0 A9 02 +; ----------------------------------------------------------------------------- +; Routine: CompactOamList_OnNonzero_89B2 +; Global: CompactOamList_OnNonzero_89B2.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompactOamList_OnNonzero_89B2: + sta $0222,y ; CPU:$89B2 PRG:09B2 99 22 02 +; ----------------------------------------------------------------------------- +; Routine: CompactOamList_OnNonzero_89B5 +; Global: CompactOamList_OnNonzero_89B5.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompactOamList_OnNonzero_89B5: + lda $BEC0,x ; CPU:$89B5 PRG:09B5 BD C0 BE +; ----------------------------------------------------------------------------- +; Routine: CompactOamList_OnNonzero_89B8 +; Global: CompactOamList_OnNonzero_89B8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompactOamList_OnNonzero_89B8: + sta $0220,y ; CPU:$89B8 PRG:09B8 99 20 02 + lda #$FF ; CPU:$89BB PRG:09BB A9 FF + sta $0221,y ; CPU:$89BD PRG:09BD 99 21 02 + lda $BEC8,x ; CPU:$89C0 PRG:09C0 BD C8 BE + sta $0223,y ; CPU:$89C3 PRG:09C3 99 23 02 + dey ; CPU:$89C6 PRG:09C6 88 + dey ; CPU:$89C7 PRG:09C7 88 + dey ; CPU:$89C8 PRG:09C8 88 + dey ; CPU:$89C9 PRG:09C9 88 + dex ; CPU:$89CA PRG:09CA CA + bpl CompactOamList_OnNonnegative_898A ; CPU:$89CB PRG:09CB 10 BD + rts ; CPU:$89CD PRG:09CD 60 +; ----------------------------------------------------------------------------- +; Routine: ReadControllerAndInit +; Global: Read the controllers, reset the per-player bookkeeping, and initialise the object list. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllerAndInit: + lda #$00 ; CPU:$89CE PRG:09CE A9 00 + sta ActorIndex ; CPU:$89D0 PRG:09D0 85 1E + lda #$40 ; CPU:$89D2 PRG:09D2 A9 40 + sta SourcePointerLo ; CPU:$89D4 PRG:09D4 85 10 + lda #$02 ; CPU:$89D6 PRG:09D6 A9 02 + sta SourcePointerHi ; CPU:$89D8 PRG:09D8 85 11 + lda #$70 ; CPU:$89DA PRG:09DA A9 70 + sta DestinationPointerLo ; CPU:$89DC PRG:09DC 85 12 + lda #$B9 ; CPU:$89DE PRG:09DE A9 B9 + sta DestinationPointerHi ; CPU:$89E0 PRG:09E0 85 13 + lda #$00 ; CPU:$89E2 PRG:09E2 A9 00 + sta VramBlockCountLo ; CPU:$89E4 PRG:09E4 85 14 + lda #$04 ; CPU:$89E6 PRG:09E6 A9 04 + sta CollisionFlagBits ; CPU:$89E8 PRG:09E8 85 15 + ldy #$00 ; CPU:$89EA PRG:09EA A0 00 + ldx #$00 ; CPU:$89EC PRG:09EC A2 00 +; ----------------------------------------------------------------------------- +; Routine: ReadControllerAndInit_OnCarryClear_89EE +; Global: ReadControllerAndInit_OnCarryClear_89EE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllerAndInit_OnCarryClear_89EE: + lda $BF90,x ; CPU:$89EE PRG:09EE BD 90 BF + sta Zp16 ; CPU:$89F1 PRG:09F1 85 16 + lda #$02 ; CPU:$89F3 PRG:09F3 A9 02 + sta Zp18 ; CPU:$89F5 PRG:09F5 85 18 +; ----------------------------------------------------------------------------- +; Routine: ReadControllerAndInit_OnNonzero_89F7 +; Global: ReadControllerAndInit_OnNonzero_89F7.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllerAndInit_OnNonzero_89F7: + lda $BF98,x ; CPU:$89F7 PRG:09F7 BD 98 BF + jsr $8C65 ; CPU:$89FA PRG:09FA 20 65 8C + bne ReadControllerAndInit_OnNonzero_89F7 ; CPU:$89FD PRG:09FD D0 F8 + lda DestinationPointerLo ; CPU:$89FF PRG:09FF A5 12 + clc ; CPU:$8A01 PRG:0A01 18 + adc #$C8 ; CPU:$8A02 PRG:0A02 69 C8 + sta DestinationPointerLo ; CPU:$8A04 PRG:0A04 85 12 + lda DestinationPointerHi ; CPU:$8A06 PRG:0A06 A5 13 + adc #$00 ; CPU:$8A08 PRG:0A08 69 00 + sta DestinationPointerHi ; CPU:$8A0A PRG:0A0A 85 13 + lda VramBlockCountLo ; CPU:$8A0C PRG:0A0C A5 14 + adc #$32 ; CPU:$8A0E PRG:0A0E 69 32 + sta VramBlockCountLo ; CPU:$8A10 PRG:0A10 85 14 + lda CollisionFlagBits ; CPU:$8A12 PRG:0A12 A5 15 + adc #$00 ; CPU:$8A14 PRG:0A14 69 00 + sta CollisionFlagBits ; CPU:$8A16 PRG:0A16 85 15 + inx ; CPU:$8A18 PRG:0A18 E8 + cpx #$08 ; CPU:$8A19 PRG:0A19 E0 08 + bcc ReadControllerAndInit_OnCarryClear_89EE ; CPU:$8A1B PRG:0A1B 90 D1 + rts ; CPU:$8A1D PRG:0A1D 60 +; Pass 3: tail of a bytecode program; the $1D byte rules out an instruction decode. +; ---- data $8A1E-$8A27 (10 bytes) ---- +StandaloneBytecodeProgram_2: + .byte $01, $21, $CD, $1C, $0E, $15, $0E, $0C, $1D, $C0 ; CPU:$8A1E PRG:0A1E 01 21 CD 1C 0E 15 0E 0C 1D C0 +UpdateStageActors: + lda Zp8E ; CPU:$8A28 PRG:0A28 A5 8E + bne UpdateStageActors_JoinBranchPaths_8A5D ; CPU:$8A2A PRG:0A2A D0 31 + lda PlayerPaletteIndexHi ; CPU:$8A2C PRG:0A2C A5 92 + bmi UpdateStageActors_JoinBranchPaths_8A5D ; CPU:$8A2E PRG:0A2E 30 2D + lda #$20 ; CPU:$8A30 PRG:0A30 A9 20 + sta $2006 ; CPU:$8A32 PRG:0A32 8D 06 20 + lda #$BF ; CPU:$8A35 PRG:0A35 A9 BF + sta $2006 ; CPU:$8A37 PRG:0A37 8D 06 20 + lda PlayerPaletteIndexHi ; CPU:$8A3A PRG:0A3A A5 92 + sta $2007 ; CPU:$8A3C PRG:0A3C 8D 07 20 + lda #$24 ; CPU:$8A3F PRG:0A3F A9 24 + sta $2006 ; CPU:$8A41 PRG:0A41 8D 06 20 + lda #$A0 ; CPU:$8A44 PRG:0A44 A9 A0 + sta $2006 ; CPU:$8A46 PRG:0A46 8D 06 20 + lda PlayerPaletteIndexLo ; CPU:$8A49 PRG:0A49 A5 91 + sta $2007 ; CPU:$8A4B PRG:0A4B 8D 07 20 + lda #$25 ; CPU:$8A4E PRG:0A4E A9 25 + sta $2007 ; CPU:$8A50 PRG:0A50 8D 07 20 + lda Zp90 ; CPU:$8A53 PRG:0A53 A5 90 + sta $2007 ; CPU:$8A55 PRG:0A55 8D 07 20 + lda Zp8F ; CPU:$8A58 PRG:0A58 A5 8F + sta $2007 ; CPU:$8A5A PRG:0A5A 8D 07 20 +; ----------------------------------------------------------------------------- +; Routine: UpdateStageActors_JoinBranchPaths_8A5D +; Global: UpdateStageActors_JoinBranchPaths_8A5D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateStageActors_JoinBranchPaths_8A5D: + rts ; CPU:$8A5D PRG:0A5D 60 +; ----------------------------------------------------------------------------- +; Routine: SpawnStageActors +; Global: SpawnStageActors.; called from $8795, $8AE5 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnStageActors: + lda Zp8A ; CPU:$8A5E PRG:0A5E A5 8A + beq SpawnStageActors_OnZero_8AA5 ; CPU:$8A60 PRG:0A60 F0 43 + ldx #$00 ; CPU:$8A62 PRG:0A62 A2 00 + ror a ; CPU:$8A64 PRG:0A64 6A + bcc SpawnStageActors_OnCarryClear_8A68 ; CPU:$8A65 PRG:0A65 90 01 + inx ; CPU:$8A67 PRG:0A67 E8 +; ----------------------------------------------------------------------------- +; Routine: SpawnStageActors_OnCarryClear_8A68 +; Global: SpawnStageActors_OnCarryClear_8A68.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnStageActors_OnCarryClear_8A68: + lda PlayerActionState,x ; CPU:$8A68 PRG:0A68 B5 F0 + beq SpawnStageActors_OnZero_8A74 ; CPU:$8A6A PRG:0A6A F0 08 + cmp #$80 ; CPU:$8A6C PRG:0A6C C9 80 + beq SpawnStageActors_OnZero_8A74 ; CPU:$8A6E PRG:0A6E F0 04 + cmp #$D0 ; CPU:$8A70 PRG:0A70 C9 D0 + bne SpawnStageActors_OnNonzero_8A84 ; CPU:$8A72 PRG:0A72 D0 10 +; ----------------------------------------------------------------------------- +; Routine: SpawnStageActors_OnZero_8A74 +; Global: SpawnStageActors_OnZero_8A74.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnStageActors_OnZero_8A74: + lda #$80 ; CPU:$8A74 PRG:0A74 A9 80 + sta PlayerActionState,x ; CPU:$8A76 PRG:0A76 95 F0 + txa ; CPU:$8A78 PRG:0A78 8A + asl a ; CPU:$8A79 PRG:0A79 0A + asl a ; CPU:$8A7A PRG:0A7A 0A + tay ; CPU:$8A7B PRG:0A7B A8 + lda #$00 ; CPU:$8A7C PRG:0A7C A9 00 + sta $0034,y ; CPU:$8A7E PRG:0A7E 99 34 00 + sta $0033,y ; CPU:$8A81 PRG:0A81 99 33 00 +; ----------------------------------------------------------------------------- +; Routine: SpawnStageActors_OnNonzero_8A84 +; Global: SpawnStageActors_OnNonzero_8A84.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnStageActors_OnNonzero_8A84: + jsr $A4FF ; CPU:$8A84 PRG:0A84 20 FF A4 + lda PlayerActionState,x ; CPU:$8A87 PRG:0A87 B5 F0 + beq SpawnStageActors_OnZero_8A93 ; CPU:$8A89 PRG:0A89 F0 08 + cmp #$80 ; CPU:$8A8B PRG:0A8B C9 80 + beq SpawnStageActors_OnZero_8A93 ; CPU:$8A8D PRG:0A8D F0 04 + cmp #$D0 ; CPU:$8A8F PRG:0A8F C9 D0 + bne SpawnStageActors_JoinBranchPaths_8AA4 ; CPU:$8A91 PRG:0A91 D0 11 +; ----------------------------------------------------------------------------- +; Routine: SpawnStageActors_OnZero_8A93 +; Global: SpawnStageActors_OnZero_8A93.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnStageActors_OnZero_8A93: + txa ; CPU:$8A93 PRG:0A93 8A + asl a ; CPU:$8A94 PRG:0A94 0A + asl a ; CPU:$8A95 PRG:0A95 0A + tay ; CPU:$8A96 PRG:0A96 A8 + lda #$64 ; CPU:$8A97 PRG:0A97 A9 64 + sta $0034,y ; CPU:$8A99 PRG:0A99 99 34 00 + lda #$FE ; CPU:$8A9C PRG:0A9C A9 FE + sta PlayerActionState,x ; CPU:$8A9E PRG:0A9E 95 F0 + lda #$00 ; CPU:$8AA0 PRG:0AA0 A9 00 + sta ScriptFlags,x ; CPU:$8AA2 PRG:0AA2 95 41 +; ----------------------------------------------------------------------------- +; Routine: SpawnStageActors_JoinBranchPaths_8AA4 +; Global: SpawnStageActors_JoinBranchPaths_8AA4.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnStageActors_JoinBranchPaths_8AA4: + rts ; CPU:$8AA4 PRG:0AA4 60 +; ----------------------------------------------------------------------------- +; Routine: SpawnStageActors_OnZero_8AA5 +; Global: SpawnStageActors_OnZero_8AA5.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnStageActors_OnZero_8AA5: + lda RoundTransitionTimer ; CPU:$8AA5 PRG:0AA5 A5 8D + bne SpawnStageActors_JoinBranchPaths_8AA4 ; CPU:$8AA7 PRG:0AA7 D0 FB + dec Zp8E ; CPU:$8AA9 PRG:0AA9 C6 8E + bpl SpawnStageActors_JoinBranchPaths_8AA4 ; CPU:$8AAB PRG:0AAB 10 F7 + lda #$05 ; CPU:$8AAD PRG:0AAD A9 05 + sta Zp8E ; CPU:$8AAF PRG:0AAF 85 8E + dec Zp8F ; CPU:$8AB1 PRG:0AB1 C6 8F + bpl SpawnStageActors_JoinBranchPaths_8AA4 ; CPU:$8AB3 PRG:0AB3 10 EF + lda #$09 ; CPU:$8AB5 PRG:0AB5 A9 09 + sta Zp8F ; CPU:$8AB7 PRG:0AB7 85 8F + dec Zp90 ; CPU:$8AB9 PRG:0AB9 C6 90 + bpl SpawnStageActors_JoinBranchPaths_8AA4 ; CPU:$8ABB PRG:0ABB 10 E7 + lda #$05 ; CPU:$8ABD PRG:0ABD A9 05 + sta Zp90 ; CPU:$8ABF PRG:0ABF 85 90 + dec PlayerPaletteIndexLo ; CPU:$8AC1 PRG:0AC1 C6 91 + bpl SpawnStageActors_JoinBranchPaths_8AA4 ; CPU:$8AC3 PRG:0AC3 10 DF + lda #$09 ; CPU:$8AC5 PRG:0AC5 A9 09 + sta PlayerPaletteIndexLo ; CPU:$8AC7 PRG:0AC7 85 91 + dec PlayerPaletteIndexHi ; CPU:$8AC9 PRG:0AC9 C6 92 + bpl SpawnStageActors_JoinBranchPaths_8AA4 ; CPU:$8ACB PRG:0ACB 10 D7 + ldx #$01 ; CPU:$8ACD PRG:0ACD A2 01 + lda $032C ; CPU:$8ACF PRG:0ACF AD 2C 03 + bne SpawnStageActors_JoinBranchPaths_8AE1 ; CPU:$8AD2 PRG:0AD2 D0 0D + inx ; CPU:$8AD4 PRG:0AD4 E8 + lda $032B ; CPU:$8AD5 PRG:0AD5 AD 2B 03 + bne SpawnStageActors_JoinBranchPaths_8AE1 ; CPU:$8AD8 PRG:0AD8 D0 07 + lda Zp4F ; CPU:$8ADA PRG:0ADA A5 4F + cmp Zp50 ; CPU:$8ADC PRG:0ADC C5 50 + bcs SpawnStageActors_JoinBranchPaths_8AE1 ; CPU:$8ADE PRG:0ADE B0 01 + dex ; CPU:$8AE0 PRG:0AE0 CA +; ----------------------------------------------------------------------------- +; Routine: SpawnStageActors_JoinBranchPaths_8AE1 +; Global: SpawnStageActors_JoinBranchPaths_8AE1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnStageActors_JoinBranchPaths_8AE1: + stx Zp8A ; CPU:$8AE1 PRG:0AE1 86 8A + stx Zp93 ; CPU:$8AE3 PRG:0AE3 86 93 + jmp $8A5E ; CPU:$8AE5 PRG:0AE5 4C 5E 8A +; ----------------------------------------------------------------------------- +; Routine: UpdateAttributeTable +; Global: Rewrite the attribute table entry at $209C through the compressed stream writer. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateAttributeTable: + lda #$20 ; CPU:$8AE8 PRG:0AE8 A9 20 + sta $2006 ; CPU:$8AEA PRG:0AEA 8D 06 20 + lda #$9C ; CPU:$8AED PRG:0AED A9 9C + sta $2006 ; CPU:$8AEF PRG:0AEF 8D 06 20 + lda #$32 ; CPU:$8AF2 PRG:0AF2 A9 32 + jsr $8B20 ; CPU:$8AF4 PRG:0AF4 20 20 8B + lda #$32 ; CPU:$8AF7 PRG:0AF7 A9 32 + sta $2007 ; CPU:$8AF9 PRG:0AF9 8D 07 20 + lda #$2E ; CPU:$8AFC PRG:0AFC A9 2E + sta SourcePointerLo ; CPU:$8AFE PRG:0AFE 85 10 + lda #$88 ; CPU:$8B00 PRG:0B00 A9 88 + sta SourcePointerHi ; CPU:$8B02 PRG:0B02 85 11 + jmp $ACF5 ; CPU:$8B04 PRG:0B04 4C F5 AC +; ----------------------------------------------------------------------------- +; Routine: ClearScrollLatch +; Global: ClearScrollLatch.; called from $83FC, $86AD +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearScrollLatch: + lda $0352 ; CPU:$8B07 PRG:0B07 AD 52 03 + bne ClearScrollLatch_OnNonzero_8B0D ; CPU:$8B0A PRG:0B0A D0 01 + rts ; CPU:$8B0C PRG:0B0C 60 +; ----------------------------------------------------------------------------- +; Routine: ClearScrollLatch_OnNonzero_8B0D +; Global: ClearScrollLatch_OnNonzero_8B0D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearScrollLatch_OnNonzero_8B0D: + lda #$22 ; CPU:$8B0D PRG:0B0D A9 22 + sta $2006 ; CPU:$8B0F PRG:0B0F 8D 06 20 + lda #$0E ; CPU:$8B12 PRG:0B12 A9 0E + sta $2006 ; CPU:$8B14 PRG:0B14 8D 06 20 + lda #$32 ; CPU:$8B17 PRG:0B17 A9 32 + sta Zp16 ; CPU:$8B19 PRG:0B19 85 16 + lda $0352 ; CPU:$8B1B PRG:0B1B AD 52 03 + bne WriteNametableTile_OnNonzero_8B25 ; CPU:$8B1E PRG:0B1E D0 05 +; ----------------------------------------------------------------------------- +; Routine: WriteNametableTile +; Global: Write one tile into the nametable at the address in zero page $10/$11 plus the per-round offset. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteNametableTile: + sta Zp16 ; CPU:$8B20 PRG:0B20 85 16 + lda $0325 ; CPU:$8B22 PRG:0B22 AD 25 03 +; ----------------------------------------------------------------------------- +; Routine: WriteNametableTile_OnNonzero_8B25 +; Global: WriteNametableTile_OnNonzero_8B25.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteNametableTile_OnNonzero_8B25: + sta SourcePointerLo ; CPU:$8B25 PRG:0B25 85 10 + lda #$00 ; CPU:$8B27 PRG:0B27 A9 00 + sta Zp95 ; CPU:$8B29 PRG:0B29 85 95 + sta SourcePointerHi ; CPU:$8B2B PRG:0B2B 85 11 + sta DestinationPointerLo ; CPU:$8B2D PRG:0B2D 85 12 + ldx #$0F ; CPU:$8B2F PRG:0B2F A2 0F + bne ClearAttributeRegion_JoinBranchPaths_8B37 ; CPU:$8B31 PRG:0B31 D0 04 +; ----------------------------------------------------------------------------- +; Routine: ClearAttributeRegion +; Global: ClearAttributeRegion.; called from $8BF2 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearAttributeRegion: + ldx #$00 ; CPU:$8B33 PRG:0B33 A2 00 + stx Zp95 ; CPU:$8B35 PRG:0B35 86 95 +; ----------------------------------------------------------------------------- +; Routine: ClearAttributeRegion_JoinBranchPaths_8B37 +; Global: ClearAttributeRegion_JoinBranchPaths_8B37.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearAttributeRegion_JoinBranchPaths_8B37: + lda #$00 ; CPU:$8B37 PRG:0B37 A9 00 + sta DestinationPointerHi ; CPU:$8B39 PRG:0B39 85 13 +; ----------------------------------------------------------------------------- +; Routine: ClearAttributeRegion_OnNonnegative_8B3B +; Global: ClearAttributeRegion_OnNonnegative_8B3B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearAttributeRegion_OnNonnegative_8B3B: + sec ; CPU:$8B3B PRG:0B3B 38 + lda SourcePointerLo ; CPU:$8B3C PRG:0B3C A5 10 + sbc $8B7D,x ; CPU:$8B3E PRG:0B3E FD 7D 8B + sta VramBlockCountLo ; CPU:$8B41 PRG:0B41 85 14 + lda SourcePointerHi ; CPU:$8B43 PRG:0B43 A5 11 + sbc $8B7E,x ; CPU:$8B45 PRG:0B45 FD 7E 8B + sta CollisionFlagBits ; CPU:$8B48 PRG:0B48 85 15 + lda DestinationPointerLo ; CPU:$8B4A PRG:0B4A A5 12 + sbc $8B7F,x ; CPU:$8B4C PRG:0B4C FD 7F 8B + bcc ClearAttributeRegion_OnCarryClear_8B5F ; CPU:$8B4F PRG:0B4F 90 0E + sta DestinationPointerLo ; CPU:$8B51 PRG:0B51 85 12 + lda CollisionFlagBits ; CPU:$8B53 PRG:0B53 A5 15 + sta SourcePointerHi ; CPU:$8B55 PRG:0B55 85 11 + lda VramBlockCountLo ; CPU:$8B57 PRG:0B57 A5 14 + sta SourcePointerLo ; CPU:$8B59 PRG:0B59 85 10 + inc DestinationPointerHi ; CPU:$8B5B PRG:0B5B E6 13 + bpl ClearAttributeRegion_OnNonnegative_8B3B ; CPU:$8B5D PRG:0B5D 10 DC +; ----------------------------------------------------------------------------- +; Routine: ClearAttributeRegion_OnCarryClear_8B5F +; Global: ClearAttributeRegion_OnCarryClear_8B5F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearAttributeRegion_OnCarryClear_8B5F: + lda DestinationPointerHi ; CPU:$8B5F PRG:0B5F A5 13 + beq ClearAttributeRegion_OnZero_8B67 ; CPU:$8B61 PRG:0B61 F0 04 + dec Zp95 ; CPU:$8B63 PRG:0B63 C6 95 + bne ClearAttributeRegion_JoinBranchPaths_8B6D ; CPU:$8B65 PRG:0B65 D0 06 +; ----------------------------------------------------------------------------- +; Routine: ClearAttributeRegion_OnZero_8B67 +; Global: ClearAttributeRegion_OnZero_8B67.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearAttributeRegion_OnZero_8B67: + bit Zp95 ; CPU:$8B67 PRG:0B67 24 95 + bmi ClearAttributeRegion_JoinBranchPaths_8B6D ; CPU:$8B69 PRG:0B69 30 02 + lda Zp16 ; CPU:$8B6B PRG:0B6B A5 16 +; ----------------------------------------------------------------------------- +; Routine: ClearAttributeRegion_JoinBranchPaths_8B6D +; Global: ClearAttributeRegion_JoinBranchPaths_8B6D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearAttributeRegion_JoinBranchPaths_8B6D: + sta $2007 ; CPU:$8B6D PRG:0B6D 8D 07 20 + inx ; CPU:$8B70 PRG:0B70 E8 + inx ; CPU:$8B71 PRG:0B71 E8 + inx ; CPU:$8B72 PRG:0B72 E8 + cpx #$15 ; CPU:$8B73 PRG:0B73 E0 15 + bcc ClearAttributeRegion_JoinBranchPaths_8B37 ; CPU:$8B75 PRG:0B75 90 C0 + lda SourcePointerLo ; CPU:$8B77 PRG:0B77 A5 10 + sta $2007 ; CPU:$8B79 PRG:0B79 8D 07 20 + rts ; CPU:$8B7C PRG:0B7C 60 +; Pass 3: 7 x 3-byte deltas {source lo, source hi, destination lo}. ClearAttributeRegion walks it with three `sbc table,x` against the same index. +; ---- data $8B7D-$8B91 (21 bytes) ---- +AttributeBlockDeltaTable: + .byte $80, $96, $98, $40, $42, $0F, $A0, $86, $01, $10, $27, $00, $E8, $03, $00, $64 ; CPU:$8B7D PRG:0B7D 80 96 98 40 42 0F A0 86 01 10 27 00 E8 03 00 64 + .byte $00, $00, $0A, $00, $00 ; CPU:$8B8D PRG:0B8D 00 00 0A 00 00 +RenderHudDigits: + jsr $ABE4 ; CPU:$8B92 PRG:0B92 20 E4 AB + lda #$30 ; CPU:$8B95 PRG:0B95 A9 30 + sta Zp16 ; CPU:$8B97 PRG:0B97 85 16 + lda $0324 ; CPU:$8B99 PRG:0B99 AD 24 03 + bne RenderHudDigits_OnNonzero_8BBA ; CPU:$8B9C PRG:0B9C D0 1C + lda $0343 ; CPU:$8B9E PRG:0B9E AD 43 03 + sta SourcePointerLo ; CPU:$8BA1 PRG:0BA1 85 10 + lda $0344 ; CPU:$8BA3 PRG:0BA3 AD 44 03 + sta SourcePointerHi ; CPU:$8BA6 PRG:0BA6 85 11 + lda $0345 ; CPU:$8BA8 PRG:0BA8 AD 45 03 + sta DestinationPointerLo ; CPU:$8BAB PRG:0BAB 85 12 + jsr $8BF8 ; CPU:$8BAD PRG:0BAD 20 F8 8B + lda #$22 ; CPU:$8BB0 PRG:0BB0 A9 22 + sta $2006 ; CPU:$8BB2 PRG:0BB2 8D 06 20 + lda #$F0 ; CPU:$8BB5 PRG:0BB5 A9 F0 + jsr $8BEF ; CPU:$8BB7 PRG:0BB7 20 EF 8B +; ----------------------------------------------------------------------------- +; Routine: RenderHudDigits_OnNonzero_8BBA +; Global: RenderHudDigits_OnNonzero_8BBA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RenderHudDigits_OnNonzero_8BBA: + lda $0328 ; CPU:$8BBA PRG:0BBA AD 28 03 + sta SourcePointerLo ; CPU:$8BBD PRG:0BBD 85 10 + lda $0329 ; CPU:$8BBF PRG:0BBF AD 29 03 + sta SourcePointerHi ; CPU:$8BC2 PRG:0BC2 85 11 + lda $032A ; CPU:$8BC4 PRG:0BC4 AD 2A 03 + sta DestinationPointerLo ; CPU:$8BC7 PRG:0BC7 85 12 + jsr $8BF8 ; CPU:$8BC9 PRG:0BC9 20 F8 8B + lda #$22 ; CPU:$8BCC PRG:0BCC A9 22 + sta $2006 ; CPU:$8BCE PRG:0BCE 8D 06 20 + lda #$50 ; CPU:$8BD1 PRG:0BD1 A9 50 + jsr $8BEF ; CPU:$8BD3 PRG:0BD3 20 EF 8B + lda $0340 ; CPU:$8BD6 PRG:0BD6 AD 40 03 + sta SourcePointerLo ; CPU:$8BD9 PRG:0BD9 85 10 + lda $0341 ; CPU:$8BDB PRG:0BDB AD 41 03 + sta SourcePointerHi ; CPU:$8BDE PRG:0BDE 85 11 + lda $0342 ; CPU:$8BE0 PRG:0BE0 AD 42 03 + sta DestinationPointerLo ; CPU:$8BE3 PRG:0BE3 85 12 + jsr $8BF8 ; CPU:$8BE5 PRG:0BE5 20 F8 8B + lda #$22 ; CPU:$8BE8 PRG:0BE8 A9 22 + sta $2006 ; CPU:$8BEA PRG:0BEA 8D 06 20 + lda #$B0 ; CPU:$8BED PRG:0BED A9 B0 +; ----------------------------------------------------------------------------- +; Routine: RenderHudDigitDescriptor +; Global: RenderHudDigitDescriptor.; called from $8BB7, $8BD3 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RenderHudDigitDescriptor: + sta $2006 ; CPU:$8BEF PRG:0BEF 8D 06 20 + jsr $8B33 ; CPU:$8BF2 PRG:0BF2 20 33 8B + jmp $ABE4 ; CPU:$8BF5 PRG:0BF5 4C E4 AB +; ----------------------------------------------------------------------------- +; Routine: SetRenderingOn +; Global: Re-enable rendering: PPUCTRL=$10 with PPUMASK left at zero and the shadow updated. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetRenderingOn: + lda #$10 ; CPU:$8BF8 PRG:0BF8 A9 10 + sta PpuCtrlShadow ; CPU:$8BFA PRG:0BFA 85 FC + sta $2000 ; CPU:$8BFC PRG:0BFC 8D 00 20 +; ----------------------------------------------------------------------------- +; Routine: SetRenderingOn_OnNonnegative_8BFF +; Global: SetRenderingOn_OnNonnegative_8BFF.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetRenderingOn_OnNonnegative_8BFF: + lda $2002 ; CPU:$8BFF PRG:0BFF AD 02 20 + bpl SetRenderingOn_OnNonnegative_8BFF ; CPU:$8C02 PRG:0C02 10 FB + rts ; CPU:$8C04 PRG:0C04 60 +; ----------------------------------------------------------------------------- +; Routine: AdvanceAnimationSlot +; Global: Advance the animation slot below the current one. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceAnimationSlot: + ldx PlayerCount ; CPU:$8C05 PRG:0C05 A6 94 + dex ; CPU:$8C07 PRG:0C07 CA + jsr $A4FF ; CPU:$8C08 PRG:0C08 20 FF A4 + jmp $8C11 ; CPU:$8C0B PRG:0C0B 4C 11 8C +; ----------------------------------------------------------------------------- +; Routine: QueueVramTransfer +; Global: Queue a VRAM descriptor built from the PlayerCount-relative index. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramTransfer: + ldx PlayerCount ; CPU:$8C0E PRG:0C0E A6 94 + dex ; CPU:$8C10 PRG:0C10 CA +; ----------------------------------------------------------------------------- +; Routine: QueueVramTransferAlt +; Global: QueueVramTransferAlt.; called from $8C0B +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramTransferAlt: + txa ; CPU:$8C11 PRG:0C11 8A + asl a ; CPU:$8C12 PRG:0C12 0A + tax ; CPU:$8C13 PRG:0C13 AA + lda PlayerSpriteIndex1,x ; CPU:$8C14 PRG:0C14 B5 26 + sta BytecodeHandlerPointerLo ; CPU:$8C16 PRG:0C16 85 1C + lda PlayerSpriteIndex2,x ; CPU:$8C18 PRG:0C18 B5 27 + sta BytecodeHandlerPointerHi ; CPU:$8C1A PRG:0C1A 85 1D + lda #$14 ; CPU:$8C1C PRG:0C1C A9 14 + sta DestinationPointerLo ; CPU:$8C1E PRG:0C1E 85 12 + lda #$03 ; CPU:$8C20 PRG:0C20 A9 03 + sta DestinationPointerHi ; CPU:$8C22 PRG:0C22 85 13 + lda BytecodeHandlerPointerHi ; CPU:$8C24 PRG:0C24 A5 1D + jsr $A253 ; CPU:$8C26 PRG:0C26 20 53 A2 + lda BytecodeHandlerPointerLo ; CPU:$8C29 PRG:0C29 A5 1C + jsr $A253 ; CPU:$8C2B PRG:0C2B 20 53 A2 + lda #$40 ; CPU:$8C2E PRG:0C2E A9 40 + sta SourcePointerLo ; CPU:$8C30 PRG:0C30 85 10 + lda #$02 ; CPU:$8C32 PRG:0C32 A9 02 + sta SourcePointerHi ; CPU:$8C34 PRG:0C34 85 11 + ldx #$01 ; CPU:$8C36 PRG:0C36 A2 01 + stx ActorIndex ; CPU:$8C38 PRG:0C38 86 1E +; ----------------------------------------------------------------------------- +; Routine: QueueVramTransferAlt_OnNonnegative_8C3A +; Global: QueueVramTransferAlt_OnNonnegative_8C3A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramTransferAlt_OnNonnegative_8C3A: + ldx ActorIndex ; CPU:$8C3A PRG:0C3A A6 1E + lda BytecodeHandlerPointerLo,x ; CPU:$8C3C PRG:0C3C B5 1C + jsr $8CB8 ; CPU:$8C3E PRG:0C3E 20 B8 8C + lda Zp16 ; CPU:$8C41 PRG:0C41 A5 16 + sta VramBlockCountLo ; CPU:$8C43 PRG:0C43 85 14 + lda Zp17 ; CPU:$8C45 PRG:0C45 A5 17 + sta CollisionFlagBits ; CPU:$8C47 PRG:0C47 85 15 + ldy #$00 ; CPU:$8C49 PRG:0C49 A0 00 + ldx ActorIndex ; CPU:$8C4B PRG:0C4B A6 1E + lda #$50 ; CPU:$8C4D PRG:0C4D A9 50 + sta Zp16 ; CPU:$8C4F PRG:0C4F 85 16 + lda #$04 ; CPU:$8C51 PRG:0C51 A9 04 + sta Zp18 ; CPU:$8C53 PRG:0C53 85 18 +; ----------------------------------------------------------------------------- +; Routine: QueueVramTransferAlt_OnNonzero_8C55 +; Global: QueueVramTransferAlt_OnNonzero_8C55.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramTransferAlt_OnNonzero_8C55: + txa ; CPU:$8C55 PRG:0C55 8A + lsr a ; CPU:$8C56 PRG:0C56 4A + ror a ; CPU:$8C57 PRG:0C57 6A + ror a ; CPU:$8C58 PRG:0C58 6A + adc #$50 ; CPU:$8C59 PRG:0C59 69 50 + jsr $8C65 ; CPU:$8C5B PRG:0C5B 20 65 8C + bne QueueVramTransferAlt_OnNonzero_8C55 ; CPU:$8C5E PRG:0C5E D0 F5 + dec ActorIndex ; CPU:$8C60 PRG:0C60 C6 1E + bpl QueueVramTransferAlt_OnNonnegative_8C3A ; CPU:$8C62 PRG:0C62 10 D6 + rts ; CPU:$8C64 PRG:0C64 60 +; ----------------------------------------------------------------------------- +; Routine: ExecuteVramTransfer +; Global: Execute the queued VRAM transfer: copy bytes from (BytecodeStreamPointerLo/Hi) through the destination pointer and the two block counters. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ExecuteVramTransfer: + sta Zp17 ; CPU:$8C65 PRG:0C65 85 17 + lda (VramBlockCountLo),y ; CPU:$8C67 PRG:0C67 B1 14 + sta BytecodeStreamPointerLo ; CPU:$8C69 PRG:0C69 85 1A + jsr $ACD7 ; CPU:$8C6B PRG:0C6B 20 D7 AC + lda #$04 ; CPU:$8C6E PRG:0C6E A9 04 + sta Zp19 ; CPU:$8C70 PRG:0C70 85 19 +; ----------------------------------------------------------------------------- +; Routine: ExecuteVramTransfer_OnNonzero_8C72 +; Global: ExecuteVramTransfer_OnNonzero_8C72.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ExecuteVramTransfer_OnNonzero_8C72: + lda Zp16 ; CPU:$8C72 PRG:0C72 A5 16 + sta (SourcePointerLo),y ; CPU:$8C74 PRG:0C74 91 10 + lda (DestinationPointerLo),y ; CPU:$8C76 PRG:0C76 B1 12 + cmp #$FF ; CPU:$8C78 PRG:0C78 C9 FF + beq ExecuteVramTransfer_OnZero_8C98 ; CPU:$8C7A PRG:0C7A F0 1C + pha ; CPU:$8C7C PRG:0C7C 48 + jsr $AC88 ; CPU:$8C7D PRG:0C7D 20 88 AC + pla ; CPU:$8C80 PRG:0C80 68 + sta (SourcePointerLo),y ; CPU:$8C81 PRG:0C81 91 10 + jsr $AC88 ; CPU:$8C83 PRG:0C83 20 88 AC + lda BytecodeStreamPointerLo ; CPU:$8C86 PRG:0C86 A5 1A + and #$C0 ; CPU:$8C88 PRG:0C88 29 C0 + ora ActorIndex ; CPU:$8C8A PRG:0C8A 05 1E + sta (SourcePointerLo),y ; CPU:$8C8C PRG:0C8C 91 10 + jsr $AC88 ; CPU:$8C8E PRG:0C8E 20 88 AC + lda Zp17 ; CPU:$8C91 PRG:0C91 A5 17 + sta (SourcePointerLo),y ; CPU:$8C93 PRG:0C93 91 10 + jsr $AC88 ; CPU:$8C95 PRG:0C95 20 88 AC +; ----------------------------------------------------------------------------- +; Routine: ExecuteVramTransfer_OnZero_8C98 +; Global: ExecuteVramTransfer_OnZero_8C98.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ExecuteVramTransfer_OnZero_8C98: + jsr $ACC9 ; CPU:$8C98 PRG:0C98 20 C9 AC + asl BytecodeStreamPointerLo ; CPU:$8C9B PRG:0C9B 06 1A + asl BytecodeStreamPointerLo ; CPU:$8C9D PRG:0C9D 06 1A + lda Zp17 ; CPU:$8C9F PRG:0C9F A5 17 + clc ; CPU:$8CA1 PRG:0CA1 18 + adc #$08 ; CPU:$8CA2 PRG:0CA2 69 08 + sta Zp17 ; CPU:$8CA4 PRG:0CA4 85 17 + dec Zp19 ; CPU:$8CA6 PRG:0CA6 C6 19 + bne ExecuteVramTransfer_OnNonzero_8C72 ; CPU:$8CA8 PRG:0CA8 D0 C8 + lda #$F0 ; CPU:$8CAA PRG:0CAA A9 F0 + sta (SourcePointerLo),y ; CPU:$8CAC PRG:0CAC 91 10 + lda Zp16 ; CPU:$8CAE PRG:0CAE A5 16 + clc ; CPU:$8CB0 PRG:0CB0 18 + adc #$08 ; CPU:$8CB1 PRG:0CB1 69 08 + sta Zp16 ; CPU:$8CB3 PRG:0CB3 85 16 + dec Zp18 ; CPU:$8CB5 PRG:0CB5 C6 18 + rts ; CPU:$8CB7 PRG:0CB7 60 +; ----------------------------------------------------------------------------- +; Routine: QueueVramDescriptor +; Global: Push a VRAM descriptor and bump the queue index. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramDescriptor: + pha ; CPU:$8CB8 PRG:0CB8 48 + sta Zp18 ; CPU:$8CB9 PRG:0CB9 85 18 + lda #$34 ; CPU:$8CBB PRG:0CBB A9 34 + sta DestinationPointerLo ; CPU:$8CBD PRG:0CBD 85 12 + lda #$00 ; CPU:$8CBF PRG:0CBF A9 00 + sta DestinationPointerHi ; CPU:$8CC1 PRG:0CC1 85 13 + jsr $A0FB ; CPU:$8CC3 PRG:0CC3 20 FB A0 + lda Zp19 ; CPU:$8CC6 PRG:0CC6 A5 19 + clc ; CPU:$8CC8 PRG:0CC8 18 + adc $034C ; CPU:$8CC9 PRG:0CC9 6D 4C 03 + sta Zp16 ; CPU:$8CCC PRG:0CCC 85 16 + lda VramBlockCountLo ; CPU:$8CCE PRG:0CCE A5 14 + adc $034D ; CPU:$8CD0 PRG:0CD0 6D 4D 03 + sta Zp17 ; CPU:$8CD3 PRG:0CD3 85 17 + pla ; CPU:$8CD5 PRG:0CD5 68 + sta Zp18 ; CPU:$8CD6 PRG:0CD6 85 18 + lda #$D0 ; CPU:$8CD8 PRG:0CD8 A9 D0 + sta DestinationPointerLo ; CPU:$8CDA PRG:0CDA 85 12 + jsr $A0FB ; CPU:$8CDC PRG:0CDC 20 FB A0 + lda Zp19 ; CPU:$8CDF PRG:0CDF A5 19 + clc ; CPU:$8CE1 PRG:0CE1 18 + adc $034E ; CPU:$8CE2 PRG:0CE2 6D 4E 03 + sta DestinationPointerLo ; CPU:$8CE5 PRG:0CE5 85 12 + lda VramBlockCountLo ; CPU:$8CE7 PRG:0CE7 A5 14 + adc $034F ; CPU:$8CE9 PRG:0CE9 6D 4F 03 + sta DestinationPointerHi ; CPU:$8CEC PRG:0CEC 85 13 + rts ; CPU:$8CEE PRG:0CEE 60 +; Pass 3: 38 x 16-bit pointers into the bytecode programs that follow. RunBytecodeInterpreter masks the program index with $3F, so entries 38-63 would read past this table; entry 38 already reads the first byte of BytecodeProgram_00, so the table is exactly 38 entries. +; ---- data $8CEF-$8D3A (76 bytes) ---- +BytecodeProgramPointerTable: + .word $907D ; entry 0 -> $907D ; CPU:$8CEF PRG:0CEF 7D 90 + .word $9081 ; entry 1 -> $9081 ; CPU:$8CF1 PRG:0CF1 81 90 + .word $90CA ; entry 2 -> $90CA ; CPU:$8CF3 PRG:0CF3 CA 90 + .word $90DE ; entry 3 -> $90DE ; CPU:$8CF5 PRG:0CF5 DE 90 + .word $9119 ; entry 4 -> $9119 ; CPU:$8CF7 PRG:0CF7 19 91 + .word $90B9 ; entry 5 -> $90B9 ; CPU:$8CF9 PRG:0CF9 B9 90 + .word $9131 ; entry 6 -> $9131 ; CPU:$8CFB PRG:0CFB 31 91 + .word $9136 ; entry 7 -> $9136 ; CPU:$8CFD PRG:0CFD 36 91 + .word $9141 ; entry 8 -> $9141 ; CPU:$8CFF PRG:0CFF 41 91 + .word $922C ; entry 9 -> $922C ; CPU:$8D01 PRG:0D01 2C 92 + .word $922F ; entry 10 -> $922F ; CPU:$8D03 PRG:0D03 2F 92 + .word $8E79 ; entry 11 -> $8E79 ; CPU:$8D05 PRG:0D05 79 8E + .word $90D7 ; entry 12 -> $90D7 ; CPU:$8D07 PRG:0D07 D7 90 + .word $8D3B ; entry 13 -> $8D3B ; CPU:$8D09 PRG:0D09 3B 8D + .word $8E2D ; entry 14 -> $8E2D ; CPU:$8D0B PRG:0D0B 2D 8E + .word $8FFD ; entry 15 -> $8FFD ; CPU:$8D0D PRG:0D0D FD 8F + .word $8F94 ; entry 16 -> $8F94 ; CPU:$8D0F PRG:0D0F 94 8F + .word $9008 ; entry 17 -> $9008 ; CPU:$8D11 PRG:0D11 08 90 + .word $9175 ; entry 18 -> $9175 ; CPU:$8D13 PRG:0D13 75 91 + .word $918B ; entry 19 -> $918B ; CPU:$8D15 PRG:0D15 8B 91 + .word $91E0 ; entry 20 -> $91E0 ; CPU:$8D17 PRG:0D17 E0 91 + .word $91EC ; entry 21 -> $91EC ; CPU:$8D19 PRG:0D19 EC 91 + .word $8D8D ; entry 22 -> $8D8D ; CPU:$8D1B PRG:0D1B 8D 8D + .word $8D96 ; entry 23 -> $8D96 ; CPU:$8D1D PRG:0D1D 96 8D + .word $8EA9 ; entry 24 -> $8EA9 ; CPU:$8D1F PRG:0D1F A9 8E + .word $8EF4 ; entry 25 -> $8EF4 ; CPU:$8D21 PRG:0D21 F4 8E + .word $90A6 ; entry 26 -> $90A6 ; CPU:$8D23 PRG:0D23 A6 90 + .word $9071 ; entry 27 -> $9071 ; CPU:$8D25 PRG:0D25 71 90 + .word $8F1A ; entry 28 -> $8F1A ; CPU:$8D27 PRG:0D27 1A 8F + .word $8F71 ; entry 29 -> $8F71 ; CPU:$8D29 PRG:0D29 71 8F + .word $9232 ; entry 30 -> $9232 ; CPU:$8D2B PRG:0D2B 32 92 + .word $8F20 ; entry 31 -> $8F20 ; CPU:$8D2D PRG:0D2D 20 8F + .word $8F48 ; entry 32 -> $8F48 ; CPU:$8D2F PRG:0D2F 48 8F + .word $8D9F ; entry 33 -> $8D9F ; CPU:$8D31 PRG:0D31 9F 8D + .word $8DB6 ; entry 34 -> $8DB6 ; CPU:$8D33 PRG:0D33 B6 8D + .word $8DE2 ; entry 35 -> $8DE2 ; CPU:$8D35 PRG:0D35 E2 8D + .word $8D40 ; entry 36 -> $8D40 ; CPU:$8D37 PRG:0D37 40 8D + .word $8D5C ; entry 37 -> $8D5C ; CPU:$8D39 PRG:0D39 5C 8D +; Pass 3: bytecode program, table index/indices [13], 5 bytes. +; ---- data $8D3B-$8D3F (5 bytes) ---- +BytecodeProgram_00: + .byte $E1, $3C, $E5, $EB, $D0 ; CPU:$8D3B PRG:0D3B E1 3C E5 EB D0 +; Pass 3: bytecode program, table index/indices [36], 28 bytes. +; ---- data $8D40-$8D5B (28 bytes) ---- +BytecodeProgram_01: + .byte $D1, $06, $FD, $00, $E1, $1E, $E5, $D1, $0C, $F8, $00, $CB, $03, $E1, $14, $DA ; CPU:$8D40 PRG:0D40 D1 06 FD 00 E1 1E E5 D1 0C F8 00 CB 03 E1 14 DA + .byte $CA, $C9, $E1, $1E, $DA, $C8, $E1, $5A, $DA, $E1, $F0, $D6 ; CPU:$8D50 PRG:0D50 CA C9 E1 1E DA C8 E1 5A DA E1 F0 D6 +; Pass 3: bytecode program, table index/indices [37], 49 bytes. +; ---- data $8D5C-$8D8C (49 bytes) ---- +BytecodeProgram_02: + .byte $CB, $05, $D1, $00, $E1, $0F, $E5, $D1, $02, $08, $00, $0F, $00, $15, $00, $1A ; CPU:$8D5C PRG:0D5C CB 05 D1 00 E1 0F E5 D1 02 08 00 0F 00 15 00 1A + .byte $00, $1E, $00, $21, $00, $23, $00, $24, $00, $24, $00, $23, $00, $21, $00, $1E ; CPU:$8D6C PRG:0D6C 00 1E 00 21 00 23 00 24 00 24 00 23 00 21 00 1E + .byte $00, $1A, $00, $15, $00, $0F, $00, $08, $00, $00, $00, $C9, $D1, $00, $E1, $F0 ; CPU:$8D7C PRG:0D7C 00 1A 00 15 00 0F 00 08 00 00 00 C9 D1 00 E1 F0 + .byte $E5 ; CPU:$8D8C PRG:0D8C E5 +; Pass 3: bytecode program, table index/indices [22], 9 bytes. +; ---- data $8D8D-$8D95 (9 bytes) ---- +BytecodeProgram_03: + .byte $D1, $0B, $E1, $15, $EC, $E1, $15, $ED, $D0 ; CPU:$8D8D PRG:0D8D D1 0B E1 15 EC E1 15 ED D0 +; Pass 3: bytecode program, table index/indices [23], 9 bytes. +; ---- data $8D96-$8D9E (9 bytes) ---- +BytecodeProgram_04: + .byte $D1, $0B, $E1, $18, $EE, $E1, $18, $EF, $D0 ; CPU:$8D96 PRG:0D96 D1 0B E1 18 EE E1 18 EF D0 +; Pass 3: bytecode program, table index/indices [33], 23 bytes. +; ---- data $8D9F-$8DB5 (23 bytes) ---- +BytecodeProgram_05: + .byte $D1, $06, $00, $FF, $00, $FF, $00, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FE, $FF ; CPU:$8D9F PRG:0D9F D1 06 00 FF 00 FF 00 FF FF FF FF FF FF FF FE FF + .byte $FD, $FF, $E1, $1E, $DA, $EB, $D0 ; CPU:$8DAF PRG:0DAF FD FF E1 1E DA EB D0 +; Pass 3: bytecode program, table index/indices [34], 44 bytes. +; ---- data $8DB6-$8DE1 (44 bytes) ---- +BytecodeProgram_06: + .byte $D1, $06, $00, $FF, $00, $FF, $00, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FE, $FF ; CPU:$8DB6 PRG:0DB6 D1 06 00 FF 00 FF 00 FF FF FF FF FF FF FF FE FF + .byte $FD, $FF, $D1, $0C, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF ; CPU:$8DC6 PRG:0DC6 FD FF D1 0C F8 FF F8 FF F8 FF F8 FF F8 FF F8 FF + .byte $E1, $1E, $DA, $D1, $06, $FD, $00, $E1, $08, $E5, $EB, $D0 ; CPU:$8DD6 PRG:0DD6 E1 1E DA D1 06 FD 00 E1 08 E5 EB D0 +; Pass 3: bytecode program, table index/indices [35], 75 bytes. +; ---- data $8DE2-$8E2C (75 bytes) ---- +BytecodeProgram_07: + .byte $D1, $06, $00, $FF, $00, $FF, $00, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FE, $FF ; CPU:$8DE2 PRG:0DE2 D1 06 00 FF 00 FF 00 FF FF FF FF FF FF FF FE FF + .byte $FD, $FF, $D1, $0C, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF ; CPU:$8DF2 PRG:0DF2 FD FF D1 0C F8 FF F8 FF F8 FF F8 FF F8 FF F8 FF + .byte $F8, $FF, $D1, $C6, $FD, $FF, $FD, $FF, $FD, $FF, $FD, $FF, $FD, $FF, $FD, $FF ; CPU:$8E02 PRG:0E02 F8 FF D1 C6 FD FF FD FF FD FF FD FF FD FF FD FF + .byte $FD, $FF, $D1, $CC, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF ; CPU:$8E12 PRG:0E12 FD FF D1 CC F8 FF F8 FF F8 FF F8 FF F8 FF F8 FF + .byte $F8, $FF, $D1, $06, $FD, $FF, $E1, $1E, $DA, $EB, $D0 ; CPU:$8E22 PRG:0E22 F8 FF D1 06 FD FF E1 1E DA EB D0 +; Pass 3: bytecode program, table index/indices [14], 76 bytes. +; ---- data $8E2D-$8E78 (76 bytes) ---- +BytecodeProgram_08: + .byte $D1, $06, $00, $FF, $00, $FF, $00, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FE, $FF ; CPU:$8E2D PRG:0E2D D1 06 00 FF 00 FF 00 FF FF FF FF FF FF FF FE FF + .byte $FD, $FF, $D1, $0C, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF ; CPU:$8E3D PRG:0E3D FD FF D1 0C F8 FF F8 FF F8 FF F8 FF F8 FF F8 FF + .byte $F8, $FF, $D1, $C6, $FD, $FF, $FD, $FF, $FD, $FF, $FD, $FF, $FD, $FF, $FD, $FF ; CPU:$8E4D PRG:0E4D F8 FF D1 C6 FD FF FD FF FD FF FD FF FD FF FD FF + .byte $FD, $FF, $D1, $CC, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF ; CPU:$8E5D PRG:0E5D FD FF D1 CC F8 FF F8 FF F8 FF F8 FF F8 FF F8 FF + .byte $F8, $FF, $D1, $06, $FD, $FF, $DB, $C8, $E1, $78, $DA, $D0 ; CPU:$8E6D PRG:0E6D F8 FF D1 06 FD FF DB C8 E1 78 DA D0 +; Pass 3: bytecode program, table index/indices [11], 48 bytes. +; ---- data $8E79-$8EA8 (48 bytes) ---- +BytecodeProgram_09: + .byte $DB, $E1, $50, $DA, $D1, $06, $00, $FF, $00, $FF, $00, $FF, $FF, $FF, $FF, $FF ; CPU:$8E79 PRG:0E79 DB E1 50 DA D1 06 00 FF 00 FF 00 FF FF FF FF FF + .byte $FF, $FF, $FE, $FF, $FD, $FF, $D1, $0C, $F8, $FF, $F8, $FF, $F8, $FF, $F8, $FF ; CPU:$8E89 PRG:0E89 FF FF FE FF FD FF D1 0C F8 FF F8 FF F8 FF F8 FF + .byte $F8, $FF, $F8, $FF, $C8, $E1, $28, $DA, $D1, $06, $FD, $00, $E1, $08, $E5, $D0 ; CPU:$8E99 PRG:0E99 F8 FF F8 FF C8 E1 28 DA D1 06 FD 00 E1 08 E5 D0 +; Pass 3: bytecode program, table index/indices [24], 75 bytes. +; ---- data $8EA9-$8EF3 (75 bytes) ---- +BytecodeProgram_0A: + .byte $D1, $08, $04, $03, $08, $03, $0B, $03, $0E, $03, $10, $03, $12, $03, $13, $03 ; CPU:$8EA9 PRG:0EA9 D1 08 04 03 08 03 0B 03 0E 03 10 03 12 03 13 03 + .byte $14, $03, $D1, $0A, $E1, $02, $D3, $D1, $8A, $E1, $02, $D3, $D1, $0A, $E1, $02 ; CPU:$8EB9 PRG:0EB9 14 03 D1 0A E1 02 D3 D1 8A E1 02 D3 D1 0A E1 02 + .byte $D3, $D1, $8A, $E1, $02, $D3, $D1, $0A, $E1, $02, $D3, $D1, $8A, $E1, $02, $D3 ; CPU:$8EC9 PRG:0EC9 D3 D1 8A E1 02 D3 D1 0A E1 02 D3 D1 8A E1 02 D3 + .byte $D1, $0A, $E1, $02, $D3, $D1, $8A, $E1, $02, $D3, $13, $03, $12, $03, $10, $03 ; CPU:$8ED9 PRG:0ED9 D1 0A E1 02 D3 D1 8A E1 02 D3 13 03 12 03 10 03 + .byte $0E, $03, $0B, $03, $08, $03, $04, $03, $00, $03, $D0 ; CPU:$8EE9 PRG:0EE9 0E 03 0B 03 08 03 04 03 00 03 D0 +; Pass 3: bytecode program, table index/indices [25], 38 bytes. +; ---- data $8EF4-$8F19 (38 bytes) ---- +BytecodeProgram_0B: + .byte $04, $03, $08, $03, $0B, $03, $0E, $03, $10, $03, $12, $03, $13, $03, $14, $03 ; CPU:$8EF4 PRG:0EF4 04 03 08 03 0B 03 0E 03 10 03 12 03 13 03 14 03 + .byte $D1, $07, $E1, $10, $D3, $13, $03, $12, $03, $10, $03, $0E, $03, $0B, $03, $08 ; CPU:$8F04 PRG:0F04 D1 07 E1 10 D3 13 03 12 03 10 03 0E 03 0B 03 08 + .byte $03, $04, $03, $00, $03, $D0 ; CPU:$8F14 PRG:0F14 03 04 03 00 03 D0 +; Pass 3: bytecode program, table index/indices [28], 6 bytes. +; ---- data $8F1A-$8F1F (6 bytes) ---- +BytecodeProgram_0C: + .byte $D1, $05, $E1, $10, $E6, $D0 ; CPU:$8F1A PRG:0F1A D1 05 E1 10 E6 D0 +; Pass 3: bytecode program, table index/indices [31], 40 bytes. +; ---- data $8F20-$8F47 (40 bytes) ---- +BytecodeProgram_0D: + .byte $E7, $D1, $06, $08, $01, $0F, $01, $15, $01, $1A, $01, $1E, $01, $21, $01, $23 ; CPU:$8F20 PRG:0F20 E7 D1 06 08 01 0F 01 15 01 1A 01 1E 01 21 01 23 + .byte $01, $24, $01, $24, $01, $23, $01, $21, $01, $1E, $01, $1A, $01, $15, $01, $0F ; CPU:$8F30 PRG:0F30 01 24 01 24 01 23 01 21 01 1E 01 1A 01 15 01 0F + .byte $01, $08, $01, $00, $01, $FD, $01, $E2 ; CPU:$8F40 PRG:0F40 01 08 01 00 01 FD 01 E2 +; Pass 3: bytecode program, table index/indices [32], 41 bytes. +; ---- data $8F48-$8F70 (41 bytes) ---- +BytecodeProgram_0E: + .byte $D1, $0C, $08, $00, $0F, $00, $15, $FF, $1A, $00, $1E, $FF, $21, $00, $23, $FF ; CPU:$8F48 PRG:0F48 D1 0C 08 00 0F 00 15 FF 1A 00 1E FF 21 00 23 FF + .byte $24, $00, $24, $FF, $23, $00, $21, $FF, $1E, $00, $1A, $FF, $15, $00, $0F, $FF ; CPU:$8F58 PRG:0F58 24 00 24 FF 23 00 21 FF 1E 00 1A FF 15 00 0F FF + .byte $08, $00, $00, $FF, $F8, $00, $D7, $18, $E3 ; CPU:$8F68 PRG:0F68 08 00 00 FF F8 00 D7 18 E3 +; Pass 3: bytecode program, table index/indices [29], 35 bytes. +; ---- data $8F71-$8F93 (35 bytes) ---- +BytecodeProgram_0F: + .byte $D1, $06, $E8, $E8, $E8, $E8, $E8, $E8, $E8, $E8, $E8, $E8, $E8, $E8, $E8, $E8 ; CPU:$8F71 PRG:0F71 D1 06 E8 E8 E8 E8 E8 E8 E8 E8 E8 E8 E8 E8 E8 E8 + .byte $E8, $E8, $E9, $E9, $E9, $E9, $E9, $E9, $E9, $E9, $E9, $E9, $E9, $E9, $E9, $E9 ; CPU:$8F81 PRG:0F81 E8 E8 E9 E9 E9 E9 E9 E9 E9 E9 E9 E9 E9 E9 E9 E9 + .byte $E9, $E9, $D0 ; CPU:$8F91 PRG:0F91 E9 E9 D0 +; Pass 3: bytecode program, table index/indices [16], 105 bytes. +; ---- data $8F94-$8FFC (105 bytes) ---- +BytecodeProgram_10: + .byte $E7, $D1, $08, $08, $00, $10, $00, $18, $00, $20, $00, $28, $00, $30, $00, $38 ; CPU:$8F94 PRG:0F94 E7 D1 08 08 00 10 00 18 00 20 00 28 00 30 00 38 + .byte $00, $40, $00, $48, $00, $50, $00, $58, $00, $60, $00, $68, $00, $70, $00, $78 ; CPU:$8FA4 PRG:0FA4 00 40 00 48 00 50 00 58 00 60 00 68 00 70 00 78 + .byte $00, $80, $00, $88, $00, $90, $00, $98, $00, $A0, $00, $A8, $00, $B0, $00, $B8 ; CPU:$8FB4 PRG:0FB4 00 80 00 88 00 90 00 98 00 A0 00 A8 00 B0 00 B8 + .byte $00, $C0, $00, $D1, $02, $C7, $04, $C0, $00, $B8, $00, $B0, $00, $A8, $00, $A0 ; CPU:$8FC4 PRG:0FC4 00 C0 00 D1 02 C7 04 C0 00 B8 00 B0 00 A8 00 A0 + .byte $00, $98, $00, $90, $00, $88, $00, $80, $00, $78, $00, $70, $00, $68, $00, $60 ; CPU:$8FD4 PRG:0FD4 00 98 00 90 00 88 00 80 00 78 00 70 00 68 00 60 + .byte $00, $58, $00, $50, $00, $48, $00, $40, $00, $38, $00, $30, $00, $28, $00, $20 ; CPU:$8FE4 PRG:0FE4 00 58 00 50 00 48 00 40 00 38 00 30 00 28 00 20 + .byte $00, $18, $00, $10, $00, $08, $00, $00, $00 ; CPU:$8FF4 PRG:0FF4 00 18 00 10 00 08 00 00 00 +; Pass 3: bytecode program, table index/indices [15], 11 bytes. +; ---- data $8FFD-$9007 (11 bytes) ---- +BytecodeProgram_11: + .byte $E1, $1E, $E5, $D1, $00, $E1, $64, $E5, $D1, $02, $D0 ; CPU:$8FFD PRG:0FFD E1 1E E5 D1 00 E1 64 E5 D1 02 D0 +; Pass 3: bytecode program, table index/indices [17], 105 bytes. +; ---- data $9008-$9070 (105 bytes) ---- +BytecodeProgram_12: + .byte $D1, $01, $08, $00, $10, $00, $18, $00, $20, $00, $28, $00, $30, $00, $38, $00 ; CPU:$9008 PRG:1008 D1 01 08 00 10 00 18 00 20 00 28 00 30 00 38 00 + .byte $40, $00, $48, $00, $50, $00, $58, $00, $60, $00, $68, $00, $70, $00, $78, $00 ; CPU:$9018 PRG:1018 40 00 48 00 50 00 58 00 60 00 68 00 70 00 78 00 + .byte $80, $00, $88, $00, $90, $00, $98, $00, $A0, $00, $A8, $00, $B0, $00, $B8, $00 ; CPU:$9028 PRG:1028 80 00 88 00 90 00 98 00 A0 00 A8 00 B0 00 B8 00 + .byte $D1, $82, $C7, $FC, $E4, $B6, $00, $AE, $00, $A6, $00, $9E, $00, $96, $00, $8E ; CPU:$9038 PRG:1038 D1 82 C7 FC E4 B6 00 AE 00 A6 00 9E 00 96 00 8E + .byte $00, $86, $00, $7E, $00, $76, $00, $6E, $00, $66, $00, $5E, $00, $56, $00, $4E ; CPU:$9048 PRG:1048 00 86 00 7E 00 76 00 6E 00 66 00 5E 00 56 00 4E + .byte $00, $46, $00, $3E, $00, $36, $00, $2E, $00, $26, $00, $1E, $00, $16, $00, $0E ; CPU:$9058 PRG:1058 00 46 00 3E 00 36 00 2E 00 26 00 1E 00 16 00 0E + .byte $00, $06, $00, $FE, $00, $F6, $00, $D7, $20 ; CPU:$9068 PRG:1068 00 06 00 FE 00 F6 00 D7 20 +; Pass 3: bytecode program, table index/indices [27], 12 bytes. +; ---- data $9071-$907C (12 bytes) ---- +BytecodeProgram_13: + .byte $DB, $E1, $78, $DA, $D1, $06, $FD, $00, $E1, $08, $E5, $D0 ; CPU:$9071 PRG:1071 DB E1 78 DA D1 06 FD 00 E1 08 E5 D0 +; Pass 3: bytecode program, table index/indices [0], 4 bytes. +; ---- data $907D-$9080 (4 bytes) ---- +BytecodeProgram_14: + .byte $D1, $0B, $CC, $CD ; CPU:$907D PRG:107D D1 0B CC CD +; Pass 3: bytecode program, table index/indices [1], 37 bytes. +; ---- data $9081-$90A5 (37 bytes) ---- +BytecodeProgram_15: + .byte $D1, $0B, $E1, $08, $D2, $D1, $0A, $E1, $1E, $D2, $13, $01, $12, $01, $10, $01 ; CPU:$9081 PRG:1081 D1 0B E1 08 D2 D1 0A E1 1E D2 13 01 12 01 10 01 + .byte $0E, $01, $0B, $01, $08, $01, $04, $01, $00, $01, $FC, $01, $F8, $01, $D7, $1C ; CPU:$9091 PRG:1091 0E 01 0B 01 08 01 04 01 00 01 FC 01 F8 01 D7 1C + .byte $E0, $E1, $1E, $DA, $D0 ; CPU:$90A1 PRG:10A1 E0 E1 1E DA D0 +; Pass 3: bytecode program, table index/indices [26], 19 bytes. +; ---- data $90A6-$90B8 (19 bytes) ---- +BytecodeProgram_16: + .byte $D1, $01, $13, $00, $12, $00, $10, $00, $0E, $00, $0B, $00, $08, $00, $04, $00 ; CPU:$90A6 PRG:10A6 D1 01 13 00 12 00 10 00 0E 00 0B 00 08 00 04 00 + .byte $00, $00, $E2 ; CPU:$90B6 PRG:10B6 00 00 E2 +; Pass 3: bytecode program, table index/indices [5], 17 bytes. +; ---- data $90B9-$90C9 (17 bytes) ---- +BytecodeProgram_17: + .byte $D1, $01, $13, $00, $12, $00, $10, $00, $0E, $00, $0B, $00, $08, $00, $04, $00 ; CPU:$90B9 PRG:10B9 D1 01 13 00 12 00 10 00 0E 00 0B 00 08 00 04 00 + .byte $EA ; CPU:$90C9 PRG:10C9 EA +; Pass 3: bytecode program, table index/indices [2], 13 bytes. +; ---- data $90CA-$90D6 (13 bytes) ---- +BytecodeProgram_18: + .byte $D1, $03, $E1, $08, $E5, $D1, $08, $D8, $E0, $E1, $1E, $E5, $D0 ; CPU:$90CA PRG:10CA D1 03 E1 08 E5 D1 08 D8 E0 E1 1E E5 D0 +; Pass 3: bytecode program, table index/indices [12], 7 bytes. +; ---- data $90D7-$90DD (7 bytes) ---- +BytecodeProgram_19: + .byte $E0, $D1, $05, $E1, $20, $DF, $D0 ; CPU:$90D7 PRG:10D7 E0 D1 05 E1 20 DF D0 +; Pass 3: bytecode program, table index/indices [3], 59 bytes. +; ---- data $90DE-$9118 (59 bytes) ---- +BytecodeProgram_1A: + .byte $D1, $06, $D9, $D4, $D9, $D4, $D9, $D4, $D9, $D4, $D9, $D4, $D9, $D4, $D9, $D4 ; CPU:$90DE PRG:10DE D1 06 D9 D4 D9 D4 D9 D4 D9 D4 D9 D4 D9 D4 D9 D4 + .byte $D9, $D4, $D9, $D4, $D9, $D4, $D9, $D4, $D9, $D4, $D9, $D5, $D9, $D5, $D9, $D5 ; CPU:$90EE PRG:10EE D9 D4 D9 D4 D9 D4 D9 D4 D9 D4 D9 D5 D9 D5 D9 D5 + .byte $D9, $D5, $D9, $D5, $D9, $D5, $D9, $D5, $D9, $D5, $D9, $D5, $D9, $D5, $D9, $D5 ; CPU:$90FE PRG:10FE D9 D5 D9 D5 D9 D5 D9 D5 D9 D5 D9 D5 D9 D5 D9 D5 + .byte $D9, $D5, $D9, $D5, $D9, $D5, $D9, $D5, $D9, $D5, $D0 ; CPU:$910E PRG:110E D9 D5 D9 D5 D9 D5 D9 D5 D9 D5 D0 +; Pass 3: bytecode program, table index/indices [4], 24 bytes. +; ---- data $9119-$9130 (24 bytes) ---- +BytecodeProgram_1B: + .byte $D7, $1C, $E0, $E1, $1E, $DA, $D0, $D1, $06, $E1, $08, $E5, $D1, $0C, $E1, $1E ; CPU:$9119 PRG:1119 D7 1C E0 E1 1E DA D0 D1 06 E1 08 E5 D1 0C E1 1E + .byte $DA, $D1, $06, $E1, $08, $E5, $EB, $D0 ; CPU:$9129 PRG:1129 DA D1 06 E1 08 E5 EB D0 +; Pass 3: bytecode program, table index/indices [6], 5 bytes. +; ---- data $9131-$9135 (5 bytes) ---- +BytecodeProgram_1C: + .byte $E1, $1E, $DA, $EB, $D0 ; CPU:$9131 PRG:1131 E1 1E DA EB D0 +; Pass 3: bytecode program, table index/indices [7], 11 bytes. +; ---- data $9136-$9140 (11 bytes) ---- +BytecodeProgram_1D: + .byte $D1, $08, $E1, $08, $E5, $D1, $09, $E1, $1E, $E5, $EA ; CPU:$9136 PRG:1136 D1 08 E1 08 E5 D1 09 E1 1E E5 EA +; Pass 3: bytecode program, table index/indices [8], 52 bytes. +; ---- data $9141-$9174 (52 bytes) ---- +BytecodeProgram_1E: + .byte $D1, $06, $E1, $08, $E5, $0C, $FE, $E1, $08, $E5, $D1, $0C, $10, $FA, $10, $FE ; CPU:$9141 PRG:1141 D1 06 E1 08 E5 0C FE E1 08 E5 D1 0C 10 FA 10 FE + .byte $10, $FE, $0F, $FE, $0D, $FE, $D1, $CB, $0A, $FF, $07, $FF, $04, $FF, $00, $FF ; CPU:$9151 PRG:1151 10 FE 0F FE 0D FE D1 CB 0A FF 07 FF 04 FF 00 FF + .byte $DE, $E1, $1E, $DA, $D1, $0C, $F8, $00, $E1, $08, $E5, $D1, $06, $FD, $00, $E1 ; CPU:$9161 PRG:1161 DE E1 1E DA D1 0C F8 00 E1 08 E5 D1 06 FD 00 E1 + .byte $08, $E5, $EB, $D0 ; CPU:$9171 PRG:1171 08 E5 EB D0 +; Pass 3: bytecode program, table index/indices [18], 22 bytes. +; ---- data $9175-$918A (22 bytes) ---- +BytecodeProgram_1F: + .byte $E7, $D1, $08, $E1, $08, $E5, $D1, $07, $E1, $1E, $E5, $D1, $02, $E1, $0F, $E5 ; CPU:$9175 PRG:1175 E7 D1 08 E1 08 E5 D1 07 E1 1E E5 D1 02 E1 0F E5 + .byte $D1, $07, $E1, $0F, $E5, $E2 ; CPU:$9185 PRG:1185 D1 07 E1 0F E5 E2 +; Pass 3: bytecode program, table index/indices [19], 85 bytes. +; ---- data $918B-$91DF (85 bytes) ---- +BytecodeProgram_20: + .byte $D1, $06, $E1, $08, $E5, $D1, $0C, $10, $F8, $E1, $1D, $E5, $1C, $FF, $27, $FF ; CPU:$918B PRG:118B D1 06 E1 08 E5 D1 0C 10 F8 E1 1D E5 1C FF 27 FF + .byte $D1, $CB, $31, $FF, $3A, $FF, $42, $FF, $D1, $CC, $49, $FF, $4F, $FF, $54, $FF ; CPU:$919B PRG:119B D1 CB 31 FF 3A FF 42 FF D1 CC 49 FF 4F FF 54 FF + .byte $D1, $0B, $58, $FF, $5B, $FF, $5D, $FF, $D1, $0C, $5E, $FF, $5E, $FF, $5D, $FF ; CPU:$91AB PRG:11AB D1 0B 58 FF 5B FF 5D FF D1 0C 5E FF 5E FF 5D FF + .byte $D1, $CB, $5B, $FF, $58, $FF, $54, $FF, $D1, $CC, $4F, $FF, $49, $FF, $42, $FF ; CPU:$91BB PRG:11BB D1 CB 5B FF 58 FF 54 FF D1 CC 4F FF 49 FF 42 FF + .byte $D1, $0B, $3A, $FF, $31, $FF, $27, $FF, $D1, $0C, $1C, $FF, $10, $FF, $04, $FF ; CPU:$91CB PRG:11CB D1 0B 3A FF 31 FF 27 FF D1 0C 1C FF 10 FF 04 FF + .byte $F8, $FF, $D7, $18, $E3 ; CPU:$91DB PRG:11DB F8 FF D7 18 E3 +; Pass 3: bytecode program, table index/indices [20], 12 bytes. +; ---- data $91E0-$91EB (12 bytes) ---- +BytecodeProgram_21: + .byte $E7, $D1, $08, $E1, $08, $E5, $D1, $00, $E1, $3C, $E5, $E2 ; CPU:$91E0 PRG:11E0 E7 D1 08 E1 08 E5 D1 00 E1 3C E5 E2 +; Pass 3: bytecode program, table index/indices [21], 64 bytes. +; ---- data $91EC-$922B (64 bytes) ---- +BytecodeProgram_22: + .byte $D1, $06, $E1, $08, $E5, $D1, $82, $10, $F8, $E1, $1E, $E5, $1A, $00, $23, $00 ; CPU:$91EC PRG:11EC D1 06 E1 08 E5 D1 82 10 F8 E1 1E E5 1A 00 23 00 + .byte $2B, $00, $32, $00, $38, $00, $3D, $00, $41, $00, $44, $00, $46, $00, $47, $00 ; CPU:$91FC PRG:11FC 2B 00 32 00 38 00 3D 00 41 00 44 00 46 00 47 00 + .byte $D1, $02, $47, $00, $46, $00, $44, $00, $41, $00, $3D, $00, $38, $00, $32, $00 ; CPU:$920C PRG:120C D1 02 47 00 46 00 44 00 41 00 3D 00 38 00 32 00 + .byte $2B, $00, $23, $00, $1A, $00, $10, $00, $05, $00, $F8, $00, $E4, $D7, $1E, $E3 ; CPU:$921C PRG:121C 2B 00 23 00 1A 00 10 00 05 00 F8 00 E4 D7 1E E3 +; Pass 3: bytecode program, table index/indices [9], 3 bytes. +; ---- data $922C-$922E (3 bytes) ---- +BytecodeProgram_23: + .byte $D1, $03, $DC ; CPU:$922C PRG:122C D1 03 DC +; Pass 3: bytecode program, table index/indices [10], 3 bytes. +; ---- data $922F-$9231 (3 bytes) ---- +BytecodeProgram_24: + .byte $D1, $01, $DD ; CPU:$922F PRG:122F D1 01 DD +; Pass 3: bytecode program, table index/indices [30], 5 bytes. +; ---- data $9232-$9236 (5 bytes) ---- +BytecodeProgram_25: + .byte $E1, $1E, $DA, $CF, $CE ; CPU:$9232 PRG:1232 E1 1E DA CF CE +; Pass 3: 40 x 16-bit opcode handlers, index = (token - $C8). Dispatched through BytecodeHandlerPointerLo/Hi into DispatchThroughPointer (jmp ($001C)). Tokens $C8-$EF map to entries 0-39; slots the assembler never filled hold the next table's bytes. +; ---- data $9237-$9286 (80 bytes) ---- +BytecodeHandlerTable: + .word $928D ; entry 0 -> $928D ; CPU:$9237 PRG:1237 8D 92 + .word $9477 ; entry 1 -> $9477 ; CPU:$9239 PRG:1239 77 94 + .word $9287 ; entry 2 -> $9287 ; CPU:$923B PRG:123B 87 92 + .word $946D ; entry 3 -> $946D ; CPU:$923D PRG:123D 6D 94 + .word $99B0 ; entry 4 -> $99B0 ; CPU:$923F PRG:123F B0 99 + .word $99B7 ; entry 5 -> $99B7 ; CPU:$9241 PRG:1241 B7 99 + .word $997C ; entry 6 -> $997C ; CPU:$9243 PRG:1243 7C 99 + .word $996E ; entry 7 -> $996E ; CPU:$9245 PRG:1245 6E 99 + .word $94CF ; entry 8 -> $94CF ; CPU:$9247 PRG:1247 CF 94 + .word $950B ; entry 9 -> $950B ; CPU:$9249 PRG:1249 0B 95 + .word $95DC ; entry 10 -> $95DC ; CPU:$924B PRG:124B DC 95 + .word $93CC ; entry 11 -> $93CC ; CPU:$924D PRG:124D CC 93 + .word $9644 ; entry 12 -> $9644 ; CPU:$924F PRG:124F 44 96 + .word $966D ; entry 13 -> $966D ; CPU:$9251 PRG:1251 6D 96 + .word $9293 ; entry 14 -> $9293 ; CPU:$9253 PRG:1253 93 92 + .word $937C ; entry 15 -> $937C ; CPU:$9255 PRG:1255 7C 93 + .word $986A ; entry 16 -> $986A ; CPU:$9257 PRG:1257 6A 98 + .word $975E ; entry 17 -> $975E ; CPU:$9259 PRG:1259 5E 97 + .word $94AD ; entry 18 -> $94AD ; CPU:$925B PRG:125B AD 94 + .word $9499 ; entry 19 -> $9499 ; CPU:$925D PRG:125D 99 94 + .word $9522 ; entry 20 -> $9522 ; CPU:$925F PRG:125F 22 95 + .word $9541 ; entry 21 -> $9541 ; CPU:$9261 PRG:1261 41 95 + .word $9559 ; entry 22 -> $9559 ; CPU:$9263 PRG:1263 59 95 + .word $98B0 ; entry 23 -> $98B0 ; CPU:$9265 PRG:1265 B0 98 + .word $94C0 ; entry 24 -> $94C0 ; CPU:$9267 PRG:1267 C0 94 + .word $9465 ; entry 25 -> $9465 ; CPU:$9269 PRG:1269 65 94 + .word $96BC ; entry 26 -> $96BC ; CPU:$926B PRG:126B BC 96 + .word $96C2 ; entry 27 -> $96C2 ; CPU:$926D PRG:126D C2 96 + .word $9480 ; entry 28 -> $9480 ; CPU:$926F PRG:126F 80 94 + .word $948F ; entry 29 -> $948F ; CPU:$9271 PRG:1271 8F 94 + .word $93A4 ; entry 30 -> $93A4 ; CPU:$9273 PRG:1273 A4 93 + .word $994B ; entry 31 -> $994B ; CPU:$9275 PRG:1275 4B 99 + .word $9409 ; entry 32 -> $9409 ; CPU:$9277 PRG:1277 09 94 + .word $941B ; entry 33 -> $941B ; CPU:$9279 PRG:1279 1B 94 + .word $94FE ; entry 34 -> $94FE ; CPU:$927B PRG:127B FE 94 + .word $9513 ; entry 35 -> $9513 ; CPU:$927D PRG:127D 13 95 + .word $92CD ; entry 36 -> $92CD ; CPU:$927F PRG:127F CD 92 + .word $92B2 ; entry 37 -> $92B2 ; CPU:$9281 PRG:1281 B2 92 + .word $9354 ; entry 38 -> $9354 ; CPU:$9283 PRG:1283 54 93 + .word $932C ; entry 39 -> $932C ; CPU:$9285 PRG:1285 2C 93 +QueueVramDescriptor_Entry_9287: + jsr $8765 ; CPU:$9287 PRG:1287 20 65 87 + jmp $9AE8 ; CPU:$928A PRG:128A 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: QueueVramDescriptor_JumpNext_928D +; Global: QueueVramDescriptor_JumpNext_928D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramDescriptor_JumpNext_928D: + jsr $82E1 ; CPU:$928D PRG:128D 20 E1 82 + jmp $9AE8 ; CPU:$9290 PRG:1290 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: QueueVramDescriptor_JumpNext_9293 +; Global: QueueVramDescriptor_JumpNext_9293.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramDescriptor_JumpNext_9293: + dec Zp7A,x ; CPU:$9293 PRG:1293 D6 7A + bne QueueVramDescriptor_OnNonzero_929F ; CPU:$9295 PRG:1295 D0 08 + lda #$FF ; CPU:$9297 PRG:1297 A9 FF + sta $0321 ; CPU:$9299 PRG:1299 8D 21 03 + jmp $9B25 ; CPU:$929C PRG:129C 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: QueueVramDescriptor_OnNonzero_929F +; Global: QueueVramDescriptor_OnNonzero_929F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramDescriptor_OnNonzero_929F: + jsr $94C7 ; CPU:$929F PRG:129F 20 C7 94 + lda Zp7A,x ; CPU:$92A2 PRG:12A2 B5 7A + cmp #$C8 ; CPU:$92A4 PRG:12A4 C9 C8 + bne QueueVramDescriptor_OnNonzero_92AF ; CPU:$92A6 PRG:12A6 D0 07 + ldy #$65 ; CPU:$92A8 PRG:12A8 A0 65 + lda #$FE ; CPU:$92AA PRG:12AA A9 FE + jsr $9A2E ; CPU:$92AC PRG:12AC 20 2E 9A +; ----------------------------------------------------------------------------- +; Routine: QueueVramDescriptor_OnNonzero_92AF +; Global: QueueVramDescriptor_OnNonzero_92AF.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramDescriptor_OnNonzero_92AF: + jmp $9B25 ; CPU:$92AF PRG:12AF 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: QueueVramDescriptor_JumpNext_92B2 +; Global: QueueVramDescriptor_JumpNext_92B2.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramDescriptor_JumpNext_92B2: + dec Zp7A,x ; CPU:$92B2 PRG:12B2 D6 7A + beq QueueVramDescriptor_OnZero_9329 ; CPU:$92B4 PRG:12B4 F0 73 + jsr $94C7 ; CPU:$92B6 PRG:12B6 20 C7 94 + lda $003A,y ; CPU:$92B9 PRG:12B9 B9 3A 00 + clc ; CPU:$92BC PRG:12BC 18 + adc #$01 ; CPU:$92BD PRG:12BD 69 01 + sta $003A,y ; CPU:$92BF PRG:12BF 99 3A 00 + inc Zp4B,x ; CPU:$92C2 PRG:12C2 F6 4B + lda $0033,y ; CPU:$92C4 PRG:12C4 B9 33 00 + sec ; CPU:$92C7 PRG:12C7 38 + sbc Zp4B,x ; CPU:$92C8 PRG:12C8 F5 4B + jmp $934B ; CPU:$92CA PRG:12CA 4C 4B 93 +; ----------------------------------------------------------------------------- +; Routine: QueueVramDescriptor_JumpNext_92CD +; Global: QueueVramDescriptor_JumpNext_92CD.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramDescriptor_JumpNext_92CD: + dec Zp7A,x ; CPU:$92CD PRG:12CD D6 7A + beq QueueVramDescriptor_OnZero_92E8 ; CPU:$92CF PRG:12CF F0 17 + jsr $94C7 ; CPU:$92D1 PRG:12D1 20 C7 94 + lda $0033,y ; CPU:$92D4 PRG:12D4 B9 33 00 + clc ; CPU:$92D7 PRG:12D7 18 + adc Zp4B,x ; CPU:$92D8 PRG:12D8 75 4B + sta $0033,y ; CPU:$92DA PRG:12DA 99 33 00 + dec Zp4B,x ; CPU:$92DD PRG:12DD D6 4B + lda $003A,y ; CPU:$92DF PRG:12DF B9 3A 00 + sec ; CPU:$92E2 PRG:12E2 38 + sbc #$01 ; CPU:$92E3 PRG:12E3 E9 01 + jmp $9371 ; CPU:$92E5 PRG:12E5 4C 71 93 +; ----------------------------------------------------------------------------- +; Routine: QueueVramDescriptor_OnZero_92E8 +; Global: QueueVramDescriptor_OnZero_92E8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramDescriptor_OnZero_92E8: + lda ControllerDPad1,x ; CPU:$92E8 PRG:12E8 B5 F6 + eor #$03 ; CPU:$92EA PRG:12EA 49 03 + sta ControllerDPad1,x ; CPU:$92EC PRG:12EC 95 F6 + sta ControllerFaceButtons1,x ; CPU:$92EE PRG:12EE 95 F8 + lda #$4F ; CPU:$92F0 PRG:12F0 A9 4F + sta Zp4F,x ; CPU:$92F2 PRG:12F2 95 4F + lda #$96 ; CPU:$92F4 PRG:12F4 A9 96 + sta Zp88,x ; CPU:$92F6 PRG:12F6 95 88 + tya ; CPU:$92F8 PRG:12F8 98 + pha ; CPU:$92F9 PRG:12F9 48 + lda SourcePointerLo ; CPU:$92FA PRG:12FA A5 10 + pha ; CPU:$92FC PRG:12FC 48 + lda SourcePointerHi ; CPU:$92FD PRG:12FD A5 11 + pha ; CPU:$92FF PRG:12FF 48 + lda DestinationPointerLo ; CPU:$9300 PRG:1300 A5 12 + pha ; CPU:$9302 PRG:1302 48 + lda DestinationPointerHi ; CPU:$9303 PRG:1303 A5 13 + pha ; CPU:$9305 PRG:1305 48 + lda PlayerPaletteIndex,x ; CPU:$9306 PRG:1306 B5 2A + eor #$01 ; CPU:$9308 PRG:1308 49 01 + sta PlayerPaletteIndex,x ; CPU:$930A PRG:130A 95 2A + tay ; CPU:$930C PRG:130C A8 + lda #$10 ; CPU:$930D PRG:130D A9 10 + clc ; CPU:$930F PRG:130F 18 + adc ActorSlotOffset ; CPU:$9310 PRG:1310 65 21 + sta DestinationPointerLo ; CPU:$9312 PRG:1312 85 12 + lda #$03 ; CPU:$9314 PRG:1314 A9 03 + sta DestinationPointerHi ; CPU:$9316 PRG:1316 85 13 + jsr $A250 ; CPU:$9318 PRG:1318 20 50 A2 + pla ; CPU:$931B PRG:131B 68 + sta DestinationPointerHi ; CPU:$931C PRG:131C 85 13 + pla ; CPU:$931E PRG:131E 68 + sta DestinationPointerLo ; CPU:$931F PRG:131F 85 12 + pla ; CPU:$9321 PRG:1321 68 + sta SourcePointerHi ; CPU:$9322 PRG:1322 85 11 + pla ; CPU:$9324 PRG:1324 68 + sta SourcePointerLo ; CPU:$9325 PRG:1325 85 10 + pla ; CPU:$9327 PRG:1327 68 + tay ; CPU:$9328 PRG:1328 A8 +; ----------------------------------------------------------------------------- +; Routine: QueueVramDescriptor_OnZero_9329 +; Global: QueueVramDescriptor_OnZero_9329.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramDescriptor_OnZero_9329: + jmp $9AE8 ; CPU:$9329 PRG:1329 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: QueueVramDescriptor_JumpNext_932C +; Global: QueueVramDescriptor_JumpNext_932C.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueVramDescriptor_JumpNext_932C: + dec Zp7A,x ; CPU:$932C PRG:132C D6 7A + beq QueueVramDescriptor_OnZero_9329 ; CPU:$932E PRG:132E F0 F9 + jsr $94C7 ; CPU:$9330 PRG:1330 20 C7 94 + lda $003A,y ; CPU:$9333 PRG:1333 B9 3A 00 + sec ; CPU:$9336 PRG:1336 38 + sbc #$02 ; CPU:$9337 PRG:1337 E9 02 + sta $003A,y ; CPU:$9339 PRG:1339 99 3A 00 + inc Zp4B,x ; CPU:$933C PRG:133C F6 4B + lda Zp4B,x ; CPU:$933E PRG:133E B5 4B + rol a ; CPU:$9340 PRG:1340 2A + php ; CPU:$9341 PRG:1341 08 + ror a ; CPU:$9342 PRG:1342 6A + plp ; CPU:$9343 PRG:1343 28 + ror a ; CPU:$9344 PRG:1344 6A + eor #$FF ; CPU:$9345 PRG:1345 49 FF + sec ; CPU:$9347 PRG:1347 38 + adc $0033,y ; CPU:$9348 PRG:1348 79 33 00 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorX +; Global: UpdateActorX.; called from $92CA +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorX: + sta $0033,y ; CPU:$934B PRG:134B 99 33 00 + jsr $82ED ; CPU:$934E PRG:134E 20 ED 82 + jmp $9374 ; CPU:$9351 PRG:1351 4C 74 93 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorX_JumpNext_9354 +; Global: UpdateActorX_JumpNext_9354.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorX_JumpNext_9354: + dec Zp7A,x ; CPU:$9354 PRG:1354 D6 7A + beq QueueVramDescriptor_OnZero_92E8 ; CPU:$9356 PRG:1356 F0 90 + jsr $94C7 ; CPU:$9358 PRG:1358 20 C7 94 + lda Zp4B,x ; CPU:$935B PRG:135B B5 4B + rol a ; CPU:$935D PRG:135D 2A + php ; CPU:$935E PRG:135E 08 + ror a ; CPU:$935F PRG:135F 6A + plp ; CPU:$9360 PRG:1360 28 + ror a ; CPU:$9361 PRG:1361 6A + clc ; CPU:$9362 PRG:1362 18 + adc $0033,y ; CPU:$9363 PRG:1363 79 33 00 + sta $0033,y ; CPU:$9366 PRG:1366 99 33 00 + dec Zp4B,x ; CPU:$9369 PRG:1369 D6 4B + lda $003A,y ; CPU:$936B PRG:136B B9 3A 00 + clc ; CPU:$936E PRG:136E 18 + adc #$02 ; CPU:$936F PRG:136F 69 02 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTile +; Global: UpdateActorTile.; called from $92E5 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTile: + sta $003A,y ; CPU:$9371 PRG:1371 99 3A 00 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt +; Global: UpdateActorTileAlt.; called from $9351 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt: + lda #$01 ; CPU:$9374 PRG:1374 A9 01 + jsr $9653 ; CPU:$9376 PRG:1376 20 53 96 + jmp $9B25 ; CPU:$9379 PRG:1379 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_JumpNext_937C +; Global: UpdateActorTileAlt_JumpNext_937C.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_JumpNext_937C: + lda (BytecodeStreamPointerLo),y ; CPU:$937C PRG:137C B1 1A + iny ; CPU:$937E PRG:137E C8 + sta BytecodeHandlerPointerLo ; CPU:$937F PRG:137F 85 1C + tya ; CPU:$9381 PRG:1381 98 + pha ; CPU:$9382 PRG:1382 48 + ldy ActorSlotOffset ; CPU:$9383 PRG:1383 A4 21 + lda $003B,y ; CPU:$9385 PRG:1385 B9 3B 00 + asl a ; CPU:$9388 PRG:1388 0A + lda $003C,y ; CPU:$9389 PRG:1389 B9 3C 00 + rol a ; CPU:$938C PRG:138C 2A + sta Zp51 ; CPU:$938D PRG:138D 85 51 + lda $003A,y ; CPU:$938F PRG:138F B9 3A 00 + sec ; CPU:$9392 PRG:1392 38 + sbc $0033,y ; CPU:$9393 PRG:1393 F9 33 00 + clc ; CPU:$9396 PRG:1396 18 + adc BytecodeHandlerPointerLo ; CPU:$9397 PRG:1397 65 1C + tay ; CPU:$9399 PRG:1399 A8 + ldx #$40 ; CPU:$939A PRG:139A A2 40 + jsr $A660 ; CPU:$939C PRG:139C 20 60 A6 + pla ; CPU:$939F PRG:139F 68 + tay ; CPU:$93A0 PRG:13A0 A8 + jmp $9AE8 ; CPU:$93A1 PRG:13A1 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_JumpNext_93A4 +; Global: UpdateActorTileAlt_JumpNext_93A4.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_JumpNext_93A4: + dec Zp7A,x ; CPU:$93A4 PRG:13A4 D6 7A + beq UpdateActorTileAlt_OnZero_93D0 ; CPU:$93A6 PRG:13A6 F0 28 + dey ; CPU:$93A8 PRG:13A8 88 + lda #$08 ; CPU:$93A9 PRG:13A9 A9 08 + jsr $9585 ; CPU:$93AB PRG:13AB 20 85 95 + bcs UpdateActorTileAlt_OnCarrySet_93C4 ; CPU:$93AE PRG:13AE B0 14 + jsr $9A3F ; CPU:$93B0 PRG:13B0 20 3F 9A + ldy #$5F ; CPU:$93B3 PRG:13B3 A0 5F + lda #$FA ; CPU:$93B5 PRG:13B5 A9 FA + jsr $9A24 ; CPU:$93B7 PRG:13B7 20 24 9A + ldy #$60 ; CPU:$93BA PRG:13BA A0 60 + lda #$FB ; CPU:$93BC PRG:13BC A9 FB + jsr $9A2E ; CPU:$93BE PRG:13BE 20 2E 9A + jmp $9B25 ; CPU:$93C1 PRG:13C1 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_OnCarrySet_93C4 +; Global: UpdateActorTileAlt_OnCarrySet_93C4.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_OnCarrySet_93C4: + lda #$02 ; CPU:$93C4 PRG:13C4 A9 02 + jsr $9653 ; CPU:$93C6 PRG:13C6 20 53 96 + jmp $9B25 ; CPU:$93C9 PRG:13C9 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_JumpNext_93CC +; Global: UpdateActorTileAlt_JumpNext_93CC.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_JumpNext_93CC: + dec Zp7A,x ; CPU:$93CC PRG:13CC D6 7A + bne UpdateActorTileAlt_OnNonzero_93D3 ; CPU:$93CE PRG:13CE D0 03 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_OnZero_93D0 +; Global: UpdateActorTileAlt_OnZero_93D0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_OnZero_93D0: + jmp $9AE8 ; CPU:$93D0 PRG:13D0 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_OnNonzero_93D3 +; Global: UpdateActorTileAlt_OnNonzero_93D3.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_OnNonzero_93D3: + dey ; CPU:$93D3 PRG:13D3 88 + lda #$08 ; CPU:$93D4 PRG:13D4 A9 08 + jsr $9585 ; CPU:$93D6 PRG:13D6 20 85 95 + bcs UpdateActorTileAlt_OnCarrySet_9401 ; CPU:$93D9 PRG:13D9 B0 26 + jsr $9A3F ; CPU:$93DB PRG:13DB 20 3F 9A + ldy #$5A ; CPU:$93DE PRG:13DE A0 5A + lda #$FA ; CPU:$93E0 PRG:13E0 A9 FA + jsr $9A24 ; CPU:$93E2 PRG:13E2 20 24 9A + ldy #$4E ; CPU:$93E5 PRG:13E5 A0 4E + lda #$FB ; CPU:$93E7 PRG:13E7 A9 FB + jsr $9A2E ; CPU:$93E9 PRG:13E9 20 2E 9A + ldy ActorSlotOffset ; CPU:$93EC PRG:13EC A4 21 + lda $003A,y ; CPU:$93EE PRG:13EE B9 3A 00 + clc ; CPU:$93F1 PRG:13F1 18 + adc #$08 ; CPU:$93F2 PRG:13F2 69 08 + tay ; CPU:$93F4 PRG:13F4 A8 + ldx #$80 ; CPU:$93F5 PRG:13F5 A2 80 + lda BytecodeHandlerPointerLo ; CPU:$93F7 PRG:13F7 A5 1C + sta Zp51 ; CPU:$93F9 PRG:13F9 85 51 + jsr $A660 ; CPU:$93FB PRG:13FB 20 60 A6 + jmp $9B25 ; CPU:$93FE PRG:13FE 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_OnCarrySet_9401 +; Global: UpdateActorTileAlt_OnCarrySet_9401.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_OnCarrySet_9401: + lda #$03 ; CPU:$9401 PRG:1401 A9 03 + jsr $9653 ; CPU:$9403 PRG:1403 20 53 96 + jmp $9B25 ; CPU:$9406 PRG:1406 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_JumpNext_9409 +; Global: UpdateActorTileAlt_JumpNext_9409.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_JumpNext_9409: + jsr $94C8 ; CPU:$9409 PRG:1409 20 C8 94 + jsr $9732 ; CPU:$940C PRG:140C 20 32 97 + ldx ActorIndex ; CPU:$940F PRG:140F A6 1E + lda #$02 ; CPU:$9411 PRG:1411 A9 02 + sta Zp4B,x ; CPU:$9413 PRG:1413 95 4B + jsr $9653 ; CPU:$9415 PRG:1415 20 53 96 + jmp $9B25 ; CPU:$9418 PRG:1418 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_JumpNext_941B +; Global: UpdateActorTileAlt_JumpNext_941B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_JumpNext_941B: + jsr $94C8 ; CPU:$941B PRG:141B 20 C8 94 + jsr $9732 ; CPU:$941E PRG:141E 20 32 97 + ldx ActorIndex ; CPU:$9421 PRG:1421 A6 1E + lda Zp5A,x ; CPU:$9423 PRG:1423 B5 5A + bmi UpdateActorTileAlt_OnNegative_942C ; CPU:$9425 PRG:1425 30 05 + lda #$02 ; CPU:$9427 PRG:1427 A9 02 + jsr $9653 ; CPU:$9429 PRG:1429 20 53 96 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_OnNegative_942C +; Global: UpdateActorTileAlt_OnNegative_942C.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_OnNegative_942C: + ldy ActorSlotOffset ; CPU:$942C PRG:142C A4 21 + lda Zp4B,x ; CPU:$942E PRG:142E B5 4B + lsr a ; CPU:$9430 PRG:1430 4A + sta BytecodeHandlerPointerLo ; CPU:$9431 PRG:1431 85 1C + lda $0033,y ; CPU:$9433 PRG:1433 B9 33 00 + sec ; CPU:$9436 PRG:1436 38 + sbc BytecodeHandlerPointerLo ; CPU:$9437 PRG:1437 E5 1C + bpl UpdateActorTileAlt_OnNonnegative_9441 ; CPU:$9439 PRG:1439 10 06 + cmp #$FD ; CPU:$943B PRG:143B C9 FD + bcc UpdateActorTileAlt_OnCarryClear_9454 ; CPU:$943D PRG:143D 90 15 + bcs UpdateActorTileAlt_OnCarrySet_9451 ; CPU:$943F PRG:143F B0 10 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_OnNonnegative_9441 +; Global: UpdateActorTileAlt_OnNonnegative_9441.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_OnNonnegative_9441: + cmp #$06 ; CPU:$9441 PRG:1441 C9 06 + bcs UpdateActorTileAlt_OnCarrySet_9451 ; CPU:$9443 PRG:1443 B0 0C + pha ; CPU:$9445 PRG:1445 48 + lda Zp5A,x ; CPU:$9446 PRG:1446 B5 5A + bne UpdateActorTileAlt_OnNonzero_9450 ; CPU:$9448 PRG:1448 D0 06 + lda #$06 ; CPU:$944A PRG:144A A9 06 + sta ScriptCounterA,x ; CPU:$944C PRG:144C 95 43 + sta Zp5A,x ; CPU:$944E PRG:144E 95 5A +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_OnNonzero_9450 +; Global: UpdateActorTileAlt_OnNonzero_9450.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_OnNonzero_9450: + pla ; CPU:$9450 PRG:1450 68 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_OnCarrySet_9451 +; Global: UpdateActorTileAlt_OnCarrySet_9451.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_OnCarrySet_9451: + jmp $969E ; CPU:$9451 PRG:1451 4C 9E 96 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_OnCarryClear_9454 +; Global: UpdateActorTileAlt_OnCarryClear_9454.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_OnCarryClear_9454: + lda Zp5A,x ; CPU:$9454 PRG:1454 B5 5A + bmi UpdateActorTileAlt_OnNegative_945B ; CPU:$9456 PRG:1456 30 03 + jmp $96AA ; CPU:$9458 PRG:1458 4C AA 96 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_OnNegative_945B +; Global: UpdateActorTileAlt_OnNegative_945B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_OnNegative_945B: + ldy #$4F ; CPU:$945B PRG:145B A0 4F + lda #$FA ; CPU:$945D PRG:145D A9 FA + jsr $9A24 ; CPU:$945F PRG:145F 20 24 9A + jmp $9B25 ; CPU:$9462 PRG:1462 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_JumpNext_9465 +; Global: UpdateActorTileAlt_JumpNext_9465.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_JumpNext_9465: + lda (BytecodeStreamPointerLo),y ; CPU:$9465 PRG:1465 B1 1A + iny ; CPU:$9467 PRG:1467 C8 + sta Zp7A,x ; CPU:$9468 PRG:1468 95 7A + jmp $9AE8 ; CPU:$946A PRG:146A 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_JumpNext_946D +; Global: UpdateActorTileAlt_JumpNext_946D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_JumpNext_946D: + lda (BytecodeStreamPointerLo),y ; CPU:$946D PRG:146D B1 1A + iny ; CPU:$946F PRG:146F C8 + sta Zp7C,x ; CPU:$9470 PRG:1470 95 7C + sty Zp7E,x ; CPU:$9472 PRG:1472 94 7E + jmp $9AE8 ; CPU:$9474 PRG:1474 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_JumpNext_9477 +; Global: UpdateActorTileAlt_JumpNext_9477.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_JumpNext_9477: + dec Zp7C,x ; CPU:$9477 PRG:1477 D6 7C + beq UpdateActorTileAlt_OnZero_947D ; CPU:$9479 PRG:1479 F0 02 + ldy Zp7E,x ; CPU:$947B PRG:147B B4 7E +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_OnZero_947D +; Global: UpdateActorTileAlt_OnZero_947D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_OnZero_947D: + jmp $9AE8 ; CPU:$947D PRG:147D 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_JumpNext_9480 +; Global: UpdateActorTileAlt_JumpNext_9480.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_JumpNext_9480: + jsr $94C8 ; CPU:$9480 PRG:1480 20 C8 94 + lda $003A,y ; CPU:$9483 PRG:1483 B9 3A 00 + clc ; CPU:$9486 PRG:1486 18 + adc #$06 ; CPU:$9487 PRG:1487 69 06 + sta $003A,y ; CPU:$9489 PRG:1489 99 3A 00 + jmp $9B25 ; CPU:$948C PRG:148C 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_JumpNext_948F +; Global: UpdateActorTileAlt_JumpNext_948F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_JumpNext_948F: + dec Zp7A,x ; CPU:$948F PRG:148F D6 7A + beq UpdateActorTileAlt_OnZero_94AA ; CPU:$9491 PRG:1491 F0 17 + jsr $94C7 ; CPU:$9493 PRG:1493 20 C7 94 + jmp $9B25 ; CPU:$9496 PRG:1496 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_JumpNext_9499 +; Global: UpdateActorTileAlt_JumpNext_9499.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_JumpNext_9499: + tya ; CPU:$9499 PRG:1499 98 + pha ; CPU:$949A PRG:149A 48 + lda #$20 ; CPU:$949B PRG:149B A9 20 + sta BytecodeHandlerPointerLo ; CPU:$949D PRG:149D 85 1C + lda #$BD ; CPU:$949F PRG:149F A9 BD + sta BytecodeHandlerPointerHi ; CPU:$94A1 PRG:14A1 85 1D + lda ActorSlotOffsetHi ; CPU:$94A3 PRG:14A3 A5 22 + jsr $99E4 ; CPU:$94A5 PRG:14A5 20 E4 99 + pla ; CPU:$94A8 PRG:14A8 68 + tay ; CPU:$94A9 PRG:14A9 A8 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_OnZero_94AA +; Global: UpdateActorTileAlt_OnZero_94AA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_OnZero_94AA: + jmp $9AE8 ; CPU:$94AA PRG:14AA 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileAlt_JumpNext_94AD +; Global: UpdateActorTileAlt_JumpNext_94AD.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileAlt_JumpNext_94AD: + dec Zp7A,x ; CPU:$94AD PRG:14AD D6 7A + beq UpdateActorTileAlt_OnZero_94AA ; CPU:$94AF PRG:14AF F0 F9 +; ----------------------------------------------------------------------------- +; Routine: TestPlayerFacing +; Global: TestPlayerFacing.; called from $99A0 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestPlayerFacing: + jsr $94C7 ; CPU:$94B1 PRG:14B1 20 C7 94 + lda FrameCounterLo ; CPU:$94B4 PRG:14B4 A5 24 + and #$01 ; CPU:$94B6 PRG:14B6 29 01 + asl a ; CPU:$94B8 PRG:14B8 0A + sbc #$01 ; CPU:$94B9 PRG:14B9 E9 01 + sta Zp5C,x ; CPU:$94BB PRG:14BB 95 5C + jmp $9B25 ; CPU:$94BD PRG:14BD 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: TestPlayerFacing_JumpNext_94C0 +; Global: TestPlayerFacing_JumpNext_94C0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestPlayerFacing_JumpNext_94C0: + lda #$FF ; CPU:$94C0 PRG:14C0 A9 FF + sta SoundVolume3,x ; CPU:$94C2 PRG:14C2 95 82 + jmp $9AE8 ; CPU:$94C4 PRG:14C4 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: SelectActorSlot +; Global: SelectActorSlot.; called from $929F, $92B6, $92D1, $9330, $9358, $9493, $94B1, $9522 and 3 more +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SelectActorSlot: + dey ; CPU:$94C7 PRG:14C7 88 +; ----------------------------------------------------------------------------- +; Routine: SelectActorSlotAlt +; Global: SelectActorSlotAlt.; called from $9409, $941B, $9480, $9559, $9587, $9644, $966D, $9B0C +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SelectActorSlotAlt: + ldx ActorIndex ; CPU:$94C8 PRG:14C8 A6 1E + sty ScriptFlags,x ; CPU:$94CA PRG:14CA 94 41 + ldy ActorSlotOffset ; CPU:$94CC PRG:14CC A4 21 + rts ; CPU:$94CE PRG:14CE 60 +; ----------------------------------------------------------------------------- +; Routine: ClearActorPosition +; Global: ClearActorPosition.; called from $954E, $99DF +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearActorPosition: + ldx ActorIndex ; CPU:$94CF PRG:14CF A6 1E + ldy ActorSlotOffset ; CPU:$94D1 PRG:14D1 A4 21 + lda #$00 ; CPU:$94D3 PRG:14D3 A9 00 + sta PlayerActionState,x ; CPU:$94D5 PRG:14D5 95 F0 +; ----------------------------------------------------------------------------- +; Routine: ClearActorFields +; Global: ClearActorFields.; called from $9508 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearActorFields: + sta $0033,y ; CPU:$94D7 PRG:14D7 99 33 00 + sta $0034,y ; CPU:$94DA PRG:14DA 99 34 00 + lda Zp8A ; CPU:$94DD PRG:14DD A5 8A + beq ClearActorFields_JoinBranchPaths_94F3 ; CPU:$94DF PRG:14DF F0 12 + inx ; CPU:$94E1 PRG:14E1 E8 + cpx Zp8A ; CPU:$94E2 PRG:14E2 E4 8A + bne ClearActorFields_OnNonzero_94F6 ; CPU:$94E4 PRG:14E4 D0 10 + ldy #$64 ; CPU:$94E6 PRG:14E6 A0 64 + lda #$FE ; CPU:$94E8 PRG:14E8 A9 FE + jsr $9A24 ; CPU:$94EA PRG:14EA 20 24 9A + ldx ActorSlotOffsetHi ; CPU:$94ED PRG:14ED A6 22 + lda #$80 ; CPU:$94EF PRG:14EF A9 80 + sta PlayerActionState,x ; CPU:$94F1 PRG:14F1 95 F0 +; ----------------------------------------------------------------------------- +; Routine: ClearActorFields_JoinBranchPaths_94F3 +; Global: ClearActorFields_JoinBranchPaths_94F3.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearActorFields_JoinBranchPaths_94F3: + jmp $9B25 ; CPU:$94F3 PRG:14F3 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: ClearActorFields_OnNonzero_94F6 +; Global: ClearActorFields_OnNonzero_94F6.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearActorFields_OnNonzero_94F6: + ldx ActorIndex ; CPU:$94F6 PRG:14F6 A6 1E + lda #$80 ; CPU:$94F8 PRG:14F8 A9 80 + sta PlayerActionState,x ; CPU:$94FA PRG:14FA 95 F0 + bne ClearActorFields_JoinBranchPaths_94F3 ; CPU:$94FC PRG:14FC D0 F5 +; ----------------------------------------------------------------------------- +; Routine: SetActorFlag +; Global: SetActorFlag.; called from $96B9, $9945 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorFlag: + ldx ActorIndex ; CPU:$94FE PRG:14FE A6 1E + ldy ActorSlotOffset ; CPU:$9500 PRG:1500 A4 21 + lda #$80 ; CPU:$9502 PRG:1502 A9 80 + sta PlayerActionState,x ; CPU:$9504 PRG:1504 95 F0 + lda #$00 ; CPU:$9506 PRG:1506 A9 00 + jmp $94D7 ; CPU:$9508 PRG:1508 4C D7 94 +; ----------------------------------------------------------------------------- +; Routine: SetActorFlag_JumpNext_950B +; Global: SetActorFlag_JumpNext_950B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorFlag_JumpNext_950B: + lda (BytecodeStreamPointerLo),y ; CPU:$950B PRG:150B B1 1A + iny ; CPU:$950D PRG:150D C8 + sta ScriptCounterA,x ; CPU:$950E PRG:150E 95 43 + jmp $9AE8 ; CPU:$9510 PRG:1510 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: SetActorFlag_JumpNext_9513 +; Global: SetActorFlag_JumpNext_9513.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorFlag_JumpNext_9513: + ldx ActorSlotOffsetHi ; CPU:$9513 PRG:1513 A6 22 + lda PlayerActionState,x ; CPU:$9515 PRG:1515 B5 F0 + cmp #$80 ; CPU:$9517 PRG:1517 C9 80 + bne SetActorFlag_OnNonzero_951F ; CPU:$9519 PRG:1519 D0 04 + lda #$00 ; CPU:$951B PRG:151B A9 00 + sta PlayerActionState,x ; CPU:$951D PRG:151D 95 F0 +; ----------------------------------------------------------------------------- +; Routine: SetActorFlag_OnNonzero_951F +; Global: SetActorFlag_OnNonzero_951F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorFlag_OnNonzero_951F: + jmp $9AE8 ; CPU:$951F PRG:151F 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: SetActorFlag_JumpNext_9522 +; Global: SetActorFlag_JumpNext_9522.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorFlag_JumpNext_9522: + jsr $94C7 ; CPU:$9522 PRG:1522 20 C7 94 + dec Zp60,x ; CPU:$9525 PRG:1525 D6 60 + beq ClearActorPosition ; CPU:$9527 PRG:1527 F0 A6 + lda #$FF ; CPU:$9529 PRG:1529 A9 FF + jsr $9653 ; CPU:$952B PRG:152B 20 53 96 + lda Zp62,x ; CPU:$952E PRG:152E B5 62 + bne SetActorFlag_OnNonzero_9535 ; CPU:$9530 PRG:1530 D0 03 + jmp $9B25 ; CPU:$9532 PRG:1532 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: SetActorFlag_OnNonzero_9535 +; Global: SetActorFlag_OnNonzero_9535.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorFlag_OnNonzero_9535: + ldy #$4A ; CPU:$9535 PRG:1535 A0 4A + lda #$F6 ; CPU:$9537 PRG:1537 A9 F6 + jsr $9A24 ; CPU:$9539 PRG:1539 20 24 9A + lda #$20 ; CPU:$953C PRG:153C A9 20 + sta Zp60,x ; CPU:$953E PRG:153E 95 60 + rts ; CPU:$9540 PRG:1540 60 +; ----------------------------------------------------------------------------- +; Routine: SetActorFlag_Return_9541 +; Global: SetActorFlag_Return_9541.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorFlag_Return_9541: + jsr $94C7 ; CPU:$9541 PRG:1541 20 C7 94 + dec Zp60,x ; CPU:$9544 PRG:1544 D6 60 + bne SetActorFlag_OnNonzero_9551 ; CPU:$9546 PRG:1546 D0 09 + lda #$00 ; CPU:$9548 PRG:1548 A9 00 + sta Zp62,x ; CPU:$954A PRG:154A 95 62 + bne SetActorFlag_OnNonzero_9551 ; CPU:$954C PRG:154C D0 03 + jmp $94CF ; CPU:$954E PRG:154E 4C CF 94 +; ----------------------------------------------------------------------------- +; Routine: SetActorFlag_OnNonzero_9551 +; Global: SetActorFlag_OnNonzero_9551.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorFlag_OnNonzero_9551: + lda #$01 ; CPU:$9551 PRG:1551 A9 01 + jsr $9653 ; CPU:$9553 PRG:1553 20 53 96 + jmp $9B25 ; CPU:$9556 PRG:1556 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: SetActorFlag_JumpNext_9559 +; Global: SetActorFlag_JumpNext_9559.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorFlag_JumpNext_9559: + jsr $94C8 ; CPU:$9559 PRG:1559 20 C8 94 + lda $003A,y ; CPU:$955C PRG:155C B9 3A 00 + clc ; CPU:$955F PRG:155F 18 + adc #$20 ; CPU:$9560 PRG:1560 69 20 + pha ; CPU:$9562 PRG:1562 48 + lda $003B,y ; CPU:$9563 PRG:1563 B9 3B 00 + asl a ; CPU:$9566 PRG:1566 0A + lda $003C,y ; CPU:$9567 PRG:1567 B9 3C 00 + rol a ; CPU:$956A PRG:156A 2A + sec ; CPU:$956B PRG:156B 38 + sta Zp51 ; CPU:$956C PRG:156C 85 51 + ldx #$40 ; CPU:$956E PRG:156E A2 40 + pla ; CPU:$9570 PRG:1570 68 + tay ; CPU:$9571 PRG:1571 A8 + jsr $A660 ; CPU:$9572 PRG:1572 20 60 A6 + lda #$B0 ; CPU:$9575 PRG:1575 A9 B0 + sta BytecodeHandlerPointerLo ; CPU:$9577 PRG:1577 85 1C + lda #$BA ; CPU:$9579 PRG:1579 A9 BA + sta BytecodeHandlerPointerHi ; CPU:$957B PRG:157B 85 1D + lda ActorSlotOffsetHi ; CPU:$957D PRG:157D A5 22 + jsr $99E4 ; CPU:$957F PRG:157F 20 E4 99 + jmp $9B25 ; CPU:$9582 PRG:1582 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: UpdateActorState +; Global: UpdateActorState.; called from $93AB, $93D6, $95E6 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorState: + sta BytecodeHandlerPointerHi ; CPU:$9585 PRG:1585 85 1D + jsr $94C8 ; CPU:$9587 PRG:1587 20 C8 94 + lda ScriptFlagsHi ; CPU:$958A PRG:158A A5 4E + bne UpdateActorState_OnNonzero_9590 ; CPU:$958C PRG:158C D0 02 + sec ; CPU:$958E PRG:158E 38 + rts ; CPU:$958F PRG:158F 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorState_OnNonzero_9590 +; Global: UpdateActorState_OnNonzero_9590.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorState_OnNonzero_9590: + ldx ActorIndex ; CPU:$9590 PRG:1590 A6 1E + bne ComputeActorLeftEdge_OnNonzero_95B8 ; CPU:$9592 PRG:1592 D0 24 + lda ControllerDPad1 ; CPU:$9594 PRG:1594 A5 F6 + ror a ; CPU:$9596 PRG:1596 6A + bcc ComputeActorLeftEdge_OnCarryClear_95C9 ; CPU:$9597 PRG:1597 90 30 + lda Zp3B ; CPU:$9599 PRG:1599 A5 3B + asl a ; CPU:$959B PRG:159B 0A + lda PlayerPosYLo1 ; CPU:$959C PRG:159C A5 3C + rol a ; CPU:$959E PRG:159E 2A + clc ; CPU:$959F PRG:159F 18 + adc #$0A ; CPU:$95A0 PRG:15A0 69 0A + jmp $95AE ; CPU:$95A2 PRG:15A2 4C AE 95 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorState_OnCarryClear_95A5 +; Global: UpdateActorState_OnCarryClear_95A5.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorState_OnCarryClear_95A5: + lda Zp3F ; CPU:$95A5 PRG:15A5 A5 3F + asl a ; CPU:$95A7 PRG:15A7 0A + lda PlayerPosYLo2 ; CPU:$95A8 PRG:15A8 A5 40 + rol a ; CPU:$95AA PRG:15AA 2A + sec ; CPU:$95AB PRG:15AB 38 + sbc #$12 ; CPU:$95AC PRG:15AC E9 12 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorLeftEdge +; Global: ComputeActorLeftEdge.; called from $95A2 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorLeftEdge: + sta BytecodeHandlerPointerLo ; CPU:$95AE PRG:15AE 85 1C + lda PlayerPosYLo2 ; CPU:$95B0 PRG:15B0 A5 40 + sec ; CPU:$95B2 PRG:15B2 38 + sbc PlayerPosYLo1 ; CPU:$95B3 PRG:15B3 E5 3C + jmp $95D9 ; CPU:$95B5 PRG:15B5 4C D9 95 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorLeftEdge_OnNonzero_95B8 +; Global: ComputeActorLeftEdge_OnNonzero_95B8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorLeftEdge_OnNonzero_95B8: + lda ControllerDPad2 ; CPU:$95B8 PRG:15B8 A5 F7 + ror a ; CPU:$95BA PRG:15BA 6A + bcc UpdateActorState_OnCarryClear_95A5 ; CPU:$95BB PRG:15BB 90 E8 + lda Zp3F ; CPU:$95BD PRG:15BD A5 3F + asl a ; CPU:$95BF PRG:15BF 0A + lda PlayerPosYLo2 ; CPU:$95C0 PRG:15C0 A5 40 + rol a ; CPU:$95C2 PRG:15C2 2A + clc ; CPU:$95C3 PRG:15C3 18 + adc #$0A ; CPU:$95C4 PRG:15C4 69 0A + jmp $95D2 ; CPU:$95C6 PRG:15C6 4C D2 95 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorLeftEdge_OnCarryClear_95C9 +; Global: ComputeActorLeftEdge_OnCarryClear_95C9.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorLeftEdge_OnCarryClear_95C9: + lda Zp3B ; CPU:$95C9 PRG:15C9 A5 3B + asl a ; CPU:$95CB PRG:15CB 0A + lda PlayerPosYLo1 ; CPU:$95CC PRG:15CC A5 3C + rol a ; CPU:$95CE PRG:15CE 2A + sec ; CPU:$95CF PRG:15CF 38 + sbc #$12 ; CPU:$95D0 PRG:15D0 E9 12 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorRightEdge +; Global: ComputeActorRightEdge.; called from $95C6 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorRightEdge: + sta BytecodeHandlerPointerLo ; CPU:$95D2 PRG:15D2 85 1C + lda PlayerPosYLo1 ; CPU:$95D4 PRG:15D4 A5 3C + sec ; CPU:$95D6 PRG:15D6 38 + sbc PlayerPosYLo2 ; CPU:$95D7 PRG:15D7 E5 40 +; ----------------------------------------------------------------------------- +; Routine: CompareActorToLimit +; Global: CompareActorToLimit.; called from $95B5 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorToLimit: + cmp BytecodeHandlerPointerHi ; CPU:$95D9 PRG:15D9 C5 1D + rts ; CPU:$95DB PRG:15DB 60 +; ----------------------------------------------------------------------------- +; Routine: CompareActorToLimit_Return_95DC +; Global: CompareActorToLimit_Return_95DC.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorToLimit_Return_95DC: + dec Zp7A,x ; CPU:$95DC PRG:15DC D6 7A + bne CompareActorToLimit_OnNonzero_95E3 ; CPU:$95DE PRG:15DE D0 03 + jmp $9AE8 ; CPU:$95E0 PRG:15E0 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: CompareActorToLimit_OnNonzero_95E3 +; Global: CompareActorToLimit_OnNonzero_95E3.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorToLimit_OnNonzero_95E3: + dey ; CPU:$95E3 PRG:15E3 88 + lda #$06 ; CPU:$95E4 PRG:15E4 A9 06 + jsr $9585 ; CPU:$95E6 PRG:15E6 20 85 95 + bcs CompareActorToLimit_OnCarrySet_9628 ; CPU:$95E9 PRG:15E9 B0 3D + lda Zp4F,x ; CPU:$95EB PRG:15EB B5 4F + clc ; CPU:$95ED PRG:15ED 18 + adc #$02 ; CPU:$95EE PRG:15EE 69 02 + sta Zp4F,x ; CPU:$95F0 PRG:15F0 95 4F + jsr $9A3F ; CPU:$95F2 PRG:15F2 20 3F 9A + lda #$F1 ; CPU:$95F5 PRG:15F5 A9 F1 + ldy #$45 ; CPU:$95F7 PRG:15F7 A0 45 + jsr $9A24 ; CPU:$95F9 PRG:15F9 20 24 9A + lda $003A,y ; CPU:$95FC PRG:15FC B9 3A 00 + clc ; CPU:$95FF PRG:15FF 18 + adc #$08 ; CPU:$9600 PRG:1600 69 08 + tay ; CPU:$9602 PRG:1602 A8 + ldx #$80 ; CPU:$9603 PRG:1603 A2 80 + lda BytecodeHandlerPointerLo ; CPU:$9605 PRG:1605 A5 1C + sta Zp51 ; CPU:$9607 PRG:1607 85 51 + jsr $A660 ; CPU:$9609 PRG:1609 20 60 A6 + lda #$88 ; CPU:$960C PRG:160C A9 88 + sta BytecodeHandlerPointerLo ; CPU:$960E PRG:160E 85 1C + lda #$BB ; CPU:$9610 PRG:1610 A9 BB + sta BytecodeHandlerPointerHi ; CPU:$9612 PRG:1612 85 1D + jsr $99E2 ; CPU:$9614 PRG:1614 20 E2 99 + lda #$F3 ; CPU:$9617 PRG:1617 A9 F3 + ldy #$63 ; CPU:$9619 PRG:1619 A0 63 + jsr $9A2E ; CPU:$961B PRG:161B 20 2E 9A + sta Zp62,x ; CPU:$961E PRG:161E 95 62 + sta SoundVolume3,x ; CPU:$9620 PRG:1620 95 82 + jsr $97D5 ; CPU:$9622 PRG:1622 20 D5 97 + jmp $9B25 ; CPU:$9625 PRG:1625 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: CompareActorToLimit_OnCarrySet_9628 +; Global: CompareActorToLimit_OnCarrySet_9628.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorToLimit_OnCarrySet_9628: + lda #$01 ; CPU:$9628 PRG:1628 A9 01 + jsr $9653 ; CPU:$962A PRG:162A 20 53 96 + ldy ActorSlotOffset ; CPU:$962D PRG:162D A4 21 + lda $0033,y ; CPU:$962F PRG:162F B9 33 00 + cmp #$14 ; CPU:$9632 PRG:1632 C9 14 + beq CompareActorToLimit_OnZero_9641 ; CPU:$9634 PRG:1634 F0 0B + bcs CompareActorToLimit_OnCarrySet_963C ; CPU:$9636 PRG:1636 B0 04 + adc #$01 ; CPU:$9638 PRG:1638 69 01 + bpl CompareActorToLimit_OnNonnegative_963E ; CPU:$963A PRG:163A 10 02 +; ----------------------------------------------------------------------------- +; Routine: CompareActorToLimit_OnCarrySet_963C +; Global: CompareActorToLimit_OnCarrySet_963C.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorToLimit_OnCarrySet_963C: + sbc #$01 ; CPU:$963C PRG:163C E9 01 +; ----------------------------------------------------------------------------- +; Routine: CompareActorToLimit_OnNonnegative_963E +; Global: CompareActorToLimit_OnNonnegative_963E.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorToLimit_OnNonnegative_963E: + sta $0033,y ; CPU:$963E PRG:163E 99 33 00 +; ----------------------------------------------------------------------------- +; Routine: CompareActorToLimit_OnZero_9641 +; Global: CompareActorToLimit_OnZero_9641.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorToLimit_OnZero_9641: + jmp $9B25 ; CPU:$9641 PRG:1641 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: CompareActorToLimit_JumpNext_9644 +; Global: CompareActorToLimit_JumpNext_9644.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorToLimit_JumpNext_9644: + jsr $94C8 ; CPU:$9644 PRG:1644 20 C8 94 + lda #$02 ; CPU:$9647 PRG:1647 A9 02 + sta Zp4B,x ; CPU:$9649 PRG:1649 95 4B + lda #$01 ; CPU:$964B PRG:164B A9 01 + jsr $9653 ; CPU:$964D PRG:164D 20 53 96 + jmp $9B25 ; CPU:$9650 PRG:1650 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: SetActorTileFromPalette +; Global: SetActorTileFromPalette.; called from $9376, $93C6, $9403, $9415, $9429, $952B, $9553, $962A and 3 more +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorTileFromPalette: + sta BytecodeHandlerPointerLo ; CPU:$9653 PRG:1653 85 1C + ldy ActorSlotOffset ; CPU:$9655 PRG:1655 A4 21 + lda $003C,y ; CPU:$9657 PRG:1657 B9 3C 00 + ldx Zp19 ; CPU:$965A PRG:165A A6 19 + bne SetActorTileFromPalette_OnNonzero_9664 ; CPU:$965C PRG:165C D0 06 + sec ; CPU:$965E PRG:165E 38 + sbc BytecodeHandlerPointerLo ; CPU:$965F PRG:165F E5 1C + jmp $9667 ; CPU:$9661 PRG:1661 4C 67 96 +; ----------------------------------------------------------------------------- +; Routine: SetActorTileFromPalette_OnNonzero_9664 +; Global: SetActorTileFromPalette_OnNonzero_9664.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorTileFromPalette_OnNonzero_9664: + clc ; CPU:$9664 PRG:1664 18 + adc BytecodeHandlerPointerLo ; CPU:$9665 PRG:1665 65 1C +; ----------------------------------------------------------------------------- +; Routine: StoreActorTile +; Global: StoreActorTile.; called from $9661 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorTile: + sta $003C,y ; CPU:$9667 PRG:1667 99 3C 00 + ldx ActorIndex ; CPU:$966A PRG:166A A6 1E + rts ; CPU:$966C PRG:166C 60 +; ----------------------------------------------------------------------------- +; Routine: StoreActorTile_Return_966D +; Global: StoreActorTile_Return_966D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorTile_Return_966D: + jsr $94C8 ; CPU:$966D PRG:166D 20 C8 94 + lda Zp5A,x ; CPU:$9670 PRG:1670 B5 5A + bmi StoreActorTile_OnNegative_9679 ; CPU:$9672 PRG:1672 30 05 + lda #$01 ; CPU:$9674 PRG:1674 A9 01 + jsr $9653 ; CPU:$9676 PRG:1676 20 53 96 +; ----------------------------------------------------------------------------- +; Routine: StoreActorTile_OnNegative_9679 +; Global: StoreActorTile_OnNegative_9679.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorTile_OnNegative_9679: + ldy ActorSlotOffset ; CPU:$9679 PRG:1679 A4 21 + lda Zp4B,x ; CPU:$967B PRG:167B B5 4B + lsr a ; CPU:$967D PRG:167D 4A + sta BytecodeHandlerPointerLo ; CPU:$967E PRG:167E 85 1C + lda $0033,y ; CPU:$9680 PRG:1680 B9 33 00 + sec ; CPU:$9683 PRG:1683 38 + sbc BytecodeHandlerPointerLo ; CPU:$9684 PRG:1684 E5 1C + bpl StoreActorTile_OnNonnegative_968E ; CPU:$9686 PRG:1686 10 06 + cmp #$FD ; CPU:$9688 PRG:1688 C9 FD + bcc AdvanceActorCounter_OnCarryClear_96A6 ; CPU:$968A PRG:168A 90 1A + bcs AdvanceActorCounter ; CPU:$968C PRG:168C B0 10 +; ----------------------------------------------------------------------------- +; Routine: StoreActorTile_OnNonnegative_968E +; Global: StoreActorTile_OnNonnegative_968E.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorTile_OnNonnegative_968E: + cmp #$06 ; CPU:$968E PRG:168E C9 06 + bcs AdvanceActorCounter ; CPU:$9690 PRG:1690 B0 0C + pha ; CPU:$9692 PRG:1692 48 + lda Zp5A,x ; CPU:$9693 PRG:1693 B5 5A + bne StoreActorTile_OnNonzero_969D ; CPU:$9695 PRG:1695 D0 06 + lda #$06 ; CPU:$9697 PRG:1697 A9 06 + sta ScriptCounterA,x ; CPU:$9699 PRG:1699 95 43 + sta Zp5A,x ; CPU:$969B PRG:169B 95 5A +; ----------------------------------------------------------------------------- +; Routine: StoreActorTile_OnNonzero_969D +; Global: StoreActorTile_OnNonzero_969D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorTile_OnNonzero_969D: + pla ; CPU:$969D PRG:169D 68 +; ----------------------------------------------------------------------------- +; Routine: AdvanceActorCounter +; Global: AdvanceActorCounter.; called from $9451 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceActorCounter: + sta $0033,y ; CPU:$969E PRG:169E 99 33 00 + inc Zp4B,x ; CPU:$96A1 PRG:16A1 F6 4B + jmp $9B25 ; CPU:$96A3 PRG:16A3 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: AdvanceActorCounter_OnCarryClear_96A6 +; Global: AdvanceActorCounter_OnCarryClear_96A6.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceActorCounter_OnCarryClear_96A6: + lda Zp5A,x ; CPU:$96A6 PRG:16A6 B5 5A + bmi SetActorTileValue_OnNegative_96B9 ; CPU:$96A8 PRG:16A8 30 0F +; ----------------------------------------------------------------------------- +; Routine: SetActorTileValue +; Global: SetActorTileValue.; called from $9458 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorTileValue: + lda #$FD ; CPU:$96AA PRG:16AA A9 FD + sta $0033,y ; CPU:$96AC PRG:16AC 99 33 00 + ldy #$44 ; CPU:$96AF PRG:16AF A0 44 + lda #$F2 ; CPU:$96B1 PRG:16B1 A9 F2 +; ----------------------------------------------------------------------------- +; Routine: SetActorTileValue_OnNonzero_96B3 +; Global: SetActorTileValue_OnNonzero_96B3.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorTileValue_OnNonzero_96B3: + jsr $9A24 ; CPU:$96B3 PRG:16B3 20 24 9A + jmp $9B25 ; CPU:$96B6 PRG:16B6 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: SetActorTileValue_OnNegative_96B9 +; Global: SetActorTileValue_OnNegative_96B9.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorTileValue_OnNegative_96B9: + jmp $94FE ; CPU:$96B9 PRG:16B9 4C FE 94 +; ----------------------------------------------------------------------------- +; Routine: SetActorTileValue_JumpNext_96BC +; Global: SetActorTileValue_JumpNext_96BC.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorTileValue_JumpNext_96BC: + ldy #$4F ; CPU:$96BC PRG:16BC A0 4F + lda #$FA ; CPU:$96BE PRG:16BE A9 FA + bne SetActorTileValue_OnNonzero_96B3 ; CPU:$96C0 PRG:16C0 D0 F1 +; ----------------------------------------------------------------------------- +; Routine: SetActorTileValue_Continue_96C2 +; Global: SetActorTileValue_Continue_96C2.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorTileValue_Continue_96C2: + ldy #$5B ; CPU:$96C2 PRG:16C2 A0 5B + lda #$FB ; CPU:$96C4 PRG:16C4 A9 FB + bne SetActorTileValue_OnNonzero_96B3 ; CPU:$96C6 PRG:16C6 D0 EB +; ----------------------------------------------------------------------------- +; Routine: TestActorCollisionFlag +; Global: TestActorCollisionFlag.; called from $9732, $975E +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorCollisionFlag: + lda Zp5A,x ; CPU:$96C8 PRG:16C8 B5 5A + beq TestActorCollisionFlag_OnZero_96CE ; CPU:$96CA PRG:16CA F0 02 +; ----------------------------------------------------------------------------- +; Routine: TestActorCollisionFlag_OnZero_96CC +; Global: TestActorCollisionFlag_OnZero_96CC.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorCollisionFlag_OnZero_96CC: + sec ; CPU:$96CC PRG:16CC 38 + rts ; CPU:$96CD PRG:16CD 60 +; ----------------------------------------------------------------------------- +; Routine: TestActorCollisionFlag_OnZero_96CE +; Global: TestActorCollisionFlag_OnZero_96CE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorCollisionFlag_OnZero_96CE: + lda ScriptFlagsHi ; CPU:$96CE PRG:16CE A5 4E + beq TestActorCollisionFlag_OnZero_96CC ; CPU:$96D0 PRG:16D0 F0 FA + ldx ActorIndex ; CPU:$96D2 PRG:16D2 A6 1E + bne ComputeActorLeftEdgeAlt_OnNonzero_9701 ; CPU:$96D4 PRG:16D4 D0 2B + lda Zp33 ; CPU:$96D6 PRG:16D6 A5 33 + sec ; CPU:$96D8 PRG:16D8 38 + sbc Zp37 ; CPU:$96D9 PRG:16D9 E5 37 + sta BytecodeHandlerPointerHi ; CPU:$96DB PRG:16DB 85 1D + lda ControllerDPad1 ; CPU:$96DD PRG:16DD A5 F6 + ror a ; CPU:$96DF PRG:16DF 6A + bcc ComputeActorLeftEdgeAlt_OnCarryClear_9719 ; CPU:$96E0 PRG:16E0 90 37 + lda Zp3B ; CPU:$96E2 PRG:16E2 A5 3B + asl a ; CPU:$96E4 PRG:16E4 0A + lda PlayerPosYLo1 ; CPU:$96E5 PRG:16E5 A5 3C + rol a ; CPU:$96E7 PRG:16E7 2A + clc ; CPU:$96E8 PRG:16E8 18 + adc #$0A ; CPU:$96E9 PRG:16E9 69 0A + jmp $96F7 ; CPU:$96EB PRG:16EB 4C F7 96 +; ----------------------------------------------------------------------------- +; Routine: TestActorCollisionFlag_OnCarryClear_96EE +; Global: TestActorCollisionFlag_OnCarryClear_96EE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorCollisionFlag_OnCarryClear_96EE: + lda Zp3F ; CPU:$96EE PRG:16EE A5 3F + asl a ; CPU:$96F0 PRG:16F0 0A + lda PlayerPosYLo2 ; CPU:$96F1 PRG:16F1 A5 40 + rol a ; CPU:$96F3 PRG:16F3 2A + sec ; CPU:$96F4 PRG:16F4 38 + sbc #$12 ; CPU:$96F5 PRG:16F5 E9 12 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorLeftEdgeAlt +; Global: ComputeActorLeftEdgeAlt.; called from $96EB +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorLeftEdgeAlt: + sta BytecodeHandlerPointerLo ; CPU:$96F7 PRG:16F7 85 1C + lda PlayerPosYLo2 ; CPU:$96F9 PRG:16F9 A5 40 + sec ; CPU:$96FB PRG:16FB 38 + sbc PlayerPosYLo1 ; CPU:$96FC PRG:16FC E5 3C + jmp $9729 ; CPU:$96FE PRG:16FE 4C 29 97 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorLeftEdgeAlt_OnNonzero_9701 +; Global: ComputeActorLeftEdgeAlt_OnNonzero_9701.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorLeftEdgeAlt_OnNonzero_9701: + lda Zp37 ; CPU:$9701 PRG:1701 A5 37 + sec ; CPU:$9703 PRG:1703 38 + sbc Zp33 ; CPU:$9704 PRG:1704 E5 33 + sta BytecodeHandlerPointerHi ; CPU:$9706 PRG:1706 85 1D + lda ControllerDPad2 ; CPU:$9708 PRG:1708 A5 F7 + ror a ; CPU:$970A PRG:170A 6A + bcc TestActorCollisionFlag_OnCarryClear_96EE ; CPU:$970B PRG:170B 90 E1 + lda Zp3F ; CPU:$970D PRG:170D A5 3F + asl a ; CPU:$970F PRG:170F 0A + lda PlayerPosYLo2 ; CPU:$9710 PRG:1710 A5 40 + rol a ; CPU:$9712 PRG:1712 2A + clc ; CPU:$9713 PRG:1713 18 + adc #$0A ; CPU:$9714 PRG:1714 69 0A + jmp $9722 ; CPU:$9716 PRG:1716 4C 22 97 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorLeftEdgeAlt_OnCarryClear_9719 +; Global: ComputeActorLeftEdgeAlt_OnCarryClear_9719.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorLeftEdgeAlt_OnCarryClear_9719: + lda Zp3B ; CPU:$9719 PRG:1719 A5 3B + asl a ; CPU:$971B PRG:171B 0A + lda PlayerPosYLo1 ; CPU:$971C PRG:171C A5 3C + rol a ; CPU:$971E PRG:171E 2A + sec ; CPU:$971F PRG:171F 38 + sbc #$12 ; CPU:$9720 PRG:1720 E9 12 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorRightEdgeAlt +; Global: ComputeActorRightEdgeAlt.; called from $9716 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorRightEdgeAlt: + sta BytecodeHandlerPointerLo ; CPU:$9722 PRG:1722 85 1C + lda PlayerPosYLo1 ; CPU:$9724 PRG:1724 A5 3C + sec ; CPU:$9726 PRG:1726 38 + sbc PlayerPosYLo2 ; CPU:$9727 PRG:1727 E5 40 +; ----------------------------------------------------------------------------- +; Routine: TestActorRange +; Global: TestActorRange.; called from $96FE +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorRange: + cmp #$08 ; CPU:$9729 PRG:1729 C9 08 + bcs TestActorRange_OnCarrySet_9731 ; CPU:$972B PRG:172B B0 04 + lda BytecodeHandlerPointerHi ; CPU:$972D PRG:172D A5 1D + cmp #$18 ; CPU:$972F PRG:172F C9 18 +; ----------------------------------------------------------------------------- +; Routine: TestActorRange_OnCarrySet_9731 +; Global: TestActorRange_OnCarrySet_9731.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorRange_OnCarrySet_9731: + rts ; CPU:$9731 PRG:1731 60 +; ----------------------------------------------------------------------------- +; Routine: MoveActorByStep +; Global: MoveActorByStep.; called from $940C, $941E +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByStep: + jsr $96C8 ; CPU:$9732 PRG:1732 20 C8 96 + bcs MoveActorByStep_OnCarrySet_975D ; CPU:$9735 PRG:1735 B0 26 + jsr $9A3F ; CPU:$9737 PRG:1737 20 3F 9A + lda #$FF ; CPU:$973A PRG:173A A9 FF + sta Zp5A,x ; CPU:$973C PRG:173C 95 5A + ldy ActorSlotOffset ; CPU:$973E PRG:173E A4 21 + lda $003A,y ; CPU:$9740 PRG:1740 B9 3A 00 + sec ; CPU:$9743 PRG:1743 38 + sbc $0033,y ; CPU:$9744 PRG:1744 F9 33 00 + clc ; CPU:$9747 PRG:1747 18 + adc #$13 ; CPU:$9748 PRG:1748 69 13 + tay ; CPU:$974A PRG:174A A8 + ldx #$80 ; CPU:$974B PRG:174B A2 80 + lda BytecodeHandlerPointerLo ; CPU:$974D PRG:174D A5 1C + sta Zp51 ; CPU:$974F PRG:174F 85 51 + jsr $A660 ; CPU:$9751 PRG:1751 20 60 A6 + lda #$FB ; CPU:$9754 PRG:1754 A9 FB + ldy #$4E ; CPU:$9756 PRG:1756 A0 4E + jsr $9A2E ; CPU:$9758 PRG:1758 20 2E 9A + sta SoundVolume3,x ; CPU:$975B PRG:175B 95 82 +; ----------------------------------------------------------------------------- +; Routine: MoveActorByStep_OnCarrySet_975D +; Global: MoveActorByStep_OnCarrySet_975D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByStep_OnCarrySet_975D: + rts ; CPU:$975D PRG:175D 60 +; ----------------------------------------------------------------------------- +; Routine: MoveActorByStep_Return_975E +; Global: MoveActorByStep_Return_975E.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByStep_Return_975E: + jsr $96C8 ; CPU:$975E PRG:175E 20 C8 96 + bcc MoveActorByStep_OnCarryClear_9766 ; CPU:$9761 PRG:1761 90 03 + jmp $9AE8 ; CPU:$9763 PRG:1763 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: MoveActorByStep_OnCarryClear_9766 +; Global: MoveActorByStep_OnCarryClear_9766.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByStep_OnCarryClear_9766: + tya ; CPU:$9766 PRG:1766 98 + pha ; CPU:$9767 PRG:1767 48 + lda Zp4F,x ; CPU:$9768 PRG:1768 B5 4F + clc ; CPU:$976A PRG:176A 18 + adc #$02 ; CPU:$976B PRG:176B 69 02 + sta Zp4F,x ; CPU:$976D PRG:176D 95 4F + jsr $9A3F ; CPU:$976F PRG:176F 20 3F 9A + lda #$FF ; CPU:$9772 PRG:1772 A9 FF + sta Zp5A,x ; CPU:$9774 PRG:1774 95 5A + ldy ActorSlotOffset ; CPU:$9776 PRG:1776 A4 21 + lda $003A,y ; CPU:$9778 PRG:1778 B9 3A 00 + sec ; CPU:$977B PRG:177B 38 + sbc $0033,y ; CPU:$977C PRG:177C F9 33 00 + clc ; CPU:$977F PRG:177F 18 + adc #$13 ; CPU:$9780 PRG:1780 69 13 + tay ; CPU:$9782 PRG:1782 A8 + ldx #$80 ; CPU:$9783 PRG:1783 A2 80 + lda BytecodeHandlerPointerLo ; CPU:$9785 PRG:1785 A5 1C + sta Zp51 ; CPU:$9787 PRG:1787 85 51 + jsr $A660 ; CPU:$9789 PRG:1789 20 60 A6 + ldx ActorSlotOffsetHi ; CPU:$978C PRG:178C A6 22 + lda Zp62,x ; CPU:$978E PRG:178E B5 62 + bne MoveActorByStep_OnNonzero_979A ; CPU:$9790 PRG:1790 D0 08 + lda #$E8 ; CPU:$9792 PRG:1792 A9 E8 + sta BytecodeHandlerPointerLo ; CPU:$9794 PRG:1794 85 1C + lda #$B9 ; CPU:$9796 PRG:1796 A9 B9 + bne MoveActorByStep_OnNonzero_97A0 ; CPU:$9798 PRG:1798 D0 06 +; ----------------------------------------------------------------------------- +; Routine: MoveActorByStep_OnNonzero_979A +; Global: MoveActorByStep_OnNonzero_979A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByStep_OnNonzero_979A: + lda #$B8 ; CPU:$979A PRG:179A A9 B8 + sta BytecodeHandlerPointerLo ; CPU:$979C PRG:179C 85 1C + lda #$BA ; CPU:$979E PRG:179E A9 BA +; ----------------------------------------------------------------------------- +; Routine: MoveActorByStep_OnNonzero_97A0 +; Global: MoveActorByStep_OnNonzero_97A0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByStep_OnNonzero_97A0: + sta BytecodeHandlerPointerHi ; CPU:$97A0 PRG:17A0 85 1D + lda #$00 ; CPU:$97A2 PRG:17A2 A9 00 + sta Zp62,x ; CPU:$97A4 PRG:17A4 95 62 + jsr $99E2 ; CPU:$97A6 PRG:17A6 20 E2 99 + jsr $A508 ; CPU:$97A9 PRG:17A9 20 08 A5 + cmp #$01 ; CPU:$97AC PRG:17AC C9 01 + bcc SetActorAnimation62 ; CPU:$97AE PRG:17AE 90 10 + beq SetActorAnimation61 ; CPU:$97B0 PRG:17B0 F0 12 + cmp #$03 ; CPU:$97B2 PRG:17B2 C9 03 + bcc SetActorAnimation63 ; CPU:$97B4 PRG:17B4 90 06 + beq SetActorAnimation62 ; CPU:$97B6 PRG:17B6 F0 08 + cmp #$06 ; CPU:$97B8 PRG:17B8 C9 06 + bcc SetActorAnimation61 ; CPU:$97BA PRG:17BA 90 08 +; ----------------------------------------------------------------------------- +; Routine: SetActorAnimation63 +; Global: SetActorAnimation63.; called from $98AD +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorAnimation63: + ldy #$63 ; CPU:$97BC PRG:17BC A0 63 + bne SetActorAnimation61_OnNonzero_97C6 ; CPU:$97BE PRG:17BE D0 06 +; ----------------------------------------------------------------------------- +; Routine: SetActorAnimation62 +; Global: SetActorAnimation62.; called from $98AA +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorAnimation62: + ldy #$62 ; CPU:$97C0 PRG:17C0 A0 62 + bne SetActorAnimation61_OnNonzero_97C6 ; CPU:$97C2 PRG:17C2 D0 02 +; ----------------------------------------------------------------------------- +; Routine: SetActorAnimation61 +; Global: SetActorAnimation61.; called from $98A7 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorAnimation61: + ldy #$61 ; CPU:$97C4 PRG:17C4 A0 61 +; ----------------------------------------------------------------------------- +; Routine: SetActorAnimation61_OnNonzero_97C6 +; Global: SetActorAnimation61_OnNonzero_97C6.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorAnimation61_OnNonzero_97C6: + lda #$F3 ; CPU:$97C6 PRG:17C6 A9 F3 + jsr $9A2E ; CPU:$97C8 PRG:17C8 20 2E 9A + sta SoundVolume3,x ; CPU:$97CB PRG:17CB 95 82 + jsr $97D5 ; CPU:$97CD PRG:17CD 20 D5 97 + pla ; CPU:$97D0 PRG:17D0 68 + tay ; CPU:$97D1 PRG:17D1 A8 + jmp $9AE8 ; CPU:$97D2 PRG:17D2 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: UpdateActorAnimation +; Global: UpdateActorAnimation.; called from $9622, $97CD, $9942 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorAnimation: + lda $032B,x ; CPU:$97D5 PRG:17D5 BD 2B 03 + beq UpdateActorAnimation_OnZero_97FB ; CPU:$97D8 PRG:17D8 F0 21 + txa ; CPU:$97DA PRG:17DA 8A + pha ; CPU:$97DB PRG:17DB 48 + jsr $A8D1 ; CPU:$97DC PRG:17DC 20 D1 A8 + and #$1F ; CPU:$97DF PRG:17DF 29 1F + adc #$1E ; CPU:$97E1 PRG:17E1 69 1E + tay ; CPU:$97E3 PRG:17E3 A8 + pla ; CPU:$97E4 PRG:17E4 68 + tax ; CPU:$97E5 PRG:17E5 AA + sty PlayerFlashTimer,x ; CPU:$97E6 PRG:17E6 94 8B + lda ControllerButtons1,x ; CPU:$97E8 PRG:17E8 B5 FA + and #$F0 ; CPU:$97EA PRG:17EA 29 F0 + sta ControllerButtons1,x ; CPU:$97EC PRG:17EC 95 FA + lda FrameCounterLo ; CPU:$97EE PRG:17EE A5 24 + and #$01 ; CPU:$97F0 PRG:17F0 29 01 + clc ; CPU:$97F2 PRG:17F2 18 + adc #$01 ; CPU:$97F3 PRG:17F3 69 01 + asl a ; CPU:$97F5 PRG:17F5 0A + asl a ; CPU:$97F6 PRG:17F6 0A + ora ControllerButtons1,x ; CPU:$97F7 PRG:17F7 15 FA + sta ControllerButtons1,x ; CPU:$97F9 PRG:17F9 95 FA +; ----------------------------------------------------------------------------- +; Routine: UpdateActorAnimation_OnZero_97FB +; Global: UpdateActorAnimation_OnZero_97FB.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorAnimation_OnZero_97FB: + rts ; CPU:$97FB PRG:17FB 60 +; ----------------------------------------------------------------------------- +; Routine: TestAnimationSlot +; Global: TestAnimationSlot.; called from $986A +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestAnimationSlot: + lda ScriptFlagsHi ; CPU:$97FC PRG:17FC A5 4E + bne TestAnimationSlot_OnNonzero_9802 ; CPU:$97FE PRG:17FE D0 02 +; ----------------------------------------------------------------------------- +; Routine: TestAnimationSlot_JoinBranchPaths_9800 +; Global: TestAnimationSlot_JoinBranchPaths_9800.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestAnimationSlot_JoinBranchPaths_9800: + sec ; CPU:$9800 PRG:1800 38 + rts ; CPU:$9801 PRG:1801 60 +; ----------------------------------------------------------------------------- +; Routine: TestAnimationSlot_OnNonzero_9802 +; Global: TestAnimationSlot_OnNonzero_9802.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestAnimationSlot_OnNonzero_9802: + ldx ActorIndex ; CPU:$9802 PRG:1802 A6 1E + bne ComputeActorLeftEdgeAt_OnNonzero_9834 ; CPU:$9804 PRG:1804 D0 2E + lda ControllerDPad1 ; CPU:$9806 PRG:1806 A5 F6 + ror a ; CPU:$9808 PRG:1808 6A + bcc ComputeActorLeftEdgeAt_OnCarryClear_984A ; CPU:$9809 PRG:1809 90 3F + lda ControllerDPad2 ; CPU:$980B PRG:180B A5 F7 + ror a ; CPU:$980D PRG:180D 6A + bcs TestAnimationSlot_JoinBranchPaths_9800 ; CPU:$980E PRG:180E B0 F0 + lda Zp3B ; CPU:$9810 PRG:1810 A5 3B + asl a ; CPU:$9812 PRG:1812 0A + lda PlayerPosYLo1 ; CPU:$9813 PRG:1813 A5 3C + rol a ; CPU:$9815 PRG:1815 2A + clc ; CPU:$9816 PRG:1816 18 + adc #$08 ; CPU:$9817 PRG:1817 69 08 + jmp $982A ; CPU:$9819 PRG:1819 4C 2A 98 +; ----------------------------------------------------------------------------- +; Routine: TestAnimationSlot_OnCarryClear_981C +; Global: TestAnimationSlot_OnCarryClear_981C.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestAnimationSlot_OnCarryClear_981C: + lda ControllerDPad1 ; CPU:$981C PRG:181C A5 F6 + ror a ; CPU:$981E PRG:181E 6A + bcc TestAnimationSlot_JoinBranchPaths_9800 ; CPU:$981F PRG:181F 90 DF + lda Zp3F ; CPU:$9821 PRG:1821 A5 3F + asl a ; CPU:$9823 PRG:1823 0A + lda PlayerPosYLo2 ; CPU:$9824 PRG:1824 A5 40 + rol a ; CPU:$9826 PRG:1826 2A + sec ; CPU:$9827 PRG:1827 38 + sbc #$10 ; CPU:$9828 PRG:1828 E9 10 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorLeftEdgeAt +; Global: ComputeActorLeftEdgeAt.; called from $9819 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorLeftEdgeAt: + sta BytecodeHandlerPointerLo ; CPU:$982A PRG:182A 85 1C + lda PlayerPosYLo2 ; CPU:$982C PRG:182C A5 40 + sec ; CPU:$982E PRG:182E 38 + sbc PlayerPosYLo1 ; CPU:$982F PRG:182F E5 3C + jmp $985F ; CPU:$9831 PRG:1831 4C 5F 98 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorLeftEdgeAt_OnNonzero_9834 +; Global: ComputeActorLeftEdgeAt_OnNonzero_9834.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorLeftEdgeAt_OnNonzero_9834: + lda ControllerDPad2 ; CPU:$9834 PRG:1834 A5 F7 + ror a ; CPU:$9836 PRG:1836 6A + bcc TestAnimationSlot_OnCarryClear_981C ; CPU:$9837 PRG:1837 90 E3 + lda ControllerDPad1 ; CPU:$9839 PRG:1839 A5 F6 + ror a ; CPU:$983B PRG:183B 6A + bcs TestAnimationSlot_JoinBranchPaths_9800 ; CPU:$983C PRG:183C B0 C2 + lda Zp3F ; CPU:$983E PRG:183E A5 3F + asl a ; CPU:$9840 PRG:1840 0A + lda PlayerPosYLo2 ; CPU:$9841 PRG:1841 A5 40 + rol a ; CPU:$9843 PRG:1843 2A + clc ; CPU:$9844 PRG:1844 18 + adc #$08 ; CPU:$9845 PRG:1845 69 08 + jmp $9858 ; CPU:$9847 PRG:1847 4C 58 98 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorLeftEdgeAt_OnCarryClear_984A +; Global: ComputeActorLeftEdgeAt_OnCarryClear_984A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorLeftEdgeAt_OnCarryClear_984A: + lda ControllerDPad2 ; CPU:$984A PRG:184A A5 F7 + ror a ; CPU:$984C PRG:184C 6A + bcc TestAnimationSlot_JoinBranchPaths_9800 ; CPU:$984D PRG:184D 90 B1 + lda Zp3B ; CPU:$984F PRG:184F A5 3B + asl a ; CPU:$9851 PRG:1851 0A + lda PlayerPosYLo1 ; CPU:$9852 PRG:1852 A5 3C + rol a ; CPU:$9854 PRG:1854 2A + sec ; CPU:$9855 PRG:1855 38 + sbc #$10 ; CPU:$9856 PRG:1856 E9 10 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorRightEdgeAt +; Global: ComputeActorRightEdgeAt.; called from $9847 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorRightEdgeAt: + sta BytecodeHandlerPointerLo ; CPU:$9858 PRG:1858 85 1C + lda PlayerPosYLo1 ; CPU:$985A PRG:185A A5 3C + sec ; CPU:$985C PRG:185C 38 + sbc PlayerPosYLo2 ; CPU:$985D PRG:185D E5 40 +; ----------------------------------------------------------------------------- +; Routine: TestActorValue +; Global: TestActorValue.; called from $9831 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorValue: + cmp #$0D ; CPU:$985F PRG:185F C9 0D + bcs TestAnimationSlot_JoinBranchPaths_9800 ; CPU:$9861 PRG:1861 B0 9D + lda Zp33 ; CPU:$9863 PRG:1863 A5 33 + adc Zp37 ; CPU:$9865 PRG:1865 65 37 + cmp #$0C ; CPU:$9867 PRG:1867 C9 0C + rts ; CPU:$9869 PRG:1869 60 +; ----------------------------------------------------------------------------- +; Routine: TestActorValue_Return_986A +; Global: TestActorValue_Return_986A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorValue_Return_986A: + jsr $97FC ; CPU:$986A PRG:186A 20 FC 97 + bcc TestActorValue_OnCarryClear_9875 ; CPU:$986D PRG:186D 90 06 + jsr $A4DF ; CPU:$986F PRG:186F 20 DF A4 + jmp $9AE8 ; CPU:$9872 PRG:1872 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: TestActorValue_OnCarryClear_9875 +; Global: TestActorValue_OnCarryClear_9875.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorValue_OnCarryClear_9875: + tya ; CPU:$9875 PRG:1875 98 + pha ; CPU:$9876 PRG:1876 48 + ldy ActorSlotOffset ; CPU:$9877 PRG:1877 A4 21 + lda $003A,y ; CPU:$9879 PRG:1879 B9 3A 00 + clc ; CPU:$987C PRG:187C 18 + adc #$0C ; CPU:$987D PRG:187D 69 0C + tay ; CPU:$987F PRG:187F A8 + ldx #$80 ; CPU:$9880 PRG:1880 A2 80 + lda BytecodeHandlerPointerLo ; CPU:$9882 PRG:1882 A5 1C + sta Zp51 ; CPU:$9884 PRG:1884 85 51 + jsr $A660 ; CPU:$9886 PRG:1886 20 60 A6 + lda #$E0 ; CPU:$9889 PRG:1889 A9 E0 + sta BytecodeHandlerPointerLo ; CPU:$988B PRG:188B 85 1C + lda #$B9 ; CPU:$988D PRG:188D A9 B9 + sta BytecodeHandlerPointerHi ; CPU:$988F PRG:188F 85 1D + jsr $99E2 ; CPU:$9891 PRG:1891 20 E2 99 + jsr $A508 ; CPU:$9894 PRG:1894 20 08 A5 + cmp #$01 ; CPU:$9897 PRG:1897 C9 01 + bcc TestActorValue_JoinBranchPaths_98AA ; CPU:$9899 PRG:1899 90 0F + beq TestActorValue_JoinBranchPaths_98AD ; CPU:$989B PRG:189B F0 10 + cmp #$03 ; CPU:$989D PRG:189D C9 03 + bcc TestActorValue_OnCarryClear_98A7 ; CPU:$989F PRG:189F 90 06 + beq TestActorValue_JoinBranchPaths_98AA ; CPU:$98A1 PRG:18A1 F0 07 + cmp #$06 ; CPU:$98A3 PRG:18A3 C9 06 + bcc TestActorValue_JoinBranchPaths_98AD ; CPU:$98A5 PRG:18A5 90 06 +; ----------------------------------------------------------------------------- +; Routine: TestActorValue_OnCarryClear_98A7 +; Global: TestActorValue_OnCarryClear_98A7.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorValue_OnCarryClear_98A7: + jmp $97C4 ; CPU:$98A7 PRG:18A7 4C C4 97 +; ----------------------------------------------------------------------------- +; Routine: TestActorValue_JoinBranchPaths_98AA +; Global: TestActorValue_JoinBranchPaths_98AA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorValue_JoinBranchPaths_98AA: + jmp $97C0 ; CPU:$98AA PRG:18AA 4C C0 97 +; ----------------------------------------------------------------------------- +; Routine: TestActorValue_JoinBranchPaths_98AD +; Global: TestActorValue_JoinBranchPaths_98AD.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorValue_JoinBranchPaths_98AD: + jmp $97BC ; CPU:$98AD PRG:18AD 4C BC 97 +; ----------------------------------------------------------------------------- +; Routine: TestActorValue_JumpNext_98B0 +; Global: TestActorValue_JumpNext_98B0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorValue_JumpNext_98B0: + dec Zp7A,x ; CPU:$98B0 PRG:18B0 D6 7A + bne TestActorValue_OnNonzero_98B7 ; CPU:$98B2 PRG:18B2 D0 03 + jmp $9AE8 ; CPU:$98B4 PRG:18B4 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: TestActorValue_OnNonzero_98B7 +; Global: TestActorValue_OnNonzero_98B7.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorValue_OnNonzero_98B7: + jsr $94C7 ; CPU:$98B7 PRG:18B7 20 C7 94 + lda ScriptFlagsHi ; CPU:$98BA PRG:18BA A5 4E + bne TestActorValue_OnNonzero_98C1 ; CPU:$98BC PRG:18BC D0 03 +; ----------------------------------------------------------------------------- +; Routine: TestActorValue_JoinBranchPaths_98BE +; Global: TestActorValue_JoinBranchPaths_98BE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorValue_JoinBranchPaths_98BE: + jmp $9B25 ; CPU:$98BE PRG:18BE 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: TestActorValue_OnNonzero_98C1 +; Global: TestActorValue_OnNonzero_98C1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorValue_OnNonzero_98C1: + ldx ActorIndex ; CPU:$98C1 PRG:18C1 A6 1E + bne ComputeActorLeftEdgeAlt2_OnNonzero_98F0 ; CPU:$98C3 PRG:18C3 D0 2B + lda ControllerDPad1 ; CPU:$98C5 PRG:18C5 A5 F6 + ror a ; CPU:$98C7 PRG:18C7 6A + bcc ComputeActorLeftEdgeAlt2_OnCarryClear_9903 ; CPU:$98C8 PRG:18C8 90 39 + lda ControllerDPad2 ; CPU:$98CA PRG:18CA A5 F7 + ror a ; CPU:$98CC PRG:18CC 6A + bcs TestActorValue_JoinBranchPaths_98BE ; CPU:$98CD PRG:18CD B0 EF + lda Zp3B ; CPU:$98CF PRG:18CF A5 3B + asl a ; CPU:$98D1 PRG:18D1 0A + lda PlayerPosYLo1 ; CPU:$98D2 PRG:18D2 A5 3C + rol a ; CPU:$98D4 PRG:18D4 2A + jmp $98E6 ; CPU:$98D5 PRG:18D5 4C E6 98 +; ----------------------------------------------------------------------------- +; Routine: TestActorValue_OnCarryClear_98D8 +; Global: TestActorValue_OnCarryClear_98D8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestActorValue_OnCarryClear_98D8: + lda ControllerDPad1 ; CPU:$98D8 PRG:18D8 A5 F6 + ror a ; CPU:$98DA PRG:18DA 6A + bcc TestActorValue_JoinBranchPaths_98BE ; CPU:$98DB PRG:18DB 90 E1 + lda Zp3F ; CPU:$98DD PRG:18DD A5 3F + asl a ; CPU:$98DF PRG:18DF 0A + lda PlayerPosYLo2 ; CPU:$98E0 PRG:18E0 A5 40 + rol a ; CPU:$98E2 PRG:18E2 2A + sec ; CPU:$98E3 PRG:18E3 38 + sbc #$08 ; CPU:$98E4 PRG:18E4 E9 08 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorLeftEdgeAlt2 +; Global: ComputeActorLeftEdgeAlt2.; called from $98D5 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorLeftEdgeAlt2: + sta BytecodeHandlerPointerLo ; CPU:$98E6 PRG:18E6 85 1C + lda PlayerPosYLo2 ; CPU:$98E8 PRG:18E8 A5 40 + sec ; CPU:$98EA PRG:18EA 38 + sbc PlayerPosYLo1 ; CPU:$98EB PRG:18EB E5 3C + jmp $9918 ; CPU:$98ED PRG:18ED 4C 18 99 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorLeftEdgeAlt2_OnNonzero_98F0 +; Global: ComputeActorLeftEdgeAlt2_OnNonzero_98F0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorLeftEdgeAlt2_OnNonzero_98F0: + lda ControllerDPad2 ; CPU:$98F0 PRG:18F0 A5 F7 + ror a ; CPU:$98F2 PRG:18F2 6A + bcc TestActorValue_OnCarryClear_98D8 ; CPU:$98F3 PRG:18F3 90 E3 + lda ControllerDPad1 ; CPU:$98F5 PRG:18F5 A5 F6 + ror a ; CPU:$98F7 PRG:18F7 6A + bcs UpdateActorTileFromIndexAlt_JoinBranchPaths_9948 ; CPU:$98F8 PRG:18F8 B0 4E + lda Zp3F ; CPU:$98FA PRG:18FA A5 3F + asl a ; CPU:$98FC PRG:18FC 0A + lda PlayerPosYLo2 ; CPU:$98FD PRG:18FD A5 40 + rol a ; CPU:$98FF PRG:18FF 2A + jmp $9911 ; CPU:$9900 PRG:1900 4C 11 99 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorLeftEdgeAlt2_OnCarryClear_9903 +; Global: ComputeActorLeftEdgeAlt2_OnCarryClear_9903.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorLeftEdgeAlt2_OnCarryClear_9903: + lda ControllerDPad2 ; CPU:$9903 PRG:1903 A5 F7 + ror a ; CPU:$9905 PRG:1905 6A + bcc UpdateActorTileFromIndexAlt_JoinBranchPaths_9948 ; CPU:$9906 PRG:1906 90 40 + lda Zp3B ; CPU:$9908 PRG:1908 A5 3B + asl a ; CPU:$990A PRG:190A 0A + lda PlayerPosYLo1 ; CPU:$990B PRG:190B A5 3C + rol a ; CPU:$990D PRG:190D 2A + sec ; CPU:$990E PRG:190E 38 + sbc #$08 ; CPU:$990F PRG:190F E9 08 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileFromIndex +; Global: UpdateActorTileFromIndex.; called from $9900 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileFromIndex: + sta BytecodeHandlerPointerLo ; CPU:$9911 PRG:1911 85 1C + lda PlayerPosYLo1 ; CPU:$9913 PRG:1913 A5 3C + sec ; CPU:$9915 PRG:1915 38 + sbc PlayerPosYLo2 ; CPU:$9916 PRG:1916 E5 40 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileFromIndexAlt +; Global: UpdateActorTileFromIndexAlt.; called from $98ED +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileFromIndexAlt: + cmp #$09 ; CPU:$9918 PRG:1918 C9 09 + bcs UpdateActorTileFromIndexAlt_JoinBranchPaths_9948 ; CPU:$991A PRG:191A B0 2C + ldy ActorSlotOffset ; CPU:$991C PRG:191C A4 21 + lda $003A,y ; CPU:$991E PRG:191E B9 3A 00 + clc ; CPU:$9921 PRG:1921 18 + adc #$0C ; CPU:$9922 PRG:1922 69 0C + tay ; CPU:$9924 PRG:1924 A8 + ldx #$80 ; CPU:$9925 PRG:1925 A2 80 + lda BytecodeHandlerPointerLo ; CPU:$9927 PRG:1927 A5 1C + sta Zp51 ; CPU:$9929 PRG:1929 85 51 + jsr $A660 ; CPU:$992B PRG:192B 20 60 A6 + lda #$80 ; CPU:$992E PRG:192E A9 80 + sta BytecodeHandlerPointerLo ; CPU:$9930 PRG:1930 85 1C + lda #$BB ; CPU:$9932 PRG:1932 A9 BB + sta BytecodeHandlerPointerHi ; CPU:$9934 PRG:1934 85 1D + jsr $99E2 ; CPU:$9936 PRG:1936 20 E2 99 + lda #$F9 ; CPU:$9939 PRG:1939 A9 F9 + ldy #$62 ; CPU:$993B PRG:193B A0 62 + jsr $9A2E ; CPU:$993D PRG:193D 20 2E 9A + sta Zp62,x ; CPU:$9940 PRG:1940 95 62 + jsr $97D5 ; CPU:$9942 PRG:1942 20 D5 97 + jmp $94FE ; CPU:$9945 PRG:1945 4C FE 94 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileFromIndexAlt_JoinBranchPaths_9948 +; Global: UpdateActorTileFromIndexAlt_JoinBranchPaths_9948.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileFromIndexAlt_JoinBranchPaths_9948: + jmp $9B25 ; CPU:$9948 PRG:1948 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileFromIndexAlt_JumpNext_994B +; Global: UpdateActorTileFromIndexAlt_JumpNext_994B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileFromIndexAlt_JumpNext_994B: + tya ; CPU:$994B PRG:194B 98 + pha ; CPU:$994C PRG:194C 48 + ldy ActorSlotOffset ; CPU:$994D PRG:194D A4 21 + lda $0039,y ; CPU:$994F PRG:194F B9 39 00 + sta BytecodeHandlerPointerLo ; CPU:$9952 PRG:1952 85 1C + lda $003A,y ; CPU:$9954 PRG:1954 B9 3A 00 + sta BytecodeHandlerPointerHi ; CPU:$9957 PRG:1957 85 1D + jsr $A4FF ; CPU:$9959 PRG:1959 20 FF A4 + lda BytecodeHandlerPointerLo ; CPU:$995C PRG:195C A5 1C + sta $0039,y ; CPU:$995E PRG:195E 99 39 00 + ldx BytecodeHandlerPointerHi ; CPU:$9961 PRG:1961 A6 1D + dex ; CPU:$9963 PRG:1963 CA + stx PlayerPosXLo1,y ; CPU:$9964 PRG:1964 96 3A + jsr $A4F2 ; CPU:$9966 PRG:1966 20 F2 A4 + pla ; CPU:$9969 PRG:1969 68 + tay ; CPU:$996A PRG:196A A8 + jmp $9AE8 ; CPU:$996B PRG:196B 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileFromIndexAlt_JumpNext_996E +; Global: UpdateActorTileFromIndexAlt_JumpNext_996E.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileFromIndexAlt_JumpNext_996E: + lda Zp4F,x ; CPU:$996E PRG:196E B5 4F + sec ; CPU:$9970 PRG:1970 38 + sbc #$0A ; CPU:$9971 PRG:1971 E9 0A + sta Zp4F,x ; CPU:$9973 PRG:1973 95 4F + lda #$D0 ; CPU:$9975 PRG:1975 A9 D0 + sta PlayerActionState,x ; CPU:$9977 PRG:1977 95 F0 + jmp $9AE8 ; CPU:$9979 PRG:1979 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileFromIndexAlt_JumpNext_997C +; Global: UpdateActorTileFromIndexAlt_JumpNext_997C.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileFromIndexAlt_JumpNext_997C: + lda FrameCounterLo ; CPU:$997C PRG:197C A5 24 + and #$07 ; CPU:$997E PRG:197E 29 07 + bne UpdateActorTileFromIndexAlt_OnNonzero_9989 ; CPU:$9980 PRG:1980 D0 07 + lda Zp4F,x ; CPU:$9982 PRG:1982 B5 4F + sec ; CPU:$9984 PRG:1984 38 + sbc #$01 ; CPU:$9985 PRG:1985 E9 01 + sta Zp4F,x ; CPU:$9987 PRG:1987 95 4F +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileFromIndexAlt_OnNonzero_9989 +; Global: UpdateActorTileFromIndexAlt_OnNonzero_9989.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileFromIndexAlt_OnNonzero_9989: + jsr $A4FF ; CPU:$9989 PRG:1989 20 FF A4 + lda PlayerActionState,x ; CPU:$998C PRG:198C B5 F0 + bne UpdateActorTileFromIndexAlt_OnNonzero_9994 ; CPU:$998E PRG:198E D0 04 + lda #$80 ; CPU:$9990 PRG:1990 A9 80 + sta PlayerActionState,x ; CPU:$9992 PRG:1992 95 F0 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileFromIndexAlt_OnNonzero_9994 +; Global: UpdateActorTileFromIndexAlt_OnNonzero_9994.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileFromIndexAlt_OnNonzero_9994: + jsr $A4FF ; CPU:$9994 PRG:1994 20 FF A4 + lda SoundChannelStep2 ; CPU:$9997 PRG:1997 A5 D1 + cmp #$FF ; CPU:$9999 PRG:1999 C9 FF + bne UpdateActorTileFromIndexAlt_OnNonzero_99A0 ; CPU:$999B PRG:199B D0 03 + jsr $99A3 ; CPU:$999D PRG:199D 20 A3 99 +; ----------------------------------------------------------------------------- +; Routine: UpdateActorTileFromIndexAlt_OnNonzero_99A0 +; Global: UpdateActorTileFromIndexAlt_OnNonzero_99A0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorTileFromIndexAlt_OnNonzero_99A0: + jmp $94B1 ; CPU:$99A0 PRG:19A0 4C B1 94 +; ----------------------------------------------------------------------------- +; Routine: SetSoundSequenceChannel2 +; Global: SetSoundSequenceChannel2.; called from $999D, $9E21 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetSoundSequenceChannel2: + lda #$DA ; CPU:$99A3 PRG:19A3 A9 DA + sta SoundSequencePtrLo2 ; CPU:$99A5 PRG:19A5 85 D5 + lda #$B1 ; CPU:$99A7 PRG:19A7 A9 B1 + sta SoundSequencePtrHi2 ; CPU:$99A9 PRG:19A9 85 D9 + lda #$00 ; CPU:$99AB PRG:19AB A9 00 + sta SoundChannelStep2 ; CPU:$99AD PRG:19AD 85 D1 + rts ; CPU:$99AF PRG:19AF 60 +; ----------------------------------------------------------------------------- +; Routine: SetSoundSequenceChannel2_Return_99B0 +; Global: SetSoundSequenceChannel2_Return_99B0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetSoundSequenceChannel2_Return_99B0: + lda #$12 ; CPU:$99B0 PRG:19B0 A9 12 + sta Zp4B,x ; CPU:$99B2 PRG:19B2 95 4B + jmp $9AE8 ; CPU:$99B4 PRG:19B4 4C E8 9A +; ----------------------------------------------------------------------------- +; Routine: SetSoundSequenceChannel2_JumpNext_99B7 +; Global: SetSoundSequenceChannel2_JumpNext_99B7.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetSoundSequenceChannel2_JumpNext_99B7: + jsr $94C7 ; CPU:$99B7 PRG:19B7 20 C7 94 + lda #$01 ; CPU:$99BA PRG:19BA A9 01 + jsr $9653 ; CPU:$99BC PRG:19BC 20 53 96 + dec Zp4B,x ; CPU:$99BF PRG:19BF D6 4B + lda Zp4B,x ; CPU:$99C1 PRG:19C1 B5 4B + rol a ; CPU:$99C3 PRG:19C3 2A + php ; CPU:$99C4 PRG:19C4 08 + ror a ; CPU:$99C5 PRG:19C5 6A + plp ; CPU:$99C6 PRG:19C6 28 + php ; CPU:$99C7 PRG:19C7 08 + ror a ; CPU:$99C8 PRG:19C8 6A + plp ; CPU:$99C9 PRG:19C9 28 + ror a ; CPU:$99CA PRG:19CA 6A + clc ; CPU:$99CB PRG:19CB 18 + adc $0033,y ; CPU:$99CC PRG:19CC 79 33 00 + sta $0033,y ; CPU:$99CF PRG:19CF 99 33 00 + bmi SetSoundSequenceChannel2_OnNegative_99D7 ; CPU:$99D2 PRG:19D2 30 03 + jmp $9B25 ; CPU:$99D4 PRG:19D4 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: SetSoundSequenceChannel2_OnNegative_99D7 +; Global: SetSoundSequenceChannel2_OnNegative_99D7.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetSoundSequenceChannel2_OnNegative_99D7: + lda #$FF ; CPU:$99D7 PRG:19D7 A9 FF + sta SoundVolume3,x ; CPU:$99D9 PRG:19D9 95 82 + lda #$30 ; CPU:$99DB PRG:19DB A9 30 + sta SoundVolume1,x ; CPU:$99DD PRG:19DD 95 80 + jmp $94CF ; CPU:$99DF PRG:19DF 4C CF 94 +; ----------------------------------------------------------------------------- +; Routine: LookupActorTileId +; Global: LookupActorTileId.; called from $9614, $97A6, $9891, $9936 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LookupActorTileId: + lda ActorIndex ; CPU:$99E2 PRG:19E2 A5 1E +; ----------------------------------------------------------------------------- +; Routine: LookupActorTileIdAlt +; Global: LookupActorTileIdAlt.; called from $94A5, $957F +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LookupActorTileIdAlt: + tay ; CPU:$99E4 PRG:19E4 A8 + ldx PlayerPaletteIndex,y ; CPU:$99E5 PRG:19E5 B6 2A + ldy PlayerSpriteIndex1,x ; CPU:$99E7 PRG:19E7 B4 26 + eor #$01 ; CPU:$99E9 PRG:19E9 49 01 + tax ; CPU:$99EB PRG:19EB AA + lda Zp4F,x ; CPU:$99EC PRG:19EC B5 4F + sec ; CPU:$99EE PRG:19EE 38 + sbc (BytecodeHandlerPointerLo),y ; CPU:$99EF PRG:19EF F1 1C + sta Zp4F,x ; CPU:$99F1 PRG:19F1 95 4F + txa ; CPU:$99F3 PRG:19F3 8A + eor #$01 ; CPU:$99F4 PRG:19F4 49 01 + tax ; CPU:$99F6 PRG:19F6 AA + lda Zp4F,x ; CPU:$99F7 PRG:19F7 B5 4F + clc ; CPU:$99F9 PRG:19F9 18 + adc (BytecodeHandlerPointerLo),y ; CPU:$99FA PRG:19FA 71 1C + cmp #$64 ; CPU:$99FC PRG:19FC C9 64 + bcc LookupActorTileIdAlt_OnCarryClear_9A02 ; CPU:$99FE PRG:19FE 90 02 + lda #$63 ; CPU:$9A00 PRG:1A00 A9 63 +; ----------------------------------------------------------------------------- +; Routine: LookupActorTileIdAlt_OnCarryClear_9A02 +; Global: LookupActorTileIdAlt_OnCarryClear_9A02.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LookupActorTileIdAlt_OnCarryClear_9A02: + sta Zp4F,x ; CPU:$9A02 PRG:1A02 95 4F + lda Zp19 ; CPU:$9A04 PRG:1A04 A5 19 + pha ; CPU:$9A06 PRG:1A06 48 + lda #$00 ; CPU:$9A07 PRG:1A07 A9 00 + sta Zp18 ; CPU:$9A09 PRG:1A09 85 18 + lda (BytecodeHandlerPointerLo),y ; CPU:$9A0B PRG:1A0B B1 1C + sta Zp19 ; CPU:$9A0D PRG:1A0D 85 19 + lsr Zp19 ; CPU:$9A0F PRG:1A0F 46 19 + ror Zp18 ; CPU:$9A11 PRG:1A11 66 18 + lsr Zp19 ; CPU:$9A13 PRG:1A13 46 19 + ror Zp18 ; CPU:$9A15 PRG:1A15 66 18 + txa ; CPU:$9A17 PRG:1A17 8A + tay ; CPU:$9A18 PRG:1A18 A8 + cpy #$00 ; CPU:$9A19 PRG:1A19 C0 00 + jsr $8598 ; CPU:$9A1B PRG:1A1B 20 98 85 + pla ; CPU:$9A1E PRG:1A1E 68 + sta Zp19 ; CPU:$9A1F PRG:1A1F 85 19 + ldy ActorSlotOffset ; CPU:$9A21 PRG:1A21 A4 21 + rts ; CPU:$9A23 PRG:1A23 60 +; ----------------------------------------------------------------------------- +; Routine: StoreActorCoordinates +; Global: StoreActorCoordinates.; called from $93B7, $93E2, $945F, $94EA, $9539, $95F9, $96B3, $9E28 and 3 more +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorCoordinates: + ldx ActorSlotOffset ; CPU:$9A24 PRG:1A24 A6 21 + sty ActorPosXLo,x ; CPU:$9A26 PRG:1A26 94 34 + ldx ActorIndex ; CPU:$9A28 PRG:1A28 A6 1E + ldy ActorSlotOffset ; CPU:$9A2A PRG:1A2A A4 21 + bpl StoreActorCoordinatesAlt_OnNonnegative_9A36 ; CPU:$9A2C PRG:1A2C 10 08 +; ----------------------------------------------------------------------------- +; Routine: StoreActorCoordinatesAlt +; Global: StoreActorCoordinatesAlt.; called from $92AC, $93BE, $93E9, $961B, $9758, $97C8, $993D, $A46F +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorCoordinatesAlt: + ldx ActorFieldOffset ; CPU:$9A2E PRG:1A2E A6 23 + sty ActorPosXLo,x ; CPU:$9A30 PRG:1A30 94 34 + ldx ActorSlotOffsetHi ; CPU:$9A32 PRG:1A32 A6 22 + ldy ActorFieldOffset ; CPU:$9A34 PRG:1A34 A4 23 +; ----------------------------------------------------------------------------- +; Routine: StoreActorCoordinatesAlt_OnNonnegative_9A36 +; Global: StoreActorCoordinatesAlt_OnNonnegative_9A36.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorCoordinatesAlt_OnNonnegative_9A36: + sta PlayerActionState,x ; CPU:$9A36 PRG:1A36 95 F0 + lda #$00 ; CPU:$9A38 PRG:1A38 A9 00 + sta ScriptFlagsLo ; CPU:$9A3A PRG:1A3A 85 4D + sta ScriptFlags,x ; CPU:$9A3C PRG:1A3C 95 41 + rts ; CPU:$9A3E PRG:1A3E 60 +; ----------------------------------------------------------------------------- +; Routine: FlipActorFacing +; Global: FlipActorFacing.; called from $93B0, $93DB, $95F2, $9737, $976F +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FlipActorFacing: + ldx ActorIndex ; CPU:$9A3F PRG:1A3F A6 1E + lda ControllerDPad1,x ; CPU:$9A41 PRG:1A41 B5 F6 + eor #$03 ; CPU:$9A43 PRG:1A43 49 03 + ldx ActorSlotOffsetHi ; CPU:$9A45 PRG:1A45 A6 22 + sta ControllerDPad1,x ; CPU:$9A47 PRG:1A47 95 F6 + sta ControllerFaceButtons1,x ; CPU:$9A49 PRG:1A49 95 F8 + ldx ActorIndex ; CPU:$9A4B PRG:1A4B A6 1E + rts ; CPU:$9A4D PRG:1A4D 60 +; ----------------------------------------------------------------------------- +; Routine: SpawnActorPair +; Global: SpawnActorPair.; called from $87A4 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnActorPair: + lda #$00 ; CPU:$9A4E PRG:1A4E A9 00 + sta $034C ; CPU:$9A50 PRG:1A50 8D 4C 03 + lda #$04 ; CPU:$9A53 PRG:1A53 A9 04 + sta $034D ; CPU:$9A55 PRG:1A55 8D 4D 03 + lda #$70 ; CPU:$9A58 PRG:1A58 A9 70 + sta $034E ; CPU:$9A5A PRG:1A5A 8D 4E 03 + lda #$B9 ; CPU:$9A5D PRG:1A5D A9 B9 + sta $034F ; CPU:$9A5F PRG:1A5F 8D 4F 03 + lda #$01 ; CPU:$9A62 PRG:1A62 A9 01 + sta ActorIndex ; CPU:$9A64 PRG:1A64 85 1E + jsr $9A6B ; CPU:$9A66 PRG:1A66 20 6B 9A + dec ActorIndex ; CPU:$9A69 PRG:1A69 C6 1E +; ----------------------------------------------------------------------------- +; Routine: SpawnActorPairAlt +; Global: SpawnActorPairAlt.; called from $9A66 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnActorPairAlt: + ldx ActorIndex ; CPU:$9A6B PRG:1A6B A6 1E + lda #$00 ; CPU:$9A6D PRG:1A6D A9 00 + sta Zp5E,x ; CPU:$9A6F PRG:1A6F 95 5E + txa ; CPU:$9A71 PRG:1A71 8A + asl a ; CPU:$9A72 PRG:1A72 0A + asl a ; CPU:$9A73 PRG:1A73 0A + sta ActorSlotOffset ; CPU:$9A74 PRG:1A74 85 21 + tay ; CPU:$9A76 PRG:1A76 A8 + jsr $A4FF ; CPU:$9A77 PRG:1A77 20 FF A4 + stx ActorSlotOffsetHi ; CPU:$9A7A PRG:1A7A 86 22 + sty ActorFieldOffset ; CPU:$9A7C PRG:1A7C 84 23 + lda PlayerPosXLo2 ; CPU:$9A7E PRG:1A7E A5 3E + cmp PlayerPosXLo1 ; CPU:$9A80 PRG:1A80 C5 3A + lda #$00 ; CPU:$9A82 PRG:1A82 A9 00 + rol a ; CPU:$9A84 PRG:1A84 2A + eor ActorIndex ; CPU:$9A85 PRG:1A85 45 1E + ror a ; CPU:$9A87 PRG:1A87 6A + ror a ; CPU:$9A88 PRG:1A88 6A + ror a ; CPU:$9A89 PRG:1A89 6A + adc #$20 ; CPU:$9A8A PRG:1A8A 69 20 + sta SourcePointerLo ; CPU:$9A8C PRG:1A8C 85 10 + lda #$02 ; CPU:$9A8E PRG:1A8E A9 02 + sta SourcePointerHi ; CPU:$9A90 PRG:1A90 85 11 + ldx ActorIndex ; CPU:$9A92 PRG:1A92 A6 1E + ldy PlayerPaletteIndex,x ; CPU:$9A94 PRG:1A94 B4 2A + lda $0026,y ; CPU:$9A96 PRG:1A96 B9 26 00 + jsr $8CB8 ; CPU:$9A99 PRG:1A99 20 B8 8C + lda ControllerDPad1,x ; CPU:$9A9C PRG:1A9C B5 F6 + and #$01 ; CPU:$9A9E PRG:1A9E 29 01 + lsr a ; CPU:$9AA0 PRG:1AA0 4A + ror a ; CPU:$9AA1 PRG:1AA1 6A + ror a ; CPU:$9AA2 PRG:1AA2 6A + sta Zp19 ; CPU:$9AA3 PRG:1AA3 85 19 + ldy ActorSlotOffset ; CPU:$9AA5 PRG:1AA5 A4 21 + lda $0034,y ; CPU:$9AA7 PRG:1AA7 B9 34 00 + and #$7F ; CPU:$9AAA PRG:1AAA 29 7F + bne SpawnActorPairAlt_OnNonzero_9AD8 ; CPU:$9AAC PRG:1AAC D0 2A + lda ControllerButtonMask,x ; CPU:$9AAE PRG:1AAE B5 F2 + and #$0F ; CPU:$9AB0 PRG:1AB0 29 0F + bne SpawnActorPairAlt_OnNonzero_9ABC ; CPU:$9AB2 PRG:1AB2 D0 08 + lda ControllerDPad1,x ; CPU:$9AB4 PRG:1AB4 B5 F6 + beq SpawnActorPairAlt_JoinBranchPaths_9AD3 ; CPU:$9AB6 PRG:1AB6 F0 1B + lda #$01 ; CPU:$9AB8 PRG:1AB8 A9 01 + bne SpawnActorPairAlt_JoinBranchPaths_9AD3 ; CPU:$9ABA PRG:1ABA D0 17 +; ----------------------------------------------------------------------------- +; Routine: SpawnActorPairAlt_OnNonzero_9ABC +; Global: SpawnActorPairAlt_OnNonzero_9ABC.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnActorPairAlt_OnNonzero_9ABC: + lda FrameCounterLo ; CPU:$9ABC PRG:1ABC A5 24 + and #$08 ; CPU:$9ABE PRG:1ABE 29 08 + bne SpawnActorPairAlt_OnNonzero_9ACE ; CPU:$9AC0 PRG:1AC0 D0 0C + lda FrameCounterLo ; CPU:$9AC2 PRG:1AC2 A5 24 + and #$10 ; CPU:$9AC4 PRG:1AC4 29 10 + lsr a ; CPU:$9AC6 PRG:1AC6 4A + lsr a ; CPU:$9AC7 PRG:1AC7 4A + lsr a ; CPU:$9AC8 PRG:1AC8 4A + lsr a ; CPU:$9AC9 PRG:1AC9 4A + adc #$03 ; CPU:$9ACA PRG:1ACA 69 03 + bne SpawnActorPairAlt_JoinBranchPaths_9AD3 ; CPU:$9ACC PRG:1ACC D0 05 +; ----------------------------------------------------------------------------- +; Routine: SpawnActorPairAlt_OnNonzero_9ACE +; Global: SpawnActorPairAlt_OnNonzero_9ACE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnActorPairAlt_OnNonzero_9ACE: + lda #$02 ; CPU:$9ACE PRG:1ACE A9 02 + sta Zp5E,x ; CPU:$9AD0 PRG:1AD0 95 5E + lsr a ; CPU:$9AD2 PRG:1AD2 4A +; ----------------------------------------------------------------------------- +; Routine: SpawnActorPairAlt_JoinBranchPaths_9AD3 +; Global: SpawnActorPairAlt_JoinBranchPaths_9AD3.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnActorPairAlt_JoinBranchPaths_9AD3: + sta ScriptCounterA,x ; CPU:$9AD3 PRG:1AD3 95 43 + jmp $9B25 ; CPU:$9AD5 PRG:1AD5 4C 25 9B +; ----------------------------------------------------------------------------- +; Routine: SpawnActorPairAlt_OnNonzero_9AD8 +; Global: SpawnActorPairAlt_OnNonzero_9AD8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SpawnActorPairAlt_OnNonzero_9AD8: + and #$3F ; CPU:$9AD8 PRG:1AD8 29 3F + asl a ; CPU:$9ADA PRG:1ADA 0A + tay ; CPU:$9ADB PRG:1ADB A8 + lda $8CEF,y ; CPU:$9ADC PRG:1ADC B9 EF 8C + sta BytecodeStreamPointerLo ; CPU:$9ADF PRG:1ADF 85 1A + lda $8CF0,y ; CPU:$9AE1 PRG:1AE1 B9 F0 8C + sta BytecodeStreamPointerHi ; CPU:$9AE4 PRG:1AE4 85 1B + ldy ScriptFlags,x ; CPU:$9AE6 PRG:1AE6 B4 41 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeInterpreter +; Global: Bytecode interpreter entry. Reads a token byte through (BytecodeStreamPointerLo/Hi); tokens $C8-$EF are converted to an index and dispatched through the handler table at $9237 into jmp ($001C); anything else is an operand consumed by the current handler. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeInterpreter: + ldx ActorIndex ; CPU:$9AE8 PRG:1AE8 A6 1E + lda (BytecodeStreamPointerLo),y ; CPU:$9AEA PRG:1AEA B1 1A + iny ; CPU:$9AEC PRG:1AEC C8 + cmp #$F0 ; CPU:$9AED PRG:1AED C9 F0 + bcs DispatchThroughPointer_JoinBranchPaths_9B08 ; CPU:$9AEF PRG:1AEF B0 17 + cmp #$C8 ; CPU:$9AF1 PRG:1AF1 C9 C8 + bcc DispatchThroughPointer_JoinBranchPaths_9B08 ; CPU:$9AF3 PRG:1AF3 90 13 + sbc #$C8 ; CPU:$9AF5 PRG:1AF5 E9 C8 + asl a ; CPU:$9AF7 PRG:1AF7 0A + tax ; CPU:$9AF8 PRG:1AF8 AA + lda $9237,x ; CPU:$9AF9 PRG:1AF9 BD 37 92 + sta BytecodeHandlerPointerLo ; CPU:$9AFC PRG:1AFC 85 1C + lda $9238,x ; CPU:$9AFE PRG:1AFE BD 38 92 + sta BytecodeHandlerPointerHi ; CPU:$9B01 PRG:1B01 85 1D + ldx ActorIndex ; CPU:$9B03 PRG:1B03 A6 1E +; ----------------------------------------------------------------------------- +; Routine: DispatchThroughPointer +; Global: jmp ($001C) - the handler table and the $9F2B table both land here to re-enter the interpreter at the next token. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +DispatchThroughPointer: + jmp ($001C) ; CPU:$9B05 PRG:1B05 6C 1C 00 +; ----------------------------------------------------------------------------- +; Routine: DispatchThroughPointer_JoinBranchPaths_9B08 +; Global: DispatchThroughPointer_JoinBranchPaths_9B08.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +DispatchThroughPointer_JoinBranchPaths_9B08: + pha ; CPU:$9B08 PRG:1B08 48 + lda (BytecodeStreamPointerLo),y ; CPU:$9B09 PRG:1B09 B1 1A + iny ; CPU:$9B0B PRG:1B0B C8 + jsr $94C8 ; CPU:$9B0C PRG:1B0C 20 C8 94 + ldx Zp19 ; CPU:$9B0F PRG:1B0F A6 19 + bne DispatchThroughPointer_OnNonzero_9B18 ; CPU:$9B11 PRG:1B11 D0 05 + eor #$FF ; CPU:$9B13 PRG:1B13 49 FF + clc ; CPU:$9B15 PRG:1B15 18 + adc #$01 ; CPU:$9B16 PRG:1B16 69 01 +; ----------------------------------------------------------------------------- +; Routine: DispatchThroughPointer_OnNonzero_9B18 +; Global: DispatchThroughPointer_OnNonzero_9B18.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +DispatchThroughPointer_OnNonzero_9B18: + ldy ActorSlotOffset ; CPU:$9B18 PRG:1B18 A4 21 + clc ; CPU:$9B1A PRG:1B1A 18 + adc $003C,y ; CPU:$9B1B PRG:1B1B 79 3C 00 + sta $003C,y ; CPU:$9B1E PRG:1B1E 99 3C 00 + pla ; CPU:$9B21 PRG:1B21 68 + sta $0033,y ; CPU:$9B22 PRG:1B22 99 33 00 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram +; Global: Main bytecode program loop: advance the program counter, dispatch the token, and resume. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram: + jsr $9CBB ; CPU:$9B25 PRG:1B25 20 BB 9C + ldx ActorIndex ; CPU:$9B28 PRG:1B28 A6 1E + lda ScriptCounterA,x ; CPU:$9B2A PRG:1B2A B5 43 + asl a ; CPU:$9B2C PRG:1B2C 0A + asl a ; CPU:$9B2D PRG:1B2D 0A + pha ; CPU:$9B2E PRG:1B2E 48 + asl a ; CPU:$9B2F PRG:1B2F 0A + asl a ; CPU:$9B30 PRG:1B30 0A + adc DestinationPointerLo ; CPU:$9B31 PRG:1B31 65 12 + sta DestinationPointerLo ; CPU:$9B33 PRG:1B33 85 12 + lda #$00 ; CPU:$9B35 PRG:1B35 A9 00 + adc DestinationPointerHi ; CPU:$9B37 PRG:1B37 65 13 + sta DestinationPointerHi ; CPU:$9B39 PRG:1B39 85 13 + pla ; CPU:$9B3B PRG:1B3B 68 + adc Zp16 ; CPU:$9B3C PRG:1B3C 65 16 + sta Zp16 ; CPU:$9B3E PRG:1B3E 85 16 + lda #$00 ; CPU:$9B40 PRG:1B40 A9 00 + adc Zp17 ; CPU:$9B42 PRG:1B42 65 17 + sta Zp17 ; CPU:$9B44 PRG:1B44 85 17 + lda #$0F ; CPU:$9B46 PRG:1B46 A9 0F + sta CollisionFlagBits ; CPU:$9B48 PRG:1B48 85 15 + ldy #$3D ; CPU:$9B4A PRG:1B4A A0 3D +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnNonnegative_9B4C +; Global: RunBytecodeProgram_OnNonnegative_9B4C.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnNonnegative_9B4C: + sty VramBlockCountLo ; CPU:$9B4C PRG:1B4C 84 14 + ldy CollisionFlagBits ; CPU:$9B4E PRG:1B4E A4 15 + lda (DestinationPointerLo),y ; CPU:$9B50 PRG:1B50 B1 12 + ldy VramBlockCountLo ; CPU:$9B52 PRG:1B52 A4 14 + sta (SourcePointerLo),y ; CPU:$9B54 PRG:1B54 91 10 + dey ; CPU:$9B56 PRG:1B56 88 + dey ; CPU:$9B57 PRG:1B57 88 + dey ; CPU:$9B58 PRG:1B58 88 + dey ; CPU:$9B59 PRG:1B59 88 + dec CollisionFlagBits ; CPU:$9B5A PRG:1B5A C6 15 + bpl RunBytecodeProgram_OnNonnegative_9B4C ; CPU:$9B5C PRG:1B5C 10 EE + lda #$03 ; CPU:$9B5E PRG:1B5E A9 03 + sta CollisionFlagBits ; CPU:$9B60 PRG:1B60 85 15 + ldy #$3E ; CPU:$9B62 PRG:1B62 A0 3E +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnNonnegative_9B64 +; Global: RunBytecodeProgram_OnNonnegative_9B64.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnNonnegative_9B64: + sty VramBlockCountLo ; CPU:$9B64 PRG:1B64 84 14 + ldy CollisionFlagBits ; CPU:$9B66 PRG:1B66 A4 15 + lda (Zp16),y ; CPU:$9B68 PRG:1B68 B1 16 + sta BytecodeStreamPointerLo ; CPU:$9B6A PRG:1B6A 85 1A + lda #$03 ; CPU:$9B6C PRG:1B6C A9 03 + sta Zp18 ; CPU:$9B6E PRG:1B6E 85 18 + ldy VramBlockCountLo ; CPU:$9B70 PRG:1B70 A4 14 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnNonnegative_9B72 +; Global: RunBytecodeProgram_OnNonnegative_9B72.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnNonnegative_9B72: + lda #$00 ; CPU:$9B72 PRG:1B72 A9 00 + sta BytecodeStreamPointerHi ; CPU:$9B74 PRG:1B74 85 1B + lsr BytecodeStreamPointerLo ; CPU:$9B76 PRG:1B76 46 1A + ror BytecodeStreamPointerHi ; CPU:$9B78 PRG:1B78 66 1B + lsr BytecodeStreamPointerLo ; CPU:$9B7A PRG:1B7A 46 1A + ror BytecodeStreamPointerHi ; CPU:$9B7C PRG:1B7C 66 1B + txa ; CPU:$9B7E PRG:1B7E 8A + clc ; CPU:$9B7F PRG:1B7F 18 + adc PlayerActiveFlag,x ; CPU:$9B80 PRG:1B80 75 78 + and #$03 ; CPU:$9B82 PRG:1B82 29 03 + ora BytecodeStreamPointerHi ; CPU:$9B84 PRG:1B84 05 1B + sta (SourcePointerLo),y ; CPU:$9B86 PRG:1B86 91 10 + dey ; CPU:$9B88 PRG:1B88 88 + dey ; CPU:$9B89 PRG:1B89 88 + dey ; CPU:$9B8A PRG:1B8A 88 + dey ; CPU:$9B8B PRG:1B8B 88 + dec Zp18 ; CPU:$9B8C PRG:1B8C C6 18 + bpl RunBytecodeProgram_OnNonnegative_9B72 ; CPU:$9B8E PRG:1B8E 10 E2 + dec CollisionFlagBits ; CPU:$9B90 PRG:1B90 C6 15 + bpl RunBytecodeProgram_OnNonnegative_9B64 ; CPU:$9B92 PRG:1B92 10 D0 + lda Zp19 ; CPU:$9B94 PRG:1B94 A5 19 + eor ScriptCounterA,x ; CPU:$9B96 PRG:1B96 55 43 + and #$40 ; CPU:$9B98 PRG:1B98 29 40 + beq RunBytecodeProgram_OnZero_9BA1 ; CPU:$9B9A PRG:1B9A F0 05 + lda #$00 ; CPU:$9B9C PRG:1B9C A9 00 + jsr $9E7F ; CPU:$9B9E PRG:1B9E 20 7F 9E +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnZero_9BA1 +; Global: RunBytecodeProgram_OnZero_9BA1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnZero_9BA1: + ldx ActorIndex ; CPU:$9BA1 PRG:1BA1 A6 1E + lda ScriptCounterA,x ; CPU:$9BA3 PRG:1BA3 B5 43 + rol a ; CPU:$9BA5 PRG:1BA5 2A + bcc RunBytecodeProgram_OnCarryClear_9BF3 ; CPU:$9BA6 PRG:1BA6 90 4B + ldx #$18 ; CPU:$9BA8 PRG:1BA8 A2 18 + ldy #$00 ; CPU:$9BAA PRG:1BAA A0 00 + lda #$04 ; CPU:$9BAC PRG:1BAC A9 04 + sta Zp1F ; CPU:$9BAE PRG:1BAE 85 1F +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnNonzero_9BB0 +; Global: RunBytecodeProgram_OnNonzero_9BB0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnNonzero_9BB0: + lda #$04 ; CPU:$9BB0 PRG:1BB0 A9 04 + sta Zp20 ; CPU:$9BB2 PRG:1BB2 85 20 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnNonzero_9BB4 +; Global: RunBytecodeProgram_OnNonzero_9BB4.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnNonzero_9BB4: + iny ; CPU:$9BB4 PRG:1BB4 C8 + lda (SourcePointerLo),y ; CPU:$9BB5 PRG:1BB5 B1 10 + iny ; CPU:$9BB7 PRG:1BB7 C8 + sta Zp97,x ; CPU:$9BB8 PRG:1BB8 95 97 + inx ; CPU:$9BBA PRG:1BBA E8 + lda (SourcePointerLo),y ; CPU:$9BBB PRG:1BBB B1 10 + iny ; CPU:$9BBD PRG:1BBD C8 + eor #$80 ; CPU:$9BBE PRG:1BBE 49 80 + sta Zp97,x ; CPU:$9BC0 PRG:1BC0 95 97 + inx ; CPU:$9BC2 PRG:1BC2 E8 + iny ; CPU:$9BC3 PRG:1BC3 C8 + dec Zp20 ; CPU:$9BC4 PRG:1BC4 C6 20 + bne RunBytecodeProgram_OnNonzero_9BB4 ; CPU:$9BC6 PRG:1BC6 D0 EC + txa ; CPU:$9BC8 PRG:1BC8 8A + sec ; CPU:$9BC9 PRG:1BC9 38 + sbc #$10 ; CPU:$9BCA PRG:1BCA E9 10 + tax ; CPU:$9BCC PRG:1BCC AA + dec Zp1F ; CPU:$9BCD PRG:1BCD C6 1F + bne RunBytecodeProgram_OnNonzero_9BB0 ; CPU:$9BCF PRG:1BCF D0 DF + ldx #$00 ; CPU:$9BD1 PRG:1BD1 A2 00 + ldy #$00 ; CPU:$9BD3 PRG:1BD3 A0 00 + lda #$04 ; CPU:$9BD5 PRG:1BD5 A9 04 + sta Zp1F ; CPU:$9BD7 PRG:1BD7 85 1F +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnNonzero_9BD9 +; Global: RunBytecodeProgram_OnNonzero_9BD9.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnNonzero_9BD9: + lda #$04 ; CPU:$9BD9 PRG:1BD9 A9 04 + sta Zp20 ; CPU:$9BDB PRG:1BDB 85 20 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnNonzero_9BDD +; Global: RunBytecodeProgram_OnNonzero_9BDD.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnNonzero_9BDD: + lda Zp97,x ; CPU:$9BDD PRG:1BDD B5 97 + inx ; CPU:$9BDF PRG:1BDF E8 + iny ; CPU:$9BE0 PRG:1BE0 C8 + sta (SourcePointerLo),y ; CPU:$9BE1 PRG:1BE1 91 10 + iny ; CPU:$9BE3 PRG:1BE3 C8 + lda Zp97,x ; CPU:$9BE4 PRG:1BE4 B5 97 + inx ; CPU:$9BE6 PRG:1BE6 E8 + sta (SourcePointerLo),y ; CPU:$9BE7 PRG:1BE7 91 10 + iny ; CPU:$9BE9 PRG:1BE9 C8 + iny ; CPU:$9BEA PRG:1BEA C8 + dec Zp20 ; CPU:$9BEB PRG:1BEB C6 20 + bne RunBytecodeProgram_OnNonzero_9BDD ; CPU:$9BED PRG:1BED D0 EE + dec Zp1F ; CPU:$9BEF PRG:1BEF C6 1F + bne RunBytecodeProgram_OnNonzero_9BD9 ; CPU:$9BF1 PRG:1BF1 D0 E6 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnCarryClear_9BF3 +; Global: RunBytecodeProgram_OnCarryClear_9BF3.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnCarryClear_9BF3: + ldy ActorSlotOffset ; CPU:$9BF3 PRG:1BF3 A4 21 + lda $0033,y ; CPU:$9BF5 PRG:1BF5 B9 33 00 + sta BytecodeHandlerPointerHi ; CPU:$9BF8 PRG:1BF8 85 1D + lda $0032,y ; CPU:$9BFA PRG:1BFA B9 32 00 + sec ; CPU:$9BFD PRG:1BFD 38 + sbc #$10 ; CPU:$9BFE PRG:1BFE E9 10 + sec ; CPU:$9C00 PRG:1C00 38 + sbc PpuScrollX ; CPU:$9C01 PRG:1C01 E5 FE + ldx ActorIndex ; CPU:$9C03 PRG:1C03 A6 1E + clc ; CPU:$9C05 PRG:1C05 18 + adc Zp5C,x ; CPU:$9C06 PRG:1C06 75 5C + sta VramBlockCountLo ; CPU:$9C08 PRG:1C08 85 14 + lda $0031,y ; CPU:$9C0A PRG:1C0A B9 31 00 + sec ; CPU:$9C0D PRG:1C0D 38 + sbc Zp5E,x ; CPU:$9C0E PRG:1C0E F5 5E + sta DestinationPointerHi ; CPU:$9C10 PRG:1C10 85 13 + txa ; CPU:$9C12 PRG:1C12 8A + asl a ; CPU:$9C13 PRG:1C13 0A + asl a ; CPU:$9C14 PRG:1C14 0A + asl a ; CPU:$9C15 PRG:1C15 0A + adc #$E0 ; CPU:$9C16 PRG:1C16 69 E0 + sta Zp18 ; CPU:$9C18 PRG:1C18 85 18 + lda #$02 ; CPU:$9C1A PRG:1C1A A9 02 + sta Zp19 ; CPU:$9C1C PRG:1C1C 85 19 + lda $0031,y ; CPU:$9C1E PRG:1C1E B9 31 00 + clc ; CPU:$9C21 PRG:1C21 18 + adc #$1F ; CPU:$9C22 PRG:1C22 69 1F + tax ; CPU:$9C24 PRG:1C24 AA + lda $0033,y ; CPU:$9C25 PRG:1C25 B9 33 00 + beq RunBytecodeProgram_OnZero_9C2C ; CPU:$9C28 PRG:1C28 F0 02 + bpl RunBytecodeProgram_OnNonnegative_9C2E ; CPU:$9C2A PRG:1C2A 10 02 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnZero_9C2C +; Global: RunBytecodeProgram_OnZero_9C2C.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnZero_9C2C: + ldx #$F0 ; CPU:$9C2C PRG:1C2C A2 F0 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnNonnegative_9C2E +; Global: RunBytecodeProgram_OnNonnegative_9C2E.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnNonnegative_9C2E: + txa ; CPU:$9C2E PRG:1C2E 8A + ldy #$00 ; CPU:$9C2F PRG:1C2F A0 00 + sta (Zp18),y ; CPU:$9C31 PRG:1C31 91 18 + ldy #$04 ; CPU:$9C33 PRG:1C33 A0 04 + sta (Zp18),y ; CPU:$9C35 PRG:1C35 91 18 + lda VramBlockCountLo ; CPU:$9C37 PRG:1C37 A5 14 + clc ; CPU:$9C39 PRG:1C39 18 + adc #$08 ; CPU:$9C3A PRG:1C3A 69 08 + dey ; CPU:$9C3C PRG:1C3C 88 + sta (Zp18),y ; CPU:$9C3D PRG:1C3D 91 18 + clc ; CPU:$9C3F PRG:1C3F 18 + adc #$08 ; CPU:$9C40 PRG:1C40 69 08 + ldy #$07 ; CPU:$9C42 PRG:1C42 A0 07 + sta (Zp18),y ; CPU:$9C44 PRG:1C44 91 18 + ldy #$00 ; CPU:$9C46 PRG:1C46 A0 00 + lda #$03 ; CPU:$9C48 PRG:1C48 A9 03 + sta DestinationPointerLo ; CPU:$9C4A PRG:1C4A 85 12 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnNonnegative_9C4C +; Global: RunBytecodeProgram_OnNonnegative_9C4C.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnNonnegative_9C4C: + lda VramBlockCountLo ; CPU:$9C4C PRG:1C4C A5 14 + sta CollisionFlagBits ; CPU:$9C4E PRG:1C4E 85 15 + ldx #$03 ; CPU:$9C50 PRG:1C50 A2 03 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnNonnegative_9C52 +; Global: RunBytecodeProgram_OnNonnegative_9C52.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnNonnegative_9C52: + iny ; CPU:$9C52 PRG:1C52 C8 + lda (SourcePointerLo),y ; CPU:$9C53 PRG:1C53 B1 10 + dey ; CPU:$9C55 PRG:1C55 88 + cmp #$FF ; CPU:$9C56 PRG:1C56 C9 FF + beq RunBytecodeProgram_OnZero_9C71 ; CPU:$9C58 PRG:1C58 F0 17 + lda BytecodeHandlerPointerHi ; CPU:$9C5A PRG:1C5A A5 1D + cmp #$F0 ; CPU:$9C5C PRG:1C5C C9 F0 + bcc RunBytecodeProgram_OnCarryClear_9C66 ; CPU:$9C5E PRG:1C5E 90 06 + lda DestinationPointerHi ; CPU:$9C60 PRG:1C60 A5 13 + sbc BytecodeHandlerPointerHi ; CPU:$9C62 PRG:1C62 E5 1D + bcc RunBytecodeProgram_JoinBranchPaths_9C73 ; CPU:$9C64 PRG:1C64 90 0D +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnCarryClear_9C66 +; Global: RunBytecodeProgram_OnCarryClear_9C66.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnCarryClear_9C66: + lda DestinationPointerHi ; CPU:$9C66 PRG:1C66 A5 13 + sec ; CPU:$9C68 PRG:1C68 38 + sbc BytecodeHandlerPointerHi ; CPU:$9C69 PRG:1C69 E5 1D + bcs RunBytecodeProgram_JoinBranchPaths_9C73 ; CPU:$9C6B PRG:1C6B B0 06 + cmp #$F0 ; CPU:$9C6D PRG:1C6D C9 F0 + bcs RunBytecodeProgram_JoinBranchPaths_9C73 ; CPU:$9C6F PRG:1C6F B0 02 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnZero_9C71 +; Global: RunBytecodeProgram_OnZero_9C71.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnZero_9C71: + lda #$F0 ; CPU:$9C71 PRG:1C71 A9 F0 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_JoinBranchPaths_9C73 +; Global: RunBytecodeProgram_JoinBranchPaths_9C73.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_JoinBranchPaths_9C73: + sta (SourcePointerLo),y ; CPU:$9C73 PRG:1C73 91 10 + lda ActorIndex ; CPU:$9C75 PRG:1C75 A5 1E + bne RunBytecodeProgram_OnNonzero_9C84 ; CPU:$9C77 PRG:1C77 D0 0B + lda PlayerPosYLo1 ; CPU:$9C79 PRG:1C79 A5 3C + asl a ; CPU:$9C7B PRG:1C7B 0A + bcs RunBytecodeProgram_JoinBranchPaths_9C91 ; CPU:$9C7C PRG:1C7C B0 13 + cmp PpuScrollX ; CPU:$9C7E PRG:1C7E C5 FE + bcs RunBytecodeProgram_JoinBranchPaths_9C91 ; CPU:$9C80 PRG:1C80 B0 0F + bcc RunBytecodeProgram_OnCarryClear_9C8D ; CPU:$9C82 PRG:1C82 90 09 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnNonzero_9C84 +; Global: RunBytecodeProgram_OnNonzero_9C84.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnNonzero_9C84: + lda PlayerPosYLo2 ; CPU:$9C84 PRG:1C84 A5 40 + asl a ; CPU:$9C86 PRG:1C86 0A + bcc RunBytecodeProgram_JoinBranchPaths_9C91 ; CPU:$9C87 PRG:1C87 90 08 + cmp PpuScrollX ; CPU:$9C89 PRG:1C89 C5 FE + bcc RunBytecodeProgram_JoinBranchPaths_9C91 ; CPU:$9C8B PRG:1C8B 90 04 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_OnCarryClear_9C8D +; Global: RunBytecodeProgram_OnCarryClear_9C8D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_OnCarryClear_9C8D: + lda #$F0 ; CPU:$9C8D PRG:1C8D A9 F0 + sta (SourcePointerLo),y ; CPU:$9C8F PRG:1C8F 91 10 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_JoinBranchPaths_9C91 +; Global: RunBytecodeProgram_JoinBranchPaths_9C91.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_JoinBranchPaths_9C91: + iny ; CPU:$9C91 PRG:1C91 C8 + iny ; CPU:$9C92 PRG:1C92 C8 + iny ; CPU:$9C93 PRG:1C93 C8 + lda CollisionFlagBits ; CPU:$9C94 PRG:1C94 A5 15 + sta (SourcePointerLo),y ; CPU:$9C96 PRG:1C96 91 10 + clc ; CPU:$9C98 PRG:1C98 18 + adc #$08 ; CPU:$9C99 PRG:1C99 69 08 + sta CollisionFlagBits ; CPU:$9C9B PRG:1C9B 85 15 + iny ; CPU:$9C9D PRG:1C9D C8 + dex ; CPU:$9C9E PRG:1C9E CA + bpl RunBytecodeProgram_OnNonnegative_9C52 ; CPU:$9C9F PRG:1C9F 10 B1 + lda DestinationPointerHi ; CPU:$9CA1 PRG:1CA1 A5 13 + clc ; CPU:$9CA3 PRG:1CA3 18 + adc #$08 ; CPU:$9CA4 PRG:1CA4 69 08 + sta DestinationPointerHi ; CPU:$9CA6 PRG:1CA6 85 13 + dec DestinationPointerLo ; CPU:$9CA8 PRG:1CA8 C6 12 + bpl RunBytecodeProgram_OnNonnegative_9C4C ; CPU:$9CAA PRG:1CAA 10 A0 + rts ; CPU:$9CAC PRG:1CAC 60 +; ----------------------------------------------------------------------------- +; Routine: RunBytecodeProgram_Return_9CAD +; Global: Decrement the 16-bit word in Zp14/Zp15 by one. A textbook "dec 16-bit" helper, but Zp14/Zp15 are otherwise scratch, and no word in the image points here. Provably unreachable; kept as code. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunBytecodeProgram_Return_9CAD: + lda Zp18 ; CPU:$9CAD PRG:1CAD A5 18 + sec ; CPU:$9CAF PRG:1CAF 38 + sbc #$01 ; CPU:$9CB0 PRG:1CB0 E9 01 + sta Zp18 ; CPU:$9CB2 PRG:1CB2 85 18 + lda Zp19 ; CPU:$9CB4 PRG:1CB4 A5 19 + sbc #$00 ; CPU:$9CB6 PRG:1CB6 E9 00 + sta Zp19 ; CPU:$9CB8 PRG:1CB8 85 19 + rts ; CPU:$9CBA PRG:1CBA 60 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeState +; Global: Reset the per-invocation script state at $034D/$034E and the flags in zero page $4D/$4E. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeState: + lda #$00 ; CPU:$9CBB PRG:1CBB A9 00 + sta ScriptFlagsLo ; CPU:$9CBD PRG:1CBD 85 4D + sta ScriptFlagsHi ; CPU:$9CBF PRG:1CBF 85 4E + lda PlayerPosXLo1 ; CPU:$9CC1 PRG:1CC1 A5 3A + sec ; CPU:$9CC3 PRG:1CC3 38 + sbc PlayerPosXLo2 ; CPU:$9CC4 PRG:1CC4 E5 3E + clc ; CPU:$9CC6 PRG:1CC6 18 + adc #$07 ; CPU:$9CC7 PRG:1CC7 69 07 + cmp #$0F ; CPU:$9CC9 PRG:1CC9 C9 0F + bcs ResetBytecodeState_OnCarrySet_9D0D ; CPU:$9CCB PRG:1CCB B0 40 + lda #$FF ; CPU:$9CCD PRG:1CCD A9 FF + sta ScriptFlagsHi ; CPU:$9CCF PRG:1CCF 85 4E + lda PlayerActionState ; CPU:$9CD1 PRG:1CD1 A5 F0 + cmp #$C0 ; CPU:$9CD3 PRG:1CD3 C9 C0 + bcc ResetBytecodeState_OnCarryClear_9CDB ; CPU:$9CD5 PRG:1CD5 90 04 + cmp #$F0 ; CPU:$9CD7 PRG:1CD7 C9 F0 + bne CopyActorCoordinates ; CPU:$9CD9 PRG:1CD9 D0 73 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeState_OnCarryClear_9CDB +; Global: ResetBytecodeState_OnCarryClear_9CDB.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeState_OnCarryClear_9CDB: + lda PlayerActionState2 ; CPU:$9CDB PRG:1CDB A5 F1 + cmp #$C0 ; CPU:$9CDD PRG:1CDD C9 C0 + bcc ResetBytecodeState_OnCarryClear_9CE5 ; CPU:$9CDF PRG:1CDF 90 04 + cmp #$F0 ; CPU:$9CE1 PRG:1CE1 C9 F0 + bne CopyActorCoordinates ; CPU:$9CE3 PRG:1CE3 D0 69 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeState_OnCarryClear_9CE5 +; Global: ResetBytecodeState_OnCarryClear_9CE5.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeState_OnCarryClear_9CE5: + lda #$00 ; CPU:$9CE5 PRG:1CE5 A9 00 + sta Zp18 ; CPU:$9CE7 PRG:1CE7 85 18 + lda Zp3B ; CPU:$9CE9 PRG:1CE9 A5 3B + sec ; CPU:$9CEB PRG:1CEB 38 + sbc Zp3F ; CPU:$9CEC PRG:1CEC E5 3F + tax ; CPU:$9CEE PRG:1CEE AA + lda PlayerPosYLo1 ; CPU:$9CEF PRG:1CEF A5 3C + sbc PlayerPosYLo2 ; CPU:$9CF1 PRG:1CF1 E5 40 + bpl ResetBytecodeState_OnNonnegative_9D04 ; CPU:$9CF3 PRG:1CF3 10 0F + dec Zp18 ; CPU:$9CF5 PRG:1CF5 C6 18 + eor #$FF ; CPU:$9CF7 PRG:1CF7 49 FF + tay ; CPU:$9CF9 PRG:1CF9 A8 + txa ; CPU:$9CFA PRG:1CFA 8A + eor #$FF ; CPU:$9CFB PRG:1CFB 49 FF + clc ; CPU:$9CFD PRG:1CFD 18 + adc #$01 ; CPU:$9CFE PRG:1CFE 69 01 + tax ; CPU:$9D00 PRG:1D00 AA + tya ; CPU:$9D01 PRG:1D01 98 + adc #$00 ; CPU:$9D02 PRG:1D02 69 00 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeState_OnNonnegative_9D04 +; Global: ResetBytecodeState_OnNonnegative_9D04.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeState_OnNonnegative_9D04: + cmp #$08 ; CPU:$9D04 PRG:1D04 C9 08 + bne ResetBytecodeState_OnNonzero_9D10 ; CPU:$9D06 PRG:1D06 D0 08 + txa ; CPU:$9D08 PRG:1D08 8A + cmp #$00 ; CPU:$9D09 PRG:1D09 C9 00 + beq ResetBytecodeState_OnZero_9D4A ; CPU:$9D0B PRG:1D0B F0 3D +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeState_OnCarrySet_9D0D +; Global: ResetBytecodeState_OnCarrySet_9D0D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeState_OnCarrySet_9D0D: + jmp $9D4E ; CPU:$9D0D PRG:1D0D 4C 4E 9D +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeState_OnNonzero_9D10 +; Global: ResetBytecodeState_OnNonzero_9D10.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeState_OnNonzero_9D10: + bcs CopyActorCoordinates ; CPU:$9D10 PRG:1D10 B0 3C + lda PlayerPosYLo2 ; CPU:$9D12 PRG:1D12 A5 40 + lsr a ; CPU:$9D14 PRG:1D14 4A + sta BytecodeHandlerPointerHi ; CPU:$9D15 PRG:1D15 85 1D + lda Zp3F ; CPU:$9D17 PRG:1D17 A5 3F + ror a ; CPU:$9D19 PRG:1D19 6A + sta BytecodeHandlerPointerLo ; CPU:$9D1A PRG:1D1A 85 1C + lda PlayerPosYLo1 ; CPU:$9D1C PRG:1D1C A5 3C + lsr a ; CPU:$9D1E PRG:1D1E 4A + sta BytecodeStreamPointerHi ; CPU:$9D1F PRG:1D1F 85 1B + lda Zp3B ; CPU:$9D21 PRG:1D21 A5 3B + ror a ; CPU:$9D23 PRG:1D23 6A + sta BytecodeStreamPointerLo ; CPU:$9D24 PRG:1D24 85 1A + clc ; CPU:$9D26 PRG:1D26 18 + adc BytecodeHandlerPointerLo ; CPU:$9D27 PRG:1D27 65 1C + sta VramBlockCountLo ; CPU:$9D29 PRG:1D29 85 14 + lda BytecodeStreamPointerHi ; CPU:$9D2B PRG:1D2B A5 1B + adc BytecodeHandlerPointerHi ; CPU:$9D2D PRG:1D2D 65 1D + ldy #$04 ; CPU:$9D2F PRG:1D2F A0 04 + ldx Zp18 ; CPU:$9D31 PRG:1D31 A6 18 + beq ResetBytecodeState_OnZero_9D39 ; CPU:$9D33 PRG:1D33 F0 04 + ldy #$00 ; CPU:$9D35 PRG:1D35 A0 00 + ldx #$04 ; CPU:$9D37 PRG:1D37 A2 04 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeState_OnZero_9D39 +; Global: ResetBytecodeState_OnZero_9D39.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeState_OnZero_9D39: + sec ; CPU:$9D39 PRG:1D39 38 + sbc #$04 ; CPU:$9D3A PRG:1D3A E9 04 + sta $003C,y ; CPU:$9D3C PRG:1D3C 99 3C 00 + clc ; CPU:$9D3F PRG:1D3F 18 + adc #$08 ; CPU:$9D40 PRG:1D40 69 08 + sta PlayerPosYLo1,x ; CPU:$9D42 PRG:1D42 95 3C + lda VramBlockCountLo ; CPU:$9D44 PRG:1D44 A5 14 + sta Zp3B ; CPU:$9D46 PRG:1D46 85 3B + sta Zp3F ; CPU:$9D48 PRG:1D48 85 3F +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeState_OnZero_9D4A +; Global: ResetBytecodeState_OnZero_9D4A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeState_OnZero_9D4A: + lda #$FF ; CPU:$9D4A PRG:1D4A A9 FF + sta ScriptFlagsLo ; CPU:$9D4C PRG:1D4C 85 4D +; ----------------------------------------------------------------------------- +; Routine: CopyActorCoordinates +; Global: CopyActorCoordinates.; called from $9D0D +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CopyActorCoordinates: + ldy ActorSlotOffset ; CPU:$9D4E PRG:1D4E A4 21 + lda $003A,y ; CPU:$9D50 PRG:1D50 B9 3A 00 + sta $0031,y ; CPU:$9D53 PRG:1D53 99 31 00 + ldx ActorIndex ; CPU:$9D56 PRG:1D56 A6 1E + lda PlayerActionState,x ; CPU:$9D58 PRG:1D58 B5 F0 + cmp #$FF ; CPU:$9D5A PRG:1D5A C9 FF + bcc CopyActorCoordinates_OnCarryClear_9D61 ; CPU:$9D5C PRG:1D5C 90 03 + jmp $9DE6 ; CPU:$9D5E PRG:1D5E 4C E6 9D +; ----------------------------------------------------------------------------- +; Routine: CopyActorCoordinates_OnCarryClear_9D61 +; Global: CopyActorCoordinates_OnCarryClear_9D61.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CopyActorCoordinates_OnCarryClear_9D61: + lda $003A,y ; CPU:$9D61 PRG:1D61 B9 3A 00 + sec ; CPU:$9D64 PRG:1D64 38 + sbc #$38 ; CPU:$9D65 PRG:1D65 E9 38 + sta VramBlockCountLo ; CPU:$9D67 PRG:1D67 85 14 + lda #$06 ; CPU:$9D69 PRG:1D69 A9 06 + sta BytecodeStreamPointerHi ; CPU:$9D6B PRG:1D6B 85 1B + jsr $A15D ; CPU:$9D6D PRG:1D6D 20 5D A1 + lda #$B0 ; CPU:$9D70 PRG:1D70 A9 B0 + clc ; CPU:$9D72 PRG:1D72 18 + adc Zp18 ; CPU:$9D73 PRG:1D73 65 18 + sta VramBlockCountLo ; CPU:$9D75 PRG:1D75 85 14 + lda #$58 ; CPU:$9D77 PRG:1D77 A9 58 + sec ; CPU:$9D79 PRG:1D79 38 + sbc Zp18 ; CPU:$9D7A PRG:1D7A E5 18 + sta CollisionFlagBits ; CPU:$9D7C PRG:1D7C 85 15 + ldy ActorSlotOffset ; CPU:$9D7E PRG:1D7E A4 21 + lda $003C,y ; CPU:$9D80 PRG:1D80 B9 3C 00 + cmp VramBlockCountLo ; CPU:$9D83 PRG:1D83 C5 14 + bcs LoadActorTileIndex_OnCarrySet_9E02 ; CPU:$9D85 PRG:1D85 B0 7B + cmp CollisionFlagBits ; CPU:$9D87 PRG:1D87 C5 15 + bcs LoadActorTileIndex ; CPU:$9D89 PRG:1D89 B0 5B + lda #$00 ; CPU:$9D8B PRG:1D8B A9 00 + sta $003B,y ; CPU:$9D8D PRG:1D8D 99 3B 00 + lda CollisionFlagBits ; CPU:$9D90 PRG:1D90 A5 15 + sta $003C,y ; CPU:$9D92 PRG:1D92 99 3C 00 + ldx ActorIndex ; CPU:$9D95 PRG:1D95 A6 1E + lda PlayerActiveFlag,x ; CPU:$9D97 PRG:1D97 B5 78 + bne CopyActorCoordinates_OnNonzero_9DA2 ; CPU:$9D99 PRG:1D99 D0 07 + lda $0326 ; CPU:$9D9B PRG:1D9B AD 26 03 + cmp #$02 ; CPU:$9D9E PRG:1D9E C9 02 + beq LoadActorTileIndex_OnZero_9E19 ; CPU:$9DA0 PRG:1DA0 F0 77 +; ----------------------------------------------------------------------------- +; Routine: CopyActorCoordinates_OnNonzero_9DA2 +; Global: CopyActorCoordinates_OnNonzero_9DA2.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CopyActorCoordinates_OnNonzero_9DA2: + lda PlayerActionState,x ; CPU:$9DA2 PRG:1DA2 B5 F0 + cmp #$E0 ; CPU:$9DA4 PRG:1DA4 C9 E0 + beq CopyActorCoordinates_OnZero_9DB6 ; CPU:$9DA6 PRG:1DA6 F0 0E + cmp #$F6 ; CPU:$9DA8 PRG:1DA8 C9 F6 + bne LoadActorTileIndex ; CPU:$9DAA PRG:1DAA D0 3A + lda #$03 ; CPU:$9DAC PRG:1DAC A9 03 + sta ScriptCounterC,x ; CPU:$9DAE PRG:1DAE 95 45 + lda #$FF ; CPU:$9DB0 PRG:1DB0 A9 FF + sta Zp62,x ; CPU:$9DB2 PRG:1DB2 95 62 + bne CopyActorCoordinates_OnNonzero_9DBB ; CPU:$9DB4 PRG:1DB4 D0 05 +; ----------------------------------------------------------------------------- +; Routine: CopyActorCoordinates_OnZero_9DB6 +; Global: CopyActorCoordinates_OnZero_9DB6.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CopyActorCoordinates_OnZero_9DB6: + lda #$03 ; CPU:$9DB6 PRG:1DB6 A9 03 + jsr $9E6E ; CPU:$9DB8 PRG:1DB8 20 6E 9E +; ----------------------------------------------------------------------------- +; Routine: CopyActorCoordinates_OnNonzero_9DBB +; Global: CopyActorCoordinates_OnNonzero_9DBB.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CopyActorCoordinates_OnNonzero_9DBB: + txa ; CPU:$9DBB PRG:1DBB 8A + asl a ; CPU:$9DBC PRG:1DBC 0A + tax ; CPU:$9DBD PRG:1DBD AA + lda $0031,y ; CPU:$9DBE PRG:1DBE B9 31 00 + ldy #$21 ; CPU:$9DC1 PRG:1DC1 A0 21 + cmp #$5A ; CPU:$9DC3 PRG:1DC3 C9 5A + bcc CopyActorCoordinates_OnCarryClear_9DD0 ; CPU:$9DC5 PRG:1DC5 90 09 + cmp #$7B ; CPU:$9DC7 PRG:1DC7 C9 7B + bcc CopyActorCoordinates_OnCarryClear_9DD4 ; CPU:$9DC9 PRG:1DC9 90 09 + iny ; CPU:$9DCB PRG:1DCB C8 + lda #$32 ; CPU:$9DCC PRG:1DCC A9 32 + bne SetActorBounds ; CPU:$9DCE PRG:1DCE D0 06 +; ----------------------------------------------------------------------------- +; Routine: CopyActorCoordinates_OnCarryClear_9DD0 +; Global: CopyActorCoordinates_OnCarryClear_9DD0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CopyActorCoordinates_OnCarryClear_9DD0: + lda #$74 ; CPU:$9DD0 PRG:1DD0 A9 74 + bne SetActorBounds ; CPU:$9DD2 PRG:1DD2 D0 02 +; ----------------------------------------------------------------------------- +; Routine: CopyActorCoordinates_OnCarryClear_9DD4 +; Global: CopyActorCoordinates_OnCarryClear_9DD4.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CopyActorCoordinates_OnCarryClear_9DD4: + lda #$D3 ; CPU:$9DD4 PRG:1DD4 A9 D3 +; ----------------------------------------------------------------------------- +; Routine: SetActorBounds +; Global: SetActorBounds.; called from $9E6B +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetActorBounds: + sta ScriptArgLo,x ; CPU:$9DD6 PRG:1DD6 95 47 + sty ScriptArgHi,x ; CPU:$9DD8 PRG:1DD8 94 48 + lda #$7B ; CPU:$9DDA PRG:1DDA A9 7B + sta SoundSequencePtrLo1 ; CPU:$9DDC PRG:1DDC 85 D4 + lda #$B1 ; CPU:$9DDE PRG:1DDE A9 B1 + sta SoundSequencePtrHi1 ; CPU:$9DE0 PRG:1DE0 85 D8 + lda #$00 ; CPU:$9DE2 PRG:1DE2 A9 00 + sta SoundChannelStep1 ; CPU:$9DE4 PRG:1DE4 85 D0 +; ----------------------------------------------------------------------------- +; Routine: LoadActorTileIndex +; Global: LoadActorTileIndex.; called from $9D5E +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorTileIndex: + ldy ActorSlotOffset ; CPU:$9DE6 PRG:1DE6 A4 21 + lda $003B,y ; CPU:$9DE8 PRG:1DE8 B9 3B 00 + asl a ; CPU:$9DEB PRG:1DEB 0A + lda $003C,y ; CPU:$9DEC PRG:1DEC B9 3C 00 + rol a ; CPU:$9DEF PRG:1DEF 2A + pha ; CPU:$9DF0 PRG:1DF0 48 + php ; CPU:$9DF1 PRG:1DF1 08 + lda $0034,y ; CPU:$9DF2 PRG:1DF2 B9 34 00 + and #$7F ; CPU:$9DF5 PRG:1DF5 29 7F + rol a ; CPU:$9DF7 PRG:1DF7 2A + plp ; CPU:$9DF8 PRG:1DF8 28 + ror a ; CPU:$9DF9 PRG:1DF9 6A + sta $0034,y ; CPU:$9DFA PRG:1DFA 99 34 00 + pla ; CPU:$9DFD PRG:1DFD 68 + sta $0032,y ; CPU:$9DFE PRG:1DFE 99 32 00 + rts ; CPU:$9E01 PRG:1E01 60 +; ----------------------------------------------------------------------------- +; Routine: LoadActorTileIndex_OnCarrySet_9E02 +; Global: LoadActorTileIndex_OnCarrySet_9E02.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorTileIndex_OnCarrySet_9E02: + lda #$FF ; CPU:$9E02 PRG:1E02 A9 FF + sta $003B,y ; CPU:$9E04 PRG:1E04 99 3B 00 + ldx VramBlockCountLo ; CPU:$9E07 PRG:1E07 A6 14 + dex ; CPU:$9E09 PRG:1E09 CA + stx PlayerPosYLo1,y ; CPU:$9E0A PRG:1E0A 96 3C + ldx ActorIndex ; CPU:$9E0C PRG:1E0C A6 1E + lda PlayerActiveFlag,x ; CPU:$9E0E PRG:1E0E B5 78 + bne LoadActorTileIndex_OnNonzero_9E37 ; CPU:$9E10 PRG:1E10 D0 25 + lda $0326 ; CPU:$9E12 PRG:1E12 AD 26 03 + cmp #$02 ; CPU:$9E15 PRG:1E15 C9 02 + bne LoadActorTileIndex_OnNonzero_9E37 ; CPU:$9E17 PRG:1E17 D0 1E +; ----------------------------------------------------------------------------- +; Routine: LoadActorTileIndex_OnZero_9E19 +; Global: LoadActorTileIndex_OnZero_9E19.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorTileIndex_OnZero_9E19: + ldx ActorIndex ; CPU:$9E19 PRG:1E19 A6 1E + lda PlayerActionState,x ; CPU:$9E1B PRG:1E1B B5 F0 + cmp #$FA ; CPU:$9E1D PRG:1E1D C9 FA + bcs LoadActorTileIndex ; CPU:$9E1F PRG:1E1F B0 C5 + jsr $99A3 ; CPU:$9E21 PRG:1E21 20 A3 99 + lda #$FC ; CPU:$9E24 PRG:1E24 A9 FC + ldy #$5E ; CPU:$9E26 PRG:1E26 A0 5E + jsr $9A24 ; CPU:$9E28 PRG:1E28 20 24 9A + ldx ActorSlotOffsetHi ; CPU:$9E2B PRG:1E2B A6 22 + lda PlayerActionState,x ; CPU:$9E2D PRG:1E2D B5 F0 + bne LoadActorTileIndex ; CPU:$9E2F PRG:1E2F D0 B5 + lda #$80 ; CPU:$9E31 PRG:1E31 A9 80 + sta PlayerActionState,x ; CPU:$9E33 PRG:1E33 95 F0 + bne LoadActorTileIndex ; CPU:$9E35 PRG:1E35 D0 AF +; ----------------------------------------------------------------------------- +; Routine: LoadActorTileIndex_OnNonzero_9E37 +; Global: LoadActorTileIndex_OnNonzero_9E37.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorTileIndex_OnNonzero_9E37: + lda PlayerActionState,x ; CPU:$9E37 PRG:1E37 B5 F0 + cmp #$E0 ; CPU:$9E39 PRG:1E39 C9 E0 + beq LoadActorTileIndex_OnZero_9E4B ; CPU:$9E3B PRG:1E3B F0 0E + cmp #$F6 ; CPU:$9E3D PRG:1E3D C9 F6 + bne LoadActorTileIndex ; CPU:$9E3F PRG:1E3F D0 A5 + lda #$83 ; CPU:$9E41 PRG:1E41 A9 83 + sta ScriptCounterC,x ; CPU:$9E43 PRG:1E43 95 45 + lda #$FF ; CPU:$9E45 PRG:1E45 A9 FF + sta Zp62,x ; CPU:$9E47 PRG:1E47 95 62 + bne LoadActorTileIndex_OnNonzero_9E50 ; CPU:$9E49 PRG:1E49 D0 05 +; ----------------------------------------------------------------------------- +; Routine: LoadActorTileIndex_OnZero_9E4B +; Global: LoadActorTileIndex_OnZero_9E4B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorTileIndex_OnZero_9E4B: + lda #$83 ; CPU:$9E4B PRG:1E4B A9 83 + jsr $9E6E ; CPU:$9E4D PRG:1E4D 20 6E 9E +; ----------------------------------------------------------------------------- +; Routine: LoadActorTileIndex_OnNonzero_9E50 +; Global: LoadActorTileIndex_OnNonzero_9E50.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorTileIndex_OnNonzero_9E50: + txa ; CPU:$9E50 PRG:1E50 8A + asl a ; CPU:$9E51 PRG:1E51 0A + tax ; CPU:$9E52 PRG:1E52 AA + lda $0031,y ; CPU:$9E53 PRG:1E53 B9 31 00 + ldy #$25 ; CPU:$9E56 PRG:1E56 A0 25 + cmp #$5A ; CPU:$9E58 PRG:1E58 C9 5A + bcc LoadActorTileIndex_OnCarryClear_9E65 ; CPU:$9E5A PRG:1E5A 90 09 + cmp #$7B ; CPU:$9E5C PRG:1E5C C9 7B + bcc LoadActorTileIndex_OnCarryClear_9E69 ; CPU:$9E5E PRG:1E5E 90 09 + iny ; CPU:$9E60 PRG:1E60 C8 + lda #$2F ; CPU:$9E61 PRG:1E61 A9 2F + bne LoadActorTileIndex_OnNonzero_9E6B ; CPU:$9E63 PRG:1E63 D0 06 +; ----------------------------------------------------------------------------- +; Routine: LoadActorTileIndex_OnCarryClear_9E65 +; Global: LoadActorTileIndex_OnCarryClear_9E65.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorTileIndex_OnCarryClear_9E65: + lda #$6D ; CPU:$9E65 PRG:1E65 A9 6D + bne LoadActorTileIndex_OnNonzero_9E6B ; CPU:$9E67 PRG:1E67 D0 02 +; ----------------------------------------------------------------------------- +; Routine: LoadActorTileIndex_OnCarryClear_9E69 +; Global: LoadActorTileIndex_OnCarryClear_9E69.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorTileIndex_OnCarryClear_9E69: + lda #$CE ; CPU:$9E69 PRG:1E69 A9 CE +; ----------------------------------------------------------------------------- +; Routine: LoadActorTileIndex_OnNonzero_9E6B +; Global: LoadActorTileIndex_OnNonzero_9E6B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorTileIndex_OnNonzero_9E6B: + jmp $9DD6 ; CPU:$9E6B PRG:1E6B 4C D6 9D +; ----------------------------------------------------------------------------- +; Routine: UpdateActorFacing +; Global: UpdateActorFacing.; called from $9DB8, $9E4D +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateActorFacing: + sta ScriptCounterC,x ; CPU:$9E6E PRG:1E6E 95 45 + lda ControllerDPad1,x ; CPU:$9E70 PRG:1E70 B5 F6 + eor #$03 ; CPU:$9E72 PRG:1E72 49 03 + sta ControllerDPad1,x ; CPU:$9E74 PRG:1E74 95 F6 + sta ControllerFaceButtons1,x ; CPU:$9E76 PRG:1E76 95 F8 + ldy #$41 ; CPU:$9E78 PRG:1E78 A0 41 + lda #$F1 ; CPU:$9E7A PRG:1E7A A9 F1 + jmp $9A24 ; CPU:$9E7C PRG:1E7C 4C 24 9A +; ----------------------------------------------------------------------------- +; Routine: QueueNametableWrite +; Global: Queue a nametable write described by a two-byte descriptor and advance the write pointer. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueNametableWrite: + sta $0351 ; CPU:$9E7F PRG:1E7F 8D 51 03 + lda SourcePointerLo ; CPU:$9E82 PRG:1E82 A5 10 + pha ; CPU:$9E84 PRG:1E84 48 + ldx #$04 ; CPU:$9E85 PRG:1E85 A2 04 +; ----------------------------------------------------------------------------- +; Routine: QueueNametableWrite_OnNonzero_9E87 +; Global: QueueNametableWrite_OnNonzero_9E87.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueNametableWrite_OnNonzero_9E87: + ldy #$0F ; CPU:$9E87 PRG:1E87 A0 0F +; ----------------------------------------------------------------------------- +; Routine: QueueNametableWrite_OnNonnegative_9E89 +; Global: QueueNametableWrite_OnNonnegative_9E89.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +QueueNametableWrite_OnNonnegative_9E89: + lda (SourcePointerLo),y ; CPU:$9E89 PRG:1E89 B1 10 + sta $0097,y ; CPU:$9E8B PRG:1E8B 99 97 00 + dey ; CPU:$9E8E PRG:1E8E 88 + bpl QueueNametableWrite_OnNonnegative_9E89 ; CPU:$9E8F PRG:1E8F 10 F8 + ldy #$00 ; CPU:$9E91 PRG:1E91 A0 00 + lda ZpA3 ; CPU:$9E93 PRG:1E93 A5 A3 + sta (SourcePointerLo),y ; CPU:$9E95 PRG:1E95 91 10 + iny ; CPU:$9E97 PRG:1E97 C8 + lda ZpA4 ; CPU:$9E98 PRG:1E98 A5 A4 + sta (SourcePointerLo),y ; CPU:$9E9A PRG:1E9A 91 10 + iny ; CPU:$9E9C PRG:1E9C C8 + lda ZpA5 ; CPU:$9E9D PRG:1E9D A5 A5 + eor #$40 ; CPU:$9E9F PRG:1E9F 49 40 + sta (SourcePointerLo),y ; CPU:$9EA1 PRG:1EA1 91 10 + iny ; CPU:$9EA3 PRG:1EA3 C8 + jsr $9F14 ; CPU:$9EA4 PRG:1EA4 20 14 9F + iny ; CPU:$9EA7 PRG:1EA7 C8 + lda Zp9F ; CPU:$9EA8 PRG:1EA8 A5 9F + sta (SourcePointerLo),y ; CPU:$9EAA PRG:1EAA 91 10 + iny ; CPU:$9EAC PRG:1EAC C8 + lda ZpA0 ; CPU:$9EAD PRG:1EAD A5 A0 + sta (SourcePointerLo),y ; CPU:$9EAF PRG:1EAF 91 10 + iny ; CPU:$9EB1 PRG:1EB1 C8 + lda ZpA1 ; CPU:$9EB2 PRG:1EB2 A5 A1 + eor #$40 ; CPU:$9EB4 PRG:1EB4 49 40 + sta (SourcePointerLo),y ; CPU:$9EB6 PRG:1EB6 91 10 + iny ; CPU:$9EB8 PRG:1EB8 C8 + jsr $9F14 ; CPU:$9EB9 PRG:1EB9 20 14 9F + iny ; CPU:$9EBC PRG:1EBC C8 + lda Zp9B ; CPU:$9EBD PRG:1EBD A5 9B + sta (SourcePointerLo),y ; CPU:$9EBF PRG:1EBF 91 10 + iny ; CPU:$9EC1 PRG:1EC1 C8 + lda Zp9C ; CPU:$9EC2 PRG:1EC2 A5 9C + sta (SourcePointerLo),y ; CPU:$9EC4 PRG:1EC4 91 10 + iny ; CPU:$9EC6 PRG:1EC6 C8 + lda Zp9D ; CPU:$9EC7 PRG:1EC7 A5 9D + eor #$40 ; CPU:$9EC9 PRG:1EC9 49 40 + sta (SourcePointerLo),y ; CPU:$9ECB PRG:1ECB 91 10 + iny ; CPU:$9ECD PRG:1ECD C8 + jsr $9F14 ; CPU:$9ECE PRG:1ECE 20 14 9F + iny ; CPU:$9ED1 PRG:1ED1 C8 + lda Zp97 ; CPU:$9ED2 PRG:1ED2 A5 97 + sta (SourcePointerLo),y ; CPU:$9ED4 PRG:1ED4 91 10 + iny ; CPU:$9ED6 PRG:1ED6 C8 + lda Zp98 ; CPU:$9ED7 PRG:1ED7 A5 98 + sta (SourcePointerLo),y ; CPU:$9ED9 PRG:1ED9 91 10 + iny ; CPU:$9EDB PRG:1EDB C8 + lda Zp99 ; CPU:$9EDC PRG:1EDC A5 99 + eor #$40 ; CPU:$9EDE PRG:1EDE 49 40 + sta (SourcePointerLo),y ; CPU:$9EE0 PRG:1EE0 91 10 + iny ; CPU:$9EE2 PRG:1EE2 C8 + jsr $9F14 ; CPU:$9EE3 PRG:1EE3 20 14 9F + lda SourcePointerLo ; CPU:$9EE6 PRG:1EE6 A5 10 + clc ; CPU:$9EE8 PRG:1EE8 18 + adc #$10 ; CPU:$9EE9 PRG:1EE9 69 10 + sta SourcePointerLo ; CPU:$9EEB PRG:1EEB 85 10 + dex ; CPU:$9EED PRG:1EED CA + bne QueueNametableWrite_OnNonzero_9E87 ; CPU:$9EEE PRG:1EEE D0 97 + pla ; CPU:$9EF0 PRG:1EF0 68 + sta SourcePointerLo ; CPU:$9EF1 PRG:1EF1 85 10 + rts ; CPU:$9EF3 PRG:1EF3 60 +; Pass 3: the 32-byte initial OAM block LoadOamShadowFromTable copies into $0300. +; ---- data $9EF4-$9F13 (32 bytes) ---- +OamShadowTemplate: + .byte $02, $02, $30, $27, $02, $37, $26, $0F, $02, $26, $2A, $38, $02, $10, $0F, $27 ; CPU:$9EF4 PRG:1EF4 02 02 30 27 02 37 26 0F 02 26 2A 38 02 10 0F 27 + .byte $02, $0F, $10, $30, $02, $10, $0F, $30, $02, $22, $30, $22, $02, $16, $30, $16 ; CPU:$9F04 PRG:1F04 02 0F 10 30 02 10 0F 30 02 22 30 22 02 16 30 16 +FlushNametableWrite: + lda $0351 ; CPU:$9F14 PRG:1F14 AD 51 03 + beq FlushNametableWrite_JoinBranchPaths_9F2A ; CPU:$9F17 PRG:1F17 F0 11 + lda (SourcePointerLo),y ; CPU:$9F19 PRG:1F19 B1 10 + eor $0350 ; CPU:$9F1B PRG:1F1B 4D 50 03 + bpl FlushNametableWrite_JoinBranchPaths_9F2A ; CPU:$9F1E PRG:1F1E 10 0A + dey ; CPU:$9F20 PRG:1F20 88 + dey ; CPU:$9F21 PRG:1F21 88 + dey ; CPU:$9F22 PRG:1F22 88 + lda #$F0 ; CPU:$9F23 PRG:1F23 A9 F0 + sta (SourcePointerLo),y ; CPU:$9F25 PRG:1F25 91 10 + iny ; CPU:$9F27 PRG:1F27 C8 + iny ; CPU:$9F28 PRG:1F28 C8 + iny ; CPU:$9F29 PRG:1F29 C8 +; ----------------------------------------------------------------------------- +; Routine: FlushNametableWrite_JoinBranchPaths_9F2A +; Global: FlushNametableWrite_JoinBranchPaths_9F2A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FlushNametableWrite_JoinBranchPaths_9F2A: + rts ; CPU:$9F2A PRG:1F2A 60 +; Pass 3: 16 x 16-bit handlers consumed by UpdateActorMovement; index = (token & $0F) * 2. Entry 1 holds $9FBB, one byte into a real jsr, so that slot is unused. +; ---- data $9F2B-$9F4A (32 bytes) ---- +SecondaryBytecodeHandlerTable: + .word $9FBA ; entry 0 -> $9FBA ; CPU:$9F2B PRG:1F2B BA 9F + .word $9FBB ; entry 1 -> $9FBB ; CPU:$9F2D PRG:1F2D BB 9F + .word $9FC2 ; entry 2 -> $9FC2 ; CPU:$9F2F PRG:1F2F C2 9F + .word $9FBA ; entry 3 -> $9FBA ; CPU:$9F31 PRG:1F31 BA 9F + .word $9FC9 ; entry 4 -> $9FC9 ; CPU:$9F33 PRG:1F33 C9 9F + .word $9FD7 ; entry 5 -> $9FD7 ; CPU:$9F35 PRG:1F35 D7 9F + .word $9FFA ; entry 6 -> $9FFA ; CPU:$9F37 PRG:1F37 FA 9F + .word $9FC9 ; entry 7 -> $9FC9 ; CPU:$9F39 PRG:1F39 C9 9F + .word $9FD0 ; entry 8 -> $9FD0 ; CPU:$9F3B PRG:1F3B D0 9F + .word $9FEF ; entry 9 -> $9FEF ; CPU:$9F3D PRG:1F3D EF 9F + .word $A012 ; entry 10 -> $A012 ; CPU:$9F3F PRG:1F3F 12 A0 + .word $9FD0 ; entry 11 -> $9FD0 ; CPU:$9F41 PRG:1F41 D0 9F + .word $9FBA ; entry 12 -> $9FBA ; CPU:$9F43 PRG:1F43 BA 9F + .word $9FBB ; entry 13 -> $9FBB ; CPU:$9F45 PRG:1F45 BB 9F + .word $9FC2 ; entry 14 -> $9FC2 ; CPU:$9F47 PRG:1F47 C2 9F + .word $9FBA ; entry 15 -> $9FBA ; CPU:$9F49 PRG:1F49 BA 9F +UpdateActorMovement: + lda #$01 ; CPU:$9F4B PRG:1F4B A9 01 + sta ActorIndex ; CPU:$9F4D PRG:1F4D 85 1E + jsr $9F54 ; CPU:$9F4F PRG:1F4F 20 54 9F + dec ActorIndex ; CPU:$9F52 PRG:1F52 C6 1E +; ----------------------------------------------------------------------------- +; Routine: MoveActorByOpcode +; Global: Move an actor by one opcode: read the displacement, apply it, and redraw. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByOpcode: + ldx ActorIndex ; CPU:$9F54 PRG:1F54 A6 1E + txa ; CPU:$9F56 PRG:1F56 8A + asl a ; CPU:$9F57 PRG:1F57 0A + asl a ; CPU:$9F58 PRG:1F58 0A + adc #$39 ; CPU:$9F59 PRG:1F59 69 39 + sta SourcePointerLo ; CPU:$9F5B PRG:1F5B 85 10 + lda #$00 ; CPU:$9F5D PRG:1F5D A9 00 + sta SourcePointerHi ; CPU:$9F5F PRG:1F5F 85 11 + lda $0326 ; CPU:$9F61 PRG:1F61 AD 26 03 + cmp #$01 ; CPU:$9F64 PRG:1F64 C9 01 + bne MoveActorByOpcode_JoinBranchPaths_9F7F ; CPU:$9F66 PRG:1F66 D0 17 + lda SoundVolume3,x ; CPU:$9F68 PRG:1F68 B5 82 + beq MoveActorByOpcode_JoinBranchPaths_9F7F ; CPU:$9F6A PRG:1F6A F0 13 + lda ControllerButtonMask,x ; CPU:$9F6C PRG:1F6C B5 F2 + and #$0F ; CPU:$9F6E PRG:1F6E 29 0F + bne MoveActorByOpcode_JoinBranchPaths_9F83 ; CPU:$9F70 PRG:1F70 D0 11 + lda SoundVolume1,x ; CPU:$9F72 PRG:1F72 B5 80 + beq MoveActorByOpcode_JoinBranchPaths_9F83 ; CPU:$9F74 PRG:1F74 F0 0D + sec ; CPU:$9F76 PRG:1F76 38 + sbc #$01 ; CPU:$9F77 PRG:1F77 E9 01 + sta SoundVolume1,x ; CPU:$9F79 PRG:1F79 95 80 + lda ControllerFaceButtons1,x ; CPU:$9F7B PRG:1F7B B5 F8 + bne MoveActorByOpcode_JoinBranchPaths_9F83 ; CPU:$9F7D PRG:1F7D D0 04 +; ----------------------------------------------------------------------------- +; Routine: MoveActorByOpcode_JoinBranchPaths_9F7F +; Global: MoveActorByOpcode_JoinBranchPaths_9F7F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByOpcode_JoinBranchPaths_9F7F: + lda ControllerButtonMask,x ; CPU:$9F7F PRG:1F7F B5 F2 + and #$0F ; CPU:$9F81 PRG:1F81 29 0F +; ----------------------------------------------------------------------------- +; Routine: MoveActorByOpcode_JoinBranchPaths_9F83 +; Global: MoveActorByOpcode_JoinBranchPaths_9F83.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByOpcode_JoinBranchPaths_9F83: + asl a ; CPU:$9F83 PRG:1F83 0A + tay ; CPU:$9F84 PRG:1F84 A8 + lda $9F2B,y ; CPU:$9F85 PRG:1F85 B9 2B 9F + sta BytecodeHandlerPointerLo ; CPU:$9F88 PRG:1F88 85 1C + lda $9F2C,y ; CPU:$9F8A PRG:1F8A B9 2C 9F + sta BytecodeHandlerPointerHi ; CPU:$9F8D PRG:1F8D 85 1D + jsr $9B05 ; CPU:$9F8F PRG:1F8F 20 05 9B + ldx ActorIndex ; CPU:$9F92 PRG:1F92 A6 1E + lda PlayerActionState,x ; CPU:$9F94 PRG:1F94 B5 F0 + cmp #$FF ; CPU:$9F96 PRG:1F96 C9 FF + beq MoveActorByOpcode_JoinBranchPaths_9FBA ; CPU:$9F98 PRG:1F98 F0 20 + ldy #$01 ; CPU:$9F9A PRG:1F9A A0 01 + lda (SourcePointerLo),y ; CPU:$9F9C PRG:1F9C B1 10 + cmp #$9C ; CPU:$9F9E PRG:1F9E C9 9C + bcc MoveActorByOpcode_OnCarryClear_9FAC ; CPU:$9FA0 PRG:1FA0 90 0A + dey ; CPU:$9FA2 PRG:1FA2 88 + lda #$FF ; CPU:$9FA3 PRG:1FA3 A9 FF + sta (SourcePointerLo),y ; CPU:$9FA5 PRG:1FA5 91 10 + iny ; CPU:$9FA7 PRG:1FA7 C8 + lda #$9B ; CPU:$9FA8 PRG:1FA8 A9 9B + bne MoveActorByOpcode_OnNonzero_9FB8 ; CPU:$9FAA PRG:1FAA D0 0C +; ----------------------------------------------------------------------------- +; Routine: MoveActorByOpcode_OnCarryClear_9FAC +; Global: MoveActorByOpcode_OnCarryClear_9FAC.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByOpcode_OnCarryClear_9FAC: + cmp #$39 ; CPU:$9FAC PRG:1FAC C9 39 + bcs MoveActorByOpcode_JoinBranchPaths_9FBA ; CPU:$9FAE PRG:1FAE B0 0A + dey ; CPU:$9FB0 PRG:1FB0 88 + lda #$00 ; CPU:$9FB1 PRG:1FB1 A9 00 + sta (SourcePointerLo),y ; CPU:$9FB3 PRG:1FB3 91 10 + iny ; CPU:$9FB5 PRG:1FB5 C8 + lda #$39 ; CPU:$9FB6 PRG:1FB6 A9 39 +; ----------------------------------------------------------------------------- +; Routine: MoveActorByOpcode_OnNonzero_9FB8 +; Global: MoveActorByOpcode_OnNonzero_9FB8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByOpcode_OnNonzero_9FB8: + sta (SourcePointerLo),y ; CPU:$9FB8 PRG:1FB8 91 10 +; ----------------------------------------------------------------------------- +; Routine: MoveActorByOpcode_JoinBranchPaths_9FBA +; Global: MoveActorByOpcode_JoinBranchPaths_9FBA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByOpcode_JoinBranchPaths_9FBA: + rts ; CPU:$9FBA PRG:1FBA 60 +; ----------------------------------------------------------------------------- +; Routine: MoveActorByOpcode_Return_9FBB +; Global: MoveActorByOpcode_Return_9FBB.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByOpcode_Return_9FBB: + jsr $A01D ; CPU:$9FBB PRG:1FBB 20 1D A0 + ldy #$02 ; CPU:$9FBE PRG:1FBE A0 02 + bne AddToNametableValue ; CPU:$9FC0 PRG:1FC0 D0 1D +; ----------------------------------------------------------------------------- +; Routine: MoveActorByOpcode_Continue_9FC2 +; Global: MoveActorByOpcode_Continue_9FC2.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByOpcode_Continue_9FC2: + jsr $A01D ; CPU:$9FC2 PRG:1FC2 20 1D A0 + ldy #$02 ; CPU:$9FC5 PRG:1FC5 A0 02 + bne SubtractFromNametableValue ; CPU:$9FC7 PRG:1FC7 D0 39 +; ----------------------------------------------------------------------------- +; Routine: MoveActorByOpcode_Continue_9FC9 +; Global: MoveActorByOpcode_Continue_9FC9.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByOpcode_Continue_9FC9: + jsr $A01D ; CPU:$9FC9 PRG:1FC9 20 1D A0 + ldy #$00 ; CPU:$9FCC PRG:1FCC A0 00 + beq AddToNametableValue ; CPU:$9FCE PRG:1FCE F0 0F +; ----------------------------------------------------------------------------- +; Routine: MoveActorByOpcode_Continue_9FD0 +; Global: MoveActorByOpcode_Continue_9FD0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByOpcode_Continue_9FD0: + jsr $A01D ; CPU:$9FD0 PRG:1FD0 20 1D A0 + ldy #$00 ; CPU:$9FD3 PRG:1FD3 A0 00 + beq SubtractFromNametableValue ; CPU:$9FD5 PRG:1FD5 F0 2B +; ----------------------------------------------------------------------------- +; Routine: MoveActorByOpcode_Continue_9FD7 +; Global: MoveActorByOpcode_Continue_9FD7.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +MoveActorByOpcode_Continue_9FD7: + jsr $A0F4 ; CPU:$9FD7 PRG:1FD7 20 F4 A0 + ldy #$00 ; CPU:$9FDA PRG:1FDA A0 00 + jsr $9FDF ; CPU:$9FDC PRG:1FDC 20 DF 9F +; ----------------------------------------------------------------------------- +; Routine: AddToNametableValue +; Global: AddToNametableValue.; called from $9FDC, $9FF7, $9FFF +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AddToNametableValue: + clc ; CPU:$9FDF PRG:1FDF 18 + lda (SourcePointerLo),y ; CPU:$9FE0 PRG:1FE0 B1 10 + adc DestinationPointerLo ; CPU:$9FE2 PRG:1FE2 65 12 + sta (SourcePointerLo),y ; CPU:$9FE4 PRG:1FE4 91 10 + iny ; CPU:$9FE6 PRG:1FE6 C8 + lda (SourcePointerLo),y ; CPU:$9FE7 PRG:1FE7 B1 10 + adc DestinationPointerHi ; CPU:$9FE9 PRG:1FE9 65 13 + sta (SourcePointerLo),y ; CPU:$9FEB PRG:1FEB 91 10 + iny ; CPU:$9FED PRG:1FED C8 + rts ; CPU:$9FEE PRG:1FEE 60 +; ----------------------------------------------------------------------------- +; Routine: AddToNametableValue_Return_9FEF +; Global: AddToNametableValue_Return_9FEF.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AddToNametableValue_Return_9FEF: + jsr $A0F4 ; CPU:$9FEF PRG:1FEF 20 F4 A0 + ldy #$00 ; CPU:$9FF2 PRG:1FF2 A0 00 + jsr $A002 ; CPU:$9FF4 PRG:1FF4 20 02 A0 + jmp $9FDF ; CPU:$9FF7 PRG:1FF7 4C DF 9F +; ----------------------------------------------------------------------------- +; Routine: AddToNametableValue_JumpNext_9FFA +; Global: AddToNametableValue_JumpNext_9FFA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AddToNametableValue_JumpNext_9FFA: + jsr $A0F4 ; CPU:$9FFA PRG:1FFA 20 F4 A0 + ldy #$00 ; CPU:$9FFD PRG:1FFD A0 00 + jsr $9FDF ; CPU:$9FFF PRG:1FFF 20 DF 9F +; ----------------------------------------------------------------------------- +; Routine: SubtractFromNametableValue +; Global: SubtractFromNametableValue.; called from $9FF4, $A017, $A01A +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SubtractFromNametableValue: + sec ; CPU:$A002 PRG:2002 38 + lda (SourcePointerLo),y ; CPU:$A003 PRG:2003 B1 10 + sbc DestinationPointerLo ; CPU:$A005 PRG:2005 E5 12 + sta (SourcePointerLo),y ; CPU:$A007 PRG:2007 91 10 + iny ; CPU:$A009 PRG:2009 C8 + lda (SourcePointerLo),y ; CPU:$A00A PRG:200A B1 10 + sbc DestinationPointerHi ; CPU:$A00C PRG:200C E5 13 + sta (SourcePointerLo),y ; CPU:$A00E PRG:200E 91 10 + iny ; CPU:$A010 PRG:2010 C8 + rts ; CPU:$A011 PRG:2011 60 +; ----------------------------------------------------------------------------- +; Routine: SubtractFromNametableValue_Return_A012 +; Global: SubtractFromNametableValue_Return_A012.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SubtractFromNametableValue_Return_A012: + jsr $A0F4 ; CPU:$A012 PRG:2012 20 F4 A0 + ldy #$00 ; CPU:$A015 PRG:2015 A0 00 + jsr $A002 ; CPU:$A017 PRG:2017 20 02 A0 + jmp $A002 ; CPU:$A01A PRG:201A 4C 02 A0 +; ----------------------------------------------------------------------------- +; Routine: ProcessBytecodeOpcode +; Global: Process one bytecode opcode against the actor record, advancing the script pointer. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ProcessBytecodeOpcode: + ldx ActorIndex ; CPU:$A01D PRG:201D A6 1E + lda Zp2F,x ; CPU:$A01F PRG:201F B5 2F + sta DestinationPointerLo ; CPU:$A021 PRG:2021 85 12 + clc ; CPU:$A023 PRG:2023 18 + adc #$64 ; CPU:$A024 PRG:2024 69 64 + sta VramBlockCountLo ; CPU:$A026 PRG:2026 85 14 + pha ; CPU:$A028 PRG:2028 48 + jsr $A0A5 ; CPU:$A029 PRG:2029 20 A5 A0 + lda Zp18 ; CPU:$A02C PRG:202C A5 18 + sta DestinationPointerLo ; CPU:$A02E PRG:202E 85 12 + lda Zp19 ; CPU:$A030 PRG:2030 A5 19 + sta DestinationPointerHi ; CPU:$A032 PRG:2032 85 13 + lda Zp4F,x ; CPU:$A034 PRG:2034 B5 4F + clc ; CPU:$A036 PRG:2036 18 + adc Zp2F,x ; CPU:$A037 PRG:2037 75 2F + sta Zp19 ; CPU:$A039 PRG:2039 85 19 + jsr $A085 ; CPU:$A03B PRG:203B 20 85 A0 + pla ; CPU:$A03E PRG:203E 68 + sec ; CPU:$A03F PRG:203F 38 + sbc VramBlockCountLo ; CPU:$A040 PRG:2040 E5 14 + sta VramBlockCountLo ; CPU:$A042 PRG:2042 85 14 + ldx ActorIndex ; CPU:$A044 PRG:2044 A6 1E + ldy PlayerPaletteIndex,x ; CPU:$A046 PRG:2046 B4 2A + ldx PlayerSpriteIndex1,y ; CPU:$A048 PRG:2048 B6 26 + lda $0324 ; CPU:$A04A PRG:204A AD 24 03 + beq ProcessBytecodeOpcode_JoinBranchPaths_A062 ; CPU:$A04D PRG:204D F0 13 + lda ActorIndex ; CPU:$A04F PRG:204F A5 1E + beq ProcessBytecodeOpcode_JoinBranchPaths_A062 ; CPU:$A051 PRG:2051 F0 0F + lda $0325 ; CPU:$A053 PRG:2053 AD 25 03 + sec ; CPU:$A056 PRG:2056 38 + sbc #$01 ; CPU:$A057 PRG:2057 E9 01 + asl a ; CPU:$A059 PRG:2059 0A + bcs ProcessBytecodeOpcode_OnCarrySet_A060 ; CPU:$A05A PRG:205A B0 04 + and #$F0 ; CPU:$A05C PRG:205C 29 F0 + bpl ProcessBytecodeOpcode_JoinBranchPaths_A062 ; CPU:$A05E PRG:205E 10 02 +; ----------------------------------------------------------------------------- +; Routine: ProcessBytecodeOpcode_OnCarrySet_A060 +; Global: ProcessBytecodeOpcode_OnCarrySet_A060.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ProcessBytecodeOpcode_OnCarrySet_A060: + lda #$7F ; CPU:$A060 PRG:2060 A9 7F +; ----------------------------------------------------------------------------- +; Routine: ProcessBytecodeOpcode_JoinBranchPaths_A062 +; Global: ProcessBytecodeOpcode_JoinBranchPaths_A062.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ProcessBytecodeOpcode_JoinBranchPaths_A062: + clc ; CPU:$A062 PRG:2062 18 + adc $BD28,x ; CPU:$A063 PRG:2063 7D 28 BD + sta DestinationPointerLo ; CPU:$A066 PRG:2066 85 12 + ldx ActorIndex ; CPU:$A068 PRG:2068 A6 1E + lda PlayerActiveFlag,x ; CPU:$A06A PRG:206A B5 78 + beq ProcessBytecodeOpcode_JoinBranchPaths_A07B ; CPU:$A06C PRG:206C F0 0D + lda DestinationPointerLo ; CPU:$A06E PRG:206E A5 12 + clc ; CPU:$A070 PRG:2070 18 + adc #$32 ; CPU:$A071 PRG:2071 69 32 + sta DestinationPointerLo ; CPU:$A073 PRG:2073 85 12 + bcc ProcessBytecodeOpcode_JoinBranchPaths_A07B ; CPU:$A075 PRG:2075 90 04 + lda #$FF ; CPU:$A077 PRG:2077 A9 FF + sta DestinationPointerLo ; CPU:$A079 PRG:2079 85 12 +; ----------------------------------------------------------------------------- +; Routine: ProcessBytecodeOpcode_JoinBranchPaths_A07B +; Global: ProcessBytecodeOpcode_JoinBranchPaths_A07B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ProcessBytecodeOpcode_JoinBranchPaths_A07B: + jsr $A0A5 ; CPU:$A07B PRG:207B 20 A5 A0 + lda #$32 ; CPU:$A07E PRG:207E A9 32 + sta Zp16 ; CPU:$A080 PRG:2080 85 16 + jmp $A0C6 ; CPU:$A082 PRG:2082 4C C6 A0 +; ----------------------------------------------------------------------------- +; Routine: ComputeBytecodeOffset +; Global: ComputeBytecodeOffset.; called from $A03B +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeBytecodeOffset: + lda #$00 ; CPU:$A085 PRG:2085 A9 00 + sta Zp18 ; CPU:$A087 PRG:2087 85 18 + ldy #$08 ; CPU:$A089 PRG:2089 A0 08 +; ----------------------------------------------------------------------------- +; Routine: ComputeBytecodeOffset_OnNonzero_A08B +; Global: ComputeBytecodeOffset_OnNonzero_A08B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeBytecodeOffset_OnNonzero_A08B: + lsr Zp19 ; CPU:$A08B PRG:208B 46 19 + ror Zp18 ; CPU:$A08D PRG:208D 66 18 + sec ; CPU:$A08F PRG:208F 38 + lda DestinationPointerLo ; CPU:$A090 PRG:2090 A5 12 + sbc Zp18 ; CPU:$A092 PRG:2092 E5 18 + tax ; CPU:$A094 PRG:2094 AA + lda DestinationPointerHi ; CPU:$A095 PRG:2095 A5 13 + sbc Zp19 ; CPU:$A097 PRG:2097 E5 19 + bcc ComputeBytecodeOffset_OnCarryClear_A09F ; CPU:$A099 PRG:2099 90 04 + stx DestinationPointerLo ; CPU:$A09B PRG:209B 86 12 + sta DestinationPointerHi ; CPU:$A09D PRG:209D 85 13 +; ----------------------------------------------------------------------------- +; Routine: ComputeBytecodeOffset_OnCarryClear_A09F +; Global: ComputeBytecodeOffset_OnCarryClear_A09F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeBytecodeOffset_OnCarryClear_A09F: + rol VramBlockCountLo ; CPU:$A09F PRG:209F 26 14 + dey ; CPU:$A0A1 PRG:20A1 88 + bne ComputeBytecodeOffset_OnNonzero_A08B ; CPU:$A0A2 PRG:20A2 D0 E7 + rts ; CPU:$A0A4 PRG:20A4 60 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeAccumulator +; Global: ResetBytecodeAccumulator.; called from $83B3, $A029, $A07B +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeAccumulator: + lda #$00 ; CPU:$A0A5 PRG:20A5 A9 00 + sta Zp18 ; CPU:$A0A7 PRG:20A7 85 18 + sta Zp19 ; CPU:$A0A9 PRG:20A9 85 19 + ldy #$08 ; CPU:$A0AB PRG:20AB A0 08 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeAccumulator_OnNonzero_A0AD +; Global: ResetBytecodeAccumulator_OnNonzero_A0AD.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeAccumulator_OnNonzero_A0AD: + asl Zp18 ; CPU:$A0AD PRG:20AD 06 18 + rol Zp19 ; CPU:$A0AF PRG:20AF 26 19 + asl DestinationPointerLo ; CPU:$A0B1 PRG:20B1 06 12 + bcc ResetBytecodeAccumulator_OnCarryClear_A0C2 ; CPU:$A0B3 PRG:20B3 90 0D + clc ; CPU:$A0B5 PRG:20B5 18 + lda Zp18 ; CPU:$A0B6 PRG:20B6 A5 18 + adc VramBlockCountLo ; CPU:$A0B8 PRG:20B8 65 14 + sta Zp18 ; CPU:$A0BA PRG:20BA 85 18 + lda Zp19 ; CPU:$A0BC PRG:20BC A5 19 + adc #$00 ; CPU:$A0BE PRG:20BE 69 00 + sta Zp19 ; CPU:$A0C0 PRG:20C0 85 19 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeAccumulator_OnCarryClear_A0C2 +; Global: ResetBytecodeAccumulator_OnCarryClear_A0C2.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeAccumulator_OnCarryClear_A0C2: + dey ; CPU:$A0C2 PRG:20C2 88 + bne ResetBytecodeAccumulator_OnNonzero_A0AD ; CPU:$A0C3 PRG:20C3 D0 E8 + rts ; CPU:$A0C5 PRG:20C5 60 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeAccumulatorAlt +; Global: ResetBytecodeAccumulatorAlt.; called from $A082, $A879, $A8B6 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeAccumulatorAlt: + lda #$00 ; CPU:$A0C6 PRG:20C6 A9 00 + sta VramBlockCountLo ; CPU:$A0C8 PRG:20C8 85 14 + sta CollisionFlagBits ; CPU:$A0CA PRG:20CA 85 15 + ldy #$10 ; CPU:$A0CC PRG:20CC A0 10 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeAccumulatorAlt_OnNonzero_A0CE +; Global: ResetBytecodeAccumulatorAlt_OnNonzero_A0CE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeAccumulatorAlt_OnNonzero_A0CE: + lsr Zp16 ; CPU:$A0CE PRG:20CE 46 16 + ror CollisionFlagBits ; CPU:$A0D0 PRG:20D0 66 15 + ror VramBlockCountLo ; CPU:$A0D2 PRG:20D2 66 14 + sec ; CPU:$A0D4 PRG:20D4 38 + lda Zp18 ; CPU:$A0D5 PRG:20D5 A5 18 + sbc VramBlockCountLo ; CPU:$A0D7 PRG:20D7 E5 14 + tax ; CPU:$A0D9 PRG:20D9 AA + lda Zp19 ; CPU:$A0DA PRG:20DA A5 19 + sbc CollisionFlagBits ; CPU:$A0DC PRG:20DC E5 15 + sta Zp17 ; CPU:$A0DE PRG:20DE 85 17 + lda #$00 ; CPU:$A0E0 PRG:20E0 A9 00 + sbc Zp16 ; CPU:$A0E2 PRG:20E2 E5 16 + bcc ResetBytecodeAccumulatorAlt_OnCarryClear_A0EC ; CPU:$A0E4 PRG:20E4 90 06 + stx Zp18 ; CPU:$A0E6 PRG:20E6 86 18 + lda Zp17 ; CPU:$A0E8 PRG:20E8 A5 17 + sta Zp19 ; CPU:$A0EA PRG:20EA 85 19 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeAccumulatorAlt_OnCarryClear_A0EC +; Global: ResetBytecodeAccumulatorAlt_OnCarryClear_A0EC.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeAccumulatorAlt_OnCarryClear_A0EC: + rol DestinationPointerLo ; CPU:$A0EC PRG:20EC 26 12 + rol DestinationPointerHi ; CPU:$A0EE PRG:20EE 26 13 + dey ; CPU:$A0F0 PRG:20F0 88 + bne ResetBytecodeAccumulatorAlt_OnNonzero_A0CE ; CPU:$A0F1 PRG:20F1 D0 DB + rts ; CPU:$A0F3 PRG:20F3 60 +; ----------------------------------------------------------------------------- +; Routine: AdvanceBytecodeProgram +; Global: AdvanceBytecodeProgram.; called from $9FD7, $9FEF, $9FFA, $A012 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceBytecodeProgram: + jsr $A01D ; CPU:$A0F4 PRG:20F4 20 1D A0 + lda #$B5 ; CPU:$A0F7 PRG:20F7 A9 B5 + sta Zp18 ; CPU:$A0F9 PRG:20F9 85 18 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeStateAlt +; Global: ResetBytecodeStateAlt.; called from $8CC3, $8CDC +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeStateAlt: + lda #$00 ; CPU:$A0FB PRG:20FB A9 00 + sta Zp19 ; CPU:$A0FD PRG:20FD 85 19 + sta VramBlockCountLo ; CPU:$A0FF PRG:20FF 85 14 + sta CollisionFlagBits ; CPU:$A101 PRG:2101 85 15 + ldy #$08 ; CPU:$A103 PRG:2103 A0 08 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeStateAlt_OnNonzero_A105 +; Global: ResetBytecodeStateAlt_OnNonzero_A105.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeStateAlt_OnNonzero_A105: + asl Zp19 ; CPU:$A105 PRG:2105 06 19 + rol VramBlockCountLo ; CPU:$A107 PRG:2107 26 14 + rol CollisionFlagBits ; CPU:$A109 PRG:2109 26 15 + asl Zp18 ; CPU:$A10B PRG:210B 06 18 + bcc ResetBytecodeStateAlt_OnCarryClear_A122 ; CPU:$A10D PRG:210D 90 13 + clc ; CPU:$A10F PRG:210F 18 + lda Zp19 ; CPU:$A110 PRG:2110 A5 19 + adc DestinationPointerLo ; CPU:$A112 PRG:2112 65 12 + sta Zp19 ; CPU:$A114 PRG:2114 85 19 + lda VramBlockCountLo ; CPU:$A116 PRG:2116 A5 14 + adc DestinationPointerHi ; CPU:$A118 PRG:2118 65 13 + sta VramBlockCountLo ; CPU:$A11A PRG:211A 85 14 + lda CollisionFlagBits ; CPU:$A11C PRG:211C A5 15 + adc #$00 ; CPU:$A11E PRG:211E 69 00 + sta CollisionFlagBits ; CPU:$A120 PRG:2120 85 15 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodeStateAlt_OnCarryClear_A122 +; Global: ResetBytecodeStateAlt_OnCarryClear_A122.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodeStateAlt_OnCarryClear_A122: + dey ; CPU:$A122 PRG:2122 88 + bne ResetBytecodeStateAlt_OnNonzero_A105 ; CPU:$A123 PRG:2123 D0 E0 + lda VramBlockCountLo ; CPU:$A125 PRG:2125 A5 14 + sta DestinationPointerLo ; CPU:$A127 PRG:2127 85 12 + lda CollisionFlagBits ; CPU:$A129 PRG:2129 A5 15 + sta DestinationPointerHi ; CPU:$A12B PRG:212B 85 13 + rts ; CPU:$A12D PRG:212D 60 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorTileRow +; Global: ComputeActorTileRow.; called from $87A7 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorTileRow: + lda Zp3B ; CPU:$A12E PRG:212E A5 3B + clc ; CPU:$A130 PRG:2130 18 + adc Zp3F ; CPU:$A131 PRG:2131 65 3F + lda PlayerPosYLo1 ; CPU:$A133 PRG:2133 A5 3C + adc PlayerPosYLo2 ; CPU:$A135 PRG:2135 65 40 + sta SourcePointerLo ; CPU:$A137 PRG:2137 85 10 + lda #$00 ; CPU:$A139 PRG:2139 A9 00 + rol a ; CPU:$A13B PRG:213B 2A + sta SourcePointerHi ; CPU:$A13C PRG:213C 85 11 + lda SourcePointerLo ; CPU:$A13E PRG:213E A5 10 + sec ; CPU:$A140 PRG:2140 38 + sbc #$D0 ; CPU:$A141 PRG:2141 E9 D0 + sta SourcePointerLo ; CPU:$A143 PRG:2143 85 10 + lda SourcePointerHi ; CPU:$A145 PRG:2145 A5 11 + sbc #$00 ; CPU:$A147 PRG:2147 E9 00 + bpl ComputeActorTileRow_OnNonnegative_A14F ; CPU:$A149 PRG:2149 10 04 + lda #$00 ; CPU:$A14B PRG:214B A9 00 + beq ComputeActorTileRow_JoinBranchPaths_A157 ; CPU:$A14D PRG:214D F0 08 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorTileRow_OnNonnegative_A14F +; Global: ComputeActorTileRow_OnNonnegative_A14F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorTileRow_OnNonnegative_A14F: + lda SourcePointerLo ; CPU:$A14F PRG:214F A5 10 + cmp #$70 ; CPU:$A151 PRG:2151 C9 70 + bcc ComputeActorTileRow_JoinBranchPaths_A157 ; CPU:$A153 PRG:2153 90 02 + lda #$70 ; CPU:$A155 PRG:2155 A9 70 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorTileRow_JoinBranchPaths_A157 +; Global: ComputeActorTileRow_JoinBranchPaths_A157.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorTileRow_JoinBranchPaths_A157: + clc ; CPU:$A157 PRG:2157 18 + adc #$50 ; CPU:$A158 PRG:2158 69 50 + sta PpuScrollX ; CPU:$A15A PRG:215A 85 FE + rts ; CPU:$A15C PRG:215C 60 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodePointers +; Global: ResetBytecodePointers.; called from $9D6D +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodePointers: + lda #$00 ; CPU:$A15D PRG:215D A9 00 + sta BytecodeStreamPointerLo ; CPU:$A15F PRG:215F 85 1A + sta CollisionFlagBits ; CPU:$A161 PRG:2161 85 15 + ldy #$08 ; CPU:$A163 PRG:2163 A0 08 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodePointers_OnNonzero_A165 +; Global: ResetBytecodePointers_OnNonzero_A165.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodePointers_OnNonzero_A165: + lsr BytecodeStreamPointerHi ; CPU:$A165 PRG:2165 46 1B + ror BytecodeStreamPointerLo ; CPU:$A167 PRG:2167 66 1A + lda VramBlockCountLo ; CPU:$A169 PRG:2169 A5 14 + sec ; CPU:$A16B PRG:216B 38 + sbc BytecodeStreamPointerLo ; CPU:$A16C PRG:216C E5 1A + tax ; CPU:$A16E PRG:216E AA + lda CollisionFlagBits ; CPU:$A16F PRG:216F A5 15 + sbc BytecodeStreamPointerHi ; CPU:$A171 PRG:2171 E5 1B + bcc ResetBytecodePointers_OnCarryClear_A179 ; CPU:$A173 PRG:2173 90 04 + sta CollisionFlagBits ; CPU:$A175 PRG:2175 85 15 + stx VramBlockCountLo ; CPU:$A177 PRG:2177 86 14 +; ----------------------------------------------------------------------------- +; Routine: ResetBytecodePointers_OnCarryClear_A179 +; Global: ResetBytecodePointers_OnCarryClear_A179.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ResetBytecodePointers_OnCarryClear_A179: + rol Zp18 ; CPU:$A179 PRG:2179 26 18 + dey ; CPU:$A17B PRG:217B 88 + bne ResetBytecodePointers_OnNonzero_A165 ; CPU:$A17C PRG:217C D0 E7 + rts ; CPU:$A17E PRG:217E 60 +; ----------------------------------------------------------------------------- +; Routine: RunActorScript +; Global: Run an actor script: set up the source/destination pointers, then walk the descriptor stream. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunActorScript: + lda #$04 ; CPU:$A17F PRG:217F A9 04 + sta $034C ; CPU:$A181 PRG:2181 8D 4C 03 + lda #$04 ; CPU:$A184 PRG:2184 A9 04 + sta $034D ; CPU:$A186 PRG:2186 8D 4D 03 + lda #$80 ; CPU:$A189 PRG:2189 A9 80 + sta $034E ; CPU:$A18B PRG:218B 8D 4E 03 + lda #$B9 ; CPU:$A18E PRG:218E A9 B9 + sta $034F ; CPU:$A190 PRG:2190 8D 4F 03 + lda #$A0 ; CPU:$A193 PRG:2193 A9 A0 + sta SourcePointerLo ; CPU:$A195 PRG:2195 85 10 + lda #$02 ; CPU:$A197 PRG:2197 A9 02 + sta SourcePointerHi ; CPU:$A199 PRG:2199 85 11 + lda PpuScrollX ; CPU:$A19B PRG:219B A5 FE + cmp #$90 ; CPU:$A19D PRG:219D C9 90 + lda #$C8 ; CPU:$A19F PRG:219F A9 C8 + bcs RunActorScript_OnCarrySet_A1A5 ; CPU:$A1A1 PRG:21A1 B0 02 + lda #$28 ; CPU:$A1A3 PRG:21A3 A9 28 +; ----------------------------------------------------------------------------- +; Routine: RunActorScript_OnCarrySet_A1A5 +; Global: RunActorScript_OnCarrySet_A1A5.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunActorScript_OnCarrySet_A1A5: + sta BytecodeStreamPointerLo ; CPU:$A1A5 PRG:21A5 85 1A + lda #$80 ; CPU:$A1A7 PRG:21A7 A9 80 + sta BytecodeStreamPointerHi ; CPU:$A1A9 PRG:21A9 85 1B + lda #$00 ; CPU:$A1AB PRG:21AB A9 00 + rol a ; CPU:$A1AD PRG:21AD 2A + tax ; CPU:$A1AE PRG:21AE AA + ror a ; CPU:$A1AF PRG:21AF 6A + ror a ; CPU:$A1B0 PRG:21B0 6A + sta $0350 ; CPU:$A1B1 PRG:21B1 8D 50 03 + ror a ; CPU:$A1B4 PRG:21B4 6A + eor #$40 ; CPU:$A1B5 PRG:21B5 49 40 + sta BytecodeHandlerPointerLo ; CPU:$A1B7 PRG:21B7 85 1C + lda Zp88,x ; CPU:$A1B9 PRG:21B9 B5 88 + beq RunActorScript_OnZero_A1C3 ; CPU:$A1BB PRG:21BB F0 06 + lda BytecodeHandlerPointerLo ; CPU:$A1BD PRG:21BD A5 1C + eor #$40 ; CPU:$A1BF PRG:21BF 49 40 + sta BytecodeHandlerPointerLo ; CPU:$A1C1 PRG:21C1 85 1C +; ----------------------------------------------------------------------------- +; Routine: RunActorScript_OnZero_A1C3 +; Global: RunActorScript_OnZero_A1C3.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunActorScript_OnZero_A1C3: + lda PlayerPaletteIndex,x ; CPU:$A1C3 PRG:21C3 B5 2A + eor #$01 ; CPU:$A1C5 PRG:21C5 49 01 + sta Zp2C ; CPU:$A1C7 PRG:21C7 85 2C + tay ; CPU:$A1C9 PRG:21C9 A8 + lda $0026,y ; CPU:$A1CA PRG:21CA B9 26 00 + jsr $8CB8 ; CPU:$A1CD PRG:21CD 20 B8 8C + lda Zp16 ; CPU:$A1D0 PRG:21D0 A5 16 + sta VramBlockCountLo ; CPU:$A1D2 PRG:21D2 85 14 + lda Zp17 ; CPU:$A1D4 PRG:21D4 A5 17 + sta CollisionFlagBits ; CPU:$A1D6 PRG:21D6 85 15 + lda BytecodeStreamPointerHi ; CPU:$A1D8 PRG:21D8 A5 1B + sec ; CPU:$A1DA PRG:21DA 38 + sbc PpuScrollX ; CPU:$A1DB PRG:21DB E5 FE + sta BytecodeStreamPointerHi ; CPU:$A1DD PRG:21DD 85 1B + lda #$03 ; CPU:$A1DF PRG:21DF A9 03 + sta Zp16 ; CPU:$A1E1 PRG:21E1 85 16 +; ----------------------------------------------------------------------------- +; Routine: RunActorScript_OnNonnegative_A1E3 +; Global: RunActorScript_OnNonnegative_A1E3.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunActorScript_OnNonnegative_A1E3: + lda BytecodeStreamPointerHi ; CPU:$A1E3 PRG:21E3 A5 1B + sta Zp19 ; CPU:$A1E5 PRG:21E5 85 19 + ldy #$00 ; CPU:$A1E7 PRG:21E7 A0 00 + lda (VramBlockCountLo),y ; CPU:$A1E9 PRG:21E9 B1 14 + sta Zp18 ; CPU:$A1EB PRG:21EB 85 18 + lda #$03 ; CPU:$A1ED PRG:21ED A9 03 + sta Zp17 ; CPU:$A1EF PRG:21EF 85 17 +; ----------------------------------------------------------------------------- +; Routine: RunActorScript_OnNonnegative_A1F1 +; Global: RunActorScript_OnNonnegative_A1F1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunActorScript_OnNonnegative_A1F1: + ldy #$00 ; CPU:$A1F1 PRG:21F1 A0 00 + lda BytecodeStreamPointerLo ; CPU:$A1F3 PRG:21F3 A5 1A + sta (SourcePointerLo),y ; CPU:$A1F5 PRG:21F5 91 10 + lda (DestinationPointerLo),y ; CPU:$A1F7 PRG:21F7 B1 12 + cmp #$FF ; CPU:$A1F9 PRG:21F9 C9 FF + bne RunActorScript_OnNonzero_A201 ; CPU:$A1FB PRG:21FB D0 04 + lda #$F0 ; CPU:$A1FD PRG:21FD A9 F0 + sta (SourcePointerLo),y ; CPU:$A1FF PRG:21FF 91 10 +; ----------------------------------------------------------------------------- +; Routine: RunActorScript_OnNonzero_A201 +; Global: RunActorScript_OnNonzero_A201.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunActorScript_OnNonzero_A201: + iny ; CPU:$A201 PRG:2201 C8 + sta (SourcePointerLo),y ; CPU:$A202 PRG:2202 91 10 + lda Zp18 ; CPU:$A204 PRG:2204 A5 18 + and #$C0 ; CPU:$A206 PRG:2206 29 C0 + asl Zp18 ; CPU:$A208 PRG:2208 06 18 + asl Zp18 ; CPU:$A20A PRG:220A 06 18 + iny ; CPU:$A20C PRG:220C C8 + ora #$02 ; CPU:$A20D PRG:220D 09 02 + sta (SourcePointerLo),y ; CPU:$A20F PRG:220F 91 10 + iny ; CPU:$A211 PRG:2211 C8 + lda Zp19 ; CPU:$A212 PRG:2212 A5 19 + sta (SourcePointerLo),y ; CPU:$A214 PRG:2214 91 10 + clc ; CPU:$A216 PRG:2216 18 + adc #$08 ; CPU:$A217 PRG:2217 69 08 + sta Zp19 ; CPU:$A219 PRG:2219 85 19 + lda SourcePointerLo ; CPU:$A21B PRG:221B A5 10 + clc ; CPU:$A21D PRG:221D 18 + adc #$04 ; CPU:$A21E PRG:221E 69 04 + sta SourcePointerLo ; CPU:$A220 PRG:2220 85 10 + jsr $ACC9 ; CPU:$A222 PRG:2222 20 C9 AC + dec Zp17 ; CPU:$A225 PRG:2225 C6 17 + bpl RunActorScript_OnNonnegative_A1F1 ; CPU:$A227 PRG:2227 10 C8 + lda BytecodeStreamPointerLo ; CPU:$A229 PRG:2229 A5 1A + clc ; CPU:$A22B PRG:222B 18 + adc #$08 ; CPU:$A22C PRG:222C 69 08 + sta BytecodeStreamPointerLo ; CPU:$A22E PRG:222E 85 1A + jsr $ACD7 ; CPU:$A230 PRG:2230 20 D7 AC + dec Zp16 ; CPU:$A233 PRG:2233 C6 16 + bpl RunActorScript_OnNonnegative_A1E3 ; CPU:$A235 PRG:2235 10 AC + lda BytecodeHandlerPointerLo ; CPU:$A237 PRG:2237 A5 1C + beq RunActorScript_OnZero_A246 ; CPU:$A239 PRG:2239 F0 0B + lda #$A0 ; CPU:$A23B PRG:223B A9 A0 + sta SourcePointerLo ; CPU:$A23D PRG:223D 85 10 + lda #$02 ; CPU:$A23F PRG:223F A9 02 + sta SourcePointerHi ; CPU:$A241 PRG:2241 85 11 + jsr $9E7F ; CPU:$A243 PRG:2243 20 7F 9E +; ----------------------------------------------------------------------------- +; Routine: RunActorScript_OnZero_A246 +; Global: RunActorScript_OnZero_A246.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RunActorScript_OnZero_A246: + lda #$18 ; CPU:$A246 PRG:2246 A9 18 + sta DestinationPointerLo ; CPU:$A248 PRG:2248 85 12 + lda #$03 ; CPU:$A24A PRG:224A A9 03 + sta DestinationPointerHi ; CPU:$A24C PRG:224C 85 13 + ldy Zp2C ; CPU:$A24E PRG:224E A4 2C +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigByte +; Global: Read one byte of the actor configuration block, scaled by four. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigByte: + lda $0026,y ; CPU:$A250 PRG:2250 B9 26 00 +; ----------------------------------------------------------------------------- +; Routine: ComputeActorConfigOffset +; Global: Compute the byte offset of an actor configuration record. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeActorConfigOffset: + asl a ; CPU:$A253 PRG:2253 0A + asl a ; CPU:$A254 PRG:2254 0A + adc #$44 ; CPU:$A255 PRG:2255 69 44 + sta SourcePointerLo ; CPU:$A257 PRG:2257 85 10 + lda #$00 ; CPU:$A259 PRG:2259 A9 00 + adc #$AB ; CPU:$A25B PRG:225B 69 AB + sta SourcePointerHi ; CPU:$A25D PRG:225D 85 11 +; ----------------------------------------------------------------------------- +; Routine: CopyConfigBytes +; Global: CopyConfigBytes.; called from $AB78 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CopyConfigBytes: + ldy #$03 ; CPU:$A25F PRG:225F A0 03 +; ----------------------------------------------------------------------------- +; Routine: CopyConfigBytes_OnNonnegative_A261 +; Global: CopyConfigBytes_OnNonnegative_A261.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CopyConfigBytes_OnNonnegative_A261: + lda (SourcePointerLo),y ; CPU:$A261 PRG:2261 B1 10 + sta (DestinationPointerLo),y ; CPU:$A263 PRG:2263 91 12 + dey ; CPU:$A265 PRG:2265 88 + bpl CopyConfigBytes_OnNonnegative_A261 ; CPU:$A266 PRG:2266 10 F9 + lda DestinationPointerLo ; CPU:$A268 PRG:2268 A5 12 + sec ; CPU:$A26A PRG:226A 38 + sbc #$04 ; CPU:$A26B PRG:226B E9 04 + sta DestinationPointerLo ; CPU:$A26D PRG:226D 85 12 + rts ; CPU:$A26F PRG:226F 60 +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigRecord +; Global: LoadActorConfigRecord.; called from $879E +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigRecord: + lda #$04 ; CPU:$A270 PRG:2270 A9 04 + sta ActorFieldOffset ; CPU:$A272 PRG:2272 85 23 + ldx #$01 ; CPU:$A274 PRG:2274 A2 01 + stx ActorSlotOffsetHi ; CPU:$A276 PRG:2276 86 22 + dex ; CPU:$A278 PRG:2278 CA + stx ActorIndex ; CPU:$A279 PRG:2279 86 1E + ldy #$00 ; CPU:$A27B PRG:227B A0 00 + sty ActorSlotOffset ; CPU:$A27D PRG:227D 84 21 + bit ControllerButtonsPrev ; CPU:$A27F PRG:227F 24 F4 + bvs LoadActorConfigRecord_JoinBranchPaths_A28D ; CPU:$A281 PRG:2281 70 0A + bit ControllerButtonMask ; CPU:$A283 PRG:2283 24 F2 + bvc LoadActorConfigRecord_JoinBranchPaths_A28D ; CPU:$A285 PRG:2285 50 06 + jsr $A2C9 ; CPU:$A287 PRG:2287 20 C9 A2 + jmp $A298 ; CPU:$A28A PRG:228A 4C 98 A2 +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigRecord_JoinBranchPaths_A28D +; Global: LoadActorConfigRecord_JoinBranchPaths_A28D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigRecord_JoinBranchPaths_A28D: + bit ControllerButtonsPrev ; CPU:$A28D PRG:228D 24 F4 + bmi CompareConfigValue ; CPU:$A28F PRG:228F 30 07 + bit ControllerButtonMask ; CPU:$A291 PRG:2291 24 F2 + bpl CompareConfigValue ; CPU:$A293 PRG:2293 10 03 + jsr $A338 ; CPU:$A295 PRG:2295 20 38 A3 +; ----------------------------------------------------------------------------- +; Routine: CompareConfigValue +; Global: CompareConfigValue.; called from $A28A +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareConfigValue: + lda PlayerActionState2 ; CPU:$A298 PRG:2298 A5 F1 + cmp #$F5 ; CPU:$A29A PRG:229A C9 F5 + beq ReturnFromConfigLoad ; CPU:$A29C PRG:229C F0 2A + cmp #$FB ; CPU:$A29E PRG:229E C9 FB + beq ReturnFromConfigLoad ; CPU:$A2A0 PRG:22A0 F0 26 + ldx #$00 ; CPU:$A2A2 PRG:22A2 A2 00 + stx ActorSlotOffsetHi ; CPU:$A2A4 PRG:22A4 86 22 + stx ActorFieldOffset ; CPU:$A2A6 PRG:22A6 86 23 + inx ; CPU:$A2A8 PRG:22A8 E8 + stx ActorIndex ; CPU:$A2A9 PRG:22A9 86 1E + ldy #$04 ; CPU:$A2AB PRG:22AB A0 04 + sty ActorSlotOffset ; CPU:$A2AD PRG:22AD 84 21 + bit ControllerButtonsPrev2 ; CPU:$A2AF PRG:22AF 24 F5 + bvs CompareConfigValue_JoinBranchPaths_A2BD ; CPU:$A2B1 PRG:22B1 70 0A + bit ControllerButtonMask2 ; CPU:$A2B3 PRG:22B3 24 F3 + bvc CompareConfigValue_JoinBranchPaths_A2BD ; CPU:$A2B5 PRG:22B5 50 06 + jsr $A2C9 ; CPU:$A2B7 PRG:22B7 20 C9 A2 + jmp $A2C8 ; CPU:$A2BA PRG:22BA 4C C8 A2 +; ----------------------------------------------------------------------------- +; Routine: CompareConfigValue_JoinBranchPaths_A2BD +; Global: CompareConfigValue_JoinBranchPaths_A2BD.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareConfigValue_JoinBranchPaths_A2BD: + bit ControllerButtonsPrev2 ; CPU:$A2BD PRG:22BD 24 F5 + bmi ReturnFromConfigLoad ; CPU:$A2BF PRG:22BF 30 07 + bit ControllerButtonMask2 ; CPU:$A2C1 PRG:22C1 24 F3 + bpl ReturnFromConfigLoad ; CPU:$A2C3 PRG:22C3 10 03 + jsr $A338 ; CPU:$A2C5 PRG:22C5 20 38 A3 +; ----------------------------------------------------------------------------- +; Routine: ReturnFromConfigLoad +; Global: ReturnFromConfigLoad.; called from $A2BA +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReturnFromConfigLoad: + rts ; CPU:$A2C8 PRG:22C8 60 +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigFields +; Global: LoadActorConfigFields.; called from $A287, $A2B7 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigFields: + lda PlayerActiveFlag,x ; CPU:$A2C9 PRG:22C9 B5 78 + beq LoadActorConfigFields_OnZero_A2D8 ; CPU:$A2CB PRG:22CB F0 0B + jsr $A508 ; CPU:$A2CD PRG:22CD 20 08 A5 + cmp #$04 ; CPU:$A2D0 PRG:22D0 C9 04 + beq StoreActorPaletteByte_OnZero_A32A ; CPU:$A2D2 PRG:22D2 F0 56 + cmp #$05 ; CPU:$A2D4 PRG:22D4 C9 05 + beq StoreActorControlByte_OnZero_A334 ; CPU:$A2D6 PRG:22D6 F0 5C +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigFields_OnZero_A2D8 +; Global: LoadActorConfigFields_OnZero_A2D8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigFields_OnZero_A2D8: + lda PlayerActionState,x ; CPU:$A2D8 PRG:22D8 B5 F0 + cmp #$D0 ; CPU:$A2DA PRG:22DA C9 D0 + bne LoadActorConfigFields_OnNonzero_A30B ; CPU:$A2DC PRG:22DC D0 2D + lda $003C,y ; CPU:$A2DE PRG:22DE B9 3C 00 + bmi LoadActorConfigFields_OnNegative_A2EB ; CPU:$A2E1 PRG:22E1 30 08 + lda ControllerDPad1,x ; CPU:$A2E3 PRG:22E3 B5 F6 + and #$FC ; CPU:$A2E5 PRG:22E5 29 FC + ora #$01 ; CPU:$A2E7 PRG:22E7 09 01 + bne LoadActorConfigFields_OnNonzero_A2F1 ; CPU:$A2E9 PRG:22E9 D0 06 +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigFields_OnNegative_A2EB +; Global: LoadActorConfigFields_OnNegative_A2EB.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigFields_OnNegative_A2EB: + lda ControllerDPad1,x ; CPU:$A2EB PRG:22EB B5 F6 + and #$FC ; CPU:$A2ED PRG:22ED 29 FC + ora #$02 ; CPU:$A2EF PRG:22EF 09 02 +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigFields_OnNonzero_A2F1 +; Global: LoadActorConfigFields_OnNonzero_A2F1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigFields_OnNonzero_A2F1: + sta ControllerDPad1,x ; CPU:$A2F1 PRG:22F1 95 F6 + sta ControllerFaceButtons1,x ; CPU:$A2F3 PRG:22F3 95 F8 + jsr $A4FF ; CPU:$A2F5 PRG:22F5 20 FF A4 + lda $0034,y ; CPU:$A2F8 PRG:22F8 B9 34 00 + and #$7F ; CPU:$A2FB PRG:22FB 29 7F + cmp #$5E ; CPU:$A2FD PRG:22FD C9 5E + beq LoadActorConfigFields_OnZero_A305 ; CPU:$A2FF PRG:22FF F0 04 + lda #$00 ; CPU:$A301 PRG:2301 A9 00 + sta PlayerActionState,x ; CPU:$A303 PRG:2303 95 F0 +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigFields_OnZero_A305 +; Global: LoadActorConfigFields_OnZero_A305.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigFields_OnZero_A305: + jsr $A4FF ; CPU:$A305 PRG:2305 20 FF A4 + jmp $A316 ; CPU:$A308 PRG:2308 4C 16 A3 +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigFields_OnNonzero_A30B +; Global: LoadActorConfigFields_OnNonzero_A30B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigFields_OnNonzero_A30B: + lda Zp4F,x ; CPU:$A30B PRG:230B B5 4F + cmp #$14 ; CPU:$A30D PRG:230D C9 14 + bcc ReturnFromConfigLoad ; CPU:$A30F PRG:230F 90 B7 + sec ; CPU:$A311 PRG:2311 38 + sbc #$02 ; CPU:$A312 PRG:2312 E9 02 + sta Zp4F,x ; CPU:$A314 PRG:2314 95 4F +; ----------------------------------------------------------------------------- +; Routine: StoreActorPaletteByte +; Global: StoreActorPaletteByte.; called from $A308 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorPaletteByte: + ldy #$40 ; CPU:$A316 PRG:2316 A0 40 + lda #$E0 ; CPU:$A318 PRG:2318 A9 E0 + jsr $A49F ; CPU:$A31A PRG:231A 20 9F A4 + lda #$9A ; CPU:$A31D PRG:231D A9 9A + sta SoundSequencePtrLo1 ; CPU:$A31F PRG:231F 85 D4 + lda #$B1 ; CPU:$A321 PRG:2321 A9 B1 + sta SoundSequencePtrHi1 ; CPU:$A323 PRG:2323 85 D8 + lda #$00 ; CPU:$A325 PRG:2325 A9 00 + sta SoundChannelStep1 ; CPU:$A327 PRG:2327 85 D0 + rts ; CPU:$A329 PRG:2329 60 +; ----------------------------------------------------------------------------- +; Routine: StoreActorPaletteByte_OnZero_A32A +; Global: StoreActorPaletteByte_OnZero_A32A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorPaletteByte_OnZero_A32A: + ldy #$58 ; CPU:$A32A PRG:232A A0 58 +; ----------------------------------------------------------------------------- +; Routine: StoreActorControlByte +; Global: StoreActorControlByte.; called from $A3A2, $A4A7 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorControlByte: + lda #$FA ; CPU:$A32C PRG:232C A9 FA + jsr $A49F ; CPU:$A32E PRG:232E 20 9F A4 + jmp $A4F2 ; CPU:$A331 PRG:2331 4C F2 A4 +; ----------------------------------------------------------------------------- +; Routine: StoreActorControlByte_OnZero_A334 +; Global: StoreActorControlByte_OnZero_A334.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorControlByte_OnZero_A334: + ldy #$59 ; CPU:$A334 PRG:2334 A0 59 + bne StoreActorControlByte ; CPU:$A336 PRG:2336 D0 F4 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte +; Global: ReadActorConfigByte.; called from $A295, $A2C5 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte: + ldx ActorIndex ; CPU:$A338 PRG:2338 A6 1E + ldy ActorSlotOffset ; CPU:$A33A PRG:233A A4 21 + lda PlayerActiveFlag,x ; CPU:$A33C PRG:233C B5 78 + beq ReadActorConfigByte_JoinBranchPaths_A388 ; CPU:$A33E PRG:233E F0 48 + jsr $A508 ; CPU:$A340 PRG:2340 20 08 A5 + cmp #$06 ; CPU:$A343 PRG:2343 C9 06 + bne ReadActorConfigByte_JoinBranchPaths_A388 ; CPU:$A345 PRG:2345 D0 41 + lda Zp84 ; CPU:$A347 PRG:2347 A5 84 + bne ReadActorConfigByte_JoinBranchPaths_A388 ; CPU:$A349 PRG:2349 D0 3D + lda $003A,y ; CPU:$A34B PRG:234B B9 3A 00 + sec ; CPU:$A34E PRG:234E 38 + sbc $0033,y ; CPU:$A34F PRG:234F F9 33 00 + clc ; CPU:$A352 PRG:2352 18 + adc #$08 ; CPU:$A353 PRG:2353 69 08 + sta $0210 ; CPU:$A355 PRG:2355 8D 10 02 + clc ; CPU:$A358 PRG:2358 18 + adc #$08 ; CPU:$A359 PRG:2359 69 08 + sta $0214 ; CPU:$A35B PRG:235B 8D 14 02 + lda $003C,y ; CPU:$A35E PRG:235E B9 3C 00 + asl a ; CPU:$A361 PRG:2361 0A + sta Zp85 ; CPU:$A362 PRG:2362 85 85 + lda #$00 ; CPU:$A364 PRG:2364 A9 00 + adc #$00 ; CPU:$A366 PRG:2366 69 00 + sta Zp86 ; CPU:$A368 PRG:2368 85 86 + lda #$23 ; CPU:$A36A PRG:236A A9 23 + sta $0211 ; CPU:$A36C PRG:236C 8D 11 02 + lda #$36 ; CPU:$A36F PRG:236F A9 36 + sta $0215 ; CPU:$A371 PRG:2371 8D 15 02 + stx $0212 ; CPU:$A374 PRG:2374 8E 12 02 + stx $0216 ; CPU:$A377 PRG:2377 8E 16 02 + txa ; CPU:$A37A PRG:237A 8A + eor #$01 ; CPU:$A37B PRG:237B 49 01 + sta Zp87 ; CPU:$A37D PRG:237D 85 87 + lda ControllerDPad1,x ; CPU:$A37F PRG:237F B5 F6 + sta Zp84 ; CPU:$A381 PRG:2381 85 84 + lda #$05 ; CPU:$A383 PRG:2383 A9 05 + sta ScriptCounterA,x ; CPU:$A385 PRG:2385 95 43 + rts ; CPU:$A387 PRG:2387 60 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_JoinBranchPaths_A388 +; Global: ReadActorConfigByte_JoinBranchPaths_A388.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_JoinBranchPaths_A388: + lda PlayerActionState,x ; CPU:$A388 PRG:2388 B5 F0 + cmp #$E0 ; CPU:$A38A PRG:238A C9 E0 + bne ReadActorConfigByte_OnNonzero_A3B1 ; CPU:$A38C PRG:238C D0 23 + jsr $A4DF ; CPU:$A38E PRG:238E 20 DF A4 + lda PlayerActiveFlag,x ; CPU:$A391 PRG:2391 B5 78 + beq ReadActorConfigByte_JoinBranchPaths_A3A5 ; CPU:$A393 PRG:2393 F0 10 + jsr $A508 ; CPU:$A395 PRG:2395 20 08 A5 + cmp #$02 ; CPU:$A398 PRG:2398 C9 02 + bne ReadActorConfigByte_JoinBranchPaths_A3A5 ; CPU:$A39A PRG:239A D0 09 + lda #$00 ; CPU:$A39C PRG:239C A9 00 + sta Zp5A,x ; CPU:$A39E PRG:239E 95 5A + ldy #$5D ; CPU:$A3A0 PRG:23A0 A0 5D + jmp $A32C ; CPU:$A3A2 PRG:23A2 4C 2C A3 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_JoinBranchPaths_A3A5 +; Global: ReadActorConfigByte_JoinBranchPaths_A3A5.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_JoinBranchPaths_A3A5: + ldy #$43 ; CPU:$A3A5 PRG:23A5 A0 43 + lda #$F2 ; CPU:$A3A7 PRG:23A7 A9 F2 + jsr $A49F ; CPU:$A3A9 PRG:23A9 20 9F A4 + sta Zp5A,x ; CPU:$A3AC PRG:23AC 95 5A + jmp $A4DF ; CPU:$A3AE PRG:23AE 4C DF A4 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_OnNonzero_A3B1 +; Global: ReadActorConfigByte_OnNonzero_A3B1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_OnNonzero_A3B1: + lda PlayerPosXLo1 ; CPU:$A3B1 PRG:23B1 A5 3A + sec ; CPU:$A3B3 PRG:23B3 38 + sbc PlayerPosXLo2 ; CPU:$A3B4 PRG:23B4 E5 3E + clc ; CPU:$A3B6 PRG:23B6 18 + adc #$08 ; CPU:$A3B7 PRG:23B7 69 08 + cmp #$10 ; CPU:$A3B9 PRG:23B9 C9 10 + bcs ReadActorConfigByte_OnCarrySet_A3C9 ; CPU:$A3BB PRG:23BB B0 0C + lda PlayerPosYLo1 ; CPU:$A3BD PRG:23BD A5 3C + sec ; CPU:$A3BF PRG:23BF 38 + sbc PlayerPosYLo2 ; CPU:$A3C0 PRG:23C0 E5 40 + clc ; CPU:$A3C2 PRG:23C2 18 + adc #$0C ; CPU:$A3C3 PRG:23C3 69 0C + cmp #$18 ; CPU:$A3C5 PRG:23C5 C9 18 + bcc ReadActorConfigByte_JoinBranchPaths_A406 ; CPU:$A3C7 PRG:23C7 90 3D +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_OnCarrySet_A3C9 +; Global: ReadActorConfigByte_OnCarrySet_A3C9.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_OnCarrySet_A3C9: + ldx ActorIndex ; CPU:$A3C9 PRG:23C9 A6 1E + lda Zp88,x ; CPU:$A3CB PRG:23CB B5 88 + bne ReadActorConfigByte_JoinBranchPaths_A406 ; CPU:$A3CD PRG:23CD D0 37 + ldx ActorIndex ; CPU:$A3CF PRG:23CF A6 1E + bne ReadActorConfigByte_OnNonzero_A3FA ; CPU:$A3D1 PRG:23D1 D0 27 + lda PlayerPosYLo1 ; CPU:$A3D3 PRG:23D3 A5 3C + cmp #$64 ; CPU:$A3D5 PRG:23D5 C9 64 + bcs ReadActorConfigByte_JoinBranchPaths_A406 ; CPU:$A3D7 PRG:23D7 B0 2D + lda PlayerPosXLo1 ; CPU:$A3D9 PRG:23D9 A5 3A + cmp #$40 ; CPU:$A3DB PRG:23DB C9 40 + bcs ReadActorConfigByte_JoinBranchPaths_A406 ; CPU:$A3DD PRG:23DD B0 27 + lda #$0A ; CPU:$A3DF PRG:23DF A9 0A + sta Zp4B,x ; CPU:$A3E1 PRG:23E1 95 4B + lda #$02 ; CPU:$A3E3 PRG:23E3 A9 02 + ldy #$56 ; CPU:$A3E5 PRG:23E5 A0 56 + bne ReadActorConfigByte_OnNonzero_A3F1 ; CPU:$A3E7 PRG:23E7 D0 08 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_OnCarrySet_A3E9 +; Global: ReadActorConfigByte_OnCarrySet_A3E9.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_OnCarrySet_A3E9: + lda #$0C ; CPU:$A3E9 PRG:23E9 A9 0C + sta Zp4B,x ; CPU:$A3EB PRG:23EB 95 4B + lda #$01 ; CPU:$A3ED PRG:23ED A9 01 + ldy #$57 ; CPU:$A3EF PRG:23EF A0 57 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_OnNonzero_A3F1 +; Global: ReadActorConfigByte_OnNonzero_A3F1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_OnNonzero_A3F1: + sta ControllerDPad1,x ; CPU:$A3F1 PRG:23F1 95 F6 + sta ControllerFaceButtons1,x ; CPU:$A3F3 PRG:23F3 95 F8 + lda #$FF ; CPU:$A3F5 PRG:23F5 A9 FF + jmp $9A24 ; CPU:$A3F7 PRG:23F7 4C 24 9A +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_OnNonzero_A3FA +; Global: ReadActorConfigByte_OnNonzero_A3FA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_OnNonzero_A3FA: + lda PlayerPosYLo2 ; CPU:$A3FA PRG:23FA A5 40 + cmp #$B4 ; CPU:$A3FC PRG:23FC C9 B4 + bcc ReadActorConfigByte_JoinBranchPaths_A406 ; CPU:$A3FE PRG:23FE 90 06 + lda PlayerPosXLo2 ; CPU:$A400 PRG:2400 A5 3E + cmp #$94 ; CPU:$A402 PRG:2402 C9 94 + bcs ReadActorConfigByte_OnCarrySet_A3E9 ; CPU:$A404 PRG:2404 B0 E3 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_JoinBranchPaths_A406 +; Global: ReadActorConfigByte_JoinBranchPaths_A406.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_JoinBranchPaths_A406: + lda ScriptFlagsLo ; CPU:$A406 PRG:2406 A5 4D + bne ReadActorConfigByte_OnNonzero_A40D ; CPU:$A408 PRG:2408 D0 03 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_OnCarrySet_A40A +; Global: ReadActorConfigByte_OnCarrySet_A40A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_OnCarrySet_A40A: + jmp $A482 ; CPU:$A40A PRG:240A 4C 82 A4 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_OnNonzero_A40D +; Global: ReadActorConfigByte_OnNonzero_A40D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_OnNonzero_A40D: + lda ControllerDPad1 ; CPU:$A40D PRG:240D A5 F6 + eor ControllerDPad2 ; CPU:$A40F PRG:240F 45 F7 + and #$03 ; CPU:$A411 PRG:2411 29 03 + beq ReadActorConfigByte_OnZero_A418 ; CPU:$A413 PRG:2413 F0 03 + jmp $A4AA ; CPU:$A415 PRG:2415 4C AA A4 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_OnZero_A418 +; Global: ReadActorConfigByte_OnZero_A418.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_OnZero_A418: + ldx ActorIndex ; CPU:$A418 PRG:2418 A6 1E + bne ReadActorConfigByte_OnNonzero_A423 ; CPU:$A41A PRG:241A D0 07 + lda ControllerDPad1 ; CPU:$A41C PRG:241C A5 F6 + ror a ; CPU:$A41E PRG:241E 6A + bcc ReadActorConfigByte_JoinBranchPaths_A430 ; CPU:$A41F PRG:241F 90 0F + bcs ReadActorConfigByte_OnCarrySet_A428 ; CPU:$A421 PRG:2421 B0 05 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_OnNonzero_A423 +; Global: ReadActorConfigByte_OnNonzero_A423.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_OnNonzero_A423: + lda ControllerDPad2 ; CPU:$A423 PRG:2423 A5 F7 + ror a ; CPU:$A425 PRG:2425 6A + bcs ReadActorConfigByte_JoinBranchPaths_A430 ; CPU:$A426 PRG:2426 B0 08 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_OnCarrySet_A428 +; Global: ReadActorConfigByte_OnCarrySet_A428.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_OnCarrySet_A428: + lda PlayerPosYLo2 ; CPU:$A428 PRG:2428 A5 40 + sec ; CPU:$A42A PRG:242A 38 + sbc PlayerPosYLo1 ; CPU:$A42B PRG:242B E5 3C + jmp $A435 ; CPU:$A42D PRG:242D 4C 35 A4 +; ----------------------------------------------------------------------------- +; Routine: ReadActorConfigByte_JoinBranchPaths_A430 +; Global: ReadActorConfigByte_JoinBranchPaths_A430.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadActorConfigByte_JoinBranchPaths_A430: + lda PlayerPosYLo1 ; CPU:$A430 PRG:2430 A5 3C + sec ; CPU:$A432 PRG:2432 38 + sbc PlayerPosYLo2 ; CPU:$A433 PRG:2433 E5 40 +; ----------------------------------------------------------------------------- +; Routine: CompareActorConfigValue +; Global: CompareActorConfigValue.; called from $A42D +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorConfigValue: + cmp #$09 ; CPU:$A435 PRG:2435 C9 09 + bcs ReadActorConfigByte_OnCarrySet_A40A ; CPU:$A437 PRG:2437 B0 D1 + lda PlayerActiveFlag,x ; CPU:$A439 PRG:2439 B5 78 + beq StoreActorConfigResult_JoinBranchPaths_A475 ; CPU:$A43B PRG:243B F0 38 + jsr $A508 ; CPU:$A43D PRG:243D 20 08 A5 + cmp #$07 ; CPU:$A440 PRG:2440 C9 07 + beq CompareActorConfigValue_OnZero_A44E ; CPU:$A442 PRG:2442 F0 0A + cmp #$03 ; CPU:$A444 PRG:2444 C9 03 + beq CompareActorConfigValue_OnZero_A459 ; CPU:$A446 PRG:2446 F0 11 + cmp #$00 ; CPU:$A448 PRG:2448 C9 00 + beq CompareActorConfigValue_OnZero_A464 ; CPU:$A44A PRG:244A F0 18 + bne StoreActorConfigResult_JoinBranchPaths_A475 ; CPU:$A44C PRG:244C D0 27 +; ----------------------------------------------------------------------------- +; Routine: CompareActorConfigValue_OnZero_A44E +; Global: CompareActorConfigValue_OnZero_A44E.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorConfigValue_OnZero_A44E: + ldy #$54 ; CPU:$A44E PRG:244E A0 54 + lda #$FA ; CPU:$A450 PRG:2450 A9 FA + jsr $A49F ; CPU:$A452 PRG:2452 20 9F A4 + ldy #$55 ; CPU:$A455 PRG:2455 A0 55 + bne CompareActorConfigValue_OnNonzero_A46D ; CPU:$A457 PRG:2457 D0 14 +; ----------------------------------------------------------------------------- +; Routine: CompareActorConfigValue_OnZero_A459 +; Global: CompareActorConfigValue_OnZero_A459.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorConfigValue_OnZero_A459: + ldy #$52 ; CPU:$A459 PRG:2459 A0 52 + lda #$FA ; CPU:$A45B PRG:245B A9 FA + jsr $A49F ; CPU:$A45D PRG:245D 20 9F A4 + ldy #$53 ; CPU:$A460 PRG:2460 A0 53 + bne CompareActorConfigValue_OnNonzero_A46D ; CPU:$A462 PRG:2462 D0 09 +; ----------------------------------------------------------------------------- +; Routine: CompareActorConfigValue_OnZero_A464 +; Global: CompareActorConfigValue_OnZero_A464.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorConfigValue_OnZero_A464: + ldy #$50 ; CPU:$A464 PRG:2464 A0 50 + lda #$FA ; CPU:$A466 PRG:2466 A9 FA + jsr $A49F ; CPU:$A468 PRG:2468 20 9F A4 + ldy #$51 ; CPU:$A46B PRG:246B A0 51 +; ----------------------------------------------------------------------------- +; Routine: CompareActorConfigValue_OnNonzero_A46D +; Global: CompareActorConfigValue_OnNonzero_A46D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CompareActorConfigValue_OnNonzero_A46D: + lda #$FB ; CPU:$A46D PRG:246D A9 FB +; ----------------------------------------------------------------------------- +; Routine: StoreActorConfigResult +; Global: StoreActorConfigResult.; called from $A4CF +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorConfigResult: + jsr $9A2E ; CPU:$A46F PRG:246F 20 2E 9A + sta SoundVolume3,x ; CPU:$A472 PRG:2472 95 82 + rts ; CPU:$A474 PRG:2474 60 +; ----------------------------------------------------------------------------- +; Routine: StoreActorConfigResult_JoinBranchPaths_A475 +; Global: StoreActorConfigResult_JoinBranchPaths_A475.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorConfigResult_JoinBranchPaths_A475: + ldy #$47 ; CPU:$A475 PRG:2475 A0 47 + lda #$F4 ; CPU:$A477 PRG:2477 A9 F4 + jsr $A49F ; CPU:$A479 PRG:2479 20 9F A4 + ldy #$48 ; CPU:$A47C PRG:247C A0 48 + lda #$F5 ; CPU:$A47E PRG:247E A9 F5 + bne StoreActorConfigResult ; CPU:$A480 PRG:2480 D0 ED +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigAlt +; Global: LoadActorConfigAlt.; called from $A40A +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigAlt: + lda PlayerActiveFlag,x ; CPU:$A482 PRG:2482 B5 78 + beq LoadActorConfigAlt_OnZero_A48D ; CPU:$A484 PRG:2484 F0 07 + jsr $A508 ; CPU:$A486 PRG:2486 20 08 A5 + cmp #$01 ; CPU:$A489 PRG:2489 C9 01 + beq StoreActorConfigResultAlt_OnZero_A4A5 ; CPU:$A48B PRG:248B F0 18 +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigAlt_OnZero_A48D +; Global: LoadActorConfigAlt_OnZero_A48D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigAlt_OnZero_A48D: + txa ; CPU:$A48D PRG:248D 8A + eor #$01 ; CPU:$A48E PRG:248E 49 01 + tax ; CPU:$A490 PRG:2490 AA + lda Zp62,x ; CPU:$A491 PRG:2491 B5 62 + beq LoadActorConfigAlt_OnZero_A49B ; CPU:$A493 PRG:2493 F0 06 + ldy #$4C ; CPU:$A495 PRG:2495 A0 4C + lda #$F8 ; CPU:$A497 PRG:2497 A9 F8 + bne StoreActorConfigResultAlt ; CPU:$A499 PRG:2499 D0 04 +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigAlt_OnZero_A49B +; Global: LoadActorConfigAlt_OnZero_A49B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigAlt_OnZero_A49B: + ldy #$42 ; CPU:$A49B PRG:249B A0 42 + lda #$F0 ; CPU:$A49D PRG:249D A9 F0 +; ----------------------------------------------------------------------------- +; Routine: StoreActorConfigResultAlt +; Global: StoreActorConfigResultAlt.; called from $A31A, $A32E, $A3A9, $A452, $A45D, $A468, $A479 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorConfigResultAlt: + jsr $9A24 ; CPU:$A49F PRG:249F 20 24 9A + sta SoundVolume3,x ; CPU:$A4A2 PRG:24A2 95 82 + rts ; CPU:$A4A4 PRG:24A4 60 +; ----------------------------------------------------------------------------- +; Routine: StoreActorConfigResultAlt_OnZero_A4A5 +; Global: StoreActorConfigResultAlt_OnZero_A4A5.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreActorConfigResultAlt_OnZero_A4A5: + ldy #$5C ; CPU:$A4A5 PRG:24A5 A0 5C + jmp $A32C ; CPU:$A4A7 PRG:24A7 4C 2C A3 +; ----------------------------------------------------------------------------- +; Routine: LoadActorFacingFlag +; Global: LoadActorFacingFlag.; called from $A415 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorFacingFlag: + ldx ActorIndex ; CPU:$A4AA PRG:24AA A6 1E + bne LoadActorFacingFlag_OnNonzero_A4B5 ; CPU:$A4AC PRG:24AC D0 07 + lda ControllerDPad1 ; CPU:$A4AE PRG:24AE A5 F6 + ror a ; CPU:$A4B0 PRG:24B0 6A + bcc LoadActorFacingFlag_OnCarryClear_A4BA ; CPU:$A4B1 PRG:24B1 90 07 + bcs LoadActorFacingFlag_JoinBranchPaths_A4C2 ; CPU:$A4B3 PRG:24B3 B0 0D +; ----------------------------------------------------------------------------- +; Routine: LoadActorFacingFlag_OnNonzero_A4B5 +; Global: LoadActorFacingFlag_OnNonzero_A4B5.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorFacingFlag_OnNonzero_A4B5: + lda ControllerDPad2 ; CPU:$A4B5 PRG:24B5 A5 F7 + ror a ; CPU:$A4B7 PRG:24B7 6A + bcc LoadActorFacingFlag_JoinBranchPaths_A4C2 ; CPU:$A4B8 PRG:24B8 90 08 +; ----------------------------------------------------------------------------- +; Routine: LoadActorFacingFlag_OnCarryClear_A4BA +; Global: LoadActorFacingFlag_OnCarryClear_A4BA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorFacingFlag_OnCarryClear_A4BA: + lda PlayerPosYLo1 ; CPU:$A4BA PRG:24BA A5 3C + sec ; CPU:$A4BC PRG:24BC 38 + sbc PlayerPosYLo2 ; CPU:$A4BD PRG:24BD E5 40 + jmp $A4C7 ; CPU:$A4BF PRG:24BF 4C C7 A4 +; ----------------------------------------------------------------------------- +; Routine: LoadActorFacingFlag_JoinBranchPaths_A4C2 +; Global: LoadActorFacingFlag_JoinBranchPaths_A4C2.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorFacingFlag_JoinBranchPaths_A4C2: + lda PlayerPosYLo2 ; CPU:$A4C2 PRG:24C2 A5 40 + sec ; CPU:$A4C4 PRG:24C4 38 + sbc PlayerPosYLo1 ; CPU:$A4C5 PRG:24C5 E5 3C +; ----------------------------------------------------------------------------- +; Routine: LoadActorConfigBlock +; Global: LoadActorConfigBlock.; called from $A4BF +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadActorConfigBlock: + cmp #$09 ; CPU:$A4C7 PRG:24C7 C9 09 + bcs LoadActorConfigAlt ; CPU:$A4C9 PRG:24C9 B0 B7 + ldy #$49 ; CPU:$A4CB PRG:24CB A0 49 + lda #$F6 ; CPU:$A4CD PRG:24CD A9 F6 + jsr $A46F ; CPU:$A4CF PRG:24CF 20 6F A4 + lda #$64 ; CPU:$A4D2 PRG:24D2 A9 64 + sec ; CPU:$A4D4 PRG:24D4 38 + sbc Zp4F,x ; CPU:$A4D5 PRG:24D5 F5 4F + lsr a ; CPU:$A4D7 PRG:24D7 4A + adc #$20 ; CPU:$A4D8 PRG:24D8 69 20 + sta Zp60,x ; CPU:$A4DA PRG:24DA 95 60 + jsr $A4F2 ; CPU:$A4DC PRG:24DC 20 F2 A4 +; ----------------------------------------------------------------------------- +; Routine: TestSoundChannelState +; Global: TestSoundChannelState.; called from $986F, $A38E, $A3AE +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestSoundChannelState: + lda SoundChannelStep4 ; CPU:$A4DF PRG:24DF A5 D3 + cmp #$FF ; CPU:$A4E1 PRG:24E1 C9 FF + bne TestSoundChannelState_OnNonzero_A4F1 ; CPU:$A4E3 PRG:24E3 D0 0C + lda #$9C ; CPU:$A4E5 PRG:24E5 A9 9C + sta SoundSequencePtrLo4 ; CPU:$A4E7 PRG:24E7 85 D7 + lda #$B2 ; CPU:$A4E9 PRG:24E9 A9 B2 + sta SoundSequencePtrHi4 ; CPU:$A4EB PRG:24EB 85 DB + lda #$00 ; CPU:$A4ED PRG:24ED A9 00 + sta SoundChannelStep4 ; CPU:$A4EF PRG:24EF 85 D3 +; ----------------------------------------------------------------------------- +; Routine: TestSoundChannelState_OnNonzero_A4F1 +; Global: TestSoundChannelState_OnNonzero_A4F1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestSoundChannelState_OnNonzero_A4F1: + rts ; CPU:$A4F1 PRG:24F1 60 +; ----------------------------------------------------------------------------- +; Routine: SetSoundSequenceChannel2Alt +; Global: SetSoundSequenceChannel2Alt.; called from $9966, $A331, $A4DC +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetSoundSequenceChannel2Alt: + lda #$A7 ; CPU:$A4F2 PRG:24F2 A9 A7 + sta SoundSequencePtrLo2 ; CPU:$A4F4 PRG:24F4 85 D5 + lda #$B2 ; CPU:$A4F6 PRG:24F6 A9 B2 + sta SoundSequencePtrHi2 ; CPU:$A4F8 PRG:24F8 85 D9 + lda #$00 ; CPU:$A4FA PRG:24FA A9 00 + sta SoundChannelStep2 ; CPU:$A4FC PRG:24FC 85 D1 + rts ; CPU:$A4FE PRG:24FE 60 +; ----------------------------------------------------------------------------- +; Routine: FlipObjectIndex +; Global: Flip the low bit of A, turning a player index into its partner (0<->1, 2<->3). +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FlipObjectIndex: + txa ; CPU:$A4FF PRG:24FF 8A + eor #$01 ; CPU:$A500 PRG:2500 49 01 + tax ; CPU:$A502 PRG:2502 AA + tya ; CPU:$A503 PRG:2503 98 + eor #$04 ; CPU:$A504 PRG:2504 49 04 + tay ; CPU:$A506 PRG:2506 A8 + rts ; CPU:$A507 PRG:2507 60 +; ----------------------------------------------------------------------------- +; Routine: LookupObjectIndex +; Global: Resolve an object index through the per-player tables at $2A and $26. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LookupObjectIndex: + ldx ActorIndex ; CPU:$A508 PRG:2508 A6 1E + lda PlayerPaletteIndex,x ; CPU:$A50A PRG:250A B5 2A + tax ; CPU:$A50C PRG:250C AA + lda PlayerSpriteIndex1,x ; CPU:$A50D PRG:250D B5 26 + ldx ActorIndex ; CPU:$A50F PRG:250F A6 1E + rts ; CPU:$A511 PRG:2511 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectSlots +; Global: Walk the object slots looking for one whose countdown at $45 is non-zero. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectSlots: + lda #$01 ; CPU:$A512 PRG:2512 A9 01 + sta ActorIndex ; CPU:$A514 PRG:2514 85 1E + jsr $A51B ; CPU:$A516 PRG:2516 20 1B A5 + dec ActorIndex ; CPU:$A519 PRG:2519 C6 1E +; ----------------------------------------------------------------------------- +; Routine: AdvanceObjectSlot +; Global: AdvanceObjectSlot.; called from $A516 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceObjectSlot: + ldx ActorIndex ; CPU:$A51B PRG:251B A6 1E + lda ScriptCounterC,x ; CPU:$A51D PRG:251D B5 45 + bne AdvanceObjectSlot_OnNonzero_A522 ; CPU:$A51F PRG:251F D0 01 + rts ; CPU:$A521 PRG:2521 60 +; ----------------------------------------------------------------------------- +; Routine: AdvanceObjectSlot_OnNonzero_A522 +; Global: AdvanceObjectSlot_OnNonzero_A522.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceObjectSlot_OnNonzero_A522: + bmi AdvanceObjectSlot_OnNegative_A583 ; CPU:$A522 PRG:2522 30 5F + clc ; CPU:$A524 PRG:2524 18 + adc #$01 ; CPU:$A525 PRG:2525 69 01 + sta ScriptCounterC,x ; CPU:$A527 PRG:2527 95 45 + cmp #$21 ; CPU:$A529 PRG:2529 C9 21 + bcc AdvanceObjectSlot_OnCarryClear_A532 ; CPU:$A52B PRG:252B 90 05 +; ----------------------------------------------------------------------------- +; Routine: AdvanceObjectSlot_OnCarrySet_A52D +; Global: AdvanceObjectSlot_OnCarrySet_A52D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceObjectSlot_OnCarrySet_A52D: + lda #$00 ; CPU:$A52D PRG:252D A9 00 + sta ScriptCounterC,x ; CPU:$A52F PRG:252F 95 45 + rts ; CPU:$A531 PRG:2531 60 +; ----------------------------------------------------------------------------- +; Routine: AdvanceObjectSlot_OnCarryClear_A532 +; Global: AdvanceObjectSlot_OnCarryClear_A532.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceObjectSlot_OnCarryClear_A532: + lsr a ; CPU:$A532 PRG:2532 4A + and #$1E ; CPU:$A533 PRG:2533 29 1E + tay ; CPU:$A535 PRG:2535 A8 + txa ; CPU:$A536 PRG:2536 8A + asl a ; CPU:$A537 PRG:2537 0A + tax ; CPU:$A538 PRG:2538 AA + lda $A5F4,y ; CPU:$A539 PRG:2539 B9 F4 A5 + sta SourcePointerLo ; CPU:$A53C PRG:253C 85 10 + lda $A5F5,y ; CPU:$A53E PRG:253E B9 F5 A5 + sta SourcePointerHi ; CPU:$A541 PRG:2541 85 11 + lda PpuCtrlShadow ; CPU:$A543 PRG:2543 A5 FC + ora #$04 ; CPU:$A545 PRG:2545 09 04 + sta $2000 ; CPU:$A547 PRG:2547 8D 00 20 + lda ScriptArgHi,x ; CPU:$A54A PRG:254A B5 48 + sta $2006 ; CPU:$A54C PRG:254C 8D 06 20 + lda ScriptArgLo,x ; CPU:$A54F PRG:254F B5 47 + sta $2006 ; CPU:$A551 PRG:2551 8D 06 20 + ldy #$02 ; CPU:$A554 PRG:2554 A0 02 + jsr $A5DD ; CPU:$A556 PRG:2556 20 DD A5 + lda ScriptArgHi,x ; CPU:$A559 PRG:2559 B5 48 + sta $2006 ; CPU:$A55B PRG:255B 8D 06 20 + lda ScriptArgLo,x ; CPU:$A55E PRG:255E B5 47 + sec ; CPU:$A560 PRG:2560 38 + sbc #$01 ; CPU:$A561 PRG:2561 E9 01 + sta $2006 ; CPU:$A563 PRG:2563 8D 06 20 + ldy #$04 ; CPU:$A566 PRG:2566 A0 04 + jsr $A5DD ; CPU:$A568 PRG:2568 20 DD A5 + lda ScriptArgHi,x ; CPU:$A56B PRG:256B B5 48 + sta $2006 ; CPU:$A56D PRG:256D 8D 06 20 + lda ScriptArgLo,x ; CPU:$A570 PRG:2570 B5 47 + clc ; CPU:$A572 PRG:2572 18 + adc #$1E ; CPU:$A573 PRG:2573 69 1E + sta $2006 ; CPU:$A575 PRG:2575 8D 06 20 + ldy #$03 ; CPU:$A578 PRG:2578 A0 03 + jsr $A5DD ; CPU:$A57A PRG:257A 20 DD A5 + lda PpuCtrlShadow ; CPU:$A57D PRG:257D A5 FC + sta $2000 ; CPU:$A57F PRG:257F 8D 00 20 + rts ; CPU:$A582 PRG:2582 60 +; ----------------------------------------------------------------------------- +; Routine: AdvanceObjectSlot_OnNegative_A583 +; Global: AdvanceObjectSlot_OnNegative_A583.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceObjectSlot_OnNegative_A583: + clc ; CPU:$A583 PRG:2583 18 + adc #$01 ; CPU:$A584 PRG:2584 69 01 + sta ScriptCounterC,x ; CPU:$A586 PRG:2586 95 45 + cmp #$A1 ; CPU:$A588 PRG:2588 C9 A1 + bcs AdvanceObjectSlot_OnCarrySet_A52D ; CPU:$A58A PRG:258A B0 A1 + lsr a ; CPU:$A58C PRG:258C 4A + and #$1E ; CPU:$A58D PRG:258D 29 1E + tay ; CPU:$A58F PRG:258F A8 + txa ; CPU:$A590 PRG:2590 8A + asl a ; CPU:$A591 PRG:2591 0A + tax ; CPU:$A592 PRG:2592 AA + lda $A606,y ; CPU:$A593 PRG:2593 B9 06 A6 + sta SourcePointerLo ; CPU:$A596 PRG:2596 85 10 + lda $A607,y ; CPU:$A598 PRG:2598 B9 07 A6 + sta SourcePointerHi ; CPU:$A59B PRG:259B 85 11 + lda PpuCtrlShadow ; CPU:$A59D PRG:259D A5 FC + ora #$04 ; CPU:$A59F PRG:259F 09 04 + sta $2000 ; CPU:$A5A1 PRG:25A1 8D 00 20 + lda ScriptArgHi,x ; CPU:$A5A4 PRG:25A4 B5 48 + sta $2006 ; CPU:$A5A6 PRG:25A6 8D 06 20 + lda ScriptArgLo,x ; CPU:$A5A9 PRG:25A9 B5 47 + sta $2006 ; CPU:$A5AB PRG:25AB 8D 06 20 + ldy #$02 ; CPU:$A5AE PRG:25AE A0 02 + jsr $A5DD ; CPU:$A5B0 PRG:25B0 20 DD A5 + lda ScriptArgHi,x ; CPU:$A5B3 PRG:25B3 B5 48 + sta $2006 ; CPU:$A5B5 PRG:25B5 8D 06 20 + lda ScriptArgLo,x ; CPU:$A5B8 PRG:25B8 B5 47 + clc ; CPU:$A5BA PRG:25BA 18 + adc #$01 ; CPU:$A5BB PRG:25BB 69 01 + sta $2006 ; CPU:$A5BD PRG:25BD 8D 06 20 + ldy #$04 ; CPU:$A5C0 PRG:25C0 A0 04 + jsr $A5DD ; CPU:$A5C2 PRG:25C2 20 DD A5 + lda ScriptArgHi,x ; CPU:$A5C5 PRG:25C5 B5 48 + sta $2006 ; CPU:$A5C7 PRG:25C7 8D 06 20 + lda ScriptArgLo,x ; CPU:$A5CA PRG:25CA B5 47 + clc ; CPU:$A5CC PRG:25CC 18 + adc #$22 ; CPU:$A5CD PRG:25CD 69 22 + sta $2006 ; CPU:$A5CF PRG:25CF 8D 06 20 + ldy #$03 ; CPU:$A5D2 PRG:25D2 A0 03 + jsr $A5DD ; CPU:$A5D4 PRG:25D4 20 DD A5 + lda PpuCtrlShadow ; CPU:$A5D7 PRG:25D7 A5 FC + sta $2000 ; CPU:$A5D9 PRG:25D9 8D 00 20 + rts ; CPU:$A5DC PRG:25DC 60 +; ----------------------------------------------------------------------------- +; Routine: WriteNametableBytes +; Global: WriteNametableBytes.; called from $A556, $A568, $A57A, $A5B0, $A5C2, $A5D4 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteNametableBytes: + tya ; CPU:$A5DD PRG:25DD 98 + pha ; CPU:$A5DE PRG:25DE 48 +; ----------------------------------------------------------------------------- +; Routine: WriteNametableBytes_OnNonnegative_A5DF +; Global: WriteNametableBytes_OnNonnegative_A5DF.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteNametableBytes_OnNonnegative_A5DF: + lda (SourcePointerLo),y ; CPU:$A5DF PRG:25DF B1 10 + sta $2007 ; CPU:$A5E1 PRG:25E1 8D 07 20 + dey ; CPU:$A5E4 PRG:25E4 88 + bpl WriteNametableBytes_OnNonnegative_A5DF ; CPU:$A5E5 PRG:25E5 10 F8 + pla ; CPU:$A5E7 PRG:25E7 68 + sec ; CPU:$A5E8 PRG:25E8 38 + adc SourcePointerLo ; CPU:$A5E9 PRG:25E9 65 10 + sta SourcePointerLo ; CPU:$A5EB PRG:25EB 85 10 + lda #$00 ; CPU:$A5ED PRG:25ED A9 00 + adc SourcePointerHi ; CPU:$A5EF PRG:25EF 65 11 + sta SourcePointerHi ; CPU:$A5F1 PRG:25F1 85 11 + rts ; CPU:$A5F3 PRG:25F3 60 +; Pass 3: 18 x 16-bit pointers into StageDescriptorData. Two readers share it: UpdateStageDescriptorAt reads (A & $1E) starting at entry 0, and the writer at $A593 reads the same array starting at entry 9. Entry 18 already reads descriptor text, so 18. +; ---- data $A5F4-$A617 (36 bytes) ---- +StageDescriptorPointerTable: + .word $A618 ; entry 0 -> $A618 ; CPU:$A5F4 PRG:25F4 18 A6 + .word $A624 ; entry 1 -> $A624 ; CPU:$A5F6 PRG:25F6 24 A6 + .word $A618 ; entry 2 -> $A618 ; CPU:$A5F8 PRG:25F8 18 A6 + .word $A630 ; entry 3 -> $A630 ; CPU:$A5FA PRG:25FA 30 A6 + .word $A618 ; entry 4 -> $A618 ; CPU:$A5FC PRG:25FC 18 A6 + .word $A624 ; entry 5 -> $A624 ; CPU:$A5FE PRG:25FE 24 A6 + .word $A618 ; entry 6 -> $A618 ; CPU:$A600 PRG:2600 18 A6 + .word $A630 ; entry 7 -> $A630 ; CPU:$A602 PRG:2602 30 A6 + .word $A618 ; entry 8 -> $A618 ; CPU:$A604 PRG:2604 18 A6 + .word $A63C ; entry 9 -> $A63C ; CPU:$A606 PRG:2606 3C A6 + .word $A648 ; entry 10 -> $A648 ; CPU:$A608 PRG:2608 48 A6 + .word $A63C ; entry 11 -> $A63C ; CPU:$A60A PRG:260A 3C A6 + .word $A654 ; entry 12 -> $A654 ; CPU:$A60C PRG:260C 54 A6 + .word $A63C ; entry 13 -> $A63C ; CPU:$A60E PRG:260E 3C A6 + .word $A648 ; entry 14 -> $A648 ; CPU:$A610 PRG:2610 48 A6 + .word $A63C ; entry 15 -> $A63C ; CPU:$A612 PRG:2612 3C A6 + .word $A654 ; entry 16 -> $A654 ; CPU:$A614 PRG:2614 54 A6 + .word $A63C ; entry 17 -> $A63C ; CPU:$A616 PRG:2616 3C A6 +; Pass 3: packed tile/attribute sequences the pointer table above targets. Six records, twelve bytes apart ($A618 $A624 $A630 $A63C $A648) and a final ten-byte record at $A654; each is a short header followed by a descending run of tile indices. The last record ends with the two $30 terminator bytes. +; ---- data $A618-$A65F (72 bytes) ---- +StageDescriptorData: + .byte $6E, $6D, $6C, $6D, $6C, $69, $6B, $6A, $6B, $6A, $30, $30, $6E, $6D, $6C, $A3 ; CPU:$A618 PRG:2618 6E 6D 6C 6D 6C 69 6B 6A 6B 6A 30 30 6E 6D 6C A3 + .byte $A2, $9D, $9D, $9D, $A1, $A0, $9F, $9E, $AB, $AA, $A9, $A8, $A7, $A6, $A5, $A4 ; CPU:$A628 PRG:2628 A2 9D 9D 9D A1 A0 9F 9E AB AA A9 A8 A7 A6 A5 A4 + .byte $6B, $6A, $30, $30, $86, $84, $82, $84, $82, $81, $85, $83, $85, $83, $30, $30 ; CPU:$A638 PRG:2638 6B 6A 30 30 86 84 82 84 82 81 85 83 85 83 30 30 + .byte $86, $84, $82, $94, $93, $8E, $8E, $8E, $92, $91, $90, $8F, $97, $96, $95, $9C ; CPU:$A648 PRG:2648 86 84 82 94 93 8E 8E 8E 92 91 90 8F 97 96 95 9C + .byte $9B, $9A, $99, $98, $85, $83, $30, $30 ; CPU:$A658 PRG:2658 9B 9A 99 98 85 83 30 30 +SetSoundSequenceChannel4: + lda #$CB ; CPU:$A660 PRG:2660 A9 CB + sta SoundSequencePtrLo1 ; CPU:$A662 PRG:2662 85 D4 + lda #$B1 ; CPU:$A664 PRG:2664 A9 B1 + sta SoundSequencePtrHi1 ; CPU:$A666 PRG:2666 85 D8 + lda #$00 ; CPU:$A668 PRG:2668 A9 00 + sta SoundChannelStep1 ; CPU:$A66A PRG:266A 85 D0 + txa ; CPU:$A66C PRG:266C 8A + pha ; CPU:$A66D PRG:266D 48 + tya ; CPU:$A66E PRG:266E 98 + pha ; CPU:$A66F PRG:266F 48 + ldx #$00 ; CPU:$A670 PRG:2670 A2 00 + lda Zp52 ; CPU:$A672 PRG:2672 A5 52 + beq SetSoundSequenceChannel4_OnZero_A67F ; CPU:$A674 PRG:2674 F0 09 + ldx #$04 ; CPU:$A676 PRG:2676 A2 04 + lda Zp56 ; CPU:$A678 PRG:2678 A5 56 + beq SetSoundSequenceChannel4_OnZero_A67F ; CPU:$A67A PRG:267A F0 03 + pla ; CPU:$A67C PRG:267C 68 + pla ; CPU:$A67D PRG:267D 68 + rts ; CPU:$A67E PRG:267E 60 +; ----------------------------------------------------------------------------- +; Routine: SetSoundSequenceChannel4_OnZero_A67F +; Global: SetSoundSequenceChannel4_OnZero_A67F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetSoundSequenceChannel4_OnZero_A67F: + lda Zp51 ; CPU:$A67F PRG:267F A5 51 + sta Zp54,x ; CPU:$A681 PRG:2681 95 54 + pla ; CPU:$A683 PRG:2683 68 + sta Zp53,x ; CPU:$A684 PRG:2684 95 53 + pla ; CPU:$A686 PRG:2686 68 + sta Zp52,x ; CPU:$A687 PRG:2687 95 52 + lda #$1E ; CPU:$A689 PRG:2689 A9 1E + sta Zp55,x ; CPU:$A68B PRG:268B 95 55 + rts ; CPU:$A68D PRG:268D 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectList +; Global: Update the whole object list, then the second half of it. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectList: + ldx #$00 ; CPU:$A68E PRG:268E A2 00 + jsr $A695 ; CPU:$A690 PRG:2690 20 95 A6 + ldx #$04 ; CPU:$A693 PRG:2693 A2 04 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectListEntry +; Global: UpdateObjectListEntry.; called from $A690 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectListEntry: + lda Zp52,x ; CPU:$A695 PRG:2695 B5 52 + beq UpdateObjectListEntry_OnZero_A6EF ; CPU:$A697 PRG:2697 F0 56 + bmi UpdateObjectListEntry_OnNegative_A6BE ; CPU:$A699 PRG:2699 30 23 + dec Zp55,x ; CPU:$A69B PRG:269B D6 55 + beq UpdateObjectListEntry_OnZero_A6EB ; CPU:$A69D PRG:269D F0 4C + lda Zp53,x ; CPU:$A69F PRG:269F B5 53 + sta $0200,x ; CPU:$A6A1 PRG:26A1 9D 00 02 + sta $0208,x ; CPU:$A6A4 PRG:26A4 9D 08 02 + lda Zp54,x ; CPU:$A6A7 PRG:26A7 B5 54 + sec ; CPU:$A6A9 PRG:26A9 38 + sbc PpuScrollX ; CPU:$A6AA PRG:26AA E5 FE + sta $020B,x ; CPU:$A6AC PRG:26AC 9D 0B 02 + sec ; CPU:$A6AF PRG:26AF 38 + sbc #$08 ; CPU:$A6B0 PRG:26B0 E9 08 + sta $0203,x ; CPU:$A6B2 PRG:26B2 9D 03 02 + lda #$83 ; CPU:$A6B5 PRG:26B5 A9 83 + sta $0202,x ; CPU:$A6B7 PRG:26B7 9D 02 02 + lda #$C3 ; CPU:$A6BA PRG:26BA A9 C3 + bne UpdateObjectListEntry_OnNonzero_A6DF ; CPU:$A6BC PRG:26BC D0 21 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectListEntry_OnNegative_A6BE +; Global: UpdateObjectListEntry_OnNegative_A6BE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectListEntry_OnNegative_A6BE: + dec Zp55,x ; CPU:$A6BE PRG:26BE D6 55 + beq UpdateObjectListEntry_OnZero_A6EB ; CPU:$A6C0 PRG:26C0 F0 29 + lda Zp53,x ; CPU:$A6C2 PRG:26C2 B5 53 + sta $0200,x ; CPU:$A6C4 PRG:26C4 9D 00 02 + clc ; CPU:$A6C7 PRG:26C7 18 + adc #$08 ; CPU:$A6C8 PRG:26C8 69 08 + sta $0208,x ; CPU:$A6CA PRG:26CA 9D 08 02 + lda Zp54,x ; CPU:$A6CD PRG:26CD B5 54 + sec ; CPU:$A6CF PRG:26CF 38 + sbc PpuScrollX ; CPU:$A6D0 PRG:26D0 E5 FE + sta $0203,x ; CPU:$A6D2 PRG:26D2 9D 03 02 + sta $020B,x ; CPU:$A6D5 PRG:26D5 9D 0B 02 + lda #$03 ; CPU:$A6D8 PRG:26D8 A9 03 + sta $0202,x ; CPU:$A6DA PRG:26DA 9D 02 02 + lda #$83 ; CPU:$A6DD PRG:26DD A9 83 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectListEntry_OnNonzero_A6DF +; Global: UpdateObjectListEntry_OnNonzero_A6DF.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectListEntry_OnNonzero_A6DF: + sta $020A,x ; CPU:$A6DF PRG:26DF 9D 0A 02 + lda #$3E ; CPU:$A6E2 PRG:26E2 A9 3E + sta $0201,x ; CPU:$A6E4 PRG:26E4 9D 01 02 + sta $0209,x ; CPU:$A6E7 PRG:26E7 9D 09 02 + rts ; CPU:$A6EA PRG:26EA 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectListEntry_OnZero_A6EB +; Global: UpdateObjectListEntry_OnZero_A6EB.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectListEntry_OnZero_A6EB: + lda #$00 ; CPU:$A6EB PRG:26EB A9 00 + sta Zp52,x ; CPU:$A6ED PRG:26ED 95 52 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectListEntry_OnZero_A6EF +; Global: UpdateObjectListEntry_OnZero_A6EF.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectListEntry_OnZero_A6EF: + lda #$F0 ; CPU:$A6EF PRG:26EF A9 F0 + sta $0200,x ; CPU:$A6F1 PRG:26F1 9D 00 02 + sta $0208,x ; CPU:$A6F4 PRG:26F4 9D 08 02 + rts ; CPU:$A6F7 PRG:26F7 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions +; Global: Update object collisions and the object scroll test. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions: + lda Zp93 ; CPU:$A6F8 PRG:26F8 A5 93 + bne UpdateObjectCollisions_OnNonzero_A728 ; CPU:$A6FA PRG:26FA D0 2C + lda Zp8A ; CPU:$A6FC PRG:26FC A5 8A + cmp #$01 ; CPU:$A6FE PRG:26FE C9 01 + bcc UpdateObjectCollisions_OnCarryClear_A729 ; CPU:$A700 PRG:2700 90 27 + bne UpdateObjectCollisions_OnNonzero_A70D ; CPU:$A702 PRG:2702 D0 09 + lda #$20 ; CPU:$A704 PRG:2704 A9 20 + sta $2006 ; CPU:$A706 PRG:2706 8D 06 20 + lda #$7B ; CPU:$A709 PRG:2709 A9 7B + bne UpdateObjectCollisions_OnNonzero_A714 ; CPU:$A70B PRG:270B D0 07 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_OnNonzero_A70D +; Global: UpdateObjectCollisions_OnNonzero_A70D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_OnNonzero_A70D: + lda #$24 ; CPU:$A70D PRG:270D A9 24 + sta $2006 ; CPU:$A70F PRG:270F 8D 06 20 + lda #$62 ; CPU:$A712 PRG:2712 A9 62 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_OnNonzero_A714 +; Global: UpdateObjectCollisions_OnNonzero_A714.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_OnNonzero_A714: + sta $2006 ; CPU:$A714 PRG:2714 8D 06 20 + lda #$30 ; CPU:$A717 PRG:2717 A9 30 + sta $2007 ; CPU:$A719 PRG:2719 8D 07 20 + sta $2007 ; CPU:$A71C PRG:271C 8D 07 20 + sta $2007 ; CPU:$A71F PRG:271F 8D 07 20 + sta $2007 ; CPU:$A722 PRG:2722 8D 07 20 + sta $2007 ; CPU:$A725 PRG:2725 8D 07 20 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_OnNonzero_A728 +; Global: UpdateObjectCollisions_OnNonzero_A728.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_OnNonzero_A728: + rts ; CPU:$A728 PRG:2728 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_OnCarryClear_A729 +; Global: UpdateObjectCollisions_OnCarryClear_A729.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_OnCarryClear_A729: + lda ActionCooldown ; CPU:$A729 PRG:2729 A5 65 + beq UpdateObjectCollisions_OnZero_A79B ; CPU:$A72B PRG:272B F0 6E + lda #$20 ; CPU:$A72D PRG:272D A9 20 + sta $2006 ; CPU:$A72F PRG:272F 8D 06 20 + lda #$7B ; CPU:$A732 PRG:2732 A9 7B + sta $2006 ; CPU:$A734 PRG:2734 8D 06 20 + ldx Zp64 ; CPU:$A737 PRG:2737 A6 64 + ldy #$05 ; CPU:$A739 PRG:2739 A0 05 + lda #$38 ; CPU:$A73B PRG:273B A9 38 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_OnNonzero_A73D +; Global: UpdateObjectCollisions_OnNonzero_A73D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_OnNonzero_A73D: + sta $2007 ; CPU:$A73D PRG:273D 8D 07 20 + dex ; CPU:$A740 PRG:2740 CA + bne UpdateObjectCollisions_OnNonzero_A745 ; CPU:$A741 PRG:2741 D0 02 + lda #$30 ; CPU:$A743 PRG:2743 A9 30 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_OnNonzero_A745 +; Global: UpdateObjectCollisions_OnNonzero_A745.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_OnNonzero_A745: + dey ; CPU:$A745 PRG:2745 88 + bne UpdateObjectCollisions_OnNonzero_A73D ; CPU:$A746 PRG:2746 D0 F5 + lda #$24 ; CPU:$A748 PRG:2748 A9 24 + sta $2006 ; CPU:$A74A PRG:274A 8D 06 20 + lda #$62 ; CPU:$A74D PRG:274D A9 62 + sta $2006 ; CPU:$A74F PRG:274F 8D 06 20 + ldx ActionCooldown ; CPU:$A752 PRG:2752 A6 65 + ldy #$05 ; CPU:$A754 PRG:2754 A0 05 + lda #$30 ; CPU:$A756 PRG:2756 A9 30 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_OnNonzero_A758 +; Global: UpdateObjectCollisions_OnNonzero_A758.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_OnNonzero_A758: + dex ; CPU:$A758 PRG:2758 CA + bne UpdateObjectCollisions_OnNonzero_A75D ; CPU:$A759 PRG:2759 D0 02 + lda Zp77 ; CPU:$A75B PRG:275B A5 77 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_OnNonzero_A75D +; Global: UpdateObjectCollisions_OnNonzero_A75D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_OnNonzero_A75D: + sta $2007 ; CPU:$A75D PRG:275D 8D 07 20 + dey ; CPU:$A760 PRG:2760 88 + bne UpdateObjectCollisions_OnNonzero_A758 ; CPU:$A761 PRG:2761 D0 F5 + lda ScreenTransitionState ; CPU:$A763 PRG:2763 A5 68 + bne UpdateObjectCollisions_JoinBranchPaths_A78F ; CPU:$A765 PRG:2765 D0 28 + lda Zp66 ; CPU:$A767 PRG:2767 A5 66 + cmp #$04 ; CPU:$A769 PRG:2769 C9 04 + bcc UpdateObjectCollisions_OnCarryClear_A773 ; CPU:$A76B PRG:276B 90 06 + lda Zp64 ; CPU:$A76D PRG:276D A5 64 + cmp #$04 ; CPU:$A76F PRG:276F C9 04 + bcc UpdateObjectCollisions_OnCarryClear_A77F ; CPU:$A771 PRG:2771 90 0C +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_OnCarryClear_A773 +; Global: UpdateObjectCollisions_OnCarryClear_A773.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_OnCarryClear_A773: + lda Zp67 ; CPU:$A773 PRG:2773 A5 67 + cmp #$03 ; CPU:$A775 PRG:2775 C9 03 + bcs UpdateObjectCollisions_JoinBranchPaths_A78F ; CPU:$A777 PRG:2777 B0 16 + lda ActionCooldown ; CPU:$A779 PRG:2779 A5 65 + cmp #$03 ; CPU:$A77B PRG:277B C9 03 + bcc UpdateObjectCollisions_JoinBranchPaths_A78F ; CPU:$A77D PRG:277D 90 10 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_OnCarryClear_A77F +; Global: UpdateObjectCollisions_OnCarryClear_A77F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_OnCarryClear_A77F: + lda #$FF ; CPU:$A77F PRG:277F A9 FF + sta ScreenTransitionState ; CPU:$A781 PRG:2781 85 68 + lda #$80 ; CPU:$A783 PRG:2783 A9 80 + sta Zp6C ; CPU:$A785 PRG:2785 85 6C + lda #$01 ; CPU:$A787 PRG:2787 A9 01 + sta Zp69 ; CPU:$A789 PRG:2789 85 69 + lda #$0A ; CPU:$A78B PRG:278B A9 0A + sta Zp6A ; CPU:$A78D PRG:278D 85 6A +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_JoinBranchPaths_A78F +; Global: UpdateObjectCollisions_JoinBranchPaths_A78F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_JoinBranchPaths_A78F: + lda Zp64 ; CPU:$A78F PRG:278F A5 64 + sta Zp66 ; CPU:$A791 PRG:2791 85 66 + lda ActionCooldown ; CPU:$A793 PRG:2793 A5 65 + sta Zp67 ; CPU:$A795 PRG:2795 85 67 + lda #$00 ; CPU:$A797 PRG:2797 A9 00 + sta ActionCooldown ; CPU:$A799 PRG:2799 85 65 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_OnZero_A79B +; Global: UpdateObjectCollisions_OnZero_A79B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_OnZero_A79B: + rts ; CPU:$A79B PRG:279B 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectCollisions_OnZero_A79C +; Global: UpdateObjectCollisions_OnZero_A79C.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectCollisions_OnZero_A79C: + jmp $A82F ; CPU:$A79C PRG:279C 4C 2F A8 +; ----------------------------------------------------------------------------- +; Routine: CheckObjectScroll +; Global: CheckObjectScroll.; called from $87B0 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CheckObjectScroll: + lda PlayerActionState ; CPU:$A79F PRG:279F A5 F0 + cmp #$FE ; CPU:$A7A1 PRG:27A1 C9 FE + beq UpdateObjectCollisions_OnZero_A79C ; CPU:$A7A3 PRG:27A3 F0 F7 + lda PlayerActionState2 ; CPU:$A7A5 PRG:27A5 A5 F1 + cmp #$FE ; CPU:$A7A7 PRG:27A7 C9 FE + beq UpdateObjectCollisions_OnZero_A79C ; CPU:$A7A9 PRG:27A9 F0 F1 + lda ScreenTransitionState ; CPU:$A7AB PRG:27AB A5 68 + bne CheckObjectScroll_OnNonzero_A7B0 ; CPU:$A7AD PRG:27AD D0 01 + rts ; CPU:$A7AF PRG:27AF 60 +; ----------------------------------------------------------------------------- +; Routine: CheckObjectScroll_OnNonzero_A7B0 +; Global: CheckObjectScroll_OnNonzero_A7B0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CheckObjectScroll_OnNonzero_A7B0: + bpl CheckObjectScroll_OnNonnegative_A800 ; CPU:$A7B0 PRG:27B0 10 4E + lda Zp69 ; CPU:$A7B2 PRG:27B2 A5 69 + bmi CheckObjectScroll_OnNegative_A7CA ; CPU:$A7B4 PRG:27B4 30 14 + bne CheckObjectScroll_OnNonzero_A7E8 ; CPU:$A7B6 PRG:27B6 D0 30 +; ----------------------------------------------------------------------------- +; Routine: CheckObjectScroll_OnZero_A7B8 +; Global: CheckObjectScroll_OnZero_A7B8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CheckObjectScroll_OnZero_A7B8: + dec Zp6A ; CPU:$A7B8 PRG:27B8 C6 6A + bpl CheckObjectScroll_OnNonnegative_A7BF ; CPU:$A7BA PRG:27BA 10 03 + jmp $A834 ; CPU:$A7BC PRG:27BC 4C 34 A8 +; ----------------------------------------------------------------------------- +; Routine: CheckObjectScroll_OnNonnegative_A7BF +; Global: CheckObjectScroll_OnNonnegative_A7BF.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CheckObjectScroll_OnNonnegative_A7BF: + jsr $A8D1 ; CPU:$A7BF PRG:27BF 20 D1 A8 + and #$BF ; CPU:$A7C2 PRG:27C2 29 BF + clc ; CPU:$A7C4 PRG:27C4 18 + adc #$20 ; CPU:$A7C5 PRG:27C5 69 20 + sta Zp69 ; CPU:$A7C7 PRG:27C7 85 69 + rts ; CPU:$A7C9 PRG:27C9 60 +; ----------------------------------------------------------------------------- +; Routine: CheckObjectScroll_OnNegative_A7CA +; Global: CheckObjectScroll_OnNegative_A7CA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CheckObjectScroll_OnNegative_A7CA: + and #$7F ; CPU:$A7CA PRG:27CA 29 7F + beq CheckObjectScroll_OnZero_A7B8 ; CPU:$A7CC PRG:27CC F0 EA + lda Zp6B ; CPU:$A7CE PRG:27CE A5 6B + sec ; CPU:$A7D0 PRG:27D0 38 + sbc #$80 ; CPU:$A7D1 PRG:27D1 E9 80 + sta Zp6B ; CPU:$A7D3 PRG:27D3 85 6B + lda Zp6C ; CPU:$A7D5 PRG:27D5 A5 6C + sbc #$00 ; CPU:$A7D7 PRG:27D7 E9 00 + sta Zp6C ; CPU:$A7D9 PRG:27D9 85 6C + cmp #$64 ; CPU:$A7DB PRG:27DB C9 64 + bcs CheckObjectScroll_JoinBranchPaths_A7FD ; CPU:$A7DD PRG:27DD B0 1E + lda #$64 ; CPU:$A7DF PRG:27DF A9 64 +; ----------------------------------------------------------------------------- +; Routine: CheckObjectScroll_OnNonzero_A7E1 +; Global: CheckObjectScroll_OnNonzero_A7E1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CheckObjectScroll_OnNonzero_A7E1: + sta Zp6C ; CPU:$A7E1 PRG:27E1 85 6C + lda #$00 ; CPU:$A7E3 PRG:27E3 A9 00 + sta Zp69 ; CPU:$A7E5 PRG:27E5 85 69 + rts ; CPU:$A7E7 PRG:27E7 60 +; ----------------------------------------------------------------------------- +; Routine: CheckObjectScroll_OnNonzero_A7E8 +; Global: CheckObjectScroll_OnNonzero_A7E8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CheckObjectScroll_OnNonzero_A7E8: + lda Zp6B ; CPU:$A7E8 PRG:27E8 A5 6B + clc ; CPU:$A7EA PRG:27EA 18 + adc #$80 ; CPU:$A7EB PRG:27EB 69 80 + sta Zp6B ; CPU:$A7ED PRG:27ED 85 6B + lda Zp6C ; CPU:$A7EF PRG:27EF A5 6C + adc #$00 ; CPU:$A7F1 PRG:27F1 69 00 + sta Zp6C ; CPU:$A7F3 PRG:27F3 85 6C + cmp #$A4 ; CPU:$A7F5 PRG:27F5 C9 A4 + bcc CheckObjectScroll_JoinBranchPaths_A7FD ; CPU:$A7F7 PRG:27F7 90 04 + lda #$A3 ; CPU:$A7F9 PRG:27F9 A9 A3 + bne CheckObjectScroll_OnNonzero_A7E1 ; CPU:$A7FB PRG:27FB D0 E4 +; ----------------------------------------------------------------------------- +; Routine: CheckObjectScroll_JoinBranchPaths_A7FD +; Global: CheckObjectScroll_JoinBranchPaths_A7FD.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CheckObjectScroll_JoinBranchPaths_A7FD: + dec Zp69 ; CPU:$A7FD PRG:27FD C6 69 + rts ; CPU:$A7FF PRG:27FF 60 +; ----------------------------------------------------------------------------- +; Routine: CheckObjectScroll_OnNonnegative_A800 +; Global: CheckObjectScroll_OnNonnegative_A800.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CheckObjectScroll_OnNonnegative_A800: + lda Zp6F ; CPU:$A800 PRG:2800 A5 6F + clc ; CPU:$A802 PRG:2802 18 + adc Zp73 ; CPU:$A803 PRG:2803 65 73 + sta Zp6F ; CPU:$A805 PRG:2805 85 6F + lda PlayerBoxOriginY ; CPU:$A807 PRG:2807 A5 70 + adc Zp74 ; CPU:$A809 PRG:2809 65 74 + sta PlayerBoxOriginY ; CPU:$A80B PRG:280B 85 70 + lda PpuScrollX ; CPU:$A80D PRG:280D A5 FE + lsr a ; CPU:$A80F PRG:280F 4A + cmp PlayerBoxOriginY ; CPU:$A810 PRG:2810 C5 70 + bcs ClearScrollLatchAlt ; CPU:$A812 PRG:2812 B0 1B + ora #$80 ; CPU:$A814 PRG:2814 09 80 + cmp PlayerBoxOriginY ; CPU:$A816 PRG:2816 C5 70 + bcc ClearScrollLatchAlt ; CPU:$A818 PRG:2818 90 15 + lda Zp6D ; CPU:$A81A PRG:281A A5 6D + clc ; CPU:$A81C PRG:281C 18 + adc Zp71 ; CPU:$A81D PRG:281D 65 71 + sta Zp6D ; CPU:$A81F PRG:281F 85 6D + lda PlayerBoxOriginX ; CPU:$A821 PRG:2821 A5 6E + adc Zp72 ; CPU:$A823 PRG:2823 65 72 + sta PlayerBoxOriginX ; CPU:$A825 PRG:2825 85 6E + cmp #$30 ; CPU:$A827 PRG:2827 C9 30 + bcc ClearScrollLatchAlt ; CPU:$A829 PRG:2829 90 04 + cmp #$E8 ; CPU:$A82B PRG:282B C9 E8 + bcc ClearScrollLatchAlt_OnCarryClear_A833 ; CPU:$A82D PRG:282D 90 04 +; ----------------------------------------------------------------------------- +; Routine: ClearScrollLatchAlt +; Global: ClearScrollLatchAlt.; called from $A79C +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearScrollLatchAlt: + lda #$00 ; CPU:$A82F PRG:282F A9 00 + sta ScreenTransitionState ; CPU:$A831 PRG:2831 85 68 +; ----------------------------------------------------------------------------- +; Routine: ClearScrollLatchAlt_OnCarryClear_A833 +; Global: ClearScrollLatchAlt_OnCarryClear_A833.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearScrollLatchAlt_OnCarryClear_A833: + rts ; CPU:$A833 PRG:2833 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectSprite +; Global: UpdateObjectSprite.; called from $A7BC +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectSprite: + lda #$01 ; CPU:$A834 PRG:2834 A9 01 + sta ScreenTransitionState ; CPU:$A836 PRG:2836 85 68 + ldx #$00 ; CPU:$A838 PRG:2838 A2 00 + lda Zp4F ; CPU:$A83A PRG:283A A5 4F + cmp Zp50 ; CPU:$A83C PRG:283C C5 50 + bcc UpdateObjectSprite_OnCarryClear_A842 ; CPU:$A83E PRG:283E 90 02 + ldx #$04 ; CPU:$A840 PRG:2840 A2 04 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectSprite_OnCarryClear_A842 +; Global: UpdateObjectSprite_OnCarryClear_A842.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectSprite_OnCarryClear_A842: + lda FrameCounterLo ; CPU:$A842 PRG:2842 A5 24 + ror a ; CPU:$A844 PRG:2844 6A + bcs UpdateObjectSprite_OnCarrySet_A856 ; CPU:$A845 PRG:2845 B0 0F + lda PlayerPosXLo1,x ; CPU:$A847 PRG:2847 B5 3A + sec ; CPU:$A849 PRG:2849 38 + sbc #$30 ; CPU:$A84A PRG:284A E9 30 + sta Zp16 ; CPU:$A84C PRG:284C 85 16 + lda #$48 ; CPU:$A84E PRG:284E A9 48 + sta PlayerBoxOriginX ; CPU:$A850 PRG:2850 85 6E + lda #$00 ; CPU:$A852 PRG:2852 A9 00 + beq UpdateObjectSprite_OnZero_A862 ; CPU:$A854 PRG:2854 F0 0C +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectSprite_OnCarrySet_A856 +; Global: UpdateObjectSprite_OnCarrySet_A856.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectSprite_OnCarrySet_A856: + lda #$C8 ; CPU:$A856 PRG:2856 A9 C8 + sbc PlayerPosXLo1,x ; CPU:$A858 PRG:2858 F5 3A + sta Zp16 ; CPU:$A85A PRG:285A 85 16 + lda #$E0 ; CPU:$A85C PRG:285C A9 E0 + sta PlayerBoxOriginX ; CPU:$A85E PRG:285E 85 6E + lda #$FF ; CPU:$A860 PRG:2860 A9 FF +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectSprite_OnZero_A862 +; Global: UpdateObjectSprite_OnZero_A862.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectSprite_OnZero_A862: + sta Zp72 ; CPU:$A862 PRG:2862 85 72 + lda Zp3B,x ; CPU:$A864 PRG:2864 B5 3B + sec ; CPU:$A866 PRG:2866 38 + sbc Zp6B ; CPU:$A867 PRG:2867 E5 6B + sta SourcePointerLo ; CPU:$A869 PRG:2869 85 10 + lda PlayerPosYLo1,x ; CPU:$A86B PRG:286B B5 3C + sbc Zp6C ; CPU:$A86D PRG:286D E5 6C + bcc SetObjectFlags_OnCarryClear_A89D ; CPU:$A86F PRG:286F 90 2C + lsr a ; CPU:$A871 PRG:2871 4A + sta Zp19 ; CPU:$A872 PRG:2872 85 19 + lda SourcePointerLo ; CPU:$A874 PRG:2874 A5 10 + ror a ; CPU:$A876 PRG:2876 6A + sta Zp18 ; CPU:$A877 PRG:2877 85 18 + jsr $A0C6 ; CPU:$A879 PRG:2879 20 C6 A0 + lda DestinationPointerLo ; CPU:$A87C PRG:287C A5 12 + sta Zp73 ; CPU:$A87E PRG:287E 85 73 + lda DestinationPointerHi ; CPU:$A880 PRG:2880 A5 13 + sta Zp74 ; CPU:$A882 PRG:2882 85 74 +; ----------------------------------------------------------------------------- +; Routine: SetObjectFlags +; Global: SetObjectFlags.; called from $A8CE +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetObjectFlags: + lda #$80 ; CPU:$A884 PRG:2884 A9 80 + sta Zp71 ; CPU:$A886 PRG:2886 85 71 + lda Zp6B ; CPU:$A888 PRG:2888 A5 6B + sta Zp6F ; CPU:$A88A PRG:288A 85 6F + lda Zp6C ; CPU:$A88C PRG:288C A5 6C + sta PlayerBoxOriginY ; CPU:$A88E PRG:288E 85 70 + lda #$AE ; CPU:$A890 PRG:2890 A9 AE + sta SoundSequencePtrLo2 ; CPU:$A892 PRG:2892 85 D5 + lda #$B2 ; CPU:$A894 PRG:2894 A9 B2 + sta SoundSequencePtrHi2 ; CPU:$A896 PRG:2896 85 D9 + lda #$00 ; CPU:$A898 PRG:2898 A9 00 + sta SoundChannelStep2 ; CPU:$A89A PRG:289A 85 D1 + rts ; CPU:$A89C PRG:289C 60 +; ----------------------------------------------------------------------------- +; Routine: SetObjectFlags_OnCarryClear_A89D +; Global: SetObjectFlags_OnCarryClear_A89D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetObjectFlags_OnCarryClear_A89D: + eor #$FF ; CPU:$A89D PRG:289D 49 FF + sta SourcePointerHi ; CPU:$A89F PRG:289F 85 11 + lda SourcePointerLo ; CPU:$A8A1 PRG:28A1 A5 10 + eor #$FF ; CPU:$A8A3 PRG:28A3 49 FF + clc ; CPU:$A8A5 PRG:28A5 18 + adc #$01 ; CPU:$A8A6 PRG:28A6 69 01 + sta SourcePointerLo ; CPU:$A8A8 PRG:28A8 85 10 + lda SourcePointerHi ; CPU:$A8AA PRG:28AA A5 11 + adc #$00 ; CPU:$A8AC PRG:28AC 69 00 + lsr a ; CPU:$A8AE PRG:28AE 4A + sta Zp19 ; CPU:$A8AF PRG:28AF 85 19 + lda SourcePointerLo ; CPU:$A8B1 PRG:28B1 A5 10 + ror a ; CPU:$A8B3 PRG:28B3 6A + sta Zp18 ; CPU:$A8B4 PRG:28B4 85 18 + jsr $A0C6 ; CPU:$A8B6 PRG:28B6 20 C6 A0 + lda DestinationPointerHi ; CPU:$A8B9 PRG:28B9 A5 13 + eor #$FF ; CPU:$A8BB PRG:28BB 49 FF + sta DestinationPointerHi ; CPU:$A8BD PRG:28BD 85 13 + lda DestinationPointerLo ; CPU:$A8BF PRG:28BF A5 12 + eor #$FF ; CPU:$A8C1 PRG:28C1 49 FF + clc ; CPU:$A8C3 PRG:28C3 18 + adc #$01 ; CPU:$A8C4 PRG:28C4 69 01 + sta Zp73 ; CPU:$A8C6 PRG:28C6 85 73 + lda DestinationPointerHi ; CPU:$A8C8 PRG:28C8 A5 13 + adc #$00 ; CPU:$A8CA PRG:28CA 69 00 + sta Zp74 ; CPU:$A8CC PRG:28CC 85 74 + jmp $A884 ; CPU:$A8CE PRG:28CE 4C 84 A8 +; ----------------------------------------------------------------------------- +; Routine: AdvanceObjectFrame +; Global: Advance an object animation frame from the table at ($75),y. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceObjectFrame: + ldy #$00 ; CPU:$A8D1 PRG:28D1 A0 00 + lda (Zp75),y ; CPU:$A8D3 PRG:28D3 B1 75 + tax ; CPU:$A8D5 PRG:28D5 AA + lda Zp75 ; CPU:$A8D6 PRG:28D6 A5 75 + clc ; CPU:$A8D8 PRG:28D8 18 + adc #$01 ; CPU:$A8D9 PRG:28D9 69 01 + sta Zp75 ; CPU:$A8DB PRG:28DB 85 75 + lda Zp76 ; CPU:$A8DD PRG:28DD A5 76 + adc #$00 ; CPU:$A8DF PRG:28DF 69 00 + and #$3F ; CPU:$A8E1 PRG:28E1 29 3F + ora #$80 ; CPU:$A8E3 PRG:28E3 09 80 + sta Zp76 ; CPU:$A8E5 PRG:28E5 85 76 + txa ; CPU:$A8E7 PRG:28E7 8A + rts ; CPU:$A8E8 PRG:28E8 60 +; ----------------------------------------------------------------------------- +; Routine: TestObjectActive +; Global: TestObjectActive.; called from $87B6 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestObjectActive: + lda ScreenTransitionState ; CPU:$A8E9 PRG:28E9 A5 68 + bne TestObjectActive_OnNonzero_A8F9 ; CPU:$A8EB PRG:28EB D0 0C + lda #$F0 ; CPU:$A8ED PRG:28ED A9 F0 + sta $02F0 ; CPU:$A8EF PRG:28EF 8D F0 02 + sta $02F4 ; CPU:$A8F2 PRG:28F2 8D F4 02 + sta $02F8 ; CPU:$A8F5 PRG:28F5 8D F8 02 + rts ; CPU:$A8F8 PRG:28F8 60 +; ----------------------------------------------------------------------------- +; Routine: TestObjectActive_OnNonzero_A8F9 +; Global: TestObjectActive_OnNonzero_A8F9.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestObjectActive_OnNonzero_A8F9: + bpl TestObjectActive_OnNonnegative_A916 ; CPU:$A8F9 PRG:28F9 10 1B + lda #$4C ; CPU:$A8FB PRG:28FB A9 4C + sta $02F4 ; CPU:$A8FD PRG:28FD 8D F4 02 + sta $02F8 ; CPU:$A900 PRG:2900 8D F8 02 + lda #$23 ; CPU:$A903 PRG:2903 A9 23 + sta $02F6 ; CPU:$A905 PRG:2905 8D F6 02 + sta $02FA ; CPU:$A908 PRG:2908 8D FA 02 + ldx #$42 ; CPU:$A90B PRG:290B A2 42 + stx $02F5 ; CPU:$A90D PRG:290D 8E F5 02 + inx ; CPU:$A910 PRG:2910 E8 + stx $02F9 ; CPU:$A911 PRG:2911 8E F9 02 + bne TestObjectActive_OnNonzero_A936 ; CPU:$A914 PRG:2914 D0 20 +; ----------------------------------------------------------------------------- +; Routine: TestObjectActive_OnNonnegative_A916 +; Global: TestObjectActive_OnNonnegative_A916.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestObjectActive_OnNonnegative_A916: + lda PlayerBoxOriginX ; CPU:$A916 PRG:2916 A5 6E + sta $02F0 ; CPU:$A918 PRG:2918 8D F0 02 + lda Zp6F ; CPU:$A91B PRG:291B A5 6F + asl a ; CPU:$A91D PRG:291D 0A + lda PlayerBoxOriginY ; CPU:$A91E PRG:291E A5 70 + rol a ; CPU:$A920 PRG:2920 2A + sec ; CPU:$A921 PRG:2921 38 + sbc #$04 ; CPU:$A922 PRG:2922 E9 04 + sec ; CPU:$A924 PRG:2924 38 + sbc PpuScrollX ; CPU:$A925 PRG:2925 E5 FE + sta $02F3 ; CPU:$A927 PRG:2927 8D F3 02 + lda FrameCounterLo ; CPU:$A92A PRG:292A A5 24 + and #$03 ; CPU:$A92C PRG:292C 29 03 + sta $02F2 ; CPU:$A92E PRG:292E 8D F2 02 + lda #$FF ; CPU:$A931 PRG:2931 A9 FF + sta $02F1 ; CPU:$A933 PRG:2933 8D F1 02 +; ----------------------------------------------------------------------------- +; Routine: TestObjectActive_OnNonzero_A936 +; Global: TestObjectActive_OnNonzero_A936.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +TestObjectActive_OnNonzero_A936: + lda Zp6B ; CPU:$A936 PRG:2936 A5 6B + asl a ; CPU:$A938 PRG:2938 0A + lda Zp6C ; CPU:$A939 PRG:2939 A5 6C + rol a ; CPU:$A93B PRG:293B 2A + sec ; CPU:$A93C PRG:293C 38 + sbc PpuScrollX ; CPU:$A93D PRG:293D E5 FE + sta $02FB ; CPU:$A93F PRG:293F 8D FB 02 + sec ; CPU:$A942 PRG:2942 38 + sbc #$08 ; CPU:$A943 PRG:2943 E9 08 + sta $02F7 ; CPU:$A945 PRG:2945 8D F7 02 + rts ; CPU:$A948 PRG:2948 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectAnimations +; Global: Update both players' object animations. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectAnimations: + lda #$01 ; CPU:$A949 PRG:2949 A9 01 + sta ActorIndex ; CPU:$A94B PRG:294B 85 1E + jsr $A952 ; CPU:$A94D PRG:294D 20 52 A9 + dec ActorIndex ; CPU:$A950 PRG:2950 C6 1E +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectAnimation +; Global: UpdateObjectAnimation.; called from $A94D +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectAnimation: + lda ScreenTransitionState ; CPU:$A952 PRG:2952 A5 68 + beq UpdateObjectAnimation_JoinBranchPaths_A991 ; CPU:$A954 PRG:2954 F0 3B + bmi UpdateObjectAnimation_JoinBranchPaths_A991 ; CPU:$A956 PRG:2956 30 39 + lda ActorIndex ; CPU:$A958 PRG:2958 A5 1E + tay ; CPU:$A95A PRG:295A A8 + asl a ; CPU:$A95B PRG:295B 0A + asl a ; CPU:$A95C PRG:295C 0A + tax ; CPU:$A95D PRG:295D AA + lda PlayerPosXLo1,x ; CPU:$A95E PRG:295E B5 3A + sec ; CPU:$A960 PRG:2960 38 + sbc PlayerBoxOriginX ; CPU:$A961 PRG:2961 E5 6E + clc ; CPU:$A963 PRG:2963 18 + adc #$1C ; CPU:$A964 PRG:2964 69 1C + cmp #$08 ; CPU:$A966 PRG:2966 C9 08 + bcs UpdateObjectAnimation_JoinBranchPaths_A991 ; CPU:$A968 PRG:2968 B0 27 + lda PlayerPosYLo1,x ; CPU:$A96A PRG:296A B5 3C + sec ; CPU:$A96C PRG:296C 38 + sbc PlayerBoxOriginY ; CPU:$A96D PRG:296D E5 70 + clc ; CPU:$A96F PRG:296F 18 + adc #$08 ; CPU:$A970 PRG:2970 69 08 + cmp #$10 ; CPU:$A972 PRG:2972 C9 10 + bcs UpdateObjectAnimation_JoinBranchPaths_A991 ; CPU:$A974 PRG:2974 B0 1B + lda $004F,y ; CPU:$A976 PRG:2976 B9 4F 00 + clc ; CPU:$A979 PRG:2979 18 + adc #$14 ; CPU:$A97A PRG:297A 69 14 + cmp #$64 ; CPU:$A97C PRG:297C C9 64 + bcc UpdateObjectAnimation_OnCarryClear_A982 ; CPU:$A97E PRG:297E 90 02 + lda #$63 ; CPU:$A980 PRG:2980 A9 63 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectAnimation_OnCarryClear_A982 +; Global: UpdateObjectAnimation_OnCarryClear_A982.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectAnimation_OnCarryClear_A982: + sta $004F,y ; CPU:$A982 PRG:2982 99 4F 00 + lda #$00 ; CPU:$A985 PRG:2985 A9 00 + sta ScreenTransitionState ; CPU:$A987 PRG:2987 85 68 + lda #$96 ; CPU:$A989 PRG:2989 A9 96 + sta $0078,y ; CPU:$A98B PRG:298B 99 78 00 + jsr $82ED ; CPU:$A98E PRG:298E 20 ED 82 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectAnimation_JoinBranchPaths_A991 +; Global: UpdateObjectAnimation_JoinBranchPaths_A991.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectAnimation_JoinBranchPaths_A991: + rts ; CPU:$A991 PRG:2991 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectTimer +; Global: UpdateObjectTimer.; called from $87B9 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectTimer: + lda FrameCounterLo ; CPU:$A992 PRG:2992 A5 24 + and #$03 ; CPU:$A994 PRG:2994 29 03 + bne DecrementObjectCounter_JoinBranchPaths_A9AA ; CPU:$A996 PRG:2996 D0 12 + ldx #$00 ; CPU:$A998 PRG:2998 A2 00 + jsr $A99E ; CPU:$A99A PRG:299A 20 9E A9 + inx ; CPU:$A99D PRG:299D E8 +; ----------------------------------------------------------------------------- +; Routine: DecrementObjectCounter +; Global: DecrementObjectCounter.; called from $A99A +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +DecrementObjectCounter: + lda PlayerActiveFlag,x ; CPU:$A99E PRG:299E B5 78 + beq DecrementObjectCounter_OnZero_A9A4 ; CPU:$A9A0 PRG:29A0 F0 02 + dec PlayerActiveFlag,x ; CPU:$A9A2 PRG:29A2 D6 78 +; ----------------------------------------------------------------------------- +; Routine: DecrementObjectCounter_OnZero_A9A4 +; Global: DecrementObjectCounter_OnZero_A9A4.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +DecrementObjectCounter_OnZero_A9A4: + lda Zp88,x ; CPU:$A9A4 PRG:29A4 B5 88 + beq DecrementObjectCounter_JoinBranchPaths_A9AA ; CPU:$A9A6 PRG:29A6 F0 02 + dec Zp88,x ; CPU:$A9A8 PRG:29A8 D6 88 +; ----------------------------------------------------------------------------- +; Routine: DecrementObjectCounter_JoinBranchPaths_A9AA +; Global: DecrementObjectCounter_JoinBranchPaths_A9AA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +DecrementObjectCounter_JoinBranchPaths_A9AA: + rts ; CPU:$A9AA PRG:29AA 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectState +; Global: UpdateObjectState.; called from $87BC +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectState: + lda Zp84 ; CPU:$A9AB PRG:29AB A5 84 + beq UpdateObjectState_OnZero_A9CD ; CPU:$A9AD PRG:29AD F0 1E + bmi UpdateObjectState_OnNegative_A9D6 ; CPU:$A9AF PRG:29AF 30 25 + ror a ; CPU:$A9B1 PRG:29B1 6A + bcs ToggleScrollRegionFlip_OnCarrySet_A9EA ; CPU:$A9B2 PRG:29B2 B0 36 + lda Zp85 ; CPU:$A9B4 PRG:29B4 A5 85 + sec ; CPU:$A9B6 PRG:29B6 38 + sbc #$03 ; CPU:$A9B7 PRG:29B7 E9 03 + sta Zp85 ; CPU:$A9B9 PRG:29B9 85 85 + lda Zp86 ; CPU:$A9BB PRG:29BB A5 86 + sbc #$00 ; CPU:$A9BD PRG:29BD E9 00 + sta Zp86 ; CPU:$A9BF PRG:29BF 85 86 + bne BuildObjectList ; CPU:$A9C1 PRG:29C1 D0 3C + lda Zp85 ; CPU:$A9C3 PRG:29C3 A5 85 + cmp PpuScrollX ; CPU:$A9C5 PRG:29C5 C5 FE + bcs BuildObjectList ; CPU:$A9C7 PRG:29C7 B0 36 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectState_OnCarrySet_A9C9 +; Global: UpdateObjectState_OnCarrySet_A9C9.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectState_OnCarrySet_A9C9: + lda #$00 ; CPU:$A9C9 PRG:29C9 A9 00 + sta Zp84 ; CPU:$A9CB PRG:29CB 85 84 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectState_OnZero_A9CD +; Global: UpdateObjectState_OnZero_A9CD.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectState_OnZero_A9CD: + lda #$F0 ; CPU:$A9CD PRG:29CD A9 F0 + sta $0210 ; CPU:$A9CF PRG:29CF 8D 10 02 + sta $0214 ; CPU:$A9D2 PRG:29D2 8D 14 02 + rts ; CPU:$A9D5 PRG:29D5 60 +; ----------------------------------------------------------------------------- +; Routine: UpdateObjectState_OnNegative_A9D6 +; Global: UpdateObjectState_OnNegative_A9D6.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateObjectState_OnNegative_A9D6: + inc Zp84 ; CPU:$A9D6 PRG:29D6 E6 84 +; ----------------------------------------------------------------------------- +; Routine: ToggleScrollRegionFlip +; Global: ToggleScrollRegionFlip.; called from $AA0A +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ToggleScrollRegionFlip: + lda FrameCounterLo ; CPU:$A9D8 PRG:29D8 A5 24 + and #$03 ; CPU:$A9DA PRG:29DA 29 03 + bne ToggleScrollRegionFlip_OnNonzero_A9E9 ; CPU:$A9DC PRG:29DC D0 0B + lda $0212 ; CPU:$A9DE PRG:29DE AD 12 02 + eor #$40 ; CPU:$A9E1 PRG:29E1 49 40 + sta $0212 ; CPU:$A9E3 PRG:29E3 8D 12 02 + sta $0216 ; CPU:$A9E6 PRG:29E6 8D 16 02 +; ----------------------------------------------------------------------------- +; Routine: ToggleScrollRegionFlip_OnNonzero_A9E9 +; Global: ToggleScrollRegionFlip_OnNonzero_A9E9.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ToggleScrollRegionFlip_OnNonzero_A9E9: + rts ; CPU:$A9E9 PRG:29E9 60 +; ----------------------------------------------------------------------------- +; Routine: ToggleScrollRegionFlip_OnCarrySet_A9EA +; Global: ToggleScrollRegionFlip_OnCarrySet_A9EA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ToggleScrollRegionFlip_OnCarrySet_A9EA: + lda Zp85 ; CPU:$A9EA PRG:29EA A5 85 + clc ; CPU:$A9EC PRG:29EC 18 + adc #$03 ; CPU:$A9ED PRG:29ED 69 03 + sta Zp85 ; CPU:$A9EF PRG:29EF 85 85 + lda Zp86 ; CPU:$A9F1 PRG:29F1 A5 86 + adc #$00 ; CPU:$A9F3 PRG:29F3 69 00 + sta Zp86 ; CPU:$A9F5 PRG:29F5 85 86 + beq BuildObjectList ; CPU:$A9F7 PRG:29F7 F0 06 + lda Zp85 ; CPU:$A9F9 PRG:29F9 A5 85 + cmp PpuScrollX ; CPU:$A9FB PRG:29FB C5 FE + bcs UpdateObjectState_OnCarrySet_A9C9 ; CPU:$A9FD PRG:29FD B0 CA +; ----------------------------------------------------------------------------- +; Routine: BuildObjectList +; Global: BuildObjectList.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +BuildObjectList: + lda Zp85 ; CPU:$A9FF PRG:29FF A5 85 + sec ; CPU:$AA01 PRG:2A01 38 + sbc PpuScrollX ; CPU:$AA02 PRG:2A02 E5 FE + sta $0213 ; CPU:$AA04 PRG:2A04 8D 13 02 + sta $0217 ; CPU:$AA07 PRG:2A07 8D 17 02 + jsr $A9D8 ; CPU:$AA0A PRG:2A0A 20 D8 A9 + ldx Zp87 ; CPU:$AA0D PRG:2A0D A6 87 + txa ; CPU:$AA0F PRG:2A0F 8A + asl a ; CPU:$AA10 PRG:2A10 0A + asl a ; CPU:$AA11 PRG:2A11 0A + tay ; CPU:$AA12 PRG:2A12 A8 + lda $003A,y ; CPU:$AA13 PRG:2A13 B9 3A 00 + sec ; CPU:$AA16 PRG:2A16 38 + sbc $0033,y ; CPU:$AA17 PRG:2A17 F9 33 00 + sec ; CPU:$AA1A PRG:2A1A 38 + sbc $0210 ; CPU:$AA1B PRG:2A1B ED 10 02 + clc ; CPU:$AA1E PRG:2A1E 18 + adc #$1C ; CPU:$AA1F PRG:2A1F 69 1C + cmp #$28 ; CPU:$AA21 PRG:2A21 C9 28 + bcs ToggleScrollRegionFlip_OnCarrySet_AA55 ; CPU:$AA23 PRG:2A23 B0 30 + lda Zp86 ; CPU:$AA25 PRG:2A25 A5 86 + lsr a ; CPU:$AA27 PRG:2A27 4A + lda Zp85 ; CPU:$AA28 PRG:2A28 A5 85 + ror a ; CPU:$AA2A PRG:2A2A 6A + sec ; CPU:$AA2B PRG:2A2B 38 + sbc $003C,y ; CPU:$AA2C PRG:2A2C F9 3C 00 + clc ; CPU:$AA2F PRG:2A2F 18 + adc #$08 ; CPU:$AA30 PRG:2A30 69 08 + cmp #$0C ; CPU:$AA32 PRG:2A32 C9 0C + bcs ToggleScrollRegionFlip_OnCarrySet_AA55 ; CPU:$AA34 PRG:2A34 B0 1F + lda #$C0 ; CPU:$AA36 PRG:2A36 A9 C0 + sta Zp84 ; CPU:$AA38 PRG:2A38 85 84 + lda #$4B ; CPU:$AA3A PRG:2A3A A9 4B + sta $0034,y ; CPU:$AA3C PRG:2A3C 99 34 00 + lda #$FB ; CPU:$AA3F PRG:2A3F A9 FB + sta PlayerActionState,x ; CPU:$AA41 PRG:2A41 95 F0 + jsr $A4FF ; CPU:$AA43 PRG:2A43 20 FF A4 + lda #$4F ; CPU:$AA46 PRG:2A46 A9 4F + sta $0034,y ; CPU:$AA48 PRG:2A48 99 34 00 + lda #$FA ; CPU:$AA4B PRG:2A4B A9 FA + sta PlayerActionState,x ; CPU:$AA4D PRG:2A4D 95 F0 + lda #$00 ; CPU:$AA4F PRG:2A4F A9 00 + sta ScriptFlags ; CPU:$AA51 PRG:2A51 85 41 + sta Zp42 ; CPU:$AA53 PRG:2A53 85 42 +; ----------------------------------------------------------------------------- +; Routine: ToggleScrollRegionFlip_OnCarrySet_AA55 +; Global: ToggleScrollRegionFlip_OnCarrySet_AA55.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ToggleScrollRegionFlip_OnCarrySet_AA55: + rts ; CPU:$AA55 PRG:2A55 60 +; ----------------------------------------------------------------------------- +; Routine: ReadControllers +; Global: Read both controller ports: strobe $4016, shift eight bits per port into zero page $FA/$FB, save the previous byte in $F4/$F5, and derive the face/direction masks in $F6-$F9. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllers: + ldx #$01 ; CPU:$AA56 PRG:2A56 A2 01 + stx $4016 ; CPU:$AA58 PRG:2A58 8E 16 40 + dex ; CPU:$AA5B PRG:2A5B CA + stx $4016 ; CPU:$AA5C PRG:2A5C 8E 16 40 + jsr $AA63 ; CPU:$AA5F PRG:2A5F 20 63 AA + inx ; CPU:$AA62 PRG:2A62 E8 +; ----------------------------------------------------------------------------- +; Routine: ReadControllerShiftRegister +; Global: Shift one controller port's eight bits in from $4016/4017 and run the edge-detection post-processing. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllerShiftRegister: + lda ControllerButtons1,x ; CPU:$AA63 PRG:2A63 B5 FA + sta ControllerButtonsPrev,x ; CPU:$AA65 PRG:2A65 95 F4 + ldy #$08 ; CPU:$AA67 PRG:2A67 A0 08 +; ----------------------------------------------------------------------------- +; Routine: ReadControllerShiftRegister_OnNonzero_AA69 +; Global: ReadControllerShiftRegister_OnNonzero_AA69.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllerShiftRegister_OnNonzero_AA69: + lda $4016,x ; CPU:$AA69 PRG:2A69 BD 16 40 + and #$03 ; CPU:$AA6C PRG:2A6C 29 03 + cmp #$01 ; CPU:$AA6E PRG:2A6E C9 01 + rol ControllerButtons1,x ; CPU:$AA70 PRG:2A70 36 FA + dey ; CPU:$AA72 PRG:2A72 88 + bne ReadControllerShiftRegister_OnNonzero_AA69 ; CPU:$AA73 PRG:2A73 D0 F4 + lda $0322 ; CPU:$AA75 PRG:2A75 AD 22 03 + bne ReadControllerShiftRegister_JoinBranchPaths_AA82 ; CPU:$AA78 PRG:2A78 D0 08 + lda $032B,x ; CPU:$AA7A PRG:2A7A BD 2B 03 + beq ReadControllerShiftRegister_JoinBranchPaths_AA82 ; CPU:$AA7D PRG:2A7D F0 03 + jsr $AD19 ; CPU:$AA7F PRG:2A7F 20 19 AD +; ----------------------------------------------------------------------------- +; Routine: ReadControllerShiftRegister_JoinBranchPaths_AA82 +; Global: ReadControllerShiftRegister_JoinBranchPaths_AA82.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllerShiftRegister_JoinBranchPaths_AA82: + lda PlayerActionState,x ; CPU:$AA82 PRG:2A82 B5 F0 + beq ReadControllerShiftRegister_OnZero_AA98 ; CPU:$AA84 PRG:2A84 F0 12 + cmp #$F0 ; CPU:$AA86 PRG:2A86 C9 F0 + bcs ReadControllerShiftRegister_OnCarrySet_AA9D ; CPU:$AA88 PRG:2A88 B0 13 + cmp #$E0 ; CPU:$AA8A PRG:2A8A C9 E0 + bcs ReadControllerShiftRegister_OnCarrySet_AAA1 ; CPU:$AA8C PRG:2A8C B0 13 + cmp #$D0 ; CPU:$AA8E PRG:2A8E C9 D0 + bcs ReadControllerShiftRegister_OnCarrySet_AAA8 ; CPU:$AA90 PRG:2A90 B0 16 + cmp #$C0 ; CPU:$AA92 PRG:2A92 C9 C0 + bcs ReadControllerShiftRegister_OnCarrySet_AAB4 ; CPU:$AA94 PRG:2A94 B0 1E + bcc ReadControllerShiftRegister_OnCarryClear_AAAE ; CPU:$AA96 PRG:2A96 90 16 +; ----------------------------------------------------------------------------- +; Routine: ReadControllerShiftRegister_OnZero_AA98 +; Global: ReadControllerShiftRegister_OnZero_AA98.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllerShiftRegister_OnZero_AA98: + lda ControllerButtons1,x ; CPU:$AA98 PRG:2A98 B5 FA + jmp $AAB8 ; CPU:$AA9A PRG:2A9A 4C B8 AA +; ----------------------------------------------------------------------------- +; Routine: ReadControllerShiftRegister_OnCarrySet_AA9D +; Global: ReadControllerShiftRegister_OnCarrySet_AA9D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllerShiftRegister_OnCarrySet_AA9D: + lda #$00 ; CPU:$AA9D PRG:2A9D A9 00 + beq StoreControllerButtonBits ; CPU:$AA9F PRG:2A9F F0 17 +; ----------------------------------------------------------------------------- +; Routine: ReadControllerShiftRegister_OnCarrySet_AAA1 +; Global: ReadControllerShiftRegister_OnCarrySet_AAA1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllerShiftRegister_OnCarrySet_AAA1: + lda ControllerButtons1,x ; CPU:$AAA1 PRG:2AA1 B5 FA + and #$80 ; CPU:$AAA3 PRG:2AA3 29 80 + jmp $AAB8 ; CPU:$AAA5 PRG:2AA5 4C B8 AA +; ----------------------------------------------------------------------------- +; Routine: ReadControllerShiftRegister_OnCarrySet_AAA8 +; Global: ReadControllerShiftRegister_OnCarrySet_AAA8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllerShiftRegister_OnCarrySet_AAA8: + lda ControllerButtons1,x ; CPU:$AAA8 PRG:2AA8 B5 FA + and #$40 ; CPU:$AAAA PRG:2AAA 29 40 + bpl StoreControllerButtonBits ; CPU:$AAAC PRG:2AAC 10 0A +; ----------------------------------------------------------------------------- +; Routine: ReadControllerShiftRegister_OnCarryClear_AAAE +; Global: ReadControllerShiftRegister_OnCarryClear_AAAE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllerShiftRegister_OnCarryClear_AAAE: + lda ControllerButtons1,x ; CPU:$AAAE PRG:2AAE B5 FA + and #$0F ; CPU:$AAB0 PRG:2AB0 29 0F + bpl StoreControllerButtonBits ; CPU:$AAB2 PRG:2AB2 10 04 +; ----------------------------------------------------------------------------- +; Routine: ReadControllerShiftRegister_OnCarrySet_AAB4 +; Global: ReadControllerShiftRegister_OnCarrySet_AAB4.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadControllerShiftRegister_OnCarrySet_AAB4: + lda ControllerButtons1,x ; CPU:$AAB4 PRG:2AB4 B5 FA + and #$C0 ; CPU:$AAB6 PRG:2AB6 29 C0 +; ----------------------------------------------------------------------------- +; Routine: StoreControllerButtonBits +; Global: StoreControllerButtonBits.; called from $AA9A, $AAA5 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreControllerButtonBits: + sta ControllerButtonMask,x ; CPU:$AAB8 PRG:2AB8 95 F2 + and #$03 ; CPU:$AABA PRG:2ABA 29 03 + beq StoreControllerButtonBits_OnZero_AAC0 ; CPU:$AABC PRG:2ABC F0 02 + sta ControllerDPad1,x ; CPU:$AABE PRG:2ABE 95 F6 +; ----------------------------------------------------------------------------- +; Routine: StoreControllerButtonBits_OnZero_AAC0 +; Global: StoreControllerButtonBits_OnZero_AAC0.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreControllerButtonBits_OnZero_AAC0: + lda ControllerButtonMask,x ; CPU:$AAC0 PRG:2AC0 B5 F2 + and #$0F ; CPU:$AAC2 PRG:2AC2 29 0F + beq StoreControllerButtonBits_OnZero_AACC ; CPU:$AAC4 PRG:2AC4 F0 06 + sta ControllerFaceButtons1,x ; CPU:$AAC6 PRG:2AC6 95 F8 + lda #$30 ; CPU:$AAC8 PRG:2AC8 A9 30 + sta SoundVolume1,x ; CPU:$AACA PRG:2ACA 95 80 +; ----------------------------------------------------------------------------- +; Routine: StoreControllerButtonBits_OnZero_AACC +; Global: StoreControllerButtonBits_OnZero_AACC.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreControllerButtonBits_OnZero_AACC: + rts ; CPU:$AACC PRG:2ACC 60 +; ----------------------------------------------------------------------------- +; Routine: EnableRendering +; Global: Enable rendering: PPUMASK=$18, PPUCTRL=$90, both shadows updated. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +EnableRendering: + lda #$18 ; CPU:$AACD PRG:2ACD A9 18 + sta $2001 ; CPU:$AACF PRG:2ACF 8D 01 20 + sta PpuMaskShadow ; CPU:$AAD2 PRG:2AD2 85 FD + lda #$90 ; CPU:$AAD4 PRG:2AD4 A9 90 + sta $2000 ; CPU:$AAD6 PRG:2AD6 8D 00 20 + sta PpuCtrlShadow ; CPU:$AAD9 PRG:2AD9 85 FC + rts ; CPU:$AADB PRG:2ADB 60 +; ----------------------------------------------------------------------------- +; Routine: DisableRenderingAndClearNametables +; Global: Disable rendering, then clear both nametables to tile $30. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +DisableRenderingAndClearNametables: + lda #$00 ; CPU:$AADC PRG:2ADC A9 00 + sta $2000 ; CPU:$AADE PRG:2ADE 8D 00 20 + sta PpuCtrlShadow ; CPU:$AAE1 PRG:2AE1 85 FC + sta $2001 ; CPU:$AAE3 PRG:2AE3 8D 01 20 + sta PpuMaskShadow ; CPU:$AAE6 PRG:2AE6 85 FD + lda #$20 ; CPU:$AAE8 PRG:2AE8 A9 20 + jsr $AAEF ; CPU:$AAEA PRG:2AEA 20 EF AA + lda #$24 ; CPU:$AAED PRG:2AED A9 24 +; ----------------------------------------------------------------------------- +; Routine: ClearNametablePattern +; Global: Set the PPU address from A and write $C0/$40 bytes of tile $30. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearNametablePattern: + sta $2006 ; CPU:$AAEF PRG:2AEF 8D 06 20 + lda #$00 ; CPU:$AAF2 PRG:2AF2 A9 00 + sta $2006 ; CPU:$AAF4 PRG:2AF4 8D 06 20 + lda #$04 ; CPU:$AAF7 PRG:2AF7 A9 04 + sta SourcePointerLo ; CPU:$AAF9 PRG:2AF9 85 10 + ldy #$C0 ; CPU:$AAFB PRG:2AFB A0 C0 + lda #$30 ; CPU:$AAFD PRG:2AFD A9 30 +; ----------------------------------------------------------------------------- +; Routine: ClearNametablePattern_OnNonzero_AAFF +; Global: ClearNametablePattern_OnNonzero_AAFF.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearNametablePattern_OnNonzero_AAFF: + sta $2007 ; CPU:$AAFF PRG:2AFF 8D 07 20 + dey ; CPU:$AB02 PRG:2B02 88 + bne ClearNametablePattern_OnNonzero_AAFF ; CPU:$AB03 PRG:2B03 D0 FA + dec SourcePointerLo ; CPU:$AB05 PRG:2B05 C6 10 + bne ClearNametablePattern_OnNonzero_AAFF ; CPU:$AB07 PRG:2B07 D0 F6 + lda #$00 ; CPU:$AB09 PRG:2B09 A9 00 +; ----------------------------------------------------------------------------- +; Routine: ClearNametablePattern_OnNonzero_AB0B +; Global: ClearNametablePattern_OnNonzero_AB0B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearNametablePattern_OnNonzero_AB0B: + sta $2007 ; CPU:$AB0B PRG:2B0B 8D 07 20 + iny ; CPU:$AB0E PRG:2B0E C8 + cpy #$40 ; CPU:$AB0F PRG:2B0F C0 40 + bne ClearNametablePattern_OnNonzero_AB0B ; CPU:$AB11 PRG:2B11 D0 F8 + rts ; CPU:$AB13 PRG:2B13 60 +; Pass 3: bytecode program not listed in BytecodeProgramPointerTable. +; ---- data $AB14-$AB67 (84 bytes) ---- +StandaloneBytecodeProgram_3: + .byte $02, $20, $22, $27, $02, $20, $16, $27, $02, $26, $2A, $37, $02, $10, $0F, $27 ; CPU:$AB14 PRG:2B14 02 20 22 27 02 20 16 27 02 26 2A 37 02 10 0F 27 + .byte $02, $3C, $22, $27, $02, $3C, $16, $27, $02, $26, $2A, $37, $02, $10, $0F, $27 ; CPU:$AB24 PRG:2B24 02 3C 22 27 02 3C 16 27 02 26 2A 37 02 10 0F 27 + .byte $08, $30, $22, $27, $08, $30, $16, $27, $08, $26, $2A, $37, $08, $00, $0F, $27 ; CPU:$AB34 PRG:2B34 08 30 22 27 08 30 16 27 08 26 2A 37 08 00 0F 27 + .byte $02, $16, $37, $30, $02, $12, $37, $28, $02, $0F, $37, $16, $02, $0F, $21, $16 ; CPU:$AB44 PRG:2B44 02 16 37 30 02 12 37 28 02 0F 37 16 02 0F 21 16 + .byte $02, $0F, $37, $10, $02, $0F, $10, $28, $02, $1A, $28, $18, $02, $18, $2C, $0F ; CPU:$AB54 PRG:2B54 02 0F 37 10 02 0F 10 28 02 1A 28 18 02 18 2C 0F + .byte $0F, $0F, $37, $30 ; CPU:$AB64 PRG:2B64 0F 0F 37 30 +CopyPaletteFromTable: + lda #$1C ; CPU:$AB68 PRG:2B68 A9 1C + sta DestinationPointerLo ; CPU:$AB6A PRG:2B6A 85 12 + lda #$03 ; CPU:$AB6C PRG:2B6C A9 03 + sta DestinationPointerHi ; CPU:$AB6E PRG:2B6E 85 13 + lda #$64 ; CPU:$AB70 PRG:2B70 A9 64 + sta SourcePointerLo ; CPU:$AB72 PRG:2B72 85 10 + lda #$AB ; CPU:$AB74 PRG:2B74 A9 AB + sta SourcePointerHi ; CPU:$AB76 PRG:2B76 85 11 + jsr $A25F ; CPU:$AB78 PRG:2B78 20 5F A2 + ldx #$02 ; CPU:$AB7B PRG:2B7B A2 02 +; ----------------------------------------------------------------------------- +; Routine: CopyPaletteFromTable_OnNonnegative_AB7D +; Global: CopyPaletteFromTable_OnNonnegative_AB7D.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +CopyPaletteFromTable_OnNonnegative_AB7D: + ldy PlayerPaletteIndex,x ; CPU:$AB7D PRG:2B7D B4 2A + jsr $A250 ; CPU:$AB7F PRG:2B7F 20 50 A2 + dex ; CPU:$AB82 PRG:2B82 CA + bpl CopyPaletteFromTable_OnNonnegative_AB7D ; CPU:$AB83 PRG:2B83 10 F8 + ldy #$0F ; CPU:$AB85 PRG:2B85 A0 0F + lda $0326 ; CPU:$AB87 PRG:2B87 AD 26 03 + asl a ; CPU:$AB8A PRG:2B8A 0A + asl a ; CPU:$AB8B PRG:2B8B 0A + asl a ; CPU:$AB8C PRG:2B8C 0A + asl a ; CPU:$AB8D PRG:2B8D 0A + adc #$14 ; CPU:$AB8E PRG:2B8E 69 14 + sta SourcePointerLo ; CPU:$AB90 PRG:2B90 85 10 + lda #$00 ; CPU:$AB92 PRG:2B92 A9 00 + adc #$AB ; CPU:$AB94 PRG:2B94 69 AB + sta SourcePointerHi ; CPU:$AB96 PRG:2B96 85 11 +; ----------------------------------------------------------------------------- +; Routine: LoadShadowOamBlock +; Global: LoadShadowOamBlock.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadShadowOamBlock: + lda (SourcePointerLo),y ; CPU:$AB98 PRG:2B98 B1 10 + sta $0300,y ; CPU:$AB9A PRG:2B9A 99 00 03 + dey ; CPU:$AB9D PRG:2B9D 88 + bpl LoadShadowOamBlock ; CPU:$AB9E PRG:2B9E 10 F8 + sta $0327 ; CPU:$ABA0 PRG:2BA0 8D 27 03 +; ----------------------------------------------------------------------------- +; Routine: FillShadowOamBlock +; Global: FillShadowOamBlock.; called from $8717 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FillShadowOamBlock: + ldx #$1C ; CPU:$ABA3 PRG:2BA3 A2 1C + lda $0327 ; CPU:$ABA5 PRG:2BA5 AD 27 03 +; ----------------------------------------------------------------------------- +; Routine: FillShadowOamBlock_OnNonnegative_ABA8 +; Global: FillShadowOamBlock_OnNonnegative_ABA8.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FillShadowOamBlock_OnNonnegative_ABA8: + sta $0300,x ; CPU:$ABA8 PRG:2BA8 9D 00 03 + dex ; CPU:$ABAB PRG:2BAB CA + dex ; CPU:$ABAC PRG:2BAC CA + dex ; CPU:$ABAD PRG:2BAD CA + dex ; CPU:$ABAE PRG:2BAE CA + bpl FillShadowOamBlock_OnNonnegative_ABA8 ; CPU:$ABAF PRG:2BAF 10 F7 +; ----------------------------------------------------------------------------- +; Routine: UploadPalette +; Global: Upload the 32-byte palette from $0300 to $3F00, then restore PPUMASK. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UploadPalette: + lda #$00 ; CPU:$ABB1 PRG:2BB1 A9 00 + sta $2001 ; CPU:$ABB3 PRG:2BB3 8D 01 20 + tay ; CPU:$ABB6 PRG:2BB6 A8 + lda $2002 ; CPU:$ABB7 PRG:2BB7 AD 02 20 + lda #$3F ; CPU:$ABBA PRG:2BBA A9 3F + sta $2006 ; CPU:$ABBC PRG:2BBC 8D 06 20 + lda #$00 ; CPU:$ABBF PRG:2BBF A9 00 + sta $2006 ; CPU:$ABC1 PRG:2BC1 8D 06 20 +; ----------------------------------------------------------------------------- +; Routine: UploadPalette_OnCarryClear_ABC4 +; Global: UploadPalette_OnCarryClear_ABC4.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UploadPalette_OnCarryClear_ABC4: + lda $0300,y ; CPU:$ABC4 PRG:2BC4 B9 00 03 + sta $2007 ; CPU:$ABC7 PRG:2BC7 8D 07 20 + iny ; CPU:$ABCA PRG:2BCA C8 + cpy #$20 ; CPU:$ABCB PRG:2BCB C0 20 + bcc UploadPalette_OnCarryClear_ABC4 ; CPU:$ABCD PRG:2BCD 90 F5 + lda #$3F ; CPU:$ABCF PRG:2BCF A9 3F + sta $2006 ; CPU:$ABD1 PRG:2BD1 8D 06 20 + lda #$00 ; CPU:$ABD4 PRG:2BD4 A9 00 + sta $2006 ; CPU:$ABD6 PRG:2BD6 8D 06 20 + sta $2006 ; CPU:$ABD9 PRG:2BD9 8D 06 20 + sta $2006 ; CPU:$ABDC PRG:2BDC 8D 06 20 + lda PpuMaskShadow ; CPU:$ABDF PRG:2BDF A5 FD + sta $2001 ; CPU:$ABE1 PRG:2BE1 8D 01 20 +; ----------------------------------------------------------------------------- +; Routine: ApplyPpuScrollAndControl +; Global: Write the latched scroll (PpuScrollX/PpuScrollY) and PpuCtrlShadow to the PPU. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ApplyPpuScrollAndControl: + lda $2002 ; CPU:$ABE4 PRG:2BE4 AD 02 20 + lda PpuScrollX ; CPU:$ABE7 PRG:2BE7 A5 FE + sta $2005 ; CPU:$ABE9 PRG:2BE9 8D 05 20 + lda PpuScrollY ; CPU:$ABEC PRG:2BEC A5 FF + sta $2005 ; CPU:$ABEE PRG:2BEE 8D 05 20 + lda PpuCtrlShadow ; CPU:$ABF1 PRG:2BF1 A5 FC + sta $2000 ; CPU:$ABF3 PRG:2BF3 8D 00 20 + rts ; CPU:$ABF6 PRG:2BF6 60 +; ----------------------------------------------------------------------------- +; Routine: ShiftAccumulatorRight4 +; Global: ShiftAccumulatorRight4.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ShiftAccumulatorRight4: + lsr a ; CPU:$ABF7 PRG:2BF7 4A + lsr a ; CPU:$ABF8 PRG:2BF8 4A + lsr a ; CPU:$ABF9 PRG:2BF9 4A + lsr a ; CPU:$ABFA PRG:2BFA 4A + rts ; CPU:$ABFB PRG:2BFB 60 +; ----------------------------------------------------------------------------- +; Routine: ClearOamShadow +; Global: Clear the 256-byte OAM shadow at $0200 to $F0. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearOamShadow: + ldx #$00 ; CPU:$ABFC PRG:2BFC A2 00 + stx $2003 ; CPU:$ABFE PRG:2BFE 8E 03 20 + lda #$F0 ; CPU:$AC01 PRG:2C01 A9 F0 +; ----------------------------------------------------------------------------- +; Routine: ClearOamShadow_OnNonzero_AC03 +; Global: ClearOamShadow_OnNonzero_AC03.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ClearOamShadow_OnNonzero_AC03: + sta $2004 ; CPU:$AC03 PRG:2C03 8D 04 20 + sta $0200,x ; CPU:$AC06 PRG:2C06 9D 00 02 + dex ; CPU:$AC09 PRG:2C09 CA + bne ClearOamShadow_OnNonzero_AC03 ; CPU:$AC0A PRG:2C0A D0 F7 + rts ; CPU:$AC0C PRG:2C0C 60 +; ----------------------------------------------------------------------------- +; Routine: SelectLevelVramWriter +; Global: Select and run the level's VRAM writer from the three-entry table at $AC35, indexed by the level byte at $0326. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SelectLevelVramWriter: + lda #$38 ; CPU:$AC0D PRG:2C0D A9 38 + sta Zp77 ; CPU:$AC0F PRG:2C0F 85 77 + lda #$A4 ; CPU:$AC11 PRG:2C11 A9 A4 + sta SourcePointerLo ; CPU:$AC13 PRG:2C13 85 10 + lda #$B4 ; CPU:$AC15 PRG:2C15 A9 B4 + sta SourcePointerHi ; CPU:$AC17 PRG:2C17 85 11 + lda #$20 ; CPU:$AC19 PRG:2C19 A9 20 + jsr $AC78 ; CPU:$AC1B PRG:2C1B 20 78 AC + lda #$24 ; CPU:$AC1E PRG:2C1E A9 24 + jsr $AC78 ; CPU:$AC20 PRG:2C20 20 78 AC + lda $0326 ; CPU:$AC23 PRG:2C23 AD 26 03 + asl a ; CPU:$AC26 PRG:2C26 0A + tax ; CPU:$AC27 PRG:2C27 AA + lda $AC35,x ; CPU:$AC28 PRG:2C28 BD 35 AC + sta SourcePointerLo ; CPU:$AC2B PRG:2C2B 85 10 + lda $AC36,x ; CPU:$AC2D PRG:2C2D BD 36 AC + sta SourcePointerHi ; CPU:$AC30 PRG:2C30 85 11 + jmp ($0010) ; CPU:$AC32 PRG:2C32 6C 10 00 +; Pass 3: 3 x 16-bit VRAM writers, index = the level byte at $0326. SelectLevelVramWriter loads the entry into SourcePointerLo/Hi and jumps through jmp ($0010). +; ---- data $AC35-$AC3A (6 bytes) ---- +LevelVramWriterTable: + .word $AC3B ; entry 0 -> $AC3B ; CPU:$AC35 PRG:2C35 3B AC + .word $AC3B ; entry 1 -> $AC3B ; CPU:$AC37 PRG:2C37 3B AC + .word $AC62 ; entry 2 -> $AC62 ; CPU:$AC39 PRG:2C39 62 AC +SetLevelVramStream: + lda #$9E ; CPU:$AC3B PRG:2C3B A9 9E + sta SourcePointerLo ; CPU:$AC3D PRG:2C3D 85 10 + lda #$B7 ; CPU:$AC3F PRG:2C3F A9 B7 + sta SourcePointerHi ; CPU:$AC41 PRG:2C41 85 11 +; ----------------------------------------------------------------------------- +; Routine: FillAttributeBlock +; Global: FillAttributeBlock.; called from $AC6A +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +FillAttributeBlock: + ldy #$00 ; CPU:$AC43 PRG:2C43 A0 00 + lda #$23 ; CPU:$AC45 PRG:2C45 A9 23 + jsr $AC4C ; CPU:$AC47 PRG:2C47 20 4C AC + lda #$27 ; CPU:$AC4A PRG:2C4A A9 27 +; ----------------------------------------------------------------------------- +; Routine: WriteAttributeBlock +; Global: WriteAttributeBlock.; called from $AC47 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteAttributeBlock: + sta $2006 ; CPU:$AC4C PRG:2C4C 8D 06 20 + lda #$C0 ; CPU:$AC4F PRG:2C4F A9 C0 + sta $2006 ; CPU:$AC51 PRG:2C51 8D 06 20 + ldx #$40 ; CPU:$AC54 PRG:2C54 A2 40 +; ----------------------------------------------------------------------------- +; Routine: WriteAttributeBlock_OnNonzero_AC56 +; Global: WriteAttributeBlock_OnNonzero_AC56.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteAttributeBlock_OnNonzero_AC56: + lda (SourcePointerLo),y ; CPU:$AC56 PRG:2C56 B1 10 + sta $2007 ; CPU:$AC58 PRG:2C58 8D 07 20 + jsr $AC88 ; CPU:$AC5B PRG:2C5B 20 88 AC + dex ; CPU:$AC5E PRG:2C5E CA + bne WriteAttributeBlock_OnNonzero_AC56 ; CPU:$AC5F PRG:2C5F D0 F5 + rts ; CPU:$AC61 PRG:2C61 60 +; ----------------------------------------------------------------------------- +; Routine: LoadAttributeStream +; Global: LoadAttributeStream.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadAttributeStream: + lda #$1E ; CPU:$AC62 PRG:2C62 A9 1E + sta SourcePointerLo ; CPU:$AC64 PRG:2C64 85 10 + lda #$B8 ; CPU:$AC66 PRG:2C66 A9 B8 + sta SourcePointerHi ; CPU:$AC68 PRG:2C68 85 11 + jsr $AC43 ; CPU:$AC6A PRG:2C6A 20 43 AC + lda #$6F ; CPU:$AC6D PRG:2C6D A9 6F + sta SourcePointerLo ; CPU:$AC6F PRG:2C6F 85 10 + lda #$B7 ; CPU:$AC71 PRG:2C71 A9 B7 + sta SourcePointerHi ; CPU:$AC73 PRG:2C73 85 11 + jmp $ACE5 ; CPU:$AC75 PRG:2C75 4C E5 AC +; ----------------------------------------------------------------------------- +; Routine: SetPpuAddressHighAnd40 +; Global: SetPpuAddressHighAnd40.; called from $80CD, $AC1B, $AC20 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetPpuAddressHighAnd40: + sta $2006 ; CPU:$AC78 PRG:2C78 8D 06 20 + lda #$40 ; CPU:$AC7B PRG:2C7B A9 40 + sta $2006 ; CPU:$AC7D PRG:2C7D 8D 06 20 + ldy #$00 ; CPU:$AC80 PRG:2C80 A0 00 +; ----------------------------------------------------------------------------- +; Routine: WriteCompressedVramStream +; Global: Decode one compressed VRAM token: below $B8 is a literal, $B8-$C3 is a run whose fill value comes from the table at $ACBD and whose length is the next stream byte, $C0 additionally skips a byte first, and $C4 or above is a literal. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteCompressedVramStream: + lda (SourcePointerLo),y ; CPU:$AC82 PRG:2C82 B1 10 + cmp #$C0 ; CPU:$AC84 PRG:2C84 C9 C0 + bne DecodeVramStreamToken ; CPU:$AC86 PRG:2C86 D0 0E +; ----------------------------------------------------------------------------- +; Routine: AdvanceSourceByte +; Global: Advance the compressed-stream source pointer (SourcePointerLo/Hi) by one byte. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceSourceByte: + lda SourcePointerLo ; CPU:$AC88 PRG:2C88 A5 10 + clc ; CPU:$AC8A PRG:2C8A 18 + adc #$01 ; CPU:$AC8B PRG:2C8B 69 01 + sta SourcePointerLo ; CPU:$AC8D PRG:2C8D 85 10 + lda SourcePointerHi ; CPU:$AC8F PRG:2C8F A5 11 + adc #$00 ; CPU:$AC91 PRG:2C91 69 00 + sta SourcePointerHi ; CPU:$AC93 PRG:2C93 85 11 + rts ; CPU:$AC95 PRG:2C95 60 +; ----------------------------------------------------------------------------- +; Routine: DecodeVramStreamToken +; Global: DecodeVramStreamToken.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +DecodeVramStreamToken: + cmp #$C4 ; CPU:$AC96 PRG:2C96 C9 C4 + bcs AdvanceSourceByte_OnCarrySet_AC9E ; CPU:$AC98 PRG:2C98 B0 04 + cmp #$B8 ; CPU:$AC9A PRG:2C9A C9 B8 + bcs WriteVramRunToken ; CPU:$AC9C PRG:2C9C B0 09 +; ----------------------------------------------------------------------------- +; Routine: AdvanceSourceByte_OnCarrySet_AC9E +; Global: AdvanceSourceByte_OnCarrySet_AC9E.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceSourceByte_OnCarrySet_AC9E: + sta $2007 ; CPU:$AC9E PRG:2C9E 8D 07 20 +; ----------------------------------------------------------------------------- +; Routine: AdvanceSourceByte_OnZero_ACA1 +; Global: AdvanceSourceByte_OnZero_ACA1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceSourceByte_OnZero_ACA1: + jsr $AC88 ; CPU:$ACA1 PRG:2CA1 20 88 AC + jmp $AC82 ; CPU:$ACA4 PRG:2CA4 4C 82 AC +; ----------------------------------------------------------------------------- +; Routine: WriteVramRunToken +; Global: WriteVramRunToken.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteVramRunToken: + sbc #$B8 ; CPU:$ACA7 PRG:2CA7 E9 B8 + tax ; CPU:$ACA9 PRG:2CA9 AA + lda $ACBD,x ; CPU:$ACAA PRG:2CAA BD BD AC + pha ; CPU:$ACAD PRG:2CAD 48 + jsr $AC88 ; CPU:$ACAE PRG:2CAE 20 88 AC + lda (SourcePointerLo),y ; CPU:$ACB1 PRG:2CB1 B1 10 + tax ; CPU:$ACB3 PRG:2CB3 AA + pla ; CPU:$ACB4 PRG:2CB4 68 +; ----------------------------------------------------------------------------- +; Routine: AdvanceSourceByte_OnNonzero_ACB5 +; Global: AdvanceSourceByte_OnNonzero_ACB5.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceSourceByte_OnNonzero_ACB5: + sta $2007 ; CPU:$ACB5 PRG:2CB5 8D 07 20 + dex ; CPU:$ACB8 PRG:2CB8 CA + bne AdvanceSourceByte_OnNonzero_ACB5 ; CPU:$ACB9 PRG:2CB9 D0 FA + beq AdvanceSourceByte_OnZero_ACA1 ; CPU:$ACBB PRG:2CBB F0 E4 +; Pass 3: the 12 fill values the compressed-VRAM run tokens $B8-$C3 select by index (token - $B8); WriteVramRunToken reads one with `lda $ACBD,x`. +; ---- data $ACBD-$ACC8 (12 bytes) ---- +VramRunFillValues: + .byte $B1, $31, $72, $73, $30, $3D, $38, $32, $00, $55, $05, $00 ; CPU:$ACBD PRG:2CBD B1 31 72 73 30 3D 38 32 00 55 05 00 +AdvanceDestinationWord: + lda DestinationPointerLo ; CPU:$ACC9 PRG:2CC9 A5 12 + clc ; CPU:$ACCB PRG:2CCB 18 + adc #$01 ; CPU:$ACCC PRG:2CCC 69 01 + sta DestinationPointerLo ; CPU:$ACCE PRG:2CCE 85 12 + lda DestinationPointerHi ; CPU:$ACD0 PRG:2CD0 A5 13 + adc #$00 ; CPU:$ACD2 PRG:2CD2 69 00 + sta DestinationPointerHi ; CPU:$ACD4 PRG:2CD4 85 13 + rts ; CPU:$ACD6 PRG:2CD6 60 +; ----------------------------------------------------------------------------- +; Routine: AdvanceCountWord +; Global: AdvanceCountWord.; called from $8C6B, $A230 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceCountWord: + lda VramBlockCountLo ; CPU:$ACD7 PRG:2CD7 A5 14 + clc ; CPU:$ACD9 PRG:2CD9 18 + adc #$01 ; CPU:$ACDA PRG:2CDA 69 01 + sta VramBlockCountLo ; CPU:$ACDC PRG:2CDC 85 14 + lda StreamBlockCountHi ; CPU:$ACDE PRG:2CDE A5 15 + adc #$00 ; CPU:$ACE0 PRG:2CE0 69 00 + sta StreamBlockCountHi ; CPU:$ACE2 PRG:2CE2 85 15 + rts ; CPU:$ACE4 PRG:2CE4 60 +; ----------------------------------------------------------------------------- +; Routine: WithRenderingEnabled +; Global: WithRenderingEnabled.; called from $AC75 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WithRenderingEnabled: + lda PpuCtrlShadow ; CPU:$ACE5 PRG:2CE5 A5 FC + pha ; CPU:$ACE7 PRG:2CE7 48 + ora #$04 ; CPU:$ACE8 PRG:2CE8 09 04 + sta $2000 ; CPU:$ACEA PRG:2CEA 8D 00 20 + jsr $ACF5 ; CPU:$ACED PRG:2CED 20 F5 AC + pla ; CPU:$ACF0 PRG:2CF0 68 + sta $2000 ; CPU:$ACF1 PRG:2CF1 8D 00 20 + rts ; CPU:$ACF4 PRG:2CF4 60 +; ----------------------------------------------------------------------------- +; Routine: WriteCompressedVramBlocks +; Global: Write a block of compressed data to VRAM: the first byte is the block count, then each block supplies a 16-bit PPU address followed by a token run. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteCompressedVramBlocks: + ldy #$00 ; CPU:$ACF5 PRG:2CF5 A0 00 + lda $2002 ; CPU:$ACF7 PRG:2CF7 AD 02 20 + lda (SourcePointerLo),y ; CPU:$ACFA PRG:2CFA B1 10 + sta DestinationPointerLo ; CPU:$ACFC PRG:2CFC 85 12 + jsr $AC88 ; CPU:$ACFE PRG:2CFE 20 88 AC +; ----------------------------------------------------------------------------- +; Routine: WriteCompressedVramBlocks_OnNonzero_AD01 +; Global: WriteCompressedVramBlocks_OnNonzero_AD01.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteCompressedVramBlocks_OnNonzero_AD01: + lda (SourcePointerLo),y ; CPU:$AD01 PRG:2D01 B1 10 + sta $2006 ; CPU:$AD03 PRG:2D03 8D 06 20 + jsr $AC88 ; CPU:$AD06 PRG:2D06 20 88 AC + lda (SourcePointerLo),y ; CPU:$AD09 PRG:2D09 B1 10 + sta $2006 ; CPU:$AD0B PRG:2D0B 8D 06 20 + jsr $AC88 ; CPU:$AD0E PRG:2D0E 20 88 AC + jsr $AC82 ; CPU:$AD11 PRG:2D11 20 82 AC + dec DestinationPointerLo ; CPU:$AD14 PRG:2D14 C6 12 + bne WriteCompressedVramBlocks_OnNonzero_AD01 ; CPU:$AD16 PRG:2D16 D0 E9 + rts ; CPU:$AD18 PRG:2D18 60 +; ----------------------------------------------------------------------------- +; Routine: ComputeCollisionBits +; Global: Compute the collision bit flags for the active player and store them in zero page $15. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeCollisionBits: + stx ActorIndex ; CPU:$AD19 PRG:2D19 86 1E + txa ; CPU:$AD1B PRG:2D1B 8A + asl a ; CPU:$AD1C PRG:2D1C 0A + asl a ; CPU:$AD1D PRG:2D1D 0A + sta ActorSlotOffset ; CPU:$AD1E PRG:2D1E 85 21 + tay ; CPU:$AD20 PRG:2D20 A8 + lda #$00 ; CPU:$AD21 PRG:2D21 A9 00 + sta CollisionFlagBits ; CPU:$AD23 PRG:2D23 85 15 + jsr $AD36 ; CPU:$AD25 PRG:2D25 20 36 AD + jsr $AE9B ; CPU:$AD28 PRG:2D28 20 9B AE + ldx ActorIndex ; CPU:$AD2B PRG:2D2B A6 1E + lda ControllerButtons1,x ; CPU:$AD2D PRG:2D2D B5 FA + and #$30 ; CPU:$AD2F PRG:2D2F 29 30 + ora CollisionFlagBits ; CPU:$AD31 PRG:2D31 05 15 + sta ControllerButtons1,x ; CPU:$AD33 PRG:2D33 95 FA + rts ; CPU:$AD35 PRG:2D35 60 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits +; Global: ComputePlayerOverlapBits.; called from $AD25 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits: + txa ; CPU:$AD36 PRG:2D36 8A + eor #$01 ; CPU:$AD37 PRG:2D37 49 01 + tax ; CPU:$AD39 PRG:2D39 AA + lda PlayerActionState,x ; CPU:$AD3A PRG:2D3A B5 F0 + cmp #$FE ; CPU:$AD3C PRG:2D3C C9 FE + bcs ComputePlayerOverlapBits_OnCarrySet_AD91 ; CPU:$AD3E PRG:2D3E B0 51 + ldx ActorIndex ; CPU:$AD40 PRG:2D40 A6 1E + lda PlayerActiveFlag,x ; CPU:$AD42 PRG:2D42 B5 78 + bne ComputePlayerOverlapBits_JoinBranchPaths_AD94 ; CPU:$AD44 PRG:2D44 D0 4E + lda PlayerActionState,x ; CPU:$AD46 PRG:2D46 B5 F0 + cmp #$C0 ; CPU:$AD48 PRG:2D48 C9 C0 + bcs ComputePlayerOverlapBits_OnCarrySet_AD84 ; CPU:$AD4A PRG:2D4A B0 38 + lda ScriptFlagsHi ; CPU:$AD4C PRG:2D4C A5 4E + beq ComputePlayerOverlapBits_JoinBranchPaths_AD7A ; CPU:$AD4E PRG:2D4E F0 2A + jsr $A4FF ; CPU:$AD50 PRG:2D50 20 FF A4 + lda $0033,y ; CPU:$AD53 PRG:2D53 B9 33 00 + beq ComputePlayerOverlapBits_JoinBranchPaths_AD7A ; CPU:$AD56 PRG:2D56 F0 22 + bmi ComputePlayerOverlapBits_JoinBranchPaths_AD7A ; CPU:$AD58 PRG:2D58 30 20 + lda FrameCounterLo ; CPU:$AD5A PRG:2D5A A5 24 + adc #$04 ; CPU:$AD5C PRG:2D5C 69 04 + and #$07 ; CPU:$AD5E PRG:2D5E 29 07 + bne ComputePlayerOverlapBits_JoinBranchPaths_AD7A ; CPU:$AD60 PRG:2D60 D0 18 + ldx ActorIndex ; CPU:$AD62 PRG:2D62 A6 1E + ldy ActorSlotOffset ; CPU:$AD64 PRG:2D64 A4 21 + lda $003A,y ; CPU:$AD66 PRG:2D66 B9 3A 00 + cmp #$68 ; CPU:$AD69 PRG:2D69 C9 68 + bcs ComputePlayerOverlapBits_OnCarrySet_AD71 ; CPU:$AD6B PRG:2D6B B0 04 + lda #$04 ; CPU:$AD6D PRG:2D6D A9 04 + bne ComputePlayerOverlapBits_OnNonzero_AD73 ; CPU:$AD6F PRG:2D6F D0 02 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnCarrySet_AD71 +; Global: ComputePlayerOverlapBits_OnCarrySet_AD71.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnCarrySet_AD71: + lda #$08 ; CPU:$AD71 PRG:2D71 A9 08 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnNonzero_AD73 +; Global: ComputePlayerOverlapBits_OnNonzero_AD73.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnNonzero_AD73: + sta CollisionFlagBits ; CPU:$AD73 PRG:2D73 85 15 + lda #$20 ; CPU:$AD75 PRG:2D75 A9 20 + sta PlayerFlashTimer,x ; CPU:$AD77 PRG:2D77 95 8B + rts ; CPU:$AD79 PRG:2D79 60 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_JoinBranchPaths_AD7A +; Global: ComputePlayerOverlapBits_JoinBranchPaths_AD7A.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_JoinBranchPaths_AD7A: + ldx ActorIndex ; CPU:$AD7A PRG:2D7A A6 1E + ldy ActorSlotOffset ; CPU:$AD7C PRG:2D7C A4 21 + lda PlayerFlashTimer,x ; CPU:$AD7E PRG:2D7E B5 8B + beq ComputePlayerOverlapBits_OnZero_AD8B ; CPU:$AD80 PRG:2D80 F0 09 + dec PlayerFlashTimer,x ; CPU:$AD82 PRG:2D82 D6 8B +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnCarrySet_AD84 +; Global: ComputePlayerOverlapBits_OnCarrySet_AD84.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnCarrySet_AD84: + lda ControllerButtonsPrev,x ; CPU:$AD84 PRG:2D84 B5 F4 + and #$0F ; CPU:$AD86 PRG:2D86 29 0F + sta CollisionFlagBits ; CPU:$AD88 PRG:2D88 85 15 + rts ; CPU:$AD8A PRG:2D8A 60 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnZero_AD8B +; Global: ComputePlayerOverlapBits_OnZero_AD8B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnZero_AD8B: + lda Zp4F,x ; CPU:$AD8B PRG:2D8B B5 4F + cmp #$19 ; CPU:$AD8D PRG:2D8D C9 19 + bcs ComputePlayerOverlapBits_JoinBranchPaths_AD94 ; CPU:$AD8F PRG:2D8F B0 03 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnCarrySet_AD91 +; Global: ComputePlayerOverlapBits_OnCarrySet_AD91.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnCarrySet_AD91: + jmp $AE45 ; CPU:$AD91 PRG:2D91 4C 45 AE +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_JoinBranchPaths_AD94 +; Global: ComputePlayerOverlapBits_JoinBranchPaths_AD94.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_JoinBranchPaths_AD94: + lda ScreenTransitionState ; CPU:$AD94 PRG:2D94 A5 68 + beq ComputePlayerOverlapBits_JoinBranchPaths_ADC2 ; CPU:$AD96 PRG:2D96 F0 2A + bmi ComputePlayerOverlapBits_JoinBranchPaths_ADC2 ; CPU:$AD98 PRG:2D98 30 28 + lda $003A,y ; CPU:$AD9A PRG:2D9A B9 3A 00 + sec ; CPU:$AD9D PRG:2D9D 38 + sbc PlayerBoxOriginX ; CPU:$AD9E PRG:2D9E E5 6E + clc ; CPU:$ADA0 PRG:2DA0 18 + adc #$1A ; CPU:$ADA1 PRG:2DA1 69 1A + cmp #$04 ; CPU:$ADA3 PRG:2DA3 C9 04 + bcc ComputePlayerOverlapBits_OnCarryClear_ADB1 ; CPU:$ADA5 PRG:2DA5 90 0A + bpl ComputePlayerOverlapBits_OnNonnegative_ADAD ; CPU:$ADA7 PRG:2DA7 10 04 + lda #$04 ; CPU:$ADA9 PRG:2DA9 A9 04 + bne ComputePlayerOverlapBits_OnNonzero_ADAF ; CPU:$ADAB PRG:2DAB D0 02 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnNonnegative_ADAD +; Global: ComputePlayerOverlapBits_OnNonnegative_ADAD.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnNonnegative_ADAD: + lda #$08 ; CPU:$ADAD PRG:2DAD A9 08 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnNonzero_ADAF +; Global: ComputePlayerOverlapBits_OnNonzero_ADAF.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnNonzero_ADAF: + sta CollisionFlagBits ; CPU:$ADAF PRG:2DAF 85 15 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnCarryClear_ADB1 +; Global: ComputePlayerOverlapBits_OnCarryClear_ADB1.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnCarryClear_ADB1: + lda $003C,y ; CPU:$ADB1 PRG:2DB1 B9 3C 00 + sec ; CPU:$ADB4 PRG:2DB4 38 + sbc PlayerBoxOriginY ; CPU:$ADB5 PRG:2DB5 E5 70 + clc ; CPU:$ADB7 PRG:2DB7 18 + adc #$03 ; CPU:$ADB8 PRG:2DB8 69 03 + cmp #$07 ; CPU:$ADBA PRG:2DBA C9 07 + bcc ComputePlayerOverlapBits_OnCarryClear_AE15 ; CPU:$ADBC PRG:2DBC 90 57 + bpl ComputePlayerOverlapBits_JoinBranchPaths_AE0F ; CPU:$ADBE PRG:2DBE 10 4F + bmi ComputePlayerOverlapBits_OnNegative_AE0B ; CPU:$ADC0 PRG:2DC0 30 49 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_JoinBranchPaths_ADC2 +; Global: ComputePlayerOverlapBits_JoinBranchPaths_ADC2.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_JoinBranchPaths_ADC2: + lda FrameCounterLo ; CPU:$ADC2 PRG:2DC2 A5 24 + and #$0F ; CPU:$ADC4 PRG:2DC4 29 0F + beq ComputePlayerOverlapBits_OnZero_AE16 ; CPU:$ADC6 PRG:2DC6 F0 4E + lda $003A,y ; CPU:$ADC8 PRG:2DC8 B9 3A 00 + sta SourcePointerLo ; CPU:$ADCB PRG:2DCB 85 10 + lda $003C,y ; CPU:$ADCD PRG:2DCD B9 3C 00 + sta DestinationPointerLo ; CPU:$ADD0 PRG:2DD0 85 12 + jsr $A4FF ; CPU:$ADD2 PRG:2DD2 20 FF A4 + lda $003A,y ; CPU:$ADD5 PRG:2DD5 B9 3A 00 + sta SourcePointerHi ; CPU:$ADD8 PRG:2DD8 85 11 + lda $003C,y ; CPU:$ADDA PRG:2DDA B9 3C 00 + sta DestinationPointerHi ; CPU:$ADDD PRG:2DDD 85 13 + lda SourcePointerLo ; CPU:$ADDF PRG:2DDF A5 10 + sec ; CPU:$ADE1 PRG:2DE1 38 + sbc SourcePointerHi ; CPU:$ADE2 PRG:2DE2 E5 11 + clc ; CPU:$ADE4 PRG:2DE4 18 + adc #$06 ; CPU:$ADE5 PRG:2DE5 69 06 + cmp #$0D ; CPU:$ADE7 PRG:2DE7 C9 0D + bcc SetDefaultOverlapBits_OnCarryClear_AE56 ; CPU:$ADE9 PRG:2DE9 90 6B + lda DestinationPointerLo ; CPU:$ADEB PRG:2DEB A5 12 + sec ; CPU:$ADED PRG:2DED 38 + sbc DestinationPointerHi ; CPU:$ADEE PRG:2DEE E5 13 + clc ; CPU:$ADF0 PRG:2DF0 18 + adc #$03 ; CPU:$ADF1 PRG:2DF1 69 03 + cmp #$07 ; CPU:$ADF3 PRG:2DF3 C9 07 + bcc SetDefaultOverlapBits_OnCarryClear_AE56 ; CPU:$ADF5 PRG:2DF5 90 5F + lda SourcePointerLo ; CPU:$ADF7 PRG:2DF7 A5 10 + cmp SourcePointerHi ; CPU:$ADF9 PRG:2DF9 C5 11 + bcs ComputePlayerOverlapBits_OnCarrySet_AE01 ; CPU:$ADFB PRG:2DFB B0 04 + lda #$04 ; CPU:$ADFD PRG:2DFD A9 04 + bne ComputePlayerOverlapBits_OnNonzero_AE03 ; CPU:$ADFF PRG:2DFF D0 02 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnCarrySet_AE01 +; Global: ComputePlayerOverlapBits_OnCarrySet_AE01.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnCarrySet_AE01: + lda #$08 ; CPU:$AE01 PRG:2E01 A9 08 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnNonzero_AE03 +; Global: ComputePlayerOverlapBits_OnNonzero_AE03.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnNonzero_AE03: + sta CollisionFlagBits ; CPU:$AE03 PRG:2E03 85 15 + lda DestinationPointerLo ; CPU:$AE05 PRG:2E05 A5 12 + cmp DestinationPointerHi ; CPU:$AE07 PRG:2E07 C5 13 + bcs ComputePlayerOverlapBits_JoinBranchPaths_AE0F ; CPU:$AE09 PRG:2E09 B0 04 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnNegative_AE0B +; Global: ComputePlayerOverlapBits_OnNegative_AE0B.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnNegative_AE0B: + lda #$01 ; CPU:$AE0B PRG:2E0B A9 01 + bne ComputePlayerOverlapBits_OnNonzero_AE11 ; CPU:$AE0D PRG:2E0D D0 02 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_JoinBranchPaths_AE0F +; Global: ComputePlayerOverlapBits_JoinBranchPaths_AE0F.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_JoinBranchPaths_AE0F: + lda #$02 ; CPU:$AE0F PRG:2E0F A9 02 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnNonzero_AE11 +; Global: ComputePlayerOverlapBits_OnNonzero_AE11.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnNonzero_AE11: + ora CollisionFlagBits ; CPU:$AE11 PRG:2E11 05 15 + sta CollisionFlagBits ; CPU:$AE13 PRG:2E13 85 15 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnCarryClear_AE15 +; Global: ComputePlayerOverlapBits_OnCarryClear_AE15.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnCarryClear_AE15: + rts ; CPU:$AE15 PRG:2E15 60 +; ----------------------------------------------------------------------------- +; Routine: ComputePlayerOverlapBits_OnZero_AE16 +; Global: ComputePlayerOverlapBits_OnZero_AE16.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputePlayerOverlapBits_OnZero_AE16: + ldx ActorIndex ; CPU:$AE16 PRG:2E16 A6 1E + lda Zp4F,x ; CPU:$AE18 PRG:2E18 B5 4F + cmp #$32 ; CPU:$AE1A PRG:2E1A C9 32 + bcc SetDefaultOverlapBits ; CPU:$AE1C PRG:2E1C 90 27 + jsr $A8D1 ; CPU:$AE1E PRG:2E1E 20 D1 A8 + and #$1F ; CPU:$AE21 PRG:2E21 29 1F + adc #$10 ; CPU:$AE23 PRG:2E23 69 10 + ldx ActorIndex ; CPU:$AE25 PRG:2E25 A6 1E + sta PlayerFlashTimer,x ; CPU:$AE27 PRG:2E27 95 8B + jsr $A8D1 ; CPU:$AE29 PRG:2E29 20 D1 A8 + and #$0F ; CPU:$AE2C PRG:2E2C 29 0F + tax ; CPU:$AE2E PRG:2E2E AA + lda $AE35,x ; CPU:$AE2F PRG:2E2F BD 35 AE + sta CollisionFlagBits ; CPU:$AE32 PRG:2E32 85 15 + rts ; CPU:$AE34 PRG:2E34 60 +; Pass 3: 16-entry animation-frame -> collision-flag-bits table (index = animation frame & $0F). +; ---- data $AE35-$AE44 (16 bytes) ---- +AnimationFrameCollisionBits: + .byte $00, $01, $02, $01, $04, $05, $06, $02, $08, $09, $0A, $01, $02, $04, $08, $00 ; CPU:$AE35 PRG:2E35 00 01 02 01 04 05 06 02 08 09 0A 01 02 04 08 00 +SetDefaultOverlapBits: + lda #$40 ; CPU:$AE45 PRG:2E45 A9 40 + sta PlayerFlashTimer,x ; CPU:$AE47 PRG:2E47 95 8B + ldx ActorIndex ; CPU:$AE49 PRG:2E49 A6 1E + bne SetDefaultOverlapBits_OnNonzero_AE51 ; CPU:$AE4B PRG:2E4B D0 04 + lda #$0A ; CPU:$AE4D PRG:2E4D A9 0A + bne SetDefaultOverlapBits_OnNonzero_AE53 ; CPU:$AE4F PRG:2E4F D0 02 +; ----------------------------------------------------------------------------- +; Routine: SetDefaultOverlapBits_OnNonzero_AE51 +; Global: SetDefaultOverlapBits_OnNonzero_AE51.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetDefaultOverlapBits_OnNonzero_AE51: + lda #$05 ; CPU:$AE51 PRG:2E51 A9 05 +; ----------------------------------------------------------------------------- +; Routine: SetDefaultOverlapBits_OnNonzero_AE53 +; Global: SetDefaultOverlapBits_OnNonzero_AE53.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetDefaultOverlapBits_OnNonzero_AE53: + sta CollisionFlagBits ; CPU:$AE53 PRG:2E53 85 15 + rts ; CPU:$AE55 PRG:2E55 60 +; ----------------------------------------------------------------------------- +; Routine: SetDefaultOverlapBits_OnCarryClear_AE56 +; Global: SetDefaultOverlapBits_OnCarryClear_AE56.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetDefaultOverlapBits_OnCarryClear_AE56: + lda SourcePointerLo ; CPU:$AE56 PRG:2E56 A5 10 + sec ; CPU:$AE58 PRG:2E58 38 + sbc SourcePointerHi ; CPU:$AE59 PRG:2E59 E5 11 + sta Zp16 ; CPU:$AE5B PRG:2E5B 85 16 + bcs SetDefaultOverlapBits_OnCarrySet_AE63 ; CPU:$AE5D PRG:2E5D B0 04 + eor #$FF ; CPU:$AE5F PRG:2E5F 49 FF + adc #$01 ; CPU:$AE61 PRG:2E61 69 01 +; ----------------------------------------------------------------------------- +; Routine: SetDefaultOverlapBits_OnCarrySet_AE63 +; Global: SetDefaultOverlapBits_OnCarrySet_AE63.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetDefaultOverlapBits_OnCarrySet_AE63: + sta Zp18 ; CPU:$AE63 PRG:2E63 85 18 + lda DestinationPointerLo ; CPU:$AE65 PRG:2E65 A5 12 + sec ; CPU:$AE67 PRG:2E67 38 + sbc DestinationPointerHi ; CPU:$AE68 PRG:2E68 E5 13 + sta Zp17 ; CPU:$AE6A PRG:2E6A 85 17 + bcs SetDefaultOverlapBits_OnCarrySet_AE72 ; CPU:$AE6C PRG:2E6C B0 04 + eor #$FF ; CPU:$AE6E PRG:2E6E 49 FF + adc #$01 ; CPU:$AE70 PRG:2E70 69 01 +; ----------------------------------------------------------------------------- +; Routine: SetDefaultOverlapBits_OnCarrySet_AE72 +; Global: SetDefaultOverlapBits_OnCarrySet_AE72.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetDefaultOverlapBits_OnCarrySet_AE72: + sta Zp19 ; CPU:$AE72 PRG:2E72 85 19 + cmp Zp18 ; CPU:$AE74 PRG:2E74 C5 18 + bcs SetDefaultOverlapBits_OnCarrySet_AE88 ; CPU:$AE76 PRG:2E76 B0 10 + lda Zp16 ; CPU:$AE78 PRG:2E78 A5 16 + bmi SetDefaultOverlapBits_OnNegative_AE80 ; CPU:$AE7A PRG:2E7A 30 04 + lda #$08 ; CPU:$AE7C PRG:2E7C A9 08 + bne SetDefaultOverlapBits_OnNonzero_AE82 ; CPU:$AE7E PRG:2E7E D0 02 +; ----------------------------------------------------------------------------- +; Routine: SetDefaultOverlapBits_OnNegative_AE80 +; Global: SetDefaultOverlapBits_OnNegative_AE80.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetDefaultOverlapBits_OnNegative_AE80: + lda #$04 ; CPU:$AE80 PRG:2E80 A9 04 +; ----------------------------------------------------------------------------- +; Routine: SetDefaultOverlapBits_OnNonzero_AE82 +; Global: SetDefaultOverlapBits_OnNonzero_AE82.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetDefaultOverlapBits_OnNonzero_AE82: + sta CollisionFlagBits ; CPU:$AE82 PRG:2E82 85 15 + lda Zp18 ; CPU:$AE84 PRG:2E84 A5 18 + bne SetDefaultOverlapBits_OnNonzero_AE96 ; CPU:$AE86 PRG:2E86 D0 0E +; ----------------------------------------------------------------------------- +; Routine: SetDefaultOverlapBits_OnCarrySet_AE88 +; Global: SetDefaultOverlapBits_OnCarrySet_AE88.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetDefaultOverlapBits_OnCarrySet_AE88: + lda Zp17 ; CPU:$AE88 PRG:2E88 A5 17 + bmi SetDefaultOverlapBits_OnNegative_AE90 ; CPU:$AE8A PRG:2E8A 30 04 + lda #$02 ; CPU:$AE8C PRG:2E8C A9 02 + bne SetDefaultOverlapBits_OnNonzero_AE92 ; CPU:$AE8E PRG:2E8E D0 02 +; ----------------------------------------------------------------------------- +; Routine: SetDefaultOverlapBits_OnNegative_AE90 +; Global: SetDefaultOverlapBits_OnNegative_AE90.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetDefaultOverlapBits_OnNegative_AE90: + lda #$01 ; CPU:$AE90 PRG:2E90 A9 01 +; ----------------------------------------------------------------------------- +; Routine: SetDefaultOverlapBits_OnNonzero_AE92 +; Global: SetDefaultOverlapBits_OnNonzero_AE92.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetDefaultOverlapBits_OnNonzero_AE92: + sta CollisionFlagBits ; CPU:$AE92 PRG:2E92 85 15 + lda Zp19 ; CPU:$AE94 PRG:2E94 A5 19 +; ----------------------------------------------------------------------------- +; Routine: SetDefaultOverlapBits_OnNonzero_AE96 +; Global: SetDefaultOverlapBits_OnNonzero_AE96.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +SetDefaultOverlapBits_OnNonzero_AE96: + ldx ActorIndex ; CPU:$AE96 PRG:2E96 A6 1E + sta PlayerFlashTimer,x ; CPU:$AE98 PRG:2E98 95 8B + rts ; CPU:$AE9A PRG:2E9A 60 +; ----------------------------------------------------------------------------- +; Routine: ComputeEdgeOverlapBits +; Global: ComputeEdgeOverlapBits.; called from $AD28 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeEdgeOverlapBits: + lda FrameCounterLo ; CPU:$AE9B PRG:2E9B A5 24 + ror a ; CPU:$AE9D PRG:2E9D 6A + bcs ComputeEdgeOverlapBits_JoinBranchPaths_AEE9 ; CPU:$AE9E PRG:2E9E B0 49 + ldx ActorIndex ; CPU:$AEA0 PRG:2EA0 A6 1E + lda PlayerActionState,x ; CPU:$AEA2 PRG:2EA2 B5 F0 + cmp #$D0 ; CPU:$AEA4 PRG:2EA4 C9 D0 + beq ComputeEdgeOverlapBits_OnZero_AEFA ; CPU:$AEA6 PRG:2EA6 F0 52 + lda Zp88,x ; CPU:$AEA8 PRG:2EA8 B5 88 + bne ComputeEdgeOverlapBits_JoinBranchPaths_AECA ; CPU:$AEAA PRG:2EAA D0 1E + ldx ActorIndex ; CPU:$AEAC PRG:2EAC A6 1E + bne ComputeEdgeOverlapBits_OnNonzero_AEBE ; CPU:$AEAE PRG:2EAE D0 0E + lda PlayerPosYLo1 ; CPU:$AEB0 PRG:2EB0 A5 3C + cmp #$64 ; CPU:$AEB2 PRG:2EB2 C9 64 + bcs ComputeEdgeOverlapBits_JoinBranchPaths_AECA ; CPU:$AEB4 PRG:2EB4 B0 14 + lda PlayerPosXLo1 ; CPU:$AEB6 PRG:2EB6 A5 3A + cmp #$40 ; CPU:$AEB8 PRG:2EB8 C9 40 + bcs ComputeEdgeOverlapBits_JoinBranchPaths_AECA ; CPU:$AEBA PRG:2EBA B0 0E + bcc ComputeEdgeOverlapBits_JoinBranchPaths_AEDC ; CPU:$AEBC PRG:2EBC 90 1E +; ----------------------------------------------------------------------------- +; Routine: ComputeEdgeOverlapBits_OnNonzero_AEBE +; Global: ComputeEdgeOverlapBits_OnNonzero_AEBE.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeEdgeOverlapBits_OnNonzero_AEBE: + lda PlayerPosYLo2 ; CPU:$AEBE PRG:2EBE A5 40 + cmp #$B4 ; CPU:$AEC0 PRG:2EC0 C9 B4 + bcc ComputeEdgeOverlapBits_JoinBranchPaths_AECA ; CPU:$AEC2 PRG:2EC2 90 06 + lda PlayerPosXLo2 ; CPU:$AEC4 PRG:2EC4 A5 3E + cmp #$94 ; CPU:$AEC6 PRG:2EC6 C9 94 + bcs ComputeEdgeOverlapBits_JoinBranchPaths_AEDC ; CPU:$AEC8 PRG:2EC8 B0 12 +; ----------------------------------------------------------------------------- +; Routine: ComputeEdgeOverlapBits_JoinBranchPaths_AECA +; Global: ComputeEdgeOverlapBits_JoinBranchPaths_AECA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeEdgeOverlapBits_JoinBranchPaths_AECA: + lda ScriptFlagsHi ; CPU:$AECA PRG:2ECA A5 4E + beq ComputeEdgeOverlapBits_JoinBranchPaths_AEE9 ; CPU:$AECC PRG:2ECC F0 1B + lda PlayerPosYLo1 ; CPU:$AECE PRG:2ECE A5 3C + sec ; CPU:$AED0 PRG:2ED0 38 + sbc PlayerPosYLo2 ; CPU:$AED1 PRG:2ED1 E5 40 + sta VramBlockCountLo ; CPU:$AED3 PRG:2ED3 85 14 + clc ; CPU:$AED5 PRG:2ED5 18 + adc #$10 ; CPU:$AED6 PRG:2ED6 69 10 + cmp #$20 ; CPU:$AED8 PRG:2ED8 C9 20 + bcs ComputeEdgeOverlapBits_JoinBranchPaths_AEEA ; CPU:$AEDA PRG:2EDA B0 0E +; ----------------------------------------------------------------------------- +; Routine: ComputeEdgeOverlapBits_JoinBranchPaths_AEDC +; Global: ComputeEdgeOverlapBits_JoinBranchPaths_AEDC.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeEdgeOverlapBits_JoinBranchPaths_AEDC: + jsr $A8D1 ; CPU:$AEDC PRG:2EDC 20 D1 A8 + and #$1F ; CPU:$AEDF PRG:2EDF 29 1F + bne ComputeEdgeOverlapBits_JoinBranchPaths_AEEA ; CPU:$AEE1 PRG:2EE1 D0 07 +; ----------------------------------------------------------------------------- +; Routine: ComputeEdgeOverlapBits_OnZero_AEE3 +; Global: ComputeEdgeOverlapBits_OnZero_AEE3.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeEdgeOverlapBits_OnZero_AEE3: + lda CollisionFlagBits ; CPU:$AEE3 PRG:2EE3 A5 15 + ora #$80 ; CPU:$AEE5 PRG:2EE5 09 80 + sta CollisionFlagBits ; CPU:$AEE7 PRG:2EE7 85 15 +; ----------------------------------------------------------------------------- +; Routine: ComputeEdgeOverlapBits_JoinBranchPaths_AEE9 +; Global: ComputeEdgeOverlapBits_JoinBranchPaths_AEE9.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeEdgeOverlapBits_JoinBranchPaths_AEE9: + rts ; CPU:$AEE9 PRG:2EE9 60 +; ----------------------------------------------------------------------------- +; Routine: ComputeEdgeOverlapBits_JoinBranchPaths_AEEA +; Global: ComputeEdgeOverlapBits_JoinBranchPaths_AEEA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeEdgeOverlapBits_JoinBranchPaths_AEEA: + lda VramBlockCountLo ; CPU:$AEEA PRG:2EEA A5 14 + clc ; CPU:$AEEC PRG:2EEC 18 + adc #$20 ; CPU:$AEED PRG:2EED 69 20 + cmp #$40 ; CPU:$AEEF PRG:2EEF C9 40 + bcs ComputeEdgeOverlapBits_JoinBranchPaths_AF01 ; CPU:$AEF1 PRG:2EF1 B0 0E + jsr $A8D1 ; CPU:$AEF3 PRG:2EF3 20 D1 A8 + and #$1F ; CPU:$AEF6 PRG:2EF6 29 1F + bne ComputeEdgeOverlapBits_JoinBranchPaths_AF01 ; CPU:$AEF8 PRG:2EF8 D0 07 +; ----------------------------------------------------------------------------- +; Routine: ComputeEdgeOverlapBits_OnZero_AEFA +; Global: ComputeEdgeOverlapBits_OnZero_AEFA.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeEdgeOverlapBits_OnZero_AEFA: + lda CollisionFlagBits ; CPU:$AEFA PRG:2EFA A5 15 + ora #$40 ; CPU:$AEFC PRG:2EFC 09 40 + sta CollisionFlagBits ; CPU:$AEFE PRG:2EFE 85 15 + rts ; CPU:$AF00 PRG:2F00 60 +; ----------------------------------------------------------------------------- +; Routine: ComputeEdgeOverlapBits_JoinBranchPaths_AF01 +; Global: ComputeEdgeOverlapBits_JoinBranchPaths_AF01.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeEdgeOverlapBits_JoinBranchPaths_AF01: + ldx ActorIndex ; CPU:$AF01 PRG:2F01 A6 1E + lda PlayerActiveFlag,x ; CPU:$AF03 PRG:2F03 B5 78 + beq ComputeEdgeOverlapBits_JoinBranchPaths_AF24 ; CPU:$AF05 PRG:2F05 F0 1D + lda FrameCounterLo ; CPU:$AF07 PRG:2F07 A5 24 + and #$3F ; CPU:$AF09 PRG:2F09 29 3F + bne ComputeEdgeOverlapBits_JoinBranchPaths_AF24 ; CPU:$AF0B PRG:2F0B D0 17 + jsr $A508 ; CPU:$AF0D PRG:2F0D 20 08 A5 + cmp #$01 ; CPU:$AF10 PRG:2F10 C9 01 + beq ComputeEdgeOverlapBits_OnZero_AEE3 ; CPU:$AF12 PRG:2F12 F0 CF + cmp #$02 ; CPU:$AF14 PRG:2F14 C9 02 + beq ComputeEdgeOverlapBits_OnZero_AEFA ; CPU:$AF16 PRG:2F16 F0 E2 + cmp #$04 ; CPU:$AF18 PRG:2F18 C9 04 + beq ComputeEdgeOverlapBits_OnZero_AEFA ; CPU:$AF1A PRG:2F1A F0 DE + cmp #$05 ; CPU:$AF1C PRG:2F1C C9 05 + beq ComputeEdgeOverlapBits_OnZero_AEFA ; CPU:$AF1E PRG:2F1E F0 DA + cmp #$06 ; CPU:$AF20 PRG:2F20 C9 06 + beq ComputeEdgeOverlapBits_OnZero_AEE3 ; CPU:$AF22 PRG:2F22 F0 BF +; ----------------------------------------------------------------------------- +; Routine: ComputeEdgeOverlapBits_JoinBranchPaths_AF24 +; Global: ComputeEdgeOverlapBits_JoinBranchPaths_AF24.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeEdgeOverlapBits_JoinBranchPaths_AF24: + rts ; CPU:$AF24 PRG:2F24 60 +; ----------------------------------------------------------------------------- +; Routine: InitializeSoundEngine +; Global: Silence the APU: $4015=0, the enable mask cleared, and all four channels marked finished. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +InitializeSoundEngine: + lda #$00 ; CPU:$AF25 PRG:2F25 A9 00 + sta $4015 ; CPU:$AF27 PRG:2F27 8D 15 40 + sta ApuEnableMask ; CPU:$AF2A PRG:2F2A 85 E8 + lda #$FF ; CPU:$AF2C PRG:2F2C A9 FF + sta SoundChannelStep1 ; CPU:$AF2E PRG:2F2E 85 D0 + sta SoundChannelStep2 ; CPU:$AF30 PRG:2F30 85 D1 + sta SoundChannelStep3 ; CPU:$AF32 PRG:2F32 85 D2 + sta SoundChannelStep4 ; CPU:$AF34 PRG:2F34 85 D3 + rts ; CPU:$AF36 PRG:2F36 60 +; Pass 3: lda $E9 / bne $AF34 sits immediately after the rts that ends InitializeSoundEngine and branches back into the middle of it. No word in the image points here and the bytecode handler tables do not contain it, so it is unreachable. It is neither a coherent routine nor a table anything reads, so it stays data. +; ---- data $AF37-$AF3A (4 bytes) ---- +UnreachableSoundInitIsland: + .byte $A5, $E9, $D0, $FB ; CPU:$AF37 PRG:2F37 A5 E9 D0 FB +UpdateSoundFrame: + ldx #$FF ; CPU:$AF3B PRG:2F3B A2 FF + jsr $AF40 ; CPU:$AF3D PRG:2F3D 20 40 AF +; ----------------------------------------------------------------------------- +; Routine: UpdateAllSoundChannels +; Global: Update all four sound channels in turn. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateAllSoundChannels: + jsr $AF43 ; CPU:$AF40 PRG:2F40 20 43 AF +; ----------------------------------------------------------------------------- +; Routine: UpdateSoundChannel +; Global: Update one sound channel: restart it from its sequence when finished, otherwise count the note timer down and step the sequence. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateSoundChannel: + inx ; CPU:$AF43 PRG:2F43 E8 + txa ; CPU:$AF44 PRG:2F44 8A + asl a ; CPU:$AF45 PRG:2F45 0A + asl a ; CPU:$AF46 PRG:2F46 0A + sta ApuRegisterOffset ; CPU:$AF47 PRG:2F47 85 E4 + lda SoundChannelStep1,x ; CPU:$AF49 PRG:2F49 B5 D0 + beq StartSoundChannelNote ; CPU:$AF4B PRG:2F4B F0 26 + cmp #$FF ; CPU:$AF4D PRG:2F4D C9 FF + beq UpdateSoundChannel_JoinBranchPaths_AF68 ; CPU:$AF4F PRG:2F4F F0 17 + dec SoundNoteTimer1,x ; CPU:$AF51 PRG:2F51 D6 C8 + bne UpdateSoundChannel_JoinBranchPaths_AF68 ; CPU:$AF53 PRG:2F53 D0 13 +; ----------------------------------------------------------------------------- +; Routine: AdvanceSoundChannelNote +; Global: AdvanceSoundChannelNote.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceSoundChannelNote: + jsr $AFAB ; CPU:$AF55 PRG:2F55 20 AB AF + ldy #$00 ; CPU:$AF58 PRG:2F58 A0 00 + lda (SoundReadPointerLo),y ; CPU:$AF5A PRG:2F5A B1 EE + jsr $B06C ; CPU:$AF5C PRG:2F5C 20 6C B0 + cmp #$FF ; CPU:$AF5F PRG:2F5F C9 FF + beq WriteSoundChannelState ; CPU:$AF61 PRG:2F61 F0 06 + jsr $AFD9 ; CPU:$AF63 PRG:2F63 20 D9 AF + inc SoundChannelStep1,x ; CPU:$AF66 PRG:2F66 F6 D0 +; ----------------------------------------------------------------------------- +; Routine: UpdateSoundChannel_JoinBranchPaths_AF68 +; Global: UpdateSoundChannel_JoinBranchPaths_AF68.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +UpdateSoundChannel_JoinBranchPaths_AF68: + rts ; CPU:$AF68 PRG:2F68 60 +; ----------------------------------------------------------------------------- +; Routine: WriteSoundChannelState +; Global: WriteSoundChannelState.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteSoundChannelState: + sta SoundChannelStep1,x ; CPU:$AF69 PRG:2F69 95 D0 +; ----------------------------------------------------------------------------- +; Routine: RebuildApuEnableMask +; Global: RebuildApuEnableMask.; called from $B037 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +RebuildApuEnableMask: + lda ApuEnableMask ; CPU:$AF6B PRG:2F6B A5 E8 + and $B0F7,x ; CPU:$AF6D PRG:2F6D 3D F7 B0 + jmp $B062 ; CPU:$AF70 PRG:2F70 4C 62 B0 +; ----------------------------------------------------------------------------- +; Routine: StartSoundChannelNote +; Global: StartSoundChannelNote.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StartSoundChannelNote: + jsr $B05D ; CPU:$AF73 PRG:2F73 20 5D B0 + lda SoundSequencePtrLo1,x ; CPU:$AF76 PRG:2F76 B5 D4 + sta SoundReadPointerLo ; CPU:$AF78 PRG:2F78 85 EE + lda SoundSequencePtrHi1,x ; CPU:$AF7A PRG:2F7A B5 D8 + sta SoundReadPointerHi ; CPU:$AF7C PRG:2F7C 85 EF + ldy #$00 ; CPU:$AF7E PRG:2F7E A0 00 + lda (SoundReadPointerLo),y ; CPU:$AF80 PRG:2F80 B1 EE + sta SoundEnvelopeValue1,x ; CPU:$AF82 PRG:2F82 95 CC + and #$30 ; CPU:$AF84 PRG:2F84 29 30 + sta SoundEnvelopeMode1,x ; CPU:$AF86 PRG:2F86 95 C4 + iny ; CPU:$AF88 PRG:2F88 C8 + lda (SoundReadPointerLo),y ; CPU:$AF89 PRG:2F89 B1 EE + jsr $AFC5 ; CPU:$AF8B PRG:2F8B 20 C5 AF + iny ; CPU:$AF8E PRG:2F8E C8 + sty SoundChannelStep1,x ; CPU:$AF8F PRG:2F8F 94 D0 + lda (SoundReadPointerLo),y ; CPU:$AF91 PRG:2F91 B1 EE + ora SoundEnvelopeMaskHi ; CPU:$AF93 PRG:2F93 05 ED + ldy ApuRegisterOffset ; CPU:$AF95 PRG:2F95 A4 E4 + sta $4000,y ; CPU:$AF97 PRG:2F97 99 00 40 + sta SoundLastCtrlWrite1,x ; CPU:$AF9A PRG:2F9A 95 E0 + ldy #$03 ; CPU:$AF9C PRG:2F9C A0 03 + lda (SoundReadPointerLo),y ; CPU:$AF9E PRG:2F9E B1 EE + ldy ApuRegisterOffset ; CPU:$AFA0 PRG:2FA0 A4 E4 + sta $4001,y ; CPU:$AFA2 PRG:2FA2 99 01 40 + lda #$FF ; CPU:$AFA5 PRG:2FA5 A9 FF + sta SoundSustainCounter1,x ; CPU:$AFA7 PRG:2FA7 95 DC + bne AdvanceSoundChannelNote ; CPU:$AFA9 PRG:2FA9 D0 AA +; ----------------------------------------------------------------------------- +; Routine: AdvanceSoundSequencePointer +; Global: Advance a sound channel's sequence pointer by step*2 from its base. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceSoundSequencePointer: + lda #$00 ; CPU:$AFAB PRG:2FAB A9 00 + sta SoundReadPointerHi ; CPU:$AFAD PRG:2FAD 85 EF + lda SoundChannelStep1,x ; CPU:$AFAF PRG:2FAF B5 D0 + sta SoundReadPointerLo ; CPU:$AFB1 PRG:2FB1 85 EE + asl SoundReadPointerLo ; CPU:$AFB3 PRG:2FB3 06 EE + rol SoundReadPointerHi ; CPU:$AFB5 PRG:2FB5 26 EF + lda SoundSequencePtrLo1,x ; CPU:$AFB7 PRG:2FB7 B5 D4 + clc ; CPU:$AFB9 PRG:2FB9 18 + adc SoundReadPointerLo ; CPU:$AFBA PRG:2FBA 65 EE + sta SoundReadPointerLo ; CPU:$AFBC PRG:2FBC 85 EE + lda SoundSequencePtrHi1,x ; CPU:$AFBE PRG:2FBE B5 D8 + adc SoundReadPointerHi ; CPU:$AFC0 PRG:2FC0 65 EF + sta SoundReadPointerHi ; CPU:$AFC2 PRG:2FC2 85 EF + rts ; CPU:$AFC4 PRG:2FC4 60 +; ----------------------------------------------------------------------------- +; Routine: ComputeEnvelopeMask +; Global: Compute the envelope mask for a channel from its envelope mode. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeEnvelopeMask: + pha ; CPU:$AFC5 PRG:2FC5 48 + lda SoundEnvelopeMode1,x ; CPU:$AFC6 PRG:2FC6 B5 C4 + cmp #$20 ; CPU:$AFC8 PRG:2FC8 C9 20 + beq ComputeEnvelopeMask_OnZero_AFD5 ; CPU:$AFCA PRG:2FCA F0 09 + pla ; CPU:$AFCC PRG:2FCC 68 + ror a ; CPU:$AFCD PRG:2FCD 6A + ror a ; CPU:$AFCE PRG:2FCE 6A + ror a ; CPU:$AFCF PRG:2FCF 6A + and #$C0 ; CPU:$AFD0 PRG:2FD0 29 C0 + sta SoundEnvelopeMaskHi ; CPU:$AFD2 PRG:2FD2 85 ED + rts ; CPU:$AFD4 PRG:2FD4 60 +; ----------------------------------------------------------------------------- +; Routine: ComputeEnvelopeMask_OnZero_AFD5 +; Global: ComputeEnvelopeMask_OnZero_AFD5.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeEnvelopeMask_OnZero_AFD5: + pla ; CPU:$AFD5 PRG:2FD5 68 + sta SoundEnvelopeMaskHi ; CPU:$AFD6 PRG:2FD6 85 ED + rts ; CPU:$AFD8 PRG:2FD8 60 +; ----------------------------------------------------------------------------- +; Routine: ComputeTonePeriod +; Global: Compute the tone period for a channel from its note table and write the period registers. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeTonePeriod: + pha ; CPU:$AFD9 PRG:2FD9 48 + lda SoundEnvelopeMode1,x ; CPU:$AFDA PRG:2FDA B5 C4 + cmp #$30 ; CPU:$AFDC PRG:2FDC C9 30 + beq WriteFixedToneRegisters ; CPU:$AFDE PRG:2FDE F0 49 + pla ; CPU:$AFE0 PRG:2FE0 68 + pha ; CPU:$AFE1 PRG:2FE1 48 + and #$0F ; CPU:$AFE2 PRG:2FE2 29 0F + cmp #$0C ; CPU:$AFE4 PRG:2FE4 C9 0C + bcs ComputeTonePeriod_OnCarrySet_B036 ; CPU:$AFE6 PRG:2FE6 B0 4E + asl a ; CPU:$AFE8 PRG:2FE8 0A + tay ; CPU:$AFE9 PRG:2FE9 A8 + lda $B0CC,y ; CPU:$AFEA PRG:2FEA B9 CC B0 + sta SoundTonePeriodLo ; CPU:$AFED PRG:2FED 85 EA + lda $B0CB,y ; CPU:$AFEF PRG:2FEF B9 CB B0 + sta SoundTonePeriodHi ; CPU:$AFF2 PRG:2FF2 85 EB + pla ; CPU:$AFF4 PRG:2FF4 68 + and #$F0 ; CPU:$AFF5 PRG:2FF5 29 F0 + cmp #$A0 ; CPU:$AFF7 PRG:2FF7 C9 A0 + bcs ComputeTonePeriod_OnCarrySet_B028 ; CPU:$AFF9 PRG:2FF9 B0 2D + lsr a ; CPU:$AFFB PRG:2FFB 4A + lsr a ; CPU:$AFFC PRG:2FFC 4A + lsr a ; CPU:$AFFD PRG:2FFD 4A + lsr a ; CPU:$AFFE PRG:2FFE 4A + tay ; CPU:$AFFF PRG:2FFF A8 +; ----------------------------------------------------------------------------- +; Routine: ShiftNoteTableIndex +; Global: ShiftNoteTableIndex.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ShiftNoteTableIndex: + lsr SoundTonePeriodHi ; CPU:$B000 PRG:3000 46 EB + ror SoundTonePeriodLo ; CPU:$B002 PRG:3002 66 EA + dey ; CPU:$B004 PRG:3004 88 + bpl ShiftNoteTableIndex ; CPU:$B005 PRG:3005 10 F9 +; ----------------------------------------------------------------------------- +; Routine: WriteToneRegisters +; Global: WriteToneRegisters.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteToneRegisters: + jsr $B03A ; CPU:$B007 PRG:3007 20 3A B0 + jsr $B05D ; CPU:$B00A PRG:300A 20 5D B0 + lda SoundLastCtrlWrite1,x ; CPU:$B00D PRG:300D B5 E0 + ldy ApuRegisterOffset ; CPU:$B00F PRG:300F A4 E4 + sta $4000,y ; CPU:$B011 PRG:3011 99 00 40 + lda SoundTonePeriodHi ; CPU:$B014 PRG:3014 A5 EB + and #$07 ; CPU:$B016 PRG:3016 29 07 + ora #$08 ; CPU:$B018 PRG:3018 09 08 + sta SoundTonePeriodHi ; CPU:$B01A PRG:301A 85 EB + lda SoundTonePeriodLo ; CPU:$B01C PRG:301C A5 EA + ldy ApuRegisterOffset ; CPU:$B01E PRG:301E A4 E4 + sta $4002,y ; CPU:$B020 PRG:3020 99 02 40 + lda SoundTonePeriodHi ; CPU:$B023 PRG:3023 A5 EB + sta $4003,y ; CPU:$B025 PRG:3025 99 03 40 +; ----------------------------------------------------------------------------- +; Routine: ComputeTonePeriod_OnCarrySet_B028 +; Global: ComputeTonePeriod_OnCarrySet_B028.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeTonePeriod_OnCarrySet_B028: + rts ; CPU:$B028 PRG:3028 60 +; ----------------------------------------------------------------------------- +; Routine: WriteFixedToneRegisters +; Global: WriteFixedToneRegisters.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteFixedToneRegisters: + pla ; CPU:$B029 PRG:3029 68 + cmp #$10 ; CPU:$B02A PRG:302A C9 10 + bcs ComputeTonePeriod_OnCarrySet_B037 ; CPU:$B02C PRG:302C B0 09 + sta SoundTonePeriodLo ; CPU:$B02E PRG:302E 85 EA + lda #$00 ; CPU:$B030 PRG:3030 A9 00 + sta SoundTonePeriodHi ; CPU:$B032 PRG:3032 85 EB + beq WriteToneRegisters ; CPU:$B034 PRG:3034 F0 D1 +; ----------------------------------------------------------------------------- +; Routine: ComputeTonePeriod_OnCarrySet_B036 +; Global: ComputeTonePeriod_OnCarrySet_B036.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeTonePeriod_OnCarrySet_B036: + pla ; CPU:$B036 PRG:3036 68 +; ----------------------------------------------------------------------------- +; Routine: ComputeTonePeriod_OnCarrySet_B037 +; Global: ComputeTonePeriod_OnCarrySet_B037.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ComputeTonePeriod_OnCarrySet_B037: + jsr $AF6B ; CPU:$B037 PRG:3037 20 6B AF +; ----------------------------------------------------------------------------- +; Routine: ReadNoteDuration +; Global: Read a note's duration from the sequence and store it, doubling it for looped notes. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadNoteDuration: + ldy #$01 ; CPU:$B03A PRG:303A A0 01 + lda (SoundReadPointerLo),y ; CPU:$B03C PRG:303C B1 EE + cmp #$F0 ; CPU:$B03E PRG:303E C9 F0 + bcc StoreShortNoteDuration ; CPU:$B040 PRG:3040 90 17 + sec ; CPU:$B042 PRG:3042 38 + sbc #$F0 ; CPU:$B043 PRG:3043 E9 F0 + tay ; CPU:$B045 PRG:3045 A8 + lda $B0E3,y ; CPU:$B046 PRG:3046 B9 E3 B0 +; ----------------------------------------------------------------------------- +; Routine: StoreNoteDuration +; Global: StoreNoteDuration.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreNoteDuration: + sta SoundNoteTimer1,x ; CPU:$B049 PRG:3049 95 C8 + lda SoundEnvelopeValue1,x ; CPU:$B04B PRG:304B B5 CC + and #$01 ; CPU:$B04D PRG:304D 29 01 + beq ReadNoteDuration_OnZero_B058 ; CPU:$B04F PRG:304F F0 07 + lda SoundNoteTimer1,x ; CPU:$B051 PRG:3051 B5 C8 + clc ; CPU:$B053 PRG:3053 18 + adc SoundNoteTimer1,x ; CPU:$B054 PRG:3054 75 C8 + sta SoundNoteTimer1,x ; CPU:$B056 PRG:3056 95 C8 +; ----------------------------------------------------------------------------- +; Routine: ReadNoteDuration_OnZero_B058 +; Global: ReadNoteDuration_OnZero_B058.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadNoteDuration_OnZero_B058: + rts ; CPU:$B058 PRG:3058 60 +; ----------------------------------------------------------------------------- +; Routine: StoreShortNoteDuration +; Global: StoreShortNoteDuration.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +StoreShortNoteDuration: + and #$0F ; CPU:$B059 PRG:3059 29 0F + bpl StoreNoteDuration ; CPU:$B05B PRG:305B 10 EC +; ----------------------------------------------------------------------------- +; Routine: BuildApuChannelMask +; Global: BuildApuChannelMask.; called from $AF73, $B00A +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +BuildApuChannelMask: + lda ApuEnableMask ; CPU:$B05D PRG:305D A5 E8 + ora $B0F3,x ; CPU:$B05F PRG:305F 1D F3 B0 +; ----------------------------------------------------------------------------- +; Routine: WriteApuEnable +; Global: WriteApuEnable.; called from $AF70 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteApuEnable: + bit SoundMuted ; CPU:$B062 PRG:3062 24 E9 + bmi WriteApuEnable_OnNegative_B069 ; CPU:$B064 PRG:3064 30 03 + sta $4015 ; CPU:$B066 PRG:3066 8D 15 40 +; ----------------------------------------------------------------------------- +; Routine: WriteApuEnable_OnNegative_B069 +; Global: WriteApuEnable_OnNegative_B069.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteApuEnable_OnNegative_B069: + sta ApuEnableMask ; CPU:$B069 PRG:3069 85 E8 + rts ; CPU:$B06B PRG:306B 60 +; ----------------------------------------------------------------------------- +; Routine: ApplySoundCommand +; Global: Apply one byte of a sound sequence: below $A0 is ignored, $A0-$AF patches the $4000 control byte, and $B0+ handles note and sustain data. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ApplySoundCommand: + cmp #$C0 ; CPU:$B06C PRG:306C C9 C0 + bcs ReturnFromSoundCommand ; CPU:$B06E PRG:306E B0 25 + cmp #$B0 ; CPU:$B070 PRG:3070 C9 B0 + bcs HandleNoteTerminator ; CPU:$B072 PRG:3072 B0 29 + cmp #$A0 ; CPU:$B074 PRG:3074 C9 A0 + bcc ReturnFromSoundCommand ; CPU:$B076 PRG:3076 90 1D + iny ; CPU:$B078 PRG:3078 C8 + lda SoundEnvelopeMode1,x ; CPU:$B079 PRG:3079 B5 C4 + cmp #$20 ; CPU:$B07B PRG:307B C9 20 + beq ReadLoopFlag ; CPU:$B07D PRG:307D F0 17 + lda SoundLastCtrlWrite1,x ; CPU:$B07F PRG:307F B5 E0 + and #$E0 ; CPU:$B081 PRG:3081 29 E0 +; ----------------------------------------------------------------------------- +; Routine: WriteApuControlRegister +; Global: WriteApuControlRegister.; called from $B09A +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +WriteApuControlRegister: + ora (SoundReadPointerLo),y ; CPU:$B083 PRG:3083 11 EE + sta SoundLastCtrlWrite1,x ; CPU:$B085 PRG:3085 95 E0 + ldy ApuRegisterOffset ; CPU:$B087 PRG:3087 A4 E4 + sta $4000,y ; CPU:$B089 PRG:3089 99 00 40 +; ----------------------------------------------------------------------------- +; Routine: AdvanceSoundSequenceStep +; Global: AdvanceSoundSequenceStep.; called from $B0C8 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceSoundSequenceStep: + inc SoundChannelStep1,x ; CPU:$B08C PRG:308C F6 D0 +; ----------------------------------------------------------------------------- +; Routine: AdvanceSoundSequenceStepAlt +; Global: AdvanceSoundSequenceStepAlt.; called from $B0B8 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +AdvanceSoundSequenceStepAlt: + jsr $AFAB ; CPU:$B08E PRG:308E 20 AB AF + ldy #$00 ; CPU:$B091 PRG:3091 A0 00 + lda (SoundReadPointerLo),y ; CPU:$B093 PRG:3093 B1 EE +; ----------------------------------------------------------------------------- +; Routine: ReturnFromSoundCommand +; Global: ReturnFromSoundCommand.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReturnFromSoundCommand: + rts ; CPU:$B095 PRG:3095 60 +; ----------------------------------------------------------------------------- +; Routine: ReadLoopFlag +; Global: ReadLoopFlag.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +ReadLoopFlag: + lda SoundLastCtrlWrite1,x ; CPU:$B096 PRG:3096 B5 E0 + and #$80 ; CPU:$B098 PRG:3098 29 80 + jmp $B083 ; CPU:$B09A PRG:309A 4C 83 B0 +; ----------------------------------------------------------------------------- +; Routine: HandleNoteTerminator +; Global: HandleNoteTerminator.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +HandleNoteTerminator: + and #$0F ; CPU:$B09D PRG:309D 29 0F + cmp #$0F ; CPU:$B09F PRG:309F C9 0F + bne HandleSustainCounter ; CPU:$B0A1 PRG:30A1 D0 06 + lda #$02 ; CPU:$B0A3 PRG:30A3 A9 02 + sta SoundChannelStep1,x ; CPU:$B0A5 PRG:30A5 95 D0 + bne AdvanceSoundSequenceStepAlt ; CPU:$B0A7 PRG:30A7 D0 E5 +; ----------------------------------------------------------------------------- +; Routine: HandleSustainCounter +; Global: HandleSustainCounter.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +HandleSustainCounter: + lda SoundSustainCounter1,x ; CPU:$B0A9 PRG:30A9 B5 DC + beq DecrementSustainCounter ; CPU:$B0AB PRG:30AB F0 19 + cmp #$0F ; CPU:$B0AD PRG:30AD C9 0F + bcs LoadSoundSequenceStep_OnCarrySet_B0BB ; CPU:$B0AF PRG:30AF B0 0A + dec SoundSustainCounter1,x ; CPU:$B0B1 PRG:30B1 D6 DC +; ----------------------------------------------------------------------------- +; Routine: LoadSoundSequenceStep +; Global: LoadSoundSequenceStep.; called from $B0C3 +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadSoundSequenceStep: + iny ; CPU:$B0B3 PRG:30B3 C8 + lda (SoundReadPointerLo),y ; CPU:$B0B4 PRG:30B4 B1 EE + sta SoundChannelStep1,x ; CPU:$B0B6 PRG:30B6 95 D0 + jmp $B08E ; CPU:$B0B8 PRG:30B8 4C 8E B0 +; ----------------------------------------------------------------------------- +; Routine: LoadSoundSequenceStep_OnCarrySet_B0BB +; Global: LoadSoundSequenceStep_OnCarrySet_B0BB.; no call site is visible in the static trace +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +LoadSoundSequenceStep_OnCarrySet_B0BB: + lda (SoundReadPointerLo),y ; CPU:$B0BB PRG:30BB B1 EE + and #$0F ; CPU:$B0BD PRG:30BD 29 0F + sta SoundSustainCounter1,x ; CPU:$B0BF PRG:30BF 95 DC + dec SoundSustainCounter1,x ; CPU:$B0C1 PRG:30C1 D6 DC + jmp $B0B3 ; CPU:$B0C3 PRG:30C3 4C B3 B0 +; ----------------------------------------------------------------------------- +; Routine: DecrementSustainCounter +; Global: Decrement the channel's sustain counter and advance the sequence.0x8644 Set PPUCTRL to $10 and PPUMASK to 0, updating both shadow bytes. Provably unreachable: no word in the image points at it except the jsr at $8654, and $8653 itself is unreferenced. Kept as code because the shape is unambiguous. +; Local: Continues its parent routine along the condition or operation encoded in this label, +; then returns, branches again, or rejoins shared code as documented by the instructions. +; Parameters: Not yet resolved; the callers visible in the static trace show what is loaded before the call. +; Returns: Not yet resolved; status flags and registers may carry results. +; Clobbers: Not yet resolved. +; ----------------------------------------------------------------------------- +DecrementSustainCounter: + dec SoundSustainCounter1,x ; CPU:$B0C6 PRG:30C6 D6 DC + jmp $B08C ; CPU:$B0C8 PRG:30C8 4C 8C B0 +; Pass 3: 12 x 16-bit tone periods, index = note number & $0F (guarded by cmp #$0C). ComputeTonePeriod loads the low byte from $B0CB+n and the high byte from $B0CC+n. +; ---- data $B0CB-$B0E2 (24 bytes) ---- +SoundNotePeriodTable: + .word $5C0D ; entry 0 -> $5C0D ; CPU:$B0CB PRG:30CB 0D 5C + .word $9C0C ; entry 1 -> $9C0C ; CPU:$B0CD PRG:30CD 0C 9C + .word $E80B ; entry 2 -> $E80B ; CPU:$B0CF PRG:30CF 0B E8 + .word $3C0B ; entry 3 -> $3C0B ; CPU:$B0D1 PRG:30D1 0B 3C + .word $9A0A ; entry 4 -> $9A0A ; CPU:$B0D3 PRG:30D3 0A 9A + .word $020A ; entry 5 -> $020A ; CPU:$B0D5 PRG:30D5 0A 02 + .word $7209 ; entry 6 -> $7209 ; CPU:$B0D7 PRG:30D7 09 72 + .word $EA08 ; entry 7 -> $EA08 ; CPU:$B0D9 PRG:30D9 08 EA + .word $6A08 ; entry 8 -> $6A08 ; CPU:$B0DB PRG:30DB 08 6A + .word $F207 ; entry 9 -> $F207 ; CPU:$B0DD PRG:30DD 07 F2 + .word $8007 ; entry 10 -> $8007 ; CPU:$B0DF PRG:30DF 07 80 + .word $1407 ; entry 11 -> $1407 ; CPU:$B0E1 PRG:30E1 07 14 +; Pass 3: 16 note durations, index = (duration byte - $F0), clamped by the table's end at $B0F2. +; ---- data $B0E3-$B0F2 (16 bytes) ---- +SoundNoteDurationTable: + .byte $06, $0C, $18, $30, $60, $12, $24, $48, $08, $1E, $3C, $10, $4E, $80, $54, $7F ; CPU:$B0E3 PRG:30E3 06 0C 18 30 60 12 24 48 08 1E 3C 10 4E 80 54 7F +; Pass 3: 4 x 1-byte masks OR-ed into ApuEnableMask, indexed by channel*4 in BuildApuChannelMask. +; ---- data $B0F3-$B0F6 (4 bytes) ---- +ApuChannelEnableBitsSet: + .byte $01, $02, $04, $08 ; CPU:$B0F3 PRG:30F3 01 02 04 08 +; Pass 3: 4 x 1-byte masks AND-ed into ApuEnableMask, indexed by channel*4 in RebuildApuEnableMask. +; ---- data $B0F7-$B0FA (4 bytes) ---- +ApuChannelEnableBitsClear: + .byte $0E, $0D, $0B, $07 ; CPU:$B0F7 PRG:30F7 0E 0D 0B 07 +; Pass 3: the bulk of the per-stage data - compressed nametable and attribute payloads plus the object layout lists. Nothing indexes it with a constant address: ProcessBytecodeOpcode reaches it through StageDataPointerLow plus the 16-bit value carried in the bytecode stream, so the record structure is not resolvable from the static trace. +; ---- data $B0FB-$B91A (2080 bytes) ---- +StageNametableAndObjectData: + .byte $00, $03, $0F, $00, $2A, $F1, $2A, $F3, $2A, $F1, $30, $F1, $32, $F1, $33, $FA ; CPU:$B0FB PRG:30FB 00 03 0F 00 2A F1 2A F3 2A F1 30 F1 32 F1 33 FA + .byte $33, $F1, $35, $F1, $37, $F1, $39, $F6, $35, $F1, $35, $F1, $37, $F2, $39, $F1 ; CPU:$B10B PRG:310B 33 F1 35 F1 37 F1 39 F6 35 F1 35 F1 37 F2 39 F1 + .byte $3A, $F3, $FF, $10, $01, $0F, $00, $27, $F1, $27, $F3, $27, $F1, $29, $F1, $2A ; CPU:$B11B PRG:311B 3A F3 FF 10 01 0F 00 27 F1 27 F3 27 F1 29 F1 2A + .byte $F1, $30, $FA, $30, $F1, $32, $F1, $33, $F1, $35, $F6, $32, $F1, $32, $F1, $33 ; CPU:$B12B PRG:312B F1 30 FA 30 F1 32 F1 33 F1 35 F6 32 F1 32 F1 33 + .byte $F2, $35, $F1, $35, $F3, $FF, $20, $00, $7F, $00, $1A, $F1, $2A, $F1, $B3, $02 ; CPU:$B13B PRG:313B F2 35 F1 35 F3 FF 20 00 7F 00 1A F1 2A F1 B3 02 + .byte $23, $F1, $33, $F1, $B3, $05, $25, $F1, $35, $F1, $B3, $08, $2A, $F3, $FF, $00 ; CPU:$B14B PRG:314B 23 F1 33 F1 B3 05 25 F1 35 F1 B3 08 2A F3 FF 00 + .byte $00, $0A, $00, $1F, $F1, $1F, $F1, $1F, $F4, $FF, $10, $00, $0A, $00, $1F, $F1 ; CPU:$B15B PRG:315B 00 0A 00 1F F1 1F F1 1F F4 FF 10 00 0A 00 1F F1 + .byte $1F, $F1, $1F, $F4, $FF, $20, $00, $24, $00, $1F, $F1, $1F, $F1, $1F, $F4, $FF ; CPU:$B16B PRG:316B 1F F1 1F F4 FF 20 00 24 00 1F F1 1F F1 1F F4 FF + .byte $00, $03, $1F, $9A, $10, $F0, $A0, $1C, $10, $F0, $A0, $1A, $10, $F0, $A0, $18 ; CPU:$B17B PRG:317B 00 03 1F 9A 10 F0 A0 1C 10 F0 A0 1A 10 F0 A0 18 + .byte $10, $F0, $A0, $16, $10, $F0, $A0, $14, $10, $F0, $A0, $12, $10, $F0, $FF, $00 ; CPU:$B18B PRG:318B 10 F0 A0 16 10 F0 A0 14 10 F0 A0 12 10 F0 FF 00 + .byte $02, $0F, $9C, $30, $F2, $FF, $00, $02, $0A, $95, $1F, $F2, $57, $F1, $57, $F5 ; CPU:$B19B PRG:319B 02 0F 9C 30 F2 FF 00 02 0A 95 1F F2 57 F1 57 F5 + .byte $1F, $F3, $B1, $02, $FF, $30, $00, $1F, $00, $0A, $F4, $A0, $1D, $0A, $F2, $A0 ; CPU:$B1AB PRG:31AB 1F F3 B1 02 FF 30 00 1F 00 0A F4 A0 1D 0A F2 A0 + .byte $1A, $0A, $F2, $A0, $18, $0A, $F1, $A0, $15, $0A, $F1, $A0, $12, $0A, $F1, $FF ; CPU:$B1BB PRG:31BB 1A 0A F2 A0 18 0A F1 A0 15 0A F1 A0 12 0A F1 FF + .byte $00, $01, $1F, $82, $27, $E9, $A0, $1B, $27, $E9, $A0, $17, $27, $E7, $FF, $10 ; CPU:$B1CB PRG:31CB 00 01 1F 82 27 E9 A0 1B 27 E9 A0 17 27 E7 FF 10 + .byte $00, $00, $00, $09, $E5, $09, $F0, $09, $E8, $09, $F2, $09, $F0, $09, $E4, $FF ; CPU:$B1DB PRG:31DB 00 00 00 09 E5 09 F0 09 E8 09 F2 09 F0 09 E4 FF + .byte $00, $01, $1F, $00, $40, $E3, $A0, $1C, $40, $E2, $A0, $1A, $40, $E2, $A0, $18 ; CPU:$B1EB PRG:31EB 00 01 1F 00 40 E3 A0 1C 40 E2 A0 1A 40 E2 A0 18 + .byte $40, $E2, $A0, $15, $40, $E2, $A0, $13, $40, $E2, $FF, $10, $01, $1F, $00, $47 ; CPU:$B1FB PRG:31FB 40 E2 A0 15 40 E2 A0 13 40 E2 FF 10 01 1F 00 47 + .byte $E3, $A0, $1C, $47, $E2, $A0, $1A, $47, $E2, $A0, $18, $47, $E2, $A0, $15, $47 ; CPU:$B20B PRG:320B E3 A0 1C 47 E2 A0 1A 47 E2 A0 18 47 E2 A0 15 47 + .byte $E2, $A0, $13, $47, $E2, $FF, $00, $01, $0F, $00, $35, $F1, $35, $F1, $35, $F1 ; CPU:$B21B PRG:321B E2 A0 13 47 E2 FF 00 01 0F 00 35 F1 35 F1 35 F1 + .byte $35, $F1, $35, $F1, $33, $F1, $32, $F1, $30, $F1, $27, $F1, $29, $F1, $2A, $F1 ; CPU:$B22B PRG:322B 35 F1 35 F1 33 F1 32 F1 30 F1 27 F1 29 F1 2A F1 + .byte $30, $F1, $2A, $F2, $FF, $10, $01, $0F, $00, $32, $F1, $32, $F1, $32, $F1, $32 ; CPU:$B23B PRG:323B 30 F1 2A F2 FF 10 01 0F 00 32 F1 32 F1 32 F1 32 + .byte $F1, $32, $F1, $30, $F1, $2A, $F1, $29, $F1, $23, $F1, $25, $F1, $27, $F1, $29 ; CPU:$B24B PRG:324B F1 32 F1 30 F1 2A F1 29 F1 23 F1 25 F1 27 F1 29 + .byte $F1, $25, $F2, $FF, $20, $00, $20, $00, $1A, $F1, $2A, $F1, $1A, $F1, $2A, $F1 ; CPU:$B25B PRG:325B F1 25 F2 FF 20 00 20 00 1A F1 2A F1 1A F1 2A F1 + .byte $20, $F1, $30, $F1, $20, $F1, $30, $F1, $15, $F1, $25, $F1, $15, $F1, $25, $F1 ; CPU:$B26B PRG:326B 20 F1 30 F1 20 F1 30 F1 15 F1 25 F1 15 F1 25 F1 + .byte $2A, $F2, $FF, $30, $00, $00, $00, $04, $F1, $04, $F0, $04, $F0, $B5, $02, $04 ; CPU:$B27B PRG:327B 2A F2 FF 30 00 00 00 04 F1 04 F0 04 F0 B5 02 04 + .byte $F2, $FF, $00, $00, $0A, $00, $30, $F0, $37, $F0, $39, $F0, $3B, $F0, $40, $F0 ; CPU:$B28B PRG:328B F2 FF 00 00 0A 00 30 F0 37 F0 39 F0 3B F0 40 F0 + .byte $FF, $30, $00, $00, $00, $0F, $E1, $0A, $E1, $05, $E1, $FF, $00, $01, $0F, $8B ; CPU:$B29B PRG:329B FF 30 00 00 00 0F E1 0A E1 05 E1 FF 00 01 0F 8B + .byte $30, $F5, $FF, $00, $01, $1F, $AA, $40, $E6, $50, $E6, $B3, $02, $FF, $00, $01 ; CPU:$B2AB PRG:32AB 30 F5 FF 00 01 1F AA 40 E6 50 E6 B3 02 FF 00 01 + .byte $0F, $00, $25, $F6, $25, $F1, $25, $F1, $2A, $F1, $35, $F1, $33, $FA, $1F, $F1 ; CPU:$B2BB PRG:32BB 0F 00 25 F6 25 F1 25 F1 2A F1 35 F1 33 FA 1F F1 + .byte $33, $F1, $32, $F1, $30, $F1, $32, $F1, $2A, $F2, $27, $F2, $25, $FE, $1F, $F3 ; CPU:$B2CB PRG:32CB 33 F1 32 F1 30 F1 32 F1 2A F2 27 F2 25 FE 1F F3 + .byte $25, $F6, $25, $F1, $25, $F1, $2A, $F1, $35, $F1, $33, $FA, $1F, $F1, $33, $F1 ; CPU:$B2DB PRG:32DB 25 F6 25 F1 25 F1 2A F1 35 F1 33 FA 1F F1 33 F1 + .byte $32, $F1, $30, $F1, $32, $F1, $33, $F2, $35, $FE, $1F, $F3, $1F, $F2, $3A, $F1 ; CPU:$B2EB PRG:32EB 32 F1 30 F1 32 F1 33 F2 35 FE 1F F3 1F F2 3A F1 + .byte $3A, $F2, $1F, $F1, $3A, $F1, $40, $F1, $3A, $F2, $FF, $10, $01, $0F, $00, $22 ; CPU:$B2FB PRG:32FB 3A F2 1F F1 3A F1 40 F1 3A F2 FF 10 01 0F 00 22 + .byte $F6, $22, $F1, $22, $F1, $27, $F1, $32, $F1, $30, $FA, $1F, $F1, $30, $F1, $2A ; CPU:$B30B PRG:330B F6 22 F1 22 F1 27 F1 32 F1 30 FA 1F F1 30 F1 2A + .byte $F1, $29, $F1, $2A, $F1, $27, $F2, $23, $F2, $22, $FE, $1F, $F3, $22, $F6, $22 ; CPU:$B31B PRG:331B F1 29 F1 2A F1 27 F2 23 F2 22 FE 1F F3 22 F6 22 + .byte $F1, $22, $F1, $27, $F1, $32, $F1, $30, $FA, $1F, $F1, $30, $F1, $2A, $F1, $29 ; CPU:$B32B PRG:332B F1 22 F1 27 F1 32 F1 30 FA 1F F1 30 F1 2A F1 29 + .byte $F1, $2A, $F1, $30, $F2, $32, $FE, $1F, $F3, $1F, $F2, $37, $F1, $37, $F2, $1F ; CPU:$B33B PRG:333B F1 2A F1 30 F2 32 FE 1F F3 1F F2 37 F1 37 F2 1F + .byte $F1, $37, $F1, $37, $F1, $37, $F2, $FF, $20, $00, $20, $00, $1A, $F1, $2A, $F1 ; CPU:$B34B PRG:334B F1 37 F1 37 F1 37 F2 FF 20 00 20 00 1A F1 2A F1 + .byte $B3, $02, $23, $F1, $33, $F1, $B3, $05, $1A, $F1, $2A, $F1, $B3, $08, $25, $F1 ; CPU:$B35B PRG:335B B3 02 23 F1 33 F1 B3 05 1A F1 2A F1 B3 08 25 F1 + .byte $35, $F1, $B3, $0B, $1A, $F1, $2A, $F1, $B3, $0E, $23, $F1, $33, $F1, $B3, $11 ; CPU:$B36B PRG:336B 35 F1 B3 0B 1A F1 2A F1 B3 0E 23 F1 33 F1 B3 11 + .byte $1A, $F1, $2A, $F1, $B3, $14, $25, $F1, $35, $F1, $B3, $17, $2A, $F1, $2A, $F2 ; CPU:$B37B PRG:337B 1A F1 2A F1 B3 14 25 F1 35 F1 B3 17 2A F1 2A F2 + .byte $1F, $F1, $2A, $F1, $30, $F1, $2A, $F2, $FF, $30, $00, $00, $00, $0A, $F2, $05 ; CPU:$B38B PRG:338B 1F F1 2A F1 30 F1 2A F2 FF 30 00 00 00 0A F2 05 + .byte $F2, $0A, $F1, $0A, $F1, $05, $F2, $B7, $02, $07, $F1, $07, $F2, $1F, $F1, $07 ; CPU:$B39B PRG:339B F2 0A F1 0A F1 05 F2 B7 02 07 F1 07 F2 1F F1 07 + .byte $F1, $07, $F1, $07, $F2, $FF, $BC, $46, $C5, $C6, $C7, $CE, $CF, $D0, $D7, $D8 ; CPU:$B3AB PRG:33AB F1 07 F1 07 F2 FF BC 46 C5 C6 C7 CE CF D0 D7 D8 + .byte $D9, $E0, $E1, $E2, $F2, $F3, $FB, $E9, $EA, $EB, $2C, $BC, $0D, $C8, $C9, $CA ; CPU:$B3BB PRG:33BB D9 E0 E1 E2 F2 F3 FB E9 EA EB 2C BC 0D C8 C9 CA + .byte $D1, $D2, $D3, $DA, $DB, $DC, $E3, $E4, $2B, $F4, $F5, $F6, $EC, $ED, $EE, $BC ; CPU:$B3CB PRG:33CB D1 D2 D3 DA DB DC E3 E4 2B F4 F5 F6 EC ED EE BC + .byte $0C, $FC, $FD, $FE, $CC, $CD, $D4, $D5, $D6, $DD, $DE, $DF, $E6, $E7, $E8, $F7 ; CPU:$B3DB PRG:33DB 0C FC FD FE CC CD D4 D5 D6 DD DE DF E6 E7 E8 F7 + .byte $F8, $F9, $EF, $F0, $F1, $FA, $BC, $0B, $27, $28, $29, $2A, $BC, $80, $01, $26 ; CPU:$B3EB PRG:33EB F8 F9 EF F0 F1 FA BC 0B 27 28 29 2A BC 80 01 26 + .byte $19, $15, $0A, $22, $0E, $1B, $30, $10, $0A, $16, $0E, $BC, $33, $02, $26, $19 ; CPU:$B3FB PRG:33FB 19 15 0A 22 0E 1B 30 10 0A 16 0E BC 33 02 26 19 + .byte $15, $0A, $22, $0E, $1B, $30, $10, $0A, $16, $0E, $BC, $50, $16, $25, $1E, $25 ; CPU:$B40B PRG:340B 15 0A 22 0E 1B 30 10 0A 16 0E BC 50 16 25 1E 25 + .byte $1C, $25, $0C, $25, $15, $25, $0E, $25, $30, $12, $1C, $30, $0A, $BC, $0F, $1D ; CPU:$B41B PRG:341B 1C 25 0C 25 15 25 0E 25 30 12 1C 30 0A BC 0F 1D + .byte $1B, $0A, $0D, $0E, $16, $0A, $1B, $14, $30, $18, $0F, $30, $16, $0A, $1D, $1D ; CPU:$B42B PRG:342B 1B 0A 0D 0E 16 0A 1B 14 30 18 0F 30 16 0A 1D 1D + .byte $0E, $15, $2D, $12, $17, $0C, $25, $BC, $28, $0C, $11, $0A, $1B, $0A, $0C, $1D ; CPU:$B43B PRG:343B 0E 15 2D 12 17 0C 25 BC 28 0C 11 0A 1B 0A 0C 1D + .byte $0E, $1B, $1C, $30, $C4, $30, $1D, $18, $0E, $12, $24, $BC, $0E, $22, $1E, $0D ; CPU:$B44B PRG:344B 0E 1B 1C 30 C4 30 1D 18 0E 12 24 BC 0E 22 1E 0D + .byte $0E, $1D, $0A, $16, $0A, $10, $18, $30, $01, $09, $08, $03, $BC, $31, $C4, $30 ; CPU:$B45B PRG:345B 0E 1D 0A 16 0A 10 18 30 01 09 08 03 BC 31 C4 30 + .byte $0B, $0A, $17, $0D, $0A, $12, $30, $01, $09, $08, $06, $BC, $33, $15, $12, $0C ; CPU:$B46B PRG:346B 0B 0A 17 0D 0A 12 30 01 09 08 06 BC 33 15 12 0C + .byte $0E, $17, $1C, $0E, $0D, $30, $0B, $22, $30, $17, $12, $17, $1D, $0E, $17, $0D ; CPU:$B47B PRG:347B 0E 17 1C 0E 0D 30 0B 22 30 17 12 17 1D 0E 17 0D + .byte $18, $BC, $0C, $18, $0F, $30, $0A, $16, $0E, $1B, $12, $0C, $0A, $30, $12, $17 ; CPU:$B48B PRG:348B 18 BC 0C 18 0F 30 0A 16 0E 1B 12 0C 0A 30 12 17 + .byte $0C, $25, $BC, $8C, $C1, $10, $C3, $30, $C0, $BC, $0A, $53, $54, $53, $54, $53 ; CPU:$B49B PRG:349B 0C 25 BC 8C C1 10 C3 30 C0 BC 0A 53 54 53 54 53 + .byte $54, $40, $3D, $39, $3A, $3D, $39, $3A, $3D, $39, $3A, $BF, $06, $BC, $0A, $55 ; CPU:$B4AB PRG:34AB 54 40 3D 39 3A 3D 39 3A 3D 39 3A BF 06 BC 0A 55 + .byte $56, $55, $56, $55, $56, $40, $32, $3B, $3C, $32, $3B, $3C, $32, $3B, $3C, $32 ; CPU:$B4BB PRG:34BB 56 55 56 55 56 40 32 3B 3C 32 3B 3C 32 3B 3C 32 + .byte $BE, $05, $BC, $0A, $53, $54, $53, $54, $53, $41, $40, $BF, $0D, $01, $32, $BC ; CPU:$B4CB PRG:34CB BE 05 BC 0A 53 54 53 54 53 41 40 BF 0D 01 32 BC + .byte $0A, $55, $56, $55, $56, $55, $42, $3F, $BD, $09, $BF, $05, $06, $BC, $0A, $53 ; CPU:$B4DB PRG:34DB 0A 55 56 55 56 55 42 3F BD 09 BF 05 06 BC 0A 53 + .byte $54, $53, $54, $53, $43, $46, $49, $30, $63, $BC, $0C, $BC, $0A, $55, $56, $55 ; CPU:$B4EB PRG:34EB 54 53 54 53 43 46 49 30 63 BC 0C BC 0A 55 56 55 + .byte $56, $41, $44, $47, $30, $30, $64, $66, $6F, $BB, $0A, $BC, $0A, $53, $54, $53 ; CPU:$B4FB PRG:34FB 56 41 44 47 30 30 64 66 6F BB 0A BC 0A 53 54 53 + .byte $54, $42, $45, $48, $30, $30, $64, $67, $70, $BB, $0A, $BC, $0A, $55, $56, $55 ; CPU:$B50B PRG:350B 54 42 45 48 30 30 64 67 70 BB 0A BC 0A 55 56 55 + .byte $56, $43, $46, $49, $30, $30, $64, $68, $70, $BB, $0A, $BC, $0A, $53, $54, $53 ; CPU:$B51B PRG:351B 56 43 46 49 30 30 64 68 70 BB 0A BC 0A 53 54 53 + .byte $41, $44, $47, $BC, $03, $AE, $69, $71, $BA, $0A, $BC, $0A, $55, $56, $55, $42 ; CPU:$B52B PRG:352B 41 44 47 BC 03 AE 69 71 BA 0A BC 0A 55 56 55 42 + .byte $45, $48, $BC, $03, $6A, $6C, $BF, $0B, $BC, $0A, $53, $54, $53, $43, $46, $49 ; CPU:$B53B PRG:353B 45 48 BC 03 6A 6C BF 0B BC 0A 53 54 53 43 46 49 + .byte $BC, $03, $6B, $6D, $BF, $0B, $BC, $0A, $55, $56, $41, $44, $47, $BC, $04, $69 ; CPU:$B54B PRG:354B BC 03 6B 6D BF 0B BC 0A 55 56 41 44 47 BC 04 69 + .byte $6E, $BF, $0B, $BC, $0A, $53, $54, $42, $45, $48, $BC, $03, $6A, $6C, $BF, $0C ; CPU:$B55B PRG:355B 6E BF 0B BC 0A 53 54 42 45 48 BC 03 6A 6C BF 0C + .byte $BC, $0A, $55, $56, $43, $46, $49, $BC, $03, $6B, $6D, $BF, $0C, $BC, $0A, $53 ; CPU:$B56B PRG:356B BC 0A 55 56 43 46 49 BC 03 6B 6D BF 0C BC 0A 53 + .byte $41, $44, $47, $BC, $04, $69, $6E, $BF, $0C, $BC, $0A, $55, $42, $45, $48, $BC ; CPU:$B57B PRG:357B 41 44 47 BC 04 69 6E BF 0C BC 0A 55 42 45 48 BC + .byte $03, $6A, $6C, $BF, $0D, $BC, $0A, $53, $43, $46, $49, $BC, $03, $6B, $6D, $BF ; CPU:$B58B PRG:358B 03 6A 6C BF 0D BC 0A 53 43 46 49 BC 03 6B 6D BF + .byte $0D, $BC, $0A, $41, $44, $47, $BC, $04, $69, $6E, $BF, $0D, $BC, $0A, $42, $45 ; CPU:$B59B PRG:359B 0D BC 0A 41 44 47 BC 04 69 6E BF 0D BC 0A 42 45 + .byte $48, $BC, $03, $6A, $6C, $BF, $0E, $BC, $0A, $43, $46, $49, $BC, $03, $6B, $6D ; CPU:$B5AB PRG:35AB 48 BC 03 6A 6C BF 0E BC 0A 43 46 49 BC 03 6B 6D + .byte $BF, $0E, $BC, $0A, $44, $47, $BC, $04, $69, $6E, $BF, $0E, $BC, $0A, $45, $48 ; CPU:$B5BB PRG:35BB BF 0E BC 0A 44 47 BC 04 69 6E BF 0E BC 0A 45 48 + .byte $30, $63, $30, $75, $76, $B8, $0F, $BC, $0A, $46, $49, $30, $31, $74, $77, $79 ; CPU:$B5CB PRG:35CB 30 63 30 75 76 B8 0F BC 0A 46 49 30 31 74 77 79 + .byte $B8, $0F, $BC, $0A, $47, $30, $30, $31, $74, $77, $7A, $B8, $0F, $BC, $0A, $48 ; CPU:$B5DB PRG:35DB B8 0F BC 0A 47 30 30 31 74 77 7A B8 0F BC 0A 48 + .byte $30, $30, $31, $74, $78, $BF, $10, $BC, $0A, $49, $30, $30, $AE, $30, $AF, $B9 ; CPU:$B5EB PRG:35EB 30 30 31 74 78 BF 10 BC 0A 49 30 30 AE 30 AF B9 + .byte $10, $BC, $0F, $AF, $B9, $10, $BC, $0F, $AF, $B9, $10, $C0, $34, $35, $BF, $06 ; CPU:$B5FB PRG:35FB 10 BC 0F AF B9 10 BC 0F AF B9 10 C0 34 35 BF 06 + .byte $39, $3A, $3D, $39, $3A, $3D, $39, $3A, $3D, $40, $57, $58, $57, $58, $57, $58 ; CPU:$B60B PRG:360B 39 3A 3D 39 3A 3D 39 3A 3D 40 57 58 57 58 57 58 + .byte $BC, $08, $36, $37, $BE, $05, $32, $3B, $3C, $32, $3B, $3C, $32, $3B, $3C, $32 ; CPU:$B61B PRG:361B BC 08 36 37 BE 05 32 3B 3C 32 3B 3C 32 3B 3C 32 + .byte $40, $59, $5A, $59, $5A, $59, $5A, $BC, $08, $BF, $11, $40, $4A, $58, $57, $58 ; CPU:$B62B PRG:362B 40 59 5A 59 5A 59 5A BC 08 BF 11 40 4A 58 57 58 + .byte $57, $58, $BC, $08, $00, $25, $00, $00, $BF, $04, $BD, $09, $3E, $4B, $5A, $59 ; CPU:$B63B PRG:363B 57 58 BC 08 00 25 00 00 BF 04 BD 09 3E 4B 5A 59 + .byte $5A, $59, $5A, $BC, $08, $BC, $0E, $63, $30, $52, $4F, $4C, $58, $57, $58, $57 ; CPU:$B64B PRG:364B 5A 59 5A BC 08 BC 0E 63 30 52 4F 4C 58 57 58 57 + .byte $58, $BC, $08, $BB, $0C, $7B, $7E, $65, $30, $30, $50, $4D, $4A, $59, $5A, $59 ; CPU:$B65B PRG:365B 58 BC 08 BB 0C 7B 7E 65 30 30 50 4D 4A 59 5A 59 + .byte $5A, $BC, $08, $BB, $0C, $7C, $7F, $65, $30, $30, $51, $4E, $4B, $57, $58, $57 ; CPU:$B66B PRG:366B 5A BC 08 BB 0C 7C 7F 65 30 30 51 4E 4B 57 58 57 + .byte $58, $BC, $08, $BB, $0C, $7C, $80, $65, $30, $30, $52, $4F, $4C, $59, $5A, $59 ; CPU:$B67B PRG:367B 58 BC 08 BB 0C 7C 80 65 30 30 52 4F 4C 59 5A 59 + .byte $5A, $BC, $08, $BA, $0C, $7D, $81, $AE, $BC, $03, $50, $4D, $4A, $58, $57, $58 ; CPU:$B68B PRG:368B 5A BC 08 BA 0C 7D 81 AE BC 03 50 4D 4A 58 57 58 + .byte $BC, $08, $BF, $0D, $82, $83, $BC, $03, $51, $4E, $4B, $5A, $59, $5A, $BC, $08 ; CPU:$B69B PRG:369B BC 08 BF 0D 82 83 BC 03 51 4E 4B 5A 59 5A BC 08 + .byte $BF, $0D, $84, $85, $BC, $03, $52, $4F, $4C, $58, $57, $58, $BC, $08, $BF, $0D ; CPU:$B6AB PRG:36AB BF 0D 84 85 BC 03 52 4F 4C 58 57 58 BC 08 BF 0D + .byte $86, $81, $BC, $04, $50, $4D, $4A, $59, $5A, $BC, $08, $BF, $0E, $82, $83, $BC ; CPU:$B6BB PRG:36BB 86 81 BC 04 50 4D 4A 59 5A BC 08 BF 0E 82 83 BC + .byte $03, $51, $4E, $4B, $57, $58, $BC, $08, $BF, $0E, $84, $85, $BC, $03, $52, $4F ; CPU:$B6CB PRG:36CB 03 51 4E 4B 57 58 BC 08 BF 0E 84 85 BC 03 52 4F + .byte $4C, $59, $5A, $BC, $08, $BF, $0E, $86, $81, $BC, $04, $50, $4D, $4A, $58, $BC ; CPU:$B6DB PRG:36DB 4C 59 5A BC 08 BF 0E 86 81 BC 04 50 4D 4A 58 BC + .byte $08, $BF, $0F, $82, $83, $BC, $03, $51, $4E, $4B, $5A, $BC, $08, $BF, $0F, $84 ; CPU:$B6EB PRG:36EB 08 BF 0F 82 83 BC 03 51 4E 4B 5A BC 08 BF 0F 84 + .byte $85, $BC, $03, $52, $4F, $4C, $58, $BC, $08, $BF, $0F, $86, $81, $BC, $04, $50 ; CPU:$B6FB PRG:36FB 85 BC 03 52 4F 4C 58 BC 08 BF 0F 86 81 BC 04 50 + .byte $4D, $4A, $BC, $08, $BF, $10, $82, $83, $BC, $03, $51, $4E, $4B, $BC, $08, $BF ; CPU:$B70B PRG:370B 4D 4A BC 08 BF 10 82 83 BC 03 51 4E 4B BC 08 BF + .byte $10, $84, $85, $BC, $03, $52, $4F, $4C, $BC, $08, $BF, $10, $86, $81, $BC, $04 ; CPU:$B71B PRG:371B 10 84 85 BC 03 52 4F 4C BC 08 BF 10 86 81 BC 04 + .byte $50, $4D, $BC, $08, $B8, $11, $87, $8A, $30, $63, $30, $51, $4E, $BC, $08, $B8 ; CPU:$B72B PRG:372B 50 4D BC 08 B8 11 87 8A 30 63 30 51 4E BC 08 B8 + .byte $11, $88, $8B, $8D, $31, $30, $52, $4F, $BC, $08, $B8, $11, $89, $8B, $8D, $31 ; CPU:$B73B PRG:373B 11 88 8B 8D 31 30 52 4F BC 08 B8 11 89 8B 8D 31 + .byte $30, $30, $50, $BC, $08, $BF, $12, $8C, $8D, $31, $30, $30, $51, $BC, $08, $B9 ; CPU:$B74B PRG:374B 30 30 50 BC 08 BF 12 8C 8D 31 30 30 51 BC 08 B9 + .byte $12, $B0, $30, $AE, $30, $30, $52, $BC, $08, $B9, $12, $B0, $BC, $0D, $B9, $12 ; CPU:$B75B PRG:375B 12 B0 30 AE 30 30 52 BC 08 B9 12 B0 BC 0D B9 12 + .byte $B0, $BC, $0D, $C0, $06, $20, $D3, $60, $61, $61, $61, $B2, $C0, $22, $ED, $60 ; CPU:$B76B PRG:376B B0 BC 0D C0 06 20 D3 60 61 61 61 B2 C0 22 ED 60 + .byte $61, $61, $61, $B2, $C0, $24, $CE, $60, $62, $62, $62, $B2, $C0, $26, $F4, $60 ; CPU:$B77B PRG:377B 61 61 61 B2 C0 24 CE 60 62 62 62 B2 C0 26 F4 60 + .byte $62, $62, $62, $B2, $C0, $20, $F5, $B3, $B4, $B4, $B5, $C0, $26, $F2, $B6, $B7 ; CPU:$B78B PRG:378B 62 62 62 B2 C0 20 F5 B3 B4 B4 B5 C0 26 F2 B6 B7 + .byte $B7, $E5, $C0, $00, $00, $80, $A0, $F0, $F0, $30, $00, $00, $00, $88, $AA, $2F ; CPU:$B79B PRG:379B B7 E5 C0 00 00 80 A0 F0 F0 30 00 00 00 88 AA 2F + .byte $4F, $57, $55, $00, $00, $88, $AA, $12, $44, $55, $55, $00, $00, $88, $AA, $55 ; CPU:$B7AB PRG:37AB 4F 57 55 00 00 88 AA 12 44 55 55 00 00 88 AA 55 + .byte $55, $55, $55, $00, $00, $88, $66, $55, $55, $55, $55, $00, $00, $88, $46, $55 ; CPU:$B7BB PRG:37BB 55 55 55 00 00 88 66 55 55 55 55 00 00 88 46 55 + .byte $55, $55, $55, $00, $00, $88, $44, $55, $55, $55, $55, $00, $00, $00, $05, $05 ; CPU:$B7CB PRG:37CB 55 55 55 00 00 88 44 55 55 55 55 00 00 00 05 05 + .byte $05, $05, $05, $40, $50, $F0, $F0, $B0, $A0, $00, $00, $55, $55, $5F, $5F, $AB ; CPU:$B7DB PRG:37DB 05 05 05 40 50 F0 F0 B0 A0 00 00 55 55 5F 5F AB + .byte $AA, $00, $00, $55, $55, $55, $55, $9A, $AA, $00, $00, $55, $55, $55, $55, $99 ; CPU:$B7EB PRG:37EB AA 00 00 55 55 55 55 9A AA 00 00 55 55 55 55 99 + .byte $AA, $00, $00, $55, $55, $55, $55, $55, $AA, $00, $00, $55, $55, $55, $55, $55 ; CPU:$B7FB PRG:37FB AA 00 00 55 55 55 55 55 AA 00 00 55 55 55 55 55 + .byte $9A, $00, $00, $55, $55, $55, $55, $55, $99, $00, $00, $05, $05, $05, $05, $05 ; CPU:$B80B PRG:380B 9A 00 00 55 55 55 55 55 99 00 00 05 05 05 05 05 + .byte $00, $00, $00, $00, $00, $80, $A0, $F0, $F0, $30, $00, $00, $00, $88, $AA, $EF ; CPU:$B81B PRG:381B 00 00 00 00 00 80 A0 F0 F0 30 00 00 00 88 AA EF + .byte $FF, $F7, $F5, $00, $00, $88, $AA, $FE, $FF, $FF, $FF, $00, $00, $88, $AA, $FF ; CPU:$B82B PRG:382B FF F7 F5 00 00 88 AA FE FF FF FF 00 00 88 AA FF + .byte $FF, $FF, $FF, $00, $00, $88, $EE, $FF, $FF, $FF, $FF, $00, $00, $88, $FE, $FF ; CPU:$B83B PRG:383B FF FF FF 00 00 88 EE FF FF FF FF 00 00 88 FE FF + .byte $FF, $FF, $FF, $00, $00, $88, $FF, $FF, $FF, $FF, $FF, $00, $00, $00, $0F, $0F ; CPU:$B84B PRG:384B FF FF FF 00 00 88 FF FF FF FF FF 00 00 00 0F 0F + .byte $0F, $0F, $0F, $40, $50, $F0, $F0, $B0, $A0, $00, $00, $F5, $F5, $FF, $FF, $AB ; CPU:$B85B PRG:385B 0F 0F 0F 40 50 F0 F0 B0 A0 00 00 F5 F5 FF FF AB + .byte $AA, $00, $00, $FF, $FF, $FF, $FF, $BA, $AA, $00, $00, $FF, $FF, $FF, $FF, $BB ; CPU:$B86B PRG:386B AA 00 00 FF FF FF FF BA AA 00 00 FF FF FF FF BB + .byte $AA, $00, $00, $FF, $FF, $FF, $FF, $FF, $AA, $00, $00, $FF, $FF, $FF, $FF, $FF ; CPU:$B87B PRG:387B AA 00 00 FF FF FF FF FF AA 00 00 FF FF FF FF FF + .byte $BA, $00, $00, $FF, $FF, $FF, $FF, $FF, $BB, $00, $00, $0F, $0F, $0F, $0F, $0F ; CPU:$B88B PRG:388B BA 00 00 FF FF FF FF FF BB 00 00 0F 0F 0F 0F 0F + .byte $00, $00, $00, $04, $04, $05, $05, $84, $04, $05, $05, $05, $8A, $01, $8D, $10 ; CPU:$B89B PRG:389B 00 00 00 04 04 05 05 84 04 05 05 05 8A 01 8D 10 + .byte $90, $04, $05, $05, $85, $05, $05, $05, $8A, $01, $8D, $10, $90, $04, $05, $05 ; CPU:$B8AB PRG:38AB 90 04 05 05 85 05 05 05 8A 01 8D 10 90 04 05 05 + .byte $85, $05, $05, $05, $8A, $01, $8D, $10, $8F, $04, $04, $05, $05, $84, $04, $05 ; CPU:$B8BB PRG:38BB 85 05 05 05 8A 01 8D 10 8F 04 04 05 05 84 04 05 + .byte $05, $05, $8A, $01, $85, $04, $05, $05, $05, $84, $10, $8F, $05, $04, $05, $05 ; CPU:$B8CB PRG:38CB 05 05 8A 01 85 04 05 05 05 84 10 8F 05 04 05 05 + .byte $84, $05, $05, $05, $05, $8A, $01, $8D, $10, $8F, $04, $04, $05, $05, $84, $04 ; CPU:$B8DB PRG:38DB 84 05 05 05 05 8A 01 8D 10 8F 04 04 05 05 84 04 + .byte $05, $05, $05, $8A, $01, $8D, $10, $8F, $05, $04, $05, $05, $84, $05, $05, $05 ; CPU:$B8EB PRG:38EB 05 05 05 8A 01 8D 10 8F 05 04 05 05 84 05 05 05 + .byte $05, $8A, $01, $8D, $10, $8F, $04, $05, $05, $05, $84, $04, $05, $05, $05, $86 ; CPU:$B8FB PRG:38FB 05 8A 01 8D 10 8F 04 05 05 05 84 04 05 05 05 86 + .byte $55, $83, $01, $82, $01, $01, $87, $05, $81, $10, $81, $0A, $87, $01, $85, $00 ; CPU:$B90B PRG:390B 55 83 01 82 01 01 87 05 81 10 81 0A 87 01 85 00 +; Pass 3: an 86-byte run of $FF padding between stage data blocks. +; ---- data $B91B-$B970 (86 bytes) ---- +StageDataFiller: + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$B91B PRG:391B FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$B92B PRG:392B FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$B93B PRG:393B FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$B94B PRG:394B FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$B95B PRG:395B FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$B96B PRG:396B FF FF FF FF FF FF +; Pass 3: continuation of the stage data block; see StageNametableAndObjectData. +; ---- data $B971-$BD27 (951 bytes) ---- +StageNametableAndObjectData_1: + .byte $44, $44, $FF, $FF, $45, $45, $FF, $00, $01, $01, $00, $02, $03, $03, $02, $FF ; CPU:$B971 PRG:3971 44 44 FF FF 45 45 FF 00 01 01 00 02 03 03 02 FF + .byte $46, $47, $FF, $FF, $48, $49, $4A, $FF, $37, $38, $FF, $FF, $39, $3A, $FF, $FF ; CPU:$B981 PRG:3981 46 47 FF FF 48 49 4A FF 37 38 FF FF 39 3A FF FF + .byte $44, $44, $FF, $1B, $45, $45, $1B, $1C, $01, $01, $1C, $1D, $1E, $1E, $1D, $FF ; CPU:$B991 PRG:3991 44 44 FF 1B 45 45 1B 1C 01 01 1C 1D 1E 1E 1D FF + .byte $46, $47, $FF, $FF, $48, $49, $4A, $FF, $04, $05, $06, $07, $08, $09, $FF, $FF ; CPU:$B9A1 PRG:39A1 46 47 FF FF 48 49 4A FF 04 05 06 07 08 09 FF FF + .byte $46, $47, $FF, $FF, $48, $49, $4A, $0A, $0B, $0C, $0D, $FF, $0E, $0F, $FF, $FF ; CPU:$B9B1 PRG:39B1 46 47 FF FF 48 49 4A 0A 0B 0C 0D FF 0E 0F FF FF + .byte $46, $47, $FF, $FF, $48, $49, $4A, $FF, $3B, $01, $16, $FF, $19, $1A, $FF, $FF ; CPU:$B9C1 PRG:39C1 46 47 FF FF 48 49 4A FF 3B 01 16 FF 19 1A FF FF + .byte $46, $47, $FF, $FF, $48, $49, $FF, $10, $11, $2A, $2B, $3D, $13, $2E, $3C, $05 ; CPU:$B9D1 PRG:39D1 46 47 FF FF 48 49 FF 10 11 2A 2B 3D 13 2E 3C 05 + .byte $07, $03, $05, $07, $07, $03, $03, $05, $03, $07, $05, $03, $03, $07, $07, $FF ; CPU:$B9E1 PRG:39E1 07 03 05 07 07 03 03 05 03 07 05 03 03 07 07 FF + .byte $46, $47, $FF, $FF, $48, $49, $4A, $16, $17, $18, $FF, $FF, $19, $1A, $FF, $FF ; CPU:$B9F1 PRG:39F1 46 47 FF FF 48 49 4A 16 17 18 FF FF 19 1A FF FF + .byte $1B, $FF, $FF, $FF, $20, $4C, $4B, $3B, $01, $4E, $4D, $19, $1A, $4F, $FF, $FF ; CPU:$BA01 PRG:3A01 1B FF FF FF 20 4C 4B 3B 01 4E 4D 19 1A 4F FF FF + .byte $46, $47, $FF, $FF, $48, $49, $4A, $16, $24, $25, $26, $FF, $FF, $27, $28, $FF ; CPU:$BA11 PRG:3A11 46 47 FF FF 48 49 4A 16 24 25 26 FF FF 27 28 FF + .byte $46, $47, $FF, $FF, $48, $49, $4A, $FF, $29, $2A, $2B, $2C, $2D, $2E, $3C, $2F ; CPU:$BA21 PRG:3A21 46 47 FF FF 48 49 4A FF 29 2A 2B 2C 2D 2E 3C 2F + .byte $30, $FF, $FF, $31, $32, $4C, $4B, $33, $34, $4E, $4D, $FF, $FF, $4F, $FF, $FF ; CPU:$BA31 PRG:3A31 30 FF FF 31 32 4C 4B 33 34 4E 4D FF FF 4F FF FF + .byte $50, $51, $FF, $FF, $52, $52, $FF, $00, $01, $01, $00, $02, $03, $03, $02, $FF ; CPU:$BA41 PRG:3A41 50 51 FF FF 52 52 FF 00 01 01 00 02 03 03 02 FF + .byte $53, $54, $FF, $FF, $55, $56, $FF, $FF, $37, $38, $FF, $FF, $39, $3A, $FF, $FF ; CPU:$BA51 PRG:3A51 53 54 FF FF 55 56 FF FF 37 38 FF FF 39 3A FF FF + .byte $50, $51, $FF, $1B, $52, $52, $1B, $1C, $01, $01, $1C, $1D, $1E, $1E, $1D, $FF ; CPU:$BA61 PRG:3A61 50 51 FF 1B 52 52 1B 1C 01 01 1C 1D 1E 1E 1D FF + .byte $53, $54, $FF, $FF, $55, $56, $FF, $FF, $04, $05, $06, $07, $08, $09, $FF, $FF ; CPU:$BA71 PRG:3A71 53 54 FF FF 55 56 FF FF 04 05 06 07 08 09 FF FF + .byte $53, $54, $FF, $FF, $55, $56, $FF, $0A, $0B, $0C, $0D, $FF, $0E, $0F, $FF, $FF ; CPU:$BA81 PRG:3A81 53 54 FF FF 55 56 FF 0A 0B 0C 0D FF 0E 0F FF FF + .byte $53, $54, $FF, $FF, $55, $56, $FF, $FF, $3B, $01, $16, $FF, $19, $1A, $FF, $FF ; CPU:$BA91 PRG:3A91 53 54 FF FF 55 56 FF FF 3B 01 16 FF 19 1A FF FF + .byte $53, $54, $FF, $FF, $55, $56, $FF, $10, $11, $2A, $2B, $3D, $13, $2E, $3C, $08 ; CPU:$BAA1 PRG:3AA1 53 54 FF FF 55 56 FF 10 11 2A 2B 3D 13 2E 3C 08 + .byte $0A, $06, $0A, $0A, $07, $07, $07, $07, $05, $0A, $05, $05, $07, $0A, $0A, $FF ; CPU:$BAB1 PRG:3AB1 0A 06 0A 0A 07 07 07 07 05 0A 05 05 07 0A 0A FF + .byte $53, $54, $FF, $FF, $55, $56, $FF, $16, $17, $18, $FF, $FF, $19, $1A, $FF, $FF ; CPU:$BAC1 PRG:3AC1 53 54 FF FF 55 56 FF 16 17 18 FF FF 19 1A FF FF + .byte $1B, $FF, $FF, $FF, $20, $58, $57, $3B, $01, $5A, $59, $19, $1A, $FF, $FF, $FF ; CPU:$BAD1 PRG:3AD1 1B FF FF FF 20 58 57 3B 01 5A 59 19 1A FF FF FF + .byte $53, $54, $FF, $FF, $55, $56, $FF, $16, $24, $25, $26, $FF, $FF, $27, $28, $FF ; CPU:$BAE1 PRG:3AE1 53 54 FF FF 55 56 FF 16 24 25 26 FF FF 27 28 FF + .byte $53, $54, $FF, $FF, $55, $56, $FF, $FF, $29, $2A, $2B, $2C, $2D, $2E, $3C, $2F ; CPU:$BAF1 PRG:3AF1 53 54 FF FF 55 56 FF FF 29 2A 2B 2C 2D 2E 3C 2F + .byte $30, $FF, $FF, $31, $32, $58, $57, $33, $34, $5A, $59, $FF, $FF, $FF, $FF, $FF ; CPU:$BB01 PRG:3B01 30 FF FF 31 32 58 57 33 34 5A 59 FF FF FF FF FF + .byte $5D, $5E, $FF, $FF, $5F, $5F, $FF, $00, $01, $01, $00, $5C, $5B, $5B, $5C, $FF ; CPU:$BB11 PRG:3B11 5D 5E FF FF 5F 5F FF 00 01 01 00 5C 5B 5B 5C FF + .byte $60, $61, $FF, $FF, $62, $63, $FF, $FF, $37, $38, $FF, $FF, $73, $72, $FF, $FF ; CPU:$BB21 PRG:3B21 60 61 FF FF 62 63 FF FF 37 38 FF FF 73 72 FF FF + .byte $5D, $5E, $FF, $1B, $5F, $5F, $1B, $78, $01, $01, $78, $79, $7A, $7A, $79, $FF ; CPU:$BB31 PRG:3B31 5D 5E FF 1B 5F 5F 1B 78 01 01 78 79 7A 7A 79 FF + .byte $60, $61, $FF, $FF, $62, $63, $FF, $FF, $04, $05, $06, $82, $76, $77, $FF, $FF ; CPU:$BB41 PRG:3B41 60 61 FF FF 62 63 FF FF 04 05 06 82 76 77 FF FF + .byte $60, $61, $FF, $FF, $62, $63, $FF, $0A, $0B, $0C, $0D, $FF, $74, $75, $FF, $FF ; CPU:$BB51 PRG:3B51 60 61 FF FF 62 63 FF 0A 0B 0C 0D FF 74 75 FF FF + .byte $60, $61, $FF, $FF, $62, $63, $FF, $FF, $3B, $01, $16, $FF, $6B, $6A, $FF, $FF ; CPU:$BB61 PRG:3B61 60 61 FF FF 62 63 FF FF 3B 01 16 FF 6B 6A FF FF + .byte $60, $61, $FF, $FF, $62, $63, $FF, $6C, $6D, $2A, $2B, $6E, $6F, $2E, $3C, $07 ; CPU:$BB71 PRG:3B71 60 61 FF FF 62 63 FF 6C 6D 2A 2B 6E 6F 2E 3C 07 + .byte $0A, $05, $07, $0A, $0A, $0A, $0A, $07, $05, $07, $07, $0A, $0A, $05, $07, $FF ; CPU:$BB81 PRG:3B81 0A 05 07 0A 0A 0A 0A 07 05 07 07 0A 0A 05 07 FF + .byte $60, $61, $FF, $FF, $62, $63, $FF, $16, $17, $18, $FF, $FF, $6B, $6A, $FF, $FF ; CPU:$BB91 PRG:3B91 60 61 FF FF 62 63 FF 16 17 18 FF FF 6B 6A FF FF + .byte $1B, $FF, $FF, $FF, $20, $7F, $7E, $3B, $01, $81, $80, $6B, $6A, $FF, $FF, $FF ; CPU:$BBA1 PRG:3BA1 1B FF FF FF 20 7F 7E 3B 01 81 80 6B 6A FF FF FF + .byte $60, $61, $FF, $FF, $62, $63, $FF, $16, $24, $25, $68, $FF, $FF, $27, $69, $FF ; CPU:$BBB1 PRG:3BB1 60 61 FF FF 62 63 FF 16 24 25 68 FF FF 27 69 FF + .byte $60, $61, $FF, $FF, $62, $63, $FF, $FF, $7B, $2A, $2B, $7C, $7D, $2E, $3C, $64 ; CPU:$BBC1 PRG:3BC1 60 61 FF FF 62 63 FF FF 7B 2A 2B 7C 7D 2E 3C 64 + .byte $65, $FF, $FF, $66, $67, $7F, $7E, $33, $34, $81, $80, $FF, $FF, $FF, $FF, $FF ; CPU:$BBD1 PRG:3BD1 65 FF FF 66 67 7F 7E 33 34 81 80 FF FF FF FF FF + .byte $DA, $DA, $FF, $FF, $DB, $DB, $FF, $8E, $DC, $DC, $8E, $02, $03, $03, $02, $FF ; CPU:$BBE1 PRG:3BE1 DA DA FF FF DB DB FF 8E DC DC 8E 02 03 03 02 FF + .byte $DD, $DE, $FF, $FF, $DF, $E0, $FF, $FF, $E1, $90, $FF, $FF, $39, $3A, $FF, $FF ; CPU:$BBF1 PRG:3BF1 DD DE FF FF DF E0 FF FF E1 90 FF FF 39 3A FF FF + .byte $DA, $DA, $FF, $93, $DB, $DB, $93, $1C, $DC, $DC, $1C, $1D, $1E, $1E, $1D, $FF ; CPU:$BC01 PRG:3C01 DA DA FF 93 DB DB 93 1C DC DC 1C 1D 1E 1E 1D FF + .byte $DD, $DE, $FF, $FF, $DF, $E0, $FF, $FF, $E2, $8C, $06, $07, $08, $09, $FF, $FF ; CPU:$BC11 PRG:3C11 DD DE FF FF DF E0 FF FF E2 8C 06 07 08 09 FF FF + .byte $DD, $DE, $FF, $FF, $DF, $E0, $FF, $0A, $8D, $99, $0D, $FF, $0E, $0F, $FF, $FF ; CPU:$BC21 PRG:3C21 DD DE FF FF DF E0 FF 0A 8D 99 0D FF 0E 0F FF FF + .byte $DD, $DE, $FF, $FF, $DF, $E0, $FF, $FF, $E4, $9B, $91, $FF, $19, $1A, $FF, $FF ; CPU:$BC31 PRG:3C31 DD DE FF FF DF E0 FF FF E4 9B 91 FF 19 1A FF FF + .byte $DD, $DE, $FF, $FF, $DF, $E0, $FF, $10, $E3, $2A, $85, $3D, $13, $2E, $3C, $FF ; CPU:$BC41 PRG:3C41 DD DE FF FF DF E0 FF 10 E3 2A 85 3D 13 2E 3C FF + .byte $DA, $DA, $FF, $93, $DB, $DB, $93, $1F, $DC, $DC, $1F, $02, $03, $03, $02, $FF ; CPU:$BC51 PRG:3C51 DA DA FF 93 DB DB 93 1F DC DC 1F 02 03 03 02 FF + .byte $DD, $DE, $FF, $FF, $DF, $E0, $FF, $91, $92, $18, $FF, $FF, $19, $1A, $FF, $FF ; CPU:$BC61 PRG:3C61 DD DE FF FF DF E0 FF 91 92 18 FF FF 19 1A FF FF + .byte $1B, $FF, $FF, $FF, $21, $E8, $E7, $E4, $01, $EA, $E9, $19, $1A, $FF, $FF, $FF ; CPU:$BC71 PRG:3C71 1B FF FF FF 21 E8 E7 E4 01 EA E9 19 1A FF FF FF + .byte $DD, $DE, $FF, $FF, $DF, $E0, $FF, $16, $8A, $25, $26, $FF, $FF, $E5, $28, $FF ; CPU:$BC81 PRG:3C81 DD DE FF FF DF E0 FF 16 8A 25 26 FF FF E5 28 FF + .byte $DD, $DE, $FF, $FF, $DF, $E0, $FF, $FF, $29, $2A, $85, $2C, $2D, $2E, $3C, $2F ; CPU:$BC91 PRG:3C91 DD DE FF FF DF E0 FF FF 29 2A 85 2C 2D 2E 3C 2F + .byte $30, $FF, $FF, $31, $E6, $E8, $E7, $33, $8F, $EA, $E9, $FF, $FF, $FF, $FF, $98 ; CPU:$BCA1 PRG:3CA1 30 FF FF 31 E6 E8 E7 33 8F EA E9 FF FF FF FF 98 + .byte $83, $83, $98, $FF, $84, $84, $FF, $8E, $01, $01, $8E, $02, $03, $03, $02, $FF ; CPU:$BCB1 PRG:3CB1 83 83 98 FF 84 84 FF 8E 01 01 8E 02 03 03 02 FF + .byte $86, $87, $FF, $FF, $88, $89, $FF, $FF, $37, $90, $FF, $FF, $39, $3A, $FF, $98 ; CPU:$BCC1 PRG:3CC1 86 87 FF FF 88 89 FF FF 37 90 FF FF 39 3A FF 98 + .byte $83, $83, $98, $93, $84, $84, $93, $1F, $01, $01, $1F, $1D, $1E, $1E, $1D, $FF ; CPU:$BCD1 PRG:3CD1 83 83 98 93 84 84 93 1F 01 01 1F 1D 1E 1E 1D FF + .byte $86, $87, $FF, $FF, $88, $89, $FF, $FF, $8B, $8C, $06, $07, $08, $09, $FF, $FF ; CPU:$BCE1 PRG:3CE1 86 87 FF FF 88 89 FF FF 8B 8C 06 07 08 09 FF FF + .byte $86, $87, $FF, $FF, $88, $89, $FF, $0A, $8D, $99, $0D, $FF, $0E, $0F, $FF, $FF ; CPU:$BCF1 PRG:3CF1 86 87 FF FF 88 89 FF 0A 8D 99 0D FF 0E 0F FF FF + .byte $86, $87, $FF, $FF, $88, $89, $FF, $FF, $3B, $9B, $91, $FF, $19, $1A, $FF, $FF ; CPU:$BD01 PRG:3D01 86 87 FF FF 88 89 FF FF 3B 9B 91 FF 19 1A FF FF + .byte $86, $87, $FF, $FF, $88, $89, $FF, $10, $11, $2A, $85, $3D, $13, $2E, $3C, $28 ; CPU:$BD11 PRG:3D11 86 87 FF FF 88 89 FF 10 11 2A 85 3D 13 2E 3C 28 + .byte $14, $1E, $28, $28, $1E, $0A, $28 ; CPU:$BD21 PRG:3D21 14 1E 28 28 1E 0A 28 +; Pass 3: one low byte per player; ProcessBytecodeOpcode adds $32 for the second player to reach its copy, so the two entries are $32 apart in the stage data that follows. +; ---- data $BD28-$BD29 (2 bytes) ---- +StageDataPointerLow: + .byte $6B, $6B ; CPU:$BD28 PRG:3D28 6B 6B +; Pass 3: continuation of the stage data block, read through StageDataPointerLow plus the $32 per-player offset. +; ---- data $BD2A-$BEBF (406 bytes) ---- +StageNametableAndObjectData_2: + .byte $6E, $75, $75, $80, $5A, $78, $FF, $86, $87, $FF, $FF, $88, $89, $FF, $91, $92 ; CPU:$BD2A PRG:3D2A 6E 75 75 80 5A 78 FF 86 87 FF FF 88 89 FF 91 92 + .byte $18, $FF, $FF, $19, $1A, $FF, $FF, $1B, $FF, $FF, $FF, $21, $95, $94, $3B, $01 ; CPU:$BD3A PRG:3D3A 18 FF FF 19 1A FF FF 1B FF FF FF 21 95 94 3B 01 + .byte $97, $96, $19, $1A, $FF, $FF, $FF, $86, $87, $FF, $FF, $88, $89, $FF, $16, $8A ; CPU:$BD4A PRG:3D4A 97 96 19 1A FF FF FF 86 87 FF FF 88 89 FF 16 8A + .byte $25, $26, $FF, $FF, $27, $28, $FF, $86, $87, $FF, $FF, $88, $89, $FF, $FF, $29 ; CPU:$BD5A PRG:3D5A 25 26 FF FF 27 28 FF 86 87 FF FF 88 89 FF FF 29 + .byte $2A, $85, $2C, $2D, $2E, $3C, $2F, $30, $FF, $FF, $31, $32, $95, $94, $33, $8F ; CPU:$BD6A PRG:3D6A 2A 85 2C 2D 2E 3C 2F 30 FF FF 31 32 95 94 33 8F + .byte $97, $96, $FF, $FF, $FF, $FF, $FF, $AB, $AB, $FF, $FF, $AC, $AC, $FF, $00, $AD ; CPU:$BD7A PRG:3D7A 97 96 FF FF FF FF FF AB AB FF FF AC AC FF 00 AD + .byte $AD, $00, $02, $03, $03, $02, $FF, $9D, $9E, $FF, $FF, $9F, $A0, $FF, $FF, $A3 ; CPU:$BD8A PRG:3D8A AD 00 02 03 03 02 FF 9D 9E FF FF 9F A0 FF FF A3 + .byte $90, $FF, $FF, $39, $3A, $FF, $FF, $AB, $AB, $FF, $1B, $AC, $AC, $1B, $1C, $AD ; CPU:$BD9A PRG:3D9A 90 FF FF 39 3A FF FF AB AB FF 1B AC AC 1B 1C AD + .byte $AD, $1C, $1D, $1E, $1E, $1D, $FF, $9D, $9E, $FF, $FF, $9F, $A0, $FF, $FF, $A2 ; CPU:$BDAA PRG:3DAA AD 1C 1D 1E 1E 1D FF 9D 9E FF FF 9F A0 FF FF A2 + .byte $8C, $06, $07, $08, $09, $FF, $FF, $9D, $9E, $FF, $FF, $9F, $A0, $FF, $0A, $8D ; CPU:$BDBA PRG:3DBA 8C 06 07 08 09 FF FF 9D 9E FF FF 9F A0 FF 0A 8D + .byte $99, $0D, $FF, $0E, $0F, $FF, $FF, $9D, $9E, $FF, $FF, $9F, $A0, $FF, $FF, $A1 ; CPU:$BDCA PRG:3DCA 99 0D FF 0E 0F FF FF 9D 9E FF FF 9F A0 FF FF A1 + .byte $9B, $91, $FF, $19, $1A, $FF, $FF, $9D, $9E, $FF, $FF, $9F, $A0, $FF, $10, $A6 ; CPU:$BDDA PRG:3DDA 9B 91 FF 19 1A FF FF 9D 9E FF FF 9F A0 FF 10 A6 + .byte $2A, $85, $3D, $13, $2E, $3C, $FF, $9D, $9E, $FF, $FF, $9F, $A0, $FF, $9C, $8A ; CPU:$BDEA PRG:3DEA 2A 85 3D 13 2E 3C FF 9D 9E FF FF 9F A0 FF 9C 8A + .byte $25, $26, $FF, $FF, $27, $28, $FF, $9D, $9E, $FF, $FF, $9F, $A0, $FF, $91, $92 ; CPU:$BDFA PRG:3DFA 25 26 FF FF 27 28 FF 9D 9E FF FF 9F A0 FF 91 92 + .byte $18, $FF, $FF, $19, $1A, $FF, $FF, $1B, $FF, $FF, $FF, $20, $A8, $A7, $A1, $01 ; CPU:$BE0A PRG:3E0A 18 FF FF 19 1A FF FF 1B FF FF FF 20 A8 A7 A1 01 + .byte $AA, $A9, $19, $1A, $FF, $FF, $FF, $9D, $9E, $FF, $FF, $9F, $A0, $FF, $16, $8A ; CPU:$BE1A PRG:3E1A AA A9 19 1A FF FF FF 9D 9E FF FF 9F A0 FF 16 8A + .byte $25, $26, $FF, $FF, $27, $28, $FF, $9D, $9E, $FF, $FF, $9F, $A0, $FF, $FF, $A4 ; CPU:$BE2A PRG:3E2A 25 26 FF FF 27 28 FF 9D 9E FF FF 9F A0 FF FF A4 + .byte $2A, $85, $2C, $2D, $2E, $3C, $2F, $30, $FF, $FF, $31, $A5, $A8, $A7, $33, $8F ; CPU:$BE3A PRG:3E3A 2A 85 2C 2D 2E 3C 2F 30 FF FF 31 A5 A8 A7 33 8F + .byte $AA, $A9, $FF, $FF, $FF, $FF, $BB, $BC, $BC, $BB, $FF, $BD, $BD, $FF, $00, $01 ; CPU:$BE4A PRG:3E4A AA A9 FF FF FF FF BB BC BC BB FF BD BD FF 00 01 + .byte $01, $00, $5C, $5B, $5B, $5C, $FF, $BE, $BF, $FF, $FF, $C0, $C1, $FF, $FF, $37 ; CPU:$BE5A PRG:3E5A 01 00 5C 5B 5B 5C FF BE BF FF FF C0 C1 FF FF 37 + .byte $38, $FF, $FF, $73, $72, $FF, $BB, $BC, $BC, $BB, $1B, $BD, $BD, $1B, $78, $01 ; CPU:$BE6A PRG:3E6A 38 FF FF 73 72 FF BB BC BC BB 1B BD BD 1B 78 01 + .byte $01, $78, $79, $7A, $7A, $79, $FF, $BE, $BF, $FF, $FF, $C0, $C1, $FF, $FF, $04 ; CPU:$BE7A PRG:3E7A 01 78 79 7A 7A 79 FF BE BF FF FF C0 C1 FF FF 04 + .byte $05, $06, $82, $76, $77, $FF, $FF, $BE, $BF, $FF, $FF, $C0, $C1, $FF, $0A, $0B ; CPU:$BE8A PRG:3E8A 05 06 82 76 77 FF FF BE BF FF FF C0 C1 FF 0A 0B + .byte $0C, $0D, $FF, $74, $75, $FF, $FF, $BE, $BF, $FF, $FF, $C0, $C1, $FF, $FF, $3B ; CPU:$BE9A PRG:3E9A 0C 0D FF 74 75 FF FF BE BF FF FF C0 C1 FF FF 3B + .byte $01, $16, $FF, $6B, $6A, $FF, $FF, $BE, $BF, $FF, $FF, $C0, $C1, $FF, $6C, $6D ; CPU:$BEAA PRG:3EAA 01 16 FF 6B 6A FF FF BE BF FF FF C0 C1 FF 6C 6D + .byte $2A, $2B, $6E, $6F, $2E, $3C ; CPU:$BEBA PRG:3EBA 2A 2B 6E 6F 2E 3C +; Pass 3: 8 entries (ldx #$07) copied into $0220 by CompactOamList. +; ---- data $BEC0-$BEC7 (8 bytes) ---- +InitialOamAttributes: + .byte $40, $58, $80, $A8, $C0, $A8, $80, $58 ; CPU:$BEC0 PRG:3EC0 40 58 80 A8 C0 A8 80 58 +; Pass 3: 8 entries copied into $0223 by CompactOamList. +; ---- data $BEC8-$BECF (8 bytes) ---- +InitialOamTiles: + .byte $7C, $AC, $BC, $AC, $7C, $4C, $3C, $4C ; CPU:$BEC8 PRG:3EC8 7C AC BC AC 7C 4C 3C 4C +; Pass 3: the tail of the stage data block, ahead of the VRAM block descriptors. +; ---- data $BED0-$BF8F (192 bytes) ---- +StageDataTail: + .byte $FF, $BE, $BF, $FF, $FF, $C0, $C1, $FF, $16, $17, $18, $FF, $FF, $6B, $6A, $FF ; CPU:$BED0 PRG:3ED0 FF BE BF FF FF C0 C1 FF 16 17 18 FF FF 6B 6A FF + .byte $FF, $1B, $FF, $FF, $FF, $20, $C3, $C2, $3B, $01, $C5, $C4, $6B, $6A, $FF, $FF ; CPU:$BEE0 PRG:3EE0 FF 1B FF FF FF 20 C3 C2 3B 01 C5 C4 6B 6A FF FF + .byte $FF, $BE, $BF, $FF, $FF, $C0, $C1, $FF, $16, $24, $25, $68, $FF, $FF, $27, $69 ; CPU:$BEF0 PRG:3EF0 FF BE BF FF FF C0 C1 FF 16 24 25 68 FF FF 27 69 + .byte $FF, $BE, $BF, $FF, $FF, $C0, $C1, $FF, $FF, $7B, $2A, $2B, $7C, $7D, $2E, $3C ; CPU:$BF00 PRG:3F00 FF BE BF FF FF C0 C1 FF FF 7B 2A 2B 7C 7D 2E 3C + .byte $64, $65, $FF, $FF, $66, $67, $C3, $C2, $33, $34, $C5, $C4, $FF, $FF, $FF, $FF ; CPU:$BF10 PRG:3F10 64 65 FF FF 66 67 C3 C2 33 34 C5 C4 FF FF FF FF + .byte $FF, $C6, $C6, $FF, $C7, $C8, $C8, $C7, $C9, $CA, $CA, $C9, $02, $03, $03, $02 ; CPU:$BF20 PRG:3F20 FF C6 C6 FF C7 C8 C8 C7 C9 CA CA C9 02 03 03 02 + .byte $FF, $D4, $3F, $FF, $FF, $D5, $FE, $FF, $FF, $D6, $D7, $CF, $FF, $39, $3A, $FF ; CPU:$BF30 PRG:3F30 FF D4 3F FF FF D5 FE FF FF D6 D7 CF FF 39 3A FF + .byte $FF, $C6, $C6, $FF, $C7, $C8, $C8, $C7, $C9, $CA, $CA, $C9, $1D, $03, $03, $1D ; CPU:$BF40 PRG:3F40 FF C6 C6 FF C7 C8 C8 C7 C9 CA CA C9 1D 03 03 1D + .byte $FF, $D4, $3F, $FF, $FF, $D5, $FE, $FF, $CC, $CD, $CE, $CF, $07, $08, $09, $FF ; CPU:$BF50 PRG:3F50 FF D4 3F FF FF D5 FE FF CC CD CE CF 07 08 09 FF + .byte $FF, $D4, $3F, $FF, $FF, $D5, $FE, $FF, $CF, $CE, $CD, $CC, $FF, $0E, $0F, $FF ; CPU:$BF60 PRG:3F60 FF D4 3F FF FF D5 FE FF CF CE CD CC FF 0E 0F FF + .byte $FF, $D4, $3F, $FF, $FF, $D5, $FE, $FF, $FF, $D6, $D7, $16, $FF, $19, $1A, $FF ; CPU:$BF70 PRG:3F70 FF D4 3F FF FF D5 FE FF FF D6 D7 16 FF 19 1A FF + .byte $FF, $D4, $3F, $FF, $FF, $D5, $FE, $C7, $10, $11, $2A, $C9, $3D, $13, $2E, $FF ; CPU:$BF80 PRG:3F80 FF D4 3F FF FF D5 FE C7 10 11 2A C9 3D 13 2E FF +; Pass 3: 8 block sizes fed to ExecuteVramTransfer by ReadControllerAndInit. +; ---- data $BF90-$BF97 (8 bytes) ---- +VramBlockByteCounts: + .byte $30, $48, $70, $98, $B0, $98, $70, $48 ; CPU:$BF90 PRG:3F90 30 48 70 98 B0 98 70 48 +; Pass 3: 8 block source low bytes; the high byte is always $02. +; ---- data $BF98-$BF9F (8 bytes) ---- +VramBlockSourceLowBytes: + .byte $70, $A0, $B0, $A0, $70, $40, $30, $40 ; CPU:$BF98 PRG:3F98 70 A0 B0 A0 70 40 30 40 +; Pass 3: the $B1A1/$B1B0/$B2B9/$B3B2 sound sequences the sound engine points at, plus the level tables, ending just before the vectors. +; ---- data $BFA0-$BFFA (91 bytes) ---- +SoundSequenceAndLevelData: + .byte $FF, $D4, $3F, $FF, $FF, $D5, $FE, $FF, $16, $17, $CD, $CC, $FF, $19, $1A, $FF ; CPU:$BFA0 PRG:3FA0 FF D4 3F FF FF D5 FE FF 16 17 CD CC FF 19 1A FF + .byte $FF, $1B, $FF, $FF, $FF, $20, $D9, $D8, $D6, $01, $D9, $D8, $19, $1A, $FF, $FF ; CPU:$BFB0 PRG:3FB0 FF 1B FF FF FF 20 D9 D8 D6 01 D9 D8 19 1A FF FF + .byte $FF, $D4, $3F, $FF, $FF, $D5, $FE, $FF, $16, $24, $25, $26, $FF, $FF, $D3, $28 ; CPU:$BFC0 PRG:3FC0 FF D4 3F FF FF D5 FE FF 16 24 25 26 FF FF D3 28 + .byte $FF, $D4, $3F, $FF, $FF, $D5, $FE, $C7, $FF, $CB, $2A, $C9, $2C, $2D, $2E, $FF ; CPU:$BFD0 PRG:3FD0 FF D4 3F FF FF D5 FE C7 FF CB 2A C9 2C 2D 2E FF + .byte $2F, $30, $FF, $FF, $31, $D2, $D9, $D8, $33, $34, $14, $15, $FF, $FF, $FF, $FF ; CPU:$BFE0 PRG:3FE0 2F 30 FF FF 31 D2 D9 D8 33 34 14 15 FF FF FF FF + .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $CB ; CPU:$BFF0 PRG:3FF0 FF FF FF FF FF FF FF FF FF FF CB +; Pass 3: the three CPU vectors, mirrored into the ROM at $FFFB-$FFFF. +; ---- data $BFFB-$BFFF (5 bytes) ---- +InterruptVectors: + .byte $86, $00, $80, $64, $87 ; CPU:$BFFB PRG:3FFB 86 00 80 64 87 diff --git a/_wip/MUSCLE (U)/copilot/reconstructed.lbl b/_wip/MUSCLE (U)/copilot/reconstructed.lbl index e69de29..40af55c 100644 --- a/_wip/MUSCLE (U)/copilot/reconstructed.lbl +++ b/_wip/MUSCLE (U)/copilot/reconstructed.lbl @@ -0,0 +1,774 @@ +al 00BFFB .InterruptVectors +al 00BFA0 .SoundSequenceAndLevelData +al 00BF98 .VramBlockSourceLowBytes +al 00BF90 .VramBlockByteCounts +al 00BED0 .StageDataTail +al 00BEC8 .InitialOamTiles +al 00BEC0 .InitialOamAttributes +al 00BD2A .StageNametableAndObjectData_2 +al 00BD28 .StageDataPointerLow +al 00B971 .StageNametableAndObjectData_1 +al 00B91B .StageDataFiller +al 00B0FB .StageNametableAndObjectData +al 00B0F7 .ApuChannelEnableBitsClear +al 00B0F3 .ApuChannelEnableBitsSet +al 00B0E3 .SoundNoteDurationTable +al 00B0CB .SoundNotePeriodTable +al 00B0B3 .LoadSoundSequenceStep +al 00B0BB .LoadSoundSequenceStep_OnCarrySet_B0BB +al 00B0C6 .DecrementSustainCounter +al 00B0A9 .HandleSustainCounter +al 00B08E .AdvanceSoundSequenceStepAlt +al 00B08C .AdvanceSoundSequenceStep +al 00B083 .WriteApuControlRegister +al 00B096 .ReadLoopFlag +al 00B09D .HandleNoteTerminator +al 00B095 .ReturnFromSoundCommand +al 00B06C .ApplySoundCommand +al 00B069 .WriteApuEnable_OnNegative_B069 +al 00B062 .WriteApuEnable +al 00B05D .BuildApuChannelMask +al 00B058 .ReadNoteDuration_OnZero_B058 +al 00B049 .StoreNoteDuration +al 00B059 .StoreShortNoteDuration +al 00B03A .ReadNoteDuration +al 00B037 .ComputeTonePeriod_OnCarrySet_B037 +al 00B007 .WriteToneRegisters +al 00B000 .ShiftNoteTableIndex +al 00B028 .ComputeTonePeriod_OnCarrySet_B028 +al 00B036 .ComputeTonePeriod_OnCarrySet_B036 +al 00B029 .WriteFixedToneRegisters +al 00AFD9 .ComputeTonePeriod +al 00AFD5 .ComputeEnvelopeMask_OnZero_AFD5 +al 00AFC5 .ComputeEnvelopeMask +al 00AFAB .AdvanceSoundSequencePointer +al 00AF6B .RebuildApuEnableMask +al 00AF69 .WriteSoundChannelState +al 00AF55 .AdvanceSoundChannelNote +al 00AF68 .UpdateSoundChannel_JoinBranchPaths_AF68 +al 00AF73 .StartSoundChannelNote +al 00AF43 .UpdateSoundChannel +al 00AF40 .UpdateAllSoundChannels +al 00AF3B .UpdateSoundFrame +al 00AF37 .UnreachableSoundInitIsland +al 00AF25 .InitializeSoundEngine +al 00AF24 .ComputeEdgeOverlapBits_JoinBranchPaths_AF24 +al 00AF01 .ComputeEdgeOverlapBits_JoinBranchPaths_AF01 +al 00AEE3 .ComputeEdgeOverlapBits_OnZero_AEE3 +al 00AEEA .ComputeEdgeOverlapBits_JoinBranchPaths_AEEA +al 00AEDC .ComputeEdgeOverlapBits_JoinBranchPaths_AEDC +al 00AEBE .ComputeEdgeOverlapBits_OnNonzero_AEBE +al 00AECA .ComputeEdgeOverlapBits_JoinBranchPaths_AECA +al 00AEFA .ComputeEdgeOverlapBits_OnZero_AEFA +al 00AEE9 .ComputeEdgeOverlapBits_JoinBranchPaths_AEE9 +al 00AE9B .ComputeEdgeOverlapBits +al 00AE92 .SetDefaultOverlapBits_OnNonzero_AE92 +al 00AE90 .SetDefaultOverlapBits_OnNegative_AE90 +al 00AE96 .SetDefaultOverlapBits_OnNonzero_AE96 +al 00AE82 .SetDefaultOverlapBits_OnNonzero_AE82 +al 00AE80 .SetDefaultOverlapBits_OnNegative_AE80 +al 00AE88 .SetDefaultOverlapBits_OnCarrySet_AE88 +al 00AE72 .SetDefaultOverlapBits_OnCarrySet_AE72 +al 00AE63 .SetDefaultOverlapBits_OnCarrySet_AE63 +al 00AE53 .SetDefaultOverlapBits_OnNonzero_AE53 +al 00AE51 .SetDefaultOverlapBits_OnNonzero_AE51 +al 00AE35 .AnimationFrameCollisionBits +al 00AE45 .SetDefaultOverlapBits +al 00AE11 .ComputePlayerOverlapBits_OnNonzero_AE11 +al 00AE03 .ComputePlayerOverlapBits_OnNonzero_AE03 +al 00AE01 .ComputePlayerOverlapBits_OnCarrySet_AE01 +al 00AE56 .SetDefaultOverlapBits_OnCarryClear_AE56 +al 00AE16 .ComputePlayerOverlapBits_OnZero_AE16 +al 00AE0B .ComputePlayerOverlapBits_OnNegative_AE0B +al 00AE0F .ComputePlayerOverlapBits_JoinBranchPaths_AE0F +al 00AE15 .ComputePlayerOverlapBits_OnCarryClear_AE15 +al 00ADAF .ComputePlayerOverlapBits_OnNonzero_ADAF +al 00ADAD .ComputePlayerOverlapBits_OnNonnegative_ADAD +al 00ADB1 .ComputePlayerOverlapBits_OnCarryClear_ADB1 +al 00ADC2 .ComputePlayerOverlapBits_JoinBranchPaths_ADC2 +al 00AD8B .ComputePlayerOverlapBits_OnZero_AD8B +al 00AD73 .ComputePlayerOverlapBits_OnNonzero_AD73 +al 00AD71 .ComputePlayerOverlapBits_OnCarrySet_AD71 +al 00AD7A .ComputePlayerOverlapBits_JoinBranchPaths_AD7A +al 00AD84 .ComputePlayerOverlapBits_OnCarrySet_AD84 +al 00AD94 .ComputePlayerOverlapBits_JoinBranchPaths_AD94 +al 00AD91 .ComputePlayerOverlapBits_OnCarrySet_AD91 +al 00AD36 .ComputePlayerOverlapBits +al 00AD19 .ComputeCollisionBits +al 00AD01 .WriteCompressedVramBlocks_OnNonzero_AD01 +al 00ACF5 .WriteCompressedVramBlocks +al 00ACE5 .WithRenderingEnabled +al 00ACD7 .AdvanceCountWord +al 00ACC9 .AdvanceDestinationWord +al 00ACBD .VramRunFillValues +al 00ACB5 .AdvanceSourceByte_OnNonzero_ACB5 +al 00ACA1 .AdvanceSourceByte_OnZero_ACA1 +al 00ACA7 .WriteVramRunToken +al 00AC9E .AdvanceSourceByte_OnCarrySet_AC9E +al 00AC88 .AdvanceSourceByte +al 00AC96 .DecodeVramStreamToken +al 00AC82 .WriteCompressedVramStream +al 00AC78 .SetPpuAddressHighAnd40 +al 00AC62 .LoadAttributeStream +al 00AC56 .WriteAttributeBlock_OnNonzero_AC56 +al 00AC4C .WriteAttributeBlock +al 00AC43 .FillAttributeBlock +al 00AC3B .SetLevelVramStream +al 00AC35 .LevelVramWriterTable +al 00AC0D .SelectLevelVramWriter +al 00AC03 .ClearOamShadow_OnNonzero_AC03 +al 00ABFC .ClearOamShadow +al 00ABF7 .ShiftAccumulatorRight4 +al 00ABE4 .ApplyPpuScrollAndControl +al 00ABC4 .UploadPalette_OnCarryClear_ABC4 +al 00ABB1 .UploadPalette +al 00ABA8 .FillShadowOamBlock_OnNonnegative_ABA8 +al 00ABA3 .FillShadowOamBlock +al 00AB98 .LoadShadowOamBlock +al 00AB7D .CopyPaletteFromTable_OnNonnegative_AB7D +al 00AB68 .CopyPaletteFromTable +al 00AB14 .StandaloneBytecodeProgram_3 +al 00AB0B .ClearNametablePattern_OnNonzero_AB0B +al 00AAFF .ClearNametablePattern_OnNonzero_AAFF +al 00AAEF .ClearNametablePattern +al 00AADC .DisableRenderingAndClearNametables +al 00AACD .EnableRendering +al 00AACC .StoreControllerButtonBits_OnZero_AACC +al 00AAC0 .StoreControllerButtonBits_OnZero_AAC0 +al 00AAB8 .StoreControllerButtonBits +al 00AAAE .ReadControllerShiftRegister_OnCarryClear_AAAE +al 00AAB4 .ReadControllerShiftRegister_OnCarrySet_AAB4 +al 00AAA8 .ReadControllerShiftRegister_OnCarrySet_AAA8 +al 00AAA1 .ReadControllerShiftRegister_OnCarrySet_AAA1 +al 00AA9D .ReadControllerShiftRegister_OnCarrySet_AA9D +al 00AA98 .ReadControllerShiftRegister_OnZero_AA98 +al 00AA82 .ReadControllerShiftRegister_JoinBranchPaths_AA82 +al 00AA69 .ReadControllerShiftRegister_OnNonzero_AA69 +al 00AA63 .ReadControllerShiftRegister +al 00AA56 .ReadControllers +al 00AA55 .ToggleScrollRegionFlip_OnCarrySet_AA55 +al 00A9E9 .ToggleScrollRegionFlip_OnNonzero_A9E9 +al 00A9D8 .ToggleScrollRegionFlip +al 00A9C9 .UpdateObjectState_OnCarrySet_A9C9 +al 00A9FF .BuildObjectList +al 00A9EA .ToggleScrollRegionFlip_OnCarrySet_A9EA +al 00A9D6 .UpdateObjectState_OnNegative_A9D6 +al 00A9CD .UpdateObjectState_OnZero_A9CD +al 00A9AB .UpdateObjectState +al 00A9A4 .DecrementObjectCounter_OnZero_A9A4 +al 00A99E .DecrementObjectCounter +al 00A9AA .DecrementObjectCounter_JoinBranchPaths_A9AA +al 00A992 .UpdateObjectTimer +al 00A982 .UpdateObjectAnimation_OnCarryClear_A982 +al 00A991 .UpdateObjectAnimation_JoinBranchPaths_A991 +al 00A952 .UpdateObjectAnimation +al 00A949 .UpdateObjectAnimations +al 00A936 .TestObjectActive_OnNonzero_A936 +al 00A916 .TestObjectActive_OnNonnegative_A916 +al 00A8F9 .TestObjectActive_OnNonzero_A8F9 +al 00A8E9 .TestObjectActive +al 00A8D1 .AdvanceObjectFrame +al 00A884 .SetObjectFlags +al 00A89D .SetObjectFlags_OnCarryClear_A89D +al 00A862 .UpdateObjectSprite_OnZero_A862 +al 00A856 .UpdateObjectSprite_OnCarrySet_A856 +al 00A842 .UpdateObjectSprite_OnCarryClear_A842 +al 00A834 .UpdateObjectSprite +al 00A833 .ClearScrollLatchAlt_OnCarryClear_A833 +al 00A82F .ClearScrollLatchAlt +al 00A7E1 .CheckObjectScroll_OnNonzero_A7E1 +al 00A7FD .CheckObjectScroll_JoinBranchPaths_A7FD +al 00A7BF .CheckObjectScroll_OnNonnegative_A7BF +al 00A7B8 .CheckObjectScroll_OnZero_A7B8 +al 00A7E8 .CheckObjectScroll_OnNonzero_A7E8 +al 00A7CA .CheckObjectScroll_OnNegative_A7CA +al 00A800 .CheckObjectScroll_OnNonnegative_A800 +al 00A7B0 .CheckObjectScroll_OnNonzero_A7B0 +al 00A79F .CheckObjectScroll +al 00A79C .UpdateObjectCollisions_OnZero_A79C +al 00A77F .UpdateObjectCollisions_OnCarryClear_A77F +al 00A773 .UpdateObjectCollisions_OnCarryClear_A773 +al 00A78F .UpdateObjectCollisions_JoinBranchPaths_A78F +al 00A75D .UpdateObjectCollisions_OnNonzero_A75D +al 00A758 .UpdateObjectCollisions_OnNonzero_A758 +al 00A745 .UpdateObjectCollisions_OnNonzero_A745 +al 00A73D .UpdateObjectCollisions_OnNonzero_A73D +al 00A79B .UpdateObjectCollisions_OnZero_A79B +al 00A714 .UpdateObjectCollisions_OnNonzero_A714 +al 00A70D .UpdateObjectCollisions_OnNonzero_A70D +al 00A729 .UpdateObjectCollisions_OnCarryClear_A729 +al 00A728 .UpdateObjectCollisions_OnNonzero_A728 +al 00A6F8 .UpdateObjectCollisions +al 00A6DF .UpdateObjectListEntry_OnNonzero_A6DF +al 00A6EB .UpdateObjectListEntry_OnZero_A6EB +al 00A6BE .UpdateObjectListEntry_OnNegative_A6BE +al 00A6EF .UpdateObjectListEntry_OnZero_A6EF +al 00A695 .UpdateObjectListEntry +al 00A68E .UpdateObjectList +al 00A67F .SetSoundSequenceChannel4_OnZero_A67F +al 00A660 .SetSoundSequenceChannel4 +al 00A618 .StageDescriptorData +al 00A5F4 .StageDescriptorPointerTable +al 00A5DF .WriteNametableBytes_OnNonnegative_A5DF +al 00A5DD .WriteNametableBytes +al 00A52D .AdvanceObjectSlot_OnCarrySet_A52D +al 00A532 .AdvanceObjectSlot_OnCarryClear_A532 +al 00A583 .AdvanceObjectSlot_OnNegative_A583 +al 00A522 .AdvanceObjectSlot_OnNonzero_A522 +al 00A51B .AdvanceObjectSlot +al 00A512 .UpdateObjectSlots +al 00A508 .LookupObjectIndex +al 00A4FF .FlipObjectIndex +al 00A4F2 .SetSoundSequenceChannel2Alt +al 00A4F1 .TestSoundChannelState_OnNonzero_A4F1 +al 00A4DF .TestSoundChannelState +al 00A4C7 .LoadActorConfigBlock +al 00A4C2 .LoadActorFacingFlag_JoinBranchPaths_A4C2 +al 00A4BA .LoadActorFacingFlag_OnCarryClear_A4BA +al 00A4B5 .LoadActorFacingFlag_OnNonzero_A4B5 +al 00A4AA .LoadActorFacingFlag +al 00A49F .StoreActorConfigResultAlt +al 00A49B .LoadActorConfigAlt_OnZero_A49B +al 00A4A5 .StoreActorConfigResultAlt_OnZero_A4A5 +al 00A48D .LoadActorConfigAlt_OnZero_A48D +al 00A482 .LoadActorConfigAlt +al 00A46F .StoreActorConfigResult +al 00A46D .CompareActorConfigValue_OnNonzero_A46D +al 00A464 .CompareActorConfigValue_OnZero_A464 +al 00A459 .CompareActorConfigValue_OnZero_A459 +al 00A44E .CompareActorConfigValue_OnZero_A44E +al 00A475 .StoreActorConfigResult_JoinBranchPaths_A475 +al 00A435 .CompareActorConfigValue +al 00A428 .ReadActorConfigByte_OnCarrySet_A428 +al 00A430 .ReadActorConfigByte_JoinBranchPaths_A430 +al 00A423 .ReadActorConfigByte_OnNonzero_A423 +al 00A418 .ReadActorConfigByte_OnZero_A418 +al 00A40A .ReadActorConfigByte_OnCarrySet_A40A +al 00A40D .ReadActorConfigByte_OnNonzero_A40D +al 00A3E9 .ReadActorConfigByte_OnCarrySet_A3E9 +al 00A3F1 .ReadActorConfigByte_OnNonzero_A3F1 +al 00A3FA .ReadActorConfigByte_OnNonzero_A3FA +al 00A406 .ReadActorConfigByte_JoinBranchPaths_A406 +al 00A3C9 .ReadActorConfigByte_OnCarrySet_A3C9 +al 00A3A5 .ReadActorConfigByte_JoinBranchPaths_A3A5 +al 00A3B1 .ReadActorConfigByte_OnNonzero_A3B1 +al 00A388 .ReadActorConfigByte_JoinBranchPaths_A388 +al 00A338 .ReadActorConfigByte +al 00A32C .StoreActorControlByte +al 00A316 .StoreActorPaletteByte +al 00A305 .LoadActorConfigFields_OnZero_A305 +al 00A2F1 .LoadActorConfigFields_OnNonzero_A2F1 +al 00A2EB .LoadActorConfigFields_OnNegative_A2EB +al 00A30B .LoadActorConfigFields_OnNonzero_A30B +al 00A334 .StoreActorControlByte_OnZero_A334 +al 00A32A .StoreActorPaletteByte_OnZero_A32A +al 00A2D8 .LoadActorConfigFields_OnZero_A2D8 +al 00A2C9 .LoadActorConfigFields +al 00A2BD .CompareConfigValue_JoinBranchPaths_A2BD +al 00A2C8 .ReturnFromConfigLoad +al 00A298 .CompareConfigValue +al 00A28D .LoadActorConfigRecord_JoinBranchPaths_A28D +al 00A270 .LoadActorConfigRecord +al 00A261 .CopyConfigBytes_OnNonnegative_A261 +al 00A25F .CopyConfigBytes +al 00A253 .ComputeActorConfigOffset +al 00A250 .LoadActorConfigByte +al 00A246 .RunActorScript_OnZero_A246 +al 00A201 .RunActorScript_OnNonzero_A201 +al 00A1F1 .RunActorScript_OnNonnegative_A1F1 +al 00A1E3 .RunActorScript_OnNonnegative_A1E3 +al 00A1C3 .RunActorScript_OnZero_A1C3 +al 00A1A5 .RunActorScript_OnCarrySet_A1A5 +al 00A17F .RunActorScript +al 00A179 .ResetBytecodePointers_OnCarryClear_A179 +al 00A165 .ResetBytecodePointers_OnNonzero_A165 +al 00A15D .ResetBytecodePointers +al 00A157 .ComputeActorTileRow_JoinBranchPaths_A157 +al 00A14F .ComputeActorTileRow_OnNonnegative_A14F +al 00A12E .ComputeActorTileRow +al 00A122 .ResetBytecodeStateAlt_OnCarryClear_A122 +al 00A105 .ResetBytecodeStateAlt_OnNonzero_A105 +al 00A0FB .ResetBytecodeStateAlt +al 00A0F4 .AdvanceBytecodeProgram +al 00A0EC .ResetBytecodeAccumulatorAlt_OnCarryClear_A0EC +al 00A0CE .ResetBytecodeAccumulatorAlt_OnNonzero_A0CE +al 00A0C6 .ResetBytecodeAccumulatorAlt +al 00A0C2 .ResetBytecodeAccumulator_OnCarryClear_A0C2 +al 00A0AD .ResetBytecodeAccumulator_OnNonzero_A0AD +al 00A0A5 .ResetBytecodeAccumulator +al 00A09F .ComputeBytecodeOffset_OnCarryClear_A09F +al 00A08B .ComputeBytecodeOffset_OnNonzero_A08B +al 00A085 .ComputeBytecodeOffset +al 00A07B .ProcessBytecodeOpcode_JoinBranchPaths_A07B +al 00A060 .ProcessBytecodeOpcode_OnCarrySet_A060 +al 00A062 .ProcessBytecodeOpcode_JoinBranchPaths_A062 +al 00A01D .ProcessBytecodeOpcode +al 00A012 .SubtractFromNametableValue_Return_A012 +al 009FFA .AddToNametableValue_JumpNext_9FFA +al 009FEF .AddToNametableValue_Return_9FEF +al 009FD7 .MoveActorByOpcode_Continue_9FD7 +al 009FD0 .MoveActorByOpcode_Continue_9FD0 +al 009FC9 .MoveActorByOpcode_Continue_9FC9 +al 00A002 .SubtractFromNametableValue +al 009FC2 .MoveActorByOpcode_Continue_9FC2 +al 009FDF .AddToNametableValue +al 009FBB .MoveActorByOpcode_Return_9FBB +al 009FB8 .MoveActorByOpcode_OnNonzero_9FB8 +al 009FAC .MoveActorByOpcode_OnCarryClear_9FAC +al 009FBA .MoveActorByOpcode_JoinBranchPaths_9FBA +al 009F83 .MoveActorByOpcode_JoinBranchPaths_9F83 +al 009F7F .MoveActorByOpcode_JoinBranchPaths_9F7F +al 009F54 .MoveActorByOpcode +al 009F4B .UpdateActorMovement +al 009F2B .SecondaryBytecodeHandlerTable +al 009F2A .FlushNametableWrite_JoinBranchPaths_9F2A +al 009F14 .FlushNametableWrite +al 009EF4 .OamShadowTemplate +al 009E89 .QueueNametableWrite_OnNonnegative_9E89 +al 009E87 .QueueNametableWrite_OnNonzero_9E87 +al 009E7F .QueueNametableWrite +al 009E6E .UpdateActorFacing +al 009E6B .LoadActorTileIndex_OnNonzero_9E6B +al 009E69 .LoadActorTileIndex_OnCarryClear_9E69 +al 009E65 .LoadActorTileIndex_OnCarryClear_9E65 +al 009E50 .LoadActorTileIndex_OnNonzero_9E50 +al 009E4B .LoadActorTileIndex_OnZero_9E4B +al 009E37 .LoadActorTileIndex_OnNonzero_9E37 +al 009DD6 .SetActorBounds +al 009DD4 .CopyActorCoordinates_OnCarryClear_9DD4 +al 009DD0 .CopyActorCoordinates_OnCarryClear_9DD0 +al 009DBB .CopyActorCoordinates_OnNonzero_9DBB +al 009DB6 .CopyActorCoordinates_OnZero_9DB6 +al 009E19 .LoadActorTileIndex_OnZero_9E19 +al 009DA2 .CopyActorCoordinates_OnNonzero_9DA2 +al 009DE6 .LoadActorTileIndex +al 009E02 .LoadActorTileIndex_OnCarrySet_9E02 +al 009D61 .CopyActorCoordinates_OnCarryClear_9D61 +al 009D39 .ResetBytecodeState_OnZero_9D39 +al 009D4A .ResetBytecodeState_OnZero_9D4A +al 009D10 .ResetBytecodeState_OnNonzero_9D10 +al 009D04 .ResetBytecodeState_OnNonnegative_9D04 +al 009CE5 .ResetBytecodeState_OnCarryClear_9CE5 +al 009D4E .CopyActorCoordinates +al 009CDB .ResetBytecodeState_OnCarryClear_9CDB +al 009D0D .ResetBytecodeState_OnCarrySet_9D0D +al 009CBB .ResetBytecodeState +al 009CAD .RunBytecodeProgram_Return_9CAD +al 009C8D .RunBytecodeProgram_OnCarryClear_9C8D +al 009C91 .RunBytecodeProgram_JoinBranchPaths_9C91 +al 009C84 .RunBytecodeProgram_OnNonzero_9C84 +al 009C73 .RunBytecodeProgram_JoinBranchPaths_9C73 +al 009C66 .RunBytecodeProgram_OnCarryClear_9C66 +al 009C71 .RunBytecodeProgram_OnZero_9C71 +al 009C52 .RunBytecodeProgram_OnNonnegative_9C52 +al 009C4C .RunBytecodeProgram_OnNonnegative_9C4C +al 009C2E .RunBytecodeProgram_OnNonnegative_9C2E +al 009C2C .RunBytecodeProgram_OnZero_9C2C +al 009BDD .RunBytecodeProgram_OnNonzero_9BDD +al 009BD9 .RunBytecodeProgram_OnNonzero_9BD9 +al 009BB4 .RunBytecodeProgram_OnNonzero_9BB4 +al 009BB0 .RunBytecodeProgram_OnNonzero_9BB0 +al 009BF3 .RunBytecodeProgram_OnCarryClear_9BF3 +al 009BA1 .RunBytecodeProgram_OnZero_9BA1 +al 009B72 .RunBytecodeProgram_OnNonnegative_9B72 +al 009B64 .RunBytecodeProgram_OnNonnegative_9B64 +al 009B4C .RunBytecodeProgram_OnNonnegative_9B4C +al 009B25 .RunBytecodeProgram +al 009B18 .DispatchThroughPointer_OnNonzero_9B18 +al 009B05 .DispatchThroughPointer +al 009B08 .DispatchThroughPointer_JoinBranchPaths_9B08 +al 009AE8 .RunBytecodeInterpreter +al 009ACE .SpawnActorPairAlt_OnNonzero_9ACE +al 009AD3 .SpawnActorPairAlt_JoinBranchPaths_9AD3 +al 009ABC .SpawnActorPairAlt_OnNonzero_9ABC +al 009AD8 .SpawnActorPairAlt_OnNonzero_9AD8 +al 009A6B .SpawnActorPairAlt +al 009A4E .SpawnActorPair +al 009A3F .FlipActorFacing +al 009A2E .StoreActorCoordinatesAlt +al 009A36 .StoreActorCoordinatesAlt_OnNonnegative_9A36 +al 009A24 .StoreActorCoordinates +al 009A02 .LookupActorTileIdAlt_OnCarryClear_9A02 +al 0099E4 .LookupActorTileIdAlt +al 0099E2 .LookupActorTileId +al 0099D7 .SetSoundSequenceChannel2_OnNegative_99D7 +al 0099B7 .SetSoundSequenceChannel2_JumpNext_99B7 +al 0099B0 .SetSoundSequenceChannel2_Return_99B0 +al 0099A3 .SetSoundSequenceChannel2 +al 0099A0 .UpdateActorTileFromIndexAlt_OnNonzero_99A0 +al 009994 .UpdateActorTileFromIndexAlt_OnNonzero_9994 +al 009989 .UpdateActorTileFromIndexAlt_OnNonzero_9989 +al 00997C .UpdateActorTileFromIndexAlt_JumpNext_997C +al 00996E .UpdateActorTileFromIndexAlt_JumpNext_996E +al 00994B .UpdateActorTileFromIndexAlt_JumpNext_994B +al 009918 .UpdateActorTileFromIndexAlt +al 009911 .UpdateActorTileFromIndex +al 009948 .UpdateActorTileFromIndexAlt_JoinBranchPaths_9948 +al 0098E6 .ComputeActorLeftEdgeAlt2 +al 0098D8 .TestActorValue_OnCarryClear_98D8 +al 009903 .ComputeActorLeftEdgeAlt2_OnCarryClear_9903 +al 0098F0 .ComputeActorLeftEdgeAlt2_OnNonzero_98F0 +al 0098BE .TestActorValue_JoinBranchPaths_98BE +al 0098C1 .TestActorValue_OnNonzero_98C1 +al 0098B7 .TestActorValue_OnNonzero_98B7 +al 0098B0 .TestActorValue_JumpNext_98B0 +al 0098A7 .TestActorValue_OnCarryClear_98A7 +al 0098AD .TestActorValue_JoinBranchPaths_98AD +al 0098AA .TestActorValue_JoinBranchPaths_98AA +al 009875 .TestActorValue_OnCarryClear_9875 +al 00986A .TestActorValue_Return_986A +al 00985F .TestActorValue +al 009858 .ComputeActorRightEdgeAt +al 00982A .ComputeActorLeftEdgeAt +al 00981C .TestAnimationSlot_OnCarryClear_981C +al 00984A .ComputeActorLeftEdgeAt_OnCarryClear_984A +al 009834 .ComputeActorLeftEdgeAt_OnNonzero_9834 +al 009800 .TestAnimationSlot_JoinBranchPaths_9800 +al 009802 .TestAnimationSlot_OnNonzero_9802 +al 0097FC .TestAnimationSlot +al 0097FB .UpdateActorAnimation_OnZero_97FB +al 0097D5 .UpdateActorAnimation +al 0097C6 .SetActorAnimation61_OnNonzero_97C6 +al 0097BC .SetActorAnimation63 +al 0097C4 .SetActorAnimation61 +al 0097C0 .SetActorAnimation62 +al 0097A0 .MoveActorByStep_OnNonzero_97A0 +al 00979A .MoveActorByStep_OnNonzero_979A +al 009766 .MoveActorByStep_OnCarryClear_9766 +al 00975E .MoveActorByStep_Return_975E +al 00975D .MoveActorByStep_OnCarrySet_975D +al 009732 .MoveActorByStep +al 009731 .TestActorRange_OnCarrySet_9731 +al 009729 .TestActorRange +al 009722 .ComputeActorRightEdgeAlt +al 0096F7 .ComputeActorLeftEdgeAlt +al 0096EE .TestActorCollisionFlag_OnCarryClear_96EE +al 009719 .ComputeActorLeftEdgeAlt_OnCarryClear_9719 +al 009701 .ComputeActorLeftEdgeAlt_OnNonzero_9701 +al 0096CC .TestActorCollisionFlag_OnZero_96CC +al 0096CE .TestActorCollisionFlag_OnZero_96CE +al 0096C8 .TestActorCollisionFlag +al 0096C2 .SetActorTileValue_Continue_96C2 +al 0096BC .SetActorTileValue_JumpNext_96BC +al 0096B3 .SetActorTileValue_OnNonzero_96B3 +al 0096AA .SetActorTileValue +al 0096B9 .SetActorTileValue_OnNegative_96B9 +al 00969D .StoreActorTile_OnNonzero_969D +al 00969E .AdvanceActorCounter +al 0096A6 .AdvanceActorCounter_OnCarryClear_96A6 +al 00968E .StoreActorTile_OnNonnegative_968E +al 009679 .StoreActorTile_OnNegative_9679 +al 00966D .StoreActorTile_Return_966D +al 009667 .StoreActorTile +al 009664 .SetActorTileFromPalette_OnNonzero_9664 +al 009653 .SetActorTileFromPalette +al 009644 .CompareActorToLimit_JumpNext_9644 +al 00963E .CompareActorToLimit_OnNonnegative_963E +al 00963C .CompareActorToLimit_OnCarrySet_963C +al 009641 .CompareActorToLimit_OnZero_9641 +al 009628 .CompareActorToLimit_OnCarrySet_9628 +al 0095E3 .CompareActorToLimit_OnNonzero_95E3 +al 0095DC .CompareActorToLimit_Return_95DC +al 0095D9 .CompareActorToLimit +al 0095D2 .ComputeActorRightEdge +al 0095AE .ComputeActorLeftEdge +al 0095A5 .UpdateActorState_OnCarryClear_95A5 +al 0095C9 .ComputeActorLeftEdge_OnCarryClear_95C9 +al 0095B8 .ComputeActorLeftEdge_OnNonzero_95B8 +al 009590 .UpdateActorState_OnNonzero_9590 +al 009585 .UpdateActorState +al 009559 .SetActorFlag_JumpNext_9559 +al 009551 .SetActorFlag_OnNonzero_9551 +al 009541 .SetActorFlag_Return_9541 +al 009535 .SetActorFlag_OnNonzero_9535 +al 009522 .SetActorFlag_JumpNext_9522 +al 00951F .SetActorFlag_OnNonzero_951F +al 009513 .SetActorFlag_JumpNext_9513 +al 00950B .SetActorFlag_JumpNext_950B +al 0094FE .SetActorFlag +al 0094F6 .ClearActorFields_OnNonzero_94F6 +al 0094F3 .ClearActorFields_JoinBranchPaths_94F3 +al 0094D7 .ClearActorFields +al 0094CF .ClearActorPosition +al 0094C8 .SelectActorSlotAlt +al 0094C7 .SelectActorSlot +al 0094C0 .TestPlayerFacing_JumpNext_94C0 +al 0094B1 .TestPlayerFacing +al 0094AD .UpdateActorTileAlt_JumpNext_94AD +al 009499 .UpdateActorTileAlt_JumpNext_9499 +al 0094AA .UpdateActorTileAlt_OnZero_94AA +al 00948F .UpdateActorTileAlt_JumpNext_948F +al 009480 .UpdateActorTileAlt_JumpNext_9480 +al 00947D .UpdateActorTileAlt_OnZero_947D +al 009477 .UpdateActorTileAlt_JumpNext_9477 +al 00946D .UpdateActorTileAlt_JumpNext_946D +al 009465 .UpdateActorTileAlt_JumpNext_9465 +al 00945B .UpdateActorTileAlt_OnNegative_945B +al 009450 .UpdateActorTileAlt_OnNonzero_9450 +al 009451 .UpdateActorTileAlt_OnCarrySet_9451 +al 009454 .UpdateActorTileAlt_OnCarryClear_9454 +al 009441 .UpdateActorTileAlt_OnNonnegative_9441 +al 00942C .UpdateActorTileAlt_OnNegative_942C +al 00941B .UpdateActorTileAlt_JumpNext_941B +al 009409 .UpdateActorTileAlt_JumpNext_9409 +al 009401 .UpdateActorTileAlt_OnCarrySet_9401 +al 0093D3 .UpdateActorTileAlt_OnNonzero_93D3 +al 0093CC .UpdateActorTileAlt_JumpNext_93CC +al 0093C4 .UpdateActorTileAlt_OnCarrySet_93C4 +al 0093D0 .UpdateActorTileAlt_OnZero_93D0 +al 0093A4 .UpdateActorTileAlt_JumpNext_93A4 +al 00937C .UpdateActorTileAlt_JumpNext_937C +al 009374 .UpdateActorTileAlt +al 009371 .UpdateActorTile +al 009354 .UpdateActorX_JumpNext_9354 +al 00934B .UpdateActorX +al 00932C .QueueVramDescriptor_JumpNext_932C +al 0092E8 .QueueVramDescriptor_OnZero_92E8 +al 0092CD .QueueVramDescriptor_JumpNext_92CD +al 009329 .QueueVramDescriptor_OnZero_9329 +al 0092B2 .QueueVramDescriptor_JumpNext_92B2 +al 0092AF .QueueVramDescriptor_OnNonzero_92AF +al 00929F .QueueVramDescriptor_OnNonzero_929F +al 009293 .QueueVramDescriptor_JumpNext_9293 +al 00928D .QueueVramDescriptor_JumpNext_928D +al 009287 .QueueVramDescriptor_Entry_9287 +al 009237 .BytecodeHandlerTable +al 009232 .BytecodeProgram_25 +al 00922F .BytecodeProgram_24 +al 00922C .BytecodeProgram_23 +al 0091EC .BytecodeProgram_22 +al 0091E0 .BytecodeProgram_21 +al 00918B .BytecodeProgram_20 +al 009175 .BytecodeProgram_1F +al 009141 .BytecodeProgram_1E +al 009136 .BytecodeProgram_1D +al 009131 .BytecodeProgram_1C +al 009119 .BytecodeProgram_1B +al 0090DE .BytecodeProgram_1A +al 0090D7 .BytecodeProgram_19 +al 0090CA .BytecodeProgram_18 +al 0090B9 .BytecodeProgram_17 +al 0090A6 .BytecodeProgram_16 +al 009081 .BytecodeProgram_15 +al 00907D .BytecodeProgram_14 +al 009071 .BytecodeProgram_13 +al 009008 .BytecodeProgram_12 +al 008FFD .BytecodeProgram_11 +al 008F94 .BytecodeProgram_10 +al 008F71 .BytecodeProgram_0F +al 008F48 .BytecodeProgram_0E +al 008F20 .BytecodeProgram_0D +al 008F1A .BytecodeProgram_0C +al 008EF4 .BytecodeProgram_0B +al 008EA9 .BytecodeProgram_0A +al 008E79 .BytecodeProgram_09 +al 008E2D .BytecodeProgram_08 +al 008DE2 .BytecodeProgram_07 +al 008DB6 .BytecodeProgram_06 +al 008D9F .BytecodeProgram_05 +al 008D96 .BytecodeProgram_04 +al 008D8D .BytecodeProgram_03 +al 008D5C .BytecodeProgram_02 +al 008D40 .BytecodeProgram_01 +al 008D3B .BytecodeProgram_00 +al 008CEF .BytecodeProgramPointerTable +al 008CB8 .QueueVramDescriptor +al 008C98 .ExecuteVramTransfer_OnZero_8C98 +al 008C72 .ExecuteVramTransfer_OnNonzero_8C72 +al 008C65 .ExecuteVramTransfer +al 008C55 .QueueVramTransferAlt_OnNonzero_8C55 +al 008C3A .QueueVramTransferAlt_OnNonnegative_8C3A +al 008C11 .QueueVramTransferAlt +al 008C0E .QueueVramTransfer +al 008C05 .AdvanceAnimationSlot +al 008BFF .SetRenderingOn_OnNonnegative_8BFF +al 008BF8 .SetRenderingOn +al 008BEF .RenderHudDigitDescriptor +al 008BBA .RenderHudDigits_OnNonzero_8BBA +al 008B92 .RenderHudDigits +al 008B7D .AttributeBlockDeltaTable +al 008B6D .ClearAttributeRegion_JoinBranchPaths_8B6D +al 008B67 .ClearAttributeRegion_OnZero_8B67 +al 008B5F .ClearAttributeRegion_OnCarryClear_8B5F +al 008B3B .ClearAttributeRegion_OnNonnegative_8B3B +al 008B33 .ClearAttributeRegion +al 008B37 .ClearAttributeRegion_JoinBranchPaths_8B37 +al 008B20 .WriteNametableTile +al 008B25 .WriteNametableTile_OnNonzero_8B25 +al 008B0D .ClearScrollLatch_OnNonzero_8B0D +al 008B07 .ClearScrollLatch +al 008AE8 .UpdateAttributeTable +al 008AE1 .SpawnStageActors_JoinBranchPaths_8AE1 +al 008AA4 .SpawnStageActors_JoinBranchPaths_8AA4 +al 008A93 .SpawnStageActors_OnZero_8A93 +al 008A84 .SpawnStageActors_OnNonzero_8A84 +al 008A74 .SpawnStageActors_OnZero_8A74 +al 008A68 .SpawnStageActors_OnCarryClear_8A68 +al 008AA5 .SpawnStageActors_OnZero_8AA5 +al 008A5E .SpawnStageActors +al 008A5D .UpdateStageActors_JoinBranchPaths_8A5D +al 008A28 .UpdateStageActors +al 008A1E .StandaloneBytecodeProgram_2 +al 0089F7 .ReadControllerAndInit_OnNonzero_89F7 +al 0089EE .ReadControllerAndInit_OnCarryClear_89EE +al 0089CE .ReadControllerAndInit +al 0089B2 .CompactOamList_OnNonzero_89B2 +al 0089B8 .CompactOamList_OnNonzero_89B8 +al 0089B5 .CompactOamList_OnNonzero_89B5 +al 00899F .CompactOamList_OnNonzero_899F +al 00899D .CompactOamList_OnZero_899D +al 0089AC .CompactOamList_OnZero_89AC +al 0089B0 .CompactOamList_OnCarryClear_89B0 +al 0089A8 .CompactOamList_OnZero_89A8 +al 00898A .CompactOamList_OnNonnegative_898A +al 008986 .CompactOamList +al 00897F .FindFreeOamSlot_OnNonzero_897F +al 00896B .FindFreeOamSlot_OnZero_896B +al 00896A .FindFreeOamSlot_JoinBranchPaths_896A +al 008942 .FindFreeOamSlot_OnZero_8942 +al 008938 .FindFreeOamSlot_OnNonnegative_8938 +al 008936 .FindFreeOamSlot +al 00892A .EmitOamAtOffset_OnNonzero_892A +al 008943 .FindFreeOamSlot_JoinBranchPaths_8943 +al 00891B .EmitOamAtOffset_OnZero_891B +al 008909 .EmitOamAtOffset_OnZero_8909 +al 0088F9 .EmitOamFromTable +al 0088F4 .EmitOamBlankEntry_OnZero_88F4 +al 0088EB .EmitOamBlankEntry +al 0088FF .EmitOamAtOffset +al 00890F .EmitOamAtOffset_JoinBranchPaths_890F +al 0088F3 .EmitOamBlankEntry_JoinBranchPaths_88F3 +al 0088B0 .EmitOamEntry +al 0088AE .BuildOamList_OnNonzero_88AE +al 0088A4 .BuildOamList +al 00889D .PollControllerAndCheckRound_OnNonzero_889D +al 008899 .PollControllerAndCheckRound_OnCarrySet_8899 +al 00888D .PollControllerAndCheckRound_OnZero_888D +al 008882 .PollControllerAndCheckRound +al 008881 .SignalVblankComplete_JoinBranchPaths_8881 +al 00886C .PollControllerBitsAlt +al 00885B .PollControllerAndAdvance +al 00887C .SignalVblankComplete +al 00885A .PollControllerBits_JoinBranchPaths_885A +al 008848 .PollControllerBits +al 008837 .PlayDeathSequence +al 00881F .StandaloneBytecodeProgram_1 +al 008803 .UpdateFlashCounter_OnNonzero_8803 +al 008801 .UpdateFlashCounter_OnZero_8801 +al 008819 .UpdateFlashCounter_OnCarryClear_8819 +al 0087F2 .UpdateFlashCounter +al 0087D1 .PollControllerStart +al 0087F1 .PollControllerStart_JoinBranchPaths_87F1 +al 0087BF .UpdateTimersAlt +al 008795 .RunGameStateDispatcher_OnNonzero_8795 +al 008787 .RunGameStateDispatcher_JoinBranchPaths_8787 +al 00877C .RunGameStateDispatcher +al 008765 .SetSoundSequenceChannel1 +al 008764 .IrqHandler +al 008759 .FinishNmiRegisters +al 008751 .FinishNmiUpdates +al 008742 .NmiHandler_OnNonzero_8742 +al 008728 .NmiHandler_OnCarrySet_8728 +al 00872F .NmiHandler_OnNonzero_872F +al 008703 .NmiHandler_OnNegative_8703 +al 008709 .NmiHandler_OnZero_8709 +al 0086FA .NmiHandler_OnZero_86FA +al 0086E3 .NmiHandler_OnNonzero_86E3 +al 0086D8 .NmiHandler_OnZero_86D8 +al 0086CB .NmiHandler +al 0086AD .UpdateRoundLogic_OnNegative_86AD +al 0086AA .UpdateRoundLogic_JoinBranchPaths_86AA +al 0086A0 .UpdateRoundLogic_JoinBranchPaths_86A0 +al 008682 .UpdateRoundLogic_OnNonzero_8682 +al 00865D .UpdateRoundLogic +al 008653 .SetRenderingOffAndSignalVblank +al 008644 .ForceRenderingOff +al 008639 .BeginVblankFrame +al 0085ED .StandaloneBytecodeProgram +al 0085DA .UpdateScrollTargetAlt_OnNonzero_85DA +al 0085A8 .UpdateScrollTargetAlt_OnNonzero_85A8 +al 0085EC .UpdateScrollTargetAlt_JoinBranchPaths_85EC +al 0085A3 .UpdateScrollTargetAlt_OnZero_85A3 +al 008598 .UpdateScrollTargetAlt +al 008596 .UpdateScrollTarget +al 00858F .PlayRoundChangeMusic_OnNonzero_858F +al 00856C .PlayRoundChangeMusic +al 008564 .UpdateRoundTimers_OnZero_8564 +al 008522 .UpdateRoundTimers_OnCarrySet_8522 +al 00851C .UpdateRoundTimers_OnCarrySet_851C +al 00850F .UpdateRoundTimers_OnZero_850F +al 0084F4 .UpdateRoundTimers_OnCarryClear_84F4 +al 0084EE .UpdateRoundTimers_OnNonzero_84EE +al 0084E9 .UpdateRoundTimers_OnCarrySet_84E9 +al 0084B5 .UpdateRoundTimers_OnNonzero_84B5 +al 0084B1 .UpdateRoundTimers_OnNonzero_84B1 +al 00851F .UpdateRoundTimers_OnNonzero_851F +al 0084A1 .UpdateRoundTimers_OnZero_84A1 +al 00848D .UpdateRoundTimers_OnNonzero_848D +al 00845C .UpdateRoundTimers +al 00841A .UpdateActorPositions_OnZero_841A +al 008434 .UpdateActorPositions_OnNonzero_8434 +al 0083E1 .UpdateActorPositions_OnCarryClear_83E1 +al 0083D0 .UpdateActorPositions_OnZero_83D0 +al 0083AB .UpdateActorPositions_OnNonnegative_83AB +al 0083A7 .UpdateActorPositions +al 00839B .LoadOamShadowFromTable_OnNonnegative_839B +al 008399 .LoadOamShadowFromTable +al 008390 .WriteScoreTallyDigits_OnNonzero_8390 +al 008385 .WriteScoreTallyDigits_OnZero_8385 +al 008374 .WriteScoreTallyDigits_OnCarryClear_8374 +al 008372 .WriteScoreTallyDigits +al 008353 .UpdateScoreTallyDigits +al 008352 .UpdateHudTallyTiles_OnZero_8352 +al 00833E .UpdateHudTallyTiles_OnZero_833E +al 00832A .UpdateHudTallyTiles +al 0082FF .StartMusicSequence +al 0082FA .StartIntroMusic +al 0082ED .SilenceSoundChannel3 +al 0082E1 .SilenceSoundChannels1And3 +al 0082DA .DivideBy20_OnCarryClear_82DA +al 0082BE .DivideBy20_OnNonzero_82BE +al 0082AC .DivideBy20 +al 008298 .MainGameLoop_OnNonzero_8298 +al 00828C .MainGameLoop_OnNonzero_828C +al 008284 .MainGameLoop_OnZero_8284 +al 00829E .MainGameLoop_OnNonnegative_829E +al 008261 .MainGameLoop_OnNonzero_8261 +al 008255 .MainGameLoop_OnNonzero_8255 +al 00824D .MainGameLoop_OnZero_824D +al 008267 .MainGameLoop_OnNonnegative_8267 +al 008232 .MainGameLoop_OnZero_8232 +al 008235 .MainGameLoop_OnZero_8235 +al 008226 .MainGameLoop +al 008223 .InitializeRound_OnNonzero_8223 +al 0081E2 .InitializeRound_JoinBranchPaths_81E2 +al 0081E0 .InitializeRound_OnCarryClear_81E0 +al 0081D6 .InitializeRound_OnCarryClear_81D6 +al 0081DE .InitializeRound_OnCarryClear_81DE +al 0081DA .InitializeRound_OnCarryClear_81DA +al 0081A0 .InitializeRound_OnNonzero_81A0 +al 008196 .InitializeRound_OnNonnegative_8196 +al 008191 .InitializeRound_OnNonzero_8191 +al 008187 .InitializeRound_OnNonnegative_8187 +al 008173 .InitializeRound_OnCarryClear_8173 +al 008154 .UpdateFadeFlashSprites_OnCarryClear_8154 +al 008132 .UpdateFadeFlashSprites +al 00811A .StartStageSequence_OnZero_811A +al 00810A .StartStageSequence_OnNonzero_810A +al 008105 .StartStageSequence_OnNonzero_8105 +al 008164 .InitializeRound +al 0080E0 .StartStageSequence_OnZero_80E0 +al 0080AC .StartStageSequence +al 008094 .UpdateNametableFromStream_OnZero_8094 +al 008077 .UpdateNametableFromStream_OnZero_8077 +al 00807A .UpdateNametableFromStream_OnZero_807A +al 008066 .UpdateNametableFromStream_OnZero_8066 +al 00805B .UpdateNametableFromStream_OnNonzero_805B +al 00806E .UpdateNametableFromStream_OnNonnegative_806E +al 008080 .UpdateNametableFromStream_OnZero_8080 +al 008052 .UpdateNametableFromStream +al 00803B .InitializeGameState_OnNonzero_803B +al 00802C .InitializeGameState +al 008019 .WaitForSecondPpuWarmup +al 00800E .WaitForFirstPpuWarmup +al 008000 .Reset diff --git a/_wip/MUSCLE (U)/copilot/reconstructed.map b/_wip/MUSCLE (U)/copilot/reconstructed.map index aaf7f17..aed4a2a 100644 --- a/_wip/MUSCLE (U)/copilot/reconstructed.map +++ b/_wip/MUSCLE (U)/copilot/reconstructed.map @@ -1,14 +1,20 @@ Modules list: ------------- +header.o: + HEADER Offs=000000 Size=000010 Align=00001 Fill=0000 prg.o: PRG Offs=000000 Size=004000 Align=00001 Fill=0000 +chr.o: + CHR Offs=000000 Size=002000 Align=00001 Fill=0000 Segment list: ------------- Name Start End Size Align ---------------------------------------------------- -PRG 00C000 00FFFF 004000 00001 +CHR 000000 001FFF 002000 00001 +HEADER 000000 00000F 000010 00001 +PRG 008000 00BFFF 004000 00001 Exports list by name: diff --git a/_wip/MUSCLE (U)/copilot/reconstructed_prg.bin b/_wip/MUSCLE (U)/copilot/reconstructed.nes similarity index 64% rename from _wip/MUSCLE (U)/copilot/reconstructed_prg.bin rename to _wip/MUSCLE (U)/copilot/reconstructed.nes index 99ef18d0c5a6f65321526aaa8ec00664426c2286..1a7346df27a35bee86dd028816f158c5b153bb11 100644 GIT binary patch delta 8282 zcmbtZTWlQHc|OBg?vM)2U0p1%Vw$tEB`ESkw2ta}39WZFa$3u&5vj2i6e(a64Im4t z(9&>IZIsoXVVIbDC?X;X5bMRH0RuJEpmpBzAd91{uu?5S3~E#e+Eg4zs^|iSxHjE# z7!K$3`_9aelzTyo{I>Q#*Z+3@%b7#hH6}bG|CQf+?z4trh!m!3G9%*uEJw;941;7! zB@lNl%M!vcO!SnEW)wxj4}vhB&18CdEYr$8xV(5=kCZK;LJ+tdsCb3`b^T5dj0n@R z%ryz5u*OC`-xs3XXgUQfR2|P1QYn$EHl20b(X;{m@lejOaul({ZYHz;yHO{MmY3f- zxkefjuIG6cM{>3;`fWRhrr#RR+1EX9uu`A!gv5vt1C?^Q%tn{i6pg+v0~+P*g_Vfo z04k(ZnCOfFcC~;CreR;GD3bkRB&^!@Kwh{4dij`0z~P2Q(y@ibu9AW>K~n4wBlMwo zh6A?am@t)%X0=cBYzFI#3u^I0&LvRCaS`IK?<*-CP|Jg>W=wNIZ{gTE%f#7vIDmEX z3$B+j`ZYZ>9F&&l`!>43`1`?iDjV~gHs*Qjl`d!oA!Uv)6;WcXYcMU`TWK+ z|I}=%Lb=h1e6L3R>Hp`6^5p^|V6f5*>m_s=&FTOo6+QWUaw^$u7AI@LC=bEHMS<{o zb!KL6ZZQdb_^M&#Y-(Mt;_Lt`D(JlY*y^cP;2hZRIG|fB7BaF68sD6qTVAPD1f0%s zUX;qiq=qh}79RS_^73LjCPb~~c`mxK$?4Z4K@f@jG9U>0ayx(L@twP1l0vaqa}lO< zvp3JzJ0sjNoEN7-PfpIOm>%>Wsl?43#9qEK>Jk%>P@LS@#Zh40cVCa!>5g=4s$p#} z6}38!Q?(Jh1;o%Qy&wJB0&!6nVv+pD!Kg>VF<{~a zoZu4=BpYB4o{)Sh*?>KZS}B;6%X_4J>G<&{o_Ij>#E%YgT|4NDj3z)DRY4L>h^jQ2 zQtbO3+3EN`V)euM`PtcNCJHJ`%*+NY2bmXwAkGV%1L#ytjZt+hCM}K06s}ywQLwR^ z%Au=H<=BWRozozs#@fbQO{ytos#D90^RvJ%r3ivDyqzEhac*%=1IE5V9xlQZGDuRS z-6)X8=)=sDvnVzQX%rhCAI{1LhD$Kr;Ebav_BUV*!~nZs0qmHkU?>T?^f9fZ{S@v^L!%kV8& z6Bqz``yc^`)f*Uu*fclJ$sq%<@EW@42{EPKX80zQzB6+r2jfwL&bQcgCi;8^j$)|LL4 z5N895M7VkY@I$wb=O7Qj&S^_D8+9l^2;y|IuGqljxpgMbWU}2AR4v``KcnFz4gBt~u(3rFEwj0E*tJH0;bqRMO zon0w_iM+WdXMbL@QN(SNm4p+-hM^S85UT}iIKaBVD1wr4_ET!&K$FXXug?&0P3X-t zZh3dt0D}cJcV_1L^=nsZ5P@(iNoc3?U;M^5{<5ij>2nK{LX2x=#2+Imy36BkwLGK? z4H;1!pg>5}5|kK32w)8eb86JDoet-yGa+WQI50GAY>tR8PHeB$Bu zOfZ1Oo~B0gckmC4tCeg_V;>fX46*`TolzJ>QGi;5C3~Ls_3BQbD-|eg*IQ64`##TG zbVd`cIQs^4Lx@MDJZ@QzZJJOA@yArivZ>|m%62E$TosD^z&88!0a%3I?0eXcl!@Q| zgV)c< zkPt3hxL^awggFiF3_31aqSLH4aqJ;)twZH?agNk$Cwah1u7Lf6_kKB1t<_8Fw!|{H z_a{)01pxGmPeG542>dq^hJO{EMqhg$l5giDfbipeYEb6`q3<&o3Ra+=bcAI~iHP7T z({_r(KF*23h<>Ra_VvMSItvS)rxP6VcPEfMO!$74R4P%zjlW##2$n&3moN{` zKr5txFz_Ke{}H4fL=?qcA^!;HPk0mOfByXWpH)t*z?jWSrOB1e%GhH=LqprfRO5QP z-M-ThbC>4;qxgW}$u-5;wxwG$lZI;C$qtl;BlcTMTz@B9$zuJj)|tJ=!h#y89J?0v z^$F84mzIXcROp4-Y`Y=F7(R4|FwpS4u-$G5V`zaKRMhSx2Qh|8J&#Gwqcgg+g!S!q zGn;LQ%V&m$jG-Y_KGtqW?Y00h{;xoc|3e_84=oV#2?R2!&|{dVLf2&|3Om*1AxO|7LytfBeOjdb?(GwLo(!oz8IBD(V>EfA?KNO>F-iep;U?r`{81y# z0Q)rqcF$a%r-tog=*e{Tnxq9TQJJIDWbH({HPv->#P{UwKuWJ$trAf=7-V zsgR!W(XGp;ZCJE_pgiJ7Vr6MzZf0^?b!GbsrQsUA8DC{{^g)R{S>V7Z$1u>OW2P6( z6k|#{=%6+>iMf`*dLZ13u_<+~!|e_jxwG8B{21;(I%oQS_{WDga&ZjYi?7!Cgnv)o z%UtT~DRk0#RD#Ss{nd$2HArYZq|@ui*yfFYa`ND=H5^7uOCR5c{&8d5cGJM2iWI;0 zJi*`pzWML({^R2OJQmKXNAG|1@S}&%9cDh27!l8(d;YEG-#Qe3 zEJo2=ho%lq)uv=kr$VGfx8@2L8sZ~F|)NmK~hoAi9t)prG=&(=l(mpQP@ySox zlXCL+r-bYND*DwOzc%%?zx~?ZJ@+^Bi;G~ttib);^XCqqLq63v9U%@wMtT1RaagBj zw7NHRcXfB^9iFVu=ZP?E)B|8t>sfX4+BIB61}g)7I9y6puAHnZJn(cP znBK6fe8=%z-*<%{R_povh>sdz2?K=&*WS8=XVpQGL#Z_I{e(A>e7^-}Yr=A@1&PyX z^>(~4jTkRf3Lu~-UzkR~>Z!H9r~8E_a*S>v=U{T(I`r80WV$gKfKx*cfW|Q7&%e-b zWm4ST+xzYp1|Qgw;+?yn`SMqP_@g&djCJ^K$Z);JShr!*rY&5rG1mRTb7y}1*E>FU z;J~4YiK$(Ca-NUXtR(FVkQh#rRZbgeeaT1U6i zeZXcPq7o2e19yzBK_qiZjL|)bges9xISP}2c$3(Jhge8gh@~( z1XV&nB?MslG@kW(ei7Et`U_$lStE8Q@kxl4gg(q#h$0pLb1R63rA}oiSpbEzM4#*`5V%l~p#jxb517F(z#yWiE%B5ewpY*pw z0I>hfN->|u`yW-!_Mp7D?kYy~WbpLLC?ZDmY`}+4?;8Hh2HZmL>+Ov(8XLB5-MTZy z5K=oSr6ceq7|F_sd+Aqnp#|aeZ)RHV$iD9uO6@Aftdr62)3=v^Ccfv(s|ASt(TXB!5s`bw8Cf zo=B4zG)W+xXC)$}1d{QjyS9(x|84%z`Xd|Y1cGfTVMs~u4T&+f&U^KWPttY2El&9V zwq*YQ`&;iEdEtd4@5okV|JgU*IJ=*(|Ii;Fam5Ph*o-g!M5&Fg;0AI@Sbb4fN(#7Xz3~3*p56ETHKB+NsV|nAv5ZNGVJ{{TcVhv%vRUEzd1{pLp#{d_=!^(eq+~g!oS;_mr0a delta 9 QcmbPmfU%*0aiM?%021c|L;wH) diff --git a/_wip/MUSCLE (U)/copilot/rom.nes b/_wip/MUSCLE (U)/copilot/rom.nes new file mode 120000 index 0000000..420bf67 --- /dev/null +++ b/_wip/MUSCLE (U)/copilot/rom.nes @@ -0,0 +1 @@ +../M.U.S.C.L.E. (U).nes \ No newline at end of file diff --git a/_wip/MUSCLE (U)/copilot/routine_names.tsv b/_wip/MUSCLE (U)/copilot/routine_names.tsv new file mode 100644 index 0000000..d86accb --- /dev/null +++ b/_wip/MUSCLE (U)/copilot/routine_names.tsv @@ -0,0 +1,228 @@ +0x8000 Reset +0x800E WaitForFirstPpuWarmup +0x8019 WaitForSecondPpuWarmup +0x802C InitializeGameState +0x8052 UpdateNametableFromStream +0x80AC StartStageSequence +0x8132 UpdateFadeFlashSprites +0x8164 InitializeRound +0x8226 MainGameLoop +0x82AC DivideBy20 +0x82E1 SilenceSoundChannels1And3 +0x82ED SilenceSoundChannel3 +0x82FA StartIntroMusic +0x82FF StartMusicSequence +0x832A UpdateHudTallyTiles +0x8353 UpdateScoreTallyDigits +0x8372 WriteScoreTallyDigits +0x8399 LoadOamShadowFromTable +0x83A7 UpdateActorPositions +0x845C UpdateRoundTimers +0x856C PlayRoundChangeMusic +0x8596 UpdateScrollTarget +0x8598 UpdateScrollTargetAlt +0x8639 BeginVblankFrame +0x8644 ForceRenderingOff +0x8653 SetRenderingOffAndSignalVblank +0x865D UpdateRoundLogic +0x86CB NmiHandler +0x8751 FinishNmiUpdates +0x8759 FinishNmiRegisters +0x8764 IrqHandler +0x8765 SetSoundSequenceChannel1 +0x877C RunGameStateDispatcher +0x87BF UpdateTimersAlt +0x87D1 PollControllerStart +0x87F2 UpdateFlashCounter +0x8837 PlayDeathSequence +0x8848 PollControllerBits +0x885B PollControllerAndAdvance +0x886C PollControllerBitsAlt +0x887C SignalVblankComplete +0x8882 PollControllerAndCheckRound +0x88A4 BuildOamList +0x88B0 EmitOamEntry +0x88EB EmitOamBlankEntry +0x88F9 EmitOamFromTable +0x88FF EmitOamAtOffset +0x8936 FindFreeOamSlot +0x8986 CompactOamList +0x89CE ReadControllerAndInit +0x8A28 UpdateStageActors +0x8A5E SpawnStageActors +0x8AE8 UpdateAttributeTable +0x8B07 ClearScrollLatch +0x8B20 WriteNametableTile +0x8B33 ClearAttributeRegion +0x8B92 RenderHudDigits +0x8BEF RenderHudDigitDescriptor +0x8BF8 SetRenderingOn +0x8C05 AdvanceAnimationSlot +0x8C0E QueueVramTransfer +0x8C11 QueueVramTransferAlt +0x8C65 ExecuteVramTransfer +0x8CB8 QueueVramDescriptor +0x934B UpdateActorX +0x9371 UpdateActorTile +0x9374 UpdateActorTileAlt +0x94B1 TestPlayerFacing +0x94C7 SelectActorSlot +0x94C8 SelectActorSlotAlt +0x94CF ClearActorPosition +0x94D7 ClearActorFields +0x94FE SetActorFlag +0x9585 UpdateActorState +0x95AE ComputeActorLeftEdge +0x95D2 ComputeActorRightEdge +0x95D9 CompareActorToLimit +0x9653 SetActorTileFromPalette +0x9667 StoreActorTile +0x969E AdvanceActorCounter +0x96AA SetActorTileValue +0x96C8 TestActorCollisionFlag +0x96F7 ComputeActorLeftEdgeAlt +0x9722 ComputeActorRightEdgeAlt +0x9729 TestActorRange +0x9732 MoveActorByStep +0x97BC SetActorAnimation63 +0x97C0 SetActorAnimation62 +0x97C4 SetActorAnimation61 +0x97D5 UpdateActorAnimation +0x97FC TestAnimationSlot +0x982A ComputeActorLeftEdgeAt +0x9858 ComputeActorRightEdgeAt +0x985F TestActorValue +0x98E6 ComputeActorLeftEdgeAlt2 +0x9911 UpdateActorTileFromIndex +0x9918 UpdateActorTileFromIndexAlt +0x99A3 SetSoundSequenceChannel2 +0x99E2 LookupActorTileId +0x99E4 LookupActorTileIdAlt +0x9A24 StoreActorCoordinates +0x9A2E StoreActorCoordinatesAlt +0x9A3F FlipActorFacing +0x9A4E SpawnActorPair +0x9A6B SpawnActorPairAlt +0x9AE8 RunBytecodeInterpreter +0x9B05 DispatchThroughPointer +0x9B25 RunBytecodeProgram +0x9CBB ResetBytecodeState +0x9D4E CopyActorCoordinates +0x9DD6 SetActorBounds +0x9DE6 LoadActorTileIndex +0x9E6E UpdateActorFacing +0x9E7F QueueNametableWrite +0x9F14 FlushNametableWrite +0x9F4B UpdateActorMovement +0x9F54 MoveActorByOpcode +0x9FDF AddToNametableValue +0xA002 SubtractFromNametableValue +0xA01D ProcessBytecodeOpcode +0xA085 ComputeBytecodeOffset +0xA0A5 ResetBytecodeAccumulator +0xA0C6 ResetBytecodeAccumulatorAlt +0xA0F4 AdvanceBytecodeProgram +0xA0FB ResetBytecodeStateAlt +0xA12E ComputeActorTileRow +0xA15D ResetBytecodePointers +0xA17F RunActorScript +0xA250 LoadActorConfigByte +0xA253 ComputeActorConfigOffset +0xA25F CopyConfigBytes +0xA270 LoadActorConfigRecord +0xA298 CompareConfigValue +0xA2C8 ReturnFromConfigLoad +0xA2C9 LoadActorConfigFields +0xA316 StoreActorPaletteByte +0xA32C StoreActorControlByte +0xA338 ReadActorConfigByte +0xA435 CompareActorConfigValue +0xA46F StoreActorConfigResult +0xA482 LoadActorConfigAlt +0xA49F StoreActorConfigResultAlt +0xA4AA LoadActorFacingFlag +0xA4C7 LoadActorConfigBlock +0xA4DF TestSoundChannelState +0xA4F2 SetSoundSequenceChannel2Alt +0xA4FF FlipObjectIndex +0xA508 LookupObjectIndex +0xA512 UpdateObjectSlots +0xA51B AdvanceObjectSlot +0xA5DD WriteNametableBytes +0xA660 SetSoundSequenceChannel4 +0xA68E UpdateObjectList +0xA695 UpdateObjectListEntry +0xA6F8 UpdateObjectCollisions +0xA79F CheckObjectScroll +0xA82F ClearScrollLatchAlt +0xA834 UpdateObjectSprite +0xA884 SetObjectFlags +0xA8D1 AdvanceObjectFrame +0xA8E9 TestObjectActive +0xA949 UpdateObjectAnimations +0xA952 UpdateObjectAnimation +0xA992 UpdateObjectTimer +0xA99E DecrementObjectCounter +0xA9AB UpdateObjectState +0xA9D8 ToggleScrollRegionFlip +0xA9FF BuildObjectList +0xAA56 ReadControllers +0xAA63 ReadControllerShiftRegister +0xAAB8 StoreControllerButtonBits +0xAACD EnableRendering +0xAADC DisableRenderingAndClearNametables +0xAAEF ClearNametablePattern +0xAB68 CopyPaletteFromTable +0xAB98 LoadShadowOamBlock +0xABA3 FillShadowOamBlock +0xABB1 UploadPalette +0xABE4 ApplyPpuScrollAndControl +0xABF7 ShiftAccumulatorRight4 +0xABFC ClearOamShadow +0xAC0D SelectLevelVramWriter +0xAC3B SetLevelVramStream +0xAC43 FillAttributeBlock +0xAC4C WriteAttributeBlock +0xAC62 LoadAttributeStream +0xAC78 SetPpuAddressHighAnd40 +0xAC82 WriteCompressedVramStream +0xAC88 AdvanceSourceByte +0xAC96 DecodeVramStreamToken +0xACA7 WriteVramRunToken +0xACC9 AdvanceDestinationWord +0xACD7 AdvanceCountWord +0xACE5 WithRenderingEnabled +0xACF5 WriteCompressedVramBlocks +0xAD19 ComputeCollisionBits +0xAD36 ComputePlayerOverlapBits +0xAE45 SetDefaultOverlapBits +0xAE9B ComputeEdgeOverlapBits +0xAF25 InitializeSoundEngine +0xAF3B UpdateSoundFrame +0xAF40 UpdateAllSoundChannels +0xAF43 UpdateSoundChannel +0xAF55 AdvanceSoundChannelNote +0xAF69 WriteSoundChannelState +0xAF6B RebuildApuEnableMask +0xAF73 StartSoundChannelNote +0xAFAB AdvanceSoundSequencePointer +0xAFC5 ComputeEnvelopeMask +0xAFD9 ComputeTonePeriod +0xB000 ShiftNoteTableIndex +0xB007 WriteToneRegisters +0xB029 WriteFixedToneRegisters +0xB03A ReadNoteDuration +0xB049 StoreNoteDuration +0xB059 StoreShortNoteDuration +0xB05D BuildApuChannelMask +0xB062 WriteApuEnable +0xB06C ApplySoundCommand +0xB083 WriteApuControlRegister +0xB08C AdvanceSoundSequenceStep +0xB08E AdvanceSoundSequenceStepAlt +0xB095 ReturnFromSoundCommand +0xB096 ReadLoopFlag +0xB09D HandleNoteTerminator +0xB0A9 HandleSustainCounter +0xB0B3 LoadSoundSequenceStep +0xB0C6 DecrementSustainCounter diff --git a/_wip/MUSCLE (U)/copilot/routine_purposes.tsv b/_wip/MUSCLE (U)/copilot/routine_purposes.tsv new file mode 100644 index 0000000..4237eb5 --- /dev/null +++ b/_wip/MUSCLE (U)/copilot/routine_purposes.tsv @@ -0,0 +1,96 @@ +# MUSCLE (U) routine purpose notes - Pass 2 +# addrpurpose +0x8000 Power-on entry: stack set up, PPU blanked through two vblank waits, APU frame counter silenced, $0300-$032C cleared, then the initial nametable stream is decoded into $0400 and the first stage is started. +0x800E Spin on $2002 until bit 7 is set, so the write to $2000 just before it has taken effect. +0x8019 Second vblank wait, this time before touching $4017/$4010. +0x802C Reset the game-state bytes at $0326/$032B/$032C and zero page $FF, clear $0300-$032C, then decode the compressed nametable pointed at by SourcePointerLo/Hi. +0x8052 Decode the compressed nametable stream at (SourcePointerLo/Hi) into (DestinationPointerLo/Hi). A byte with bit 7 clear is a run of (byte & $7F) copies of the next stream byte; a byte with bit 7 set is a literal, written only when it differs from what is already at the destination. $0346 is set whenever VRAM actually changed. +0x80AC Stage start-up: reset the animation and actor counters, clear the OAM shadow, initialise the sound engine, upload the HUD palette row, and hand control to MainGameLoop. +0x8132 Push or drop the two flash sprites (palette tiles $82) depending on PlayerCount and the fade state. +0x8164 Round initialisation: clear the shadow arrays at zero page $00-$BF, reset the controllers and the OAM shadow, collect the $81/$82 type sprites, set the per-player palette and sprite bases, and start the actors. +0x8226 Main game loop. Waits for the NMI handler to raise $0321, services the two frame timers, reads the controllers, and restarts the stage or updates actor positions. $0321/$0320 form the vblank handshake with the NMI. +0x82AC Restoring binary division of the 8-bit value in A by the constant 20 ($14). Eight steps shift the divisor right, conditionally subtract it from the 16-bit remainder, and roll the quotient bit into $0349. Quotient -> $0349, remainder -> $0347/$0348. +0x82E1 Point sound channels 1 and 3 at the silent sequence at $B1A1/$B1B0 with step 0. +0x82ED Point sound channel 3 at $B1B0 with step 0 (the tail of SilenceSoundChannels1And3). +0x82FA Set the $14-frame transition timer and start the intro music sequence for all four channels. +0x82FF Start a four-channel music sequence from the $B2B9/$B3B2 tables. +0x832A Draw the two score/tally markers at $20BB and $24A6 when their flags at $0338/$0339 are set. +0x8353 Redraw the score row at $20EC and $210C with the three current digits. +0x8372 Write one score digit: blank the cell unless it matches PlayerCount, then stamp the tile. +0x8399 Copy the 32-byte OAM shadow at $9EF4 into $0300 and upload it. +0x83A7 Advance both actors: add the per-actor scroll delta to the position in $0340-$0342, then step the round counter and redraw the tally markers. +0x845C Per-round timer and state update: redraw the score, start the round-change music, and either loop again or advance the round and prepare the transition objects. +0x856C Start the short round-change jingle and wait for the NMI handshake. +0x8596 Compare the actor position in $0340-$0342 against the screen bounds in $0328-$032A and latch the tighter limit. +0x8639 Clear the vblank handshake ($0321, $0320) and re-enable rendering. +0x8644 Force rendering off: PPUCTRL=$10, PPUMASK=0, updating both shadow bytes. +0x8653 Force rendering off and immediately signal the main loop by setting $0321. +0x865D Positive game-state branch of the NMI: update the flash counters and actors, detect a button edge, and bump the frame-skip counter in zero page $FE. +0x8751 Finish the NMI: clear the vblank latch unless $0321 says work is outstanding, poll $2002 to release the PPU address latch, and run the sound frame update. +0x8759 NMI epilogue: poll $2002, update the sound engine, restore Y/X/A, and RTI at $8764. +0x8765 Point sound channel 1 at the $B1EB sequence. +0x877C Main game-state dispatcher. Counts down the transition timer at zero page $8D and runs one of fourteen subsystem updates chosen by that counter. +0x87F2 Advance the screen-flash counter against the $2C-frame limit. +0x8837 Play the player-death sequence: load the palette, upload the sound command, clear the attribute area, and respawn the actors. +0x8848 Test the start/select bits of the raw controller byte. +0x885B Read the controllers and advance the frame counter. +0x887C Signal the main loop that the NMI frame is finished. +0x8882 Read the controllers and test the round-transition flag at $0326. +0x88A4 Build the OAM list for the active player: blank every slot, then emit one sprite per visible actor row. +0x88B0 Emit a single OAM entry built from the actor record. +0x8936 Find the next free OAM slot by scanning the $032E source list for a value matching the running sprite index. +0x8986 Compact the OAM list, dropping entries whose actor has moved off screen. +0x89CE Read the controllers, reset the per-player bookkeeping, and initialise the object list. +0x8A28 Update the stage actors: pick the animation for each player from the palette index pair and hand off to SpawnStageActors. +0x8AE8 Rewrite the attribute table entry at $209C through the compressed stream writer. +0x8B20 Write one tile into the nametable at the address in zero page $10/$11 plus the per-round offset. +0x8B92 Render the HUD digits: set up the palette copy, clear the digit cells, then run each digit descriptor. +0x8BF8 Re-enable rendering: PPUCTRL=$10 with PPUMASK left at zero and the shadow updated. +0x8C05 Advance the animation slot below the current one. +0x8C0E Queue a VRAM descriptor built from the PlayerCount-relative index. +0x8C65 Execute the queued VRAM transfer: copy bytes from (BytecodeStreamPointerLo/Hi) through the destination pointer and the two block counters. +0x8CB8 Push a VRAM descriptor and bump the queue index. +0x9AE8 Bytecode interpreter entry. Reads a token byte through (BytecodeStreamPointerLo/Hi); tokens $C8-$EF are converted to an index and dispatched through the handler table at $9237 into jmp ($001C); anything else is an operand consumed by the current handler. +0x9B05 jmp ($001C) - the handler table and the $9F2B table both land here to re-enter the interpreter at the next token. +0x9B25 Main bytecode program loop: advance the program counter, dispatch the token, and resume. +0x9CBB Reset the per-invocation script state at $034D/$034E and the flags in zero page $4D/$4E. +0x9E7F Queue a nametable write described by a two-byte descriptor and advance the write pointer. +0x9F4B Update actor movement from the object script, dispatching through jmp ($001C). +0x9F54 Move an actor by one opcode: read the displacement, apply it, and redraw. +0xA01D Process one bytecode opcode against the actor record, advancing the script pointer. +0xA17F Run an actor script: set up the source/destination pointers, then walk the descriptor stream. +0xA250 Read one byte of the actor configuration block, scaled by four. +0xA253 Compute the byte offset of an actor configuration record. +0xA4FF Flip the low bit of A, turning a player index into its partner (0<->1, 2<->3). +0xA508 Resolve an object index through the per-player tables at $2A and $26. +0xA512 Walk the object slots looking for one whose countdown at $45 is non-zero. +0xA68E Update the whole object list, then the second half of it. +0xA6F8 Update object collisions and the object scroll test. +0xA8D1 Advance an object animation frame from the table at ($75),y. +0xA949 Update both players' object animations. +0xAA56 Read both controller ports: strobe $4016, shift eight bits per port into zero page $FA/$FB, save the previous byte in $F4/$F5, and derive the face/direction masks in $F6-$F9. +0xAA63 Shift one controller port's eight bits in from $4016/4017 and run the edge-detection post-processing. +0xAACD Enable rendering: PPUMASK=$18, PPUCTRL=$90, both shadows updated. +0xAADC Disable rendering, then clear both nametables to tile $30. +0xAAEF Set the PPU address from A and write $C0/$40 bytes of tile $30. +0xAB68 Load the HUD palette and the per-round object configuration into the $0300 shadow. +0xABB1 Upload the 32-byte palette from $0300 to $3F00, then restore PPUMASK. +0xABE4 Write the latched scroll (PpuScrollX/PpuScrollY) and PpuCtrlShadow to the PPU. +0xABFC Clear the 256-byte OAM shadow at $0200 to $F0. +0xAC0D Select and run the level's VRAM writer from the three-entry table at $AC35, indexed by the level byte at $0326. +0xAC82 Decode one compressed VRAM token: below $B8 is a literal, $B8-$C3 is a run whose fill value comes from the table at $ACBD and whose length is the next stream byte, $C0 additionally skips a byte first, and $C4 or above is a literal. +0xAC88 Advance the compressed-stream source pointer (SourcePointerLo/Hi) by one byte. +0xACF5 Write a block of compressed data to VRAM: the first byte is the block count, then each block supplies a 16-bit PPU address followed by a token run. +0xAD19 Compute the collision bit flags for the active player and store them in zero page $15. +0xAF25 Silence the APU: $4015=0, the enable mask cleared, and all four channels marked finished. +0xAF3B Sound frame update: walk all four channels and update the APU. +0xAF40 Update all four sound channels in turn. +0xAF43 Update one sound channel: restart it from its sequence when finished, otherwise count the note timer down and step the sequence. +0xAFAB Advance a sound channel's sequence pointer by step*2 from its base. +0xAFC5 Compute the envelope mask for a channel from its envelope mode. +0xAFD9 Compute the tone period for a channel from its note table and write the period registers. +0xB03A Read a note's duration from the sequence and store it, doubling it for looped notes. +0xB06C Apply one byte of a sound sequence: below $A0 is ignored, $A0-$AF patches the $4000 control byte, and $B0+ handles note and sustain data. +0xB0C6 Decrement the channel's sustain counter and advance the sequence.0x8644 Set PPUCTRL to $10 and PPUMASK to 0, updating both shadow bytes. Provably unreachable: no word in the image points at it except the jsr at $8654, and $8653 itself is unreferenced. Kept as code because the shape is unambiguous. +0x8653 Call ForceRenderingOff, signal the main loop through SignalVblankComplete, then clear the vblank latch at $0320. Provably unreachable (no word in the image points at $8653). Kept as code because the shape is unambiguous. +0x9CAD Decrement the 16-bit word in Zp14/Zp15 by one. A textbook "dec 16-bit" helper, but Zp14/Zp15 are otherwise scratch, and no word in the image points here. Provably unreachable; kept as code. diff --git a/_wip/MUSCLE (U)/copilot/zero_page_names.tsv b/_wip/MUSCLE (U)/copilot/zero_page_names.tsv new file mode 100644 index 0000000..e049847 --- /dev/null +++ b/_wip/MUSCLE (U)/copilot/zero_page_names.tsv @@ -0,0 +1,112 @@ +# MUSCLE (U) zero-page names - Pass 2 +# kindoldnewnote +zp Zp10 SourcePointerLo Lo byte of the compressed VRAM/attribute stream pointer +zp Zp11 SourcePointerHi Hi byte of the compressed VRAM/attribute stream pointer +zp Zp12 DestinationPointerLo Lo byte of the VRAM destination pointer +zp Zp13 DestinationPointerHi Hi byte of the VRAM destination pointer +zp Zp1A BytecodeStreamPointerLo Lo byte of the token-stream pointer, loaded from the $8CEF table +zp Zp1B BytecodeStreamPointerHi Hi byte of the token-stream pointer +zp Zp1C BytecodeHandlerPointerLo Lo byte of the handler address consumed by jmp ($001C) +zp Zp1D BytecodeHandlerPointerHi Hi byte of the handler address consumed by jmp ($001C) +zp Zp1E ActorIndex Active player/actor slot (0 or 1) used as an array index +zp Zp21 ActorSlotOffset ActorIndex*4; byte offset into the per-actor record arrays +zp Zp22 ActorSlotOffsetHi High half of the per-actor record offset +zp Zp23 ActorFieldOffset Second per-actor offset used by the bytecode handlers +zp Zp24 FrameCounterLo Low byte of the 16-bit frame counter, incremented once per NMI +zp Zp25 FrameCounterHi High byte of the 16-bit frame counter +zp Zp26 PlayerSpriteIndex1 Per-player sprite slot table, first plane +zp Zp27 PlayerSpriteIndex2 Per-player sprite slot table, second plane +zp Zp28 PlayerSpriteIndex3 Per-player sprite slot table, third plane +zp Zp29 PlayerSpriteIndex4 Per-player sprite slot table, fourth plane +zp Zp2A PlayerPaletteIndex Per-player palette slot table +zp Zp2B PlayerTileIndex Per-player tile slot table +zp Zp34 ActorPosXLo Per-actor 16-bit X scratch, written by the bytecode handlers +zp Zp35 ActorPosXHi Per-actor 16-bit X scratch, high byte +zp Zp36 ActorPosY Per-actor Y scratch +zp Zp3A PlayerPosXLo1 Player 1 X position, low byte +zp Zp3C PlayerPosYLo1 Player 1 Y position, low byte +zp Zp3E PlayerPosXLo2 Player 2 X position, low byte +zp Zp40 PlayerPosYLo2 Player 2 Y position, low byte +zp Zp41 ScriptFlags Script state byte selected by the bytecode SelectActorSlot handlers +zp Zp43 ScriptCounterA Per-actor bytecode counter A +zp Zp44 ScriptCounterB Per-actor bytecode counter B +zp Zp45 ScriptCounterC Per-actor bytecode counter C +zp Zp47 ScriptArgLo Per-actor bytecode argument, low byte +zp Zp48 ScriptArgHi Per-actor bytecode argument, high byte +zp Zp4D ScriptFlagsLo Low byte of the 16-bit script flag pair +zp Zp4E ScriptFlagsHi High byte; tested non-zero to gate several bytecode handlers +zp Zp65 ActionCooldown Frames to wait before the main loop resumes object updates +zp Zp68 ScreenTransitionState 0 = idle, negative = entering, positive = leaving +zp Zp6E PlayerBoxOriginX Player 1 hitbox origin used by the overlap test +zp Zp70 PlayerBoxOriginY Player 1 hitbox origin used by the overlap test +zp Zp78 PlayerActiveFlag Per-player "still alive / facing right" flag gating the overlap test +zp Zp80 SoundVolume1 APU channel 1 volume +zp Zp81 SoundVolume2 APU channel 2 volume +zp Zp82 SoundVolume3 APU channel 3 volume +zp Zp83 SoundVolume4 APU channel 4 volume +zp Zp8B PlayerFlashTimer Per-player damage-flash countdown +zp Zp8C PlayerFlashTimer2 Per-player damage-flash countdown, second half +zp Zp8D RoundTransitionTimer Decremented by the round-transition state +zp Zp91 PlayerPaletteIndexLo Low byte of the player palette index pair +zp Zp92 PlayerPaletteIndexHi High byte of the player palette index pair +zp Zp94 PlayerCount 0 = one player, 1 = two players +zp Zp96 SubModeFlag $FF entering a sub-mode, $01 leaving it, 0 idle +zp ZpC4 SoundEnvelopeMode1 APU channel 1 envelope/tone mode nibble +zp ZpC5 SoundEnvelopeMode2 APU channel 2 envelope/tone mode nibble +zp ZpC6 SoundEnvelopeMode3 APU channel 3 envelope/tone mode nibble +zp ZpC7 SoundEnvelopeMode4 APU channel 4 envelope/tone mode nibble +zp ZpC8 SoundNoteTimer1 APU channel 1 note duration countdown +zp ZpC9 SoundNoteTimer2 APU channel 2 note duration countdown +zp ZpCA SoundNoteTimer3 APU channel 3 note duration countdown +zp ZpCB SoundNoteTimer4 APU channel 4 note duration countdown +zp ZpCC SoundEnvelopeValue1 APU channel 1 envelope byte read from the sequence +zp ZpCD SoundEnvelopeValue2 APU channel 2 envelope byte read from the sequence +zp ZpCE SoundEnvelopeValue3 APU channel 3 envelope byte read from the sequence +zp ZpCF SoundEnvelopeValue4 APU channel 4 envelope byte read from the sequence +zp ZpD0 SoundChannelStep1 APU channel 1 step index into its note table +zp ZpD1 SoundChannelStep2 APU channel 2 step index into its note table +zp ZpD2 SoundChannelStep3 APU channel 3 step index into its note table +zp ZpD3 SoundChannelStep4 APU channel 4 step index into its note table +zp ZpD4 SoundSequencePtrLo1 APU channel 1 sequence pointer, low byte +zp ZpD5 SoundSequencePtrLo2 APU channel 2 sequence pointer, low byte +zp ZpD6 SoundSequencePtrLo3 APU channel 3 sequence pointer, low byte +zp ZpD7 SoundSequencePtrLo4 APU channel 4 sequence pointer, low byte +zp ZpD8 SoundSequencePtrHi1 APU channel 1 sequence pointer, high byte +zp ZpD9 SoundSequencePtrHi2 APU channel 2 sequence pointer, high byte +zp ZpDA SoundSequencePtrHi3 APU channel 3 sequence pointer, high byte +zp ZpDB SoundSequencePtrHi4 APU channel 4 sequence pointer, high byte +zp ZpDC SoundSustainCounter1 APU channel 1 sustain/release counter +zp ZpDD SoundSustainCounter2 APU channel 2 sustain/release counter +zp ZpDE SoundSustainCounter3 APU channel 3 sustain/release counter +zp ZpDF SoundSustainCounter4 APU channel 4 sustain/release counter +zp ZpE0 SoundLastCtrlWrite1 Last value written to $4000+4*channel, channel 1 +zp ZpE1 SoundLastCtrlWrite2 Last value written to $4000+4*channel, channel 2 +zp ZpE2 SoundLastCtrlWrite3 Last value written to $4000+4*channel, channel 3 +zp ZpE3 SoundLastCtrlWrite4 Last value written to $4000+4*channel, channel 4 +zp ZpE4 ApuRegisterOffset Channel*4, the offset added to $4000/$4001/$4002/$4003 +zp ZpE8 ApuEnableMask Bit mask of currently enabled APU channels +zp ZpE9 SoundMuted Bit 7 set suppresses writes to $4015 (write during rendering) +zp ZpEA SoundTonePeriodLo Computed tone period, low byte +zp ZpEB SoundTonePeriodHi Computed tone period, high byte +zp ZpEC SoundEnvelopeMaskLo Computed envelope bits OR-ed into $4000, low part +zp ZpED SoundEnvelopeMaskHi Computed envelope bits OR-ed into $4000, high part +zp ZpEE SoundReadPointerLo Lo byte of the sound sequence read cursor +zp ZpEF SoundReadPointerHi Hi byte of the sound sequence read cursor +zp ZpF0 PlayerActionState Per-player action/animation state byte ($80..$FF) +zp ZpF1 PlayerActionState2 Per-player second action state byte +zp ZpF2 ControllerButtonMask Filtered button bits for this read, per player +zp ZpF3 ControllerButtonMask2 Filtered button bits, second player +zp ZpF4 ControllerButtonsPrev Previous read's button byte, for edge detection +zp ZpF5 ControllerButtonsPrev2 Previous read's button byte, second player +zp ZpF6 ControllerDPad1 Directional bits derived from the button byte +zp ZpF7 ControllerDPad2 Directional bits derived from the button byte +zp ZpF8 ControllerFaceButtons1 Face-button bits derived from the button byte +zp ZpF9 ControllerFaceButtons2 Face-button bits derived from the button byte +zp ZpFA ControllerButtons1 Raw button byte for player 1 (shadows $4010/$4011 at reset) +zp ZpFB ControllerButtons2 Raw button byte for player 2 (shadows $4010/$4011 at reset) +zp ZpFC PpuCtrlShadow Shadow of the last value written to $2000 +zp ZpFD PpuMaskShadow Shadow of the last value written to $2001 +zp ZpFE PpuScrollX Shadow of the first $2005 write +zp ZpFF PpuScrollY Shadow of the second $2005 write +zp Zp14 VramBlockCountLo Low byte of the 16-bit block counter advanced by AdvanceCountWord +zp Zp15 CollisionFlagBits Accumulator for the overlap bit flags OR-ed together by ComputePlayerOverlapBits diff --git a/_wip/MUSCLE (U)/copilot/zero_page_ranges.tsv b/_wip/MUSCLE (U)/copilot/zero_page_ranges.tsv new file mode 100644 index 0000000..d3b7d50 --- /dev/null +++ b/_wip/MUSCLE (U)/copilot/zero_page_ranges.tsv @@ -0,0 +1,7 @@ +# MUSCLE (U) reused zero-page bytes - Pass 3 +# Zero page $14/$15 is the 16-bit block counter for the compressed-VRAM transfer path and +# the collision-bit accumulator for the overlap test. locals.inc names both roles; this +# file applies the counter name only inside AdvanceCountWord and the two block-count +# set-ups, so the same byte is not mislabelled at every site. +# kindstartendoldnew +zprange 0xACD7 0xACE2 Zp15 StreamBlockCountHi