diff --git a/src/actors/egg.asm b/src/actors/egg.asm index c8184a1a..f748f133 100644 --- a/src/actors/egg.asm +++ b/src/actors/egg.asm @@ -34,6 +34,7 @@ .IMPORT Func_InitActorDefault .IMPORT Func_InitActorSmokeExplosion .IMPORT Func_IsPointInAnySolidPlatform +.IMPORT Func_PlaySfxPoof .IMPORT Func_PointHitsTerrain .IMPORT Func_SetActorCenterToPoint .IMPORT Func_SetPointToActorCenter @@ -113,7 +114,7 @@ _Hatch: @noSpawn: ldx T0 ; egg actor index _Break: - ;; TODO: play a sound for the egg breaking/hatching + jsr Func_PlaySfxPoof ; preserves X jmp Func_InitActorSmokeExplosion ; preserves X _Remove: lda #eActor::None diff --git a/src/devices/upgrade.asm b/src/devices/upgrade.asm index ca494d5b..65359382 100644 --- a/src/devices/upgrade.asm +++ b/src/devices/upgrade.asm @@ -27,9 +27,9 @@ .IMPORT FuncA_Objects_MoveShapeRightOneTile .IMPORT FuncA_Objects_SetShapePosToDeviceTopLeft .IMPORT FuncA_Objects_SetUpgradeTileIds -.IMPORT FuncA_Room_PlaySfxSpawnUpgrade .IMPORT Func_FindEmptyActorSlot .IMPORT Func_InitActorSmokeExplosion +.IMPORT Func_PlaySfxPoof .IMPORT Ram_ActorPosX_i16_0_arr .IMPORT Ram_ActorPosX_i16_1_arr .IMPORT Ram_ActorPosY_i16_0_arr @@ -94,7 +94,7 @@ _SmokePuff: jsr Func_InitActorSmokeExplosion @done: _PlaySound: - jmp FuncA_Room_PlaySfxSpawnUpgrade + jmp Func_PlaySfxPoof .ENDPROC ;;;=========================================================================;;; diff --git a/src/machines/blaster.asm b/src/machines/blaster.asm index 4df8be3c..37a03d52 100644 --- a/src/machines/blaster.asm +++ b/src/machines/blaster.asm @@ -34,6 +34,7 @@ .IMPORT FuncA_Objects_GetMachineLightTileId .IMPORT FuncA_Objects_SetShapePosToPlatformTopLeft .IMPORT Func_FindEmptyActorSlot +.IMPORT Func_InitActorDefault .IMPORT Func_InitActorProjFireblast .IMPORT Func_IsPointInPlatform .IMPORT Func_MovePointDownByA @@ -218,9 +219,10 @@ _Reflect: sta Ram_ActorState3_byte_arr, x ; reflection timer bne _Continue ; unconditional _Remove: - ;; TODO: turn to smoke - lda #eActor::None - sta Ram_ActorType_eActor_arr, x + sty T0 ; mirror platform index + ldy #eActor::SmokeParticle ; param: actor type + jsr Func_InitActorDefault ; preserves X and T0+ + ldy T0 ; mirror platform index _Continue: dex .assert kMaxActors <= $80, error diff --git a/src/rooms/core_south.asm b/src/rooms/core_south.asm index 2aca9628..18da1277 100644 --- a/src/rooms/core_south.asm +++ b/src/rooms/core_south.asm @@ -47,6 +47,7 @@ .IMPORT Func_MovePointDownByA .IMPORT Func_MovePointVert .IMPORT Func_Noop +.IMPORT Func_PlaySfxPoof .IMPORT Func_SetActorCenterToPoint .IMPORT Func_SetFlag .IMPORT Func_SetPlatformTopToPointY @@ -451,6 +452,7 @@ _ReleaseCratesFunc: jsr Func_SetActorCenterToPoint ; preserves X jsr Func_InitActorSmokeExplosion @doneSmoke: + jsr Func_PlaySfxPoof ldx #eFlag::CoreSouthCorraHelped ; param: flag jmp Func_SetFlag _SwimUpFunc: diff --git a/src/rooms/lava_center.asm b/src/rooms/lava_center.asm index 424f0398..81590884 100644 --- a/src/rooms/lava_center.asm +++ b/src/rooms/lava_center.asm @@ -58,6 +58,7 @@ .IMPORT Func_MachineBlasterReadRegM .IMPORT Func_MovePlatformTopTowardPointY .IMPORT Func_MovePlatformVert +.IMPORT Func_PlaySfxPoof .IMPORT Func_SetFlag .IMPORT Func_SetPointToActorCenter .IMPORT Ppu_ChrObjLava @@ -608,7 +609,7 @@ _Mirrors: jsr Func_SetFlag ; preserves T0+ ldx T1 ; actor index jsr Func_InitActorSmokeExplosion ; preserves X and T0+ - ;; TODO: play a sound for the chain breaking + jsr Func_PlaySfxPoof ; preserves X and T0+ @continue: dex .assert kMaxActors <= $80, error diff --git a/src/sounds/upgrade.asm b/src/sounds/poof.asm similarity index 80% rename from src/sounds/upgrade.asm rename to src/sounds/poof.asm index 4ea8de7a..a090445e 100644 --- a/src/sounds/upgrade.asm +++ b/src/sounds/poof.asm @@ -28,9 +28,8 @@ .SEGMENT "PRG8" -;;; SFX sequence data for pulse channel portion of the "spawn upgrade" sound -;;; effect. -.PROC Data_SpawnUpgradePulse_sSfxSeq_arr +;;; SFX sequence data for pulse channel portion of the "poof" sound effect. +.PROC Data_PoofPulse_sSfxSeq_arr .linecont + D_STRUCT sSfxSeq d_byte Duration_u8, 12 @@ -43,9 +42,8 @@ .linecont - .ENDPROC -;;; SFX sequence data for pulse channel portion of the "spawn upgrade" sound -;;; effect. -.PROC Data_SpawnUpgradeNoise_sSfxSeq_arr +;;; SFX sequence data for pulse channel portion of the "poof" sound effect. +.PROC Data_PoofNoise_sSfxSeq_arr D_STRUCT sSfxSeq d_byte Duration_u8, 15 d_byte Env_bEnvelope, bEnvelope::NoLength | 3 @@ -57,18 +55,24 @@ ;;;=========================================================================;;; -.SEGMENT "PRGA_Room" +.SEGMENT "PRG8" -;;; Starts playing the sound for when an upgrade is spawned. -;;; @preserve T0+ -.EXPORT FuncA_Room_PlaySfxSpawnUpgrade -.PROC FuncA_Room_PlaySfxSpawnUpgrade +;;; Starts playing the sound for a poof of smoke e.g. when an upgrade spawns, +;;; or a chain is broken, or an egg hatches. +;;; @preserve X, T0+ +.EXPORT Func_PlaySfxPoof +.PROC Func_PlaySfxPoof + txa + pha ldx #eChan::Pulse2 - ldya #Data_SpawnUpgradePulse_sSfxSeq_arr + ldya #Data_PoofPulse_sSfxSeq_arr jsr Func_PlaySfxSequence ; preserves T0+ ldx #eChan::Noise - ldya #Data_SpawnUpgradeNoise_sSfxSeq_arr - jmp Func_PlaySfxSequence ; preserves T0+ + ldya #Data_PoofNoise_sSfxSeq_arr + jsr Func_PlaySfxSequence ; preserves T0+ + pla + tax + rts .ENDPROC ;;;=========================================================================;;;