Update Sprites and Items

- Add the Portal Rod item (WIP)
- Add Twinrova Boss Sprite
- Update the Minecart Sprite
- Fix the HUD magic meter draw
- Fix some Zora Mask bugs (WIP)
- General housekeeping
This commit is contained in:
scawful
2023-09-13 23:01:16 -04:00
parent 00c700c31d
commit 9e0ee96943
27 changed files with 2562 additions and 457 deletions

View File

@@ -106,4 +106,6 @@ LinkItem_Ether:
.return
CLC
RTS
}
}
warnpc $07A4F6

View File

@@ -7,9 +7,23 @@ incbin gfx/deku_link.bin
; =============================================================================
org $07B0AB
LinkItem_EvaluateMagicCost:
org $07A64B ; formerly Quake
LinkItem_DekuMask:
{
JSR Link_CheckNewY_ButtonPress : BCC .continue
LDX.b #$01
JSR LinkItem_EvaluateMagicCost : BCC .return
LDA.b #$0A : STA $5D
RTS
.continue
; Check for R button held
%CheckNewR_ButtonPress() : BEQ .return
@@ -26,6 +40,7 @@ LinkItem_DekuMask:
LDA #$35 : STA $BC ; put the mask on
LDA #$01 : STA $02B2 ; set the deku mask flag
STA $02F5 ; Somaria platform flag, no dash.
BRA .return
@@ -33,6 +48,7 @@ LinkItem_DekuMask:
STZ $5D
; Restore the shield
LDA $0AAF : STA.l $7EF35A
STZ $02F5
%ResetToLinkGraphics()
@@ -40,6 +56,19 @@ LinkItem_DekuMask:
RTS
}
; =========================================================
org $07E370
LinkHop_FindArbitraryLandingSpot:
org $07A6D6
LinkState_UsingQuake:
{
}
warnpc $07A779
org $318000
; org $07A013
; JSL LinkItem_SlingshotPrepare

View File

@@ -17,32 +17,44 @@ UpdateGbcPalette:
GameboyLinkPalette:
{
dw #$0000, #$7FFF, #$237E, #$B711, #$369E, #$14A5, #$01FF, #$1078, #$46FF
dw #$22A2, #$3B68, #$0A4A, #$12EF, #$2A5C, #$1571, #$7A18, #$7FFF
dw #$237E, #$B711, #$369E, #$14A5, #$01FF, #$1078, #$46FF, #$7E03
dw #$7691, #$2678, #$435C, #$1199, #$7A18, #$7FFF, #$237E, #$B711
dw #$369E, #$14A5, #$01FF, #$1078, #$46FF, #$147F, #$457E, #$6DF3
dw #$7EB9, #$2A5C, #$2227, #$7A18, #$7FFF, #$237E, #$B711, #$369E
dw #$14A5, #$01FF, #$1078, #$46FF, #$05FF, #$3B68, #$0A4A, #$12EF
dw #$567E, #$1872, #$7A18, #$5276, #$0352
dw #$0000, #$7FFF, #$237E, #$B711, #$369E, #$14A5, #$01FF, #$1078, #$46FF
dw #$22A2, #$3B68, #$0A4A, #$12EF, #$2A5C, #$1571, #$7A18, #$7FFF
dw #$237E, #$B711, #$369E, #$14A5, #$01FF, #$1078, #$46FF, #$7E03
dw #$7691, #$2678, #$435C, #$1199, #$7A18, #$7FFF, #$237E, #$B711
dw #$369E, #$14A5, #$01FF, #$1078, #$46FF, #$147F, #$457E, #$6DF3
dw #$7EB9, #$2A5C, #$2227, #$7A18, #$7FFF, #$237E, #$B711, #$369E
dw #$14A5, #$01FF, #$1078, #$46FF, #$05FF, #$3B68, #$0A4A, #$12EF
dw #$567E, #$1872, #$7A18, #$5276, #$0352
}
org $07A9B1
LinkMode_MagicMirror:
{
JSL LinkState_GameboyForm
}
pullpc
LinkState_GameboyForm:
{
CLC
LDA $0FFF : BEQ .return ; not in dark world
; %PlayerTransform()
SEP #$30
LDA $02B2 : CMP.b #$06 : BEQ .already_gbc
LDA $7EF357 : BEQ .return ; doesnt have the pearl
LDA $0FFF : BEQ .return ; not in dark world
%PlayerTransform()
JSL UpdateGbcPalette
LDA #$3B : STA $BC ; change link's sprite
LDA #$3B : STA $BC ; change link's sprite
LDA #$06 : STA $02B2
BRA .return
.return
LDA $BC : CMP.b #$06 : BNE .not_gbc
.already_gbc
%PlayerTransform()
LDA #$10 : STA $BC
STZ $02B2
.not_gbc
CLC
.return
JSL $07F1E6
RTL
}
}
pushpc

