Skip to content

Commit

Permalink
Merge branch 'AS' into asm68k
Browse files Browse the repository at this point in the history
  • Loading branch information
Clownacy committed May 13, 2023
2 parents 3d7bbb6 + 450261b commit 9b31a2c
Show file tree
Hide file tree
Showing 24 changed files with 85 additions and 85 deletions.
22 changes: 11 additions & 11 deletions Variables.asm
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ v_jpadpress1: equ $FFFFF605 ; joypad input - pressed
v_vdp_buffer1: equ $FFFFF60C ; VDP instruction buffer (2 bytes)

v_demolength: equ $FFFFF614 ; the length of a demo in frames (2 bytes)
v_scrposy_dup: equ $FFFFF616 ; screen position y (duplicate) (2 bytes)
v_bgscrposy_dup: equ $FFFFF618 ; background screen position y (duplicate) (2 bytes)
v_scrposx_dup: equ $FFFFF61A ; screen position x (duplicate) (2 bytes)
v_bgscreenposx_dup_unused: equ $FFFFF61C ; background screen position x (duplicate) (2 bytes)
v_bg3screenposy_dup_unused: equ $FFFFF61E ; (2 bytes)
v_bg3screenposx_dup_unused: equ $FFFFF620 ; (2 bytes)
v_scrposy_vdp: equ $FFFFF616 ; screen position y (VDP) (2 bytes)
v_bgscrposy_vdp: equ $FFFFF618 ; background screen position y (VDP) (2 bytes)
v_scrposx_vdp: equ $FFFFF61A ; screen position x (VDP) (2 bytes)
v_bgscrposx_vdp: equ $FFFFF61C ; background screen position x (VDP) (2 bytes)
v_bg3scrposy_vdp: equ $FFFFF61E ; (2 bytes)
v_bg3scrposx_vdp: equ $FFFFF620 ; (2 bytes)

v_hbla_hreg: equ $FFFFF624 ; VDP H.interrupt register buffer (8Axx) (2 bytes)
v_hbla_line: equ $FFFFF625 ; screen line where water starts and palette is changed by HBlank
Expand Down Expand Up @@ -225,20 +225,20 @@ v_lani5_frame: equ $FFFFF7BA ; level graphics animation 5 - current frame
v_lani5_time: equ $FFFFF7BB ; level graphics animation 5 - time until next frame
v_gfxbigring: equ $FFFFF7BE ; settings for giant ring graphics loading (2 bytes)
f_conveyrev: equ $FFFFF7C0 ; flag set to reverse conveyor belts in LZ/SBZ
v_obj63: equ $FFFFF7C1 ; object 63 (LZ/SBZ platforms) variables (6 bytes)
v_obj63: equ $FFFFF7C1 ; object 63 (LZ/SBZ platforms) variables (6 bytes)
f_wtunnelmode: equ $FFFFF7C7 ; LZ water tunnel mode
f_lockmulti: equ $FFFFF7C8 ; flag set to lock controls, lock Sonic's position & animation
f_playerctrl: equ $FFFFF7C8 ; Player control override flags (object ineraction, control enable)
f_wtunnelallow: equ $FFFFF7C9 ; LZ water tunnels (00 = enabled; 01 = disabled)
f_jumponly: equ $FFFFF7CA ; flag set to lock controls apart from jumping
v_obj6B: equ $FFFFF7CB ; object 6B (SBZ stomper) variable
f_slidemode: equ $FFFFF7CA ; LZ water slide mode
v_obj6B: equ $FFFFF7CB ; object 6B (SBZ stomper) variable
f_lockctrl: equ $FFFFF7CC ; flag set to lock controls during ending sequence
f_bigring: equ $FFFFF7CD ; flag set when Sonic collects the giant ring
v_itembonus: equ $FFFFF7D0 ; item bonus from broken enemies, blocks etc. (2 bytes)
v_timebonus: equ $FFFFF7D2 ; time bonus at the end of an act (2 bytes)
v_ringbonus: equ $FFFFF7D4 ; ring bonus at the end of an act (2 bytes)
f_endactbonus: equ $FFFFF7D6 ; time/ring bonus update flag at the end of an act
v_sonicend: equ $FFFFF7D7 ; routine counter for Sonic in the ending sequence
v_lz_deform: equ $FFFFF7D8 ; LZ deformtaion offset, in units of $80 (2 bytes)
v_lz_deform: equ $FFFFF7D8 ; LZ deformtaion offset, in units of $80 (2 bytes)
f_switch: equ $FFFFF7E0 ; flags set when Sonic stands on a switch ($10 bytes)
v_scroll_block_1_size: equ $FFFFF7F0 ; (2 bytes)
v_scroll_block_2_size: equ $FFFFF7F2 ; unused (2 bytes)
Expand Down
18 changes: 9 additions & 9 deletions _inc/DeformLayers (JP1).asm
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ DeformLayers:
bsr.w ScrollHoriz
bsr.w ScrollVertical
bsr.w DynamicLevelEvents
move.w (v_screenposy).w,(v_scrposy_dup).w
move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_screenposy).w,(v_scrposy_vdp).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
moveq #0,d0
move.b (v_zone).w,d0
add.w d0,d0
Expand Down Expand Up @@ -71,7 +71,7 @@ Deform_GHZ:
moveq #0,d0
@limitY:
move.w d0,d4
move.w d0,(v_bgscrposy_dup).w
move.w d0,(v_bgscrposy_vdp).w
move.w (v_screenposx).w,d0
cmpi.b #id_Title,(v_gamemode).w
bne.s @notTitle
Expand Down Expand Up @@ -166,7 +166,7 @@ Deform_LZ:
asl.l #7,d5
bsr.w BGScroll_XY

