From a2be34b4af4595bb4ed2fbe3cf85a578c61deecc Mon Sep 17 00:00:00 2001 From: "Matthew D. Steele" Date: Sat, 14 Sep 2024 12:35:46 -0400 Subject: [PATCH] Use fall macro in more places --- src/audio.asm | 4 ++-- src/harm.asm | 2 +- src/null.asm | 36 +++++++++--------------------------- src/platforms/crate.asm | 2 +- src/point.asm | 4 ++-- src/rooms/crypt_south.asm | 2 +- src/rooms/temple_altar.asm | 2 +- src/trig.asm | 2 +- 8 files changed, 18 insertions(+), 36 deletions(-) diff --git a/src/audio.asm b/src/audio.asm index aa549e8f..f5169cd7 100644 --- a/src/audio.asm +++ b/src/audio.asm @@ -303,7 +303,7 @@ _ResetChannels: rts _Enabled: jsr Func_AudioContinueAllSfx - .assert * = Func_AudioContinueMusic, error, "fallthrough" + fall Func_AudioContinueMusic .ENDPROC ;;; Continues playing the current music. @@ -674,7 +674,7 @@ _SoundFinished: lda #eSound::None sta Ram_Sound_sChanSfx_arr + sChanSfx::Sfx_eSound, x ;; Disable the channel. - .assert * = Func_DisableCurrentChannel, error, "fallthrough" + fall Func_DisableCurrentChannel ; preserves X .ENDPROC ;;; Disables the current APU channel. diff --git a/src/harm.asm b/src/harm.asm index e774b9c0..ea7fa851 100644 --- a/src/harm.asm +++ b/src/harm.asm @@ -103,7 +103,7 @@ _SetVelX: sta Zp_AvatarFlags_bObj lda #kAvatarHarmDeath sta Zp_AvatarHarmTimer_u8 - .assert * = Func_DropFlower, error, "fallthrough" + fall Func_DropFlower ; preserves X, Y, and T0+ .ENDPROC ;;; If the player avatar is carrying a flower, drops the flower. Otherwise, diff --git a/src/null.asm b/src/null.asm index 2d5f18b1..84f1287f 100644 --- a/src/null.asm +++ b/src/null.asm @@ -27,44 +27,26 @@ .SEGMENT "PRG8" ;;; An empty sActor array (that is immediately terminated by eActor::None). -.EXPORT Data_Empty_sActor_arr -.PROC Data_Empty_sActor_arr - .assert eActor::None = 0, error - .assert * = Data_Zero_u8, error, "fallthrough" -.ENDPROC +.EXPORT Data_Empty_sActor_arr := Data_Zero_u8 +.ASSERT eActor::None = 0, error ;;; A music chain that contains nothing but a HALT ($00) item. -.EXPORT Data_Empty_bChain_arr -.PROC Data_Empty_bChain_arr - .assert * = Data_Zero_u8, error, "fallthrough" -.ENDPROC +.EXPORT Data_Empty_bChain_arr := Data_Zero_u8 ;;; An empty sDevice array (that is immediately terminated by eDevice::None). -.EXPORT Data_Empty_sDevice_arr -.PROC Data_Empty_sDevice_arr - .assert eDevice::None = 0, error - .assert * = Data_Zero_u8, error, "fallthrough" -.ENDPROC +.EXPORT Data_Empty_sDevice_arr := Data_Zero_u8 +.ASSERT eDevice::None = 0, error ;;; A music opcode array that contains nothing but a STOP ($00) opcode. -.EXPORT Data_Empty_bMusic_arr -.PROC Data_Empty_bMusic_arr - .assert * = Data_Zero_u8, error, "fallthrough" -.ENDPROC +.EXPORT Data_Empty_bMusic_arr := Data_Zero_u8 ;;; A sPhrase struct that contains nothing but a DONE ($00) note. -.EXPORT Data_Empty_sPhrase -.PROC Data_Empty_sPhrase - .assert * = Data_Zero_u8, error, "fallthrough" -.ENDPROC +.EXPORT Data_Empty_sPhrase := Data_Zero_u8 ;;; An empty sPlatform array (that is immediately terminated by ;;; ePlatform::None). -.EXPORT Data_Empty_sPlatform_arr -.PROC Data_Empty_sPlatform_arr - .assert ePlatform::None = 0, error - .assert * = Data_Zero_u8, error, "fallthrough" -.ENDPROC +.EXPORT Data_Empty_sPlatform_arr := Data_Zero_u8 +.ASSERT ePlatform::None = 0, error ;;; A byte that is zero, which can serve as a null value for all of the above ;;; exported symbols. diff --git a/src/platforms/crate.asm b/src/platforms/crate.asm index 2dca9ca7..924c4bcf 100644 --- a/src/platforms/crate.asm +++ b/src/platforms/crate.asm @@ -57,7 +57,7 @@ kPaletteObjPlatformStack = 0 .EXPORT FuncA_Objects_DrawCratePlatform .PROC FuncA_Objects_DrawCratePlatform lda #kTileIdObjCrateFirst ; param: first tile ID - .assert * = FuncA_Objects_Draw2x2PlatformStack, error, "fallthrough" + fall FuncA_Objects_Draw2x2PlatformStack .ENDPROC ;;; Draws a platform that is a stack of one or more 2x2 shapes. The diff --git a/src/point.asm b/src/point.asm index ab72af07..e72a0290 100644 --- a/src/point.asm +++ b/src/point.asm @@ -65,7 +65,7 @@ Zp_PointY_i16: .res 2 .PROC Func_MovePointLeftByA eor #$ff ; param: negative offset sec ; param: carry bit - .assert * = Func_MovePointHorzNegative, error, "fallthrough" + fall Func_MovePointHorzNegative ; preserves X, Y, and T0+ .ENDPROC ;;; Helper function for Func_MovePointHorz and Func_MovePointLeftByA. @@ -113,7 +113,7 @@ Zp_PointY_i16: .res 2 .PROC Func_MovePointUpByA eor #$ff ; param: negative offset sec ; param: carry bit - .assert * = Func_MovePointVertNegative, error, "fallthrough" + fall Func_MovePointVertNegative ; preserves X, Y, and T0+ .ENDPROC ;;; Helper function for Func_MovePointVert and Func_MovePointUpByA. diff --git a/src/rooms/crypt_south.asm b/src/rooms/crypt_south.asm index e291155d..e3f38605 100644 --- a/src/rooms/crypt_south.asm +++ b/src/rooms/crypt_south.asm @@ -466,7 +466,7 @@ _MoveHorz: _Finished: lda Zp_RoomState + sState::WinchReset_eResetSeq jeq FuncA_Machine_WinchReachedGoal - .assert * = FuncC_Crypt_SouthWinch_Reset, error, "fallthrough" + fall FuncC_Crypt_SouthWinch_Reset .ENDPROC .PROC FuncC_Crypt_SouthWinch_Reset diff --git a/src/rooms/temple_altar.asm b/src/rooms/temple_altar.asm index 80669be0..fa70e88a 100644 --- a/src/rooms/temple_altar.asm +++ b/src/rooms/temple_altar.asm @@ -551,7 +551,7 @@ _MoveToUpperRight: _MoveToLowerRight: lda #eResetSeq::LowerRight sta Zp_RoomState + sState::LowerMinigun_eResetSeq - .assert * = FuncC_Temple_AltarLowerMinigun_Init, error, "fallthrough" + fall FuncC_Temple_AltarLowerMinigun_Init .ENDPROC .PROC FuncC_Temple_AltarLowerMinigun_Init diff --git a/src/trig.asm b/src/trig.asm index 1a6dc72e..c5d00387 100644 --- a/src/trig.asm +++ b/src/trig.asm @@ -32,7 +32,7 @@ .EXPORT Func_Cosine .PROC Func_Cosine add #$40 - .assert * = Func_Sine, error, "fallthrough" + fall Func_Sine .ENDPROC ;;; Computes the sine of an angle.