Skip to content

Commit

Permalink
Relabeling and adding equates to AIZ hollow tree (S3 Obj03)
Browse files Browse the repository at this point in the history
Trying to find the cause of the bug I made a workaround for back in 06af32c. Still haven't found it.
  • Loading branch information
Clownacy committed Oct 12, 2015
1 parent 45c3cd5 commit 2b3582d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 52 deletions.
2 changes: 1 addition & 1 deletion Levels/Misc/Object list - Sonic 3.asm
@@ -1,7 +1,7 @@
dc.l Obj_Ring ; 0
dc.l Obj_Monitor ; 1
dc.l Obj_PathSwap ; 2
dc.l Obj_03_1 ; 3
dc.l Obj_AIZHollowTree ; 3
dc.l Obj_CollapsingPlatform; 4
dc.l Obj_AIZLRZEMZRock ; 5
dc.l Obj_AIZRideVine ; 6
Expand Down
105 changes: 54 additions & 51 deletions sonic3k.asm
Expand Up @@ -43981,14 +43981,14 @@ sub_1F734:
; End of function sub_1F734

; ---------------------------------------------------------------------------

Obj_03_1:
move.b #$D0,7(a0)
; Obj_03_1:
Obj_AIZHollowTree:
move.b #$D0,width_pixels(a0)
move.l #loc_1F752,(a0)

loc_1F752:
bsr.w sub_1F7B8
move.b $2A(a0),d0
move.b status(a0),d0
andi.b #$18,d0
bne.s loc_1F7B2
tst.w $38(a0)
Expand Down Expand Up @@ -44047,31 +44047,31 @@ sub_1F7B8:


sub_1F7CE:
btst d6,$2A(a0)
btst d6,status(a0)
bne.w loc_1F85C
btst #1,$2A(a1)
btst #Status_InAir,status(a1)
bne.w locret_1F85A
move.w $10(a1),d0
move.w x_pos(a1),d0
addi.w #$10,d0
sub.w $10(a0),d0
sub.w x_pos(a0),d0
bcs.s locret_1F85A
cmpi.w #$40,d0
bge.s locret_1F85A
move.w $14(a1),d0
sub.w $14(a0),d0
move.w y_pos(a1),d0
sub.w y_pos(a0),d0
cmpi.w #-$5A,d0
blt.s locret_1F85A
cmpi.w #$A0,d0
bgt.s locret_1F85A
cmpi.w #$600,$18(a1)
cmpi.w #$600,x_vel(a1)
blt.s locret_1F85A
tst.b $2E(a1)
tst.b object_control(a1)
bne.s locret_1F85A
bsr.w RideObject_SetRide
move.l #0,(a2)
bset #6,$2E(a1)
bset #1,$2E(a1)
move.b #0,$20(a1)
bset #6,object_control(a1)
bset #1,object_control(a1)
move.b #0,anim(a1)
cmpa.w #Player_1,a1
bne.s locret_1F85A
jsr (Create_New_Sprite3).l
Expand All @@ -44089,17 +44089,17 @@ locret_1F85A:
; ---------------------------------------------------------------------------

loc_1F85C:
move.w $1C(a1),d0
move.w ground_vel(a1),d0
bpl.s loc_1F864
neg.w d0

loc_1F864:
cmpi.w #$600,d0
blo.w loc_1F8FE
btst #1,$2A(a1)
btst #Status_InAir,status(a1)
bne.s loc_1F88C
move.w $14(a1),d0
sub.w $14(a0),d0
move.w y_pos(a1),d0
sub.w y_pos(a0),d0
addi.w #$90,d0
bmi.s AIZTree_FallOff
cmpi.w #$130,d0
Expand All @@ -44109,31 +44109,31 @@ loc_1F864:

loc_1F88C:

cmpi.w #$2C99,$10(a1)
cmpi.w #$2C99,x_pos(a1)
bhs.s loc_1F8A0
move.w #$2C99,$10(a1)
move.w #$400,$18(a1)
move.w #$2C99,x_pos(a1)
move.w #$400,x_vel(a1)

