Merge pull request #50 from scawful/JaredMenuFixes

This commit is contained in:
Justin Scofield
2024-03-25 19:56:06 -04:00
committed by GitHub
12 changed files with 777 additions and 620 deletions

12
.gitignore vendored Normal file
View 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

View File

@@ -14,13 +14,14 @@ 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)
; Free ROM in Bank 00 ; Free ROM in Bank 00
org $0098AB : db $D8>>1 org $0098AB : db $6C
org $0098AC : db $64
; Module RunInterface 0E.01: Item Menu ; Module RunInterface 0E.01: Item Menu
org $00F877 : db Menu_Entry>>0 org $00F877 : db Menu_Entry>>0
@@ -68,6 +69,7 @@ Menu_Entry:
dw Menu_ScrollUp ; 08 dw Menu_ScrollUp ; 08
dw Menu_CheckBottle ; 09 dw Menu_CheckBottle ; 09
dw Menu_Exit ; 0A dw Menu_Exit ; 0A
dw Menu_InitiateScrollDown ; 0B
; ========================================================= ; =========================================================
; 00 MENU INIT GRAPHICS ; 00 MENU INIT GRAPHICS
@@ -158,11 +160,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
.loop .notDoneScrolling
STX.w MenuScrollLevelV STX.w MenuScrollLevelV
RTS RTS
} }
@@ -178,7 +179,6 @@ Menu_ItemScreen:
INC $0207 INC $0207
LDA.w $0202 : BEQ .no_inputs LDA.w $0202 : BEQ .no_inputs
; Scroll through joypad 1 inputs ; Scroll through joypad 1 inputs
ASL : TAY : LDA.b $F4 ASL : TAY : LDA.b $F4
LSR : BCS .move_right LSR : BCS .move_right
@@ -223,7 +223,6 @@ Menu_ItemScreen:
REP #$20 REP #$20
BEQ .no_delete BEQ .no_delete
; Delete cursor ; Delete cursor
LDA.w #$20F5 LDA.w #$20F5
STA.w $1108, X : STA.w $1148, X STA.w $1108, X : STA.w $1148, X
@@ -262,7 +261,6 @@ Menu_ScrollTo:
SEP #$20 SEP #$20
JSR Menu_ScrollHorizontal JSR Menu_ScrollHorizontal
BCC .not_done BCC .not_done
INC.w $0200 INC.w $0200
.not_done .not_done
@@ -288,7 +286,6 @@ Menu_ScrollFrom:
{ {
JSR Menu_ScrollHorizontal JSR Menu_ScrollHorizontal
BCC .not_done BCC .not_done
JMP Menu_InitItemScreen JMP Menu_InitItemScreen
.not_done .not_done
@@ -300,19 +297,17 @@ Menu_ScrollFrom:
Menu_ScrollUp: Menu_ScrollUp:
{ {
JSL $0DFA58 ; HUD_Rebuild_Long
LDA.b #$12 : STA.w $012F ; play menu exit sound effect
SEP #$10 SEP #$10
REP #$20 REP #$20
LDX.w MenuScrollLevelV LDX.w MenuScrollLevelV
LDA.w Menu_Scroll, X LDA.w Menu_Scroll, X
STA.b $EA : BNE .loop STA.b $EA : BNE .notDoneScrolling
STZ.b $E4 STZ.b $E4
INC.w $0200 INC.w $0200
RTS RTS
.loop .notDoneScrolling
DEX : DEX : STX.w MenuScrollLevelV DEX : DEX : STX.w MenuScrollLevelV
RTS RTS
} }
@@ -377,8 +372,85 @@ Menu_Exit:
} }
; ========================================================= ; =========================================================
; 0B MENU COPY TO RIGHT
Menu_InitiateScrollDown:
{
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 instead of doing this abomination.
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
JSL $0DFA58 ; HUD_Rebuild_Long
; Draw one frame of the clock so it doesn't just
; pop in when scrolling down.
JSL DrawClockToHudLong
; The whole HUD fits on 4 rows so I'm only going to
; copy 4 here. Also we start 2 in because thats the
; left we need to go.
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
LDA.b #$12 : STA.w $012F ; play menu exit sound effect
RTS
}
menu_frame: incbin "tilemaps/menu_frame.tilemap" menu_frame: incbin "tilemaps/menu_frame.tilemap"
quest_icons: incbin "tilemaps/quest_icons.tilemap" quest_icons: incbin "tilemaps/quest_icons.tilemap"
incsrc "menu_map_names.asm" incsrc "menu_map_names.asm"
incsrc "menu_hud.asm" incsrc "menu_hud.asm"
; =========================================================

View File

@@ -1,6 +1,7 @@
; ========================================================= ; =========================================================
; Tilemap Menu background ; Tilemap Menu background
; This function is bled into via the previous menu.asm file.
Menu_DrawBackground: Menu_DrawBackground:
{ {
REP #$30 REP #$30
@@ -39,15 +40,12 @@ DrawMenuItem:
STA.b $08 STA.b $08
STY.b $00 STY.b $00
LDA.b [$08] LDA.b [$08] : AND.w #$00FF : BNE .not_zero
AND.w #$00FF
BNE .not_zero
LDY.w #NothingGFX LDY.w #NothingGFX
BRA .draw BRA .draw
.not_zero .not_zero
DEC DEC
ASL : ASL : ASL ASL : ASL : ASL
@@ -63,7 +61,6 @@ DrawMenuItem:
RTS RTS
} }
; ========================================================= ; =========================================================
; Quest Icons Tilemap Draw Routine ; Quest Icons Tilemap Draw Routine
@@ -93,7 +90,6 @@ Menu_DrawQuestIcons:
RTS RTS
} }
; ========================================================= ; =========================================================
Menu_DrawTriforceIcons: Menu_DrawTriforceIcons:
@@ -105,57 +101,65 @@ Menu_DrawTriforceIcons:
LSR : BCC + LSR : BCC +
STX.w $1366 : INX : STX.w $1368 : DEX STX.w $1366 : INX : STX.w $1368 : DEX
STY.w $13A6 : INY : STY.w $13A8 : DEY STY.w $13A6 : INY : STY.w $13A8 : DEY
+
+ LSR : BCC + LSR : BCC +
STX.w $136A : INX : STX.w $136C : DEX STX.w $136A : INX : STX.w $136C : DEX
STY.w $13AA : INY : STY.w $13AC : DEY STY.w $13AA : INY : STY.w $13AC : DEY
+
+ LSR : BCC + LSR : BCC +
STX.w $136E : INX : STX.w $1370 : DEX STX.w $136E : INX : STX.w $1370 : DEX
STY.w $13AE : INY : STY.w $13B0 : DEY STY.w $13AE : INY : STY.w $13B0 : DEY
+
+ LSR : BCC + LSR : BCC +
STX.w $13E4 : INX : STX.w $13E6 : DEX STX.w $13E4 : INX : STX.w $13E6 : DEX
STY.w $1424 : INY : STY.w $1426 : DEY STY.w $1424 : INY : STY.w $1426 : DEY
+
+ LSR : BCC + LSR : BCC +
STX.w $13E8 : INX : STX.w $13EA : DEX STX.w $13E8 : INX : STX.w $13EA : DEX
STY.w $1428 : INY : STY.w $142A : DEY STY.w $1428 : INY : STY.w $142A : DEY
+
+ LSR : BCC + LSR : BCC +
STX.w $13EC : INX : STX.w $13EE : DEX STX.w $13EC : INX : STX.w $13EE : DEX
STY.w $142C : INY : STY.w $142E : DEY STY.w $142C : INY : STY.w $142E : DEY
+
+ LSR : BCC + LSR : BCC +
STX.w $13F0 : INX : STX.w $13F2 : DEX STX.w $13F0 : INX : STX.w $13F2 : DEX
STY.w $1430 : INY : STY.w $1432 : DEY STY.w $1430 : INY : STY.w $1432 : DEY
+ +
RTS RTS
} }
; ========================================================= ; =========================================================
Menu_DrawPendantIcons: Menu_DrawPendantIcons:
{ {
LDA.l $7EF374 LDA.l $7EF374
LSR : BCC + LSR : BCC +
LDX.w #$2502 : STX.w $14A4 : INX : STX.w $14A6 LDX.w #$2502 : STX.w $14A4 : INX : STX.w $14A6
LDX.w #$2512 : STX.w $14E4 : INX : STX.w $14E6 LDX.w #$2512 : STX.w $14E4 : INX : STX.w $14E6
+
+ LSR : BCC + LSR : BCC +
LDX.w #$3D00 : STX.w $14AA : INX : STX.w $14AC LDX.w #$3D00 : STX.w $14AA : INX : STX.w $14AC
LDX.w #$3D10 : STX.w $14EA : INX : STX.w $14EC LDX.w #$3D10 : STX.w $14EA : INX : STX.w $14EC
+
+ LSR : BCC + LSR : BCC +
LDX.w #$2D06 : STX.w $14B0 : INX : STX.w $14B2 LDX.w #$2D06 : STX.w $14B0 : INX : STX.w $14B2
LDX.w #$2D16 : STX.w $14F0 : INX : STX.w $14F2 LDX.w #$2D16 : STX.w $14F0 : INX : STX.w $14F2
+
+ RTS RTS
} }
; ========================================================= ; =========================================================
; V H O P P P T T T T T T T T T T <- tile format ; V H O P P P T T T T T T T T T T <- tile format
@@ -184,14 +188,15 @@ Menu_DrawHeartPieces:
.top_right .top_right
LDX.w #$64AD : STX.w $14A0 LDX.w #$64AD : STX.w $14A0
.bottom_left .bottom_left
LDX.w #$24AE : STX.w $14DE LDX.w #$24AE : STX.w $14DE
.top_left .top_left
LDX.w #$24AD : STX.w $149E LDX.w #$24AD : STX.w $149E
RTS RTS
} }
; ========================================================= ; =========================================================
; TODO: Attach SRAM values to these for progression ; TODO: Attach SRAM values to these for progression
@@ -243,6 +248,7 @@ DrawYItems:
LDA.w GoldstarOrHookshot : BNE .spoof_hookshot LDA.w GoldstarOrHookshot : BNE .spoof_hookshot
LDA #$0001 ; No goldstar, but hookshot LDA #$0001 ; No goldstar, but hookshot
.spoof_hookshot .spoof_hookshot
STA.w MenuItemValueSpoof : LDA.w #MenuItemValueSpoof STA.w MenuItemValueSpoof : LDA.w #MenuItemValueSpoof
LDX.w #menu_offset(7,9) LDX.w #menu_offset(7,9)
LDY.w #HookGFX LDY.w #HookGFX
@@ -303,10 +309,11 @@ DrawYItems:
; Row 3 ------------------------------------------------- ; Row 3 -------------------------------------------------
LDA.l $7EF34C : CMP.w #$0000 : BEQ .no_ocarina LDA.l $7EF34C : AND.w #$00FF : CMP.w #$0000 : BEQ .no_ocarina
LDA.w $030F : BNE .spoof_ocarina LDA.w $030F : BNE .spoof_ocarina
LDA #$0001 ; Multi-songs not unlocked yet LDA #$0001 ; Multi-songs not unlocked yet
.spoof_ocarina .spoof_ocarina
STA.w ShortSpoof : LDA.w #ShortSpoof STA.w ShortSpoof : LDA.w #ShortSpoof
LDX.w #menu_offset(13,3) LDX.w #menu_offset(13,3)
LDY.w #OcarinaGFX LDY.w #OcarinaGFX
@@ -323,6 +330,7 @@ DrawYItems:
; LDA.l $7EF350 : CMP.w #$00 : BEQ .no_somaria ; LDA.l $7EF350 : CMP.w #$00 : BEQ .no_somaria
; LDA.w SomariaOrByrna : BNE .spoof_somaria ; LDA.w SomariaOrByrna : BNE .spoof_somaria
; .spoof_somaria ; .spoof_somaria
; LDA.w #$01 : STA.w ShortSpoof : LDA.w #ShortSpoof ; LDA.w #$01 : STA.w ShortSpoof : LDA.w #ShortSpoof
LDA.w #$7EF350 LDA.w #$7EF350
LDX.w #menu_offset(13,9) LDX.w #menu_offset(13,9)
@@ -330,7 +338,6 @@ DrawYItems:
JSR DrawMenuItem JSR DrawMenuItem
.no_somaria .no_somaria
LDA.w #$7EF351 LDA.w #$7EF351
LDX.w #menu_offset(13,13) LDX.w #menu_offset(13,13)
;LDY.w #ByrnaGFX ;LDY.w #ByrnaGFX
@@ -436,7 +443,6 @@ Menu_DrawQuestItems:
Menu_DrawBigKey: Menu_DrawBigKey:
{ {
LDA $040C : AND.w #$00FF : CMP.w #$00FF : BEQ .notInPalace LDA $040C : AND.w #$00FF : CMP.w #$00FF : BEQ .notInPalace
LSR A : TAX LSR A : TAX
; Check if we have the big key in this palace ; Check if we have the big key in this palace
@@ -445,9 +451,7 @@ Menu_DrawBigKey:
.locateBigKeyFlag .locateBigKeyFlag
ASL A : DEX : BPL .locateBigKeyFlag : BCC .dontHaveBigKey ASL A : DEX : BPL .locateBigKeyFlag : BCC .dontHaveBigKey
JSR CheckPalaceItemPossession : LDA $02 : BEQ .noTreasureYet JSR CheckPalaceItemPossession : LDA $02 : BEQ .noTreasureYet
SEP #$30 SEP #$30
LDA.b #$7E : STA.b $0A LDA.b #$7E : STA.b $0A
REP #$30 REP #$30
@@ -477,7 +481,6 @@ Menu_DrawBigKey:
.notInPalace .notInPalace
LDA $040C : AND.w #$00FF : CMP.w #$00FF : BEQ .notInPalaceAgain LDA $040C : AND.w #$00FF : CMP.w #$00FF : BEQ .notInPalaceAgain
LSR A : TAX LSR A : TAX
; Check if we have the map in this dungeon ; Check if we have the map in this dungeon
@@ -486,7 +489,6 @@ Menu_DrawBigKey:
.locateMapFlag .locateMapFlag
ASL A : DEX : BPL .locateMapFlag : BCC .dontHaveMap ASL A : DEX : BPL .locateMapFlag : BCC .dontHaveMap
LDA.w #$01 LDA.w #$01
STA.w ShortSpoof STA.w ShortSpoof
LDA.w #ShortSpoof LDA.w #ShortSpoof
@@ -503,7 +505,7 @@ Menu_DrawBigKey:
; ========================================================= ; =========================================================
; *$6EEB6-$6EEDB LOCAL ; $06EEB6-$06EEDB LOCAL
CheckPalaceItemPossession: CheckPalaceItemPossession:
{ {
SEP #$30 SEP #$30
@@ -533,7 +535,6 @@ CheckPalaceItemPossession:
; *$6EEDC-$6EEE0 JUMP LOCATION ; *$6EEDC-$6EEE0 JUMP LOCATION
.pool_CheckPalaceItemPossession: .pool_CheckPalaceItemPossession:
{ {
.failure .failure
STZ $02 STZ $02
@@ -612,7 +613,6 @@ CheckPalaceItemPossession:
Menu_DrawBigChestKey: Menu_DrawBigChestKey:
{ {
LDA $040C : AND.w #$00FF : CMP.w #$00FF : BEQ .notInPalace LDA $040C : AND.w #$00FF : CMP.w #$00FF : BEQ .notInPalace
LSR A : TAX LSR A : TAX
LDA $7EF364 LDA $7EF364
@@ -621,7 +621,6 @@ Menu_DrawBigChestKey:
ASL A : DEX : BPL .locateCompassFlag ASL A : DEX : BPL .locateCompassFlag
BCC .dontHaveCompass BCC .dontHaveCompass
SEP #$30 SEP #$30
LDA.b #$7E : STA.b $0A LDA.b #$7E : STA.b $0A
REP #$30 REP #$30
@@ -638,3 +637,5 @@ Menu_DrawBigChestKey:
RTS RTS
} }
; =========================================================

View File

@@ -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
@@ -173,6 +173,8 @@ MirrorGFX:
; Collectibles ; Collectibles
; --------------------------------------------------------- ; ---------------------------------------------------------
; vhopppcc cccccccc
QuarterNoteGFX: QuarterNoteGFX:
dw $30AA, $306B, $307A, $306A ; Gray Note dw $30AA, $306B, $307A, $306A ; Gray Note
dw $2CAA, $2C6B, $2C7A, $2C6A ; Blue Note dw $2CAA, $2C6B, $2C7A, $2C6A ; Blue Note
@@ -218,7 +220,7 @@ SwordGFX:
dw $2C64, $2CCE, $2C75, $EC64 ; level one dw $2C64, $2CCE, $2C75, $EC64 ; level one
dw $2C64, $2C65, $2C74, $2D26 ; level two dw $2C64, $2C65, $2C74, $2D26 ; level two
dw $3464, $3465, $3475, $3429 ; level three dw $3464, $3465, $3475, $3429 ; level three
dw $3464, $3465, $3475, $3429 ; level four dw $3864, $3865, $3875, $3829 ; level four
; --------------------------------------------------------- ; ---------------------------------------------------------

View File

@@ -70,7 +70,6 @@ HUD_Update:
; Branch if at full health ; Branch if at full health
LDA $7EF36C : CMP $7EF36D : BEQ .healthUpdated LDA $7EF36C : CMP $7EF36D : BEQ .healthUpdated
; Seems absurd to have a branch of zero bytes, right? ; Seems absurd to have a branch of zero bytes, right?
SEC : SBC #$04 : CMP $7EF36D : BCS .healthUpdated SEC : SBC #$04 : CMP $7EF36D : BCS .healthUpdated
@@ -94,7 +93,6 @@ HUD_Update:
; Magic amount indicator (normal, 1/2, or 1/4) ; Magic amount indicator (normal, 1/2, or 1/4)
LDA $7EF37B : AND.w #$00FF : CMP.w #$0001 : BCC .normal_magic_meter LDA $7EF37B : AND.w #$00FF : CMP.w #$0001 : BCC .normal_magic_meter
; draw 1/2 magic meter ; draw 1/2 magic meter
LDA.w #$2851 : STA $7EC730 LDA.w #$2851 : STA $7EC730
LDA.w #$28FA : STA $7EC732 LDA.w #$28FA : STA $7EC732
@@ -134,7 +132,6 @@ HUD_Update:
; Check if the user has bombs equipped ; Check if the user has bombs equipped
LDX $0202 : LDA $7EF33F, X : AND.w #$00FF LDX $0202 : LDA $7EF33F, X : AND.w #$00FF
CPX.w #$0004 : BNE .not_bombs CPX.w #$0004 : BNE .not_bombs
; Number of bombs Link has. ; Number of bombs Link has.
LDA $7EF343 : AND.w #$00FF LDA $7EF343 : AND.w #$00FF
JSR HexToDecimal JSR HexToDecimal
@@ -147,6 +144,7 @@ HUD_Update:
LDA $05 : AND.w #$00FF : ORA.w #$2400 : STA $7EC7B2 LDA $05 : AND.w #$00FF : ORA.w #$2400 : STA $7EC7B2
.not_bombs .not_bombs
; Check if the user has arrows equipped ; Check if the user has arrows equipped
LDX $0202 : LDA $7EF33F, X : AND.w #$00FF LDX $0202 : LDA $7EF33F, X : AND.w #$00FF
CPX.w #$0001 : BNE .not_arrows CPX.w #$0001 : BNE .not_arrows
@@ -171,18 +169,19 @@ HUD_Update:
LDA $7EF36F : AND.w #$00FF : CMP.w #$00FF : BEQ .no_keys LDA $7EF36F : AND.w #$00FF : CMP.w #$00FF : BEQ .no_keys
JSR HexToDecimal JSR HexToDecimal
.no_keys .no_keys
REP #$30 REP #$30
; The key digit, which is optionally drawn. ; The key digit, which is optionally drawn.
; Also check to see if the key spot is blank ; Also check to see if the key spot is blank
LDA $05 : AND.w #$00FF : ORA.w #$2400 : STA $7EC7A4 LDA $05 : AND.w #$00FF : ORA.w #$2400 : STA $7EC7A4
CMP.w #$247F : BNE .dont_blank_key_icon CMP.w #$247F : BNE .dont_blank_key_icon
; TODO: Find the proper index of the key icon, this one is outdated. ; 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. ; If the key digit is blank, also blank out the key icon.
STA $7EC724 STA $7EC724
.dont_blank_key_icon .dont_blank_key_icon
SEP #$30 SEP #$30
RTL RTL
} }
@@ -216,17 +215,14 @@ 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 CMP.b #$03 : BCC .no_silver_arrows
; Check how many arrows the player has:
; check how many arrows the player has
LDA $7EF377 : BNE .draw_bow_item_icon LDA $7EF377 : BNE .draw_bow_item_icon
LDX.b #$03 LDX.b #$03
BRA .draw_bow_item_icon BRA .draw_bow_item_icon
@@ -236,11 +232,10 @@ HUD_UpdateItemBox:
LDX.b #$02 LDX.b #$02
LDA $7EF377 : BNE .draw_bow_item_icon LDA $7EF377 : BNE .draw_bow_item_icon
LDX.b #$01 LDX.b #$01
.draw_bow_item_icon .draw_bow_item_icon
; values of X correspond to how the icon will end up drawn: ; Values of X correspond to how the icon will end up drawn:
; 0x01 - normal bow with no arrows ; 0x01 - normal bow with no arrows
; 0x02 - normal bow with arrows ; 0x02 - normal bow with arrows
; 0x03 - silver bow with no silver arrows ; 0x03 - silver bow with no silver arrows
@@ -248,36 +243,49 @@ HUD_UpdateItemBox:
TXA : STA $7EF340 TXA : STA $7EF340
.no_bow .no_bow
REP #$30 REP #$30
LDX $0202 : BEQ .no_equipped_item LDX $0202 : BEQ .no_equipped_item
LDA $7EF33F, X : AND.w #$00FF TXY
LDA.l Menu_AddressIndex-1, X
AND.w #$00FF : TAX
LDA.l $7EF300, X : AND.w #$00FF
TYX
CPX.w #$0004 : BNE .bombs_not_equipped CPX.w #$0004 : BNE .bombs_not_equipped
LDA.w #$0001 LDA.w #$0001
.bombs_not_equipped .bombs_not_equipped
CPX.w #$0006 : BNE .bottle1_not_equipped CPX.w #$0006 : BNE .bottle1_not_equipped
JMP .load_bottle_content LDA.w #$0000 : JMP .load_bottle_content
.bottle1_not_equipped .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 #$0001 : JMP .load_bottle_content
.bottle2_not_equipped .bottle2_not_equipped
CPX.w #$0012 : BNE .bottle3_not_equipped CPX.w #$0012 : BNE .bottle3_not_equipped
LDA.w #$0003 : JMP .load_bottle_content LDA.w #$0002 : JMP .load_bottle_content
.bottle3_not_equipped .bottle3_not_equipped
CPX.w #$0018 : BNE .bottle_not_equipped CPX.w #$0018 : BNE .bottle_not_equipped
LDA.w #$0004 LDA.w #$0003
.load_bottle_content .load_bottle_content
TXY : TAX : LDA $7EF35B, X : AND.w #$00FF : TYX
TXY : TAX : LDA $7EF35C, X : AND.w #$00FF : TYX
.bottle_not_equipped .bottle_not_equipped
CPX.w #$000D : BNE .flute_not_equipped CPX.w #$000D : BNE .flute_not_equipped
LDA $030F LDA $030F
.flute_not_equipped .flute_not_equipped
CPX.w #$0003 : BNE .hookshot_not_equipped CPX.w #$0003 : BNE .hookshot_not_equipped
LDA.w GoldstarOrHookshot : BEQ .hookshot_not_equipped LDA.w GoldstarOrHookshot : BEQ .hookshot_not_equipped
SEC : SBC.b #$01 SEC : SBC.b #$01
@@ -388,9 +396,9 @@ HudItems:
; bows, boomerang, hookshot, bombs, powder, bottle1 ; bows, boomerang, hookshot, bombs, powder, bottle1
dw $F629, $F651, $F669, $F679, $F689, $F751 dw $F629, $F651, $F669, $F679, $F689, $F751
; hammer, lamp, fire rod, ice rod, mirror, bottle2 ; hammer, lamp, fire rod, ice rod, mirror, bottle2
dw $F701, $F6F1, $F6A1, $F6B1, $F7C9, $F751 dw $F701, $F6F1, $F6A1, $F6B1, $F7C1, $F751
; flute, book, somaria, byrna, feather, bottle3 ; flute, book, somaria, byrna, feather, bottle3
dw $F859, $F741, $F799, $F7A9, $F731, $F751 dw $F859, $F741, $F799, $F7A9, $F729, $F751
; deku, zora, wolf, bunny, stone, bottle4 ; deku, zora, wolf, bunny, stone, bottle4
dw $F6E1, $F821, $F6D1, $F7B9, $F811, $F751 dw $F6E1, $F821, $F6D1, $F7B9, $F811, $F751
} }
@@ -401,7 +409,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
@@ -550,6 +558,7 @@ FloorIndicator:
; disable the floor indicator during the next frame. ; disable the floor indicator during the next frame.
LDA.w #$0000 LDA.w #$0000
.dont_disable .dont_disable
STA $04A0 STA $04A0
PHB : PHK : PLB PHB : PHK : PLB
LDA.w #$251E : STA $7EC7F0 LDA.w #$251E : STA $7EC7F0

View File

@@ -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

View File

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

View File

@@ -32,8 +32,8 @@ Menu_AddressIndex:
db $7EF34C ; shovel 7EF34F db $7EF34C ; shovel 7EF34F
db $7EF34E ; Book db $7EF34E ; Book
db $7EF350 ; Cane of Somaria db $7EF350 ; Cane of Somaria / Cane of Byrna
db $7EF351 ; Cane of Byrna db $7EF351 ; Fishing rod
db $7EF34D ; Roc's Feather db $7EF34D ; Roc's Feather
db $7EF35E ; Bottle 3 db $7EF35E ; Bottle 3
@@ -64,7 +64,7 @@ Menu_ItemCursorPositions:
dw menu_offset(12,2) ; shovel dw menu_offset(12,2) ; shovel
dw menu_offset(12,5) ; feather dw menu_offset(12,5) ; feather
dw menu_offset(12,8) ; somaria dw menu_offset(12,8) ; somaria
dw menu_offset(12,12) ; byrna dw menu_offset(12,12) ; byrna / fishing rod
dw menu_offset(12,15) ; bunny hood dw menu_offset(12,15) ; bunny hood
dw menu_offset(12,18) ; bottle3 dw menu_offset(12,18) ; bottle3
@@ -167,6 +167,10 @@ 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.
.lookForAlternateItem
LDY.b #$00
.loop .loop
INY : CPY.b #$25 : BCS .bad INY : CPY.b #$25 : BCS .bad
@@ -178,9 +182,23 @@ Menu_InitItemScreen:
BRA .all_good BRA .all_good
.bad .bad
; If we made it here that means there are no items
; available but one was still selected. This should
; never happen under normal vanilla circumstances.
STZ.w $0202 STZ.w $0202
STZ $0207
LDA.b #$04
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.
LDX.w Menu_AddressIndex-1, Y
LDA.l $7EF300, X
CMP.b #$01 : BCC .lookForAlternateItem
STZ $0207 STZ $0207
LDA.b #$04 LDA.b #$04
STA.w $0200 STA.w $0200
@@ -206,8 +224,8 @@ Menu_AddressLong:
db $4C ; shovel 4F db $4C ; shovel 4F
db $4E ; Book db $4E ; Book
db $50 ; Cane of Somaria db $50 ; Cane of Somaria / Cane of Byrna
db $51 ; Cane of Byrna db $51 ; Fishing Rod
db $4D ; Roc's Feather db $4D ; Roc's Feather
db $5E ; Bottle 3 db $5E ; Bottle 3
@@ -257,7 +275,6 @@ SearchForEquippedItem_Override:
LDY $0202 : LDX.w Menu_AddressLong-1, Y LDY $0202 : LDX.w Menu_AddressLong-1, Y
LDA.l $7EF33F, X : CMP.b #$00 : BNE .item_available LDA.l $7EF33F, X : CMP.b #$00 : BNE .item_available
; In this case we have no equippable items ; In this case we have no equippable items
STZ $0202 : STZ $0203 : STZ $0204 STZ $0202 : STZ $0203 : STZ $0204
@@ -266,9 +283,7 @@ SearchForEquippedItem_Override:
.item_available .item_available
; Is there an item currently equipped (in the HUD slot)? ; Is there an item currently equipped (in the HUD slot)?
LDA $0202 LDA $0202 : BNE .alreadyEquipped
BNE .alreadyEquipped
; If not, set the equipped item to the Bow and Arrow ; If not, set the equipped item to the Bow and Arrow
; (even if we don't actually have it) ; (even if we don't actually have it)
LDA.b #$01 : STA $0202 LDA.b #$01 : STA $0202
@@ -284,6 +299,7 @@ SearchForEquippedItem_Override:
JMP TryEquipNextItem_Override JMP TryEquipNextItem_Override
} }
pushpc pushpc
org $0DDEB0 org $0DDEB0
@@ -303,4 +319,6 @@ SearchForEquippedItem:
} }
warnpc $0DE3C7 warnpc $0DE3C7
; =========================================================
pullpc pullpc

View File

@@ -99,6 +99,7 @@ Menu_ItemNames:
dw "__STONE_MASK__ " dw "__STONE_MASK__ "
dw "____BOTTLE____ " dw "____BOTTLE____ "
Menu_MushroomLabel:
Menu_BottleItems: Menu_BottleItems:
dw "___MUSHROOM___ " dw "___MUSHROOM___ "
dw "_EMPTY_BOTTLE_ " dw "_EMPTY_BOTTLE_ "
@@ -119,13 +120,25 @@ Menu_SongNames:
Menu_DrawItemName: Menu_DrawItemName:
{ {
SEP #$30 SEP #$30
; Double check that we have the item.
LDY.w $0202
LDX.w Menu_AddressIndex-1, Y
LDA.l $7EF300, X
CMP.b #$01 : BCS .haveItem
REP #$30
RTS
.haveItem
LDA.w $0202 : CMP.b #$03 : BEQ .goldstar LDA.w $0202 : CMP.b #$03 : BEQ .goldstar
LDA.w $0202 : CMP.b #$0D : BEQ .ocarina CMP.b #$05 : BEQ .mushroom
CMP.b #$0D : BEQ .ocarina
; Check if it's a bottle ; Check if it's a bottle
LDA.w $0202 : CMP.b #$06 : BEQ .bottle_1 CMP.b #$06 : BEQ .bottle_1
LDA.w $0202 : CMP.b #$0C : BEQ .bottle_2 CMP.b #$0C : BEQ .bottle_2
LDA.w $0202 : CMP.b #$12 : BEQ .bottle_3 CMP.b #$12 : BEQ .bottle_3
LDA.w $0202 : CMP.b #$18 : BEQ .bottle_4 CMP.b #$18 : BEQ .bottle_4
.draw_item .draw_item
REP #$30 REP #$30
@@ -150,13 +163,19 @@ Menu_DrawItemName:
REP #$30 : LDX #$0002 : JMP .draw_bottle REP #$30 : LDX #$0002 : JMP .draw_bottle
.bottle_4 .bottle_4
REP #$30 : LDX #$0003 REP #$30 : LDX #$0003
.draw_bottle .draw_bottle
JSR DrawBottleNames JSR DrawBottleNames
RTS RTS
.goldstar .goldstar
LDA GoldstarOrHookshot : CMP.b #$02 : BNE .draw_item LDA GoldstarOrHookshot : CMP.b #$02 : BNE .draw_item
JSR MaybeDrawGoldstarName JSR DrawGoldstarName
RTS
.mushroom
LDA.l $7EF344 : CMP.b #$02 : BCS .draw_item
JSR DrawMushroomName
RTS RTS
.ocarina .ocarina
@@ -164,23 +183,22 @@ Menu_DrawItemName:
; Check the timer and see if we should draw the item name ; Check the timer and see if we should draw the item name
LDA $1A : AND.w #$00FF : CMP #$0080 : BCC .draw_item LDA $1A : AND.w #$00FF : CMP #$0080 : BCC .draw_item
LDA $030F : BEQ .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 LDY.w #$0000
.draw_ocarina_loop .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 INX #2 : INY #2 : CPY #$001C : BCC .draw_ocarina_loop
RTS RTS
} }
DrawBottleNames: DrawBottleNames:
{ {
LDA.l $7EF35C, X : AND.w #$00FF LDA.l $7EF35C, X : AND.w #$00FF
DEC : ASL #5 : TAX DEC : ASL #5 : TAX
LDY.w #$0000 LDY.w #$0000
.draw_bottle_loop .draw_bottle_loop
LDA.w Menu_BottleItems, X : STA.w $1692, Y LDA.w Menu_BottleItems, X : STA.w $1692, Y
INX #2 : INY #2 INX #2 : INY #2
@@ -188,17 +206,30 @@ DrawBottleNames:
RTS RTS
} }
MaybeDrawGoldstarName: DrawGoldstarName:
{ {
REP #$30 REP #$30
LDX.w #$0000 LDX.w #$0000
LDY.w #$0000 LDY.w #$0000
.draw_goldstar_loop .draw_goldstar_loop
LDA.w Menu_GoldstarLabel, X LDA.w Menu_GoldstarLabel, X
STA.w $1692, X : INX #2 : INY #2 : CPY #$001C : BCC .draw_goldstar_loop STA.w $1692, X : INX #2 : INY #2 : CPY #$001C : BCC .draw_goldstar_loop
RTS RTS
} }
DrawMushroomName:
{
REP #$30
LDX.w #$0000
LDY.w #$0000
.draw_mushroom_loop
LDA.w Menu_MushroomLabel, X
STA.w $1692, X : INX #2 : INY #2 : CPY #$001C : BCC .draw_mushroom_loop
RTS
}
; ========================================================= ; =========================================================
DrawLocationName: DrawLocationName:

View File

@@ -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"

View File

@@ -17,19 +17,29 @@ org $068361
JSL HUD_ClockDisplay ; $1CFF30 JSL HUD_ClockDisplay ; $1CFF30
;originally JSL $09B06E, executed every frame ;originally JSL $09B06E, executed every frame
; =========================================================
; org $1CFF30 ; org $1CFF30
org $328000 ; Free space org $328000 ; Free space
HUD_ClockDisplay: HUD_ClockDisplay:
{ {
JSR RunClock JSR RunClock
JSR DrawToHud JSR DrawClockToHud
JSL $09B06E ; Restore Garnish_ExecuteUpperSlots_long JSL $09B06E ; Restore Garnish_ExecuteUpperSlots_long
RTL RTL
} }
DrawToHud: DrawClockToHudLong:
{
JSR DrawClockToHud
RTL
}
DrawClockToHud:
{ {
LDX #$00 LDX #$00
.debut .debut
LDY #$00 : LDA $7EE000,x LDY #$00 : LDA $7EE000,x
@@ -38,66 +48,68 @@ DrawToHud:
SBC #$0A : INY : BRA .debut2 SBC #$0A : INY : BRA .debut2
.draw .draw
ADC #$90 : CPX #$01 : BEQ .minutes_low ADC #$90 : CPX #$01 : BEQ .minutes_low
STA.l !hud_hours_low STA.l !hud_hours_low
LDA #$30 : STA.l !hud_hours_low+1 ; white palette LDA #$30 : STA.l !hud_hours_low+1 ; white palette
BRA .continue_draw ; 04 BRA .continue_draw ; 04
.minutes_low .minutes_low
STA.l !hud_min_low STA.l !hud_min_low
LDA #$30 : STA.l !hud_min_low+1 ; white palette LDA #$30 : STA.l !hud_min_low+1 ; white palette
.continue_draw .continue_draw
TYA TYA
CLC : ADC #$90 : CPX #$01 CLC : ADC #$90 : CPX #$01 : BEQ .minutes_high
BEQ .minutes_high
STA.l !hud_hours_high STA.l !hud_hours_high
LDA #$30 : STA.l !hud_hours_high+1 ; white palette LDA #$30 : STA.l !hud_hours_high+1 ; white palette
BRA .finish_draw ; 04 BRA .finish_draw ; 04
.minutes_high .minutes_high
STA.l !hud_min_high STA.l !hud_min_high
LDA #$30 : STA.l !hud_min_high+1 ; white palette LDA #$30 : STA.l !hud_min_high+1 ; white palette
.finish_draw .finish_draw
INX : CPX #$02 : BMI .debut INX : CPX #$02 : BMI .debut
RTS RTS
} }
;-------------------------------- ; =========================================================
RunClock: RunClock:
{ {
LDA $10 ;checks current event in game LDA $10 ;checks current event in game
CMP #$07 ;dungeon/building? CMP #$07 : BEQ .counter_increasing ;dungeon/building?
BEQ .counter_increasing CMP #$09 : BEQ .overworld ;overworld?
CMP #$09 ;overworld? CMP #$0B : BEQ .overworld ;sub-area ? (under the bridge; zora domain...)
BEQ .overworld CMP #$0E : BEQ .dialog ;dialog box?
CMP #$0B
BEQ .overworld ;sub-area ? (under the bridge; zora domain...)
CMP #$0E ;dialog box?
BEQ .dialog
RTS RTS
.overworld .overworld
LDA $11
CMP #$23 ;hdma transfer? (warping) LDA $11 : CMP #$23 : BNE .mosaic ;hdma transfer? (warping)
BNE .mosaic ; Lol what?
.mosaic .mosaic
CMP #$0D ;mosaic ?
BMI .counter_increasing CMP #$0D : BMI .counter_increasing ;mosaic ?
RTS RTS
.dialog .dialog
LDA $11 ;which kind of dialog? (to prevent the counter from increasing if save menu or item menu openned) LDA $11 ;which kind of dialog? (to prevent the counter from increasing if save menu or item menu openned)
CMP #$02 ;NPC/signs speech CMP #$02 : BEQ .counter_increasing ;NPC/signs speech
BEQ .counter_increasing
RTS RTS
.counter_increasing .counter_increasing
; time speed (1,3,5,7,F,1F,3F,7F,FF) ; time speed (1,3,5,7,F,1F,3F,7F,FF)
; #$3F is almost 1 sec = 1 game minute ; #$3F is almost 1 sec = 1 game minute
LDA $1A : AND #$3F ; 05 LDA $1A : AND #$3F : BEQ .increase_minutes ; 05
BEQ .increase_minutes
.end .end
RTS RTS
.increase_minutes .increase_minutes
@@ -106,18 +118,19 @@ RunClock:
RTS RTS
.increase_hours .increase_hours
LDA #$00 : STA $7EE001 LDA #$00 : STA $7EE001
LDA $7EE000 : INC A : STA $7EE000 LDA $7EE000 : INC A : STA $7EE000
CMP #$18 ; hours = #24 ? CMP #$18 : BPL .reset_hours ; hours = #24 ?
BPL .reset_hours
;check indoors/outdoors ;check indoors/outdoors
LDA $1B : BEQ .outdoors0 LDA $1B : BEQ .outdoors0
RTS RTS
.outdoors0 .outdoors0
JSL rom_to_buff ;update buffer palette JSL rom_to_buff ;update buffer palette
JSL buff_to_eff ;update effective palette JSL buff_to_eff ;update effective palette
;rain layer ? ;rain layer ?
LDA $8C : CMP #$9F : BEQ .skip_bg_updt0 LDA $8C : CMP #$9F : BEQ .skip_bg_updt0
LDA $8C : CMP #$9E : BEQ .skip_bg_updt0 ; canopy layer ? LDA $8C : CMP #$9E : BEQ .skip_bg_updt0 ; canopy layer ?
@@ -127,33 +140,38 @@ RunClock:
.skip_bg_updt0 ;prevent the sub layer from disappearing ($1D zeroed) .skip_bg_updt0 ;prevent the sub layer from disappearing ($1D zeroed)
JSL $0BFE72 JSL $0BFE72
.inc_hours_end .inc_hours_end
RTS RTS
.reset_hours .reset_hours
LDA #$00 : STA $7EE000 LDA #$00 : STA $7EE000
;check indoors/outdoors ;check indoors/outdoors
LDA $1B : BEQ .outdoors1 LDA $1B : BEQ .outdoors1
RTS RTS
.outdoors1 .outdoors1
JSL rom_to_buff JSL rom_to_buff
JSL buff_to_eff JSL buff_to_eff
LDA $8C : CMP #$9F ;rain layer ?
BEQ .skip_bg_updt1 LDA $8C : CMP #$9F : BEQ .skip_bg_updt1 ;rain layer ?
LDA $8C : CMP #$9E : BEQ .skip_bg_updt1 ; canopy layer ? LDA $8C : CMP #$9E : BEQ .skip_bg_updt1 ; canopy layer ?
JSL $0BFE70 ;update background color JSL $0BFE70 ;update background color
BRA .reset_end BRA .reset_end
.skip_bg_updt1 ;prevent the sub layer from disappearing ($1D zeroed) .skip_bg_updt1 ;prevent the sub layer from disappearing ($1D zeroed)
JSL $0BFE72 JSL $0BFE72
.reset_end .reset_end
RTS RTS
} }
;----------------------------------------------- ; =========================================================
;----[ Day / Night system * palette effect ]---- ;----[ Day / Night system * palette effect ]----
;----------------------------------------------- ; =========================================================
!blue_value = $7EE010 !blue_value = $7EE010
!green_value = $7EE012 !green_value = $7EE012
@@ -196,26 +214,29 @@ LoadDayNightPaletteEffect:
RTL RTL
.title_check .title_check
LDA $10 : AND #$00FF
CMP #$0002 ; title or file select screen ? ; title or file select screen ?
BPL .outin_check LDA $10 : AND #$00FF : CMP #$0002 : BPL .outin_check
LDA.l !pal_color : STA $7EC300,X LDA.l !pal_color : STA $7EC300,X
RTL RTL
.outin_check .outin_check
LDA $1B : AND #$00FF : BEQ .outdoors2 LDA $1B : AND #$00FF : BEQ .outdoors2
LDA.l !pal_color LDA.l !pal_color
STA $7EC300,X STA $7EC300,X
RTL RTL
.outdoors2 .outdoors2
PHX PHX
JSL ColorSubEffect JSL ColorSubEffect
PLX PLX
STA.l $7EC300,X STA.l $7EC300,X
RTL RTL
} }
;--------------------------------
; =========================================================
ColorSubEffect: ColorSubEffect:
{ {
@@ -231,9 +252,7 @@ ColorSubEffect:
; substract amount to blue field based on a table ; substract amount to blue field based on a table
SEC : SBC.l blue_table, X : STA !temp_value SEC : SBC.l blue_table, X : STA !temp_value
AND #$7C00 ; mask out everything except the blue bits AND #$7C00 ; mask out everything except the blue bits
CMP !temp_value ; overflow ? CMP !temp_value : BEQ .no_blue_sign_change; overflow ?
BEQ .no_blue_sign_change
.blue_sign_change .blue_sign_change
LDA #$0400 ; LDA smallest blue value LDA #$0400 ; LDA smallest blue value
@@ -245,9 +264,7 @@ do_green:
SEC : SBC.l green_table,x ; substract amount to blue field based on a table SEC : SBC.l green_table,x ; substract amount to blue field based on a table
STA.l !temp_value STA.l !temp_value
; mask out everything except the green bits ; mask out everything except the green bits
AND #$03E0 : CMP !temp_value ; overflow ? AND #$03E0 : CMP !temp_value : BEQ .no_green_sign_change ; overflow ?
BEQ .no_green_sign_change
.green_sign_change .green_sign_change
LDA #$0020 ; LDA smallest green value LDA #$0020 ; LDA smallest green value
@@ -259,9 +276,7 @@ do_green:
SEC : SBC.l red_table,x ; substract amount to red field based on a table SEC : SBC.l red_table,x ; substract amount to red field based on a table
STA.l !temp_value STA.l !temp_value
AND #$001F ; mask out everything except the red bits AND #$001F ; mask out everything except the red bits
CMP !temp_value ; overflow ? CMP !temp_value : BEQ .no_red_sign_change ; overflow ?
BEQ .no_red_sign_change
.red_sign_change .red_sign_change
LDA #$0001 ; LDA smallest red value LDA #$0001 ; LDA smallest red value
@@ -275,6 +290,8 @@ do_green:
RTL RTL
} }
; =========================================================
; color_sub_tables : 24 * 2 bytes each = 48 bytes (2 bytes = 1 color sub for each hour) ; color_sub_tables : 24 * 2 bytes each = 48 bytes (2 bytes = 1 color sub for each hour)
blue_table: blue_table:
@@ -325,13 +342,10 @@ SubAreasFix:
rtl rtl
} }
GlovesFix: GlovesFix:
{ {
STA.l !pal_color STA.l !pal_color
LDA $1B LDA $1B : AND #$00FF : BEQ .outdoors3
AND #$00FF
BEQ .outdoors3
LDA.l !pal_color LDA.l !pal_color
STA $7EC4FA STA $7EC4FA
RTL RTL
@@ -346,18 +360,14 @@ GlovesFix:
CheckIfNight: CheckIfNight:
{ {
LDA $7EE000 : CMP.b #$06 LDA $7EE000 : CMP.b #$06 : BCC .night_time
BCC .night_time
.day_time .day_time
LDA.l $7EF3C5 LDA.l $7EF3C5
RTL RTL
.night_time .night_time
LDA $7EE000 : CMP.b #$14 LDA $7EE000 : CMP.b #$14 : BCS .day_time
BCS .day_time
LDA.l $7EF3C5 LDA.l $7EF3C5
CLC CLC
ADC #$01 ADC #$01
@@ -402,7 +412,7 @@ org $2885F9
org $0ED601 org $0ED601
JSL SubAreasFix JSL SubAreasFix
;-------------------------------- ; =========================================================
; Gloves color loading routine ; Gloves color loading routine
;$1B/EE1B C2 30 REP #$30 ;$1B/EE1B C2 30 REP #$30
@@ -421,3 +431,5 @@ org $0ED601
org $1BEE2D org $1BEE2D
JSL GlovesFix JSL GlovesFix
; =========================================================

View File

@@ -1,4 +1,4 @@
; ============================== ; =========================================================
; WRAM in Use ; WRAM in Use
org $008000 org $008000
base $7E0730 ; MAP16OVERFLOW free ram region base $7E0730 ; MAP16OVERFLOW free ram region
@@ -24,7 +24,7 @@ SomariaOrByrna: skip 1
base off base off
; ============================== ; =========================================================
; SRAM in Use ; SRAM in Use
FishingRod = $7EF38A FishingRod = $7EF38A