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

@@ -2,7 +2,7 @@
; Glitched Mode Fixes
;================================================================================
GetAgahnimPalette:
LDA $A0 ; get room id
LDA.b RoomIndex ; get room id
CMP.b #13 : BNE + ; Agahnim 2 room
LDA.b #$07 ; Use Agahnim 2
RTL
@@ -11,25 +11,25 @@ GetAgahnimPalette:
RTL
;--------------------------------------------------------------------------------
GetAgahnimDeath:
STA $0BA0, X ; thing we wrote over
LDA $A0 ; get room id
STA.w $0BA0, X ; thing we wrote over
LDA.b RoomIndex ; get room id
CMP.b #13 : BNE + ; Agahnim 2 room
LDA.l Bugfix_SetWorldOnAgahnimDeath : BEQ ++
LDA.l InvertedMode : BEQ +++
LDA.b #$00 : STA CurrentWorld ; Switch to light world
LDA.b #$00 : STA.l CurrentWorld ; Switch to light world
BRA ++
+++
LDA.b #$40 : STA CurrentWorld ; Switch to dark world
LDA.b #$40 : STA.l CurrentWorld ; Switch to dark world
++
LDA.b #$01 ; Use Agahnim 2
RTL
+ ; Elsewhere
LDA.l Bugfix_SetWorldOnAgahnimDeath : BEQ ++
LDA.l InvertedMode : BEQ +++
LDA.b #$40 : STA CurrentWorld ; Switch to dark world
LDA.b #$40 : STA.l CurrentWorld ; Switch to dark world
BRA ++
+++
LDA.b #$00 : STA CurrentWorld ; Switch to light world
LDA.b #$00 : STA.l CurrentWorld ; Switch to light world
; (This will later get flipped to DW when Agahnim 1
; warps us to the pyramid)
++
@@ -37,7 +37,7 @@ GetAgahnimDeath:
RTL
;--------------------------------------------------------------------------------
GetAgahnimType:
LDA $A0 ; get room id
LDA.b RoomIndex ; get room id
CMP.b #13 : BNE + ; Agahnim 2 room
LDA.b #$0006 ; Use Agahnim 2
BRA .done
@@ -48,7 +48,7 @@ RTL
;--------------------------------------------------------------------------------
GetAgahnimSlot:
PHX ; thing we wrote over
LDA $A0 ; get room id
LDA.b RoomIndex ; get room id
CMP.b #13 : BNE + ; Agahnim 2 room
LDA.b #$01 ; Use Agahnim 2
JML.l GetAgahnimSlotReturn
@@ -57,8 +57,8 @@ GetAgahnimSlot:
JML.l GetAgahnimSlotReturn
;--------------------------------------------------------------------------------
GetAgahnimLightning:
INC $0E30, X ; thing we wrote over
LDA $A0 ; get room id
INC.w $0E30, X ; thing we wrote over
LDA.b RoomIndex ; get room id
CMP.b #13 : BNE + ; Agahnim 2 room
LDA.b #$01 ; Use Agahnim 2
RTL
@@ -69,11 +69,11 @@ GetAgahnimLightning:
;0 = Allow
;1 = Forbid
AllowJoypadInput:
LDA PermitSQFromBosses : BEQ .fullCheck
LDA $0403 : AND.b #$80 : BEQ .fullCheck
LDA $0112 : ORA $02E4 ; we have heart container, do short check
LDA.l PermitSQFromBosses : BEQ .fullCheck
LDA.w $0403 : AND.b #$80 : BEQ .fullCheck
LDA.w $0112 : ORA.w $02E4 ; we have heart container, do short check
RTL
.fullCheck
LDA $0112 : ORA $02E4 : ORA $0FFC
LDA.w $0112 : ORA.w $02E4 : ORA.w $0FFC
RTL
;--------------------------------------------------------------------------------