move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
lea (Lz_Scroll_Data).l,a3
lea (Drown_WobbleData).l,a2
move.b (v_lz_deform).w,d2
Expand Down Expand Up @@ -274,7 +274,7 @@ Deform_MZ:
move.w d0,(v_bg2screenposy).w
move.w d0,(v_bg3screenposy).w
bsr.w BGScroll_YAbsolute
move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
; do something with redraw flags
move.b (v_bg1_scroll_flags).w,d0
or.b (v_bg2_scroll_flags).w,d0
Expand Down Expand Up @@ -353,7 +353,7 @@ Deform_SLZ:
ext.l d5
asl.l #7,d5
bsr.w Bg_Scroll_Y
move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
; calculate background scroll buffer
lea (v_bgscroll_buffer).w,a1
move.w (v_screenposx).w,d2
Expand Down Expand Up @@ -458,7 +458,7 @@ Deform_SYZ:
asl.l #1,d5
add.l d1,d5
bsr.w Bg_Scroll_Y
move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
; calculate background scroll buffer
lea (v_bgscroll_buffer).w,a1
move.w (v_screenposx).w,d2
Expand Down Expand Up @@ -568,7 +568,7 @@ Deform_SBZ:
move.w (v_bgscreenposy).w,d0
move.w d0,(v_bg2screenposy).w
move.w d0,(v_bg3screenposy).w
move.w d0,(v_bgscrposy_dup).w
move.w d0,(v_bgscrposy_vdp).w
move.b (v_bg1_scroll_flags).w,d0
or.b (v_bg3_scroll_flags).w,d0
or.b d0,(v_bg2_scroll_flags).w
Expand Down Expand Up @@ -635,7 +635,7 @@ Deform_SBZ2:;loc_68A2:
ext.l d5
asl.l #5,d5
bsr.w BGScroll_XY
move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
; copy fg & bg x-position to hscroll table
lea (v_hscrolltablebuffer).w,a1
move.w #223,d1
Expand Down
24 changes: 12 additions & 12 deletions _inc/DeformLayers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ DeformLayers:
bsr.w ScrollHoriz
bsr.w ScrollVertical
bsr.w DynamicLevelEvents
move.w (v_screenposx).w,(v_scrposx_dup).w
move.w (v_screenposy).w,(v_scrposy_dup).w
move.w (v_bgscreenposx).w,(v_bgscreenposx_dup_unused).w
move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_bg3screenposx).w,(v_bg3screenposx_dup_unused).w
move.w (v_bg3screenposy).w,(v_bg3screenposy_dup_unused).w
move.w (v_screenposx).w,(v_scrposx_vdp).w
move.w (v_screenposy).w,(v_scrposy_vdp).w
move.w (v_bgscreenposx).w,(v_bgscrposx_vdp).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
move.w (v_bg3screenposx).w,(v_bg3scrposx_vdp).w
move.w (v_bg3screenposy).w,(v_bg3scrposy_vdp).w
moveq #0,d0
move.b (v_zone).w,d0
add.w d0,d0
Expand Down Expand Up @@ -67,7 +67,7 @@ Deform_GHZ:
move.w d0,(v_bg2screenposy).w
move.w d0,d4
bsr.w ScrollBlock3
move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
move.w #$6F,d1
sub.w d4,d1
move.w (v_screenposx).w,d0
Expand Down Expand Up @@ -132,7 +132,7 @@ Deform_LZ:
ext.l d5
asl.l #7,d5
bsr.w ScrollBlock1
move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
lea (v_hscrolltablebuffer).w,a1
move.w #223,d1
move.w (v_screenposx).w,d0
Expand Down Expand Up @@ -178,7 +178,7 @@ Deform_MZ:
loc_6402:
move.w d0,(v_bg2screenposy).w
bsr.w ScrollBlock3
move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
lea (v_hscrolltablebuffer).w,a1
move.w #223,d1
move.w (v_screenposx).w,d0
Expand Down Expand Up @@ -208,7 +208,7 @@ Deform_SLZ:
ext.l d5
asl.l #7,d5
bsr.w ScrollBlock2
move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
bsr.w Deform_SLZ_2
lea (v_bgscroll_buffer).w,a2
move.w (v_bgscreenposy).w,d0
Expand Down Expand Up @@ -321,7 +321,7 @@ Deform_SYZ:
asl.l #1,d5
add.l d1,d5
bsr.w ScrollBlock1
move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
lea (v_hscrolltablebuffer).w,a1
move.w #223,d1
move.w (v_screenposx).w,d0
Expand Down Expand Up @@ -352,7 +352,7 @@ Deform_SBZ:
asl.l #4,d5
asl.l #1,d5
bsr.w ScrollBlock1
move.w (v_bgscreenposy).w,(v_bgscrposy_dup).w
move.w (v_bgscreenposy).w,(v_bgscrposy_vdp).w
lea (v_hscrolltablebuffer).w,a1
move.w #223,d1
move.w (v_screenposx).w,d0
Expand Down
2 changes: 1 addition & 1 deletion _inc/DynamicLevelEvents.asm
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ DLE_SBZ3:
clr.b (v_lastlamp).w
move.w #1,(f_restart).w ; restart level
move.w #(id_SBZ<<8)+2,(v_zone).w ; set level number to 0502 (FZ)
move.b #1,(f_lockmulti).w ; freeze Sonic
move.b #1,(f_playerctrl).w ; lock controls

