split GT and Ganon crystal checks

something seems wrong with Inverted, will check later, or have someone else look into it
This commit is contained in:
sporchia
2019-06-15 09:29:44 -04:00
parent d182c3343e
commit cdf345248e
5 changed files with 33 additions and 25 deletions

View File

@@ -191,6 +191,7 @@ incsrc stats/main.asm
org $308000 ; bank #$30 org $308000 ; bank #$30
incsrc tables.asm incsrc tables.asm
; uncomment for inverted adjustments
;incsrc sandbox.asm ;incsrc sandbox.asm
org $318000 ; bank #$31 org $318000 ; bank #$31

View File

@@ -13,7 +13,7 @@ LockAgahnimDoors:
+ : CMP.w #$0002 : BNE + + : CMP.w #$0002 : BNE +
JSR.w LockAgahnimDoorsCore : BEQ .unlock JSR.w LockAgahnimDoorsCore : BEQ .unlock
SEP #$30 SEP #$30
JSL.l CheckEnoughCrystals JSL.l CheckEnoughCrystalsForTower
REP #$30 REP #$30
BEQ .crystalOrUnlock BEQ .crystalOrUnlock
LDA #$0001 : RTL LDA #$0001 : RTL

View File

@@ -10,7 +10,7 @@ GoalItemGanonCheck:
LDA $0E20, X : CMP.b #$D6 : BNE .success ; skip if not ganon LDA $0E20, X : CMP.b #$D6 : BNE .success ; skip if not ganon
JSL.l CheckGanonVulnerability JSL.l CheckGanonVulnerability
BCS .success BCS .success
.fail .fail
LDA $0D80, X : CMP.b #17 : !BLT .success ; decmial 17 because Acmlm's chart is decimal LDA $0D80, X : CMP.b #17 : !BLT .success ; decmial 17 because Acmlm's chart is decimal
LDA.b #$00 LDA.b #$00
@@ -47,42 +47,48 @@ CheckGanonVulnerability:
LDA.l !GOAL_COUNTER : CMP.b #100 : !BLT .fail ; require 100 goal items LDA.l !GOAL_COUNTER : CMP.b #100 : !BLT .fail ; require 100 goal items
BRA .success BRA .success
+ : CMP #$06 : BNE + + : CMP #$06 : BNE +
;#$06 = Require "NumberOfCrystalsRequired" Crystals ;#$06 = Require "NumberOfCrystalsRequiredForGanon" Crystals
JSL CheckEnoughCrystals : BCC .fail JSL CheckEnoughCrystalsForGanon : BCC .fail
BRA .success BRA .success
+ +
.fail : CLC : RTL .fail : CLC : RTL
.success : SEC : RTL .success : SEC : RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GetRequriedCrystals: GetRequriedCrystalsForTower:
BEQ + : JSL.l BreakTowerSeal_ExecuteSparkles : + ; thing we wrote over BEQ + : JSL.l BreakTowerSeal_ExecuteSparkles : + ; thing we wrote over
LDA.l NumberOfCrystalsRequired : CMP.b #$00 : BNE + : JML.l Ancilla_BreakTowerSeal_stop_spawning_sparkles : + LDA.l NumberOfCrystalsRequiredForTower : CMP.b #$00 : BNE + : JML.l Ancilla_BreakTowerSeal_stop_spawning_sparkles : +
LDA.l NumberOfCrystalsRequired : CMP.b #$01 : BNE + : JML.l Ancilla_BreakTowerSeal_draw_single_crystal : + LDA.l NumberOfCrystalsRequiredForTower : CMP.b #$01 : BNE + : JML.l Ancilla_BreakTowerSeal_draw_single_crystal : +
LDA.l NumberOfCrystalsRequired : DEC #2 : TAX LDA.l NumberOfCrystalsRequiredForTower : DEC #2 : TAX
JML.l GetRequriedCrystals_continue JML.l GetRequriedCrystalsForTower_continue
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GetRequriedCrystalsInX: GetRequriedCrystalsInX:
LDA.l NumberOfCrystalsRequired : CMP.b #$00 : BNE + LDA.l NumberOfCrystalsRequiredForTower : CMP.b #$00 : BNE +
TAX TAX
RTL RTL
+ +
TXA : - : CMP.l NumberOfCrystalsRequired : !BLT + : !SUB.l NumberOfCrystalsRequired : BRA - : + TXA : - : CMP.l NumberOfCrystalsRequiredForTower : !BLT + : !SUB.l NumberOfCrystalsRequiredForTower : BRA - : +
INC : CMP.l NumberOfCrystalsRequired : BNE + INC : CMP.l NumberOfCrystalsRequiredForTower : BNE +
LDA.b #$08 LDA.b #$08
+ : DEC : TAX + : DEC : TAX
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
CheckEnoughCrystals: CheckEnoughCrystalsForGanon:
LDA InvincibleGanon : CMP #$06 : BNE .normal LDA InvincibleGanon : CMP #$06 : BNE .normal
.other
PHX : PHY PHX : PHY
LDA $7EF37A : JSL CountBits ; the comparison is against 1 less LDA $7EF37A : JSL CountBits ; the comparison is against 1 less
PLY : PLX PLY : PLX
CMP.l NumberOfCrystalsRequired CMP.l NumberOfCrystalsRequiredForGanon
RTL RTL
.normal .normal
LDA $7EF37A : AND.b #$7F : CMP.b #$7F ; thing we wrote over LDA $7EF37A : AND.b #$7F : CMP.b #$7F ; thing we wrote over
RTL RTL
;--------------------------------------------------------------------------------
CheckEnoughCrystalsForTower:
PHX : PHY
LDA $7EF37A : JSL CountBits ; the comparison is against 1 less
PLY : PLX
CMP.l NumberOfCrystalsRequiredForTower
RTL

