NPC icon for NPC requiring item turnin; include standing items in loot

HUD as well
This commit is contained in:
2026-05-27 23:01:02 -05:00
parent 05172929a3
commit 85ea4477d2
13 changed files with 206 additions and 49 deletions

View File

@@ -6,6 +6,7 @@
!DTile = $2D60
!BlueSquare = $2C5E
!BossIcon = $253C
!NPCIcon = $253B
DrHudOverride:
PHB
@@ -30,6 +31,13 @@ DRHUD_DrawIndicators:
LDA.b FrameCounter : AND.b #$10 : BEQ DRHUD_EnemyDropIndicator
DRHUD_BossIndicator:
LDA.w DungeonID : CMP.b #$FF : BNE .in_dungeon
LDA.w NpcItemIndicator : BEQ .early_exit
LDA.l ShowLootInHUD : BEQ .early_exit
REP #$10
LDY.w #!NPCIcon : STY.w HUDMultiIndicator
JMP DRHUD_Finished
.in_dungeon
LDA.l DRMode : BNE .continue
.early_exit
REP #$10

View File

@@ -71,13 +71,16 @@ CheckLoot:
+
LDA.l ItemSources : BIT.w #$0008 : BEQ +
JSR CheckBoss
JSR CheckMisc
JSR CheckMisc2
+
LDA.l ItemSources : BIT.w #$0010 : BEQ +
JSR CheckPrize
+
JSR CheckNpcs
.done
PLA : STA.b $0E
PLA : STA.b $06
@@ -133,25 +136,22 @@ CheckChests:
.done
RTS
CheckBoss:
; we assume all bosses are in section 1 of split sections
; mainly to simplify hera cage key and GT torch
; which use the same flow
; and bosses are always in their own section anyway
CheckMisc:
; this includes bosses, bonk torches, and standing items (in caves + hera cage key)
; all dungeon items in this section are in section 1 of split sections
; for cave items we'll always know what section we're in
; but for dungeon items, we won't have a section specified in door rando
; so if we don't have a section, assume it's 1, and it'll match all the dungeon items anyway
LDA.b $CA
AND.w #$F000
XBA
CMP.w #$0020
BCC +
RTS
BIT.w #$F000
BNE +
ORA.w #$1000
+
LDA.b $CA
AND.w #$01FF
AND.w #$F1FF
STA.b $04
LDX.w #$FFFA
.next_boss
.next_misc
INX #6
LDA.l MiscLocations, X
BPL .check
@@ -159,9 +159,10 @@ CheckBoss:
.check
CMP.b $04
BNE .next_boss
BNE .next_misc
TXY
AND.w #$01FF
CMP.b RoomIndex
BEQ .current_room
@@ -186,7 +187,7 @@ CheckBoss:
TYX
BIT.b $04
BNE .next_boss ; continue checking if we already got the item
BNE .next_misc ; continue checking if we already got the item
LDA.l MiscLocations+4, X
STA.b $05
@@ -198,7 +199,24 @@ CheckBoss:
AND.w #$00FF
JSR GetLootClass
BRA .next_boss
BRA .next_misc
CheckMisc2:
; this currently only includes the library and Uncle
; so let's just hard-code them for now
LDA.b $CA
CMP.w #$2107 : BNE +
LDA.l NpcFlags : AND.w #$0080 : BNE +
LDA.l LibraryItem : AND.w #$00FF : JSR GetLootClass
+
LDA.b $CA
CMP.w #$1055 : BNE +
LDA.l ProgressFlags : AND.w #$0001 : BNE +
LDA.l UncleItem : AND.w #$00FF : JSR GetLootClass
+
RTS
CheckPrize:
LDA.b $CA
@@ -236,6 +254,41 @@ CheckPrize:
BRA .next_prize
CheckNpcs:
LDA.b $CA
LDX.w #$FFFA
.next_npc
INX #6
LDA.l NpcItems, X
BMI .nope
CMP.b $CA
BNE .next_npc
LDA.l NpcItems+3, X ; get location of data to check
STA.b $05
LDA.l NpcItems+2, X
STA.b $04
LDA.b [$04]
AND.w #$00FF
AND.l NpcItems+5, X
BNE .next_npc
.yep
LDA.w NpcItemIndicator
ORA.w #$0001
STA.w NpcItemIndicator
RTS
.nope
LDA.w NpcItemIndicator
AND.w #$FF00
STA.w NpcItemIndicator
RTS
CheckPots:
LDA.b $CA
AND.w #$01FF

