From c2772a54e555e242099c867ea224548c97fb1096 Mon Sep 17 00:00:00 2001 From: "Matthew D. Steele" Date: Sun, 20 Oct 2024 18:36:31 -0400 Subject: [PATCH] Use fall macro in more places --- src/actors/rodent.asm | 4 ++-- src/cutscene.asm | 4 ++-- src/hud.asm | 2 +- src/machines/crane.asm | 2 +- src/machines/minigun.asm | 6 +++--- src/machines/semaphore.asm | 6 +++--- src/machines/winch.asm | 4 ++-- src/platforms/chex.asm | 4 ++-- src/rooms/boss_city.asm | 4 ++-- src/rooms/city_building3.asm | 2 +- src/rooms/core_elevator.asm | 2 +- src/rooms/core_lock.asm | 2 +- src/rooms/core_south.asm | 3 ++- src/rooms/factory_elevator.asm | 6 +++--- src/rooms/garden_shaft.asm | 2 +- src/rooms/lava_center.asm | 2 +- src/rooms/mermaid_elevator.asm | 2 +- src/rooms/temple_foyer.asm | 4 ++-- src/sounds/explode.asm | 4 ++-- src/terrain.asm | 2 +- 20 files changed, 34 insertions(+), 33 deletions(-) diff --git a/src/actors/rodent.asm b/src/actors/rodent.asm index 4b404311..63ab0099 100644 --- a/src/actors/rodent.asm +++ b/src/actors/rodent.asm @@ -233,8 +233,8 @@ _CheckDirection: ;; Check if the rodent is running horizontally or vertically. lda Ram_ActorVelY_i16_1_arr, x .assert >kRodentRunSpeed > 0, error - beq FuncA_Actor_TickBadRodent_RunningHorz - .assert * = FuncA_Actor_TickBadRodent_RunningVert, error, "fallthrough" + beq FuncA_Actor_TickBadRodent_RunningHorz ; preserves X + fall FuncA_Actor_TickBadRodent_RunningVert ; preserves X .ENDPROC ;;; Performs per-frame updates for a rodent baddie actor that's in Running diff --git a/src/cutscene.asm b/src/cutscene.asm index 6ef37b9f..e856f54f 100644 --- a/src/cutscene.asm +++ b/src/cutscene.asm @@ -141,7 +141,7 @@ Ram_Next_sCutscene_ptr_1_arr: .res kMaxForks .EXPORT Main_Cutscene_Start .PROC Main_Cutscene_Start jsr_prga FuncA_Cutscene_Init - .assert * = Main_Cutscene_Continue, error, "fallthrough" + fall Main_Cutscene_Continue .ENDPROC ;;; Mode for continuing a cutscene that's already in progress. @@ -343,7 +343,7 @@ _InitMainFork: ;;; @return Y A parameter for the main to jump to, if any. .PROC FuncA_Cutscene_AdvanceForkAndExecute jsr FuncA_Cutscene_AdvanceFork - .assert * = FuncA_Cutscene_ExecuteOneFork, error, "fallthrough" + fall FuncA_Cutscene_ExecuteOneFork ; returns C, T1T0, and Y .ENDPROC ;;; Executes actions for the current frame on the current cutscene fork. diff --git a/src/hud.asm b/src/hud.asm index e6434cff..ddf02a53 100644 --- a/src/hud.asm +++ b/src/hud.asm @@ -154,7 +154,7 @@ _CalculateMargin: sbc #0 sta Zp_ShapePosY_i16 + 1 jsr Func_SetMachineIndex - .assert * = FuncA_Objects_DrawHudRegisters, error, "fallthrough" + fall FuncA_Objects_DrawHudRegisters .ENDPROC ;;; Draws all register name/value pairs for the HUD. The screen Y-position of diff --git a/src/machines/crane.asm b/src/machines/crane.asm index fab66a93..f417a7ac 100644 --- a/src/machines/crane.asm +++ b/src/machines/crane.asm @@ -193,7 +193,7 @@ _LeftClaw: jsr FuncA_Objects_Draw1x1Shape pla ; pulley platform index tax ; param: pulley platform index - .assert * = FuncA_Objects_DrawCraneRopeToPulley, error, "fallthrough" + fall FuncA_Objects_DrawCraneRopeToPulley .ENDPROC ;;; Draws a rope that the current crane machine is hanging from up to the diff --git a/src/machines/minigun.asm b/src/machines/minigun.asm index 4deda9dd..8acadf27 100644 --- a/src/machines/minigun.asm +++ b/src/machines/minigun.asm @@ -202,7 +202,7 @@ _RightHalf: lda #kTileWidthPx * 2 ; param: offset jsr FuncA_Objects_MoveShapeRightByA ; preserves X lda #kPaletteObjMinigun ; param: object flags - .assert * = FuncA_Objects_DrawMinigunVertLightHalf, error, "fallthrough" + fall FuncA_Objects_DrawMinigunVertLightHalf .ENDPROC ;;; Draws the half with the machine light of a vertical-facing minigun machine. @@ -293,7 +293,7 @@ _RightHalf: jsr FuncA_Objects_MoveShapeRightByA ; preserves T0+ ldx T2 ; param: barrel tile ID offset lda #kPaletteObjMinigun | bObj::FlipH ; param: object flags - .assert * = FuncA_Objects_DrawMinigunHorzBarrelHalf, error, "fallthrough" + fall FuncA_Objects_DrawMinigunHorzBarrelHalf .ENDPROC ;;; Draws the half with the barrel of a side-facing minigun machine. @@ -332,7 +332,7 @@ _RightHalf: lda #kTileWidthPx * 2 ; param: offset jsr FuncA_Objects_MoveShapeRightByA lda #kPaletteObjMinigun ; param: object flags - .assert * = FuncA_Objects_DrawMinigunHorzLightHalf, error, "fallthrough" + fall FuncA_Objects_DrawMinigunHorzLightHalf .ENDPROC ;;; Draws the half with the machine light of a side-facing minigun machine. diff --git a/src/machines/semaphore.asm b/src/machines/semaphore.asm index df9d13d3..86e21b3d 100644 --- a/src/machines/semaphore.asm +++ b/src/machines/semaphore.asm @@ -198,7 +198,7 @@ _CheckIfDone: .EXPORT FuncA_Objects_DrawSemaphoreCommMachine .PROC FuncA_Objects_DrawSemaphoreCommMachine jsr FuncA_Objects_DrawSemaphoreFlags - .assert * = FuncA_Objects_DrawSemaphoreLockMachine, error, "fallthrough" + fall FuncA_Objects_DrawSemaphoreLockMachine .ENDPROC ;;; Draws a semaphore machine that's connected to the lock (and thus doesn't @@ -207,7 +207,7 @@ _CheckIfDone: .EXPORT FuncA_Objects_DrawSemaphoreLockMachine .PROC FuncA_Objects_DrawSemaphoreLockMachine lda #kTileIdObjSemaphoreDistSensor ; param: corner tile ID - .assert * = FuncA_Objects_DrawSemaphoreActuator, error, "fallthrough" + fall FuncA_Objects_DrawSemaphoreActuator .ENDPROC ;;; Draws the movable actuator for a semaphore machine. @@ -246,7 +246,7 @@ _LowerFlag: ldx Zp_MachineIndex_u8 lda Ram_MachineState1_byte_arr, x ; lower bSemaphoreFlag and #bSemaphoreFlag::AngleMask ; param: flag angle - .assert * = FuncA_Objects_DrawSemaphoreFlag, error, "fallthrough" + fall FuncA_Objects_DrawSemaphoreFlag .ENDPROC ;;; Draws one flag on a semaphore machine. diff --git a/src/machines/winch.asm b/src/machines/winch.asm index 91c2f238..2fcd4f6a 100644 --- a/src/machines/winch.asm +++ b/src/machines/winch.asm @@ -371,7 +371,7 @@ _Done: jsr FuncA_Objects_DrawWinchSpikeball jsr FuncA_Objects_MoveShapeUpOneTile jsr FuncA_Objects_MoveShapeLeftHalfTile - .assert * = FuncA_Objects_DrawWinchChain, error, "fallthrough" + fall FuncA_Objects_DrawWinchChain .ENDPROC ;;; Allocates and populates OAM slots for a chain that feeds into a winch @@ -418,7 +418,7 @@ _Done: .endrepeat ldx T0 ; param: chain length in tiles ;; Draw the chain. - .assert * = FuncA_Objects_DrawChainWithLength, error, "fallthrough" + fall FuncA_Objects_DrawChainWithLength .ENDPROC ;;; Allocates and populates OAM slots for a chain of the given length. When diff --git a/src/platforms/chex.asm b/src/platforms/chex.asm index f0f87318..19420df2 100644 --- a/src/platforms/chex.asm +++ b/src/platforms/chex.asm @@ -50,7 +50,7 @@ kPaletteObjPlatformChex = 0 .PROC FuncA_Objects_DrawRocksPlatformHorz .assert kTileIdObjPlatformRocksFirst .mod 2 = 0, error ldy #kTileIdObjPlatformRocksFirst ; param: first tile ID (0 mod 2) - .assert * = FuncA_Objects_DrawPlatformChexHorz, error, "fallthrough" + fall FuncA_Objects_DrawPlatformChexHorz .ENDPROC ;;; Draws a horizontal (Nx1) checkerboarded platform. The platform is assumed @@ -111,7 +111,7 @@ kPaletteObjPlatformChex = 0 .PROC FuncA_Objects_DrawRocksPlatformVert .assert kTileIdObjPlatformRocksFirst .mod 2 = 0, error ldy #kTileIdObjPlatformRocksFirst ; param: first tile ID (0 mod 2) - .assert * = FuncA_Objects_DrawPlatformChexVert, error, "fallthrough" + fall FuncA_Objects_DrawPlatformChexVert .ENDPROC ;;; Draws a vertical (1xN) checkerboarded platform. The platform is assumed to diff --git a/src/rooms/boss_city.asm b/src/rooms/boss_city.asm index 7f4a6223..5ff55739 100644 --- a/src/rooms/boss_city.asm +++ b/src/rooms/boss_city.asm @@ -750,7 +750,7 @@ _SpineAngle_u8_arr5: ldx #kLeftWallPlatformIndex ; param: platform index ldy Zp_RoomState + sState::LeftWallDamage_u8 ; param: damage pattern lda #kTileIdObjPlatformCityWalls + 2 ; param: first tile ID - .assert * = FuncC_Boss_City_DrawSideWall, error, "fallthrough" + fall FuncC_Boss_City_DrawSideWall .ENDPROC ;;; Draws one of the side walls in this room, using the given damage pattern. @@ -860,7 +860,7 @@ _DrawBackgroundTerrainObjects: rts @open: dec Zp_RoomState + sState::BossShellOpen_u8 - .assert * = FuncC_Boss_City_AdjustShellPlatformsVert, error, "fallthrough" + fall FuncC_Boss_City_AdjustShellPlatformsVert .ENDPROC ;;; Adjusts the boss's two shell platforms to their correct vertical position, diff --git a/src/rooms/city_building3.asm b/src/rooms/city_building3.asm index daa924ec..93324963 100644 --- a/src/rooms/city_building3.asm +++ b/src/rooms/city_building3.asm @@ -525,7 +525,7 @@ _SetFlagIfCratesDestroyed: .PROC FuncA_Room_CityBuilding3Reloader_InitReset lda #kReloaderInitGoalX sta Ram_MachineGoalHorz_u8_arr + kReloaderMachineIndex - .assert * = FuncA_Room_CityBuilding3_ResetLevers, error, "fallthrough" + fall FuncA_Room_CityBuilding3_ResetLevers .ENDPROC .PROC FuncA_Room_CityBuilding3_ResetLevers diff --git a/src/rooms/core_elevator.asm b/src/rooms/core_elevator.asm index 5d06bbc2..0129a33e 100644 --- a/src/rooms/core_elevator.asm +++ b/src/rooms/core_elevator.asm @@ -255,7 +255,7 @@ _Passages_sPassage_arr: jsr FuncA_Room_ResetLever lda #0 sta Zp_RoomState + sElevatorState::UpperJetLowerLever_u8 - .assert * = FuncA_Room_CoreElevatorJet_Init, error, "fallthrough" + fall FuncA_Room_CoreElevatorJet_Init .ENDPROC .PROC FuncA_Room_CoreElevatorJet_Init diff --git a/src/rooms/core_lock.asm b/src/rooms/core_lock.asm index dd337fdc..5b30170d 100644 --- a/src/rooms/core_lock.asm +++ b/src/rooms/core_lock.asm @@ -273,7 +273,7 @@ _Passages_sPassage_arr: .PROC FuncC_Core_LockLift3_ReadReg lda #kLift3MaxPlatformTop + kTileHeightPx - .assert * = FuncC_Core_LockLift_ReadReg, error, "fallthrough" + fall FuncC_Core_LockLift_ReadReg .ENDPROC .PROC FuncC_Core_LockLift_ReadReg diff --git a/src/rooms/core_south.asm b/src/rooms/core_south.asm index 18da1277..bf722579 100644 --- a/src/rooms/core_south.asm +++ b/src/rooms/core_south.asm @@ -356,6 +356,7 @@ _WaterBobOffset_i8_arr8: .byte 1, 1, 0, <-1, <-1, <-1, 0, 1 .ENDPROC +;;; @prereq PRGA_Objects is loaded. .PROC FuncC_Core_South_DrawRoom _Anchors: ldx #kAnchor1PlatformIndex @@ -374,7 +375,7 @@ _LowerCrates: jsr FuncC_Core_South_DrawAnchoredCrate _UpperCrates: ldx #kCrate3PlatformIndex ; param: platform index - .assert * = FuncC_Core_South_DrawAnchoredCrate, error, "fallthrough" + fall FuncC_Core_South_DrawAnchoredCrate .ENDPROC ;;; Draws a platform that is a stack of one or more wooden crates with a chain diff --git a/src/rooms/factory_elevator.asm b/src/rooms/factory_elevator.asm index 2a73199e..065e771c 100644 --- a/src/rooms/factory_elevator.asm +++ b/src/rooms/factory_elevator.asm @@ -455,7 +455,7 @@ _StoreElevatorState: lda Zp_AvatarPosY_i16 + 1 beq FuncA_Room_StoreElevatorJetState ldx #kLowerJetMachineIndex ; param: machine index - .assert * = FuncA_Room_StoreElevatorJetState, error, "fallthrough" + fall FuncA_Room_StoreElevatorJetState .ENDPROC ;;; Stores state data for the specified jet machine in Zp_RoomState, so that it @@ -563,7 +563,7 @@ _Hud: sta Zp_RoomState + sElevatorState::UpperJetUpperLever_u8 ldx #kUpperJetLowerLeverDeviceIndex ; param: device index jsr FuncA_Room_ResetLever - .assert * = FuncA_Room_FactoryElevatorUpperJet_Init, error, "fallthrough" + fall FuncA_Room_FactoryElevatorUpperJet_Init .ENDPROC .PROC FuncA_Room_FactoryElevatorUpperJet_Init @@ -577,7 +577,7 @@ _Hud: jsr FuncA_Room_ResetLever lda #0 sta Zp_RoomState + sElevatorState::LowerJetLowerLever_u8 - .assert * = FuncA_Room_FactoryElevatorLowerJet_Init, error, "fallthrough" + fall FuncA_Room_FactoryElevatorLowerJet_Init .ENDPROC .PROC FuncA_Room_FactoryElevatorLowerJet_Init diff --git a/src/rooms/garden_shaft.asm b/src/rooms/garden_shaft.asm index cbc90411..a7309ad0 100644 --- a/src/rooms/garden_shaft.asm +++ b/src/rooms/garden_shaft.asm @@ -251,7 +251,7 @@ _Passages_sPassage_arr: ldx Zp_MachineIndex_u8 lda #kBridgeMaxAngle sta Ram_MachineState1_byte_arr, x ; bridge angle (0-kBridgeMaxAngle) - .assert * = FuncC_Garden_ShaftBridge_Reset, error, "fallthrough" + fall FuncC_Garden_ShaftBridge_Reset .ENDPROC .PROC FuncC_Garden_ShaftBridge_Reset diff --git a/src/rooms/lava_center.asm b/src/rooms/lava_center.asm index 81590884..4ca0cac2 100644 --- a/src/rooms/lava_center.asm +++ b/src/rooms/lava_center.asm @@ -583,7 +583,7 @@ _Mirrors: ;; If the crate's chain hasn't been broken yet, we're done. jsr FuncA_Room_LavaCenter_IsCrateFlagSet ; preserves X, returns C bcs FuncA_Room_LavaCenter_TickFallingCrate ; preserves X - .assert * = FuncA_Room_LavaCenter_TickHangingCrate, error, "fallthrough" + fall FuncA_Room_LavaCenter_TickHangingCrate ; preserves X .ENDPROC ;;; Performs per-frame updates for a crate in this room that's still hanging. diff --git a/src/rooms/mermaid_elevator.asm b/src/rooms/mermaid_elevator.asm index 56c0b1b9..e66eaecb 100644 --- a/src/rooms/mermaid_elevator.asm +++ b/src/rooms/mermaid_elevator.asm @@ -268,7 +268,7 @@ _Passages_sPassage_arr: sta Zp_RoomState + sElevatorState::LowerJetUpperLever_u8 ldx #kLowerJetLowerLeverDeviceIndex ; param: device index jsr FuncA_Room_ResetLever - .assert * = FuncA_Room_MermaidElevatorJet_Init, error, "fallthrough" + fall FuncA_Room_MermaidElevatorJet_Init .ENDPROC .PROC FuncA_Room_MermaidElevatorJet_Init diff --git a/src/rooms/temple_foyer.asm b/src/rooms/temple_foyer.asm index 9fe4be7e..d84cc11d 100644 --- a/src/rooms/temple_foyer.asm +++ b/src/rooms/temple_foyer.asm @@ -286,7 +286,7 @@ _MoveHorz: _ReachedGoal: lda Zp_RoomState + sState::CarriageReset_eResetSeq jeq FuncA_Machine_ReachedGoal - .assert * = FuncC_Temple_FoyerCarriage_Reset, error, "fallthrough" + fall FuncC_Temple_FoyerCarriage_Reset .ENDPROC .PROC FuncC_Temple_FoyerCarriage_Reset @@ -310,7 +310,7 @@ _MoveStraightToMiddle: _MoveToBottomRight: lda #eResetSeq::BottomRight sta Zp_RoomState + sState::CarriageReset_eResetSeq - .assert * = FuncC_Temple_FoyerCarriage_Init, error, "fallthrough" + fall FuncC_Temple_FoyerCarriage_Init .ENDPROC .PROC FuncC_Temple_FoyerCarriage_Init diff --git a/src/sounds/explode.asm b/src/sounds/explode.asm index 826d4cbc..7850ad57 100644 --- a/src/sounds/explode.asm +++ b/src/sounds/explode.asm @@ -103,7 +103,7 @@ _NoisePeriod_u8_arr: .PROC Func_PlaySfxExplodeFracture lda #bSfxExplode::DivEnv sta Zp_Next_sChanSfx_arr + eChan::Noise + sChanSfx::Param1_byte - .assert * = Func_PlaySfxExplodeLong, error, "fallthrough" + fall Func_PlaySfxExplodeLong ; preserve X, Y, and T0+ .ENDPROC ;;; Starts playing a explosion sound with a longer duration. @@ -111,7 +111,7 @@ _NoisePeriod_u8_arr: ;;; @preserve X, Y, T0+ .PROC Func_PlaySfxExplodeLong lda #$1f - .assert * = Func_PlaySfxExplode, error, "fallthrough" + fall Func_PlaySfxExplode ; preserve X, Y, and T0+ .ENDPROC ;;; Starts playing a explosion sound. diff --git a/src/terrain.asm b/src/terrain.asm index d448c6da..029d7196 100644 --- a/src/terrain.asm +++ b/src/terrain.asm @@ -137,7 +137,7 @@ _TallRoom: lda Zp_PointX_i16 + 1 ; effectively block col * 16 (hi) adc Zp_TerrainColumn_u8_arr_ptr + 1 ; block col * 8 (hi) sta Zp_TerrainColumn_u8_arr_ptr + 1 ; block col * 24 (hi) - .assert * = Func_GetTerrainColumnPtrForByteOffset, error, "fallthrough" + fall Func_GetTerrainColumnPtrForByteOffset .ENDPROC ;;; Adds (Zp_Current_sRoom + sRoom::TerrainData_ptr) to