Dungeon reminder added to hud for Crossed dungeons

Blinking red square added to hud and it indicates a boss room is close by. Only appears if you have the compass. (Basic & Crossed)
Key counters added to hud if you have found the map. (Crossed only)
This commit is contained in:
aerinon
2020-04-03 15:45:55 -06:00
parent e30f66742b
commit bb402ff7f2
9 changed files with 130 additions and 5 deletions

View File

@@ -21,6 +21,7 @@ incsrc keydoors.asm
incsrc overrides.asm
;incsrc edges.asm
;incsrc math.asm
incsrc hudadditions.asm
warnpc $279000
; Data Section

View File

@@ -540,4 +540,23 @@ db $a0,$a0,$50 ; DP Main Lobby
db $58,$50,$30, $98,$50,$70 ; TT Ambush
db $58,$50,$30 ; TT Nook
MultDivInfo: ; (1placeholder, 1, 2, 3, 4, 5, 6, 10, 20)
db $01, $01, $02, $03, $04, $05, $06, $0a, $14
db $01, $01, $02, $03, $04, $05, $06, $0a, $14
; dungeon tables
; HC HC EP DP AT SP PD MM SW IP TH TT TR GT
org $27f000
CompassBossIndicator:
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
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
DungeonReminderTable: ;27f054
dw $2D50, $2D50, $2D51, $2D52, $2D54, $2D56, $2D55, $2D5A, $2D57, $2D59, $2D53, $2D58, $2D5B, $2D5C
;27f070

View File

@@ -89,6 +89,13 @@ jsl FixShopCode
org $1ddeea ; <- Bank1D.asm : 286 (JSL Sprite_LoadProperties)
jsl VitreousKeyReset
; also rando's hooks.asm line 1360
org $a0ee11 ; <- 6FC4C - headsup_display.asm : 836 (LDA $7EF36E : AND.w #$00FF : ADD.w #$0007 : AND.w #$FFF8 : TAX)
jsl DrHudOverride
org $098638 ; rando's hooks.asm line 2192
jsl CountChestKeys
org $06D192 ; rando's hooks.asm line 457
jsl CountAbsorbedKeys
; 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

63
asm/hudadditions.asm Normal file
View File

@@ -0,0 +1,63 @@
DrHudOverride:
{
jsl.l NewDrawHud
jsr HudAdditions
rtl
}
HudAdditions:
{
ldx $040c : cpx #$ff : bne + : rts : +
lda DRMode : bne + : rts : +
phb : phk : plb
lda $7ef364 : and.l $0098c0, x : beq +
lda CompassBossIndicator, x : and #$00ff : cmp $a0 : bne +
lda $1a : and #$0010 : beq +
lda #$345e : sta $7ec790 : bra .next
+ lda #$207f : sta $7ec790
.next lda DRMode : and #$0002 : beq .restore
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 $7ef4e0, x : jsr ConvertToDisplay : sta $7ec7e2
lda #$2830 : sta $7ec7e4
lda ChestKeys, x : jsr ConvertToDisplay : sta $7ec7e6
.restore
plb : rts
}
ConvertToDisplay:
and #$00ff : cmp #$000a : !blt +
!add #$2553 : rts
+ !add #$2490 : rts
; and $18c0, x
;207f is blank
CountChestKeys:
jsl ItemDowngradeFix
cpy #$24 : beq +
cpy #$a0 : !blt .end
cpy #$ae : !bge .end
pha : phx
tya : and #$0f : bne ++
inc a
++ tax : bra .count
+ pha : phx
lda $040c : lsr : tax
.count
lda $7ef4b0, x : inc : sta $7ef4b0, x
lda $7ef4e0, x : inc : sta $7ef4e0, x
.restore plx : pla
.end rtl
CountAbsorbedKeys:
jsl IncrementSmallKeysNoPrimary : phx
lda $040c : cmp #$ff : beq +
lsr : tax
lda $7ef4b0, x : inc : sta $7ef4b0, x
+ plx : rtl