Add new custom object handler for id 0x32

This commit is contained in:
scawful
2024-05-01 08:01:49 -04:00
parent 8efb24fa3c
commit 8a67cfa88a

View File

@@ -3,6 +3,9 @@
org $018262 ;object id 0x31 org $018262 ;object id 0x31
dw ExpandedObject dw ExpandedObject
org $018264
dw ExpandedObject2
; #_018650: dw RoomDraw_WeirdUglyPot ID 230 ; #_018650: dw RoomDraw_WeirdUglyPot ID 230
org $018650 org $018650
dw HeavyPot dw HeavyPot
@@ -13,6 +16,10 @@ org $01B53C
JSL NewObjectsCode JSL NewObjectsCode
RTS RTS
ExpandedObject2:
JSL NewObjectsCode2
RTS
HeavyPot: HeavyPot:
LDA.w #$1010 LDA.w #$1010
PHX : LDX.w $042C PHX : LDX.w $042C
@@ -153,6 +160,73 @@ CustomDrawConfig:
RTS RTS
} }
NewObjectsCode2:
{
PHB : PHK : PLB
PHX
STZ $03 ; 03 will be used to store the object ID for custom config
LDA $00 : PHA
LDA $02 : PHA
; $00 Will be used for tile count and tile to skip
LDA $B2 : ASL #2 : ORA $B4
;get the offset for the object data based on the object height
ASL : TAX
LDA .ObjOffset, X
TAX
.lineLoop
LDA .ObjData, X : BNE .continue
;break
BRA .Done
.continue
PHY ; Keep current position in the buffer
STA $00 ; we save the tile count + tile to skip
-- ;Tiles Loop
INX : INX
; Vhopppcc cccccccc
LDA .ObjData, X : BEQ +
STA [$BF], Y
+
INY : INY
LDA $00 : DEC : STA $00 : AND #$001F : BNE +
LDA $00 : XBA : AND #$00FF : STA $00
PLA ;Pull back position
CLC : ADC $00 : TAY
INX : INX
BRA .lineLoop
+
BRA --
.Done
PLA : STA $02
PLA : STA $00 ;Not sure if needed
PLX
PLB
RTL
.ObjOffset
dw .IceFurnace-.ObjData ; 00
dw .Firewood-.ObjData ; 01
dw .IceChair-.ObjData ; 02
.ObjData
.IceFurnace
incbin Data/furnace.bin
.Firewood
incbin Data/firewood.bin
.IceChair
incbin Data/ice_chair.bin
}
pushpc pushpc
; Item ID 22B ; Item ID 22B