View File

@@ -78,7 +78,7 @@ SplitRooms:
%d(.no) : %d(.no) : %d(.no) : %d(.11b) : %d(.11c) : %d(.no) : %d(.11e) : %d(.11f)
; 120
%d(.120) : %d(.no) : %d(.122) : %d(.no) : %d(.124) : %d(.125) : %d(.126) : %d(.no)
%d(.120) : %d(.no) : %d(.122) : %d(.no) : %d(.124) : %d(.125) : %d(.126) : %d(.127)
.no
db $00
@@ -909,3 +909,21 @@ db $02
db $03
db $04
db $FF
.127 ; Hammer Pegs Cave (1) // Fake Dark Lake Hylia Spike Hint Cave (2)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(.no_items) : %d(..pots) : %d(.no_items)
..areas
db $03, $80, $FF, $00, $FF
db $FF
..doors
db $08
db $FF
..pots
db $04
db $05
db $06
db $07
db $FF

View File

@@ -150,7 +150,10 @@ DrawFullRoomTile:
RTL
DrawSingleRoomLoot:
PHX : PHY
LDA.l ShowLootOnMap : AND.w #$00FF : BNE +
RTL
+ PHX : PHY
TYX

View File

@@ -32,6 +32,9 @@ DrawLoot:
LDA.l DRMode
BNE .skip
LDA.l ShowLootOnMap
BEQ .skip
REP #$30
PHX : PHY

View File

@@ -2,8 +2,25 @@ pushpc
org $828C73
JSL EnterRoom
NOP
org $86C0AB
JSL CollectHeartPieceAndUpdate
org $86D1A8
JSL SetDeathFlagAndUpdate
pullpc
SetDeathFlagAndUpdate:
JSL UpdateLootHUD
JSL Sprite_ManuallySetDeathFlagUW
RTL
CollectHeartPieceAndUpdate:
JSL $85F018
JSL UpdateLootHUD
RTL
ClearLootHUD:
LDA.b GameMode
CMP.b #$07

View File

