Heart colors

This commit is contained in:
cassidoxa
2023-08-13 13:46:21 -04:00
parent ad17c8e88d
commit aaf970b837
11 changed files with 189 additions and 70 deletions

View File

@@ -354,17 +354,34 @@ DrawPlayerFileShared:
++
; Heart Pieces
LDA.l HUDHeartColors_index : ASL : TAX
LDA.l EquipmentSRAM+$2B : AND.w #$00FF : BNE +
%fs_drawItem(9,26,FileSelectItems_heart_piece_0_of_4)
BRA ++
LDY.w #9*$20+26*2+$1004
LDA.w #$02C0 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0000, Y
LDA.w #$42C0 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0002, Y
LDA.w #$02D0 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0040, Y
LDA.w #$42D0 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0042, Y
JMP ++
+ : DEC : BNE +
%fs_drawItem(9,26,FileSelectItems_heart_piece_1_of_4)
BRA ++
LDY.w #9*$20+26*2+$1004
LDA.w #$02C1 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0000, Y
LDA.w #$42C0 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0002, Y
LDA.w #$02D0 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0040, Y
LDA.w #$42D0 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0042, Y
JMP ++
+ : DEC : BNE +
%fs_drawItem(9,26,FileSelectItems_heart_piece_2_of_4)
BRA ++
LDY.w #9*$20+26*2+$1004
LDA.w #$02C1 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0000, Y
LDA.w #$42C0 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0002, Y
LDA.w #$02D1 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0040, Y
LDA.w #$42D0 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0042, Y
JMP ++
+
%fs_drawItem(9,26,FileSelectItems_heart_piece_3_of_4)
LDY.w #9*$20+26*2+$1004
LDA.w #$02C1 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0000, Y
LDA.w #$42C1 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0002, Y
LDA.w #$02D1 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0040, Y
LDA.w #$42D0 : ORA.l HUDHeartColors_masks_file_select,X : STA.w $0042, Y
++
LDA.l EquipmentSRAM+$0130 : AND.w #$00FF
@@ -572,15 +589,6 @@ FileSelectItems:
.red_mail
dw #$02AF|!FS_COLOR_RED, #$02AF|!FS_COLOR_RED|!FS_HFLIP, #$02BF|!FS_COLOR_RED, #$02F5|!FS_COLOR_RED
.heart_piece_0_of_4
dw #$02C0|!FS_COLOR_RED, #$02C0|!FS_COLOR_RED|!FS_HFLIP, #$02D0|!FS_COLOR_RED, #$02D0|!FS_COLOR_RED|!FS_HFLIP
.heart_piece_1_of_4
dw #$02C1|!FS_COLOR_RED, #$02C0|!FS_COLOR_RED|!FS_HFLIP, #$02D0|!FS_COLOR_RED, #$02D0|!FS_COLOR_RED|!FS_HFLIP
.heart_piece_2_of_4
dw #$02C1|!FS_COLOR_RED, #$02C0|!FS_COLOR_RED|!FS_HFLIP, #$02D1|!FS_COLOR_RED, #$02D0|!FS_COLOR_RED|!FS_HFLIP
.heart_piece_3_of_4
dw #$02C1|!FS_COLOR_RED, #$02C1|!FS_COLOR_RED|!FS_HFLIP, #$02D1|!FS_COLOR_RED, #$02D0|!FS_COLOR_RED|!FS_HFLIP
.empty_bottle
dw #$0280|!FS_COLOR_BW, #$0281|!FS_COLOR_BW, #$0290|!FS_COLOR_BW, #$0291|!FS_COLOR_BW
.red_potion

View File

