Port map key counter on HUD from DR
This commit is contained in:
@@ -1,22 +1,24 @@
|
|||||||
DrawDungeonCompassCounts:
|
DrawDungeonItemCounts:
|
||||||
LDX.b IndoorsFlag : BNE + : RTL : + ; Skip if outdoors
|
LDX.b IndoorsFlag : BNE + : RTL : + ; Skip if outdoors
|
||||||
|
|
||||||
; extra hard safeties for getting dungeon ID to prevent crashes
|
; extra hard safeties for getting dungeon ID to prevent crashes
|
||||||
PHA
|
PHA
|
||||||
LDA.w DungeonID : AND.w #$00FE : TAX ; force dungeon ID to be multiple of 2
|
LDA.w DungeonID : AND.w #$00FE : TAX ; force dungeon ID to be multiple of 2
|
||||||
PLA
|
PLA
|
||||||
|
|
||||||
CPX.b #$1B : BCS .done ; Skip if not in a valid dungeon ID
|
CPX.b #$1B : BCS .done ; Skip if not in a valid dungeon ID
|
||||||
|
TXA : LSR : TAX : BNE +
|
||||||
|
INC ; Count sewer as Hyrule Castle
|
||||||
|
+
|
||||||
|
JSR.w DrawCompassCounts
|
||||||
|
JSR.w DrawMapCounts
|
||||||
|
.done
|
||||||
|
RTL
|
||||||
|
|
||||||
BIT.w #$0002 : BNE ++ ; if CompassMode==2, we don't check for the compass
|
DrawCompassCounts:
|
||||||
|
PHX
|
||||||
|
LDA.l CompassMode : BIT.w #$0002 : BNE + ; if CompassMode==2, we don't check for the compass
|
||||||
LDA.l CompassField : AND.l DungeonItemMasks, X ; Load compass values to A, mask with dungeon item masks
|
LDA.l CompassField : AND.l DungeonItemMasks, X ; Load compass values to A, mask with dungeon item masks
|
||||||
BEQ .done ; skip if we don't have compass
|
BEQ .done ; skip if we don't have compass
|
||||||
++
|
+
|
||||||
|
|
||||||
TXA : LSR : TAX
|
|
||||||
BNE +
|
|
||||||
INC
|
|
||||||
+
|
|
||||||
LDA.l CompassTotalsWRAM, X : AND.w #$00FF
|
LDA.l CompassTotalsWRAM, X : AND.w #$00FF
|
||||||
SEP #$20
|
SEP #$20
|
||||||
JSR HudHexToDec2Digit
|
JSR HudHexToDec2Digit
|
||||||
@@ -25,18 +27,39 @@ DrawDungeonCompassCounts:
|
|||||||
LDX.b Scrap06 : TXA : ORA.w #$2400 : STA.l HUDTileMapBuffer+$9A
|
LDX.b Scrap06 : TXA : ORA.w #$2400 : STA.l HUDTileMapBuffer+$9A
|
||||||
LDX.b Scrap07 : TXA : ORA.w #$2400 : STA.l HUDTileMapBuffer+$9C
|
LDX.b Scrap07 : TXA : ORA.w #$2400 : STA.l HUDTileMapBuffer+$9C
|
||||||
PLX
|
PLX
|
||||||
|
|
||||||
LDA.l DungeonLocationsChecked, X : AND.w #$00FF
|
LDA.l DungeonLocationsChecked, X : AND.w #$00FF
|
||||||
SEP #$20
|
SEP #$20
|
||||||
JSR HudHexToDec2Digit
|
JSR HudHexToDec2Digit
|
||||||
REP #$20
|
REP #$20
|
||||||
LDX.b Scrap06 : TXA : ORA.w #$2400 : STA.l HUDTileMapBuffer+$94 ; Draw the item count
|
LDX.b Scrap06 : TXA : ORA.w #$2400 : STA.l HUDTileMapBuffer+$94 ; Draw the item count
|
||||||
LDX.b Scrap07 : TXA : ORA.w #$2400 : STA.l HUDTileMapBuffer+$96
|
LDX.b Scrap07 : TXA : ORA.w #$2400 : STA.l HUDTileMapBuffer+$96
|
||||||
|
|
||||||
LDA.w #$2830 : STA.l HUDTileMapBuffer+$98 ; draw the slash
|
LDA.w #$2830 : STA.l HUDTileMapBuffer+$98 ; draw the slash
|
||||||
|
.done
|
||||||
|
PLX
|
||||||
|
RTS
|
||||||
|
|
||||||
.done
|
DrawMapCounts:
|
||||||
RTL
|
PHX
|
||||||
|
LDA.l MapHUDMode : BIT.w #$0002 : BNE + ; if MapHUDMode==2, we don't check for map
|
||||||
|
LDA.l MapField : AND.l DungeonItemMasks, X ; Load map values to A, mask with dungeon item masks
|
||||||
|
BEQ .done ; skip if we don't have map
|
||||||
|
+
|
||||||
|
LDA.l MapTotalsWRAM, X : AND.w #$00FF
|
||||||
|
SEP #$20
|
||||||
|
JSR HudHexToDec2Digit
|
||||||
|
REP #$20
|
||||||
|
PHX
|
||||||
|
LDX.b Scrap07 : TXA : ORA.w #$2400 : STA.l HUDTileMapBuffer+$A6
|
||||||
|
PLX
|
||||||
|
LDA.l DungeonCollectedKeys, X : AND.w #$00FF
|
||||||
|
SEP #$20
|
||||||
|
JSR HudHexToDec2Digit
|
||||||
|
REP #$20
|
||||||
|
LDX.b Scrap07 : TXA : ORA.w #$2400 : STA.l HUDTileMapBuffer+$A2
|
||||||
|
LDA.w #$2830 : STA.l HUDTileMapBuffer+$A4 ; draw the slash
|
||||||
|
.done
|
||||||
|
PLX
|
||||||
|
RTS
|
||||||
|
|
||||||
DungeonItemMasks: ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc
|
DungeonItemMasks: ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc
|
||||||
dw $8000, $4000, $2000, $1000, $0800, $0400, $0200, $0100
|
dw $8000, $4000, $2000, $1000, $0800, $0400, $0200, $0100
|
||||||
|
|||||||
@@ -85,9 +85,7 @@ NewDrawHud:
|
|||||||
;================================================================================
|
;================================================================================
|
||||||
; Draw Dungeon Compass Counts
|
; Draw Dungeon Compass Counts
|
||||||
;================================================================================
|
;================================================================================
|
||||||
LDA.l CompassMode : AND.w #$00FF : BEQ + ; skip if CompassMode is 0.
|
JSL.l DrawDungeonItemCounts ; compasses.asm
|
||||||
JSL.l DrawDungeonCompassCounts ; compasses.asm
|
|
||||||
+
|
|
||||||
|
|
||||||
;================================================================================
|
;================================================================================
|
||||||
; Draw key count
|
; Draw key count
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ org $308038 ; PC 0x180038
|
|||||||
LampConeSewers:
|
LampConeSewers:
|
||||||
db #$01 ; #$00 = Off - #$01 = On (default)
|
db #$01 ; #$00 = Off - #$01 = On (default)
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
; 0x180039 - 0x180039 (Unused)
|
; 0x180039 (Unused)
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
org $30803A ; PC 0x18003B - PC 0x18003C
|
org $30803A ; PC 0x18003B - PC 0x18003C
|
||||||
MapHUDMode:
|
MapHUDMode:
|
||||||
|
|||||||
Reference in New Issue
Block a user