Torch keys counted like chest

Moved the total key counter to a count down on the left.
Added the BK indicator
Attempt to fix dungeon counters and fish error in Mystery.py
Removed double rom patch
AT map added.
5 chests min for all dungeons
This commit is contained in:
aerinon
2020-04-07 16:50:02 -06:00
parent bb402ff7f2
commit 114ed784f1
11 changed files with 63 additions and 38 deletions

View File

@@ -552,10 +552,8 @@ TotalKeys: ;27f01c
db $04, $04, $02, $04, $04, $06, $06, $06, $05, $06, $01, $03, $06, $08
ChestKeys: ;27f02a
db $01, $01, $00, $01, $02, $01, $06, $03, $03, $02, $01, $01, $04, $04
OtherKeys: ;27f038
db $03, $03, $02, $03, $02, $05, $00, $03, $02, $04, $00, $02, $02, $04
BigKeyStatus: ;27f046 (status 2 indicate BnC guard)
db $02, $02, $01, $01, $00, $01, $01, $01, $01, $01, $01, $01, $01, $01
BigKeyStatus: ;27f038 (status 2 indicate BnC guard)
dw $0002, $0002, $0001, $0001, $0000, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001
DungeonReminderTable: ;27f054
dw $2D50, $2D50, $2D51, $2D52, $2D54, $2D56, $2D55, $2D5A, $2D57, $2D59, $2D53, $2D58, $2D5B, $2D5C
;27f070

View File

@@ -96,6 +96,9 @@ org $098638 ; rando's hooks.asm line 2192
jsl CountChestKeys
org $06D192 ; rando's hooks.asm line 457
jsl CountAbsorbedKeys
; rando's hooks.asm line 1020
org $05FC7E ; <- 2FC7E - sprite_dash_item.asm : 118 (LDA $7EF36F : INC A : STA $7EF36F)
jsl CountBonkItem
; These two, if enabled together, have implications for vanilla BK doors in IP/Hera/Mire
; IPBJ is common enough to consider not doing this. Mire is not a concern for vanilla - maybe glitched modes

View File

@@ -15,17 +15,29 @@ HudAdditions:
lda $1a : and #$0010 : beq +
lda #$345e : sta $7ec790 : bra .next
+ lda #$207f : sta $7ec790
.next lda DRMode : and #$0002 : beq .restore
.next lda DRMode : and #$0002 : bne + : plb : rts : +
lda DungeonReminderTable, x : sta $7ec702
lda $7ef368 : and.l $0098c0, x : beq .restore
txa : lsr : tax
lda $7ef4b0, x : jsr ConvertToDisplay : sta $7ec7a2
lda #$2830 : sta $7ec7a4
lda TotalKeys, x : jsr ConvertToDisplay : sta $7ec7a6
lda #$2811 : sta $7ec740
lda $7ef366 : and.l $0098c0, x : bne .check
lda BigKeyStatus, x : and #$00ff : bne + ;todo: "and" is redundant or change table to one byte
lda #$2574 : bra ++
+ cmp #$0002 : bne +
lda #$2420 : bra ++
+ lda #$207f : bra ++
.check lda #$2826
++ sta $7ec742
+ txa : lsr : tax
lda $7ef4e0, x : jsr ConvertToDisplay : sta $7ec7a2
lda #$2830 : sta $7ec7a4
lda ChestKeys, x : jsr ConvertToDisplay : sta $7ec7a6
lda #$2871 : sta $7ec780
lda TotalKeys, x
sep #$20 : !sub $7ef4b0, x : rep #$20
jsr ConvertToDisplay : sta $7ec782
lda $7ef4e0, x : jsr ConvertToDisplay : sta $7ec7e2
lda #$2830 : sta $7ec7e4
lda ChestKeys, x : jsr ConvertToDisplay : sta $7ec7e6
.restore
plb : rts
}
@@ -40,6 +52,10 @@ ConvertToDisplay:
CountChestKeys:
jsl ItemDowngradeFix
jsr CountChest
rtl
CountChest:
cpy #$24 : beq +
cpy #$a0 : !blt .end
cpy #$ae : !bge .end
@@ -53,11 +69,25 @@ CountChestKeys:
lda $7ef4b0, x : inc : sta $7ef4b0, x
lda $7ef4e0, x : inc : sta $7ef4e0, x
.restore plx : pla
.end rtl
.end rts
CountAbsorbedKeys:
jsl IncrementSmallKeysNoPrimary : phx
lda $040c : cmp #$ff : beq +
lsr : tax
lda $7ef4b0, x : inc : sta $7ef4b0, x
+ plx : rtl
+ plx : rtl
CountBonkItem:
jsl GiveBonkItem
lda $a0 ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte
cmp #115 : bne + ; Desert Bonk Key
lda.l BonkKey_Desert
bra ++
+ : cmp #140 : bne + ; GTower Bonk Key
lda.l BonkKey_GTower
bra ++
+ lda.b #$24 ; default to small key
++
phy : tay : jsr CountChest : ply
rtl