Fix potions to work normally in Spike cave
This commit is contained in:
25
potions.asm
25
potions.asm
@@ -4,8 +4,15 @@
|
||||
;--------------------------------------------------------------------------------
|
||||
!BUSY_HEALTH = $7F5092
|
||||
RefillHealth:
|
||||
;STA $FFFFFF
|
||||
LDA.l PotionHealthRefill : CMP.b #$A0 : !BGE +
|
||||
REP #$20 ; set 16-bit accumulator
|
||||
LDA $A0 ; these are all decimal because i got them that way
|
||||
CMP.w #279 : BNE + ; Spike Cave bottles work normally
|
||||
SEP #$20 ; set 8-bit accumulator
|
||||
LDA #$A0
|
||||
BRA .done
|
||||
+
|
||||
SEP #$20 ; set 8-bit accumulator
|
||||
LDA.l PotionHealthRefill : CMP.b #$A0 : !BGE .done
|
||||
LDA !BUSY_HEALTH : BNE ++
|
||||
LDA.l PotionHealthRefill ; load refill amount
|
||||
!ADD $7EF36D ; add to current health
|
||||
@@ -24,7 +31,7 @@ RefillHealth:
|
||||
.notDone
|
||||
CLC
|
||||
RTL
|
||||
+
|
||||
.done
|
||||
|
||||
; Check goal health versus actual health.
|
||||
; if(actual < goal) then branch.
|
||||
@@ -44,7 +51,15 @@ RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
!BUSY_MAGIC = $7F5093
|
||||
RefillMagic:
|
||||
LDA.l PotionMagicRefill : CMP.b #$80 : !BGE +
|
||||
REP #$20 ; set 16-bit accumulator
|
||||
LDA $A0 ; these are all decimal because i got them that way
|
||||
CMP.w #279 : BNE + ; Spike Cave bottles work normally
|
||||
SEP #$20 ; set 8-bit accumulator
|
||||
LDA #$80
|
||||
BRA .done
|
||||
+
|
||||
SEP #$20 ; set 8-bit accumulator
|
||||
LDA.l PotionMagicRefill : CMP.b #$80 : !BGE .done
|
||||
LDA !BUSY_MAGIC : BNE ++
|
||||
LDA.l PotionMagicRefill ; load refill amount
|
||||
!ADD $7EF36E ; add to current magic
|
||||
@@ -60,7 +75,7 @@ RefillMagic:
|
||||
LDA.b #$01 : STA $7EF373 ; refill some magic
|
||||
CLC
|
||||
RTL
|
||||
+
|
||||
.done
|
||||
|
||||
SEP #$30
|
||||
; Check if Link's magic meter is full
|
||||
|
||||
Reference in New Issue
Block a user