Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. Mike B Berry

    Mike B Berry A grandiose return Member

    Joined:
    Jun 6, 2012
    Messages:
    377
    Location:
    New places, newer motivation
    You should've posted a video explaining what is going on.... I forgot to mention that before you were to post. Sorry bout that, my bad.
     
  2. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    We need to see the code really before we can help, but my guesses are that you've haven't cleared the RAMS when Tails lands on the floor, here's a piece from S2R:

    Tails_ResetOnFloor_Part3:
    bclr #1,status(a0)
    bclr #5,status(a0)
    bclr #4,status(a0)
    moveq #0,d0
    move.b d0,jumping(a0)
    move.w d0,(Chain_Bonus_counter).w
    move.b d0,flip_angle(a0)
    move.b d0,flip_turned(a0)
    move.b d0,flips_remaining(a0)
    move.w d0,(Tails_Look_delay_counter).w
    move.w d0,($FFFFFEB0).w ; clear $FFFFFEB0 - $FFFFFEB1 (Tails flying and tired RAM)
    tst.b ($FFFFFEB2).w ; Was Tails carrying Sonic?
    beq.s + ; If not, branch
    move.b d0,($FFFFFEB2).w ; Clear Tails carrying Sonic
    move.b d0,($FFFFB02A).w ; Clear the control flag
    +
    cmpi.b #$20,anim(a0)
    bcc.s +
    cmpi.b #$14,anim(a0)
    bne.s return_1CBC4
    +
    move.b d0,anim(a0)

    return_1CBC4:
    rtsMake sure that the start of the flying code (or the command to jump to the subroutine) is in "Obj02_MdJump:" and only when you press A, B or C again in mid-air should it start, otherwise, completely ignore flying code. Then, in "Obj02_MdAir" you want to do a check to see if Tails is flying and if so, branch to flying code, otherwise, ignore. Example in S2R:

    Code:
    Obj02_MdAir:
    	cmpi.w	#5,(Player_mode).w	; Are Sonic and Knuckles together?
    	beq.s	IOAagaincontinue	; branch if so.  This will stop knuckles flying as he is the follower as he is in place of tails
    	tst.b	($FFFFFEB0).w		; tailsflyingcode           
    	bne.s	Tails_Flight		; Branch if Flying
      
    IOAagaincontinue:
    This may be another reason why Tails suddenly falls like mad when you've walked off a ledge, etc.

    Somewhere in your flying code you must have him setting his animation to the hanging pose. Just find that command and then remove it. And to make Tails tired, you need to add a counter of some sort and when reaches 0, change his animation to tired and disable the controls for flying any more.
     
    Last edited by a moderator: May 28, 2013
  3. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Alright my friend fixed all of the bugs and Tails flight works correcly, (Tired and Swimming sprites not included) now would anyone like to see it in action or not until I port those sprites, and TSR do I have your permission since of course it was your code from the start?
     
  4. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Neither really. We all know what it looks like from S3K.
     
  5. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    But how are you going to know if I'm telling the truth, I could be lying, not that their would be a reason too.
     
  6. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    I will need those sprites by the time it's been modified by myself =P

    You have my permission, although it won't look different compared to S3K until I get my hands on it. Then I'll really make it unique. :>

    ...

    Not that I think I'll show many people what I mean until a few other things are done as well =P
     
  7. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    So your plan is to make different sprites or ugh confused lol
     
  8. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Ok so I have been adding animations for Tails flight and when I got to adding the tired swimming animation this happens with them.



    How can i extend the amount of animation scrips tails is aloud to use, with out getting glitched animations?
     
  9. rika_chou

    rika_chou Adopt Member

    Joined:
    Aug 11, 2007
    Messages:
    689
    You have to extend the animation list for his tail object.
     
  10. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Correction, his Obj05AniSelection, I added more dc.b and then put a 0 like so, dc.b 0, to accommodate the new animations, and it shows the animations correctly.

    So now Tails flight is 90% done since I still have to add the sounds.

    Edit: Another problem that I have is with the Tails Super transformation sprites I added. If in Sonic and Tails mode, when Sonic and Tails become super, the transformation animations for Tails show, but they dont when in Tails Alone mode, instead it shows his walking animations.

    Edit2: This is the check super routine for Taills.

    Code:
    Tails_CheckGoSuper:
            move.b	(Ctrl_2_Press_Logical).w,d0
    	andi.b	#$70,d0		; is a jump button pressed?
    	beq.w	return_1ABA43		; if not, branch
            tst.b	(Update_HUD_timer).w	; has Sonic reached the end of the act?
    	beq.w	Tails_DoFly		; if yes, branch
            
            tst.b	(Super_Tails_flag).w	; is Sonic already Super?
    	bne.w	Tails_DoFly		; if yes, branch
    	cmpi.b	#7,(Emerald_count).w	; does Sonic have exactly 7 emeralds?
    	bne.w	Tails_DoFly	; if not, branch
    	cmpi.w	#50,(Ring_count).w	; does Sonic have at least 50 rings?
    	blo.w	Tails_DoFly		; if not, branch
            
            move.b	#1,(Super_Sonic_palette).w
    	move.b	#$F,(Palette_frame_count).w
    	move.b	#1,(Super_Tails_flag).w
    	move.b	#$81,obj_control(a0)
            move.b	#$24,anim(a0)			; use transformation animation
    	move.b	#$7E,(Object_RAM+$2040).w	; load Obj7E (super sonic stars object) at $FFFFD040
            move.w	#$A00,(Tails_top_speed).w
    	move.w	#$18,(Tails_acceleration).w
    	move.w	#$100,(Tails_deceleration).w
            btst	#6,status(a0)	; Check if underwater, return if not
    	beq.s	+
    	move.w	#$500,(Tails_top_speed).w
    	move.w	#$18,(Tails_acceleration).w
    	move.w	#$80,(Tails_deceleration).w
    +
            move.w	#0,invincibility_time(a0)
    	bset	#1,status_secondary(a0)	; make Sonic invincible
    	move.w	#$1F+$80,d0
    	jsr	(PlaySound).l	; Play transformation sound effect.
    	move.w	#$AC+$80,d0
    	jsr	(PlayMusic).l	; load the Super Sonic song and return
    
     
    Last edited by a moderator: May 31, 2013
  11. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    What correction? That's what rika practically told you to do.

    As for your code, the bug lies in the very first command I believe:

    Code:
            move.b	(Ctrl_2_Press_Logical).w,d0
     
  12. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Oh I thought he said script not list. Wouldnt this, move.b (Ctrl_2_Press_Logical).w,d0 be controller 2, which is Tails?
     
  13. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Another thing I am trying to do is seperate Knuckles layout from Sonic, I have copied all of the layout files made a new pointer list for Knuckles layouts, but there is no effect


    Control for loadig layouts

    sub_E4A2:
    moveq #0,d0
    move.w (Current_ZoneAndAct).w,d0
    ror.b #1,d0
    lsr.w #5,d0
    add.w d1,d0
    cmpi.b #3,(player_mode).w
    bne.s + ; No? Branch
    lea (Off_level_Knux).l,a1
    adda.w d0,a1
    bra.s ++
    +
    lea (Off_Level).l,a1
    +
    move.w (a1,d0.w),d0
    lea (a1,d0.l),a1
    moveq #0,d1
    move.w d1,d2
    move.b (a1)+,d1
    move.b (a1)+,d2
    move.l d1,d5
    addq.l #1,d5
    moveq #0,d3
    move.w #$80,d3
    divu.w d5,d3
    subq.w #1,d3

    My pointer list for Knux

    Off_Level_Knux:
    dc.w Level_EHZ1_K-Off_Level_Knux
    dc.w Level_EHZ2_K-Off_Level_Knux; 1
    dc.w Level_EHZ1_K-Off_Level_Knux; 2
    dc.w Level_EHZ1_K-Off_Level_Knux; 3
    dc.w Level_WZ_K-Off_Level_Knux; 4
    dc.w Level_WZ2_K-Off_Level_Knux; 5
    dc.w Level_EHZ1_K-Off_Level_Knux; 6
    dc.w Level_EHZ1_K-Off_Level_Knux; 7
    dc.w Level_MTZ1_K-Off_Level_Knux; 8
    dc.w Level_MTZ2_K-Off_Level_Knux; 9
    dc.w Level_MTZ3_K-Off_Level_Knux; 10
    dc.w Level_MTZ3_K-Off_Level_Knux; 11
    dc.w Level_WFZ_K-Off_Level_Knux; 12
    dc.w Level_WFZ_K-Off_Level_Knux; 13
    dc.w Level_HTZ1_K-Off_Level_Knux; 14
    dc.w Level_HTZ2_K-Off_Level_Knux; 15
    dc.w Level_HPZ1_K-Off_Level_Knux; 16
    dc.w Level_HPZ2_K-Off_Level_Knux; 17
    dc.w Level_EHZ1_K-Off_Level_Knux; 18
    dc.w Level_EHZ1_K-Off_Level_Knux; 19
    dc.w Level_OOZ1_K-Off_Level_Knux; 20
    dc.w Level_OOZ2_K-Off_Level_Knux; 21
    dc.w Level_MCZ1_K-Off_Level_Knux; 22
    dc.w Level_MCZ2_K-Off_Level_Knux; 23
    dc.w Level_CNZ1_K-Off_Level_Knux; 24
    dc.w Level_CNZ2_K-Off_Level_Knux; 25
    dc.w Level_CPZ1_K-Off_Level_Knux; 26
    dc.w Level_CPZ2_K-Off_Level_Knux; 27
    dc.w Level_DEZ_K-Off_Level_Knux; 28
    dc.w Level_DEZ_K-Off_Level_Knux; 29
    dc.w Level_ARZ1_K-Off_Level_Knux; 30
    dc.w Level_ARZ2_K-Off_Level_Knux; 31
    dc.w Level_SCZ_K-Off_Level_Knux; 32
    dc.w Level_SCZ_K-Off_Level_Knux; 33

    ;---------------------------------------------------------------------------------------
    ; Layouts for Knuckles
    ;---------------------------------------------------------------------------------------
    ; EHZ act 1 level layout (Kosinski compression)
    Level_EHZ1_K: BINCLUDE "level/layout/EHZ_1_K.bin"
    ;---------------------------------------------------------------------------------------
    ; EHZ act 2 level layout (Kosinski compression)
    Level_EHZ2_K: BINCLUDE "level/layout/EHZ_2_K.bin"
    ;---------------------------------------------------------------------------------------
    ; Wood Zone level layout (Kosinski compression)
    Level_WZ_K: BINCLUDE "level/layout/WZ_K.bin"
    ;---------------------------------------------------------------------------------------
    ; Wood Zone level layout (Kosinski compression)
    Level_WZ2_K: BINCLUDE "level/layout/WZ2_K.bin"
    ;---------------------------------------------------------------------------------------
    ; MTZ act 1 level layout (Kosinski compression)
    Level_MTZ1_K: BINCLUDE "level/layout/MTZ_1_K.bin"
    ;---------------------------------------------------------------------------------------
    ; MTZ act 2 level layout (Kosinski compression)
    Level_MTZ2_K: BINCLUDE "level/layout/MTZ_2_K.bin"
    ;---------------------------------------------------------------------------------------
    ; MTZ act 3 level layout (Kosinski compression)
    Level_MTZ3_K: BINCLUDE "level/layout/MTZ_3_K.bin"
    ;---------------------------------------------------------------------------------------
    ; WFZ level layout (Kosinski compression)
    Level_WFZ_K: BINCLUDE "level/layout/WFZ_K.bin"
    ;---------------------------------------------------------------------------------------
    ; HTZ act 1 level layout (Kosinski compression)
    Level_HTZ1_K: BINCLUDE "level/layout/HTZ_1_K.bin"
    ;---------------------------------------------------------------------------------------
    ; HTZ act 2 level layout (Kosinski compression)
    Level_HTZ2_K: BINCLUDE "level/layout/HTZ_2_K.bin"
    ;---------------------------------------------------------------------------------------
    ; OOZ act 1 level layout (Kosinski compression)
    Level_OOZ1_K: BINCLUDE "level/layout/OOZ_1_K.bin"
    ;---------------------------------------------------------------------------------------
    ; OOZ act 2 level layout (Kosinski compression)
    Level_OOZ2_K: BINCLUDE "level/layout/OOZ_2_K.bin"
    ;---------------------------------------------------------------------------------------
    ; MCZ act 1 level layout (Kosinski compression)
    Level_MCZ1_K: BINCLUDE "level/layout/MCZ_1_K.bin"
    ;---------------------------------------------------------------------------------------
    ; MCZ act 2 level layout (Kosinski compression)
    Level_MCZ2_K: BINCLUDE "level/layout/MCZ_2_K.bin"
    ;---------------------------------------------------------------------------------------
    ; CNZ act 1 level layout (Kosinski compression)
    Level_CNZ1_K: BINCLUDE "level/layout/CNZ_1_K.bin"
    ;---------------------------------------------------------------------------------------
    ; CNZ act 2 level layout (Kosinski compression)
    Level_CNZ2_K: BINCLUDE "level/layout/CNZ_2_K.bin"
    ;---------------------------------------------------------------------------------------
    ; CPZ act 1 level layout (Kosinski compression)
    Level_CPZ1_K: BINCLUDE "level/layout/CPZ_1_K.bin"
    ;---------------------------------------------------------------------------------------
    ; CPZ act 2 level layout (Kosinski compression)
    Level_CPZ2_K: BINCLUDE "level/layout/CPZ_2_K.bin"
    ;---------------------------------------------------------------------------------------
    ; DEZ level layout (Kosinski compression)
    Level_DEZ_K: BINCLUDE "level/layout/DEZ_K.bin"
    ;---------------------------------------------------------------------------------------
    ; ARZ act 1 level layout (Kosinski compression)
    Level_ARZ1_K: BINCLUDE "level/layout/ARZ_1_K.bin"
    ;---------------------------------------------------------------------------------------
    ; ARZ act 2 level layout (Kosinski compression)
    Level_ARZ2_K: BINCLUDE "level/layout/ARZ_2_K.bin"
    ;---------------------------------------------------------------------------------------
    ; SCZ level layout (Kosinski compression)
    Level_SCZ_K: BINCLUDE "level/layout/SCZ_K.bin"
    ;---------------------------------------------------------------------------------------
    ; HPZ level layout (Kosinski compression)
    Level_HPZ1_K: BINCLUDE "level/layout/HPZ1_K.bin"
    ;---------------------------------------------------------------------------------------
    ; HPZ level layout (Kosinski compression)
    Level_HPZ2_K: BINCLUDE "level/layout/HPZ2_K.bin"

    Is how I pointed to the files, do nothing?
     
    Last edited by a moderator: May 31, 2013
  14. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    lea (Off_level_Knux).l,a1
    adda.w d0,a1What's the adda.w for? You don't have that under "lea (Off_Level).l,a1"
     
  15. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    I thought I was going to get a address mode not aloud here error.


    Edit: Like what I had to do for Knux start locations.
     
    Last edited by a moderator: May 31, 2013
  16. InfiniteWave

    InfiniteWave Veteran Of The Arte & Sword Member

    Joined:
    Apr 18, 2013
    Messages:
    77
    Location:
    Visiting the Hakurei Shrine
    How do I get the game to load S3K's collision arrays and curve and resistance data? I only want it for one stage and 3K's data breaks most of the other stages.
     
  17. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    I figured out how to do this before, since I needed to do it for my Death Egg Zone to work right. It should be something along the lines of this (this is an example from my own hack):


    cmpi.b #death_egg_zone,(Current_Zone).w
    bne.s LoadFloorColArray_NotDEZ
    lea (ColArray_DEZ).l,a2
    bra.s ContinueLoadingFloorColArray

    LoadFloorColArray_NotDEZ:
    lea (ColArray).l,a2

    ContinueLoadingFloorColArray:

    Then, below the ColArray BINCLUDEs, add this (again, example from my hack):


    ; ----------------------------------------------------------------------------------
    ; Collision arrays for DEZ
    ; ----------------------------------------------------------------------------------
    ColArray_DEZ: BINCLUDE "collision/Collision array 1 - DEZ.bin"
    ColArray2_DEZ: BINCLUDE "collision/Collision array 2 - DEZ.bin"
    even

    Make changes as necessary. Note that this is for Sonic 2, so I don't think it'll work for Sonic 1.

    But when you do it right, it works like a charm. Be sure you put "+$1000" in for the rotated arrays. I hope this helped you in some way.
     
  18. InfiniteWave

    InfiniteWave Veteran Of The Arte & Sword Member

    Joined:
    Apr 18, 2013
    Messages:
    77
    Location:
    Visiting the Hakurei Shrine
    Doesn't work, the collision is game is still using Sonic 2's collision. It would be a-lot helpfull if you post the entire subroutine or at-least the name of it so I know where to edit.
     
  19. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    In that case, here's a more specific example from my hack:


    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||

    ; d2 = y_pos
    ; d3 = x_pos
    ; d5 = ($c,$d) - solidity type bit (L/R/B or top)
    ; returns relevant block ID in (a1)
    ; returns distance to bottom in d1

    ; loc_1E7D0:
    FindFloor:
    bsr.w Floor_ChkTile
    move.w (a1),d0
    move.w d0,d4
    andi.w #$3FF,d0
    beq.s loc_1E7E2
    btst d5,d4
    bne.s loc_1E7F0

    loc_1E7E2:
    add.w a3,d2
    bsr.w FindFloor2
    sub.w a3,d2
    addi.w #$10,d1
    rts
    ; ===========================================================================

    loc_1E7F0: ; block has some solidity
    movea.l (Collision_addr).w,a2 ; pointer to collision data, i.e. blockID -> collisionID array
    move.b (a2,d0.w),d0 ; get collisionID
    andi.w #$FF,d0
    beq.s loc_1E7E2
    cmpi.b #death_egg_zone,(Current_Zone).w
    bne.s LoadFloorColCurveMap_NotDEZ
    lea (ColCurveMap_DEZ).l,a2
    bra.s ContinueLoadingFloorColCurveMap

    LoadFloorColCurveMap_NotDEZ:
    lea (ColCurveMap).l,a2

    ContinueLoadingFloorColCurveMap:
    move.b (a2,d0.w),(a4) ; get angle from AngleMap --> (a4)
    lsl.w #4,d0
    move.w d3,d1 ; x_pos
    btst #$A,d4 ; adv.blockID in d4 - X flipping
    beq.s +
    not.w d1
    neg.b (a4)
    +
    btst #$B,d4 ; Y flipping
    beq.s +
    addi.b #$40,(a4)
    neg.b (a4)
    subi.b #$40,(a4)
    +
    andi.w #$F,d1 ; x_pos (mod 16)
    add.w d0,d1 ; d0 = 16*blockID -> offset in ColArray to look up
    cmpi.b #death_egg_zone,(Current_Zone).w
    bne.s LoadFloorColArray_NotDEZ
    lea (ColArray_DEZ).l,a2
    bra.s ContinueLoadingFloorColArray

    LoadFloorColArray_NotDEZ:
    lea (ColArray).l,a2

    ContinueLoadingFloorColArray:
    move.b (a2,d1.w),d0 ; heigth from ColArray
    ext.w d0
    eor.w d6,d4
    btst #$B,d4 ; Y flipping
    beq.s +
    neg.w d0
    +
    tst.w d0
    beq.w loc_1E7E2 ; no collision
    bmi.s loc_1E85E
    cmpi.b #$10,d0
    beq.s loc_1E86A
    move.w d2,d1
    andi.w #$F,d1
    add.w d1,d0
    move.w #$F,d1
    sub.w d0,d1
    rts
    ; ===========================================================================

    loc_1E85E:
    move.w d2,d1
    andi.w #$F,d1
    add.w d1,d0
    bpl.w loc_1E7E2

    loc_1E86A:
    sub.w a3,d2
    bsr.w FindFloor2
    add.w a3,d2
    subi.w #$10,d1
    rts
    ; End of function FindFloor


    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


    ; loc_1E878:
    FindFloor2:
    bsr.w Floor_ChkTile
    move.w (a1),d0
    move.w d0,d4
    andi.w #$3FF,d0
    beq.s loc_1E88A
    btst d5,d4
    bne.s loc_1E898

    loc_1E88A:
    move.w #$F,d1
    move.w d2,d0
    andi.w #$F,d0
    sub.w d0,d1
    rts
    ; ===========================================================================

    loc_1E898:
    movea.l (Collision_addr).w,a2
    move.b (a2,d0.w),d0
    andi.w #$FF,d0
    beq.s loc_1E88A
    cmpi.b #death_egg_zone,(Current_Zone).w
    bne.s LoadFloor2ColCurveMap_NotDEZ
    lea (ColCurveMap_DEZ).l,a2
    bra.s ContinueLoadingFloor2ColCurveMap

    LoadFloor2ColCurveMap_NotDEZ:
    lea (ColCurveMap).l,a2

    ContinueLoadingFloor2ColCurveMap:
    move.b (a2,d0.w),(a4)
    lsl.w #4,d0
    move.w d3,d1
    btst #$A,d4
    beq.s +
    not.w d1
    neg.b (a4)
    +
    btst #$B,d4
    beq.s +
    addi.b #$40,(a4)
    neg.b (a4)
    subi.b #$40,(a4)
    +
    andi.w #$F,d1
    add.w d0,d1
    cmpi.b #death_egg_zone,(Current_Zone).w
    bne.s LoadFloor2ColArray_NotDEZ
    lea (ColArray_DEZ).l,a2
    bra.s ContinueLoadingFloor2ColArray

    LoadFloor2ColArray_NotDEZ:
    lea (ColArray).l,a2

    ContinueLoadingFloor2ColArray:
    move.b (a2,d1.w),d0
    ext.w d0
    eor.w d6,d4
    btst #$B,d4
    beq.s +
    neg.w d0
    +
    tst.w d0
    beq.w loc_1E88A
    bmi.s loc_1E900
    move.w d2,d1
    andi.w #$F,d1
    add.w d1,d0
    move.w #$F,d1
    sub.w d0,d1
    rts
    ; ===========================================================================

    loc_1E900:
    move.w d2,d1
    andi.w #$F,d1
    add.w d1,d0
    bpl.w loc_1E88A
    not.w d1
    rts
    ; ===========================================================================
    ; loc_1E910:
    Obj_CheckInFloor:
    bsr.w Floor_ChkTile
    move.w (a1),d0
    move.w d0,d4
    andi.w #$3FF,d0
    beq.s loc_1E922
    btst d5,d4
    bne.s loc_1E928

    loc_1E922:
    move.w #$10,d1
    rts
    ; ===========================================================================

    loc_1E928:
    movea.l (Collision_addr).w,a2
    move.b (a2,d0.w),d0
    andi.w #$FF,d0
    beq.s loc_1E922
    cmpi.b #death_egg_zone,(Current_Zone).w
    bne.s LoadObjChkFloorColCurveMap_NotDEZ
    lea (ColCurveMap_DEZ).l,a2
    bra.s ContinueLoadingObjChkFloorColCurveMap

    LoadObjChkFloorColCurveMap_NotDEZ:
    lea (ColCurveMap).l,a2

    ContinueLoadingObjChkFloorColCurveMap:
    move.b (a2,d0.w),(a4)
    lsl.w #4,d0
    move.w d3,d1
    btst #$A,d4
    beq.s +
    not.w d1
    neg.b (a4)
    +
    btst #$B,d4
    beq.s +
    addi.b #$40,(a4)
    neg.b (a4)
    subi.b #$40,(a4)
    +
    andi.w #$F,d1
    add.w d0,d1
    cmpi.b #death_egg_zone,(Current_Zone).w
    bne.s LoadFloorCheckColArray_NotDEZ
    lea (ColArray_DEZ).l,a2
    bra.s ContinueLoadingFloorCheckColArray

    LoadFloorCheckColArray_NotDEZ:
    lea (ColArray).l,a2

    ContinueLoadingFloorCheckColArray:
    move.b (a2,d1.w),d0
    ext.w d0
    eor.w d6,d4
    btst #$B,d4
    beq.s +
    neg.w d0
    +
    tst.w d0
    beq.s loc_1E922
    bmi.s loc_1E996
    cmpi.b #$10,d0
    beq.s loc_1E9A2
    move.w d2,d1
    andi.w #$F,d1
    add.w d1,d0
    move.w #$F,d1
    sub.w d0,d1
    rts
    ; ===========================================================================

    loc_1E996:
    move.w d2,d1
    andi.w #$F,d1
    add.w d1,d0
    bpl.w loc_1E922

    loc_1E9A2:
    sub.w a3,d2
    bsr.w FindFloor2
    add.w a3,d2
    subi.w #$10,d1
    rts
    ; ===========================================================================

    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||

    ; d2 = y_pos
    ; d3 = x_pos
    ; d5 = ($c,$d) - solidity type bit (L/R/B or top)
    ; returns relevant block ID in (a1)
    ; returns distance to left/right in d1
    ; returns angle in (a4)

    ; loc_1E9B0:
    FindWall:
    bsr.w Floor_ChkTile
    move.w (a1),d0
    move.w d0,d4
    andi.w #$3FF,d0 ; plain blockID
    beq.s loc_1E9C2 ; no collision
    btst d5,d4
    bne.s loc_1E9D0

    loc_1E9C2:
    add.w a3,d3
    bsr.w FindWall2
    sub.w a3,d3
    addi.w #$10,d1
    rts
    ; ===========================================================================

    loc_1E9D0:
    movea.l (Collision_addr).w,a2
    move.b (a2,d0.w),d0
    andi.w #$FF,d0 ; relevant collisionArrayEntry
    beq.s loc_1E9C2
    cmpi.b #death_egg_zone,(Current_Zone).w
    bne.s LoadWallColCurveMap_NotDEZ
    lea (ColCurveMap_DEZ).l,a2
    bra.s ContinueLoadingWallColCurveMap

    LoadWallColCurveMap_NotDEZ:
    lea (ColCurveMap).l,a2

    ContinueLoadingWallColCurveMap:
    move.b (a2,d0.w),(a4)
    lsl.w #4,d0 ; offset in collision array
    move.w d2,d1 ; y
    btst #$B,d4 ; y-mirror?
    beq.s +
    not.w d1
    addi.b #$40,(a4)
    neg.b (a4)
    subi.b #$40,(a4)
    +
    btst #$A,d4 ; x-mirror?
    beq.s +
    neg.b (a4)
    +
    andi.w #$F,d1 ; y
    add.w d0,d1 ; line to look up
    cmpi.b #death_egg_zone,(Current_Zone).w
    bne.s LoadWallColArray_NotDEZ
    lea (ColArray_DEZ+$1000).l,a2
    bra.s ContinueLoadingWallColArray

    LoadWallColArray_NotDEZ:
    lea (ColArray+$1000).l,a2 ; rotated collision array

    ContinueLoadingWallColArray:
    move.b (a2,d1.w),d0 ; collision value
    ext.w d0
    eor.w d6,d4 ; set x-flip flag if from the right
    btst #$A,d4 ; x-mirror?
    beq.s +
    neg.w d0
    +
    tst.w d0
    beq.w loc_1E9C2
    bmi.s loc_1EA3E
    cmpi.b #$10,d0
    beq.s loc_1EA4A
    move.w d3,d1 ; x
    andi.w #$F,d1
    add.w d1,d0
    move.w #$F,d1
    sub.w d0,d1
    rts
    ; ===========================================================================

    loc_1EA3E:
    move.w d3,d1
    andi.w #$F,d1
    add.w d1,d0
    bpl.w loc_1E9C2 ; no collision

    loc_1EA4A:
    sub.w a3,d3
    bsr.w FindWall2
    add.w a3,d3
    subi.w #$10,d1
    rts
    ; End of function FindWall


    ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||

    ; loc_1EA58:
    FindWall2:
    bsr.w Floor_ChkTile
    move.w (a1),d0
    move.w d0,d4
    andi.w #$3FF,d0
    beq.s loc_1EA6A
    btst d5,d4
    bne.s loc_1EA78

    loc_1EA6A:
    move.w #$F,d1
    move.w d3,d0
    andi.w #$F,d0
    sub.w d0,d1
    rts
    ; ===========================================================================

    loc_1EA78:
    movea.l (Collision_addr).w,a2
    move.b (a2,d0.w),d0
    andi.w #$FF,d0
    beq.s loc_1EA6A
    cmpi.b #death_egg_zone,(Current_Zone).w
    bne.s LoadWall2ColCurveMap_NotDEZ
    lea (ColCurveMap_DEZ).l,a2
    bra.s ContinueLoadingWall2ColCurveMap

    LoadWall2ColCurveMap_NotDEZ:
    lea (ColCurveMap).l,a2

    ContinueLoadingWall2ColCurveMap:
    move.b (a2,d0.w),(a4)
    lsl.w #4,d0
    move.w d2,d1
    btst #$B,d4
    beq.s +
    not.w d1
    addi.b #$40,(a4)
    neg.b (a4)
    subi.b #$40,(a4)
    +
    btst #$A,d4
    beq.s +
    neg.b (a4)
    +
    andi.w #$F,d1
    add.w d0,d1
    cmpi.b #death_egg_zone,(Current_Zone).w
    bne.s LoadWall2ColArray_NotDEZ
    lea (ColArray_DEZ+$1000).l,a2
    bra.s ContinueLoadingWall2ColArray

    LoadWall2ColArray_NotDEZ:
    lea (ColArray+$1000).l,a2 ; rotated collision array

    ContinueLoadingWall2ColArray:
    move.b (a2,d1.w),d0
    ext.w d0
    eor.w d6,d4
    btst #$A,d4
    beq.s +
    neg.w d0
    +
    tst.w d0
    beq.w loc_1EA6A
    bmi.s loc_1EAE0
    move.w d3,d1
    andi.w #$F,d1
    add.w d1,d0
    move.w #$F,d1
    sub.w d0,d1
    rts
    ; ===========================================================================

    loc_1EAE0:
    move.w d3,d1
    andi.w #$F,d1
    add.w d1,d0
    bpl.w loc_1EA6A
    not.w d1
    rts
    ; End of function FindWall2

    I am very sorry if I wasn't specific enough the first time. As for the BINCLUDE's I mentioned, just search for "Collision array 1" and you should find them. Then, without replacing the original BINCLUDE's, add the new ones under them so it looks something like this (again, example from my hack):


    ; -----------------------------------------------------------------------------------
    ; Curve and resistance mapping
    ; -----------------------------------------------------------------------------------
    ColCurveMap: BINCLUDE "collision/Curve and resistance mapping.bin"
    even
    ; -----------------------------------------------------------------------------------
    ; Curve and resistance mapping for DEZ
    ; -----------------------------------------------------------------------------------
    ColCurveMap_DEZ: BINCLUDE "collision/Curve and resistance mapping for DEZ.bin"
    even
    ; ----------------------------------------------------------------------------------
    ; Collision arrays
    ; ----------------------------------------------------------------------------------
    ColArray: BINCLUDE "collision/Collision array 1.bin"
    ColArray2: BINCLUDE "collision/Collision array 2.bin"
    even
    ; ----------------------------------------------------------------------------------
    ; Collision arrays for DEZ
    ; ----------------------------------------------------------------------------------
    ColArray_DEZ: BINCLUDE "collision/Collision array 1 - DEZ.bin"
    ColArray2_DEZ: BINCLUDE "collision/Collision array 2 - DEZ.bin"
    even

    You will probably have to change them to work with the zone you're modifying, but regardless, this should do the trick.
     
  20. InfiniteWave

    InfiniteWave Veteran Of The Arte & Sword Member

    Joined:
    Apr 18, 2013
    Messages:
    77
    Location:
    Visiting the Hakurei Shrine
    That's much better, I'll come back and give word if it works. Thanks.