Continue labeling and documentation in ram.asm, main rando block

Deleted several unused modules and some commented code
Reorganized some routines to clean up modules
Moved some memory into mirrored WRAM
Refactored NMI hook aux routine
Removed old fake flipper fix
This commit is contained in:
cassidoxa
2022-11-16 21:38:28 -05:00
parent 43f753b517
commit 788cceaab9
67 changed files with 962 additions and 2127 deletions

View File

@@ -4,7 +4,7 @@ QuickSwap:
; We perform all other checks only if we are pushing L or R in order to have minimal
; perf impact, since this runs every frame
LDA.b $F6 : AND #$30 : BEQ .done
LDA.b $F6 : AND.b #$30 : BEQ .done
XBA ; stash away the value for after the checks.
@@ -18,9 +18,9 @@ QuickSwap:
; If prossing both L and R this frame, then go directly to the special swap code
LDX.w $0202 : BRA .special_swap
+
BIT #$10 : BEQ + ; Only pressed R
BIT.b #$10 : BEQ + ; Only pressed R
JSR.w RCode
LDA.b $F2 : BIT #$20 : BNE .special_swap ; Still holding L from a previous frame
LDA.b $F2 : BIT.b #$20 : BNE .special_swap ; Still holding L from a previous frame
BRA .store
+
; Only pressed L
@@ -29,18 +29,18 @@ QuickSwap:
BRA .store
.special_swap
LDA InventoryTracking+1 : ORA #$01 : STA InventoryTracking+1
LDA.l InventoryTracking+1 : ORA.b #$01 : STA.l InventoryTracking+1
CPX.b #$02 : BEQ + ; boomerang
CPX.b #$01 : BEQ + ; bow
CPX.b #$05 : BEQ + ; powder
CPX.b #$0D : BEQ + ; flute
CPX.b #$10 : BEQ + ; bottle
BRA .store
+ STX $0202 : JSL ProcessMenuButtons_y_pressed
+ STX.w $0202 : JSL ProcessMenuButtons_y_pressed
.store
LDA.b #$20 : STA.w $012F
STX $0202
STX.w $0202
JSL HUD_RefreshIconLong
PLX
@@ -50,11 +50,11 @@ QuickSwap:
RTL
RCode:
LDX.w $0202
LDA.b $F2 : BIT #$20 : BNE ++ ; Still holding L from a previous frame
LDA InventoryTracking+1 : AND #$FE : STA InventoryTracking+1
LDA.b $F2 : BIT.b #$20 : BNE ++ ; Still holding L from a previous frame
LDA.l InventoryTracking+1 : AND.b #$FE : STA.l InventoryTracking+1
BRA +
++
LDA InventoryTracking+1 : BIT #$01 : BEQ +
LDA.l InventoryTracking+1 : BIT.b #$01 : BEQ +
RTS
-
+ CPX.b #$14 : BNE + : LDX.b #$00 ;will wrap around to 1
@@ -68,10 +68,10 @@ RTS
LCode:
LDX.w $0202
LDA.b $F2 : BIT #$10 : BNE ++ ; Still holding R from a previous frame
LDA InventoryTracking+1 : AND #$FE : STA InventoryTracking+1
LDA.l InventoryTracking+1 : AND.b #$FE : STA.l InventoryTracking+1
BRA +
++
LDA InventoryTracking+1 : BIT #$01 : BEQ +
LDA.l InventoryTracking+1 : BIT.b #$01 : BEQ +
RTS
-
+ CPX.b #$01 : BNE + : LDX.b #$15 ; will wrap around to $14