Standardizes build process and adds OVERVIEW.md for each

This commit is contained in:
tmerritt committed 2026-10-15 18:50:41 -04:00
1 parent 25423d3828
commit a29b03b00b
135 files changed
+26562 -420

No files matched your search

+41 -53
View File
@@ -154,7 +154,7 @@ NmiHandler:
lda PpuBufferReadOffset ; $00A3: A5 52
cmp PpuBufferWriteOffset ; $00A5: C5 53
beq Label_C0AC ; $00A7: F0 03
jsr Sub_C17C ; $00A9: 20 7C C1
jsr FlushPpuCommandPreserved ; $00A9: 20 7C C1
Label_C0AC:
jsr UpdatePpuTransferSources ; $00AC: 20 0D D6
jsr BuildFrameOam ; $00AF: 20 98 D7
@@ -340,7 +340,7 @@ SetPpuMask:
;===============================================================================
WaitForFrameAndSetPpuMask:
jsr Sub_C154 ; $0119: 20 54 C1
jsr BuildPpuCommand ; $0119: 20 54 C1
ldy #$00 ; $011C: A0 00
Label_C11E:
lda $0057,y ; $011E: B9 57 00
@@ -439,26 +439,27 @@ Label_C144:
tax ; $0152: AA
rts ; $0153: 60
;===============================================================================
; Sub_C154
; BuildPpuCommand
;
; Global:
; Reachable game-engine routine identified during recursive Pass-1 tracing.
; Builds a PPU command-buffer entry from the pending command address/length.
;
; Local:
; Performs the control flow beginning at CPU $C154; detailed semantics are
; refined as its RAM and table dependencies are traced.
; Formats the PPU command (address high byte with $20 prefix, address low
; byte, length) and writes it into the command buffer at $0300.
;
; Parameters:
; Caller-defined register and global RAM state.
; PpuCommandAddressLo/Hi ($55/$54), PpuCommandLength ($56),
; PpuBufferWriteOffset ($53).
;
; Returns:
; Routine-specific result; register preservation remains provisional.
; PpuBufferWriteOffset advanced; command bytes appended to $0300 buffer.
;
; PRG offset: $0154
; CPU address: $C154
;===============================================================================
Sub_C154:
BuildPpuCommand:
ldx PpuBufferWriteOffset ; $0154: A6 53
lda #$00 ; $0156: A9 00
sta Temp12 ; $0158: 85 12
@@ -505,26 +506,26 @@ AppendPpuAddressAndLength:
inx ; $017A: E8
rts ; $017B: 60
;===============================================================================
; Sub_C17C
; FlushPpuCommandPreserved
;
; Global:
; Reachable game-engine routine identified during recursive Pass-1 tracing.
; Flushes the PPU command buffer while preserving the X and Y registers.
;
; Local:
; Performs the control flow beginning at CPU $C17C; detailed semantics are
; refined as its RAM and table dependencies are traced.
; Saves X/Y, calls PreserveXYAndFinalizePpuCommand to walk the $0300 command
; buffer and write pending PPU updates, then restores X/Y.
;
; Parameters:
; Caller-defined register and global RAM state.
; PpuBufferReadOffset/WriteOffset ($52/$53).
;
; Returns:
; Routine-specific result; register preservation remains provisional.
; X and Y preserved; PPU command buffer drained.
;
; PRG offset: $017C
; CPU address: $C17C
;===============================================================================
Sub_C17C:
FlushPpuCommandPreserved:
tya ; $017C: 98
pha ; $017D: 48
txa ; $017E: 8A
@@ -978,35 +979,38 @@ SpawnAtRandomPosition:
jsr GetRandomValue ; $03F7: 20 B3 F1
and #$7F ; $03FA: 29 7F
cmp #$04 ; $03FC: C9 04
bcc Sub_C40C ; $03FE: 90 0C
bcc SpawnRandomObject ; $03FE: 90 0C
cmp #$18 ; $0400: C9 18
bcs Sub_C40C ; $0402: B0 08
bcs SpawnRandomObject ; $0402: B0 08
asl a ; $0404: 0A
asl a ; $0405: 0A
asl a ; $0406: 0A
sta SpawnPixelPosition ; $0407: 85 15
jsr AllocateEffectObject ; $0409: 20 6B C4
;===============================================================================
; Sub_C40C
; SpawnRandomObject
;
; Global:
; Reachable game-engine routine identified during recursive Pass-1 tracing.
; Spawns a gameplay object at a randomized screen position.
;
; Local:
; Performs the control flow beginning at CPU $C40C; detailed semantics are
; refined as its RAM and table dependencies are traced.
; Picks a random Y position in the valid band, snaps it to a 32-pixel grid,
; derives a spawn parameter from random state and the spawn selector table,
; allocates a gameplay-object slot, then retries (optionally reflecting Y
; velocity) until the object is placed or the slot pool is exhausted.
;
; Parameters:
; Caller-defined register and global RAM state.
; RandomState ($1B), SpawnSelector ($BA), SpawnSelectorAdjustmentTable.
;
; Returns:
; Routine-specific result; register preservation remains provisional.
; A gameplay object allocated and initialized; X = slot ($00-$13) or $FF if
; the pool is full.
;
; PRG offset: $040C
; CPU address: $C40C
;===============================================================================
Sub_C40C:
SpawnRandomObject:
jsr GetRandomValue ; $040C: 20 B3 F1
and #$3F ; $040F: 29 3F
cmp #$02 ; $0411: C9 02
@@ -1025,9 +1029,9 @@ Sub_C40C:
jsr $C486 ; $042A: 20 86 C4
jsr GetRandomValue ; $042D: 20 B3 F1
lsr a ; $0430: 4A
bcc Sub_C40C ; $0431: 90 D9
bcc SpawnRandomObject ; $0431: 90 D9
jsr ReflectObjectYVelocity ; $0433: 20 4F CA
jmp Sub_C40C ; $0436: 4C 0C C4
jmp SpawnRandomObject ; $0436: 4C 0C C4
Label_C439:
rts ; $0439: 60
SpawnSelectorAdjustmentTable:
@@ -1112,7 +1116,7 @@ SpawnPatternNoneAlt:
;===============================================================================
InitializeSpecialObject:
jsr Sub_C40C ; $045F: 20 0C C4
jsr SpawnRandomObject ; $045F: 20 0C C4
jsr GetRandomValue ; $0462: 20 B3 F1
and #$7F ; $0465: 29 7F
sta $0508,x ; $0467: 9D 08 05
@@ -1210,17 +1214,19 @@ AllocateGameplayObject:
sta GameplayObjectPosY,x ; $04A9: 9D A4 04
rts ; $04AC: 60
; Preserve the remaining undecoded PRG bytes.
;===============================================================================
; SpawnCommandStreamData_C4AD
; Round spawn command stream
;
; Structured spawn/object command data preceding the sorted-record helpers.
; The exact record boundaries and gameplay meanings remain provisional.
; Command data consumed by SpawnFromCommandStream ($C3C9) to initialize
; round objects. Each command byte: top 3 bits give the spawn Y position,
; bits 7-6 select object type (%10 = effect object via AllocateEffectObject,
; %00 = gameplay object via AllocateGameplayObject), and any other value
; terminates the stream.
;
; PRG offsets: $04AD-$0526
; CPU range: $C4AD-$C526
;===============================================================================
SpawnCommandStreamData_C4AD:
RoundSpawnCommandStream:
.byte $00, $00, $09, $00, $08, $8C, $00, $07; $04AD: 00 00 09 00 08 8C 00 07
.byte $18, $00, $18, $00, $19, $00, $1A, $00; $04B5: 18 00 18 00 19 00 1A 00
.byte $84, $94, $1A, $00, $1A, $00, $1A, $00; $04BD: 84 94 1A 00 1A 00 1A 00
@@ -1384,8 +1390,6 @@ Label_C5AE:
bpl Label_C5AE ; $05B4: 10 F8
rts ; $05B6: 60
; Preserve the remaining undecoded PRG bytes.
;===============================================================================
; Carrier display-selection tables
;===============================================================================
NormalDisplayModeTable:
@@ -1604,8 +1608,6 @@ Label_C6B3:
Label_C6B7:
rts ; $06B7: 60
; Preserve the remaining undecoded PRG bytes.
;===============================================================================
; Carrier animation remap table
; Maps player animation states to the carrier-sequence animation states.
;===============================================================================
@@ -1759,8 +1761,6 @@ Label_C72E:
lda #$03 ; $0743: A9 03
jmp ConfigureRoundPresentation ; $0745: 4C 56 C8
; Preserve the remaining undecoded PRG bytes.
;===============================================================================
; Round spawn lookup tables
;===============================================================================
RoundObjectCountTable:
@@ -2010,8 +2010,6 @@ AppendRoundHudValue:
Label_C88A:
rts ; $088A: 60
; Preserve the remaining undecoded PRG bytes.
;===============================================================================
; Round spawner and sprite lookup tables
;===============================================================================
RoundHudTileTable:
@@ -2215,8 +2213,6 @@ IntegrateGameplayObjectPosition:
sta GameplayObjectPosY,x ; $09D9: 9D A4 04
rts ; $09DC: 60
; Preserve the remaining undecoded PRG bytes.
;===============================================================================
; Round-object sprite tables
;===============================================================================
RoundObjectTileTable:
@@ -2426,8 +2422,7 @@ Label_CB0C:
Label_CB18:
jmp Label_CAE1 ; $0B18: 4C E1 CA
; Preserve the remaining undecoded PRG bytes.
; $0B1B is the RTS terminating TestGameplayObjectAgainstBounds.
; $0B1B: RTS terminating TestGameplayObjectAgainstBounds.
rts ; $0B1B: 60
;===============================================================================
@@ -2867,8 +2862,6 @@ AdvanceHudCommandAddress:
Label_CD25:
rts ; $0D25: 60
; Preserve the remaining undecoded PRG bytes.
;===============================================================================
; Bonus-object HUD tile triplets
;
; Each four-byte table is indexed by BonusObjectPhase ($00-$03). The three
@@ -2900,7 +2893,6 @@ BonusHudRow2Tile1Table:
BonusHudRow2Tile2Table:
.byte $A7, $24, $24, $24 ; $0D46: A7 24 24 24
; Preserve the remaining undecoded PRG bytes.
;===============================================================================
; InitializeParticleSlots
;
@@ -3152,8 +3144,6 @@ Label_CE99:
sta $0259,y ; $0EAA: 99 59 02
rts ; $0EAD: 60
; Preserve the remaining undecoded PRG bytes.
;===============================================================================
; Particle rendering tables
;===============================================================================
ParticleInitialVelocityTable:
@@ -3502,7 +3492,6 @@ Label_D104:
sta PlayerParticleHitCount2 ; $1109: 8D CE 05
rts ; $110C: 60
; Preserve the remaining undecoded PRG bytes.
; Sequence parameter tables
ParticleSequenceIndexTable:
.byte $03, $05, $07, $07, $07 ; $110D: 03 05 07 07 07
@@ -4172,7 +4161,6 @@ GetNametableAddressForIndex:
sta $51 ; $1659: 85 51
rts ; $165B: 60
; Preserve the remaining undecoded PRG bytes.
NametableAddressPairTable:
.byte $63, $21, $A5, $21, $CB, $20, $B7, $20 ; $165C: 63 21 A5 21 CB 20 B7 20
.byte $7D, $21, $9B, $22, $F2, $20, $49, $22 ; $1664: 7D 21 9B 22 F2 20 49 22