From 8ccb1dfb66d3f70e6ecac848f17dd92672e86253 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Mon, 13 Jun 2022 23:39:22 +0100 Subject: [PATCH] [decomp] macros for sound playback (#1453) * `sound-play` macro * update source * fix `add-debug-light` lol * fix `add-debug-light` forreal * Update debug.gc * update some mood/tod decomp --- common/util/print_float.cpp | 18 +- common/util/print_float.h | 1 + decompiler/IR2/FormExpressionAnalysis.cpp | 127 ++++++++++++ decompiler/config/all-types.gc | 33 +++- .../jak1_ntsc_black_label/var_names.jsonc | 13 +- goal_src/engine/ambient/ambient.gc | 6 +- goal_src/engine/ambient/mood.gc | 30 ++- goal_src/engine/camera/cam-master.gc | 2 +- goal_src/engine/camera/cam-states.gc | 8 +- .../engine/collide/collide-reaction-target.gc | 2 +- goal_src/engine/debug/debug.gc | 35 ++-- goal_src/engine/draw/drawable.gc | 153 +++++++-------- goal_src/engine/game/collectables-part.gc | 3 +- goal_src/engine/game/collectables.gc | 18 +- goal_src/engine/game/crates.gc | 14 +- goal_src/engine/game/effect-control.gc | 2 +- goal_src/engine/game/game-info.gc | 12 +- goal_src/engine/game/generic-obs.gc | 4 +- goal_src/engine/game/main.gc | 8 +- goal_src/engine/game/powerups.gc | 14 +- goal_src/engine/game/projectiles.gc | 10 +- goal_src/engine/game/settings.gc | 8 +- goal_src/engine/gfx/time-of-day.gc | 182 +++++++++--------- goal_src/engine/gfx/water/water.gc | 6 +- goal_src/engine/ps2/pad.gc | 4 +- goal_src/engine/sound/gsound-h.gc | 21 +- goal_src/engine/sound/gsound.gc | 25 ++- goal_src/engine/target/target-death.gc | 23 +-- goal_src/engine/target/target-handler.gc | 16 +- goal_src/engine/target/target-part.gc | 2 +- goal_src/engine/target/target-util.gc | 4 +- goal_src/engine/target/target.gc | 20 +- goal_src/engine/target/target2.gc | 10 +- goal_src/engine/ui/hud-classes.gc | 2 +- goal_src/engine/ui/hud.gc | 2 +- goal_src/engine/ui/progress/progress.gc | 102 +++++----- goal_src/levels/beach/beach-obs.gc | 16 +- goal_src/levels/beach/lurkercrab.gc | 4 +- goal_src/levels/beach/lurkerpuppy.gc | 4 +- goal_src/levels/beach/lurkerworm.gc | 2 +- goal_src/levels/beach/pelican.gc | 2 +- goal_src/levels/beach/seagull.gc | 2 +- goal_src/levels/citadel/citadel-obs.gc | 86 +++++---- goal_src/levels/citadel/citadel-sages.gc | 4 +- goal_src/levels/citadel/citb-drop-plat.gc | 4 +- goal_src/levels/citadel/citb-plat.gc | 30 +-- goal_src/levels/common/basebutton.gc | 12 +- goal_src/levels/common/baseplat.gc | 20 +- goal_src/levels/common/battlecontroller.gc | 2 +- goal_src/levels/common/launcherdoor.gc | 4 +- goal_src/levels/common/orb-cache.gc | 6 +- goal_src/levels/common/plat-button.gc | 6 +- goal_src/levels/common/plat-eco.gc | 10 +- goal_src/levels/common/plat.gc | 10 +- goal_src/levels/common/rigid-body.gc | 10 +- goal_src/levels/common/sharkey.gc | 17 +- goal_src/levels/common/ticky.gc | 2 +- goal_src/levels/finalboss/final-door.gc | 4 +- goal_src/levels/finalboss/green-eco-lurker.gc | 32 +-- goal_src/levels/finalboss/robotboss-weapon.gc | 8 +- goal_src/levels/finalboss/robotboss.gc | 20 +- goal_src/levels/finalboss/sage-finalboss.gc | 10 +- goal_src/levels/firecanyon/firecanyon-obs.gc | 6 +- goal_src/levels/flut_common/target-flut.gc | 33 ++-- goal_src/levels/jungle/bouncer.gc | 2 +- goal_src/levels/jungle/fisher.gc | 10 +- goal_src/levels/jungle/jungle-mirrors.gc | 67 ++----- goal_src/levels/jungle/jungle-obs.gc | 20 +- goal_src/levels/jungle/junglesnake.gc | 10 +- goal_src/levels/jungleb/aphid.gc | 4 +- goal_src/levels/jungleb/jungleb-obs.gc | 6 +- goal_src/levels/jungleb/plant-boss.gc | 13 +- goal_src/levels/jungleb/plat-flip.gc | 4 +- goal_src/levels/lavatube/lavatube-energy.gc | 2 +- goal_src/levels/lavatube/lavatube-obs.gc | 6 +- goal_src/levels/maincave/dark-crystal.gc | 17 +- goal_src/levels/maincave/driller-lurker.gc | 5 +- goal_src/levels/maincave/gnawer.gc | 4 +- goal_src/levels/maincave/maincave-obs.gc | 2 +- goal_src/levels/maincave/maincave-part.gc | 2 +- goal_src/levels/maincave/mother-spider-egg.gc | 13 +- .../levels/maincave/mother-spider-proj.gc | 13 +- goal_src/levels/maincave/mother-spider.gc | 27 ++- goal_src/levels/maincave/spiderwebs.gc | 2 +- goal_src/levels/misty/balloonlurker.gc | 26 +-- goal_src/levels/misty/misty-conveyor.gc | 14 +- goal_src/levels/misty/misty-obs.gc | 2 +- goal_src/levels/misty/misty-warehouse.gc | 2 +- goal_src/levels/misty/mistycannon.gc | 50 +---- goal_src/levels/misty/muse.gc | 2 +- goal_src/levels/misty/quicksandlurker.gc | 10 +- goal_src/levels/ogre/flying-lurker.gc | 11 +- goal_src/levels/ogre/ogre-obs.gc | 4 +- goal_src/levels/ogre/ogreboss.gc | 72 +------ goal_src/levels/racer_common/racer-states.gc | 30 ++- goal_src/levels/racer_common/target-racer.gc | 20 +- .../levels/rolling/rolling-lightning-mole.gc | 2 +- goal_src/levels/rolling/rolling-obs.gc | 8 +- goal_src/levels/rolling/rolling-race-ring.gc | 2 +- goal_src/levels/snow/ice-cube.gc | 24 ++- goal_src/levels/snow/snow-ball.gc | 25 +-- goal_src/levels/snow/snow-bumper.gc | 2 +- goal_src/levels/snow/snow-flutflut-obs.gc | 2 +- goal_src/levels/snow/snow-obs.gc | 60 ++---- goal_src/levels/snow/snow-ram-boss.gc | 22 ++- goal_src/levels/snow/snow-ram.gc | 6 +- goal_src/levels/sunken/bully.gc | 25 +-- goal_src/levels/sunken/helix-water.gc | 8 +- goal_src/levels/sunken/puffer.gc | 10 +- goal_src/levels/sunken/qbert-plat.gc | 4 +- goal_src/levels/sunken/square-platform.gc | 2 +- goal_src/levels/sunken/steam-cap.gc | 8 +- goal_src/levels/sunken/sun-exit-chamber.gc | 2 +- goal_src/levels/sunken/sun-iris-door.gc | 4 +- goal_src/levels/sunken/sunken-water.gc | 6 +- goal_src/levels/sunken/target-tube.gc | 14 +- goal_src/levels/sunken/wall-plat.gc | 6 +- goal_src/levels/swamp/billy.gc | 4 +- goal_src/levels/swamp/kermit.gc | 22 +-- goal_src/levels/swamp/swamp-obs.gc | 2 +- goal_src/levels/swamp/swamp-rat-nest.gc | 31 +-- goal_src/levels/title/title-obs.gc | 4 +- goal_src/levels/training/training-obs.gc | 4 +- goal_src/levels/training/training-part.gc | 2 +- goal_src/levels/village1/assistant.gc | 12 +- goal_src/levels/village1/fishermans-boat.gc | 14 +- goal_src/levels/village1/village1-part2.gc | 2 +- .../levels/village2/assistant-village2.gc | 12 +- goal_src/levels/village2/village2-obs.gc | 16 +- goal_src/levels/village2/village2-part.gc | 2 +- goal_src/levels/village3/village3-obs.gc | 2 +- .../levels/village_common/villagep-obs.gc | 27 +-- goal_src/pc/progress-pc.gc | 98 +++++----- .../decompiler/reference/decompiler-macros.gc | 8 + .../reference/engine/ambient/ambient_REF.gc | 6 +- .../reference/engine/ambient/mood_REF.gc | 30 ++- .../collide/collide-reaction-target_REF.gc | 2 +- .../reference/engine/draw/drawable_REF.gc | 148 +++++++------- .../reference/engine/game/collectables_REF.gc | 18 +- .../reference/engine/game/crates_REF.gc | 16 +- .../engine/game/effect-control_REF.gc | 2 +- .../reference/engine/game/game-info_REF.gc | 12 +- .../reference/engine/game/generic-obs_REF.gc | 4 +- .../reference/engine/game/main_REF.gc | 20 +- .../reference/engine/game/powerups_REF.gc | 14 +- .../reference/engine/game/projectiles_REF.gc | 10 +- .../reference/engine/game/settings_REF.gc | 8 +- .../reference/engine/gfx/water/water_REF.gc | 2 +- .../reference/engine/sound/gsound-h_REF.gc | 52 ++--- .../reference/engine/sound/gsound_REF.gc | 18 +- .../engine/target/target-death_REF.gc | 20 +- .../engine/target/target-handler_REF.gc | 4 +- .../engine/target/target-part_REF.gc | 2 +- .../reference/engine/target/target2_REF.gc | 10 +- .../reference/engine/target/target_REF.gc | 8 +- .../reference/engine/ui/hud-classes_REF.gc | 2 +- .../decompiler/reference/engine/ui/hud_REF.gc | 2 +- .../engine/ui/progress/progress_REF.gc | 102 +++++----- .../reference/levels/beach/beach-obs_REF.gc | 16 +- .../reference/levels/beach/lurkerpuppy_REF.gc | 4 +- .../reference/levels/beach/lurkerworm_REF.gc | 2 +- .../reference/levels/beach/pelican_REF.gc | 2 +- .../reference/levels/beach/seagull_REF.gc | 2 +- .../levels/citadel/citadel-obs_REF.gc | 86 +++++---- .../levels/citadel/citadel-sages_REF.gc | 4 +- .../levels/citadel/citb-drop-plat_REF.gc | 4 +- .../reference/levels/citadel/citb-plat_REF.gc | 30 +-- .../reference/levels/common/basebutton_REF.gc | 12 +- .../reference/levels/common/baseplat_REF.gc | 20 +- .../levels/common/battlecontroller_REF.gc | 2 +- .../levels/common/launcherdoor_REF.gc | 4 +- .../reference/levels/common/orb-cache_REF.gc | 6 +- .../levels/common/plat-button_REF.gc | 6 +- .../reference/levels/common/plat-eco_REF.gc | 10 +- .../reference/levels/common/plat_REF.gc | 10 +- .../reference/levels/common/rigid-body_REF.gc | 10 +- .../reference/levels/common/sharkey_REF.gc | 17 +- .../reference/levels/common/ticky_REF.gc | 2 +- .../levels/finalboss/final-door_REF.gc | 4 +- .../levels/finalboss/green-eco-lurker_REF.gc | 32 +-- .../levels/finalboss/robotboss-weapon_REF.gc | 8 +- .../levels/finalboss/robotboss_REF.gc | 8 +- .../levels/finalboss/sage-finalboss_REF.gc | 10 +- .../levels/firecanyon/firecanyon-obs_REF.gc | 6 +- .../levels/flut_common/target-flut_REF.gc | 26 +-- .../reference/levels/jungle/bouncer_REF.gc | 2 +- .../reference/levels/jungle/fisher_REF.gc | 10 +- .../levels/jungle/jungle-mirrors_REF.gc | 67 ++----- .../reference/levels/jungle/jungle-obs_REF.gc | 20 +- .../reference/levels/jungleb/aphid_REF.gc | 4 +- .../levels/jungleb/jungleb-obs_REF.gc | 6 +- .../levels/jungleb/plant-boss_REF.gc | 8 +- .../reference/levels/jungleb/plat-flip_REF.gc | 4 +- .../levels/lavatube/lavatube-energy_REF.gc | 2 +- .../levels/lavatube/lavatube-obs_REF.gc | 6 +- .../levels/maincave/dark-crystal_REF.gc | 6 +- .../reference/levels/maincave/gnawer_REF.gc | 4 +- .../levels/maincave/maincave-obs_REF.gc | 2 +- .../levels/maincave/maincave-part_REF.gc | 2 +- .../levels/maincave/mother-spider-egg_REF.gc | 2 +- .../levels/maincave/mother-spider-proj_REF.gc | 6 +- .../levels/maincave/mother-spider_REF.gc | 2 +- .../levels/maincave/spiderwebs_REF.gc | 2 +- .../levels/misty/balloonlurker_REF.gc | 26 +-- .../levels/misty/misty-conveyor_REF.gc | 14 +- .../reference/levels/misty/misty-obs_REF.gc | 2 +- .../levels/misty/misty-warehouse_REF.gc | 2 +- .../reference/levels/misty/mistycannon_REF.gc | 50 +---- .../reference/levels/misty/muse_REF.gc | 2 +- .../levels/misty/quicksandlurker_REF.gc | 10 +- .../reference/levels/ogre/ogre-obs_REF.gc | 4 +- .../reference/levels/ogre/ogreboss_REF.gc | 72 +------ .../levels/racer_common/racer-states_REF.gc | 30 ++- .../levels/racer_common/target-racer_REF.gc | 20 +- .../rolling/rolling-lightning-mole_REF.gc | 2 +- .../levels/rolling/rolling-obs_REF.gc | 8 +- .../levels/rolling/rolling-race-ring_REF.gc | 2 +- .../reference/levels/snow/ice-cube_REF.gc | 12 +- .../reference/levels/snow/snow-ball_REF.gc | 25 +-- .../reference/levels/snow/snow-bumper_REF.gc | 2 +- .../levels/snow/snow-flutflut-obs_REF.gc | 2 +- .../reference/levels/snow/snow-obs_REF.gc | 60 ++---- .../levels/snow/snow-ram-boss_REF.gc | 10 +- .../reference/levels/snow/snow-ram_REF.gc | 6 +- .../reference/levels/sunken/bully_REF.gc | 20 +- .../levels/sunken/helix-water_REF.gc | 8 +- .../reference/levels/sunken/qbert-plat_REF.gc | 4 +- .../levels/sunken/square-platform_REF.gc | 2 +- .../reference/levels/sunken/steam-cap_REF.gc | 8 +- .../levels/sunken/sun-exit-chamber_REF.gc | 2 +- .../levels/sunken/sun-iris-door_REF.gc | 4 +- .../levels/sunken/sunken-water_REF.gc | 6 +- .../levels/sunken/target-tube_REF.gc | 14 +- .../reference/levels/sunken/wall-plat_REF.gc | 6 +- .../reference/levels/swamp/billy_REF.gc | 4 +- .../reference/levels/swamp/kermit_REF.gc | 22 +-- .../reference/levels/swamp/swamp-obs_REF.gc | 2 +- .../reference/levels/title/title-obs_REF.gc | 4 +- .../levels/training/training-obs_REF.gc | 4 +- .../levels/training/training-part_REF.gc | 2 +- .../levels/village1/assistant_REF.gc | 12 +- .../levels/village1/fishermans-boat_REF.gc | 14 +- .../levels/village1/village1-part2_REF.gc | 2 +- .../levels/village2/assistant-village2_REF.gc | 12 +- .../levels/village2/village2-obs_REF.gc | 16 +- .../levels/village2/village2-part_REF.gc | 2 +- .../levels/village_common/villagep-obs_REF.gc | 14 +- 247 files changed, 1698 insertions(+), 2139 deletions(-) diff --git a/common/util/print_float.cpp b/common/util/print_float.cpp index 24646ccc76..f25f4b5549 100644 --- a/common/util/print_float.cpp +++ b/common/util/print_float.cpp @@ -28,11 +28,11 @@ std::string meters_to_string(float value, bool append_trailing_decimal) { } /*! - * Convert a fixed point value to a string. Fixed point values usually end up with strange numbers + * Convert a fixed point value to a float. Fixed point values usually end up with strange numbers * that were definitely not what was written when we do a naive conversion. This function * is a bit more clever. */ -std::string fixed_point_to_string(s64 value, s64 scale, bool append_trailing_decimal) { +float fixed_point_to_float(s64 value, s64 scale) { float sign = value < 0 ? -1 : 1; value = std::abs(value); double naive = (double)value / scale; @@ -54,7 +54,7 @@ std::string fixed_point_to_string(s64 value, s64 scale, bool append_trailing_dec fixed_add += 5; } if ((s64)((fixed_start + fixed_add) / flt_scale * scale) == value) { - return float_to_string((fixed_start + fixed_add) / flt_scale * sign, append_trailing_decimal); + return (fixed_start + fixed_add) / flt_scale * sign; } // add e.g. 0.001 in a 1/1000 scale @@ -63,10 +63,18 @@ std::string fixed_point_to_string(s64 value, s64 scale, bool append_trailing_dec fixed_add += 1; } if ((s64)((fixed_start + fixed_add) / flt_scale * scale) == value) { - return float_to_string((fixed_start + fixed_add) / flt_scale * sign, append_trailing_decimal); + return (fixed_start + fixed_add) / flt_scale * sign; } // added too much! - ASSERT_MSG(false, fmt::format("fixed_point_to_string failed hard. v: {} s: {}", value, scale)); + ASSERT_MSG(false, fmt::format("fixed_point_to_float failed hard. v: {} s: {}", value, scale)); + return 0; +} + +/*! + * Convert a fixed point value to a string. Wrapper around fixed_point_to_string + */ +std::string fixed_point_to_string(s64 value, s64 scale, bool append_trailing_decimal) { + return float_to_string(fixed_point_to_float(value, scale), append_trailing_decimal); } /*! diff --git a/common/util/print_float.h b/common/util/print_float.h index 7445e92e84..b88dc9b0bb 100644 --- a/common/util/print_float.h +++ b/common/util/print_float.h @@ -3,6 +3,7 @@ #include #include "common/common_types.h" +float fixed_point_to_float(s64 value, s64 scale); std::string fixed_point_to_string(s64 value, s64 scale, bool append_trailing_decimal = false); std::string float_to_string(float value, bool append_trailing_decimal = true); std::string meters_to_string(float value, bool append_trailing_decimal = false); diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index ffed5d960e..e73fd165e4 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -3058,6 +3058,133 @@ void FunctionCallElement::update_from_stack(const Env& env, } } + // check for sound-play stuff + { + if (arg_forms.size() == 7 && unstacked.at(0)->to_form(env).is_symbol("sound-play-by-name")) { + auto ssn = arg_forms.at(0)->to_string(env); + static const std::string ssn_check = "(static-sound-name \""; + // idk what a good way to do this is :( + if (ssn.substr(0, ssn_check.size()) == ssn_check) { + // get sound name + auto sound_name = ssn.substr(ssn_check.size(), ssn.size() - ssn_check.size() - 2); + + // get sound id + auto so_id_f = arg_forms.at(1); + if (so_id_f->to_string(env) == "(new-sound-id)") { + so_id_f = nullptr; + } + + // get sound volume + bool panic = false; + auto so_vol_o = arg_forms.at(2)->to_form(env); + Form* so_vol_f = nullptr; + if (so_vol_o.is_int()) { + auto vol_as_flt_temp = fixed_point_to_float(so_vol_o.as_int(), 1024) * 100; + // fixed point convert is good but floating point accuracy sucks so we can do even better + // with a hardcoded case + for (int i = 0; i < 100; ++i) { + if (int(i * 1024.0f / 100.0f) == so_vol_o.as_int()) { + vol_as_flt_temp = i; + break; + } + } + // make the number now... + if (int(vol_as_flt_temp * 1024.0f / 100.0f) == so_vol_o.as_int()) { + if (so_vol_o.as_int() != 1024) { + so_vol_f = pool.form(float_to_string(vol_as_flt_temp, false)); + } + } + } else { + auto mr_vol = match( + Matcher::cast("int", Matcher::op_fixed(FixedOperatorKind::MULTIPLICATION, + {Matcher::single(10.24f), Matcher::any(0)})), + arg_forms.at(2)); + if (mr_vol.matched) { + so_vol_f = mr_vol.maps.forms.at(0); + } else { + // AAAHHHH i dont know how to handle this volume thing! + panic = true; + } + } + + // get sound pitch mod + auto so_pitch_o = arg_forms.at(3)->to_form(env); + Form* so_pitch_f = nullptr; + if (so_pitch_o.is_int()) { + if (so_pitch_o.as_int() != 0) { + so_pitch_f = + pool.form(fixed_point_to_string(so_pitch_o.as_int(), 1524)); + } + } else { + auto mr_pitch = match( + Matcher::cast("int", Matcher::op_fixed(FixedOperatorKind::MULTIPLICATION, + {Matcher::single(1524), Matcher::any(0)})), + arg_forms.at(3)); + if (mr_pitch.matched) { + so_pitch_f = mr_pitch.maps.forms.at(0); + } else { + panic = true; + } + } + + // rest + if (!panic) { + auto so_bend = arg_forms.at(4); + if (so_bend->to_form(env).is_int(0)) { + so_bend = nullptr; + } + auto elt_group = arg_forms.at(5)->try_as_element(); + if (elt_group && elt_group->op().is_func() && + elt_group->op().func()->to_form(env).is_symbol("sound-group") && + elt_group->elts().size() == 1) { + Form* so_group_f = nullptr; + if (!elt_group->elts().at(0)->to_form(env).is_symbol("sfx")) { + so_group_f = pool.form( + elt_group->elts().at(0)->to_form(env).as_symbol()->name); + } + auto so_positional_f = arg_forms.at(6); + if (so_positional_f->to_form(env).is_symbol("#t")) { + so_positional_f = nullptr; + } + // now make the macro call! + std::vector macro_args; + macro_args.push_back(pool.form(sound_name)); + if (so_id_f) { + macro_args.push_back(pool.form(":id")); + macro_args.push_back(so_id_f); + } + if (so_vol_f) { + macro_args.push_back(pool.form(":vol")); + macro_args.push_back(so_vol_f); + } + if (so_pitch_f) { + macro_args.push_back(pool.form(":pitch")); + macro_args.push_back(so_pitch_f); + } + if (so_bend) { + macro_args.push_back(pool.form(":bend")); + macro_args.push_back(so_bend); + } + if (so_group_f) { + macro_args.push_back(pool.form(":group")); + macro_args.push_back(so_group_f); + } + if (so_positional_f) { + macro_args.push_back(pool.form(":position")); + macro_args.push_back(so_positional_f); + } + + new_form = pool.alloc_element( + GenericOperator::make_function(pool.form("sound-play")), + macro_args); + result->push_back(new_form); + return; + } + } + } + } + } + new_form = pool.alloc_element(GenericOperator::make_function(unstacked.at(0)), arg_forms); diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index 7668a603b0..7611e46d71 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -2970,6 +2970,19 @@ ;; - Types +(defenum sound-group + :bitfield #t + :type uint8 + (sfx) + (music) + (dialog) + (sog3) + (ambient) + (sog5) + (sog6) + (sog7) + ) + (deftype sound-id (uint32) () (:methods @@ -3023,7 +3036,7 @@ (priority int8 :offset-assert 11) (volume int32 :offset-assert 12) (trans vector3w :inline :offset-assert 16) - (group uint8 :offset-assert 28) + (group sound-group :offset-assert 28) ) :pack-me :method-count-assert 9 @@ -3048,7 +3061,7 @@ ) (deftype sound-rpc-group-cmd (sound-rpc-cmd) - ((group uint8 :offset-assert 4) + ((group sound-group :offset-assert 4) ) :method-count-assert 9 :size-assert #x5 @@ -3283,9 +3296,9 @@ (deftype sound-spec (basic) ((mask sound-mask :offset-assert 4) (num float :offset-assert 8) - (group uint8 :offset-assert 12) + (group sound-group :offset-assert 12) + (sound-name-char uint8 16 :offset 16) (sound-name sound-name :score 20 :offset 16) - (sound-name-char uint8 16 :offset 16) ;; moved to after sound-name (trans float 4 :offset-assert 32) ;; guess (volume int32 :offset-assert 48) (pitch-mod int32 :offset-assert 52) @@ -16301,7 +16314,7 @@ (define-extern effect-param->sound-spec (function sound-spec (pointer float) int sound-spec)) (define-extern ear-trans (function vector)) (define-extern sound-play-by-spec (function sound-spec sound-id vector sound-id)) -(define-extern sound-play-by-name (function sound-name sound-id int int int int symbol sound-id)) +(define-extern sound-play-by-name (function sound-name sound-id int int int sound-group symbol sound-id)) (define-extern sound-angle-convert (function float int)) (define-extern sound-set-ear-trans (function vector vector float int)) (define-extern activate-progress (function process progress-screen none)) @@ -16324,13 +16337,13 @@ (define-extern swap-sound-buffers (function vector vector float int)) (define-extern free-last-sound-buffer-entry (function int)) (define-extern sound-basic-cb (function int (pointer int32) none)) -(define-extern sound-set-volume (function uint float int)) +(define-extern sound-set-volume (function sound-group float int)) (define-extern sound-set-reverb (function int float float uint int)) (define-extern sound-pause (function sound-id int)) (define-extern sound-continue (function sound-id int)) -(define-extern sound-group-pause (function uint int)) -(define-extern sound-group-stop (function uint int)) -(define-extern sound-group-continue (function uint int)) +(define-extern sound-group-pause (function sound-group int)) +(define-extern sound-group-stop (function sound-group int)) +(define-extern sound-group-continue (function sound-group int)) (define-extern sound-set-falloff-curve (function int float float int)) (define-extern sound-set-sound-falloff (function sound-name int int int int)) (define-extern sound-set-flava (function uint int)) @@ -18601,7 +18614,7 @@ (define-extern update-mood-jungleb-blue (function mood-context float int none)) (define-extern update-mood-prt-color (function mood-context vector)) (define-extern update-mood-default (function mood-context float int none)) -(define-extern update-mood-misty (function mood-context float float none)) +(define-extern update-mood-misty (function mood-context float int none)) (define-extern update-mood-village2 (function mood-context float int none)) (define-extern update-mood-swamp (function mood-context float int none)) (define-extern update-mood-village1 (function mood-context float int none)) diff --git a/decompiler/config/jak1_ntsc_black_label/var_names.jsonc b/decompiler/config/jak1_ntsc_black_label/var_names.jsonc index 3575d78cc3..7abc82803d 100644 --- a/decompiler/config/jak1_ntsc_black_label/var_names.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/var_names.jsonc @@ -3739,7 +3739,18 @@ "s4-0": ["s4-0", "vector"], "v1-42": ["v1-42", "vector"], "s3-1": "lod-to-use", - "f30-1": "cam-dist" + "f30-1": "cam-dist", + "s3-0": "tod", + "v1-17": "shadow-msk", + "a0-10": "lev-idx", + "s0-1": "lgt", + "s1-1": "cur-lgt", + "s2-0": "vu-lgt", + "a1-22": "lgt-msk-0", + "a2-14": "lgt-msk-1", + "f26-0": "lgt-interp", + "f28-0": "interp", + "f30-0": "cur-interp" } }, diff --git a/goal_src/engine/ambient/ambient.gc b/goal_src/engine/ambient/ambient.gc index 0952effdda..706ebe3892 100644 --- a/goal_src/engine/ambient/ambient.gc +++ b/goal_src/engine/ambient/ambient.gc @@ -502,7 +502,7 @@ (s4-1 string->sound-name) ) (format (clear *temp-string*) "spool-~S" arg0) - (let ((s5-2 (s5-1 (s4-1 *temp-string*) (new-sound-id) 1024 0 0 1 #t))) + (let ((s5-2 (s5-1 (s4-1 *temp-string*) (new-sound-id) 1024 0 0 (sound-group sfx) #t))) (set! (-> self sound-id) s5-2) (let ((s4-3 (-> *display* base-frame-counter))) (while (and (!= (current-str-id) s5-2) (< (- (-> *display* base-frame-counter) s4-3) (seconds 5))) @@ -554,7 +554,7 @@ ) (format (clear *temp-string*) "spool-~S" arg0) (set! (-> self sound-id) - (s5-0 (s4-0 *temp-string*) (new-sound-id) 1024 1 0 1 (the-as symbol (-> self trans))) + (s5-0 (s4-0 *temp-string*) (new-sound-id) 1024 1 0 (sound-group sfx) (the-as symbol (-> self trans))) ) ) ) @@ -563,7 +563,7 @@ (s4-2 string->sound-name) ) (format (clear *temp-string*) "spool-~S" arg0) - (set! (-> self sound-id) (s5-1 (s4-2 *temp-string*) (new-sound-id) 1024 0 0 1 #t)) + (set! (-> self sound-id) (s5-1 (s4-2 *temp-string*) (new-sound-id) 1024 0 0 (sound-group sfx) #t)) ) ) ) diff --git a/goal_src/engine/ambient/mood.gc b/goal_src/engine/ambient/mood.gc index e877d5cc16..13ffd7a3b1 100644 --- a/goal_src/engine/ambient/mood.gc +++ b/goal_src/engine/ambient/mood.gc @@ -677,23 +677,17 @@ ) (when (>= (-> *math-camera* trans y) -81920.0) (if arg6 - (sound-play-by-name - (static-sound-name "thunder") - *thunder-id* - (the int (* 10.24 (rand-vu-float-range 25.0 75.0))) - (the int (* 1524.0 (rand-vu-float-range -1.0 1.0))) - 0 - 1 - #t + (sound-play + "thunder" + :id *thunder-id* + :vol (rand-vu-float-range 25.0 75.0) + :pitch (rand-vu-float-range -1.0 1.0) ) - (sound-play-by-name - (static-sound-name "thunder") - *thunder-id* - (the int (* 10.24 (rand-vu-float-range 200.0 400.0))) - (the int (* 1524.0 (rand-vu-float-range -1.0 1.0))) - 0 - 1 - #t + (sound-play + "thunder" + :id *thunder-id* + :vol (rand-vu-float-range 200.0 400.0) + :pitch (rand-vu-float-range -1.0 1.0) ) ) ) @@ -914,11 +908,11 @@ ) -(defun update-mood-misty ((arg0 mood-context) (arg1 float) (arg2 float)) +(defun update-mood-misty ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) (clear-mood-times arg0) - (update-mood-palette arg0 arg1 (the-as int arg2)) + (update-mood-palette arg0 arg1 arg2) (when *time-of-day-effects* (update-mood-flames arg0 2 4 0 0.333 0.001953125 1.0) (let* ((s4-1 (get-task-control (game-task misty-warehouse))) diff --git a/goal_src/engine/camera/cam-master.gc b/goal_src/engine/camera/cam-master.gc index fea2700f41..0375e5bdab 100644 --- a/goal_src/engine/camera/cam-master.gc +++ b/goal_src/engine/camera/cam-master.gc @@ -386,7 +386,7 @@ (collide-kind background) (the-as process #f) s4-2 - (new 'static 'pat-surface :camera #x1 :nocamera #x1 :nolineofsight #x1) + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) ) ) ) diff --git a/goal_src/engine/camera/cam-states.gc b/goal_src/engine/camera/cam-states.gc index f3add826d9..6e466bd585 100644 --- a/goal_src/engine/camera/cam-states.gc +++ b/goal_src/engine/camera/cam-states.gc @@ -1924,7 +1924,7 @@ (cam-los-spline-collide (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 (-> *camera* target-spline end-point)))) arg0 - (new 'static 'pat-surface :camera #x1 :nocamera #x1 :nolineofsight #x1) + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) ) ) ) @@ -1957,7 +1957,7 @@ (cam-los-spline-collide (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 s2-2))) arg0 - (new 'static 'pat-surface :camera #x1 :nocamera #x1 :nolineofsight #x1) + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) ) ) (< f30-1 0.0) @@ -2224,7 +2224,7 @@ (let ((f30-0 (vector-length (-> self view-flat)))) (vector--float*! s5-0 (-> *camera* tpos-curr) (-> *camera* local-down) (-> *camera* target-height)) (vector-! s5-0 s5-0 (-> self string-trans)) - (cam-los-collide (-> self string-trans) s5-0 gp-0 (new 'static 'pat-surface :camera #x1 :nocamera #x1 :nolineofsight #x1)) + (cam-los-collide (-> self string-trans) s5-0 gp-0 (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1)) (when (-> gp-0 vert-next y) (when (or (= (-> self los-state) (slave-los-state ccw)) (= (-> self los-state) (slave-los-state cw))) (let ((a0-6 (new 'stack-no-clear 'vector))) @@ -2859,7 +2859,7 @@ (collide-kind background cak-3 wall-object ground-object cak-14) (the-as process #f) s4-0 - (new 'static 'pat-surface :camera #x1 :nocamera #x1 :nolineofsight #x1) + (new 'static 'pat-surface :nocamera #x1 :nolineofsight #x1) ) ) ) diff --git a/goal_src/engine/collide/collide-reaction-target.gc b/goal_src/engine/collide/collide-reaction-target.gc index a0b39c3826..58a00786f9 100644 --- a/goal_src/engine/collide/collide-reaction-target.gc +++ b/goal_src/engine/collide/collide-reaction-target.gc @@ -305,7 +305,7 @@ (-> arg0 history-data (logand (+ (-> arg0 unknown-halfword00) 127) 127)) (cond (#f - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! sv-104 (logior sv-104 8192)) (vector-reflect-flat-above! arg2 (the-as vector (-> sv-88 vector)) sv-84) ) diff --git a/goal_src/engine/debug/debug.gc b/goal_src/engine/debug/debug.gc index 9d49a9b742..0defb07bf4 100644 --- a/goal_src/engine/debug/debug.gc +++ b/goal_src/engine/debug/debug.gc @@ -907,31 +907,20 @@ (defun-debug add-debug-light ((arg0 symbol) (arg1 bucket-id) (arg2 light) (arg3 vector) (arg4 string)) (if (not arg0) - (return #f) - ) + (return #f) + ) (when (!= (-> arg2 levels x) 0.0) - (add-debug-vector arg0 arg1 - arg3 - (-> arg2 direction) - (meters 3) - (static-rgba #xff #xff #xff #x80) + (add-debug-vector arg0 arg1 arg3 (-> arg2 direction) (meters 3) (static-rgba #xff #xff #xff #x80)) + (let ((light-vec-end (vector+*! (new-stack-vector0) arg3 (-> arg2 direction) (* (meters 3) (-> arg2 levels x)))) + ;; the original code here uses w for alpha but that looks terrible + (light-rgba (new 'static 'rgba :r (the int (* 128.0 (-> arg2 color x))) + :g (the int (* 128.0 (-> arg2 color y))) + :b (the int (* 128.0 (-> arg2 color z))) + :a 128 + ))) + (add-debug-text-sphere arg0 arg1 light-vec-end (* (meters 0.5) (-> arg2 levels x)) (string-format "~S ~,,2f" arg4 (-> arg2 levels x)) light-rgba) + ) ) - ;; this might be wrong - (let ((light-vec-end (vector+*! (new-stack-vector0) arg3 (-> arg2 direction) (* (meters 3) (-> arg2 levels x)))) - (light-rgba (new 'static 'rgba :r (the int (* 128.0 (-> arg2 color x))) - :g (the int (* 128.0 (-> arg2 color y))) - :b (the int (* 128.0 (-> arg2 color z))) - :a (the int (* 128.0 (-> arg2 color w))) - )) - ) - (add-debug-text-sphere arg0 arg1 - light-vec-end - (* (meters 0.5) (-> arg2 levels x)) - (string-format "~S ~,,2f" arg4 (-> arg2 levels x)) - light-rgba - ) - ) - ) #f ) diff --git a/goal_src/engine/draw/drawable.gc b/goal_src/engine/draw/drawable.gc index ea291d61c9..9249778496 100644 --- a/goal_src/engine/draw/drawable.gc +++ b/goal_src/engine/draw/drawable.gc @@ -521,8 +521,8 @@ (logclear! (-> arg1 status) (draw-status was-drawn)) (when (zero? (logand (-> arg1 status) (draw-status hidden no-anim no-skeleton-update))) (let ((s4-0 (the-as vector (+ 48 (the-as int (scratchpad-object int))))) - (s2-0 (the-as vu-lights (+ 64 (the-as int (scratchpad-object int))))) - (s3-0 *time-of-day-context*) + (vu-lgt (the-as vu-lights (+ 64 (the-as int (scratchpad-object int))))) + (tod *time-of-day-context*) ) (.lvf vf16 (&-> arg1 origin quad)) (.lvf vf17 (&-> arg1 bounds quad)) @@ -534,135 +534,130 @@ (when (sphere-in-view-frustum? (the-as sphere s4-0)) (case (-> arg1 global-effect) (((draw-effect title)) - (when (not (-> s3-0 title-updated)) - (set! (-> s3-0 title-updated) #t) + (when (not (-> tod title-updated)) + (set! (-> tod title-updated) #t) (let ((s0-0 (-> *math-camera* inv-camera-rot)) (a1-1 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) ) (set-vector! a1-1 0.612 0.5 -0.612 0.0) (set-vector! s1-0 -0.696 0.174 0.696 0.0) - (vector-matrix*! (the-as vector (-> s3-0 title-light-group)) a1-1 s0-0) - (vector-matrix*! (the-as vector (-> s3-0 title-light-group dir1)) s1-0 s0-0) + (vector-matrix*! (the-as vector (-> tod title-light-group)) a1-1 s0-0) + (vector-matrix*! (the-as vector (-> tod title-light-group dir1)) s1-0 s0-0) ) (set-vector! (-> *time-of-day-context* current-shadow) 0.612 -0.5 -0.612 1.0) ) - (vu-lights<-light-group! s2-0 (-> s3-0 title-light-group)) + (vu-lights<-light-group! vu-lgt (-> tod title-light-group)) ) (else - (let ((f28-0 (-> arg1 secondary-interp)) - (f30-0 (-> arg1 current-secondary-interp)) - (v1-17 (-> arg1 shadow-mask)) - (a0-10 (-> arg1 level-index)) - (s0-1 (-> s3-0 light-group (-> *target* draw light-index))) - (s1-1 (new 'stack-no-clear 'light-group)) + (let ((interp (-> arg1 secondary-interp)) + (cur-interp (-> arg1 current-secondary-interp)) + (shadow-msk (-> arg1 shadow-mask)) + (lev-idx (-> arg1 level-index)) + (lgt (-> tod light-group (-> *target* draw light-index))) + (cur-lgt (new 'stack-no-clear 'light-group)) ) (cond ((= (-> arg1 light-index) 255) ) - ((= a0-10 2) - (set! s0-1 (-> s3-0 light-group (-> arg1 light-index))) + ((= lev-idx 2) + (set! lgt (-> tod light-group (-> arg1 light-index))) ) (else - (set! s0-1 (-> s3-0 moods a0-10 light-group (-> arg1 light-index))) + (set! lgt (-> tod moods lev-idx light-group (-> arg1 light-index))) ) ) - (when (not (or (= a0-10 2) (zero? v1-17))) - (let* ((a1-22 (-> s3-0 light-masks-0 a0-10)) - (a2-14 (-> s3-0 light-masks-1 a0-10)) - (f26-0 (-> s3-0 light-interp a0-10)) - (a0-13 (logand a1-22 v1-17)) - (v1-18 (logand a2-14 v1-17)) + (when (not (or (= lev-idx 2) (zero? shadow-msk))) + (let* ((lgt-msk-0 (-> tod light-masks-0 lev-idx)) + (lgt-msk-1 (-> tod light-masks-1 lev-idx)) + (lgt-interp (-> tod light-interp lev-idx)) + (a0-13 (logand lgt-msk-0 shadow-msk)) + (v1-18 (logand lgt-msk-1 shadow-msk)) ) (cond ((and (zero? a0-13) (zero? v1-18)) ) (else - (set! f28-0 (cond - ((and (nonzero? a0-13) (nonzero? v1-18)) - 1.0 - ) - ((zero? a0-13) - (quad-copy! (the-as pointer s1-1) (the-as pointer s0-1) 12) - (set! s0-1 s1-1) - (set! (-> s0-1 dir1 levels x) 0.0) - f26-0 - ) - (else - (quad-copy! (the-as pointer s1-1) (the-as pointer s0-1) 12) - (set! s0-1 s1-1) - (set! (-> s0-1 dir0 levels x) 0.0) - (- 1.0 f26-0) + (set! interp (cond + ((and (nonzero? a0-13) (nonzero? v1-18)) + 1.0 ) - ) + ((zero? a0-13) + (quad-copy! (the-as pointer cur-lgt) (the-as pointer lgt) 12) + (set! lgt cur-lgt) + (set! (-> lgt dir1 levels x) 0.0) + lgt-interp + ) + (else + (quad-copy! (the-as pointer cur-lgt) (the-as pointer lgt) 12) + (set! lgt cur-lgt) + (set! (-> lgt dir0 levels x) 0.0) + (- 1.0 lgt-interp) + ) + ) ) ) ) ) ) (if *teleport* - (set! f30-0 f28-0) + (set! cur-interp interp) ) - (when (not (or (paused?) (= f28-0 f30-0))) - (let ((f0-15 (- f30-0 f28-0))) - (set! f30-0 (cond - ((< (fabs f0-15) 0.2) - f28-0 - ) - ((< f0-15 0.0) - (+ 0.2 f30-0) - ) - (else - (+ -0.2 f30-0) - ) - ) + (when (not (or (paused?) (= interp cur-interp))) + (let ((f0-15 (- cur-interp interp))) + (set! cur-interp (cond + ((< (fabs f0-15) 0.2) + interp + ) + ((< f0-15 0.0) + (+ 0.2 cur-interp) + ) + (else + (+ -0.2 cur-interp) + ) + ) ) ) - (set! (-> arg1 current-secondary-interp) f30-0) + (set! (-> arg1 current-secondary-interp) cur-interp) ) (cond - ((= f30-0 0.0) - (vu-lights<-light-group! s2-0 s0-1) + ((= cur-interp 0.0) + (vu-lights<-light-group! vu-lgt lgt) ) (else - (if (!= s0-1 s1-1) - (quad-copy! (the-as pointer s1-1) (the-as pointer s0-1) 12) + (if (!= lgt cur-lgt) + (quad-copy! (the-as pointer cur-lgt) (the-as pointer lgt) 12) ) - (let ((f0-20 (- 1.0 f30-0))) - (set! (-> s1-1 dir0 levels x) (* (-> s1-1 dir0 levels x) f0-20)) - (set! (-> s1-1 dir0 levels y) (* (-> s1-1 dir0 levels y) f0-20)) - (set! (-> s1-1 dir1 levels x) (* (-> s1-1 dir1 levels x) f0-20)) - (set! (-> s1-1 dir1 levels y) (* (-> s1-1 dir1 levels y) f0-20)) - (set! (-> s1-1 dir2 levels x) (* (-> s1-1 dir2 levels x) f0-20)) - (set! (-> s1-1 dir2 levels y) (* (-> s1-1 dir2 levels y) f0-20)) + (let ((f0-20 (- 1.0 cur-interp))) + (set! (-> cur-lgt dir0 levels x) (* (-> cur-lgt dir0 levels x) f0-20)) + (set! (-> cur-lgt dir0 levels y) (* (-> cur-lgt dir0 levels y) f0-20)) + (set! (-> cur-lgt dir1 levels x) (* (-> cur-lgt dir1 levels x) f0-20)) + (set! (-> cur-lgt dir1 levels y) (* (-> cur-lgt dir1 levels y) f0-20)) + (set! (-> cur-lgt dir2 levels x) (* (-> cur-lgt dir2 levels x) f0-20)) + (set! (-> cur-lgt dir2 levels y) (* (-> cur-lgt dir2 levels y) f0-20)) ) - (vu-lights<-light-group! s2-0 s1-1) + (vu-lights<-light-group! vu-lgt cur-lgt) ) ) ) - (.lvf vf2 (&-> s2-0 color 0 quad)) - (.lvf vf3 (&-> s2-0 color 1 quad)) - (.lvf vf4 (&-> s2-0 color 2 quad)) - (.lvf vf5 (&-> s2-0 ambient quad)) + (.lvf vf2 (&-> vu-lgt color 0 quad)) + (.lvf vf3 (&-> vu-lgt color 1 quad)) + (.lvf vf4 (&-> vu-lgt color 2 quad)) + (.lvf vf5 (&-> vu-lgt ambient quad)) (.mul.vf vf5 vf5 vf28) (.mul.vf vf2 vf2 vf28) (.mul.vf vf3 vf3 vf28) (.mul.vf vf4 vf4 vf28) (.add.vf vf5 vf5 vf29) - (.svf (&-> s2-0 color 0 quad) vf2) - (.svf (&-> s2-0 color 1 quad) vf3) - (.svf (&-> s2-0 color 2 quad) vf4) - (.svf (&-> s2-0 ambient quad) vf5) + (.svf (&-> vu-lgt color 0 quad) vf2) + (.svf (&-> vu-lgt color 1 quad) vf3) + (.svf (&-> vu-lgt color 2 quad) vf4) + (.svf (&-> vu-lgt ambient quad) vf5) (.mov v1-37 vf5) ) ) (if *display-lights* - (add-debug-lights - #t - (bucket-id debug) - (the-as (inline-array light) (-> s3-0 light-group)) - (-> arg1 origin) - ) + (add-debug-lights #t (bucket-id debug) (the-as (inline-array light) (-> tod light-group)) (-> arg1 origin)) ) (let ((at-0 *math-camera*)) (.lvf vf16 (&-> at-0 plane 0 quad)) diff --git a/goal_src/engine/game/collectables-part.gc b/goal_src/engine/game/collectables-part.gc index daf45fcdbf..cd7c76030b 100644 --- a/goal_src/engine/game/collectables-part.gc +++ b/goal_src/engine/game/collectables-part.gc @@ -13,7 +13,8 @@ ;; DECOMP BEGINS (defun eco-fadeout ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) - (if (zero? (logand (-> (the-as process-drawable (-> arg1 key proc)) state-flags) (state-flags fade-out-particles))) + (if (zero? (logand (-> (the-as process-drawable (-> arg1 key proc)) state-flags) (state-flags fade-out-particles)) + ) (set! (-> arg1 next-time) (the-as uint (* (-> *sp-frame-time* x) 2))) ) 0 diff --git a/goal_src/engine/game/collectables.gc b/goal_src/engine/game/collectables.gc index 93befbfac8..19c68b93ed 100644 --- a/goal_src/engine/game/collectables.gc +++ b/goal_src/engine/game/collectables.gc @@ -404,7 +404,7 @@ :virtual #t :code (behavior () (if (type-type? (-> self type) fuel-cell) - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") ) (logclear! (-> self mask) (process-mask actor-pause)) (let ((gp-1 (new 'stack 'trajectory))) @@ -763,13 +763,13 @@ ) (case (-> self fact pickup-type) (((pickup-type eco-yellow)) - (sound-play-by-name (static-sound-name "y-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "y-eco-pickup") ) (((pickup-type eco-red)) - (sound-play-by-name (static-sound-name "r-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "r-eco-pickup") ) (((pickup-type eco-blue)) - (sound-play-by-name (static-sound-name "b-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "b-eco-pickup") (case (-> (level-get-target-inside *level*) name) (('training) (level-hint-spawn @@ -783,10 +783,10 @@ ) ) (((pickup-type eco-green)) - (sound-play-by-name (static-sound-name "g-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "g-eco-pickup") ) (((pickup-type eco-green) (pickup-type eco-pill)) - (sound-play-by-name (static-sound-name "pill-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "pill-pickup") ) ) (if (nonzero? (-> self part)) @@ -1593,7 +1593,7 @@ ) :code (behavior ((arg0 object) (arg1 handle)) (local-vars (sv-96 res-tag)) - (sound-play-by-name (static-sound-name "pu-powercell") (new-sound-id) 1024 0 0 1 #t) + (sound-play "pu-powercell") (clear-collide-with-as (-> self root-override)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) @@ -2109,7 +2109,7 @@ (initialize-params self 0 (the-as float 1024.0)) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self actor-pause) #f) - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (go fuel-cell-clone-anim arg0) (none) ) @@ -2190,7 +2190,7 @@ :code (behavior ((arg0 object) (arg1 handle)) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status complete) #t) - (sound-play-by-name (static-sound-name "buzzer-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "buzzer-pickup") (case (-> (level-get-target-inside *level*) name) (('training) (level-hint-spawn diff --git a/goal_src/engine/game/crates.gc b/goal_src/engine/game/crates.gc index 1680e910fe..7401a6f019 100644 --- a/goal_src/engine/game/crates.gc +++ b/goal_src/engine/game/crates.gc @@ -529,7 +529,7 @@ ) (set! (-> self incomming-attack-id) s4-0) (if (not (!= (-> self smush amp) 0.0)) - (sound-play-by-name (static-sound-name "icrate-nobreak") (new-sound-id) 1024 0 0 1 #t) + (sound-play "icrate-nobreak") ) (activate! (-> self smush) 0.1 90 150 1.0 1.0) (go-virtual bounce-on) @@ -572,7 +572,7 @@ ) (set! (-> self incomming-attack-id) s4-0) (if (not (!= (-> self smush amp) 0.0)) - (sound-play-by-name (static-sound-name "scrate-nobreak") (new-sound-id) 1024 0 0 1 #t) + (sound-play "scrate-nobreak") ) (activate! (-> self smush) 0.1 90 150 1.0 1.0) (go-virtual bounce-on) @@ -836,16 +836,16 @@ (logior! (-> self draw status) (draw-status hidden)) (case (-> self look) (('iron) - (sound-play-by-name (static-sound-name "icrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "icrate-break") ) (('steel) - (sound-play-by-name (static-sound-name "scrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "scrate-break") ) (('darkeco) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") ) (else - (sound-play-by-name (static-sound-name "wcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "wcrate-break") ) ) (case (-> self defense) @@ -1296,7 +1296,7 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) (let ((f30-0 57001.605)) - (sound-play-by-name (static-sound-name "crate-jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "crate-jump") (while (or (!= (-> self smush amp) 0.0) (!= f30-0 0.0)) (+! f30-0 (* -245760.0 (-> *display* seconds-per-frame))) (+! (-> self root-override trans y) (* f30-0 (-> *display* seconds-per-frame))) diff --git a/goal_src/engine/game/effect-control.gc b/goal_src/engine/game/effect-control.gc index 3e5cd44ea9..54bfc59a06 100644 --- a/goal_src/engine/game/effect-control.gc +++ b/goal_src/engine/game/effect-control.gc @@ -1142,7 +1142,7 @@ ) 0 0 - 1 + (sound-group sfx) #t ) ) diff --git a/goal_src/engine/game/game-info.gc b/goal_src/engine/game/game-info.gc index 109ed91c57..38676a284b 100644 --- a/goal_src/engine/game/game-info.gc +++ b/goal_src/engine/game/game-info.gc @@ -522,7 +522,7 @@ ) ;; play the sound! - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-green-eco") ) ;; remember the source. @@ -603,7 +603,7 @@ (when (< 0.0 amount) ;; play sound. (if (>= (- (-> *display* base-frame-counter) (-> obj money-pickup-time)) (seconds 0.05)) - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "money-pickup") ) (set! (-> obj money-pickup-time) (-> *display* base-frame-counter)) ) @@ -692,16 +692,16 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 17 (seconds 0.2)) (case kind (((pickup-type eco-blue)) - (sound-play-by-name (static-sound-name "get-blue-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-blue-eco") ) (((pickup-type eco-green)) - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-green-eco") ) (((pickup-type eco-yellow)) - (sound-play-by-name (static-sound-name "get-yellow-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-yellow-eco") ) (((pickup-type eco-red)) - (sound-play-by-name (static-sound-name "get-red-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-red-eco") ) ) ) diff --git a/goal_src/engine/game/generic-obs.gc b/goal_src/engine/game/generic-obs.gc index 267dcec07d..62d15c7ebd 100644 --- a/goal_src/engine/game/generic-obs.gc +++ b/goal_src/engine/game/generic-obs.gc @@ -1950,7 +1950,7 @@ (go launcher-idle) ) (spawn (-> self part) (-> self root-override trans)) - (sound-play-by-name (static-sound-name "launch-idle") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "launch-idle" :id (-> self sound-id)) (if (and (and *target* (>= (+ 2867.2 (-> self root-override root-prim prim-core world-sphere w)) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -1962,7 +1962,7 @@ (none) ) :code (behavior () - (sound-play-by-name (static-sound-name "launch-start") (new-sound-id) 1024 0 0 1 #t) + (sound-play "launch-start") (anim-loop) (none) ) diff --git a/goal_src/engine/game/main.gc b/goal_src/engine/game/main.gc index 963d293857..fa59958735 100644 --- a/goal_src/engine/game/main.gc +++ b/goal_src/engine/game/main.gc @@ -122,7 +122,7 @@ ;; ?? (set! *pause-lock* #f) - (sound-group-pause (the-as uint 255)) + (sound-group-pause (sound-group sfx music dialog sog3 ambient sog5 sog6 sog7)) (hide-progress-screen) ) (('menu) @@ -147,7 +147,7 @@ (('game) ;; allow pausable/menu to run. (logclear! (-> *setting-control* default process-mask) (process-mask pause menu)) - (sound-group-continue (the-as uint 255)) + (sound-group-continue (sound-group sfx music dialog sog3 ambient sog5 sog6 sog7)) (hide-progress-screen) ) ) @@ -419,11 +419,11 @@ (external-cam-reset!) ) (set! *external-cam-mode* 'pad-1) - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") ) (else (set! *external-cam-mode* #f) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") ) ) ) diff --git a/goal_src/engine/game/powerups.gc b/goal_src/engine/game/powerups.gc index 3b86016bfb..661a4d10fe 100644 --- a/goal_src/engine/game/powerups.gc +++ b/goal_src/engine/game/powerups.gc @@ -595,14 +595,12 @@ (let ((f30-0 (-> self control unknown-float141)) (f0-13 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 81920.0)) ) - (sound-play-by-name - (static-sound-name "ice-loop") - (-> self control unknown-soundid00) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f0-13)) - 0 - 1 - (the-as symbol (-> self control trans)) + (sound-play + "ice-loop" + :id (-> self control unknown-soundid00) + :vol f30-0 + :pitch f0-13 + :position (the-as symbol (-> self control trans)) ) ) ) diff --git a/goal_src/engine/game/projectiles.gc b/goal_src/engine/game/projectiles.gc index 30504e4362..c8f9154b7a 100644 --- a/goal_src/engine/game/projectiles.gc +++ b/goal_src/engine/game/projectiles.gc @@ -759,7 +759,7 @@ (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "yellow-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "yellow-explode") (suspend) (go-virtual projectile-die) (none) @@ -783,7 +783,7 @@ (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "yellow-fizzle") (new-sound-id) 1024 0 0 1 #t) + (sound-play "yellow-fizzle") (suspend) (go-virtual projectile-die) (none) @@ -918,8 +918,8 @@ (set! (-> *part-id-table* 358 init-specs 11 initial-valuef) (the float (sar (shl (the int (+ -16384.0 f30-0)) 48) 48)) ) - (sound-play-by-name (static-sound-name "yellow-fire") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj sound-id) (sound-play-by-name (static-sound-name "yellow-buzz") (new-sound-id) 1024 0 0 1 #t)) + (sound-play "yellow-fire") + (set! (-> obj sound-id) (sound-play "yellow-buzz")) (if (zero? (logand (-> obj options) 416)) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 103) -1 #f #f #f s5-0 :to obj) ) @@ -1103,7 +1103,7 @@ (defmethod dummy-27 projectile-blue ((obj projectile-blue)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (sound-play-by-name (static-sound-name "blue-eco-on") (new-sound-id) 1024 0 0 1 #t) + (sound-play "blue-eco-on") (set! (-> obj mode) 2) (set! (-> obj max-speed) (-> *TARGET-bank* yellow-projectile-speed)) (set! (-> obj update-velocity) projectile-update-velocity-space-wars) diff --git a/goal_src/engine/game/settings.gc b/goal_src/engine/game/settings.gc index 4b0dd9e91f..8cbc040e31 100644 --- a/goal_src/engine/game/settings.gc +++ b/goal_src/engine/game/settings.gc @@ -289,19 +289,19 @@ (when *sound-player-enable* (when (!= (-> gp-0 sfx-volume) (-> s5-1 sfx-volume)) (seek! (-> gp-0 sfx-volume) (-> s5-1 sfx-volume) (* 100.0 (-> *display* seconds-per-frame))) - (sound-set-volume (the-as uint 1) (-> gp-0 sfx-volume)) + (sound-set-volume (sound-group sfx) (-> gp-0 sfx-volume)) ) (when (!= (-> gp-0 music-volume) (-> s5-1 music-volume)) (seek! (-> gp-0 music-volume) (-> s5-1 music-volume) (* 100.0 (-> *display* seconds-per-frame))) - (sound-set-volume (the-as uint 2) (-> gp-0 music-volume)) + (sound-set-volume (sound-group music) (-> gp-0 music-volume)) ) (when (!= (-> gp-0 dialog-volume) (-> s5-1 dialog-volume)) (seek! (-> gp-0 dialog-volume) (-> s5-1 dialog-volume) (* 100.0 (-> *display* seconds-per-frame))) - (sound-set-volume (the-as uint 4) (-> gp-0 dialog-volume)) + (sound-set-volume (sound-group dialog) (-> gp-0 dialog-volume)) ) (when (!= (-> gp-0 ambient-volume) (-> s5-1 ambient-volume)) (seek! (-> gp-0 ambient-volume) (-> s5-1 ambient-volume) (* 100.0 (-> *display* seconds-per-frame))) - (sound-set-volume (the-as uint 16) (-> gp-0 ambient-volume)) + (sound-set-volume (sound-group ambient) (-> gp-0 ambient-volume)) ) ) ;; send language change to the IOP. diff --git a/goal_src/engine/gfx/time-of-day.gc b/goal_src/engine/gfx/time-of-day.gc index 77777a9005..41ee1bc6e9 100644 --- a/goal_src/engine/gfx/time-of-day.gc +++ b/goal_src/engine/gfx/time-of-day.gc @@ -21,21 +21,21 @@ (defbehavior time-of-day-update time-of-day-proc () "Update the particles and sky tng renderer for time-of-day effects" (time-of-day-effect) - + ;; spawn or kill stars, if needed. (cond ;; should have stars in the sky ((and (or (>= (-> self hour) 19) (>= 5 (-> self hour))) ;; night time (and (< 45.0 (-> *time-of-day-context* num-stars)) (-> *time-of-day-context* sky)) ;; sky + stars desired ) - + ;; see if we need more (when (and *dproc* (< (-> self star-count) (the int (-> *time-of-day-context* num-stars)))) (spawn (-> self stars) (math-camera-pos)) (+! (-> self star-count) 1) ) ) - + ;; have stars, but don't want them ((> (-> self star-count) 0) ;; kill all stars. @@ -55,7 +55,7 @@ 0 ) ) - + ;; spawn or kill sun, if needed (cond ((and (>= (-> self time-of-day) 6.25) @@ -73,7 +73,7 @@ 0 ) ) - + ;; spawn or kill green sun, if needed (cond ((and (or (>= (-> self time-of-day) 21.75) (>= 10.25 (-> self time-of-day))) @@ -90,7 +90,7 @@ 0 ) ) - + ;; update the sky renderer. (update-sky-tng-data (-> self time-of-day)) 0 @@ -105,7 +105,7 @@ (while #t ;; tick! (+! (-> self frame) (the int (* (-> self time-ratio) (-> *display* time-adjust-ratio)))) - + ;; now update time... (when (>= (-> self frame) 300) ;; 300 ticks/second @@ -156,7 +156,7 @@ ) ) ) - + ;; set the time of day float. This is in hours (0-24) (let* ((f0-4 (the float (-> self frame))) (f0-6 (+ (* 0.0033333334 f0-4) (the float (-> self second)))) @@ -205,7 +205,7 @@ ) (defun time-of-day-setup ((arg0 symbol)) - "This function is weird. Returns if time of day will tick forward or not. + "This function is weird. Returns if time of day will tick forward or not. If you set arg0 it will toggle on/off time of day. Otherwise, calling the function has no side effects." (when arg0 @@ -267,19 +267,19 @@ (defun update-time-of-day ((arg0 time-of-day-context)) "Update the time of day context" - + ;; set defaults (set! (-> arg0 sky) #f) (set! (-> arg0 target-interp) 0.0) - + (when *target* (set! (-> *target* draw light-index) (the-as uint 0)) (when (-> *target* sidekick) (set! (-> *target* sidekick 0 draw light-index) (the-as uint 0)) ) ) - - + + ;; see if either level gives us a sky. (dotimes (v1-12 (-> *level* length)) (let ((a0-4 (-> *level* level v1-12))) @@ -290,19 +290,19 @@ ) ) ) - + ;; level distances (let ((s4-0 (new 'stack-no-clear 'array 'float 2))) ;; was a boxed array, but the GOAL implementation seems buggy. (set! (-> s4-0 0) 0.0) (set! (-> s4-0 1) 0.0) 0.0 - + (let ((s5-0 0) (f30-0 (-> arg0 current-interp)) ) (set! *lightning-frame-done* #f) (set! *lightning-realtime-done* #f) - + ;; loop over levels and figure out which to use. (dotimes (s3-0 2) (let ((s2-0 (-> *level* level s3-0))) @@ -327,7 +327,7 @@ ) ) ) - + ;; now pick desired interpolation weights (let* ((f0-6 (-> s4-0 0)) (f1-0 (-> s4-0 1)) @@ -347,15 +347,15 @@ ;; this is a hack to pick the mood of village2 when we're closer to sunken, as long as ;; the camera is above 0. ((and (< 0.0 (-> *math-camera* trans y)) - (= (-> *level* level0 name) 'village2) - (= (-> *level* level1 name) 'sunken) - ) + (= (-> *level* level0 name) 'village2) + (= (-> *level* level1 name) 'sunken) + ) 0.0 ;; picks 0 = village2 ) ((and (< 0.0 (-> *math-camera* trans y)) - (= (-> *level* level0 name) 'sunken) - (= (-> *level* level1 name) 'village2) - ) + (= (-> *level* level0 name) 'sunken) + (= (-> *level* level1 name) 'village2) + ) 1.0 ;; picks 1 = village 2 ) (else @@ -365,13 +365,13 @@ ) ) ) - + ;; normally we will slowly ramp the interpolation weights. ;; but if we've just teleported, immediately snap to the new value. (if *teleport* (set! f30-0 f28-0) ) - + ;; ramp interpolation weights. (when (not (or (paused?) (= f28-0 f30-0))) (let ((f0-7 (- f30-0 f28-0))) @@ -408,13 +408,13 @@ ) ) ) - + ;; number of active skys (set! (-> arg0 active-count) (the-as uint s5-0)) ;; interpolation value between the two level moods. (set! (-> arg0 interp) f28-0) ) - + ;; Do the interpolation (set! (-> arg0 current-interp) f30-0) (set! *sky-drawn* #f) @@ -481,8 +481,8 @@ (dotimes (s4-4 8) (dotimes (s3-2 3) (let ((s2-1 (+ (+ (* 48 s3-2) 156 (* 192 s4-4)) (the-as int arg0)))) - (let ((s1-0 (+ (+ (* 48 s3-2) 156 (* 192 s4-4)) (the-as int (-> arg0 moods 0))) ) - (s0-0 (+ (+ (* 48 s3-2) 156 (* 192 s4-4)) (the-as int (-> arg0 moods 1))) ) + (let ((s1-0 (+ (+ (* 48 s3-2) 156 (* 192 s4-4)) (the-as int (-> arg0 moods 0)))) + (s0-0 (+ (+ (* 48 s3-2) 156 (* 192 s4-4)) (the-as int (-> arg0 moods 1)))) ) (vector4-lerp! (the-as vector (+ s2-1 0)) (the-as vector (+ s1-0 0)) (the-as vector (+ s0-0 0)) f30-0) (vector4-lerp! (the-as vector (+ s2-1 16)) (the-as vector (+ s1-0 16)) (the-as vector (+ s0-0 16)) f30-0) @@ -506,7 +506,7 @@ ) ) ) - + ;; setup sky stuff (dotimes (s4-5 2) (make-sky-textures arg0 s4-5) @@ -530,14 +530,13 @@ (set! (-> arg0 current-sun env-color y) (* 0.5019608 (-> arg0 current-sun env-color y))) (set! (-> arg0 current-sun env-color z) (* 0.5019608 (-> arg0 current-sun env-color z))) (set! (-> arg0 current-sun env-color w) (* 0.5019608 (-> arg0 current-sun env-color w))) - + (let ((v1-179 (-> arg0 current-fog))) - (set! *fog-color* - (new 'static 'rgba - :r (the int (-> v1-179 fog-color x)) - :g (the int (-> v1-179 fog-color y)) - :b (the int (-> v1-179 fog-color z)) - ) + (set! *fog-color* (new 'static 'rgba + :r (the int (-> v1-179 fog-color x)) + :g (the int (-> v1-179 fog-color y)) + :b (the int (-> v1-179 fog-color z)) + ) ) ) (let ((v1-184 (-> arg0 current-fog erase-color))) @@ -554,73 +553,68 @@ (set! (-> *math-camera* fog-end) (-> arg0 current-fog fog-dists y)) (set! (-> *math-camera* fog-max) (-> arg0 current-fog fog-dists z)) (set! (-> *math-camera* fog-min) (-> arg0 current-fog fog-dists w)) - + ;; interp target lights. (note: added check here.) (let* ((v1-195 (if *target* (-> *target* draw light-index) 0)) (f30-1 (-> arg0 target-interp)) (s4-6 (-> arg0 light-group)) (s5-2 (-> arg0 light-group v1-195)) ) - + (when (nonzero? v1-195) + (cond + ((= f30-1 1.0) + ) + ((= f30-1 0.0) + (quad-copy! (the-as pointer (-> arg0 light-group v1-195)) (the-as pointer (-> arg0 light-group)) 12) + ) + (else + (dotimes (s3-4 4) + (vector4-lerp! + (the-as vector (+ (the-as uint (-> s5-2 dir0)) (* 48 s3-4))) + (the-as vector (+ (the-as uint (-> s4-6 0)) (* 48 s3-4))) + (the-as vector (+ (the-as uint (-> s5-2 dir0)) (* 48 s3-4))) + f30-1 + ) + (vector4-lerp! + (the-as vector (+ (the-as uint (-> s5-2 dir0 color)) (* 48 s3-4))) + (the-as vector (+ (the-as uint (-> s4-6 0 dir0 color)) (* 48 s3-4))) + (the-as vector (+ (the-as uint (-> s5-2 dir0 color)) (* 48 s3-4))) + f30-1 + ) + (vector4-lerp! + (the-as vector (+ (the-as uint (-> s5-2 dir0 levels)) (* 48 s3-4))) + (the-as vector (+ (the-as uint (-> s4-6 0 dir0 levels)) (* 48 s3-4))) + (the-as vector (+ (the-as uint (-> s5-2 dir0 levels)) (* 48 s3-4))) + f30-1 + ) + (vector-normalize! (the-as vector (+ (the-as uint (-> s5-2 dir0)) (* 48 s3-4))) 1.0) + ) + ) + ) - (when (nonzero? v1-195) - (cond - ((= f30-1 1.0) - ) - ((= f30-1 0.0) - (quad-copy! (the-as pointer (-> arg0 light-group v1-195)) (the-as pointer (-> arg0 light-group)) 12) - ) - (else - (dotimes (s3-4 4) - (vector4-lerp! - (the-as vector (+ (the-as uint (-> s5-2 dir0)) (* 48 s3-4))) - (the-as vector (+ (the-as uint (-> s4-6 0)) (* 48 s3-4))) - (the-as vector (+ (the-as uint (-> s5-2 dir0)) (* 48 s3-4))) - f30-1 + ;; some shadow thing. + (let ((a2-30 (new 'stack-no-clear 'vector))) + (set! (-> a2-30 x) (- (-> s5-2 dir0 direction x))) + (set! (-> a2-30 y) (- (-> s5-2 dir0 direction y))) + (set! (-> a2-30 z) (- (-> s5-2 dir0 direction z))) + (when (< (-> s5-2 dir0 direction y) 0.9063) + (let* ((f0-56 0.4226) + (f1-17 (-> a2-30 x)) + (f1-19 (* f1-17 f1-17)) + (f2-7 (-> a2-30 z)) + (f0-57 (/ f0-56 (sqrtf (+ f1-19 (* f2-7 f2-7))))) + ) + (set! (-> a2-30 x) (* (-> a2-30 x) f0-57)) + (set! (-> a2-30 y) -0.9063) + (set! (-> a2-30 z) (* (-> a2-30 z) f0-57)) + ) + ) + (vector4-lerp! (-> arg0 current-shadow) (-> arg0 current-shadow) a2-30 f30-1) ) - (vector4-lerp! - (the-as vector (+ (the-as uint (-> s5-2 dir0 color)) (* 48 s3-4))) - (the-as vector (+ (the-as uint (-> s4-6 0 dir0 color)) (* 48 s3-4))) - (the-as vector (+ (the-as uint (-> s5-2 dir0 color)) (* 48 s3-4))) - f30-1 - ) - (vector4-lerp! - (the-as vector (+ (the-as uint (-> s5-2 dir0 levels)) (* 48 s3-4))) - (the-as vector (+ (the-as uint (-> s4-6 0 dir0 levels)) (* 48 s3-4))) - (the-as vector (+ (the-as uint (-> s5-2 dir0 levels)) (* 48 s3-4))) - f30-1 - ) - (vector-normalize! - (the-as vector (+ (the-as uint (-> s5-2 dir0)) (* 48 s3-4))) - 1.0 - ) - ) + (vector-normalize! (-> arg0 current-shadow) 1.0) ) - ) - - ;; some shadow thing. - (let ((a2-30 (new 'stack-no-clear 'vector))) - (set! (-> a2-30 x) (- (-> s5-2 dir0 direction x))) - (set! (-> a2-30 y) (- (-> s5-2 dir0 direction y))) - (set! (-> a2-30 z) (- (-> s5-2 dir0 direction z))) - (when (< (-> s5-2 dir0 direction y) 0.9063) - (let* ((f0-56 0.4226) - (f1-17 (-> a2-30 x)) - (f1-19 (* f1-17 f1-17)) - (f2-7 (-> a2-30 z)) - (f0-57 (/ f0-56 (sqrtf (+ f1-19 (* f2-7 f2-7))))) - ) - (set! (-> a2-30 x) (* (-> a2-30 x) f0-57)) - (set! (-> a2-30 y) -0.9063) - (set! (-> a2-30 z) (* (-> a2-30 z) f0-57)) - ) - ) - (vector4-lerp! (-> arg0 current-shadow) (-> arg0 current-shadow) a2-30 f30-1) - ) - (vector-normalize! (-> arg0 current-shadow) 1.0) ) - ) - + (reset! *palette-fade-controls*) 0 (none) diff --git a/goal_src/engine/gfx/water/water.gc b/goal_src/engine/gfx/water/water.gc index df86336208..5dcb022ee9 100644 --- a/goal_src/engine/gfx/water/water.gc +++ b/goal_src/engine/gfx/water/water.gc @@ -47,7 +47,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! s5-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 (the-as symbol s5-0)) + (sound-play "water-drop" :position (the-as symbol s5-0)) (sp-launch-particles-var *sp-particle-system-3d* (-> *part-id-table* 108) @@ -642,7 +642,9 @@ ((zero? (logand (-> obj flags) (water-flags wt01))) (logclear! (-> obj flags) (water-flags wt09 wt10 wt11 wt12 wt13 wt14 wt16)) ) - ((and (logtest? (water-flags wt21) (-> obj flags)) (logtest? (-> obj process state-flags) (state-flags grabbed))) + ((and (logtest? (water-flags wt21) (-> obj flags)) + (logtest? (-> obj process state-flags) (state-flags grabbed)) + ) (set! (-> obj flags) (logior (water-flags wt16) (-> obj flags))) ) ((begin diff --git a/goal_src/engine/ps2/pad.gc b/goal_src/engine/ps2/pad.gc index 22586f6f30..90032db363 100644 --- a/goal_src/engine/ps2/pad.gc +++ b/goal_src/engine/ps2/pad.gc @@ -434,8 +434,8 @@ "play the appropriate sound for inputting a cheat code" `(if ,cheat? - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") + (sound-play "cursor-options") ) ) diff --git a/goal_src/engine/sound/gsound-h.gc b/goal_src/engine/sound/gsound-h.gc index 4735ba578a..637186e5be 100644 --- a/goal_src/engine/sound/gsound-h.gc +++ b/goal_src/engine/sound/gsound-h.gc @@ -10,6 +10,19 @@ ;; The EE sends commands using the IOP RPC system to the OVERLORD IOP driver telling it to load and play sounds. ;; There is also some sort of per-frame status update, that is not included here. +(defenum sound-group + :bitfield #t + :type uint8 + (sfx) + (music) + (dialog) + (sog3) + (ambient) + (sog5) + (sog6) + (sog7) + ) + (deftype sound-id (uint32) () (:methods @@ -173,7 +186,7 @@ (priority int8 :offset-assert 11) (volume int32 :offset-assert 12) (trans vector3w :inline :offset-assert 16) - (group uint8 :offset-assert 28) + (group sound-group :offset-assert 28) ) :pack-me :method-count-assert 9 @@ -198,7 +211,7 @@ ) (deftype sound-rpc-group-cmd (sound-rpc-cmd) - ((group uint8 :offset-assert 4) + ((group sound-group :offset-assert 4) ) :method-count-assert 9 :size-assert #x5 @@ -435,9 +448,9 @@ (deftype sound-spec (basic) ((mask sound-mask :offset-assert 4) (num float :offset-assert 8) - (group uint8 :offset-assert 12) + (group sound-group :offset-assert 12) + (sound-name-char uint8 16 :offset 16) (sound-name sound-name :score 20 :offset 16) - (sound-name-char uint8 16 :offset 16) ;; moved to after sound-name (trans float 4 :offset-assert 32) ;; guess (volume int32 :offset-assert 48) (pitch-mod int32 :offset-assert 52) diff --git a/goal_src/engine/sound/gsound.gc b/goal_src/engine/sound/gsound.gc index 4e6784b8e0..b81d140a73 100644 --- a/goal_src/engine/sound/gsound.gc +++ b/goal_src/engine/sound/gsound.gc @@ -301,7 +301,7 @@ ) ) -(defun sound-set-volume ((group uint) (volume float)) +(defun sound-set-volume ((group sound-group) (volume float)) (let ((cmd (the sound-rpc-set-master-volume (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command set-master-volume)) @@ -351,10 +351,17 @@ ) ) -(defun sound-play-by-name ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group int) (trans symbol)) +(defmacro sound-play (name &key (id (new-sound-id)) + &key (vol 100.0) &key (pitch 0) &key (bend 0) + &key (group sfx) + &key (position #t)) + `(sound-play-by-name (static-sound-name ,name) ,id (the int (* (/ 1024.0 100.0) ,vol)) (the int (* 1524.0 ,pitch)) ,bend (sound-group ,group) ,position) + ) + +(defun sound-play-by-name ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group sound-group) (trans symbol)) "Play a sound called name with the specified params" - (local-vars (sv-16 int)) + (local-vars (sv-16 sound-group)) (set! sv-16 group) (let ((sound-trans (the-as vector trans))) (when *sound-player-enable* @@ -364,7 +371,7 @@ (set! (-> cmd id) id) (set! (-> cmd name) name) (set! (-> cmd parms mask) (sound-mask)) - (set! (-> cmd parms group) (the-as uint sv-16)) + (set! (-> cmd parms group) sv-16) (set! (-> cmd parms volume) vol) (set! (-> cmd parms pitch-mod) pitch) (set! (-> cmd parms bend) bend) @@ -428,7 +435,7 @@ 0 ) -(defun sound-group-pause ((group uint)) +(defun sound-group-pause ((group sound-group)) (let ((cmd (the sound-rpc-pause-group (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command pause-group)) @@ -437,7 +444,7 @@ 0 ) -(defun sound-group-stop ((group uint)) +(defun sound-group-stop ((group sound-group)) (let ((cmd (the sound-rpc-stop-group (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command stop-group)) @@ -446,7 +453,7 @@ 0 ) -(defun sound-group-continue ((group uint)) +(defun sound-group-continue ((group sound-group)) (let ((cmd (the sound-rpc-continue-group (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command continue-group)) @@ -654,7 +661,7 @@ (-> obj volume) (-> obj pitch) 0 - 1 + (sound-group sfx) (the-as symbol (-> obj trans)))) ) (else @@ -665,7 +672,7 @@ (-> obj volume) (-> obj pitch) 0 - 1 + (sound-group sfx) (the-as symbol (-> obj trans)))) (set! (-> obj play-time) (+ (-> *display* base-frame-counter) (-> obj time-base) diff --git a/goal_src/engine/target/target-death.gc b/goal_src/engine/target/target-death.gc index f398f3203c..110ce8b206 100644 --- a/goal_src/engine/target/target-death.gc +++ b/goal_src/engine/target/target-death.gc @@ -585,10 +585,10 @@ (= v1-13 'up) ) ) - (sound-play-by-name (static-sound-name "hit-up") (new-sound-id) 1024 0 0 1 #t) + (sound-play "hit-up") ) (else - (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + (sound-play "oof") ) ) ) @@ -597,7 +597,7 @@ (process-spawn-function process process-drawable-burn-effect 1200 :to self) ) (('tar) - (sound-play-by-name (static-sound-name "get-burned") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-burned") ) ) 0 @@ -620,7 +620,8 @@ (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) (zero? (logand (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -732,7 +733,7 @@ (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! eichar-jump-ja :num! (seek!) :frame-num 0.0) (when (= (-> arg0 angle) 'air) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (sound-play "smack-surface") (dummy-10 (-> self skel effect) 'group-smack-surface (the-as float 0.0) 5) (dummy-10 (-> self skel effect) 'group-smack-surface-dizzy (the-as float 0.0) 8) ) @@ -740,7 +741,7 @@ (('shove) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! eichar-smack-surface-ja :num! (seek!) :frame-num 0.0) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (sound-play "smack-surface") ) (else (when (not (ja-group? eichar-hit-from-front-ja)) @@ -1107,7 +1108,7 @@ ) ) (('drown 'drown-death) - (sound-play-by-name (static-sound-name "death-drown") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-drown") (logclear! (-> self water flags) (water-flags wt04)) (clear-collide-with-as (-> self control)) (set! (-> self control unknown-surface00) *dive-mods*) @@ -1146,7 +1147,7 @@ ) (cond ((= arg0 'dark-eco-pool) - (sound-play-by-name (static-sound-name "death-darkeco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-darkeco") (process-spawn part-tracker :init part-tracker-init @@ -1160,7 +1161,7 @@ ) ) ((or (= arg0 'lava) (= arg0 'melt)) - (sound-play-by-name (static-sound-name "death-melt") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-melt") (process-spawn part-tracker :init part-tracker-init @@ -1185,7 +1186,7 @@ ) ) (('endlessfall) - (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-fall") (camera-change-to (the-as string cam-endlessfall) 30 #f) (set! (-> self control pat-ignore-mask unknown-bit) 1) (logclear! (-> self water flags) (water-flags wt04)) @@ -1322,7 +1323,7 @@ (else (case arg0 (('tar) - (sound-play-by-name (static-sound-name "death-drown") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-drown") ) ) (+! (-> *game-info* death-movie-tick) 1) diff --git a/goal_src/engine/target/target-handler.gc b/goal_src/engine/target/target-handler.gc index 63920d33e5..8470d5962b 100644 --- a/goal_src/engine/target/target-handler.gc +++ b/goal_src/engine/target/target-handler.gc @@ -425,7 +425,7 @@ self ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.5)) - (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + (sound-play "oof") #t ) (else @@ -1022,7 +1022,7 @@ #f ) ((= arg2 'jump) - (sound-play-by-name (static-sound-name "jump-long") (new-sound-id) 1024 0 0 1 #t) + (sound-play "jump-long") (go target-jump (the-as float (-> arg3 param 0)) @@ -1077,7 +1077,17 @@ target-standard-event-handler (set! (-> self control unknown-vector11 quad) (the-as uint128 0)) (set! (-> self control unknown-float41) 0.0) (set! (-> self control unknown-float81) 0.0) - (logclear! (-> self state-flags) (state-flags sf02 being-attacked do-not-notice grabbed first-person-mode looking-at-enemy falling-into-pool-of-bad flop-hit-ground)) + (logclear! (-> self state-flags) (state-flags + sf02 + being-attacked + do-not-notice + grabbed + first-person-mode + looking-at-enemy + falling-into-pool-of-bad + flop-hit-ground + ) + ) (target-danger-set! 'harmless #f) (logior! (-> self water flags) (water-flags wt04)) (logclear! (-> self water flags) (water-flags wt16)) diff --git a/goal_src/engine/target/target-part.gc b/goal_src/engine/target/target-part.gc index 2e1feda33e..b016d29e38 100644 --- a/goal_src/engine/target/target-part.gc +++ b/goal_src/engine/target/target-part.gc @@ -2141,7 +2141,7 @@ ) (defbehavior process-drawable-burn-effect target ((arg0 time-frame)) - (sound-play-by-name (static-sound-name "get-burned") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-burned") (let ((s5-1 (new 'stack 'rgbaf)) (s3-0 (-> *display* base-frame-counter)) (s4-1 (-> self parent)) diff --git a/goal_src/engine/target/target-util.gc b/goal_src/engine/target/target-util.gc index 7ebde0ac3e..9ce84022e8 100644 --- a/goal_src/engine/target/target-util.gc +++ b/goal_src/engine/target/target-util.gc @@ -813,7 +813,9 @@ (or (zero? (logand (-> self control status) (cshape-moving-flags twall))) (>= 0.7 (-> self control touch-angle)) ) - (and (< (-> self control unknown-float61) 0.7) (zero? (logand (-> self state-flags) (state-flags prevent-duck)))) + (and (< (-> self control unknown-float61) 0.7) + (zero? (logand (-> self state-flags) (state-flags prevent-duck))) + ) ) ) diff --git a/goal_src/engine/target/target.gc b/goal_src/engine/target/target.gc index 4470e8f961..c29628d8a6 100644 --- a/goal_src/engine/target/target.gc +++ b/goal_src/engine/target/target.gc @@ -1422,7 +1422,7 @@ ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 716 0 0 1 #t) + (sound-play "jump" :vol 70) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! arg2 (cond @@ -1474,7 +1474,8 @@ (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) (zero? (logand (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -1594,7 +1595,8 @@ (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) (zero? (logand (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -1653,7 +1655,7 @@ ) (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 457 0 1 #t) + (sound-play "jump" :pitch 0.3) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (set! (-> self control unknown-surface00) (cond ((= arg2 'flip) @@ -1693,7 +1695,8 @@ (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) (zero? (logand (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -1758,7 +1761,7 @@ :event target-jump-event-handler :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 819 -609 0 1 #t) + (sound-play "jump" :vol 80 :pitch -0.4) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (cond @@ -2194,7 +2197,7 @@ ) :code (behavior () (if (logtest? (-> self water flags) (water-flags wt09)) - (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) + (sound-play "swim-stroke") ) (ja-channel-push! 1 (seconds 0.02)) (ja :group! eichar-attack-punch-ja :num! min) @@ -2541,7 +2544,8 @@ (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) (zero? (logand (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (set-quaternion! (-> self control) (-> self control dir-targ)) diff --git a/goal_src/engine/target/target2.gc b/goal_src/engine/target/target2.gc index e4f25cd1b2..56c5efc115 100644 --- a/goal_src/engine/target/target2.gc +++ b/goal_src/engine/target/target2.gc @@ -1059,7 +1059,7 @@ (none) ) :code (behavior ((arg0 float) (arg1 float)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "jump") (send-event *camera* 'damp-up) (ja :group! (-> self draw art-group data 83) :num! min) (let ((f0-1 (target-height-above-ground)) @@ -1116,7 +1116,7 @@ (none) ) :code (behavior ((arg0 float) (arg1 float)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "jump") (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -1691,7 +1691,7 @@ (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) - (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) + (sound-play "swim-stroke") (dummy-13 (-> self water) (the-as float 1.4) (-> self control trans) 0 (-> self control transv)) (go target-attack) ) @@ -1736,7 +1736,7 @@ (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) - (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) + (sound-play "swim-stroke") (dummy-13 (-> self water) (the-as float 1.4) (-> self control trans) 0 (-> self control transv)) (go target-attack) ) @@ -2677,7 +2677,7 @@ :to self ) ) - (sound-play-by-name (static-sound-name "launch-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "launch-fire") (go target-high-jump arg0 arg0 'launch) (none) ) diff --git a/goal_src/engine/ui/hud-classes.gc b/goal_src/engine/ui/hud-classes.gc index 047494a366..5cde804efa 100644 --- a/goal_src/engine/ui/hud-classes.gc +++ b/goal_src/engine/ui/hud-classes.gc @@ -670,7 +670,7 @@ ) ) (set! (-> obj start-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "get-all-orbs") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-all-orbs") 0 (none) ) diff --git a/goal_src/engine/ui/hud.gc b/goal_src/engine/ui/hud.gc index d3e230783d..5822000d4f 100644 --- a/goal_src/engine/ui/hud.gc +++ b/goal_src/engine/ui/hud.gc @@ -73,7 +73,7 @@ (when (and (!= (-> obj value) (-> obj target-value)) (>= (- (-> *display* base-frame-counter) (-> obj last-increment-time)) (seconds 0.1)) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (+! (-> obj value) 1) (set! (-> obj last-increment-time) (-> *display* base-frame-counter)) ) diff --git a/goal_src/engine/ui/progress/progress.gc b/goal_src/engine/ui/progress/progress.gc index f6c9f24950..68a50db5c8 100644 --- a/goal_src/engine/ui/progress/progress.gc +++ b/goal_src/engine/ui/progress/progress.gc @@ -1008,13 +1008,13 @@ (cond ((< (-> obj option-index) 4) (when (nonzero? (-> s5-0 file (-> obj option-index) present)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *progress-state* which) (-> obj option-index)) (set! (-> obj next-display-state) (progress-screen memcard-loading)) ) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1022,7 +1022,7 @@ (((progress-screen save-game) (progress-screen save-game-title)) (cond ((< (-> obj option-index) 4) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *progress-state* which) (-> obj option-index)) (if (zero? (-> s5-0 file (-> obj option-index) present)) (set! (-> obj next-display-state) (progress-screen memcard-saving)) @@ -1030,30 +1030,30 @@ ) ) ((and (= (-> obj display-state) (progress-screen save-game-title)) (= (-> obj option-index) 4)) - (sound-play-by-name (static-sound-name "starts-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "starts-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) ) (((progress-screen memcard-insert)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen memcard-data-exists)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-saving)) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (if (= (-> obj display-state-stack 0) (progress-screen title)) (set! (-> obj next-display-state) (progress-screen save-game-title)) (set! (-> obj next-display-state) (progress-screen save-game)) @@ -1064,11 +1064,11 @@ (((progress-screen memcard-no-data)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-creating)) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") @@ -1082,18 +1082,18 @@ ) (cond ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) ((nonzero? (-> obj display-state-stack 0)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1106,19 +1106,19 @@ (progress-screen memcard-removed) (progress-screen auto-save) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen pal-change-to-60hz)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) (set! (-> obj video-mode-timeout) (-> *display* real-frame-counter)) (set! (-> obj next-display-state) (progress-screen pal-now-60hz)) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> *progress-state* video-mode-choice) 'pal) (set! (-> obj next-display-state) (progress-screen invalid)) ) @@ -1129,30 +1129,30 @@ ((not (-> *progress-state* yes-no-choice)) (set! (-> *progress-state* video-mode-choice) 'pal) (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") ) (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") ) ) (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen no-disc) (progress-screen bad-disc)) (when (is-cd-in?) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) (((progress-screen quit)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "title-start") ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1160,18 +1160,18 @@ (((progress-screen memcard-format)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-formatting)) ) ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1195,7 +1195,7 @@ ((cpad-pressed? 0 up) (when (not (-> obj selected-option)) (if (!= (length s5-0) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") ) (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) (if (> (-> obj option-index) 0) @@ -1218,7 +1218,7 @@ (when v1-34 (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) 1024 0 0 1 #t) + (sound-play "slider2001") ) ) ) @@ -1231,7 +1231,7 @@ ((cpad-pressed? 0 down) (when (not (-> obj selected-option)) (if (!= (length s5-0) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") ) (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) (cond @@ -1259,7 +1259,7 @@ (when v1-69 (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) 1024 0 0 1 #t) + (sound-play "slider2001") ) ) ) @@ -1308,7 +1308,7 @@ ) ) (if s4-5 - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1353,7 +1353,7 @@ ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 f30-0)) 0 0 1 #t) + (sound-play "slider2001" :vol f30-0) ) ) ) @@ -1405,7 +1405,7 @@ ) ) (if v1-217 - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1450,7 +1450,7 @@ ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 f30-1)) 0 0 1 #t) + (sound-play "slider2001" :vol f30-1) ) ) ) @@ -1488,7 +1488,7 @@ ) ) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj selected-option) #f) ) ((or (can-go-back? obj) @@ -1501,8 +1501,8 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-stats") + (sound-play "cursor-options") ) (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) (set! (-> obj next-display-state) (progress-screen invalid)) @@ -1519,7 +1519,7 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) (push! obj) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (the-as progress-screen (-> s5-0 (-> obj option-index) param3))) (case (-> obj next-display-state) (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) @@ -1535,8 +1535,8 @@ ) ((= (-> s5-0 (-> obj option-index) name) (game-text-id back)) (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-stats") + (sound-play "cursor-options") ) (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) (set! (-> obj next-display-state) (progress-screen invalid)) @@ -1570,7 +1570,7 @@ ) ) ) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) @@ -1587,7 +1587,7 @@ ) ) (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj selected-option) #f) (case (-> s5-0 (-> obj option-index) option-type) (((game-option-type aspect-ratio)) @@ -1631,7 +1631,7 @@ (let ((s5-0 (-> obj display-level-index))) (set! (-> obj next-level-index) (get-next-level-down s5-0)) (when (!= s5-0 (-> obj next-level-index)) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! (-> obj level-transition) 2) ) ) @@ -1640,28 +1640,28 @@ (let ((s5-2 (-> obj next-level-index))) (set! (-> obj next-level-index) (get-next-level-up s5-2)) (when (!= s5-2 (-> obj next-level-index)) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! (-> obj level-transition) 1) ) ) ) ((cpad-pressed? 0 square) (when (nonzero? (-> obj display-state)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen fuel-cell)) (set! (-> obj stat-transition) #t) ) ) ((cpad-pressed? 0 x) (when (!= (-> obj display-state) (progress-screen money)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen money)) (set! (-> obj stat-transition) #t) ) ) ((cpad-pressed? 0 triangle) (when (!= (-> obj display-state) (progress-screen buzzer)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen buzzer)) (set! (-> obj stat-transition) #t) ) @@ -1669,7 +1669,7 @@ ((cpad-pressed? 0 circle) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (push! obj) (set! (-> obj next-display-state) (progress-screen settings)) ) @@ -1679,7 +1679,7 @@ (let ((s5-8 (-> obj task-index))) (set! (-> obj task-index) (get-next-task-down (-> obj task-index) (-> obj display-level-index))) (if (!= s5-8 (-> obj task-index)) - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1687,7 +1687,7 @@ (let ((s5-10 (-> obj task-index))) (set! (-> obj task-index) (get-next-task-up (-> obj task-index) (-> obj display-level-index))) (if (!= s5-10 (-> obj task-index)) - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -2179,11 +2179,11 @@ (-> progress-waiting event) :enter (behavior () - (sound-group-pause (the-as uint 255)) + (sound-group-pause (sound-group sfx music dialog sog3 ambient sog5 sog6 sog7)) (logclear! (-> *setting-control* default process-mask) (process-mask pause menu)) (add-setting! 'process-mask 'set 0.0 16) (apply-settings *setting-control*) - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") (set-blackout-frames 0) (set! *pause-lock* #f) (none) @@ -2214,7 +2214,7 @@ (defstate progress-going-out (progress) :enter (behavior () - (sound-play-by-name (static-sound-name "menu-close") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-close") (hide-progress-icons) (set! (-> self particles 3 init-pos x) -320.0) (set! (-> self particles 4 init-pos x) -320.0) diff --git a/goal_src/levels/beach/beach-obs.gc b/goal_src/levels/beach/beach-obs.gc index d31e4fb138..c9ecb7a2c5 100644 --- a/goal_src/levels/beach/beach-obs.gc +++ b/goal_src/levels/beach/beach-obs.gc @@ -53,7 +53,7 @@ (rider-trans) (let ((t2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)))) (if (!= (+ (-> t2-0 x) (-> t2-0 y) (-> t2-0 z)) 0.0) - (sound-play-by-name (static-sound-name "gears-rumble") (-> self sound-id) 1024 0 0 1 (the-as symbol t2-0)) + (sound-play "gears-rumble" :id (-> self sound-id) :position (the-as symbol t2-0)) ) ) (none) @@ -233,8 +233,8 @@ (the-as uint 2) ) ) - (sound-play-by-name (static-sound-name "grotto-pole-hit") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "dirt-crumble") (new-sound-id) 1024 0 0 1 #t) + (sound-play "grotto-pole-hit") + (sound-play "dirt-crumble") (increment-success-for-hint (game-text-id beach-grottopole-increment)) (go grottopole-moving-up) ) @@ -248,8 +248,8 @@ (the-as uint 1) ) ) - (sound-play-by-name (static-sound-name "grotto-pole-hit") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "dirt-crumble") (new-sound-id) 1024 0 0 1 #t) + (sound-play "grotto-pole-hit") + (sound-play "dirt-crumble") (go grottopole-moving-down) ) ) @@ -548,7 +548,7 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) - (sound-play-by-name (static-sound-name "cannon-shot") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cannon-shot") (increment-success-for-hint (game-text-id beach-eco-rock-increment)) (go ecoventrock-break #f) ) @@ -1011,7 +1011,7 @@ ) (defbehavior flutflutegg-hit-sounds flutflutegg () - (sound-play-by-name (static-sound-name "egg-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "egg-hit") (cond ((not (task-closed? (game-task beach-flutflut) (task-status need-introduction))) ) @@ -1238,7 +1238,7 @@ ) ) ) - (sound-play-by-name (static-sound-name "sack-land") (new-sound-id) 2048 0 0 1 #t) + (sound-play "sack-land" :vol 200) (go flutflutegg-break #f) ) (none) diff --git a/goal_src/levels/beach/lurkercrab.gc b/goal_src/levels/beach/lurkercrab.gc index a57f2adb08..53eb409c0d 100644 --- a/goal_src/levels/beach/lurkercrab.gc +++ b/goal_src/levels/beach/lurkercrab.gc @@ -360,7 +360,9 @@ nav-enemy-default-event-handler (none) ) :trans (behavior () - (if (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying)) + (if (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (go-virtual nav-enemy-victory) ) (if (< (ja-aframe-num 0) 2.0) diff --git a/goal_src/levels/beach/lurkerpuppy.gc b/goal_src/levels/beach/lurkerpuppy.gc index 6a18e2de59..7b8460c1c1 100644 --- a/goal_src/levels/beach/lurkerpuppy.gc +++ b/goal_src/levels/beach/lurkerpuppy.gc @@ -69,7 +69,7 @@ nav-enemy-default-event-handler (let ((f30-0 (rand-vu-float-range 0.9 1.1))) (loop (if (rand-vu-percent? 0.25) - (sound-play-by-name (static-sound-name "puppy-bark") (new-sound-id) 1024 0 0 1 #t) + (sound-play "puppy-bark") ) (ja-no-eval :group! lurkerpuppy-run-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -170,7 +170,7 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :code (behavior () - (sound-play-by-name (static-sound-name "head-butt") (new-sound-id) 1024 0 0 1 #t) + (sound-play "head-butt") (go-virtual nav-enemy-victory) (none) ) diff --git a/goal_src/levels/beach/lurkerworm.gc b/goal_src/levels/beach/lurkerworm.gc index ce30498210..58300d0bc1 100644 --- a/goal_src/levels/beach/lurkerworm.gc +++ b/goal_src/levels/beach/lurkerworm.gc @@ -339,7 +339,7 @@ lurkerworm-default-post-behavior :event lurkerworm-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "worm-rise1") (new-sound-id) 1024 0 0 1 #t) + (sound-play "worm-rise1") (none) ) :code (behavior () diff --git a/goal_src/levels/beach/pelican.gc b/goal_src/levels/beach/pelican.gc index 2dc60d6b62..702fea9c01 100644 --- a/goal_src/levels/beach/pelican.gc +++ b/goal_src/levels/beach/pelican.gc @@ -811,7 +811,7 @@ (set! (-> v1-2 user-int8 0) 5) ) (when (not arg0) - (sound-play-by-name (static-sound-name "scrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "scrate-break") (process-spawn part-tracker :init part-tracker-init diff --git a/goal_src/levels/beach/seagull.gc b/goal_src/levels/beach/seagull.gc index 522e882d69..527ec7c892 100644 --- a/goal_src/levels/beach/seagull.gc +++ b/goal_src/levels/beach/seagull.gc @@ -1259,7 +1259,7 @@ (if (>= (-> obj targetnum) 4) (set! (-> obj teleport-frames) 1500) ) - (sound-play-by-name (static-sound-name "seagull-takeoff") (new-sound-id) 1024 0 0 1 #t) + (sound-play "seagull-takeoff") (set! (-> obj alert-time) (-> *display* base-frame-counter)) ) (none) diff --git a/goal_src/levels/citadel/citadel-obs.gc b/goal_src/levels/citadel/citadel-obs.gc index e06c923381..875dae4295 100644 --- a/goal_src/levels/citadel/citadel-obs.gc +++ b/goal_src/levels/citadel/citadel-obs.gc @@ -737,48 +737,50 @@ (defstate citb-robotboss-idle (citb-robotboss) :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (sv-96 int) (sv-112 int)) - (the-as object (cond - ((= arg2 'shield-off) - (stop! (-> self sound)) - (if (-> self shield-on) - (sound-play-by-name (static-sound-name "robotcage-off") (new-sound-id) 1024 0 0 1 #t) + (the-as + object + (cond + ((= arg2 'shield-off) + (stop! (-> self sound)) + (if (-> self shield-on) + (sound-play "robotcage-off") + ) + (set! (-> self shield-on) #f) + #f + ) + ((= arg2 'shield-on) + (let ((v0-3 #t)) + (set! (-> self shield-on) v0-3) + v0-3 + ) + ) + ((= arg2 'die) + (cleanup-for-death self) + (the-as symbol (deactivate self)) + ) + ((or (= arg2 'touch) (= arg2 'attack)) + (let ((s4-0 sound-play-by-name) + (s3-0 (make-u128 #x7061 (the-as uint #x7a2d646c65696873))) + (s2-0 (new-sound-id)) + (s1-0 1024) + (s0-0 0) + ) + (set! sv-96 0) + (set! sv-112 1) + (let ((t2-1 (target-pos 0))) + (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-96 (the-as sound-group sv-112) (the-as symbol t2-1)) + ) + ) + (the-as symbol (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) ) - (set! (-> self shield-on) #f) - #f - ) - ((= arg2 'shield-on) - (let ((v0-3 #t)) - (set! (-> self shield-on) v0-3) - v0-3 - ) - ) - ((= arg2 'die) - (cleanup-for-death self) - (the-as symbol (deactivate self)) - ) - ((or (= arg2 'touch) (= arg2 'attack)) - (let ((s4-0 sound-play-by-name) - (s3-0 (make-u128 #x7061 (the-as uint #x7a2d646c65696873))) - (s2-0 (new-sound-id)) - (s1-0 1024) - (s0-0 0) - ) - (set! sv-96 0) - (set! sv-112 1) - (let ((t2-1 (target-pos 0))) - (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-96 sv-112 (the-as symbol t2-1)) - ) - ) - (the-as symbol (send-event - arg0 - 'shove - (-> arg3 param 0) - (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) - ) - ) - ) - ) - ) + ) + ) + ) + ) ) :code (behavior () (let ((gp-0 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-nose-sg* #f :to self))) @@ -1323,7 +1325,7 @@ (-> self root-override trans) :to *entity-pool* ) - (sound-play-by-name (static-sound-name "sagecage-open") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sagecage-open") (go citb-generator-broken) (none) ) diff --git a/goal_src/levels/citadel/citadel-sages.gc b/goal_src/levels/citadel/citadel-sages.gc index 832f2f7e0f..75a7cfae25 100644 --- a/goal_src/levels/citadel/citadel-sages.gc +++ b/goal_src/levels/citadel/citadel-sages.gc @@ -103,7 +103,7 @@ (the-as object (cond ((= v1-0 'disable-bars) (stop! (-> self sound)) - (sound-play-by-name (static-sound-name "sagecage-off") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sagecage-off") (set! (-> self bars-on) #f) (citb-sagecage-update-collision) ) @@ -396,7 +396,7 @@ 1024 0 0 - 1 + (sound-group sfx) (the-as symbol (-> self spawn-pos)) ) ) diff --git a/goal_src/levels/citadel/citb-drop-plat.gc b/goal_src/levels/citadel/citb-drop-plat.gc index 2fab97562b..c731734620 100644 --- a/goal_src/levels/citadel/citb-drop-plat.gc +++ b/goal_src/levels/citadel/citb-drop-plat.gc @@ -169,7 +169,7 @@ ) (when (and (not s5-0) (< (-> self interp) 0.05)) (set! s5-0 #t) - (sound-play-by-name (static-sound-name "bridge-piece-up") (new-sound-id) 1024 0 0 1 (the-as symbol gp-0)) + (sound-play "bridge-piece-up" :position (the-as symbol gp-0)) ) (set! (-> self spin-angle) (* 10.0 (-> self spin-speed) (-> self interp))) (if (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) @@ -195,7 +195,7 @@ :code (behavior () (when (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "bridge-piece-dn") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bridge-piece-dn") (let ((gp-1 (the int (* 300.0 (rand-vu-float-range 0.2 0.3))))) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) gp-1) (set! (-> self interp) diff --git a/goal_src/levels/citadel/citb-plat.gc b/goal_src/levels/citadel/citb-plat.gc index 222265e82b..8581bc711c 100644 --- a/goal_src/levels/citadel/citb-plat.gc +++ b/goal_src/levels/citadel/citb-plat.gc @@ -223,15 +223,7 @@ (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (vector+! (-> self basetrans) (-> self basetrans) (-> self trans-offset)) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (none) @@ -791,15 +783,7 @@ (set! (-> self path-pos) (get-current-phase (-> self sync))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (none) @@ -953,15 +937,7 @@ ) (ja-channel-push! 1 (seconds 0.1)) (restore-collide-with-as (-> self root-override)) - (sound-play-by-name - (static-sound-name "eco-torch") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self blast-pos)) - ) + (sound-play "eco-torch" :position (the-as symbol (-> self blast-pos))) (dotimes (gp-1 2) (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/levels/common/basebutton.gc b/goal_src/levels/common/basebutton.gc index 44f3bf3872..b840cb7a9c 100644 --- a/goal_src/levels/common/basebutton.gc +++ b/goal_src/levels/common/basebutton.gc @@ -83,13 +83,13 @@ (case (-> arg3 param 1) (('flop) (TODO-RENAME-29 self (-> self event-going-down) (-> self notify-actor)) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-down) ) ) ) (('trigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-down) ) (('move-to) @@ -124,7 +124,7 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('untrigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-up) ) (('move-to) @@ -163,7 +163,7 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('untrigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-up) ) (('move-to) @@ -192,7 +192,7 @@ (suspend) ) (TODO-RENAME-29 self (-> self event-going-up) (-> self notify-actor)) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-up) ) ) @@ -217,7 +217,7 @@ (move-to-vec-or-quat! self (the-as vector (-> arg3 param 0)) (the-as quaternion (-> arg3 param 1))) ) (('trigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-down) ) ) diff --git a/goal_src/levels/common/baseplat.gc b/goal_src/levels/common/baseplat.gc index cf094f4da3..e2fb8270e7 100644 --- a/goal_src/levels/common/baseplat.gc +++ b/goal_src/levels/common/baseplat.gc @@ -184,11 +184,11 @@ (cond ((-> self locked) (if (= (-> self next-state name) 'door-closed) - (sound-play-by-name (static-sound-name "door-lock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "door-lock") ) ) (else - (sound-play-by-name (static-sound-name "door-unlock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "door-unlock") ) ) #t @@ -240,17 +240,9 @@ eco-door-event-handler ) ) (if gp-0 - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) ) - (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) (clear-collide-with-as (-> self root-override)) (until (ja-done? 0) (ja :num! (seek! max (-> self speed))) @@ -312,13 +304,13 @@ eco-door-event-handler (suspend) ) ) - (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) (until (ja-done? 0) (ja :num! (seek! 0.0 (-> self speed))) (suspend) ) (if (-> self locked) - (sound-play-by-name (static-sound-name "door-lock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "door-lock") ) (go-virtual door-closed) (none) diff --git a/goal_src/levels/common/battlecontroller.gc b/goal_src/levels/common/battlecontroller.gc index cf1ab456c7..a206c4afbe 100644 --- a/goal_src/levels/common/battlecontroller.gc +++ b/goal_src/levels/common/battlecontroller.gc @@ -533,7 +533,7 @@ battlecontroller-default-event-handler process-drawable-fuel-cell-handler ) :code (behavior () - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 -2286 0 1 #f) + (sound-play "money-pickup" :pitch -1.5 :position #f) (battlecontroller-battle-end) (battlecontroller-camera-off) (battlecontroller-set-task-completed) diff --git a/goal_src/levels/common/launcherdoor.gc b/goal_src/levels/common/launcherdoor.gc index 303119b951..9a7f0865b1 100644 --- a/goal_src/levels/common/launcherdoor.gc +++ b/goal_src/levels/common/launcherdoor.gc @@ -48,7 +48,7 @@ (defstate launcherdoor-closed (launcherdoor) :code (behavior ((arg0 symbol)) (if (not arg0) - (sound-play-by-name (static-sound-name "ldoor-close") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ldoor-close") ) (when *target* (case (-> *target* current-level name) @@ -110,7 +110,7 @@ (defstate launcherdoor-open (launcherdoor) :code (behavior ((arg0 symbol)) (if (not arg0) - (sound-play-by-name (static-sound-name "ldoor-open") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ldoor-open") ) (set! (-> self draw force-lod) 0) (clear-collide-with-as (-> self root-override)) diff --git a/goal_src/levels/common/orb-cache.gc b/goal_src/levels/common/orb-cache.gc index f862a5c58d..3e4f734d55 100644 --- a/goal_src/levels/common/orb-cache.gc +++ b/goal_src/levels/common/orb-cache.gc @@ -73,7 +73,7 @@ ) :code (behavior ((arg0 symbol)) (if (and (not arg0) (-> self child)) - (sound-play-by-name (static-sound-name "close-orb-cash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "close-orb-cash") ) (dotimes (gp-1 (-> self money)) (let ((a0-4 (handle->process (-> self money-list gp-1)))) @@ -205,7 +205,7 @@ (calculate-pos self arg0) (if arg0 (set! (-> self basetrans y) (-> self platform-pos)) - (sound-play-by-name (static-sound-name "open-orb-cash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "open-orb-cash") ) (dotimes (s5-1 (-> self money)) (let ((s4-1 (new 'stack-no-clear 'vector))) @@ -275,7 +275,7 @@ :trans (the-as (function none :behavior orb-cache-top) plat-trans) :code (behavior ((arg0 symbol)) (if (not arg0) - (sound-play-by-name (static-sound-name "close-orb-cash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "close-orb-cash") ) (ja :group! (-> self draw art-group data 3) :num! (identity (ja-aframe 0.0 0))) (new 'stack-no-clear 'vector) diff --git a/goal_src/levels/common/plat-button.gc b/goal_src/levels/common/plat-button.gc index 8aaeb7faba..181875850a 100644 --- a/goal_src/levels/common/plat-button.gc +++ b/goal_src/levels/common/plat-button.gc @@ -216,7 +216,7 @@ (move-to-point! (-> self root-override) gp-0) ) ) - (sound-play-by-name (static-sound-name "elev-loop") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "elev-loop" :id (-> self sound-id)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (-> self sound-id)) @@ -290,7 +290,7 @@ (move-to-point! (-> self root-override) gp-0) ) ) - (sound-play-by-name (static-sound-name "elev-loop") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "elev-loop" :id (-> self sound-id)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (-> self sound-id)) @@ -324,7 +324,7 @@ (process-entity-status! self (entity-perm-status bit-3) #f) ) (sound-stop (-> self sound-id)) - (sound-play-by-name (static-sound-name "elev-land") (new-sound-id) 1024 0 0 1 #t) + (sound-play "elev-land") (loop (if (or (not *target*) (< 268435460.0 (vector-vector-xz-distance-squared (-> self root-override trans) (target-pos 0))) diff --git a/goal_src/levels/common/plat-eco.gc b/goal_src/levels/common/plat-eco.gc index 36c19e47c4..83304de0ef 100644 --- a/goal_src/levels/common/plat-eco.gc +++ b/goal_src/levels/common/plat-eco.gc @@ -96,15 +96,7 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('wake) - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) (go-virtual plat-path-active (the-as plat #f)) ) (('ridden 'edge-grabbed) diff --git a/goal_src/levels/common/plat.gc b/goal_src/levels/common/plat.gc index 72e5191db6..0ee4403c3b 100644 --- a/goal_src/levels/common/plat.gc +++ b/goal_src/levels/common/plat.gc @@ -239,15 +239,7 @@ ) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (none) diff --git a/goal_src/levels/common/rigid-body.gc b/goal_src/levels/common/rigid-body.gc index 7f6cbb5278..14cf8fda6d 100644 --- a/goal_src/levels/common/rigid-body.gc +++ b/goal_src/levels/common/rigid-body.gc @@ -592,7 +592,15 @@ (set! (-> self rbody lin-momentum-damping-factor) (-> self info linear-damping)) (set! (-> self rbody ang-momentum-damping-factor) (-> self info angular-damping)) (if (-> self player-impulse) - (sound-play-by-name (string->sound-name (-> self info sound-name)) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name + (string->sound-name (-> self info sound-name)) + (new-sound-id) + 1024 + 0 + 0 + (sound-group sfx) + #t + ) ) (TODO-RENAME-28 self) (quaternion-copy! (-> self root-overlay quat) (-> self rbody rotation)) diff --git a/goal_src/levels/common/sharkey.gc b/goal_src/levels/common/sharkey.gc index 2b6ced4d9f..7f779eb122 100644 --- a/goal_src/levels/common/sharkey.gc +++ b/goal_src/levels/common/sharkey.gc @@ -362,7 +362,7 @@ nav-enemy-default-event-handler (s5-0 (new 'stack-no-clear 'vector)) ) (-> *display* base-frame-counter) - (sound-play-by-name (static-sound-name "bigshark-bite") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bigshark-bite") (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> gp-0 quad) (-> self collide-info trans quad)) (ja-channel-push! 1 (seconds 0.1)) @@ -488,7 +488,7 @@ nav-enemy-default-event-handler :code (behavior () (set! (-> self player-water-time) (-> *display* base-frame-counter)) (ja-channel-push! 1 (seconds 0.17)) - (sound-play-by-name (static-sound-name "bigshark-idle") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bigshark-idle") (loop (ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim)) :num! (seek! max (-> self anim-speed)) @@ -509,14 +509,11 @@ nav-enemy-default-event-handler (f1-2 (fmax 0.0 (fmin 1.0 (- 1.0 (/ (+ -24576.0 f3-0) (+ -24576.0 (-> self spawn-distance))))))) (f0-2 (+ 0.5 (* 1.5 f1-2))) ) - (sound-play-by-name - (static-sound-name "bigshark-alert") - (-> self sound-id) - 1024 - (the int (* 1524.0 f0-2)) - 0 - 1 - (the-as symbol (-> self collide-info trans)) + (sound-play + "bigshark-alert" + :id (-> self sound-id) + :pitch f0-2 + :position (the-as symbol (-> self collide-info trans)) ) ) (none) diff --git a/goal_src/levels/common/ticky.gc b/goal_src/levels/common/ticky.gc index 5cefae4f81..bd899ac2ce 100644 --- a/goal_src/levels/common/ticky.gc +++ b/goal_src/levels/common/ticky.gc @@ -50,7 +50,7 @@ ) (when (>= (- (-> *display* base-frame-counter) (-> obj last-tick-time)) v1-7) (set! (-> obj last-tick-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "stopwatch") (new-sound-id) 1024 0 0 1 #t) + (sound-play "stopwatch") ) ) ) diff --git a/goal_src/levels/finalboss/final-door.gc b/goal_src/levels/finalboss/final-door.gc index 7e86173ee7..d8c2bd3e70 100644 --- a/goal_src/levels/finalboss/final-door.gc +++ b/goal_src/levels/finalboss/final-door.gc @@ -221,7 +221,7 @@ (defstate jump (powercellalt) :virtual #t :code (behavior () - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (let ((gp-1 (new 'stack 'trajectory))) (set! (-> self base y) (-> self jump-pos y)) (setup-from-to-duration! gp-1 (-> self root-override trans) (-> self jump-pos) 300.0 -2.2755556) @@ -241,7 +241,7 @@ (set! (-> self root-override trans quad) (-> self jump-pos quad)) (set! (-> self base quad) (-> self root-override trans quad)) (transform-post) - (sound-play-by-name (static-sound-name "land-pcmetal") (new-sound-id) 1024 3048 0 1 #t) + (sound-play "land-pcmetal" :pitch 2) (process-spawn part-tracker :init part-tracker-init diff --git a/goal_src/levels/finalboss/green-eco-lurker.gc b/goal_src/levels/finalboss/green-eco-lurker.gc index 13178ee3c6..1ac98d11c0 100644 --- a/goal_src/levels/finalboss/green-eco-lurker.gc +++ b/goal_src/levels/finalboss/green-eco-lurker.gc @@ -505,15 +505,7 @@ (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self sound-delay)) ) (set! (-> self played-sound?) #t) - (sound-play-by-name - (static-sound-name "blob-jump") - (new-sound-id) - 1024 - (the int (* 1524.0 (nav-enemy-rnd-float-range -0.5 0.5))) - 0 - 1 - #t - ) + (sound-play "blob-jump" :pitch (nav-enemy-rnd-float-range -0.5 0.5)) ) (dummy-53 self) 0 @@ -521,15 +513,7 @@ ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) - (sound-play-by-name - (static-sound-name "blob-out") - (new-sound-id) - 1024 - (the int (* 1524.0 (nav-enemy-rnd-float-range -1.0 1.0))) - 0 - 1 - #t - ) + (sound-play "blob-out" :pitch (nav-enemy-rnd-float-range -1.0 1.0)) (cond ((zero? (nav-enemy-rnd-int-count 2)) (ja-no-eval :group! green-eco-lurker-jump-with-flip-ja :num! (seek!) :frame-num 0.0) @@ -562,15 +546,7 @@ ) :code (behavior () (activate! *camera-smush-control* 409.6 37 150 1.0 0.99) - (sound-play-by-name - (static-sound-name "blob-land") - (new-sound-id) - 1024 - (the int (* 1524.0 (nav-enemy-rnd-float-range -1.0 1.0))) - 0 - 1 - #t - ) + (sound-play "blob-land" :pitch (nav-enemy-rnd-float-range -1.0 1.0)) (let ((v1-4 (-> self draw shadow-ctrl))) (let ((a0-4 v1-4)) (set! (-> a0-4 settings bot-plane w) (- -7168.0)) @@ -678,7 +654,7 @@ (-> self collide-info trans) :to *entity-pool* ) - (sound-play-by-name (static-sound-name "blob-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "blob-explode") (activate! *camera-smush-control* 409.6 37 150 1.0 0.99) (let ((v1-14 (-> self draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) diff --git a/goal_src/levels/finalboss/robotboss-weapon.gc b/goal_src/levels/finalboss/robotboss-weapon.gc index 24e97ff078..302f44df2c 100644 --- a/goal_src/levels/finalboss/robotboss-weapon.gc +++ b/goal_src/levels/finalboss/robotboss-weapon.gc @@ -254,7 +254,7 @@ (defstate darkecobomb-explode (darkecobomb) :code (behavior ((arg0 symbol)) (send-event *target* 'reset-pickup 'eco) - (sound-play-by-name (static-sound-name "explod-bomb") (new-sound-id) 1024 0 0 1 #f) + (sound-play "explod-bomb" :position #f) (activate! *camera-smush-control* 819.2 37 600 1.0 0.995) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (process-spawn @@ -351,7 +351,7 @@ :to *entity-pool* ) (set! (-> self next-tick) (+ -0.06 (-> self next-tick))) - (sound-play-by-name (static-sound-name "robo-warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "robo-warning") ) ) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (the int (-> self countdown-time))) @@ -366,7 +366,7 @@ (none) ) :code (behavior () - (sound-play-by-name (static-sound-name "bomb-open") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bomb-open") (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -634,7 +634,7 @@ (defstate redshot-explode (redshot) :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (sound-play-by-name (static-sound-name "red-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "red-explode") (logclear! (-> self draw status) (draw-status hidden)) (quaternion-identity! (-> self root-override quat)) (set! (-> self ring radius-secondary) 3072.0) diff --git a/goal_src/levels/finalboss/robotboss.gc b/goal_src/levels/finalboss/robotboss.gc index 43be9621f2..0cf1dc34c5 100644 --- a/goal_src/levels/finalboss/robotboss.gc +++ b/goal_src/levels/finalboss/robotboss.gc @@ -889,7 +889,7 @@ :to *entity-pool* ) ) - (sound-play-by-name (static-sound-name "bfg-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bfg-fire") (none) ) @@ -1465,7 +1465,7 @@ gp-0 :to *entity-pool* ) - (sound-play-by-name (static-sound-name "red-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "red-fire") ) ) ) @@ -1920,7 +1920,7 @@ gp-0 :to *entity-pool* ) - (sound-play-by-name (static-sound-name "green-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "green-fire") ) ) (none) @@ -2339,7 +2339,12 @@ (spawn (-> self particle 0) s4-0) (when (and arg1 (nonzero? (-> self looping-sound 0))) (update! (-> self looping-sound 0)) - (when (and *target* (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying)))) + (when (and *target* + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + ) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result)) (a2-0 (new 'stack-no-clear 'vector)) ) @@ -2374,7 +2379,10 @@ (when (and arg1 (nonzero? (-> self looping-sound 1))) (update! (-> self looping-sound 1)) (if (and *target* - (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (>= 8192.0 (vector-vector-distance gp-0 (target-pos 0))) ) (send-event *target* 'attack #f (static-attack-info ((shove-up (meters 2.5)) (shove-back (meters 7.5))))) @@ -2571,7 +2579,7 @@ (+! (-> self hits-to-go) -1) (ja-channel-push! 1 (seconds 0.1)) (ja :group! robotboss-blue-last-hit-ja) - (sound-play-by-name (static-sound-name "explod-eye") (new-sound-id) 1024 0 0 1 #t) + (sound-play "explod-eye") (set! (-> self blue-smoke) #t) (let ((gp-1 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-1 (-> self node-list data 7)) diff --git a/goal_src/levels/finalboss/sage-finalboss.gc b/goal_src/levels/finalboss/sage-finalboss.gc index df3f4745af..126723dffe 100644 --- a/goal_src/levels/finalboss/sage-finalboss.gc +++ b/goal_src/levels/finalboss/sage-finalboss.gc @@ -149,15 +149,7 @@ (seek! (-> self path-pos) (-> self dest) (* (-> self speed) (-> *display* seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (when (send-event *target* 'query 'powerup (pickup-type eco-yellow)) diff --git a/goal_src/levels/firecanyon/firecanyon-obs.gc b/goal_src/levels/firecanyon/firecanyon-obs.gc index 47a17cd0ea..9522773c22 100644 --- a/goal_src/levels/firecanyon/firecanyon-obs.gc +++ b/goal_src/levels/firecanyon/firecanyon-obs.gc @@ -104,7 +104,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "cool-balloon") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cool-balloon") (process-spawn part-tracker :init part-tracker-init @@ -292,7 +292,7 @@ (= (send-event *target* 'query 'mode) 'racer) (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 225280.0) ) - (sound-play-by-name (static-sound-name "magma-rock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "magma-rock") (let ((v1-8 (entity-actor-count (-> self entity) 'alt-actor))) 0 (cond @@ -591,7 +591,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (process-spawn part-tracker :init part-tracker-init diff --git a/goal_src/levels/flut_common/target-flut.gc b/goal_src/levels/flut_common/target-flut.gc index 1f16d7b04f..06c1df9e36 100644 --- a/goal_src/levels/flut_common/target-flut.gc +++ b/goal_src/levels/flut_common/target-flut.gc @@ -732,7 +732,6 @@ (let* ((f0-16 (current-cycle-distance (-> self skel))) (f0-18 (/ (* 58.0 (-> self control unknown-float01)) (* 60.0 f0-16))) ) - (format *stdcon* "~% val: ~f~%" f0-16) (if (= (-> self control surf name) '*tar-surface*) (set! f0-18 (* 0.4 (-> self control unknown-float12))) ) @@ -792,7 +791,7 @@ ) :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 -762 0 1 #t) + (sound-play "jump" :pitch -0.5) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flut-jump-mods*) @@ -835,7 +834,8 @@ (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) (zero? (logand (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) @@ -948,7 +948,8 @@ (pad-buttons square) ) (and (zero? (logand (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08))) + (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) @@ -961,7 +962,7 @@ (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) ) (if (ja-group? (-> self draw art-group data 149)) - (sound-play-by-name (static-sound-name "flut-flap") (-> self flut flap-sound-id) 1024 0 0 1 #t) + (sound-play "flut-flap" :id (-> self flut flap-sound-id)) ) (seek! (-> self control unknown-float122) @@ -1312,7 +1313,7 @@ ) :code (behavior () (ja-channel-push! 1 (seconds 0.02)) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "flut-hit") (ja :group! (-> self draw art-group data 150) :num! min) (set! (-> self control dynam gravity-max) 368640.0) (set! (-> self control dynam gravity-length) 368640.0) @@ -1515,7 +1516,7 @@ (none) ) :code (behavior ((arg0 float)) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 -762 0 1 #t) + (sound-play "flut-hit" :pitch -0.5) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! (-> self draw art-group data 152) :num! (seek! (ja-aframe (the-as float 8.0) 0)) @@ -1566,7 +1567,7 @@ (set! (-> self control unknown-dword31) 0) (set! (-> self control unknown-dword33) 0) (set! (-> self control unknown-surface00) *flut-air-attack-mods*) - (sound-play-by-name (static-sound-name "flop-land") (new-sound-id) 1024 -609 0 1 #t) + (sound-play "flop-land" :pitch -0.4) (dummy-10 (-> self skel effect) 'group-flut-attack-strike-ground (ja-frame-num 0) 0) (let ((gp-2 (process-spawn touch-tracker :init touch-tracker-init (-> self control trans) 4096.0 30 :to self))) (send-event (ppointer->process gp-2) 'event 'attack 'flut-attack) @@ -1739,7 +1740,7 @@ ) ) (target-hit-effect gp-0) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 -1524 0 1 #t) + (sound-play "flut-hit" :pitch -1) ) (set! (-> self control unknown-surface00) *smack-mods*) (let ((f30-0 1.0)) @@ -1749,8 +1750,8 @@ (ja-channel-set! 1) (ja :group! (-> self draw art-group data 158) :num! min) ) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 1524 0 1 #t) + (sound-play "smack-surface") + (sound-play "flut-hit" :pitch 1) ) (else (when (not (ja-group? (-> self draw art-group data 157))) @@ -1794,8 +1795,8 @@ ((or (= arg0 'none) (= arg0 'water-vol) (= arg0 'sharkey)) ) ((= arg0 'endlessfall) - (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 716 -2133 0 1 #t) + (sound-play "death-fall") + (sound-play "flut-hit" :vol 70 :pitch -1.4) (camera-change-to (the-as string cam-endlessfall) 30 #f) (set! (-> self control pat-ignore-mask unknown-bit) 1) (logclear! (-> self water flags) (water-flags wt04)) @@ -1914,7 +1915,7 @@ ) ) (let ((gp-1 #f)) - (sound-play-by-name (static-sound-name "uppercut") (new-sound-id) 1024 0 0 1 #t) + (sound-play "uppercut") (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! (-> self draw art-group data 155) :num! (seek! (ja-aframe (the-as float 24.0) 0)) @@ -1930,7 +1931,7 @@ (ja :num! (seek! (ja-aframe (the-as float 24.0) 0))) ) ) - (sound-play-by-name (static-sound-name "flut-coo") (new-sound-id) 1024 0 0 1 #t) + (sound-play "flut-coo") (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self control transv quad) (the-as uint128 0)) (quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00)) @@ -2026,7 +2027,7 @@ (set! (-> self control unknown-vector102 quad) (-> gp-0 quad)) (set! (-> self control unknown-vector103 quad) (-> s4-0 quad)) ) - (sound-play-by-name (static-sound-name "flut-coo") (new-sound-id) 921 -762 0 1 #t) + (sound-play "flut-coo" :vol 90 :pitch -0.5) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! (-> self draw art-group data 156) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/levels/jungle/bouncer.gc b/goal_src/levels/jungle/bouncer.gc index 1570c35ecf..bd7fd3f481 100644 --- a/goal_src/levels/jungle/bouncer.gc +++ b/goal_src/levels/jungle/bouncer.gc @@ -39,7 +39,7 @@ (case arg2 (('bonk) (when (send-event arg0 'jump (-> self spring-height) (-> self spring-height) #f) - (sound-play-by-name (static-sound-name "trampoline") (new-sound-id) 1024 0 0 1 #t) + (sound-play "trampoline") (go bouncer-fire) ) ) diff --git a/goal_src/levels/jungle/fisher.gc b/goal_src/levels/jungle/fisher.gc index ac91195722..1152b52076 100644 --- a/goal_src/levels/jungle/fisher.gc +++ b/goal_src/levels/jungle/fisher.gc @@ -922,7 +922,7 @@ :code (behavior () (case (-> self mode) (('deadly 'bad) - (sound-play-by-name (static-sound-name "caught-eel") (new-sound-id) 1024 0 0 1 #t) + (sound-play "caught-eel") (ambient-hint-spawn "sksp0a42" (-> self root trans) *entity-pool* 'ambient) (send-event (ppointer->process (-> self parent)) 'deadly) ) @@ -938,7 +938,7 @@ (-> self root trans) :to *entity-pool* ) - (sound-play-by-name (static-sound-name "get-big-fish") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-big-fish") (send-event (ppointer->process (-> self parent)) 'fisher-fish-caught 5) ) (else @@ -953,7 +953,7 @@ (-> self root trans) :to *entity-pool* ) - (sound-play-by-name (static-sound-name "get-small-fish") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-small-fish") (send-event (ppointer->process (-> self parent)) 'fisher-fish-caught 1) ) ) @@ -1496,7 +1496,7 @@ ) (set! (-> self spawner-last) (-> self spawner)) (set! (-> self spawn-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "fish-spawn") (new-sound-id) 716 0 0 1 #t) + (sound-play "fish-spawn" :vol 70) (fisher-spawn-ambient) (process-spawn fisher-fish gp-0 (-> self spawner) (* 1.85 (-> self params fish-vel)) :to self) ) @@ -1523,7 +1523,7 @@ (local-vars (v0-2 object)) (case arg2 (('fisher-fish-die) - (sound-play-by-name (static-sound-name "fish-miss") (new-sound-id) 1024 0 0 1 #t) + (sound-play "fish-miss") (set! v0-2 (+ (-> self missed) (-> arg3 param 0))) (set! (-> self missed) (the-as int v0-2)) v0-2 diff --git a/goal_src/levels/jungle/jungle-mirrors.gc b/goal_src/levels/jungle/jungle-mirrors.gc index 4bd6eb95c3..61c740d3d5 100644 --- a/goal_src/levels/jungle/jungle-mirrors.gc +++ b/goal_src/levels/jungle/jungle-mirrors.gc @@ -687,7 +687,10 @@ (set! sv-32 0) (set! sv-48 1) (let ((t2-0 (target-pos 0))) - (the-as int (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-32 sv-48 (the-as symbol t2-0))) + (the-as + int + (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-32 (the-as sound-group sv-48) (the-as symbol t2-0)) + ) ) ) ) @@ -797,15 +800,7 @@ ) (when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (sound-stop (-> self sound-id)) - (sound-play-by-name - (static-sound-name "beam-connect") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (target-pos 0)) - ) + (sound-play "beam-connect" :position (the-as symbol (target-pos 0))) ) (process-entity-status! self (entity-perm-status complete) #t) (set! gp-0 #t) @@ -1211,15 +1206,7 @@ (defstate periscope-activate (periscope) :exit (behavior () (sound-stop (-> self rise-sound-id)) - (sound-play-by-name - (static-sound-name "eco-tower-stop") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self base)) - ) + (sound-play "eco-tower-stop" :position (the-as symbol (-> self base))) (none) ) :trans periscope-debug-trans @@ -1235,15 +1222,7 @@ (set! (-> self turn) (+ 18204.445 (-> self target-turn))) ) (until (and v1-13 (= (-> self turn) (-> self target-turn)) (= (-> self tilt) (-> self target-tilt))) - (sound-play-by-name - (static-sound-name "eco-tower-rise") - (-> self rise-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self base)) - ) + (sound-play "eco-tower-rise" :id (-> self rise-sound-id) :position (the-as symbol (-> self base))) (seek! (-> self y-offset) (-> self height) (* 16384.0 (-> *display* seconds-per-frame))) (seek! (-> self turn) (-> self target-turn) (* 7281.778 (-> *display* seconds-per-frame))) (seek! (-> self tilt) (-> self target-tilt) (* 7281.778 (-> *display* seconds-per-frame))) @@ -1336,15 +1315,7 @@ (if (nonzero? gp-0) (level-hint-spawn (game-text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) ) - (sound-play-by-name - (static-sound-name "site-moves") - (-> self grips-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self grips transform)) - ) + (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) (periscope-update-joints) (suspend) @@ -1423,15 +1394,7 @@ ) :post (behavior () (if (-> self grips-moving?) - (sound-play-by-name - (static-sound-name "site-moves") - (-> self grips-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self grips transform)) - ) + (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) (sound-stop (-> self grips-sound-id)) ) (periscope-draw-beam-impact) @@ -1675,15 +1638,7 @@ (until (= (-> self y-offset-grips) f30-0) (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) (periscope-update-joints) - (sound-play-by-name - (static-sound-name "site-moves") - (-> self grips-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self grips transform)) - ) + (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) (suspend) ) ) @@ -1856,7 +1811,7 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) - (sound-play-by-name (static-sound-name "mirror-smash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "mirror-smash") (go reflector-mirror-broken #f) ) ) diff --git a/goal_src/levels/jungle/jungle-obs.gc b/goal_src/levels/jungle/jungle-obs.gc index acfbfc6054..e84d2d17f9 100644 --- a/goal_src/levels/jungle/jungle-obs.gc +++ b/goal_src/levels/jungle/jungle-obs.gc @@ -689,15 +689,7 @@ :trans (the-as (function none :behavior precurbridge) rider-trans) :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) (if (rand-vu-percent? 0.1) @@ -990,15 +982,7 @@ (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) (go maindoor-open #f) ) (if (and *target* diff --git a/goal_src/levels/jungle/junglesnake.gc b/goal_src/levels/jungle/junglesnake.gc index b52b19fb59..c370b143bd 100644 --- a/goal_src/levels/jungle/junglesnake.gc +++ b/goal_src/levels/jungle/junglesnake.gc @@ -117,7 +117,10 @@ ) (cond ((and (-> self is-lethal?) - (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) ) (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) (let ((v0-1 (the-as object #t))) @@ -401,7 +404,10 @@ junglesnake-default-event-handler :trans (behavior () (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self refractory-delay)) - (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) ) (go junglesnake-attack) ) diff --git a/goal_src/levels/jungleb/aphid.gc b/goal_src/levels/jungleb/aphid.gc index 245bea1f7f..d4e1743684 100644 --- a/goal_src/levels/jungleb/aphid.gc +++ b/goal_src/levels/jungleb/aphid.gc @@ -74,7 +74,7 @@ ) (loop (ja-channel-push! 1 (seconds 0.05)) - (sound-play-by-name (static-sound-name "aphid-spike-out") (new-sound-id) 1024 0 0 1 #t) + (sound-play "aphid-spike-out") (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -95,7 +95,7 @@ ) (aphid-vulnerable) (ja-channel-push! 1 (seconds 0.05)) - (sound-play-by-name (static-sound-name "aphid-spike-in") (new-sound-id) 1024 0 0 1 #t) + (sound-play "aphid-spike-in") (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) diff --git a/goal_src/levels/jungleb/jungleb-obs.gc b/goal_src/levels/jungleb/jungleb-obs.gc index da1724220b..b881f67ba8 100644 --- a/goal_src/levels/jungleb/jungleb-obs.gc +++ b/goal_src/levels/jungleb/jungleb-obs.gc @@ -210,7 +210,7 @@ (go eggtop-close #f) ) (spawn (-> self part) (-> self root-override trans)) - (sound-play-by-name (static-sound-name "electric-loop") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "electric-loop" :id (-> self sound-id)) (none) ) :code (behavior () @@ -230,7 +230,7 @@ ) :code (behavior ((arg0 symbol)) (when (not arg0) - (sound-play-by-name (static-sound-name "vent-switch") (new-sound-id) 2048 0 0 1 #t) + (sound-play "vent-switch" :vol 200) (process-spawn part-tracker :init part-tracker-init @@ -285,7 +285,7 @@ ) ) (save-reminder (get-task-control (-> self entity extra perm task)) 2 0) - (sound-play-by-name (static-sound-name "jngb-eggtop-seq") (new-sound-id) 1024 0 0 1 #t) + (sound-play "jngb-eggtop-seq") (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/goal_src/levels/jungleb/plant-boss.gc b/goal_src/levels/jungleb/plant-boss.gc index d49c525fcb..7727e9b13c 100644 --- a/goal_src/levels/jungleb/plant-boss.gc +++ b/goal_src/levels/jungleb/plant-boss.gc @@ -730,7 +730,7 @@ (suspend) (ja :num! (seek! (ja-aframe (the-as float 30.0) 0))) ) - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plant-leaf") (ja-no-eval :group! plant-boss-leaf-grow-right-ja :num! (seek!) :frame-num (ja-aframe (the-as float 30.0) 0)) (until (ja-done? 0) (suspend) @@ -747,7 +747,7 @@ (suspend) (ja :num! (seek! (ja-aframe (the-as float 30.0) 0))) ) - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plant-leaf") (ja-no-eval :group! plant-boss-leaf-grow-left-ja :num! (seek!) :frame-num (ja-aframe (the-as float 30.0) 0)) (until (ja-done? 0) (suspend) @@ -863,7 +863,7 @@ :code (behavior () (case (-> self side) ((1) - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plant-leaf") (ja-no-eval :group! plant-boss-leaf-grow-right-ja :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) @@ -871,7 +871,7 @@ ) ) (else - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plant-leaf") (ja-no-eval :group! plant-boss-leaf-grow-left-ja :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) @@ -1092,7 +1092,10 @@ ) ) *target* - (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) ) (go plant-boss-attack 1) ) diff --git a/goal_src/levels/jungleb/plat-flip.gc b/goal_src/levels/jungleb/plat-flip.gc index 4367e7038a..30339dd17f 100644 --- a/goal_src/levels/jungleb/plat-flip.gc +++ b/goal_src/levels/jungleb/plat-flip.gc @@ -65,7 +65,7 @@ ((begin (set! f30-0 (- f0-1 (-> self before-turn-down-time))) (< f30-0 (-> self turn-down-time))) (when (not gp-0) (set! gp-0 #t) - (sound-play-by-name (static-sound-name "plat-flip") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-flip") ) (ja :group! plat-flip-turn-down-ja :num! (identity (/ (* f30-0 (the float (+ (-> (the-as art-joint-anim plat-flip-turn-down-ja) data 0 length) -1))) @@ -81,7 +81,7 @@ (else (when (not gp-0) (set! gp-0 #t) - (sound-play-by-name (static-sound-name "plat-flip") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-flip") ) (let ((f30-2 (- f30-1 (-> self before-turn-up-time)))) (ja :group! plat-flip-turn-up-ja diff --git a/goal_src/levels/lavatube/lavatube-energy.gc b/goal_src/levels/lavatube/lavatube-energy.gc index e545ed66eb..e33154d55c 100644 --- a/goal_src/levels/lavatube/lavatube-energy.gc +++ b/goal_src/levels/lavatube/lavatube-energy.gc @@ -778,7 +778,7 @@ (the-as object (when (= v1-0 'attack) (when (and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) (increment-success-for-hint (game-text-id lavatube-shoot-the-spheres)) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (process-spawn part-tracker :init part-tracker-init diff --git a/goal_src/levels/lavatube/lavatube-obs.gc b/goal_src/levels/lavatube/lavatube-obs.gc index 75054f8b21..bf0292b7f5 100644 --- a/goal_src/levels/lavatube/lavatube-obs.gc +++ b/goal_src/levels/lavatube/lavatube-obs.gc @@ -500,7 +500,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root-override trans quad)) (set! (-> gp-1 y) (+ -49152.0 (-> gp-1 y))) @@ -1021,7 +1021,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root-override trans quad)) (set! (-> gp-1 y) (+ -73728.0 (-> gp-1 y))) @@ -1197,7 +1197,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "cool-balloon") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cool-balloon") (process-spawn part-tracker :init part-tracker-init diff --git a/goal_src/levels/maincave/dark-crystal.gc b/goal_src/levels/maincave/dark-crystal.gc index 48b3d484b7..d808097621 100644 --- a/goal_src/levels/maincave/dark-crystal.gc +++ b/goal_src/levels/maincave/dark-crystal.gc @@ -453,7 +453,7 @@ :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (dotimes (gp-0 (-> *dark-crystal-flash-delays* length)) - (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warning") (set! (-> self draw color-mult quad) (-> self lit-color-mult quad)) (set! (-> self draw color-emissive quad) (-> self lit-color-emissive quad)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -497,8 +497,8 @@ (logior! (-> self draw status) (draw-status hidden)) (dummy-20 self) (if (-> self underwater?) - (sound-play-by-name (static-sound-name "water-explosion") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "crystal-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-explosion") + (sound-play "crystal-explode") ) (process-spawn part-tracker @@ -582,7 +582,16 @@ (when (>= (-> obj explode-danger-radius) (vector-vector-distance s5-0 s3-0)) (vector-! s4-0 s3-0 s5-0) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result))) - (if (< (fill-and-probe-using-line-sphere *collide-cache* s5-0 s4-0 819.2 (collide-kind background) obj t2-0 (new 'static 'pat-surface :noentity #x1)) + (if (< (fill-and-probe-using-line-sphere + *collide-cache* + s5-0 + s4-0 + 819.2 + (collide-kind background) + obj + t2-0 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (send-event *target* 'attack #f (new 'static 'attack-info)) diff --git a/goal_src/levels/maincave/driller-lurker.gc b/goal_src/levels/maincave/driller-lurker.gc index 5f3cbfeb45..1586176396 100644 --- a/goal_src/levels/maincave/driller-lurker.gc +++ b/goal_src/levels/maincave/driller-lurker.gc @@ -505,7 +505,10 @@ ) (when (and (-> obj hit-player?) (or (not *target*) - (and (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (>= (- (-> *display* base-frame-counter) (-> obj hit-player-time)) (seconds 0.05)) ) ) diff --git a/goal_src/levels/maincave/gnawer.gc b/goal_src/levels/maincave/gnawer.gc index 564708ea7c..b67100ae88 100644 --- a/goal_src/levels/maincave/gnawer.gc +++ b/goal_src/levels/maincave/gnawer.gc @@ -843,7 +843,7 @@ (go gnawer-retreat-into-post) ) (('attack) - (sound-play-by-name (static-sound-name "gnawer-dies") (new-sound-id) 1024 -381 0 1 #t) + (sound-play "gnawer-dies" :pitch -0.25) (go gnawer-retreat-into-post) ) ) @@ -1254,7 +1254,7 @@ ) ) 0 - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (until (not (-> self child)) (suspend) ) diff --git a/goal_src/levels/maincave/maincave-obs.gc b/goal_src/levels/maincave/maincave-obs.gc index 8865a5d7b9..56aa06a64c 100644 --- a/goal_src/levels/maincave/maincave-obs.gc +++ b/goal_src/levels/maincave/maincave-obs.gc @@ -502,7 +502,7 @@ ) (when (-> self should-play-sound?) (set! (-> self should-play-sound?) #f) - (sound-play-by-name (static-sound-name "hot-flame") (new-sound-id) 1024 0 0 1 #t) + (sound-play "hot-flame") ) (cond ((< gp-0 30) diff --git a/goal_src/levels/maincave/maincave-part.gc b/goal_src/levels/maincave/maincave-part.gc index eb284307c6..696762375c 100644 --- a/goal_src/levels/maincave/maincave-part.gc +++ b/goal_src/levels/maincave/maincave-part.gc @@ -290,7 +290,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/goal_src/levels/maincave/mother-spider-egg.gc b/goal_src/levels/maincave/mother-spider-egg.gc index 2be3e2892a..ce08d7cd56 100644 --- a/goal_src/levels/maincave/mother-spider-egg.gc +++ b/goal_src/levels/maincave/mother-spider-egg.gc @@ -180,7 +180,16 @@ (set! (-> a1-1 y) (+ 1228.8 (-> a1-1 y))) (set-vector! a2-1 0.0 -61440.0 0.0 1.0) (cond - ((>= (fill-and-probe-using-line-sphere *collide-cache* a1-1 a2-1 7372.8 (collide-kind background) obj s5-0 (new 'static 'pat-surface :noentity #x1)) + ((>= (fill-and-probe-using-line-sphere + *collide-cache* + a1-1 + a2-1 + 7372.8 + (collide-kind background) + obj + s5-0 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (let ((v1-11 (-> obj draw shadow-ctrl))) @@ -240,7 +249,7 @@ ) ) (when (= f30-0 (-> self traj time)) - (sound-play-by-name (static-sound-name "eggs-lands") (new-sound-id) 1024 0 0 1 #t) + (sound-play "eggs-lands") (go mother-spider-egg-on-ground) ) ) diff --git a/goal_src/levels/maincave/mother-spider-proj.gc b/goal_src/levels/maincave/mother-spider-proj.gc index e3712bb15e..5c98189ae4 100644 --- a/goal_src/levels/maincave/mother-spider-proj.gc +++ b/goal_src/levels/maincave/mother-spider-proj.gc @@ -332,13 +332,18 @@ (set! (-> obj target quad) (-> (target-pos 0) quad)) (set! (-> obj target y) (+ 4915.2 (-> obj target y))) (set! (-> obj target-base quad) (-> obj target quad)) - (set! (-> obj sound-id) (sound-play-by-name (static-sound-name "mother-track") (new-sound-id) 1024 0 0 1 #t)) - (sound-play-by-name (static-sound-name "mother-fire") (new-sound-id) 1024 0 0 1 #t) + (set! (-> obj sound-id) (sound-play "mother-track")) + (sound-play "mother-fire") (none) ) (defmethod dummy-28 mother-spider-proj ((obj mother-spider-proj)) - (when (and *target* (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying)))) + (when (and *target* + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + ) (let ((gp-0 (-> obj target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (set! (-> gp-0 y) (+ 4915.2 (-> gp-0 y))) @@ -376,7 +381,7 @@ (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "mother-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "mother-hit") (suspend) (go-virtual projectile-die) (none) diff --git a/goal_src/levels/maincave/mother-spider.gc b/goal_src/levels/maincave/mother-spider.gc index c5561a14b8..e765dc6aa8 100644 --- a/goal_src/levels/maincave/mother-spider.gc +++ b/goal_src/levels/maincave/mother-spider.gc @@ -401,7 +401,16 @@ (set-vector! a2-0 0.0 -81920.0 0.0 1.0) (set! (-> a1-0 y) (+ -8192.0 (-> a1-0 y))) (cond - ((>= (fill-and-probe-using-line-sphere *collide-cache* a1-0 a2-0 8192.0 (collide-kind background) obj s5-0 (new 'static 'pat-surface :noentity #x1)) + ((>= (fill-and-probe-using-line-sphere + *collide-cache* + a1-0 + a2-0 + 8192.0 + (collide-kind background) + obj + s5-0 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (let ((v1-11 (-> obj draw shadow-ctrl))) @@ -1017,7 +1026,9 @@ ) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (-> self node-list data 6)) - (if (or (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying)) + (if (or (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (< (vector-vector-distance gp-0 (camera-pos)) 8192.0) ) (go mother-spider-traveling (the-as uint 2)) @@ -1225,14 +1236,20 @@ (go mother-spider-traveling (the-as uint 0)) ) (if (and (>= (- (-> *display* base-frame-counter) (-> self started-birthing-time)) (seconds 6)) - (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) ) (go mother-spider-traveling (the-as uint 1)) ) (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) (> (-> self birthing-counter) 0) (and (>= 49152.0 (- (-> self max-dist-from-anchor) (-> self dist-from-anchor))) - (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (TODO-RENAME-21 (-> self nav) (-> self root-override trans)) ) ) @@ -1300,7 +1317,7 @@ (process-spawn mother-spider-egg (-> self entity) (-> self root-override trans) s5-0 s4-0 :to self) (+! (-> self baby-count) 1) (+! (-> self birthing-counter) -1) - (sound-play-by-name (static-sound-name "lay-eggs") (new-sound-id) 1024 0 0 1 #t) + (sound-play "lay-eggs") ) ) ) diff --git a/goal_src/levels/maincave/spiderwebs.gc b/goal_src/levels/maincave/spiderwebs.gc index df94bf6cb4..322c9bcd13 100644 --- a/goal_src/levels/maincave/spiderwebs.gc +++ b/goal_src/levels/maincave/spiderwebs.gc @@ -107,7 +107,7 @@ (defstate spiderwebs-bounce (spiderwebs) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (sound-play-by-name (static-sound-name "web-tramp") (new-sound-id) 1024 0 0 1 #t) + (sound-play "web-tramp") (ja-no-eval :group! spiderwebs-bounce-ja :num! (seek! (ja-aframe 10.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/goal_src/levels/misty/balloonlurker.gc b/goal_src/levels/misty/balloonlurker.gc index b1b4780084..b999d27a8a 100644 --- a/goal_src/levels/misty/balloonlurker.gc +++ b/goal_src/levels/misty/balloonlurker.gc @@ -579,25 +579,15 @@ (f1-2 100.0) (f0-3 (* 3.0 f0-2)) ) - (sound-play-by-name - (static-sound-name "propeller") - (-> self engine-sound-id) - (the int (* 10.24 f1-2)) - (the int (* 1524.0 f0-3)) - 0 - 1 - (the-as symbol (-> self node-list data 4 bone transform vector 3)) + (sound-play + "propeller" + :id (-> self engine-sound-id) + :vol f1-2 + :pitch f0-3 + :position (the-as symbol (-> self node-list data 4 bone transform vector 3)) ) ) - (sound-play-by-name - (static-sound-name "pedals") - (-> self pedal-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-overlay trans)) - ) + (sound-play "pedals" :id (-> self pedal-sound-id) :position (the-as symbol (-> self root-overlay trans))) ) ) (else @@ -735,7 +725,7 @@ (-> self explosion-force-position) :to *entity-pool* ) - (sound-play-by-name (static-sound-name "explosion") (new-sound-id) 1024 0 0 1 #t) + (sound-play "explosion") (set! (-> self explosion) #t) (vector-! (-> self explosion-force) (-> self rbody position) (-> self explosion-force-position)) (set! (-> self explosion-force y) (* 2.0 (-> self explosion-force y))) diff --git a/goal_src/levels/misty/misty-conveyor.gc b/goal_src/levels/misty/misty-conveyor.gc index 0ffa93b57c..677f269b2e 100644 --- a/goal_src/levels/misty/misty-conveyor.gc +++ b/goal_src/levels/misty/misty-conveyor.gc @@ -138,7 +138,7 @@ (let ((v1-0 arg2)) (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - (sound-play-by-name (static-sound-name "icrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "icrate-break") (process-spawn part-tracker :init part-tracker-init @@ -164,15 +164,7 @@ ) (else (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 163840.0) - (sound-play-by-name - (static-sound-name "barrel-roll") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "barrel-roll" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) ) ) @@ -321,7 +313,7 @@ (set! sv-48 0.0) (activate! (-> self smush) -0.15 90 150 1.0 1.0) (set! sv-64 f24-0) - (sound-play-by-name (static-sound-name "barrel-bounce") (new-sound-id) 819 0 0 1 #t) + (sound-play "barrel-bounce" :vol 80) (process-spawn part-tracker :init part-tracker-init diff --git a/goal_src/levels/misty/misty-obs.gc b/goal_src/levels/misty/misty-obs.gc index c0b9f93fad..056470a7c0 100644 --- a/goal_src/levels/misty/misty-obs.gc +++ b/goal_src/levels/misty/misty-obs.gc @@ -1393,7 +1393,7 @@ (defstate breakaway-about-to-fall (breakaway) :code (behavior () - (sound-play-by-name (static-sound-name "falling-bones") (new-sound-id) 1024 0 0 1 #t) + (sound-play "falling-bones") (sp-launch-particles-var *sp-particle-system-2d* (-> *part-id-table* 281) diff --git a/goal_src/levels/misty/misty-warehouse.gc b/goal_src/levels/misty/misty-warehouse.gc index c658527d22..55f0608b01 100644 --- a/goal_src/levels/misty/misty-warehouse.gc +++ b/goal_src/levels/misty/misty-warehouse.gc @@ -98,7 +98,7 @@ (suspend) ) ) - (sound-play-by-name (static-sound-name "arena-steps") (new-sound-id) 1024 0 0 1 #t) + (sound-play "arena-steps") (send-to-all-after (-> self link) 'trigger-rise) (go silostep-rise #f) (none) diff --git a/goal_src/levels/misty/mistycannon.gc b/goal_src/levels/misty/mistycannon.gc index cfca405f56..6bd6a94900 100644 --- a/goal_src/levels/misty/mistycannon.gc +++ b/goal_src/levels/misty/mistycannon.gc @@ -686,14 +686,11 @@ (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* 300.0 (-> self muzzle-time)))) (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) (suspend) - (let ((f0-1 - (fmin - 1.0 - (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) - (the float (the int (* 300.0 (-> self muzzle-time)))) - ) - ) - ) + (let ((f0-1 (fmin 1.0 (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) + (the float (the int (* 300.0 (-> self muzzle-time)))) + ) + ) + ) ) (set! (-> self root-override scale x) (* 0.6 f0-1)) (set! (-> self root-override scale y) (* 0.6 f0-1)) @@ -712,18 +709,7 @@ ) ) (set! (-> self sfx) - (the-as - uint - (sound-play-by-name - (static-sound-name "sack-incoming") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) - ) + (the-as uint (sound-play "sack-incoming" :position (the-as symbol (-> self root-override trans)))) ) ) (when (nonzero? (-> self sfx)) @@ -756,15 +742,7 @@ 0 ) (set! (-> self ground-time) (-> *display* base-frame-counter)) - (sound-play-by-name - (static-sound-name "sack-land") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) (ja-no-eval :group! sack-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1135,7 +1113,7 @@ (vector+! (-> obj hellmouth) (-> obj hellmouth) s3-0) (spawn-mistycannon-missile obj s3-0 s2-0 f30-0 arg1 f28-0 arg2 (-> obj entity)) ) - (sound-play-by-name (static-sound-name "cannon-shot") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cannon-shot") (set! (-> obj part local-clock) 0) (set! (-> obj part-timer) (-> *display* base-frame-counter)) (mistycannon-pick-random-target-point) @@ -1614,7 +1592,7 @@ (rotate! self f30-0) (tilt! self (- f28-0)) (if (or (!= f30-0 0.0) (!= f28-0 0.0)) - (sound-play-by-name (static-sound-name "telescope") (-> self aim-sound-id) 1024 0 0 1 #t) + (sound-play "telescope" :id (-> self aim-sound-id)) (sound-stop (-> self aim-sound-id)) ) ) @@ -1639,15 +1617,7 @@ (set! gp-0 (seekl gp-0 300 (the-as int (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) ) - (sound-play-by-name - (static-sound-name "cannon-charge") - (-> self sound-id) - 1024 - (the int (* 1524.0 (* 0.008 (the float gp-0)))) - 0 - 1 - #t - ) + (sound-play "cannon-charge" :id (-> self sound-id) :pitch (* 0.008 (the float gp-0))) ) (when (or (= gp-0 300) (and (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) (nonzero? gp-0)) diff --git a/goal_src/levels/misty/muse.gc b/goal_src/levels/misty/muse.gc index 4e077e73d9..1a994dae59 100644 --- a/goal_src/levels/misty/muse.gc +++ b/goal_src/levels/misty/muse.gc @@ -342,7 +342,7 @@ nav-enemy-default-event-handler (none) ) :code (behavior () - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "money-pickup") (close-specific-task! (game-task misty-muse) (task-status need-reminder)) (process-entity-status! self (entity-perm-status dead) #t) (suspend) diff --git a/goal_src/levels/misty/quicksandlurker.gc b/goal_src/levels/misty/quicksandlurker.gc index 4556e2561c..2687946f26 100644 --- a/goal_src/levels/misty/quicksandlurker.gc +++ b/goal_src/levels/misty/quicksandlurker.gc @@ -373,15 +373,7 @@ (defstate quicksandlurker-missile-impact (quicksandlurker-missile) :code (behavior () - (sound-play-by-name - (static-sound-name "sack-land") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) (process-spawn part-tracker :init part-tracker-init diff --git a/goal_src/levels/ogre/flying-lurker.gc b/goal_src/levels/ogre/flying-lurker.gc index fd3ea5a8cf..acdd949881 100644 --- a/goal_src/levels/ogre/flying-lurker.gc +++ b/goal_src/levels/ogre/flying-lurker.gc @@ -356,7 +356,16 @@ (set! (-> a1-1 quad) (-> obj root trans quad)) (set! (-> a1-1 y) (+ -8192.0 (-> a1-1 y))) (set-vector! a2-0 0.0 -81920.0 0.0 1.0) - (when (>= (fill-and-probe-using-line-sphere *collide-cache* a1-1 a2-0 8192.0 (collide-kind background) pp s3-1 (new 'static 'pat-surface :noentity #x1)) + (when (>= (fill-and-probe-using-line-sphere + *collide-cache* + a1-1 + a2-0 + 8192.0 + (collide-kind background) + pp + s3-1 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (set! (-> s3-1 intersect w) 8192.0) diff --git a/goal_src/levels/ogre/ogre-obs.gc b/goal_src/levels/ogre/ogre-obs.gc index 14933b247e..32a69cb651 100644 --- a/goal_src/levels/ogre/ogre-obs.gc +++ b/goal_src/levels/ogre/ogre-obs.gc @@ -338,7 +338,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (if arg0 (process-spawn part-tracker @@ -497,7 +497,7 @@ ) ) (if (-> self triggered) - (sound-play-by-name (static-sound-name "rock-in-lava") (new-sound-id) 1024 0 0 1 #t) + (sound-play "rock-in-lava") ) (go-virtual rigid-body-platform-float) ) diff --git a/goal_src/levels/ogre/ogreboss.gc b/goal_src/levels/ogre/ogreboss.gc index fd8439eda1..b6bec2a3c2 100644 --- a/goal_src/levels/ogre/ogreboss.gc +++ b/goal_src/levels/ogre/ogreboss.gc @@ -195,7 +195,7 @@ (defun ogreboss-rock-explosion-effect ((arg0 basic)) (with-pp - (sound-play-by-name (static-sound-name "ogre-explode") (new-sound-id) 1024 0 0 1 (the-as symbol arg0)) + (sound-play "ogre-explode" :position (the-as symbol arg0)) (process-spawn part-tracker :init part-tracker-init @@ -566,15 +566,7 @@ ) ) (spawn (-> self part) (-> self node-list data 3 bone transform vector 3)) - (sound-play-by-name - (static-sound-name "ogre-rock") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self joint transform)) - ) + (sound-play "ogre-rock" :id (-> self sound-id) :position (the-as symbol (-> self joint transform))) (suspend) ) (none) @@ -583,15 +575,7 @@ ) (defbehavior ogreboss-super-boulder-impact-effect ogreboss-super-boulder () - (sound-play-by-name - (static-sound-name "ogre-boulder") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self draw origin)) - ) + (sound-play "ogre-boulder" :position (the-as symbol (-> self draw origin))) (activate! *camera-smush-control* (the-as float 819.2) 37 600 (the-as float 1.0) (the-as float 0.995)) (process-spawn part-tracker @@ -1297,15 +1281,7 @@ ) (set! (-> gp-0 dest) s5-0) ) - (sound-play-by-name - (static-sound-name "ogre-fires") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-fires" :position (the-as symbol (-> self root-override trans))) (process-spawn part-tracker :init part-tracker-init @@ -1587,15 +1563,7 @@ ) (defbehavior ogreboss-roll-boulder ogreboss () - (sound-play-by-name - (static-sound-name "ogre-fires") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-fires" :position (the-as symbol (-> self root-override trans))) (+! (-> self roll-boulder) (rand-vu-int-range 1 2)) (if (>= (-> self roll-boulder) 3) (+! (-> self roll-boulder) -3) @@ -1680,37 +1648,13 @@ (let ((v1-17 (rand-vu-int-range 0 2))) (cond ((zero? v1-17) - (sound-play-by-name - (static-sound-name "ogre-grunt1") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-grunt1" :position (the-as symbol (-> self root-override trans))) ) ((= v1-17 1) - (sound-play-by-name - (static-sound-name "ogre-grunt2") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-grunt2" :position (the-as symbol (-> self root-override trans))) ) (else - (sound-play-by-name - (static-sound-name "ogre-grunt3") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-grunt3" :position (the-as symbol (-> self root-override trans))) ) ) ) diff --git a/goal_src/levels/racer_common/racer-states.gc b/goal_src/levels/racer_common/racer-states.gc index e3d915c172..81c02a9dc4 100644 --- a/goal_src/levels/racer_common/racer-states.gc +++ b/goal_src/levels/racer_common/racer-states.gc @@ -55,10 +55,8 @@ ) ) (('boost) - (sound-play-by-name (static-sound-name "get-blue-eco") (new-sound-id) 1024 0 0 1 #t) - (set! (-> self racer boost-sound-id) - (sound-play-by-name (static-sound-name "zoom-boost") (new-sound-id) 1024 0 0 1 #t) - ) + (sound-play "get-blue-eco") + (set! (-> self racer boost-sound-id) (sound-play "zoom-boost")) (set! (-> self racer boost-time) (-> *display* base-frame-counter)) (let ((f0-12 (seek (-> self racer boost-level) @@ -464,8 +462,8 @@ ) (when (!= (-> self racer slide-shift-x) 0.0) (if (rand-vu-percent? 0.5) - (sound-play-by-name (static-sound-name "zoomer-rev1") (new-sound-id) 819 0 0 1 #t) - (sound-play-by-name (static-sound-name "zoomer-rev2") (new-sound-id) 819 0 0 1 #t) + (sound-play "zoomer-rev1" :vol 80) + (sound-play "zoomer-rev2" :vol 80) ) ) (set! (-> self racer bounce) 0) @@ -519,7 +517,7 @@ :event (-> target-racing-start event) :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self racer shock-offsetv) 0.0) - (sound-play-by-name (static-sound-name "zoomer-jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-jump") (set! (-> self state-time) (-> *display* base-frame-counter)) (when arg2 (when (>= (-> self racer hill-ground-value) 0.11) @@ -642,7 +640,7 @@ :event (-> target-racing-start event) :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (logior! (-> self control root-prim prim-core action) (collide-action ca-15)) - (sound-play-by-name (static-sound-name "zoomer-jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-jump") (set! (-> self state-time) (-> *display* base-frame-counter)) (racer-calc-gravity) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) @@ -713,7 +711,7 @@ (defstate target-racing-smack (target) :event (-> target-racing-start event) :enter (behavior ((arg0 float) (arg1 symbol)) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (sound-play "smack-surface") (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (set! (-> self racer heavy) arg1) (vector-! (-> self control transv) (-> self control unknown-vector70) (-> self control trans)) @@ -741,7 +739,7 @@ (none) ) :code (behavior ((arg0 float) (arg1 symbol)) - (sound-play-by-name (static-sound-name "zoomer-crash-2") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-crash-2") (ja-channel-push! 2 (seconds 0.05)) (ja-no-eval :group! (-> self draw art-group data 136) :num! (seek!)) (ja :chan 1 @@ -828,7 +826,7 @@ (when (!= (-> self attack-info mode) 'endlessfall) (dummy-10 (-> self skel effect) 'group-target-hit -1.0 -1) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) - (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + (sound-play "oof") ) (set! (-> self game hit-time) (-> *display* base-frame-counter)) (logior! (-> self state-flags) (state-flags being-attacked)) @@ -910,7 +908,7 @@ ((-> target-racing-start exit)) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'loop) (send-event (ppointer->process (-> self manipy)) 'draw #f) - (sound-play-by-name (static-sound-name "zoomer-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-explode") (process-spawn part-tracker :init part-tracker-init @@ -1002,7 +1000,7 @@ ) ) (('melt) - (sound-play-by-name (static-sound-name "zoomer-melt") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-melt") (process-spawn part-tracker :init part-tracker-init @@ -1025,7 +1023,7 @@ ) ) (('endlessfall) - (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-fall") (camera-change-to (the-as string cam-endlessfall) 30 #f) (set! (-> self control pat-ignore-mask unknown-bit) 1) (let ((f30-0 (fmin -4096.0 (- (-> self control ground-impact-vel))))) @@ -1139,7 +1137,7 @@ (set! (-> self control transv quad) (the-as uint128 0)) (when (< 50.0 (ja-aframe-num 0)) (when (not gp-1) - (sound-play-by-name (static-sound-name "zoomer-start") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-start") (set! gp-1 #t) ) (set! (-> self racer front-rotv) 65536.0) @@ -1279,7 +1277,7 @@ :event target-generic-event-handler :exit (-> target-racing-start exit) :code (behavior ((arg0 handle)) - (sound-play-by-name (static-sound-name "zoomer-stop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-stop") (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control transv quad) (the-as uint128 0)) (let ((gp-1 (new 'stack-no-clear 'vector))) diff --git a/goal_src/levels/racer_common/target-racer.gc b/goal_src/levels/racer_common/target-racer.gc index 2b54ce5608..63ecaf5c54 100644 --- a/goal_src/levels/racer_common/target-racer.gc +++ b/goal_src/levels/racer_common/target-racer.gc @@ -588,14 +588,12 @@ ) ) (let ((f0-11 (lerp-scale 100.0 60.0 (-> self racer engine-sound-pitch) 0.8 2.0))) - (sound-play-by-name - (static-sound-name "zoomer-loop") - (-> self racer engine-sound-id) - (the int (* 10.24 f0-11)) - (the int (* 1524.0 (-> self racer engine-sound-pitch))) - 0 - 1 - (the-as symbol (-> self control trans)) + (sound-play + "zoomer-loop" + :id (-> self racer engine-sound-id) + :vol f0-11 + :pitch (-> self racer engine-sound-pitch) + :position (the-as symbol (-> self control trans)) ) ) (cond @@ -617,7 +615,7 @@ (>= (- (-> *display* base-frame-counter) (-> self racer heat-sound-time)) (seconds 1)) ) (set! (-> self racer heat-sound-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warning") ) ) ) @@ -966,7 +964,7 @@ 1024 0 0 - 1 + (sound-group sfx) #t ) ) @@ -978,7 +976,7 @@ ) ) (set! (-> self racer heat-sound-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warning") ) (when (rand-vu-percent? (/ (-> self racer heat) (-> *RACER-bank* heat-max))) (let ((a2-28 diff --git a/goal_src/levels/rolling/rolling-lightning-mole.gc b/goal_src/levels/rolling/rolling-lightning-mole.gc index 6545e54661..c692629c1e 100644 --- a/goal_src/levels/rolling/rolling-lightning-mole.gc +++ b/goal_src/levels/rolling/rolling-lightning-mole.gc @@ -1175,7 +1175,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.05) - (sound-play-by-name (static-sound-name "land-grass") (new-sound-id) 1024 0 0 1 #t) + (sound-play "land-grass") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/goal_src/levels/rolling/rolling-obs.gc b/goal_src/levels/rolling/rolling-obs.gc index 7630480ae2..a629482d40 100644 --- a/goal_src/levels/rolling/rolling-obs.gc +++ b/goal_src/levels/rolling/rolling-obs.gc @@ -273,7 +273,7 @@ :code (behavior () (dark-plant-randomize self) (logclear! (-> self draw status) (draw-status hidden)) - (sound-play-by-name (static-sound-name "darkvine-grow") (new-sound-id) 1024 0 0 1 #t) + (sound-play "darkvine-grow") (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -324,7 +324,7 @@ :code (behavior () (spawn (-> self part) (-> self root trans)) (ja-channel-push! 1 (seconds 0.2)) - (sound-play-by-name (static-sound-name "darkvine-kill") (new-sound-id) 1024 0 0 1 #t) + (sound-play "darkvine-kill") (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -345,7 +345,7 @@ (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (if (rand-vu-percent? 0.3) - (sound-play-by-name (static-sound-name "darkvine-move") (new-sound-id) 1024 0 0 1 #t) + (sound-play "darkvine-move") ) (when (task-closed? (game-task rolling-plants) (task-status need-hint)) (level-hint-spawn @@ -829,7 +829,7 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('break) - (sound-play-by-name (static-sound-name "cool-rolling-st") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cool-rolling-st") (go rolling-start-break #f) ) (('break-and-die) diff --git a/goal_src/levels/rolling/rolling-race-ring.gc b/goal_src/levels/rolling/rolling-race-ring.gc index 1de8c2c864..6e34fb32cf 100644 --- a/goal_src/levels/rolling/rolling-race-ring.gc +++ b/goal_src/levels/rolling/rolling-race-ring.gc @@ -655,7 +655,7 @@ (none) ) :exit (behavior () - (sound-play-by-name (static-sound-name "close-racering") (new-sound-id) 1024 0 0 1 #t) + (sound-play "close-racering") (let ((a0-3 (handle->process (-> self part-track)))) (if a0-3 (deactivate a0-3) diff --git a/goal_src/levels/snow/ice-cube.gc b/goal_src/levels/snow/ice-cube.gc index aef70e2399..20bb7f1444 100644 --- a/goal_src/levels/snow/ice-cube.gc +++ b/goal_src/levels/snow/ice-cube.gc @@ -911,7 +911,9 @@ (dummy-57 self) (logclear! (-> self mask) (process-mask actor-pause)) (if (or (not *target*) - (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying)) + (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (not (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos))) ) (go-virtual nav-enemy-patrol) @@ -1046,7 +1048,9 @@ (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-58 self) (if (or (not *target*) - (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying)) + (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (not (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos))) ) (go ice-cube-retract-spikes) @@ -1136,7 +1140,9 @@ (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (set! (-> self next-skid-sound-time) (-> *display* base-frame-counter)) (if (or (not *target*) - (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying)) + (logtest? (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) (not (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos))) ) (go ice-cube-retract-spikes) @@ -1235,15 +1241,7 @@ ) (when (>= (-> *display* base-frame-counter) (-> self next-skid-sound-time)) (set! (-> self next-skid-sound-time) (+ (-> *display* base-frame-counter) (nav-enemy-rnd-int-range 60 120))) - (sound-play-by-name - (static-sound-name "ice-stop") - (new-sound-id) - (the int (* 10.24 (the float (the int (* 0.0012207031 (-> self speed)))))) - 0 - 0 - 1 - #t - ) + (sound-play "ice-stop" :vol (the float (the int (* 0.0012207031 (-> self speed))))) ) ) (let ((f30-1 (* (vector-xz-length (-> self nav travel)) (-> *display* frames-per-second)))) @@ -1421,7 +1419,7 @@ :to self ) ) - (sound-play-by-name (static-sound-name "ice-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ice-explode") (suspend) (ja-channel-set! 0) (ja-post) diff --git a/goal_src/levels/snow/snow-ball.gc b/goal_src/levels/snow/snow-ball.gc index 6df1995969..489c9138a5 100644 --- a/goal_src/levels/snow/snow-ball.gc +++ b/goal_src/levels/snow/snow-ball.gc @@ -200,7 +200,7 @@ (defmethod play-landing-sound snow-ball-roller ((obj snow-ball-roller) (arg0 float)) (let ((f30-0 (* 0.0018780049 (fmin 53248.0 (fmax 0.0 (+ -4096.0 (fabs arg0))))))) - (sound-play-by-name (static-sound-name "snowball-land") (new-sound-id) (the int (* 10.24 f30-0)) 0 0 1 #t) + (sound-play "snowball-land" :vol f30-0) ) ) @@ -290,27 +290,16 @@ (cond ((zero? (-> self rolling-sound-id)) (if (and v1-54 (-> self rolling-sound-enabled?)) - (set! (-> self rolling-sound-id) (sound-play-by-name - (static-sound-name "snowball-roll") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (set! (-> self rolling-sound-id) + (sound-play "snowball-roll" :position (the-as symbol (-> self root-override trans))) ) ) ) ((and v1-54 (-> self rolling-sound-enabled?)) - (sound-play-by-name - (static-sound-name "snowball-roll") - (-> self rolling-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) + (sound-play + "snowball-roll" + :id (-> self rolling-sound-id) + :position (the-as symbol (-> self root-override trans)) ) ) (else diff --git a/goal_src/levels/snow/snow-bumper.gc b/goal_src/levels/snow/snow-bumper.gc index eca8506c0f..853cfe9110 100644 --- a/goal_src/levels/snow/snow-bumper.gc +++ b/goal_src/levels/snow/snow-bumper.gc @@ -232,7 +232,7 @@ :code (behavior () (local-vars (sv-16 symbol)) (logclear! (-> self mask) (process-mask actor-pause)) - (sound-play-by-name (static-sound-name "bumper-pwr-dwn") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bumper-pwr-dwn") (ja-no-eval :group! snow-bumper-button-ja :num! (seek! max 0.05) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part) (-> self root trans)) diff --git a/goal_src/levels/snow/snow-flutflut-obs.gc b/goal_src/levels/snow/snow-flutflut-obs.gc index 647bab97aa..8d2f5c0d4e 100644 --- a/goal_src/levels/snow/snow-flutflut-obs.gc +++ b/goal_src/levels/snow/snow-flutflut-obs.gc @@ -312,7 +312,7 @@ (none) ) :code (behavior () - (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 -1524 0 1 #t) + (sound-play "prec-button1" :pitch -1) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/goal_src/levels/snow/snow-obs.gc b/goal_src/levels/snow/snow-obs.gc index e8e20d0f6e..bd50ba6b29 100644 --- a/goal_src/levels/snow/snow-obs.gc +++ b/goal_src/levels/snow/snow-obs.gc @@ -545,8 +545,8 @@ (when (not gp-0) (set! gp-0 #t) (if (>= f0-0 0.5) - (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) + (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) ) ) ) @@ -649,7 +649,7 @@ (let ((v1-0 arg2)) (the-as object (when (= v1-0 'bonk) (dummy-22 self) - (sound-play-by-name (static-sound-name "snow-spat-short") (new-sound-id) 768 1143 0 1 #t) + (sound-play "snow-spat-short" :vol 75 :pitch 0.75) ) ) ) @@ -670,26 +670,10 @@ (set! gp-0 v1-3) (cond ((> v1-3 0) - (sound-play-by-name - (static-sound-name "snow-spat-long") - (new-sound-id) - 1024 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-long" :pitch (rand-vu-float-range -0.2 0.2)) ) (1 - (sound-play-by-name - (static-sound-name "snow-spat-short") - (new-sound-id) - 1024 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-short" :pitch (rand-vu-float-range -0.2 0.2)) ) ) ) @@ -998,7 +982,7 @@ ) ) (when (>= 1677.7216 f30-0) - (sound-play-by-name (static-sound-name "lodge-close") (new-sound-id) 1024 0 0 1 #t) + (sound-play "lodge-close") (activate! *camera-smush-control* 819.2 37 150 1.0 0.99) (go snow-fort-gate-idle-open) ) @@ -1238,7 +1222,7 @@ (none) ) :code (behavior () - (sound-play-by-name (static-sound-name "eng-start-up") (new-sound-id) 1024 0 0 1 #t) + (sound-play "eng-start-up") (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.85) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1279,7 +1263,7 @@ (ja :num! (seek! max 0.35)) ) (stop! (-> self sound)) - (sound-play-by-name (static-sound-name "eng-shut-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "eng-shut-down") (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek! max 0.85) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1390,7 +1374,7 @@ (suspend) (set! v1-1 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) ) - (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 -1524 0 1 #t) + (sound-play "prec-button1" :pitch -1) (let ((gp-1 (get-process *default-dead-pool* snowcam #x4000))) (set! (-> (the-as snowcam (-> (when gp-1 (let ((t9-3 (method-of-type snowcam activate))) @@ -1632,8 +1616,8 @@ (until (ja-done? 0) (when (and (not gp-0) (>= (ja-frame-num 0) 5.0)) (set! gp-0 #t) - (sound-play-by-name (static-sound-name "explosion") (new-sound-id) 409 1371 0 1 #t) - (sound-play-by-name (static-sound-name "snow-spat-short") (new-sound-id) 1024 381 0 1 #t) + (sound-play "explosion" :vol 40 :pitch 0.9) + (sound-play "snow-spat-short" :pitch 0.25) ) (suspend) (ja :num! (seek!)) @@ -1663,28 +1647,12 @@ ((and gp-0 (< f0-4 1.0)) (set! gp-0 #f) (set! s5-0 #t) - (sound-play-by-name - (static-sound-name "snow-spat-long") - (new-sound-id) - 870 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-long" :vol 85 :pitch (rand-vu-float-range -0.2 0.2)) ) ((and s5-0 (>= f0-4 11.0)) (set! s5-0 #f) (set! gp-0 #t) - (sound-play-by-name - (static-sound-name "snow-spat-short") - (new-sound-id) - 870 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-short" :vol 85 :pitch (rand-vu-float-range -0.2 0.2)) ) ) ) @@ -1799,7 +1767,7 @@ ) :trans (the-as (function none :behavior snow-log-button) rider-trans) :code (behavior () - (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 0 0 1 #t) + (sound-play "prec-button1") (loop (let ((f30-0 (+ -1433.6 (-> self orig-trans y)))) (when (= (-> self root-override trans y) f30-0) diff --git a/goal_src/levels/snow/snow-ram-boss.gc b/goal_src/levels/snow/snow-ram-boss.gc index a924130212..5c363ad4d3 100644 --- a/goal_src/levels/snow/snow-ram-boss.gc +++ b/goal_src/levels/snow/snow-ram-boss.gc @@ -580,7 +580,7 @@ (set! (-> obj attack-mode) 'snow-ram-proj) (set! (-> obj launch-time) (-> *display* base-frame-counter)) (set! (-> obj timeout) (seconds 4)) - (set! (-> obj sound-id) (sound-play-by-name (static-sound-name "ramboss-track") (new-sound-id) 1024 0 0 1 #t)) + (set! (-> obj sound-id) (sound-play "ramboss-track")) (let ((v1-12 (-> obj parent-override))) (set! (-> v1-12 0 proj-stoked) #t) (set! (-> v1-12 0 proj-status) (the-as uint 1)) @@ -604,7 +604,12 @@ ) (defmethod dummy-28 ram-boss-proj ((obj ram-boss-proj)) - (when (and *target* (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying)))) + (when (and *target* + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) + ) (let ((gp-0 (-> obj target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (set! (-> gp-0 y) (+ 4915.2 (-> gp-0 y))) @@ -639,9 +644,7 @@ ) ) :code (behavior () - (set! (-> self charge-sound-id) - (sound-play-by-name (static-sound-name "ramboss-charge") (new-sound-id) 1024 0 0 1 #t) - ) + (set! (-> self charge-sound-id) (sound-play "ramboss-charge")) (loop (let ((gp-1 (-> self parent-override))) (when (-> gp-1 0 dead?) @@ -684,7 +687,7 @@ (defstate ram-boss-proj-launch (ram-boss-proj) :code (behavior () - (sound-play-by-name (static-sound-name "ramboss-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ramboss-fire") (set! (-> self launched?) #t) (set! (-> self growth) 1.0) (logior! (-> self root-override root-prim prim-core action) (collide-action solid)) @@ -715,7 +718,7 @@ (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "ramboss-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ramboss-hit") (suspend) (go-virtual projectile-die) (none) @@ -1610,7 +1613,10 @@ ) ) (when (and (= (-> self proj-status) 2) - (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) ) (let ((gp-2 (new 'stack-no-clear 'vector)) diff --git a/goal_src/levels/snow/snow-ram.gc b/goal_src/levels/snow/snow-ram.gc index 08bb1be6ce..68abde7133 100644 --- a/goal_src/levels/snow/snow-ram.gc +++ b/goal_src/levels/snow/snow-ram.gc @@ -213,14 +213,14 @@ (local-vars (sv-16 symbol)) (ja-channel-push! 1 (seconds 0.075)) (loop - (sound-play-by-name (static-sound-name "set-ram") (new-sound-id) 1024 0 0 1 #t) + (sound-play "set-ram") (ja-no-eval :group! ram-cock-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) ) (let ((gp-1 #f)) - (sound-play-by-name (static-sound-name "slam-crash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "slam-crash") (logclear! (-> self mask) (process-mask actor-pause)) (ja-no-eval :group! ram-release-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -324,7 +324,7 @@ ) (set! (-> (the-as (pointer snowcam) v1-14) 0 seq) (the-as uint 1)) ) - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 diff --git a/goal_src/levels/sunken/bully.gc b/goal_src/levels/sunken/bully.gc index 4d35bcd1ce..255629d0bb 100644 --- a/goal_src/levels/sunken/bully.gc +++ b/goal_src/levels/sunken/bully.gc @@ -374,7 +374,10 @@ (defbehavior bully-post bully () (when (and (-> self hit-player?) (or (not *target*) - (and (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) ) ) @@ -642,15 +645,7 @@ (set! v1-34 (or (ja-done? 0) (-> self bounced?))) ) (when (-> self bounced?) - (sound-play-by-name - (static-sound-name "bully-bounce") - (new-sound-id) - (the int (* 10.24 (the float (-> self bounce-volume)))) - 0 - 0 - 1 - #t - ) + (sound-play "bully-bounce" :vol (the float (-> self bounce-volume))) (until (not (-> self bounced?)) (set! (-> self bounced?) #f) (ja-channel-push! 1 (seconds 0.2)) @@ -713,15 +708,7 @@ (set! v1-17 (or (ja-done? 0) (-> self bounced?))) ) (when (-> self bounced?) - (sound-play-by-name - (static-sound-name "bully-bounce") - (new-sound-id) - (the int (* 10.24 (the float (-> self bounce-volume)))) - 0 - 0 - 1 - #t - ) + (sound-play "bully-bounce" :vol (the float (-> self bounce-volume))) (set! gp-0 0) (until (not (-> self bounced?)) (set! (-> self bounced?) #f) diff --git a/goal_src/levels/sunken/helix-water.gc b/goal_src/levels/sunken/helix-water.gc index 4b430b5970..06ed974368 100644 --- a/goal_src/levels/sunken/helix-water.gc +++ b/goal_src/levels/sunken/helix-water.gc @@ -344,7 +344,7 @@ (game-task none) ) (send-event *target* 'play-anim 'shock-in) - (sound-play-by-name (static-sound-name "prec-button8") (new-sound-id) 1024 0 0 1 #t) + (sound-play "prec-button8") (set! (-> self root-override transv quad) (the-as uint128 0)) (let ((gp-3 5)) (until (<= gp-3 0) @@ -373,7 +373,7 @@ (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.25)) (suspend) ) - (sound-play-by-name (static-sound-name "maindoor") (new-sound-id) 1024 0 0 1 #t) + (sound-play "maindoor") (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.9)) (suspend) ) @@ -449,8 +449,8 @@ ) ) ) - (sound-play-by-name (static-sound-name "prec-button8") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "maindoor") (new-sound-id) 1024 0 0 1 #t) + (sound-play "prec-button8") + (sound-play "maindoor") (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) self) (set! (-> a1-3 num-params) 0) diff --git a/goal_src/levels/sunken/puffer.gc b/goal_src/levels/sunken/puffer.gc index 7503015eb5..200e9312f4 100644 --- a/goal_src/levels/sunken/puffer.gc +++ b/goal_src/levels/sunken/puffer.gc @@ -134,7 +134,10 @@ (defbehavior puffer-post puffer () (when (and (-> self hit-player?) (or (not *target*) - (and (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) ) ) @@ -230,7 +233,10 @@ (defmethod dummy-25 puffer ((obj puffer) (arg0 float)) (when *target* (let ((gp-0 (target-pos 0))) - (when (and (zero? (logand (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying))) + (when (and (zero? (logand (-> *target* state-flags) + (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) + ) + ) (dummy-24 obj gp-0) (>= (-> gp-0 y) (+ -14336.0 (-> obj attack-bottom-y))) (>= (+ 2048.0 (-> obj top-y)) (-> gp-0 y)) diff --git a/goal_src/levels/sunken/qbert-plat.gc b/goal_src/levels/sunken/qbert-plat.gc index 1857471b6b..bb538d61c9 100644 --- a/goal_src/levels/sunken/qbert-plat.gc +++ b/goal_src/levels/sunken/qbert-plat.gc @@ -195,7 +195,7 @@ (cond (v1-3 (process-spawn qbert-plat-on (-> obj entity) obj :to obj) - (sound-play-by-name (static-sound-name "plat-light-on") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-light-on") ) (else (let ((gp-2 (-> obj child))) @@ -204,7 +204,7 @@ (set! gp-2 (-> gp-2 0 brother)) ) ) - (sound-play-by-name (static-sound-name "plat-light-off") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-light-off") ) ) ) diff --git a/goal_src/levels/sunken/square-platform.gc b/goal_src/levels/sunken/square-platform.gc index 48e486ae8b..c1b1dc828b 100644 --- a/goal_src/levels/sunken/square-platform.gc +++ b/goal_src/levels/sunken/square-platform.gc @@ -223,7 +223,7 @@ (t1-0 1) (t2-0 #t) ) - (s2-0 (the-as sound-name s1-0) s0-0 sv-48 a3-0 t0-0 t1-0 t2-0) + (s2-0 (the-as sound-name s1-0) s0-0 sv-48 a3-0 t0-0 (the-as sound-group t1-0) t2-0) ) ) ) diff --git a/goal_src/levels/sunken/steam-cap.gc b/goal_src/levels/sunken/steam-cap.gc index 250ae1549e..a6b57508a8 100644 --- a/goal_src/levels/sunken/steam-cap.gc +++ b/goal_src/levels/sunken/steam-cap.gc @@ -483,7 +483,7 @@ (set! s5-0 #f) (set! (-> obj do-falling-sound?) #t) (when (-> obj do-burst?) - (sound-play-by-name (static-sound-name "sunk-top-rises") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sunk-top-rises") (set! (-> obj do-burst?) #f) (spawn (-> obj part) (-> obj down)) (spawn (-> obj part) (-> obj down)) @@ -504,7 +504,7 @@ (set! s5-0 #t) (when (-> obj do-falling-sound?) (set! (-> obj do-falling-sound?) #f) - (sound-play-by-name (static-sound-name "sunk-top-falls") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sunk-top-falls") ) ) ) @@ -534,7 +534,7 @@ (when (< (-> s3-3 y) (-> obj down y)) (when (-> obj do-landing-sound?) (set! (-> obj do-landing-sound?) #f) - (sound-play-by-name (static-sound-name "sunk-top-lands") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sunk-top-lands") ) (set! (-> s3-3 y) (-> obj down y)) (let ((f0-20 (-> s2-0 transv y))) @@ -542,7 +542,7 @@ (let ((f0-22 (* 0.3 (- f0-20)))) (set! (-> s2-0 transv y) f0-22) (if (< 7782.4 f0-22) - (sound-play-by-name (static-sound-name "sunk-top-lands") (new-sound-id) 614 0 0 1 #t) + (sound-play "sunk-top-lands" :vol 60) ) ) ) diff --git a/goal_src/levels/sunken/sun-exit-chamber.gc b/goal_src/levels/sunken/sun-exit-chamber.gc index 173eaf93a6..226db6e594 100644 --- a/goal_src/levels/sunken/sun-exit-chamber.gc +++ b/goal_src/levels/sunken/sun-exit-chamber.gc @@ -383,7 +383,7 @@ :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (if arg0 - (sound-play-by-name (static-sound-name "blue-eco-start") (new-sound-id) 1024 0 0 1 #t) + (sound-play "blue-eco-start") ) (dummy-21 self #t) (none) diff --git a/goal_src/levels/sunken/sun-iris-door.gc b/goal_src/levels/sunken/sun-iris-door.gc index 02ede5c020..058ec92f03 100644 --- a/goal_src/levels/sunken/sun-iris-door.gc +++ b/goal_src/levels/sunken/sun-iris-door.gc @@ -132,7 +132,7 @@ ) ) :code (behavior () - (sound-play-by-name (static-sound-name "irisdoor2") (new-sound-id) 1024 0 0 1 #t) + (sound-play "irisdoor2") (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) @@ -285,7 +285,7 @@ ) ) :code (behavior () - (sound-play-by-name (static-sound-name "irisdoor2") (new-sound-id) 1024 0 0 1 #t) + (sound-play "irisdoor2") (ja-no-eval :num! (seek! 0.0)) (until (ja-done? 0) (suspend) diff --git a/goal_src/levels/sunken/sunken-water.gc b/goal_src/levels/sunken/sunken-water.gc index 8f079a88cc..01cdde025c 100644 --- a/goal_src/levels/sunken/sunken-water.gc +++ b/goal_src/levels/sunken/sunken-water.gc @@ -99,7 +99,7 @@ (case arg2 (('notify) (if (= (-> arg3 param 0) 'attack) - (sound-play-by-name (static-sound-name "get-shocked") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-shocked") ) ) (else @@ -136,7 +136,7 @@ (draw-ripple self) (when (not (-> self playing-deadly-sound?)) (set! (-> self playing-deadly-sound?) #t) - (sound-play-by-name (static-sound-name "water-on") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-on") ) (update! (-> self sound)) ) @@ -161,7 +161,7 @@ (when (-> self playing-deadly-sound?) (set! (-> self playing-deadly-sound?) #f) (stop! (-> self sound)) - (sound-play-by-name (static-sound-name "water-off") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-off") ) ) ) diff --git a/goal_src/levels/sunken/target-tube.gc b/goal_src/levels/sunken/target-tube.gc index 8072d6eabb..d3107005c1 100644 --- a/goal_src/levels/sunken/target-tube.gc +++ b/goal_src/levels/sunken/target-tube.gc @@ -166,14 +166,12 @@ (let ((f30-0 (-> self tube tube-sound-vol)) (f0-5 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 122880.0)) ) - (sound-play-by-name - (static-sound-name "slide-loop") - (-> self tube tube-sound-id) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f0-5)) - 0 - 1 - (the-as symbol (-> self control trans)) + (sound-play + "slide-loop" + :id (-> self tube tube-sound-id) + :vol f30-0 + :pitch f0-5 + :position (the-as symbol (-> self control trans)) ) ) ) diff --git a/goal_src/levels/sunken/wall-plat.gc b/goal_src/levels/sunken/wall-plat.gc index 08e91b280d..01f1a9e413 100644 --- a/goal_src/levels/sunken/wall-plat.gc +++ b/goal_src/levels/sunken/wall-plat.gc @@ -70,7 +70,7 @@ ) ) :enter (behavior () - (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + (sound-play "wall-plat") (none) ) :trans (the-as (function none :behavior wall-plat) rider-trans) @@ -124,7 +124,7 @@ ) ) :enter (behavior () - (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + (sound-play "wall-plat") (none) ) :trans (the-as (function none :behavior wall-plat) rider-trans) @@ -184,7 +184,7 @@ ) (else (when (not gp-0) - (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + (sound-play "wall-plat") (set! gp-0 #t) ) (restore-collide-with-as (-> self root-override)) diff --git a/goal_src/levels/swamp/billy.gc b/goal_src/levels/swamp/billy.gc index 81ce6672b1..15156e13cb 100644 --- a/goal_src/levels/swamp/billy.gc +++ b/goal_src/levels/swamp/billy.gc @@ -172,7 +172,7 @@ ) :code (behavior () (send-event (handle->process (-> self snack)) 'eat) - (sound-play-by-name (static-sound-name "rat-gulp") (new-sound-id) 1024 0 0 1 #t) + (sound-play "rat-gulp") (ja-channel-push! 1 (seconds 0.05)) (ja :group! (-> self draw art-group data 12)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) @@ -196,7 +196,7 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.075)) (dotimes (gp-0 1) - (sound-play-by-name (static-sound-name "rat-eat") (new-sound-id) 1024 0 0 1 #t) + (sound-play "rat-eat") (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) (ja-no-eval :group! (-> self draw art-group data (-> self nav-info victory-anim)) :num! (seek! max f30-0) diff --git a/goal_src/levels/swamp/kermit.gc b/goal_src/levels/swamp/kermit.gc index 21af9ca458..4c200443c3 100644 --- a/goal_src/levels/swamp/kermit.gc +++ b/goal_src/levels/swamp/kermit.gc @@ -543,15 +543,7 @@ ) :code (behavior () (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) - (sound-play-by-name - (static-sound-name "kermit-loop") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "kermit-loop" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) (spawn (-> self part) (-> self root-override trans)) (find-ground-and-draw-shadow (-> self root-override trans) @@ -575,7 +567,7 @@ (defstate kermit-pulse-impact (kermit-pulse) :code (behavior () - (sound-play-by-name (static-sound-name "get-shocked") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-shocked") (process-spawn part-tracker :init part-tracker-init @@ -1271,15 +1263,7 @@ nav-enemy-default-event-handler (loop (ja-no-eval :group! kermit-turn-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (sound-play-by-name - (static-sound-name "kermit-stretch") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self collide-info trans)) - ) + (sound-play "kermit-stretch" :id (-> self sound-id) :position (the-as symbol (-> self collide-info trans))) (suspend) (ja :num! (seek!)) ) diff --git a/goal_src/levels/swamp/swamp-obs.gc b/goal_src/levels/swamp/swamp-obs.gc index cf8890d731..c37ae1a061 100644 --- a/goal_src/levels/swamp/swamp-obs.gc +++ b/goal_src/levels/swamp/swamp-obs.gc @@ -614,7 +614,7 @@ (defstate swamp-rock-break (swamp-rock) :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (sound-play-by-name (static-sound-name "rock-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "rock-break") (process-spawn part-tracker :init part-tracker-init diff --git a/goal_src/levels/swamp/swamp-rat-nest.gc b/goal_src/levels/swamp/swamp-rat-nest.gc index e684249081..805135dd56 100644 --- a/goal_src/levels/swamp/swamp-rat-nest.gc +++ b/goal_src/levels/swamp/swamp-rat-nest.gc @@ -855,20 +855,23 @@ swamp-rat-nest-default-event-handler ;; WARN: Function may read a register that is not set: t2 (defbehavior swamp-rat-nest-spawn-rat swamp-rat-nest () (local-vars (t2-0 none)) - (when (and (-> self dummy) (> (-> self dummy 0 spawn-joint-count) 0)) - (let* ((v1-5 (swamp-rat-nest-pick-spawn-joint)) - (v1-8 (-> self dummy 0 node-list data v1-5 bone)) - (gp-0 (new 'stack-no-clear 'vector)) - ) - (set! (-> gp-0 quad) (-> v1-8 transform vector 3 quad)) - (let ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-8 transform vector 1) 1.0)) - (s4-0 (if (= (-> self fact-override pickup-type) (pickup-type none)) - 0 - 9 - ) - ) - ) - (process-spawn swamp-rat self gp-0 s5-0 s4-0 t2-0 :to self) + (the-as + (pointer swamp-rat) + (when (and (-> self dummy) (> (-> self dummy 0 spawn-joint-count) 0)) + (let* ((v1-5 (swamp-rat-nest-pick-spawn-joint)) + (v1-8 (-> self dummy 0 node-list data v1-5 bone)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> v1-8 transform vector 3 quad)) + (let ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-8 transform vector 1) 1.0)) + (s4-0 (if (= (-> self fact-override pickup-type) (pickup-type none)) + 0 + 9 + ) + ) + ) + (process-spawn swamp-rat self gp-0 s5-0 s4-0 t2-0 :to self) + ) ) ) ) diff --git a/goal_src/levels/title/title-obs.gc b/goal_src/levels/title/title-obs.gc index 870cf4f92e..9d71619189 100644 --- a/goal_src/levels/title/title-obs.gc +++ b/goal_src/levels/title/title-obs.gc @@ -671,7 +671,7 @@ :trans (behavior () (hide-hud-quick) (spool-push *art-control* "ndi-intro" 0 self -1.0) - (sound-group-pause (the-as uint 2)) + (sound-group-pause (sound-group music)) (none) ) :code (behavior () @@ -815,7 +815,7 @@ (remove-setting! 'sfx-volume) (remove-setting! 'music-volume) (remove-setting! 'allow-progress) - (sound-group-continue (the-as uint 2)) + (sound-group-continue (sound-group music)) (when *time-of-day-proc* (set! (-> *time-of-day-proc* 0 time-ratio) 18000.0) (set! *time-of-day-fast* #t) diff --git a/goal_src/levels/training/training-obs.gc b/goal_src/levels/training/training-obs.gc index 2819c7fe92..40ae53f4d0 100644 --- a/goal_src/levels/training/training-obs.gc +++ b/goal_src/levels/training/training-obs.gc @@ -774,7 +774,7 @@ (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 12.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 20.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-explode 4.0 -1) - (sound-play-by-name (static-sound-name "break-dummy") (new-sound-id) 1024 0 0 1 #t) + (sound-play "break-dummy") (ja-channel-set! 0) (let ((s5-2 (new 'stack 'joint-exploder-tuning 1))) (set! (-> s5-2 duration) (seconds 1.5)) @@ -912,7 +912,7 @@ (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 12.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 21.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-explode 4.0 -1) - (sound-play-by-name (static-sound-name "break-dummy") (new-sound-id) 1024 0 0 1 #t) + (sound-play "break-dummy") (ja-channel-set! 0) (let ((s5-2 (new 'stack 'joint-exploder-tuning 1))) (set! (-> s5-2 duration) (seconds 1.5)) diff --git a/goal_src/levels/training/training-part.gc b/goal_src/levels/training/training-part.gc index 8d571e6b06..264cc74f21 100644 --- a/goal_src/levels/training/training-part.gc +++ b/goal_src/levels/training/training-part.gc @@ -290,7 +290,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/goal_src/levels/village1/assistant.gc b/goal_src/levels/village1/assistant.gc index 5a720d6b06..b05217c073 100644 --- a/goal_src/levels/village1/assistant.gc +++ b/goal_src/levels/village1/assistant.gc @@ -224,15 +224,7 @@ (suspend) (ja :num! (seek!)) ) - (sound-play-by-name - (static-sound-name "welding-loop") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (target-pos 0)) - ) + (sound-play "welding-loop" :id (-> self sound-id) :position (the-as symbol (target-pos 0))) (ja :group! assistant-idle-welding-ja) (let* ((f30-0 4.0) (v1-76 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -364,7 +356,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/goal_src/levels/village1/fishermans-boat.gc b/goal_src/levels/village1/fishermans-boat.gc index dd7a549fb3..a221ff40d3 100644 --- a/goal_src/levels/village1/fishermans-boat.gc +++ b/goal_src/levels/village1/fishermans-boat.gc @@ -733,14 +733,12 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (vector<-cspace! gp-0 (-> self node-list data 4)) - (sound-play-by-name - (static-sound-name "boat-engine") - (-> self engine-sound-id) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f28-0)) - 0 - 1 - (the-as symbol gp-0) + (sound-play + "boat-engine" + :id (-> self engine-sound-id) + :vol f30-0 + :pitch f28-0 + :position (the-as symbol gp-0) ) ) ) diff --git a/goal_src/levels/village1/village1-part2.gc b/goal_src/levels/village1/village1-part2.gc index 28dc32888f..9604e20dee 100644 --- a/goal_src/levels/village1/village1-part2.gc +++ b/goal_src/levels/village1/village1-part2.gc @@ -1610,7 +1610,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/goal_src/levels/village2/assistant-village2.gc b/goal_src/levels/village2/assistant-village2.gc index 34d23f530a..f11bb6a5e0 100644 --- a/goal_src/levels/village2/assistant-village2.gc +++ b/goal_src/levels/village2/assistant-village2.gc @@ -531,15 +531,7 @@ ) ) ((< f0-9 0.6666667) - (sound-play-by-name - (static-sound-name "welding-loop") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (target-pos 0)) - ) + (sound-play "welding-loop" :id (-> self sound-id) :position (the-as symbol (target-pos 0))) (ja-no-eval :group! assistant-village2-idle-hut-start-welding-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -692,7 +684,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/goal_src/levels/village2/village2-obs.gc b/goal_src/levels/village2/village2-obs.gc index b8d09938e7..5778888a04 100644 --- a/goal_src/levels/village2/village2-obs.gc +++ b/goal_src/levels/village2/village2-obs.gc @@ -1201,7 +1201,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "boulder-splash") (process-spawn part-tracker :init part-tracker-init @@ -1226,7 +1226,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "boulder-splash") (process-spawn part-tracker :init part-tracker-init @@ -1251,7 +1251,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) + (sound-play "v2ogre-boulder") (process-spawn part-tracker :init part-tracker-init @@ -1276,7 +1276,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "boulder-splash") (process-spawn part-tracker :init part-tracker-init @@ -1301,7 +1301,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) + (sound-play "v2ogre-boulder") (process-spawn part-tracker :init part-tracker-init @@ -1326,7 +1326,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "boulder-splash") (process-spawn part-tracker :init part-tracker-init @@ -1351,7 +1351,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) + (sound-play "v2ogre-boulder") (process-spawn part-tracker :init part-tracker-init @@ -1376,7 +1376,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) + (sound-play "v2ogre-boulder") (process-spawn part-tracker :init part-tracker-init diff --git a/goal_src/levels/village2/village2-part.gc b/goal_src/levels/village2/village2-part.gc index e9f3f78fb5..2eb4111ae2 100644 --- a/goal_src/levels/village2/village2-part.gc +++ b/goal_src/levels/village2/village2-part.gc @@ -1853,7 +1853,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/goal_src/levels/village3/village3-obs.gc b/goal_src/levels/village3/village3-obs.gc index 197c95392c..58a289600d 100644 --- a/goal_src/levels/village3/village3-obs.gc +++ b/goal_src/levels/village3/village3-obs.gc @@ -432,7 +432,7 @@ :code (behavior ((arg0 handle) (arg1 symbol)) (process-entity-status! self (entity-perm-status complete) #t) (if (not arg1) - (sound-play-by-name (static-sound-name "gdl-start-up") (new-sound-id) 1024 0 0 1 #t) + (sound-play "gdl-start-up") ) (let ((f30-0 (if arg1 1.0 diff --git a/goal_src/levels/village_common/villagep-obs.gc b/goal_src/levels/village_common/villagep-obs.gc index 29b8568fa7..603c6a9191 100644 --- a/goal_src/levels/village_common/villagep-obs.gc +++ b/goal_src/levels/village_common/villagep-obs.gc @@ -72,7 +72,7 @@ (set! (-> self post-hook) target-no-stick-post) (ja-channel-set! 1) (send-event self 'do-effect 'death-warp-in -1.0) - (sound-play-by-name (static-sound-name "warpgate-tele") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warpgate-tele") (ja-no-eval :group! (-> self draw art-group data 41) :num! (seek! (ja-aframe 50.0 0)) :frame-num (ja-aframe 40.0 0) @@ -223,7 +223,7 @@ :enter (behavior () (set-setting! 'allow-progress #f 0.0 0) (apply-settings *setting-control*) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) @@ -236,7 +236,7 @@ ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (go-virtual idle) ) (when *target* @@ -272,13 +272,13 @@ ((cpad-pressed? 0 right) (set! s5-0 #t) (set! s4-0 #f) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! s3-0 (get-next-slot-up self s3-0)) ) ((cpad-pressed? 0 left) (set! s5-0 #t) (set! s4-0 #t) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! s3-0 (get-next-slot-down self s3-0)) ) ) @@ -818,8 +818,8 @@ (defstate basebutton-going-down (warp-gate-switch) :virtual #t :code (behavior () - (sound-play-by-name (static-sound-name "warpgate-butt") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "warpgate-act") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warpgate-butt") + (sound-play "warpgate-act") (let ((gp-2 (entity-actor-count (-> self entity) 'trigger-actor))) (dotimes (s5-2 gp-2) (let ((s4-0 (entity-actor-lookup (-> self entity) 'trigger-actor s5-2)) @@ -961,12 +961,13 @@ (process-grab? *target*) (process-entity-status! self (entity-perm-status bit-3) #t) (kill-current-level-hint '(ambient) '() 'exit) - (until (not (or (-> *setting-control* current talking) (or (-> *setting-control* current spooling) - (-> *setting-control* current hint) - (-> *setting-control* current ambient) - (not *target*) - (logtest? (-> *target* state-flags) (state-flags being-attacked dying)) - ) + (until (not (or (-> *setting-control* current talking) + (or (-> *setting-control* current spooling) + (-> *setting-control* current hint) + (-> *setting-control* current ambient) + (not *target*) + (logtest? (-> *target* state-flags) (state-flags being-attacked dying)) + ) ) ) (set-setting! 'allow-progress #f 0.0 0) diff --git a/goal_src/pc/progress-pc.gc b/goal_src/pc/progress-pc.gc index 83ed463c79..6074463acc 100644 --- a/goal_src/pc/progress-pc.gc +++ b/goal_src/pc/progress-pc.gc @@ -649,7 +649,7 @@ ;; original code checked hold and then press, because hold can be used during center screen option. which we don't use. (when (not (-> obj selected-option)) (if (!= (length options) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") ) (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) (cond @@ -670,7 +670,7 @@ ;; pressed down. (when (not (-> obj selected-option)) (if (!= (length options) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") ) (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) (cond @@ -755,7 +755,7 @@ ) ) (if sound? - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -795,7 +795,7 @@ ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 vol)) 0 0 1 #t) + (sound-play "slider2001" :vol vol) ) ) ) @@ -865,7 +865,7 @@ ) ;; play sound if desired (if sound? - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -901,7 +901,7 @@ ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 vol)) 0 0 1 #t) + (sound-play "slider2001" :vol vol) ) ) ) @@ -930,7 +930,7 @@ ) ) ;; ding - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj selected-option) #f) ) ((or (can-go-back? obj) @@ -942,11 +942,11 @@ (cpad-clear! 0 square) (cpad-clear! 0 triangle) (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-stats") + (sound-play "cursor-options") ) (when (= (-> obj display-state) (progress-screen music-player)) - (sound-group-pause (the-as uint 2)) + (sound-group-pause (sound-group music)) (progress-reset-music-parms)) (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) (set! (-> obj next-display-state) (progress-screen invalid)) @@ -964,7 +964,7 @@ (cpad-clear! 0 x) (cpad-clear! 0 circle) (push! obj) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (the-as progress-screen (-> options (-> obj option-index) param3))) (case (-> obj next-display-state) (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) @@ -979,7 +979,7 @@ (cpad-clear! 0 circle) (set! *progress-music* (-> obj option-index)) (push! obj) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen flava-player)) ) ) @@ -990,8 +990,8 @@ (cpad-clear! 0 circle) (set-setting *setting-control* obj 'music (progress-get-music-by-index *progress-music*) 0.0 0) (set! *progress-flava* (the int (-> options (-> obj option-index) param1))) - (sound-group-continue (the-as uint 2)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-group-continue (sound-group music)) + (sound-play "select-option") ) ) ((= (-> options (-> obj option-index) option-type) (game-option-type button)) @@ -1005,11 +1005,11 @@ (((game-text-id back)) ;; go back! (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-stats") + (sound-play "cursor-options") ) (when (= (-> obj display-state) (progress-screen music-player)) - (sound-group-pause (the-as uint 2)) + (sound-group-pause (sound-group music)) (progress-reset-music-parms)) (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) (set! (-> obj next-display-state) (progress-screen invalid)) @@ -1017,7 +1017,7 @@ (((game-text-id camera-controls-original)) ;; restore default camera controls (reset-original-camera *pc-settings*) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") ) ) ;; other behaviors are hardcoded elsewhere because screw you. @@ -1031,7 +1031,7 @@ (cpad-clear! 0 circle) (cpad-clear! 0 square) (cpad-clear! 0 triangle) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ((= (-> options (-> obj option-index) option-type) (game-option-type aspect-new)) @@ -1045,7 +1045,7 @@ (cpad-clear! 0 circle) (cpad-clear! 0 square) (cpad-clear! 0 triangle) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ((!= (-> options (-> obj option-index) option-type) (game-option-type yes-no)) @@ -1105,7 +1105,7 @@ ) ) ) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (cpad-clear! 0 x) (cpad-clear! 0 circle) (set! (-> obj selected-option) #t) @@ -1139,7 +1139,7 @@ ) (else ;; an option was selected. write stuff! - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj selected-option) #f) (case (-> options (-> obj option-index) option-type) (((game-option-type aspect-ratio)) @@ -1220,13 +1220,13 @@ (cond ((< (-> obj option-index) 4) (when (nonzero? (-> s5-0 file (-> obj option-index) present)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *progress-state* which) (-> obj option-index)) (set! (-> obj next-display-state) (progress-screen memcard-loading)) ) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1234,7 +1234,7 @@ (((progress-screen save-game) (progress-screen save-game-title)) (cond ((< (-> obj option-index) 4) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *progress-state* which) (-> obj option-index)) (if (zero? (-> s5-0 file (-> obj option-index) present)) (set! (-> obj next-display-state) (progress-screen memcard-saving)) @@ -1242,30 +1242,30 @@ ) ) ((and (= (-> obj display-state) (progress-screen save-game-title)) (= (-> obj option-index) 4)) - (sound-play-by-name (static-sound-name "starts-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "starts-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) ) (((progress-screen memcard-insert)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen memcard-data-exists)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-saving)) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (if (= (-> obj display-state-stack 0) (progress-screen title)) (set! (-> obj next-display-state) (progress-screen save-game-title)) (set! (-> obj next-display-state) (progress-screen save-game)) @@ -1276,11 +1276,11 @@ (((progress-screen memcard-no-data)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-creating)) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") @@ -1294,18 +1294,18 @@ ) (cond ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) ((nonzero? (-> obj display-state-stack 0)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1318,19 +1318,19 @@ (progress-screen memcard-removed) (progress-screen auto-save) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen pal-change-to-60hz)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) (set! (-> obj video-mode-timeout) (-> *display* real-frame-counter)) (set! (-> obj next-display-state) (progress-screen pal-now-60hz)) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> *progress-state* video-mode-choice) 'pal) (set! (-> obj next-display-state) (progress-screen invalid)) ) @@ -1341,30 +1341,30 @@ ((not (-> *progress-state* yes-no-choice)) (set! (-> *progress-state* video-mode-choice) 'pal) (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") ) (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") ) ) (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen no-disc) (progress-screen bad-disc)) (when (is-cd-in?) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) (((progress-screen quit)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "title-start") ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1372,18 +1372,18 @@ (((progress-screen memcard-format)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-formatting)) ) ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1391,12 +1391,12 @@ (((progress-screen quit-title)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (kernel-shutdown) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1968,7 +1968,7 @@ ;; override the enter handler for progress-going-out (set! (-> progress-going-out enter) (lambda :behavior progress () - (sound-play-by-name (static-sound-name "menu-close") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-close") (hide-progress-icons) (remove-setting! 'music) (apply-settings *setting-control*) diff --git a/test/decompiler/reference/decompiler-macros.gc b/test/decompiler/reference/decompiler-macros.gc index 2339e21ac9..aa11ce3a1e 100644 --- a/test/decompiler/reference/decompiler-macros.gc +++ b/test/decompiler/reference/decompiler-macros.gc @@ -990,6 +990,14 @@ )) ) +;; gsound +(defmacro sound-play (name &key (id (new-sound-id)) + &key (vol 100.0) &key (pitch 0) &key (bend 0) + &key (group sfx) + &key (position #t)) + `(sound-play-by-name (static-sound-name ,name) ,id (the int (* (/ 1024.0 100.0) ,vol)) (the int (* 1524.0 ,pitch)) ,bend (sound-group ,group) ,position) + ) + ;; process-drawable (defmacro ja-group (&key (chan 0)) "get the frame group for self. default channel is 0, the base channel. returns #f if no frame group." diff --git a/test/decompiler/reference/engine/ambient/ambient_REF.gc b/test/decompiler/reference/engine/ambient/ambient_REF.gc index 71fdd76e69..34773099f0 100644 --- a/test/decompiler/reference/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/engine/ambient/ambient_REF.gc @@ -518,7 +518,7 @@ (s4-1 string->sound-name) ) (format (clear *temp-string*) "spool-~S" arg0) - (let ((s5-2 (s5-1 (s4-1 *temp-string*) (new-sound-id) 1024 0 0 1 #t))) + (let ((s5-2 (s5-1 (s4-1 *temp-string*) (new-sound-id) 1024 0 0 (sound-group sfx) #t))) (set! (-> self sound-id) s5-2) (let ((s4-3 (-> *display* base-frame-counter))) (while (and (!= (current-str-id) s5-2) (< (- (-> *display* base-frame-counter) s4-3) (seconds 5))) @@ -571,7 +571,7 @@ ) (format (clear *temp-string*) "spool-~S" arg0) (set! (-> self sound-id) - (s5-0 (s4-0 *temp-string*) (new-sound-id) 1024 1 0 1 (the-as symbol (-> self trans))) + (s5-0 (s4-0 *temp-string*) (new-sound-id) 1024 1 0 (sound-group sfx) (the-as symbol (-> self trans))) ) ) ) @@ -580,7 +580,7 @@ (s4-2 string->sound-name) ) (format (clear *temp-string*) "spool-~S" arg0) - (set! (-> self sound-id) (s5-1 (s4-2 *temp-string*) (new-sound-id) 1024 0 0 1 #t)) + (set! (-> self sound-id) (s5-1 (s4-2 *temp-string*) (new-sound-id) 1024 0 0 (sound-group sfx) #t)) ) ) ) diff --git a/test/decompiler/reference/engine/ambient/mood_REF.gc b/test/decompiler/reference/engine/ambient/mood_REF.gc index 15a5f86708..9dd745ef8a 100644 --- a/test/decompiler/reference/engine/ambient/mood_REF.gc +++ b/test/decompiler/reference/engine/ambient/mood_REF.gc @@ -719,23 +719,17 @@ ) (when (>= (-> *math-camera* trans y) -81920.0) (if arg6 - (sound-play-by-name - (static-sound-name "thunder") - *thunder-id* - (the int (* 10.24 (rand-vu-float-range 25.0 75.0))) - (the int (* 1524.0 (rand-vu-float-range -1.0 1.0))) - 0 - 1 - #t + (sound-play + "thunder" + :id *thunder-id* + :vol (rand-vu-float-range 25.0 75.0) + :pitch (rand-vu-float-range -1.0 1.0) ) - (sound-play-by-name - (static-sound-name "thunder") - *thunder-id* - (the int (* 10.24 (rand-vu-float-range 200.0 400.0))) - (the int (* 1524.0 (rand-vu-float-range -1.0 1.0))) - 0 - 1 - #t + (sound-play + "thunder" + :id *thunder-id* + :vol (rand-vu-float-range 200.0 400.0) + :pitch (rand-vu-float-range -1.0 1.0) ) ) ) @@ -1001,11 +995,11 @@ ;; definition for function update-mood-misty ;; INFO: Return type mismatch int vs none. -(defun update-mood-misty ((arg0 mood-context) (arg1 float) (arg2 float)) +(defun update-mood-misty ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) (clear-mood-times arg0) - (update-mood-palette arg0 arg1 (the-as int arg2)) + (update-mood-palette arg0 arg1 arg2) (when *time-of-day-effects* (update-mood-flames arg0 2 4 0 0.333 0.001953125 1.0) (let* ((s4-1 (get-task-control (game-task misty-warehouse))) diff --git a/test/decompiler/reference/engine/collide/collide-reaction-target_REF.gc b/test/decompiler/reference/engine/collide/collide-reaction-target_REF.gc index a0484b74ee..5184c34f5a 100644 --- a/test/decompiler/reference/engine/collide/collide-reaction-target_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-reaction-target_REF.gc @@ -365,7 +365,7 @@ (-> arg0 history-data (logand (+ (-> arg0 unknown-halfword00) 127) 127)) (cond (#f - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! sv-104 (logior sv-104 8192)) (vector-reflect-flat-above! arg2 (the-as vector (-> sv-88 vector)) sv-84) ) diff --git a/test/decompiler/reference/engine/draw/drawable_REF.gc b/test/decompiler/reference/engine/draw/drawable_REF.gc index 6f5e89b8f2..3851955afb 100644 --- a/test/decompiler/reference/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/engine/draw/drawable_REF.gc @@ -579,8 +579,8 @@ (logclear! (-> arg1 status) (draw-status was-drawn)) (when (zero? (logand (-> arg1 status) (draw-status hidden no-anim no-skeleton-update))) (let ((s4-0 (the-as vector (+ 48 (the-as int (the-as terrain-context #x70000000))))) - (s2-0 (the-as vu-lights (+ 64 (the-as int (the-as terrain-context #x70000000))))) - (s3-0 *time-of-day-context*) + (vu-lgt (the-as vu-lights (+ 64 (the-as int (the-as terrain-context #x70000000))))) + (tod *time-of-day-context*) ) (.lvf vf16 (&-> arg1 origin quad)) (.lvf vf17 (&-> arg1 bounds quad)) @@ -592,130 +592,130 @@ (when (sphere-in-view-frustum? (the-as sphere s4-0)) (case (-> arg1 global-effect) (((draw-effect title)) - (when (not (-> s3-0 title-updated)) - (set! (-> s3-0 title-updated) #t) + (when (not (-> tod title-updated)) + (set! (-> tod title-updated) #t) (let ((s0-0 (-> *math-camera* inv-camera-rot)) (a1-1 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) ) (set-vector! a1-1 0.612 0.5 -0.612 0.0) (set-vector! s1-0 -0.696 0.174 0.696 0.0) - (vector-matrix*! (the-as vector (-> s3-0 title-light-group)) a1-1 s0-0) - (vector-matrix*! (the-as vector (-> s3-0 title-light-group dir1)) s1-0 s0-0) + (vector-matrix*! (the-as vector (-> tod title-light-group)) a1-1 s0-0) + (vector-matrix*! (the-as vector (-> tod title-light-group dir1)) s1-0 s0-0) ) (set-vector! (-> *time-of-day-context* current-shadow) 0.612 -0.5 -0.612 1.0) ) - (vu-lights<-light-group! s2-0 (-> s3-0 title-light-group)) + (vu-lights<-light-group! vu-lgt (-> tod title-light-group)) ) (else - (let ((f28-0 (-> arg1 secondary-interp)) - (f30-0 (-> arg1 current-secondary-interp)) - (v1-17 (-> arg1 shadow-mask)) - (a0-10 (-> arg1 level-index)) - (s0-1 (-> s3-0 light-group (-> *target* draw light-index))) - (s1-1 (new 'stack-no-clear 'light-group)) + (let ((interp (-> arg1 secondary-interp)) + (cur-interp (-> arg1 current-secondary-interp)) + (shadow-msk (-> arg1 shadow-mask)) + (lev-idx (-> arg1 level-index)) + (lgt (-> tod light-group (-> *target* draw light-index))) + (cur-lgt (new 'stack-no-clear 'light-group)) ) (cond ((= (-> arg1 light-index) 255) ) - ((= a0-10 2) - (set! s0-1 (-> s3-0 light-group (-> arg1 light-index))) + ((= lev-idx 2) + (set! lgt (-> tod light-group (-> arg1 light-index))) ) (else - (set! s0-1 (-> s3-0 moods a0-10 light-group (-> arg1 light-index))) + (set! lgt (-> tod moods lev-idx light-group (-> arg1 light-index))) ) ) - (when (not (or (= a0-10 2) (zero? v1-17))) - (let* ((a1-22 (-> s3-0 light-masks-0 a0-10)) - (a2-14 (-> s3-0 light-masks-1 a0-10)) - (f26-0 (-> s3-0 light-interp a0-10)) - (a0-13 (logand a1-22 v1-17)) - (v1-18 (logand a2-14 v1-17)) + (when (not (or (= lev-idx 2) (zero? shadow-msk))) + (let* ((lgt-msk-0 (-> tod light-masks-0 lev-idx)) + (lgt-msk-1 (-> tod light-masks-1 lev-idx)) + (lgt-interp (-> tod light-interp lev-idx)) + (a0-13 (logand lgt-msk-0 shadow-msk)) + (v1-18 (logand lgt-msk-1 shadow-msk)) ) (cond ((and (zero? a0-13) (zero? v1-18)) ) (else - (set! f28-0 (cond - ((and (nonzero? a0-13) (nonzero? v1-18)) - 1.0 - ) - ((zero? a0-13) - (quad-copy! (the-as pointer s1-1) (the-as pointer s0-1) 12) - (set! s0-1 s1-1) - (set! (-> s0-1 dir1 levels x) 0.0) - f26-0 - ) - (else - (quad-copy! (the-as pointer s1-1) (the-as pointer s0-1) 12) - (set! s0-1 s1-1) - (set! (-> s0-1 dir0 levels x) 0.0) - (- 1.0 f26-0) + (set! interp (cond + ((and (nonzero? a0-13) (nonzero? v1-18)) + 1.0 ) - ) + ((zero? a0-13) + (quad-copy! (the-as pointer cur-lgt) (the-as pointer lgt) 12) + (set! lgt cur-lgt) + (set! (-> lgt dir1 levels x) 0.0) + lgt-interp + ) + (else + (quad-copy! (the-as pointer cur-lgt) (the-as pointer lgt) 12) + (set! lgt cur-lgt) + (set! (-> lgt dir0 levels x) 0.0) + (- 1.0 lgt-interp) + ) + ) ) ) ) ) ) (if *teleport* - (set! f30-0 f28-0) + (set! cur-interp interp) ) - (when (not (or (paused?) (= f28-0 f30-0))) - (let ((f0-15 (- f30-0 f28-0))) - (set! f30-0 (cond - ((< (fabs f0-15) 0.2) - f28-0 - ) - ((< f0-15 0.0) - (+ 0.2 f30-0) - ) - (else - (+ -0.2 f30-0) - ) - ) + (when (not (or (paused?) (= interp cur-interp))) + (let ((f0-15 (- cur-interp interp))) + (set! cur-interp (cond + ((< (fabs f0-15) 0.2) + interp + ) + ((< f0-15 0.0) + (+ 0.2 cur-interp) + ) + (else + (+ -0.2 cur-interp) + ) + ) ) ) - (set! (-> arg1 current-secondary-interp) f30-0) + (set! (-> arg1 current-secondary-interp) cur-interp) ) (cond - ((= f30-0 0.0) - (vu-lights<-light-group! s2-0 s0-1) + ((= cur-interp 0.0) + (vu-lights<-light-group! vu-lgt lgt) ) (else - (if (!= s0-1 s1-1) - (quad-copy! (the-as pointer s1-1) (the-as pointer s0-1) 12) + (if (!= lgt cur-lgt) + (quad-copy! (the-as pointer cur-lgt) (the-as pointer lgt) 12) ) - (let ((f0-20 (- 1.0 f30-0))) - (set! (-> s1-1 dir0 levels x) (* (-> s1-1 dir0 levels x) f0-20)) - (set! (-> s1-1 dir0 levels y) (* (-> s1-1 dir0 levels y) f0-20)) - (set! (-> s1-1 dir1 levels x) (* (-> s1-1 dir1 levels x) f0-20)) - (set! (-> s1-1 dir1 levels y) (* (-> s1-1 dir1 levels y) f0-20)) - (set! (-> s1-1 dir2 levels x) (* (-> s1-1 dir2 levels x) f0-20)) - (set! (-> s1-1 dir2 levels y) (* (-> s1-1 dir2 levels y) f0-20)) + (let ((f0-20 (- 1.0 cur-interp))) + (set! (-> cur-lgt dir0 levels x) (* (-> cur-lgt dir0 levels x) f0-20)) + (set! (-> cur-lgt dir0 levels y) (* (-> cur-lgt dir0 levels y) f0-20)) + (set! (-> cur-lgt dir1 levels x) (* (-> cur-lgt dir1 levels x) f0-20)) + (set! (-> cur-lgt dir1 levels y) (* (-> cur-lgt dir1 levels y) f0-20)) + (set! (-> cur-lgt dir2 levels x) (* (-> cur-lgt dir2 levels x) f0-20)) + (set! (-> cur-lgt dir2 levels y) (* (-> cur-lgt dir2 levels y) f0-20)) ) - (vu-lights<-light-group! s2-0 s1-1) + (vu-lights<-light-group! vu-lgt cur-lgt) ) ) ) - (.lvf vf2 (&-> s2-0 color 0 quad)) - (.lvf vf3 (&-> s2-0 color 1 quad)) - (.lvf vf4 (&-> s2-0 color 2 quad)) - (.lvf vf5 (&-> s2-0 ambient quad)) + (.lvf vf2 (&-> vu-lgt color 0 quad)) + (.lvf vf3 (&-> vu-lgt color 1 quad)) + (.lvf vf4 (&-> vu-lgt color 2 quad)) + (.lvf vf5 (&-> vu-lgt ambient quad)) (.mul.vf vf5 vf5 vf28) (.mul.vf vf2 vf2 vf28) (.mul.vf vf3 vf3 vf28) (.mul.vf vf4 vf4 vf28) (.add.vf vf5 vf5 vf29) - (.svf (&-> s2-0 color 0 quad) vf2) - (.svf (&-> s2-0 color 1 quad) vf3) - (.svf (&-> s2-0 color 2 quad) vf4) - (.svf (&-> s2-0 ambient quad) vf5) + (.svf (&-> vu-lgt color 0 quad) vf2) + (.svf (&-> vu-lgt color 1 quad) vf3) + (.svf (&-> vu-lgt color 2 quad) vf4) + (.svf (&-> vu-lgt ambient quad) vf5) (.mov v1-37 vf5) ) ) (if *display-lights* - (add-debug-lights #t (bucket-id debug) (the-as (inline-array light) (-> s3-0 light-group)) (-> arg1 origin)) + (add-debug-lights #t (bucket-id debug) (the-as (inline-array light) (-> tod light-group)) (-> arg1 origin)) ) (let ((at-0 *math-camera*)) (.lvf vf16 (&-> at-0 plane 0 quad)) diff --git a/test/decompiler/reference/engine/game/collectables_REF.gc b/test/decompiler/reference/engine/game/collectables_REF.gc index 8060476d85..f37e8a23d1 100644 --- a/test/decompiler/reference/engine/game/collectables_REF.gc +++ b/test/decompiler/reference/engine/game/collectables_REF.gc @@ -445,7 +445,7 @@ :virtual #t :code (behavior () (if (type-type? (-> self type) fuel-cell) - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") ) (logclear! (-> self mask) (process-mask actor-pause)) (let ((gp-1 (new 'stack 'trajectory))) @@ -807,13 +807,13 @@ ) (case (-> self fact pickup-type) (((pickup-type eco-yellow)) - (sound-play-by-name (static-sound-name "y-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "y-eco-pickup") ) (((pickup-type eco-red)) - (sound-play-by-name (static-sound-name "r-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "r-eco-pickup") ) (((pickup-type eco-blue)) - (sound-play-by-name (static-sound-name "b-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "b-eco-pickup") (case (-> (level-get-target-inside *level*) name) (('training) (level-hint-spawn @@ -827,10 +827,10 @@ ) ) (((pickup-type eco-green)) - (sound-play-by-name (static-sound-name "g-eco-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "g-eco-pickup") ) (((pickup-type eco-green) (pickup-type eco-pill)) - (sound-play-by-name (static-sound-name "pill-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "pill-pickup") ) ) (if (nonzero? (-> self part)) @@ -1733,7 +1733,7 @@ ) :code (behavior ((arg0 object) (arg1 handle)) (local-vars (sv-96 res-tag)) - (sound-play-by-name (static-sound-name "pu-powercell") (new-sound-id) 1024 0 0 1 #t) + (sound-play "pu-powercell") (clear-collide-with-as (-> self root-override)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) @@ -2259,7 +2259,7 @@ (initialize-params self 0 (the-as float 1024.0)) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self actor-pause) #f) - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (go fuel-cell-clone-anim arg0) (none) ) @@ -2354,7 +2354,7 @@ :code (behavior ((arg0 object) (arg1 handle)) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status complete) #t) - (sound-play-by-name (static-sound-name "buzzer-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "buzzer-pickup") (case (-> (level-get-target-inside *level*) name) (('training) (level-hint-spawn diff --git a/test/decompiler/reference/engine/game/crates_REF.gc b/test/decompiler/reference/engine/game/crates_REF.gc index 01c3fc2c27..e7622401f0 100644 --- a/test/decompiler/reference/engine/game/crates_REF.gc +++ b/test/decompiler/reference/engine/game/crates_REF.gc @@ -537,7 +537,7 @@ (('iron) (case (-> arg3 param 1) (('flop 'uppercut 'explode 'darkeco 'eco-yellow 'bonk 'racer 'tube 'flut-bonk 'flut-attack) - (if (and (logtest? (-> self fact options) (fact-options rqeuire-zoomer)) + (if (and (logtest? (-> self fact options) (fact-options require-zoomer)) *target* (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-9))) ) @@ -576,7 +576,7 @@ ) (set! (-> self incomming-attack-id) s4-0) (if (not (!= (-> self smush amp) 0.0)) - (sound-play-by-name (static-sound-name "icrate-nobreak") (new-sound-id) 1024 0 0 1 #t) + (sound-play "icrate-nobreak") ) (activate! (-> self smush) 0.1 90 150 1.0 1.0) (go-virtual bounce-on) @@ -619,7 +619,7 @@ ) (set! (-> self incomming-attack-id) s4-0) (if (not (!= (-> self smush amp) 0.0)) - (sound-play-by-name (static-sound-name "scrate-nobreak") (new-sound-id) 1024 0 0 1 #t) + (sound-play "scrate-nobreak") ) (activate! (-> self smush) 0.1 90 150 1.0 1.0) (go-virtual bounce-on) @@ -887,16 +887,16 @@ (logior! (-> self draw status) (draw-status hidden)) (case (-> self look) (('iron) - (sound-play-by-name (static-sound-name "icrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "icrate-break") ) (('steel) - (sound-play-by-name (static-sound-name "scrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "scrate-break") ) (('darkeco) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") ) (else - (sound-play-by-name (static-sound-name "wcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "wcrate-break") ) ) (case (-> self defense) @@ -1394,7 +1394,7 @@ (logior! (-> self mask) (process-mask sleep-code)) (suspend) (let ((f30-0 57001.605)) - (sound-play-by-name (static-sound-name "crate-jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "crate-jump") (while (or (!= (-> self smush amp) 0.0) (!= f30-0 0.0)) (+! f30-0 (* -245760.0 (-> *display* seconds-per-frame))) (+! (-> self root-override trans y) (* f30-0 (-> *display* seconds-per-frame))) diff --git a/test/decompiler/reference/engine/game/effect-control_REF.gc b/test/decompiler/reference/engine/game/effect-control_REF.gc index 3009beaf22..1edd56fa3e 100644 --- a/test/decompiler/reference/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/engine/game/effect-control_REF.gc @@ -1151,7 +1151,7 @@ ) 0 0 - 1 + (sound-group sfx) #t ) ) diff --git a/test/decompiler/reference/engine/game/game-info_REF.gc b/test/decompiler/reference/engine/game/game-info_REF.gc index 37307d1008..8312720c32 100644 --- a/test/decompiler/reference/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/engine/game/game-info_REF.gc @@ -450,7 +450,7 @@ (if (or (!= (handle->process source-handle) (handle->process (-> obj eco-source))) (>= (- (-> *display* base-frame-counter) (-> obj eco-source-time)) (seconds 0.5)) ) - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-green-eco") ) (when (handle->process source-handle) (set! (-> obj eco-source) source-handle) @@ -506,7 +506,7 @@ (((pickup-type money)) (when (< 0.0 amount) (if (>= (- (-> *display* base-frame-counter) (-> obj money-pickup-time)) (seconds 0.05)) - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "money-pickup") ) (set! (-> obj money-pickup-time) (-> *display* base-frame-counter)) ) @@ -581,16 +581,16 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 17 (seconds 0.2)) (case kind (((pickup-type eco-blue)) - (sound-play-by-name (static-sound-name "get-blue-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-blue-eco") ) (((pickup-type eco-green)) - (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-green-eco") ) (((pickup-type eco-yellow)) - (sound-play-by-name (static-sound-name "get-yellow-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-yellow-eco") ) (((pickup-type eco-red)) - (sound-play-by-name (static-sound-name "get-red-eco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-red-eco") ) ) ) diff --git a/test/decompiler/reference/engine/game/generic-obs_REF.gc b/test/decompiler/reference/engine/game/generic-obs_REF.gc index bb247d9a28..5e7c93b05e 100644 --- a/test/decompiler/reference/engine/game/generic-obs_REF.gc +++ b/test/decompiler/reference/engine/game/generic-obs_REF.gc @@ -2081,7 +2081,7 @@ (go launcher-idle) ) (spawn (-> self part) (-> self root-override trans)) - (sound-play-by-name (static-sound-name "launch-idle") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "launch-idle" :id (-> self sound-id)) (if (and (and *target* (>= (+ 2867.2 (-> self root-override root-prim prim-core world-sphere w)) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -2093,7 +2093,7 @@ (none) ) :code (behavior () - (sound-play-by-name (static-sound-name "launch-start") (new-sound-id) 1024 0 0 1 #t) + (sound-play "launch-start") (anim-loop) (none) ) diff --git a/test/decompiler/reference/engine/game/main_REF.gc b/test/decompiler/reference/engine/game/main_REF.gc index 9b5332fc59..8508036b19 100644 --- a/test/decompiler/reference/engine/game/main_REF.gc +++ b/test/decompiler/reference/engine/game/main_REF.gc @@ -101,7 +101,7 @@ ) (logclear! (-> *setting-control* default process-mask) (process-mask menu)) (set! *pause-lock* #f) - (sound-group-pause (the-as uint 255)) + (sound-group-pause (sound-group sfx music dialog sog3 ambient sog5 sog6 sog7)) (hide-progress-screen) ) (('menu) @@ -121,7 +121,7 @@ ) (('game) (logclear! (-> *setting-control* default process-mask) (process-mask pause menu)) - (sound-group-continue (the-as uint 255)) + (sound-group-continue (sound-group sfx music dialog sog3 ambient sog5 sog6 sog7)) (hide-progress-screen) ) ) @@ -439,8 +439,8 @@ (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons r1)) (set! *cheat-mode* (not *cheat-mode*)) (if *cheat-mode* - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") + (sound-play "cursor-options") ) (set! (-> *cheat-temp* 0) 0) 0 @@ -612,8 +612,8 @@ ) ) (if *cheat-mode* - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") + (sound-play "cursor-options") ) (set! (-> *cheat-temp* 1) 0) 0 @@ -721,8 +721,8 @@ ) ) (if *progress-cheat* - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") + (sound-play "cursor-options") ) (set! (-> *cheat-temp* 2) 0) 0 @@ -830,8 +830,8 @@ ) ) (if *progress-cheat* - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") + (sound-play "cursor-options") ) (set! (-> *cheat-temp* 3) 0) 0 diff --git a/test/decompiler/reference/engine/game/powerups_REF.gc b/test/decompiler/reference/engine/game/powerups_REF.gc index 7f06ddd791..2e61adb28e 100644 --- a/test/decompiler/reference/engine/game/powerups_REF.gc +++ b/test/decompiler/reference/engine/game/powerups_REF.gc @@ -623,14 +623,12 @@ (let ((f30-0 (-> self control unknown-float141)) (f0-13 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 81920.0)) ) - (sound-play-by-name - (static-sound-name "ice-loop") - (-> self control unknown-soundid00) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f0-13)) - 0 - 1 - (the-as symbol (-> self control trans)) + (sound-play + "ice-loop" + :id (-> self control unknown-soundid00) + :vol f30-0 + :pitch f0-13 + :position (the-as symbol (-> self control trans)) ) ) ) diff --git a/test/decompiler/reference/engine/game/projectiles_REF.gc b/test/decompiler/reference/engine/game/projectiles_REF.gc index 8326277e0e..85fc14a000 100644 --- a/test/decompiler/reference/engine/game/projectiles_REF.gc +++ b/test/decompiler/reference/engine/game/projectiles_REF.gc @@ -807,7 +807,7 @@ (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "yellow-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "yellow-explode") (suspend) (go-virtual projectile-die) (none) @@ -832,7 +832,7 @@ (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "yellow-fizzle") (new-sound-id) 1024 0 0 1 #t) + (sound-play "yellow-fizzle") (suspend) (go-virtual projectile-die) (none) @@ -980,8 +980,8 @@ (set! (-> *part-id-table* 358 init-specs 11 initial-valuef) (the float (sar (shl (the int (+ -16384.0 f30-0)) 48) 48)) ) - (sound-play-by-name (static-sound-name "yellow-fire") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj sound-id) (sound-play-by-name (static-sound-name "yellow-buzz") (new-sound-id) 1024 0 0 1 #t)) + (sound-play "yellow-fire") + (set! (-> obj sound-id) (sound-play "yellow-buzz")) (if (zero? (logand (-> obj options) 416)) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 103) -1 #f #f #f s5-0 :to obj) ) @@ -1175,7 +1175,7 @@ ;; Used lq/sq (defmethod dummy-27 projectile-blue ((obj projectile-blue)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (sound-play-by-name (static-sound-name "blue-eco-on") (new-sound-id) 1024 0 0 1 #t) + (sound-play "blue-eco-on") (set! (-> obj mode) 2) (set! (-> obj max-speed) (-> *TARGET-bank* yellow-projectile-speed)) (set! (-> obj update-velocity) projectile-update-velocity-space-wars) diff --git a/test/decompiler/reference/engine/game/settings_REF.gc b/test/decompiler/reference/engine/game/settings_REF.gc index 6161724b93..ef48fb637a 100644 --- a/test/decompiler/reference/engine/game/settings_REF.gc +++ b/test/decompiler/reference/engine/game/settings_REF.gc @@ -270,19 +270,19 @@ (when *sound-player-enable* (when (!= (-> gp-0 sfx-volume) (-> s5-1 sfx-volume)) (seek! (-> gp-0 sfx-volume) (-> s5-1 sfx-volume) (* 100.0 (-> *display* seconds-per-frame))) - (sound-set-volume (the-as uint 1) (-> gp-0 sfx-volume)) + (sound-set-volume (sound-group sfx) (-> gp-0 sfx-volume)) ) (when (!= (-> gp-0 music-volume) (-> s5-1 music-volume)) (seek! (-> gp-0 music-volume) (-> s5-1 music-volume) (* 100.0 (-> *display* seconds-per-frame))) - (sound-set-volume (the-as uint 2) (-> gp-0 music-volume)) + (sound-set-volume (sound-group music) (-> gp-0 music-volume)) ) (when (!= (-> gp-0 dialog-volume) (-> s5-1 dialog-volume)) (seek! (-> gp-0 dialog-volume) (-> s5-1 dialog-volume) (* 100.0 (-> *display* seconds-per-frame))) - (sound-set-volume (the-as uint 4) (-> gp-0 dialog-volume)) + (sound-set-volume (sound-group dialog) (-> gp-0 dialog-volume)) ) (when (!= (-> gp-0 ambient-volume) (-> s5-1 ambient-volume)) (seek! (-> gp-0 ambient-volume) (-> s5-1 ambient-volume) (* 100.0 (-> *display* seconds-per-frame))) - (sound-set-volume (the-as uint 16) (-> gp-0 ambient-volume)) + (sound-set-volume (sound-group ambient) (-> gp-0 ambient-volume)) ) ) (when (!= (-> gp-0 language) (-> s5-1 language)) diff --git a/test/decompiler/reference/engine/gfx/water/water_REF.gc b/test/decompiler/reference/engine/gfx/water/water_REF.gc index 50cb881e27..2ab80cdf12 100644 --- a/test/decompiler/reference/engine/gfx/water/water_REF.gc +++ b/test/decompiler/reference/engine/gfx/water/water_REF.gc @@ -49,7 +49,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! s5-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 (the-as symbol s5-0)) + (sound-play "water-drop" :position (the-as symbol s5-0)) (sp-launch-particles-var *sp-particle-system-3d* (-> *part-id-table* 108) diff --git a/test/decompiler/reference/engine/sound/gsound-h_REF.gc b/test/decompiler/reference/engine/sound/gsound-h_REF.gc index 7a26b9494a..23a4788c30 100644 --- a/test/decompiler/reference/engine/sound/gsound-h_REF.gc +++ b/test/decompiler/reference/engine/sound/gsound-h_REF.gc @@ -50,16 +50,16 @@ ;; definition of type sound-play-parms (deftype sound-play-parms (structure) - ((mask sound-mask :offset-assert 0) - (pitch-mod int16 :offset-assert 2) - (bend int16 :offset-assert 4) - (fo-min int16 :offset-assert 6) - (fo-max int16 :offset-assert 8) - (fo-curve int8 :offset-assert 10) - (priority int8 :offset-assert 11) - (volume int32 :offset-assert 12) - (trans vector3w :inline :offset-assert 16) - (group uint8 :offset-assert 28) + ((mask sound-mask :offset-assert 0) + (pitch-mod int16 :offset-assert 2) + (bend int16 :offset-assert 4) + (fo-min int16 :offset-assert 6) + (fo-max int16 :offset-assert 8) + (fo-curve int8 :offset-assert 10) + (priority int8 :offset-assert 11) + (volume int32 :offset-assert 12) + (trans vector3w :inline :offset-assert 16) + (group sound-group :offset-assert 28) ) :pack-me :method-count-assert 9 @@ -122,7 +122,7 @@ ;; definition of type sound-rpc-group-cmd (deftype sound-rpc-group-cmd (sound-rpc-cmd) - ((group uint8 :offset-assert 4) + ((group sound-group :offset-assert 4) ) :method-count-assert 9 :size-assert #x5 @@ -636,21 +636,21 @@ ;; definition of type sound-spec (deftype sound-spec (basic) - ((mask sound-mask :offset-assert 4) - (num float :offset-assert 8) - (group uint8 :offset-assert 12) - (sound-name sound-name :offset 16) - (sound-name-char uint8 16 :offset 16) - (trans float 4 :offset-assert 32) - (volume int32 :offset-assert 48) - (pitch-mod int32 :offset-assert 52) - (bend int32 :offset-assert 56) - (fo-min int16 :offset-assert 60) - (fo-max int16 :offset-assert 62) - (fo-curve int8 :offset-assert 64) - (priority int8 :offset-assert 65) - (auto-time int32 :offset-assert 68) - (auto-from int32 :offset-assert 72) + ((mask sound-mask :offset-assert 4) + (num float :offset-assert 8) + (group sound-group :offset-assert 12) + (sound-name-char uint8 16 :offset 16) + (sound-name sound-name :offset 16) + (trans float 4 :offset-assert 32) + (volume int32 :offset-assert 48) + (pitch-mod int32 :offset-assert 52) + (bend int32 :offset-assert 56) + (fo-min int16 :offset-assert 60) + (fo-max int16 :offset-assert 62) + (fo-curve int8 :offset-assert 64) + (priority int8 :offset-assert 65) + (auto-time int32 :offset-assert 68) + (auto-from int32 :offset-assert 72) ) :method-count-assert 9 :size-assert #x4c diff --git a/test/decompiler/reference/engine/sound/gsound_REF.gc b/test/decompiler/reference/engine/sound/gsound_REF.gc index e05e41167d..c079d8deb4 100644 --- a/test/decompiler/reference/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/engine/sound/gsound_REF.gc @@ -406,7 +406,7 @@ ) ;; definition for function sound-set-volume -(defun sound-set-volume ((arg0 uint) (arg1 float)) +(defun sound-set-volume ((arg0 sound-group) (arg1 float)) (let ((cmd (the-as sound-rpc-set-master-volume (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command set-master-volume)) (set! (-> cmd group) arg0) @@ -440,8 +440,8 @@ ;; definition for function sound-play-by-name ;; Used lq/sq -(defun sound-play-by-name ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group int) (trans symbol)) - (local-vars (sv-16 int)) +(defun sound-play-by-name ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group sound-group) (trans symbol)) + (local-vars (sv-16 sound-group)) (with-pp (set! sv-16 group) (let ((sound-trans (the-as structure trans))) @@ -451,7 +451,7 @@ (set! (-> cmd id) id) (set! (-> cmd name) name) (set! (-> cmd parms mask) (sound-mask)) - (set! (-> cmd parms group) (the-as uint sv-16)) + (set! (-> cmd parms group) sv-16) (set! (-> cmd parms volume) vol) (set! (-> cmd parms pitch-mod) pitch) (set! (-> cmd parms bend) bend) @@ -532,7 +532,7 @@ ) ;; definition for function sound-group-pause -(defun sound-group-pause ((arg0 uint)) +(defun sound-group-pause ((arg0 sound-group)) (let ((cmd (the-as sound-rpc-pause-group (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command pause-group)) (set! (-> cmd group) arg0) @@ -541,7 +541,7 @@ ) ;; definition for function sound-group-stop -(defun sound-group-stop ((arg0 uint)) +(defun sound-group-stop ((arg0 sound-group)) (let ((cmd (the-as sound-rpc-stop-group (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command stop-group)) (set! (-> cmd group) arg0) @@ -550,7 +550,7 @@ ) ;; definition for function sound-group-continue -(defun sound-group-continue ((arg0 uint)) +(defun sound-group-continue ((arg0 sound-group)) (let ((cmd (the-as sound-rpc-continue-group (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command continue-group)) (set! (-> cmd group) arg0) @@ -770,7 +770,7 @@ (-> obj volume) (-> obj pitch) 0 - 1 + (sound-group sfx) (the-as symbol (-> obj trans)) ) ) @@ -784,7 +784,7 @@ (-> obj volume) (-> obj pitch) 0 - 1 + (sound-group sfx) (the-as symbol (-> obj trans)) ) ) diff --git a/test/decompiler/reference/engine/target/target-death_REF.gc b/test/decompiler/reference/engine/target/target-death_REF.gc index 3b5c1f421f..0cd02afaf1 100644 --- a/test/decompiler/reference/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/engine/target/target-death_REF.gc @@ -590,10 +590,10 @@ (= v1-13 'up) ) ) - (sound-play-by-name (static-sound-name "hit-up") (new-sound-id) 1024 0 0 1 #t) + (sound-play "hit-up") ) (else - (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + (sound-play "oof") ) ) ) @@ -602,7 +602,7 @@ (process-spawn-function process process-drawable-burn-effect 1200 :to self) ) (('tar) - (sound-play-by-name (static-sound-name "get-burned") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-burned") ) ) 0 @@ -743,7 +743,7 @@ (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! eichar-jump-ja :num! (seek!) :frame-num 0.0) (when (= (-> arg0 angle) 'air) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (sound-play "smack-surface") (dummy-10 (-> self skel effect) 'group-smack-surface (the-as float 0.0) 5) (dummy-10 (-> self skel effect) 'group-smack-surface-dizzy (the-as float 0.0) 8) ) @@ -751,7 +751,7 @@ (('shove) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! eichar-smack-surface-ja :num! (seek!) :frame-num 0.0) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (sound-play "smack-surface") ) (else (when (not (ja-group? eichar-hit-from-front-ja)) @@ -1092,7 +1092,7 @@ ) ) (('drown 'drown-death) - (sound-play-by-name (static-sound-name "death-drown") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-drown") (logclear! (-> self water flags) (water-flags wt04)) (clear-collide-with-as (-> self control)) (set! (-> self control unknown-surface00) *dive-mods*) @@ -1131,7 +1131,7 @@ ) (cond ((= arg0 'dark-eco-pool) - (sound-play-by-name (static-sound-name "death-darkeco") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-darkeco") (process-spawn part-tracker :init part-tracker-init @@ -1145,7 +1145,7 @@ ) ) ((or (= arg0 'lava) (= arg0 'melt)) - (sound-play-by-name (static-sound-name "death-melt") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-melt") (process-spawn part-tracker :init part-tracker-init @@ -1170,7 +1170,7 @@ ) ) (('endlessfall) - (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-fall") (camera-change-to (the-as string cam-endlessfall) 30 #f) (set! (-> self control pat-ignore-mask unknown-bit) 1) (logclear! (-> self water flags) (water-flags wt04)) @@ -1307,7 +1307,7 @@ (else (case arg0 (('tar) - (sound-play-by-name (static-sound-name "death-drown") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-drown") ) ) (+! (-> *game-info* death-movie-tick) 1) diff --git a/test/decompiler/reference/engine/target/target-handler_REF.gc b/test/decompiler/reference/engine/target/target-handler_REF.gc index 6e2d96719e..51b01c8f6a 100644 --- a/test/decompiler/reference/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/engine/target/target-handler_REF.gc @@ -424,7 +424,7 @@ self ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.5)) - (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + (sound-play "oof") #t ) (else @@ -1029,7 +1029,7 @@ #f ) ((= arg2 'jump) - (sound-play-by-name (static-sound-name "jump-long") (new-sound-id) 1024 0 0 1 #t) + (sound-play "jump-long") (go target-jump (the-as float (-> arg3 param 0)) diff --git a/test/decompiler/reference/engine/target/target-part_REF.gc b/test/decompiler/reference/engine/target/target-part_REF.gc index 55ab2b15f1..1c4631d9e7 100644 --- a/test/decompiler/reference/engine/target/target-part_REF.gc +++ b/test/decompiler/reference/engine/target/target-part_REF.gc @@ -2269,7 +2269,7 @@ ;; definition for function process-drawable-burn-effect ;; Used lq/sq (defbehavior process-drawable-burn-effect target ((arg0 time-frame)) - (sound-play-by-name (static-sound-name "get-burned") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-burned") (let ((s5-1 (new 'stack 'rgbaf)) (s3-0 (-> *display* base-frame-counter)) (s4-1 (-> self parent)) diff --git a/test/decompiler/reference/engine/target/target2_REF.gc b/test/decompiler/reference/engine/target/target2_REF.gc index b75413cd5d..9a6de8309e 100644 --- a/test/decompiler/reference/engine/target/target2_REF.gc +++ b/test/decompiler/reference/engine/target/target2_REF.gc @@ -1092,7 +1092,7 @@ (none) ) :code (behavior ((arg0 float) (arg1 float)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "jump") (send-event *camera* 'damp-up) (ja :group! (-> self draw art-group data 83) :num! min) (let ((f0-1 (target-height-above-ground)) @@ -1151,7 +1151,7 @@ (none) ) :code (behavior ((arg0 float) (arg1 float)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "jump") (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -1734,7 +1734,7 @@ (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) - (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) + (sound-play "swim-stroke") (dummy-13 (-> self water) (the-as float 1.4) (-> self control trans) 0 (-> self control transv)) (go target-attack) ) @@ -1780,7 +1780,7 @@ (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) - (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) + (sound-play "swim-stroke") (dummy-13 (-> self water) (the-as float 1.4) (-> self control trans) 0 (-> self control transv)) (go target-attack) ) @@ -2730,7 +2730,7 @@ :to self ) ) - (sound-play-by-name (static-sound-name "launch-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "launch-fire") (go target-high-jump arg0 arg0 'launch) (none) ) diff --git a/test/decompiler/reference/engine/target/target_REF.gc b/test/decompiler/reference/engine/target/target_REF.gc index 550f5ddb53..ec4936225d 100644 --- a/test/decompiler/reference/engine/target/target_REF.gc +++ b/test/decompiler/reference/engine/target/target_REF.gc @@ -1421,7 +1421,7 @@ ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 716 0 0 1 #t) + (sound-play "jump" :vol 70) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! arg2 (cond @@ -1657,7 +1657,7 @@ ) (set! (-> self state-time) (-> *display* base-frame-counter)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 457 0 1 #t) + (sound-play "jump" :pitch 0.3) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (set! (-> self control unknown-surface00) (cond ((= arg2 'flip) @@ -1765,7 +1765,7 @@ :event target-jump-event-handler :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 819 -609 0 1 #t) + (sound-play "jump" :vol 80 :pitch -0.4) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (cond @@ -2205,7 +2205,7 @@ ) :code (behavior () (if (logtest? (-> self water flags) (water-flags wt09)) - (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) + (sound-play "swim-stroke") ) (ja-channel-push! 1 (seconds 0.02)) (ja :group! eichar-attack-punch-ja :num! min) diff --git a/test/decompiler/reference/engine/ui/hud-classes_REF.gc b/test/decompiler/reference/engine/ui/hud-classes_REF.gc index 83be9a452f..b11c9b30b7 100644 --- a/test/decompiler/reference/engine/ui/hud-classes_REF.gc +++ b/test/decompiler/reference/engine/ui/hud-classes_REF.gc @@ -728,7 +728,7 @@ ) ) (set! (-> obj start-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "get-all-orbs") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-all-orbs") 0 (none) ) diff --git a/test/decompiler/reference/engine/ui/hud_REF.gc b/test/decompiler/reference/engine/ui/hud_REF.gc index 05820e4875..f50a78c6a6 100644 --- a/test/decompiler/reference/engine/ui/hud_REF.gc +++ b/test/decompiler/reference/engine/ui/hud_REF.gc @@ -74,7 +74,7 @@ (when (and (!= (-> obj value) (-> obj target-value)) (>= (- (-> *display* base-frame-counter) (-> obj last-increment-time)) (seconds 0.1)) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (+! (-> obj value) 1) (set! (-> obj last-increment-time) (-> *display* base-frame-counter)) ) diff --git a/test/decompiler/reference/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/engine/ui/progress/progress_REF.gc index cd0b39e847..31740517b5 100644 --- a/test/decompiler/reference/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/engine/ui/progress/progress_REF.gc @@ -1242,13 +1242,13 @@ (cond ((< (-> obj option-index) 4) (when (nonzero? (-> s5-0 file (-> obj option-index) present)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *progress-state* which) (-> obj option-index)) (set! (-> obj next-display-state) (progress-screen memcard-loading)) ) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1256,7 +1256,7 @@ (((progress-screen save-game) (progress-screen save-game-title)) (cond ((< (-> obj option-index) 4) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *progress-state* which) (-> obj option-index)) (if (zero? (-> s5-0 file (-> obj option-index) present)) (set! (-> obj next-display-state) (progress-screen memcard-saving)) @@ -1264,30 +1264,30 @@ ) ) ((and (= (-> obj display-state) (progress-screen save-game-title)) (= (-> obj option-index) 4)) - (sound-play-by-name (static-sound-name "starts-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "starts-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) ) (((progress-screen memcard-insert)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen memcard-data-exists)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-saving)) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (if (= (-> obj display-state-stack 0) (progress-screen title)) (set! (-> obj next-display-state) (progress-screen save-game-title)) (set! (-> obj next-display-state) (progress-screen save-game)) @@ -1298,11 +1298,11 @@ (((progress-screen memcard-no-data)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-creating)) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") @@ -1316,18 +1316,18 @@ ) (cond ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) ((nonzero? (-> obj display-state-stack 0)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1340,19 +1340,19 @@ (progress-screen memcard-removed) (progress-screen auto-save) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen pal-change-to-60hz)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) (set! (-> obj video-mode-timeout) (-> *display* real-frame-counter)) (set! (-> obj next-display-state) (progress-screen pal-now-60hz)) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> *progress-state* video-mode-choice) 'pal) (set! (-> obj next-display-state) (progress-screen invalid)) ) @@ -1363,30 +1363,30 @@ ((not (-> *progress-state* yes-no-choice)) (set! (-> *progress-state* video-mode-choice) 'pal) (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") ) (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") ) ) (set! (-> obj next-display-state) (progress-screen invalid)) ) (((progress-screen no-disc) (progress-screen bad-disc)) (when (is-cd-in?) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) (((progress-screen quit)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "title-start") ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1394,18 +1394,18 @@ (((progress-screen memcard-format)) (cond ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj next-display-state) (progress-screen memcard-formatting)) ) ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj next-display-state) (progress-screen invalid)) ) ) @@ -1431,7 +1431,7 @@ ((cpad-pressed? 0 up) (when (not (-> obj selected-option)) (if (!= (length s5-0) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") ) (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) (if (> (-> obj option-index) 0) @@ -1454,7 +1454,7 @@ (when v1-34 (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) 1024 0 0 1 #t) + (sound-play "slider2001") ) ) ) @@ -1467,7 +1467,7 @@ ((cpad-pressed? 0 down) (when (not (-> obj selected-option)) (if (!= (length s5-0) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") ) (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) (cond @@ -1495,7 +1495,7 @@ (when v1-69 (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) 1024 0 0 1 #t) + (sound-play "slider2001") ) ) ) @@ -1544,7 +1544,7 @@ ) ) (if s4-5 - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1589,7 +1589,7 @@ ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 f30-0)) 0 0 1 #t) + (sound-play "slider2001" :vol f30-0) ) ) ) @@ -1641,7 +1641,7 @@ ) ) (if v1-217 - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1686,7 +1686,7 @@ ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 f30-1)) 0 0 1 #t) + (sound-play "slider2001" :vol f30-1) ) ) ) @@ -1724,7 +1724,7 @@ ) ) ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (set! (-> obj selected-option) #f) ) ((or (can-go-back? obj) @@ -1737,8 +1737,8 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-stats") + (sound-play "cursor-options") ) (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) (set! (-> obj next-display-state) (progress-screen invalid)) @@ -1755,7 +1755,7 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) (push! obj) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (the-as progress-screen (-> s5-0 (-> obj option-index) param3))) (case (-> obj next-display-state) (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) @@ -1771,8 +1771,8 @@ ) ((= (-> s5-0 (-> obj option-index) name) (game-text-id back)) (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-stats") + (sound-play "cursor-options") ) (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) (set! (-> obj next-display-state) (progress-screen invalid)) @@ -1806,7 +1806,7 @@ ) ) ) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) @@ -1823,7 +1823,7 @@ ) ) (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> obj selected-option) #f) (case (-> s5-0 (-> obj option-index) option-type) (((game-option-type aspect-ratio)) @@ -1869,7 +1869,7 @@ (let ((s5-0 (-> obj display-level-index))) (set! (-> obj next-level-index) (get-next-level-down s5-0)) (when (!= s5-0 (-> obj next-level-index)) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! (-> obj level-transition) 2) ) ) @@ -1878,28 +1878,28 @@ (let ((s5-2 (-> obj next-level-index))) (set! (-> obj next-level-index) (get-next-level-up s5-2)) (when (!= s5-2 (-> obj next-level-index)) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! (-> obj level-transition) 1) ) ) ) ((cpad-pressed? 0 square) (when (nonzero? (-> obj display-state)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen fuel-cell)) (set! (-> obj stat-transition) #t) ) ) ((cpad-pressed? 0 x) (when (!= (-> obj display-state) (progress-screen money)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen money)) (set! (-> obj stat-transition) #t) ) ) ((cpad-pressed? 0 triangle) (when (!= (-> obj display-state) (progress-screen buzzer)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-option") (set! (-> obj next-display-state) (progress-screen buzzer)) (set! (-> obj stat-transition) #t) ) @@ -1907,7 +1907,7 @@ ((cpad-pressed? 0 circle) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (push! obj) (set! (-> obj next-display-state) (progress-screen settings)) ) @@ -1917,7 +1917,7 @@ (let ((s5-8 (-> obj task-index))) (set! (-> obj task-index) (get-next-task-down (-> obj task-index) (-> obj display-level-index))) (if (!= s5-8 (-> obj task-index)) - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -1925,7 +1925,7 @@ (let ((s5-10 (-> obj task-index))) (set! (-> obj task-index) (get-next-task-up (-> obj task-index) (-> obj display-level-index))) (if (!= s5-10 (-> obj task-index)) - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-l-r") ) ) ) @@ -2415,11 +2415,11 @@ (defstate progress-coming-in (progress) :event (-> progress-waiting event) :enter (behavior () - (sound-group-pause (the-as uint 255)) + (sound-group-pause (sound-group sfx music dialog sog3 ambient sog5 sog6 sog7)) (logclear! (-> *setting-control* default process-mask) (process-mask pause menu)) (add-setting! 'process-mask 'set 0.0 (process-mask progress)) (apply-settings *setting-control*) - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) + (sound-play "select-menu") (set-blackout-frames 0) (set! *pause-lock* #f) (none) @@ -2448,7 +2448,7 @@ ;; failed to figure out what this is: (defstate progress-going-out (progress) :enter (behavior () - (sound-play-by-name (static-sound-name "menu-close") (new-sound-id) 1024 0 0 1 #t) + (sound-play "menu-close") (hide-progress-icons) (set! (-> self particles 3 init-pos x) -320.0) (set! (-> self particles 4 init-pos x) -320.0) diff --git a/test/decompiler/reference/levels/beach/beach-obs_REF.gc b/test/decompiler/reference/levels/beach/beach-obs_REF.gc index 26f34a94f9..91b6f6235a 100644 --- a/test/decompiler/reference/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/levels/beach/beach-obs_REF.gc @@ -57,7 +57,7 @@ (rider-trans) (let ((t2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4)))) (if (!= (+ (-> t2-0 x) (-> t2-0 y) (-> t2-0 z)) 0.0) - (sound-play-by-name (static-sound-name "gears-rumble") (-> self sound-id) 1024 0 0 1 (the-as symbol t2-0)) + (sound-play "gears-rumble" :id (-> self sound-id) :position (the-as symbol t2-0)) ) ) (none) @@ -259,8 +259,8 @@ (the-as uint 2) ) ) - (sound-play-by-name (static-sound-name "grotto-pole-hit") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "dirt-crumble") (new-sound-id) 1024 0 0 1 #t) + (sound-play "grotto-pole-hit") + (sound-play "dirt-crumble") (increment-success-for-hint (game-text-id beach-grottopole-increment)) (go grottopole-moving-up) ) @@ -274,8 +274,8 @@ (the-as uint 1) ) ) - (sound-play-by-name (static-sound-name "grotto-pole-hit") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "dirt-crumble") (new-sound-id) 1024 0 0 1 #t) + (sound-play "grotto-pole-hit") + (sound-play "dirt-crumble") (go grottopole-moving-down) ) ) @@ -601,7 +601,7 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) - (sound-play-by-name (static-sound-name "cannon-shot") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cannon-shot") (increment-success-for-hint (game-text-id beach-eco-rock-increment)) (go ecoventrock-break #f) ) @@ -1125,7 +1125,7 @@ ;; definition for function flutflutegg-hit-sounds ;; INFO: Return type mismatch int vs none. (defbehavior flutflutegg-hit-sounds flutflutegg () - (sound-play-by-name (static-sound-name "egg-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "egg-hit") (cond ((not (task-closed? (game-task beach-flutflut) (task-status need-introduction))) ) @@ -1355,7 +1355,7 @@ ) ) ) - (sound-play-by-name (static-sound-name "sack-land") (new-sound-id) 2048 0 0 1 #t) + (sound-play "sack-land" :vol 200) (go flutflutegg-break #f) ) (none) diff --git a/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc b/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc index 19cc61200c..23794ed792 100644 --- a/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc +++ b/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc @@ -75,7 +75,7 @@ nav-enemy-default-event-handler (let ((f30-0 (rand-vu-float-range 0.9 1.1))) (loop (if (rand-vu-percent? 0.25) - (sound-play-by-name (static-sound-name "puppy-bark") (new-sound-id) 1024 0 0 1 #t) + (sound-play "puppy-bark") ) (ja-no-eval :group! lurkerpuppy-run-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -179,7 +179,7 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :code (behavior () - (sound-play-by-name (static-sound-name "head-butt") (new-sound-id) 1024 0 0 1 #t) + (sound-play "head-butt") (go-virtual nav-enemy-victory) (none) ) diff --git a/test/decompiler/reference/levels/beach/lurkerworm_REF.gc b/test/decompiler/reference/levels/beach/lurkerworm_REF.gc index ccd5aaf959..1690fc68fc 100644 --- a/test/decompiler/reference/levels/beach/lurkerworm_REF.gc +++ b/test/decompiler/reference/levels/beach/lurkerworm_REF.gc @@ -375,7 +375,7 @@ lurkerworm-default-post-behavior :event lurkerworm-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "worm-rise1") (new-sound-id) 1024 0 0 1 #t) + (sound-play "worm-rise1") (none) ) :code (behavior () diff --git a/test/decompiler/reference/levels/beach/pelican_REF.gc b/test/decompiler/reference/levels/beach/pelican_REF.gc index 0d83654a23..6b11c1319b 100644 --- a/test/decompiler/reference/levels/beach/pelican_REF.gc +++ b/test/decompiler/reference/levels/beach/pelican_REF.gc @@ -868,7 +868,7 @@ (set! (-> v1-2 user-int8 0) 5) ) (when (not arg0) - (sound-play-by-name (static-sound-name "scrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "scrate-break") (process-spawn part-tracker :init part-tracker-init diff --git a/test/decompiler/reference/levels/beach/seagull_REF.gc b/test/decompiler/reference/levels/beach/seagull_REF.gc index 530ee24b4d..3850b8ac21 100644 --- a/test/decompiler/reference/levels/beach/seagull_REF.gc +++ b/test/decompiler/reference/levels/beach/seagull_REF.gc @@ -1329,7 +1329,7 @@ (if (>= (-> obj targetnum) 4) (set! (-> obj teleport-frames) 1500) ) - (sound-play-by-name (static-sound-name "seagull-takeoff") (new-sound-id) 1024 0 0 1 #t) + (sound-play "seagull-takeoff") (set! (-> obj alert-time) (-> *display* base-frame-counter)) ) (none) diff --git a/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc b/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc index f776827b33..06025dd6c0 100644 --- a/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc +++ b/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc @@ -959,48 +959,50 @@ (defstate citb-robotboss-idle (citb-robotboss) :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (sv-96 int) (sv-112 int)) - (the-as object (cond - ((= arg2 'shield-off) - (stop! (-> self sound)) - (if (-> self shield-on) - (sound-play-by-name (static-sound-name "robotcage-off") (new-sound-id) 1024 0 0 1 #t) + (the-as + object + (cond + ((= arg2 'shield-off) + (stop! (-> self sound)) + (if (-> self shield-on) + (sound-play "robotcage-off") + ) + (set! (-> self shield-on) #f) + #f + ) + ((= arg2 'shield-on) + (let ((v0-3 #t)) + (set! (-> self shield-on) v0-3) + v0-3 + ) + ) + ((= arg2 'die) + (cleanup-for-death self) + (the-as symbol (deactivate self)) + ) + ((or (= arg2 'touch) (= arg2 'attack)) + (let ((s4-0 sound-play-by-name) + (s3-0 (make-u128 #x7061 (the-as uint #x7a2d646c65696873))) + (s2-0 (new-sound-id)) + (s1-0 1024) + (s0-0 0) + ) + (set! sv-96 0) + (set! sv-112 1) + (let ((t2-1 (target-pos 0))) + (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-96 (the-as sound-group sv-112) (the-as symbol t2-1)) + ) + ) + (the-as symbol (send-event + arg0 + 'shove + (-> arg3 param 0) + (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) ) - (set! (-> self shield-on) #f) - #f - ) - ((= arg2 'shield-on) - (let ((v0-3 #t)) - (set! (-> self shield-on) v0-3) - v0-3 - ) - ) - ((= arg2 'die) - (cleanup-for-death self) - (the-as symbol (deactivate self)) - ) - ((or (= arg2 'touch) (= arg2 'attack)) - (let ((s4-0 sound-play-by-name) - (s3-0 (make-u128 #x7061 (the-as uint #x7a2d646c65696873))) - (s2-0 (new-sound-id)) - (s1-0 1024) - (s0-0 0) - ) - (set! sv-96 0) - (set! sv-112 1) - (let ((t2-1 (target-pos 0))) - (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-96 sv-112 (the-as symbol t2-1)) - ) - ) - (the-as symbol (send-event - arg0 - 'shove - (-> arg3 param 0) - (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) - ) - ) - ) - ) - ) + ) + ) + ) + ) ) :code (behavior () (let ((gp-0 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-nose-sg* #f :to self))) @@ -1638,7 +1640,7 @@ (-> self root-override trans) :to *entity-pool* ) - (sound-play-by-name (static-sound-name "sagecage-open") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sagecage-open") (go citb-generator-broken) (none) ) diff --git a/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc b/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc index 43dd2732a1..d9bb2f503d 100644 --- a/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc +++ b/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc @@ -111,7 +111,7 @@ (the-as object (cond ((= v1-0 'disable-bars) (stop! (-> self sound)) - (sound-play-by-name (static-sound-name "sagecage-off") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sagecage-off") (set! (-> self bars-on) #f) (citb-sagecage-update-collision) ) @@ -458,7 +458,7 @@ 1024 0 0 - 1 + (sound-group sfx) (the-as symbol (-> self spawn-pos)) ) ) diff --git a/test/decompiler/reference/levels/citadel/citb-drop-plat_REF.gc b/test/decompiler/reference/levels/citadel/citb-drop-plat_REF.gc index 4839070d36..5fa6a8d8d3 100644 --- a/test/decompiler/reference/levels/citadel/citb-drop-plat_REF.gc +++ b/test/decompiler/reference/levels/citadel/citb-drop-plat_REF.gc @@ -188,7 +188,7 @@ ) (when (and (not s5-0) (< (-> self interp) 0.05)) (set! s5-0 #t) - (sound-play-by-name (static-sound-name "bridge-piece-up") (new-sound-id) 1024 0 0 1 (the-as symbol gp-0)) + (sound-play "bridge-piece-up" :position (the-as symbol gp-0)) ) (set! (-> self spin-angle) (* 10.0 (-> self spin-speed) (-> self interp))) (if (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) @@ -215,7 +215,7 @@ :code (behavior () (when (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "bridge-piece-dn") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bridge-piece-dn") (let ((gp-1 (the int (* 300.0 (rand-vu-float-range 0.2 0.3))))) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) gp-1) (set! (-> self interp) diff --git a/test/decompiler/reference/levels/citadel/citb-plat_REF.gc b/test/decompiler/reference/levels/citadel/citb-plat_REF.gc index d48cbf1c76..d940438865 100644 --- a/test/decompiler/reference/levels/citadel/citb-plat_REF.gc +++ b/test/decompiler/reference/levels/citadel/citb-plat_REF.gc @@ -247,15 +247,7 @@ (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (vector+! (-> self basetrans) (-> self basetrans) (-> self trans-offset)) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (none) @@ -905,15 +897,7 @@ (set! (-> self path-pos) (get-current-phase (-> self sync))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (none) @@ -1089,15 +1073,7 @@ ) (ja-channel-push! 1 (seconds 0.1)) (restore-collide-with-as (-> self root-override)) - (sound-play-by-name - (static-sound-name "eco-torch") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self blast-pos)) - ) + (sound-play "eco-torch" :position (the-as symbol (-> self blast-pos))) (dotimes (gp-1 2) (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) diff --git a/test/decompiler/reference/levels/common/basebutton_REF.gc b/test/decompiler/reference/levels/common/basebutton_REF.gc index 0fef23b6bb..37880d644a 100644 --- a/test/decompiler/reference/levels/common/basebutton_REF.gc +++ b/test/decompiler/reference/levels/common/basebutton_REF.gc @@ -102,13 +102,13 @@ (case (-> arg3 param 1) (('flop) (TODO-RENAME-29 self (-> self event-going-down) (-> self notify-actor)) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-down) ) ) ) (('trigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-down) ) (('move-to) @@ -144,7 +144,7 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('untrigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-up) ) (('move-to) @@ -184,7 +184,7 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('untrigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-up) ) (('move-to) @@ -213,7 +213,7 @@ (suspend) ) (TODO-RENAME-29 self (-> self event-going-up) (-> self notify-actor)) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-up) ) ) @@ -239,7 +239,7 @@ (move-to-vec-or-quat! self (the-as vector (-> arg3 param 0)) (the-as quaternion (-> arg3 param 1))) ) (('trigger) - (sound-play-by-name (static-sound-name "silo-button") (new-sound-id) 1024 0 0 1 #t) + (sound-play "silo-button") (go-virtual basebutton-going-down) ) ) diff --git a/test/decompiler/reference/levels/common/baseplat_REF.gc b/test/decompiler/reference/levels/common/baseplat_REF.gc index ce2158e1f8..cf631b7687 100644 --- a/test/decompiler/reference/levels/common/baseplat_REF.gc +++ b/test/decompiler/reference/levels/common/baseplat_REF.gc @@ -190,11 +190,11 @@ (cond ((-> self locked) (if (= (-> self next-state name) 'door-closed) - (sound-play-by-name (static-sound-name "door-lock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "door-lock") ) ) (else - (sound-play-by-name (static-sound-name "door-unlock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "door-unlock") ) ) #t @@ -249,17 +249,9 @@ eco-door-event-handler ) ) (if gp-0 - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) ) - (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) (clear-collide-with-as (-> self root-override)) (until (ja-done? 0) (ja :num! (seek! max (-> self speed))) @@ -323,13 +315,13 @@ eco-door-event-handler (suspend) ) ) - (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) (until (ja-done? 0) (ja :num! (seek! 0.0 (-> self speed))) (suspend) ) (if (-> self locked) - (sound-play-by-name (static-sound-name "door-lock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "door-lock") ) (go-virtual door-closed) (none) diff --git a/test/decompiler/reference/levels/common/battlecontroller_REF.gc b/test/decompiler/reference/levels/common/battlecontroller_REF.gc index 2cf47f62e1..0ae034ef0c 100644 --- a/test/decompiler/reference/levels/common/battlecontroller_REF.gc +++ b/test/decompiler/reference/levels/common/battlecontroller_REF.gc @@ -617,7 +617,7 @@ battlecontroller-default-event-handler process-drawable-fuel-cell-handler ) :code (behavior () - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 -2286 0 1 #f) + (sound-play "money-pickup" :pitch -1.5 :position #f) (battlecontroller-battle-end) (battlecontroller-camera-off) (battlecontroller-set-task-completed) diff --git a/test/decompiler/reference/levels/common/launcherdoor_REF.gc b/test/decompiler/reference/levels/common/launcherdoor_REF.gc index 2579207937..5465a5cc9f 100644 --- a/test/decompiler/reference/levels/common/launcherdoor_REF.gc +++ b/test/decompiler/reference/levels/common/launcherdoor_REF.gc @@ -52,7 +52,7 @@ (defstate launcherdoor-closed (launcherdoor) :code (behavior ((arg0 symbol)) (if (not arg0) - (sound-play-by-name (static-sound-name "ldoor-close") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ldoor-close") ) (when *target* (case (-> *target* current-level name) @@ -115,7 +115,7 @@ (defstate launcherdoor-open (launcherdoor) :code (behavior ((arg0 symbol)) (if (not arg0) - (sound-play-by-name (static-sound-name "ldoor-open") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ldoor-open") ) (set! (-> self draw force-lod) 0) (clear-collide-with-as (-> self root-override)) diff --git a/test/decompiler/reference/levels/common/orb-cache_REF.gc b/test/decompiler/reference/levels/common/orb-cache_REF.gc index 7893ebe48f..cdb80d8835 100644 --- a/test/decompiler/reference/levels/common/orb-cache_REF.gc +++ b/test/decompiler/reference/levels/common/orb-cache_REF.gc @@ -86,7 +86,7 @@ ) :code (behavior ((arg0 symbol)) (if (and (not arg0) (-> self child)) - (sound-play-by-name (static-sound-name "close-orb-cash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "close-orb-cash") ) (dotimes (gp-1 (-> self money)) (let ((a0-4 (handle->process (-> self money-list gp-1)))) @@ -225,7 +225,7 @@ (calculate-pos self arg0) (if arg0 (set! (-> self basetrans y) (-> self platform-pos)) - (sound-play-by-name (static-sound-name "open-orb-cash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "open-orb-cash") ) (dotimes (s5-1 (-> self money)) (let ((s4-1 (new 'stack-no-clear 'vector))) @@ -296,7 +296,7 @@ :trans (the-as (function none :behavior orb-cache-top) plat-trans) :code (behavior ((arg0 symbol)) (if (not arg0) - (sound-play-by-name (static-sound-name "close-orb-cash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "close-orb-cash") ) (ja :group! (-> self draw art-group data 3) :num! (identity (ja-aframe 0.0 0))) (new 'stack-no-clear 'vector) diff --git a/test/decompiler/reference/levels/common/plat-button_REF.gc b/test/decompiler/reference/levels/common/plat-button_REF.gc index 637e83e88a..fa35e2c824 100644 --- a/test/decompiler/reference/levels/common/plat-button_REF.gc +++ b/test/decompiler/reference/levels/common/plat-button_REF.gc @@ -238,7 +238,7 @@ (move-to-point! (-> self root-override) gp-0) ) ) - (sound-play-by-name (static-sound-name "elev-loop") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "elev-loop" :id (-> self sound-id)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (-> self sound-id)) @@ -313,7 +313,7 @@ (move-to-point! (-> self root-override) gp-0) ) ) - (sound-play-by-name (static-sound-name "elev-loop") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "elev-loop" :id (-> self sound-id)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (-> self sound-id)) @@ -348,7 +348,7 @@ (process-entity-status! self (entity-perm-status bit-3) #f) ) (sound-stop (-> self sound-id)) - (sound-play-by-name (static-sound-name "elev-land") (new-sound-id) 1024 0 0 1 #t) + (sound-play "elev-land") (loop (if (or (not *target*) (< 268435460.0 (vector-vector-xz-distance-squared (-> self root-override trans) (target-pos 0))) diff --git a/test/decompiler/reference/levels/common/plat-eco_REF.gc b/test/decompiler/reference/levels/common/plat-eco_REF.gc index c631acec14..e4b8af0465 100644 --- a/test/decompiler/reference/levels/common/plat-eco_REF.gc +++ b/test/decompiler/reference/levels/common/plat-eco_REF.gc @@ -109,15 +109,7 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('wake) - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) (go-virtual plat-path-active (the-as plat #f)) ) (('ridden 'edge-grabbed) diff --git a/test/decompiler/reference/levels/common/plat_REF.gc b/test/decompiler/reference/levels/common/plat_REF.gc index ffe9e20df3..8aada5fcbf 100644 --- a/test/decompiler/reference/levels/common/plat_REF.gc +++ b/test/decompiler/reference/levels/common/plat_REF.gc @@ -260,15 +260,7 @@ ) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (none) diff --git a/test/decompiler/reference/levels/common/rigid-body_REF.gc b/test/decompiler/reference/levels/common/rigid-body_REF.gc index fe6ce429f0..0e555a39fd 100644 --- a/test/decompiler/reference/levels/common/rigid-body_REF.gc +++ b/test/decompiler/reference/levels/common/rigid-body_REF.gc @@ -699,7 +699,15 @@ (set! (-> self rbody lin-momentum-damping-factor) (-> self info linear-damping)) (set! (-> self rbody ang-momentum-damping-factor) (-> self info angular-damping)) (if (-> self player-impulse) - (sound-play-by-name (string->sound-name (-> self info sound-name)) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name + (string->sound-name (-> self info sound-name)) + (new-sound-id) + 1024 + 0 + 0 + (sound-group sfx) + #t + ) ) (TODO-RENAME-28 self) (quaternion-copy! (-> self root-overlay quat) (-> self rbody rotation)) diff --git a/test/decompiler/reference/levels/common/sharkey_REF.gc b/test/decompiler/reference/levels/common/sharkey_REF.gc index d2c83a2a34..7626a8f1db 100644 --- a/test/decompiler/reference/levels/common/sharkey_REF.gc +++ b/test/decompiler/reference/levels/common/sharkey_REF.gc @@ -410,7 +410,7 @@ nav-enemy-default-event-handler (s5-0 (new 'stack-no-clear 'vector)) ) (-> *display* base-frame-counter) - (sound-play-by-name (static-sound-name "bigshark-bite") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bigshark-bite") (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> gp-0 quad) (-> self collide-info trans quad)) (ja-channel-push! 1 (seconds 0.1)) @@ -537,7 +537,7 @@ nav-enemy-default-event-handler :code (behavior () (set! (-> self player-water-time) (-> *display* base-frame-counter)) (ja-channel-push! 1 (seconds 0.17)) - (sound-play-by-name (static-sound-name "bigshark-idle") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bigshark-idle") (loop (ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim)) :num! (seek! max (-> self anim-speed)) @@ -558,14 +558,11 @@ nav-enemy-default-event-handler (f1-2 (fmax 0.0 (fmin 1.0 (- 1.0 (/ (+ -24576.0 f3-0) (+ -24576.0 (-> self spawn-distance))))))) (f0-2 (+ 0.5 (* 1.5 f1-2))) ) - (sound-play-by-name - (static-sound-name "bigshark-alert") - (-> self sound-id) - 1024 - (the int (* 1524.0 f0-2)) - 0 - 1 - (the-as symbol (-> self collide-info trans)) + (sound-play + "bigshark-alert" + :id (-> self sound-id) + :pitch f0-2 + :position (the-as symbol (-> self collide-info trans)) ) ) (none) diff --git a/test/decompiler/reference/levels/common/ticky_REF.gc b/test/decompiler/reference/levels/common/ticky_REF.gc index afeb1a65f0..3255c7dd83 100644 --- a/test/decompiler/reference/levels/common/ticky_REF.gc +++ b/test/decompiler/reference/levels/common/ticky_REF.gc @@ -57,7 +57,7 @@ ) (when (>= (- (-> *display* base-frame-counter) (-> obj last-tick-time)) v1-7) (set! (-> obj last-tick-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "stopwatch") (new-sound-id) 1024 0 0 1 #t) + (sound-play "stopwatch") ) ) ) diff --git a/test/decompiler/reference/levels/finalboss/final-door_REF.gc b/test/decompiler/reference/levels/finalboss/final-door_REF.gc index bb1d49c9dc..1cac7c2fc3 100644 --- a/test/decompiler/reference/levels/finalboss/final-door_REF.gc +++ b/test/decompiler/reference/levels/finalboss/final-door_REF.gc @@ -293,7 +293,7 @@ (defstate jump (powercellalt) :virtual #t :code (behavior () - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (let ((gp-1 (new 'stack 'trajectory))) (set! (-> self base y) (-> self jump-pos y)) (setup-from-to-duration! gp-1 (-> self root-override trans) (-> self jump-pos) 300.0 -2.2755556) @@ -313,7 +313,7 @@ (set! (-> self root-override trans quad) (-> self jump-pos quad)) (set! (-> self base quad) (-> self root-override trans quad)) (transform-post) - (sound-play-by-name (static-sound-name "land-pcmetal") (new-sound-id) 1024 3048 0 1 #t) + (sound-play "land-pcmetal" :pitch 2) (process-spawn part-tracker :init part-tracker-init diff --git a/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc b/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc index 0ab2b4ccf9..f7c483011c 100644 --- a/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc +++ b/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc @@ -545,15 +545,7 @@ (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self sound-delay)) ) (set! (-> self played-sound?) #t) - (sound-play-by-name - (static-sound-name "blob-jump") - (new-sound-id) - 1024 - (the int (* 1524.0 (nav-enemy-rnd-float-range -0.5 0.5))) - 0 - 1 - #t - ) + (sound-play "blob-jump" :pitch (nav-enemy-rnd-float-range -0.5 0.5)) ) (dummy-53 self) 0 @@ -561,15 +553,7 @@ ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) - (sound-play-by-name - (static-sound-name "blob-out") - (new-sound-id) - 1024 - (the int (* 1524.0 (nav-enemy-rnd-float-range -1.0 1.0))) - 0 - 1 - #t - ) + (sound-play "blob-out" :pitch (nav-enemy-rnd-float-range -1.0 1.0)) (cond ((zero? (nav-enemy-rnd-int-count 2)) (ja-no-eval :group! green-eco-lurker-jump-with-flip-ja :num! (seek!) :frame-num 0.0) @@ -603,15 +587,7 @@ ) :code (behavior () (activate! *camera-smush-control* 409.6 37 150 1.0 0.99) - (sound-play-by-name - (static-sound-name "blob-land") - (new-sound-id) - 1024 - (the int (* 1524.0 (nav-enemy-rnd-float-range -1.0 1.0))) - 0 - 1 - #t - ) + (sound-play "blob-land" :pitch (nav-enemy-rnd-float-range -1.0 1.0)) (let ((v1-4 (-> self draw shadow-ctrl))) (let ((a0-4 v1-4)) (set! (-> a0-4 settings bot-plane w) (- -7168.0)) @@ -723,7 +699,7 @@ (-> self collide-info trans) :to *entity-pool* ) - (sound-play-by-name (static-sound-name "blob-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "blob-explode") (activate! *camera-smush-control* 409.6 37 150 1.0 0.99) (let ((v1-14 (-> self draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) diff --git a/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc index f3a8f91a88..674985b8c0 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc @@ -303,7 +303,7 @@ (defstate darkecobomb-explode (darkecobomb) :code (behavior ((arg0 symbol)) (send-event *target* 'reset-pickup 'eco) - (sound-play-by-name (static-sound-name "explod-bomb") (new-sound-id) 1024 0 0 1 #f) + (sound-play "explod-bomb" :position #f) (activate! *camera-smush-control* 819.2 37 600 1.0 0.995) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (process-spawn @@ -404,7 +404,7 @@ :to *entity-pool* ) (set! (-> self next-tick) (+ -0.06 (-> self next-tick))) - (sound-play-by-name (static-sound-name "robo-warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "robo-warning") ) ) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (the int (-> self countdown-time))) @@ -419,7 +419,7 @@ (none) ) :code (behavior () - (sound-play-by-name (static-sound-name "bomb-open") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bomb-open") (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -730,7 +730,7 @@ (defstate redshot-explode (redshot) :enter (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) - (sound-play-by-name (static-sound-name "red-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "red-explode") (logclear! (-> self draw status) (draw-status hidden)) (quaternion-identity! (-> self root-override quat)) (set! (-> self ring radius-secondary) 3072.0) diff --git a/test/decompiler/reference/levels/finalboss/robotboss_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss_REF.gc index c323b04aed..41a54c85d0 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss_REF.gc @@ -915,7 +915,7 @@ :to *entity-pool* ) ) - (sound-play-by-name (static-sound-name "bfg-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bfg-fire") (none) ) @@ -1518,7 +1518,7 @@ gp-0 :to *entity-pool* ) - (sound-play-by-name (static-sound-name "red-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "red-fire") ) ) ) @@ -1981,7 +1981,7 @@ gp-0 :to *entity-pool* ) - (sound-play-by-name (static-sound-name "green-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "green-fire") ) ) (none) @@ -2651,7 +2651,7 @@ (+! (-> self hits-to-go) -1) (ja-channel-push! 1 (seconds 0.1)) (ja :group! robotboss-blue-last-hit-ja) - (sound-play-by-name (static-sound-name "explod-eye") (new-sound-id) 1024 0 0 1 #t) + (sound-play "explod-eye") (set! (-> self blue-smoke) #t) (let ((gp-1 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-1 (-> self node-list data 7)) diff --git a/test/decompiler/reference/levels/finalboss/sage-finalboss_REF.gc b/test/decompiler/reference/levels/finalboss/sage-finalboss_REF.gc index 751e7ec653..01a9c0ae7b 100644 --- a/test/decompiler/reference/levels/finalboss/sage-finalboss_REF.gc +++ b/test/decompiler/reference/levels/finalboss/sage-finalboss_REF.gc @@ -166,15 +166,7 @@ (seek! (-> self path-pos) (-> self dest) (* (-> self speed) (-> *display* seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play-by-name - (static-sound-name "eco-plat-hover") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) (plat-trans) (when (send-event *target* 'query 'powerup (pickup-type eco-yellow)) diff --git a/test/decompiler/reference/levels/firecanyon/firecanyon-obs_REF.gc b/test/decompiler/reference/levels/firecanyon/firecanyon-obs_REF.gc index aba54de0f7..2c66093dc5 100644 --- a/test/decompiler/reference/levels/firecanyon/firecanyon-obs_REF.gc +++ b/test/decompiler/reference/levels/firecanyon/firecanyon-obs_REF.gc @@ -103,7 +103,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "cool-balloon") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cool-balloon") (process-spawn part-tracker :init part-tracker-init @@ -307,7 +307,7 @@ (= (send-event *target* 'query 'mode) 'racer) (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 225280.0) ) - (sound-play-by-name (static-sound-name "magma-rock") (new-sound-id) 1024 0 0 1 #t) + (sound-play "magma-rock") (let ((v1-8 (entity-actor-count (-> self entity) 'alt-actor))) 0 (cond @@ -625,7 +625,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (process-spawn part-tracker :init part-tracker-init diff --git a/test/decompiler/reference/levels/flut_common/target-flut_REF.gc b/test/decompiler/reference/levels/flut_common/target-flut_REF.gc index 2194de7f98..b8f303d887 100644 --- a/test/decompiler/reference/levels/flut_common/target-flut_REF.gc +++ b/test/decompiler/reference/levels/flut_common/target-flut_REF.gc @@ -830,7 +830,7 @@ ) :enter (behavior ((arg0 float) (arg1 float)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "jump") (new-sound-id) 1024 -762 0 1 #t) + (sound-play "jump" :pitch -0.5) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flut-jump-mods*) @@ -1002,7 +1002,7 @@ (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) ) (if (ja-group? (-> self draw art-group data 149)) - (sound-play-by-name (static-sound-name "flut-flap") (-> self flut flap-sound-id) 1024 0 0 1 #t) + (sound-play "flut-flap" :id (-> self flut flap-sound-id)) ) (seek! (-> self control unknown-float122) @@ -1356,7 +1356,7 @@ ) :code (behavior () (ja-channel-push! 1 (seconds 0.02)) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "flut-hit") (ja :group! (-> self draw art-group data 150) :num! min) (set! (-> self control dynam gravity-max) 368640.0) (set! (-> self control dynam gravity-length) 368640.0) @@ -1560,7 +1560,7 @@ (none) ) :code (behavior ((arg0 float)) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 -762 0 1 #t) + (sound-play "flut-hit" :pitch -0.5) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! (-> self draw art-group data 152) :num! (seek! (ja-aframe (the-as float 8.0) 0)) @@ -1612,7 +1612,7 @@ (set! (-> self control unknown-dword31) 0) (set! (-> self control unknown-dword33) 0) (set! (-> self control unknown-surface00) *flut-air-attack-mods*) - (sound-play-by-name (static-sound-name "flop-land") (new-sound-id) 1024 -609 0 1 #t) + (sound-play "flop-land" :pitch -0.4) (dummy-10 (-> self skel effect) 'group-flut-attack-strike-ground (ja-frame-num 0) 0) (let ((gp-2 (process-spawn touch-tracker :init touch-tracker-init (-> self control trans) 4096.0 30 :to self))) (send-event (ppointer->process gp-2) 'event 'attack 'flut-attack) @@ -1786,7 +1786,7 @@ ) ) (target-hit-effect gp-0) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 -1524 0 1 #t) + (sound-play "flut-hit" :pitch -1) ) (set! (-> self control unknown-surface00) *smack-mods*) (let ((f30-0 1.0)) @@ -1796,8 +1796,8 @@ (ja-channel-set! 1) (ja :group! (-> self draw art-group data 158) :num! min) ) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 1024 1524 0 1 #t) + (sound-play "smack-surface") + (sound-play "flut-hit" :pitch 1) ) (else (when (not (ja-group? (-> self draw art-group data 157))) @@ -1842,8 +1842,8 @@ ((or (= arg0 'none) (= arg0 'water-vol) (= arg0 'sharkey)) ) ((= arg0 'endlessfall) - (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "flut-hit") (new-sound-id) 716 -2133 0 1 #t) + (sound-play "death-fall") + (sound-play "flut-hit" :vol 70 :pitch -1.4) (camera-change-to (the-as string cam-endlessfall) 30 #f) (set! (-> self control pat-ignore-mask unknown-bit) 1) (logclear! (-> self water flags) (water-flags wt04)) @@ -1963,7 +1963,7 @@ ) ) (let ((gp-1 #f)) - (sound-play-by-name (static-sound-name "uppercut") (new-sound-id) 1024 0 0 1 #t) + (sound-play "uppercut") (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! (-> self draw art-group data 155) :num! (seek! (ja-aframe (the-as float 24.0) 0)) @@ -1979,7 +1979,7 @@ (ja :num! (seek! (ja-aframe (the-as float 24.0) 0))) ) ) - (sound-play-by-name (static-sound-name "flut-coo") (new-sound-id) 1024 0 0 1 #t) + (sound-play "flut-coo") (logclear! (-> self state-flags) (state-flags use-alt-cam-pos)) (set! (-> self control transv quad) (the-as uint128 0)) (quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00)) @@ -2077,7 +2077,7 @@ (set! (-> self control unknown-vector102 quad) (-> gp-0 quad)) (set! (-> self control unknown-vector103 quad) (-> s4-0 quad)) ) - (sound-play-by-name (static-sound-name "flut-coo") (new-sound-id) 921 -762 0 1 #t) + (sound-play "flut-coo" :vol 90 :pitch -0.5) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! (-> self draw art-group data 156) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) diff --git a/test/decompiler/reference/levels/jungle/bouncer_REF.gc b/test/decompiler/reference/levels/jungle/bouncer_REF.gc index 8ce5834ebf..f478c03956 100644 --- a/test/decompiler/reference/levels/jungle/bouncer_REF.gc +++ b/test/decompiler/reference/levels/jungle/bouncer_REF.gc @@ -44,7 +44,7 @@ (case arg2 (('bonk) (when (send-event arg0 'jump (-> self spring-height) (-> self spring-height) #f) - (sound-play-by-name (static-sound-name "trampoline") (new-sound-id) 1024 0 0 1 #t) + (sound-play "trampoline") (go bouncer-fire) ) ) diff --git a/test/decompiler/reference/levels/jungle/fisher_REF.gc b/test/decompiler/reference/levels/jungle/fisher_REF.gc index 5745c1c210..8d4c02105c 100644 --- a/test/decompiler/reference/levels/jungle/fisher_REF.gc +++ b/test/decompiler/reference/levels/jungle/fisher_REF.gc @@ -1012,7 +1012,7 @@ :code (behavior () (case (-> self mode) (('deadly 'bad) - (sound-play-by-name (static-sound-name "caught-eel") (new-sound-id) 1024 0 0 1 #t) + (sound-play "caught-eel") (ambient-hint-spawn "sksp0a42" (-> self root trans) *entity-pool* 'ambient) (send-event (ppointer->process (-> self parent)) 'deadly) ) @@ -1028,7 +1028,7 @@ (-> self root trans) :to *entity-pool* ) - (sound-play-by-name (static-sound-name "get-big-fish") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-big-fish") (send-event (ppointer->process (-> self parent)) 'fisher-fish-caught 5) ) (else @@ -1043,7 +1043,7 @@ (-> self root trans) :to *entity-pool* ) - (sound-play-by-name (static-sound-name "get-small-fish") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-small-fish") (send-event (ppointer->process (-> self parent)) 'fisher-fish-caught 1) ) ) @@ -1601,7 +1601,7 @@ ) (set! (-> self spawner-last) (-> self spawner)) (set! (-> self spawn-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "fish-spawn") (new-sound-id) 716 0 0 1 #t) + (sound-play "fish-spawn" :vol 70) (fisher-spawn-ambient) (process-spawn fisher-fish gp-0 (-> self spawner) (* 1.85 (-> self params fish-vel)) :to self) ) @@ -1629,7 +1629,7 @@ (local-vars (v0-2 object)) (case arg2 (('fisher-fish-die) - (sound-play-by-name (static-sound-name "fish-miss") (new-sound-id) 1024 0 0 1 #t) + (sound-play "fish-miss") (set! v0-2 (+ (-> self missed) (-> arg3 param 0))) (set! (-> self missed) (the-as int v0-2)) v0-2 diff --git a/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc b/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc index ecdd2196bb..55505b8be0 100644 --- a/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc +++ b/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc @@ -776,7 +776,10 @@ (set! sv-32 0) (set! sv-48 1) (let ((t2-0 (target-pos 0))) - (the-as int (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-32 sv-48 (the-as symbol t2-0))) + (the-as + int + (s4-0 (the-as sound-name s3-0) s2-0 s1-0 s0-0 sv-32 (the-as sound-group sv-48) (the-as symbol t2-0)) + ) ) ) ) @@ -892,15 +895,7 @@ ) (when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (sound-stop (-> self sound-id)) - (sound-play-by-name - (static-sound-name "beam-connect") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (target-pos 0)) - ) + (sound-play "beam-connect" :position (the-as symbol (target-pos 0))) ) (process-entity-status! self (entity-perm-status complete) #t) (set! gp-0 #t) @@ -1332,15 +1327,7 @@ (defstate periscope-activate (periscope) :exit (behavior () (sound-stop (-> self rise-sound-id)) - (sound-play-by-name - (static-sound-name "eco-tower-stop") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self base)) - ) + (sound-play "eco-tower-stop" :position (the-as symbol (-> self base))) (none) ) :trans periscope-debug-trans @@ -1356,15 +1343,7 @@ (set! (-> self turn) (+ 18204.445 (-> self target-turn))) ) (until (and v1-13 (= (-> self turn) (-> self target-turn)) (= (-> self tilt) (-> self target-tilt))) - (sound-play-by-name - (static-sound-name "eco-tower-rise") - (-> self rise-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self base)) - ) + (sound-play "eco-tower-rise" :id (-> self rise-sound-id) :position (the-as symbol (-> self base))) (seek! (-> self y-offset) (-> self height) (* 16384.0 (-> *display* seconds-per-frame))) (seek! (-> self turn) (-> self target-turn) (* 7281.778 (-> *display* seconds-per-frame))) (seek! (-> self tilt) (-> self target-tilt) (* 7281.778 (-> *display* seconds-per-frame))) @@ -1461,15 +1440,7 @@ (if (nonzero? gp-0) (level-hint-spawn (game-text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) ) - (sound-play-by-name - (static-sound-name "site-moves") - (-> self grips-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self grips transform)) - ) + (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) (periscope-update-joints) (suspend) @@ -1548,15 +1519,7 @@ ) :post (behavior () (if (-> self grips-moving?) - (sound-play-by-name - (static-sound-name "site-moves") - (-> self grips-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self grips transform)) - ) + (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) (sound-stop (-> self grips-sound-id)) ) (periscope-draw-beam-impact) @@ -1802,15 +1765,7 @@ (until (= (-> self y-offset-grips) f30-0) (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) (periscope-update-joints) - (sound-play-by-name - (static-sound-name "site-moves") - (-> self grips-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self grips transform)) - ) + (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) (suspend) ) ) @@ -1994,7 +1949,7 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) - (sound-play-by-name (static-sound-name "mirror-smash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "mirror-smash") (go reflector-mirror-broken #f) ) ) diff --git a/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc b/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc index 423f00494f..d2b98859fa 100644 --- a/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc +++ b/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc @@ -832,15 +832,7 @@ :trans (the-as (function none :behavior precurbridge) rider-trans) :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) (if (rand-vu-percent? 0.1) @@ -1148,15 +1140,7 @@ (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) - (sound-play-by-name - (static-sound-name "blue-eco-on") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) (go maindoor-open #f) ) (if (and *target* diff --git a/test/decompiler/reference/levels/jungleb/aphid_REF.gc b/test/decompiler/reference/levels/jungleb/aphid_REF.gc index 43793350f7..357b72936d 100644 --- a/test/decompiler/reference/levels/jungleb/aphid_REF.gc +++ b/test/decompiler/reference/levels/jungleb/aphid_REF.gc @@ -82,7 +82,7 @@ ) (loop (ja-channel-push! 1 (seconds 0.05)) - (sound-play-by-name (static-sound-name "aphid-spike-out") (new-sound-id) 1024 0 0 1 #t) + (sound-play "aphid-spike-out") (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -103,7 +103,7 @@ ) (aphid-vulnerable) (ja-channel-push! 1 (seconds 0.05)) - (sound-play-by-name (static-sound-name "aphid-spike-in") (new-sound-id) 1024 0 0 1 #t) + (sound-play "aphid-spike-in") (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) diff --git a/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc b/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc index 34dd09aa44..a9916d350e 100644 --- a/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc +++ b/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc @@ -221,7 +221,7 @@ (go eggtop-close #f) ) (spawn (-> self part) (-> self root-override trans)) - (sound-play-by-name (static-sound-name "electric-loop") (-> self sound-id) 1024 0 0 1 #t) + (sound-play "electric-loop" :id (-> self sound-id)) (none) ) :code (behavior () @@ -242,7 +242,7 @@ ) :code (behavior ((arg0 symbol)) (when (not arg0) - (sound-play-by-name (static-sound-name "vent-switch") (new-sound-id) 2048 0 0 1 #t) + (sound-play "vent-switch" :vol 200) (process-spawn part-tracker :init part-tracker-init @@ -297,7 +297,7 @@ ) ) (save-reminder (get-task-control (-> self entity extra perm task)) 2 0) - (sound-play-by-name (static-sound-name "jngb-eggtop-seq") (new-sound-id) 1024 0 0 1 #t) + (sound-play "jngb-eggtop-seq") (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc b/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc index c60eebed8e..6fe0d2977d 100644 --- a/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc +++ b/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc @@ -807,7 +807,7 @@ (suspend) (ja :num! (seek! (ja-aframe (the-as float 30.0) 0))) ) - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plant-leaf") (ja-no-eval :group! plant-boss-leaf-grow-right-ja :num! (seek!) :frame-num (ja-aframe (the-as float 30.0) 0)) (until (ja-done? 0) (suspend) @@ -824,7 +824,7 @@ (suspend) (ja :num! (seek! (ja-aframe (the-as float 30.0) 0))) ) - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plant-leaf") (ja-no-eval :group! plant-boss-leaf-grow-left-ja :num! (seek!) :frame-num (ja-aframe (the-as float 30.0) 0)) (until (ja-done? 0) (suspend) @@ -943,7 +943,7 @@ :code (behavior () (case (-> self side) ((1) - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plant-leaf") (ja-no-eval :group! plant-boss-leaf-grow-right-ja :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) @@ -951,7 +951,7 @@ ) ) (else - (sound-play-by-name (static-sound-name "plant-leaf") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plant-leaf") (ja-no-eval :group! plant-boss-leaf-grow-left-ja :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) diff --git a/test/decompiler/reference/levels/jungleb/plat-flip_REF.gc b/test/decompiler/reference/levels/jungleb/plat-flip_REF.gc index df9e3f9f3e..b0de0b306a 100644 --- a/test/decompiler/reference/levels/jungleb/plat-flip_REF.gc +++ b/test/decompiler/reference/levels/jungleb/plat-flip_REF.gc @@ -78,7 +78,7 @@ ((begin (set! f30-0 (- f0-1 (-> self before-turn-down-time))) (< f30-0 (-> self turn-down-time))) (when (not gp-0) (set! gp-0 #t) - (sound-play-by-name (static-sound-name "plat-flip") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-flip") ) (ja :group! plat-flip-turn-down-ja :num! (identity (/ (* f30-0 (the float (+ (-> (the-as art-joint-anim plat-flip-turn-down-ja) data 0 length) -1))) @@ -94,7 +94,7 @@ (else (when (not gp-0) (set! gp-0 #t) - (sound-play-by-name (static-sound-name "plat-flip") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-flip") ) (let ((f30-2 (- f30-1 (-> self before-turn-up-time)))) (ja :group! plat-flip-turn-up-ja diff --git a/test/decompiler/reference/levels/lavatube/lavatube-energy_REF.gc b/test/decompiler/reference/levels/lavatube/lavatube-energy_REF.gc index 14bfc5ba58..bda9eaf67a 100644 --- a/test/decompiler/reference/levels/lavatube/lavatube-energy_REF.gc +++ b/test/decompiler/reference/levels/lavatube/lavatube-energy_REF.gc @@ -872,7 +872,7 @@ (the-as object (when (= v1-0 'attack) (when (and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow)) (increment-success-for-hint (game-text-id lavatube-shoot-the-spheres)) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (process-spawn part-tracker :init part-tracker-init diff --git a/test/decompiler/reference/levels/lavatube/lavatube-obs_REF.gc b/test/decompiler/reference/levels/lavatube/lavatube-obs_REF.gc index d705a58317..92e9cc3c55 100644 --- a/test/decompiler/reference/levels/lavatube/lavatube-obs_REF.gc +++ b/test/decompiler/reference/levels/lavatube/lavatube-obs_REF.gc @@ -593,7 +593,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root-override trans quad)) (set! (-> gp-1 y) (+ -49152.0 (-> gp-1 y))) @@ -1167,7 +1167,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root-override trans quad)) (set! (-> gp-1 y) (+ -73728.0 (-> gp-1 y))) @@ -1361,7 +1361,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "cool-balloon") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cool-balloon") (process-spawn part-tracker :init part-tracker-init diff --git a/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc b/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc index ca841bb66b..73f5c78e8e 100644 --- a/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc +++ b/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc @@ -477,7 +477,7 @@ :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (dotimes (gp-0 (-> *dark-crystal-flash-delays* length)) - (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warning") (set! (-> self draw color-mult quad) (-> self lit-color-mult quad)) (set! (-> self draw color-emissive quad) (-> self lit-color-emissive quad)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -522,8 +522,8 @@ (logior! (-> self draw status) (draw-status hidden)) (dummy-20 self) (if (-> self underwater?) - (sound-play-by-name (static-sound-name "water-explosion") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "crystal-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-explosion") + (sound-play "crystal-explode") ) (process-spawn part-tracker diff --git a/test/decompiler/reference/levels/maincave/gnawer_REF.gc b/test/decompiler/reference/levels/maincave/gnawer_REF.gc index ec76314b57..a5575782de 100644 --- a/test/decompiler/reference/levels/maincave/gnawer_REF.gc +++ b/test/decompiler/reference/levels/maincave/gnawer_REF.gc @@ -936,7 +936,7 @@ (go gnawer-retreat-into-post) ) (('attack) - (sound-play-by-name (static-sound-name "gnawer-dies") (new-sound-id) 1024 -381 0 1 #t) + (sound-play "gnawer-dies" :pitch -0.25) (go gnawer-retreat-into-post) ) ) @@ -1353,7 +1353,7 @@ ) ) 0 - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (until (not (-> self child)) (suspend) ) diff --git a/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc b/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc index d6b6fd836d..a682c32741 100644 --- a/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc +++ b/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc @@ -563,7 +563,7 @@ ) (when (-> self should-play-sound?) (set! (-> self should-play-sound?) #f) - (sound-play-by-name (static-sound-name "hot-flame") (new-sound-id) 1024 0 0 1 #t) + (sound-play "hot-flame") ) (cond ((< gp-0 30) diff --git a/test/decompiler/reference/levels/maincave/maincave-part_REF.gc b/test/decompiler/reference/levels/maincave/maincave-part_REF.gc index 7595b945f6..cdd3f2ac6c 100644 --- a/test/decompiler/reference/levels/maincave/maincave-part_REF.gc +++ b/test/decompiler/reference/levels/maincave/maincave-part_REF.gc @@ -317,7 +317,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc index 0c26edc92b..f3b5b4d671 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc @@ -265,7 +265,7 @@ ) ) (when (= f30-0 (-> self traj time)) - (sound-play-by-name (static-sound-name "eggs-lands") (new-sound-id) 1024 0 0 1 #t) + (sound-play "eggs-lands") (go mother-spider-egg-on-ground) ) ) diff --git a/test/decompiler/reference/levels/maincave/mother-spider-proj_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider-proj_REF.gc index b68b91a36f..9384ccc538 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider-proj_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider-proj_REF.gc @@ -353,8 +353,8 @@ (set! (-> obj target quad) (-> (target-pos 0) quad)) (set! (-> obj target y) (+ 4915.2 (-> obj target y))) (set! (-> obj target-base quad) (-> obj target quad)) - (set! (-> obj sound-id) (sound-play-by-name (static-sound-name "mother-track") (new-sound-id) 1024 0 0 1 #t)) - (sound-play-by-name (static-sound-name "mother-fire") (new-sound-id) 1024 0 0 1 #t) + (set! (-> obj sound-id) (sound-play "mother-track")) + (sound-play "mother-fire") (none) ) @@ -406,7 +406,7 @@ (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "mother-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "mother-hit") (suspend) (go-virtual projectile-die) (none) diff --git a/test/decompiler/reference/levels/maincave/mother-spider_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider_REF.gc index 28f51cc3ed..b3b3853982 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider_REF.gc @@ -1347,7 +1347,7 @@ (process-spawn mother-spider-egg (-> self entity) (-> self root-override trans) s5-0 s4-0 :to self) (+! (-> self baby-count) 1) (+! (-> self birthing-counter) -1) - (sound-play-by-name (static-sound-name "lay-eggs") (new-sound-id) 1024 0 0 1 #t) + (sound-play "lay-eggs") ) ) ) diff --git a/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc b/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc index 2a76339467..65fe25d035 100644 --- a/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc +++ b/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc @@ -115,7 +115,7 @@ (defstate spiderwebs-bounce (spiderwebs) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (sound-play-by-name (static-sound-name "web-tramp") (new-sound-id) 1024 0 0 1 #t) + (sound-play "web-tramp") (ja-no-eval :group! spiderwebs-bounce-ja :num! (seek! (ja-aframe 10.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/test/decompiler/reference/levels/misty/balloonlurker_REF.gc b/test/decompiler/reference/levels/misty/balloonlurker_REF.gc index f26148dd86..23db6b9973 100644 --- a/test/decompiler/reference/levels/misty/balloonlurker_REF.gc +++ b/test/decompiler/reference/levels/misty/balloonlurker_REF.gc @@ -663,25 +663,15 @@ (f1-2 100.0) (f0-3 (* 3.0 f0-2)) ) - (sound-play-by-name - (static-sound-name "propeller") - (-> self engine-sound-id) - (the int (* 10.24 f1-2)) - (the int (* 1524.0 f0-3)) - 0 - 1 - (the-as symbol (-> self node-list data 4 bone transform vector 3)) + (sound-play + "propeller" + :id (-> self engine-sound-id) + :vol f1-2 + :pitch f0-3 + :position (the-as symbol (-> self node-list data 4 bone transform vector 3)) ) ) - (sound-play-by-name - (static-sound-name "pedals") - (-> self pedal-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-overlay trans)) - ) + (sound-play "pedals" :id (-> self pedal-sound-id) :position (the-as symbol (-> self root-overlay trans))) ) ) (else @@ -823,7 +813,7 @@ (-> self explosion-force-position) :to *entity-pool* ) - (sound-play-by-name (static-sound-name "explosion") (new-sound-id) 1024 0 0 1 #t) + (sound-play "explosion") (set! (-> self explosion) #t) (vector-! (-> self explosion-force) (-> self rbody position) (-> self explosion-force-position)) (set! (-> self explosion-force y) (* 2.0 (-> self explosion-force y))) diff --git a/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc b/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc index 07dd3f5dba..a9fb874dfc 100644 --- a/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc @@ -172,7 +172,7 @@ (let ((v1-0 arg2)) (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - (sound-play-by-name (static-sound-name "icrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "icrate-break") (process-spawn part-tracker :init part-tracker-init @@ -199,15 +199,7 @@ ) (else (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 163840.0) - (sound-play-by-name - (static-sound-name "barrel-roll") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "barrel-roll" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) ) ) ) @@ -359,7 +351,7 @@ (set! sv-48 0.0) (activate! (-> self smush) -0.15 90 150 1.0 1.0) (set! sv-64 f24-0) - (sound-play-by-name (static-sound-name "barrel-bounce") (new-sound-id) 819 0 0 1 #t) + (sound-play "barrel-bounce" :vol 80) (process-spawn part-tracker :init part-tracker-init diff --git a/test/decompiler/reference/levels/misty/misty-obs_REF.gc b/test/decompiler/reference/levels/misty/misty-obs_REF.gc index cbbd684423..e538664a10 100644 --- a/test/decompiler/reference/levels/misty/misty-obs_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-obs_REF.gc @@ -1492,7 +1492,7 @@ ;; failed to figure out what this is: (defstate breakaway-about-to-fall (breakaway) :code (behavior () - (sound-play-by-name (static-sound-name "falling-bones") (new-sound-id) 1024 0 0 1 #t) + (sound-play "falling-bones") (sp-launch-particles-var *sp-particle-system-2d* (-> *part-id-table* 281) diff --git a/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc b/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc index 1c00148910..4baf00f137 100644 --- a/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc @@ -105,7 +105,7 @@ (suspend) ) ) - (sound-play-by-name (static-sound-name "arena-steps") (new-sound-id) 1024 0 0 1 #t) + (sound-play "arena-steps") (send-to-all-after (-> self link) 'trigger-rise) (go silostep-rise #f) (none) diff --git a/test/decompiler/reference/levels/misty/mistycannon_REF.gc b/test/decompiler/reference/levels/misty/mistycannon_REF.gc index 4083a69a6d..ef46f00621 100644 --- a/test/decompiler/reference/levels/misty/mistycannon_REF.gc +++ b/test/decompiler/reference/levels/misty/mistycannon_REF.gc @@ -743,14 +743,11 @@ (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* 300.0 (-> self muzzle-time)))) (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) (suspend) - (let ((f0-1 - (fmin - 1.0 - (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) - (the float (the int (* 300.0 (-> self muzzle-time)))) - ) - ) - ) + (let ((f0-1 (fmin 1.0 (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) + (the float (the int (* 300.0 (-> self muzzle-time)))) + ) + ) + ) ) (set! (-> self root-override scale x) (* 0.6 f0-1)) (set! (-> self root-override scale y) (* 0.6 f0-1)) @@ -769,18 +766,7 @@ ) ) (set! (-> self sfx) - (the-as - uint - (sound-play-by-name - (static-sound-name "sack-incoming") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) - ) + (the-as uint (sound-play "sack-incoming" :position (the-as symbol (-> self root-override trans)))) ) ) (when (nonzero? (-> self sfx)) @@ -813,15 +799,7 @@ 0 ) (set! (-> self ground-time) (-> *display* base-frame-counter)) - (sound-play-by-name - (static-sound-name "sack-land") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) (ja-no-eval :group! sack-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1247,7 +1225,7 @@ (vector+! (-> obj hellmouth) (-> obj hellmouth) s3-0) (spawn-mistycannon-missile obj s3-0 s2-0 f30-0 arg1 f28-0 arg2 (-> obj entity)) ) - (sound-play-by-name (static-sound-name "cannon-shot") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cannon-shot") (set! (-> obj part local-clock) 0) (set! (-> obj part-timer) (-> *display* base-frame-counter)) (mistycannon-pick-random-target-point) @@ -1766,7 +1744,7 @@ (rotate! self f30-0) (tilt! self (- f28-0)) (if (or (!= f30-0 0.0) (!= f28-0 0.0)) - (sound-play-by-name (static-sound-name "telescope") (-> self aim-sound-id) 1024 0 0 1 #t) + (sound-play "telescope" :id (-> self aim-sound-id)) (sound-stop (-> self aim-sound-id)) ) ) @@ -1791,15 +1769,7 @@ (set! gp-0 (seekl gp-0 300 (the-as int (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) ) - (sound-play-by-name - (static-sound-name "cannon-charge") - (-> self sound-id) - 1024 - (the int (* 1524.0 (* 0.008 (the float gp-0)))) - 0 - 1 - #t - ) + (sound-play "cannon-charge" :id (-> self sound-id) :pitch (* 0.008 (the float gp-0))) ) (when (or (= gp-0 300) (and (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) (nonzero? gp-0)) diff --git a/test/decompiler/reference/levels/misty/muse_REF.gc b/test/decompiler/reference/levels/misty/muse_REF.gc index 33c62daff1..2c381abd12 100644 --- a/test/decompiler/reference/levels/misty/muse_REF.gc +++ b/test/decompiler/reference/levels/misty/muse_REF.gc @@ -386,7 +386,7 @@ nav-enemy-default-event-handler (none) ) :code (behavior () - (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 0 0 1 #t) + (sound-play "money-pickup") (close-specific-task! (game-task misty-muse) (task-status need-reminder)) (process-entity-status! self (entity-perm-status dead) #t) (suspend) diff --git a/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc b/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc index e1f8d7e1cd..f9338cffc6 100644 --- a/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc +++ b/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc @@ -390,15 +390,7 @@ ;; failed to figure out what this is: (defstate quicksandlurker-missile-impact (quicksandlurker-missile) :code (behavior () - (sound-play-by-name - (static-sound-name "sack-land") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) (process-spawn part-tracker :init part-tracker-init diff --git a/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc b/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc index f14116f207..92b59956cb 100644 --- a/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc +++ b/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc @@ -343,7 +343,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (ja-post) - (sound-play-by-name (static-sound-name "dcrate-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "dcrate-break") (if arg0 (process-spawn part-tracker @@ -529,7 +529,7 @@ ) ) (if (-> self triggered) - (sound-play-by-name (static-sound-name "rock-in-lava") (new-sound-id) 1024 0 0 1 #t) + (sound-play "rock-in-lava") ) (go-virtual rigid-body-platform-float) ) diff --git a/test/decompiler/reference/levels/ogre/ogreboss_REF.gc b/test/decompiler/reference/levels/ogre/ogreboss_REF.gc index 0fc30c98f1..3a1c02b09e 100644 --- a/test/decompiler/reference/levels/ogre/ogreboss_REF.gc +++ b/test/decompiler/reference/levels/ogre/ogreboss_REF.gc @@ -170,7 +170,7 @@ ;; INFO: Return type mismatch int vs handle. (defun ogreboss-rock-explosion-effect ((arg0 basic)) (with-pp - (sound-play-by-name (static-sound-name "ogre-explode") (new-sound-id) 1024 0 0 1 (the-as symbol arg0)) + (sound-play "ogre-explode" :position (the-as symbol arg0)) (process-spawn part-tracker :init part-tracker-init @@ -580,15 +580,7 @@ ) ) (spawn (-> self part) (-> self node-list data 3 bone transform vector 3)) - (sound-play-by-name - (static-sound-name "ogre-rock") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self joint transform)) - ) + (sound-play "ogre-rock" :id (-> self sound-id) :position (the-as symbol (-> self joint transform))) (suspend) ) (none) @@ -599,15 +591,7 @@ ;; definition for function ogreboss-super-boulder-impact-effect ;; INFO: Return type mismatch int vs none. (defbehavior ogreboss-super-boulder-impact-effect ogreboss-super-boulder () - (sound-play-by-name - (static-sound-name "ogre-boulder") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self draw origin)) - ) + (sound-play "ogre-boulder" :position (the-as symbol (-> self draw origin))) (activate! *camera-smush-control* (the-as float 819.2) 37 600 (the-as float 1.0) (the-as float 0.995)) (process-spawn part-tracker @@ -1398,15 +1382,7 @@ ) (set! (-> gp-0 dest) s5-0) ) - (sound-play-by-name - (static-sound-name "ogre-fires") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-fires" :position (the-as symbol (-> self root-override trans))) (process-spawn part-tracker :init part-tracker-init @@ -1703,15 +1679,7 @@ ;; definition for function ogreboss-roll-boulder ;; INFO: Return type mismatch int vs none. (defbehavior ogreboss-roll-boulder ogreboss () - (sound-play-by-name - (static-sound-name "ogre-fires") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-fires" :position (the-as symbol (-> self root-override trans))) (+! (-> self roll-boulder) (rand-vu-int-range 1 2)) (if (>= (-> self roll-boulder) 3) (+! (-> self roll-boulder) -3) @@ -1805,37 +1773,13 @@ (let ((v1-17 (rand-vu-int-range 0 2))) (cond ((zero? v1-17) - (sound-play-by-name - (static-sound-name "ogre-grunt1") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-grunt1" :position (the-as symbol (-> self root-override trans))) ) ((= v1-17 1) - (sound-play-by-name - (static-sound-name "ogre-grunt2") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-grunt2" :position (the-as symbol (-> self root-override trans))) ) (else - (sound-play-by-name - (static-sound-name "ogre-grunt3") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "ogre-grunt3" :position (the-as symbol (-> self root-override trans))) ) ) ) diff --git a/test/decompiler/reference/levels/racer_common/racer-states_REF.gc b/test/decompiler/reference/levels/racer_common/racer-states_REF.gc index 74b773f389..2f50be8b36 100644 --- a/test/decompiler/reference/levels/racer_common/racer-states_REF.gc +++ b/test/decompiler/reference/levels/racer_common/racer-states_REF.gc @@ -48,10 +48,8 @@ ) ) (('boost) - (sound-play-by-name (static-sound-name "get-blue-eco") (new-sound-id) 1024 0 0 1 #t) - (set! (-> self racer boost-sound-id) - (sound-play-by-name (static-sound-name "zoom-boost") (new-sound-id) 1024 0 0 1 #t) - ) + (sound-play "get-blue-eco") + (set! (-> self racer boost-sound-id) (sound-play "zoom-boost")) (set! (-> self racer boost-time) (-> *display* base-frame-counter)) (let ((f0-12 (seek (-> self racer boost-level) @@ -461,8 +459,8 @@ ) (when (!= (-> self racer slide-shift-x) 0.0) (if (rand-vu-percent? 0.5) - (sound-play-by-name (static-sound-name "zoomer-rev1") (new-sound-id) 819 0 0 1 #t) - (sound-play-by-name (static-sound-name "zoomer-rev2") (new-sound-id) 819 0 0 1 #t) + (sound-play "zoomer-rev1" :vol 80) + (sound-play "zoomer-rev2" :vol 80) ) ) (set! (-> self racer bounce) 0) @@ -517,7 +515,7 @@ :event (-> target-racing-start event) :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self racer shock-offsetv) 0.0) - (sound-play-by-name (static-sound-name "zoomer-jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-jump") (set! (-> self state-time) (-> *display* base-frame-counter)) (when arg2 (when (>= (-> self racer hill-ground-value) 0.11) @@ -641,7 +639,7 @@ :event (-> target-racing-start event) :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (logior! (-> self control root-prim prim-core action) (collide-action ca-15)) - (sound-play-by-name (static-sound-name "zoomer-jump") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-jump") (set! (-> self state-time) (-> *display* base-frame-counter)) (racer-calc-gravity) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) @@ -713,7 +711,7 @@ (defstate target-racing-smack (target) :event (-> target-racing-start event) :enter (behavior ((arg0 float) (arg1 symbol)) - (sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t) + (sound-play "smack-surface") (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (set! (-> self racer heavy) arg1) (vector-! (-> self control transv) (-> self control unknown-vector70) (-> self control trans)) @@ -741,7 +739,7 @@ (none) ) :code (behavior ((arg0 float) (arg1 symbol)) - (sound-play-by-name (static-sound-name "zoomer-crash-2") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-crash-2") (ja-channel-push! 2 (seconds 0.05)) (ja-no-eval :group! (-> self draw art-group data 136) :num! (seek!)) (ja :chan 1 @@ -830,7 +828,7 @@ (when (!= (-> self attack-info mode) 'endlessfall) (dummy-10 (-> self skel effect) 'group-target-hit -1.0 -1) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) - (sound-play-by-name (static-sound-name "oof") (new-sound-id) 1024 0 0 1 #t) + (sound-play "oof") ) (set! (-> self game hit-time) (-> *display* base-frame-counter)) (logior! (-> self state-flags) (state-flags being-attacked)) @@ -913,7 +911,7 @@ ((-> target-racing-start exit)) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'loop) (send-event (ppointer->process (-> self manipy)) 'draw #f) - (sound-play-by-name (static-sound-name "zoomer-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-explode") (process-spawn part-tracker :init part-tracker-init @@ -1005,7 +1003,7 @@ ) ) (('melt) - (sound-play-by-name (static-sound-name "zoomer-melt") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-melt") (process-spawn part-tracker :init part-tracker-init @@ -1028,7 +1026,7 @@ ) ) (('endlessfall) - (sound-play-by-name (static-sound-name "death-fall") (new-sound-id) 1024 0 0 1 #t) + (sound-play "death-fall") (camera-change-to (the-as string cam-endlessfall) 30 #f) (set! (-> self control pat-ignore-mask unknown-bit) 1) (let ((f30-0 (fmin -4096.0 (- (-> self control ground-impact-vel))))) @@ -1143,7 +1141,7 @@ (set! (-> self control transv quad) (the-as uint128 0)) (when (< 50.0 (ja-aframe-num 0)) (when (not gp-1) - (sound-play-by-name (static-sound-name "zoomer-start") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-start") (set! gp-1 #t) ) (set! (-> self racer front-rotv) 65536.0) @@ -1285,7 +1283,7 @@ :event target-generic-event-handler :exit (-> target-racing-start exit) :code (behavior ((arg0 handle)) - (sound-play-by-name (static-sound-name "zoomer-stop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "zoomer-stop") (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self control transv quad) (the-as uint128 0)) (let ((gp-1 (new 'stack-no-clear 'vector))) diff --git a/test/decompiler/reference/levels/racer_common/target-racer_REF.gc b/test/decompiler/reference/levels/racer_common/target-racer_REF.gc index e50777d110..2b8fca0fc0 100644 --- a/test/decompiler/reference/levels/racer_common/target-racer_REF.gc +++ b/test/decompiler/reference/levels/racer_common/target-racer_REF.gc @@ -606,14 +606,12 @@ ) ) (let ((f0-11 (lerp-scale 100.0 60.0 (-> self racer engine-sound-pitch) 0.8 2.0))) - (sound-play-by-name - (static-sound-name "zoomer-loop") - (-> self racer engine-sound-id) - (the int (* 10.24 f0-11)) - (the int (* 1524.0 (-> self racer engine-sound-pitch))) - 0 - 1 - (the-as symbol (-> self control trans)) + (sound-play + "zoomer-loop" + :id (-> self racer engine-sound-id) + :vol f0-11 + :pitch (-> self racer engine-sound-pitch) + :position (the-as symbol (-> self control trans)) ) ) (cond @@ -635,7 +633,7 @@ (>= (- (-> *display* base-frame-counter) (-> self racer heat-sound-time)) (seconds 1)) ) (set! (-> self racer heat-sound-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warning") ) ) ) @@ -989,7 +987,7 @@ 1024 0 0 - 1 + (sound-group sfx) #t ) ) @@ -1001,7 +999,7 @@ ) ) (set! (-> self racer heat-sound-time) (-> *display* base-frame-counter)) - (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warning") ) (when (rand-vu-percent? (/ (-> self racer heat) (-> *RACER-bank* heat-max))) (let ((a2-28 diff --git a/test/decompiler/reference/levels/rolling/rolling-lightning-mole_REF.gc b/test/decompiler/reference/levels/rolling/rolling-lightning-mole_REF.gc index c8a3273346..e7bd98e07b 100644 --- a/test/decompiler/reference/levels/rolling/rolling-lightning-mole_REF.gc +++ b/test/decompiler/reference/levels/rolling/rolling-lightning-mole_REF.gc @@ -1265,7 +1265,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.05) - (sound-play-by-name (static-sound-name "land-grass") (new-sound-id) 1024 0 0 1 #t) + (sound-play "land-grass") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/test/decompiler/reference/levels/rolling/rolling-obs_REF.gc b/test/decompiler/reference/levels/rolling/rolling-obs_REF.gc index fdb6f38f57..fa234b1418 100644 --- a/test/decompiler/reference/levels/rolling/rolling-obs_REF.gc +++ b/test/decompiler/reference/levels/rolling/rolling-obs_REF.gc @@ -364,7 +364,7 @@ :code (behavior () (dark-plant-randomize self) (logclear! (-> self draw status) (draw-status hidden)) - (sound-play-by-name (static-sound-name "darkvine-grow") (new-sound-id) 1024 0 0 1 #t) + (sound-play "darkvine-grow") (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -417,7 +417,7 @@ :code (behavior () (spawn (-> self part) (-> self root trans)) (ja-channel-push! 1 (seconds 0.2)) - (sound-play-by-name (static-sound-name "darkvine-kill") (new-sound-id) 1024 0 0 1 #t) + (sound-play "darkvine-kill") (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -439,7 +439,7 @@ (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (if (rand-vu-percent? 0.3) - (sound-play-by-name (static-sound-name "darkvine-move") (new-sound-id) 1024 0 0 1 #t) + (sound-play "darkvine-move") ) (when (task-closed? (game-task rolling-plants) (task-status need-hint)) (level-hint-spawn @@ -972,7 +972,7 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('break) - (sound-play-by-name (static-sound-name "cool-rolling-st") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cool-rolling-st") (go rolling-start-break #f) ) (('break-and-die) diff --git a/test/decompiler/reference/levels/rolling/rolling-race-ring_REF.gc b/test/decompiler/reference/levels/rolling/rolling-race-ring_REF.gc index 5ea3b27e31..94e21c8a71 100644 --- a/test/decompiler/reference/levels/rolling/rolling-race-ring_REF.gc +++ b/test/decompiler/reference/levels/rolling/rolling-race-ring_REF.gc @@ -704,7 +704,7 @@ (none) ) :exit (behavior () - (sound-play-by-name (static-sound-name "close-racering") (new-sound-id) 1024 0 0 1 #t) + (sound-play "close-racering") (let ((a0-3 (handle->process (-> self part-track)))) (if a0-3 (deactivate a0-3) diff --git a/test/decompiler/reference/levels/snow/ice-cube_REF.gc b/test/decompiler/reference/levels/snow/ice-cube_REF.gc index 65f854cb23..4b852f1e35 100644 --- a/test/decompiler/reference/levels/snow/ice-cube_REF.gc +++ b/test/decompiler/reference/levels/snow/ice-cube_REF.gc @@ -1312,15 +1312,7 @@ ) (when (>= (-> *display* base-frame-counter) (-> self next-skid-sound-time)) (set! (-> self next-skid-sound-time) (+ (-> *display* base-frame-counter) (nav-enemy-rnd-int-range 60 120))) - (sound-play-by-name - (static-sound-name "ice-stop") - (new-sound-id) - (the int (* 10.24 (the float (the int (* 0.0012207031 (-> self speed)))))) - 0 - 0 - 1 - #t - ) + (sound-play "ice-stop" :vol (the float (the int (* 0.0012207031 (-> self speed))))) ) ) (let ((f30-1 (* (vector-xz-length (-> self nav travel)) (-> *display* frames-per-second)))) @@ -1502,7 +1494,7 @@ :to self ) ) - (sound-play-by-name (static-sound-name "ice-explode") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ice-explode") (suspend) (ja-channel-set! 0) (ja-post) diff --git a/test/decompiler/reference/levels/snow/snow-ball_REF.gc b/test/decompiler/reference/levels/snow/snow-ball_REF.gc index 8330f37029..65d83f8060 100644 --- a/test/decompiler/reference/levels/snow/snow-ball_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-ball_REF.gc @@ -266,7 +266,7 @@ ;; definition for method 21 of type snow-ball-roller (defmethod play-landing-sound snow-ball-roller ((obj snow-ball-roller) (arg0 float)) (let ((f30-0 (* 0.0018780049 (fmin 53248.0 (fmax 0.0 (+ -4096.0 (fabs arg0))))))) - (sound-play-by-name (static-sound-name "snowball-land") (new-sound-id) (the int (* 10.24 f30-0)) 0 0 1 #t) + (sound-play "snowball-land" :vol f30-0) ) ) @@ -359,27 +359,16 @@ (cond ((zero? (-> self rolling-sound-id)) (if (and v1-54 (-> self rolling-sound-enabled?)) - (set! (-> self rolling-sound-id) (sound-play-by-name - (static-sound-name "snowball-roll") - (new-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (set! (-> self rolling-sound-id) + (sound-play "snowball-roll" :position (the-as symbol (-> self root-override trans))) ) ) ) ((and v1-54 (-> self rolling-sound-enabled?)) - (sound-play-by-name - (static-sound-name "snowball-roll") - (-> self rolling-sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) + (sound-play + "snowball-roll" + :id (-> self rolling-sound-id) + :position (the-as symbol (-> self root-override trans)) ) ) (else diff --git a/test/decompiler/reference/levels/snow/snow-bumper_REF.gc b/test/decompiler/reference/levels/snow/snow-bumper_REF.gc index 9e7ee2e4b2..de9689d3a7 100644 --- a/test/decompiler/reference/levels/snow/snow-bumper_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-bumper_REF.gc @@ -245,7 +245,7 @@ :code (behavior () (local-vars (sv-16 symbol)) (logclear! (-> self mask) (process-mask actor-pause)) - (sound-play-by-name (static-sound-name "bumper-pwr-dwn") (new-sound-id) 1024 0 0 1 #t) + (sound-play "bumper-pwr-dwn") (ja-no-eval :group! snow-bumper-button-ja :num! (seek! max 0.05) :frame-num 0.0) (until (ja-done? 0) (spawn (-> self part) (-> self root trans)) diff --git a/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc b/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc index cc3f42b351..cafd54a405 100644 --- a/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc @@ -345,7 +345,7 @@ (none) ) :code (behavior () - (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 -1524 0 1 #t) + (sound-play "prec-button1" :pitch -1) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/test/decompiler/reference/levels/snow/snow-obs_REF.gc b/test/decompiler/reference/levels/snow/snow-obs_REF.gc index 66ae4494f0..e3a62795c3 100644 --- a/test/decompiler/reference/levels/snow/snow-obs_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-obs_REF.gc @@ -594,8 +594,8 @@ (when (not gp-0) (set! gp-0 #t) (if (>= f0-0 0.5) - (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (-> self close-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) + (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) ) ) ) @@ -713,7 +713,7 @@ (let ((v1-0 arg2)) (the-as object (when (= v1-0 'bonk) (dummy-22 self) - (sound-play-by-name (static-sound-name "snow-spat-short") (new-sound-id) 768 1143 0 1 #t) + (sound-play "snow-spat-short" :vol 75 :pitch 0.75) ) ) ) @@ -734,26 +734,10 @@ (set! gp-0 v1-3) (cond ((> v1-3 0) - (sound-play-by-name - (static-sound-name "snow-spat-long") - (new-sound-id) - 1024 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-long" :pitch (rand-vu-float-range -0.2 0.2)) ) (1 - (sound-play-by-name - (static-sound-name "snow-spat-short") - (new-sound-id) - 1024 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-short" :pitch (rand-vu-float-range -0.2 0.2)) ) ) ) @@ -1090,7 +1074,7 @@ ) ) (when (>= 1677.7216 f30-0) - (sound-play-by-name (static-sound-name "lodge-close") (new-sound-id) 1024 0 0 1 #t) + (sound-play "lodge-close") (activate! *camera-smush-control* 819.2 37 150 1.0 0.99) (go snow-fort-gate-idle-open) ) @@ -1356,7 +1340,7 @@ (none) ) :code (behavior () - (sound-play-by-name (static-sound-name "eng-start-up") (new-sound-id) 1024 0 0 1 #t) + (sound-play "eng-start-up") (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.85) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1398,7 +1382,7 @@ (ja :num! (seek! max 0.35)) ) (stop! (-> self sound)) - (sound-play-by-name (static-sound-name "eng-shut-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "eng-shut-down") (ja-no-eval :group! (-> self draw art-group data 5) :num! (seek! max 0.85) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1527,7 +1511,7 @@ (suspend) (set! v1-1 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) ) - (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 -1524 0 1 #t) + (sound-play "prec-button1" :pitch -1) (let ((gp-1 (get-process *default-dead-pool* snowcam #x4000))) (set! (-> (the-as snowcam (-> (when gp-1 (let ((t9-3 (method-of-type snowcam activate))) @@ -1786,8 +1770,8 @@ (until (ja-done? 0) (when (and (not gp-0) (>= (ja-frame-num 0) 5.0)) (set! gp-0 #t) - (sound-play-by-name (static-sound-name "explosion") (new-sound-id) 409 1371 0 1 #t) - (sound-play-by-name (static-sound-name "snow-spat-short") (new-sound-id) 1024 381 0 1 #t) + (sound-play "explosion" :vol 40 :pitch 0.9) + (sound-play "snow-spat-short" :pitch 0.25) ) (suspend) (ja :num! (seek!)) @@ -1818,28 +1802,12 @@ ((and gp-0 (< f0-4 1.0)) (set! gp-0 #f) (set! s5-0 #t) - (sound-play-by-name - (static-sound-name "snow-spat-long") - (new-sound-id) - 870 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-long" :vol 85 :pitch (rand-vu-float-range -0.2 0.2)) ) ((and s5-0 (>= f0-4 11.0)) (set! s5-0 #f) (set! gp-0 #t) - (sound-play-by-name - (static-sound-name "snow-spat-short") - (new-sound-id) - 870 - (the int (* 1524.0 (rand-vu-float-range -0.2 0.2))) - 0 - 1 - #t - ) + (sound-play "snow-spat-short" :vol 85 :pitch (rand-vu-float-range -0.2 0.2)) ) ) ) @@ -1970,7 +1938,7 @@ ) :trans (the-as (function none :behavior snow-log-button) rider-trans) :code (behavior () - (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 0 0 1 #t) + (sound-play "prec-button1") (loop (let ((f30-0 (+ -1433.6 (-> self orig-trans y)))) (when (= (-> self root-override trans y) f30-0) diff --git a/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc b/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc index 5dc20c0e8c..71a16fae12 100644 --- a/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc @@ -635,7 +635,7 @@ (set! (-> obj attack-mode) 'snow-ram-proj) (set! (-> obj launch-time) (-> *display* base-frame-counter)) (set! (-> obj timeout) (seconds 4)) - (set! (-> obj sound-id) (sound-play-by-name (static-sound-name "ramboss-track") (new-sound-id) 1024 0 0 1 #t)) + (set! (-> obj sound-id) (sound-play "ramboss-track")) (let ((v1-12 (-> obj parent-override))) (set! (-> v1-12 0 proj-stoked) #t) (set! (-> v1-12 0 proj-status) (the-as uint 1)) @@ -706,9 +706,7 @@ ) ) :code (behavior () - (set! (-> self charge-sound-id) - (sound-play-by-name (static-sound-name "ramboss-charge") (new-sound-id) 1024 0 0 1 #t) - ) + (set! (-> self charge-sound-id) (sound-play "ramboss-charge")) (loop (let ((gp-1 (-> self parent-override))) (when (-> gp-1 0 dead?) @@ -752,7 +750,7 @@ ;; failed to figure out what this is: (defstate ram-boss-proj-launch (ram-boss-proj) :code (behavior () - (sound-play-by-name (static-sound-name "ramboss-fire") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ramboss-fire") (set! (-> self launched?) #t) (set! (-> self growth) 1.0) (logior! (-> self root-override root-prim prim-core action) (collide-action solid)) @@ -784,7 +782,7 @@ (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (sound-play-by-name (static-sound-name "ramboss-hit") (new-sound-id) 1024 0 0 1 #t) + (sound-play "ramboss-hit") (suspend) (go-virtual projectile-die) (none) diff --git a/test/decompiler/reference/levels/snow/snow-ram_REF.gc b/test/decompiler/reference/levels/snow/snow-ram_REF.gc index d935774c2f..c6eba93e3e 100644 --- a/test/decompiler/reference/levels/snow/snow-ram_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-ram_REF.gc @@ -218,14 +218,14 @@ (local-vars (sv-16 symbol)) (ja-channel-push! 1 (seconds 0.075)) (loop - (sound-play-by-name (static-sound-name "set-ram") (new-sound-id) 1024 0 0 1 #t) + (sound-play "set-ram") (ja-no-eval :group! ram-cock-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) ) (let ((gp-1 #f)) - (sound-play-by-name (static-sound-name "slam-crash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "slam-crash") (logclear! (-> self mask) (process-mask actor-pause)) (ja-no-eval :group! ram-release-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -331,7 +331,7 @@ ) (set! (-> (the-as (pointer snowcam) v1-14) 0 seq) (the-as uint 1)) ) - (sound-play-by-name (static-sound-name "cell-prize") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cell-prize") (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 diff --git a/test/decompiler/reference/levels/sunken/bully_REF.gc b/test/decompiler/reference/levels/sunken/bully_REF.gc index 3c9c91ca6a..1ecee6551b 100644 --- a/test/decompiler/reference/levels/sunken/bully_REF.gc +++ b/test/decompiler/reference/levels/sunken/bully_REF.gc @@ -689,15 +689,7 @@ (set! v1-34 (or (ja-done? 0) (-> self bounced?))) ) (when (-> self bounced?) - (sound-play-by-name - (static-sound-name "bully-bounce") - (new-sound-id) - (the int (* 10.24 (the float (-> self bounce-volume)))) - 0 - 0 - 1 - #t - ) + (sound-play "bully-bounce" :vol (the float (-> self bounce-volume))) (until (not (-> self bounced?)) (set! (-> self bounced?) #f) (ja-channel-push! 1 (seconds 0.2)) @@ -761,15 +753,7 @@ (set! v1-17 (or (ja-done? 0) (-> self bounced?))) ) (when (-> self bounced?) - (sound-play-by-name - (static-sound-name "bully-bounce") - (new-sound-id) - (the int (* 10.24 (the float (-> self bounce-volume)))) - 0 - 0 - 1 - #t - ) + (sound-play "bully-bounce" :vol (the float (-> self bounce-volume))) (set! gp-0 0) (until (not (-> self bounced?)) (set! (-> self bounced?) #f) diff --git a/test/decompiler/reference/levels/sunken/helix-water_REF.gc b/test/decompiler/reference/levels/sunken/helix-water_REF.gc index 7dfe1567bc..c45fb7e719 100644 --- a/test/decompiler/reference/levels/sunken/helix-water_REF.gc +++ b/test/decompiler/reference/levels/sunken/helix-water_REF.gc @@ -385,7 +385,7 @@ (game-task none) ) (send-event *target* 'play-anim 'shock-in) - (sound-play-by-name (static-sound-name "prec-button8") (new-sound-id) 1024 0 0 1 #t) + (sound-play "prec-button8") (set! (-> self root-override transv quad) (the-as uint128 0)) (let ((gp-3 5)) (until (<= gp-3 0) @@ -414,7 +414,7 @@ (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.25)) (suspend) ) - (sound-play-by-name (static-sound-name "maindoor") (new-sound-id) 1024 0 0 1 #t) + (sound-play "maindoor") (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.9)) (suspend) ) @@ -491,8 +491,8 @@ ) ) ) - (sound-play-by-name (static-sound-name "prec-button8") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "maindoor") (new-sound-id) 1024 0 0 1 #t) + (sound-play "prec-button8") + (sound-play "maindoor") (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) self) (set! (-> a1-3 num-params) 0) diff --git a/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc b/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc index 87aa317006..169905c676 100644 --- a/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc +++ b/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc @@ -237,7 +237,7 @@ (cond (v1-3 (process-spawn qbert-plat-on (-> obj entity) obj :to obj) - (sound-play-by-name (static-sound-name "plat-light-on") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-light-on") ) (else (let ((gp-2 (-> obj child))) @@ -246,7 +246,7 @@ (set! gp-2 (-> gp-2 0 brother)) ) ) - (sound-play-by-name (static-sound-name "plat-light-off") (new-sound-id) 1024 0 0 1 #t) + (sound-play "plat-light-off") ) ) ) diff --git a/test/decompiler/reference/levels/sunken/square-platform_REF.gc b/test/decompiler/reference/levels/sunken/square-platform_REF.gc index a131267e83..e6980b6234 100644 --- a/test/decompiler/reference/levels/sunken/square-platform_REF.gc +++ b/test/decompiler/reference/levels/sunken/square-platform_REF.gc @@ -269,7 +269,7 @@ (t1-0 1) (t2-0 #t) ) - (s2-0 (the-as sound-name s1-0) s0-0 sv-48 a3-0 t0-0 t1-0 t2-0) + (s2-0 (the-as sound-name s1-0) s0-0 sv-48 a3-0 t0-0 (the-as sound-group t1-0) t2-0) ) ) ) diff --git a/test/decompiler/reference/levels/sunken/steam-cap_REF.gc b/test/decompiler/reference/levels/sunken/steam-cap_REF.gc index a36356b1cf..54bef1c7be 100644 --- a/test/decompiler/reference/levels/sunken/steam-cap_REF.gc +++ b/test/decompiler/reference/levels/sunken/steam-cap_REF.gc @@ -528,7 +528,7 @@ (set! s5-0 #f) (set! (-> obj do-falling-sound?) #t) (when (-> obj do-burst?) - (sound-play-by-name (static-sound-name "sunk-top-rises") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sunk-top-rises") (set! (-> obj do-burst?) #f) (spawn (-> obj part) (-> obj down)) (spawn (-> obj part) (-> obj down)) @@ -549,7 +549,7 @@ (set! s5-0 #t) (when (-> obj do-falling-sound?) (set! (-> obj do-falling-sound?) #f) - (sound-play-by-name (static-sound-name "sunk-top-falls") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sunk-top-falls") ) ) ) @@ -579,7 +579,7 @@ (when (< (-> s3-3 y) (-> obj down y)) (when (-> obj do-landing-sound?) (set! (-> obj do-landing-sound?) #f) - (sound-play-by-name (static-sound-name "sunk-top-lands") (new-sound-id) 1024 0 0 1 #t) + (sound-play "sunk-top-lands") ) (set! (-> s3-3 y) (-> obj down y)) (let ((f0-20 (-> s2-0 transv y))) @@ -587,7 +587,7 @@ (let ((f0-22 (* 0.3 (- f0-20)))) (set! (-> s2-0 transv y) f0-22) (if (< 7782.4 f0-22) - (sound-play-by-name (static-sound-name "sunk-top-lands") (new-sound-id) 614 0 0 1 #t) + (sound-play "sunk-top-lands" :vol 60) ) ) ) diff --git a/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc b/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc index 42d890fc3e..4ddb055059 100644 --- a/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc +++ b/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc @@ -443,7 +443,7 @@ :enter (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (if arg0 - (sound-play-by-name (static-sound-name "blue-eco-start") (new-sound-id) 1024 0 0 1 #t) + (sound-play "blue-eco-start") ) (dummy-21 self #t) (none) diff --git a/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc b/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc index b9b7701e2b..3c9a2eea0d 100644 --- a/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc +++ b/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc @@ -148,7 +148,7 @@ ) ) :code (behavior () - (sound-play-by-name (static-sound-name "irisdoor2") (new-sound-id) 1024 0 0 1 #t) + (sound-play "irisdoor2") (ja-no-eval :num! (seek!)) (until (ja-done? 0) (suspend) @@ -304,7 +304,7 @@ ) ) :code (behavior () - (sound-play-by-name (static-sound-name "irisdoor2") (new-sound-id) 1024 0 0 1 #t) + (sound-play "irisdoor2") (ja-no-eval :num! (seek! 0.0)) (until (ja-done? 0) (suspend) diff --git a/test/decompiler/reference/levels/sunken/sunken-water_REF.gc b/test/decompiler/reference/levels/sunken/sunken-water_REF.gc index 54ec1db62e..bdb69652fe 100644 --- a/test/decompiler/reference/levels/sunken/sunken-water_REF.gc +++ b/test/decompiler/reference/levels/sunken/sunken-water_REF.gc @@ -116,7 +116,7 @@ (case arg2 (('notify) (if (= (-> arg3 param 0) 'attack) - (sound-play-by-name (static-sound-name "get-shocked") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-shocked") ) ) (else @@ -153,7 +153,7 @@ (draw-ripple self) (when (not (-> self playing-deadly-sound?)) (set! (-> self playing-deadly-sound?) #t) - (sound-play-by-name (static-sound-name "water-on") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-on") ) (update! (-> self sound)) ) @@ -178,7 +178,7 @@ (when (-> self playing-deadly-sound?) (set! (-> self playing-deadly-sound?) #f) (stop! (-> self sound)) - (sound-play-by-name (static-sound-name "water-off") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-off") ) ) ) diff --git a/test/decompiler/reference/levels/sunken/target-tube_REF.gc b/test/decompiler/reference/levels/sunken/target-tube_REF.gc index 5684c5c83d..1b46a886f8 100644 --- a/test/decompiler/reference/levels/sunken/target-tube_REF.gc +++ b/test/decompiler/reference/levels/sunken/target-tube_REF.gc @@ -191,14 +191,12 @@ (let ((f30-0 (-> self tube tube-sound-vol)) (f0-5 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 122880.0)) ) - (sound-play-by-name - (static-sound-name "slide-loop") - (-> self tube tube-sound-id) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f0-5)) - 0 - 1 - (the-as symbol (-> self control trans)) + (sound-play + "slide-loop" + :id (-> self tube tube-sound-id) + :vol f30-0 + :pitch f0-5 + :position (the-as symbol (-> self control trans)) ) ) ) diff --git a/test/decompiler/reference/levels/sunken/wall-plat_REF.gc b/test/decompiler/reference/levels/sunken/wall-plat_REF.gc index f17397d25b..d395b98519 100644 --- a/test/decompiler/reference/levels/sunken/wall-plat_REF.gc +++ b/test/decompiler/reference/levels/sunken/wall-plat_REF.gc @@ -78,7 +78,7 @@ ) ) :enter (behavior () - (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + (sound-play "wall-plat") (none) ) :trans (the-as (function none :behavior wall-plat) rider-trans) @@ -134,7 +134,7 @@ ) ) :enter (behavior () - (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + (sound-play "wall-plat") (none) ) :trans (the-as (function none :behavior wall-plat) rider-trans) @@ -195,7 +195,7 @@ ) (else (when (not gp-0) - (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + (sound-play "wall-plat") (set! gp-0 #t) ) (restore-collide-with-as (-> self root-override)) diff --git a/test/decompiler/reference/levels/swamp/billy_REF.gc b/test/decompiler/reference/levels/swamp/billy_REF.gc index 8d522b7d7d..c481e03565 100644 --- a/test/decompiler/reference/levels/swamp/billy_REF.gc +++ b/test/decompiler/reference/levels/swamp/billy_REF.gc @@ -220,7 +220,7 @@ ) :code (behavior () (send-event (handle->process (-> self snack)) 'eat) - (sound-play-by-name (static-sound-name "rat-gulp") (new-sound-id) 1024 0 0 1 #t) + (sound-play "rat-gulp") (ja-channel-push! 1 (seconds 0.05)) (ja :group! (-> self draw art-group data 12)) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) @@ -245,7 +245,7 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.075)) (dotimes (gp-0 1) - (sound-play-by-name (static-sound-name "rat-eat") (new-sound-id) 1024 0 0 1 #t) + (sound-play "rat-eat") (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) (ja-no-eval :group! (-> self draw art-group data (-> self nav-info victory-anim)) :num! (seek! max f30-0) diff --git a/test/decompiler/reference/levels/swamp/kermit_REF.gc b/test/decompiler/reference/levels/swamp/kermit_REF.gc index f91e8d5f97..6b4abc6584 100644 --- a/test/decompiler/reference/levels/swamp/kermit_REF.gc +++ b/test/decompiler/reference/levels/swamp/kermit_REF.gc @@ -589,15 +589,7 @@ ) :code (behavior () (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) - (sound-play-by-name - (static-sound-name "kermit-loop") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self root-override trans)) - ) + (sound-play "kermit-loop" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) (spawn (-> self part) (-> self root-override trans)) (find-ground-and-draw-shadow (-> self root-override trans) @@ -622,7 +614,7 @@ ;; failed to figure out what this is: (defstate kermit-pulse-impact (kermit-pulse) :code (behavior () - (sound-play-by-name (static-sound-name "get-shocked") (new-sound-id) 1024 0 0 1 #t) + (sound-play "get-shocked") (process-spawn part-tracker :init part-tracker-init @@ -1381,15 +1373,7 @@ nav-enemy-default-event-handler (loop (ja-no-eval :group! kermit-turn-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (sound-play-by-name - (static-sound-name "kermit-stretch") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (-> self collide-info trans)) - ) + (sound-play "kermit-stretch" :id (-> self sound-id) :position (the-as symbol (-> self collide-info trans))) (suspend) (ja :num! (seek!)) ) diff --git a/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc b/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc index 87bbef1205..4650754b93 100644 --- a/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc @@ -667,7 +667,7 @@ (defstate swamp-rock-break (swamp-rock) :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (sound-play-by-name (static-sound-name "rock-break") (new-sound-id) 1024 0 0 1 #t) + (sound-play "rock-break") (process-spawn part-tracker :init part-tracker-init diff --git a/test/decompiler/reference/levels/title/title-obs_REF.gc b/test/decompiler/reference/levels/title/title-obs_REF.gc index 02e3ef860a..4281f17a74 100644 --- a/test/decompiler/reference/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/levels/title/title-obs_REF.gc @@ -716,7 +716,7 @@ :trans (behavior () (hide-hud-quick) (spool-push *art-control* "ndi-intro" 0 self -1.0) - (sound-group-pause (the-as uint 2)) + (sound-group-pause (sound-group music)) (none) ) :code (behavior () @@ -862,7 +862,7 @@ (remove-setting! 'sfx-volume) (remove-setting! 'music-volume) (remove-setting! 'allow-progress) - (sound-group-continue (the-as uint 2)) + (sound-group-continue (sound-group music)) (when *time-of-day-proc* (set! (-> *time-of-day-proc* 0 time-ratio) 18000.0) (set! *time-of-day-fast* #t) diff --git a/test/decompiler/reference/levels/training/training-obs_REF.gc b/test/decompiler/reference/levels/training/training-obs_REF.gc index a2edad7580..741801c6d4 100644 --- a/test/decompiler/reference/levels/training/training-obs_REF.gc +++ b/test/decompiler/reference/levels/training/training-obs_REF.gc @@ -867,7 +867,7 @@ (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 12.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 20.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-explode 4.0 -1) - (sound-play-by-name (static-sound-name "break-dummy") (new-sound-id) 1024 0 0 1 #t) + (sound-play "break-dummy") (ja-channel-set! 0) (let ((s5-2 (new 'stack 'joint-exploder-tuning 1))) (set! (-> s5-2 duration) (seconds 1.5)) @@ -1011,7 +1011,7 @@ (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 12.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-joint-explode 21.0 -1) (dummy-10 (-> self skel effect) 'group-scarecrow-explode 4.0 -1) - (sound-play-by-name (static-sound-name "break-dummy") (new-sound-id) 1024 0 0 1 #t) + (sound-play "break-dummy") (ja-channel-set! 0) (let ((s5-2 (new 'stack 'joint-exploder-tuning 1))) (set! (-> s5-2 duration) (seconds 1.5)) diff --git a/test/decompiler/reference/levels/training/training-part_REF.gc b/test/decompiler/reference/levels/training/training-part_REF.gc index 4e39bdc3b3..acd025a6ae 100644 --- a/test/decompiler/reference/levels/training/training-part_REF.gc +++ b/test/decompiler/reference/levels/training/training-part_REF.gc @@ -305,7 +305,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/test/decompiler/reference/levels/village1/assistant_REF.gc b/test/decompiler/reference/levels/village1/assistant_REF.gc index 573c29d9ad..178aa3b6b2 100644 --- a/test/decompiler/reference/levels/village1/assistant_REF.gc +++ b/test/decompiler/reference/levels/village1/assistant_REF.gc @@ -235,15 +235,7 @@ (suspend) (ja :num! (seek!)) ) - (sound-play-by-name - (static-sound-name "welding-loop") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (target-pos 0)) - ) + (sound-play "welding-loop" :id (-> self sound-id) :position (the-as symbol (target-pos 0))) (ja :group! assistant-idle-welding-ja) (let* ((f30-0 4.0) (v1-76 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -380,7 +372,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc b/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc index 5adfed4380..2bfafa80cc 100644 --- a/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc +++ b/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc @@ -852,14 +852,12 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (vector<-cspace! gp-0 (-> self node-list data 4)) - (sound-play-by-name - (static-sound-name "boat-engine") - (-> self engine-sound-id) - (the int (* 10.24 f30-0)) - (the int (* 1524.0 f28-0)) - 0 - 1 - (the-as symbol gp-0) + (sound-play + "boat-engine" + :id (-> self engine-sound-id) + :vol f30-0 + :pitch f28-0 + :position (the-as symbol gp-0) ) ) ) diff --git a/test/decompiler/reference/levels/village1/village1-part2_REF.gc b/test/decompiler/reference/levels/village1/village1-part2_REF.gc index 945ad396e7..24f2127083 100644 --- a/test/decompiler/reference/levels/village1/village1-part2_REF.gc +++ b/test/decompiler/reference/levels/village1/village1-part2_REF.gc @@ -1635,7 +1635,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/test/decompiler/reference/levels/village2/assistant-village2_REF.gc b/test/decompiler/reference/levels/village2/assistant-village2_REF.gc index 0117914f82..49bdb08148 100644 --- a/test/decompiler/reference/levels/village2/assistant-village2_REF.gc +++ b/test/decompiler/reference/levels/village2/assistant-village2_REF.gc @@ -549,15 +549,7 @@ ) ) ((< f0-9 0.6666667) - (sound-play-by-name - (static-sound-name "welding-loop") - (-> self sound-id) - 1024 - 0 - 0 - 1 - (the-as symbol (target-pos 0)) - ) + (sound-play "welding-loop" :id (-> self sound-id) :position (the-as symbol (target-pos 0))) (ja-no-eval :group! assistant-village2-idle-hut-start-welding-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -717,7 +709,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/test/decompiler/reference/levels/village2/village2-obs_REF.gc b/test/decompiler/reference/levels/village2/village2-obs_REF.gc index 3d68a258d1..6cd2459fab 100644 --- a/test/decompiler/reference/levels/village2/village2-obs_REF.gc +++ b/test/decompiler/reference/levels/village2/village2-obs_REF.gc @@ -1349,7 +1349,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "boulder-splash") (process-spawn part-tracker :init part-tracker-init @@ -1377,7 +1377,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "boulder-splash") (process-spawn part-tracker :init part-tracker-init @@ -1405,7 +1405,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) + (sound-play "v2ogre-boulder") (process-spawn part-tracker :init part-tracker-init @@ -1433,7 +1433,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "boulder-splash") (process-spawn part-tracker :init part-tracker-init @@ -1461,7 +1461,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) + (sound-play "v2ogre-boulder") (process-spawn part-tracker :init part-tracker-init @@ -1489,7 +1489,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "boulder-splash") (new-sound-id) 1024 0 0 1 #t) + (sound-play "boulder-splash") (process-spawn part-tracker :init part-tracker-init @@ -1517,7 +1517,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) + (sound-play "v2ogre-boulder") (process-spawn part-tracker :init part-tracker-init @@ -1545,7 +1545,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self draw origin quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) - (sound-play-by-name (static-sound-name "v2ogre-boulder") (new-sound-id) 1024 0 0 1 #t) + (sound-play "v2ogre-boulder") (process-spawn part-tracker :init part-tracker-init diff --git a/test/decompiler/reference/levels/village2/village2-part_REF.gc b/test/decompiler/reference/levels/village2/village2-part_REF.gc index 1de4c20c68..1973c09dbe 100644 --- a/test/decompiler/reference/levels/village2/village2-part_REF.gc +++ b/test/decompiler/reference/levels/village2/village2-part_REF.gc @@ -1951,7 +1951,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (if (< (rand-float-gen) 0.25) - (sound-play-by-name (static-sound-name "water-drop") (new-sound-id) 1024 0 0 1 #t) + (sound-play "water-drop") ) (set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) (sp-launch-particles-var diff --git a/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc b/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc index a5365f4493..d4b856b8ad 100644 --- a/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc +++ b/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc @@ -98,7 +98,7 @@ (set! (-> self post-hook) target-no-stick-post) (ja-channel-set! 1) (send-event self 'do-effect 'death-warp-in -1.0) - (sound-play-by-name (static-sound-name "warpgate-tele") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warpgate-tele") (ja-no-eval :group! (-> self draw art-group data 41) :num! (seek! (ja-aframe 50.0 0)) :frame-num (ja-aframe 40.0 0) @@ -254,7 +254,7 @@ :enter (behavior () (set-setting! 'allow-progress #f 0.0 0) (apply-settings *setting-control*) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "start-options") (set! (-> self state-time) (-> *display* base-frame-counter)) (none) ) @@ -267,7 +267,7 @@ ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-options") (go-virtual idle) ) (when *target* @@ -303,13 +303,13 @@ ((cpad-pressed? 0 right) (set! s5-0 #t) (set! s4-0 #f) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! s3-0 (get-next-slot-up self s3-0)) ) ((cpad-pressed? 0 left) (set! s5-0 #t) (set! s4-0 #t) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + (sound-play "cursor-up-down") (set! s3-0 (get-next-slot-down self s3-0)) ) ) @@ -865,8 +865,8 @@ (defstate basebutton-going-down (warp-gate-switch) :virtual #t :code (behavior () - (sound-play-by-name (static-sound-name "warpgate-butt") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "warpgate-act") (new-sound-id) 1024 0 0 1 #t) + (sound-play "warpgate-butt") + (sound-play "warpgate-act") (let ((gp-2 (entity-actor-count (-> self entity) 'trigger-actor))) (dotimes (s5-2 gp-2) (let ((s4-0 (entity-actor-lookup (-> self entity) 'trigger-actor s5-2))