Cleanup menu components

This commit is contained in:
scawful
2024-10-02 18:11:59 -04:00
parent 305e093def
commit 63b8a6faf6
5 changed files with 76 additions and 88 deletions

View File

@@ -30,7 +30,6 @@ org $0DF14F ; AnimateHeartRefill
LDA.b #$C7 : STA $01
LDA.b #$7E : STA $02
; ==========================================================
; Main HUD Update Loop
@@ -229,7 +228,6 @@ HUD_UpdateItemBox:
.no_silver_arrows
LDX.b #$02
LDA $7EF377 : BNE .draw_bow_item_icon
LDX.b #$01
@@ -294,8 +292,6 @@ HUD_UpdateItemBox:
CPX.w #$0010 : BNE .custom_rod_not_equipped
LDA.w FishingOrPortalRod
.custom_rod_not_equipped
JSR HUD_DrawItem
@@ -446,7 +442,7 @@ org $0DF701
; Lamp
org $0DF6F1
dw $24BC, $24BD, $24CC, $64CC
; Fire Rod
org $0DF6B1
dw $2CB0, $2CBE, $2CC0, $2CC1
@@ -468,7 +464,6 @@ org $0DF859
dw $24D4, $24D5, $24E4, $24E5 ; Red
dw $34D4, $34D5, $34E4, $34E5 ; Gold
; Roc's Feather (Net)
org $0DF731
dw $2840, $2841, $3C42, $3C43 ; Roc's Feather
@@ -518,16 +513,16 @@ org $0DF7B9
dw $3469, $7469, $3479, $7479
; Stone Mask (Flippers Slot)
org $0DF811
org $0DF811
dw $20F5, $20F5, $20F5, $20F5
dw $30B4, $30B5, $30C4, $30C5
; =========================================================
; $6FE77-$6FFC0
org $0DFE77
org $0DFE77
HUD_Tilemap:
incbin tilemaps/hud.tilemap
incbin tilemaps/hud.tilemap
; #_02816A: JSL RebuildHUD_Keys
@@ -537,7 +532,7 @@ incbin tilemaps/hud.tilemap
; ==========================================================
; $57CE0 DATA
org $0AFCE0
org $0AFCE0
FloorIndicatorNumberHigh:
{
dw $2508, $2509, $2509, $250A, $250B, $250C, $250D, $251D
@@ -567,7 +562,7 @@ FloorIndicator:
; disable the floor indicator during the next frame.
LDA.w #$0000
.dont_disable
STA $04A0
PHB : PHK : PLB
LDA.w #$251E : STA $7EC7F0
@@ -587,18 +582,16 @@ FloorIndicator:
; Check the world state
LDA $7EF3C5 : CMP.b #$02 : BCS .no_rain_state
; cause the ambient rain sound to occur (indoor version)
LDA.b #$05 : STA $012D
.no_rain_state
; cause the ambient rain sound to occur (indoor version)
LDA.b #$05 : STA $012D
.no_rain_state
REP #$20
.not_floor_1F
.sanctuary_rat_room
.not_floor_1F
.sanctuary_rat_room
LDA $A4 : AND.w #$00FF
BRA .set_floor_indicator_number
.basement_floor
.basement_floor
SEP #$20
; turn off any ambient sound effects
LDA.b #$05 : STA $012D
@@ -606,7 +599,7 @@ FloorIndicator:
INX #2
LDA $A4 : ORA.w #$FF00 : EOR.w #$FFFF
.set_floor_indicator_number
.set_floor_indicator_number
ASL A : TAY
@@ -622,7 +615,7 @@ FloorIndicator:
RTL
.hide_indicator ; *$57D90 ALTERNATE ENTRY POINT
.hide_indicator ; *$57D90 ALTERNATE ENTRY POINT
REP #$20
@@ -634,4 +627,4 @@ FloorIndicator:
RTL
}
pullpc
pullpc

View File

@@ -3,8 +3,8 @@ OverworldLocationNames:
dw "RANCH___________" ; 01
dw "PYRAMID_________" ; 02
dw "LAND_OF_TREE____" ; 03
dw "SNOW_MOUNTAIN___" ; 04
dw "SNOW_MOUNTAIN___" ; 05
dw "SNOW_MOUNTAIN___" ; 04
dw "SNOW_MOUNTAIN___" ; 05
dw "SNOW_MOUNTAIN___" ; 06
dw "SNOW_MOUNTAIN___" ; 07
dw "RANCH___________" ; 08
@@ -17,7 +17,7 @@ OverworldLocationNames:
dw "CEMETERY________" ; 0F
dw "TOADSTOOL_WOODS_" ; 10
dw "RANCH_PATH______" ; 11
dw "CROSSROADS______" ; 12
dw "CROSSROADS______" ; 12
dw "KALYXO_CASTLE___" ; 13
dw "KALYXO_CASTLE___" ; 14
dw "MOUNTAINSIDE____" ; 15

View File

