From 192f718eb092cda00ec82f48a365e7e95544b96e Mon Sep 17 00:00:00 2001 From: scawful Date: Thu, 7 Sep 2023 19:38:43 -0400 Subject: [PATCH] Add minecart track objects, housekeeping --- Dungeons/Objects/object_handler.asm | 88 +++++++++++++++++++++++++++ Dungeons/Objects/track_LR.bin | Bin 0 -> 14 bytes Dungeons/Objects/track_UD.bin | Bin 0 -> 14 bytes Dungeons/Objects/track_corner_BL.bin | Bin 0 -> 14 bytes Dungeons/Objects/track_corner_BR.bin | Bin 0 -> 14 bytes Dungeons/Objects/track_corner_TL.bin | Bin 0 -> 14 bytes Dungeons/Objects/track_corner_TR.bin | Bin 0 -> 14 bytes Dungeons/entrances.asm | 45 ++++++++------ Dungeons/spike_subtype.asm | 6 +- Dungeons/together_warp_tag.asm | 1 + 10 files changed, 116 insertions(+), 24 deletions(-) create mode 100644 Dungeons/Objects/object_handler.asm create mode 100644 Dungeons/Objects/track_LR.bin create mode 100644 Dungeons/Objects/track_UD.bin create mode 100644 Dungeons/Objects/track_corner_BL.bin create mode 100644 Dungeons/Objects/track_corner_BR.bin create mode 100644 Dungeons/Objects/track_corner_TL.bin create mode 100644 Dungeons/Objects/track_corner_TR.bin diff --git a/Dungeons/Objects/object_handler.asm b/Dungeons/Objects/object_handler.asm new file mode 100644 index 0000000..bfe3b9e --- /dev/null +++ b/Dungeons/Objects/object_handler.asm @@ -0,0 +1,88 @@ +; Dungeon Object Handler + +org $018262 ;object id 0x31 + dw ExpandedObject + + +org $01B53C + ExpandedObject: + JSL NewObjectsCode + RTS + + +org $2C8000 +NewObjectsCode: +{ + PHB : PHK : PLB + PHX + 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 + + 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 .LeftRight-.ObjData ; 00 + dw .UpDown-.ObjData ; 01 + dw .TopLeft-.ObjData ; 02 + dw .TopRight-.ObjData ; 03 + dw .Bottomleft-.ObjData ; 04 + dw .BottomRight-.ObjData ; 05 + +.ObjData + .LeftRight + incbin track_LR.bin + .UpDown + incbin track_UD.bin + .TopLeft + incbin track_corner_TL.bin + .TopRight + incbin track_corner_TR.bin + .Bottomleft + incbin track_corner_BL.bin + .BottomRight + incbin track_corner_BR.bin + +} + +pushpc \ No newline at end of file diff --git a/Dungeons/Objects/track_LR.bin b/Dungeons/Objects/track_LR.bin new file mode 100644 index 0000000000000000000000000000000000000000..c2b8c238f83f52e143c2a2357ef09c73c5748694 GIT binary patch literal 14 VcmZQ-h~SLmWNOIZ%;aQX000)`0;>Q3 literal 0 HcmV?d00001 diff --git a/Dungeons/Objects/track_UD.bin b/Dungeons/Objects/track_UD.bin new file mode 100644 index 0000000000000000000000000000000000000000..ee0a10062e3d2bb09b20599c9a86e3b48b7a6cf4 GIT binary patch literal 14 VcmZQ-DB~>WWNN73tmI^1000^o0|x*A literal 0 HcmV?d00001 diff --git a/Dungeons/Objects/track_corner_BL.bin b/Dungeons/Objects/track_corner_BL.bin new file mode 100644 index 0000000000000000000000000000000000000000..3212ed74e851e2708ac73d35b67cff24c1c45121 GIT binary patch literal 14 VcmZQ-Nb5}RWNHZO4DV!M001Rq1fu`| literal 0 HcmV?d00001 diff --git a/Dungeons/Objects/track_corner_BR.bin b/Dungeons/Objects/track_corner_BR.bin new file mode 100644 index 0000000000000000000000000000000000000000..5dc47825bc71bd80f8fe4743126be8d9034c0d91 GIT binary patch literal 14 VcmZQ-NI#i&lBps5WY|dt1^_H*1)~4} literal 0 HcmV?d00001 diff --git a/Dungeons/Objects/track_corner_TL.bin b/Dungeons/Objects/track_corner_TL.bin new file mode 100644 index 0000000000000000000000000000000000000000..70ee636b52aa31dc309d2c3886d62266a83d6c54 GIT binary patch literal 14 VcmZQ-2;&UrWNJv`Oy^`^000)G0;2!` literal 0 HcmV?d00001 diff --git a/Dungeons/Objects/track_corner_TR.bin b/Dungeons/Objects/track_corner_TR.bin new file mode 100644 index 0000000000000000000000000000000000000000..695c5827bf06e5ae30154206527bda46e2a70386 GIT binary patch literal 14 VcmZQ-2=@&0WNJwFO!H)50014R1ET-{ literal 0 HcmV?d00001 diff --git a/Dungeons/entrances.asm b/Dungeons/entrances.asm index caee230..f5d14ba 100644 --- a/Dungeons/entrances.asm +++ b/Dungeons/entrances.asm @@ -3,23 +3,30 @@ ; $DB8BF-$DB916 - chr types indicating door entrances org $1BB8BF - dw $00FE, $00C5, $00FE, $0114, $0115, $0175, $0156, $00F5 - dw $00E2, $01EF, $0119, $00FE, $0172, $0177, $013F, $0172 - dw $0112, $0161, $0172, $014C, $0156, $01EF, $00FE, $00FE - dw $00FE, $010B, $0173, $0143, $0149, $0175, $0103, $0100 - dw $01C6 ; Waterfall tile - dw $015E - dw $0167 - dw $0128, $0131, $0112, $016D, $0163 - dw $0173, $00FE, $0113, $00A7 +ValidDoorTypes_low: + dw $00FE, $00C5, $00FE, $0114 ; ???, House Door, ???, ??? + dw $0115, $0175, $0156, $00F5 + dw $00E2, $01EF, $0119, $00FE ; ???, ???, ???, Desert Door + dw $0172, $0177, $013F, $0172 + dw $0112, $0161, $0172, $014C ; ???, ???, Dam Door, ??? + dw $0156, $01EF, $00FE, $00FE + dw $00FE, $010B, $0173, $0143 ; ???, ???, ???, Tower of Hera + dw $0149, $0175, $0103, $0100 + dw $01C6, $015E, $0167, $0128 + dw $0131, $0112, $016D, $0163 + dw $0173, $00FE, $0113, $0177 -; $DB917 - $DB96E - dw $014A, $00C4, $014F, $0115, $0114, $0174, $0155, $00F5 - dw $00EE, $01EB, $0118, $0146, $0171, $0155, $0137, $0174 - dw $0173, $0121, $0164, $0155, $0157, $0128, $0114, $0123 - dw $0113, $0109, $0118, $0161, $0149, $0171, $0174, $0101 - dw $01C6 ; Waterfall tile - dw $0131 - dw $0051 - dw $014E, $0131, $0121, $017A, $0163 - dw $0172, $01BD, $0152, $00A7 \ No newline at end of file +;--------------------------------------------------------------------------------------------------- + +ValidDoorTypes_high: + dw $014A, $00C4, $014F, $0115 ; ???, House Door, ???, ??? + dw $0114, $0174, $0155, $00F5 + dw $00EE, $01EB, $0118, $0146 ; ???, ???, ???, Desert Door + dw $0171, $0155, $0137, $0174 + dw $0173, $0121, $0164, $0155 ; ???, ???, Dam Door, ??? + dw $0157, $0128, $0114, $0123 + dw $0113, $0109, $0118, $0161 + dw $0149, $0117, $0174, $0101 + dw $01C6, $0131, $0051, $014E + dw $0131, $0112, $017A, $0163 + dw $0172, $01BD, $0152, $0167 \ No newline at end of file diff --git a/Dungeons/spike_subtype.asm b/Dungeons/spike_subtype.asm index 848cb2e..4c518dc 100644 --- a/Dungeons/spike_subtype.asm +++ b/Dungeons/spike_subtype.asm @@ -8,10 +8,6 @@ ;09,0A,0B,0C,0D,0E = Vertical with speed incrementing ;you can edit the ASM to make diagonal spikes too ;#ENDPATCH_DESCRIPTION -lorom - -org $288000 ; NEED TO MOVE -pushpc org $0691D7 ; SpritePrep_SpikeBlock: JSL NewSpikePrep @@ -48,4 +44,4 @@ LDA $0D40, X : EOR.b #$FF : INC A : STA $0D40, X LDA.b #$05 : JSL $0DBB7C ; Sound_SetSfx2PanLong -RTL +RTL \ No newline at end of file diff --git a/Dungeons/together_warp_tag.asm b/Dungeons/together_warp_tag.asm index 232f7a7..9793dde 100644 --- a/Dungeons/together_warp_tag.asm +++ b/Dungeons/together_warp_tag.asm @@ -43,5 +43,6 @@ WarpTag: PLX JML WarpTag_Return } +pushpc ; ============================================================================== \ No newline at end of file