Skip to content

Commit

Permalink
Use fall macro in more places
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsteele committed Sep 14, 2024
1 parent be76f47 commit a2be34b
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 36 deletions.
4 changes: 2 additions & 2 deletions src/audio.asm
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ _ResetChannels:
rts
_Enabled:
jsr Func_AudioContinueAllSfx
.assert * = Func_AudioContinueMusic, error, "fallthrough"
fall Func_AudioContinueMusic
.ENDPROC

;;; Continues playing the current music.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/harm.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
36 changes: 9 additions & 27 deletions src/null.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/crate.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/point.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/rooms/crypt_south.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/rooms/temple_altar.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/trig.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a2be34b

Please sign in to comment.