Merge pull request #176 from cassidoxa/menu_dungeonhud

Allow menu free dungeon item toggle with no menu items
This commit is contained in:
Lexi Rose
2022-12-09 10:07:46 -06:00
committed by GitHub
4 changed files with 49 additions and 3 deletions

View File

@@ -1116,6 +1116,13 @@ JSL.l CheckCloseItemMenu
org $0DEE70 ; <- 6EE70 - equipment.asm : 2137
JSL.l PrepItemScreenBigKey : NOP
;--------------------------------------------------------------------------------
org $0DDEA5 ; LDA.b Joy1A_New : BEQ .wait_for_button
JSL.l HandleEmptyMenu : RTS
org $0DEB3C ; LDA.w ItemCursor : AND.w #$00FF
JML.l MaybeDrawEquippedItem : NOP #2
org $0DE363 ; LDA.b #$04 : STA.w SubModuleInterface
JSL.l RestoreMenu_SetSubModule : NOP
;--------------------------------------------------------------------------------
org $08D395 ; <- 45395 - ancilla_bird_travel_intro.asm : 253
JSL.l UpgradeFlute : NOP #2
;--------------------------------------------------------------------------------

View File

@@ -29,7 +29,7 @@
;--------------------------------------------------------------------------------
ProcessMenuButtons:
LDA.b Joy1A_New : BIT.b #$40 : BNE .y_pressed ; check for P1 Y-button
BIT #$20 : BNE .sel_pressed ; check for P1 Select button
BIT.b #$20 : BNE .sel_pressed ; check for P1 Select button
LDA.b Joy1A_All : BIT.b #$20 : BNE .sel_held
.sel_unheld
LDA.l HudFlag : AND.b #$20 : BEQ +

View File

@@ -177,6 +177,7 @@ CheckCloseItemMenu:
RTL
;================================================================================
ShowDungeonItems:
REP #$30
LDA.w DungeonID : AND.w #$00FF : CMP.w #$00FF : BNE + : RTL : + ; return normal result if outdoors or in a cave
LDA.l HudFlag : AND.w #$0020 ; check hud flag
BEQ + : LDA.w #$0000 : RTL : + ; if set, send the zero onwards
@@ -655,3 +656,38 @@ dw $A8FB, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $E8FB
;0x1C - ??? possibly unused. (Were they planning two extra dungeons perhaps?)
;0x1E - ??? possibly unused.
;================================================================================
HandleEmptyMenu:
LDA.b Joy1A_New : BIT.b #$DF : BNE .close_menu ; Not select, close menu
BIT.b #$20 : BNE .sel_pressed
LDA.b Joy1A_All : BIT.b #$20 : BNE .wait_for_change
LDA.l HudFlag : AND.b #$20 : BEQ .wait_for_change ; HUD flag off, skip drawing work
LDA.l HudFlag : AND.b #$DF : STA.l HudFlag ; Unset without select
LDA.b IndoorsFlag : BEQ ++ ; skip if outdoors
LDA.b #$20 : STA.w SFX3
++
LDA.b #$0C : BRA .done
.sel_pressed
LDA.l HudFlag : ORA.b #$20 : STA.l HudFlag
LDA.b #$20 : STA.w SFX3
LDA.b #$0C : BRA .done
.wait_for_change
LDA.b #$03 : BRA .done
.close_menu
LDA.b #$06
.done
STA.w SubModuleInterface
RTL
;-------------------------------------------------------------------------------
MaybeDrawEquippedItem:
LDA.w ItemCursor : BEQ +
JML.l ItemMenu_DrawEquippedYItem+$07
+
JML.l ItemMenu_DrawEquippedYItem_exit
;-------------------------------------------------------------------------------
RestoreMenu_SetSubModule:
LDA.w ItemCursor : BEQ +
LDA.b #$04 : STA.w SubModuleInterface
RTL
+
LDA.b #$03 : STA.w SubModuleInterface
RTL

View File

@@ -91,8 +91,11 @@ Equipment_UpdateEquippedItemLong = $0DDD32
BottleMenu_movingOn = $0DE01E
RestoreNormalMenu = $0DE346
Equipment_SearchForEquippedItemLong = $0DE395
DrawProgressIcons = $0DE9C8 ; this returns short
DrawEquipment = $0DED29 ; this returns short
DrawProgressIcons = $0DE9C8 ; returns short
ItemMenu_DrawEquippedYItem = $0DEB3A ; returns short
ItemMenu_DrawEquippedYItem_exit = $0DECE6 ; returns short
ItemMenu_DrawEquipment_dungeonitems = $0DEDCC ; returns short
DrawEquipment = $0DED29 ; returns short
HUD_RebuildLong = $0DFA78
HUD_RebuildIndoor_Palace = $0DFA88
HUD_RebuildLong2 = $0DFA88