@@ -73,29 +73,32 @@ warnpc $B9FA00
org $B9FA00
; Room ID mappings to bit to check for presence and address of item drop
MiscLocations:
dw $00C8 : db $04 : dl HeartContainer_ArmosKnights
dw $0033 : db $04 : dl HeartContainer_Lanmolas
dw $0007 : db $04 : dl HeartContainer_Moldorm
dw $10C8 : db $04 : dl HeartContainer_ArmosKnights
dw $1033 : db $04 : dl HeartContainer_Lanmolas
dw $1007 : db $04 : dl HeartContainer_Moldorm
dw $005A : db $04 : dl HeartContainer_HelmasaurKing
dw $0006 : db $04 : dl HeartContainer_Arrghus
dw $0029 : db $04 : dl HeartContainer_Mothula
dw $00AC : db $04 : dl HeartContainer_Blind
dw $00DE : db $04 : dl HeartContainer_Kholdstare
dw $0090 : db $04 : dl HeartContainer_Vitreous
dw $00A4 : db $04 : dl HeartContainer_Trinexx
dw $105A : db $04 : dl HeartContainer_HelmasaurKing
dw $1006 : db $04 : dl HeartContainer_Arrghus
dw $1029 : db $04 : dl HeartContainer_Mothula
dw $10AC : db $04 : dl HeartContainer_Blind
dw $10DE : db $04 : dl HeartContainer_Kholdstare
dw $1090 : db $04 : dl HeartContainer_Vitreous
dw $10A4 : db $04 : dl HeartContainer_Trinexx
dw $0073 : db $05 : dl BonkKey_Desert ; torch
dw $008C : db $05 : dl BonkKey_GTower ; torch
dw $0087 : db $05 : dl StandingKey_Hera
dw $1073 : db $05 : dl BonkKey_Desert ; torch
dw $108C : db $05 : dl BonkKey_GTower ; torch
dw $1087 : db $05 : dl StandingKey_Hera ; investigate
dw $10E1 : db $06 : dl HeartPiece_Forest_Thieves
dw $10E2 : db $06 : dl HeartPiece_Lumberjack_Tree
dw $10EA : db $05 : dl HeartPiece_Spectacle_Cave
dw $111B : db $06 : dl HeartPiece_Graveyard_Warp
dw $211B : db $05 : dl HeartPiece_Circle_Bushes
dw $111E : db $05 : dl RupeeNPC_NortheastDarkSwampCave
dw $1123 : db $05 : dl RupeeNPC_MoldormCave
dw $1126 : db $06 : dl HeartPiece_Mire_Warp
dw $1127 : db $05 : dl HeartPiece_Smith_Pegs
dw $FFFF : db $FF : dl $FFFFFF ; Placeholders
dw $FFFF : db $FF : dl $FFFFFF
dw $FFFF : db $FF : dl $FFFFFF ; Aga 1? ($0020)
dw $FFFF : db $FF : dl $FFFFFF ; Ice Armos? ($001C)
dw $FFFF : db $FF : dl $FFFFFF ; Lanmolas 2? ($0033)
dw $FFFF : db $FF : dl $FFFFFF ; Moldorm 2? ($004D)
dw $FFFF : db $FF : dl $FFFFFF ; Aga 2? ($000D)
dw $FFFF
warnpc $B9FA9A
@@ -128,7 +131,7 @@ pad $B9FB00
; $B9FB00
DungeonLabels:
dw $2550, $2579 ; Sewers
dw $25A4, $2579 ; Sewers
dw $2564, $255F ; Hyrule Castle
dw $2561, $256C ; Eastern Palace
dw $2560, $256C ; Desert Palace
@@ -165,6 +168,25 @@ dw $2952 ; 0E - triforce piece
dw $295B ; 0F - triforce
; $B9FB60
NpcItems:
dw $10E3 : dl $7EF411 : db $80 ; Magic Bat
dw $1102 : dl $7EF410 : db $04 ; Sick Kid
dw $1105 : dl $7EF410 : db $10 ; Sahasrahla
dw $1109 : dl $7EF411 : db $20 ; Potion Shop
dw $1121 : dl $7EF411 : db $04 ; Blacksmith
dw $FFFF
warnpc $B9FBA0
padbyte $FF
pad $B9FBA0
; $B9FBA0
; Currently these two are hard-coded checks
; but maybe that will change if more show up someday?
MiscLocations2:
dw $1055 : dw $7EF3C6 : db $01 : dl UncleItem
dw $2107 : dw $7EF410 : db $80 : dl LibraryItem
dw $FFFF
warnpc $B9FE00
org $B9FE00
@@ -231,5 +253,9 @@ AlwaysShowCompass:
db $01
; $B9FF12
ShowLootOnMap:
db $01
; $B9FF13
ShowLootInHUD:
db $01

View File

