Skip to content

Commit

Permalink
Added optional NoSuper flag for NoSuper builds.
Browse files Browse the repository at this point in the history
Fixed breakable walls maybe?
  • Loading branch information
DrMelon committed Nov 4, 2020
1 parent 8fd907e commit 23a778b
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ skbuilt.prev.bin
sonic3k.bin
sonic3k.prev.bin
sonic3k.lst
sonic*.bin
snolf*.bin
Build/s3builtBinaryOutput.txt
Build/s3builtErrors.txt
Build/s3builtOutput.txt
Expand Down
2 changes: 1 addition & 1 deletion Build Scripts/buildS3Complete.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set AS_MSGPATH=AS\Win32
set USEANSI=n

REM // allow the user to choose to output error messages to file by supplying the -logerrors parameter
IF "%1"=="-logerrors" ( "AS\Win32\asw.exe" -xx -q -c -D Sonic3_Complete=1 -E -A -L sonic3k.asm ) ELSE "AS\Win32\asw.exe" -xx -q -c -D Sonic3_Complete=1 -A -L sonic3k.asm
IF "%1"=="-logerrors" ( "AS\Win32\asw.exe" -xx -q -c -D Sonic3_Complete=1 -D NoSuper=0 -E -A -L sonic3k.asm ) ELSE "AS\Win32\asw.exe" -xx -q -c -D Sonic3_Complete=1 -D NoSuper=0 -A -L sonic3k.asm

REM // if there were errors, a log file is produced
IF "%1"=="-logerrors" ( IF EXIST sonic3k.log goto LABLERROR3 )
Expand Down
68 changes: 68 additions & 0 deletions Build Scripts/buildS3CompleteNoSuper.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
@ECHO OFF

pushd "%~dp0\.."

REM // make sure we can write to the file sonic3k.bin
REM // also make a backup to sonic3k.prev.bin
IF NOT EXIST sonic3k.bin goto LABLNOCOPY
IF EXIST sonic3k.prev.bin del sonic3k.prev.bin
IF EXIST sonic3k.prev.bin goto LABLNOCOPY
move /Y sonic3k.bin sonic3k.prev.bin
IF EXIST sonic3k.bin goto LABLERROR2

:LABLNOCOPY
REM // delete some intermediate assembler output just in case
IF EXIST sonic3k.p del sonic3k.p
IF EXIST sonic3k.p goto LABLERROR1

REM // clear the output window
REM cls

REM // run the assembler
REM // -xx shows the most detailed error output
REM // -q makes AS shut up
REM // -A gives us a small speedup
set AS_MSGPATH=AS\Win32
set USEANSI=n

REM // allow the user to choose to output error messages to file by supplying the -logerrors parameter
IF "%1"=="-logerrors" ( "AS\Win32\asw.exe" -xx -q -c -D Sonic3_Complete=1 -D NoSuper=1 -E -A -L sonic3k.asm ) ELSE "AS\Win32\asw.exe" -xx -q -c -D Sonic3_Complete=1 -D NoSuper=1 -A -L sonic3k.asm

REM // if there were errors, a log file is produced
IF "%1"=="-logerrors" ( IF EXIST sonic3k.log goto LABLERROR3 )

REM // combine the assembler output into a rom
IF EXIST sonic3k.p "AS\Win32\s3p2bin" sonic3k.p sonic3k_nosuper.bin sonic3k.h

REM // done -- pause if we seem to have failed, then exit
IF NOT EXIST sonic3k.p goto LABLPAUSE
IF EXIST sonic3k.bin goto LABLEXIT

:LABLPAUSE
pause
goto LABLEXIT

:LABLERROR1
echo Failed to build because write access to sonic3k.p was denied.
pause
goto LABLEXIT

:LABLERROR2
echo Failed to build because write access to sonic3k.bin was denied.
pause
goto LABLEXIT

:LABLERROR3
REM // display a noticeable message
echo.
echo ***************************************************************************
echo * *
echo * There were build errors/warnings. See sonic3k.log for more details. *
echo * *
echo ***************************************************************************
echo.
pause

:LABLEXIT
popd
exit /b
42 changes: 28 additions & 14 deletions sonic3k.asm
Original file line number Diff line number Diff line change
Expand Up @@ -23448,7 +23448,11 @@ Sonic_CheckTransform:
bne.s Sonic_InstaShield

