Applied labels and byte designators
This commit is contained in:
@@ -6,15 +6,6 @@
|
||||
!RedSquare = $345E
|
||||
!BlueSquare = $2C5E
|
||||
|
||||
!DungeonMask = $8098C0
|
||||
!EnemyDropIndicator = $7E072A
|
||||
!IndicatorAddress = $7EC790 ; used for both boss nearness and enemy drops
|
||||
!CurrentDungeonIndicator = $7EC702
|
||||
|
||||
!KeysObtained = $7EC7A2
|
||||
!KeysSlash = $7EC7A4
|
||||
!KeysTotal = $7EC7A6
|
||||
|
||||
DrHudOverride:
|
||||
PHB
|
||||
SEP #$30
|
||||
@@ -32,19 +23,19 @@ DRHUD_DrawItemCounter:
|
||||
SEP #$30
|
||||
|
||||
DRHUD_DrawIndicators:
|
||||
LDA.b $1B : BNE .continue
|
||||
LDA.b IndoorsFlag : BNE .continue
|
||||
JMP DRHUD_Finished
|
||||
.continue
|
||||
LDA.b $1A : AND.b #$10 : BEQ DRHUD_EnemyDropIndicator
|
||||
LDA.b FrameCounter : AND.b #$10 : BEQ DRHUD_EnemyDropIndicator
|
||||
|
||||
DRHUD_BossIndicator:
|
||||
LDA.l DRMode : BNE .continue
|
||||
.early_exit
|
||||
REP #$10
|
||||
LDY.w #!BlankTile : STY.w !IndicatorAddress
|
||||
LDY.w #!BlankTile : STY.w HUDMultiIndicator
|
||||
JMP DRHUD_Finished
|
||||
.continue
|
||||
LDA.w $040C : CMP.b #$1B : BCS .early_exit
|
||||
LDA.w DungeonID : CMP.b #$1B : BCS .early_exit
|
||||
|
||||
SEP #$10 ; clears the high byte of X and prevents it from getting B register
|
||||
TAX
|
||||
@@ -54,17 +45,17 @@ DRHUD_BossIndicator:
|
||||
LDA.w CompassField : AND.l DungeonMask, x
|
||||
SEP #$20
|
||||
BEQ .draw_indicator
|
||||
LDA.l CompassBossIndicator, x : CMP.b $A0 : BNE .draw_indicator
|
||||
LDA.l CompassBossIndicator, x : CMP.b RoomIndex : BNE .draw_indicator
|
||||
LDY.w #!RedSquare
|
||||
.draw_indicator
|
||||
STY.w !IndicatorAddress
|
||||
STY.w HUDMultiIndicator
|
||||
BRA DRHUD_DrawCurrentDungeonIndicator
|
||||
|
||||
DRHUD_EnemyDropIndicator:
|
||||
REP #$30
|
||||
LDA.w !EnemyDropIndicator : STA.w !IndicatorAddress
|
||||
LDA.w EnemyDropIndicator : STA.w HUDMultiIndicator
|
||||
SEP #$20
|
||||
LDA.w $040C : CMP.b #$1B : BCS DRHUD_Finished
|
||||
LDA.w DungeonID : CMP.b #$1B : BCS DRHUD_Finished
|
||||
SEP #$10 : TAX : REP #$10
|
||||
|
||||
DRHUD_DrawCurrentDungeonIndicator: ; mX
|
||||
@@ -75,7 +66,7 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX
|
||||
REP #$20 : LDA.l DungeonReminderTable,X : TAY
|
||||
SEP #$20
|
||||
.draw_indicator
|
||||
STY.w !CurrentDungeonIndicator
|
||||
STY.w HUDCurrentDungeonWorld
|
||||
|
||||
DRHUD_DrawKeyCounter:
|
||||
LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished
|
||||
@@ -83,10 +74,10 @@ DRHUD_DrawKeyCounter:
|
||||
LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished
|
||||
TXA : LSR : TAX
|
||||
LDA.l GenericKeys : AND.w #$00FF : BNE .total_only
|
||||
LDA.l DungeonCollectedKeys, X : JSR ConvertToDisplay : STA.w !KeysObtained
|
||||
LDA #!SlashTile : STA.w !KeysSlash
|
||||
LDA.l DungeonCollectedKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained
|
||||
LDA.w #!SlashTile : STA.w HUDKeysSlash
|
||||
.total_only
|
||||
LDA.l ChestKeys, x : JSR ConvertToDisplay : STA.w !KeysTotal
|
||||
LDA.l ChestKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal
|
||||
|
||||
DRHUD_Finished:
|
||||
PLB : RTL
|
||||
@@ -109,94 +100,94 @@ dw $0000, $0000, $0000, $0000, $000a, $000a, $000a, $0014, $000a, $0014, $0000,
|
||||
DrHudDungeonItemsAdditions:
|
||||
{
|
||||
jsl DrawHUDDungeonItems
|
||||
lda.l HUDDungeonItems : and #$ff : bne + : rtl : +
|
||||
lda.l DRMode : cmp #$02 : beq + : rtl : +
|
||||
lda.l HUDDungeonItems : and.b #$ff : bne + : rtl : +
|
||||
lda.l DRMode : cmp.b #$02 : beq + : rtl : +
|
||||
|
||||
phx : phy : php
|
||||
rep #$30
|
||||
|
||||
lda.w #$24f5 : sta $1606 : sta $1610 : sta $161a : sta $1624
|
||||
sta $1644 : sta $164a : sta $1652 : sta $1662 : sta $1684 : sta $16c4
|
||||
ldx #$0000
|
||||
- sta $1704, x : sta $170e, x : sta $1718, x
|
||||
inx #2 : cpx #$0008 : !blt -
|
||||
lda.w #$24f5 : sta.w $1606 : sta.w $1610 : sta.w $161a : sta.w $1624
|
||||
sta.w $1644 : sta.w $164a : sta.w $1652 : sta.w $1662 : sta.w $1684 : sta.w $16c4
|
||||
ldx.w #$0000
|
||||
- sta.w $1704, x : sta.w $170e, x : sta.w $1718, x
|
||||
inx #2 : cpx.w #$0008 : !BLT -
|
||||
|
||||
lda HudFlag : and.w #$0020 : beq + : JMP ++ : +
|
||||
lda HUDDungeonItems : and.w #$0007 : bne + : JMP ++ : +
|
||||
lda.l HudFlag : and.w #$0020 : beq + : JMP ++ : +
|
||||
lda.l HUDDungeonItems : and.w #$0007 : bne + : JMP ++ : +
|
||||
; bk symbols
|
||||
lda.w #$2811 : sta $1606 : sta $1610 : sta $161a : sta $1624
|
||||
lda.w #$2811 : sta.w $1606 : sta.w $1610 : sta.w $161a : sta.w $1624
|
||||
; sm symbols
|
||||
lda.w #$2810 : sta $160a : sta $1614 : sta $161e : sta $16e4
|
||||
lda.w #$2810 : sta.w $160a : sta.w $1614 : sta.w $161e : sta.w $16e4
|
||||
; blank out stuff
|
||||
lda.w #$24f5 : sta $1724
|
||||
lda.w #$24f5 : sta.w $1724
|
||||
|
||||
ldx #$0002
|
||||
- lda #$0000 : !addl RowOffsets,x : !addl ColumnOffsets, x : tay
|
||||
lda.l DungeonReminderTable, x : sta $1644, y : iny #2
|
||||
lda.w #$24f5 : sta $1644, y
|
||||
lda MapField : and.l $0098c0, x : beq + ; must have map
|
||||
jsr BkStatus : sta $1644, y : bra .smallKey ; big key status
|
||||
+ lda BigKeyField : and.l $0098c0, x : beq .smallKey
|
||||
lda.w #$2826 : sta $1644, y
|
||||
ldx.w #$0002
|
||||
- lda.w #$0000 : !ADD.l RowOffsets,x : !ADD.l ColumnOffsets, x : tay
|
||||
lda.l DungeonReminderTable, x : sta.w $1644, y : iny #2
|
||||
lda.w #$24f5 : sta.w $1644, y
|
||||
lda.l MapField : and.l DungeonMask, x : beq + ; must have map
|
||||
jsr BkStatus : sta.w $1644, y : bra .smallKey ; big key status
|
||||
+ lda.l BigKeyField : and.l DungeonMask, x : beq .smallKey
|
||||
lda.w #$2826 : sta.w $1644, y
|
||||
.smallKey
|
||||
+ iny #2
|
||||
cpx #$001a : bne +
|
||||
tya : !add #$003c : tay
|
||||
+ stx $00
|
||||
cpx.w #$001a : bne +
|
||||
tya : !ADD.w #$003c : tay
|
||||
+ stx.b Scrap00
|
||||
txa : lsr : tax
|
||||
lda.w #$24f5 : sta $1644, y
|
||||
lda.l GenericKeys : and #$00FF : bne +
|
||||
lda.l DungeonKeys, x : and #$00FF : beq +
|
||||
jsr ConvertToDisplay2 : sta $1644, y
|
||||
+ iny #2 : lda.w #$24f5 : sta $1644, y
|
||||
phx : ldx $00
|
||||
lda MapField : and.l $0098c0, x : beq + ; must have map
|
||||
plx : sep #$30 : lda.l ChestKeys, x : sta $02
|
||||
lda.w #$24f5 : sta.w $1644, y
|
||||
lda.l GenericKeys : and.w #$00FF : bne +
|
||||
lda.l DungeonKeys, x : and.w #$00FF : beq +
|
||||
jsr ConvertToDisplay2 : sta.w $1644, y
|
||||
+ iny #2 : lda.w #$24f5 : sta.w $1644, y
|
||||
phx : ldx.b Scrap00
|
||||
lda.l MapField : and.l DungeonMask, x : beq + ; must have map
|
||||
plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02
|
||||
lda.l GenericKeys : bne +++
|
||||
lda $02 : !sub DungeonCollectedKeys, x : sta $02
|
||||
+++ lda $02
|
||||
lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02
|
||||
+++ lda.b Scrap02
|
||||
rep #$30
|
||||
jsr ConvertToDisplay2 : sta $1644, y ; small key totals
|
||||
jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals
|
||||
bra .skipStack
|
||||
+ plx
|
||||
.skipStack iny #2
|
||||
cpx #$000d : beq +
|
||||
lda.w #$24f5 : sta $1644, y
|
||||
cpx.w #$000d : beq +
|
||||
lda.w #$24f5 : sta.w $1644, y
|
||||
+
|
||||
ldx $00
|
||||
+ inx #2 : cpx #$001b : bcs ++ : JMP -
|
||||
ldx.b Scrap00
|
||||
+ inx #2 : cpx.w #$001b : bcs ++ : JMP -
|
||||
++
|
||||
lda HudFlag : and.w #$0020 : bne + : JMP ++ : +
|
||||
lda HUDDungeonItems : and.w #$000c : bne + : JMP ++ : +
|
||||
lda.l HudFlag : and.w #$0020 : bne + : JMP ++ : +
|
||||
lda.l HUDDungeonItems : and.w #$000c : bne + : JMP ++ : +
|
||||
; map symbols (do I want these) ; note compass symbol is 2c20
|
||||
lda.w #$2821 : sta $1606 : sta $1610 : sta $161a : sta $1624
|
||||
lda.w #$2821 : sta.w $1606 : sta.w $1610 : sta.w $161a : sta.w $1624
|
||||
; blank out a couple thing from old hud
|
||||
lda.w #$24f5 : sta $16e4 : sta $1724
|
||||
sta $160a : sta $1614 : sta $161e ; blank out sm key indicators
|
||||
ldx #$0002
|
||||
- lda #$0000 ; start of hud area
|
||||
!addl RowOffsets, x : !addl ColumnOffsets, x : tay
|
||||
lda.l DungeonReminderTable, x : sta $1644, y
|
||||
lda.w #$24f5 : sta.w $16e4 : sta.w $1724
|
||||
sta.w $160a : sta.w $1614 : sta.w $161e ; blank out sm key indicators
|
||||
ldx.w #$0002
|
||||
- lda.w #$0000 ; start of hud area
|
||||
!ADD.l RowOffsets, x : !ADD.l ColumnOffsets, x : tay
|
||||
lda.l DungeonReminderTable, x : sta.w $1644, y
|
||||
iny #2
|
||||
lda.w #$24f5 : sta $1644, y ; blank out map spot
|
||||
lda MapField : and.l $0098c0, x : beq + ; must have map
|
||||
JSR MapIndicatorShort : STA $1644, Y
|
||||
lda.w #$24f5 : sta.w $1644, y ; blank out map spot
|
||||
lda.l MapField : and.l DungeonMask, x : beq + ; must have map
|
||||
JSR MapIndicatorShort : STA.w $1644, Y
|
||||
+ iny #2
|
||||
cpx #$001a : bne +
|
||||
tya : !add #$003c : tay
|
||||
+ lda CompassField : and.l $0098c0, x : beq + ; must have compass
|
||||
cpx.w #$001a : bne +
|
||||
tya : !ADD.w #$003c : tay
|
||||
+ lda.l CompassField : and.l DungeonMask, x : beq + ; must have compass
|
||||
phx ; total chest counts
|
||||
LDA.l CompassTotalsWRAM, x : !sub DungeonLocationsChecked, x
|
||||
LDA.l CompassTotalsWRAM, x : !SUB.l DungeonLocationsChecked, x
|
||||
SEP #$30 : JSR HudHexToDec2DigitCopy : REP #$30
|
||||
lda $06 : jsr ConvertToDisplay2 : sta $1644, y : iny #2
|
||||
lda $07 : jsr ConvertToDisplay2 : sta $1644, y
|
||||
lda.b Scrap06 : jsr ConvertToDisplay2 : sta.w $1644, y : iny #2
|
||||
lda.b Scrap07 : jsr ConvertToDisplay2 : sta.w $1644, y
|
||||
plx
|
||||
bra .skipBlanks
|
||||
+ lda.w #$24f5 : sta $1644, y : iny #2 : sta $1644, y
|
||||
+ lda.w #$24f5 : sta.w $1644, y : iny #2 : sta.w $1644, y
|
||||
.skipBlanks iny #2
|
||||
cpx #$001a : beq +
|
||||
lda.w #$24f5 : sta $1644, y ; blank out spot
|
||||
+ inx #2 : cpx #$001b : !bge ++ : JMP -
|
||||
cpx.w #$001a : beq +
|
||||
lda.w #$24f5 : sta.w $1644, y ; blank out spot
|
||||
+ inx #2 : cpx.w #$001b : !BGE ++ : JMP -
|
||||
++
|
||||
plp : ply : plx : rtl
|
||||
}
|
||||
@@ -223,32 +214,32 @@ IndicatorCharacters:
|
||||
dw $2426, $2817, $2818, $2819, $281A, $281B, $281C, $281D, $2590, $258B, $259B
|
||||
|
||||
MapIndicator:
|
||||
LDA.l CrystalPendantFlags_3, X : AND #$00FF
|
||||
LDA.l CrystalPendantFlags_3, X : AND.w #$00FF
|
||||
PHX
|
||||
ASL : TAX : LDA.l IndicatorCharacters, X
|
||||
PLX
|
||||
RTS
|
||||
|
||||
BkStatus:
|
||||
lda BigKeyField : and.l $0098c0, x : bne +++ ; has the bk already
|
||||
lda.l BigKeyField : and.l DungeonMask, x : bne +++ ; has the bk already
|
||||
lda.l BigKeyStatus, x : bne ++
|
||||
lda #$2827 : rts ; 0/O for no BK
|
||||
++ cmp #$0002 : bne +
|
||||
lda #$2420 : rts ; symbol for BnC
|
||||
+ lda #$24f5 : rts ; black otherwise
|
||||
+++ lda #$2826 : rts ; check mark
|
||||
lda.w #$2827 : rts ; 0/O for no BK
|
||||
++ cmp.w #$0002 : bne +
|
||||
lda.w #$2420 : rts ; symbol for BnC
|
||||
+ lda.w #$24f5 : rts ; black otherwise
|
||||
+++ lda.w #$2826 : rts ; check mark
|
||||
|
||||
ConvertToDisplay:
|
||||
and.w #$00ff : cmp #$000a : !blt +
|
||||
!add #$2553 : rts
|
||||
+ !add #$2490 : rts
|
||||
and.w #$00ff : cmp.w #$000a : !BLT +
|
||||
!ADD.w #$2553 : rts
|
||||
+ !ADD.w #$2490 : rts
|
||||
|
||||
ConvertToDisplay2:
|
||||
and.w #$00ff : beq ++
|
||||
cmp #$000a : !blt +
|
||||
!add #$2553 : rts ; 2580 with 258A as "A" for non transparent digits
|
||||
+ !add #$2816 : rts
|
||||
++ lda #$2827 : rts ; 0/O for 0 or placeholder digit ;2483
|
||||
cmp.w #$000a : !BLT +
|
||||
!ADD.w #$2553 : rts ; 2580 with 258A as "A" for non transparent digits
|
||||
+ !ADD.w #$2816 : rts
|
||||
++ lda.w #$2827 : rts ; 0/O for 0 or placeholder digit ;2483
|
||||
|
||||
CountAbsorbedKeys:
|
||||
JML IncrementSmallKeysNoPrimary
|
||||
@@ -266,12 +257,12 @@ HudHexToDec2DigitCopy: ; modified
|
||||
INY
|
||||
SBC.b #10 : BRA -
|
||||
+
|
||||
STY $06 : LDY #$00 ; Store 10s digit and reset Y
|
||||
STY.b Scrap06 : LDY.b #$00 ; Store 10s digit and reset Y
|
||||
CMP.b #1 : !BLT +
|
||||
-
|
||||
INY
|
||||
DEC : BNE -
|
||||
+
|
||||
STY $07 ; Store 1s digit
|
||||
STY.b Scrap07 ; Store 1s digit
|
||||
PLY
|
||||
RTS
|
||||
|
||||
Reference in New Issue
Block a user