@@ -1117,7 +1117,8 @@ JSL CompareBombsToMax : NOP #11
org $85FC7E ; <- 2FC7E - sprite_dash_item.asm : 118 (LDA $7EF36F : INC A : STA $7EF36F)
JSL GiveBonkItem : NOP #5
org $85FC97 ; <- 2FC97 - sprite_dash_item.asm : 126 (LDA.b #$2F : JSL Sound_SetSfx3PanLong)
NOP #6
JSL UpdateLootHUD
NOP #2
;--------------------------------------------------------------------------------
org $868D39 ; <- 30D39 - sprite_prep.asm : 1435 - (LDA.b #$08 : STA $0F50, X)
JSL LoadBonkItemGFX
@@ -1643,7 +1644,8 @@ JSL FixAga2Bunny : NOP
; Open Mode Fixes
;--------------------------------------------------------------------------------
org $85DF65 ; <- 2DF65 - sprite_uncle_and_priest.asm:994 - (LDA.b #$01 : STA $7EF3C5)
NOP #6
JSL UpdateLootHUD
NOP #2
;--------------------------------------------------------------------------------
org $85EDDF ; <- 2EDDF - sprite_zelda.asm:398 - (LDA.b #$02 : STA $7EF3C5)
JSL EndRainState : NOP #2
@@ -2758,6 +2760,13 @@ JSL MimicDirection
org $828068
JSL AdjustDefaultGraphics
;================================================================================
;--------------------------------------------------------------------------------
; Remove Overwriting HUD gfx on game over
;--------------------------------------------------------------------------------
org $809038
RTS
;================================================================================
;--------------------------------------------------------------------------------
; Dungeon Indicator VRAM overwrite

Binary file not shown.

Binary file not shown.

View File

@@ -90,11 +90,17 @@ ItemSet_FairySword:
RTL
ItemSet_SmithSword:
PHA : LDA.l NpcFlags+1 : ORA.b #$04 : STA.l NpcFlags+1 : PLA
PHA
LDA.l NpcFlags+1 : ORA.b #$04 : STA.l NpcFlags+1
JSL UpdateLootHUD
PLA
RTL
ItemSet_MagicBat:
PHA : LDA.l NpcFlags+1 : ORA.b #$80 : STA.l NpcFlags+1 : PLA
PHA
LDA.l NpcFlags+1 : ORA.b #$80 : STA.l NpcFlags+1
JSL UpdateLootHUD
PLA
RTL
ItemSet_OldMan:
@@ -110,7 +116,10 @@ RTL
ItemSet_SickKid:
PHA : LDA.l SickKidItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL Link_ReceiveItem ; thing we wrote over
PHA : LDA.l NpcFlags : ORA.b #$04 : STA.l NpcFlags : PLA
PHA
LDA.l NpcFlags : ORA.b #$04 : STA.l NpcFlags
JSL UpdateLootHUD
PLA
RTL
ItemSet_TreeKid:
@@ -122,7 +131,10 @@ RTL
ItemSet_Sahasrala:
PHA : LDA.l SahasralaItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL Link_ReceiveItem ; thing we wrote over
PHA : LDA.l NpcFlags : ORA.b #$10 : STA.l NpcFlags : PLA
PHA
LDA.l NpcFlags : ORA.b #$10 : STA.l NpcFlags
JSL UpdateLootHUD
PLA
RTL
ItemSet_Catfish:
@@ -132,7 +144,10 @@ RTL
ItemSet_Library:
PHA : LDA.l LibraryItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL Link_ReceiveItem ; thing we wrote over
PHA : LDA.l NpcFlags : ORA.b #$80 : STA.l NpcFlags : PLA
PHA
LDA.l NpcFlags : ORA.b #$80 : STA.l NpcFlags
JSL UpdateLootHUD
PLA
RTL
ItemSet_Mushroom:
@@ -149,7 +164,10 @@ ItemSet_Mushroom:
RTL
ItemSet_Powder:
PHA : LDA.l NpcFlags+1 : ORA.b #$20 : STA.l NpcFlags+1 : PLA
PHA
LDA.l NpcFlags+1 : ORA.b #$20 : STA.l NpcFlags+1
JSL UpdateLootHUD
PLA
RTL
;================================================================================

View File

@@ -338,6 +338,7 @@ SpawnedItemFlag = $7E0726 ; 0x02 - one for pot, 2 for sprite drop
SpawnedItemMWPlayer = $7E0728 ; Player Id for spawned item if Multiworld item 0x02
;
EnemyDropIndicator = $7E072A ; Used by HUD to indicate enemy drops remaining
NpcItemIndicator = $7E072C ; Flag used by HUD to indicate NPC item present
SkipBeeTrapDisguise = $7E072D ; Flag to skip bee trap disguise during draw routine
SprDropsItem = $7E0730 ; Array for whether a sprite drops an item 0x16

View File

@@ -292,6 +292,7 @@ EntranceData_song = $82D592
SpawnPointData_room_id = $82D8D2
Overworld_CheckForSpecialOverworldTrigger_Direction = $84E879
RoomHeaderPointers = $84F1E2
UncleItem = $85DF45
Sprite_ShowSolicitedMessage_Direction = $85E1A3
FluteMenuNumbers_bits = $8AB7A3
WorldMap_RedXChars = $8ABF70