added the right side hud copy

This commit is contained in:
Jared_Brian_
2024-03-18 22:52:09 -06:00
parent 2243db03fe
commit f71e1dc92a
3 changed files with 153 additions and 96 deletions

View File

@@ -20,7 +20,8 @@ org $1DB682 : dw hexto555($7b7b83), hexto555($bbbbbb)
org $1DB68A : dw hexto555($a58100), hexto555($dfb93f)
; Free ROM in Bank 00
org $0098AB : db $D8>>1
org $0098AB : db $6C
org $0098AC : db $64
; Module RunInterface 0E.01: Item Menu
org $00F877 : db Menu_Entry>>0
@@ -68,6 +69,7 @@ Menu_Entry:
dw Menu_ScrollUp ; 08
dw Menu_CheckBottle ; 09
dw Menu_Exit ; 0A
dw Menu_CopyToRight ; 0B
; =========================================================
; 00 MENU INIT GRAPHICS
@@ -177,7 +179,6 @@ Menu_ItemScreen:
INC $0207
LDA.w $0202 : BEQ .no_inputs
; Scroll through joypad 1 inputs
ASL : TAY : LDA.b $F4
LSR : BCS .move_right
@@ -222,7 +223,6 @@ Menu_ItemScreen:
REP #$20
BEQ .no_delete
; Delete cursor
LDA.w #$20F5
STA.w $1108, X : STA.w $1148, X
@@ -287,7 +287,6 @@ Menu_ScrollFrom:
{
JSR Menu_ScrollHorizontal
BCC .not_done
JMP Menu_InitItemScreen
.not_done
@@ -376,6 +375,70 @@ Menu_Exit:
}
; =========================================================
; 0B MENU COPY TO RIGHT
Menu_CopyToRight:
{
REP #$20
; Clear out the whole buffer.
LDX.b #$FE ; $1700-17FF
.loop
LDA.w #$387F
STA.w $1000, X
STA.w $1100, X
STA.w $1200, X
STA.w $1300, X
STA.w $1400, X
STA.w $1500, X
STA.w $1600, X
STA.w $1700, X
DEX : DEX
BNE .loop
; TODO: The BPL wasn't working so figure out why and fix it.
STA.w $1000
STA.w $1100
STA.w $1200
STA.w $1300
STA.w $1400
STA.w $1500
STA.w $1600
STA.w $1700
SEP #$20
; The whole HUD fits on 4 rows so I'm only going to copy 4 here.
LDX.b #$3A
.loop1
LDA $7EC702, X : STA $1082, X
DEX : BNE .loop1
LDX.b #$3A
.loop2
LDA $7EC742, X : STA $10C2, X
DEX : BNE .loop2
LDX.b #$3A
.loop3
LDA $7EC782, X : STA $1102, X
DEX : BNE .loop3
LDX.b #$3A
.loop4
LDA $7EC7C2, X : STA $1142, X
DEX : BNE .loop4
LDA.b #$24 : STA.w $0116
LDA.b #$01 : STA.b $17
LDA.b #$08 : STA.w $0200
RTS
}
menu_frame: incbin "tilemaps/menu_frame.tilemap"
quest_icons: incbin "tilemaps/quest_icons.tilemap"

View File

@@ -70,7 +70,6 @@ HUD_Update:
; Branch if at full health
LDA $7EF36C : CMP $7EF36D : BEQ .healthUpdated
; Seems absurd to have a branch of zero bytes, right?
SEC : SBC #$04 : CMP $7EF36D : BCS .healthUpdated
@@ -94,7 +93,6 @@ HUD_Update:
; Magic amount indicator (normal, 1/2, or 1/4)
LDA $7EF37B : AND.w #$00FF : CMP.w #$0001 : BCC .normal_magic_meter
; draw 1/2 magic meter
LDA.w #$2851 : STA $7EC730
LDA.w #$28FA : STA $7EC732
@@ -134,7 +132,6 @@ HUD_Update:
; Check if the user has bombs equipped
LDX $0202 : LDA $7EF33F, X : AND.w #$00FF
CPX.w #$0004 : BNE .not_bombs
; Number of bombs Link has.
LDA $7EF343 : AND.w #$00FF
JSR HexToDecimal
@@ -147,6 +144,7 @@ HUD_Update:
LDA $05 : AND.w #$00FF : ORA.w #$2400 : STA $7EC7B2
.not_bombs
; Check if the user has arrows equipped
LDX $0202 : LDA $7EF33F, X : AND.w #$00FF
CPX.w #$0001 : BNE .not_arrows
@@ -171,18 +169,19 @@ HUD_Update:
LDA $7EF36F : AND.w #$00FF : CMP.w #$00FF : BEQ .no_keys
JSR HexToDecimal
.no_keys
REP #$30
; The key digit, which is optionally drawn.
; Also check to see if the key spot is blank
LDA $05 : AND.w #$00FF : ORA.w #$2400 : STA $7EC7A4
CMP.w #$247F : BNE .dont_blank_key_icon
; TODO: Find the proper index of the key icon, this one is outdated.
; If the key digit is blank, also blank out the key icon.
STA $7EC724
.dont_blank_key_icon
SEP #$30
RTL
}
@@ -386,11 +385,6 @@ HexToDecimal:
RTS
}
CopyHudToRight:
{
}
pushpc
; =========================================================

View File

@@ -7,10 +7,10 @@ Menu_CheckHScroll:
LDA.b $F6
BIT.b #$20 : BNE .left
BIT.b #$10 : BNE .right
RTS
.left
REP #$20
LDA.w #$FFF8
BRA .merge
@@ -28,8 +28,8 @@ Menu_CheckHScroll:
RTS
.leave_menu
LDA.b #$08
STA.w $0200
LDA.b #$0B : STA.w $0200
RTS
}