fixed some bow related draw bugs and a selected item infinite loop bug
This commit is contained in:
12
.gitignore
vendored
Normal file
12
.gitignore
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
asar.exe
|
||||||
|
oos111.sfc
|
||||||
|
oos111x-1.bst
|
||||||
|
oos111x-2.bst
|
||||||
|
oos111x-3.bst
|
||||||
|
oos111x.bp
|
||||||
|
oos111x.cht
|
||||||
|
oos111x.cpu.sym
|
||||||
|
oos111x.sfc
|
||||||
|
oos111x.smp.sym
|
||||||
|
oos111x.srm
|
||||||
|
oos111x.sym
|
||||||
@@ -14,7 +14,7 @@ pushpc
|
|||||||
; update in game hud colors
|
; update in game hud colors
|
||||||
org $1BD662 : dw hexto555($814f16), hexto555($552903)
|
org $1BD662 : dw hexto555($814f16), hexto555($552903)
|
||||||
org $1BD66A : dw hexto555($d51d00), hexto555($f9f9f9)
|
org $1BD66A : dw hexto555($d51d00), hexto555($f9f9f9)
|
||||||
org $1DB672 : dw hexto555($d1a452), hexto555($f9f9f9)
|
org $1DB672 : dw hexto555($d0a050), hexto555($f9f9f9)
|
||||||
org $1DB67A : dw hexto555($5987e0), hexto555($f9f9f9)
|
org $1DB67A : dw hexto555($5987e0), hexto555($f9f9f9)
|
||||||
org $1DB682 : dw hexto555($7b7b83), hexto555($bbbbbb)
|
org $1DB682 : dw hexto555($7b7b83), hexto555($bbbbbb)
|
||||||
org $1DB68A : dw hexto555($a58100), hexto555($dfb93f)
|
org $1DB68A : dw hexto555($a58100), hexto555($dfb93f)
|
||||||
@@ -158,11 +158,10 @@ Menu_ScrollDown:
|
|||||||
INX : INX
|
INX : INX
|
||||||
LDA.w Menu_Scroll, X
|
LDA.w Menu_Scroll, X
|
||||||
STA.b $EA
|
STA.b $EA
|
||||||
CMP.w #$FF12 : BNE .loop
|
CMP.w #$FF12 : BNE .notDoneScrolling
|
||||||
|
JMP Menu_InitItemScreen
|
||||||
|
|
||||||
JMP Menu_InitItemScreen
|
.notDoneScrolling
|
||||||
|
|
||||||
.loop
|
|
||||||
STX.w MenuScrollLevelV
|
STX.w MenuScrollLevelV
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,32 @@
|
|||||||
; =========================================================
|
; =========================================================
|
||||||
; Tilemap Menu background
|
; Tilemap Menu background
|
||||||
|
|
||||||
|
; This function is bled into via the previous menu.asm function.
|
||||||
|
|
||||||
Menu_DrawBackground:
|
Menu_DrawBackground:
|
||||||
{
|
{
|
||||||
REP #$30
|
REP #$30
|
||||||
LDX.w #$FE ; $1700-17FF
|
LDX.w #$FE ; $1700-17FF
|
||||||
|
|
||||||
.loop
|
.loop
|
||||||
LDA.w menu_frame, X
|
LDA.w menu_frame, X
|
||||||
STA.w $1000, X
|
STA.w $1000, X
|
||||||
LDA.w menu_frame+$100, X
|
LDA.w menu_frame+$100, X
|
||||||
STA.w $1100, X
|
STA.w $1100, X
|
||||||
LDA.w menu_frame+$200, X
|
LDA.w menu_frame+$200, X
|
||||||
STA.w $1200, X
|
STA.w $1200, X
|
||||||
LDA.w menu_frame+$300, X
|
LDA.w menu_frame+$300, X
|
||||||
STA.w $1300, X
|
STA.w $1300, X
|
||||||
LDA.w menu_frame+$400, X
|
LDA.w menu_frame+$400, X
|
||||||
STA.w $1400, X
|
STA.w $1400, X
|
||||||
LDA.w menu_frame+$500, X
|
LDA.w menu_frame+$500, X
|
||||||
STA.w $1500, X
|
STA.w $1500, X
|
||||||
LDA.w menu_frame+$600, X
|
LDA.w menu_frame+$600, X
|
||||||
STA.w $1600, X
|
STA.w $1600, X
|
||||||
LDA.w menu_frame+$700, X
|
LDA.w menu_frame+$700, X
|
||||||
STA.w $1700, X
|
STA.w $1700, X
|
||||||
|
|
||||||
DEX : DEX
|
DEX : DEX
|
||||||
BPL .loop
|
BPL .loop
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ NothingGFX:
|
|||||||
|
|
||||||
BowsGFX:
|
BowsGFX:
|
||||||
dw $28BA, $28E9, $28E8, $28CB ; Empty bow
|
dw $28BA, $28E9, $28E8, $28CB ; Empty bow
|
||||||
dw $28BA, $28BB, $24CA, $28CB ; Bow and arrows
|
dw $28BA, $28BB, $28CA, $28CB ; Bow and arrows
|
||||||
dw $28BA, $28E9, $28E8, $28CB ; Empty silvers bow
|
dw $28BA, $28E9, $28E8, $28CB ; Empty silvers bow
|
||||||
dw $28BA, $28BB, $24CA, $28CB ; Silver bow and arrows
|
dw $28BA, $28BB, $24CA, $28CB ; Silver bow and arrows
|
||||||
|
|
||||||
|
|||||||
@@ -216,77 +216,81 @@ MagicTilemap:
|
|||||||
dw MostlyFull, Full, Full, Full
|
dw MostlyFull, Full, Full, Full
|
||||||
|
|
||||||
; =========================================================
|
; =========================================================
|
||||||
; *$6FAFD-$6FB90 LOCAL
|
; $06FAFD-$06FB90 LOCAL
|
||||||
|
|
||||||
HUD_UpdateItemBox:
|
HUD_UpdateItemBox:
|
||||||
{
|
{
|
||||||
SEP #$30
|
SEP #$30
|
||||||
; Dost thou haveth the the bow?
|
; Dost thou haveth the the bow?
|
||||||
LDA $7EF340 : BEQ .no_bow
|
LDA $7EF340 : BEQ .no_bow
|
||||||
|
CMP.b #$03 : BCC .no_silver_arrows
|
||||||
|
; check how many arrows the player has
|
||||||
|
LDA $7EF377 : BNE .draw_bow_item_icon
|
||||||
|
LDX.b #$03
|
||||||
|
BRA .draw_bow_item_icon
|
||||||
|
|
||||||
CMP.b #$03 : BCC .no_silver_arrows
|
.no_silver_arrows
|
||||||
|
|
||||||
; check how many arrows the player has
|
LDX.b #$02
|
||||||
LDA $7EF377 : BNE .draw_bow_item_icon
|
|
||||||
LDX.b #$03
|
|
||||||
BRA .draw_bow_item_icon
|
|
||||||
|
|
||||||
.no_silver_arrows
|
LDA $7EF377 : BNE .draw_bow_item_icon
|
||||||
|
LDX.b #$01
|
||||||
|
|
||||||
LDX.b #$02
|
.draw_bow_item_icon
|
||||||
|
; values of X correspond to how the icon will end up drawn:
|
||||||
|
; 0x01 - normal bow with no arrows
|
||||||
|
; 0x02 - normal bow with arrows
|
||||||
|
; 0x03 - silver bow with no silver arrows
|
||||||
|
; 0x04 - silver bow with silver arrows
|
||||||
|
TXA : STA $7EF340
|
||||||
|
|
||||||
LDA $7EF377 : BNE .draw_bow_item_icon
|
.no_bow
|
||||||
|
|
||||||
LDX.b #$01
|
REP #$30
|
||||||
|
LDX $0202 : BEQ .no_equipped_item
|
||||||
|
LDA $7EF33F, X : AND.w #$00FF
|
||||||
|
CPX.w #$0004 : BNE .bombs_not_equipped
|
||||||
|
LDA.w #$0001
|
||||||
|
|
||||||
.draw_bow_item_icon
|
.bombs_not_equipped
|
||||||
; values of X correspond to how the icon will end up drawn:
|
|
||||||
; 0x01 - normal bow with no arrows
|
|
||||||
; 0x02 - normal bow with arrows
|
|
||||||
; 0x03 - silver bow with no silver arrows
|
|
||||||
; 0x04 - silver bow with silver arrows
|
|
||||||
TXA : STA $7EF340
|
|
||||||
|
|
||||||
.no_bow
|
CPX.w #$0006 : BNE .bottle1_not_equipped
|
||||||
REP #$30
|
JMP .load_bottle_content
|
||||||
LDX $0202 : BEQ .no_equipped_item
|
|
||||||
LDA $7EF33F, X : AND.w #$00FF
|
|
||||||
CPX.w #$0004 : BNE .bombs_not_equipped
|
|
||||||
LDA.w #$0001
|
|
||||||
|
|
||||||
.bombs_not_equipped
|
.bottle1_not_equipped
|
||||||
CPX.w #$0006 : BNE .bottle1_not_equipped
|
|
||||||
JMP .load_bottle_content
|
|
||||||
|
|
||||||
.bottle1_not_equipped
|
CPX.w #$000C : BNE .bottle2_not_equipped
|
||||||
CPX.w #$000C : BNE .bottle2_not_equipped
|
LDA.w #$0002 : JMP .load_bottle_content
|
||||||
LDA.w #$0002 : JMP .load_bottle_content
|
|
||||||
|
|
||||||
.bottle2_not_equipped
|
.bottle2_not_equipped
|
||||||
CPX.w #$0012 : BNE .bottle3_not_equipped
|
|
||||||
LDA.w #$0003 : JMP .load_bottle_content
|
|
||||||
|
|
||||||
.bottle3_not_equipped
|
CPX.w #$0012 : BNE .bottle3_not_equipped
|
||||||
CPX.w #$0018 : BNE .bottle_not_equipped
|
LDA.w #$0003 : JMP .load_bottle_content
|
||||||
LDA.w #$0004
|
|
||||||
|
|
||||||
.load_bottle_content
|
.bottle3_not_equipped
|
||||||
TXY : TAX : LDA $7EF35B, X : AND.w #$00FF : TYX
|
|
||||||
|
|
||||||
.bottle_not_equipped
|
CPX.w #$0018 : BNE .bottle_not_equipped
|
||||||
CPX.w #$000D : BNE .flute_not_equipped
|
LDA.w #$0004
|
||||||
LDA $030F
|
|
||||||
|
|
||||||
.flute_not_equipped
|
.load_bottle_content
|
||||||
CPX.w #$0003 : BNE .hookshot_not_equipped
|
|
||||||
LDA.w GoldstarOrHookshot : BEQ .hookshot_not_equipped
|
|
||||||
SEC : SBC.b #$01
|
|
||||||
|
|
||||||
.hookshot_not_equipped
|
TXY : TAX : LDA $7EF35B, X : AND.w #$00FF : TYX
|
||||||
|
|
||||||
JSR HUD_DrawItem
|
.bottle_not_equipped
|
||||||
|
|
||||||
.no_equipped_item
|
CPX.w #$000D : BNE .flute_not_equipped
|
||||||
|
LDA $030F
|
||||||
|
|
||||||
|
.flute_not_equipped
|
||||||
|
|
||||||
|
CPX.w #$0003 : BNE .hookshot_not_equipped
|
||||||
|
LDA.w GoldstarOrHookshot : BEQ .hookshot_not_equipped
|
||||||
|
SEC : SBC.b #$01
|
||||||
|
|
||||||
|
.hookshot_not_equipped
|
||||||
|
|
||||||
|
JSR HUD_DrawItem
|
||||||
|
|
||||||
|
.no_equipped_item
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -401,7 +405,7 @@ HudItems:
|
|||||||
org $0DF629
|
org $0DF629
|
||||||
dw $20F5, $20F5, $20F5, $20F5 ; No bow
|
dw $20F5, $20F5, $20F5, $20F5 ; No bow
|
||||||
dw $28BA, $28E9, $28E8, $28CB ; Empty bow
|
dw $28BA, $28E9, $28E8, $28CB ; Empty bow
|
||||||
dw $28BA, $28BB, $24CA, $28CB ; Bow and arrows
|
dw $28BA, $28BB, $28CA, $28CB ; Bow and arrows
|
||||||
dw $28BA, $28E9, $28E8, $28CB ; Empty silvers bow
|
dw $28BA, $28E9, $28E8, $28CB ; Empty silvers bow
|
||||||
dw $28BA, $28BB, $24CA, $28CB ; Silver bow and arrows
|
dw $28BA, $28BB, $24CA, $28CB ; Silver bow and arrows
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Menu_Palette:
|
|||||||
dw hexto555($f9f9f9)
|
dw hexto555($f9f9f9)
|
||||||
dw hexto555($000000)
|
dw hexto555($000000)
|
||||||
dw hexto555($000000) ; transparent
|
dw hexto555($000000) ; transparent
|
||||||
dw hexto555($d1a452)
|
dw hexto555($d0a050)
|
||||||
dw hexto555($f9f9f9)
|
dw hexto555($f9f9f9)
|
||||||
dw hexto555($000000)
|
dw hexto555($000000)
|
||||||
dw hexto555($000000) ; transparent
|
dw hexto555($000000) ; transparent
|
||||||
|
|||||||
@@ -167,24 +167,39 @@ Menu_InitItemScreen:
|
|||||||
{
|
{
|
||||||
SEP #$30
|
SEP #$30
|
||||||
LDY.w $0202 : BNE .all_good
|
LDY.w $0202 : BNE .all_good
|
||||||
|
; Loop through the SRM of each item to see if we have
|
||||||
|
; one of them so we can start with that one selected.
|
||||||
|
.loop
|
||||||
|
INY : CPY.b #$25 : BCS .bad
|
||||||
|
LDX.w Menu_AddressIndex-1, Y
|
||||||
|
LDA.l $7EF300, X
|
||||||
|
BEQ .loop
|
||||||
|
|
||||||
.loop
|
STY.w $0202
|
||||||
INY : CPY.b #$25 : BCS .bad
|
BRA .all_good
|
||||||
|
|
||||||
|
.bad
|
||||||
|
; If we made it here that means there are no items
|
||||||
|
; available but one was still selected.
|
||||||
|
; This should never happen.
|
||||||
|
STZ.w $0202
|
||||||
|
|
||||||
|
STZ $0207
|
||||||
|
LDA.b #$04
|
||||||
|
STA.w $0200
|
||||||
|
RTS
|
||||||
|
|
||||||
|
.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.
|
||||||
LDX.w Menu_AddressIndex-1, Y
|
LDX.w Menu_AddressIndex-1, Y
|
||||||
LDA.l $7EF300, X
|
LDA.l $7EF300, X
|
||||||
BEQ .loop
|
CMP.b #$01 : BCC .bad
|
||||||
|
STZ $0207
|
||||||
STY.w $0202
|
LDA.b #$04
|
||||||
BRA .all_good
|
STA.w $0200
|
||||||
|
RTS
|
||||||
.bad
|
|
||||||
STZ.w $0202
|
|
||||||
|
|
||||||
.all_good
|
|
||||||
STZ $0207
|
|
||||||
LDA.b #$04
|
|
||||||
STA.w $0200
|
|
||||||
RTS
|
|
||||||
}
|
}
|
||||||
|
|
||||||
; =========================================================
|
; =========================================================
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ namespace Oracle
|
|||||||
; -------------------------------------------------------
|
; -------------------------------------------------------
|
||||||
incsrc "Util/all_items.asm"
|
incsrc "Util/all_items.asm"
|
||||||
|
|
||||||
incsrc "Dungeons/house_walls.asm"
|
;incsrc "Dungeons/house_walls.asm"
|
||||||
|
|
||||||
print ""
|
print ""
|
||||||
print "Finished applying patches"
|
print "Finished applying patches"
|
||||||
|
|||||||
Reference in New Issue
Block a user