locret_6F8C:
rts
Expand Down
6 changes: 3 additions & 3 deletions _inc/LZWaterFeatures.asm
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,10 @@ loc_3F62:
beq.s LZSlide_Move

loc_3F6A:
tst.b (f_jumponly).w
tst.b (f_slidemode).w
beq.s locret_3F7A
move.w #5,$3E(a1)
clr.b (f_jumponly).w
clr.b (f_slidemode).w

locret_3F7A:
rts
Expand All @@ -423,7 +423,7 @@ loc_3F84:
loc_3F9A:
clr.b obInertia+1(a1)
move.b #id_WaterSlide,obAnim(a1) ; use Sonic's "sliding" animation
move.b #1,(f_jumponly).w ; lock controls (except jumping)
move.b #1,(f_slidemode).w ; set water slide flag
move.b (v_vbla_byte).w,d0
andi.b #$1F,d0
bne.s locret_3FBE
Expand Down
2 changes: 1 addition & 1 deletion _incObj/0A Drowning Countdown.asm
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Drown_Countdown:; Routine $A

; Sonic drowns here
bsr.w ResumeMusic
move.b #$81,(f_lockmulti).w ; lock controls
move.b #$81,(f_playerctrl).w ; lock controls and disable object interaction
move.w #sfx_Drown,d0
jsr (PlaySound_Special).l ; play drowning sound
move.b #$A,$34(a0)
Expand Down
4 changes: 2 additions & 2 deletions _incObj/0B Pole that Breaks.asm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Pole_Action: ; Routine 2
@release:
clr.b obColType(a0)
addq.b #2,obRoutine(a0) ; goto Pole_Display next
clr.b (f_lockmulti).w
clr.b (f_playerctrl).w
clr.b (f_wtunnelallow).w
clr.b pole_grabbed(a0)
bra.s Pole_Display
Expand All @@ -92,7 +92,7 @@ Pole_Action: ; Routine 2
move.w d0,obX(a1)
bclr #0,obStatus(a1)
move.b #id_Hang,obAnim(a1) ; set Sonic's animation to "hanging" ($11)
move.b #1,(f_lockmulti).w ; lock controls
move.b #1,(f_playerctrl).w ; lock controls
move.b #1,(f_wtunnelallow).w ; disable wind tunnel
move.b #1,pole_grabbed(a0) ; begin countdown to breakage

