- Apply symbols.inc hardware register names to Defender 2 (U) (51 operands)
- Apply symbols.inc hardware register names to Donkey Kong 3 (JUE) (36 operands)
- Add APU register symbols (-) to Defender 2 (U) and Donkey Kong 3 (JUE) symbols.inc
- Apply symbols to Donkey Kong Jr. Math (U) (80 operands: 11 single + 69 hardware)
- Apply symbols to Excitebike (JU) (786 operands: 785 single + 1 hardware)
- Add promotion criteria to PROMPTS.md: symbol/local substitution,
ROM-specific semantic naming, and verification checklist
Add branch/jump target naming requirement to PROMPTS.md
All branches and jumps must target symbolic labels with descriptive names
derived from program flow role (e.g., _Loop, _Next, _Done, _Store, _Return),
never raw address literals. Adds criterion 8 to verification checklist.
Rename all OVERVIEW.md to README.md; add root README content to top-level
- Rename all OVERVIEW.md files to README.md throughout the repo (47 files)
- Prepend README.md content to top-level OVERVIEW.md before rename
- Fix apply_symbols.py NAME_RE regex to handle spaced assignments
- Apply symbols.inc to Defender 2 (U) (51 hardware operands)
- Apply symbols.inc to Donkey Kong 3 (JUE) (36 hardware operands)
- Apply symbols.inc to Donkey Kong Jr. Math (U) (80 operands: 11 single + 69 hardware)
- Apply symbols.inc to Excitebike (JU) (786 operands: 785 single + 1 hardware)
- Add missing Zp18/FrameCounter aliases to Excitebike prg.s
- Build all 27 top-level projects: byte-identical
Promote Donkey Kong Jr. Math back to _wip tier
Moves code from `copilot` folder and verifies each builds after
Add pre-commit hook for byte-identical verification
Add .git/hooks/pre-commit that runs 'make' then 'make clean' in each
project directory before committing. This ensures every project builds
byte-identical before any commit is accepted.
Also includes all file moves from the Donkey Kong Jr. Math (U) demotion
and other file restructuring from the session.
moves code out of copilot folder, its all AI generated.
Moves NROM games into NROM folder
removes copilot folder from Lunar Pool
Adds makefile to build all projects recursively
Updates docs to reflect changes in layout
Repromotes Donkey Kong Jr Math
Repromotes Excitebike
Promotes Popeye (JU) (PRG 1)
Updates Makefile to provide summary of build failure/success
Promote Raid on Bungeling Bay (U): Pass 2/3 partial, whole-ROM byte-identical
Move _wip/NROM/Raid on Bungeling Bay (U) to NROM/ and switch the build
from a PRG-only compare to a whole-ROM one:
- header.s/chr.s added (one-line .incbin of header.bin / chr.bin)
- linker.cfg gains HEADER ($0000, $0010) and CHR ($0000, $2000)
areas ahead of PRG ($C000, $4000)
- rom.nes symlink to the space-containing original ROM name
- Makefile builds header.o/prg.o/chr.o into reconstructed.nes and
compares it against rom.nes ('Byte-identical ROM verified.')
- one leftover neutral indirect operand jmp (Zp01) at $E2EC becomes
jmp (IndDispatch01); apply_symbols.py reports 0 substitutions pending
README.md / TODO.md / AGENTS.md updated: 29 promoted, 7 in _wip/.
Pac-Man (U): Pass 2 complete (label renaming) + Pass 3 partial (ZP aliases, table names)
Pass 2 — fresh map derived from the committed split, not from any drafted
map (the drafted maps in other projects were audited and found not
applicable):
- all 194 address-derived Label_XXXX definitions renamed to semantic
routine-entry names plus <Routine>_<Role>_<addr> internal branch
targets; zero Label_ remains
- all 49 jsr/jmp call sites resolved from raw $XXXX to labels; zero
raw $XXXX call operands remain
- routinemap.tsv / derived_names.tsv record the derivation
Pass 3 (partial):
- 15 proven semantic zero-page aliases added to locals.inc
(GameState, NmiFlag, ScrollX/Y, PpuCtrlShadow, OamDmaPage,
CocktailModeFlag, ActivePlayerFlag, GameplaySuspended, FrameCounter,
StateTimer, Player1/2Input, ActiveInput, CopyrightVerified)
- 112 operands substituted into prg.s (11 single + 101 hardware)
- key data tables named: ProgrammerSig ($C0EB), GameStateDispatchTable
($C253), TitleScreenData ($C2FD), EntityPtrTable ($D912),
AudioCommandTable ($EFDD)
Also corrects the README's claim that the RESET vector points at padding:
$FF00 holds real boot code (sei/cld, PPU off, double vblank wait, then
jmp ColdStart at $C042).
.gitignore: ignore reconstructed_prg.bin (build artifact of the _wip
Makefiles; '**/reconstructed.*' does not match the underscore form).
Promote Pac-Man (U): Pass 2/3 complete, whole-ROM byte-identical
Move _wip/NROM/Pac-Man (U) to NROM/ and switch the build from a PRG-only
compare to a whole-ROM one:
- header.s/chr.s added (one-line .incbin of header.bin / chr.bin)
- linker.cfg gains HEADER ($0000, $0010) and CHR ($0000, $2000)
areas ahead of PRG ($C000, $4000)
- rom.nes symlink to 'Pac-Man (U) [!].nes' (the original ROM name
contains a space and brackets)
- Makefile builds header.o/prg.o/chr.o into reconstructed.nes and
compares it against rom.nes
- reconstructed.nes is 24,592 bytes, MD5 a69d310f8cae9397fbd39f204672b5c7
- equal to the original ROM; the header/prg/chr splits were checked
against the original before promotion and are byte-exact
Pass 3 residue closed. The last 7 multi-alias zero-page operands are
resolved per site through a new sites.tsv, each proven from context
rather than guessed:
- jmp ($0010) at $C250/$D3CA/$D90F/$D9B6 -> (DispatchPtrLo); each
is immediately preceded by sta DispatchPtrLo/sta DispatchPtrHi
- jmp ($00FE) at $EFDA -> (AudioHandlerPtrLo); preceded by
sta AudioHandlerPtrLo/sta AudioHandlerPtrHi
- sta a:$0000,y at $C048/$C089 -> a:Zp00,y; the literal zero-page
base in the two ZP clear loops, so the neutral name is used rather
than the semantic WorkPtrLo. The 'a:' prefix survives the
substitution, so the bytes stay 99 00 00 (sta abs,Y)
apply_symbols.py now reports 119 operands substituted (101 hardware,
11 single-name, 7 site) and 0 residue.
New tool _tools/align_audit_comments.py: re-aligns the audit comment to
column 35 after a substitution lengthens an operand (nesdis.py pads each
instruction to 31 characters). Whitespace-only, so the byte identity
cannot change. 405 lines re-aligned in this project; all 2,387 audit
comments still match prg.bin at the stated PRG offset, 0 mismatches.
Docs: root README.md / TODO.md / AGENTS.md updated - 30 promoted, 6 in
_wip/; a per-project detail entry for Pac-Man (U) added; the stale
'Donkey Kong 3 (JUE) has no README.md' claim corrected (it has a
318-line one).
Promote Raid on Bungeling Bay (U) [a2]: Pass 3 complete, whole-ROM byte-identical
Move _wip/NROM/Raid on Bungeling Bay (U) [a2] to NROM/ and switch the build
from a PRG-only compare to a whole-ROM one:
- header.s/chr.s added (one-line .incbin of header.bin / chr.bin)
- linker.cfg gains HEADER ($0000, $0010) and CHR ($0000, $2000)
areas ahead of PRG ($C000, $4000)
- rom.nes symlink to 'Raid on Bungeling Bay (U) [a2].nes' (the original
ROM name contains spaces and brackets)
- reconstructed.nes is 24,592 bytes, MD5 659d340a1e9d420eee28df13319b0094
- equal to the original ROM; the header/prg/chr splits were checked
against the original before promotion and are byte-exact
Pass 3 - 15 semantic zero-page aliases, each applied only at the sites
where its role is proven:
- PpuCtrlShadow ($C2), 15 sites: the reset entry primes it right after
'sta PPUCTRL', and every other use is an ora/and/eor followed by
'sta PPUCTRL'
- NmiPathSelector ($C4), 5 sites: written 1 at $C3E9 and 0 at $C962
- GameState ($D6), 6 sites: 'cmp #$02' and used as an index at $C4C7
- FrameSubCounter ($55), 6 sites: set to $0A at $C520, decremented per
NMI at $C07B
- PrngPeriodCounter ($EA) / PrngSeedB ($EB) / PrngState ($EC), 13 sites:
the PRNG state
- PtrLo ($00) / PtrHi ($01), 8 sites: the 16-bit pair $1C13 and $1610
compared at $E785/$E791
- IndDispatch01 ($01) / IndDispatch02 ($02), 3 sites: the computed
dispatch at $E2EC
- IndDispatch1B ($1B) / IndDispatch1C ($1C), 6 sites: the dispatch at
$E7A3
- IndDispatch17 ($17) / IndDispatch19 ($19): the dispatches at $E79D
and $E7A0
Addresses that carry two names keep the neutral ZpXX name where the other
role applies - $01 is PtrHi at the 16-bit compare and IndDispatch01 at the
dispatch; $17 is IndDispatch17 at the dispatch and Zp17 for the absolute
RAM $0017 store in the copy loop at $E895/$E8D0.
New tool _tools/apply_zp_aliases.py does the per-site substitution:
apply_symbols.py only rewrites *numeric* operands, so it cannot rename an
operand that is already written as a neutral ZpXX name. The tool keeps the
ca65 'a:' prefix (dropping it would turn 'sta a:Zp17,y' into a zero-page
store and change the bytes) and rewrites only the operand token, so the
audit comment survives byte for byte.
Naming correction in the promoted sibling. Finishing this dump showed that
$EA was misnamed 'VBlankWaitCounter': the routine at $C412 is the game's
pseudo-random generator (the classic eor/asl/php/lsr/plp/rol scrambler,
called from thirteen gameplay sites, twice in a row at $CDF4/$CDF9 with the
second result masked #$07), so $EA is the scrambler's phase counter.
Renamed PrngPeriodCounter in both dumps and named $EB/$EC PrngSeedB /
PrngState. The sibling's two 'sta a:IndDispatch17,y' operands were also
wrong - they are absolute stores to RAM $0017, not the dispatch pointer -
and are now 'a:Zp17,y', matching the file's 'a:' = absolute convention.
Audit-comment alignment re-done with _tools/align_audit_comments.py (1,040
lines here, 1,080 in the sibling). Both files still match prg.bin at every
stated PRG offset: 5,467 and 5,483 audit comments, 0 mismatches.
Docs: root README.md / TODO.md / AGENTS.md updated - 31 promoted, 5 in
_wip/; per-project detail entries added for both Raid dumps.
Promote Pac-Man (Tengen) (U): Pass 2/3 from scratch, whole-ROM byte-identical
Move _wip/NROM/Pac-Man (Tengen) (U) to NROM/ and switch the build from a
PRG-only compare to a whole-ROM one:
- header.s/chr.s added (one-line .incbin of header.bin / chr.bin)
- linker.cfg gains HEADER ($0000, $0010) and CHR ($0000, $2000)
areas ahead of PRG ($C000, $4000)
- rom.nes symlink to 'Pac-Man (Tengen) (U) [!].nes'
- reconstructed.nes is 24,592 bytes, MD5 d34e7a74d8d2c231b6cc601210e28ad0
- equal to the original ROM; the header/prg/chr splits were checked
against the original before promotion and are byte-exact
Disassembled from scratch. No name, map or file was carried over from the
sibling 'Pac-Man (U)' dump; the map was derived from this dump's own
committed split and the two were only compared afterwards.
Pass 2 (new tool _tools/apply_pass2_map.py):
- all 194 Label_XXXX definitions renamed to semantic routine entries plus
<Routine>_<Role> branch targets; zero Label_ remains
- all 48 raw $XXXX jsr/jmp operands resolved to labels; zero raw $XXXX
call or branch operands remain
- the map is in routinemap.tsv
Pass 3:
- 30 semantic zero-page aliases, each applied only at the sites where its
role is proven (per-site choice in sites.tsv; the addresses that carry
two roles keep the neutral ZpXX name elsewhere). _tools/
derive_zp_aliases.py records how the set was derived, and locals.inc
records the reason for every remaining neutral slot
- 28 data tables named (new tool _tools/name_data_region.py), including
CharacterDataTable ($C66A) and CharacterNameStrings ($C67E), where the
ROM itself names Blinky, Pinky, Inky and Clyde - which is why the four
indexed entities are called ghosts and not 'actors'
- apply_symbols.py reports 0 substitutions pending and 0 residue
- audit-comment alignment re-done with _tools/align_audit_comments.py;
all 2,479 audit comments still match prg.bin at the stated PRG offset
Pass 1 correction - six command handlers recovered (new tool
_tools/recode_region.py). ScriptCommandTable ($EFDD) is read by the traced
instruction at $EFCC, and six of its entries point at $F00A, $F022, $F03A,
$F052, $F062 and $F072 - all of which the tracer had left as data, and two
of which it had mis-split across the 'jmp $EF61' at $F01F and $F04F.
Those 120 bytes are code here, decoded straight from the ROM; the six
handlers tile $F00A-$F081 exactly. The same gap exists in the promoted
'Pac-Man (U)' dump, which has not been corrected - recorded in both READMEs.
Residue (documented, not guessed): the unreached main game logic at
$C45A-$C55F is still .byte data. It is code - the tracer's own decoder
walks it cleanly and the dispatch table at $C511 points into it - but
nothing reaches it, so it cannot be entered without a guess. The same gap
exists in the promoted 'Pac-Man (U)' dump. Re-deriving it is a Pass 1 job;
a Mesen Code Data Logger capture is the tool the repo uses for it.
Docs: root README.md / TODO.md / AGENTS.md updated - 32 promoted, 4 in
_wip/; a per-project detail entry added for the Tengen dump.
Promote Pyramid (U): Pass 1 corrected, Pass 2/3 complete, whole-ROM byte-identical
Move _wip/NROM/Pyramid (U) to NROM/ and switch the build from a PRG-only
compare to a whole-ROM one:
- header.s/chr.s added (one-line .incbin of header.bin / chr.bin)
- linker.cfg gains HEADER ($0000, $0010) and CHR ($0000, $2000)
areas ahead of PRG ($C000, $4000)
- rom.nes symlink to 'Pyramid (U) (Sachen).nes'
- reconstructed.nes is 24,592 bytes, MD5 aa285ff17f25dd05da5996b7466c59e2
- equal to the original ROM; the header/prg/chr splits were checked
against the original before promotion and are byte-exact
Pass 1 correction - the committed split was a strict subset of the correct
one. This game dispatches through 'jmp' trampoline tables that live
*inside* the data regions, and the tracer cannot follow a jmp there, so
828 bytes of code were still marked as data. Four such tables were found
($C01E 3 entries, $C02A 6, $C042 2, $C054 5) plus ten more entries at
$C000-$C01B; all sixteen targets decode as valid instructions. Seeding
them, the $C800 boot mainline and six further code starts recovers the
whole lot, plus a five-byte stub at $DF89 (lda $33 / jmp $DECB) that sat
in a hole between two routines. The re-trace loses NO committed code byte
and takes the split from 34.5% to 39.6% (3,130 instructions / 6,493 code
bytes). 'make regen' reproduces it, so the split stays verifiable.
Pass 2 - a fresh map derived from this dump's own committed split:
- 428 Label_XXXX definitions renamed; zero Label_ residue
- 320 raw $XXXX jsr/jmp operands resolved; zero raw $XXXX branch
operands remain
- 431 routine entries and the 32 data blocks named from the code
- the internal branch-target names are derived mechanically from the
branch that reaches them by the new _tools/derive_branch_names.py
(beq -> OnZero, bne -> OnNonzero, bcc/bcs -> the carry cases, a
backwards branch -> Loop)
- recorded in routinemap.tsv
Pass 3:
- 24 semantic zero-page aliases, each applied only where its role is
proven; the 57 slots that stay neutral are each listed with the reason
in locals.inc (the neutral set lives in zp_aliases.inc so that
'make regen' can rebuild locals.inc from prg.bin)
- 32 data tables named - TaskVectorTable1/2, LevelScriptData,
MusicPeriodTable, SoundEnvelopeTable, the actor tables - recorded in
data_region_names.tsv
- apply_symbols.py reports 0 substitutions pending and 0 residue; no
hardware register is left as a raw literal
- the audit comments are now canonical on every line, data included
(the old file carried only 'PRG:$xxxx' on its 1,358 data lines);
all 3,762 audit comments match prg.bin at their stated PRG offset
Kept as-is, not 'cleaned up':
- sta $4100 stays a raw operand. The iNES header claims mapper 0 but
the boot code writes past the NES register space; the ROM does not
explain it, so it is recorded rather than guessed
- the 'A'/'V' check on RAM $0120/$0121 and its seed/clear routines
are named for what they do, not for what they are for
- the ninth entry of the $C3A6 task vector table ($D820) is a junk
slot and stays data
Docs: root README.md / TODO.md / AGENTS.md updated - 33 promoted, 3 in
_wip/; a per-project detail entry added.
Hogan's Alley (JU): Pass 1 correction, Pass 2, Pass 3, promoted to NROM/
The light-gun game whose engine dispatches through *inline* tables:
`IndirectCall` at $C34D pops the return address of the `jsr` that called
it and reads a 16-bit handler pointer from the word that follows, so all
six handler tables ($C124 19 entries, $C219 4, $C89C 14, $CDD1 1, $D234 2,
$D3D6 14) live inside the code stream and the static tracer cannot follow
them.
Pass 1 correction. The committed split was a strict subset of the correct
one -- 41.8% of the PRG was classified as code. A fresh Mesen Code Data
Logger capture was merged with the four captures already in the folder
(hogans_merged.cdl, the OR of five per-byte flag arrays, 6,544 code bytes)
and _tools/cdl_reclass.py rewrote the split to match what the CPU actually
fetched: 1,216 bytes moved from data to code, five the other way, 59 labels
emitted. The split is now 49.1% code (3,950 instructions, 8,041 bytes).
The four branch targets the reclassifier could not prove were turned into
labels by the new _tools/resolve_raw_branches.py.
Pass 2. 206 routine entries hand-named from this dump's own code and 413
internal branch targets derived mechanically by _tools/derive_branch_names.py:
630 Label_XXXX definitions gone, 484 raw $XXXX call operands resolved, 15
call targets the tracer had never labelled given a label. Recorded in
routinemap.tsv. No SubC<addr> residue was needed -- every entry the engine
reaches is named after what it does.
Pass 3. 60 semantic zero-page aliases, each applied only where its role is
proven (zp_aliases.inc, zp_alias_sites.tsv); the slots that stay neutral are
each listed with the reason. All 34 data blocks named
(data_region_names.tsv). apply_symbols.py reports 1 residue: `sta a:$00B4,y`
at $C203, the same address as Zp40/ActorPalette but forced to absolute
addressing, so it must stay numeric.
Promotion. header.s, chr.s and a HEADER/PRG/CHR linker.cfg added, rom.nes
symlinked to the original ROM; the whole-ROM cmp passes on the first
promoted build. There is deliberately no `make regen` target: the Pass 1
split here is the static trace corrected by a CDL capture, and the base the
correction was applied to is not what the current _tools/nesdis.py
produces, so prg.s is the maintained source of truth.
Tools changed:
nesdis.py --split/--note/--provenance options, so a data
region can carry its own name and explanation;
a forced-data address is no longer reported as a
recovered routine entry
apply_pass2_map.py can create the label for a call target the tracer
left unlabelled; no longer double-labels it
apply_zp_aliases.py --at-file, an address-based per-site list
derive_branch_names.py keeps the map's own header instead of writing a
fixed one
resolve_raw_branches.py new: turns `bXX *+$NN` operands into labels
build_hogans_map.py new: the hand-written Pass 2 map builder
The existing regen pipelines (MUSCLE (U), Urban Champion (JU)) still
reproduce prg.s byte for byte.
Apply the symbols.inc register names at Pass 1; fix a dropped byte in cdl_reclass
nesdis.py now names the hardware registers as it renders the operands, so a
project's Pass 1 output already reads `lda PPUSTATUS` instead of `lda $2002`
and the Pass 3 apply_symbols.py step has nothing left to do for them.
* nesdis.py --symbols FILE reads a symbols.inc-style file and substitutes
the register names. Only unambiguous entries in the $2000-$4017 window
are used: $4017 is both JOY2 and APUFRAMECOUNTER, so it stays numeric
and apply_symbols.py reports it as multi-alias residue, exactly as
before. The default is the symbols.inc next to --out, so a new project
gets the names without asking; --no-symbols opts out.
* The renderer records the operand's numeric value on the Insn, because
operand_value() used to re-parse the operand text and could no longer
read a name.
* The controller bit masks in symbols.inc (PAD_A and friends) are
constants, not addresses, and are still never substituted.
MUSCLE (U) and Urban Champion (JU) keep --no-symbols: their committed
prg.s was produced with the registers named by the Pass 3 apply_symbols.py
step, and the columns in those files reflect the in-place substitution.
Adding the missing apply_symbols.py step to both regen pipelines makes
them reproduce their committed prg.s byte for byte again - neither did
before this change (MUSCLE was 440 lines out, Urban Champion 772).
cdl_reclass.py had a bug that cost a byte: a region whose last source row
straddled the region's end was replaced by a regeneration of the region
only, so the tail of that row was dropped. Mario Bros (JU) hit it at
$C595, where the rebuild came out one byte short and every label after it
shifted. A region now covers the whole rows it replaces.
pass2.py reflow takes an optional column argument; the default is
unchanged (the ';' lands on the same column as before).
Mario Bros (JU): Pass 1 correction, Pass 2, Pass 3, promoted to NROM/
A two-player platformer whose handler tables are *inline*: the pointers sit
in the middle of the code stream, right after the `jsr` that reads them, so
the static tracer could never follow them.
Pass 1 correction. The committed split was a strict subset of the correct
one -- only 72.0% of the PRG was classified as code. A Mesen Code Data
Logger capture of this ROM (mario_mesen.cdl, 10,915 code bytes) showed
1,010 bytes the tracer had left as data were code; two branch targets the
capture never reached ($E4CB and $E639) were forced with --override for 57
more, so 1,067 bytes moved from data to code and 22 moved the other way.
The split is now 78.4% code (6,210 instructions, 12,847 bytes). The three
branch targets the reclassifier could not prove were turned into labels by
_resolve_raw_branches.py, which now refuses to put a label on a `.byte` row.
Pass 2. 206 routine entries and 519 internal branch targets: 931
Label_XXXX definitions gone, 51 raw $XXXX call operands resolved and 12 call
targets the tracer had never labelled given a label. Zero SubC residue --
the 185 entries a previous session had left as address-derived residue were
all named from this dump's own code. Recorded in routinemap.tsv.
Pass 3. 25 semantic zero-page aliases, each applied only where its role is
proven (zp_aliases.inc); the slots that stay neutral are each listed with the
reason. 35 data tables named -- GameStateHandlerTable, EnemyBehaviourTable,
EnemyScriptTable, EnemyTypePointerTable, SoundRoutineTable,
NoteFrequencyTable and the rest -- and recorded in
data_region_names.tsv. apply_symbols.py reports 0 residue.
Promotion. header.s, chr.s and a HEADER/PRG/CHR linker.cfg added, rom.nes
symlinked to the original ROM; the whole-ROM cmp passes on the first
promoted build. There is deliberately no `make regen` target: the Pass 1
split here is the static trace corrected by a CDL capture, and the base the
correction was applied to is not what the current _tools/nesdis.py
produces, so prg.s is the maintained source of truth.
Tools:
apply_pass2_map.py renames a label of any spelling -- SubC<addr> is
the honest residue form -- and its references
follow it; one combined pattern, so a 16,000-line
file does not need a substitution per label
resolve_raw_branches.py refuses to label a data row
build_mario_map.py new: the hand-written Pass 2 map builder
Remove the old _wip/NROM/Mario Bros (JU) folder (promoted to NROM/)
Mario Bros (JU): add the promoted-tier header, CHR, rom.nes symlink and zero-page aliases
Moves _ROMS/<ROM> into _wip/<MAPPER>/<ROM>
Sync the docs and the skeleton tool with the 857-project _wip tier
The _wip/ tier now holds 857 projects across 30 mapper folders, all
building byte-identical for the whole ROM. README.md, TODO.md and
AGENTS.md still described the old 39-project tier, so bring them in line
with WIP.md, which carries the tier's index.
The tier is no longer 39 projects of NROM-256 with a 16/32 KB PRG:
only two projects have a 16 KB PRG, 151 have 32 KB, 523 have 128 KB and
one has 1.5 MB, so most of it is a banked mapper whose image does not fit
the 6502's address space. Those projects link their MEMORY areas at .nes
file offsets rather than CPU addresses, which is the only option and the
honest model; the 39 older projects keep the CPU-address layout because
their PRG really is one contiguous window.
make_skeleton.py gains the two layouts (--layout flat|cpu), the board
name for the mapper, and a fix for find_rom() mistaking the build
output reconstructed.nes for the source ROM.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
16347 lines
1.1 MiB
Plaintext
16347 lines
1.1 MiB
Plaintext
; Mario Bros (JU) 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=$C07D RESET=$C000 IRQ=$C000
|
|
; PRG mapped at $C000-$FFFF (NROM, mirrored to the upper half)
|
|
;
|
|
; Pass 1 trace provenance (the audit trail behind every classification below):
|
|
; 8 further routine entries recovered from table references elsewhere in the image:
|
|
; $CE16, $CE18, $D34A, $D40B, $D451, $D47D, $D69A, $E129
|
|
; entries seeded by hand after inspecting code-shaped but unreferenced blocks:
|
|
; $C0B6, $C5A3
|
|
; indirect dispatch through zero page (not followed statically):
|
|
; jmp ($0014) at $CDB1
|
|
;
|
|
.setcpu "6502"
|
|
|
|
.include "symbols.inc"
|
|
.include "locals.inc"
|
|
|
|
.segment "PRG"
|
|
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: Reset
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
Reset:
|
|
cld ; CPU:$C000 PRG:0000 D8
|
|
sei ; CPU:$C001 PRG:0001 78
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WaitVblank1
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WaitVblank1:
|
|
lda PPUSTATUS ; CPU:$C002 PRG:0002 AD 02 20
|
|
bpl WaitVblank1 ; CPU:$C005 PRG:0005 10 FB
|
|
ldx #$00 ; CPU:$C007 PRG:0007 A2 00
|
|
stx PPUCTRL ; CPU:$C009 PRG:0009 8E 00 20
|
|
stx PPUMASK ; CPU:$C00C PRG:000C 8E 01 20
|
|
dex ; CPU:$C00F PRG:000F CA
|
|
txs ; CPU:$C010 PRG:0010 9A
|
|
ldx Zp70 ; CPU:$C011 PRG:0011 A6 70
|
|
ldy #$06 ; CPU:$C013 PRG:0013 A0 06
|
|
sty Zp01 ; CPU:$C015 PRG:0015 84 01
|
|
ldy #$00 ; CPU:$C017 PRG:0017 A0 00
|
|
sty Zp00 ; CPU:$C019 PRG:0019 84 00
|
|
lda #$00 ; CPU:$C01B PRG:001B A9 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearRamPageLoop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearRamPageLoop:
|
|
sta (Zp00),y ; CPU:$C01D PRG:001D 91 00
|
|
dey ; CPU:$C01F PRG:001F 88
|
|
bne ClearRamPageLoop ; CPU:$C020 PRG:0020 D0 FB
|
|
dec Zp01 ; CPU:$C022 PRG:0022 C6 01
|
|
bpl ClearRamPageLoop ; CPU:$C024 PRG:0024 10 F7
|
|
txa ; CPU:$C026 PRG:0026 8A
|
|
bne ClearRamPageLoop_Loop ; CPU:$C027 PRG:0027 D0 02
|
|
ldx #$5F ; CPU:$C029 PRG:0029 A2 5F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearRamPageLoop_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearRamPageLoop_Loop:
|
|
stx $0500 ; CPU:$C02B PRG:002B 8E 00 05
|
|
jsr InitVramAddress ; CPU:$C02E PRG:002E 20 1B CA
|
|
jsr SetVramAddressF400 ; CPU:$C031 PRG:0031 20 2B CA
|
|
ldy #$00 ; CPU:$C034 PRG:0034 A0 00
|
|
sta PPUSCROLL ; CPU:$C036 PRG:0036 8D 05 20
|
|
sta PPUSCROLL ; CPU:$C039 PRG:0039 8D 05 20
|
|
iny ; CPU:$C03C PRG:003C C8
|
|
sty GameRunningFlag ; CPU:$C03D PRG:003D 84 30
|
|
lda #$0F ; CPU:$C03F PRG:003F A9 0F
|
|
sta APUSTATUS ; CPU:$C041 PRG:0041 8D 15 40
|
|
lda #$90 ; CPU:$C044 PRG:0044 A9 90
|
|
sta PPUCTRL ; CPU:$C046 PRG:0046 8D 00 20
|
|
sta Zp09 ; CPU:$C049 PRG:0049 85 09
|
|
lda #$06 ; CPU:$C04B PRG:004B A9 06
|
|
sta Zp0A ; CPU:$C04D PRG:004D 85 0A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC04F
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearFramePending:
|
|
lda #$00 ; CPU:$C04F PRG:004F A9 00
|
|
sta FramePendingFlag ; CPU:$C051 PRG:0051 85 20
|
|
lda GameRunningFlag ; CPU:$C053 PRG:0053 A5 30
|
|
beq ClearFramePending_Loop ; CPU:$C055 PRG:0055 F0 06
|
|
lda Zp50 ; CPU:$C057 PRG:0057 A5 50
|
|
cmp #$01 ; CPU:$C059 PRG:0059 C9 01
|
|
bne ClearFramePending_Loop2 ; CPU:$C05B PRG:005B D0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearFramePending_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearFramePending_Loop:
|
|
jsr NopPadding ; CPU:$C05D PRG:005D 20 A7 F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearFramePending_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearFramePending_Loop2:
|
|
jsr DecFrameCounter ; CPU:$C060 PRG:0060 20 88 CD
|
|
jsr UpdateGameplay ; CPU:$C063 PRG:0063 20 B8 C4
|
|
lda #$01 ; CPU:$C066 PRG:0066 A9 01
|
|
sta NmiPhaseFlag ; CPU:$C068 PRG:0068 85 22
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC06A
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
EndFrame:
|
|
lda FramePendingFlag ; CPU:$C06A PRG:006A A5 20
|
|
beq EndFrame_Loop ; CPU:$C06C PRG:006C F0 09
|
|
inc FrameCounter ; CPU:$C06E PRG:006E E6 2F
|
|
lda #$00 ; CPU:$C070 PRG:0070 A9 00
|
|
sta NmiPhaseFlag ; CPU:$C072 PRG:0072 85 22
|
|
jmp ClearFramePending ; CPU:$C074 PRG:0074 4C 4F C0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: EndFrame_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
EndFrame_Loop:
|
|
jsr TestRamFlagPair0500 ; CPU:$C077 PRG:0077 20 28 D3
|
|
jmp EndFrame ; CPU:$C07A PRG:007A 4C 6A C0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiHandler
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiHandler:
|
|
pha ; CPU:$C07D PRG:007D 48
|
|
txa ; CPU:$C07E PRG:007E 8A
|
|
pha ; CPU:$C07F PRG:007F 48
|
|
tya ; CPU:$C080 PRG:0080 98
|
|
pha ; CPU:$C081 PRG:0081 48
|
|
lda #$00 ; CPU:$C082 PRG:0082 A9 00
|
|
sta OAMADDR ; CPU:$C084 PRG:0084 8D 03 20
|
|
lda #$02 ; CPU:$C087 PRG:0087 A9 02
|
|
sta OAMDMA ; CPU:$C089 PRG:0089 8D 14 40
|
|
lda NmiPhaseFlag ; CPU:$C08C PRG:008C A5 22
|
|
beq NmiHandler_Loop ; CPU:$C08E PRG:008E F0 1C
|
|
jsr UpdateOamShadow ; CPU:$C090 PRG:0090 20 58 CB
|
|
jsr DrawStageText ; CPU:$C093 PRG:0093 20 6A EE
|
|
jsr DrawHudRow ; CPU:$C096 PRG:0096 20 FF CC
|
|
jsr DrawTileRow2 ; CPU:$C099 PRG:0099 20 66 CA
|
|
jsr SetScroll ; CPU:$C09C PRG:009C 20 09 CE
|
|
jsr ReadControllerPort ; CPU:$C09F PRG:009F 20 C5 CC
|
|
jsr UpdateEnemyScroll ; CPU:$C0A2 PRG:00A2 20 F7 CA
|
|
ldy #$01 ; CPU:$C0A5 PRG:00A5 A0 01
|
|
sty FramePendingFlag ; CPU:$C0A7 PRG:00A7 84 20
|
|
dey ; CPU:$C0A9 PRG:00A9 88
|
|
sty Zp42 ; CPU:$C0AA PRG:00AA 84 42
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiHandler_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiHandler_Loop:
|
|
lda #$01 ; CPU:$C0AC PRG:00AC A9 01
|
|
sta Zp23 ; CPU:$C0AE PRG:00AE 85 23
|
|
pla ; CPU:$C0B0 PRG:00B0 68
|
|
tay ; CPU:$C0B1 PRG:00B1 A8
|
|
pla ; CPU:$C0B2 PRG:00B2 68
|
|
tax ; CPU:$C0B3 PRG:00B3 AA
|
|
pla ; CPU:$C0B4 PRG:00B4 68
|
|
rti ; CPU:$C0B5 PRG:00B5 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseDispatch
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseDispatch:
|
|
lda ZpB0 ; CPU:$C0B6 PRG:00B6 A5 B0
|
|
beq NmiPhaseDispatch_Loop ; CPU:$C0B8 PRG:00B8 F0 05
|
|
lda $0320 ; CPU:$C0BA PRG:00BA AD 20 03
|
|
bne NmiPhaseDispatch_Loop2 ; CPU:$C0BD PRG:00BD D0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseDispatch_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseDispatch_Loop:
|
|
jmp NmiPhaseHandlerA ; CPU:$C0BF PRG:00BF 4C 49 C1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseDispatch_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseDispatch_Loop2:
|
|
lda #$20 ; CPU:$C0C2 PRG:00C2 A9 20
|
|
sta Zp14 ; CPU:$C0C4 PRG:00C4 85 14
|
|
lda #$03 ; CPU:$C0C6 PRG:00C6 A9 03
|
|
sta Zp15 ; CPU:$C0C8 PRG:00C8 85 15
|
|
lda #$01 ; CPU:$C0CA PRG:00CA A9 01
|
|
sta Zp11 ; CPU:$C0CC PRG:00CC 85 11
|
|
ldy #$0B ; CPU:$C0CE PRG:00CE A0 0B
|
|
ldx #$08 ; CPU:$C0D0 PRG:00D0 A2 08
|
|
jsr SetVramPointer2 ; CPU:$C0D2 PRG:00D2 20 4A C4
|
|
sta $05F7 ; CPU:$C0D5 PRG:00D5 8D F7 05
|
|
ora #$00 ; CPU:$C0D8 PRG:00D8 09 00
|
|
beq NmiPhaseHandlerA ; CPU:$C0DA PRG:00DA F0 6D
|
|
lda ZpC6 ; CPU:$C0DC PRG:00DC A5 C6
|
|
ora $0336 ; CPU:$C0DE PRG:00DE 0D 36 03
|
|
beq NmiPhaseDispatch_Loop3 ; CPU:$C0E1 PRG:00E1 F0 10
|
|
tax ; CPU:$C0E3 PRG:00E3 AA
|
|
and #$F0 ; CPU:$C0E4 PRG:00E4 29 F0
|
|
bne NmiPhaseHandlerA ; CPU:$C0E6 PRG:00E6 D0 61
|
|
txa ; CPU:$C0E8 PRG:00E8 8A
|
|
and #$0F ; CPU:$C0E9 PRG:00E9 29 0F
|
|
cmp #$04 ; CPU:$C0EB PRG:00EB C9 04
|
|
beq NmiPhaseDispatch_Loop3 ; CPU:$C0ED PRG:00ED F0 04
|
|
cmp #$08 ; CPU:$C0EF PRG:00EF C9 08
|
|
bne NmiPhaseHandlerA ; CPU:$C0F1 PRG:00F1 D0 56
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseDispatch_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseDispatch_Loop3:
|
|
lda #$00 ; CPU:$C0F3 PRG:00F3 A9 00
|
|
sta $05FE ; CPU:$C0F5 PRG:00F5 8D FE 05
|
|
lda $0321 ; CPU:$C0F8 PRG:00F8 AD 21 03
|
|
sta Zp10 ; CPU:$C0FB PRG:00FB 85 10
|
|
and #$C0 ; CPU:$C0FD PRG:00FD 29 C0
|
|
bne NmiPhaseHandlerA_Loop2 ; CPU:$C0FF PRG:00FF D0 51
|
|
lda ZpB1 ; CPU:$C101 PRG:0101 A5 B1
|
|
and #$C0 ; CPU:$C103 PRG:0103 29 C0
|
|
bne NmiPhaseHandlerA_Loop ; CPU:$C105 PRG:0105 D0 48
|
|
lda ZpB1 ; CPU:$C107 PRG:0107 A5 B1
|
|
and #$03 ; CPU:$C109 PRG:0109 29 03
|
|
beq NmiPhaseHandlerA_Loop6 ; CPU:$C10B PRG:010B F0 51
|
|
lda Zp10 ; CPU:$C10D PRG:010D A5 10
|
|
and #$03 ; CPU:$C10F PRG:010F 29 03
|
|
beq NmiPhaseHandlerA_Loop7 ; CPU:$C111 PRG:0111 F0 4E
|
|
jsr CheckFrameStarted ; CPU:$C113 PRG:0113 20 A0 C3
|
|
lda Zp10 ; CPU:$C116 PRG:0116 A5 10
|
|
and #$03 ; CPU:$C118 PRG:0118 29 03
|
|
eor ZpB1 ; CPU:$C11A PRG:011A 45 B1
|
|
and #$03 ; CPU:$C11C PRG:011C 29 03
|
|
beq HandleNmiPhase2_Loop ; CPU:$C11E PRG:011E F0 1E
|
|
lda $05F7 ; CPU:$C120 PRG:0120 AD F7 05
|
|
and #$0F ; CPU:$C123 PRG:0123 29 0F
|
|
cmp #$02 ; CPU:$C125 PRG:0125 C9 02
|
|
beq NmiPhaseDispatch_Loop4 ; CPU:$C127 PRG:0127 F0 05
|
|
lda ZpB1 ; CPU:$C129 PRG:0129 A5 B1
|
|
jmp HandleNmiPhase2 ; CPU:$C12B PRG:012B 4C 30 C1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseDispatch_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseDispatch_Loop4:
|
|
lda Zp10 ; CPU:$C12E PRG:012E A5 10
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC130
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase2:
|
|
lsr a ; CPU:$C130 PRG:0130 4A
|
|
bcc NmiPhaseHandlerA ; CPU:$C131 PRG:0131 90 16
|
|
lda ActorState ; CPU:$C133 PRG:0133 A5 C4
|
|
cmp $0334 ; CPU:$C135 PRG:0135 CD 34 03
|
|
beq NmiPhaseHandlerA_Loop5 ; CPU:$C138 PRG:0138 F0 21
|
|
bcs NmiPhaseHandlerA_Loop4 ; CPU:$C13A PRG:013A B0 1C
|
|
bcc NmiPhaseHandlerA_Loop3 ; CPU:$C13C PRG:013C 90 17
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase2_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase2_Loop:
|
|
lda $0334 ; CPU:$C13E PRG:013E AD 34 03
|
|
cmp ActorState ; CPU:$C141 PRG:0141 C5 C4
|
|
beq NmiPhaseHandlerA_Loop8 ; CPU:$C143 PRG:0143 F0 1F
|
|
bcs NmiPhaseHandlerA_Loop3 ; CPU:$C145 PRG:0145 B0 0E
|
|
bcc NmiPhaseHandlerA_Loop4 ; CPU:$C147 PRG:0147 90 0F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseHandlerA
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseHandlerA:
|
|
lda #$00 ; CPU:$C149 PRG:0149 A9 00
|
|
sta $05FF ; CPU:$C14B PRG:014B 8D FF 05
|
|
rts ; CPU:$C14E PRG:014E 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseHandlerA_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseHandlerA_Loop:
|
|
jmp HandleNmiPhase3 ; CPU:$C14F PRG:014F 4C 96 C1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseHandlerA_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseHandlerA_Loop2:
|
|
jmp HandleNmiPhase4 ; CPU:$C152 PRG:0152 4C C3 C1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseHandlerA_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseHandlerA_Loop3:
|
|
jmp HandleNmiPhase5 ; CPU:$C155 PRG:0155 4C 2D C2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseHandlerA_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseHandlerA_Loop4:
|
|
jmp HandleNmiPhase6 ; CPU:$C158 PRG:0158 4C AD C2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseHandlerA_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseHandlerA_Loop5:
|
|
jmp SetMarioSpriteFlip ; CPU:$C15B PRG:015B 4C 34 C3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseHandlerA_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseHandlerA_Loop6:
|
|
jmp HandleNmiPhase7 ; CPU:$C15E PRG:015E 4C 5B C3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseHandlerA_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseHandlerA_Loop7:
|
|
jmp HandleNmiPhase8 ; CPU:$C161 PRG:0161 4C 7D C3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseHandlerA_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseHandlerA_Loop8:
|
|
lda ZpB1 ; CPU:$C164 PRG:0164 A5 B1
|
|
ora $0321 ; CPU:$C166 PRG:0166 0D 21 03
|
|
and #$04 ; CPU:$C169 PRG:0169 29 04
|
|
bne NmiPhaseHandlerA_Loop10 ; CPU:$C16B PRG:016B D0 26
|
|
ldx #$01 ; CPU:$C16D PRG:016D A2 01
|
|
ldy #$03 ; CPU:$C16F PRG:016F A0 03
|
|
lda ZpB1 ; CPU:$C171 PRG:0171 A5 B1
|
|
and #$03 ; CPU:$C173 PRG:0173 29 03
|
|
sta Zp1D ; CPU:$C175 PRG:0175 85 1D
|
|
lda $05F7 ; CPU:$C177 PRG:0177 AD F7 05
|
|
and #$03 ; CPU:$C17A PRG:017A 29 03
|
|
cmp Zp1D ; CPU:$C17C PRG:017C C5 1D
|
|
bne NmiPhaseHandlerA_Loop9 ; CPU:$C17E PRG:017E D0 09
|
|
stx ZpC5 ; CPU:$C180 PRG:0180 86 C5
|
|
sty ZpB3 ; CPU:$C182 PRG:0182 84 B3
|
|
dex ; CPU:$C184 PRG:0184 CA
|
|
stx ActorState ; CPU:$C185 PRG:0185 86 C4
|
|
beq NmiPhaseHandlerA_Loop10 ; CPU:$C187 PRG:0187 F0 0A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseHandlerA_Loop9
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseHandlerA_Loop9:
|
|
stx $0335 ; CPU:$C189 PRG:0189 8E 35 03
|
|
sty $0323 ; CPU:$C18C PRG:018C 8C 23 03
|
|
dex ; CPU:$C18F PRG:018F CA
|
|
stx $0334 ; CPU:$C190 PRG:0190 8E 34 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NmiPhaseHandlerA_Loop10
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NmiPhaseHandlerA_Loop10:
|
|
jmp NmiPhaseHandlerA ; CPU:$C193 PRG:0193 4C 49 C1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC196
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase3:
|
|
jsr CheckFrameStarted ; CPU:$C196 PRG:0196 20 A0 C3
|
|
lda Zp10 ; CPU:$C199 PRG:0199 A5 10
|
|
and #$C0 ; CPU:$C19B PRG:019B 29 C0
|
|
beq NmiPhaseHandlerA_Loop4 ; CPU:$C19D PRG:019D F0 B9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase3_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase3_OnNonzero:
|
|
lda $05F7 ; CPU:$C19F PRG:019F AD F7 05
|
|
asl a ; CPU:$C1A2 PRG:01A2 0A
|
|
bcs HandleNmiPhase4_Loop ; CPU:$C1A3 PRG:01A3 B0 29
|
|
lda $0328 ; CPU:$C1A5 PRG:01A5 AD 28 03
|
|
sec ; CPU:$C1A8 PRG:01A8 38
|
|
sbc ActorTileIndex ; CPU:$C1A9 PRG:01A9 E5 B8
|
|
cmp #$0B ; CPU:$C1AB PRG:01AB C9 0B
|
|
bcc AdvanceFrameCounter_Loop2 ; CPU:$C1AD PRG:01AD 90 72
|
|
lda ZpB1 ; CPU:$C1AF PRG:01AF A5 B1
|
|
and #$03 ; CPU:$C1B1 PRG:01B1 29 03
|
|
bne AdvanceFrameCounter_Loop ; CPU:$C1B3 PRG:01B3 D0 5D
|
|
lda Zp10 ; CPU:$C1B5 PRG:01B5 A5 10
|
|
and #$03 ; CPU:$C1B7 PRG:01B7 29 03
|
|
bne AdvanceFrameCounter_Loop2 ; CPU:$C1B9 PRG:01B9 D0 66
|
|
lda #$01 ; CPU:$C1BB PRG:01BB A9 01
|
|
ora ZpB1 ; CPU:$C1BD PRG:01BD 05 B1
|
|
sta ZpB1 ; CPU:$C1BF PRG:01BF 85 B1
|
|
bne AdvanceFrameCounter_Loop ; CPU:$C1C1 PRG:01C1 D0 4F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC1C3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase4:
|
|
jsr CheckFrameStarted ; CPU:$C1C3 PRG:01C3 20 A0 C3
|
|
lda ZpB1 ; CPU:$C1C6 PRG:01C6 A5 B1
|
|
and #$C0 ; CPU:$C1C8 PRG:01C8 29 C0
|
|
beq NmiPhaseHandlerA_Loop3 ; CPU:$C1CA PRG:01CA F0 89
|
|
bne HandleNmiPhase3_OnNonzero ; CPU:$C1CC PRG:01CC D0 D1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase4_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase4_Loop:
|
|
lda ActorTileIndex ; CPU:$C1CE PRG:01CE A5 B8
|
|
sec ; CPU:$C1D0 PRG:01D0 38
|
|
sbc $0328 ; CPU:$C1D1 PRG:01D1 ED 28 03
|
|
cmp #$0B ; CPU:$C1D4 PRG:01D4 C9 0B
|
|
bcc AdvanceFrameCounter_Loop2 ; CPU:$C1D6 PRG:01D6 90 49
|
|
lda Zp10 ; CPU:$C1D8 PRG:01D8 A5 10
|
|
and #$03 ; CPU:$C1DA PRG:01DA 29 03
|
|
bne AdvanceFrameCounter_Loop ; CPU:$C1DC PRG:01DC D0 34
|
|
lda ZpB1 ; CPU:$C1DE PRG:01DE A5 B1
|
|
and #$03 ; CPU:$C1E0 PRG:01E0 29 03
|
|
bne AdvanceFrameCounter_Loop2 ; CPU:$C1E2 PRG:01E2 D0 3D
|
|
lda #$01 ; CPU:$C1E4 PRG:01E4 A9 01
|
|
ora Zp10 ; CPU:$C1E6 PRG:01E6 05 10
|
|
sta Zp10 ; CPU:$C1E8 PRG:01E8 85 10
|
|
bne AdvanceFrameCounter_Loop ; CPU:$C1EA PRG:01EA D0 26
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC1EC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetMarioSpriteAttrs:
|
|
lda ZpB1 ; CPU:$C1EC PRG:01EC A5 B1
|
|
and #$FC ; CPU:$C1EE PRG:01EE 29 FC
|
|
ora Zp1F ; CPU:$C1F0 PRG:01F0 05 1F
|
|
sta $0321 ; CPU:$C1F2 PRG:01F2 8D 21 03
|
|
lda Zp10 ; CPU:$C1F5 PRG:01F5 A5 10
|
|
and #$FC ; CPU:$C1F7 PRG:01F7 29 FC
|
|
ora Zp1E ; CPU:$C1F9 PRG:01F9 05 1E
|
|
sta ZpB1 ; CPU:$C1FB PRG:01FB 85 B1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC1FD
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceFrameCounter:
|
|
ldx ZpBC ; CPU:$C1FD PRG:01FD A6 BC
|
|
ldy ZpBD ; CPU:$C1FF PRG:01FF A4 BD
|
|
lda $032C ; CPU:$C201 PRG:0201 AD 2C 03
|
|
sta ZpBC ; CPU:$C204 PRG:0204 85 BC
|
|
lda $032D ; CPU:$C206 PRG:0206 AD 2D 03
|
|
sta ZpBD ; CPU:$C209 PRG:0209 85 BD
|
|
stx $032C ; CPU:$C20B PRG:020B 8E 2C 03
|
|
sty $032D ; CPU:$C20E PRG:020E 8C 2D 03
|
|
rts ; CPU:$C211 PRG:0211 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceFrameCounter_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceFrameCounter_Loop:
|
|
lda ZpB1 ; CPU:$C212 PRG:0212 A5 B1
|
|
and #$03 ; CPU:$C214 PRG:0214 29 03
|
|
sta Zp1E ; CPU:$C216 PRG:0216 85 1E
|
|
lda Zp10 ; CPU:$C218 PRG:0218 A5 10
|
|
and #$03 ; CPU:$C21A PRG:021A 29 03
|
|
sta Zp1F ; CPU:$C21C PRG:021C 85 1F
|
|
jmp SetMarioSpriteAttrs ; CPU:$C21E PRG:021E 4C EC C1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceFrameCounter_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceFrameCounter_Loop2:
|
|
lda ZpB1 ; CPU:$C221 PRG:0221 A5 B1
|
|
sta $0321 ; CPU:$C223 PRG:0223 8D 21 03
|
|
lda Zp10 ; CPU:$C226 PRG:0226 A5 10
|
|
sta ZpB1 ; CPU:$C228 PRG:0228 85 B1
|
|
jmp AdvanceFrameCounter ; CPU:$C22A PRG:022A 4C FD C1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC22D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase5:
|
|
jsr GetScrollPosition ; CPU:$C22D PRG:022D 20 1F C4
|
|
dey ; CPU:$C230 PRG:0230 88
|
|
beq HandleNmiPhase5_Loop4 ; CPU:$C231 PRG:0231 F0 4F
|
|
dey ; CPU:$C233 PRG:0233 88
|
|
beq HandleNmiPhase5_Loop ; CPU:$C234 PRG:0234 F0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase5_OnCarrySet
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase5_OnCarrySet:
|
|
ldx #$06 ; CPU:$C236 PRG:0236 A2 06
|
|
ldy #$41 ; CPU:$C238 PRG:0238 A0 41
|
|
bne HandleNmiPhase5_Loop5 ; CPU:$C23A PRG:023A D0 4A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase5_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase5_Loop:
|
|
lda ActorTileIndex ; CPU:$C23C PRG:023C A5 B8
|
|
cmp $0328 ; CPU:$C23E PRG:023E CD 28 03
|
|
bcs HandleNmiPhase5_Loop2 ; CPU:$C241 PRG:0241 B0 08
|
|
lda $05F7 ; CPU:$C243 PRG:0243 AD F7 05
|
|
lsr a ; CPU:$C246 PRG:0246 4A
|
|
bcs HandleNmiPhase5_OnCarrySet ; CPU:$C247 PRG:0247 B0 ED
|
|
bcc HandleNmiPhase5_Loop4 ; CPU:$C249 PRG:0249 90 37
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase5_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase5_Loop2:
|
|
lda #$01 ; CPU:$C24B PRG:024B A9 01
|
|
sta ZpB5 ; CPU:$C24D PRG:024D 85 B5
|
|
lda ZpBA ; CPU:$C24F PRG:024F A5 BA
|
|
jsr HideOamPair ; CPU:$C251 PRG:0251 20 F5 C3
|
|
lda #$1E ; CPU:$C254 PRG:0254 A9 1E
|
|
sta ZpB6 ; CPU:$C256 PRG:0256 85 B6
|
|
lda ZpB1 ; CPU:$C258 PRG:0258 A5 B1
|
|
ora #$08 ; CPU:$C25A PRG:025A 09 08
|
|
sta ZpB1 ; CPU:$C25C PRG:025C 85 B1
|
|
lda #$2F ; CPU:$C25E PRG:025E A9 2F
|
|
sta ActorCount ; CPU:$C260 PRG:0260 85 BB
|
|
lda Zp10 ; CPU:$C262 PRG:0262 A5 10
|
|
and #$43 ; CPU:$C264 PRG:0264 29 43
|
|
cmp #$40 ; CPU:$C266 PRG:0266 C9 40
|
|
bne HandleNmiPhase5_Loop3 ; CPU:$C268 PRG:0268 D0 04
|
|
lda #$01 ; CPU:$C26A PRG:026A A9 01
|
|
sta Zp10 ; CPU:$C26C PRG:026C 85 10
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase5_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase5_Loop3:
|
|
lda Zp10 ; CPU:$C26E PRG:026E A5 10
|
|
and #$03 ; CPU:$C270 PRG:0270 29 03
|
|
ora #$80 ; CPU:$C272 PRG:0272 09 80
|
|
sta $0321 ; CPU:$C274 PRG:0274 8D 21 03
|
|
lda #$50 ; CPU:$C277 PRG:0277 A9 50
|
|
ldy #$F3 ; CPU:$C279 PRG:0279 A0 F3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase5_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase5_OnNonzero:
|
|
sta $032C ; CPU:$C27B PRG:027B 8D 2C 03
|
|
sty $032D ; CPU:$C27E PRG:027E 8C 2D 03
|
|
rts ; CPU:$C281 PRG:0281 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase5_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase5_Loop4:
|
|
ldx #$05 ; CPU:$C282 PRG:0282 A2 05
|
|
ldy #$42 ; CPU:$C284 PRG:0284 A0 42
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase5_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase5_Loop5:
|
|
sty $0321 ; CPU:$C286 PRG:0286 8C 21 03
|
|
lda ZpB1 ; CPU:$C289 PRG:0289 A5 B1
|
|
and #$08 ; CPU:$C28B PRG:028B 29 08
|
|
bne HandleNmiPhase5_Loop6 ; CPU:$C28D PRG:028D D0 18
|
|
stx ZpB1 ; CPU:$C28F PRG:028F 86 B1
|
|
jsr SwapMarioState ; CPU:$C291 PRG:0291 20 E3 C3
|
|
lda ActorState ; CPU:$C294 PRG:0294 A5 C4
|
|
sta Zp00 ; CPU:$C296 PRG:0296 85 00
|
|
lda ZpCD ; CPU:$C298 PRG:0298 A5 CD
|
|
sta Zp01 ; CPU:$C29A PRG:029A 85 01
|
|
jsr CheckState97_02 ; CPU:$C29C PRG:029C 20 C2 C3
|
|
sta ZpC2 ; CPU:$C29F PRG:029F 85 C2
|
|
lda Zp00 ; CPU:$C2A1 PRG:02A1 A5 00
|
|
beq HandleNmiPhase5_Loop6 ; CPU:$C2A3 PRG:02A3 F0 02
|
|
sta ActorPalette ; CPU:$C2A5 PRG:02A5 85 B4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase5_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase5_Loop6:
|
|
lda #$3A ; CPU:$C2A7 PRG:02A7 A9 3A
|
|
ldy #$F3 ; CPU:$C2A9 PRG:02A9 A0 F3
|
|
bne HandleNmiPhase5_OnNonzero ; CPU:$C2AB PRG:02AB D0 CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC2AD
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase6:
|
|
jsr GetScrollDelta ; CPU:$C2AD PRG:02AD 20 29 C4
|
|
dey ; CPU:$C2B0 PRG:02B0 88
|
|
beq HandleNmiPhase6_Loop4 ; CPU:$C2B1 PRG:02B1 F0 51
|
|
dey ; CPU:$C2B3 PRG:02B3 88
|
|
beq HandleNmiPhase6_Loop ; CPU:$C2B4 PRG:02B4 F0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase6_OnCarryClear
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase6_OnCarryClear:
|
|
ldx #$06 ; CPU:$C2B6 PRG:02B6 A2 06
|
|
ldy #$41 ; CPU:$C2B8 PRG:02B8 A0 41
|
|
bne HandleNmiPhase6_Loop5 ; CPU:$C2BA PRG:02BA D0 4C
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase6_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase6_Loop:
|
|
lda $0328 ; CPU:$C2BC PRG:02BC AD 28 03
|
|
cmp ActorTileIndex ; CPU:$C2BF PRG:02BF C5 B8
|
|
bcs HandleNmiPhase6_Loop2 ; CPU:$C2C1 PRG:02C1 B0 08
|
|
lda $05F7 ; CPU:$C2C3 PRG:02C3 AD F7 05
|
|
lsr a ; CPU:$C2C6 PRG:02C6 4A
|
|
bcs HandleNmiPhase6_Loop4 ; CPU:$C2C7 PRG:02C7 B0 3B
|
|
bcc HandleNmiPhase6_OnCarryClear ; CPU:$C2C9 PRG:02C9 90 EB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase6_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase6_Loop2:
|
|
lda #$01 ; CPU:$C2CB PRG:02CB A9 01
|
|
sta $0325 ; CPU:$C2CD PRG:02CD 8D 25 03
|
|
lda $032A ; CPU:$C2D0 PRG:02D0 AD 2A 03
|
|
jsr HideOamPair ; CPU:$C2D3 PRG:02D3 20 F5 C3
|
|
lda #$1E ; CPU:$C2D6 PRG:02D6 A9 1E
|
|
sta $0326 ; CPU:$C2D8 PRG:02D8 8D 26 03
|
|
lda Zp10 ; CPU:$C2DB PRG:02DB A5 10
|
|
ora #$08 ; CPU:$C2DD PRG:02DD 09 08
|
|
sta $0321 ; CPU:$C2DF PRG:02DF 8D 21 03
|
|
lda #$2F ; CPU:$C2E2 PRG:02E2 A9 2F
|
|
sta $032B ; CPU:$C2E4 PRG:02E4 8D 2B 03
|
|
lda ZpB1 ; CPU:$C2E7 PRG:02E7 A5 B1
|
|
and #$43 ; CPU:$C2E9 PRG:02E9 29 43
|
|
cmp #$40 ; CPU:$C2EB PRG:02EB C9 40
|
|
bne HandleNmiPhase6_Loop3 ; CPU:$C2ED PRG:02ED D0 04
|
|
lda #$01 ; CPU:$C2EF PRG:02EF A9 01
|
|
sta ZpB1 ; CPU:$C2F1 PRG:02F1 85 B1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase6_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase6_Loop3:
|
|
lda ZpB1 ; CPU:$C2F3 PRG:02F3 A5 B1
|
|
and #$03 ; CPU:$C2F5 PRG:02F5 29 03
|
|
ora #$80 ; CPU:$C2F7 PRG:02F7 09 80
|
|
sta ZpB1 ; CPU:$C2F9 PRG:02F9 85 B1
|
|
lda #$50 ; CPU:$C2FB PRG:02FB A9 50
|
|
ldy #$F3 ; CPU:$C2FD PRG:02FD A0 F3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase6_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase6_OnNonzero:
|
|
sta ZpBC ; CPU:$C2FF PRG:02FF 85 BC
|
|
sty ZpBD ; CPU:$C301 PRG:0301 84 BD
|
|
rts ; CPU:$C303 PRG:0303 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase6_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase6_Loop4:
|
|
ldx #$05 ; CPU:$C304 PRG:0304 A2 05
|
|
ldy #$42 ; CPU:$C306 PRG:0306 A0 42
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase6_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase6_Loop5:
|
|
sty ZpB1 ; CPU:$C308 PRG:0308 84 B1
|
|
lda $0321 ; CPU:$C30A PRG:030A AD 21 03
|
|
and #$08 ; CPU:$C30D PRG:030D 29 08
|
|
bne HandleNmiPhase6_Loop6 ; CPU:$C30F PRG:030F D0 1D
|
|
stx $0321 ; CPU:$C311 PRG:0311 8E 21 03
|
|
jsr SwapMarioState ; CPU:$C314 PRG:0314 20 E3 C3
|
|
lda $0334 ; CPU:$C317 PRG:0317 AD 34 03
|
|
sta Zp00 ; CPU:$C31A PRG:031A 85 00
|
|
lda $033D ; CPU:$C31C PRG:031C AD 3D 03
|
|
sta Zp01 ; CPU:$C31F PRG:031F 85 01
|
|
jsr CheckState97_02 ; CPU:$C321 PRG:0321 20 C2 C3
|
|
sta $0332 ; CPU:$C324 PRG:0324 8D 32 03
|
|
lda Zp00 ; CPU:$C327 PRG:0327 A5 00
|
|
beq HandleNmiPhase6_Loop6 ; CPU:$C329 PRG:0329 F0 03
|
|
sta $0324 ; CPU:$C32B PRG:032B 8D 24 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase6_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase6_Loop6:
|
|
lda #$3A ; CPU:$C32E PRG:032E A9 3A
|
|
ldy #$F3 ; CPU:$C330 PRG:0330 A0 F3
|
|
bne HandleNmiPhase6_OnNonzero ; CPU:$C332 PRG:0332 D0 CB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC334
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetMarioSpriteFlip:
|
|
lda ZpB1 ; CPU:$C334 PRG:0334 A5 B1
|
|
ora #$04 ; CPU:$C336 PRG:0336 09 04
|
|
sta $0321 ; CPU:$C338 PRG:0338 8D 21 03
|
|
lda Zp10 ; CPU:$C33B PRG:033B A5 10
|
|
ora #$04 ; CPU:$C33D PRG:033D 09 04
|
|
sta ZpB1 ; CPU:$C33F PRG:033F 85 B1
|
|
lda ActorState ; CPU:$C341 PRG:0341 A5 C4
|
|
sta Zp00 ; CPU:$C343 PRG:0343 85 00
|
|
lda ZpCD ; CPU:$C345 PRG:0345 A5 CD
|
|
sta Zp01 ; CPU:$C347 PRG:0347 85 01
|
|
jsr CheckState97_02 ; CPU:$C349 PRG:0349 20 C2 C3
|
|
sta ZpC2 ; CPU:$C34C PRG:034C 85 C2
|
|
sta $0332 ; CPU:$C34E PRG:034E 8D 32 03
|
|
lda Zp00 ; CPU:$C351 PRG:0351 A5 00
|
|
beq SetMarioSpriteFlip_Loop ; CPU:$C353 PRG:0353 F0 05
|
|
sta ActorPalette ; CPU:$C355 PRG:0355 85 B4
|
|
sta $0324 ; CPU:$C357 PRG:0357 8D 24 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetMarioSpriteFlip_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetMarioSpriteFlip_Loop:
|
|
rts ; CPU:$C35A PRG:035A 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC35B
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase7:
|
|
jsr GetScrollPosition ; CPU:$C35B PRG:035B 20 1F C4
|
|
lda Zp10 ; CPU:$C35E PRG:035E A5 10
|
|
and #$03 ; CPU:$C360 PRG:0360 29 03
|
|
dey ; CPU:$C362 PRG:0362 88
|
|
beq HandleNmiPhase7_Loop ; CPU:$C363 PRG:0363 F0 11
|
|
cmp #$02 ; CPU:$C365 PRG:0365 C9 02
|
|
bne HandleNmiPhase7_Loop2 ; CPU:$C367 PRG:0367 D0 11
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase7_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase7_OnZero:
|
|
lda #$06 ; CPU:$C369 PRG:0369 A9 06
|
|
sta ActorPalette ; CPU:$C36B PRG:036B 85 B4
|
|
ldx #$10 ; CPU:$C36D PRG:036D A2 10
|
|
ldy #$0D ; CPU:$C36F PRG:036F A0 0D
|
|
lda Zp10 ; CPU:$C371 PRG:0371 A5 10
|
|
jmp SetMarioDirection ; CPU:$C373 PRG:0373 4C 02 C4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase7_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase7_Loop:
|
|
cmp #$01 ; CPU:$C376 PRG:0376 C9 01
|
|
beq HandleNmiPhase7_OnZero ; CPU:$C378 PRG:0378 F0 EF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase7_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase7_Loop2:
|
|
jmp InitFrameState ; CPU:$C37A PRG:037A 4C A8 C3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC37D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase8:
|
|
jsr GetScrollDelta ; CPU:$C37D PRG:037D 20 29 C4
|
|
lda ZpB1 ; CPU:$C380 PRG:0380 A5 B1
|
|
and #$03 ; CPU:$C382 PRG:0382 29 03
|
|
dey ; CPU:$C384 PRG:0384 88
|
|
beq HandleNmiPhase8_Loop ; CPU:$C385 PRG:0385 F0 12
|
|
cmp #$02 ; CPU:$C387 PRG:0387 C9 02
|
|
bne HandleNmiPhase8_Loop2 ; CPU:$C389 PRG:0389 D0 12
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase8_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase8_OnZero:
|
|
lda #$06 ; CPU:$C38B PRG:038B A9 06
|
|
sta $0324 ; CPU:$C38D PRG:038D 8D 24 03
|
|
ldx #$0D ; CPU:$C390 PRG:0390 A2 0D
|
|
ldy #$10 ; CPU:$C392 PRG:0392 A0 10
|
|
lda ZpB1 ; CPU:$C394 PRG:0394 A5 B1
|
|
jmp SetMarioDirection ; CPU:$C396 PRG:0396 4C 02 C4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase8_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase8_Loop:
|
|
cmp #$01 ; CPU:$C399 PRG:0399 C9 01
|
|
beq HandleNmiPhase8_OnZero ; CPU:$C39B PRG:039B F0 EE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleNmiPhase8_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleNmiPhase8_Loop2:
|
|
jmp InitFrameState ; CPU:$C39D PRG:039D 4C A8 C3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC3A0
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckFrameStarted:
|
|
lda $05FF ; CPU:$C3A0 PRG:03A0 AD FF 05
|
|
beq InitFrameState ; CPU:$C3A3 PRG:03A3 F0 03
|
|
pla ; CPU:$C3A5 PRG:03A5 68
|
|
pla ; CPU:$C3A6 PRG:03A6 68
|
|
rts ; CPU:$C3A7 PRG:03A7 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC3A8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitFrameState:
|
|
ldy #$00 ; CPU:$C3A8 PRG:03A8 A0 00
|
|
sty ZpC1 ; CPU:$C3AA PRG:03AA 84 C1
|
|
sty $0331 ; CPU:$C3AC PRG:03AC 8C 31 03
|
|
iny ; CPU:$C3AF PRG:03AF C8
|
|
sty $05FF ; CPU:$C3B0 PRG:03B0 8C FF 05
|
|
ldy ActorCount ; CPU:$C3B3 PRG:03B3 A4 BB
|
|
bne InitFrameState_Loop ; CPU:$C3B5 PRG:03B5 D0 02
|
|
sta ActorCount ; CPU:$C3B7 PRG:03B7 85 BB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitFrameState_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitFrameState_Loop:
|
|
ldy $032B ; CPU:$C3B9 PRG:03B9 AC 2B 03
|
|
bne InitFrameState_Loop2 ; CPU:$C3BC PRG:03BC D0 03
|
|
sta $032B ; CPU:$C3BE PRG:03BE 8D 2B 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitFrameState_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitFrameState_Loop2:
|
|
rts ; CPU:$C3C1 PRG:03C1 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckState97_02
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckState97_02:
|
|
lda Zp01 ; CPU:$C3C2 PRG:03C2 A5 01
|
|
cmp #$97 ; CPU:$C3C4 PRG:03C4 C9 97
|
|
beq CheckState97_02_Loop2 ; CPU:$C3C6 PRG:03C6 F0 14
|
|
lda Zp00 ; CPU:$C3C8 PRG:03C8 A5 00
|
|
cmp #$02 ; CPU:$C3CA PRG:03CA C9 02
|
|
bne CheckState97_02_Loop ; CPU:$C3CC PRG:03CC D0 07
|
|
lda #$06 ; CPU:$C3CE PRG:03CE A9 06
|
|
sta Zp00 ; CPU:$C3D0 PRG:03D0 85 00
|
|
lda #$08 ; CPU:$C3D2 PRG:03D2 A9 08
|
|
rts ; CPU:$C3D4 PRG:03D4 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckState97_02_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckState97_02_Loop:
|
|
lda #$00 ; CPU:$C3D5 PRG:03D5 A9 00
|
|
sta Zp00 ; CPU:$C3D7 PRG:03D7 85 00
|
|
lda #$05 ; CPU:$C3D9 PRG:03D9 A9 05
|
|
rts ; CPU:$C3DB PRG:03DB 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckState97_02_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckState97_02_Loop2:
|
|
lda #$06 ; CPU:$C3DC PRG:03DC A9 06
|
|
sta Zp00 ; CPU:$C3DE PRG:03DE 85 00
|
|
lda #$1C ; CPU:$C3E0 PRG:03E0 A9 1C
|
|
rts ; CPU:$C3E2 PRG:03E2 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC3E3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SwapMarioState:
|
|
lda ActorState ; CPU:$C3E3 PRG:03E3 A5 C4
|
|
pha ; CPU:$C3E5 PRG:03E5 48
|
|
lda $0334 ; CPU:$C3E6 PRG:03E6 AD 34 03
|
|
sta ActorState ; CPU:$C3E9 PRG:03E9 85 C4
|
|
pla ; CPU:$C3EB PRG:03EB 68
|
|
sta $0334 ; CPU:$C3EC PRG:03EC 8D 34 03
|
|
lda #$01 ; CPU:$C3EF PRG:03EF A9 01
|
|
sta $05FD ; CPU:$C3F1 PRG:03F1 8D FD 05
|
|
rts ; CPU:$C3F4 PRG:03F4 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC3F5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HideOamPair:
|
|
clc ; CPU:$C3F5 PRG:03F5 18
|
|
adc #$10 ; CPU:$C3F6 PRG:03F6 69 10
|
|
tay ; CPU:$C3F8 PRG:03F8 A8
|
|
lda #$F4 ; CPU:$C3F9 PRG:03F9 A9 F4
|
|
sta $0200,y ; CPU:$C3FB PRG:03FB 99 00 02
|
|
sta $0204,y ; CPU:$C3FE PRG:03FE 99 04 02
|
|
rts ; CPU:$C401 PRG:0401 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC402
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetMarioDirection:
|
|
and #$03 ; CPU:$C402 PRG:0402 29 03
|
|
ora #$04 ; CPU:$C404 PRG:0404 09 04
|
|
sta ZpB1 ; CPU:$C406 PRG:0406 85 B1
|
|
sta $0321 ; CPU:$C408 PRG:0408 8D 21 03
|
|
stx ZpC2 ; CPU:$C40B PRG:040B 86 C2
|
|
sty $0332 ; CPU:$C40D PRG:040D 8C 32 03
|
|
ldy #$00 ; CPU:$C410 PRG:0410 A0 00
|
|
sty ActorState ; CPU:$C412 PRG:0412 84 C4
|
|
sty $0334 ; CPU:$C414 PRG:0414 8C 34 03
|
|
sty $05FE ; CPU:$C417 PRG:0417 8C FE 05
|
|
iny ; CPU:$C41A PRG:041A C8
|
|
sty $05FD ; CPU:$C41B PRG:041B 8C FD 05
|
|
rts ; CPU:$C41E PRG:041E 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC41F
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
GetScrollPosition:
|
|
lda $0329 ; CPU:$C41F PRG:041F AD 29 03
|
|
sta Zp1F ; CPU:$C422 PRG:0422 85 1F
|
|
lda ScrollX ; CPU:$C424 PRG:0424 A5 B9
|
|
jmp SubScrollDelta ; CPU:$C426 PRG:0426 4C 30 C4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC429
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
GetScrollDelta:
|
|
lda ScrollX ; CPU:$C429 PRG:0429 A5 B9
|
|
sta Zp1F ; CPU:$C42B PRG:042B 85 1F
|
|
lda $0329 ; CPU:$C42D PRG:042D AD 29 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC430
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SubScrollDelta:
|
|
sec ; CPU:$C430 PRG:0430 38
|
|
sbc Zp1F ; CPU:$C431 PRG:0431 E5 1F
|
|
bpl SubScrollDelta_Loop ; CPU:$C433 PRG:0433 10 07
|
|
cmp #$FB ; CPU:$C435 PRG:0435 C9 FB
|
|
bcs SubScrollDelta_Loop2 ; CPU:$C437 PRG:0437 B0 07
|
|
ldy #$03 ; CPU:$C439 PRG:0439 A0 03
|
|
rts ; CPU:$C43B PRG:043B 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubScrollDelta_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SubScrollDelta_Loop:
|
|
cmp #$05 ; CPU:$C43C PRG:043C C9 05
|
|
bcs SubScrollDelta_Loop3 ; CPU:$C43E PRG:043E B0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubScrollDelta_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SubScrollDelta_Loop2:
|
|
ldy #$02 ; CPU:$C440 PRG:0440 A0 02
|
|
rts ; CPU:$C442 PRG:0442 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubScrollDelta_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SubScrollDelta_Loop3:
|
|
ldy #$01 ; CPU:$C443 PRG:0443 A0 01
|
|
rts ; CPU:$C445 PRG:0445 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC446
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramPointer:
|
|
ldy #$00 ; CPU:$C446 PRG:0446 A0 00
|
|
ldx #$00 ; CPU:$C448 PRG:0448 A2 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC44A
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramPointer2:
|
|
sty Zp1C ; CPU:$C44A PRG:044A 84 1C
|
|
stx Zp1D ; CPU:$C44C PRG:044C 86 1D
|
|
lda #$20 ; CPU:$C44E PRG:044E A9 20
|
|
sta Zp12 ; CPU:$C450 PRG:0450 85 12
|
|
lda #$00 ; CPU:$C452 PRG:0452 A9 00
|
|
sta Zp13 ; CPU:$C454 PRG:0454 85 13
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramPointer2_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramPointer2_OnNonzero:
|
|
ldy #$00 ; CPU:$C456 PRG:0456 A0 00
|
|
lda (Zp14),y ; CPU:$C458 PRG:0458 B1 14
|
|
beq SetVramPointer2_Loop3 ; CPU:$C45A PRG:045A F0 52
|
|
ldx #$40 ; CPU:$C45C PRG:045C A2 40
|
|
ldy #$08 ; CPU:$C45E PRG:045E A0 08
|
|
lda (Zp14),y ; CPU:$C460 PRG:0460 B1 14
|
|
sec ; CPU:$C462 PRG:0462 38
|
|
sbc ActorTileIndex ; CPU:$C463 PRG:0463 E5 B8
|
|
bpl SetVramPointer2_Loop ; CPU:$C465 PRG:0465 10 07
|
|
eor #$FF ; CPU:$C467 PRG:0467 49 FF
|
|
clc ; CPU:$C469 PRG:0469 18
|
|
adc #$01 ; CPU:$C46A PRG:046A 69 01
|
|
ldx #$80 ; CPU:$C46C PRG:046C A2 80
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramPointer2_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramPointer2_Loop:
|
|
stx Zp1F ; CPU:$C46E PRG:046E 86 1F
|
|
pha ; CPU:$C470 PRG:0470 48
|
|
ldy #$1E ; CPU:$C471 PRG:0471 A0 1E
|
|
lda (Zp14),y ; CPU:$C473 PRG:0473 B1 14
|
|
clc ; CPU:$C475 PRG:0475 18
|
|
adc ZpCE ; CPU:$C476 PRG:0476 65 CE
|
|
adc Zp1D ; CPU:$C478 PRG:0478 65 1D
|
|
sta Zp1E ; CPU:$C47A PRG:047A 85 1E
|
|
pla ; CPU:$C47C PRG:047C 68
|
|
sec ; CPU:$C47D PRG:047D 38
|
|
sbc Zp1E ; CPU:$C47E PRG:047E E5 1E
|
|
bpl SetVramPointer2_Loop3 ; CPU:$C480 PRG:0480 10 2C
|
|
ldx #$01 ; CPU:$C482 PRG:0482 A2 01
|
|
ldy #$09 ; CPU:$C484 PRG:0484 A0 09
|
|
lda (Zp14),y ; CPU:$C486 PRG:0486 B1 14
|
|
sec ; CPU:$C488 PRG:0488 38
|
|
sbc ScrollX ; CPU:$C489 PRG:0489 E5 B9
|
|
bpl SetVramPointer2_Loop2 ; CPU:$C48B PRG:048B 10 07
|
|
eor #$FF ; CPU:$C48D PRG:048D 49 FF
|
|
clc ; CPU:$C48F PRG:048F 18
|
|
adc #$01 ; CPU:$C490 PRG:0490 69 01
|
|
ldx #$02 ; CPU:$C492 PRG:0492 A2 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramPointer2_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramPointer2_Loop2:
|
|
pha ; CPU:$C494 PRG:0494 48
|
|
txa ; CPU:$C495 PRG:0495 8A
|
|
ora Zp1F ; CPU:$C496 PRG:0496 05 1F
|
|
sta Zp1F ; CPU:$C498 PRG:0498 85 1F
|
|
ldy #$1F ; CPU:$C49A PRG:049A A0 1F
|
|
lda (Zp14),y ; CPU:$C49C PRG:049C B1 14
|
|
clc ; CPU:$C49E PRG:049E 18
|
|
adc ZpCF ; CPU:$C49F PRG:049F 65 CF
|
|
adc Zp1C ; CPU:$C4A1 PRG:04A1 65 1C
|
|
sta Zp1E ; CPU:$C4A3 PRG:04A3 85 1E
|
|
pla ; CPU:$C4A5 PRG:04A5 68
|
|
sec ; CPU:$C4A6 PRG:04A6 38
|
|
sbc Zp1E ; CPU:$C4A7 PRG:04A7 E5 1E
|
|
bpl SetVramPointer2_Loop3 ; CPU:$C4A9 PRG:04A9 10 03
|
|
lda Zp1F ; CPU:$C4AB PRG:04AB A5 1F
|
|
rts ; CPU:$C4AD PRG:04AD 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramPointer2_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramPointer2_Loop3:
|
|
jsr AdvanceDispatchPointer ; CPU:$C4AE PRG:04AE 20 B4 CD
|
|
dec Zp11 ; CPU:$C4B1 PRG:04B1 C6 11
|
|
bne SetVramPointer2_OnNonzero ; CPU:$C4B3 PRG:04B3 D0 A1
|
|
lda #$00 ; CPU:$C4B5 PRG:04B5 A9 00
|
|
rts ; CPU:$C4B7 PRG:04B7 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC4B8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateGameplay:
|
|
lda GameRunningFlag ; CPU:$C4B8 PRG:04B8 A5 30
|
|
bne UpdateGameplay_Loop6 ; CPU:$C4BA PRG:04BA D0 6C
|
|
lda Zp18 ; CPU:$C4BC PRG:04BC A5 18
|
|
and #$10 ; CPU:$C4BE PRG:04BE 29 10
|
|
beq UpdateGameplay_Loop4 ; CPU:$C4C0 PRG:04C0 F0 45
|
|
ldy ModeIndex ; CPU:$C4C2 PRG:04C2 A4 26
|
|
bne UpdateGameplay_Loop5 ; CPU:$C4C4 PRG:04C4 D0 45
|
|
iny ; CPU:$C4C6 PRG:04C6 C8
|
|
sty ModeIndex ; CPU:$C4C7 PRG:04C7 84 26
|
|
ldy Zp40 ; CPU:$C4C9 PRG:04C9 A4 40
|
|
cpy #$05 ; CPU:$C4CB PRG:04CB C0 05
|
|
beq UpdateGameplay_Loop2 ; CPU:$C4CD PRG:04CD F0 2A
|
|
cpy #$04 ; CPU:$C4CF PRG:04CF C0 04
|
|
beq UpdateGameplay_Loop ; CPU:$C4D1 PRG:04D1 F0 04
|
|
cpy #$06 ; CPU:$C4D3 PRG:04D3 C0 06
|
|
bne UpdateGameplay_Loop5 ; CPU:$C4D5 PRG:04D5 D0 34
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateGameplay_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateGameplay_Loop:
|
|
ldx #$05 ; CPU:$C4D7 PRG:04D7 A2 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateGameplay_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateGameplay_OnNonnegative:
|
|
lda FrameCountdown,x ; CPU:$C4D9 PRG:04D9 B5 2A
|
|
sta Zp5A,x ; CPU:$C4DB PRG:04DB 95 5A
|
|
dex ; CPU:$C4DD PRG:04DD CA
|
|
bpl UpdateGameplay_OnNonnegative ; CPU:$C4DE PRG:04DE 10 F9
|
|
lda Zp0A ; CPU:$C4E0 PRG:04E0 A5 0A
|
|
and #$0E ; CPU:$C4E2 PRG:04E2 29 0E
|
|
sta PPUMASK ; CPU:$C4E4 PRG:04E4 8D 01 20
|
|
sta Zp0A ; CPU:$C4E7 PRG:04E7 85 0A
|
|
sty Zp3B ; CPU:$C4E9 PRG:04E9 84 3B
|
|
lda #$05 ; CPU:$C4EB PRG:04EB A9 05
|
|
sta Zp40 ; CPU:$C4ED PRG:04ED 85 40
|
|
lda #$00 ; CPU:$C4EF PRG:04EF A9 00
|
|
sta ZpFF ; CPU:$C4F1 PRG:04F1 85 FF
|
|
sta ZpFE ; CPU:$C4F3 PRG:04F3 85 FE
|
|
sta ZpFC ; CPU:$C4F5 PRG:04F5 85 FC
|
|
beq UpdateGameplay_Loop3 ; CPU:$C4F7 PRG:04F7 F0 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateGameplay_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateGameplay_Loop2:
|
|
lda #$14 ; CPU:$C4F9 PRG:04F9 A9 14
|
|
sta Zp2B ; CPU:$C4FB PRG:04FB 85 2B
|
|
lda #$0A ; CPU:$C4FD PRG:04FD A9 0A
|
|
sta Zp40 ; CPU:$C4FF PRG:04FF 85 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateGameplay_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateGameplay_Loop3:
|
|
lda #$08 ; CPU:$C501 PRG:0501 A9 08
|
|
sta ZpFD ; CPU:$C503 PRG:0503 85 FD
|
|
bne UpdateGameplay_Loop5 ; CPU:$C505 PRG:0505 D0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateGameplay_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateGameplay_Loop4:
|
|
lda #$00 ; CPU:$C507 PRG:0507 A9 00
|
|
sta ModeIndex ; CPU:$C509 PRG:0509 85 26
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateGameplay_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateGameplay_Loop5:
|
|
lda Zp40 ; CPU:$C50B PRG:050B A5 40
|
|
jsr DispatchViaStackPointer ; CPU:$C50D PRG:050D 20 9E CD
|
|
; ---- data $C510-$C51D (14 bytes) ----
|
|
GameStateHandlerTable:
|
|
.byte $4A, $D3, $4A, $E1, $F9, $D3, $A8, $D3, $A3, $C5, $E5, $D5, $53, $E4 ; CPU:$C510 PRG:0510 4A D3 4A E1 F9 D3 A8 D3 A3 C5 E5 D5 53 E4
|
|
sbc $D5 ; CPU:$C51E PRG:051E E5 D5
|
|
; ---- data $C520-$C524 (5 bytes) ----
|
|
GameStateHandlerTable2:
|
|
.byte $51, $D4, $29, $E1, $5C ; CPU:$C520 PRG:0520 51 D4 29 E1 5C
|
|
.byte $D4, $8B ; CPU:$C525 PRG:0525 D4 8B -- nop Zp8B,x (undocumented; ca65 cannot encode)
|
|
; ---- data $C527-$C527 (1 bytes) ----
|
|
GameStateHandlerTable3:
|
|
.byte $E2 ; CPU:$C527 PRG:0527 E2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateGameplay_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateGameplay_Loop6:
|
|
lda Zp18 ; CPU:$C528 PRG:0528 A5 18
|
|
and #$30 ; CPU:$C52A PRG:052A 29 30
|
|
cmp #$10 ; CPU:$C52C PRG:052C C9 10
|
|
bne UpdateGameplay_Loop7 ; CPU:$C52E PRG:052E D0 13
|
|
lda #$00 ; CPU:$C530 PRG:0530 A9 00
|
|
sta GameRunningFlag ; CPU:$C532 PRG:0532 85 30
|
|
sta Zp40 ; CPU:$C534 PRG:0534 85 40
|
|
jsr ClearActorCounters ; CPU:$C536 PRG:0536 20 FE D4
|
|
jsr DisableBackgroundAndSprites ; CPU:$C539 PRG:0539 20 32 E1
|
|
lda #$02 ; CPU:$C53C PRG:053C A9 02
|
|
sta FrameCountdown ; CPU:$C53E PRG:053E 85 2A
|
|
sta ActorIndex ; CPU:$C540 PRG:0540 85 2D
|
|
rts ; CPU:$C542 PRG:0542 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateGameplay_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateGameplay_Loop7:
|
|
ldx Zp50 ; CPU:$C543 PRG:0543 A6 50
|
|
beq StartEnemyAction_Loop3 ; CPU:$C545 PRG:0545 F0 47
|
|
cmp #$20 ; CPU:$C547 PRG:0547 C9 20
|
|
bne UpdateGameplay_Loop10 ; CPU:$C549 PRG:0549 D0 1D
|
|
cpx #$01 ; CPU:$C54B PRG:054B E0 01
|
|
bne UpdateGameplay_Loop9 ; CPU:$C54D PRG:054D D0 12
|
|
lda ActorActionFlag ; CPU:$C54F PRG:054F A5 28
|
|
bne StartEnemyAction_Loop ; CPU:$C551 PRG:0551 D0 21
|
|
ldy Zp29 ; CPU:$C553 PRG:0553 A4 29
|
|
iny ; CPU:$C555 PRG:0555 C8
|
|
cpy #$04 ; CPU:$C556 PRG:0556 C0 04
|
|
bne UpdateGameplay_Loop8 ; CPU:$C558 PRG:0558 D0 02
|
|
ldy #$00 ; CPU:$C55A PRG:055A A0 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateGameplay_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateGameplay_Loop8:
|
|
sty Zp29 ; CPU:$C55C PRG:055C 84 29
|
|
jmp StartEnemyAction ; CPU:$C55E PRG:055E 4C 70 C5
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateGameplay_Loop9
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateGameplay_Loop9:
|
|
jsr ClearActorCounters ; CPU:$C561 PRG:0561 20 FE D4
|
|
sta Zp50 ; CPU:$C564 PRG:0564 85 50
|
|
beq StartEnemyAction_Loop3 ; CPU:$C566 PRG:0566 F0 26
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateGameplay_Loop10
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateGameplay_Loop10:
|
|
cmp #$00 ; CPU:$C568 PRG:0568 C9 00
|
|
bne StartEnemyAction ; CPU:$C56A PRG:056A D0 04
|
|
sta ActorActionFlag ; CPU:$C56C PRG:056C 85 28
|
|
beq StartEnemyAction_Loop2 ; CPU:$C56E PRG:056E F0 0E
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC570
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StartEnemyAction:
|
|
lda #$01 ; CPU:$C570 PRG:0570 A9 01
|
|
sta ActorActionFlag ; CPU:$C572 PRG:0572 85 28
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StartEnemyAction_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StartEnemyAction_Loop:
|
|
lda ActorIndex ; CPU:$C574 PRG:0574 A5 2D
|
|
cmp #$25 ; CPU:$C576 PRG:0576 C9 25
|
|
bcs StartEnemyAction_Loop2 ; CPU:$C578 PRG:0578 B0 04
|
|
lda #$25 ; CPU:$C57A PRG:057A A9 25
|
|
sta ActorIndex ; CPU:$C57C PRG:057C 85 2D
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StartEnemyAction_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StartEnemyAction_Loop2:
|
|
cpx #$01 ; CPU:$C57E PRG:057E E0 01
|
|
bne StartEnemyAction_Loop3 ; CPU:$C580 PRG:0580 D0 0C
|
|
lda Zp29 ; CPU:$C582 PRG:0582 A5 29
|
|
asl a ; CPU:$C584 PRG:0584 0A
|
|
asl a ; CPU:$C585 PRG:0585 0A
|
|
asl a ; CPU:$C586 PRG:0586 0A
|
|
asl a ; CPU:$C587 PRG:0587 0A
|
|
clc ; CPU:$C588 PRG:0588 18
|
|
adc #$80 ; CPU:$C589 PRG:0589 69 80
|
|
sta $0200 ; CPU:$C58B PRG:058B 8D 00 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StartEnemyAction_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StartEnemyAction_Loop3:
|
|
lda Zp50 ; CPU:$C58E PRG:058E A5 50
|
|
jsr DispatchViaStackPointer ; CPU:$C590 PRG:0590 20 9E CD
|
|
.byte $0B, $D4 ; CPU:$C593 PRG:0593 0B D4 -- anc #$D4 (undocumented; ca65 cannot encode)
|
|
; ---- data $C595-$C596 (2 bytes) ----
|
|
GameStateHandlerTable4:
|
|
.byte $7D, $D4 ; CPU:$C595 PRG:0595 7D D4
|
|
sta ($D4),y ; CPU:$C597 PRG:0597 91 D4
|
|
; ---- data $C599-$C599 (1 bytes) ----
|
|
GameStateHandlerTable5:
|
|
.byte $96 ; CPU:$C599 PRG:0599 96
|
|
.byte $D4, $9B ; CPU:$C59A PRG:059A D4 9B -- nop Zp9B,x (undocumented; ca65 cannot encode)
|
|
.byte $D4, $A0 ; CPU:$C59C PRG:059C D4 A0 -- nop ZpA0,x (undocumented; ca65 cannot encode)
|
|
.byte $D4, $AF ; CPU:$C59E PRG:059E D4 AF -- nop ZpAF,x (undocumented; ca65 cannot encode)
|
|
.byte $D4, $48 ; CPU:$C5A0 PRG:05A0 D4 48 -- nop Zp48,x (undocumented; ca65 cannot encode)
|
|
; ---- data $C5A2-$C5A2 (1 bytes) ----
|
|
GameStateHandlerTable6:
|
|
.byte $D4 ; CPU:$C5A2 PRG:05A2 D4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: JsrThunkTable
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
JsrThunkTable:
|
|
jsr CheckScriptCommand ; CPU:$C5A3 PRG:05A3 20 6E D5
|
|
jsr SelectEnemyFrame ; CPU:$C5A6 PRG:05A6 20 02 D2
|
|
jsr CheckMarioAlive ; CPU:$C5A9 PRG:05A9 20 01 D3
|
|
jsr InitEnemyScript ; CPU:$C5AC PRG:05AC 20 DB C5
|
|
jsr ClearEnemyPosition ; CPU:$C5AF PRG:05AF 20 6A C6
|
|
jsr CopyEnemyTileTable ; CPU:$C5B2 PRG:05B2 20 83 E7
|
|
jsr CheckStageFlag ; CPU:$C5B5 PRG:05B5 20 31 EA
|
|
jsr CheckStageReady ; CPU:$C5B8 PRG:05B8 20 95 E7
|
|
jsr CheckStageTimer ; CPU:$C5BB PRG:05BB 20 EB ED
|
|
jsr CheckStageStarted ; CPU:$C5BE PRG:05BE 20 AB E2
|
|
jsr RunScriptBlock ; CPU:$C5C1 PRG:05C1 20 1A E2
|
|
jsr CheckStageComplete ; CPU:$C5C4 PRG:05C4 20 F7 E1
|
|
jsr CheckEnemyVisible ; CPU:$C5C7 PRG:05C7 20 F8 DF
|
|
jsr CheckEnemyScriptFlag ; CPU:$C5CA PRG:05CA 20 CE E1
|
|
jsr AdvanceEnemyTimerB ; CPU:$C5CD PRG:05CD 20 6D E2
|
|
jsr CountDownStageTimer ; CPU:$C5D0 PRG:05D0 20 09 E7
|
|
jsr DecEnemyCounter ; CPU:$C5D3 PRG:05D3 20 32 EF
|
|
lda #$01 ; CPU:$C5D6 PRG:05D6 A9 01
|
|
sta Zp42 ; CPU:$C5D8 PRG:05D8 85 42
|
|
rts ; CPU:$C5DA PRG:05DA 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC5DB
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScript:
|
|
lda #$00 ; CPU:$C5DB PRG:05DB A9 00
|
|
sta ScriptPtrLo ; CPU:$C5DD PRG:05DD 85 A0
|
|
lda #$03 ; CPU:$C5DF PRG:05DF A9 03
|
|
sta ScriptPtrHi ; CPU:$C5E1 PRG:05E1 85 A1
|
|
lda #$02 ; CPU:$C5E3 PRG:05E3 A9 02
|
|
sta ScriptStepCounter ; CPU:$C5E5 PRG:05E5 85 33
|
|
lda #$00 ; CPU:$C5E7 PRG:05E7 A9 00
|
|
sta ScriptStep ; CPU:$C5E9 PRG:05E9 85 A2
|
|
sta $05FA ; CPU:$C5EB PRG:05EB 8D FA 05
|
|
lda Zp19 ; CPU:$C5EE PRG:05EE A5 19
|
|
sta $0310 ; CPU:$C5F0 PRG:05F0 8D 10 03
|
|
lda Zp1B ; CPU:$C5F3 PRG:05F3 A5 1B
|
|
sta $0330 ; CPU:$C5F5 PRG:05F5 8D 30 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScript_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScript_OnNonzero:
|
|
jsr SetupScriptPointerA ; CPU:$C5F8 PRG:05F8 20 9B CB
|
|
lda ZpB0 ; CPU:$C5FB PRG:05FB A5 B0
|
|
bne InitEnemyScript_Loop ; CPU:$C5FD PRG:05FD D0 06
|
|
jsr AdvanceEnemyFrameCounter ; CPU:$C5FF PRG:05FF 20 BA DF
|
|
jmp RunEnemyScriptEnd ; CPU:$C602 PRG:0602 4C 5D C6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScript_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScript_Loop:
|
|
jsr CheckEnemyTileRangeB ; CPU:$C605 PRG:0605 20 19 D0
|
|
ldx ZpBE ; CPU:$C608 PRG:0608 A6 BE
|
|
inc $04AC,x ; CPU:$C60A PRG:060A FE AC 04
|
|
inc $04AC,x ; CPU:$C60D PRG:060D FE AC 04
|
|
lda ZpC6 ; CPU:$C610 PRG:0610 A5 C6
|
|
beq InitEnemyScript_Loop4 ; CPU:$C612 PRG:0612 F0 22
|
|
and #$F0 ; CPU:$C614 PRG:0614 29 F0
|
|
bne InitEnemyScript_Loop2 ; CPU:$C616 PRG:0616 D0 11
|
|
lda Zp51 ; CPU:$C618 PRG:0618 A5 51
|
|
bne InitEnemyScript_Loop3 ; CPU:$C61A PRG:061A D0 10
|
|
jsr CheckEnemyScroll ; CPU:$C61C PRG:061C 20 EC DE
|
|
lda ZpC6 ; CPU:$C61F PRG:061F A5 C6
|
|
beq InitEnemyScript_Loop4 ; CPU:$C621 PRG:0621 F0 13
|
|
and #$0C ; CPU:$C623 PRG:0623 29 0C
|
|
bne InitEnemyScript_Loop4 ; CPU:$C625 PRG:0625 D0 0F
|
|
beq InitEnemyScript_Loop3 ; CPU:$C627 PRG:0627 F0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScript_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScript_Loop2:
|
|
jsr CheckEnemyState ; CPU:$C629 PRG:0629 20 E0 DD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScript_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScript_Loop3:
|
|
jsr AdvanceEnemyFrameCounter ; CPU:$C62C PRG:062C 20 BA DF
|
|
jmp RunEnemyScript ; CPU:$C62F PRG:062F 4C 57 C6
|
|
; ---- data $C632-$C635 (4 bytes) ----
|
|
ReadActorFlag51:
|
|
.byte $A5, $51, $D0, $F6 ; CPU:$C632 PRG:0632 A5 51 D0 F6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScript_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScript_Loop4:
|
|
lda ScriptStepCounter ; CPU:$C636 PRG:0636 A5 33
|
|
cmp #$02 ; CPU:$C638 PRG:0638 C9 02
|
|
bne InitEnemyScript_Loop5 ; CPU:$C63A PRG:063A D0 03
|
|
jsr NmiPhaseDispatch ; CPU:$C63C PRG:063C 20 B6 C0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScript_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScript_Loop5:
|
|
lda $05FD ; CPU:$C63F PRG:063F AD FD 05
|
|
beq InitEnemyScript_Loop6 ; CPU:$C642 PRG:0642 F0 03
|
|
jsr DispatchTableF393 ; CPU:$C644 PRG:0644 20 B9 CA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScript_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScript_Loop6:
|
|
lda Zp51 ; CPU:$C647 PRG:0647 A5 51
|
|
bne InitEnemyScript_Loop3 ; CPU:$C649 PRG:0649 D0 E1
|
|
jsr CheckEnemyType ; CPU:$C64B PRG:064B 20 BA D6
|
|
jsr CheckEnemyType30 ; CPU:$C64E PRG:064E 20 85 C7
|
|
jsr CheckEnemyTileRange ; CPU:$C651 PRG:0651 20 3F CC
|
|
jsr SetEnemyVramPointer ; CPU:$C654 PRG:0654 20 75 DC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC657
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunEnemyScript:
|
|
jsr SetScriptTableBase ; CPU:$C657 PRG:0657 20 C4 CB
|
|
jsr SetupScriptPointerB ; CPU:$C65A PRG:065A 20 B6 CB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC65D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunEnemyScriptEnd:
|
|
jsr AdvanceScriptPointer ; CPU:$C65D PRG:065D 20 AE CB
|
|
dec ScriptStepCounter ; CPU:$C660 PRG:0660 C6 33
|
|
bne InitEnemyScript_OnNonzero ; CPU:$C662 PRG:0662 D0 94
|
|
lda #$00 ; CPU:$C664 PRG:0664 A9 00
|
|
sta $05FD ; CPU:$C666 PRG:0666 8D FD 05
|
|
rts ; CPU:$C669 PRG:0669 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC66A
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearEnemyPosition:
|
|
lda Zp43 ; CPU:$C66A PRG:066A A5 43
|
|
bne ClearEnemyPosition_Loop ; CPU:$C66C PRG:066C D0 01
|
|
rts ; CPU:$C66E PRG:066E 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearEnemyPosition_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearEnemyPosition_Loop:
|
|
sta ActorYPosition ; CPU:$C66F PRG:066F 85 45
|
|
sta Zp44 ; CPU:$C671 PRG:0671 85 44
|
|
sta ScriptStepCounter ; CPU:$C673 PRG:0673 85 33
|
|
lda #$60 ; CPU:$C675 PRG:0675 A9 60
|
|
sta ScriptPtrLo ; CPU:$C677 PRG:0677 85 A0
|
|
lda #$03 ; CPU:$C679 PRG:0679 A9 03
|
|
sta ScriptPtrHi ; CPU:$C67B PRG:067B 85 A1
|
|
lda #$00 ; CPU:$C67D PRG:067D A9 00
|
|
sta ScriptStep ; CPU:$C67F PRG:067F 85 A2
|
|
lda #$0D ; CPU:$C681 PRG:0681 A9 0D
|
|
sta $05FA ; CPU:$C683 PRG:0683 8D FA 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC686
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
MoveEnemyDown:
|
|
jsr SetupScriptPointerA ; CPU:$C686 PRG:0686 20 9B CB
|
|
lda ZpB0 ; CPU:$C689 PRG:0689 A5 B0
|
|
bne MoveEnemyDown_Loop ; CPU:$C68B PRG:068B D0 0A
|
|
dec ActorYPosition ; CPU:$C68D PRG:068D C6 45
|
|
dec Zp44 ; CPU:$C68F PRG:068F C6 44
|
|
jsr AdvanceSpriteCounter ; CPU:$C691 PRG:0691 20 BD DF
|
|
jmp RunEnemyScriptC ; CPU:$C694 PRG:0694 4C 5D C7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: MoveEnemyDown_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
MoveEnemyDown_Loop:
|
|
jsr CheckEnemyTileRangeB ; CPU:$C697 PRG:0697 20 19 D0
|
|
ldx ZpBE ; CPU:$C69A PRG:069A A6 BE
|
|
inc $04AC,x ; CPU:$C69C PRG:069C FE AC 04
|
|
lda Zp51 ; CPU:$C69F PRG:069F A5 51
|
|
beq MoveEnemyDown_Loop2 ; CPU:$C6A1 PRG:06A1 F0 19
|
|
lda ZpC0 ; CPU:$C6A3 PRG:06A3 A5 C0
|
|
bne MoveEnemyDown_Loop2 ; CPU:$C6A5 PRG:06A5 D0 15
|
|
lda ActorCommand ; CPU:$C6A7 PRG:06A7 A5 BF
|
|
cmp #$40 ; CPU:$C6A9 PRG:06A9 C9 40
|
|
beq CheckEnemyCollision_Loop ; CPU:$C6AB PRG:06AB F0 1C
|
|
cmp #$80 ; CPU:$C6AD PRG:06AD C9 80
|
|
bne MoveEnemyDown_Loop2 ; CPU:$C6AF PRG:06AF D0 0B
|
|
lda #$00 ; CPU:$C6B1 PRG:06B1 A9 00
|
|
sta $04C0 ; CPU:$C6B3 PRG:06B3 8D C0 04
|
|
lda #$9E ; CPU:$C6B6 PRG:06B6 A9 9E
|
|
ldy #$F5 ; CPU:$C6B8 PRG:06B8 A0 F5
|
|
bne CheckEnemyCollision_Loop2 ; CPU:$C6BA PRG:06BA D0 11
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: MoveEnemyDown_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
MoveEnemyDown_Loop2:
|
|
jmp HandleEnemyType80 ; CPU:$C6BC PRG:06BC 4C EC EC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC6BF
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCollision:
|
|
lda ZpC9 ; CPU:$C6BF PRG:06BF A5 C9
|
|
beq CheckEnemyCollision_Loop4 ; CPU:$C6C1 PRG:06C1 F0 26
|
|
lda ActorCommand ; CPU:$C6C3 PRG:06C3 A5 BF
|
|
cmp #$40 ; CPU:$C6C5 PRG:06C5 C9 40
|
|
bne CheckEnemyCollision_Loop3 ; CPU:$C6C7 PRG:06C7 D0 17
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyCollision_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCollision_Loop:
|
|
lda #$A4 ; CPU:$C6C9 PRG:06C9 A9 A4
|
|
ldy #$F5 ; CPU:$C6CB PRG:06CB A0 F5
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyCollision_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCollision_Loop2:
|
|
sta Zp06 ; CPU:$C6CD PRG:06CD 85 06
|
|
sty Zp07 ; CPU:$C6CF PRG:06CF 84 07
|
|
lda #$30 ; CPU:$C6D1 PRG:06D1 A9 30
|
|
sta Zp00 ; CPU:$C6D3 PRG:06D3 85 00
|
|
jsr SpawnEnemySprites ; CPU:$C6D5 PRG:06D5 20 89 D7
|
|
lda #$00 ; CPU:$C6D8 PRG:06D8 A9 00
|
|
sta ZpC9 ; CPU:$C6DA PRG:06DA 85 C9
|
|
sta ZpC2 ; CPU:$C6DC PRG:06DC 85 C2
|
|
beq ResolveEnemyCollision_Loop3 ; CPU:$C6DE PRG:06DE F0 64
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyCollision_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCollision_Loop3:
|
|
jsr CheckEnemyCollisionB ; CPU:$C6E0 PRG:06E0 20 AF DE
|
|
jsr AdvanceSpriteCounter ; CPU:$C6E3 PRG:06E3 20 BD DF
|
|
jmp UpdateEnemyScript ; CPU:$C6E6 PRG:06E6 4C 47 C7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyCollision_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCollision_Loop4:
|
|
jsr CheckEnemyType ; CPU:$C6E9 PRG:06E9 20 BA D6
|
|
jsr DecEnemyScriptCounter ; CPU:$C6EC PRG:06EC 20 53 DB
|
|
jsr CheckEnemySpawnBlocked ; CPU:$C6EF PRG:06EF 20 FF DB
|
|
lda ZpC0 ; CPU:$C6F2 PRG:06F2 A5 C0
|
|
bne CheckEnemyCollision_Loop5 ; CPU:$C6F4 PRG:06F4 D0 06
|
|
jsr CheckEnemySpawn ; CPU:$C6F6 PRG:06F6 20 FE D9
|
|
jmp ResolveEnemyCollision ; CPU:$C6F9 PRG:06F9 4C 08 C7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyCollision_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCollision_Loop5:
|
|
lda ZpC0 ; CPU:$C6FC PRG:06FC A5 C0
|
|
and #$0F ; CPU:$C6FE PRG:06FE 29 0F
|
|
cmp #$03 ; CPU:$C700 PRG:0700 C9 03
|
|
beq ResolveEnemyCollision_Loop3 ; CPU:$C702 PRG:0702 F0 40
|
|
cmp #$06 ; CPU:$C704 PRG:0704 C9 06
|
|
beq ResolveEnemyCollision_Loop3 ; CPU:$C706 PRG:0706 F0 3C
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC708
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResolveEnemyCollision:
|
|
jsr DecEnemyTimer ; CPU:$C708 PRG:0708 20 2D DB
|
|
lda ZpC0 ; CPU:$C70B PRG:070B A5 C0
|
|
ora ZpC2 ; CPU:$C70D PRG:070D 05 C2
|
|
bne ResolveEnemyCollision_Loop2 ; CPU:$C70F PRG:070F D0 2A
|
|
lda ActorXPosition ; CPU:$C711 PRG:0711 A5 46
|
|
beq ResolveEnemyCollision_Loop2 ; CPU:$C713 PRG:0713 F0 26
|
|
lda ActorCommand ; CPU:$C715 PRG:0715 A5 BF
|
|
ldy #$05 ; CPU:$C717 PRG:0717 A0 05
|
|
ldx #$06 ; CPU:$C719 PRG:0719 A2 06
|
|
cmp #$20 ; CPU:$C71B PRG:071B C9 20
|
|
beq ResolveEnemyCollision_Loop ; CPU:$C71D PRG:071D F0 08
|
|
ldy #$02 ; CPU:$C71F PRG:071F A0 02
|
|
ldx #$02 ; CPU:$C721 PRG:0721 A2 02
|
|
cmp #$10 ; CPU:$C723 PRG:0723 C9 10
|
|
bne ResolveEnemyCollision_Loop2 ; CPU:$C725 PRG:0725 D0 14
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResolveEnemyCollision_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResolveEnemyCollision_Loop:
|
|
sty ActorState ; CPU:$C727 PRG:0727 84 C4
|
|
stx ActorCount ; CPU:$C729 PRG:0729 86 BB
|
|
jsr DispatchTableF393 ; CPU:$C72B PRG:072B 20 B9 CA
|
|
jsr FindFreeEnemySlot ; CPU:$C72E PRG:072E 20 B6 D9
|
|
lda ActorCommand ; CPU:$C731 PRG:0731 A5 BF
|
|
cmp #$10 ; CPU:$C733 PRG:0733 C9 10
|
|
bne ResolveEnemyCollision_Loop2 ; CPU:$C735 PRG:0735 D0 04
|
|
lda #$00 ; CPU:$C737 PRG:0737 A9 00
|
|
sta ZpC7 ; CPU:$C739 PRG:0739 85 C7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResolveEnemyCollision_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResolveEnemyCollision_Loop2:
|
|
lda ZpB3 ; CPU:$C73B PRG:073B A5 B3
|
|
cmp #$05 ; CPU:$C73D PRG:073D C9 05
|
|
bcs ResolveEnemyCollision_Loop3 ; CPU:$C73F PRG:073F B0 03
|
|
jsr CheckEnemyType30 ; CPU:$C741 PRG:0741 20 85 C7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResolveEnemyCollision_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResolveEnemyCollision_Loop3:
|
|
jsr AddEnemyTileOffset ; CPU:$C744 PRG:0744 20 73 CC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC747
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemyScript:
|
|
jsr SetScriptTableBase ; CPU:$C747 PRG:0747 20 C4 CB
|
|
lda ZpB0 ; CPU:$C74A PRG:074A A5 B0
|
|
beq UpdateEnemyScript_Loop ; CPU:$C74C PRG:074C F0 0A
|
|
lda ZpC9 ; CPU:$C74E PRG:074E A5 C9
|
|
bne UpdateEnemyScript_Loop ; CPU:$C750 PRG:0750 D0 06
|
|
lda ActorCommand ; CPU:$C752 PRG:0752 A5 BF
|
|
cmp #$40 ; CPU:$C754 PRG:0754 C9 40
|
|
bcc RunEnemyScriptB ; CPU:$C756 PRG:0756 90 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemyScript_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemyScript_Loop:
|
|
dec Zp44 ; CPU:$C758 PRG:0758 C6 44
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC75A
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunEnemyScriptB:
|
|
jsr SetupScriptPointerB ; CPU:$C75A PRG:075A 20 B6 CB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC75D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunEnemyScriptC:
|
|
jsr AdvanceScriptPointer ; CPU:$C75D PRG:075D 20 AE CB
|
|
dec ScriptStepCounter ; CPU:$C760 PRG:0760 C6 33
|
|
bne RunEnemyScriptC_Loop3 ; CPU:$C762 PRG:0762 D0 1E
|
|
lda ScriptCommand ; CPU:$C764 PRG:0764 A5 35
|
|
cmp #$AA ; CPU:$C766 PRG:0766 C9 AA
|
|
bne RunEnemyScriptC_Loop2 ; CPU:$C768 PRG:0768 D0 17
|
|
lda ActorYPosition ; CPU:$C76A PRG:076A A5 45
|
|
bne RunEnemyScriptC_Loop ; CPU:$C76C PRG:076C D0 07
|
|
sta Zp43 ; CPU:$C76E PRG:076E 85 43
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RunEnemyScriptC_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunEnemyScriptC_OnZero:
|
|
lda #$01 ; CPU:$C770 PRG:0770 A9 01
|
|
sta Zp51 ; CPU:$C772 PRG:0772 85 51
|
|
rts ; CPU:$C774 PRG:0774 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RunEnemyScriptC_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunEnemyScriptC_Loop:
|
|
lda Zp44 ; CPU:$C775 PRG:0775 A5 44
|
|
beq RunEnemyScriptC_OnZero ; CPU:$C777 PRG:0777 F0 F7
|
|
cmp #$01 ; CPU:$C779 PRG:0779 C9 01
|
|
bne RunEnemyScriptC_Loop2 ; CPU:$C77B PRG:077B D0 04
|
|
lda #$01 ; CPU:$C77D PRG:077D A9 01
|
|
sta ActorXPosition ; CPU:$C77F PRG:077F 85 46
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RunEnemyScriptC_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunEnemyScriptC_Loop2:
|
|
rts ; CPU:$C781 PRG:0781 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RunEnemyScriptC_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunEnemyScriptC_Loop3:
|
|
jmp MoveEnemyDown ; CPU:$C782 PRG:0782 4C 86 C6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC785
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType30:
|
|
lda ActorCommand ; CPU:$C785 PRG:0785 A5 BF
|
|
cmp #$30 ; CPU:$C787 PRG:0787 C9 30
|
|
bne CheckEnemyType30_Loop4 ; CPU:$C789 PRG:0789 D0 2C
|
|
lda ZpC0 ; CPU:$C78B PRG:078B A5 C0
|
|
bne CheckEnemyType30_Loop ; CPU:$C78D PRG:078D D0 03
|
|
jsr LoadEnemyTileIndex ; CPU:$C78F PRG:078F 20 9C CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType30_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType30_Loop:
|
|
lda ZpB3 ; CPU:$C792 PRG:0792 A5 B3
|
|
beq CheckEnemyType30_Loop2 ; CPU:$C794 PRG:0794 F0 01
|
|
rts ; CPU:$C796 PRG:0796 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType30_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType30_Loop2:
|
|
lda ZpC0 ; CPU:$C797 PRG:0797 A5 C0
|
|
bne CheckEnemyType30_Loop4 ; CPU:$C799 PRG:0799 D0 1C
|
|
lda ZpB1 ; CPU:$C79B PRG:079B A5 B1
|
|
and #$C0 ; CPU:$C79D PRG:079D 29 C0
|
|
bne CheckEnemyType30_Loop4 ; CPU:$C79F PRG:079F D0 16
|
|
lda ZpB1 ; CPU:$C7A1 PRG:07A1 A5 B1
|
|
ora #$80 ; CPU:$C7A3 PRG:07A3 09 80
|
|
sta ZpB1 ; CPU:$C7A5 PRG:07A5 85 B1
|
|
ldx #$6D ; CPU:$C7A7 PRG:07A7 A2 6D
|
|
ldy #$F3 ; CPU:$C7A9 PRG:07A9 A0 F3
|
|
lda ZpBE ; CPU:$C7AB PRG:07AB A5 BE
|
|
bne CheckEnemyType30_Loop3 ; CPU:$C7AD PRG:07AD D0 04
|
|
ldx #$70 ; CPU:$C7AF PRG:07AF A2 70
|
|
ldy #$F3 ; CPU:$C7B1 PRG:07B1 A0 F3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType30_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType30_Loop3:
|
|
stx ZpBC ; CPU:$C7B3 PRG:07B3 86 BC
|
|
sty ZpBD ; CPU:$C7B5 PRG:07B5 84 BD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType30_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType30_Loop4:
|
|
lda ZpB1 ; CPU:$C7B7 PRG:07B7 A5 B1
|
|
sta Zp11 ; CPU:$C7B9 PRG:07B9 85 11
|
|
jsr PushTablePointerDispatch ; CPU:$C7BB PRG:07BB 20 A0 CC
|
|
bit Zp11 ; CPU:$C7BE PRG:07BE 24 11
|
|
bmi CheckEnemyType30_Loop5 ; CPU:$C7C0 PRG:07C0 30 05
|
|
bvs CheckEnemyType30_Loop6 ; CPU:$C7C2 PRG:07C2 70 06
|
|
jmp DispatchEnemyBehaviour ; CPU:$C7C4 PRG:07C4 4C CD C7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType30_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType30_Loop5:
|
|
jmp CheckEnemyScriptCommand ; CPU:$C7C7 PRG:07C7 4C 3A C9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType30_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType30_Loop6:
|
|
jmp ReadEnemyTileIndex ; CPU:$C7CA PRG:07CA 4C A1 C9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC7CD
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviour:
|
|
lda ActorCommand ; CPU:$C7CD PRG:07CD A5 BF
|
|
and #$F0 ; CPU:$C7CF PRG:07CF 29 F0
|
|
beq DispatchEnemyBehaviour_Loop ; CPU:$C7D1 PRG:07D1 F0 07
|
|
lda ZpC2 ; CPU:$C7D3 PRG:07D3 A5 C2
|
|
beq DispatchEnemyBehaviour_Loop2 ; CPU:$C7D5 PRG:07D5 F0 07
|
|
jmp DispatchEnemyBehaviourB ; CPU:$C7D7 PRG:07D7 4C D1 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviour_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviour_Loop:
|
|
lda ZpC6 ; CPU:$C7DA PRG:07DA A5 C6
|
|
bne DispatchEnemyBehaviour_Loop4 ; CPU:$C7DC PRG:07DC D0 15
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviour_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviour_Loop2:
|
|
lda ZpCD ; CPU:$C7DE PRG:07DE A5 CD
|
|
jsr CheckRangeReturn012 ; CPU:$C7E0 PRG:07E0 20 A4 CA
|
|
and #$0F ; CPU:$C7E3 PRG:07E3 29 0F
|
|
bne DispatchEnemyBehaviour_Loop3 ; CPU:$C7E5 PRG:07E5 D0 03
|
|
jmp HandleEnemyCommand30 ; CPU:$C7E7 PRG:07E7 4C 7D C9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviour_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviour_Loop3:
|
|
lda ActorCommand ; CPU:$C7EA PRG:07EA A5 BF
|
|
and #$0F ; CPU:$C7EC PRG:07EC 29 0F
|
|
bne DispatchEnemyBehaviour_Loop4 ; CPU:$C7EE PRG:07EE D0 03
|
|
jmp DispatchEnemyBehaviourB ; CPU:$C7F0 PRG:07F0 4C D1 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviour_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviour_Loop4:
|
|
lda ZpC2 ; CPU:$C7F3 PRG:07F3 A5 C2
|
|
beq DispatchEnemyBehaviour_Loop5 ; CPU:$C7F5 PRG:07F5 F0 02
|
|
dec ZpC2 ; CPU:$C7F7 PRG:07F7 C6 C2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviour_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviour_Loop5:
|
|
lda ZpB1 ; CPU:$C7F9 PRG:07F9 A5 B1
|
|
and #$08 ; CPU:$C7FB PRG:07FB 29 08
|
|
bne DispatchEnemyBehaviour_Loop9 ; CPU:$C7FD PRG:07FD D0 70
|
|
lda ZpC0 ; CPU:$C7FF PRG:07FF A5 C0
|
|
bpl DispatchEnemyBehaviour_Loop6 ; CPU:$C801 PRG:0801 10 21
|
|
lda ZpFF ; CPU:$C803 PRG:0803 A5 FF
|
|
ora #$20 ; CPU:$C805 PRG:0805 09 20
|
|
sta ZpFF ; CPU:$C807 PRG:0807 85 FF
|
|
lda ZpB1 ; CPU:$C809 PRG:0809 A5 B1
|
|
and #$33 ; CPU:$C80B PRG:080B 29 33
|
|
ora #$80 ; CPU:$C80D PRG:080D 09 80
|
|
sta ZpB1 ; CPU:$C80F PRG:080F 85 B1
|
|
lda #$50 ; CPU:$C811 PRG:0811 A9 50
|
|
sta ZpBC ; CPU:$C813 PRG:0813 85 BC
|
|
lda #$F3 ; CPU:$C815 PRG:0815 A9 F3
|
|
sta ZpBD ; CPU:$C817 PRG:0817 85 BD
|
|
lda #$18 ; CPU:$C819 PRG:0819 A9 18
|
|
sta ZpB6 ; CPU:$C81B PRG:081B 85 B6
|
|
lda #$00 ; CPU:$C81D PRG:081D A9 00
|
|
sta ActorPalette ; CPU:$C81F PRG:081F 85 B4
|
|
jmp DispatchEnemyBehaviourD ; CPU:$C821 PRG:0821 4C E6 C9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviour_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviour_Loop6:
|
|
and #$03 ; CPU:$C824 PRG:0824 29 03
|
|
sta Zp1E ; CPU:$C826 PRG:0826 85 1E
|
|
lda ZpB1 ; CPU:$C828 PRG:0828 A5 B1
|
|
sta Zp1F ; CPU:$C82A PRG:082A 85 1F
|
|
and #$04 ; CPU:$C82C PRG:082C 29 04
|
|
bne ClearEnemyFlag_Loop3 ; CPU:$C82E PRG:082E D0 7D
|
|
lda ZpB1 ; CPU:$C830 PRG:0830 A5 B1
|
|
and #$03 ; CPU:$C832 PRG:0832 29 03
|
|
sta Zp1F ; CPU:$C834 PRG:0834 85 1F
|
|
beq ClearEnemyFlag_Loop ; CPU:$C836 PRG:0836 F0 59
|
|
ldy $05FF ; CPU:$C838 PRG:0838 AC FF 05
|
|
bne SetEnemyStateFromScroll ; CPU:$C83B PRG:083B D0 78
|
|
and Zp1E ; CPU:$C83D PRG:083D 25 1E
|
|
beq DispatchEnemyBehaviour_Loop7 ; CPU:$C83F PRG:083F F0 12
|
|
lda ZpC2 ; CPU:$C841 PRG:0841 A5 C2
|
|
bne SetEnemyStateFromScroll ; CPU:$C843 PRG:0843 D0 70
|
|
sta ActorCount ; CPU:$C845 PRG:0845 85 BB
|
|
inc ActorState ; CPU:$C847 PRG:0847 E6 C4
|
|
jsr DispatchTableF393 ; CPU:$C849 PRG:0849 20 B9 CA
|
|
lda #$08 ; CPU:$C84C PRG:084C A9 08
|
|
sta ZpC2 ; CPU:$C84E PRG:084E 85 C2
|
|
jmp SetEnemyStateFromScroll ; CPU:$C850 PRG:0850 4C B5 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviour_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviour_Loop7:
|
|
lda Zp1F ; CPU:$C853 PRG:0853 A5 1F
|
|
ora #$04 ; CPU:$C855 PRG:0855 09 04
|
|
sta Zp1F ; CPU:$C857 PRG:0857 85 1F
|
|
lda ActorState ; CPU:$C859 PRG:0859 A5 C4
|
|
sta Zp00 ; CPU:$C85B PRG:085B 85 00
|
|
lda ZpCD ; CPU:$C85D PRG:085D A5 CD
|
|
sta Zp01 ; CPU:$C85F PRG:085F 85 01
|
|
jsr CheckState97_02 ; CPU:$C861 PRG:0861 20 C2 C3
|
|
sta ZpC2 ; CPU:$C864 PRG:0864 85 C2
|
|
lda Zp00 ; CPU:$C866 PRG:0866 A5 00
|
|
beq DispatchEnemyBehaviour_Loop8 ; CPU:$C868 PRG:0868 F0 02
|
|
sta ActorPalette ; CPU:$C86A PRG:086A 85 B4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviour_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviour_Loop8:
|
|
jmp SetEnemyStateFromScroll ; CPU:$C86C PRG:086C 4C B5 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviour_Loop9
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviour_Loop9:
|
|
dec ActorCount ; CPU:$C86F PRG:086F C6 BB
|
|
beq ClearEnemyFlag ; CPU:$C871 PRG:0871 F0 11
|
|
ldy #$22 ; CPU:$C873 PRG:0873 A0 22
|
|
lda ActorCount ; CPU:$C875 PRG:0875 A5 BB
|
|
cmp #$20 ; CPU:$C877 PRG:0877 C9 20
|
|
beq DispatchEnemyBehaviour_Loop10 ; CPU:$C879 PRG:0879 F0 06
|
|
ldy #$1E ; CPU:$C87B PRG:087B A0 1E
|
|
cmp #$10 ; CPU:$C87D PRG:087D C9 10
|
|
bne DispatchEnemyBehaviour_Loop11 ; CPU:$C87F PRG:087F D0 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviour_Loop10
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviour_Loop10:
|
|
sty ZpB6 ; CPU:$C881 PRG:0881 84 B6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviour_Loop11
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviour_Loop11:
|
|
rts ; CPU:$C883 PRG:0883 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC884
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearEnemyFlag:
|
|
lda #$00 ; CPU:$C884 PRG:0884 A9 00
|
|
sta ZpB5 ; CPU:$C886 PRG:0886 85 B5
|
|
lda ZpB1 ; CPU:$C888 PRG:0888 A5 B1
|
|
and #$F7 ; CPU:$C88A PRG:088A 29 F7
|
|
sta ZpB1 ; CPU:$C88C PRG:088C 85 B1
|
|
jmp ResetActorState ; CPU:$C88E PRG:088E 4C BA CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearEnemyFlag_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearEnemyFlag_Loop:
|
|
lda Zp1E ; CPU:$C891 PRG:0891 A5 1E
|
|
bne ClearEnemyFlag_Loop2 ; CPU:$C893 PRG:0893 D0 0F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearEnemyFlag_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearEnemyFlag_OnZero:
|
|
lda #$00 ; CPU:$C895 PRG:0895 A9 00
|
|
sta ActorState ; CPU:$C897 PRG:0897 85 C4
|
|
sta ActorCount ; CPU:$C899 PRG:0899 85 BB
|
|
jsr DispatchTableF393 ; CPU:$C89B PRG:089B 20 B9 CA
|
|
jsr ResetActorState ; CPU:$C89E PRG:089E 20 BA CE
|
|
jmp SetEnemyStateFromScroll ; CPU:$C8A1 PRG:08A1 4C B5 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearEnemyFlag_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearEnemyFlag_Loop2:
|
|
lda #$05 ; CPU:$C8A4 PRG:08A4 A9 05
|
|
sta ZpC2 ; CPU:$C8A6 PRG:08A6 85 C2
|
|
lda Zp1E ; CPU:$C8A8 PRG:08A8 A5 1E
|
|
jmp SetEnemyState ; CPU:$C8AA PRG:08AA 4C B7 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearEnemyFlag_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearEnemyFlag_Loop3:
|
|
lda ZpC2 ; CPU:$C8AD PRG:08AD A5 C2
|
|
bne SetEnemyStateFromScroll ; CPU:$C8AF PRG:08AF D0 04
|
|
sta Zp1F ; CPU:$C8B1 PRG:08B1 85 1F
|
|
beq ClearEnemyFlag_OnZero ; CPU:$C8B3 PRG:08B3 F0 E0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC8B5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyStateFromScroll:
|
|
lda Zp1F ; CPU:$C8B5 PRG:08B5 A5 1F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC8B7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyState:
|
|
sta ZpB1 ; CPU:$C8B7 PRG:08B7 85 B1
|
|
sta Zp11 ; CPU:$C8B9 PRG:08B9 85 11
|
|
lda ZpB6 ; CPU:$C8BB PRG:08BB A5 B6
|
|
cmp #$0C ; CPU:$C8BD PRG:08BD C9 0C
|
|
bne SetEnemyState_Loop ; CPU:$C8BF PRG:08BF D0 06
|
|
lda ZpFF ; CPU:$C8C1 PRG:08C1 A5 FF
|
|
ora #$80 ; CPU:$C8C3 PRG:08C3 09 80
|
|
bne SetEnemyState_Loop2 ; CPU:$C8C5 PRG:08C5 D0 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyState_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyState_Loop:
|
|
cmp #$26 ; CPU:$C8C7 PRG:08C7 C9 26
|
|
bne DispatchEnemyBehaviourB ; CPU:$C8C9 PRG:08C9 D0 06
|
|
lda ZpFF ; CPU:$C8CB PRG:08CB A5 FF
|
|
ora #$40 ; CPU:$C8CD PRG:08CD 09 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyState_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyState_Loop2:
|
|
sta ZpFF ; CPU:$C8CF PRG:08CF 85 FF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC8D1
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourB:
|
|
lda ActorCommand ; CPU:$C8D1 PRG:08D1 A5 BF
|
|
cmp #$40 ; CPU:$C8D3 PRG:08D3 C9 40
|
|
bcc HandleEnemyBehaviour_Loop2 ; CPU:$C8D5 PRG:08D5 90 0D
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC8D7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyBehaviour:
|
|
lda ZpC6 ; CPU:$C8D7 PRG:08D7 A5 C6
|
|
bne HandleEnemyBehaviour_Loop ; CPU:$C8D9 PRG:08D9 D0 03
|
|
jsr LoadYFromZpB4 ; CPU:$C8DB PRG:08DB 20 A3 CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyBehaviour_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyBehaviour_Loop:
|
|
jsr CheckZpB3Return ; CPU:$C8DE PRG:08DE 20 EB CA
|
|
jmp DispatchEnemyBehaviourC ; CPU:$C8E1 PRG:08E1 4C F4 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyBehaviour_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyBehaviour_Loop2:
|
|
jsr CheckZpB3Return ; CPU:$C8E4 PRG:08E4 20 EB CA
|
|
lda ActorCommand ; CPU:$C8E7 PRG:08E7 A5 BF
|
|
and #$F0 ; CPU:$C8E9 PRG:08E9 29 F0
|
|
beq HandleEnemyBehaviour_Loop3 ; CPU:$C8EB PRG:08EB F0 04
|
|
lda ZpC8 ; CPU:$C8ED PRG:08ED A5 C8
|
|
bne DispatchEnemyBehaviourC_Loop2 ; CPU:$C8EF PRG:08EF D0 25
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyBehaviour_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyBehaviour_Loop3:
|
|
jsr CheckMarioFacing ; CPU:$C8F1 PRG:08F1 20 95 CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC8F4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourC:
|
|
ldy #$00 ; CPU:$C8F4 PRG:08F4 A0 00
|
|
lda ActorCommand ; CPU:$C8F6 PRG:08F6 A5 BF
|
|
and #$0F ; CPU:$C8F8 PRG:08F8 29 0F
|
|
bne DispatchEnemyBehaviourC_Loop ; CPU:$C8FA PRG:08FA D0 0E
|
|
lda ZpC8 ; CPU:$C8FC PRG:08FC A5 C8
|
|
bne DispatchEnemyBehaviourC_Loop2 ; CPU:$C8FE PRG:08FE D0 16
|
|
lda ZpC6 ; CPU:$C900 PRG:0900 A5 C6
|
|
bne DispatchEnemyBehaviourC_Loop ; CPU:$C902 PRG:0902 D0 06
|
|
lda #$03 ; CPU:$C904 PRG:0904 A9 03
|
|
sta ZpC6 ; CPU:$C906 PRG:0906 85 C6
|
|
ldy ZpC7 ; CPU:$C908 PRG:0908 A4 C7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourC_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourC_Loop:
|
|
tya ; CPU:$C90A PRG:090A 98
|
|
clc ; CPU:$C90B PRG:090B 18
|
|
adc ZpC5 ; CPU:$C90C PRG:090C 65 C5
|
|
lsr Zp11 ; CPU:$C90E PRG:090E 46 11
|
|
bcs DispatchEnemyBehaviourC_Loop4 ; CPU:$C910 PRG:0910 B0 0A
|
|
lsr Zp11 ; CPU:$C912 PRG:0912 46 11
|
|
bcs DispatchEnemyBehaviourC_Loop3 ; CPU:$C914 PRG:0914 B0 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourC_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourC_Loop2:
|
|
rts ; CPU:$C916 PRG:0916 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourC_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourC_Loop3:
|
|
eor #$FF ; CPU:$C917 PRG:0917 49 FF
|
|
sec ; CPU:$C919 PRG:0919 38
|
|
bcs DispatchEnemyBehaviourC_Loop5 ; CPU:$C91A PRG:091A B0 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourC_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourC_Loop4:
|
|
clc ; CPU:$C91C PRG:091C 18
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourC_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourC_Loop5:
|
|
adc ScrollX ; CPU:$C91D PRG:091D 65 B9
|
|
sta ScrollX ; CPU:$C91F PRG:091F 85 B9
|
|
lda ActorCommand ; CPU:$C921 PRG:0921 A5 BF
|
|
and #$0F ; CPU:$C923 PRG:0923 29 0F
|
|
beq DispatchEnemyBehaviourC_Loop7 ; CPU:$C925 PRG:0925 F0 0F
|
|
lda ZpC1 ; CPU:$C927 PRG:0927 A5 C1
|
|
beq DispatchEnemyBehaviourC_Loop6 ; CPU:$C929 PRG:0929 F0 01
|
|
rts ; CPU:$C92B PRG:092B 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourC_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourC_Loop6:
|
|
lda ActorCount ; CPU:$C92C PRG:092C A5 BB
|
|
bne DispatchEnemyBehaviourC_Loop8 ; CPU:$C92E PRG:092E D0 09
|
|
lda ZpB1 ; CPU:$C930 PRG:0930 A5 B1
|
|
and #$04 ; CPU:$C932 PRG:0932 29 04
|
|
bne DispatchEnemyBehaviourC_Loop8 ; CPU:$C934 PRG:0934 D0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourC_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourC_Loop7:
|
|
jsr SelectEnemyDirection ; CPU:$C936 PRG:0936 20 EA D9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourC_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourC_Loop8:
|
|
rts ; CPU:$C939 PRG:0939 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC93A
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScriptCommand:
|
|
cmp #$AA ; CPU:$C93A PRG:093A C9 AA
|
|
beq HandleEnemyCommand30 ; CPU:$C93C PRG:093C F0 3F
|
|
cmp #$99 ; CPU:$C93E PRG:093E C9 99
|
|
bne CheckEnemyScriptCommand_Loop2 ; CPU:$C940 PRG:0940 D0 17
|
|
lda ActorCommand ; CPU:$C942 PRG:0942 A5 BF
|
|
and #$0F ; CPU:$C944 PRG:0944 29 0F
|
|
bne HandleEnemyCommand30 ; CPU:$C946 PRG:0946 D0 35
|
|
lda ZpC0 ; CPU:$C948 PRG:0948 A5 C0
|
|
and #$0F ; CPU:$C94A PRG:094A 29 0F
|
|
cmp #$0F ; CPU:$C94C PRG:094C C9 0F
|
|
bne CheckEnemyScriptCommand_Loop ; CPU:$C94E PRG:094E D0 04
|
|
lda #$FF ; CPU:$C950 PRG:0950 A9 FF
|
|
sta ZpC0 ; CPU:$C952 PRG:0952 85 C0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScriptCommand_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScriptCommand_Loop:
|
|
inc ZpC0 ; CPU:$C954 PRG:0954 E6 C0
|
|
jmp HandleEnemyCommand30 ; CPU:$C956 PRG:0956 4C 7D C9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScriptCommand_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScriptCommand_Loop2:
|
|
tay ; CPU:$C959 PRG:0959 A8
|
|
lda ActorTileIndex ; CPU:$C95A PRG:095A A5 B8
|
|
cmp #$20 ; CPU:$C95C PRG:095C C9 20
|
|
bcc CheckEnemyScriptCommand_Loop3 ; CPU:$C95E PRG:095E 90 0F
|
|
lda ActorCommand ; CPU:$C960 PRG:0960 A5 BF
|
|
and #$0F ; CPU:$C962 PRG:0962 29 0F
|
|
beq CheckEnemyScriptCommand_Loop3 ; CPU:$C964 PRG:0964 F0 09
|
|
lda ZpCB ; CPU:$C966 PRG:0966 A5 CB
|
|
jsr CheckRangeReturn012 ; CPU:$C968 PRG:0968 20 A4 CA
|
|
ora #$00 ; CPU:$C96B PRG:096B 09 00
|
|
bne CheckEnemyScriptCommand_Loop4 ; CPU:$C96D PRG:096D D0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScriptCommand_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScriptCommand_Loop3:
|
|
tya ; CPU:$C96F PRG:096F 98
|
|
jmp AddEnemyTileIndex ; CPU:$C970 PRG:0970 4C DD C9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScriptCommand_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScriptCommand_Loop4:
|
|
jsr CheckEnemySpawnFree ; CPU:$C973 PRG:0973 20 67 CF
|
|
lda #$2C ; CPU:$C976 PRG:0976 A9 2C
|
|
ldy #$F3 ; CPU:$C978 PRG:0978 A0 F3
|
|
jmp SetEnemyScrollTarget ; CPU:$C97A PRG:097A 4C 92 C9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC97D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommand30:
|
|
lda ActorCommand ; CPU:$C97D PRG:097D A5 BF
|
|
cmp #$30 ; CPU:$C97F PRG:097F C9 30
|
|
bne HandleEnemyCommand30_Loop ; CPU:$C981 PRG:0981 D0 0B
|
|
lda ZpC2 ; CPU:$C983 PRG:0983 A5 C2
|
|
bne SetEnemyScrollTarget_Loop ; CPU:$C985 PRG:0985 D0 17
|
|
lda #$7B ; CPU:$C987 PRG:0987 A9 7B
|
|
ldy #$F3 ; CPU:$C989 PRG:0989 A0 F3
|
|
jmp SetEnemyScrollTarget ; CPU:$C98B PRG:098B 4C 92 C9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommand30_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommand30_Loop:
|
|
lda #$3A ; CPU:$C98E PRG:098E A9 3A
|
|
ldy #$F3 ; CPU:$C990 PRG:0990 A0 F3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC992
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyScrollTarget:
|
|
sta ZpBC ; CPU:$C992 PRG:0992 85 BC
|
|
sty ZpBD ; CPU:$C994 PRG:0994 84 BD
|
|
lda ZpB1 ; CPU:$C996 PRG:0996 A5 B1
|
|
and #$3F ; CPU:$C998 PRG:0998 29 3F
|
|
ora #$40 ; CPU:$C99A PRG:099A 09 40
|
|
sta ZpB1 ; CPU:$C99C PRG:099C 85 B1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyScrollTarget_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyScrollTarget_Loop:
|
|
jmp DispatchEnemyBehaviourD ; CPU:$C99E PRG:099E 4C E6 C9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC9A1
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadEnemyTileIndex:
|
|
tay ; CPU:$C9A1 PRG:09A1 A8
|
|
lda ZpCD ; CPU:$C9A2 PRG:09A2 A5 CD
|
|
jsr CheckRangeReturn012 ; CPU:$C9A4 PRG:09A4 20 A4 CA
|
|
and #$0F ; CPU:$C9A7 PRG:09A7 29 0F
|
|
beq ClearEnemyTileFlags_Loop ; CPU:$C9A9 PRG:09A9 F0 27
|
|
lda ZpB1 ; CPU:$C9AB PRG:09AB A5 B1
|
|
and #$3F ; CPU:$C9AD PRG:09AD 29 3F
|
|
sta ZpB1 ; CPU:$C9AF PRG:09AF 85 B1
|
|
lda ActorCommand ; CPU:$C9B1 PRG:09B1 A5 BF
|
|
cmp #$30 ; CPU:$C9B3 PRG:09B3 C9 30
|
|
bne ReadEnemyTileIndex_Loop ; CPU:$C9B5 PRG:09B5 D0 06
|
|
lda #$08 ; CPU:$C9B7 PRG:09B7 A9 08
|
|
sta ZpB3 ; CPU:$C9B9 PRG:09B9 85 B3
|
|
bne ClearEnemyTileFlags ; CPU:$C9BB PRG:09BB D0 0E
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReadEnemyTileIndex_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadEnemyTileIndex_Loop:
|
|
lda ActorCommand ; CPU:$C9BD PRG:09BD A5 BF
|
|
and #$0F ; CPU:$C9BF PRG:09BF 29 0F
|
|
beq ClearEnemyTileFlags ; CPU:$C9C1 PRG:09C1 F0 08
|
|
lda #$00 ; CPU:$C9C3 PRG:09C3 A9 00
|
|
sta ZpC1 ; CPU:$C9C5 PRG:09C5 85 C1
|
|
lda #$00 ; CPU:$C9C7 PRG:09C7 A9 00
|
|
sta ActorPalette ; CPU:$C9C9 PRG:09C9 85 B4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC9CB
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearEnemyTileFlags:
|
|
lda ActorTileIndex ; CPU:$C9CB PRG:09CB A5 B8
|
|
and #$F8 ; CPU:$C9CD PRG:09CD 29 F8
|
|
sta ActorTileIndex ; CPU:$C9CF PRG:09CF 85 B8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearEnemyTileFlags_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearEnemyTileFlags_OnZero:
|
|
rts ; CPU:$C9D1 PRG:09D1 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearEnemyTileFlags_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearEnemyTileFlags_Loop:
|
|
tya ; CPU:$C9D2 PRG:09D2 98
|
|
cmp #$CC ; CPU:$C9D3 PRG:09D3 C9 CC
|
|
beq DispatchEnemyBehaviourD_Loop ; CPU:$C9D5 PRG:09D5 F0 1A
|
|
cmp #$AA ; CPU:$C9D7 PRG:09D7 C9 AA
|
|
bne AddEnemyTileIndex ; CPU:$C9D9 PRG:09D9 D0 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC9DB
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyTileIndex:
|
|
lda #$04 ; CPU:$C9DB PRG:09DB A9 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC9DD
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AddEnemyTileIndex:
|
|
clc ; CPU:$C9DD PRG:09DD 18
|
|
adc ActorTileIndex ; CPU:$C9DE PRG:09DE 65 B8
|
|
cmp #$08 ; CPU:$C9E0 PRG:09E0 C9 08
|
|
bcc DispatchEnemyBehaviourD ; CPU:$C9E2 PRG:09E2 90 02
|
|
sta ActorTileIndex ; CPU:$C9E4 PRG:09E4 85 B8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC9E6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourD:
|
|
lda ActorCommand ; CPU:$C9E6 PRG:09E6 A5 BF
|
|
and #$F0 ; CPU:$C9E8 PRG:09E8 29 F0
|
|
bne DispatchEnemyBehaviourD_Loop2 ; CPU:$C9EA PRG:09EA D0 0C
|
|
lda ZpC1 ; CPU:$C9EC PRG:09EC A5 C1
|
|
jmp DispatchEnemyBehaviourE ; CPU:$C9EE PRG:09EE 4C FE C9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourD_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourD_Loop:
|
|
lda ZpB2 ; CPU:$C9F1 PRG:09F1 A5 B2
|
|
sta ZpB3 ; CPU:$C9F3 PRG:09F3 85 B3
|
|
jmp AdvanceEnemyTileIndex ; CPU:$C9F5 PRG:09F5 4C DB C9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourD_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourD_Loop2:
|
|
cmp #$30 ; CPU:$C9F8 PRG:09F8 C9 30
|
|
beq DispatchEnemyBehaviourE_Loop ; CPU:$C9FA PRG:09FA F0 10
|
|
lda ZpC0 ; CPU:$C9FC PRG:09FC A5 C0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCC9FE
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourE:
|
|
beq DispatchEnemyBehaviourE_Loop ; CPU:$C9FE PRG:09FE F0 0C
|
|
and #$F0 ; CPU:$CA00 PRG:0A00 29 F0
|
|
cmp #$30 ; CPU:$CA02 PRG:0A02 C9 30
|
|
beq ClearEnemyTileFlags_OnZero ; CPU:$CA04 PRG:0A04 F0 CB
|
|
lda FrameCounter ; CPU:$CA06 PRG:0A06 A5 2F
|
|
and #$03 ; CPU:$CA08 PRG:0A08 29 03
|
|
beq DispatchEnemyBehaviourE_Loop2 ; CPU:$CA0A PRG:0A0A F0 09
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourE_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourE_Loop:
|
|
lda ActorCommand ; CPU:$CA0C PRG:0A0C A5 BF
|
|
cmp #$40 ; CPU:$CA0E PRG:0A0E C9 40
|
|
bcs DispatchEnemyBehaviourE_Loop3 ; CPU:$CA10 PRG:0A10 B0 06
|
|
jsr CheckZpB3Return ; CPU:$CA12 PRG:0A12 20 EB CA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourE_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourE_Loop2:
|
|
jmp DispatchEnemyBehaviourC ; CPU:$CA15 PRG:0A15 4C F4 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchEnemyBehaviourE_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchEnemyBehaviourE_Loop3:
|
|
jmp HandleEnemyBehaviour ; CPU:$CA18 PRG:0A18 4C D7 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCA1B
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitVramAddress:
|
|
lda #$03 ; CPU:$CA1B PRG:0A1B A9 03
|
|
jsr SetVramAddress2400B ; CPU:$CA1D PRG:0A1D 20 22 CA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCA20
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramAddress2400:
|
|
lda #$01 ; CPU:$CA20 PRG:0A20 A9 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCA22
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramAddress2400B:
|
|
sta Zp01 ; CPU:$CA22 PRG:0A22 85 01
|
|
lda #$24 ; CPU:$CA24 PRG:0A24 A9 24
|
|
sta Zp00 ; CPU:$CA26 PRG:0A26 85 00
|
|
jmp UpdatePpuCtrl ; CPU:$CA28 PRG:0A28 4C 43 CD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCA2B
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramAddressF400:
|
|
ldy #$02 ; CPU:$CA2B PRG:0A2B A0 02
|
|
sty Zp01 ; CPU:$CA2D PRG:0A2D 84 01
|
|
ldy #$00 ; CPU:$CA2F PRG:0A2F A0 00
|
|
sty Zp00 ; CPU:$CA31 PRG:0A31 84 00
|
|
lda #$F4 ; CPU:$CA33 PRG:0A33 A9 F4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramAddressF400_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramAddressF400_OnNonzero:
|
|
sta (Zp00),y ; CPU:$CA35 PRG:0A35 91 00
|
|
dey ; CPU:$CA37 PRG:0A37 88
|
|
bne SetVramAddressF400_OnNonzero ; CPU:$CA38 PRG:0A38 D0 FB
|
|
rts ; CPU:$CA3A PRG:0A3A 60
|
|
DrawTileRow:
|
|
lda #$3F ; CPU:$CA3B PRG:0A3B A9 3F
|
|
ldx #$F2 ; CPU:$CA3D PRG:0A3D A2 F2
|
|
jsr DrawTileRow_Loop ; CPU:$CA3F PRG:0A3F 20 5E CA
|
|
lda #$66 ; CPU:$CA42 PRG:0A42 A9 66
|
|
ldx #$F2 ; CPU:$CA44 PRG:0A44 A2 F2
|
|
ldy Zp32 ; CPU:$CA46 PRG:0A46 A4 32
|
|
beq DrawTileRow_Loop ; CPU:$CA48 PRG:0A48 F0 14
|
|
cpy #$04 ; CPU:$CA4A PRG:0A4A C0 04
|
|
beq DrawTileRow_Loop ; CPU:$CA4C PRG:0A4C F0 10
|
|
lda #$76 ; CPU:$CA4E PRG:0A4E A9 76
|
|
ldx #$F2 ; CPU:$CA50 PRG:0A50 A2 F2
|
|
cpy #$01 ; CPU:$CA52 PRG:0A52 C0 01
|
|
beq DrawTileRow_Loop ; CPU:$CA54 PRG:0A54 F0 08
|
|
cpy #$03 ; CPU:$CA56 PRG:0A56 C0 03
|
|
beq DrawTileRow_Loop ; CPU:$CA58 PRG:0A58 F0 04
|
|
; ---- data $CA5A-$CA5D (4 bytes) ----
|
|
SetTileIndex86:
|
|
.byte $A9, $86, $A2, $F2 ; CPU:$CA5A PRG:0A5A A9 86 A2 F2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DrawTileRow_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawTileRow_Loop:
|
|
sta Zp00 ; CPU:$CA5E PRG:0A5E 85 00
|
|
stx Zp01 ; CPU:$CA60 PRG:0A60 86 01
|
|
jsr WriteVramList ; CPU:$CA62 PRG:0A62 20 00 CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DrawTileRow_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawTileRow_OnZero:
|
|
rts ; CPU:$CA65 PRG:0A65 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCA66
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawTileRow2:
|
|
ldy PlayerSlot ; CPU:$CA66 PRG:0A66 A4 3F
|
|
beq DrawTileRow_OnZero ; CPU:$CA68 PRG:0A68 F0 FB
|
|
dey ; CPU:$CA6A PRG:0A6A 88
|
|
beq DrawTileRow2_Loop ; CPU:$CA6B PRG:0A6B F0 06
|
|
lda #$27 ; CPU:$CA6D PRG:0A6D A9 27
|
|
ldx #$F2 ; CPU:$CA6F PRG:0A6F A2 F2
|
|
bne DrawTileRow2_Loop2 ; CPU:$CA71 PRG:0A71 D0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DrawTileRow2_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawTileRow2_Loop:
|
|
lda #$03 ; CPU:$CA73 PRG:0A73 A9 03
|
|
ldx #$F2 ; CPU:$CA75 PRG:0A75 A2 F2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DrawTileRow2_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawTileRow2_Loop2:
|
|
ldy #$00 ; CPU:$CA77 PRG:0A77 A0 00
|
|
sty PlayerSlot ; CPU:$CA79 PRG:0A79 84 3F
|
|
beq DrawTileRow_Loop ; CPU:$CA7B PRG:0A7B F0 E1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCA7D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeTileOffset:
|
|
lda Zp00 ; CPU:$CA7D PRG:0A7D A5 00
|
|
lsr a ; CPU:$CA7F PRG:0A7F 4A
|
|
lsr a ; CPU:$CA80 PRG:0A80 4A
|
|
lsr a ; CPU:$CA81 PRG:0A81 4A
|
|
sta Zp12 ; CPU:$CA82 PRG:0A82 85 12
|
|
lda #$20 ; CPU:$CA84 PRG:0A84 A9 20
|
|
sta Zp13 ; CPU:$CA86 PRG:0A86 85 13
|
|
lda #$00 ; CPU:$CA88 PRG:0A88 A9 00
|
|
sta Zp15 ; CPU:$CA8A PRG:0A8A 85 15
|
|
lda Zp01 ; CPU:$CA8C PRG:0A8C A5 01
|
|
and #$F8 ; CPU:$CA8E PRG:0A8E 29 F8
|
|
asl a ; CPU:$CA90 PRG:0A90 0A
|
|
rol Zp15 ; CPU:$CA91 PRG:0A91 26 15
|
|
asl a ; CPU:$CA93 PRG:0A93 0A
|
|
rol Zp15 ; CPU:$CA94 PRG:0A94 26 15
|
|
sta Zp14 ; CPU:$CA96 PRG:0A96 85 14
|
|
jsr AdvanceDispatchPointer ; CPU:$CA98 PRG:0A98 20 B4 CD
|
|
lda Zp15 ; CPU:$CA9B PRG:0A9B A5 15
|
|
sta Zp00 ; CPU:$CA9D PRG:0A9D 85 00
|
|
lda Zp14 ; CPU:$CA9F PRG:0A9F A5 14
|
|
sta Zp01 ; CPU:$CAA1 PRG:0AA1 85 01
|
|
rts ; CPU:$CAA3 PRG:0AA3 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckRangeReturn012
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckRangeReturn012:
|
|
cmp #$92 ; CPU:$CAA4 PRG:0AA4 C9 92
|
|
bcc CheckRangeReturn012_Loop2 ; CPU:$CAA6 PRG:0AA6 90 0E
|
|
cmp #$A0 ; CPU:$CAA8 PRG:0AA8 C9 A0
|
|
bcc CheckRangeReturn012_Loop ; CPU:$CAAA PRG:0AAA 90 07
|
|
cmp #$FA ; CPU:$CAAC PRG:0AAC C9 FA
|
|
bcs CheckRangeReturn012_Loop ; CPU:$CAAE PRG:0AAE B0 03
|
|
lda #$02 ; CPU:$CAB0 PRG:0AB0 A9 02
|
|
rts ; CPU:$CAB2 PRG:0AB2 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckRangeReturn012_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckRangeReturn012_Loop:
|
|
lda #$01 ; CPU:$CAB3 PRG:0AB3 A9 01
|
|
rts ; CPU:$CAB5 PRG:0AB5 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckRangeReturn012_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckRangeReturn012_Loop2:
|
|
lda #$00 ; CPU:$CAB6 PRG:0AB6 A9 00
|
|
rts ; CPU:$CAB8 PRG:0AB8 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchTableF393
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchTableF393:
|
|
lda #$93 ; CPU:$CAB9 PRG:0AB9 A9 93
|
|
sta Zp14 ; CPU:$CABB PRG:0ABB 85 14
|
|
lda #$F3 ; CPU:$CABD PRG:0ABD A9 F3
|
|
sta Zp15 ; CPU:$CABF PRG:0ABF 85 15
|
|
lda ZpC3 ; CPU:$CAC1 PRG:0AC1 A5 C3
|
|
sta Zp12 ; CPU:$CAC3 PRG:0AC3 85 12
|
|
lda #$00 ; CPU:$CAC5 PRG:0AC5 A9 00
|
|
sta Zp13 ; CPU:$CAC7 PRG:0AC7 85 13
|
|
jsr AdvanceDispatchPointer ; CPU:$CAC9 PRG:0AC9 20 B4 CD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCACC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceScriptCounter:
|
|
lda ActorState ; CPU:$CACC PRG:0ACC A5 C4
|
|
asl a ; CPU:$CACE PRG:0ACE 0A
|
|
clc ; CPU:$CACF PRG:0ACF 18
|
|
adc ActorState ; CPU:$CAD0 PRG:0AD0 65 C4
|
|
tay ; CPU:$CAD2 PRG:0AD2 A8
|
|
lda (Zp14),y ; CPU:$CAD3 PRG:0AD3 B1 14
|
|
cmp #$AA ; CPU:$CAD5 PRG:0AD5 C9 AA
|
|
bne AdvanceScriptCounter_Loop ; CPU:$CAD7 PRG:0AD7 D0 05
|
|
dec ActorState ; CPU:$CAD9 PRG:0AD9 C6 C4
|
|
jmp AdvanceScriptCounter ; CPU:$CADB PRG:0ADB 4C CC CA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceScriptCounter_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceScriptCounter_Loop:
|
|
sta ZpC5 ; CPU:$CADE PRG:0ADE 85 C5
|
|
iny ; CPU:$CAE0 PRG:0AE0 C8
|
|
lda (Zp14),y ; CPU:$CAE1 PRG:0AE1 B1 14
|
|
sta ZpB2 ; CPU:$CAE3 PRG:0AE3 85 B2
|
|
iny ; CPU:$CAE5 PRG:0AE5 C8
|
|
lda (Zp14),y ; CPU:$CAE6 PRG:0AE6 B1 14
|
|
sta ZpC7 ; CPU:$CAE8 PRG:0AE8 85 C7
|
|
rts ; CPU:$CAEA PRG:0AEA 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckZpB3Return
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckZpB3Return:
|
|
lda ZpB3 ; CPU:$CAEB PRG:0AEB A5 B3
|
|
beq CheckZpB3Return_Loop ; CPU:$CAED PRG:0AED F0 03
|
|
pla ; CPU:$CAEF PRG:0AEF 68
|
|
pla ; CPU:$CAF0 PRG:0AF0 68
|
|
rts ; CPU:$CAF1 PRG:0AF1 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckZpB3Return_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckZpB3Return_Loop:
|
|
lda ZpB2 ; CPU:$CAF2 PRG:0AF2 A5 B2
|
|
sta ZpB3 ; CPU:$CAF4 PRG:0AF4 85 B3
|
|
rts ; CPU:$CAF6 PRG:0AF6 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCAF7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemyScroll:
|
|
lda Zp42 ; CPU:$CAF7 PRG:0AF7 A5 42
|
|
beq CopyOamRow_Loop ; CPU:$CAF9 PRG:0AF9 F0 54
|
|
lda #$0D ; CPU:$CAFB PRG:0AFB A9 0D
|
|
sta ScriptStepCounter ; CPU:$CAFD PRG:0AFD 85 33
|
|
ldx #$01 ; CPU:$CAFF PRG:0AFF A2 01
|
|
lda FrameCounter ; CPU:$CB01 PRG:0B01 A5 2F
|
|
lsr a ; CPU:$CB03 PRG:0B03 4A
|
|
bcc UpdateEnemyScroll_Loop ; CPU:$CB04 PRG:0B04 90 02
|
|
ldx #$0E ; CPU:$CB06 PRG:0B06 A2 0E
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemyScroll_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemyScroll_Loop:
|
|
lda #$00 ; CPU:$CB08 PRG:0B08 A9 00
|
|
sta Zp14 ; CPU:$CB0A PRG:0B0A 85 14
|
|
lda #$03 ; CPU:$CB0C PRG:0B0C A9 03
|
|
sta Zp15 ; CPU:$CB0E PRG:0B0E 85 15
|
|
lda #$20 ; CPU:$CB10 PRG:0B10 A9 20
|
|
sta Zp12 ; CPU:$CB12 PRG:0B12 85 12
|
|
lda #$00 ; CPU:$CB14 PRG:0B14 A9 00
|
|
sta Zp13 ; CPU:$CB16 PRG:0B16 85 13
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemyScroll_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemyScroll_OnNonzero:
|
|
ldy #$00 ; CPU:$CB18 PRG:0B18 A0 00
|
|
lda (Zp14),y ; CPU:$CB1A PRG:0B1A B1 14
|
|
beq UpdateEnemyScroll_Loop2 ; CPU:$CB1C PRG:0B1C F0 0B
|
|
ldy #$03 ; CPU:$CB1E PRG:0B1E A0 03
|
|
lda (Zp14),y ; CPU:$CB20 PRG:0B20 B1 14
|
|
beq UpdateEnemyScroll_Loop2 ; CPU:$CB22 PRG:0B22 F0 05
|
|
sec ; CPU:$CB24 PRG:0B24 38
|
|
sbc #$01 ; CPU:$CB25 PRG:0B25 E9 01
|
|
sta (Zp14),y ; CPU:$CB27 PRG:0B27 91 14
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemyScroll_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemyScroll_Loop2:
|
|
lda ScriptStepCounter ; CPU:$CB29 PRG:0B29 A5 33
|
|
cmp #$0B ; CPU:$CB2B PRG:0B2B C9 0B
|
|
bcc UpdateEnemyScroll_Loop3 ; CPU:$CB2D PRG:0B2D 90 11
|
|
cpx #$0E ; CPU:$CB2F PRG:0B2F E0 0E
|
|
bcs CopyOamRow ; CPU:$CB31 PRG:0B31 B0 15
|
|
ldy #$1B ; CPU:$CB33 PRG:0B33 A0 1B
|
|
jsr CopyOamBytes ; CPU:$CB35 PRG:0B35 20 50 CB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemyScroll_OnCarrySet
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemyScroll_OnCarrySet:
|
|
ldy #$1D ; CPU:$CB38 PRG:0B38 A0 1D
|
|
jsr CopyOamBytes ; CPU:$CB3A PRG:0B3A 20 50 CB
|
|
jmp CopyOamRow ; CPU:$CB3D PRG:0B3D 4C 48 CB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemyScroll_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemyScroll_Loop3:
|
|
cmp #$05 ; CPU:$CB40 PRG:0B40 C9 05
|
|
bcc CopyOamRow ; CPU:$CB42 PRG:0B42 90 04
|
|
cpx #$0E ; CPU:$CB44 PRG:0B44 E0 0E
|
|
bcs UpdateEnemyScroll_OnCarrySet ; CPU:$CB46 PRG:0B46 B0 F0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCB48
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CopyOamRow:
|
|
jsr AdvanceDispatchPointer ; CPU:$CB48 PRG:0B48 20 B4 CD
|
|
dec ScriptStepCounter ; CPU:$CB4B PRG:0B4B C6 33
|
|
bne UpdateEnemyScroll_OnNonzero ; CPU:$CB4D PRG:0B4D D0 C9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CopyOamRow_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CopyOamRow_Loop:
|
|
rts ; CPU:$CB4F PRG:0B4F 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCB50
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CopyOamBytes:
|
|
lda $0520,x ; CPU:$CB50 PRG:0B50 BD 20 05
|
|
sta (Zp14),y ; CPU:$CB53 PRG:0B53 91 14
|
|
inx ; CPU:$CB55 PRG:0B55 E8
|
|
inx ; CPU:$CB56 PRG:0B56 E8
|
|
rts ; CPU:$CB57 PRG:0B57 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCB58
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateOamShadow:
|
|
lda Zp42 ; CPU:$CB58 PRG:0B58 A5 42
|
|
beq UpdateOamShadow_Loop2 ; CPU:$CB5A PRG:0B5A F0 28
|
|
ldx #$00 ; CPU:$CB5C PRG:0B5C A2 00
|
|
lda FrameCounter ; CPU:$CB5E PRG:0B5E A5 2F
|
|
lsr a ; CPU:$CB60 PRG:0B60 4A
|
|
bcc UpdateOamShadow_Loop ; CPU:$CB61 PRG:0B61 90 02
|
|
ldx #$0D ; CPU:$CB63 PRG:0B63 A2 0D
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateOamShadow_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateOamShadow_Loop:
|
|
ldy #$06 ; CPU:$CB65 PRG:0B65 A0 06
|
|
lda PPUSTATUS ; CPU:$CB67 PRG:0B67 AD 02 20
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateOamShadow_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateOamShadow_OnNonzero:
|
|
lda $0520,x ; CPU:$CB6A PRG:0B6A BD 20 05
|
|
sta PPUADDR ; CPU:$CB6D PRG:0B6D 8D 06 20
|
|
inx ; CPU:$CB70 PRG:0B70 E8
|
|
lda $0520,x ; CPU:$CB71 PRG:0B71 BD 20 05
|
|
sta PPUADDR ; CPU:$CB74 PRG:0B74 8D 06 20
|
|
lda PPUDATA ; CPU:$CB77 PRG:0B77 AD 07 20
|
|
lda PPUDATA ; CPU:$CB7A PRG:0B7A AD 07 20
|
|
sta $0520,x ; CPU:$CB7D PRG:0B7D 9D 20 05
|
|
inx ; CPU:$CB80 PRG:0B80 E8
|
|
dey ; CPU:$CB81 PRG:0B81 88
|
|
bne UpdateOamShadow_OnNonzero ; CPU:$CB82 PRG:0B82 D0 E6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateOamShadow_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateOamShadow_Loop2:
|
|
rts ; CPU:$CB84 PRG:0B84 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCB85
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupScriptPointer:
|
|
lda ScriptPtrLo ; CPU:$CB85 PRG:0B85 A5 A0
|
|
sta Zp14 ; CPU:$CB87 PRG:0B87 85 14
|
|
lda ScriptPtrHi ; CPU:$CB89 PRG:0B89 A5 A1
|
|
sta Zp15 ; CPU:$CB8B PRG:0B8B 85 15
|
|
lda ScriptStep ; CPU:$CB8D PRG:0B8D A5 A2
|
|
sta Zp12 ; CPU:$CB8F PRG:0B8F 85 12
|
|
lda #$00 ; CPU:$CB91 PRG:0B91 A9 00
|
|
sta Zp13 ; CPU:$CB93 PRG:0B93 85 13
|
|
jsr AdvanceDispatchPointer ; CPU:$CB95 PRG:0B95 20 B4 CD
|
|
tay ; CPU:$CB98 PRG:0B98 A8
|
|
tax ; CPU:$CB99 PRG:0B99 AA
|
|
rts ; CPU:$CB9A PRG:0B9A 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCB9B
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupScriptPointerA:
|
|
jsr SetupScriptPointer ; CPU:$CB9B PRG:0B9B 20 85 CB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupScriptPointerA_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupScriptPointerA_OnNonzero:
|
|
lda (Zp14),y ; CPU:$CB9E PRG:0B9E B1 14
|
|
sta ZpB0,x ; CPU:$CBA0 PRG:0BA0 95 B0
|
|
iny ; CPU:$CBA2 PRG:0BA2 C8
|
|
inx ; CPU:$CBA3 PRG:0BA3 E8
|
|
cpx #$20 ; CPU:$CBA4 PRG:0BA4 E0 20
|
|
bne SetupScriptPointerA_OnNonzero ; CPU:$CBA6 PRG:0BA6 D0 F6
|
|
lda #$00 ; CPU:$CBA8 PRG:0BA8 A9 00
|
|
tay ; CPU:$CBAA PRG:0BAA A8
|
|
sta (Zp14),y ; CPU:$CBAB PRG:0BAB 91 14
|
|
rts ; CPU:$CBAD PRG:0BAD 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCBAE
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceScriptPointer:
|
|
lda ScriptStep ; CPU:$CBAE PRG:0BAE A5 A2
|
|
clc ; CPU:$CBB0 PRG:0BB0 18
|
|
adc #$20 ; CPU:$CBB1 PRG:0BB1 69 20
|
|
sta ScriptStep ; CPU:$CBB3 PRG:0BB3 85 A2
|
|
rts ; CPU:$CBB5 PRG:0BB5 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCBB6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupScriptPointerB:
|
|
jsr SetupScriptPointer ; CPU:$CBB6 PRG:0BB6 20 85 CB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupScriptPointerB_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupScriptPointerB_OnNonzero:
|
|
lda ZpB0,x ; CPU:$CBB9 PRG:0BB9 B5 B0
|
|
sta (Zp14),y ; CPU:$CBBB PRG:0BBB 91 14
|
|
iny ; CPU:$CBBD PRG:0BBD C8
|
|
inx ; CPU:$CBBE PRG:0BBE E8
|
|
cpx #$20 ; CPU:$CBBF PRG:0BBF E0 20
|
|
bne SetupScriptPointerB_OnNonzero ; CPU:$CBC1 PRG:0BC1 D0 F6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupScriptPointerB_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupScriptPointerB_OnZero:
|
|
rts ; CPU:$CBC3 PRG:0BC3 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCBC4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetScriptTableBase:
|
|
lda ZpB0 ; CPU:$CBC4 PRG:0BC4 A5 B0
|
|
beq SetupScriptPointerB_OnZero ; CPU:$CBC6 PRG:0BC6 F0 FB
|
|
lda #$F2 ; CPU:$CBC8 PRG:0BC8 A9 F2
|
|
sta Zp15 ; CPU:$CBCA PRG:0BCA 85 15
|
|
lda #$96 ; CPU:$CBCC PRG:0BCC A9 96
|
|
sta Zp14 ; CPU:$CBCE PRG:0BCE 85 14
|
|
lda ZpB5 ; CPU:$CBD0 PRG:0BD0 A5 B5
|
|
jsr DispatchScriptCommand ; CPU:$CBD2 PRG:0BD2 20 29 CC
|
|
lda ZpB6 ; CPU:$CBD5 PRG:0BD5 A5 B6
|
|
sta Zp11 ; CPU:$CBD7 PRG:0BD7 85 11
|
|
ldy #$00 ; CPU:$CBD9 PRG:0BD9 A0 00
|
|
ldx ZpBA ; CPU:$CBDB PRG:0BDB A6 BA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetScriptTableBase_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetScriptTableBase_OnNonzero:
|
|
lda (Zp12),y ; CPU:$CBDD PRG:0BDD B1 12
|
|
beq SetScriptTableBase_Loop2 ; CPU:$CBDF PRG:0BDF F0 08
|
|
bpl SetScriptTableBase_Loop ; CPU:$CBE1 PRG:0BE1 10 01
|
|
asl a ; CPU:$CBE3 PRG:0BE3 0A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetScriptTableBase_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetScriptTableBase_Loop:
|
|
eor FrameCounter ; CPU:$CBE4 PRG:0BE4 45 2F
|
|
lsr a ; CPU:$CBE6 PRG:0BE6 4A
|
|
bcs SetScriptTableBase_Loop5 ; CPU:$CBE7 PRG:0BE7 B0 34
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetScriptTableBase_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetScriptTableBase_Loop2:
|
|
iny ; CPU:$CBE9 PRG:0BE9 C8
|
|
lda (Zp12),y ; CPU:$CBEA PRG:0BEA B1 12
|
|
iny ; CPU:$CBEC PRG:0BEC C8
|
|
clc ; CPU:$CBED PRG:0BED 18
|
|
adc ActorTileIndex ; CPU:$CBEE PRG:0BEE 65 B8
|
|
adc #$FF ; CPU:$CBF0 PRG:0BF0 69 FF
|
|
sta $0200,x ; CPU:$CBF2 PRG:0BF2 9D 00 02
|
|
inx ; CPU:$CBF5 PRG:0BF5 E8
|
|
lda Zp11 ; CPU:$CBF6 PRG:0BF6 A5 11
|
|
sta $0200,x ; CPU:$CBF8 PRG:0BF8 9D 00 02
|
|
inc Zp11 ; CPU:$CBFB PRG:0BFB E6 11
|
|
inx ; CPU:$CBFD PRG:0BFD E8
|
|
lda ZpB7 ; CPU:$CBFE PRG:0BFE A5 B7
|
|
sta $0200,x ; CPU:$CC00 PRG:0C00 9D 00 02
|
|
inx ; CPU:$CC03 PRG:0C03 E8
|
|
lda (Zp12),y ; CPU:$CC04 PRG:0C04 B1 12
|
|
bit ZpB7 ; CPU:$CC06 PRG:0C06 24 B7
|
|
bvs SetScriptTableBase_Loop3 ; CPU:$CC08 PRG:0C08 70 03
|
|
clc ; CPU:$CC0A PRG:0C0A 18
|
|
bcc SetScriptTableBase_Loop4 ; CPU:$CC0B PRG:0C0B 90 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetScriptTableBase_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetScriptTableBase_Loop3:
|
|
eor #$FF ; CPU:$CC0D PRG:0C0D 49 FF
|
|
sec ; CPU:$CC0F PRG:0C0F 38
|
|
sbc #$08 ; CPU:$CC10 PRG:0C10 E9 08
|
|
sec ; CPU:$CC12 PRG:0C12 38
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetScriptTableBase_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetScriptTableBase_Loop4:
|
|
adc ScrollX ; CPU:$CC13 PRG:0C13 65 B9
|
|
iny ; CPU:$CC15 PRG:0C15 C8
|
|
sta $0200,x ; CPU:$CC16 PRG:0C16 9D 00 02
|
|
inx ; CPU:$CC19 PRG:0C19 E8
|
|
jmp ReadScriptRecord ; CPU:$CC1A PRG:0C1A 4C 22 CC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetScriptTableBase_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetScriptTableBase_Loop5:
|
|
iny ; CPU:$CC1D PRG:0C1D C8
|
|
iny ; CPU:$CC1E PRG:0C1E C8
|
|
iny ; CPU:$CC1F PRG:0C1F C8
|
|
inc Zp11 ; CPU:$CC20 PRG:0C20 E6 11
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCC22
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadScriptRecord:
|
|
lda (Zp12),y ; CPU:$CC22 PRG:0C22 B1 12
|
|
cmp #$AA ; CPU:$CC24 PRG:0C24 C9 AA
|
|
bne SetScriptTableBase_OnNonzero ; CPU:$CC26 PRG:0C26 D0 B5
|
|
rts ; CPU:$CC28 PRG:0C28 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCC29
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchScriptCommand:
|
|
asl a ; CPU:$CC29 PRG:0C29 0A
|
|
sta Zp12 ; CPU:$CC2A PRG:0C2A 85 12
|
|
lda #$00 ; CPU:$CC2C PRG:0C2C A9 00
|
|
tay ; CPU:$CC2E PRG:0C2E A8
|
|
rol a ; CPU:$CC2F PRG:0C2F 2A
|
|
sta Zp13 ; CPU:$CC30 PRG:0C30 85 13
|
|
jsr AdvanceDispatchPointer ; CPU:$CC32 PRG:0C32 20 B4 CD
|
|
lda (Zp14),y ; CPU:$CC35 PRG:0C35 B1 14
|
|
sta Zp12 ; CPU:$CC37 PRG:0C37 85 12
|
|
iny ; CPU:$CC39 PRG:0C39 C8
|
|
lda (Zp14),y ; CPU:$CC3A PRG:0C3A B1 14
|
|
sta Zp13 ; CPU:$CC3C PRG:0C3C 85 13
|
|
rts ; CPU:$CC3E PRG:0C3E 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCC3F
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyTileRange:
|
|
lda ActorTileIndex ; CPU:$CC3F PRG:0C3F A5 B8
|
|
sec ; CPU:$CC41 PRG:0C41 38
|
|
sbc #$0F ; CPU:$CC42 PRG:0C42 E9 0F
|
|
cmp #$20 ; CPU:$CC44 PRG:0C44 C9 20
|
|
bcc CheckEnemyTileRange_Loop ; CPU:$CC46 PRG:0C46 90 04
|
|
cmp #$E0 ; CPU:$CC48 PRG:0C48 C9 E0
|
|
bcc CheckEnemyTileRange_Loop2 ; CPU:$CC4A PRG:0C4A 90 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyTileRange_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyTileRange_Loop:
|
|
lda #$00 ; CPU:$CC4C PRG:0C4C A9 00
|
|
sta Zp01 ; CPU:$CC4E PRG:0C4E 85 01
|
|
lda #$20 ; CPU:$CC50 PRG:0C50 A9 20
|
|
bne CheckEnemyTileRange_Loop3 ; CPU:$CC52 PRG:0C52 D0 0B
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyTileRange_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyTileRange_Loop2:
|
|
sta Zp01 ; CPU:$CC54 PRG:0C54 85 01
|
|
lda ScrollX ; CPU:$CC56 PRG:0C56 A5 B9
|
|
sta Zp00 ; CPU:$CC58 PRG:0C58 85 00
|
|
jsr ComputeTileOffset ; CPU:$CC5A PRG:0C5A 20 7D CA
|
|
lda Zp00 ; CPU:$CC5D PRG:0C5D A5 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyTileRange_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyTileRange_Loop3:
|
|
ldx $05FA ; CPU:$CC5F PRG:0C5F AE FA 05
|
|
sta ZpCA ; CPU:$CC62 PRG:0C62 85 CA
|
|
sta $0520,x ; CPU:$CC64 PRG:0C64 9D 20 05
|
|
inx ; CPU:$CC67 PRG:0C67 E8
|
|
lda Zp01 ; CPU:$CC68 PRG:0C68 A5 01
|
|
sta ZpC9 ; CPU:$CC6A PRG:0C6A 85 C9
|
|
sta $0520,x ; CPU:$CC6C PRG:0C6C 9D 20 05
|
|
inx ; CPU:$CC6F PRG:0C6F E8
|
|
stx $05FA ; CPU:$CC70 PRG:0C70 8E FA 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCC73
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AddEnemyTileOffset:
|
|
lda ActorTileIndex ; CPU:$CC73 PRG:0C73 A5 B8
|
|
clc ; CPU:$CC75 PRG:0C75 18
|
|
adc #$08 ; CPU:$CC76 PRG:0C76 69 08
|
|
cmp #$E4 ; CPU:$CC78 PRG:0C78 C9 E4
|
|
bcc AddEnemyTileOffset_Loop ; CPU:$CC7A PRG:0C7A 90 08
|
|
lda #$00 ; CPU:$CC7C PRG:0C7C A9 00
|
|
sta Zp01 ; CPU:$CC7E PRG:0C7E 85 01
|
|
lda #$20 ; CPU:$CC80 PRG:0C80 A9 20
|
|
bne AddEnemyTileOffset_Loop2 ; CPU:$CC82 PRG:0C82 D0 0B
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AddEnemyTileOffset_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AddEnemyTileOffset_Loop:
|
|
sta Zp01 ; CPU:$CC84 PRG:0C84 85 01
|
|
lda ScrollX ; CPU:$CC86 PRG:0C86 A5 B9
|
|
sta Zp00 ; CPU:$CC88 PRG:0C88 85 00
|
|
jsr ComputeTileOffset ; CPU:$CC8A PRG:0C8A 20 7D CA
|
|
lda Zp00 ; CPU:$CC8D PRG:0C8D A5 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AddEnemyTileOffset_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AddEnemyTileOffset_Loop2:
|
|
ldx $05FA ; CPU:$CC8F PRG:0C8F AE FA 05
|
|
sta $0520,x ; CPU:$CC92 PRG:0C92 9D 20 05
|
|
inx ; CPU:$CC95 PRG:0C95 E8
|
|
lda Zp01 ; CPU:$CC96 PRG:0C96 A5 01
|
|
sta $0520,x ; CPU:$CC98 PRG:0C98 9D 20 05
|
|
inx ; CPU:$CC9B PRG:0C9B E8
|
|
stx $05FA ; CPU:$CC9C PRG:0C9C 8E FA 05
|
|
rts ; CPU:$CC9F PRG:0C9F 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: PushTablePointerDispatch
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
PushTablePointerDispatch:
|
|
sty Zp1E ; CPU:$CCA0 PRG:0CA0 84 1E
|
|
lda ZpBC ; CPU:$CCA2 PRG:0CA2 A5 BC
|
|
sta Zp14 ; CPU:$CCA4 PRG:0CA4 85 14
|
|
lda ZpBD ; CPU:$CCA6 PRG:0CA6 A5 BD
|
|
sta Zp15 ; CPU:$CCA8 PRG:0CA8 85 15
|
|
ldy #$00 ; CPU:$CCAA PRG:0CAA A0 00
|
|
lda (Zp14),y ; CPU:$CCAC PRG:0CAC B1 14
|
|
cmp #$AA ; CPU:$CCAE PRG:0CAE C9 AA
|
|
beq PushTablePointerDispatch_Loop ; CPU:$CCB0 PRG:0CB0 F0 10
|
|
sty Zp13 ; CPU:$CCB2 PRG:0CB2 84 13
|
|
iny ; CPU:$CCB4 PRG:0CB4 C8
|
|
sty Zp12 ; CPU:$CCB5 PRG:0CB5 84 12
|
|
jsr AdvanceDispatchPointer ; CPU:$CCB7 PRG:0CB7 20 B4 CD
|
|
ldy Zp14 ; CPU:$CCBA PRG:0CBA A4 14
|
|
sty ZpBC ; CPU:$CCBC PRG:0CBC 84 BC
|
|
ldy Zp15 ; CPU:$CCBE PRG:0CBE A4 15
|
|
sty ZpBD ; CPU:$CCC0 PRG:0CC0 84 BD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: PushTablePointerDispatch_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
PushTablePointerDispatch_Loop:
|
|
ldy Zp1E ; CPU:$CCC2 PRG:0CC2 A4 1E
|
|
rts ; CPU:$CCC4 PRG:0CC4 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCCC5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadControllerPort:
|
|
ldx #$01 ; CPU:$CCC5 PRG:0CC5 A2 01
|
|
stx JOY1 ; CPU:$CCC7 PRG:0CC7 8E 16 40
|
|
dex ; CPU:$CCCA PRG:0CCA CA
|
|
txa ; CPU:$CCCB PRG:0CCB 8A
|
|
sta JOY1 ; CPU:$CCCC PRG:0CCC 8D 16 40
|
|
jsr ReadControllerBits ; CPU:$CCCF PRG:0CCF 20 D3 CC
|
|
inx ; CPU:$CCD2 PRG:0CD2 E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCCD3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadControllerBits:
|
|
ldy #$08 ; CPU:$CCD3 PRG:0CD3 A0 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReadControllerBits_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadControllerBits_OnNonzero:
|
|
pha ; CPU:$CCD5 PRG:0CD5 48
|
|
lda JOY1,x ; CPU:$CCD6 PRG:0CD6 BD 16 40
|
|
sta Zp00 ; CPU:$CCD9 PRG:0CD9 85 00
|
|
lsr a ; CPU:$CCDB PRG:0CDB 4A
|
|
ora Zp00 ; CPU:$CCDC PRG:0CDC 05 00
|
|
lsr a ; CPU:$CCDE PRG:0CDE 4A
|
|
pla ; CPU:$CCDF PRG:0CDF 68
|
|
rol a ; CPU:$CCE0 PRG:0CE0 2A
|
|
dey ; CPU:$CCE1 PRG:0CE1 88
|
|
bne ReadControllerBits_OnNonzero ; CPU:$CCE2 PRG:0CE2 D0 F1
|
|
stx Zp00 ; CPU:$CCE4 PRG:0CE4 86 00
|
|
asl Zp00 ; CPU:$CCE6 PRG:0CE6 06 00
|
|
ldx Zp00 ; CPU:$CCE8 PRG:0CE8 A6 00
|
|
ldy Zp18,x ; CPU:$CCEA PRG:0CEA B4 18
|
|
sty Zp00 ; CPU:$CCEC PRG:0CEC 84 00
|
|
sta Zp18,x ; CPU:$CCEE PRG:0CEE 95 18
|
|
sta Zp19,x ; CPU:$CCF0 PRG:0CF0 95 19
|
|
and #$FF ; CPU:$CCF2 PRG:0CF2 29 FF
|
|
bpl ReadControllerBits_Loop ; CPU:$CCF4 PRG:0CF4 10 08
|
|
bit Zp00 ; CPU:$CCF6 PRG:0CF6 24 00
|
|
bpl ReadControllerBits_Loop ; CPU:$CCF8 PRG:0CF8 10 04
|
|
and #$7F ; CPU:$CCFA PRG:0CFA 29 7F
|
|
sta Zp19,x ; CPU:$CCFC PRG:0CFC 95 19
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReadControllerBits_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadControllerBits_Loop:
|
|
rts ; CPU:$CCFE PRG:0CFE 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCCFF
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawHudRow:
|
|
lda Zp21 ; CPU:$CCFF PRG:0CFF A5 21
|
|
beq DrawHudRow_Loop2 ; CPU:$CD01 PRG:0D01 F0 3F
|
|
lda #$91 ; CPU:$CD03 PRG:0D03 A9 91
|
|
sta Zp00 ; CPU:$CD05 PRG:0D05 85 00
|
|
lda #$05 ; CPU:$CD07 PRG:0D07 A9 05
|
|
sta Zp01 ; CPU:$CD09 PRG:0D09 85 01
|
|
lda Zp09 ; CPU:$CD0B PRG:0D0B A5 09
|
|
and #$FB ; CPU:$CD0D PRG:0D0D 29 FB
|
|
sta PPUCTRL ; CPU:$CD0F PRG:0D0F 8D 00 20
|
|
sta Zp09 ; CPU:$CD12 PRG:0D12 85 09
|
|
ldx PPUSTATUS ; CPU:$CD14 PRG:0D14 AE 02 20
|
|
ldy #$00 ; CPU:$CD17 PRG:0D17 A0 00
|
|
beq DrawHudRow_Loop ; CPU:$CD19 PRG:0D19 F0 19
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DrawHudRow_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawHudRow_OnNonzero:
|
|
sta PPUADDR ; CPU:$CD1B PRG:0D1B 8D 06 20
|
|
iny ; CPU:$CD1E PRG:0D1E C8
|
|
lda (Zp00),y ; CPU:$CD1F PRG:0D1F B1 00
|
|
sta PPUADDR ; CPU:$CD21 PRG:0D21 8D 06 20
|
|
iny ; CPU:$CD24 PRG:0D24 C8
|
|
lda (Zp00),y ; CPU:$CD25 PRG:0D25 B1 00
|
|
and #$3F ; CPU:$CD27 PRG:0D27 29 3F
|
|
tax ; CPU:$CD29 PRG:0D29 AA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DrawHudRow_OnNonzero2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawHudRow_OnNonzero2:
|
|
iny ; CPU:$CD2A PRG:0D2A C8
|
|
lda (Zp00),y ; CPU:$CD2B PRG:0D2B B1 00
|
|
sta PPUDATA ; CPU:$CD2D PRG:0D2D 8D 07 20
|
|
dex ; CPU:$CD30 PRG:0D30 CA
|
|
bne DrawHudRow_OnNonzero2 ; CPU:$CD31 PRG:0D31 D0 F7
|
|
iny ; CPU:$CD33 PRG:0D33 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DrawHudRow_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawHudRow_Loop:
|
|
lda (Zp00),y ; CPU:$CD34 PRG:0D34 B1 00
|
|
bne DrawHudRow_OnNonzero ; CPU:$CD36 PRG:0D36 D0 E3
|
|
lda #$00 ; CPU:$CD38 PRG:0D38 A9 00
|
|
sta $0590 ; CPU:$CD3A PRG:0D3A 8D 90 05
|
|
sta $0591 ; CPU:$CD3D PRG:0D3D 8D 91 05
|
|
sta Zp21 ; CPU:$CD40 PRG:0D40 85 21
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DrawHudRow_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawHudRow_Loop2:
|
|
rts ; CPU:$CD42 PRG:0D42 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCD43
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdatePpuCtrl:
|
|
lda PPUSTATUS ; CPU:$CD43 PRG:0D43 AD 02 20
|
|
lda Zp09 ; CPU:$CD46 PRG:0D46 A5 09
|
|
and #$FB ; CPU:$CD48 PRG:0D48 29 FB
|
|
sta PPUCTRL ; CPU:$CD4A PRG:0D4A 8D 00 20
|
|
sta Zp09 ; CPU:$CD4D PRG:0D4D 85 09
|
|
lda #$1C ; CPU:$CD4F PRG:0D4F A9 1C
|
|
clc ; CPU:$CD51 PRG:0D51 18
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdatePpuCtrl_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdatePpuCtrl_OnNonzero:
|
|
adc #$04 ; CPU:$CD52 PRG:0D52 69 04
|
|
dec Zp01 ; CPU:$CD54 PRG:0D54 C6 01
|
|
bne UpdatePpuCtrl_OnNonzero ; CPU:$CD56 PRG:0D56 D0 FA
|
|
sta Zp02 ; CPU:$CD58 PRG:0D58 85 02
|
|
sta PPUADDR ; CPU:$CD5A PRG:0D5A 8D 06 20
|
|
lda #$00 ; CPU:$CD5D PRG:0D5D A9 00
|
|
sta PPUADDR ; CPU:$CD5F PRG:0D5F 8D 06 20
|
|
ldx #$04 ; CPU:$CD62 PRG:0D62 A2 04
|
|
ldy #$00 ; CPU:$CD64 PRG:0D64 A0 00
|
|
lda Zp00 ; CPU:$CD66 PRG:0D66 A5 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdatePpuCtrl_OnNonzero2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdatePpuCtrl_OnNonzero2:
|
|
sta PPUDATA ; CPU:$CD68 PRG:0D68 8D 07 20
|
|
dey ; CPU:$CD6B PRG:0D6B 88
|
|
bne UpdatePpuCtrl_OnNonzero2 ; CPU:$CD6C PRG:0D6C D0 FA
|
|
dex ; CPU:$CD6E PRG:0D6E CA
|
|
bne UpdatePpuCtrl_OnNonzero2 ; CPU:$CD6F PRG:0D6F D0 F7
|
|
lda Zp02 ; CPU:$CD71 PRG:0D71 A5 02
|
|
adc #$03 ; CPU:$CD73 PRG:0D73 69 03
|
|
sta PPUADDR ; CPU:$CD75 PRG:0D75 8D 06 20
|
|
lda #$C0 ; CPU:$CD78 PRG:0D78 A9 C0
|
|
sta PPUADDR ; CPU:$CD7A PRG:0D7A 8D 06 20
|
|
ldy #$40 ; CPU:$CD7D PRG:0D7D A0 40
|
|
lda #$00 ; CPU:$CD7F PRG:0D7F A9 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdatePpuCtrl_OnNonzero3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdatePpuCtrl_OnNonzero3:
|
|
sta PPUDATA ; CPU:$CD81 PRG:0D81 8D 07 20
|
|
dey ; CPU:$CD84 PRG:0D84 88
|
|
bne UpdatePpuCtrl_OnNonzero3 ; CPU:$CD85 PRG:0D85 D0 FA
|
|
rts ; CPU:$CD87 PRG:0D87 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCD88
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecFrameCounter:
|
|
ldx #$01 ; CPU:$CD88 PRG:0D88 A2 01
|
|
dec FrameCountdown ; CPU:$CD8A PRG:0D8A C6 2A
|
|
bpl DecFrameCounter_OnNonnegative ; CPU:$CD8C PRG:0D8C 10 06
|
|
lda #$0A ; CPU:$CD8E PRG:0D8E A9 0A
|
|
sta FrameCountdown ; CPU:$CD90 PRG:0D90 85 2A
|
|
ldx #$03 ; CPU:$CD92 PRG:0D92 A2 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecFrameCounter_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecFrameCounter_OnNonnegative:
|
|
lda Zp2B,x ; CPU:$CD94 PRG:0D94 B5 2B
|
|
beq DecFrameCounter_Loop ; CPU:$CD96 PRG:0D96 F0 02
|
|
dec Zp2B,x ; CPU:$CD98 PRG:0D98 D6 2B
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecFrameCounter_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecFrameCounter_Loop:
|
|
dex ; CPU:$CD9A PRG:0D9A CA
|
|
bpl DecFrameCounter_OnNonnegative ; CPU:$CD9B PRG:0D9B 10 F7
|
|
rts ; CPU:$CD9D PRG:0D9D 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchViaStackPointer
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchViaStackPointer:
|
|
asl a ; CPU:$CD9E PRG:0D9E 0A
|
|
tay ; CPU:$CD9F PRG:0D9F A8
|
|
iny ; CPU:$CDA0 PRG:0DA0 C8
|
|
pla ; CPU:$CDA1 PRG:0DA1 68
|
|
sta Zp14 ; CPU:$CDA2 PRG:0DA2 85 14
|
|
pla ; CPU:$CDA4 PRG:0DA4 68
|
|
sta Zp15 ; CPU:$CDA5 PRG:0DA5 85 15
|
|
lda (Zp14),y ; CPU:$CDA7 PRG:0DA7 B1 14
|
|
tax ; CPU:$CDA9 PRG:0DA9 AA
|
|
iny ; CPU:$CDAA PRG:0DAA C8
|
|
lda (Zp14),y ; CPU:$CDAB PRG:0DAB B1 14
|
|
sta Zp15 ; CPU:$CDAD PRG:0DAD 85 15
|
|
stx Zp14 ; CPU:$CDAF PRG:0DAF 86 14
|
|
jmp (Zp14) ; CPU:$CDB1 PRG:0DB1 6C 14 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceDispatchPointer
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceDispatchPointer:
|
|
pha ; CPU:$CDB4 PRG:0DB4 48
|
|
clc ; CPU:$CDB5 PRG:0DB5 18
|
|
lda Zp14 ; CPU:$CDB6 PRG:0DB6 A5 14
|
|
adc Zp12 ; CPU:$CDB8 PRG:0DB8 65 12
|
|
sta Zp14 ; CPU:$CDBA PRG:0DBA 85 14
|
|
lda Zp15 ; CPU:$CDBC PRG:0DBC A5 15
|
|
adc Zp13 ; CPU:$CDBE PRG:0DBE 65 13
|
|
sta Zp15 ; CPU:$CDC0 PRG:0DC0 85 15
|
|
pla ; CPU:$CDC2 PRG:0DC2 68
|
|
rts ; CPU:$CDC3 PRG:0DC3 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceDispatchPointer_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceDispatchPointer_OnNonzero:
|
|
sta PPUADDR ; CPU:$CDC4 PRG:0DC4 8D 06 20
|
|
iny ; CPU:$CDC7 PRG:0DC7 C8
|
|
lda (Zp00),y ; CPU:$CDC8 PRG:0DC8 B1 00
|
|
sta PPUADDR ; CPU:$CDCA PRG:0DCA 8D 06 20
|
|
iny ; CPU:$CDCD PRG:0DCD C8
|
|
lda (Zp00),y ; CPU:$CDCE PRG:0DCE B1 00
|
|
asl a ; CPU:$CDD0 PRG:0DD0 0A
|
|
pha ; CPU:$CDD1 PRG:0DD1 48
|
|
lda Zp09 ; CPU:$CDD2 PRG:0DD2 A5 09
|
|
ora #$04 ; CPU:$CDD4 PRG:0DD4 09 04
|
|
bcs AdvanceDispatchPointer_Loop ; CPU:$CDD6 PRG:0DD6 B0 02
|
|
and #$FB ; CPU:$CDD8 PRG:0DD8 29 FB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceDispatchPointer_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceDispatchPointer_Loop:
|
|
sta PPUCTRL ; CPU:$CDDA PRG:0DDA 8D 00 20
|
|
sta Zp09 ; CPU:$CDDD PRG:0DDD 85 09
|
|
pla ; CPU:$CDDF PRG:0DDF 68
|
|
asl a ; CPU:$CDE0 PRG:0DE0 0A
|
|
bcc AdvanceDispatchPointer_Loop2 ; CPU:$CDE1 PRG:0DE1 90 03
|
|
ora #$02 ; CPU:$CDE3 PRG:0DE3 09 02
|
|
iny ; CPU:$CDE5 PRG:0DE5 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceDispatchPointer_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceDispatchPointer_Loop2:
|
|
lsr a ; CPU:$CDE6 PRG:0DE6 4A
|
|
lsr a ; CPU:$CDE7 PRG:0DE7 4A
|
|
tax ; CPU:$CDE8 PRG:0DE8 AA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceDispatchPointer_OnNonzero2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceDispatchPointer_OnNonzero2:
|
|
bcs AdvanceDispatchPointer_Loop3 ; CPU:$CDE9 PRG:0DE9 B0 01
|
|
iny ; CPU:$CDEB PRG:0DEB C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceDispatchPointer_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceDispatchPointer_Loop3:
|
|
lda (Zp00),y ; CPU:$CDEC PRG:0DEC B1 00
|
|
sta PPUDATA ; CPU:$CDEE PRG:0DEE 8D 07 20
|
|
dex ; CPU:$CDF1 PRG:0DF1 CA
|
|
bne AdvanceDispatchPointer_OnNonzero2 ; CPU:$CDF2 PRG:0DF2 D0 F5
|
|
sec ; CPU:$CDF4 PRG:0DF4 38
|
|
tya ; CPU:$CDF5 PRG:0DF5 98
|
|
adc Zp00 ; CPU:$CDF6 PRG:0DF6 65 00
|
|
sta Zp00 ; CPU:$CDF8 PRG:0DF8 85 00
|
|
lda #$00 ; CPU:$CDFA PRG:0DFA A9 00
|
|
adc Zp01 ; CPU:$CDFC PRG:0DFC 65 01
|
|
sta Zp01 ; CPU:$CDFE PRG:0DFE 85 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCE00
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramList:
|
|
ldx PPUSTATUS ; CPU:$CE00 PRG:0E00 AE 02 20
|
|
ldy #$00 ; CPU:$CE03 PRG:0E03 A0 00
|
|
lda (Zp00),y ; CPU:$CE05 PRG:0E05 B1 00
|
|
bne AdvanceDispatchPointer_OnNonzero ; CPU:$CE07 PRG:0E07 D0 BB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCE09
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetScroll:
|
|
pha ; CPU:$CE09 PRG:0E09 48
|
|
lda Zp0B ; CPU:$CE0A PRG:0E0A A5 0B
|
|
sta PPUSCROLL ; CPU:$CE0C PRG:0E0C 8D 05 20
|
|
lda Zp0C ; CPU:$CE0F PRG:0E0F A5 0C
|
|
sta PPUSCROLL ; CPU:$CE11 PRG:0E11 8D 05 20
|
|
pla ; CPU:$CE14 PRG:0E14 68
|
|
rts ; CPU:$CE15 PRG:0E15 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCE16
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CopyBlockToVram:
|
|
lda #$00 ; CPU:$CE16 PRG:0E16 A9 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CopyByteBlock
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CopyByteBlock:
|
|
sta Zp03 ; CPU:$CE18 PRG:0E18 85 03
|
|
lda #$02 ; CPU:$CE1A PRG:0E1A A9 02
|
|
sta Zp04 ; CPU:$CE1C PRG:0E1C 85 04
|
|
ldy Zp02 ; CPU:$CE1E PRG:0E1E A4 02
|
|
dey ; CPU:$CE20 PRG:0E20 88
|
|
ldx Zp02 ; CPU:$CE21 PRG:0E21 A6 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CopyByteBlock_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CopyByteBlock_OnNonzero:
|
|
lda (Zp00),y ; CPU:$CE23 PRG:0E23 B1 00
|
|
sta (Zp03),y ; CPU:$CE25 PRG:0E25 91 03
|
|
dey ; CPU:$CE27 PRG:0E27 88
|
|
dex ; CPU:$CE28 PRG:0E28 CA
|
|
bne CopyByteBlock_OnNonzero ; CPU:$CE29 PRG:0E29 D0 F8
|
|
rts ; CPU:$CE2B PRG:0E2B 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReturnOne
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReturnOne:
|
|
lda #$01 ; CPU:$CE2C PRG:0E2C A9 01
|
|
sta Zp21 ; CPU:$CE2E PRG:0E2E 85 21
|
|
ldy #$00 ; CPU:$CE30 PRG:0E30 A0 00
|
|
lda (Zp02),y ; CPU:$CE32 PRG:0E32 B1 02
|
|
and #$0F ; CPU:$CE34 PRG:0E34 29 0F
|
|
sta Zp05 ; CPU:$CE36 PRG:0E36 85 05
|
|
lda (Zp02),y ; CPU:$CE38 PRG:0E38 B1 02
|
|
lsr a ; CPU:$CE3A PRG:0E3A 4A
|
|
lsr a ; CPU:$CE3B PRG:0E3B 4A
|
|
lsr a ; CPU:$CE3C PRG:0E3C 4A
|
|
lsr a ; CPU:$CE3D PRG:0E3D 4A
|
|
sta Zp04 ; CPU:$CE3E PRG:0E3E 85 04
|
|
ldx $0590 ; CPU:$CE40 PRG:0E40 AE 90 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReturnOne_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReturnOne_OnNonzero:
|
|
lda Zp01 ; CPU:$CE43 PRG:0E43 A5 01
|
|
sta $0591,x ; CPU:$CE45 PRG:0E45 9D 91 05
|
|
jsr NextIndex ; CPU:$CE48 PRG:0E48 20 84 CE
|
|
lda Zp00 ; CPU:$CE4B PRG:0E4B A5 00
|
|
sta $0591,x ; CPU:$CE4D PRG:0E4D 9D 91 05
|
|
jsr NextIndex ; CPU:$CE50 PRG:0E50 20 84 CE
|
|
lda Zp05 ; CPU:$CE53 PRG:0E53 A5 05
|
|
sta Zp06 ; CPU:$CE55 PRG:0E55 85 06
|
|
sta $0591,x ; CPU:$CE57 PRG:0E57 9D 91 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReturnOne_OnNonzero2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReturnOne_OnNonzero2:
|
|
jsr NextIndex ; CPU:$CE5A PRG:0E5A 20 84 CE
|
|
iny ; CPU:$CE5D PRG:0E5D C8
|
|
lda (Zp02),y ; CPU:$CE5E PRG:0E5E B1 02
|
|
sta $0591,x ; CPU:$CE60 PRG:0E60 9D 91 05
|
|
dec Zp06 ; CPU:$CE63 PRG:0E63 C6 06
|
|
bne ReturnOne_OnNonzero2 ; CPU:$CE65 PRG:0E65 D0 F3
|
|
jsr NextIndex ; CPU:$CE67 PRG:0E67 20 84 CE
|
|
stx $0590 ; CPU:$CE6A PRG:0E6A 8E 90 05
|
|
clc ; CPU:$CE6D PRG:0E6D 18
|
|
lda #$20 ; CPU:$CE6E PRG:0E6E A9 20
|
|
adc Zp00 ; CPU:$CE70 PRG:0E70 65 00
|
|
sta Zp00 ; CPU:$CE72 PRG:0E72 85 00
|
|
lda #$00 ; CPU:$CE74 PRG:0E74 A9 00
|
|
adc Zp01 ; CPU:$CE76 PRG:0E76 65 01
|
|
sta Zp01 ; CPU:$CE78 PRG:0E78 85 01
|
|
dec Zp04 ; CPU:$CE7A PRG:0E7A C6 04
|
|
bne ReturnOne_OnNonzero ; CPU:$CE7C PRG:0E7C D0 C5
|
|
lda #$00 ; CPU:$CE7E PRG:0E7E A9 00
|
|
sta $0591,x ; CPU:$CE80 PRG:0E80 9D 91 05
|
|
rts ; CPU:$CE83 PRG:0E83 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NextIndex
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NextIndex:
|
|
inx ; CPU:$CE84 PRG:0E84 E8
|
|
txa ; CPU:$CE85 PRG:0E85 8A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCE86
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClampTileIndex:
|
|
cmp #$2F ; CPU:$CE86 PRG:0E86 C9 2F
|
|
bcc ClampTileIndex_Loop ; CPU:$CE88 PRG:0E88 90 0A
|
|
ldx $0590 ; CPU:$CE8A PRG:0E8A AE 90 05
|
|
lda #$00 ; CPU:$CE8D PRG:0E8D A9 00
|
|
sta $0591,x ; CPU:$CE8F PRG:0E8F 9D 91 05
|
|
pla ; CPU:$CE92 PRG:0E92 68
|
|
pla ; CPU:$CE93 PRG:0E93 68
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClampTileIndex_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClampTileIndex_Loop:
|
|
rts ; CPU:$CE94 PRG:0E94 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCE95
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckMarioFacing:
|
|
lda ZpB1 ; CPU:$CE95 PRG:0E95 A5 B1
|
|
and #$C0 ; CPU:$CE97 PRG:0E97 29 C0
|
|
beq LoadEnemyTileIndex ; CPU:$CE99 PRG:0E99 F0 01
|
|
rts ; CPU:$CE9B PRG:0E9B 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCE9C
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
LoadEnemyTileIndex:
|
|
lda ZpB1 ; CPU:$CE9C PRG:0E9C A5 B1
|
|
and #$03 ; CPU:$CE9E PRG:0E9E 29 03
|
|
bne LoadYFromZpB4 ; CPU:$CEA0 PRG:0EA0 D0 01
|
|
rts ; CPU:$CEA2 PRG:0EA2 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: LoadYFromZpB4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
LoadYFromZpB4:
|
|
ldy ActorPalette ; CPU:$CEA3 PRG:0EA3 A4 B4
|
|
lda $F4B2,y ; CPU:$CEA5 PRG:0EA5 B9 B2 F4
|
|
cmp #$FF ; CPU:$CEA8 PRG:0EA8 C9 FF
|
|
beq LoadYFromZpB4_Loop ; CPU:$CEAA PRG:0EAA F0 05
|
|
sta ZpB6 ; CPU:$CEAC PRG:0EAC 85 B6
|
|
inc ActorPalette ; CPU:$CEAE PRG:0EAE E6 B4
|
|
rts ; CPU:$CEB0 PRG:0EB0 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: LoadYFromZpB4_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
LoadYFromZpB4_Loop:
|
|
iny ; CPU:$CEB1 PRG:0EB1 C8
|
|
lda $F4B2,y ; CPU:$CEB2 PRG:0EB2 B9 B2 F4
|
|
sta ActorPalette ; CPU:$CEB5 PRG:0EB5 85 B4
|
|
jmp LoadYFromZpB4 ; CPU:$CEB7 PRG:0EB7 4C A3 CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCEBA
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetActorState:
|
|
lda #$12 ; CPU:$CEBA PRG:0EBA A9 12
|
|
sta ZpB6 ; CPU:$CEBC PRG:0EBC 85 B6
|
|
lda #$00 ; CPU:$CEBE PRG:0EBE A9 00
|
|
sta ActorPalette ; CPU:$CEC0 PRG:0EC0 85 B4
|
|
rts ; CPU:$CEC2 PRG:0EC2 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCEC3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScriptBlock:
|
|
lda #$60 ; CPU:$CEC3 PRG:0EC3 A9 60
|
|
sta ScriptPtrLo ; CPU:$CEC5 PRG:0EC5 85 A0
|
|
lda #$03 ; CPU:$CEC7 PRG:0EC7 A9 03
|
|
sta ScriptPtrHi ; CPU:$CEC9 PRG:0EC9 85 A1
|
|
lda #$20 ; CPU:$CECB PRG:0ECB A9 20
|
|
sta ScriptStep ; CPU:$CECD PRG:0ECD 85 A2
|
|
sta Zp12 ; CPU:$CECF PRG:0ECF 85 12
|
|
lda #$00 ; CPU:$CED1 PRG:0ED1 A9 00
|
|
sta Zp13 ; CPU:$CED3 PRG:0ED3 85 13
|
|
lda #$06 ; CPU:$CED5 PRG:0ED5 A9 06
|
|
sta ScriptStepCounter ; CPU:$CED7 PRG:0ED7 85 33
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScriptBlock_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScriptBlock_OnNonzero:
|
|
ldy #$00 ; CPU:$CED9 PRG:0ED9 A0 00
|
|
lda (ScriptPtrLo),y ; CPU:$CEDB PRG:0EDB B1 A0
|
|
beq InitEnemyScriptBlock_Loop ; CPU:$CEDD PRG:0EDD F0 10
|
|
jsr SetupScriptPointer ; CPU:$CEDF PRG:0EDF 20 85 CB
|
|
lda Zp14 ; CPU:$CEE2 PRG:0EE2 A5 14
|
|
sta ScriptPtrLo ; CPU:$CEE4 PRG:0EE4 85 A0
|
|
lda Zp15 ; CPU:$CEE6 PRG:0EE6 A5 15
|
|
sta ScriptPtrHi ; CPU:$CEE8 PRG:0EE8 85 A1
|
|
dec ScriptStepCounter ; CPU:$CEEA PRG:0EEA C6 33
|
|
bne InitEnemyScriptBlock_OnNonzero ; CPU:$CEEC PRG:0EEC D0 EB
|
|
rts ; CPU:$CEEE PRG:0EEE 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScriptBlock_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScriptBlock_Loop:
|
|
ldy ScriptCommand ; CPU:$CEEF PRG:0EEF A4 35
|
|
sty Zp1F ; CPU:$CEF1 PRG:0EF1 84 1F
|
|
iny ; CPU:$CEF3 PRG:0EF3 C8
|
|
lda (Zp36),y ; CPU:$CEF4 PRG:0EF4 B1 36
|
|
sta Zp1E ; CPU:$CEF6 PRG:0EF6 85 1E
|
|
sta Zp1D ; CPU:$CEF8 PRG:0EF8 85 1D
|
|
iny ; CPU:$CEFA PRG:0EFA C8
|
|
lda (Zp36),y ; CPU:$CEFB PRG:0EFB B1 36
|
|
cmp #$AA ; CPU:$CEFD PRG:0EFD C9 AA
|
|
beq InitEnemyScriptBlock_Loop2 ; CPU:$CEFF PRG:0EFF F0 03
|
|
sta Zp2E ; CPU:$CF01 PRG:0F01 85 2E
|
|
tya ; CPU:$CF03 PRG:0F03 98
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScriptBlock_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScriptBlock_Loop2:
|
|
sta ScriptCommand ; CPU:$CF04 PRG:0F04 85 35
|
|
lda #$52 ; CPU:$CF06 PRG:0F06 A9 52
|
|
sta Zp14 ; CPU:$CF08 PRG:0F08 85 14
|
|
lda #$F4 ; CPU:$CF0A PRG:0F0A A9 F4
|
|
sta Zp15 ; CPU:$CF0C PRG:0F0C 85 15
|
|
lda Zp1E ; CPU:$CF0E PRG:0F0E A5 1E
|
|
beq InitEnemyScriptBlock_Loop3 ; CPU:$CF10 PRG:0F10 F0 07
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScriptBlock_OnNonzero2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScriptBlock_OnNonzero2:
|
|
jsr AdvanceDispatchPointer ; CPU:$CF12 PRG:0F12 20 B4 CD
|
|
dec Zp1E ; CPU:$CF15 PRG:0F15 C6 1E
|
|
bne InitEnemyScriptBlock_OnNonzero2 ; CPU:$CF17 PRG:0F17 D0 F9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScriptBlock_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScriptBlock_Loop3:
|
|
lda ScriptStepCounter ; CPU:$CF19 PRG:0F19 A5 33
|
|
asl a ; CPU:$CF1B PRG:0F1B 0A
|
|
asl a ; CPU:$CF1C PRG:0F1C 0A
|
|
asl a ; CPU:$CF1D PRG:0F1D 0A
|
|
asl a ; CPU:$CF1E PRG:0F1E 0A
|
|
clc ; CPU:$CF1F PRG:0F1F 18
|
|
adc #$40 ; CPU:$CF20 PRG:0F20 69 40
|
|
tax ; CPU:$CF22 PRG:0F22 AA
|
|
ldy #$00 ; CPU:$CF23 PRG:0F23 A0 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScriptBlock_OnNonzero3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScriptBlock_OnNonzero3:
|
|
lda (Zp14),y ; CPU:$CF25 PRG:0F25 B1 14
|
|
cpy #$0A ; CPU:$CF27 PRG:0F27 C0 0A
|
|
bne InitEnemyScriptBlock_Loop4 ; CPU:$CF29 PRG:0F29 D0 01
|
|
txa ; CPU:$CF2B PRG:0F2B 8A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScriptBlock_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScriptBlock_Loop4:
|
|
sta (ScriptPtrLo),y ; CPU:$CF2C PRG:0F2C 91 A0
|
|
iny ; CPU:$CF2E PRG:0F2E C8
|
|
cpy #$20 ; CPU:$CF2F PRG:0F2F C0 20
|
|
bne InitEnemyScriptBlock_OnNonzero3 ; CPU:$CF31 PRG:0F31 D0 F2
|
|
lda GameRunningFlag ; CPU:$CF33 PRG:0F33 A5 30
|
|
beq InitEnemyScriptBlock_Loop5 ; CPU:$CF35 PRG:0F35 F0 04
|
|
lda #$01 ; CPU:$CF37 PRG:0F37 A9 01
|
|
bne InitEnemyScriptBlock_Loop7 ; CPU:$CF39 PRG:0F39 D0 18
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScriptBlock_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScriptBlock_Loop5:
|
|
lda Zp1F ; CPU:$CF3B PRG:0F3B A5 1F
|
|
cmp #$02 ; CPU:$CF3D PRG:0F3D C9 02
|
|
bne InitEnemyScriptBlock_Loop6 ; CPU:$CF3F PRG:0F3F D0 07
|
|
lda $04F5 ; CPU:$CF41 PRG:0F41 AD F5 04
|
|
eor #$03 ; CPU:$CF44 PRG:0F44 49 03
|
|
bne InitEnemyScriptBlock_Loop7 ; CPU:$CF46 PRG:0F46 D0 0B
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScriptBlock_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScriptBlock_Loop6:
|
|
jsr TestRamFlagPair0500 ; CPU:$CF48 PRG:0F48 20 28 D3
|
|
and #$01 ; CPU:$CF4B PRG:0F4B 29 01
|
|
clc ; CPU:$CF4D PRG:0F4D 18
|
|
adc #$01 ; CPU:$CF4E PRG:0F4E 69 01
|
|
sta $04F5 ; CPU:$CF50 PRG:0F50 8D F5 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScriptBlock_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScriptBlock_Loop7:
|
|
ldx #$F0 ; CPU:$CF53 PRG:0F53 A2 F0
|
|
cmp #$01 ; CPU:$CF55 PRG:0F55 C9 01
|
|
beq InitEnemyScriptBlock_Loop8 ; CPU:$CF57 PRG:0F57 F0 02
|
|
ldx #$10 ; CPU:$CF59 PRG:0F59 A2 10
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyScriptBlock_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyScriptBlock_Loop8:
|
|
ldy #$12 ; CPU:$CF5B PRG:0F5B A0 12
|
|
sta (ScriptPtrLo),y ; CPU:$CF5D PRG:0F5D 91 A0
|
|
txa ; CPU:$CF5F PRG:0F5F 8A
|
|
ldy #$09 ; CPU:$CF60 PRG:0F60 A0 09
|
|
sta (ScriptPtrLo),y ; CPU:$CF62 PRG:0F62 91 A0
|
|
inc Zp43 ; CPU:$CF64 PRG:0F64 E6 43
|
|
rts ; CPU:$CF66 PRG:0F66 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCF67
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnFree:
|
|
lda Zp71 ; CPU:$CF67 PRG:0F67 A5 71
|
|
bne CheckEnemySpawnFree_Loop2 ; CPU:$CF69 PRG:0F69 D0 1D
|
|
lda ZpC1 ; CPU:$CF6B PRG:0F6B A5 C1
|
|
bne CheckEnemySpawnFree_Loop2 ; CPU:$CF6D PRG:0F6D D0 19
|
|
lda $05FF ; CPU:$CF6F PRG:0F6F AD FF 05
|
|
bne CheckEnemySpawnFree_Loop2 ; CPU:$CF72 PRG:0F72 D0 14
|
|
lda $04C5 ; CPU:$CF74 PRG:0F74 AD C5 04
|
|
bne CheckEnemySpawnFree_Loop2 ; CPU:$CF77 PRG:0F77 D0 0F
|
|
ldx ActorCommand ; CPU:$CF79 PRG:0F79 A6 BF
|
|
ldy #$01 ; CPU:$CF7B PRG:0F7B A0 01
|
|
cpx #$01 ; CPU:$CF7D PRG:0F7D E0 01
|
|
beq CheckEnemySpawnFree_Loop ; CPU:$CF7F PRG:0F7F F0 02
|
|
ldy #$06 ; CPU:$CF81 PRG:0F81 A0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawnFree_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnFree_Loop:
|
|
lda $0074,y ; CPU:$CF83 PRG:0F83 B9 74 00
|
|
beq CheckEnemySpawnFree_Loop3 ; CPU:$CF86 PRG:0F86 F0 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawnFree_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnFree_Loop2:
|
|
rts ; CPU:$CF88 PRG:0F88 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawnFree_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnFree_Loop3:
|
|
ldx #$00 ; CPU:$CF89 PRG:0F89 A2 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawnFree_OnCarryClear
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnFree_OnCarryClear:
|
|
lda ZpC9 ; CPU:$CF8B PRG:0F8B A5 C9
|
|
cmp $F574,x ; CPU:$CF8D PRG:0F8D DD 74 F5
|
|
bne CheckEnemySpawnFree_Loop4 ; CPU:$CF90 PRG:0F90 D0 15
|
|
lda ZpCA ; CPU:$CF92 PRG:0F92 A5 CA
|
|
inx ; CPU:$CF94 PRG:0F94 E8
|
|
cmp $F574,x ; CPU:$CF95 PRG:0F95 DD 74 F5
|
|
bne CheckEnemySpawnFree_Loop5 ; CPU:$CF98 PRG:0F98 D0 0E
|
|
cpx #$08 ; CPU:$CF9A PRG:0F9A E0 08
|
|
bcc CheckEnemySpawnFree_Loop7 ; CPU:$CF9C PRG:0F9C 90 26
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawnFree_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnFree_OnZero:
|
|
ldx #$02 ; CPU:$CF9E PRG:0F9E A2 02
|
|
lda #$E0 ; CPU:$CFA0 PRG:0FA0 A9 E0
|
|
sta Zp12 ; CPU:$CFA2 PRG:0FA2 85 12
|
|
jmp ComputeSpriteOffset ; CPU:$CFA4 PRG:0FA4 4C CA CF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawnFree_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnFree_Loop4:
|
|
inx ; CPU:$CFA7 PRG:0FA7 E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawnFree_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnFree_Loop5:
|
|
inx ; CPU:$CFA8 PRG:0FA8 E8
|
|
cpx #$10 ; CPU:$CFA9 PRG:0FA9 E0 10
|
|
bcc CheckEnemySpawnFree_OnCarryClear ; CPU:$CFAB PRG:0FAB 90 DE
|
|
lda ZpCB ; CPU:$CFAD PRG:0FAD A5 CB
|
|
cmp #$FA ; CPU:$CFAF PRG:0FAF C9 FA
|
|
bcc CheckEnemySpawnFree_Loop6 ; CPU:$CFB1 PRG:0FB1 90 03
|
|
jmp CheckEnemyActive ; CPU:$CFB3 PRG:0FB3 4C DF D2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawnFree_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnFree_Loop6:
|
|
lda ZpC9 ; CPU:$CFB6 PRG:0FB6 A5 C9
|
|
and #$1F ; CPU:$CFB8 PRG:0FB8 29 1F
|
|
beq CheckEnemySpawnFree_OnZero ; CPU:$CFBA PRG:0FBA F0 E2
|
|
cmp #$1F ; CPU:$CFBC PRG:0FBC C9 1F
|
|
beq CheckEnemySpawnFree_Loop7 ; CPU:$CFBE PRG:0FBE F0 04
|
|
ldx #$03 ; CPU:$CFC0 PRG:0FC0 A2 03
|
|
bne CheckEnemySpawnFree_Loop8 ; CPU:$CFC2 PRG:0FC2 D0 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawnFree_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnFree_Loop7:
|
|
ldx #$01 ; CPU:$CFC4 PRG:0FC4 A2 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawnFree_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnFree_Loop8:
|
|
lda #$DF ; CPU:$CFC6 PRG:0FC6 A9 DF
|
|
sta Zp12 ; CPU:$CFC8 PRG:0FC8 85 12
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCCFCA
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeSpriteOffset:
|
|
lda ZpCB ; CPU:$CFCA PRG:0FCA A5 CB
|
|
cmp #$A0 ; CPU:$CFCC PRG:0FCC C9 A0
|
|
bcs CheckEnemySpawnFree_Loop2 ; CPU:$CFCE PRG:0FCE B0 B8
|
|
lda #$FF ; CPU:$CFD0 PRG:0FD0 A9 FF
|
|
sta Zp13 ; CPU:$CFD2 PRG:0FD2 85 13
|
|
lda ZpCA ; CPU:$CFD4 PRG:0FD4 A5 CA
|
|
sta Zp15 ; CPU:$CFD6 PRG:0FD6 85 15
|
|
lda ZpC9 ; CPU:$CFD8 PRG:0FD8 A5 C9
|
|
sta Zp14 ; CPU:$CFDA PRG:0FDA 85 14
|
|
lda #$01 ; CPU:$CFDC PRG:0FDC A9 01
|
|
sta $0083,y ; CPU:$CFDE PRG:0FDE 99 83 00
|
|
lda ZpBE ; CPU:$CFE1 PRG:0FE1 A5 BE
|
|
clc ; CPU:$CFE3 PRG:0FE3 18
|
|
adc #$01 ; CPU:$CFE4 PRG:0FE4 69 01
|
|
sta $0084,y ; CPU:$CFE6 PRG:0FE6 99 84 00
|
|
lda ScrollX ; CPU:$CFE9 PRG:0FE9 A5 B9
|
|
sta a:Zp85,y ; CPU:$CFEB PRG:0FEB 99 85 00
|
|
jsr AdvanceDispatchPointer ; CPU:$CFEE PRG:0FEE 20 B4 CD
|
|
lda ZpCB ; CPU:$CFF1 PRG:0FF1 A5 CB
|
|
sec ; CPU:$CFF3 PRG:0FF3 38
|
|
sbc #$93 ; CPU:$CFF4 PRG:0FF4 E9 93
|
|
stx Zp00 ; CPU:$CFF6 PRG:0FF6 86 00
|
|
asl a ; CPU:$CFF8 PRG:0FF8 0A
|
|
asl a ; CPU:$CFF9 PRG:0FF9 0A
|
|
asl a ; CPU:$CFFA PRG:0FFA 0A
|
|
asl a ; CPU:$CFFB PRG:0FFB 0A
|
|
ora Zp00 ; CPU:$CFFC PRG:0FFC 05 00
|
|
sta $0074,y ; CPU:$CFFE PRG:0FFE 99 74 00
|
|
dey ; CPU:$D001 PRG:1001 88
|
|
lda #$00 ; CPU:$D002 PRG:1002 A9 00
|
|
sta $0074,y ; CPU:$D004 PRG:1004 99 74 00
|
|
iny ; CPU:$D007 PRG:1007 C8
|
|
iny ; CPU:$D008 PRG:1008 C8
|
|
sta $0074,y ; CPU:$D009 PRG:1009 99 74 00
|
|
iny ; CPU:$D00C PRG:100C C8
|
|
lda Zp14 ; CPU:$D00D PRG:100D A5 14
|
|
sta $0074,y ; CPU:$D00F PRG:100F 99 74 00
|
|
iny ; CPU:$D012 PRG:1012 C8
|
|
lda Zp15 ; CPU:$D013 PRG:1013 A5 15
|
|
sta $0074,y ; CPU:$D015 PRG:1015 99 74 00
|
|
rts ; CPU:$D018 PRG:1018 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD019
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyTileRangeB:
|
|
lda ActorTileIndex ; CPU:$D019 PRG:1019 A5 B8
|
|
ldy #$03 ; CPU:$D01B PRG:101B A0 03
|
|
cmp #$50 ; CPU:$D01D PRG:101D C9 50
|
|
bcc CheckEnemyTileRangeB_Loop ; CPU:$D01F PRG:101F 90 0B
|
|
dey ; CPU:$D021 PRG:1021 88
|
|
cmp #$80 ; CPU:$D022 PRG:1022 C9 80
|
|
bcc CheckEnemyTileRangeB_Loop ; CPU:$D024 PRG:1024 90 06
|
|
dey ; CPU:$D026 PRG:1026 88
|
|
cmp #$B0 ; CPU:$D027 PRG:1027 C9 B0
|
|
bcc CheckEnemyTileRangeB_Loop ; CPU:$D029 PRG:1029 90 01
|
|
dey ; CPU:$D02B PRG:102B 88
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyTileRangeB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyTileRangeB_Loop:
|
|
sty ZpBE ; CPU:$D02C PRG:102C 84 BE
|
|
rts ; CPU:$D02E PRG:102E 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD02F
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawScoreDigit:
|
|
lda #$01 ; CPU:$D02F PRG:102F A9 01
|
|
sta Zp21 ; CPU:$D031 PRG:1031 85 21
|
|
ldx Zp00 ; CPU:$D033 PRG:1033 A6 00
|
|
jsr NextScoreDigit ; CPU:$D035 PRG:1035 20 3F D0
|
|
lda Zp00 ; CPU:$D038 PRG:1038 A5 00
|
|
lsr a ; CPU:$D03A PRG:103A 4A
|
|
lsr a ; CPU:$D03B PRG:103B 4A
|
|
lsr a ; CPU:$D03C PRG:103C 4A
|
|
lsr a ; CPU:$D03D PRG:103D 4A
|
|
tax ; CPU:$D03E PRG:103E AA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD03F
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NextScoreDigit:
|
|
inx ; CPU:$D03F PRG:103F E8
|
|
txa ; CPU:$D040 PRG:1040 8A
|
|
and #$0F ; CPU:$D041 PRG:1041 29 0F
|
|
cmp #$09 ; CPU:$D043 PRG:1043 C9 09
|
|
bcs NextScoreDigit_Loop2 ; CPU:$D045 PRG:1045 B0 6C
|
|
asl a ; CPU:$D047 PRG:1047 0A
|
|
asl a ; CPU:$D048 PRG:1048 0A
|
|
tay ; CPU:$D049 PRG:1049 A8
|
|
sta Zp02 ; CPU:$D04A PRG:104A 85 02
|
|
ldx $0590 ; CPU:$D04C PRG:104C AE 90 05
|
|
lda $F68D,y ; CPU:$D04F PRG:104F B9 8D F6
|
|
sta $0591,x ; CPU:$D052 PRG:1052 9D 91 05
|
|
jsr NextIndex ; CPU:$D055 PRG:1055 20 84 CE
|
|
iny ; CPU:$D058 PRG:1058 C8
|
|
lda $F68D,y ; CPU:$D059 PRG:1059 B9 8D F6
|
|
sta $0591,x ; CPU:$D05C PRG:105C 9D 91 05
|
|
jsr NextIndex ; CPU:$D05F PRG:105F 20 84 CE
|
|
iny ; CPU:$D062 PRG:1062 C8
|
|
lda $F68D,y ; CPU:$D063 PRG:1063 B9 8D F6
|
|
and #$07 ; CPU:$D066 PRG:1066 29 07
|
|
sta $0591,x ; CPU:$D068 PRG:1068 9D 91 05
|
|
sta Zp01 ; CPU:$D06B PRG:106B 85 01
|
|
txa ; CPU:$D06D PRG:106D 8A
|
|
sec ; CPU:$D06E PRG:106E 38
|
|
adc Zp01 ; CPU:$D06F PRG:106F 65 01
|
|
jsr ClampTileIndex ; CPU:$D071 PRG:1071 20 86 CE
|
|
tax ; CPU:$D074 PRG:1074 AA
|
|
stx $0590 ; CPU:$D075 PRG:1075 8E 90 05
|
|
lda #$00 ; CPU:$D078 PRG:1078 A9 00
|
|
sta $0591,x ; CPU:$D07A PRG:107A 9D 91 05
|
|
iny ; CPU:$D07D PRG:107D C8
|
|
lda $F68D,y ; CPU:$D07E PRG:107E B9 8D F6
|
|
sta Zp03 ; CPU:$D081 PRG:1081 85 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NextScoreDigit_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NextScoreDigit_OnNonzero:
|
|
dex ; CPU:$D083 PRG:1083 CA
|
|
lda a:Zp90,y ; CPU:$D084 PRG:1084 B9 90 00
|
|
and #$0F ; CPU:$D087 PRG:1087 29 0F
|
|
sta $0591,x ; CPU:$D089 PRG:1089 9D 91 05
|
|
dec Zp01 ; CPU:$D08C PRG:108C C6 01
|
|
beq NextScoreDigit_Loop ; CPU:$D08E PRG:108E F0 12
|
|
dex ; CPU:$D090 PRG:1090 CA
|
|
lda a:Zp90,y ; CPU:$D091 PRG:1091 B9 90 00
|
|
and #$F0 ; CPU:$D094 PRG:1094 29 F0
|
|
lsr a ; CPU:$D096 PRG:1096 4A
|
|
lsr a ; CPU:$D097 PRG:1097 4A
|
|
lsr a ; CPU:$D098 PRG:1098 4A
|
|
lsr a ; CPU:$D099 PRG:1099 4A
|
|
sta $0591,x ; CPU:$D09A PRG:109A 9D 91 05
|
|
dey ; CPU:$D09D PRG:109D 88
|
|
dec Zp01 ; CPU:$D09E PRG:109E C6 01
|
|
bne NextScoreDigit_OnNonzero ; CPU:$D0A0 PRG:10A0 D0 E1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NextScoreDigit_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NextScoreDigit_Loop:
|
|
lda Zp03 ; CPU:$D0A2 PRG:10A2 A5 03
|
|
and #$01 ; CPU:$D0A4 PRG:10A4 29 01
|
|
beq NextScoreDigit_Loop2 ; CPU:$D0A6 PRG:10A6 F0 0B
|
|
ldy Zp02 ; CPU:$D0A8 PRG:10A8 A4 02
|
|
clc ; CPU:$D0AA PRG:10AA 18
|
|
lda a:Zp90,y ; CPU:$D0AB PRG:10AB B9 90 00
|
|
adc #$37 ; CPU:$D0AE PRG:10AE 69 37
|
|
sta $0591,x ; CPU:$D0B0 PRG:10B0 9D 91 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: NextScoreDigit_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NextScoreDigit_Loop2:
|
|
rts ; CPU:$D0B3 PRG:10B3 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD0B4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeSpriteOffsetB:
|
|
and #$07 ; CPU:$D0B4 PRG:10B4 29 07
|
|
asl a ; CPU:$D0B6 PRG:10B6 0A
|
|
asl a ; CPU:$D0B7 PRG:10B7 0A
|
|
tax ; CPU:$D0B8 PRG:10B8 AA
|
|
lda Zp04 ; CPU:$D0B9 PRG:10B9 A5 04
|
|
beq ComputeSpriteOffsetB_Loop ; CPU:$D0BB PRG:10BB F0 27
|
|
lda Zp94,x ; CPU:$D0BD PRG:10BD B5 94
|
|
beq ComputeSpriteOffsetB_Loop2 ; CPU:$D0BF PRG:10BF F0 27
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ComputeSpriteOffsetB_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeSpriteOffsetB_OnZero:
|
|
clc ; CPU:$D0C1 PRG:10C1 18
|
|
lda Zp97,x ; CPU:$D0C2 PRG:10C2 B5 97
|
|
sta Zp03 ; CPU:$D0C4 PRG:10C4 85 03
|
|
lda Zp07 ; CPU:$D0C6 PRG:10C6 A5 07
|
|
jsr AddDecimalDigit ; CPU:$D0C8 PRG:10C8 20 39 D1
|
|
sta Zp97,x ; CPU:$D0CB PRG:10CB 95 97
|
|
lda Zp96,x ; CPU:$D0CD PRG:10CD B5 96
|
|
sta Zp03 ; CPU:$D0CF PRG:10CF 85 03
|
|
lda Zp06 ; CPU:$D0D1 PRG:10D1 A5 06
|
|
jsr AddDecimalDigit ; CPU:$D0D3 PRG:10D3 20 39 D1
|
|
sta Zp96,x ; CPU:$D0D6 PRG:10D6 95 96
|
|
lda Zp95,x ; CPU:$D0D8 PRG:10D8 B5 95
|
|
sta Zp03 ; CPU:$D0DA PRG:10DA 85 03
|
|
lda Zp05 ; CPU:$D0DC PRG:10DC A5 05
|
|
jsr AddDecimalDigit ; CPU:$D0DE PRG:10DE 20 39 D1
|
|
sta Zp95,x ; CPU:$D0E1 PRG:10E1 95 95
|
|
rts ; CPU:$D0E3 PRG:10E3 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ComputeSpriteOffsetB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeSpriteOffsetB_Loop:
|
|
lda Zp94,x ; CPU:$D0E4 PRG:10E4 B5 94
|
|
beq ComputeSpriteOffsetB_OnZero ; CPU:$D0E6 PRG:10E6 F0 D9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ComputeSpriteOffsetB_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeSpriteOffsetB_Loop2:
|
|
sec ; CPU:$D0E8 PRG:10E8 38
|
|
lda Zp97,x ; CPU:$D0E9 PRG:10E9 B5 97
|
|
sta Zp03 ; CPU:$D0EB PRG:10EB 85 03
|
|
lda Zp07 ; CPU:$D0ED PRG:10ED A5 07
|
|
jsr AdjustDecimalColumns ; CPU:$D0EF PRG:10EF 20 5A D1
|
|
sta Zp97,x ; CPU:$D0F2 PRG:10F2 95 97
|
|
lda Zp96,x ; CPU:$D0F4 PRG:10F4 B5 96
|
|
sta Zp03 ; CPU:$D0F6 PRG:10F6 85 03
|
|
lda Zp06 ; CPU:$D0F8 PRG:10F8 A5 06
|
|
jsr AdjustDecimalColumns ; CPU:$D0FA PRG:10FA 20 5A D1
|
|
sta Zp96,x ; CPU:$D0FD PRG:10FD 95 96
|
|
lda Zp95,x ; CPU:$D0FF PRG:10FF B5 95
|
|
sta Zp03 ; CPU:$D101 PRG:1101 85 03
|
|
lda Zp05 ; CPU:$D103 PRG:1103 A5 05
|
|
jsr AdjustDecimalColumns ; CPU:$D105 PRG:1105 20 5A D1
|
|
sta Zp95,x ; CPU:$D108 PRG:1108 95 95
|
|
lda Zp95,x ; CPU:$D10A PRG:110A B5 95
|
|
bne ComputeSpriteOffsetB_Loop3 ; CPU:$D10C PRG:110C D0 08
|
|
lda Zp96,x ; CPU:$D10E PRG:110E B5 96
|
|
bne ComputeSpriteOffsetB_Loop3 ; CPU:$D110 PRG:1110 D0 04
|
|
lda Zp97,x ; CPU:$D112 PRG:1112 B5 97
|
|
beq ComputeSpriteOffsetB_Loop4 ; CPU:$D114 PRG:1114 F0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ComputeSpriteOffsetB_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeSpriteOffsetB_Loop3:
|
|
bcs ComputeSpriteOffsetB_Loop5 ; CPU:$D116 PRG:1116 B0 20
|
|
lda Zp94,x ; CPU:$D118 PRG:1118 B5 94
|
|
eor #$FF ; CPU:$D11A PRG:111A 49 FF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ComputeSpriteOffsetB_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeSpriteOffsetB_Loop4:
|
|
sta Zp94,x ; CPU:$D11C PRG:111C 95 94
|
|
sec ; CPU:$D11E PRG:111E 38
|
|
lda #$00 ; CPU:$D11F PRG:111F A9 00
|
|
sta Zp03 ; CPU:$D121 PRG:1121 85 03
|
|
lda Zp97,x ; CPU:$D123 PRG:1123 B5 97
|
|
jsr AdjustDecimalColumns ; CPU:$D125 PRG:1125 20 5A D1
|
|
sta Zp97,x ; CPU:$D128 PRG:1128 95 97
|
|
lda Zp96,x ; CPU:$D12A PRG:112A B5 96
|
|
jsr AdjustDecimalColumns ; CPU:$D12C PRG:112C 20 5A D1
|
|
sta Zp96,x ; CPU:$D12F PRG:112F 95 96
|
|
lda Zp95,x ; CPU:$D131 PRG:1131 B5 95
|
|
jsr AdjustDecimalColumns ; CPU:$D133 PRG:1133 20 5A D1
|
|
sta Zp95,x ; CPU:$D136 PRG:1136 95 95
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ComputeSpriteOffsetB_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeSpriteOffsetB_Loop5:
|
|
rts ; CPU:$D138 PRG:1138 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD139
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AddDecimalDigit:
|
|
jsr SplitDecimalByte ; CPU:$D139 PRG:1139 20 7C D1
|
|
adc Zp01 ; CPU:$D13C PRG:113C 65 01
|
|
cmp #$0A ; CPU:$D13E PRG:113E C9 0A
|
|
bcc AddDecimalDigit_Loop ; CPU:$D140 PRG:1140 90 02
|
|
adc #$05 ; CPU:$D142 PRG:1142 69 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AddDecimalDigit_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AddDecimalDigit_Loop:
|
|
clc ; CPU:$D144 PRG:1144 18
|
|
adc Zp02 ; CPU:$D145 PRG:1145 65 02
|
|
sta Zp02 ; CPU:$D147 PRG:1147 85 02
|
|
lda Zp03 ; CPU:$D149 PRG:1149 A5 03
|
|
and #$F0 ; CPU:$D14B PRG:114B 29 F0
|
|
adc Zp02 ; CPU:$D14D PRG:114D 65 02
|
|
bcc AddDecimalDigit_Loop2 ; CPU:$D14F PRG:114F 90 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AddDecimalDigit_OnCarrySet
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AddDecimalDigit_OnCarrySet:
|
|
adc #$5F ; CPU:$D151 PRG:1151 69 5F
|
|
sec ; CPU:$D153 PRG:1153 38
|
|
rts ; CPU:$D154 PRG:1154 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AddDecimalDigit_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AddDecimalDigit_Loop2:
|
|
cmp #$A0 ; CPU:$D155 PRG:1155 C9 A0
|
|
bcs AddDecimalDigit_OnCarrySet ; CPU:$D157 PRG:1157 B0 F8
|
|
rts ; CPU:$D159 PRG:1159 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdjustDecimalColumns
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdjustDecimalColumns:
|
|
jsr SplitDecimalByte ; CPU:$D15A PRG:115A 20 7C D1
|
|
sbc Zp01 ; CPU:$D15D PRG:115D E5 01
|
|
sta Zp01 ; CPU:$D15F PRG:115F 85 01
|
|
bcs AdjustDecimalColumns_Loop ; CPU:$D161 PRG:1161 B0 0A
|
|
adc #$0A ; CPU:$D163 PRG:1163 69 0A
|
|
sta Zp01 ; CPU:$D165 PRG:1165 85 01
|
|
lda Zp02 ; CPU:$D167 PRG:1167 A5 02
|
|
adc #$0F ; CPU:$D169 PRG:1169 69 0F
|
|
sta Zp02 ; CPU:$D16B PRG:116B 85 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdjustDecimalColumns_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdjustDecimalColumns_Loop:
|
|
lda Zp03 ; CPU:$D16D PRG:116D A5 03
|
|
and #$F0 ; CPU:$D16F PRG:116F 29 F0
|
|
sec ; CPU:$D171 PRG:1171 38
|
|
sbc Zp02 ; CPU:$D172 PRG:1172 E5 02
|
|
bcs AdjustDecimalColumns_Loop2 ; CPU:$D174 PRG:1174 B0 03
|
|
adc #$A0 ; CPU:$D176 PRG:1176 69 A0
|
|
clc ; CPU:$D178 PRG:1178 18
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdjustDecimalColumns_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdjustDecimalColumns_Loop2:
|
|
ora Zp01 ; CPU:$D179 PRG:1179 05 01
|
|
rts ; CPU:$D17B PRG:117B 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD17C
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SplitDecimalByte:
|
|
pha ; CPU:$D17C PRG:117C 48
|
|
and #$0F ; CPU:$D17D PRG:117D 29 0F
|
|
sta Zp01 ; CPU:$D17F PRG:117F 85 01
|
|
pla ; CPU:$D181 PRG:1181 68
|
|
and #$F0 ; CPU:$D182 PRG:1182 29 F0
|
|
sta Zp02 ; CPU:$D184 PRG:1184 85 02
|
|
lda Zp03 ; CPU:$D186 PRG:1186 A5 03
|
|
and #$0F ; CPU:$D188 PRG:1188 29 0F
|
|
rts ; CPU:$D18A PRG:118A 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD18B
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramColumn:
|
|
lda #$00 ; CPU:$D18B PRG:118B A9 00
|
|
sta Zp04 ; CPU:$D18D PRG:118D 85 04
|
|
clc ; CPU:$D18F PRG:118F 18
|
|
lda Zp00 ; CPU:$D190 PRG:1190 A5 00
|
|
adc #$10 ; CPU:$D192 PRG:1192 69 10
|
|
and #$F0 ; CPU:$D194 PRG:1194 29 F0
|
|
lsr a ; CPU:$D196 PRG:1196 4A
|
|
lsr a ; CPU:$D197 PRG:1197 4A
|
|
tay ; CPU:$D198 PRG:1198 A8
|
|
lda Zp00 ; CPU:$D199 PRG:1199 A5 00
|
|
and #$07 ; CPU:$D19B PRG:119B 29 07
|
|
asl a ; CPU:$D19D PRG:119D 0A
|
|
asl a ; CPU:$D19E PRG:119E 0A
|
|
tax ; CPU:$D19F PRG:119F AA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramColumn_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramColumn_OnNonnegative:
|
|
lda a:Zp90,y ; CPU:$D1A0 PRG:11A0 B9 90 00
|
|
beq SetVramColumn_Loop3 ; CPU:$D1A3 PRG:11A3 F0 51
|
|
lda Zp94,x ; CPU:$D1A5 PRG:11A5 B5 94
|
|
beq SetVramColumn_OnNonzero ; CPU:$D1A7 PRG:11A7 F0 26
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramColumn_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramColumn_OnZero:
|
|
sec ; CPU:$D1A9 PRG:11A9 38
|
|
lda a:Zp93,y ; CPU:$D1AA PRG:11AA B9 93 00
|
|
sta Zp03 ; CPU:$D1AD PRG:11AD 85 03
|
|
lda Zp97,x ; CPU:$D1AF PRG:11AF B5 97
|
|
jsr AdjustDecimalColumns ; CPU:$D1B1 PRG:11B1 20 5A D1
|
|
lda a:Zp92,y ; CPU:$D1B4 PRG:11B4 B9 92 00
|
|
sta Zp03 ; CPU:$D1B7 PRG:11B7 85 03
|
|
lda Zp96,x ; CPU:$D1B9 PRG:11B9 B5 96
|
|
jsr AdjustDecimalColumns ; CPU:$D1BB PRG:11BB 20 5A D1
|
|
lda a:Zp91,y ; CPU:$D1BE PRG:11BE B9 91 00
|
|
sta Zp03 ; CPU:$D1C1 PRG:11C1 85 03
|
|
lda Zp95,x ; CPU:$D1C3 PRG:11C3 B5 95
|
|
jsr AdjustDecimalColumns ; CPU:$D1C5 PRG:11C5 20 5A D1
|
|
bcs SetVramColumn_Loop4 ; CPU:$D1C8 PRG:11C8 B0 30
|
|
lda a:Zp90,y ; CPU:$D1CA PRG:11CA B9 90 00
|
|
bne SetVramColumn_Loop5 ; CPU:$D1CD PRG:11CD D0 30
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramColumn_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramColumn_OnNonzero:
|
|
lda #$FF ; CPU:$D1CF PRG:11CF A9 FF
|
|
sta Zp04 ; CPU:$D1D1 PRG:11D1 85 04
|
|
sec ; CPU:$D1D3 PRG:11D3 38
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramColumn_OnCarryClear
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramColumn_OnCarryClear:
|
|
tya ; CPU:$D1D4 PRG:11D4 98
|
|
bne SetVramColumn_Loop2 ; CPU:$D1D5 PRG:11D5 D0 1E
|
|
bcc SetVramColumn_Loop ; CPU:$D1D7 PRG:11D7 90 10
|
|
lda Zp94,x ; CPU:$D1D9 PRG:11D9 B5 94
|
|
sta Zp90 ; CPU:$D1DB PRG:11DB 85 90
|
|
lda Zp95,x ; CPU:$D1DD PRG:11DD B5 95
|
|
sta Zp91 ; CPU:$D1DF PRG:11DF 85 91
|
|
lda Zp96,x ; CPU:$D1E1 PRG:11E1 B5 96
|
|
sta Zp92 ; CPU:$D1E3 PRG:11E3 85 92
|
|
lda Zp97,x ; CPU:$D1E5 PRG:11E5 B5 97
|
|
sta Zp93 ; CPU:$D1E7 PRG:11E7 85 93
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramColumn_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramColumn_Loop:
|
|
lda Zp00 ; CPU:$D1E9 PRG:11E9 A5 00
|
|
and #$08 ; CPU:$D1EB PRG:11EB 29 08
|
|
beq SetVramColumn_Loop2 ; CPU:$D1ED PRG:11ED F0 06
|
|
dex ; CPU:$D1EF PRG:11EF CA
|
|
dex ; CPU:$D1F0 PRG:11F0 CA
|
|
dex ; CPU:$D1F1 PRG:11F1 CA
|
|
dex ; CPU:$D1F2 PRG:11F2 CA
|
|
bpl SetVramColumn_OnNonnegative ; CPU:$D1F3 PRG:11F3 10 AB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramColumn_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramColumn_Loop2:
|
|
rts ; CPU:$D1F5 PRG:11F5 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramColumn_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramColumn_Loop3:
|
|
lda Zp94,x ; CPU:$D1F6 PRG:11F6 B5 94
|
|
beq SetVramColumn_OnZero ; CPU:$D1F8 PRG:11F8 F0 AF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramColumn_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramColumn_Loop4:
|
|
lda a:Zp90,y ; CPU:$D1FA PRG:11FA B9 90 00
|
|
bne SetVramColumn_OnNonzero ; CPU:$D1FD PRG:11FD D0 D0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetVramColumn_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetVramColumn_Loop5:
|
|
clc ; CPU:$D1FF PRG:11FF 18
|
|
bcc SetVramColumn_OnCarryClear ; CPU:$D200 PRG:1200 90 D2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD202
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectEnemyFrame:
|
|
lda Zp71 ; CPU:$D202 PRG:1202 A5 71
|
|
bne SelectEnemyFrame_Loop2 ; CPU:$D204 PRG:1204 D0 11
|
|
lda FrameCounter ; CPU:$D206 PRG:1206 A5 2F
|
|
lsr a ; CPU:$D208 PRG:1208 4A
|
|
ldy #$00 ; CPU:$D209 PRG:1209 A0 00
|
|
bcc SelectEnemyFrame_Loop ; CPU:$D20B PRG:120B 90 02
|
|
ldy #$05 ; CPU:$D20D PRG:120D A0 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SelectEnemyFrame_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectEnemyFrame_Loop:
|
|
sty Zp05 ; CPU:$D20F PRG:120F 84 05
|
|
iny ; CPU:$D211 PRG:1211 C8
|
|
lda $0074,y ; CPU:$D212 PRG:1212 B9 74 00
|
|
bne SelectEnemyFrame_Loop3 ; CPU:$D215 PRG:1215 D0 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SelectEnemyFrame_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectEnemyFrame_Loop2:
|
|
rts ; CPU:$D217 PRG:1217 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SelectEnemyFrame_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectEnemyFrame_Loop3:
|
|
sta Zp10 ; CPU:$D218 PRG:1218 85 10
|
|
and #$F0 ; CPU:$D21A PRG:121A 29 F0
|
|
sta Zp00 ; CPU:$D21C PRG:121C 85 00
|
|
lsr a ; CPU:$D21E PRG:121E 4A
|
|
lsr a ; CPU:$D21F PRG:121F 4A
|
|
lsr a ; CPU:$D220 PRG:1220 4A
|
|
clc ; CPU:$D221 PRG:1221 18
|
|
adc Zp00 ; CPU:$D222 PRG:1222 65 00
|
|
adc #$A0 ; CPU:$D224 PRG:1224 69 A0
|
|
sta Zp01 ; CPU:$D226 PRG:1226 85 01
|
|
iny ; CPU:$D228 PRG:1228 C8
|
|
lda $0074,y ; CPU:$D229 PRG:1229 B9 74 00
|
|
tax ; CPU:$D22C PRG:122C AA
|
|
clc ; CPU:$D22D PRG:122D 18
|
|
adc #$01 ; CPU:$D22E PRG:122E 69 01
|
|
sta $0074,y ; CPU:$D230 PRG:1230 99 74 00
|
|
lda $F81C,x ; CPU:$D233 PRG:1233 BD 1C F8
|
|
cmp #$AA ; CPU:$D236 PRG:1236 C9 AA
|
|
beq ReadActorPointerTable_Loop ; CPU:$D238 PRG:1238 F0 5D
|
|
asl a ; CPU:$D23A PRG:123A 0A
|
|
sta Zp00 ; CPU:$D23B PRG:123B 85 00
|
|
asl a ; CPU:$D23D PRG:123D 0A
|
|
clc ; CPU:$D23E PRG:123E 18
|
|
adc Zp00 ; CPU:$D23F PRG:123F 65 00
|
|
adc Zp01 ; CPU:$D241 PRG:1241 65 01
|
|
sta Zp11 ; CPU:$D243 PRG:1243 85 11
|
|
lda Zp10 ; CPU:$D245 PRG:1245 A5 10
|
|
and #$0F ; CPU:$D247 PRG:1247 29 0F
|
|
cmp #$01 ; CPU:$D249 PRG:1249 C9 01
|
|
bne SelectEnemyFrame_Loop4 ; CPU:$D24B PRG:124B D0 04
|
|
lda #$D8 ; CPU:$D24D PRG:124D A9 D8
|
|
bne SelectEnemyFrame_Loop5 ; CPU:$D24F PRG:124F D0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SelectEnemyFrame_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectEnemyFrame_Loop4:
|
|
cmp #$02 ; CPU:$D251 PRG:1251 C9 02
|
|
bne SelectEnemyFrame_Loop6 ; CPU:$D253 PRG:1253 D0 06
|
|
lda #$6C ; CPU:$D255 PRG:1255 A9 6C
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SelectEnemyFrame_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectEnemyFrame_Loop5:
|
|
ldx #$22 ; CPU:$D257 PRG:1257 A2 22
|
|
bne SelectEnemyFrame_Loop7 ; CPU:$D259 PRG:1259 D0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SelectEnemyFrame_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectEnemyFrame_Loop6:
|
|
lda #$FC ; CPU:$D25B PRG:125B A9 FC
|
|
ldx #$23 ; CPU:$D25D PRG:125D A2 23
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SelectEnemyFrame_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectEnemyFrame_Loop7:
|
|
stx $0540 ; CPU:$D25F PRG:125F 8E 40 05
|
|
sta Zp10 ; CPU:$D262 PRG:1262 85 10
|
|
lda #$00 ; CPU:$D264 PRG:1264 A9 00
|
|
sta Zp07 ; CPU:$D266 PRG:1266 85 07
|
|
ldx #$00 ; CPU:$D268 PRG:1268 A2 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SelectEnemyFrame_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectEnemyFrame_OnNonzero:
|
|
asl Zp10 ; CPU:$D26A PRG:126A 06 10
|
|
bcc SelectEnemyFrame_Loop8 ; CPU:$D26C PRG:126C 90 09
|
|
lda Zp07 ; CPU:$D26E PRG:126E A5 07
|
|
clc ; CPU:$D270 PRG:1270 18
|
|
adc Zp11 ; CPU:$D271 PRG:1271 65 11
|
|
sta $0541,x ; CPU:$D273 PRG:1273 9D 41 05
|
|
inx ; CPU:$D276 PRG:1276 E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SelectEnemyFrame_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectEnemyFrame_Loop8:
|
|
inc Zp07 ; CPU:$D277 PRG:1277 E6 07
|
|
lda Zp07 ; CPU:$D279 PRG:1279 A5 07
|
|
cmp #$06 ; CPU:$D27B PRG:127B C9 06
|
|
bne SelectEnemyFrame_OnNonzero ; CPU:$D27D PRG:127D D0 EB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD27F
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadActorPointerTable:
|
|
iny ; CPU:$D27F PRG:127F C8
|
|
lda $0074,y ; CPU:$D280 PRG:1280 B9 74 00
|
|
sta Zp00 ; CPU:$D283 PRG:1283 85 00
|
|
iny ; CPU:$D285 PRG:1285 C8
|
|
lda $0074,y ; CPU:$D286 PRG:1286 B9 74 00
|
|
sta Zp01 ; CPU:$D289 PRG:1289 85 01
|
|
lda #$40 ; CPU:$D28B PRG:128B A9 40
|
|
sta Zp02 ; CPU:$D28D PRG:128D 85 02
|
|
lda #$05 ; CPU:$D28F PRG:128F A9 05
|
|
sta Zp03 ; CPU:$D291 PRG:1291 85 03
|
|
jsr ReturnOne ; CPU:$D293 PRG:1293 20 2C CE
|
|
rts ; CPU:$D296 PRG:1296 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReadActorPointerTable_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadActorPointerTable_Loop:
|
|
lda #$00 ; CPU:$D297 PRG:1297 A9 00
|
|
sta $0084,y ; CPU:$D299 PRG:1299 99 84 00
|
|
lda Zp10 ; CPU:$D29C PRG:129C A5 10
|
|
lsr a ; CPU:$D29E PRG:129E 4A
|
|
lsr a ; CPU:$D29F PRG:129F 4A
|
|
lsr a ; CPU:$D2A0 PRG:12A0 4A
|
|
lsr a ; CPU:$D2A1 PRG:12A1 4A
|
|
clc ; CPU:$D2A2 PRG:12A2 18
|
|
adc #$93 ; CPU:$D2A3 PRG:12A3 69 93
|
|
tax ; CPU:$D2A5 PRG:12A5 AA
|
|
lda #$24 ; CPU:$D2A6 PRG:12A6 A9 24
|
|
sta $0541 ; CPU:$D2A8 PRG:12A8 8D 41 05
|
|
sta $0542 ; CPU:$D2AB PRG:12AB 8D 42 05
|
|
sta $0543 ; CPU:$D2AE PRG:12AE 8D 43 05
|
|
lda Zp10 ; CPU:$D2B1 PRG:12B1 A5 10
|
|
and #$0F ; CPU:$D2B3 PRG:12B3 29 0F
|
|
cmp #$03 ; CPU:$D2B5 PRG:12B5 C9 03
|
|
bne ReadActorPointerTable_Loop2 ; CPU:$D2B7 PRG:12B7 D0 0E
|
|
txa ; CPU:$D2B9 PRG:12B9 8A
|
|
sta $0544 ; CPU:$D2BA PRG:12BA 8D 44 05
|
|
sta $0545 ; CPU:$D2BD PRG:12BD 8D 45 05
|
|
sta $0546 ; CPU:$D2C0 PRG:12C0 8D 46 05
|
|
lda #$23 ; CPU:$D2C3 PRG:12C3 A9 23
|
|
bne ReadActorPointerTable_Loop3 ; CPU:$D2C5 PRG:12C5 D0 09
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReadActorPointerTable_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadActorPointerTable_Loop2:
|
|
txa ; CPU:$D2C7 PRG:12C7 8A
|
|
sta $0543 ; CPU:$D2C8 PRG:12C8 8D 43 05
|
|
sta $0544 ; CPU:$D2CB PRG:12CB 8D 44 05
|
|
lda #$22 ; CPU:$D2CE PRG:12CE A9 22
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReadActorPointerTable_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadActorPointerTable_Loop3:
|
|
sta $0540 ; CPU:$D2D0 PRG:12D0 8D 40 05
|
|
ldy Zp05 ; CPU:$D2D3 PRG:12D3 A4 05
|
|
iny ; CPU:$D2D5 PRG:12D5 C8
|
|
lda #$00 ; CPU:$D2D6 PRG:12D6 A9 00
|
|
sta $0074,y ; CPU:$D2D8 PRG:12D8 99 74 00
|
|
iny ; CPU:$D2DB PRG:12DB C8
|
|
jmp ReadActorPointerTable ; CPU:$D2DC PRG:12DC 4C 7F D2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD2DF
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyActive:
|
|
lda Zp70 ; CPU:$D2DF PRG:12DF A5 70
|
|
bne CheckEnemyActive_Loop ; CPU:$D2E1 PRG:12E1 D0 01
|
|
rts ; CPU:$D2E3 PRG:12E3 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyActive_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyActive_Loop:
|
|
lda Zp71 ; CPU:$D2E4 PRG:12E4 A5 71
|
|
beq CheckEnemyActive_Loop2 ; CPU:$D2E6 PRG:12E6 F0 01
|
|
rts ; CPU:$D2E8 PRG:12E8 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyActive_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyActive_Loop2:
|
|
lda #$0F ; CPU:$D2E9 PRG:12E9 A9 0F
|
|
sta Zp71 ; CPU:$D2EB PRG:12EB 85 71
|
|
lda ActorCommand ; CPU:$D2ED PRG:12ED A5 BF
|
|
sta Zp72 ; CPU:$D2EF PRG:12EF 85 72
|
|
lda #$00 ; CPU:$D2F1 PRG:12F1 A9 00
|
|
sta ActorType ; CPU:$D2F3 PRG:12F3 85 2C
|
|
dec Zp70 ; CPU:$D2F5 PRG:12F5 C6 70
|
|
jsr ComputeActorTableOffset ; CPU:$D2F7 PRG:12F7 20 93 D5
|
|
lda ZpFF ; CPU:$D2FA PRG:12FA A5 FF
|
|
ora #$02 ; CPU:$D2FC PRG:12FC 09 02
|
|
sta ZpFF ; CPU:$D2FE PRG:12FE 85 FF
|
|
rts ; CPU:$D300 PRG:1300 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD301
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckMarioAlive:
|
|
lda Zp71 ; CPU:$D301 PRG:1301 A5 71
|
|
bne CheckMarioAlive_Loop ; CPU:$D303 PRG:1303 D0 01
|
|
rts ; CPU:$D305 PRG:1305 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckMarioAlive_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckMarioAlive_Loop:
|
|
lda ActorType ; CPU:$D306 PRG:1306 A5 2C
|
|
beq CheckMarioAlive_Loop2 ; CPU:$D308 PRG:1308 F0 01
|
|
rts ; CPU:$D30A PRG:130A 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckMarioAlive_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckMarioAlive_Loop2:
|
|
lda #$01 ; CPU:$D30B PRG:130B A9 01
|
|
sta ActorType ; CPU:$D30D PRG:130D 85 2C
|
|
dec Zp71 ; CPU:$D30F PRG:130F C6 71
|
|
ldy #$01 ; CPU:$D311 PRG:1311 A0 01
|
|
lda Zp71 ; CPU:$D313 PRG:1313 A5 71
|
|
cmp #$08 ; CPU:$D315 PRG:1315 C9 08
|
|
bcc CheckMarioAlive_Loop3 ; CPU:$D317 PRG:1317 90 06
|
|
ldy #$FF ; CPU:$D319 PRG:1319 A0 FF
|
|
ora #$F0 ; CPU:$D31B PRG:131B 09 F0
|
|
eor #$FF ; CPU:$D31D PRG:131D 49 FF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckMarioAlive_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckMarioAlive_Loop3:
|
|
clc ; CPU:$D31F PRG:131F 18
|
|
adc Zp0D ; CPU:$D320 PRG:1320 65 0D
|
|
sta Zp0C ; CPU:$D322 PRG:1322 85 0C
|
|
sty $05F9 ; CPU:$D324 PRG:1324 8C F9 05
|
|
rts ; CPU:$D327 PRG:1327 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: TestRamFlagPair0500
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
TestRamFlagPair0500:
|
|
lda $0500 ; CPU:$D328 PRG:1328 AD 00 05
|
|
and #$02 ; CPU:$D32B PRG:132B 29 02
|
|
sta Zp07 ; CPU:$D32D PRG:132D 85 07
|
|
lda $0501 ; CPU:$D32F PRG:132F AD 01 05
|
|
and #$02 ; CPU:$D332 PRG:1332 29 02
|
|
eor Zp07 ; CPU:$D334 PRG:1334 45 07
|
|
clc ; CPU:$D336 PRG:1336 18
|
|
beq TestRamFlagPair0500_Loop ; CPU:$D337 PRG:1337 F0 01
|
|
sec ; CPU:$D339 PRG:1339 38
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: TestRamFlagPair0500_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
TestRamFlagPair0500_Loop:
|
|
ror $0500 ; CPU:$D33A PRG:133A 6E 00 05
|
|
ror $0501 ; CPU:$D33D PRG:133D 6E 01 05
|
|
ror $0502 ; CPU:$D340 PRG:1340 6E 02 05
|
|
ror $0503 ; CPU:$D343 PRG:1343 6E 03 05
|
|
lda $0500 ; CPU:$D346 PRG:1346 AD 00 05
|
|
rts ; CPU:$D349 PRG:1349 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResetRoundState
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetRoundState:
|
|
lda ActorIndex ; CPU:$D34A PRG:134A A5 2D
|
|
bne SetEnemySpawnParams_OnNonzero ; CPU:$D34C PRG:134C D0 59
|
|
lda #$00 ; CPU:$D34E PRG:134E A9 00
|
|
sta Zp31 ; CPU:$D350 PRG:1350 85 31
|
|
sta Zp41 ; CPU:$D352 PRG:1352 85 41
|
|
lda #$03 ; CPU:$D354 PRG:1354 A9 03
|
|
sta Zp70 ; CPU:$D356 PRG:1356 85 70
|
|
ldx #$02 ; CPU:$D358 PRG:1358 A2 02
|
|
ldy #$00 ; CPU:$D35A PRG:135A A0 00
|
|
stx Zp48 ; CPU:$D35C PRG:135C 86 48
|
|
sty ActorYTarget ; CPU:$D35E PRG:135E 84 4A
|
|
sty ZpAD ; CPU:$D360 PRG:1360 84 AD
|
|
lda GameRunningFlag ; CPU:$D362 PRG:1362 A5 30
|
|
beq ResetRoundState_Loop ; CPU:$D364 PRG:1364 F0 07
|
|
lda #$55 ; CPU:$D366 PRG:1366 A9 55
|
|
sta Zp31 ; CPU:$D368 PRG:1368 85 31
|
|
jmp SetEnemySpawnParams ; CPU:$D36A PRG:136A 4C 7D D3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResetRoundState_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetRoundState_Loop:
|
|
lda Zp29 ; CPU:$D36D PRG:136D A5 29
|
|
cmp #$02 ; CPU:$D36F PRG:136F C9 02
|
|
bcs SetEnemySpawnParams ; CPU:$D371 PRG:1371 B0 0A
|
|
sty Zp4C ; CPU:$D373 PRG:1373 84 4C
|
|
sty Zp9E ; CPU:$D375 PRG:1375 84 9E
|
|
ldy #$FF ; CPU:$D377 PRG:1377 A0 FF
|
|
lda #$00 ; CPU:$D379 PRG:1379 A9 00
|
|
beq SetEnemySpawnParams_Loop ; CPU:$D37B PRG:137B F0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD37D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpawnParams:
|
|
stx Zp4C ; CPU:$D37D PRG:137D 86 4C
|
|
lda #$02 ; CPU:$D37F PRG:137F A9 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemySpawnParams_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpawnParams_Loop:
|
|
sty Zp4E ; CPU:$D381 PRG:1381 84 4E
|
|
sty ZpAE ; CPU:$D383 PRG:1383 84 AE
|
|
sta Zp39 ; CPU:$D385 PRG:1385 85 39
|
|
lda #$00 ; CPU:$D387 PRG:1387 A9 00
|
|
sta Zp49 ; CPU:$D389 PRG:1389 85 49
|
|
sta Zp4D ; CPU:$D38B PRG:138B 85 4D
|
|
ldx #$07 ; CPU:$D38D PRG:138D A2 07
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemySpawnParams_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpawnParams_OnNonnegative:
|
|
sta Zp94,x ; CPU:$D38F PRG:138F 95 94
|
|
dex ; CPU:$D391 PRG:1391 CA
|
|
bpl SetEnemySpawnParams_OnNonnegative ; CPU:$D392 PRG:1392 10 FB
|
|
ldy #$00 ; CPU:$D394 PRG:1394 A0 00
|
|
lda Zp29 ; CPU:$D396 PRG:1396 A5 29
|
|
beq SetEnemySpawnParams_Loop2 ; CPU:$D398 PRG:1398 F0 05
|
|
cmp #$02 ; CPU:$D39A PRG:139A C9 02
|
|
beq SetEnemySpawnParams_Loop2 ; CPU:$D39C PRG:139C F0 01
|
|
iny ; CPU:$D39E PRG:139E C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemySpawnParams_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpawnParams_Loop2:
|
|
sty Zp3A ; CPU:$D39F PRG:139F 84 3A
|
|
lda #$01 ; CPU:$D3A1 PRG:13A1 A9 01
|
|
sta PlayerSlot ; CPU:$D3A3 PRG:13A3 85 3F
|
|
inc Zp40 ; CPU:$D3A5 PRG:13A5 E6 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemySpawnParams_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpawnParams_OnNonzero:
|
|
rts ; CPU:$D3A7 PRG:13A7 60
|
|
lda ActorIndex ; CPU:$D3A8 PRG:13A8 A5 2D
|
|
bne SetEnemySpawnParams_OnNonzero ; CPU:$D3AA PRG:13AA D0 FB
|
|
lda #$00 ; CPU:$D3AC PRG:13AC A9 00
|
|
sta Zp49 ; CPU:$D3AE PRG:13AE 85 49
|
|
sta Zp4D ; CPU:$D3B0 PRG:13B0 85 4D
|
|
sta Zp51 ; CPU:$D3B2 PRG:13B2 85 51
|
|
sta ActorXPosition ; CPU:$D3B4 PRG:13B4 85 46
|
|
sta $05FB ; CPU:$D3B6 PRG:13B6 8D FB 05
|
|
sta $05FC ; CPU:$D3B9 PRG:13B9 8D FC 05
|
|
sta Zp43 ; CPU:$D3BC PRG:13BC 85 43
|
|
sta Zp44 ; CPU:$D3BE PRG:13BE 85 44
|
|
sta ActorYPosition ; CPU:$D3C0 PRG:13C0 85 45
|
|
sta ActorXPosition ; CPU:$D3C2 PRG:13C2 85 46
|
|
ldx #$03 ; CPU:$D3C4 PRG:13C4 A2 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemySpawnParams_OnNonnegative2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpawnParams_OnNonnegative2:
|
|
sta ZpFC,x ; CPU:$D3C6 PRG:13C6 95 FC
|
|
dex ; CPU:$D3C8 PRG:13C8 CA
|
|
bpl SetEnemySpawnParams_OnNonnegative2 ; CPU:$D3C9 PRG:13C9 10 FB
|
|
lda GameRunningFlag ; CPU:$D3CB PRG:13CB A5 30
|
|
bne SetEnemySpawnParams_Loop4 ; CPU:$D3CD PRG:13CD D0 26
|
|
jsr CopyHudPalette ; CPU:$D3CF PRG:13CF 20 0F D6
|
|
jsr InitEnemySprites ; CPU:$D3D2 PRG:13D2 20 E6 D5
|
|
jsr InitEnemySpritesB ; CPU:$D3D5 PRG:13D5 20 EC D5
|
|
lda Zp41 ; CPU:$D3D8 PRG:13D8 A5 41
|
|
cmp #$01 ; CPU:$D3DA PRG:13DA C9 01
|
|
bne SetEnemySpawnParams_Loop3 ; CPU:$D3DC PRG:13DC D0 0F
|
|
lda #$08 ; CPU:$D3DE PRG:13DE A9 08
|
|
sta Zp40 ; CPU:$D3E0 PRG:13E0 85 40
|
|
lda #$18 ; CPU:$D3E2 PRG:13E2 A9 18
|
|
sta ActorIndex ; CPU:$D3E4 PRG:13E4 85 2D
|
|
lda #$01 ; CPU:$D3E6 PRG:13E6 A9 01
|
|
sta ZpFD ; CPU:$D3E8 PRG:13E8 85 FD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemySpawnParams_OnNonzero2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpawnParams_OnNonzero2:
|
|
jmp EnableBackgroundAndSprites ; CPU:$D3EA PRG:13EA 4C 3D E1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemySpawnParams_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpawnParams_Loop3:
|
|
lda #$02 ; CPU:$D3ED PRG:13ED A9 02
|
|
sta ZpFD ; CPU:$D3EF PRG:13EF 85 FD
|
|
lda #$0C ; CPU:$D3F1 PRG:13F1 A9 0C
|
|
sta ActorIndex ; CPU:$D3F3 PRG:13F3 85 2D
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemySpawnParams_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpawnParams_Loop4:
|
|
inc Zp40 ; CPU:$D3F5 PRG:13F5 E6 40
|
|
bne SetEnemySpawnParams_OnNonzero2 ; CPU:$D3F7 PRG:13F7 D0 F1
|
|
UpdateOamSprites:
|
|
jsr DisableBackgroundAndSprites ; CPU:$D3F9 PRG:13F9 20 32 E1
|
|
jsr SetVramAddress2400 ; CPU:$D3FC PRG:13FC 20 20 CA
|
|
jsr SetVramAddressF400 ; CPU:$D3FF PRG:13FF 20 2B CA
|
|
jsr SetHudVramPointer ; CPU:$D402 PRG:1402 20 08 D5
|
|
jsr DrawHud ; CPU:$D405 PRG:1405 20 1D D6
|
|
inc Zp40 ; CPU:$D408 PRG:1408 E6 40
|
|
rts ; CPU:$D40A PRG:140A 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetHudVramAddress
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetHudVramAddress:
|
|
jsr DisableBackgroundAndSprites ; CPU:$D40B PRG:140B 20 32 E1
|
|
jsr SetVramAddress2400 ; CPU:$D40E PRG:140E 20 20 CA
|
|
jsr SetVramAddressF400 ; CPU:$D411 PRG:1411 20 2B CA
|
|
ldx #$A5 ; CPU:$D414 PRG:1414 A2 A5
|
|
ldy #$F0 ; CPU:$D416 PRG:1416 A0 F0
|
|
jsr WriteVramAt ; CPU:$D418 PRG:1418 20 D5 D5
|
|
lda #$02 ; CPU:$D41B PRG:141B A9 02
|
|
sta PlayerSlot ; CPU:$D41D PRG:141D 85 3F
|
|
lda #$01 ; CPU:$D41F PRG:141F A9 01
|
|
sta ActorActionFlag ; CPU:$D421 PRG:1421 85 28
|
|
lda #$89 ; CPU:$D423 PRG:1423 A9 89
|
|
sta Zp00 ; CPU:$D425 PRG:1425 85 00
|
|
lda #$F6 ; CPU:$D427 PRG:1427 A9 F6
|
|
sta Zp01 ; CPU:$D429 PRG:1429 85 01
|
|
lda #$04 ; CPU:$D42B PRG:142B A9 04
|
|
sta Zp02 ; CPU:$D42D PRG:142D 85 02
|
|
jsr CopyBlockToVram ; CPU:$D42F PRG:142F 20 16 CE
|
|
inc Zp50 ; CPU:$D432 PRG:1432 E6 50
|
|
ldy Zp52 ; CPU:$D434 PRG:1434 A4 52
|
|
bne SetHudVramAddress_Loop ; CPU:$D436 PRG:1436 D0 08
|
|
ldy #$02 ; CPU:$D438 PRG:1438 A0 02
|
|
sty Zp52 ; CPU:$D43A PRG:143A 84 52
|
|
lda #$4F ; CPU:$D43C PRG:143C A9 4F
|
|
bne SetHudVramAddress_Loop2 ; CPU:$D43E PRG:143E D0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetHudVramAddress_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetHudVramAddress_Loop:
|
|
dec Zp52 ; CPU:$D440 PRG:1440 C6 52
|
|
lda #$25 ; CPU:$D442 PRG:1442 A9 25
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetHudVramAddress_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetHudVramAddress_Loop2:
|
|
sta ActorIndex ; CPU:$D444 PRG:1444 85 2D
|
|
bne SetEnemySpawnParams_OnNonzero2 ; CPU:$D446 PRG:1446 D0 A2
|
|
lda ActorIndex ; CPU:$D448 PRG:1448 A5 2D
|
|
bne SetHudVramAddress_Loop3 ; CPU:$D44A PRG:144A D0 04
|
|
lda #$00 ; CPU:$D44C PRG:144C A9 00
|
|
sta Zp50 ; CPU:$D44E PRG:144E 85 50
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetHudVramAddress_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetHudVramAddress_Loop3:
|
|
rts ; CPU:$D450 PRG:1450 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchGameState
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchGameState:
|
|
lda ActorIndex ; CPU:$D451 PRG:1451 A5 2D
|
|
bne DispatchGameState_Loop ; CPU:$D453 PRG:1453 D0 04
|
|
lda #$04 ; CPU:$D455 PRG:1455 A9 04
|
|
bne DispatchGameState_Loop3 ; CPU:$D457 PRG:1457 D0 21
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchGameState_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchGameState_Loop:
|
|
jmp CheckStageComplete ; CPU:$D459 PRG:1459 4C F7 E1
|
|
lda Zp2B ; CPU:$D45C PRG:145C A5 2B
|
|
beq DispatchGameState_Loop2 ; CPU:$D45E PRG:145E F0 0F
|
|
cmp #$0A ; CPU:$D460 PRG:1460 C9 0A
|
|
bne ReturnWithoutAction ; CPU:$D462 PRG:1462 D0 18
|
|
lda Zp0A ; CPU:$D464 PRG:1464 A5 0A
|
|
ora #$10 ; CPU:$D466 PRG:1466 09 10
|
|
sta PPUMASK ; CPU:$D468 PRG:1468 8D 01 20
|
|
sta Zp0A ; CPU:$D46B PRG:146B 85 0A
|
|
bne ReturnWithoutAction ; CPU:$D46D PRG:146D D0 0D
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchGameState_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchGameState_Loop2:
|
|
ldx #$05 ; CPU:$D46F PRG:146F A2 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchGameState_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchGameState_OnNonnegative:
|
|
lda Zp5A,x ; CPU:$D471 PRG:1471 B5 5A
|
|
sta FrameCountdown,x ; CPU:$D473 PRG:1473 95 2A
|
|
dex ; CPU:$D475 PRG:1475 CA
|
|
bpl DispatchGameState_OnNonnegative ; CPU:$D476 PRG:1476 10 F9
|
|
lda Zp3B ; CPU:$D478 PRG:1478 A5 3B
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DispatchGameState_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DispatchGameState_Loop3:
|
|
sta Zp40 ; CPU:$D47A PRG:147A 85 40
|
|
ReturnWithoutAction:
|
|
rts ; CPU:$D47C PRG:147C 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetActorFlagOn4B
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetActorFlagOn4B:
|
|
ldy ActorIndex ; CPU:$D47D PRG:147D A4 2D
|
|
beq SetActorFlagOn4B_Loop2 ; CPU:$D47F PRG:147F F0 0D
|
|
cpy #$4B ; CPU:$D481 PRG:1481 C0 4B
|
|
bne SetActorFlagOn4B_Loop ; CPU:$D483 PRG:1483 D0 08
|
|
lda #$80 ; CPU:$D485 PRG:1485 A9 80
|
|
sta ZpFD ; CPU:$D487 PRG:1487 85 FD
|
|
ldy #$48 ; CPU:$D489 PRG:1489 A0 48
|
|
sty ActorIndex ; CPU:$D48B PRG:148B 84 2D
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetActorFlagOn4B_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetActorFlagOn4B_Loop:
|
|
rts ; CPU:$D48D PRG:148D 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetActorFlagOn4B_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetActorFlagOn4B_Loop2:
|
|
inc Zp50 ; CPU:$D48E PRG:148E E6 50
|
|
rts ; CPU:$D490 PRG:1490 60
|
|
; ---- data $D491-$D4FD (109 bytes) ----
|
|
EnemyBehaviourTable:
|
|
.byte $E6, $50, $4C, $4A, $D3, $E6, $50, $4C, $4A, $E1, $E6, $50, $4C, $F9, $D3, $E6 ; CPU:$D491 PRG:1491 E6 50 4C 4A D3 E6 50 4C 4A E1 E6 50 4C F9 D3 E6
|
|
.byte $50, $A9, $00, $85, $55, $85, $56, $85, $57, $85, $58, $4C, $A8, $D3, $A4, $56 ; CPU:$D4A1 PRG:14A1 50 A9 00 85 55 85 56 85 57 85 58 4C A8 D3 A4 56
|
|
.byte $D0, $17, $A6, $55, $BD, $23, $F8, $C9, $AA, $F0, $3C, $85, $19, $E8, $BD, $23 ; CPU:$D4B1 PRG:14B1 D0 17 A6 55 BD 23 F8 C9 AA F0 3C 85 19 E8 BD 23
|
|
.byte $F8, $85, $56, $E8, $86, $55, $4C, $D4, $D4, $88, $84, $56, $AD, $10, $03, $29 ; CPU:$D4C1 PRG:14C1 F8 85 56 E8 86 55 4C D4 D4 88 84 56 AD 10 03 29
|
|
.byte $03, $85, $19, $A4, $58, $D0, $13, $A6, $57, $BD, $54, $F8, $85, $1B, $E8, $BD ; CPU:$D4D1 PRG:14D1 03 85 19 A4 58 D0 13 A6 57 BD 54 F8 85 1B E8 BD
|
|
.byte $54, $F8, $85, $58, $E8, $86, $57, $4C, $F5, $D4, $88, $84, $58, $AD, $30, $03 ; CPU:$D4E1 PRG:14E1 54 F8 85 58 E8 86 57 4C F5 D4 88 84 58 AD 30 03
|
|
.byte $29, $03, $85, $1B, $4C, $A3, $C5, $A9, $05, $85, $2D, $E6, $50 ; CPU:$D4F1 PRG:14F1 29 03 85 1B 4C A3 C5 A9 05 85 2D E6 50
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD4FE
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearActorCounters:
|
|
lda #$00 ; CPU:$D4FE PRG:14FE A9 00
|
|
ldx #$03 ; CPU:$D500 PRG:1500 A2 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearActorCounters_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearActorCounters_OnNonnegative:
|
|
sta ZpFC,x ; CPU:$D502 PRG:1502 95 FC
|
|
dex ; CPU:$D504 PRG:1504 CA
|
|
bpl ClearActorCounters_OnNonnegative ; CPU:$D505 PRG:1505 10 FB
|
|
rts ; CPU:$D507 PRG:1507 60
|
|
SetHudVramPointer:
|
|
jsr DrawTileRow ; CPU:$D508 PRG:1508 20 3B CA
|
|
lda Zp32 ; CPU:$D50B PRG:150B A5 32
|
|
clc ; CPU:$D50D PRG:150D 18
|
|
adc #$93 ; CPU:$D50E PRG:150E 69 93
|
|
sta Zp07 ; CPU:$D510 PRG:1510 85 07
|
|
ldx #$00 ; CPU:$D512 PRG:1512 A2 00
|
|
ldy #$00 ; CPU:$D514 PRG:1514 A0 00
|
|
sty Zp1C ; CPU:$D516 PRG:1516 84 1C
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetHudVramPointer_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetHudVramPointer_OnNonzero:
|
|
lda #$03 ; CPU:$D518 PRG:1518 A9 03
|
|
sta Zp02 ; CPU:$D51A PRG:151A 85 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetHudVramPointer_OnNonzero2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetHudVramPointer_OnNonzero2:
|
|
lda $F1E7,y ; CPU:$D51C PRG:151C B9 E7 F1
|
|
sta $0540,x ; CPU:$D51F PRG:151F 9D 40 05
|
|
iny ; CPU:$D522 PRG:1522 C8
|
|
inx ; CPU:$D523 PRG:1523 E8
|
|
dec Zp02 ; CPU:$D524 PRG:1524 C6 02
|
|
bne SetHudVramPointer_OnNonzero2 ; CPU:$D526 PRG:1526 D0 F4
|
|
lda Zp1C ; CPU:$D528 PRG:1528 A5 1C
|
|
beq SetHudVramPointer_Loop ; CPU:$D52A PRG:152A F0 0E
|
|
lda #$92 ; CPU:$D52C PRG:152C A9 92
|
|
sta $0540,x ; CPU:$D52E PRG:152E 9D 40 05
|
|
inx ; CPU:$D531 PRG:1531 E8
|
|
lda Zp1C ; CPU:$D532 PRG:1532 A5 1C
|
|
cmp #$02 ; CPU:$D534 PRG:1534 C9 02
|
|
beq SetHudVramPointer_Loop3 ; CPU:$D536 PRG:1536 F0 17
|
|
bne SetHudVramPointer_Loop2 ; CPU:$D538 PRG:1538 D0 10
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetHudVramPointer_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetHudVramPointer_Loop:
|
|
lda $F1E7,y ; CPU:$D53A PRG:153A B9 E7 F1
|
|
sta Zp00 ; CPU:$D53D PRG:153D 85 00
|
|
lda Zp07 ; CPU:$D53F PRG:153F A5 07
|
|
sta $0540,x ; CPU:$D541 PRG:1541 9D 40 05
|
|
inx ; CPU:$D544 PRG:1544 E8
|
|
lda Zp00 ; CPU:$D545 PRG:1545 A5 00
|
|
bne SetHudVramPointer_OnNonzero ; CPU:$D547 PRG:1547 D0 CF
|
|
iny ; CPU:$D549 PRG:1549 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetHudVramPointer_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetHudVramPointer_Loop2:
|
|
inc Zp1C ; CPU:$D54A PRG:154A E6 1C
|
|
jmp SetHudVramPointer_OnNonzero ; CPU:$D54C PRG:154C 4C 18 D5
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetHudVramPointer_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetHudVramPointer_Loop3:
|
|
lda #$00 ; CPU:$D54F PRG:154F A9 00
|
|
sta $0540,x ; CPU:$D551 PRG:1551 9D 40 05
|
|
ldx #$40 ; CPU:$D554 PRG:1554 A2 40
|
|
ldy #$05 ; CPU:$D556 PRG:1556 A0 05
|
|
jsr WriteVramAt ; CPU:$D558 PRG:1558 20 D5 D5
|
|
jsr WriteVramAtF4F5 ; CPU:$D55B PRG:155B 20 8C D5
|
|
jsr ComputeActorTableOffset ; CPU:$D55E PRG:155E 20 93 D5
|
|
jsr WriteVramAtF660 ; CPU:$D561 PRG:1561 20 BE D5
|
|
lda #$00 ; CPU:$D564 PRG:1564 A9 00
|
|
ldx #$09 ; CPU:$D566 PRG:1566 A2 09
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetHudVramPointer_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetHudVramPointer_OnNonnegative:
|
|
sta $74,x ; CPU:$D568 PRG:1568 95 74
|
|
dex ; CPU:$D56A PRG:156A CA
|
|
bpl SetHudVramPointer_OnNonnegative ; CPU:$D56B PRG:156B 10 FB
|
|
rts ; CPU:$D56D PRG:156D 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD56E
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckScriptCommand:
|
|
lda ScriptCommand ; CPU:$D56E PRG:156E A5 35
|
|
cmp #$AA ; CPU:$D570 PRG:1570 C9 AA
|
|
beq CheckScriptCommand_Loop2 ; CPU:$D572 PRG:1572 F0 17
|
|
cmp #$BB ; CPU:$D574 PRG:1574 C9 BB
|
|
beq CheckScriptCommand_Loop2 ; CPU:$D576 PRG:1576 F0 13
|
|
lda Zp2E ; CPU:$D578 PRG:1578 A5 2E
|
|
bne CheckScriptCommand_Loop2 ; CPU:$D57A PRG:157A D0 0F
|
|
lda Zp41 ; CPU:$D57C PRG:157C A5 41
|
|
cmp #$02 ; CPU:$D57E PRG:157E C9 02
|
|
beq CheckScriptCommand_Loop ; CPU:$D580 PRG:1580 F0 06
|
|
lda ActorYPosition ; CPU:$D582 PRG:1582 A5 45
|
|
cmp #$04 ; CPU:$D584 PRG:1584 C9 04
|
|
bcs CheckScriptCommand_Loop2 ; CPU:$D586 PRG:1586 B0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckScriptCommand_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckScriptCommand_Loop:
|
|
jsr InitEnemyScriptBlock ; CPU:$D588 PRG:1588 20 C3 CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckScriptCommand_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckScriptCommand_Loop2:
|
|
rts ; CPU:$D58B PRG:158B 60
|
|
WriteVramAtF4F5:
|
|
ldx #$F5 ; CPU:$D58C PRG:158C A2 F5
|
|
ldy #$F4 ; CPU:$D58E PRG:158E A0 F4
|
|
jmp WriteVramAt ; CPU:$D590 PRG:1590 4C D5 D5
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD593
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeActorTableOffset:
|
|
lda Zp70 ; CPU:$D593 PRG:1593 A5 70
|
|
asl a ; CPU:$D595 PRG:1595 0A
|
|
asl a ; CPU:$D596 PRG:1596 0A
|
|
clc ; CPU:$D597 PRG:1597 18
|
|
adc Zp70 ; CPU:$D598 PRG:1598 65 70
|
|
sta Zp12 ; CPU:$D59A PRG:159A 85 12
|
|
lda #$00 ; CPU:$D59C PRG:159C A9 00
|
|
sta Zp13 ; CPU:$D59E PRG:159E 85 13
|
|
lda #$60 ; CPU:$D5A0 PRG:15A0 A9 60
|
|
sta Zp14 ; CPU:$D5A2 PRG:15A2 85 14
|
|
lda #$F5 ; CPU:$D5A4 PRG:15A4 A9 F5
|
|
sta Zp15 ; CPU:$D5A6 PRG:15A6 85 15
|
|
jsr AdvanceDispatchPointer ; CPU:$D5A8 PRG:15A8 20 B4 CD
|
|
lda #$AF ; CPU:$D5AB PRG:15AB A9 AF
|
|
sta Zp00 ; CPU:$D5AD PRG:15AD 85 00
|
|
lda #$22 ; CPU:$D5AF PRG:15AF A9 22
|
|
sta Zp01 ; CPU:$D5B1 PRG:15B1 85 01
|
|
lda Zp14 ; CPU:$D5B3 PRG:15B3 A5 14
|
|
sta Zp02 ; CPU:$D5B5 PRG:15B5 85 02
|
|
lda Zp15 ; CPU:$D5B7 PRG:15B7 A5 15
|
|
sta Zp03 ; CPU:$D5B9 PRG:15B9 85 03
|
|
jmp ReturnOne ; CPU:$D5BB PRG:15BB 4C 2C CE
|
|
WriteVramAtF660:
|
|
ldx #$60 ; CPU:$D5BE PRG:15BE A2 60
|
|
ldy #$F6 ; CPU:$D5C0 PRG:15C0 A0 F6
|
|
jsr WriteVramAt ; CPU:$D5C2 PRG:15C2 20 D5 D5
|
|
lda #$01 ; CPU:$D5C5 PRG:15C5 A9 01
|
|
sta Zp9D ; CPU:$D5C7 PRG:15C7 85 9D
|
|
lda Zp39 ; CPU:$D5C9 PRG:15C9 A5 39
|
|
beq ReturnFromActorUpdate ; CPU:$D5CB PRG:15CB F0 18
|
|
lda #$01 ; CPU:$D5CD PRG:15CD A9 01
|
|
sta Zp9E ; CPU:$D5CF PRG:15CF 85 9E
|
|
ldx #$6B ; CPU:$D5D1 PRG:15D1 A2 6B
|
|
ldy #$F6 ; CPU:$D5D3 PRG:15D3 A0 F6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD5D5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramAt:
|
|
stx Zp00 ; CPU:$D5D5 PRG:15D5 86 00
|
|
sty Zp01 ; CPU:$D5D7 PRG:15D7 84 01
|
|
jmp WriteVramList ; CPU:$D5D9 PRG:15D9 4C 00 CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD5DC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetOamShadow:
|
|
lda #$00 ; CPU:$D5DC PRG:15DC A9 00
|
|
sta Zp23 ; CPU:$D5DE PRG:15DE 85 23
|
|
nop ; CPU:$D5E0 PRG:15E0 EA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResetOamShadow_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetOamShadow_OnZero:
|
|
lda Zp23 ; CPU:$D5E1 PRG:15E1 A5 23
|
|
beq ResetOamShadow_OnZero ; CPU:$D5E3 PRG:15E3 F0 FC
|
|
ReturnFromActorUpdate:
|
|
rts ; CPU:$D5E5 PRG:15E5 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD5E6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySprites:
|
|
ldx Zp48 ; CPU:$D5E6 PRG:15E6 A6 48
|
|
ldy #$D0 ; CPU:$D5E8 PRG:15E8 A0 D0
|
|
bne InitEnemySpritesB_Loop ; CPU:$D5EA PRG:15EA D0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD5EC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpritesB:
|
|
ldx Zp4C ; CPU:$D5EC PRG:15EC A6 4C
|
|
ldy #$DC ; CPU:$D5EE PRG:15EE A0 DC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpritesB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpritesB_Loop:
|
|
lda GameRunningFlag ; CPU:$D5F0 PRG:15F0 A5 30
|
|
bne InitEnemySpritesB_Loop2 ; CPU:$D5F2 PRG:15F2 D0 15
|
|
lda #$03 ; CPU:$D5F4 PRG:15F4 A9 03
|
|
sta Zp1E ; CPU:$D5F6 PRG:15F6 85 1E
|
|
lda #$20 ; CPU:$D5F8 PRG:15F8 A9 20
|
|
inx ; CPU:$D5FA PRG:15FA E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpritesB_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpritesB_OnNonzero:
|
|
dex ; CPU:$D5FB PRG:15FB CA
|
|
beq InitEnemySpritesB_Loop3 ; CPU:$D5FC PRG:15FC F0 0C
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpritesB_OnNonzero2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpritesB_OnNonzero2:
|
|
sta $0200,y ; CPU:$D5FE PRG:15FE 99 00 02
|
|
iny ; CPU:$D601 PRG:1601 C8
|
|
iny ; CPU:$D602 PRG:1602 C8
|
|
iny ; CPU:$D603 PRG:1603 C8
|
|
iny ; CPU:$D604 PRG:1604 C8
|
|
dec Zp1E ; CPU:$D605 PRG:1605 C6 1E
|
|
bne InitEnemySpritesB_OnNonzero ; CPU:$D607 PRG:1607 D0 F2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpritesB_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpritesB_Loop2:
|
|
rts ; CPU:$D609 PRG:1609 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpritesB_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpritesB_Loop3:
|
|
lda #$F4 ; CPU:$D60A PRG:160A A9 F4
|
|
inx ; CPU:$D60C PRG:160C E8
|
|
bne InitEnemySpritesB_OnNonzero2 ; CPU:$D60D PRG:160D D0 EF
|
|
CopyHudPalette:
|
|
ldy #$00 ; CPU:$D60F PRG:160F A0 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CopyHudPalette_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CopyHudPalette_OnNonzero:
|
|
lda $F671,y ; CPU:$D611 PRG:1611 B9 71 F6
|
|
sta $02D0,y ; CPU:$D614 PRG:1614 99 D0 02
|
|
iny ; CPU:$D617 PRG:1617 C8
|
|
cpy #$18 ; CPU:$D618 PRG:1618 C0 18
|
|
bne CopyHudPalette_OnNonzero ; CPU:$D61A PRG:161A D0 F5
|
|
rts ; CPU:$D61C PRG:161C 60
|
|
DrawHud:
|
|
lda GameRunningFlag ; CPU:$D61D PRG:161D A5 30
|
|
bne AdvanceHudCounter_Loop ; CPU:$D61F PRG:161F D0 5D
|
|
lda #$24 ; CPU:$D621 PRG:1621 A9 24
|
|
sta Zp01 ; CPU:$D623 PRG:1623 85 01
|
|
ldx #$00 ; CPU:$D625 PRG:1625 A2 00
|
|
lda Zp41 ; CPU:$D627 PRG:1627 A5 41
|
|
and #$F0 ; CPU:$D629 PRG:1629 29 F0
|
|
beq DrawHud_Loop ; CPU:$D62B PRG:162B F0 07
|
|
; ---- data $D62D-$D633 (7 bytes) ----
|
|
SkipFourBytes:
|
|
.byte $4A, $4A, $4A, $4A, $95, $00, $E8 ; CPU:$D62D PRG:162D 4A 4A 4A 4A 95 00 E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DrawHud_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawHud_Loop:
|
|
lda Zp41 ; CPU:$D634 PRG:1634 A5 41
|
|
and #$0F ; CPU:$D636 PRG:1636 29 0F
|
|
sta Zp00,x ; CPU:$D638 PRG:1638 95 00
|
|
ldy #$12 ; CPU:$D63A PRG:163A A0 12
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DrawHud_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawHud_OnNonnegative:
|
|
lda $F722,y ; CPU:$D63C PRG:163C B9 22 F7
|
|
sta $0540,y ; CPU:$D63F PRG:163F 99 40 05
|
|
dey ; CPU:$D642 PRG:1642 88
|
|
bpl DrawHud_OnNonnegative ; CPU:$D643 PRG:1643 10 F7
|
|
lda Zp00 ; CPU:$D645 PRG:1645 A5 00
|
|
sta $0549 ; CPU:$D647 PRG:1647 8D 49 05
|
|
sta $0550 ; CPU:$D64A PRG:164A 8D 50 05
|
|
lda Zp01 ; CPU:$D64D PRG:164D A5 01
|
|
sta $054A ; CPU:$D64F PRG:164F 8D 4A 05
|
|
sta $0551 ; CPU:$D652 PRG:1652 8D 51 05
|
|
lda #$FF ; CPU:$D655 PRG:1655 A9 FF
|
|
sta $04F1 ; CPU:$D657 PRG:1657 8D F1 04
|
|
ldx #$40 ; CPU:$D65A PRG:165A A2 40
|
|
ldy #$05 ; CPU:$D65C PRG:165C A0 05
|
|
jsr WriteVramAt ; CPU:$D65E PRG:165E 20 D5 D5
|
|
lda $04B0 ; CPU:$D661 PRG:1661 AD B0 04
|
|
beq AdvanceHudCounter_Loop ; CPU:$D664 PRG:1664 F0 18
|
|
lda #$F0 ; CPU:$D666 PRG:1666 A9 F0
|
|
sta $04F0 ; CPU:$D668 PRG:1668 8D F0 04
|
|
ldx #$35 ; CPU:$D66B PRG:166B A2 35
|
|
ldy #$F7 ; CPU:$D66D PRG:166D A0 F7
|
|
jmp WriteVramAt ; CPU:$D66F PRG:166F 4C D5 D5
|
|
AdvanceHudCounter:
|
|
lda #$01 ; CPU:$D672 PRG:1672 A9 01
|
|
sta Zp03 ; CPU:$D674 PRG:1674 85 03
|
|
clc ; CPU:$D676 PRG:1676 18
|
|
lda Zp41 ; CPU:$D677 PRG:1677 A5 41
|
|
jsr AddDecimalDigit ; CPU:$D679 PRG:1679 20 39 D1
|
|
sta Zp41 ; CPU:$D67C PRG:167C 85 41
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceHudCounter_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceHudCounter_Loop:
|
|
rts ; CPU:$D67E PRG:167E 60
|
|
ClearSpriteBlock:
|
|
ldy #$1F ; CPU:$D67F PRG:167F A0 1F
|
|
ldx #$1F ; CPU:$D681 PRG:1681 A2 1F
|
|
lda Zp4E ; CPU:$D683 PRG:1683 A5 4E
|
|
bne ClearSpriteBlock_Loop ; CPU:$D685 PRG:1685 D0 08
|
|
ldx #$3F ; CPU:$D687 PRG:1687 A2 3F
|
|
lda ActorYTarget ; CPU:$D689 PRG:1689 A5 4A
|
|
bne ClearSpriteBlock_Loop ; CPU:$D68B PRG:168B D0 02
|
|
ldy #$3F ; CPU:$D68D PRG:168D A0 3F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearSpriteBlock_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearSpriteBlock_Loop:
|
|
lda $F2EC,x ; CPU:$D68F PRG:168F BD EC F2
|
|
sta $0300,x ; CPU:$D692 PRG:1692 9D 00 03
|
|
dex ; CPU:$D695 PRG:1695 CA
|
|
dey ; CPU:$D696 PRG:1696 88
|
|
bpl ClearSpriteBlock_Loop ; CPU:$D697 PRG:1697 10 F6
|
|
rts ; CPU:$D699 PRG:1699 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RunScriptBlockF3BA
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunScriptBlockF3BA:
|
|
lda #$BA ; CPU:$D69A PRG:169A A9 BA
|
|
sta Zp14 ; CPU:$D69C PRG:169C 85 14
|
|
lda #$F3 ; CPU:$D69E PRG:169E A9 F3
|
|
sta Zp15 ; CPU:$D6A0 PRG:16A0 85 15
|
|
lda ScriptParam ; CPU:$D6A2 PRG:16A2 A5 34
|
|
jsr DispatchScriptCommand ; CPU:$D6A4 PRG:16A4 20 29 CC
|
|
lda Zp12 ; CPU:$D6A7 PRG:16A7 A5 12
|
|
sta Zp36 ; CPU:$D6A9 PRG:16A9 85 36
|
|
lda Zp13 ; CPU:$D6AB PRG:16AB A5 13
|
|
sta Zp37 ; CPU:$D6AD PRG:16AD 85 37
|
|
lda #$00 ; CPU:$D6AF PRG:16AF A9 00
|
|
sta ScriptCommand ; CPU:$D6B1 PRG:16B1 85 35
|
|
ldy #$00 ; CPU:$D6B3 PRG:16B3 A0 00
|
|
lda (Zp36),y ; CPU:$D6B5 PRG:16B5 B1 36
|
|
sta Zp2E ; CPU:$D6B7 PRG:16B7 85 2E
|
|
rts ; CPU:$D6B9 PRG:16B9 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD6BA
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType:
|
|
lda ActorCommand ; CPU:$D6BA PRG:16BA A5 BF
|
|
and #$0F ; CPU:$D6BC PRG:16BC 29 0F
|
|
bne CheckEnemyType_Loop6 ; CPU:$D6BE PRG:16BE D0 50
|
|
lda ActorCommand ; CPU:$D6C0 PRG:16C0 A5 BF
|
|
ldx #$84 ; CPU:$D6C2 PRG:16C2 A2 84
|
|
ldy #$F5 ; CPU:$D6C4 PRG:16C4 A0 F5
|
|
cmp #$10 ; CPU:$D6C6 PRG:16C6 C9 10
|
|
beq CheckEnemyType_Loop ; CPU:$D6C8 PRG:16C8 F0 1C
|
|
ldx #$8C ; CPU:$D6CA PRG:16CA A2 8C
|
|
ldy #$F5 ; CPU:$D6CC PRG:16CC A0 F5
|
|
cmp #$20 ; CPU:$D6CE PRG:16CE C9 20
|
|
beq CheckEnemyType_Loop ; CPU:$D6D0 PRG:16D0 F0 14
|
|
ldx #$96 ; CPU:$D6D2 PRG:16D2 A2 96
|
|
ldy #$F5 ; CPU:$D6D4 PRG:16D4 A0 F5
|
|
cmp #$30 ; CPU:$D6D6 PRG:16D6 C9 30
|
|
beq CheckEnemyType_Loop ; CPU:$D6D8 PRG:16D8 F0 0C
|
|
ldx #$9E ; CPU:$D6DA PRG:16DA A2 9E
|
|
ldy #$F5 ; CPU:$D6DC PRG:16DC A0 F5
|
|
cmp #$80 ; CPU:$D6DE PRG:16DE C9 80
|
|
beq CheckEnemyType_Loop ; CPU:$D6E0 PRG:16E0 F0 04
|
|
ldx #$A4 ; CPU:$D6E2 PRG:16E2 A2 A4
|
|
ldy #$F5 ; CPU:$D6E4 PRG:16E4 A0 F5
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType_Loop:
|
|
stx Zp06 ; CPU:$D6E6 PRG:16E6 86 06
|
|
sty Zp07 ; CPU:$D6E8 PRG:16E8 84 07
|
|
lda ZpC0 ; CPU:$D6EA PRG:16EA A5 C0
|
|
bne CheckEnemyType_Loop2 ; CPU:$D6EC PRG:16EC D0 03
|
|
jmp CheckEnemySubType ; CPU:$D6EE PRG:16EE 4C 3C D7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType_Loop2:
|
|
and #$0F ; CPU:$D6F1 PRG:16F1 29 0F
|
|
cmp #$02 ; CPU:$D6F3 PRG:16F3 C9 02
|
|
bne CheckEnemyType_Loop3 ; CPU:$D6F5 PRG:16F5 D0 03
|
|
jmp HandleEnemySubType ; CPU:$D6F7 PRG:16F7 4C C2 D7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType_Loop3:
|
|
cmp #$03 ; CPU:$D6FA PRG:16FA C9 03
|
|
bne CheckEnemyType_Loop4 ; CPU:$D6FC PRG:16FC D0 03
|
|
jmp HandleEnemyCommand ; CPU:$D6FE PRG:16FE 4C 0E D8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType_Loop4:
|
|
cmp #$05 ; CPU:$D701 PRG:1701 C9 05
|
|
bne CheckEnemyType_Loop5 ; CPU:$D703 PRG:1703 D0 03
|
|
jmp HandleEnemyCommandB ; CPU:$D705 PRG:1705 4C 55 D8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType_Loop5:
|
|
cmp #$06 ; CPU:$D708 PRG:1708 C9 06
|
|
bne CheckEnemyType_OnNonzero ; CPU:$D70A PRG:170A D0 03
|
|
jmp HandleEnemyCommandC ; CPU:$D70C PRG:170C 4C 85 D8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType_OnNonzero:
|
|
rts ; CPU:$D70F PRG:170F 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyType_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyType_Loop6:
|
|
lda ZpB1 ; CPU:$D710 PRG:1710 A5 B1
|
|
and #$C0 ; CPU:$D712 PRG:1712 29 C0
|
|
bne CheckEnemyType_OnNonzero ; CPU:$D714 PRG:1714 D0 F9
|
|
jsr CheckBF_LowNibble ; CPU:$D716 PRG:1716 20 0D D9
|
|
cmp #$02 ; CPU:$D719 PRG:1719 C9 02
|
|
bne CheckEnemyType_OnNonzero ; CPU:$D71B PRG:171B D0 F2
|
|
lda Zp00 ; CPU:$D71D PRG:171D A5 00
|
|
sta ZpC1 ; CPU:$D71F PRG:171F 85 C1
|
|
lda ZpB1 ; CPU:$D721 PRG:1721 A5 B1
|
|
ora #$80 ; CPU:$D723 PRG:1723 09 80
|
|
sta ZpB1 ; CPU:$D725 PRG:1725 85 B1
|
|
lda #$AD ; CPU:$D727 PRG:1727 A9 AD
|
|
sta ZpBC ; CPU:$D729 PRG:1729 85 BC
|
|
lda #$F5 ; CPU:$D72B PRG:172B A9 F5
|
|
sta ZpBD ; CPU:$D72D PRG:172D 85 BD
|
|
lda ZpB1 ; CPU:$D72F PRG:172F A5 B1
|
|
and #$08 ; CPU:$D731 PRG:1731 29 08
|
|
beq CheckEnemyType_OnNonzero ; CPU:$D733 PRG:1733 F0 DA
|
|
lda #$00 ; CPU:$D735 PRG:1735 A9 00
|
|
sta ActorCount ; CPU:$D737 PRG:1737 85 BB
|
|
jmp ClearEnemyFlag ; CPU:$D739 PRG:1739 4C 84 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD73C
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySubType:
|
|
jsr CheckBF_LowNibble ; CPU:$D73C PRG:173C 20 0D D9
|
|
cmp #$02 ; CPU:$D73F PRG:173F C9 02
|
|
beq CheckEnemySubType_Loop ; CPU:$D741 PRG:1741 F0 01
|
|
rts ; CPU:$D743 PRG:1743 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySubType_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySubType_Loop:
|
|
lda ActorCommand ; CPU:$D744 PRG:1744 A5 BF
|
|
cmp #$20 ; CPU:$D746 PRG:1746 C9 20
|
|
bne CheckEnemySubType_Loop3 ; CPU:$D748 PRG:1748 D0 1D
|
|
lda ActorPalette ; CPU:$D74A PRG:174A A5 B4
|
|
cmp #$1A ; CPU:$D74C PRG:174C C9 1A
|
|
bcc CheckEnemySubType_Loop2 ; CPU:$D74E PRG:174E 90 03
|
|
jmp SpawnEnemy ; CPU:$D750 PRG:1750 4C 77 D8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySubType_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySubType_Loop2:
|
|
lda #$1A ; CPU:$D753 PRG:1753 A9 1A
|
|
sta ActorPalette ; CPU:$D755 PRG:1755 85 B4
|
|
inc ActorState ; CPU:$D757 PRG:1757 E6 C4
|
|
jsr DispatchTableF393 ; CPU:$D759 PRG:1759 20 B9 CA
|
|
lda $05F8 ; CPU:$D75C PRG:175C AD F8 05
|
|
and #$03 ; CPU:$D75F PRG:175F 29 03
|
|
sta ZpC1 ; CPU:$D761 PRG:1761 85 C1
|
|
lda #$04 ; CPU:$D763 PRG:1763 A9 04
|
|
bne SpawnEnemySprites_Loop2 ; CPU:$D765 PRG:1765 D0 30
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySubType_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySubType_Loop3:
|
|
cmp #$40 ; CPU:$D767 PRG:1767 C9 40
|
|
beq CheckEnemySubType_Loop4 ; CPU:$D769 PRG:1769 F0 14
|
|
cmp #$80 ; CPU:$D76B PRG:176B C9 80
|
|
bne SpawnEnemySprites_Loop ; CPU:$D76D PRG:176D D0 23
|
|
lda ZpFE ; CPU:$D76F PRG:176F A5 FE
|
|
ora #$01 ; CPU:$D771 PRG:1771 09 01
|
|
sta ZpFE ; CPU:$D773 PRG:1773 85 FE
|
|
lda #$F4 ; CPU:$D775 PRG:1775 A9 F4
|
|
sta $02B0 ; CPU:$D777 PRG:1777 8D B0 02
|
|
sta $02B4 ; CPU:$D77A PRG:177A 8D B4 02
|
|
bne CheckEnemySubType_Loop5 ; CPU:$D77D PRG:177D D0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySubType_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySubType_Loop4:
|
|
lda ZpFE ; CPU:$D77F PRG:177F A5 FE
|
|
ora #$02 ; CPU:$D781 PRG:1781 09 02
|
|
sta ZpFE ; CPU:$D783 PRG:1783 85 FE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySubType_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySubType_Loop5:
|
|
lda Zp9F ; CPU:$D785 PRG:1785 A5 9F
|
|
sta ZpCC ; CPU:$D787 PRG:1787 85 CC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD789
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SpawnEnemySprites:
|
|
ldy #$04 ; CPU:$D789 PRG:1789 A0 04
|
|
jsr InitSpritesOffscreen ; CPU:$D78B PRG:178B 20 C4 DF
|
|
lda #$06 ; CPU:$D78E PRG:178E A9 06
|
|
bne SpawnEnemySprites_Loop2 ; CPU:$D790 PRG:1790 D0 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SpawnEnemySprites_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SpawnEnemySprites_Loop:
|
|
jsr PushActorState ; CPU:$D792 PRG:1792 20 82 EE
|
|
lda #$01 ; CPU:$D795 PRG:1795 A9 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SpawnEnemySprites_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SpawnEnemySprites_Loop2:
|
|
ora Zp00 ; CPU:$D797 PRG:1797 05 00
|
|
sta ZpC0 ; CPU:$D799 PRG:1799 85 C0
|
|
ldy #$04 ; CPU:$D79B PRG:179B A0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD79D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpriteFlags:
|
|
jsr ReadEnemyPointerB ; CPU:$D79D PRG:179D 20 E0 D9
|
|
lda ZpB1 ; CPU:$D7A0 PRG:17A0 A5 B1
|
|
and #$3F ; CPU:$D7A2 PRG:17A2 29 3F
|
|
ora #$80 ; CPU:$D7A4 PRG:17A4 09 80
|
|
sta ZpB1 ; CPU:$D7A6 PRG:17A6 85 B1
|
|
ldy #$00 ; CPU:$D7A8 PRG:17A8 A0 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD7AA
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadEnemyPointer:
|
|
lda (Zp06),y ; CPU:$D7AA PRG:17AA B1 06
|
|
sta ZpBC ; CPU:$D7AC PRG:17AC 85 BC
|
|
iny ; CPU:$D7AE PRG:17AE C8
|
|
lda (Zp06),y ; CPU:$D7AF PRG:17AF B1 06
|
|
sta ZpBD ; CPU:$D7B1 PRG:17B1 85 BD
|
|
lda ZpC0 ; CPU:$D7B3 PRG:17B3 A5 C0
|
|
and #$0F ; CPU:$D7B5 PRG:17B5 29 0F
|
|
cmp #$01 ; CPU:$D7B7 PRG:17B7 C9 01
|
|
bne ReadEnemyPointer_Loop ; CPU:$D7B9 PRG:17B9 D0 06
|
|
lda ZpFF ; CPU:$D7BB PRG:17BB A5 FF
|
|
ora #$10 ; CPU:$D7BD PRG:17BD 09 10
|
|
sta ZpFF ; CPU:$D7BF PRG:17BF 85 FF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReadEnemyPointer_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadEnemyPointer_Loop:
|
|
rts ; CPU:$D7C1 PRG:17C1 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD7C2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemySubType:
|
|
jsr CheckBF_LowNibble ; CPU:$D7C2 PRG:17C2 20 0D D9
|
|
cmp #$01 ; CPU:$D7C5 PRG:17C5 C9 01
|
|
beq HandleEnemySubType_Loop ; CPU:$D7C7 PRG:17C7 F0 05
|
|
cmp #$02 ; CPU:$D7C9 PRG:17C9 C9 02
|
|
beq HandleEnemySubType_Loop2 ; CPU:$D7CB PRG:17CB F0 17
|
|
rts ; CPU:$D7CD PRG:17CD 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemySubType_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemySubType_Loop:
|
|
jsr ClearEnemyTileFlags ; CPU:$D7CE PRG:17CE 20 CB C9
|
|
lda #$03 ; CPU:$D7D1 PRG:17D1 A9 03
|
|
sta ZpC0 ; CPU:$D7D3 PRG:17D3 85 C0
|
|
lda ZpB1 ; CPU:$D7D5 PRG:17D5 A5 B1
|
|
and #$BF ; CPU:$D7D7 PRG:17D7 29 BF
|
|
sta ZpB1 ; CPU:$D7D9 PRG:17D9 85 B1
|
|
ldy #$02 ; CPU:$D7DB PRG:17DB A0 02
|
|
jmp ReadEnemyPointer ; CPU:$D7DD PRG:17DD 4C AA D7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemySubType_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemySubType_OnZero:
|
|
lda #$00 ; CPU:$D7E0 PRG:17E0 A9 00
|
|
sta ZpB3 ; CPU:$D7E2 PRG:17E2 85 B3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemySubType_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemySubType_Loop2:
|
|
jsr SelectEnemyDirection ; CPU:$D7E4 PRG:17E4 20 EA D9
|
|
lda #$00 ; CPU:$D7E7 PRG:17E7 A9 00
|
|
sta ZpB3 ; CPU:$D7E9 PRG:17E9 85 B3
|
|
lda ActorCommand ; CPU:$D7EB PRG:17EB A5 BF
|
|
cmp #$20 ; CPU:$D7ED PRG:17ED C9 20
|
|
bne HandleEnemySubType_Loop3 ; CPU:$D7EF PRG:17EF D0 0D
|
|
lda #$10 ; CPU:$D7F1 PRG:17F1 A9 10
|
|
sta ActorPalette ; CPU:$D7F3 PRG:17F3 85 B4
|
|
lda ActorState ; CPU:$D7F5 PRG:17F5 A5 C4
|
|
beq HandleEnemySubType_Loop3 ; CPU:$D7F7 PRG:17F7 F0 05
|
|
dec ActorState ; CPU:$D7F9 PRG:17F9 C6 C4
|
|
jsr DispatchTableF393 ; CPU:$D7FB PRG:17FB 20 B9 CA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemySubType_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemySubType_Loop3:
|
|
ldy #$06 ; CPU:$D7FE PRG:17FE A0 06
|
|
jsr SetEnemySpriteFlags ; CPU:$D800 PRG:1800 20 9D D7
|
|
lda ZpC0 ; CPU:$D803 PRG:1803 A5 C0
|
|
ora #$0F ; CPU:$D805 PRG:1805 09 0F
|
|
ora Zp00 ; CPU:$D807 PRG:1807 05 00
|
|
sta ZpC0 ; CPU:$D809 PRG:1809 85 C0
|
|
jmp CheckEnemyCommandA ; CPU:$D80B PRG:180B 4C 51 D8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD80E
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommand:
|
|
jsr CheckBF_LowNibble ; CPU:$D80E PRG:180E 20 0D D9
|
|
cmp #$02 ; CPU:$D811 PRG:1811 C9 02
|
|
beq HandleEnemySubType_OnZero ; CPU:$D813 PRG:1813 F0 CB
|
|
jsr CheckZpB3Return ; CPU:$D815 PRG:1815 20 EB CA
|
|
jsr PushTablePointerDispatch ; CPU:$D818 PRG:1818 20 A0 CC
|
|
cmp #$FF ; CPU:$D81B PRG:181B C9 FF
|
|
beq HandleEnemyCommand_Loop2 ; CPU:$D81D PRG:181D F0 12
|
|
cmp #$00 ; CPU:$D81F PRG:181F C9 00
|
|
bne HandleEnemyCommand_Loop ; CPU:$D821 PRG:1821 D0 06
|
|
jsr FindFreeEnemySlotBack ; CPU:$D823 PRG:1823 20 C5 D9
|
|
jsr PushTablePointerDispatch ; CPU:$D826 PRG:1826 20 A0 CC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommand_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommand_Loop:
|
|
sta ZpB6 ; CPU:$D829 PRG:1829 85 B6
|
|
jsr PushTablePointerDispatch ; CPU:$D82B PRG:182B 20 A0 CC
|
|
sta ZpB3 ; CPU:$D82E PRG:182E 85 B3
|
|
rts ; CPU:$D830 PRG:1830 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommand_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommand_Loop2:
|
|
inc ActorState ; CPU:$D831 PRG:1831 E6 C4
|
|
jsr DispatchTableF393 ; CPU:$D833 PRG:1833 20 B9 CA
|
|
lda #$00 ; CPU:$D836 PRG:1836 A9 00
|
|
sta ZpB3 ; CPU:$D838 PRG:1838 85 B3
|
|
sta ZpC0 ; CPU:$D83A PRG:183A 85 C0
|
|
ldy #$06 ; CPU:$D83C PRG:183C A0 06
|
|
jsr ReadEnemyPointerB ; CPU:$D83E PRG:183E 20 E0 D9
|
|
lda ActorCommand ; CPU:$D841 PRG:1841 A5 BF
|
|
cmp #$30 ; CPU:$D843 PRG:1843 C9 30
|
|
beq CheckEnemyCommandA ; CPU:$D845 PRG:1845 F0 0A
|
|
cmp #$20 ; CPU:$D847 PRG:1847 C9 20
|
|
bne HandleEnemyCommand_Loop3 ; CPU:$D849 PRG:1849 D0 04
|
|
lda #$10 ; CPU:$D84B PRG:184B A9 10
|
|
sta ActorPalette ; CPU:$D84D PRG:184D 85 B4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommand_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommand_Loop3:
|
|
inc ActorCount ; CPU:$D84F PRG:184F E6 BB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD851
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCommandA:
|
|
jsr FindFreeEnemySlot ; CPU:$D851 PRG:1851 20 B6 D9
|
|
rts ; CPU:$D854 PRG:1854 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD855
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommandB:
|
|
jsr CheckBF_LowNibble ; CPU:$D855 PRG:1855 20 0D D9
|
|
cmp #$01 ; CPU:$D858 PRG:1858 C9 01
|
|
beq HandleEnemyCommandB_Loop ; CPU:$D85A PRG:185A F0 05
|
|
cmp #$02 ; CPU:$D85C PRG:185C C9 02
|
|
beq HandleEnemyCommandB_Loop2 ; CPU:$D85E PRG:185E F0 11
|
|
rts ; CPU:$D860 PRG:1860 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommandB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommandB_Loop:
|
|
jsr ClearEnemyTileFlags ; CPU:$D861 PRG:1861 20 CB C9
|
|
lda ZpB1 ; CPU:$D864 PRG:1864 A5 B1
|
|
and #$FC ; CPU:$D866 PRG:1866 29 FC
|
|
ora ZpC1 ; CPU:$D868 PRG:1868 05 C1
|
|
sta ZpB1 ; CPU:$D86A PRG:186A 85 B1
|
|
lda #$00 ; CPU:$D86C PRG:186C A9 00
|
|
sta ZpC0 ; CPU:$D86E PRG:186E 85 C0
|
|
rts ; CPU:$D870 PRG:1870 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommandB_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommandB_Loop2:
|
|
lda ZpB1 ; CPU:$D871 PRG:1871 A5 B1
|
|
and #$BF ; CPU:$D873 PRG:1873 29 BF
|
|
sta ZpB1 ; CPU:$D875 PRG:1875 85 B1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD877
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SpawnEnemy:
|
|
jsr PushActorState ; CPU:$D877 PRG:1877 20 82 EE
|
|
lda #$01 ; CPU:$D87A PRG:187A A9 01
|
|
ora Zp00 ; CPU:$D87C PRG:187C 05 00
|
|
sta ZpC0 ; CPU:$D87E PRG:187E 85 C0
|
|
ldy #$08 ; CPU:$D880 PRG:1880 A0 08
|
|
jmp SetEnemySpriteFlags ; CPU:$D882 PRG:1882 4C 9D D7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD885
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommandC:
|
|
jsr PushTablePointerDispatch ; CPU:$D885 PRG:1885 20 A0 CC
|
|
cmp #$EE ; CPU:$D888 PRG:1888 C9 EE
|
|
beq HandleEnemyCommandC_Loop5 ; CPU:$D88A PRG:188A F0 35
|
|
cmp #$DD ; CPU:$D88C PRG:188C C9 DD
|
|
beq HandleEnemyCommandC_Loop3 ; CPU:$D88E PRG:188E F0 1F
|
|
cmp #$CC ; CPU:$D890 PRG:1890 C9 CC
|
|
beq HandleEnemyCommandC_Loop2 ; CPU:$D892 PRG:1892 F0 0A
|
|
ldy Zp51 ; CPU:$D894 PRG:1894 A4 51
|
|
bne HandleEnemyCommandC_Loop ; CPU:$D896 PRG:1896 D0 05
|
|
clc ; CPU:$D898 PRG:1898 18
|
|
adc ActorTileIndex ; CPU:$D899 PRG:1899 65 B8
|
|
sta ActorTileIndex ; CPU:$D89B PRG:189B 85 B8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommandC_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommandC_Loop:
|
|
rts ; CPU:$D89D PRG:189D 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommandC_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommandC_Loop2:
|
|
jsr PushTablePointerDispatch ; CPU:$D89E PRG:189E 20 A0 CC
|
|
sta ZpB5 ; CPU:$D8A1 PRG:18A1 85 B5
|
|
cmp #$05 ; CPU:$D8A3 PRG:18A3 C9 05
|
|
bne HandleEnemyCommandC ; CPU:$D8A5 PRG:18A5 D0 DE
|
|
ldy #$04 ; CPU:$D8A7 PRG:18A7 A0 04
|
|
jsr InitSpritesOffscreen ; CPU:$D8A9 PRG:18A9 20 C4 DF
|
|
jmp HandleEnemyCommandC ; CPU:$D8AC PRG:18AC 4C 85 D8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommandC_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommandC_Loop3:
|
|
jsr PushTablePointerDispatch ; CPU:$D8AF PRG:18AF 20 A0 CC
|
|
sta ZpB6 ; CPU:$D8B2 PRG:18B2 85 B6
|
|
cmp #$4D ; CPU:$D8B4 PRG:18B4 C9 4D
|
|
bne HandleEnemyCommandC_Loop4 ; CPU:$D8B6 PRG:18B6 D0 08
|
|
lda Zp51 ; CPU:$D8B8 PRG:18B8 A5 51
|
|
bne ResetEnemyList ; CPU:$D8BA PRG:18BA D0 48
|
|
lda #$02 ; CPU:$D8BC PRG:18BC A9 02
|
|
sta ZpB7 ; CPU:$D8BE PRG:18BE 85 B7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommandC_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommandC_Loop4:
|
|
rts ; CPU:$D8C0 PRG:18C0 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommandC_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommandC_Loop5:
|
|
lda $04B0 ; CPU:$D8C1 PRG:18C1 AD B0 04
|
|
bne ResetEnemyList ; CPU:$D8C4 PRG:18C4 D0 3E
|
|
lda Zp51 ; CPU:$D8C6 PRG:18C6 A5 51
|
|
bne ResetEnemyList ; CPU:$D8C8 PRG:18C8 D0 3A
|
|
lda ActorTileIndex ; CPU:$D8CA PRG:18CA A5 B8
|
|
clc ; CPU:$D8CC PRG:18CC 18
|
|
adc #$0B ; CPU:$D8CD PRG:18CD 69 0B
|
|
tax ; CPU:$D8CF PRG:18CF AA
|
|
ldy ScrollX ; CPU:$D8D0 PRG:18D0 A4 B9
|
|
lda ZpCC ; CPU:$D8D2 PRG:18D2 A5 CC
|
|
sta Zp11 ; CPU:$D8D4 PRG:18D4 85 11
|
|
lda ActorCommand ; CPU:$D8D6 PRG:18D6 A5 BF
|
|
cmp #$80 ; CPU:$D8D8 PRG:18D8 C9 80
|
|
beq HandleEnemyCommandC_Loop6 ; CPU:$D8DA PRG:18DA F0 09
|
|
lda #$00 ; CPU:$D8DC PRG:18DC A9 00
|
|
jsr SetEnemySpeed ; CPU:$D8DE PRG:18DE 20 E3 EE
|
|
ldy #$08 ; CPU:$D8E1 PRG:18E1 A0 08
|
|
bne HandleEnemyCommandC_Loop7 ; CPU:$D8E3 PRG:18E3 D0 0C
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommandC_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommandC_Loop6:
|
|
lda #$05 ; CPU:$D8E5 PRG:18E5 A9 05
|
|
jsr SetEnemySpeed ; CPU:$D8E7 PRG:18E7 20 E3 EE
|
|
lda #$00 ; CPU:$D8EA PRG:18EA A9 00
|
|
sta $04C1 ; CPU:$D8EC PRG:18EC 8D C1 04
|
|
ldy #$05 ; CPU:$D8EF PRG:18EF A0 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyCommandC_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyCommandC_Loop7:
|
|
sty Zp00 ; CPU:$D8F1 PRG:18F1 84 00
|
|
ldx ZpCC ; CPU:$D8F3 PRG:18F3 A6 CC
|
|
lda #$01 ; CPU:$D8F5 PRG:18F5 A9 01
|
|
sta Zp9D,x ; CPU:$D8F7 PRG:18F7 95 9D
|
|
txa ; CPU:$D8F9 PRG:18F9 8A
|
|
ora #$08 ; CPU:$D8FA PRG:18FA 09 08
|
|
sta Zp01 ; CPU:$D8FC PRG:18FC 85 01
|
|
jsr InitZerosIfZp30Zero ; CPU:$D8FE PRG:18FE 20 83 DE
|
|
jmp CheckStageCompleteB ; CPU:$D901 PRG:1901 4C A2 EC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD904
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetEnemyList:
|
|
lda #$00 ; CPU:$D904 PRG:1904 A9 00
|
|
sta ZpB0 ; CPU:$D906 PRG:1906 85 B0
|
|
ldy #$04 ; CPU:$D908 PRG:1908 A0 04
|
|
jmp InitSpritesOffscreen ; CPU:$D90A PRG:190A 4C C4 DF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckBF_LowNibble
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckBF_LowNibble:
|
|
lda ActorCommand ; CPU:$D90D PRG:190D A5 BF
|
|
and #$0F ; CPU:$D90F PRG:190F 29 0F
|
|
bne CheckBF_LowNibble_Loop ; CPU:$D911 PRG:1911 D0 07
|
|
lda ZpC2 ; CPU:$D913 PRG:1913 A5 C2
|
|
beq CheckBF_LowNibble_Loop ; CPU:$D915 PRG:1915 F0 03
|
|
lda #$00 ; CPU:$D917 PRG:1917 A9 00
|
|
rts ; CPU:$D919 PRG:1919 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckBF_LowNibble_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckBF_LowNibble_Loop:
|
|
lda Zp71 ; CPU:$D91A PRG:191A A5 71
|
|
bne ReadEnemyScriptValue_Loop ; CPU:$D91C PRG:191C D0 6A
|
|
lda ZpCD ; CPU:$D91E PRG:191E A5 CD
|
|
jsr CheckRangeReturn012 ; CPU:$D920 PRG:1920 20 A4 CA
|
|
cmp #$02 ; CPU:$D923 PRG:1923 C9 02
|
|
beq CheckBF_LowNibble_Loop2 ; CPU:$D925 PRG:1925 F0 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckBF_LowNibble_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckBF_LowNibble_OnZero:
|
|
rts ; CPU:$D927 PRG:1927 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckBF_LowNibble_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckBF_LowNibble_Loop2:
|
|
ldx ZpBE ; CPU:$D928 PRG:1928 A6 BE
|
|
ldy ScrollX ; CPU:$D92A PRG:192A A4 B9
|
|
jsr ReadActorPointer ; CPU:$D92C PRG:192C 20 67 EC
|
|
jsr ComputeScoreOffset ; CPU:$D92F PRG:192F 20 90 D9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckBF_LowNibble_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckBF_LowNibble_OnNonzero:
|
|
lda Zp00 ; CPU:$D932 PRG:1932 A5 00
|
|
cmp #$30 ; CPU:$D934 PRG:1934 C9 30
|
|
beq SetMarioDirectionB_Loop4 ; CPU:$D936 PRG:1936 F0 30
|
|
lsr a ; CPU:$D938 PRG:1938 4A
|
|
lsr a ; CPU:$D939 PRG:1939 4A
|
|
lsr a ; CPU:$D93A PRG:193A 4A
|
|
lsr a ; CPU:$D93B PRG:193B 4A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD93C
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetMarioDirectionB:
|
|
sta Zp1E ; CPU:$D93C PRG:193C 85 1E
|
|
lda ZpB1 ; CPU:$D93E PRG:193E A5 B1
|
|
sta $05F8 ; CPU:$D940 PRG:1940 8D F8 05
|
|
and #$FC ; CPU:$D943 PRG:1943 29 FC
|
|
ora Zp1E ; CPU:$D945 PRG:1945 05 1E
|
|
sta ZpB1 ; CPU:$D947 PRG:1947 85 B1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetMarioDirectionB_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetMarioDirectionB_OnNonzero:
|
|
lda ActorCommand ; CPU:$D949 PRG:1949 A5 BF
|
|
and #$F0 ; CPU:$D94B PRG:194B 29 F0
|
|
beq SetMarioDirectionB_Loop3 ; CPU:$D94D PRG:194D F0 16
|
|
ldy ZpC8 ; CPU:$D94F PRG:194F A4 C8
|
|
beq SetMarioDirectionB_Loop3 ; CPU:$D951 PRG:1951 F0 12
|
|
cmp #$30 ; CPU:$D953 PRG:1953 C9 30
|
|
beq SetMarioDirectionB_Loop2 ; CPU:$D955 PRG:1955 F0 0A
|
|
ldy #$03 ; CPU:$D957 PRG:1957 A0 03
|
|
cmp #$20 ; CPU:$D959 PRG:1959 C9 20
|
|
beq SetMarioDirectionB_Loop ; CPU:$D95B PRG:195B F0 02
|
|
ldy #$06 ; CPU:$D95D PRG:195D A0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetMarioDirectionB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetMarioDirectionB_Loop:
|
|
sty ZpB5 ; CPU:$D95F PRG:195F 84 B5
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetMarioDirectionB_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetMarioDirectionB_Loop2:
|
|
lda #$00 ; CPU:$D961 PRG:1961 A9 00
|
|
sta ZpC8 ; CPU:$D963 PRG:1963 85 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetMarioDirectionB_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetMarioDirectionB_Loop3:
|
|
lda #$02 ; CPU:$D965 PRG:1965 A9 02
|
|
rts ; CPU:$D967 PRG:1967 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetMarioDirectionB_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetMarioDirectionB_Loop4:
|
|
lda ActorCommand ; CPU:$D968 PRG:1968 A5 BF
|
|
and #$0F ; CPU:$D96A PRG:196A 29 0F
|
|
bne SetMarioDirectionB_OnNonzero ; CPU:$D96C PRG:196C D0 DB
|
|
lda ZpB1 ; CPU:$D96E PRG:196E A5 B1
|
|
and #$03 ; CPU:$D970 PRG:1970 29 03
|
|
beq SetMarioDirectionB ; CPU:$D972 PRG:1972 F0 C8
|
|
eor #$03 ; CPU:$D974 PRG:1974 49 03
|
|
jmp SetMarioDirectionB ; CPU:$D976 PRG:1976 4C 3C D9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD979
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadEnemyScriptValue:
|
|
lda ZpCD ; CPU:$D979 PRG:1979 A5 CD
|
|
jsr CheckRangeReturn012 ; CPU:$D97B PRG:197B 20 A4 CA
|
|
cmp #$00 ; CPU:$D97E PRG:197E C9 00
|
|
beq CheckBF_LowNibble_OnZero ; CPU:$D980 PRG:1980 F0 A5
|
|
lda #$30 ; CPU:$D982 PRG:1982 A9 30
|
|
sta Zp00 ; CPU:$D984 PRG:1984 85 00
|
|
bne CheckBF_LowNibble_OnNonzero ; CPU:$D986 PRG:1986 D0 AA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReadEnemyScriptValue_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadEnemyScriptValue_Loop:
|
|
ldy Zp72 ; CPU:$D988 PRG:1988 A4 72
|
|
dey ; CPU:$D98A PRG:198A 88
|
|
sty Zp9F ; CPU:$D98B PRG:198B 84 9F
|
|
jmp ReadEnemyScriptValue ; CPU:$D98D PRG:198D 4C 79 D9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD990
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeScoreOffset:
|
|
lda Zp32 ; CPU:$D990 PRG:1990 A5 32
|
|
asl a ; CPU:$D992 PRG:1992 0A
|
|
sta Zp00 ; CPU:$D993 PRG:1993 85 00
|
|
asl a ; CPU:$D995 PRG:1995 0A
|
|
asl a ; CPU:$D996 PRG:1996 0A
|
|
asl a ; CPU:$D997 PRG:1997 0A
|
|
clc ; CPU:$D998 PRG:1998 18
|
|
adc Zp00 ; CPU:$D999 PRG:1999 65 00
|
|
adc #$A0 ; CPU:$D99B PRG:199B 69 A0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ComputeScoreOffset_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeScoreOffset_OnZero:
|
|
ldy #$03 ; CPU:$D99D PRG:199D A0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ComputeScoreOffset_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeScoreOffset_OnNonzero:
|
|
dey ; CPU:$D99F PRG:199F 88
|
|
cmp ZpCD ; CPU:$D9A0 PRG:19A0 C5 CD
|
|
beq ComputeScoreOffset_Loop ; CPU:$D9A2 PRG:19A2 F0 09
|
|
clc ; CPU:$D9A4 PRG:19A4 18
|
|
adc #$01 ; CPU:$D9A5 PRG:19A5 69 01
|
|
cpy #$00 ; CPU:$D9A7 PRG:19A7 C0 00
|
|
bne ComputeScoreOffset_OnNonzero ; CPU:$D9A9 PRG:19A9 D0 F4
|
|
beq ComputeScoreOffset_OnZero ; CPU:$D9AB PRG:19AB F0 F0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ComputeScoreOffset_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeScoreOffset_Loop:
|
|
lda $D9B3,y ; CPU:$D9AD PRG:19AD B9 B3 D9
|
|
sta Zp00 ; CPU:$D9B0 PRG:19B0 85 00
|
|
rts ; CPU:$D9B2 PRG:19B2 60
|
|
; ---- data $D9B3-$D9B5 (3 bytes) ----
|
|
; referenced by `lda $D9B3,y` at $D9AD (operand $D9B3 falls inside this region)
|
|
BranchPastEnemy:
|
|
.byte $10, $30, $20 ; CPU:$D9B3 PRG:19B3 10 30 20
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD9B6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FindFreeEnemySlot:
|
|
pha ; CPU:$D9B6 PRG:19B6 48
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD9B7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FindFreeActorSlot:
|
|
ldy ActorCount ; CPU:$D9B7 PRG:19B7 A4 BB
|
|
lda $F638,y ; CPU:$D9B9 PRG:19B9 B9 38 F6
|
|
cmp #$FF ; CPU:$D9BC PRG:19BC C9 FF
|
|
bne FindFreeActorSlotBack_Loop ; CPU:$D9BE PRG:19BE D0 14
|
|
dec ActorCount ; CPU:$D9C0 PRG:19C0 C6 BB
|
|
jmp FindFreeActorSlot ; CPU:$D9C2 PRG:19C2 4C B7 D9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD9C5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FindFreeEnemySlotBack:
|
|
pha ; CPU:$D9C5 PRG:19C5 48
|
|
ldy ActorCount ; CPU:$D9C6 PRG:19C6 A4 BB
|
|
iny ; CPU:$D9C8 PRG:19C8 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD9C9
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FindFreeActorSlotBack:
|
|
lda $F638,y ; CPU:$D9C9 PRG:19C9 B9 38 F6
|
|
cmp #$FF ; CPU:$D9CC PRG:19CC C9 FF
|
|
bne FindFreeActorSlotBack_Loop ; CPU:$D9CE PRG:19CE D0 04
|
|
dey ; CPU:$D9D0 PRG:19D0 88
|
|
jmp FindFreeActorSlotBack ; CPU:$D9D1 PRG:19D1 4C C9 D9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: FindFreeActorSlotBack_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FindFreeActorSlotBack_Loop:
|
|
sta Zp1E ; CPU:$D9D4 PRG:19D4 85 1E
|
|
lda ZpB7 ; CPU:$D9D6 PRG:19D6 A5 B7
|
|
and #$E0 ; CPU:$D9D8 PRG:19D8 29 E0
|
|
ora Zp1E ; CPU:$D9DA PRG:19DA 05 1E
|
|
sta ZpB7 ; CPU:$D9DC PRG:19DC 85 B7
|
|
pla ; CPU:$D9DE PRG:19DE 68
|
|
rts ; CPU:$D9DF PRG:19DF 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD9E0
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadEnemyPointerB:
|
|
lda (Zp06),y ; CPU:$D9E0 PRG:19E0 B1 06
|
|
sta ZpB6 ; CPU:$D9E2 PRG:19E2 85 B6
|
|
iny ; CPU:$D9E4 PRG:19E4 C8
|
|
lda (Zp06),y ; CPU:$D9E5 PRG:19E5 B1 06
|
|
sta ZpB5 ; CPU:$D9E7 PRG:19E7 85 B5
|
|
rts ; CPU:$D9E9 PRG:19E9 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD9EA
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectEnemyDirection:
|
|
lda ZpB1 ; CPU:$D9EA PRG:19EA A5 B1
|
|
ldy #$40 ; CPU:$D9EC PRG:19EC A0 40
|
|
lsr a ; CPU:$D9EE PRG:19EE 4A
|
|
bcs SelectEnemyDirection_Loop ; CPU:$D9EF PRG:19EF B0 02
|
|
ldy #$00 ; CPU:$D9F1 PRG:19F1 A0 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SelectEnemyDirection_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectEnemyDirection_Loop:
|
|
sty Zp1E ; CPU:$D9F3 PRG:19F3 84 1E
|
|
lda ZpB7 ; CPU:$D9F5 PRG:19F5 A5 B7
|
|
and #$BF ; CPU:$D9F7 PRG:19F7 29 BF
|
|
ora Zp1E ; CPU:$D9F9 PRG:19F9 05 1E
|
|
sta ZpB7 ; CPU:$D9FB PRG:19FB 85 B7
|
|
rts ; CPU:$D9FD PRG:19FD 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCD9FE
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn:
|
|
ldy ScrollX ; CPU:$D9FE PRG:19FE A4 B9
|
|
lda ZpC2 ; CPU:$DA00 PRG:1A00 A5 C2
|
|
bne CheckEnemySpawn_Loop9 ; CPU:$DA02 PRG:1A02 D0 5D
|
|
lda ZpBE ; CPU:$DA04 PRG:1A04 A5 BE
|
|
beq CheckEnemySpawn_Loop ; CPU:$DA06 PRG:1A06 F0 01
|
|
rts ; CPU:$DA08 PRG:1A08 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_Loop:
|
|
lda ActorCommand ; CPU:$DA09 PRG:1A09 A5 BF
|
|
cmp #$30 ; CPU:$DA0B PRG:1A0B C9 30
|
|
bne CheckEnemySpawn_Loop5 ; CPU:$DA0D PRG:1A0D D0 23
|
|
lda ZpB1 ; CPU:$DA0F PRG:1A0F A5 B1
|
|
and #$C0 ; CPU:$DA11 PRG:1A11 29 C0
|
|
bne CheckEnemySpawn_Loop2 ; CPU:$DA13 PRG:1A13 D0 09
|
|
lda ZpB1 ; CPU:$DA15 PRG:1A15 A5 B1
|
|
lsr a ; CPU:$DA17 PRG:1A17 4A
|
|
bcs CheckEnemySpawn_Loop3 ; CPU:$DA18 PRG:1A18 B0 05
|
|
cpy #$40 ; CPU:$DA1A PRG:1A1A C0 40
|
|
bcc CheckEnemySpawn_Loop4 ; CPU:$DA1C PRG:1A1C 90 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_Loop2:
|
|
rts ; CPU:$DA1E PRG:1A1E 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_Loop3:
|
|
cpy #$C0 ; CPU:$DA1F PRG:1A1F C0 C0
|
|
bcs CheckEnemySpawn_Loop4 ; CPU:$DA21 PRG:1A21 B0 01
|
|
rts ; CPU:$DA23 PRG:1A23 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_Loop4:
|
|
lda ZpB1 ; CPU:$DA24 PRG:1A24 A5 B1
|
|
ora #$80 ; CPU:$DA26 PRG:1A26 09 80
|
|
sta ZpB1 ; CPU:$DA28 PRG:1A28 85 B1
|
|
lda #$4D ; CPU:$DA2A PRG:1A2A A9 4D
|
|
ldy #$F6 ; CPU:$DA2C PRG:1A2C A0 F6
|
|
ldx #$03 ; CPU:$DA2E PRG:1A2E A2 03
|
|
bne CheckEnemySpawn_Loop8 ; CPU:$DA30 PRG:1A30 D0 14
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_Loop5:
|
|
lda ZpB1 ; CPU:$DA32 PRG:1A32 A5 B1
|
|
lsr a ; CPU:$DA34 PRG:1A34 4A
|
|
bcs CheckEnemySpawn_Loop6 ; CPU:$DA35 PRG:1A35 B0 05
|
|
cpy #$28 ; CPU:$DA37 PRG:1A37 C0 28
|
|
bcc CheckEnemySpawn_Loop7 ; CPU:$DA39 PRG:1A39 90 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_OnCarryClear
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_OnCarryClear:
|
|
rts ; CPU:$DA3B PRG:1A3B 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_Loop6:
|
|
cpy #$D8 ; CPU:$DA3C PRG:1A3C C0 D8
|
|
bcc CheckEnemySpawn_OnCarryClear ; CPU:$DA3E PRG:1A3E 90 FB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_Loop7:
|
|
lda #$43 ; CPU:$DA40 PRG:1A40 A9 43
|
|
ldy #$F6 ; CPU:$DA42 PRG:1A42 A0 F6
|
|
ldx #$02 ; CPU:$DA44 PRG:1A44 A2 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_Loop8:
|
|
sta ZpBC ; CPU:$DA46 PRG:1A46 85 BC
|
|
sty ZpBD ; CPU:$DA48 PRG:1A48 84 BD
|
|
lda ZpB1 ; CPU:$DA4A PRG:1A4A A5 B1
|
|
and #$03 ; CPU:$DA4C PRG:1A4C 29 03
|
|
sta ZpC2 ; CPU:$DA4E PRG:1A4E 85 C2
|
|
lda ZpB7 ; CPU:$DA50 PRG:1A50 A5 B7
|
|
ora #$20 ; CPU:$DA52 PRG:1A52 09 20
|
|
sta ZpB7 ; CPU:$DA54 PRG:1A54 85 B7
|
|
stx ZpB2 ; CPU:$DA56 PRG:1A56 86 B2
|
|
lda #$01 ; CPU:$DA58 PRG:1A58 A9 01
|
|
sta ZpC5 ; CPU:$DA5A PRG:1A5A 85 C5
|
|
lda #$00 ; CPU:$DA5C PRG:1A5C A9 00
|
|
sta ZpC7 ; CPU:$DA5E PRG:1A5E 85 C7
|
|
rts ; CPU:$DA60 PRG:1A60 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_Loop9
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_Loop9:
|
|
bpl UpdateEnemySprite_Loop ; CPU:$DA61 PRG:1A61 10 42
|
|
lsr a ; CPU:$DA63 PRG:1A63 4A
|
|
bcc CheckEnemySpawn_Loop11 ; CPU:$DA64 PRG:1A64 90 0F
|
|
cpy #$38 ; CPU:$DA66 PRG:1A66 C0 38
|
|
bcs CheckEnemySpawn_Loop10 ; CPU:$DA68 PRG:1A68 B0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_OnCarrySet
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_OnCarrySet:
|
|
jmp AdvanceEnemySpeed ; CPU:$DA6A PRG:1A6A 4C 1E DB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_Loop10
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_Loop10:
|
|
lda #$00 ; CPU:$DA6D PRG:1A6D A9 00
|
|
sta $05FB ; CPU:$DA6F PRG:1A6F 8D FB 05
|
|
jmp UpdateEnemySprite ; CPU:$DA72 PRG:1A72 4C 7E DA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawn_Loop11
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawn_Loop11:
|
|
cpy #$C8 ; CPU:$DA75 PRG:1A75 C0 C8
|
|
bcs CheckEnemySpawn_OnCarrySet ; CPU:$DA77 PRG:1A77 B0 F1
|
|
lda #$00 ; CPU:$DA79 PRG:1A79 A9 00
|
|
sta $05FC ; CPU:$DA7B PRG:1A7B 8D FC 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDA7E
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemySprite:
|
|
jsr SelectActorSprite ; CPU:$DA7E PRG:1A7E 20 34 DB
|
|
jsr DispatchTableF393 ; CPU:$DA81 PRG:1A81 20 B9 CA
|
|
lda ZpB7 ; CPU:$DA84 PRG:1A84 A5 B7
|
|
and #$DF ; CPU:$DA86 PRG:1A86 29 DF
|
|
sta ZpB7 ; CPU:$DA88 PRG:1A88 85 B7
|
|
lda #$00 ; CPU:$DA8A PRG:1A8A A9 00
|
|
sta ZpC2 ; CPU:$DA8C PRG:1A8C 85 C2
|
|
lda ActorCommand ; CPU:$DA8E PRG:1A8E A5 BF
|
|
cmp #$30 ; CPU:$DA90 PRG:1A90 C9 30
|
|
bne UpdateEnemySprite_Loop3 ; CPU:$DA92 PRG:1A92 D0 2C
|
|
lda #$7B ; CPU:$DA94 PRG:1A94 A9 7B
|
|
ldy #$F3 ; CPU:$DA96 PRG:1A96 A0 F3
|
|
sta ZpBC ; CPU:$DA98 PRG:1A98 85 BC
|
|
sty ZpBD ; CPU:$DA9A PRG:1A9A 84 BD
|
|
lda ZpB1 ; CPU:$DA9C PRG:1A9C A5 B1
|
|
and #$3F ; CPU:$DA9E PRG:1A9E 29 3F
|
|
ora #$40 ; CPU:$DAA0 PRG:1AA0 09 40
|
|
sta ZpB1 ; CPU:$DAA2 PRG:1AA2 85 B1
|
|
rts ; CPU:$DAA4 PRG:1AA4 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemySprite_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemySprite_Loop:
|
|
jsr AdvanceEnemySpeed ; CPU:$DAA5 PRG:1AA5 20 1E DB
|
|
jsr PushTablePointerDispatch ; CPU:$DAA8 PRG:1AA8 20 A0 CC
|
|
cmp #$AA ; CPU:$DAAB PRG:1AAB C9 AA
|
|
beq UpdateEnemySprite_Loop4 ; CPU:$DAAD PRG:1AAD F0 12
|
|
tay ; CPU:$DAAF PRG:1AAF A8
|
|
lda ActorCommand ; CPU:$DAB0 PRG:1AB0 A5 BF
|
|
cmp #$30 ; CPU:$DAB2 PRG:1AB2 C9 30
|
|
bne UpdateEnemySprite_Loop2 ; CPU:$DAB4 PRG:1AB4 D0 04
|
|
lda ZpB3 ; CPU:$DAB6 PRG:1AB6 A5 B3
|
|
bne UpdateEnemySprite_Loop3 ; CPU:$DAB8 PRG:1AB8 D0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemySprite_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemySprite_Loop2:
|
|
tya ; CPU:$DABA PRG:1ABA 98
|
|
clc ; CPU:$DABB PRG:1ABB 18
|
|
adc ActorTileIndex ; CPU:$DABC PRG:1ABC 65 B8
|
|
sta ActorTileIndex ; CPU:$DABE PRG:1ABE 85 B8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemySprite_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemySprite_Loop3:
|
|
rts ; CPU:$DAC0 PRG:1AC0 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemySprite_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemySprite_Loop4:
|
|
ldy ScrollX ; CPU:$DAC1 PRG:1AC1 A4 B9
|
|
lda ZpC2 ; CPU:$DAC3 PRG:1AC3 A5 C2
|
|
lsr a ; CPU:$DAC5 PRG:1AC5 4A
|
|
bcs UpdateEnemySprite_Loop5 ; CPU:$DAC6 PRG:1AC6 B0 1B
|
|
cpy #$18 ; CPU:$DAC8 PRG:1AC8 C0 18
|
|
bcs UpdateEnemySprite_Loop3 ; CPU:$DACA PRG:1ACA B0 F4
|
|
lda #$10 ; CPU:$DACC PRG:1ACC A9 10
|
|
sta ScrollX ; CPU:$DACE PRG:1ACE 85 B9
|
|
lda $05FB ; CPU:$DAD0 PRG:1AD0 AD FB 05
|
|
bne UpdateEnemySprite_Loop8 ; CPU:$DAD3 PRG:1AD3 D0 44
|
|
jsr CheckSpriteFlip ; CPU:$DAD5 PRG:1AD5 20 D3 DF
|
|
lda #$01 ; CPU:$DAD8 PRG:1AD8 A9 01
|
|
sta $05FB ; CPU:$DADA PRG:1ADA 8D FB 05
|
|
lda #$28 ; CPU:$DADD PRG:1ADD A9 28
|
|
ldy #$01 ; CPU:$DADF PRG:1ADF A0 01
|
|
bne UpdateEnemySprite_Loop6 ; CPU:$DAE1 PRG:1AE1 D0 19
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemySprite_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemySprite_Loop5:
|
|
cpy #$E8 ; CPU:$DAE3 PRG:1AE3 C0 E8
|
|
bcc UpdateEnemySprite_Loop3 ; CPU:$DAE5 PRG:1AE5 90 D9
|
|
lda #$F0 ; CPU:$DAE7 PRG:1AE7 A9 F0
|
|
sta ScrollX ; CPU:$DAE9 PRG:1AE9 85 B9
|
|
lda $05FC ; CPU:$DAEB PRG:1AEB AD FC 05
|
|
bne UpdateEnemySprite_Loop8 ; CPU:$DAEE PRG:1AEE D0 29
|
|
jsr CheckSpriteFlip ; CPU:$DAF0 PRG:1AF0 20 D3 DF
|
|
lda #$01 ; CPU:$DAF3 PRG:1AF3 A9 01
|
|
sta $05FC ; CPU:$DAF5 PRG:1AF5 8D FC 05
|
|
lda #$D8 ; CPU:$DAF8 PRG:1AF8 A9 D8
|
|
ldy #$02 ; CPU:$DAFA PRG:1AFA A0 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemySprite_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemySprite_Loop6:
|
|
sta ScrollX ; CPU:$DAFC PRG:1AFC 85 B9
|
|
sty ZpB1 ; CPU:$DAFE PRG:1AFE 84 B1
|
|
lda #$2C ; CPU:$DB00 PRG:1B00 A9 2C
|
|
sta ActorTileIndex ; CPU:$DB02 PRG:1B02 85 B8
|
|
tya ; CPU:$DB04 PRG:1B04 98
|
|
ora #$80 ; CPU:$DB05 PRG:1B05 09 80
|
|
sta ZpC2 ; CPU:$DB07 PRG:1B07 85 C2
|
|
lda #$03 ; CPU:$DB09 PRG:1B09 A9 03
|
|
sta ZpB2 ; CPU:$DB0B PRG:1B0B 85 B2
|
|
lda ActorCommand ; CPU:$DB0D PRG:1B0D A5 BF
|
|
cmp #$30 ; CPU:$DB0F PRG:1B0F C9 30
|
|
bne UpdateEnemySprite_Loop7 ; CPU:$DB11 PRG:1B11 D0 05
|
|
tya ; CPU:$DB13 PRG:1B13 98
|
|
ora #$80 ; CPU:$DB14 PRG:1B14 09 80
|
|
sta ZpB1 ; CPU:$DB16 PRG:1B16 85 B1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemySprite_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemySprite_Loop7:
|
|
rts ; CPU:$DB18 PRG:1B18 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateEnemySprite_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemySprite_Loop8:
|
|
lda #$F4 ; CPU:$DB19 PRG:1B19 A9 F4
|
|
sta ActorTileIndex ; CPU:$DB1B PRG:1B1B 85 B8
|
|
rts ; CPU:$DB1D PRG:1B1D 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDB1E
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemySpeed:
|
|
pha ; CPU:$DB1E PRG:1B1E 48
|
|
lda Zp71 ; CPU:$DB1F PRG:1B1F A5 71
|
|
beq AdvanceEnemySpeed_Loop ; CPU:$DB21 PRG:1B21 F0 08
|
|
lda $05F9 ; CPU:$DB23 PRG:1B23 AD F9 05
|
|
clc ; CPU:$DB26 PRG:1B26 18
|
|
adc ActorTileIndex ; CPU:$DB27 PRG:1B27 65 B8
|
|
sta ActorTileIndex ; CPU:$DB29 PRG:1B29 85 B8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemySpeed_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemySpeed_Loop:
|
|
pla ; CPU:$DB2B PRG:1B2B 68
|
|
rts ; CPU:$DB2C PRG:1B2C 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDB2D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyTimer:
|
|
lda ZpC6 ; CPU:$DB2D PRG:1B2D A5 C6
|
|
beq DecEnemyTimer_OnZero ; CPU:$DB2F PRG:1B2F F0 02
|
|
dec ZpC6 ; CPU:$DB31 PRG:1B31 C6 C6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyTimer_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyTimer_OnZero:
|
|
rts ; CPU:$DB33 PRG:1B33 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDB34
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectActorSprite:
|
|
lda ActorCommand ; CPU:$DB34 PRG:1B34 A5 BF
|
|
ldx #$10 ; CPU:$DB36 PRG:1B36 A2 10
|
|
cmp #$10 ; CPU:$DB38 PRG:1B38 C9 10
|
|
beq SelectActorSprite_Loop ; CPU:$DB3A PRG:1B3A F0 0E
|
|
ldx #$20 ; CPU:$DB3C PRG:1B3C A2 20
|
|
cmp #$20 ; CPU:$DB3E PRG:1B3E C9 20
|
|
beq SelectActorSprite_Loop ; CPU:$DB40 PRG:1B40 F0 08
|
|
ldx #$40 ; CPU:$DB42 PRG:1B42 A2 40
|
|
cmp #$30 ; CPU:$DB44 PRG:1B44 C9 30
|
|
beq SelectActorSprite_Loop ; CPU:$DB46 PRG:1B46 F0 02
|
|
ldx #$08 ; CPU:$DB48 PRG:1B48 A2 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SelectActorSprite_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SelectActorSprite_Loop:
|
|
stx Zp1E ; CPU:$DB4A PRG:1B4A 86 1E
|
|
lda ZpFE ; CPU:$DB4C PRG:1B4C A5 FE
|
|
ora Zp1E ; CPU:$DB4E PRG:1B4E 05 1E
|
|
sta ZpFE ; CPU:$DB50 PRG:1B50 85 FE
|
|
rts ; CPU:$DB52 PRG:1B52 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDB53
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyScriptCounter:
|
|
ldy ScriptStepCounter ; CPU:$DB53 PRG:1B53 A4 33
|
|
dey ; CPU:$DB55 PRG:1B55 88
|
|
beq DecEnemyTimer_OnZero ; CPU:$DB56 PRG:1B56 F0 DB
|
|
sty Zp11 ; CPU:$DB58 PRG:1B58 84 11
|
|
lda FrameCounter ; CPU:$DB5A PRG:1B5A A5 2F
|
|
and #$01 ; CPU:$DB5C PRG:1B5C 29 01
|
|
bne DecEnemyScriptCounter_Loop2 ; CPU:$DB5E PRG:1B5E D0 0B
|
|
cpy #$03 ; CPU:$DB60 PRG:1B60 C0 03
|
|
beq DecEnemyScriptCounter_Loop ; CPU:$DB62 PRG:1B62 F0 06
|
|
cpy #$04 ; CPU:$DB64 PRG:1B64 C0 04
|
|
beq DecEnemyScriptCounter_Loop ; CPU:$DB66 PRG:1B66 F0 02
|
|
bne DecEnemyScriptCounter_Loop3 ; CPU:$DB68 PRG:1B68 D0 09
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyScriptCounter_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyScriptCounter_Loop:
|
|
rts ; CPU:$DB6A PRG:1B6A 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyScriptCounter_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyScriptCounter_Loop2:
|
|
cpy #$03 ; CPU:$DB6B PRG:1B6B C0 03
|
|
beq DecEnemyScriptCounter_Loop3 ; CPU:$DB6D PRG:1B6D F0 04
|
|
cpy #$04 ; CPU:$DB6F PRG:1B6F C0 04
|
|
bne DecEnemyScriptCounter_Loop ; CPU:$DB71 PRG:1B71 D0 F7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyScriptCounter_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyScriptCounter_Loop3:
|
|
lda ScriptPtrLo ; CPU:$DB73 PRG:1B73 A5 A0
|
|
sta Zp14 ; CPU:$DB75 PRG:1B75 85 14
|
|
lda ScriptPtrHi ; CPU:$DB77 PRG:1B77 A5 A1
|
|
sta Zp15 ; CPU:$DB79 PRG:1B79 85 15
|
|
lda ScriptStep ; CPU:$DB7B PRG:1B7B A5 A2
|
|
clc ; CPU:$DB7D PRG:1B7D 18
|
|
adc #$20 ; CPU:$DB7E PRG:1B7E 69 20
|
|
sta Zp12 ; CPU:$DB80 PRG:1B80 85 12
|
|
lda #$00 ; CPU:$DB82 PRG:1B82 A9 00
|
|
sta Zp13 ; CPU:$DB84 PRG:1B84 85 13
|
|
jsr AdvanceDispatchPointer ; CPU:$DB86 PRG:1B86 20 B4 CD
|
|
ldy #$05 ; CPU:$DB89 PRG:1B89 A0 05
|
|
ldx #$07 ; CPU:$DB8B PRG:1B8B A2 07
|
|
jsr SetVramPointer2 ; CPU:$DB8D PRG:1B8D 20 4A C4
|
|
and #$0F ; CPU:$DB90 PRG:1B90 29 0F
|
|
beq DecEnemyScriptCounter_Loop ; CPU:$DB92 PRG:1B92 F0 D6
|
|
sta Zp1F ; CPU:$DB94 PRG:1B94 85 1F
|
|
eor #$03 ; CPU:$DB96 PRG:1B96 49 03
|
|
sta Zp1E ; CPU:$DB98 PRG:1B98 85 1E
|
|
lda ZpC0 ; CPU:$DB9A PRG:1B9A A5 C0
|
|
ora ZpC2 ; CPU:$DB9C PRG:1B9C 05 C2
|
|
ora ZpC8 ; CPU:$DB9E PRG:1B9E 05 C8
|
|
bne DecEnemyScriptCounter_Loop5 ; CPU:$DBA0 PRG:1BA0 D0 24
|
|
lda ActorCommand ; CPU:$DBA2 PRG:1BA2 A5 BF
|
|
cmp #$80 ; CPU:$DBA4 PRG:1BA4 C9 80
|
|
bne DecEnemyScriptCounter_Loop4 ; CPU:$DBA6 PRG:1BA6 D0 04
|
|
lda ZpC1 ; CPU:$DBA8 PRG:1BA8 A5 C1
|
|
bne DecEnemyScriptCounter_Loop5 ; CPU:$DBAA PRG:1BAA D0 1A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyScriptCounter_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyScriptCounter_Loop4:
|
|
ldy #$19 ; CPU:$DBAC PRG:1BAC A0 19
|
|
lda (Zp14),y ; CPU:$DBAE PRG:1BAE B1 14
|
|
bne DecEnemyScriptCounter_Loop7 ; CPU:$DBB0 PRG:1BB0 D0 4C
|
|
lda ZpB1 ; CPU:$DBB2 PRG:1BB2 A5 B1
|
|
and #$03 ; CPU:$DBB4 PRG:1BB4 29 03
|
|
cmp Zp1E ; CPU:$DBB6 PRG:1BB6 C5 1E
|
|
beq DecEnemyScriptCounter_Loop5 ; CPU:$DBB8 PRG:1BB8 F0 0C
|
|
lda ZpB1 ; CPU:$DBBA PRG:1BBA A5 B1
|
|
and #$FC ; CPU:$DBBC PRG:1BBC 29 FC
|
|
ora Zp1E ; CPU:$DBBE PRG:1BBE 05 1E
|
|
sta ZpB1 ; CPU:$DBC0 PRG:1BC0 85 B1
|
|
lda #$01 ; CPU:$DBC2 PRG:1BC2 A9 01
|
|
sta ZpC8 ; CPU:$DBC4 PRG:1BC4 85 C8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyScriptCounter_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyScriptCounter_Loop5:
|
|
ldy #$10 ; CPU:$DBC6 PRG:1BC6 A0 10
|
|
lda (Zp14),y ; CPU:$DBC8 PRG:1BC8 B1 14
|
|
ldy #$12 ; CPU:$DBCA PRG:1BCA A0 12
|
|
ora (Zp14),y ; CPU:$DBCC PRG:1BCC 11 14
|
|
ldy #$18 ; CPU:$DBCE PRG:1BCE A0 18
|
|
ora (Zp14),y ; CPU:$DBD0 PRG:1BD0 11 14
|
|
bne DecEnemyScriptCounter_Loop7 ; CPU:$DBD2 PRG:1BD2 D0 2A
|
|
ldy #$0F ; CPU:$DBD4 PRG:1BD4 A0 0F
|
|
lda (Zp14),y ; CPU:$DBD6 PRG:1BD6 B1 14
|
|
cmp #$80 ; CPU:$DBD8 PRG:1BD8 C9 80
|
|
bne DecEnemyScriptCounter_Loop6 ; CPU:$DBDA PRG:1BDA D0 06
|
|
ldy #$11 ; CPU:$DBDC PRG:1BDC A0 11
|
|
lda (Zp14),y ; CPU:$DBDE PRG:1BDE B1 14
|
|
bne DecEnemyScriptCounter_Loop7 ; CPU:$DBE0 PRG:1BE0 D0 1C
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyScriptCounter_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyScriptCounter_Loop6:
|
|
lda ZpC9 ; CPU:$DBE2 PRG:1BE2 A5 C9
|
|
bne DecEnemyScriptCounter_Loop7 ; CPU:$DBE4 PRG:1BE4 D0 18
|
|
ldy #$01 ; CPU:$DBE6 PRG:1BE6 A0 01
|
|
lda (Zp14),y ; CPU:$DBE8 PRG:1BE8 B1 14
|
|
and #$03 ; CPU:$DBEA PRG:1BEA 29 03
|
|
cmp Zp1F ; CPU:$DBEC PRG:1BEC C5 1F
|
|
beq DecEnemyScriptCounter_Loop7 ; CPU:$DBEE PRG:1BEE F0 0E
|
|
lda (Zp14),y ; CPU:$DBF0 PRG:1BF0 B1 14
|
|
and #$FC ; CPU:$DBF2 PRG:1BF2 29 FC
|
|
ora Zp1F ; CPU:$DBF4 PRG:1BF4 05 1F
|
|
sta (Zp14),y ; CPU:$DBF6 PRG:1BF6 91 14
|
|
ldy #$18 ; CPU:$DBF8 PRG:1BF8 A0 18
|
|
lda #$01 ; CPU:$DBFA PRG:1BFA A9 01
|
|
sta (Zp14),y ; CPU:$DBFC PRG:1BFC 91 14
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyScriptCounter_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyScriptCounter_Loop7:
|
|
rts ; CPU:$DBFE PRG:1BFE 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDBFF
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnBlocked:
|
|
lda ZpB3 ; CPU:$DBFF PRG:1BFF A5 B3
|
|
bne DecEnemyScriptCounter_Loop7 ; CPU:$DC01 PRG:1C01 D0 FB
|
|
ldx ZpC8 ; CPU:$DC03 PRG:1C03 A6 C8
|
|
beq DecEnemyScriptCounter_Loop7 ; CPU:$DC05 PRG:1C05 F0 F7
|
|
lda ZpB1 ; CPU:$DC07 PRG:1C07 A5 B1
|
|
and #$C0 ; CPU:$DC09 PRG:1C09 29 C0
|
|
bne DecEnemyScriptCounter_Loop7 ; CPU:$DC0B PRG:1C0B D0 F1
|
|
lda ActorCommand ; CPU:$DC0D PRG:1C0D A5 BF
|
|
cmp #$30 ; CPU:$DC0F PRG:1C0F C9 30
|
|
beq FlipEnemySprite_Loop4 ; CPU:$DC11 PRG:1C11 F0 42
|
|
ldy #$09 ; CPU:$DC13 PRG:1C13 A0 09
|
|
cmp #$20 ; CPU:$DC15 PRG:1C15 C9 20
|
|
beq CheckEnemySpawnBlocked_Loop ; CPU:$DC17 PRG:1C17 F0 06
|
|
ldy #$00 ; CPU:$DC19 PRG:1C19 A0 00
|
|
cmp #$10 ; CPU:$DC1B PRG:1C1B C9 10
|
|
bne FlipEnemySprite_OnZero ; CPU:$DC1D PRG:1C1D D0 31
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemySpawnBlocked_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySpawnBlocked_Loop:
|
|
dex ; CPU:$DC1F PRG:1C1F CA
|
|
txa ; CPU:$DC20 PRG:1C20 8A
|
|
sty Zp1E ; CPU:$DC21 PRG:1C21 84 1E
|
|
clc ; CPU:$DC23 PRG:1C23 18
|
|
adc Zp1E ; CPU:$DC24 PRG:1C24 65 1E
|
|
tay ; CPU:$DC26 PRG:1C26 A8
|
|
lda $F626,y ; CPU:$DC27 PRG:1C27 B9 26 F6
|
|
cmp #$01 ; CPU:$DC2A PRG:1C2A C9 01
|
|
beq FlipEnemySprite_Loop ; CPU:$DC2C PRG:1C2C F0 0D
|
|
cmp #$FF ; CPU:$DC2E PRG:1C2E C9 FF
|
|
beq FlipEnemySprite_Loop2 ; CPU:$DC30 PRG:1C30 F0 12
|
|
sta ZpB6 ; CPU:$DC32 PRG:1C32 85 B6
|
|
lda #$05 ; CPU:$DC34 PRG:1C34 A9 05
|
|
sta ZpB5 ; CPU:$DC36 PRG:1C36 85 B5
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDC38
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FlipEnemySprite:
|
|
inc ZpC8 ; CPU:$DC38 PRG:1C38 E6 C8
|
|
rts ; CPU:$DC3A PRG:1C3A 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: FlipEnemySprite_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FlipEnemySprite_Loop:
|
|
lda ZpB7 ; CPU:$DC3B PRG:1C3B A5 B7
|
|
eor #$40 ; CPU:$DC3D PRG:1C3D 49 40
|
|
sta ZpB7 ; CPU:$DC3F PRG:1C3F 85 B7
|
|
jmp FlipEnemySprite ; CPU:$DC41 PRG:1C41 4C 38 DC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: FlipEnemySprite_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FlipEnemySprite_Loop2:
|
|
lda ActorCommand ; CPU:$DC44 PRG:1C44 A5 BF
|
|
ldy #$03 ; CPU:$DC46 PRG:1C46 A0 03
|
|
cmp #$20 ; CPU:$DC48 PRG:1C48 C9 20
|
|
beq FlipEnemySprite_Loop3 ; CPU:$DC4A PRG:1C4A F0 02
|
|
ldy #$06 ; CPU:$DC4C PRG:1C4C A0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: FlipEnemySprite_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FlipEnemySprite_Loop3:
|
|
sty ZpB5 ; CPU:$DC4E PRG:1C4E 84 B5
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: FlipEnemySprite_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FlipEnemySprite_OnZero:
|
|
lda #$00 ; CPU:$DC50 PRG:1C50 A9 00
|
|
sta ZpC8 ; CPU:$DC52 PRG:1C52 85 C8
|
|
rts ; CPU:$DC54 PRG:1C54 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: FlipEnemySprite_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FlipEnemySprite_Loop4:
|
|
cpx #$01 ; CPU:$DC55 PRG:1C55 E0 01
|
|
bne FlipEnemySprite_Loop5 ; CPU:$DC57 PRG:1C57 D0 15
|
|
lda #$7B ; CPU:$DC59 PRG:1C59 A9 7B
|
|
sta ZpBC ; CPU:$DC5B PRG:1C5B 85 BC
|
|
lda #$F3 ; CPU:$DC5D PRG:1C5D A9 F3
|
|
sta ZpBD ; CPU:$DC5F PRG:1C5F 85 BD
|
|
lda ZpB1 ; CPU:$DC61 PRG:1C61 A5 B1
|
|
and #$3F ; CPU:$DC63 PRG:1C63 29 3F
|
|
ora #$40 ; CPU:$DC65 PRG:1C65 09 40
|
|
sta ZpB1 ; CPU:$DC67 PRG:1C67 85 B1
|
|
lda #$02 ; CPU:$DC69 PRG:1C69 A9 02
|
|
sta ZpC8 ; CPU:$DC6B PRG:1C6B 85 C8
|
|
rts ; CPU:$DC6D PRG:1C6D 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: FlipEnemySprite_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FlipEnemySprite_Loop5:
|
|
lda ZpB1 ; CPU:$DC6E PRG:1C6E A5 B1
|
|
and #$C0 ; CPU:$DC70 PRG:1C70 29 C0
|
|
beq FlipEnemySprite_OnZero ; CPU:$DC72 PRG:1C72 F0 DC
|
|
rts ; CPU:$DC74 PRG:1C74 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDC75
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyVramPointer:
|
|
lda #$40 ; CPU:$DC75 PRG:1C75 A9 40
|
|
sta Zp14 ; CPU:$DC77 PRG:1C77 85 14
|
|
lda #$03 ; CPU:$DC79 PRG:1C79 A9 03
|
|
sta Zp15 ; CPU:$DC7B PRG:1C7B 85 15
|
|
ldy #$08 ; CPU:$DC7D PRG:1C7D A0 08
|
|
lda $04B0 ; CPU:$DC7F PRG:1C7F AD B0 04
|
|
beq SetEnemyVramPointer_Loop ; CPU:$DC82 PRG:1C82 F0 02
|
|
ldy #$0A ; CPU:$DC84 PRG:1C84 A0 0A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyVramPointer_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyVramPointer_Loop:
|
|
sty Zp11 ; CPU:$DC86 PRG:1C86 84 11
|
|
jsr SetVramPointer ; CPU:$DC88 PRG:1C88 20 46 C4
|
|
sta Zp1E ; CPU:$DC8B PRG:1C8B 85 1E
|
|
ora #$00 ; CPU:$DC8D PRG:1C8D 09 00
|
|
bne SetEnemyVramPointer_Loop2 ; CPU:$DC8F PRG:1C8F D0 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyVramPointer_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyVramPointer_OnNonzero:
|
|
rts ; CPU:$DC91 PRG:1C91 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyVramPointer_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyVramPointer_Loop2:
|
|
lda ZpC6 ; CPU:$DC92 PRG:1C92 A5 C6
|
|
bne SetEnemyVramPointer_OnNonzero ; CPU:$DC94 PRG:1C94 D0 FB
|
|
ldy #$12 ; CPU:$DC96 PRG:1C96 A0 12
|
|
lda (Zp14),y ; CPU:$DC98 PRG:1C98 B1 14
|
|
bne SetEnemyVramPointer_OnNonzero ; CPU:$DC9A PRG:1C9A D0 F5
|
|
ldy #$19 ; CPU:$DC9C PRG:1C9C A0 19
|
|
lda (Zp14),y ; CPU:$DC9E PRG:1C9E B1 14
|
|
bne SetEnemyVramPointer_OnNonzero ; CPU:$DCA0 PRG:1CA0 D0 EF
|
|
ldy #$0F ; CPU:$DCA2 PRG:1CA2 A0 0F
|
|
lda (Zp14),y ; CPU:$DCA4 PRG:1CA4 B1 14
|
|
cmp #$F0 ; CPU:$DCA6 PRG:1CA6 C9 F0
|
|
beq SetEnemyVramPointer_Loop3 ; CPU:$DCA8 PRG:1CA8 F0 0F
|
|
cmp #$A0 ; CPU:$DCAA PRG:1CAA C9 A0
|
|
beq SetEnemyVramPointer_Loop4 ; CPU:$DCAC PRG:1CAC F0 0E
|
|
cmp #$B0 ; CPU:$DCAE PRG:1CAE C9 B0
|
|
beq SetEnemyVramPointer_Loop5 ; CPU:$DCB0 PRG:1CB0 F0 0D
|
|
cmp #$40 ; CPU:$DCB2 PRG:1CB2 C9 40
|
|
bne SetEnemyVramPointer_Loop6 ; CPU:$DCB4 PRG:1CB4 D0 0C
|
|
jmp CheckEnemySlotUsed ; CPU:$DCB6 PRG:1CB6 4C C7 DD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyVramPointer_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyVramPointer_Loop3:
|
|
jmp SetEnemyScriptFlag ; CPU:$DCB9 PRG:1CB9 4C 9A E2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyVramPointer_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyVramPointer_Loop4:
|
|
jmp CheckEnemyScriptFlagB ; CPU:$DCBC PRG:1CBC 4C B8 E9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyVramPointer_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyVramPointer_Loop5:
|
|
jmp CheckEnemyScriptFlagB ; CPU:$DCBF PRG:1CBF 4C B8 E9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyVramPointer_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyVramPointer_Loop6:
|
|
ldy #$10 ; CPU:$DCC2 PRG:1CC2 A0 10
|
|
lda (Zp14),y ; CPU:$DCC4 PRG:1CC4 B1 14
|
|
and #$0F ; CPU:$DCC6 PRG:1CC6 29 0F
|
|
beq ResetEnemyListB ; CPU:$DCC8 PRG:1CC8 F0 04
|
|
cmp #$04 ; CPU:$DCCA PRG:1CCA C9 04
|
|
bcc InitEnemySpawn_Loop2 ; CPU:$DCCC PRG:1CCC 90 5E
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDCCE
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetEnemyListB:
|
|
lda #$00 ; CPU:$DCCE PRG:1CCE A9 00
|
|
sta $05FF ; CPU:$DCD0 PRG:1CD0 8D FF 05
|
|
ldy ActorCommand ; CPU:$DCD3 PRG:1CD3 A4 BF
|
|
ldx #$00 ; CPU:$DCD5 PRG:1CD5 A2 00
|
|
dey ; CPU:$DCD7 PRG:1CD7 88
|
|
beq ResetEnemyListB_Loop ; CPU:$DCD8 PRG:1CD8 F0 02
|
|
ldx #$04 ; CPU:$DCDA PRG:1CDA A2 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResetEnemyListB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetEnemyListB_Loop:
|
|
lda Zp48,x ; CPU:$DCDC PRG:1CDC B5 48
|
|
beq ResetEnemyListB_Loop2 ; CPU:$DCDE PRG:1CDE F0 05
|
|
dec Zp48,x ; CPU:$DCE0 PRG:1CE0 D6 48
|
|
jmp InitEnemySpawn ; CPU:$DCE2 PRG:1CE2 4C EA DC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResetEnemyListB_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetEnemyListB_Loop2:
|
|
inx ; CPU:$DCE5 PRG:1CE5 E8
|
|
lda #$01 ; CPU:$DCE6 PRG:1CE6 A9 01
|
|
sta Zp48,x ; CPU:$DCE8 PRG:1CE8 95 48
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDCEA
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpawn:
|
|
lda #$10 ; CPU:$DCEA PRG:1CEA A9 10
|
|
sta ZpC6 ; CPU:$DCEC PRG:1CEC 85 C6
|
|
lda #$40 ; CPU:$DCEE PRG:1CEE A9 40
|
|
sta ZpB3 ; CPU:$DCF0 PRG:1CF0 85 B3
|
|
lda #$32 ; CPU:$DCF2 PRG:1CF2 A9 32
|
|
sta ZpB6 ; CPU:$DCF4 PRG:1CF4 85 B6
|
|
lda #$00 ; CPU:$DCF6 PRG:1CF6 A9 00
|
|
sta ZpB5 ; CPU:$DCF8 PRG:1CF8 85 B5
|
|
lda #$A9 ; CPU:$DCFA PRG:1CFA A9 A9
|
|
ldy #$F6 ; CPU:$DCFC PRG:1CFC A0 F6
|
|
sta ZpBC ; CPU:$DCFE PRG:1CFE 85 BC
|
|
sty ZpBD ; CPU:$DD00 PRG:1D00 84 BD
|
|
lda ZpFF ; CPU:$DD02 PRG:1D02 A5 FF
|
|
ora #$01 ; CPU:$DD04 PRG:1D04 09 01
|
|
sta ZpFF ; CPU:$DD06 PRG:1D06 85 FF
|
|
lda Zp1E ; CPU:$DD08 PRG:1D08 A5 1E
|
|
ldy #$00 ; CPU:$DD0A PRG:1D0A A0 00
|
|
lsr a ; CPU:$DD0C PRG:1D0C 4A
|
|
bcs InitEnemySpawn_Loop ; CPU:$DD0D PRG:1D0D B0 02
|
|
ldy #$40 ; CPU:$DD0F PRG:1D0F A0 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpawn_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpawn_Loop:
|
|
sty Zp1E ; CPU:$DD11 PRG:1D11 84 1E
|
|
ldy #$07 ; CPU:$DD13 PRG:1D13 A0 07
|
|
lda (Zp14),y ; CPU:$DD15 PRG:1D15 B1 14
|
|
and #$BF ; CPU:$DD17 PRG:1D17 29 BF
|
|
ora Zp1E ; CPU:$DD19 PRG:1D19 05 1E
|
|
sta (Zp14),y ; CPU:$DD1B PRG:1D1B 91 14
|
|
ldy #$01 ; CPU:$DD1D PRG:1D1D A0 01
|
|
lda (Zp14),y ; CPU:$DD1F PRG:1D1F B1 14
|
|
eor #$03 ; CPU:$DD21 PRG:1D21 49 03
|
|
sta (Zp14),y ; CPU:$DD23 PRG:1D23 91 14
|
|
ldy #$03 ; CPU:$DD25 PRG:1D25 A0 03
|
|
lda #$20 ; CPU:$DD27 PRG:1D27 A9 20
|
|
sta (Zp14),y ; CPU:$DD29 PRG:1D29 91 14
|
|
rts ; CPU:$DD2B PRG:1D2B 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpawn_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpawn_Loop2:
|
|
lda ActorXPosition ; CPU:$DD2C PRG:1D2C A5 46
|
|
beq InitEnemySpawn_Loop3 ; CPU:$DD2E PRG:1D2E F0 0C
|
|
lda #$00 ; CPU:$DD30 PRG:1D30 A9 00
|
|
sta ZpFE ; CPU:$DD32 PRG:1D32 85 FE
|
|
sta ZpFD ; CPU:$DD34 PRG:1D34 85 FD
|
|
sta ZpFC ; CPU:$DD36 PRG:1D36 85 FC
|
|
lda #$04 ; CPU:$DD38 PRG:1D38 A9 04
|
|
bne InitEnemySpawn_Loop4 ; CPU:$DD3A PRG:1D3A D0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpawn_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpawn_Loop3:
|
|
lda ZpFF ; CPU:$DD3C PRG:1D3C A5 FF
|
|
ora #$08 ; CPU:$DD3E PRG:1D3E 09 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpawn_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpawn_Loop4:
|
|
sta ZpFF ; CPU:$DD40 PRG:1D40 85 FF
|
|
lda #$10 ; CPU:$DD42 PRG:1D42 A9 10
|
|
ldy #$19 ; CPU:$DD44 PRG:1D44 A0 19
|
|
sta (Zp14),y ; CPU:$DD46 PRG:1D46 91 14
|
|
lda #$E9 ; CPU:$DD48 PRG:1D48 A9 E9
|
|
ldy #$0C ; CPU:$DD4A PRG:1D4A A0 0C
|
|
sta (Zp14),y ; CPU:$DD4C PRG:1D4C 91 14
|
|
lda #$F7 ; CPU:$DD4E PRG:1D4E A9 F7
|
|
iny ; CPU:$DD50 PRG:1D50 C8
|
|
sta (Zp14),y ; CPU:$DD51 PRG:1D51 91 14
|
|
lda ZpB1 ; CPU:$DD53 PRG:1D53 A5 B1
|
|
and #$03 ; CPU:$DD55 PRG:1D55 29 03
|
|
bne InitEnemySpawn_Loop5 ; CPU:$DD57 PRG:1D57 D0 05
|
|
lda $05F7 ; CPU:$DD59 PRG:1D59 AD F7 05
|
|
and #$0F ; CPU:$DD5C PRG:1D5C 29 0F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpawn_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpawn_Loop5:
|
|
lsr a ; CPU:$DD5E PRG:1D5E 4A
|
|
bcs InitEnemySpawn_Loop6 ; CPU:$DD5F PRG:1D5F B0 04
|
|
lda #$FF ; CPU:$DD61 PRG:1D61 A9 FF
|
|
bne InitEnemySpawn_Loop7 ; CPU:$DD63 PRG:1D63 D0 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpawn_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpawn_Loop6:
|
|
lda #$00 ; CPU:$DD65 PRG:1D65 A9 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpawn_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpawn_Loop7:
|
|
ldy #$15 ; CPU:$DD67 PRG:1D67 A0 15
|
|
sta (Zp14),y ; CPU:$DD69 PRG:1D69 91 14
|
|
ldy #$02 ; CPU:$DD6B PRG:1D6B A0 02
|
|
lda #$01 ; CPU:$DD6D PRG:1D6D A9 01
|
|
sta (Zp14),y ; CPU:$DD6F PRG:1D6F 91 14
|
|
iny ; CPU:$DD71 PRG:1D71 C8
|
|
sta (Zp14),y ; CPU:$DD72 PRG:1D72 91 14
|
|
ldx #$02 ; CPU:$DD74 PRG:1D74 A2 02
|
|
ldy ActorCommand ; CPU:$DD76 PRG:1D76 A4 BF
|
|
dey ; CPU:$DD78 PRG:1D78 88
|
|
sty Zp11 ; CPU:$DD79 PRG:1D79 84 11
|
|
bne InitEnemySpawn_Loop8 ; CPU:$DD7B PRG:1D7B D0 02
|
|
ldx #$00 ; CPU:$DD7D PRG:1D7D A2 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpawn_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpawn_Loop8:
|
|
lda $04D0,x ; CPU:$DD7F PRG:1D7F BD D0 04
|
|
bne InitEnemySpawn_Loop9 ; CPU:$DD82 PRG:1D82 D0 05
|
|
lda #$00 ; CPU:$DD84 PRG:1D84 A9 00
|
|
sta $04D1,x ; CPU:$DD86 PRG:1D86 9D D1 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpawn_Loop9
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpawn_Loop9:
|
|
lda #$34 ; CPU:$DD89 PRG:1D89 A9 34
|
|
sta $04D0,x ; CPU:$DD8B PRG:1D8B 9D D0 04
|
|
lda $04D1,x ; CPU:$DD8E PRG:1D8E BD D1 04
|
|
sta Zp1F ; CPU:$DD91 PRG:1D91 85 1F
|
|
cmp #$03 ; CPU:$DD93 PRG:1D93 C9 03
|
|
beq InitEnemySpawn_Loop10 ; CPU:$DD95 PRG:1D95 F0 03
|
|
inc $04D1,x ; CPU:$DD97 PRG:1D97 FE D1 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpawn_Loop10
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpawn_Loop10:
|
|
ldy #$08 ; CPU:$DD9A PRG:1D9A A0 08
|
|
lda (Zp14),y ; CPU:$DD9C PRG:1D9C B1 14
|
|
tax ; CPU:$DD9E PRG:1D9E AA
|
|
iny ; CPU:$DD9F PRG:1D9F C8
|
|
lda (Zp14),y ; CPU:$DDA0 PRG:1DA0 B1 14
|
|
tay ; CPU:$DDA2 PRG:1DA2 A8
|
|
lda Zp1F ; CPU:$DDA3 PRG:1DA3 A5 1F
|
|
jsr SetEnemySpeed ; CPU:$DDA5 PRG:1DA5 20 E3 EE
|
|
ldx Zp1F ; CPU:$DDA8 PRG:1DA8 A6 1F
|
|
lda $DDB0,x ; CPU:$DDAA PRG:1DAA BD B0 DD
|
|
jmp SetEnemyActiveFlag ; CPU:$DDAD PRG:1DAD 4C B6 DD
|
|
; ---- data $DDB0-$DDB5 (6 bytes) ----
|
|
; referenced by `lda $DDB0,x` at $DDAA (operand $DDB0 falls inside this region)
|
|
WriteEnemyActiveFlag:
|
|
.byte $08, $16, $24, $32, $A9, $08 ; CPU:$DDB0 PRG:1DB0 08 16 24 32 A9 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDDB6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyActiveFlag:
|
|
sta Zp00 ; CPU:$DDB6 PRG:1DB6 85 00
|
|
ldx ActorCommand ; CPU:$DDB8 PRG:1DB8 A6 BF
|
|
dex ; CPU:$DDBA PRG:1DBA CA
|
|
lda #$01 ; CPU:$DDBB PRG:1DBB A9 01
|
|
sta Zp9D,x ; CPU:$DDBD PRG:1DBD 95 9D
|
|
txa ; CPU:$DDBF PRG:1DBF 8A
|
|
ora #$08 ; CPU:$DDC0 PRG:1DC0 09 08
|
|
sta Zp01 ; CPU:$DDC2 PRG:1DC2 85 01
|
|
jmp InitZerosIfZp30Zero ; CPU:$DDC4 PRG:1DC4 4C 83 DE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDDC7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySlotUsed:
|
|
ldy #$10 ; CPU:$DDC7 PRG:1DC7 A0 10
|
|
lda (Zp14),y ; CPU:$DDC9 PRG:1DC9 B1 14
|
|
bne CheckEnemyState_Loop2 ; CPU:$DDCB PRG:1DCB D0 37
|
|
tya ; CPU:$DDCD PRG:1DCD 98
|
|
ldy #$19 ; CPU:$DDCE PRG:1DCE A0 19
|
|
sta (Zp14),y ; CPU:$DDD0 PRG:1DD0 91 14
|
|
ldx ActorCommand ; CPU:$DDD2 PRG:1DD2 A6 BF
|
|
dex ; CPU:$DDD4 PRG:1DD4 CA
|
|
txa ; CPU:$DDD5 PRG:1DD5 8A
|
|
ldy #$1C ; CPU:$DDD6 PRG:1DD6 A0 1C
|
|
sta (Zp14),y ; CPU:$DDD8 PRG:1DD8 91 14
|
|
lda ZpFE ; CPU:$DDDA PRG:1DDA A5 FE
|
|
ora #$02 ; CPU:$DDDC PRG:1DDC 09 02
|
|
bne StartActorAction_Loop ; CPU:$DDDE PRG:1DDE D0 4C
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDDE0
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyState:
|
|
lda ZpB3 ; CPU:$DDE0 PRG:1DE0 A5 B3
|
|
cmp #$04 ; CPU:$DDE2 PRG:1DE2 C9 04
|
|
bcs CheckEnemyState_Loop2 ; CPU:$DDE4 PRG:1DE4 B0 1E
|
|
lda ZpC6 ; CPU:$DDE6 PRG:1DE6 A5 C6
|
|
and #$F0 ; CPU:$DDE8 PRG:1DE8 29 F0
|
|
cmp #$20 ; CPU:$DDEA PRG:1DEA C9 20
|
|
beq LoadEnemyTileIndexB ; CPU:$DDEC PRG:1DEC F0 41
|
|
lda #$38 ; CPU:$DDEE PRG:1DEE A9 38
|
|
sta ZpB6 ; CPU:$DDF0 PRG:1DF0 85 B6
|
|
jsr PushTablePointerDispatch ; CPU:$DDF2 PRG:1DF2 20 A0 CC
|
|
cmp #$AA ; CPU:$DDF5 PRG:1DF5 C9 AA
|
|
bne CheckEnemyState_Loop ; CPU:$DDF7 PRG:1DF7 D0 02
|
|
lda #$03 ; CPU:$DDF9 PRG:1DF9 A9 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyState_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyState_Loop:
|
|
clc ; CPU:$DDFB PRG:1DFB 18
|
|
adc ActorTileIndex ; CPU:$DDFC PRG:1DFC 65 B8
|
|
cmp #$E8 ; CPU:$DDFE PRG:1DFE C9 E8
|
|
bcs CheckEnemyState_Loop3 ; CPU:$DE00 PRG:1E00 B0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyState_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyState_OnNonzero:
|
|
sta ActorTileIndex ; CPU:$DE02 PRG:1E02 85 B8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyState_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyState_Loop2:
|
|
rts ; CPU:$DE04 PRG:1E04 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyState_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyState_Loop3:
|
|
lda #$20 ; CPU:$DE05 PRG:1E05 A9 20
|
|
sta ZpC6 ; CPU:$DE07 PRG:1E07 85 C6
|
|
lda ZpBA ; CPU:$DE09 PRG:1E09 A5 BA
|
|
jsr HideOamPair ; CPU:$DE0B PRG:1E0B 20 F5 C3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDE0E
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StartActorAction:
|
|
lda #$01 ; CPU:$DE0E PRG:1E0E A9 01
|
|
sta ZpB5 ; CPU:$DE10 PRG:1E10 85 B5
|
|
sta ZpB3 ; CPU:$DE12 PRG:1E12 85 B3
|
|
lda #$38 ; CPU:$DE14 PRG:1E14 A9 38
|
|
sta ActorPalette ; CPU:$DE16 PRG:1E16 85 B4
|
|
lda #$05 ; CPU:$DE18 PRG:1E18 A9 05
|
|
sta ZpB2 ; CPU:$DE1A PRG:1E1A 85 B2
|
|
lda #$E0 ; CPU:$DE1C PRG:1E1C A9 E0
|
|
sta ActorTileIndex ; CPU:$DE1E PRG:1E1E 85 B8
|
|
lda #$03 ; CPU:$DE20 PRG:1E20 A9 03
|
|
sta ZpB7 ; CPU:$DE22 PRG:1E22 85 B7
|
|
lda ActorXPosition ; CPU:$DE24 PRG:1E24 A5 46
|
|
bne StartActorAction_Loop2 ; CPU:$DE26 PRG:1E26 D0 06
|
|
lda ZpFE ; CPU:$DE28 PRG:1E28 A5 FE
|
|
ora #$80 ; CPU:$DE2A PRG:1E2A 09 80
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StartActorAction_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StartActorAction_Loop:
|
|
sta ZpFE ; CPU:$DE2C PRG:1E2C 85 FE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StartActorAction_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StartActorAction_Loop2:
|
|
rts ; CPU:$DE2E PRG:1E2E 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDE2F
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
LoadEnemyTileIndexB:
|
|
jsr CheckZpB3Return ; CPU:$DE2F PRG:1E2F 20 EB CA
|
|
lda ZpB6 ; CPU:$DE32 PRG:1E32 A5 B6
|
|
cmp #$BC ; CPU:$DE34 PRG:1E34 C9 BC
|
|
beq LoadEnemyTileIndexB_Loop ; CPU:$DE36 PRG:1E36 F0 03
|
|
jmp LoadYFromZpB4 ; CPU:$DE38 PRG:1E38 4C A3 CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: LoadEnemyTileIndexB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
LoadEnemyTileIndexB_Loop:
|
|
ldy #$04 ; CPU:$DE3B PRG:1E3B A0 04
|
|
jsr InitSpritesOffscreen ; CPU:$DE3D PRG:1E3D 20 C4 DF
|
|
lda ActorCommand ; CPU:$DE40 PRG:1E40 A5 BF
|
|
and #$0F ; CPU:$DE42 PRG:1E42 29 0F
|
|
beq LoadEnemyTileIndexB_Loop2 ; CPU:$DE44 PRG:1E44 F0 08
|
|
lda #$01 ; CPU:$DE46 PRG:1E46 A9 01
|
|
sta ZpC6 ; CPU:$DE48 PRG:1E48 85 C6
|
|
lda #$F4 ; CPU:$DE4A PRG:1E4A A9 F4
|
|
bne CheckEnemyState_OnNonzero ; CPU:$DE4C PRG:1E4C D0 B4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: LoadEnemyTileIndexB_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
LoadEnemyTileIndexB_Loop2:
|
|
lda Zp51 ; CPU:$DE4E PRG:1E4E A5 51
|
|
beq LoadEnemyTileIndexB_Loop3 ; CPU:$DE50 PRG:1E50 F0 05
|
|
lda #$00 ; CPU:$DE52 PRG:1E52 A9 00
|
|
sta ZpB0 ; CPU:$DE54 PRG:1E54 85 B0
|
|
rts ; CPU:$DE56 PRG:1E56 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: LoadEnemyTileIndexB_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
LoadEnemyTileIndexB_Loop3:
|
|
ldx ZpBA ; CPU:$DE57 PRG:1E57 A6 BA
|
|
lda ScrollX ; CPU:$DE59 PRG:1E59 A5 B9
|
|
pha ; CPU:$DE5B PRG:1E5B 48
|
|
ldy #$00 ; CPU:$DE5C PRG:1E5C A0 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: LoadEnemyTileIndexB_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
LoadEnemyTileIndexB_OnNonzero:
|
|
lda $F6C8,y ; CPU:$DE5E PRG:1E5E B9 C8 F6
|
|
sta a:ZpB0,y ; CPU:$DE61 PRG:1E61 99 B0 00
|
|
iny ; CPU:$DE64 PRG:1E64 C8
|
|
cpy #$20 ; CPU:$DE65 PRG:1E65 C0 20
|
|
bne LoadEnemyTileIndexB_OnNonzero ; CPU:$DE67 PRG:1E67 D0 F5
|
|
stx ZpBA ; CPU:$DE69 PRG:1E69 86 BA
|
|
pla ; CPU:$DE6B PRG:1E6B 68
|
|
ldy #$01 ; CPU:$DE6C PRG:1E6C A0 01
|
|
ldx #$F0 ; CPU:$DE6E PRG:1E6E A2 F0
|
|
cmp #$80 ; CPU:$DE70 PRG:1E70 C9 80
|
|
bcs LoadEnemyTileIndexB_Loop4 ; CPU:$DE72 PRG:1E72 B0 04
|
|
ldy #$02 ; CPU:$DE74 PRG:1E74 A0 02
|
|
ldx #$10 ; CPU:$DE76 PRG:1E76 A2 10
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: LoadEnemyTileIndexB_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
LoadEnemyTileIndexB_Loop4:
|
|
sty ZpC2 ; CPU:$DE78 PRG:1E78 84 C2
|
|
sty ZpB1 ; CPU:$DE7A PRG:1E7A 84 B1
|
|
stx ScrollX ; CPU:$DE7C PRG:1E7C 86 B9
|
|
ldy #$04 ; CPU:$DE7E PRG:1E7E A0 04
|
|
jmp InitSpritesOffscreen ; CPU:$DE80 PRG:1E80 4C C4 DF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitZerosIfZp30Zero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitZerosIfZp30Zero:
|
|
lda GameRunningFlag ; CPU:$DE83 PRG:1E83 A5 30
|
|
bne InitEnemySpriteTable_Loop ; CPU:$DE85 PRG:1E85 D0 27
|
|
ldx #$00 ; CPU:$DE87 PRG:1E87 A2 00
|
|
stx Zp04 ; CPU:$DE89 PRG:1E89 86 04
|
|
ldx #$00 ; CPU:$DE8B PRG:1E8B A2 00
|
|
stx Zp05 ; CPU:$DE8D PRG:1E8D 86 05
|
|
stx Zp06 ; CPU:$DE8F PRG:1E8F 86 06
|
|
stx Zp07 ; CPU:$DE91 PRG:1E91 86 07
|
|
lda Zp01 ; CPU:$DE93 PRG:1E93 A5 01
|
|
and #$08 ; CPU:$DE95 PRG:1E95 29 08
|
|
bne InitZerosIfZp30Zero_Loop ; CPU:$DE97 PRG:1E97 D0 01
|
|
inx ; CPU:$DE99 PRG:1E99 E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitZerosIfZp30Zero_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitZerosIfZp30Zero_Loop:
|
|
lda Zp00 ; CPU:$DE9A PRG:1E9A A5 00
|
|
sta Zp06,x ; CPU:$DE9C PRG:1E9C 95 06
|
|
lda Zp01 ; CPU:$DE9E PRG:1E9E A5 01
|
|
jmp ComputeSpriteOffsetB ; CPU:$DEA0 PRG:1EA0 4C B4 D0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDEA3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpriteTable:
|
|
ldx #$1F ; CPU:$DEA3 PRG:1EA3 A2 1F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpriteTable_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpriteTable_OnNonnegative:
|
|
lda $F2EC,y ; CPU:$DEA5 PRG:1EA5 B9 EC F2
|
|
sta ZpB0,x ; CPU:$DEA8 PRG:1EA8 95 B0
|
|
dey ; CPU:$DEAA PRG:1EAA 88
|
|
dex ; CPU:$DEAB PRG:1EAB CA
|
|
bpl InitEnemySpriteTable_OnNonnegative ; CPU:$DEAC PRG:1EAC 10 F7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemySpriteTable_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemySpriteTable_Loop:
|
|
rts ; CPU:$DEAE PRG:1EAE 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDEAF
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCollisionB:
|
|
lda ZpC9 ; CPU:$DEAF PRG:1EAF A5 C9
|
|
and #$F0 ; CPU:$DEB1 PRG:1EB1 29 F0
|
|
cmp #$20 ; CPU:$DEB3 PRG:1EB3 C9 20
|
|
bne CheckEnemyCollisionB_Loop ; CPU:$DEB5 PRG:1EB5 D0 03
|
|
jmp LoadEnemyTileIndexB ; CPU:$DEB7 PRG:1EB7 4C 2F DE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyCollisionB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCollisionB_Loop:
|
|
jsr PushTablePointerDispatch ; CPU:$DEBA PRG:1EBA 20 A0 CC
|
|
cmp #$AA ; CPU:$DEBD PRG:1EBD C9 AA
|
|
bne CheckEnemyCollisionB_Loop2 ; CPU:$DEBF PRG:1EBF D0 02
|
|
lda #$04 ; CPU:$DEC1 PRG:1EC1 A9 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyCollisionB_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCollisionB_Loop2:
|
|
clc ; CPU:$DEC3 PRG:1EC3 18
|
|
adc ActorTileIndex ; CPU:$DEC4 PRG:1EC4 65 B8
|
|
cmp #$E8 ; CPU:$DEC6 PRG:1EC6 C9 E8
|
|
bcs CheckEnemyCollisionB_Loop5 ; CPU:$DEC8 PRG:1EC8 B0 16
|
|
sta ActorTileIndex ; CPU:$DECA PRG:1ECA 85 B8
|
|
jsr PushTablePointerDispatch ; CPU:$DECC PRG:1ECC 20 A0 CC
|
|
cmp #$AA ; CPU:$DECF PRG:1ECF C9 AA
|
|
beq CheckEnemyCollisionB_Loop4 ; CPU:$DED1 PRG:1ED1 F0 0C
|
|
eor ZpC5 ; CPU:$DED3 PRG:1ED3 45 C5
|
|
bpl CheckEnemyCollisionB_Loop3 ; CPU:$DED5 PRG:1ED5 10 03
|
|
clc ; CPU:$DED7 PRG:1ED7 18
|
|
adc #$01 ; CPU:$DED8 PRG:1ED8 69 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyCollisionB_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCollisionB_Loop3:
|
|
clc ; CPU:$DEDA PRG:1EDA 18
|
|
adc ScrollX ; CPU:$DEDB PRG:1EDB 65 B9
|
|
sta ScrollX ; CPU:$DEDD PRG:1EDD 85 B9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyCollisionB_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCollisionB_Loop4:
|
|
rts ; CPU:$DEDF PRG:1EDF 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyCollisionB_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyCollisionB_Loop5:
|
|
lda #$20 ; CPU:$DEE0 PRG:1EE0 A9 20
|
|
sta ZpC9 ; CPU:$DEE2 PRG:1EE2 85 C9
|
|
ldy #$04 ; CPU:$DEE4 PRG:1EE4 A0 04
|
|
jsr InitSpritesOffscreen ; CPU:$DEE6 PRG:1EE6 20 C4 DF
|
|
jmp StartActorAction ; CPU:$DEE9 PRG:1EE9 4C 0E DE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDEEC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll:
|
|
lda ZpC6 ; CPU:$DEEC PRG:1EEC A5 C6
|
|
ldy ActorCommand ; CPU:$DEEE PRG:1EEE A4 BF
|
|
cmp #$01 ; CPU:$DEF0 PRG:1EF0 C9 01
|
|
bne CheckEnemyScroll_Loop3 ; CPU:$DEF2 PRG:1EF2 D0 43
|
|
dey ; CPU:$DEF4 PRG:1EF4 88
|
|
bne CheckEnemyScroll_Loop2 ; CPU:$DEF5 PRG:1EF5 D0 2D
|
|
jsr InitEnemySprites ; CPU:$DEF7 PRG:1EF7 20 E6 D5
|
|
lda Zp49 ; CPU:$DEFA PRG:1EFA A5 49
|
|
beq CheckEnemyScroll_Loop ; CPU:$DEFC PRG:1EFC F0 09
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_OnNonzero:
|
|
lda #$00 ; CPU:$DEFE PRG:1EFE A9 00
|
|
sta ZpB0 ; CPU:$DF00 PRG:1F00 85 B0
|
|
ldy #$06 ; CPU:$DF02 PRG:1F02 A0 06
|
|
jmp InitSpritesOffscreen ; CPU:$DF04 PRG:1F04 4C C4 DF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_Loop:
|
|
ldy #$1F ; CPU:$DF07 PRG:1F07 A0 1F
|
|
jsr InitEnemySpriteTable ; CPU:$DF09 PRG:1F09 20 A3 DE
|
|
jsr InitEnemyPalette ; CPU:$DF0C PRG:1F0C 20 9D DF
|
|
lda #$74 ; CPU:$DF0F PRG:1F0F A9 74
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_OnNonzero2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_OnNonzero2:
|
|
sta ScrollX ; CPU:$DF11 PRG:1F11 85 B9
|
|
lda #$09 ; CPU:$DF13 PRG:1F13 A9 09
|
|
sta ActorTileIndex ; CPU:$DF15 PRG:1F15 85 B8
|
|
lda #$02 ; CPU:$DF17 PRG:1F17 A9 02
|
|
sta ZpC6 ; CPU:$DF19 PRG:1F19 85 C6
|
|
lda ZpFD ; CPU:$DF1B PRG:1F1B A5 FD
|
|
ora #$10 ; CPU:$DF1D PRG:1F1D 09 10
|
|
sta ZpFD ; CPU:$DF1F PRG:1F1F 85 FD
|
|
jmp ResetActorState ; CPU:$DF21 PRG:1F21 4C BA CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_Loop2:
|
|
jsr InitEnemySpritesB ; CPU:$DF24 PRG:1F24 20 EC D5
|
|
lda Zp4D ; CPU:$DF27 PRG:1F27 A5 4D
|
|
bne CheckEnemyScroll_OnNonzero ; CPU:$DF29 PRG:1F29 D0 D3
|
|
ldy #$3F ; CPU:$DF2B PRG:1F2B A0 3F
|
|
jsr InitEnemySpriteTable ; CPU:$DF2D PRG:1F2D 20 A3 DE
|
|
jsr InitEnemyPaletteB ; CPU:$DF30 PRG:1F30 20 AC DF
|
|
lda #$8C ; CPU:$DF33 PRG:1F33 A9 8C
|
|
bne CheckEnemyScroll_OnNonzero2 ; CPU:$DF35 PRG:1F35 D0 DA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_Loop3:
|
|
cmp #$02 ; CPU:$DF37 PRG:1F37 C9 02
|
|
bne CheckEnemyScroll_Loop6 ; CPU:$DF39 PRG:1F39 D0 25
|
|
jsr CheckZpB3Return ; CPU:$DF3B PRG:1F3B 20 EB CA
|
|
inc ActorTileIndex ; CPU:$DF3E PRG:1F3E E6 B8
|
|
jsr ClearEnemySprites ; CPU:$DF40 PRG:1F40 20 B0 DF
|
|
inc $02C0,x ; CPU:$DF43 PRG:1F43 FE C0 02
|
|
inc $02C4,x ; CPU:$DF46 PRG:1F46 FE C4 02
|
|
lda ActorTileIndex ; CPU:$DF49 PRG:1F49 A5 B8
|
|
cmp #$28 ; CPU:$DF4B PRG:1F4B C9 28
|
|
beq CheckEnemyScroll_Loop4 ; CPU:$DF4D PRG:1F4D F0 01
|
|
rts ; CPU:$DF4F PRG:1F4F 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_Loop4:
|
|
lda #$04 ; CPU:$DF50 PRG:1F50 A9 04
|
|
ldy ActorCommand ; CPU:$DF52 PRG:1F52 A4 BF
|
|
dey ; CPU:$DF54 PRG:1F54 88
|
|
beq CheckEnemyScroll_Loop5 ; CPU:$DF55 PRG:1F55 F0 02
|
|
lda #$08 ; CPU:$DF57 PRG:1F57 A9 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_Loop5:
|
|
sta ZpC6 ; CPU:$DF59 PRG:1F59 85 C6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_OnNonzero3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_OnNonzero3:
|
|
lda #$FF ; CPU:$DF5B PRG:1F5B A9 FF
|
|
sta ZpB3 ; CPU:$DF5D PRG:1F5D 85 B3
|
|
rts ; CPU:$DF5F PRG:1F5F 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_Loop6:
|
|
lda ZpB1 ; CPU:$DF60 PRG:1F60 A5 B1
|
|
beq CheckEnemyScroll_Loop9 ; CPU:$DF62 PRG:1F62 F0 23
|
|
bmi CheckEnemyScroll_Loop7 ; CPU:$DF64 PRG:1F64 30 06
|
|
and #$08 ; CPU:$DF66 PRG:1F66 29 08
|
|
bne CheckEnemyScroll_Loop9 ; CPU:$DF68 PRG:1F68 D0 1D
|
|
beq CheckEnemyScroll_Loop8 ; CPU:$DF6A PRG:1F6A F0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_Loop7:
|
|
lda #$18 ; CPU:$DF6C PRG:1F6C A9 18
|
|
sta ZpB6 ; CPU:$DF6E PRG:1F6E 85 B6
|
|
bne CheckEnemyScroll_OnZero ; CPU:$DF70 PRG:1F70 D0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_Loop8:
|
|
jsr LoadYFromZpB4 ; CPU:$DF72 PRG:1F72 20 A3 CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_OnZero:
|
|
lda #$00 ; CPU:$DF75 PRG:1F75 A9 00
|
|
sta ZpC6 ; CPU:$DF77 PRG:1F77 85 C6
|
|
sta ZpB3 ; CPU:$DF79 PRG:1F79 85 B3
|
|
jsr ClearEnemySprites ; CPU:$DF7B PRG:1F7B 20 B0 DF
|
|
lda #$F4 ; CPU:$DF7E PRG:1F7E A9 F4
|
|
sta $02C0,x ; CPU:$DF80 PRG:1F80 9D C0 02
|
|
sta $02C4,x ; CPU:$DF83 PRG:1F83 9D C4 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_OnNonzero4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_OnNonzero4:
|
|
rts ; CPU:$DF86 PRG:1F86 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScroll_Loop9
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScroll_Loop9:
|
|
lda ZpB3 ; CPU:$DF87 PRG:1F87 A5 B3
|
|
bne CheckEnemyScroll_OnNonzero4 ; CPU:$DF89 PRG:1F89 D0 FB
|
|
jsr ClearEnemySprites ; CPU:$DF8B PRG:1F8B 20 B0 DF
|
|
lda $02C1,x ; CPU:$DF8E PRG:1F8E BD C1 02
|
|
cmp #$CF ; CPU:$DF91 PRG:1F91 C9 CF
|
|
beq CheckEnemyScroll_OnZero ; CPU:$DF93 PRG:1F93 F0 E0
|
|
inc $02C1,x ; CPU:$DF95 PRG:1F95 FE C1 02
|
|
inc $02C5,x ; CPU:$DF98 PRG:1F98 FE C5 02
|
|
bne CheckEnemyScroll_OnNonzero3 ; CPU:$DF9B PRG:1F9B D0 BE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDF9D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyPalette:
|
|
ldy #$07 ; CPU:$DF9D PRG:1F9D A0 07
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyPalette_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyPalette_OnNonzero:
|
|
ldx #$07 ; CPU:$DF9F PRG:1F9F A2 07
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyPalette_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyPalette_OnNonnegative:
|
|
lda $F699,y ; CPU:$DFA1 PRG:1FA1 B9 99 F6
|
|
sta $02C0,y ; CPU:$DFA4 PRG:1FA4 99 C0 02
|
|
dey ; CPU:$DFA7 PRG:1FA7 88
|
|
dex ; CPU:$DFA8 PRG:1FA8 CA
|
|
bpl InitEnemyPalette_OnNonnegative ; CPU:$DFA9 PRG:1FA9 10 F6
|
|
rts ; CPU:$DFAB PRG:1FAB 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDFAC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyPaletteB:
|
|
ldy #$0F ; CPU:$DFAC PRG:1FAC A0 0F
|
|
bne InitEnemyPalette_OnNonzero ; CPU:$DFAE PRG:1FAE D0 EF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDFB0
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearEnemySprites:
|
|
ldx #$08 ; CPU:$DFB0 PRG:1FB0 A2 08
|
|
ldy ActorCommand ; CPU:$DFB2 PRG:1FB2 A4 BF
|
|
dey ; CPU:$DFB4 PRG:1FB4 88
|
|
bne ClearEnemySprites_Loop ; CPU:$DFB5 PRG:1FB5 D0 02
|
|
ldx #$00 ; CPU:$DFB7 PRG:1FB7 A2 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearEnemySprites_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearEnemySprites_Loop:
|
|
rts ; CPU:$DFB9 PRG:1FB9 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDFBA
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyFrameCounter:
|
|
jsr AdvanceSpriteCounter ; CPU:$DFBA PRG:1FBA 20 BD DF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDFBD
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceSpriteCounter:
|
|
inc $05FA ; CPU:$DFBD PRG:1FBD EE FA 05
|
|
inc $05FA ; CPU:$DFC0 PRG:1FC0 EE FA 05
|
|
rts ; CPU:$DFC3 PRG:1FC3 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitSpritesOffscreen
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitSpritesOffscreen:
|
|
lda #$F4 ; CPU:$DFC4 PRG:1FC4 A9 F4
|
|
ldx ZpBA ; CPU:$DFC6 PRG:1FC6 A6 BA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitSpritesOffscreen_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitSpritesOffscreen_OnNonzero:
|
|
sta $0200,x ; CPU:$DFC8 PRG:1FC8 9D 00 02
|
|
inx ; CPU:$DFCB PRG:1FCB E8
|
|
inx ; CPU:$DFCC PRG:1FCC E8
|
|
inx ; CPU:$DFCD PRG:1FCD E8
|
|
inx ; CPU:$DFCE PRG:1FCE E8
|
|
dey ; CPU:$DFCF PRG:1FCF 88
|
|
bne InitSpritesOffscreen_OnNonzero ; CPU:$DFD0 PRG:1FD0 D0 F6
|
|
rts ; CPU:$DFD2 PRG:1FD2 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDFD3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckSpriteFlip:
|
|
lda ActorCommand ; CPU:$DFD3 PRG:1FD3 A5 BF
|
|
cmp #$40 ; CPU:$DFD5 PRG:1FD5 C9 40
|
|
bne CheckSpriteFlip_OnNonzero ; CPU:$DFD7 PRG:1FD7 D0 1E
|
|
ldy #$00 ; CPU:$DFD9 PRG:1FD9 A0 00
|
|
lda ZpC1 ; CPU:$DFDB PRG:1FDB A5 C1
|
|
bne CheckSpriteFlip_Loop2 ; CPU:$DFDD PRG:1FDD D0 16
|
|
pla ; CPU:$DFDF PRG:1FDF 68
|
|
pla ; CPU:$DFE0 PRG:1FE0 68
|
|
lda $04C0 ; CPU:$DFE1 PRG:1FE1 AD C0 04
|
|
beq CheckSpriteFlip_Loop ; CPU:$DFE4 PRG:1FE4 F0 08
|
|
lda $04C1 ; CPU:$DFE6 PRG:1FE6 AD C1 04
|
|
bne CheckSpriteFlip_Loop ; CPU:$DFE9 PRG:1FE9 D0 03
|
|
jmp StartEnemyStage ; CPU:$DFEB PRG:1FEB 4C AF EC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckSpriteFlip_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckSpriteFlip_Loop:
|
|
sty ZpB0 ; CPU:$DFEE PRG:1FEE 84 B0
|
|
ldy #$02 ; CPU:$DFF0 PRG:1FF0 A0 02
|
|
jmp InitSpritesOffscreen ; CPU:$DFF2 PRG:1FF2 4C C4 DF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckSpriteFlip_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckSpriteFlip_Loop2:
|
|
sty ZpC1 ; CPU:$DFF5 PRG:1FF5 84 C1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckSpriteFlip_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckSpriteFlip_OnNonzero:
|
|
rts ; CPU:$DFF7 PRG:1FF7 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCDFF8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyVisible:
|
|
lda Zp21 ; CPU:$DFF8 PRG:1FF8 A5 21
|
|
bne CheckSpriteFlip_OnNonzero ; CPU:$DFFA PRG:1FFA D0 FB
|
|
lda $04C5 ; CPU:$DFFC PRG:1FFC AD C5 04
|
|
bne CheckSpriteFlip_OnNonzero ; CPU:$DFFF PRG:1FFF D0 F6
|
|
ldx #$A8 ; CPU:$E001 PRG:2001 A2 A8
|
|
ldy #$E0 ; CPU:$E003 PRG:2003 A0 E0
|
|
lda $04F0 ; CPU:$E005 PRG:2005 AD F0 04
|
|
beq CheckEnemyVisible_Loop ; CPU:$E008 PRG:2008 F0 05
|
|
dec $04F0 ; CPU:$E00A PRG:200A CE F0 04
|
|
beq CheckEnemyVisible_Loop4 ; CPU:$E00D PRG:200D F0 3A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyVisible_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyVisible_Loop:
|
|
lda $04F1 ; CPU:$E00F PRG:200F AD F1 04
|
|
beq CheckEnemyVisible_Loop2 ; CPU:$E012 PRG:2012 F0 0F
|
|
dec $04F1 ; CPU:$E014 PRG:2014 CE F1 04
|
|
bne CheckEnemyVisible_Loop2 ; CPU:$E017 PRG:2017 D0 0A
|
|
lda #$49 ; CPU:$E019 PRG:2019 A9 49
|
|
sta Zp00 ; CPU:$E01B PRG:201B 85 00
|
|
lda #$22 ; CPU:$E01D PRG:201D A9 22
|
|
sta Zp01 ; CPU:$E01F PRG:201F 85 01
|
|
bne CheckEnemyVisible_Loop5 ; CPU:$E021 PRG:2021 D0 2E
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyVisible_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyVisible_Loop2:
|
|
ldx #$88 ; CPU:$E023 PRG:2023 A2 88
|
|
ldy #$E0 ; CPU:$E025 PRG:2025 A0 E0
|
|
lda Zp49 ; CPU:$E027 PRG:2027 A5 49
|
|
beq CheckEnemyVisible_Loop6 ; CPU:$E029 PRG:2029 F0 2D
|
|
lda $0300 ; CPU:$E02B PRG:202B AD 00 03
|
|
bne CheckEnemyVisible_Loop6 ; CPU:$E02E PRG:202E D0 28
|
|
lda Zp39 ; CPU:$E030 PRG:2030 A5 39
|
|
beq CheckEnemyVisible_Loop3 ; CPU:$E032 PRG:2032 F0 08
|
|
lda Zp4E ; CPU:$E034 PRG:2034 A5 4E
|
|
bne CheckEnemyVisible_Loop3 ; CPU:$E036 PRG:2036 D0 04
|
|
ldx #$78 ; CPU:$E038 PRG:2038 A2 78
|
|
ldy #$E0 ; CPU:$E03A PRG:203A A0 E0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyVisible_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyVisible_Loop3:
|
|
lda #$00 ; CPU:$E03C PRG:203C A9 00
|
|
sta Zp49 ; CPU:$E03E PRG:203E 85 49
|
|
lda #$FF ; CPU:$E040 PRG:2040 A9 FF
|
|
sta ActorYTarget ; CPU:$E042 PRG:2042 85 4A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyVisible_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyVisible_OnNonzero:
|
|
lda #$FF ; CPU:$E044 PRG:2044 A9 FF
|
|
sta $04F0 ; CPU:$E046 PRG:2046 8D F0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyVisible_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyVisible_Loop4:
|
|
lda #$89 ; CPU:$E049 PRG:2049 A9 89
|
|
sta Zp00 ; CPU:$E04B PRG:204B 85 00
|
|
lda #$21 ; CPU:$E04D PRG:204D A9 21
|
|
sta Zp01 ; CPU:$E04F PRG:204F 85 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyVisible_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyVisible_Loop5:
|
|
stx Zp02 ; CPU:$E051 PRG:2051 86 02
|
|
sty Zp03 ; CPU:$E053 PRG:2053 84 03
|
|
jmp ReturnOne ; CPU:$E055 PRG:2055 4C 2C CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyVisible_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyVisible_Loop6:
|
|
lda Zp4D ; CPU:$E058 PRG:2058 A5 4D
|
|
beq CheckEnemyVisible_Loop8 ; CPU:$E05A PRG:205A F0 1B
|
|
lda $0320 ; CPU:$E05C PRG:205C AD 20 03
|
|
bne CheckEnemyVisible_Loop8 ; CPU:$E05F PRG:205F D0 16
|
|
lda Zp39 ; CPU:$E061 PRG:2061 A5 39
|
|
beq CheckEnemyVisible_Loop7 ; CPU:$E063 PRG:2063 F0 08
|
|
lda ActorYTarget ; CPU:$E065 PRG:2065 A5 4A
|
|
bne CheckEnemyVisible_Loop7 ; CPU:$E067 PRG:2067 D0 04
|
|
ldx #$98 ; CPU:$E069 PRG:2069 A2 98
|
|
ldy #$E0 ; CPU:$E06B PRG:206B A0 E0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyVisible_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyVisible_Loop7:
|
|
lda #$00 ; CPU:$E06D PRG:206D A9 00
|
|
sta Zp4D ; CPU:$E06F PRG:206F 85 4D
|
|
lda #$FF ; CPU:$E071 PRG:2071 A9 FF
|
|
sta Zp4E ; CPU:$E073 PRG:2073 85 4E
|
|
bne CheckEnemyVisible_OnNonzero ; CPU:$E075 PRG:2075 D0 CD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyVisible_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyVisible_Loop8:
|
|
rts ; CPU:$E077 PRG:2077 60
|
|
; ---- data $E078-$E0B7 (64 bytes) ----
|
|
EnemyTileIndexTable:
|
|
.byte $1F, $16, $0A, $1B, $12, $18, $24, $10, $0A, $16, $0E, $24, $18, $1F, $0E, $1B ; CPU:$E078 PRG:2078 1F 16 0A 1B 12 18 24 10 0A 16 0E 24 18 1F 0E 1B
|
|
.byte $1F, $24, $24, $24, $10, $0A, $16, $0E, $24, $18, $1F, $0E, $1B, $24, $24, $24 ; CPU:$E088 PRG:2088 1F 24 24 24 10 0A 16 0E 24 18 1F 0E 1B 24 24 24
|
|
.byte $1F, $15, $1E, $12, $10, $12, $24, $10, $0A, $16, $0E, $24, $18, $1F, $0E, $1B ; CPU:$E098 PRG:2098 1F 15 1E 12 10 12 24 10 0A 16 0E 24 18 1F 0E 1B
|
|
.byte $1F, $24, $24, $24, $24, $24, $24, $24, $24, $24, $24, $24, $24, $24, $24, $24 ; CPU:$E0A8 PRG:20A8 1F 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
|
|
WriteVramAt0300:
|
|
lda #$03 ; CPU:$E0B8 PRG:20B8 A9 03
|
|
sta Zp01 ; CPU:$E0BA PRG:20BA 85 01
|
|
lda #$00 ; CPU:$E0BC PRG:20BC A9 00
|
|
sta Zp00 ; CPU:$E0BE PRG:20BE 85 00
|
|
tay ; CPU:$E0C0 PRG:20C0 A8
|
|
jsr SetVramAddressF400_OnNonzero ; CPU:$E0C1 PRG:20C1 20 35 CA
|
|
lda #$04 ; CPU:$E0C4 PRG:20C4 A9 04
|
|
sta Zp01 ; CPU:$E0C6 PRG:20C6 85 01
|
|
lda #$00 ; CPU:$E0C8 PRG:20C8 A9 00
|
|
sta Zp00 ; CPU:$E0CA PRG:20CA 85 00
|
|
tay ; CPU:$E0CC PRG:20CC A8
|
|
jmp SetVramAddressF400_OnNonzero ; CPU:$E0CD PRG:20CD 4C 35 CA
|
|
; ---- data $E0D0-$E128 (89 bytes) ----
|
|
EnemyScriptTable:
|
|
.byte $00, $00, $00, $00, $01, $00, $00, $00, $AA, $03, $20, $02, $01, $00, $00, $03 ; CPU:$E0D0 PRG:20D0 00 00 00 00 01 00 00 00 AA 03 20 02 01 00 00 03
|
|
.byte $01, $01, $00, $04, $02, $01, $01, $05, $02, $01, $01, $AA, $04, $20, $06, $03 ; CPU:$E0E0 PRG:20E0 01 01 00 04 02 01 01 05 02 01 01 AA 04 20 06 03
|
|
.byte $02, $01, $07, $03, $02, $01, $08, $03, $02, $02, $09, $03, $02, $02, $AA, $04 ; CPU:$E0F0 PRG:20F0 02 01 07 03 02 01 08 03 02 02 09 03 02 02 AA 04
|
|
.byte $15, $0A, $03, $03, $02, $07, $03, $03, $02, $09, $03, $03, $03, $09, $03, $03 ; CPU:$E100 PRG:2100 15 0A 03 03 02 07 03 03 02 09 03 03 03 09 03 03
|
|
.byte $04, $AA, $04, $15, $0A, $03, $03, $04, $07, $03, $03, $04, $09, $03, $03, $04 ; CPU:$E110 PRG:2110 04 AA 04 15 0A 03 03 04 07 03 03 04 09 03 03 04
|
|
.byte $09, $03, $03, $04, $FF, $0B, $00, $00, $00 ; CPU:$E120 PRG:2120 09 03 03 04 FF 0B 00 00 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetActorStateReturn
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetActorStateReturn:
|
|
lda ActorIndex ; CPU:$E129 PRG:2129 A5 2D
|
|
bne SetActorStateReturn_Loop ; CPU:$E12B PRG:212B D0 04
|
|
lda Zp3B ; CPU:$E12D PRG:212D A5 3B
|
|
sta Zp40 ; CPU:$E12F PRG:212F 85 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetActorStateReturn_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetActorStateReturn_Loop:
|
|
rts ; CPU:$E131 PRG:2131 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE132
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DisableBackgroundAndSprites:
|
|
jsr ResetOamShadow ; CPU:$E132 PRG:2132 20 DC D5
|
|
lda Zp0A ; CPU:$E135 PRG:2135 A5 0A
|
|
and #$E7 ; CPU:$E137 PRG:2137 29 E7
|
|
sta PPUMASK ; CPU:$E139 PRG:2139 8D 01 20
|
|
rts ; CPU:$E13C PRG:213C 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE13D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
EnableBackgroundAndSprites:
|
|
jsr ResetOamShadow ; CPU:$E13D PRG:213D 20 DC D5
|
|
lda Zp0A ; CPU:$E140 PRG:2140 A5 0A
|
|
ora #$18 ; CPU:$E142 PRG:2142 09 18
|
|
sta PPUMASK ; CPU:$E144 PRG:2144 8D 01 20
|
|
sta Zp0A ; CPU:$E147 PRG:2147 85 0A
|
|
rts ; CPU:$E149 PRG:2149 60
|
|
jsr WriteVramAt0300 ; CPU:$E14A PRG:214A 20 B8 E0
|
|
ldx Zp31 ; CPU:$E14D PRG:214D A6 31
|
|
lda $E0D0,x ; CPU:$E14F PRG:214F BD D0 E0
|
|
cmp #$AA ; CPU:$E152 PRG:2152 C9 AA
|
|
bne EnableBackgroundAndSprites_Loop2 ; CPU:$E154 PRG:2154 D0 32
|
|
inx ; CPU:$E156 PRG:2156 E8
|
|
lda $E0D0,x ; CPU:$E157 PRG:2157 BD D0 E0
|
|
sta Zp32 ; CPU:$E15A PRG:215A 85 32
|
|
inx ; CPU:$E15C PRG:215C E8
|
|
lda $E0D0,x ; CPU:$E15D PRG:215D BD D0 E0
|
|
sta $04B1 ; CPU:$E160 PRG:2160 8D B1 04
|
|
inx ; CPU:$E163 PRG:2163 E8
|
|
stx Zp31 ; CPU:$E164 PRG:2164 86 31
|
|
lda Zp41 ; CPU:$E166 PRG:2166 A5 41
|
|
cmp #$07 ; CPU:$E168 PRG:2168 C9 07
|
|
bcc EnableBackgroundAndSprites_Loop ; CPU:$E16A PRG:216A 90 04
|
|
; ---- data $E16C-$E16F (4 bytes) ----
|
|
SetActorCounter3:
|
|
.byte $A9, $03, $85, $70 ; CPU:$E16C PRG:216C A9 03 85 70
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: EnableBackgroundAndSprites_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
EnableBackgroundAndSprites_Loop:
|
|
lda #$BB ; CPU:$E170 PRG:2170 A9 BB
|
|
sta ScriptCommand ; CPU:$E172 PRG:2172 85 35
|
|
jsr ClearSpriteBlock ; CPU:$E174 PRG:2174 20 7F D6
|
|
lda #$00 ; CPU:$E177 PRG:2177 A9 00
|
|
sta $030A ; CPU:$E179 PRG:2179 8D 0A 03
|
|
lda #$18 ; CPU:$E17C PRG:217C A9 18
|
|
sta $032A ; CPU:$E17E PRG:217E 8D 2A 03
|
|
lda #$01 ; CPU:$E181 PRG:2181 A9 01
|
|
sta $04B0 ; CPU:$E183 PRG:2183 8D B0 04
|
|
bne EnableBackgroundAndSprites_Loop5 ; CPU:$E186 PRG:2186 D0 3C
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: EnableBackgroundAndSprites_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
EnableBackgroundAndSprites_Loop2:
|
|
cmp #$FF ; CPU:$E188 PRG:2188 C9 FF
|
|
bne EnableBackgroundAndSprites_Loop3 ; CPU:$E18A PRG:218A D0 04
|
|
; ---- data $E18C-$E18F (4 bytes) ----
|
|
CheckActorIndex41:
|
|
.byte $A2, $41, $D0, $BF ; CPU:$E18C PRG:218C A2 41 D0 BF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: EnableBackgroundAndSprites_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
EnableBackgroundAndSprites_Loop3:
|
|
lda $E0D0,x ; CPU:$E190 PRG:2190 BD D0 E0
|
|
sta ScriptParam ; CPU:$E193 PRG:2193 85 34
|
|
inx ; CPU:$E195 PRG:2195 E8
|
|
lda $E0D0,x ; CPU:$E196 PRG:2196 BD D0 E0
|
|
sta Zp32 ; CPU:$E199 PRG:2199 85 32
|
|
inx ; CPU:$E19B PRG:219B E8
|
|
ldy #$01 ; CPU:$E19C PRG:219C A0 01
|
|
lda Zp41 ; CPU:$E19E PRG:219E A5 41
|
|
cmp #$08 ; CPU:$E1A0 PRG:21A0 C9 08
|
|
bcc EnableBackgroundAndSprites_Loop4 ; CPU:$E1A2 PRG:21A2 90 03
|
|
; ---- data $E1A4-$E1A6 (3 bytes) ----
|
|
WriteRam04C0:
|
|
.byte $8C, $C0, $04 ; CPU:$E1A4 PRG:21A4 8C C0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: EnableBackgroundAndSprites_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
EnableBackgroundAndSprites_Loop4:
|
|
lda $E0D0,x ; CPU:$E1A7 PRG:21A7 BD D0 E0
|
|
sta $04F3 ; CPU:$E1AA PRG:21AA 8D F3 04
|
|
inx ; CPU:$E1AD PRG:21AD E8
|
|
lda $E0D0,x ; CPU:$E1AE PRG:21AE BD D0 E0
|
|
sta $04FC ; CPU:$E1B1 PRG:21B1 8D FC 04
|
|
inx ; CPU:$E1B4 PRG:21B4 E8
|
|
stx Zp31 ; CPU:$E1B5 PRG:21B5 86 31
|
|
lda #$00 ; CPU:$E1B7 PRG:21B7 A9 00
|
|
sta ScriptCommand ; CPU:$E1B9 PRG:21B9 85 35
|
|
jsr LookupNoteTable2 ; CPU:$E1BB PRG:21BB 20 7A E9
|
|
jsr ClearSpriteBlock ; CPU:$E1BE PRG:21BE 20 7F D6
|
|
jsr RunScriptBlockF3BA ; CPU:$E1C1 PRG:21C1 20 9A D6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: EnableBackgroundAndSprites_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
EnableBackgroundAndSprites_Loop5:
|
|
jsr AdvanceHudCounter ; CPU:$E1C4 PRG:21C4 20 72 D6
|
|
jsr UpdateOamSprites ; CPU:$E1C7 PRG:21C7 20 F9 D3
|
|
lda #$02 ; CPU:$E1CA PRG:21CA A9 02
|
|
bne SetActorStateAndReturn ; CPU:$E1CC PRG:21CC D0 26
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE1CE
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScriptFlag:
|
|
lda ScriptCommand ; CPU:$E1CE PRG:21CE A5 35
|
|
cmp #$AA ; CPU:$E1D0 PRG:21D0 C9 AA
|
|
bne SetActorStateAndReturn_Loop ; CPU:$E1D2 PRG:21D2 D0 22
|
|
lda ActorYPosition ; CPU:$E1D4 PRG:21D4 A5 45
|
|
bne SetActorStateAndReturn_Loop ; CPU:$E1D6 PRG:21D6 D0 1E
|
|
lda ActorIndex ; CPU:$E1D8 PRG:21D8 A5 2D
|
|
bne SetActorStateAndReturn_Loop ; CPU:$E1DA PRG:21DA D0 1A
|
|
ldy #$FF ; CPU:$E1DC PRG:21DC A0 FF
|
|
lda Zp49 ; CPU:$E1DE PRG:21DE A5 49
|
|
beq CheckEnemyScriptFlag_Loop ; CPU:$E1E0 PRG:21E0 F0 02
|
|
sty ActorYTarget ; CPU:$E1E2 PRG:21E2 84 4A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScriptFlag_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScriptFlag_Loop:
|
|
lda Zp4D ; CPU:$E1E4 PRG:21E4 A5 4D
|
|
beq CheckEnemyScriptFlag_Loop2 ; CPU:$E1E6 PRG:21E6 F0 02
|
|
sty Zp4E ; CPU:$E1E8 PRG:21E8 84 4E
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScriptFlag_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScriptFlag_Loop2:
|
|
lda #$10 ; CPU:$E1EA PRG:21EA A9 10
|
|
SetActorState9:
|
|
sta ActorIndex ; CPU:$E1EC PRG:21EC 85 2D
|
|
lda #$01 ; CPU:$E1EE PRG:21EE A9 01
|
|
sta Zp3B ; CPU:$E1F0 PRG:21F0 85 3B
|
|
lda #$09 ; CPU:$E1F2 PRG:21F2 A9 09
|
|
SetActorStateAndReturn:
|
|
sta Zp40 ; CPU:$E1F4 PRG:21F4 85 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetActorStateAndReturn_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetActorStateAndReturn_Loop:
|
|
rts ; CPU:$E1F6 PRG:21F6 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE1F7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageComplete:
|
|
lda Zp21 ; CPU:$E1F7 PRG:21F7 A5 21
|
|
bne CheckStageComplete_Loop2 ; CPU:$E1F9 PRG:21F9 D0 1E
|
|
lda $04C5 ; CPU:$E1FB PRG:21FB AD C5 04
|
|
bne CheckStageComplete_Loop2 ; CPU:$E1FE PRG:21FE D0 19
|
|
ldy #$00 ; CPU:$E200 PRG:2200 A0 00
|
|
lda Zp9D ; CPU:$E202 PRG:2202 A5 9D
|
|
beq CheckStageComplete_Loop ; CPU:$E204 PRG:2204 F0 09
|
|
sty Zp9D ; CPU:$E206 PRG:2206 84 9D
|
|
lda #$F0 ; CPU:$E208 PRG:2208 A9 F0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageComplete_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageComplete_OnNonzero:
|
|
sta Zp00 ; CPU:$E20A PRG:220A 85 00
|
|
jmp DrawScoreDigit ; CPU:$E20C PRG:220C 4C 2F D0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageComplete_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageComplete_Loop:
|
|
lda Zp9E ; CPU:$E20F PRG:220F A5 9E
|
|
beq CheckStageComplete_Loop2 ; CPU:$E211 PRG:2211 F0 06
|
|
sty Zp9E ; CPU:$E213 PRG:2213 84 9E
|
|
lda #$F1 ; CPU:$E215 PRG:2215 A9 F1
|
|
bne CheckStageComplete_OnNonzero ; CPU:$E217 PRG:2217 D0 F1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageComplete_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageComplete_Loop2:
|
|
rts ; CPU:$E219 PRG:2219 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE21A
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunScriptBlock:
|
|
lda #$F9 ; CPU:$E21A PRG:221A A9 F9
|
|
sta Zp00 ; CPU:$E21C PRG:221C 85 00
|
|
jsr SetVramColumn ; CPU:$E21E PRG:221E 20 8B D1
|
|
lda ZpAD ; CPU:$E221 PRG:2221 A5 AD
|
|
bne RunScriptBlock_Loop ; CPU:$E223 PRG:2223 D0 14
|
|
lda ActorYTarget ; CPU:$E225 PRG:2225 A5 4A
|
|
bne RunScriptBlock_Loop ; CPU:$E227 PRG:2227 D0 10
|
|
lda Zp95 ; CPU:$E229 PRG:2229 A5 95
|
|
cmp #$02 ; CPU:$E22B PRG:222B C9 02
|
|
bcc RunScriptBlock_Loop ; CPU:$E22D PRG:222D 90 0A
|
|
inc ZpAD ; CPU:$E22F PRG:222F E6 AD
|
|
inc Zp48 ; CPU:$E231 PRG:2231 E6 48
|
|
jsr InitEnemySprites ; CPU:$E233 PRG:2233 20 E6 D5
|
|
jmp AdvanceEnemyTimer ; CPU:$E236 PRG:2236 4C 4E E2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RunScriptBlock_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunScriptBlock_Loop:
|
|
lda ZpAE ; CPU:$E239 PRG:2239 A5 AE
|
|
bne AdvanceEnemyTimer_Loop ; CPU:$E23B PRG:223B D0 22
|
|
lda Zp4E ; CPU:$E23D PRG:223D A5 4E
|
|
bne AdvanceEnemyTimer_Loop ; CPU:$E23F PRG:223F D0 1E
|
|
lda Zp99 ; CPU:$E241 PRG:2241 A5 99
|
|
cmp #$02 ; CPU:$E243 PRG:2243 C9 02
|
|
bcc AdvanceEnemyTimer_Loop ; CPU:$E245 PRG:2245 90 18
|
|
inc ZpAE ; CPU:$E247 PRG:2247 E6 AE
|
|
inc Zp4C ; CPU:$E249 PRG:2249 E6 4C
|
|
jsr InitEnemySpritesB ; CPU:$E24B PRG:224B 20 EC D5
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE24E
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyTimer:
|
|
lda ActorIndex ; CPU:$E24E PRG:224E A5 2D
|
|
beq AdvanceEnemyTimer_OnZero ; CPU:$E250 PRG:2250 F0 06
|
|
lda #$01 ; CPU:$E252 PRG:2252 A9 01
|
|
sta Zp54 ; CPU:$E254 PRG:2254 85 54
|
|
bne AdvanceEnemyTimer_OnZero2 ; CPU:$E256 PRG:2256 D0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyTimer_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyTimer_OnZero:
|
|
lda ZpFD ; CPU:$E258 PRG:2258 A5 FD
|
|
ora #$08 ; CPU:$E25A PRG:225A 09 08
|
|
sta ZpFD ; CPU:$E25C PRG:225C 85 FD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyTimer_OnZero2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyTimer_OnZero2:
|
|
rts ; CPU:$E25E PRG:225E 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyTimer_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyTimer_Loop:
|
|
lda ActorIndex ; CPU:$E25F PRG:225F A5 2D
|
|
bne AdvanceEnemyTimer_OnZero2 ; CPU:$E261 PRG:2261 D0 FB
|
|
lda Zp54 ; CPU:$E263 PRG:2263 A5 54
|
|
beq AdvanceEnemyTimer_OnZero2 ; CPU:$E265 PRG:2265 F0 F7
|
|
lda #$00 ; CPU:$E267 PRG:2267 A9 00
|
|
sta Zp54 ; CPU:$E269 PRG:2269 85 54
|
|
beq AdvanceEnemyTimer_OnZero ; CPU:$E26B PRG:226B F0 EB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE26D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyTimerB:
|
|
lda ActorYTarget ; CPU:$E26D PRG:226D A5 4A
|
|
beq AdvanceEnemyTimer_OnZero2 ; CPU:$E26F PRG:226F F0 ED
|
|
lda Zp4E ; CPU:$E271 PRG:2271 A5 4E
|
|
beq AdvanceEnemyTimer_OnZero2 ; CPU:$E273 PRG:2273 F0 E9
|
|
lda #$00 ; CPU:$E275 PRG:2275 A9 00
|
|
sta Zp52 ; CPU:$E277 PRG:2277 85 52
|
|
jsr ClearActorCounters ; CPU:$E279 PRG:2279 20 FE D4
|
|
lda #$40 ; CPU:$E27C PRG:227C A9 40
|
|
sta ZpFD ; CPU:$E27E PRG:227E 85 FD
|
|
lda #$20 ; CPU:$E280 PRG:2280 A9 20
|
|
sta ActorIndex ; CPU:$E282 PRG:2282 85 2D
|
|
lda #$0B ; CPU:$E284 PRG:2284 A9 0B
|
|
sta Zp40 ; CPU:$E286 PRG:2286 85 40
|
|
jmp SetVramAddressF400 ; CPU:$E288 PRG:2288 4C 2B CA
|
|
lda ActorIndex ; CPU:$E28B PRG:228B A5 2D
|
|
bne AdvanceEnemyTimerB_Loop ; CPU:$E28D PRG:228D D0 0A
|
|
lda #$01 ; CPU:$E28F PRG:228F A9 01
|
|
sta GameRunningFlag ; CPU:$E291 PRG:2291 85 30
|
|
sta ActorActionFlag ; CPU:$E293 PRG:2293 85 28
|
|
lda #$00 ; CPU:$E295 PRG:2295 A9 00
|
|
sta Zp50 ; CPU:$E297 PRG:2297 85 50
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyTimerB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyTimerB_Loop:
|
|
rts ; CPU:$E299 PRG:2299 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE29A
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyScriptFlag:
|
|
ldy #$10 ; CPU:$E29A PRG:229A A0 10
|
|
lda (Zp14),y ; CPU:$E29C PRG:229C B1 14
|
|
bne SetEnemyScriptFlag_Loop ; CPU:$E29E PRG:229E D0 0A
|
|
lda ActorCommand ; CPU:$E2A0 PRG:22A0 A5 BF
|
|
sta (Zp14),y ; CPU:$E2A2 PRG:22A2 91 14
|
|
lda ZpFE ; CPU:$E2A4 PRG:22A4 A5 FE
|
|
ora #$02 ; CPU:$E2A6 PRG:22A6 09 02
|
|
sta ZpFE ; CPU:$E2A8 PRG:22A8 85 FE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyScriptFlag_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyScriptFlag_Loop:
|
|
rts ; CPU:$E2AA PRG:22AA 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE2AB
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageStarted:
|
|
lda $04B0 ; CPU:$E2AB PRG:22AB AD B0 04
|
|
bne CheckStageStarted_Loop ; CPU:$E2AE PRG:22AE D0 01
|
|
rts ; CPU:$E2B0 PRG:22B0 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageStarted_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageStarted_Loop:
|
|
cmp #$01 ; CPU:$E2B1 PRG:22B1 C9 01
|
|
bne WriteScriptByte_Loop ; CPU:$E2B3 PRG:22B3 D0 74
|
|
lda #$40 ; CPU:$E2B5 PRG:22B5 A9 40
|
|
sta Zp14 ; CPU:$E2B7 PRG:22B7 85 14
|
|
lda #$03 ; CPU:$E2B9 PRG:22B9 A9 03
|
|
sta Zp15 ; CPU:$E2BB PRG:22BB 85 15
|
|
lda #$20 ; CPU:$E2BD PRG:22BD A9 20
|
|
sta Zp12 ; CPU:$E2BF PRG:22BF 85 12
|
|
lda #$00 ; CPU:$E2C1 PRG:22C1 A9 00
|
|
sta Zp13 ; CPU:$E2C3 PRG:22C3 85 13
|
|
lda #$0A ; CPU:$E2C5 PRG:22C5 A9 0A
|
|
sta ScriptStepCounter ; CPU:$E2C7 PRG:22C7 85 33
|
|
ldx #$00 ; CPU:$E2C9 PRG:22C9 A2 00
|
|
lda #$30 ; CPU:$E2CB PRG:22CB A9 30
|
|
sta Zp11 ; CPU:$E2CD PRG:22CD 85 11
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageStarted_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageStarted_OnNonzero:
|
|
ldy #$00 ; CPU:$E2CF PRG:22CF A0 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageStarted_OnNonzero2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageStarted_OnNonzero2:
|
|
lda $E6C5,y ; CPU:$E2D1 PRG:22D1 B9 C5 E6
|
|
cpy #$0A ; CPU:$E2D4 PRG:22D4 C0 0A
|
|
bne CheckStageStarted_Loop2 ; CPU:$E2D6 PRG:22D6 D0 0C
|
|
lda Zp11 ; CPU:$E2D8 PRG:22D8 A5 11
|
|
pha ; CPU:$E2DA PRG:22DA 48
|
|
clc ; CPU:$E2DB PRG:22DB 18
|
|
adc #$10 ; CPU:$E2DC PRG:22DC 69 10
|
|
sta Zp11 ; CPU:$E2DE PRG:22DE 85 11
|
|
pla ; CPU:$E2E0 PRG:22E0 68
|
|
jmp WriteScriptByte ; CPU:$E2E1 PRG:22E1 4C FD E2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageStarted_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageStarted_Loop2:
|
|
cpy #$09 ; CPU:$E2E4 PRG:22E4 C0 09
|
|
bne CheckStageStarted_Loop3 ; CPU:$E2E6 PRG:22E6 D0 05
|
|
lda $E6E5,x ; CPU:$E2E8 PRG:22E8 BD E5 E6
|
|
bne WriteScriptByte ; CPU:$E2EB PRG:22EB D0 10
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageStarted_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageStarted_Loop3:
|
|
cpy #$08 ; CPU:$E2ED PRG:22ED C0 08
|
|
bne CheckStageStarted_Loop4 ; CPU:$E2EF PRG:22EF D0 05
|
|
lda $E6E6,x ; CPU:$E2F1 PRG:22F1 BD E6 E6
|
|
bne WriteScriptByte ; CPU:$E2F4 PRG:22F4 D0 07
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageStarted_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageStarted_Loop4:
|
|
cpy #$04 ; CPU:$E2F6 PRG:22F6 C0 04
|
|
bne WriteScriptByte ; CPU:$E2F8 PRG:22F8 D0 03
|
|
lda $E6E7,x ; CPU:$E2FA PRG:22FA BD E7 E6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE2FD
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteScriptByte:
|
|
sta (Zp14),y ; CPU:$E2FD PRG:22FD 91 14
|
|
iny ; CPU:$E2FF PRG:22FF C8
|
|
cpy #$20 ; CPU:$E300 PRG:2300 C0 20
|
|
bne CheckStageStarted_OnNonzero2 ; CPU:$E302 PRG:2302 D0 CD
|
|
inx ; CPU:$E304 PRG:2304 E8
|
|
inx ; CPU:$E305 PRG:2305 E8
|
|
inx ; CPU:$E306 PRG:2306 E8
|
|
jsr AdvanceDispatchPointer ; CPU:$E307 PRG:2307 20 B4 CD
|
|
dec ScriptStepCounter ; CPU:$E30A PRG:230A C6 33
|
|
bne CheckStageStarted_OnNonzero ; CPU:$E30C PRG:230C D0 C1
|
|
lda #$00 ; CPU:$E30E PRG:230E A9 00
|
|
sta $04B5 ; CPU:$E310 PRG:2310 8D B5 04
|
|
sta $04B6 ; CPU:$E313 PRG:2313 8D B6 04
|
|
lda #$40 ; CPU:$E316 PRG:2316 A9 40
|
|
sta $04B3 ; CPU:$E318 PRG:2318 8D B3 04
|
|
lda #$01 ; CPU:$E31B PRG:231B A9 01
|
|
sta $04B2 ; CPU:$E31D PRG:231D 8D B2 04
|
|
lda #$0A ; CPU:$E320 PRG:2320 A9 0A
|
|
sta $04BC ; CPU:$E322 PRG:2322 8D BC 04
|
|
inc $04B0 ; CPU:$E325 PRG:2325 EE B0 04
|
|
rts ; CPU:$E328 PRG:2328 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteScriptByte_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteScriptByte_Loop:
|
|
lda $04B2 ; CPU:$E329 PRG:2329 AD B2 04
|
|
bne InitStage_Loop4 ; CPU:$E32C PRG:232C D0 3E
|
|
lda $04B1 ; CPU:$E32E PRG:232E AD B1 04
|
|
bne InitStage_Loop ; CPU:$E331 PRG:2331 D0 1B
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE333
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitStage:
|
|
lda #$01 ; CPU:$E333 PRG:2333 A9 01
|
|
sta Zp51 ; CPU:$E335 PRG:2335 85 51
|
|
lda #$00 ; CPU:$E337 PRG:2337 A9 00
|
|
sta $04B0 ; CPU:$E339 PRG:2339 8D B0 04
|
|
sta ZpFC ; CPU:$E33C PRG:233C 85 FC
|
|
sta $04B4 ; CPU:$E33E PRG:233E 8D B4 04
|
|
lda #$10 ; CPU:$E341 PRG:2341 A9 10
|
|
sta ActorIndex ; CPU:$E343 PRG:2343 85 2D
|
|
lda #$06 ; CPU:$E345 PRG:2345 A9 06
|
|
sta Zp3B ; CPU:$E347 PRG:2347 85 3B
|
|
lda #$09 ; CPU:$E349 PRG:2349 A9 09
|
|
sta Zp40 ; CPU:$E34B PRG:234B 85 40
|
|
rts ; CPU:$E34D PRG:234D 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitStage_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitStage_Loop:
|
|
sta Zp03 ; CPU:$E34E PRG:234E 85 03
|
|
cmp #$18 ; CPU:$E350 PRG:2350 C9 18
|
|
beq InitStage_Loop2 ; CPU:$E352 PRG:2352 F0 04
|
|
cmp #$13 ; CPU:$E354 PRG:2354 C9 13
|
|
bne InitStage_Loop3 ; CPU:$E356 PRG:2356 D0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitStage_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitStage_Loop2:
|
|
lda #$04 ; CPU:$E358 PRG:2358 A9 04
|
|
sta ZpFC ; CPU:$E35A PRG:235A 85 FC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitStage_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitStage_Loop3:
|
|
lda #$01 ; CPU:$E35C PRG:235C A9 01
|
|
sec ; CPU:$E35E PRG:235E 38
|
|
jsr AdjustDecimalColumns ; CPU:$E35F PRG:235F 20 5A D1
|
|
sta $04B1 ; CPU:$E362 PRG:2362 8D B1 04
|
|
lda #$09 ; CPU:$E365 PRG:2365 A9 09
|
|
sta $04B2 ; CPU:$E367 PRG:2367 8D B2 04
|
|
bne InitStage_Loop5 ; CPU:$E36A PRG:236A D0 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitStage_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitStage_Loop4:
|
|
dec $04B3 ; CPU:$E36C PRG:236C CE B3 04
|
|
bne InitStage_Loop6 ; CPU:$E36F PRG:236F D0 3D
|
|
dec $04B2 ; CPU:$E371 PRG:2371 CE B2 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitStage_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitStage_Loop5:
|
|
lda #$06 ; CPU:$E374 PRG:2374 A9 06
|
|
sta $04B3 ; CPU:$E376 PRG:2376 8D B3 04
|
|
lda #$14 ; CPU:$E379 PRG:2379 A9 14
|
|
sta $0540 ; CPU:$E37B PRG:237B 8D 40 05
|
|
lda $04B1 ; CPU:$E37E PRG:237E AD B1 04
|
|
lsr a ; CPU:$E381 PRG:2381 4A
|
|
lsr a ; CPU:$E382 PRG:2382 4A
|
|
lsr a ; CPU:$E383 PRG:2383 4A
|
|
lsr a ; CPU:$E384 PRG:2384 4A
|
|
sta $0541 ; CPU:$E385 PRG:2385 8D 41 05
|
|
lda $04B1 ; CPU:$E388 PRG:2388 AD B1 04
|
|
and #$0F ; CPU:$E38B PRG:238B 29 0F
|
|
sta $0542 ; CPU:$E38D PRG:238D 8D 42 05
|
|
lda #$66 ; CPU:$E390 PRG:2390 A9 66
|
|
sta $0543 ; CPU:$E392 PRG:2392 8D 43 05
|
|
lda $04B2 ; CPU:$E395 PRG:2395 AD B2 04
|
|
sta $0544 ; CPU:$E398 PRG:2398 8D 44 05
|
|
lda #$AE ; CPU:$E39B PRG:239B A9 AE
|
|
sta Zp00 ; CPU:$E39D PRG:239D 85 00
|
|
lda #$20 ; CPU:$E39F PRG:239F A9 20
|
|
sta Zp01 ; CPU:$E3A1 PRG:23A1 85 01
|
|
lda #$40 ; CPU:$E3A3 PRG:23A3 A9 40
|
|
sta Zp02 ; CPU:$E3A5 PRG:23A5 85 02
|
|
lda #$05 ; CPU:$E3A7 PRG:23A7 A9 05
|
|
sta Zp03 ; CPU:$E3A9 PRG:23A9 85 03
|
|
jsr ReturnOne ; CPU:$E3AB PRG:23AB 20 2C CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitStage_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitStage_Loop6:
|
|
ldx #$40 ; CPU:$E3AE PRG:23AE A2 40
|
|
ldy #$03 ; CPU:$E3B0 PRG:23B0 A0 03
|
|
lda FrameCounter ; CPU:$E3B2 PRG:23B2 A5 2F
|
|
lsr a ; CPU:$E3B4 PRG:23B4 4A
|
|
bcc InitStage_Loop7 ; CPU:$E3B5 PRG:23B5 90 04
|
|
ldx #$E0 ; CPU:$E3B7 PRG:23B7 A2 E0
|
|
ldy #$03 ; CPU:$E3B9 PRG:23B9 A0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitStage_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitStage_Loop7:
|
|
stx ScriptPtrLo ; CPU:$E3BB PRG:23BB 86 A0
|
|
sty ScriptPtrHi ; CPU:$E3BD PRG:23BD 84 A1
|
|
lda #$05 ; CPU:$E3BF PRG:23BF A9 05
|
|
sta ScriptStepCounter ; CPU:$E3C1 PRG:23C1 85 33
|
|
lda #$00 ; CPU:$E3C3 PRG:23C3 A9 00
|
|
sta ScriptStep ; CPU:$E3C5 PRG:23C5 85 A2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitStage_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitStage_OnNonzero:
|
|
jsr SetupScriptPointerA ; CPU:$E3C7 PRG:23C7 20 9B CB
|
|
lda ZpB0 ; CPU:$E3CA PRG:23CA A5 B0
|
|
beq RunStageScriptB ; CPU:$E3CC PRG:23CC F0 15
|
|
lda ZpC0 ; CPU:$E3CE PRG:23CE A5 C0
|
|
bne RunStageScriptB_Loop2 ; CPU:$E3D0 PRG:23D0 D0 21
|
|
lda ZpB3 ; CPU:$E3D2 PRG:23D2 A5 B3
|
|
bne RunStageScript_OnNonzero ; CPU:$E3D4 PRG:23D4 D0 0A
|
|
lda ZpB2 ; CPU:$E3D6 PRG:23D6 A5 B2
|
|
sta ZpB3 ; CPU:$E3D8 PRG:23D8 85 B3
|
|
jsr CheckMarioFacing ; CPU:$E3DA PRG:23DA 20 95 CE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE3DD
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunStageScript:
|
|
jsr SetScriptTableBase ; CPU:$E3DD PRG:23DD 20 C4 CB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RunStageScript_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunStageScript_OnNonzero:
|
|
jsr SetupScriptPointerB ; CPU:$E3E0 PRG:23E0 20 B6 CB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE3E3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunStageScriptB:
|
|
jsr AdvanceScriptPointer ; CPU:$E3E3 PRG:23E3 20 AE CB
|
|
dec ScriptStepCounter ; CPU:$E3E6 PRG:23E6 C6 33
|
|
bne InitStage_OnNonzero ; CPU:$E3E8 PRG:23E8 D0 DD
|
|
lda $04BC ; CPU:$E3EA PRG:23EA AD BC 04
|
|
bne RunStageScriptB_Loop ; CPU:$E3ED PRG:23ED D0 03
|
|
jmp InitStage ; CPU:$E3EF PRG:23EF 4C 33 E3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RunStageScriptB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunStageScriptB_Loop:
|
|
rts ; CPU:$E3F2 PRG:23F2 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RunStageScriptB_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunStageScriptB_Loop2:
|
|
cmp #$08 ; CPU:$E3F3 PRG:23F3 C9 08
|
|
beq HandleStageCommand ; CPU:$E3F5 PRG:23F5 F0 27
|
|
cmp #$01 ; CPU:$E3F7 PRG:23F7 C9 01
|
|
bne RunStageScriptB_Loop3 ; CPU:$E3F9 PRG:23F9 D0 05
|
|
inc $04B5 ; CPU:$E3FB PRG:23FB EE B5 04
|
|
bne RunStageScriptB_Loop4 ; CPU:$E3FE PRG:23FE D0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RunStageScriptB_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunStageScriptB_Loop3:
|
|
inc $04B6 ; CPU:$E400 PRG:2400 EE B6 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RunStageScriptB_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunStageScriptB_Loop4:
|
|
lda #$E8 ; CPU:$E403 PRG:2403 A9 E8
|
|
sta ZpBC ; CPU:$E405 PRG:2405 85 BC
|
|
lda #$F6 ; CPU:$E407 PRG:2407 A9 F6
|
|
sta ZpBD ; CPU:$E409 PRG:2409 85 BD
|
|
lda #$07 ; CPU:$E40B PRG:240B A9 07
|
|
sta ZpB5 ; CPU:$E40D PRG:240D 85 B5
|
|
ldy #$02 ; CPU:$E40F PRG:240F A0 02
|
|
jsr InitSpritesOffscreen ; CPU:$E411 PRG:2411 20 C4 DF
|
|
lda #$08 ; CPU:$E414 PRG:2414 A9 08
|
|
sta ZpC0 ; CPU:$E416 PRG:2416 85 C0
|
|
lda #$9E ; CPU:$E418 PRG:2418 A9 9E
|
|
sta ZpB6 ; CPU:$E41A PRG:241A 85 B6
|
|
bne RunStageScript_OnNonzero ; CPU:$E41C PRG:241C D0 C2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE41E
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleStageCommand:
|
|
jsr PushTablePointerDispatch ; CPU:$E41E PRG:241E 20 A0 CC
|
|
cmp #$CC ; CPU:$E421 PRG:2421 C9 CC
|
|
beq HandleStageCommand_Loop ; CPU:$E423 PRG:2423 F0 0A
|
|
cmp #$DD ; CPU:$E425 PRG:2425 C9 DD
|
|
beq HandleStageCommand_Loop2 ; CPU:$E427 PRG:2427 F0 17
|
|
cmp #$EE ; CPU:$E429 PRG:2429 C9 EE
|
|
beq HandleStageCommand_Loop3 ; CPU:$E42B PRG:242B F0 1B
|
|
bne RunStageScript ; CPU:$E42D PRG:242D D0 AE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleStageCommand_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleStageCommand_Loop:
|
|
jsr PushTablePointerDispatch ; CPU:$E42F PRG:242F 20 A0 CC
|
|
sta ZpB5 ; CPU:$E432 PRG:2432 85 B5
|
|
cmp #$05 ; CPU:$E434 PRG:2434 C9 05
|
|
bne HandleStageCommand ; CPU:$E436 PRG:2436 D0 E6
|
|
ldy #$04 ; CPU:$E438 PRG:2438 A0 04
|
|
jsr InitSpritesOffscreen ; CPU:$E43A PRG:243A 20 C4 DF
|
|
jmp HandleStageCommand ; CPU:$E43D PRG:243D 4C 1E E4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleStageCommand_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleStageCommand_Loop2:
|
|
jsr PushTablePointerDispatch ; CPU:$E440 PRG:2440 20 A0 CC
|
|
sta ZpB6 ; CPU:$E443 PRG:2443 85 B6
|
|
jmp RunStageScript ; CPU:$E445 PRG:2445 4C DD E3
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleStageCommand_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleStageCommand_Loop3:
|
|
dec $04BC ; CPU:$E448 PRG:2448 CE BC 04
|
|
ldy #$04 ; CPU:$E44B PRG:244B A0 04
|
|
jsr InitSpritesOffscreen ; CPU:$E44D PRG:244D 20 C4 DF
|
|
jmp RunStageScriptB ; CPU:$E450 PRG:2450 4C E3 E3
|
|
; ---- $E453-$E708: recovered as code by the Code Data Logger re-classification ----
|
|
; The data blocks inside it are named individually below.
|
|
; referenced by `lda $E6C5,y` at $E2D1 (operand $E6C5 falls inside this region)
|
|
; referenced by `lda $E6E5,x` at $E2E8 (operand $E6E5 falls inside this region)
|
|
; referenced by `lda $E6E6,x` at $E2F1 (operand $E6E6 falls inside this region)
|
|
; referenced by `lda $E6E7,x` at $E2FA (operand $E6E7 falls inside this region)
|
|
jsr CheckStageComplete ; CPU:$E453 PRG:2453 20 F7 E1
|
|
lda $04B4 ; CPU:$E456 PRG:2456 AD B4 04
|
|
jsr DispatchViaStackPointer ; CPU:$E459 PRG:2459 20 9E CD
|
|
; ---- data $E45C-$E463 (8 bytes) ----
|
|
EnemyTypePointerTable:
|
|
.byte $64, $E4, $8A, $E4, $9A, $E4, $AA, $E4 ; CPU:$E45C PRG:245C 64 E4 8A E4 9A E4 AA E4
|
|
jsr DisableBackgroundAndSprites ; CPU:$E464 PRG:2464 20 32 E1
|
|
jsr SetVramAddress2400 ; CPU:$E467 PRG:2467 20 20 CA
|
|
jsr DrawTileRow ; CPU:$E46A PRG:246A 20 3B CA
|
|
jsr SetVramAddressF400 ; CPU:$E46D PRG:246D 20 2B CA
|
|
jsr WriteVramAtF660 ; CPU:$E470 PRG:2470 20 BE D5
|
|
jsr CopyHudPalette ; CPU:$E473 PRG:2473 20 0F D6
|
|
jsr InitEnemySprites ; CPU:$E476 PRG:2476 20 E6 D5
|
|
jsr InitEnemySpritesB ; CPU:$E479 PRG:2479 20 EC D5
|
|
jsr EnableBackgroundAndSprites ; CPU:$E47C PRG:247C 20 3D E1
|
|
lda #$00 ; CPU:$E47F PRG:247F A9 00
|
|
sta $04BA ; CPU:$E481 PRG:2481 8D BA 04
|
|
sta Zp2B ; CPU:$E484 PRG:2484 85 2B
|
|
inc $04B4 ; CPU:$E486 PRG:2486 EE B4 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleStageCommand_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleStageCommand_OnNonzero:
|
|
rts ; CPU:$E489 PRG:2489 60
|
|
lda Zp2B ; CPU:$E48A PRG:248A A5 2B
|
|
bne HandleStageCommand_OnNonzero ; CPU:$E48C PRG:248C D0 FB
|
|
lda $04BA ; CPU:$E48E PRG:248E AD BA 04
|
|
jsr DispatchViaStackPointer ; CPU:$E491 PRG:2491 20 9E CD
|
|
; ---- data $E494-$E499 (6 bytes) ----
|
|
EnemyTypePointerTable2:
|
|
.byte $1A, $E5, $CE, $E5, $70, $E6 ; CPU:$E494 PRG:2494 1A E5 CE E5 70 E6
|
|
lda Zp2B ; CPU:$E49A PRG:249A A5 2B
|
|
bne HandleStageCommand_OnNonzero ; CPU:$E49C PRG:249C D0 EB
|
|
lda $04BA ; CPU:$E49E PRG:249E AD BA 04
|
|
jsr DispatchViaStackPointer ; CPU:$E4A1 PRG:24A1 20 9E CD
|
|
; ---- data $E4A4-$E4A9 (6 bytes) ----
|
|
EnemyTypePointerTable3:
|
|
.byte $54, $E5, $46, $E6, $B8, $E6 ; CPU:$E4A4 PRG:24A4 54 E5 46 E6 B8 E6
|
|
lda $04B5 ; CPU:$E4AA PRG:24AA AD B5 04
|
|
clc ; CPU:$E4AD PRG:24AD 18
|
|
adc $04B6 ; CPU:$E4AE PRG:24AE 6D B6 04
|
|
ldx #$BF ; CPU:$E4B1 PRG:24B1 A2 BF
|
|
ldy #$E5 ; CPU:$E4B3 PRG:24B3 A0 E5
|
|
cmp #$0A ; CPU:$E4B5 PRG:24B5 C9 0A
|
|
bne WriteVramAt22D0_Loop4 ; CPU:$E4B7 PRG:24B7 D0 4D
|
|
ldx #$AD ; CPU:$E4B9 PRG:24B9 A2 AD
|
|
ldy #$E5 ; CPU:$E4BB PRG:24BB A0 E5
|
|
lda Zp41 ; CPU:$E4BD PRG:24BD A5 41
|
|
cmp #$07 ; CPU:$E4BF PRG:24BF C9 07
|
|
bcs WriteVramAt22D0 ; CPU:$E4C1 PRG:24C1 B0 08
|
|
ldx #$B6 ; CPU:$E4C3 PRG:24C3 A2 B6
|
|
ldy #$E5 ; CPU:$E4C5 PRG:24C5 A0 E5
|
|
lda #$30 ; CPU:$E4C7 PRG:24C7 A9 30
|
|
bne WriteVramAt22D0_Loop ; CPU:$E4C9 PRG:24C9 D0 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteVramAt22D0
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramAt22D0:
|
|
lda #$50 ; CPU:$E4CB PRG:24CB A9 50
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteVramAt22D0_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramAt22D0_Loop:
|
|
sta Zp1E ; CPU:$E4CD PRG:24CD 85 1E
|
|
stx Zp02 ; CPU:$E4CF PRG:24CF 86 02
|
|
sty Zp03 ; CPU:$E4D1 PRG:24D1 84 03
|
|
lda #$D0 ; CPU:$E4D3 PRG:24D3 A9 D0
|
|
sta Zp00 ; CPU:$E4D5 PRG:24D5 85 00
|
|
lda #$22 ; CPU:$E4D7 PRG:24D7 A9 22
|
|
sta Zp01 ; CPU:$E4D9 PRG:24D9 85 01
|
|
jsr ReturnOne ; CPU:$E4DB PRG:24DB 20 2C CE
|
|
lda Zp1E ; CPU:$E4DE PRG:24DE A5 1E
|
|
sta Zp00 ; CPU:$E4E0 PRG:24E0 85 00
|
|
lda ActorYTarget ; CPU:$E4E2 PRG:24E2 A5 4A
|
|
bne WriteVramAt22D0_Loop2 ; CPU:$E4E4 PRG:24E4 D0 07
|
|
lda #$08 ; CPU:$E4E6 PRG:24E6 A9 08
|
|
sta Zp01 ; CPU:$E4E8 PRG:24E8 85 01
|
|
jsr InitZerosIfZp30Zero ; CPU:$E4EA PRG:24EA 20 83 DE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteVramAt22D0_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramAt22D0_Loop2:
|
|
lda Zp4E ; CPU:$E4ED PRG:24ED A5 4E
|
|
bne WriteVramAt22D0_Loop3 ; CPU:$E4EF PRG:24EF D0 0B
|
|
; ---- data $E4F1-$E4FB (11 bytes) ----
|
|
InitEnemySpawnBlock:
|
|
.byte $A5, $1E, $85, $00, $A9, $09, $85, $01, $20, $83, $DE ; CPU:$E4F1 PRG:24F1 A5 1E 85 00 A9 09 85 01 20 83 DE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteVramAt22D0_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramAt22D0_Loop3:
|
|
ldx #$A4 ; CPU:$E4FC PRG:24FC A2 A4
|
|
ldy #$E5 ; CPU:$E4FE PRG:24FE A0 E5
|
|
lda ZpFD ; CPU:$E500 PRG:2500 A5 FD
|
|
ora #$04 ; CPU:$E502 PRG:2502 09 04
|
|
sta ZpFD ; CPU:$E504 PRG:2504 85 FD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteVramAt22D0_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramAt22D0_Loop4:
|
|
lda #$C7 ; CPU:$E506 PRG:2506 A9 C7
|
|
sta Zp00 ; CPU:$E508 PRG:2508 85 00
|
|
lda #$22 ; CPU:$E50A PRG:250A A9 22
|
|
sta Zp01 ; CPU:$E50C PRG:250C 85 01
|
|
stx Zp02 ; CPU:$E50E PRG:250E 86 02
|
|
sty Zp03 ; CPU:$E510 PRG:2510 84 03
|
|
jsr ReturnOne ; CPU:$E512 PRG:2512 20 2C CE
|
|
lda #$10 ; CPU:$E515 PRG:2515 A9 10
|
|
jmp SetActorState9 ; CPU:$E517 PRG:2517 4C EC E1
|
|
lda ActorYTarget ; CPU:$E51A PRG:251A A5 4A
|
|
beq WriteVramAt22D0_Loop5 ; CPU:$E51C PRG:251C F0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteVramAt22D0_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramAt22D0_OnNonzero:
|
|
inc $04B4 ; CPU:$E51E PRG:251E EE B4 04
|
|
rts ; CPU:$E521 PRG:2521 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteVramAt22D0_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramAt22D0_Loop5:
|
|
lda #$17 ; CPU:$E522 PRG:2522 A9 17
|
|
sta Zp1E ; CPU:$E524 PRG:2524 85 1E
|
|
lda #$27 ; CPU:$E526 PRG:2526 A9 27
|
|
sta Zp00 ; CPU:$E528 PRG:2528 85 00
|
|
lda #$21 ; CPU:$E52A PRG:252A A9 21
|
|
ldx #$68 ; CPU:$E52C PRG:252C A2 68
|
|
ldy #$E5 ; CPU:$E52E PRG:252E A0 E5
|
|
sta Zp01 ; CPU:$E530 PRG:2530 85 01
|
|
stx Zp02 ; CPU:$E532 PRG:2532 86 02
|
|
sty Zp03 ; CPU:$E534 PRG:2534 84 03
|
|
jsr ReturnOne ; CPU:$E536 PRG:2536 20 2C CE
|
|
ldx Zp1E ; CPU:$E539 PRG:2539 A6 1E
|
|
ldy #$17 ; CPU:$E53B PRG:253B A0 17
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteVramAt22D0_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramAt22D0_OnNonnegative:
|
|
lda $E574,x ; CPU:$E53D PRG:253D BD 74 E5
|
|
sta $0200,x ; CPU:$E540 PRG:2540 9D 00 02
|
|
dex ; CPU:$E543 PRG:2543 CA
|
|
dey ; CPU:$E544 PRG:2544 88
|
|
bpl WriteVramAt22D0_OnNonnegative ; CPU:$E545 PRG:2545 10 F6
|
|
inc $04BA ; CPU:$E547 PRG:2547 EE BA 04
|
|
lda #$00 ; CPU:$E54A PRG:254A A9 00
|
|
sta $04BB ; CPU:$E54C PRG:254C 8D BB 04
|
|
lda #$10 ; CPU:$E54F PRG:254F A9 10
|
|
sta Zp2B ; CPU:$E551 PRG:2551 85 2B
|
|
rts ; CPU:$E553 PRG:2553 60
|
|
lda Zp4E ; CPU:$E554 PRG:2554 A5 4E
|
|
bne WriteVramAt22D0_OnNonzero ; CPU:$E556 PRG:2556 D0 C6
|
|
; ---- data $E558-$E5CD (118 bytes) ----
|
|
EnemySpawnScript:
|
|
.byte $A9, $2F, $85, $1E, $A9, $07, $85, $00, $A9, $22, $A2, $6E, $A0, $E5, $D0, $C8 ; CPU:$E558 PRG:2558 A9 2F 85 1E A9 07 85 00 A9 22 A2 6E A0 E5 D0 C8
|
|
.byte $15, $16, $0A, $1B, $12, $18, $15, $15, $1E, $12, $10, $12, $40, $13, $40, $20 ; CPU:$E568 PRG:2568 15 16 0A 1B 12 18 15 15 1E 12 10 12 40 13 40 20
|
|
.byte $40, $12, $40, $28, $48, $15, $40, $20, $48, $14, $40, $28, $50, $17, $40, $20 ; CPU:$E578 PRG:2578 40 12 40 28 48 15 40 20 48 14 40 28 50 17 40 20
|
|
.byte $50, $16, $40, $28, $78, $13, $41, $20, $78, $12, $41, $28, $80, $15, $41, $20 ; CPU:$E588 PRG:2588 50 16 40 28 78 13 41 20 78 12 41 28 80 15 41 20
|
|
.byte $80, $14, $41, $28, $88, $17, $41, $20, $88, $16, $41, $28, $18, $19, $0E, $1B ; CPU:$E598 PRG:2598 80 14 41 28 88 17 41 20 88 16 41 28 18 19 0E 1B
|
|
.byte $0F, $0E, $0C, $1D, $67, $18, $05, $00, $00, $00, $19, $1D, $1C, $65, $18, $03 ; CPU:$E5A8 PRG:25A8 0F 0E 0C 1D 67 18 05 00 00 00 19 1D 1C 65 18 03
|
|
.byte $00, $00, $00, $19, $1D, $1C, $65, $1E, $24, $24, $24, $24, $24, $17, $18, $24 ; CPU:$E5B8 PRG:25B8 00 00 00 19 1D 1C 65 1E 24 24 24 24 24 17 18 24
|
|
.byte $0B, $18, $17, $1E, $1C, $26 ; CPU:$E5C8 PRG:25C8 0B 18 17 1E 1C 26
|
|
lda $04B5 ; CPU:$E5CE PRG:25CE AD B5 04
|
|
beq UpdateScoreCounter ; CPU:$E5D1 PRG:25D1 F0 66
|
|
cmp $04BB ; CPU:$E5D3 PRG:25D3 CD BB 04
|
|
beq WriteVramAt22D0_OnZero ; CPU:$E5D6 PRG:25D6 F0 59
|
|
lda $04BB ; CPU:$E5D8 PRG:25D8 AD BB 04
|
|
asl a ; CPU:$E5DB PRG:25DB 0A
|
|
asl a ; CPU:$E5DC PRG:25DC 0A
|
|
asl a ; CPU:$E5DD PRG:25DD 0A
|
|
tax ; CPU:$E5DE PRG:25DE AA
|
|
ldy #$41 ; CPU:$E5DF PRG:25DF A0 41
|
|
lda $04B5 ; CPU:$E5E1 PRG:25E1 AD B5 04
|
|
cmp #$06 ; CPU:$E5E4 PRG:25E4 C9 06
|
|
lda $04BB ; CPU:$E5E6 PRG:25E6 AD BB 04
|
|
bcc WriteVramAt22D0_OnCarryClear ; CPU:$E5E9 PRG:25E9 90 0B
|
|
ldy #$38 ; CPU:$E5EB PRG:25EB A0 38
|
|
cmp #$05 ; CPU:$E5ED PRG:25ED C9 05
|
|
bcc WriteVramAt22D0_OnCarryClear ; CPU:$E5EF PRG:25EF 90 05
|
|
ldy #$4A ; CPU:$E5F1 PRG:25F1 A0 4A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteVramAt22D0_OnCarrySet
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramAt22D0_OnCarrySet:
|
|
sec ; CPU:$E5F3 PRG:25F3 38
|
|
sbc #$05 ; CPU:$E5F4 PRG:25F4 E9 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteVramAt22D0_OnCarryClear
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramAt22D0_OnCarryClear:
|
|
sty Zp1E ; CPU:$E5F6 PRG:25F6 84 1E
|
|
asl a ; CPU:$E5F8 PRG:25F8 0A
|
|
asl a ; CPU:$E5F9 PRG:25F9 0A
|
|
sta Zp1F ; CPU:$E5FA PRG:25FA 85 1F
|
|
asl a ; CPU:$E5FC PRG:25FC 0A
|
|
clc ; CPU:$E5FD PRG:25FD 18
|
|
adc Zp1F ; CPU:$E5FE PRG:25FE 65 1F
|
|
adc #$70 ; CPU:$E600 PRG:2600 69 70
|
|
sta $0233,x ; CPU:$E602 PRG:2602 9D 33 02
|
|
sta $0237,x ; CPU:$E605 PRG:2605 9D 37 02
|
|
lda #$02 ; CPU:$E608 PRG:2608 A9 02
|
|
sta $0232,x ; CPU:$E60A PRG:260A 9D 32 02
|
|
sta $0236,x ; CPU:$E60D PRG:260D 9D 36 02
|
|
lda #$A5 ; CPU:$E610 PRG:2610 A9 A5
|
|
sta $0231,x ; CPU:$E612 PRG:2612 9D 31 02
|
|
lda #$A6 ; CPU:$E615 PRG:2615 A9 A6
|
|
sta $0235,x ; CPU:$E617 PRG:2617 9D 35 02
|
|
lda Zp1E ; CPU:$E61A PRG:261A A5 1E
|
|
sta $0230,x ; CPU:$E61C PRG:261C 9D 30 02
|
|
clc ; CPU:$E61F PRG:261F 18
|
|
adc #$08 ; CPU:$E620 PRG:2620 69 08
|
|
sta $0234,x ; CPU:$E622 PRG:2622 9D 34 02
|
|
inc $04BB ; CPU:$E625 PRG:2625 EE BB 04
|
|
lda #$0A ; CPU:$E628 PRG:2628 A9 0A
|
|
sta Zp2B ; CPU:$E62A PRG:262A 85 2B
|
|
lda #$20 ; CPU:$E62C PRG:262C A9 20
|
|
sta ZpFD ; CPU:$E62E PRG:262E 85 FD
|
|
rts ; CPU:$E630 PRG:2630 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteVramAt22D0_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteVramAt22D0_OnZero:
|
|
inc $04BA ; CPU:$E631 PRG:2631 EE BA 04
|
|
lda #$10 ; CPU:$E634 PRG:2634 A9 10
|
|
sta Zp2B ; CPU:$E636 PRG:2636 85 2B
|
|
rts ; CPU:$E638 PRG:2638 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateScoreCounter
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateScoreCounter:
|
|
lda #$00 ; CPU:$E639 PRG:2639 A9 00
|
|
sta $04BA ; CPU:$E63B PRG:263B 8D BA 04
|
|
inc $04B4 ; CPU:$E63E PRG:263E EE B4 04
|
|
lda #$10 ; CPU:$E641 PRG:2641 A9 10
|
|
sta Zp2B ; CPU:$E643 PRG:2643 85 2B
|
|
rts ; CPU:$E645 PRG:2645 60
|
|
lda $04B6 ; CPU:$E646 PRG:2646 AD B6 04
|
|
beq UpdateScoreCounter ; CPU:$E649 PRG:2649 F0 EE
|
|
cmp $04BB ; CPU:$E64B PRG:264B CD BB 04
|
|
beq WriteVramAt22D0_OnZero ; CPU:$E64E PRG:264E F0 E1
|
|
lda $04BB ; CPU:$E650 PRG:2650 AD BB 04
|
|
asl a ; CPU:$E653 PRG:2653 0A
|
|
asl a ; CPU:$E654 PRG:2654 0A
|
|
asl a ; CPU:$E655 PRG:2655 0A
|
|
clc ; CPU:$E656 PRG:2656 18
|
|
adc #$50 ; CPU:$E657 PRG:2657 69 50
|
|
tax ; CPU:$E659 PRG:2659 AA
|
|
ldy #$79 ; CPU:$E65A PRG:265A A0 79
|
|
lda $04B6 ; CPU:$E65C PRG:265C AD B6 04
|
|
cmp #$06 ; CPU:$E65F PRG:265F C9 06
|
|
lda $04BB ; CPU:$E661 PRG:2661 AD BB 04
|
|
bcc WriteVramAt22D0_OnCarryClear ; CPU:$E664 PRG:2664 90 90
|
|
ldy #$70 ; CPU:$E666 PRG:2666 A0 70
|
|
cmp #$05 ; CPU:$E668 PRG:2668 C9 05
|
|
bcc WriteVramAt22D0_OnCarryClear ; CPU:$E66A PRG:266A 90 8A
|
|
ldy #$82 ; CPU:$E66C PRG:266C A0 82
|
|
bcs WriteVramAt22D0_OnCarrySet ; CPU:$E66E PRG:266E B0 83
|
|
lda #$00 ; CPU:$E670 PRG:2670 A9 00
|
|
sta Zp1F ; CPU:$E672 PRG:2672 85 1F
|
|
ldx #$37 ; CPU:$E674 PRG:2674 A2 37
|
|
ldy #$21 ; CPU:$E676 PRG:2676 A0 21
|
|
lda $04B5 ; CPU:$E678 PRG:2678 AD B5 04
|
|
sta Zp1E ; CPU:$E67B PRG:267B 85 1E
|
|
stx Zp00 ; CPU:$E67D PRG:267D 86 00
|
|
sty Zp01 ; CPU:$E67F PRG:267F 84 01
|
|
lda #$03 ; CPU:$E681 PRG:2681 A9 03
|
|
sta Zp02 ; CPU:$E683 PRG:2683 85 02
|
|
lda #$E7 ; CPU:$E685 PRG:2685 A9 E7
|
|
sta Zp03 ; CPU:$E687 PRG:2687 85 03
|
|
jsr ReturnOne ; CPU:$E689 PRG:2689 20 2C CE
|
|
lda #$00 ; CPU:$E68C PRG:268C A9 00
|
|
sta Zp04 ; CPU:$E68E PRG:268E 85 04
|
|
sta Zp05 ; CPU:$E690 PRG:2690 85 05
|
|
sta Zp07 ; CPU:$E692 PRG:2692 85 07
|
|
ldy #$08 ; CPU:$E694 PRG:2694 A0 08
|
|
sty Zp03 ; CPU:$E696 PRG:2696 84 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateScoreCounter_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateScoreCounter_OnNonzero:
|
|
clc ; CPU:$E698 PRG:2698 18
|
|
jsr AddDecimalDigit ; CPU:$E699 PRG:2699 20 39 D1
|
|
bcc UpdateScoreCounter_Loop ; CPU:$E69C PRG:269C 90 02
|
|
; ---- data $E69E-$E69F (2 bytes) ----
|
|
IncRam04C5:
|
|
.byte $E6, $05 ; CPU:$E69E PRG:269E E6 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateScoreCounter_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateScoreCounter_Loop:
|
|
dec Zp1E ; CPU:$E6A0 PRG:26A0 C6 1E
|
|
bne UpdateScoreCounter_OnNonzero ; CPU:$E6A2 PRG:26A2 D0 F4
|
|
sta Zp06 ; CPU:$E6A4 PRG:26A4 85 06
|
|
lda Zp1F ; CPU:$E6A6 PRG:26A6 A5 1F
|
|
jsr ComputeSpriteOffsetB ; CPU:$E6A8 PRG:26A8 20 B4 D0
|
|
lda #$20 ; CPU:$E6AB PRG:26AB A9 20
|
|
sta Zp2B ; CPU:$E6AD PRG:26AD 85 2B
|
|
lda #$00 ; CPU:$E6AF PRG:26AF A9 00
|
|
sta $04BA ; CPU:$E6B1 PRG:26B1 8D BA 04
|
|
inc $04B4 ; CPU:$E6B4 PRG:26B4 EE B4 04
|
|
rts ; CPU:$E6B7 PRG:26B7 60
|
|
; ---- data $E6B8-$E708 (81 bytes) ----
|
|
EnemySpawnCode:
|
|
.byte $A9, $01, $85, $1F, $A2, $17, $A0, $22, $AD, $B6, $04, $D0, $B6, $01, $01, $03 ; CPU:$E6B8 PRG:26B8 A9 01 85 1F A2 17 A0 22 AD B6 04 D0 B6 01 01 03
|
|
.byte $00, $2C, $05, $A5, $02, $00, $00, $00, $00, $00, $00, $00, $F0, $00, $00, $00 ; CPU:$E6C8 PRG:26C8 00 2C 05 A5 02 00 00 00 00 00 00 00 F0 00 00 00
|
|
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $0F, $0F, $38, $24, $2C ; CPU:$E6D8 PRG:26D8 00 00 00 00 00 00 00 00 00 00 00 0F 0F 38 24 2C
|
|
.byte $C8, $24, $2E, $18, $5A, $2D, $2C, $5A, $30, $D4, $5A, $30, $E8, $5A, $2D, $60 ; CPU:$E6E8 PRG:26E8 C8 24 2E 18 5A 2D 2C 5A 30 D4 5A 30 E8 5A 2D 60
|
|
.byte $8A, $2F, $A0, $8A, $2E, $28, $BA, $2D, $D8, $BA, $30, $15, $21, $24, $08, $00 ; CPU:$E6F8 PRG:26F8 8A 2F A0 8A 2E 28 BA 2D D8 BA 30 15 21 24 08 00
|
|
.byte $00 ; CPU:$E708 PRG:2708 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE709
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CountDownStageTimer:
|
|
lda $04D0 ; CPU:$E709 PRG:2709 AD D0 04
|
|
beq CountDownStageTimer_Loop ; CPU:$E70C PRG:270C F0 03
|
|
dec $04D0 ; CPU:$E70E PRG:270E CE D0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CountDownStageTimer_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CountDownStageTimer_Loop:
|
|
lda $04D2 ; CPU:$E711 PRG:2711 AD D2 04
|
|
beq CountDownStageTimer_Loop2 ; CPU:$E714 PRG:2714 F0 03
|
|
dec $04D2 ; CPU:$E716 PRG:2716 CE D2 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CountDownStageTimer_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CountDownStageTimer_Loop2:
|
|
inc Zp27 ; CPU:$E719 PRG:2719 E6 27
|
|
lda Zp27 ; CPU:$E71B PRG:271B A5 27
|
|
cmp #$3E ; CPU:$E71D PRG:271D C9 3E
|
|
bcc CountDownStageTimer_Loop5 ; CPU:$E71F PRG:271F 90 1C
|
|
lda #$00 ; CPU:$E721 PRG:2721 A9 00
|
|
sta Zp27 ; CPU:$E723 PRG:2723 85 27
|
|
lda $04F3 ; CPU:$E725 PRG:2725 AD F3 04
|
|
beq CountDownStageTimer_Loop3 ; CPU:$E728 PRG:2728 F0 03
|
|
dec $04F3 ; CPU:$E72A PRG:272A CE F3 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CountDownStageTimer_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CountDownStageTimer_Loop3:
|
|
lda $04FC ; CPU:$E72D PRG:272D AD FC 04
|
|
beq CountDownStageTimer_Loop4 ; CPU:$E730 PRG:2730 F0 03
|
|
dec $04FC ; CPU:$E732 PRG:2732 CE FC 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CountDownStageTimer_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CountDownStageTimer_Loop4:
|
|
lda $04FF ; CPU:$E735 PRG:2735 AD FF 04
|
|
beq CountDownStageTimer_Loop5 ; CPU:$E738 PRG:2738 F0 03
|
|
dec $04FF ; CPU:$E73A PRG:273A CE FF 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CountDownStageTimer_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CountDownStageTimer_Loop5:
|
|
rts ; CPU:$E73D PRG:273D 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE73E
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckMarioSprite:
|
|
lda $0300 ; CPU:$E73E PRG:273E AD 00 03
|
|
beq CheckMarioSprite_Loop2 ; CPU:$E741 PRG:2741 F0 25
|
|
lda $0316 ; CPU:$E743 PRG:2743 AD 16 03
|
|
bne CheckMarioSprite_Loop2 ; CPU:$E746 PRG:2746 D0 20
|
|
ldx #$00 ; CPU:$E748 PRG:2748 A2 00
|
|
lda $030E ; CPU:$E74A PRG:274A AD 0E 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckMarioSprite_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckMarioSprite_OnNonzero:
|
|
cmp $04F6,x ; CPU:$E74D PRG:274D DD F6 04
|
|
bne CheckMarioSprite_Loop3 ; CPU:$E750 PRG:2750 D0 17
|
|
inc $04F7,x ; CPU:$E752 PRG:2752 FE F7 04
|
|
ldy #$F0 ; CPU:$E755 PRG:2755 A0 F0
|
|
lda Zp3A ; CPU:$E757 PRG:2757 A5 3A
|
|
beq CheckMarioSprite_Loop ; CPU:$E759 PRG:2759 F0 02
|
|
ldy #$3E ; CPU:$E75B PRG:275B A0 3E
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckMarioSprite_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckMarioSprite_Loop:
|
|
tya ; CPU:$E75D PRG:275D 98
|
|
cmp $04F7,x ; CPU:$E75E PRG:275E DD F7 04
|
|
bcs CheckMarioSprite_Loop2 ; CPU:$E761 PRG:2761 B0 05
|
|
lda #$01 ; CPU:$E763 PRG:2763 A9 01
|
|
sta $04F8,x ; CPU:$E765 PRG:2765 9D F8 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckMarioSprite_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckMarioSprite_Loop2:
|
|
rts ; CPU:$E768 PRG:2768 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckMarioSprite_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckMarioSprite_Loop3:
|
|
sta $04F6,x ; CPU:$E769 PRG:2769 9D F6 04
|
|
lda #$00 ; CPU:$E76C PRG:276C A9 00
|
|
sta $04F7,x ; CPU:$E76E PRG:276E 9D F7 04
|
|
rts ; CPU:$E771 PRG:2771 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE772
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemySprite:
|
|
lda $0320 ; CPU:$E772 PRG:2772 AD 20 03
|
|
beq CheckMarioSprite_Loop2 ; CPU:$E775 PRG:2775 F0 F1
|
|
lda $0336 ; CPU:$E777 PRG:2777 AD 36 03
|
|
bne CheckMarioSprite_Loop2 ; CPU:$E77A PRG:277A D0 EC
|
|
lda $032E ; CPU:$E77C PRG:277C AD 2E 03
|
|
ldx #$03 ; CPU:$E77F PRG:277F A2 03
|
|
bne CheckMarioSprite_OnNonzero ; CPU:$E781 PRG:2781 D0 CA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE783
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CopyEnemyTileTable:
|
|
ldx #$03 ; CPU:$E783 PRG:2783 A2 03
|
|
ldy #$00 ; CPU:$E785 PRG:2785 A0 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CopyEnemyTileTable_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CopyEnemyTileTable_OnNonnegative:
|
|
lda $04AC,x ; CPU:$E787 PRG:2787 BD AC 04
|
|
sta $04A8,x ; CPU:$E78A PRG:278A 9D A8 04
|
|
tya ; CPU:$E78D PRG:278D 98
|
|
sta $04AC,x ; CPU:$E78E PRG:278E 9D AC 04
|
|
dex ; CPU:$E791 PRG:2791 CA
|
|
bpl CopyEnemyTileTable_OnNonnegative ; CPU:$E792 PRG:2792 10 F3
|
|
rts ; CPU:$E794 PRG:2794 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE795
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageReady:
|
|
lda $04B0 ; CPU:$E795 PRG:2795 AD B0 04
|
|
bne CheckStageReady_Loop ; CPU:$E798 PRG:2798 D0 12
|
|
lda $04F3 ; CPU:$E79A PRG:279A AD F3 04
|
|
beq CheckStageReady_Loop2 ; CPU:$E79D PRG:279D F0 0E
|
|
ldy ActorXPosition ; CPU:$E79F PRG:279F A4 46
|
|
beq CheckStageReady_Loop ; CPU:$E7A1 PRG:27A1 F0 09
|
|
cmp #$04 ; CPU:$E7A3 PRG:27A3 C9 04
|
|
bcc CheckStageReady_Loop ; CPU:$E7A5 PRG:27A5 90 05
|
|
lda #$04 ; CPU:$E7A7 PRG:27A7 A9 04
|
|
sta $04F3 ; CPU:$E7A9 PRG:27A9 8D F3 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageReady_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageReady_Loop:
|
|
rts ; CPU:$E7AC PRG:27AC 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageReady_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageReady_Loop2:
|
|
lda $04BE ; CPU:$E7AD PRG:27AD AD BE 04
|
|
bne CheckStageReady_Loop3 ; CPU:$E7B0 PRG:27B0 D0 0B
|
|
jsr CheckStageScript ; CPU:$E7B2 PRG:27B2 20 AD EE
|
|
jsr InitEnemyPaletteTable ; CPU:$E7B5 PRG:27B5 20 A0 E9
|
|
lda #$01 ; CPU:$E7B8 PRG:27B8 A9 01
|
|
sta $04BE ; CPU:$E7BA PRG:27BA 8D BE 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageReady_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageReady_Loop3:
|
|
jsr CheckMarioSprite ; CPU:$E7BD PRG:27BD 20 3E E7
|
|
jsr CheckEnemySprite ; CPU:$E7C0 PRG:27C0 20 72 E7
|
|
lda $0430 ; CPU:$E7C3 PRG:27C3 AD 30 04
|
|
beq CheckStageReady_Loop4 ; CPU:$E7C6 PRG:27C6 F0 03
|
|
jmp CheckEnemyOamOverflow ; CPU:$E7C8 PRG:27C8 4C 6B E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageReady_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageReady_Loop4:
|
|
lda $0431 ; CPU:$E7CB PRG:27CB AD 31 04
|
|
beq CheckStageReady_Loop5 ; CPU:$E7CE PRG:27CE F0 06
|
|
dec $0431 ; CPU:$E7D0 PRG:27D0 CE 31 04
|
|
jmp WriteOamSlot ; CPU:$E7D3 PRG:27D3 4C 05 E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageReady_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageReady_Loop5:
|
|
lda Zp51 ; CPU:$E7D6 PRG:27D6 A5 51
|
|
bne WriteOamSlot ; CPU:$E7D8 PRG:27D8 D0 2B
|
|
lda $04F8 ; CPU:$E7DA PRG:27DA AD F8 04
|
|
bne WriteOamSlot_Loop ; CPU:$E7DD PRG:27DD D0 27
|
|
lda $04FB ; CPU:$E7DF PRG:27DF AD FB 04
|
|
bne SetEnemyOamPointerB_Loop ; CPU:$E7E2 PRG:27E2 D0 66
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE7E4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteEnemyOam:
|
|
ldx $042A ; CPU:$E7E4 PRG:27E4 AE 2A 04
|
|
lda $0428 ; CPU:$E7E7 PRG:27E7 AD 28 04
|
|
clc ; CPU:$E7EA PRG:27EA 18
|
|
adc #$FC ; CPU:$E7EB PRG:27EB 69 FC
|
|
sta $0200,x ; CPU:$E7ED PRG:27ED 9D 00 02
|
|
lda $0426 ; CPU:$E7F0 PRG:27F0 AD 26 04
|
|
sta $0201,x ; CPU:$E7F3 PRG:27F3 9D 01 02
|
|
lda $0427 ; CPU:$E7F6 PRG:27F6 AD 27 04
|
|
sta $0202,x ; CPU:$E7F9 PRG:27F9 9D 02 02
|
|
lda $0429 ; CPU:$E7FC PRG:27FC AD 29 04
|
|
clc ; CPU:$E7FF PRG:27FF 18
|
|
adc #$FC ; CPU:$E800 PRG:2800 69 FC
|
|
sta $0203,x ; CPU:$E802 PRG:2802 9D 03 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE805
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteOamSlot:
|
|
rts ; CPU:$E805 PRG:2805 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteOamSlot_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteOamSlot_Loop:
|
|
ldx $030E ; CPU:$E806 PRG:2806 AE 0E 03
|
|
lda $04A8,x ; CPU:$E809 PRG:2809 BD A8 04
|
|
cmp #$08 ; CPU:$E80C PRG:280C C9 08
|
|
bcs WriteOamSlot ; CPU:$E80E PRG:280E B0 F5
|
|
lda #$00 ; CPU:$E810 PRG:2810 A9 00
|
|
sta $04F8 ; CPU:$E812 PRG:2812 8D F8 04
|
|
sta $04F7 ; CPU:$E815 PRG:2815 8D F7 04
|
|
stx $042E ; CPU:$E818 PRG:2818 8E 2E 04
|
|
lda $F0A1,x ; CPU:$E81B PRG:281B BD A1 F0
|
|
sta $0428 ; CPU:$E81E PRG:281E 8D 28 04
|
|
lda $0309 ; CPU:$E821 PRG:2821 AD 09 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE824
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamSlot:
|
|
ldy #$18 ; CPU:$E824 PRG:2824 A0 18
|
|
ldx #$01 ; CPU:$E826 PRG:2826 A2 01
|
|
cmp #$80 ; CPU:$E828 PRG:2828 C9 80
|
|
bcs SetEnemyOamSlot_Loop ; CPU:$E82A PRG:282A B0 04
|
|
ldy #$E8 ; CPU:$E82C PRG:282C A0 E8
|
|
ldx #$02 ; CPU:$E82E PRG:282E A2 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamSlot_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamSlot_Loop:
|
|
sty $0429 ; CPU:$E830 PRG:2830 8C 29 04
|
|
stx $0421 ; CPU:$E833 PRG:2833 8E 21 04
|
|
lda #$01 ; CPU:$E836 PRG:2836 A9 01
|
|
sta $0430 ; CPU:$E838 PRG:2838 8D 30 04
|
|
jsr ToggleZpFC_Bit3 ; CPU:$E83B PRG:283B 20 6D E9
|
|
ldx #$DB ; CPU:$E83E PRG:283E A2 DB
|
|
ldy #$EF ; CPU:$E840 PRG:2840 A0 EF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE842
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointerB:
|
|
stx $042C ; CPU:$E842 PRG:2842 8E 2C 04
|
|
sty $042D ; CPU:$E845 PRG:2845 8C 2D 04
|
|
bne WriteOamSlot ; CPU:$E848 PRG:2848 D0 BB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamPointerB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointerB_Loop:
|
|
ldx $032E ; CPU:$E84A PRG:284A AE 2E 03
|
|
lda $04A8,x ; CPU:$E84D PRG:284D BD A8 04
|
|
cmp #$08 ; CPU:$E850 PRG:2850 C9 08
|
|
bcs WriteOamSlot ; CPU:$E852 PRG:2852 B0 B1
|
|
stx $042E ; CPU:$E854 PRG:2854 8E 2E 04
|
|
lda $F0A1,x ; CPU:$E857 PRG:2857 BD A1 F0
|
|
sta $0428 ; CPU:$E85A PRG:285A 8D 28 04
|
|
lda #$00 ; CPU:$E85D PRG:285D A9 00
|
|
sta $04FB ; CPU:$E85F PRG:285F 8D FB 04
|
|
sta $04FA ; CPU:$E862 PRG:2862 8D FA 04
|
|
lda $0329 ; CPU:$E865 PRG:2865 AD 29 03
|
|
jmp SetEnemyOamSlot ; CPU:$E868 PRG:2868 4C 24 E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE86B
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyOamOverflow:
|
|
cmp #$01 ; CPU:$E86B PRG:286B C9 01
|
|
bne SetEnemyOamSlotB_Loop2 ; CPU:$E86D PRG:286D D0 24
|
|
jsr CheckFlagsReturnCarry ; CPU:$E86F PRG:286F 20 25 EA
|
|
bcc CheckEnemyOamOverflow_Loop ; CPU:$E872 PRG:2872 90 03
|
|
jmp SetEnemyOamSlotC ; CPU:$E874 PRG:2874 4C 52 E9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyOamOverflow_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyOamOverflow_Loop:
|
|
jsr RunScript ; CPU:$E877 PRG:2877 20 D3 E9
|
|
cmp #$FF ; CPU:$E87A PRG:287A C9 FF
|
|
bne SetEnemyOamSlotB_OnNonzero ; CPU:$E87C PRG:287C D0 0B
|
|
lda #$10 ; CPU:$E87E PRG:287E A9 10
|
|
sta $0430 ; CPU:$E880 PRG:2880 8D 30 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE883
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamSlotB:
|
|
ldx #$1B ; CPU:$E883 PRG:2883 A2 1B
|
|
ldy #$F0 ; CPU:$E885 PRG:2885 A0 F0
|
|
bne SetEnemyOamPointerB ; CPU:$E887 PRG:2887 D0 B9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamSlotB_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamSlotB_OnNonzero:
|
|
cmp #$00 ; CPU:$E889 PRG:2889 C9 00
|
|
beq SetEnemyOamSlotB_Loop ; CPU:$E88B PRG:288B F0 03
|
|
sta $0426 ; CPU:$E88D PRG:288D 8D 26 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamSlotB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamSlotB_Loop:
|
|
jmp WriteEnemyOam ; CPU:$E890 PRG:2890 4C E4 E7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamSlotB_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamSlotB_Loop2:
|
|
cmp #$02 ; CPU:$E893 PRG:2893 C9 02
|
|
bne SpawnEnemySprite_Loop ; CPU:$E895 PRG:2895 D0 3C
|
|
jsr RunScript ; CPU:$E897 PRG:2897 20 D3 E9
|
|
cmp #$FF ; CPU:$E89A PRG:289A C9 FF
|
|
bne SetEnemyOamSlotB_OnNonzero ; CPU:$E89C PRG:289C D0 EB
|
|
jsr ClearStageFlag ; CPU:$E89E PRG:289E 20 73 E9
|
|
ldy #$00 ; CPU:$E8A1 PRG:28A1 A0 00
|
|
sty $0430 ; CPU:$E8A3 PRG:28A3 8C 30 04
|
|
dey ; CPU:$E8A6 PRG:28A6 88
|
|
lda Zp3A ; CPU:$E8A7 PRG:28A7 A5 3A
|
|
beq SetEnemyOamSlotB_Loop3 ; CPU:$E8A9 PRG:28A9 F0 02
|
|
ldy #$80 ; CPU:$E8AB PRG:28AB A0 80
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamSlotB_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamSlotB_Loop3:
|
|
sty $0431 ; CPU:$E8AD PRG:28AD 8C 31 04
|
|
lda #$F4 ; CPU:$E8B0 PRG:28B0 A9 F4
|
|
sta $0428 ; CPU:$E8B2 PRG:28B2 8D 28 04
|
|
ldx $042A ; CPU:$E8B5 PRG:28B5 AE 2A 04
|
|
sta $0200,x ; CPU:$E8B8 PRG:28B8 9D 00 02
|
|
jmp WriteOamSlot ; CPU:$E8BB PRG:28BB 4C 05 E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE8BE
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SpawnEnemySprite:
|
|
lda #$02 ; CPU:$E8BE PRG:28BE A9 02
|
|
sta Zp00 ; CPU:$E8C0 PRG:28C0 85 00
|
|
ldx Zp9F ; CPU:$E8C2 PRG:28C2 A6 9F
|
|
lda #$01 ; CPU:$E8C4 PRG:28C4 A9 01
|
|
sta Zp9D,x ; CPU:$E8C6 PRG:28C6 95 9D
|
|
txa ; CPU:$E8C8 PRG:28C8 8A
|
|
ora #$08 ; CPU:$E8C9 PRG:28C9 09 08
|
|
sta Zp01 ; CPU:$E8CB PRG:28CB 85 01
|
|
jsr InitZerosIfZp30Zero ; CPU:$E8CD PRG:28CD 20 83 DE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SpawnEnemySprite_OnCarrySet
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SpawnEnemySprite_OnCarrySet:
|
|
jmp SetEnemyOamSlotC ; CPU:$E8D0 PRG:28D0 4C 52 E9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SpawnEnemySprite_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SpawnEnemySprite_Loop:
|
|
jsr CheckFlagsReturnCarry ; CPU:$E8D3 PRG:28D3 20 25 EA
|
|
bcs SpawnEnemySprite_OnCarrySet ; CPU:$E8D6 PRG:28D6 B0 F8
|
|
ldx $042E ; CPU:$E8D8 PRG:28D8 AE 2E 04
|
|
lda $04A8,x ; CPU:$E8DB PRG:28DB BD A8 04
|
|
cmp #$09 ; CPU:$E8DE PRG:28DE C9 09
|
|
bcs SpawnEnemySprite_OnCarrySet ; CPU:$E8E0 PRG:28E0 B0 EE
|
|
lda $0421 ; CPU:$E8E2 PRG:28E2 AD 21 04
|
|
lsr a ; CPU:$E8E5 PRG:28E5 4A
|
|
bcs ScanEnemyTypeTable_Loop2 ; CPU:$E8E6 PRG:28E6 B0 46
|
|
lda $0429 ; CPU:$E8E8 PRG:28E8 AD 29 04
|
|
cmp #$10 ; CPU:$E8EB PRG:28EB C9 10
|
|
bcs SpawnEnemySprite_Loop2 ; CPU:$E8ED PRG:28ED B0 03
|
|
jmp SetEnemyOamSlotC ; CPU:$E8EF PRG:28EF 4C 52 E9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SpawnEnemySprite_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SpawnEnemySprite_Loop2:
|
|
jsr RunScript ; CPU:$E8F2 PRG:28F2 20 D3 E9
|
|
cmp #$AA ; CPU:$E8F5 PRG:28F5 C9 AA
|
|
beq SetEnemyOamSlotB ; CPU:$E8F7 PRG:28F7 F0 8A
|
|
cmp #$BB ; CPU:$E8F9 PRG:28F9 C9 BB
|
|
bne SpawnEnemySprite_Loop4 ; CPU:$E8FB PRG:28FB D0 0A
|
|
jsr ReadEnemyOamValue ; CPU:$E8FD PRG:28FD 20 5E E9
|
|
bne SpawnEnemySprite_Loop3 ; CPU:$E900 PRG:2900 D0 03
|
|
jmp SpawnEnemySprite ; CPU:$E902 PRG:2902 4C BE E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SpawnEnemySprite_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SpawnEnemySprite_Loop3:
|
|
lda #$00 ; CPU:$E905 PRG:2905 A9 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SpawnEnemySprite_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SpawnEnemySprite_Loop4:
|
|
dec $0429 ; CPU:$E907 PRG:2907 CE 29 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SpawnEnemySprite_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SpawnEnemySprite_OnNonzero:
|
|
clc ; CPU:$E90A PRG:290A 18
|
|
adc $0428 ; CPU:$E90B PRG:290B 6D 28 04
|
|
sta $0428 ; CPU:$E90E PRG:290E 8D 28 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE911
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ScanEnemyTypeTable:
|
|
ldx $0424 ; CPU:$E911 PRG:2911 AE 24 04
|
|
lda $F4B2,x ; CPU:$E914 PRG:2914 BD B2 F4
|
|
cmp #$FF ; CPU:$E917 PRG:2917 C9 FF
|
|
bne ScanEnemyTypeTable_Loop ; CPU:$E919 PRG:2919 D0 0A
|
|
inx ; CPU:$E91B PRG:291B E8
|
|
lda $F4B2,x ; CPU:$E91C PRG:291C BD B2 F4
|
|
sta $0424 ; CPU:$E91F PRG:291F 8D 24 04
|
|
jmp ScanEnemyTypeTable ; CPU:$E922 PRG:2922 4C 11 E9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ScanEnemyTypeTable_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ScanEnemyTypeTable_Loop:
|
|
sta $0426 ; CPU:$E925 PRG:2925 8D 26 04
|
|
inc $0424 ; CPU:$E928 PRG:2928 EE 24 04
|
|
jmp WriteEnemyOam ; CPU:$E92B PRG:292B 4C E4 E7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ScanEnemyTypeTable_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ScanEnemyTypeTable_Loop2:
|
|
lda $0429 ; CPU:$E92E PRG:292E AD 29 04
|
|
cmp #$F4 ; CPU:$E931 PRG:2931 C9 F4
|
|
bcs SetEnemyOamSlotC ; CPU:$E933 PRG:2933 B0 1D
|
|
jsr RunScript ; CPU:$E935 PRG:2935 20 D3 E9
|
|
cmp #$AA ; CPU:$E938 PRG:2938 C9 AA
|
|
beq ScanEnemyTypeTable_Loop3 ; CPU:$E93A PRG:293A F0 0C
|
|
cmp #$BB ; CPU:$E93C PRG:293C C9 BB
|
|
bne ScanEnemyTypeTable_Loop5 ; CPU:$E93E PRG:293E D0 0D
|
|
jsr ReadEnemyOamValue ; CPU:$E940 PRG:2940 20 5E E9
|
|
bne ScanEnemyTypeTable_Loop4 ; CPU:$E943 PRG:2943 D0 06
|
|
jmp SpawnEnemySprite ; CPU:$E945 PRG:2945 4C BE E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ScanEnemyTypeTable_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ScanEnemyTypeTable_Loop3:
|
|
jmp SetEnemyOamSlotB ; CPU:$E948 PRG:2948 4C 83 E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ScanEnemyTypeTable_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ScanEnemyTypeTable_Loop4:
|
|
lda #$00 ; CPU:$E94B PRG:294B A9 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ScanEnemyTypeTable_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ScanEnemyTypeTable_Loop5:
|
|
inc $0429 ; CPU:$E94D PRG:294D EE 29 04
|
|
bne SpawnEnemySprite_OnNonzero ; CPU:$E950 PRG:2950 D0 B8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE952
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamSlotC:
|
|
lda #$02 ; CPU:$E952 PRG:2952 A9 02
|
|
sta $0430 ; CPU:$E954 PRG:2954 8D 30 04
|
|
ldx #$06 ; CPU:$E957 PRG:2957 A2 06
|
|
ldy #$F0 ; CPU:$E959 PRG:2959 A0 F0
|
|
jmp SetEnemyOamPointerB ; CPU:$E95B PRG:295B 4C 42 E8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE95E
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadEnemyOamValue:
|
|
lda $0428 ; CPU:$E95E PRG:295E AD 28 04
|
|
jsr UpdateEnemyTile ; CPU:$E961 PRG:2961 20 A5 EE
|
|
ldy $0429 ; CPU:$E964 PRG:2964 AC 29 04
|
|
jsr ReadActorPointer ; CPU:$E967 PRG:2967 20 67 EC
|
|
ora #$00 ; CPU:$E96A PRG:296A 09 00
|
|
rts ; CPU:$E96C PRG:296C 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ToggleZpFC_Bit3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ToggleZpFC_Bit3:
|
|
lda ZpFC ; CPU:$E96D PRG:296D A5 FC
|
|
ora #$08 ; CPU:$E96F PRG:296F 09 08
|
|
bne ClearStageFlag_Loop ; CPU:$E971 PRG:2971 D0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE973
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearStageFlag:
|
|
lda ZpFC ; CPU:$E973 PRG:2973 A5 FC
|
|
and #$F7 ; CPU:$E975 PRG:2975 29 F7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ClearStageFlag_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ClearStageFlag_Loop:
|
|
sta ZpFC ; CPU:$E977 PRG:2977 85 FC
|
|
rts ; CPU:$E979 PRG:2979 60
|
|
LookupNoteTable2:
|
|
lda $04F3 ; CPU:$E97A PRG:297A AD F3 04
|
|
ldy Zp3A ; CPU:$E97D PRG:297D A4 3A
|
|
beq LookupNoteTable2_Loop ; CPU:$E97F PRG:297F F0 03
|
|
clc ; CPU:$E981 PRG:2981 18
|
|
adc #$04 ; CPU:$E982 PRG:2982 69 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: LookupNoteTable2_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
LookupNoteTable2_Loop:
|
|
tax ; CPU:$E984 PRG:2984 AA
|
|
lda $F081,x ; CPU:$E985 PRG:2985 BD 81 F0
|
|
sta $04F3 ; CPU:$E988 PRG:2988 8D F3 04
|
|
lda $04FC ; CPU:$E98B PRG:298B AD FC 04
|
|
sta $04FD ; CPU:$E98E PRG:298E 8D FD 04
|
|
cpy #$00 ; CPU:$E991 PRG:2991 C0 00
|
|
beq LookupNoteTable2_Loop2 ; CPU:$E993 PRG:2993 F0 03
|
|
clc ; CPU:$E995 PRG:2995 18
|
|
adc #$04 ; CPU:$E996 PRG:2996 69 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: LookupNoteTable2_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
LookupNoteTable2_Loop2:
|
|
tax ; CPU:$E998 PRG:2998 AA
|
|
lda $F089,x ; CPU:$E999 PRG:2999 BD 89 F0
|
|
sta $04FC ; CPU:$E99C PRG:299C 8D FC 04
|
|
rts ; CPU:$E99F PRG:299F 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE9A0
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyPaletteTable:
|
|
ldx #$1F ; CPU:$E9A0 PRG:29A0 A2 1F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitEnemyPaletteTable_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitEnemyPaletteTable_OnNonnegative:
|
|
lda $F061,x ; CPU:$E9A2 PRG:29A2 BD 61 F0
|
|
sta $0420,x ; CPU:$E9A5 PRG:29A5 9D 20 04
|
|
dex ; CPU:$E9A8 PRG:29A8 CA
|
|
bpl InitEnemyPaletteTable_OnNonnegative ; CPU:$E9A9 PRG:29A9 10 F7
|
|
rts ; CPU:$E9AB PRG:29AB 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE9AC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitMarioPaletteTable:
|
|
ldx #$1F ; CPU:$E9AC PRG:29AC A2 1F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: InitMarioPaletteTable_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
InitMarioPaletteTable_OnNonnegative:
|
|
lda $EFBB,x ; CPU:$E9AE PRG:29AE BD BB EF
|
|
sta $0340,x ; CPU:$E9B1 PRG:29B1 9D 40 03
|
|
dex ; CPU:$E9B4 PRG:29B4 CA
|
|
bpl InitMarioPaletteTable_OnNonnegative ; CPU:$E9B5 PRG:29B5 10 F7
|
|
rts ; CPU:$E9B7 PRG:29B7 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE9B8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScriptFlagB:
|
|
ldy #$10 ; CPU:$E9B8 PRG:29B8 A0 10
|
|
lda (Zp14),y ; CPU:$E9BA PRG:29BA B1 14
|
|
cmp #$10 ; CPU:$E9BC PRG:29BC C9 10
|
|
bne CheckEnemyScriptFlagB_OnNonzero ; CPU:$E9BE PRG:29BE D0 12
|
|
lda #$02 ; CPU:$E9C0 PRG:29C0 A9 02
|
|
sta (Zp14),y ; CPU:$E9C2 PRG:29C2 91 14
|
|
ldy #$0C ; CPU:$E9C4 PRG:29C4 A0 0C
|
|
lda #$06 ; CPU:$E9C6 PRG:29C6 A9 06
|
|
sta (Zp14),y ; CPU:$E9C8 PRG:29C8 91 14
|
|
iny ; CPU:$E9CA PRG:29CA C8
|
|
lda #$F0 ; CPU:$E9CB PRG:29CB A9 F0
|
|
sta (Zp14),y ; CPU:$E9CD PRG:29CD 91 14
|
|
jmp ResetEnemyListB ; CPU:$E9CF PRG:29CF 4C CE DC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyScriptFlagB_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyScriptFlagB_OnNonzero:
|
|
rts ; CPU:$E9D2 PRG:29D2 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE9D3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunScript:
|
|
lda #$00 ; CPU:$E9D3 PRG:29D3 A9 00
|
|
ldx $042C ; CPU:$E9D5 PRG:29D5 AE 2C 04
|
|
ldy $042D ; CPU:$E9D8 PRG:29D8 AC 2D 04
|
|
jsr FetchScriptByte ; CPU:$E9DB PRG:29DB 20 FA E9
|
|
cmp #$CC ; CPU:$E9DE PRG:29DE C9 CC
|
|
bne RunScript_Loop ; CPU:$E9E0 PRG:29E0 D0 06
|
|
jsr ToggleZpFC_Bit3 ; CPU:$E9E2 PRG:29E2 20 6D E9
|
|
jmp RunScript ; CPU:$E9E5 PRG:29E5 4C D3 E9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RunScript_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RunScript_Loop:
|
|
cmp #$DD ; CPU:$E9E8 PRG:29E8 C9 DD
|
|
bne CheckEnemyScriptFlagB_OnNonzero ; CPU:$E9EA PRG:29EA D0 E6
|
|
jsr ClearStageFlag ; CPU:$E9EC PRG:29EC 20 73 E9
|
|
jmp RunScript ; CPU:$E9EF PRG:29EF 4C D3 E9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE9F2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
PrepareOamWrite:
|
|
lda #$01 ; CPU:$E9F2 PRG:29F2 A9 01
|
|
ldx $034C ; CPU:$E9F4 PRG:29F4 AE 4C 03
|
|
ldy $034D ; CPU:$E9F7 PRG:29F7 AC 4D 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCE9FA
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FetchScriptByte:
|
|
sta Zp1E ; CPU:$E9FA PRG:29FA 85 1E
|
|
stx Zp14 ; CPU:$E9FC PRG:29FC 86 14
|
|
sty Zp15 ; CPU:$E9FE PRG:29FE 84 15
|
|
ldy #$00 ; CPU:$EA00 PRG:2A00 A0 00
|
|
lda (Zp14),y ; CPU:$EA02 PRG:2A02 B1 14
|
|
sty Zp13 ; CPU:$EA04 PRG:2A04 84 13
|
|
iny ; CPU:$EA06 PRG:2A06 C8
|
|
sty Zp12 ; CPU:$EA07 PRG:2A07 84 12
|
|
jsr AdvanceDispatchPointer ; CPU:$EA09 PRG:2A09 20 B4 CD
|
|
pha ; CPU:$EA0C PRG:2A0C 48
|
|
ldx Zp14 ; CPU:$EA0D PRG:2A0D A6 14
|
|
ldy Zp15 ; CPU:$EA0F PRG:2A0F A4 15
|
|
lda Zp1E ; CPU:$EA11 PRG:2A11 A5 1E
|
|
bne FetchScriptByte_Loop ; CPU:$EA13 PRG:2A13 D0 08
|
|
stx $042C ; CPU:$EA15 PRG:2A15 8E 2C 04
|
|
sty $042D ; CPU:$EA18 PRG:2A18 8C 2D 04
|
|
pla ; CPU:$EA1B PRG:2A1B 68
|
|
rts ; CPU:$EA1C PRG:2A1C 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: FetchScriptByte_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
FetchScriptByte_Loop:
|
|
stx $034C ; CPU:$EA1D PRG:2A1D 8E 4C 03
|
|
sty $034D ; CPU:$EA20 PRG:2A20 8C 4D 03
|
|
pla ; CPU:$EA23 PRG:2A23 68
|
|
rts ; CPU:$EA24 PRG:2A24 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckFlagsReturnCarry
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckFlagsReturnCarry:
|
|
lda Zp51 ; CPU:$EA25 PRG:2A25 A5 51
|
|
bne CheckFlagsReturnCarry_Loop ; CPU:$EA27 PRG:2A27 D0 06
|
|
lda Zp71 ; CPU:$EA29 PRG:2A29 A5 71
|
|
bne CheckFlagsReturnCarry_Loop ; CPU:$EA2B PRG:2A2B D0 02
|
|
clc ; CPU:$EA2D PRG:2A2D 18
|
|
rts ; CPU:$EA2E PRG:2A2E 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckFlagsReturnCarry_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckFlagsReturnCarry_Loop:
|
|
sec ; CPU:$EA2F PRG:2A2F 38
|
|
rts ; CPU:$EA30 PRG:2A30 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEA31
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageFlag:
|
|
lda $04B0 ; CPU:$EA31 PRG:2A31 AD B0 04
|
|
beq CheckStageFlag_Loop ; CPU:$EA34 PRG:2A34 F0 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageFlag_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageFlag_OnNonzero:
|
|
rts ; CPU:$EA36 PRG:2A36 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageFlag_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageFlag_Loop:
|
|
lda $04FC ; CPU:$EA37 PRG:2A37 AD FC 04
|
|
bne CheckStageFlag_OnNonzero ; CPU:$EA3A PRG:2A3A D0 FA
|
|
lda $04BF ; CPU:$EA3C PRG:2A3C AD BF 04
|
|
bne CheckStageFlag_Loop2 ; CPU:$EA3F PRG:2A3F D0 0B
|
|
jsr CheckStageScript ; CPU:$EA41 PRG:2A41 20 AD EE
|
|
jsr InitMarioPaletteTable ; CPU:$EA44 PRG:2A44 20 AC E9
|
|
lda #$01 ; CPU:$EA47 PRG:2A47 A9 01
|
|
sta $04BF ; CPU:$EA49 PRG:2A49 8D BF 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageFlag_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageFlag_Loop2:
|
|
lda $0430 ; CPU:$EA4C PRG:2A4C AD 30 04
|
|
bne CheckStageFlag_Loop3 ; CPU:$EA4F PRG:2A4F D0 03
|
|
jsr ClearStageFlag ; CPU:$EA51 PRG:2A51 20 73 E9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageFlag_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageFlag_Loop3:
|
|
lda $0350 ; CPU:$EA54 PRG:2A54 AD 50 03
|
|
cmp #$10 ; CPU:$EA57 PRG:2A57 C9 10
|
|
beq SetEnemyOamPointer_Loop4 ; CPU:$EA59 PRG:2A59 F0 3C
|
|
cmp #$01 ; CPU:$EA5B PRG:2A5B C9 01
|
|
beq SetEnemyOamPointer_Loop2 ; CPU:$EA5D PRG:2A5D F0 32
|
|
cmp #$02 ; CPU:$EA5F PRG:2A5F C9 02
|
|
beq SetEnemyOamPointer_Loop3 ; CPU:$EA61 PRG:2A61 F0 31
|
|
lda #$28 ; CPU:$EA63 PRG:2A63 A9 28
|
|
sta $0348 ; CPU:$EA65 PRG:2A65 8D 48 03
|
|
lda #$50 ; CPU:$EA68 PRG:2A68 A9 50
|
|
sta $0349 ; CPU:$EA6A PRG:2A6A 8D 49 03
|
|
lda $0342 ; CPU:$EA6D PRG:2A6D AD 42 03
|
|
bne CheckStageFlag_Loop4 ; CPU:$EA70 PRG:2A70 D0 07
|
|
lda #$02 ; CPU:$EA72 PRG:2A72 A9 02
|
|
sta $0355 ; CPU:$EA74 PRG:2A74 8D 55 03
|
|
bne CheckStageFlag_Loop5 ; CPU:$EA77 PRG:2A77 D0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageFlag_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageFlag_Loop4:
|
|
dec $0342 ; CPU:$EA79 PRG:2A79 CE 42 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageFlag_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageFlag_Loop5:
|
|
jsr CheckFlagsReturnCarry ; CPU:$EA7C PRG:2A7C 20 25 EA
|
|
bcs SetEnemyOamPointer_Loop ; CPU:$EA7F PRG:2A7F B0 0F
|
|
lda #$01 ; CPU:$EA81 PRG:2A81 A9 01
|
|
ldx #$9D ; CPU:$EA83 PRG:2A83 A2 9D
|
|
ldy #$EF ; CPU:$EA85 PRG:2A85 A0 EF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEA87
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointer:
|
|
sta $0350 ; CPU:$EA87 PRG:2A87 8D 50 03
|
|
stx $034C ; CPU:$EA8A PRG:2A8A 8E 4C 03
|
|
sty $034D ; CPU:$EA8D PRG:2A8D 8C 4D 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamPointer_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointer_Loop:
|
|
rts ; CPU:$EA90 PRG:2A90 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamPointer_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointer_Loop2:
|
|
jmp WriteOamRow ; CPU:$EA91 PRG:2A91 4C 14 EC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamPointer_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointer_Loop3:
|
|
jmp HideEnemySprite ; CPU:$EA94 PRG:2A94 4C 30 EC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamPointer_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointer_Loop4:
|
|
jsr CheckFlagsReturnCarry ; CPU:$EA97 PRG:2A97 20 25 EA
|
|
bcc SetEnemyOamPointer_Loop5 ; CPU:$EA9A PRG:2A9A 90 03
|
|
jmp SetEnemyOamSlotD ; CPU:$EA9C PRG:2A9C 4C E9 EB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamPointer_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointer_Loop5:
|
|
lda $0348 ; CPU:$EA9F PRG:2A9F AD 48 03
|
|
cmp #$18 ; CPU:$EAA2 PRG:2AA2 C9 18
|
|
bcs SetEnemyOamPointer_Loop7 ; CPU:$EAA4 PRG:2AA4 B0 17
|
|
lda $04FF ; CPU:$EAA6 PRG:2AA6 AD FF 04
|
|
bne SetEnemyOamPointer_Loop6 ; CPU:$EAA9 PRG:2AA9 D0 0A
|
|
lda $0348 ; CPU:$EAAB PRG:2AAB AD 48 03
|
|
cmp #$0C ; CPU:$EAAE PRG:2AAE C9 0C
|
|
bcs AdvanceEnemyFrame ; CPU:$EAB0 PRG:2AB0 B0 2D
|
|
jmp SetEnemyOamSlotD ; CPU:$EAB2 PRG:2AB2 4C E9 EB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamPointer_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointer_Loop6:
|
|
lda #$01 ; CPU:$EAB5 PRG:2AB5 A9 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamPointer_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointer_OnZero:
|
|
sta $0351 ; CPU:$EAB7 PRG:2AB7 8D 51 03
|
|
jmp AdvanceEnemyFrame ; CPU:$EABA PRG:2ABA 4C DF EA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamPointer_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointer_Loop7:
|
|
cmp #$D4 ; CPU:$EABD PRG:2ABD C9 D4
|
|
bcc SetEnemyOamPointer_Loop8 ; CPU:$EABF PRG:2ABF 90 04
|
|
lda #$00 ; CPU:$EAC1 PRG:2AC1 A9 00
|
|
beq SetEnemyOamPointer_OnZero ; CPU:$EAC3 PRG:2AC3 F0 F2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamPointer_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointer_Loop8:
|
|
lda $0349 ; CPU:$EAC5 PRG:2AC5 AD 49 03
|
|
cmp #$0C ; CPU:$EAC8 PRG:2AC8 C9 0C
|
|
bcs SetEnemyOamPointer_Loop9 ; CPU:$EACA PRG:2ACA B0 07
|
|
jsr AddStageCounter ; CPU:$EACC PRG:2ACC 20 BC EE
|
|
lda #$00 ; CPU:$EACF PRG:2ACF A9 00
|
|
beq SetEnemyOamPointer_Loop10 ; CPU:$EAD1 PRG:2AD1 F0 09
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamPointer_Loop9
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointer_Loop9:
|
|
cmp #$F8 ; CPU:$EAD3 PRG:2AD3 C9 F8
|
|
bcc AdvanceEnemyFrame_Loop ; CPU:$EAD5 PRG:2AD5 90 0B
|
|
jsr SubStageCounter ; CPU:$EAD7 PRG:2AD7 20 CC EE
|
|
lda #$01 ; CPU:$EADA PRG:2ADA A9 01
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemyOamPointer_Loop10
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamPointer_Loop10:
|
|
sta $0341 ; CPU:$EADC PRG:2ADC 8D 41 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEADF
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyFrame:
|
|
jsr ToggleZpFC_Bit3 ; CPU:$EADF PRG:2ADF 20 6D E9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyFrame_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyFrame_Loop:
|
|
lda $034B ; CPU:$EAE2 PRG:2AE2 AD 4B 03
|
|
beq AdvanceEnemyFrame_Loop2 ; CPU:$EAE5 PRG:2AE5 F0 06
|
|
dec $034B ; CPU:$EAE7 PRG:2AE7 CE 4B 03
|
|
jmp DecEnemyFrameCounter ; CPU:$EAEA PRG:2AEA 4C 6B EB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyFrame_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyFrame_Loop2:
|
|
lda $035B ; CPU:$EAED PRG:2AED AD 5B 03
|
|
jsr CheckRangeReturn012 ; CPU:$EAF0 PRG:2AF0 20 A4 CA
|
|
cmp #$00 ; CPU:$EAF3 PRG:2AF3 C9 00
|
|
beq DecEnemyFrameCounter ; CPU:$EAF5 PRG:2AF5 F0 74
|
|
cmp #$02 ; CPU:$EAF7 PRG:2AF7 C9 02
|
|
bne AdvanceEnemyFrame_Loop3 ; CPU:$EAF9 PRG:2AF9 D0 21
|
|
lda $0348 ; CPU:$EAFB PRG:2AFB AD 48 03
|
|
jsr UpdateEnemyTile ; CPU:$EAFE PRG:2AFE 20 A5 EE
|
|
ldy $0349 ; CPU:$EB01 PRG:2B01 AC 49 03
|
|
jsr ReadActorPointer ; CPU:$EB04 PRG:2B04 20 67 EC
|
|
lda #$10 ; CPU:$EB07 PRG:2B07 A9 10
|
|
sta Zp00 ; CPU:$EB09 PRG:2B09 85 00
|
|
ldx Zp9F ; CPU:$EB0B PRG:2B0B A6 9F
|
|
lda #$01 ; CPU:$EB0D PRG:2B0D A9 01
|
|
sta Zp9D,x ; CPU:$EB0F PRG:2B0F 95 9D
|
|
txa ; CPU:$EB11 PRG:2B11 8A
|
|
ora #$08 ; CPU:$EB12 PRG:2B12 09 08
|
|
sta Zp01 ; CPU:$EB14 PRG:2B14 85 01
|
|
jsr InitZerosIfZp30Zero ; CPU:$EB16 PRG:2B16 20 83 DE
|
|
jmp SetEnemyOamSlotD ; CPU:$EB19 PRG:2B19 4C E9 EB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyFrame_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyFrame_Loop3:
|
|
jsr ToggleZpFC_Bit3 ; CPU:$EB1C PRG:2B1C 20 6D E9
|
|
jsr TestRamFlagPair0500 ; CPU:$EB1F PRG:2B1F 20 28 D3
|
|
and #$01 ; CPU:$EB22 PRG:2B22 29 01
|
|
clc ; CPU:$EB24 PRG:2B24 18
|
|
adc $0343 ; CPU:$EB25 PRG:2B25 6D 43 03
|
|
sta $0343 ; CPU:$EB28 PRG:2B28 8D 43 03
|
|
lda #$08 ; CPU:$EB2B PRG:2B2B A9 08
|
|
sta $034B ; CPU:$EB2D PRG:2B2D 8D 4B 03
|
|
ldx #$00 ; CPU:$EB30 PRG:2B30 A2 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyFrame_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyFrame_OnNonzero:
|
|
lda $F574,x ; CPU:$EB32 PRG:2B32 BD 74 F5
|
|
cmp $0357 ; CPU:$EB35 PRG:2B35 CD 57 03
|
|
bne AdvanceEnemyFrame_Loop4 ; CPU:$EB38 PRG:2B38 D0 08
|
|
lda $F575,x ; CPU:$EB3A PRG:2B3A BD 75 F5
|
|
cmp $0358 ; CPU:$EB3D PRG:2B3D CD 58 03
|
|
beq AdvanceEnemyFrame_Loop5 ; CPU:$EB40 PRG:2B40 F0 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyFrame_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyFrame_Loop4:
|
|
inx ; CPU:$EB42 PRG:2B42 E8
|
|
inx ; CPU:$EB43 PRG:2B43 E8
|
|
cpx #$10 ; CPU:$EB44 PRG:2B44 E0 10
|
|
bne AdvanceEnemyFrame_OnNonzero ; CPU:$EB46 PRG:2B46 D0 EA
|
|
beq AdvanceEnemyFrame_OnZero ; CPU:$EB48 PRG:2B48 F0 09
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyFrame_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyFrame_Loop5:
|
|
cpx #$08 ; CPU:$EB4A PRG:2B4A E0 08
|
|
bcc AdvanceEnemyFrame_Loop6 ; CPU:$EB4C PRG:2B4C 90 10
|
|
lda $0341 ; CPU:$EB4E PRG:2B4E AD 41 03
|
|
beq AdvanceEnemyFrame_Loop7 ; CPU:$EB51 PRG:2B51 F0 10
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyFrame_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyFrame_OnZero:
|
|
lda $0351 ; CPU:$EB53 PRG:2B53 AD 51 03
|
|
eor #$01 ; CPU:$EB56 PRG:2B56 49 01
|
|
sta $0351 ; CPU:$EB58 PRG:2B58 8D 51 03
|
|
jmp DecEnemyFrameCounter ; CPU:$EB5B PRG:2B5B 4C 6B EB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyFrame_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyFrame_Loop6:
|
|
lda $0341 ; CPU:$EB5E PRG:2B5E AD 41 03
|
|
beq AdvanceEnemyFrame_OnZero ; CPU:$EB61 PRG:2B61 F0 F0
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AdvanceEnemyFrame_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AdvanceEnemyFrame_Loop7:
|
|
lda $0341 ; CPU:$EB63 PRG:2B63 AD 41 03
|
|
eor #$01 ; CPU:$EB66 PRG:2B66 49 01
|
|
sta $0341 ; CPU:$EB68 PRG:2B68 8D 41 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEB6B
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyFrameCounter:
|
|
ldy #$04 ; CPU:$EB6B PRG:2B6B A0 04
|
|
lda $0341 ; CPU:$EB6D PRG:2B6D AD 41 03
|
|
beq DecEnemyFrameCounter_Loop ; CPU:$EB70 PRG:2B70 F0 02
|
|
ldy #$FC ; CPU:$EB72 PRG:2B72 A0 FC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyFrameCounter_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyFrameCounter_Loop:
|
|
tya ; CPU:$EB74 PRG:2B74 98
|
|
clc ; CPU:$EB75 PRG:2B75 18
|
|
adc $0349 ; CPU:$EB76 PRG:2B76 6D 49 03
|
|
sta Zp00 ; CPU:$EB79 PRG:2B79 85 00
|
|
ldy #$04 ; CPU:$EB7B PRG:2B7B A0 04
|
|
lda $0351 ; CPU:$EB7D PRG:2B7D AD 51 03
|
|
bne DecEnemyFrameCounter_Loop2 ; CPU:$EB80 PRG:2B80 D0 02
|
|
ldy #$FC ; CPU:$EB82 PRG:2B82 A0 FC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyFrameCounter_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyFrameCounter_Loop2:
|
|
tya ; CPU:$EB84 PRG:2B84 98
|
|
clc ; CPU:$EB85 PRG:2B85 18
|
|
adc $0348 ; CPU:$EB86 PRG:2B86 6D 48 03
|
|
sta Zp01 ; CPU:$EB89 PRG:2B89 85 01
|
|
jsr ComputeTileOffset ; CPU:$EB8B PRG:2B8B 20 7D CA
|
|
lda Zp00 ; CPU:$EB8E PRG:2B8E A5 00
|
|
sta $0358 ; CPU:$EB90 PRG:2B90 8D 58 03
|
|
sta $0528 ; CPU:$EB93 PRG:2B93 8D 28 05
|
|
lda Zp01 ; CPU:$EB96 PRG:2B96 A5 01
|
|
sta $0357 ; CPU:$EB98 PRG:2B98 8D 57 03
|
|
sta $0529 ; CPU:$EB9B PRG:2B9B 8D 29 05
|
|
lda $0343 ; CPU:$EB9E PRG:2B9E AD 43 03
|
|
bne WriteEnemyOamSlot_OnZero ; CPU:$EBA1 PRG:2BA1 D0 70
|
|
lda $0342 ; CPU:$EBA3 PRG:2BA3 AD 42 03
|
|
sta $0343 ; CPU:$EBA6 PRG:2BA6 8D 43 03
|
|
lda $0348 ; CPU:$EBA9 PRG:2BA9 AD 48 03
|
|
ldy $0351 ; CPU:$EBAC PRG:2BAC AC 51 03
|
|
bne DecEnemyFrameCounter_Loop3 ; CPU:$EBAF PRG:2BAF D0 07
|
|
sec ; CPU:$EBB1 PRG:2BB1 38
|
|
sbc $0355 ; CPU:$EBB2 PRG:2BB2 ED 55 03
|
|
jmp AddEnemyFrameCounter ; CPU:$EBB5 PRG:2BB5 4C BC EB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyFrameCounter_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyFrameCounter_Loop3:
|
|
clc ; CPU:$EBB8 PRG:2BB8 18
|
|
adc $0355 ; CPU:$EBB9 PRG:2BB9 6D 55 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEBBC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AddEnemyFrameCounter:
|
|
sta $0348 ; CPU:$EBBC PRG:2BBC 8D 48 03
|
|
lda $0341 ; CPU:$EBBF PRG:2BBF AD 41 03
|
|
bne AddEnemyFrameCounter_Loop ; CPU:$EBC2 PRG:2BC2 D0 05
|
|
inc $0349 ; CPU:$EBC4 PRG:2BC4 EE 49 03
|
|
bne ScanEnemyTypeTableB ; CPU:$EBC7 PRG:2BC7 D0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AddEnemyFrameCounter_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AddEnemyFrameCounter_Loop:
|
|
dec $0349 ; CPU:$EBC9 PRG:2BC9 CE 49 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEBCC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ScanEnemyTypeTableB:
|
|
ldx $0344 ; CPU:$EBCC PRG:2BCC AE 44 03
|
|
lda $F4B2,x ; CPU:$EBCF PRG:2BCF BD B2 F4
|
|
cmp #$FF ; CPU:$EBD2 PRG:2BD2 C9 FF
|
|
bne ScanEnemyTypeTableB_Loop ; CPU:$EBD4 PRG:2BD4 D0 0A
|
|
inx ; CPU:$EBD6 PRG:2BD6 E8
|
|
lda $F4B2,x ; CPU:$EBD7 PRG:2BD7 BD B2 F4
|
|
sta $0344 ; CPU:$EBDA PRG:2BDA 8D 44 03
|
|
jmp ScanEnemyTypeTableB ; CPU:$EBDD PRG:2BDD 4C CC EB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ScanEnemyTypeTableB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ScanEnemyTypeTableB_Loop:
|
|
sta $0346 ; CPU:$EBE0 PRG:2BE0 8D 46 03
|
|
inc $0344 ; CPU:$EBE3 PRG:2BE3 EE 44 03
|
|
jmp WriteEnemyOamSlot ; CPU:$EBE6 PRG:2BE6 4C F2 EB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEBE9
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemyOamSlotD:
|
|
lda #$02 ; CPU:$EBE9 PRG:2BE9 A9 02
|
|
ldx #$06 ; CPU:$EBEB PRG:2BEB A2 06
|
|
ldy #$F0 ; CPU:$EBED PRG:2BED A0 F0
|
|
jmp SetEnemyOamPointer ; CPU:$EBEF PRG:2BEF 4C 87 EA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEBF2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteEnemyOamSlot:
|
|
ldx $034A ; CPU:$EBF2 PRG:2BF2 AE 4A 03
|
|
lda $0348 ; CPU:$EBF5 PRG:2BF5 AD 48 03
|
|
clc ; CPU:$EBF8 PRG:2BF8 18
|
|
adc #$FC ; CPU:$EBF9 PRG:2BF9 69 FC
|
|
sta $0200,x ; CPU:$EBFB PRG:2BFB 9D 00 02
|
|
lda $0346 ; CPU:$EBFE PRG:2BFE AD 46 03
|
|
sta $0201,x ; CPU:$EC01 PRG:2C01 9D 01 02
|
|
lda $0347 ; CPU:$EC04 PRG:2C04 AD 47 03
|
|
sta $0202,x ; CPU:$EC07 PRG:2C07 9D 02 02
|
|
lda $0349 ; CPU:$EC0A PRG:2C0A AD 49 03
|
|
clc ; CPU:$EC0D PRG:2C0D 18
|
|
adc #$FC ; CPU:$EC0E PRG:2C0E 69 FC
|
|
sta $0203,x ; CPU:$EC10 PRG:2C10 9D 03 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteEnemyOamSlot_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteEnemyOamSlot_OnZero:
|
|
rts ; CPU:$EC13 PRG:2C13 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEC14
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteOamRow:
|
|
jsr PrepareOamWrite ; CPU:$EC14 PRG:2C14 20 F2 E9
|
|
cmp #$FF ; CPU:$EC17 PRG:2C17 C9 FF
|
|
beq WriteOamRow_Loop ; CPU:$EC19 PRG:2C19 F0 0A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteOamRow_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteOamRow_OnNonzero:
|
|
cmp #$00 ; CPU:$EC1B PRG:2C1B C9 00
|
|
beq WriteEnemyOamSlot_OnZero ; CPU:$EC1D PRG:2C1D F0 F4
|
|
sta $0346 ; CPU:$EC1F PRG:2C1F 8D 46 03
|
|
jmp WriteEnemyOamSlot ; CPU:$EC22 PRG:2C22 4C F2 EB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WriteOamRow_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WriteOamRow_Loop:
|
|
lda #$10 ; CPU:$EC25 PRG:2C25 A9 10
|
|
sta $0350 ; CPU:$EC27 PRG:2C27 8D 50 03
|
|
lda #$1E ; CPU:$EC2A PRG:2C2A A9 1E
|
|
sta $04FF ; CPU:$EC2C PRG:2C2C 8D FF 04
|
|
rts ; CPU:$EC2F PRG:2C2F 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEC30
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HideEnemySprite:
|
|
jsr PrepareOamWrite ; CPU:$EC30 PRG:2C30 20 F2 E9
|
|
cmp #$FF ; CPU:$EC33 PRG:2C33 C9 FF
|
|
bne WriteOamRow_OnNonzero ; CPU:$EC35 PRG:2C35 D0 E4
|
|
ldx $034A ; CPU:$EC37 PRG:2C37 AE 4A 03
|
|
lda #$F4 ; CPU:$EC3A PRG:2C3A A9 F4
|
|
sta $0200,x ; CPU:$EC3C PRG:2C3C 9D 00 02
|
|
lda #$00 ; CPU:$EC3F PRG:2C3F A9 00
|
|
sta $0350 ; CPU:$EC41 PRG:2C41 8D 50 03
|
|
lda $04FE ; CPU:$EC44 PRG:2C44 AD FE 04
|
|
cmp #$02 ; CPU:$EC47 PRG:2C47 C9 02
|
|
beq HideEnemySprite_Loop ; CPU:$EC49 PRG:2C49 F0 06
|
|
inc $04FE ; CPU:$EC4B PRG:2C4B EE FE 04
|
|
lda $04FE ; CPU:$EC4E PRG:2C4E AD FE 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HideEnemySprite_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HideEnemySprite_Loop:
|
|
lsr a ; CPU:$EC51 PRG:2C51 4A
|
|
lsr a ; CPU:$EC52 PRG:2C52 4A
|
|
lsr a ; CPU:$EC53 PRG:2C53 4A
|
|
ldy Zp3A ; CPU:$EC54 PRG:2C54 A4 3A
|
|
beq HideEnemySprite_Loop2 ; CPU:$EC56 PRG:2C56 F0 03
|
|
clc ; CPU:$EC58 PRG:2C58 18
|
|
adc #$04 ; CPU:$EC59 PRG:2C59 69 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HideEnemySprite_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HideEnemySprite_Loop2:
|
|
clc ; CPU:$EC5B PRG:2C5B 18
|
|
adc $04FD ; CPU:$EC5C PRG:2C5C 6D FD 04
|
|
tax ; CPU:$EC5F PRG:2C5F AA
|
|
lda $F089,x ; CPU:$EC60 PRG:2C60 BD 89 F0
|
|
sta $04FC ; CPU:$EC63 PRG:2C63 8D FC 04
|
|
rts ; CPU:$EC66 PRG:2C66 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEC67
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadActorPointer:
|
|
lda #$00 ; CPU:$EC67 PRG:2C67 A9 00
|
|
sta Zp9F ; CPU:$EC69 PRG:2C69 85 9F
|
|
sty Zp1F ; CPU:$EC6B PRG:2C6B 84 1F
|
|
ldy #$00 ; CPU:$EC6D PRG:2C6D A0 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReadActorPointer_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadActorPointer_OnNonzero:
|
|
lda $0084,y ; CPU:$EC6F PRG:2C6F B9 84 00
|
|
beq ReadActorPointer_Loop ; CPU:$EC72 PRG:2C72 F0 1D
|
|
txa ; CPU:$EC74 PRG:2C74 8A
|
|
cmp a:Zp85,y ; CPU:$EC75 PRG:2C75 D9 85 00
|
|
bne ReadActorPointer_Loop ; CPU:$EC78 PRG:2C78 D0 17
|
|
lda Zp1F ; CPU:$EC7A PRG:2C7A A5 1F
|
|
sec ; CPU:$EC7C PRG:2C7C 38
|
|
sbc #$10 ; CPU:$EC7D PRG:2C7D E9 10
|
|
cmp $0086,y ; CPU:$EC7F PRG:2C7F D9 86 00
|
|
bcs ReadActorPointer_Loop ; CPU:$EC82 PRG:2C82 B0 0D
|
|
lda Zp1F ; CPU:$EC84 PRG:2C84 A5 1F
|
|
clc ; CPU:$EC86 PRG:2C86 18
|
|
adc #$10 ; CPU:$EC87 PRG:2C87 69 10
|
|
cmp $0086,y ; CPU:$EC89 PRG:2C89 D9 86 00
|
|
bcc ReadActorPointer_Loop ; CPU:$EC8C PRG:2C8C 90 03
|
|
lda #$00 ; CPU:$EC8E PRG:2C8E A9 00
|
|
rts ; CPU:$EC90 PRG:2C90 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ReadActorPointer_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ReadActorPointer_Loop:
|
|
inc Zp9F ; CPU:$EC91 PRG:2C91 E6 9F
|
|
ldy #$05 ; CPU:$EC93 PRG:2C93 A0 05
|
|
lda Zp9F ; CPU:$EC95 PRG:2C95 A5 9F
|
|
cmp #$02 ; CPU:$EC97 PRG:2C97 C9 02
|
|
bne ReadActorPointer_OnNonzero ; CPU:$EC99 PRG:2C99 D0 D4
|
|
lda #$00 ; CPU:$EC9B PRG:2C9B A9 00
|
|
sta Zp9F ; CPU:$EC9D PRG:2C9D 85 9F
|
|
lda #$FF ; CPU:$EC9F PRG:2C9F A9 FF
|
|
rts ; CPU:$ECA1 PRG:2CA1 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCECA2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageCompleteB:
|
|
lda $04C0 ; CPU:$ECA2 PRG:2CA2 AD C0 04
|
|
bne CheckStageCompleteB_Loop ; CPU:$ECA5 PRG:2CA5 D0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageCompleteB_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageCompleteB_OnNonzero:
|
|
jmp ResetEnemyList ; CPU:$ECA7 PRG:2CA7 4C 04 D9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageCompleteB_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageCompleteB_Loop:
|
|
lda $04C1 ; CPU:$ECAA PRG:2CAA AD C1 04
|
|
bne CheckStageCompleteB_OnNonzero ; CPU:$ECAD PRG:2CAD D0 F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCECAF
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StartEnemyStage:
|
|
lda #$FF ; CPU:$ECAF PRG:2CAF A9 FF
|
|
sta $04C2 ; CPU:$ECB1 PRG:2CB1 8D C2 04
|
|
lda #$01 ; CPU:$ECB4 PRG:2CB4 A9 01
|
|
sta $04C1 ; CPU:$ECB6 PRG:2CB6 8D C1 04
|
|
ldy ZpBA ; CPU:$ECB9 PRG:2CB9 A4 BA
|
|
ldx #$1F ; CPU:$ECBB PRG:2CBB A2 1F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StartEnemyStage_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StartEnemyStage_OnNonnegative:
|
|
lda $ECCC,x ; CPU:$ECBD PRG:2CBD BD CC EC
|
|
sta ZpB0,x ; CPU:$ECC0 PRG:2CC0 95 B0
|
|
dex ; CPU:$ECC2 PRG:2CC2 CA
|
|
bpl StartEnemyStage_OnNonnegative ; CPU:$ECC3 PRG:2CC3 10 F8
|
|
sty ZpBA ; CPU:$ECC5 PRG:2CC5 84 BA
|
|
ldy #$04 ; CPU:$ECC7 PRG:2CC7 A0 04
|
|
jmp InitSpritesOffscreen ; CPU:$ECC9 PRG:2CC9 4C C4 DF
|
|
; ---- data $ECCC-$ECEB (32 bytes) ----
|
|
; referenced by `lda $ECCC,x` at $ECBD (operand $ECCC falls inside this region)
|
|
SoundEnvelopeTable:
|
|
.byte $01, $00, $02, $00, $33, $05, $8C, $23, $00, $00, $00, $00, $4C, $F6, $00, $80 ; CPU:$ECCC PRG:2CCC 01 00 02 00 33 05 8C 23 00 00 00 00 4C F6 00 80
|
|
.byte $00, $00, $01, $0A, $02, $01, $00, $00, $00, $00, $00, $00, $00, $00, $04, $03 ; CPU:$ECDC PRG:2CDC 00 00 01 0A 02 01 00 00 00 00 00 00 00 00 04 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCECEC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyType80:
|
|
lda ActorCommand ; CPU:$ECEC PRG:2CEC A5 BF
|
|
cmp #$80 ; CPU:$ECEE PRG:2CEE C9 80
|
|
beq HandleEnemyType80_Loop ; CPU:$ECF0 PRG:2CF0 F0 09
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyType80_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyType80_OnNonzero:
|
|
jmp CheckEnemyCollision ; CPU:$ECF2 PRG:2CF2 4C BF C6
|
|
; ---- data $ECF5-$ECFA (6 bytes) ----
|
|
JumpToActorScript:
|
|
.byte $20, $BD, $DF, $4C, $5A, $C7 ; CPU:$ECF5 PRG:2CF5 20 BD DF 4C 5A C7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyType80_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyType80_Loop:
|
|
lda ZpC0 ; CPU:$ECFB PRG:2CFB A5 C0
|
|
bne HandleEnemyType80_OnNonzero ; CPU:$ECFD PRG:2CFD D0 F3
|
|
lda $04C2 ; CPU:$ECFF PRG:2CFF AD C2 04
|
|
beq HandleEnemyType80_Loop3 ; CPU:$ED02 PRG:2D02 F0 1C
|
|
dec $04C2 ; CPU:$ED04 PRG:2D04 CE C2 04
|
|
bne HandleEnemyType80_OnNonzero ; CPU:$ED07 PRG:2D07 D0 E9
|
|
jsr TestRamFlagPair0500 ; CPU:$ED09 PRG:2D09 20 28 D3
|
|
ldy #$01 ; CPU:$ED0C PRG:2D0C A0 01
|
|
ldx #$F0 ; CPU:$ED0E PRG:2D0E A2 F0
|
|
and #$01 ; CPU:$ED10 PRG:2D10 29 01
|
|
beq HandleEnemyType80_Loop2 ; CPU:$ED12 PRG:2D12 F0 04
|
|
ldy #$02 ; CPU:$ED14 PRG:2D14 A0 02
|
|
ldx #$10 ; CPU:$ED16 PRG:2D16 A2 10
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyType80_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyType80_Loop2:
|
|
sty ZpC2 ; CPU:$ED18 PRG:2D18 84 C2
|
|
sty ZpB1 ; CPU:$ED1A PRG:2D1A 84 B1
|
|
stx ScrollX ; CPU:$ED1C PRG:2D1C 86 B9
|
|
bne HandleEnemyType80_OnNonzero ; CPU:$ED1E PRG:2D1E D0 D2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyType80_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyType80_Loop3:
|
|
lda ZpC1 ; CPU:$ED20 PRG:2D20 A5 C1
|
|
bne HandleEnemyType80_Loop6 ; CPU:$ED22 PRG:2D22 D0 48
|
|
lda ZpB1 ; CPU:$ED24 PRG:2D24 A5 B1
|
|
and #$C0 ; CPU:$ED26 PRG:2D26 29 C0
|
|
bne HandleEnemyType80_OnNonzero ; CPU:$ED28 PRG:2D28 D0 C8
|
|
ldy ScrollX ; CPU:$ED2A PRG:2D2A A4 B9
|
|
lda ZpBE ; CPU:$ED2C PRG:2D2C A5 BE
|
|
cmp #$01 ; CPU:$ED2E PRG:2D2E C9 01
|
|
beq HandleEnemyType80_Loop4 ; CPU:$ED30 PRG:2D30 F0 0E
|
|
cmp #$02 ; CPU:$ED32 PRG:2D32 C9 02
|
|
bne HandleEnemyType80_OnNonzero ; CPU:$ED34 PRG:2D34 D0 BC
|
|
cpy #$80 ; CPU:$ED36 PRG:2D36 C0 80
|
|
bne HandleEnemyType80_OnNonzero ; CPU:$ED38 PRG:2D38 D0 B8
|
|
lda #$00 ; CPU:$ED3A PRG:2D3A A9 00
|
|
ldx #$00 ; CPU:$ED3C PRG:2D3C A2 00
|
|
beq HandleEnemyType80_Loop5 ; CPU:$ED3E PRG:2D3E F0 10
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyType80_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyType80_Loop4:
|
|
lda #$09 ; CPU:$ED40 PRG:2D40 A9 09
|
|
ldx #$01 ; CPU:$ED42 PRG:2D42 A2 01
|
|
cpy #$30 ; CPU:$ED44 PRG:2D44 C0 30
|
|
beq HandleEnemyType80_Loop5 ; CPU:$ED46 PRG:2D46 F0 08
|
|
cpy #$D0 ; CPU:$ED48 PRG:2D48 C0 D0
|
|
bne HandleEnemyType80_OnNonzero ; CPU:$ED4A PRG:2D4A D0 A6
|
|
lda #$10 ; CPU:$ED4C PRG:2D4C A9 10
|
|
ldx #$02 ; CPU:$ED4E PRG:2D4E A2 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyType80_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyType80_Loop5:
|
|
tay ; CPU:$ED50 PRG:2D50 A8
|
|
lda $04CD,x ; CPU:$ED51 PRG:2D51 BD CD 04
|
|
bne HandleEnemyType80_OnNonzero ; CPU:$ED54 PRG:2D54 D0 9C
|
|
lda #$01 ; CPU:$ED56 PRG:2D56 A9 01
|
|
stx $04CC ; CPU:$ED58 PRG:2D58 8E CC 04
|
|
tya ; CPU:$ED5B PRG:2D5B 98
|
|
sta $04C6 ; CPU:$ED5C PRG:2D5C 8D C6 04
|
|
lda #$00 ; CPU:$ED5F PRG:2D5F A9 00
|
|
sta $04C5 ; CPU:$ED61 PRG:2D61 8D C5 04
|
|
sta ZpB1 ; CPU:$ED64 PRG:2D64 85 B1
|
|
lda #$80 ; CPU:$ED66 PRG:2D66 A9 80
|
|
sta ZpC1 ; CPU:$ED68 PRG:2D68 85 C1
|
|
bne HandleEnemyType80_OnNonzero ; CPU:$ED6A PRG:2D6A D0 86
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyType80_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyType80_Loop6:
|
|
dec ZpC1 ; CPU:$ED6C PRG:2D6C C6 C1
|
|
beq CheckEnemyFlags_Loop ; CPU:$ED6E PRG:2D6E F0 3C
|
|
lda ZpC1 ; CPU:$ED70 PRG:2D70 A5 C1
|
|
ldy #$6A ; CPU:$ED72 PRG:2D72 A0 6A
|
|
cmp #$20 ; CPU:$ED74 PRG:2D74 C9 20
|
|
beq HandleEnemyType80_Loop7 ; CPU:$ED76 PRG:2D76 F0 24
|
|
cmp #$40 ; CPU:$ED78 PRG:2D78 C9 40
|
|
bne CheckEnemyFlags ; CPU:$ED7A PRG:2D7A D0 2D
|
|
lda ActorTileIndex ; CPU:$ED7C PRG:2D7C A5 B8
|
|
clc ; CPU:$ED7E PRG:2D7E 18
|
|
adc #$07 ; CPU:$ED7F PRG:2D7F 69 07
|
|
sta $02B0 ; CPU:$ED81 PRG:2D81 8D B0 02
|
|
sta $02B4 ; CPU:$ED84 PRG:2D84 8D B4 02
|
|
lda #$03 ; CPU:$ED87 PRG:2D87 A9 03
|
|
sta $02B2 ; CPU:$ED89 PRG:2D89 8D B2 02
|
|
sta $02B6 ; CPU:$ED8C PRG:2D8C 8D B6 02
|
|
lda ScrollX ; CPU:$ED8F PRG:2D8F A5 B9
|
|
sta $02B7 ; CPU:$ED91 PRG:2D91 8D B7 02
|
|
sec ; CPU:$ED94 PRG:2D94 38
|
|
sbc #$08 ; CPU:$ED95 PRG:2D95 E9 08
|
|
sta $02B3 ; CPU:$ED97 PRG:2D97 8D B3 02
|
|
ldy #$68 ; CPU:$ED9A PRG:2D9A A0 68
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: HandleEnemyType80_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
HandleEnemyType80_Loop7:
|
|
sty $02B1 ; CPU:$ED9C PRG:2D9C 8C B1 02
|
|
iny ; CPU:$ED9F PRG:2D9F C8
|
|
sty $02B5 ; CPU:$EDA0 PRG:2DA0 8C B5 02
|
|
lda ZpFE ; CPU:$EDA3 PRG:2DA3 A5 FE
|
|
ora #$04 ; CPU:$EDA5 PRG:2DA5 09 04
|
|
sta ZpFE ; CPU:$EDA7 PRG:2DA7 85 FE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEDA9
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyFlags:
|
|
jmp CheckEnemyCollision ; CPU:$EDA9 PRG:2DA9 4C BF C6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyFlags_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyFlags_Loop:
|
|
lda Zp21 ; CPU:$EDAC PRG:2DAC A5 21
|
|
bne CheckEnemyFlags_Loop3 ; CPU:$EDAE PRG:2DAE D0 37
|
|
lda Zp75 ; CPU:$EDB0 PRG:2DB0 A5 75
|
|
ora Zp7A ; CPU:$EDB2 PRG:2DB2 05 7A
|
|
bne CheckEnemyFlags_Loop3 ; CPU:$EDB4 PRG:2DB4 D0 31
|
|
sta $04CA ; CPU:$EDB6 PRG:2DB6 8D CA 04
|
|
ldy #$04 ; CPU:$EDB9 PRG:2DB9 A0 04
|
|
jsr InitSpritesOffscreen ; CPU:$EDBB PRG:2DBB 20 C4 DF
|
|
jsr ComputeActorTableOffsetB ; CPU:$EDBE PRG:2DBE 20 50 EF
|
|
lda #$01 ; CPU:$EDC1 PRG:2DC1 A9 01
|
|
sta $04C5 ; CPU:$EDC3 PRG:2DC3 8D C5 04
|
|
ldx $04CC ; CPU:$EDC6 PRG:2DC6 AE CC 04
|
|
sta $04CD,x ; CPU:$EDC9 PRG:2DC9 9D CD 04
|
|
lda $04CD ; CPU:$EDCC PRG:2DCC AD CD 04
|
|
and $04CE ; CPU:$EDCF PRG:2DCF 2D CE 04
|
|
and $04CF ; CPU:$EDD2 PRG:2DD2 2D CF 04
|
|
bne CheckEnemyFlags_Loop2 ; CPU:$EDD5 PRG:2DD5 D0 06
|
|
jsr StartEnemyStage ; CPU:$EDD7 PRG:2DD7 20 AF EC
|
|
jmp CheckEnemyFlags ; CPU:$EDDA PRG:2DDA 4C A9 ED
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyFlags_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyFlags_Loop2:
|
|
lda #$00 ; CPU:$EDDD PRG:2DDD A9 00
|
|
sta $04C0 ; CPU:$EDDF PRG:2DDF 8D C0 04
|
|
sta ZpB0 ; CPU:$EDE2 PRG:2DE2 85 B0
|
|
jmp RunEnemyScriptB ; CPU:$EDE4 PRG:2DE4 4C 5A C7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckEnemyFlags_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckEnemyFlags_Loop3:
|
|
inc ZpC1 ; CPU:$EDE7 PRG:2DE7 E6 C1
|
|
bne CheckEnemyFlags ; CPU:$EDE9 PRG:2DE9 D0 BE
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEDEB
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageTimer:
|
|
lda $04C5 ; CPU:$EDEB PRG:2DEB AD C5 04
|
|
bne CheckStageTimer_Loop ; CPU:$EDEE PRG:2DEE D0 01
|
|
rts ; CPU:$EDF0 PRG:2DF0 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageTimer_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageTimer_Loop:
|
|
lda $04CA ; CPU:$EDF1 PRG:2DF1 AD CA 04
|
|
beq CheckStageTimer_Loop3 ; CPU:$EDF4 PRG:2DF4 F0 29
|
|
dec $04CA ; CPU:$EDF6 PRG:2DF6 CE CA 04
|
|
lda $02B3 ; CPU:$EDF9 PRG:2DF9 AD B3 02
|
|
beq CheckStageTimer_Loop2 ; CPU:$EDFC PRG:2DFC F0 20
|
|
cmp #$40 ; CPU:$EDFE PRG:2DFE C9 40
|
|
beq CheckStageTimer_Loop2 ; CPU:$EE00 PRG:2E00 F0 1C
|
|
cmp #$A0 ; CPU:$EE02 PRG:2E02 C9 A0
|
|
beq CheckStageTimer_Loop2 ; CPU:$EE04 PRG:2E04 F0 18
|
|
dec $02B3 ; CPU:$EE06 PRG:2E06 CE B3 02
|
|
dec $02B3 ; CPU:$EE09 PRG:2E09 CE B3 02
|
|
dec $02B7 ; CPU:$EE0C PRG:2E0C CE B7 02
|
|
dec $02B7 ; CPU:$EE0F PRG:2E0F CE B7 02
|
|
inc $02BB ; CPU:$EE12 PRG:2E12 EE BB 02
|
|
inc $02BB ; CPU:$EE15 PRG:2E15 EE BB 02
|
|
inc $02BF ; CPU:$EE18 PRG:2E18 EE BF 02
|
|
inc $02BF ; CPU:$EE1B PRG:2E1B EE BF 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageTimer_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageTimer_Loop2:
|
|
rts ; CPU:$EE1E PRG:2E1E 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageTimer_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageTimer_Loop3:
|
|
ldx $04C6 ; CPU:$EE1F PRG:2E1F AE C6 04
|
|
lda $EE53,x ; CPU:$EE22 PRG:2E22 BD 53 EE
|
|
beq CheckStageTimer_Loop4 ; CPU:$EE25 PRG:2E25 F0 19
|
|
sta $04C9 ; CPU:$EE27 PRG:2E27 8D C9 04
|
|
inx ; CPU:$EE2A PRG:2E2A E8
|
|
lda $EE53,x ; CPU:$EE2B PRG:2E2B BD 53 EE
|
|
sta $04C8 ; CPU:$EE2E PRG:2E2E 8D C8 04
|
|
lda #$01 ; CPU:$EE31 PRG:2E31 A9 01
|
|
sta $04C7 ; CPU:$EE33 PRG:2E33 8D C7 04
|
|
inx ; CPU:$EE36 PRG:2E36 E8
|
|
stx $04C6 ; CPU:$EE37 PRG:2E37 8E C6 04
|
|
lda #$08 ; CPU:$EE3A PRG:2E3A A9 08
|
|
sta $04CA ; CPU:$EE3C PRG:2E3C 8D CA 04
|
|
rts ; CPU:$EE3F PRG:2E3F 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageTimer_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageTimer_Loop4:
|
|
lda #$00 ; CPU:$EE40 PRG:2E40 A9 00
|
|
sta $04C5 ; CPU:$EE42 PRG:2E42 8D C5 04
|
|
sta $04C7 ; CPU:$EE45 PRG:2E45 8D C7 04
|
|
lda #$F4 ; CPU:$EE48 PRG:2E48 A9 F4
|
|
ldx #$0F ; CPU:$EE4A PRG:2E4A A2 0F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageTimer_OnNonnegative
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageTimer_OnNonnegative:
|
|
sta $02B0,x ; CPU:$EE4C PRG:2E4C 9D B0 02
|
|
dex ; CPU:$EE4F PRG:2E4F CA
|
|
bpl CheckStageTimer_OnNonnegative ; CPU:$EE50 PRG:2E50 10 FA
|
|
rts ; CPU:$EE52 PRG:2E52 60
|
|
; ---- data $EE53-$EE69 (23 bytes) ----
|
|
; referenced by `lda $EE53,x` at $EE22 (operand $EE53 falls inside this region)
|
|
; referenced by `lda $EE53,x` at $EE2B (operand $EE53 falls inside this region)
|
|
SoundRoutineTable:
|
|
.byte $F7, $63, $F7, $6D, $F7, $7B, $F7, $8B, $00, $F7, $9B, $F7, $A4, $F7, $B3, $00 ; CPU:$EE53 PRG:2E53 F7 63 F7 6D F7 7B F7 8B 00 F7 9B F7 A4 F7 B3 00
|
|
.byte $F7, $C2, $F7, $CB, $F7, $DA, $00 ; CPU:$EE63 PRG:2E63 F7 C2 F7 CB F7 DA 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEE6A
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawStageText:
|
|
lda $04C7 ; CPU:$EE6A PRG:2E6A AD C7 04
|
|
beq DrawStageText_Loop ; CPU:$EE6D PRG:2E6D F0 12
|
|
lda $04C8 ; CPU:$EE6F PRG:2E6F AD C8 04
|
|
sta Zp00 ; CPU:$EE72 PRG:2E72 85 00
|
|
lda $04C9 ; CPU:$EE74 PRG:2E74 AD C9 04
|
|
sta Zp01 ; CPU:$EE77 PRG:2E77 85 01
|
|
jsr WriteVramList ; CPU:$EE79 PRG:2E79 20 00 CE
|
|
lda #$00 ; CPU:$EE7C PRG:2E7C A9 00
|
|
sta $04C7 ; CPU:$EE7E PRG:2E7E 8D C7 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DrawStageText_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DrawStageText_Loop:
|
|
rts ; CPU:$EE81 PRG:2E81 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEE82
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
PushActorState:
|
|
lda Zp00 ; CPU:$EE82 PRG:2E82 A5 00
|
|
pha ; CPU:$EE84 PRG:2E84 48
|
|
lda Zp06 ; CPU:$EE85 PRG:2E85 A5 06
|
|
pha ; CPU:$EE87 PRG:2E87 48
|
|
lda Zp07 ; CPU:$EE88 PRG:2E88 A5 07
|
|
pha ; CPU:$EE8A PRG:2E8A 48
|
|
lda #$10 ; CPU:$EE8B PRG:2E8B A9 10
|
|
sta Zp00 ; CPU:$EE8D PRG:2E8D 85 00
|
|
ldx Zp9F ; CPU:$EE8F PRG:2E8F A6 9F
|
|
lda #$01 ; CPU:$EE91 PRG:2E91 A9 01
|
|
sta Zp9D,x ; CPU:$EE93 PRG:2E93 95 9D
|
|
txa ; CPU:$EE95 PRG:2E95 8A
|
|
sta Zp01 ; CPU:$EE96 PRG:2E96 85 01
|
|
jsr InitZerosIfZp30Zero ; CPU:$EE98 PRG:2E98 20 83 DE
|
|
pla ; CPU:$EE9B PRG:2E9B 68
|
|
sta Zp07 ; CPU:$EE9C PRG:2E9C 85 07
|
|
pla ; CPU:$EE9E PRG:2E9E 68
|
|
sta Zp06 ; CPU:$EE9F PRG:2E9F 85 06
|
|
pla ; CPU:$EEA1 PRG:2EA1 68
|
|
sta Zp00 ; CPU:$EEA2 PRG:2EA2 85 00
|
|
rts ; CPU:$EEA4 PRG:2EA4 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEEA5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateEnemyTile:
|
|
sta ActorTileIndex ; CPU:$EEA5 PRG:2EA5 85 B8
|
|
jsr CheckEnemyTileRangeB ; CPU:$EEA7 PRG:2EA7 20 19 D0
|
|
ldx ZpBE ; CPU:$EEAA PRG:2EAA A6 BE
|
|
rts ; CPU:$EEAC PRG:2EAC 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEEAD
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageScript:
|
|
lda ScriptCommand ; CPU:$EEAD PRG:2EAD A5 35
|
|
cmp #$AA ; CPU:$EEAF PRG:2EAF C9 AA
|
|
bne CheckStageScript_Loop ; CPU:$EEB1 PRG:2EB1 D0 06
|
|
lda ActorYPosition ; CPU:$EEB3 PRG:2EB3 A5 45
|
|
cmp #$04 ; CPU:$EEB5 PRG:2EB5 C9 04
|
|
bcc CheckStageScript_Loop2 ; CPU:$EEB7 PRG:2EB7 90 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageScript_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageScript_Loop:
|
|
pla ; CPU:$EEB9 PRG:2EB9 68
|
|
pla ; CPU:$EEBA PRG:2EBA 68
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckStageScript_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckStageScript_Loop2:
|
|
rts ; CPU:$EEBB PRG:2EBB 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEEBC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AddStageCounter:
|
|
jsr TestRamFlagPair0500 ; CPU:$EEBC PRG:2EBC 20 28 D3
|
|
and #$07 ; CPU:$EEBF PRG:2EBF 29 07
|
|
clc ; CPU:$EEC1 PRG:2EC1 18
|
|
adc $0349 ; CPU:$EEC2 PRG:2EC2 6D 49 03
|
|
sta $0349 ; CPU:$EEC5 PRG:2EC5 8D 49 03
|
|
inc $0348 ; CPU:$EEC8 PRG:2EC8 EE 48 03
|
|
rts ; CPU:$EECB PRG:2ECB 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEECC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SubStageCounter:
|
|
jsr TestRamFlagPair0500 ; CPU:$EECC PRG:2ECC 20 28 D3
|
|
and #$03 ; CPU:$EECF PRG:2ECF 29 03
|
|
sta Zp07 ; CPU:$EED1 PRG:2ED1 85 07
|
|
lda $0349 ; CPU:$EED3 PRG:2ED3 AD 49 03
|
|
sec ; CPU:$EED6 PRG:2ED6 38
|
|
sbc Zp07 ; CPU:$EED7 PRG:2ED7 E5 07
|
|
sta $0349 ; CPU:$EED9 PRG:2ED9 8D 49 03
|
|
dec $0348 ; CPU:$EEDC PRG:2EDC CE 48 03
|
|
dec $0348 ; CPU:$EEDF PRG:2EDF CE 48 03
|
|
rts ; CPU:$EEE2 PRG:2EE2 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEEE3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpeed:
|
|
sta Zp1E ; CPU:$EEE3 PRG:2EE3 85 1E
|
|
txa ; CPU:$EEE5 PRG:2EE5 8A
|
|
sec ; CPU:$EEE6 PRG:2EE6 38
|
|
ldx $04D5 ; CPU:$EEE7 PRG:2EE7 AE D5 04
|
|
beq SetEnemySpeed_Loop ; CPU:$EEEA PRG:2EEA F0 02
|
|
sbc #$08 ; CPU:$EEEC PRG:2EEC E9 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemySpeed_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpeed_Loop:
|
|
sbc #$18 ; CPU:$EEEE PRG:2EEE E9 18
|
|
sta $02E8,x ; CPU:$EEF0 PRG:2EF0 9D E8 02
|
|
sta $02EC,x ; CPU:$EEF3 PRG:2EF3 9D EC 02
|
|
tya ; CPU:$EEF6 PRG:2EF6 98
|
|
sec ; CPU:$EEF7 PRG:2EF7 38
|
|
sbc #$08 ; CPU:$EEF8 PRG:2EF8 E9 08
|
|
sta $02EB,x ; CPU:$EEFA PRG:2EFA 9D EB 02
|
|
tya ; CPU:$EEFD PRG:2EFD 98
|
|
sta $02EF,x ; CPU:$EEFE PRG:2EFE 9D EF 02
|
|
ldy Zp1E ; CPU:$EF01 PRG:2F01 A4 1E
|
|
lda $EF97,y ; CPU:$EF03 PRG:2F03 B9 97 EF
|
|
sta $02E9,x ; CPU:$EF06 PRG:2F06 9D E9 02
|
|
lda #$45 ; CPU:$EF09 PRG:2F09 A9 45
|
|
sta $02ED,x ; CPU:$EF0B PRG:2F0B 9D ED 02
|
|
ldy #$03 ; CPU:$EF0E PRG:2F0E A0 03
|
|
lda Zp11 ; CPU:$EF10 PRG:2F10 A5 11
|
|
beq SetEnemySpeed_Loop2 ; CPU:$EF12 PRG:2F12 F0 02
|
|
ldy #$02 ; CPU:$EF14 PRG:2F14 A0 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemySpeed_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpeed_Loop2:
|
|
tya ; CPU:$EF16 PRG:2F16 98
|
|
sta $02EA,x ; CPU:$EF17 PRG:2F17 9D EA 02
|
|
sta $02EE,x ; CPU:$EF1A PRG:2F1A 9D EE 02
|
|
ldx #$00 ; CPU:$EF1D PRG:2F1D A2 00
|
|
ldy #$08 ; CPU:$EF1F PRG:2F1F A0 08
|
|
lda $04D5 ; CPU:$EF21 PRG:2F21 AD D5 04
|
|
beq SetEnemySpeed_Loop3 ; CPU:$EF24 PRG:2F24 F0 03
|
|
inx ; CPU:$EF26 PRG:2F26 E8
|
|
ldy #$00 ; CPU:$EF27 PRG:2F27 A0 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetEnemySpeed_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetEnemySpeed_Loop3:
|
|
lda #$40 ; CPU:$EF29 PRG:2F29 A9 40
|
|
sta $04D6,x ; CPU:$EF2B PRG:2F2B 9D D6 04
|
|
sty $04D5 ; CPU:$EF2E PRG:2F2E 8C D5 04
|
|
rts ; CPU:$EF31 PRG:2F31 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEF32
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyCounter:
|
|
ldx #$00 ; CPU:$EF32 PRG:2F32 A2 00
|
|
ldy #$00 ; CPU:$EF34 PRG:2F34 A0 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyCounter_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyCounter_OnNonzero:
|
|
lda $04D6,x ; CPU:$EF36 PRG:2F36 BD D6 04
|
|
beq DecEnemyCounter_Loop ; CPU:$EF39 PRG:2F39 F0 0D
|
|
dec $04D6,x ; CPU:$EF3B PRG:2F3B DE D6 04
|
|
bne DecEnemyCounter_Loop ; CPU:$EF3E PRG:2F3E D0 08
|
|
lda #$F4 ; CPU:$EF40 PRG:2F40 A9 F4
|
|
sta $02E8,y ; CPU:$EF42 PRG:2F42 99 E8 02
|
|
sta $02EC,y ; CPU:$EF45 PRG:2F45 99 EC 02
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecEnemyCounter_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecEnemyCounter_Loop:
|
|
ldy #$08 ; CPU:$EF48 PRG:2F48 A0 08
|
|
inx ; CPU:$EF4A PRG:2F4A E8
|
|
cpx #$02 ; CPU:$EF4B PRG:2F4B E0 02
|
|
bne DecEnemyCounter_OnNonzero ; CPU:$EF4D PRG:2F4D D0 E7
|
|
rts ; CPU:$EF4F PRG:2F4F 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCEF50
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeActorTableOffsetB:
|
|
lda $04CC ; CPU:$EF50 PRG:2F50 AD CC 04
|
|
asl a ; CPU:$EF53 PRG:2F53 0A
|
|
asl a ; CPU:$EF54 PRG:2F54 0A
|
|
asl a ; CPU:$EF55 PRG:2F55 0A
|
|
asl a ; CPU:$EF56 PRG:2F56 0A
|
|
tax ; CPU:$EF57 PRG:2F57 AA
|
|
ldy #$00 ; CPU:$EF58 PRG:2F58 A0 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ComputeActorTableOffsetB_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeActorTableOffsetB_OnNonzero:
|
|
lda $EF67,x ; CPU:$EF5A PRG:2F5A BD 67 EF
|
|
sta $02B0,y ; CPU:$EF5D PRG:2F5D 99 B0 02
|
|
inx ; CPU:$EF60 PRG:2F60 E8
|
|
iny ; CPU:$EF61 PRG:2F61 C8
|
|
cpy #$10 ; CPU:$EF62 PRG:2F62 C0 10
|
|
bne ComputeActorTableOffsetB_OnNonzero ; CPU:$EF64 PRG:2F64 D0 F4
|
|
rts ; CPU:$EF66 PRG:2F66 60
|
|
; ---- data $EF67-$F8A6 (2368 bytes) ----
|
|
; referenced by `lda $F4B2,y` at $CEA5 (operand $F4B2 falls inside this region)
|
|
; referenced by `lda $F4B2,y` at $CEB2 (operand $F4B2 falls inside this region)
|
|
; referenced by `cmp $F574,x` at $CF8D (operand $F574 falls inside this region)
|
|
; referenced by `cmp $F574,x` at $CF95 (operand $F574 falls inside this region)
|
|
; referenced by `lda $F68D,y` at $D04F (operand $F68D falls inside this region)
|
|
; referenced by `lda $F68D,y` at $D059 (operand $F68D falls inside this region)
|
|
; ... and 23 further references from decoded code
|
|
GraphicsDataBlock:
|
|
.byte $77, $8A, $03, $70, $77, $8B, $03, $78, $77, $8B, $43, $80, $77, $8A, $43, $88 ; CPU:$EF67 PRG:2F67 77 8A 03 70 77 8B 03 78 77 8B 43 80 77 8A 43 88
|
|
.byte $A7, $8A, $03, $20, $A7, $8B, $03, $28, $A7, $8B, $43, $30, $A7, $8A, $43, $38 ; CPU:$EF77 PRG:2F77 A7 8A 03 20 A7 8B 03 28 A7 8B 43 30 A7 8A 43 38
|
|
.byte $A7, $8A, $03, $C0, $A7, $8B, $03, $C8, $A7, $8B, $43, $D0, $A7, $8A, $43, $D8 ; CPU:$EF87 PRG:2F87 A7 8A 03 C0 A7 8B 03 C8 A7 8B 43 D0 A7 8A 43 D8
|
|
.byte $40, $42, $43, $44, $3E, $3F, $9C, $00, $9D, $00, $9F, $00, $00, $9D, $00, $9B ; CPU:$EF97 PRG:2F97 40 42 43 44 3E 3F 9C 00 9D 00 9F 00 00 9D 00 9B
|
|
.byte $00, $00, $92, $00, $00, $93, $00, $00, $94, $00, $00, $95, $00, $92, $00, $93 ; CPU:$EFA7 PRG:2FA7 00 00 92 00 00 93 00 00 94 00 00 95 00 92 00 93
|
|
.byte $00, $94, $00, $FF, $01, $01, $03, $01, $3D, $07, $92, $02, $F4, $00, $04, $00 ; CPU:$EFB7 PRG:2FB7 00 94 00 FF 01 01 03 01 3D 07 92 02 F4 00 04 00
|
|
.byte $00, $00, $00, $B0, $00, $01, $00, $00, $00, $01, $00, $00, $00, $00, $00, $00 ; CPU:$EFC7 PRG:2FC7 00 00 00 B0 00 01 00 00 00 01 00 00 00 00 00 00
|
|
.byte $00, $00, $04, $04, $9C, $00, $9D, $00, $9F, $00, $9C, $00, $9D, $00, $9F, $00 ; CPU:$EFD7 PRG:2FD7 00 00 04 04 9C 00 9D 00 9F 00 9C 00 9D 00 9F 00
|
|
.byte $9C, $00, $9D, $00, $9F, $00, $9C, $00, $9D, $00, $9F, $00, $9C, $00, $9D, $00 ; CPU:$EFE7 PRG:2FE7 9C 00 9D 00 9F 00 9C 00 9D 00 9F 00 9C 00 9D 00
|
|
.byte $9F, $00, $9C, $00, $9D, $00, $9F, $00, $9C, $00, $9D, $00, $9B, $00, $FF, $9B ; CPU:$EFF7 PRG:2FF7 9F 00 9C 00 9D 00 9F 00 9C 00 9D 00 9B 00 FF 9B
|
|
.byte $00, $9C, $00, $9D, $00, $00, $9E, $00, $9F, $00, $9C, $00, $9D, $00, $00, $9E ; CPU:$F007 PRG:3007 00 9C 00 9D 00 00 9E 00 9F 00 9C 00 9D 00 00 9E
|
|
.byte $00, $9F, $00, $FF, $00, $00, $FF, $FF, $DD, $FF, $FE, $FE, $FD, $FE, $FE, $FF ; CPU:$F017 PRG:3017 00 9F 00 FF 00 00 FF FF DD FF FE FE FD FE FE FF
|
|
.byte $FF, $00, $FF, $00, $FF, $00, $00, $00, $01, $00, $01, $00, $01, $01, $02, $02 ; CPU:$F027 PRG:3027 FF 00 FF 00 FF 00 00 00 01 00 01 00 01 01 02 02
|
|
.byte $03, $02, $02, $01, $CC, $01, $01, $00, $00, $BB, $00, $00, $FF, $00, $FF, $FF ; CPU:$F037 PRG:3037 03 02 02 01 CC 01 01 00 00 BB 00 00 FF 00 FF FF
|
|
.byte $DD, $FF, $FE, $FF, $FF, $FF, $FF, $00, $00, $00, $01, $01, $01, $02, $02, $01 ; CPU:$F047 PRG:3047 DD FF FE FF FF FF FF 00 00 00 01 01 01 02 02 01
|
|
.byte $01, $CC, $01, $00, $01, $00, $00, $BB, $00, $AA, $01, $01, $00, $01, $3D, $07 ; CPU:$F057 PRG:3057 01 CC 01 00 01 00 00 BB 00 AA 01 01 00 01 3D 07
|
|
.byte $92, $01, $F4, $00, $00, $00, $00, $00, $00, $A0, $00, $80, $00, $00, $00, $00 ; CPU:$F067 PRG:3067 92 01 F4 00 00 00 00 00 00 A0 00 80 00 00 00 00
|
|
.byte $00, $00, $00, $00, $00, $00, $00, $00, $04, $04, $28, $1E, $0A, $05, $0F, $0A ; CPU:$F077 PRG:3077 00 00 00 00 00 00 00 00 04 04 28 1E 0A 05 0F 0A
|
|
.byte $07, $03, $32, $32, $28, $26, $1E, $1E, $1C, $12, $28, $28, $1C, $12, $1C, $1C ; CPU:$F087 PRG:3087 07 03 32 32 28 26 1E 1E 1C 12 28 28 1C 12 1C 1C
|
|
.byte $12, $0A, $1E, $14, $14, $12, $14, $12, $0A, $08, $CC, $9C, $6C, $3C, $20, $83 ; CPU:$F097 PRG:3097 12 0A 1E 14 14 12 14 12 0A 08 CC 9C 6C 3C 20 83
|
|
.byte $02, $76, $7A, $20, $A3, $02, $77, $79, $20, $9A, $02, $7C, $7E, $20, $BA, $02 ; CPU:$F0A7 PRG:30A7 02 76 7A 20 A3 02 77 79 20 9A 02 7C 7E 20 BA 02
|
|
.byte $7D, $7F, $21, $63, $02, $80, $82, $21, $83, $02, $81, $83, $21, $7A, $02, $84 ; CPU:$F0B7 PRG:30B7 7D 7F 21 63 02 80 82 21 83 02 81 83 21 7A 02 84
|
|
.byte $86, $21, $9A, $02, $85, $87, $20, $85, $4A, $7B, $20, $90, $4A, $7B, $21, $85 ; CPU:$F0C7 PRG:30C7 86 21 9A 02 85 87 20 85 4A 7B 20 90 4A 7B 21 85
|
|
.byte $4A, $89, $21, $90, $4A, $89, $20, $C3, $19, $78, $24, $24, $68, $69, $69, $6B ; CPU:$F0D7 PRG:30D7 4A 89 21 90 4A 89 20 C3 19 78 24 24 68 69 69 6B
|
|
.byte $69, $68, $69, $68, $6B, $69, $24, $68, $69, $68, $69, $6B, $69, $6B, $69, $24 ; CPU:$F0E7 PRG:30E7 69 68 69 68 6B 69 24 68 69 68 69 6B 69 6B 69 24
|
|
.byte $24, $88, $20, $E6, $13, $68, $6A, $6A, $6E, $6A, $68, $6A, $68, $6E, $6A, $24 ; CPU:$F0F7 PRG:30F7 24 88 20 E6 13 68 6A 6A 6E 6A 68 6A 68 6E 6A 24
|
|
.byte $68, $6A, $68, $6A, $6E, $6A, $6E, $71, $21, $06, $13, $68, $6A, $6A, $68, $6C ; CPU:$F107 PRG:3107 68 6A 68 6A 6E 6A 6E 71 21 06 13 68 6A 6A 68 6C
|
|
.byte $68, $6D, $68, $6E, $6A, $24, $68, $6D, $68, $6D, $6E, $6A, $6F, $69, $21, $26 ; CPU:$F117 PRG:3117 68 6D 68 6E 6A 24 68 6D 68 6D 6E 6A 6F 69 21 26
|
|
.byte $13, $68, $6A, $6A, $6E, $6A, $68, $6A, $68, $6E, $6A, $24, $68, $6A, $68, $6A ; CPU:$F127 PRG:3127 13 68 6A 6A 6E 6A 68 6A 68 6E 6A 24 68 6A 68 6A
|
|
.byte $6E, $6A, $72, $6A, $21, $43, $19, $78, $24, $24, $68, $6A, $6A, $6E, $6A, $68 ; CPU:$F137 PRG:3137 6E 6A 72 6A 21 43 19 78 24 24 68 6A 6A 6E 6A 68
|
|
.byte $6A, $68, $6F, $70, $24, $68, $70, $68, $6A, $6F, $70, $6F, $70, $73, $24, $88 ; CPU:$F147 PRG:3147 6A 68 6F 70 24 68 70 68 6A 6F 70 6F 70 73 24 88
|
|
.byte $22, $09, $0F, $01, $24, $19, $15, $0A, $22, $0E, $1B, $24, $10, $0A, $16, $0E ; CPU:$F157 PRG:3157 22 09 0F 01 24 19 15 0A 22 0E 1B 24 10 0A 16 0E
|
|
.byte $24, $0A, $22, $49, $0F, $01, $24, $19, $15, $0A, $22, $0E, $1B, $24, $10, $0A ; CPU:$F167 PRG:3167 24 0A 22 49 0F 01 24 19 15 0A 22 0E 1B 24 10 0A
|
|
.byte $16, $0E, $24, $0B, $22, $89, $0F, $02, $24, $19, $15, $0A, $22, $0E, $1B, $24 ; CPU:$F177 PRG:3177 16 0E 24 0B 22 89 0F 02 24 19 15 0A 22 0E 1B 24
|
|
.byte $10, $0A, $16, $0E, $24, $0A, $22, $C9, $0F, $02, $24, $19, $15, $0A, $22, $0E ; CPU:$F187 PRG:3187 10 0A 16 0E 24 0A 22 C9 0F 02 24 19 15 0A 22 0E
|
|
.byte $1B, $24, $10, $0A, $16, $0E, $24, $0B, $23, $05, $16, $25, $01, $09, $08, $03 ; CPU:$F197 PRG:3197 1B 24 10 0A 16 0E 24 0B 23 05 16 25 01 09 08 03
|
|
.byte $24, $17, $12, $17, $1D, $0E, $17, $0D, $18, $24, $0C, $18, $28, $15, $1D, $0D ; CPU:$F1A7 PRG:31A7 24 17 12 17 1D 0E 17 0D 18 24 0C 18 28 15 1D 0D
|
|
.byte $26, $23, $4B, $0D, $16, $0A, $0D, $0E, $24, $12, $17, $24, $13, $0A, $19, $0A ; CPU:$F1B7 PRG:31B7 26 23 4B 0D 16 0A 0D 0E 24 12 17 24 13 0A 19 0A
|
|
.byte $17, $23, $C8, $0F, $AA, $2A, $0A, $0A, $0A, $0A, $8A, $00, $FF, $30, $00, $00 ; CPU:$F1C7 PRG:31C7 17 23 C8 0F AA 2A 0A 0A 0A 0A 8A 00 FF 30 00 00
|
|
.byte $00, $00, $C0, $23, $D8, $48, $FF, $23, $E0, $50, $55, $23, $F0, $48, $AA, $00 ; CPU:$F1D7 PRG:31D7 00 00 C0 23 D8 48 FF 23 E0 50 55 23 F0 48 AA 00
|
|
.byte $21, $20, $4E, $21, $32, $4E, $21, $E8, $50, $22, $00, $44, $22, $1C, $44, $22 ; CPU:$F1E7 PRG:31E7 21 20 4E 21 32 4E 21 E8 50 22 00 44 22 1C 44 22
|
|
.byte $A0, $4C, $22, $B4, $4C, $00, $23, $60, $60, $23, $80, $60, $3F, $00, $20, $0F ; CPU:$F1F7 PRG:31F7 A0 4C 22 B4 4C 00 23 60 60 23 80 60 3F 00 20 0F
|
|
.byte $30, $2C, $12, $0F, $30, $29, $09, $0F, $30, $27, $18, $0F, $30, $26, $06, $0F ; CPU:$F207 PRG:3207 30 2C 12 0F 30 29 09 0F 30 27 18 0F 30 26 06 0F
|
|
.byte $16, $37, $12, $0F, $30, $27, $19, $0F, $30, $27, $16, $0F, $2C, $12, $25, $00 ; CPU:$F217 PRG:3217 16 37 12 0F 30 27 19 0F 30 27 16 0F 2C 12 25 00
|
|
.byte $3F, $00, $14, $0F, $16, $16, $16, $0F, $27, $27, $27, $0F, $30, $2C, $12, $0F ; CPU:$F227 PRG:3227 3F 00 14 0F 16 16 16 0F 27 27 27 0F 30 2C 12 0F
|
|
.byte $30, $29, $19, $0F, $35, $35, $35, $00, $23, $C0, $10, $00, $00, $C0, $30, $00 ; CPU:$F237 PRG:3237 30 29 19 0F 35 35 35 00 23 C0 10 00 00 C0 30 00
|
|
.byte $50, $00, $00, $55, $55, $00, $00, $00, $00, $55, $55, $23, $F0, $10, $F5, $FF ; CPU:$F247 PRG:3247 50 00 00 55 55 00 00 00 00 55 55 23 F0 10 F5 FF
|
|
.byte $FF, $FF, $FF, $FF, $FF, $F5, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $00, $23 ; CPU:$F257 PRG:3257 FF FF FF FF FF F5 FF FF FF FF FF FF FF FF 00 23
|
|
.byte $D0, $58, $00, $23, $E8, $08, $50, $00, $00, $00, $00, $00, $00, $50, $00, $23 ; CPU:$F267 PRG:3267 D0 58 00 23 E8 08 50 00 00 00 00 00 00 50 00 23
|
|
.byte $D0, $58, $AA, $23, $E8, $08, $5A, $AA, $AA, $00, $00, $AA, $AA, $5A, $00, $23 ; CPU:$F277 PRG:3277 D0 58 AA 23 E8 08 5A AA AA 00 00 AA AA 5A 00 23
|
|
.byte $D0, $58, $FF, $23, $E8, $08, $5F, $FF, $FF, $00, $00, $FF, $FF, $5F, $00, $A6 ; CPU:$F287 PRG:3287 D0 58 FF 23 E8 08 5F FF FF 00 00 FF FF 5F 00 A6
|
|
.byte $F2, $B9, $F2, $C6, $F2, $C6, $F2, $D0, $F2, $DA, $F2, $E1, $F2, $E8, $F2, $00 ; CPU:$F297 PRG:3297 F2 B9 F2 C6 F2 C6 F2 D0 F2 DA F2 E1 F2 E8 F2 00
|
|
.byte $EF, $F8, $00, $EF, $00, $00, $F7, $F8, $00, $F7, $00, $00, $00, $F8, $00, $00 ; CPU:$F2A7 PRG:32A7 EF F8 00 EF 00 00 F7 F8 00 F7 00 00 00 F8 00 00
|
|
.byte $00, $AA, $00, $F7, $F8, $00, $F7, $00, $00, $00, $F8, $00, $00, $00, $AA, $80 ; CPU:$F2B7 PRG:32B7 00 AA 00 F7 F8 00 F7 00 00 00 F8 00 00 00 AA 80
|
|
.byte $F7, $F8, $01, $F7, $00, $00, $00, $FC, $AA, $00, $F7, $FC, $80, $00, $F8, $01 ; CPU:$F2C7 PRG:32C7 F7 F8 01 F7 00 00 00 FC AA 00 F7 FC 80 00 F8 01
|
|
.byte $00, $00, $AA, $00, $F7, $FC, $00, $00, $FC, $AA, $00, $F7, $F8, $00, $00, $FC ; CPU:$F2D7 PRG:32D7 00 00 AA 00 F7 FC 00 00 FC AA 00 F7 F8 00 00 FC
|
|
.byte $AA, $00, $FC, $FC, $AA, $01, $00, $03, $00, $00, $00, $12, $40, $D0, $44, $10 ; CPU:$F2E7 PRG:32E7 AA 00 FC FC AA 01 00 03 00 00 00 12 40 D0 44 10
|
|
.byte $00, $00, $00, $00, $01, $00, $00, $00, $00, $00, $01, $00, $00, $00, $00, $00 ; CPU:$F2F7 PRG:32F7 00 00 00 00 01 00 00 00 00 00 01 00 00 00 00 00
|
|
.byte $00, $00, $00, $04, $04, $01, $00, $03, $00, $00, $00, $12, $01, $D0, $C4, $28 ; CPU:$F307 PRG:3307 00 00 00 04 04 01 00 03 00 00 00 12 01 D0 C4 28
|
|
.byte $00, $00, $00, $00, $02, $00, $00, $00, $00, $00, $01, $00, $00, $00, $00, $00 ; CPU:$F317 PRG:3317 00 00 00 00 02 00 00 00 00 00 01 00 00 00 00 00
|
|
.byte $00, $00, $00, $04, $04, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; CPU:$F327 PRG:3327 00 00 00 04 04 00 00 00 00 00 00 00 00 00 00 00
|
|
.byte $00, $00, $00, $01, $00, $01, $00, $01, $01, $00, $01, $01, $02, $01, $02, $02 ; CPU:$F337 PRG:3337 00 00 00 01 00 01 00 01 01 00 01 01 02 01 02 02
|
|
.byte $02, $02, $02, $02, $03, $03, $03, $03, $AA, $FC, $FC, $FC, $FC, $FC, $FC, $FC ; CPU:$F347 PRG:3347 02 02 02 02 03 03 03 03 AA FC FC FC FC FC FC FC
|
|
.byte $FD, $FD, $FE, $FE, $FE, $FE, $FE, $FE, $FF, $FE, $FF, $FF, $FF, $00, $FF, $FF ; CPU:$F357 PRG:3357 FD FD FE FE FE FE FE FE FF FE FF FF FF 00 FF FF
|
|
.byte $00, $FF, $00, $00, $00, $AA, $FE, $FE, $FE, $FF, $FF, $FF, $FF, $FF, $00, $FF ; CPU:$F367 PRG:3367 00 FF 00 00 00 AA FE FE FE FF FF FF FF FF 00 FF
|
|
.byte $00, $FF, $00, $AA, $00, $01, $00, $01, $00, $01, $01, $01, $02, $01, $01, $02 ; CPU:$F377 PRG:3377 00 FF 00 AA 00 01 00 01 00 01 01 01 02 01 01 02
|
|
.byte $03, $03, $04, $04, $CC, $04, $CC, $CC, $CC, $04, $CC, $AA, $01, $03, $00, $01 ; CPU:$F387 PRG:3387 03 03 04 04 CC 04 CC CC CC 04 CC AA 01 03 00 01
|
|
.byte $02, $00, $01, $01, $00, $AA, $01, $03, $00, $01, $02, $00, $01, $01, $FF, $AA ; CPU:$F397 PRG:3397 02 00 01 01 00 AA 01 03 00 01 02 00 01 01 FF AA
|
|
.byte $01, $02, $00, $01, $01, $FF, $01, $01, $FF, $01, $01, $00, $01, $01, $00, $01 ; CPU:$F3A7 PRG:33A7 01 02 00 01 01 FF 01 01 FF 01 01 00 01 01 00 01
|
|
.byte $01, $01, $AA, $D2, $F3, $D9, $F3, $E4, $F3, $ED, $F3, $FA, $F3, $03, $F4, $0E ; CPU:$F3B7 PRG:33B7 01 01 AA D2 F3 D9 F3 E4 F3 ED F3 FA F3 03 F4 0E
|
|
.byte $F4, $19, $F4, $24, $F4, $31, $F4, $3E, $F4, $49, $F4, $05, $00, $12, $00, $1F ; CPU:$F3C7 PRG:33C7 F4 19 F4 24 F4 31 F4 3E F4 49 F4 05 00 12 00 1F
|
|
.byte $00, $AA, $05, $00, $12, $00, $1F, $00, $19, $00, $1F, $00, $AA, $05, $01, $0C ; CPU:$F3D7 PRG:33D7 00 AA 05 00 12 00 1F 00 19 00 1F 00 AA 05 01 0C
|
|
.byte $01, $2B, $01, $0C, $01, $AA, $03, $01, $0C, $01, $31, $00, $06, $00, $49, $01 ; CPU:$F3E7 PRG:33E7 01 2B 01 0C 01 AA 03 01 0C 01 31 00 06 00 49 01
|
|
.byte $07, $01, $AA, $0C, $02, $0C, $02, $31, $02, $0C, $02, $AA, $0C, $02, $0C, $02 ; CPU:$F3F7 PRG:33F7 07 01 AA 0C 02 0C 02 31 02 0C 02 AA 0C 02 0C 02
|
|
.byte $31, $01, $06, $01, $31, $02, $AA, $03, $00, $0C, $00, $31, $02, $06, $00, $31 ; CPU:$F407 PRG:3407 31 01 06 01 31 02 AA 03 00 0C 00 31 02 06 00 31
|
|
.byte $00, $AA, $03, $01, $0C, $01, $31, $02, $06, $01, $31, $01, $AA, $0C, $02, $0C ; CPU:$F417 PRG:3417 00 AA 03 01 0C 01 31 02 06 01 31 01 AA 0C 02 0C
|
|
.byte $01, $31, $01, $06, $01, $31, $02, $12, $01, $AA, $03, $01, $0C, $01, $31, $01 ; CPU:$F427 PRG:3427 01 31 01 06 01 31 02 12 01 AA 03 01 0C 01 31 01
|
|
.byte $06, $02, $31, $02, $12, $01, $AA, $03, $00, $0C, $00, $31, $01, $06, $00, $06 ; CPU:$F437 PRG:3437 06 02 31 02 12 01 AA 03 00 0C 00 31 01 06 00 06
|
|
.byte $00, $AA, $01, $00, $05, $00, $40, $00, $FF, $00, $AA, $01, $00, $03, $00, $0A ; CPU:$F447 PRG:3447 00 AA 01 00 05 00 40 00 FF 00 AA 01 00 03 00 0A
|
|
.byte $06, $52, $21, $28, $00, $00, $00, $4C, $F6, $00, $10, $00, $00, $00, $0A, $00 ; CPU:$F457 PRG:3457 06 52 21 28 00 00 00 4C F6 00 10 00 00 00 0A 00
|
|
.byte $01, $00, $00, $00, $00, $00, $00, $00, $00, $04, $06, $01, $00, $03, $00, $10 ; CPU:$F467 PRG:3467 01 00 00 00 00 00 00 00 00 04 06 01 00 03 00 10
|
|
.byte $03, $6C, $22, $28, $00, $00, $04, $4C, $F6, $00, $20, $00, $00, $00, $14, $00 ; CPU:$F477 PRG:3477 03 6C 22 28 00 00 04 4C F6 00 20 00 00 00 14 00
|
|
.byte $01, $00, $00, $00, $00, $00, $00, $00, $00, $05, $06, $01, $00, $03, $00, $24 ; CPU:$F487 PRG:3487 01 00 00 00 00 00 00 00 00 05 06 01 00 03 00 24
|
|
.byte $03, $7D, $20, $28, $00, $00, $08, $4C, $F6, $00, $30, $00, $00, $00, $00, $00 ; CPU:$F497 PRG:3497 03 7D 20 28 00 00 08 4C F6 00 30 00 00 00 00 00
|
|
.byte $01, $00, $00, $00, $00, $00, $00, $00, $00, $05, $06, $06, $0C, $00, $0C, $FF ; CPU:$F4A7 PRG:34A7 01 00 00 00 00 00 00 00 00 05 06 06 0C 00 0C FF
|
|
.byte $00, $26, $2C, $FF, $06, $52, $54, $52, $56, $FF, $0A, $6C, $6C, $6F, $6F, $6C ; CPU:$F4B7 PRG:34B7 00 26 2C FF 06 52 54 52 56 FF 0A 6C 6C 6F 6F 6C
|
|
.byte $6C, $72, $72, $FF, $10, $D0, $D0, $D3, $D3, $D0, $D0, $D6, $D6, $FF, $1A, $7D ; CPU:$F4C7 PRG:34C7 6C 72 72 FF 10 D0 D0 D3 D3 D0 D0 D6 D6 FF 1A 7D
|
|
.byte $7D, $80, $80, $83, $83, $FF, $24, $A1, $A3, $A5, $A7, $A9, $FF, $2C, $8C, $8E ; CPU:$F4D7 PRG:34D7 7D 80 80 83 83 FF 24 A1 A3 A5 A7 A9 FF 2C 8C 8E
|
|
.byte $90, $FF, $33, $B4, $B8, $BC, $FF, $38, $92, $93, $94, $95, $FF, $3D, $20, $82 ; CPU:$F4E7 PRG:34E7 90 FF 33 B4 B8 BC FF 38 92 93 94 95 FF 3D 20 82
|
|
.byte $04, $52, $51, $3C, $50, $20, $A0, $06, $41, $57, $56, $55, $47, $54, $20, $C0 ; CPU:$F4F7 PRG:34F7 04 52 51 3C 50 20 A0 06 41 57 56 55 47 54 20 C0
|
|
.byte $06, $46, $5C, $5B, $5A, $4C, $59, $20, $E0, $04, $49, $61, $49, $5F, $20, $9A ; CPU:$F507 PRG:3507 06 46 5C 5B 5A 4C 59 20 E0 04 49 61 49 5F 20 9A
|
|
.byte $04, $39, $3C, $3A, $3B, $20, $BA, $06, $3D, $47, $3E, $3F, $40, $41, $20, $DA ; CPU:$F517 PRG:3517 04 39 3C 3A 3B 20 BA 06 3D 47 3E 3F 40 41 20 DA
|
|
.byte $06, $42, $4C, $43, $44, $45, $46, $20, $FC, $04, $48, $49, $4A, $4B, $22, $E0 ; CPU:$F527 PRG:3527 06 42 4C 43 44 45 46 20 FC 04 48 49 4A 4B 22 E0
|
|
.byte $04, $41, $41, $41, $57, $23, $00, $04, $46, $46, $46, $5C, $23, $20, $04, $4B ; CPU:$F537 PRG:3537 04 41 41 41 57 23 00 04 46 46 46 5C 23 20 04 4B
|
|
.byte $4B, $4B, $61, $22, $FC, $04, $40, $41, $41, $41, $23, $1C, $04, $45, $46, $46 ; CPU:$F547 PRG:3547 4B 4B 61 22 FC 04 40 41 41 41 23 1C 04 45 46 46
|
|
.byte $46, $23, $3C, $04, $4A, $4B, $4B, $4B, $00, $22, $24, $24, $24, $24, $22, $FE ; CPU:$F557 PRG:3557 46 23 3C 04 4A 4B 4B 4B 00 22 24 24 24 24 22 FE
|
|
.byte $FF, $90, $91, $22, $FC, $FD, $8E, $8F, $22, $FA, $FB, $8C, $8D, $2D, $21, $F7 ; CPU:$F567 PRG:3567 FF 90 91 22 FC FD 8E 8F 22 FA FB 8C 8D 2D 21 F7
|
|
.byte $21, $03, $22, $AB, $22, $32, $21, $E8, $21, $1C, $22, $B4, $22, $AA, $F5, $CA ; CPU:$F577 PRG:3577 21 03 22 AB 22 32 21 E8 21 1C 22 B4 22 AA F5 CA
|
|
.byte $F5, $58, $06, $52, $06, $AA, $F5, $EA, $F5, $D0, $03, $6C, $03, $D9, $04, $BD ; CPU:$F587 PRG:3587 F5 58 06 52 06 AA F5 EA F5 D0 03 6C 03 D9 04 BD
|
|
.byte $F5, $08, $F6, $E0, $04, $7D, $03, $0F, $F7, $00, $00, $E8, $04, $E8, $F6, $00 ; CPU:$F597 PRG:3597 F5 08 F6 E0 04 7D 03 0F F7 00 00 E8 04 E8 F6 00
|
|
.byte $00, $46, $07, $FD, $FE, $FE, $FE, $FE, $FF, $FF, $FF, $FE, $00, $FF, $00, $FE ; CPU:$F5A7 PRG:35A7 00 46 07 FD FE FE FE FE FF FF FF FE 00 FF 00 FE
|
|
.byte $00, $FF, $00, $00, $00, $99, $FE, $FE, $FE, $FF, $FF, $FF, $00, $FF, $00, $FF ; CPU:$F5B7 PRG:35B7 00 FF 00 00 00 99 FE FE FE FF FF FF 00 FF 00 FF
|
|
.byte $00, $00, $99, $58, $40, $5A, $40, $58, $40, $5A, $30, $58, $30, $5A, $20, $58 ; CPU:$F5C7 PRG:35C7 00 00 99 58 40 5A 40 58 40 5A 30 58 30 5A 20 58
|
|
.byte $20, $5A, $20, $58, $20, $5A, $18, $58, $10, $00, $5A, $10, $58, $10, $5A, $08 ; CPU:$F5D7 PRG:35D7 20 5A 20 58 20 5A 18 58 10 00 5A 10 58 10 5A 08
|
|
.byte $58, $08, $FF, $D9, $40, $DC, $40, $D9, $40, $DC, $30, $D9, $30, $DC, $20, $D9 ; CPU:$F5E7 PRG:35E7 58 08 FF D9 40 DC 40 D9 40 DC 30 D9 30 DC 20 D9
|
|
.byte $20, $DC, $20, $D9, $18, $DC, $10, $00, $D9, $10, $DC, $08, $D9, $08, $DC, $08 ; CPU:$F5F7 PRG:35F7 20 DC 20 D9 18 DC 10 00 D9 10 DC 08 D9 08 DC 08
|
|
.byte $FF, $E0, $60, $E3, $40, $E0, $30, $E3, $20, $E0, $20, $E3, $18, $E0, $18, $E3 ; CPU:$F607 PRG:3607 FF E0 60 E3 40 E0 30 E3 20 E0 20 E3 18 E0 18 E3
|
|
.byte $10, $E0, $10, $00, $E3, $08, $E0, $08, $E3, $08, $E0, $08, $E3, $04, $FF, $E6 ; CPU:$F617 PRG:3617 10 E0 10 00 E3 08 E0 08 E3 08 E0 08 E3 04 FF E6
|
|
.byte $E6, $E6, $E6, $01, $E6, $E6, $E6, $FF, $75, $75, $75, $75, $01, $75, $75, $75 ; CPU:$F627 PRG:3627 E6 E6 E6 01 E6 E6 E6 FF 75 75 75 75 01 75 75 75
|
|
.byte $FF, $01, $02, $03, $FF, $02, $01, $03, $FF, $00, $03, $FF, $FB, $FB, $FD, $FE ; CPU:$F637 PRG:3637 FF 01 02 03 FF 02 01 03 FF 00 03 FF FB FB FD FE
|
|
.byte $FE, $FF, $FF, $FF, $FF, $AA, $F7, $F8, $FA, $FB, $FC, $FD, $FE, $FE, $FE, $FE ; CPU:$F647 PRG:3647 FE FF FF FF FF AA F7 F8 FA FB FC FD FE FE FE FE
|
|
.byte $FE, $FF, $FF, $00, $FF, $00, $00, $FF, $AA, $20, $63, $01, $2A, $20, $6B, $03 ; CPU:$F657 PRG:3657 FE FF FF 00 FF 00 00 FF AA 20 63 01 2A 20 6B 03
|
|
.byte $2B, $2C, $2D, $00, $20, $75, $02, $29, $2A, $00, $F4, $DF, $00, $40, $F4, $DF ; CPU:$F667 PRG:3667 2B 2C 2D 00 20 75 02 29 2A 00 F4 DF 00 40 F4 DF
|
|
.byte $00, $4C, $F4, $DF, $00, $58, $F4, $DF, $01, $A8, $F4, $DF, $01, $B4, $F4, $DF ; CPU:$F677 PRG:3677 00 4C F4 DF 00 58 F4 DF 01 A8 F4 DF 01 B4 F4 DF
|
|
.byte $01, $C0, $F4, $EE, $00, $38, $20, $6E, $06, $00, $20, $64, $06, $00, $20, $77 ; CPU:$F687 PRG:3687 01 C0 F4 EE 00 38 20 6E 06 00 20 64 06 00 20 77
|
|
.byte $06, $00, $10, $CD, $03, $6C, $10, $CD, $43, $73, $10, $CD, $03, $84, $10, $CD ; CPU:$F697 PRG:3697 06 00 10 CD 03 6C 10 CD 43 73 10 CD 03 84 10 CD
|
|
.byte $43, $8B, $FD, $FE, $FE, $FE, $FF, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $00 ; CPU:$F6A7 PRG:36A7 43 8B FD FE FE FE FF FF 00 FF 00 FF 00 FF 00 00
|
|
.byte $00, $00, $00, $00, $01, $00, $01, $00, $01, $00, $01, $01, $02, $02, $02, $03 ; CPU:$F6B7 PRG:36B7 00 00 00 00 01 00 01 00 01 00 01 01 02 02 02 03
|
|
.byte $AA, $01, $00, $02, $00, $2C, $05, $A1, $22, $00, $00, $00, $00, $4C, $F6, $00 ; CPU:$F6C7 PRG:36C7 AA 01 00 02 00 2C 05 A1 22 00 00 00 00 4C F6 00
|
|
.byte $40, $00, $01, $00, $0A, $02, $01, $00, $00, $00, $00, $00, $00, $00, $00, $04 ; CPU:$F6D7 PRG:36D7 40 00 01 00 0A 02 01 00 00 00 00 00 00 00 00 04
|
|
.byte $03, $FE, $FE, $FE, $FF, $DD, $47, $FF, $FF, $FF, $00, $DD, $48, $FF, $FF, $00 ; CPU:$F6E7 PRG:36E7 03 FE FE FE FF DD 47 FF FF FF 00 DD 48 FF FF 00
|
|
.byte $FF, $CC, $01, $DD, $49, $00, $00, $00, $00, $00, $00, $CC, $05, $DD, $4D, $00 ; CPU:$F6F7 PRG:36F7 FF CC 01 DD 49 00 00 00 00 00 00 CC 05 DD 4D 00
|
|
.byte $00, $00, $00, $00, $00, $00, $00, $EE, $FE, $FE, $FE, $FF, $DD, $EB, $FF, $FF ; CPU:$F707 PRG:3707 00 00 00 00 00 00 00 EE FE FE FE FF DD EB FF FF
|
|
.byte $FF, $00, $DD, $F0, $00, $00, $00, $00, $00, $00, $EE, $22, $4C, $08, $19, $11 ; CPU:$F717 PRG:3717 FF 00 DD F0 00 00 00 00 00 00 EE 22 4C 08 19 11
|
|
.byte $0A, $1C, $0E, $24, $24, $24, $23, $41, $04, $19, $2E, $24, $24, $00, $21, $89 ; CPU:$F727 PRG:3727 0A 1C 0E 24 24 24 23 41 04 19 2E 24 24 00 21 89
|
|
.byte $0F, $1D, $0E, $1C, $1D, $24, $22, $18, $1E, $1B, $24, $1C, $14, $12, $15, $15 ; CPU:$F737 PRG:3737 0F 1D 0E 1C 1D 24 22 18 1E 1B 24 1C 14 12 15 15
|
|
.byte $20, $8D, $06, $30, $31, $31, $31, $31, $32, $20, $AD, $06, $33, $02, $00, $66 ; CPU:$F747 PRG:3747 20 8D 06 30 31 31 31 31 32 20 AD 06 33 02 00 66
|
|
.byte $00, $34, $20, $CD, $06, $35, $36, $36, $36, $36, $37, $00, $21, $EE, $44, $97 ; CPU:$F757 PRG:3757 00 34 20 CD 06 35 36 36 36 36 37 00 21 EE 44 97
|
|
.byte $23, $DB, $02, $20, $80, $00, $21, $EC, $42, $97, $21, $F2, $42, $97, $23, $DB ; CPU:$F767 PRG:3767 23 DB 02 20 80 00 21 EC 42 97 21 F2 42 97 23 DB
|
|
.byte $02, $00, $00, $00, $21, $EA, $42, $97, $21, $F4, $42, $97, $23, $DA, $04, $20 ; CPU:$F777 PRG:3777 02 00 00 00 21 EA 42 97 21 F4 42 97 23 DA 04 20
|
|
.byte $00, $00, $80, $00, $21, $E8, $42, $97, $21, $F6, $42, $97, $23, $DA, $04, $00 ; CPU:$F787 PRG:3787 00 00 80 00 21 E8 42 97 21 F6 42 97 23 DA 04 00
|
|
.byte $00, $00, $00, $00, $22, $A4, $44, $97, $23, $E9, $01, $50, $00, $22, $A2, $42 ; CPU:$F797 PRG:3797 00 00 00 00 22 A4 44 97 23 E9 01 50 00 22 A2 42
|
|
.byte $97, $22, $A8, $42, $97, $23, $E8, $03, $52, $00, $08, $00, $22, $A0, $42, $97 ; CPU:$F7A7 PRG:37A7 97 22 A8 42 97 23 E8 03 52 00 08 00 22 A0 42 97
|
|
.byte $22, $AA, $42, $97, $23, $E8, $03, $50, $00, $00, $00, $22, $B8, $44, $97, $23 ; CPU:$F7B7 PRG:37B7 22 AA 42 97 23 E8 03 50 00 00 00 22 B8 44 97 23
|
|
.byte $EE, $01, $50, $00, $22, $B6, $42, $97, $22, $BC, $42, $97, $23, $ED, $03, $02 ; CPU:$F7C7 PRG:37C7 EE 01 50 00 22 B6 42 97 22 BC 42 97 23 ED 03 02
|
|
.byte $00, $58, $00, $22, $B4, $42, $97, $22, $BE, $42, $97, $23, $ED, $03, $00, $00 ; CPU:$F7D7 PRG:37D7 00 58 00 22 B4 42 97 22 BE 42 97 23 ED 03 00 00
|
|
.byte $50, $00, $00, $03, $FF, $03, $00, $03, $00, $03, $FF, $03, $01, $03, $01, $03 ; CPU:$F7E7 PRG:37E7 50 00 00 03 FF 03 00 03 00 03 FF 03 01 03 01 03
|
|
.byte $00, $03, $01, $03, $02, $03, $02, $03, $02, $02, $02, $02, $03, $02, $03, $02 ; CPU:$F7F7 PRG:37F7 00 03 01 03 02 03 02 03 02 02 02 02 03 02 03 02
|
|
.byte $03, $02, $03, $01, $03, $01, $03, $01, $03, $01, $04, $00, $04, $01, $04, $00 ; CPU:$F807 PRG:3807 03 02 03 01 03 01 03 01 03 01 04 00 04 01 04 00
|
|
.byte $04, $01, $04, $01, $AA, $00, $01, $02, $02, $01, $00, $AA, $00, $5C, $01, $50 ; CPU:$F817 PRG:3817 04 01 04 01 AA 00 01 02 02 01 00 AA 00 5C 01 50
|
|
.byte $00, $10, $02, $14, $82, $40, $00, $10, $01, $28, $00, $50, $80, $40, $02, $28 ; CPU:$F827 PRG:3827 00 10 02 14 82 40 00 10 01 28 00 50 80 40 02 28
|
|
.byte $00, $14, $01, $10, $81, $40, $00, $48, $01, $30, $81, $30, $01, $10, $00, $10 ; CPU:$F837 PRG:3837 00 14 01 10 81 40 00 48 01 30 81 30 01 10 00 10
|
|
.byte $02, $45, $82, $40, $02, $20, $00, $08, $01, $40, $81, $40, $AA, $00, $30, $02 ; CPU:$F847 PRG:3847 02 45 82 40 02 20 00 08 01 40 81 40 AA 00 30 02
|
|
.byte $50, $00, $10, $01, $18, $81, $30, $81, $18, $00, $10, $02, $24, $82, $60, $82 ; CPU:$F857 PRG:3857 50 00 10 01 18 81 30 81 18 00 10 02 24 82 60 82
|
|
.byte $40, $00, $08, $01, $24, $81, $40, $00, $18, $02, $10, $82, $40, $00, $40, $01 ; CPU:$F867 PRG:3867 40 00 08 01 24 81 40 00 18 02 10 82 40 00 40 01
|
|
.byte $60, $00, $50, $01, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F877 PRG:3877 60 00 50 01 FF FF FF FF FF FF FF FF FF FF FF FF
|
|
.byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F887 PRG:3887 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
|
.byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; CPU:$F897 PRG:3897 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCF8A7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
NopPadding:
|
|
nop ; CPU:$F8A7 PRG:38A7 EA
|
|
nop ; CPU:$F8A8 PRG:38A8 EA
|
|
nop ; CPU:$F8A9 PRG:38A9 EA
|
|
nop ; CPU:$F8AA PRG:38AA EA
|
|
nop ; CPU:$F8AB PRG:38AB EA
|
|
nop ; CPU:$F8AC PRG:38AC EA
|
|
nop ; CPU:$F8AD PRG:38AD EA
|
|
lda #$C0 ; CPU:$F8AE PRG:38AE A9 C0
|
|
sta JOY2 ; CPU:$F8B0 PRG:38B0 8D 17 40
|
|
jsr CheckSoundEnabled ; CPU:$F8B3 PRG:38B3 20 91 FA
|
|
lda #$00 ; CPU:$F8B6 PRG:38B6 A9 00
|
|
sta ZpFF ; CPU:$F8B8 PRG:38B8 85 FF
|
|
sta ZpFE ; CPU:$F8BA PRG:38BA 85 FE
|
|
sta ZpFD ; CPU:$F8BC PRG:38BC 85 FD
|
|
sta APUDMCDIRECT ; CPU:$F8BE PRG:38BE 8D 11 40
|
|
rts ; CPU:$F8C1 PRG:38C1 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AudioPulse1CtrlSetup
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AudioPulse1CtrlSetup:
|
|
ldx #$90 ; CPU:$F8C2 PRG:38C2 A2 90
|
|
bne StorePulse1Ctrl ; CPU:$F8C4 PRG:38C4 D0 05
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AudioPulse1SweepSet
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AudioPulse1SweepSet:
|
|
ldy #$7F ; CPU:$F8C6 PRG:38C6 A0 7F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StorePulse1Sweep
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StorePulse1Sweep:
|
|
sty APUPULSE1SWEEP ; CPU:$F8C8 PRG:38C8 8C 01 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StorePulse1Ctrl
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StorePulse1Ctrl:
|
|
stx APUPULSE1CTRL ; CPU:$F8CB PRG:38CB 8E 00 40
|
|
rts ; CPU:$F8CE PRG:38CE 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SaveXYWritePulse2Freq
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SaveXYWritePulse2Freq:
|
|
stx ZpF1 ; CPU:$F8CF PRG:38CF 86 F1
|
|
sty ZpF0 ; CPU:$F8D1 PRG:38D1 84 F0
|
|
bne Pulse2FreqXZero ; CPU:$F8D3 PRG:38D3 D0 03
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCF8D5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
PlayPulseNote:
|
|
jsr StorePulse1Sweep ; CPU:$F8D5 PRG:38D5 20 C8 F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: Pulse2FreqXZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
Pulse2FreqXZero:
|
|
ldx #$00 ; CPU:$F8D8 PRG:38D8 A2 00
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WritePulse2Freq
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WritePulse2Freq:
|
|
tay ; CPU:$F8DA PRG:38DA A8
|
|
lda $F901,y ; CPU:$F8DB PRG:38DB B9 01 F9
|
|
beq AudioReturn ; CPU:$F8DE PRG:38DE F0 0B
|
|
sta APUPULSE1TIMERLO,x ; CPU:$F8E0 PRG:38E0 9D 02 40
|
|
lda $F900,y ; CPU:$F8E3 PRG:38E3 B9 00 F9
|
|
ora #$08 ; CPU:$F8E6 PRG:38E6 09 08
|
|
sta APUPULSE1TIMERHI,x ; CPU:$F8E8 PRG:38E8 9D 03 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: AudioReturn
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
AudioReturn:
|
|
rts ; CPU:$F8EB PRG:38EB 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCF8EC
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WritePulse2Ctrl:
|
|
jsr WritePulse2Period ; CPU:$F8EC PRG:38EC 20 6D F9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: Pulse2FreqXFour
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
Pulse2FreqXFour:
|
|
ldx #$04 ; CPU:$F8EF PRG:38EF A2 04
|
|
bne WritePulse2Freq ; CPU:$F8F1 PRG:38F1 D0 E7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessTriangleChannel
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessTriangleChannel:
|
|
txa ; CPU:$F8F3 PRG:38F3 8A
|
|
and #$3E ; CPU:$F8F4 PRG:38F4 29 3E
|
|
ldx #$08 ; CPU:$F8F6 PRG:38F6 A2 08
|
|
bne WritePulse2Freq ; CPU:$F8F8 PRG:38F8 D0 E0
|
|
sta Zp85 ; CPU:$F8FA PRG:38FA 85 85
|
|
sta Zp8D ; CPU:$F8FC PRG:38FC 85 8D
|
|
sta $018D ; CPU:$F8FE PRG:38FE 8D 8D 01
|
|
; ---- data $F901-$F901 (1 bytes) ----
|
|
NoteTableTerminator:
|
|
.byte $C4 ; CPU:$F901 PRG:3901 C4
|
|
brk ; CPU:$F902 PRG:3902 00
|
|
; ---- data $F903-$F903 (1 bytes) ----
|
|
NoteTableStart:
|
|
.byte $00 ; CPU:$F903 PRG:3903 00
|
|
; ---- data $F904-$F96A (103 bytes) ----
|
|
; referenced by `lda $F94E,y` at $F98E (operand $F94E falls inside this region)
|
|
NoteFrequencyTable:
|
|
.byte $00, $69, $00, $D4, $00, $C8, $00, $BD, $00, $B2, $00, $A8, $00, $9F, $00, $8D ; CPU:$F904 PRG:3904 00 69 00 D4 00 C8 00 BD 00 B2 00 A8 00 9F 00 8D
|
|
.byte $00, $85, $00, $7E, $00, $76, $00, $70, $01, $AB, $01, $7C, $01, $67, $01, $52 ; CPU:$F914 PRG:3914 00 85 00 7E 00 76 00 70 01 AB 01 7C 01 67 01 52
|
|
.byte $01, $3F, $01, $1C, $01, $0C, $00, $FD, $00, $EE, $00, $E1, $03, $57, $02, $F9 ; CPU:$F924 PRG:3924 01 3F 01 1C 01 0C 00 FD 00 EE 00 E1 03 57 02 F9
|
|
.byte $02, $A6, $02, $80, $02, $3A, $02, $1A, $01, $FC, $01, $DF, $06, $AE, $05, $F3 ; CPU:$F934 PRG:3934 02 A6 02 80 02 3A 02 1A 01 FC 01 DF 06 AE 05 F3
|
|
.byte $05, $4D, $05, $01, $04, $75, $03, $89, $00, $53, $03, $07, $0E, $1C, $38, $15 ; CPU:$F944 PRG:3944 05 4D 05 01 04 75 03 89 00 53 03 07 0E 1C 38 15
|
|
.byte $2A, $04, $08, $10, $20, $40, $18, $30, $06, $05, $0A, $14, $28, $50, $1E, $3C ; CPU:$F954 PRG:3954 2A 04 08 10 20 40 18 30 06 05 0A 14 28 50 1E 3C
|
|
.byte $04, $0B, $16, $2C, $58, $21, $07 ; CPU:$F964 PRG:3964 04 0B 16 2C 58 21 07
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCF96B
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WritePulse2PeriodA:
|
|
ldy #$7F ; CPU:$F96B PRG:396B A0 7F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCF96D
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WritePulse2Period:
|
|
stx APUPULSE2CTRL ; CPU:$F96D PRG:396D 8E 04 40
|
|
sty APUPULSE2SWEEP ; CPU:$F970 PRG:3970 8C 05 40
|
|
rts ; CPU:$F973 PRG:3973 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DivideYBy8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DivideYBy8:
|
|
tya ; CPU:$F974 PRG:3974 98
|
|
lsr a ; CPU:$F975 PRG:3975 4A
|
|
lsr a ; CPU:$F976 PRG:3976 4A
|
|
lsr a ; CPU:$F977 PRG:3977 4A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCF978
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ComputeNotePeriod:
|
|
lsr a ; CPU:$F978 PRG:3978 4A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: YMinusXDiv8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
YMinusXDiv8:
|
|
lsr a ; CPU:$F979 PRG:3979 4A
|
|
sta Zp00 ; CPU:$F97A PRG:397A 85 00
|
|
tya ; CPU:$F97C PRG:397C 98
|
|
sec ; CPU:$F97D PRG:397D 38
|
|
sbc Zp00 ; CPU:$F97E PRG:397E E5 00
|
|
rts ; CPU:$F980 PRG:3980 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: RotateBitsForTableLookup
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
RotateBitsForTableLookup:
|
|
tax ; CPU:$F981 PRG:3981 AA
|
|
ror a ; CPU:$F982 PRG:3982 6A
|
|
txa ; CPU:$F983 PRG:3983 8A
|
|
rol a ; CPU:$F984 PRG:3984 2A
|
|
rol a ; CPU:$F985 PRG:3985 2A
|
|
rol a ; CPU:$F986 PRG:3986 2A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: LookupNoteTable
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
LookupNoteTable:
|
|
and #$07 ; CPU:$F987 PRG:3987 29 07
|
|
clc ; CPU:$F989 PRG:3989 18
|
|
adc $068D ; CPU:$F98A PRG:398A 6D 8D 06
|
|
tay ; CPU:$F98D PRG:398D A8
|
|
lda $F94E,y ; CPU:$F98E PRG:398E B9 4E F9
|
|
rts ; CPU:$F991 PRG:3991 60
|
|
; ---- data $F992-$F9A1 (16 bytes) ----
|
|
; referenced by `lda $F99D,y` at $FA14 (operand $F99D falls inside this region)
|
|
; referenced by `ldy $F997,x` at $FA73 (operand $F997 falls inside this region)
|
|
PulseDutyTable:
|
|
.byte $8C, $84, $83, $8D, $8D, $83, $83, $8B, $8C, $83, $8B, $8C, $8A, $8A, $8B, $8B ; CPU:$F992 PRG:3992 8C 84 83 8D 8D 83 83 8B 8C 83 8B 8C 8A 8A 8B 8B
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupAudioChannel
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupAudioChannel:
|
|
sty ZpF0 ; CPU:$F9A2 PRG:39A2 84 F0
|
|
lda #$85 ; CPU:$F9A4 PRG:39A4 A9 85
|
|
sta ZpF1 ; CPU:$F9A6 PRG:39A6 85 F1
|
|
lda #$FE ; CPU:$F9A8 PRG:39A8 A9 FE
|
|
sta ZpF2 ; CPU:$F9AA PRG:39AA 85 F2
|
|
ldx #$84 ; CPU:$F9AC PRG:39AC A2 84
|
|
ldy #$8A ; CPU:$F9AE PRG:39AE A0 8A
|
|
lda #$2A ; CPU:$F9B0 PRG:39B0 A9 2A
|
|
jsr PlayPulseNote ; CPU:$F9B2 PRG:39B2 20 D5 F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecayFrequencyEnvelope
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecayFrequencyEnvelope:
|
|
dec ZpF1 ; CPU:$F9B5 PRG:39B5 C6 F1
|
|
lda ZpF1 ; CPU:$F9B7 PRG:39B7 A5 F1
|
|
bne DecayFrequencyEnvelope_Loop ; CPU:$F9B9 PRG:39B9 D0 03
|
|
jmp ResetAudioChannel ; CPU:$F9BB PRG:39BB 4C EF FA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecayFrequencyEnvelope_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecayFrequencyEnvelope_Loop:
|
|
cmp #$40 ; CPU:$F9BE PRG:39BE C9 40
|
|
beq DecayFrequencyEnvelope_Loop3 ; CPU:$F9C0 PRG:39C0 F0 1B
|
|
bcc DecayFrequencyEnvelope_Loop4 ; CPU:$F9C2 PRG:39C2 90 1F
|
|
cmp #$78 ; CPU:$F9C4 PRG:39C4 C9 78
|
|
bcc DecayFrequencyEnvelope_Loop2 ; CPU:$F9C6 PRG:39C6 90 10
|
|
lsr a ; CPU:$F9C8 PRG:39C8 4A
|
|
bcs DecayFrequencyEnvelope_Loop8 ; CPU:$F9C9 PRG:39C9 B0 50
|
|
lda ZpF2 ; CPU:$F9CB PRG:39CB A5 F2
|
|
tay ; CPU:$F9CD PRG:39CD A8
|
|
jsr ComputeNotePeriod ; CPU:$F9CE PRG:39CE 20 78 F9
|
|
sta ZpF2 ; CPU:$F9D1 PRG:39D1 85 F2
|
|
sta APUPULSE1TIMERLO ; CPU:$F9D3 PRG:39D3 8D 02 40
|
|
bne DecayFrequencyEnvelope_Loop8 ; CPU:$F9D6 PRG:39D6 D0 43
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecayFrequencyEnvelope_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecayFrequencyEnvelope_Loop2:
|
|
jsr AudioPulse1CtrlSetup ; CPU:$F9D8 PRG:39D8 20 C2 F8
|
|
bne DecayFrequencyEnvelope_Loop8 ; CPU:$F9DB PRG:39DB D0 3E
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecayFrequencyEnvelope_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecayFrequencyEnvelope_Loop3:
|
|
lda #$35 ; CPU:$F9DD PRG:39DD A9 35
|
|
sta ZpF2 ; CPU:$F9DF PRG:39DF 85 F2
|
|
bne DecayFrequencyEnvelope_Loop6 ; CPU:$F9E1 PRG:39E1 D0 0F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecayFrequencyEnvelope_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecayFrequencyEnvelope_Loop4:
|
|
ldx #$9C ; CPU:$F9E3 PRG:39E3 A2 9C
|
|
cmp #$18 ; CPU:$F9E5 PRG:39E5 C9 18
|
|
bcs DecayFrequencyEnvelope_Loop5 ; CPU:$F9E7 PRG:39E7 B0 04
|
|
lsr a ; CPU:$F9E9 PRG:39E9 4A
|
|
ora #$90 ; CPU:$F9EA PRG:39EA 09 90
|
|
tax ; CPU:$F9EC PRG:39EC AA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecayFrequencyEnvelope_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecayFrequencyEnvelope_Loop5:
|
|
dec $06B7 ; CPU:$F9ED PRG:39ED CE B7 06
|
|
bne DecayFrequencyEnvelope_Loop7 ; CPU:$F9F0 PRG:39F0 D0 1F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecayFrequencyEnvelope_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecayFrequencyEnvelope_Loop6:
|
|
lda #$04 ; CPU:$F9F2 PRG:39F2 A9 04
|
|
sta $06B7 ; CPU:$F9F4 PRG:39F4 8D B7 06
|
|
lda ZpF2 ; CPU:$F9F7 PRG:39F7 A5 F2
|
|
lsr a ; CPU:$F9F9 PRG:39F9 4A
|
|
lsr a ; CPU:$F9FA PRG:39FA 4A
|
|
lsr a ; CPU:$F9FB PRG:39FB 4A
|
|
lsr a ; CPU:$F9FC PRG:39FC 4A
|
|
sec ; CPU:$F9FD PRG:39FD 38
|
|
adc ZpF2 ; CPU:$F9FE PRG:39FE 65 F2
|
|
sta ZpF2 ; CPU:$FA00 PRG:3A00 85 F2
|
|
asl a ; CPU:$FA02 PRG:3A02 0A
|
|
asl a ; CPU:$FA03 PRG:3A03 0A
|
|
sta APUPULSE1TIMERLO ; CPU:$FA04 PRG:3A04 8D 02 40
|
|
lda ZpF2 ; CPU:$FA07 PRG:3A07 A5 F2
|
|
rol a ; CPU:$FA09 PRG:3A09 2A
|
|
rol a ; CPU:$FA0A PRG:3A0A 2A
|
|
rol a ; CPU:$FA0B PRG:3A0B 2A
|
|
and #$03 ; CPU:$FA0C PRG:3A0C 29 03
|
|
sta APUPULSE1TIMERHI ; CPU:$FA0E PRG:3A0E 8D 03 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecayFrequencyEnvelope_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecayFrequencyEnvelope_Loop7:
|
|
ldy $06B7 ; CPU:$FA11 PRG:3A11 AC B7 06
|
|
lda $F99D,y ; CPU:$FA14 PRG:3A14 B9 9D F9
|
|
tay ; CPU:$FA17 PRG:3A17 A8
|
|
jsr StorePulse1Sweep ; CPU:$FA18 PRG:3A18 20 C8 F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecayFrequencyEnvelope_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecayFrequencyEnvelope_Loop8:
|
|
jmp UpdateSoundChannel ; CPU:$FA1B PRG:3A1B 4C 27 FD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel:
|
|
sty ZpF0 ; CPU:$FA1E PRG:3A1E 84 F0
|
|
lda #$14 ; CPU:$FA20 PRG:3A20 A9 14
|
|
sta ZpF1 ; CPU:$FA22 PRG:3A22 85 F1
|
|
ldx #$85 ; CPU:$FA24 PRG:3A24 A2 85
|
|
ldy #$85 ; CPU:$FA26 PRG:3A26 A0 85
|
|
lda #$30 ; CPU:$FA28 PRG:3A28 A9 30
|
|
jsr PlayPulseNote ; CPU:$FA2A PRG:3A2A 20 D5 F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_OnCarrySet
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_OnCarrySet:
|
|
lda ZpF1 ; CPU:$FA2D PRG:3A2D A5 F1
|
|
cmp #$0D ; CPU:$FA2F PRG:3A2F C9 0D
|
|
bne SetupSoundChannel_Loop ; CPU:$FA31 PRG:3A31 D0 05
|
|
lda #$30 ; CPU:$FA33 PRG:3A33 A9 30
|
|
jsr Pulse2FreqXZero ; CPU:$FA35 PRG:3A35 20 D8 F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_Loop:
|
|
jmp DecayCounter ; CPU:$FA38 PRG:3A38 4C EB FA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_OnCarrySet2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_OnCarrySet2:
|
|
ldx #$6E ; CPU:$FA3B PRG:3A3B A2 6E
|
|
lda #$12 ; CPU:$FA3D PRG:3A3D A9 12
|
|
jsr SaveXYWritePulse2Freq ; CPU:$FA3F PRG:3A3F 20 CF F8
|
|
bne SetupSoundChannel_Loop2 ; CPU:$FA42 PRG:3A42 D0 17
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_OnCarrySet3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_OnCarrySet3:
|
|
lda ZpF1 ; CPU:$FA44 PRG:3A44 A5 F1
|
|
cmp #$50 ; CPU:$FA46 PRG:3A46 C9 50
|
|
bcs SetupSoundChannel_Loop3 ; CPU:$FA48 PRG:3A48 B0 15
|
|
cmp #$46 ; CPU:$FA4A PRG:3A4A C9 46
|
|
bcs SetupSoundChannel_Loop4 ; CPU:$FA4C PRG:3A4C B0 23
|
|
cmp #$37 ; CPU:$FA4E PRG:3A4E C9 37
|
|
bcs SetupSoundChannel_Loop3 ; CPU:$FA50 PRG:3A50 B0 0D
|
|
bcc SetupSoundChannel_Loop4 ; CPU:$FA52 PRG:3A52 90 1D
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_OnCarrySet4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_OnCarrySet4:
|
|
ldx #$1E ; CPU:$FA54 PRG:3A54 A2 1E
|
|
lda #$06 ; CPU:$FA56 PRG:3A56 A9 06
|
|
jsr SaveXYWritePulse2Freq ; CPU:$FA58 PRG:3A58 20 CF F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_Loop2:
|
|
lda #$06 ; CPU:$FA5B PRG:3A5B A9 06
|
|
sta ZpF2 ; CPU:$FA5D PRG:3A5D 85 F2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_Loop3:
|
|
ldx ZpF2 ; CPU:$FA5F PRG:3A5F A6 F2
|
|
ldy $F991,x ; CPU:$FA61 PRG:3A61 BC 91 F9
|
|
bne SetupSoundChannel_Loop5 ; CPU:$FA64 PRG:3A64 D0 10
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_OnCarrySet5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_OnCarrySet5:
|
|
ldx #$10 ; CPU:$FA66 PRG:3A66 A2 10
|
|
lda #$22 ; CPU:$FA68 PRG:3A68 A9 22
|
|
jsr SaveXYWritePulse2Freq ; CPU:$FA6A PRG:3A6A 20 CF F8
|
|
lda #$06 ; CPU:$FA6D PRG:3A6D A9 06
|
|
sta ZpF2 ; CPU:$FA6F PRG:3A6F 85 F2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_Loop4:
|
|
ldx ZpF2 ; CPU:$FA71 PRG:3A71 A6 F2
|
|
ldy $F997,x ; CPU:$FA73 PRG:3A73 BC 97 F9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_Loop5:
|
|
dec ZpF2 ; CPU:$FA76 PRG:3A76 C6 F2
|
|
bne SetupSoundChannel_Loop6 ; CPU:$FA78 PRG:3A78 D0 04
|
|
lda #$06 ; CPU:$FA7A PRG:3A7A A9 06
|
|
sta ZpF2 ; CPU:$FA7C PRG:3A7C 85 F2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_Loop6:
|
|
ldx #$9A ; CPU:$FA7E PRG:3A7E A2 9A
|
|
lda ZpF1 ; CPU:$FA80 PRG:3A80 A5 F1
|
|
cmp #$0A ; CPU:$FA82 PRG:3A82 C9 0A
|
|
bcs CheckSoundEnabled_OnCarryClear ; CPU:$FA84 PRG:3A84 B0 62
|
|
bcc CheckSoundEnabled_OnCarrySet ; CPU:$FA86 PRG:3A86 90 5D
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_OnCarrySet6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_OnCarrySet6:
|
|
jmp SetupAudioChannel ; CPU:$FA88 PRG:3A88 4C A2 F9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_OnCarrySet7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_OnCarrySet7:
|
|
jmp DecayFrequencyEnvelope ; CPU:$FA8B PRG:3A8B 4C B5 F9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupSoundChannel_OnCarrySet8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupSoundChannel_OnCarrySet8:
|
|
jmp SetupSoundChannel ; CPU:$FA8E PRG:3A8E 4C 1E FA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckSoundEnabled
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckSoundEnabled:
|
|
lda ZpFA ; CPU:$FA91 PRG:3A91 A5 FA
|
|
bne CheckSoundEnabled_OnZero ; CPU:$FA93 PRG:3A93 D0 3C
|
|
ldy ZpFF ; CPU:$FA95 PRG:3A95 A4 FF
|
|
lda ZpF0 ; CPU:$FA97 PRG:3A97 A5 F0
|
|
lsr a ; CPU:$FA99 PRG:3A99 4A
|
|
bcs SetupSoundChannel_OnCarrySet7 ; CPU:$FA9A PRG:3A9A B0 EF
|
|
lsr ZpFF ; CPU:$FA9C PRG:3A9C 46 FF
|
|
bcs SetupSoundChannel_OnCarrySet6 ; CPU:$FA9E PRG:3A9E B0 E8
|
|
lsr a ; CPU:$FAA0 PRG:3AA0 4A
|
|
bcs SetupSoundChannel_OnCarrySet ; CPU:$FAA1 PRG:3AA1 B0 8A
|
|
lsr ZpFF ; CPU:$FAA3 PRG:3AA3 46 FF
|
|
bcs SetupSoundChannel_OnCarrySet8 ; CPU:$FAA5 PRG:3AA5 B0 E7
|
|
lsr a ; CPU:$FAA7 PRG:3AA7 4A
|
|
bcs SetupSoundChannel_OnCarrySet3 ; CPU:$FAA8 PRG:3AA8 B0 9A
|
|
lsr ZpFF ; CPU:$FAAA PRG:3AAA 46 FF
|
|
bcs SetupSoundChannel_OnCarrySet2 ; CPU:$FAAC PRG:3AAC B0 8D
|
|
lsr ZpFF ; CPU:$FAAE PRG:3AAE 46 FF
|
|
bcs SetupSoundChannel_OnCarrySet4 ; CPU:$FAB0 PRG:3AB0 B0 A2
|
|
lsr a ; CPU:$FAB2 PRG:3AB2 4A
|
|
bcs SetupSoundChannel_Loop3 ; CPU:$FAB3 PRG:3AB3 B0 AA
|
|
lsr a ; CPU:$FAB5 PRG:3AB5 4A
|
|
bcs SetupSoundChannel_Loop4 ; CPU:$FAB6 PRG:3AB6 B0 B9
|
|
lsr ZpFF ; CPU:$FAB8 PRG:3AB8 46 FF
|
|
bcs SetupSoundChannel_OnCarrySet5 ; CPU:$FABA PRG:3ABA B0 AA
|
|
lsr a ; CPU:$FABC PRG:3ABC 4A
|
|
bcs CheckSoundEnabled_Loop2 ; CPU:$FABD PRG:3ABD B0 1C
|
|
lsr ZpFF ; CPU:$FABF PRG:3ABF 46 FF
|
|
bcs CheckSoundEnabled_Loop ; CPU:$FAC1 PRG:3AC1 B0 11
|
|
lsr a ; CPU:$FAC3 PRG:3AC3 4A
|
|
bcs ResetAudioChannel_Loop2 ; CPU:$FAC4 PRG:3AC4 B0 39
|
|
lsr ZpFF ; CPU:$FAC6 PRG:3AC6 46 FF
|
|
bcs ResetAudioChannel_Loop ; CPU:$FAC8 PRG:3AC8 B0 2E
|
|
lsr a ; CPU:$FACA PRG:3ACA 4A
|
|
bcs ResetAudioChannel_Loop4 ; CPU:$FACB PRG:3ACB B0 57
|
|
lsr ZpFF ; CPU:$FACD PRG:3ACD 46 FF
|
|
bcs ResetAudioChannel_Loop3 ; CPU:$FACF PRG:3ACF B0 3E
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckSoundEnabled_OnZero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckSoundEnabled_OnZero:
|
|
jmp UpdateSoundState ; CPU:$FAD1 PRG:3AD1 4C C9 FC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckSoundEnabled_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckSoundEnabled_Loop:
|
|
ldx #$11 ; CPU:$FAD4 PRG:3AD4 A2 11
|
|
lda #$34 ; CPU:$FAD6 PRG:3AD6 A9 34
|
|
jsr SaveXYWritePulse2Freq ; CPU:$FAD8 PRG:3AD8 20 CF F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckSoundEnabled_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckSoundEnabled_Loop2:
|
|
lda ZpF1 ; CPU:$FADB PRG:3ADB A5 F1
|
|
ldy #$8C ; CPU:$FADD PRG:3ADD A0 8C
|
|
cmp #$08 ; CPU:$FADF PRG:3ADF C9 08
|
|
bcc CheckSoundEnabled_OnCarrySet ; CPU:$FAE1 PRG:3AE1 90 02
|
|
lda #$08 ; CPU:$FAE3 PRG:3AE3 A9 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckSoundEnabled_OnCarrySet
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckSoundEnabled_OnCarrySet:
|
|
ora #$90 ; CPU:$FAE5 PRG:3AE5 09 90
|
|
tax ; CPU:$FAE7 PRG:3AE7 AA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: CheckSoundEnabled_OnCarryClear
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
CheckSoundEnabled_OnCarryClear:
|
|
jsr StorePulse1Sweep ; CPU:$FAE8 PRG:3AE8 20 C8 F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: DecayCounter
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
DecayCounter:
|
|
dec ZpF1 ; CPU:$FAEB PRG:3AEB C6 F1
|
|
bne CheckSoundEnabled_OnZero ; CPU:$FAED PRG:3AED D0 E2
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResetAudioChannel
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetAudioChannel:
|
|
jsr AudioPulse1CtrlSetup ; CPU:$FAEF PRG:3AEF 20 C2 F8
|
|
lda #$00 ; CPU:$FAF2 PRG:3AF2 A9 00
|
|
sta ZpF0 ; CPU:$FAF4 PRG:3AF4 85 F0
|
|
beq CheckSoundEnabled_OnZero ; CPU:$FAF6 PRG:3AF6 F0 D9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResetAudioChannel_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetAudioChannel_Loop:
|
|
ldx #$09 ; CPU:$FAF8 PRG:3AF8 A2 09
|
|
lda #$04 ; CPU:$FAFA PRG:3AFA A9 04
|
|
jsr SaveXYWritePulse2Freq ; CPU:$FAFC PRG:3AFC 20 CF F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResetAudioChannel_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetAudioChannel_Loop2:
|
|
ldy #$84 ; CPU:$FAFF PRG:3AFF A0 84
|
|
lda ZpF1 ; CPU:$FB01 PRG:3B01 A5 F1
|
|
cmp #$04 ; CPU:$FB03 PRG:3B03 C9 04
|
|
beq ResetAudioChannel ; CPU:$FB05 PRG:3B05 F0 E8
|
|
cmp #$08 ; CPU:$FB07 PRG:3B07 C9 08
|
|
bcs CheckSoundEnabled_OnCarrySet ; CPU:$FB09 PRG:3B09 B0 DA
|
|
ldy #$8B ; CPU:$FB0B PRG:3B0B A0 8B
|
|
bne CheckSoundEnabled_OnCarrySet ; CPU:$FB0D PRG:3B0D D0 D6
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResetAudioChannel_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetAudioChannel_Loop3:
|
|
sty ZpF0 ; CPU:$FB0F PRG:3B0F 84 F0
|
|
lda #$05 ; CPU:$FB11 PRG:3B11 A9 05
|
|
sta ZpF1 ; CPU:$FB13 PRG:3B13 85 F1
|
|
inc $06F0 ; CPU:$FB15 PRG:3B15 EE F0 06
|
|
lda $06F0 ; CPU:$FB18 PRG:3B18 AD F0 06
|
|
and #$07 ; CPU:$FB1B PRG:3B1B 29 07
|
|
tay ; CPU:$FB1D PRG:3B1D A8
|
|
lda $FB32,y ; CPU:$FB1E PRG:3B1E B9 32 FB
|
|
jsr Pulse2FreqXZero ; CPU:$FB21 PRG:3B21 20 D8 F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ResetAudioChannel_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ResetAudioChannel_Loop4:
|
|
lda ZpF1 ; CPU:$FB24 PRG:3B24 A5 F1
|
|
ldy #$7F ; CPU:$FB26 PRG:3B26 A0 7F
|
|
ldx #$90 ; CPU:$FB28 PRG:3B28 A2 90
|
|
cmp #$04 ; CPU:$FB2A PRG:3B2A C9 04
|
|
bcs CheckSoundEnabled_OnCarrySet ; CPU:$FB2C PRG:3B2C B0 B7
|
|
lda #$04 ; CPU:$FB2E PRG:3B2E A9 04
|
|
bcc CheckSoundEnabled_OnCarryClear ; CPU:$FB30 PRG:3B30 90 B6
|
|
; ---- data $FB32-$FB37 (6 bytes) ----
|
|
ReadSoundCounters:
|
|
.byte $26, $22, $26, $22, $26, $22 ; CPU:$FB32 PRG:3B32 26 22 26 22 26 22
|
|
.byte $1C, $22, $83 ; CPU:$FB38 PRG:3B38 1C 22 83 -- nop $8322,x (undocumented; ca65 cannot encode)
|
|
sty Zp82 ; CPU:$FB3B PRG:3B3B 84 82
|
|
; ---- data $FB3D-$FB3D (1 bytes) ----
|
|
WriteSoundFlag:
|
|
.byte $8E ; CPU:$FB3D PRG:3B3D 8E
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SetupNoiseChannel
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
SetupNoiseChannel:
|
|
sty ZpFB ; CPU:$FB3E PRG:3B3E 84 FB
|
|
lda #$60 ; CPU:$FB40 PRG:3B40 A9 60
|
|
sta ZpF3 ; CPU:$FB42 PRG:3B42 85 F3
|
|
lda #$19 ; CPU:$FB44 PRG:3B44 A9 19
|
|
sta ZpF4 ; CPU:$FB46 PRG:3B46 85 F4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel:
|
|
lda ZpF3 ; CPU:$FB48 PRG:3B48 A5 F3
|
|
and #$07 ; CPU:$FB4A PRG:3B4A 29 07
|
|
bne ProcessNoiseChannel_Loop2 ; CPU:$FB4C PRG:3B4C D0 1E
|
|
lda ZpF4 ; CPU:$FB4E PRG:3B4E A5 F4
|
|
and $0500 ; CPU:$FB50 PRG:3B50 2D 00 05
|
|
lsr a ; CPU:$FB53 PRG:3B53 4A
|
|
lsr a ; CPU:$FB54 PRG:3B54 4A
|
|
clc ; CPU:$FB55 PRG:3B55 18
|
|
adc ZpF4 ; CPU:$FB56 PRG:3B56 65 F4
|
|
bcs ProcessNoiseChannel_Loop ; CPU:$FB58 PRG:3B58 B0 02
|
|
sta ZpF4 ; CPU:$FB5A PRG:3B5A 85 F4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_Loop:
|
|
lda ZpF4 ; CPU:$FB5C PRG:3B5C A5 F4
|
|
rol a ; CPU:$FB5E PRG:3B5E 2A
|
|
rol a ; CPU:$FB5F PRG:3B5F 2A
|
|
rol a ; CPU:$FB60 PRG:3B60 2A
|
|
sta APUPULSE2TIMERLO ; CPU:$FB61 PRG:3B61 8D 06 40
|
|
rol a ; CPU:$FB64 PRG:3B64 2A
|
|
and #$07 ; CPU:$FB65 PRG:3B65 29 07
|
|
ora #$08 ; CPU:$FB67 PRG:3B67 09 08
|
|
sta APUPULSE2TIMERHI ; CPU:$FB69 PRG:3B69 8D 07 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_Loop2:
|
|
lda $0500 ; CPU:$FB6C PRG:3B6C AD 00 05
|
|
and #$03 ; CPU:$FB6F PRG:3B6F 29 03
|
|
lda $FB3A,y ; CPU:$FB71 PRG:3B71 B9 3A FB
|
|
sta APUPULSE2SWEEP ; CPU:$FB74 PRG:3B74 8D 05 40
|
|
jmp WritePulse2Sweep ; CPU:$FB77 PRG:3B77 4C A7 FC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_OnCarrySet
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_OnCarrySet:
|
|
sty ZpFB ; CPU:$FB7A PRG:3B7A 84 FB
|
|
lda #$28 ; CPU:$FB7C PRG:3B7C A9 28
|
|
sta ZpF3 ; CPU:$FB7E PRG:3B7E 85 F3
|
|
lda #$FE ; CPU:$FB80 PRG:3B80 A9 FE
|
|
sta ZpF4 ; CPU:$FB82 PRG:3B82 85 F4
|
|
jsr WritePulse2PeriodA ; CPU:$FB84 PRG:3B84 20 6B F9
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_OnCarrySet2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_OnCarrySet2:
|
|
ldy ZpF4 ; CPU:$FB87 PRG:3B87 A4 F4
|
|
lda ZpF3 ; CPU:$FB89 PRG:3B89 A5 F3
|
|
and #$03 ; CPU:$FB8B PRG:3B8B 29 03
|
|
beq ProcessNoiseChannel_Loop3 ; CPU:$FB8D PRG:3B8D F0 0B
|
|
cmp #$03 ; CPU:$FB8F PRG:3B8F C9 03
|
|
beq ProcessNoiseChannel_Loop4 ; CPU:$FB91 PRG:3B91 F0 0D
|
|
tya ; CPU:$FB93 PRG:3B93 98
|
|
jsr YMinusXDiv8 ; CPU:$FB94 PRG:3B94 20 79 F9
|
|
tay ; CPU:$FB97 PRG:3B97 A8
|
|
bne ProcessNoiseChannel_Loop4 ; CPU:$FB98 PRG:3B98 D0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_Loop3:
|
|
tya ; CPU:$FB9A PRG:3B9A 98
|
|
jsr ComputeNotePeriod ; CPU:$FB9B PRG:3B9B 20 78 F9
|
|
sta ZpF4 ; CPU:$FB9E PRG:3B9E 85 F4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_Loop4:
|
|
tya ; CPU:$FBA0 PRG:3BA0 98
|
|
clc ; CPU:$FBA1 PRG:3BA1 18
|
|
rol a ; CPU:$FBA2 PRG:3BA2 2A
|
|
rol a ; CPU:$FBA3 PRG:3BA3 2A
|
|
sta APUPULSE2TIMERLO ; CPU:$FBA4 PRG:3BA4 8D 06 40
|
|
rol a ; CPU:$FBA7 PRG:3BA7 2A
|
|
sta APUPULSE2TIMERHI ; CPU:$FBA8 PRG:3BA8 8D 07 40
|
|
jmp WritePulse2Sweep ; CPU:$FBAB PRG:3BAB 4C A7 FC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_OnCarrySet3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_OnCarrySet3:
|
|
sty ZpFB ; CPU:$FBAE PRG:3BAE 84 FB
|
|
lda #$1D ; CPU:$FBB0 PRG:3BB0 A9 1D
|
|
sta ZpF3 ; CPU:$FBB2 PRG:3BB2 85 F3
|
|
lda #$08 ; CPU:$FBB4 PRG:3BB4 A9 08
|
|
sta ZpF4 ; CPU:$FBB6 PRG:3BB6 85 F4
|
|
lda #$1A ; CPU:$FBB8 PRG:3BB8 A9 1A
|
|
bne ProcessNoiseChannel_Loop5 ; CPU:$FBBA PRG:3BBA D0 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_OnCarrySet4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_OnCarrySet4:
|
|
lda ZpF3 ; CPU:$FBBC PRG:3BBC A5 F3
|
|
cmp #$1A ; CPU:$FBBE PRG:3BBE C9 1A
|
|
bne ProcessNoiseChannel_Loop6 ; CPU:$FBC0 PRG:3BC0 D0 05
|
|
lda #$4C ; CPU:$FBC2 PRG:3BC2 A9 4C
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_Loop5:
|
|
jsr Pulse2FreqXFour ; CPU:$FBC4 PRG:3BC4 20 EF F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_Loop6:
|
|
ldx #$86 ; CPU:$FBC7 PRG:3BC7 A2 86
|
|
dec ZpF4 ; CPU:$FBC9 PRG:3BC9 C6 F4
|
|
bne ProcessNoiseChannel_Loop7 ; CPU:$FBCB PRG:3BCB D0 06
|
|
lda #$04 ; CPU:$FBCD PRG:3BCD A9 04
|
|
sta ZpF4 ; CPU:$FBCF PRG:3BCF 85 F4
|
|
ldx #$46 ; CPU:$FBD1 PRG:3BD1 A2 46
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_Loop7:
|
|
jsr WritePulse2PeriodA ; CPU:$FBD3 PRG:3BD3 20 6B F9
|
|
bne StopPulse2Channel ; CPU:$FBD6 PRG:3BD6 D0 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_OnCarrySet5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_OnCarrySet5:
|
|
sty ZpFB ; CPU:$FBD8 PRG:3BD8 84 FB
|
|
lda #$20 ; CPU:$FBDA PRG:3BDA A9 20
|
|
sta ZpF3 ; CPU:$FBDC PRG:3BDC 85 F3
|
|
ldx #$46 ; CPU:$FBDE PRG:3BDE A2 46
|
|
ldy #$BE ; CPU:$FBE0 PRG:3BE0 A0 BE
|
|
lda #$10 ; CPU:$FBE2 PRG:3BE2 A9 10
|
|
bne ProcessNoiseEnvelope_OnNonzero2 ; CPU:$FBE4 PRG:3BE4 D0 4F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_OnCarrySet6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_OnCarrySet6:
|
|
jmp SetupNoiseChannel ; CPU:$FBE6 PRG:3BE6 4C 3E FB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseChannel_OnCarrySet7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseChannel_OnCarrySet7:
|
|
jmp ProcessNoiseChannel ; CPU:$FBE9 PRG:3BE9 4C 48 FB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseEnvelope
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseEnvelope:
|
|
ldy ZpFE ; CPU:$FBEC PRG:3BEC A4 FE
|
|
lda ZpFB ; CPU:$FBEE PRG:3BEE A5 FB
|
|
lsr a ; CPU:$FBF0 PRG:3BF0 4A
|
|
bcs ProcessNoiseChannel_OnCarrySet2 ; CPU:$FBF1 PRG:3BF1 B0 94
|
|
lsr ZpFE ; CPU:$FBF3 PRG:3BF3 46 FE
|
|
bcs ProcessNoiseChannel_OnCarrySet ; CPU:$FBF5 PRG:3BF5 B0 83
|
|
lsr ZpFE ; CPU:$FBF7 PRG:3BF7 46 FE
|
|
bcs ProcessNoiseChannel_OnCarrySet3 ; CPU:$FBF9 PRG:3BF9 B0 B3
|
|
lsr a ; CPU:$FBFB PRG:3BFB 4A
|
|
bcs ProcessNoiseChannel_OnCarrySet4 ; CPU:$FBFC PRG:3BFC B0 BE
|
|
lsr a ; CPU:$FBFE PRG:3BFE 4A
|
|
bcs ProcessNoiseChannel_OnCarrySet7 ; CPU:$FBFF PRG:3BFF B0 E8
|
|
lsr ZpFE ; CPU:$FC01 PRG:3C01 46 FE
|
|
bcs ProcessNoiseChannel_OnCarrySet6 ; CPU:$FC03 PRG:3C03 B0 E1
|
|
lsr ZpFE ; CPU:$FC05 PRG:3C05 46 FE
|
|
bcs ProcessNoiseChannel_OnCarrySet5 ; CPU:$FC07 PRG:3C07 B0 CF
|
|
lsr a ; CPU:$FC09 PRG:3C09 4A
|
|
bcs StopPulse2Channel ; CPU:$FC0A PRG:3C0A B0 2C
|
|
lsr ZpFE ; CPU:$FC0C PRG:3C0C 46 FE
|
|
bcs ProcessNoiseEnvelope_Loop ; CPU:$FC0E PRG:3C0E B0 19
|
|
lsr a ; CPU:$FC10 PRG:3C10 4A
|
|
bcs StopPulse2Channel ; CPU:$FC11 PRG:3C11 B0 25
|
|
lsr ZpFE ; CPU:$FC13 PRG:3C13 46 FE
|
|
bcs StopPulse2Channel_Loop ; CPU:$FC15 PRG:3C15 B0 2F
|
|
lsr a ; CPU:$FC17 PRG:3C17 4A
|
|
bcs StopPulse2Channel ; CPU:$FC18 PRG:3C18 B0 1E
|
|
lsr ZpFE ; CPU:$FC1A PRG:3C1A 46 FE
|
|
bcs StopPulse2Channel_Loop2 ; CPU:$FC1C PRG:3C1C B0 36
|
|
lsr a ; CPU:$FC1E PRG:3C1E 4A
|
|
bcs StopPulse2Channel_Loop3 ; CPU:$FC1F PRG:3C1F B0 3B
|
|
lsr ZpFE ; CPU:$FC21 PRG:3C21 46 FE
|
|
bcs StopPulse2Channel_Loop6 ; CPU:$FC23 PRG:3C23 B0 54
|
|
lsr a ; CPU:$FC25 PRG:3C25 4A
|
|
bcs StopPulse2Channel_Loop7 ; CPU:$FC26 PRG:3C26 B0 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseEnvelope_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseEnvelope_OnNonzero:
|
|
rts ; CPU:$FC28 PRG:3C28 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseEnvelope_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseEnvelope_Loop:
|
|
sty ZpFB ; CPU:$FC29 PRG:3C29 84 FB
|
|
lda #$18 ; CPU:$FC2B PRG:3C2B A9 18
|
|
sta ZpF3 ; CPU:$FC2D PRG:3C2D 85 F3
|
|
ldx #$44 ; CPU:$FC2F PRG:3C2F A2 44
|
|
ldy #$86 ; CPU:$FC31 PRG:3C31 A0 86
|
|
lda #$2A ; CPU:$FC33 PRG:3C33 A9 2A
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: ProcessNoiseEnvelope_OnNonzero2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
ProcessNoiseEnvelope_OnNonzero2:
|
|
jsr WritePulse2Ctrl ; CPU:$FC35 PRG:3C35 20 EC F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCFC38
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StopPulse2Channel:
|
|
dec ZpF3 ; CPU:$FC38 PRG:3C38 C6 F3
|
|
bne ProcessNoiseEnvelope_OnNonzero ; CPU:$FC3A PRG:3C3A D0 EC
|
|
lda #$00 ; CPU:$FC3C PRG:3C3C A9 00
|
|
sta ZpFB ; CPU:$FC3E PRG:3C3E 85 FB
|
|
lda #$10 ; CPU:$FC40 PRG:3C40 A9 10
|
|
sta APUPULSE2CTRL ; CPU:$FC42 PRG:3C42 8D 04 40
|
|
rts ; CPU:$FC45 PRG:3C45 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StopPulse2Channel_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StopPulse2Channel_Loop:
|
|
sty ZpFB ; CPU:$FC46 PRG:3C46 84 FB
|
|
lda #$14 ; CPU:$FC48 PRG:3C48 A9 14
|
|
sta ZpF3 ; CPU:$FC4A PRG:3C4A 85 F3
|
|
ldx #$A0 ; CPU:$FC4C PRG:3C4C A2 A0
|
|
ldy #$9D ; CPU:$FC4E PRG:3C4E A0 9D
|
|
lda #$34 ; CPU:$FC50 PRG:3C50 A9 34
|
|
bne ProcessNoiseEnvelope_OnNonzero2 ; CPU:$FC52 PRG:3C52 D0 E1
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StopPulse2Channel_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StopPulse2Channel_Loop2:
|
|
sty ZpFB ; CPU:$FC54 PRG:3C54 84 FB
|
|
lda #$2A ; CPU:$FC56 PRG:3C56 A9 2A
|
|
sta ZpF3 ; CPU:$FC58 PRG:3C58 85 F3
|
|
bne StopPulse2Channel_Loop4 ; CPU:$FC5A PRG:3C5A D0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StopPulse2Channel_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StopPulse2Channel_Loop3:
|
|
dec ZpF4 ; CPU:$FC5C PRG:3C5C C6 F4
|
|
bne StopPulse2Channel_Loop5 ; CPU:$FC5E PRG:3C5E D0 09
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StopPulse2Channel_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StopPulse2Channel_Loop4:
|
|
lda #$04 ; CPU:$FC60 PRG:3C60 A9 04
|
|
jsr Pulse2FreqXFour ; CPU:$FC62 PRG:3C62 20 EF F8
|
|
lda #$06 ; CPU:$FC65 PRG:3C65 A9 06
|
|
sta ZpF4 ; CPU:$FC67 PRG:3C67 85 F4
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StopPulse2Channel_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StopPulse2Channel_Loop5:
|
|
ldy ZpF4 ; CPU:$FC69 PRG:3C69 A4 F4
|
|
lda $F8F9,y ; CPU:$FC6B PRG:3C6B B9 F9 F8
|
|
tay ; CPU:$FC6E PRG:3C6E A8
|
|
ldx #$88 ; CPU:$FC6F PRG:3C6F A2 88
|
|
stx APUPULSE2CTRL ; CPU:$FC71 PRG:3C71 8E 04 40
|
|
jsr WritePulse2Period ; CPU:$FC74 PRG:3C74 20 6D F9
|
|
bne StopPulse2Channel ; CPU:$FC77 PRG:3C77 D0 BF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StopPulse2Channel_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StopPulse2Channel_Loop6:
|
|
sty ZpFB ; CPU:$FC79 PRG:3C79 84 FB
|
|
lda #$1C ; CPU:$FC7B PRG:3C7B A9 1C
|
|
sta ZpF3 ; CPU:$FC7D PRG:3C7D 85 F3
|
|
lda #$1C ; CPU:$FC7F PRG:3C7F A9 1C
|
|
ldx #$95 ; CPU:$FC81 PRG:3C81 A2 95
|
|
ldy #$95 ; CPU:$FC83 PRG:3C83 A0 95
|
|
jsr WritePulse2Ctrl ; CPU:$FC85 PRG:3C85 20 EC F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StopPulse2Channel_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StopPulse2Channel_Loop7:
|
|
lda ZpF3 ; CPU:$FC88 PRG:3C88 A5 F3
|
|
cmp #$17 ; CPU:$FC8A PRG:3C8A C9 17
|
|
bcc StopPulse2Channel_Loop8 ; CPU:$FC8C PRG:3C8C 90 07
|
|
bne StopPulse2Channel ; CPU:$FC8E PRG:3C8E D0 A8
|
|
lda #$26 ; CPU:$FC90 PRG:3C90 A9 26
|
|
jsr Pulse2FreqXFour ; CPU:$FC92 PRG:3C92 20 EF F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StopPulse2Channel_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StopPulse2Channel_Loop8:
|
|
ldy #$97 ; CPU:$FC95 PRG:3C95 A0 97
|
|
lda ZpF3 ; CPU:$FC97 PRG:3C97 A5 F3
|
|
cmp #$0E ; CPU:$FC99 PRG:3C99 C9 0E
|
|
bcs StopPulse2Channel_OnCarrySet ; CPU:$FC9B PRG:3C9B B0 04
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StopPulse2Channel_OnCarryClear
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StopPulse2Channel_OnCarryClear:
|
|
lsr a ; CPU:$FC9D PRG:3C9D 4A
|
|
ora #$90 ; CPU:$FC9E PRG:3C9E 09 90
|
|
tay ; CPU:$FCA0 PRG:3CA0 A8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: StopPulse2Channel_OnCarrySet
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
StopPulse2Channel_OnCarrySet:
|
|
sty APUPULSE2CTRL ; CPU:$FCA1 PRG:3CA1 8C 04 40
|
|
jmp StopPulse2Channel ; CPU:$FCA4 PRG:3CA4 4C 38 FC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCFCA7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WritePulse2Sweep:
|
|
ldy #$9A ; CPU:$FCA7 PRG:3CA7 A0 9A
|
|
lda ZpF3 ; CPU:$FCA9 PRG:3CA9 A5 F3
|
|
cmp #$14 ; CPU:$FCAB PRG:3CAB C9 14
|
|
bcs StopPulse2Channel_OnCarrySet ; CPU:$FCAD PRG:3CAD B0 F2
|
|
bcc StopPulse2Channel_OnCarryClear ; CPU:$FCAF PRG:3CAF 90 EC
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WritePulse2Sweep_OnCarrySet
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WritePulse2Sweep_OnCarrySet:
|
|
lda #$08 ; CPU:$FCB1 PRG:3CB1 A9 08
|
|
sta ZpF5 ; CPU:$FCB3 PRG:3CB3 85 F5
|
|
lda #$08 ; CPU:$FCB5 PRG:3CB5 A9 08
|
|
sta APUTRIANGLECTRL ; CPU:$FCB7 PRG:3CB7 8D 08 40
|
|
lda #$34 ; CPU:$FCBA PRG:3CBA A9 34
|
|
sta APUTRIANGLETIMERLO ; CPU:$FCBC PRG:3CBC 8D 0A 40
|
|
lda #$08 ; CPU:$FCBF PRG:3CBF A9 08
|
|
sta APUTRIANGLETIMERHI ; CPU:$FCC1 PRG:3CC1 8D 0B 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: WritePulse2Sweep_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
WritePulse2Sweep_OnNonzero:
|
|
dec ZpF5 ; CPU:$FCC4 PRG:3CC4 C6 F5
|
|
jmp UpdateSoundChannel ; CPU:$FCC6 PRG:3CC6 4C 27 FD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCFCC9
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundState:
|
|
lda ZpF9 ; CPU:$FCC9 PRG:3CC9 A5 F9
|
|
bne UpdateSoundChannel ; CPU:$FCCB PRG:3CCB D0 5A
|
|
lda ZpFC ; CPU:$FCCD PRG:3CCD A5 FC
|
|
lsr a ; CPU:$FCCF PRG:3CCF 4A
|
|
lsr a ; CPU:$FCD0 PRG:3CD0 4A
|
|
ldx ZpF5 ; CPU:$FCD1 PRG:3CD1 A6 F5
|
|
bne WritePulse2Sweep_OnNonzero ; CPU:$FCD3 PRG:3CD3 D0 EF
|
|
lsr a ; CPU:$FCD5 PRG:3CD5 4A
|
|
bcs WritePulse2Sweep_OnCarrySet ; CPU:$FCD6 PRG:3CD6 B0 D9
|
|
lsr a ; CPU:$FCD8 PRG:3CD8 4A
|
|
bcs UpdateSoundState_Loop ; CPU:$FCD9 PRG:3CD9 B0 08
|
|
ldx $06C0 ; CPU:$FCDB PRG:3CDB AE C0 06
|
|
bne UpdateSoundState_Loop2 ; CPU:$FCDE PRG:3CDE D0 13
|
|
jmp UpdateSoundChannel ; CPU:$FCE0 PRG:3CE0 4C 27 FD
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundState_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundState_Loop:
|
|
lda #$0E ; CPU:$FCE3 PRG:3CE3 A9 0E
|
|
sta $06C0 ; CPU:$FCE5 PRG:3CE5 8D C0 06
|
|
lda #$FE ; CPU:$FCE8 PRG:3CE8 A9 FE
|
|
sta ZpF6 ; CPU:$FCEA PRG:3CEA 85 F6
|
|
lda #$08 ; CPU:$FCEC PRG:3CEC A9 08
|
|
sta APUTRIANGLECTRL ; CPU:$FCEE PRG:3CEE 8D 08 40
|
|
bne UpdateSoundState_Loop3 ; CPU:$FCF1 PRG:3CF1 D0 18
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundState_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundState_Loop2:
|
|
dec $06C0 ; CPU:$FCF3 PRG:3CF3 CE C0 06
|
|
lda $06C0 ; CPU:$FCF6 PRG:3CF6 AD C0 06
|
|
cmp #$08 ; CPU:$FCF9 PRG:3CF9 C9 08
|
|
bcs UpdateSoundState_Loop3 ; CPU:$FCFB PRG:3CFB B0 0E
|
|
ldy ZpF6 ; CPU:$FCFD PRG:3CFD A4 F6
|
|
jsr DivideYBy8 ; CPU:$FCFF PRG:3CFF 20 74 F9
|
|
sta ZpF6 ; CPU:$FD02 PRG:3D02 85 F6
|
|
lda $06C0 ; CPU:$FD04 PRG:3D04 AD C0 06
|
|
and #$03 ; CPU:$FD07 PRG:3D07 29 03
|
|
beq UpdateSoundState_Loop4 ; CPU:$FD09 PRG:3D09 F0 0F
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundState_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundState_Loop3:
|
|
lda $0500 ; CPU:$FD0B PRG:3D0B AD 00 05
|
|
lsr a ; CPU:$FD0E PRG:3D0E 4A
|
|
bcc UpdateSoundState_Loop4 ; CPU:$FD0F PRG:3D0F 90 09
|
|
lda ZpF6 ; CPU:$FD11 PRG:3D11 A5 F6
|
|
clc ; CPU:$FD13 PRG:3D13 18
|
|
rol a ; CPU:$FD14 PRG:3D14 2A
|
|
sta APUTRIANGLETIMERLO ; CPU:$FD15 PRG:3D15 8D 0A 40
|
|
bne UpdateSoundState_Loop5 ; CPU:$FD18 PRG:3D18 D0 07
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundState_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundState_Loop4:
|
|
lda ZpF6 ; CPU:$FD1A PRG:3D1A A5 F6
|
|
rol a ; CPU:$FD1C PRG:3D1C 2A
|
|
rol a ; CPU:$FD1D PRG:3D1D 2A
|
|
sta APUTRIANGLETIMERLO ; CPU:$FD1E PRG:3D1E 8D 0A 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundState_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundState_Loop5:
|
|
rol a ; CPU:$FD21 PRG:3D21 2A
|
|
and #$03 ; CPU:$FD22 PRG:3D22 29 03
|
|
sta APUTRIANGLETIMERHI ; CPU:$FD24 PRG:3D24 8D 0B 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: SubCFD27
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel:
|
|
lda ZpFD ; CPU:$FD27 PRG:3D27 A5 FD
|
|
bne UpdateSoundChannel_Loop ; CPU:$FD29 PRG:3D29 D0 08
|
|
lda $06A2 ; CPU:$FD2B PRG:3D2B AD A2 06
|
|
bne UpdateSoundChannel_Loop3 ; CPU:$FD2E PRG:3D2E D0 48
|
|
jmp ProcessNoiseEnvelope ; CPU:$FD30 PRG:3D30 4C EC FB
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop:
|
|
ldy #$07 ; CPU:$FD33 PRG:3D33 A0 07
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_OnNonzero
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_OnNonzero:
|
|
asl a ; CPU:$FD35 PRG:3D35 0A
|
|
bcs UpdateSoundChannel_Loop2 ; CPU:$FD36 PRG:3D36 B0 03
|
|
dey ; CPU:$FD38 PRG:3D38 88
|
|
bne UpdateSoundChannel_OnNonzero ; CPU:$FD39 PRG:3D39 D0 FA
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop2
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop2:
|
|
inc $06A2 ; CPU:$FD3B PRG:3D3B EE A2 06
|
|
sty $06F2 ; CPU:$FD3E PRG:3D3E 8C F2 06
|
|
lda $FE64,y ; CPU:$FD41 PRG:3D41 B9 64 FE
|
|
tay ; CPU:$FD44 PRG:3D44 A8
|
|
lda $FE64,y ; CPU:$FD45 PRG:3D45 B9 64 FE
|
|
sta $068D ; CPU:$FD48 PRG:3D48 8D 8D 06
|
|
lda $FE65,y ; CPU:$FD4B PRG:3D4B B9 65 FE
|
|
sta ZpF7 ; CPU:$FD4E PRG:3D4E 85 F7
|
|
lda $FE66,y ; CPU:$FD50 PRG:3D50 B9 66 FE
|
|
sta ZpF8 ; CPU:$FD53 PRG:3D53 85 F8
|
|
lda $FE67,y ; CPU:$FD55 PRG:3D55 B9 67 FE
|
|
sta ZpF9 ; CPU:$FD58 PRG:3D58 85 F9
|
|
lda $FE68,y ; CPU:$FD5A PRG:3D5A B9 68 FE
|
|
sta ZpFA ; CPU:$FD5D PRG:3D5D 85 FA
|
|
lda $FE69,y ; CPU:$FD5F PRG:3D5F B9 69 FE
|
|
sta $0686 ; CPU:$FD62 PRG:3D62 8D 86 06
|
|
lda #$01 ; CPU:$FD65 PRG:3D65 A9 01
|
|
sta $0695 ; CPU:$FD67 PRG:3D67 8D 95 06
|
|
sta $0696 ; CPU:$FD6A PRG:3D6A 8D 96 06
|
|
sta $0698 ; CPU:$FD6D PRG:3D6D 8D 98 06
|
|
sta $069A ; CPU:$FD70 PRG:3D70 8D 9A 06
|
|
ldy #$00 ; CPU:$FD73 PRG:3D73 A0 00
|
|
sty $0682 ; CPU:$FD75 PRG:3D75 8C 82 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop3
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop3:
|
|
ldy ZpFA ; CPU:$FD78 PRG:3D78 A4 FA
|
|
beq UpdateSoundChannel_Loop7 ; CPU:$FD7A PRG:3D7A F0 33
|
|
dec $0696 ; CPU:$FD7C PRG:3D7C CE 96 06
|
|
bne UpdateSoundChannel_Loop7 ; CPU:$FD7F PRG:3D7F D0 2E
|
|
inc ZpFA ; CPU:$FD81 PRG:3D81 E6 FA
|
|
lda (ZpF7),y ; CPU:$FD83 PRG:3D83 B1 F7
|
|
beq UpdateSoundChannel_Loop8 ; CPU:$FD85 PRG:3D85 F0 37
|
|
bpl UpdateSoundChannel_Loop4 ; CPU:$FD87 PRG:3D87 10 0C
|
|
jsr LookupNoteTable ; CPU:$FD89 PRG:3D89 20 87 F9
|
|
sta $0691 ; CPU:$FD8C PRG:3D8C 8D 91 06
|
|
ldy ZpFA ; CPU:$FD8F PRG:3D8F A4 FA
|
|
inc ZpFA ; CPU:$FD91 PRG:3D91 E6 FA
|
|
lda (ZpF7),y ; CPU:$FD93 PRG:3D93 B1 F7
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop4
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop4:
|
|
jsr Pulse2FreqXZero ; CPU:$FD95 PRG:3D95 20 D8 F8
|
|
bne UpdateSoundChannel_Loop5 ; CPU:$FD98 PRG:3D98 D0 04
|
|
ldx #$10 ; CPU:$FD9A PRG:3D9A A2 10
|
|
bne UpdateSoundChannel_Loop6 ; CPU:$FD9C PRG:3D9C D0 08
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop5
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop5:
|
|
ldx #$06 ; CPU:$FD9E PRG:3D9E A2 06
|
|
lda ZpF9 ; CPU:$FDA0 PRG:3DA0 A5 F9
|
|
bne UpdateSoundChannel_Loop6 ; CPU:$FDA2 PRG:3DA2 D0 02
|
|
ldx #$86 ; CPU:$FDA4 PRG:3DA4 A2 86
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop6
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop6:
|
|
jsr AudioPulse1SweepSet ; CPU:$FDA6 PRG:3DA6 20 C6 F8
|
|
lda $0691 ; CPU:$FDA9 PRG:3DA9 AD 91 06
|
|
sta $0696 ; CPU:$FDAC PRG:3DAC 8D 96 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop7
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop7:
|
|
dec $0695 ; CPU:$FDAF PRG:3DAF CE 95 06
|
|
bne UpdateSoundChannel_Loop11 ; CPU:$FDB2 PRG:3DB2 D0 4E
|
|
ldy $0682 ; CPU:$FDB4 PRG:3DB4 AC 82 06
|
|
inc $0682 ; CPU:$FDB7 PRG:3DB7 EE 82 06
|
|
lda (ZpF7),y ; CPU:$FDBA PRG:3DBA B1 F7
|
|
bne UpdateSoundChannel_Loop9 ; CPU:$FDBC PRG:3DBC D0 1C
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop8
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop8:
|
|
jsr AudioPulse1CtrlSetup ; CPU:$FDBE PRG:3DBE 20 C2 F8
|
|
lda #$00 ; CPU:$FDC1 PRG:3DC1 A9 00
|
|
sta ZpFA ; CPU:$FDC3 PRG:3DC3 85 FA
|
|
sta ZpF9 ; CPU:$FDC5 PRG:3DC5 85 F9
|
|
sta ZpF0 ; CPU:$FDC7 PRG:3DC7 85 F0
|
|
sta ZpFB ; CPU:$FDC9 PRG:3DC9 85 FB
|
|
sta $06A2 ; CPU:$FDCB PRG:3DCB 8D A2 06
|
|
sta $06C0 ; CPU:$FDCE PRG:3DCE 8D C0 06
|
|
sta APUTRIANGLECTRL ; CPU:$FDD1 PRG:3DD1 8D 08 40
|
|
lda #$10 ; CPU:$FDD4 PRG:3DD4 A9 10
|
|
sta APUPULSE2CTRL ; CPU:$FDD6 PRG:3DD6 8D 04 40
|
|
rts ; CPU:$FDD9 PRG:3DD9 60
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop9
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop9:
|
|
jsr RotateBitsForTableLookup ; CPU:$FDDA PRG:3DDA 20 81 F9
|
|
sta $0695 ; CPU:$FDDD PRG:3DDD 8D 95 06
|
|
txa ; CPU:$FDE0 PRG:3DE0 8A
|
|
and #$3E ; CPU:$FDE1 PRG:3DE1 29 3E
|
|
jsr Pulse2FreqXFour ; CPU:$FDE3 PRG:3DE3 20 EF F8
|
|
beq UpdateSoundChannel_Loop11 ; CPU:$FDE6 PRG:3DE6 F0 1A
|
|
ldx #$9F ; CPU:$FDE8 PRG:3DE8 A2 9F
|
|
lda $06F2 ; CPU:$FDEA PRG:3DEA AD F2 06
|
|
beq UpdateSoundChannel_Loop10 ; CPU:$FDED PRG:3DED F0 0B
|
|
ldx #$87 ; CPU:$FDEF PRG:3DEF A2 87
|
|
lda $0695 ; CPU:$FDF1 PRG:3DF1 AD 95 06
|
|
cmp #$10 ; CPU:$FDF4 PRG:3DF4 C9 10
|
|
bcs UpdateSoundChannel_Loop10 ; CPU:$FDF6 PRG:3DF6 B0 02
|
|
ldx #$84 ; CPU:$FDF8 PRG:3DF8 A2 84
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop10
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop10:
|
|
stx APUPULSE2CTRL ; CPU:$FDFA PRG:3DFA 8E 04 40
|
|
lda #$7F ; CPU:$FDFD PRG:3DFD A9 7F
|
|
sta APUPULSE2SWEEP ; CPU:$FDFF PRG:3DFF 8D 05 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop11
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop11:
|
|
ldy ZpF9 ; CPU:$FE02 PRG:3E02 A4 F9
|
|
beq UpdateSoundChannel_Loop14 ; CPU:$FE04 PRG:3E04 F0 27
|
|
dec $0698 ; CPU:$FE06 PRG:3E06 CE 98 06
|
|
bne UpdateSoundChannel_Loop14 ; CPU:$FE09 PRG:3E09 D0 22
|
|
inc ZpF9 ; CPU:$FE0B PRG:3E0B E6 F9
|
|
lda (ZpF7),y ; CPU:$FE0D PRG:3E0D B1 F7
|
|
jsr RotateBitsForTableLookup ; CPU:$FE0F PRG:3E0F 20 81 F9
|
|
sta $0698 ; CPU:$FE12 PRG:3E12 8D 98 06
|
|
clc ; CPU:$FE15 PRG:3E15 18
|
|
adc #$FE ; CPU:$FE16 PRG:3E16 69 FE
|
|
asl a ; CPU:$FE18 PRG:3E18 0A
|
|
asl a ; CPU:$FE19 PRG:3E19 0A
|
|
cmp #$38 ; CPU:$FE1A PRG:3E1A C9 38
|
|
bcc UpdateSoundChannel_Loop12 ; CPU:$FE1C PRG:3E1C 90 02
|
|
lda #$38 ; CPU:$FE1E PRG:3E1E A9 38
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop12
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop12:
|
|
ldy $06F2 ; CPU:$FE20 PRG:3E20 AC F2 06
|
|
bne UpdateSoundChannel_Loop13 ; CPU:$FE23 PRG:3E23 D0 02
|
|
lda #$FF ; CPU:$FE25 PRG:3E25 A9 FF
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop13
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop13:
|
|
sta APUTRIANGLECTRL ; CPU:$FE27 PRG:3E27 8D 08 40
|
|
jsr ProcessTriangleChannel ; CPU:$FE2A PRG:3E2A 20 F3 F8
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop14
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop14:
|
|
lda $06F2 ; CPU:$FE2D PRG:3E2D AD F2 06
|
|
cmp #$07 ; CPU:$FE30 PRG:3E30 C9 07
|
|
bne UpdateSoundChannel_Loop17 ; CPU:$FE32 PRG:3E32 D0 2F
|
|
dec $069A ; CPU:$FE34 PRG:3E34 CE 9A 06
|
|
bne UpdateSoundChannel_Loop17 ; CPU:$FE37 PRG:3E37 D0 2A
|
|
ldy $0686 ; CPU:$FE39 PRG:3E39 AC 86 06
|
|
inc $0686 ; CPU:$FE3C PRG:3E3C EE 86 06
|
|
lda (ZpF7),y ; CPU:$FE3F PRG:3E3F B1 F7
|
|
jsr RotateBitsForTableLookup ; CPU:$FE41 PRG:3E41 20 81 F9
|
|
sta $069A ; CPU:$FE44 PRG:3E44 8D 9A 06
|
|
txa ; CPU:$FE47 PRG:3E47 8A
|
|
and #$3E ; CPU:$FE48 PRG:3E48 29 3E
|
|
bne UpdateSoundChannel_Loop15 ; CPU:$FE4A PRG:3E4A D0 08
|
|
lda #$00 ; CPU:$FE4C PRG:3E4C A9 00
|
|
ldx #$02 ; CPU:$FE4E PRG:3E4E A2 02
|
|
ldy #$08 ; CPU:$FE50 PRG:3E50 A0 08
|
|
bne UpdateSoundChannel_Loop16 ; CPU:$FE52 PRG:3E52 D0 06
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop15
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop15:
|
|
lda #$02 ; CPU:$FE54 PRG:3E54 A9 02
|
|
ldx #$00 ; CPU:$FE56 PRG:3E56 A2 00
|
|
ldy #$28 ; CPU:$FE58 PRG:3E58 A0 28
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop16
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop16:
|
|
sta APUNOISECTRL ; CPU:$FE5A PRG:3E5A 8D 0C 40
|
|
stx APUNOISEPERIOD ; CPU:$FE5D PRG:3E5D 8E 0E 40
|
|
sty APUNOISELENGTH ; CPU:$FE60 PRG:3E60 8C 0F 40
|
|
; -----------------------------------------------------------------------------
|
|
; Routine: UpdateSoundChannel_Loop17
|
|
; 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.
|
|
; -----------------------------------------------------------------------------
|
|
UpdateSoundChannel_Loop17:
|
|
rts ; CPU:$FE63 PRG:3E63 60
|
|
; ---- data $FE64-$FFFF (412 bytes) ----
|
|
; referenced by `lda $FE64,y` at $FD41 (operand $FE64 falls inside this region)
|
|
; referenced by `lda $FE64,y` at $FD45 (operand $FE64 falls inside this region)
|
|
; referenced by `lda $FE65,y` at $FD4B (operand $FE65 falls inside this region)
|
|
; referenced by `lda $FE66,y` at $FD50 (operand $FE66 falls inside this region)
|
|
; referenced by `lda $FE67,y` at $FD55 (operand $FE67 falls inside this region)
|
|
; referenced by `lda $FE68,y` at $FD5A (operand $FE68 falls inside this region)
|
|
; ... and 1 further references from decoded code
|
|
VectorPageAndSoundData:
|
|
.byte $08, $0D, $12, $17, $1C, $21, $26, $2B, $0F, $95, $FE, $30, $00, $00, $D1, $FE ; CPU:$FE64 PRG:3E64 08 0D 12 17 1C 21 26 2B 0F 95 FE 30 00 00 D1 FE
|
|
.byte $00, $08, $00, $E6, $FE, $0A, $00, $0F, $F3, $FE, $00, $00, $07, $FC, $FE, $03 ; CPU:$FE74 PRG:3E74 00 08 00 E6 FE 0A 00 0F F3 FE 00 00 07 FC FE 03
|
|
.byte $00, $00, $0B, $FF, $00, $00, $07, $0D, $FF, $18, $00, $16, $44, $FF, $1F, $38 ; CPU:$FE84 PRG:3E84 00 00 0B FF 00 00 07 0D FF 18 00 16 44 FF 1F 38
|
|
.byte $7E, $5D, $78, $5D, $78, $5C, $78, $5C, $62, $E6, $65, $5E, $65, $5E, $64, $5E ; CPU:$FE94 PRG:3E94 7E 5D 78 5D 78 5C 78 5C 62 E6 65 5E 65 5E 64 5E
|
|
.byte $40, $5E, $F8, $00, $85, $06, $81, $26, $85, $06, $81, $26, $06, $26, $06, $0E ; CPU:$FEA4 PRG:3EA4 40 5E F8 00 85 06 81 26 85 06 81 26 06 26 06 0E
|
|
.byte $83, $12, $85, $10, $81, $0A, $85, $10, $81, $0A, $10, $0A, $2E, $0A, $83, $26 ; CPU:$FEB4 PRG:3EB4 83 12 85 10 81 0A 85 10 81 0A 10 0A 2E 0A 83 26
|
|
.byte $00, $5D, $78, $5D, $78, $1D, $5F, $40, $5F, $40, $9E, $80, $F8, $6E, $6A, $A6 ; CPU:$FEC4 PRG:3EC4 00 5D 78 5D 78 1D 5F 40 5F 40 9E 80 F8 6E 6A A6
|
|
.byte $A6, $A6, $AE, $07, $00, $82, $46, $38, $32, $4A, $48, $81, $40, $42, $44, $48 ; CPU:$FED4 PRG:3ED4 A6 A6 AE 07 00 82 46 38 32 4A 48 81 40 42 44 48
|
|
.byte $84, $30, $66, $6E, $4A, $50, $52, $50, $4A, $6E, $27, $00, $E6, $DE, $39, $04 ; CPU:$FEE4 PRG:3EE4 84 30 66 6E 4A 50 52 50 4A 6E 27 00 E6 DE 39 04
|
|
.byte $12, $04, $12, $04, $12, $04, $D2, $00, $83, $83, $00, $46, $46, $4E, $52, $42 ; CPU:$FEF4 PRG:3EF4 12 04 12 04 12 04 D2 00 83 83 00 46 46 4E 52 42
|
|
.byte $4E, $12, $14, $16, $18, $1A, $05, $E6, $00, $2E, $46, $02, $AE, $6A, $67, $28 ; CPU:$FF04 PRG:3F04 4E 12 14 16 18 1A 05 E6 00 2E 46 02 AE 6A 67 28
|
|
.byte $6A, $02, $A6, $64, $63, $9E, $A4, $6A, $47, $08, $4B, $02, $0C, $4F, $02, $07 ; CPU:$FF14 PRG:3F14 6A 02 A6 64 63 9E A4 6A 47 08 4B 02 0C 4F 02 07
|
|
.byte $00, $86, $A6, $A2, $9C, $AA, $A2, $9C, $BC, $9E, $BC, $B6, $B2, $26, $24, $26 ; CPU:$FF24 PRG:3F24 00 86 A6 A2 9C AA A2 9C BC 9E BC B6 B2 26 24 26
|
|
.byte $24, $A6, $22, $1E, $22, $1E, $A2, $1C, $00, $1C, $00, $1C, $00, $1C, $00, $1D ; CPU:$FF34 PRG:3F34 24 A6 22 1E 22 1E A2 1C 00 1C 00 1C 00 1C 00 1D
|
|
.byte $47, $EA, $42, $66, $AA, $AC, $6A, $A6, $47, $EA, $42, $66, $AA, $AC, $6A, $A6 ; CPU:$FF44 PRG:3F44 47 EA 42 66 AA AC 6A A6 47 EA 42 66 AA AC 6A A6
|
|
.byte $6A, $AC, $86, $6C, $AA, $6C, $86, $8A, $46, $4A, $4E, $D0, $D2, $11, $00, $77 ; CPU:$FF54 PRG:3F54 6A AC 86 6C AA 6C 86 8A 46 4A 4E D0 D2 11 00 77
|
|
.byte $76, $F6, $5D, $5C, $DC, $77, $76, $F6, $5D, $5C, $DC, $65, $64, $E4, $7F, $7E ; CPU:$FF64 PRG:3F64 76 F6 5D 5C DC 77 76 F6 5D 5C DC 65 64 E4 7F 7E
|
|
.byte $FE, $BE, $B6, $9C, $B8, $A4, $9C, $F6, $82, $2A, $81, $36, $82, $24, $81, $1C ; CPU:$FF74 PRG:3F74 FE BE B6 9C B8 A4 9C F6 82 2A 81 36 82 24 81 1C
|
|
.byte $1E, $20, $22, $24, $1C, $26, $1C, $24, $1C, $22, $82, $2A, $81, $36, $82, $24 ; CPU:$FF84 PRG:3F84 1E 20 22 24 1C 26 1C 24 1C 22 82 2A 81 36 82 24
|
|
.byte $81, $1C, $1E, $24, $22, $24, $1C, $26, $1C, $24, $22, $1C, $24, $26, $1C, $2A ; CPU:$FF94 PRG:3F94 81 1C 1E 24 22 24 1C 26 1C 24 22 1C 24 26 1C 2A
|
|
.byte $24, $26, $1C, $24, $26, $2A, $24, $2C, $1E, $2A, $24, $2C, $0A, $2C, $06, $0A ; CPU:$FFA4 PRG:3FA4 24 26 1C 24 26 2A 24 2C 1E 2A 24 2C 0A 2C 06 0A
|
|
.byte $0E, $06, $0A, $0E, $80, $2E, $86, $06, $82, $3A, $81, $3C, $84, $36, $40, $44 ; CPU:$FFB4 PRG:3FB4 0E 06 0A 0E 80 2E 86 06 82 3A 81 3C 84 36 40 44
|
|
.byte $44, $44, $40, $44, $40, $44, $40, $44, $44, $44, $40, $44, $40, $44, $40, $44 ; CPU:$FFC4 PRG:3FC4 44 44 40 44 40 44 40 44 44 44 40 44 40 44 40 44
|
|
.byte $44, $44, $40, $44, $40, $44, $40, $44, $44, $44, $40, $44, $40, $44, $40, $44 ; CPU:$FFD4 PRG:3FD4 44 44 40 44 40 44 40 44 44 44 40 44 40 44 40 44
|
|
.byte $44, $44, $40, $44, $44, $44, $40, $44, $44, $44, $40, $44, $44, $84, $84, $84 ; CPU:$FFE4 PRG:3FE4 44 44 40 44 44 44 40 44 44 44 40 44 44 84 84 84
|
|
.byte $84, $84, $44, $44, $44, $05, $7D, $C0, $00, $C0, $00, $C0 ; CPU:$FFF4 PRG:3FF4 84 84 44 44 44 05 7D C0 00 C0 00 C0
|