Add SecretObject to object_handler

To be used with Book of Secrets to allow for special objects which react to the item
This commit is contained in:
scawful
2024-03-30 23:14:19 -04:00
parent 34334bc30c
commit 33cec3b1d2

View File

@@ -1,30 +1,52 @@
; =========================================================
; Dungeon Object Handler ; Dungeon Object Handler
org $018262 ;object id 0x31 org $018262
dw ExpandedObject dw ExpandedObject ; Object ID 0x31
dw SecretObject ; Object ID 0x32
; #_018650: dw RoomDraw_WeirdUglyPot ID 230 ; #_018650: dw RoomDraw_WeirdUglyPot ID 230
org $018650 org $018650
dw HeavyPot dw HeavyPot
; Item ID 22B
; Heavy Pot grahics
; Currently modified to look like normal pot
org $00A9AC
dw $0D28, $0D38, $4D28, $4D38
; org $01B306 ; RoomDraw_WeirdGloveRequiredPot
; LDA.w #$1010
; Bank01 Free Space ; Bank01 Free Space
org $01B53C org $01B53C
ExpandedObject: ExpandedObject:
{
JSL NewObjectsCode JSL NewObjectsCode
RTS RTS
}
SecretObject:
{
JSL HandleSecretObjects
RTS
}
HeavyPot: HeavyPot:
{
LDA.w #$1010 LDA.w #$1010
PHX : LDX.w $042C PHX : LDX.w $042C
LDA.w #$1111 : STA $0500, X LDA.w #$1111 : STA $0500, X
; Store this object's position in the object buffer to $0520, X ; Store object's position in the object buffer to $0520, X
LDA $BA : STA $0520, X LDA $BA : STA $0520, X
; Store it's tilemap position. ; Store tilemap position.
TYA : STA $0540, X TYA : STA $0540, X
JMP $B350 JMP $B350
}
warnpc $01B560 warnpc $01B560
; =========================================================
org $2C8000 org $2C8000
NewObjectsCode: NewObjectsCode:
{ {
@@ -132,16 +154,13 @@ NewObjectsCode:
incbin Data/small_statue.bin incbin Data/small_statue.bin
} }
; May need to make this a table ; May need to make this a table
; This modifies object 0xOE to use the spritesheets for the object ; This modifies object 0xOE to use the spritesheets for the object
CustomDrawConfig: CustomDrawConfig:
{ {
PHA PHA
LDA $03 : AND #$00FF : CMP.w #$000E : BEQ .custom_config LDA $03 : AND #$00FF : CMP.w #$000E : BEQ .custom_config
TYA : LSR : AND #$00FF TYA : LSR : AND #$00FF
CMP #$000E : BNE .no_spriteset CMP #$000E : BNE .no_spriteset
LDA #$000E : STA $03 LDA #$000E : STA $03
.custom_config .custom_config
@@ -153,11 +172,16 @@ CustomDrawConfig:
RTS RTS
} }
; =========================================================
; Secret Object Handler
; Disappears if Link uses the Book of Secrets near them
HandleSecretObjects:
{
; TODO: Implement the Book of Secrets check
; TODO: Add object draw code
; TODO: Implement the object's disappearance
RTL
}
pushpc pushpc
; Item ID 22B
org $00A9AC
dw $0D28, $0D38, $4D28, $4D38
; org $01B306 ; RoomDraw_WeirdGloveRequiredPot
; LDA.w #$1010