Re-add accidentally deleted HUD stuff
Fix some processor flags
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
|
||||||
DrawDungeonCompassCounts:
|
DrawDungeonCompassCounts:
|
||||||
|
SEP #$10
|
||||||
LDX $1B : BNE + : RTL : + ; Skip if outdoors
|
LDX $1B : 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
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ DrHudOverride:
|
|||||||
|
|
||||||
HudAdditions:
|
HudAdditions:
|
||||||
{
|
{
|
||||||
|
SEP #$10
|
||||||
LDA.l DRFlags : AND #$0008 : BNE + : JMP .end_item_count : +
|
LDA.l DRFlags : AND #$0008 : BNE + : JMP .end_item_count : +
|
||||||
LDA.l TotalItemCounter : PHA : CMP #1000 : !BLT +
|
LDA.l TotalItemCounter : PHA : CMP #1000 : !BLT +
|
||||||
JSL HexToDec4Digit_fast
|
JSL HexToDec4Digit_fast
|
||||||
|
|||||||
@@ -72,11 +72,6 @@ SprItemIndex = $7E0750
|
|||||||
SprItemMWPlayer = $7E0760 ; 0x16
|
SprItemMWPlayer = $7E0760 ; 0x16
|
||||||
SprItemFlags = $7E0770 ; 0x16 (used for both pots and drops) (combine with SprDropsItem?)
|
SprItemFlags = $7E0770 ; 0x16 (used for both pots and drops) (combine with SprDropsItem?)
|
||||||
|
|
||||||
; 7F:6600-7F:684F ($250 or 592 bytes) for pots and 7F:6850-7F:6A9F ($250 or 592 bytes) for sprites
|
|
||||||
|
|
||||||
PotItemSRAM = $7F6600
|
|
||||||
SpriteItemSRAM = $7F6850
|
|
||||||
|
|
||||||
; todo: move sprites
|
; todo: move sprites
|
||||||
;org $09D62E
|
;org $09D62E
|
||||||
;UWSpritesPointers ; 0x250 bytes for 0x128 rooms' 16-bit pointers
|
;UWSpritesPointers ; 0x250 bytes for 0x128 rooms' 16-bit pointers
|
||||||
@@ -164,8 +159,8 @@ RevealPotItem:
|
|||||||
; set bit and count if first time lifting this pot
|
; set bit and count if first time lifting this pot
|
||||||
LDA.b $A0 : ASL : TAY
|
LDA.b $A0 : ASL : TAY
|
||||||
TXA : ASL : TAX : LDA.l BitFieldMasks, X : STA $0A
|
TXA : ASL : TAX : LDA.l BitFieldMasks, X : STA $0A
|
||||||
TYX : LDA.l PotItemSRAM, X : BIT $0A : BNE .obtained
|
TYX : LDA.l RoomPotData, X : BIT $0A : BNE .obtained
|
||||||
ORA $0A : STA PotItemSRAM, X
|
ORA $0A : STA RoomPotData, X
|
||||||
PLY : PHY
|
PLY : PHY
|
||||||
JSR ShouldCountNormalPot : BCC .obtained
|
JSR ShouldCountNormalPot : BCC .obtained
|
||||||
; increment dungeon counts
|
; increment dungeon counts
|
||||||
@@ -316,9 +311,9 @@ ShouldSpawnItem:
|
|||||||
TAX : LDA.l BitFieldMasks, X : STA $00
|
TAX : LDA.l BitFieldMasks, X : STA $00
|
||||||
PLX ; restore X again
|
PLX ; restore X again
|
||||||
LDA.w SprItemFlags, X : AND #$00FF : CMP #$0001 : BEQ +
|
LDA.w SprItemFlags, X : AND #$00FF : CMP #$0001 : BEQ +
|
||||||
TYX : LDA.l SpriteItemSRAM, X : BIT $00 : BEQ .notObtained
|
TYX : LDA.l SpritePotData, X : BIT $00 : BEQ .notObtained
|
||||||
BRA .obtained
|
BRA .obtained
|
||||||
+ TYX : LDA.l PotItemSRAM, X : BIT $00 : BEQ .notObtained
|
+ TYX : LDA.l RoomPotData, X : BIT $00 : BEQ .notObtained
|
||||||
.obtained
|
.obtained
|
||||||
SEP #$30 : PLY : PLX : LDA #$01 : RTL ; already obtained
|
SEP #$30 : PLY : PLX : LDA #$01 : RTL ; already obtained
|
||||||
.notObtained
|
.notObtained
|
||||||
@@ -333,8 +328,8 @@ MarkSRAMForItem:
|
|||||||
TAX : LDA.l BitFieldMasks, X : STA $00
|
TAX : LDA.l BitFieldMasks, X : STA $00
|
||||||
TYX
|
TYX
|
||||||
LDA.w SpawnedItemFlag : CMP #$0001 : BEQ +
|
LDA.w SpawnedItemFlag : CMP #$0001 : BEQ +
|
||||||
LDA SpriteItemSRAM, X : ORA $00 : STA SpriteItemSRAM, X : BRA .end
|
LDA SpritePotData, X : ORA $00 : STA SpritePotData, X : BRA .end
|
||||||
+ LDA PotItemSRAM, X : ORA $00 : STA PotItemSRAM, X
|
+ LDA RoomPotData, X : ORA $00 : STA RoomPotData, X
|
||||||
.end
|
.end
|
||||||
SEP #$30 : PLY : PLX
|
SEP #$30 : PLY : PLX
|
||||||
LDA.w $0403
|
LDA.w $0403
|
||||||
|
|||||||
58
newhud.asm
58
newhud.asm
@@ -1,8 +1,64 @@
|
|||||||
|
NewDrawHud:
|
||||||
|
SEP #$30
|
||||||
|
;================================================================================
|
||||||
|
; Draw bomb count
|
||||||
|
!BOMBCOUNT_DRAW_ADDRESS = "$7EC75A"
|
||||||
|
!INFINITE_BOMBS = "$7F50C9"
|
||||||
|
;================================================================================
|
||||||
|
|
||||||
|
LDA !INFINITE_BOMBS : BNE .infinite_bombs
|
||||||
|
.finite_bombs
|
||||||
|
LDA.l $7EF343 ; bombs
|
||||||
|
JSR HudHexToDec2Digit ;requires 8 bit registers!
|
||||||
|
REP #$20
|
||||||
|
LDX.b $06 : TXA : ORA.w #$2400 : STA !BOMBCOUNT_DRAW_ADDRESS ; Draw bombs 10 digit
|
||||||
|
LDX.b $07 : TXA : ORA.w #$2400 : STA !BOMBCOUNT_DRAW_ADDRESS+2 ; Draw bombs 1 digit
|
||||||
|
BRA +
|
||||||
|
|
||||||
|
.infinite_bombs
|
||||||
|
REP #$20
|
||||||
|
LDA.w #$2431 : STA !BOMBCOUNT_DRAW_ADDRESS ; infinity (left half)
|
||||||
|
INC A : STA !BOMBCOUNT_DRAW_ADDRESS+2 ; infinity (right half)
|
||||||
|
+
|
||||||
|
|
||||||
|
;================================================================================
|
||||||
|
; Draw rupee counter
|
||||||
|
!RUPEE_DRAW_ADDRESS = "$7EC750"
|
||||||
|
;================================================================================
|
||||||
|
|
||||||
|
LDA.l $7EF362 ; Drawing bombs (above) always ends with 16-bit A, so, no need to REP here
|
||||||
|
JSR HudHexToDec4Digit
|
||||||
|
LDX.b $04 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS ; 1000s
|
||||||
|
LDX.b $05 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS+2 ; 100s
|
||||||
|
LDX.b $06 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS+4 ; 10s
|
||||||
|
LDX.b $07 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS+6 ; 1s
|
||||||
|
|
||||||
|
;================================================================================
|
||||||
|
; Draw arrow count
|
||||||
|
!ARROWCOUNT_DRAW_ADDRESS = "$7EC760"
|
||||||
|
!INFINITE_ARROWS = "$7F50C8"
|
||||||
|
;================================================================================
|
||||||
|
|
||||||
|
SEP #$20
|
||||||
|
LDA.l ArrowMode : BNE +
|
||||||
|
LDA !INFINITE_ARROWS : BNE .infinite_arrows
|
||||||
|
.finite_arrows
|
||||||
|
LDA.l $7EF377 ; arrows
|
||||||
|
JSR HudHexToDec2Digit
|
||||||
|
REP #$20
|
||||||
|
LDX.b $06 : TXA : ORA.w #$2400 : STA !ARROWCOUNT_DRAW_ADDRESS ; Draw arrows 10 digit
|
||||||
|
LDX.b $07 : TXA : ORA.w #$2400 : STA !ARROWCOUNT_DRAW_ADDRESS+2 ; Draw arrows 1 digit
|
||||||
|
BRA +
|
||||||
|
|
||||||
|
.infinite_arrows
|
||||||
|
REP #$20
|
||||||
|
LDA.w #$2431 : STA !ARROWCOUNT_DRAW_ADDRESS ; infinity (left half)
|
||||||
|
INC A : STA !ARROWCOUNT_DRAW_ADDRESS+2 ; infinity (right half)
|
||||||
|
+
|
||||||
;================================================================================
|
;================================================================================
|
||||||
; Draw Goal Item Indicator
|
; Draw Goal Item Indicator
|
||||||
!GOAL_DRAW_ADDRESS = "$7EC72A"
|
!GOAL_DRAW_ADDRESS = "$7EC72A"
|
||||||
;================================================================================
|
;================================================================================
|
||||||
NewDrawHud:
|
|
||||||
REP #$20
|
REP #$20
|
||||||
LDA.l GoalItemRequirement : BNE + : JMP .done : + ; Star Meter
|
LDA.l GoalItemRequirement : BNE + : JMP .done : + ; Star Meter
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user