@@ -237,7 +237,7 @@ db $3D
org $8CD6BD ; <- Y position table for Death Counts
db $51
;--------------------------------------------------------------------------------
org $8CD55F : LDA.w #$0600 ; Hearts tile offset
org $8CD55F : JSL.l CheckHeartPaletteFileSelect : NOP #2
;================================================================================
; Name Entry Screen
@@ -1380,6 +1380,7 @@ JSL RNG_Enemy_Drops
org $8DFDCB
JSL UpdateHearts
RTS
org $8DF191 : JSL.l ColorAnimatedHearts : BRA + : NOP #7 : +
org $8DFC4C ; <- 6FC4C - headsup_display.asm : 836 (LDA $7EF36E : AND.w #$00FF : ADD.w #$0007 : AND.w #$FFF8 : TAX)
JML OnDrawHud : NOP #197 ; why? it's not hurting anyone lol
@@ -1417,11 +1418,16 @@ org $87A205
JSL.l RebuildHUD_update_long
org $8AEF62
JSL.l RebuildHUD_update_long
org $87A1CF
JSL.l RebuildHUD_update_long
;--------------------------------------------------------------------------------
org $8DFFE1
RebuildHUD_update_long:
JSR.w RebuildHUD_update : RTL
warnpc $8E8000
;--------------------------------------------------------------------------------
org $8DEDE8
JSL.l DrawHeartPiecesMenu : BRA DrawEquipment_in_a_dungeon
;================================================================================
; 300 Rupee NPC

View File

@@ -143,10 +143,10 @@ AddInventory:
PHK : PLB
LDA.b #$7E : STA.b Scrap0D
LDA.l StatsLocked : BNE .done
JSR.w ShopCheck : BCS .done
JSR.w DungeonIncrement : BCS .done
JSR.w IncrementByOne
LDA.w InventoryTable_properties,Y : BIT #$01 : BEQ .done
JSR.w ShopCheck : BCS .done
JSR.w DungeonIncrement
JSR.w IncrementByOne
JSR.w StampItem
SEP #$20
JSR.w IncrementYAItems
@@ -194,15 +194,14 @@ DungeonIncrement:
LDA.w InventoryTable_properties,Y : BIT.b #$40 : BEQ +
JSL.l CountChestKeyLong
+
LDA.b IndoorsFlag : BEQ .count
LDA.w InventoryTable_properties,Y : BIT #$01 : BEQ .count ; Skip prizes but continue checks in AddInventory
LDA.w DungeonID : BMI .count
LDA.b IndoorsFlag : BEQ .done
LDA.w DungeonID : BMI .done
CMP.l BallNChainDungeon : BNE +
CPY.b #$32 : BEQ .ballchain_bigkey
+
CMP.b #$04 : BCS +
LDA.l SewersLocations : INC : STA.l SewersLocations : STA.l HCLocations
BRA .count
BRA .done
+
LSR : TAX : LDA.l DungeonLocationsChecked, X : INC : STA.l DungeonLocationsChecked, X
CPX.b #$0D : BNE +
@@ -210,11 +209,7 @@ DungeonIncrement:
LDA.l PreGTBKLocations : INC : STA.l PreGTBKLocations
++
+
.count
CLC
RTS
.dont_count
SEC
.done
RTS
.ballchain_bigkey
LDA.l BigKeysBigChests
@@ -264,11 +259,13 @@ RTS
RTS
IncrementByOne:
REP #$20
LDA.w InventoryTable_stat,X : BEQ .skip
STA.b Scrap0B
SEP #$20
LDA.b #$01 : ADC.b [Scrap0B] : STA.b [Scrap0B]
.skip
SEP #$20
RTS
IncrementBossSword:
@@ -317,6 +314,21 @@ IncrementBossSword:
PLX
RTL
;--------------------------------------------------------------------------------
IncrementFinalSword:
PHX
REP #$20
LDA.w RoomIndex : BNE .done
SEP #$20
LDA.l SwordEquipment : CMP.b #$FF : BNE +
BRA IncrementBossSword_none
+
ASL : TAX
JMP.w (IncrementBossSword_vectors,X)
.done
SEP #$20
PLX
RTL
;--------------------------------------------------------------------------------
Link_ReceiveItem_HUDRefresh:
LDA.l BombsEquipment : BNE + ; skip if we have bombs

View File

@@ -54,7 +54,7 @@ endmacro
%ReceiptProps($1D, -4, 0, $0E, $F34E, $01, skip, skip) ; 1D - Book
%ReceiptProps($1E, -4, 0, $11, $F356, $01, skip, skip) ; 1E - Flippers
%ReceiptProps($1F, -4, 0, $17, $F357, $01, skip, skip) ; 1F - Pearl
%ReceiptProps($20, -4, 0, $28, $F37A, $FF, skip, skip) ; 20 - Crystal
%ReceiptProps($20, -4, 0, $28, $F37A, $FF, dungeon_crystal, skip) ; 20 - Crystal
%ReceiptProps($21, -4, 0, $27, $F34D, $01, skip, skip) ; 21 - Net
%ReceiptProps($22, -4, 0, $04, $F35B, $FF, blue_mail, skip) ; 22 - Blue mail
%ReceiptProps($23, -5, 0, $04, $F35B, $02, red_mail, skip) ; 23 - Red mail
@@ -77,9 +77,9 @@ endmacro
%ReceiptProps($34, -2, 4, $24, $F360, $FF, skip, skip) ; 34 - 1 rupee
%ReceiptProps($35, -2, 4, $24, $F360, $FF, skip, skip) ; 35 - 5 rupees
%ReceiptProps($36, -2, 4, $24, $F360, $EC, skip, skip) ; 36 - 20 rupees
%ReceiptProps($37, -4, 0, $23, $F374, $FF, skip, skip) ; 37 - Green pendant
%ReceiptProps($38, -4, 0, $39, $F374, $FF, skip, skip) ; 38 - Red pendant
%ReceiptProps($39, -4, 0, $39, $F374, $FF, skip, skip) ; 39 - Blue pendant
%ReceiptProps($37, -4, 0, $23, $F374, $FF, pendant, skip) ; 37 - Green pendant
%ReceiptProps($38, -4, 0, $39, $F374, $FF, pendant, skip) ; 38 - Red pendant
%ReceiptProps($39, -4, 0, $39, $F374, $FF, pendant, skip) ; 39 - Blue pendant
%ReceiptProps($3A, -4, 0, $29, $F340, $01, bow_and_arrows, skip) ; 3A - Bow And Arrows
%ReceiptProps($3B, -4, 0, $2A, $F340, $03, silver_bow, skip) ; 3B - Silver Bow
%ReceiptProps($3C, -4, 0, $2C, $F35C, $FF, skip, skip) ; 3C - Full bottle (bee)
@@ -609,7 +609,7 @@ endmacro
%InventoryItem($1D, $85, $0000, $0000) ; 1D - Book
%InventoryItem($1E, $89, $0000, $0000) ; 1E - Flippers
%InventoryItem($1F, $81, $0000, $0000) ; 1F - Pearl
%InventoryItem($20, $80, $0000, CrystalCounter) ; 20 - Crystal
%InventoryItem($20, $80, $0000, $0000) ; 20 - Crystal
%InventoryItem($21, $85, $0000, $0000) ; 21 - Net
%InventoryItem($22, $81, $0000, $0000) ; 22 - Blue mail
%InventoryItem($23, $81, $0000, $0000) ; 23 - Red mail
@@ -632,9 +632,9 @@ endmacro
%InventoryItem($34, $01, $0000, $0000) ; 34 - 1 rupee
%InventoryItem($35, $01, $0000, $0000) ; 35 - 5 rupees
%InventoryItem($36, $01, $0000, $0000) ; 36 - 20 rupees
%InventoryItem($37, $00, $0000, PendantCounter) ; 37 - Green pendant
%InventoryItem($38, $00, $0000, PendantCounter) ; 38 - Red pendant
%InventoryItem($39, $00, $0000, PendantCounter) ; 39 - Blue pendant
%InventoryItem($37, $00, $0000, $0000) ; 37 - Green pendant
%InventoryItem($38, $00, $0000, $0000) ; 38 - Red pendant
%InventoryItem($39, $00, $0000, $0000) ; 39 - Blue pendant
%InventoryItem($3A, $A5, $0000, $0000) ; 3A - Bow And Arrows
%InventoryItem($3B, $A5, $0000, $0000) ; 3B - Silver Bow
%InventoryItem($3C, $85, $0000, $0000) ; 3C - Full bottle (bee)
@@ -753,13 +753,13 @@ endmacro
%InventoryItem($AD, $41, $0000, SmallKeyCounter) ; AD - Small key of Ganon's Tower
%InventoryItem($AE, $01, $0000, $0000) ; AE - Reserved
%InventoryItem($AF, $01, $0000, SmallKeyCounter) ; AF - Generic small key
%InventoryItem($B0, $81, $0000, CrystalCounter) ; B0 - Crystal 6
%InventoryItem($B1, $81, $0000, CrystalCounter) ; B1 - Crystal 1
%InventoryItem($B2, $81, $0000, CrystalCounter) ; B2 - Crystal 5
%InventoryItem($B3, $81, $0000, CrystalCounter) ; B3 - Crystal 7
%InventoryItem($B4, $81, $0000, CrystalCounter) ; B4 - Crystal 2
%InventoryItem($B5, $81, $0000, CrystalCounter) ; B5 - Crystal 4
%InventoryItem($B6, $81, $0000, CrystalCounter) ; B6 - Crystal 3
%InventoryItem($B0, $81, $0000, $0000) ; B0 - Crystal 6
%InventoryItem($B1, $81, $0000, $0000) ; B1 - Crystal 1
%InventoryItem($B2, $81, $0000, $0000) ; B2 - Crystal 5
%InventoryItem($B3, $81, $0000, $0000) ; B3 - Crystal 7
%InventoryItem($B4, $81, $0000, $0000) ; B4 - Crystal 2
%InventoryItem($B5, $81, $0000, $0000) ; B5 - Crystal 4
%InventoryItem($B6, $81, $0000, $0000) ; B6 - Crystal 3
%InventoryItem($B7, $01, $0000, $0000) ; B7 - Reserved
%InventoryItem($B8, $01, $0000, $0000) ; B8 -
%InventoryItem($B9, $01, $0000, $0000) ; B9 -

View File

@@ -64,10 +64,8 @@ NewHUD_DrawArrows:
;================================================================================
NewHUD_DrawGoal:
LDA.w UpdateHUD : BEQ .no_goal
REP #$20
LDA.w UpdateHUD : BEQ .no_goal
LDA.l GoalItemRequirement : BEQ .no_goal
LDA.l GoalItemIcon : STA.w HUDGoalIndicator
@@ -390,9 +388,7 @@ RTL
;================================================================================
UpdateHearts:
PHB
REP #$20
SEP #$10
LDX.b #$7E
@@ -418,7 +414,7 @@ UpdateHearts:
CPX.b #$01
BMI .done_hearts
LDA.w #$24A0
JSR.w CheckHeartPalette
CPY.b #$01
BPL .add_heart
@@ -459,13 +455,13 @@ UpdateHearts:
BEQ .skip_partial
CMP.w #$0005
LDA.w #$24A0
JSR.w CheckHeartPalette
BCS .more_than_half
INC
.more_than_half
STA.b ($09)
.skip_partial
@@ -473,3 +469,30 @@ UpdateHearts:
PLB
RTL
CheckHeartPaletteFileSelect:
LDA.l HUDHeartColors_index : ASL : TAX
LDA.l HUDHeartColors_masks_file_select,X
ORA.w #$0200
LDX.w #$000A
RTL
CheckHeartPalette:
PHX
LDA.l HUDHeartColors_index : ASL : TAX
LDA.l HUDHeartColors_masks_game_hud,X
ORA.w #$20A0
PLX
RTS
ColorAnimatedHearts:
REP #$20
LDA.l HUDHeartColors_index : ASL : TAX
LDA.l HUDHeartColors_masks_game_hud,X
ORA.l HeartFramesBaseTiles,X
STA.b [Scrap00],Y
SEP #$20
RTL
HeartFramesBaseTiles:
dw $20A3, $20A4, $20A3, $20A0

View File

@@ -539,7 +539,8 @@ ItemBehavior:
.generic_smallkey
LDA.l GenericKeys : BEQ .normal
LDA.l CurrentSmallKeys : INC : STA.l CurrentSmallKeys
LDA.l CurrentSmallKeys : INC
STA.l CurrentGenericKeys : STA.l CurrentSmallKeys
RTS
.normal
LDA.w DungeonID : BMI +
@@ -592,6 +593,16 @@ ItemBehavior:
JSL MaybeFlagCompassTotalPickup
RTS
.pendant
SEP #$20
LDA.l PendantCounter : INC : STA.l PendantCounter
RTS
.dungeon_crystal
SEP #$20
LDA.l CrystalCounter : INC : STA.l CrystalCounter
RTS
.free_crystal
REP #$20
LSR
@@ -604,6 +615,7 @@ ItemBehavior:
BPL -
SEP #$20
ORA.l CrystalsField : STA.l CrystalsField
LDA.l CrystalCounter : INC : STA.l CrystalCounter
.done
RTS

View File

@@ -111,7 +111,7 @@ CheckCloseItemMenu:
LDA.l MenuCollapse : BNE +
LDA.b Joy1A_New : AND.b #$10 : RTL
+
LDA.b Joy1A_All : AND.b #$10 : EOR.b #$10
LDA.b Joy1A_All : EOR.b #$10
RTL
;================================================================================
ShowDungeonItems:
@@ -630,3 +630,38 @@ RestoreMenu_SetSubModule:
LDA.b #$03 : STA.w SubModuleInterface
RTL
;-------------------------------------------------------------------------------
DrawHeartPiecesMenu:
LDA.l HUDHeartColors_index : AND.w #$00FF
ASL : TAX
LDA.l HUDHeartColors_masks_game_hud,X
STA.b Scrap0D
LDA.l HeartPieceQuarter : AND.w #$00FF
ASL #3 : TAX
LDY.w #$16F2
LDA.l HeartPieceMenuBaseTiles,X
ORA.b Scrap0D
STA.w $0000,Y
INX #2
LDA.l HeartPieceMenuBaseTiles,X
ORA.b Scrap0D
STA.w $0002,Y
INX #2
LDA.l HeartPieceMenuBaseTiles,X
ORA.b Scrap0D
STA.w $0040,Y
INX #2
LDA.l HeartPieceMenuBaseTiles,X
ORA.b Scrap0D
STA.w $0042,Y
RTL
HeartPieceMenuBaseTiles:
dw $2084, $6084, $2085, $6085 ; 0 heart pieces
dw $20AD, $6084, $2085, $6085 ; 1 heart piece
dw $20AD, $6084, $20AE, $6085 ; 2 heart pieces
dw $20AD, $60AD, $20AE, $6085 ; 3 heart pieces

View File

@@ -130,8 +130,11 @@ SpritePrep_ShopKeeper:
PLY : +++
PHX : PHY
PHX : TYX : LDA.l ShopInventory, X : PLX : TAY
REP #$20 ; set 16-bit accumulator
PHX : TYX : LDA.l ShopInventory, X : PLX
SEP #$10
JSL.l ResolveLootIDLong
TAY
REP #$30
LDA.b 1,s : TAX : LDA.l .tile_offsets, X : TAX
JSR LoadTile
PLY : PLX
@@ -548,6 +551,8 @@ Shopkeeper_DrawNextItem:
PLY
LDA.l ShopInventory, X ; get item id
JSL.l ResolveLootIDLong
STA.b Scrap0D
CMP.b #$2E : BNE + : BRA .potion
+ CMP.b #$2F : BNE + : BRA .potion
+ CMP.b #$30 : BEQ .potion
@@ -565,14 +570,14 @@ Shopkeeper_DrawNextItem:
STA.l SpriteOAM+4
LDA.l ShopInventory, X
LDA.b Scrap0D
PHX
JSL.l GetSpritePalette_resolved : STA.l SpriteOAM+5
PLX
LDA.b #$00 : STA.l SpriteOAM+6
LDA.l ShopInventory, X
LDA.b Scrap0D
PHX
TAX
LDA.l SpriteProperties_standing_width,X : BEQ .narrow

View File

@@ -342,7 +342,7 @@ StatsFinalPrep:
LDA.l StatsLocked : BNE .ramPostOnly
INC : STA.l StatsLocked
JSL.l IncrementBossSword
JSL.l IncrementFinalSword
LDA.l HighestMail : INC : STA.l HighestMail ; add green mail to mail count

View File

@@ -2572,12 +2572,29 @@ org $B0F000 ; PC 0x187000-0x18700F
CompassTotalsROM:
db $08, $08, $06, $06, $02, $0A, $0E, $08, $08, $08, $06, $08, $0C, $1B, $00, $00
org $30F010
org $B0F010
ChestKeys: ; PC 0x187010-0x18701F
db $01, $01, $00, $01, $02, $01, $06, $03, $03, $02, $01, $01, $04, $04, $00, $00
org $B0F020
HUDHeartColors: ; PC 0x187020
.index ; $00 = Red | $01 = Blue | $02 = Green | $03 = Yellow
dw #$0000
.masks_game_hud ; PC 0x187022
dw #$0400 ; Red
dw #$0C00 ; Blue
dw #$1C00 ; Green
dw #$0800 ; Yellow
.masks_file_select ; PC 0x18702A
dw #$0400 ; Red
dw #$0C00 ; Blue
dw #$1800 ; Green
dw #$0800 ; Yellow
org $B0F032
;--------------------------------------------------------------------------------
; 0x187010 - 187FFF (unused)
; 0x187032 - 187FFF (unused)
;--------------------------------------------------------------------------------
@@ -2674,18 +2691,18 @@ dw $FFFF
org $8ABE76
WorldMapIcon_tile:
db $38, $62 ; green pendant
db $32, $60 ; red pendant
db $34, $60 ; blue pendant
db $34, $64 ; crystal
db $38, $62 ; green pendant ; Eastern Palace
db $32, $60 ; red pendant ; Hera
db $34, $60 ; blue pendant ; Desert
db $34, $64 ; crystal ; PoD
db $34, $64 ; crystal
db $34, $64 ; crystal
db $34, $64 ; crystal
db $34, $64 ; crystal
db $34, $64 ; crystal ; Skull Woods
db $34, $64 ; crystal ; Turtle Rock
db $34, $64 ; crystal ; Thieves Town
db $34, $64 ; crystal ; Misery Mire
db $34, $64 ; crystal
db $34, $64 ; crystal
db $34, $64 ; crystal ; Ice Palace
db $34, $64 ; crystal ; Swamp Palace
db $32, $66 ; skull looking thing
db $00, $00 ; red x

View File

@@ -156,6 +156,7 @@ ItemMenu_DrawEquippedYItem = $8DEB3A
ItemMenu_DrawEquippedYItem_exit = $8DECE6
ItemMenu_DrawEquipment_dungeonitems = $8DEDCC
DrawEquipment = $8DED29
DrawEquipment_in_a_dungeon = $8DEDFE
UpdateHUDBuffer_update_item_check_arrows = $8DFB41
RenderText_DecompressAndDrawSingle = $8EF4FB
DecompressFontGFX = $8EF572