Bug fix for attic blind

Bug fix for simple dungeon shuffles making HC your DW access with door shuffle on
Bug fix for accessibility: none
Moved bk/key info to keysanity screen
Added chest total to keysanity screen
This commit is contained in:
aerinon
2020-07-13 17:11:36 -06:00
parent 6574b5708a
commit b4fd8f6bdc
10 changed files with 122 additions and 24 deletions

View File

@@ -561,10 +561,14 @@ 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
TotalLocationsLow: ;27f070
db $08, $08, $06, $06, $02, $00, $04, $08, $08, $08, $06, $08, $02, $07
TotalLocationsHigh: ;27f07e
db $00, $00, $00, $00, $00, $01, $01, $00, $00, $00, $00, $00, $01, $02
;27F08C
; Vert 0,6,0 Horz 2,0,8
org $27f080
org $27f090
CoordIndex: ; Horizontal 1st
db 2, 0 ; Coordinate Index $20-$23
OppCoordIndex:
@@ -584,7 +588,7 @@ dw $007f, $0077 ; Left/Top camera bounds when at edge or layout frozen
dw $0007, $000b ; Left/Top camera bounds when not frozen + appropriate low byte $22/$20 (preadj. by #$78/#$6c)
dw $00ff, $010b ; Right/Bot camera bounds when not frozen + appropriate low byte $20/$22
dw $017f, $0187 ; Right/Bot camera bound when at edge or layout frozen
;27f09e next free byte
;27f0ae next free byte
org $27f100
TilesetTable:

View File

@@ -120,10 +120,15 @@ jsl GuruguruFix : bra .next
nop #3
.next
org $028fc9
nop #2 : jsl BlindAtticFix
; also rando's hooks.asm line 1360
; 106e4e -> goes to a0ee4e
; 106e4e -> goes to a0ee4e
org $a0ee84 ; <- 6FC4C - headsup_display.asm : 836 (LDA $7EF36E : AND.w #$00FF : ADD.w #$0007 : AND.w #$FFF8 : TAX)
jsl DrHudOverride
org $0ded04 ; <- rando's hooks.asm line 2192 - 6ED04 - equipment.asm : 1963 (REP #$30)
jsl DrHudDungeonItemsAdditions
org $098638 ; rando's hooks.asm line 2192
jsl CountChestKeys
org $06D192 ; rando's hooks.asm line 457

View File

@@ -36,35 +36,92 @@ HudAdditions:
+ lda.w DRFlags : and #$0004 : beq .restore
lda $7ef368 : and.l $0098c0, x : beq .restore
lda #$2811 : sta $7ec740
lda $7ef366 : and.l $0098c0, x : bne .check
lda.w BigKeyStatus, x : bne + ; change this, if bk status changes to one byte
lda #$2574 : bra ++
+ cmp #$0002 : bne +
lda #$2420 : bra ++
+ lda #$207f : bra ++
.check lda #$2826
++ sta $7ec742
; lda #$2811 : sta $7ec740
; lda $7ef366 : and.l $0098c0, x : bne .check
; lda.w BigKeyStatus, x : bne + ; change this, if bk status changes 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.w ChestKeys, x : jsr ConvertToDisplay : sta $7ec7a6
lda #$2871 : sta $7ec780
lda.w TotalKeys, x
sep #$20 : !sub $7ef4b0, x : rep #$20
jsr ConvertToDisplay : sta $7ec782
; lda #$2871 : sta $7ec780
; lda.w TotalKeys, x
; sep #$20 : !sub $7ef4b0, x : rep #$20 ; todo 4b0 no longer in use
; jsr ConvertToDisplay : sta $7ec782
.restore
plb : rts
}
HudOffsets:
; none hc east desert aga swamp pod mire skull ice hera tt tr gt
dw $fffe, $0000, $0006, $0008, $0002, $0010, $000e, $0018, $0012, $0016, $000a, $0014, $001a, $001e
DrHudDungeonItemsAdditions:
{
jsl DrawHUDDungeonItems
lda.l HUDDungeonItems : and #$ff : bne + : rtl : +
lda.l DRMode : cmp #$02 : beq + : rtl : +
phx : phy : php
rep #$30
lda !HUD_FLAG : and.w #$0020 : beq + : bra ++ : +
lda HUDDungeonItems : and.w #$0003 : bne + : bra ++ : +
lda.w #$2810 : sta $1684 ; small keys icon
lda.w #$2811 : sta $16c4 ; big key icon
lda.w #$2810 : sta $1704 ; small keys icon
ldx #$0002
- lda $7ef364 : and.l $0098c0, x : beq + ; must have compass
lda.l HudOffsets, x : tay
jsr BkStatus : sta $16C6, y ; big key status
lda.l ChestKeys, x : jsr ConvertToDisplay2 : sta $1706, y ; small key totals
+ inx #2 : cpx #$001b : bcc -
++
lda !HUD_FLAG : and.w #$0020 : bne + : bra ++ : +
lda HUDDungeonItems : and.w #$000c : bne + : bra ++ : +
lda.w #$24f5 : sta $1704 ; blank
ldx #$0002
- lda $7ef364 : and.l $0098c0, x : beq + ; must have compass
lda.l HudOffsets, x : tay
phx ; total chest counts
txa : lsr : tax
lda.l TotalLocationsLow, x : jsr ConvertToDisplay2 : sta $1706, y
lda.l TotalLocationsHigh, x : jsr ConvertToDisplay2 : sta $16c6, y
plx
+
+ inx #2 : cpx #$001b : bcc -
++
plp : ply : plx : rtl
}
BkStatus:
lda $7ef366 : and.l $0098c0, x : bne +++ ; has the bk already
lda.l BigKeyStatus, x : bne ++
lda #$2574 : rts ; X for no BK
++ cmp #$0002 : bne +
lda #$2420 : rts ; symbol for BnC
+ lda #$24f5 : rts ; black otherwise
+++ lda #$2826 : rts ; check mark
ConvertToDisplay:
and #$00ff : cmp #$000a : !blt +
and.w #$00ff : cmp #$000a : !blt +
!add #$2553 : rts
+ !add #$2490 : rts
ConvertToDisplay2:
and.w #$00ff : beq ++
cmp #$000a : !blt +
!add #$2553 : rts
+ !add #$2816 : rts
++ lda #$3020 : rts
CountChestKeys:
jsl ItemDowngradeFix

View File

@@ -73,4 +73,10 @@ GuruguruFix:
lda $a0 : cmp #$df : !bge +
and #$0f : cmp #$0e : !blt +
iny #2
+ rtl
+ rtl
BlindAtticFix:
lda.l DRMode : beq +
lda #$01 : rtl
+ lda $7EF3CC : cmp.b #$06
rtl