loc_1F8A0:
cmpi.w #$2D66,$10(a1)
cmpi.w #$2D66,x_pos(a1)
blo.s AIZTree_FallOff
move.w #$2D66,$10(a1)
move.w #-$400,$18(a1)
move.w #$2D66,x_pos(a1)
move.w #-$400,x_vel(a1)

AIZTree_FallOff:
bset #1,$2A(a1)
bclr #2,$2A(a1)
move.b #$13,$1E(a1)
move.b #9,$1F(a1)
move.w #1,$20(a1)
bclr #3,$2A(a1)
bclr d6,$2A(a0)
move.b #0,$30(a1)
move.b #4,$31(a1)
bclr #6,$2E(a1)
bclr #1,$2E(a1)
asr $18(a1)
asr $1A(a1)
bset #Status_InAir,status(a1)
bclr #Status_Roll,status(a1)
move.b #$13,y_radius(a1)
move.b #9,x_radius(a1)
move.w #1,anim(a1)
bclr #Status_OnObj,status(a1)
bclr d6,status(a0)
move.b #0,flips_remaining(a1)
move.b #4,flip_speed(a1)
bclr #6,object_control(a1)
bclr #1,object_control(a1)
asr x_vel(a1)
asr y_vel(a1)
rts
; ---------------------------------------------------------------------------

Expand All @@ -44149,16 +44149,17 @@ loc_1F8FE:
; End of function sub_1F7CE

; ---------------------------------------------------------------------------
; unused/dead code
bra.w loc_1F88C

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


AIZTree_SetPlayerPos:

btst #3,$2A(a1)
btst #Status_OnObj,status(a1)
beq.w locret_1F85A
move.w $1C(a1),d0
move.w ground_vel(a1),d0
ext.l d0
lsl.l #8,d0
add.l d0,(a2)
Expand All @@ -44169,39 +44170,41 @@ AIZTree_SetPlayerPos:
move.w #$4000,(Camera_max_X_pos).w

loc_1F93C:
move.w $10(a1),d2
move.w x_pos(a1),d2
move.w (a2),d0
lsr.w #1,d0
jsr (GetSineCosine).l
muls.w #$7000,d0
swap d0
add.w $10(a0),d0
move.w d0,$10(a1)
add.w x_pos(a0),d0
move.w d0,x_pos(a1)
sub.w d2,d0
asl.w #8,d0
move.w d0,$18(a1)
move.w $14(a1),d2
move.w d0,x_vel(a1)
move.w y_pos(a1),d2
move.w (a2),d0
lsr.w #2,d0
neg.w d0
addi.w #$90,d0
add.w $14(a0),d0
move.w d0,$14(a1)
add.w y_pos(a0),d0
move.w d0,y_pos(a1)
sub.w d2,d0
asl.w #8,d0
move.w d0,$1A(a1)
move.w d0,y_vel(a1)
moveq #0,d0
move.w (a2),d0
lsr.w #1,d0
divu.w #$B,d0
move.b byte_1F99A(pc,d0.w),$22(a1)
move.b AIZTree_PlayerFrames(pc,d0.w),mapping_frame(a1)
moveq #0,d0
move.b $22(a1),d0
move.b mapping_frame(a1),d0
jmp (Tails_Carry_LoadPLC).l
; End of function AIZTree_SetPlayerPos

; ---------------------------------------------------------------------------
byte_1F99A: dc.b $69, $6A, $6B, $77, $6C, $6C, $6D, $6D, $6E, $6E, $6F, $6F, $70, $70, $71, $71, $72, $72, $73, $73
; byte_1F99A:
AIZTree_PlayerFrames:
dc.b $69, $6A, $6B, $77, $6C, $6C, $6D, $6D, $6E, $6E, $6F, $6F, $70, $70, $71, $71, $72, $72, $73, $73
dc.b $74, $74, $75, $75, $76, $76, $77, $77, $6C, $6C, $6D, $6D, $6E, $6E, $6F, $6F, $70, $70, $71, $71
dc.b $72, $72, $73, $73, $74, $74, $75, $75, $6B, $6B, $6A, $6A, $69, $69
byte_1F9D0: dc.b $18, $27, $18, $17, $18, $F, $E, $F, $10, $28, $28, $10, $28, $10, $10, $20
Expand Down

0 comments on commit 2b3582d

Please sign in to comment.