More fast hud
Added update hud flag
This commit is contained in:
@@ -3,6 +3,7 @@ DungeonItemMasks: ; these are dungeon correlations to $7EF364 - $7EF369 so it kn
|
||||
dw $0080, $0040, $0020, $0010, $0008, $0004
|
||||
;--------------------------------------------------------------------------------
|
||||
InitDungeonCounts:
|
||||
PHB
|
||||
LDX.b #$0F
|
||||
-
|
||||
LDA.l CompassTotalsROM, X : STA.l CompassTotalsWRAM, X
|
||||
@@ -13,5 +14,18 @@ InitDungeonCounts:
|
||||
LDA.l ChestKeys, X : STA.l MapTotalsWRAM, X
|
||||
DEX
|
||||
BPL -
|
||||
|
||||
LDA.b #$7E
|
||||
PHA : PLB
|
||||
REP #$30
|
||||
LDA.l TotalItemCount
|
||||
JSL.l HUDHex4Digit_Long
|
||||
SEP #$20
|
||||
LDA.b Scrap04 : TAX : STX.w TotalItemCountTiles+$00
|
||||
LDA.b Scrap05 : TAX : STX.w TotalItemCountTiles+$02
|
||||
LDA.b Scrap06 : TAX : STX.w TotalItemCountTiles+$04
|
||||
LDA.b Scrap07 : TAX : STX.w TotalItemCountTiles+$06
|
||||
SEP #$10
|
||||
PLB
|
||||
RTL
|
||||
|
||||
|
||||
@@ -155,6 +155,7 @@ JML.l AllowStartFromExitReturn
|
||||
STZ.b SubSubModule
|
||||
STZ.w DeathReloadFlag
|
||||
STZ.w RespawnFlag
|
||||
INC.w UpdateHUD
|
||||
|
||||
JSL Equipment_SearchForEquippedItemLong
|
||||
JSL HUD_RebuildLong2
|
||||
|
||||
@@ -17,6 +17,7 @@ JML.l ReturnFromOnDrawHud
|
||||
OnDungeonEntrance:
|
||||
STA.l PegColor ; thing we wrote over
|
||||
JSL MaybeFlagDungeonTotalsEntrance
|
||||
INC.w UpdateHUD
|
||||
RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
OnPlayerDead:
|
||||
@@ -37,6 +38,7 @@ OnDungeonExit:
|
||||
|
||||
PHA : PHP
|
||||
JSL.l HUD_RebuildLong
|
||||
INC.w UpdateHUD
|
||||
JSL.l FloodGateResetInner
|
||||
JSL.l SetSilverBowMode
|
||||
PLP : PLA
|
||||
|
||||
@@ -1376,7 +1376,11 @@ MVN $217E
|
||||
;--------------------------------------------------------------------------------
|
||||
org $0DFB1F ; 6FB1F - headsup_display.asm : 681 (LDA $7EF340 : BEQ .hastNoBow)
|
||||
JSL.l CheckHUDSilverArrows
|
||||
|
||||
;--------------------------------------------------------------------------------
|
||||
org $0DF1AB
|
||||
JSR.w RebuildHUD_update
|
||||
org $0DDFC8
|
||||
JSR.w RebuildHUD_update
|
||||
;================================================================================
|
||||
; 300 Rupee NPC
|
||||
;--------------------------------------------------------------------------------
|
||||
|
||||
@@ -689,6 +689,7 @@ Link_ReceiveItem_HUDRefresh:
|
||||
+
|
||||
|
||||
JSL.l HUD_RefreshIconLong ; thing we wrote over
|
||||
INC.w UpdateHUD
|
||||
JSL.l PostItemGet
|
||||
RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
@@ -703,6 +704,7 @@ HandleBombAbsorbtion:
|
||||
LDA.b #$04 : STA.w ItemCursor ; set selected item to bombs
|
||||
LDA.b #$01 : STA.w CurrentYItem ; set selected item to bombs
|
||||
JSL.l HUD_RebuildLong
|
||||
INC.w UpdateHUD
|
||||
+
|
||||
RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
|
||||
60
newhud.asm
60
newhud.asm
@@ -64,6 +64,8 @@ NewHUD_DrawArrows:
|
||||
|
||||
;================================================================================
|
||||
NewHUD_DrawGoal:
|
||||
LDA.w UpdateHUD : BEQ .no_goal
|
||||
|
||||
REP #$20
|
||||
|
||||
LDA.l GoalItemRequirement : BEQ .no_goal
|
||||
@@ -122,6 +124,7 @@ NewHUD_DrawKeys:
|
||||
|
||||
;================================================================================
|
||||
NewHUD_DrawDungeonCounters:
|
||||
LDA.w UpdateHUD : BEQ NewHUD_DrawPrizeIcon
|
||||
LDA.l CompassMode : ORA.l MapHUDMode : BIT.b #$03 : BEQ NewHUD_DrawPrizeIcon
|
||||
LDX.b IndoorsFlag : BNE +
|
||||
JMP.w NewHUD_DrawMagicMeter
|
||||
@@ -129,7 +132,7 @@ NewHUD_DrawDungeonCounters:
|
||||
SEP #$30
|
||||
; extra hard safeties for getting dungeon ID to prevent crashes
|
||||
LDA.w DungeonID
|
||||
CPX.b #$1B : BCS NewHUD_DrawPrizeIcon ; Skip if not in a valid dungeon ID
|
||||
CMP.b #$1B : BCS NewHUD_DrawPrizeIcon ; Skip if not in a valid dungeon ID
|
||||
AND.b #$FE : TAX
|
||||
LSR : TAY
|
||||
PHX : PHY
|
||||
@@ -141,6 +144,8 @@ NewHUD_DrawDungeonCounters:
|
||||
|
||||
;================================================================================
|
||||
NewHUD_DrawPrizeIcon:
|
||||
REP #$10
|
||||
SEP #$20
|
||||
LDA.b GameMode
|
||||
CMP.b #$12
|
||||
BEQ .no_prize
|
||||
@@ -151,7 +156,7 @@ NewHUD_DrawPrizeIcon:
|
||||
CMP.b #$08 : BNE .dungeon
|
||||
|
||||
.no_prize
|
||||
LDY.w #BlankTile
|
||||
LDY.w #!BlankTile
|
||||
BRA .draw_prize
|
||||
|
||||
.dungeon
|
||||
@@ -162,16 +167,17 @@ NewHUD_DrawPrizeIcon:
|
||||
LDA.l MapMode
|
||||
|
||||
REP #$30
|
||||
BEQ .prize
|
||||
|
||||
LDA.l MapField
|
||||
AND.l DungeonItemMasks,X
|
||||
|
||||
SEP #$20
|
||||
BEQ .no_prize
|
||||
|
||||
.prize
|
||||
TYX
|
||||
LDA.l CrystalPendantFlags_2,X
|
||||
AND.b #$40
|
||||
AND.w #$0040
|
||||
BNE .crystal
|
||||
|
||||
LDY.w #!PTile
|
||||
@@ -183,6 +189,38 @@ NewHUD_DrawPrizeIcon:
|
||||
.draw_prize
|
||||
STY.w HUDPrizeIcon
|
||||
|
||||
;================================================================================
|
||||
NewHUD_DrawItemCounter:
|
||||
LDA.w UpdateHUD : BEQ NewHUD_DrawMagicMeter
|
||||
LDA.l ItemCounterHUD : AND.w #$00FF : BEQ NewHUD_DrawMagicMeter
|
||||
LDA.w #!SlashTile : STA.w HUDGoalIndicator+$08
|
||||
LDA.l TotalItemCount : CMP.w #1000 : BCS .item_four_digits
|
||||
LDA.w TotalItemCountTiles+$02 : STA.w HUDGoalIndicator+$0A
|
||||
LDA.w TotalItemCountTiles+$04 : STA.w HUDGoalIndicator+$0C
|
||||
LDA.w TotalItemCountTiles+$06 : STA.w HUDGoalIndicator+$0E
|
||||
|
||||
LDA.w TotalItemCounter
|
||||
JSR.w HUDHex4Digit
|
||||
LDA.b $05 : TAX : STX.w HUDGoalIndicator+$02
|
||||
LDA.b $06 : TAX : STX.w HUDGoalIndicator+$04
|
||||
LDA.b $07 : TAX : STX.w HUDGoalIndicator+$06
|
||||
BRA NewHUD_DrawMagicMeter
|
||||
|
||||
.item_four_digits
|
||||
LDA.w TotalItemCountTiles+$00 : STA.w HUDGoalIndicator+$0A
|
||||
LDA.w TotalItemCountTiles+$02 : STA.w HUDGoalIndicator+$0C
|
||||
LDA.w TotalItemCountTiles+$04 : STA.w HUDGoalIndicator+$0E
|
||||
LDA.w TotalItemCountTiles+$06 : STA.w HUDGoalIndicator+$10
|
||||
|
||||
LDA.w TotalItemCounter
|
||||
JSR.w HUDHex4Digit
|
||||
LDA.b $04 : TAX : STX.w HUDGoalIndicator+$00
|
||||
LDA.b $05 : TAX : STX.w HUDGoalIndicator+$02
|
||||
LDA.b $06 : TAX : STX.w HUDGoalIndicator+$04
|
||||
LDA.b $07 : TAX : STX.w HUDGoalIndicator+$06
|
||||
|
||||
|
||||
|
||||
;================================================================================
|
||||
DrawMagicMeter_mp_tilemap = $0DFE0F
|
||||
NewHUD_DrawMagicMeter:
|
||||
@@ -197,7 +235,7 @@ NewHUD_DrawMagicMeter:
|
||||
|
||||
.infinite_magic
|
||||
LDA.b #$80
|
||||
STA.l CurrentMagic
|
||||
STA.w CurrentMagic
|
||||
TAY
|
||||
|
||||
LDA.b FrameCounter
|
||||
@@ -215,13 +253,14 @@ NewHUD_DrawMagicMeter:
|
||||
LDA.l MagicMeterColorMasks,X
|
||||
|
||||
TYX
|
||||
TAY : AND.l DrawMagicMeter_mp_tilemap+0,X : STA.l HUDTileMapBuffer+$046
|
||||
TYA : AND.l DrawMagicMeter_mp_tilemap+2,X : STA.l HUDTileMapBuffer+$086
|
||||
TYA : AND.l DrawMagicMeter_mp_tilemap+4,X : STA.l HUDTileMapBuffer+$0C6
|
||||
TYA : AND.l DrawMagicMeter_mp_tilemap+6,X : STA.l HUDTileMapBuffer+$106
|
||||
TAY : AND.l DrawMagicMeter_mp_tilemap+0,X : STA.w HUDTileMapBuffer+$046
|
||||
TYA : AND.l DrawMagicMeter_mp_tilemap+2,X : STA.w HUDTileMapBuffer+$086
|
||||
TYA : AND.l DrawMagicMeter_mp_tilemap+4,X : STA.w HUDTileMapBuffer+$0C6
|
||||
TYA : AND.l DrawMagicMeter_mp_tilemap+6,X : STA.w HUDTileMapBuffer+$106
|
||||
|
||||
;================================================================================
|
||||
NewHUD_DoneDrawing:
|
||||
STZ.w UpdateHUD
|
||||
PLB
|
||||
RTL
|
||||
|
||||
@@ -239,6 +278,7 @@ DrawCompassCounts:
|
||||
|
||||
; no compass needed if this bit is set
|
||||
BIT.b #$02 : BNE .draw_compass_count
|
||||
REP #$20
|
||||
LDA.l CompassField : AND.l DungeonItemMasks,X : BEQ .done
|
||||
|
||||
.draw_compass_count
|
||||
@@ -268,6 +308,7 @@ DrawMapCounts:
|
||||
|
||||
; no map needed if this bit is set
|
||||
BIT.b #$02 : BNE .draw_map_count
|
||||
REP #$20
|
||||
LDA.l MapField : AND.l DungeonItemMasks,X : BEQ .done
|
||||
|
||||
.draw_map_count
|
||||
@@ -275,6 +316,7 @@ DrawMapCounts:
|
||||
INX
|
||||
|
||||
.not_sewers
|
||||
SEP #$20
|
||||
LDA.l DungeonCollectedKeys, X
|
||||
PHA
|
||||
|
||||
|
||||
@@ -17,18 +17,23 @@ RTL
|
||||
;================================================================================
|
||||
HUDRebuildIndoorHole:
|
||||
PHA
|
||||
INC.w UpdateHUD
|
||||
LDA.l GenericKeys : BEQ .normal
|
||||
.generic
|
||||
PLA
|
||||
LDA.l CurrentGenericKeys ; generic key count
|
||||
JSL.l HUD_RebuildIndoor_Palace
|
||||
STA.l CurrentSmallKeys
|
||||
JSL.l RebuildHUD_update
|
||||
RTL
|
||||
.normal
|
||||
PLA
|
||||
JSL.l HUD_RebuildIndoor_Palace
|
||||
|
||||
STA.l CurrentSmallKeys
|
||||
JSL.l RebuildHUD_update
|
||||
RTL
|
||||
;================================================================================
|
||||
HUDRebuildIndoor:
|
||||
INC.w UpdateHUD
|
||||
LDA.l GenericKeys : BEQ .normal
|
||||
.generic
|
||||
LDA.b #$00 : STA.l RoomDarkness
|
||||
@@ -170,6 +175,7 @@ RaiseHudMenu:
|
||||
RTL
|
||||
;================================================================================
|
||||
CheckCloseItemMenu:
|
||||
INC.w UpdateHUD
|
||||
LDA.l MenuCollapse : BNE +
|
||||
LDA.b Joy1A_New : AND.b #$10 : RTL
|
||||
+
|
||||
|
||||
3
ram.asm
3
ram.asm
@@ -354,6 +354,8 @@ DelayTimer = $7E1CE9 ;
|
||||
;
|
||||
TextID = $7E1CF0 ; Message ID and page. Word length.
|
||||
;
|
||||
UpdateHUD = $7E1E03 ; Flag used to mark HUD updates and avoid heavy code segments.
|
||||
;
|
||||
ToastBuffer = $7E1E0E ; Multiworld buffer. Word length.
|
||||
;
|
||||
MSUResumeTime = $7E1E6B ; Mirrored MSU block
|
||||
@@ -439,6 +441,7 @@ HUDArrowCount = $7EC760 ;
|
||||
HUDKeyDigits = $7EC764 ;
|
||||
;
|
||||
BigRAM = $7EC900 ; Big buffer of free ram (0x1F00)
|
||||
TotalItemCountTiles = $7ECB00 ; Cached total item count tiles for HUD. Four words high to low.
|
||||
|
||||
;================================================================================
|
||||
; Bank 7F
|
||||
|
||||
@@ -83,6 +83,7 @@ IncrementSmallKeys:
|
||||
JSL.l UpdateKeys
|
||||
PHY : LDY.b #24 : JSL.l FullInventoryExternal : PLY
|
||||
JSL.l HUD_RebuildLong
|
||||
INC.w UpdateHUD
|
||||
PLX
|
||||
RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
@@ -102,6 +103,7 @@ IncrementSmallKeysNoPrimary:
|
||||
PLP
|
||||
+
|
||||
JSL.l HUD_RebuildLong
|
||||
INC.w UpdateHUD
|
||||
PLX
|
||||
RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
|
||||
@@ -117,11 +117,6 @@ DrawChallengeTimer:
|
||||
LDA.w #$280C : STA.l HUDTileMapBuffer+$96
|
||||
RTL
|
||||
+
|
||||
LDA.w #$247F : STA.l HUDTileMapBuffer+$90
|
||||
STA.l HUDTileMapBuffer+$92
|
||||
STA.l HUDTileMapBuffer+$94
|
||||
STA.l HUDTileMapBuffer+$96
|
||||
++
|
||||
|
||||
LDA.l TimerStyle : BNE + : RTL : + ; Hud Timer
|
||||
LDA.w #$2807 : STA.l HUDTileMapBuffer+$92
|
||||
|
||||
@@ -101,6 +101,7 @@ DrawEquipment = $0DED29 ; returns short
|
||||
HUD_RebuildLong = $0DFA78
|
||||
HUD_RebuildIndoor_Palace = $0DFA88
|
||||
HUD_RebuildLong2 = $0DFA88
|
||||
RebuildHUD_update = $0DFAA5
|
||||
Messaging_Text = $0EEE10
|
||||
Overworld_TileAttr = $0FFD94
|
||||
Overworld_DrawPersistentMap16 = $1BC97C
|
||||
|
||||
Reference in New Issue
Block a user