@@ -19,7 +19,7 @@ Menu_CheckHScroll:
REP #$20
LDA.w #$0008
.merge
.merge
STA.w MenuScrollHDirection
SEP #$30
@@ -41,8 +41,8 @@ Menu_ScrollHorizontal:
LDA.w $E4 ; BG3 Horizontal Scroll Value
ADC.w MenuScrollHDirection ; Direction set by Menu_CheckHScroll
AND.w #$01FF
STA.b $E4
AND.w #$01FF
STA.b $E4
AND.w #$00FF
BNE .loop
@@ -50,7 +50,7 @@ Menu_ScrollHorizontal:
RTS
.loop
CLC
CLC
RTS
}

View File

@@ -14,19 +14,19 @@ Menu_ItemIndex:
db $11, $0F, $08, $10, $13, $0B
; =========================================================
; Decides which graphics is drawn
; Decides which graphics is drawn
Menu_AddressIndex:
db $7EF340 ; Bow
db $7EF341 ; Boomerang
db $7EF342 ; Hookshot / Goldstar
db $7EF343 ; Bombs
db $7EF344 ; Powder
db $7EF344 ; Powder
db $7EF35C ; Bottle 1
db $7EF34B ; Hammer
db $7EF34A ; Lamp
db $7EF34B ; Hammer
db $7EF34A ; Lamp
db $7EF345 ; Fire Rod
db $7EF346 ; Ice Rod
db $7EF346 ; Ice Rod
db $7EF353 ; Magic Mirror
db $7EF35D ; Bottle 2
@@ -34,12 +34,12 @@ Menu_AddressIndex:
db $7EF34E ; Book of Secrets
db $7EF350 ; Cane of Somaria / Cane of Byrna
db $7EF351 ; Fishing Rod / Portal Rod
db $7EF34D ; Roc's Feather
db $7EF34D ; Roc's Feather
db $7EF35E ; Bottle 3
db $7EF349 ; Deku Mask
db $7EF349 ; Deku Mask
db $7EF347 ; Zora Mask
db $7EF358 ; Wolf Mask
db $7EF358 ; Wolf Mask
db $7EF348 ; Bunny Hood
db $7EF352 ; Stone Mask
db $7EF35F ; Bottle #4
@@ -54,36 +54,35 @@ Menu_ItemCursorPositions:
dw menu_offset(6,15) ; deku mask
dw menu_offset(6,18) ; bottle1
dw menu_offset(9,2) ; hammer
dw menu_offset(9,2) ; hammer
dw menu_offset(9,5) ; lamp
dw menu_offset(9,8) ; firerod
dw menu_offset(9,12) ; icerod
dw menu_offset(9,15) ; goron
dw menu_offset(9,18) ; bottle2
dw menu_offset(12,2) ; shovel
dw menu_offset(12,5) ; feather
dw menu_offset(12,2) ; shovel
dw menu_offset(12,5) ; feather
dw menu_offset(12,8) ; somaria
dw menu_offset(12,12) ; byrna / fishing rod
dw menu_offset(12,15) ; bunny hood
dw menu_offset(12,18) ; bottle3
dw menu_offset(15,2) ; powder
dw menu_offset(15,5) ; book
dw menu_offset(15,2) ; powder
dw menu_offset(15,5) ; book
dw menu_offset(15,8) ; flute
dw menu_offset(15,12) ; mirror
dw menu_offset(15,15) ; stone mask
dw menu_offset(15,15) ; stone mask
dw menu_offset(15,18) ; bottle4
; =========================================================
Menu_FindNextItem:
{
LDY.w $0202 : INY
CPY.b #$19 : BCC .no_reset
LDY.b #$01
.no_reset
LDY.b #$01
.no_reset
STY.w $0202
LDX.w Menu_AddressIndex-1, Y
LDA.l $7EF300, X
@@ -96,8 +95,8 @@ Menu_FindNextItem:
Menu_FindPrevItem:
{
LDY.w $0202 : DEY : BNE .no_reset
LDY.b #$18
.no_reset
LDY.b #$18
.no_reset
STY.w $0202
LDX.w Menu_AddressIndex-1, Y
LDA.l $7EF300, X
@@ -111,13 +110,13 @@ Menu_FindNextDownItem:
{
LDA.w $0202 : CLC : ADC.b #$06
CMP.b #$19 : BCC .no_reset
SBC.b #$18
.no_reset
SBC.b #$18
.no_reset
TAY : STY.w $0202
LDX.w Menu_AddressIndex-1, Y
LDA.l $7EF300, X
BEQ Menu_FindNextItem
RTS
RTS
}
; =========================================================
@@ -126,21 +125,21 @@ Menu_FindNextUpItem:
{
LDA.w $0202 : SEC : SBC.b #$06
BPL .no_reset : BNE .no_reset
CLC : ADC.b #$18
.no_reset
CLC : ADC.b #$18
.no_reset
TAY : STY.w $0202
CPY.b #$19 : BCS .reset_up
LDX.w Menu_AddressIndex-1, Y
LDA.l $7EF300, X
BEQ Menu_FindNextItem
RTS
.reset_up
LDX.w Menu_AddressIndex-1, Y
LDA.l $7EF300, X
BEQ Menu_FindNextItem
RTS
.reset_up
LDY.b #$01
STY.w $0202
LDX.w Menu_AddressIndex-1, Y
LDA.l $7EF300, X
BEQ Menu_FindNextItem
RTS
RTS
}
@@ -159,7 +158,7 @@ Menu_DeleteCursor_AltEntry:
STA.w $118E, X : STA.w $11CE, X
SEP #$30
STZ $0207
RTS
RTS
}
; =========================================================
@@ -193,7 +192,7 @@ Menu_InitItemScreen:
STA.w $0200
RTS
.all_good
.all_good
; Double check we still have the item that was selected.
; This is to prevent a bug where we can get stuck in an
; infinite loop later on.
@@ -211,39 +210,38 @@ Menu_InitItemScreen:
Menu_AddressLong:
db $40 ; Bow
db $41 ; Boomerang
db $42 ; Hookshot
db $42 ; Hookshot
db $43 ; Bombs
db $44 ; Powder
db $44 ; Powder
db $5C ; Bottle 1
db $4B ; Hammer
db $4A ; Lamp
db $4B ; Hammer
db $4A ; Lamp
db $45 ; Fire Rod
db $46 ; Ice Rod
db $46 ; Ice Rod
db $53 ; Magic Mirror
db $5D ; Bottle 2
db $4C ; Ocarina (formerly shovel 4F)
db $4E ; Book
db $4E ; Book
db $50 ; Cane of Somaria / Cane of Byrna
db $51 ; Fishing Rod
db $4D ; Roc's Feather
db $4D ; Roc's Feather
db $5E ; Bottle 3
db $49 ; Deku Mask
db $49 ; Deku Mask
db $47 ; Zora Mask
db $58 ; Wolf Mask
db $58 ; Wolf Mask
db $48 ; Bunny Hood
db $52 ; Stone Mask
db $5F ; Bottle #4
db $5F ; Bottle 4
GotoNextItem_Local:
{
; Load our currently equipped item, and move to the next one
; If we reach our limit (21), set it back to the bow and arrow slot.
LDA $0202 : INC A : CMP.b #$18 : BCC .dont_reset
LDA.b #$01
LDA.b #$01
.dont_reset
; Otherwise try to equip the item in the next slot
STA $0202
@@ -252,12 +250,12 @@ GotoNextItem_Local:
DoWeHaveThisItem_Override:
{
LDY.w $0202 : LDX.w Menu_AddressLong-1, Y
LDY.w $0202 : LDX.w Menu_AddressLong-1, Y
LDA.l $7EF300, X : CMP.b #$00 : BNE .have_this_item
CLC
RTL
.have_this_item
SEC
SEC
RTL
}
@@ -302,13 +300,13 @@ SearchForEquippedItem_Override:
BCS .we_have_that_item
JSR TryEquipNextItem_Override
.exit
REP #$30
PLB
PLB
RTL
}
pushpc
pushpc
org $0DDEB0
ItemMenu_CheckForOwnership:
@@ -325,6 +323,5 @@ SearchForEquippedItem:
}
assert pc() <= $0DE3C7
; =========================================================
pullpc
pullpc

