Files
alttpr-baserom/goalitem.asm
Karkat aeb329d28e let's dev 5/26/2017
dwarf s&q spawn
invincible ganon switch
2017-05-26 00:08:29 -04:00

34 lines
1.4 KiB
NASM

;--------------------------------------------------------------------------------
; $7F5010 - Scratch Space (Callee Preserved)
;--------------------------------------------------------------------------------
!GOAL_COUNTER = "$7EF460"
DrawGoalIndicator:
LDA.l GoalItemRequirement : AND.w #$00FF : BNE + : RTL : + ; Star Meter
PHX
LDX.w #$0000
LDA.l GoalItemIcon : STA $7EC72C, X : INX #2 ; draw star icon and move the cursor
LDA.l !GOAL_COUNTER
AND.w #$00FF
JSL.l HexToDec
LDA $7F5006 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 10's digit and move the cursor
LDA $7F5007 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 1's and move the cursor
LDA.w #$2830 : STA $7EC72C, X : INX #2 ; draw slash and move the cursor
LDA.l GoalItemRequirement
AND.w #$00FF
JSL.l HexToDec
LDA $7F5006 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 10's digit and move the cursor
LDA $7F5007 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 1's and move the cursor
PLX
RTL
;--------------------------------------------------------------------------------
GoalItemGanonCheck:
LDA $0E20, X : CMP.b #$D6 : BNE .normal ; skip if not ganon
LDA InvincibleGanon : CMP #$01 : BNE + : RTL : +
.normal
LDA $44 : CMP.b #$80 ; thing we wrote over
RTL
;--------------------------------------------------------------------------------