Expand Down
4 changes: 2 additions & 2 deletions _incObj/11 Bridge (part 1).asm
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ Bri_Main: ; Routine 0
move.w d2,obY(a0)
move.w d2,$3C(a0)
move.w a0,d5
subi.w #$D000,d5
subi.w #v_objspace&$FFFF,d5
lsr.w #6,d5
andi.w #$7F,d5
move.b d5,(a2)+
addq.b #1,obSubtype(a0)

@notleftmost:
move.w a1,d5
subi.w #$D000,d5
subi.w #v_objspace&$FFFF,d5
lsr.w #6,d5
andi.w #$7F,d5
move.b d5,(a2)+
Expand Down
4 changes: 2 additions & 2 deletions _incObj/15 Swinging Platforms (part 1).asm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Swing_Main: ; Routine 0
bne.s @fail
addq.b #1,obSubtype(a0)
move.w a1,d5
subi.w #$D000,d5
subi.w #v_objspace&$FFFF,d5
lsr.w #6,d5
andi.w #$7F,d5
move.b d5,(a2)+
Expand All @@ -96,7 +96,7 @@ Swing_Main: ; Routine 0

@fail:
move.w a0,d5
subi.w #$D000,d5
subi.w #v_objspace&$FFFF,d5
lsr.w #6,d5
andi.w #$7F,d5
move.b d5,(a2)+
Expand Down
2 changes: 1 addition & 1 deletion _incObj/17 Spiked Pole Helix.asm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Hel_Build:
bne.s Hel_Action
addq.b #1,obSubtype(a0)
move.w a1,d5
subi.w #$D000,d5
subi.w #v_objspace&$FFFF,d5
lsr.w #6,d5
andi.w #$7F,d5
move.b d5,(a2)+ ; copy child address to parent RAM
Expand Down
2 changes: 1 addition & 1 deletion _incObj/26 Monitor (SolidSides subroutine).asm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Mon_SolidSides:
add.w d2,d2
cmp.w d2,d3
bcc.s loc_A4E6
tst.b (f_lockmulti).w
tst.b (f_playerctrl).w
bmi.s loc_A4E6
cmpi.b #6,(v_player+obRoutine).w
bcc.s loc_A4E6
Expand Down
6 changes: 3 additions & 3 deletions _incObj/2F MZ Large Grassy Platforms.asm
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ loc_B086:
moveq #0,d0
move.b (a2)+,d0
lsl.w #6,d0
addi.w #$D000,d0
addi.w #v_objspace&$FFFF,d0
movea.w d0,a1
move.w d1,$3C(a1)
dbf d2,loc_B086
Expand All @@ -215,7 +215,7 @@ sub_B09C:
addq.b #1,(a2)
lea 1(a2,d0.w),a2
move.w a1,d0
subi.w #$D000,d0
subi.w #v_objspace&$FFFF,d0
lsr.w #6,d0
andi.w #$7F,d0
move.b d0,(a2)
Expand Down Expand Up @@ -250,7 +250,7 @@ loc_B0F4:
move.b (a2),d0
clr.b (a2)+
lsl.w #6,d0
addi.w #$D000,d0
addi.w #v_objspace&$FFFF,d0
movea.w d0,a1
bsr.w DeleteChild
dbf d2,loc_B0F4
Expand Down
2 changes: 1 addition & 1 deletion _incObj/48 Eggman's Swinging Ball.asm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ GBall_MakeLinks:

loc_17B60:
move.w a1,d5
subi.w #$D000,d5
subi.w #v_objspace&$FFFF,d5
lsr.w #6,d5
andi.w #$7F,d5
move.b d5,(a2)+
Expand Down
4 changes: 2 additions & 2 deletions _incObj/57 Spiked Ball and Chain.asm
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ SBall_Main: ; Routine 0
bne.s @fail
addq.b #1,sball_childs(a0) ; increment child object counter
move.w a1,d5 ; get child object RAM address
subi.w #$D000,d5 ; subtract $D000
subi.w #v_objspace&$FFFF,d5 ; subtract base address
lsr.w #6,d5 ; divide by $40
andi.w #$7F,d5
move.b d5,(a2)+ ; copy child RAM number
Expand All @@ -92,7 +92,7 @@ SBall_Main: ; Routine 0

@fail:
move.w a0,d5
subi.w #$D000,d5
subi.w #v_objspace&$FFFF,d5
lsr.w #6,d5
andi.w #$7F,d5
move.b d5,(a2)+
Expand Down
2 changes: 1 addition & 1 deletion _incObj/60 Orbinaut.asm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Orb_Main: ; Routine 0
bne.s @fail
addq.b #1,(a3)
move.w a1,d5
subi.w #$D000,d5
subi.w #v_objspace&$FFFF,d5
lsr.w #6,d5
andi.w #$7F,d5
move.b d5,(a2)+
Expand Down
2 changes: 1 addition & 1 deletion _incObj/64 Bubbles.asm
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Bub_BblTypes: dc.b 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0
; ===========================================================================

Bub_ChkSonic:
tst.b (f_lockmulti).w
tst.b (f_playerctrl).w
bmi.s @loc_12998
lea (v_player).w,a1
move.w obX(a1),d0
Expand Down
4 changes: 2 additions & 2 deletions _incObj/66 Rotating Junction.asm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Jun_Action: ; Routine 2

move.b d1,$32(a0)
addq.b #4,obRoutine(a0) ; goto Jun_Release next
move.b #1,(f_lockmulti).w ; lock controls
move.b #1,(f_playerctrl).w ; lock controls
move.b #id_Roll,obAnim(a1) ; make Sonic use "rolling" animation
move.w #$800,obInertia(a1)
move.w #0,obVelX(a1)
Expand Down Expand Up @@ -115,7 +115,7 @@ Jun_Release: ; Routine 6
move.w #$800,obVelY(a1)

@isdown:
clr.b (f_lockmulti).w ; unlock controls
clr.b (f_playerctrl).w ; unlock controls
subq.b #4,obRoutine(a0)

@dontrelease:
Expand Down
Loading

0 comments on commit 9b31a2c

Please sign in to comment.