View File

@@ -58,7 +58,7 @@ PlaytimeLabel:
Menu_DrawHourDigit:
{
SEP #$30
LDA.l $7EE000
LDA.l $7EE000
ASL A : ASL A
TAX
REP #$30
@@ -71,7 +71,7 @@ Menu_DrawHourDigit:
Menu_DrawMinuteDigit:
{
SEP #$30
LDA.l $7EE001
LDA.l $7EE001
ASL A : ASL A
TAX
REP #$30
@@ -85,9 +85,9 @@ Menu_DrawPlaytimeLabel:
{
LDX.w #$10
.draw2
.draw2
LDA.w PlaytimeLabel, X
STA.w $1692, X
STA.w $1692, X
DEX : DEX : BPL .draw2
; Draw the current time based on the time system RAM
@@ -100,7 +100,6 @@ Menu_DrawPlaytimeLabel:
; LDX #$18
JSR Menu_DrawMinuteDigit
RTS
}
@@ -199,7 +198,6 @@ Menu_DrawItemName:
CMP.b #$0C : BEQ .bottle_2
CMP.b #$12 : BEQ .bottle_3
CMP.b #$18 : BEQ .bottle_4
.draw_item
REP #$30
LDA.w $0202 : BEQ .no_items
@@ -249,11 +247,11 @@ Menu_DrawItemName:
; Check the timer and see if we should draw the item name
LDA $1A : AND.w #$00FF : CMP #$0080 : BCC .draw_item
LDA $030F : BEQ .draw_item
LDA $030F : AND.w #$00FF : DEC : ASL #5 : TAX
LDA $030F : AND.w #$00FF : DEC : ASL #5 : TAX
LDY.w #$0000
.draw_ocarina_loop
LDA.w Menu_SongNames, X : STA.w $1692, Y
LDA.w Menu_SongNames, X : STA.w $1692, Y
INX #2 : INY #2 : CPY #$001C : BCC .draw_ocarina_loop
RTS
}