View File

@@ -53,6 +53,7 @@ LinkItem_ShovelAndFlute:
JMP LinkItem_WolfMask
}
; warnpc $07A31F
; =============================================================================

View File

@@ -26,7 +26,7 @@ UpdateZoraPalette:
REP #$30 ; change 16 bit mode
LDX #$001E
.loop
.loop
LDA.l zora_palette, X : STA $7EC6E0, X
DEX : DEX : BPL .loop
@@ -51,9 +51,13 @@ org $0998FC
; =============================================================================
; Replaces Bombos medallion
org $07A569
LinkItem_ZoraMask:
{
; No removing the mask whilst diving.
LDA $0AAB : BNE .return
; Check for R button held
%CheckNewR_ButtonPress() : BEQ .return
@@ -75,26 +79,17 @@ LinkItem_ZoraMask:
CLC
RTS
}
print pc, " ==> LinkItem_ZoraMask ", pc
warnpc $07A5CE
; =============================================================================
; End of LinkState_Swimming
org $079781
org $079781
JSR LinkState_UsingZoraMask
RTS
; End of LinkState_Default
org $0782D2
JSR LinkState_UsingZoraMask_dungeon_resurface
JSR $E8F0
CLC
RTS
; C2C3
org $07C307
JSR LinkState_UsingZoraMask_dungeon_stairs
RTS
; =============================================================================
pullpc ; Bank07 Free Space from Deku Mask
@@ -109,10 +104,9 @@ LinkState_UsingZoraMask:
.normal
; Return to normal state
STZ $55
STZ $5E ; Reset speed to normal
STZ $037B
STZ $0351
LDA #$00 : STA $5E ; Reset speed to normal
STA $037B
JMP .return
.swimming
@@ -189,7 +183,7 @@ LinkState_UsingZoraMask:
LDA #$08
STA $5E ; Set the player speed
STZ $0345
STZ $0345 ; Reset deep water flag
LDA #$01
STA $0AAB ; Set the player underwater flag
@@ -200,6 +194,19 @@ LinkState_UsingZoraMask:
}
}
pushpc
; End of LinkState_Default
org $0782D2
JSR LinkState_UsingZoraMask_dungeon_resurface
JSR $E8F0
CLC
RTS
warnpc $078364
pullpc
.dungeon_resurface
{
LDA $1B : BEQ .return_default ; We are in overworld actually
@@ -214,7 +221,7 @@ LinkState_UsingZoraMask:
; Check if the ground level is safe
; Otherwise, eject the player back to the surface
LDA $0114 : BNE .remove_dive : CLC
CMP.b #$09 : BEQ .remove_dive
; CMP.b #$09 : BEQ .remove_dive
; Check the Y button and clear state if activated
JSR Link_CheckNewY_ButtonPress : BCC .return_default
@@ -244,6 +251,14 @@ LinkState_UsingZoraMask:
RTS
}
pushpc
; C2C3
org $07C307
JSR LinkState_UsingZoraMask_dungeon_stairs
RTS
pullpc
.dungeon_stairs
{
@@ -257,19 +272,21 @@ LinkState_UsingZoraMask:
}
print "==> LinkState_UsingZoraMask ", pc
; =============================================================================
; TODO: Make this so it does not cancel if $0202 is still the same mask
; corresponding to the form the player is in.
; Also, prevent this from canceling minish form.
LinkState_ResetMaskAnimated:
{
LDA $02B2 : BEQ .no_mask
CMP #$05 : BEQ .no_mask
CMP #$01 : BNE .transform
LDA $02B2 : BEQ .no_mask
CMP.b #$05 : BEQ .no_mask
CMP.b #$06 : BEQ .gbc_form
CMP.b #$02 : BEQ .no_mask
CMP #$01 : BNE .transform
; Restore the sword, shield, and bow override
LDA $0AA5 : STA.l $7EF359
LDA $0AAF : STA.l $7EF35A
LDA #$00 : STA $7E03FC
.transform
LDY.b #$04 : LDA.b #$23
@@ -280,6 +297,7 @@ LinkState_ResetMaskAnimated:
JSL Palette_ArmorAndGloves
LDA #$10 : STA $BC
.no_mask
.gbc_form
RTL
}