View File

@@ -327,14 +327,14 @@ PreventEnterOnBonk_BRANCH_IX:
; Crystals Mode ; Crystals Mode
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $099B7B ; <- ancilla_init.asm : 4136 (LDA $7EF37A : AND.b #$7F : CMP.b #$7F) org $099B7B ; <- ancilla_init.asm : 4136 (LDA $7EF37A : AND.b #$7F : CMP.b #$7F)
JSL.l CheckEnoughCrystals JSL.l CheckEnoughCrystalsForTower
NOP #4 NOP #4
db #$90 ; BCC db #$90 ; BCC
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $08CE0C ; <- 44E0C - ancilla_break_tower_seal.asm : 168 (BEQ #$03 : JSR BreakTowerSeal_ExecuteSparkles : LDX.b #$06) org $08CE0C ; <- 44E0C - ancilla_break_tower_seal.asm : 168 (BEQ #$03 : JSR BreakTowerSeal_ExecuteSparkles : LDX.b #$06)
JML.l GetRequriedCrystals JML.l GetRequriedCrystalsForTower
NOP #3 NOP #3
GetRequriedCrystals_continue: GetRequriedCrystalsForTower_continue:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $08CF19 ; <- 44F19 - ancilla_break_tower_seal.asm : 336 (TXA : AND.b #$07 : TAX) org $08CF19 ; <- 44F19 - ancilla_break_tower_seal.asm : 336 (TXA : AND.b #$07 : TAX)
JSL.l GetRequriedCrystalsInX JSL.l GetRequriedCrystalsInX

View File

@@ -153,7 +153,7 @@ db #$00
; #$03 = Require Crystals and Aga2 ; #$03 = Require Crystals and Aga2
; #$04 = Require Crystals ; #$04 = Require Crystals
; #$05 = Require 100 Goal Items ; #$05 = Require 100 Goal Items
; #$06 = Require "NumberOfCrystalsRequired" ; #$06 = Require "NumberOfCrystalsRequiredForGanon"
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $30803F ; PC 0x18003F org $30803F ; PC 0x18003F
HammerableGanon: HammerableGanon:
@@ -257,10 +257,11 @@ CrystalPendantFlags_2:
;Crystal: $40 ;Crystal: $40
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $30805E ; PC 0x18005E - Number of crystals required to enter GT org $30805E ; PC 0x18005E - Number of crystals required to enter GT
NumberOfCrystalsRequired: NumberOfCrystalsRequiredForTower:
db #$07 ; #$07 = 7 Crystals
org $30805F ; PC 0x18005F - Number of crystals required to kill GT
NumberOfCrystalsRequiredForGanon:
db #$07 ; #$07 = 7 Crystals db #$07 ; #$07 = 7 Crystals
;--------------------------------------------------------------------------------
; 0x18005F - 0x18005F (unused)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $308060 ; PC 0x180060 - 0x18007E org $308060 ; PC 0x180060 - 0x18007E
ProgrammableItemLogicJump_1: ProgrammableItemLogicJump_1: