let's dev sep 15th 2017
added logic to synchronize dungeon key stats moved keysanity table init to menu init so it comes in pre-rendered
This commit is contained in:
@@ -26,7 +26,7 @@ org $3FFFFF ; <- 1FFFFF
|
|||||||
db #$00 ; expand file to 2mb
|
db #$00 ; expand file to 2mb
|
||||||
|
|
||||||
org $1FFFF8 ; <- FFFF8 timestamp rom
|
org $1FFFF8 ; <- FFFF8 timestamp rom
|
||||||
db #$20, #$17, #$09, #$10 ; year/month/day
|
db #$20, #$17, #$09, #$15 ; year/month/day
|
||||||
|
|
||||||
;================================================================================
|
;================================================================================
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ endmacro
|
|||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Clock_Test:
|
Clock_Test:
|
||||||
LDA $FFFFFF
|
|
||||||
JSL.l Clock_Init
|
JSL.l Clock_Init
|
||||||
JSL.l Clock_IsSupported
|
JSL.l Clock_IsSupported
|
||||||
RTL
|
RTL
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ RTL
|
|||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
DarkWorldFlagSet:
|
DarkWorldFlagSet:
|
||||||
PHA
|
PHA
|
||||||
STA $FFFFFF
|
|
||||||
LDA !FORCE_PYRAMID : AND.b #$08 : BNE .pyramid
|
LDA !FORCE_PYRAMID : AND.b #$08 : BNE .pyramid
|
||||||
|
|
||||||
LDA Bugfix_PreAgaDWDungeonDeathToFakeDW : BEQ +
|
LDA Bugfix_PreAgaDWDungeonDeathToFakeDW : BEQ +
|
||||||
@@ -46,7 +45,7 @@ RTL
|
|||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
SetDeathWorldChecked:
|
SetDeathWorldChecked:
|
||||||
PHA : STA $FFFFFF
|
PHA
|
||||||
LDA $1B : BEQ + ; skip this for indoors
|
LDA $1B : BEQ + ; skip this for indoors
|
||||||
LDA $040C : CMP #$FF : BNE .done ; unless it's a cave
|
LDA $040C : CMP #$FF : BNE .done ; unless it's a cave
|
||||||
+
|
+
|
||||||
|
|||||||
17
hooks.asm
17
hooks.asm
@@ -92,7 +92,8 @@ NOP
|
|||||||
;org $05FC7E ; <- 2FC7E - sprite_dash_item.asm : 118 (LDA $7EF36F : INC A : STA $7EF36F)
|
;org $05FC7E ; <- 2FC7E - sprite_dash_item.asm : 118 (LDA $7EF36F : INC A : STA $7EF36F)
|
||||||
;JSL.l IncrementSmallKeys
|
;JSL.l IncrementSmallKeys
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
org $06D18D ; <- 3518D - sprite_absorbable.asm : 274 (LDA $7EF36F : INC A : STA $7EF36F)
|
;org $06D18D ; <- 3518D - sprite_absorbable.asm : 274 (LDA $7EF36F : INC A : STA $7EF36F)
|
||||||
|
org $06D192 ; <- 35192 - sprite_absorbable.asm : 274 (STA $7EF36F)
|
||||||
JSL.l IncrementSmallKeys
|
JSL.l IncrementSmallKeys
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
org $00F945 ; <- 7945 - Bank00.asm : 8557 (JSL SavePalaceDeaths)
|
org $00F945 ; <- 7945 - Bank00.asm : 8557 (JSL SavePalaceDeaths)
|
||||||
@@ -886,7 +887,7 @@ org $0DFC37 ; <- 6FC37 - headsup_display.asm : 828 (LDA.w #$28F7)
|
|||||||
JSL.l DrawMagicHeader
|
JSL.l DrawMagicHeader
|
||||||
NOP #17
|
NOP #17
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
org $0DFB29 ; <- - headsup_display.asm : 688 (LDA.b #$86 : STA $7EC71E)
|
org $0DFB29 ; <- headsup_display.asm : 688 (LDA.b #$86 : STA $7EC71E)
|
||||||
;LDA.b #$86 : STA $7EC720 ; nudge silver arrow right - remember to update this in newit
|
;LDA.b #$86 : STA $7EC720 ; nudge silver arrow right - remember to update this in newit
|
||||||
;LDA.b #$24 : STA $7EC721
|
;LDA.b #$24 : STA $7EC721
|
||||||
;LDA.b #$87 : STA $7EC722
|
;LDA.b #$87 : STA $7EC722
|
||||||
@@ -895,15 +896,21 @@ JSL.l DrawHUDSilverArrows : BRA +
|
|||||||
NOP #18
|
NOP #18
|
||||||
+
|
+
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
org $01CF67 ; <- CF67 - Bank01.asm : 11625 (STA $7EF36F)
|
||||||
|
JSL.l DecrementSmallKeys
|
||||||
|
;--------------------------------------------------------------------------------
|
||||||
|
org $0DED04 ; <- 6ED04 - equipment.asm : 1963 (REP #$30)
|
||||||
|
JSL.l DrawHUDDungeonItems
|
||||||
|
;--------------------------------------------------------------------------------
|
||||||
; Insert our version of the hud tilemap
|
; Insert our version of the hud tilemap
|
||||||
org $0DFA96 ; <- 6FA96 - headsup_display.asm : 626 (LDX.w #.hud_tilemap)
|
org $0DFA96 ; <- 6FA96 - headsup_display.asm : 626 (LDX.w #.hud_tilemap)
|
||||||
LDX.w #HUD_TileMap
|
LDX.w #HUD_TileMap
|
||||||
org $0DFA9C ; <- 6FA9C - headsup_display.asm : 629 (MVN $0D, $7E ; $Transfer 0x014A bytes from $6FE77 -> $7EC700)
|
org $0DFA9C ; <- 6FA9C - headsup_display.asm : 629 (MVN $0D, $7E ; $Transfer 0x014A bytes from $6FE77 -> $7EC700)
|
||||||
MVN $207E
|
MVN $207E
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
org $0DE48E ; <- 6E48E - equipment.asm : 1233 (LDA.w #$11CE : STA $00) - HOOK HERE TO DRAW ON THE ITEM SCREEN
|
;org $0DE48E ; <- 6E48E - equipment.asm : 1233 (LDA.w #$11CE : STA $00) - HOOK HERE TO DRAW ON THE ITEM SCREEN
|
||||||
JSL.l DrawHUDDungeonItems
|
;JSL.l DrawHUDDungeonItems
|
||||||
NOP
|
;NOP
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
org $0DFB1F ; 6FB1F - headsup_display.asm : 681 (LDA $7EF340 : BEQ .hastNoBow)
|
org $0DFB1F ; 6FB1F - headsup_display.asm : 681 (LDA $7EF340 : BEQ .hastNoBow)
|
||||||
JSL.l CheckHUDSilverArrows
|
JSL.l CheckHUDSilverArrows
|
||||||
|
|||||||
@@ -140,11 +140,46 @@ ShowDungeonItems:
|
|||||||
LDA $040C : AND.w #$00FF : CMP.w #$00FF ; original logic
|
LDA $040C : AND.w #$00FF : CMP.w #$00FF ; original logic
|
||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
UpdateKeys:
|
||||||
|
PHX : PHP
|
||||||
|
SEP #$30 ; set 8-bit accumulator & index registers
|
||||||
|
LDA $040C : CMP.b $1F : !BLT .skip
|
||||||
|
|
||||||
|
LSR : TAX ; get dungeon index and store to X
|
||||||
|
|
||||||
|
LDA $7EF36F ; load current key count
|
||||||
|
STA $7EF37C, X ; save to main counts
|
||||||
|
|
||||||
|
CPX.b #$00 : BNE +
|
||||||
|
STA $7EF37D ; copy HC to sewers
|
||||||
|
+ : CPX.b #$01 : BNE +
|
||||||
|
STA $7EF37C ; copy sewers to HC
|
||||||
|
+
|
||||||
|
.skip
|
||||||
|
PLP : PLX
|
||||||
|
JSL.l PostItemGet
|
||||||
|
RTL
|
||||||
|
;$37C = Sewer Passage
|
||||||
|
;$37D = Hyrule Castle
|
||||||
|
;$37E = Eastern Palace
|
||||||
|
;$37F = Desert Palace
|
||||||
|
;$380 = Hyrule Castle 2
|
||||||
|
;$381 = Swamp Palace
|
||||||
|
;$382 = Dark Palace
|
||||||
|
;$383 = Misery Mire
|
||||||
|
;$384 = Skull Woods
|
||||||
|
;$385 = Ice Palace
|
||||||
|
;$386 = Tower of Hera
|
||||||
|
;$387 = Gargoyle's Domain
|
||||||
|
;$388 = Turtle Rock
|
||||||
|
;$389 = Ganon's Tower
|
||||||
|
;--------------------------------------------------------------------------------
|
||||||
DrawHUDDungeonItems:
|
DrawHUDDungeonItems:
|
||||||
LDA HUDDundeonItems : BNE +
|
LDA.l HUDDungeonItems : BNE + : RTL : +
|
||||||
LDA.w #$11CE : STA $00 ; thing we wrote over
|
|
||||||
RTL
|
PHP
|
||||||
+
|
REP #$30 ; set 16-bit accumulator & index registers
|
||||||
|
|
||||||
; dungeon names
|
; dungeon names
|
||||||
LDA.w #$2D50 : STA $1646 ; sewers
|
LDA.w #$2D50 : STA $1646 ; sewers
|
||||||
LDA.w #$2D54 : STA $1648 ; Agahnims Tower
|
LDA.w #$2D54 : STA $1648 ; Agahnims Tower
|
||||||
@@ -170,7 +205,7 @@ DrawHUDDungeonItems:
|
|||||||
INX #2 : CPX.w #$0020 : BCC -
|
INX #2 : CPX.w #$0020 : BCC -
|
||||||
|
|
||||||
LDA !HUD_FLAG : AND.w #$0020 : BEQ + : BRL +++ : +
|
LDA !HUD_FLAG : AND.w #$0020 : BEQ + : BRL +++ : +
|
||||||
LDA HUDDundeonItems : AND.w #$0001 : BNE + : BRL ++ : +
|
LDA HUDDungeonItems : AND.w #$0001 : BNE + : BRL ++ : +
|
||||||
LDA.w #$2810 : STA $1684 ; small keys icon
|
LDA.w #$2810 : STA $1684 ; small keys icon
|
||||||
SEP #$20 ; set 8-bit accumulator
|
SEP #$20 ; set 8-bit accumulator
|
||||||
; Small Keys
|
; Small Keys
|
||||||
@@ -195,7 +230,7 @@ DrawHUDDungeonItems:
|
|||||||
++
|
++
|
||||||
|
|
||||||
; Big Keys
|
; Big Keys
|
||||||
LDA HUDDundeonItems : AND.w #$0002 : BNE + : BRL ++ : +
|
LDA HUDDungeonItems : AND.w #$0002 : BNE + : BRL ++ : +
|
||||||
LDA.w #$2811 : STA $16C4 ; big key icon
|
LDA.w #$2811 : STA $16C4 ; big key icon
|
||||||
LDA $7EF367 : AND.w #$0080 : BEQ + ; sewers
|
LDA $7EF367 : AND.w #$0080 : BEQ + ; sewers
|
||||||
LDA.w #$2826 : STA $16C6
|
LDA.w #$2826 : STA $16C6
|
||||||
@@ -242,7 +277,7 @@ DrawHUDDungeonItems:
|
|||||||
+++
|
+++
|
||||||
LDA !HUD_FLAG : AND.w #$0020 : BNE + : BRL +++ : +
|
LDA !HUD_FLAG : AND.w #$0020 : BNE + : BRL +++ : +
|
||||||
; Maps
|
; Maps
|
||||||
LDA HUDDundeonItems : AND.w #$0004 : BNE + : BRL ++ : +
|
LDA HUDDungeonItems : AND.w #$0004 : BNE + : BRL ++ : +
|
||||||
LDA.w #$2821 : STA $1684 ; map icon
|
LDA.w #$2821 : STA $1684 ; map icon
|
||||||
LDA $7EF369 : AND.w #$0080 : BEQ + ; sewers
|
LDA $7EF369 : AND.w #$0080 : BEQ + ; sewers
|
||||||
LDA.w #$2826 : STA $1686
|
LDA.w #$2826 : STA $1686
|
||||||
@@ -286,7 +321,7 @@ DrawHUDDungeonItems:
|
|||||||
++
|
++
|
||||||
|
|
||||||
; Compasses
|
; Compasses
|
||||||
LDA HUDDundeonItems : AND.w #$0008 : BNE + : BRL ++ : +
|
LDA HUDDungeonItems : AND.w #$0008 : BNE + : BRL ++ : +
|
||||||
LDA.w #$2C20 : STA $16C4 ; compass icon
|
LDA.w #$2C20 : STA $16C4 ; compass icon
|
||||||
LDA $7EF365 : AND.w #$0080 : BEQ + ; sewers
|
LDA $7EF365 : AND.w #$0080 : BEQ + ; sewers
|
||||||
LDA.w #$2C26 : STA $16C6
|
LDA.w #$2C26 : STA $16C6
|
||||||
@@ -327,11 +362,8 @@ DrawHUDDungeonItems:
|
|||||||
LDA $7EF364 : AND.w #$0004 : BEQ + ; Ganon's Tower
|
LDA $7EF364 : AND.w #$0004 : BEQ + ; Ganon's Tower
|
||||||
LDA.w #$2C26 : STA $16E4
|
LDA.w #$2C26 : STA $16E4
|
||||||
+
|
+
|
||||||
++
|
++ : +++
|
||||||
|
PLP
|
||||||
+++
|
|
||||||
|
|
||||||
LDA.w #$11CE : STA $00 ; thing we wrote over
|
|
||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
;================================================================================
|
;================================================================================
|
||||||
|
|||||||
@@ -194,10 +194,16 @@ IncrementFlute:
|
|||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
IncrementSmallKeys:
|
IncrementSmallKeys:
|
||||||
|
STA $7EF36F ; thing we wrote over, write small key count
|
||||||
LDA !LOCK_STATS : BNE +
|
LDA !LOCK_STATS : BNE +
|
||||||
JSL AddInventory_incrementKeyLong
|
JSL AddInventory_incrementKeyLong
|
||||||
+
|
+
|
||||||
LDA $7EF36F ; thing we wrote over, read small key count
|
JSL.l UpdateKeys
|
||||||
|
RTL
|
||||||
|
;--------------------------------------------------------------------------------
|
||||||
|
DecrementSmallKeys:
|
||||||
|
STA $7EF36F ; thing we wrote over, write small key count
|
||||||
|
JSL.l UpdateKeys
|
||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
IncrementAgahnim2Sword:
|
IncrementAgahnim2Sword:
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ AllowHammerTablets:
|
|||||||
db #$00 ; #$00 = Off (default) - #$01 = On
|
db #$00 ; #$00 = Off (default) - #$01 = On
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
org $308045 ; PC 0x180045
|
org $308045 ; PC 0x180045
|
||||||
HUDDundeonItems:
|
HUDDungeonItems:
|
||||||
db #$FF ; display ----dcba a: Small Keys, b: Big Key, c: Map, d: Compass
|
db #$FF ; display ----dcba a: Small Keys, b: Big Key, c: Map, d: Compass
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
org $308080 ; PC 0x180080
|
org $308080 ; PC 0x180080
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ macro Blt32(value1,value2)
|
|||||||
endmacro
|
endmacro
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
CalculateTimer:
|
CalculateTimer:
|
||||||
LDA $FFFFFF
|
|
||||||
LDA.w #$0000
|
LDA.w #$0000
|
||||||
STA.l !CLOCK_HOURS ; clear digit storage
|
STA.l !CLOCK_HOURS ; clear digit storage
|
||||||
STA.l !CLOCK_HOURS+2
|
STA.l !CLOCK_HOURS+2
|
||||||
|
|||||||
Reference in New Issue
Block a user