loc_119E8:
cmpi.w #50,(Ring_count).w ; does Sonic have at least 50 rings?
if NoSuper=1
cmpi.w #500,(Ring_count).w ; does Sonic have at least 50 rings?
else
cmpi.w #50,(Ring_count).w ; does Sonic have at least 50 rings?
endif
blo.s Sonic_InstaShield ; if not, perform Insta-Shield
tst.b (Update_HUD_timer).w
bne.s Sonic_Transform
Expand Down Expand Up @@ -28660,7 +28664,12 @@ Tails_Test_For_Flight:
bne.s loc_1515C
cmpi.b #7,(Super_emerald_count).w
blo.s loc_1515C
cmpi.w #$32,(Ring_count).w
;cmpi.w #$32,(Ring_count).w
if NoSuper=1
cmpi.w #500,(Ring_count).w ; does Sonic have at least 50 rings?
else
cmpi.w #50,(Ring_count).w ; does Sonic have at least 50 rings?
endif
blo.s loc_1515C
tst.b (Update_HUD_timer).w
bne.s Tails_Transform
Expand Down Expand Up @@ -32292,7 +32301,11 @@ Knux_Test_For_Glide:
bne.s loc_1786C

loc_1785E:
cmpi.w #$32,(Ring_count).w
if NoSuper=1
cmpi.w #500,(Ring_count).w ; does Sonic have at least 50 rings?
else
cmpi.w #50,(Ring_count).w ; does Sonic have at least 50 rings?
endif
blo.s loc_1786C
tst.b (Update_HUD_timer).w
bne.s Knux_Transform
Expand Down Expand Up @@ -42935,7 +42948,7 @@ loc_1F1A0:
dbf d1,loc_1F198

loc_1F1FA:
moveq #sfx_Collapse,d0
moveq #sfx_Collapse,d0 ; breakable bar? is that a hcz thing?
jmp (Play_Sound_2).l
; End of function sub_1F188

Expand Down Expand Up @@ -44272,7 +44285,7 @@ locret_2011C:


sub_2011E:
cmpi.b #9,(Current_zone).w
cmpi.b #9,(Current_zone).w ;is current zone 9?
beq.w loc_201C4
moveq #0,d0
move.b $22(a0),d0
Expand Down Expand Up @@ -45491,7 +45504,7 @@ loc_21536:
move.l #word_21A9A,$38(a0)

loc_21568:
move.w (Player_1+x_vel).w,$30(a0)
move.w (Player_1+x_vel).w,$30(a0) ; check velocities....
move.w (Player_2+x_vel).w,$32(a0)
moveq #0,d1
move.b 7(a0),d1
Expand Down Expand Up @@ -45519,17 +45532,18 @@ loc_215AC:
; ---------------------------------------------------------------------------

loc_215B2:
lea (Player_1).w,a1
lea (Player_1).w,a1 ; load player into a1
move.w $30(a0),d1
move.w d6,d0
andi.w #1,d0
beq.s loc_2162A
tst.b (Super_Sonic_Knux_flag).w
bne.s loc_215F4
cmpi.b #2,$38(a1)
beq.s loc_215F4
btst #4,$2B(a1)
bne.s loc_215E0
;cmpi.b #2,$38(a1) ; checking character id for knux
bra.s loc_215F4
;beq.s loc_215F4 ; if knolf...
btst #4,$2B(a1) ; testing secondary status for fireshield blast
bne.s loc_215E0
btst #5,$2A(a0)
beq.s loc_2162A

Expand All @@ -45545,8 +45559,8 @@ loc_215EE:
blo.s loc_2162A

loc_215F4:
bclr #5,$2A(a0)
bsr.s sub_2165A
bclr #5,$2A(a0)
bsr.s sub_2165A ; break?
btst #6,$2A(a0)
beq.s loc_215AC
lea (Player_2).w,a1
Expand Down Expand Up @@ -45593,7 +45607,7 @@ loc_2167A:
bclr #5,$2A(a1)
move.l #loc_21692,(a0)
addq.b #1,$22(a0)
bsr.s sub_216B0
bsr.s sub_216B0 ;smash the wall

loc_21692:
jsr (MoveSprite2).l
Expand Down

0 comments on commit 23a778b

Please sign in to comment.