add portal rod as swappable with fishing rod

This commit is contained in:
scawful
2024-06-18 18:46:13 -04:00
parent b359fb6937
commit f8d9acc281
5 changed files with 70 additions and 16 deletions

View File

@@ -23,10 +23,35 @@ org $06C058 ; JSL Sprite_74_RunningBoy
RTS
}
org $07AF3E ; Cane of Byrna - End: $07AFB4
LinkItem_CaneOfByrna:
org $07AF3E ; Cane of Byrna
LinkItem_FishingRodAndPortalRod:
{
JSL LinkItem_FishingRod
; If the sram slot is 02, we can swap between the fishing rod and the portal rod
LDA.l $7EF351 : CMP.b #$02 : BEQ +
JSL LinkItem_FishingRod
RTS
+
LDA.w FishingOrPortalRod : BNE .portal_rod
JSL LinkItem_FishingRod
JMP ++
.portal_rod
JSR LinkItem_PortalRod
++
LDA.b $F6
BIT.b #$20 : BNE .left ; pressed left
BIT.b #$10 : BNE .right ; pressed right
RTS
; Swap the ram variable FishingOrPortalRod based on left or right
; 00 = fishing rod, 01 = portal rod
.left
LDA.w FishingOrPortalRod : CMP #$00 : BEQ .right
LDA.b #$00 : STA.w FishingOrPortalRod
RTS
.right
LDA.w FishingOrPortalRod : CMP #$01 : BEQ .left
LDA.b #$01 : STA.w FishingOrPortalRod
RTS
}

View File

@@ -345,10 +345,15 @@ DrawYItems:
LDY.w #SomariaGFX
JSR DrawMenuItem
LDA.w #$7EF351
LDX.w #menu_offset(13,13)
LDY.w #FishingRodGFX
JSR DrawMenuItem
; LDA.w #$7EF351
LDA.l $7EF351 : AND.w #$00FF : CMP.w #$00 : BEQ .no_rods
LDA.w FishingOrPortalRod
INC A
STA.w MenuItemValueSpoof : LDA.w #MenuItemValueSpoof
LDX.w #menu_offset(13,13)
LDY.w #FishingRodGFX
JSR DrawMenuItem
.no_rods
LDA.w #$7EF34D
LDX.w #menu_offset(13,16)

View File

@@ -141,7 +141,7 @@ FishingRodGFX:
dw $2C82, $2C83, $2C8B, $2C8C
PortalRodGFX:
dw $2CF0, $24F1, $30EC, $24F2
dw $2CF0, $24F1, $30EC, $E4F0
; ---------------------------------------------------------
@@ -186,12 +186,7 @@ QuarterNoteGFX:
; ---------------------------------------------------------
TradeQuestGFX:
dw $3D36, $3D37, $3D46, $3D47 ; Yoshi Doll
dw $28DE, $28DF, $28EE, $28EF ; Tasty Meat
dw $346C, $346D, $347C, $347D ; This shit is Bananas!
dw $241E, $241F, $242E, $242F ; Pretty Bow
dw $3D7E, $3D7F, $356C, $756C ; Pineapple
; =========================================================
; Equipped Items

View File

@@ -290,9 +290,14 @@ HUD_UpdateItemBox:
CPX.w #$0003 : BNE .hookshot_not_equipped
LDA.w GoldstarOrHookshot : BEQ .hookshot_not_equipped
SEC : SBC.w #$0001
.hookshot_not_equipped
CPX.w #$0010 : BNE .custom_rod_not_equipped
LDA.w FishingOrPortalRod
.custom_rod_not_equipped
JSR HUD_DrawItem
.no_equipped_item
@@ -399,7 +404,7 @@ HudItems:
; hammer, lamp, fire rod, ice rod, mirror, bottle2
dw $F701, $F6F1, $F6A1, $F6B1, $F7C1, $F751
; flute, book, somaria, byrna, feather, bottle3
dw $F859, $F741, $F7A1, $F7A9, $F729, $F751
dw $F859, $F741, $F7A1, $F8A9, $F729, $F751
; deku, zora, wolf, bunny, stone, bottle4
dw $F6E1, $F821, $F6D1, $F7B9, $F811, $F751
}
@@ -490,8 +495,10 @@ org $0DF7A1
; Byrna
; org $0DF7A9
; dw $2CDC, $2CDD, $2CEC, $2CED ; Cane of Byrna
org $0DF7B1
; org $0DF7B1
org $0DF8A9
dw $2C82, $2C83, $2C8B, $2C8C ; Fishing Rod
dw $2CF0, $24F1, $30EC, $E4F0 ; Portal Rod
; Deku (Quake)
org $0DF6E1

View File

@@ -148,6 +148,9 @@ Menu_BottleItems:
Menu_GoldstarLabel:
dw "__GOLD_STAR___ "
Menu_PortalRodItems:
dw "__PORTAL_ROD__ "
Menu_SongNames:
dw "SONG:_STORMS__ "
dw "SONG:_HEALING_ "
@@ -170,6 +173,7 @@ Menu_DrawItemName:
LDA.w $0202 : CMP.b #$03 : BEQ .goldstar
CMP.b #$05 : BEQ .mushroom
CMP.b #$0D : BEQ .ocarina
CMP.b #$10 : BEQ .custom_rods
; Check if it's a bottle
CMP.b #$06 : BEQ .bottle_1
CMP.b #$0C : BEQ .bottle_2
@@ -204,6 +208,11 @@ Menu_DrawItemName:
JSR DrawBottleNames
RTS
.custom_rods
LDA.w FishingOrPortalRod : CMP.b #$01 : BNE .draw_item
JSR DrawPortalRodName
RTS
.goldstar
LDA GoldstarOrHookshot : CMP.b #$02 : BNE .draw_item
JSR DrawGoldstarName
@@ -229,6 +238,19 @@ Menu_DrawItemName:
RTS
}
DrawPortalRodName:
{
REP #$30
LDX.w #$0000
LDY.w #$0000
.draw_portal_rod_loop
LDA.w Menu_PortalRodItems, X : STA.w $1692, Y
INX #2 : INY #2
CPY #$001C : BCC .draw_portal_rod_loop
RTS
}
DrawBottleNames:
{
LDA.l $7EF35C, X : AND.w #$00FF