From 51d008f9ab9c16623306ba6d4ca525327fb384b9 Mon Sep 17 00:00:00 2001 From: Hat Kid <6624576+Hat-Kid@users.noreply.github.com> Date: Sat, 7 Dec 2024 23:10:49 +0100 Subject: [PATCH] decompiler: detect and turn inverse mult to div (#3795) Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com> --- common/goos/Object.h | 16 +- decompiler/IR2/AtomicOp.cpp | 7 + decompiler/IR2/AtomicOp.h | 2 + decompiler/IR2/Form.cpp | 9 +- decompiler/IR2/Form.h | 2 + decompiler/IR2/FormExpressionAnalysis.cpp | 70 ++++- decompiler/IR2/GenericElementMatcher.cpp | 31 +++ decompiler/IR2/GenericElementMatcher.h | 4 + goal_src/jak1/engine/anim/joint-exploder.gc | 15 +- goal_src/jak1/engine/camera/cam-layout.gc | 13 +- goal_src/jak1/engine/camera/cam-master.gc | 6 +- goal_src/jak1/engine/camera/cam-states-dbg.gc | 21 +- goal_src/jak1/engine/camera/cam-states.gc | 12 +- goal_src/jak1/engine/camera/cam-update.gc | 12 +- goal_src/jak1/engine/camera/camera.gc | 23 +- goal_src/jak1/engine/collide/collide-probe.gc | 2 +- goal_src/jak1/engine/collide/collide-touch.gc | 2 +- goal_src/jak1/engine/collide/surface-h.gc | 7 +- .../jak1/engine/common-obs/collectables.gc | 21 +- goal_src/jak1/engine/common-obs/crates.gc | 6 +- .../jak1/engine/common-obs/dark-eco-pool.gc | 4 +- .../jak1/engine/common-obs/generic-obs.gc | 2 +- goal_src/jak1/engine/common-obs/nav-enemy.gc | 6 +- goal_src/jak1/engine/common-obs/plat-eco.gc | 3 +- goal_src/jak1/engine/common-obs/rigid-body.gc | 11 +- goal_src/jak1/engine/common-obs/ropebridge.gc | 7 +- goal_src/jak1/engine/common-obs/sharkey.gc | 3 +- goal_src/jak1/engine/common-obs/water.gc | 28 +- goal_src/jak1/engine/debug/anim-tester.gc | 11 +- goal_src/jak1/engine/debug/default-menu.gc | 9 +- goal_src/jak1/engine/game/effect-control.gc | 2 +- goal_src/jak1/engine/geometry/cylinder.gc | 6 +- goal_src/jak1/engine/gfx/foreground/ripple.gc | 4 +- goal_src/jak1/engine/gfx/mood/mood.gc | 51 ++-- goal_src/jak1/engine/gfx/mood/weather-part.gc | 6 +- goal_src/jak1/engine/physics/dynamics-h.gc | 5 +- goal_src/jak1/engine/physics/trajectory.gc | 4 +- .../engine/target/collide-reaction-target.gc | 2 +- goal_src/jak1/engine/target/logic-target.gc | 2 +- goal_src/jak1/engine/target/target-util.gc | 7 +- goal_src/jak1/engine/target/target.gc | 11 +- goal_src/jak1/engine/target/target2.gc | 11 +- goal_src/jak1/engine/ui/hud-classes.gc | 11 +- .../jak1/engine/ui/progress/progress-draw.gc | 6 +- goal_src/jak1/levels/beach/beach-obs.gc | 2 +- goal_src/jak1/levels/beach/lurkerworm.gc | 2 +- goal_src/jak1/levels/citadel/citb-plat.gc | 12 +- goal_src/jak1/levels/finalboss/light-eco.gc | 2 +- .../jak1/levels/finalboss/robotboss-weapon.gc | 19 +- .../jak1/levels/flut_common/target-flut.gc | 32 +-- goal_src/jak1/levels/jungle/fisher.gc | 2 +- goal_src/jak1/levels/jungle/jungle-obs.gc | 28 +- .../jak1/levels/lavatube/lavatube-energy.gc | 2 +- goal_src/jak1/levels/maincave/baby-spider.gc | 7 +- .../jak1/levels/maincave/driller-lurker.gc | 6 +- goal_src/jak1/levels/maincave/gnawer.gc | 4 +- .../jak1/levels/maincave/mother-spider.gc | 4 +- goal_src/jak1/levels/misty/balloonlurker.gc | 5 +- goal_src/jak1/levels/misty/misty-obs.gc | 2 +- goal_src/jak1/levels/misty/mistycannon.gc | 10 +- goal_src/jak1/levels/misty/muse.gc | 8 +- goal_src/jak1/levels/misty/quicksandlurker.gc | 2 +- goal_src/jak1/levels/ogre/flying-lurker.gc | 2 +- goal_src/jak1/levels/ogre/ogreboss.gc | 8 +- .../jak1/levels/racer_common/racer-states.gc | 40 +-- .../jak1/levels/racer_common/target-racer.gc | 24 +- goal_src/jak1/levels/rolling/rolling-obs.gc | 4 +- .../jak1/levels/rolling/rolling-robber.gc | 2 +- goal_src/jak1/levels/snow/ice-cube.gc | 2 +- goal_src/jak1/levels/snow/snow-ball.gc | 13 +- goal_src/jak1/levels/snow/snow-bunny.gc | 9 +- goal_src/jak1/levels/sunken/helix-water.gc | 12 +- goal_src/jak1/levels/sunken/puffer.gc | 12 +- goal_src/jak1/levels/sunken/steam-cap.gc | 2 +- goal_src/jak1/levels/sunken/target-tube.gc | 5 +- goal_src/jak1/levels/sunken/whirlpool.gc | 2 +- goal_src/jak1/levels/swamp/kermit.gc | 4 +- goal_src/jak1/levels/swamp/swamp-rat.gc | 7 +- .../jak1/levels/village1/fishermans-boat.gc | 6 +- goal_src/jak1/levels/village2/swamp-blimp.gc | 14 +- goal_src/jak2/engine/camera/cam-layout.gc | 2 +- goal_src/jak2/engine/camera/cam-master.gc | 4 +- goal_src/jak2/engine/camera/cam-states-dbg.gc | 20 +- goal_src/jak2/engine/camera/cam-states.gc | 4 +- goal_src/jak2/engine/camera/camera.gc | 18 +- goal_src/jak2/engine/collide/collide-touch.gc | 2 +- .../jak2/engine/common_objs/blocking-plane.gc | 18 +- .../jak2/engine/common_objs/collectables.gc | 102 +++---- goal_src/jak2/engine/common_objs/crates.gc | 4 +- .../jak2/engine/common_objs/dark-eco-pool.gc | 2 +- goal_src/jak2/engine/common_objs/water.gc | 26 +- goal_src/jak2/engine/debug/default-menu.gc | 37 ++- goal_src/jak2/engine/debug/editable-player.gc | 14 +- goal_src/jak2/engine/debug/editable.gc | 6 +- .../jak2/engine/debug/nav/nav-graph-editor.gc | 7 +- goal_src/jak2/engine/game/effect-control.gc | 2 +- goal_src/jak2/engine/geometry/cylinder.gc | 4 +- goal_src/jak2/engine/gfx/foreground/ripple.gc | 12 +- goal_src/jak2/engine/gfx/hw/video.gc | 12 +- goal_src/jak2/engine/gfx/mood/mood-funcs.gc | 14 +- goal_src/jak2/engine/gfx/mood/mood-funcs2.gc | 18 +- goal_src/jak2/engine/gfx/mood/mood-tables2.gc | 249 ++++++++++-------- goal_src/jak2/engine/gfx/mood/mood.gc | 24 +- goal_src/jak2/engine/gfx/mood/time-of-day.gc | 13 +- goal_src/jak2/engine/gfx/ocean/ocean-mid.gc | 4 +- goal_src/jak2/engine/gfx/ocean/ocean-near.gc | 4 +- .../jak2/engine/gfx/ocean/ocean-texture.gc | 6 +- goal_src/jak2/engine/gfx/ocean/ocean.gc | 20 +- .../engine/gfx/sprite/particles/sparticle.gc | 4 +- .../jak2/engine/gfx/sprite/sprite-distort.gc | 10 +- .../jak2/engine/gfx/sprite/sprite-glow.gc | 2 +- goal_src/jak2/engine/physics/dynamics-h.gc | 6 +- goal_src/jak2/engine/physics/rigid-body.gc | 18 +- goal_src/jak2/engine/physics/trajectory.gc | 4 +- goal_src/jak2/engine/scene/scene.gc | 18 +- goal_src/jak2/engine/sound/gsound.gc | 184 ++++++++----- .../jak2/engine/target/board/board-states.gc | 15 +- .../jak2/engine/target/board/target-board.gc | 14 +- .../engine/target/collide-reaction-target.gc | 2 +- .../jak2/engine/target/gun/gun-yellow-shot.gc | 2 +- goal_src/jak2/engine/target/logic-target.gc | 3 +- goal_src/jak2/engine/target/mech/mech-part.gc | 2 +- .../jak2/engine/target/mech/mech-states.gc | 16 +- goal_src/jak2/engine/target/surface-h.gc | 9 +- goal_src/jak2/engine/target/target-anim.gc | 8 +- goal_src/jak2/engine/target/target-carry.gc | 2 +- goal_src/jak2/engine/target/target-darkjak.gc | 2 +- goal_src/jak2/engine/target/target-death.gc | 35 ++- goal_src/jak2/engine/target/target-gun.gc | 4 +- goal_src/jak2/engine/target/target-swim.gc | 4 +- goal_src/jak2/engine/target/target-tube.gc | 12 +- .../jak2/engine/target/target-turret-shot.gc | 2 +- goal_src/jak2/engine/target/target-turret.gc | 2 +- goal_src/jak2/engine/target/target-util.gc | 10 +- goal_src/jak2/engine/target/target.gc | 8 +- goal_src/jak2/engine/target/target2.gc | 19 +- goal_src/jak2/engine/ui/hud.gc | 2 +- goal_src/jak2/engine/ui/minimap.gc | 27 +- goal_src/jak2/engine/ui/text.gc | 26 +- goal_src/jak2/engine/util/smush-control-h.gc | 46 ++-- goal_src/jak2/engine/util/sync-info.gc | 6 +- goal_src/jak2/levels/atoll/atoll-obs.gc | 20 +- .../levels/castle/boss/casboss-texture.gc | 4 +- .../jak2/levels/castle/boss/castle-baron.gc | 2 +- goal_src/jak2/levels/castle/castle-texture.gc | 2 +- .../jak2/levels/castle/roboguard-level.gc | 6 +- goal_src/jak2/levels/city/bombbot/bombbot.gc | 4 +- goal_src/jak2/levels/city/common/nav-graph.gc | 8 +- goal_src/jak2/levels/city/common/trail.gc | 2 +- goal_src/jak2/levels/city/ctywide-obs.gc | 14 +- .../jak2/levels/city/onintent/onin-game.gc | 10 +- .../jak2/levels/city/palace/ctypal-obs.gc | 27 +- .../jak2/levels/city/slums/kor/kid3-course.gc | 2 +- .../jak2/levels/city/slums/kor/kor3-course.gc | 2 +- .../city/traffic/citizen/citizen-norm.gc | 2 +- .../levels/city/traffic/citizen/citizen.gc | 24 +- .../levels/city/traffic/citizen/civilian.gc | 4 +- .../jak2/levels/city/traffic/citizen/guard.gc | 22 +- .../city/traffic/citizen/metalhead-flitter.gc | 8 +- .../traffic/citizen/metalhead-predator.gc | 14 +- .../levels/city/traffic/traffic-engine.gc | 24 +- .../jak2/levels/city/traffic/vehicle/bike.gc | 86 +++--- .../jak2/levels/city/traffic/vehicle/car.gc | 70 ++--- .../city/traffic/vehicle/vehicle-effects.gc | 12 +- .../city/traffic/vehicle/vehicle-guard.gc | 2 +- .../city/traffic/vehicle/vehicle-physics.gc | 8 +- .../city/traffic/vehicle/vehicle-util.gc | 12 +- .../levels/city/traffic/vehicle/vehicle.gc | 6 +- .../jak2/levels/common/ai/sig/sig-plasma.gc | 2 +- .../jak2/levels/common/ai/sig/sig-states.gc | 10 +- goal_src/jak2/levels/common/ai/sig/sig.gc | 6 +- goal_src/jak2/levels/common/elec-gate.gc | 33 +-- .../jak2/levels/common/enemy/centurion.gc | 2 +- goal_src/jak2/levels/common/enemy/flitter.gc | 2 +- .../common/enemy/hover/crimson-guard-hover.gc | 8 +- .../common/enemy/hover/hover-nav-control.gc | 6 +- .../common/enemy/hover/hover-nav-edit.gc | 2 +- .../jak2/levels/common/enemy/hover/wasp.gc | 6 +- goal_src/jak2/levels/common/enemy/spyder.gc | 5 +- .../jak2/levels/common/entities/gun-buoy.gc | 12 +- .../jak2/levels/common/entities/spydroid.gc | 8 +- .../jak2/levels/common/guard-projectile.gc | 2 +- .../levels/common/metalhead-projectile.gc | 2 +- .../jak2/levels/common/race/race-manager.gc | 7 +- goal_src/jak2/levels/common/race/race-mesh.gc | 4 +- .../jak2/levels/consite/consite-scenes.gc | 2 +- goal_src/jak2/levels/dig/dig-digger.gc | 2 +- goal_src/jak2/levels/dig/dig3-obs.gc | 8 +- goal_src/jak2/levels/drill/drill-baron.gc | 14 +- goal_src/jak2/levels/drill/drill-obs.gc | 18 +- goal_src/jak2/levels/drill/ginsu.gc | 2 +- goal_src/jak2/levels/forest/forest-obs.gc | 44 ++-- goal_src/jak2/levels/forest/pegasus.gc | 96 +++---- goal_src/jak2/levels/forest/predator.gc | 41 +-- goal_src/jak2/levels/forest/wren.gc | 14 +- .../fortress/dump/fort-robotank-turret.gc | 10 +- .../levels/fortress/dump/fort-robotank.gc | 4 +- .../levels/fortress/rescue/forrescb-obs.gc | 39 +-- goal_src/jak2/levels/intro/intro-scenes.gc | 4 +- goal_src/jak2/levels/mountain/mountain-obs.gc | 30 +-- goal_src/jak2/levels/mountain/rhino.gc | 2 +- .../jak2/levels/nest/boss/metalkor-extras.gc | 10 +- .../jak2/levels/nest/boss/metalkor-states.gc | 8 +- .../jak2/levels/nest/boss/nestb-scenes.gc | 2 +- .../jak2/levels/palace/boss/squid-setup.gc | 37 +-- .../jak2/levels/palace/boss/squid-states.gc | 2 +- .../jak2/levels/palace/cable/palcab-obs.gc | 61 ++--- .../levels/palace/throne/metalkor-texture.gc | 4 +- goal_src/jak2/levels/ruins/mechtest-obs.gc | 22 +- goal_src/jak2/levels/ruins/pillar-collapse.gc | 12 +- goal_src/jak2/levels/ruins/rapid-gunner.gc | 24 +- goal_src/jak2/levels/sewer/sewer-obs2.gc | 5 +- goal_src/jak2/levels/stadium/stadium-obs.gc | 8 +- goal_src/jak2/levels/tomb/widow-baron.gc | 14 +- goal_src/jak2/levels/tomb/widow-extras.gc | 10 +- goal_src/jak2/levels/under/jellyfish.gc | 17 +- goal_src/jak2/levels/under/under-obs.gc | 2 +- goal_src/jak2/levels/under/underb-master.gc | 18 +- goal_src/jak3/engine/camera/cam-layout.gc | 2 +- goal_src/jak3/engine/camera/cam-master.gc | 12 +- goal_src/jak3/engine/camera/cam-states-dbg.gc | 16 +- goal_src/jak3/engine/camera/cam-states.gc | 4 +- goal_src/jak3/engine/camera/camera.gc | 18 +- goal_src/jak3/engine/collide/collide-touch.gc | 2 +- .../jak3/engine/common-obs/blocking-plane.gc | 8 +- .../jak3/engine/common-obs/collectables.gc | 10 +- goal_src/jak3/engine/common-obs/crates.gc | 13 +- .../jak3/engine/common-obs/enemy-states.gc | 19 +- .../engine/common-obs/guard-projectile.gc | 2 +- .../engine/common-obs/metalhead-projectile.gc | 2 +- goal_src/jak3/engine/common-obs/water.gc | 4 +- .../jak3/engine/debug/collision-editor.gc | 2 +- goal_src/jak3/engine/debug/default-menu.gc | 30 +-- goal_src/jak3/engine/debug/manipulator.gc | 22 +- goal_src/jak3/engine/game/effect-control.gc | 2 +- goal_src/jak3/engine/game/game-info.gc | 12 +- goal_src/jak3/engine/game/settings.gc | 2 +- goal_src/jak3/engine/game/task/task-arrow.gc | 4 +- .../engine/gfx/background/hfrag/hfrag-work.gc | 2 +- .../jak3/engine/gfx/background/hfrag/hfrag.gc | 10 +- goal_src/jak3/engine/gfx/blit-displays.gc | 8 +- goal_src/jak3/engine/gfx/foreground/ripple.gc | 2 +- .../gfx/generic/lightning/lightning-new.gc | 8 +- goal_src/jak3/engine/gfx/hw/video.gc | 2 +- goal_src/jak3/engine/gfx/mood/mood-tables2.gc | 4 +- goal_src/jak3/engine/gfx/mood/mood.gc | 8 +- goal_src/jak3/engine/gfx/ocean/ocean-mid.gc | 4 +- goal_src/jak3/engine/gfx/ocean/ocean-near.gc | 4 +- .../jak3/engine/gfx/ocean/ocean-texture.gc | 6 +- goal_src/jak3/engine/gfx/ocean/ocean.gc | 20 +- .../gfx/sprite/particles/light-trails.gc | 6 +- .../engine/gfx/sprite/particles/sparticle.gc | 4 +- .../jak3/engine/gfx/sprite/sprite-distort.gc | 4 +- .../jak3/engine/gfx/sprite/sprite-glow.gc | 2 +- goal_src/jak3/engine/nav/nav-mesh.gc | 2 +- goal_src/jak3/engine/physics/cloth.gc | 28 +- goal_src/jak3/engine/physics/dynamics-h.gc | 6 +- goal_src/jak3/engine/physics/ragdoll-edit.gc | 6 +- goal_src/jak3/engine/physics/rigid-body.gc | 4 +- goal_src/jak3/engine/physics/trajectory.gc | 4 +- .../process-drawable/process-drawable.gc | 21 +- goal_src/jak3/engine/sound/gsound.gc | 11 +- .../jak3/engine/target/board/board-states.gc | 23 +- .../jak3/engine/target/board/target-board.gc | 16 +- .../engine/target/collide-reaction-target.gc | 2 +- .../jak3/engine/target/gun/gun-blue-shot.gc | 14 +- .../jak3/engine/target/gun/gun-dark-shot.gc | 41 ++- goal_src/jak3/engine/target/gun/gun-part.gc | 2 +- .../jak3/engine/target/gun/gun-red-shot.gc | 10 +- .../jak3/engine/target/gun/gun-yellow-shot.gc | 14 +- goal_src/jak3/engine/target/logic-target.gc | 2 +- goal_src/jak3/engine/target/mech/mech-part.gc | 2 +- .../jak3/engine/target/mech/mech-states.gc | 12 +- goal_src/jak3/engine/target/surface-h.gc | 6 +- goal_src/jak3/engine/target/target-anim.gc | 8 +- goal_src/jak3/engine/target/target-darkjak.gc | 6 +- goal_src/jak3/engine/target/target-death.gc | 29 +- goal_src/jak3/engine/target/target-gun.gc | 4 +- .../jak3/engine/target/target-invisible.gc | 10 +- goal_src/jak3/engine/target/target-launch.gc | 4 +- .../jak3/engine/target/target-lightjak.gc | 13 +- goal_src/jak3/engine/target/target-swim.gc | 4 +- goal_src/jak3/engine/target/target-tube.gc | 2 +- .../jak3/engine/target/target-turret-shot.gc | 2 +- goal_src/jak3/engine/target/target-util.gc | 10 +- goal_src/jak3/engine/target/target.gc | 6 +- goal_src/jak3/engine/target/target2.gc | 25 +- goal_src/jak3/engine/ui/hud-classes.gc | 2 +- goal_src/jak3/engine/ui/hud.gc | 2 +- .../jak3/engine/ui/progress/progress-draw.gc | 24 +- goal_src/jak3/engine/ui/progress/progress.gc | 34 +-- goal_src/jak3/engine/ui/text.gc | 2 +- goal_src/jak3/engine/util/smush-control-h.gc | 2 +- goal_src/jak3/engine/util/sync-info.gc | 6 +- .../levels/city/blow-tower/blow-tower-obs.gc | 16 +- .../levels/city/blow-tower/blow-tower-obs2.gc | 31 ++- .../levels/city/blow-tower/cty-blow-tower.gc | 18 +- goal_src/jak3/levels/city/bombbot/bombbot.gc | 6 +- .../jak3/levels/city/common/guard-grenade.gc | 2 +- .../jak3/levels/city/common/guard-states.gc | 2 +- goal_src/jak3/levels/city/common/nav-graph.gc | 6 +- goal_src/jak3/levels/city/common/trail.gc | 2 +- goal_src/jak3/levels/city/ctywide-obs.gc | 11 +- .../jak3/levels/city/hijack/cty-hijack.gc | 14 +- .../jak3/levels/city/hijack/guide-arrow.gc | 2 +- .../levels/city/port/attack/ctyport-attack.gc | 18 +- .../jak3/levels/city/port/attack/h-torpedo.gc | 22 +- .../jak3/levels/city/protect/assault-task.gc | 11 +- .../jak3/levels/city/protect/flying-turret.gc | 8 +- .../levels/city/protect/protect-gunship.gc | 19 +- .../levels/city/protect/roboguard-city.gc | 21 +- .../levels/city/sniper/cty-sniper-turret.gc | 32 ++- .../city/traffic/citizen/citizen-norm.gc | 2 +- .../levels/city/traffic/citizen/citizen.gc | 2 +- .../levels/city/traffic/citizen/civilian.gc | 2 +- .../city/traffic/citizen/metalhead-flitter.gc | 8 +- .../traffic/citizen/metalhead-predator.gc | 2 +- .../levels/city/traffic/traffic-engine.gc | 4 +- .../jak3/levels/city/traffic/vehicle/bike.gc | 16 +- .../jak3/levels/city/traffic/vehicle/car.gc | 8 +- .../city/traffic/vehicle/vehicle-effects.gc | 12 +- .../city/traffic/vehicle/vehicle-physics.gc | 2 +- .../city/traffic/vehicle/vehicle-util.gc | 2 +- .../levels/city/traffic/vehicle/vehicle.gc | 4 +- .../levels/city/vinroom/ljkdxvin-texture.gc | 4 +- goal_src/jak3/levels/comb/comb-field.gc | 6 +- goal_src/jak3/levels/comb/comb-sentry.gc | 5 +- goal_src/jak3/levels/comb/h-sled.gc | 37 +-- goal_src/jak3/levels/comb/railx-mood.gc | 2 +- goal_src/jak3/levels/common-obs/ladder.gc | 12 +- goal_src/jak3/levels/common/elec-gate.gc | 8 +- .../common/enemy/darkprec/dp-bipedal.gc | 2 +- .../levels/common/enemy/darkprec/neo-wasp.gc | 7 +- goal_src/jak3/levels/common/enemy/flitter.gc | 8 +- .../levels/common/enemy/hover/robo-hover.gc | 8 +- goal_src/jak3/levels/common/enemy/mantis.gc | 17 +- .../common/enemy/prebot-eco-creature.gc | 14 +- goal_src/jak3/levels/common/enemy/spyder.gc | 5 +- .../jak3/levels/common/enemy/spydroid-orig.gc | 11 +- goal_src/jak3/levels/common/enemy/spydroid.gc | 4 +- .../levels/common/external-player-control.gc | 4 +- .../levels/common/hvehicle/squad-control.gc | 2 +- .../levels/common/hvehicle/turret-control.gc | 2 +- .../jak3/levels/common/race/race-manager.gc | 6 +- goal_src/jak3/levels/common/race/race-mesh.gc | 4 +- .../levels/desert/boss/terraformer-setup.gc | 4 +- .../jak3/levels/desert/des-burning-bush.gc | 8 +- goal_src/jak3/levels/desert/des-bush.gc | 4 +- goal_src/jak3/levels/desert/des-cactus.gc | 7 +- .../jak3/levels/desert/desert-dust-storm.gc | 8 +- .../jak3/levels/desert/hover/des-beast-2.gc | 14 +- .../jak3/levels/desert/hover/des-beast.gc | 4 +- .../levels/desert/hover/deshover-texture.gc | 4 +- .../levels/desert/race/turtle-training.gc | 27 +- .../levels/desert/rescue/desert-rescue.gc | 9 +- .../levels/desert/rescue/neo-satellite.gc | 12 +- .../desert/wvehicle/was-squad-control.gc | 2 +- .../levels/desert/wvehicle/wcar-marauder.gc | 2 +- .../levels/desert/wvehicle/wcar-mirage.gc | 2 +- .../desert/wvehicle/wcar-projectiles.gc | 4 +- .../jak3/levels/desert/wvehicle/wcar-rhino.gc | 2 +- .../levels/desert/wvehicle/wcar-scorpion.gc | 6 +- .../jak3/levels/desert/wvehicle/wcar-toad.gc | 4 +- .../levels/desert/wvehicle/wcar-turtle.gc | 6 +- .../levels/desert/wvehicle/wvehicle-ai.gc | 2 +- .../levels/desert/wvehicle/wvehicle-hud.gc | 2 +- .../desert/wvehicle/wvehicle-physics.gc | 12 +- .../levels/desert/wvehicle/wvehicle-states.gc | 4 +- .../jak3/levels/desert/wvehicle/wvehicle.gc | 6 +- .../levels/factory/car/hvehicle-physics.gc | 8 +- .../jak3/levels/factory/car/hvehicle-util.gc | 2 +- goal_src/jak3/levels/factory/car/hvehicle.gc | 6 +- .../levels/factory/fac-robotank-turret.gc | 16 +- goal_src/jak3/levels/factory/fac-robotank.gc | 8 +- goal_src/jak3/levels/factory/fac-tower.gc | 9 +- .../levels/factory/factory-boss-states.gc | 4 +- .../jak3/levels/factory/factory-manager.gc | 2 +- .../jak3/levels/factory/ffight-projectile.gc | 2 +- .../jak3/levels/factory/ftank-projectile.gc | 2 +- .../jak3/levels/factory/fturret-projectile.gc | 2 +- goal_src/jak3/levels/factory/h-warf.gc | 14 +- goal_src/jak3/levels/factory/missile-bot.gc | 2 +- .../jak3/levels/factory/warf-projectile.gc | 4 +- .../jak3/levels/forest/for-turret-shot.gc | 2 +- goal_src/jak3/levels/forest/for-turret.gc | 2 +- goal_src/jak3/levels/forest/foresta-obs.gc | 2 +- goal_src/jak3/levels/glider/glider-manager.gc | 8 +- goal_src/jak3/levels/glider/h-glider.gc | 2 +- .../jak3/levels/hiphog/ltnfxhip-texture.gc | 4 +- .../jak3/levels/mhcity/destroy-dark-eco.gc | 8 +- goal_src/jak3/levels/mine/gekko.gc | 10 +- goal_src/jak3/levels/mine/manta.gc | 2 +- goal_src/jak3/levels/mine/mine-obs.gc | 11 +- goal_src/jak3/levels/mine/prebot-extras.gc | 4 +- goal_src/jak3/levels/mine/prebot-states.gc | 4 +- goal_src/jak3/levels/mine/rat.gc | 5 +- goal_src/jak3/levels/nest/egg-spider.gc | 10 +- goal_src/jak3/levels/nest/mh-centipede.gc | 18 +- .../jak3/levels/precursor/precura-obs2.gc | 9 +- goal_src/jak3/levels/sewer/mh-wasp.gc | 9 +- goal_src/jak3/levels/sewer/saberfish.gc | 6 +- .../jak3/levels/sewer/sew-laser-turret.gc | 9 +- goal_src/jak3/levels/sewer/sew-whirlpool.gc | 2 +- .../jak3/levels/sewer/sewer-move-turret.gc | 2 +- .../jak3/levels/stadium/dm-mine-spider.gc | 8 +- goal_src/jak3/levels/stadium/rubble-part.gc | 4 +- goal_src/jak3/levels/temple/temple-obs.gc | 39 +-- goal_src/jak3/levels/temple/temple-obs2.gc | 2 +- .../jak3/levels/temple/templea-texture.gc | 8 +- goal_src/jak3/levels/volcano/volcano-obs.gc | 7 +- goal_src/jak3/levels/volcano/volcano-obs2.gc | 4 +- .../jak3/levels/volcano/volcano-scenes.gc | 4 +- goal_src/jak3/levels/volcano/volcanox-obs.gc | 8 +- .../jak3/levels/volcano/volcanox-texture.gc | 4 +- goal_src/jak3/levels/wascity/ctymark-obs.gc | 2 +- .../levels/wascity/defend/was-pre-game.gc | 34 +-- goal_src/jak3/levels/wascity/dm-flyer.gc | 2 +- goal_src/jak3/levels/wascity/tizard.gc | 8 +- .../jak3/levels/wascity/wascity-turret.gc | 9 +- .../jak3/levels/wascity/wasdef-manager.gc | 8 +- goal_src/jak3/levels/wascity/wasgun-hud.gc | 2 +- .../jak3/levels/wascity/wasgun-manager.gc | 9 +- .../levels/wascity/wasstadium/wasstadb-obs.gc | 8 +- .../levels/wascity/wasstadium/wasstadc-obs.gc | 24 +- goal_src/jak3/levels/wascity/wlander-male.gc | 2 +- goal_src/jak3/pc/debug/default-menu-pc.gc | 1 + .../jak1/engine/anim/joint-exploder_REF.gc | 2 +- .../jak1/engine/camera/cam-layout_REF.gc | 2 +- .../jak1/engine/camera/cam-master_REF.gc | 4 +- .../jak1/engine/camera/cam-states-dbg_REF.gc | 44 ++-- .../jak1/engine/camera/cam-states_REF.gc | 6 +- .../jak1/engine/camera/cam-update_REF.gc | 8 +- .../jak1/engine/camera/camera_REF.gc | 24 +- .../jak1/engine/collide/collide-probe_REF.gc | 2 +- .../jak1/engine/collide/collide-touch_REF.gc | 2 +- .../jak1/engine/collide/surface-h_REF.gc | 6 +- .../engine/common-obs/collectables_REF.gc | 4 +- .../jak1/engine/common-obs/crates_REF.gc | 6 +- .../engine/common-obs/dark-eco-pool_REF.gc | 4 +- .../jak1/engine/common-obs/generic-obs_REF.gc | 2 +- .../jak1/engine/common-obs/nav-enemy_REF.gc | 6 +- .../jak1/engine/common-obs/plat-eco_REF.gc | 2 +- .../jak1/engine/common-obs/rigid-body_REF.gc | 2 +- .../jak1/engine/common-obs/ropebridge_REF.gc | 4 +- .../jak1/engine/common-obs/sharkey_REF.gc | 2 +- .../jak1/engine/common-obs/water_REF.gc | 28 +- .../jak1/engine/debug/anim-tester_REF.gc | 2 +- .../jak1/engine/debug/default-menu_REF.gc | 8 +- .../jak1/engine/draw/drawable_REF.gc | 2 +- .../jak1/engine/game/effect-control_REF.gc | 2 +- .../jak1/engine/game/settings_REF.gc | 2 +- .../jak1/engine/geometry/cylinder_REF.gc | 4 +- .../jak1/engine/geometry/geometry_REF.gc | 12 +- .../engine/gfx/background/subdivide_REF.gc | 10 +- .../jak1/engine/gfx/foreground/ripple_REF.gc | 2 +- .../jak1/engine/gfx/hw/display_REF.gc | 4 +- .../jak1/engine/gfx/math-camera_REF.gc | 2 +- .../jak1/engine/gfx/mood/mood_REF.gc | 41 ++- .../jak1/engine/gfx/mood/time-of-day_REF.gc | 6 +- .../jak1/engine/gfx/mood/weather-part_REF.gc | 6 +- .../gfx/sprite/sparticle/sparticle_REF.gc | 4 +- .../engine/gfx/sprite/sprite-distort_REF.gc | 10 +- .../jak1/engine/math/quaternion_REF.gc | 9 +- .../jak1/engine/math/transformq_REF.gc | 2 +- .../jak1/engine/physics/dynamics-h_REF.gc | 6 +- .../jak1/engine/physics/trajectory_REF.gc | 5 +- .../reference/jak1/engine/sound/gsound_REF.gc | 6 +- .../target/collide-reaction-target_REF.gc | 2 +- .../jak1/engine/target/logic-target_REF.gc | 2 +- .../jak1/engine/target/target-util_REF.gc | 6 +- .../jak1/engine/target/target2_REF.gc | 6 +- .../jak1/engine/target/target_REF.gc | 10 +- .../jak1/engine/ui/hud-classes_REF.gc | 7 +- .../engine/ui/progress/progress-draw_REF.gc | 8 +- .../reference/jak1/engine/ui/text_REF.gc | 2 +- .../jak1/engine/util/smush-control-h_REF.gc | 2 +- .../jak1/engine/util/sync-info_REF.gc | 6 +- .../jak1/levels/beach/beach-obs_REF.gc | 2 +- .../jak1/levels/beach/lurkerworm_REF.gc | 2 +- .../jak1/levels/beach/seagull_REF.gc | 36 +-- .../jak1/levels/citadel/citb-plat_REF.gc | 2 +- .../jak1/levels/finalboss/light-eco_REF.gc | 2 +- .../levels/finalboss/robotboss-weapon_REF.gc | 4 +- .../levels/flut_common/target-flut_REF.gc | 7 +- .../jak1/levels/jungle/fisher_REF.gc | 2 +- .../jak1/levels/jungle/jungle-obs_REF.gc | 8 +- .../levels/lavatube/lavatube-energy_REF.gc | 2 +- .../jak1/levels/maincave/baby-spider_REF.gc | 2 +- .../levels/maincave/driller-lurker_REF.gc | 6 +- .../jak1/levels/maincave/gnawer_REF.gc | 4 +- .../jak1/levels/maincave/mother-spider_REF.gc | 4 +- .../jak1/levels/misty/balloonlurker_REF.gc | 5 +- .../jak1/levels/misty/misty-obs_REF.gc | 2 +- .../jak1/levels/misty/mistycannon_REF.gc | 10 +- .../reference/jak1/levels/misty/muse_REF.gc | 6 +- .../jak1/levels/misty/quicksandlurker_REF.gc | 2 +- .../jak1/levels/ogre/flying-lurker_REF.gc | 2 +- .../jak1/levels/ogre/ogreboss_REF.gc | 8 +- .../levels/racer_common/racer-states_REF.gc | 4 +- .../levels/racer_common/target-racer_REF.gc | 28 +- .../jak1/levels/rolling/rolling-obs_REF.gc | 4 +- .../jak1/levels/rolling/rolling-robber_REF.gc | 2 +- .../jak1/levels/snow/ice-cube_REF.gc | 2 +- .../jak1/levels/snow/snow-ball_REF.gc | 2 +- .../jak1/levels/snow/snow-bunny_REF.gc | 4 +- .../jak1/levels/sunken/helix-water_REF.gc | 2 +- .../jak1/levels/sunken/puffer_REF.gc | 4 +- .../jak1/levels/sunken/steam-cap_REF.gc | 2 +- .../jak1/levels/sunken/target-tube_REF.gc | 2 +- .../jak1/levels/sunken/whirlpool_REF.gc | 2 +- .../reference/jak1/levels/swamp/kermit_REF.gc | 4 +- .../jak1/levels/swamp/swamp-obs_REF.gc | 4 +- .../jak1/levels/swamp/swamp-rat_REF.gc | 2 +- .../levels/village1/fishermans-boat_REF.gc | 6 +- .../jak1/levels/village2/swamp-blimp_REF.gc | 14 +- .../jak2/engine/camera/cam-debug_REF.gc | 8 +- .../jak2/engine/camera/cam-layout_REF.gc | 2 +- .../jak2/engine/camera/cam-master_REF.gc | 4 +- .../jak2/engine/camera/cam-states-dbg_REF.gc | 48 ++-- .../jak2/engine/camera/cam-states_REF.gc | 4 +- .../jak2/engine/camera/camera_REF.gc | 18 +- .../jak2/engine/collide/collide-touch_REF.gc | 2 +- .../engine/common_objs/blocking-plane_REF.gc | 8 +- .../engine/common_objs/collectables_REF.gc | 8 +- .../jak2/engine/common_objs/crates_REF.gc | 4 +- .../engine/common_objs/dark-eco-pool_REF.gc | 2 +- .../jak2/engine/common_objs/water_REF.gc | 26 +- .../jak2/engine/debug/default-menu_REF.gc | 30 +-- .../jak2/engine/debug/editable-player_REF.gc | 6 +- .../jak2/engine/debug/editable_REF.gc | 2 +- .../engine/debug/nav/nav-graph-editor_REF.gc | 2 +- .../jak2/engine/draw/drawable_REF.gc | 2 +- .../jak2/engine/game/effect-control_REF.gc | 2 +- .../jak2/engine/geometry/cylinder_REF.gc | 4 +- .../jak2/engine/geometry/geometry_REF.gc | 12 +- .../jak2/engine/gfx/foreground/ripple_REF.gc | 2 +- .../reference/jak2/engine/gfx/hw/video_REF.gc | 2 +- .../jak2/engine/gfx/math-camera_REF.gc | 2 +- .../jak2/engine/gfx/mood/mood-funcs2_REF.gc | 18 +- .../jak2/engine/gfx/mood/mood-funcs_REF.gc | 14 +- .../jak2/engine/gfx/mood/mood-tables2_REF.gc | 4 +- .../jak2/engine/gfx/mood/mood_REF.gc | 8 +- .../jak2/engine/gfx/mood/time-of-day_REF.gc | 12 +- .../jak2/engine/gfx/ocean/ocean-mid_REF.gc | 4 +- .../jak2/engine/gfx/ocean/ocean-near_REF.gc | 4 +- .../engine/gfx/ocean/ocean-texture_REF.gc | 6 +- .../jak2/engine/gfx/ocean/ocean_REF.gc | 22 +- .../jak2/engine/gfx/sky/sky-tng_REF.gc | 6 +- .../gfx/sprite/particles/sparticle_REF.gc | 4 +- .../engine/gfx/sprite/sprite-distort_REF.gc | 10 +- .../jak2/engine/gfx/sprite/sprite-glow_REF.gc | 2 +- .../reference/jak2/engine/math/math_REF.gc | 14 +- .../jak2/engine/math/quaternion_REF.gc | 8 +- .../jak2/engine/math/transformq_REF.gc | 2 +- .../jak2/engine/physics/dynamics-h_REF.gc | 6 +- .../jak2/engine/physics/rigid-body_REF.gc | 4 +- .../jak2/engine/physics/trajectory_REF.gc | 4 +- .../reference/jak2/engine/ps2/timer_REF.gc | 4 +- .../reference/jak2/engine/scene/scene_REF.gc | 4 +- .../reference/jak2/engine/sound/gsound_REF.gc | 8 +- .../engine/target/board/board-states_REF.gc | 12 +- .../engine/target/board/target-board_REF.gc | 14 +- .../target/collide-reaction-target_REF.gc | 2 +- .../engine/target/gun/gun-yellow-shot_REF.gc | 2 +- .../jak2/engine/target/logic-target_REF.gc | 2 +- .../jak2/engine/target/mech/mech-part_REF.gc | 2 +- .../engine/target/mech/mech-states_REF.gc | 6 +- .../jak2/engine/target/surface-h_REF.gc | 6 +- .../jak2/engine/target/target-anim_REF.gc | 8 +- .../jak2/engine/target/target-carry_REF.gc | 2 +- .../jak2/engine/target/target-darkjak_REF.gc | 6 +- .../jak2/engine/target/target-death_REF.gc | 2 +- .../jak2/engine/target/target-gun_REF.gc | 4 +- .../jak2/engine/target/target-swim_REF.gc | 4 +- .../jak2/engine/target/target-tube_REF.gc | 2 +- .../engine/target/target-turret-shot_REF.gc | 2 +- .../jak2/engine/target/target-turret_REF.gc | 2 +- .../jak2/engine/target/target-util_REF.gc | 10 +- .../jak2/engine/target/target2_REF.gc | 2 +- .../jak2/engine/target/target_REF.gc | 8 +- .../reference/jak2/engine/ui/bigmap_REF.gc | 4 +- .../reference/jak2/engine/ui/hud_REF.gc | 6 +- .../reference/jak2/engine/ui/minimap_REF.gc | 26 +- .../engine/ui/progress/progress-draw_REF.gc | 2 +- .../jak2/engine/ui/progress/progress_REF.gc | 62 ++--- .../reference/jak2/engine/ui/text_REF.gc | 2 +- .../jak2/engine/util/smush-control-h_REF.gc | 2 +- .../jak2/engine/util/sync-info_REF.gc | 6 +- .../reference/jak2/kernel/gstring_REF.gc | 2 +- .../jak2/levels/atoll/atoll-obs_REF.gc | 4 +- .../levels/castle/boss/casboss-texture_REF.gc | 4 +- .../levels/castle/boss/castle-baron_REF.gc | 2 +- .../jak2/levels/castle/castle-texture_REF.gc | 2 +- .../jak2/levels/castle/roboguard-level_REF.gc | 6 +- .../jak2/levels/city/bombbot/bombbot_REF.gc | 4 +- .../jak2/levels/city/common/nav-graph_REF.gc | 6 +- .../jak2/levels/city/common/trail_REF.gc | 2 +- .../jak2/levels/city/ctywide-obs_REF.gc | 14 +- .../levels/city/onintent/onin-game_REF.gc | 10 +- .../jak2/levels/city/palace/ctypal-obs_REF.gc | 6 +- .../levels/city/slums/kor/kid3-course_REF.gc | 2 +- .../levels/city/slums/kor/kor3-course_REF.gc | 2 +- .../city/traffic/citizen/citizen-norm_REF.gc | 2 +- .../city/traffic/citizen/citizen_REF.gc | 2 +- .../city/traffic/citizen/civilian_REF.gc | 2 +- .../levels/city/traffic/citizen/guard_REF.gc | 6 +- .../traffic/citizen/metalhead-flitter_REF.gc | 2 +- .../traffic/citizen/metalhead-predator_REF.gc | 2 +- .../levels/city/traffic/traffic-engine_REF.gc | 7 +- .../levels/city/traffic/vehicle/bike_REF.gc | 16 +- .../levels/city/traffic/vehicle/car_REF.gc | 8 +- .../traffic/vehicle/vehicle-effects_REF.gc | 12 +- .../city/traffic/vehicle/vehicle-guard_REF.gc | 2 +- .../traffic/vehicle/vehicle-physics_REF.gc | 8 +- .../city/traffic/vehicle/vehicle-util_REF.gc | 2 +- .../city/traffic/vehicle/vehicle_REF.gc | 6 +- .../levels/common/ai/sig/sig-plasma_REF.gc | 2 +- .../levels/common/ai/sig/sig-states_REF.gc | 10 +- .../jak2/levels/common/ai/sig/sig_REF.gc | 6 +- .../jak2/levels/common/elec-gate_REF.gc | 2 +- .../jak2/levels/common/enemy/centurion_REF.gc | 2 +- .../jak2/levels/common/enemy/flitter_REF.gc | 2 +- .../enemy/hover/crimson-guard-hover_REF.gc | 8 +- .../enemy/hover/hover-nav-control_REF.gc | 2 +- .../common/enemy/hover/hover-nav-edit_REF.gc | 2 +- .../levels/common/enemy/hover/wasp_REF.gc | 6 +- .../jak2/levels/common/enemy/spyder_REF.gc | 2 +- .../levels/common/entities/gun-buoy_REF.gc | 6 +- .../levels/common/entities/spydroid_REF.gc | 8 +- .../levels/common/guard-projectile_REF.gc | 2 +- .../levels/common/metalhead-projectile_REF.gc | 2 +- .../levels/common/race/race-manager_REF.gc | 6 +- .../jak2/levels/common/race/race-mesh_REF.gc | 4 +- .../jak2/levels/consite/consite-scenes_REF.gc | 2 +- .../jak2/levels/dig/dig-digger_REF.gc | 2 +- .../reference/jak2/levels/dig/dig3-obs_REF.gc | 8 +- .../jak2/levels/drill/drill-baron_REF.gc | 14 +- .../jak2/levels/drill/drill-obs_REF.gc | 18 +- .../reference/jak2/levels/drill/ginsu_REF.gc | 2 +- .../jak2/levels/forest/forest-obs_REF.gc | 2 +- .../jak2/levels/forest/pegasus_REF.gc | 2 +- .../jak2/levels/forest/predator_REF.gc | 2 +- .../reference/jak2/levels/forest/wren_REF.gc | 2 +- .../fortress/dump/fort-robotank-turret_REF.gc | 12 +- .../levels/fortress/dump/fort-robotank_REF.gc | 4 +- .../fortress/rescue/forrescb-obs_REF.gc | 4 +- .../jak2/levels/intro/intro-scenes_REF.gc | 4 +- .../jak2/levels/mountain/mountain-obs_REF.gc | 30 +-- .../jak2/levels/mountain/rhino_REF.gc | 2 +- .../levels/nest/boss/metalkor-extras_REF.gc | 10 +- .../levels/nest/boss/metalkor-states_REF.gc | 8 +- .../jak2/levels/nest/boss/nestb-scenes_REF.gc | 2 +- .../levels/palace/boss/squid-setup_REF.gc | 2 +- .../levels/palace/boss/squid-states_REF.gc | 2 +- .../levels/palace/cable/palcab-obs_REF.gc | 4 +- .../palace/throne/metalkor-texture_REF.gc | 4 +- .../jak2/levels/ruins/mechtest-obs_REF.gc | 2 +- .../jak2/levels/ruins/pillar-collapse_REF.gc | 2 +- .../jak2/levels/ruins/rapid-gunner_REF.gc | 2 +- .../jak2/levels/sewer/sewer-obs2_REF.gc | 2 +- .../jak2/levels/stadium/stadium-obs_REF.gc | 8 +- .../jak2/levels/tomb/widow-baron_REF.gc | 4 +- .../jak2/levels/tomb/widow-extras_REF.gc | 10 +- .../jak2/levels/under/jellyfish_REF.gc | 2 +- .../jak2/levels/under/under-obs_REF.gc | 2 +- .../jak2/levels/under/underb-master_REF.gc | 2 +- .../jak3/engine/camera/cam-layout_REF.gc | 6 +- .../jak3/engine/camera/cam-master_REF.gc | 4 +- .../jak3/engine/camera/cam-states-dbg_REF.gc | 28 +- .../jak3/engine/camera/cam-states_REF.gc | 8 +- .../jak3/engine/camera/camera_REF.gc | 22 +- .../jak3/engine/collide/collide-touch_REF.gc | 6 +- .../engine/common-obs/blocking-plane_REF.gc | 12 +- .../engine/common-obs/collectables_REF.gc | 10 +- .../jak3/engine/common-obs/crates_REF.gc | 4 +- .../engine/common-obs/enemy-states_REF.gc | 4 +- .../engine/common-obs/guard-projectile_REF.gc | 6 +- .../common-obs/metalhead-projectile_REF.gc | 2 +- .../jak3/engine/common-obs/water_REF.gc | 4 +- .../jak3/engine/debug/collision-editor_REF.gc | 2 +- .../jak3/engine/debug/default-menu_REF.gc | 30 +-- .../jak3/engine/debug/manipulator_REF.gc | 26 +- .../jak3/engine/draw/drawable_REF.gc | 2 +- .../jak3/engine/game/effect-control_REF.gc | 2 +- .../jak3/engine/game/game-info_REF.gc | 12 +- .../jak3/engine/game/settings_REF.gc | 2 +- .../jak3/engine/game/task/task-arrow_REF.gc | 4 +- .../jak3/engine/geometry/geometry_REF.gc | 4 +- .../gfx/background/hfrag/hfrag-work_REF.gc | 6 +- .../engine/gfx/background/hfrag/hfrag_REF.gc | 8 +- .../engine/gfx/background/subdivide_REF.gc | 10 +- .../jak3/engine/gfx/blit-displays_REF.gc | 12 +- .../engine/gfx/foreground/foreground_REF.gc | 4 +- .../jak3/engine/gfx/foreground/ripple_REF.gc | 6 +- .../generic/lightning/lightning-new_REF.gc | 8 +- .../reference/jak3/engine/gfx/hw/video_REF.gc | 2 +- .../jak3/engine/gfx/math-camera_REF.gc | 6 +- .../jak3/engine/gfx/mood/mood-tables2_REF.gc | 4 +- .../jak3/engine/gfx/mood/mood_REF.gc | 8 +- .../jak3/engine/gfx/ocean/ocean-mid_REF.gc | 4 +- .../jak3/engine/gfx/ocean/ocean-near_REF.gc | 8 +- .../engine/gfx/ocean/ocean-texture_REF.gc | 10 +- .../jak3/engine/gfx/ocean/ocean_REF.gc | 20 +- .../jak3/engine/gfx/sky/sky-tng_REF.gc | 6 +- .../gfx/sprite/particles/light-trails_REF.gc | 6 +- .../gfx/sprite/particles/sparticle_REF.gc | 8 +- .../engine/gfx/sprite/sprite-distort_REF.gc | 4 +- .../jak3/engine/gfx/sprite/sprite-glow_REF.gc | 2 +- .../reference/jak3/engine/math/math_REF.gc | 18 +- .../jak3/engine/math/quaternion_REF.gc | 12 +- .../jak3/engine/math/transformq_REF.gc | 6 +- .../reference/jak3/engine/nav/nav-mesh_REF.gc | 2 +- .../jak3/engine/physics/cloth_REF.gc | 10 +- .../jak3/engine/physics/dynamics-h_REF.gc | 10 +- .../jak3/engine/physics/ragdoll-edit_REF.gc | 6 +- .../jak3/engine/physics/rigid-body_REF.gc | 4 +- .../jak3/engine/physics/trajectory_REF.gc | 4 +- .../reference/jak3/engine/ps2/timer_REF.gc | 8 +- .../reference/jak3/engine/scene/scene_REF.gc | 4 +- .../reference/jak3/engine/sound/gsound_REF.gc | 8 +- .../engine/target/board/board-states_REF.gc | 20 +- .../engine/target/board/target-board_REF.gc | 16 +- .../target/collide-reaction-target_REF.gc | 2 +- .../engine/target/gun/gun-blue-shot_REF.gc | 10 +- .../engine/target/gun/gun-dark-shot_REF.gc | 32 +-- .../jak3/engine/target/gun/gun-part_REF.gc | 2 +- .../engine/target/gun/gun-red-shot_REF.gc | 10 +- .../engine/target/gun/gun-yellow-shot_REF.gc | 10 +- .../jak3/engine/target/logic-target_REF.gc | 2 +- .../jak3/engine/target/mech/mech-part_REF.gc | 6 +- .../engine/target/mech/mech-states_REF.gc | 2 +- .../jak3/engine/target/surface-h_REF.gc | 6 +- .../jak3/engine/target/target-anim_REF.gc | 8 +- .../jak3/engine/target/target-darkjak_REF.gc | 6 +- .../jak3/engine/target/target-death_REF.gc | 2 +- .../jak3/engine/target/target-gun_REF.gc | 4 +- .../engine/target/target-invisible_REF.gc | 4 +- .../jak3/engine/target/target-launch_REF.gc | 4 +- .../jak3/engine/target/target-lightjak_REF.gc | 11 +- .../jak3/engine/target/target-swim_REF.gc | 4 +- .../jak3/engine/target/target-tube_REF.gc | 2 +- .../engine/target/target-turret-shot_REF.gc | 6 +- .../jak3/engine/target/target-util_REF.gc | 10 +- .../jak3/engine/target/target2_REF.gc | 2 +- .../jak3/engine/target/target_REF.gc | 6 +- .../reference/jak3/engine/ui/bigmap_REF.gc | 10 +- .../jak3/engine/ui/hud-classes_REF.gc | 2 +- .../reference/jak3/engine/ui/hud_REF.gc | 6 +- .../reference/jak3/engine/ui/minimap_REF.gc | 22 +- .../engine/ui/progress/progress-draw_REF.gc | 28 +- .../jak3/engine/ui/progress/progress_REF.gc | 38 ++- .../reference/jak3/engine/ui/text_REF.gc | 6 +- .../jak3/engine/util/smush-control-h_REF.gc | 6 +- .../jak3/engine/util/sync-info_REF.gc | 10 +- .../reference/jak3/kernel/gstring_REF.gc | 2 +- .../city/blow-tower/blow-tower-obs2_REF.gc | 13 +- .../city/blow-tower/blow-tower-obs_REF.gc | 10 +- .../city/blow-tower/cty-blow-tower_REF.gc | 18 +- .../jak3/levels/city/bombbot/bombbot_REF.gc | 6 +- .../levels/city/common/guard-grenade_REF.gc | 6 +- .../levels/city/common/guard-states_REF.gc | 6 +- .../jak3/levels/city/common/nav-graph_REF.gc | 10 +- .../jak3/levels/city/common/trail_REF.gc | 6 +- .../jak3/levels/city/ctywide-obs_REF.gc | 8 +- .../jak3/levels/city/hijack/cty-hijack_REF.gc | 2 +- .../levels/city/hijack/guide-arrow_REF.gc | 6 +- .../city/port/attack/ctyport-attack_REF.gc | 9 +- .../levels/city/port/attack/h-torpedo_REF.gc | 22 +- .../levels/city/protect/assault-task_REF.gc | 2 +- .../levels/city/protect/flying-turret_REF.gc | 8 +- .../city/protect/protect-gunship_REF.gc | 16 +- .../levels/city/protect/roboguard-city_REF.gc | 12 +- .../city/sniper/cty-sniper-turret_REF.gc | 4 +- .../city/traffic/citizen/citizen-norm_REF.gc | 6 +- .../city/traffic/citizen/citizen_REF.gc | 6 +- .../city/traffic/citizen/civilian_REF.gc | 2 +- .../traffic/citizen/metalhead-flitter_REF.gc | 2 +- .../traffic/citizen/metalhead-predator_REF.gc | 6 +- .../levels/city/traffic/traffic-engine_REF.gc | 8 +- .../levels/city/traffic/vehicle/bike_REF.gc | 16 +- .../levels/city/traffic/vehicle/car_REF.gc | 8 +- .../traffic/vehicle/vehicle-effects_REF.gc | 16 +- .../traffic/vehicle/vehicle-physics_REF.gc | 6 +- .../city/traffic/vehicle/vehicle-util_REF.gc | 2 +- .../city/traffic/vehicle/vehicle_REF.gc | 4 +- .../city/vinroom/ljkdxvin-texture_REF.gc | 8 +- .../jak3/levels/comb/comb-field_REF.gc | 10 +- .../jak3/levels/comb/comb-sentry_REF.gc | 2 +- .../reference/jak3/levels/comb/h-sled_REF.gc | 37 +-- .../jak3/levels/comb/railx-mood_REF.gc | 6 +- .../jak3/levels/common-obs/ladder_REF.gc | 16 +- .../jak3/levels/common/elec-gate_REF.gc | 2 +- .../common/enemy/darkprec/dp-bipedal_REF.gc | 2 +- .../common/enemy/darkprec/neo-wasp_REF.gc | 4 +- .../jak3/levels/common/enemy/flitter_REF.gc | 2 +- .../common/enemy/hover/robo-hover_REF.gc | 8 +- .../jak3/levels/common/enemy/mantis_REF.gc | 2 +- .../common/enemy/prebot-eco-creature_REF.gc | 14 +- .../jak3/levels/common/enemy/spyder_REF.gc | 2 +- .../levels/common/enemy/spydroid-orig_REF.gc | 8 +- .../jak3/levels/common/enemy/spydroid_REF.gc | 4 +- .../common/external-player-control_REF.gc | 8 +- .../common/hvehicle/squad-control_REF.gc | 2 +- .../common/hvehicle/turret-control_REF.gc | 6 +- .../levels/common/race/race-manager_REF.gc | 6 +- .../jak3/levels/common/race/race-mesh_REF.gc | 8 +- .../desert/boss/terraformer-setup_REF.gc | 4 +- .../levels/desert/des-burning-bush_REF.gc | 2 +- .../jak3/levels/desert/des-bush_REF.gc | 4 +- .../jak3/levels/desert/des-cactus_REF.gc | 4 +- .../levels/desert/desert-dust-storm_REF.gc | 12 +- .../levels/desert/hover/des-beast-2_REF.gc | 8 +- .../jak3/levels/desert/hover/des-beast_REF.gc | 4 +- .../desert/hover/deshover-texture_REF.gc | 8 +- .../levels/desert/race/turtle-training_REF.gc | 2 +- .../levels/desert/rescue/desert-rescue_REF.gc | 6 +- .../levels/desert/rescue/neo-satellite_REF.gc | 16 +- .../desert/wvehicle/was-squad-control_REF.gc | 2 +- .../desert/wvehicle/wcar-marauder_REF.gc | 2 +- .../levels/desert/wvehicle/wcar-mirage_REF.gc | 6 +- .../desert/wvehicle/wcar-projectiles_REF.gc | 2 +- .../levels/desert/wvehicle/wcar-rhino_REF.gc | 2 +- .../desert/wvehicle/wcar-scorpion_REF.gc | 6 +- .../levels/desert/wvehicle/wcar-toad_REF.gc | 8 +- .../levels/desert/wvehicle/wcar-turtle_REF.gc | 6 +- .../levels/desert/wvehicle/wvehicle-ai_REF.gc | 6 +- .../desert/wvehicle/wvehicle-hud_REF.gc | 6 +- .../desert/wvehicle/wvehicle-physics_REF.gc | 12 +- .../desert/wvehicle/wvehicle-states_REF.gc | 4 +- .../levels/desert/wvehicle/wvehicle_REF.gc | 6 +- .../factory/car/hvehicle-physics_REF.gc | 12 +- .../levels/factory/car/hvehicle-util_REF.gc | 2 +- .../jak3/levels/factory/car/hvehicle_REF.gc | 6 +- .../levels/factory/fac-robotank-turret_REF.gc | 4 +- .../jak3/levels/factory/fac-robotank_REF.gc | 2 +- .../jak3/levels/factory/fac-tower_REF.gc | 6 +- .../levels/factory/factory-boss-states_REF.gc | 8 +- .../levels/factory/factory-manager_REF.gc | 2 +- .../levels/factory/ffight-projectile_REF.gc | 2 +- .../levels/factory/ftank-projectile_REF.gc | 6 +- .../levels/factory/fturret-projectile_REF.gc | 6 +- .../jak3/levels/factory/h-warf_REF.gc | 14 +- .../jak3/levels/factory/missile-bot_REF.gc | 6 +- .../levels/factory/warf-projectile_REF.gc | 4 +- .../jak3/levels/forest/for-turret-shot_REF.gc | 6 +- .../jak3/levels/forest/for-turret_REF.gc | 2 +- .../jak3/levels/forest/foresta-obs_REF.gc | 2 +- .../jak3/levels/glider/glider-manager_REF.gc | 8 +- .../jak3/levels/glider/h-glider_REF.gc | 2 +- .../levels/hiphog/ltnfxhip-texture_REF.gc | 8 +- .../levels/mhcity/destroy-dark-eco_REF.gc | 2 +- .../reference/jak3/levels/mine/gekko_REF.gc | 7 +- .../reference/jak3/levels/mine/manta_REF.gc | 2 +- .../jak3/levels/mine/mine-obs_REF.gc | 2 +- .../jak3/levels/mine/prebot-extras_REF.gc | 4 +- .../jak3/levels/mine/prebot-states_REF.gc | 8 +- .../reference/jak3/levels/mine/rat_REF.gc | 2 +- .../jak3/levels/nest/egg-spider_REF.gc | 4 +- .../jak3/levels/nest/mh-centipede_REF.gc | 22 +- .../jak3/levels/precursor/precura-obs2_REF.gc | 6 +- .../jak3/levels/sewer/mh-wasp_REF.gc | 6 +- .../jak3/levels/sewer/saberfish_REF.gc | 3 +- .../jak3/levels/sewer/sew-laser-turret_REF.gc | 2 +- .../jak3/levels/sewer/sew-whirlpool_REF.gc | 6 +- .../levels/sewer/sewer-move-turret_REF.gc | 6 +- .../jak3/levels/stadium/dm-mine-spider_REF.gc | 2 +- .../jak3/levels/stadium/rubble-part_REF.gc | 8 +- .../jak3/levels/temple/temple-obs2_REF.gc | 6 +- .../jak3/levels/temple/temple-obs_REF.gc | 2 +- .../jak3/levels/temple/templea-texture_REF.gc | 12 +- .../jak3/levels/volcano/volcano-obs2_REF.gc | 4 +- .../jak3/levels/volcano/volcano-obs_REF.gc | 4 +- .../jak3/levels/volcano/volcano-scenes_REF.gc | 8 +- .../jak3/levels/volcano/volcanox-obs_REF.gc | 2 +- .../levels/volcano/volcanox-texture_REF.gc | 8 +- .../jak3/levels/wascity/ctymark-obs_REF.gc | 2 +- .../levels/wascity/defend/was-pre-game_REF.gc | 28 +- .../jak3/levels/wascity/dm-flyer_REF.gc | 2 +- .../jak3/levels/wascity/tizard_REF.gc | 2 +- .../jak3/levels/wascity/wascity-turret_REF.gc | 6 +- .../jak3/levels/wascity/wasdef-manager_REF.gc | 2 +- .../jak3/levels/wascity/wasgun-hud_REF.gc | 6 +- .../jak3/levels/wascity/wasgun-manager_REF.gc | 6 +- .../wascity/wasstadium/wasstadb-obs_REF.gc | 2 +- .../wascity/wasstadium/wasstadc-obs_REF.gc | 4 +- .../jak3/levels/wascity/wlander-male_REF.gc | 3 +- 886 files changed, 4062 insertions(+), 3888 deletions(-) diff --git a/common/goos/Object.h b/common/goos/Object.h index 6aac254eb4c..673a0cee9c8 100644 --- a/common/goos/Object.h +++ b/common/goos/Object.h @@ -57,6 +57,8 @@ #include "common/util/Assert.h" #include "common/util/crc32.h" +#include "fmt/core.h" + namespace goos { /*! @@ -234,10 +236,14 @@ class Object { ObjectType type = ObjectType::INVALID; + private: + bool disallow_hex_for_int = false; + + public: std::string print() const { switch (type) { case ObjectType::INTEGER: - return integer_obj.print(); + return disallow_hex_for_int ? fmt::format("{}", integer_obj.value) : integer_obj.print(); case ObjectType::FLOAT: return float_obj.print(); case ObjectType::CHAR: @@ -278,6 +284,14 @@ class Object { return o; } + static Object make_integer_no_hex(IntType value) { + Object o; + o.type = ObjectType::INTEGER; + o.integer_obj.value = value; + o.disallow_hex_for_int = true; + return o; + } + static Object make_float(FloatType value) { Object o; o.type = ObjectType::FLOAT; diff --git a/decompiler/IR2/AtomicOp.cpp b/decompiler/IR2/AtomicOp.cpp index 16e0a52cd68..caccad8be3f 100644 --- a/decompiler/IR2/AtomicOp.cpp +++ b/decompiler/IR2/AtomicOp.cpp @@ -149,6 +149,11 @@ SimpleAtom SimpleAtom::make_static_address(int static_label_id) { return result; } +void SimpleAtom::mark_as_no_hex() { + ASSERT(is_int() && !is_integer_promoted_to_float()); + m_no_display_int_as_hex = true; +} + /*! * Mark this atom as a float. It will be printed as a float. * This can only be applied to an "integer" atom. @@ -194,6 +199,8 @@ goos::Object SimpleAtom::to_form(const std::vector& labels, con if (std::abs(m_int) > INT32_MAX) { u64 v = m_int; return pretty_print::to_symbol(fmt::format("#x{:x}", v)); + } else if (m_no_display_int_as_hex) { + return goos::Object::make_integer_no_hex(m_int); } else { return goos::Object::make_integer(m_int); } diff --git a/decompiler/IR2/AtomicOp.h b/decompiler/IR2/AtomicOp.h index 9dcb36791f8..93d5b5bd8cb 100644 --- a/decompiler/IR2/AtomicOp.h +++ b/decompiler/IR2/AtomicOp.h @@ -190,6 +190,7 @@ class SimpleAtom { ASSERT(is_sym_ptr() || is_sym_val() || is_sym_val_ptr()); return m_string; } + void mark_as_no_hex(); void mark_as_float(); bool is_integer_promoted_to_float() const; float get_integer_promoted_to_float() const; @@ -200,6 +201,7 @@ class SimpleAtom { s64 m_int = -1; // for integer constant and static address label id RegisterAccess m_variable; bool m_display_int_as_float = false; + bool m_no_display_int_as_hex = false; }; /*! diff --git a/decompiler/IR2/Form.cpp b/decompiler/IR2/Form.cpp index 723e088ddb9..49b90c5ca69 100644 --- a/decompiler/IR2/Form.cpp +++ b/decompiler/IR2/Form.cpp @@ -281,12 +281,19 @@ void LoadSourceElement::get_modified_regs(RegSet& regs) const { ///////////////////////////// SimpleAtomElement::SimpleAtomElement(const SimpleAtom& atom, bool omit_var_cast) - : m_atom(atom), m_omit_var_cast(omit_var_cast) { + : m_atom(atom), m_omit_var_cast(omit_var_cast), m_no_hex(false) { if (m_omit_var_cast) { ASSERT(atom.is_var()); } } +SimpleAtomElement::SimpleAtomElement(int int_val, bool no_hex) + : m_atom(SimpleAtom::make_int_constant(int_val)), m_omit_var_cast(false), m_no_hex(no_hex) { + if (m_no_hex) { + m_atom.mark_as_no_hex(); + } +} + goos::Object SimpleAtomElement::to_form_internal(const Env& env) const { if (m_omit_var_cast) { return m_atom.var().to_form(env, RegisterAccess::Print::AS_VARIABLE_NO_CAST); diff --git a/decompiler/IR2/Form.h b/decompiler/IR2/Form.h index 3f09a143045..f8ae80a3a4a 100644 --- a/decompiler/IR2/Form.h +++ b/decompiler/IR2/Form.h @@ -309,6 +309,7 @@ class LoadSourceElement : public FormElement { class SimpleAtomElement : public FormElement { public: explicit SimpleAtomElement(const SimpleAtom& var, bool omit_var_cast = false); + SimpleAtomElement(int int_val, bool no_hex = false); goos::Object to_form_internal(const Env& env) const override; void apply(const std::function& f) override; void apply_form(const std::function& f) override; @@ -324,6 +325,7 @@ class SimpleAtomElement : public FormElement { private: SimpleAtom m_atom; bool m_omit_var_cast; + bool m_no_hex; }; /*! diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 2ff59586730..f0e93089ed0 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -965,7 +965,7 @@ FormElement* make_and_compact_math_op(Form* arg0, /*! * Update a two-argument form that uses two floats. * This is for operations like * and + that can be nested - * (* (* a b)) -> (* a b c) + * (* (* a b) c) -> (* a b c) * Note that we only apply this to the _first_ argument to keep the order of operations the same. */ void SimpleExpressionElement::update_from_stack_float_2_nestable(const Env& env, @@ -2603,6 +2603,9 @@ void SetVarElement::push_to_stack(const Env& env, FormPool& pool, FormStack& sta ASSERT(x->parent_form == m_src); } + if (auto test0 = m_src->to_string(env) == "(* 0.00024414062 (-> arg0 y))") { + printf(""); + } if (m_src->is_single_element()) { auto src_as_se = dynamic_cast(m_src->back()); if (src_as_se) { @@ -2624,6 +2627,71 @@ void SetVarElement::push_to_stack(const Env& env, FormPool& pool, FormStack& sta } } } + + // (* 0.125 b) -> (/ b 8) + // adds explicit cast b to float if necessary + auto src_as_ge = dynamic_cast(m_src->back()); + if (src_as_ge) { + auto mr = match(Matcher::op_fixed(FixedOperatorKind::MULTIPLICATION, + {Matcher::any_single(0), Matcher::any(1)}), + m_src); + if (mr.matched && std::abs(mr.maps.floats.at(0)) < 1 && mr.maps.floats.at(0) != 0) { + auto inverse_mult = mr.maps.floats.at(0); + float divisor_num = 1.0f / inverse_mult; + + // note: float inaccuracies lead to convergent values, so we can do this safely + if ((int)divisor_num != divisor_num && 1.0f / std::roundf(divisor_num) == inverse_mult) { + lg::debug("managed to round divisor - cool !! {} -> {} ({})", divisor_num, + std::roundf(divisor_num), inverse_mult); + divisor_num = std::roundf(divisor_num); + } + + int divisor_int = (int)divisor_num; + bool integer = divisor_int == divisor_num; + if (integer) { + auto elt = mr.maps.forms.at(1)->try_as_single_element(); + auto b_as_simple = dynamic_cast(elt); + // WARNING : there is an assumption here that derefs DO NOT have implicit casts! + auto b_as_deref = dynamic_cast(elt); + if (b_as_deref || + (b_as_simple && b_as_simple->expr().kind() == SimpleExpression::Kind::IDENTITY)) { + // TODO check if op is float, cast if so + Form* divisor = nullptr; + if (divisor_num == 4096.0f) { + divisor = pool.form("METER_LENGTH"); + } else if (integer && divisor_int % 4096 == 0) { + divisor = pool.form( + GenericOperator::make_function(pool.form("meters")), + pool.form(divisor_int / 4096, true)); + } else if (integer && divisor_int % 2048 == 0) { + divisor = pool.form( + GenericOperator::make_function(pool.form("meters")), + pool.form(divisor_num / (float)METER_LENGTH)); + } else if (integer) { + divisor = pool.form(divisor_int, true); + } else { + // this shouldn't run because of the checks before. + divisor = pool.form(divisor_num); + } + if (divisor) { + if (b_as_deref || (b_as_simple->expr().is_var() && + env.get_types_before_op(b_as_simple->expr().var().idx()) + .get(b_as_simple->expr().var().reg()) + .typespec() == TypeSpec("float"))) { + *m_src->back_ref() = pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::DIVISION), mr.maps.forms.at(1), + divisor); + } else { + *m_src->back_ref() = pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::DIVISION), + pool.form(TypeSpec("float"), mr.maps.forms.at(1), true), divisor); + } + m_src->back()->parent_form = m_src; + } + } + } + } + } } stack.push_value_to_reg(m_dst, m_src, true, m_src_type, m_var_info); diff --git a/decompiler/IR2/GenericElementMatcher.cpp b/decompiler/IR2/GenericElementMatcher.cpp index 65a7e796c25..c9eced46eba 100644 --- a/decompiler/IR2/GenericElementMatcher.cpp +++ b/decompiler/IR2/GenericElementMatcher.cpp @@ -127,6 +127,13 @@ Matcher Matcher::single(std::optional value) { return m; } +Matcher Matcher::any_single(int match_id) { + Matcher m; + m.m_kind = Kind::ANY_FLOAT; + m.m_float_out_id = match_id; + return m; +} + Matcher Matcher::any_quoted_symbol(int match_id) { Matcher m; m.m_kind = Kind::ANY_QUOTED_SYMBOL; @@ -477,6 +484,30 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out, const Env* cons return false; } break; + case Kind::ANY_FLOAT: { + auto as_const_float = + dynamic_cast(input->try_as_single_active_element()); + if (as_const_float) { + if (m_float_out_id != -1) { + maps_out->floats[m_float_out_id] = as_const_float->value(); + } + return true; + } + + auto as_expr = dynamic_cast(input->try_as_single_active_element()); + if (as_expr && as_expr->expr().is_identity()) { + const auto& atom = as_expr->expr().get_arg(0); + if (atom.is_integer_promoted_to_float()) { + if (m_float_out_id != -1) { + maps_out->floats[m_float_out_id] = atom.get_integer_promoted_to_float(); + } + return true; + } + } + + return false; + } break; + case Kind::ANY_QUOTED_SYMBOL: { auto as_simple_atom = dynamic_cast(input->try_as_single_active_element()); if (as_simple_atom) { diff --git a/decompiler/IR2/GenericElementMatcher.h b/decompiler/IR2/GenericElementMatcher.h index 66b9a2b1bc7..fd81c1e6e5b 100644 --- a/decompiler/IR2/GenericElementMatcher.h +++ b/decompiler/IR2/GenericElementMatcher.h @@ -21,6 +21,7 @@ struct MatchResult { std::unordered_map forms; std::unordered_map label; std::unordered_map ints; + std::unordered_map floats; } maps; Form* int_or_form_to_form(FormPool& pool, int key_idx) { @@ -56,6 +57,7 @@ class Matcher { static Matcher integer(std::optional value); static Matcher any_integer(int match_id = -1); static Matcher single(std::optional value); + static Matcher any_single(int match_id = -1); static Matcher any_reg_cast_to_int_or_uint(int match_id = -1); static Matcher any_quoted_symbol(int match_id = -1); static Matcher any_symbol(int match_id = -1); @@ -91,6 +93,7 @@ class Matcher { INT, ANY_INT, FLOAT, + ANY_FLOAT, ANY_QUOTED_SYMBOL, ANY_SYMBOL, DEREF_OP, @@ -132,6 +135,7 @@ class Matcher { int m_form_match; int m_label_out_id; int m_int_out_id; + int m_float_out_id; }; std::optional m_int_match; std::optional m_float_match; diff --git a/goal_src/jak1/engine/anim/joint-exploder.gc b/goal_src/jak1/engine/anim/joint-exploder.gc index 3f0bb3f02a0..eb3c24d011a 100644 --- a/goal_src/jak1/engine/anim/joint-exploder.gc +++ b/goal_src/jak1/engine/anim/joint-exploder.gc @@ -21,13 +21,16 @@ (:methods (new (symbol type int) _type_))) + (deftype joint-exploder-static-joint-params (structure) ((joint-index int16) (parent-joint-index int16))) + (deftype joint-exploder-static-params (basic) ((joints (array joint-exploder-static-joint-params)))) + (deftype joint-exploder-joint (structure) ((next int16) (prev int16) @@ -38,18 +41,21 @@ (transv vector :inline) (prev-pos vector :inline))) + (deftype joint-exploder-joints (basic) ((num-joints int32) (joint joint-exploder-joint :inline :dynamic :offset 16)) (:methods (new (symbol type joint-exploder-static-params) _type_))) + (deftype joint-exploder-list (structure) ((head int32) (pre-moved? symbol) (bbox-valid? symbol) (bbox bounding-box :inline))) + (deftype joint-exploder (process-drawable) ((parent-override (pointer process-drawable) :overlay-at parent) (die-if-below-y float) @@ -73,6 +79,7 @@ (:states joint-exploder-shatter)) + (defmethod asize-of ((this joint-exploder-joints)) (the-as int (+ (-> this type size) (* 176 (-> this num-joints))))) @@ -270,7 +277,7 @@ (set! (-> s5-1 transv y) (* 0.7 f30-0)))) (+! (-> s4-0 y) (* 40.96 (-> s3-0 normal y))) (set! (-> s4-0 w) 1.0) - (set! (-> s5-1 rspeed) (* 0.5 (-> s5-1 rspeed))))) + (set! (-> s5-1 rspeed) (/ (-> s5-1 rspeed) 2)))) (set! v1-2 (-> s5-1 next))))) #f) @@ -381,9 +388,9 @@ (add-point! s5-1 (the-as vector3s (+ (the-as uint (-> gp-0 joint 0 mat vector 3)) (* 176 s4-1))))))) #f))) -(defmethod relocate ((this joint-exploder) (arg0 int)) - (if (nonzero? (-> this joints)) (&+! (-> this joints) arg0)) - (the-as joint-exploder ((method-of-type process-drawable relocate) this arg0))) +(defmethod relocate ((this joint-exploder) (offset int)) + (if (nonzero? (-> this joints)) (&+! (-> this joints) offset)) + (the-as joint-exploder ((method-of-type process-drawable relocate) this offset))) (defbehavior joint-exploder-init-by-other joint-exploder ((arg0 skeleton-group) (arg1 int) (arg2 joint-exploder-static-params) (arg3 joint-exploder-static-params)) (set! (-> self static-params) arg3) diff --git a/goal_src/jak1/engine/camera/cam-layout.gc b/goal_src/jak1/engine/camera/cam-layout.gc index e2bedad6cfc..5864c3476ee 100644 --- a/goal_src/jak1/engine/camera/cam-layout.gc +++ b/goal_src/jak1/engine/camera/cam-layout.gc @@ -20,6 +20,7 @@ (debug-t float) (debug-step float))) + (define *CAM_LAYOUT-bank* (new 'static 'cam-layout-bank @@ -34,6 +35,7 @@ (deftype clm-basic (basic) ()) + (deftype clm-item-action (structure) ((button uint64) (options uint64) @@ -43,11 +45,13 @@ (parm1-basic basic :offset 24) (parm1 symbol :overlay-at parm1-basic))) + (deftype clm-item (clm-basic) ((description string) (button-symbol symbol) (action clm-item-action :inline))) + (deftype clm-list-item (basic) ((description string) (track-val symbol) @@ -58,15 +62,18 @@ (val-parm1 symbol :overlay-at val-parm1-basic) (actions (array clm-item-action)))) + (deftype clm-list (clm-basic) ((tracker symbol) (cur-list-item int32) (items (array clm-list-item)))) + (deftype clm (basic) ((title string) (items (array clm-basic)))) + (define *volume-point-current* 0) (define *volume-point* (new 'debug 'vector-array 1000)) @@ -78,6 +85,7 @@ (deftype volume-descriptor-array (inline-array-class) ((data plane-volume :inline :dynamic :offset 16))) + (set! (-> volume-descriptor-array heap-base) (the-as uint 24)) (define *volume-descriptor-current* 0) @@ -97,6 +105,7 @@ (:states cam-layout-active)) + (defun cam-layout-print ((arg0 int) (arg1 int) (arg2 string)) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame debug-buf)) (gp-0 (-> s5-0 base))) @@ -290,6 +299,7 @@ (axis vector) (disp string))) + (defun interp-test ((arg0 (function vector vector vector float vector float none)) (arg1 interp-test-info)) (let ((s3-0 (new-stack-vector0)) (gp-0 (new-stack-vector0))) @@ -756,7 +766,7 @@ #f) (defun fov->maya ((arg0 float)) - (the-as float (if (= arg0 0.0) 0.0 (/ 12.700255 (tan (* 0.5 arg0)))))) + (the-as float (if (= arg0 0.0) 0.0 (/ 12.700255 (tan (/ arg0 2)))))) (defun cam-layout-save-cam-rot ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s3-0 (-> arg2 quat)) @@ -1436,6 +1446,7 @@ (force-on int32) (force-off int32))) + (defbehavior clmf-cam-flag-toggle cam-layout ((arg0 int) (arg1 int)) (let ((s4-0 (/ arg0 8)) (gp-0 (new 'stack 'clmf-cam-flag-toggle-info))) diff --git a/goal_src/jak1/engine/camera/cam-master.gc b/goal_src/jak1/engine/camera/cam-master.gc index 0386544382d..8870c9d3faf 100644 --- a/goal_src/jak1/engine/camera/cam-master.gc +++ b/goal_src/jak1/engine/camera/cam-master.gc @@ -25,6 +25,7 @@ (down-move-to-pitch-on-ground float) (pitch-off-blend float))) + (define *CAMERA_MASTER-bank* (new 'static 'camera-master-bank @@ -286,9 +287,9 @@ (vector-! gp-6 (-> self tpos-curr) (-> self tpos-tgt)) (let ((f30-0 (vector-dot gp-6 (-> self local-down)))) (vector--float*! gp-6 gp-6 (-> self local-down) f30-0) - (if (< 0.0 f30-0) (set! (-> self upspeed) (* 0.5 (-> self upspeed)))) + (if (< 0.0 f30-0) (set! (-> self upspeed) (/ (-> self upspeed) 2))) (vector+! (-> self tpos-tgt) (-> self tpos-tgt) gp-6) - (let ((f0-30 (* 0.05 f30-0))) (vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) f0-30))) + (let ((f0-30 (/ f30-0 20))) (vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) f0-30))) (vector-! gp-6 (-> self tpos-curr-adj) (-> self tpos-tgt)) (let* ((f0-32 (vector-dot gp-6 (-> self local-down))) (f0-33 (if (< 0.0 f0-32) @@ -957,6 +958,7 @@ (deftype list-keeper (process) ((dummy float))) + (defstate list-keeper-active (camera-master) :code (behavior () diff --git a/goal_src/jak1/engine/camera/cam-states-dbg.gc b/goal_src/jak1/engine/camera/cam-states-dbg.gc index 3ee90c81ef3..a5ca7e702d9 100644 --- a/goal_src/jak1/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak1/engine/camera/cam-states-dbg.gc @@ -10,6 +10,7 @@ ((speed float) (rot-speed degrees))) + (define *CAM_POINT_WATCH-bank* (new 'static 'cam-point-watch-bank :speed 1600.0 :rot-speed (degrees 0.6))) (defstate cam-point-watch (camera-slave) @@ -36,10 +37,10 @@ (f0-0 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 48.0 110.0 -1.0))) (cond ((cpad-hold? (-> *CAMERA-bank* joypad) r2) - (set! (-> s5-0 y) (- (-> s5-0 y) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) - (set! (-> s5-0 x) (- (-> s5-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0)))) - (+! (-> gp-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f28-0)) - (+! (-> gp-0 z) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f30-0))) + (set! (-> s5-0 y) (- (-> s5-0 y) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f26-0)))) + (set! (-> s5-0 x) (- (-> s5-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f0-0)))) + (+! (-> gp-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f28-0)) + (+! (-> gp-0 z) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f30-0))) (else (set! (-> s5-0 y) (- (-> s5-0 y) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) (set! (-> s5-0 x) (- (-> s5-0 x) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0)))) @@ -63,6 +64,7 @@ ((speed float) (rot-speed degrees))) + (define *CAM_FREE-bank* (new 'static 'cam-free-bank :speed 1600.0 :rot-speed (degrees 0.6))) (defun cam-free-floating-input ((arg0 vector) (arg1 vector) (arg2 symbol) (arg3 int)) @@ -226,13 +228,13 @@ ((cpad-hold? arg3 r2) (cond ((cpad-hold? arg3 l2) - (set! (-> arg0 y) (- (-> arg0 y) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f24-0)))) - (set! (-> arg0 x) (- (-> arg0 x) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f26-0))))) + (set! (-> arg0 y) (- (-> arg0 y) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f24-0)))) + (set! (-> arg0 x) (- (-> arg0 x) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f26-0))))) (else (set! (-> arg0 y) (- (-> arg0 y) (* (- f24-0) (-> *CAM_FREE-bank* rot-speed)))) (set! (-> arg0 x) (- (-> arg0 x) (* (- f26-0) (-> *CAM_FREE-bank* rot-speed)))))) - (+! (-> arg1 x) (* 0.2 (-> *CAM_FREE-bank* speed) f28-14)) - (+! (-> arg1 z) (* 0.2 (-> *CAM_FREE-bank* speed) f30-14))) + (+! (-> arg1 x) (* (/ (-> *CAM_FREE-bank* speed) 5) f28-14)) + (+! (-> arg1 z) (* (/ (-> *CAM_FREE-bank* speed) 5) f30-14))) ((cpad-hold? arg3 l2) (+! (-> arg1 x) (* f28-14 (-> *CAM_FREE-bank* speed))) (+! (-> arg1 y) (* f26-0 (-> *CAM_FREE-bank* speed))) @@ -251,6 +253,7 @@ (up vector :inline) (tm matrix :inline))) + (defun cam-free-floating-move ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 int)) (if (logtest? (-> *cpad-list* cpads arg3 valid) 128) (return (the-as vector #f))) (if (= *master-mode* 'menu) (return (the-as vector #f))) @@ -298,12 +301,14 @@ (orbit-off vector :inline) (radius-lerp float))) + (deftype CAM_ORBIT-bank (basic) ((RADIUS_MAX float) (RADIUS_MIN float) (TARGET_OFF_ADJUST float) (ORBIT_OFF_ADJUST float))) + (define *CAM_ORBIT-bank* (new 'static 'CAM_ORBIT-bank :RADIUS_MAX 61440.0 :RADIUS_MIN 409.6 :TARGET_OFF_ADJUST 81.92 :ORBIT_OFF_ADJUST 81.92)) diff --git a/goal_src/jak1/engine/camera/cam-states.gc b/goal_src/jak1/engine/camera/cam-states.gc index 6cd935d6cc2..7efa1ffa807 100644 --- a/goal_src/jak1/engine/camera/cam-states.gc +++ b/goal_src/jak1/engine/camera/cam-states.gc @@ -245,6 +245,7 @@ (max-fov float) (min-fov float))) + (define *CAM_EYE-bank* (new 'static 'cam-eye-bank :rot-speed 364.0889 :max-degrees 12743.111 :max-fov 11650.845 :min-fov 6189.511)) @@ -353,6 +354,7 @@ ((rot-speed float) (tilt-degrees float))) + (define *CAM_BILLY-bank* (new 'static 'cam-billy-bank :rot-speed 364.0889 :tilt-degrees -1820.4445)) (defstate cam-billy (camera-slave) @@ -748,6 +750,7 @@ ((los-coll-rad meters) (los-coll-rad2 meters))) + (define *CAM_STRING-bank* (new 'static 'cam-string-bank :los-coll-rad (meters 1) :los-coll-rad2 (meters 0.5))) (defun cam-string-find-position-rel! ((arg0 vector)) @@ -817,6 +820,7 @@ (lat-dist float) (vert-dist float))) + (deftype collide-los-dist-info (structure) ((min-par float) (max-par float) @@ -828,6 +832,7 @@ (max-vn float) (count int32))) + (defun dist-info-init ((arg0 collide-los-dist-info)) (set! (-> arg0 min-par) 1.0) (set! (-> arg0 max-par) 0.0) @@ -893,6 +898,7 @@ (straddle collide-los-dist-info :inline) (lateral-valid symbol))) + (defun los-cw-ccw ((arg0 (inline-array collide-cache-tri)) (arg1 vector) (arg2 vector) @@ -1364,13 +1370,13 @@ (f0-2 (/ (- (vector-length (-> self view-flat)) (-> self string-min-val z)) (- (-> self string-max-val z) (-> self string-min-val z)))) (f30-0 (-> self view-off-param))) - (if (-> self have-phony-joystick) (set! f28-0 (* 0.05 (-> self phony-joystick-y)))) + (if (-> self have-phony-joystick) (set! f28-0 (/ (-> self phony-joystick-y) 20))) (if (and (-> *camera* being-attacked) (not (time-elapsed? (-> *camera* attack-start) (seconds 0.25)))) (set! f28-0 0.05)) (if (!= f28-0 0.0) (logior! (-> self options) 256)) (let ((f26-0 (fmin 1.0 f0-2))) (let ((f0-3 f26-0)) (when (< f26-0 0.0) - (let ((f0-6 (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (* 0.5 (-> self string-min-val z))))) + (let ((f0-6 (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (/ (-> self string-min-val z) 2)))) (set! f0-3 (fmin 0.75 f0-6)))) (let ((f1-10 (-> self string-min-val y)) (f2-3 (-> self string-max-val y))) @@ -1729,6 +1735,7 @@ (max-y meters) (min-y meters))) + (define *CAM_STICK-bank* (new 'static 'cam-stick-bank :max-z (meters 30) :min-z (meters 5) :max-y (meters 15) :min-y (meters 2))) @@ -1866,6 +1873,7 @@ (max-y meters) (min-y meters))) + (define *CAM_BIKE-bank* (new 'static 'cam-bike-bank :max-z (meters 6) :min-z (meters 10) :max-y (meters 3) :min-y (meters 5))) diff --git a/goal_src/jak1/engine/camera/cam-update.gc b/goal_src/jak1/engine/camera/cam-update.gc index a891d58d405..3518fdbb143 100644 --- a/goal_src/jak1/engine/camera/cam-update.gc +++ b/goal_src/jak1/engine/camera/cam-update.gc @@ -14,6 +14,8 @@ ;; Once the camera's position and orientation has been calculated, ;; the camera and visibility outputs are updated in this file. +;; DECOMP BEGINS + (defun plane-from-points ((arg0 (inline-array plane)) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 int)) "Get a plane that contains the 3 given points." (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -127,7 +129,7 @@ (if (< (-> s4-0 length) (-> s4-0 from-bsp current-leaf-idx)) (set! v1-32 #f))) ;; see if we want adj vis. (when s3-0 - (set! a0-16 (nonzero? (logand (shl #x8000 16) (-> s3-0 flags)))) + (set! a0-16 (logtest? (shl #x8000 16) (-> s3-0 flags))) (if (< (-> s3-0 length) (-> s3-0 from-bsp current-leaf-idx)) (set! a0-16 #f))) v1-32 ;; this is the cond condition, and is if we want the self vis. )) @@ -252,10 +254,10 @@ (new 'static 'rgba :r #xff :a #x80)) (format *stdcon* "~f ~f ~f ~f~%" - (* 0.00024414062 (-> s5-1 info bsphere x)) - (* 0.00024414062 (-> s5-1 info bsphere y)) - (* 0.00024414062 (-> s5-1 info bsphere z)) - (* 0.00024414062 (-> s5-1 info bsphere w))))))) + (/ (-> s5-1 info bsphere x) METER_LENGTH) + (/ (-> s5-1 info bsphere y) METER_LENGTH) + (/ (-> s5-1 info bsphere z) METER_LENGTH) + (/ (-> s5-1 info bsphere w) METER_LENGTH)))))) (update-math-camera *math-camera* (-> *setting-control* current video-mode) (-> *setting-control* current aspect-ratio)) (update! *camera-smush-control*) (cond diff --git a/goal_src/jak1/engine/camera/camera.gc b/goal_src/jak1/engine/camera/camera.gc index 3938d235473..5936fcd3c13 100644 --- a/goal_src/jak1/engine/camera/camera.gc +++ b/goal_src/jak1/engine/camera/camera.gc @@ -122,7 +122,7 @@ (cond ((>= arg0 1.0) 1.0) ((>= 0.0 arg0) 0.0) - ((>= 0.25 arg0) (* 0.5 arg0)) + ((>= 0.25 arg0) (/ arg0 2)) ((>= arg0 0.75) (- 1.0 (* 0.5 (- 1.0 arg0)))) (else (+ 0.125 (* 1.5 (+ -0.25 arg0)))))) @@ -404,7 +404,7 @@ (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-! s3-0 (the-as vector (-> this point (-> this used-point))) (the-as vector (-> this point (-> this end-point)))) (let* ((f0-0 (vector-length s3-0)) - (f1-1 (* 0.33333334 (- 1.5 (* 0.00024414062 f0-0))))) + (f1-1 (* 0.33333334 (- 1.5 (/ f0-0 METER_LENGTH))))) 0.0 (let* ((f1-2 (fmax 0.0 f1-1)) (f30-0 (+ 0.3 f1-2)) @@ -424,7 +424,7 @@ (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s1-0))) (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-8)))) (let* ((f0-4 (vector-normalize-ret-len! s2-0 1.0)) - (f0-5 (* 0.5 f0-4)) + (f0-5 (/ f0-4 2)) (f26-0 (* (fmin 1.0 f0-5) f30-0 (vector-dot arg0 s2-0)))) (let ((f2-7 (vector-dot s2-0 s3-0))) (cond @@ -456,7 +456,7 @@ 0.0 0.0 (let* ((f1-1 (- f1-0 (* f0-0 (-> this point v1-0 tp-length)))) - (f2-5 (* 0.1 f1-1)) + (f2-5 (/ f1-1 10)) (f2-8 (* (fmin arg1 (- f2-5 (-> this max-move))) (-> *display* time-adjust-ratio)))) (set! (-> this max-move) (fmin arg2 (+ (-> this max-move) f2-8))))) (set! (-> this max-move) (fmax 0.4096 (-> this max-move))) @@ -471,7 +471,7 @@ (tracking-spline-method-19 this (* (-> this max-move) (-> *display* time-adjust-ratio)) arg0 s4-0) (tracking-spline-method-14 this s4-0) (dotimes (s3-0 63) - (tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 s4-0)) + (tracking-spline-method-18 this (/ (-> this sample-len) 64) arg0 s4-0)) (vector-float*! arg0 arg0 0.015625) (let ((a2-3 (-> s4-0 cur-pt))) (set! (-> this debug-last-point) a2-3) @@ -737,7 +737,7 @@ (f0-20 (* f0-19 f0-19))) (vector-! s5-1 s5-1 (-> arg0 follow-off)) (vector-float*! s5-1 s5-1 f0-20)) - (+! (-> arg0 follow-blend) (* 0.016666668 (-> *display* time-adjust-ratio))) + (+! (-> arg0 follow-blend) (/ (-> *display* time-adjust-ratio) 60)) (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s5-1)) (else (set! (-> arg0 follow-off quad) (-> s5-1 quad))))) (vector+! (-> arg0 follow-pt) (-> *camera* tpos-curr-adj) (-> arg0 follow-off)) @@ -812,7 +812,8 @@ (quaternion-normalize! gp-0) (if (< (-> gp-0 w) 0.0) (quaternion-negate! gp-0 gp-0)) (let ((f28-0 (acos (-> gp-0 w)))) - (if (< (* 0.25 (-> *display* time-adjust-ratio) f28-0) f30-0) (set! f30-0 (* 0.25 (-> *display* time-adjust-ratio) f28-0))) + (if (< (* (/ (-> *display* time-adjust-ratio) 4) f28-0) f30-0) + (set! f30-0 (* (/ (-> *display* time-adjust-ratio) 4) f28-0))) (cond ((< (-> gp-0 w) 0.9999999) (quaternion-float*! gp-0 gp-0 (/ (sin f30-0) (sin f28-0))) (set! (-> gp-0 w) (cos f30-0))) (else (quaternion-identity! gp-0)))))) @@ -839,7 +840,7 @@ (let ((f28-0 (vector-dot s3-0 (the-as vector (-> arg0 vector))))) (set! sv-128 s2-0) (set! sv-112 (-> arg0 vector)) - (let ((f0-6 (* 0.8 (tan (* 0.5 arg2))))) (.lvf vf1 (&-> sv-112 0 quad)) (let ((v1-6 f0-6)) (.mov vf2 v1-6))) + (let ((f0-6 (* 0.8 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-112 0 quad)) (let ((v1-6 f0-6)) (.mov vf2 v1-6))) (.add.x.vf vf1 vf0 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> sv-128 quad) vf1) @@ -859,7 +860,7 @@ (let ((f28-1 (vector-dot s3-0 (-> arg0 vector 1)))) (set! sv-160 s2-0) (set! sv-144 (-> arg0 vector 1)) - (let ((f0-15 (* 0.525 (tan (* 0.5 arg2))))) (.lvf vf1 (&-> sv-144 quad)) (let ((v1-23 f0-15)) (.mov vf2 v1-23))) + (let ((f0-15 (* 0.525 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-144 quad)) (let ((v1-23 f0-15)) (.mov vf2 v1-23))) (.add.x.vf vf1 vf0 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> sv-160 quad) vf1) @@ -877,7 +878,7 @@ (let ((f28-2 (vector-dot s3-0 (-> arg0 vector 1)))) (let ((s0-1 s2-0)) (set! sv-176 (-> arg0 vector 1)) - (let ((f0-25 (* 0.525 (tan (* 0.5 arg2))))) (vector-float*! s0-1 sv-176 f0-25))) + (let ((f0-25 (* 0.525 (tan (/ arg2 2))))) (vector-float*! s0-1 sv-176 f0-25))) (vector+! s2-0 s2-0 (-> arg0 vector 2)) (vector-normalize! s2-0 1.0) (let ((f0-27 (vector-dot s2-0 (-> arg0 vector 1)))) @@ -962,7 +963,7 @@ (set! (-> arg0 underwater-blend target) 0.0)) (set! sv-240 vector-into-frustum-nosmooth!) (set! sv-256 s5-0) - (let ((a2-5 (lerp-clamp arg3 (* 0.25 arg3) (-> arg0 underwater-blend value)))) (sv-240 sv-256 arg1 a2-5)) + (let ((a2-5 (lerp-clamp arg3 (/ arg3 4) (-> arg0 underwater-blend value)))) (sv-240 sv-256 arg1 a2-5)) (cond (arg4 (slave-matrix-blend-2 (-> arg0 inv-mat) arg2 s1-0 s5-0)) (else diff --git a/goal_src/jak1/engine/collide/collide-probe.gc b/goal_src/jak1/engine/collide/collide-probe.gc index 89b5d41e77a..5e4e016e670 100644 --- a/goal_src/jak1/engine/collide/collide-probe.gc +++ b/goal_src/jak1/engine/collide/collide-probe.gc @@ -262,7 +262,7 @@ (let ((f0-0 (misty-ambush-height arg0))) (cond ((< f0-0 (-> arg0 y)) (/ (- (-> arg0 y) f0-0) arg1)) - (else (format 0 "WARNING: ~%height = ~f, pos.y = ~f" (* 0.00024414062 f0-0) (* 0.00024414062 (-> arg0 y))) -1.0)))) + (else (format 0 "WARNING: ~%height = ~f, pos.y = ~f" (/ f0-0 METER_LENGTH) (/ (-> arg0 y) METER_LENGTH)) -1.0)))) (defun pke-collide-test () 0 diff --git a/goal_src/jak1/engine/collide/collide-touch.gc b/goal_src/jak1/engine/collide/collide-touch.gc index c82d2447171..008c71b7378 100644 --- a/goal_src/jak1/engine/collide/collide-touch.gc +++ b/goal_src/jak1/engine/collide/collide-touch.gc @@ -389,7 +389,7 @@ ;; subtract off the two radius. this is now the offset between the "closest" points (and is negative) (let ((f1-2 (- (- (vector-length gp-1) (-> s3-0 prim-core world-sphere w)) (-> s4-0 prim-core world-sphere w)))) ;; this offset is the radius, minus half the overlap distance - (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2)))) + (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (/ f1-2 2)))) ;; so add it to s4's origin to get to the halfway point (vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core)))) arg0) diff --git a/goal_src/jak1/engine/collide/surface-h.gc b/goal_src/jak1/engine/collide/surface-h.gc index 503317f0e0a..3f7876b88bb 100644 --- a/goal_src/jak1/engine/collide/surface-h.gc +++ b/goal_src/jak1/engine/collide/surface-h.gc @@ -80,13 +80,13 @@ ;; these calc-terminal functions are unused. (defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float)) - (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1)) + (- (* (/ (- (/ arg0 60) arg1) arg2) (- 1.0 arg2)) arg1)) (defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))) (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))))) + (let ((f0-4 (sqrtf (/ (- (/ arg0 60) arg1) arg2)))) (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))))) (defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float)) - (let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))) (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))))) + (let ((f0-5 (sqrtf (sqrtf (/ (- (/ arg0 60) arg1) arg2))))) (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))))) (defmethod print ((this surface)) ;; seems this format string is wrong. @@ -930,6 +930,7 @@ :alignv 1.0 :slope-up-traction 1.0 :align-speed 1.0))) + ;; og:preserve-this (define *stone-surface* v1-41) (set! (-> v1-41 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-41 touch-hook) nothing) diff --git a/goal_src/jak1/engine/common-obs/collectables.gc b/goal_src/jak1/engine/common-obs/collectables.gc index e2ff87d4731..36b21fd4807 100644 --- a/goal_src/jak1/engine/common-obs/collectables.gc +++ b/goal_src/jak1/engine/common-obs/collectables.gc @@ -47,6 +47,7 @@ (initialize (_type_) _type_) (initialize-params (_type_ time-frame float) none))) + (defmethod initialize-params ((this collectable) (arg0 time-frame) (arg1 float)) (logclear! (-> this mask) (process-mask crate enemy platform ambient)) (logior! (-> this mask) (process-mask collectable)) @@ -101,6 +102,7 @@ (animate (_type_) none) (blocked () _type_ :state))) + (defmethod initialize ((this eco-collectable)) (stack-size-set! (-> this main-thread) 192) ;; og:preserve-this hack increased from 128 (logior! (-> this mask) (process-mask actor-pause)) @@ -360,7 +362,7 @@ (when (and (>= 0.0 (-> self root transv y)) (>= (-> self base y) (-> self root trans y))) (set! (-> self root trans y) (-> self base y)) (cond - ((< (-> self root transv y) -8192.0) (set! (-> self root transv y) (* -0.5 (-> self root transv y)))) + ((< (-> self root transv y) -8192.0) (set! (-> self root transv y) (/ (-> self root transv y) -2))) (else (vector-reset! (-> self root transv)) (logclear! (-> self flags) (collectable-flags trans)) @@ -535,6 +537,7 @@ (deftype eco (eco-collectable) ()) + (defmethod animate ((this eco)) (let ((a0-1 (-> this part)) (a1-0 (-> this root root-prim prim-core))) @@ -573,24 +576,28 @@ (deftype eco-yellow (eco) ()) + (defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) (none)) (deftype eco-red (eco) ()) + (defmethod init-from-entity! ((this eco-red) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) (none)) (deftype eco-blue (eco) ()) + (defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) (none)) (deftype health (eco-collectable) ()) + (defmethod animate ((this health)) (let ((a0-1 (-> this part)) (a1-0 (-> this root root-prim prim-core))) @@ -605,6 +612,7 @@ (deftype eco-pill (eco-collectable) ()) + (defmethod animate ((this eco-pill)) (let ((a0-1 (-> this part)) (a1-0 (-> this root root-prim prim-core))) @@ -661,6 +669,7 @@ (deftype money (eco-collectable) ()) + (defmethod run-logic? ((this money)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) @@ -814,11 +823,12 @@ (:states (fuel-cell-clone-anim handle) (fuel-cell-spline-slider handle float float))) + (defun fuel-cell-pick-anim ((arg0 process-drawable)) (let* ((gp-0 (-> arg0 entity extra trans)) (a0-2 (res-lump-value (-> arg0 entity) 'movie-mask uint128 :time (the-as float -1000000000.0))) (a1-1 8) - (v1-6 (abs (the int (+ (* 0.00024414062 (-> gp-0 x)) (* 0.00024414062 (-> gp-0 z)))))) + (v1-6 (abs (the int (+ (/ (-> gp-0 x) METER_LENGTH) (/ (-> gp-0 z) METER_LENGTH))))) (v1-7 (mod v1-6 a1-1))) (while (logtest? a0-2 (ash 1 v1-7)) (set! v1-7 (mod (+ v1-7 1) a1-1))) @@ -1220,6 +1230,7 @@ (deftype buzzer (eco-collectable) ((victory-anim spool-anim))) + (defmethod animate ((this buzzer)) (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) (let ((a0-2 (-> this skel root-channel 0))) @@ -1565,6 +1576,7 @@ (:states ecovalve-idle)) + (defskelgroup *ecovalve-sg* ecovalve ecovalve-geo-jg @@ -1636,6 +1648,7 @@ (vent-pickup handle) vent-wait-for-touch)) + (defmethod initialize ((this vent) (arg0 entity-actor) (arg1 pickup-type)) (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask actor-pause)) @@ -1777,24 +1790,28 @@ (deftype ventyellow (vent) ()) + (defmethod init-from-entity! ((this ventyellow) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-yellow)) (none)) (deftype ventred (vent) ()) + (defmethod init-from-entity! ((this ventred) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-red)) (none)) (deftype ventblue (vent) ()) + (defmethod init-from-entity! ((this ventblue) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-blue)) (none)) (deftype ecovent (vent) ()) + (defmethod init-from-entity! ((this ecovent) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-blue)) (none)) diff --git a/goal_src/jak1/engine/common-obs/crates.gc b/goal_src/jak1/engine/common-obs/crates.gc index e2a43b1561b..00aa15a42c6 100644 --- a/goal_src/jak1/engine/common-obs/crates.gc +++ b/goal_src/jak1/engine/common-obs/crates.gc @@ -862,9 +862,9 @@ (defmethod smush-update! ((this crate)) (let ((f0-0 (update! (-> this smush)))) - (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale x) (+ 1.0 (/ f0-0 -2))) (set! (-> this root scale y) (+ 1.0 f0-0)) - (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0)))) + (set! (-> this root scale z) (+ 1.0 (/ f0-0 -2)))) 0 (none)) @@ -954,7 +954,7 @@ (+! (-> self root trans y) (* f30-0 (seconds-per-frame))) (when (< (-> self root trans y) (-> self base y)) (set! (-> self root trans y) (-> self base y)) - (set! f30-0 (* -0.5 f30-0)) + (set! f30-0 (/ f30-0 -2)) (if (< (fabs f30-0) 16384.0) (set! f30-0 0.0))) (crate-post) (ja-post) diff --git a/goal_src/jak1/engine/common-obs/dark-eco-pool.gc b/goal_src/jak1/engine/common-obs/dark-eco-pool.gc index a01f409a62f..50fcec4725a 100644 --- a/goal_src/jak1/engine/common-obs/dark-eco-pool.gc +++ b/goal_src/jak1/engine/common-obs/dark-eco-pool.gc @@ -337,7 +337,7 @@ (case (-> self look) ((32) (set! (-> gp-0 global-scale) (* 4096.0 (* 1.5 (+ 1.0 f30-0)))) - (set! (-> gp-0 individual-normal-scale) (+ 0.5 (* 0.5 f30-0)))) + (set! (-> gp-0 individual-normal-scale) (+ 0.5 (/ f30-0 2)))) (else (set! (-> gp-0 global-scale) (* 4096.0 (* 3.0 (+ 1.0 f30-0)))) - (set! (-> gp-0 individual-normal-scale) (+ 0.5 (* 0.5 f30-0)))))))) + (set! (-> gp-0 individual-normal-scale) (+ 0.5 (/ f30-0 2)))))))) diff --git a/goal_src/jak1/engine/common-obs/generic-obs.gc b/goal_src/jak1/engine/common-obs/generic-obs.gc index 07844f467fd..2a1acc27099 100644 --- a/goal_src/jak1/engine/common-obs/generic-obs.gc +++ b/goal_src/jak1/engine/common-obs/generic-obs.gc @@ -86,7 +86,7 @@ (when (and *target* (< (vector-vector-distance (-> self root trans) (-> *target* control unknown-vector90)) (-> self range)) (logtest? (-> *target* control root-prim prim-core action) (collide-action edgegrab-possible)) - (< (-> *target* control unknown-vector90 y) (+ (-> self root trans y) (* 0.5 (-> self range))))) + (< (-> *target* control unknown-vector90 y) (+ (-> self root trans y) (/ (-> self range) 2)))) (if (send-event *target* 'pole-grab self) (go swingpole-active))) (suspend)))) diff --git a/goal_src/jak1/engine/common-obs/nav-enemy.gc b/goal_src/jak1/engine/common-obs/nav-enemy.gc index 440d53fce23..3f5385ca697 100644 --- a/goal_src/jak1/engine/common-obs/nav-enemy.gc +++ b/goal_src/jak1/engine/common-obs/nav-enemy.gc @@ -32,7 +32,7 @@ (defmethod eval-position! ((this trajectory) (time float) (result vector)) (vector+float*! result (-> this initial-position) (-> this initial-velocity) time) - (+! (-> result y) (* 0.5 time time (-> this gravity))) + (+! (-> result y) (* (/ time 2) time (-> this gravity))) result) (defmethod relocate ((this nav-enemy) (offset int)) @@ -876,14 +876,14 @@ nav-enemy-default-event-handler (vector-xz-normalize! s1-1 1.0) (vector-xz-normalize! s2-2 1.0) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump drop-jump)) - (if (or (>= (* 0.5 (-> self nav-info run-travel-speed)) f24-0) (>= (cos 3640.889) (vector-dot s1-1 s2-2))) + (if (or (>= (/ (-> self nav-info run-travel-speed) 2) f24-0) (>= (cos 3640.889) (vector-dot s1-1 s2-2))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)))) (if (or (and (< f26-0 0.0) (< f28-0 (fabs f26-0))) (and (< (fabs f26-0) 12288.0) (< f28-0 20480.0))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)))) (when (and arg1 (logtest? (-> self nav-enemy-flags) (nav-enemy-flags drop-jump))) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) (set! f30-0 2048.0)) - (setup-from-to-height! (-> self jump-trajectory) s4-0 arg0 f30-0 (* 0.000011111111 arg4))) + (setup-from-to-height! (-> self jump-trajectory) s4-0 arg0 f30-0 (/ arg4 90000))) (set! (-> self nav extra-nav-sphere quad) (-> arg0 quad)) (set! (-> self nav extra-nav-sphere w) (-> self collide-info nav-radius)) (logior! (-> self collide-info nav-flags) (nav-flags navf1)) diff --git a/goal_src/jak1/engine/common-obs/plat-eco.gc b/goal_src/jak1/engine/common-obs/plat-eco.gc index f44d7e9594b..c4241e75aa5 100644 --- a/goal_src/jak1/engine/common-obs/plat-eco.gc +++ b/goal_src/jak1/engine/common-obs/plat-eco.gc @@ -17,6 +17,7 @@ (:methods (notice-blue (handle) _type_ :state :overlay-at wad))) + (defskelgroup *plat-eco-unlit-sg* plat-eco plat-eco-lod0-jg @@ -130,7 +131,7 @@ (sync-now! (-> self sync) (-> self sync-linear-val)) (set! (-> self sync-offset-faux) (-> self sync offset)) (let* ((f0-3 (the float (-> self sync period))) - (f1-1 (* 0.5 f0-3))) + (f1-1 (/ f0-3 2))) (if (< f1-1 (- (-> self sync-offset-dest) (-> self sync-offset-faux))) (+! (-> self sync-offset-faux) f0-3)) (if (< f1-1 (- (-> self sync-offset-faux) (-> self sync-offset-dest))) (set! (-> self sync-offset-faux) (- (-> self sync-offset-faux) f0-3)))) diff --git a/goal_src/jak1/engine/common-obs/rigid-body.gc b/goal_src/jak1/engine/common-obs/rigid-body.gc index 97e0d39cff7..bda78a666c0 100644 --- a/goal_src/jak1/engine/common-obs/rigid-body.gc +++ b/goal_src/jak1/engine/common-obs/rigid-body.gc @@ -201,9 +201,11 @@ (platform symbol) (sound-name string))) + (deftype rigid-body-control-point-inline-array (inline-array-class) ((data rigid-body-control-point :inline :dynamic :offset 16))) + (set! (-> rigid-body-control-point-inline-array heap-base) (the-as uint 48)) (deftype rigid-body-platform (process-drawable) @@ -240,11 +242,12 @@ (rigid-body-platform-method-33 (_type_) object) (rigid-body-platform-method-34 (_type_) none))) -(defmethod relocate ((this rigid-body-platform) (arg0 int)) + +(defmethod relocate ((this rigid-body-platform) (offset int)) (if (nonzero? (-> this control-point-array)) (set! (-> this control-point-array) - (the-as rigid-body-control-point-inline-array (+ (the-as int (-> this control-point-array)) arg0)))) - (call-parent-method this arg0)) + (the-as rigid-body-control-point-inline-array (+ (the-as int (-> this control-point-array)) offset)))) + (call-parent-method this offset)) (defmethod rigid-body-platform-method-22 ((this rigid-body-platform) (arg0 vector) (arg1 float)) (let ((v1-0 (-> this water-anim))) @@ -328,7 +331,7 @@ (+! (-> this sim-time-remaining) (* 0.0033333334 (the float (- (current-time) (-> *display* old-base-frame-counter))))) (let ((f30-0 (* DISPLAY_FPS_RATIO 0.016666668)) ;; og:preserve-this changed for high fps (f28-0 (* 0.0033333334 (the float (logand #xffffff (current-time)))))) - (while (>= (-> this sim-time-remaining) (* 0.5 f30-0)) + (while (>= (-> this sim-time-remaining) (/ f30-0 2)) (clear-force-torque! (-> this rbody)) (rigid-body-platform-method-23 this f28-0) (rigid-body-method-10 (-> this rbody) f30-0) diff --git a/goal_src/jak1/engine/common-obs/ropebridge.gc b/goal_src/jak1/engine/common-obs/ropebridge.gc index 2dba7a84a55..6a1df534259 100644 --- a/goal_src/jak1/engine/common-obs/ropebridge.gc +++ b/goal_src/jak1/engine/common-obs/ropebridge.gc @@ -26,6 +26,7 @@ (bridge-end-to-end-len float) (rest-state symbol))) + (define *ropebridge-70-rest-state* (new 'static 'inline-array @@ -480,6 +481,7 @@ (extra-force vector :inline)) :pack-me) + (deftype ropebridge (process-drawable) ((root collide-shape :override) (subtype uint64) @@ -508,6 +510,7 @@ (:states ropebridge-idle)) + (defskelgroup *ropebridge-32-sg* ropebridge-32 ropebridge-32-lod0-jg @@ -889,7 +892,7 @@ (set-time! (-> this agitated-time-stamp)) (set-time! (-> this bonk-time-stamp)) (set-time! (-> this attack-flop-time-stamp)) - (set-vector! (-> this extra-trans) 0.0 0.0 (- (* 0.5 (-> this tuning bridge-end-to-end-len))) 1.0) + (set-vector! (-> this extra-trans) 0.0 0.0 (- (/ (-> this tuning bridge-end-to-end-len) 2)) 1.0) (set! (-> this do-physics?) #t) (let ((a0-13 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (set! (-> this root) a0-13) @@ -900,7 +903,7 @@ (logior! (-> this skel status) (janim-status inited)) (let ((v1-29 (-> this tuning))) (set! (-> this draw bounds w) (-> v1-29 view-frustum-radius)) - (set! (-> this sleep-dist) (+ 40960.0 (* 0.5 (-> v1-29 bridge-end-to-end-len)))) + (set! (-> this sleep-dist) (+ 40960.0 (/ (-> v1-29 bridge-end-to-end-len) 2))) (if (or (< 35 (-> v1-29 num-springs)) (< 36 (-> v1-29 num-spring-points))) (format 0 "ERROR: ##########~%Exceeded max # of springs in ropebridge! Stomping memory!~%##########~%"))) (set! (-> this skel postbind-function) ropebridge-joint-callback) diff --git a/goal_src/jak1/engine/common-obs/sharkey.gc b/goal_src/jak1/engine/common-obs/sharkey.gc index 8ca9a7ce871..3b57a3ca142 100644 --- a/goal_src/jak1/engine/common-obs/sharkey.gc +++ b/goal_src/jak1/engine/common-obs/sharkey.gc @@ -47,6 +47,7 @@ (sound-id sound-id) (enable-patrol basic))) + (defskelgroup *sharkey-sg* sharkey sharkey-lod0-jg @@ -101,7 +102,7 @@ nav-enemy-default-event-handler (let ((f30-0 (-> this water height)) (s5-0 (new 'stack-no-clear 'vector))) (let* ((f3-0 (- -36864.0 (-> this collide-info trans y))) - (f0-2 (fmax 0.0 (fmin 1.0 (- 1.0 (* 0.00008138021 f3-0)))))) + (f0-2 (fmax 0.0 (fmin 1.0 (- 1.0 (/ f3-0 (meters 3))))))) (set-vector! (-> this draw color-mult) f0-2 f0-2 f0-2 1.0)) (water-control-method-10 (-> this water)) (let ((f28-0 (-> this collide-info trans y))) diff --git a/goal_src/jak1/engine/common-obs/water.gc b/goal_src/jak1/engine/common-obs/water.gc index 27e1e29fe27..8ab5a15836f 100644 --- a/goal_src/jak1/engine/common-obs/water.gc +++ b/goal_src/jak1/engine/common-obs/water.gc @@ -626,7 +626,7 @@ (set! (-> *part-id-table* 118 init-specs 4 initial-valuef) (+ 24576.0 f30-1)) (set! (-> *part-id-table* 118 init-specs 19 initial-valuef) (+ 49152.0 f30-1)) (set! (-> *part-id-table* 118 init-specs 1 initial-valuef) (* 0.0000036621095 f28-0)) - (set! (-> *part-id-table* 118 init-specs 2 initial-valuef) (* 0.1 f28-0)) + (set! (-> *part-id-table* 118 init-specs 2 initial-valuef) (/ f28-0 10)) (set! (-> *part-id-table* 118 init-specs 13 initial-valuef) 0.7111111) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 118) s4-0) (set! (-> *part-id-table* 121 init-specs 1 initial-valuef) (* 0.000004150391 f28-0)) @@ -754,7 +754,7 @@ (launch-particles (-> *part-id-table* 145) a2-15)) (set-time! (-> this drip-time)) (logclear! (-> this flags) (water-flags wt15)) - (seek! (-> this drip-wetness) 0.0 (* 0.001 (-> this drip-speed))) + (seek! (-> this drip-wetness) 0.0 (/ (-> this drip-speed) 1000)) (set! (-> this drip-speed) (* 1.05 (-> this drip-speed))) (if (= (-> this drip-wetness) 0.0) (set! (-> this drip-height) 0.0))) ((time-elapsed? (the-as time-frame (the int (/ (the float (-> this drip-time)) (-> this drip-mult)))) @@ -785,9 +785,9 @@ (set! (-> *part-id-table* 129 init-specs 12 random-rangef) (* 13.653334 (* -0.075 f0-0))) (set! (-> *part-id-table* 133 init-specs 12 initial-valuef) (* 13.653334 (* -0.15 f0-0))) (set! (-> *part-id-table* 133 init-specs 12 random-rangef) (* 13.653334 (* -0.075 f0-0))) - (set! (-> *part-id-table* 131 init-specs 2 initial-valuef) (* 4096.0 (* 0.1 f0-0))) + (set! (-> *part-id-table* 131 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 10))) (set! (-> *part-id-table* 131 init-specs 2 random-rangef) (* 4096.0 (* 0.4 f0-0))) - (set! (-> *part-id-table* 131 init-specs 4 initial-valuef) (* 4096.0 (* 0.1 f0-0))) + (set! (-> *part-id-table* 131 init-specs 4 initial-valuef) (* 4096.0 (/ f0-0 10))) (set! (-> *part-id-table* 131 init-specs 4 random-rangef) (* 4096.0 (* 0.4 f0-0))) (set! (-> *part-id-table* 131 init-specs 9 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 131 init-specs 9 random-rangef) (* 13.653334 (* 3.4 f0-0))) @@ -801,23 +801,23 @@ (set! (-> *part-id-table* 126 init-specs 9 random-rangef) (* 13.653334 (* 1.4 f0-0))) (set! (-> *part-id-table* 126 init-specs 10 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 126 init-specs 10 random-rangef) (* 13.653334 (* 1.4 f0-0))) - (set! (-> *part-id-table* 127 init-specs 2 initial-valuef) (* 4096.0 (* -0.5 f0-0))) + (set! (-> *part-id-table* 127 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 -2))) (set! (-> *part-id-table* 127 init-specs 2 random-rangef) (* 4096.0 f0-0)) - (set! (-> *part-id-table* 127 init-specs 3 initial-valuef) (* 4096.0 (* -0.5 f0-0))) + (set! (-> *part-id-table* 127 init-specs 3 initial-valuef) (* 4096.0 (/ f0-0 -2))) (set! (-> *part-id-table* 127 init-specs 3 random-rangef) (* 4096.0 f0-0)) - (set! (-> *part-id-table* 127 init-specs 4 initial-valuef) (* 4096.0 (* 0.5 f0-0))) + (set! (-> *part-id-table* 127 init-specs 4 initial-valuef) (* 4096.0 (/ f0-0 2))) (set! (-> *part-id-table* 127 init-specs 4 random-rangef) (* 4096.0 f0-0)) - (set! (-> *part-id-table* 127 init-specs 6 initial-valuef) (* 4096.0 (* 0.5 f0-0))) + (set! (-> *part-id-table* 127 init-specs 6 initial-valuef) (* 4096.0 (/ f0-0 2))) (set! (-> *part-id-table* 127 init-specs 6 random-rangef) (* 4096.0 f0-0)) (set! (-> *part-id-table* 127 init-specs 11 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 127 init-specs 11 random-rangef) (* 13.653334 f0-0)) (set! (-> *part-id-table* 127 init-specs 12 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 127 init-specs 12 random-rangef) (* 13.653334 f0-0)) (set! (-> *part-id-table* 132 init-specs 1 initial-valuef) (* 4.0 f0-0)) - (set! (-> *part-id-table* 132 init-specs 2 initial-valuef) (* 4096.0 (* -0.25 f0-0))) - (set! (-> *part-id-table* 132 init-specs 2 random-rangef) (* 4096.0 (* 0.5 f0-0))) - (set! (-> *part-id-table* 132 init-specs 3 initial-valuef) (* 4096.0 (* -0.25 f0-0))) - (set! (-> *part-id-table* 132 init-specs 3 random-rangef) (* 4096.0 (* 0.5 f0-0))) + (set! (-> *part-id-table* 132 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 -4))) + (set! (-> *part-id-table* 132 init-specs 2 random-rangef) (* 4096.0 (/ f0-0 2))) + (set! (-> *part-id-table* 132 init-specs 3 initial-valuef) (* 4096.0 (/ f0-0 -4))) + (set! (-> *part-id-table* 132 init-specs 3 random-rangef) (* 4096.0 (/ f0-0 2))) (set! (-> *part-id-table* 132 init-specs 10 initial-valuef) (* 13.653334 (* -0.75 f0-0))) (set! (-> *part-id-table* 132 init-specs 10 random-rangef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 132 init-specs 12 initial-valuef) (* 13.653334 (* -0.75 f0-0))) @@ -849,10 +849,10 @@ (set! (-> *part-id-table* 125 init-specs 13 initial-valuef) (* 13.653334 (* -0.3 f0-0))) (set! (-> *part-id-table* 125 init-specs 13 random-rangef) (* 13.653334 (* -0.075 f0-0))) (set! (-> *part-id-table* 124 init-specs 2 initial-valuef) (* 4096.0 (* 1.2 f0-0))) - (set! (-> *part-id-table* 124 init-specs 2 random-rangef) (* 4096.0 (* 0.2 f0-0))) + (set! (-> *part-id-table* 124 init-specs 2 random-rangef) (* 4096.0 (/ f0-0 5))) (set! (-> *part-id-table* 124 init-specs 3 initial-valuef) (* 4096.0 (* 0.4 f0-0))) (set! (-> *part-id-table* 124 init-specs 3 random-rangef) (* 4096.0 (* 1.2 f0-0))) - (set! (-> *part-id-table* 124 init-specs 7 initial-valuef) (* 4096.0 (* 0.2 f0-0))) + (set! (-> *part-id-table* 124 init-specs 7 initial-valuef) (* 4096.0 (/ f0-0 5))) (set! (-> *part-id-table* 124 init-specs 7 random-rangef) (* 4096.0 (* 2.2 f0-0))) (set! (-> *part-id-table* 130 init-specs 2 initial-valuef) (* 4096.0 (* 0.3 f0-0))) (set! (-> *part-id-table* 130 init-specs 2 random-rangef) (* 4096.0 (* 0.9 f0-0))) diff --git a/goal_src/jak1/engine/debug/anim-tester.gc b/goal_src/jak1/engine/debug/anim-tester.gc index 0f7ee0f9544..035d73ba2ee 100644 --- a/goal_src/jak1/engine/debug/anim-tester.gc +++ b/goal_src/jak1/engine/debug/anim-tester.gc @@ -56,10 +56,12 @@ (return-int int32)) :allow-misaligned) + (deftype list-field (structure) ((left int32) (width int32))) + (deftype DISP_LIST-bank (basic) ((TV_SPACING int32) (BORDER_WIDTH int32) @@ -73,6 +75,7 @@ (BXOFF int32) (BYOFF int32))) + (define *DISP_LIST-bank* (new 'static 'DISP_LIST-bank @@ -248,6 +251,7 @@ (EDIT_LIST_MIN_WIDTH int32) (EDIT_PICK_X int32))) + (define *ANIM_TESTER-bank* (new 'static 'anim-tester-bank @@ -287,6 +291,7 @@ (:states anim-tester-process)) + (defun anim-tester-num-print ((arg0 basic) (arg1 float)) (cond ((= arg1 -2.0) (format arg0 "max")) @@ -311,6 +316,7 @@ (:methods (new (symbol type int string basic) _type_))) + (defun anim-test-obj-init ((arg0 anim-test-obj) (arg1 list-control)) (set! (-> arg0 mesh-geo) #f) (set! (-> arg0 joint-geo) #f) @@ -341,6 +347,7 @@ (:methods (new (symbol type int string) _type_))) + (defun anim-test-sequence-init ((arg0 anim-test-sequence) (arg1 anim-test-obj)) (set! (-> arg0 list-con listfunc) anim-test-edit-sequence-list-handler) (set! (-> arg0 list-con left) (-> *ANIM_TESTER-bank* EDIT_LIST_X)) @@ -371,6 +378,7 @@ (:methods (new (symbol type int string) _type_))) + (defmethod new anim-test-seq-item ((allocation symbol) (type-to-make type) (arg0 int) (arg1 string)) (let ((t9-0 (method-of-type structure new)) (v1-1 type-to-make)) @@ -394,6 +402,7 @@ (set! (-> arg0 flags) (-> arg1 flags)) (let ((v0-0 (-> arg1 parent))) (set! (-> arg0 parent) v0-0) v0-0)) + (defun anim-test-obj-item-valid? ((arg0 anim-test-obj) (arg1 anim-test-seq-item)) (let ((v1-0 (-> arg0 seq-list))) "return the start of the list" @@ -475,7 +484,7 @@ (set! (-> self anim-first) (-> arg0 first-frame)) (set! (-> self anim-last) (-> arg0 last-frame)) (set! (-> self anim-gspeed) (* 0.01 (the float (-> self speed)))) - (set! (-> self anim-speed) (* 0.01 (-> self anim-gspeed) (the float (-> arg0 speed)))) + (set! (-> self anim-speed) (* (/ (-> self anim-gspeed) 100) (the float (-> arg0 speed)))) (when (< (-> self anim-speed) 0.0) (set! (-> self anim-first) (-> arg0 last-frame)) (set! (-> self anim-last) (-> arg0 first-frame))) diff --git a/goal_src/jak1/engine/debug/default-menu.gc b/goal_src/jak1/engine/debug/default-menu.gc index 341c997ed90..60444a5e637 100644 --- a/goal_src/jak1/engine/debug/default-menu.gc +++ b/goal_src/jak1/engine/debug/default-menu.gc @@ -106,8 +106,8 @@ (('close) (if (and *math-camera* *subdivide-settings*) (set! (-> *subdivide-settings* close 3) (* 4096.0 arg2)))) (('far) (if (and *math-camera* *subdivide-settings*) (set! (-> *subdivide-settings* far 3) (* 4096.0 arg2)))))) (case arg0 - (('close) (if (and *math-camera* *subdivide-settings*) (* 0.00024414062 (-> *subdivide-settings* close 3)) arg3)) - (('far) (if (and *math-camera* *subdivide-settings*) (* 0.00024414062 (-> *subdivide-settings* far 3)) arg3)) + (('close) (if (and *math-camera* *subdivide-settings*) (/ (-> *subdivide-settings* close 3) METER_LENGTH) arg3)) + (('far) (if (and *math-camera* *subdivide-settings*) (/ (-> *subdivide-settings* far 3) METER_LENGTH) arg3)) (else arg3))) (defun dm-subdiv-int ((arg0 symbol) (arg1 debug-menu-msg) (arg2 int) (arg3 int)) @@ -301,6 +301,7 @@ ((drawable-tree-instance-shrub) (let ((s3-0 (-> (the-as drawable-tree-instance-shrub v1-7) info prototype-inline-array-shrub))) (dotimes (s2-0 (-> s3-0 length)) + ;; og:preserve-this (let ((a1-4 (new 'debug 'debug-menu-item-flag (-> s3-0 data s2-0 name) (-> s3-0 data s2-0 name) dm-instance-pick-func))) (debug-menu-append-item *instance-shrub-menu* a1-4))))) ((drawable-tree-instance-tie) @@ -1034,7 +1035,7 @@ (when (= arg1 (debug-menu-msg press)) (set! (-> gp-0 dists x) (* 4096.0 arg2)) (prototype-bucket-recalc-fields gp-0)) - (* 0.00024414062 (-> gp-0 dists x))) + (/ (-> gp-0 dists x) METER_LENGTH)) (else (empty) arg3))))) (the-as float 1.0) #t @@ -1052,7 +1053,7 @@ (when (= arg1 (debug-menu-msg press)) (set! (-> gp-0 dists w) (* 4096.0 arg2)) (prototype-bucket-recalc-fields gp-0)) - (* 0.00024414062 (-> gp-0 dists w))) + (/ (-> gp-0 dists w) METER_LENGTH)) (else (empty) arg3))))) (the-as float 1.0) #t diff --git a/goal_src/jak1/engine/game/effect-control.gc b/goal_src/jak1/engine/game/effect-control.gc index 847cb9cd6ab..06ea81e8672 100644 --- a/goal_src/jak1/engine/game/effect-control.gc +++ b/goal_src/jak1/engine/game/effect-control.gc @@ -502,7 +502,7 @@ ((logtest? (-> self control root-prim prim-core action) (collide-action racer)) (sound-play-by-name (sound-name-with-material 'zoom-land (-> self control ground-pat) "") (new-sound-id) - (the int (* 10.24 (* 100.0 (the float (the int (* 10.24 (* 0.000016276043 (-> self control ground-impact-vel)))))))) + (the int (* 10.24 (* 100.0 (the float (the int (* 10.24 (/ (-> self control ground-impact-vel) (meters 15)))))))) 0 0 (sound-group sfx) diff --git a/goal_src/jak1/engine/geometry/cylinder.gc b/goal_src/jak1/engine/geometry/cylinder.gc index e7a2c520fa9..1d9aeeabacf 100644 --- a/goal_src/jak1/engine/geometry/cylinder.gc +++ b/goal_src/jak1/engine/geometry/cylinder.gc @@ -31,6 +31,7 @@ (deftype cylinder-verts (structure) ((vert vector 24 :inline))) + (defmethod debug-draw ((this cylinder) (arg0 vector4w)) "Debug draw a cylinder. This is slow and ugly" (local-vars @@ -63,7 +64,7 @@ (vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0)) (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0))) (vector-normalize! s1-0 (-> this radius)) - (vector-float*! s0-0 (-> this axis) (* 0.125 (-> this length))) + (vector-float*! s0-0 (-> this axis) (/ (-> this length) 8)) (let ((s5-0 (new 'stack-no-clear 'cylinder-verts)) (s4-0 (new 'stack-no-clear 'cylinder-verts)) (s3-0 (new 'stack-no-clear 'matrix))) @@ -150,6 +151,7 @@ (deftype cylinder-flat-verts (structure) ((vert vector 10 :inline))) + (defmethod debug-draw ((this cylinder-flat) (arg0 vector4w)) (local-vars (sv-448 vector) (sv-464 int)) (rlet ((vf0 :class vf) @@ -163,7 +165,7 @@ (vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0)) (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0))) (vector-normalize! s1-0 (-> this radius)) - (vector-float*! s0-0 (-> this axis) (* 0.14285715 (-> this length))) + (vector-float*! s0-0 (-> this axis) (/ (-> this length) 7)) (let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s4-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s3-0 (new 'stack-no-clear 'matrix))) diff --git a/goal_src/jak1/engine/gfx/foreground/ripple.gc b/goal_src/jak1/engine/gfx/foreground/ripple.gc index 3e3aab2b198..b80606ac11a 100644 --- a/goal_src/jak1/engine/gfx/foreground/ripple.gc +++ b/goal_src/jak1/engine/gfx/foreground/ripple.gc @@ -17,10 +17,12 @@ (effect merc-effect)) :pack-me) + (deftype ripple-globals (structure) ((count int32) (requests ripple-request 16 :inline))) + (define *ripple-globals* (new 'global 'ripple-globals)) (defun ripple-make-request ((arg0 ripple-wave) (arg1 merc-effect)) @@ -132,4 +134,4 @@ (f1-12 (+ f0-22 (* (- f26-1 f24-1) (- f1-9 f0-22)))) (f0-23 (-> gp-0 faded-scale))) (if (< f0-23 0.0) (set! f0-23 (-> gp-0 global-scale))) - (+ f30-0 (* 0.0078125 f1-12 f0-23)))))))) + (+ f30-0 (* (/ f1-12 128) f0-23)))))))) diff --git a/goal_src/jak1/engine/gfx/mood/mood.gc b/goal_src/jak1/engine/gfx/mood/mood.gc index 00331a0139b..13046784be7 100644 --- a/goal_src/jak1/engine/gfx/mood/mood.gc +++ b/goal_src/jak1/engine/gfx/mood/mood.gc @@ -351,6 +351,7 @@ (length uint8) (height uint8))) + (defun update-mood-flames ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 int) (arg4 float) (arg5 float) (arg6 float)) (let* ((s5-0 (the-as flames-state (&-> arg0 state arg3))) (s4-0 (+ (-> s5-0 index) arg1)) @@ -448,6 +449,7 @@ ((val uint8)) :pack-me) + (defun update-mood-lightning ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 float) (arg6 symbol)) (local-vars (a3-2 (array float))) (with-pp @@ -546,10 +548,12 @@ ((time uint8)) :pack-me) + (deftype light-state (structure) ((fade uint8)) :pack-me) + (defun update-mood-light ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 int) (arg4 float) (arg5 float) (arg6 float) (arg7 int)) (let* ((gp-0 (&-> arg0 state arg2)) (f0-1 (the float (* (logand (+ (-> arg0 state arg3) arg7) 255) 512))) @@ -577,6 +581,7 @@ (last-index uint8)) :pack-me) + (define *lava-time* (the-as float 0)) (defun update-mood-lava ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 symbol)) @@ -598,8 +603,8 @@ (set! (-> s4-0 last-index) s0-1)) (when arg3 (let* ((v1-14 (logand (+ s0-1 -1) 3)) - (f1-11 (* 0.0078125 (-> s4-0 scale s0-1))) - (f0-11 (* 0.0078125 (-> s4-0 scale v1-14)))) + (f1-11 (/ (-> s4-0 scale s0-1) 128)) + (f0-11 (/ (-> s4-0 scale v1-14) 128))) (set! (-> arg0 times (+ arg1 s0-1) w) (* f30-2 f1-11)) (set! (-> arg0 times (+ arg1 v1-14) w) (* (- 1.0 f30-2) f0-11)))))) (none)) @@ -628,6 +633,7 @@ (time0 light-time-state :inline) (time1 light-time-state :inline))) + (defun update-mood-misty ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) @@ -665,6 +671,7 @@ ((flames flames-state :inline) (lightning lightning-state :inline))) + (defun update-mood-village2 ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) @@ -710,7 +717,7 @@ (let ((f0-26 (vector-vector-distance s4-1 s3-0))) (when (< f0-26 61440.0) (let ((a2-10 (new 'stack-no-clear 'vector)) - (f0-27 (* 0.000016276043 f0-26))) + (f0-27 (/ f0-26 (meters 15)))) (set-vector! a2-10 1.0 0.5 0.0 1.0) (let ((f0-31 (* 0.5 (- 1.0 (fmax 0.0 (fmin 1.0 f0-27)))))) (vector+float*! (-> s5-5 ambi color) (-> s5-5 ambi color) a2-10 f0-31)))))) @@ -746,7 +753,7 @@ (let ((f30-0 (fmax 0.0 (-> *math-camera* camera-rot vector 1 z)))) (let ((a2-4 (new 'stack-no-clear 'vector))) (set-vector! a2-4 0.0 32.0 48.0 128.0) - (vector4-lerp! (the-as vector (-> arg0 current-fog)) (the-as vector (-> arg0 current-fog)) a2-4 (* 0.5 f30-0))) + (vector4-lerp! (the-as vector (-> arg0 current-fog)) (the-as vector (-> arg0 current-fog)) a2-4 (/ f30-0 2))) (let ((f0-7 (-> arg0 current-fog fog-dists w)) (f1-1 255.0)) (set! (-> arg0 current-fog fog-dists w) (+ f0-7 (* 0.666 f30-0 (- f1-1 f0-7)))))) @@ -757,6 +764,7 @@ (deftype village1-states (structure) ((flames flames-state :inline))) + (defun update-mood-village1 ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) @@ -829,6 +837,7 @@ (time light-time-state :inline) (one-shot uint8))) + (defun update-mood-jungle ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) @@ -994,6 +1003,7 @@ ((light light-state :inline) (time light-time-state :inline))) + (set! (-> *sunken-mood* state 0) (the-as uint 255)) (defun update-mood-sunken ((arg0 mood-context) (arg1 float) (arg2 int)) @@ -1003,7 +1013,7 @@ (update-mood-sky-texture arg0 arg1) (if (not (paused?)) (+! (-> arg0 state 1) 1)) (let ((f30-0 (update-mood-palette arg0 arg1 arg2)) - (f28-0 (* -0.00000055486504 (-> *math-camera* trans y))) + (f28-0 (/ (-> *math-camera* trans y) (meters -440))) (s5-1 (-> arg0 light-group))) (when *time-of-day-effects* (update-mood-light arg0 2 0 1 0.875 0.25 20.0 32) @@ -1070,6 +1080,7 @@ (time light-time-state :inline) (lightning lightning-state :inline))) + (define *rolling-spheres-on* (new 'static 'inline-array @@ -1147,43 +1158,43 @@ (let ((s5-2 (-> arg0 light-group 6))) (update-light-kit s5-2 (-> arg0 light-group 0 ambi) 1.0) (set! (-> s5-2 dir0 levels x) - (+ (* 0.25 (-> arg0 times 4 w)) (* 0.25 (-> arg0 times 5 w)) (* 0.25 (-> arg0 times 6 w)) (* 0.25 (-> arg0 times 7 w))))) + (+ (/ (-> arg0 times 4 w) 4) (/ (-> arg0 times 5 w) 4) (/ (-> arg0 times 6 w) 4) (/ (-> arg0 times 7 w) 4)))) (new 'stack-no-clear 'vector) (let ((s5-3 (target-joint-pos))) 0.0 (dotimes (s4-2 11) (let ((f0-7 (vector-vector-distance (-> *rolling-spheres-on* s4-2) s5-3))) (when (< f0-7 (-> *rolling-spheres-on* s4-2 w)) - (let ((f30-0 (/ (- f0-7 (* 0.5 (-> *rolling-spheres-on* s4-2 w))) (* 0.5 (-> *rolling-spheres-on* s4-2 w))))) + (let ((f30-0 (/ (- f0-7 (/ (-> *rolling-spheres-on* s4-2 w) 2)) (/ (-> *rolling-spheres-on* s4-2 w) 2)))) (set-target-light-index 1) (set! (-> *time-of-day-context* target-interp) (- 1.0 (fmax 0.0 (fmin 1.0 f30-0)))))))) (let ((f0-11 (vector-vector-distance (the-as vector (&-> *rolling-spheres-light0* x)) s5-3))) (when (< f0-11 (-> *rolling-spheres-light0* w)) - (let ((f30-1 (/ (- f0-11 (* 0.5 (-> *rolling-spheres-light0* w))) (* 0.5 (-> *rolling-spheres-light0* w))))) + (let ((f30-1 (/ (- f0-11 (/ (-> *rolling-spheres-light0* w) 2)) (/ (-> *rolling-spheres-light0* w) 2)))) (set-target-light-index 2) (set! (-> *time-of-day-context* target-interp) (- 1.0 (fmax 0.0 (fmin 1.0 f30-1))))))) (dotimes (s4-3 4) (let ((f0-15 (vector-vector-distance (-> *rolling-spheres-light1* s4-3) s5-3))) (when (< f0-15 (-> *rolling-spheres-light1* s4-3 w)) - (let ((f30-2 (/ (- f0-15 (* 0.5 (-> *rolling-spheres-light1* s4-3 w))) (* 0.5 (-> *rolling-spheres-light1* s4-3 w))))) + (let ((f30-2 (/ (- f0-15 (/ (-> *rolling-spheres-light1* s4-3 w) 2)) (/ (-> *rolling-spheres-light1* s4-3 w) 2)))) (set-target-light-index 3) (set! (-> *time-of-day-context* target-interp) (- 1.0 (fmax 0.0 (fmin 1.0 f30-2)))))))) (dotimes (s4-4 5) (let ((f0-19 (vector-vector-distance (the-as vector (+ (the-as uint *rolling-spheres-light2*) (* s4-4 16))) s5-3))) (when (< f0-19 (-> *rolling-spheres-light2* matrix vector s4-4 w)) - (let ((f30-3 (/ (- f0-19 (* 0.5 (-> *rolling-spheres-light2* matrix vector s4-4 w))) - (* 0.5 (-> *rolling-spheres-light2* matrix vector s4-4 w))))) + (let ((f30-3 (/ (- f0-19 (/ (-> *rolling-spheres-light2* matrix vector s4-4 w) 2)) + (/ (-> *rolling-spheres-light2* matrix vector s4-4 w) 2)))) (set-target-light-index 4) (set! (-> *time-of-day-context* target-interp) (- 1.0 (fmax 0.0 (fmin 1.0 f30-3)))))))) (dotimes (s4-5 2) (let ((f0-23 (vector-vector-distance (-> *rolling-spheres-light3* s4-5) s5-3))) (when (< f0-23 (-> *rolling-spheres-light3* s4-5 w)) - (let ((f30-4 (/ (- f0-23 (* 0.5 (-> *rolling-spheres-light3* s4-5 w))) (* 0.5 (-> *rolling-spheres-light3* s4-5 w))))) + (let ((f30-4 (/ (- f0-23 (/ (-> *rolling-spheres-light3* s4-5 w) 2)) (/ (-> *rolling-spheres-light3* s4-5 w) 2)))) (set-target-light-index 5) (set! (-> *time-of-day-context* target-interp) (- 1.0 (fmax 0.0 (fmin 1.0 f30-4)))))))) (let ((f0-27 (vector-vector-distance (the-as vector (&-> *rolling-spheres-light4* x)) s5-3))) (when (< f0-27 (-> *rolling-spheres-light4* w)) - (let ((f30-5 (/ (- f0-27 (* 0.5 (-> *rolling-spheres-light4* w))) (* 0.5 (-> *rolling-spheres-light4* w))))) + (let ((f30-5 (/ (- f0-27 (/ (-> *rolling-spheres-light4* w) 2)) (/ (-> *rolling-spheres-light4* w) 2)))) (set-target-light-index 6) (set! (-> *time-of-day-context* target-interp) (- 1.0 (fmax 0.0 (fmin 1.0 f30-5)))))))) (update-mood-itimes arg0) @@ -1193,6 +1204,7 @@ (deftype firecanyon-states (structure) ((lava lava-state :inline))) + (defun update-mood-firecanyon ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) @@ -1207,6 +1219,7 @@ ((light light-state :inline) (time light-time-state :inline))) + (defun update-mood-training ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) @@ -1222,6 +1235,7 @@ (deftype maincave-states (structure) ((flames flames-state :inline))) + (defun update-mood-maincave ((arg0 mood-context) (arg1 float) (arg2 int)) (when (not (paused?)) (clear-mood-times arg0) @@ -1261,7 +1275,7 @@ (set! (-> arg0 times s2-0 w) f28-0) (vector-! s3-0 (the-as vector (-> *palette-fade-controls* control s2-0)) (-> *target* control trans)) (let* ((f3-0 (vector-length s3-0)) - (f28-1 (* f28-0 (fmax 0.0 (fmin 1.0 (- 1.0 (* 0.000012207031 f3-0))))))) + (f28-1 (* f28-0 (fmax 0.0 (fmin 1.0 (- 1.0 (/ f3-0 (meters 20)))))))) (vector-normalize! s3-0 f28-1) (if (< f30-0 f28-1) (set! f30-0 f28-1)))) (vector+! s4-0 s4-0 s3-0) @@ -1295,6 +1309,7 @@ (deftype robocave-states (structure) ((flames flames-state :inline))) + (defun update-mood-robocave ((arg0 mood-context) (arg1 float) (arg2 int)) (clear-mood-times arg0) (set! (-> arg0 times 0 w) 1.0) @@ -1311,6 +1326,7 @@ (one-shot uint8) (interp float))) + (defun update-mood-snow ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) @@ -1352,6 +1368,7 @@ (lava-time float) (time uint8))) + (defun update-mood-village3 ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) @@ -1476,6 +1493,7 @@ (light light-state :inline) (time light-time-state :inline))) + (set! (-> *lavatube-mood* state 18) (the-as uint 255)) (defun update-mood-lavatube ((arg0 mood-context) (arg1 float) (arg2 int)) @@ -1497,6 +1515,7 @@ (lava-time float) (lava-fade float))) + (defun update-mood-ogre ((arg0 mood-context) (arg1 float) (arg2 int)) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) @@ -1614,6 +1633,7 @@ ((start-time time-frame) (secret-time time-frame))) + (defun update-mood-finalboss ((arg0 mood-context) (arg1 float) (arg2 int)) (clear-mood-times arg0) (set! (-> arg0 light-group 0 dir2 levels x) 0.0) @@ -1743,6 +1763,7 @@ (flicker-on uint8) (shield-fade float))) + (set! (-> *citadel-mood* state 4) (the-as uint 255)) (defun update-mood-citadel ((arg0 mood-context) (arg1 float) (arg2 int)) @@ -1816,7 +1837,7 @@ (set-vector! s3-1 0.1 0.1 0.1 1.0) (let ((f30-3 (* (-> (the-as (pointer float) s5-1) 2) f30-2))) (vector4-lerp! s3-1 s3-1 s2-0 f30-3) - (set! (-> arg0 times 7 w) (* (+ 0.8 (* 0.1 f28-4)) f30-3)))) + (set! (-> arg0 times 7 w) (* (+ 0.8 (/ f28-4 10)) f30-3)))) (let ((v1-49 (-> s4-2 0 dir1))) (set! (-> v1-49 direction x) 0.0) (set! (-> v1-49 direction y) -1.0) diff --git a/goal_src/jak1/engine/gfx/mood/weather-part.gc b/goal_src/jak1/engine/gfx/mood/weather-part.gc index 67641446727..9a600d61303 100644 --- a/goal_src/jak1/engine/gfx/mood/weather-part.gc +++ b/goal_src/jak1/engine/gfx/mood/weather-part.gc @@ -473,9 +473,9 @@ (set! (-> arg2 vector 2 y) (-> *time-of-day-context* current-sun sun-color y)) (set! (-> arg2 vector 2 z) (-> *time-of-day-context* current-sun sun-color z))) ((or (= s5-0 1) (= s5-0 2)) - (set! (-> arg2 vector 2 x) (* 0.25 (-> *time-of-day-context* current-sun sun-color x))) - (set! (-> arg2 vector 2 y) (* 0.25 (-> *time-of-day-context* current-sun sun-color y))) - (set! (-> arg2 vector 2 z) (* 0.25 (-> *time-of-day-context* current-sun sun-color z)))))) + (set! (-> arg2 vector 2 x) (/ (-> *time-of-day-context* current-sun sun-color x) 4)) + (set! (-> arg2 vector 2 y) (/ (-> *time-of-day-context* current-sun sun-color y) 4)) + (set! (-> arg2 vector 2 z) (/ (-> *time-of-day-context* current-sun sun-color z) 4))))) 0 (none)) diff --git a/goal_src/jak1/engine/physics/dynamics-h.gc b/goal_src/jak1/engine/physics/dynamics-h.gc index a7fced38b44..a6b73f5aeae 100644 --- a/goal_src/jak1/engine/physics/dynamics-h.gc +++ b/goal_src/jak1/engine/physics/dynamics-h.gc @@ -15,6 +15,7 @@ (walk-distance meters) (run-distance meters))) + (defun time-to-apex ((arg0 float) (arg1 float)) "How many ticks it takes to reach the apex of a ballistic trajectory." (the int (/ arg0 (- (vel-tick arg1))))) @@ -25,8 +26,8 @@ (v0-0 0)) ;; actually integrate forward, just like the game will do so we're exact. (while (< (- arg2) f0-0) - (set! arg0 (- arg0 (* 0.0033333334 arg1))) - (+! f0-0 (* 0.0033333334 arg0)) + (set! arg0 (- arg0 (/ arg1 300))) + (+! f0-0 (/ arg0 300)) (+! v0-0 1)) v0-0)) diff --git a/goal_src/jak1/engine/physics/trajectory.gc b/goal_src/jak1/engine/physics/trajectory.gc index 6bdb4b15587..6633ea608ab 100644 --- a/goal_src/jak1/engine/physics/trajectory.gc +++ b/goal_src/jak1/engine/physics/trajectory.gc @@ -13,7 +13,7 @@ (+! (-> result x) (* time (-> this initial-velocity x))) (+! (-> result y) (* time (-> this initial-velocity y))) (+! (-> result z) (* time (-> this initial-velocity z))) - (+! (-> result y) (* 0.5 time time (-> this gravity))) + (+! (-> result y) (* (/ time 2) time (-> this gravity))) result) (defmethod eval-velocity! ((this trajectory) (time float) (result vector)) @@ -34,7 +34,7 @@ ;; but have magnitude that we calculated above. (vector-xz-normalize! (-> this initial-velocity) xz-vel)) ;; solve for the y velocity that makes us land at the right height. - (set! (-> this initial-velocity y) (- (/ (- (-> to y) (-> from y)) duration) (* 0.5 duration (-> this gravity)))) + (set! (-> this initial-velocity y) (- (/ (- (-> to y) (-> from y)) duration) (* (/ duration 2) (-> this gravity)))) 0 (none)) diff --git a/goal_src/jak1/engine/target/collide-reaction-target.gc b/goal_src/jak1/engine/target/collide-reaction-target.gc index 07b073d858a..f2f4957b0b7 100644 --- a/goal_src/jak1/engine/target/collide-reaction-target.gc +++ b/goal_src/jak1/engine/target/collide-reaction-target.gc @@ -106,7 +106,7 @@ (if (or (not (logtest? sv-32 32)) (< 0.5 f0-21)) (set! sv-48 (the-as symbol #f))) (when (and (or (and (< f0-21 0.95) (>= f30-0 0.0)) (and (logtest? sv-32 32) (< f0-21 0.3)) - (< f1-11 (* -0.25 (-> arg1 best-from-prim local-sphere w)))) + (< f1-11 (/ (-> arg1 best-from-prim local-sphere w) -4))) (>= (vector-dot sv-52 sv-16) -0.000001)) (set! (-> arg0 surf) *edge-surface*) (set! sv-32 (logior sv-32 1024)) diff --git a/goal_src/jak1/engine/target/logic-target.gc b/goal_src/jak1/engine/target/logic-target.gc index d0b1746d87f..3af68683f58 100644 --- a/goal_src/jak1/engine/target/logic-target.gc +++ b/goal_src/jak1/engine/target/logic-target.gc @@ -331,7 +331,7 @@ (when (< f2-0 (-> a1-3 a2-6 w)) (set! a0-3 a2-6) (set! f2-0 (-> a1-3 a2-6 w)))) - (let ((f1-1 (* 0.0625 f1-0))) + (let ((f1-1 (/ f1-0 16))) (set! (-> self control unknown-int10) a0-3) (set! (-> self control unknown-float100) f1-1) (if (logtest? (-> self control unknown-surface01 flags) (surface-flags no-turn-around)) diff --git a/goal_src/jak1/engine/target/target-util.gc b/goal_src/jak1/engine/target/target-util.gc index 923c42d318c..fb5f58e48fd 100644 --- a/goal_src/jak1/engine/target/target-util.gc +++ b/goal_src/jak1/engine/target/target-util.gc @@ -118,6 +118,7 @@ (tongue-pull-speed-max float) (yellow-attack-timeout time-frame))) + (define *TARGET-bank* (new 'static 'target-bank @@ -547,7 +548,7 @@ (dotimes (s5-0 8) (+! f30-0 (fabs (deg-diff (atan (-> arg0 control unknown-vector-array00 s5-0 x) (-> arg0 control unknown-vector-array00 s5-0 z)) 0.0)))) - (* 0.125 f30-0))) + (/ f30-0 8))) (defbehavior can-play-stance-amibent? target () (and (time-elapsed? (-> self state-time) (seconds 30)) @@ -769,9 +770,9 @@ (let ((f0-1 (fmax -1.0 (fmin 1.0 (* 2.0 arg1)))) (f30-0 (fmax -1.0 (fmin 1.0 (* 1.6 arg2))))) (let ((f1-5 (fabs (- f0-1 (the-as float (-> arg0 blend 1)))))) - (set! (-> arg0 blend 1) (seek (the-as float (-> arg0 blend 1)) f0-1 (fmax 0.05 (fmin 0.2 (* 0.25 f1-5)))))) + (set! (-> arg0 blend 1) (seek (the-as float (-> arg0 blend 1)) f0-1 (fmax 0.05 (fmin 0.2 (/ f1-5 4)))))) (let ((f0-7 (fabs (- f30-0 (the-as float (-> arg0 blend 2)))))) - (set! (-> arg0 blend 2) (seek (the-as float (-> arg0 blend 2)) f30-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-7))))))) + (set! (-> arg0 blend 2) (seek (the-as float (-> arg0 blend 2)) f30-0 (fmax 0.05 (fmin 0.2 (/ f0-7 4))))))) (if (>= (-> arg0 blend 1) 0.0) (ja :chan (-> arg0 chan 1) :group! (-> arg0 group 1) :frame-interp (fabs (-> arg0 blend 1))) (ja :chan (-> arg0 chan 1) :group! (-> arg0 group 2) :frame-interp (fabs (-> arg0 blend 1)))) diff --git a/goal_src/jak1/engine/target/target.gc b/goal_src/jak1/engine/target/target.gc index 50329802ccf..5e475ee3a86 100644 --- a/goal_src/jak1/engine/target/target.gc +++ b/goal_src/jak1/engine/target/target.gc @@ -422,7 +422,7 @@ ((ja-group? eichar-turn-around-ja) (set! f30-0 1.0) (ja-channel-push! 7 (seconds 0.05))) ((ja-group? eichar-duck-roll-ja) (ja-channel-push! 7 (seconds 0.075)) (set! f30-0 1.0)) ((ja-group? eichar-attack-from-stance-ja) - (let ((f30-1 (fmax 0.8 (fmin 1.0 (* 0.000048828126 (-> self control unknown-float01)))))) + (let ((f30-1 (fmax 0.8 (fmin 1.0 (/ (-> self control unknown-float01) (meters 5)))))) (cond ((and (rand-vu-percent? (the-as float 0.3)) (< 20480.0 (-> self control unknown-float01))) (ja-no-eval :group! @@ -559,8 +559,8 @@ (* 2.0 (seconds-per-frame)))) (let ((v1-317 (-> self skel effect))) (set! (-> v1-317 channel-offset) (if (< 0.5 f30-0) 3 0))) 0 - (let ((f0-64 (fabs (- f22-0 f28-2)))) (set! f28-2 (seek f28-2 f22-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-64)))))) - (let ((f0-69 (fabs (- f24-0 f26-1)))) (set! f26-1 (seek f26-1 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-69))))))) + (let ((f0-64 (fabs (- f22-0 f28-2)))) (set! f28-2 (seek f28-2 f22-0 (fmax 0.05 (fmin 0.2 (/ f0-64 4)))))) + (let ((f0-69 (fabs (- f24-0 f26-1)))) (set! f26-1 (seek f26-1 f24-0 (fmax 0.05 (fmin 0.2 (/ f0-69 4))))))) (cond ((>= f28-2 0.0) (ja :chan 1 :group! eichar-walk-up-ja :frame-interp (fabs f28-2) :dist (-> *TARGET-bank* walk-up-cycle-dist)) @@ -1413,7 +1413,7 @@ (vector-float*! gp-1 gp-1 (/ f0-4 f1-2)))))) (else (let* ((f1-5 (/ f0-1 (* (-> self control dynam gravity-length) (seconds-per-frame)))) - (f30-0 (* 0.5 f1-5 (seconds-per-frame) f0-1))) + (f30-0 (* (/ f1-5 2) (seconds-per-frame) f0-1))) (if (ja-group? eichar-attack-uppercut-ja) (set! f30-0 (fmax 0.0 @@ -1468,8 +1468,7 @@ (let ((f30-0 393216.0)) (let ((f0-8 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - (while (not (or (and (< (fabs (/ f0-8 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) - (time-elapsed? (-> self state-time) (seconds 1.7)))) + (while (not (or (and (< (fabs (/ f0-8 (/ f1-1 300))) 150.0) (< f1-1 0.0)) (time-elapsed? (-> self state-time) (seconds 1.7)))) (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) (* f30-0 (seconds-per-frame))) diff --git a/goal_src/jak1/engine/target/target2.gc b/goal_src/jak1/engine/target/target2.gc index c4e0c2b42d7..72f80f4bbb6 100644 --- a/goal_src/jak1/engine/target/target2.gc +++ b/goal_src/jak1/engine/target/target2.gc @@ -28,7 +28,9 @@ (send-event *camera* 'joystick 0.0 0.0) (suspend) (ja :num! (seek!))) - (suspend-for (seconds 0.3) (suspend) (ja :num! (seek! (ja-aframe (the-as float 19.0) 0) 0.05))) + (suspend-for (seconds 0.3) + (suspend) + (ja :num! (seek! (ja-aframe (the-as float 19.0) 0) 0.05))) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! eichar-painful-land-ja :num! (seek!) :frame-num (ja-aframe (the-as float 40.0) 0)) (until (ja-done? 0) @@ -112,6 +114,7 @@ hud-normal hud-waiting)) + (define *fp-hud-stack* (malloc 'global #x3800)) (defmethod deactivate ((this first-person-hud)) @@ -669,7 +672,7 @@ (ja :group! eichar-pole-jump-loop-ja :num! min) (let ((f0-1 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - (while (not (and (< (fabs (/ f0-1 (* 0.0033333334 f1-1))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) + (while (not (and (< (fabs (/ f0-1 (/ f1-1 300))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) (suspend) (ja :num! (loop!)) (set! f0-1 (target-height-above-ground)) @@ -1150,8 +1153,8 @@ (loop (let ((f0-10 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control unknown-float61))))) (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control unknown-float62)))))) - (let ((f1-4 (fabs (- f0-10 f30-1)))) (set! f30-1 (seek f30-1 f0-10 (fmax 0.05 (fmin 0.2 (* 0.25 f1-4)))))) - (let ((f0-14 (fabs (- f24-0 f28-0)))) (set! f28-0 (seek f28-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))))) + (let ((f1-4 (fabs (- f0-10 f30-1)))) (set! f30-1 (seek f30-1 f0-10 (fmax 0.05 (fmin 0.2 (/ f1-4 4)))))) + (let ((f0-14 (fabs (- f24-0 f28-0)))) (set! f28-0 (seek f28-0 f24-0 (fmax 0.05 (fmin 0.2 (/ f0-14 4))))))) (ja :chan 3 :group! eichar-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist)) (if (>= f30-1 0.0) (ja :chan 3 :group! eichar-walk-up-ja :frame-interp (fabs f30-1) :dist (-> *TARGET-bank* walk-up-cycle-dist)) diff --git a/goal_src/jak1/engine/ui/hud-classes.gc b/goal_src/jak1/engine/ui/hud-classes.gc index eec99fc5a4a..e9717668ff7 100644 --- a/goal_src/jak1/engine/ui/hud-classes.gc +++ b/goal_src/jak1/engine/ui/hud-classes.gc @@ -118,7 +118,6 @@ (deftype hud-pickups (hud) ()) - (defmethod draw-hud ((this hud-pickups)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this)) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) @@ -234,7 +233,6 @@ (deftype hud-health (hud) ((scale float))) - (defun part-hud-health-01-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (let ((f0-0 (-> *hud-parts* health 0 scale))) (set! (-> arg2 vector 0 w) f0-0) (set! (-> arg2 vector 1 w) f0-0)) (cond @@ -371,7 +369,6 @@ (level-index int32) (start-time time-frame))) - (defmethod draw-hud ((this hud-money-all)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this)) 0 @@ -533,6 +530,7 @@ (y-scale float) (y-pos int32))) +;; og:preserve-this (define-extern *game-counts* game-count-info) (defmethod draw-hud ((this hud-money)) @@ -855,7 +853,6 @@ (scale-center float) (icon-pos-y int32))) - (defmethod draw-hud ((this hud-fuel-cell)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this)) (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) (bucket-id debug)) @@ -941,13 +938,13 @@ (when *target* (when (!= *master-mode* 'pause) (let ((a0-2 (-> this icons 0 icon 0 root))) - (set-yaw-angle-clear-roll-pitch! a0-2 (+ (y-angle a0-2) (* 182.04445 (* 0.5 (-> *display* time-adjust-ratio))))))) + (set-yaw-angle-clear-roll-pitch! a0-2 (+ (y-angle a0-2) (* 182.04445 (/ (-> *display* time-adjust-ratio) 2)))))) (set! (-> this icons 0 icon-y) (-> this icon-pos-y)) (tally-value this (the int (+ 0.5 (-> *target* game fuel))) 0) (let ((s5-1 (new 'stack-no-clear 'vector))) (vector<-cspace! s5-1 (-> this icons 0 icon 0 node-list data 3)) (set! (-> this particles 0 pos x) (-> s5-1 x)) - (set! (-> this particles 0 pos y) (* 0.5 (-> s5-1 y))) + (set! (-> this particles 0 pos y) (/ (-> s5-1 y) 2)) (set! (-> this particles 0 pos z) (+ 2.0 (* 0.05 (+ -2048.0 (-> s5-1 z))))))) 0 (none)) @@ -1062,7 +1059,6 @@ ((scale float) (text-y-offset int32))) - (defun part-hud-buzzer-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (let ((f0-0 (-> *hud-parts* buzzers 0 scale))) (set! (-> arg2 vector 0 w) f0-0) (set! (-> arg2 vector 1 w) f0-0)) (none)) @@ -1252,7 +1248,6 @@ (scale-backing float) (scale-blue float))) - (defun calculate-rotation-and-color-for-slice ((arg0 int) (arg1 float) (arg2 int) (arg3 int) (arg4 int) (arg5 matrix)) (cond ((>= 0.0 arg1) (set! (-> arg5 vector 1 z) -16566.045)) diff --git a/goal_src/jak1/engine/ui/progress/progress-draw.gc b/goal_src/jak1/engine/ui/progress/progress-draw.gc index a1afa1b4740..2ad6c16a4f7 100644 --- a/goal_src/jak1/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak1/engine/ui/progress/progress-draw.gc @@ -47,7 +47,7 @@ (let ((a0-18 (-> this icons sv-144 icon 0 root))) (set! sv-176 a0-18) (set! sv-160 (method-of-object sv-176 set-yaw-angle-clear-roll-pitch!)) - (let ((a1-2 (+ (y-angle a0-18) (* 182.04445 (* 0.5 (-> *display* time-adjust-ratio)))))) (sv-160 sv-176 a1-2))) + (let ((a1-2 (+ (y-angle a0-18) (* 182.04445 (/ (-> *display* time-adjust-ratio) 2))))) (sv-160 sv-176 a1-2))) (set! sv-144 (+ sv-144 1))) (set! sv-192 (+ sv-112 (/ (- (* 47 (-> s5-0 nb-of-tasks)) (* sv-128 (-> s5-0 nb-of-tasks))) 2))) (set! sv-208 0) @@ -1042,7 +1042,7 @@ (s2-0 *temp-string* s3-0 (the int (+ 428.0 (the float s5-0) f30-0)) - (- 12 (the int (* 0.16666667 f30-0))) + (- 12 (the int (/ f30-0 6))) (font-color default) (font-flags shadow kerning large))) (let ((s2-1 draw-string-xy)) @@ -1050,7 +1050,7 @@ (s2-1 *temp-string* s3-0 (the int (+ 456.0 (the float (adjust-pos s5-0 50)) f30-0)) - (- 48 (the int (* 0.125 f30-0))) + (- 48 (the int (/ f30-0 8))) (font-color default) (font-flags shadow kerning large))) (let ((s2-2 draw-string-xy)) diff --git a/goal_src/jak1/levels/beach/beach-obs.gc b/goal_src/jak1/levels/beach/beach-obs.gc index d6c6bd881c1..c7e331a8e18 100644 --- a/goal_src/jak1/levels/beach/beach-obs.gc +++ b/goal_src/jak1/levels/beach/beach-obs.gc @@ -520,7 +520,7 @@ (set-vector! s4-0 (+ (-> s5-1 x) (-> s3-0 x)) (-> s5-1 y) (+ (-> s5-1 z) (-> s3-0 z)) 1.0) (vector-float*! s3-0 s3-0 10.0) (spawn-flying-rock s4-0 s3-0 1.0 (-> self entity)) - (set-vector! s3-0 (+ (* -0.866 f26-0) (* 0.5 f28-0)) (* 0.5 f30-0) (+ (* 0.866 f28-0) (* 0.5 f26-0)) 1.0) + (set-vector! s3-0 (+ (* -0.866 f26-0) (/ f28-0 2)) (/ f30-0 2) (+ (* 0.866 f28-0) (/ f26-0 2)) 1.0) (set-vector! s4-0 (-> s5-1 x) (+ 3276.8 (-> s5-1 y)) (-> s5-1 z) 1.0) (vector-float*! s3-0 s3-0 10.0) (spawn-flying-rock s4-0 s3-0 1.0 (-> self entity)))) diff --git a/goal_src/jak1/levels/beach/lurkerworm.gc b/goal_src/jak1/levels/beach/lurkerworm.gc index 347f4af8d4b..9b0f8d0a469 100644 --- a/goal_src/jak1/levels/beach/lurkerworm.gc +++ b/goal_src/jak1/levels/beach/lurkerworm.gc @@ -314,7 +314,7 @@ lurkerworm-default-post-behavior (let* ((f0-13 (- 1.0 (* 0.00009765625 (+ -16384.0 (if *target* (vector-vector-distance (-> self root trans) (-> *target* control trans)) 4096000.0))))) - (f30-2 (* 0.2 f0-13))) + (f30-2 (/ f0-13 5))) (if (< (rand-float-gen) f30-2) (go lurkerworm-strike)))) (+! s5-0 -1) (when (zero? s5-0) diff --git a/goal_src/jak1/levels/citadel/citb-plat.gc b/goal_src/jak1/levels/citadel/citb-plat.gc index e41da9eca70..28bbe1ea093 100644 --- a/goal_src/jak1/levels/citadel/citb-plat.gc +++ b/goal_src/jak1/levels/citadel/citb-plat.gc @@ -48,6 +48,7 @@ (citb-base-plat-active () _type_ :state) (citb-base-plat-method-24 (_type_) none))) + (defstate citb-base-plat-idle (citb-base-plat) :virtual #t :trans @@ -109,6 +110,7 @@ (deftype citb-plat-eco (plat-eco) ()) + (defmethod baseplat-method-24 ((this citb-plat-eco)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -143,6 +145,7 @@ (deftype citb-plat (plat) ((trans-offset vector :inline))) + (defstate plat-path-active (citb-plat) :virtual #t :trans @@ -206,6 +209,7 @@ (delay time-frame) (rise symbol))) + (defstate citb-base-plat-idle (citb-stair-plat) :virtual #t :event @@ -309,10 +313,11 @@ (:states citb-chain-plat-settle)) + (defmethod rigid-body-platform-method-22 ((this citb-chain-plat) (arg0 vector) (arg1 float)) (+ 12288.0 (* 2048.0 - (fmax 0.0 (fmin 1.0 (* 0.000024414063 (-> this float-height-offset)))) + (fmax 0.0 (fmin 1.0 (/ (-> this float-height-offset) (meters 10)))) (cos (* 109.22667 (+ (* 60.0 arg1) (* 0.03 (-> arg0 x)) (* 0.03 (-> arg0 z)))))) (-> this float-height-offset) (-> this orig-trans y))) @@ -457,6 +462,7 @@ (deftype citb-rotatebox (citb-base-plat) ()) + (defstate citb-base-plat-active (citb-rotatebox) :virtual #t :trans rider-trans @@ -506,6 +512,7 @@ (deftype citb-donut (citb-base-plat) ((sync sync-info :inline))) + (defstate citb-base-plat-active (citb-donut) :virtual #t :post @@ -551,6 +558,7 @@ (deftype citb-stopbox (plat) ()) + (defstate plat-path-active (citb-stopbox) :virtual #t :trans @@ -601,6 +609,7 @@ citb-firehose-blast citb-firehose-idle)) + (defskelgroup *citb-firehose-sg* citb-firehose citb-firehose-lod0-jg @@ -732,6 +741,7 @@ citb-exit-plat-idle citb-exit-plat-rise)) + (defstate citb-exit-plat-idle (citb-exit-plat) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) diff --git a/goal_src/jak1/levels/finalboss/light-eco.gc b/goal_src/jak1/levels/finalboss/light-eco.gc index 7542500e87d..1e3911fbb23 100644 --- a/goal_src/jak1/levels/finalboss/light-eco.gc +++ b/goal_src/jak1/levels/finalboss/light-eco.gc @@ -597,7 +597,7 @@ (ja-post) (let ((f0-4 0.0)) (countdown (v1-33 4) - (let ((a2-4 (the int (* 0.00048828125 f0-4)))) (logior! (-> self angle-mask) (ash 1 a2-4))) + (let ((a2-4 (the int (/ f0-4 (meters 0.5))))) (logior! (-> self angle-mask) (ash 1 a2-4))) (set! f0-4 (+ 16384.0 f0-4)))) (go light-eco-mother-appear) (none)) diff --git a/goal_src/jak1/levels/finalboss/robotboss-weapon.gc b/goal_src/jak1/levels/finalboss/robotboss-weapon.gc index c81b472aa86..35cacb3dab2 100644 --- a/goal_src/jak1/levels/finalboss/robotboss-weapon.gc +++ b/goal_src/jak1/levels/finalboss/robotboss-weapon.gc @@ -16,6 +16,7 @@ (torus-method-11 (_type_ vector) symbol) (torus-method-12 (_type_ vector) vector))) + (defmethod torus-method-10 ((this torus) (arg0 collide-prim-core) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) @@ -40,6 +41,7 @@ (deftype torus-verts (structure) ((vert vector 8 :inline))) + (defmethod torus-method-9 ((this torus) (arg0 vector)) (local-vars (sv-256 int) (sv-272 int) (sv-288 int)) (let ((s0-0 (new 'stack-no-clear 'vector)) @@ -112,6 +114,7 @@ (:states arcing-shot-debug-trajectory)) + (defbehavior arcing-shot-setup arcing-shot ((arg0 vector) (arg1 vector) (arg2 float)) (set! (-> self from quad) (-> arg0 quad)) (set! (-> self to quad) (-> arg1 quad)) @@ -127,7 +130,7 @@ (vector-lerp! arg0 (-> self from) (-> self to) s5-0) (set! (-> arg0 y) (-> self from y)) (+! (-> arg0 y) (* (-> self y-vel) s5-0)) - (set! (-> arg0 y) (+ (-> arg0 y) (* 0.5 s5-0 s5-0 (-> self grav)))))) + (set! (-> arg0 y) (+ (-> arg0 y) (* (/ s5-0 2) s5-0 (-> self grav)))))) (defbehavior arcing-shot-draw arcing-shot () (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -161,6 +164,7 @@ darkecobomb-idle darkecobomb-land)) + (defskelgroup *darkecobomb-sg* darkecobomb darkecobomb-lod0-jg @@ -341,6 +345,7 @@ (:states greenshot-idle)) + (defskelgroup *greenshot-sg* greenshot greenshot-lod0-jg @@ -404,10 +409,11 @@ redshot-idle redshot-wait)) -(defmethod relocate ((this redshot) (arg0 int)) - (if (nonzero? (-> this shot-particle)) (&+! (-> this shot-particle) arg0)) - (if (nonzero? (-> this test-particle)) (&+! (-> this test-particle) arg0)) - (the-as redshot ((method-of-type arcing-shot relocate) this arg0))) + +(defmethod relocate ((this redshot) (offset int)) + (if (nonzero? (-> this shot-particle)) (&+! (-> this shot-particle) offset)) + (if (nonzero? (-> this test-particle)) (&+! (-> this test-particle) offset)) + (the-as redshot ((method-of-type arcing-shot relocate) this offset))) (defmethod deactivate ((this redshot)) (if (nonzero? (-> this shot-particle)) (kill-and-free-particles (-> this shot-particle))) @@ -480,7 +486,7 @@ :code (behavior () (loop - (ja :num-func num-func-identity :frame-num (* 0.000016276043 (-> self ring radius-primary))) + (ja :num-func num-func-identity :frame-num (/ (-> self ring radius-primary) (meters 15))) (suspend))) :post transform-post) @@ -559,6 +565,7 @@ (:states yellowshot-idle)) + (defstate yellowshot-idle (yellowshot) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) diff --git a/goal_src/jak1/levels/flut_common/target-flut.gc b/goal_src/jak1/levels/flut_common/target-flut.gc index 0cf802b7bb4..69bcf10f2ac 100644 --- a/goal_src/jak1/levels/flut_common/target-flut.gc +++ b/goal_src/jak1/levels/flut_common/target-flut.gc @@ -483,7 +483,7 @@ ((ja-group? eichar-flut-walk-ja) (set! f28-0 (ja-frame-num 0)) (-> self skel root-channel 1 frame-interp)) (else (ja-channel-push! 2 (the-as time-frame gp-0)) f30-0)))) (ja-no-eval :group! eichar-flut-walk-ja :num! (loop!) :dist 49152.0 :frame-num f28-0) - (ja-no-eval :chan 1 :group! eichar-flut-run-ja :num! (identity (* 0.5 f28-0)) :frame-interp f30-0 :dist 40960.0) + (ja-no-eval :chan 1 :group! eichar-flut-run-ja :num! (identity (/ f28-0 2)) :frame-interp f30-0 :dist 40960.0) (loop (suspend) (let ((f0-13 (lerp-scale (the-as float 0.0) @@ -1162,21 +1162,21 @@ (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f30-0) (vector-float*! gp-3 gp-3 (/ f0-4 f1-3)))))) (suspend-for (seconds 1) - (target-flut-falling-anim-trans) - (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) - (let ((s5-2 (new-stack-vector0)) - (f30-1 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) - 0.0 - (vector-! s5-2 - (-> self control transv) - (vector-float*! s5-2 (-> self control dynam gravity-normal) (the-as float f30-1))) - (let* ((f0-10 (vector-length s5-2)) - (f1-4 f0-10)) - (if (< (the-as float (-> self control unknown-uint20)) (the-as float f30-1)) (set! f30-1 (-> self control unknown-uint20))) - (vector+! (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f30-1)) - (vector-float*! s5-2 s5-2 (/ f0-10 f1-4))))) - (target-flut-post-post)) + (target-flut-falling-anim-trans) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) + (let ((s5-2 (new-stack-vector0)) + (f30-1 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))) + 0.0 + (vector-! s5-2 + (-> self control transv) + (vector-float*! s5-2 (-> self control dynam gravity-normal) (the-as float f30-1))) + (let* ((f0-10 (vector-length s5-2)) + (f1-4 f0-10)) + (if (< (the-as float (-> self control unknown-uint20)) (the-as float f30-1)) (set! f30-1 (-> self control unknown-uint20))) + (vector+! (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) (the-as float f30-1)) + (vector-float*! s5-2 s5-2 (/ f0-10 f1-4))))) + (target-flut-post-post)) (camera-change-to (the-as string 'base) 0 #f)) (else (set! (-> self control unknown-surface00) *neutral-mods*) diff --git a/goal_src/jak1/levels/jungle/fisher.gc b/goal_src/jak1/levels/jungle/fisher.gc index e8120198e0a..8eda653f057 100644 --- a/goal_src/jak1/levels/jungle/fisher.gc +++ b/goal_src/jak1/levels/jungle/fisher.gc @@ -855,7 +855,7 @@ *entity-pool*) (sound-play "get-small-fish") (send-event (ppointer->process (-> self parent)) 'fisher-fish-caught 1))) - (set! (-> self vel) (* 0.25 (-> self vel))) + (set! (-> self vel) (/ (-> self vel) 4)) (while (< 0.1 (-> self root scale x)) (set! (-> self offset) (-> (the-as fisher (-> self parent 0)) paddle)) (fisher-fish-move) diff --git a/goal_src/jak1/levels/jungle/jungle-obs.gc b/goal_src/jak1/levels/jungle/jungle-obs.gc index 8da921a5823..574683d2a4f 100644 --- a/goal_src/jak1/levels/jungle/jungle-obs.gc +++ b/goal_src/jak1/levels/jungle/jungle-obs.gc @@ -30,6 +30,7 @@ (:state-methods idle)) + (defskelgroup *logtrap-sg* logtrap logtrap-lod0-jg @@ -87,6 +88,7 @@ (:states towertop-idle)) + (defskelgroup *towertop-sg* towertop towertop-lod0-jg @@ -120,6 +122,7 @@ (:states lurkerm-tall-sail-idle)) + (defskelgroup *lurkerm-tall-sail-sg* lurkerm-tall-sail lurkerm-tall-sail-lod0-jg @@ -139,11 +142,11 @@ :code (behavior () (loop - (ja-no-eval :group! lurkerm-tall-sail-idle-ja :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) + (ja-no-eval :group! lurkerm-tall-sail-idle-ja :num! (seek! max (/ (-> self speed) 2)) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* 12743.111 (seconds-per-frame) (-> self speed))) (suspend) - (ja :num! (seek! max (* 0.5 (-> self speed))))))) + (ja :num! (seek! max (/ (-> self speed) 2)))))) :post rider-post) (defmethod init-from-entity! ((this lurkerm-tall-sail) (arg0 entity-actor)) @@ -189,6 +192,7 @@ (:states lurkerm-short-sail-idle)) + (defskelgroup *lurkerm-short-sail-sg* lurkerm-short-sail 0 @@ -205,11 +209,11 @@ :code (behavior () (loop - (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (/ (-> self speed) 2)) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* -12743.111 (seconds-per-frame) (-> self speed))) (suspend) - (ja :num! (seek! max (* 0.5 (-> self speed))))))) + (ja :num! (seek! max (/ (-> self speed) 2)))))) :post rider-post) (defmethod init-from-entity! ((this lurkerm-short-sail) (arg0 entity-actor)) @@ -273,6 +277,7 @@ (:states lurkerm-piston-idle)) + (defskelgroup *lurkerm-piston-sg* lurkerm-piston lurkerm-piston-geo-jg @@ -350,6 +355,7 @@ (:states accordian-idle)) + (defskelgroup *accordian-sg* accordian accordian-lod0-jg @@ -394,8 +400,10 @@ (deftype junglecam (process-hidden) ()) + (deftype precurbridgecam (pov-camera) ()) + (defstate pov-camera-playing (precurbridgecam) :virtual #t :code @@ -415,6 +423,7 @@ (deftype precurbridge-span (structure) ()) + (deftype precurbridge (process-drawable) ((root collide-shape-moving :override) (smush smush-control :inline) @@ -426,6 +435,7 @@ (precurbridge-active symbol) precurbridge-idle)) + (defskelgroup *precurbridge-sg* precurbridge precurbridge-geo-jg @@ -694,6 +704,7 @@ (:states (maindoor-closed symbol) (maindoor-open symbol))) + (defskelgroup *maindoor-sg* maindoor maindoor-lod0-jg @@ -768,6 +779,7 @@ (deftype sidedoor (eco-door) ()) + (defskelgroup *sidedoor-sg* sidedoor sidedoor-geo-jg @@ -807,9 +819,10 @@ (:states jngpusher-idle)) -(defmethod relocate ((this jngpusher) (arg0 int)) - (if (nonzero? (-> this back-prim)) (&+! (-> this back-prim) arg0)) - (call-parent-method this arg0)) + +(defmethod relocate ((this jngpusher) (offset int)) + (if (nonzero? (-> this back-prim)) (&+! (-> this back-prim) offset)) + (call-parent-method this offset)) (defskelgroup *jngpusher-sg* jngpusher @@ -876,6 +889,7 @@ (deftype jungle-water (water-anim) ()) + (define ripple-for-jungle-water (new 'static 'ripple-wave-set diff --git a/goal_src/jak1/levels/lavatube/lavatube-energy.gc b/goal_src/jak1/levels/lavatube/lavatube-energy.gc index a6cb18fd6bf..1e6d9528d5f 100644 --- a/goal_src/jak1/levels/lavatube/lavatube-energy.gc +++ b/goal_src/jak1/levels/lavatube/lavatube-energy.gc @@ -513,7 +513,7 @@ (loop (ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) - (set! f30-0 (- f30-0 (* 0.002 (-> *display* time-adjust-ratio)))) + (set! f30-0 (- f30-0 (/ (-> *display* time-adjust-ratio) 500))) (if (< f30-0 0.0) (go energybase-stopped)) (suspend) (ja :num! (seek! max f30-0)))))) diff --git a/goal_src/jak1/levels/maincave/baby-spider.gc b/goal_src/jak1/levels/maincave/baby-spider.gc index ef91eee63c2..390a6befdf6 100644 --- a/goal_src/jak1/levels/maincave/baby-spider.gc +++ b/goal_src/jak1/levels/maincave/baby-spider.gc @@ -216,7 +216,7 @@ baby-spider-default-event-handler (f1-1 (+ 1.0 (* 2.0 f0-0))) (f2-2 f1-1) (f2-4 (/ 1.0 f2-2)) - (f0-2 (+ 1.0 (* 0.2 f0-0)))) + (f0-2 (+ 1.0 (/ f0-0 5)))) (set! (-> this delta-wiggle-angle) (* 910.2222 f1-1)) (set! (-> this wiggle-factor) (* 1.5 f2-4)) (set! (-> this target-speed) (* 28672.0 f0-2))) @@ -383,7 +383,10 @@ baby-spider-default-event-handler (ja-no-eval :num! (loop!)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600))) - (suspend-for gp-0 (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend))))))) + (suspend-for gp-0 + (ja :num-func num-func-identity :frame-num 0.0) + (ja-blend-eval) + (suspend))))))) (defstate nav-enemy-give-up (baby-spider) :virtual #t diff --git a/goal_src/jak1/levels/maincave/driller-lurker.gc b/goal_src/jak1/levels/maincave/driller-lurker.gc index eeb64c97fbf..5f8d1289d2c 100644 --- a/goal_src/jak1/levels/maincave/driller-lurker.gc +++ b/goal_src/jak1/levels/maincave/driller-lurker.gc @@ -254,7 +254,7 @@ (let* ((f0-5 (-> this path-u)) (f30-0 (* (-> this path-dir) f1-1 (seconds-per-frame))) (s4-0 #t) - (f0-6 (+ f0-5 (* 0.00024414062 (-> this path-units-per-meter) f30-0)))) + (f0-6 (+ f0-5 (* (/ (-> this path-units-per-meter) METER_LENGTH) f30-0)))) (cond ((< f0-6 0.0) (set! s4-0 #f) @@ -406,7 +406,7 @@ ((< f0-2 143360.0) (let ((f0-3 (driller-lurker-method-23 this)) (f1-5 (-> this path-u))) - (if (>= (* 0.1 (-> this path-units-per-meter)) (fabs (- f0-3 f1-5))) (return #t))))))))) + (if (>= (/ (-> this path-units-per-meter) 10) (fabs (- f0-3 f1-5))) (return #t))))))))) #f) (defmethod driller-lurker-method-27 ((this driller-lurker)) @@ -547,7 +547,7 @@ (s5-0 (method-of-object gp-0 path-control-method-20))) (target-pos 0) (let ((f0-1 (- (s5-0 gp-0) (-> self path-u)))) - (when (>= (fabs f0-1) (* 0.1 (-> self path-units-per-meter))) + (when (>= (fabs f0-1) (/ (-> self path-units-per-meter) 10)) (cond ((< 0.0 f0-1) (when (< (-> self path-dir) 0.0) (set! (-> self path-dir) 1.0) (set! (-> self path-speed) 0.0))) (else (when (>= (-> self path-dir) 0.0) (set! (-> self path-dir) -1.0) (set! (-> self path-speed) 0.0))))))) diff --git a/goal_src/jak1/levels/maincave/gnawer.gc b/goal_src/jak1/levels/maincave/gnawer.gc index dc02f8d4ee0..ca3ccb6d495 100644 --- a/goal_src/jak1/levels/maincave/gnawer.gc +++ b/goal_src/jak1/levels/maincave/gnawer.gc @@ -415,7 +415,7 @@ (set! (-> this route surface-dist) f0-25) (set! (-> this route total-dist) (+ 20480.0 f0-25)))) (set! (-> this route total-travel-time) - (the-as time-frame (the int (/ (-> this route total-dist) (* 0.016666668 (-> this speed)))))) + (the-as time-frame (the int (/ (-> this route total-dist) (/ (-> this speed) 60))))) (none)) (defmethod gnawer-method-22 ((this gnawer) (arg0 float)) @@ -459,7 +459,7 @@ (let ((f0-1 (+ 10240.0 (-> this route surface-dist)))) (cond ((< arg3 10240.0) - (let ((f0-3 (* 0.00009765625 arg3))) (vector-float*! (-> gp-0 world-pos) (-> this route src-pt-offset) f0-3)) + (let ((f0-3 (/ arg3 (meters 2.5)))) (vector-float*! (-> gp-0 world-pos) (-> this route src-pt-offset) f0-3)) (set! (-> gp-0 world-pos y) (-> this route src-pt-offset y)) (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> this post-trans))) ((< arg3 f0-1) diff --git a/goal_src/jak1/levels/maincave/mother-spider.gc b/goal_src/jak1/levels/maincave/mother-spider.gc index 4d991dbabd1..1f31dae686f 100644 --- a/goal_src/jak1/levels/maincave/mother-spider.gc +++ b/goal_src/jak1/levels/maincave/mother-spider.gc @@ -399,7 +399,7 @@ (let ((f0-1 (fmax 0.0 (- (-> this dist-from-anchor) (-> this idle-dist-from-anchor))))) (cond ((>= f0-1 20480.0) (vector-identity! (-> this root scale))) - (else (let ((f0-2 (* 0.000048828126 f0-1))) (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0))))) + (else (let ((f0-2 (/ f0-1 (meters 5)))) (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0))))) (if arg0 (shadow-handler this)) (let ((s4-1 (-> this leg-socket-part-mask))) (when (nonzero? s4-1) @@ -503,7 +503,7 @@ (vector+! v1-51 (-> this root trans) (-> this anchor-trans)) (vector-float*! v1-51 v1-51 0.5) (vector-! v1-51 v1-51 (-> this root trans)) - (set! (-> v1-51 w) (+ 28672.0 (* 0.5 (-> this dist-from-anchor))))) + (set! (-> v1-51 w) (+ 28672.0 (/ (-> this dist-from-anchor) 2)))) (cond ((!= (-> this spin-vel) 0.0) (let ((f0-44 (+ (-> this orient-rot y) (* (-> this spin-vel) (seconds-per-frame))))) diff --git a/goal_src/jak1/levels/misty/balloonlurker.gc b/goal_src/jak1/levels/misty/balloonlurker.gc index 87121848c3b..acfa3c5a242 100644 --- a/goal_src/jak1/levels/misty/balloonlurker.gc +++ b/goal_src/jak1/levels/misty/balloonlurker.gc @@ -399,8 +399,7 @@ (-> this info max-buoyancy-depth)))) (vector-float*! s5-0 *y-vector* - (* 0.25 - (-> this buoyancy-factor) + (* (/ (-> this buoyancy-factor) 4) (-> this info gravity-factor) (fmax 0.3 (fmin 1.0 f0-6)) (-> this info gravity) @@ -498,7 +497,7 @@ (seek! (-> self throttle-control) 0.0 (* 0.25 (seconds-per-frame)))))) (seek! (-> self engine-thrust) (* (-> self throttle-control) (-> *BALLOONLURKER-bank* max-engine-thrust)) - (* 0.005 (-> *BALLOONLURKER-bank* max-engine-thrust))) + (/ (-> *BALLOONLURKER-bank* max-engine-thrust) 200)) (let ((f0-31 60.0) (f1-14 1820.4445) (f2-6 6735.6445) diff --git a/goal_src/jak1/levels/misty/misty-obs.gc b/goal_src/jak1/levels/misty/misty-obs.gc index ccbadbdbdab..8198e836a25 100644 --- a/goal_src/jak1/levels/misty/misty-obs.gc +++ b/goal_src/jak1/levels/misty/misty-obs.gc @@ -1066,7 +1066,7 @@ (let ((f0-3 (vector-dot gp-0 v1-4)) (f1-1 (vector-dot a0-4 v1-4))) (cond - ((and (< 0.0 f1-1) (< (fabs (* 0.5 f0-3)) f1-1)) + ((and (< 0.0 f1-1) (< (fabs (/ f0-3 2)) f1-1)) (if (send-event *target* 'query 'powerup (pickup-type eco-red)) (go mis-bone-bridge-fall #f) (go mis-bone-bridge-hit))) (else (go mis-bone-bridge-bump) #f)))))))) diff --git a/goal_src/jak1/levels/misty/mistycannon.gc b/goal_src/jak1/levels/misty/mistycannon.gc index cd0c187d498..1df4c95b339 100644 --- a/goal_src/jak1/levels/misty/mistycannon.gc +++ b/goal_src/jak1/levels/misty/mistycannon.gc @@ -29,7 +29,7 @@ (set! (-> arg0 min) arg1) (set! (-> arg0 range) (the float (sar (shl (the int (- arg2 arg1)) 48) 48))) (if (< (-> arg0 range) 0.0) (+! (-> arg0 range) 65536.0)) - (set! (-> arg0 value) (* 0.5 (-> arg0 range))) + (set! (-> arg0 value) (/ (-> arg0 range) 2)) (set! (-> arg0 speed) arg3) 0 (none)) @@ -658,9 +658,9 @@ (vector-float*! (-> self root transv) (-> self root transv) 0.5) (update-transforms! (-> self root)) (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (-> self root root-prim collide-with)) - (seek! (-> self root scale x) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - (seek! (-> self root scale y) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - (seek! (-> self root scale z) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) + (seek! (-> self root scale x) 0.0 (/ (-> *display* time-adjust-ratio) 100)) + (seek! (-> self root scale y) 0.0 (/ (-> *display* time-adjust-ratio) 100)) + (seek! (-> self root scale z) 0.0 (/ (-> *display* time-adjust-ratio) 100)) (when (< 0.05 (-> self root scale x)) (suspend) (goto cfg-3)) @@ -969,7 +969,7 @@ (defun solve-missile-tilt ((arg0 quadratic-solution) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) - (let* ((f1-3 (* 0.5 arg2 arg2 arg4)) + (let* ((f1-3 (* (/ arg2 2) arg2 arg4)) (f0-3 f1-3) (f30-0 (- (* arg2 arg1 arg1))) (f2-6 (+ f1-3 (* arg1 arg1 arg3))) diff --git a/goal_src/jak1/levels/misty/muse.gc b/goal_src/jak1/levels/misty/muse.gc index 71920c96d4f..52aca340581 100644 --- a/goal_src/jak1/levels/misty/muse.gc +++ b/goal_src/jak1/levels/misty/muse.gc @@ -21,6 +21,7 @@ muse-caught muse-idle)) + (deftype point-on-path-segment-info (structure) ((point vector :inline) (segment vector 2 :inline) @@ -30,6 +31,7 @@ (distance-to-segment float) (parametric-index float))) + (defun analyze-point-on-path-segment ((arg0 point-on-path-segment-info)) (vector-! (-> arg0 dir) (-> arg0 segment 1) (the-as vector (-> arg0 segment))) (vector-normalize! (-> arg0 dir) 1.0) @@ -81,8 +83,8 @@ (set! f30-0 (+ f22-0 (-> gp-0 parametric-index))))) 0)) (let ((f0-6 (- f30-0 f28-0))) - (if (< f0-6 (* -0.5 (-> self max-path-index))) (+! f0-6 (-> self max-path-index))) - (if (< (* 0.5 (-> self max-path-index)) f0-6) (set! f0-6 (- f0-6 (-> self max-path-index)))) + (if (< f0-6 (/ (-> self max-path-index) -2)) (+! f0-6 (-> self max-path-index))) + (if (< (/ (-> self max-path-index) 2) f0-6) (set! f0-6 (- f0-6 (-> self max-path-index)))) (cond ((>= f0-6 0.0) (set! (-> self dest-path-index) (the float (the int (+ 2.5 f30-0)))) @@ -186,7 +188,7 @@ nav-enemy-default-event-handler (ja :group! muse-run-ja :num! min) (loop (suspend) - (ja :num! (loop! (* 0.000016276043 (-> self momentum-speed)))))) + (ja :num! (loop! (/ (-> self momentum-speed) (meters 15)))))) :post (behavior () (set! (-> self nav destination-pos quad) (-> self dest-point quad)) diff --git a/goal_src/jak1/levels/misty/quicksandlurker.gc b/goal_src/jak1/levels/misty/quicksandlurker.gc index 2bf5d4f7a78..ff6b8ee1f87 100644 --- a/goal_src/jak1/levels/misty/quicksandlurker.gc +++ b/goal_src/jak1/levels/misty/quicksandlurker.gc @@ -557,7 +557,7 @@ (set! (-> gp-0 quad) (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node quicksandlurker-lod0-jg jawEND)) quad)) (vector-! s5-0 (target-pos 5) gp-0) - (let ((f1-0 (vector-xz-length s5-0))) (set! (-> s5-0 y) (fmin (-> s5-0 y) (* 0.5 f1-0)))) + (let ((f1-0 (vector-xz-length s5-0))) (set! (-> s5-0 y) (fmin (-> s5-0 y) (/ f1-0 2)))) (vector-normalize! s5-0 49152.0) (spawn-quicksandlurker-missile self gp-0 s5-0 (-> self entity))) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 199) -1 #f #f #f gp-0 :to *entity-pool*))) diff --git a/goal_src/jak1/levels/ogre/flying-lurker.gc b/goal_src/jak1/levels/ogre/flying-lurker.gc index f6185b20347..80c9bd59867 100644 --- a/goal_src/jak1/levels/ogre/flying-lurker.gc +++ b/goal_src/jak1/levels/ogre/flying-lurker.gc @@ -346,7 +346,7 @@ 0.0 (let* ((f1-6 (* -81920.0 (the float (-> self rank)))) (f0-10 (+ (if (< f26-0 f0-6) (fmax (+ -81920.0 f1-6) (- f26-0 f0-6)) (fmin (+ 245760.0 f1-6) (- f26-0 f0-6))) f28-0)) - (f1-10 (* 0.000012207031 f0-10)) + (f1-10 (/ f0-10 (meters 20))) (f0-12 (fmax -0.5 (fmin 0.5 f1-10)))) (set! (-> self speed) (+ (* (+ 0.5 f0-12) (- arg2 arg3)) arg3)))) ;; og:preserve-this PAL patch here diff --git a/goal_src/jak1/levels/ogre/ogreboss.gc b/goal_src/jak1/levels/ogre/ogreboss.gc index 142c6928ab0..0fc602ca45b 100644 --- a/goal_src/jak1/levels/ogre/ogreboss.gc +++ b/goal_src/jak1/levels/ogre/ogreboss.gc @@ -886,7 +886,7 @@ ;; og:preserve-this (set! (-> gp-0 src) (-> self node-list data (#if *jak1-full-game* 50 52) bone transform vector 3)) (set! (-> gp-0 duration) - (the-as time-frame (the int (* 300.0 (+ 1.25 (* -0.25 (-> self level)) (/ 0.5 (-> self difficulty))))))) + (the-as time-frame (the int (* 300.0 (+ 1.25 (/ (-> self level) -4) (/ 0.5 (-> self difficulty))))))) (set! (-> gp-0 pickup-type) arg0) (set! (-> gp-0 blast-radius) 32768.0) (cond @@ -1057,7 +1057,7 @@ (set! f28-0 (cond ((< (-> self try-count) (the-as uint 5)) (* 0.0 f28-0)) - ((< (-> self try-count) (the-as uint 10)) (* 0.5 f28-0)) + ((< (-> self try-count) (the-as uint 10)) (/ f28-0 2)) (else (empty) f28-0))) (if (and *target* (< (rand-vu) f28-0)) (set! boulder-pickup (pickup-type eco-green)))) (ogreboss-shoot-boulder (the-as pickup-type boulder-pickup))) @@ -1099,7 +1099,7 @@ (when (and (> (-> self hit-count) 0) (>= 45.0 f30-0)) (set! f0-0 (+ (ja-aframe (the-as float 0.0) 1) - (* 0.022222223 f30-0 (- (ja-aframe (the-as float 8.0) 1) (ja-aframe (the-as float 0.0) 1))))) + (* (/ f30-0 45) (- (ja-aframe (the-as float 8.0) 1) (ja-aframe (the-as float 0.0) 1))))) (set! f1-0 (cond ((< f30-0 7.5) (* 0.120000005 f30-0)) @@ -1210,7 +1210,7 @@ :code (behavior () (set! (-> self shuffle-pos) 0.0) - (let ((f30-0 (+ 1.0 (* 0.25 (-> self difficulty) (-> self level)))) + (let ((f30-0 (+ 1.0 (* (/ (-> self difficulty) 4) (-> self level)))) (gp-0 (if (rand-vu-percent? (the-as float 0.5)) 0 1))) (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! ogreboss-shuffle-prepare-ja :num! (seek! max f30-0) :frame-num 0.0) diff --git a/goal_src/jak1/levels/racer_common/racer-states.gc b/goal_src/jak1/levels/racer_common/racer-states.gc index da70f948d9e..90dc3594b1d 100644 --- a/goal_src/jak1/levels/racer_common/racer-states.gc +++ b/goal_src/jak1/levels/racer_common/racer-states.gc @@ -642,7 +642,7 @@ (let ((s5-0 (-> self parent-override)) (gp-0 (new 'stack 'joint-exploder-tuning 1))) (let* ((f0-0 (vector-length (-> s5-0 0 control transv))) - (f30-0 (fmin 1.0 (* 0.000008138021 f0-0)))) + (f30-0 (fmin 1.0 (/ f0-0 (meters 30))))) (set! (-> gp-0 duration) (seconds 5)) (set! (-> gp-0 fountain-rand-transv-hi x) (fmax 24576.0 f0-0)) (set! (-> gp-0 fountain-rand-transv-hi y) (+ 81920.0 f0-0)) @@ -698,7 +698,7 @@ (set! (-> self racer stick-lock) #t) (send-event *camera* 'joystick 0.0 1.0) (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (seconds-per-frame))) - (if (>= (ja-aframe-num 0) 245.0) (set-forward-vel (* 0.5 (-> self control unknown-float01)))) + (if (>= (ja-aframe-num 0) 245.0) (set-forward-vel (/ (-> self control unknown-float01) 2))) (suspend) (ja :num! (seek!)))))) (('melt) @@ -735,18 +735,18 @@ (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-2) (vector-float*! gp-8 gp-8 (/ f0-29 f1-9))))) (suspend-for (seconds 0.75) - (vector-seek! (-> self draw color-mult) *zero-vector* (* 1.5 (seconds-per-frame))) - (set-forward-vel (* 0.96 (-> self control unknown-float01))) - (let ((s5-3 (new-stack-vector0)) - (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - 0.0 - (vector-! s5-3 (-> self control transv) (vector-float*! s5-3 (-> self control dynam gravity-normal) f28-0)) - (let* ((f0-38 (vector-length s5-3)) - (f1-12 f0-38)) - (if (< f30-0 f28-0) (set! f28-0 f30-0)) - (vector+! (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f28-0) - (vector-float*! s5-3 s5-3 (/ f0-38 f1-12))))))) + (vector-seek! (-> self draw color-mult) *zero-vector* (* 1.5 (seconds-per-frame))) + (set-forward-vel (* 0.96 (-> self control unknown-float01))) + (let ((s5-3 (new-stack-vector0)) + (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! s5-3 (-> self control transv) (vector-float*! s5-3 (-> self control dynam gravity-normal) f28-0)) + (let* ((f0-38 (vector-length s5-3)) + (f1-12 f0-38)) + (if (< f30-0 f28-0) (set! f28-0 f30-0)) + (vector+! (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f28-0) + (vector-float*! s5-3 s5-3 (/ f0-38 f1-12))))))) (camera-change-to (the-as string 'base) 0 #f))) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self control unknown-float01) 0.0) @@ -870,12 +870,12 @@ (ja :chan 2 :group! eichar-racer-dig-ja :num! (chan 0)) (ja :chan 3 :group! eichar-racer-dig2-ja :num! (chan 0))) (suspend-for (seconds 0.5) - (set! (-> self racer stick-lock) #t) - (set-forward-vel (* 0.9 (-> self control unknown-float01))) - (set! (-> self racer turn-anim-targ) 0.0) - (set! (-> self racer turn-anim-targ) 0.0) - (target-racing-turn-anim) - (seek! (-> self control unknown-vector11 y) 6144.0 (* 3.0 (seconds-per-frame)))) + (set! (-> self racer stick-lock) #t) + (set-forward-vel (* 0.9 (-> self control unknown-float01))) + (set! (-> self racer turn-anim-targ) 0.0) + (set! (-> self racer turn-anim-targ) 0.0) + (target-racing-turn-anim) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 3.0 (seconds-per-frame)))) (go target-racing-get-off-jump arg0)) :post target-racing-post) diff --git a/goal_src/jak1/levels/racer_common/target-racer.gc b/goal_src/jak1/levels/racer_common/target-racer.gc index 463777dca47..77f88da7786 100644 --- a/goal_src/jak1/levels/racer_common/target-racer.gc +++ b/goal_src/jak1/levels/racer_common/target-racer.gc @@ -133,8 +133,8 @@ (let ((f30-1 (if (or (< (* arg1 arg0) 0.0) (not (racer-on-ground?))) 1.0 (+ 1.0 (* (fabs arg1) (lerp-scale 0.0 3.0 (-> self control unknown-float01) 0.0 (-> self racer transv-max)))))) - (f28-1 (lerp-scale 32768.0 20024.889 (-> self control unknown-float01) 0.0 (* 0.5 (-> self racer transv-max)))) - (f0-18 (lerp-scale 91022.22 236657.78 (-> self control unknown-float01) 0.0 (* 0.125 (-> self racer transv-max))))) + (f28-1 (lerp-scale 32768.0 20024.889 (-> self control unknown-float01) 0.0 (/ (-> self racer transv-max) 2))) + (f0-18 (lerp-scale 91022.22 236657.78 (-> self control unknown-float01) 0.0 (/ (-> self racer transv-max) 8)))) (seek! (-> self racer rotv y) (* arg0 f30-1 (- f28-1)) (* f0-18 (seconds-per-frame)))) (set! (-> self racer rotv y) (* (-> self racer rotv y) (lerp-scale 0.99 0.9 (-> self control unknown-float01) 0.0 (-> self racer transv-max)))) @@ -192,7 +192,7 @@ (when (< 0.0 f0-0) (let ((f1-4 (* f0-0 (+ (-> self control unknown-surface01 target-speed) (-> self racer boost-output) (-> self racer hill-boost))))) (+! (-> self control unknown-vector00 z) (* f1-4 (seconds-per-frame))))) - (seek! (-> self racer front-rotv) (+ 65536.0 (* 364088.88 (+ f0-0 (* 0.1 arg1)))) (* 364088.88 (seconds-per-frame)))) + (seek! (-> self racer front-rotv) (+ 65536.0 (* 364088.88 (+ f0-0 (/ arg1 10)))) (* 364088.88 (seconds-per-frame)))) (set! (-> self racer front-rot) (the float (sar (shl (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (seconds-per-frame)))) 48) 48))) (let* ((f1-12 (-> self control unknown-surface01 fric)) @@ -438,7 +438,7 @@ (set! (-> *part-id-table* 2275 init-specs 4 initial-valuef) (+ 24576.0 f1-3)) (set! (-> *part-id-table* 2275 init-specs 19 initial-valuef) (+ 49152.0 f1-3)) (set! (-> *part-id-table* 2275 init-specs 1 initial-valuef) (* 0.0000036621095 f0-17)) - (set! (-> *part-id-table* 2275 init-specs 2 initial-valuef) (* 0.1 f0-17)) + (set! (-> *part-id-table* 2275 init-specs 2 initial-valuef) (/ f0-17 10)) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2275) s4-2) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2276) s4-2))) (-> *part-id-table* 2208)) @@ -508,8 +508,8 @@ (set! f26-0 (-> *RACER-bank* lavatube-surface-heat-inc)) (set! f30-2 (-> *RACER-bank* lavatube-jump-heat-inc)))) (let* ((f20-0 (get-health-percent-lost *game-info* #f)) - (f22-1 (lerp-scale f22-0 (* 0.5 f22-0) f20-0 0.0 1.0)) - (f24-1 (lerp-scale f24-0 (* 0.33333334 f24-0) f20-0 0.0 1.0))) + (f22-1 (lerp-scale f22-0 (/ f22-0 2) f20-0 0.0 1.0)) + (f24-1 (lerp-scale f24-0 (/ f24-0 3) f20-0 0.0 1.0))) (case (-> self control poly-pat material) (((pat-material hotcoals)) (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f22-1 (seconds-per-frame)))) (((pat-material lava)) @@ -659,7 +659,7 @@ (set-twist! (-> self racer tail) (the-as float #f) (the-as float #f) (* -273.06668 (-> self racer tail-anim-frame))) (let ((f30-2 (fmin 1.0 (* 2.0 (fabs (-> self racer slide-shift-x)))))) (ja :num-func num-func-identity :frame-num (ja-aframe (-> self racer turn-anim-frame) 0)) - (ja :chan 1 :num! (chan 0) :frame-interp (+ 0.5 (* 0.025 (-> self racer tail-anim-frame)))) + (ja :chan 1 :num! (chan 0) :frame-interp (+ 0.5 (/ (-> self racer tail-anim-frame) 40))) (let ((gp-2 (-> self skel root-channel 2))) ;; og:preserve-this changed for high fps (let ((f0-82 (lerp (-> self racer slide-interp) f30-2 (* DISPLAY_FPS_RATIO 0.125)))) @@ -671,7 +671,7 @@ :num! (chan 0) :frame-interp - (* (-> self racer slide-interp) (+ 0.5 (* 0.025 (-> self racer tail-anim-frame))))) + (* (-> self racer slide-interp) (+ 0.5 (/ (-> self racer tail-anim-frame) 40)))) 0 (none)) @@ -687,7 +687,7 @@ (set! s4-0 s5-0))) (suspend) (let ((f0-4 (lerp-scale 2.0 1.0 (ja-aframe-num 0) 0.0 22.0))) - (if (= (-> self next-state name) 'target-racing-falling) (set! f0-4 (* 0.5 f0-4))) + (if (= (-> self next-state name) 'target-racing-falling) (set! f0-4 (/ f0-4 2))) (ja :num! (seek! max f0-4))) (set! f30-0 (ja-aframe-num 0)) (ja-blend-eval))) @@ -803,8 +803,8 @@ (let ((f1-16 (+ (-> self racer bob-timer) (* (-> self racer bob-meta-timer) (-> *display* time-adjust-ratio)))) (f2-12 (-> self racer bob-period))) (set! (-> self racer bob-timer) (- f1-16 (* (the float (the int (/ f1-16 f2-12))) f2-12)))) - (when (!= (the int (/ f0-52 (* 0.5 (-> self racer bob-period)))) - (the int (/ (-> self racer bob-timer) (* 0.5 (-> self racer bob-period))))) + (when (!= (the int (/ f0-52 (/ (-> self racer bob-period) 2))) + (the int (/ (-> self racer bob-timer) (/ (-> self racer bob-period) 2)))) (seek! (-> self racer bob-mult-trans) 1.0 0.75) (if (< 1.5 (-> self racer bob-meta-meta-timer)) (seek! (-> self racer bob-meta-meta-timer) 1.0 0.5)) (when (time-elapsed? (-> self racer bob-meta-time) (seconds 2.2)) @@ -825,7 +825,7 @@ ((= v1-128 2) (* -0.035555556 f0-77)) ((= v1-128 3) (* -0.017777778 f0-77)) (else (* -0.13333334 f0-77))))) - (if (-> self racer hop?) (set! f1-36 (* 0.5 f1-36))) + (if (-> self racer hop?) (set! f1-36 (/ f1-36 2))) (if (= (-> self control unknown-surface00 mode) 'air) (set! (-> self racer targ-rotx) (fmax -2730.6667 (fmin 5461.3335 f1-36))))) (cond diff --git a/goal_src/jak1/levels/rolling/rolling-obs.gc b/goal_src/jak1/levels/rolling/rolling-obs.gc index c47920d7076..0f603e7c2fb 100644 --- a/goal_src/jak1/levels/rolling/rolling-obs.gc +++ b/goal_src/jak1/levels/rolling/rolling-obs.gc @@ -478,9 +478,9 @@ (defun seconds->race-time ((arg0 race-time) (arg1 time-frame)) (let* ((v1-1 (max 0 (min #x2bf1d arg1))) (f0-1 (* 0.0033333334 (the float v1-1)))) - (set! (-> arg0 digit 0) (the int (* 0.016666668 f0-1))) + (set! (-> arg0 digit 0) (the int (/ f0-1 60))) (let ((f0-2 (- f0-1 (* 60.0 (the float (-> arg0 digit 0)))))) - (set! (-> arg0 digit 1) (the int (* 0.1 f0-2))) + (set! (-> arg0 digit 1) (the int (/ f0-2 10))) (let ((f0-3 (- f0-2 (* 10.0 (the float (-> arg0 digit 1)))))) (set! (-> arg0 digit 2) (the int f0-3)) (let ((f0-4 (- f0-3 (the float (-> arg0 digit 2))))) diff --git a/goal_src/jak1/levels/rolling/rolling-robber.gc b/goal_src/jak1/levels/rolling/rolling-robber.gc index d63a67af06d..bac5e00810c 100644 --- a/goal_src/jak1/levels/rolling/rolling-robber.gc +++ b/goal_src/jak1/levels/rolling/rolling-robber.gc @@ -181,7 +181,7 @@ (let* ((f2-1 (/ (- (vector-length gp-1) arg0) (- arg1 arg0))) (f0-4 (- 1.0 (fmax 0.0 (fmin 1.0 f2-1)))) (f0-5 (lerp arg3 arg2 f0-4)) - (f30-0 (* 0.0033333334 f0-5))) + (f30-0 (/ f0-5 300))) (cond ((or (not arg4) (< arg0 (vector-length gp-1))) (if (< (-> self speed) 0.0) (set! f30-0 (- f30-0)))) ((< (vector-dot gp-1 (-> self tangent)) 0.0) (set! f30-0 (- f30-0)))) diff --git a/goal_src/jak1/levels/snow/ice-cube.gc b/goal_src/jak1/levels/snow/ice-cube.gc index 231d6d5d772..a6adafb98e7 100644 --- a/goal_src/jak1/levels/snow/ice-cube.gc +++ b/goal_src/jak1/levels/snow/ice-cube.gc @@ -947,7 +947,7 @@ (if (< f30-1 13107.2) (go ice-cube-mean-charge-done)) (set! (-> self collide-info transv quad) (-> self nav travel quad)) (if (< (-> self speed) f30-1) (set! f30-1 (-> self speed))) - (set! (-> self anim-blend) (fmin 1.0 (* 0.000016276043 f30-1))) + (set! (-> self anim-blend) (fmin 1.0 (/ f30-1 (meters 15)))) (vector-normalize! (-> self collide-info transv) f30-1)) (+! (-> self collide-info transv y) -36864.0) (quaternion-rotate-y-to-vector! (-> self collide-info quat) diff --git a/goal_src/jak1/levels/snow/snow-ball.gc b/goal_src/jak1/levels/snow/snow-ball.gc index cacfc63e04d..9deec808c34 100644 --- a/goal_src/jak1/levels/snow/snow-ball.gc +++ b/goal_src/jak1/levels/snow/snow-ball.gc @@ -11,14 +11,17 @@ (:states snow-ball-shadow-idle)) + (deftype snow-ball-junction (structure) ((enter-time time-frame) (exit-time time-frame))) + (deftype snow-ball-path-info (structure) ((hug-path? symbol) (path-pos vector :inline))) + (deftype snow-ball-roller (process-drawable) ((root collide-shape-moving :override) (which-path int32) @@ -42,6 +45,7 @@ (:states snow-ball-roller-idle)) + (deftype snow-ball (process) ((child-override (pointer snow-ball-roller) :overlay-at child) (state-time time-frame) @@ -55,6 +59,7 @@ (:states snow-ball-idle)) + (defskelgroup *snow-ball-sg* snow-ball snow-ball-lod0-jg @@ -189,7 +194,7 @@ (cond ((>= f0-23 245760.0) (deactivate self)) (else - (let ((f0-25 (- 1.0 (* 0.0000040690106 f0-23)))) + (let ((f0-25 (- 1.0 (/ f0-23 (meters 60))))) (set! (-> self root scale x) f0-25) (set! (-> self root scale y) f0-25) (set! (-> self root scale z) f0-25)))))) @@ -367,10 +372,10 @@ (suspend) (b! #t cfg-1 :delay (nop!)))) -(defmethod relocate ((this snow-ball) (arg0 int)) +(defmethod relocate ((this snow-ball) (offset int)) (dotimes (v1-0 2) - (if (nonzero? (-> this path v1-0)) (&+! (-> this path v1-0) arg0))) - (call-parent-method this arg0)) + (if (nonzero? (-> this path v1-0)) (&+! (-> this path v1-0) offset))) + (call-parent-method this offset)) (defmethod init-from-entity! ((this snow-ball) (arg0 entity-actor)) (set! (-> this last-path-picked) 1) diff --git a/goal_src/jak1/levels/snow/snow-bunny.gc b/goal_src/jak1/levels/snow/snow-bunny.gc index dd8650ebfb2..b51024dc700 100644 --- a/goal_src/jak1/levels/snow/snow-bunny.gc +++ b/goal_src/jak1/levels/snow/snow-bunny.gc @@ -319,7 +319,9 @@ :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1))))) (loop - (let ((s5-1 (current-time))) (until (time-elapsed? s5-1 (seconds 2.52)) (suspend) (ja :num! (loop!)))) + (suspend-for (seconds 2.52) + (suspend) + (ja :num! (loop!))) (cond ((zero? gp-2) (if (nav-enemy-method-53 self) (go-virtual snow-bunny-patrol-hop))) (else (+! gp-2 -1))))))) @@ -355,7 +357,7 @@ (when (>= f30-0 6144.0) (when (nav-enemy-method-51 this s5-0 s5-0) (set! (-> this final-dest quad) (-> s5-0 quad)) - (set! (-> this halfway-dist) (* 0.5 f30-0)) + (set! (-> this halfway-dist) (/ f30-0 2)) (set! (-> this base-hop-dist) (rand-vu-float-range 6144.0 22118.4)) (return #t)))) (set! s2-0 (mod (+ s2-0 1) s4-0)))) @@ -585,6 +587,7 @@ (best-dest vector :inline) (away-vec vector :inline))) + (defmethod nav-enemy-method-55 ((this snow-bunny)) (set! (-> this using-jump-event?) #f) (if (not *target*) (return #f)) @@ -615,7 +618,7 @@ (vector+! (-> this final-dest) s4-1 s1-1)))) (let* ((s1-3 (vector-! (new 'stack-no-clear 'vector) (-> this final-dest) (-> this collide-info trans))) (f0-12 (vector-length s1-3))) - (let ((f1-4 (* 0.000011625744 f0-12))) + (let ((f1-4 (/ f0-12 (meters 21)))) (cond ((< 1.0 f1-4) (set! f1-4 1.0)) ((< f1-4 0.4) (set! f1-4 0.4))) diff --git a/goal_src/jak1/levels/sunken/helix-water.gc b/goal_src/jak1/levels/sunken/helix-water.gc index d780c78ed60..18fd4373d66 100644 --- a/goal_src/jak1/levels/sunken/helix-water.gc +++ b/goal_src/jak1/levels/sunken/helix-water.gc @@ -26,6 +26,7 @@ helix-slide-door-idle-closed helix-slide-door-idle-open)) + (defskelgroup *helix-slide-door-sg* helix-slide-door helix-slide-door-lod0-jg @@ -47,6 +48,7 @@ helix-button-quick-activate helix-button-startup)) + (defskelgroup *helix-button-sg* helix-button helix-button-lod0-jg @@ -56,6 +58,7 @@ (deftype helix-dark-eco (dark-eco-pool) ()) + (deftype helix-water (process-drawable) ((last-alt-actor-consumed int32) (alt-actors (array entity-actor)) @@ -70,6 +73,7 @@ helix-water-activated helix-water-idle)) + (defstate water-vol-idle (helix-dark-eco) :virtual #t :event @@ -407,7 +411,7 @@ (when (not (logtest? (-> *target* state-flags) (state-flags grabbed))) (let* ((f0-5 (- f0-4 (-> self root trans y))) (f0-6 (+ -40960.0 f0-5)) - (f0-7 (* 0.000024414063 f0-6))) + (f0-7 (/ f0-6 (meters 10)))) (cond ((< f0-7 0.0) (set! f0-7 0.0)) ((< 1.0 f0-7) (set! f0-7 1.0))) @@ -424,9 +428,9 @@ (suspend))) :post ja-post) -(defmethod relocate ((this helix-water) (arg0 int)) - (if (nonzero? (-> this alt-actors)) (&+! (-> this alt-actors) arg0)) - (call-parent-method this arg0)) +(defmethod relocate ((this helix-water) (offset int)) + (if (nonzero? (-> this alt-actors)) (&+! (-> this alt-actors) offset)) + (call-parent-method this offset)) (defmethod init-from-entity! ((this helix-water) (arg0 entity-actor)) (set! (-> this last-alt-actor-consumed) -1) diff --git a/goal_src/jak1/levels/sunken/puffer.gc b/goal_src/jak1/levels/sunken/puffer.gc index c82d60e8fa2..a888caa3279 100644 --- a/goal_src/jak1/levels/sunken/puffer.gc +++ b/goal_src/jak1/levels/sunken/puffer.gc @@ -58,6 +58,7 @@ puffer-idle puffer-patrol)) + (defskelgroup *puffer-sg* puffer puffer-main-lod0-jg @@ -170,6 +171,7 @@ (buddy-dir vector :inline) (dest vector :inline))) + (defmethod puffer-method-23 ((this puffer) (arg0 symbol)) (local-vars (v1-0 process)) (set! v1-0 @@ -264,13 +266,13 @@ (let ((f30-1 (-> this attack-bottom-y))) (set! (-> this targ-trans-y) (fmax (fmin (+ 4096.0 (-> (target-pos 0) y)) (-> this top-y)) f30-1))) (set! (-> this root transv y) - (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root trans y)))) + (* (/ (-> *display* frames-per-second) 8) (- (-> this targ-trans-y) (-> this root trans y)))) (when (< 6144.0 (fabs (-> this root transv y))) (if (>= (-> this root transv y) 0.0) (set! (-> this root transv y) 6144.0) (set! (-> this root transv y) -6144.0)))) ((< (-> this root trans y) f30-0) (set! (-> this targ-trans-y) (* 0.5 (+ (-> this top-y) (-> this patrol-bottom-y)))) (set! (-> this root transv y) - (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root trans y)))) + (* (/ (-> *display* frames-per-second) 8) (- (-> this targ-trans-y) (-> this root trans y)))) (when (< 2048.0 (fabs (-> this root transv y))) (if (>= (-> this root transv y) 0.0) (set! (-> this root transv y) 2048.0) (set! (-> this root transv y) -2048.0)))) (else @@ -649,9 +651,9 @@ (else (puffer-method-30 this))) (none)) -(defmethod relocate ((this puffer) (arg0 int)) - (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0)) - (call-parent-method this arg0)) +(defmethod relocate ((this puffer) (offset int)) + (if (nonzero? (-> this neck)) (&+! (-> this neck) offset)) + (call-parent-method this offset)) (defmethod init-from-entity! ((this puffer) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) diff --git a/goal_src/jak1/levels/sunken/steam-cap.gc b/goal_src/jak1/levels/sunken/steam-cap.gc index e485ae16065..6ca03a44a0a 100644 --- a/goal_src/jak1/levels/sunken/steam-cap.gc +++ b/goal_src/jak1/levels/sunken/steam-cap.gc @@ -507,7 +507,7 @@ (let ((f0-31 0.0)) (dotimes (v1-71 3) (+! f0-31 (-> this control-pt v1-71 trans y))) - (let ((f0-32 (* 0.33333334 f0-31)) + (let ((f0-32 (/ f0-31 3)) (a1-16 (new 'stack-no-clear 'vector))) (set! (-> a1-16 quad) (-> this root trans quad)) (set! (-> a1-16 y) f0-32) diff --git a/goal_src/jak1/levels/sunken/target-tube.gc b/goal_src/jak1/levels/sunken/target-tube.gc index 888a5ce5311..1e7be6c7cab 100644 --- a/goal_src/jak1/levels/sunken/target-tube.gc +++ b/goal_src/jak1/levels/sunken/target-tube.gc @@ -133,8 +133,10 @@ (tube-sound-id sound-id) (tube-sound-vol float))) + (deftype tube-bank (basic) ()) + (define *TUBE-bank* (new 'static 'tube-bank)) (defbehavior tube-sounds target () @@ -534,7 +536,7 @@ (vector-! s3-2 (-> arg1 vector) (vector-float*! s3-2 (-> self control unknown-vector71) f30-0)) (let* ((f0-3 (vector-length s3-2)) (f1-0 f0-3)) - (if (< f30-0 0.0) (set! f30-0 (* 0.5 f30-0))) + (if (< f30-0 0.0) (set! f30-0 (/ f30-0 2))) (vector+! (-> arg1 vector) (vector-float*! (-> arg1 vector) (-> self control unknown-vector71) f30-0) (vector-float*! s3-2 s3-2 (/ f0-3 f1-0))))) @@ -629,6 +631,7 @@ slide-control-watch slide-control-ride)) + (defun distance-from-tangent ((arg0 path-control) (arg1 float) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 vector)) (eval-path-curve-div! arg0 arg2 arg1 'interp) (path-control-method-12 arg0 arg3 arg1) diff --git a/goal_src/jak1/levels/sunken/whirlpool.gc b/goal_src/jak1/levels/sunken/whirlpool.gc index efefc68c6eb..72f1169cd6c 100644 --- a/goal_src/jak1/levels/sunken/whirlpool.gc +++ b/goal_src/jak1/levels/sunken/whirlpool.gc @@ -279,7 +279,7 @@ (let* ((f0-2 (* 0.000024414063 (- 40960.0 f28-0))) (f26-0 (* f0-2 f0-2)) (f0-7 (atan (- (-> gp-0 x) (-> this root trans x)) (- (-> gp-0 z) (-> this root trans z)))) - (f30-0 (* 0.5 f26-0 arg0 (seconds-per-frame))) + (f30-0 (* (/ f26-0 2) arg0 (seconds-per-frame))) (f24-0 (+ f0-7 f30-0)) (f28-1 (- f28-0 (fmin f28-0 (* 0.16874999 f26-0 (fabs arg0) (seconds-per-frame))))) (s4-1 (new 'stack-no-clear 'vector))) diff --git a/goal_src/jak1/levels/swamp/kermit.gc b/goal_src/jak1/levels/swamp/kermit.gc index fd78947ba0f..3ac9c66ade8 100644 --- a/goal_src/jak1/levels/swamp/kermit.gc +++ b/goal_src/jak1/levels/swamp/kermit.gc @@ -658,8 +658,8 @@ (set! (-> self rotate-speed) 1820444.5) (let ((f0-2 (fmin arg0 (vector-vector-distance (-> self collide-info trans) (-> self nav target-pos))))) (cond - ((< 16384.0 f0-2) (set! (-> self target-speed) (* 0.045454547 (-> *display* frames-per-second) f0-2)) (kermit-long-hop)) - (else (set! (-> self target-speed) (* 0.1 (-> *display* frames-per-second) f0-2)) (kermit-short-hop)))) + ((< 16384.0 f0-2) (set! (-> self target-speed) (* (/ (-> *display* frames-per-second) 22) f0-2)) (kermit-long-hop)) + (else (set! (-> self target-speed) (* (/ (-> *display* frames-per-second) 10) f0-2)) (kermit-short-hop)))) (set! (-> self airborne) #f) #f) diff --git a/goal_src/jak1/levels/swamp/swamp-rat.gc b/goal_src/jak1/levels/swamp/swamp-rat.gc index e0ed3f87c23..be6fabbf1d2 100644 --- a/goal_src/jak1/levels/swamp/swamp-rat.gc +++ b/goal_src/jak1/levels/swamp/swamp-rat.gc @@ -117,7 +117,7 @@ swamp-rat-default-event-handler (f1-1 (+ 1.0 (* 2.0 f0-0))) (f2-2 f1-1) (f2-4 (/ 1.0 f2-2)) - (f0-2 (+ 1.0 (* 0.2 f0-0)))) + (f0-2 (+ 1.0 (/ f0-0 5)))) (set! (-> self delta-wiggle-angle) (* 910.2222 f1-1)) (set! (-> self wiggle-factor) (* 1.5 f2-4)) (set! (-> self target-speed) (* 28672.0 f0-2)))) @@ -185,7 +185,10 @@ swamp-rat-default-event-handler (ja-no-eval :num! (loop!)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600))) - (suspend-for gp-0 (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend))))))) + (suspend-for gp-0 + (ja :num-func num-func-identity :frame-num 0.0) + (ja-blend-eval) + (suspend))))))) (defstate nav-enemy-give-up (swamp-rat) :virtual #t diff --git a/goal_src/jak1/levels/village1/fishermans-boat.gc b/goal_src/jak1/levels/village1/fishermans-boat.gc index 33ee2e79ced..758b774fd26 100644 --- a/goal_src/jak1/levels/village1/fishermans-boat.gc +++ b/goal_src/jak1/levels/village1/fishermans-boat.gc @@ -541,7 +541,7 @@ (set! (-> *part-id-table* 2896 init-specs 4 initial-valuef) (+ 24576.0 arg1)) (set! (-> *part-id-table* 2896 init-specs 19 initial-valuef) (+ 49152.0 arg1)) (set! (-> *part-id-table* 2896 init-specs 1 initial-valuef) (* 0.0000036621095 arg2)) - (set! (-> *part-id-table* 2896 init-specs 2 initial-valuef) (* 0.1 arg2)) + (set! (-> *part-id-table* 2896 init-specs 2 initial-valuef) (/ arg2 10)) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2896) gp-0)) 0 (none)) @@ -566,7 +566,7 @@ (cond ((< 0.0 (-> self engine-sound-envelope)) (if (zero? (-> self engine-sound-id)) (set! (-> self engine-sound-id) (new-sound-id))) - (* 0.0000008138021 (-> self engine-thrust)) + (/ (-> self engine-thrust) (meters 300)) (let ((f30-0 (* 100.0 (-> self engine-sound-envelope))) (f28-0 (+ -1.0 (* 2.0 (-> self engine-sound-envelope)))) (gp-0 (new 'stack-no-clear 'vector))) @@ -897,7 +897,7 @@ (defbehavior fishermans-boat-set-throttle-by-speed fishermans-boat ((arg0 float)) (let* ((f0-0 (vector-xz-length (-> self rbody lin-velocity))) (f1-2 (/ (- arg0 f0-0) arg0)) - (f30-0 (* 0.005 f1-2))) + (f30-0 (/ f1-2 200))) (format *stdcon* "current ~M target ~M throttle ~f~%" f0-0 arg0 (-> self controller throttle)) (set! (-> self controller throttle) (fmax 0.0 (fmin 1.0 (+ (-> self controller throttle) f30-0))))) 0 diff --git a/goal_src/jak1/levels/village2/swamp-blimp.gc b/goal_src/jak1/levels/village2/swamp-blimp.gc index 10d796616d5..e09ffad1074 100644 --- a/goal_src/jak1/levels/village2/swamp-blimp.gc +++ b/goal_src/jak1/levels/village2/swamp-blimp.gc @@ -267,7 +267,7 @@ (defmethod init! ((this swamp-rope-rand-float) (arg0 int) (arg1 int) (arg2 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this max-val) (* 0.5 arg2)) + (set! (-> this max-val) (/ arg2 2)) (set! (-> this timer) 0) (set! (-> this value) 0.0) 0 @@ -328,8 +328,8 @@ (defmethod init! ((this swamp-blimp-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this xz-max) (* 0.5 arg2)) - (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this xz-max) (/ arg2 2)) + (set! (-> this y-max) (/ arg3 2)) (set! (-> this timer) 0) (vector-reset! (-> this value)) 0 @@ -822,14 +822,14 @@ (defbehavior swamp-rope-break-code swamp-rope () (when (or (< 0.001 (fabs (-> self base-vec x))) (< 0.001 (fabs (-> self base-vec z)))) - (set! (-> self base-vec x) (- (-> self base-vec x) (* 0.02 (-> *display* time-adjust-ratio) (-> self base-vec x)))) - (set! (-> self base-vec z) (- (-> self base-vec z) (* 0.02 (-> *display* time-adjust-ratio) (-> self base-vec z)))) + (set! (-> self base-vec x) (- (-> self base-vec x) (* (/ (-> *display* time-adjust-ratio) 50) (-> self base-vec x)))) + (set! (-> self base-vec z) (- (-> self base-vec z) (* (/ (-> *display* time-adjust-ratio) 50) (-> self base-vec z)))) (vector-normalize! (-> self base-vec) 1.0)) (when (< 0.4 (-> self scale-base)) (let ((f1-13 (fmax 0.002 (* 0.05 (+ -0.4 (-> self scale-base)))))) (set! (-> self scale-base) (- (-> self scale-base) (* f1-13 (-> *display* time-adjust-ratio)))))) - (+! (-> self scale-t) (* 0.005 (-> *display* time-adjust-ratio))) - (+! (-> self x-t) (* 0.004 (-> *display* time-adjust-ratio))) + (+! (-> self scale-t) (/ (-> *display* time-adjust-ratio) 200)) + (+! (-> self x-t) (/ (-> *display* time-adjust-ratio) 250)) (+! (-> self z-t) (* 0.003 (-> *display* time-adjust-ratio))) (let ((f0-19 (* (sin (+ 32768.0 (* 65536.0 (-> self scale-t)))) (fmax 0.003 (fmin 0.1 (* 0.1 (- 3.0 (-> self scale-t)))))))) (set! (-> self root scale y) (+ (-> self scale-base) f0-19))) diff --git a/goal_src/jak2/engine/camera/cam-layout.gc b/goal_src/jak2/engine/camera/cam-layout.gc index 7b40b585167..c8d572f5a82 100644 --- a/goal_src/jak2/engine/camera/cam-layout.gc +++ b/goal_src/jak2/engine/camera/cam-layout.gc @@ -1042,7 +1042,7 @@ (defun fov->maya ((arg0 float)) (if (= arg0 0.0) 0.0 - (/ 12.700255 (tan (* 0.5 arg0))) + (/ 12.700255 (tan (/ arg0 2))) ) ) diff --git a/goal_src/jak2/engine/camera/cam-master.gc b/goal_src/jak2/engine/camera/cam-master.gc index 4fabe271e3f..63edb3655ce 100644 --- a/goal_src/jak2/engine/camera/cam-master.gc +++ b/goal_src/jak2/engine/camera/cam-master.gc @@ -214,10 +214,10 @@ (let ((f30-0 (vector-dot s5-7 (-> self local-down)))) (vector--float*! s5-7 s5-7 (-> self local-down) f30-0) (if (< 0.0 f30-0) - (set! (-> self upspeed) (* 0.5 (-> self upspeed))) + (set! (-> self upspeed) (/ (-> self upspeed) 2)) ) (vector+! (-> self tpos-tgt) (-> self tpos-tgt) s5-7) - (let ((f0-26 (* 0.05 f30-0))) + (let ((f0-26 (/ f30-0 20))) (vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) f0-26) ) ) diff --git a/goal_src/jak2/engine/camera/cam-states-dbg.gc b/goal_src/jak2/engine/camera/cam-states-dbg.gc index 8062a4e7383..9d741277e97 100644 --- a/goal_src/jak2/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak2/engine/camera/cam-states-dbg.gc @@ -47,10 +47,10 @@ ) (cond ((cpad-hold? (-> *CAMERA-bank* joypad) r2) - (set! (-> s5-0 y) (- (-> s5-0 y) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) - (set! (-> s5-0 x) (- (-> s5-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0)))) - (+! (-> gp-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f28-0)) - (+! (-> gp-0 z) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f30-0)) + (set! (-> s5-0 y) (- (-> s5-0 y) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f26-0)))) + (set! (-> s5-0 x) (- (-> s5-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f0-0)))) + (+! (-> gp-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f28-0)) + (+! (-> gp-0 z) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f30-0)) ) (else (set! (-> s5-0 y) (- (-> s5-0 y) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) @@ -104,8 +104,8 @@ (let ((f30-0 (vector-length a0-7))) (cond (#f - (let* ((f28-0 (* 0.01 f30-0 (-> v1-0 x))) - (f26-0 (* 0.01 f30-0 (-> v1-0 y))) + (let* ((f28-0 (* (/ f30-0 100) (-> v1-0 x))) + (f26-0 (* (/ f30-0 100) (-> v1-0 y))) (f0-5 f28-0) (f0-7 (* f0-5 f0-5)) (f1-2 f26-0) @@ -348,16 +348,16 @@ ((and (not s3-0) (cpad-hold? arg3 r2)) (cond ((cpad-hold? arg3 l2) - (set! (-> arg0 y) (- (-> arg0 y) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f26-0)))) - (set! (-> arg0 x) (- (-> arg0 x) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f0-60)))) + (set! (-> arg0 y) (- (-> arg0 y) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f26-0)))) + (set! (-> arg0 x) (- (-> arg0 x) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f0-60)))) ) (else (set! (-> arg0 y) (- (-> arg0 y) (* (- f26-0) (-> *CAM_FREE-bank* rot-speed)))) (set! (-> arg0 x) (- (-> arg0 x) (* (- f0-60) (-> *CAM_FREE-bank* rot-speed)))) ) ) - (+! (-> arg1 x) (* 0.2 (-> *CAM_FREE-bank* speed) f28-14)) - (+! (-> arg1 z) (* 0.2 (-> *CAM_FREE-bank* speed) f30-14)) + (+! (-> arg1 x) (* (/ (-> *CAM_FREE-bank* speed) 5) f28-14)) + (+! (-> arg1 z) (* (/ (-> *CAM_FREE-bank* speed) 5) f30-14)) ) ((and (not s3-0) (cpad-hold? arg3 l2)) (+! (-> arg1 x) (* f28-14 (-> *CAM_FREE-bank* speed))) diff --git a/goal_src/jak2/engine/camera/cam-states.gc b/goal_src/jak2/engine/camera/cam-states.gc index ccc6428fb43..9b5ab1dbd8b 100644 --- a/goal_src/jak2/engine/camera/cam-states.gc +++ b/goal_src/jak2/engine/camera/cam-states.gc @@ -2285,7 +2285,7 @@ (set! f28-0 0.0) ) (if (-> self have-phony-joystick) - (set! f28-0 (* 0.05 (-> self phony-joystick-y))) + (set! f28-0 (/ (-> self phony-joystick-y) 20)) ) (if (and (-> *camera* being-attacked) (not (time-elapsed? (-> *camera* attack-start) (seconds 0.25)))) (set! f28-0 0.05) @@ -2308,7 +2308,7 @@ (let ((f0-23 f26-0)) (when (< f26-0 0.0) (let ((f0-26 - (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (* 0.5 (-> self string-min-val z))) + (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (/ (-> self string-min-val z) 2)) ) ) (set! f0-23 (fmin 0.75 f0-26)) diff --git a/goal_src/jak2/engine/camera/camera.gc b/goal_src/jak2/engine/camera/camera.gc index 3732e5a77ad..ca33daaa9d9 100644 --- a/goal_src/jak2/engine/camera/camera.gc +++ b/goal_src/jak2/engine/camera/camera.gc @@ -265,7 +265,7 @@ 0.0 ) ((>= 0.25 arg0) - (* 0.5 arg0) + (/ arg0 2) ) ((>= arg0 0.75) (- 1.0 (* 0.5 (- 1.0 arg0))) @@ -734,7 +734,7 @@ (the-as vector (-> this point (-> this end-point))) ) (let* ((f0-0 (vector-length s3-0)) - (f1-1 (* 0.33333334 (- 1.5 (* 0.00024414062 f0-0)))) + (f1-1 (* 0.33333334 (- 1.5 (/ f0-0 METER_LENGTH)))) ) 0.0 (let* ((f1-2 (fmax 0.0 f1-1)) @@ -764,7 +764,7 @@ (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-18))) ) (let* ((f0-5 (vector-normalize-ret-len! s2-0 1.0)) - (f0-6 (* 0.5 f0-5)) + (f0-6 (/ f0-5 2)) (f26-0 (* (fmin 1.0 f0-6) f30-0 (vector-dot arg0 s2-0))) ) (let ((f1-14 (vector-dot s2-0 s3-0))) @@ -837,7 +837,7 @@ (tracking-spline-method-19 this (* (-> this max-move) (-> pp clock time-adjust-ratio)) arg0 s4-0) (tracking-spline-method-14 this s4-0) (dotimes (s3-0 63) - (tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 s4-0) + (tracking-spline-method-18 this (/ (-> this sample-len) 64) arg0 s4-0) ) (vector-float*! arg0 arg0 0.015625) (let ((a2-3 (-> s4-0 cur-pt))) @@ -1213,7 +1213,7 @@ (vector-! s2-0 s2-0 (-> arg0 follow-off)) (vector-float*! s2-0 s2-0 f0-23) ) - (+! (-> arg0 follow-blend) (* 0.016666668 (-> pp clock time-adjust-ratio))) + (+! (-> arg0 follow-blend) (/ (-> pp clock time-adjust-ratio) 60)) (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s2-0) ) (else @@ -1439,7 +1439,7 @@ (let ((f28-0 (vector-dot s3-0 (the-as vector (-> arg0 vector))))) (set! sv-128 s2-0) (set! sv-112 (-> arg0 vector)) - (let ((f0-7 (* 0.8 (tan (* 0.5 arg2))))) + (let ((f0-7 (* 0.8 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-112 0 quad)) (let ((v1-11 f0-7)) (.mov vf2 v1-11) @@ -1472,7 +1472,7 @@ (let ((f28-1 (vector-dot s3-0 (-> arg0 vector 1)))) (set! sv-160 s2-0) (set! sv-144 (-> arg0 vector 1)) - (let ((f0-16 (* 0.525 (tan (* 0.5 arg2))))) + (let ((f0-16 (* 0.525 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-144 quad)) (let ((v1-32 f0-16)) (.mov vf2 v1-32) @@ -1498,7 +1498,7 @@ (let ((f28-2 (vector-dot s3-0 (-> arg0 vector 1)))) (let ((s0-1 s2-0)) (set! sv-176 (-> arg0 vector 1)) - (let ((f0-26 (* 0.525 (tan (* 0.5 arg2))))) + (let ((f0-26 (* 0.525 (tan (/ arg2 2))))) (vector-float*! s0-1 sv-176 f0-26) ) ) @@ -1657,7 +1657,7 @@ (set! sv-256 vector-into-frustum-nosmooth!) (set! sv-272 s1-0) (set! sv-288 arg1) - (let ((a2-5 (lerp-clamp arg3 (* 0.25 arg3) (-> arg0 underwater-blend value)))) + (let ((a2-5 (lerp-clamp arg3 (/ arg3 4) (-> arg0 underwater-blend value)))) (sv-256 sv-272 sv-288 a2-5) ) (cond diff --git a/goal_src/jak2/engine/collide/collide-touch.gc b/goal_src/jak2/engine/collide/collide-touch.gc index 1047a105f53..e7da1bb367d 100644 --- a/goal_src/jak2/engine/collide/collide-touch.gc +++ b/goal_src/jak2/engine/collide/collide-touch.gc @@ -487,7 +487,7 @@ ) ) (let ((f1-2 (- (- (vector-length gp-1) (-> v1-0 prim-core world-sphere w)) (-> s4-0 prim-core world-sphere w)))) - (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2))) + (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (/ f1-2 2))) ) (vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core))) ) diff --git a/goal_src/jak2/engine/common_objs/blocking-plane.gc b/goal_src/jak2/engine/common_objs/blocking-plane.gc index ecafe4dccbd..c010c0f01f5 100644 --- a/goal_src/jak2/engine/common_objs/blocking-plane.gc +++ b/goal_src/jak2/engine/common_objs/blocking-plane.gc @@ -112,11 +112,11 @@ ) (vector+! (-> s2-1 trans) s3-0 s4-0) (vector-float*! (-> s2-1 trans) (-> s2-1 trans) 0.5) - (+! (-> s2-1 trans y) (* 0.5 height)) + (+! (-> s2-1 trans y) (/ height 2)) (vector-! (the-as vector (-> s1-0 vector)) s4-0 s3-0) (let ((f30-1 (vector-normalize-ret-len! (the-as vector (-> s1-0 vector)) 1.0))) - (set! (-> s2-1 scale x) (* 0.00024414062 f30-1)) - (set! (-> s2-1 scale y) (* 0.00024414062 height)) + (set! (-> s2-1 scale x) (/ f30-1 METER_LENGTH)) + (set! (-> s2-1 scale y) (/ height METER_LENGTH)) (set! (-> s2-1 scale z) 0.0) (set! (-> s1-0 vector 1 quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) (vector-cross! (-> s1-0 vector 2) (the-as vector (-> s1-0 vector)) (-> s1-0 vector 1)) @@ -124,7 +124,7 @@ (matrix->quaternion (-> s2-1 quat) s1-0) (let ((v1-20 (-> this root root-prim local-sphere))) (set! (-> v1-20 x) 0.0) - (set! (-> v1-20 y) (* 0.00024414062 (* 0.5 height))) + (set! (-> v1-20 y) (* 0.00024414062 (/ height 2))) (set! (-> v1-20 z) 0.0) (let ((f0-17 0.5) (f1-7 (* f30-1 f30-1)) @@ -160,11 +160,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this blocking-plane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s5-0 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) (f30-0 (res-lump-float (-> this entity) 'height :default 122880.0)) ) diff --git a/goal_src/jak2/engine/common_objs/collectables.gc b/goal_src/jak2/engine/common_objs/collectables.gc index 21b6745e7f9..0799e6629c5 100644 --- a/goal_src/jak2/engine/common_objs/collectables.gc +++ b/goal_src/jak2/engine/common_objs/collectables.gc @@ -880,7 +880,7 @@ (set! (-> self root trans y) (-> self base y)) (cond ((< (-> self root transv y) -8192.0) - (set! (-> self root transv y) (* -0.5 (-> self root transv y))) + (set! (-> self root transv y) (/ (-> self root transv y) -2)) ) (else (if (and (logtest? (-> self fact options) (actor-option suck-in)) @@ -1014,7 +1014,7 @@ ) (else (if (nonzero? (-> self part)) - (set! (-> self part fade) (* 0.0033333334 f0-1)) + (set! (-> self part fade) (/ f0-1 300)) ) (when (nonzero? (-> self draw)) (logior! (-> self draw status) (draw-control-status force-fade)) @@ -1240,11 +1240,11 @@ (defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-common this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1256,11 +1256,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this eco-red) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-common this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1272,11 +1272,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-common this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1288,11 +1288,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this eco-green) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-common this arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1304,11 +1304,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this health) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-common this arg0 (pickup-type health) (-> *FACT-bank* health-default-inc)) (none) ) @@ -1344,16 +1344,17 @@ This commonly includes things such as: (defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (init-common this arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc)) (none) ) (defmethod deactivate ((this eco-pill)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (+! (-> *game-info* live-eco-pill-count) -1) ((method-of-type collectable deactivate) this) (none) @@ -1396,6 +1397,7 @@ This commonly includes things such as: (defmethod run-logic? ((this money)) + "Should this process be run? Checked by execute-process-tree." (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen)) @@ -1410,6 +1412,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this money)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (when (and (-> this next-state) (= (-> this next-state name) 'pickup)) (case (-> this pickup-type) (((pickup-type gem)) @@ -1546,11 +1549,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this money) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (initialize-allocations this) (process-drawable-from-entity! this (-> this entity)) (initialize-options this 0 1024.0 (the-as fact-info #f)) @@ -1629,6 +1632,7 @@ This commonly includes things such as: (defmethod deactivate ((this gem)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (+! (-> *game-info* live-gem-count) -1) (call-parent-method this) (none) @@ -1980,11 +1984,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this trick-point) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (initialize-allocations this) (process-drawable-from-entity! this (-> this entity)) (initialize-options this 0 1024.0 (the-as fact-info #f)) @@ -2234,11 +2238,11 @@ This commonly includes things such as: (defmethod init-from-entity! ((this eco) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((v1-1 (res-lump-value (-> this entity) 'eco-info uint128 :time -1000000000.0))) (set! (-> this type) (cond ((= (the-as uint v1-1) 3) @@ -2557,14 +2561,14 @@ This commonly includes things such as: ) ((and (>= f22-0 f0-5) (logtest? s2-1 (game-feature gun-red))) (set! s2-0 (pickup-type ammo-red)) - (set! f30-0 (* 0.5 f30-0)) + (set! f30-0 (/ f30-0 2)) ) ((and (>= f24-0 f0-5) (logtest? s2-1 (game-feature gun-blue))) (set! s2-0 (pickup-type ammo-blue)) ) ((and (>= f28-0 f0-5) (logtest? s2-1 (game-feature gun-dark))) (set! s2-0 (pickup-type ammo-dark)) - (set! f30-0 (* 0.1 f30-0)) + (set! f30-0 (/ f30-0 10)) ) (else (set! s2-0 (pickup-type eco-pill-dark)) diff --git a/goal_src/jak2/engine/common_objs/crates.gc b/goal_src/jak2/engine/common_objs/crates.gc index a2856841c5f..37ca75ca2f9 100644 --- a/goal_src/jak2/engine/common_objs/crates.gc +++ b/goal_src/jak2/engine/common_objs/crates.gc @@ -1291,9 +1291,9 @@ (defmethod smush-update! ((this crate)) (let ((f0-0 (update! (-> this smush)))) - (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale x) (+ 1.0 (/ f0-0 -2))) (set! (-> this root scale y) (+ 1.0 f0-0)) - (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale z) (+ 1.0 (/ f0-0 -2))) ) 0 (none) diff --git a/goal_src/jak2/engine/common_objs/dark-eco-pool.gc b/goal_src/jak2/engine/common_objs/dark-eco-pool.gc index ce341eba6dd..5f099e83f19 100644 --- a/goal_src/jak2/engine/common_objs/dark-eco-pool.gc +++ b/goal_src/jak2/engine/common_objs/dark-eco-pool.gc @@ -301,7 +301,7 @@ (f0-9 (fmax -1.0 (fmin 1.0 f0-7))) ) (set! (-> gp-0 global-scale) (* 4096.0 (* 3.0 (+ 1.0 f0-9)))) - (set! (-> gp-0 individual-normal-scale) (+ 0.5 (* 0.5 f0-9))) + (set! (-> gp-0 individual-normal-scale) (+ 0.5 (/ f0-9 2))) ) ) ) diff --git a/goal_src/jak2/engine/common_objs/water.gc b/goal_src/jak2/engine/common_objs/water.gc index 14fdcf32f4e..774c4f9ce01 100644 --- a/goal_src/jak2/engine/common_objs/water.gc +++ b/goal_src/jak2/engine/common_objs/water.gc @@ -830,7 +830,7 @@ (set! (-> *part-id-table* 506 init-specs 4 initial-valuef) (+ 24576.0 f30-0)) (set! (-> *part-id-table* 506 init-specs 19 initial-valuef) (+ 49152.0 f30-0)) (set! (-> *part-id-table* 506 init-specs 1 initial-valuef) (* 0.0000036621095 f28-0)) - (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (* 0.1 f28-0)) + (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (/ f28-0 10)) (set! (-> *part-id-table* 506 init-specs 13 initial-valuef) 0.7111111) (set! (-> *part-id-table* 506 init-specs 3 initial-valuef) (-> this wake-size)) (set! (-> *part-id-table* 506 init-specs 5 initial-valuef) (-> this wake-size)) @@ -1089,7 +1089,7 @@ ) (set-time! (-> this drip-time)) (logclear! (-> this flags) (water-flags spawn-drip)) - (seek! (-> this drip-wetness) 0.0 (* 0.001 (-> this drip-speed))) + (seek! (-> this drip-wetness) 0.0 (/ (-> this drip-speed) 1000)) (set! (-> this drip-speed) (* 1.05 (-> this drip-speed))) (if (= (-> this drip-wetness) 0.0) (set! (-> this drip-height) 0.0) @@ -1144,9 +1144,9 @@ (set! (-> *part-id-table* 512 init-specs 12 random-rangef) (* 13.653334 (* -0.075 f0-0))) (set! (-> *part-id-table* 513 init-specs 12 initial-valuef) (* 13.653334 (* -0.15 f0-0))) (set! (-> *part-id-table* 513 init-specs 12 random-rangef) (* 13.653334 (* -0.075 f0-0))) - (set! (-> *part-id-table* 519 init-specs 2 initial-valuef) (* 4096.0 (* 0.1 f0-0))) + (set! (-> *part-id-table* 519 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 10))) (set! (-> *part-id-table* 519 init-specs 2 random-rangef) (* 4096.0 (* 0.4 f0-0))) - (set! (-> *part-id-table* 519 init-specs 4 initial-valuef) (* 4096.0 (* 0.1 f0-0))) + (set! (-> *part-id-table* 519 init-specs 4 initial-valuef) (* 4096.0 (/ f0-0 10))) (set! (-> *part-id-table* 519 init-specs 4 random-rangef) (* 4096.0 (* 0.4 f0-0))) (set! (-> *part-id-table* 519 init-specs 9 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 519 init-specs 9 random-rangef) (* 13.653334 (* 3.4 f0-0))) @@ -1160,11 +1160,11 @@ (set! (-> *part-id-table* 516 init-specs 10 random-rangef) (* 13.653334 (* 2.4 f0-0))) (set! (-> *part-id-table* 516 init-specs 11 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 516 init-specs 11 random-rangef) (* 13.653334 (* 2.4 f0-0))) - (set! (-> *part-id-table* 520 init-specs 1 initial-valuef) (* 0.5 f0-0)) - (set! (-> *part-id-table* 520 init-specs 2 initial-valuef) (* 4096.0 (* -0.25 f0-0))) - (set! (-> *part-id-table* 520 init-specs 2 random-rangef) (* 4096.0 (* 0.5 f0-0))) - (set! (-> *part-id-table* 520 init-specs 3 initial-valuef) (* 4096.0 (* -0.25 f0-0))) - (set! (-> *part-id-table* 520 init-specs 3 random-rangef) (* 4096.0 (* 0.5 f0-0))) + (set! (-> *part-id-table* 520 init-specs 1 initial-valuef) (/ f0-0 2)) + (set! (-> *part-id-table* 520 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 -4))) + (set! (-> *part-id-table* 520 init-specs 2 random-rangef) (* 4096.0 (/ f0-0 2))) + (set! (-> *part-id-table* 520 init-specs 3 initial-valuef) (* 4096.0 (/ f0-0 -4))) + (set! (-> *part-id-table* 520 init-specs 3 random-rangef) (* 4096.0 (/ f0-0 2))) (set! (-> *part-id-table* 520 init-specs 10 initial-valuef) (* 13.653334 (* -0.75 f0-0))) (set! (-> *part-id-table* 520 init-specs 10 random-rangef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 520 init-specs 12 initial-valuef) (* 13.653334 (* -0.75 f0-0))) @@ -1173,7 +1173,7 @@ (set! (-> *part-id-table* 520 init-specs 11 random-rangef) (* 13.653334 (* 2.0 f0-0))) (set! (-> *part-id-table* 520 init-specs 15 initial-valuef) (* 13.653334 (* -0.3 f0-0))) (set! (-> *part-id-table* 520 init-specs 15 random-rangef) (* 13.653334 (* -0.075 f0-0))) - (set! (-> *part-id-table* 517 init-specs 1 initial-valuef) (* 0.5 f0-0)) + (set! (-> *part-id-table* 517 init-specs 1 initial-valuef) (/ f0-0 2)) (set! (-> *part-id-table* 517 init-specs 2 initial-valuef) (* 1.2 f0-0)) (set! (-> *part-id-table* 517 init-specs 9 initial-valuef) (* 13.653334 f0-0)) (set! (-> *part-id-table* 517 init-specs 9 random-rangef) (* 13.653334 (* 2.0 f0-0))) @@ -1196,10 +1196,10 @@ (set! (-> *part-id-table* 515 init-specs 13 initial-valuef) (* 13.653334 (* -0.3 f0-0))) (set! (-> *part-id-table* 515 init-specs 13 random-rangef) (* 13.653334 (* -0.075 f0-0))) (set! (-> *part-id-table* 514 init-specs 2 initial-valuef) (* 4096.0 (* 1.2 f0-0))) - (set! (-> *part-id-table* 514 init-specs 2 random-rangef) (* 4096.0 (* 0.2 f0-0))) + (set! (-> *part-id-table* 514 init-specs 2 random-rangef) (* 4096.0 (/ f0-0 5))) (set! (-> *part-id-table* 514 init-specs 3 initial-valuef) (* 4096.0 (* 0.4 f0-0))) (set! (-> *part-id-table* 514 init-specs 3 random-rangef) (* 4096.0 (* 1.2 f0-0))) - (set! (-> *part-id-table* 514 init-specs 7 initial-valuef) (* 4096.0 (* 0.2 f0-0))) + (set! (-> *part-id-table* 514 init-specs 7 initial-valuef) (* 4096.0 (/ f0-0 5))) (set! (-> *part-id-table* 514 init-specs 7 random-rangef) (* 4096.0 (* 2.2 f0-0))) (set! (-> *part-id-table* 518 init-specs 2 initial-valuef) (* 4096.0 (* 0.3 f0-0))) (set! (-> *part-id-table* 518 init-specs 2 random-rangef) (* 4096.0 (* 0.9 f0-0))) @@ -1302,7 +1302,7 @@ (set! (-> *part-id-table* 506 init-specs 4 initial-valuef) (+ 24576.0 arg0)) (set! (-> *part-id-table* 506 init-specs 19 initial-valuef) (+ 49152.0 arg0)) (set! (-> *part-id-table* 506 init-specs 1 initial-valuef) (* 0.0000036621095 f30-0)) - (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (* 0.1 f30-0)) + (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (/ f30-0 10)) (set! (-> *part-id-table* 506 init-specs 13 initial-valuef) 0.7111111) (set! (-> *part-id-table* 506 init-specs 3 initial-valuef) arg3) (set! (-> *part-id-table* 506 init-specs 5 initial-valuef) arg3) diff --git a/goal_src/jak2/engine/debug/default-menu.gc b/goal_src/jak2/engine/debug/default-menu.gc index 728b428cd18..be9a791186f 100644 --- a/goal_src/jak2/engine/debug/default-menu.gc +++ b/goal_src/jak2/engine/debug/default-menu.gc @@ -298,13 +298,13 @@ (case arg0 (('close) (if (and *math-camera* *subdivide-settings*) - (* 0.00024414062 (-> *subdivide-settings* close 7)) + (/ (-> *subdivide-settings* close 7) METER_LENGTH) arg3 ) ) (('far) (if (and *math-camera* *subdivide-settings*) - (* 0.00024414062 (-> *subdivide-settings* far 7)) + (/ (-> *subdivide-settings* far 7) METER_LENGTH) arg3 ) ) @@ -559,7 +559,7 @@ (if (= arg1 (debug-menu-msg press)) (set! (-> v1-0 camera-to-bbox-dist) (* 4096.0 arg2)) ) - (* 0.00024414062 (-> v1-0 camera-to-bbox-dist)) + (/ (-> v1-0 camera-to-bbox-dist) METER_LENGTH) ) ) @@ -974,7 +974,7 @@ ) ) ) - (* 0.00024414062 f1-2) + (/ f1-2 METER_LENGTH) ) ) (else @@ -1011,7 +1011,7 @@ (set! (-> (the-as prototype-bucket-tie gp-0) tie-vanish-far) f0-0) ) ) - (* 0.00024414062 f0-0) + (/ f0-0 METER_LENGTH) ) ) (else @@ -2550,7 +2550,7 @@ (set! (-> gp-0 dists x) (* 4096.0 arg2)) (prototype-bucket-recalc-fields gp-0) ) - (* 0.00024414062 (-> gp-0 dists x)) + (/ (-> gp-0 dists x) METER_LENGTH) ) (else (empty) @@ -2581,7 +2581,7 @@ (set! (-> gp-0 dists w) (* 4096.0 arg2)) (prototype-bucket-recalc-fields gp-0) ) - (* 0.00024414062 (-> gp-0 dists w)) + (/ (-> gp-0 dists w) METER_LENGTH) ) (else (empty) @@ -4362,10 +4362,7 @@ ,(lambda () (let ((v1-1 (process-spawn-function process (lambda () (set-master-mode 'game) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.3)) - (suspend) - ) + (suspend-for (seconds 0.3) ) (until #f (format *stdcon* "press x clear map, press circle cancel~%") @@ -5252,13 +5249,13 @@ fog-dists x ) - (* 0.00024414062 - (-> *overide-mood-fog-table* + (/ (-> *overide-mood-fog-table* data (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) fog-dists x ) + METER_LENGTH ) ) (set! (-> *overide-mood-fog-table* @@ -5267,13 +5264,13 @@ fog-dists y ) - (* 0.00024414062 - (-> *overide-mood-fog-table* + (/ (-> *overide-mood-fog-table* data (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) fog-dists y ) + METER_LENGTH ) ) ) @@ -5286,10 +5283,10 @@ (dotimes (v1-1 8) (set! (-> *overide-mood-fog-table* data v1-1 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-1 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-1 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-1 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-1 fog-dists y) METER_LENGTH) ) ) #f @@ -5616,10 +5613,10 @@ (set! (-> *overide-mood-color-table* data v1-2 amb-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-2 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-2 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-2 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-2 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-2 fog-dists y) METER_LENGTH) ) (set-vector! (-> *time-of-day-context* times v1-2) 1.0 1.0 1.0 1.0) ) @@ -5643,7 +5640,7 @@ (flag "Sound channels" *display-iop-info* dm-boolean-toggle-pick-func) (function "Reload Banks" #f sound-bank-reload) (function "List Sounds" #f ,(lambda () (list-sounds) (none))) - ;(function "IOP Info" #f ,(lambda () (loader-test-command (sound-command iop-mem) (the-as uint 0)) (none))) + (function "IOP Info" #f ,(lambda () (loader-test-command (sound-command iop-mem) (the-as uint 0)) (none))) ) ) ) diff --git a/goal_src/jak2/engine/debug/editable-player.gc b/goal_src/jak2/engine/debug/editable-player.gc index 1db1b003d8d..ac953b40c90 100644 --- a/goal_src/jak2/engine/debug/editable-player.gc +++ b/goal_src/jak2/engine/debug/editable-player.gc @@ -642,7 +642,7 @@ ) (else (vector-! s5-1 (edit-get-trans s1-2) s4-1) - (let ((f0-9 (* 0.00390625 f30-1 (vector-length s5-1)))) + (let ((f0-9 (* (/ f30-1 256) (vector-length s5-1)))) (set! f0-6 (fmax -40960.0 (fmin 40960.0 f0-9))) ) (set! (-> arg0 move-speed) f0-6) @@ -692,7 +692,7 @@ ) (else (vector-! s5-2 (edit-get-trans s1-3) s4-2) - (let ((f0-21 (* 0.00390625 f30-2 (vector-length s5-2)))) + (let ((f0-21 (* (/ f30-2 256) (vector-length s5-2)))) (set! f0-18 (fmax -40960.0 (fmin 40960.0 f0-21))) ) (set! (-> arg0 move-speed) f0-18) @@ -742,7 +742,7 @@ ) (else (vector-! s5-3 (edit-get-trans s1-4) s4-3) - (let ((f0-32 (* 0.00390625 f30-3 (vector-length s5-3)))) + (let ((f0-32 (* (/ f30-3 256) (vector-length s5-3)))) (set! (-> arg0 move-speed) f0-32) (set! f0-29 (fmax -40960.0 (fmin 40960.0 f0-32))) ) @@ -1437,23 +1437,23 @@ ) ;; WARN: Return type mismatch process-drawable vs editable-player. -(defmethod relocate ((this editable-player) (arg0 int)) +(defmethod relocate ((this editable-player) (offset int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) - (set! (-> v1-0 relocating-offset) arg0) + (set! (-> v1-0 relocating-offset) offset) ) (let ((v1-2 (-> this current))) (if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min)) (< (the-as int v1-2) (-> *kernel-context* relocating-max)) ) - (&+! (-> this current) arg0) + (&+! (-> this current) offset) ) ) - (the-as editable-player ((method-of-type process-drawable relocate) this arg0)) + (the-as editable-player ((method-of-type process-drawable relocate) this offset)) ) (defmethod editable-player-method-21 ((this editable-player)) diff --git a/goal_src/jak2/engine/debug/editable.gc b/goal_src/jak2/engine/debug/editable.gc index a72db8aa658..e594f276714 100644 --- a/goal_src/jak2/engine/debug/editable.gc +++ b/goal_src/jak2/engine/debug/editable.gc @@ -1082,7 +1082,7 @@ (* 0.00024414062 (- (-> this trans x) (-> arg0 level-offset x))) (* 0.00024414062 (- (-> this trans y) (-> arg0 level-offset y))) (* 0.00024414062 (- (-> this trans z) (-> arg0 level-offset z))) - (* 0.00024414062 (-> this radius)) + (/ (-> this radius) METER_LENGTH) ) (if (= (-> this direction w) 0.0) (format s5-0 ", dir_x=0.0, dir_y=0.0, dir_z=0.0") @@ -1808,9 +1808,9 @@ ) ;; WARN: Return type mismatch (array editable) vs editable-array. -(defmethod relocate ((this editable-array) (arg0 int)) +(defmethod relocate ((this editable-array) (offset int)) (the-as editable-array (when (nonzero? (-> this selection)) - (let ((v0-0 (&+ (-> this selection) arg0))) + (let ((v0-0 (&+ (-> this selection) offset))) (set! (-> this selection) v0-0) v0-0 ) diff --git a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc index 3b53d09b6d6..1ee9ac8300a 100644 --- a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc +++ b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc @@ -149,13 +149,14 @@ ) (defmethod deactivate ((this nav-graph-editor)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (set! *nav-graph-editor* (the-as (pointer nav-graph-editor) #f)) ((method-of-type process deactivate) this) (none) ) -(defmethod relocate ((this nav-graph-editor) (arg0 int)) - (call-parent-method this arg0) +(defmethod relocate ((this nav-graph-editor) (offset int)) + (call-parent-method this offset) ) ;; WARN: Return type mismatch symbol vs none. @@ -1777,7 +1778,7 @@ (let ((gp-0 (-> self nav-graph edge-array data (-> self selected-index)))) (format *stdcon* "Density = ~F~%" (-> gp-0 density)) (logior! (-> gp-0 mysql-save-flag) (mysql-save-flag update)) - (+! (-> gp-0 density) (* 0.01 (-> *mouse* speedx))) + (+! (-> gp-0 density) (/ (-> *mouse* speedx) 100)) (if (< (-> gp-0 density) 0.0) (set! (-> gp-0 density) 0.0) ) diff --git a/goal_src/jak2/engine/game/effect-control.gc b/goal_src/jak2/engine/game/effect-control.gc index bb99aad853d..d40b1d13d37 100644 --- a/goal_src/jak2/engine/game/effect-control.gc +++ b/goal_src/jak2/engine/game/effect-control.gc @@ -1143,7 +1143,7 @@ (sound-play-by-name (sound-name-with-material "zoom-land" (-> self control ground-pat) "") (new-sound-id) - (the int (* 1024.0 (* 0.000016276043 (-> self control ground-impact-vel)))) + (the int (* 1024.0 (/ (-> self control ground-impact-vel) (meters 15)))) 0 0 (sound-group sfx) diff --git a/goal_src/jak2/engine/geometry/cylinder.gc b/goal_src/jak2/engine/geometry/cylinder.gc index 8833ef406e5..b1805faa9ba 100644 --- a/goal_src/jak2/engine/geometry/cylinder.gc +++ b/goal_src/jak2/engine/geometry/cylinder.gc @@ -73,7 +73,7 @@ (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) (vector-normalize! s1-0 (-> this radius)) - (vector-float*! s0-0 (-> this axis) (* 0.125 (-> this length))) + (vector-float*! s0-0 (-> this axis) (/ (-> this length) 8)) (let ((s5-0 (new 'stack-no-clear 'cylinder-verts)) (s4-0 (new 'stack-no-clear 'cylinder-verts)) (s3-0 (new 'stack-no-clear 'matrix)) @@ -242,7 +242,7 @@ (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) (vector-normalize! s1-0 (-> this radius)) - (vector-float*! s0-0 (-> this axis) (* 0.14285715 (-> this length))) + (vector-float*! s0-0 (-> this axis) (/ (-> this length) 7)) (let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s4-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s3-0 (new 'stack-no-clear 'matrix)) diff --git a/goal_src/jak2/engine/gfx/foreground/ripple.gc b/goal_src/jak2/engine/gfx/foreground/ripple.gc index ce0748a3dd2..394c317f533 100644 --- a/goal_src/jak2/engine/gfx/foreground/ripple.gc +++ b/goal_src/jak2/engine/gfx/foreground/ripple.gc @@ -26,9 +26,9 @@ (defun ripple-make-request ((waveform ripple-wave) (effect merc-effect)) "Iterate through [[*ripple-globals*]] `requests` looking for the one that matches the provided `effect` -If NOT found, append a new [[ripple-request]] with the providded `effect` and `waveform` to the end of the `requests`. + If NOT found, append a new [[ripple-request]] with the providded `effect` and `waveform` to the end of the `requests`. -NOTE: There can only be 16 effects at a given time, NOOP if already at that limit!" + NOTE: There can only be 16 effects at a given time, NOOP if already at that limit!" (let ((v1-1 (-> *ripple-globals* count)) (a2-1 (-> *ripple-globals* requests)) (a3-0 0) @@ -74,10 +74,10 @@ NOTE: There can only be 16 effects at a given time, NOOP if already at that limi (defun ripple-execute () "Iterate through [[*ripple-globals*]] requests, from the end to index `0` -For each request, if it has a `waveform` create the wave-table via `ripple-create-wave-table` -Then for each `waveform` apply the `effect` using `ripple-apply-wave-table` + For each request, if it has a `waveform` create the wave-table via `ripple-create-wave-table` + Then for each `waveform` apply the `effect` using `ripple-apply-wave-table` -Once completed, all `requests` have been processed and the `count` is reset to `0`" + Once completed, all `requests` have been processed and the `count` is reset to `0`" (when (-> *ripple-globals* count) (ripple-execute-init) (let ((gp-0 0) @@ -192,7 +192,7 @@ Once completed, all `requests` have been processed and the `count` is reset to ` (if (< f0-23 0.0) (set! f0-23 (-> gp-0 global-scale)) ) - (+ f30-0 (* 0.0078125 f1-12 f0-23)) + (+ f30-0 (* (/ f1-12 128) f0-23)) ) ) ) diff --git a/goal_src/jak2/engine/gfx/hw/video.gc b/goal_src/jak2/engine/gfx/hw/video.gc index 7239ac97365..7242d2cce80 100644 --- a/goal_src/jak2/engine/gfx/hw/video.gc +++ b/goal_src/jak2/engine/gfx/hw/video.gc @@ -11,11 +11,11 @@ (defun set-video-mode ((tv-format symbol)) "Set related settings to the video mode in the settings, [[*video-params*]] and the [[*video-mode*]] -`ntsc` has a [[*video-mode*]] value of `0`, where as `pal` has a value of `1` + `ntsc` has a [[*video-mode*]] value of `0`, where as `pal` has a value of `1` -Will also set a bunch of common settings related to profiling and the camera to finalize the switch + Will also set a bunch of common settings related to profiling and the camera to finalize the switch -@param tv-format Recognizes `ntsc` and `pal`" + @param tv-format Recognizes `ntsc` and `pal`" (case tv-format (('ntsc) (set! (-> *setting-control* user-default display-dx) 0) @@ -42,7 +42,7 @@ Will also set a bunch of common settings related to profiling and the camera to (set! (-> *video-params* reset-video-mode) #t) (set! (-> *math-camera* isometric vector 1 y) 0.5) (set! (-> *math-camera* y-clip) 416.0) - (set! (-> *math-camera* y-pix) (* 0.5 (-> *math-camera* y-clip))) + (set! (-> *math-camera* y-pix) (/ (-> *math-camera* y-clip) 2)) (set! *profile-y* 1848) (set! (-> *video-params* set-video-mode) #t) 0 @@ -56,7 +56,7 @@ Will also set a bunch of common settings related to profiling and the camera to (defun set-aspect-ratio ((aspect symbol)) "Set [[*video-params*]] aspect-ratio related settings based on the mode provided. -@param aspect Recognizes `aspect4x3` and `aspect16x9`" + @param aspect Recognizes `aspect4x3` and `aspect16x9`" (case aspect (('aspect4x3) (set! (-> *video-params* relative-x-scale) 1.0) @@ -78,7 +78,7 @@ Will also set a bunch of common settings related to profiling and the camera to (defun set-progressive-scan ((val symbol)) "Flip the progressive scan setting flag depending on the value provided -@param val The value to set the progressive scan flag to" + @param val The value to set the progressive scan flag to" (set! (-> *setting-control* user-default use-progressive-scan) val) 0 (none) diff --git a/goal_src/jak2/engine/gfx/mood/mood-funcs.gc b/goal_src/jak2/engine/gfx/mood/mood-funcs.gc index 9879af5f7d9..0a476faffd5 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-funcs.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-funcs.gc @@ -481,7 +481,7 @@ ) (cond ((< f0-3 15.0) - (set! (-> gp-1 blink) (* 0.06666667 f0-3)) + (set! (-> gp-1 blink) (/ f0-3 15)) ) ((< 45.0 f0-3) (set! (-> gp-1 blink) (* 0.06666667 (- 60.0 f0-3))) @@ -536,7 +536,7 @@ (set! (-> v1-12 r) 1.0) ) (let ((f0-8 (- 1.0 (get-sphere-interp a0-9 a1-3 1024000.0 2048000.0)))) - (update-mood-weather! *mood-control* (+ 0.25 (* 0.75 f0-8)) (+ 0.5 (* 0.5 f0-8)) 30.0 30.0) + (update-mood-weather! *mood-control* (+ 0.25 (* 0.75 f0-8)) (+ 0.5 (/ f0-8 2)) 30.0 30.0) ) ) ) @@ -1304,7 +1304,7 @@ (let ((v1-1 (level-get *level* 'palent))) (when v1-1 (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) - (set! (-> (the-as palent-states v1-2) turret-value) (* 0.5 arg0)) + (set! (-> (the-as palent-states v1-2) turret-value) (/ arg0 2)) ) ) ) @@ -1385,9 +1385,9 @@ (defun update-village1-lights ((arg0 mood-context)) (let ((v1-0 (-> arg0 light-group))) - (set! (-> v1-0 0 dir0 extra x) (* 0.5 (-> v1-0 0 dir0 extra x))) - (set! (-> v1-0 0 dir1 extra x) (* 0.5 (-> v1-0 0 dir1 extra x))) - (set! (-> v1-0 0 dir2 extra x) (* 0.5 (-> v1-0 0 dir2 extra x))) + (set! (-> v1-0 0 dir0 extra x) (/ (-> v1-0 0 dir0 extra x) 2)) + (set! (-> v1-0 0 dir1 extra x) (/ (-> v1-0 0 dir1 extra x) 2)) + (set! (-> v1-0 0 dir2 extra x) (/ (-> v1-0 0 dir2 extra x) 2)) (set! (-> v1-0 0 ambi extra x) (* 0.75 (-> v1-0 0 ambi extra x))) ) ) @@ -1403,7 +1403,7 @@ (set! (-> arg0 times 6 w) (- 1.0 f0-0)) (set! (-> arg0 times 7 w) f0-0) (if (!= f0-0 0.0) - (set-filter-color! (- 1.0 (* 0.25 f0-0)) (- 1.0 (* 0.5 f0-0)) 1.0) + (set-filter-color! (- 1.0 (/ f0-0 4)) (- 1.0 (/ f0-0 2)) 1.0) ) ) (when (not (paused?)) diff --git a/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc b/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc index eca27e71d93..26042895a0d 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc @@ -586,7 +586,7 @@ (if (or (and (>= a0-37 350) (< a0-37 400)) (>= a0-37 500)) (+! f4-0 f0-8) ) - (let ((f0-10 (* 0.0006510417 f4-0))) + (let ((f0-10 (/ f4-0 1536))) (set! (-> arg0 times 2 w) f0-10) (set! (-> arg0 light-group 3 dir1 extra x) f0-10) ) @@ -625,7 +625,7 @@ (if (nonzero? (-> s5-0 spec-hog-2-on)) (set! (-> s5-0 spec-hog-2-on initial-valuef) f0-19) ) - (set! (-> arg0 times 3 w) (+ 0.5 (* 0.0009765625 f0-19))) + (set! (-> arg0 times 3 w) (+ 0.5 (/ f0-19 1024))) ) (set! (-> arg0 light-group 4 dir1 extra x) (-> arg0 times 3 w)) (let ((v1-6 (mod v1-5 600))) @@ -638,7 +638,7 @@ (if (nonzero? (-> s5-0 spec-hiphog-on2)) (set! (-> s5-0 spec-hiphog-on2 initial-valuef) f0-24) ) - (set! (-> arg0 times 4 w) (* 0.001953125 f0-24)) + (set! (-> arg0 times 4 w) (/ f0-24 512)) ) ) (else @@ -659,7 +659,7 @@ (if (nonzero? (-> s5-0 spec-clock-moon)) (set! (-> s5-0 spec-clock-moon initial-valuef) f0-31) ) - (set-vector! (-> arg0 times 5) 0.471 0.722 1.0 (+ 0.5 (* 0.001953125 f0-31))) + (set-vector! (-> arg0 times 5) 0.471 0.722 1.0 (+ 0.5 (/ f0-31 512))) ) ) (else @@ -667,7 +667,7 @@ (if (nonzero? (-> s5-0 spec-clock-sun)) (set! (-> s5-0 spec-clock-sun initial-valuef) f0-35) ) - (set-vector! (-> arg0 times 5) 1.0 0.99 0.54 (+ 0.5 (* 0.0009765625 f0-35))) + (set-vector! (-> arg0 times 5) 1.0 0.99 0.54 (+ 0.5 (/ f0-35 1024))) ) ) ) @@ -2328,7 +2328,7 @@ ) (when (!= (-> gp-0 explosion) 0.0) (set! (-> arg0 times 7 w) (-> gp-0 explosion)) - (let ((f0-15 (- 1.0 (* 0.5 (-> gp-0 explosion))))) + (let ((f0-15 (- 1.0 (/ (-> gp-0 explosion) 2)))) (set! (-> arg0 times 2 w) (* (-> arg0 times 2 w) f0-15)) (set! (-> arg0 times 3 w) (* (-> arg0 times 3 w) f0-15)) (set! (-> arg0 times 0 w) (* (-> arg0 times 0 w) f0-15)) @@ -2437,7 +2437,7 @@ ((< 0.0 (-> gp-1 flash)) (set! (-> gp-1 level) (-> gp-1 flash)) (set-vector! (-> gp-1 dir) 0.0 0.0 1.0 0.0) - (set! (-> gp-1 flash) (- (-> gp-1 flash) (* 0.5 (-> *display* base-clock seconds-per-frame)))) + (set! (-> gp-1 flash) (- (-> gp-1 flash) (/ (-> *display* base-clock seconds-per-frame) 2))) (set! (-> gp-1 time) 0.0) ) (else @@ -2461,7 +2461,7 @@ (let ((f30-0 (vector-length (-> gp-1 pos)))) (set! (-> gp-1 dir quad) (-> gp-1 pos quad)) (vector-normalize! (-> gp-1 dir) 1.0) - (set! (-> gp-1 level) (* (-> gp-1 scale) (- 1.0 (fmin 1.0 (* 0.000009765625 f30-0))))) + (set! (-> gp-1 level) (* (-> gp-1 scale) (- 1.0 (fmin 1.0 (/ f30-0 (meters 25)))))) ) (set! (-> gp-1 pos z) (- (-> gp-1 pos z) (* (-> gp-1 delta) (-> *display* base-clock seconds-per-frame)))) ) @@ -2560,7 +2560,7 @@ (set! (-> arg0 times 5 w) (+ (-> gp-1 purple) (-> gp-1 purple-noise))) (when (not (paused?)) (seek! (-> gp-1 purple) 0.0 (* 4.0 (seconds-per-frame))) - (set! (-> gp-1 purple-noise) (rand-vu-float-range 0.0 (* 0.2 (-> gp-1 purple)))) + (set! (-> gp-1 purple-noise) (rand-vu-float-range 0.0 (/ (-> gp-1 purple) 5))) (+! (-> gp-1 rot) (* 16384.0 (seconds-per-frame))) ) ) diff --git a/goal_src/jak2/engine/gfx/mood/mood-tables2.gc b/goal_src/jak2/engine/gfx/mood/mood-tables2.gc index bfd30a8eb69..f82a2953c7d 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-tables2.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-tables2.gc @@ -97,15 +97,18 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defun init-overide-table ((arg0 mood-table)) - (set! (-> arg0 mood-fog-table) (new 'debug 'mood-fog-table)) - (set! (-> arg0 mood-color-table) (new 'debug 'mood-color-table)) - (set! (-> arg0 mood-channel-group) *no-cloud-mood-channel-group*) - (set! (-> arg0 mood-direction-table) *mood-direction-table*) - (set! (-> arg0 mood-sky-table) *mood-sky-table*) - (set! (-> arg0 mood-interp-table) *mood-interp-table*) - (mem-copy! (the-as pointer (-> arg0 mood-fog-table)) (the-as pointer *no-cloud-clear-mood-fog-table*) 384) - (mem-copy! (the-as pointer (-> arg0 mood-color-table)) (the-as pointer *no-cloud-mood-color-table*) 256) +(defun init-overide-table ((table mood-table)) + "Similar to [[init-mood-table]], does the bare minimum to setup the given [[mood-table]] + @param! table The table to initialize + @returns [[none]]" + (set! (-> table mood-fog-table) (new 'debug 'mood-fog-table)) + (set! (-> table mood-color-table) (new 'debug 'mood-color-table)) + (set! (-> table mood-channel-group) *no-cloud-mood-channel-group*) + (set! (-> table mood-direction-table) *mood-direction-table*) + (set! (-> table mood-sky-table) *mood-sky-table*) + (set! (-> table mood-interp-table) *mood-interp-table*) + (mem-copy! (the-as pointer (-> table mood-fog-table)) (the-as pointer *no-cloud-clear-mood-fog-table*) 384) + (mem-copy! (the-as pointer (-> table mood-color-table)) (the-as pointer *no-cloud-mood-color-table*) 256) (none) ) @@ -115,62 +118,62 @@ ;; WARN: Return type mismatch object vs none. (defun print-mood-tables () - "Print out the contents of the [[*overide-table*]]" + "Generates the GOAL code for defining the current state of [[*overide-table*]]" (mem-copy! (the-as pointer (-> *overide-table* mood-fog-table)) (the-as pointer *overide-mood-fog-table*) 384) (mem-copy! (the-as pointer (-> *overide-table* mood-color-table)) (the-as pointer *overide-mood-color-table*) 256 ) - (dotimes (v1-2 8) + (dotimes (data-idx 8) (vector-float*! - (the-as vector (-> *overide-table* mood-fog-table data v1-2)) - (the-as vector (-> *overide-table* mood-fog-table data v1-2)) - (-> *overide-table* mood-fog-table data v1-2 fog-color w) + (the-as vector (-> *overide-table* mood-fog-table data data-idx)) + (the-as vector (-> *overide-table* mood-fog-table data data-idx)) + (-> *overide-table* mood-fog-table data data-idx fog-color w) ) (vector-float*! - (the-as vector (-> *overide-table* mood-color-table data v1-2)) - (the-as vector (-> *overide-table* mood-color-table data v1-2)) - (-> *overide-table* mood-color-table data v1-2 lgt-color w) + (the-as vector (-> *overide-table* mood-color-table data data-idx)) + (the-as vector (-> *overide-table* mood-color-table data data-idx)) + (-> *overide-table* mood-color-table data data-idx lgt-color w) ) (vector-float*! - (the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* v1-2 32))) - (the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* v1-2 32))) - (-> *overide-table* mood-color-table data v1-2 amb-color w) + (the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* data-idx 32))) + (the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* data-idx 32))) + (-> *overide-table* mood-color-table data data-idx amb-color w) ) - (set! (-> *overide-table* mood-fog-table data v1-2 fog-color w) 128.0) - (set! (-> *overide-table* mood-color-table data v1-2 lgt-color w) 0.0) - (set! (-> *overide-table* mood-color-table data v1-2 amb-color w) 1.0) + (set! (-> *overide-table* mood-fog-table data data-idx fog-color w) 128.0) + (set! (-> *overide-table* mood-color-table data data-idx lgt-color w) 0.0) + (set! (-> *overide-table* mood-color-table data data-idx amb-color w) 1.0) ) (format 0 "(define *overide-mood-color-table*~%") (format 0 " (new 'static 'mood-color-table~%") (format 0 " :data (new 'static 'inline-array 'mood-color 0~%") - (dotimes (gp-0 8) + (dotimes (_color-idx 8) (format 0 " (new 'static 'mood-color") - (let ((v1-5 gp-0)) + (let ((color-idx _color-idx)) (cond - ((zero? v1-5) + ((zero? color-idx) (format 0 " ; sun rise~%") ) - ((= v1-5 1) + ((= color-idx 1) (format 0 " ; morning~%") ) - ((= v1-5 2) + ((= color-idx 2) (format 0 " ; noon~%") ) - ((= v1-5 3) + ((= color-idx 3) (format 0 " ; afternoon~%") ) - ((= v1-5 4) + ((= color-idx 4) (format 0 " ; sunset~%") ) - ((= v1-5 5) + ((= color-idx 5) (format 0 " ; twilight~%") ) - ((= v1-5 6) + ((= color-idx 6) (format 0 " ; evening~%") ) - ((= v1-5 7) + ((= color-idx 7) (format 0 " ; green sun~%") ) ) @@ -178,18 +181,18 @@ (format 0 " :lgt-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" - (-> *overide-table* mood-color-table data gp-0 lgt-color x) - (-> *overide-table* mood-color-table data gp-0 lgt-color y) - (-> *overide-table* mood-color-table data gp-0 lgt-color z) - (-> *overide-table* mood-color-table data gp-0 lgt-color w) + (-> *overide-table* mood-color-table data _color-idx lgt-color x) + (-> *overide-table* mood-color-table data _color-idx lgt-color y) + (-> *overide-table* mood-color-table data _color-idx lgt-color z) + (-> *overide-table* mood-color-table data _color-idx lgt-color w) ) (format 0 " :amb-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" - (-> *overide-table* mood-color-table data gp-0 amb-color x) - (-> *overide-table* mood-color-table data gp-0 amb-color y) - (-> *overide-table* mood-color-table data gp-0 amb-color z) - (-> *overide-table* mood-color-table data gp-0 amb-color w) + (-> *overide-table* mood-color-table data _color-idx amb-color x) + (-> *overide-table* mood-color-table data _color-idx amb-color y) + (-> *overide-table* mood-color-table data _color-idx amb-color z) + (-> *overide-table* mood-color-table data _color-idx amb-color w) ) (format 0 " )~%") ) @@ -199,32 +202,32 @@ (format 0 "(define *overide-mood-fog-table*~%") (format 0 " (new 'static 'mood-fog-table~%") (format 0 " :data (new 'static 'inline-array 'mood-fog 0~%") - (dotimes (gp-1 8) + (dotimes (_fog-idx 8) (format 0 " (new 'static 'mood-fog") - (let ((v1-33 gp-1)) + (let ((fog-idx _fog-idx)) (cond - ((zero? v1-33) + ((zero? fog-idx) (format 0 " ; sun rise~%") ) - ((= v1-33 1) + ((= fog-idx 1) (format 0 " ; morning~%") ) - ((= v1-33 2) + ((= fog-idx 2) (format 0 " ; noon~%") ) - ((= v1-33 3) + ((= fog-idx 3) (format 0 " ; afternoon~%") ) - ((= v1-33 4) + ((= fog-idx 4) (format 0 " ; sunset~%") ) - ((= v1-33 5) + ((= fog-idx 5) (format 0 " ; twilight~%") ) - ((= v1-33 6) + ((= fog-idx 6) (format 0 " ; evening~%") ) - ((= v1-33 7) + ((= fog-idx 7) (format 0 " ; green sun~%") ) ) @@ -232,18 +235,18 @@ (format 0 " :fog-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" - (-> *overide-table* mood-fog-table data gp-1 fog-color x) - (-> *overide-table* mood-fog-table data gp-1 fog-color y) - (-> *overide-table* mood-fog-table data gp-1 fog-color z) - (-> *overide-table* mood-fog-table data gp-1 fog-color w) + (-> *overide-table* mood-fog-table data _fog-idx fog-color x) + (-> *overide-table* mood-fog-table data _fog-idx fog-color y) + (-> *overide-table* mood-fog-table data _fog-idx fog-color z) + (-> *overide-table* mood-fog-table data _fog-idx fog-color w) ) (format 0 " :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%" - (-> *overide-table* mood-fog-table data gp-1 fog-dists x) - (-> *overide-table* mood-fog-table data gp-1 fog-dists y) - (-> *overide-table* mood-fog-table data gp-1 fog-dists w) - (-> *overide-table* mood-fog-table data gp-1 fog-dists z) + (-> *overide-table* mood-fog-table data _fog-idx fog-dists x) + (-> *overide-table* mood-fog-table data _fog-idx fog-dists y) + (-> *overide-table* mood-fog-table data _fog-idx fog-dists w) + (-> *overide-table* mood-fog-table data _fog-idx fog-dists z) ) (format 0 " :erase-color (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 128.0)~%") (format 0 " )~%") @@ -258,38 +261,46 @@ ;; WARN: Return type mismatch object vs none. (defun desaturate-mood-colors ((arg0 float) (arg1 float) (arg2 float)) "Unused - Generate GOAL code for a new [[*overide-mood-color-table*]] definition that desaturates the color -Apply said overrides to the [[*overide-table*]]" + Apply said overrides to the [[*overide-table*]]" (mem-copy! (the-as pointer (-> *overide-table* mood-color-table)) (the-as pointer *no-cloud-mood-color-table*) 256 ) - (dotimes (v1-1 8) - (let ((a1-3 (-> *overide-table* mood-color-table data v1-1)) + (dotimes (data-idx 8) + (let ((color-data (-> *overide-table* mood-color-table data data-idx)) (mood-colors (the-as (inline-array mood-color) - (-> (the-as (inline-array mood-color) (-> *overide-table* mood-color-table data 0 amb-color)) v1-1) + (-> (the-as (inline-array mood-color) (-> *overide-table* mood-color-table data 0 amb-color)) data-idx) ) ) ) - (let ((f1-2 (fmax (fmax (-> a1-3 lgt-color x) (-> a1-3 lgt-color y)) (-> a1-3 lgt-color z))) - (f0-4 + (let ((max-light-color + (fmax (fmax (-> color-data lgt-color x) (-> color-data lgt-color y)) (-> color-data lgt-color z)) + ) + (max-0th-light-color (fmax (fmax (-> mood-colors 0 lgt-color x) (-> mood-colors 0 lgt-color y)) (-> mood-colors 0 lgt-color z)) ) ) - (set! (-> a1-3 lgt-color x) (* (+ (-> a1-3 lgt-color x) (* (- f1-2 (-> a1-3 lgt-color x)) arg0)) arg1)) - (set! (-> a1-3 lgt-color y) (* (+ (-> a1-3 lgt-color y) (* (- f1-2 (-> a1-3 lgt-color y)) arg0)) arg1)) - (set! (-> a1-3 lgt-color z) (* (+ (-> a1-3 lgt-color z) (* (- f1-2 (-> a1-3 lgt-color z)) arg0)) arg1)) - (set! (-> a1-3 lgt-color w) 0.0) + (set! (-> color-data lgt-color x) + (* (+ (-> color-data lgt-color x) (* (- max-light-color (-> color-data lgt-color x)) arg0)) arg1) + ) + (set! (-> color-data lgt-color y) + (* (+ (-> color-data lgt-color y) (* (- max-light-color (-> color-data lgt-color y)) arg0)) arg1) + ) + (set! (-> color-data lgt-color z) + (* (+ (-> color-data lgt-color z) (* (- max-light-color (-> color-data lgt-color z)) arg0)) arg1) + ) + (set! (-> color-data lgt-color w) 0.0) (set! (-> mood-colors 0 lgt-color x) - (* (+ (-> mood-colors 0 lgt-color x) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2) + (* (+ (-> mood-colors 0 lgt-color x) (* (- max-0th-light-color (-> mood-colors 0 lgt-color x)) arg0)) arg2) ) (set! (-> mood-colors 0 lgt-color y) - (* (+ (-> mood-colors 0 lgt-color y) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2) + (* (+ (-> mood-colors 0 lgt-color y) (* (- max-0th-light-color (-> mood-colors 0 lgt-color x)) arg0)) arg2) ) (set! (-> mood-colors 0 lgt-color z) - (* (+ (-> mood-colors 0 lgt-color z) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2) + (* (+ (-> mood-colors 0 lgt-color z) (* (- max-0th-light-color (-> mood-colors 0 lgt-color x)) arg0)) arg2) ) ) (set! (-> mood-colors 0 lgt-color w) 1.0) @@ -298,32 +309,32 @@ Apply said overrides to the [[*overide-table*]]" (format 0 "(define *overide-mood-color-table*~%") (format 0 " (new 'static 'mood-color-table~%") (format 0 " :data (new 'static 'inline-array 'mood-color 0~%") - (dotimes (gp-1 8) + (dotimes (_color-idx 8) (format 0 " (new 'static 'mood-color") - (let ((v1-4 gp-1)) + (let ((color-idx _color-idx)) (cond - ((zero? v1-4) + ((zero? color-idx) (format 0 " ; sun rise~%") ) - ((= v1-4 1) + ((= color-idx 1) (format 0 " ; morning~%") ) - ((= v1-4 2) + ((= color-idx 2) (format 0 " ; noon~%") ) - ((= v1-4 3) + ((= color-idx 3) (format 0 " ; afternoon~%") ) - ((= v1-4 4) + ((= color-idx 4) (format 0 " ; sunset~%") ) - ((= v1-4 5) + ((= color-idx 5) (format 0 " ; twilight~%") ) - ((= v1-4 6) + ((= color-idx 6) (format 0 " ; evening~%") ) - ((= v1-4 7) + ((= color-idx 7) (format 0 " ; green sun~%") ) ) @@ -331,18 +342,18 @@ Apply said overrides to the [[*overide-table*]]" (format 0 " :lgt-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" - (-> *overide-table* mood-color-table data gp-1 lgt-color x) - (-> *overide-table* mood-color-table data gp-1 lgt-color y) - (-> *overide-table* mood-color-table data gp-1 lgt-color z) - (-> *overide-table* mood-color-table data gp-1 lgt-color w) + (-> *overide-table* mood-color-table data _color-idx lgt-color x) + (-> *overide-table* mood-color-table data _color-idx lgt-color y) + (-> *overide-table* mood-color-table data _color-idx lgt-color z) + (-> *overide-table* mood-color-table data _color-idx lgt-color w) ) (format 0 " :amb-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" - (-> *overide-table* mood-color-table data gp-1 amb-color x) - (-> *overide-table* mood-color-table data gp-1 amb-color y) - (-> *overide-table* mood-color-table data gp-1 amb-color z) - (-> *overide-table* mood-color-table data gp-1 amb-color w) + (-> *overide-table* mood-color-table data _color-idx amb-color x) + (-> *overide-table* mood-color-table data _color-idx amb-color y) + (-> *overide-table* mood-color-table data _color-idx amb-color z) + (-> *overide-table* mood-color-table data _color-idx amb-color w) ) (format 0 " )~%") ) @@ -355,47 +366,53 @@ Apply said overrides to the [[*overide-table*]]" ;; WARN: Return type mismatch object vs none. (defun desaturate-mood-fog ((arg0 (pointer mood-fog-table)) (arg1 float) (arg2 float)) "Unused - Generate GOAL code for a new [[*overide-mood-fog-table*]] definition that desaturates the fog color -Apply said overrides to the [[*overide-table*]]" + Apply said overrides to the [[*overide-table*]]" (mem-copy! (the-as pointer (-> *overide-table* mood-fog-table)) arg0 384) - (dotimes (v1-2 8) - (let ((a0-5 (-> *overide-table* mood-fog-table data v1-2))) - (let ((f0-2 (fmax (fmax (-> a0-5 fog-color x) (-> a0-5 fog-color y)) (-> a0-5 fog-color z)))) - (set! (-> a0-5 fog-color x) (* (+ (-> a0-5 fog-color x) (* (- f0-2 (-> a0-5 fog-color x)) arg1)) arg2)) - (set! (-> a0-5 fog-color y) (* (+ (-> a0-5 fog-color y) (* (- f0-2 (-> a0-5 fog-color y)) arg1)) arg2)) - (set! (-> a0-5 fog-color z) (* (+ (-> a0-5 fog-color z) (* (- f0-2 (-> a0-5 fog-color z)) arg1)) arg2)) + (dotimes (data-idx 8) + (let ((fog-data (-> *overide-table* mood-fog-table data data-idx))) + (let ((max-fog-val (fmax (fmax (-> fog-data fog-color x) (-> fog-data fog-color y)) (-> fog-data fog-color z)))) + (set! (-> fog-data fog-color x) + (* (+ (-> fog-data fog-color x) (* (- max-fog-val (-> fog-data fog-color x)) arg1)) arg2) + ) + (set! (-> fog-data fog-color y) + (* (+ (-> fog-data fog-color y) (* (- max-fog-val (-> fog-data fog-color y)) arg1)) arg2) + ) + (set! (-> fog-data fog-color z) + (* (+ (-> fog-data fog-color z) (* (- max-fog-val (-> fog-data fog-color z)) arg1)) arg2) + ) ) - (set! (-> a0-5 fog-color w) 1.0) + (set! (-> fog-data fog-color w) 1.0) ) ) (format 0 "(define *overide-mood-fog-table*~%") (format 0 " (new 'static 'mood-fog-table~%") (format 0 " :data (new 'static 'inline-array 'mood-fog 0~%") - (dotimes (gp-1 8) + (dotimes (_fog-idx 8) (format 0 " (new 'static 'mood-fog") - (let ((v1-5 gp-1)) + (let ((fog-idx _fog-idx)) (cond - ((zero? v1-5) + ((zero? fog-idx) (format 0 " ; sun rise~%") ) - ((= v1-5 1) + ((= fog-idx 1) (format 0 " ; morning~%") ) - ((= v1-5 2) + ((= fog-idx 2) (format 0 " ; noon~%") ) - ((= v1-5 3) + ((= fog-idx 3) (format 0 " ; afternoon~%") ) - ((= v1-5 4) + ((= fog-idx 4) (format 0 " ; sunset~%") ) - ((= v1-5 5) + ((= fog-idx 5) (format 0 " ; twilight~%") ) - ((= v1-5 6) + ((= fog-idx 6) (format 0 " ; evening~%") ) - ((= v1-5 7) + ((= fog-idx 7) (format 0 " ; green sun~%") ) ) @@ -403,18 +420,18 @@ Apply said overrides to the [[*overide-table*]]" (format 0 " :fog-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" - (-> *overide-table* mood-fog-table data gp-1 fog-color x) - (-> *overide-table* mood-fog-table data gp-1 fog-color y) - (-> *overide-table* mood-fog-table data gp-1 fog-color z) - (-> *overide-table* mood-fog-table data gp-1 fog-color w) + (-> *overide-table* mood-fog-table data _fog-idx fog-color x) + (-> *overide-table* mood-fog-table data _fog-idx fog-color y) + (-> *overide-table* mood-fog-table data _fog-idx fog-color z) + (-> *overide-table* mood-fog-table data _fog-idx fog-color w) ) (format 0 " :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%" - (* 0.00024414062 (-> *overide-table* mood-fog-table data gp-1 fog-dists x)) - (* 0.00024414062 (-> *overide-table* mood-fog-table data gp-1 fog-dists y)) - (-> *overide-table* mood-fog-table data gp-1 fog-dists w) - (-> *overide-table* mood-fog-table data gp-1 fog-dists z) + (/ (-> *overide-table* mood-fog-table data _fog-idx fog-dists x) METER_LENGTH) + (/ (-> *overide-table* mood-fog-table data _fog-idx fog-dists y) METER_LENGTH) + (-> *overide-table* mood-fog-table data _fog-idx fog-dists w) + (-> *overide-table* mood-fog-table data _fog-idx fog-dists z) ) (format 0 " :erase-color (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 128.0)~%") (format 0 " )~%") diff --git a/goal_src/jak2/engine/gfx/mood/mood.gc b/goal_src/jak2/engine/gfx/mood/mood.gc index a7d2a118bcd..95c36b5c954 100644 --- a/goal_src/jak2/engine/gfx/mood/mood.gc +++ b/goal_src/jak2/engine/gfx/mood/mood.gc @@ -24,10 +24,10 @@ #f ) -(defun clear-mood-times ((arg0 mood-context)) +(defun clear-mood-times ((mood-ctx mood-context)) "Clear all of the mood times on the given context" - (dotimes (v1-0 8) - (set! (-> arg0 times v1-0 w) 0.0) + (dotimes (idx 8) + (set! (-> mood-ctx times idx w) 0.0) ) #f ) @@ -531,8 +531,8 @@ (set! (-> arg0 times arg1 w) f30-1) (when (not (paused?)) (if (< 0.75 f30-1) - (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.04 (-> pp clock time-adjust-ratio)))) - (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.02 (-> pp clock time-adjust-ratio)))) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (/ (-> pp clock time-adjust-ratio) 25))) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (/ (-> pp clock time-adjust-ratio) 50))) ) ) ) @@ -897,9 +897,9 @@ ;; WARN: Return type mismatch int vs sound-id. (defmethod play-or-stop-lightning! ((this mood-control) (arg0 sound-spec) (arg1 vector)) "Handles playing/stopping of the lightning sound -- Plays the lightning sound if we are not loading and `lightning-id` is zero -- Stops the lightning sound first if `lightning-id` is non-zero -Returns the current value of `lightning-id`" + - Plays the lightning sound if we are not loading and `lightning-id` is zero + - Stops the lightning sound first if `lightning-id` is non-zero + Returns the current value of `lightning-id`" (vector+! (new 'stack-no-clear 'vector) arg1 (math-camera-pos)) (the-as sound-id (cond ((or (load-in-progress? *level*) (movie?)) @@ -1331,8 +1331,8 @@ Returns the current value of `lightning-id`" (defmethod update-mood-weather! ((this mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float)) "Set the `target-interp` and `speed-interp` for the clouds and fog -If `*-speed` is 0.0, use the `*-target` args to set `current-interp` -See [[mood-weather]]" + If `*-speed` is 0.0, use the `*-target` args to set `current-interp` + See [[mood-weather]]" (set! (-> this target-interp cloud) cloud-target) (set! (-> this target-interp fog) fog-target) (set! (-> this speed-interp cloud) cloud-speed) @@ -1349,7 +1349,7 @@ See [[mood-weather]]" (defmethod update-mood-range! ((this mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float)) "Set the minimum and maximum ranges of clouds and fog -See [[mood-range]]" + See [[mood-range]]" (set! (-> this range min-cloud) min-cloud) (set! (-> this range max-cloud) max-cloud) (set! (-> this range min-fog) min-fog) @@ -1360,7 +1360,7 @@ See [[mood-range]]" (defmethod set-time-for-random-weather! ((this mood-control) (arg0 float) (arg1 float)) "Set the `time-until-random`'s cloud and fog values -See [[mood-weather]]" + See [[mood-weather]]" (set! (-> this time-until-random cloud) arg0) (set! (-> this time-until-random fog) arg1) 0 diff --git a/goal_src/jak2/engine/gfx/mood/time-of-day.gc b/goal_src/jak2/engine/gfx/mood/time-of-day.gc index 5eebf20817c..d76ad790103 100644 --- a/goal_src/jak2/engine/gfx/mood/time-of-day.gc +++ b/goal_src/jak2/engine/gfx/mood/time-of-day.gc @@ -15,6 +15,7 @@ ) (defmethod deactivate ((this time-of-day-proc)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this sun)) (kill-and-free-particles (-> this sun)) ) @@ -198,7 +199,7 @@ (-> self time-of-day) ) (('time-of-day-norm) - (* 0.041666668 (-> self time-of-day)) + (/ (-> self time-of-day) 24) ) (('hour) (-> self hours) @@ -305,10 +306,10 @@ (set! (-> *overide-mood-color-table* data v1-8 amb-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-8 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-8 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-8 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-8 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-8 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-8 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-8 fog-dists y) METER_LENGTH) ) (set-vector! (-> *time-of-day-context* times v1-8) 1.0 1.0 1.0 1.0) ) @@ -366,7 +367,7 @@ ) (let* ((f0-23 (fmax (fmax (-> s4-0 x) (-> s4-0 y)) (-> s4-0 z))) (f2-14 (fmax (fmax (-> s5-0 x) (-> s5-0 y)) (-> s5-0 z))) - (f0-27 (fmin 0.85 (- 1.0 (/ (* 0.5 f2-14) (+ f0-23 f2-14))))) + (f0-27 (fmin 0.85 (- 1.0 (/ (/ f2-14 2) (+ f0-23 f2-14))))) (v0-1 (-> arg0 current-shadow-color)) ) (set! (-> v0-1 x) f0-27) @@ -631,8 +632,8 @@ (v1-1 (-> *time-of-day-context* current-fog)) (f1-0 (-> v1-1 fog-dists x)) (f2-0 (-> v1-1 fog-dists y)) - (f3-1 (* 0.003921569 (-> v1-1 fog-dists w))) - (f4-2 (* 0.003921569 (-> v1-1 fog-dists z))) + (f3-1 (/ (-> v1-1 fog-dists w) 255)) + (f4-2 (/ (-> v1-1 fog-dists z) 255)) ) (+ f4-2 (* (fmax 0.0 (fmin 1.0 (/ (- f0-0 f1-0) (- f2-0 f1-0)))) (- f3-1 f4-2))) ) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc b/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc index a0f40a30a26..281c7838018 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc @@ -19,7 +19,7 @@ (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 393216.0) (let* ((s4-0 (-> (matrix-local->world #f #f) vector 2)) (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + (f1-1 (+ 0.5 (/ (-> s4-0 y) -2))) ) (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 0.0) ) @@ -271,7 +271,7 @@ (let ((f0-16 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) (if (-> *time-of-day-context* sky) (set-vector! (-> arg0 env-color) f0-16 f0-16 f0-16 f0-16) - (set-vector! (-> arg0 env-color) f0-16 f0-16 (* 0.5 f0-16) f0-16) + (set-vector! (-> arg0 env-color) f0-16 f0-16 (/ f0-16 2) f0-16) ) ) (set-vector! (-> arg0 index-table 0) 63 84 66 0) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-near.gc b/goal_src/jak2/engine/gfx/ocean/ocean-near.gc index 43b6271164f..013c9463f84 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-near.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-near.gc @@ -45,7 +45,7 @@ (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 0.000010172526) (let* ((s4-0 (-> (matrix-local->world #f #f) vector 2)) (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + (f1-1 (+ 0.5 (/ (-> s4-0 y) -2))) ) (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 128.0) ) @@ -342,7 +342,7 @@ (let ((f0-28 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) (if (-> *time-of-day-context* sky) (set-vector! (-> arg0 env-color) f0-28 f0-28 f0-28 f0-28) - (set-vector! (-> arg0 env-color) f0-28 f0-28 (* 0.5 f0-28) f0-28) + (set-vector! (-> arg0 env-color) f0-28 f0-28 (/ f0-28 2) f0-28) ) ) (set! (-> arg0 drw2-adgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1)) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc b/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc index a50cd014d9f..b6c44ba3875 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc @@ -569,8 +569,8 @@ (defmethod ocean-method-84 ((this ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) (when (>= (-> arg1 sun 0 pos y) -150.0) - (let* ((f2-0 (* 0.00010050251 (-> arg1 sun 0 pos x))) - (f1-3 (* 0.00010050251 (-> arg1 sun 0 pos z))) + (let* ((f2-0 (/ (-> arg1 sun 0 pos x) 9950)) + (f1-3 (/ (-> arg1 sun 0 pos z) 9950)) (f0-6 (if (< 0.0 (-> arg1 sun 0 pos y)) 1.0 (* 0.006666667 (+ 150.0 (-> arg1 sun 0 pos y))) @@ -737,7 +737,7 @@ (vector--float*! s2-0 arg2 (-> s3-0 sun1-normal) 9.0) (vector--float*! s4-0 arg2 (-> s3-0 moon-normal) 9.0) (vector-float*! s5-0 s5-0 (* (-> s3-0 sun0-scale) f28-0)) - (vector+float*! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> s3-0 sun1-scale))) + (vector+float*! s5-0 s5-0 s2-0 (* (/ f28-0 4) (-> s3-0 sun1-scale))) (vector+float*! s5-0 s5-0 s4-0 (* (-> s3-0 moon-scale) f28-0)) ) (+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0))) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean.gc b/goal_src/jak2/engine/gfx/ocean/ocean.gc index 62da36dfac2..7b5f45ef3d1 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean.gc @@ -10,8 +10,8 @@ ;; DECOMP BEGINS (defmethod set-corners! ((this ocean) (corner-x float) (corner-z float)) - (let* ((f2-0 (* 0.00008138021 corner-x)) - (f3-0 (* 0.00008138021 corner-z)) + (let* ((f2-0 (/ corner-x (meters 3))) + (f3-0 (/ corner-z (meters 3))) (f0-2 f2-0) (f0-4 (- f0-2 (the float (the int f0-2)))) (f1-6 f3-0) @@ -41,8 +41,8 @@ ((and (-> this heights) *ocean-map*) (let* ((f30-0 (- (-> arg0 x) (-> this start-corner x))) (f28-0 (- (-> arg0 z) (-> this start-corner z))) - (v1-3 (the int (* 0.0000025431316 f30-0))) - (a0-2 (the int (* 0.0000025431316 f28-0))) + (v1-3 (the int (/ f30-0 (meters 96)))) + (a0-2 (the int (/ f28-0 (meters 96)))) (v1-7 (-> this ocean-trans-indices data (+ (* 48 a0-2) v1-3))) ) (cond @@ -53,8 +53,8 @@ ) ) ((begin - (let ((a0-8 (logand (the int (* 0.000010172526 f30-0)) 3)) - (a3-4 (logand (the int (* 0.000010172526 f28-0)) 3)) + (let ((a0-8 (logand (the int (/ f30-0 (meters 24))) 3)) + (a3-4 (logand (the int (/ f28-0 (meters 24))) 3)) (v1-10 (-> this ocean-near-indices data (-> v1-7 child))) ) (set! v1-12 (-> (the-as (pointer int16) (+ (* (+ (* a3-4 4) a0-8) 2) (the-as int v1-10))))) @@ -67,14 +67,12 @@ ) ) (else - (let ((a0-14 (logand (the int (* 0.00008138021 f30-0)) 7))) + (let ((a0-14 (logand (the int (/ f30-0 (meters 3))) 7))) (cond - ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) - (ash 1 a0-14) - ) + ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (/ f28-0 (meters 3))) 7)) (ash 1 a0-14)) ) (let* ((f1-2 (vector-vector-distance arg0 (math-camera-pos))) - (f26-0 (- 1.0 (fmin 1.0 (* 0.000010172526 f1-2)))) + (f26-0 (- 1.0 (fmin 1.0 (/ f1-2 (meters 24))))) ) (if (-> this ocean-near-translucent?) (+ (* f26-0 (set-corners! this f30-0 f28-0)) (-> this start-corner y)) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc index 19f648abfd1..72843110cce 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc @@ -251,8 +251,8 @@ (set! (-> arg1 radius) f28-0) (let ((f24-0 (sin f26-0)) (f26-1 (cos f26-0)) - (f22-0 (sin (* 0.5 f30-0))) - (f0-5 (cos (* 0.5 f30-0))) + (f22-0 (sin (/ f30-0 2))) + (f0-5 (cos (/ f30-0 2))) (a1-1 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) diff --git a/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc b/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc index 1ed1cd06d9d..0830a94dc98 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc @@ -77,13 +77,7 @@ across the screen. The resolution of the circle is defined by the number of "tur (let ((rot (* 65536.0 (/ (the float turn) (the float turns))))) (set-vector! (-> tbls entry entry-idx) (* (sin rot) cam-aspx) (* (cos rot) cam-aspy) 0.0 0.0) (let ((s3-1 (+ entry-idx 1))) - (set-vector! - (-> tbls entry s3-1) - (* 0.001953125 cam-aspx (sin rot)) - (* 0.001953125 cam-aspy (cos rot)) - 0.0 - 0.0 - ) + (set-vector! (-> tbls entry s3-1) (* (/ cam-aspx 512) (sin rot)) (* (/ cam-aspy 512) (cos rot)) 0.0 0.0) (set! entry-idx (+ s3-1 1)) ) ) @@ -92,7 +86,7 @@ across the screen. The resolution of the circle is defined by the number of "tur ) (set-vector! (-> tbls entry entry-idx) 0.0 cam-aspy 0.0 0.0) (let ((v1-20 (+ entry-idx 1))) - (set-vector! (-> tbls entry v1-20) 0.0 (* 0.001953125 cam-aspy) 0.0 0.0) + (set-vector! (-> tbls entry v1-20) 0.0 (/ cam-aspy 512) 0.0 0.0) (+ v1-20 1) ) ) diff --git a/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc b/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc index 6e7afd6d13d..cdeb2581d83 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc @@ -539,7 +539,7 @@ 1.0 ) (else - (let* ((f1-1 (* 0.00024414062 a0-5)) + (let* ((f1-1 (/ a0-5 METER_LENGTH)) (f0-4 (- f1-1 (the float (the int f1-1)))) ) (let ((f1-3 (* 4096.0 (- f1-1 f0-4)))) diff --git a/goal_src/jak2/engine/physics/dynamics-h.gc b/goal_src/jak2/engine/physics/dynamics-h.gc index d6ce5bf6294..3c164364be5 100644 --- a/goal_src/jak2/engine/physics/dynamics-h.gc +++ b/goal_src/jak2/engine/physics/dynamics-h.gc @@ -30,7 +30,7 @@ ) (defun time-to-apex ((arg0 float) (arg1 float)) - (the int (/ arg0 (- (* 0.0033333334 arg1)))) + (the int (/ arg0 (- (/ arg1 300)))) ) (defun time-to-ground ((arg0 float) (arg1 float) (arg2 float)) @@ -38,8 +38,8 @@ (v0-0 0) ) (while (< (- arg2) f0-0) - (set! arg0 (- arg0 (* 0.0033333334 arg1))) - (+! f0-0 (* 0.0033333334 arg0)) + (set! arg0 (- arg0 (/ arg1 300))) + (+! f0-0 (/ arg0 300)) (+! v0-0 1) ) v0-0 diff --git a/goal_src/jak2/engine/physics/rigid-body.gc b/goal_src/jak2/engine/physics/rigid-body.gc index a0451fdc6be..dace5696631 100644 --- a/goal_src/jak2/engine/physics/rigid-body.gc +++ b/goal_src/jak2/engine/physics/rigid-body.gc @@ -48,8 +48,8 @@ ) ) -(defmethod relocate ((this rigid-body-control) (arg0 int)) - (&+! (-> this process) arg0) +(defmethod relocate ((this rigid-body-control) (offset int)) + (&+! (-> this process) offset) this ) @@ -64,7 +64,7 @@ ) (matrix-identity! (-> this inertial-tensor)) (matrix-identity! (-> this inv-inertial-tensor)) - (let ((f0-4 (* 0.083333336 f24-0))) + (let ((f0-4 (/ f24-0 12))) (let* ((f1-1 f30-0) (f1-3 (* f1-1 f1-1)) (f2-0 f26-0) @@ -1023,11 +1023,11 @@ (defmethod init-from-entity! ((this rigid-body-object) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (allocate-and-init-cshape this) (process-drawable-from-entity! this arg0) (init-skel-and-rigid-body this) @@ -1410,7 +1410,7 @@ This commonly includes things such as: (f0-9 (/ 163840.0 (get-inv-mass a0-38))) ) (vector-reset! (-> this player-force)) - (set! (-> this player-force y) (* -0.1 f0-9 f30-2)) + (set! (-> this player-force y) (* (/ f0-9 -10) f30-2)) ) ) ) diff --git a/goal_src/jak2/engine/physics/trajectory.gc b/goal_src/jak2/engine/physics/trajectory.gc index cce583c1df6..c8c83ee8170 100644 --- a/goal_src/jak2/engine/physics/trajectory.gc +++ b/goal_src/jak2/engine/physics/trajectory.gc @@ -9,7 +9,7 @@ (defmethod compute-trans-at-time ((this trajectory) (arg0 float) (arg1 vector)) (vector+float*! arg1 (-> this initial-position) (-> this initial-velocity) arg0) - (+! (-> arg1 y) (* 0.5 arg0 arg0 (-> this gravity))) + (+! (-> arg1 y) (* (/ arg0 2) arg0 (-> this gravity))) arg1 ) @@ -31,7 +31,7 @@ (vector-! (-> this initial-velocity) arg1 arg0) (vector-xz-normalize! (-> this initial-velocity) f0-3) ) - (set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* 0.5 arg2 (-> this gravity)))) + (set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* (/ arg2 2) (-> this gravity)))) 0 (none) ) diff --git a/goal_src/jak2/engine/scene/scene.gc b/goal_src/jak2/engine/scene/scene.gc index aa96a1e8ad0..a7092162401 100644 --- a/goal_src/jak2/engine/scene/scene.gc +++ b/goal_src/jak2/engine/scene/scene.gc @@ -234,6 +234,7 @@ ) (defmethod deactivate ((this scene-player)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (set! *scene-player* (the-as (pointer scene-player) #f)) (kill-persister *setting-control* (the-as engine-pers 'blackout) 'bg-a-force) ((method-of-type process-drawable deactivate) this) @@ -241,23 +242,23 @@ ) ;; WARN: Return type mismatch process-drawable vs scene-player. -(defmethod relocate ((this scene-player) (arg0 int)) +(defmethod relocate ((this scene-player) (offset int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) - (set! (-> v1-0 relocating-offset) arg0) + (set! (-> v1-0 relocating-offset) offset) ) (let ((v1-2 (-> this scene-list))) (if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min)) (< (the-as int v1-2) (-> *kernel-context* relocating-max)) ) - (&+! (-> this scene-list) arg0) + (&+! (-> this scene-list) offset) ) ) - (the-as scene-player ((method-of-type process-drawable relocate) this arg0)) + (the-as scene-player ((method-of-type process-drawable relocate) this offset)) ) (defmethod scene-player-method-25 ((this scene-player) (arg0 float)) @@ -661,7 +662,7 @@ ) (let* ((v1-28 (-> s3-0 base)) (a2-23 - (+ (- 1793 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (* 0.5 (-> arg1 width))))) + (+ (- 1793 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2)))) ) (a3-8 (+ (the int (-> arg1 origin y)) 1841)) (a0-23 (+ a2-23 (-> arg0 width))) @@ -687,7 +688,7 @@ (&+! (-> s3-0 base) 112) (let* ((v1-32 (-> s3-0 base)) (a1-38 - (+ (- 1792 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (* 0.5 (-> arg1 width))))) + (+ (- 1792 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2)))) ) (a3-11 (+ (the int (-> arg1 origin y)) 1840)) (a0-30 (+ a1-38 (-> arg0 width))) @@ -1051,10 +1052,7 @@ (* 30.0 (seconds-per-frame)) (bucket-id screen-filter) ) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 0.05)) - (suspend) - ) + (suspend-for (seconds 0.05) ) (set! (-> *setting-control* user-current bg-a) 0.0) (remove-setting! 'movie) diff --git a/goal_src/jak2/engine/sound/gsound.gc b/goal_src/jak2/engine/sound/gsound.gc index eddaf653bd2..2ef21227973 100644 --- a/goal_src/jak2/engine/sound/gsound.gc +++ b/goal_src/jak2/engine/sound/gsound.gc @@ -13,6 +13,7 @@ (defmethod kill-callback ((this engine-sound-pers) (arg0 connection-pers)) + "Called when a connection is removed." (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) (set! (-> v1-0 id) (the-as sound-id (-> arg0 param-int64 0))) @@ -40,8 +41,9 @@ (kmemclose) -(defun sound-name= ((arg0 sound-name) (arg1 sound-name)) - (and (= (the-as uint arg0) (the-as uint arg1)) (= (-> arg0 hi) (-> arg1 hi))) +(defun sound-name= ((a sound-name) (b sound-name)) + "Are two sound names the same?" + (and (= (the-as uint a) (the-as uint b)) (= (-> a hi) (-> b hi))) ) (deftype sound-iop-info (structure) @@ -75,6 +77,7 @@ (define *sound-iop-info* (new 'global 'sound-iop-info)) (defun str-is-playing? () + "Is any streaming audio playing?" (countdown (v1-0 4) (if (and (>= (the-as uint (-> *sound-iop-info* stream-id v1-0)) 0) (logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status ststatus-four)) @@ -86,6 +89,7 @@ ) (defun str-id-is-playing? ((arg0 int)) + "Is any streaming audio with the given ID playing?" (countdown (v1-0 4) (if (and (= arg0 (-> *sound-iop-info* stream-id v1-0)) (logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status ststatus-one ststatus-six)) @@ -96,31 +100,35 @@ #f ) -(defun current-str-pos ((arg0 sound-id)) +(defun current-str-pos ((id sound-id)) + "Get the current stream position of the given sound ID, or -1 if it is not playing." (if (>= (-> *setting-control* user-current movie-skip-frame) 0.0) (return (the int (* 34.133335 (-> *setting-control* user-current movie-skip-frame)))) ) (dotimes (v1-5 4) - (if (= arg0 (-> *sound-iop-info* stream-id v1-5)) + (if (= id (-> *sound-iop-info* stream-id v1-5)) (return (the-as int (-> *sound-iop-info* stream-position v1-5))) ) ) -1 ) -(defun is-ramdisk-loaded? ((arg0 symbol)) +(defun is-ramdisk-loaded? ((name symbol)) + "Check if the ramdisk-name is set to this (unused)." (let ((gp-0 (-> *sound-iop-info* ramdisk-name)) - (s5-0 (symbol->string arg0)) + (s5-0 (symbol->string name)) ) (and (charp-prefix= (-> s5-0 data) gp-0) (= (-> gp-0 (length s5-0)) 46)) ) ) (defun is-cd-in? () + "Is the CD/DVD in the ps2?" (zero? (-> *sound-iop-info* nocd)) ) (defun new-sound-id () + "Allocate a new sound ID, used to identify a unique playback of a sound." (set! *current-sound-id* (+ *current-sound-id* 1)) (if (< (the-as int *current-sound-id*) #x10000) (set! *current-sound-id* (the-as sound-id #x10000)) @@ -129,6 +137,7 @@ ) (defun check-irx-version () + "Confirm OVERLORD version is correct and set up the sound-iop-info address so the OVERLORD can report back to the EE." (let ((gp-0 (the-as sound-rpc-get-irx-version (add-element *sound-loader-rpc*)))) (set! (-> gp-0 command) (sound-command get-irx-version)) (set! (-> gp-0 ee-addr) (&-> *sound-iop-info* frame)) @@ -145,22 +154,24 @@ 0 ) -(defun sound-bank-iop-store ((arg0 sound-name)) +(defun sound-bank-iop-store ((name sound-name)) + "Send a iop-store RPC to loader with the given name" (let ((gp-0 (new-sound-id))) (let ((v1-1 (the-as sound-rpc-bank-cmd (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command iop-store)) - (set! (-> v1-1 bank-name) arg0) + (set! (-> v1-1 bank-name) name) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) gp-0 ) ) -(defun sound-bank-iop-free ((arg0 sound-name)) +(defun sound-bank-iop-free ((name sound-name)) + "Send a iop-free RPC to loader with the given name" (let ((gp-0 (new-sound-id))) (let ((v1-1 (the-as sound-rpc-bank-cmd (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command iop-free)) - (set! (-> v1-1 bank-name) arg0) + (set! (-> v1-1 bank-name) name) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) gp-0 @@ -168,6 +179,7 @@ ) (defun sound-bank-load ((arg0 sound-name)) + "Send RPC to load a sound bank." (let ((gp-0 (new-sound-id))) (let ((v1-1 (the-as sound-rpc-load-bank (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command load-bank)) @@ -178,48 +190,53 @@ ) ) -(defun sound-bank-load-from-iop ((arg0 sound-name)) +(defun sound-bank-load-from-iop ((name sound-name)) + "Send load-bank-from-iop rpc to loader" (let ((gp-0 (new-sound-id))) (let ((v1-1 (the-as sound-rpc-load-bank (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command load-bank-from-iop)) - (set! (-> v1-1 bank-name) arg0) + (set! (-> v1-1 bank-name) name) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) gp-0 ) ) -(defun sound-bank-load-from-ee ((arg0 sound-name) (arg1 pointer)) +(defun sound-bank-load-from-ee ((name sound-name) (addr pointer)) + "Send load-bank-from-ee rpc to loader" (let ((gp-0 (new-sound-id))) (let ((v1-1 (the-as sound-rpc-load-bank (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command load-bank-from-ee)) - (set! (-> v1-1 bank-name) arg0) - (set! (-> v1-1 ee-addr) arg1) + (set! (-> v1-1 bank-name) name) + (set! (-> v1-1 ee-addr) addr) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) gp-0 ) ) -(defun sound-bank-unload ((arg0 sound-name)) +(defun sound-bank-unload ((name sound-name)) + "Send unload-bank rpc to loader" (let ((v1-1 (the-as sound-rpc-unload-bank (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command unload-bank)) - (set! (-> v1-1 bank-name) arg0) + (set! (-> v1-1 bank-name) name) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) 0 ) -(defun sound-music-load ((arg0 sound-name)) +(defun sound-music-load ((name sound-name)) + "Send load-music rpc to loader" (let ((v1-1 (the-as sound-rpc-load-music (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command load-music)) - (set! (-> v1-1 bank-name) arg0) + (set! (-> v1-1 bank-name) name) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) 0 ) (defun sound-music-unload () + "Send unload-music rpc to loader." (let ((v1-1 (the-as sound-rpc-unload-music (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command unload-music)) ) @@ -228,6 +245,7 @@ ) (defun set-language ((arg0 language-enum)) + "Send set-language rpc to loader. Note this is only for sound, no game text is changed." (kset-language arg0) (let ((v1-1 (the-as sound-rpc-set-language (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command set-language)) @@ -238,6 +256,7 @@ ) (defun sound-set-stereo-mode ((arg0 stereo-mode)) + "Send set-stereo-mode rpc to loader." (let ((v1-1 (the-as sound-rpc-set-stereo-mode (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command set-stereo-mode)) (set! (-> v1-1 mode) (the-as int arg0)) @@ -248,6 +267,7 @@ ) (defun list-sounds () + "Send list-sounds rpc to loader." (let ((v1-1 (the-as sound-rpc-list-sounds (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command list-sounds)) ) @@ -262,6 +282,7 @@ ) (defun sound-buffer-dump () + "Print out all sound-commands in the buffer." (let ((gp-0 (-> *sound-player-rpc* current elt-used)) (s5-0 (-> *sound-player-rpc* current elt-size)) ) @@ -299,6 +320,7 @@ (define *sound-player-enable* #t) (defun swap-sound-buffers ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Per-frame update of sound system - update loop-engine, update ear trans, send player RPC, check for missing/dirty CD." (run-pending-updates! *sound-loop-engine* (-> *display* base-clock frame-counter)) (cond ((check-busy *sound-player-rpc*) @@ -332,37 +354,42 @@ ) (defun get-sound-buffer-entry () + "Allocate a new entry in the player RPC queue, to be flushed on the next frame." (add-element *sound-player-rpc*) ) (defun free-last-sound-buffer-entry () + "Remove the last thing added with get-sound-buffer-entry." (decrement-elt-used *sound-player-rpc*) 0 (none) ) (defun sound-basic-cb ((arg0 int) (arg1 (pointer int32))) + "Unknown and unused callback." (set! (-> arg1 0) arg0) 0 (none) ) (defun sound-trans-convert ((arg0 vector3w) (arg1 vector)) + "Convert a GOAL translation (meters) to integer format for the IOP" (let ((v1-0 (if arg1 arg1 (ear-trans 0) ) ) ) - (set! (-> arg0 x) (the int (* 0.0625 (-> v1-0 x)))) - (set! (-> arg0 y) (the int (* 0.0625 (-> v1-0 y)))) - (set! (-> arg0 z) (the int (* 0.0625 (-> v1-0 z)))) + (set! (-> arg0 x) (the int (/ (-> v1-0 x) 16))) + (set! (-> arg0 y) (the int (/ (-> v1-0 y) 16))) + (set! (-> arg0 z) (the int (/ (-> v1-0 z) 16))) ) 0 ) -(defun sound-angle-convert ((arg0 float)) - (let* ((f0-3 (the float (sar (shl (the int arg0) 48) 48))) +(defun sound-angle-convert ((float-angle float)) + "Convert a GOAL angle to integer format for the iop" + (let* ((f0-3 (the float (sar (shl (the int float-angle) 48) 48))) (v0-0 (the int (* 0.005493164 f0-3))) ) (if (< v0-0 0) @@ -377,6 +404,7 @@ ;; WARN: Return type mismatch uint128 vs sound-name. (defun string->sound-name ((arg0 string)) + "Create a sound-name from a string" (let ((v1-0 (new 'stack-no-clear 'qword))) (set! (-> v1-0 quad) (the-as uint128 0)) (let ((a1-0 (the-as (pointer uint8) v1-0)) @@ -393,6 +421,7 @@ ) (defun sound-set-volume ((arg0 sound-group) (arg1 float)) + "Send set-master-volume rpc." (let ((v1-0 (the-as sound-rpc-set-master-volume (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-master-volume)) (set! (-> v1-0 group) arg0) @@ -401,18 +430,20 @@ 0 ) -(defun sound-set-reverb ((arg0 int) (arg1 float) (arg2 float) (arg3 uint)) +(defun sound-set-reverb ((reverb int) (left float) (right float) (core uint)) + "Send set-reverb rpc" (let ((v1-0 (the-as sound-rpc-set-reverb (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-reverb)) - (set! (-> v1-0 core) arg3) - (set! (-> v1-0 reverb) arg0) - (set! (-> v1-0 left) (the-as uint (the int (* 32767.0 arg1)))) - (set! (-> v1-0 right) (the-as uint (the int (* 32767.0 arg2)))) + (set! (-> v1-0 core) core) + (set! (-> v1-0 reverb) reverb) + (set! (-> v1-0 left) (the-as uint (the int (* 32767.0 left)))) + (set! (-> v1-0 right) (the-as uint (the int (* 32767.0 right)))) ) 0 ) (defun sound-set-ear-trans ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Send set-ear-trans rpc" (let ((gp-0 (the-as sound-rpc-set-ear-trans (get-sound-buffer-entry)))) (set! (-> gp-0 command) (sound-command set-ear-trans)) (sound-trans-convert (the-as vector3w (-> gp-0 ear-trans0)) arg0) @@ -424,8 +455,9 @@ ) (defbehavior sound-play-by-name process-drawable ((arg0 sound-name) (arg1 sound-id) (arg2 int) (arg3 int) (arg4 int) (arg5 sound-group) (arg6 object)) - "Last arg can by a symbol with value [[#t]], in which case it will pull `trans` [[vector]] off the current [[process-drawable]] -otherwise, an explicit [[vector]] can be provided" + "Send play rpc to play a sound! + Last arg can by a symbol with value [[#t]], in which case it will pull `trans` [[vector]] off the current [[process-drawable]] + otherwise, an explicit [[vector]] can be provided" (local-vars (sv-16 sound-group)) (set! sv-16 arg5) (let ((s4-0 arg6)) @@ -455,6 +487,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defbehavior sound-play-by-spec process-drawable ((arg0 sound-spec) (arg1 sound-id) (arg2 vector)) + "Send play rpc to play a sound!" (when *sound-player-enable* (let ((s5-0 (the-as sound-rpc-play (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command play)) @@ -483,37 +516,41 @@ otherwise, an explicit [[vector]] can be provided" arg1 ) -(defun sound-pause ((arg0 sound-id)) - (when (nonzero? arg0) +(defun sound-pause ((id sound-id)) + "Send pause-sound rpc to pause by id" + (when (nonzero? id) (let ((v1-1 (the-as sound-rpc-pause-sound (get-sound-buffer-entry)))) (set! (-> v1-1 command) (sound-command pause-sound)) - (set! (-> v1-1 id) arg0) + (set! (-> v1-1 id) id) ) ) 0 ) -(defun sound-stop ((arg0 sound-id)) - (when (nonzero? arg0) +(defun sound-stop ((id sound-id)) + "Send stop-sound rpc to stop by id" + (when (nonzero? id) (let ((v1-1 (the-as sound-rpc-stop-sound (get-sound-buffer-entry)))) (set! (-> v1-1 command) (sound-command stop-sound)) - (set! (-> v1-1 id) arg0) + (set! (-> v1-1 id) id) ) ) 0 ) -(defun sound-continue ((arg0 sound-id)) - (when (nonzero? arg0) +(defun sound-continue ((id sound-id)) + "Send continue-sound rpc to continue by id" + (when (nonzero? id) (let ((v1-1 (the-as sound-rpc-continue-sound (get-sound-buffer-entry)))) (set! (-> v1-1 command) (sound-command continue-sound)) - (set! (-> v1-1 id) arg0) + (set! (-> v1-1 id) id) ) ) 0 ) (defun sound-group-pause ((arg0 sound-group)) + "Send pause-group rpc" (let ((v1-0 (the-as sound-rpc-pause-group (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command pause-group)) (set! (-> v1-0 group) arg0) @@ -522,6 +559,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defun sound-group-stop ((arg0 sound-group)) + "Send stop-group rpc" (let ((v1-0 (the-as sound-rpc-stop-group (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command stop-group)) (set! (-> v1-0 group) arg0) @@ -530,6 +568,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defun sound-group-continue ((arg0 sound-group)) + "Send continue-group rpc" (let ((v1-0 (the-as sound-rpc-continue-group (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command continue-group)) (set! (-> v1-0 group) arg0) @@ -537,33 +576,37 @@ otherwise, an explicit [[vector]] can be provided" 0 ) -(defun sound-set-flava ((arg0 uint) (arg1 uint)) +(defun sound-set-flava ((flava uint) (excitement uint)) + "Send set-flava rpc" (let ((v1-0 (the-as sound-rpc-set-flava (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-flava)) - (set! (-> v1-0 flava) arg0) - (set! (-> v1-0 excitement) arg1) + (set! (-> v1-0 flava) flava) + (set! (-> v1-0 excitement) excitement) ) 0 ) -(defun sound-set-midi-reg ((arg0 int) (arg1 int)) +(defun sound-set-midi-reg ((reg int) (val int)) + "Send set-midi-reg rpc" (let ((v1-0 (the-as sound-rpc-set-midi-reg (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-midi-reg)) - (set! (-> v1-0 reg) arg0) - (set! (-> v1-0 value) arg1) + (set! (-> v1-0 reg) reg) + (set! (-> v1-0 value) val) ) 0 ) -(defun sound-set-fps ((arg0 int)) +(defun sound-set-fps ((fps int)) + "Send set-fps rpc" (let ((v1-0 (the-as sound-rpc-set-fps (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-fps)) - (set! (-> v1-0 fps) (the-as uint arg0)) + (set! (-> v1-0 fps) (the-as uint fps)) ) 0 ) (defun sound-volume-off () + "Adjust settings to turn all sound volume off" (set-setting! 'music-volume 'abs 0.0 0) (set-setting! 'sfx-volume 'abs 0.0 0) (set-setting! 'ambient-volume 'abs 0.0 0) @@ -574,6 +617,7 @@ otherwise, an explicit [[vector]] can be provided" ;; WARN: Return type mismatch object vs ambient-sound. (defmethod new ambient-sound ((allocation symbol) (type-to-make type) (arg0 basic) (arg1 vector)) + "Set up ambient-sound. Can use an entity-actor (grabs from lump), sound-spec, or name as a string." (local-vars (sv-16 sound-spec) (sv-32 sound-name) @@ -679,6 +723,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defmethod update! ((this ambient-sound)) + "Per-frame update of ambient sound." (with-pp (if (not *ambient-sound-class*) (return (the-as int #f)) @@ -772,6 +817,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defmethod update-trans! ((this ambient-sound) (arg0 vector)) + "Change the trans of the sound." (with-pp (set! (-> this trans quad) (-> arg0 quad)) (when (nonzero? (-> this playing-id)) @@ -798,6 +844,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defmethod update-vol! ((this ambient-sound) (arg0 float)) + "Change the volume of the sound." (when (nonzero? (-> this playing-id)) (when *sound-player-enable* (let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -831,21 +878,23 @@ otherwise, an explicit [[vector]] can be provided" ) (defmethod set-falloff-far! ((this ambient-sound) (arg0 float)) - (set! (-> this falloff-far) (the int (* 0.00024414062 arg0))) + (set! (-> this falloff-far) (the int (/ arg0 METER_LENGTH))) 0 (none) ) -(defmethod change-sound! ((this ambient-sound) (arg0 sound-name)) - (when (not (and (= (the-as uint (-> this name)) (the-as uint arg0)) (= (-> arg0 hi) (-> this name hi)))) +(defmethod change-sound! ((this ambient-sound) (new-sound sound-name)) + "Change the sound being played." + (when (not (and (= (the-as uint (-> this name)) (the-as uint new-sound)) (= (-> new-sound hi) (-> this name hi)))) (stop! this) (set! (-> this playing-id) (new-sound-id)) - (set! (-> this name) arg0) + (set! (-> this name) new-sound) ) 0 ) (defun show-iop-info ((arg0 dma-buffer)) + "Display iop info on screen." (dotimes (s5-0 24) (draw-string-xy (if (zero? (-> *sound-iop-info* chinfo s5-0)) @@ -898,7 +947,8 @@ otherwise, an explicit [[vector]] can be provided" 0 ) -(defun show-iop-memory ((arg0 dma-buffer)) +(defun show-iop-memory ((dma dma-buffer)) + "Display iop memory stats on screen" (let ((s5-0 draw-string-xy)) (format (clear *temp-string*) @@ -906,7 +956,7 @@ otherwise, an explicit [[vector]] can be provided" (-> *sound-iop-info* freemem) (shr (-> *sound-iop-info* freemem) 10) ) - (s5-0 *temp-string* arg0 32 96 (font-color default) (font-flags shadow)) + (s5-0 *temp-string* dma 32 96 (font-color default) (font-flags shadow)) ) (let ((s5-1 draw-string-xy)) (format @@ -915,12 +965,13 @@ otherwise, an explicit [[vector]] can be provided" (-> *sound-iop-info* freemem2) (shr (-> *sound-iop-info* freemem2) 10) ) - (s5-1 *temp-string* arg0 32 64 (font-color default) (font-flags shadow)) + (s5-1 *temp-string* dma 32 64 (font-color default) (font-flags shadow)) ) 0 ) (defun ear-trans ((arg0 int)) + "Get the current location of the ear. Use 1 for the settings ear-handle, or 0 for the camera." (cond ((or (movie?) *external-cam-mode*) (math-camera-pos) @@ -935,6 +986,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defun-debug make-sqrt-table () + "Generate integer square-root table used in the IOP." (format #t "static int sqrt_table[256] =~%{~%") (dotimes (gp-0 256) (let* ((f0-2 (sqrtf (* 16777216.0 (the float gp-0)))) @@ -968,11 +1020,12 @@ otherwise, an explicit [[vector]] can be provided" ) ) -(defun loader-test-command ((arg0 sound-command) (arg1 uint)) +(defun loader-test-command ((cmd sound-command) (param uint)) + "Send a command to loader by ID." (let ((v1-1 (the-as sound-rpc-test-cmd (add-element *sound-loader-rpc*)))) - (set! (-> v1-1 command) arg0) + (set! (-> v1-1 command) cmd) (set! (-> v1-1 ee-addr) (the-as pointer 0)) - (set! (-> v1-1 param0) arg1) + (set! (-> v1-1 param0) param) ) (call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0)) (sync *sound-loader-rpc* #f) @@ -980,12 +1033,13 @@ otherwise, an explicit [[vector]] can be provided" (none) ) -(defun doppler-pitch-shift ((arg0 vector) (arg1 vector)) +(defun doppler-pitch-shift ((sound-pos vector) (sound-vel vector)) + "Compute pitch shift for the doppler effect. This is done assuming the listener is *target* and has *target*'s velocity." (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 2))) - (vector-! (-> gp-0 0) (target-pos 0) arg0) + (vector-! (-> gp-0 0) (target-pos 0) sound-pos) (if *target* - (vector-! (-> gp-0 1) arg1 (-> *target* control transv)) - (set! (-> gp-0 1 quad) (-> arg1 quad)) + (vector-! (-> gp-0 1) sound-vel (-> *target* control transv)) + (set! (-> gp-0 1 quad) (-> sound-vel quad)) ) (vector-normalize! (-> gp-0 0) 1.0) (let ((f0-1 (/ 1228800.0 (fmax 0.1 (- 1228800.0 (vector-dot (-> gp-0 0) (-> gp-0 1))))))) @@ -995,6 +1049,7 @@ otherwise, an explicit [[vector]] can be provided" ) (defun sound-bank-reload () + "Start a background process to unload all sound banks, then load them again." (process-spawn-function process (lambda () @@ -1008,10 +1063,7 @@ otherwise, an explicit [[vector]] can be provided" (set! (-> a1-3 0) 'empty0) (want-sound-banks *load-state* a1-3) ) - (let ((s5-0 (current-time))) - (until (time-elapsed? s5-0 (seconds 1)) - (suspend) - ) + (suspend-for (seconds 1) ) (let ((a1-4 (new 'stack-no-clear 'array 'symbol 4))) (set! (-> a1-4 2) (-> gp-0 2)) diff --git a/goal_src/jak2/engine/target/board/board-states.gc b/goal_src/jak2/engine/target/board/board-states.gc index 86c17d80dc9..fa5fcec98fc 100644 --- a/goal_src/jak2/engine/target/board/board-states.gc +++ b/goal_src/jak2/engine/target/board/board-states.gc @@ -66,8 +66,8 @@ ) ) (set! (-> self board turn-anim-targ) (+ (lerp-scale - (* 0.5 (-> *TARGET_BOARD-bank* turn-frames)) - (* -0.5 (-> *TARGET_BOARD-bank* turn-frames)) + (/ (-> *TARGET_BOARD-bank* turn-frames) 2) + (/ (-> *TARGET_BOARD-bank* turn-frames) -2) f26-0 -5461.3335 5461.3335 @@ -80,8 +80,8 @@ 32768.0 ) (lerp-scale - (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) - (* -0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (/ (-> *TARGET_BOARD-bank* turn-frames) 5) + (/ (-> *TARGET_BOARD-bank* turn-frames) -5) (-> self board turn-anim-mag) 1.0 -1.0 @@ -89,7 +89,7 @@ ) ) (when (and (or (< (* f30-0 (-> self board turn-anim-targ)) 0.0) (= f30-0 0.0)) - (and (< (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) (fabs (- f30-0 (-> self board turn-anim-targ)))) + (and (< (/ (-> *TARGET_BOARD-bank* turn-frames) 5) (fabs (- f30-0 (-> self board turn-anim-targ)))) (>= (current-time) (-> self control turn-lockout-end-time)) ) ) @@ -2187,7 +2187,7 @@ (else (let ((f30-1 (* (lerp-scale 0.7 1.0 (fabs (-> self board ride-lean)) 0.0 1.0) - (lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (* 0.5 (-> self control mod-surface transv-max))) + (lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (/ (-> self control mod-surface transv-max) 2)) ) ) (f0-23 @@ -2973,7 +2973,8 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (move-to-point! (-> self control) s4-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) diff --git a/goal_src/jak2/engine/target/board/target-board.gc b/goal_src/jak2/engine/target/board/target-board.gc index d969759d7c7..5edaf54d2e1 100644 --- a/goal_src/jak2/engine/target/board/target-board.gc +++ b/goal_src/jak2/engine/target/board/target-board.gc @@ -166,7 +166,7 @@ (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) (set! (-> arg0 seek0) (lerp-scale - (* 0.1 (-> arg0 seek0)) + (/ (-> arg0 seek0) 10) (-> arg0 seek0) (the float (- (current-time) (-> self board spin-time))) 0.0 @@ -175,7 +175,7 @@ ) (set! (-> arg0 seek90) (lerp-scale - (* 0.1 (-> arg0 seek90)) + (/ (-> arg0 seek90) 10) (-> arg0 seek90) (the float (- (current-time) (-> self board spin-time))) 0.0 @@ -191,8 +191,8 @@ (when (not (time-elapsed? (-> self board spin-ground-start-time) (seconds 0.3))) (set-time! (-> self control last-attack-end-time)) (set-time! (-> self board spin-ground-time)) - (set! (-> arg0 seek0) (* 0.1 (-> arg0 seek0))) - (set! (-> arg0 seek90) (* 0.1 (-> arg0 seek90))) + (set! (-> arg0 seek0) (/ (-> arg0 seek0) 10)) + (set! (-> arg0 seek90) (/ (-> arg0 seek90) 10)) (set! (-> arg0 vel-turn) 131072.0) (set! (-> arg0 turnv) 91022.22) ) @@ -1749,7 +1749,7 @@ (< 0.98 (vector-dot (-> self board unknown-vector01) (-> self control standard-dynamics gravity-normal))) (< f26-0 8192.0) (< f30-0 8192.0) - (or (< (* 0.2 f28-0) f30-0) (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)))) + (or (< (/ f28-0 5) f30-0) (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)))) ) (vector+float*! (-> self control transv) @@ -2065,7 +2065,7 @@ (set! (-> s2-0 start-pos quad) (-> v1-2 prim-core world-sphere quad)) (set! (-> s2-0 move-dist quad) (-> arg1 quad)) (let ((a0-3 s2-0)) - (set! (-> a0-3 radius) (* 0.5 (-> v1-2 prim-core world-sphere w))) + (set! (-> a0-3 radius) (/ (-> v1-2 prim-core world-sphere w) 2)) (set! (-> a0-3 collide-with) (-> v1-2 prim-core collide-with)) (set! (-> a0-3 ignore-process0) (-> arg0 process)) (set! (-> a0-3 ignore-process1) #f) @@ -2466,7 +2466,7 @@ (let* ((f30-0 (-> self board ride-speed)) (f0-4 (lerp-scale (-> self control current-surface fric) - (* 0.2 (-> self control current-surface fric)) + (/ (-> self control current-surface fric) 5) f30-0 0.0 (-> self control current-surface transv-max) diff --git a/goal_src/jak2/engine/target/collide-reaction-target.gc b/goal_src/jak2/engine/target/collide-reaction-target.gc index e5b31465a34..61f3a50b39b 100644 --- a/goal_src/jak2/engine/target/collide-reaction-target.gc +++ b/goal_src/jak2/engine/target/collide-reaction-target.gc @@ -151,7 +151,7 @@ ) (when (and (or (and (< f0-27 0.95) (>= f30-0 0.0)) (and (logtest? sv-32 (cshape-reaction-flags csrf05)) (< f0-27 0.3)) - (< f1-11 (* -0.25 (-> arg1 best-my-prim local-sphere w))) + (< f1-11 (/ (-> arg1 best-my-prim local-sphere w) -4)) ) (>= (vector-dot tangent contact-normal) -0.000001) ) diff --git a/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc b/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc index fa3c2e4efbb..ad1b0e2ece9 100644 --- a/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc @@ -103,7 +103,7 @@ (vector-normalize! s5-1 1.0) (launch-particles (-> *part-id-table* 224) gp-0) (let ((s3-0 (new 'stack-no-clear 'matrix)) - (f28-1 (* 0.000015258789 f30-0)) + (f28-1 (/ f30-0 (meters 16))) (f30-1 (-> *part-id-table* 226 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-0 s5-1 *up-vector*) diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index ac40e8a1aba..9ab02ce1ac1 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -635,7 +635,7 @@ (set! f2-0 (-> a1-3 a2-6 w)) ) ) - (let ((f1-1 (* 0.0625 f1-0))) + (let ((f1-1 (/ f1-0 16))) (set! (-> self control idx-of-fastest-xz-vel) a0-3) (set! (-> self control average-xz-vel) f1-1) (if (logtest? (-> self control current-surface flags) (surface-flag no-turn-around)) @@ -3304,6 +3304,7 @@ ) (defmethod deactivate ((this target)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (kill-persister *setting-control* (the-as engine-pers 'bg-a-speed) 'bg-a-speed) (if (nonzero? (-> this darkjak)) (sound-stop (-> this darkjak tone)) diff --git a/goal_src/jak2/engine/target/mech/mech-part.gc b/goal_src/jak2/engine/target/mech/mech-part.gc index c8bd36950ce..8c69c388d2d 100644 --- a/goal_src/jak2/engine/target/mech/mech-part.gc +++ b/goal_src/jak2/engine/target/mech/mech-part.gc @@ -153,7 +153,7 @@ (quaternion-rotate-local-x! s1-0 s1-0 32768.0) (let ((a0-3 s0-0)) (let ((v1-10 arg1)) - (let ((a1-4 (* 0.5 arg4))) + (let ((a1-4 (/ arg4 2))) (.mov vf7 a1-4) ) (.lvf vf5 (&-> arg2 quad)) diff --git a/goal_src/jak2/engine/target/mech/mech-states.gc b/goal_src/jak2/engine/target/mech/mech-states.gc index 58119ea312f..1ecab42caba 100644 --- a/goal_src/jak2/engine/target/mech/mech-states.gc +++ b/goal_src/jak2/engine/target/mech/mech-states.gc @@ -776,7 +776,7 @@ (else (seek! (-> self mech jump-thrust) 0.0 (* 491520.0 (seconds-per-frame))) (set! (-> self mech thruster-flame-width) (* 0.021428572 (-> self mech jump-thrust))) - (set! (-> self mech thruster-flame-length) (* 0.028571429 (-> self mech jump-thrust))) + (set! (-> self mech thruster-flame-length) (/ (-> self mech jump-thrust) 35)) ) ) ) @@ -1002,7 +1002,8 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (move-to-point! (-> self control) s4-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) @@ -1137,7 +1138,9 @@ ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-mech-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (suspend-for (seconds 0.8) (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5))) + (suspend-for (seconds 0.8) + (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5)) + ) (remove-setting! 'mode-name) ) (else @@ -1257,7 +1260,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ) (set! (-> self control transv quad) (the-as uint128 0)) @@ -1281,7 +1285,7 @@ (dotimes (s4-0 1) ((method-of-type sphere new) (the-as symbol (+ (the-as uint s5-0) (* s4-0 16))) sphere) ) - (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> (the-as sphere (&-> s5-0 x)) quad) (-> self control collision-spheres 2 prim-core world-sphere quad) ) @@ -2106,7 +2110,7 @@ (* 491520.0 (seconds-per-frame)) ) (set! (-> self mech thruster-flame-width) (* 0.021428572 (-> self mech jump-thrust))) - (set! (-> self mech thruster-flame-length) (* 0.028571429 (-> self mech jump-thrust))) + (set! (-> self mech thruster-flame-length) (/ (-> self mech jump-thrust) 35)) (let ((v1-120 (ja-group))) (if (and v1-120 (or (= v1-120 jakb-mech-push-ja) (= v1-120 jakb-mech-pull-ja))) (ja :num! (loop! f26-1)) diff --git a/goal_src/jak2/engine/target/surface-h.gc b/goal_src/jak2/engine/target/surface-h.gc index cc51e034c05..c45d9f6acfa 100644 --- a/goal_src/jak2/engine/target/surface-h.gc +++ b/goal_src/jak2/engine/target/surface-h.gc @@ -67,6 +67,9 @@ ;; DECOMP BEGINS (deftype surface (basic) + "Definition of a bunch of parameters for different types of surfaces. +Parameters include values such as max speed, friction, callback functions that run +on impact, during touch, on exit, etc." ((name symbol) (turnv float) (turnvv float) @@ -111,17 +114,17 @@ (defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float)) - (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1) + (- (* (/ (- (/ arg0 60) arg1) arg2) (- 1.0 arg2)) arg1) ) (defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))) + (let ((f0-4 (sqrtf (/ (- (/ arg0 60) arg1) arg2)))) (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))) ) ) (defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float)) - (let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))) + (let ((f0-5 (sqrtf (sqrtf (/ (- (/ arg0 60) arg1) arg2))))) (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))) ) ) diff --git a/goal_src/jak2/engine/target/target-anim.gc b/goal_src/jak2/engine/target/target-anim.gc index dc37275a28e..415289f71ef 100644 --- a/goal_src/jak2/engine/target/target-anim.gc +++ b/goal_src/jak2/engine/target/target-anim.gc @@ -662,7 +662,7 @@ ) ((lambda :behavior target () - (let ((f30-0 (fmax 0.8 (fmin 1.0 (* 0.000048828126 (-> self control ctrl-xz-vel)))))) + (let ((f30-0 (fmax 0.8 (fmin 1.0 (/ (-> self control ctrl-xz-vel) (meters 5)))))) (cond ((and (rand-vu-percent? 0.3) (< 20480.0 (-> self control ctrl-xz-vel))) (ja-no-eval :group! jakb-attack-from-stance-alt-end-ja :num! (seek! (ja-aframe 29.0 0) f30-0) :frame-num 0.0) @@ -1020,10 +1020,10 @@ ) ) (let ((f0-37 (fabs (- f20-0 f30-0)))) - (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-37))))) + (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (/ f0-37 4))))) ) (let ((f0-42 (fabs (- f22-1 f28-0)))) - (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (* 0.25 f0-42))))) + (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (/ f0-42 4))))) ) ) (set! (-> self control unknown-float-n12iuh3n1) f30-0) @@ -1556,7 +1556,7 @@ (let ((f0-11 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not (or (and (< (fabs (/ f0-11 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) + (while (not (or (and (< (fabs (/ f0-11 (/ f1-1 300))) 150.0) (< f1-1 0.0)) (time-elapsed? (-> self state-time) (seconds 1.7)) ) ) diff --git a/goal_src/jak2/engine/target/target-carry.gc b/goal_src/jak2/engine/target/target-carry.gc index b8e08d11161..d6605e2c682 100644 --- a/goal_src/jak2/engine/target/target-carry.gc +++ b/goal_src/jak2/engine/target/target-carry.gc @@ -82,7 +82,7 @@ (dotimes (s4-0 1) ((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere) ) - (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> s5-0 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) (set! (-> s5-0 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-0 0.0 1.0)) (let ((v1-17 gp-0)) diff --git a/goal_src/jak2/engine/target/target-darkjak.gc b/goal_src/jak2/engine/target/target-darkjak.gc index 2c4de6d5450..d4c95bb1b7a 100644 --- a/goal_src/jak2/engine/target/target-darkjak.gc +++ b/goal_src/jak2/engine/target/target-darkjak.gc @@ -599,7 +599,7 @@ (set-setting! 'rapid-tracking #f 0.0 0) ((lambda :behavior target () - (set! (-> self control bend-target) (* 0.5 (-> self control bend-target))) + (set! (-> self control bend-target) (/ (-> self control bend-target) 2)) (if (logtest? (water-flags touch-water) (-> self water flags)) (sound-play "swim-stroke") ) diff --git a/goal_src/jak2/engine/target/target-death.gc b/goal_src/jak2/engine/target/target-death.gc index 73756f24a2b..b8ca552f552 100644 --- a/goal_src/jak2/engine/target/target-death.gc +++ b/goal_src/jak2/engine/target/target-death.gc @@ -310,7 +310,8 @@ ) ) ) - (suspend-for (seconds 0.05)) + (suspend-for (seconds 0.05) + ) ) ((logtest? (-> arg0 flags) (continue-flags title)) (go target-title #t) @@ -333,7 +334,8 @@ (intro-play) ) ((logtest? (-> arg0 flags) (continue-flags warp-gate)) - (suspend-for (seconds 0.05)) + (suspend-for (seconds 0.05) + ) (let ((s5-8 (new 'static 'vector)) (a2-26 (find-nearest-entity (-> arg0 trans) warp-gate)) ) @@ -362,7 +364,8 @@ (go target-grab 'stance) ) (else - (suspend-for (seconds 0.05)) + (suspend-for (seconds 0.05) + ) ) ) (let* ((a0-122 *game-info*) @@ -981,7 +984,7 @@ (set! (-> sv-32 vector y) (-> sv-32 shove-up)) ) (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) - (set! (-> sv-32 damage) (fmax 1.0 (ceil (* 0.5 (-> sv-32 damage))))) + (set! (-> sv-32 damage) (fmax 1.0 (ceil (/ (-> sv-32 damage) 2)))) (if (< (- (-> self fact health) (-> sv-32 damage)) 1.0) (set! (-> sv-32 damage) (+ -1.0 (-> self fact health))) ) @@ -1013,7 +1016,8 @@ (let ((gp-1 (new-stack-vector0))) (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (move-to-point! (-> self control) gp-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) @@ -1628,7 +1632,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (b! #t cfg-131 :delay (nop!)) (label cfg-79) (b! (not (or (= v1-63 'grenade) (= v1-63 'big-explosion) (= v1-63 'explode))) cfg-122 :delay (empty-form)) @@ -1739,7 +1744,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) (b! #t cfg-131 :delay (nop!)) (label cfg-122) @@ -1788,7 +1794,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ) (label cfg-131) @@ -1804,7 +1811,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (suspend-for (seconds 1.2)) + (suspend-for (seconds 1.2) + ) ) ((= v1-50 'endlessfall) ((lambda :behavior target @@ -1842,8 +1850,7 @@ (target-falling-anim 30 (seconds 0.33)) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (suspend-for - (seconds 0.8) + (suspend-for (seconds 0.8) (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) (set! v1-24 'target-hit-ground-hard) (goto cfg-17) @@ -1886,7 +1893,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) (remove-setting! 'mode-name) (none) @@ -1975,7 +1983,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ((= v1-50 'centipede) (set! (-> self trans-hook) #f) diff --git a/goal_src/jak2/engine/target/target-gun.gc b/goal_src/jak2/engine/target/target-gun.gc index 071159e24f7..f42547f3908 100644 --- a/goal_src/jak2/engine/target/target-gun.gc +++ b/goal_src/jak2/engine/target/target-gun.gc @@ -1637,7 +1637,7 @@ (dotimes (s4-1 1) ((method-of-type sphere new) (the-as symbol (-> s5-2 s4-1)) sphere) ) - (let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> s5-2 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) (set! (-> s5-2 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-1 0.0 1.0)) (let ((v1-212 gp-3)) @@ -1726,7 +1726,7 @@ (let* ((f0-28 (deg-diff (y-angle (-> self control)) (vector-y-angle (-> self control to-target-pt-xz)))) (f0-30 (fmax -5461.3335 (fmin 5461.3335 f0-28))) ) - (seek! (-> self upper-body twist z) f0-30 (fabs (* 0.2 f0-30))) + (seek! (-> self upper-body twist z) f0-30 (fabs (/ f0-30 5))) ) ) ) diff --git a/goal_src/jak2/engine/target/target-swim.gc b/goal_src/jak2/engine/target/target-swim.gc index 71eb0014ada..8b21f4614f0 100644 --- a/goal_src/jak2/engine/target/target-swim.gc +++ b/goal_src/jak2/engine/target/target-swim.gc @@ -181,10 +181,10 @@ (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x))))) ) (let ((f1-4 (fabs (- f0-10 f28-0)))) - (set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (* 0.25 f1-4))))) + (set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (/ f1-4 4))))) ) (let ((f0-14 (fabs (- f24-0 f26-0)))) - (set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))) + (set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (/ f0-14 4))))) ) ) (ja :chan 3 :group! jakb-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist)) diff --git a/goal_src/jak2/engine/target/target-tube.gc b/goal_src/jak2/engine/target/target-tube.gc index bacc5476fbb..46f31e8c584 100644 --- a/goal_src/jak2/engine/target/target-tube.gc +++ b/goal_src/jak2/engine/target/target-tube.gc @@ -813,7 +813,7 @@ (f2-0 f1-2) ) (if (< f0-2 0.0) - (set! f0-2 (* 0.5 f0-2)) + (set! f0-2 (/ f0-2 2)) ) (vector+! (-> arg1 vector) @@ -1087,11 +1087,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this slide-control) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/goal_src/jak2/engine/target/target-turret-shot.gc b/goal_src/jak2/engine/target/target-turret-shot.gc index 68da24d5a4d..420c0687c45 100644 --- a/goal_src/jak2/engine/target/target-turret-shot.gc +++ b/goal_src/jak2/engine/target/target-turret-shot.gc @@ -271,7 +271,7 @@ (launch-particles (-> *part-id-table* 608) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 923 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 923 init-specs 4 initial-valuef)) ) diff --git a/goal_src/jak2/engine/target/target-turret.gc b/goal_src/jak2/engine/target/target-turret.gc index ed6a94541ce..c94c13d82e6 100644 --- a/goal_src/jak2/engine/target/target-turret.gc +++ b/goal_src/jak2/engine/target/target-turret.gc @@ -384,7 +384,7 @@ ) ) (set! (-> this sprites 28 color w) - (the int (* 0.00390625 (-> this fade-interp) (the float (-> this values 2 current)))) + (the int (* (/ (-> this fade-interp) 256) (the float (-> this values 2 current)))) ) (set-as-offset-from! (-> this sprites 28) diff --git a/goal_src/jak2/engine/target/target-util.gc b/goal_src/jak2/engine/target/target-util.gc index 3f4836a711c..8b9225a4d5d 100644 --- a/goal_src/jak2/engine/target/target-util.gc +++ b/goal_src/jak2/engine/target/target-util.gc @@ -1080,7 +1080,7 @@ ) ) ) - (* 0.125 f30-0) + (/ f30-0 8) ) ) @@ -1720,10 +1720,10 @@ (f30-0 (fmax -1.0 (fmin 1.0 arg2))) ) (let ((f1-5 (fabs (- f0-1 (-> arg0 blend 1))))) - (seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + (seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (/ arg3 5))) ) (let ((f0-9 (fabs (- f30-0 (-> arg0 blend 2))))) - (seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + (seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (/ arg3 5))) ) ) (cond @@ -1897,8 +1897,8 @@ (cond ((and (< 0.0 f0-4) (focus-test? this in-air)) (let* ((v0-1 (new 'static 'vector)) - (f0-5 (+ (* 0.0016666667 (-> v1-0 dynam gravity-length)) f0-4)) - (f0-8 (/ (* 0.5 f0-5 f0-5) (-> v1-0 dynam gravity-length))) + (f0-5 (+ (/ (-> v1-0 dynam gravity-length) 600) f0-4)) + (f0-8 (/ (* (/ f0-5 2) f0-5) (-> v1-0 dynam gravity-length))) ) (vector+float*! v0-1 (-> v1-0 trans) (-> v1-0 dynam gravity-normal) f0-8) ) diff --git a/goal_src/jak2/engine/target/target.gc b/goal_src/jak2/engine/target/target.gc index 3b38f56391c..5acb706a2b2 100644 --- a/goal_src/jak2/engine/target/target.gc +++ b/goal_src/jak2/engine/target/target.gc @@ -494,11 +494,11 @@ (delete-back-vel) (let* ((f0-4 arg5) (f1-2 0.0) - (f2-2 (+ (* 0.0016666667 (-> self control dynam gravity-length)) + (f2-2 (+ (/ (-> self control dynam gravity-length) 600) (fmax 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) ) - (f0-5 (* f0-4 (fmax f1-2 (/ (* 0.5 f2-2 f2-2) (-> self control dynam gravity-length))))) + (f0-5 (* f0-4 (fmax f1-2 (/ (* (/ f2-2 2) f2-2) (-> self control dynam gravity-length))))) (s3-1 (+ arg0 f0-5)) ) (let ((s2-1 (+ arg1 f0-5))) @@ -626,7 +626,7 @@ (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) (darkjak-stage giant)) ) - (set! (-> v1-62 y) (* 0.5 (-> v1-62 y))) + (set! (-> v1-62 y) (/ (-> v1-62 y) 2)) ) (set! v0-1 (-> self control anim-collide-offset-local)) (set! (-> v0-1 quad) (-> v1-62 quad)) @@ -2645,7 +2645,7 @@ ) (else (let* ((f1-5 (/ f0-2 (* (-> self control dynam gravity-length) (seconds-per-frame)))) - (f0-7 (* 0.5 f1-5 (seconds-per-frame) f0-2)) + (f0-7 (* (/ f1-5 2) (seconds-per-frame) f0-2)) ) (let ((v1-22 (ja-group))) (if (and v1-22 diff --git a/goal_src/jak2/engine/target/target2.gc b/goal_src/jak2/engine/target/target2.gc index 13f2b540ac0..95b3f637057 100644 --- a/goal_src/jak2/engine/target/target2.gc +++ b/goal_src/jak2/engine/target/target2.gc @@ -50,7 +50,10 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 0.3) (suspend) (ja :num! (seek! (ja-aframe 19.0 0) 0.05))) + (suspend-for (seconds 0.3) + (suspend) + (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) + ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-painful-land-ja :num! (seek!) :frame-num (ja-aframe 40.0 0)) (until (ja-done? 0) @@ -649,7 +652,7 @@ (let ((f0-1 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not (and (< (fabs (/ f0-1 (* 0.0033333334 f1-1))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) + (while (not (and (< (fabs (/ f0-1 (/ f1-1 300))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) (suspend) (ja :num! (loop!)) (set! f0-1 (target-height-above-ground)) @@ -1196,7 +1199,9 @@ (until #f (let ((s5-0 (rand-vu-int-range 30 600))) (ja :group! jakb-wall-hide-head-ja) - (suspend-for s5-0 (gp-0)) + (suspend-for s5-0 + (gp-0) + ) ) (let ((f30-0 (rand-vu-float-range 0.5 1.5))) (cond @@ -1234,7 +1239,9 @@ (ja :num! (seek! max f30-0)) ) (let ((s5-2 (rand-vu-int-range 60 300))) - (suspend-for s5-2 (gp-0)) + (suspend-for s5-2 + (gp-0) + ) ) (ja-no-eval :group! jakb-wall-hide-head-left-ja :num! (seek! 0.0 f30-0) :frame-num max) (until (ja-done? 0) @@ -1251,7 +1258,9 @@ (ja :num! (seek! 0.0 f30-0)) ) (let ((s5-3 (rand-vu-int-range 60 300))) - (suspend-for s5-3 (gp-0)) + (suspend-for s5-3 + (gp-0) + ) ) (ja-no-eval :group! jakb-wall-hide-head-right-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak2/engine/ui/hud.gc b/goal_src/jak2/engine/ui/hud.gc index 4bcd99e92d9..958e1e7e2dc 100644 --- a/goal_src/jak2/engine/ui/hud.gc +++ b/goal_src/jak2/engine/ui/hud.gc @@ -924,7 +924,7 @@ :code (behavior () (until #f (if (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask pause))) - (seek! (-> self offset) 0.0 (* 0.1 (-> self clock time-adjust-ratio))) + (seek! (-> self offset) 0.0 (/ (-> self clock time-adjust-ratio) 10)) ) (if (>= 0.0 (-> self offset)) (go hud-in) diff --git a/goal_src/jak2/engine/ui/minimap.gc b/goal_src/jak2/engine/ui/minimap.gc index 1c8b2ea943a..42adbd42b2e 100644 --- a/goal_src/jak2/engine/ui/minimap.gc +++ b/goal_src/jak2/engine/ui/minimap.gc @@ -1134,6 +1134,10 @@ (defmethod run-pending-updates! ((this engine-minimap) (arg0 time-frame)) + "Run updates if they scheduled. If something is found that has no pending update, kill it. + Note that we won't kill things on this call if they fail to update their `update-time`. + They will survive until the next call to `run-pending-updates`! + (or you can modify their `update-time` before that to prevent them from being killed.)" (let ((s2-0 (the-as (pointer connection-pers) (&-> this alive-list))) (s3-0 (-> this alive-list)) ) @@ -1242,6 +1246,7 @@ ;; WARN: Function (method 10 engine-minimap) has a return type of none, but the expression builder found a return statement. (defmethod kill-callback ((this engine-minimap) (arg0 connection-pers)) + "Called when a connection is removed." (if (not arg0) (return #f) ) @@ -1346,7 +1351,7 @@ (set! (-> this target-inv-scale) 0.5) ) ) - (seek! (-> this offset y) (-> this target-inv-scale) (* 0.5 f30-2)) + (seek! (-> this offset y) (-> this target-inv-scale) (/ f30-2 2)) ) (run-pending-updates! (-> this engine) (-> *display* base-clock frame-counter)) (when (and (-> this ctywide) (and (= (-> this ctywide status) 'active) (!= (-> this offset w) 0.0))) @@ -1927,23 +1932,23 @@ (set-vector! (-> arg0 mat vector 2) (* (-> s1-0 x) f30-0) 0.0 (-> s1-0 z) 0.0) ) (vector-! s2-0 (target-pos 0) (-> this minimap-corner)) - (set! (-> s2-0 x) (* 0.00000023841858 (-> s2-0 x))) - (set! (-> s2-0 z) (* 0.00000023841858 (-> s2-0 z))) + (set! (-> s2-0 x) (/ (-> s2-0 x) (meters 1024))) + (set! (-> s2-0 z) (/ (-> s2-0 z) (meters 1024))) (vector+! (-> arg0 mat trans) s2-0 (-> this offset)) ) ) (set! (-> arg0 mat trans y) 0.0) - (set! (-> arg0 corner 0 x) (* 0.25 (-> this offset y))) - (set! (-> arg0 corner 0 z) (* 0.25 (-> this offset y))) + (set! (-> arg0 corner 0 x) (/ (-> this offset y) 4)) + (set! (-> arg0 corner 0 z) (/ (-> this offset y) 4)) (set! (-> arg0 corner 0 w) 1.0) - (set! (-> arg0 corner 1 x) (* -0.25 (-> this offset y))) - (set! (-> arg0 corner 1 z) (* 0.25 (-> this offset y))) + (set! (-> arg0 corner 1 x) (/ (-> this offset y) -4)) + (set! (-> arg0 corner 1 z) (/ (-> this offset y) 4)) (set! (-> arg0 corner 1 w) 1.0) - (set! (-> arg0 corner 2 x) (* 0.25 (-> this offset y))) - (set! (-> arg0 corner 2 z) (* -0.25 (-> this offset y))) + (set! (-> arg0 corner 2 x) (/ (-> this offset y) 4)) + (set! (-> arg0 corner 2 z) (/ (-> this offset y) -4)) (set! (-> arg0 corner 2 w) 1.0) - (set! (-> arg0 corner 3 x) (* -0.25 (-> this offset y))) - (set! (-> arg0 corner 3 z) (* -0.25 (-> this offset y))) + (set! (-> arg0 corner 3 x) (/ (-> this offset y) -4)) + (set! (-> arg0 corner 3 z) (/ (-> this offset y) -4)) (set! (-> arg0 corner 3 w) 1.0) (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) (-> arg0 mat)) (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) (-> arg0 mat)) diff --git a/goal_src/jak2/engine/ui/text.gc b/goal_src/jak2/engine/ui/text.gc index 53f4fe7bece..da6ae40df37 100644 --- a/goal_src/jak2/engine/ui/text.gc +++ b/goal_src/jak2/engine/ui/text.gc @@ -32,7 +32,7 @@ (kmemclose) -(defmethod relocate ((this game-text-info) (arg0 int)) +(defmethod relocate ((this game-text-info) (offset int)) (let ((v1-1 (-> *level* loading-level))) (when v1-1 (set! (-> v1-1 loaded-text-info (-> v1-1 loaded-text-info-count)) this) @@ -52,21 +52,21 @@ ) -(defmethod mem-usage ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) - (set! (-> arg0 length) (max 84 (-> arg0 length))) - (set! (-> arg0 data 83 name) "string") - (+! (-> arg0 data 83 count) 1) +(defmethod mem-usage ((this game-text-info) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 84 (-> usage length))) + (set! (-> usage data 83 name) "string") + (+! (-> usage data 83 count) 1) (let ((v1-6 (asize-of this))) - (+! (-> arg0 data 83 used) v1-6) - (+! (-> arg0 data 83 total) (logand -16 (+ v1-6 15))) + (+! (-> usage data 83 used) v1-6) + (+! (-> usage data 83 total) (logand -16 (+ v1-6 15))) ) (dotimes (s4-0 (-> this length)) - (set! (-> arg0 length) (max 84 (-> arg0 length))) - (set! (-> arg0 data 83 name) "string") - (+! (-> arg0 data 83 count) 1) + (set! (-> usage length) (max 84 (-> usage length))) + (set! (-> usage data 83 name) "string") + (+! (-> usage data 83 count) 1) (let ((v1-18 (asize-of (-> this data s4-0 text)))) - (+! (-> arg0 data 83 used) v1-18) - (+! (-> arg0 data 83 total) (logand -16 (+ v1-18 15))) + (+! (-> usage data 83 used) v1-18) + (+! (-> usage data 83 total) (logand -16 (+ v1-18 15))) ) ) this @@ -464,7 +464,7 @@ in a single text group and file." ) (set! sv-64 0) (if (logtest? (-> arg1 flags) (font-flags middle)) - (+! (-> arg1 origin x) (* 0.5 (-> arg1 width))) + (+! (-> arg1 origin x) (/ (-> arg1 width) 2)) ) (set! sv-72 (-> sv-32 0)) (set! sv-80 0) diff --git a/goal_src/jak2/engine/util/smush-control-h.gc b/goal_src/jak2/engine/util/smush-control-h.gc index 05fea6fb5c7..205be0c514c 100644 --- a/goal_src/jak2/engine/util/smush-control-h.gc +++ b/goal_src/jak2/engine/util/smush-control-h.gc @@ -8,6 +8,7 @@ ;; DECOMP BEGINS (deftype smush-control (structure) + "This holds information about the current state of an object's smush." ((start-time time-frame) (period float) (duration float) @@ -45,23 +46,23 @@ (defmethod update! ((this smush-control)) (cond ((!= (-> this amp) 0.0) - (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) - (f0-2 (-> this period)) - (f28-0 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) + (let* ((elapsed-time (the float (- (current-time) (-> this start-time)))) + (period (-> this period)) + (f28-0 (- elapsed-time (* (the float (the int (/ elapsed-time period))) period))) ) - (when (>= (- f30-0 (-> this ticks)) (-> this period)) + (when (>= (- elapsed-time (-> this ticks)) (-> this period)) (set! (-> this amp) (* (-> this amp) (-> this damp-amp))) (set! (-> this period) (* (-> this period) (-> this damp-period))) - (set! (-> this ticks) f30-0) + (set! (-> this ticks) elapsed-time) (if (< (-> this damp-period) 0.0) (set-zero! this) ) ) - (if (>= f30-0 (-> this duration)) + (if (>= elapsed-time (-> this duration)) (set-zero! this) ) (* (sin (/ (* 65536.0 f28-0) (-> this period))) - (* (-> this amp) (/ (- (-> this duration) f30-0) (-> this duration))) + (* (-> this amp) (/ (- (-> this duration) elapsed-time) (-> this duration))) ) ) ) @@ -74,12 +75,12 @@ (defmethod get-no-update ((this smush-control)) (cond ((!= (-> this amp) 0.0) - (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) - (f0-2 (-> this period)) - (f0-4 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) + (let* ((elapsed-time (the float (- (current-time) (-> this start-time)))) + (period (-> this period)) + (f0-4 (- elapsed-time (* (the float (the int (/ elapsed-time period))) period))) ) (* (sin (/ (* 65536.0 f0-4) (-> this period))) - (* (-> this amp) (/ (- (-> this duration) f30-0) (-> this duration))) + (* (-> this amp) (/ (- (-> this duration) elapsed-time) (-> this duration))) ) ) ) @@ -96,15 +97,22 @@ this ) -(defmethod activate! ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock)) - (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) - (set! (-> this amp) arg0) - (set! (-> this period) (the float arg1)) - (set! (-> this duration) (the float arg2)) - (set! (-> this damp-amp) arg3) - (set! (-> this damp-period) arg4) +(defmethod activate! ((this smush-control) + (amplitude float) + (period int) + (duration int) + (damp-amplitude float) + (damp-period float) + (clock clock) + ) + (when (>= (fabs (/ (-> this amp) 5)) (fabs (get-no-update this))) + (set! (-> this amp) amplitude) + (set! (-> this period) (the float period)) + (set! (-> this duration) (the float duration)) + (set! (-> this damp-amp) damp-amplitude) + (set! (-> this damp-period) damp-period) (set! (-> this ticks) 0.0) - (set! (-> this start-time) (-> arg5 frame-counter)) + (set! (-> this start-time) (-> clock frame-counter)) ) this ) diff --git a/goal_src/jak2/engine/util/sync-info.gc b/goal_src/jak2/engine/util/sync-info.gc index 0aa3e3d618a..25acfcc1bc2 100644 --- a/goal_src/jak2/engine/util/sync-info.gc +++ b/goal_src/jak2/engine/util/sync-info.gc @@ -425,7 +425,7 @@ (defmethod set-params! ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this max-val) (* 0.5 arg2)) + (set! (-> this max-val) (/ arg2 2)) (set! (-> this start-time) 0) (set! (-> this timer) 0) (set! (-> this value) 0.0) @@ -525,8 +525,8 @@ (defmethod set-params! ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this xz-max) (* 0.5 arg2)) - (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this xz-max) (/ arg2 2)) + (set! (-> this y-max) (/ arg3 2)) (set! (-> this start-time) 0) (set! (-> this timer) 0) (vector-reset! (-> this value)) diff --git a/goal_src/jak2/levels/atoll/atoll-obs.gc b/goal_src/jak2/levels/atoll/atoll-obs.gc index f1b0e376c0f..60cf98367cd 100644 --- a/goal_src/jak2/levels/atoll/atoll-obs.gc +++ b/goal_src/jak2/levels/atoll/atoll-obs.gc @@ -252,7 +252,7 @@ (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* (-> self rotspeed) (seconds-per-frame))) (let ((f1-2 (- (-> self dest-height) (-> self root trans y)))) (if (< 0.0 f1-2) - (+! (-> self root trans y) (* (fmax 6144.0 (* 0.5 f1-2)) (seconds-per-frame))) + (+! (-> self root trans y) (* (fmax 6144.0 (/ f1-2 2)) (seconds-per-frame))) ) ) (update! (-> self sound)) @@ -271,7 +271,7 @@ (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* (-> self rotspeed) (seconds-per-frame))) (let ((f1-2 (- (-> self dest-height) (-> self root trans y)))) (if (< 0.0 f1-2) - (+! (-> self root trans y) (* (fmax 6144.0 (* 0.5 f1-2)) (seconds-per-frame))) + (+! (-> self root trans y) (* (fmax 6144.0 (/ f1-2 2)) (seconds-per-frame))) ) ) (update! (-> self sound)) @@ -557,21 +557,25 @@ ) ) :code (behavior () - (suspend-for (the int (-> self cycle-offset))) + (suspend-for (the int (-> self cycle-offset)) + ) (until #f - (suspend-for (the int (-> self cycle-time))) + (suspend-for (the int (-> self cycle-time)) + ) (activate! (-> self smush) -1.0 60 225 1.0 1.0 (-> self clock)) (sound-play "rot-pipe-wiggle" :position (-> self root trans)) - (suspend-for (seconds 0.75) (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush))))) + (suspend-for (seconds 0.75) + (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))) + ) (set! (-> self shudder-angle) 0.0) (set-zero! (-> self smush)) - (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25) + ) (sound-play "rot-pipe-turn" :position (-> self root trans)) (let* ((f0-7 2.0) (f30-1 (* 16384.0 f0-7)) ) - (suspend-for - (seconds 0.5) + (suspend-for (seconds 0.5) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) diff --git a/goal_src/jak2/levels/castle/boss/casboss-texture.gc b/goal_src/jak2/levels/castle/boss/casboss-texture.gc index ae091cba512..82d664108e2 100644 --- a/goal_src/jak2/levels/castle/boss/casboss-texture.gc +++ b/goal_src/jak2/levels/castle/boss/casboss-texture.gc @@ -163,8 +163,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) diff --git a/goal_src/jak2/levels/castle/boss/castle-baron.gc b/goal_src/jak2/levels/castle/boss/castle-baron.gc index f4606c8bae1..9168115e0ac 100644 --- a/goal_src/jak2/levels/castle/boss/castle-baron.gc +++ b/goal_src/jak2/levels/castle/boss/castle-baron.gc @@ -1024,7 +1024,7 @@ (f2-2 f1-1) (f2-4 (/ 1.0 f2-2)) ) - (+ 1.0 (* 0.2 f0-0)) + (+ 1.0 (/ f0-0 5)) (set! (-> this delta-wiggle-angle) (* 182.04445 f1-1)) (set! (-> this wiggle-factor) (* 2.0 f2-4)) ) diff --git a/goal_src/jak2/levels/castle/castle-texture.gc b/goal_src/jak2/levels/castle/castle-texture.gc index c90a97f96fc..07ac5d2d6e2 100644 --- a/goal_src/jak2/levels/castle/castle-texture.gc +++ b/goal_src/jak2/levels/castle/castle-texture.gc @@ -737,7 +737,7 @@ (set! (-> a1-4 data 0 end-time) f0-3) (set! (-> a1-4 data 1 end-time) f0-3) ) - (set! f0-3 (* 0.5 f0-3)) + (set! f0-3 (/ f0-3 2)) ) ) #f diff --git a/goal_src/jak2/levels/castle/roboguard-level.gc b/goal_src/jak2/levels/castle/roboguard-level.gc index 2fa28e3d5e1..c32b3a89fbd 100644 --- a/goal_src/jak2/levels/castle/roboguard-level.gc +++ b/goal_src/jak2/levels/castle/roboguard-level.gc @@ -467,10 +467,10 @@ (ja-channel-push! 1 (seconds 0.2)) (let ((f30-0 (rnd-float-range self 0.9 1.1))) (until #f - (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (* 0.1 f30-0)) :frame-num 9.0) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (/ f30-0 10)) :frame-num 9.0) (until (ja-done? 0) (suspend) - (ja :num! (seek! 10.0 (* 0.1 f30-0))) + (ja :num! (seek! 10.0 (/ f30-0 10))) ) ) ) @@ -1107,7 +1107,7 @@ s5-1 s5-1 gp-0 - (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame)) ) ) ) diff --git a/goal_src/jak2/levels/city/bombbot/bombbot.gc b/goal_src/jak2/levels/city/bombbot/bombbot.gc index 80040c432b2..1386dd1a360 100644 --- a/goal_src/jak2/levels/city/bombbot/bombbot.gc +++ b/goal_src/jak2/levels/city/bombbot/bombbot.gc @@ -1000,7 +1000,7 @@ (set! (-> t0-0 z) 0.0) (set! (-> t0-0 w) 1.0) (let ((v0-5 (t9-5 a0-31 a1-16 a2-22 a3-1 t0-0 (/ f28-0 f30-0)))) - (set! (-> s1-0 delta-y) (* 0.05 (-> v0-5 y) (vector-length (-> s1-0 speed)))) + (set! (-> s1-0 delta-y) (* (/ (-> v0-5 y) 20) (vector-length (-> s1-0 speed)))) ) ) ) @@ -2477,7 +2477,7 @@ ) (set! (-> v1-3 main-y) (- (-> s4-0 feet s0-0 real-position y) (-> s4-0 root trans y))) (set! (-> v1-3 main-y) (-> v1-3 delta-y)) - (+! f30-0 (* 0.25 (-> v1-3 main-y))) + (+! f30-0 (/ (-> v1-3 main-y) 4)) (set! (-> s1-0 quad) (-> v1-3 pos-offset quad)) (set! (-> s1-0 y) (* -2.0 (-> v1-3 main-y))) (new 'stack-no-clear 'vector) diff --git a/goal_src/jak2/levels/city/common/nav-graph.gc b/goal_src/jak2/levels/city/common/nav-graph.gc index 4a1030f733a..c01cc088fd1 100644 --- a/goal_src/jak2/levels/city/common/nav-graph.gc +++ b/goal_src/jak2/levels/city/common/nav-graph.gc @@ -14,13 +14,13 @@ ) (defmethod set-speed-limit ((this nav-branch) (arg0 float)) - (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 1024))))))) 0 (none) ) (defmethod set-width ((this nav-branch) (arg0 float)) - (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) + (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 256))))))) 0 (none) ) @@ -307,7 +307,7 @@ ) (defmethod set-radius ((this nav-node) (arg0 float)) - (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 1024))))))) 0 (none) ) @@ -1097,7 +1097,7 @@ (defmethod patch-nodes ((this nav-graph)) "Patch nodes. Node pointers are stored as indices into arrays to be allocated on the level heap -and patched at runtime after loading." + and patched at runtime after loading." (when (not (-> this patched)) (set! (-> this patched) #t) (let ((s5-0 0)) diff --git a/goal_src/jak2/levels/city/common/trail.gc b/goal_src/jak2/levels/city/common/trail.gc index 51d3066e097..bea6207c88b 100644 --- a/goal_src/jak2/levels/city/common/trail.gc +++ b/goal_src/jak2/levels/city/common/trail.gc @@ -492,7 +492,7 @@ ) 0 (let* ((f0-0 (-> v1-0 cell-width)) - (f1-1 (* 0.5 f0-0)) + (f1-1 (/ (the float f0-0) 2)) ) (let ((f3-0 (- (-> arg0 x) f1-1)) (f2-2 (- (-> arg0 z) f1-1)) diff --git a/goal_src/jak2/levels/city/ctywide-obs.gc b/goal_src/jak2/levels/city/ctywide-obs.gc index 1e842bb85a3..7f3d197253f 100644 --- a/goal_src/jak2/levels/city/ctywide-obs.gc +++ b/goal_src/jak2/levels/city/ctywide-obs.gc @@ -498,11 +498,11 @@ ) (vector+! (-> s1-0 trans) s4-0 s3-0) (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) - (+! (-> s1-0 trans y) (* 0.5 arg1)) + (+! (-> s1-0 trans y) (/ arg1 2)) (vector-! (the-as vector (-> s2-2 vector)) s3-0 s4-0) (let ((f30-1 (vector-normalize-ret-len! (the-as vector (-> s2-2 vector)) 1.0))) - (set! (-> s1-0 scale x) (* 0.00024414062 f30-1)) - (set! (-> s1-0 scale y) (* 0.00024414062 arg1)) + (set! (-> s1-0 scale x) (/ f30-1 METER_LENGTH)) + (set! (-> s1-0 scale y) (/ arg1 METER_LENGTH)) (set! (-> s1-0 scale z) 1.0) (set! (-> s2-2 vector 1 quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) (vector-cross! (-> s2-2 vector 2) (the-as vector (-> s2-2 vector)) (-> s2-2 vector 1)) @@ -512,7 +512,7 @@ (set! (-> this plane w) (- (vector-dot (-> s2-2 vector 2) (-> this root trans)))) (let ((v0-8 (-> this root root-prim local-sphere))) (set! (-> v0-8 x) 0.0) - (set! (-> v0-8 y) (* 0.00024414062 (* 0.5 arg1))) + (set! (-> v0-8 y) (* 0.00024414062 (/ arg1 2))) (set! (-> v0-8 z) 0.0) (let ((f0-20 0.5) (f1-7 (* f30-1 f30-1)) @@ -663,7 +663,7 @@ 0.0 0.0 0.0 - (let* ((f28-0 (/ 1.0 (* 0.00024414062 (-> arg1 omega)))) + (let* ((f28-0 (/ 1.0 (/ (-> arg1 omega) METER_LENGTH))) (f26-0 (* (rand-vu-float-range -136.53334 136.53334) f28-0)) (f30-0 (* (rand-vu-float-range 0.0 136.53334) f28-0)) (f0-8 (* (rand-vu-float-range -13.653334 54.613335) f28-0)) @@ -1825,7 +1825,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> s0-0 quad) vf6) (let ((f30-0 (vector-vector-xz-distance s4-0 s0-0))) - (let ((f0-2 (* 0.0000012207031 f30-0)) + (let ((f0-2 (/ f30-0 (meters 200))) (a0-7 s4-0) ) (let ((v1-10 s4-0)) @@ -1899,7 +1899,7 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'quaternion))) - (let ((f0-42 (/ 45511.11 (* 0.00024414062 f30-0)))) + (let ((f0-42 (/ 45511.11 (/ f30-0 METER_LENGTH)))) (quaternion-axis-angle! s5-1 1.0 0.0 0.0 (fmax (fmin (-> this angle-guns) f0-42) (- f0-42))) ) (quaternion*! diff --git a/goal_src/jak2/levels/city/onintent/onin-game.gc b/goal_src/jak2/levels/city/onintent/onin-game.gc index 17379c736d7..6f9dfb3a1ad 100644 --- a/goal_src/jak2/levels/city/onintent/onin-game.gc +++ b/goal_src/jak2/levels/city/onintent/onin-game.gc @@ -1033,8 +1033,8 @@ (let* ((a0-1 (-> arg4 control)) (v1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg2 x-y-z-sx) (-> a0-1 origin trans))) ) - (set! (-> arg1 vel-sxvel x) (* 0.083333336 (-> v1-1 x))) - (set! (-> arg1 vel-sxvel y) (* 0.083333336 (-> v1-1 y))) + (set! (-> arg1 vel-sxvel x) (/ (-> v1-1 x) 12)) + (set! (-> arg1 vel-sxvel y) (/ (-> v1-1 y) 12)) ) 0 (none) @@ -1375,9 +1375,9 @@ (let* ((a0-1 (-> arg4 control)) (v1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg2 x-y-z-sx) (-> a0-1 origin trans))) ) - (set! (-> arg1 vel-sxvel x) (* -0.008333334 (-> v1-1 x))) - (set! (-> arg1 vel-sxvel y) (* -0.008333334 (-> v1-1 y))) - (set! (-> arg1 vel-sxvel z) (* -0.008333334 (-> v1-1 z))) + (set! (-> arg1 vel-sxvel x) (/ (-> v1-1 x) -120)) + (set! (-> arg1 vel-sxvel y) (/ (-> v1-1 y) -120)) + (set! (-> arg1 vel-sxvel z) (/ (-> v1-1 z) -120)) ) 0 (none) diff --git a/goal_src/jak2/levels/city/palace/ctypal-obs.gc b/goal_src/jak2/levels/city/palace/ctypal-obs.gc index 0077572206e..d843707f143 100644 --- a/goal_src/jak2/levels/city/palace/ctypal-obs.gc +++ b/goal_src/jak2/levels/city/palace/ctypal-obs.gc @@ -168,11 +168,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this ctypal-broke-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (format #t "~A initialising~%" (-> this name)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -200,9 +200,9 @@ This commonly includes things such as: (format 0 "trans ~F ~F ~F~%" - (* 0.00024414062 (-> v1-10 trans x)) - (* 0.00024414062 (-> v1-10 trans y)) - (* 0.00024414062 (-> v1-10 trans z)) + (/ (-> v1-10 trans x) METER_LENGTH) + (/ (-> v1-10 trans y) METER_LENGTH) + (/ (-> v1-10 trans z) METER_LENGTH) ) ) (set! (-> this ent) arg0) @@ -224,6 +224,7 @@ This commonly includes things such as: ) (defmethod run-logic? ((this ctypal-baron-statue-broken)) + "Should this process be run? Checked by execute-process-tree." #t ) @@ -235,11 +236,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this ctypal-baron-statue-broken) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak2/levels/city/slums/kor/kid3-course.gc b/goal_src/jak2/levels/city/slums/kor/kid3-course.gc index 4cd06140272..d74a0689640 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid3-course.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid3-course.gc @@ -99,7 +99,7 @@ (quaternion-vector-angle! (-> arg1 root quat) *up-vector* - (* 182.04445 (* 0.00024414062 (-> arg1 course spots 1 center w))) + (* 182.04445 (/ (-> arg1 course spots 1 center w) METER_LENGTH)) ) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 5 #f) diff --git a/goal_src/jak2/levels/city/slums/kor/kor3-course.gc b/goal_src/jak2/levels/city/slums/kor/kor3-course.gc index 6152fc157dc..e6162c111b8 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor3-course.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor3-course.gc @@ -99,7 +99,7 @@ (quaternion-vector-angle! (-> arg1 root quat) *up-vector* - (* 182.04445 (* 0.00024414062 (-> arg1 course spots 1 center w))) + (* 182.04445 (/ (-> arg1 course spots 1 center w) METER_LENGTH)) ) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 5 #f) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc index bc02d1dd9fd..10965c66cc0 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc @@ -435,7 +435,7 @@ (if (or (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) (= (-> this incoming knocked-type) (knocked-type knocked-type-3)) ) - (set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed))) + (set! (-> arg0 anim-speed) (/ (-> arg0 anim-speed) 2)) ) (let ((a0-47 (-> this skel root-channel 0))) (set! (-> a0-47 frame-group) (the-as art-joint-anim s4-0)) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen.gc index 86719d594a8..fd010b4f2a0 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen.gc @@ -97,8 +97,8 @@ ;; WARN: Return type mismatch int vs enemy-aware. (defmethod update-target-awareness! ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! -@TODO - flesh out docs -@returns the value that sets `aware`" + @TODO - flesh out docs + @returns the value that sets `aware`" (when arg1 (let ((f0-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans)))) (when (< f0-0 (-> arg1 rating)) @@ -239,7 +239,7 @@ (defmethod general-event-handler ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch 'hit-knocked) (let ((v1-1 #f)) @@ -357,9 +357,9 @@ (defmethod common-post ((this citizen)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (when (< (-> this next-time-look-at) (current-time)) (when (nonzero? (-> this neck)) (let ((a0-4 (handle->process (-> this focus handle)))) @@ -587,7 +587,7 @@ s5-1 s5-1 gp-0 - (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame)) ) ) ) @@ -645,11 +645,11 @@ ;; WARN: Return type mismatch entity-perm-status vs none. (defmethod init-from-entity! ((this citizen) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (process-entity-status! this (entity-perm-status dead) #t) (none) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/civilian.gc b/goal_src/jak2/levels/city/traffic/citizen/civilian.gc index d050d067fce..9f65dbbf8b5 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/civilian.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/civilian.gc @@ -254,7 +254,7 @@ (defmethod general-event-handler ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('track) #f @@ -950,7 +950,7 @@ ) (if (and (-> self allow-dive) (< (vector-length v1-8) (* (-> self dive-reaction) (vector-length (-> self cp-vec)))) - (< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (* 0.5 (-> self cp-sphere r))) + (< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (/ (-> self cp-sphere r) 2)) ) (go-dive self) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/guard.gc b/goal_src/jak2/levels/city/traffic/citizen/guard.gc index 3957109ac1b..94d77018b5c 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/guard.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/guard.gc @@ -453,9 +453,9 @@ (defmethod common-post ((this crimson-guard)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type citizen common-post))) (t9-0 this) ) @@ -494,7 +494,7 @@ ;; WARN: disable def twice: 122. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod general-event-handler ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch 'hit-knocked) (speech-control-method-13 *speech-control* (the-as handle this)) @@ -968,7 +968,7 @@ (((knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-17 (-> this draw art-group data (-> this info knocked (-> this hit-face))))) - (set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed))) + (set! (-> arg0 anim-speed) (/ (-> arg0 anim-speed) 2)) (let ((a0-36 (-> this skel root-channel 0))) (set! (-> a0-36 frame-group) (the-as art-joint-anim a1-17)) (set! (-> a0-36 param 0) (the float (+ (-> (the-as art-joint-anim a1-17) frames num-frames) -1))) @@ -1536,7 +1536,7 @@ (set! (-> this target-vel) (vector-length (-> this target-vel-vec))) (let ((s5-4 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this target-pos)))) (let* ((f0-3 (vector-length s5-4)) - (f0-4 (* 0.0000012207031 f0-3)) + (f0-4 (/ f0-3 (meters 200))) (a1-9 (-> this target-pos-predict)) ) (let ((v1-62 (-> this target-pos))) @@ -1941,7 +1941,7 @@ (.svf (&-> a1-6 quad) vf6) ) (let ((f30-2 (* 0.5 (vector-vector-xz-distance s5-0 s3-0)))) - (vector-normalize! s4-0 (* 0.5 f30-2)) + (vector-normalize! s4-0 (/ f30-2 2)) (vector-normalize! s2-0 (* 2.0 f30-2)) ) (do-spline gp-0 s5-0 s4-0 s3-0 s2-0 0.9) @@ -3672,14 +3672,14 @@ (none) ) -(defmethod relocate ((this crimson-guard) (arg0 int)) +(defmethod relocate ((this crimson-guard) (offset int)) (if (nonzero? (-> this joint)) - (&+! (-> this joint) arg0) + (&+! (-> this joint) offset) ) (if (nonzero? (-> this l-control)) - (&+! (-> this l-control) arg0) + (&+! (-> this l-control) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod init-enemy! ((this crimson-guard)) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc index b2c51bf45ef..7475325cb71 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc @@ -382,10 +382,12 @@ ) ) ) - (suspend-for (seconds 0.6)) + (suspend-for (seconds 0.6) + ) (+! (-> self root trans y) -8192.0) (logior! (-> self draw status) (draw-control-status no-draw)) - (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) + ) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) ) @@ -550,7 +552,7 @@ (set! (-> this last-change-dir) (the-as uint (current-time))) (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) + (f0-9 (* (/ f30-0 2) (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) (if (-> this heading) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc index e12e56909c9..04f528aa157 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc @@ -380,9 +380,9 @@ (defmethod common-post ((this metalhead-predator)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type citizen-enemy common-post))) (t9-0 this) ) @@ -395,7 +395,7 @@ ;; WARN: disable def twice: 21. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod general-event-handler ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) (set! (-> this shock-effect-end) (the-as int (+ (current-time) (seconds 1)))) @@ -697,7 +697,7 @@ (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-240 quad) vf6) (let* ((f0-5 (vector-length sv-240)) - (f0-6 (* 0.0000018780048 f0-5)) + (f0-6 (/ f0-5 (meters 130))) ) (set! sv-256 (new 'stack-no-clear 'vector)) (let ((s0-0 (new 'stack-no-clear 'vector)) @@ -1090,8 +1090,8 @@ (none) ) -(defmethod relocate ((this metalhead-predator) (arg0 int)) - (call-parent-method this arg0) +(defmethod relocate ((this metalhead-predator) (offset int)) + (call-parent-method this offset) ) (defmethod init-enemy! ((this metalhead-predator)) diff --git a/goal_src/jak2/levels/city/traffic/traffic-engine.gc b/goal_src/jak2/levels/city/traffic/traffic-engine.gc index 10c75e686ce..3d7484914ee 100644 --- a/goal_src/jak2/levels/city/traffic/traffic-engine.gc +++ b/goal_src/jak2/levels/city/traffic/traffic-engine.gc @@ -240,7 +240,7 @@ (defmethod add-new-supression-box ((this traffic-suppressor) (arg0 traffic-suppression-params)) "Create a suppression box for these params. -The param object is updated with the ID of the box and can be later used with update-box-from-params." + The param object is updated with the ID of the box and can be later used with update-box-from-params." (set! (-> arg0 id) -1) (let ((v1-1 0)) (b! #t cfg-4 :delay (nop!)) @@ -445,7 +445,7 @@ The param object is updated with the ID of the box and can be later used with up (defmethod deactivate-object ((this traffic-tracker) (arg0 int) (arg1 symbol)) "Send a traffic-off event (or traffic-off-force) to deactivate an object, specified by index in active object array. -Process is recycled and moved to reserved, if it deactivates." + Process is recycled and moved to reserved, if it deactivates." (with-pp (let* ((s3-0 (-> this active-object-type-list arg0)) (gp-0 'traffic-off) @@ -611,9 +611,8 @@ Process is recycled and moved to reserved, if it deactivates." (+! (-> s4-0 params position z) (* (-> s4-0 vector 0 x) f0-6)) ) ) - (set! (-> s4-0 vector 2 y) (+ (* 0.5 (-> s4-0 vector 2 x)) - (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing)) - ) + (set! (-> s4-0 vector 2 y) + (+ (/ (-> s4-0 vector 2 x) 2) (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing))) ) (vector-float*! (-> s4-0 params velocity) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 x)) (vector-float*! (-> s4-0 vector 1) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 y)) @@ -1325,7 +1324,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! decay-rate 1.5) ) ) - (set! (-> v1-1 0 decay-rate) (* 0.1 decay-rate)) + (set! (-> v1-1 0 decay-rate) (/ decay-rate 10)) (when (< (-> v1-1 0 danger-level) danger-level) (set! (-> v1-1 0 danger-level) danger-level) (set! (-> v1-1 0 sphere r) danger-radius) @@ -2131,9 +2130,8 @@ Process is recycled and moved to reserved, if it deactivates." (defmethod traffic-engine-method-49 ((this traffic-engine) (los vector) (arg2 int) (target-status traffic-target-status)) (local-vars - ;; og:preserve-this stack array -> pointer - (guards (pointer crimson-guard)) - (guard-target-dists (pointer float)) + (guards (array crimson-guard)) + (guard-target-dists (array float)) (guard-idx int) (sv-208 int) (sv-216 float) @@ -2180,9 +2178,8 @@ Process is recycled and moved to reserved, if it deactivates." (when (not (update-guard-status-spots target-pos)) ) (when (update-guard-status-spots target-pos) - ;; og:preserve-this stack array -> pointer - (set! guards (new 'stack-no-clear 'array 'crimson-guard 16)) - (set! guard-target-dists (new 'stack-no-clear 'array 'float 16)) + (set! guards (the-as (array crimson-guard) (new 'stack 'boxed-array crimson-guard 16))) + (set! guard-target-dists (the-as (array float) (new 'stack 'boxed-array float 16))) (set! guard-idx 0) (dotimes (guard-count (the-as int (-> this vehicle-tracker-array active-object-count))) (case (-> this vehicle-tracker-array active-object-type-list guard-count) @@ -2222,8 +2219,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (dotimes (s4-1 guard-idx) - ;; og:preserve-this stack array -> pointer - (let ((crimson-guard (-> (the-as (pointer crimson-guard) guards) s4-1))) + (let ((crimson-guard (-> (the-as (array crimson-guard) guards) s4-1))) (when (= (-> crimson-guard move-index) -1) (set! sv-208 -1) ;; og:preserve-this kinda hacky, was ps2 weird infinity. diff --git a/goal_src/jak2/levels/city/traffic/vehicle/bike.gc b/goal_src/jak2/levels/city/traffic/vehicle/bike.gc index 1acbaff8c6a..7f7451a3793 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/bike.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/bike.gc @@ -1017,29 +1017,29 @@ ) -(defmethod relocate ((this bikea) (arg0 int)) +(defmethod relocate ((this bikea) (offset int)) (if (nonzero? (-> this fin-fl)) - (&+! (-> this fin-fl) arg0) + (&+! (-> this fin-fl) offset) ) (if (nonzero? (-> this fin-fr)) - (&+! (-> this fin-fr) arg0) + (&+! (-> this fin-fr) offset) ) (if (nonzero? (-> this fin-rl)) - (&+! (-> this fin-rl) arg0) + (&+! (-> this fin-rl) offset) ) (if (nonzero? (-> this fin-rr)) - (&+! (-> this fin-rr) arg0) + (&+! (-> this fin-rr) offset) ) (if (nonzero? (-> this rudder)) - (&+! (-> this rudder) arg0) + (&+! (-> this rudder) offset) ) (if (nonzero? (-> this brake-l)) - (&+! (-> this brake-l) arg0) + (&+! (-> this brake-l) offset) ) (if (nonzero? (-> this brake-r)) - (&+! (-> this brake-r) arg0) + (&+! (-> this brake-r) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this bikea)) @@ -1101,10 +1101,10 @@ (f28-0 (* -13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (* -0.2 f26-0) f30-0)) - (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (* 0.2 f26-0) f30-0)) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (/ f26-0 -5) f30-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (/ f26-0 5) f30-0)) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 f28-0) (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) @@ -1144,32 +1144,32 @@ ) -(defmethod relocate ((this bikeb) (arg0 int)) +(defmethod relocate ((this bikeb) (offset int)) (if (nonzero? (-> this fin-rl)) - (&+! (-> this fin-rl) arg0) + (&+! (-> this fin-rl) offset) ) (if (nonzero? (-> this fin-rr)) - (&+! (-> this fin-rr) arg0) + (&+! (-> this fin-rr) offset) ) (if (nonzero? (-> this rudder)) - (&+! (-> this rudder) arg0) + (&+! (-> this rudder) offset) ) (if (nonzero? (-> this rudder-f)) - (&+! (-> this rudder-f) arg0) + (&+! (-> this rudder-f) offset) ) (if (nonzero? (-> this brake-l)) - (&+! (-> this brake-l) arg0) + (&+! (-> this brake-l) offset) ) (if (nonzero? (-> this brake-r)) - (&+! (-> this brake-r) arg0) + (&+! (-> this brake-r) offset) ) (if (nonzero? (-> this flap-l)) - (&+! (-> this flap-l) arg0) + (&+! (-> this flap-l) offset) ) (if (nonzero? (-> this flap-r)) - (&+! (-> this flap-r) arg0) + (&+! (-> this flap-r) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this bikeb)) @@ -1231,8 +1231,8 @@ (f28-0 (* 13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this rudder-f rotation) s5-0 (- f30-0)) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) @@ -1279,41 +1279,41 @@ ) -(defmethod relocate ((this bikec) (arg0 int)) +(defmethod relocate ((this bikec) (offset int)) (if (nonzero? (-> this fin-fl)) - (&+! (-> this fin-fl) arg0) + (&+! (-> this fin-fl) offset) ) (if (nonzero? (-> this fin-fr)) - (&+! (-> this fin-fr) arg0) + (&+! (-> this fin-fr) offset) ) (if (nonzero? (-> this fin-rl)) - (&+! (-> this fin-rl) arg0) + (&+! (-> this fin-rl) offset) ) (if (nonzero? (-> this fin-rr)) - (&+! (-> this fin-rr) arg0) + (&+! (-> this fin-rr) offset) ) (if (nonzero? (-> this fin2-fl)) - (&+! (-> this fin2-fl) arg0) + (&+! (-> this fin2-fl) offset) ) (if (nonzero? (-> this fin2-fr)) - (&+! (-> this fin2-fr) arg0) + (&+! (-> this fin2-fr) offset) ) (if (nonzero? (-> this rudder)) - (&+! (-> this rudder) arg0) + (&+! (-> this rudder) offset) ) (if (nonzero? (-> this brake-l)) - (&+! (-> this brake-l) arg0) + (&+! (-> this brake-l) offset) ) (if (nonzero? (-> this brake-r)) - (&+! (-> this brake-r) arg0) + (&+! (-> this brake-r) offset) ) (if (nonzero? (-> this spoiler-l)) - (&+! (-> this spoiler-l) arg0) + (&+! (-> this spoiler-l) offset) ) (if (nonzero? (-> this spoiler-r)) - (&+! (-> this spoiler-r) arg0) + (&+! (-> this spoiler-r) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this bikec)) @@ -1379,8 +1379,8 @@ (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f26-0) (quaternion-vector-angle! (-> this fin2-fl rotation) s5-0 (- f26-0)) (quaternion-vector-angle! (-> this fin2-fr rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) @@ -1440,11 +1440,11 @@ ) -(defmethod relocate ((this guard-bike) (arg0 int)) +(defmethod relocate ((this guard-bike) (offset int)) (if (nonzero? (-> this turret-jm)) - (&+! (-> this turret-jm) arg0) + (&+! (-> this turret-jm) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod start-jump ((this guard-bike)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/car.gc b/goal_src/jak2/levels/city/traffic/vehicle/car.gc index 419e4dbda07..133bec8cd0a 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/car.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/car.gc @@ -1134,35 +1134,35 @@ ) -(defmethod relocate ((this cara) (arg0 int)) +(defmethod relocate ((this cara) (offset int)) (if (nonzero? (-> this steering-wheel-l)) - (&+! (-> this steering-wheel-l) arg0) + (&+! (-> this steering-wheel-l) offset) ) (if (nonzero? (-> this steering-wheel-r)) - (&+! (-> this steering-wheel-r) arg0) + (&+! (-> this steering-wheel-r) offset) ) (if (nonzero? (-> this fin-fl)) - (&+! (-> this fin-fl) arg0) + (&+! (-> this fin-fl) offset) ) (if (nonzero? (-> this fin-fr)) - (&+! (-> this fin-fr) arg0) + (&+! (-> this fin-fr) offset) ) (if (nonzero? (-> this fin-rl)) - (&+! (-> this fin-rl) arg0) + (&+! (-> this fin-rl) offset) ) (if (nonzero? (-> this fin-rr)) - (&+! (-> this fin-rr) arg0) + (&+! (-> this fin-rr) offset) ) (if (nonzero? (-> this rudder)) - (&+! (-> this rudder) arg0) + (&+! (-> this rudder) offset) ) (if (nonzero? (-> this rudder-l)) - (&+! (-> this rudder-l) arg0) + (&+! (-> this rudder-l) offset) ) (if (nonzero? (-> this rudder-r)) - (&+! (-> this rudder-r) arg0) + (&+! (-> this rudder-r) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this cara)) @@ -1279,26 +1279,26 @@ ) -(defmethod relocate ((this carb) (arg0 int)) +(defmethod relocate ((this carb) (offset int)) (if (nonzero? (-> this steering-wheel-l)) - (&+! (-> this steering-wheel-l) arg0) + (&+! (-> this steering-wheel-l) offset) ) (if (nonzero? (-> this steering-wheel-r)) - (&+! (-> this steering-wheel-r) arg0) + (&+! (-> this steering-wheel-r) offset) ) (if (nonzero? (-> this fin-fl)) - (&+! (-> this fin-fl) arg0) + (&+! (-> this fin-fl) offset) ) (if (nonzero? (-> this fin-fr)) - (&+! (-> this fin-fr) arg0) + (&+! (-> this fin-fr) offset) ) (if (nonzero? (-> this fin-rl)) - (&+! (-> this fin-rl) arg0) + (&+! (-> this fin-rl) offset) ) (if (nonzero? (-> this fin-rr)) - (&+! (-> this fin-rr) arg0) + (&+! (-> this fin-rr) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this carb)) @@ -1411,29 +1411,29 @@ ) -(defmethod relocate ((this carc) (arg0 int)) +(defmethod relocate ((this carc) (offset int)) (if (nonzero? (-> this steering-wheel)) - (&+! (-> this steering-wheel) arg0) + (&+! (-> this steering-wheel) offset) ) (if (nonzero? (-> this fin-fl)) - (&+! (-> this fin-fl) arg0) + (&+! (-> this fin-fl) offset) ) (if (nonzero? (-> this fin-fr)) - (&+! (-> this fin-fr) arg0) + (&+! (-> this fin-fr) offset) ) (if (nonzero? (-> this fin-rl)) - (&+! (-> this fin-rl) arg0) + (&+! (-> this fin-rl) offset) ) (if (nonzero? (-> this fin-rr)) - (&+! (-> this fin-rr) arg0) + (&+! (-> this fin-rr) offset) ) (if (nonzero? (-> this fin2-rl)) - (&+! (-> this fin2-rl) arg0) + (&+! (-> this fin2-rl) offset) ) (if (nonzero? (-> this fin2-rr)) - (&+! (-> this fin2-rr) arg0) + (&+! (-> this fin2-rr) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this carc)) @@ -1503,10 +1503,10 @@ (quaternion-vector-angle! (-> this steering-wheel rotation) s5-0 f0-3) (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f28-0)) (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (* 0.2 f28-0) (* -0.8 f30-0))) - (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (* -0.2 f28-0) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (/ f30-0 -5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (/ f30-0 -5))) + (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (/ f28-0 5) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (/ f28-0 -5) (* -0.8 f30-0))) ) 0 (none) @@ -1558,11 +1558,11 @@ ) -(defmethod relocate ((this hellcat) (arg0 int)) +(defmethod relocate ((this hellcat) (offset int)) (if (nonzero? (-> this turret-jm)) - (&+! (-> this turret-jm) arg0) + (&+! (-> this turret-jm) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod allocate-and-init-cshape ((this hellcat)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc index 9b4d8fb7be2..5205f8128e3 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc @@ -173,7 +173,7 @@ ;; WARN: Return type mismatch object vs none. (defun calc-fade-vals ((arg0 float)) "@unused just a debugging print function" - (let* ((f1-1 (* 0.00024414062 arg0)) + (let* ((f1-1 (/ arg0 METER_LENGTH)) (f0-3 (- f1-1 (the float (the int f1-1)))) (f1-3 (* 4096.0 (- f1-1 f0-3))) (f1-5 (/ -1.0 (* (- 1.0 f0-3) f1-3))) @@ -230,14 +230,14 @@ (init-vf0-vector) (let* ((f0-0 (rand-vu-float-range 1.0 1.33)) (s4-1 (* arg3 f0-0)) - (s0-0 (fmin (* arg2 f0-0) (* 0.5 s4-1))) + (s0-0 (fmin (* arg2 f0-0) (/ s4-1 2))) (s3-1 (new 'stack-no-clear 'inline-array 'vehicle-control-point 3)) (s2-0 (-> this info)) ) (let ((a1-2 (-> s3-1 0 normal))) (let ((v1-2 arg0)) (let ((a0-2 arg1)) - (let ((a2-2 (* 0.25 s4-1))) + (let ((a2-2 (/ s4-1 4))) (.mov vf7 a2-2) ) (.lvf vf5 (&-> a0-2 quad)) @@ -265,13 +265,13 @@ (let ((f0-14 (* 4.0 s0-0))) (set! (-> s3-1 1 local-pos w) f0-14) (set! (-> s3-1 1 normal w) f0-14) - (set! (-> s3-1 1 normal x) (* 0.025 f0-14)) + (set! (-> s3-1 1 normal x) (/ f0-14 40)) ) (add! *simple-sprite-system* (the-as sprite-glow-data (-> s3-1 1))) (forward-up->quaternion (the-as quaternion (-> s3-1 0)) arg1 (the-as vector (-> this rbody state matrix))) (quaternion-rotate-local-x! (the-as quaternion (-> s3-1 0)) (the-as quaternion (-> s3-1 0)) 32768.0) (let ((v1-16 (-> s3-1 0 normal))) - (let ((a0-10 (* 0.5 s4-1))) + (let ((a0-10 (/ s4-1 2))) (.mov vf7 a0-10) ) (.lvf vf5 (&-> arg1 quad)) @@ -451,7 +451,7 @@ (-> this info part-vel) (-> this rbody state lin-velocity) (-> s5-0 0 vector 1) - (* 0.2 (-> this info max-engine-thrust) (+ 0.5 (-> this engine-power-factor))) + (* (/ (-> this info max-engine-thrust) 5) (+ 0.5 (-> this engine-power-factor))) ) (let ((v1-117 (-> this info part-vel)) (a0-45 (-> this info part-vel)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc index 9a72fc88423..564661025ae 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc @@ -323,7 +323,7 @@ (-> gp-0 vec-12 x) ) ) - (set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (* 0.1 (-> gp-0 vec-12 x)))))) + (set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (/ (-> gp-0 vec-12 x) 10))))) (+! (-> this aim-rot s3-1) (* (-> this aim-rot-vel s3-1) (-> gp-0 vec-12 x))) (when (or (zero? s3-1) (not (logtest? (-> this flags) (turret-flag no-rot-y-clamp)))) (let ((f0-31 (-> this info rot-min s3-1))) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc index a4da63f9572..04227cf5b07 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc @@ -29,7 +29,7 @@ (let ((f1-5 (fmin (-> this water-height) (+ (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))))) 0.0 (let* ((f2-5 (fmax -1.0 (fmin 1.0 (/ (- (-> this water-height) (-> s0-0 world-sphere y)) (-> s0-0 world-sphere w))))) - (f30-0 (+ 0.5 (* -0.25 f2-5 f2-5 f2-5) (* 0.75 f2-5))) + (f30-0 (+ 0.5 (* (/ f2-5 -4) f2-5 f2-5) (* 0.75 f2-5))) ) (set! (-> s4-0 local-pos 0 y) (* 0.5 (+ f0-2 f1-5))) (let ((v1-18 (-> this rbody)) @@ -303,8 +303,8 @@ (let ((f1-20 (fmax 0.0 f0-38))) (+! (-> this lift-thrust s2-1) f1-20) (when (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) - (+! (-> this roll-thrust 0) (* 0.05 f1-20)) - (+! (-> this roll-thrust 1) (* 0.05 f1-20)) + (+! (-> this roll-thrust 0) (/ f1-20 20)) + (+! (-> this roll-thrust 1) (/ f1-20 20)) ) ) (vector-reset! (-> arg1 force)) @@ -326,7 +326,7 @@ (and (> (-> this flight-level-index) 0) (< f0-40 0.0) (< (-> arg1 velocity y) 0.0)) ) (vector-reset! (-> arg1 force)) - (let ((f0-43 (* -0.25 (-> this info inv-lift-thruster-count))) + (let ((f0-43 (/ (-> this info inv-lift-thruster-count) -4)) (f1-28 arg0) ) (set! (-> arg1 force y) (* f0-43 (/ 1.0 f1-28) (-> this info info mass) (-> arg1 velocity y))) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc index 8a74f33d2b3..8cf2ba4e526 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc @@ -151,11 +151,11 @@ ;; WARN: Return type mismatch entity-perm-status vs none. (defmethod init-from-entity! ((this vehicle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -419,7 +419,7 @@ This commonly includes things such as: (let* ((v1-1 (-> this rbody state lin-velocity)) (f0-4 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) (f0-6 (/ (- arg0 f0-4) arg0)) - (f1-6 (* 0.005 f0-6)) + (f1-6 (/ f0-6 200)) ) (set! (-> this controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> this controls throttle) f1-6)))) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc index a76261fd9d1..6ba16fb7e25 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc @@ -453,7 +453,7 @@ (set! f1-6 (* f0-23 f0-23)) ) (if (not (logtest? (-> this flags) (rigid-body-object-flag riding))) - (set! f1-6 (* 0.5 f1-6)) + (set! f1-6 (/ f1-6 2)) ) ) (+! (-> this power-level) @@ -1230,7 +1230,7 @@ ) (when (< f0-9 (* f1-8 f1-8)) (let ((f0-10 (vector-length (-> this root transv)))) - (seek! (-> this engine-power-factor) (* 0.000016276043 f0-10) (* 6.0 (seconds-per-frame))) + (seek! (-> this engine-power-factor) (/ f0-10 (meters 15)) (* 6.0 (seconds-per-frame))) ) (do-engine-sounds this) ) @@ -1517,7 +1517,7 @@ ((or (logtest? (penetrate dark-giant) arg3) (and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'eco-dark)) ) - (set! (-> s5-0 vector 2 y) (* 0.1 (-> s5-0 vector 2 y))) + (set! (-> s5-0 vector 2 y) (/ (-> s5-0 vector 2 y) 10)) (set! f0-2 (* 409600.0 (-> this info info mass))) (/ 0.4 (-> this info damage-factor)) ) diff --git a/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc b/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc index d4d384e3d32..4f270c9ce5b 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc @@ -192,7 +192,7 @@ (static-sound-name "sig-gun-powerup") (-> this powerup-sound-id) (the int (* 1024.0 f28-0)) - (the int (* 1524.0 (+ 0.5 (* 0.5 f30-0)))) + (the int (* 1524.0 (+ 0.5 (/ f30-0 2)))) 0 (sound-group sfx) s4-0 diff --git a/goal_src/jak2/levels/common/ai/sig/sig-states.gc b/goal_src/jak2/levels/common/ai/sig/sig-states.gc index 4c10258cb95..74c6c4bc2cc 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-states.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-states.gc @@ -1493,7 +1493,7 @@ (until #f (suspend) (let* ((f0-1 (vector-length (-> self root transv))) - (f0-3 (fmax 0.1 (* 0.000020345053 f0-1))) + (f0-3 (fmax 0.1 (/ f0-1 (meters 12)))) ) (ja :num! (loop! f0-3)) ) @@ -1612,14 +1612,14 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.15)) (let* ((f0-0 (vector-length (-> self root transv))) - (f0-2 (fmax 0.1 (* 0.000020345053 f0-0))) + (f0-2 (fmax 0.1 (/ f0-0 (meters 12)))) ) (ja-no-eval :group! sig-chased-run-jump-land0-ja :num! (seek! max f0-2) :frame-num 0.0) ) (until (ja-done? 0) (suspend) (let* ((f0-4 (vector-length (-> self root transv))) - (f0-6 (fmax 0.1 (* 0.000020345053 f0-4))) + (f0-6 (fmax 0.1 (/ f0-4 (meters 12)))) ) (ja :num! (seek! max f0-6)) ) @@ -1744,14 +1744,14 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.15)) (let* ((f0-0 (vector-length (-> self root transv))) - (f0-2 (fmax 0.1 (* 0.000020345053 f0-0))) + (f0-2 (fmax 0.1 (/ f0-0 (meters 12)))) ) (ja-no-eval :group! sig-chased-shoot-jump-land0-ja :num! (seek! max f0-2) :frame-num 0.0) ) (until (ja-done? 0) (suspend) (let* ((f0-4 (vector-length (-> self root transv))) - (f0-6 (fmax 0.1 (* 0.000020345053 f0-4))) + (f0-6 (fmax 0.1 (/ f0-4 (meters 12)))) ) (ja :num! (seek! max f0-6)) ) diff --git a/goal_src/jak2/levels/common/ai/sig/sig.gc b/goal_src/jak2/levels/common/ai/sig/sig.gc index 91baaf6ef89..ef168bb6a51 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig.gc @@ -958,19 +958,19 @@ (cond ((or (not (and v1-6 (= v1-6 (-> this draw art-group data 3)))) (or (= (-> this jump-why) 4) (>= f2-1 8192.0))) (logior! (-> this bot-flags) (bot-flags bf23)) - (let ((f2-3 (fmax 12288.0 (* 0.5 f1-0))) + (let ((f2-3 (fmax 12288.0 (/ f1-0 2))) (f1-3 (fmax (-> arg0 start-pos y) (-> arg0 dest-pos y))) ) (- (fmax (+ (fmin (-> arg0 start-pos y) (-> arg0 dest-pos y)) f2-3) (+ 10240.0 f1-3)) f1-3) ) ) (else - (fmax 2048.0 (* 0.2 f1-0)) + (fmax 2048.0 (/ f1-0 5)) ) ) ) ) - (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f1-4 (* 0.000011111111 f0-2)) + (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f1-4 (/ f0-2 90000)) ) ) (none) diff --git a/goal_src/jak2/levels/common/elec-gate.gc b/goal_src/jak2/levels/common/elec-gate.gc index 226279a06e5..1c6cfb993c6 100644 --- a/goal_src/jak2/levels/common/elec-gate.gc +++ b/goal_src/jak2/levels/common/elec-gate.gc @@ -750,6 +750,7 @@ ) (defmethod deactivate ((this elec-gate)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (set-elec-scale-if-close! this 0.0) (call-parent-method this) (none) @@ -773,9 +774,9 @@ (defmethod set-state! ((this elec-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed -make the gate `idle`. + make the gate `idle`. -Otherwise, the gate will be `active`." + Otherwise, the gate will be `active`." (if (or (logtest? (actor-option user17) (-> this fact options)) (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) ) @@ -788,11 +789,11 @@ Otherwise, the gate will be `active`." (defmethod init-from-entity! ((this elec-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this entity) arg0) @@ -841,7 +842,7 @@ This commonly includes things such as: (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp) ) ) - (set! (-> this wall-xz) (* 0.5 (-> this wall-xz))) + (set! (-> this wall-xz) (/ (-> this wall-xz) 2)) (+! (-> this wall-xz) 4096.0) (set! (-> this wall-y) (fabs @@ -874,8 +875,8 @@ This commonly includes things such as: (defmethod set-elec-scale! ((this fort-elec-gate) (scale float)) "Calls associated mood functions to set the scale with the value provided -@see mood-funcs -@see mood-funcs2" + @see mood-funcs + @see mood-funcs2" (set-fordumpa-electricity-scale! scale) (set-forresca-electricity-scale! scale (-> this palette-id)) (set-forrescb-electricity-scale! scale (-> this palette-id)) @@ -898,8 +899,8 @@ This commonly includes things such as: (defmethod set-elec-scale! ((this drill-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided -@see mood-funcs -@see mood-funcs2" + @see mood-funcs + @see mood-funcs2" (set-drill-electricity-scale! arg0 (-> this palette-id)) 0 (none) @@ -924,8 +925,8 @@ This commonly includes things such as: (defmethod set-elec-scale! ((this castle-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided -@see mood-funcs -@see mood-funcs2" + @see mood-funcs + @see mood-funcs2" (set-castle-electricity-scale! arg0) 0 (none) @@ -995,8 +996,8 @@ This commonly includes things such as: (defmethod set-elec-scale! ((this palroof-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided -@see mood-funcs -@see mood-funcs2" + @see mood-funcs + @see mood-funcs2" (set-palroof-electricity-scale! arg0 (-> this palette-id)) 0 (none) diff --git a/goal_src/jak2/levels/common/enemy/centurion.gc b/goal_src/jak2/levels/common/enemy/centurion.gc index e0610aa23cb..4e55e27ab93 100644 --- a/goal_src/jak2/levels/common/enemy/centurion.gc +++ b/goal_src/jak2/levels/common/enemy/centurion.gc @@ -675,7 +675,7 @@ (set! (-> s2-0 quad) (-> (get-trans (the-as process-focusable s0-0) 3) quad)) (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s2-0))) (let* ((f0-0 (vector-length s1-2)) - (f0-1 (* 0.0000030517579 f0-0)) + (f0-1 (/ f0-0 (meters 80))) (a0-7 s2-0) ) (let ((v1-17 s2-0)) diff --git a/goal_src/jak2/levels/common/enemy/flitter.gc b/goal_src/jak2/levels/common/enemy/flitter.gc index 2609429f7bb..b70f673a13b 100644 --- a/goal_src/jak2/levels/common/enemy/flitter.gc +++ b/goal_src/jak2/levels/common/enemy/flitter.gc @@ -857,7 +857,7 @@ (set! (-> this last-change-dir) (the-as uint (current-time))) (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) + (f0-9 (* (/ f30-0 2) (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) (if (-> this heading) diff --git a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc index 8e1072b32ee..64906628b43 100644 --- a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc +++ b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc @@ -1372,10 +1372,10 @@ (-> arg0 thrust s3-0) (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) (fmax 0.0 (-> v0-6 y)) - (fabs (* 0.2 (-> v0-6 z))) + (fabs (/ (-> v0-6 z) 5)) (fmax 0.0 (-> s1-1 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) @@ -1397,7 +1397,7 @@ (set! (-> *part-id-table* 721 init-specs 0 initial-valuef) (* f24-0 f0-14)) (set! (-> arg0 thrust s3-0) f28-0) (let ((f0-15 (* f26-0 f0-14))) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (* -0.5 f0-15)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (/ f0-15 -2)) ) ) ) @@ -1473,7 +1473,7 @@ ) (set! (-> *part-id-table* 721 init-specs 0 initial-valuef) f1-0) ) - (let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (* -0.5 f0-0)))) + (let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (/ f0-0 -2)))) (vector+! (-> s5-0 trans) s4-0 v1-29) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc index 7314e1f99c2..54664394a58 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc @@ -1453,7 +1453,7 @@ (vector-normalize-copy! (-> s5-0 curve-matrix vector 2) s3-0 1.0) (vector-normalize-copy! (-> s5-0 curve-matrix trans) s4-0 1.0) (set! (-> s5-0 pos-index 0) (vector-dot s3-0 (-> s5-0 curve-matrix trans))) - (set! (-> s5-0 pos-index 1) (/ (* 0.5 (-> s5-0 pos-index 0) (-> s5-0 pos-index 0)) (* 0.2 f28-0))) + (set! (-> s5-0 pos-index 1) (/ (* (/ (-> s5-0 pos-index 0) 2) (-> s5-0 pos-index 0)) (/ f28-0 5))) (set! (-> s5-0 dist) (vector-dot (-> this dest-vel) (-> s5-0 curve-matrix trans))) (vector-normalize-copy! (-> s5-0 curve-matrix vector 1) s4-0 (-> this target-speed)) (vector-! (the-as vector (-> s5-0 curve-matrix)) (-> s5-0 curve-matrix vector 1) s3-0) @@ -1674,9 +1674,9 @@ (none) ) -(defmethod relocate ((this hover-nav-control) (arg0 int)) +(defmethod relocate ((this hover-nav-control) (offset int)) (if (nonzero? (-> this root)) - (&+! (-> this root) arg0) + (&+! (-> this root) offset) ) this ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc index 77e8a473321..af89de6d114 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc @@ -26,7 +26,7 @@ (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> arg0 quad)) (let* ((f0-2 (vector-vector-distance s4-0 arg1)) - (s3-1 (+ (the int (* 0.000008138021 f0-2)) 1)) + (s3-1 (+ (the int (/ f0-2 (meters 30))) 1)) (s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) 110592.0)) ) (dotimes (s1-0 s3-1) diff --git a/goal_src/jak2/levels/common/enemy/hover/wasp.gc b/goal_src/jak2/levels/common/enemy/hover/wasp.gc index 16a2afa6a66..f3166754138 100644 --- a/goal_src/jak2/levels/common/enemy/hover/wasp.gc +++ b/goal_src/jak2/levels/common/enemy/hover/wasp.gc @@ -1210,10 +1210,10 @@ (-> arg0 thrust s3-0) (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) (fmax 0.0 (-> v0-6 y)) - (fabs (* 0.2 (-> v0-6 z))) + (fabs (/ (-> v0-6 z) 5)) (fmax 0.0 (-> s1-1 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) @@ -1237,7 +1237,7 @@ (set! (-> *part-id-table* 721 init-specs 0 initial-valuef) (* f24-0 f0-15)) (set! (-> arg0 thrust s3-0) f28-0) (let ((f0-16 (* f26-0 f0-15))) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (* -0.5 f0-16)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (/ f0-16 -2)) ) ) ) diff --git a/goal_src/jak2/levels/common/enemy/spyder.gc b/goal_src/jak2/levels/common/enemy/spyder.gc index 7c02f83a71a..43109ad34dd 100644 --- a/goal_src/jak2/levels/common/enemy/spyder.gc +++ b/goal_src/jak2/levels/common/enemy/spyder.gc @@ -1035,7 +1035,7 @@ ) ) (let ((v1-17 (-> self nav))) - (set! (-> v1-17 max-rotation-rate) (* 0.05 (-> *spyder-nav-enemy-info* maximum-rotation-rate))) + (set! (-> v1-17 max-rotation-rate) (/ (-> *spyder-nav-enemy-info* maximum-rotation-rate) 20)) ) 0 (ja-channel-push! 2 (seconds 0.2)) @@ -1067,8 +1067,7 @@ (set! (-> self fire-info 0 quad) (-> s3-0 quad)) (set! (-> self fire-info 1 quad) (-> s2-1 quad)) ) - (suspend-for - (seconds 0.2) + (suspend-for (seconds 0.2) (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) (ja :num! (loop!)) (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) diff --git a/goal_src/jak2/levels/common/entities/gun-buoy.gc b/goal_src/jak2/levels/common/entities/gun-buoy.gc index 6c91ae73c53..1b61881a8e7 100644 --- a/goal_src/jak2/levels/common/entities/gun-buoy.gc +++ b/goal_src/jak2/levels/common/entities/gun-buoy.gc @@ -516,7 +516,7 @@ (* 40.96 (seconds-per-frame)) ) ) - (let ((f30-0 (- 1.0 (fabs (* 0.000012207031 (-> self y-offset)))))) + (let ((f30-0 (- 1.0 (fabs (/ (-> self y-offset) (meters 20)))))) (let ((f0-7 (* f30-0 f30-0))) (set-vector! (-> self root scale) f30-0 f30-0 f30-0 1.0) (let ((t9-1 vector-lerp!) @@ -552,7 +552,7 @@ :code sleep-code :post (behavior () (seek! (-> self y-offset) -81920.0 (* 49152.0 (seconds-per-frame))) - (let ((f30-0 (- 1.0 (fabs (* 0.000012207031 (-> self y-offset)))))) + (let ((f30-0 (- 1.0 (fabs (/ (-> self y-offset) (meters 20)))))) (let ((f0-5 (* f30-0 f30-0))) (set-vector! (-> self root scale) f30-0 f30-0 f30-0 1.0) (let ((t9-1 vector-lerp!) @@ -826,7 +826,8 @@ (gun-buoy-method-183 self a1-1) ) ) - (suspend-for (seconds 0.75)) + (suspend-for (seconds 0.75) + ) ) (go-virtual hostile) ) @@ -852,7 +853,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (go-virtual exit-ambush) ) :post gun-buoy-chase-post @@ -1093,7 +1095,7 @@ (f1-1 (-> this elev-angle)) (f0-7 (fmax -728.1778 (fmin 728.1778 f1-1))) (f1-2 (- f1-1 f0-7)) - (f2-3 (* 0.2 f1-2)) + (f2-3 (/ f1-2 5)) (f30-0 (+ f0-7 (* 0.8 f1-2))) ) (quaternion-vector-angle! s5-1 *x-vector* f2-3) diff --git a/goal_src/jak2/levels/common/entities/spydroid.gc b/goal_src/jak2/levels/common/entities/spydroid.gc index ad664122d48..077c8ce8ba0 100644 --- a/goal_src/jak2/levels/common/entities/spydroid.gc +++ b/goal_src/jak2/levels/common/entities/spydroid.gc @@ -703,7 +703,7 @@ (set! (-> this old-y-deg) f0-5) ) (set! (-> this desire-turn) - (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) + (< (+ 0.5 (/ (-> this nav state speed) METER_LENGTH)) (* 0.005493164 (fabs (-> this diff-angle)))) ) (if (and (< (-> this root trans y) (+ -122880.0 (-> this floor))) (-> this next-state) @@ -1039,7 +1039,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-43 (ja-group))) @@ -1094,7 +1094,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-27 (ja-group))) @@ -1150,7 +1150,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-27 (ja-group))) diff --git a/goal_src/jak2/levels/common/guard-projectile.gc b/goal_src/jak2/levels/common/guard-projectile.gc index 9a03d5e6509..c5cc24ce636 100644 --- a/goal_src/jak2/levels/common/guard-projectile.gc +++ b/goal_src/jak2/levels/common/guard-projectile.gc @@ -383,7 +383,7 @@ (launch-particles (-> *part-id-table* 608) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 609 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 609 init-specs 4 initial-valuef)) ) diff --git a/goal_src/jak2/levels/common/metalhead-projectile.gc b/goal_src/jak2/levels/common/metalhead-projectile.gc index b25ea7323c5..30033922d82 100644 --- a/goal_src/jak2/levels/common/metalhead-projectile.gc +++ b/goal_src/jak2/levels/common/metalhead-projectile.gc @@ -369,7 +369,7 @@ (launch-particles (-> *part-id-table* 622) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000020345053 f30-0)) + (f26-0 (/ f30-0 (meters 12))) (f30-1 (-> *part-id-table* 623 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 623 init-specs 5 initial-valuef)) ) diff --git a/goal_src/jak2/levels/common/race/race-manager.gc b/goal_src/jak2/levels/common/race/race-manager.gc index 30a74a248a3..c164761d2a3 100644 --- a/goal_src/jak2/levels/common/race/race-manager.gc +++ b/goal_src/jak2/levels/common/race/race-manager.gc @@ -815,7 +815,7 @@ (let ((v1-3 (new 'stack-no-clear 'mystery-race-manager-type))) (set! (-> v1-3 vec1 z) 81920.0) (set! (-> v1-3 word) 4) - (set! (-> v1-3 vec0 z) (* -0.5 (-> v1-3 vec1 z))) + (set! (-> v1-3 vec0 z) (/ (-> v1-3 vec1 z) -2)) (set! (-> v1-3 vec0 w) -20480.0) (set! (-> v1-3 vec1 x) (/ (-> v1-3 vec1 z) (the float (+ (-> v1-3 word) -1)))) (set! (-> v1-3 vec1 y) -40960.0) @@ -1235,7 +1235,7 @@ (let ((v1-6 gp-1)) (set! (-> v1-6 height) (the float 70)) ) - (set! (-> gp-1 origin x) (the float (- 256 (the int (* 0.5 (-> gp-1 width)))))) + (set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2))))) (set! (-> gp-1 origin y) 320.0) (set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s5-0 print-game-text)) @@ -1263,7 +1263,7 @@ (let ((v1-6 gp-1)) (set! (-> v1-6 height) (the float 35)) ) - (set! (-> gp-1 origin x) (the float (- 256 (the int (* 0.5 (-> gp-1 width)))))) + (set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2))))) (set! (-> gp-1 origin y) 320.0) (set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s5-0 print-game-text)) @@ -1564,6 +1564,7 @@ (define *race-manager* (the-as (pointer race-manager) #f)) (defmethod deactivate ((this race-manager)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.0 0) (send-event *traffic-manager* 'restore-default-settings) (call-parent-method this) diff --git a/goal_src/jak2/levels/common/race/race-mesh.gc b/goal_src/jak2/levels/common/race/race-mesh.gc index 091fb01fc0c..fd09481ecc2 100644 --- a/goal_src/jak2/levels/common/race/race-mesh.gc +++ b/goal_src/jak2/levels/common/race/race-mesh.gc @@ -705,7 +705,7 @@ (set! (-> s3-0 cell-bits 0 quad) (the-as uint128 0)) (set! (-> s3-0 cell-bits 1 quad) (the-as uint128 0)) (let ((f0-1 (/ 1.0 (-> s4-0 cell-length))) - (f1-2 (fmin (-> arg0 search-sphere r) (* 0.5 (-> s4-0 cell-length)))) + (f1-2 (fmin (-> arg0 search-sphere r) (/ (-> s4-0 cell-length) 2))) ) (let ((f3-1 (- (-> arg0 search-sphere x) f1-2)) (f2-4 (- (-> arg0 search-sphere z) f1-2)) @@ -739,7 +739,7 @@ (+! s2-0 1) ) ) - (when (and (= (-> arg0 slice-id) -1) (< (* 0.5 (-> s4-0 cell-length)) (-> arg0 search-sphere r))) + (when (and (= (-> arg0 slice-id) -1) (< (/ (-> s4-0 cell-length) 2) (-> arg0 search-sphere r))) (while (= (-> arg0 slice-id) -1) (set! (-> s3-0 bounds min x) (max 0 (+ (-> s3-0 bounds min x) -1))) (set! (-> s3-0 bounds min z) (max 0 (+ (-> s3-0 bounds min z) -1))) diff --git a/goal_src/jak2/levels/consite/consite-scenes.gc b/goal_src/jak2/levels/consite/consite-scenes.gc index 3a79a13df38..83ba3343984 100644 --- a/goal_src/jak2/levels/consite/consite-scenes.gc +++ b/goal_src/jak2/levels/consite/consite-scenes.gc @@ -612,7 +612,7 @@ (launch-particles (-> *part-id-table* 622) s3-2) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000020345053 f30-0)) + (f26-0 (/ f30-0 (meters 12))) (f30-1 (-> *part-id-table* 623 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 623 init-specs 5 initial-valuef)) ) diff --git a/goal_src/jak2/levels/dig/dig-digger.gc b/goal_src/jak2/levels/dig/dig-digger.gc index ef573a4129f..fe65b944ee4 100644 --- a/goal_src/jak2/levels/dig/dig-digger.gc +++ b/goal_src/jak2/levels/dig/dig-digger.gc @@ -1013,7 +1013,7 @@ (set! (-> gp-0 vector 2 w) 0.0) (matrix->quaternion (-> self root quat) gp-0) ) - (set! (-> self root scale z) (* 0.000003937752 f30-0)) + (set! (-> self root scale z) (/ f30-0 (meters 62))) (when (!= (-> self old-dist) 0.0) (let ((f2-0 (fabs (- f30-0 (-> self old-dist))))) (set! (-> self frame target) (fmin 1.0 (fmax 0.0 (* 0.0008719308 (- 573.44 f2-0))))) diff --git a/goal_src/jak2/levels/dig/dig3-obs.gc b/goal_src/jak2/levels/dig/dig3-obs.gc index 827ccbfb61f..c52750f406a 100644 --- a/goal_src/jak2/levels/dig/dig3-obs.gc +++ b/goal_src/jak2/levels/dig/dig3-obs.gc @@ -831,7 +831,7 @@ (let* ((f30-0 (the float (ja-num-frames 0))) (f0-10 (+ (* 1.5 f30-0 (get-norm! (-> self parent-ptr 0 swing-sync) 0)) (if (= (-> self parent-ptr 0 options) 1) - (* 0.5 f30-0) + (/ f30-0 2) 0.0 ) ) @@ -850,7 +850,7 @@ 1.0 0.0 ) - (* 0.02 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 50) ) (dig-balloon-lurker-trapeze-method-21 self) (suspend) @@ -1055,7 +1055,7 @@ -0.5 0.5 ) - (* 0.01 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 100) ) (let ((f0-7 (+ -1.0 (fabs (* 2.0 (-> self pedal-anim-speed))))) (f1-5 (* 2.0 (fabs (-> self pedal-anim-speed)))) @@ -1253,7 +1253,7 @@ ) ) ) - (set! (-> this anim-speed) (* 0.000015258789 f0-18)) + (set! (-> this anim-speed) (/ f0-18 (meters 16))) ) (go (method-of-object this idle)) (none) diff --git a/goal_src/jak2/levels/drill/drill-baron.gc b/goal_src/jak2/levels/drill/drill-baron.gc index b76828af545..3fbb9482471 100644 --- a/goal_src/jak2/levels/drill/drill-baron.gc +++ b/goal_src/jak2/levels/drill/drill-baron.gc @@ -1219,7 +1219,7 @@ (* (-> self inc-y) (-> self clock time-adjust-ratio)) (-> self ease-y) (-> self ease-y) - (* 0.05 (-> self clock time-adjust-ratio) (-> self inc-y)) + (* (/ (-> self clock time-adjust-ratio) 20) (-> self inc-y)) ) ) (set! (-> self root trans y) @@ -1300,8 +1300,8 @@ (else (set! (-> self from-y) (-> self current-y-position)) (let ((f0-6 (fabs (- (+ f30-0 (-> v1-35 ship-y-offset)) (-> self from-y))))) - (set! (-> self inc-y) (* 0.02 f0-6)) - (set! (-> self ease-y) (* 0.2 f0-6)) + (set! (-> self inc-y) (/ f0-6 50)) + (set! (-> self ease-y) (/ f0-6 5)) ) ) ) @@ -1318,7 +1318,7 @@ (* (-> self inc-y) (-> self clock time-adjust-ratio)) (-> self ease-y) (-> self ease-y) - (* 0.05 (-> self clock time-adjust-ratio) (-> self inc-y)) + (* (/ (-> self clock time-adjust-ratio) 20) (-> self inc-y)) ) ) (if (and (= (-> self current-y-position) f28-0) (-> s5-0 alive)) @@ -1371,7 +1371,7 @@ 0.0 (* 5.0 (-> pp clock time-adjust-ratio)) 90.0 - (* 0.1 (-> pp clock time-adjust-ratio)) + (/ (-> pp clock time-adjust-ratio) 10) ) ) ) @@ -1806,7 +1806,7 @@ ) ) (until #f - (seek! (-> self anim-frame) 1.0 (* 0.01 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 1.0 (/ (-> self clock time-adjust-ratio) 100)) (let ((v1-12 (-> self skel root-channel 0))) (set! (-> v1-12 num-func) num-func-identity) (let ((f0-4 (-> self anim-frame)) @@ -1945,7 +1945,7 @@ ) :code (behavior () (until #f - (seek! (-> self anim-frame) 0.0 (* 0.01 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 100)) (let ((v1-4 (-> self skel root-channel 0))) (set! (-> v1-4 num-func) num-func-identity) (let ((f0-4 (-> self anim-frame)) diff --git a/goal_src/jak2/levels/drill/drill-obs.gc b/goal_src/jak2/levels/drill/drill-obs.gc index 985773f0c8f..dda1d1073cd 100644 --- a/goal_src/jak2/levels/drill/drill-obs.gc +++ b/goal_src/jak2/levels/drill/drill-obs.gc @@ -342,7 +342,7 @@ (until #f (let ((f30-0 (- (-> self extent 1 y) (-> self extent 0 y)))) (when (!= f30-0 (-> self length)) - (let ((f0-3 (* 0.000010172526 f30-0))) + (let ((f0-3 (/ f30-0 (meters 24)))) (ja :num! (identity f0-3)) ) (transform-post) @@ -737,16 +737,16 @@ (set! (-> s0-0 random-rangef) f30-0) ) (if s5-0 - (set! (-> s5-0 random-rangef) (* 0.5 f28-0)) + (set! (-> s5-0 random-rangef) (/ f28-0 2)) ) (if gp-0 - (set! (-> gp-0 random-rangef) (* 0.5 f30-0)) + (set! (-> gp-0 random-rangef) (/ f30-0 2)) ) (if s4-0 - (set! (-> s5-0 random-rangef) (* 0.5 f28-0)) + (set! (-> s5-0 random-rangef) (/ f28-0 2)) ) (if v1-22 - (set! (-> gp-0 random-rangef) (* 0.5 f30-0)) + (set! (-> gp-0 random-rangef) (/ f30-0 2)) ) ) (spawn-with-matrix (-> self part) (-> self local-to-world)) @@ -769,10 +769,10 @@ (set! (-> s4-1 random-rangef) f30-0) ) (if gp-1 - (set! (-> gp-1 random-rangef) (* 0.5 f28-0)) + (set! (-> gp-1 random-rangef) (/ f28-0 2)) ) (if v1-39 - (set! (-> v1-39 random-rangef) (* 0.5 f30-0)) + (set! (-> v1-39 random-rangef) (/ f30-0 2)) ) ) (spawn-with-matrix (-> self part-off) (-> self local-to-world)) @@ -883,9 +883,9 @@ (set! (-> this deadly-length) (vector-vector-distance (-> s4-1 vector 2) (the-as vector (-> s4-1 vector)))) (let ((v1-39 (-> this root root-prim))) (vector-reset! (-> v1-39 local-sphere)) - (let* ((f0-14 (* 0.5 (-> this deadly-width))) + (let* ((f0-14 (/ (-> this deadly-width) 2)) (f0-16 (* f0-14 f0-14)) - (f1-7 (* 0.5 (-> this deadly-length))) + (f1-7 (/ (-> this deadly-length) 2)) ) (set! (-> v1-39 local-sphere w) (sqrtf (+ f0-16 (* f1-7 f1-7)))) ) diff --git a/goal_src/jak2/levels/drill/ginsu.gc b/goal_src/jak2/levels/drill/ginsu.gc index f2a37cb0df1..e149549c9f2 100644 --- a/goal_src/jak2/levels/drill/ginsu.gc +++ b/goal_src/jak2/levels/drill/ginsu.gc @@ -501,7 +501,7 @@ s4-0 s4-0 s5-3 - (* (fmax 0.5 (* 0.00024414062 (-> this nav state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> this nav state speed) METER_LENGTH)) (seconds-per-frame)) ) ) ) diff --git a/goal_src/jak2/levels/forest/forest-obs.gc b/goal_src/jak2/levels/forest/forest-obs.gc index 18a9cadfd7a..f522240a365 100644 --- a/goal_src/jak2/levels/forest/forest-obs.gc +++ b/goal_src/jak2/levels/forest/forest-obs.gc @@ -151,7 +151,7 @@ (go-virtual dormant) ) ) - (set! (-> *game-info* bot-health 0) (* 0.11111111 (-> self hit-points))) + (set! (-> *game-info* bot-health 0) (/ (-> self hit-points) 9)) (transform-post) (none) ) @@ -343,7 +343,8 @@ ) ) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (send-event *camera* 'change-target #f) (cleanup-for-death self) ) @@ -594,7 +595,8 @@ (lambda :behavior task-manager () (set-time! (-> self start-time)) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (let ((s5-0 (entity-by-name "transport-level-1")) (gp-1 (entity-by-name "transport-level-2")) ) @@ -663,7 +665,8 @@ ) ) ) - (suspend-for (seconds 15)) + (suspend-for (seconds 15) + ) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer self)) (set! (-> a1-4 num-params) 1) @@ -697,7 +700,8 @@ ) ) (dotimes (s3-1 3) - (suspend-for (seconds 10)) + (suspend-for (seconds 10) + ) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) (process->ppointer self)) (set! (-> a1-6 num-params) 1) @@ -730,7 +734,8 @@ ) ) ) - (suspend-for (seconds 10)) + (suspend-for (seconds 10) + ) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) (process->ppointer self)) (set! (-> a1-8 num-params) 1) @@ -764,7 +769,8 @@ ) ) ) - (suspend-for (seconds 10)) + (suspend-for (seconds 10) + ) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer self)) (set! (-> a1-10 num-params) 1) @@ -797,7 +803,8 @@ ) ) ) - (suspend-for (seconds 10)) + (suspend-for (seconds 10) + ) (dotimes (s3-4 10) (let ((v1-114 s4-0)) (if (not (if v1-114 @@ -807,7 +814,8 @@ (goto cfg-74) ) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) ) (label cfg-74) (let ((a1-12 (new 'stack-no-clear 'event-message-block))) @@ -882,21 +890,25 @@ ) ) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) ) ) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (set-setting! 'entity-name "camera-260" 0.0 0) (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (process-grab? *target* #f) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (send-event (if s5-0 (-> s5-0 extra process) ) 'leave ) - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (send-event (if gp-1 (-> gp-1 extra process) @@ -904,11 +916,13 @@ 'leave ) ) - (suspend-for (seconds 3)) + (suspend-for (seconds 3) + ) (remove-setting! 'entity-name) (remove-setting! 'process-mask) (process-release? *target*) - (suspend-for (seconds 3)) + (suspend-for (seconds 3) + ) (go-virtual complete) (while *target* (suspend) diff --git a/goal_src/jak2/levels/forest/pegasus.gc b/goal_src/jak2/levels/forest/pegasus.gc index c2d3d00b326..53547336a59 100644 --- a/goal_src/jak2/levels/forest/pegasus.gc +++ b/goal_src/jak2/levels/forest/pegasus.gc @@ -187,8 +187,8 @@ ;; WARN: Return type mismatch int vs enemy-aware. (defmethod update-target-awareness! ((this pegasus) (proc process-focusable) (focus enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! -For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targetted for more than 5 [[seconds]] -@returns the value from [[enemy::57]], otherwise [[enemy-aware::4]]" + For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targetted for more than 5 [[seconds]] + @returns the value from [[enemy::57]], otherwise [[enemy-aware::4]]" (the-as enemy-aware (if (time-elapsed? (-> this targetted-timer) (seconds 5)) (the-as int ((method-of-type enemy update-target-awareness!) this proc focus)) 4 @@ -198,7 +198,7 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett (defmethod general-event-handler ((this pegasus) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case event-type (('track) #f @@ -237,9 +237,9 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett (defmethod damage-amount-from-attack ((this pegasus) (arg0 process) (arg1 event-message-block)) "Only attacks from the jetboard will deal max damage (6), but by default it will return `1`. -This is why the scouts are technically killable by other means -@returns the amount of damage taken from an attack. Also updates the `targetted-timer`. -@see [[*pegasus-enemy-info*]]" + This is why the scouts are technically killable by other means + @returns the amount of damage taken from an attack. Also updates the `targetted-timer`. + @see [[*pegasus-enemy-info*]]" (let ((hitpoints 1)) (let ((attack-info (the-as attack-info (-> arg1 param 1)))) (case (-> arg1 message) @@ -258,10 +258,10 @@ This is why the scouts are technically killable by other means ;; WARN: Return type mismatch symbol vs none. (defbehavior pegasus-draw-section pegasus ((path-percent-a float) (path-percent-b float) (color rgba)) "Draws the [[pegasus]] curve section between the two provided points. -@param path-percent-a Percentage along the path for the first point -@param path-percent-b Percentage along the path for the second point -param color The color to draw the curve with -@see [[curve-control]]" + @param path-percent-a Percentage along the path for the first point + @param path-percent-b Percentage along the path for the second point + param color The color to draw the curve with + @see [[curve-control]]" (let ((point-a (new 'stack-no-clear 'vector)) (point-b (new 'stack-no-clear 'vector)) ) @@ -284,9 +284,9 @@ param color The color to draw the curve with (defbehavior pegasus-show-runs pegasus () "When [[*display-path-marks*]] is enabled, allow the user to cycle through the displayed path -- Pressing [[up]] on the D-Pad will increment the path index -- Pressing [[down]] on the D-Pad will decrement the path index -Additional debug text will be displayed as well. This is useful as many paths overlap other paths" + - Pressing [[up]] on the D-Pad will increment the path index + - Pressing [[down]] on the D-Pad will decrement the path index + Additional debug text will be displayed as well. This is useful as many paths overlap other paths" (when *display-path-marks* (when (cpad-pressed? 0 up) (+! (-> self display-path) 1) @@ -335,10 +335,10 @@ Additional debug text will be displayed as well. This is useful as many paths o ;; WARN: Return type mismatch vector vs none. (defbehavior pegasus-rotate pegasus ((influenced-by-target? symbol) (angle float)) "Rotates the [[pegasus]] along the path, factoring in the current speed and the target's position -@param influenced-by-target? Whether or not to care about [[target]]'s position -@param angle The hopeful angle to use when constructing the rotation matrix, ultimately limited to `0.25` (radians?) though -@see [[target-pos]] and [[matrix-from-two-vectors-max-angle-partial!]] -@TODO - `float` should be `degrees` -- The usual amount passed in is `(degrees 100.0835)`" + @param influenced-by-target? Whether or not to care about [[target]]'s position + @param angle The hopeful angle to use when constructing the rotation matrix, ultimately limited to `0.25` (radians?) though + @see [[target-pos]] and [[matrix-from-two-vectors-max-angle-partial!]] + @TODO - `float` should be `degrees` -- The usual amount passed in is `(degrees 100.0835)`" (let ((rotation-matrix (new 'stack-no-clear 'matrix)) (flee-direction-vec (new 'stack-no-clear 'vector)) ) @@ -380,14 +380,14 @@ Additional debug text will be displayed as well. This is useful as many paths o ;; WARN: Return type mismatch float vs none. (defbehavior pegasus-loop-on-same-path pegasus () "Creates an endless loop on the same path as the name suggests -- If we are beyond the end of the path, start again near the beginning (1%) -- If we are far before the beginning, start at the beginning (0%) -- If we are atleast 1% into the path, step back 1% -- If we are less than 0% somehow, slowly add 1% -Ultimately this appears to be some sort of safe-guard to get things back into a somewhat working state -if there are unexpected path conditions -- but the results of this are not great! -Another potential explaination is to make it easy during development to identify and debug a bad path -In practice, this is never called" + - If we are beyond the end of the path, start again near the beginning (1%) + - If we are far before the beginning, start at the beginning (0%) + - If we are atleast 1% into the path, step back 1% + - If we are less than 0% somehow, slowly add 1% + Ultimately this appears to be some sort of safe-guard to get things back into a somewhat working state + if there are unexpected path conditions -- but the results of this are not great! + Another potential explaination is to make it easy during development to identify and debug a bad path + In practice, this is never called" (cond ((< 100.0 (-> self curve-position)) (set! (-> self curve-position) 1.0) @@ -407,9 +407,9 @@ In practice, this is never called" (defbehavior pegasus-choose-path pegasus () "Determines the next path the pegasus should take if we have completed the current path it's on -There are many fail-safes here if something goes wrong to try to keep the pegasus behaving -@see [[pegasus-look-on-same-path]] -@TODO - understand the path selection better" + There are many fail-safes here if something goes wrong to try to keep the pegasus behaving + @see [[pegasus-look-on-same-path]] + @TODO - understand the path selection better" (local-vars (f0-15 float) (f30-0 float)) (while (begin (label cfg-61) (or (< 1.0 (-> self curve-position)) (< (-> self curve-position) 0.0))) (let ((curr-pegasus-path (-> self path-info (-> self current-path))) @@ -523,8 +523,8 @@ There are many fail-safes here if something goes wrong to try to keep the pegasu (defbehavior pegasus-move pegasus ((explicit-y-vel float) (adjust-y-offset? symbol)) "Moves the pegasus along the path by smoothly interpolating along it -@param explicit-y-vel Normally `0.0` but this value is used when the pegasus needs to switch direction -@param adjust-y-offset? Normally [[#f]] which forces the movement to reflect the result of the collison query - the [[pegasus]] will stay close to the ground. [[#t]] ignores this" + @param explicit-y-vel Normally `0.0` but this value is used when the pegasus needs to switch direction + @param adjust-y-offset? Normally [[#f]] which forces the movement to reflect the result of the collison query - the [[pegasus]] will stay close to the ground. [[#t]] ignores this" (+! (-> self curve-position) (/ (the float (* (- (current-time) (-> self clock old-frame-counter)) (the int (-> self speed)))) (total-distance (-> self path-info (-> self current-path) path-data)) @@ -612,13 +612,13 @@ There are many fail-safes here if something goes wrong to try to keep the pegasu (defbehavior pegasus-calc-speed pegasus ((min-dist float) (max-dist float) (max-speed float) (min-speed float)) "Calculates the pegasus' speed based on a number of factors: -- Speed up as the target gets closer (up to a max) and slow down as the target is further away (up to a min) -This function also is what causes the pegasus to flip around -@param min-dist TODO -@param max-dist TODO -@param max-speed The maximum speed the pegasus can go -@param min-speed The minimum speed the pegasus can go -@returns If there should be a reaction to the target via [[enemy::72]]" + - Speed up as the target gets closer (up to a max) and slow down as the target is further away (up to a min) + This function also is what causes the pegasus to flip around + @param min-dist TODO + @param max-dist TODO + @param max-speed The maximum speed the pegasus can go + @param min-speed The minimum speed the pegasus can go + @returns If there should be a reaction to the target via [[enemy::72]]" (let ((dir-to-target (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (target-pos 0))) (react-to-target? #f) ) @@ -630,7 +630,7 @@ This function also is what causes the pegasus to flip around (if (not (time-elapsed? (-> self targetted-timer) (seconds 5))) (set! interpolated-speed (fmax 163840.0 interpolated-speed)) ) - (let ((movement-speed (* 0.0033333334 interpolated-speed))) + (let ((movement-speed (/ interpolated-speed 300))) (cond ((< (vector-dot dir-to-target (-> self tangent)) 0.0) (if (< 0.0 (-> self speed)) @@ -676,9 +676,9 @@ This function also is what causes the pegasus to flip around (defbehavior pegasus-calc-anim-speed pegasus () "Based on `speed`, adjust how fast the pegasus should animate. -The faster it's moving the fast it flaps it's wings, etc -@TODO understand the magic values here better -@returns The anim speed, it can be no lower than `1.5`" + The faster it's moving the fast it flaps it's wings, etc + @TODO understand the magic values here better + @returns The anim speed, it can be no lower than `1.5`" (let* ((speed-abs (fabs (-> self speed))) (f0-2 (* 0.07324219 speed-abs)) (f0-3 (+ -15.0 f0-2)) @@ -690,9 +690,9 @@ The faster it's moving the fast it flaps it's wings, etc (defmethod common-post ((this pegasus)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (track-how-long-aimed-at! this) (pegasus-show-runs) ((method-of-type enemy common-post) this) @@ -827,7 +827,7 @@ The faster it's moving the fast it flaps it's wings, etc (defbehavior pegasus-fly-code pegasus ((arg0 int)) "Handles the flying animations and sounds -@TODO - cleanup a bit more" + @TODO - cleanup a bit more" (let ((anim-speed (pegasus-calc-anim-speed))) (let ((gp-0 (and (-> self can-run) (< (the-as time-frame (-> self ambient-possible)) (current-time))))) (let* ((min-dist (lerp-scale 61440.0 32768.0 (the float arg0) 0.0 3000.0)) @@ -1253,13 +1253,13 @@ The faster it's moving the fast it flaps it's wings, etc ) ;; WARN: Return type mismatch enemy vs pegasus. -(defmethod relocate ((this pegasus) (arg0 int)) +(defmethod relocate ((this pegasus) (offset int)) (countdown (v1-0 20) (if (-> this path-info v1-0 path-data) - (&+! (-> this path-info v1-0 path-data) arg0) + (&+! (-> this path-info v1-0 path-data) offset) ) ) - (the-as pegasus ((method-of-type enemy relocate) this arg0)) + (the-as pegasus ((method-of-type enemy relocate) this offset)) ) (defmethod init-enemy! ((this pegasus)) diff --git a/goal_src/jak2/levels/forest/predator.gc b/goal_src/jak2/levels/forest/predator.gc index e5e59abb099..b843346b78b 100644 --- a/goal_src/jak2/levels/forest/predator.gc +++ b/goal_src/jak2/levels/forest/predator.gc @@ -405,7 +405,7 @@ (defmethod general-event-handler ((this predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) (set! (-> this shock-effect-end) (the-as uint (+ (current-time) (seconds 1)))) @@ -707,7 +707,7 @@ (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-224 quad) vf6) (let* ((f0-5 (vector-length sv-224)) - (f0-6 (* 0.0000018780048 f0-5)) + (f0-6 (/ f0-5 (meters 130))) ) (set! sv-240 (new 'stack-no-clear 'vector)) (let ((s0-0 (new 'stack-no-clear 'vector)) @@ -1310,9 +1310,9 @@ (defmethod common-post ((this predator)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy common-post))) (t9-0 this) ) @@ -1416,8 +1416,8 @@ (none) ) -(defmethod relocate ((this predator) (arg0 int)) - (call-parent-method this arg0) +(defmethod relocate ((this predator) (offset int)) + (call-parent-method this offset) ) (defmethod nav-enemy-method-167 ((this predator)) @@ -1434,6 +1434,7 @@ ) (defmethod run-logic? ((this predator)) + "Should this process be run? Checked by execute-process-tree." #t ) @@ -1450,11 +1451,11 @@ ;; WARN: Return type mismatch entity-perm-status vs none. (defmethod init-from-entity! ((this predator) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -1534,12 +1535,12 @@ This commonly includes things such as: (define *predator-manager* (the-as predator-manager #f)) ;; WARN: Return type mismatch process vs predator-manager. -(defmethod relocate ((this predator-manager) (arg0 int)) +(defmethod relocate ((this predator-manager) (offset int)) (set! *predator-manager* this) (if *predator-manager* - (set! *predator-manager* (&+ *predator-manager* arg0)) + (set! *predator-manager* (&+ *predator-manager* offset)) ) - (the-as predator-manager ((method-of-type process relocate) this arg0)) + (the-as predator-manager ((method-of-type process relocate) this offset)) ) (defmethod predator-manager-method-16 ((this predator-manager)) @@ -1594,11 +1595,11 @@ This commonly includes things such as: ;; WARN: new jak 2 until loop case, check carefully (defmethod init-from-entity! ((this predator-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (rlet ((acc :class vf) (vf0 :class vf) diff --git a/goal_src/jak2/levels/forest/wren.gc b/goal_src/jak2/levels/forest/wren.gc index 72a5a000b66..ab93266622b 100644 --- a/goal_src/jak2/levels/forest/wren.gc +++ b/goal_src/jak2/levels/forest/wren.gc @@ -126,7 +126,7 @@ ;; WARN: Return type mismatch object vs symbol. (defmethod spooked? ((this wren)) "@returns a [[symbol]] indicating if Jak is considered close enough to the wren to spook it. -If so, it transitions from [[wren::peck]] to [[wren::hunt]]" + If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) gp-0 @@ -315,7 +315,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (seek! (-> self fly-interp) (lerp-scale 0.0 1.0 f0-11 -0.2 0.5) (seconds-per-frame)) ) (let ((f30-1 (-> self fly-interp))) - (seek! (-> self path-du-mod) (+ 0.9 (* 0.2 f30-1)) (* 0.5 (seconds-per-frame))) + (seek! (-> self path-du-mod) (+ 0.9 (/ f30-1 5)) (* 0.5 (seconds-per-frame))) (set! (-> self bob-level-seek) (+ -12288.0 (* 24576.0 f30-1))) (let ((v1-59 (-> self skel root-channel 0))) (let ((f0-23 (- 1.0 f30-1))) @@ -437,11 +437,11 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this wren) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc index fe089b994a5..7417072ab0e 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc @@ -191,8 +191,8 @@ :code (behavior () (until #f (when (and (not (paused?)) (time-elapsed? (-> self state-time) (seconds 1))) - (seek! (-> self anim-frame) 0.0 (* 0.2 (-> self clock time-adjust-ratio))) - (seek! (-> self transition) 1.0 (* 0.01 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 5)) + (seek! (-> self transition) 1.0 (/ (-> self clock time-adjust-ratio) 100)) ) (set-roboscreen-alpha! (-> self transition)) (ja :num-func num-func-identity :frame-num (-> self anim-frame)) @@ -218,7 +218,7 @@ :code (behavior () (until #f (when (not (paused?)) - (seek! (-> self anim-frame) 15.0 (* 0.2 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 15.0 (/ (-> self clock time-adjust-ratio) 5)) (seek! (-> self transition) 0.0 (* 0.015 (-> self clock time-adjust-ratio))) ) (set-roboscreen-alpha! (-> self transition)) @@ -432,7 +432,7 @@ (let ((f0-0 (vector-length (vector-! (new 'stack-no-clear 'vector) (the-as vector gp-0) (the-as vector s5-0)))) (gp-1 (-> self sight-scale)) ) - (set! (-> gp-1 z) (* 0.000024414063 f0-0)) + (set! (-> gp-1 z) (/ f0-0 (meters 10))) (let ((f0-1 (lerp-scale 0.1 6.0 f0-0 61440.0 163840.0))) (set! (-> gp-1 x) f0-1) (set! (-> gp-1 y) f0-1) @@ -902,7 +902,7 @@ (let* ((f0-29 (fmax -4551.1113 (fmin 4551.1113 (- 16384.0 (acos (- (vector-dot gp-2 *y-vector*))))))) (f2-1 (- (-> self gun-elev-cam) f0-29)) (f1-12 (if (< f2-1 0.0) - (fmin 3640.889 (* (fabs (* 0.1 f2-1)) (-> self clock frames-per-second))) + (fmin 3640.889 (* (fabs (/ f2-1 10)) (-> self clock frames-per-second))) 910.2222 ) ) diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc index 483d4e52e1f..b26343a42b7 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc @@ -374,7 +374,7 @@ (f1-16 (- 1.0 f0-44)) (f26-0 0.0) ) - (when (and (or (< f0-44 f24-0) (< f24-0 f1-16)) (time-elapsed? (-> self buzz-timer) (the int (* 0.5 f30-2)))) + (when (and (or (< f0-44 f24-0) (< f24-0 f1-16)) (time-elapsed? (-> self buzz-timer) (the int (/ f30-2 2)))) (let* ((gp-2 *target*) (a0-43 (if (type? gp-2 process-focusable) gp-2 @@ -391,7 +391,7 @@ (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (* 0.49 f26-0))) - (the-as time-frame (max 45 (the int (* 0.25 f30-2)))) + (the-as time-frame (max 45 (the int (/ f30-2 4)))) ) (set-time! (-> self buzz-timer)) ) diff --git a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc index 23f7a70a8d2..02972ffff4f 100644 --- a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc @@ -37,11 +37,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fort-twist-rail) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -227,14 +227,14 @@ This commonly includes things such as: (+! (-> s4-1 y) (sqrtf (- f0-6 f2-2))) ) (let* ((f0-12 (* 2.0 (asin (/ f1-4 f30-0)))) - (f28-1 (* 0.0625 f0-12)) + (f28-1 (/ f0-12 16)) (s3-1 (new 'stack-no-clear 'vector)) ) (set! (-> s3-1 x) 0.0) (set! (-> s3-1 y) (- f30-0)) (set! (-> s3-1 z) 0.0) (set! (-> s3-1 w) 0.0) - (let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) gp-1 (* -0.5 f0-12)))) + (let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) gp-1 (/ f0-12 -2)))) (vector-orient-by-quat! s3-1 s3-1 a2-2) ) (dotimes (s2-1 17) @@ -374,14 +374,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs fort-elec-belt-inst. -(defmethod relocate ((this fort-elec-belt-inst) (arg0 int)) +(defmethod relocate ((this fort-elec-belt-inst) (offset int)) (if (nonzero? (-> this l-bolt)) - (&+! (-> this l-bolt) arg0) + (&+! (-> this l-bolt) offset) ) - (the-as fort-elec-belt-inst ((method-of-type process-drawable relocate) this arg0)) + (the-as fort-elec-belt-inst ((method-of-type process-drawable relocate) this offset)) ) (defmethod deactivate ((this fort-elec-belt-inst)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -509,21 +510,21 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process vs fort-elec-belt. -(defmethod relocate ((this fort-elec-belt) (arg0 int)) +(defmethod relocate ((this fort-elec-belt) (offset int)) (if (nonzero? (-> this path)) - (&+! (-> this path) arg0) + (&+! (-> this path) offset) ) - (the-as fort-elec-belt ((method-of-type process relocate) this arg0)) + (the-as fort-elec-belt ((method-of-type process relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this fort-elec-belt) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-64 int)) (quaternion-copy! (-> this init-quat) (-> arg0 quat)) (let ((s5-0 (new 'stack-no-clear 'sync-info-params))) @@ -643,7 +644,7 @@ This commonly includes things such as: (defmethod set-and-get-ambient-sound! ((this fort-conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] -and return it as well. Otherwise, set it to `0`" + and return it as well. Otherwise, set it to `0`" (let* ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) (v1-2 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 1.0 'interp)) (a3-3 (vector+! (new 'stack-no-clear 'vector) s5-0 v1-2)) diff --git a/goal_src/jak2/levels/intro/intro-scenes.gc b/goal_src/jak2/levels/intro/intro-scenes.gc index 39ca303d25b..28623c942a1 100644 --- a/goal_src/jak2/levels/intro/intro-scenes.gc +++ b/goal_src/jak2/levels/intro/intro-scenes.gc @@ -2237,7 +2237,7 @@ (let ((f0-2 1.0)) (cond ((< f30-0 2.0) - (set! f0-2 (* 0.5 f30-0)) + (set! f0-2 (/ f30-0 2)) ) ((< 3.0 f30-0) (set! f0-2 (* 0.5 (- 5.0 f30-0))) @@ -2359,7 +2359,7 @@ (let ((f0-6 1.0)) (cond ((< f30-0 2.0) - (set! f0-6 (* 0.5 f30-0)) + (set! f0-6 (/ f30-0 2)) ) ((< 6.0 f30-0) (set! f0-6 (* 0.5 (- 8.0 f30-0))) diff --git a/goal_src/jak2/levels/mountain/mountain-obs.gc b/goal_src/jak2/levels/mountain/mountain-obs.gc index 4ff58b96421..05a64091164 100644 --- a/goal_src/jak2/levels/mountain/mountain-obs.gc +++ b/goal_src/jak2/levels/mountain/mountain-obs.gc @@ -467,8 +467,8 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a2-2 quad) vf6) ) - (let* ((a0-30 (the int (* 0.00024414062 (-> s0-1 x)))) - (a1-20 (the int (* 0.00024414062 (-> s0-1 z)))) + (let* ((a0-30 (the int (/ (-> s0-1 x) METER_LENGTH))) + (a1-20 (the int (/ (-> s0-1 z) METER_LENGTH))) (a0-32 (/ (- *dice-offset-x* a0-30) -4)) ) (if (not (logtest? (-> *dice-blocked-array* (/ (- *dice-offset-z* a1-20) -4)) (ash 1 (- 15 a0-32)))) @@ -507,8 +507,8 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-13 quad) vf6) ) - (let* ((v1-15 (the int (* 0.00024414062 (-> s0-1 x)))) - (a0-48 (the int (* 0.00024414062 (-> s0-1 z)))) + (let* ((v1-15 (the int (/ (-> s0-1 x) METER_LENGTH))) + (a0-48 (the int (/ (-> s0-1 z) METER_LENGTH))) (v1-17 (/ (- *dice-offset-x* v1-15) -4)) (a1-31 (/ (- *dice-offset-z* a0-48) -4)) ) @@ -867,8 +867,8 @@ (set! (-> self color z) (-> self color x)) (set! (-> self draw color-mult quad) (-> self color quad)) (when (zero? (-> self active)) - (let* ((v1-15 (the int (* 0.00024414062 (-> self root trans x)))) - (a0-5 (the int (* 0.00024414062 (-> self root trans z)))) + (let* ((v1-15 (the int (/ (-> self root trans x) METER_LENGTH))) + (a0-5 (the int (/ (-> self root trans z) METER_LENGTH))) (s5-0 (/ (- *dice-offset-x* v1-15) -4)) (gp-0 (/ (- *dice-offset-z* a0-5) -4)) ) @@ -1065,8 +1065,8 @@ (set! (-> v1-9 quad 2) a2-1) (set! (-> v1-9 trans quad) a3-1) ) - (let ((v1-12 (the int (+ 2.0 (* 0.00024414062 (-> s1-0 trans x))))) - (a0-14 (the int (+ 2.0 (* 0.00024414062 (-> s1-0 trans z))))) + (let ((v1-12 (the int (+ 2.0 (/ (-> s1-0 trans x) METER_LENGTH)))) + (a0-14 (the int (+ 2.0 (/ (-> s1-0 trans z) METER_LENGTH)))) ) (set! sv-544 (/ (- *dice-offset-x* v1-12) -4)) (let ((s0-0 (/ (- *dice-offset-z* a0-14) -4))) @@ -1153,8 +1153,8 @@ (set! (-> sv-608 y) (get-ripple-height s0-1 sv-608)) (vector-! sv-576 sv-576 sv-560) (vector-! sv-608 sv-608 sv-560) - (set! (-> sv-576 y) (* 0.5 (-> sv-576 y))) - (set! (-> sv-608 y) (* 0.5 (-> sv-608 y))) + (set! (-> sv-576 y) (/ (-> sv-576 y) 2)) + (set! (-> sv-608 y) (/ (-> sv-608 y) 2)) (set! (-> sv-576 w) 0.0) (set! (-> sv-592 w) 0.0) (set! (-> sv-608 w) 0.0) @@ -1364,9 +1364,9 @@ (set! (-> this first) (the-as uint 1)) ) ) - (let* ((a0-48 (the int (* 0.00024414062 (-> this root trans x)))) - (v1-37 (the int (* 0.00024414062 (-> this root trans y)))) - (a1-21 (the int (* 0.00024414062 (-> this root trans z)))) + (let* ((a0-48 (the int (/ (-> this root trans x) METER_LENGTH))) + (v1-37 (the int (/ (-> this root trans y) METER_LENGTH))) + (a1-21 (the int (/ (-> this root trans z) METER_LENGTH))) (a0-49 (- a0-48 *dice-offset-x*)) (a2-13 (- a1-21 *dice-offset-z*)) (a1-22 (+ a0-49 1)) @@ -1998,7 +1998,7 @@ (gp-0 (-> self draw shadow-ctrl)) ) (vector<-cspace! (-> self root trans) s5-0) - (let ((f0-1 (* 0.5 (-> s5-0 bone scale y)))) + (let ((f0-1 (/ (-> s5-0 bone scale y) 2))) (set-vector! (-> self root scale) f0-1 f0-1 f0-1 1.0) ) (cond @@ -2309,7 +2309,7 @@ ) ) (when (< f30-0 122880.0) - (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (- 1.0 (* 0.000008138021 f30-0)))) (seconds 0.2)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (- 1.0 (/ f30-0 (meters 30))))) (seconds 0.2)) (activate! *camera-smush-control* (lerp-scale 1638.4 0.0 f30-0 0.0 122880.0) diff --git a/goal_src/jak2/levels/mountain/rhino.gc b/goal_src/jak2/levels/mountain/rhino.gc index bdf46fb666c..0b1178872f9 100644 --- a/goal_src/jak2/levels/mountain/rhino.gc +++ b/goal_src/jak2/levels/mountain/rhino.gc @@ -726,7 +726,7 @@ (the int (* 2.0 f30-0)) ) (else - (the int (* 0.5 f30-0)) + (the int (/ f30-0 2)) ) ) ) diff --git a/goal_src/jak2/levels/nest/boss/metalkor-extras.gc b/goal_src/jak2/levels/nest/boss/metalkor-extras.gc index b1bb81ca011..34f764aec36 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-extras.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-extras.gc @@ -638,7 +638,7 @@ (set! (-> self foot-locks s4-0 lock target) 1.0) ) (else - (vector+float*! s3-0 (-> gp-0 start-pos) (-> gp-0 move-dist) (- f0-12 (* 0.000013563368 f1-2))) + (vector+float*! s3-0 (-> gp-0 start-pos) (-> gp-0 move-dist) (- f0-12 (/ f1-2 (meters 18)))) (set! (-> self foot-locks s4-0 lock target) 0.0) ) ) @@ -987,7 +987,7 @@ (set! f28-0 0.0) ) (else - (* 0.5 f26-0) + (/ f26-0 2) ) ) ) @@ -1784,7 +1784,7 @@ (f30-0 (vector-normalize-ret-len! gp-1 1.0)) ) (quaternion-from-two-vectors! (-> self root quat) (new 'static 'vector :y -1.0) gp-1) - (set! (-> self root scale y) (* 0.000009042245 f30-0)) + (set! (-> self root scale y) (/ f30-0 (meters 27))) ) ) :code sleep-code @@ -1844,7 +1844,7 @@ (gp-2 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> self target-pos))) ) (let ((f0-4 (vector-normalize-ret-len! gp-2 1.0))) - (set! (-> self root scale y) (* 0.000009042245 f0-4)) + (set! (-> self root scale y) (/ f0-4 (meters 27))) (vector+float*! (-> self root trans) s5-0 gp-2 (- f0-4)) ) (quaternion-from-two-vectors! (-> self root quat) (new 'static 'vector :y -1.0) gp-2) @@ -2005,7 +2005,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (let ((f30-0 4096.0)) - (let ((f28-1 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) + (let ((f28-1 (* 0.00013563369 (tan (/ (-> *math-camera* fov) 2)) f30-0))) (matrix->quaternion (-> self root quat) s5-0) (set-vector! (-> self root scale) f28-1 f28-1 f28-1 1.0) ) diff --git a/goal_src/jak2/levels/nest/boss/metalkor-states.gc b/goal_src/jak2/levels/nest/boss/metalkor-states.gc index 062658fc749..561689360ba 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-states.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-states.gc @@ -685,10 +685,10 @@ ) ) ((= (-> self stage) 3) - (* 0.004 f28-0) + (/ f28-0 250) ) (else - (* 0.008 f28-0) + (/ f28-0 125) ) ) ) @@ -1390,7 +1390,7 @@ ) ) (when (!= f30-0 0.0) - (matrix-axis-angle! s5-0 (-> gp-0 vector 1) (* 0.5 (-> self clock time-adjust-ratio) f30-0)) + (matrix-axis-angle! s5-0 (-> gp-0 vector 1) (* (/ (-> self clock time-adjust-ratio) 2) f30-0)) (matrix*! gp-0 gp-0 s5-0) (matrix-remove-z-rot gp-0 (new 'static 'vector :y -1.0)) (matrix->quaternion (-> self root quat) gp-0) @@ -1967,7 +1967,7 @@ (s4-0 (new 'stack-no-clear 'vector)) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (let ((f30-0 (* 4096.0 (* 0.25 (-> self clock time-adjust-ratio)))) + (let ((f30-0 (* 4096.0 (/ (-> self clock time-adjust-ratio) 4))) (s1-0 #f) ) (set! (-> s3-0 quad) (-> self root trans quad)) diff --git a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc index f8169455bd3..04f8a244717 100644 --- a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc +++ b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc @@ -409,7 +409,7 @@ (launch-particles (-> *part-id-table* 622) s3-2) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000020345053 f30-0)) + (f26-0 (/ f30-0 (meters 12))) (f30-1 (-> *part-id-table* 623 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 623 init-specs 5 initial-valuef)) ) diff --git a/goal_src/jak2/levels/palace/boss/squid-setup.gc b/goal_src/jak2/levels/palace/boss/squid-setup.gc index 9320778e18e..8269d8a9168 100644 --- a/goal_src/jak2/levels/palace/boss/squid-setup.gc +++ b/goal_src/jak2/levels/palace/boss/squid-setup.gc @@ -1064,13 +1064,13 @@ ) ;; WARN: Return type mismatch process-drawable vs squid-tentacle. -(defmethod relocate ((this squid-tentacle) (arg0 int)) +(defmethod relocate ((this squid-tentacle) (offset int)) (dotimes (v1-0 11) (if (nonzero? (-> this chain-joints v1-0 joint-mod)) - (&+! (-> this chain-joints v1-0 joint-mod) arg0) + (&+! (-> this chain-joints v1-0 joint-mod) offset) ) ) - (the-as squid-tentacle ((method-of-type process-drawable relocate) this arg0)) + (the-as squid-tentacle ((method-of-type process-drawable relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. @@ -1499,6 +1499,7 @@ ) (defmethod deactivate ((this squid)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this thruster-part)) (kill-and-free-particles (-> this thruster-part)) ) @@ -1519,39 +1520,39 @@ ) ;; WARN: Return type mismatch process-drawable vs squid. -(defmethod relocate ((this squid) (arg0 int)) +(defmethod relocate ((this squid) (offset int)) (if (nonzero? (-> this thruster-part)) - (&+! (-> this thruster-part) arg0) + (&+! (-> this thruster-part) offset) ) (if (nonzero? (-> this first-path)) - (&+! (-> this first-path) arg0) + (&+! (-> this first-path) offset) ) (if (nonzero? (-> this second-path)) - (&+! (-> this second-path) arg0) + (&+! (-> this second-path) offset) ) (if (nonzero? (-> this third-path)) - (&+! (-> this third-path) arg0) + (&+! (-> this third-path) offset) ) (if (nonzero? (-> this gun-tilt-left-jm)) - (&+! (-> this gun-tilt-left-jm) arg0) + (&+! (-> this gun-tilt-left-jm) offset) ) (if (nonzero? (-> this gun-tilt-right-jm)) - (&+! (-> this gun-tilt-right-jm) arg0) + (&+! (-> this gun-tilt-right-jm) offset) ) (if (nonzero? (-> this tentacle-base-jm)) - (&+! (-> this tentacle-base-jm) arg0) + (&+! (-> this tentacle-base-jm) offset) ) - (the-as squid ((method-of-type process-drawable relocate) this arg0)) + (the-as squid ((method-of-type process-drawable relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this squid) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate @@ -2831,7 +2832,7 @@ This commonly includes things such as: (launch-particles (-> *part-id-table* 4859) s4-1) ) (let ((s4-2 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000012207031 f30-0)) + (f26-0 (/ f30-0 (meters 20))) (f30-1 (-> *part-id-table* 4860 init-specs 3 initial-valuef)) (f28-0 (-> *part-id-table* 4860 init-specs 4 initial-valuef)) ) diff --git a/goal_src/jak2/levels/palace/boss/squid-states.gc b/goal_src/jak2/levels/palace/boss/squid-states.gc index 1b5a1084c86..d59c05efd60 100644 --- a/goal_src/jak2/levels/palace/boss/squid-states.gc +++ b/goal_src/jak2/levels/palace/boss/squid-states.gc @@ -1441,7 +1441,7 @@ ) ) (set! (-> self gun-tilt) (fmin 8192.0 (fmax -8192.0 (-> self gun-tilt)))) - (let ((f30-2 (* 0.5 (-> self gun-tilt)))) + (let ((f30-2 (/ (-> self gun-tilt) 2))) (quaternion-set! (-> self gun-tilt-left-jm quat) (sin f30-2) 0.0 0.0 (cos f30-2)) ) (quaternion-copy! (-> self gun-tilt-right-jm quat) (-> self gun-tilt-left-jm quat)) diff --git a/goal_src/jak2/levels/palace/cable/palcab-obs.gc b/goal_src/jak2/levels/palace/cable/palcab-obs.gc index 961cde7a975..1ed3c3718f9 100644 --- a/goal_src/jak2/levels/palace/cable/palcab-obs.gc +++ b/goal_src/jak2/levels/palace/cable/palcab-obs.gc @@ -140,7 +140,7 @@ (s1-0 (quaternion-rotate-local-z! (new 'stack-no-clear 'quaternion) (-> self root quat) - (+ (-> s4-0 z-rotate) (* 0.2 f28-0)) + (+ (-> s4-0 z-rotate) (/ f28-0 5)) ) ) ) @@ -189,25 +189,25 @@ ) ;; WARN: Return type mismatch process-drawable vs pal-electric-fan. -(defmethod relocate ((this pal-electric-fan) (arg0 int)) +(defmethod relocate ((this pal-electric-fan) (offset int)) (dotimes (v1-0 3) (dotimes (a2-0 6) (if (nonzero? (-> (the-as pal-electric-fan (&+ this (* 112 v1-0))) poles 0 rings a2-0 lightning)) - (&+! (-> (the-as pal-electric-fan (&+ this (* 112 v1-0))) poles 0 rings a2-0 lightning) arg0) + (&+! (-> (the-as pal-electric-fan (&+ this (* 112 v1-0))) poles 0 rings a2-0 lightning) offset) ) ) ) - (the-as pal-electric-fan ((method-of-type process-drawable relocate) this arg0)) + (the-as pal-electric-fan ((method-of-type process-drawable relocate) this offset)) ) ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this pal-electric-fan) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -431,11 +431,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this pal-cable-nut) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -545,7 +545,7 @@ This commonly includes things such as: (launch-particles (-> *part-id-table* 608) s4-1) ) (let ((s4-2 (new 'stack-no-clear 'matrix)) - (f22-0 (* 0.000027126736 f30-0)) + (f22-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 609 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 609 init-specs 4 initial-valuef)) (f26-1 (-> *part-id-table* 609 init-specs 1 initial-valuef)) @@ -891,6 +891,7 @@ This commonly includes things such as: ) (defmethod deactivate ((this pal-rot-gun)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (sound-stop (-> this shot-sound-id)) (call-parent-method this) @@ -900,11 +901,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this pal-rot-gun) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -965,11 +966,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this pal-windmill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (logior! (-> this mask) (process-mask ambient)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -1040,11 +1041,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this pal-flip-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/goal_src/jak2/levels/palace/throne/metalkor-texture.gc b/goal_src/jak2/levels/palace/throne/metalkor-texture.gc index 8737c9a431c..c8088269b3b 100644 --- a/goal_src/jak2/levels/palace/throne/metalkor-texture.gc +++ b/goal_src/jak2/levels/palace/throne/metalkor-texture.gc @@ -163,8 +163,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) diff --git a/goal_src/jak2/levels/ruins/mechtest-obs.gc b/goal_src/jak2/levels/ruins/mechtest-obs.gc index 67a91aff894..f26db2d6a62 100644 --- a/goal_src/jak2/levels/ruins/mechtest-obs.gc +++ b/goal_src/jak2/levels/ruins/mechtest-obs.gc @@ -193,7 +193,7 @@ ) ) ) - (vector-float*! (-> s4-0 transv) s3-0 (* 0.1 (-> self clock frames-per-second))) + (vector-float*! (-> s4-0 transv) s3-0 (/ (-> self clock frames-per-second) 10)) ) (let ((v1-35 (-> s4-0 root-prim))) (set! (-> v1-35 prim-core collide-as) (-> s4-0 backup-collide-as)) @@ -436,11 +436,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this throwblock) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -511,11 +511,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this pushblock) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/goal_src/jak2/levels/ruins/pillar-collapse.gc b/goal_src/jak2/levels/ruins/pillar-collapse.gc index e8bcc676e00..e812934e455 100644 --- a/goal_src/jak2/levels/ruins/pillar-collapse.gc +++ b/goal_src/jak2/levels/ruins/pillar-collapse.gc @@ -63,7 +63,7 @@ (a0-8 (-> gp-1 mode)) (v1-6 (cond ((= a0-8 'mech-punch) - (and (< f1-1 0.0) (< (fabs (* 0.5 f0-3)) (fabs f1-1))) + (and (< f1-1 0.0) (< (fabs (/ f0-3 2)) (fabs f1-1))) ) ((= a0-8 'crush) (< (sqrtf (+ (* (-> v1-4 x) (-> v1-4 x)) (* (-> v1-4 z) (-> v1-4 z)))) 40960.0) @@ -230,11 +230,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this ruins-pillar-collapse) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape-moving)) (stack-size-set! (-> this main-thread) 512) (logior! (-> this mask) (process-mask collectable)) diff --git a/goal_src/jak2/levels/ruins/rapid-gunner.gc b/goal_src/jak2/levels/ruins/rapid-gunner.gc index f09dbafcb05..f97d0ba8819 100644 --- a/goal_src/jak2/levels/ruins/rapid-gunner.gc +++ b/goal_src/jak2/levels/ruins/rapid-gunner.gc @@ -240,7 +240,7 @@ (defmethod general-event-handler ((this rapid-gunner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch) (logclear! (-> this mask) (process-mask actor-pause)) @@ -465,10 +465,10 @@ (defmethod in-aggro-range? ((this rapid-gunner) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. -- if `activate-distance` is `0.0`, always true -- otherwise, check if the provided process is close enough -@param proc The process used to distance check -@returns true/false" + - if `activate-distance` is `0.0`, always true + - otherwise, check if the provided process is close enough + @param proc The process used to distance check + @returns true/false" (let ((t9-0 (method-of-type nav-enemy in-aggro-range?))) (and (t9-0 this arg0 arg1) (or (not (logtest? (-> this fact enemy-options) (enemy-option user8))) @@ -567,9 +567,9 @@ (defmethod common-post ((this rapid-gunner)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy common-post))) (t9-0 this) ) @@ -823,7 +823,7 @@ (seek-to-point-toward-point! (-> self root) (get-trans (the-as process-focusable a0-2) 3) - (* 0.5 (-> self nav max-rotation-rate)) + (/ (-> self nav max-rotation-rate) 2) (seconds 0.5) ) ) @@ -1411,11 +1411,11 @@ (none) ) -(defmethod relocate ((this rapid-gunner) (arg0 int)) +(defmethod relocate ((this rapid-gunner) (offset int)) (if (nonzero? (-> this joint)) - (&+! (-> this joint) arg0) + (&+! (-> this joint) offset) ) - (call-parent-method this arg0) + (call-parent-method this offset) ) (defmethod init-enemy! ((this rapid-gunner)) diff --git a/goal_src/jak2/levels/sewer/sewer-obs2.gc b/goal_src/jak2/levels/sewer/sewer-obs2.gc index 03c16aed46b..19455566f30 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs2.gc @@ -291,7 +291,7 @@ (f28-0 (seek-ease f0-8 0.0 - (* (lerp 21299.2 8192.0 (* 0.000005086263 (-> self spin-rate))) (seconds-per-frame)) + (* (lerp 21299.2 8192.0 (/ (-> self spin-rate) (meters 48))) (seconds-per-frame)) 12288.0 2.0 ) @@ -861,7 +861,8 @@ ) ) (cleanup-for-death self) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ) diff --git a/goal_src/jak2/levels/stadium/stadium-obs.gc b/goal_src/jak2/levels/stadium/stadium-obs.gc index 6386b516602..23acec5162d 100644 --- a/goal_src/jak2/levels/stadium/stadium-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-obs.gc @@ -589,7 +589,7 @@ ) (rigid-body-method-18 (-> v1-27 state) a1-12 a2-3) ) - (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> this escort-force 0 y))) + (vector-normalize-copy! s5-0 *y-vector* (* (/ f30-0 2) f28-0 (-> this escort-force 0 y))) (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 1) (-> this root quat)) (vector+! gp-0 gp-0 (-> this root trans)) (let ((v1-34 (-> this rbody)) @@ -606,7 +606,7 @@ ) (rigid-body-method-18 (-> v1-40 state) a1-21 a2-8) ) - (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> this escort-force 1 y))) + (vector-normalize-copy! s5-0 *y-vector* (* (/ f30-0 2) f28-0 (-> this escort-force 1 y))) ) ) (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 3) (-> this root quat)) @@ -1600,7 +1600,7 @@ (ja-no-eval :group! (-> self draw art-group data (-> self walk-anim)) :num! (loop!) :frame-num 0.0) (until #f (suspend) - (let ((f0-3 (fmax 0.2 (* 0.00008138021 (-> self observed-speed))))) + (let ((f0-3 (fmax 0.2 (/ (-> self observed-speed) (meters 3))))) (ja :num! (loop! f0-3)) ) ) @@ -2082,7 +2082,7 @@ ) (until #f (suspend) - (let ((f30-0 (fmax 0.2 (* 0.00008138021 (-> self observed-speed)))) + (let ((f30-0 (fmax 0.2 (/ (-> self observed-speed) (meters 3)))) (f28-0 0.0) ) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) diff --git a/goal_src/jak2/levels/tomb/widow-baron.gc b/goal_src/jak2/levels/tomb/widow-baron.gc index 9e4bbe73795..7756f754589 100644 --- a/goal_src/jak2/levels/tomb/widow-baron.gc +++ b/goal_src/jak2/levels/tomb/widow-baron.gc @@ -112,8 +112,8 @@ (defmethod init ((this widow-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this xz-max) (* 0.5 arg2)) - (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this xz-max) (/ arg2 2)) + (set! (-> this y-max) (/ arg3 2)) (set! (-> this timer) 0) (vector-reset! (-> this value)) 0 @@ -516,11 +516,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this tomb-boss-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (case ((method-of-type res-lump get-property-struct) (-> this entity) 'tomb-boss-bridge-type diff --git a/goal_src/jak2/levels/tomb/widow-extras.gc b/goal_src/jak2/levels/tomb/widow-extras.gc index c82673045a5..b5093678a2d 100644 --- a/goal_src/jak2/levels/tomb/widow-extras.gc +++ b/goal_src/jak2/levels/tomb/widow-extras.gc @@ -591,21 +591,21 @@ ) (let ((s3-0 quaternion-set!) (s2-0 s5-0) - (s1-0 (sin (* 0.5 (-> this x-rotate)))) + (s1-0 (sin (/ (-> this x-rotate) 2))) (s0-0 0.0) ) (set! sv-48 (the-as float 0.0)) - (let ((t0-0 (cos (* 0.5 (-> this x-rotate))))) + (let ((t0-0 (cos (/ (-> this x-rotate) 2)))) (s3-0 s2-0 s1-0 s0-0 sv-48 t0-0) ) ) (let ((s3-1 quaternion-set!) (s2-1 gp-0) (s1-1 0.0) - (s0-1 (sin (* 0.5 (-> this y-rotate)))) + (s0-1 (sin (/ (-> this y-rotate) 2))) ) (set! sv-64 (the-as float 0.0)) - (let ((t0-1 (cos (* 0.5 (-> this y-rotate))))) + (let ((t0-1 (cos (/ (-> this y-rotate) 2)))) (s3-1 s2-1 s1-1 s0-1 sv-64 t0-1) ) ) @@ -1272,7 +1272,7 @@ (vector-! v1-42 arg1 arg0) (set! (-> v1-42 y) 0.0) (let ((f30-1 (atan (-> v1-42 x) (-> v1-42 z)))) - (quaternion-set! (-> self root quat) 0.0 (sin (* 0.5 f30-1)) 0.0 (cos (* 0.5 f30-1))) + (quaternion-set! (-> self root quat) 0.0 (sin (/ f30-1 2)) 0.0 (cos (/ f30-1 2))) ) ) (set! (-> self which-trajectory) 0) diff --git a/goal_src/jak2/levels/under/jellyfish.gc b/goal_src/jak2/levels/under/jellyfish.gc index 150a7ac4303..2c7f94260de 100644 --- a/goal_src/jak2/levels/under/jellyfish.gc +++ b/goal_src/jak2/levels/under/jellyfish.gc @@ -787,7 +787,7 @@ (defmethod general-event-handler ((this jellyfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy -@TODO - unsure if there is a pattern for the events and this should have a more specific name" + @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -931,7 +931,7 @@ (vector-normalize! s3-1 f28-0) (vector+! (-> this charge-pos) s5-0 s3-1) (let ((f30-0 f28-0) - (f28-1 (* 0.000024414063 f28-0)) + (f28-1 (/ f28-0 (meters 10))) (s3-2 0) (s2-0 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) @@ -1015,9 +1015,9 @@ (defmethod common-post ((this jellyfish)) "Does a lot of various things relating to interacting with the target -- tracks when the enemy was last drawn -- looks at the target and handles attacking -@TODO Not extremely well understood yet" + - tracks when the enemy was last drawn + - looks at the target and handles attacking + @TODO Not extremely well understood yet" (let ((v1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) (-> this main-joint-acc) (-> this root quat))) ) (+! (-> this tentacle-clock) @@ -1146,16 +1146,17 @@ ) ;; WARN: Return type mismatch hover-enemy vs jellyfish. -(defmethod relocate ((this jellyfish) (arg0 int)) +(defmethod relocate ((this jellyfish) (offset int)) (dotimes (v1-0 5) (if (nonzero? (-> this tentacles v1-0)) - (&+! (-> this tentacles v1-0) arg0) + (&+! (-> this tentacles v1-0) offset) ) ) - (the-as jellyfish ((method-of-type hover-enemy relocate) this arg0)) + (the-as jellyfish ((method-of-type hover-enemy relocate) this offset)) ) (defmethod deactivate ((this jellyfish)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this sound-id)) (call-parent-method this) (none) diff --git a/goal_src/jak2/levels/under/under-obs.gc b/goal_src/jak2/levels/under/under-obs.gc index 7412d52e3eb..d1eaa84f2ed 100644 --- a/goal_src/jak2/levels/under/under-obs.gc +++ b/goal_src/jak2/levels/under/under-obs.gc @@ -1318,7 +1318,7 @@ s5-1 ) (vector-normalize! s5-1 1.0) - (vector-seek-3d-smooth! (-> gp-1 vector 1) s5-1 (* 0.5 (-> self clock time-adjust-ratio)) 0.5) + (vector-seek-3d-smooth! (-> gp-1 vector 1) s5-1 (/ (-> self clock time-adjust-ratio) 2) 0.5) (vector-normalize! s5-1 1.0) (quaternion-from-two-vectors-partial! (-> self head-mod quat) diff --git a/goal_src/jak2/levels/under/underb-master.gc b/goal_src/jak2/levels/under/underb-master.gc index b167374587a..2dd581dc1fe 100644 --- a/goal_src/jak2/levels/under/underb-master.gc +++ b/goal_src/jak2/levels/under/underb-master.gc @@ -173,6 +173,7 @@ (define *underb-master* (the-as (pointer underb-master) #f)) (defmethod deactivate ((this underb-master)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (sound-stop (-> this ambient-sound-id)) (send-event (handle->process (-> this warp-handle)) 'die-fast) (set! *underb-master* (the-as (pointer underb-master) #f)) @@ -620,14 +621,15 @@ ;; WARN: Return type mismatch process-drawable vs under-locking. -(defmethod relocate ((this under-locking) (arg0 int)) +(defmethod relocate ((this under-locking) (offset int)) (if (nonzero? (-> this draining-part)) - (&+! (-> this draining-part) arg0) + (&+! (-> this draining-part) offset) ) - (the-as under-locking ((method-of-type process-drawable relocate) this arg0)) + (the-as under-locking ((method-of-type process-drawable relocate) this offset)) ) (defmethod deactivate ((this under-locking)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (if (nonzero? (-> this draining-part)) (kill-and-free-particles (-> this draining-part)) ) @@ -1039,11 +1041,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! ((this under-locking) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. -This commonly includes things such as: -- stack size -- collision information -- loading the skeleton group / bones -- sounds" + This commonly includes things such as: + - stack size + - collision information + - loading the skeleton group / bones + - sounds" (local-vars (sv-16 res-tag)) (set! (-> this which-reminder?) #f) (set! (-> this spooled-sound-id) (new 'static 'sound-id)) diff --git a/goal_src/jak3/engine/camera/cam-layout.gc b/goal_src/jak3/engine/camera/cam-layout.gc index fc7746d8176..95e918b380d 100644 --- a/goal_src/jak3/engine/camera/cam-layout.gc +++ b/goal_src/jak3/engine/camera/cam-layout.gc @@ -1072,7 +1072,7 @@ (defun fov->maya ((arg0 float)) (if (= arg0 0.0) 0.0 - (/ 12.700255 (tan (* 0.5 arg0))) + (/ 12.700255 (tan (/ arg0 2))) ) ) diff --git a/goal_src/jak3/engine/camera/cam-master.gc b/goal_src/jak3/engine/camera/cam-master.gc index abdd08ca09d..5ca59215f7e 100644 --- a/goal_src/jak3/engine/camera/cam-master.gc +++ b/goal_src/jak3/engine/camera/cam-master.gc @@ -231,10 +231,10 @@ (let ((f30-0 (vector-dot s5-7 (-> self local-down)))) (vector--float*! s5-7 s5-7 (-> self local-down) f30-0) (if (< 0.0 f30-0) - (set! (-> self upspeed) (* 0.5 (-> self upspeed))) + (set! (-> self upspeed) (/ (-> self upspeed) 2)) ) (vector+! (-> self tpos-tgt) (-> self tpos-tgt) s5-7) - (let ((f0-26 (* 0.05 f30-0))) + (let ((f0-26 (/ f30-0 20))) (vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) f0-26) ) ) @@ -995,9 +995,7 @@ (-> self local-down) (vector-normalize-copy! (-> self local-down) (-> *standard-dynamics* gravity) 1.0) ) - (when (nonzero? cam-master-effect) ;; og:preserve-this not-yet-implemented check - (cam-master-effect) - ) + (cam-master-effect) ) ) :code (behavior () @@ -1059,9 +1057,7 @@ (let ((a1-4 (new-stack-vector0))) (tracking-spline-method-10 (-> self target-spline) a1-4) ) - (when (nonzero? group-rain-screend-drop) ;; og:preserve-this not-yet-implemented check - (set! (-> self water-drip) (create-launch-control group-rain-screend-drop self)) - ) + (set! (-> self water-drip) (create-launch-control group-rain-screend-drop self)) (set! (-> self water-drip-time) (seconds -60)) (go cam-master-active) 0 diff --git a/goal_src/jak3/engine/camera/cam-states-dbg.gc b/goal_src/jak3/engine/camera/cam-states-dbg.gc index f36e06d6d4f..fea30383f29 100644 --- a/goal_src/jak3/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak3/engine/camera/cam-states-dbg.gc @@ -47,10 +47,10 @@ ) (cond ((cpad-hold? (-> *CAMERA-bank* joypad) r2) - (set! (-> s5-0 y) (- (-> s5-0 y) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) - (set! (-> s5-0 x) (- (-> s5-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0)))) - (+! (-> gp-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f28-0)) - (+! (-> gp-0 z) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f30-0)) + (set! (-> s5-0 y) (- (-> s5-0 y) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f26-0)))) + (set! (-> s5-0 x) (- (-> s5-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f0-0)))) + (+! (-> gp-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f28-0)) + (+! (-> gp-0 z) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f30-0)) ) (else (set! (-> s5-0 y) (- (-> s5-0 y) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) @@ -293,16 +293,16 @@ ((logtest? (-> (the-as cpad-list (+ (* arg4 4) (the-as int *cpad-list*))) cpads 0 button0-abs 0) (pad-buttons l2) ) - (set! (-> arg1 y) (- (-> arg1 y) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f24-0)))) - (set! (-> arg1 x) (- (-> arg1 x) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f0-19)))) + (set! (-> arg1 y) (- (-> arg1 y) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f24-0)))) + (set! (-> arg1 x) (- (-> arg1 x) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f0-19)))) ) (else (set! (-> arg1 y) (- (-> arg1 y) (* (- f24-0) (-> *CAM_FREE-bank* rot-speed)))) (set! (-> arg1 x) (- (-> arg1 x) (* (- f0-19) (-> *CAM_FREE-bank* rot-speed)))) ) ) - (+! (-> arg2 x) (* 0.2 f30-0 f26-2)) - (+! (-> arg2 z) (* 0.2 f30-0 f28-4)) + (+! (-> arg2 x) (* (/ f30-0 5) f26-2)) + (+! (-> arg2 z) (* (/ f30-0 5) f28-4)) ) ((and (not s3-0) (cpad-hold? arg4 l2)) (+! (-> arg2 x) (* f26-2 f30-0)) diff --git a/goal_src/jak3/engine/camera/cam-states.gc b/goal_src/jak3/engine/camera/cam-states.gc index 8bd1dc27e9d..2776f902888 100644 --- a/goal_src/jak3/engine/camera/cam-states.gc +++ b/goal_src/jak3/engine/camera/cam-states.gc @@ -2443,7 +2443,7 @@ (set! f28-0 0.0) ) (if (-> self have-phony-joystick) - (set! f28-0 (* 0.05 (-> self phony-joystick-y))) + (set! f28-0 (/ (-> self phony-joystick-y) 20)) ) (if (and (-> *camera* being-attacked) (not (time-elapsed? (-> *camera* attack-start) (seconds 0.25)))) (set! f28-0 0.05) @@ -2466,7 +2466,7 @@ (let ((f0-23 f26-0)) (when (and (< f26-0 0.0) (not (logtest? (cam-slave-options BOMBBOT) (-> *camera* settings slave-options)))) (let ((f0-26 - (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (* 0.5 (-> self string-min-val z))) + (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (/ (-> self string-min-val z) 2)) ) ) (set! f0-23 (fmin 0.75 f0-26)) diff --git a/goal_src/jak3/engine/camera/camera.gc b/goal_src/jak3/engine/camera/camera.gc index f094a459b66..8733bdd8fb5 100644 --- a/goal_src/jak3/engine/camera/camera.gc +++ b/goal_src/jak3/engine/camera/camera.gc @@ -285,7 +285,7 @@ 0.0 ) ((>= 0.25 arg0) - (* 0.5 arg0) + (/ arg0 2) ) ((>= arg0 0.75) (- 1.0 (* 0.5 (- 1.0 arg0))) @@ -788,7 +788,7 @@ (the-as vector (-> this point (-> this end-point))) ) (let* ((f0-0 (vector-length s3-0)) - (f1-1 (* 0.33333334 (- 1.5 (* 0.00024414062 f0-0)))) + (f1-1 (* 0.33333334 (- 1.5 (/ f0-0 METER_LENGTH)))) ) 0.0 (let* ((f1-2 (fmax 0.0 f1-1)) @@ -818,7 +818,7 @@ (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-18))) ) (let* ((f0-5 (vector-normalize-ret-len! s2-0 1.0)) - (f0-6 (* 0.5 f0-5)) + (f0-6 (/ f0-5 2)) (f26-0 (* (fmin 1.0 f0-6) f30-0 (vector-dot arg0 s2-0))) ) (let ((f1-14 (vector-dot s2-0 s3-0))) @@ -894,7 +894,7 @@ (tracking-spline-method-19 this (* (-> this max-move) (-> pp clock time-adjust-ratio)) arg0 arg5 s3-0) (tracking-spline-method-14 this s3-0) (dotimes (s2-0 63) - (tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 arg5 s3-0) + (tracking-spline-method-18 this (/ (-> this sample-len) 64) arg0 arg5 s3-0) ) (vector-float*! arg0 arg0 0.015625) (vector-float*! arg5 arg5 0.015625) @@ -1283,7 +1283,7 @@ (vector-! s2-0 s2-0 (-> arg0 follow-off)) (vector-float*! s2-0 s2-0 f0-23) ) - (+! (-> arg0 follow-blend) (* 0.016666668 (-> pp clock time-adjust-ratio))) + (+! (-> arg0 follow-blend) (/ (-> pp clock time-adjust-ratio) 60)) (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s2-0) ) (else @@ -1518,7 +1518,7 @@ (let ((f28-0 (vector-dot s3-0 (-> arg0 rvec)))) (set! sv-128 s2-0) (set! sv-112 (-> arg0 rvec)) - (let ((f0-7 (* 0.8 (tan (* 0.5 arg2))))) + (let ((f0-7 (* 0.8 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-112 quad)) (let ((v1-11 f0-7)) (.mov vf2 v1-11) @@ -1551,7 +1551,7 @@ (let ((f28-1 (vector-dot s3-0 (-> arg0 uvec)))) (set! sv-160 s2-0) (set! sv-144 (-> arg0 uvec)) - (let ((f0-16 (* 0.525 (tan (* 0.5 arg2))))) + (let ((f0-16 (* 0.525 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-144 quad)) (let ((v1-32 f0-16)) (.mov vf2 v1-32) @@ -1577,7 +1577,7 @@ (let ((f28-2 (vector-dot s3-0 (-> arg0 uvec)))) (let ((s0-1 s2-0)) (set! sv-176 (-> arg0 uvec)) - (let ((f0-26 (* 0.525 (tan (* 0.5 arg2))))) + (let ((f0-26 (* 0.525 (tan (/ arg2 2))))) (vector-float*! s0-1 sv-176 f0-26) ) ) @@ -1741,7 +1741,7 @@ (set! sv-256 vector-into-frustum-nosmooth!) (set! sv-272 s1-0) (set! sv-288 arg1) - (let ((a2-5 (lerp-clamp arg3 (* 0.25 arg3) (-> arg0 underwater-blend value)))) + (let ((a2-5 (lerp-clamp arg3 (/ arg3 4) (-> arg0 underwater-blend value)))) (sv-256 sv-272 sv-288 a2-5) ) (cond diff --git a/goal_src/jak3/engine/collide/collide-touch.gc b/goal_src/jak3/engine/collide/collide-touch.gc index 2355329d66a..592fd009f6a 100644 --- a/goal_src/jak3/engine/collide/collide-touch.gc +++ b/goal_src/jak3/engine/collide/collide-touch.gc @@ -488,7 +488,7 @@ ) ) (let ((f1-2 (- (- (vector-length gp-1) (-> v1-0 prim-core world-sphere w)) (-> s4-0 prim-core world-sphere w)))) - (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2))) + (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (/ f1-2 2))) ) (vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core))) ) diff --git a/goal_src/jak3/engine/common-obs/blocking-plane.gc b/goal_src/jak3/engine/common-obs/blocking-plane.gc index 7b681e325a3..18d1affbafa 100644 --- a/goal_src/jak3/engine/common-obs/blocking-plane.gc +++ b/goal_src/jak3/engine/common-obs/blocking-plane.gc @@ -154,11 +154,11 @@ ) (vector+! (-> s2-1 trans) s3-0 s4-0) (vector-float*! (-> s2-1 trans) (-> s2-1 trans) 0.5) - (+! (-> s2-1 trans y) (* 0.5 arg1)) + (+! (-> s2-1 trans y) (/ arg1 2)) (vector-! (-> s1-0 rvec) s4-0 s3-0) (let ((f30-1 (vector-normalize-ret-len! (-> s1-0 rvec) 1.0))) - (set! (-> s2-1 scale x) (* 0.00024414062 f30-1)) - (set! (-> s2-1 scale y) (* 0.00024414062 arg1)) + (set! (-> s2-1 scale x) (/ f30-1 METER_LENGTH)) + (set! (-> s2-1 scale y) (/ arg1 METER_LENGTH)) (set! (-> s2-1 scale z) 0.0) (set! (-> s1-0 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) (vector-cross! (-> s1-0 fvec) (-> s1-0 rvec) (-> s1-0 uvec)) @@ -166,7 +166,7 @@ (matrix->quaternion (-> s2-1 quat) s1-0) (let ((v1-20 (-> this root root-prim local-sphere))) (set! (-> v1-20 x) 0.0) - (set! (-> v1-20 y) (* 0.00024414062 (* 0.5 arg1))) + (set! (-> v1-20 y) (* 0.00024414062 (/ arg1 2))) (set! (-> v1-20 z) 0.0) (let ((f0-17 0.5) (f1-7 (* f30-1 f30-1)) diff --git a/goal_src/jak3/engine/common-obs/collectables.gc b/goal_src/jak3/engine/common-obs/collectables.gc index 5da58d9c625..c0b2c851ef0 100644 --- a/goal_src/jak3/engine/common-obs/collectables.gc +++ b/goal_src/jak3/engine/common-obs/collectables.gc @@ -916,7 +916,7 @@ (set! (-> self root trans y) (-> self base y)) (cond ((< (-> self root transv y) -8192.0) - (set! (-> self root transv y) (* -0.5 (-> self root transv y))) + (set! (-> self root transv y) (/ (-> self root transv y) -2)) ) (else (if (and (logtest? (-> self fact options) (actor-option suck-in)) @@ -1057,7 +1057,7 @@ ) (else (if (nonzero? (-> self part)) - (set! (-> self part local-space-binding) (the-as particle-local-space-info (* 0.0033333334 f0-1))) + (set! (-> self part local-space-binding) (the-as particle-local-space-info (/ f0-1 300))) ) (when (nonzero? (-> self draw)) (logior! (-> self draw status) (draw-control-status force-fade)) @@ -1717,7 +1717,7 @@ (set! (-> a0-6 y) 0.0) (vector-normalize! a0-6 1.0) ) - (vector-float*! gp-2 gp-2 (rand-vu-float-range (* 0.25 f30-0) (* 0.75 f30-0))) + (vector-float*! gp-2 gp-2 (rand-vu-float-range (/ f30-0 4) (* 0.75 f30-0))) ) (set! (-> self root transv quad) (-> gp-2 quad)) ) @@ -2795,7 +2795,7 @@ ((and (>= f24-1 f0-10) (logtest? s2-0 (game-feature gun-red-1 gun-red-2 gun-red-3))) (set! (-> arg1 0) (pickup-type ammo-red)) (if (>= 1 (mod (the-as int (rand-uint31-gen *random-generator*)) 3)) - (set! (-> arg2 0) (* 0.5 (-> arg2 0))) + (set! (-> arg2 0) (/ (-> arg2 0) 2)) ) ) ((and (>= f28-1 f0-10) (logtest? s2-0 (game-feature gun-blue-1 gun-blue-2 gun-blue-3))) @@ -2805,7 +2805,7 @@ ) ((and (>= f30-1 f0-10) (logtest? (game-feature gun-dark-1 gun-dark-2 gun-dark-3) s2-0)) (set! (-> arg1 0) (pickup-type ammo-dark)) - (set! (-> arg2 0) (the float (the int (fmax 1.0 (* 0.06666667 (-> arg2 0)))))) + (set! (-> arg2 0) (the float (the int (fmax 1.0 (/ (-> arg2 0) 15))))) ) (else (pickup-dark-set! arg0 arg1 arg2 arg3) diff --git a/goal_src/jak3/engine/common-obs/crates.gc b/goal_src/jak3/engine/common-obs/crates.gc index baa3b14e7c6..10a3ea1d5ae 100644 --- a/goal_src/jak3/engine/common-obs/crates.gc +++ b/goal_src/jak3/engine/common-obs/crates.gc @@ -920,7 +920,8 @@ ) ) (when (not arg0) - (suspend-for (seconds 0.04)) + (suspend-for (seconds 0.04) + ) (case (-> self look) (('iron) (sound-play "icrate-break") @@ -1012,9 +1013,11 @@ (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1 #t) (process-entity-status! self (entity-perm-status dead) #t) (process-entity-status! self (entity-perm-status subtask-complete) #t) - (suspend-for (seconds 5)) + (suspend-for (seconds 5) + ) (when (logtest? (actor-option cond-respawn) (-> self fact options)) - (suspend-for (seconds 15)) + (suspend-for (seconds 15) + ) (go-virtual hide) ) ) @@ -1346,9 +1349,9 @@ (defmethod smush-update! ((this crate)) (let ((f0-0 (update! (-> this smush)))) - (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale x) (+ 1.0 (/ f0-0 -2))) (set! (-> this root scale y) (+ 1.0 f0-0)) - (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale z) (+ 1.0 (/ f0-0 -2))) ) 0 (none) diff --git a/goal_src/jak3/engine/common-obs/enemy-states.gc b/goal_src/jak3/engine/common-obs/enemy-states.gc index 9d3d07f1ab1..db1a23ffe50 100644 --- a/goal_src/jak3/engine/common-obs/enemy-states.gc +++ b/goal_src/jak3/engine/common-obs/enemy-states.gc @@ -669,7 +669,8 @@ :code (behavior () (cond ((handle->process (-> self ragdoll-proc)) - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (until (ragdoll-settled? self) (if (or (time-elapsed? (-> self state-time) (seconds 4)) (enemy-method-109 self)) (go-die self) @@ -975,11 +976,13 @@ :code (behavior () (cond ((handle->process (-> self ragdoll-proc)) - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (if (-> self skel effect) (do-effect (-> self skel effect) "death-default" 0.0 -1) ) - (suspend-for (seconds 0.8)) + (suspend-for (seconds 0.8) + ) ) (else (ja-channel-push! 1 (seconds 0.075)) @@ -1061,11 +1064,13 @@ :code (behavior () (cond ((handle->process (-> self ragdoll-proc)) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (if (-> self skel effect) (do-effect (-> self skel effect) "death-default" 0.0 -1) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (deactivate-ragdoll! self) ) (else @@ -1182,7 +1187,7 @@ (f26-1 (fmax 0.0 (fmin 1.0 f0-12))) (f28-1 (* f28-0 f26-1)) ) - (let* ((f1-8 (* 0.000061035156 (-> self root root-prim local-sphere w))) + (let* ((f1-8 (/ (-> self root root-prim local-sphere w) (meters 4))) (f0-21 (fmax 0.0 (fmin 1.0 f1-8))) ) (* f30-0 (lerp 2.0 1.0 f0-21)) @@ -1212,7 +1217,7 @@ (f0-34 (/ (- f0-32 (* (the float (the int (/ f0-32 f30-3))) f30-3)) f30-3)) (f0-36 (cos (* 65536.0 f0-34))) (f0-37 (+ 1.0 f0-36)) - (f28-3 (* 0.5 f0-37)) + (f28-3 (/ f0-37 2)) ) (ja :num! identity :frame-interp0 f28-3 :frame-interp1 f28-3) (let ((a0-20 (-> self skel root-channel 1))) diff --git a/goal_src/jak3/engine/common-obs/guard-projectile.gc b/goal_src/jak3/engine/common-obs/guard-projectile.gc index d09cea5f64b..f9389db0653 100644 --- a/goal_src/jak3/engine/common-obs/guard-projectile.gc +++ b/goal_src/jak3/engine/common-obs/guard-projectile.gc @@ -372,7 +372,7 @@ (launch-particles (-> *part-id-table* 852) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 853 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 853 init-specs 4 initial-valuef)) ) diff --git a/goal_src/jak3/engine/common-obs/metalhead-projectile.gc b/goal_src/jak3/engine/common-obs/metalhead-projectile.gc index 6b4534223dc..7d35e38898c 100644 --- a/goal_src/jak3/engine/common-obs/metalhead-projectile.gc +++ b/goal_src/jak3/engine/common-obs/metalhead-projectile.gc @@ -367,7 +367,7 @@ (launch-particles (-> *part-id-table* 864) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000020345053 f30-0)) + (f26-0 (/ f30-0 (meters 12))) (f30-1 (-> *part-id-table* 865 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 865 init-specs 5 initial-valuef)) ) diff --git a/goal_src/jak3/engine/common-obs/water.gc b/goal_src/jak3/engine/common-obs/water.gc index 231acd69ead..77e2ee1082f 100644 --- a/goal_src/jak3/engine/common-obs/water.gc +++ b/goal_src/jak3/engine/common-obs/water.gc @@ -593,7 +593,7 @@ ) (set-time! (-> this drip-time)) (logclear! (-> this flags) (water-flag spawn-drip)) - (seek! (-> this drip-wetness) 0.0 (* 0.001 (-> this drip-speed))) + (seek! (-> this drip-wetness) 0.0 (/ (-> this drip-speed) 1000)) (set! (-> this drip-speed) (* 1.05 (-> this drip-speed))) (if (= (-> this drip-wetness) 0.0) (set! (-> this drip-height) 0.0) @@ -733,7 +733,7 @@ (set! (-> *part-id-table* 759 init-specs 4 initial-valuef) (+ 24576.0 arg0)) (set! (-> *part-id-table* 759 init-specs 19 initial-valuef) (+ 49152.0 arg0)) (set! (-> *part-id-table* 759 init-specs 1 initial-valuef) (* 0.0000036621095 f30-0)) - (set! (-> *part-id-table* 759 init-specs 2 initial-valuef) (* 0.1 f30-0)) + (set! (-> *part-id-table* 759 init-specs 2 initial-valuef) (/ f30-0 10)) (set! (-> *part-id-table* 759 init-specs 13 initial-valuef) 0.7111111) (set! (-> *part-id-table* 759 init-specs 3 initial-valuef) arg3) (set! (-> *part-id-table* 759 init-specs 5 initial-valuef) arg3) diff --git a/goal_src/jak3/engine/debug/collision-editor.gc b/goal_src/jak3/engine/debug/collision-editor.gc index e32c2daf9ed..14c090e04c0 100644 --- a/goal_src/jak3/engine/debug/collision-editor.gc +++ b/goal_src/jak3/engine/debug/collision-editor.gc @@ -762,7 +762,7 @@ (when (= (-> this analog-func) (collision-editor-func analog)) (set! f30-0 (* -409.6 f30-0)) (set! f28-0 (* -409.6 f28-0)) - (let ((f0-8 (+ (* 0.01 f24-0) (* -0.01 f26-0)))) + (let ((f0-8 (+ (/ f24-0 100) (/ f26-0 -100)))) (set! f24-0 (+ 1.0 f0-8)) ) (set! f26-0 0.0) diff --git a/goal_src/jak3/engine/debug/default-menu.gc b/goal_src/jak3/engine/debug/default-menu.gc index cfc95a87e0a..4a4a5329989 100644 --- a/goal_src/jak3/engine/debug/default-menu.gc +++ b/goal_src/jak3/engine/debug/default-menu.gc @@ -266,13 +266,13 @@ (case arg0 (('close) (if (and *math-camera* *subdivide-settings*) - (* 0.00024414062 (-> *subdivide-settings* close 0)) + (/ (-> *subdivide-settings* close 0) METER_LENGTH) arg3 ) ) (('far) (if (and *math-camera* *subdivide-settings*) - (* 0.00024414062 (-> *subdivide-settings* far 0)) + (/ (-> *subdivide-settings* far 0) METER_LENGTH) arg3 ) ) @@ -534,7 +534,7 @@ (if (= arg1 (debug-menu-msg press)) (set! (-> v1-0 camera-to-bbox-dist) (* 4096.0 arg2)) ) - (* 0.00024414062 (-> v1-0 camera-to-bbox-dist)) + (/ (-> v1-0 camera-to-bbox-dist) METER_LENGTH) ) ) @@ -1039,7 +1039,7 @@ ) ) ) - (set! f30-0 (* 0.00024414062 f1-2)) + (set! f30-0 (/ f1-2 METER_LENGTH)) ) ) ) @@ -1074,7 +1074,7 @@ (set! (-> (the-as prototype-bucket-tie s2-0) tie-vanish-far) f0-0) ) ) - (set! f30-0 (* 0.00024414062 f0-0)) + (set! f30-0 (/ f0-0 METER_LENGTH)) ) ) ) @@ -2602,7 +2602,7 @@ (set! (-> s2-0 dists x) (* 4096.0 arg2)) (prototype-bucket-recalc-fields s2-0) ) - (set! f30-0 (* 0.00024414062 (-> s2-0 dists x))) + (set! f30-0 (/ (-> s2-0 dists x) METER_LENGTH)) ) ) ) @@ -2636,7 +2636,7 @@ (set! (-> s2-0 dists w) (* 4096.0 arg2)) (prototype-bucket-recalc-fields s2-0) ) - (set! f30-0 (* 0.00024414062 (-> s2-0 dists w))) + (set! f30-0 (/ (-> s2-0 dists w) METER_LENGTH)) ) ) ) @@ -6095,13 +6095,13 @@ fog-dists x ) - (* 0.00024414062 - (-> *overide-mood-fog-table* + (/ (-> *overide-mood-fog-table* data (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) fog-dists x ) + METER_LENGTH ) ) (set! (-> *overide-mood-fog-table* @@ -6110,13 +6110,13 @@ fog-dists y ) - (* 0.00024414062 - (-> *overide-mood-fog-table* + (/ (-> *overide-mood-fog-table* data (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) fog-dists y ) + METER_LENGTH ) ) ) @@ -6129,10 +6129,10 @@ (dotimes (v1-0 8) (set! (-> *overide-mood-fog-table* data v1-0 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-0 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-0 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-0 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-0 fog-dists y) METER_LENGTH) ) ) #f @@ -6455,10 +6455,10 @@ (set! (-> *overide-mood-color-table* data v1-0 amb-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-0 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-0 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-0 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-0 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-0 fog-dists y) METER_LENGTH) ) (set-vector! (-> *time-of-day-context* times v1-0) 1.0 1.0 1.0 1.0) ) diff --git a/goal_src/jak3/engine/debug/manipulator.gc b/goal_src/jak3/engine/debug/manipulator.gc index ebd3f5ea622..6d3bca4c47b 100644 --- a/goal_src/jak3/engine/debug/manipulator.gc +++ b/goal_src/jak3/engine/debug/manipulator.gc @@ -132,7 +132,7 @@ ) (v1-22 (vector-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 a2-3)) ) - (let ((a0-13 (* 0.25 arg3))) + (let ((a0-13 (/ arg3 4))) (.mov vf7 a0-13) ) (.lvf vf5 (&-> v1-22 quad)) @@ -152,7 +152,7 @@ ) (v1-29 (vector-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 a2-7)) ) - (let ((a0-17 (* 0.25 arg3))) + (let ((a0-17 (/ arg3 4))) (.mov vf7 a0-17) ) (.lvf vf5 (&-> v1-29 quad)) @@ -208,7 +208,7 @@ s5-0 (the-as vector (-> this mat)) f30-1 - (* 0.25 f30-1) + (/ f30-1 4) (if (= (-> this action) (manipulator-action ma1)) *color-yellow* *color-red* @@ -216,17 +216,17 @@ ) ) (if s3-0 - (draw-axis s5-0 (-> this mat uvec) f30-1 (* 0.25 f30-1) (if (= (-> this action) (manipulator-action ma2)) - *color-yellow* - *color-green* - ) + (draw-axis s5-0 (-> this mat uvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma2)) + *color-yellow* + *color-green* + ) ) ) (if s2-0 - (draw-axis s5-0 (-> this mat fvec) f30-1 (* 0.25 f30-1) (if (= (-> this action) (manipulator-action ma3)) - *color-yellow* - *color-blue* - ) + (draw-axis s5-0 (-> this mat fvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma3)) + *color-yellow* + *color-blue* + ) ) ) (let ((s1-0 (new 'stack-no-clear 'vector)) diff --git a/goal_src/jak3/engine/game/effect-control.gc b/goal_src/jak3/engine/game/effect-control.gc index ba36a3b16da..b593a11c50c 100644 --- a/goal_src/jak3/engine/game/effect-control.gc +++ b/goal_src/jak3/engine/game/effect-control.gc @@ -1064,7 +1064,7 @@ (sound-play-by-name (sound-name-with-material "zoom-land" (-> self control ground-pat) "") (new-sound-id) - (the int (* 1024.0 (* 0.000016276043 (-> self control ground-impact-vel)))) + (the int (* 1024.0 (/ (-> self control ground-impact-vel) (meters 15)))) 0 0 (sound-group) diff --git a/goal_src/jak3/engine/game/game-info.gc b/goal_src/jak3/engine/game/game-info.gc index 664ffc2480b..22b0344fe38 100644 --- a/goal_src/jak3/engine/game/game-info.gc +++ b/goal_src/jak3/engine/game/game-info.gc @@ -80,10 +80,10 @@ ) (set! f0-0 (-> *FACT-bank* ammo-yellow-max)) (if (logtest? (game-feature gun-upgrade-yellow-ammo-1) (-> this features)) - (set! f0-0 (+ (the-as float f0-0) (* 0.5 (-> *FACT-bank* ammo-yellow-max)))) + (set! f0-0 (+ (the-as float f0-0) (/ (-> *FACT-bank* ammo-yellow-max) 2))) ) (if (logtest? (game-feature gun-upgrade-yellow-ammo-2) (-> this features)) - (set! f0-0 (+ (the-as float f0-0) (* 0.5 (-> *FACT-bank* ammo-yellow-max)))) + (set! f0-0 (+ (the-as float f0-0) (/ (-> *FACT-bank* ammo-yellow-max) 2))) ) (if (logtest? (game-secrets gun-upgrade-ammo-yellow) (-> this secrets)) (set! f0-0 (+ (the-as float f0-0) (-> *FACT-bank* ammo-yellow-max))) @@ -97,10 +97,10 @@ ) (set! f0-0 (-> *FACT-bank* ammo-red-max)) (if (logtest? (game-feature gun-upgrade-red-ammo-1) (-> this features)) - (set! f0-0 (+ (the-as float f0-0) (* 0.5 (-> *FACT-bank* ammo-red-max)))) + (set! f0-0 (+ (the-as float f0-0) (/ (-> *FACT-bank* ammo-red-max) 2))) ) (if (logtest? (game-feature gun-upgrade-red-ammo-2) (-> this features)) - (set! f0-0 (+ (the-as float f0-0) (* 0.5 (-> *FACT-bank* ammo-red-max)))) + (set! f0-0 (+ (the-as float f0-0) (/ (-> *FACT-bank* ammo-red-max) 2))) ) (if (logtest? (game-secrets gun-upgrade-ammo-red) (-> this secrets)) (set! f0-0 (+ (the-as float f0-0) (-> *FACT-bank* ammo-red-max))) @@ -114,10 +114,10 @@ ) (set! f0-0 (-> *FACT-bank* ammo-blue-max)) (if (logtest? (game-feature gun-upgrade-blue-ammo-1) (-> this features)) - (set! f0-0 (+ (the-as float f0-0) (* 0.5 (-> *FACT-bank* ammo-blue-max)))) + (set! f0-0 (+ (the-as float f0-0) (/ (-> *FACT-bank* ammo-blue-max) 2))) ) (if (logtest? (game-feature gun-upgrade-blue-ammo-2) (-> this features)) - (set! f0-0 (+ (the-as float f0-0) (* 0.5 (-> *FACT-bank* ammo-blue-max)))) + (set! f0-0 (+ (the-as float f0-0) (/ (-> *FACT-bank* ammo-blue-max) 2))) ) (if (logtest? (game-secrets gun-upgrade-ammo-blue) (-> this secrets)) (set! f0-0 (+ (the-as float f0-0) (-> *FACT-bank* ammo-blue-max))) diff --git a/goal_src/jak3/engine/game/settings.gc b/goal_src/jak3/engine/game/settings.gc index e8fd3851d72..7bbd395e791 100644 --- a/goal_src/jak3/engine/game/settings.gc +++ b/goal_src/jak3/engine/game/settings.gc @@ -1752,7 +1752,7 @@ (seek! (-> s5-0 dust-storm-sound-scalar) (-> s4-0 dust-storm-sound-scalar) - (* 0.5 (-> *display* real-clock seconds-per-frame)) + (/ (-> *display* real-clock seconds-per-frame) 2) ) (set! (-> s5-0 ambient-wind-scalar) (-> s4-0 ambient-wind-scalar)) (set! (-> s5-0 halfpipe-jump-mult) (-> s4-0 halfpipe-jump-mult)) diff --git a/goal_src/jak3/engine/game/task/task-arrow.gc b/goal_src/jak3/engine/game/task/task-arrow.gc index f5356c10e0a..5af437c1eaf 100644 --- a/goal_src/jak3/engine/game/task/task-arrow.gc +++ b/goal_src/jak3/engine/game/task/task-arrow.gc @@ -203,11 +203,11 @@ (* (-> this alpha) (rand-vu-float-range 80.0 96.0)) ) (let ((f1-18 (lerp-scale 18432.0 44236.8 (- (-> (math-camera-pos) y) (-> this root trans y)) 12288.0 49152.0)) - (f0-56 (* 0.16666667 (-> this base-scale) f30-1)) + (f0-56 (* (/ (-> this base-scale) 6) f30-1)) ) (set! (-> *part-id-table* 410 init-specs 3 initial-valuef) (* f1-18 f0-56)) (set! (-> *part-id-table* 410 init-specs 5 initial-valuef) (* 73728.0 f0-56)) - (set! (-> *part-id-table* 411 init-specs 3 initial-valuef) (* 0.25 f0-56 f1-18)) + (set! (-> *part-id-table* 411 init-specs 3 initial-valuef) (* (/ f0-56 4) f1-18)) (set! (-> *part-id-table* 411 init-specs 5 initial-valuef) (* 18432.0 f0-56)) (if (or (not (logtest? (-> this flags) (task-arrow-flags taf4))) (< 0.0 f0-56)) (spawn (-> this part) (-> this root trans)) diff --git a/goal_src/jak3/engine/gfx/background/hfrag/hfrag-work.gc b/goal_src/jak3/engine/gfx/background/hfrag/hfrag-work.gc index 075335d0f73..2f81710a3cb 100644 --- a/goal_src/jak3/engine/gfx/background/hfrag/hfrag-work.gc +++ b/goal_src/jak3/engine/gfx/background/hfrag/hfrag-work.gc @@ -250,7 +250,7 @@ ) (let ((f2-1 (* 0.14285715 (- f0-0 f1-0)))) (set! (-> this dists x) (- f1-0)) - (set! (-> this dists y) (- (+ f1-0 (* 0.5 f2-1)))) + (set! (-> this dists y) (- (+ f1-0 (/ f2-1 2)))) (set! (-> this dists z) (- (+ f1-0 (* 2.0 f2-1)))) ) (set! (-> this dists w) (- f0-0)) diff --git a/goal_src/jak3/engine/gfx/background/hfrag/hfrag.gc b/goal_src/jak3/engine/gfx/background/hfrag/hfrag.gc index 19b7c449fab..4b0d9b23dda 100644 --- a/goal_src/jak3/engine/gfx/background/hfrag/hfrag.gc +++ b/goal_src/jak3/engine/gfx/background/hfrag/hfrag.gc @@ -125,7 +125,7 @@ 0 (let ((s4-0 *math-camera*)) (vector-! s2-0 (camera-pos) (-> s5-0 start-corner)) - (+ (* (the int (* 0.0000019073486 (-> s2-0 y))) 32) (the int (* 0.0000019073486 (-> s2-0 x)))) + (+ (* (the int (/ (-> s2-0 y) (meters 128))) 32) (the int (/ (-> s2-0 x) (meters 128)))) (.lvf vf16 (&-> s4-0 plane 0 quad)) (.lvf vf17 (&-> s4-0 plane 1 quad)) (.lvf vf18 (&-> s4-0 plane 2 quad)) @@ -702,7 +702,7 @@ (s2-0 (-> this pat-array 0)) ) (when (not (logtest? (-> arg1 ignore-pat) s2-0)) - (when (nonzero? (-> v1-0 a0-2 packed-index bit11)) + (when (nonzero? (-> (the-as hfrag-vertex (-> v1-0 a0-2)) packed-index bit11)) (set! sv-16 (-> v1-0 a0-2 height)) (set! sv-24 (-> v1-0 (+ a0-2 1) height)) (set! sv-32 (-> v1-0 (+ a0-2 512) height)) @@ -754,8 +754,8 @@ (set! sv-24 (the int (* 0.000030517578 (- (-> arg1 bbox min z) (-> this start-corner z))))) (set! sv-32 (the int (* 0.000030517578 (- (-> arg1 bbox max x) (-> this start-corner x))))) (set! sv-40 (the int (* 0.000030517578 (- (-> arg1 bbox max z) (-> this start-corner z))))) - (set! sv-48 (the int (* 0.125 (-> arg1 bbox min y)))) - (set! sv-56 (the int (* 0.125 (-> arg1 bbox max y)))) + (set! sv-48 (the int (/ (-> arg1 bbox min y) 8))) + (set! sv-56 (the int (/ (-> arg1 bbox max y) 8))) (set! sv-16 (max 0 (min 511 sv-16))) (set! sv-32 (max 0 (min 511 sv-32))) (set! sv-24 (max 0 (min 511 sv-24))) @@ -807,7 +807,7 @@ (set! sv-68 (new 'stack-no-clear 'vector)) (set! sv-72 (new 'stack-no-clear 'vector)) (set! sv-76 (the-as float 0.000030517578)) - (set! sv-80 (* 0.000030517578 (-> arg1 radius))) + (set! sv-80 (/ (-> arg1 radius) (meters 8))) (vector-! sv-64 (-> arg1 start-pos) (-> this start-corner)) (vector-float*! sv-64 sv-64 sv-76) (vector-float*! sv-72 (-> arg1 move-dist) sv-76) diff --git a/goal_src/jak3/engine/gfx/blit-displays.gc b/goal_src/jak3/engine/gfx/blit-displays.gc index 3878a712d63..1e4b019d344 100644 --- a/goal_src/jak3/engine/gfx/blit-displays.gc +++ b/goal_src/jak3/engine/gfx/blit-displays.gc @@ -402,9 +402,9 @@ (cond ((-> this zoom-blur-2d) (set! (-> s5-0 quad) (-> this zoom-blur-pos quad)) - (let* ((f2-0 (* 0.001953125 f28-0 (-> s5-0 x))) + (let* ((f2-0 (* (/ f28-0 512) (-> s5-0 x))) (f0-6 (- f26-0 (- f28-0 f2-0))) - (f3-1 (* 0.0024038462 f28-0 (-> s5-0 y))) + (f3-1 (* (/ f28-0 416) (-> s5-0 y))) (f1-4 (- f30-0 (- f28-0 f3-1))) ) (set! (-> (the-as (inline-array vector4w) s2-0) 0 quad) (-> this sprite-slow-tmpl dma-vif quad)) @@ -430,10 +430,10 @@ ) (+! (-> s5-0 x) -1792.0) (+! (-> s5-0 y) -1840.0) - (let* ((f1-10 (* 0.001953125 f28-0 (-> s5-0 x))) + (let* ((f1-10 (* (/ f28-0 512) (-> s5-0 x))) (f2-8 (fmax 0.0 (fmin f1-10 f28-0))) (f0-22 (- f26-0 (- f28-0 f2-8))) - (f3-4 (* 0.0024038462 f28-0 (-> s5-0 y))) + (f3-4 (* (/ f28-0 416) (-> s5-0 y))) (f3-6 (fmax 0.0 (fmin f3-4 f28-0))) (f1-16 (- f30-0 (- f28-0 f3-6))) ) diff --git a/goal_src/jak3/engine/gfx/foreground/ripple.gc b/goal_src/jak3/engine/gfx/foreground/ripple.gc index 7fb1b6ff5c9..7aa0caf1233 100644 --- a/goal_src/jak3/engine/gfx/foreground/ripple.gc +++ b/goal_src/jak3/engine/gfx/foreground/ripple.gc @@ -187,7 +187,7 @@ (if (< f0-23 0.0) (set! f0-23 (-> gp-0 global-scale)) ) - (+ f30-0 (* 0.0078125 f1-12 f0-23)) + (+ f30-0 (* (/ f1-12 128) f0-23)) ) ) ) diff --git a/goal_src/jak3/engine/gfx/generic/lightning/lightning-new.gc b/goal_src/jak3/engine/gfx/generic/lightning/lightning-new.gc index df2a90e6b16..c57a4db05d9 100644 --- a/goal_src/jak3/engine/gfx/generic/lightning/lightning-new.gc +++ b/goal_src/jak3/engine/gfx/generic/lightning/lightning-new.gc @@ -715,10 +715,10 @@ (v1-13 (matrix-f-u-compose (new 'stack-no-clear 'matrix) (the-as vector arg4) a2-4)) (f26-1 6.0) ) - (set! sv-160 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (* 0.5 f22-0))) - (set! sv-164 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (* -0.5 f22-0))) - (set! sv-168 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (* 0.5 f22-0))) - (set! sv-172 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (* -0.5 f22-0))) + (set! sv-160 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (/ f22-0 2))) + (set! sv-164 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (/ f22-0 -2))) + (set! sv-168 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (/ f22-0 2))) + (set! sv-172 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (/ f22-0 -2))) (set! sv-176 (the-as rgba (new 'stack-no-clear 'array 'rgba 1))) (set! sv-176 (-> this base-color)) (set! sv-176 (copy-and-set-field sv-176 a (the int (* 128.0 f24-0)))) diff --git a/goal_src/jak3/engine/gfx/hw/video.gc b/goal_src/jak3/engine/gfx/hw/video.gc index d7f67fa3363..b72cae7e7d5 100644 --- a/goal_src/jak3/engine/gfx/hw/video.gc +++ b/goal_src/jak3/engine/gfx/hw/video.gc @@ -32,7 +32,7 @@ (set! (-> *video-params* reset-video-mode) #t) (set! (-> *math-camera* isometric uvec y) 0.5) (set! (-> *math-camera* y-clip) 416.0) - (set! (-> *math-camera* y-pix) (* 0.5 (-> *math-camera* y-clip))) + (set! (-> *math-camera* y-pix) (/ (-> *math-camera* y-clip) 2)) (set! *profile-y* 1848) (set! (-> *video-params* set-video-mode) #t) 0 diff --git a/goal_src/jak3/engine/gfx/mood/mood-tables2.gc b/goal_src/jak3/engine/gfx/mood/mood-tables2.gc index e0bbc974e71..997ca61aeb8 100644 --- a/goal_src/jak3/engine/gfx/mood/mood-tables2.gc +++ b/goal_src/jak3/engine/gfx/mood/mood-tables2.gc @@ -426,8 +426,8 @@ (format 0 " :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%" - (* 0.00024414062 (-> *overide-table* mood-fog-table data _fog-idx fog-dists x)) - (* 0.00024414062 (-> *overide-table* mood-fog-table data _fog-idx fog-dists y)) + (/ (-> *overide-table* mood-fog-table data _fog-idx fog-dists x) METER_LENGTH) + (/ (-> *overide-table* mood-fog-table data _fog-idx fog-dists y) METER_LENGTH) (-> *overide-table* mood-fog-table data _fog-idx fog-dists w) (-> *overide-table* mood-fog-table data _fog-idx fog-dists z) ) diff --git a/goal_src/jak3/engine/gfx/mood/mood.gc b/goal_src/jak3/engine/gfx/mood/mood.gc index 8068f4d4d25..07b3e7803a4 100644 --- a/goal_src/jak3/engine/gfx/mood/mood.gc +++ b/goal_src/jak3/engine/gfx/mood/mood.gc @@ -574,8 +574,8 @@ (set! (-> arg0 times arg1 w) f28-0) (when (not (paused?)) (if (< 0.75 f28-0) - (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.04 (-> pp clock time-adjust-ratio)))) - (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.02 (-> pp clock time-adjust-ratio)))) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (/ (-> pp clock time-adjust-ratio) 25))) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (/ (-> pp clock time-adjust-ratio) 50))) ) ) ) @@ -1576,11 +1576,11 @@ (format *stdcon* "overide fog ~f~%" (-> this overide fog)) ) (else - (format *stdcon* "time until random cloud ~f~%" (* 0.0033333334 (-> this time-until-random cloud))) + (format *stdcon* "time until random cloud ~f~%" (/ (-> this time-until-random cloud) 300)) (format *stdcon* "current cloud ~f~%" (-> this current-interp cloud)) (format *stdcon* "target cloud ~f~%" (-> this target-interp cloud)) (format *stdcon* "speed cloud ~f~%" (* (/ 1.0 (-> this speed-interp cloud)) (seconds-per-frame))) - (format *stdcon* "time until random fog ~f~%" (* 0.0033333334 (-> this time-until-random fog))) + (format *stdcon* "time until random fog ~f~%" (/ (-> this time-until-random fog) 300)) (format *stdcon* "current fog ~f~%" (-> this current-interp fog)) (format *stdcon* "target fog ~f~%" (-> this target-interp fog)) (format *stdcon* "speed fog ~f~%" (* (/ 1.0 (-> this speed-interp fog)) (seconds-per-frame))) diff --git a/goal_src/jak3/engine/gfx/ocean/ocean-mid.gc b/goal_src/jak3/engine/gfx/ocean/ocean-mid.gc index 911aa5399a1..cd8fff9e93d 100644 --- a/goal_src/jak3/engine/gfx/ocean/ocean-mid.gc +++ b/goal_src/jak3/engine/gfx/ocean/ocean-mid.gc @@ -19,7 +19,7 @@ (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 393216.0) (let* ((s4-0 (-> (matrix-local->world #f #f) fvec)) (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + (f1-1 (+ 0.5 (/ (-> s4-0 y) -2))) ) (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 0.0) ) @@ -271,7 +271,7 @@ (let ((f0-16 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) (if (-> *time-of-day-context* sky) (set-vector! (-> arg0 env-color) f0-16 f0-16 f0-16 f0-16) - (set-vector! (-> arg0 env-color) f0-16 f0-16 (* 0.5 f0-16) f0-16) + (set-vector! (-> arg0 env-color) f0-16 f0-16 (/ f0-16 2) f0-16) ) ) (set-vector! (-> arg0 index-table 0) 63 84 66 0) diff --git a/goal_src/jak3/engine/gfx/ocean/ocean-near.gc b/goal_src/jak3/engine/gfx/ocean/ocean-near.gc index 5bf67054e82..579ae0321ec 100644 --- a/goal_src/jak3/engine/gfx/ocean/ocean-near.gc +++ b/goal_src/jak3/engine/gfx/ocean/ocean-near.gc @@ -45,7 +45,7 @@ (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 0.000010172526) (let* ((s4-0 (-> (matrix-local->world #f #f) fvec)) (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + (f1-1 (+ 0.5 (/ (-> s4-0 y) -2))) ) (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 128.0) ) @@ -342,7 +342,7 @@ (let ((f0-28 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) (if (-> *time-of-day-context* sky) (set-vector! (-> arg0 env-color) f0-28 f0-28 f0-28 f0-28) - (set-vector! (-> arg0 env-color) f0-28 f0-28 (* 0.5 f0-28) f0-28) + (set-vector! (-> arg0 env-color) f0-28 f0-28 (/ f0-28 2) f0-28) ) ) (set! (-> arg0 drw2-adgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1)) diff --git a/goal_src/jak3/engine/gfx/ocean/ocean-texture.gc b/goal_src/jak3/engine/gfx/ocean/ocean-texture.gc index 930544311e2..8fb25396f15 100644 --- a/goal_src/jak3/engine/gfx/ocean/ocean-texture.gc +++ b/goal_src/jak3/engine/gfx/ocean/ocean-texture.gc @@ -575,8 +575,8 @@ (defmethod ocean-method-83 ((this ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) (when (>= (-> arg1 sun 0 pos y) -150.0) - (let* ((f2-0 (* 0.00010050251 (-> arg1 sun 0 pos x))) - (f1-3 (* 0.00010050251 (-> arg1 sun 0 pos z))) + (let* ((f2-0 (/ (-> arg1 sun 0 pos x) 9950)) + (f1-3 (/ (-> arg1 sun 0 pos z) 9950)) (f0-6 (if (< 0.0 (-> arg1 sun 0 pos y)) 1.0 (* 0.006666667 (+ 150.0 (-> arg1 sun 0 pos y))) @@ -743,7 +743,7 @@ (vector--float*! s2-0 arg2 (-> s3-0 sun1-normal) 9.0) (vector--float*! s4-0 arg2 (-> s3-0 moon-normal) 9.0) (vector-float*! s5-0 s5-0 (* (-> s3-0 sun0-scale) f28-0)) - (vector+float*! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> s3-0 sun1-scale))) + (vector+float*! s5-0 s5-0 s2-0 (* (/ f28-0 4) (-> s3-0 sun1-scale))) (vector+float*! s5-0 s5-0 s4-0 (* (-> s3-0 moon-scale) f28-0)) ) (+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0))) diff --git a/goal_src/jak3/engine/gfx/ocean/ocean.gc b/goal_src/jak3/engine/gfx/ocean/ocean.gc index efa2aedc323..eac2328daa0 100644 --- a/goal_src/jak3/engine/gfx/ocean/ocean.gc +++ b/goal_src/jak3/engine/gfx/ocean/ocean.gc @@ -18,8 +18,8 @@ ;; DECOMP BEGINS (defmethod set-corners! ((this ocean) (arg0 float) (arg1 float)) - (let* ((f2-0 (* 0.00008138021 arg0)) - (f3-0 (* 0.00008138021 arg1)) + (let* ((f2-0 (/ arg0 (meters 3))) + (f3-0 (/ arg1 (meters 3))) (f0-2 f2-0) (f0-4 (- f0-2 (the float (the int f0-2)))) (f1-6 f3-0) @@ -49,8 +49,8 @@ ((and (-> this heights) *ocean-map*) (let* ((f30-0 (- (-> arg0 x) (-> this start-corner x))) (f28-0 (- (-> arg0 z) (-> this start-corner z))) - (v1-3 (the int (* 0.0000025431316 f30-0))) - (a0-2 (the int (* 0.0000025431316 f28-0))) + (v1-3 (the int (/ f30-0 (meters 96)))) + (a0-2 (the int (/ f28-0 (meters 96)))) (v1-7 (-> this ocean-trans-indices data (+ (* 48 a0-2) v1-3))) ) (cond @@ -61,8 +61,8 @@ ) ) ((begin - (let ((a0-8 (logand (the int (* 0.000010172526 f30-0)) 3)) - (a3-4 (logand (the int (* 0.000010172526 f28-0)) 3)) + (let ((a0-8 (logand (the int (/ f30-0 (meters 24))) 3)) + (a3-4 (logand (the int (/ f28-0 (meters 24))) 3)) (v1-10 (-> this ocean-near-indices data (-> v1-7 child))) ) (set! v1-12 (-> (the-as (pointer int16) (+ (* (+ (* a3-4 4) a0-8) 2) (the-as int v1-10))))) @@ -75,14 +75,12 @@ ) ) (else - (let ((a0-14 (logand (the int (* 0.00008138021 f30-0)) 7))) + (let ((a0-14 (logand (the int (/ f30-0 (meters 3))) 7))) (cond - ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) - (ash 1 a0-14) - ) + ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (/ f28-0 (meters 3))) 7)) (ash 1 a0-14)) ) (let* ((f1-2 (vector-vector-distance arg0 (math-camera-pos))) - (f26-0 (- 1.0 (fmin 1.0 (* 0.000010172526 f1-2)))) + (f26-0 (- 1.0 (fmin 1.0 (/ f1-2 (meters 24))))) ) (if (-> this ocean-near-translucent?) (+ (* f26-0 (set-corners! this f30-0 f28-0)) (-> this start-corner y)) diff --git a/goal_src/jak3/engine/gfx/sprite/particles/light-trails.gc b/goal_src/jak3/engine/gfx/sprite/particles/light-trails.gc index eb7238fb192..ad0e25b03d2 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/light-trails.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/light-trails.gc @@ -164,7 +164,7 @@ ((= (-> this appearance lie-mode) (lie-mode use-two-strips)) (let ((s1-0 (new 'stack-no-clear 'vector))) (set! (-> s1-0 quad) (-> this cache-vector 0 quad)) - (vector-normalize! s1-0 (* 0.5 arg2)) + (vector-normalize! s1-0 (/ arg2 2)) (add-vert-to-prim-strip! this (-> this strip) @@ -184,7 +184,7 @@ ) (let ((s1-1 (new 'stack-no-clear 'vector))) (set! (-> s1-1 quad) (-> this cache-vector 1 quad)) - (vector-normalize! s1-1 (* 0.5 arg2)) + (vector-normalize! s1-1 (/ arg2 2)) (add-vert-to-prim-strip! this (-> this strip2) @@ -206,7 +206,7 @@ (else (let ((s1-2 (new 'stack-no-clear 'vector))) (set! (-> s1-2 quad) (-> arg3 quad)) - (vector-normalize! s1-2 (* 0.5 arg2)) + (vector-normalize! s1-2 (/ arg2 2)) (add-vert-to-prim-strip! this (-> this strip) diff --git a/goal_src/jak3/engine/gfx/sprite/particles/sparticle.gc b/goal_src/jak3/engine/gfx/sprite/particles/sparticle.gc index 95aab615135..e84e1eaa5a9 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/sparticle.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/sparticle.gc @@ -297,8 +297,8 @@ (set! (-> arg1 radius) f28-0) (let ((f24-0 (sin f26-0)) (f26-1 (cos f26-0)) - (f22-0 (sin (* 0.5 f30-0))) - (f0-5 (cos (* 0.5 f30-0))) + (f22-0 (sin (/ f30-0 2))) + (f0-5 (cos (/ f30-0 2))) (a2-1 (new 'stack-no-clear 'quaternion)) (s4-0 (new 'stack-no-clear 'vector)) ) diff --git a/goal_src/jak3/engine/gfx/sprite/sprite-distort.gc b/goal_src/jak3/engine/gfx/sprite/sprite-distort.gc index 4c9387a76cf..4a9399a3b19 100644 --- a/goal_src/jak3/engine/gfx/sprite/sprite-distort.gc +++ b/goal_src/jak3/engine/gfx/sprite/sprite-distort.gc @@ -44,7 +44,7 @@ (let ((f26-0 (* 65536.0 (/ (the float s2-0) (the float s4-0))))) (set-vector! (-> gp-0 entry s3-0) (* (sin f26-0) f28-0) (* (cos f26-0) f30-0) 0.0 0.0) (let ((s3-1 (+ s3-0 1))) - (set-vector! (-> gp-0 entry s3-1) (* 0.001953125 f28-0 (sin f26-0)) (* 0.001953125 f30-0 (cos f26-0)) 0.0 0.0) + (set-vector! (-> gp-0 entry s3-1) (* (/ f28-0 512) (sin f26-0)) (* (/ f30-0 512) (cos f26-0)) 0.0 0.0) (set! s3-0 (+ s3-1 1)) ) ) @@ -53,7 +53,7 @@ ) (set-vector! (-> gp-0 entry s3-0) 0.0 f30-0 0.0 0.0) (let ((v1-20 (+ s3-0 1))) - (set-vector! (-> gp-0 entry v1-20) 0.0 (* 0.001953125 f30-0) 0.0 0.0) + (set-vector! (-> gp-0 entry v1-20) 0.0 (/ f30-0 512) 0.0 0.0) (+ v1-20 1) ) ) diff --git a/goal_src/jak3/engine/gfx/sprite/sprite-glow.gc b/goal_src/jak3/engine/gfx/sprite/sprite-glow.gc index 23ea7cefa79..d308241d845 100644 --- a/goal_src/jak3/engine/gfx/sprite/sprite-glow.gc +++ b/goal_src/jak3/engine/gfx/sprite/sprite-glow.gc @@ -532,7 +532,7 @@ 1.0 ) (else - (let* ((f1-1 (* 0.00024414062 a0-5)) + (let* ((f1-1 (/ a0-5 METER_LENGTH)) (f0-4 (- f1-1 (the float (the int f1-1)))) ) (let ((f1-3 (* 4096.0 (- f1-1 f0-4)))) diff --git a/goal_src/jak3/engine/nav/nav-mesh.gc b/goal_src/jak3/engine/nav/nav-mesh.gc index 4446d4e7df6..30ec82bb055 100644 --- a/goal_src/jak3/engine/nav/nav-mesh.gc +++ b/goal_src/jak3/engine/nav/nav-mesh.gc @@ -823,7 +823,7 @@ ) (set! (-> s5-0 word02) (the int - (+ 1.0 (* (fmax 1.0 (* 0.000015258789 (-> s5-0 float00))) (fmax 1.0 (* 0.000015258789 (-> s5-0 float01))))) + (+ 1.0 (* (fmax 1.0 (/ (-> s5-0 float00) (meters 16))) (fmax 1.0 (/ (-> s5-0 float01) (meters 16))))) ) ) (set! (-> s5-0 word03) (min 4096 (* (-> s5-0 word01) (-> s5-0 word02)))) diff --git a/goal_src/jak3/engine/physics/cloth.gc b/goal_src/jak3/engine/physics/cloth.gc index c969a7e4a8f..16785c947eb 100644 --- a/goal_src/jak3/engine/physics/cloth.gc +++ b/goal_src/jak3/engine/physics/cloth.gc @@ -5,6 +5,9 @@ ;; name in dgo: cloth ;; dgos: GAME +(#when PC_PORT + (define *display-cloth-spheres* #f)) + ;; DECOMP BEGINS (defmethod relocate ((this verlet-particle-system) (offset int)) @@ -300,14 +303,14 @@ (meters 0.02) (static-rgba #x80 0 #x80 #x80) ) - ; (s4-0 - ; s3-0 - ; (the-as bucket-id s2-0) - ; *temp-string* - ; (the-as vector (-> this particles data s5-0)) - ; (the-as font-color s1-0) - ; (the-as vector2h #f) - ; ) + (s4-0 + s3-0 + (the-as bucket-id s2-0) + *temp-string* + (the-as vector (-> this particles data s5-0)) + (the-as font-color s1-0) + (the-as vector2h #f) + ) ) ) 0 @@ -637,7 +640,8 @@ (compute-verlet-step this (* 0.0033333334 (the float v1-4))) ) ) - ;; (debug-draw this) + ;; og:preserve-this + (if *display-cloth-spheres* (debug-draw this)) 0 ) ) @@ -667,7 +671,7 @@ ) (set! (-> s4-0 one-over-two-times-constraint-length) (/ 1.0 (* 2.0 f0-1))) (set! (-> s4-0 constraint-length-sqd) (* f0-1 f0-1)) - (set! (-> s4-0 constraint-length-half) (* 0.5 f0-1)) + (set! (-> s4-0 constraint-length-half) (/ f0-1 2)) ) ) ) @@ -925,7 +929,7 @@ (let* ((f1-4 (/ (+ f1-2 (vector-dot a3-4 a3-4)) (* 2.0 f0-1))) (f0-3 (/ (- f1-4 f0-1) f1-4)) ) - (vector-float*! a3-4 a3-4 (* 0.5 f0-3)) + (vector-float*! a3-4 a3-4 (/ f0-3 2)) ) ) (let ((f1-6 1.0) @@ -1976,7 +1980,7 @@ (-> this collision-constraints data s5-0 r) *color-cyan* ) - (format *stdcon* "Transform ~d, size ~f~%" s5-0 (* 0.00024414062 (-> this collision-constraints data s5-0 r))) + (format *stdcon* "Transform ~d, size ~f~%" s5-0 (/ (-> this collision-constraints data s5-0 r) METER_LENGTH)) ) (dotimes (s5-1 (-> this disc-collision-constraints length)) (add-debug-sphere diff --git a/goal_src/jak3/engine/physics/dynamics-h.gc b/goal_src/jak3/engine/physics/dynamics-h.gc index fa1d233b6f3..023288a6285 100644 --- a/goal_src/jak3/engine/physics/dynamics-h.gc +++ b/goal_src/jak3/engine/physics/dynamics-h.gc @@ -30,7 +30,7 @@ ) (defun time-to-apex ((arg0 float) (arg1 float)) - (the int (/ arg0 (- (* 0.0033333334 arg1)))) + (the int (/ arg0 (- (/ arg1 300)))) ) (defun time-to-ground ((arg0 float) (arg1 float) (arg2 float)) @@ -38,8 +38,8 @@ (v0-0 0) ) (while (< (- arg2) f0-0) - (set! arg0 (- arg0 (* 0.0033333334 arg1))) - (+! f0-0 (* 0.0033333334 arg0)) + (set! arg0 (- arg0 (/ arg1 300))) + (+! f0-0 (/ arg0 300)) (+! v0-0 1) ) v0-0 diff --git a/goal_src/jak3/engine/physics/ragdoll-edit.gc b/goal_src/jak3/engine/physics/ragdoll-edit.gc index 22f651890e1..a6e5cfc9e50 100644 --- a/goal_src/jak3/engine/physics/ragdoll-edit.gc +++ b/goal_src/jak3/engine/physics/ragdoll-edit.gc @@ -1015,13 +1015,13 @@ (set! f26-0 (* 546.13336 f26-0)) ) ((= v1-135 2) - (let ((f0-25 (* 0.01 f30-0))) + (let ((f0-25 (/ f30-0 100))) (set! f30-0 (+ 1.0 f0-25)) ) - (let ((f0-27 (* -0.01 f28-0))) + (let ((f0-27 (/ f28-0 -100))) (set! f28-0 (+ 1.0 f0-27)) ) - (let ((f0-29 (* 0.01 f26-0))) + (let ((f0-29 (/ f26-0 100))) (set! f26-0 (+ 1.0 f0-29)) ) ) diff --git a/goal_src/jak3/engine/physics/rigid-body.gc b/goal_src/jak3/engine/physics/rigid-body.gc index a184d0ad8fb..bf5f21c10d9 100644 --- a/goal_src/jak3/engine/physics/rigid-body.gc +++ b/goal_src/jak3/engine/physics/rigid-body.gc @@ -45,7 +45,7 @@ ) (matrix-identity! (-> this inertial-tensor)) (matrix-identity! (-> this inv-inertial-tensor)) - (let ((f0-4 (* 0.083333336 f24-0))) + (let ((f0-4 (/ f24-0 12))) (let* ((f1-1 f30-0) (f1-3 (* f1-1 f1-1)) (f2-0 f26-0) @@ -1375,7 +1375,7 @@ (f0-9 (/ 163840.0 (get-inv-mass (the-as process-focusable s4-1)))) ) (vector-reset! (-> this player-force)) - (set! (-> this player-force y) (* -0.1 f0-9 f30-2)) + (set! (-> this player-force y) (* (/ f0-9 -10) f30-2)) ) ) ) diff --git a/goal_src/jak3/engine/physics/trajectory.gc b/goal_src/jak3/engine/physics/trajectory.gc index abf4e7910b1..b24bfa4401e 100644 --- a/goal_src/jak3/engine/physics/trajectory.gc +++ b/goal_src/jak3/engine/physics/trajectory.gc @@ -9,7 +9,7 @@ (defmethod compute-trans-at-time ((this trajectory) (arg0 float) (arg1 vector)) (vector+float*! arg1 (-> this initial-position) (-> this initial-velocity) arg0) - (+! (-> arg1 y) (* 0.5 arg0 arg0 (-> this gravity))) + (+! (-> arg1 y) (* (/ arg0 2) arg0 (-> this gravity))) arg1 ) @@ -31,7 +31,7 @@ (vector-! (-> this initial-velocity) arg1 arg0) (vector-xz-normalize! (-> this initial-velocity) f0-3) ) - (set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* 0.5 arg2 (-> this gravity)))) + (set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* (/ arg2 2) (-> this gravity)))) 0 (none) ) diff --git a/goal_src/jak3/engine/process-drawable/process-drawable.gc b/goal_src/jak3/engine/process-drawable/process-drawable.gc index 80a4c2c3cbb..a6652a30fa6 100644 --- a/goal_src/jak3/engine/process-drawable/process-drawable.gc +++ b/goal_src/jak3/engine/process-drawable/process-drawable.gc @@ -41,7 +41,12 @@ ) ) ) - )) + ) + +(defun-debug draw-cloth-spheres ((pd process-drawable)) + "Added in PC port" + (if (-> pd draw cloth-instances) + (dotimes (i (length (-> pd draw cloth-instances))) (debug-draw-spheres (-> pd draw cloth-instances i)))))) ;; DECOMP BEGINS @@ -553,12 +558,14 @@ ) ) ;; og:preserve-this - (#when PC_PORT (when *debug-segment* - (when *display-bones* - (draw-bone-lines (the-as process-drawable (-> this process)))) - (if *display-joint-names* - (draw-joint-spheres (the-as process-drawable (-> this process)))) - )) + (#when PC_PORT + (when *debug-segment* + (when *display-bones* + (draw-bone-lines (the-as process-drawable (-> this process)))) + (if *display-joint-names* + (draw-joint-spheres (the-as process-drawable (-> this process)))) + (if *display-cloth-spheres* + (draw-cloth-spheres (the process-drawable (-> this process)))))) 0 (none) ) diff --git a/goal_src/jak3/engine/sound/gsound.gc b/goal_src/jak3/engine/sound/gsound.gc index bc6e1c5506e..0f1ca067e82 100644 --- a/goal_src/jak3/engine/sound/gsound.gc +++ b/goal_src/jak3/engine/sound/gsound.gc @@ -545,9 +545,9 @@ ) ) ) - (set! (-> int-trans 0) (the int (* 0.0625 (-> v1-0 x)))) - (set! (-> int-trans 1) (the int (* 0.0625 (-> v1-0 y)))) - (set! (-> int-trans 2) (the int (* 0.0625 (-> v1-0 z)))) + (set! (-> int-trans 0) (the int (/ (-> v1-0 x) 16))) + (set! (-> int-trans 1) (the int (/ (-> v1-0 y) 16))) + (set! (-> int-trans 2) (the int (/ (-> v1-0 z) 16))) ) 0 ) @@ -1071,7 +1071,7 @@ ) (defmethod set-falloff-far! ((this ambient-sound) (arg0 float)) - (set! (-> this falloff-far) (the int (* 0.00024414062 arg0))) + (set! (-> this falloff-far) (the int (/ arg0 METER_LENGTH))) 0 (none) ) @@ -1291,7 +1291,8 @@ (set! (-> a1-3 0) 'empty0) (want-sound-banks *load-state* a1-3) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (let ((a1-4 (new 'stack-no-clear 'array 'symbol 4))) (set! (-> a1-4 2) (-> gp-0 4)) (set! (-> a1-4 1) (-> gp-0 2)) diff --git a/goal_src/jak3/engine/target/board/board-states.gc b/goal_src/jak3/engine/target/board/board-states.gc index 5bb52ebe412..93c912a71a1 100644 --- a/goal_src/jak3/engine/target/board/board-states.gc +++ b/goal_src/jak3/engine/target/board/board-states.gc @@ -44,8 +44,8 @@ ) ) (set! (-> self board turn-anim-targ) (+ (lerp-scale - (* 0.5 (-> *TARGET_BOARD-bank* turn-frames)) - (* -0.5 (-> *TARGET_BOARD-bank* turn-frames)) + (/ (-> *TARGET_BOARD-bank* turn-frames) 2) + (/ (-> *TARGET_BOARD-bank* turn-frames) -2) f26-0 -5461.3335 5461.3335 @@ -58,8 +58,8 @@ 32768.0 ) (lerp-scale - (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) - (* -0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (/ (-> *TARGET_BOARD-bank* turn-frames) 5) + (/ (-> *TARGET_BOARD-bank* turn-frames) -5) (-> self board turn-anim-mag) 1.0 -1.0 @@ -67,7 +67,7 @@ ) ) (when (and (or (< (* f30-0 (-> self board turn-anim-targ)) 0.0) (= f30-0 0.0)) - (and (< (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) (fabs (- f30-0 (-> self board turn-anim-targ)))) + (and (< (/ (-> *TARGET_BOARD-bank* turn-frames) 5) (fabs (- f30-0 (-> self board turn-anim-targ)))) (>= (current-time) (-> self control turn-lockout-end-time)) ) ) @@ -647,7 +647,7 @@ (vector-float*! (-> self control transv) (-> self control transv) - (+ 1.0 (* 0.5 (-> *setting-control* user-current halfpipe-jump-mult))) + (+ 1.0 (/ (-> *setting-control* user-current halfpipe-jump-mult) 2)) ) ) (else @@ -859,7 +859,7 @@ (vector-float*! (-> self control transv) (-> self control transv) - (+ 1.0 f30-0 (* 0.5 (-> *setting-control* user-current halfpipe-jump-mult))) + (+ 1.0 f30-0 (/ (-> *setting-control* user-current halfpipe-jump-mult) 2)) ) ) ) @@ -1351,7 +1351,7 @@ (vector-float*! (-> self control transv) (-> self control transv) - (+ 1.0 (* 0.5 (-> *setting-control* user-current halfpipe-jump-mult))) + (+ 1.0 (/ (-> *setting-control* user-current halfpipe-jump-mult) 2)) ) ) (target-board-spin-check) @@ -2420,7 +2420,7 @@ (compute-alignment! (-> self align)) (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) (set! (-> self control ctrl-xz-vel) - (* f30-0 (* 0.000024414063 (-> self clock frames-per-second) (-> self align delta trans z))) + (* f30-0 (* (/ (-> self clock frames-per-second) (meters 10)) (-> self align delta trans z))) ) (vector-float*! (-> self control transv) gp-0 (-> self control ctrl-xz-vel)) (let ((v1-31 (new-stack-vector0)) @@ -2639,7 +2639,7 @@ (else (let ((f30-1 (* (lerp-scale 0.7 1.0 (fabs (-> self board ride-lean)) 0.0 1.0) - (lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (* 0.5 (-> self control mod-surface transv-max))) + (lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (/ (-> self control mod-surface transv-max) 2)) ) ) (f28-1 @@ -3373,7 +3373,8 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (move-to-point! (-> self control) s4-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) diff --git a/goal_src/jak3/engine/target/board/target-board.gc b/goal_src/jak3/engine/target/board/target-board.gc index af3c4cc26ba..bc75df1d084 100644 --- a/goal_src/jak3/engine/target/board/target-board.gc +++ b/goal_src/jak3/engine/target/board/target-board.gc @@ -76,7 +76,7 @@ (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) (set! (-> arg0 seek0) (lerp-scale - (* 0.1 (-> arg0 seek0)) + (/ (-> arg0 seek0) 10) (-> arg0 seek0) (the float (- (current-time) (-> self board spin-time))) 0.0 @@ -85,7 +85,7 @@ ) (set! (-> arg0 seek90) (lerp-scale - (* 0.1 (-> arg0 seek90)) + (/ (-> arg0 seek90) 10) (-> arg0 seek90) (the float (- (current-time) (-> self board spin-time))) 0.0 @@ -101,8 +101,8 @@ (when (not (time-elapsed? (-> self board spin-ground-start-time) (seconds 0.3))) (set-time! (-> self control last-attack-end-time)) (set-time! (-> self board spin-ground-time)) - (set! (-> arg0 seek0) (* 0.1 (-> arg0 seek0))) - (set! (-> arg0 seek90) (* 0.1 (-> arg0 seek90))) + (set! (-> arg0 seek0) (/ (-> arg0 seek0) 10)) + (set! (-> arg0 seek90) (/ (-> arg0 seek90) 10)) (set! (-> arg0 vel-turn) 131072.0) (set! (-> arg0 turnv) 91022.22) ) @@ -801,7 +801,7 @@ (set! f26-0 (-> s5-1 v1-18 w)) ) ) - (let ((f28-1 (* 0.0625 f28-0))) + (let ((f28-1 (/ f28-0 16))) (vector-normalize! s4-0 1.0) (set! (-> self control idx-of-fastest-xz-vel) s2-0) (set! (-> self control average-xz-vel) f28-1) @@ -1900,7 +1900,7 @@ (< 0.98 (vector-dot (-> self board probe-normal) (-> self control standard-dynamics gravity-normal))) (< f26-0 8192.0) (< f30-0 8192.0) - (or (< (* 0.2 f28-0) f30-0) (not (time-elapsed? (-> self board last-jump-time) (seconds 0.1)))) + (or (< (/ f28-0 5) f30-0) (not (time-elapsed? (-> self board last-jump-time) (seconds 0.1)))) ) (vector+float*! (-> self control transv) @@ -2300,7 +2300,7 @@ (set! (-> s2-0 start-pos quad) (-> v1-2 prim-core world-sphere quad)) (set! (-> s2-0 move-dist quad) (-> arg1 quad)) (let ((a0-3 s2-0)) - (set! (-> a0-3 radius) (* 0.5 (-> v1-2 prim-core world-sphere w))) + (set! (-> a0-3 radius) (/ (-> v1-2 prim-core world-sphere w) 2)) (set! (-> a0-3 collide-with) (-> v1-2 prim-core collide-with)) (set! (-> a0-3 ignore-process0) (-> arg0 process)) (set! (-> a0-3 ignore-process1) #f) @@ -2682,7 +2682,7 @@ (let* ((f30-0 (-> self board ride-speed)) (f0-4 (lerp-scale (-> self control current-surface fric) - (* 0.2 (-> self control current-surface fric)) + (/ (-> self control current-surface fric) 5) f30-0 0.0 (-> self control current-surface transv-max) diff --git a/goal_src/jak3/engine/target/collide-reaction-target.gc b/goal_src/jak3/engine/target/collide-reaction-target.gc index 5d04729a830..440c125b231 100644 --- a/goal_src/jak3/engine/target/collide-reaction-target.gc +++ b/goal_src/jak3/engine/target/collide-reaction-target.gc @@ -152,7 +152,7 @@ ) (when (and (or (and (< f0-27 0.95) (>= f30-0 0.0)) (and (logtest? sv-32 (cshape-reaction-flags csrf05)) (< f0-27 0.3)) - (< f1-11 (* -0.25 (-> arg1 best-my-prim local-sphere w))) + (< f1-11 (/ (-> arg1 best-my-prim local-sphere w) -4)) ) (>= (vector-dot tangent contact-normal) -0.000001) ) diff --git a/goal_src/jak3/engine/target/gun/gun-blue-shot.gc b/goal_src/jak3/engine/target/gun/gun-blue-shot.gc index 1d13854152d..d7f2607bf40 100644 --- a/goal_src/jak3/engine/target/gun/gun-blue-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-blue-shot.gc @@ -37,7 +37,7 @@ (set! (-> v1-0 y) (- (-> arg2 rvec y) (-> a0-1 y))) (set! (-> v1-0 z) (- (-> arg2 rvec z) (-> a0-1 z))) (let ((f1-3 (vector-length v1-0))) - (set! (-> arg2 fvec w) (* 128.0 (- 1.0 (* 0.0000024414062 f1-3)))) + (set! (-> arg2 fvec w) (* 128.0 (- 1.0 (/ f1-3 (meters 100))))) ) ) 0 @@ -246,7 +246,7 @@ (let ((s3-0 (new 'stack-no-clear 'dist-dot-val))) (get-dist-and-dot (the-as gun-blue-shot arg0) s3-0) (when (< (-> s3-0 dist) 49152.0) - (let ((f0-12 (* 0.000020345053 (-> s3-0 dist))) + (let ((f0-12 (/ (-> s3-0 dist) (meters 12))) (f24-1 (* 0.5 (+ 1.0 (-> s3-0 dot)))) ) (set! f24-0 (* (lerp 65536.0 131072.0 f0-12) (- 2.0 f24-1))) @@ -534,7 +534,7 @@ (set! f30-0 (+ 28.0 f30-0)) ) (if (logtest? (process-mask vehicle civilian) (-> s4-1 mask)) - (set! f30-0 (* 0.25 f30-0)) + (set! f30-0 (/ f30-0 4)) ) (set! (-> sv-1284 sv-1288 value) f30-0) (set! sv-1296 (+ sv-1296 f30-0)) @@ -865,7 +865,7 @@ (set! sv-80 (new 'stack-no-clear 'vector)) 0.0 (let* ((f28-0 (acos f0-2)) - (f0-4 (* 0.000030517578 f28-0)) + (f0-4 (/ f28-0 (meters 8))) ) 0.0 0.0 @@ -2668,7 +2668,8 @@ (defstate dissipate (gun-blue-shot-3) :virtual #t :code (behavior () - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (go-virtual die) ) ) @@ -2676,7 +2677,8 @@ (defstate impact (gun-blue-shot-3) :virtual #t :code (behavior () - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (go-virtual die) ) ) diff --git a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc index 7d9f00b95c7..829508a0193 100644 --- a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc @@ -201,13 +201,7 @@ ) (set! (-> self root trans quad) (-> arg0 pos quad)) (quaternion-identity! (-> self root quat)) - (set-vector! - (-> self root scale) - (* 0.00024414062 (-> arg0 size-x)) - (* 0.00024414062 (-> arg0 size-y)) - 1.0 - 1.0 - ) + (set-vector! (-> self root scale) (/ (-> arg0 size-x) METER_LENGTH) (/ (-> arg0 size-y) METER_LENGTH) 1.0 1.0) (go-virtual active) ) @@ -218,13 +212,7 @@ (('set-pos-and-size) (let ((v1-2 (the-as gun-dark-3-sphere-init-params (-> block param 0)))) (set! (-> self root trans quad) (-> v1-2 pos quad)) - (set-vector! - (-> self root scale) - (* 0.00024414062 (-> v1-2 size-x)) - (* 0.00024414062 (-> v1-2 size-y)) - 1.0 - 1.0 - ) + (set-vector! (-> self root scale) (/ (-> v1-2 size-x) METER_LENGTH) (/ (-> v1-2 size-y) METER_LENGTH) 1.0 1.0) (vector-float*! (-> self root scale) (-> self root scale) 1.7) (set! (-> self alpha-val) (-> v1-2 alpha-val)) ) @@ -1691,7 +1679,7 @@ (set! f30-0 (lerp-scale 4096.0 1228.8 f0-9 30.0 300.0)) ) ) - (let ((f30-1 (* 0.5 f30-0))) + (let ((f30-1 (/ f30-0 2))) (vector-normalize! (-> self spin-vector) f30-1) (vector-normalize! (-> self core-velocity) 7372.8) (set! (-> s5-0 fvec quad) (-> s4-0 quad)) @@ -2510,7 +2498,7 @@ ) (s3-1 s2-2 (the-as quaternion s1-0) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-40)))) *up-vector*) ) - (let ((f0-18 (* 0.000061035156 (-> self obj-radius)))) + (let ((f0-18 (/ (-> self obj-radius) (meters 4)))) 0.0 (let* ((f30-1 (lerp 1.0 0.2 f0-18)) (s3-2 s5-4) @@ -2782,7 +2770,7 @@ (let* ((f0-1 (vector-normalize-ret-len! s5-1 1.0)) (f0-2 (* 182.04445 f0-1)) (f0-3 (* 360.0 f0-2)) - (f0-4 (* 0.2 f0-3)) + (f0-4 (/ f0-3 5)) (f30-0 (fmin 116508.445 f0-4)) (s4-0 (handle->process (-> this parent-hand))) ) @@ -2884,7 +2872,7 @@ (until (< (-> self end-time) (current-time)) (suspend) ) - (let* ((f0-1 (+ 0.5 (* 0.0625 (-> self cached-damage)))) + (let* ((f0-1 (+ 0.5 (/ (-> self cached-damage) 16))) (f0-2 (fmin 0.9 f0-1)) ) (send-event (handle->process (-> self parent-hand)) 'gun-dark-2-off f0-2) @@ -2915,8 +2903,7 @@ ;; WARN: Return type mismatch int vs object. (defbehavior zero-g-wait-for-land gravity-spinner () - (suspend-for - (seconds 1.5) + (suspend-for (seconds 1.5) (let* ((s4-0 (handle->process (-> self parent-hand))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -2998,7 +2985,7 @@ (let ((f0-0 (vector-length (the-as vector (-> block param 1))))) 0.0 (when (< 40960.0 f0-0) - (let ((f30-0 (* 0.000024414063 f0-0))) + (let ((f30-0 (/ f0-0 (meters 10)))) (format 0 "Receving impact damage ~f~%" f30-0) (+! (-> self cached-damage) f30-0) ) @@ -3151,7 +3138,7 @@ ) 0.0 (set! (-> self cached-damage) (* 2.0 (-> self cached-damage))) - (let* ((f0-6 (* 0.00012207031 f0-5)) + (let* ((f0-6 (/ f0-5 (meters 2))) (f0-7 (fmax 1.0 f0-6)) ) (+! (-> self cached-damage) f0-7) @@ -3308,8 +3295,8 @@ (vector4-lerp! s5-0 (-> v1-0 0 dir0 color) (-> v1-0 0 dir1 color) (-> v1-0 0 dir1 extra x)) (fmax (fmax (-> s4-0 x) (-> s4-0 y)) (-> s4-0 z)) (fmax (fmax (-> s5-0 x) (-> s5-0 y)) (-> s5-0 z)) - (let* ((f0-10 (+ (* 0.2 (-> s4-0 x)) (* 0.75 (-> s4-0 y)) (* 0.05 (-> s4-0 z)))) - (f1-12 (+ (* 0.2 (-> s5-0 x)) (* 0.75 (-> s5-0 y)) (* 0.05 (-> s5-0 z)))) + (let* ((f0-10 (+ (/ (-> s4-0 x) 5) (* 0.75 (-> s4-0 y)) (/ (-> s4-0 z) 20))) + (f1-12 (+ (/ (-> s5-0 x) 5) (* 0.75 (-> s5-0 y)) (/ (-> s5-0 z) 20))) (f0-12 (* 0.5 (+ f0-10 f1-12))) (f30-0 (lerp-scale-clamp 0.0 1.0 f0-12 0.0 1.0)) (s5-1 (new 'stack 'rgbaf)) @@ -3613,9 +3600,11 @@ ) ) (set! f30-0 (+ -0.6 f30-0)) - (suspend-for (seconds 0.15)) + (suspend-for (seconds 0.15) + ) + ) + (suspend-for (seconds 13.5) ) - (suspend-for (seconds 13.5)) (go empty-state) (set! f30-0 4.0) ) diff --git a/goal_src/jak3/engine/target/gun/gun-part.gc b/goal_src/jak3/engine/target/gun/gun-part.gc index a7881308267..37bd83514c3 100644 --- a/goal_src/jak3/engine/target/gun/gun-part.gc +++ b/goal_src/jak3/engine/target/gun/gun-part.gc @@ -3845,7 +3845,7 @@ gun (let* ((f0-4 (vector-normalize-ret-len! s5-0 1.0)) (f0-6 (- (* 300.0 f0-4) (* f30-0 (seconds-per-frame)))) (f0-7 (fmax 0.0 f0-6)) - (f0-8 (* 0.0033333334 f0-7)) + (f0-8 (/ f0-7 300)) ) (vector-normalize! s5-0 f0-8) ) diff --git a/goal_src/jak3/engine/target/gun/gun-red-shot.gc b/goal_src/jak3/engine/target/gun/gun-red-shot.gc index 3b1d386633e..788aa18a148 100644 --- a/goal_src/jak3/engine/target/gun/gun-red-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-red-shot.gc @@ -1312,9 +1312,9 @@ ) ) (let ((v1-8 (new 'stack-no-clear 'vector))) - (set! (-> v1-8 x) (* 0.00024414062 (-> this current-warp-radius))) + (set! (-> v1-8 x) (/ (-> this current-warp-radius) METER_LENGTH)) (set! (-> v1-8 y) 1.0) - (set! (-> v1-8 z) (* 0.00024414062 (-> this current-warp-radius))) + (set! (-> v1-8 z) (/ (-> this current-warp-radius) METER_LENGTH)) (set! (-> v1-8 w) 1.0) (send-event (handle->process (-> this explosion-1)) 'scale v1-8) ) @@ -1433,7 +1433,7 @@ (set-time! (-> self state-time)) (set! (-> self max-radius) (lerp (-> self min-charge-radius) (-> self max-charge-radius) (-> self strength))) (/ (-> self max-radius) (-> self max-charge-radius)) - (let ((f0-15 (* 0.000012207031 (-> self max-radius)))) + (let ((f0-15 (/ (-> self max-radius) (meters 20)))) 0.0 (let ((f1-5 (/ (* 2.0 (- (* 163840.0 f0-15) (-> self max-radius))) (* f0-15 f0-15)))) (set! (-> *part-id-table* 353 init-specs 9 initial-valuef) (* 1.2 f1-5)) @@ -1531,7 +1531,7 @@ (lerp 20480.0 24576.0 (/ (-> self max-radius) (-> self max-charge-radius))) ) (set! (-> *part-id-table* 226 init-specs 3 initial-valuef) - (* 0.5 (-> *part-id-table* 226 init-specs 3 initial-valuef)) + (/ (-> *part-id-table* 226 init-specs 3 initial-valuef) 2) ) (set! (-> *part-id-table* 226 init-specs 3 random-rangef) (lerp 0.0 20480.0 (/ (-> self max-radius) (-> self max-charge-radius))) @@ -1946,7 +1946,7 @@ (let ((gp-6 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (math-camera-pos)))) 0.0 (let* ((f0-2 (vector-length gp-6)) - (f30-0 (* 0.0000016276042 f0-2)) + (f30-0 (/ f0-2 (meters 150))) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) diff --git a/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc b/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc index b615be11262..f9ab483a3fd 100644 --- a/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc @@ -247,7 +247,7 @@ (set! f0-11 (+ 28.0 f0-11)) ) (if (logtest? (process-mask vehicle civilian) (-> s3-1 mask)) - (set! f0-11 (* 0.25 f0-11)) + (set! f0-11 (/ f0-11 4)) ) (set! (-> sv-1076 sv-1080 value) f0-11) (set! sv-1088 (+ sv-1088 f0-11)) @@ -566,7 +566,8 @@ process (lambda :behavior process ((arg0 handle)) - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (send-event (handle->process arg0) 'die) ) gp-4 @@ -596,7 +597,8 @@ ) (logior! (-> self draw status) (draw-control-status no-draw)) (transform-post) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (deactivate self) ) :post ja-post @@ -1103,7 +1105,7 @@ (spawn-particles this s3-0) ) (let ((s3-1 (new 'stack-no-clear 'matrix)) - (f30-1 (fmin 1.0 (* 0.000015258789 f30-0))) + (f30-1 (fmin 1.0 (/ f30-0 (meters 16)))) (f28-0 (-> *part-id-table* 267 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-1 gp-1 *up-vector*) @@ -1883,7 +1885,7 @@ (set! (-> this damage) 2.0) (when (logtest? (game-feature feature22) (-> *game-info* features)) (set! (-> this damage) (* 2.0 (-> this damage))) - (set! (-> this vehicle-impulse-factor) (* 0.5 (-> this vehicle-impulse-factor))) + (set! (-> this vehicle-impulse-factor) (/ (-> this vehicle-impulse-factor) 2)) ) (logior! (-> this options) (projectile-options po13)) (set! (-> this muzzle-flash-part) (-> *part-id-table* 275)) @@ -2027,7 +2029,7 @@ (launch-particles (-> *part-id-table* 270) s3-0) ) (let ((s3-1 (new 'stack-no-clear 'matrix)) - (f30-1 (fmin 1.0 (* 0.000015258789 f30-0))) + (f30-1 (fmin 1.0 (/ f30-0 (meters 16)))) (f28-0 (-> *part-id-table* 267 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-1 s4-1 *up-vector*) diff --git a/goal_src/jak3/engine/target/logic-target.gc b/goal_src/jak3/engine/target/logic-target.gc index f516e148f6e..ca86601e63f 100644 --- a/goal_src/jak3/engine/target/logic-target.gc +++ b/goal_src/jak3/engine/target/logic-target.gc @@ -795,7 +795,7 @@ (set! f2-0 (-> a1-3 a2-6 w)) ) ) - (let ((f1-1 (* 0.0625 f1-0))) + (let ((f1-1 (/ f1-0 16))) (set! (-> self control idx-of-fastest-xz-vel) a0-3) (set! (-> self control average-xz-vel) f1-1) (if (logtest? (-> self control current-surface flags) (surface-flag no-turn-around)) diff --git a/goal_src/jak3/engine/target/mech/mech-part.gc b/goal_src/jak3/engine/target/mech/mech-part.gc index 0ce02fd1bcc..305935dff34 100644 --- a/goal_src/jak3/engine/target/mech/mech-part.gc +++ b/goal_src/jak3/engine/target/mech/mech-part.gc @@ -152,7 +152,7 @@ (quaternion-rotate-local-x! s1-0 s1-0 32768.0) (let ((a0-3 s0-0)) (let ((v1-10 arg1)) - (let ((a1-4 (* 0.5 arg4))) + (let ((a1-4 (/ arg4 2))) (.mov vf7 a1-4) ) (.lvf vf5 (&-> arg2 quad)) diff --git a/goal_src/jak3/engine/target/mech/mech-states.gc b/goal_src/jak3/engine/target/mech/mech-states.gc index 08899e3c237..a83f2edd7cd 100644 --- a/goal_src/jak3/engine/target/mech/mech-states.gc +++ b/goal_src/jak3/engine/target/mech/mech-states.gc @@ -1002,7 +1002,8 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (move-to-point! (-> self control) s4-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) @@ -1142,7 +1143,9 @@ ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-mech-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (suspend-for (seconds 0.8) (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5))) + (suspend-for (seconds 0.8) + (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5)) + ) (remove-setting! 'mode-name) ) (else @@ -1244,7 +1247,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ) (set! (-> self control transv quad) (the-as uint128 0)) @@ -1268,7 +1272,7 @@ (dotimes (s4-0 1) ((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere) ) - (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> s5-0 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) (set! (-> s5-0 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 11468.8 f30-0 0.0 1.0)) (let ((v1-17 gp-0)) diff --git a/goal_src/jak3/engine/target/surface-h.gc b/goal_src/jak3/engine/target/surface-h.gc index cd5eeb1e0b3..6e00c861bb5 100644 --- a/goal_src/jak3/engine/target/surface-h.gc +++ b/goal_src/jak3/engine/target/surface-h.gc @@ -121,17 +121,17 @@ on impact, during touch, on exit, etc." (defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float)) - (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1) + (- (* (/ (- (/ arg0 60) arg1) arg2) (- 1.0 arg2)) arg1) ) (defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))) + (let ((f0-4 (sqrtf (/ (- (/ arg0 60) arg1) arg2)))) (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))) ) ) (defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float)) - (let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))) + (let ((f0-5 (sqrtf (sqrtf (/ (- (/ arg0 60) arg1) arg2))))) (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))) ) ) diff --git a/goal_src/jak3/engine/target/target-anim.gc b/goal_src/jak3/engine/target/target-anim.gc index 467551b9640..3c150aaf2cf 100644 --- a/goal_src/jak3/engine/target/target-anim.gc +++ b/goal_src/jak3/engine/target/target-anim.gc @@ -814,7 +814,7 @@ ) ((lambda :behavior target () - (let ((f30-0 (fmax 0.8 (fmin 1.0 (* 0.000048828126 (-> self control ctrl-xz-vel)))))) + (let ((f30-0 (fmax 0.8 (fmin 1.0 (/ (-> self control ctrl-xz-vel) (meters 5)))))) (cond ((and (rand-vu-percent? 0.3) (and (< 20480.0 (-> self control ctrl-xz-vel)) (zero? (-> self ext-anim)))) (ja-no-eval :group! jakb-attack-from-stance-alt-end-ja :num! (seek! (ja-aframe 29.0 0) f30-0) :frame-num 0.0) @@ -1186,10 +1186,10 @@ ) ) (let ((f0-37 (fabs (- f20-0 f30-0)))) - (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-37))))) + (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (/ f0-37 4))))) ) (let ((f0-42 (fabs (- f22-1 f28-0)))) - (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (* 0.25 f0-42))))) + (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (/ f0-42 4))))) ) ) (set! (-> self control unknown-float-n12iuh3n1) f30-0) @@ -1767,7 +1767,7 @@ (let ((f0-11 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not (or (and (< (fabs (/ f0-11 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) + (while (not (or (and (< (fabs (/ f0-11 (/ f1-1 300))) 150.0) (< f1-1 0.0)) (time-elapsed? (-> self state-time) (seconds 1.7)) ) ) diff --git a/goal_src/jak3/engine/target/target-darkjak.gc b/goal_src/jak3/engine/target/target-darkjak.gc index 7f48ca93411..052988e876a 100644 --- a/goal_src/jak3/engine/target/target-darkjak.gc +++ b/goal_src/jak3/engine/target/target-darkjak.gc @@ -215,12 +215,12 @@ (let ((v1-16 (-> (the-as collide-shape-prim-group (-> arg0 root root-prim)) child 0)) (a0-10 (-> (the-as collide-shape-prim-group (-> arg0 root root-prim)) child 1)) ) - (set! (-> v1-16 local-sphere w) (* 0.1 (-> arg0 root root-prim local-sphere w))) + (set! (-> v1-16 local-sphere w) (/ (-> arg0 root root-prim local-sphere w) 10)) (set! (-> a0-10 local-sphere w) (-> arg0 root root-prim local-sphere w)) ) (let ((s5-0 (new 'stack-no-clear 'collide-query)) (v1-20 (new 'stack-no-clear 'vector)) - (f30-0 (* 0.5 (-> arg0 root root-prim local-sphere w))) + (f30-0 (/ (-> arg0 root root-prim local-sphere w) 2)) ) (set! (-> v1-20 quad) (-> arg0 root trans quad)) (vector+float*! (-> s5-0 start-pos) v1-20 *up-vector* 0.0) @@ -1217,7 +1217,7 @@ (set-setting! 'rapid-tracking #f 0.0 0) ((lambda :behavior target () - (set! (-> self control bend-target) (* 0.5 (-> self control bend-target))) + (set! (-> self control bend-target) (/ (-> self control bend-target) 2)) (if (logtest? (water-flag touch-water) (-> self water flags)) (sound-play "swim-stroke") ) diff --git a/goal_src/jak3/engine/target/target-death.gc b/goal_src/jak3/engine/target/target-death.gc index 24c68da7b5b..2d5120f49f5 100644 --- a/goal_src/jak3/engine/target/target-death.gc +++ b/goal_src/jak3/engine/target/target-death.gc @@ -57,7 +57,8 @@ (intro-play) ) ((logtest? (-> arg0 flags) (continue-flags warp-gate)) - (suspend-for (seconds 0.05)) + (suspend-for (seconds 0.05) + ) (let ((s5-1 (new 'static 'vector)) (a2-0 (find-nearest-entity (-> arg0 trans) warp-gate)) ) @@ -216,7 +217,8 @@ (go target-grab 'stance) ) (else - (suspend-for (seconds 0.05)) + (suspend-for (seconds 0.05) + ) ) ) 0 @@ -1420,7 +1422,7 @@ (set! (-> sv-32 vector y) (-> sv-32 shove-up)) ) (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) - (set! (-> sv-32 damage) (fmax 1.0 (ceil (* 0.5 (-> sv-32 damage))))) + (set! (-> sv-32 damage) (fmax 1.0 (ceil (/ (-> sv-32 damage) 2)))) 0 ) (set! (-> sv-36 quad) (-> sv-32 vector quad)) @@ -1450,7 +1452,8 @@ (let ((gp-1 (new-stack-vector0))) (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (move-to-point! (-> self control) gp-1) ) (set! (-> self control camera-pos quad) (-> self control trans quad)) @@ -2278,7 +2281,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) (('grenade 'big-explosion 'explode) (set! (-> self post-hook) target-no-stick-post) @@ -2357,7 +2361,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ) ) @@ -2373,7 +2378,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (suspend-for (seconds 1.2)) + (suspend-for (seconds 1.2) + ) ) ((= v1-61 'endlessfall) ((lambda :behavior target @@ -2411,8 +2417,7 @@ (target-falling-anim 30 (seconds 0.33)) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (suspend-for - (seconds 0.8) + (suspend-for (seconds 0.8) (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) (set! v1-24 'target-hit-ground-hard) (goto cfg-17) @@ -2465,7 +2470,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) (remove-setting! 'mode-name) ) @@ -2630,7 +2636,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ((= v1-61 'centipede) (set! (-> self trans-hook) #f) diff --git a/goal_src/jak3/engine/target/target-gun.gc b/goal_src/jak3/engine/target/target-gun.gc index f947e1d67a6..89d7b930feb 100644 --- a/goal_src/jak3/engine/target/target-gun.gc +++ b/goal_src/jak3/engine/target/target-gun.gc @@ -2082,7 +2082,7 @@ (dotimes (s4-1 1) ((method-of-type sphere new) (the-as symbol (-> s5-2 s4-1)) sphere) ) - (let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> s5-2 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) (set! (-> s5-2 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-1 0.0 1.0)) (let ((v1-214 gp-3)) @@ -2171,7 +2171,7 @@ (let* ((f0-28 (deg-diff (y-angle (-> self control)) (vector-y-angle (-> self control to-target-pt-xz)))) (f0-30 (fmax -5461.3335 (fmin 5461.3335 f0-28))) ) - (seek! (-> self upper-body twist z) f0-30 (fabs (* 0.2 f0-30))) + (seek! (-> self upper-body twist z) f0-30 (fabs (/ f0-30 5))) ) ) ) diff --git a/goal_src/jak3/engine/target/target-invisible.gc b/goal_src/jak3/engine/target/target-invisible.gc index 468be4dddae..a59da774e32 100644 --- a/goal_src/jak3/engine/target/target-invisible.gc +++ b/goal_src/jak3/engine/target/target-invisible.gc @@ -180,8 +180,8 @@ (vector+! s4-0 s4-0 s3-0) ) (set! (-> *part-id-table* 659 init-specs 2 initial-valuef) (-> *invis-joint-list* s5-0 size)) - (set! (-> *part-id-table* 659 init-specs 3 initial-valuef) (* 0.5 (-> *invis-joint-list* s5-0 size))) - (set! (-> *part-id-table* 659 init-specs 4 initial-valuef) (* 0.5 (-> *invis-joint-list* s5-0 size))) + (set! (-> *part-id-table* 659 init-specs 3 initial-valuef) (/ (-> *invis-joint-list* s5-0 size) 2)) + (set! (-> *part-id-table* 659 init-specs 4 initial-valuef) (/ (-> *invis-joint-list* s5-0 size) 2)) (launch-particles (-> *part-id-table* 659) s4-0) ) ) @@ -442,7 +442,8 @@ (set-time! (-> self state-time)) ) :code (behavior () - (suspend-for (seconds 0.66)) + (suspend-for (seconds 0.66) + ) (cond ((logtest? (-> *part-group-id-table* 182 flags) (sp-group-flag sp13)) (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) @@ -469,7 +470,8 @@ ) ) (sound-play "dark-maker") - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (go-virtual idle) ) :post (behavior () diff --git a/goal_src/jak3/engine/target/target-launch.gc b/goal_src/jak3/engine/target/target-launch.gc index 0b42792e3a8..d4c4ea0eac2 100644 --- a/goal_src/jak3/engine/target/target-launch.gc +++ b/goal_src/jak3/engine/target/target-launch.gc @@ -54,7 +54,7 @@ (f0-5 (- 1.0 f0-4)) ) (let ((f1-5 (* 1.4 f0-5 (/ f30-0 (* 0.0033333334 (the float (-> self control sliding-start-time))))))) - (* 0.0033333334 f1-5 (the float (- (current-time) (-> self clock old-frame-counter)))) + (* (/ f1-5 300) (the float (- (current-time) (-> self clock old-frame-counter)))) ) (let ((f0-6 (- 1.0 f0-5))) (vector+float*! @@ -63,7 +63,7 @@ (-> self control unknown-vector37) f0-6 ) - (+! (-> self control trans y) (* 0.5 f0-6 f0-6 (the-as float (-> self control unknown-word04)))) + (+! (-> self control trans y) (* (/ f0-6 2) f0-6 (the-as float (-> self control unknown-word04)))) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self control transv quad) (-> self control unknown-vector37 quad)) (+! (-> self control transv y) (* f0-6 (the-as float (-> self control unknown-word04)))) diff --git a/goal_src/jak3/engine/target/target-lightjak.gc b/goal_src/jak3/engine/target/target-lightjak.gc index e8aa500cfa9..bf0cb35bc08 100644 --- a/goal_src/jak3/engine/target/target-lightjak.gc +++ b/goal_src/jak3/engine/target/target-lightjak.gc @@ -1380,12 +1380,7 @@ (set! (-> self fact shield-attack-id) a0-46) ) (if (not (logtest? (-> self lightjak stage) (lightjak-stage ls1))) - (send-event - self - 'get-pickup - (pickup-type eco-pill-light) - (* -0.33333334 (-> *FACT-bank* lightjak-shield-inc)) - ) + (send-event self 'get-pickup (pickup-type eco-pill-light) (/ (-> *FACT-bank* lightjak-shield-inc) -3)) ) (set-time! (-> self lightjak shield-count-time)) ) @@ -2275,7 +2270,9 @@ (defstate die (freeze-screen) :virtual #t :code (behavior () - (suspend-for (seconds 1) (seek! (-> self transition) 0.0 (seconds-per-frame))) + (suspend-for (seconds 1) + (seek! (-> self transition) 0.0 (seconds-per-frame)) + ) ) ) @@ -2766,7 +2763,7 @@ ) (else (let* ((f1-5 (/ f0-1 (* (-> self control dynam gravity-length) (seconds-per-frame)))) - (f0-6 (* 0.5 f1-5 (seconds-per-frame) f0-1)) + (f0-6 (* (/ f1-5 2) (seconds-per-frame) f0-1)) (v1-25 (new-stack-vector0)) ) (let ((f1-9 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) diff --git a/goal_src/jak3/engine/target/target-swim.gc b/goal_src/jak3/engine/target/target-swim.gc index c922805e3dd..b456775632c 100644 --- a/goal_src/jak3/engine/target/target-swim.gc +++ b/goal_src/jak3/engine/target/target-swim.gc @@ -187,10 +187,10 @@ (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x))))) ) (let ((f1-4 (fabs (- f0-10 f28-0)))) - (set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (* 0.25 f1-4))))) + (set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (/ f1-4 4))))) ) (let ((f0-14 (fabs (- f24-0 f26-0)))) - (set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))) + (set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (/ f0-14 4))))) ) ) (ja :chan 3 :group! jakb-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist)) diff --git a/goal_src/jak3/engine/target/target-tube.gc b/goal_src/jak3/engine/target/target-tube.gc index f55dd610eae..b13a4aafc88 100644 --- a/goal_src/jak3/engine/target/target-tube.gc +++ b/goal_src/jak3/engine/target/target-tube.gc @@ -845,7 +845,7 @@ (f2-0 f1-2) ) (if (< f0-2 0.0) - (set! f0-2 (* 0.5 f0-2)) + (set! f0-2 (/ f0-2 2)) ) (vector+! (-> arg1 vector) diff --git a/goal_src/jak3/engine/target/target-turret-shot.gc b/goal_src/jak3/engine/target/target-turret-shot.gc index 91582cc7a48..5d490db51a9 100644 --- a/goal_src/jak3/engine/target/target-turret-shot.gc +++ b/goal_src/jak3/engine/target/target-turret-shot.gc @@ -276,7 +276,7 @@ (launch-particles (-> *part-id-table* 852) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 1021 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 1021 init-specs 4 initial-valuef)) ) diff --git a/goal_src/jak3/engine/target/target-util.gc b/goal_src/jak3/engine/target/target-util.gc index 873ca181f8d..e8485d0d92b 100644 --- a/goal_src/jak3/engine/target/target-util.gc +++ b/goal_src/jak3/engine/target/target-util.gc @@ -1253,7 +1253,7 @@ ) ) ) - (* 0.125 f30-0) + (/ f30-0 8) ) ) @@ -1931,10 +1931,10 @@ (f30-0 (fmax -1.0 (fmin 1.0 arg2))) ) (let ((f1-5 (fabs (- f0-1 (-> arg0 blend 1))))) - (seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + (seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (/ arg3 5))) ) (let ((f0-9 (fabs (- f30-0 (-> arg0 blend 2))))) - (seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + (seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (/ arg3 5))) ) ) (cond @@ -2120,8 +2120,8 @@ (cond ((and (< 0.0 f0-5) (focus-test? this in-air)) (let* ((v0-1 (new 'static 'vector)) - (f0-6 (+ (* 0.0016666667 (-> v1-0 dynam gravity-length)) f0-5)) - (f0-9 (/ (* 0.5 f0-6 f0-6) (-> v1-0 dynam gravity-length))) + (f0-6 (+ (/ (-> v1-0 dynam gravity-length) 600) f0-5)) + (f0-9 (/ (* (/ f0-6 2) f0-6) (-> v1-0 dynam gravity-length))) ) (vector+float*! v0-1 (-> v1-0 trans) (-> v1-0 dynam gravity-normal) f0-9) ) diff --git a/goal_src/jak3/engine/target/target.gc b/goal_src/jak3/engine/target/target.gc index 0890c7ed7fc..ff5e0b16eea 100644 --- a/goal_src/jak3/engine/target/target.gc +++ b/goal_src/jak3/engine/target/target.gc @@ -587,11 +587,11 @@ (delete-back-vel) (let* ((f0-0 arg5) (f1-0 0.0) - (f2-2 (+ (* 0.0016666667 (-> self control dynam gravity-length)) + (f2-2 (+ (/ (-> self control dynam gravity-length) 600) (fmax 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) ) - (f0-1 (* f0-0 (fmax f1-0 (/ (* 0.5 f2-2 f2-2) (-> self control dynam gravity-length))))) + (f0-1 (* f0-0 (fmax f1-0 (/ (* (/ f2-2 2) f2-2) (-> self control dynam gravity-length))))) (s5-1 (+ arg0 f0-1)) ) (let ((s2-1 (+ arg1 f0-1))) @@ -2898,7 +2898,7 @@ ) (else (let* ((f1-5 (/ f0-4 (* (-> self control dynam gravity-length) (seconds-per-frame)))) - (f0-9 (* 0.5 f1-5 (seconds-per-frame) f0-4)) + (f0-9 (* (/ f1-5 2) (seconds-per-frame) f0-4)) ) (let ((v1-36 (ja-group))) (if (and v1-36 diff --git a/goal_src/jak3/engine/target/target2.gc b/goal_src/jak3/engine/target/target2.gc index 1fc5ab716cb..3ff49c0e3e7 100644 --- a/goal_src/jak3/engine/target/target2.gc +++ b/goal_src/jak3/engine/target/target2.gc @@ -47,7 +47,10 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 0.3) (suspend) (ja :num! (seek! (ja-aframe 19.0 0) 0.05))) + (suspend-for (seconds 0.3) + (suspend) + (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) + ) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-painful-land-ja :num! (seek!) :frame-num (ja-aframe 40.0 0)) (until (ja-done? 0) @@ -824,7 +827,7 @@ (let ((f0-1 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not (and (< (fabs (/ f0-1 (* 0.0033333334 f1-1))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) + (while (not (and (< (fabs (/ f0-1 (/ f1-1 300))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) (suspend) (ja :num! (loop!)) (set! f0-1 (target-height-above-ground)) @@ -1539,7 +1542,9 @@ (until #f (let ((s5-0 (rand-vu-int-range 30 600))) (ja :group! jakb-wall-hide-head-ja) - (suspend-for s5-0 (gp-0)) + (suspend-for s5-0 + (gp-0) + ) ) (let ((f30-0 (rand-vu-float-range 0.5 1.5))) (cond @@ -1577,7 +1582,9 @@ (ja :num! (seek! max f30-0)) ) (let ((s5-2 (rand-vu-int-range 60 300))) - (suspend-for s5-2 (gp-0)) + (suspend-for s5-2 + (gp-0) + ) ) (ja-no-eval :group! jakb-wall-hide-head-left-ja :num! (seek! 0.0 f30-0) :frame-num max) (until (ja-done? 0) @@ -1594,7 +1601,9 @@ (ja :num! (seek! 0.0 f30-0)) ) (let ((s5-3 (rand-vu-int-range 60 300))) - (suspend-for s5-3 (gp-0)) + (suspend-for s5-3 + (gp-0) + ) ) (ja-no-eval :group! jakb-wall-hide-head-right-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -1854,7 +1863,8 @@ :trans (behavior () (set-time! (-> self control time-of-last-debug-float)) (cond - ((cpad-hold? (-> self control cpad number) r2) + ;; og:preserve-this no debug hover when paused. + ((and (cpad-hold? (-> self control cpad number) r2) (not *pause-lock*)) (let ((a1-0 (new 'stack-no-clear 'vector))) (set! (-> a1-0 quad) (-> self control trans quad)) (let ((v1-14 (new-stack-vector0)) @@ -1941,8 +1951,7 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for - (the-as time-frame arg0) + (suspend-for (the-as time-frame arg0) (ja-no-eval :group! jakb-blast-recover-loop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) diff --git a/goal_src/jak3/engine/ui/hud-classes.gc b/goal_src/jak3/engine/ui/hud-classes.gc index 890117bcae0..78ce59be75a 100644 --- a/goal_src/jak3/engine/ui/hud-classes.gc +++ b/goal_src/jak3/engine/ui/hud-classes.gc @@ -179,7 +179,7 @@ ) ) (set! (-> this sprites 2 color x) (the int (* 0.35 f1-17 f0-27))) - (set! (-> this sprites 2 color y) (the int (* 0.1 f1-17 f0-27))) + (set! (-> this sprites 2 color y) (the int (* (/ f1-17 10) f0-27))) (set! (-> this sprites 2 color z) (the int (* 0.8 f1-17 f0-27))) ) ) diff --git a/goal_src/jak3/engine/ui/hud.gc b/goal_src/jak3/engine/ui/hud.gc index 8c5916f58a8..202a30609d2 100644 --- a/goal_src/jak3/engine/ui/hud.gc +++ b/goal_src/jak3/engine/ui/hud.gc @@ -1099,7 +1099,7 @@ :code (behavior () (until #f (if (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask pause))) - (seek! (-> self offset) 0.0 (* 0.1 (-> self clock time-adjust-ratio))) + (seek! (-> self offset) 0.0 (/ (-> self clock time-adjust-ratio) 10)) ) (if (>= 0.0 (-> self offset)) (go hud-in) diff --git a/goal_src/jak3/engine/ui/progress/progress-draw.gc b/goal_src/jak3/engine/ui/progress/progress-draw.gc index 335cc7f54b3..87efdc2a01b 100644 --- a/goal_src/jak3/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak3/engine/ui/progress/progress-draw.gc @@ -577,9 +577,9 @@ (t1-1 s1-0) (f28-0 (sv-48 s0-1 sv-64 sv-80 sv-96 t0-1 t1-1 t2-1 t3-1)) ) - (set! f30-0 (* 0.5 f28-0)) + (set! f30-0 (/ f28-0 2)) (let ((v1-17 arg0)) - (set! (-> v1-17 scale) (* 0.5 (-> arg0 scale))) + (set! (-> v1-17 scale) (/ (-> arg0 scale) 2)) ) (let* ((a0-7 this) (t9-3 (method-of-object a0-7 progress-method-40)) @@ -755,7 +755,7 @@ 0 ) ) - (the int (* 0.5 f30-0)) + (the int (/ f30-0 2)) ) ) ) @@ -1280,7 +1280,7 @@ 0 0 0 - (let* ((gp-0 (the int (* 0.016666668 arg0))) + (let* ((gp-0 (the int (/ arg0 60))) (v1-5 (- arg0 (* 60.0 (the float gp-0)))) (s5-0 (the int v1-5)) (v1-6 (- v1-5 (the float s5-0))) @@ -1302,13 +1302,7 @@ ) (cond ((logtest? (-> v1-3 flags) (highscore-flags hf2)) - (print-game-text - (highscore-time->string this (* 0.0033333334 arg1)) - arg0 - #f - 44 - (bucket-id hud-draw-hud-alpha) - ) + (print-game-text (highscore-time->string this (/ arg1 300)) arg0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ((logtest? (-> v1-3 flags) (highscore-flags hf3)) (let ((s4-1 print-game-text)) @@ -1832,8 +1826,8 @@ (f28-0 (- (-> s0-1 z) (-> s0-1 x))) (s1-2 (init-text! this)) ) - (let* ((f30-0 (* 0.5 f28-0)) - (f28-1 (* 0.5 f28-0)) + (let* ((f30-0 (/ f28-0 2)) + (f28-1 (/ f28-0 2)) (f26-0 (+ sv-16 (-> s0-1 x))) (f24-0 (+ sv-16 (-> s0-1 x) f30-0)) ) @@ -2236,7 +2230,7 @@ (f2-4 (+ (-> s4-0 x) (* 0.5 (- (-> s4-0 z) (-> s4-0 x))))) (f30-1 (+ f2-4 f1-6)) (f28-0 (- f2-4 f1-6)) - (f26-0 (+ -8.0 (* 0.5 f0-7) (-> arg1 origin y))) + (f26-0 (+ -8.0 (/ f0-7 2) (-> arg1 origin y))) ) (let ((f1-10 (+ -15.0 (-> arg1 origin y))) (f24-0 (+ 3.0 f0-7 (-> arg1 origin y))) @@ -2516,7 +2510,7 @@ (let ((a0-23 arg1)) (set! (-> a0-23 color) (font-color font-color-32)) ) - (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float (the int (* 0.5 f30-2))))) + (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float (the int (/ f30-2 2))))) (let ((s5-1 print-game-text)) (format (clear *temp-string*) "~33L~C" 163) (s5-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) diff --git a/goal_src/jak3/engine/ui/progress/progress.gc b/goal_src/jak3/engine/ui/progress/progress.gc index 30fbb3bb2df..4fd910d4fb6 100644 --- a/goal_src/jak3/engine/ui/progress/progress.gc +++ b/goal_src/jak3/engine/ui/progress/progress.gc @@ -1094,14 +1094,14 @@ (seek-ease (-> self menu-transition) 0.0 - (* 0.1 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 10) 0.4 - (* 0.01 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 100) ) ) ) (else - (seek! (-> self menu-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))) + (seek! (-> self menu-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)) (when (and (= (-> self menu-transition) 1.0) (or (and (nonzero? (-> self state-pos)) (= (-> self anim-frame) 1.0)) (or (and (zero? (-> self state-pos)) (= (-> self anim-frame) 0.0)) @@ -1144,12 +1144,12 @@ (if (= (-> self ring-angle) (-> self ring-want-angle)) (respond-to-cpad self) ) - (let ((f30-0 (* 0.005 (-> self clock time-adjust-ratio)))) + (let ((f30-0 (/ (-> self clock time-adjust-ratio) 200))) (cond ((= (-> self menu-transition) 1.0) (if (and (zero? (-> self state-pos)) (= (-> self starting-state) 'main)) - (seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) - (seek! (-> self anim-frame) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 50)) + (seek! (-> self anim-frame) 1.0 (/ (-> self clock time-adjust-ratio) 50)) ) (let ((f0-27 (if (and (zero? (-> self state-pos)) (!= (-> self starting-state) 'title)) 0.0 @@ -1159,14 +1159,14 @@ ) (when (= (-> self next) 'bigmap) (set! f0-27 0.4) - (set! f30-0 (* 0.008 (-> self clock time-adjust-ratio))) + (set! f30-0 (/ (-> self clock time-adjust-ratio) 125)) ) (seek! (-> self pos-transition) f0-27 f30-0) ) ) ((zero? (-> self state-pos)) (if (= (-> self current) 'bigmap) - (set! f30-0 (* 0.05 (-> self clock time-adjust-ratio))) + (set! f30-0 (/ (-> self clock time-adjust-ratio) 20)) ) (if (!= (-> self starting-state) 'title) (seek! (-> self pos-transition) 0.0 f30-0) @@ -1217,9 +1217,9 @@ (set! (-> self swing) (seek-ease (-> self swing) 4.0 - (* 0.05 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 20) 0.5 - (* 0.005 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 200) ) ) (set! (-> self swing) (seek-ease @@ -1493,9 +1493,9 @@ (set! (-> self scanlines-alpha) (seek-ease (-> self scanlines-alpha) (- 1.0 (-> self menu-transition)) - (* 0.05 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 20) 0.3 - (* 0.001 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 1000) ) ) ) @@ -1815,16 +1815,16 @@ ) ) :trans (behavior () - (seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 50)) (cond ((= (-> self anim-frame) 0.0) - (seek! (-> self pos-transition) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self pos-transition) 1.0 (/ (-> self clock time-adjust-ratio) 50)) (if (= (-> self pos-transition) 1.0) (go-virtual gone) ) ) (else - (seek! (-> self pos-transition) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self pos-transition) 0.0 (/ (-> self clock time-adjust-ratio) 50)) ) ) (set-ring-position self) @@ -1871,11 +1871,11 @@ (let ((s5-0 (&+ (the-as (pointer float) *setting-control*) (-> this setting-offset))) (s3-0 #f) ) - (let ((f30-0 (* 0.02 (-> pp clock time-adjust-ratio))) + (let ((f30-0 (/ (-> pp clock time-adjust-ratio) 50)) (f28-0 0.0) ) (when (type? this menu-picture-slider-option) - (set! f30-0 (* 0.005 (-> pp clock time-adjust-ratio))) + (set! f30-0 (/ (-> pp clock time-adjust-ratio) 200)) (set! f28-0 0.25) ) (cond diff --git a/goal_src/jak3/engine/ui/text.gc b/goal_src/jak3/engine/ui/text.gc index 34867435416..2ac85517b19 100644 --- a/goal_src/jak3/engine/ui/text.gc +++ b/goal_src/jak3/engine/ui/text.gc @@ -447,7 +447,7 @@ ) (set! sv-64 0) (if (logtest? (-> arg1 flags) (font-flags middle)) - (+! (-> arg1 origin x) (* 0.5 (-> arg1 width))) + (+! (-> arg1 origin x) (/ (-> arg1 width) 2)) ) (set! sv-72 (-> sv-32 0)) (set! sv-80 0) diff --git a/goal_src/jak3/engine/util/smush-control-h.gc b/goal_src/jak3/engine/util/smush-control-h.gc index e40f94fc2dc..0c92ade6b95 100644 --- a/goal_src/jak3/engine/util/smush-control-h.gc +++ b/goal_src/jak3/engine/util/smush-control-h.gc @@ -110,7 +110,7 @@ (clock clock) ) "Start the smush with the given parameters." - (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) + (when (>= (fabs (/ (-> this amp) 5)) (fabs (get-no-update this))) (set! (-> this amp) amplitude) (set! (-> this period) (the float period)) (set! (-> this duration) (the float duration)) diff --git a/goal_src/jak3/engine/util/sync-info.gc b/goal_src/jak3/engine/util/sync-info.gc index d88fc2b22f9..10bdef39a7f 100644 --- a/goal_src/jak3/engine/util/sync-info.gc +++ b/goal_src/jak3/engine/util/sync-info.gc @@ -409,7 +409,7 @@ (defmethod set-params! ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this max-val) (* 0.5 arg2)) + (set! (-> this max-val) (/ arg2 2)) (set! (-> this start-time) 0) (set! (-> this timer) 0) (set! (-> this value) 0.0) @@ -507,8 +507,8 @@ (defmethod set-params! ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this xz-max) (* 0.5 arg2)) - (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this xz-max) (/ arg2 2)) + (set! (-> this y-max) (/ arg3 2)) (set! (-> this start-time) 0) (set! (-> this timer) 0) (vector-reset! (-> this value)) diff --git a/goal_src/jak3/levels/city/blow-tower/blow-tower-obs.gc b/goal_src/jak3/levels/city/blow-tower/blow-tower-obs.gc index f96c9260c1c..ff0347f185d 100644 --- a/goal_src/jak3/levels/city/blow-tower/blow-tower-obs.gc +++ b/goal_src/jak3/levels/city/blow-tower/blow-tower-obs.gc @@ -1303,7 +1303,7 @@ (f0-2 (evaluate *curve-linear-up-down* f0-1 (loop-behavior use-default))) (f0-3 (sin (lerp -16384.0 16384.0 f0-2))) (f0-4 (+ 1.0 f0-3)) - (f0-5 (* 0.5 f0-4)) + (f0-5 (/ f0-4 2)) (f0-6 (* 0.8 f0-5)) (f0-7 (+ 0.3 f0-6)) ) @@ -1514,7 +1514,8 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) ) - (suspend-for (seconds 0.1)) + (suspend-for (seconds 0.1) + ) (let ((v1-46 (-> self root root-prim))) (set! (-> v1-46 prim-core collide-as) (collide-spec)) (set! (-> v1-46 prim-core collide-with) (collide-spec)) @@ -1776,11 +1777,11 @@ (set! (-> v1-4 quad) (-> sv-52 quad)) (set! sv-80 v1-4) ) - (let* ((f30-0 (- (* 0.5 arg2))) + (let* ((f30-0 (- (/ arg2 2))) (v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-7 (the-as number (logior #x3f800000 v1-6))) ) - (set! sv-84 (+ f30-0 (* (+ -1.0 (the-as float v1-7)) (+ (* 0.5 arg2) (* 0.5 arg2))))) + (set! sv-84 (+ f30-0 (* (+ -1.0 (the-as float v1-7)) (+ (/ arg2 2) (/ arg2 2))))) ) (vector+float*! sv-80 sv-80 (vector-cross! (new 'stack-no-clear 'vector) sv-48 *up-vector*) (* sv-84 arg3)) (bt-barrel-ground-probe sv-80) @@ -1804,10 +1805,10 @@ ) (set! sv-128 sv-48) (let* ((f30-1 arg3) - (f28-0 (- (* 0.25 arg2))) + (f28-0 (- (/ arg2 4))) (v1-30 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-31 (the-as number (logior #x3f800000 v1-30))) - (f0-18 (* f30-1 (+ f28-0 (* (+ -1.0 (the-as float v1-31)) (+ (* 0.25 arg2) (* 0.25 arg2)))))) + (f0-18 (* f30-1 (+ f28-0 (* (+ -1.0 (the-as float v1-31)) (+ (/ arg2 4) (/ arg2 4)))))) ) (vector+float*! s1-1 s0-1 sv-128 f0-18) ) @@ -1875,7 +1876,8 @@ :code (behavior () (until #f (attempt-barrel-spawn) - (suspend-for (seconds 0.3)) + (suspend-for (seconds 0.3) + ) ) #f ) diff --git a/goal_src/jak3/levels/city/blow-tower/blow-tower-obs2.gc b/goal_src/jak3/levels/city/blow-tower/blow-tower-obs2.gc index c6032d6111d..701af6949c9 100644 --- a/goal_src/jak3/levels/city/blow-tower/blow-tower-obs2.gc +++ b/goal_src/jak3/levels/city/blow-tower/blow-tower-obs2.gc @@ -177,7 +177,7 @@ (f0-6 (+ -1.0 (the-as float v1-35))) ) (cond - ((< f0-6 (* 0.5 f30-0)) + ((< f0-6 (/ f30-0 2)) (set! s5-1 (logior s5-1 2)) ) ((< f0-6 f30-0) @@ -366,7 +366,8 @@ (defbehavior bt-roboguard-turret-code bt-roboguard () (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! bt-roboguard-idle-shoot0-loop-ja :num! zero) - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (let ((gp-1 (lambda ((arg0 bt-roboguard) (arg1 symbol)) (quaternion-rotate-y! (-> arg0 root quat) (-> arg0 root quat) (* 20480.0 (seconds-per-frame) (if arg1 @@ -381,7 +382,8 @@ ) (until #f (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) ) @@ -402,7 +404,8 @@ ) ) (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) ) @@ -730,7 +733,7 @@ (let ((f30-0 0.3)) (set! (-> (new 'stack-no-clear 'vector) quad) (-> this bob-vec quad)) (set! (-> this xz-dir x) (-> this bobbers 0 current-speed)) - (set! (-> this xz-dir z) (* 0.25 (-> this bobbers 2 current-speed))) + (set! (-> this xz-dir z) (/ (-> this bobbers 2 current-speed) 4)) (let ((f26-0 (lerp-scale 0.0 10922.667 (-> this xz-dir z) f30-0 1.0)) (f24-0 (lerp-scale 0.0 -10922.667 (-> this xz-dir z) (- f30-0) -1.0)) (f28-0 (lerp-scale 0.0 -10922.667 (-> this xz-dir x) f30-0 1.0)) @@ -2178,7 +2181,8 @@ ) ) :code (behavior () - (suspend-for (seconds 0.3)) + (suspend-for (seconds 0.3) + ) (until #f (suspend) (when (ragdoll-settled? self) @@ -2186,9 +2190,11 @@ (logior! (-> self skel effect flags) (effect-control-flag ecf1)) ) (do-effect (-> self skel effect) "death-default" 0.0 -1) - (suspend-for (seconds 0.3)) + (suspend-for (seconds 0.3) + ) (logior! (-> self draw status) (draw-control-status no-draw)) - (suspend-for (seconds 0.8)) + (suspend-for (seconds 0.8) + ) (go-virtual dormant) ) ) @@ -2460,9 +2466,9 @@ (let ((s4-4 (new 'stack-no-clear 'quaternion))) (vector-normalize! s3-3 1.0) (+! (-> s3-3 y) 1.0) - (set! (-> s3-3 y) (* 0.5 (-> s3-3 y))) + (set! (-> s3-3 y) (/ (-> s3-3 y) 2)) (+! (-> s3-3 x) 1.0) - (set! (-> s3-3 x) (* 0.5 (-> s3-3 x))) + (set! (-> s3-3 x) (/ (-> s3-3 x) 2)) (quaternion-rotate-x! s4-4 (quaternion-identity! (new 'stack-no-clear 'quaternion)) @@ -2592,6 +2598,7 @@ (none) ) +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this bt-grunt)) (local-vars (f0-0 float)) (let ((gp-0 (the-as ragdoll-proc (handle->process (-> this ragdoll-proc))))) @@ -2717,10 +2724,10 @@ (-> arg0 thrust s3-0) (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) (fmax 0.0 (-> v0-6 y)) - (fabs (* 0.2 (-> v0-6 z))) + (fabs (/ (-> v0-6 z) 5)) (fmax 0.0 (-> s1-1 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) diff --git a/goal_src/jak3/levels/city/blow-tower/cty-blow-tower.gc b/goal_src/jak3/levels/city/blow-tower/cty-blow-tower.gc index e494f2fa975..a243f9d4c76 100644 --- a/goal_src/jak3/levels/city/blow-tower/cty-blow-tower.gc +++ b/goal_src/jak3/levels/city/blow-tower/cty-blow-tower.gc @@ -1049,7 +1049,7 @@ (set! arg0 (-> arg1 control)) ) (let ((f28-0 (* 409.6 arg0)) - (f30-0 (lerp 0.05 1.0 (* 0.2 arg0))) + (f30-0 (lerp 0.05 1.0 (/ arg0 5))) ) (activate! *camera-smush-control* f28-0 45 (the int (* 300.0 f30-0)) 1.0 0.9 (-> *display* camera-clock)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (the-as time-frame (the int (* 150.0 f30-0)))) @@ -1110,7 +1110,7 @@ ) (let* ((f30-0 5461.3335) (s5-0 (the int (/ 65536.0 f30-0))) - (f28-0 (* 0.5 f30-0)) + (f28-0 (/ f30-0 2)) ) (dotimes (s4-0 s5-0) (vector-rotate-around-y! @@ -1245,7 +1245,7 @@ (matrix->quaternion arg2 a1-16) ) ) - (quaternion-rotate-local-x! arg2 arg2 (* 0.5 (-> this roll-amount))) + (quaternion-rotate-local-x! arg2 arg2 (/ (-> this roll-amount) 2)) ) ) (vector-! s1-0 s2-0 (-> this root trans)) @@ -1735,7 +1735,7 @@ (set! (-> this hud-target angle) 0.0) (set! (-> this hud-target flags) (hud-sprite-flags hsf3)) (set! (-> this hud-target-inner flags) (hud-sprite-flags hsf3)) - (let* ((f0-46 (* 0.03125 (-> this onscreen-targets s5-1 size))) + (let* ((f0-46 (/ (-> this onscreen-targets s5-1 size) 32)) (f0-48 (fmax 0.4 (fmin 2.0 f0-46))) (f0-49 (* 2.0 f0-48)) ) @@ -2135,7 +2135,7 @@ ) (let* ((f0-24 (vector-dot s4-12 s2-2)) (f0-25 (+ 1.0 f0-24)) - (f0-26 (* 0.5 f0-25)) + (f0-26 (/ f0-25 2)) (f0-27 (* f0-26 f0-26)) (f0-28 (lerp 0.0 2.0 f0-27)) (f30-0 (fmax 0.3 (fmin 2.0 f0-28))) @@ -2215,7 +2215,7 @@ (vector-y-angle (vector-z-quaternion! (new 'stack-no-clear 'vector) arg0)) ) ) - (f0-2 (* 0.000061035156 f0-1)) + (f0-2 (/ f0-1 (meters 4))) (f0-3 (+ 0.5 f0-2)) (f0-4 (floor f0-3)) ) @@ -3103,7 +3103,7 @@ ) (let ((f0-38 (-> this path-height-vel))) 0.0 - (let ((f0-41 (fmax -1.0 (fmin 1.0 (* 0.000024414063 f0-38))))) + (let ((f0-41 (fmax -1.0 (fmin 1.0 (/ f0-38 (meters 10)))))) (quaternion-rotate-local-x! s4-2 s4-2 (* -4551.1113 f0-41)) ) ) @@ -3429,7 +3429,7 @@ ) (let ((f0-17 (-> this path-height-vel))) 0.0 - (let ((f0-20 (fmax -1.0 (fmin 1.0 (* 0.000024414063 f0-17))))) + (let ((f0-20 (fmax -1.0 (fmin 1.0 (/ f0-17 (meters 10)))))) (quaternion-rotate-local-x! s4-1 s4-1 (* -4551.1113 f0-20)) ) ) @@ -4568,7 +4568,7 @@ (f0-18 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-17))) f30-0)) ) (set! (-> *part-id-table* 4825 init-specs 4 initial-valuef) f0-18) - (set! (-> *part-id-table* 4825 init-specs 3 initial-valuef) (* 0.5 f0-18)) + (set! (-> *part-id-table* 4825 init-specs 3 initial-valuef) (/ f0-18 2)) ) (draw-beam (-> *part-id-table* 4825) diff --git a/goal_src/jak3/levels/city/bombbot/bombbot.gc b/goal_src/jak3/levels/city/bombbot/bombbot.gc index e1d32f8e412..baee2d636ef 100644 --- a/goal_src/jak3/levels/city/bombbot/bombbot.gc +++ b/goal_src/jak3/levels/city/bombbot/bombbot.gc @@ -593,7 +593,7 @@ (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) (damage 20.0) (vehicle-damage-factor 1.0) - (vehicle-impulse-factor (* 0.000012207031 f30-0)) + (vehicle-impulse-factor (/ f30-0 (meters 20))) (attacker-velocity s4-2) ) ) @@ -1606,7 +1606,7 @@ (set! (-> t0-0 z) 0.0) (set! (-> t0-0 w) 1.0) (let ((v0-6 (t9-6 a0-32 a1-17 a2-23 a3-1 t0-0 (/ f28-0 f30-0)))) - (set! (-> s1-0 delta-y) (* 0.05 (-> v0-6 y) (vector-length (-> s1-0 speed)))) + (set! (-> s1-0 delta-y) (* (/ (-> v0-6 y) 20) (vector-length (-> s1-0 speed)))) ) ) ) @@ -3278,7 +3278,7 @@ ) (set! (-> v1-3 main-y) (- (-> s4-0 feet s0-0 real-position y) (-> s4-0 root trans y))) (set! (-> v1-3 main-y) (-> v1-3 delta-y)) - (+! f30-0 (* 0.25 (-> v1-3 main-y))) + (+! f30-0 (/ (-> v1-3 main-y) 4)) (set! (-> s1-0 quad) (-> v1-3 pos-offset quad)) (set! (-> s1-0 y) (* -2.0 (-> v1-3 main-y))) (new 'stack-no-clear 'vector) diff --git a/goal_src/jak3/levels/city/common/guard-grenade.gc b/goal_src/jak3/levels/city/common/guard-grenade.gc index 6234f27fef2..38180c8beda 100644 --- a/goal_src/jak3/levels/city/common/guard-grenade.gc +++ b/goal_src/jak3/levels/city/common/guard-grenade.gc @@ -328,7 +328,7 @@ (set! (-> self reloading-ammo) (the-as handle #f)) ) :trans (behavior () - (when (>= (* 0.5 (-> self grenade-guard-min-player-dist)) (-> self target-self-xz-dist)) + (when (>= (/ (-> self grenade-guard-min-player-dist) 2) (-> self target-self-xz-dist)) (cond ((not (time-elapsed? (-> self state-time) (seconds 1.5))) (+! (-> self num-times-reloading-interrupted) 1) diff --git a/goal_src/jak3/levels/city/common/guard-states.gc b/goal_src/jak3/levels/city/common/guard-states.gc index e93ce08b363..85753456329 100644 --- a/goal_src/jak3/levels/city/common/guard-states.gc +++ b/goal_src/jak3/levels/city/common/guard-states.gc @@ -547,7 +547,7 @@ (.svf (&-> a1-2 quad) vf6) ) (let ((f30-2 (* 0.5 (vector-vector-xz-distance s3-0 s1-0)))) - (vector-normalize! s2-0 (* 0.5 f30-2)) + (vector-normalize! s2-0 (/ f30-2 2)) (vector-normalize! s0-0 (* 2.0 f30-2)) ) (set! sv-144 0) diff --git a/goal_src/jak3/levels/city/common/nav-graph.gc b/goal_src/jak3/levels/city/common/nav-graph.gc index f6d00abd1a2..7f1184f7ce1 100644 --- a/goal_src/jak3/levels/city/common/nav-graph.gc +++ b/goal_src/jak3/levels/city/common/nav-graph.gc @@ -14,13 +14,13 @@ ) (defmethod set-speed-limit ((this nav-branch) (arg0 float)) - (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 1024))))))) 0 (none) ) (defmethod set-width ((this nav-branch) (arg0 float)) - (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) + (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 256))))))) 0 (none) ) @@ -301,7 +301,7 @@ ) (defmethod set-radius ((this nav-node) (arg0 float)) - (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 1024))))))) 0 (none) ) diff --git a/goal_src/jak3/levels/city/common/trail.gc b/goal_src/jak3/levels/city/common/trail.gc index da1d92cb286..a3a5653f6eb 100644 --- a/goal_src/jak3/levels/city/common/trail.gc +++ b/goal_src/jak3/levels/city/common/trail.gc @@ -545,7 +545,7 @@ ) 0 (let* ((f0-0 (-> v1-0 cell-width)) - (f1-1 (* 0.5 f0-0)) + (f1-1 (/ (the float f0-0) 2)) ) (let ((f3-0 (- (-> arg0 x) f1-1)) (f2-2 (- (-> arg0 z) f1-1)) diff --git a/goal_src/jak3/levels/city/ctywide-obs.gc b/goal_src/jak3/levels/city/ctywide-obs.gc index 8e335bebf25..1dad0d980d7 100644 --- a/goal_src/jak3/levels/city/ctywide-obs.gc +++ b/goal_src/jak3/levels/city/ctywide-obs.gc @@ -499,11 +499,11 @@ ) (vector+! (-> s1-0 trans) arg0 arg1) (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) - (+! (-> s1-0 trans y) (* 0.5 arg2)) + (+! (-> s1-0 trans y) (/ arg2 2)) (vector-! (-> s2-1 rvec) arg1 arg0) (let ((f30-1 (vector-normalize-ret-len! (-> s2-1 rvec) 1.0))) - (set! (-> s1-0 scale x) (* 0.00024414062 f30-1)) - (set! (-> s1-0 scale y) (* 0.00024414062 arg2)) + (set! (-> s1-0 scale x) (/ f30-1 METER_LENGTH)) + (set! (-> s1-0 scale y) (/ arg2 METER_LENGTH)) (set! (-> s1-0 scale z) 1.0) (set! (-> s2-1 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) (vector-cross! (-> s2-1 fvec) (-> s2-1 rvec) (-> s2-1 uvec)) @@ -513,7 +513,7 @@ (set! (-> this plane w) (- (vector-dot (-> s2-1 fvec) (-> this root trans)))) (let ((v0-6 (-> this root root-prim local-sphere))) (set! (-> v0-6 x) 0.0) - (set! (-> v0-6 y) (* 0.00024414062 (* 0.5 arg2))) + (set! (-> v0-6 y) (* 0.00024414062 (/ arg2 2))) (set! (-> v0-6 z) 0.0) (let ((f0-20 0.5) (f1-7 (* f30-1 f30-1)) @@ -2456,8 +2456,7 @@ ) (send-event *camera* 'teleport-to-transformq s4-0) ) - (suspend-for - (seconds 3) + (suspend-for (seconds 3) (set! (-> *camera* slave 0 fov) (-> *city-burning-bush-get-on-info* (-> self info index) fov)) ) (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) diff --git a/goal_src/jak3/levels/city/hijack/cty-hijack.gc b/goal_src/jak3/levels/city/hijack/cty-hijack.gc index a89210c00f7..5bc741fc9c0 100644 --- a/goal_src/jak3/levels/city/hijack/cty-hijack.gc +++ b/goal_src/jak3/levels/city/hijack/cty-hijack.gc @@ -1218,7 +1218,7 @@ ) 0.0 (let* ((f0-3 (sin (* 65536.0 f0-1))) - (f0-4 (* 0.125 f0-3)) + (f0-4 (/ f0-3 8)) ) (set! (-> self draw color-emissive x) (+ 0.375 f0-4)) ) @@ -1681,7 +1681,8 @@ (until (process-grab? *target* #f) (suspend) ) - (suspend-for (seconds 1.5)) + (suspend-for (seconds 1.5) + ) (send-event (handle->process (-> self hpickup)) 'flight-up) (let ((gp-1 (-> self missiles allocated-length)) (s5-0 0) @@ -1729,7 +1730,8 @@ ) ) (sound-play "hj-missile" :id (-> self missile-sound)) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (dotimes (gp-3 (-> self missiles length)) (send-event (handle->process (-> self missiles gp-3)) 'begin-moving) ) @@ -1738,9 +1740,11 @@ (send-event (handle->process (-> self missiles gp-4)) 'begin-moving) ) (cty-hijack-manager-method-39 self 1) - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (remove-setting! 'entity-name) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (until (process-release? *target*) (suspend) ) diff --git a/goal_src/jak3/levels/city/hijack/guide-arrow.gc b/goal_src/jak3/levels/city/hijack/guide-arrow.gc index 285470ef8f0..ce48fd977bd 100644 --- a/goal_src/jak3/levels/city/hijack/guide-arrow.gc +++ b/goal_src/jak3/levels/city/hijack/guide-arrow.gc @@ -72,7 +72,7 @@ (logior! (-> this draw status) (draw-control-status force-fade)) (let ((f0-8 (vector-vector-distance (-> this root trans) (math-camera-pos)))) 0.0 - (let* ((f1-2 (* 0.0000027126737 f0-8)) + (let* ((f1-2 (/ f0-8 (meters 90))) (f1-4 (fmax 0.0 (fmin 1.0 f1-2))) (f0-11 (- 1.0 (* (- 1.0 f1-4) (- 1.0 f1-4)))) ) diff --git a/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc b/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc index 9e472813609..705d46875ad 100644 --- a/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc +++ b/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc @@ -1837,7 +1837,8 @@ process (lambda :behavior process () - (suspend-for (seconds 0.75)) + (suspend-for (seconds 0.75) + ) (let ((a0-0 (ppointer->process (-> self parent)))) (if a0-0 (play-speech (the-as ctyport-attack-manager a0-0) 13) @@ -1987,7 +1988,8 @@ :virtual #t :code (behavior () (sound-stop (-> self hum-sound)) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (disable *screen-filter*) (deactivate self) ) @@ -2173,7 +2175,8 @@ ) ) :code (behavior () - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (let ((gp-1 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-1 from) (process->ppointer self)) (set! (-> gp-1 num-params) 0) @@ -2670,11 +2673,8 @@ (cond ((-> arg0 inout?) (let* ((f0-2 (* 0.0033333334 (the float (- (current-time) (-> this mine-clock))))) - (f1-3 (* 0.0033333334 (-> arg0 period))) - (f0-5 (+ (/ (- f0-2 (* (the float (the int (/ f0-2 f1-3))) f1-3)) (* 0.0033333334 (-> arg0 period))) - (-> arg0 offset) - ) - ) + (f1-3 (/ (-> arg0 period) 300)) + (f0-5 (+ (/ (- f0-2 (* (the float (the int (/ f0-2 f1-3))) f1-3)) (/ (-> arg0 period) 300)) (-> arg0 offset))) (f0-6 (- f0-5 (* (the float (the int (/ f0-5 1.0))) 1.0))) ) (if (< 0.5 f0-6) @@ -2690,7 +2690,7 @@ ) ) (if (-> arg0 spin?) - (+! f30-0 (* 0.0033333334 (-> arg0 spinrate) (the float (- (current-time) (-> this mine-clock))))) + (+! f30-0 (* (/ (-> arg0 spinrate) 300) (the float (- (current-time) (-> this mine-clock))))) ) (vector-rotate-around-y! s4-0 s4-0 f30-0) ) diff --git a/goal_src/jak3/levels/city/port/attack/h-torpedo.gc b/goal_src/jak3/levels/city/port/attack/h-torpedo.gc index d5a92e95ef1..f0e9eea0236 100644 --- a/goal_src/jak3/levels/city/port/attack/h-torpedo.gc +++ b/goal_src/jak3/levels/city/port/attack/h-torpedo.gc @@ -628,14 +628,14 @@ (when #t (cond ((< 0.0 (-> this down-force)) - (let* ((f1-3 (* 0.0000024414062 (-> this down-force))) + (let* ((f1-3 (/ (-> this down-force) (meters 100))) (f0-7 (fmax 0.0 (fmin 1.0 f1-3))) ) (set! (-> this target-pitch) (lerp 0.0 -7281.778 f0-7)) ) ) (else - (let* ((f1-6 (* -0.0000024414062 (-> this down-force))) + (let* ((f1-6 (/ (-> this down-force) (meters -100))) (f0-11 (fmax 0.0 (fmin 1.0 f1-6))) ) (set! (-> this target-pitch) (lerp 0.0 7281.778 f0-11)) @@ -658,8 +658,8 @@ (vector+float*! v1-16 a0-7 a1-5 a2-3) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) - (let* ((s2-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 s4-0 (* 0.5 f30-0))) - (s1-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 s4-0 (* -0.5 f30-0))) + (let* ((s2-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 s4-0 (/ f30-0 2))) + (s1-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 s4-0 (/ f30-0 -2))) (f28-0 (probe-ground this s2-1 a2-3)) (f0-24 (probe-ground this s1-1 a2-3)) ) @@ -827,7 +827,7 @@ (when (not (-> this on-water?)) (set! f26-0 10.0) (when (< (-> this down-force) -204800.0) - (let* ((f1-11 (* -0.0000012207031 (-> this down-force))) + (let* ((f1-11 (/ (-> this down-force) (meters -200))) (f24-0 (fmax 0.0 (fmin 1.0 f1-11))) ) (cpad-set-buzz! @@ -870,14 +870,14 @@ ) ) (when (-> this on-water?) - (let ((f0-42 (* -0.0000012207031 (-> this down-force)))) + (let ((f0-42 (/ (-> this down-force) (meters -200)))) (if (< 0.1 f0-42) (set! (-> this spawn-splash?) #t) ) ) ) (when (and (-> this on-water?) (>= (current-time) (-> this next-bob-cam-time))) - (let ((f0-44 (* -0.0000012207031 (-> this down-force)))) + (let ((f0-44 (/ (-> this down-force) (meters -200)))) (cond ((< 0.2 f0-44) (let ((f24-1 (fmax 0.0 (fmin 1.0 f0-44))) @@ -966,7 +966,7 @@ (vector-z-quaternion! s4-0 (the-as quaternion (-> this rbody rot))) (vector-float*! (-> this rbody lin-momentum) s4-0 (* (-> this speed) (-> this info info mass))) ) - (+! (-> this rbody lin-momentum y) (* 0.5 (-> this down-force) (-> this info info mass))) + (+! (-> this rbody lin-momentum y) (* (/ (-> this down-force) 2) (-> this info info mass))) (if (< (-> this rbody position y) -6144.0) (set! (-> this rbody lin-momentum y) (fmax 0.0 (-> this rbody lin-momentum y))) ) @@ -1770,16 +1770,16 @@ (seek! (-> this ground-vol-current) f30-0 (* 5.4 (seconds-per-frame))) ) ) - (let* ((f0-27 (* 0.00000012207032 (-> this rbody lin-momentum y))) + (let* ((f0-27 (/ (-> this rbody lin-momentum y) (meters 2000))) (f0-29 (fmax -1.0 (fmin 1.0 f0-27))) - (f0-30 (* 0.5 f0-29)) + (f0-30 (/ f0-29 2)) ) (if (< f0-30 (-> this pitch-current)) (seek! (-> this pitch-current) f0-30 (* 0.25 (seconds-per-frame))) (seek! (-> this pitch-current) f0-30 (* 4.0 (seconds-per-frame))) ) ) - (let* ((f1-25 (* 0.00000012207032 (-> this rbody lin-momentum y))) + (let* ((f1-25 (/ (-> this rbody lin-momentum y) (meters 2000))) (f30-2 (fmax 0.0 (fmin 1.0 f1-25))) ) (sound-play-by-name diff --git a/goal_src/jak3/levels/city/protect/assault-task.gc b/goal_src/jak3/levels/city/protect/assault-task.gc index aa89205bed5..02657784d66 100644 --- a/goal_src/jak3/levels/city/protect/assault-task.gc +++ b/goal_src/jak3/levels/city/protect/assault-task.gc @@ -172,7 +172,7 @@ (let* ((f30-0 (- 1.0 (* (- 1.0 f0-1) (- 1.0 f0-1)))) (f0-2 (sin (lerp -16384.0 16384.0 f0-1))) (f0-3 (+ 1.0 f0-2)) - (f0-4 (* 0.5 f0-3)) + (f0-4 (/ f0-3 2)) ) (set! (-> *display* force-sync) (the-as uint 2)) (when s5-0 @@ -283,7 +283,8 @@ ) ) :code (behavior () - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (send-event self 'ammo-special 15 29) (sleep-code) ) @@ -426,7 +427,8 @@ (set! (-> v1-4 notify-proc) (process->handle self)) (send-event (handle->process (-> self h-player-controller)) 'set-params v1-4) ) - (suspend-for (seconds 0.1)) + (suspend-for (seconds 0.1) + ) (if *target* (logclear! (-> *target* focus-status) (focus-status teleporting)) ) @@ -1368,7 +1370,8 @@ process (lambda :behavior process () - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (dotimes (gp-1 (-> *assault-squad* spawn-records 1 records length)) (send-event (handle->process (-> *assault-squad* spawn-records 1 records data gp-1 proc)) 'traffic-off-force) ) diff --git a/goal_src/jak3/levels/city/protect/flying-turret.gc b/goal_src/jak3/levels/city/protect/flying-turret.gc index 24336d4815c..622a71ee3e4 100644 --- a/goal_src/jak3/levels/city/protect/flying-turret.gc +++ b/goal_src/jak3/levels/city/protect/flying-turret.gc @@ -412,7 +412,7 @@ ) (vector+float*! (-> this root transv) (-> this root transv) s5-1 (* f28-0 (seconds-per-frame))) (let* ((f0-19 (fmax 61440.0 (* (vector-length s5-1) f28-0))) - (f28-1 (* 0.000008138021 f0-19)) + (f28-1 (/ f0-19 (meters 30))) (f26-0 0.8) (f24-0 0.40000004) (v1-53 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -426,7 +426,7 @@ ) (else (let* ((f0-30 (fmax 61440.0 (* 3.0 (vector-length (-> this root transv))))) - (f28-2 (* 0.000008138021 f0-30)) + (f28-2 (/ f0-30 (meters 30))) (f26-1 0.8) (f24-1 0.40000004) (v1-68 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -531,7 +531,7 @@ ) (let ((f0-8 (* (lerp 3072.0 8601.6 f0-6) (-> this thruster-intensity-scalar)))) (set! (-> *part-id-table* 4709 init-specs 4 initial-valuef) f0-8) - (set! (-> *part-id-table* 4709 init-specs 3 initial-valuef) (* 0.5 f0-8)) + (set! (-> *part-id-table* 4709 init-specs 3 initial-valuef) (/ f0-8 2)) ) ) (draw-beam (-> *part-id-table* 4709) gp-0 s5-0 #f) @@ -550,7 +550,7 @@ ) (flying-turret-method-227 this) (let* ((f0-0 (vector-length (-> this root transv))) - (f0-1 (* 0.000016276043 f0-0)) + (f0-1 (/ f0-0 (meters 15))) ) 0.0 0.0 diff --git a/goal_src/jak3/levels/city/protect/protect-gunship.gc b/goal_src/jak3/levels/city/protect/protect-gunship.gc index 76617f3da58..a84be36f9f1 100644 --- a/goal_src/jak3/levels/city/protect/protect-gunship.gc +++ b/goal_src/jak3/levels/city/protect/protect-gunship.gc @@ -1616,7 +1616,8 @@ (set! (-> gp-1 pickup-amount) 2.0) (drop-pickup gp-1 #t *entity-pool* gp-1 0 #t) ) - (suspend-for (seconds 5)) + (suspend-for (seconds 5) + ) ) ) @@ -1809,7 +1810,7 @@ (set-time! (-> self state-time)) (let ((gp-2 (vector-! (new 'stack-no-clear 'vector) (-> self dest-pos) (-> self root trans)))) 0.0 - (set! (-> self travel-speed) (/ (vector-normalize-ret-len! gp-2 1.0) (* 0.0033333334 (-> self attack-time)))) + (set! (-> self travel-speed) (/ (vector-normalize-ret-len! gp-2 1.0) (/ (-> self attack-time) 300))) (let ((a1-3 (matrix-f-compose (new 'stack-no-clear 'matrix) gp-2))) (matrix->quaternion (-> self root quat) a1-3) ) @@ -2175,9 +2176,9 @@ (let* ((v1-121 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-122 (the-as number (logior #x3f800000 v1-121))) (f0-35 (- (* (+ -1.0 (the-as float v1-122)) (-> this missile-info probe-angle-shift)))) - (f24-1 (* 0.25 f0-35)) + (f24-1 (/ f0-35 4)) (f0-38 (floor (the float (/ s5-5 3)))) - (f2-0 (* 0.000016276043 f30-3)) + (f2-0 (/ f30-3 (meters 15))) (f1-15 (fmax 0.0 (fmin 1.0 f2-0))) (f1-16 (* f1-15 f1-15)) (f0-39 (* f0-38 (- 1.0 f1-16))) @@ -2376,7 +2377,7 @@ (vector-float*! s5-0 s5-0 0.5) (set! (-> s5-0 y) 0.0) (let* ((f0-11 (vector-normalize-ret-len! s5-0 1.0)) - (f1-6 (* 0.000009765625 f0-11)) + (f1-6 (/ f0-11 (meters 25))) (f0-13 (fmax 0.0 (fmin 1.0 f1-6))) (f0-14 (* f0-13 f0-13)) ) @@ -2493,7 +2494,7 @@ (f0-51 (+ f28-1 (* f26-0 (+ -1.0 (the-as float v1-118))) f30-2)) ) (set! (-> *part-id-table* 4785 init-specs 4 initial-valuef) f0-51) - (set! (-> *part-id-table* 4785 init-specs 3 initial-valuef) (* 0.5 f0-51)) + (set! (-> *part-id-table* 4785 init-specs 3 initial-valuef) (/ f0-51 2)) ) (draw-beam (-> *part-id-table* 4785) @@ -2650,7 +2651,7 @@ (vector-float*! s5-1 s5-1 -1.0) (let ((f30-1 (- (vector-y-angle s4-1) (vector-y-angle s5-1)))) (format 0 "Doing inverse rotate~%") - (set! (-> this rotate-rate) (* 0.25 f30-1)) + (set! (-> this rotate-rate) (/ f30-1 4)) ) ) ) @@ -3395,7 +3396,7 @@ 0.0 0.0 (let* ((f0-6 (vector-length v1-8)) - (f0-7 (* 0.000009765625 f0-6)) + (f0-7 (/ f0-6 (meters 25))) (f1-3 (* f0-7 f0-7 (seconds-per-frame))) (f0-10 (fmax 0.0 (fmin 1.0 f1-3))) ) @@ -3421,7 +3422,7 @@ (set! (-> s5-3 y) 0.0) (let ((f1-6 (vector-normalize-ret-len! s5-3 1.0))) (when (< f1-6 122880.0) - (let* ((f0-21 (* 0.000008138021 f1-6)) + (let* ((f0-21 (/ f1-6 (meters 30))) (f0-22 (- 1.0 f0-21)) (f0-23 (* f0-22 f0-22)) ) diff --git a/goal_src/jak3/levels/city/protect/roboguard-city.gc b/goal_src/jak3/levels/city/protect/roboguard-city.gc index b4193867116..845cd4c319f 100644 --- a/goal_src/jak3/levels/city/protect/roboguard-city.gc +++ b/goal_src/jak3/levels/city/protect/roboguard-city.gc @@ -439,7 +439,8 @@ (defbehavior roboguard-city-turret-code roboguard-city () (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! roboguard-city-idle-shoot0-loop-ja :num! zero) - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (let ((gp-1 (lambda :behavior process ((arg0 roboguard-city) (arg1 symbol)) @@ -455,7 +456,8 @@ ) (until #f (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) ) @@ -476,7 +478,8 @@ ) ) (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) ) @@ -932,7 +935,7 @@ (-> self move-dest) self (-> self target-status handle) - (* 0.5 (-> self attack-distance)) + (/ (-> self attack-distance) 2) (-> self random-offset-search) ) (roboguard-city-method-239 self) @@ -1059,7 +1062,7 @@ (-> this move-dest) this (-> this target-status handle) - (* 0.5 (-> this attack-distance)) + (/ (-> this attack-distance) 2) (-> this random-offset-search) ) (roboguard-city-method-239 this) @@ -1079,7 +1082,7 @@ (-> this move-dest) this (-> this target-status handle) - (* 0.5 (-> this attack-distance)) + (/ (-> this attack-distance) 2) (-> this random-offset-search) ) (roboguard-city-method-235 this) @@ -1949,7 +1952,7 @@ (-> this move-dest) this (-> this target-status handle) - (* 0.5 (-> this attack-distance)) + (/ (-> this attack-distance) 2) (-> this random-offset-search) ) (roboguard-city-method-239 this) @@ -1966,7 +1969,7 @@ 0.0 (let* ((f0-8 (vector-dot s5-3 v1-35)) (f0-9 (+ 1.0 f0-8)) - (f0-10 (* 0.5 f0-9)) + (f0-10 (/ f0-9 2)) (f0-11 (lerp -0.2 0.0 f0-10)) ) (sound-play-by-name @@ -2104,7 +2107,7 @@ (f0-21 (+ -1.0 (the-as float v1-61))) ) (cond - ((< f0-21 (* 0.5 f30-1)) + ((< f0-21 (/ f30-1 2)) (set! s5-0 (logior s5-0 2)) ) ((< f0-21 f30-1) diff --git a/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc b/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc index 63841c06748..b0d7470a066 100644 --- a/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc +++ b/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc @@ -1180,7 +1180,7 @@ (launch-particles (-> *part-id-table* 4846) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f28-1 (* 0.000015258789 f30-0)) + (f28-1 (/ f30-0 (meters 16))) (f30-1 (-> *part-id-table* 4847 init-specs 3 initial-valuef)) ) (-> *part-id-table* 4847 init-specs 4 initial-valuef) @@ -2341,7 +2341,7 @@ ) (quaternion-copy! (-> self gun-shoulder-jmod rotation) (new 'static 'quaternion :x 0.5 :w 0.8660254)) (quaternion-copy! (-> self gun-elbow-jmod rotation) (new 'static 'quaternion :x -0.5 :w 0.8660254)) - (set! (-> self fov-mult) (lerp-clamp 1.3 0.45 (* 0.0000048828124 f30-0))) + (set! (-> self fov-mult) (lerp-clamp 1.3 0.45 (/ f30-0 (meters 50)))) (set-setting! 'fov 'rel (-> self fov-mult) 0) ) ) @@ -2627,7 +2627,8 @@ ) :code (behavior () (logior! (-> self flags) (cty-sniper-turret-flag cst3)) - (suspend-for (seconds 0.49)) + (suspend-for (seconds 0.49) + ) (let ((gp-1 (rand-vu-int-range 3 6))) (dotimes (s5-0 gp-1) (fire-shot self) @@ -2759,8 +2760,7 @@ (when (and (< f30-0 0.0) (not (-> *setting-control* user-current freeze-screen))) (set-setting! 'mode-name 'cam-no-trans 0.0 0) (suspend) - (suspend-for - (seconds 0.5) + (suspend-for (seconds 0.5) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 quad) (the-as uint128 0)) (cond @@ -2817,7 +2817,8 @@ #t ) (logior! (-> *target* focus-status) (focus-status ignore)) - (suspend-for (seconds 0.08)) + (suspend-for (seconds 0.08) + ) (send-event self 'pov-cam-on) (send-event (handle->process (-> self reticle)) 'on) (setup @@ -2830,7 +2831,8 @@ #x33001 #t ) - (suspend-for (seconds 0.08)) + (suspend-for (seconds 0.08) + ) (disable *screen-filter*) ) (else @@ -2871,12 +2873,13 @@ ) ) ) - (suspend-for (seconds 1.5) (when (focus-test? *target* grabbed) - (logclear! (-> self flags) (cty-sniper-turret-flag cst11)) - (send-event (handle->process (-> self reticle)) 'unlock) - (goto cfg-44) - ) - ) + (suspend-for (seconds 1.5) + (when (focus-test? *target* grabbed) + (logclear! (-> self flags) (cty-sniper-turret-flag cst11)) + (send-event (handle->process (-> self reticle)) 'unlock) + (goto cfg-44) + ) + ) (if (and (logtest? (-> self flags) (cty-sniper-turret-flag cst7)) (not (cty-sniper-turret-method-39 self))) (go-virtual locked-on) ) @@ -2929,7 +2932,8 @@ (suspend) (set-setting! 'interp-time 'abs 600.0 0) (remove-setting! 'mode-name) - (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25) + ) (send-event (handle->process (-> self reticle)) 'die) (let ((v1-71 (-> self root root-prim))) (set! (-> v1-71 prim-core collide-as) (collide-spec)) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen-norm.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen-norm.gc index 11942cdac4e..1be442fee37 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen-norm.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen-norm.gc @@ -647,7 +647,7 @@ (if (or (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) (= (-> this incoming knocked-type) (knocked-type dark-shot)) ) - (set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed))) + (set! (-> arg0 anim-speed) (/ (-> arg0 anim-speed) 2)) ) (let ((a0-47 (-> this skel root-channel 0))) (set! (-> a0-47 frame-group) (the-as art-joint-anim s4-0)) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen.gc index f1263e9eebc..ecf5ff7b9e9 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen.gc @@ -752,7 +752,7 @@ s5-1 s5-1 gp-0 - (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame)) ) ) 0 diff --git a/goal_src/jak3/levels/city/traffic/citizen/civilian.gc b/goal_src/jak3/levels/city/traffic/citizen/civilian.gc index 24b25a43300..bdb77060412 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/civilian.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/civilian.gc @@ -874,7 +874,7 @@ ) (if (and (-> self allow-dive) (< (vector-length v1-8) (* (-> self dive-reaction) (vector-length (-> self cp-vec)))) - (< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (* 0.5 (-> self cp-sphere r))) + (< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (/ (-> self cp-sphere r) 2)) ) (civilian-method-231 self) ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc b/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc index caf7d0abc9f..89805c625f2 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc @@ -337,10 +337,12 @@ ) ) ) - (suspend-for (seconds 0.6)) + (suspend-for (seconds 0.6) + ) (+! (-> self root trans y) -8192.0) (logior! (-> self draw status) (draw-control-status no-draw)) - (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) + ) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) ) @@ -480,7 +482,7 @@ (set-time! (-> this last-change-dir)) (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) + (f0-9 (* (/ f30-0 2) (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) (if (-> this heading) diff --git a/goal_src/jak3/levels/city/traffic/citizen/metalhead-predator.gc b/goal_src/jak3/levels/city/traffic/citizen/metalhead-predator.gc index fd4916bd9cf..9873e1fe2f9 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/metalhead-predator.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/metalhead-predator.gc @@ -712,7 +712,7 @@ (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-272 quad) vf6) (let* ((f0-5 (vector-length sv-272)) - (f0-6 (* 0.0000018780048 f0-5)) + (f0-6 (/ f0-5 (meters 130))) ) (set! sv-288 (new 'stack-no-clear 'vector)) (let ((s0-0 (new 'stack-no-clear 'vector)) diff --git a/goal_src/jak3/levels/city/traffic/traffic-engine.gc b/goal_src/jak3/levels/city/traffic/traffic-engine.gc index ae8a202efc9..48dc268f62f 100644 --- a/goal_src/jak3/levels/city/traffic/traffic-engine.gc +++ b/goal_src/jak3/levels/city/traffic/traffic-engine.gc @@ -329,7 +329,7 @@ ) ) (set! (-> s4-0 vec2 y) - (+ (* 0.5 (-> s4-0 vec2 x)) (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing))) + (+ (/ (-> s4-0 vec2 x) 2) (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing))) ) (vector-float*! (-> s4-0 params velocity) (-> s4-0 vec0) (-> s4-0 vec2 x)) (vector-float*! (-> s4-0 vec1) (-> s4-0 vec0) (-> s4-0 vec2 y)) @@ -975,7 +975,7 @@ (set! f3-0 1.5) ) ) - (set! (-> v1-1 0 decay-rate) (* 0.1 f3-0)) + (set! (-> v1-1 0 decay-rate) (/ f3-0 10)) (when (< (-> v1-1 0 danger-level) f2-0) (set! (-> v1-1 0 danger-level) f2-0) (set! (-> v1-1 0 sphere r) f1-0) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/bike.gc b/goal_src/jak3/levels/city/traffic/vehicle/bike.gc index 193cd282ed7..48653e45b8b 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/bike.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/bike.gc @@ -1618,10 +1618,10 @@ (f26-0 (* -13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f28-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f28-0) (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (* -0.2 f28-0) f30-0)) - (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (* 0.2 f28-0) f30-0)) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f28-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f28-0) (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (/ f28-0 -5) f30-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (/ f28-0 5) f30-0)) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 f26-0) (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f26-0) @@ -1720,8 +1720,8 @@ (f28-0 (* 13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this rudder-f rotation) s5-0 (- f30-0)) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) @@ -1831,8 +1831,8 @@ (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f26-0) (quaternion-vector-angle! (-> this fin2-fl rotation) s5-0 (- f26-0)) (quaternion-vector-angle! (-> this fin2-fr rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/car.gc b/goal_src/jak3/levels/city/traffic/vehicle/car.gc index b2068b7eddc..af486e2b896 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/car.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/car.gc @@ -1945,10 +1945,10 @@ (quaternion-vector-angle! (-> this steering-wheel rotation) s5-0 f0-3) (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f28-0)) (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (* 0.2 f28-0) (* -0.8 f30-0))) - (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (* -0.2 f28-0) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (/ f30-0 -5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (/ f30-0 -5))) + (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (/ f28-0 5) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (/ f28-0 -5) (* -0.8 f30-0))) ) 0 (none) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-effects.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-effects.gc index ece2e662435..08bdcb938ba 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-effects.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-effects.gc @@ -37,7 +37,7 @@ ;; WARN: Return type mismatch object vs none. (defun calc-fade-vals ((arg0 float)) - (let* ((f1-1 (* 0.00024414062 arg0)) + (let* ((f1-1 (/ arg0 METER_LENGTH)) (f0-3 (- f1-1 (the float (the int f1-1)))) (f1-3 (* 4096.0 (- f1-1 f0-3))) (f1-5 (/ -1.0 (* (- 1.0 f0-3) f1-3))) @@ -228,7 +228,7 @@ (set! (-> *part-id-table* 923 init-specs 9 random-rangef) (* 48.0 f0-40)) ) (set! (-> s5-0 float0) - (* 0.2 (-> this info handling max-engine-thrust) (+ 0.5 (-> this engine-power-factor))) + (* (/ (-> this info handling max-engine-thrust) 5) (+ 0.5 (-> this engine-power-factor))) ) (let ((s4-2 (-> *part-id-table* 923))) (dotimes (s3-0 2) @@ -354,12 +354,12 @@ (set! (-> s5-0 vec4 quad) (-> s5-0 vec0 quad)) (let ((f0-0 (rand-vu-float-range 1.0 1.33))) (set! (-> s5-0 float0) (* f0-0 (-> arg1 length) (-> arg1 thrust))) - (set! (-> s5-0 float1) (fmin (* (-> arg1 width) f0-0) (* 0.5 (-> s5-0 float0)))) + (set! (-> s5-0 float1) (fmin (* (-> arg1 width) f0-0) (/ (-> s5-0 float0) 2))) ) (let ((a1-5 (-> s5-0 vec3))) (let ((v1-4 (-> arg1 trans))) (let ((a0-9 (-> s5-0 vec4))) - (let ((a2-2 (* 0.25 (-> s5-0 float0)))) + (let ((a2-2 (/ (-> s5-0 float0) 4))) (.mov vf7 a2-2) ) (.lvf vf5 (&-> a0-9 quad)) @@ -385,13 +385,13 @@ (let ((f0-13 (* 4.0 (-> s5-0 float1)))) (set! (-> s5-0 glow position w) f0-13) (set! (-> s5-0 glow size-y) f0-13) - (set! (-> s5-0 glow size-probe) (* 0.025 f0-13)) + (set! (-> s5-0 glow size-probe) (/ f0-13 40)) ) (add! *simple-sprite-system* (-> s5-0 glow)) (let ((v1-15 (-> s5-0 vec3))) (let ((a0-14 (-> arg1 trans))) (let ((a1-11 (-> s5-0 vec4))) - (let ((a2-5 (* 0.5 (-> s5-0 float0)))) + (let ((a2-5 (/ (-> s5-0 float0) 2))) (.mov vf7 a2-5) ) (.lvf vf5 (&-> a1-11 quad)) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-physics.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-physics.gc index 36b456d781d..230a81dddf6 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-physics.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-physics.gc @@ -17,7 +17,7 @@ ) 0.0 (let* ((f2-4 (fmax -1.0 (fmin 1.0 (/ (- (-> this water-height) (-> arg0 y)) (-> arg0 w))))) - (f30-0 (+ 0.5 (* -0.25 f2-4 f2-4 f2-4) (* 0.75 f2-4))) + (f30-0 (+ 0.5 (* (/ f2-4 -4) f2-4 f2-4) (* 0.75 f2-4))) ) (set! (-> s5-0 rvec y) (* 0.5 (+ f0-1 f1-3))) (rigid-body-control-method-23 (-> this rbody) (-> s5-0 rvec) (-> s5-0 fvec)) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc index 9ecd83f3bb5..753788bd02a 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc @@ -572,7 +572,7 @@ (set! arg0 0.0) ) (if (logtest? (game-secrets vehicle-hit-points) (-> *game-info* secrets)) - (set! arg0 (* 0.5 arg0)) + (set! arg0 (/ arg0 2)) ) ) (set! (-> this hit-points) (- (-> this hit-points) (* arg0 (-> this damage-factor)))) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc index 54327da2161..989224f3e03 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc @@ -294,7 +294,7 @@ (set! f1-6 (* f0-23 f0-23)) ) (if (not (logtest? (-> this v-flags) (vehicle-flag riding))) - (set! f1-6 (* 0.5 f1-6)) + (set! f1-6 (/ f1-6 2)) ) ) (+! (-> this power-level) @@ -1105,7 +1105,7 @@ (and (logtest? (penetrate dark-skin) arg3) (logtest? arg3 (penetrate punch spin))) ) (set! f30-0 (* 204800.0 (-> this info info mass))) - (* 0.2 (-> this info damage hit-points)) + (/ (-> this info damage hit-points) 5) ) ((logtest? (penetrate jak-red-shockwave) arg3) (case (-> arg1 mode) diff --git a/goal_src/jak3/levels/city/vinroom/ljkdxvin-texture.gc b/goal_src/jak3/levels/city/vinroom/ljkdxvin-texture.gc index c5de882cf12..8e58ac5960d 100644 --- a/goal_src/jak3/levels/city/vinroom/ljkdxvin-texture.gc +++ b/goal_src/jak3/levels/city/vinroom/ljkdxvin-texture.gc @@ -163,8 +163,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) diff --git a/goal_src/jak3/levels/comb/comb-field.gc b/goal_src/jak3/levels/comb/comb-field.gc index 88613fcb669..5b1c3d64d59 100644 --- a/goal_src/jak3/levels/comb/comb-field.gc +++ b/goal_src/jak3/levels/comb/comb-field.gc @@ -296,8 +296,8 @@ (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) (vector-! (-> s2-2 rvec) s4-0 s3-0) (let ((f30-1 (vector-normalize-ret-len! (-> s2-2 rvec) 1.0))) - (set! (-> s1-0 scale x) (* 0.00024414062 f30-1)) - (set! (-> s1-0 scale y) (* 0.00024414062 arg1)) + (set! (-> s1-0 scale x) (/ f30-1 METER_LENGTH)) + (set! (-> s1-0 scale y) (/ arg1 METER_LENGTH)) (set! (-> s1-0 scale z) 1.0) (set! (-> s2-2 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) (vector-cross! (-> s2-2 fvec) (-> s2-2 rvec) (-> s2-2 uvec)) @@ -307,7 +307,7 @@ (set! (-> this plane w) (- (vector-dot (-> s2-2 fvec) (-> this root trans)))) (let ((v0-8 (-> this root root-prim local-sphere))) (set! (-> v0-8 x) 0.0) - (set! (-> v0-8 y) (* 0.00024414062 (* 0.5 arg1))) + (set! (-> v0-8 y) (* 0.00024414062 (/ arg1 2))) (set! (-> v0-8 z) 0.0) (let ((f0-18 0.5) (f1-5 (* f30-1 f30-1)) diff --git a/goal_src/jak3/levels/comb/comb-sentry.gc b/goal_src/jak3/levels/comb/comb-sentry.gc index c98ea8d07d1..6ab4ef219f3 100644 --- a/goal_src/jak3/levels/comb/comb-sentry.gc +++ b/goal_src/jak3/levels/comb/comb-sentry.gc @@ -83,7 +83,7 @@ (launch-particles (-> *part-id-table* 4238) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 4239 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 4239 init-specs 4 initial-valuef)) ) @@ -727,7 +727,8 @@ :unk 0 ) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (cleanup-for-death self) ) :post #f diff --git a/goal_src/jak3/levels/comb/h-sled.gc b/goal_src/jak3/levels/comb/h-sled.gc index 9896d10477c..6801933cc42 100644 --- a/goal_src/jak3/levels/comb/h-sled.gc +++ b/goal_src/jak3/levels/comb/h-sled.gc @@ -229,7 +229,7 @@ (launch-particles (-> *part-id-table* 4232) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix))) - (* 0.000027126736 f30-0) + (/ f30-0 (meters 9)) (-> *part-id-table* 4233 init-specs 3 initial-valuef) (-> *part-id-table* 4233 init-specs 4 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) @@ -1138,19 +1138,20 @@ (set! (-> gp-0 tmp z) (-> this ai-target-speed)) (set! (-> gp-0 world-pos quad) (-> this ai-target-pos quad)) (vector-! (-> gp-0 lift-dir) (-> gp-0 world-pos) (-> gp-0 mat fvec)) - (set! (-> gp-0 tmp w) (* 0.00036621094 - (- (-> gp-0 tmp z) (-> gp-0 p-body x)) - (-> this info handling ai-throttle-factor) - (-> gp-0 p-body y) - ) + (set! (-> gp-0 tmp w) + (* 0.00036621094 + (- (-> gp-0 tmp z) (-> gp-0 p-body x)) + (-> this info handling ai-throttle-factor) + (-> gp-0 p-body y) + ) ) (set! (-> gp-0 mat rvec y) (fmax 0.0 (fmin 1.0 (+ (-> this controls throttle) (-> gp-0 tmp w))))) - (set! (-> gp-0 mat rvec x) (fmax -1.0 (fmin 1.0 (* 0.000012207031 - (-> this info handling ai-steering-factor) - (vector-dot (-> gp-0 local-pos) (-> gp-0 lift-dir)) - ) - ) - ) + (set! (-> gp-0 mat rvec x) + (fmax -1.0 (fmin 1.0 (* (/ (-> this info handling ai-steering-factor) (meters 20)) + (vector-dot (-> gp-0 local-pos) (-> gp-0 lift-dir)) + ) + ) + ) ) (vehicle-method-92 this (the-as vehicle-controls (-> gp-0 mat))) ) @@ -1261,7 +1262,7 @@ ) (cond ((logtest? (vehicle-flag ignition) (-> this v-flags)) - (let ((f1-4 (+ 0.75 (* 0.25 (-> this controls throttle))))) + (let ((f1-4 (+ 0.75 (/ (-> this controls throttle) 4)))) (if (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) (set! f1-4 (+ 1.0 (* (-> this turbo-boost-factor) (-> this info handling turbo-boost-factor)))) ) @@ -1400,7 +1401,7 @@ (set! (-> s5-1 1 x) (fmax 0.0 (fmin 1.0 (+ -1.0 (-> s5-1 0 x))))) (set! (-> s5-1 1 y) (* 0.0 (-> s5-1 1 x))) (set! (-> s5-1 1 z) (-> s5-1 0 y)) - (set! (-> s5-1 1 w) (* 0.5 (-> s5-1 0 y))) + (set! (-> s5-1 1 w) (/ (-> s5-1 0 y) 2)) (set! (-> s5-1 0 z) (cube-root (-> s5-1 0 z))) (set! (-> s5-1 1 x) (cube-root (-> s5-1 1 x))) (set! (-> s5-1 1 z) (cube-root (-> s5-1 1 z))) @@ -1709,7 +1710,11 @@ ) ) (vector-matrix*! (-> s4-0 world-pos) (-> s4-0 local-pos) (-> s4-0 mat)) - (vector-float*! (-> s4-0 force) (-> this impact-normal) (* -0.5 (-> s2-0 extra gravity) (-> s2-0 info mass))) + (vector-float*! + (-> s4-0 force) + (-> this impact-normal) + (* (/ (-> s2-0 extra gravity) -2) (-> s2-0 info mass)) + ) (rigid-body-control-method-22 s3-0 (-> s4-0 world-pos) (-> s4-0 force)) ) (when (logtest? (-> this v-flags) (vehicle-flag on-ground)) @@ -1796,7 +1801,7 @@ (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) - (set! (-> gp-2 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-2 scale) (/ (-> self draw bounds w) 11264)) (set! (-> gp-2 group) (-> *part-group-id-table* (-> self info explosion-part))) (set! (-> gp-2 collide-with) (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) diff --git a/goal_src/jak3/levels/comb/railx-mood.gc b/goal_src/jak3/levels/comb/railx-mood.gc index baea16b4063..0f2b1efc41a 100644 --- a/goal_src/jak3/levels/comb/railx-mood.gc +++ b/goal_src/jak3/levels/comb/railx-mood.gc @@ -81,7 +81,7 @@ (the-as vector (-> gp-0 ambi color)) (the-as vector (-> gp-0 ambi color)) s2-0 - (* 0.5 (-> (the-as railx-states s3-0) yellow brightness)) + (/ (-> (the-as railx-states s3-0) yellow brightness) 2) ) (vector-float*! (the-as vector (-> gp-0 dir0 color)) s4-0 (-> (the-as railx-states s3-0) blue brightness)) (set! (-> gp-0 dir1 color quad) (-> gp-0 ambi color quad)) diff --git a/goal_src/jak3/levels/common-obs/ladder.gc b/goal_src/jak3/levels/common-obs/ladder.gc index 174f0cf6506..00b1b8975eb 100644 --- a/goal_src/jak3/levels/common-obs/ladder.gc +++ b/goal_src/jak3/levels/common-obs/ladder.gc @@ -109,8 +109,8 @@ (-> self rider-unit) ) (('stance) - (let* ((f0-8 (/ (* 0.5 (-> self meters-per-rung)) (-> self meters-per-unit))) - (f1-12 (* (the float (the int (/ (+ (-> self rider-unit) (* 0.5 f0-8)) f0-8))) f0-8)) + (let* ((f0-8 (/ (/ (-> self meters-per-rung) 2) (-> self meters-per-unit))) + (f1-12 (* (the float (the int (/ (+ (-> self rider-unit) (/ f0-8 2)) f0-8))) f0-8)) ) (+! (-> self rider-unit) (* 0.1 (- f1-12 (-> self rider-unit)))) (set! (-> self rider-unit) (seek (-> self rider-unit) f1-12 (* 2.0 (seconds-per-frame) f0-8))) @@ -217,9 +217,9 @@ (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) (set! (-> this root scale y) (/ (-> this set-height) (-> this art-height))) - (set! (-> this draw bounds y) (/ (* 0.5 (-> this set-height)) (-> this root scale y))) - (set! (-> this draw bounds w) (+ 2048.0 (* 0.5 (-> this set-height)))) - (set! (-> this root root-prim local-sphere y) (/ (* 0.5 (-> this set-height)) (-> this root scale y))) - (set! (-> this root root-prim local-sphere w) (+ 2048.0 (* 0.5 (-> this set-height)))) + (set! (-> this draw bounds y) (/ (/ (-> this set-height) 2) (-> this root scale y))) + (set! (-> this draw bounds w) (+ 2048.0 (/ (-> this set-height) 2))) + (set! (-> this root root-prim local-sphere y) (/ (/ (-> this set-height) 2) (-> this root scale y))) + (set! (-> this root root-prim local-sphere w) (+ 2048.0 (/ (-> this set-height) 2))) (go (method-of-object this idle)) ) diff --git a/goal_src/jak3/levels/common/elec-gate.gc b/goal_src/jak3/levels/common/elec-gate.gc index 89fab2c02cb..94b7871b55a 100644 --- a/goal_src/jak3/levels/common/elec-gate.gc +++ b/goal_src/jak3/levels/common/elec-gate.gc @@ -643,7 +643,8 @@ (defstate shutdown-camera (elec-gate) :virtual #t :code (behavior () - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (format 0 "~s~%" (-> self name)) (if (res-lump-struct (-> self entity) 'camera-name structure) (process-spawn @@ -655,7 +656,8 @@ :to *entity-pool* ) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (go-virtual shutdown) ) :post (behavior () @@ -904,7 +906,7 @@ (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp) ) ) - (set! (-> this wall-xz) (* 0.5 (-> this wall-xz))) + (set! (-> this wall-xz) (/ (-> this wall-xz) 2)) (+! (-> this wall-xz) 4096.0) (set! (-> this wall-y) (fabs diff --git a/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal.gc b/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal.gc index 502fe7a2a07..90b396cd13e 100644 --- a/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal.gc +++ b/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal.gc @@ -2554,7 +2554,7 @@ (set! (-> s2-0 4 x) (/ (-> s2-0 3 w) (+ (fmax 0.0 (vector-dot arg2 (-> s2-0 5))) arg5))) (vector+float*! arg0 (-> s2-0 0) (-> s2-0 1) (-> s2-0 4 x)) (let ((f1-19 (/ (-> s2-0 2 x) arg5))) - (set! (-> arg0 y) (+ 10240.0 (* 0.25 arg6 (* f1-19 f1-19)) (-> arg3 y))) + (set! (-> arg0 y) (+ 10240.0 (* (/ arg6 4) (* f1-19 f1-19)) (-> arg3 y))) ) #t ) diff --git a/goal_src/jak3/levels/common/enemy/darkprec/neo-wasp.gc b/goal_src/jak3/levels/common/enemy/darkprec/neo-wasp.gc index 2a943e80ce5..e0d64babc78 100644 --- a/goal_src/jak3/levels/common/enemy/darkprec/neo-wasp.gc +++ b/goal_src/jak3/levels/common/enemy/darkprec/neo-wasp.gc @@ -657,7 +657,8 @@ 0 (set! (-> self hit-points) 0.0) (do-effect (-> self skel effect) "death-default" 0.0 -1) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (send-event self 'death-end) (cleanup-for-death self) ) @@ -809,10 +810,10 @@ (-> this thrust 0) (+ (* 0.4 (fmax 0.0 (* (-> v1-2 x) f0-0))) (fmax 0.0 (-> v1-2 y)) - (fabs (* 0.2 (-> v1-2 z))) + (fabs (/ (-> v1-2 z) 5)) (fmax 0.0 (-> s5-0 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) diff --git a/goal_src/jak3/levels/common/enemy/flitter.gc b/goal_src/jak3/levels/common/enemy/flitter.gc index 414c5cf6c67..d364c3d3194 100644 --- a/goal_src/jak3/levels/common/enemy/flitter.gc +++ b/goal_src/jak3/levels/common/enemy/flitter.gc @@ -699,7 +699,8 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1412)) ) ) - (suspend-for (seconds 0.6)) + (suspend-for (seconds 0.6) + ) (+! (-> self root trans y) -8192.0) (update-focus self) (let ((a0-14 (handle->process (-> self focus handle)))) @@ -717,7 +718,8 @@ ) ) ) - (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) + ) (logclear! (-> self draw status) (draw-control-status no-draw)) (go-virtual ambush-jumping) ) @@ -857,7 +859,7 @@ (set-time! (-> this last-change-dir)) (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) + (f0-9 (* (/ f30-0 2) (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) (if (-> this heading) diff --git a/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc b/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc index fc1369c57d0..052a8a4c840 100644 --- a/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc +++ b/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc @@ -1289,10 +1289,10 @@ (-> arg0 thrust s3-0) (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) (fmax 0.0 (-> v0-6 y)) - (fabs (* 0.2 (-> v0-6 z))) + (fabs (/ (-> v0-6 z) 5)) (fmax 0.0 (-> s1-1 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) @@ -1314,7 +1314,7 @@ (set! (-> *part-id-table* 2213 init-specs 0 initial-valuef) (* f24-0 f0-14)) (set! (-> arg0 thrust s3-0) f28-0) (let ((f0-15 (* f26-0 f0-14))) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (* -0.5 f0-15)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (/ f0-15 -2)) ) ) ) @@ -1389,7 +1389,7 @@ ) (set! (-> *part-id-table* 2213 init-specs 0 initial-valuef) f1-0) ) - (let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (* -0.5 f0-0)))) + (let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (/ f0-0 -2)))) (vector+! (-> s5-0 trans) s4-0 v1-29) ) ) diff --git a/goal_src/jak3/levels/common/enemy/mantis.gc b/goal_src/jak3/levels/common/enemy/mantis.gc index d56fb3add5d..b4f9cb9c767 100644 --- a/goal_src/jak3/levels/common/enemy/mantis.gc +++ b/goal_src/jak3/levels/common/enemy/mantis.gc @@ -758,9 +758,11 @@ ) ) ) - (suspend-for (seconds 0.3)) + (suspend-for (seconds 0.3) + ) (logior! (-> self draw status) (draw-control-status no-draw)) - (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) + ) (logclear! (-> self draw status) (draw-control-status no-draw)) (let* ((v1-45 (-> self nav)) (a1-7 (-> self root trans)) @@ -892,10 +894,11 @@ (suspend) (ja :num! (seek! max 1.2)) ) - (suspend-for (seconds 1) (if (logtest? (-> self root status) (collide-status on-ground)) - (goto cfg-35) - ) - ) + (suspend-for (seconds 1) + (if (logtest? (-> self root status) (collide-status on-ground)) + (goto cfg-35) + ) + ) (label cfg-35) (go-virtual hostile) ) @@ -1423,7 +1426,7 @@ ((method-of-type sphere new) (the-as symbol (-> s4-0 s3-0)) sphere) ) (set! (-> s4-0 0 quad) (-> this root trans quad)) - (set! (-> s4-0 0 y) (+ (-> this base-height) (* 0.5 (-> this root root-prim prim-core world-sphere w)))) + (set! (-> s4-0 0 y) (+ (-> this base-height) (/ (-> this root root-prim prim-core world-sphere w) 2))) (set! (-> s4-0 0 r) (-> this root root-prim prim-core world-sphere w)) (let ((v1-16 s5-1)) (set! (-> v1-16 best-dist) (the-as float s4-0)) diff --git a/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc b/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc index df7ec2c630a..a0782167177 100644 --- a/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc +++ b/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc @@ -799,7 +799,7 @@ ) (set! (-> this old-y-deg) f0-0) ) - (if (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) + (if (< (+ 0.5 (/ (-> this nav state speed) METER_LENGTH)) (* 0.005493164 (fabs (-> this diff-angle)))) (logior! (-> this flags) (eco-creature-flag ecf0)) (logclear! (-> this flags) (eco-creature-flag ecf0)) ) @@ -1060,7 +1060,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) (else (prebot-large-eco-creature-method-194 self) @@ -1092,7 +1092,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) (else (prebot-large-eco-creature-method-194 self) @@ -1125,7 +1125,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) (else (prebot-large-eco-creature-method-194 self) @@ -1289,7 +1289,7 @@ (vector-! v1-27 (the-as vector gp-0) (the-as vector s5-0)) (set! (-> v1-27 y) 0.0) (let ((f30-1 (atan (-> v1-27 x) (-> v1-27 z)))) - (quaternion-set! (-> self root quat) 0.0 (sin (* 0.5 f30-1)) 0.0 (cos (* 0.5 f30-1))) + (quaternion-set! (-> self root quat) 0.0 (sin (/ f30-1 2)) 0.0 (cos (/ f30-1 2))) ) ) (set! (-> self which-trajectory) 0) @@ -1367,8 +1367,8 @@ (let ((s5-0 (new 'stack-no-clear 'quaternion)) (gp-0 (new 'stack-no-clear 'quaternion)) ) - (quaternion-set! s5-0 (sin (* 0.5 (-> self x-rotate))) 0.0 0.0 (cos (* 0.5 (-> self x-rotate)))) - (quaternion-set! gp-0 0.0 (sin (* 0.5 (-> self y-rotate))) 0.0 (cos (* 0.5 (-> self y-rotate)))) + (quaternion-set! s5-0 (sin (/ (-> self x-rotate) 2)) 0.0 0.0 (cos (/ (-> self x-rotate) 2))) + (quaternion-set! gp-0 0.0 (sin (/ (-> self y-rotate) 2)) 0.0 (cos (/ (-> self y-rotate) 2))) (quaternion-normalize! (quaternion*! (-> self spin-jm quat) gp-0 s5-0)) ) (cond diff --git a/goal_src/jak3/levels/common/enemy/spyder.gc b/goal_src/jak3/levels/common/enemy/spyder.gc index c7efca2945c..1e8561e0427 100644 --- a/goal_src/jak3/levels/common/enemy/spyder.gc +++ b/goal_src/jak3/levels/common/enemy/spyder.gc @@ -1036,7 +1036,7 @@ ) ) (let ((v1-17 (-> self nav))) - (set! (-> v1-17 max-rotation-rate) (* 0.05 (-> *spyder-nav-enemy-info* maximum-rotation-rate))) + (set! (-> v1-17 max-rotation-rate) (/ (-> *spyder-nav-enemy-info* maximum-rotation-rate) 20)) ) 0 (ja-channel-push! 2 (seconds 0.2)) @@ -1068,8 +1068,7 @@ (set! (-> self fire-info 0 quad) (-> s3-0 quad)) (set! (-> self fire-info 1 quad) (-> s2-1 quad)) ) - (suspend-for - (seconds 0.2) + (suspend-for (seconds 0.2) (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) (ja :num! (loop!)) (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) diff --git a/goal_src/jak3/levels/common/enemy/spydroid-orig.gc b/goal_src/jak3/levels/common/enemy/spydroid-orig.gc index d353525ca9b..61705505b8a 100644 --- a/goal_src/jak3/levels/common/enemy/spydroid-orig.gc +++ b/goal_src/jak3/levels/common/enemy/spydroid-orig.gc @@ -794,7 +794,7 @@ ) (set! (-> this old-y-deg) f0-5) ) - (if (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) + (if (< (+ 0.5 (/ (-> this nav state speed) METER_LENGTH)) (* 0.005493164 (fabs (-> this diff-angle)))) (logior! (-> this flags) (spydroid-orig-flag sof1)) (logclear! (-> this flags) (spydroid-orig-flag sof1)) ) @@ -1123,7 +1123,8 @@ ) (suspend) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (send-event self 'death-end) (let ((gp-1 (-> self child))) (while gp-1 @@ -1304,7 +1305,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-44 (ja-group))) @@ -1359,7 +1360,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-28 (ja-group))) @@ -1415,7 +1416,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-28 (ja-group))) diff --git a/goal_src/jak3/levels/common/enemy/spydroid.gc b/goal_src/jak3/levels/common/enemy/spydroid.gc index 3cb59b5d700..9f2f66ae212 100644 --- a/goal_src/jak3/levels/common/enemy/spydroid.gc +++ b/goal_src/jak3/levels/common/enemy/spydroid.gc @@ -680,7 +680,7 @@ (set! (-> gp-0 quad) (-> (get-trans a0-2 3) quad)) (set! f0-0 (spydroid-method-234 self gp-0)) ) - (set! f28-0 (* 0.00024414062 f0-0)) + (set! f28-0 (/ f0-0 METER_LENGTH)) ) ) (if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) @@ -888,7 +888,7 @@ (f0-2 (-> s4-1 y)) ) (if (not (logtest? (-> this draw status) (draw-control-status on-screen))) - (set! f30-0 (* 0.1 f30-0)) + (set! f30-0 (/ f30-0 10)) ) (when (< f0-2 40960.0) (set! (-> s4-1 y) 0.0) diff --git a/goal_src/jak3/levels/common/external-player-control.gc b/goal_src/jak3/levels/common/external-player-control.gc index d4ec86c2904..2a67108fcb7 100644 --- a/goal_src/jak3/levels/common/external-player-control.gc +++ b/goal_src/jak3/levels/common/external-player-control.gc @@ -53,8 +53,8 @@ (set! (-> arg0 stick0-speed) arg2) (+! (-> s5-0 x) 1.0) (+! (-> s5-0 z) 1.0) - (set! (-> s5-0 x) (* 0.5 (-> s5-0 x))) - (set! (-> s5-0 z) (* 0.5 (-> s5-0 z))) + (set! (-> s5-0 x) (/ (-> s5-0 x) 2)) + (set! (-> s5-0 z) (/ (-> s5-0 z) 2)) (set! (-> arg0 leftx) (the-as uint (the int (* 255.0 (-> s5-0 x))))) (if (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) (set! (-> arg0 leftx) (the-as uint (* (the-as uint -1) (-> arg0 leftx)))) diff --git a/goal_src/jak3/levels/common/hvehicle/squad-control.gc b/goal_src/jak3/levels/common/hvehicle/squad-control.gc index 971eb5d468a..6106c3eff45 100644 --- a/goal_src/jak3/levels/common/hvehicle/squad-control.gc +++ b/goal_src/jak3/levels/common/hvehicle/squad-control.gc @@ -485,7 +485,7 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-40 vf1) (let ((f0-17 v1-40) - (f1-4 (* 0.5 arg3)) + (f1-4 (/ arg3 2)) ) (when (< (* f1-4 f1-4) f0-17) (vector+! s5-0 s5-0 (-> s2-0 vec0)) diff --git a/goal_src/jak3/levels/common/hvehicle/turret-control.gc b/goal_src/jak3/levels/common/hvehicle/turret-control.gc index ec35aa78dd6..76ffe931601 100644 --- a/goal_src/jak3/levels/common/hvehicle/turret-control.gc +++ b/goal_src/jak3/levels/common/hvehicle/turret-control.gc @@ -335,7 +335,7 @@ (-> gp-0 vec-12 x) ) ) - (set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (* 0.1 (-> gp-0 vec-12 x)))))) + (set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (/ (-> gp-0 vec-12 x) 10))))) (+! (-> this aim-rot s3-1) (* (-> this aim-rot-vel s3-1) (-> gp-0 vec-12 x))) (when (or (zero? s3-1) (not (logtest? (-> this flags) (turret-flag no-rot-y-clamp)))) (let ((f0-31 (-> this info rot-min s3-1))) diff --git a/goal_src/jak3/levels/common/race/race-manager.gc b/goal_src/jak3/levels/common/race/race-manager.gc index c952868fb69..ecaebd7ac01 100644 --- a/goal_src/jak3/levels/common/race/race-manager.gc +++ b/goal_src/jak3/levels/common/race/race-manager.gc @@ -865,7 +865,7 @@ (let ((v1-8 (new 'stack-no-clear 'race-manager-stack-var0))) (set! (-> v1-8 vec1 z) 61440.0) (set! (-> v1-8 word) 1) - (set! (-> v1-8 vec0 z) (* -0.5 (-> v1-8 vec1 z))) + (set! (-> v1-8 vec0 z) (/ (-> v1-8 vec1 z) -2)) (set! (-> v1-8 vec0 w) -20480.0) (set! (-> v1-8 vec1 x) (/ (-> v1-8 vec1 z) (the float (max 1 (+ (-> v1-8 word) -1))))) (set! (-> v1-8 vec1 y) -40960.0) @@ -1212,7 +1212,7 @@ (let ((v1-12 gp-1)) (set! (-> v1-12 height) (the float 70)) ) - (set! (-> gp-1 origin x) (the float (- 256 (the int (* 0.5 (-> gp-1 width)))))) + (set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2))))) (set! (-> gp-1 origin y) 320.0) (set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s5-1 print-game-text)) @@ -1268,7 +1268,7 @@ (let ((v1-12 gp-1)) (set! (-> v1-12 height) (the float 35)) ) - (set! (-> gp-1 origin x) (the float (- 256 (the int (* 0.5 (-> gp-1 width)))))) + (set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2))))) (set! (-> gp-1 origin y) 320.0) (set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s5-1 print-game-text)) diff --git a/goal_src/jak3/levels/common/race/race-mesh.gc b/goal_src/jak3/levels/common/race/race-mesh.gc index 637c2947236..77d5b3e4a84 100644 --- a/goal_src/jak3/levels/common/race/race-mesh.gc +++ b/goal_src/jak3/levels/common/race/race-mesh.gc @@ -687,7 +687,7 @@ (set! (-> s3-0 cell-bits 0 quad) (the-as uint128 0)) (set! (-> s3-0 cell-bits 1 quad) (the-as uint128 0)) (let ((f0-1 (/ 1.0 (-> s4-0 cell-length))) - (f1-2 (fmin (-> arg0 search-sphere r) (* 0.5 (-> s4-0 cell-length)))) + (f1-2 (fmin (-> arg0 search-sphere r) (/ (-> s4-0 cell-length) 2))) ) (let ((f3-1 (- (-> arg0 search-sphere x) f1-2)) (f2-4 (- (-> arg0 search-sphere z) f1-2)) @@ -721,7 +721,7 @@ (+! s2-0 1) ) ) - (when (and (= (-> arg0 slice-id) -1) (< (* 0.5 (-> s4-0 cell-length)) (-> arg0 search-sphere r))) + (when (and (= (-> arg0 slice-id) -1) (< (/ (-> s4-0 cell-length) 2) (-> arg0 search-sphere r))) (while (= (-> arg0 slice-id) -1) (set! (-> s3-0 bounds min x) (max 0 (+ (-> s3-0 bounds min x) -1))) (set! (-> s3-0 bounds min z) (max 0 (+ (-> s3-0 bounds min z) -1))) diff --git a/goal_src/jak3/levels/desert/boss/terraformer-setup.gc b/goal_src/jak3/levels/desert/boss/terraformer-setup.gc index 565d0493249..54b0b4fc673 100644 --- a/goal_src/jak3/levels/desert/boss/terraformer-setup.gc +++ b/goal_src/jak3/levels/desert/boss/terraformer-setup.gc @@ -758,8 +758,8 @@ (let ((s5-0 (new 'stack-no-clear 'quaternion)) (gp-0 (new 'stack-no-clear 'quaternion)) ) - (quaternion-set! s5-0 (sin (* 0.5 (-> self x-rotate))) 0.0 0.0 (cos (* 0.5 (-> self x-rotate)))) - (quaternion-set! gp-0 0.0 (sin (* 0.5 (-> self y-rotate))) 0.0 (cos (* 0.5 (-> self y-rotate)))) + (quaternion-set! s5-0 (sin (/ (-> self x-rotate) 2)) 0.0 0.0 (cos (/ (-> self x-rotate) 2))) + (quaternion-set! gp-0 0.0 (sin (/ (-> self y-rotate) 2)) 0.0 (cos (/ (-> self y-rotate) 2))) (quaternion-normalize! (quaternion*! (-> self root quat) gp-0 s5-0)) ) (cond diff --git a/goal_src/jak3/levels/desert/des-burning-bush.gc b/goal_src/jak3/levels/desert/des-burning-bush.gc index b49b511da4f..d61f3faaec1 100644 --- a/goal_src/jak3/levels/desert/des-burning-bush.gc +++ b/goal_src/jak3/levels/desert/des-burning-bush.gc @@ -932,7 +932,8 @@ ) ) ) - (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25) + ) (set-time! (-> self state-time)) (while (and (nonzero? (get-status *gui-control* (the-as sound-id (-> self message-id)))) (not (time-elapsed? (-> self state-time) (seconds 60))) @@ -1022,7 +1023,7 @@ ) (else (set! (-> *part-id-table* 1585 init-specs 11 initial-valuef) f0-4) - (set! (-> *part-id-table* 1586 init-specs 11 initial-valuef) (* 0.5 f0-4)) + (set! (-> *part-id-table* 1586 init-specs 11 initial-valuef) (/ f0-4 2)) (spawn-from-cspace (-> this part) (-> this node-list data 4)) (spawn-from-cspace (-> this part) (-> this node-list data 5)) ) @@ -1490,8 +1491,7 @@ (send-event *camera* 'teleport-to-transformq s4-0) ) (set! (-> self update-fov?) #t) - (suspend-for - (seconds 3) + (suspend-for (seconds 3) (set! (-> *camera* slave 0 fov) (-> *burning-bush-get-on-info* (-> self info index) fov)) ) (set! (-> self update-fov?) #f) diff --git a/goal_src/jak3/levels/desert/des-bush.gc b/goal_src/jak3/levels/desert/des-bush.gc index a270ab95ba5..cacbaa0bf08 100644 --- a/goal_src/jak3/levels/desert/des-bush.gc +++ b/goal_src/jak3/levels/desert/des-bush.gc @@ -1688,7 +1688,7 @@ (set! (-> this fail-radius) (res-lump-float s5-2 'fail-radius :default 655360.0)) (set! (-> this chase-distance) (res-lump-float s5-2 'chase-distance :default 102400.0)) (set! (-> this start-offset-vel) (res-lump-float s5-2 'start-offset-vel :default 20480.0)) - (format #t "new-vel: ~f~%" (* 0.00024414062 (-> this start-offset-vel))) + (format #t "new-vel: ~f~%" (/ (-> this start-offset-vel) METER_LENGTH)) (set! (-> this entity) (the-as entity-actor s5-2)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-19 (res-lump-data s5-2 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -1707,7 +1707,7 @@ (set-sbanks this) (set! (-> this sound-id) (new 'static 'sound-id)) (set! (-> this current-spirit-vel) (-> this min-spirit-vel)) - (format #t "min-spirit-vel: ~f~%" (* 0.00024414062 (-> this min-spirit-vel))) + (format #t "min-spirit-vel: ~f~%" (/ (-> this min-spirit-vel) METER_LENGTH)) (none) ) diff --git a/goal_src/jak3/levels/desert/des-cactus.gc b/goal_src/jak3/levels/desert/des-cactus.gc index 851fda2bf84..2bc7926736a 100644 --- a/goal_src/jak3/levels/desert/des-cactus.gc +++ b/goal_src/jak3/levels/desert/des-cactus.gc @@ -73,8 +73,8 @@ (quaternion-conjugate! (-> s5-0 1) (-> this root quat)) (quaternion->matrix (the-as matrix (-> s5-0 2)) (-> s5-0 1)) (set! (-> s5-0 7 x) 2730.6667) - (set! (-> s5-0 7 z) (sin (* 0.5 (-> s5-0 7 x)))) - (set! (-> s5-0 7 y) (cos (* 0.5 (-> s5-0 7 x)))) + (set! (-> s5-0 7 z) (sin (/ (-> s5-0 7 x) 2))) + (set! (-> s5-0 7 y) (cos (/ (-> s5-0 7 x) 2))) (vector-rotate90-around-y! (the-as vector (-> s5-0 6)) (-> this spring-pos)) (vector-float*! (the-as vector (-> s5-0 6)) (the-as vector (-> s5-0 6)) (* -1.0 (-> s5-0 7 z))) (vector-rotate*! (the-as vector (-> s5-0 6)) (the-as vector (-> s5-0 6)) (the-as matrix (-> s5-0 2))) @@ -361,7 +361,8 @@ ) ) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (cleanup-for-death self) ) :post #f diff --git a/goal_src/jak3/levels/desert/desert-dust-storm.gc b/goal_src/jak3/levels/desert/desert-dust-storm.gc index 1a0840f4df5..9ab3df11406 100644 --- a/goal_src/jak3/levels/desert/desert-dust-storm.gc +++ b/goal_src/jak3/levels/desert/desert-dust-storm.gc @@ -428,7 +428,7 @@ (set! f0-44 (+ 65536.0 f0-44)) ) (let* ((f0-46 (+ (* 5.0 f0-44) (* 5.0 (- (-> this current-wind-angle-speed))))) - (f1-23 (* 0.2 f0-46 f28-3)) + (f1-23 (* (/ f0-46 5) f28-3)) ) (+! (-> this current-wind-angle-speed) (* f1-23 (seconds-per-frame))) ) @@ -569,7 +569,7 @@ (vector+float*! s4-0 s4-0 (get-transv *target*) 0.2) ) (vector+float*! s4-0 s4-0 (-> (math-camera-matrix) fvec) 20480.0) - (let ((f30-4 (* 0.000061035156 (-> this stretch-val)))) + (let ((f30-4 (/ (-> this stretch-val) (meters 4)))) (set! (-> *part-id-table* 1421 init-specs 2 initial-valuef) (lerp 20480.0 61440.0 f30-4)) (set! (-> *part-id-table* 1422 init-specs 2 initial-valuef) (lerp 20480.0 61440.0 f30-4)) ) @@ -623,7 +623,7 @@ #t (let* ((f0-12 (vector-dot s5-2 (-> this fog-plane-dir))) (f0-13 (fmax 0.0 f0-12)) - (f1-5 (* 0.000016276043 f0-13)) + (f1-5 (/ f0-13 (meters 15))) (f0-15 (fmax 0.0 (fmin 1.0 f1-5))) ) (set! f28-0 (lerp (fmin 0.8 (-> this intensity)) (-> this intensity) f0-15)) @@ -680,7 +680,7 @@ (send-event *target* 'push-trans - (vector-float*! (new 'stack-no-clear 'vector) *duststorm-wind-vec* (* 0.02 *duststorm-wind-vel*)) + (vector-float*! (new 'stack-no-clear 'vector) *duststorm-wind-vec* (/ (the float *duststorm-wind-vel*) 50)) (seconds 0.11) ) ) diff --git a/goal_src/jak3/levels/desert/hover/des-beast-2.gc b/goal_src/jak3/levels/desert/hover/des-beast-2.gc index 8f8c1cdd5c8..80dd08b0662 100644 --- a/goal_src/jak3/levels/desert/hover/des-beast-2.gc +++ b/goal_src/jak3/levels/desert/hover/des-beast-2.gc @@ -32,9 +32,9 @@ (let ((v1-1 (the-as object (-> block param 0)))) (let ((a0-4 (-> self entity extra perm))) (logior! (-> a0-4 status) (entity-perm-status bit-5)) - (set! (-> a0-4 user-int16 0) (the int (* 0.00024414062 (-> (the-as vector v1-1) x)))) - (set! (-> a0-4 user-int16 1) (the int (* 0.00024414062 (-> (the-as vector v1-1) y)))) - (set! (-> a0-4 user-int16 2) (the int (* 0.00024414062 (-> (the-as vector v1-1) z)))) + (set! (-> a0-4 user-int16 0) (the int (/ (-> (the-as vector v1-1) x) METER_LENGTH))) + (set! (-> a0-4 user-int16 1) (the int (/ (-> (the-as vector v1-1) y) METER_LENGTH))) + (set! (-> a0-4 user-int16 2) (the int (/ (-> (the-as vector v1-1) z) METER_LENGTH))) ) (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) ) @@ -665,7 +665,7 @@ (vector+float*! gp-1 (-> s5-1 0) (-> s5-1 1) (-> s5-1 4 x)) 0 ) - (let ((f1-20 (* 0.000008138021 (-> s5-1 2 x)))) + (let ((f1-20 (/ (-> s5-1 2 x) (meters 30)))) (set! (-> gp-1 y) (fmin (+ 327680.0 (-> self root trans y)) (+ 20480.0 (* 9216.0 (* f1-20 f1-20)) (-> gp-1 y))) ) @@ -818,13 +818,15 @@ ) ) :code (behavior () - (suspend-for (seconds 0.1)) + (suspend-for (seconds 0.1) + ) (until (ja-done? 0) (suspend) ) (logior! (-> self skel effect flags) (effect-control-flag ecf1)) (do-effect (-> self skel effect) "death-default" 0.0 -1) - (suspend-for (seconds 3)) + (suspend-for (seconds 3) + ) (go-virtual die) ) :post (behavior () diff --git a/goal_src/jak3/levels/desert/hover/des-beast.gc b/goal_src/jak3/levels/desert/hover/des-beast.gc index fe51b17ed41..c06ad01904e 100644 --- a/goal_src/jak3/levels/desert/hover/des-beast.gc +++ b/goal_src/jak3/levels/desert/hover/des-beast.gc @@ -1831,7 +1831,7 @@ (let ((f30-0 (lerp-scale 3276.8 0.0 (vector-vector-distance (camera-pos) (-> this root trans)) 81920.0 573440.0))) (when (!= f30-0 0.0) (activate! *camera-smush-control* f30-0 37 600 1.0 0.1 (-> *display* camera-clock)) - (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (* 0.00024414062 f30-0))) (seconds 0.2)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (/ f30-0 METER_LENGTH))) (seconds 0.2)) ) ) ) @@ -1956,7 +1956,7 @@ (static-attack-info :mask (vehicle-impulse-factor) ((id (-> this attack-id)) (damage 2.0) (vehicle-damage-factor 0.01) - (vehicle-impulse-factor (* 0.00012207031 f30-2)) + (vehicle-impulse-factor (/ f30-2 (meters 2))) (attacker-velocity s3-4) ) ) diff --git a/goal_src/jak3/levels/desert/hover/deshover-texture.gc b/goal_src/jak3/levels/desert/hover/deshover-texture.gc index a48ea094e2f..dd29444a752 100644 --- a/goal_src/jak3/levels/desert/hover/deshover-texture.gc +++ b/goal_src/jak3/levels/desert/hover/deshover-texture.gc @@ -163,8 +163,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) diff --git a/goal_src/jak3/levels/desert/race/turtle-training.gc b/goal_src/jak3/levels/desert/race/turtle-training.gc index 53359bf0236..f1ce4952844 100644 --- a/goal_src/jak3/levels/desert/race/turtle-training.gc +++ b/goal_src/jak3/levels/desert/race/turtle-training.gc @@ -229,7 +229,7 @@ (let ((v1-3 s5-0)) (set! (-> v1-3 height) (the float 70)) ) - (set! (-> s5-0 origin x) (the float (- 201 (the int (* 0.5 (-> s5-0 width)))))) + (set! (-> s5-0 origin x) (the float (- 201 (the int (/ (-> s5-0 width) 2))))) (set! (-> s5-0 origin y) 290.0) (set! (-> s5-0 flags) (font-flags shadow kerning middle-vert large)) (let ((s4-0 print-game-text)) @@ -289,8 +289,11 @@ (set! (-> gp-0 map-icon) (the-as uint 12)) (set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 self))) ) - (suspend-for (seconds 4) (print-training-text self (text-id text-05e6))) - (suspend-for (seconds 0.25)) + (suspend-for (seconds 4) + (print-training-text self (text-id text-05e6)) + ) + (suspend-for (seconds 0.25) + ) (set! (-> self time-limit) (seconds 30)) (set-time! (-> self start-time)) (until #f @@ -315,7 +318,8 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25) + ) (set! (-> self show-message?) #f) (set! (-> self goal-pos quad) (-> self goal-array 1 pos quad)) (let ((gp-5 (new 'stack-no-clear 'task-arrow-params))) @@ -346,7 +350,8 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25) + ) (set! (-> self time-limit) (seconds 28)) (set-time! (-> self start-time)) (set-time! (-> self test-time)) @@ -365,7 +370,8 @@ (sound-play "special-pickup") (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25) + ) (set! (-> self show-message?) #f) (set! (-> self goal-pos quad) (-> self goal-array 2 pos quad)) (let ((gp-10 (new 'stack-no-clear 'task-arrow-params))) @@ -413,7 +419,8 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25) + ) (set! (-> self goal-pos quad) (-> self goal-array 3 pos quad)) (let ((gp-13 (new 'stack-no-clear 'task-arrow-params))) (set! (-> gp-13 pos quad) (-> self goal-pos quad)) @@ -442,7 +449,8 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25) + ) (set! (-> self goal-pos quad) (-> self goal-array 4 pos quad)) (let ((gp-16 (new 'stack-no-clear 'task-arrow-params))) (set! (-> gp-16 pos quad) (-> self goal-pos quad)) @@ -475,7 +483,8 @@ (set! (-> self arrow) (the-as handle #f)) (send-event (handle->process (-> self hud-timer)) 'hide-and-die) (set! (-> self start-time) 0) - (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25) + ) (set! (-> self goal-pos quad) (-> self goal-array 5 pos quad)) (let ((gp-19 (new 'stack-no-clear 'task-arrow-params))) (set! (-> gp-19 pos quad) (-> self goal-pos quad)) diff --git a/goal_src/jak3/levels/desert/rescue/desert-rescue.gc b/goal_src/jak3/levels/desert/rescue/desert-rescue.gc index 114d01d13c9..80cbede6606 100644 --- a/goal_src/jak3/levels/desert/rescue/desert-rescue.gc +++ b/goal_src/jak3/levels/desert/rescue/desert-rescue.gc @@ -1278,8 +1278,8 @@ (vector+float*! s4-0 (-> this root trans) s3-0 0.0) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) - (let* ((s5-1 (vector+float*! (new 'stack-no-clear 'vector) s4-0 s3-0 (* 0.5 f30-0))) - (s2-1 (vector+float*! (new 'stack-no-clear 'vector) s4-0 s3-0 (* -0.5 f30-0))) + (let* ((s5-1 (vector+float*! (new 'stack-no-clear 'vector) s4-0 s3-0 (/ f30-0 2))) + (s2-1 (vector+float*! (new 'stack-no-clear 'vector) s4-0 s3-0 (/ f30-0 -2))) (f28-0 (probe-ground this s5-1)) (f0-6 (probe-ground this s2-1)) ) @@ -1616,7 +1616,7 @@ ) (when (or (logtest? (-> self draw status) (draw-control-status on-screen)) (< f0-0 1024000.0)) 0.0 - (let* ((f0-1 (* 0.0000048828124 f0-0)) + (let* ((f0-1 (/ f0-0 (meters 50))) (f0-3 (fmax 1.0 (+ -2.0 f0-1))) ) (set! (-> self move-speed) (/ 245760.0 f0-3)) @@ -2562,7 +2562,8 @@ ((-> (method-of-type task-manager active) trans)) ) :code (behavior () - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (send-event self 'fail) (sleep-code) ) diff --git a/goal_src/jak3/levels/desert/rescue/neo-satellite.gc b/goal_src/jak3/levels/desert/rescue/neo-satellite.gc index 4bb6d1b4e4a..7a41e60951e 100644 --- a/goal_src/jak3/levels/desert/rescue/neo-satellite.gc +++ b/goal_src/jak3/levels/desert/rescue/neo-satellite.gc @@ -1770,7 +1770,7 @@ (defmethod neo-sat-method-201 ((this neo-sat)) (when (and (-> this next-state) (= (-> this next-state name) 'neo-sat-drill-prepare)) - (let ((f0-1 (* 0.000010172526 (-> this spin-current)))) + (let ((f0-1 (/ (-> this spin-current) (meters 24)))) (sound-play-by-name (static-sound-name "sat-hover") (-> this snd-hover) @@ -2242,7 +2242,7 @@ (set! (-> s2-3 y) 0.0) (vector-normalize! s2-3 1.0) (let* ((f0-23 (acos (vector-dot s2-3 s3-0))) - (f0-24 (* 0.000030517578 f0-23)) + (f0-24 (/ f0-23 (meters 8))) (f22-0 (- 1.0 f0-24)) (f1-10 (+ (lerp 0.0 0.75 (* f22-0 f22-0)) (lerp -0.25 0.25 f26-1))) (f24-1 (fmax 0.0 (fmin 1.0 f1-10))) @@ -2445,7 +2445,7 @@ (seconds-per-frame) ) ) - (f0-11 (* 0.05 f0-10)) + (f0-11 (/ f0-10 20)) ) (+! (-> this spin-speed) f0-11) ) @@ -2694,7 +2694,7 @@ ) (vector+float*! s1-0 (-> this shockwave-origin) s0-0 f28-1) (set! (-> s1-0 y) (neo-sat-method-218 this s1-0)) - (set! (-> *part-id-table* 1679 init-specs 3 initial-valuef) (lerp 409.6 2457.6 (* 0.0000061035157 f28-1))) + (set! (-> *part-id-table* 1679 init-specs 3 initial-valuef) (lerp 409.6 2457.6 (/ f28-1 (meters 40)))) (let* ((f26-2 (-> *part-id-table* 1679 init-specs 3 initial-valuef)) (f24-1 1.0) (v1-41 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -3662,11 +3662,11 @@ ) (defmethod neo-sat-method-215 ((this neo-sat) (arg0 float)) - (* 0.000108506945 arg0) + (/ arg0 9216) ) (defmethod neo-sat-method-216 ((this neo-sat) (arg0 float)) - (* 0.000108506945 arg0) + (/ arg0 9216) ) (defmethod neo-sat-method-213 ((this neo-sat) (arg0 float)) diff --git a/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc b/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc index 1c492e02908..82ba3db0fe1 100644 --- a/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc +++ b/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc @@ -231,7 +231,7 @@ (-> s5-1 2 trans) (-> (the-as process-drawable s4-0) root trans) (-> s5-1 2 uvec) - (* 0.5 (-> s5-1 3 uvec y)) + (/ (-> s5-1 3 uvec y) 2) ) ) ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-marauder.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-marauder.gc index 4b52e792884..c2af3e02a40 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-marauder.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-marauder.gc @@ -125,7 +125,7 @@ (let ((s5-0 (-> this target-status))) (when (< 122880.0 (vector-vector-distance (-> s5-0 position) (-> this root trans))) (let ((f1-0 (vector-length (-> s5-0 velocity)))) - (set! (-> this turret-control inaccuracy) (* (-> this inaccuracy-factor) (fmax 1.0 (* 0.000012207031 f1-0)))) + (set! (-> this turret-control inaccuracy) (* (-> this inaccuracy-factor) (fmax 1.0 (/ f1-0 (meters 20))))) ) (turret-control-method-11 (-> this turret-control) this (-> s5-0 position) (-> s5-0 velocity)) ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-mirage.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-mirage.gc index e33848485d2..4e462f44a95 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-mirage.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-mirage.gc @@ -83,7 +83,7 @@ (set! (-> gp-1 vec11 w) (fmax 0.1 (/ (-> gp-1 vec11 x) (fmax 4096.0 (- (-> gp-1 vec11 y)))))) (set! (-> gp-1 vec11 z) (+ (-> gp-1 vec6 y) (* (-> gp-1 vec11 w) (-> gp-1 vec7 y)))) (set! (-> gp-1 vec4 y) (+ (* (/ 1.0 (-> gp-1 vec11 w)) (- (-> gp-1 vec11 z) (-> gp-1 vec0 y))) - (* 0.5 (-> gp-1 vec11 w) (-> gp-1 vec10 w)) + (* (/ (-> gp-1 vec11 w) 2) (-> gp-1 vec10 w)) ) ) (set! (-> gp-1 vec4 y) (* (-> gp-1 vec4 y) (/ 1.0 (fmax 0.1 (-> gp-1 mat0 uvec y))))) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-projectiles.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-projectiles.gc index 76c1e7989d8..42d80942489 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-projectiles.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-projectiles.gc @@ -297,7 +297,7 @@ (launch-particles (-> *part-id-table* 981) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000008138021 f30-0)) + (f26-0 (/ f30-0 (meters 30))) (f30-1 (-> *part-id-table* 982 init-specs 3 initial-valuef)) (f28-0 (-> *part-id-table* 982 init-specs 5 initial-valuef)) ) @@ -506,7 +506,7 @@ (let* ((v1-26 (estimate-light-trail-mem-usage (the-as uint (-> s5-1 max-num-crumbs)) - (the-as uint (= (-> s5-1 appearance lie-mode) 3)) + (the-as uint (= (-> s5-1 appearance lie-mode) (lie-mode use-two-strips))) ) ) (s4-1 (get-process *default-dead-pool* light-trail-tracker-projectile (+ v1-26 8192) 1)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-rhino.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-rhino.gc index 30a8ddd17be..690cb94bcd9 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-rhino.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-rhino.gc @@ -176,7 +176,7 @@ (not (-> *setting-control* cam-current entity-name)) ) ) - (activate! *camera-smush-control* (fmin 1331.2 (* 0.5 f0-0)) 120 360 1.0 0.9 (-> *display* camera-clock)) + (activate! *camera-smush-control* (fmin 1331.2 (/ f0-0 2)) 120 360 1.0 0.9 (-> *display* camera-clock)) ) ) ((method-of-type wcar-base vehicle-method-94) this) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-scorpion.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-scorpion.gc index 28fd4e667b6..a232956857e 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-scorpion.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-scorpion.gc @@ -209,7 +209,7 @@ (defmethod vehicle-method-94 ((this v-scorpion)) (let ((f0-0 (vector-length (-> this lin-acceleration)))) (if (and (< 327680.0 f0-0) (not (logtest? (-> this controls flags) (vehicle-controls-flag vcf0)))) - (activate! *camera-smush-control* (fmin 2048.0 (* 0.5 f0-0)) 60 210 1.0 0.9 (-> *display* camera-clock)) + (activate! *camera-smush-control* (fmin 2048.0 (/ f0-0 2)) 60 210 1.0 0.9 (-> *display* camera-clock)) ) ) ((method-of-type wcar-base vehicle-method-94) this) @@ -279,11 +279,11 @@ ) 0 (let ((v1-44 (-> this jmod-shock-mids s4-1))) - (set! (-> v1-44 transform trans y) (* -0.5 (-> s5-1 ground-pos z) (-> s3-0 x-scale))) + (set! (-> v1-44 transform trans y) (* (/ (-> s5-1 ground-pos z) -2) (-> s3-0 x-scale))) ) 0 (let ((v1-48 (-> this jmod-shock-bots s4-1))) - (set! (-> v1-48 transform trans y) (* -1.0 (+ -2048.0 (* 0.5 (-> s5-1 ground-pos z))) (-> s3-0 x-scale))) + (set! (-> v1-48 transform trans y) (* -1.0 (+ -2048.0 (/ (-> s5-1 ground-pos z) 2)) (-> s3-0 x-scale))) ) ) 0 diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-toad.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-toad.gc index 9a68a3744aa..6d9be7dffa0 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-toad.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-toad.gc @@ -108,7 +108,7 @@ (set! (-> gp-1 vec11 w) (fmax 0.1 (/ (-> gp-1 vec11 x) (fmax 4096.0 (- (-> gp-1 vec11 y)))))) (set! (-> gp-1 vec11 z) (+ (-> gp-1 vec6 y) (* (-> gp-1 vec11 w) (-> gp-1 vec7 y)))) (set! (-> gp-1 vec4 y) (+ (* (/ 1.0 (-> gp-1 vec11 w)) (- (-> gp-1 vec11 z) (-> gp-1 vec0 y))) - (* 0.5 (-> gp-1 vec11 w) (-> gp-1 vec10 w)) + (* (/ (-> gp-1 vec11 w) 2) (-> gp-1 vec10 w)) ) ) (set! (-> gp-1 vec4 y) (* (-> gp-1 vec4 y) (/ 1.0 (fmax 0.1 (-> gp-1 mat0 uvec y))))) @@ -306,7 +306,7 @@ (set! (-> gp-0 wsphere z) 13590.528) (set! (-> gp-0 wsphere r) 0.0) (set! (-> gp-0 friction-coef) - (+ (-> gp-0 wsphere r) (* 2.0 (asin (/ (* 0.5 (-> arg1 travel)) (-> gp-0 wsphere z))))) + (+ (-> gp-0 wsphere r) (* 2.0 (asin (/ (/ (-> arg1 travel) 2) (-> gp-0 wsphere z))))) ) (set! (-> gp-0 steering-axis quad) (-> (new 'static 'vector :x 10649.6 :y 2662.4 :z 7618.56 :w 1.0) quad)) (set-vector! diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-turtle.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-turtle.gc index 4f9a7fa0a78..e25c2cc2119 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-turtle.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-turtle.gc @@ -152,7 +152,7 @@ (-> this spring-vel) (-> this spring-vel) (-> s5-1 mat fvec) - (* -0.00024414062 (-> s5-1 mat trans x)) + (/ (-> s5-1 mat trans x) (meters -1)) ) (set! (-> s5-1 mat trans y) 500.0) (set! (-> s5-1 mat trans z) 5.0) @@ -187,8 +187,8 @@ (quaternion-conjugate! (-> s5-2 quat1) (-> this root quat)) (quaternion->matrix (-> s5-2 mat0) (-> s5-2 quat1)) (set! (-> s5-2 float0) 8192.0) - (set! (-> s5-2 float2) (sin (* 0.5 (-> s5-2 float0)))) - (set! (-> s5-2 float1) (cos (* 0.5 (-> s5-2 float0)))) + (set! (-> s5-2 float2) (sin (/ (-> s5-2 float0) 2))) + (set! (-> s5-2 float1) (cos (/ (-> s5-2 float0) 2))) (vector-rotate90-around-y! (-> s5-2 vec0) (-> this spring-pos)) (vector-float*! (-> s5-2 vec0) (-> s5-2 vec0) (* -1.0 (-> s5-2 float2))) (vector-rotate*! (-> s5-2 vec0) (-> s5-2 vec0) (-> s5-2 mat0)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-ai.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-ai.gc index f3b08c0b83e..53859546dae 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-ai.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-ai.gc @@ -165,7 +165,7 @@ (vector-! (-> gp-0 world-normal) (-> gp-0 axis) (-> gp-0 p-body)) (vector-normalize! (-> gp-0 world-normal) 1.0) (vector+float*! (-> gp-0 velocity) (the-as vector (-> gp-0 mat)) (-> gp-0 world-normal) 163840.0) - (set! (-> gp-0 wheel-axis x) (* 0.5 (-> gp-0 wheel-axis x))) + (set! (-> gp-0 wheel-axis x) (/ (-> gp-0 wheel-axis x) 2)) 0 ) ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-hud.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-hud.gc index 50c3032a423..5511ef28d7b 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-hud.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-hud.gc @@ -30,7 +30,7 @@ ) (else (set! (-> a1-3 tid) (the-as texture-id (-> this tex-off))) - (set! (-> a1-3 color w) (the int (* 0.5 f0-7))) + (set! (-> a1-3 color w) (the int (/ f0-7 2))) ) ) ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc index c89936b8114..5ba526a4b46 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc @@ -305,7 +305,9 @@ ) ) (f1-29 - (/ (* 0.5 (-> s2-1 inertia) (-> s2-1 forward-slip-vel)) (* arg0 (-> arg1 probe-work-array 0 world-normal y))) + (/ (* (/ (-> s2-1 inertia) 2) (-> s2-1 forward-slip-vel)) + (* arg0 (-> arg1 probe-work-array 0 world-normal y)) + ) ) ) (if (logtest? (-> s1-1 flags) (vehicle-wheel-flag vwf0)) @@ -335,7 +337,7 @@ ) ) (if (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) - (set! f0-57 (* 0.05 f0-57)) + (set! f0-57 (/ f0-57 20)) ) (+! (-> arg1 probe-work-array 0 ground-pos y) f0-57) ) @@ -425,7 +427,7 @@ (vector-rotate*! (-> arg1 normal) (-> arg1 normal) (-> sv-16 inv-i-world)) (vector-cross! (-> arg1 normal) (-> arg1 normal) (-> arg1 tmp)) (set! (-> arg1 probe-work-array 0 world-normal z) - (/ (* -0.5 (-> s1-2 side-vel)) + (/ (/ (-> s1-2 side-vel) -2) (* arg0 (+ (-> sv-16 info inv-mass) (vector-dot (the-as vector (-> arg1 probe-work-array)) (-> arg1 normal)))) ) ) @@ -437,7 +439,7 @@ (vector-rotate*! (-> arg1 normal) (-> arg1 normal) (-> sv-16 inv-i-world)) (vector-cross! (-> arg1 normal) (-> arg1 normal) (-> arg1 tmp)) (let ((f0-94 - (/ (* -0.25 (-> s1-2 forward-slip-vel)) + (/ (/ (-> s1-2 forward-slip-vel) -4) (* arg0 (+ (-> sv-16 info inv-mass) (vector-dot (the-as vector (&-> arg1 impulse)) (-> arg1 normal)))) ) ) @@ -616,7 +618,7 @@ ) (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) (vector-reset! (-> gp-0 force)) - (set! (-> gp-0 force y) (* -0.5 (-> s4-0 extra gravity) (-> s4-0 info mass))) + (set! (-> gp-0 force y) (* (/ (-> s4-0 extra gravity) -2) (-> s4-0 info mass))) (rigid-body-control-method-22 s5-0 (-> gp-0 world-pos) (-> gp-0 force)) ) ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc index f2fff7a603c..e2105d64003 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc @@ -115,7 +115,7 @@ (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) - (set! (-> gp-2 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-2 scale) (/ (-> self draw bounds w) 11264)) (set! (-> gp-2 group) (-> *part-group-id-table* (-> self info explosion-part))) (set! (-> gp-2 collide-with) (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) @@ -172,7 +172,7 @@ (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 4096.0) - (set! (-> gp-0 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-0 scale) (/ (-> self draw bounds w) 11264)) (set! (-> gp-0 group) (-> *part-group-id-table* (-> self info explosion-part))) (set! (-> gp-0 collide-with) (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc index b358c1b5a14..7ceeae93070 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc @@ -738,13 +738,13 @@ (when (< 18.204445 (fabs (-> s5-0 0 fvec z))) (cond ((logtest? (-> s4-0 physics-model rear-wheel flags) (vehicle-wheel-flag vwf4)) - (set! (-> s5-0 1 rvec w) (/ (* 0.5 (-> s5-0 1 uvec z)) (sin (fabs (-> s5-0 0 fvec z))))) + (set! (-> s5-0 1 rvec w) (/ (/ (-> s5-0 1 uvec z) 2) (sin (fabs (-> s5-0 0 fvec z))))) (let ((f0-32 (- (* (-> s5-0 1 rvec w) (cos (fabs (-> s5-0 0 fvec z)))) (* 2.0 (+ (-> s4-0 physics-model rear-wheel local-pos x) (-> s4-0 physics-model rear-wheel susp-arm-length))) ) ) - (f1-22 (* 0.5 (-> s5-0 1 uvec z))) + (f1-22 (/ (-> s5-0 1 uvec z) 2)) ) (set! (-> s5-0 1 rvec z) (sqrtf (+ (* f1-22 f1-22) (* f0-32 f0-32)))) ) @@ -757,7 +757,7 @@ (- (-> s5-0 1 rvec w) (+ (-> s4-0 physics-model front-wheel local-pos x) (-> s4-0 physics-model front-wheel susp-arm-length) - (* -0.5 (-> s5-0 1 uvec y)) + (/ (-> s5-0 1 uvec y) -2) ) ) ) diff --git a/goal_src/jak3/levels/factory/car/hvehicle-physics.gc b/goal_src/jak3/levels/factory/car/hvehicle-physics.gc index fd87d3658d2..90cd1d6fb99 100644 --- a/goal_src/jak3/levels/factory/car/hvehicle-physics.gc +++ b/goal_src/jak3/levels/factory/car/hvehicle-physics.gc @@ -187,8 +187,8 @@ (let ((f1-20 (fmax 0.0 f0-38))) (+! (-> this lift-thrust s2-1) f1-20) (when (logtest? (vehicle-flag flight-level-transition) (-> this v-flags)) - (+! (-> this roll-thrust 0) (* 0.05 f1-20)) - (+! (-> this roll-thrust 1) (* 0.05 f1-20)) + (+! (-> this roll-thrust 0) (/ f1-20 20)) + (+! (-> this roll-thrust 1) (/ f1-20 20)) ) ) (vector-reset! (-> arg1 force)) @@ -205,7 +205,7 @@ (and (> (-> this flight-level-index) 0) (< f0-40 0.0) (< (-> arg1 velocity y) 0.0)) ) (vector-reset! (-> arg1 force)) - (let ((f0-43 (* -0.25 (-> this info physics-model inv-lift-thruster-count))) + (let ((f0-43 (/ (-> this info physics-model inv-lift-thruster-count) -4)) (f1-28 arg0) ) (set! (-> arg1 force y) (* f0-43 (/ 1.0 f1-28) (-> this info info mass) (-> arg1 velocity y))) @@ -308,7 +308,7 @@ ) ) ) - (set! (-> arg1 impulse) (/ (* -0.5 (-> arg1 vel-dot-norm)) + (set! (-> arg1 impulse) (/ (/ (-> arg1 vel-dot-norm) -2) (* arg0 (+ (-> s3-0 info inv-mass) (vector-dot (-> arg1 normal) (-> arg1 tmp)))) ) ) diff --git a/goal_src/jak3/levels/factory/car/hvehicle-util.gc b/goal_src/jak3/levels/factory/car/hvehicle-util.gc index 9e9057021e3..f2e965deef5 100644 --- a/goal_src/jak3/levels/factory/car/hvehicle-util.gc +++ b/goal_src/jak3/levels/factory/car/hvehicle-util.gc @@ -306,7 +306,7 @@ (let* ((v1-1 (-> this rbody lin-velocity)) (f0-4 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) (f0-6 (/ (- arg0 f0-4) arg0)) - (f1-6 (* 0.005 f0-6)) + (f1-6 (/ f0-6 200)) ) (set! (-> this controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> this controls throttle) f1-6)))) ) diff --git a/goal_src/jak3/levels/factory/car/hvehicle.gc b/goal_src/jak3/levels/factory/car/hvehicle.gc index 6913fca869a..a9192998feb 100644 --- a/goal_src/jak3/levels/factory/car/hvehicle.gc +++ b/goal_src/jak3/levels/factory/car/hvehicle.gc @@ -896,7 +896,7 @@ (cond ((< f0-9 (* f1-8 f1-8)) (let ((f0-10 (vector-length (-> this root transv)))) - (seek! (-> this engine-power-factor) (* 0.000016276043 f0-10) (* 6.0 (seconds-per-frame))) + (seek! (-> this engine-power-factor) (/ f0-10 (meters 15)) (* 6.0 (seconds-per-frame))) ) (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag sounds) (-> this v-flags)))) (rigid-body-object-method-38 this) @@ -1045,7 +1045,7 @@ (set! (-> this outgoing-attack-id) a0-18) ) ) - (let ((f0-11 (+ 0.5 (* 0.000024414063 (-> s5-0 mat trans x))))) + (let ((f0-11 (+ 0.5 (/ (-> s5-0 mat trans x) (meters 10))))) (when (send-event arg0 'attack @@ -1239,7 +1239,7 @@ (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) - (set! (-> gp-2 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-2 scale) (/ (-> self draw bounds w) 11264)) (set! (-> gp-2 group) (-> *part-group-id-table* (-> self info explosion-part))) (set! (-> gp-2 collide-with) (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) diff --git a/goal_src/jak3/levels/factory/fac-robotank-turret.gc b/goal_src/jak3/levels/factory/fac-robotank-turret.gc index f97b970f946..b0d0479e837 100644 --- a/goal_src/jak3/levels/factory/fac-robotank-turret.gc +++ b/goal_src/jak3/levels/factory/fac-robotank-turret.gc @@ -180,7 +180,7 @@ (let ((f0-0 (vector-length (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0))) (gp-1 (-> self sight-scale)) ) - (set! (-> gp-1 z) (* 0.000024414063 f0-0)) + (set! (-> gp-1 z) (/ f0-0 (meters 10))) (let ((f0-1 (lerp-scale 0.1 6.0 f0-0 61440.0 163840.0))) (set! (-> gp-1 x) f0-1) (set! (-> gp-1 y) f0-1) @@ -457,7 +457,7 @@ (let* ((f0-28 (fmax -16384.0 (fmin 16384.0 (- 16384.0 (acos (- (vector-dot gp-2 *y-vector*))))))) (f2-1 (- (-> self gun-elev-cam) f0-28)) (f1-12 (if (< f2-1 0.0) - (fmin 3640.889 (* (fabs (* 0.1 f2-1)) (-> self clock frames-per-second))) + (fmin 3640.889 (* (fabs (/ f2-1 10)) (-> self clock frames-per-second))) 910.2222 ) ) @@ -714,7 +714,8 @@ ) (logior! (-> self flags) (fac-robotank-turret-flag frt3)) (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (let ((gp-2 (max 2 (min 3 (rand-vu-int-range 0 3))))) 0 (dotimes (s5-2 gp-2) @@ -741,7 +742,8 @@ ) ) (let ((f30-0 (rand-vu-float-range 0.05 0.43))) - (suspend-for (the int (* 300.0 f30-0))) + (suspend-for (the int (* 300.0 f30-0)) + ) ) ) ) @@ -759,7 +761,8 @@ ) ) ) - (suspend-for (the int (* 300.0 f30-1))) + (suspend-for (the int (* 300.0 f30-1)) + ) ) ) #f @@ -776,7 +779,8 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (while (-> self child) (suspend) ) diff --git a/goal_src/jak3/levels/factory/fac-robotank.gc b/goal_src/jak3/levels/factory/fac-robotank.gc index 5c1948eebcd..c1fb7c4b635 100644 --- a/goal_src/jak3/levels/factory/fac-robotank.gc +++ b/goal_src/jak3/levels/factory/fac-robotank.gc @@ -311,7 +311,7 @@ (f1-13 (- 1.0 f0-32)) ) 0.0 - (when (and (or (< f0-32 f26-0) (< f26-0 f1-13)) (time-elapsed? (-> self buzz-timer) (the int (* 0.5 f28-1)))) + (when (and (or (< f0-32 f26-0) (< f26-0 f1-13)) (time-elapsed? (-> self buzz-timer) (the int (/ f28-1 2)))) (let* ((gp-1 *target*) (a0-37 (if (type? gp-1 process-focusable) gp-1 @@ -492,7 +492,8 @@ ) :code (behavior () (logclear! (-> self flags) (robotank-flag r2)) - (suspend-for (seconds 0.1)) + (suspend-for (seconds 0.1) + ) (logior! (-> self flags) (robotank-flag r2)) (sleep-code) ) @@ -656,7 +657,8 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (while (-> self child) (suspend) ) diff --git a/goal_src/jak3/levels/factory/fac-tower.gc b/goal_src/jak3/levels/factory/fac-tower.gc index caefb816b0f..c2a89e3c11e 100644 --- a/goal_src/jak3/levels/factory/fac-tower.gc +++ b/goal_src/jak3/levels/factory/fac-tower.gc @@ -263,7 +263,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) :post ja-post ) @@ -820,7 +821,7 @@ (static-sound-name "gtower-openloop") (-> this rotate-sound) 1024 - (the int (* 1524.0 (+ 1.0 (* 0.00001 (-> this yawvel))))) + (the int (* 1524.0 (+ 1.0 (/ (-> this yawvel) 100000)))) 0 (sound-group) (-> this root trans) @@ -828,8 +829,8 @@ (sound-play-by-name (static-sound-name "gtower-blade") (-> this blade-sound) - (the int (* 1024.0 (fmax 0.0 (fmin 0.5 (* 0.00001 (-> this yawvel)))))) - (the int (* 1524.0 (+ 1.3 (* 0.00001 (-> this yawvel))))) + (the int (* 1024.0 (fmax 0.0 (fmin 0.5 (/ (-> this yawvel) 100000))))) + (the int (* 1524.0 (+ 1.3 (/ (-> this yawvel) 100000)))) 0 (sound-group) (-> this root trans) diff --git a/goal_src/jak3/levels/factory/factory-boss-states.gc b/goal_src/jak3/levels/factory/factory-boss-states.gc index 745bbd4c4cf..40c00646f1e 100644 --- a/goal_src/jak3/levels/factory/factory-boss-states.gc +++ b/goal_src/jak3/levels/factory/factory-boss-states.gc @@ -124,9 +124,9 @@ (quaternion-set! (-> self root quat) 0.0 - (sin (* 0.5 (-> self root-angle))) + (sin (/ (-> self root-angle) 2)) 0.0 - (cos (* 0.5 (-> self root-angle))) + (cos (/ (-> self root-angle) 2)) ) (none) ) diff --git a/goal_src/jak3/levels/factory/factory-manager.gc b/goal_src/jak3/levels/factory/factory-manager.gc index ff38a23a21a..1f4f4821f5d 100644 --- a/goal_src/jak3/levels/factory/factory-manager.gc +++ b/goal_src/jak3/levels/factory/factory-manager.gc @@ -712,7 +712,7 @@ (vector-normalize! s4-0 1.0) (vector-! s3-0 s2-0 (-> this pvel)) (set! (-> this pvel quad) (-> s2-0 quad)) - (vector-float*! s3-0 s3-0 (* 0.000016276043 f28-0)) + (vector-float*! s3-0 s3-0 (/ f28-0 (meters 15))) (cond ((< 0.0 (-> this blendpath)) (let ((v1-52 (new 'stack-no-clear 'vector))) diff --git a/goal_src/jak3/levels/factory/ffight-projectile.gc b/goal_src/jak3/levels/factory/ffight-projectile.gc index 021ebd67cd2..6467ad4664a 100644 --- a/goal_src/jak3/levels/factory/ffight-projectile.gc +++ b/goal_src/jak3/levels/factory/ffight-projectile.gc @@ -361,7 +361,7 @@ (launch-particles (-> *part-id-table* 2853) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f28-1 (* 0.000015258789 f30-0)) + (f28-1 (/ f30-0 (meters 16))) (f30-1 (-> *part-id-table* 2854 init-specs 3 initial-valuef)) ) (-> *part-id-table* 2854 init-specs 4 initial-valuef) diff --git a/goal_src/jak3/levels/factory/ftank-projectile.gc b/goal_src/jak3/levels/factory/ftank-projectile.gc index aa3befe9c55..f292474166e 100644 --- a/goal_src/jak3/levels/factory/ftank-projectile.gc +++ b/goal_src/jak3/levels/factory/ftank-projectile.gc @@ -291,7 +291,7 @@ (launch-particles (-> *part-id-table* 2868) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f28-1 (* 0.000015258789 f30-0)) + (f28-1 (/ f30-0 (meters 16))) (f30-1 (-> *part-id-table* 2869 init-specs 3 initial-valuef)) ) (-> *part-id-table* 2869 init-specs 4 initial-valuef) diff --git a/goal_src/jak3/levels/factory/fturret-projectile.gc b/goal_src/jak3/levels/factory/fturret-projectile.gc index 0522cd5089d..b082f22efdd 100644 --- a/goal_src/jak3/levels/factory/fturret-projectile.gc +++ b/goal_src/jak3/levels/factory/fturret-projectile.gc @@ -397,7 +397,7 @@ (launch-particles (-> *part-id-table* 2880) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 2881 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 2881 init-specs 4 initial-valuef)) ) diff --git a/goal_src/jak3/levels/factory/h-warf.gc b/goal_src/jak3/levels/factory/h-warf.gc index dc1032fe4dc..7813833d0d9 100644 --- a/goal_src/jak3/levels/factory/h-warf.gc +++ b/goal_src/jak3/levels/factory/h-warf.gc @@ -494,13 +494,13 @@ ) ((< arg0 1638400.0) (let ((f0-15 (- 1.0 (* 0.0000034877232 (- 1638400.0 arg0))))) - (set! (-> v0-0 x) (+ 1.0 (* -0.5 f0-15))) + (set! (-> v0-0 x) (+ 1.0 (/ f0-15 -2))) (set! (-> v0-0 y) (+ 1.0 (* 0.0 f0-15))) ) ) ((< arg0 1761280.0) (let ((f0-20 (- 1.0 (* 0.000008138021 (- 1761280.0 arg0))))) - (set! (-> v0-0 x) (+ 0.5 (* -0.5 f0-20))) + (set! (-> v0-0 x) (+ 0.5 (/ f0-20 -2))) (set! (-> v0-0 y) (+ 1.0 (* 0.0 f0-20))) ) ) @@ -760,7 +760,7 @@ (t9-0 this) ) 0.0 - (let ((f0-2 (+ 1.0 (fmax 0.0 (fmin 1.0 (* 0.0000024414062 (-> this speed))))))) + (let ((f0-2 (+ 1.0 (fmax 0.0 (fmin 1.0 (/ (-> this speed) (meters 100))))))) (sound-play-by-name (static-sound-name "hellcat-engine") (-> this engine-sound) @@ -804,7 +804,7 @@ (static-sound-name "hellcat-bank") (-> this wind-noise-sound) (the int (* 1024.0 (-> this wind))) - (the int (* 1524.0 (+ 0.7 (* 0.25 (-> this wind))))) + (the int (* 1524.0 (+ 0.7 (/ (-> this wind) 4)))) 0 (sound-group) (-> this root trans) @@ -1199,7 +1199,7 @@ (set! (-> s5-0 z) (fabs (-> s5-0 z))) 0.0 (let* ((f1-1 (atan (-> s2-0 x) (- (-> s2-0 z)))) - (f30-0 (fmax -1.0 (fmin 1.0 (* 0.000030517578 f1-1)))) + (f30-0 (fmax -1.0 (fmin 1.0 (/ f1-1 (meters 8))))) ) (matrix-transpose! s3-0 (-> this rbody matrix)) (vector-rotate*! arg0 (-> this forward) s3-0) @@ -1335,7 +1335,7 @@ (set-vector! s3-0 4096.0 0.0 0.0 1.0) 0.0 (let ((s1-2 (new 'stack-no-clear 'matrix))) - (let ((f0-76 (* 16384.0 (fmax -1.0 (fmin 1.0 (* 0.0000000012207031 (-> this rbody ang-velocity y) (fabs f30-1)))))) + (let ((f0-76 (* 16384.0 (fmax -1.0 (fmin 1.0 (* (/ (-> this rbody ang-velocity y) (meters 200000)) (fabs f30-1)))))) ) (matrix-rotate-y! s1-2 f0-76) ) @@ -1588,7 +1588,7 @@ (set! (-> this outgoing-attack-id) a0-18) ) ) - (let ((f0-10 (+ 0.5 (* 0.000024414063 (-> s5-0 impulse))))) + (let ((f0-10 (+ 0.5 (/ (-> s5-0 impulse) (meters 10))))) (when (send-event arg0 'attack diff --git a/goal_src/jak3/levels/factory/missile-bot.gc b/goal_src/jak3/levels/factory/missile-bot.gc index a95b5320c6e..9b01d3ac2da 100644 --- a/goal_src/jak3/levels/factory/missile-bot.gc +++ b/goal_src/jak3/levels/factory/missile-bot.gc @@ -546,7 +546,7 @@ ) (vector-! gp-0 gp-0 (-> self root trans)) (let* ((f0-2 (vector-length gp-0)) - (f30-0 (fmin 16384.0 (* 0.2 f0-2))) + (f30-0 (fmin 16384.0 (/ f0-2 5))) (f0-3 (missile-bot-get-kick-time f0-2)) ) (vector+! gp-0 gp-0 (-> self root trans)) diff --git a/goal_src/jak3/levels/factory/warf-projectile.gc b/goal_src/jak3/levels/factory/warf-projectile.gc index 97f3945447b..678198d642c 100644 --- a/goal_src/jak3/levels/factory/warf-projectile.gc +++ b/goal_src/jak3/levels/factory/warf-projectile.gc @@ -407,7 +407,7 @@ (warf-projectile-method-42 this s3-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix))) - (fmin 1.0 (* 0.0000061035157 f30-0)) + (fmin 1.0 (/ f30-0 (meters 40))) (-> *part-id-table* 2895 init-specs 3 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) (set! (-> s4-1 trans quad) (-> gp-0 quad)) @@ -1003,7 +1003,7 @@ (launch-part this s3-0) ) (let ((s3-1 (new 'stack-no-clear 'matrix)) - (f30-1 (fmin 1.0 (* 0.000008138021 f30-0))) + (f30-1 (fmin 1.0 (/ f30-0 (meters 30)))) (f28-0 (-> *part-id-table* 2895 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-1 s4-1 *up-vector*) diff --git a/goal_src/jak3/levels/forest/for-turret-shot.gc b/goal_src/jak3/levels/forest/for-turret-shot.gc index c16e115185b..b386e83ce60 100644 --- a/goal_src/jak3/levels/forest/for-turret-shot.gc +++ b/goal_src/jak3/levels/forest/for-turret-shot.gc @@ -374,7 +374,7 @@ (launch-particles (-> *part-id-table* 1066) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000008138021 f30-0)) + (f26-0 (/ f30-0 (meters 30))) (f30-1 (-> *part-id-table* 1067 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 1067 init-specs 5 initial-valuef)) ) diff --git a/goal_src/jak3/levels/forest/for-turret.gc b/goal_src/jak3/levels/forest/for-turret.gc index f652170e99a..28fafd5f13d 100644 --- a/goal_src/jak3/levels/forest/for-turret.gc +++ b/goal_src/jak3/levels/forest/for-turret.gc @@ -285,7 +285,7 @@ ) (vector-cvt.w.s! (the-as vector (-> this sprites 28 color-ptr)) sv-312) (set! (-> this sprites 28 color w) - (the int (* 0.0078125 (-> this fade-interp) (lerp-scale 0.0 128.0 f30-0 1820.4445 3640.889))) + (the int (* (/ (-> this fade-interp) 128) (lerp-scale 0.0 128.0 f30-0 1820.4445 3640.889))) ) ) (let ((s2-6 set-as-offset-from!) diff --git a/goal_src/jak3/levels/forest/foresta-obs.gc b/goal_src/jak3/levels/forest/foresta-obs.gc index 139f16de22f..dfb30043ee1 100644 --- a/goal_src/jak3/levels/forest/foresta-obs.gc +++ b/goal_src/jak3/levels/forest/foresta-obs.gc @@ -469,7 +469,7 @@ (let ((f0-7 1.0)) (let ((f1-3 (- (-> self extend-height) (-> self root trans y)))) (if (< f1-3 4096.0) - (set! f0-7 (* 0.00024414062 f1-3)) + (set! f0-7 (/ f1-3 METER_LENGTH)) ) ) (sound-play-by-name diff --git a/goal_src/jak3/levels/glider/glider-manager.gc b/goal_src/jak3/levels/glider/glider-manager.gc index 4e1ea1abc08..7a48379f2e7 100644 --- a/goal_src/jak3/levels/glider/glider-manager.gc +++ b/goal_src/jak3/levels/glider/glider-manager.gc @@ -1097,7 +1097,7 @@ (b! (not s3-1) cfg-86 :delay (nop!)) (let ((f0-16 (vector-vector-xz-distance (-> s3-1 rbody matrix trans) (-> s5-2 pos)))) (let ((f1-1 (- (-> s3-1 rbody matrix trans y) (-> s5-2 pos y)))) - (if (< (* 0.5 (-> s5-2 hheight)) f1-1) + (if (< (/ (-> s5-2 hheight) 2) f1-1) (set! (-> s5-2 hheight) (* 2.0 f1-1)) ) ) @@ -1107,7 +1107,7 @@ (when (not (cpad-hold? 0 r2)) (vector+! s4-3 (-> s3-1 rbody matrix trans) (-> s5-2 pos)) (vector-float*! (-> s5-2 pos) s4-3 0.5) - (set! (-> s5-2 pos w) (* 0.5 f0-16)) + (set! (-> s5-2 pos w) (/ f0-16 2)) (set! (-> s5-2 thermal-time) (- (current-time) (-> this thermal-start-time))) (set! (-> this creating-thermal?) #f) ) @@ -1220,10 +1220,10 @@ (set! (-> arg0 min-thermal-time) (-> s3-0 thermal-time)) (set! (-> this last-active-thermal) s2-0) ) - (if (< (-> s4-1 y) (- (+ (-> s3-0 pos y) (-> s3-0 hheight)) (* 0.5 (-> s3-0 hheight)))) + (if (< (-> s4-1 y) (- (+ (-> s3-0 pos y) (-> s3-0 hheight)) (/ (-> s3-0 hheight) 2))) (set! (-> arg0 thermal-strength) 1.0) (set! (-> arg0 thermal-strength) - (/ (- (+ (-> s3-0 pos y) (-> s3-0 hheight)) (-> s4-1 y)) (* 0.5 (-> s3-0 hheight))) + (/ (- (+ (-> s3-0 pos y) (-> s3-0 hheight)) (-> s4-1 y)) (/ (-> s3-0 hheight) 2)) ) ) ) diff --git a/goal_src/jak3/levels/glider/h-glider.gc b/goal_src/jak3/levels/glider/h-glider.gc index 9aefd05241f..164ca02e6a4 100644 --- a/goal_src/jak3/levels/glider/h-glider.gc +++ b/goal_src/jak3/levels/glider/h-glider.gc @@ -982,7 +982,7 @@ (set-vector! s3-0 4096.0 0.0 0.0 1.0) 0.0 (let ((s1-3 (new 'stack-no-clear 'matrix))) - (let ((f0-56 (* 16384.0 (fmax -1.0 (fmin 1.0 (* 0.0000000012207031 (-> this rbody ang-velocity y) (fabs f30-2)))))) + (let ((f0-56 (* 16384.0 (fmax -1.0 (fmin 1.0 (* (/ (-> this rbody ang-velocity y) (meters 200000)) (fabs f30-2)))))) ) (matrix-rotate-y! s1-3 f0-56) ) diff --git a/goal_src/jak3/levels/hiphog/ltnfxhip-texture.gc b/goal_src/jak3/levels/hiphog/ltnfxhip-texture.gc index 530c626bc5f..a97a0626942 100644 --- a/goal_src/jak3/levels/hiphog/ltnfxhip-texture.gc +++ b/goal_src/jak3/levels/hiphog/ltnfxhip-texture.gc @@ -163,8 +163,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) diff --git a/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc b/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc index 9c7991e8f7a..c042cb3c215 100644 --- a/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc +++ b/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc @@ -237,7 +237,8 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (while *scene-player* (suspend) ) @@ -274,7 +275,8 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 325) :mat-joint gp-1) ) ) - (suspend-for (seconds 0.1)) + (suspend-for (seconds 0.1) + ) (logior! (-> self draw status) (draw-control-status no-draw)) (let ((t0-2 (res-lump-struct (-> self entity) 'camera-name structure))) (if t0-2 @@ -792,7 +794,7 @@ (cspace<-parented-transformq-joint! arg0 arg1) (dotimes (s4-0 (length *dark-eco-tower-waves*)) (let* ((s3-0 (-> *dark-eco-tower-waves* s4-0)) - (f0-2 (- (* 0.000012207031 (-> arg0 bone transform trans y)) + (f0-2 (- (/ (-> arg0 bone transform trans y) (meters 20)) (* 0.0033333334 (the float (current-time)) (-> s3-0 freq)) ) ) diff --git a/goal_src/jak3/levels/mine/gekko.gc b/goal_src/jak3/levels/mine/gekko.gc index 5da6f47688c..1a82bb3696f 100644 --- a/goal_src/jak3/levels/mine/gekko.gc +++ b/goal_src/jak3/levels/mine/gekko.gc @@ -1673,7 +1673,7 @@ :event enemy-event-handler :enter (behavior () (set! (-> self move-speed) (vector-length (-> self root transv))) - (set! (-> self move-decel) (fmax 163840.0 (* 0.00012207031 (-> self move-speed) (-> self move-speed)))) + (set! (-> self move-decel) (fmax 163840.0 (* (/ (-> self move-speed) (meters 2)) (-> self move-speed)))) (set-time! (-> self state-time)) ) :trans (behavior () @@ -1948,7 +1948,8 @@ (ja-channel-push! 1 (seconds 0.4)) (ja-no-eval :group! gekko-run0-a-ja :num! (seek!) :frame-num 0.0) (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) - (suspend-for (seconds 0.4)) + (suspend-for (seconds 0.4) + ) (if (enemy-method-109 self) (go-die self) (go-hostile self) @@ -2012,7 +2013,7 @@ ) (set! (-> a0-2 0 quad) (-> s3-0 trans quad)) (set! (-> a0-2 0 w) - (+ 409.6 sv-560 (sqrtf (+ (* 25600.0 (-> gp-0 scale) (-> gp-0 scale)) (* 0.25 f30-0 f30-0)))) + (+ 409.6 sv-560 (sqrtf (+ (* 25600.0 (-> gp-0 scale) (-> gp-0 scale)) (* (/ f30-0 4) f30-0)))) ) (let ((a1-6 s2-0)) (set! (-> a1-6 best-dist) (the-as float a0-2)) @@ -2044,7 +2045,7 @@ ) ) ) - (vector+float*! (-> s2-0 start-pos) sv-1008 v1-28 (* 0.5 f30-0)) + (vector+float*! (-> s2-0 start-pos) sv-1008 v1-28 (/ f30-0 2)) (vector-float*! (-> s2-0 move-dist) v1-28 (- f30-0)) ) (let ((v1-29 s2-0)) @@ -2640,6 +2641,7 @@ ) ) +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this gekko)) (local-vars (v1-18 gekko-shadow-spot)) (let ((s5-0 (handle->process (-> this ragdoll-proc)))) diff --git a/goal_src/jak3/levels/mine/manta.gc b/goal_src/jak3/levels/mine/manta.gc index 910922cf375..27c7f541d09 100644 --- a/goal_src/jak3/levels/mine/manta.gc +++ b/goal_src/jak3/levels/mine/manta.gc @@ -1204,7 +1204,7 @@ ) (vector-! (-> this move-matrix trans) (-> this focus-pos) (-> this move-matrix uvec)) (vector-normalize! (-> this move-matrix trans) 24576.0) - (set! (-> this move-matrix trans y) (* -0.5 (-> this move-matrix trans y))) + (set! (-> this move-matrix trans y) (/ (-> this move-matrix trans y) -2)) (matrix*! (-> this curve-matrix) *hermite-matrix* (-> this move-matrix)) 0 (none) diff --git a/goal_src/jak3/levels/mine/mine-obs.gc b/goal_src/jak3/levels/mine/mine-obs.gc index 89bfeef6ecf..bad64de41d5 100644 --- a/goal_src/jak3/levels/mine/mine-obs.gc +++ b/goal_src/jak3/levels/mine/mine-obs.gc @@ -569,7 +569,8 @@ (suspend) (ja :num! (seek! max 0.03)) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (go-virtual inactive) ) :post (behavior () @@ -616,7 +617,7 @@ (the float (sar (shl - (the int (+ (-> this wheel-angle) (* 182.04445 (seconds-per-frame) (* 0.00024414062 (-> this ang-momentum))))) + (the int (+ (-> this wheel-angle) (* 182.04445 (seconds-per-frame) (/ (-> this ang-momentum) METER_LENGTH)))) 48 ) 48 @@ -1318,7 +1319,8 @@ ) ) :code (behavior () - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (let ((a1-0 (new 'stack-no-clear 'array 'symbol 3))) (set! (-> a1-0 2) 'mine6) (set! (-> a1-0 1) 'mine5) @@ -1634,7 +1636,8 @@ :virtual #t :code (behavior () (sound-play "floor-switch") - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (when (not (task-node-closed? (game-task-node mine-blow-introduction))) (let ((a1-1 (new 'stack-no-clear 'array 'symbol 3))) (set! (-> a1-1 2) 'mine6) diff --git a/goal_src/jak3/levels/mine/prebot-extras.gc b/goal_src/jak3/levels/mine/prebot-extras.gc index 95036467b8e..e64214880a1 100644 --- a/goal_src/jak3/levels/mine/prebot-extras.gc +++ b/goal_src/jak3/levels/mine/prebot-extras.gc @@ -494,7 +494,7 @@ ) ) ) - (let ((f0-13 (* 0.002 f28-0))) + (let ((f0-13 (/ f28-0 500))) (fmin 0.1 f0-13) ) (let ((f28-4 (+ 0.0 @@ -505,7 +505,7 @@ ) ) (when (-> self use-pos-pitch) - (+! f28-4 (* 0.2 f26-0)) + (+! f28-4 (/ f26-0 5)) (when (and (-> self allow-whoosh) (< (fabs (-> s3-2 x)) (-> self whoosh-lead))) (set! (-> self allow-whoosh) #f) (sound-play "sword-whoosh-by" :position gp-0) diff --git a/goal_src/jak3/levels/mine/prebot-states.gc b/goal_src/jak3/levels/mine/prebot-states.gc index fc0e5813373..82fd54f0590 100644 --- a/goal_src/jak3/levels/mine/prebot-states.gc +++ b/goal_src/jak3/levels/mine/prebot-states.gc @@ -123,7 +123,6 @@ ) ) -;; WARN: Return type mismatch none vs object. (defbehavior prebot-common prebot () (dotimes (gp-0 20) (cond @@ -1028,7 +1027,7 @@ ) (if (= f30-0 0.0) (prebot-light-pulse-off) - (prebot-light-pulse-on (+ 0.2 (* 0.1 f30-0)) (+ 0.1 (* 0.04 f30-0)) 0.0) + (prebot-light-pulse-on (+ 0.2 (/ f30-0 10)) (+ 0.1 (/ f30-0 25)) 0.0) ) ) (when (>= (-> self num-attacks) (the-as uint (min 5 (-> gp-0 length)))) @@ -2519,6 +2518,7 @@ (none) ) +;; WARN: Return type mismatch connection vs none. (defmethod set-time-limit ((this task-manager-prebot)) (let ((t9-0 (method-of-type task-manager set-time-limit))) (t9-0 this) diff --git a/goal_src/jak3/levels/mine/rat.gc b/goal_src/jak3/levels/mine/rat.gc index 259301b9d40..cfdcfb3bd0c 100644 --- a/goal_src/jak3/levels/mine/rat.gc +++ b/goal_src/jak3/levels/mine/rat.gc @@ -961,7 +961,7 @@ (seek-toward-heading-vec! (-> self root) (-> self face-dir) - (* 0.5 (-> self nav max-rotation-rate)) + (/ (-> self nav max-rotation-rate) 2) (seconds 0.02) ) (nav-enemy-simple-post) @@ -1996,7 +1996,8 @@ (logior! (-> self entity extra perm status) (entity-perm-status subtask-complete)) ) :code (behavior () - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (while (-> self child) (suspend) ) diff --git a/goal_src/jak3/levels/nest/egg-spider.gc b/goal_src/jak3/levels/nest/egg-spider.gc index bacb680b751..6af228fd126 100644 --- a/goal_src/jak3/levels/nest/egg-spider.gc +++ b/goal_src/jak3/levels/nest/egg-spider.gc @@ -732,7 +732,7 @@ s5-1 s5-1 gp-0 - (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame)) ) ) 0 @@ -841,7 +841,7 @@ (set-time! (-> this last-change-dir)) (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-14 (* 0.5 f30-0 (tan (-> this move-angle)))) + (f0-14 (* (/ f30-0 2) (tan (-> this move-angle)))) (s2-1 (new 'stack-no-clear 'vector)) ) (if (-> this heading) @@ -1330,7 +1330,8 @@ (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 639)) ) ) - (suspend-for (seconds 0.6)) + (suspend-for (seconds 0.6) + ) (let ((v1-38 (-> self root root-prim))) (set! (-> v1-38 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-38 prim-core collide-with) (-> self root backup-collide-with)) @@ -1353,7 +1354,8 @@ ) ) ) - (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) + ) (ja-channel-push! 1 0) (ja-no-eval :group! egg-spider-crawl-from-ground-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak3/levels/nest/mh-centipede.gc b/goal_src/jak3/levels/nest/mh-centipede.gc index f6374f896b1..236f8b3a022 100644 --- a/goal_src/jak3/levels/nest/mh-centipede.gc +++ b/goal_src/jak3/levels/nest/mh-centipede.gc @@ -760,10 +760,10 @@ (v1-3 (-> self entity extra perm)) ) (logior! (-> v1-3 status) (entity-perm-status bit-5)) - (set! (-> v1-3 user-int16 0) (the int (* 0.00024414062 (-> (the-as vector a1-1) x)))) - (set! (-> v1-3 user-int16 1) (the int (* 0.00024414062 (-> (the-as vector a1-1) z)))) - (set! (-> v1-3 user-int16 2) (the int (* 0.00024414062 (-> (the-as vector a0-3) x)))) - (set! (-> v1-3 user-int16 3) (the int (* 0.00024414062 (-> (the-as vector a0-3) z)))) + (set! (-> v1-3 user-int16 0) (the int (/ (-> (the-as vector a1-1) x) METER_LENGTH))) + (set! (-> v1-3 user-int16 1) (the int (/ (-> (the-as vector a1-1) z) METER_LENGTH))) + (set! (-> v1-3 user-int16 2) (the int (/ (-> (the-as vector a0-3) x) METER_LENGTH))) + (set! (-> v1-3 user-int16 3) (the int (/ (-> (the-as vector a0-3) z) METER_LENGTH))) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual idle) @@ -1858,7 +1858,7 @@ (set! f0-14 (-> v1-50 damage)) ) (if (and (-> self next-state) (= (-> self next-state name) 'shooting)) - (set! f0-14 (* 0.5 f0-14)) + (set! f0-14 (/ f0-14 2)) ) (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) (set! f0-14 (* 0.6666667 f0-14)) @@ -2200,7 +2200,7 @@ (when (nonzero? (-> self breach-part)) (let ((f30-0 (-> *part-id-table* 2499 init-specs 2 initial-valuef))) (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) - (lerp-scale f30-0 (* 0.1 f30-0) (the float (- (current-time) (-> self state-time))) 0.0 150.0) + (lerp-scale f30-0 (/ f30-0 10) (the float (- (current-time) (-> self state-time))) 0.0 150.0) ) (spawn (-> self breach-part) (-> self launch-position)) (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) f30-0) @@ -2368,7 +2368,7 @@ (f28-1 (-> *part-id-table* 2508 init-specs 2 initial-valuef)) ) (set! (-> *part-id-table* 2507 init-specs 2 initial-valuef) - (lerp-scale f30-10 (* 0.05 f30-10) (the float (- (current-time) (-> self nose-smack-time))) 0.0 30.0) + (lerp-scale f30-10 (/ f30-10 20) (the float (- (current-time) (-> self nose-smack-time))) 0.0 30.0) ) (set! (-> *part-id-table* 2508 init-specs 2 initial-valuef) (lerp-scale f28-1 (* 0.0 f28-1) (the float (- (current-time) (-> self nose-smack-time))) 0.0 150.0) @@ -2486,7 +2486,7 @@ (when (nonzero? (-> self breach-part)) (let ((f30-1 (-> *part-id-table* 2499 init-specs 2 initial-valuef))) (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) - (lerp-scale f30-1 (* 0.1 f30-1) (the float (- (current-time) (-> self state-time))) 0.0 150.0) + (lerp-scale f30-1 (/ f30-1 10) (the float (- (current-time) (-> self state-time))) 0.0 150.0) ) (spawn (-> self breach-part) (-> self launch-position)) (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) f30-1) @@ -2652,7 +2652,7 @@ (f28-1 (-> *part-id-table* 2508 init-specs 2 initial-valuef)) ) (set! (-> *part-id-table* 2507 init-specs 2 initial-valuef) - (lerp-scale f30-11 (* 0.05 f30-11) (the float (- (current-time) (-> self nose-smack-time))) 0.0 30.0) + (lerp-scale f30-11 (/ f30-11 20) (the float (- (current-time) (-> self nose-smack-time))) 0.0 30.0) ) (set! (-> *part-id-table* 2508 init-specs 2 initial-valuef) (lerp-scale f28-1 (* 0.0 f28-1) (the float (- (current-time) (-> self nose-smack-time))) 0.0 150.0) diff --git a/goal_src/jak3/levels/precursor/precura-obs2.gc b/goal_src/jak3/levels/precursor/precura-obs2.gc index adfe87a2e2f..8735b4b8ee0 100644 --- a/goal_src/jak3/levels/precursor/precura-obs2.gc +++ b/goal_src/jak3/levels/precursor/precura-obs2.gc @@ -367,7 +367,7 @@ ) ) ) - (vector-float*! (-> s4-0 transv) s3-0 (* 0.1 (-> self clock frames-per-second))) + (vector-float*! (-> s4-0 transv) s3-0 (/ (-> self clock frames-per-second) 10)) ) (let ((v1-35 (-> s4-0 root-prim))) (set! (-> v1-35 prim-core collide-as) (-> s4-0 backup-collide-as)) @@ -908,7 +908,7 @@ (set! (-> gp-1 quad) (-> self root transv quad)) (let ((f0-9 32768.0)) (set! (-> gp-1 y) 0.0) - (let* ((f0-11 (* 0.000048828126 f0-9 (vector-length gp-1))) + (let* ((f0-11 (* (/ f0-9 (meters 5)) (vector-length gp-1))) (f30-0 (fmin 32768.0 f0-11)) ) (vector-normalize! gp-1 1.0) @@ -918,7 +918,7 @@ ) ) (quaternion*! (-> self root quat) (-> self spin-quat) (-> self root quat)) - (if (< (* 0.00024414062 (-> self root trans y)) 500.0) + (if (< (/ (-> self root trans y) METER_LENGTH) 500.0) (go-virtual explode) ) ) @@ -1658,7 +1658,8 @@ (let ((gp-0 (res-lump-data (-> self entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and gp-0 (nonzero? (-> sv-16 elt-count))) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (set! (-> self actor-group-count) (the-as int (-> sv-16 elt-count))) (set! (-> self actor-group) (the-as (pointer actor-group) gp-0)) (dotimes (gp-1 (length (-> self actor-group 0))) diff --git a/goal_src/jak3/levels/sewer/mh-wasp.gc b/goal_src/jak3/levels/sewer/mh-wasp.gc index 4f7cde4335c..1f7173a2eaf 100644 --- a/goal_src/jak3/levels/sewer/mh-wasp.gc +++ b/goal_src/jak3/levels/sewer/mh-wasp.gc @@ -830,7 +830,8 @@ 0 (set! (-> self hit-points) 0.0) (do-effect (-> self skel effect) (the-as string 'death-default) 0.0 -1) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (send-event self 'death-end) (cleanup-for-death self) ) @@ -972,10 +973,10 @@ (-> arg0 thrust s3-0) (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) (fmax 0.0 (-> v0-6 y)) - (fabs (* 0.2 (-> v0-6 z))) + (fabs (/ (-> v0-6 z) 5)) (fmax 0.0 (-> s1-1 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) @@ -999,7 +1000,7 @@ (set! (-> *part-id-table* 5032 init-specs 0 initial-valuef) (* f24-0 f0-15)) (set! (-> arg0 thrust s3-0) f28-0) (let ((f0-16 (* f26-0 f0-15))) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (* -0.5 f0-16)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (/ f0-16 -2)) ) ) ) diff --git a/goal_src/jak3/levels/sewer/saberfish.gc b/goal_src/jak3/levels/sewer/saberfish.gc index 40018d8bb20..9ce24bde58f 100644 --- a/goal_src/jak3/levels/sewer/saberfish.gc +++ b/goal_src/jak3/levels/sewer/saberfish.gc @@ -1553,7 +1553,7 @@ ) ) (until #f - (let* ((f0-1 (* 0.000061035156 (-> self swim-final-rotate-deg))) + (let* ((f0-1 (/ (-> self swim-final-rotate-deg) (meters 4))) (f0-2 (fmin 1.0 f0-1)) ) (let ((v1-19 (-> self skel root-channel 0)) @@ -3166,7 +3166,8 @@ ) (ja-channel-push! 1 0) (ja-no-eval :group! saberfish-flip-up-start-ja :num! (seek!) :frame-num 0.0) - (suspend-for (seconds 0.4)) + (suspend-for (seconds 0.4) + ) (ja-channel-push! 1 0) (ja-no-eval :group! saberfish-flip-up-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -3467,6 +3468,7 @@ ) ) +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this saberfish)) (let* ((s5-0 (handle->process (-> this ragdoll-proc))) (v0-0 diff --git a/goal_src/jak3/levels/sewer/sew-laser-turret.gc b/goal_src/jak3/levels/sewer/sew-laser-turret.gc index 9d7dbdcc0a5..0e05e2d75eb 100644 --- a/goal_src/jak3/levels/sewer/sew-laser-turret.gc +++ b/goal_src/jak3/levels/sewer/sew-laser-turret.gc @@ -514,7 +514,7 @@ (let ((a1-3 (new 'stack-no-clear 'vector))) (-> a0-2 y) (set! (-> a1-3 quad) (-> this node-list data arg1 bone transform fvec quad)) - (set! (-> a1-3 y) (* 0.5 (-> a1-3 y))) + (set! (-> a1-3 y) (/ (-> a1-3 y) 2)) (fire-laser! a0-2 a1-3 (the-as sew-laser-guard this) 491520.0) ) ) @@ -1054,9 +1054,12 @@ (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) 10240.0) - (suspend-for (seconds 2) (spawn (-> self part) gp-1)) + (suspend-for (seconds 2) + (spawn (-> self part) gp-1) + ) + ) + (suspend-for (seconds 1) ) - (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) diff --git a/goal_src/jak3/levels/sewer/sew-whirlpool.gc b/goal_src/jak3/levels/sewer/sew-whirlpool.gc index 74c9e15315c..6fe243672b0 100644 --- a/goal_src/jak3/levels/sewer/sew-whirlpool.gc +++ b/goal_src/jak3/levels/sewer/sew-whirlpool.gc @@ -32,7 +32,7 @@ (let* ((f26-0 (* 0.000016276043 (- 61440.0 f30-0))) (f24-0 98304.0) (f0-6 (atan (- (-> gp-0 x) (-> self root trans x)) (- (-> gp-0 z) (-> self root trans z)))) - (f28-0 (* 0.5 f26-0 f24-0 (seconds-per-frame))) + (f28-0 (* (/ f26-0 2) f24-0 (seconds-per-frame))) (f22-0 (+ f0-6 f28-0)) (f26-1 (- f30-0 (fmin f30-0 (* 0.16874999 f26-0 (fabs f24-0) (seconds-per-frame))))) (s5-0 (new 'stack-no-clear 'vector)) diff --git a/goal_src/jak3/levels/sewer/sewer-move-turret.gc b/goal_src/jak3/levels/sewer/sewer-move-turret.gc index 0de2b21437b..c15d9ded2e8 100644 --- a/goal_src/jak3/levels/sewer/sewer-move-turret.gc +++ b/goal_src/jak3/levels/sewer/sewer-move-turret.gc @@ -121,7 +121,7 @@ (let ((f1-1 1228.8)) (cond ((< f0-0 5.0) - (set! f1-1 (* 0.2 f0-0 f1-1)) + (set! f1-1 (* (/ f0-0 5) f1-1)) ) ((< 40.0 f0-0) (set! f1-1 (* 0.2 (- 45.0 f0-0) f1-1)) diff --git a/goal_src/jak3/levels/stadium/dm-mine-spider.gc b/goal_src/jak3/levels/stadium/dm-mine-spider.gc index 8504fa710be..0b9d5186e37 100644 --- a/goal_src/jak3/levels/stadium/dm-mine-spider.gc +++ b/goal_src/jak3/levels/stadium/dm-mine-spider.gc @@ -730,7 +730,7 @@ s5-1 s5-1 gp-0 - (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame)) ) ) 0 @@ -1055,14 +1055,16 @@ (set-time! (-> self state-time)) ) :code (behavior () - (suspend-for (seconds 0.6)) + (suspend-for (seconds 0.6) + ) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) ) (logclear! (-> self draw status) (draw-control-status no-draw)) (update-focus self) - (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))) + (suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))) + ) (ja-channel-push! 1 0) (ja-no-eval :group! dm-mine-spider-climb-start-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) diff --git a/goal_src/jak3/levels/stadium/rubble-part.gc b/goal_src/jak3/levels/stadium/rubble-part.gc index b33968c1fa4..9ef4c4ba7c1 100644 --- a/goal_src/jak3/levels/stadium/rubble-part.gc +++ b/goal_src/jak3/levels/stadium/rubble-part.gc @@ -256,8 +256,8 @@ ) (defun rub-elec-gate-adjust-particles ((arg0 float) (arg1 float) (arg2 float)) - (* 0.5 arg0) - (set! (-> *part-id-table* 3729 init-specs 3 initial-valuef) (- (* 0.5 arg1))) + (/ arg0 2) + (set! (-> *part-id-table* 3729 init-specs 3 initial-valuef) (- (/ arg1 2))) (set! (-> *part-id-table* 3729 init-specs 4 initial-valuef) arg0) (set! (-> *part-id-table* 3729 init-specs 5 initial-valuef) arg1) (set! (-> *part-id-table* 3729 init-specs 9 initial-valuef) (* 48.0 arg2)) diff --git a/goal_src/jak3/levels/temple/temple-obs.gc b/goal_src/jak3/levels/temple/temple-obs.gc index 4ac33ae7d8e..fcab1c11c9a 100644 --- a/goal_src/jak3/levels/temple/temple-obs.gc +++ b/goal_src/jak3/levels/temple/temple-obs.gc @@ -921,7 +921,8 @@ (until (process-grab? *target* #f) (suspend) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) ) ) (set-time! (-> self state-time)) @@ -938,11 +939,12 @@ ) (set! (-> self root scale x) (* f0-11 f0-11)) ) - (set! (-> self root scale y) (+ 1.0 (* 0.5 (-> self root scale x)))) + (set! (-> self root scale y) (+ 1.0 (/ (-> self root scale x) 2))) (set! (-> self root scale z) (-> self root scale x)) (when (= (-> self root scale x) 0.0) (send-event (handle->process (-> self perm-part)) 'die) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (until (process-release? *target*) (suspend) ) @@ -1733,24 +1735,27 @@ ) ) :code (behavior () - (suspend-for (the int (-> self cycle-offset))) + (suspend-for (the int (-> self cycle-offset)) + ) (until #f - (suspend-for (the int (-> self cycle-time))) + (suspend-for (the int (-> self cycle-time)) + ) (sound-play "fan-shake" :position (-> self root trans)) - (suspend-for (seconds 0.01) (let ((f0-5 (* 36408.89 (the float (- (current-time) time)))) - (f1-3 (* 0.33333334 (- 3.0 (the float (- (current-time) time))))) - ) - (set! (-> self shudder-angle) (* 0.0018204444 f1-3 (sin f0-5))) - ) - ) + (suspend-for (seconds 0.01) + (let ((f0-5 (* 36408.89 (the float (- (current-time) time)))) + (f1-3 (* 0.33333334 (- 3.0 (the float (- (current-time) time))))) + ) + (set! (-> self shudder-angle) (* 0.0018204444 f1-3 (sin f0-5))) + ) + ) (set! (-> self shudder-angle) 0.0) - (suspend-for (seconds 0.04)) + (suspend-for (seconds 0.04) + ) (sound-play "fan-turn" :position (-> self root trans)) (let* ((f0-9 100.0) (f30-1 (* 16384.0 f0-9)) ) - (suspend-for - (seconds 0.01) + (suspend-for (seconds 0.01) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) @@ -2122,7 +2127,8 @@ (script-eval (the-as pair gp-0)) ) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (cleanup-for-death self) (deactivate self) ) @@ -2283,7 +2289,8 @@ (script-eval (the-as pair gp-0)) ) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (cleanup-for-death self) (deactivate self) ) diff --git a/goal_src/jak3/levels/temple/temple-obs2.gc b/goal_src/jak3/levels/temple/temple-obs2.gc index f54a99ceca0..08bd167b979 100644 --- a/goal_src/jak3/levels/temple/temple-obs2.gc +++ b/goal_src/jak3/levels/temple/temple-obs2.gc @@ -785,7 +785,7 @@ ) ) (v1-10 (vector-! (new 'stack-no-clear 'vector) s3-0 (-> self root trans))) - (f30-0 (* 0.000024414063 f0-0)) + (f30-0 (/ f0-0 (meters 10))) (s2-0 vector-xz-normalize!) (a0-7 v1-10) ) diff --git a/goal_src/jak3/levels/temple/templea-texture.gc b/goal_src/jak3/levels/temple/templea-texture.gc index 2c434d7d7b7..bf6830f4766 100644 --- a/goal_src/jak3/levels/temple/templea-texture.gc +++ b/goal_src/jak3/levels/temple/templea-texture.gc @@ -309,8 +309,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) @@ -513,8 +513,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) diff --git a/goal_src/jak3/levels/volcano/volcano-obs.gc b/goal_src/jak3/levels/volcano/volcano-obs.gc index dc76babc0f7..6e208afc3af 100644 --- a/goal_src/jak3/levels/volcano/volcano-obs.gc +++ b/goal_src/jak3/levels/volcano/volcano-obs.gc @@ -64,7 +64,7 @@ :code sleep-code :post (behavior () (let ((f0-0 (cos (get-scaled-val! (-> self sync) 32768.0 0))) - (f1-1 (* 0.5 (-> self amplitude))) + (f1-1 (/ (-> self amplitude) 2)) ) (set! (-> self root trans y) (- (- (-> self init-y) f1-1) (* f0-0 f1-1))) ) @@ -925,7 +925,8 @@ (set! (-> self stopped-up-by) (the-as handle #f)) ) :code (behavior () - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) (set! (-> a1-0 num-params) 0) @@ -1587,7 +1588,7 @@ (send-event (handle->process (-> self ball)) 'push (* f28-0 f30-1)) (set! (-> *part-id-table* 4612 init-specs 2 initial-valuef) (* 10.0 f30-1 (- 1.0 f28-0))) (set! (-> *part-id-table* 4612 init-specs 13 initial-valuef) - (+ (* 6826.6665 f30-1 f28-0) (* 0.002 (-> self ball-height) f30-1 (- 1.0 f28-0))) + (+ (* 6826.6665 f30-1 f28-0) (* (/ (-> self ball-height) 500) f30-1 (- 1.0 f28-0))) ) ) 0 diff --git a/goal_src/jak3/levels/volcano/volcano-obs2.gc b/goal_src/jak3/levels/volcano/volcano-obs2.gc index 597b85dae1a..6828ce3e3cc 100644 --- a/goal_src/jak3/levels/volcano/volcano-obs2.gc +++ b/goal_src/jak3/levels/volcano/volcano-obs2.gc @@ -848,7 +848,7 @@ ) ) ) - (set! (-> self player-force y) (* 0.1 (-> self player-force y))) + (set! (-> self player-force y) (/ (-> self player-force y) 10)) (if (and (logtest? (-> self rbody flags) (rigid-body-flag enable-physics)) (< (vector-length (-> self root transv)) 4096.0) (< (* (vector-length (-> self rbody lin-momentum)) (-> self info info inv-mass)) 2457.6) @@ -915,7 +915,7 @@ (set! (-> s4-1 quad) (-> this to-hole-vec quad)) (let ((s3-1 (new 'stack-no-clear 'vector))) (set! (-> s3-1 quad) (-> this rbody position quad)) - (set! (-> s4-1 y) (* -0.1 (-> s4-1 y))) + (set! (-> s4-1 y) (/ (-> s4-1 y) -10)) (vector-float*! s4-1 s4-1 (lerp-scale 0.0 30.0 (-> this hole-dist-xz) 20480.0 4096.0)) (apply-impact! (-> this rbody) s3-1 s4-1) ) diff --git a/goal_src/jak3/levels/volcano/volcano-scenes.gc b/goal_src/jak3/levels/volcano/volcano-scenes.gc index f656207feff..b6174628065 100644 --- a/goal_src/jak3/levels/volcano/volcano-scenes.gc +++ b/goal_src/jak3/levels/volcano/volcano-scenes.gc @@ -538,8 +538,8 @@ (vector+! s4-0 s4-0 s3-0) ) (set! (-> *part-id-table* 659 init-specs 2 initial-valuef) (-> *vol-invis-joint-list* s5-0 size)) - (set! (-> *part-id-table* 659 init-specs 3 initial-valuef) (* 0.5 (-> *vol-invis-joint-list* s5-0 size))) - (set! (-> *part-id-table* 659 init-specs 4 initial-valuef) (* 0.5 (-> *vol-invis-joint-list* s5-0 size))) + (set! (-> *part-id-table* 659 init-specs 3 initial-valuef) (/ (-> *vol-invis-joint-list* s5-0 size) 2)) + (set! (-> *part-id-table* 659 init-specs 4 initial-valuef) (/ (-> *vol-invis-joint-list* s5-0 size) 2)) (launch-particles (-> *part-id-table* 659) s4-0) ) ) diff --git a/goal_src/jak3/levels/volcano/volcanox-obs.gc b/goal_src/jak3/levels/volcano/volcanox-obs.gc index 2679466204b..1bd802639b3 100644 --- a/goal_src/jak3/levels/volcano/volcanox-obs.gc +++ b/goal_src/jak3/levels/volcano/volcanox-obs.gc @@ -360,7 +360,8 @@ (until (process-grab? *target* #f) (suspend) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) ) ) (set-time! (-> self state-time)) @@ -377,11 +378,12 @@ ) (set! (-> self root scale x) (* f0-11 f0-11)) ) - (set! (-> self root scale y) (+ 1.0 (* 0.5 (-> self root scale x)))) + (set! (-> self root scale y) (+ 1.0 (/ (-> self root scale x) 2))) (set! (-> self root scale z) (-> self root scale x)) (when (= (-> self root scale x) 0.0) (send-event (handle->process (-> self perm-part)) 'die) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (until (process-release? *target*) (suspend) ) diff --git a/goal_src/jak3/levels/volcano/volcanox-texture.gc b/goal_src/jak3/levels/volcano/volcanox-texture.gc index 3ccfe378d05..f65591b73fa 100644 --- a/goal_src/jak3/levels/volcano/volcanox-texture.gc +++ b/goal_src/jak3/levels/volcano/volcanox-texture.gc @@ -163,8 +163,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) diff --git a/goal_src/jak3/levels/wascity/ctymark-obs.gc b/goal_src/jak3/levels/wascity/ctymark-obs.gc index 090c849536a..0e05ddd3cf2 100644 --- a/goal_src/jak3/levels/wascity/ctymark-obs.gc +++ b/goal_src/jak3/levels/wascity/ctymark-obs.gc @@ -1172,7 +1172,7 @@ 0.0 0.0 0.0 - (let* ((f28-0 (/ 1.0 (* 0.00024414062 (-> arg1 omega)))) + (let* ((f28-0 (/ 1.0 (/ (-> arg1 omega) METER_LENGTH))) (f26-0 (* (rand-vu-float-range -136.53334 136.53334) f28-0)) (f30-0 (* (rand-vu-float-range 0.0 136.53334) f28-0)) (f0-8 (* (rand-vu-float-range -13.653334 54.613335) f28-0)) diff --git a/goal_src/jak3/levels/wascity/defend/was-pre-game.gc b/goal_src/jak3/levels/wascity/defend/was-pre-game.gc index b62b89a1a93..9700b7c9d84 100644 --- a/goal_src/jak3/levels/wascity/defend/was-pre-game.gc +++ b/goal_src/jak3/levels/wascity/defend/was-pre-game.gc @@ -596,8 +596,8 @@ (let* ((a0-1 (-> arg4 control)) (v1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg2 x-y-z-sx) (-> a0-1 origin trans))) ) - (set! (-> arg1 vel-sxvel x) (* 0.083333336 (-> v1-1 x))) - (set! (-> arg1 vel-sxvel y) (* 0.083333336 (-> v1-1 y))) + (set! (-> arg1 vel-sxvel x) (/ (-> v1-1 x) 12)) + (set! (-> arg1 vel-sxvel y) (/ (-> v1-1 y) 12)) ) 0 (none) @@ -938,9 +938,9 @@ (let* ((a0-1 (-> arg4 control)) (v1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg2 x-y-z-sx) (-> a0-1 origin trans))) ) - (set! (-> arg1 vel-sxvel x) (* -0.008333334 (-> v1-1 x))) - (set! (-> arg1 vel-sxvel y) (* -0.008333334 (-> v1-1 y))) - (set! (-> arg1 vel-sxvel z) (* -0.008333334 (-> v1-1 z))) + (set! (-> arg1 vel-sxvel x) (/ (-> v1-1 x) -120)) + (set! (-> arg1 vel-sxvel y) (/ (-> v1-1 y) -120)) + (set! (-> arg1 vel-sxvel z) (/ (-> v1-1 z) -120)) ) 0 (none) @@ -1807,7 +1807,8 @@ ) ) ) - (suspend-for (-> self start-delay)) + (suspend-for (-> self start-delay) + ) (go-virtual fall) ) :post (behavior () @@ -2073,7 +2074,8 @@ (sound-play "lose-icon") (send-event (ppointer->process (-> self parent)) 'done) (set! (-> self post-hook) #f) - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) ) :post (behavior () (vector-normalize! @@ -3037,19 +3039,19 @@ ) (cond ((zero? a0-7) - (set-vector! v1-6 0.0 (* 90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 1.0) + (set-vector! v1-6 0.0 (* 90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 1.0) ) ((= a0-7 1) - (set-vector! v1-6 (* 90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 0.0 1.0) + (set-vector! v1-6 (* 90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 0.0 1.0) ) ((= a0-7 2) - (set-vector! v1-6 0.0 (* -90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 1.0) + (set-vector! v1-6 0.0 (* -90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 1.0) ) ((= a0-7 2) - (set-vector! v1-6 0.0 (* 90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 1.0) + (set-vector! v1-6 0.0 (* 90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 1.0) ) ((= a0-7 3) - (set-vector! v1-6 (* -90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 0.0 1.0) + (set-vector! v1-6 (* -90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 0.0 1.0) ) ) ) @@ -3099,16 +3101,16 @@ ) (cond ((zero? a0-7) - (set-vector! v1-6 0.0 (* 90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 1.0) + (set-vector! v1-6 0.0 (* 90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 1.0) ) ((= a0-7 1) - (set-vector! v1-6 (* 90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 0.0 1.0) + (set-vector! v1-6 (* 90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 0.0 1.0) ) ((= a0-7 2) - (set-vector! v1-6 0.0 (* -90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 1.0) + (set-vector! v1-6 0.0 (* -90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 1.0) ) ((= a0-7 3) - (set-vector! v1-6 (* -90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 0.0 1.0) + (set-vector! v1-6 (* -90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 0.0 1.0) ) ) ) diff --git a/goal_src/jak3/levels/wascity/dm-flyer.gc b/goal_src/jak3/levels/wascity/dm-flyer.gc index af71a88ae00..76f20e0558e 100644 --- a/goal_src/jak3/levels/wascity/dm-flyer.gc +++ b/goal_src/jak3/levels/wascity/dm-flyer.gc @@ -330,7 +330,7 @@ ) ((= v1-0 (projectile-options po0 po1)) (let* ((f0-0 (vector-vector-distance (target-pos 0) (-> this root trans))) - (f0-2 (+ 0.3 (* 0.0000012207031 f0-0))) + (f0-2 (+ 0.3 (/ f0-0 (meters 200)))) ) (sound-play-by-name (static-sound-name "missile-travel") diff --git a/goal_src/jak3/levels/wascity/tizard.gc b/goal_src/jak3/levels/wascity/tizard.gc index 3d6406435e9..4c6fe8f12cf 100644 --- a/goal_src/jak3/levels/wascity/tizard.gc +++ b/goal_src/jak3/levels/wascity/tizard.gc @@ -73,7 +73,8 @@ :code (behavior () (when (-> self first-run?) (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 0.05 0.12))))) - (suspend-for gp-0) + (suspend-for gp-0 + ) ) (set! (-> self path-base-u) (the float (rand-vu-int-count (-> self path curve num-cverts)))) (get-point-in-path! (-> self path) (-> self root trans) (-> self path-base-u) 'interp) @@ -154,7 +155,8 @@ :event tizard-event-handler :code (behavior () (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 1.0 2.0))))) - (suspend-for gp-0) + (suspend-for gp-0 + ) ) (if (< 17294.223 (acos (vector-dot (-> self rotation-matrix fvec) (-> self path-dir)))) (go-virtual turning) @@ -186,7 +188,7 @@ ) (quaternion-normalize! s4-1) (quaternion-normalize! s3-0) - (dotimes (s2-0 (the int (* 0.000061035156 f30-0))) + (dotimes (s2-0 (the int (/ f30-0 (meters 4)))) (cond (s5-0 (ja-no-eval :group! tizard-turn-left0-ja :num! (seek!) :frame-num 0.0) diff --git a/goal_src/jak3/levels/wascity/wascity-turret.gc b/goal_src/jak3/levels/wascity/wascity-turret.gc index bf015c6b782..964274f84cf 100644 --- a/goal_src/jak3/levels/wascity/wascity-turret.gc +++ b/goal_src/jak3/levels/wascity/wascity-turret.gc @@ -379,7 +379,7 @@ (if (< (-> s2-0 z) 0.0) (set! f0-6 (- f0-6)) ) - (set! (-> s3-1 x) (* 0.000061035156 f0-6)) + (set! (-> s3-1 x) (/ f0-6 (meters 4))) ) (let ((f0-13 (atan (-> s2-0 y) (sqrtf (+ (* (-> s2-0 x) (-> s2-0 x)) (* (-> s2-0 z) (-> s2-0 z))))))) (set! (-> s3-1 y) (* -0.00014085036 f0-13)) @@ -696,7 +696,8 @@ (set! (-> self facing-ocean) #t) (set! (-> self facing-city) #f) (set! (-> self reset-facing) #f) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (sound-play "jump-in-turret") (let* ((v1-9 (-> *game-info* sub-task-list (game-task-node wascity-gungame-resolution))) (a0-4 (handle->process (if (-> v1-9 manager) @@ -1374,7 +1375,7 @@ (set! (-> s0-1 quad) (-> s1-1 quad)) (when (= (-> s2-2 type) skeet) (set! sv-960 s2-2) - (let ((f28-1 (* 0.00000013563368 f28-0))) + (let ((f28-1 (/ f28-0 (meters 1800)))) (if #f (add-debug-sphere #t (bucket-id debug) s1-1 (meters 12) *color-red*) ) @@ -1636,7 +1637,7 @@ (if (< (-> s4-0 z) 0.0) (set! f0-4 (- f0-4)) ) - (set! (-> s5-0 x) (* 0.000061035156 f0-4)) + (set! (-> s5-0 x) (/ f0-4 (meters 4))) ) (let ((f0-11 (atan (-> s4-0 y) (sqrtf (+ (* (-> s4-0 x) (-> s4-0 x)) (* (-> s4-0 z) (-> s4-0 z))))))) (set! (-> s5-0 y) (* -0.00014085036 f0-11)) diff --git a/goal_src/jak3/levels/wascity/wasdef-manager.gc b/goal_src/jak3/levels/wascity/wasdef-manager.gc index 9f67723fcdc..fbacf936853 100644 --- a/goal_src/jak3/levels/wascity/wasdef-manager.gc +++ b/goal_src/jak3/levels/wascity/wasdef-manager.gc @@ -1219,7 +1219,7 @@ 0.0 (set-vector! v1-0 6583861.5 0.0 -1960301.9 1.0) (let ((f0-5 (vector-vector-xz-distance v1-0 arg0))) - (- 36864.0 (* 0.1 f0-5)) + (- 36864.0 (/ f0-5 10)) ) ) ) @@ -1629,7 +1629,8 @@ (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) ) - (suspend-for (seconds 4)) + (suspend-for (seconds 4) + ) ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -2047,7 +2048,8 @@ :code (behavior () (maker-method-38 self) (set! *maker-num-visible* (+ *maker-num-visible* -1)) - (suspend-for (seconds 3)) + (suspend-for (seconds 3) + ) (if (nonzero? (-> self explosion-sound-id)) (set-action! *gui-control* diff --git a/goal_src/jak3/levels/wascity/wasgun-hud.gc b/goal_src/jak3/levels/wascity/wasgun-hud.gc index 7d296fa8641..0c5f7573fa3 100644 --- a/goal_src/jak3/levels/wascity/wasgun-hud.gc +++ b/goal_src/jak3/levels/wascity/wasgun-hud.gc @@ -151,7 +151,7 @@ (set! (-> s4-2 y) (+ (the int (-> s3-3 y)) -50)) 1.0 (let ((s2-3 (min 2 (the int (* 3.0 (-> this minfo s5-3 hit-points)))))) - (let ((f0-48 (* 0.00005 (-> s3-3 z)))) + (let ((f0-48 (/ (-> s3-3 z) 20000))) (set! (-> this reticle s2-3 scale-x) f0-48) (set! (-> this reticle s2-3 scale-y) f0-48) ) diff --git a/goal_src/jak3/levels/wascity/wasgun-manager.gc b/goal_src/jak3/levels/wascity/wasgun-manager.gc index 38c31cb4ec5..a7a2cde65f6 100644 --- a/goal_src/jak3/levels/wascity/wasgun-manager.gc +++ b/goal_src/jak3/levels/wascity/wasgun-manager.gc @@ -1278,7 +1278,8 @@ (logior! (-> self minimap flags) (minimap-flag fade-out)) (set! (-> self minimap) #f) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (sound-play "point-missed" :position (wascity-turret-gun-pos)) (let ((v1-49 (handle->process (-> self mgr)))) (when v1-49 @@ -2296,10 +2297,10 @@ (format #t "((sktpos ~f ~f) ~f ~f)~%" - (* 0.00024414062 (-> arg2 x)) - (* 0.00024414062 (-> arg2 z)) + (/ (-> arg2 x) METER_LENGTH) + (/ (-> arg2 z) METER_LENGTH) (* 0.005493164 arg3) - (* 0.00024414062 s2-1) + (/ s2-1 METER_LENGTH) ) (spawn-skeet arg0 arg1 arg2 arg3 s2-1) ) diff --git a/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc b/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc index 8957996575a..eb02d0ec0ee 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc @@ -1006,7 +1006,7 @@ (let ((v1-6 gp-1)) (set! (-> v1-6 height) (the float 70)) ) - (set! (-> gp-1 origin x) (the float (- 256 (the int (* 0.5 (-> gp-1 width)))))) + (set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2))))) (set! (-> gp-1 origin y) 320.0) (set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s5-0 print-game-text)) @@ -1081,7 +1081,8 @@ ) ) :code (behavior () - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (set! *arena-trainer-checkpoint-valid* #t) (copy-string<-string (-> *training-fail* fail continue) "wasstada-checkpoint-3") (set-setting! 'death-info *training-fail* 0.0 0) @@ -1299,7 +1300,8 @@ ) (suspend) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (send-event self 'death-end) (while (-> self child) (suspend) diff --git a/goal_src/jak3/levels/wascity/wasstadium/wasstadc-obs.gc b/goal_src/jak3/levels/wascity/wasstadium/wasstadc-obs.gc index 636137a3d77..eda9b809f92 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/wasstadc-obs.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/wasstadc-obs.gc @@ -378,7 +378,8 @@ (suspend) (ja :num! (seek!)) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (ja-no-eval :group! wstd-fight-house-a-open-ja :num! (seek! 0.0) :frame-num 5.0) (until (ja-done? 0) (suspend) @@ -774,7 +775,7 @@ (goto cfg-20) ) (let ((f0-2 (lerp-scale 0.0 1.0 (-> self root trans y) 49152.0 40960.0))) - (set-vector! (-> self draw color-mult) (+ 1.0 f0-2) (- 1.0 (* 0.5 f0-2)) (- 1.0 f0-2) 1.0) + (set-vector! (-> self draw color-mult) (+ 1.0 f0-2) (- 1.0 (/ f0-2 2)) (- 1.0 f0-2) 1.0) ) (set! (-> self delta-y) (* (-> self depth) (- (sin f30-0)))) (+! f30-0 (* 3276.8 (seconds-per-frame))) @@ -808,7 +809,7 @@ (set! f30-0 0.0) ) (let ((f0-21 (lerp-scale 0.0 1.0 (-> self root trans y) 49152.0 40960.0))) - (set-vector! (-> self draw color-mult) (+ 1.0 f0-21) (- 1.0 (* 0.5 f0-21)) (- 1.0 f0-21) 1.0) + (set-vector! (-> self draw color-mult) (+ 1.0 f0-21) (- 1.0 (/ f0-21 2)) (- 1.0 f0-21) 1.0) ) (sound-play-by-spec gp-1 (-> self ambient-sound-id) (-> self root trans)) (suspend) @@ -2141,7 +2142,8 @@ ) (let ((gp-1 (-> *game-info* gun-type))) (set-setting! 'change-gun #t 0.0 0) - (suspend-for (seconds 5)) + (suspend-for (seconds 5) + ) (set! (-> self gui-id) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -2156,7 +2158,9 @@ (send-event (-> v1-33 extra process) 'off) ) ) - (suspend-for (seconds 2) (print-text self (-> self text-id))) + (suspend-for (seconds 2) + (print-text self (-> self text-id)) + ) (send-event self 'complete) (until #f (suspend) @@ -2210,7 +2214,8 @@ ) (let ((gp-2 32)) (set-setting! 'change-gun #t 0.0 0) - (suspend-for (seconds 5)) + (suspend-for (seconds 5) + ) (set! (-> self gui-id) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -2224,7 +2229,9 @@ (send-event (-> v1-38 extra process) 'off) ) ) - (suspend-for (seconds 2) (print-text self (-> self text-id))) + (suspend-for (seconds 2) + (print-text self (-> self text-id)) + ) (send-event self 'complete) (until #f (suspend) @@ -2427,7 +2434,8 @@ (send-event (handle->process (-> self arrow-h)) 'leave) (send-event *target* 'end-mode 'darkjak) (send-event *target* 'end-mode 'grab) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (go-virtual complete) ) ) diff --git a/goal_src/jak3/levels/wascity/wlander-male.gc b/goal_src/jak3/levels/wascity/wlander-male.gc index 80d61a5ead6..305e4bfe9e8 100644 --- a/goal_src/jak3/levels/wascity/wlander-male.gc +++ b/goal_src/jak3/levels/wascity/wlander-male.gc @@ -377,7 +377,7 @@ s5-0 s5-0 gp-0 - (* (+ 1.0 (* 0.00024414062 (-> this nav state speed))) (seconds-per-frame)) + (* (+ 1.0 (/ (-> this nav state speed) METER_LENGTH)) (seconds-per-frame)) ) ) 0 diff --git a/goal_src/jak3/pc/debug/default-menu-pc.gc b/goal_src/jak3/pc/debug/default-menu-pc.gc index 4c1705287a4..24635bc01bb 100644 --- a/goal_src/jak3/pc/debug/default-menu-pc.gc +++ b/goal_src/jak3/pc/debug/default-menu-pc.gc @@ -988,6 +988,7 @@ (flag "Joint names" *display-joint-names* dm-boolean-toggle-pick-func) (flag "Bone lines" *display-bones* dm-boolean-toggle-pick-func) (flag "Entity Lights" *display-lights* dm-boolean-toggle-pick-func) + (flag "Cloth Spheres" *display-cloth-spheres* dm-boolean-toggle-pick-func) (flag "Debug Font Auto-Scale" #f ,(dm-lambda-boolean-flag (-> *pc-settings* debug-font-scale-auto?))) (float-var "Debug Font Scale" #f ,(dm-lambda-float-var (-> *pc-settings* debug-font-scale)) 2 (new 'static 'bfloat :data 0.01) #t (new 'static 'bfloat :data 0.1) 2 0) ) diff --git a/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc b/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc index b1595de58fb..730ff6e588e 100644 --- a/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc @@ -517,7 +517,7 @@ ) (+! (-> s4-0 y) (* 40.96 (-> s3-0 normal y))) (set! (-> s4-0 w) 1.0) - (set! (-> s5-1 rspeed) (* 0.5 (-> s5-1 rspeed))) + (set! (-> s5-1 rspeed) (/ (-> s5-1 rspeed) 2)) ) ) (set! v1-2 (-> s5-1 next)) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc index c6ea4d3bf3b..a3e06fb2021 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc @@ -1235,7 +1235,7 @@ (defun fov->maya ((arg0 float)) (the-as float (if (= arg0 0.0) 0.0 - (/ 12.700255 (tan (* 0.5 arg0))) + (/ 12.700255 (tan (/ arg0 2))) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc index 1bbc961d292..1d3d7a771d1 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc @@ -427,10 +427,10 @@ (let ((f30-0 (vector-dot gp-6 (-> self local-down)))) (vector--float*! gp-6 gp-6 (-> self local-down) f30-0) (if (< 0.0 f30-0) - (set! (-> self upspeed) (* 0.5 (-> self upspeed))) + (set! (-> self upspeed) (/ (-> self upspeed) 2)) ) (vector+! (-> self tpos-tgt) (-> self tpos-tgt) gp-6) - (let ((f0-30 (* 0.05 f30-0))) + (let ((f0-30 (/ f30-0 20))) (vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) f0-30) ) ) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc index eb78ff1cb94..9b33ecef63e 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc @@ -51,10 +51,10 @@ ) (cond ((cpad-hold? (-> *CAMERA-bank* joypad) r2) - (set! (-> s5-0 y) (- (-> s5-0 y) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) - (set! (-> s5-0 x) (- (-> s5-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0)))) - (+! (-> gp-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f28-0)) - (+! (-> gp-0 z) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f30-0)) + (set! (-> s5-0 y) (- (-> s5-0 y) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f26-0)))) + (set! (-> s5-0 x) (- (-> s5-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f0-0)))) + (+! (-> gp-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f28-0)) + (+! (-> gp-0 z) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f30-0)) ) (else (set! (-> s5-0 y) (- (-> s5-0 y) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) @@ -203,13 +203,13 @@ ((cpad-hold? arg3 r2) (when *camera-read-buttons* (if (cpad-hold? arg3 r1) - (+! (-> arg1 y) (+ (* 0.2 (-> *CAM_FREE-bank* speed)) (analog-input - (the-as int (-> *cpad-list* cpads arg3 abutton 9)) - 0.0 - 32.0 - 230.0 - (* 0.2 (-> *CAM_FREE-bank* speed)) - ) + (+! (-> arg1 y) (+ (/ (-> *CAM_FREE-bank* speed) 5) (analog-input + (the-as int (-> *cpad-list* cpads arg3 abutton 9)) + 0.0 + 32.0 + 230.0 + (/ (-> *CAM_FREE-bank* speed) 5) + ) ) ) ) @@ -217,13 +217,13 @@ (when *camera-read-buttons* (if (cpad-hold? arg3 l1) (set! (-> arg1 y) - (- (-> arg1 y) (+ (* 0.2 (-> *CAM_FREE-bank* speed)) (analog-input - (the-as int (-> *cpad-list* cpads arg3 abutton 8)) - 0.0 - 32.0 - 230.0 - (* 0.2 (-> *CAM_FREE-bank* speed)) - ) + (- (-> arg1 y) (+ (/ (-> *CAM_FREE-bank* speed) 5) (analog-input + (the-as int (-> *cpad-list* cpads arg3 abutton 8)) + 0.0 + 32.0 + 230.0 + (/ (-> *CAM_FREE-bank* speed) 5) + ) ) ) ) @@ -317,16 +317,16 @@ ((cpad-hold? arg3 r2) (cond ((cpad-hold? arg3 l2) - (set! (-> arg0 y) (- (-> arg0 y) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f24-0)))) - (set! (-> arg0 x) (- (-> arg0 x) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f26-0)))) + (set! (-> arg0 y) (- (-> arg0 y) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f24-0)))) + (set! (-> arg0 x) (- (-> arg0 x) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f26-0)))) ) (else (set! (-> arg0 y) (- (-> arg0 y) (* (- f24-0) (-> *CAM_FREE-bank* rot-speed)))) (set! (-> arg0 x) (- (-> arg0 x) (* (- f26-0) (-> *CAM_FREE-bank* rot-speed)))) ) ) - (+! (-> arg1 x) (* 0.2 (-> *CAM_FREE-bank* speed) f28-14)) - (+! (-> arg1 z) (* 0.2 (-> *CAM_FREE-bank* speed) f30-14)) + (+! (-> arg1 x) (* (/ (-> *CAM_FREE-bank* speed) 5) f28-14)) + (+! (-> arg1 z) (* (/ (-> *CAM_FREE-bank* speed) 5) f30-14)) ) ((cpad-hold? arg3 l2) (+! (-> arg1 x) (* f28-14 (-> *CAM_FREE-bank* speed))) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc index 546f8258b5c..c9d6a5943aa 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc @@ -2331,7 +2331,7 @@ (f30-0 (-> self view-off-param)) ) (if (-> self have-phony-joystick) - (set! f28-0 (* 0.05 (-> self phony-joystick-y))) + (set! f28-0 (/ (-> self phony-joystick-y) 20)) ) (if (and (-> *camera* being-attacked) (not (time-elapsed? (-> *camera* attack-start) (seconds 0.25)))) (set! f28-0 0.05) @@ -2342,9 +2342,7 @@ (let ((f26-0 (fmin 1.0 f0-2))) (let ((f0-3 f26-0)) (when (< f26-0 0.0) - (let ((f0-6 - (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (* 0.5 (-> self string-min-val z))) - ) + (let ((f0-6 (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (/ (-> self string-min-val z) 2))) ) (set! f0-3 (fmin 0.75 f0-6)) ) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-update_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-update_REF.gc index 33068b7b9f3..35291b51260 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-update_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-update_REF.gc @@ -307,10 +307,10 @@ (format *stdcon* "~f ~f ~f ~f~%" - (* 0.00024414062 (-> s5-1 info bsphere x)) - (* 0.00024414062 (-> s5-1 info bsphere y)) - (* 0.00024414062 (-> s5-1 info bsphere z)) - (* 0.00024414062 (-> s5-1 info bsphere w)) + (/ (-> s5-1 info bsphere x) METER_LENGTH) + (/ (-> s5-1 info bsphere y) METER_LENGTH) + (/ (-> s5-1 info bsphere z) METER_LENGTH) + (/ (-> s5-1 info bsphere w) METER_LENGTH) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/camera/camera_REF.gc b/test/decompiler/reference/jak1/engine/camera/camera_REF.gc index 6cfb68ceedb..671986fcbdd 100644 --- a/test/decompiler/reference/jak1/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/camera_REF.gc @@ -272,7 +272,7 @@ 0.0 ) ((>= 0.25 arg0) - (* 0.5 arg0) + (/ arg0 2) ) ((>= arg0 0.75) (- 1.0 (* 0.5 (- 1.0 arg0))) @@ -748,7 +748,7 @@ (the-as vector (-> this point (-> this end-point))) ) (let* ((f0-0 (vector-length s3-0)) - (f1-1 (* 0.33333334 (- 1.5 (* 0.00024414062 f0-0)))) + (f1-1 (* 0.33333334 (- 1.5 (/ f0-0 METER_LENGTH)))) ) 0.0 (let* ((f1-2 (fmax 0.0 f1-1)) @@ -778,7 +778,7 @@ (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-8))) ) (let* ((f0-4 (vector-normalize-ret-len! s2-0 1.0)) - (f0-5 (* 0.5 f0-4)) + (f0-5 (/ f0-4 2)) (f26-0 (* (fmin 1.0 f0-5) f30-0 (vector-dot arg0 s2-0))) ) (let ((f2-7 (vector-dot s2-0 s3-0))) @@ -838,7 +838,7 @@ 0.0 0.0 (let* ((f1-1 (- f1-0 (* f0-0 (-> this point v1-0 tp-length)))) - (f2-5 (* 0.1 f1-1)) + (f2-5 (/ f1-1 10)) (f2-8 (* (fmin arg1 (- f2-5 (-> this max-move))) (-> *display* time-adjust-ratio))) ) (set! (-> this max-move) (fmin arg2 (+ (-> this max-move) f2-8))) @@ -859,7 +859,7 @@ (tracking-spline-method-19 this (* (-> this max-move) (-> *display* time-adjust-ratio)) arg0 s4-0) (tracking-spline-method-14 this s4-0) (dotimes (s3-0 63) - (tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 s4-0) + (tracking-spline-method-18 this (/ (-> this sample-len) 64) arg0 s4-0) ) (vector-float*! arg0 arg0 0.015625) (let ((a2-3 (-> s4-0 cur-pt))) @@ -1282,7 +1282,7 @@ (vector-! s5-1 s5-1 (-> arg0 follow-off)) (vector-float*! s5-1 s5-1 f0-20) ) - (+! (-> arg0 follow-blend) (* 0.016666668 (-> *display* time-adjust-ratio))) + (+! (-> arg0 follow-blend) (/ (-> *display* time-adjust-ratio) 60)) (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s5-1) ) (else @@ -1414,8 +1414,8 @@ (quaternion-negate! gp-0 gp-0) ) (let ((f28-0 (acos (-> gp-0 w)))) - (if (< (* 0.25 (-> *display* time-adjust-ratio) f28-0) f30-0) - (set! f30-0 (* 0.25 (-> *display* time-adjust-ratio) f28-0)) + (if (< (* (/ (-> *display* time-adjust-ratio) 4) f28-0) f30-0) + (set! f30-0 (* (/ (-> *display* time-adjust-ratio) 4) f28-0)) ) (cond ((< (-> gp-0 w) 0.9999999) @@ -1460,7 +1460,7 @@ (let ((f28-0 (vector-dot s3-0 (the-as vector (-> arg0 vector))))) (set! sv-128 s2-0) (set! sv-112 (-> arg0 vector)) - (let ((f0-6 (* 0.8 (tan (* 0.5 arg2))))) + (let ((f0-6 (* 0.8 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-112 0 quad)) (let ((v1-6 f0-6)) (.mov vf2 v1-6) @@ -1490,7 +1490,7 @@ (let ((f28-1 (vector-dot s3-0 (-> arg0 vector 1)))) (set! sv-160 s2-0) (set! sv-144 (-> arg0 vector 1)) - (let ((f0-15 (* 0.525 (tan (* 0.5 arg2))))) + (let ((f0-15 (* 0.525 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-144 quad)) (let ((v1-23 f0-15)) (.mov vf2 v1-23) @@ -1516,7 +1516,7 @@ (let ((f28-2 (vector-dot s3-0 (-> arg0 vector 1)))) (let ((s0-1 s2-0)) (set! sv-176 (-> arg0 vector 1)) - (let ((f0-25 (* 0.525 (tan (* 0.5 arg2))))) + (let ((f0-25 (* 0.525 (tan (/ arg2 2))))) (vector-float*! s0-1 sv-176 f0-25) ) ) @@ -1657,7 +1657,7 @@ ) (set! sv-240 vector-into-frustum-nosmooth!) (set! sv-256 s5-0) - (let ((a2-5 (lerp-clamp arg3 (* 0.25 arg3) (-> arg0 underwater-blend value)))) + (let ((a2-5 (lerp-clamp arg3 (/ arg3 4) (-> arg0 underwater-blend value)))) (sv-240 sv-256 arg1 a2-5) ) (cond diff --git a/test/decompiler/reference/jak1/engine/collide/collide-probe_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-probe_REF.gc index 26f1c6c4efe..c1eec9ce988 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-probe_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-probe_REF.gc @@ -350,7 +350,7 @@ (/ (- (-> arg0 y) f0-0) arg1) ) (else - (format 0 "WARNING: ~%height = ~f, pos.y = ~f" (* 0.00024414062 f0-0) (* 0.00024414062 (-> arg0 y))) + (format 0 "WARNING: ~%height = ~f, pos.y = ~f" (/ f0-0 METER_LENGTH) (/ (-> arg0 y) METER_LENGTH)) -1.0 ) ) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc index c2902cf90f5..4f1edc58069 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc @@ -492,7 +492,7 @@ ) ) (let ((f1-2 (- (- (vector-length gp-1) (-> s3-0 prim-core world-sphere w)) (-> s4-0 prim-core world-sphere w)))) - (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2))) + (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (/ f1-2 2))) ) (vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core))) ) diff --git a/test/decompiler/reference/jak1/engine/collide/surface-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/surface-h_REF.gc index b89eb85233d..bc57ab23e20 100644 --- a/test/decompiler/reference/jak1/engine/collide/surface-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/surface-h_REF.gc @@ -78,19 +78,19 @@ ;; definition for function calc-terminal-vel (defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float)) - (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1) + (- (* (/ (- (/ arg0 60) arg1) arg2) (- 1.0 arg2)) arg1) ) ;; definition for function calc-terminal2-vel (defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))) + (let ((f0-4 (sqrtf (/ (- (/ arg0 60) arg1) arg2)))) (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))) ) ) ;; definition for function calc-terminal4-vel (defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float)) - (let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))) + (let ((f0-5 (sqrtf (sqrtf (/ (- (/ arg0 60) arg1) arg2))))) (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc index 5b1dbbc46a1..766d6c82ded 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc @@ -568,7 +568,7 @@ (set! (-> self root trans y) (-> self base y)) (cond ((< (-> self root transv y) -8192.0) - (set! (-> self root transv y) (* -0.5 (-> self root transv y))) + (set! (-> self root transv y) (/ (-> self root transv y) -2)) ) (else (vector-reset! (-> self root transv)) @@ -1366,7 +1366,7 @@ (let* ((gp-0 (-> arg0 entity extra trans)) (a0-2 (res-lump-value (-> arg0 entity) 'movie-mask uint128 :time (the-as float -1000000000.0))) (a1-1 8) - (v1-6 (abs (the int (+ (* 0.00024414062 (-> gp-0 x)) (* 0.00024414062 (-> gp-0 z)))))) + (v1-6 (abs (the int (+ (/ (-> gp-0 x) METER_LENGTH) (/ (-> gp-0 z) METER_LENGTH))))) (v1-7 (mod v1-6 a1-1)) ) (while (logtest? a0-2 (ash 1 v1-7)) diff --git a/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc index 0d18e00c3ff..80380e2d742 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc @@ -1195,9 +1195,9 @@ ;; INFO: Return type mismatch int vs none. (defmethod smush-update! ((this crate)) (let ((f0-0 (update! (-> this smush)))) - (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale x) (+ 1.0 (/ f0-0 -2))) (set! (-> this root scale y) (+ 1.0 f0-0)) - (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale z) (+ 1.0 (/ f0-0 -2))) ) 0 (none) @@ -1345,7 +1345,7 @@ (+! (-> self root trans y) (* f30-0 (seconds-per-frame))) (when (< (-> self root trans y) (-> self base y)) (set! (-> self root trans y) (-> self base y)) - (set! f30-0 (* -0.5 f30-0)) + (set! f30-0 (/ f30-0 -2)) (if (< (fabs f30-0) 16384.0) (set! f30-0 0.0) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc index 6783050b861..3f7893e40a0 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc @@ -391,11 +391,11 @@ (case (-> self look) ((32) (set! (-> gp-0 global-scale) (* 4096.0 (* 1.5 (+ 1.0 f30-0)))) - (set! (-> gp-0 individual-normal-scale) (+ 0.5 (* 0.5 f30-0))) + (set! (-> gp-0 individual-normal-scale) (+ 0.5 (/ f30-0 2))) ) (else (set! (-> gp-0 global-scale) (* 4096.0 (* 3.0 (+ 1.0 f30-0)))) - (set! (-> gp-0 individual-normal-scale) (+ 0.5 (* 0.5 f30-0))) + (set! (-> gp-0 individual-normal-scale) (+ 0.5 (/ f30-0 2))) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc index cf94fc5e1ec..c060145e7b2 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc @@ -97,7 +97,7 @@ (when (and *target* (< (vector-vector-distance (-> self root trans) (-> *target* control unknown-vector90)) (-> self range)) (logtest? (-> *target* control root-prim prim-core action) (collide-action edgegrab-possible)) - (< (-> *target* control unknown-vector90 y) (+ (-> self root trans y) (* 0.5 (-> self range)))) + (< (-> *target* control unknown-vector90 y) (+ (-> self root trans y) (/ (-> self range) 2))) ) (if (send-event *target* 'pole-grab self) (go swingpole-active) diff --git a/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc index 3fc108d66d8..43a2e20fa05 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc @@ -38,7 +38,7 @@ ;; definition for method 9 of type trajectory (defmethod eval-position! ((this trajectory) (time float) (result vector)) (vector+float*! result (-> this initial-position) (-> this initial-velocity) time) - (+! (-> result y) (* 0.5 time time (-> this gravity))) + (+! (-> result y) (* (/ time 2) time (-> this gravity))) result ) @@ -1426,7 +1426,7 @@ nav-enemy-default-event-handler (vector-xz-normalize! s1-1 1.0) (vector-xz-normalize! s2-2 1.0) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump drop-jump)) - (if (or (>= (* 0.5 (-> self nav-info run-travel-speed)) f24-0) (>= (cos 3640.889) (vector-dot s1-1 s2-2))) + (if (or (>= (/ (-> self nav-info run-travel-speed) 2) f24-0) (>= (cos 3640.889) (vector-dot s1-1 s2-2))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) ) ) @@ -1438,7 +1438,7 @@ nav-enemy-default-event-handler (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) (set! f30-0 2048.0) ) - (setup-from-to-height! (-> self jump-trajectory) s4-0 arg0 f30-0 (* 0.000011111111 arg4)) + (setup-from-to-height! (-> self jump-trajectory) s4-0 arg0 f30-0 (/ arg4 90000)) ) (set! (-> self nav extra-nav-sphere quad) (-> arg0 quad)) (set! (-> self nav extra-nav-sphere w) (-> self collide-info nav-radius)) diff --git a/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc index c04ab7821a1..e7897c36278 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc @@ -187,7 +187,7 @@ (sync-now! (-> self sync) (-> self sync-linear-val)) (set! (-> self sync-offset-faux) (-> self sync offset)) (let* ((f0-3 (the float (-> self sync period))) - (f1-1 (* 0.5 f0-3)) + (f1-1 (/ f0-3 2)) ) (if (< f1-1 (- (-> self sync-offset-dest) (-> self sync-offset-faux))) (+! (-> self sync-offset-faux) f0-3) diff --git a/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc index a79b6d823e6..f2797a3cd5c 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc @@ -542,7 +542,7 @@ (let ((f30-0 0.016666668) (f28-0 (* 0.0033333334 (the float (logand #xffffff (current-time))))) ) - (while (>= (-> this sim-time-remaining) (* 0.5 f30-0)) + (while (>= (-> this sim-time-remaining) (/ f30-0 2)) (clear-force-torque! (-> this rbody)) (rigid-body-platform-method-23 this f28-0) (rigid-body-method-10 (-> this rbody) f30-0) diff --git a/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc index 07fc68ab5cb..6a1a19455ea 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc @@ -1086,7 +1086,7 @@ (set-time! (-> this agitated-time-stamp)) (set-time! (-> this bonk-time-stamp)) (set-time! (-> this attack-flop-time-stamp)) - (set-vector! (-> this extra-trans) 0.0 0.0 (- (* 0.5 (-> this tuning bridge-end-to-end-len))) 1.0) + (set-vector! (-> this extra-trans) 0.0 0.0 (- (/ (-> this tuning bridge-end-to-end-len) 2)) 1.0) (set! (-> this do-physics?) #t) (let ((a0-13 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (set! (-> this root) a0-13) @@ -1098,7 +1098,7 @@ (logior! (-> this skel status) (janim-status inited)) (let ((v1-29 (-> this tuning))) (set! (-> this draw bounds w) (-> v1-29 view-frustum-radius)) - (set! (-> this sleep-dist) (+ 40960.0 (* 0.5 (-> v1-29 bridge-end-to-end-len)))) + (set! (-> this sleep-dist) (+ 40960.0 (/ (-> v1-29 bridge-end-to-end-len) 2))) (if (or (< 35 (-> v1-29 num-springs)) (< 36 (-> v1-29 num-spring-points))) (format 0 "ERROR: ##########~%Exceeded max # of springs in ropebridge! Stomping memory!~%##########~%") ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc index f81b699a368..24af72a02ac 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc @@ -162,7 +162,7 @@ nav-enemy-default-event-handler (s5-0 (new 'stack-no-clear 'vector)) ) (let* ((f3-0 (- -36864.0 (-> this collide-info trans y))) - (f0-2 (fmax 0.0 (fmin 1.0 (- 1.0 (* 0.00008138021 f3-0))))) + (f0-2 (fmax 0.0 (fmin 1.0 (- 1.0 (/ f3-0 (meters 3)))))) ) (set-vector! (-> this draw color-mult) f0-2 f0-2 f0-2 1.0) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc index 33d97f75fee..98b60f7fb4d 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc @@ -763,7 +763,7 @@ (set! (-> *part-id-table* 118 init-specs 4 initial-valuef) (+ 24576.0 f30-1)) (set! (-> *part-id-table* 118 init-specs 19 initial-valuef) (+ 49152.0 f30-1)) (set! (-> *part-id-table* 118 init-specs 1 initial-valuef) (* 0.0000036621095 f28-0)) - (set! (-> *part-id-table* 118 init-specs 2 initial-valuef) (* 0.1 f28-0)) + (set! (-> *part-id-table* 118 init-specs 2 initial-valuef) (/ f28-0 10)) (set! (-> *part-id-table* 118 init-specs 13 initial-valuef) 0.7111111) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 118) s4-0) (set! (-> *part-id-table* 121 init-specs 1 initial-valuef) (* 0.000004150391 f28-0)) @@ -985,7 +985,7 @@ ) (set-time! (-> this drip-time)) (logclear! (-> this flags) (water-flags wt15)) - (seek! (-> this drip-wetness) 0.0 (* 0.001 (-> this drip-speed))) + (seek! (-> this drip-wetness) 0.0 (/ (-> this drip-speed) 1000)) (set! (-> this drip-speed) (* 1.05 (-> this drip-speed))) (if (= (-> this drip-wetness) 0.0) (set! (-> this drip-height) 0.0) @@ -1037,9 +1037,9 @@ (set! (-> *part-id-table* 129 init-specs 12 random-rangef) (* 13.653334 (* -0.075 f0-0))) (set! (-> *part-id-table* 133 init-specs 12 initial-valuef) (* 13.653334 (* -0.15 f0-0))) (set! (-> *part-id-table* 133 init-specs 12 random-rangef) (* 13.653334 (* -0.075 f0-0))) - (set! (-> *part-id-table* 131 init-specs 2 initial-valuef) (* 4096.0 (* 0.1 f0-0))) + (set! (-> *part-id-table* 131 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 10))) (set! (-> *part-id-table* 131 init-specs 2 random-rangef) (* 4096.0 (* 0.4 f0-0))) - (set! (-> *part-id-table* 131 init-specs 4 initial-valuef) (* 4096.0 (* 0.1 f0-0))) + (set! (-> *part-id-table* 131 init-specs 4 initial-valuef) (* 4096.0 (/ f0-0 10))) (set! (-> *part-id-table* 131 init-specs 4 random-rangef) (* 4096.0 (* 0.4 f0-0))) (set! (-> *part-id-table* 131 init-specs 9 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 131 init-specs 9 random-rangef) (* 13.653334 (* 3.4 f0-0))) @@ -1053,23 +1053,23 @@ (set! (-> *part-id-table* 126 init-specs 9 random-rangef) (* 13.653334 (* 1.4 f0-0))) (set! (-> *part-id-table* 126 init-specs 10 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 126 init-specs 10 random-rangef) (* 13.653334 (* 1.4 f0-0))) - (set! (-> *part-id-table* 127 init-specs 2 initial-valuef) (* 4096.0 (* -0.5 f0-0))) + (set! (-> *part-id-table* 127 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 -2))) (set! (-> *part-id-table* 127 init-specs 2 random-rangef) (* 4096.0 f0-0)) - (set! (-> *part-id-table* 127 init-specs 3 initial-valuef) (* 4096.0 (* -0.5 f0-0))) + (set! (-> *part-id-table* 127 init-specs 3 initial-valuef) (* 4096.0 (/ f0-0 -2))) (set! (-> *part-id-table* 127 init-specs 3 random-rangef) (* 4096.0 f0-0)) - (set! (-> *part-id-table* 127 init-specs 4 initial-valuef) (* 4096.0 (* 0.5 f0-0))) + (set! (-> *part-id-table* 127 init-specs 4 initial-valuef) (* 4096.0 (/ f0-0 2))) (set! (-> *part-id-table* 127 init-specs 4 random-rangef) (* 4096.0 f0-0)) - (set! (-> *part-id-table* 127 init-specs 6 initial-valuef) (* 4096.0 (* 0.5 f0-0))) + (set! (-> *part-id-table* 127 init-specs 6 initial-valuef) (* 4096.0 (/ f0-0 2))) (set! (-> *part-id-table* 127 init-specs 6 random-rangef) (* 4096.0 f0-0)) (set! (-> *part-id-table* 127 init-specs 11 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 127 init-specs 11 random-rangef) (* 13.653334 f0-0)) (set! (-> *part-id-table* 127 init-specs 12 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 127 init-specs 12 random-rangef) (* 13.653334 f0-0)) (set! (-> *part-id-table* 132 init-specs 1 initial-valuef) (* 4.0 f0-0)) - (set! (-> *part-id-table* 132 init-specs 2 initial-valuef) (* 4096.0 (* -0.25 f0-0))) - (set! (-> *part-id-table* 132 init-specs 2 random-rangef) (* 4096.0 (* 0.5 f0-0))) - (set! (-> *part-id-table* 132 init-specs 3 initial-valuef) (* 4096.0 (* -0.25 f0-0))) - (set! (-> *part-id-table* 132 init-specs 3 random-rangef) (* 4096.0 (* 0.5 f0-0))) + (set! (-> *part-id-table* 132 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 -4))) + (set! (-> *part-id-table* 132 init-specs 2 random-rangef) (* 4096.0 (/ f0-0 2))) + (set! (-> *part-id-table* 132 init-specs 3 initial-valuef) (* 4096.0 (/ f0-0 -4))) + (set! (-> *part-id-table* 132 init-specs 3 random-rangef) (* 4096.0 (/ f0-0 2))) (set! (-> *part-id-table* 132 init-specs 10 initial-valuef) (* 13.653334 (* -0.75 f0-0))) (set! (-> *part-id-table* 132 init-specs 10 random-rangef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 132 init-specs 12 initial-valuef) (* 13.653334 (* -0.75 f0-0))) @@ -1101,10 +1101,10 @@ (set! (-> *part-id-table* 125 init-specs 13 initial-valuef) (* 13.653334 (* -0.3 f0-0))) (set! (-> *part-id-table* 125 init-specs 13 random-rangef) (* 13.653334 (* -0.075 f0-0))) (set! (-> *part-id-table* 124 init-specs 2 initial-valuef) (* 4096.0 (* 1.2 f0-0))) - (set! (-> *part-id-table* 124 init-specs 2 random-rangef) (* 4096.0 (* 0.2 f0-0))) + (set! (-> *part-id-table* 124 init-specs 2 random-rangef) (* 4096.0 (/ f0-0 5))) (set! (-> *part-id-table* 124 init-specs 3 initial-valuef) (* 4096.0 (* 0.4 f0-0))) (set! (-> *part-id-table* 124 init-specs 3 random-rangef) (* 4096.0 (* 1.2 f0-0))) - (set! (-> *part-id-table* 124 init-specs 7 initial-valuef) (* 4096.0 (* 0.2 f0-0))) + (set! (-> *part-id-table* 124 init-specs 7 initial-valuef) (* 4096.0 (/ f0-0 5))) (set! (-> *part-id-table* 124 init-specs 7 random-rangef) (* 4096.0 (* 2.2 f0-0))) (set! (-> *part-id-table* 130 init-specs 2 initial-valuef) (* 4096.0 (* 0.3 f0-0))) (set! (-> *part-id-table* 130 init-specs 2 random-rangef) (* 4096.0 (* 0.9 f0-0))) diff --git a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc index 8bdcea0e0b5..d4efcb3eaa6 100644 --- a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc @@ -938,7 +938,7 @@ (set! (-> self anim-first) (-> arg0 first-frame)) (set! (-> self anim-last) (-> arg0 last-frame)) (set! (-> self anim-gspeed) (* 0.01 (the float (-> self speed)))) - (set! (-> self anim-speed) (* 0.01 (-> self anim-gspeed) (the float (-> arg0 speed)))) + (set! (-> self anim-speed) (* (/ (-> self anim-gspeed) 100) (the float (-> arg0 speed)))) (when (< (-> self anim-speed) 0.0) (set! (-> self anim-first) (-> arg0 last-frame)) (set! (-> self anim-last) (-> arg0 first-frame)) diff --git a/test/decompiler/reference/jak1/engine/debug/default-menu_REF.gc b/test/decompiler/reference/jak1/engine/debug/default-menu_REF.gc index 8c99ab36f2a..74a6f20bed4 100644 --- a/test/decompiler/reference/jak1/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/default-menu_REF.gc @@ -249,13 +249,13 @@ (case arg0 (('close) (if (and *math-camera* *subdivide-settings*) - (* 0.00024414062 (-> *subdivide-settings* close 3)) + (/ (-> *subdivide-settings* close 3) METER_LENGTH) arg3 ) ) (('far) (if (and *math-camera* *subdivide-settings*) - (* 0.00024414062 (-> *subdivide-settings* far 3)) + (/ (-> *subdivide-settings* far 3) METER_LENGTH) arg3 ) ) @@ -1999,7 +1999,7 @@ (set! (-> gp-0 dists x) (* 4096.0 arg2)) (prototype-bucket-recalc-fields gp-0) ) - (* 0.00024414062 (-> gp-0 dists x)) + (/ (-> gp-0 dists x) METER_LENGTH) ) (else (empty) @@ -2030,7 +2030,7 @@ (set! (-> gp-0 dists w) (* 4096.0 arg2)) (prototype-bucket-recalc-fields gp-0) ) - (* 0.00024414062 (-> gp-0 dists w)) + (/ (-> gp-0 dists w) METER_LENGTH) ) (else (empty) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc index dd9abd688fc..38caf1ff1c1 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc @@ -350,7 +350,7 @@ ) ) (set! (-> arg0 rdists z) (/ 1.0 (- (-> arg0 dists w) (-> arg0 dists z)))) - (set! (-> arg0 dists y) (* 0.5 (-> arg0 dists x))) + (set! (-> arg0 dists y) (/ (-> arg0 dists x) 2)) (set! (-> arg0 rdists y) (/ 1.0 (-> arg0 dists y))) arg0 ) diff --git a/test/decompiler/reference/jak1/engine/game/effect-control_REF.gc b/test/decompiler/reference/jak1/engine/game/effect-control_REF.gc index ca1dc697690..f0708eda41b 100644 --- a/test/decompiler/reference/jak1/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/effect-control_REF.gc @@ -1136,7 +1136,7 @@ (sound-name-with-material 'zoom-land (-> self control ground-pat) "") (new-sound-id) (the int - (* 10.24 (* 100.0 (the float (the int (* 10.24 (* 0.000016276043 (-> self control ground-impact-vel))))))) + (* 10.24 (* 100.0 (the float (the int (* 10.24 (/ (-> self control ground-impact-vel) (meters 15))))))) ) 0 0 diff --git a/test/decompiler/reference/jak1/engine/game/settings_REF.gc b/test/decompiler/reference/jak1/engine/game/settings_REF.gc index beeb2e3983f..2d73616994b 100644 --- a/test/decompiler/reference/jak1/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/settings_REF.gc @@ -235,7 +235,7 @@ (let ((gp-0 (-> this current))) (let ((s5-0 (-> this target))) (mem-copy! (the-as pointer s5-0) (the-as pointer (-> this default)) 196) - (set! (-> s5-0 ambient-volume) (* 0.01 (-> this default ambient-volume) (-> this default sfx-volume))) + (set! (-> s5-0 ambient-volume) (* (/ (-> this default ambient-volume) 100) (-> this default sfx-volume))) (update-from-engine s5-0 (-> this engine)) (set! (-> gp-0 border-mode) (-> s5-0 border-mode)) (set! (-> gp-0 common-page) (-> s5-0 common-page)) diff --git a/test/decompiler/reference/jak1/engine/geometry/cylinder_REF.gc b/test/decompiler/reference/jak1/engine/geometry/cylinder_REF.gc index d55c867fcd4..a7b3f904337 100644 --- a/test/decompiler/reference/jak1/engine/geometry/cylinder_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/cylinder_REF.gc @@ -86,7 +86,7 @@ (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) (vector-normalize! s1-0 (-> this radius)) - (vector-float*! s0-0 (-> this axis) (* 0.125 (-> this length))) + (vector-float*! s0-0 (-> this axis) (/ (-> this length) 8)) (let ((s5-0 (new 'stack-no-clear 'cylinder-verts)) (s4-0 (new 'stack-no-clear 'cylinder-verts)) (s3-0 (new 'stack-no-clear 'matrix)) @@ -253,7 +253,7 @@ (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) (vector-normalize! s1-0 (-> this radius)) - (vector-float*! s0-0 (-> this axis) (* 0.14285715 (-> this length))) + (vector-float*! s0-0 (-> this axis) (/ (-> this length) 7)) (let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s4-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s3-0 (new 'stack-no-clear 'matrix)) diff --git a/test/decompiler/reference/jak1/engine/geometry/geometry_REF.gc b/test/decompiler/reference/jak1/engine/geometry/geometry_REF.gc index a8282284dd6..b4a159528e1 100644 --- a/test/decompiler/reference/jak1/engine/geometry/geometry_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/geometry_REF.gc @@ -107,7 +107,7 @@ (.svf (&-> dst quad) vf3) (let* ((f0-0 (vector-length dst)) (f1-1 (vector-dot dst plane-normal)) - (f1-2 (- (* 0.02 f0-0) f1-1)) + (f1-2 (- (/ f0-0 50) f1-1)) ) (vector+float*! dst dst plane-normal (fmin 16384.0 (* 16.0 f1-2))) ) @@ -335,11 +335,11 @@ (f26-0 (vector-dot arg1 arg2)) (f28-0 (sqrtf (* 0.5 (- 1.0 f26-0)))) ) - (let ((f0-5 (sin (* 0.5 arg3)))) + (let ((f0-5 (sin (/ arg3 2)))) (cond ((< f0-5 f28-0) (set! f28-0 f0-5) - (set! (-> arg0 w) (cos (* 0.5 arg3))) + (set! (-> arg0 w) (cos (/ arg3 2))) ) (else (set! (-> arg0 w) (sqrtf (* 0.5 (+ 1.0 f26-0)))) @@ -1043,9 +1043,7 @@ ) ;; definition for function curve-evaluate! -;; WARN: Failed load: (set! vf3 (l.vf (+ v1-9 16))) at op 67 -;; WARN: Failed load: (set! vf4 (l.vf (+ v1-9 32))) at op 69 -;; WARN: Failed load: (set! vf5 (l.vf (+ v1-9 48))) at op 71 +;; ERROR: Failed load: (set! vf3 (l.vf (+ v1-9 16))) at op 67 ;; ERROR: Unsupported inline assembly instruction kind - [addiu v1, s3, -3] ;; ERROR: Unsupported inline assembly instruction kind - [sll v1, v1, 4] (defun curve-evaluate! ((arg0 vector) (arg1 float) (arg2 (inline-array vector)) (arg3 int) (arg4 (pointer float)) (arg5 int)) @@ -1227,7 +1225,7 @@ ) (while (> s3-0 0) (+! s3-0 -1) - (set! f28-0 (* 0.5 f28-0)) + (set! f28-0 (/ f28-0 2)) (let ((v1-4 (cond ((< f22-0 f20-0) (curve-get-pos! s1-0 s0-1 arg0) diff --git a/test/decompiler/reference/jak1/engine/gfx/background/subdivide_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/subdivide_REF.gc index 4ee2cb83d19..7ce965430c1 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/subdivide_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/subdivide_REF.gc @@ -127,7 +127,7 @@ (set! (-> settings meters 0) (-> settings far idx)) (set! (-> settings meters 4) (-> settings close idx)) (let ((f0-3 (* 0.14285715 (- (-> settings meters 0) (-> settings meters 4))))) - (set! (-> settings meters 3) (+ (-> settings meters 4) (* 0.5 f0-3))) + (set! (-> settings meters 3) (+ (-> settings meters 4) (/ f0-3 2))) (set! (-> settings meters 2) (+ (-> settings meters 3) f0-3)) (set! (-> settings meters 1) (+ (-> settings meters 2) (* 2.0 f0-3))) ) @@ -161,16 +161,16 @@ ) (set! (-> arg0 k0s 0 y) (- f4-1)) (set! (-> arg0 k0s 1 y) (- f3-2)) - (set! (-> arg0 k0s 0 x) (* 0.5 f4-1)) - (set! (-> arg0 k0s 1 x) (* 0.5 f3-2)) + (set! (-> arg0 k0s 0 x) (/ f4-1 2)) + (set! (-> arg0 k0s 1 x) (/ f3-2 2)) (let ((f2-1 (* f2-0 f4-1)) (f5-7 (* f1-0 f3-2)) ) (set! (-> arg0 k1s 0 y) f2-1) (set! (-> arg0 k1s 1 y) f5-7) ) - (set! (-> arg0 k1s 0 x) (* -0.5 f4-1 f1-0)) - (set! (-> arg0 k1s 1 x) (* -0.5 f3-2 f0-0)) + (set! (-> arg0 k1s 0 x) (* (/ f4-1 -2) f1-0)) + (set! (-> arg0 k1s 1 x) (* (/ f3-2 -2) f0-0)) ) ) (none) diff --git a/test/decompiler/reference/jak1/engine/gfx/foreground/ripple_REF.gc b/test/decompiler/reference/jak1/engine/gfx/foreground/ripple_REF.gc index 0a1b4f4ccc4..ec68dde16fe 100644 --- a/test/decompiler/reference/jak1/engine/gfx/foreground/ripple_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/foreground/ripple_REF.gc @@ -209,7 +209,7 @@ (if (< f0-23 0.0) (set! f0-23 (-> gp-0 global-scale)) ) - (+ f30-0 (* 0.0078125 f1-12 f0-23)) + (+ f30-0 (* (/ f1-12 128) f0-23)) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc index f43f81ca874..0591b005aa7 100644 --- a/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc @@ -18,13 +18,13 @@ (case (get-video-mode) (('pal) (set! (-> this time-adjust-ratio) (* 1.2 ratio)) - (set! (-> this seconds-per-frame) (* 0.02 ratio)) + (set! (-> this seconds-per-frame) (/ ratio 50)) (set! (-> this frames-per-second) (* 50.0 (/ 1.0 ratio))) (set! (-> this time-factor) 6.0) ) (else (set! (-> this time-adjust-ratio) ratio) - (set! (-> this seconds-per-frame) (* 0.016666668 ratio)) + (set! (-> this seconds-per-frame) (/ ratio 60)) (set! (-> this frames-per-second) (* 60.0 (/ 1.0 ratio))) (set! (-> this time-factor) 5.0) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/math-camera_REF.gc b/test/decompiler/reference/jak1/engine/gfx/math-camera_REF.gc index af246fe3626..14f89dcc422 100644 --- a/test/decompiler/reference/jak1/engine/gfx/math-camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/math-camera_REF.gc @@ -30,7 +30,7 @@ ;; definition for function update-math-camera ;; INFO: Used lq/sq (defun update-math-camera ((math-cam math-camera) (video-mode symbol) (aspect symbol)) - (set! (-> math-cam x-ratio) (tan (* 0.5 (-> math-cam fov)))) + (set! (-> math-cam x-ratio) (tan (/ (-> math-cam fov) 2))) (if (= aspect 'aspect4x3) (set! (-> math-cam y-ratio) (* 0.75 (-> math-cam x-ratio))) (set! (-> math-cam y-ratio) (* 0.5625 (-> math-cam x-ratio))) diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/mood_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/mood_REF.gc index 270346a4d69..7e23c8c2e11 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/mood_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/mood_REF.gc @@ -911,8 +911,8 @@ ) (when arg3 (let* ((v1-14 (logand (+ s0-1 -1) 3)) - (f1-11 (* 0.0078125 (-> s4-0 scale s0-1))) - (f0-11 (* 0.0078125 (-> s4-0 scale v1-14))) + (f1-11 (/ (-> s4-0 scale s0-1) 128)) + (f0-11 (/ (-> s4-0 scale v1-14) 128)) ) (set! (-> arg0 times (+ arg1 s0-1) w) (* f30-2 f1-11)) (set! (-> arg0 times (+ arg1 v1-14) w) (* (- 1.0 f30-2) f0-11)) @@ -1095,7 +1095,7 @@ (let ((f0-26 (vector-vector-distance s4-1 s3-0))) (when (< f0-26 61440.0) (let ((a2-10 (new 'stack-no-clear 'vector)) - (f0-27 (* 0.000016276043 f0-26)) + (f0-27 (/ f0-26 (meters 15))) ) (set-vector! a2-10 1.0 0.5 0.0 1.0) (let ((f0-31 (* 0.5 (- 1.0 (fmax 0.0 (fmin 1.0 f0-27)))))) @@ -1163,7 +1163,7 @@ (let ((f30-0 (fmax 0.0 (-> *math-camera* camera-rot vector 1 z)))) (let ((a2-4 (new 'stack-no-clear 'vector))) (set-vector! a2-4 0.0 32.0 48.0 128.0) - (vector4-lerp! (the-as vector (-> arg0 current-fog)) (the-as vector (-> arg0 current-fog)) a2-4 (* 0.5 f30-0)) + (vector4-lerp! (the-as vector (-> arg0 current-fog)) (the-as vector (-> arg0 current-fog)) a2-4 (/ f30-0 2)) ) (let ((f0-7 (-> arg0 current-fog fog-dists w)) (f1-1 255.0) @@ -1594,7 +1594,7 @@ (+! (-> arg0 state 1) 1) ) (let ((f30-0 (update-mood-palette arg0 arg1 arg2)) - (f28-0 (* -0.00000055486504 (-> *math-camera* trans y))) + (f28-0 (/ (-> *math-camera* trans y) (meters -440))) (s5-1 (-> arg0 light-group)) ) (when *time-of-day-effects* @@ -1774,11 +1774,8 @@ ) (let ((s5-2 (-> arg0 light-group 6))) (update-light-kit s5-2 (-> arg0 light-group 0 ambi) 1.0) - (set! (-> s5-2 dir0 levels x) (+ (* 0.25 (-> arg0 times 4 w)) - (* 0.25 (-> arg0 times 5 w)) - (* 0.25 (-> arg0 times 6 w)) - (* 0.25 (-> arg0 times 7 w)) - ) + (set! (-> s5-2 dir0 levels x) + (+ (/ (-> arg0 times 4 w) 4) (/ (-> arg0 times 5 w) 4) (/ (-> arg0 times 6 w) 4) (/ (-> arg0 times 7 w) 4)) ) ) (new 'stack-no-clear 'vector) @@ -1787,7 +1784,7 @@ (dotimes (s4-2 11) (let ((f0-7 (vector-vector-distance (-> *rolling-spheres-on* s4-2) s5-3))) (when (< f0-7 (-> *rolling-spheres-on* s4-2 w)) - (let ((f30-0 (/ (- f0-7 (* 0.5 (-> *rolling-spheres-on* s4-2 w))) (* 0.5 (-> *rolling-spheres-on* s4-2 w))))) + (let ((f30-0 (/ (- f0-7 (/ (-> *rolling-spheres-on* s4-2 w) 2)) (/ (-> *rolling-spheres-on* s4-2 w) 2)))) (set-target-light-index 1) (set! (-> *time-of-day-context* target-interp) (- 1.0 (fmax 0.0 (fmin 1.0 f30-0)))) ) @@ -1796,7 +1793,7 @@ ) (let ((f0-11 (vector-vector-distance (the-as vector (&-> *rolling-spheres-light0* x)) s5-3))) (when (< f0-11 (-> *rolling-spheres-light0* w)) - (let ((f30-1 (/ (- f0-11 (* 0.5 (-> *rolling-spheres-light0* w))) (* 0.5 (-> *rolling-spheres-light0* w))))) + (let ((f30-1 (/ (- f0-11 (/ (-> *rolling-spheres-light0* w) 2)) (/ (-> *rolling-spheres-light0* w) 2)))) (set-target-light-index 2) (set! (-> *time-of-day-context* target-interp) (- 1.0 (fmax 0.0 (fmin 1.0 f30-1)))) ) @@ -1805,10 +1802,7 @@ (dotimes (s4-3 4) (let ((f0-15 (vector-vector-distance (-> *rolling-spheres-light1* s4-3) s5-3))) (when (< f0-15 (-> *rolling-spheres-light1* s4-3 w)) - (let ((f30-2 - (/ (- f0-15 (* 0.5 (-> *rolling-spheres-light1* s4-3 w))) (* 0.5 (-> *rolling-spheres-light1* s4-3 w))) - ) - ) + (let ((f30-2 (/ (- f0-15 (/ (-> *rolling-spheres-light1* s4-3 w) 2)) (/ (-> *rolling-spheres-light1* s4-3 w) 2)))) (set-target-light-index 3) (set! (-> *time-of-day-context* target-interp) (- 1.0 (fmax 0.0 (fmin 1.0 f30-2)))) ) @@ -1818,8 +1812,8 @@ (dotimes (s4-4 5) (let ((f0-19 (vector-vector-distance (the-as vector (+ (the-as uint *rolling-spheres-light2*) (* s4-4 16))) s5-3))) (when (< f0-19 (-> *rolling-spheres-light2* matrix vector s4-4 w)) - (let ((f30-3 (/ (- f0-19 (* 0.5 (-> *rolling-spheres-light2* matrix vector s4-4 w))) - (* 0.5 (-> *rolling-spheres-light2* matrix vector s4-4 w)) + (let ((f30-3 (/ (- f0-19 (/ (-> *rolling-spheres-light2* matrix vector s4-4 w) 2)) + (/ (-> *rolling-spheres-light2* matrix vector s4-4 w) 2) ) ) ) @@ -1832,10 +1826,7 @@ (dotimes (s4-5 2) (let ((f0-23 (vector-vector-distance (-> *rolling-spheres-light3* s4-5) s5-3))) (when (< f0-23 (-> *rolling-spheres-light3* s4-5 w)) - (let ((f30-4 - (/ (- f0-23 (* 0.5 (-> *rolling-spheres-light3* s4-5 w))) (* 0.5 (-> *rolling-spheres-light3* s4-5 w))) - ) - ) + (let ((f30-4 (/ (- f0-23 (/ (-> *rolling-spheres-light3* s4-5 w) 2)) (/ (-> *rolling-spheres-light3* s4-5 w) 2)))) (set-target-light-index 5) (set! (-> *time-of-day-context* target-interp) (- 1.0 (fmax 0.0 (fmin 1.0 f30-4)))) ) @@ -1844,7 +1835,7 @@ ) (let ((f0-27 (vector-vector-distance (the-as vector (&-> *rolling-spheres-light4* x)) s5-3))) (when (< f0-27 (-> *rolling-spheres-light4* w)) - (let ((f30-5 (/ (- f0-27 (* 0.5 (-> *rolling-spheres-light4* w))) (* 0.5 (-> *rolling-spheres-light4* w))))) + (let ((f30-5 (/ (- f0-27 (/ (-> *rolling-spheres-light4* w) 2)) (/ (-> *rolling-spheres-light4* w) 2)))) (set-target-light-index 6) (set! (-> *time-of-day-context* target-interp) (- 1.0 (fmax 0.0 (fmin 1.0 f30-5)))) ) @@ -1985,7 +1976,7 @@ (set! (-> arg0 times s2-0 w) f28-0) (vector-! s3-0 (the-as vector (-> *palette-fade-controls* control s2-0)) (-> *target* control trans)) (let* ((f3-0 (vector-length s3-0)) - (f28-1 (* f28-0 (fmax 0.0 (fmin 1.0 (- 1.0 (* 0.000012207031 f3-0)))))) + (f28-1 (* f28-0 (fmax 0.0 (fmin 1.0 (- 1.0 (/ f3-0 (meters 20))))))) ) (vector-normalize! s3-0 f28-1) (if (< f30-0 f28-1) @@ -2925,7 +2916,7 @@ (set-vector! s3-1 0.1 0.1 0.1 1.0) (let ((f30-3 (* (-> (the-as (pointer float) s5-1) 2) f30-2))) (vector4-lerp! s3-1 s3-1 s2-0 f30-3) - (set! (-> arg0 times 7 w) (* (+ 0.8 (* 0.1 f28-4)) f30-3)) + (set! (-> arg0 times 7 w) (* (+ 0.8 (/ f28-4 10)) f30-3)) ) ) (let ((v1-49 (-> s4-2 0 dir1))) diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc index 90b7296d98b..ec062195374 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc @@ -126,9 +126,9 @@ ) ) (let* ((f0-4 (the float (-> self frame))) - (f0-6 (+ (* 0.0033333334 f0-4) (the float (-> self second)))) - (f0-8 (+ (* 0.016666668 f0-6) (the float (-> self minute)))) - (f0-10 (+ (* 0.016666668 f0-8) (the float (-> self hour)))) + (f0-6 (+ (/ f0-4 300) (the float (-> self second)))) + (f0-8 (+ (/ f0-6 60) (the float (-> self minute)))) + (f0-10 (+ (/ f0-8 60) (the float (-> self hour)))) ) (set! (-> self time-of-day) f0-10) (set! (-> *time-of-day-context* time) f0-10) diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/weather-part_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/weather-part_REF.gc index dc917cfb394..f979418f4c0 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/weather-part_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/weather-part_REF.gc @@ -550,9 +550,9 @@ (set! (-> arg2 vector 2 z) (-> *time-of-day-context* current-sun sun-color z)) ) ((or (= s5-0 1) (= s5-0 2)) - (set! (-> arg2 vector 2 x) (* 0.25 (-> *time-of-day-context* current-sun sun-color x))) - (set! (-> arg2 vector 2 y) (* 0.25 (-> *time-of-day-context* current-sun sun-color y))) - (set! (-> arg2 vector 2 z) (* 0.25 (-> *time-of-day-context* current-sun sun-color z))) + (set! (-> arg2 vector 2 x) (/ (-> *time-of-day-context* current-sun sun-color x) 4)) + (set! (-> arg2 vector 2 y) (/ (-> *time-of-day-context* current-sun sun-color y) 4)) + (set! (-> arg2 vector 2 z) (/ (-> *time-of-day-context* current-sun sun-color z) 4)) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle_REF.gc index e577d18fcda..5a2f6374087 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle_REF.gc @@ -298,8 +298,8 @@ (set! (-> arg1 radius) f30-0) (let ((f26-0 (sin f28-0)) (f28-1 (cos f28-0)) - (f22-0 (sin (* 0.5 f24-0))) - (f0-5 (cos (* 0.5 f24-0))) + (f22-0 (sin (/ f24-0 2))) + (f0-5 (cos (/ f24-0 2))) (a1-1 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-distort_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-distort_REF.gc index 29849fcc0ae..706bb63d2fe 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-distort_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-distort_REF.gc @@ -47,13 +47,7 @@ (let ((f26-0 (* 65536.0 (/ (the float i) (the float iterations))))) (set-vector! (-> tables entry entry-index) (* (sin f26-0) cam-aspx) (* (cos f26-0) cam-aspy) 0.0 0.0) (let ((s3-1 (+ entry-index 1))) - (set-vector! - (-> tables entry s3-1) - (* 0.001953125 cam-aspx (sin f26-0)) - (* 0.00390625 cam-aspy (cos f26-0)) - 0.0 - 0.0 - ) + (set-vector! (-> tables entry s3-1) (* (/ cam-aspx 512) (sin f26-0)) (* (/ cam-aspy 256) (cos f26-0)) 0.0 0.0) (set! entry-index (+ s3-1 1)) ) ) @@ -62,7 +56,7 @@ ) (set-vector! (-> tables entry entry-index) 0.0 cam-aspy 0.0 0.0) (let ((v1-17 (+ entry-index 1))) - (set-vector! (-> tables entry v1-17) 0.0 (* 0.00390625 cam-aspy) 0.0 0.0) + (set-vector! (-> tables entry v1-17) 0.0 (/ cam-aspy 256) 0.0 0.0) (+ v1-17 1) ) ) diff --git a/test/decompiler/reference/jak1/engine/math/quaternion_REF.gc b/test/decompiler/reference/jak1/engine/math/quaternion_REF.gc index 695ee51f35f..0308e749133 100644 --- a/test/decompiler/reference/jak1/engine/math/quaternion_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/quaternion_REF.gc @@ -2,7 +2,6 @@ (in-package goal) ;; definition for method 3 of type quaternion -;; INFO: this function exists in multiple non-identical object files (defmethod inspect ((this quaternion)) (format #t "[~8x] quaternion~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w)) @@ -18,7 +17,7 @@ ;; definition for function quaternion-axis-angle! (defun quaternion-axis-angle! ((quat quaternion) (x float) (y float) (z float) (angle float)) - (let* ((f28-0 (* 0.5 angle)) + (let* ((f28-0 (/ angle 2)) (f30-0 (sin f28-0)) (f0-1 (cos f28-0)) ) @@ -32,7 +31,7 @@ ;; definition for function quaternion-vector-angle! (defun quaternion-vector-angle! ((quat quaternion) (axis vector) (angle float)) - (let* ((f28-0 (* 0.5 angle)) + (let* ((f28-0 (/ angle 2)) (f30-0 (sin f28-0)) (f0-1 (cos f28-0)) ) @@ -434,7 +433,7 @@ (cond ((< 0.0 f0-2) (let ((f0-4 (sqrtf (+ 1.0 f0-2)))) - (set! (-> arg0 w) (* 0.5 f0-4)) + (set! (-> arg0 w) (/ f0-4 2)) (let ((f0-5 (/ 0.5 f0-4))) (set! (-> arg0 x) (* f0-5 (- (-> arg1 vector 1 z) (-> arg1 vector 2 y)))) (set! (-> arg0 y) (* f0-5 (- (-> arg1 vector 2 x) (-> arg1 vector 0 z)))) @@ -469,7 +468,7 @@ ) ) ) - (set! (-> arg0 data a2-0) (* 0.5 f0-12)) + (set! (-> arg0 data a2-0) (/ f0-12 2)) (if (!= f0-12 0.0) (set! f0-12 (/ 0.5 f0-12)) ) diff --git a/test/decompiler/reference/jak1/engine/math/transformq_REF.gc b/test/decompiler/reference/jak1/engine/math/transformq_REF.gc index f6aec9d28c4..28062a33981 100644 --- a/test/decompiler/reference/jak1/engine/math/transformq_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/transformq_REF.gc @@ -47,7 +47,7 @@ saturated-yaw ) (else - (* 0.000000001 saturated-yaw) + (/ saturated-yaw 1000000000) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/physics/dynamics-h_REF.gc b/test/decompiler/reference/jak1/engine/physics/dynamics-h_REF.gc index c35d1d1faac..3fcef3e635b 100644 --- a/test/decompiler/reference/jak1/engine/physics/dynamics-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/physics/dynamics-h_REF.gc @@ -28,7 +28,7 @@ ;; definition for function time-to-apex (defun time-to-apex ((arg0 float) (arg1 float)) - (the int (/ arg0 (- (* 0.0033333334 arg1)))) + (the int (/ arg0 (- (/ arg1 300)))) ) ;; definition for function time-to-ground @@ -37,8 +37,8 @@ (v0-0 0) ) (while (< (- arg2) f0-0) - (set! arg0 (- arg0 (* 0.0033333334 arg1))) - (+! f0-0 (* 0.0033333334 arg0)) + (set! arg0 (- arg0 (/ arg1 300))) + (+! f0-0 (/ arg0 300)) (+! v0-0 1) ) v0-0 diff --git a/test/decompiler/reference/jak1/engine/physics/trajectory_REF.gc b/test/decompiler/reference/jak1/engine/physics/trajectory_REF.gc index 701956321df..d5837292942 100644 --- a/test/decompiler/reference/jak1/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/jak1/engine/physics/trajectory_REF.gc @@ -2,14 +2,13 @@ (in-package goal) ;; definition for method 9 of type trajectory -;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq (defmethod eval-position! ((this trajectory) (time float) (result vector)) (set! (-> result quad) (-> this initial-position quad)) (+! (-> result x) (* time (-> this initial-velocity x))) (+! (-> result y) (* time (-> this initial-velocity y))) (+! (-> result z) (* time (-> this initial-velocity z))) - (+! (-> result y) (* 0.5 time time (-> this gravity))) + (+! (-> result y) (* (/ time 2) time (-> this gravity))) result ) @@ -33,7 +32,7 @@ (vector-xz-normalize! (-> this initial-velocity) xz-vel) ) (set! (-> this initial-velocity y) - (- (/ (- (-> to y) (-> from y)) duration) (* 0.5 duration (-> this gravity))) + (- (/ (- (-> to y) (-> from y)) duration) (* (/ duration 2) (-> this gravity))) ) 0 (none) diff --git a/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc index 19d34068943..aab6a84ac11 100644 --- a/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc @@ -361,9 +361,9 @@ ) ) ) - (set! (-> arg0 x) (the int (* 0.0625 (-> v1-0 x)))) - (set! (-> arg0 y) (the int (* 0.0625 (-> v1-0 y)))) - (set! (-> arg0 z) (the int (* 0.0625 (-> v1-0 z)))) + (set! (-> arg0 x) (the int (/ (-> v1-0 x) 16))) + (set! (-> arg0 y) (the int (/ (-> v1-0 y) 16))) + (set! (-> arg0 z) (the int (/ (-> v1-0 z) 16))) ) 0 ) diff --git a/test/decompiler/reference/jak1/engine/target/collide-reaction-target_REF.gc b/test/decompiler/reference/jak1/engine/target/collide-reaction-target_REF.gc index 00cdb26fbde..baace6a70aa 100644 --- a/test/decompiler/reference/jak1/engine/target/collide-reaction-target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/collide-reaction-target_REF.gc @@ -193,7 +193,7 @@ ) (when (and (or (and (< f0-21 0.95) (>= f30-0 0.0)) (and (logtest? sv-32 32) (< f0-21 0.3)) - (< f1-11 (* -0.25 (-> arg1 best-from-prim local-sphere w))) + (< f1-11 (/ (-> arg1 best-from-prim local-sphere w) -4)) ) (>= (vector-dot sv-52 sv-16) -0.000001) ) diff --git a/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc index a84a18b583c..d4b7907e2b6 100644 --- a/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc @@ -559,7 +559,7 @@ (set! f2-0 (-> a1-3 a2-6 w)) ) ) - (let ((f1-1 (* 0.0625 f1-0))) + (let ((f1-1 (/ f1-0 16))) (set! (-> self control unknown-int10) a0-3) (set! (-> self control unknown-float100) f1-1) (if (logtest? (-> self control unknown-surface01 flags) (surface-flags no-turn-around)) diff --git a/test/decompiler/reference/jak1/engine/target/target-util_REF.gc b/test/decompiler/reference/jak1/engine/target/target-util_REF.gc index 5f3a1707bbd..a0b1436b5bd 100644 --- a/test/decompiler/reference/jak1/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-util_REF.gc @@ -801,7 +801,7 @@ ) ) ) - (* 0.125 f30-0) + (/ f30-0 8) ) ) @@ -1209,10 +1209,10 @@ (f30-0 (fmax -1.0 (fmin 1.0 (* 1.6 arg2)))) ) (let ((f1-5 (fabs (- f0-1 (the-as float (-> arg0 blend 1)))))) - (set! (-> arg0 blend 1) (seek (the-as float (-> arg0 blend 1)) f0-1 (fmax 0.05 (fmin 0.2 (* 0.25 f1-5))))) + (set! (-> arg0 blend 1) (seek (the-as float (-> arg0 blend 1)) f0-1 (fmax 0.05 (fmin 0.2 (/ f1-5 4))))) ) (let ((f0-7 (fabs (- f30-0 (the-as float (-> arg0 blend 2)))))) - (set! (-> arg0 blend 2) (seek (the-as float (-> arg0 blend 2)) f30-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-7))))) + (set! (-> arg0 blend 2) (seek (the-as float (-> arg0 blend 2)) f30-0 (fmax 0.05 (fmin 0.2 (/ f0-7 4))))) ) ) (if (>= (-> arg0 blend 1) 0.0) diff --git a/test/decompiler/reference/jak1/engine/target/target2_REF.gc b/test/decompiler/reference/jak1/engine/target/target2_REF.gc index 4d3f80d24cc..c11bbb8a072 100644 --- a/test/decompiler/reference/jak1/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target2_REF.gc @@ -1056,7 +1056,7 @@ (let ((f0-1 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not (and (< (fabs (/ f0-1 (* 0.0033333334 f1-1))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) + (while (not (and (< (fabs (/ f0-1 (/ f1-1 300))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) (suspend) (ja :num! (loop!)) (set! f0-1 (target-height-above-ground)) @@ -1789,10 +1789,10 @@ (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control unknown-float62))))) ) (let ((f1-4 (fabs (- f0-10 f30-1)))) - (set! f30-1 (seek f30-1 f0-10 (fmax 0.05 (fmin 0.2 (* 0.25 f1-4))))) + (set! f30-1 (seek f30-1 f0-10 (fmax 0.05 (fmin 0.2 (/ f1-4 4))))) ) (let ((f0-14 (fabs (- f24-0 f28-0)))) - (set! f28-0 (seek f28-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))) + (set! f28-0 (seek f28-0 f24-0 (fmax 0.05 (fmin 0.2 (/ f0-14 4))))) ) ) (ja :chan 3 :group! eichar-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist)) diff --git a/test/decompiler/reference/jak1/engine/target/target_REF.gc b/test/decompiler/reference/jak1/engine/target/target_REF.gc index a2b8fde3953..1cec14bd477 100644 --- a/test/decompiler/reference/jak1/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target_REF.gc @@ -655,7 +655,7 @@ (set! f30-0 1.0) ) ((ja-group? eichar-attack-from-stance-ja) - (let ((f30-1 (fmax 0.8 (fmin 1.0 (* 0.000048828126 (-> self control unknown-float01)))))) + (let ((f30-1 (fmax 0.8 (fmin 1.0 (/ (-> self control unknown-float01) (meters 5)))))) (cond ((and (rand-vu-percent? (the-as float 0.3)) (< 20480.0 (-> self control unknown-float01))) (ja-no-eval :group! eichar-attack-from-stance-alt-end-ja @@ -872,10 +872,10 @@ ) 0 (let ((f0-64 (fabs (- f22-0 f28-2)))) - (set! f28-2 (seek f28-2 f22-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-64))))) + (set! f28-2 (seek f28-2 f22-0 (fmax 0.05 (fmin 0.2 (/ f0-64 4))))) ) (let ((f0-69 (fabs (- f24-0 f26-1)))) - (set! f26-1 (seek f26-1 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-69))))) + (set! f26-1 (seek f26-1 f24-0 (fmax 0.05 (fmin 0.2 (/ f0-69 4))))) ) ) (cond @@ -2250,7 +2250,7 @@ ) (else (let* ((f1-5 (/ f0-1 (* (-> self control dynam gravity-length) (seconds-per-frame)))) - (f30-0 (* 0.5 f1-5 (seconds-per-frame) f0-1)) + (f30-0 (* (/ f1-5 2) (seconds-per-frame) f0-1)) ) (if (ja-group? eichar-attack-uppercut-ja) (set! f30-0 @@ -2339,7 +2339,7 @@ (let ((f0-8 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not (or (and (< (fabs (/ f0-8 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) + (while (not (or (and (< (fabs (/ f0-8 (/ f1-1 300))) 150.0) (< f1-1 0.0)) (time-elapsed? (-> self state-time) (seconds 1.7)) ) ) diff --git a/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc b/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc index 5375339b801..5407aa928dd 100644 --- a/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc @@ -1301,10 +1301,7 @@ (when *target* (when (!= *master-mode* 'pause) (let ((a0-2 (-> this icons 0 icon 0 root))) - (set-yaw-angle-clear-roll-pitch! - a0-2 - (+ (y-angle a0-2) (* 182.04445 (* 0.5 (-> *display* time-adjust-ratio)))) - ) + (set-yaw-angle-clear-roll-pitch! a0-2 (+ (y-angle a0-2) (* 182.04445 (/ (-> *display* time-adjust-ratio) 2)))) ) ) (set! (-> this icons 0 icon-y) (-> this icon-pos-y)) @@ -1312,7 +1309,7 @@ (let ((s5-1 (new 'stack-no-clear 'vector))) (vector<-cspace! s5-1 (-> this icons 0 icon 0 node-list data 3)) (set! (-> this particles 0 pos x) (-> s5-1 x)) - (set! (-> this particles 0 pos y) (* 0.5 (-> s5-1 y))) + (set! (-> this particles 0 pos y) (/ (-> s5-1 y) 2)) (set! (-> this particles 0 pos z) (+ 2.0 (* 0.05 (+ -2048.0 (-> s5-1 z))))) ) ) diff --git a/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc index 86e338be56f..39c37625974 100644 --- a/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc @@ -61,7 +61,7 @@ (let ((a0-18 (-> this icons sv-144 icon 0 root))) (set! sv-176 a0-18) (set! sv-160 (method-of-object sv-176 set-yaw-angle-clear-roll-pitch!)) - (let ((a1-2 (+ (y-angle a0-18) (* 182.04445 (* 0.5 (-> *display* time-adjust-ratio)))))) + (let ((a1-2 (+ (y-angle a0-18) (* 182.04445 (/ (-> *display* time-adjust-ratio) 2))))) (sv-160 sv-176 a1-2) ) ) @@ -1704,7 +1704,7 @@ (case (-> s3-0 s0-0 option-type) (((game-option-type slider)) (let* ((v1-82 (the-as uint #x8000ffff)) - (f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) + (f0-12 (/ (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))) 100)) (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) ) @@ -2006,7 +2006,7 @@ *temp-string* s3-0 (the int (+ 428.0 (the float s5-0) f30-0)) - (- 12 (the int (* 0.16666667 f30-0))) + (- 12 (the int (/ f30-0 6))) (font-color default) (font-flags shadow kerning large) ) @@ -2017,7 +2017,7 @@ *temp-string* s3-0 (the int (+ 456.0 (the float (adjust-pos s5-0 50)) f30-0)) - (- 48 (the int (* 0.125 f30-0))) + (- 48 (the int (/ f30-0 8))) (font-color default) (font-flags shadow kerning large) ) diff --git a/test/decompiler/reference/jak1/engine/ui/text_REF.gc b/test/decompiler/reference/jak1/engine/ui/text_REF.gc index 900ae1b2119..8abc57e0071 100644 --- a/test/decompiler/reference/jak1/engine/ui/text_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/text_REF.gc @@ -434,7 +434,7 @@ ) (set! sv-168 0) (if (logtest? (-> gp-0 flags) (font-flags middle)) - (+! (-> gp-0 origin x) (* 0.5 (-> font-ctxt width))) + (+! (-> gp-0 origin x) (/ (-> font-ctxt width) 2)) ) (set! sv-176 (the-as int (-> sv-140 0))) (set! sv-184 0) diff --git a/test/decompiler/reference/jak1/engine/util/smush-control-h_REF.gc b/test/decompiler/reference/jak1/engine/util/smush-control-h_REF.gc index 0c6d60b640e..87f280c29ca 100644 --- a/test/decompiler/reference/jak1/engine/util/smush-control-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/smush-control-h_REF.gc @@ -110,7 +110,7 @@ ;; definition for method 12 of type smush-control (defmethod activate! ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float)) - (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) + (when (>= (fabs (/ (-> this amp) 5)) (fabs (get-no-update this))) (set! (-> this amp) arg0) (set! (-> this period) (the float arg1)) (set! (-> this duration) (the float arg2)) diff --git a/test/decompiler/reference/jak1/engine/util/sync-info_REF.gc b/test/decompiler/reference/jak1/engine/util/sync-info_REF.gc index d7f6bd674ec..d0608b75212 100644 --- a/test/decompiler/reference/jak1/engine/util/sync-info_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/sync-info_REF.gc @@ -400,7 +400,7 @@ (defmethod set-params! ((this delayed-rand-float) (min-tim int) (max-time int) (max-times-two float)) (set! (-> this min-time) min-tim) (set! (-> this max-time) max-time) - (set! (-> this max-val) (* 0.5 max-times-two)) + (set! (-> this max-val) (/ max-times-two 2)) (set! (-> this start-time) 0) (set! (-> this timer) 0) (set! (-> this value) 0.0) @@ -496,8 +496,8 @@ (defmethod set-params! ((this delayed-rand-vector) (min-time int) (max-time int) (xz-range float) (y-range float)) (set! (-> this min-time) min-time) (set! (-> this max-time) max-time) - (set! (-> this xz-max) (* 0.5 xz-range)) - (set! (-> this y-max) (* 0.5 y-range)) + (set! (-> this xz-max) (/ xz-range 2)) + (set! (-> this y-max) (/ y-range 2)) (set! (-> this start-time) 0) (set! (-> this timer) 0) (vector-reset! (-> this value)) diff --git a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc index 8d6b2c4e568..4e8383151eb 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc @@ -653,7 +653,7 @@ (set-vector! s4-0 (+ (-> s5-1 x) (-> s3-0 x)) (-> s5-1 y) (+ (-> s5-1 z) (-> s3-0 z)) 1.0) (vector-float*! s3-0 s3-0 10.0) (spawn-flying-rock s4-0 s3-0 1.0 (-> self entity)) - (set-vector! s3-0 (+ (* -0.866 f26-0) (* 0.5 f28-0)) (* 0.5 f30-0) (+ (* 0.866 f28-0) (* 0.5 f26-0)) 1.0) + (set-vector! s3-0 (+ (* -0.866 f26-0) (/ f28-0 2)) (/ f30-0 2) (+ (* 0.866 f28-0) (/ f26-0 2)) 1.0) (set-vector! s4-0 (-> s5-1 x) (+ 3276.8 (-> s5-1 y)) (-> s5-1 z) 1.0) (vector-float*! s3-0 s3-0 10.0) (spawn-flying-rock s4-0 s3-0 1.0 (-> self entity)) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc index d0549689c22..ce152d014b0 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc @@ -415,7 +415,7 @@ lurkerworm-default-post-behavior ) ) ) - (f30-2 (* 0.2 f0-13)) + (f30-2 (/ f0-13 5)) ) (if (< (rand-float-gen) f30-2) (go lurkerworm-strike) diff --git a/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc b/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc index abe07d4749a..5c7394fd305 100644 --- a/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc @@ -253,7 +253,7 @@ ) ) (set! (-> this tilt) (- f0-5)) - (set! (-> this heading) (the float (sar (shl (the int (+ (-> this heading) (* 0.05 f0-5))) 48) 48))) + (set! (-> this heading) (the float (sar (shl (the int (+ (-> this heading) (/ f0-5 20))) 48) 48))) ) 0 (none) @@ -303,7 +303,7 @@ ) ) (set! (-> v1-15 tilt) (- f0-7)) - (set! (-> v1-15 heading) (the float (sar (shl (the int (+ (-> v1-15 heading) (* 0.05 f0-7))) 48) 48))) + (set! (-> v1-15 heading) (the float (sar (shl (the int (+ (-> v1-15 heading) (/ f0-7 20))) 48) 48))) ) 0 ) @@ -337,7 +337,7 @@ ) ) (set! (-> v1-18 tilt) (- f0-20)) - (set! (-> v1-18 heading) (the float (sar (shl (the int (+ (-> v1-18 heading) (* 0.05 f0-20))) 48) 48))) + (set! (-> v1-18 heading) (the float (sar (shl (the int (+ (-> v1-18 heading) (/ f0-20 20))) 48) 48))) ) 0 ) @@ -547,8 +547,8 @@ (let ((f30-1 (* arg0 (sin (-> this heading)))) (f0-4 (* arg0 (cos (-> this heading)))) ) - (set! (-> this root transv x) (+ (* 0.8 (-> this root transv x)) (* 0.2 f30-1))) - (set! (-> this root transv z) (+ (* 0.8 (-> this root transv z)) (* 0.2 f0-4))) + (set! (-> this root transv x) (+ (* 0.8 (-> this root transv x)) (/ f30-1 5))) + (set! (-> this root transv z) (+ (* 0.8 (-> this root transv z)) (/ f0-4 5))) ) 0 (none) @@ -645,8 +645,8 @@ (f30-2 (* f28-0 (sin (-> gp-1 heading)))) (f0-10 (* f28-0 (cos (-> gp-1 heading)))) ) - (set! (-> gp-1 root transv x) (+ (* 0.8 (-> gp-1 root transv x)) (* 0.2 f30-2))) - (set! (-> gp-1 root transv z) (+ (* 0.8 (-> gp-1 root transv z)) (* 0.2 f0-10))) + (set! (-> gp-1 root transv x) (+ (* 0.8 (-> gp-1 root transv x)) (/ f30-2 5))) + (set! (-> gp-1 root transv z) (+ (* 0.8 (-> gp-1 root transv z)) (/ f0-10 5))) ) 0 ) @@ -724,7 +724,7 @@ ) ) (set! (-> v1-34 tilt) (- f0-12)) - (set! (-> v1-34 heading) (the float (sar (shl (the int (+ (-> v1-34 heading) (* 0.05 f0-12))) 48) 48))) + (set! (-> v1-34 heading) (the float (sar (shl (the int (+ (-> v1-34 heading) (/ f0-12 20))) 48) 48))) ) 0 ) @@ -758,7 +758,7 @@ ) ) (set! (-> v1-37 tilt) (- f0-25)) - (set! (-> v1-37 heading) (the float (sar (shl (the int (+ (-> v1-37 heading) (* 0.05 f0-25))) 48) 48))) + (set! (-> v1-37 heading) (the float (sar (shl (the int (+ (-> v1-37 heading) (/ f0-25 20))) 48) 48))) ) 0 ) @@ -820,8 +820,8 @@ (f30-2 (* f28-0 (sin (-> s5-1 heading)))) (f0-44 (* f28-0 (cos (-> s5-1 heading)))) ) - (set! (-> s5-1 root transv x) (+ (* 0.8 (-> s5-1 root transv x)) (* 0.2 f30-2))) - (set! (-> s5-1 root transv z) (+ (* 0.8 (-> s5-1 root transv z)) (* 0.2 f0-44))) + (set! (-> s5-1 root transv x) (+ (* 0.8 (-> s5-1 root transv x)) (/ f30-2 5))) + (set! (-> s5-1 root transv z) (+ (* 0.8 (-> s5-1 root transv z)) (/ f0-44 5))) ) 0 (seagull-method-27 self) @@ -915,7 +915,7 @@ ) ) (set! (-> v1-36 tilt) (- f0-12)) - (set! (-> v1-36 heading) (the float (sar (shl (the int (+ (-> v1-36 heading) (* 0.05 f0-12))) 48) 48))) + (set! (-> v1-36 heading) (the float (sar (shl (the int (+ (-> v1-36 heading) (/ f0-12 20))) 48) 48))) ) 0 ) @@ -949,7 +949,7 @@ ) ) (set! (-> v1-39 tilt) (- f0-25)) - (set! (-> v1-39 heading) (the float (sar (shl (the int (+ (-> v1-39 heading) (* 0.05 f0-25))) 48) 48))) + (set! (-> v1-39 heading) (the float (sar (shl (the int (+ (-> v1-39 heading) (/ f0-25 20))) 48) 48))) ) 0 ) @@ -969,8 +969,8 @@ (f30-0 (* f28-0 (sin (-> gp-1 heading)))) (f0-41 (* f28-0 (cos (-> gp-1 heading)))) ) - (set! (-> gp-1 root transv x) (+ (* 0.8 (-> gp-1 root transv x)) (* 0.2 f30-0))) - (set! (-> gp-1 root transv z) (+ (* 0.8 (-> gp-1 root transv z)) (* 0.2 f0-41))) + (set! (-> gp-1 root transv x) (+ (* 0.8 (-> gp-1 root transv x)) (/ f30-0 5))) + (set! (-> gp-1 root transv z) (+ (* 0.8 (-> gp-1 root transv z)) (/ f0-41 5))) ) 0 (seagull-method-27 self) @@ -1070,7 +1070,7 @@ ) ) (set! (-> v1-21 tilt) (- f0-12)) - (set! (-> v1-21 heading) (the float (sar (shl (the int (+ (-> v1-21 heading) (* 0.05 f0-12))) 48) 48))) + (set! (-> v1-21 heading) (the float (sar (shl (the int (+ (-> v1-21 heading) (/ f0-12 20))) 48) 48))) ) 0 ) @@ -1110,7 +1110,7 @@ ) ) (set! (-> v1-48 tilt) (- f0-32)) - (set! (-> v1-48 heading) (the float (sar (shl (the int (+ (-> v1-48 heading) (* 0.05 f0-32))) 48) 48))) + (set! (-> v1-48 heading) (the float (sar (shl (the int (+ (-> v1-48 heading) (/ f0-32 20))) 48) 48))) ) 0 ) @@ -1148,7 +1148,7 @@ ) ) (set! (-> v1-59 tilt) (- f0-47)) - (set! (-> v1-59 heading) (the float (sar (shl (the int (+ (-> v1-59 heading) (* 0.05 f0-47))) 48) 48))) + (set! (-> v1-59 heading) (the float (sar (shl (the int (+ (-> v1-59 heading) (/ f0-47 20))) 48) 48))) ) 0 ) diff --git a/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc index 0ac9f6174f8..4043e7615f3 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc @@ -464,7 +464,7 @@ (defmethod rigid-body-platform-method-22 ((this citb-chain-plat) (arg0 vector) (arg1 float)) (+ 12288.0 (* 2048.0 - (fmax 0.0 (fmin 1.0 (* 0.000024414063 (-> this float-height-offset)))) + (fmax 0.0 (fmin 1.0 (/ (-> this float-height-offset) (meters 10)))) (cos (* 109.22667 (+ (* 60.0 arg1) (* 0.03 (-> arg0 x)) (* 0.03 (-> arg0 z))))) ) (-> this float-height-offset) diff --git a/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc index 782707a4d86..60c341233b8 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc @@ -780,7 +780,7 @@ (ja-post) (let ((f0-4 0.0)) (countdown (v1-33 4) - (let ((a2-4 (the int (* 0.00048828125 f0-4)))) + (let ((a2-4 (the int (/ f0-4 (meters 0.5))))) (logior! (-> self angle-mask) (ash 1 a2-4)) ) (set! f0-4 (+ 16384.0 f0-4)) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc index 0d4b1322dd4..1a1f6e5b174 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc @@ -206,7 +206,7 @@ (vector-lerp! arg0 (-> self from) (-> self to) s5-0) (set! (-> arg0 y) (-> self from y)) (+! (-> arg0 y) (* (-> self y-vel) s5-0)) - (set! (-> arg0 y) (+ (-> arg0 y) (* 0.5 s5-0 s5-0 (-> self grav)))) + (set! (-> arg0 y) (+ (-> arg0 y) (* (/ s5-0 2) s5-0 (-> self grav)))) ) ) @@ -736,7 +736,7 @@ ) :code (behavior () (loop - (ja :num-func num-func-identity :frame-num (* 0.000016276043 (-> self ring radius-primary))) + (ja :num-func num-func-identity :frame-num (/ (-> self ring radius-primary) (meters 15))) (suspend) ) ) diff --git a/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc b/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc index e704258d9e7..80a2228c564 100644 --- a/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc +++ b/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc @@ -726,12 +726,7 @@ ) ) (ja-no-eval :group! eichar-flut-walk-ja :num! (loop!) :dist 49152.0 :frame-num f28-0) - (ja-no-eval :chan 1 - :group! eichar-flut-run-ja - :num! (identity (* 0.5 f28-0)) - :frame-interp f30-0 - :dist 40960.0 - ) + (ja-no-eval :chan 1 :group! eichar-flut-run-ja :num! (identity (/ f28-0 2)) :frame-interp f30-0 :dist 40960.0) (loop (suspend) (let ((f0-13 (lerp-scale diff --git a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc index bfd6ac099e5..96f0d5000ec 100644 --- a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc @@ -1020,7 +1020,7 @@ (send-event (ppointer->process (-> self parent)) 'fisher-fish-caught 1) ) ) - (set! (-> self vel) (* 0.25 (-> self vel))) + (set! (-> self vel) (/ (-> self vel) 4)) (while (< 0.1 (-> self root scale x)) (set! (-> self offset) (-> (the-as fisher (-> self parent 0)) paddle)) (fisher-fish-move) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc index 9e83996d76f..279715db344 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc @@ -198,7 +198,7 @@ :trans rider-trans :code (behavior () (loop - (ja-no-eval :group! lurkerm-tall-sail-idle-ja :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) + (ja-no-eval :group! lurkerm-tall-sail-idle-ja :num! (seek! max (/ (-> self speed) 2)) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! (-> self root quat) @@ -206,7 +206,7 @@ (* 12743.111 (seconds-per-frame) (-> self speed)) ) (suspend) - (ja :num! (seek! max (* 0.5 (-> self speed)))) + (ja :num! (seek! max (/ (-> self speed) 2))) ) ) ) @@ -298,7 +298,7 @@ :trans rider-trans :code (behavior () (loop - (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (/ (-> self speed) 2)) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! (-> self root quat) @@ -306,7 +306,7 @@ (* -12743.111 (seconds-per-frame) (-> self speed)) ) (suspend) - (ja :num! (seek! max (* 0.5 (-> self speed)))) + (ja :num! (seek! max (/ (-> self speed) 2))) ) ) ) diff --git a/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc index 7f2b583dac5..71360ab91c9 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc @@ -666,7 +666,7 @@ (loop (ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) - (set! f30-0 (- f30-0 (* 0.002 (-> *display* time-adjust-ratio)))) + (set! f30-0 (- f30-0 (/ (-> *display* time-adjust-ratio) 500))) (if (< f30-0 0.0) (go energybase-stopped) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc b/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc index 443d8d1709e..506addaced1 100644 --- a/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc @@ -290,7 +290,7 @@ baby-spider-default-event-handler (f1-1 (+ 1.0 (* 2.0 f0-0))) (f2-2 f1-1) (f2-4 (/ 1.0 f2-2)) - (f0-2 (+ 1.0 (* 0.2 f0-0))) + (f0-2 (+ 1.0 (/ f0-0 5))) ) (set! (-> this delta-wiggle-angle) (* 910.2222 f1-1)) (set! (-> this wiggle-factor) (* 1.5 f2-4)) diff --git a/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc b/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc index 6d2a81d208a..56fae2e4dd3 100644 --- a/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc @@ -360,7 +360,7 @@ (let* ((f0-5 (-> this path-u)) (f30-0 (* (-> this path-dir) f1-1 (seconds-per-frame))) (s4-0 #t) - (f0-6 (+ f0-5 (* 0.00024414062 (-> this path-units-per-meter) f30-0))) + (f0-6 (+ f0-5 (* (/ (-> this path-units-per-meter) METER_LENGTH) f30-0))) ) (cond ((< f0-6 0.0) @@ -635,7 +635,7 @@ (let ((f0-3 (driller-lurker-method-23 this)) (f1-5 (-> this path-u)) ) - (if (>= (* 0.1 (-> this path-units-per-meter)) (fabs (- f0-3 f1-5))) + (if (>= (/ (-> this path-units-per-meter) 10) (fabs (- f0-3 f1-5))) (return #t) ) ) @@ -845,7 +845,7 @@ ) (target-pos 0) (let ((f0-1 (- (s5-0 gp-0) (-> self path-u)))) - (when (>= (fabs f0-1) (* 0.1 (-> self path-units-per-meter))) + (when (>= (fabs f0-1) (/ (-> self path-units-per-meter) 10)) (cond ((< 0.0 f0-1) (when (< (-> self path-dir) 0.0) diff --git a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc index 30128705ec3..a3405c29124 100644 --- a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc @@ -571,7 +571,7 @@ ) ) (set! (-> this route total-travel-time) - (the-as time-frame (the int (/ (-> this route total-dist) (* 0.016666668 (-> this speed))))) + (the-as time-frame (the int (/ (-> this route total-dist) (/ (-> this speed) 60)))) ) (none) ) @@ -643,7 +643,7 @@ (let ((f0-1 (+ 10240.0 (-> this route surface-dist)))) (cond ((< arg3 10240.0) - (let ((f0-3 (* 0.00009765625 arg3))) + (let ((f0-3 (/ arg3 (meters 2.5)))) (vector-float*! (-> gp-0 world-pos) (-> this route src-pt-offset) f0-3) ) (set! (-> gp-0 world-pos y) (-> this route src-pt-offset y)) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc index 9aca8c88a96..17d3242fe58 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc @@ -589,7 +589,7 @@ (vector-identity! (-> this root scale)) ) (else - (let ((f0-2 (* 0.000048828126 f0-1))) + (let ((f0-2 (/ f0-1 (meters 5)))) (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) ) @@ -777,7 +777,7 @@ (vector+! v1-51 (-> this root trans) (-> this anchor-trans)) (vector-float*! v1-51 v1-51 0.5) (vector-! v1-51 v1-51 (-> this root trans)) - (set! (-> v1-51 w) (+ 28672.0 (* 0.5 (-> this dist-from-anchor)))) + (set! (-> v1-51 w) (+ 28672.0 (/ (-> this dist-from-anchor) 2))) ) (cond ((!= (-> this spin-vel) 0.0) diff --git a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc index d5c8010d19a..9c38a4d369e 100644 --- a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc @@ -561,8 +561,7 @@ (vector-float*! s5-0 *y-vector* - (* 0.25 - (-> this buoyancy-factor) + (* (/ (-> this buoyancy-factor) 4) (-> this info gravity-factor) (fmax 0.3 (fmin 1.0 f0-6)) (-> this info gravity) @@ -725,7 +724,7 @@ (seek! (-> self engine-thrust) (* (-> self throttle-control) (-> *BALLOONLURKER-bank* max-engine-thrust)) - (* 0.005 (-> *BALLOONLURKER-bank* max-engine-thrust)) + (/ (-> *BALLOONLURKER-bank* max-engine-thrust) 200) ) (let ((f0-31 60.0) (f1-14 1820.4445) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc index ee18086aea0..565637f2813 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc @@ -1225,7 +1225,7 @@ (f1-1 (vector-dot a0-4 v1-4)) ) (cond - ((and (< 0.0 f1-1) (< (fabs (* 0.5 f0-3)) f1-1)) + ((and (< 0.0 f1-1) (< (fabs (/ f0-3 2)) f1-1)) (if (send-event *target* 'query 'powerup (pickup-type eco-red)) (go mis-bone-bridge-fall #f) (go mis-bone-bridge-hit) diff --git a/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc b/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc index 65e35e0a236..d981d7f87eb 100644 --- a/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc @@ -51,7 +51,7 @@ (if (< (-> arg0 range) 0.0) (+! (-> arg0 range) 65536.0) ) - (set! (-> arg0 value) (* 0.5 (-> arg0 range))) + (set! (-> arg0 value) (/ (-> arg0 range) 2)) (set! (-> arg0 speed) arg3) 0 (none) @@ -846,9 +846,9 @@ (vector-float*! (-> self root transv) (-> self root transv) 0.5) (update-transforms! (-> self root)) (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (-> self root root-prim collide-with)) - (seek! (-> self root scale x) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - (seek! (-> self root scale y) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - (seek! (-> self root scale z) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) + (seek! (-> self root scale x) 0.0 (/ (-> *display* time-adjust-ratio) 100)) + (seek! (-> self root scale y) 0.0 (/ (-> *display* time-adjust-ratio) 100)) + (seek! (-> self root scale z) 0.0 (/ (-> *display* time-adjust-ratio) 100)) (when (< 0.05 (-> self root scale x)) (suspend) (goto cfg-3) @@ -1350,7 +1350,7 @@ ;; definition for function solve-missile-tilt (defun solve-missile-tilt ((arg0 quadratic-solution) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) - (let* ((f1-3 (* 0.5 arg2 arg2 arg4)) + (let* ((f1-3 (* (/ arg2 2) arg2 arg4)) (f0-3 f1-3) (f30-0 (- (* arg2 arg1 arg1))) (f2-6 (+ f1-3 (* arg1 arg1 arg3))) diff --git a/test/decompiler/reference/jak1/levels/misty/muse_REF.gc b/test/decompiler/reference/jak1/levels/misty/muse_REF.gc index 17f563fec2a..a30c5f1f3c5 100644 --- a/test/decompiler/reference/jak1/levels/misty/muse_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/muse_REF.gc @@ -136,10 +136,10 @@ ) ) (let ((f0-6 (- f30-0 f28-0))) - (if (< f0-6 (* -0.5 (-> self max-path-index))) + (if (< f0-6 (/ (-> self max-path-index) -2)) (+! f0-6 (-> self max-path-index)) ) - (if (< (* 0.5 (-> self max-path-index)) f0-6) + (if (< (/ (-> self max-path-index) 2) f0-6) (set! f0-6 (- f0-6 (-> self max-path-index))) ) (cond @@ -292,7 +292,7 @@ nav-enemy-default-event-handler (ja :group! muse-run-ja :num! min) (loop (suspend) - (ja :num! (loop! (* 0.000016276043 (-> self momentum-speed)))) + (ja :num! (loop! (/ (-> self momentum-speed) (meters 15)))) ) ) :post (behavior () diff --git a/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc index 12079944323..16aef2899cb 100644 --- a/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc @@ -736,7 +736,7 @@ ) (vector-! s5-0 (target-pos 5) gp-0) (let ((f1-0 (vector-xz-length s5-0))) - (set! (-> s5-0 y) (fmin (-> s5-0 y) (* 0.5 f1-0))) + (set! (-> s5-0 y) (fmin (-> s5-0 y) (/ f1-0 2))) ) (vector-normalize! s5-0 49152.0) (spawn-quicksandlurker-missile self gp-0 s5-0 (-> self entity)) diff --git a/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc b/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc index 42305d13ddc..3954900b5de 100644 --- a/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc @@ -517,7 +517,7 @@ f28-0 ) ) - (f1-10 (* 0.000012207031 f0-10)) + (f1-10 (/ f0-10 (meters 20))) (f0-12 (fmax -0.5 (fmin 0.5 f1-10))) ) (set! (-> self speed) (+ (* (+ 0.5 f0-12) (- arg2 arg3)) arg3)) diff --git a/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc index 26a28259a7b..27054ba91f1 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc @@ -1290,7 +1290,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 src) (-> self node-list data 52 bone transform vector 3)) (set! (-> gp-0 duration) - (the-as time-frame (the int (* 300.0 (+ 1.25 (* -0.25 (-> self level)) (/ 0.5 (-> self difficulty)))))) + (the-as time-frame (the int (* 300.0 (+ 1.25 (/ (-> self level) -4) (/ 0.5 (-> self difficulty)))))) ) (set! (-> gp-0 pickup-type) arg0) (set! (-> gp-0 blast-radius) 32768.0) @@ -1566,7 +1566,7 @@ (* 0.0 f28-0) ) ((< (-> self try-count) (the-as uint 10)) - (* 0.5 f28-0) + (/ f28-0 2) ) (else (empty) @@ -1640,7 +1640,7 @@ (let ((f30-0 (the float (- (current-time) (-> self hit-time))))) (when (and (> (-> self hit-count) 0) (>= 45.0 f30-0)) (set! f0-0 (+ (ja-aframe (the-as float 0.0) 1) - (* 0.022222223 f30-0 (- (ja-aframe (the-as float 8.0) 1) (ja-aframe (the-as float 0.0) 1))) + (* (/ f30-0 45) (- (ja-aframe (the-as float 8.0) 1) (ja-aframe (the-as float 0.0) 1))) ) ) (set! f1-0 (cond @@ -1817,7 +1817,7 @@ ) :code (behavior () (set! (-> self shuffle-pos) 0.0) - (let ((f30-0 (+ 1.0 (* 0.25 (-> self difficulty) (-> self level)))) + (let ((f30-0 (+ 1.0 (* (/ (-> self difficulty) 4) (-> self level)))) (gp-0 (if (rand-vu-percent? (the-as float 0.5)) 0 1 diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc index afe015bb5c8..c655bf0d324 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc @@ -882,7 +882,7 @@ (gp-0 (new 'stack 'joint-exploder-tuning 1)) ) (let* ((f0-0 (vector-length (-> s5-0 0 control transv))) - (f30-0 (fmin 1.0 (* 0.000008138021 f0-0))) + (f30-0 (fmin 1.0 (/ f0-0 (meters 30)))) ) (set! (-> gp-0 duration) (seconds 5)) (set! (-> gp-0 fountain-rand-transv-hi x) (fmax 24576.0 f0-0)) @@ -944,7 +944,7 @@ (send-event *camera* 'joystick 0.0 1.0) (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (seconds-per-frame))) (if (>= (ja-aframe-num 0) 245.0) - (set-forward-vel (* 0.5 (-> self control unknown-float01))) + (set-forward-vel (/ (-> self control unknown-float01) 2)) ) (suspend) (ja :num! (seek!)) diff --git a/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc index ab220ae2132..22e1416c05b 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc @@ -171,12 +171,8 @@ (+ 1.0 (* (fabs arg1) (lerp-scale 0.0 3.0 (-> self control unknown-float01) 0.0 (-> self racer transv-max)))) ) ) - (f28-1 - (lerp-scale 32768.0 20024.889 (-> self control unknown-float01) 0.0 (* 0.5 (-> self racer transv-max))) - ) - (f0-18 - (lerp-scale 91022.22 236657.78 (-> self control unknown-float01) 0.0 (* 0.125 (-> self racer transv-max))) - ) + (f28-1 (lerp-scale 32768.0 20024.889 (-> self control unknown-float01) 0.0 (/ (-> self racer transv-max) 2))) + (f0-18 (lerp-scale 91022.22 236657.78 (-> self control unknown-float01) 0.0 (/ (-> self racer transv-max) 8))) ) (seek! (-> self racer rotv y) (* arg0 f30-1 (- f28-1)) (* f0-18 (seconds-per-frame))) ) @@ -279,7 +275,7 @@ ) (seek! (-> self racer front-rotv) - (+ 65536.0 (* 364088.88 (+ f0-0 (* 0.1 arg1)))) + (+ 65536.0 (* 364088.88 (+ f0-0 (/ arg1 10)))) (* 364088.88 (seconds-per-frame)) ) ) @@ -690,7 +686,7 @@ (set! (-> *part-id-table* 2275 init-specs 4 initial-valuef) (+ 24576.0 f1-3)) (set! (-> *part-id-table* 2275 init-specs 19 initial-valuef) (+ 49152.0 f1-3)) (set! (-> *part-id-table* 2275 init-specs 1 initial-valuef) (* 0.0000036621095 f0-17)) - (set! (-> *part-id-table* 2275 init-specs 2 initial-valuef) (* 0.1 f0-17)) + (set! (-> *part-id-table* 2275 init-specs 2 initial-valuef) (/ f0-17 10)) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2275) s4-2) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2276) s4-2) ) @@ -822,8 +818,8 @@ ) ) (let* ((f20-0 (get-health-percent-lost *game-info* #f)) - (f22-1 (lerp-scale f22-0 (* 0.5 f22-0) f20-0 0.0 1.0)) - (f24-1 (lerp-scale f24-0 (* 0.33333334 f24-0) f20-0 0.0 1.0)) + (f22-1 (lerp-scale f22-0 (/ f22-0 2) f20-0 0.0 1.0)) + (f24-1 (lerp-scale f24-0 (/ f24-0 3) f20-0 0.0 1.0)) ) (case (-> self control poly-pat material) (((pat-material hotcoals)) @@ -1072,7 +1068,7 @@ ) (let ((f30-2 (fmin 1.0 (* 2.0 (fabs (-> self racer slide-shift-x)))))) (ja :num-func num-func-identity :frame-num (ja-aframe (-> self racer turn-anim-frame) 0)) - (ja :chan 1 :num! (chan 0) :frame-interp (+ 0.5 (* 0.025 (-> self racer tail-anim-frame)))) + (ja :chan 1 :num! (chan 0) :frame-interp (+ 0.5 (/ (-> self racer tail-anim-frame) 40))) (let ((gp-2 (-> self skel root-channel 2))) (let ((f0-82 (lerp (-> self racer slide-interp) f30-2 0.125))) (set! (-> self racer slide-interp) f0-82) @@ -1084,7 +1080,7 @@ ) (ja :chan 3 :num! (chan 0) - :frame-interp (* (-> self racer slide-interp) (+ 0.5 (* 0.025 (-> self racer tail-anim-frame)))) + :frame-interp (* (-> self racer slide-interp) (+ 0.5 (/ (-> self racer tail-anim-frame) 40))) ) 0 (none) @@ -1114,7 +1110,7 @@ (suspend) (let ((f0-4 (lerp-scale 2.0 1.0 (ja-aframe-num 0) 0.0 22.0))) (if (= (-> self next-state name) 'target-racing-falling) - (set! f0-4 (* 0.5 f0-4)) + (set! f0-4 (/ f0-4 2)) ) (ja :num! (seek! max f0-4)) ) @@ -1315,8 +1311,8 @@ ) (set! (-> self racer bob-timer) (- f1-16 (* (the float (the int (/ f1-16 f2-12))) f2-12))) ) - (when (!= (the int (/ f0-52 (* 0.5 (-> self racer bob-period)))) - (the int (/ (-> self racer bob-timer) (* 0.5 (-> self racer bob-period)))) + (when (!= (the int (/ f0-52 (/ (-> self racer bob-period) 2))) + (the int (/ (-> self racer bob-timer) (/ (-> self racer bob-period) 2))) ) (seek! (-> self racer bob-mult-trans) 1.0 0.75) (if (< 1.5 (-> self racer bob-meta-meta-timer)) @@ -1359,7 +1355,7 @@ ) ) (if (-> self racer hop?) - (set! f1-36 (* 0.5 f1-36)) + (set! f1-36 (/ f1-36 2)) ) (if (= (-> self control unknown-surface00 mode) 'air) (set! (-> self racer targ-rotx) (fmax -2730.6667 (fmin 5461.3335 f1-36))) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc index 5b91b1f3247..570e9d01b95 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc @@ -765,9 +765,9 @@ (let* ((v1-1 (max 0 (min #x2bf1d arg1))) (f0-1 (* 0.0033333334 (the float v1-1))) ) - (set! (-> arg0 digit 0) (the int (* 0.016666668 f0-1))) + (set! (-> arg0 digit 0) (the int (/ f0-1 60))) (let ((f0-2 (- f0-1 (* 60.0 (the float (-> arg0 digit 0)))))) - (set! (-> arg0 digit 1) (the int (* 0.1 f0-2))) + (set! (-> arg0 digit 1) (the int (/ f0-2 10))) (let ((f0-3 (- f0-2 (* 10.0 (the float (-> arg0 digit 1)))))) (set! (-> arg0 digit 2) (the int f0-3)) (let ((f0-4 (- f0-3 (the float (-> arg0 digit 2))))) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc index 16cf292ad01..5b0e6a5f195 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc @@ -279,7 +279,7 @@ (let* ((f2-1 (/ (- (vector-length gp-1) arg0) (- arg1 arg0))) (f0-4 (- 1.0 (fmax 0.0 (fmin 1.0 f2-1)))) (f0-5 (lerp arg3 arg2 f0-4)) - (f30-0 (* 0.0033333334 f0-5)) + (f30-0 (/ f0-5 300)) ) (cond ((or (not arg4) (< arg0 (vector-length gp-1))) diff --git a/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc b/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc index b7ef91a02c0..a8d8d93920d 100644 --- a/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc @@ -1284,7 +1284,7 @@ (if (< (-> self speed) f30-1) (set! f30-1 (-> self speed)) ) - (set! (-> self anim-blend) (fmin 1.0 (* 0.000016276043 f30-1))) + (set! (-> self anim-blend) (fmin 1.0 (/ f30-1 (meters 15)))) (vector-normalize! (-> self collide-info transv) f30-1) ) (+! (-> self collide-info transv y) -36864.0) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc index 99a6a0c2235..8e3407cbc6c 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc @@ -324,7 +324,7 @@ (deactivate self) ) (else - (let ((f0-25 (- 1.0 (* 0.0000040690106 f0-23)))) + (let ((f0-25 (- 1.0 (/ f0-23 (meters 60))))) (set! (-> self root scale x) f0-25) (set! (-> self root scale y) f0-25) (set! (-> self root scale z) f0-25) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc index 7332702349b..fbea0e8d42c 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc @@ -530,7 +530,7 @@ (when (>= f30-0 6144.0) (when (nav-enemy-method-51 this s5-0 s5-0) (set! (-> this final-dest quad) (-> s5-0 quad)) - (set! (-> this halfway-dist) (* 0.5 f30-0)) + (set! (-> this halfway-dist) (/ f30-0 2)) (set! (-> this base-hop-dist) (rand-vu-float-range 6144.0 22118.4)) (return #t) ) @@ -939,7 +939,7 @@ (let* ((s1-3 (vector-! (new 'stack-no-clear 'vector) (-> this final-dest) (-> this collide-info trans))) (f0-12 (vector-length s1-3)) ) - (let ((f1-4 (* 0.000011625744 f0-12))) + (let ((f1-4 (/ f0-12 (meters 21)))) (cond ((< 1.0 f1-4) (set! f1-4 1.0) diff --git a/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc b/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc index eaa96692f11..4f7519e6160 100644 --- a/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc @@ -666,7 +666,7 @@ (when (not (logtest? (-> *target* state-flags) (state-flags grabbed))) (let* ((f0-5 (- f0-4 (-> self root trans y))) (f0-6 (+ -40960.0 f0-5)) - (f0-7 (* 0.000024414063 f0-6)) + (f0-7 (/ f0-6 (meters 10))) ) (cond ((< f0-7 0.0) diff --git a/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc b/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc index 02a9865af44..de2031e5130 100644 --- a/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc @@ -467,7 +467,7 @@ (set! (-> this targ-trans-y) (fmax (fmin (+ 4096.0 (-> (target-pos 0) y)) (-> this top-y)) f30-1)) ) (set! (-> this root transv y) - (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root trans y))) + (* (/ (-> *display* frames-per-second) 8) (- (-> this targ-trans-y) (-> this root trans y))) ) (when (< 6144.0 (fabs (-> this root transv y))) (if (>= (-> this root transv y) 0.0) @@ -479,7 +479,7 @@ ((< (-> this root trans y) f30-0) (set! (-> this targ-trans-y) (* 0.5 (+ (-> this top-y) (-> this patrol-bottom-y)))) (set! (-> this root transv y) - (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root trans y))) + (* (/ (-> *display* frames-per-second) 8) (- (-> this targ-trans-y) (-> this root trans y))) ) (when (< 2048.0 (fabs (-> this root transv y))) (if (>= (-> this root transv y) 0.0) diff --git a/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc b/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc index 868389c1efb..c552e0f55b6 100644 --- a/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc @@ -644,7 +644,7 @@ (dotimes (v1-71 3) (+! f0-31 (-> this control-pt v1-71 trans y)) ) - (let ((f0-32 (* 0.33333334 f0-31)) + (let ((f0-32 (/ f0-31 3)) (a1-16 (new 'stack-no-clear 'vector)) ) (set! (-> a1-16 quad) (-> this root trans quad)) diff --git a/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc b/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc index a36bd70b471..3c04cebb87c 100644 --- a/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc @@ -759,7 +759,7 @@ (f1-0 f0-3) ) (if (< f30-0 0.0) - (set! f30-0 (* 0.5 f30-0)) + (set! f30-0 (/ f30-0 2)) ) (vector+! (-> arg1 vector) diff --git a/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc b/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc index 10cb137887e..09e027d1b38 100644 --- a/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc @@ -301,7 +301,7 @@ (let* ((f0-2 (* 0.000024414063 (- 40960.0 f28-0))) (f26-0 (* f0-2 f0-2)) (f0-7 (atan (- (-> gp-0 x) (-> this root trans x)) (- (-> gp-0 z) (-> this root trans z)))) - (f30-0 (* 0.5 f26-0 arg0 (seconds-per-frame))) + (f30-0 (* (/ f26-0 2) arg0 (seconds-per-frame))) (f24-0 (+ f0-7 f30-0)) (f28-1 (- f28-0 (fmin f28-0 (* 0.16874999 f26-0 (fabs arg0) (seconds-per-frame))))) (s4-1 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc b/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc index 0c254c37d96..4a1f47867b3 100644 --- a/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc @@ -875,11 +875,11 @@ (let ((f0-2 (fmin arg0 (vector-vector-distance (-> self collide-info trans) (-> self nav target-pos))))) (cond ((< 16384.0 f0-2) - (set! (-> self target-speed) (* 0.045454547 (-> *display* frames-per-second) f0-2)) + (set! (-> self target-speed) (* (/ (-> *display* frames-per-second) 22) f0-2)) (kermit-long-hop) ) (else - (set! (-> self target-speed) (* 0.1 (-> *display* frames-per-second) f0-2)) + (set! (-> self target-speed) (* (/ (-> *display* frames-per-second) 10) f0-2)) (kermit-short-hop) ) ) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc index f049c59959f..1d03a6eaab7 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc @@ -469,14 +469,14 @@ ) ((< (-> self y-offset) 0.0) (set! (-> self y-accel) - (fmin (fmin 4.096 (fmax -4.096 (+ 0.1024 (-> self y-accel)))) (* -0.0001 (-> self y-offset))) + (fmin (fmin 4.096 (fmax -4.096 (+ 0.1024 (-> self y-accel)))) (/ (-> self y-offset) -10000)) ) (set! (-> self y-vel) (fmin f28-0 (fmax f30-0 (+ (-> self y-vel) (-> self y-accel))))) (set! (-> self y-vel) (* 0.99 (-> self y-vel))) ) (else (set! (-> self y-accel) - (fmin 4.096 (fmax (fmax -4.096 (+ -0.1024 (-> self y-accel))) (* -0.0001 (-> self y-offset)))) + (fmin 4.096 (fmax (fmax -4.096 (+ -0.1024 (-> self y-accel))) (/ (-> self y-offset) -10000))) ) (set! (-> self y-vel) (fmin f28-0 (fmax f30-0 (+ (-> self y-vel) (-> self y-accel))))) (set! (-> self y-vel) (* 0.99 (-> self y-vel))) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc index 5eb8328a285..67603c7a534 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc @@ -177,7 +177,7 @@ swamp-rat-default-event-handler (f1-1 (+ 1.0 (* 2.0 f0-0))) (f2-2 f1-1) (f2-4 (/ 1.0 f2-2)) - (f0-2 (+ 1.0 (* 0.2 f0-0))) + (f0-2 (+ 1.0 (/ f0-0 5))) ) (set! (-> self delta-wiggle-angle) (* 910.2222 f1-1)) (set! (-> self wiggle-factor) (* 1.5 f2-4)) diff --git a/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc b/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc index cf3e36f804f..035741d55bd 100644 --- a/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc @@ -785,7 +785,7 @@ (set! (-> *part-id-table* 2896 init-specs 4 initial-valuef) (+ 24576.0 arg1)) (set! (-> *part-id-table* 2896 init-specs 19 initial-valuef) (+ 49152.0 arg1)) (set! (-> *part-id-table* 2896 init-specs 1 initial-valuef) (* 0.0000036621095 arg2)) - (set! (-> *part-id-table* 2896 init-specs 2 initial-valuef) (* 0.1 arg2)) + (set! (-> *part-id-table* 2896 init-specs 2 initial-valuef) (/ arg2 10)) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2896) gp-0) ) 0 @@ -822,7 +822,7 @@ (if (zero? (-> self engine-sound-id)) (set! (-> self engine-sound-id) (new-sound-id)) ) - (* 0.0000008138021 (-> self engine-thrust)) + (/ (-> self engine-thrust) (meters 300)) (let ((f30-0 (* 100.0 (-> self engine-sound-envelope))) (f28-0 (+ -1.0 (* 2.0 (-> self engine-sound-envelope)))) (gp-0 (new 'stack-no-clear 'vector)) @@ -1274,7 +1274,7 @@ (defbehavior fishermans-boat-set-throttle-by-speed fishermans-boat ((arg0 float)) (let* ((f0-0 (vector-xz-length (-> self rbody lin-velocity))) (f1-2 (/ (- arg0 f0-0) arg0)) - (f30-0 (* 0.005 f1-2)) + (f30-0 (/ f1-2 200)) ) (format *stdcon* "current ~M target ~M throttle ~f~%" f0-0 arg0 (-> self controller throttle)) (set! (-> self controller throttle) (fmax 0.0 (fmin 1.0 (+ (-> self controller throttle) f30-0)))) diff --git a/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc b/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc index c4246258d02..0423ae1a960 100644 --- a/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc @@ -333,7 +333,7 @@ (defmethod init! ((this swamp-rope-rand-float) (arg0 int) (arg1 int) (arg2 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this max-val) (* 0.5 arg2)) + (set! (-> this max-val) (/ arg2 2)) (set! (-> this timer) 0) (set! (-> this value) 0.0) 0 @@ -441,8 +441,8 @@ (defmethod init! ((this swamp-blimp-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this xz-max) (* 0.5 arg2)) - (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this xz-max) (/ arg2 2)) + (set! (-> this y-max) (/ arg3 2)) (set! (-> this timer) 0) (vector-reset! (-> this value)) 0 @@ -1272,10 +1272,10 @@ (defbehavior swamp-rope-break-code swamp-rope () (when (or (< 0.001 (fabs (-> self base-vec x))) (< 0.001 (fabs (-> self base-vec z)))) (set! (-> self base-vec x) - (- (-> self base-vec x) (* 0.02 (-> *display* time-adjust-ratio) (-> self base-vec x))) + (- (-> self base-vec x) (* (/ (-> *display* time-adjust-ratio) 50) (-> self base-vec x))) ) (set! (-> self base-vec z) - (- (-> self base-vec z) (* 0.02 (-> *display* time-adjust-ratio) (-> self base-vec z))) + (- (-> self base-vec z) (* (/ (-> *display* time-adjust-ratio) 50) (-> self base-vec z))) ) (vector-normalize! (-> self base-vec) 1.0) ) @@ -1284,8 +1284,8 @@ (set! (-> self scale-base) (- (-> self scale-base) (* f1-13 (-> *display* time-adjust-ratio)))) ) ) - (+! (-> self scale-t) (* 0.005 (-> *display* time-adjust-ratio))) - (+! (-> self x-t) (* 0.004 (-> *display* time-adjust-ratio))) + (+! (-> self scale-t) (/ (-> *display* time-adjust-ratio) 200)) + (+! (-> self x-t) (/ (-> *display* time-adjust-ratio) 250)) (+! (-> self z-t) (* 0.003 (-> *display* time-adjust-ratio))) (let ((f0-19 (* (sin (+ 32768.0 (* 65536.0 (-> self scale-t)))) (fmax 0.003 (fmin 0.1 (* 0.1 (- 3.0 (-> self scale-t)))))) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc index eb443c7a6f2..350d895a5df 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc @@ -1109,7 +1109,7 @@ (meters 0.25) ) ) - (let ((f30-0 (* 0.5 (-> *camera-combiner* fov)))) + (let ((f30-0 (/ (-> *camera-combiner* fov) 2))) (camera-fov-frame (-> *camera-combiner* inv-camera-rot) (camera-pos) @@ -1121,7 +1121,7 @@ ) (cond ((= (-> arg0 blend-to-type) (camera-blend-to-type unknown-2)) - (let ((f0-2 (* 0.5 (-> arg0 fov)))) + (let ((f0-2 (/ (-> arg0 fov) 2))) (camera-fov-frame (the-as matrix (-> *camera-combiner* tracking)) (-> arg0 trans) @@ -1133,7 +1133,7 @@ ) ) (else - (let ((f0-4 (* 0.5 (-> arg0 fov)))) + (let ((f0-4 (/ (-> arg0 fov) 2))) (camera-fov-frame (the-as matrix (-> arg0 tracking)) (-> arg0 trans) @@ -1676,7 +1676,7 @@ ;; WARN: Return type mismatch int vs none. (defun camera-master-debug ((arg0 camera-master)) (when *display-cam-other* - (let ((f0-1 (* 0.5 (-> *camera-other-fov* data)))) + (let ((f0-1 (/ (-> *camera-other-fov* data) 2))) (camera-fov-frame *camera-other-matrix* *camera-other-trans* diff --git a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc index ad8a169f33a..48b2a55f8b8 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc @@ -1260,7 +1260,7 @@ (defun fov->maya ((arg0 float)) (if (= arg0 0.0) 0.0 - (/ 12.700255 (tan (* 0.5 arg0))) + (/ 12.700255 (tan (/ arg0 2))) ) ) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc index a4fe37dd9ab..08df9864f6a 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc @@ -214,10 +214,10 @@ (let ((f30-0 (vector-dot s5-7 (-> self local-down)))) (vector--float*! s5-7 s5-7 (-> self local-down) f30-0) (if (< 0.0 f30-0) - (set! (-> self upspeed) (* 0.5 (-> self upspeed))) + (set! (-> self upspeed) (/ (-> self upspeed) 2)) ) (vector+! (-> self tpos-tgt) (-> self tpos-tgt) s5-7) - (let ((f0-26 (* 0.05 f30-0))) + (let ((f0-26 (/ f30-0 20))) (vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) f0-26) ) ) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc index d1543db1ac8..22388a14fd3 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc @@ -56,10 +56,10 @@ ) (cond ((cpad-hold? (-> *CAMERA-bank* joypad) r2) - (set! (-> s5-0 y) (- (-> s5-0 y) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) - (set! (-> s5-0 x) (- (-> s5-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0)))) - (+! (-> gp-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f28-0)) - (+! (-> gp-0 z) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f30-0)) + (set! (-> s5-0 y) (- (-> s5-0 y) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f26-0)))) + (set! (-> s5-0 x) (- (-> s5-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f0-0)))) + (+! (-> gp-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f28-0)) + (+! (-> gp-0 z) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f30-0)) ) (else (set! (-> s5-0 y) (- (-> s5-0 y) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) @@ -128,8 +128,8 @@ (let ((f30-0 (vector-length a0-7))) (cond (#f - (let* ((f28-0 (* 0.01 f30-0 (-> v1-0 x))) - (f26-0 (* 0.01 f30-0 (-> v1-0 y))) + (let* ((f28-0 (* (/ f30-0 100) (-> v1-0 x))) + (f26-0 (* (/ f30-0 100) (-> v1-0 y))) (f0-5 f28-0) (f0-7 (* f0-5 f0-5)) (f1-2 f26-0) @@ -312,13 +312,13 @@ ((cpad-hold? arg3 r2) (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) (if (cpad-hold? arg3 r1) - (+! (-> arg1 y) (+ (* 0.2 (-> *CAM_FREE-bank* speed)) (analog-input - (the-as int (-> *cpad-list* cpads arg3 abutton 9)) - 0.0 - 32.0 - 230.0 - (* 0.2 (-> *CAM_FREE-bank* speed)) - ) + (+! (-> arg1 y) (+ (/ (-> *CAM_FREE-bank* speed) 5) (analog-input + (the-as int (-> *cpad-list* cpads arg3 abutton 9)) + 0.0 + 32.0 + 230.0 + (/ (-> *CAM_FREE-bank* speed) 5) + ) ) ) ) @@ -326,13 +326,13 @@ (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) (if (cpad-hold? arg3 l1) (set! (-> arg1 y) - (- (-> arg1 y) (+ (* 0.2 (-> *CAM_FREE-bank* speed)) (analog-input - (the-as int (-> *cpad-list* cpads arg3 abutton 8)) - 0.0 - 32.0 - 230.0 - (* 0.2 (-> *CAM_FREE-bank* speed)) - ) + (- (-> arg1 y) (+ (/ (-> *CAM_FREE-bank* speed) 5) (analog-input + (the-as int (-> *cpad-list* cpads arg3 abutton 8)) + 0.0 + 32.0 + 230.0 + (/ (-> *CAM_FREE-bank* speed) 5) + ) ) ) ) @@ -372,16 +372,16 @@ ((and (not s3-0) (cpad-hold? arg3 r2)) (cond ((cpad-hold? arg3 l2) - (set! (-> arg0 y) (- (-> arg0 y) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f26-0)))) - (set! (-> arg0 x) (- (-> arg0 x) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f0-60)))) + (set! (-> arg0 y) (- (-> arg0 y) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f26-0)))) + (set! (-> arg0 x) (- (-> arg0 x) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f0-60)))) ) (else (set! (-> arg0 y) (- (-> arg0 y) (* (- f26-0) (-> *CAM_FREE-bank* rot-speed)))) (set! (-> arg0 x) (- (-> arg0 x) (* (- f0-60) (-> *CAM_FREE-bank* rot-speed)))) ) ) - (+! (-> arg1 x) (* 0.2 (-> *CAM_FREE-bank* speed) f28-14)) - (+! (-> arg1 z) (* 0.2 (-> *CAM_FREE-bank* speed) f30-14)) + (+! (-> arg1 x) (* (/ (-> *CAM_FREE-bank* speed) 5) f28-14)) + (+! (-> arg1 z) (* (/ (-> *CAM_FREE-bank* speed) 5) f30-14)) ) ((and (not s3-0) (cpad-hold? arg3 l2)) (+! (-> arg1 x) (* f28-14 (-> *CAM_FREE-bank* speed))) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc index 214a30274fb..450f49abb36 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc @@ -2398,7 +2398,7 @@ (set! f28-0 0.0) ) (if (-> self have-phony-joystick) - (set! f28-0 (* 0.05 (-> self phony-joystick-y))) + (set! f28-0 (/ (-> self phony-joystick-y) 20)) ) (if (and (-> *camera* being-attacked) (not (time-elapsed? (-> *camera* attack-start) (seconds 0.25)))) (set! f28-0 0.05) @@ -2421,7 +2421,7 @@ (let ((f0-23 f26-0)) (when (< f26-0 0.0) (let ((f0-26 - (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (* 0.5 (-> self string-min-val z))) + (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (/ (-> self string-min-val z) 2)) ) ) (set! f0-23 (fmin 0.75 f0-26)) diff --git a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc index 6fe3ff881cd..b3db1fe81d9 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc @@ -272,7 +272,7 @@ 0.0 ) ((>= 0.25 arg0) - (* 0.5 arg0) + (/ arg0 2) ) ((>= arg0 0.75) (- 1.0 (* 0.5 (- 1.0 arg0))) @@ -768,7 +768,7 @@ (the-as vector (-> this point (-> this end-point))) ) (let* ((f0-0 (vector-length s3-0)) - (f1-1 (* 0.33333334 (- 1.5 (* 0.00024414062 f0-0)))) + (f1-1 (* 0.33333334 (- 1.5 (/ f0-0 METER_LENGTH)))) ) 0.0 (let* ((f1-2 (fmax 0.0 f1-1)) @@ -798,7 +798,7 @@ (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-18))) ) (let* ((f0-5 (vector-normalize-ret-len! s2-0 1.0)) - (f0-6 (* 0.5 f0-5)) + (f0-6 (/ f0-5 2)) (f26-0 (* (fmin 1.0 f0-6) f30-0 (vector-dot arg0 s2-0))) ) (let ((f1-14 (vector-dot s2-0 s3-0))) @@ -873,7 +873,7 @@ (tracking-spline-method-19 this (* (-> this max-move) (-> pp clock time-adjust-ratio)) arg0 s4-0) (tracking-spline-method-14 this s4-0) (dotimes (s3-0 63) - (tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 s4-0) + (tracking-spline-method-18 this (/ (-> this sample-len) 64) arg0 s4-0) ) (vector-float*! arg0 arg0 0.015625) (let ((a2-3 (-> s4-0 cur-pt))) @@ -1265,7 +1265,7 @@ (vector-! s2-0 s2-0 (-> arg0 follow-off)) (vector-float*! s2-0 s2-0 f0-23) ) - (+! (-> arg0 follow-blend) (* 0.016666668 (-> pp clock time-adjust-ratio))) + (+! (-> arg0 follow-blend) (/ (-> pp clock time-adjust-ratio) 60)) (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s2-0) ) (else @@ -1497,7 +1497,7 @@ (let ((f28-0 (vector-dot s3-0 (the-as vector (-> arg0 vector))))) (set! sv-128 s2-0) (set! sv-112 (-> arg0 vector)) - (let ((f0-7 (* 0.8 (tan (* 0.5 arg2))))) + (let ((f0-7 (* 0.8 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-112 0 quad)) (let ((v1-11 f0-7)) (.mov vf2 v1-11) @@ -1530,7 +1530,7 @@ (let ((f28-1 (vector-dot s3-0 (-> arg0 vector 1)))) (set! sv-160 s2-0) (set! sv-144 (-> arg0 vector 1)) - (let ((f0-16 (* 0.525 (tan (* 0.5 arg2))))) + (let ((f0-16 (* 0.525 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-144 quad)) (let ((v1-32 f0-16)) (.mov vf2 v1-32) @@ -1556,7 +1556,7 @@ (let ((f28-2 (vector-dot s3-0 (-> arg0 vector 1)))) (let ((s0-1 s2-0)) (set! sv-176 (-> arg0 vector 1)) - (let ((f0-26 (* 0.525 (tan (* 0.5 arg2))))) + (let ((f0-26 (* 0.525 (tan (/ arg2 2))))) (vector-float*! s0-1 sv-176 f0-26) ) ) @@ -1716,7 +1716,7 @@ (set! sv-256 vector-into-frustum-nosmooth!) (set! sv-272 s1-0) (set! sv-288 arg1) - (let ((a2-5 (lerp-clamp arg3 (* 0.25 arg3) (-> arg0 underwater-blend value)))) + (let ((a2-5 (lerp-clamp arg3 (/ arg3 4) (-> arg0 underwater-blend value)))) (sv-256 sv-272 sv-288 a2-5) ) (cond diff --git a/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc index ad9491688ea..3364cdcad93 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc @@ -514,7 +514,7 @@ ) ) (let ((f1-2 (- (- (vector-length gp-1) (-> v1-0 prim-core world-sphere w)) (-> s4-0 prim-core world-sphere w)))) - (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2))) + (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (/ f1-2 2))) ) (vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core))) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc index 1a26437caf1..9d9b234ca7d 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc @@ -124,11 +124,11 @@ ) (vector+! (-> s2-1 trans) s3-0 s4-0) (vector-float*! (-> s2-1 trans) (-> s2-1 trans) 0.5) - (+! (-> s2-1 trans y) (* 0.5 height)) + (+! (-> s2-1 trans y) (/ height 2)) (vector-! (the-as vector (-> s1-0 vector)) s4-0 s3-0) (let ((f30-1 (vector-normalize-ret-len! (the-as vector (-> s1-0 vector)) 1.0))) - (set! (-> s2-1 scale x) (* 0.00024414062 f30-1)) - (set! (-> s2-1 scale y) (* 0.00024414062 height)) + (set! (-> s2-1 scale x) (/ f30-1 METER_LENGTH)) + (set! (-> s2-1 scale y) (/ height METER_LENGTH)) (set! (-> s2-1 scale z) 0.0) (set! (-> s1-0 vector 1 quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) (vector-cross! (-> s1-0 vector 2) (the-as vector (-> s1-0 vector)) (-> s1-0 vector 1)) @@ -136,7 +136,7 @@ (matrix->quaternion (-> s2-1 quat) s1-0) (let ((v1-20 (-> this root root-prim local-sphere))) (set! (-> v1-20 x) 0.0) - (set! (-> v1-20 y) (* 0.00024414062 (* 0.5 height))) + (set! (-> v1-20 y) (* 0.00024414062 (/ height 2))) (set! (-> v1-20 z) 0.0) (let ((f0-17 0.5) (f1-7 (* f30-1 f30-1)) diff --git a/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc index cbda00792de..d6f9891a557 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc @@ -947,7 +947,7 @@ (set! (-> self root trans y) (-> self base y)) (cond ((< (-> self root transv y) -8192.0) - (set! (-> self root transv y) (* -0.5 (-> self root transv y))) + (set! (-> self root transv y) (/ (-> self root transv y) -2)) ) (else (if (and (logtest? (-> self fact options) (actor-option suck-in)) @@ -1084,7 +1084,7 @@ ) (else (if (nonzero? (-> self part)) - (set! (-> self part fade) (* 0.0033333334 f0-1)) + (set! (-> self part fade) (/ f0-1 300)) ) (when (nonzero? (-> self draw)) (logior! (-> self draw status) (draw-control-status force-fade)) @@ -3039,14 +3039,14 @@ ) ((and (>= f22-0 f0-5) (logtest? s2-1 (game-feature gun-red))) (set! s2-0 (pickup-type ammo-red)) - (set! f30-0 (* 0.5 f30-0)) + (set! f30-0 (/ f30-0 2)) ) ((and (>= f24-0 f0-5) (logtest? s2-1 (game-feature gun-blue))) (set! s2-0 (pickup-type ammo-blue)) ) ((and (>= f28-0 f0-5) (logtest? s2-1 (game-feature gun-dark))) (set! s2-0 (pickup-type ammo-dark)) - (set! f30-0 (* 0.1 f30-0)) + (set! f30-0 (/ f30-0 10)) ) (else (set! s2-0 (pickup-type eco-pill-dark)) diff --git a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc index 84eb2816569..cc208ca8471 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc @@ -1363,9 +1363,9 @@ ;; WARN: Return type mismatch int vs none. (defmethod smush-update! ((this crate)) (let ((f0-0 (update! (-> this smush)))) - (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale x) (+ 1.0 (/ f0-0 -2))) (set! (-> this root scale y) (+ 1.0 f0-0)) - (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale z) (+ 1.0 (/ f0-0 -2))) ) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc index f6774a678f7..cf884d6db61 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc @@ -324,7 +324,7 @@ (f0-9 (fmax -1.0 (fmin 1.0 f0-7))) ) (set! (-> gp-0 global-scale) (* 4096.0 (* 3.0 (+ 1.0 f0-9)))) - (set! (-> gp-0 individual-normal-scale) (+ 0.5 (* 0.5 f0-9))) + (set! (-> gp-0 individual-normal-scale) (+ 0.5 (/ f0-9 2))) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc index 60d2b1d1faa..ab9f4fcf098 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc @@ -875,7 +875,7 @@ (set! (-> *part-id-table* 506 init-specs 4 initial-valuef) (+ 24576.0 f30-0)) (set! (-> *part-id-table* 506 init-specs 19 initial-valuef) (+ 49152.0 f30-0)) (set! (-> *part-id-table* 506 init-specs 1 initial-valuef) (* 0.0000036621095 f28-0)) - (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (* 0.1 f28-0)) + (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (/ f28-0 10)) (set! (-> *part-id-table* 506 init-specs 13 initial-valuef) 0.7111111) (set! (-> *part-id-table* 506 init-specs 3 initial-valuef) (-> this wake-size)) (set! (-> *part-id-table* 506 init-specs 5 initial-valuef) (-> this wake-size)) @@ -1134,7 +1134,7 @@ ) (set-time! (-> this drip-time)) (logclear! (-> this flags) (water-flags spawn-drip)) - (seek! (-> this drip-wetness) 0.0 (* 0.001 (-> this drip-speed))) + (seek! (-> this drip-wetness) 0.0 (/ (-> this drip-speed) 1000)) (set! (-> this drip-speed) (* 1.05 (-> this drip-speed))) (if (= (-> this drip-wetness) 0.0) (set! (-> this drip-height) 0.0) @@ -1193,9 +1193,9 @@ (set! (-> *part-id-table* 512 init-specs 12 random-rangef) (* 13.653334 (* -0.075 f0-0))) (set! (-> *part-id-table* 513 init-specs 12 initial-valuef) (* 13.653334 (* -0.15 f0-0))) (set! (-> *part-id-table* 513 init-specs 12 random-rangef) (* 13.653334 (* -0.075 f0-0))) - (set! (-> *part-id-table* 519 init-specs 2 initial-valuef) (* 4096.0 (* 0.1 f0-0))) + (set! (-> *part-id-table* 519 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 10))) (set! (-> *part-id-table* 519 init-specs 2 random-rangef) (* 4096.0 (* 0.4 f0-0))) - (set! (-> *part-id-table* 519 init-specs 4 initial-valuef) (* 4096.0 (* 0.1 f0-0))) + (set! (-> *part-id-table* 519 init-specs 4 initial-valuef) (* 4096.0 (/ f0-0 10))) (set! (-> *part-id-table* 519 init-specs 4 random-rangef) (* 4096.0 (* 0.4 f0-0))) (set! (-> *part-id-table* 519 init-specs 9 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 519 init-specs 9 random-rangef) (* 13.653334 (* 3.4 f0-0))) @@ -1209,11 +1209,11 @@ (set! (-> *part-id-table* 516 init-specs 10 random-rangef) (* 13.653334 (* 2.4 f0-0))) (set! (-> *part-id-table* 516 init-specs 11 initial-valuef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 516 init-specs 11 random-rangef) (* 13.653334 (* 2.4 f0-0))) - (set! (-> *part-id-table* 520 init-specs 1 initial-valuef) (* 0.5 f0-0)) - (set! (-> *part-id-table* 520 init-specs 2 initial-valuef) (* 4096.0 (* -0.25 f0-0))) - (set! (-> *part-id-table* 520 init-specs 2 random-rangef) (* 4096.0 (* 0.5 f0-0))) - (set! (-> *part-id-table* 520 init-specs 3 initial-valuef) (* 4096.0 (* -0.25 f0-0))) - (set! (-> *part-id-table* 520 init-specs 3 random-rangef) (* 4096.0 (* 0.5 f0-0))) + (set! (-> *part-id-table* 520 init-specs 1 initial-valuef) (/ f0-0 2)) + (set! (-> *part-id-table* 520 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 -4))) + (set! (-> *part-id-table* 520 init-specs 2 random-rangef) (* 4096.0 (/ f0-0 2))) + (set! (-> *part-id-table* 520 init-specs 3 initial-valuef) (* 4096.0 (/ f0-0 -4))) + (set! (-> *part-id-table* 520 init-specs 3 random-rangef) (* 4096.0 (/ f0-0 2))) (set! (-> *part-id-table* 520 init-specs 10 initial-valuef) (* 13.653334 (* -0.75 f0-0))) (set! (-> *part-id-table* 520 init-specs 10 random-rangef) (* 13.653334 (* 1.5 f0-0))) (set! (-> *part-id-table* 520 init-specs 12 initial-valuef) (* 13.653334 (* -0.75 f0-0))) @@ -1222,7 +1222,7 @@ (set! (-> *part-id-table* 520 init-specs 11 random-rangef) (* 13.653334 (* 2.0 f0-0))) (set! (-> *part-id-table* 520 init-specs 15 initial-valuef) (* 13.653334 (* -0.3 f0-0))) (set! (-> *part-id-table* 520 init-specs 15 random-rangef) (* 13.653334 (* -0.075 f0-0))) - (set! (-> *part-id-table* 517 init-specs 1 initial-valuef) (* 0.5 f0-0)) + (set! (-> *part-id-table* 517 init-specs 1 initial-valuef) (/ f0-0 2)) (set! (-> *part-id-table* 517 init-specs 2 initial-valuef) (* 1.2 f0-0)) (set! (-> *part-id-table* 517 init-specs 9 initial-valuef) (* 13.653334 f0-0)) (set! (-> *part-id-table* 517 init-specs 9 random-rangef) (* 13.653334 (* 2.0 f0-0))) @@ -1245,10 +1245,10 @@ (set! (-> *part-id-table* 515 init-specs 13 initial-valuef) (* 13.653334 (* -0.3 f0-0))) (set! (-> *part-id-table* 515 init-specs 13 random-rangef) (* 13.653334 (* -0.075 f0-0))) (set! (-> *part-id-table* 514 init-specs 2 initial-valuef) (* 4096.0 (* 1.2 f0-0))) - (set! (-> *part-id-table* 514 init-specs 2 random-rangef) (* 4096.0 (* 0.2 f0-0))) + (set! (-> *part-id-table* 514 init-specs 2 random-rangef) (* 4096.0 (/ f0-0 5))) (set! (-> *part-id-table* 514 init-specs 3 initial-valuef) (* 4096.0 (* 0.4 f0-0))) (set! (-> *part-id-table* 514 init-specs 3 random-rangef) (* 4096.0 (* 1.2 f0-0))) - (set! (-> *part-id-table* 514 init-specs 7 initial-valuef) (* 4096.0 (* 0.2 f0-0))) + (set! (-> *part-id-table* 514 init-specs 7 initial-valuef) (* 4096.0 (/ f0-0 5))) (set! (-> *part-id-table* 514 init-specs 7 random-rangef) (* 4096.0 (* 2.2 f0-0))) (set! (-> *part-id-table* 518 init-specs 2 initial-valuef) (* 4096.0 (* 0.3 f0-0))) (set! (-> *part-id-table* 518 init-specs 2 random-rangef) (* 4096.0 (* 0.9 f0-0))) @@ -1361,7 +1361,7 @@ (set! (-> *part-id-table* 506 init-specs 4 initial-valuef) (+ 24576.0 arg0)) (set! (-> *part-id-table* 506 init-specs 19 initial-valuef) (+ 49152.0 arg0)) (set! (-> *part-id-table* 506 init-specs 1 initial-valuef) (* 0.0000036621095 f30-0)) - (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (* 0.1 f30-0)) + (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (/ f30-0 10)) (set! (-> *part-id-table* 506 init-specs 13 initial-valuef) 0.7111111) (set! (-> *part-id-table* 506 init-specs 3 initial-valuef) arg3) (set! (-> *part-id-table* 506 init-specs 5 initial-valuef) arg3) diff --git a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc index c3c71c62395..c1524e44cf2 100644 --- a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc @@ -267,13 +267,13 @@ (case arg0 (('close) (if (and *math-camera* *subdivide-settings*) - (* 0.00024414062 (-> *subdivide-settings* close 7)) + (/ (-> *subdivide-settings* close 7) METER_LENGTH) arg3 ) ) (('far) (if (and *math-camera* *subdivide-settings*) - (* 0.00024414062 (-> *subdivide-settings* far 7)) + (/ (-> *subdivide-settings* far 7) METER_LENGTH) arg3 ) ) @@ -548,7 +548,7 @@ (if (= arg1 (debug-menu-msg press)) (set! (-> v1-0 camera-to-bbox-dist) (* 4096.0 arg2)) ) - (* 0.00024414062 (-> v1-0 camera-to-bbox-dist)) + (/ (-> v1-0 camera-to-bbox-dist) METER_LENGTH) ) ) @@ -1015,7 +1015,7 @@ ) ) ) - (* 0.00024414062 f1-2) + (/ f1-2 METER_LENGTH) ) ) (else @@ -1053,7 +1053,7 @@ (set! (-> (the-as prototype-bucket-tie gp-0) tie-vanish-far) f0-0) ) ) - (* 0.00024414062 f0-0) + (/ f0-0 METER_LENGTH) ) ) (else @@ -2613,7 +2613,7 @@ (set! (-> gp-0 dists x) (* 4096.0 arg2)) (prototype-bucket-recalc-fields gp-0) ) - (* 0.00024414062 (-> gp-0 dists x)) + (/ (-> gp-0 dists x) METER_LENGTH) ) (else (empty) @@ -2644,7 +2644,7 @@ (set! (-> gp-0 dists w) (* 4096.0 arg2)) (prototype-bucket-recalc-fields gp-0) ) - (* 0.00024414062 (-> gp-0 dists w)) + (/ (-> gp-0 dists w) METER_LENGTH) ) (else (empty) @@ -5256,13 +5256,13 @@ fog-dists x ) - (* 0.00024414062 - (-> *overide-mood-fog-table* + (/ (-> *overide-mood-fog-table* data (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) fog-dists x ) + METER_LENGTH ) ) (set! (-> *overide-mood-fog-table* @@ -5271,13 +5271,13 @@ fog-dists y ) - (* 0.00024414062 - (-> *overide-mood-fog-table* + (/ (-> *overide-mood-fog-table* data (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) fog-dists y ) + METER_LENGTH ) ) ) @@ -5290,10 +5290,10 @@ (dotimes (v1-1 8) (set! (-> *overide-mood-fog-table* data v1-1 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-1 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-1 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-1 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-1 fog-dists y) METER_LENGTH) ) ) #f @@ -5620,10 +5620,10 @@ (set! (-> *overide-mood-color-table* data v1-2 amb-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-2 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-2 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-2 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-2 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-2 fog-dists y) METER_LENGTH) ) (set-vector! (-> *time-of-day-context* times v1-2) 1.0 1.0 1.0 1.0) ) diff --git a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc index 57faf940144..2df1f39c414 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc @@ -644,7 +644,7 @@ ) (else (vector-! s5-1 (edit-get-trans s1-2) s4-1) - (let ((f0-9 (* 0.00390625 f30-1 (vector-length s5-1)))) + (let ((f0-9 (* (/ f30-1 256) (vector-length s5-1)))) (set! f0-6 (fmax -40960.0 (fmin 40960.0 f0-9))) ) (set! (-> arg0 move-speed) f0-6) @@ -694,7 +694,7 @@ ) (else (vector-! s5-2 (edit-get-trans s1-3) s4-2) - (let ((f0-21 (* 0.00390625 f30-2 (vector-length s5-2)))) + (let ((f0-21 (* (/ f30-2 256) (vector-length s5-2)))) (set! f0-18 (fmax -40960.0 (fmin 40960.0 f0-21))) ) (set! (-> arg0 move-speed) f0-18) @@ -744,7 +744,7 @@ ) (else (vector-! s5-3 (edit-get-trans s1-4) s4-3) - (let ((f0-32 (* 0.00390625 f30-3 (vector-length s5-3)))) + (let ((f0-32 (* (/ f30-3 256) (vector-length s5-3)))) (set! (-> arg0 move-speed) f0-32) (set! f0-29 (fmax -40960.0 (fmin 40960.0 f0-32))) ) diff --git a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc index 9efcbe6e2ce..d9641ec4b4c 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc @@ -1152,7 +1152,7 @@ (* 0.00024414062 (- (-> this trans x) (-> arg0 level-offset x))) (* 0.00024414062 (- (-> this trans y) (-> arg0 level-offset y))) (* 0.00024414062 (- (-> this trans z) (-> arg0 level-offset z))) - (* 0.00024414062 (-> this radius)) + (/ (-> this radius) METER_LENGTH) ) (if (= (-> this direction w) 0.0) (format s5-0 ", dir_x=0.0, dir_y=0.0, dir_z=0.0") diff --git a/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc b/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc index 10fba8472e2..1ca2634a7a3 100644 --- a/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc @@ -1896,7 +1896,7 @@ (let ((gp-0 (-> self nav-graph edge-array data (-> self selected-index)))) (format *stdcon* "Density = ~F~%" (-> gp-0 density)) (logior! (-> gp-0 mysql-save-flag) (mysql-save-flag update)) - (+! (-> gp-0 density) (* 0.01 (-> *mouse* speedx))) + (+! (-> gp-0 density) (/ (-> *mouse* speedx) 100)) (if (< (-> gp-0 density) 0.0) (set! (-> gp-0 density) 0.0) ) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc index 84eaabc9e31..a5e179f1fba 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc @@ -389,7 +389,7 @@ ) ) (set! (-> arg0 rdists z) (/ 1.0 (- (-> arg0 dists w) (-> arg0 dists z)))) - (set! (-> arg0 dists y) (* 0.5 (-> arg0 dists x))) + (set! (-> arg0 dists y) (/ (-> arg0 dists x) 2)) (set! (-> arg0 rdists y) (/ 1.0 (-> arg0 dists y))) arg0 ) diff --git a/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc b/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc index f58eaad01cc..cebdf05bed0 100644 --- a/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc @@ -1154,7 +1154,7 @@ (sound-play-by-name (sound-name-with-material "zoom-land" (-> self control ground-pat) "") (new-sound-id) - (the int (* 1024.0 (* 0.000016276043 (-> self control ground-impact-vel)))) + (the int (* 1024.0 (/ (-> self control ground-impact-vel) (meters 15)))) 0 0 (sound-group sfx) diff --git a/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc b/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc index 7fa3c75722e..94882675907 100644 --- a/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc @@ -83,7 +83,7 @@ (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) (vector-normalize! s1-0 (-> this radius)) - (vector-float*! s0-0 (-> this axis) (* 0.125 (-> this length))) + (vector-float*! s0-0 (-> this axis) (/ (-> this length) 8)) (let ((s5-0 (new 'stack-no-clear 'cylinder-verts)) (s4-0 (new 'stack-no-clear 'cylinder-verts)) (s3-0 (new 'stack-no-clear 'matrix)) @@ -270,7 +270,7 @@ (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) (vector-normalize! s1-0 (-> this radius)) - (vector-float*! s0-0 (-> this axis) (* 0.14285715 (-> this length))) + (vector-float*! s0-0 (-> this axis) (/ (-> this length) 7)) (let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s4-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s3-0 (new 'stack-no-clear 'matrix)) diff --git a/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc b/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc index 180f6daa105..a082c3d0dbc 100644 --- a/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc @@ -96,7 +96,7 @@ (.svf (&-> arg0 quad) vf3) (let* ((f0-0 (vector-length arg0)) (f1-1 (vector-dot arg0 arg2)) - (f0-2 (- (* 0.02 f0-0) f1-1)) + (f0-2 (- (/ f0-0 50) f1-1)) ) (vector+float*! arg0 arg0 arg2 (fmin 16384.0 (* 16.0 f0-2))) ) @@ -477,11 +477,11 @@ (f26-0 (vector-dot arg1 arg2)) (f28-0 (sqrtf (* 0.5 (- 1.0 f26-0)))) ) - (let ((f0-5 (sin (* 0.5 arg3)))) + (let ((f0-5 (sin (/ arg3 2)))) (cond ((< f0-5 f28-0) (set! f28-0 f0-5) - (set! (-> arg0 w) (cos (* 0.5 arg3))) + (set! (-> arg0 w) (cos (/ arg3 2))) ) (else (set! (-> arg0 w) (sqrtf (* 0.5 (+ 1.0 f26-0)))) @@ -505,11 +505,11 @@ (f26-0 (+ 1.0 (* arg4 (+ -1.0 (vector-dot arg1 arg2))))) (f28-0 (sqrtf (* 0.5 (- 1.0 f26-0)))) ) - (let ((f0-5 (sin (* 0.5 arg3)))) + (let ((f0-5 (sin (/ arg3 2)))) (cond ((< f0-5 f28-0) (set! f28-0 f0-5) - (set! (-> arg0 w) (cos (* 0.5 arg3))) + (set! (-> arg0 w) (cos (/ arg3 2))) ) (else (set! (-> arg0 w) (sqrtf (* 0.5 (+ 1.0 f26-0)))) @@ -1704,7 +1704,7 @@ ) (while (> s3-0 0) (+! s3-0 -1) - (set! f28-0 (* 0.5 f28-0)) + (set! f28-0 (/ f28-0 2)) (let ((v1-6 (cond ((< f22-0 f20-0) (curve-get-pos! s1-0 s0-1 arg0) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/ripple_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/ripple_REF.gc index 53e1672245c..c5936e941eb 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/ripple_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/ripple_REF.gc @@ -231,7 +231,7 @@ (if (< f0-23 0.0) (set! f0-23 (-> gp-0 global-scale)) ) - (+ f30-0 (* 0.0078125 f1-12 f0-23)) + (+ f30-0 (* (/ f1-12 128) f0-23)) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/video_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/video_REF.gc index 742d6d90c8e..d7a3d434b74 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/video_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/video_REF.gc @@ -32,7 +32,7 @@ (set! (-> *video-params* reset-video-mode) #t) (set! (-> *math-camera* isometric vector 1 y) 0.5) (set! (-> *math-camera* y-clip) 416.0) - (set! (-> *math-camera* y-pix) (* 0.5 (-> *math-camera* y-clip))) + (set! (-> *math-camera* y-pix) (/ (-> *math-camera* y-clip) 2)) (set! *profile-y* 1848) (set! (-> *video-params* set-video-mode) #t) 0 diff --git a/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc b/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc index a24cd23d189..7056f548e6c 100644 --- a/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc @@ -55,7 +55,7 @@ Without this corrector, the fogginess of the world would change as the FOV chang "Compute some one-time camera constants. These should only change when changing aspect ratio." (local-vars (sv-16 float)) - (set! (-> arg0 x-ratio) (tan (* 0.5 arg3))) + (set! (-> arg0 x-ratio) (tan (/ arg3 2))) (if (= arg2 'aspect4x3) (set! (-> arg0 y-ratio) (* 0.75 (-> arg0 x-ratio))) (set! (-> arg0 y-ratio) (* 0.5625 (-> arg0 x-ratio))) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc index 6d4b9172e22..8247392ce9e 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc @@ -686,7 +686,7 @@ (if (or (and (>= a0-37 350) (< a0-37 400)) (>= a0-37 500)) (+! f4-0 f0-8) ) - (let ((f0-10 (* 0.0006510417 f4-0))) + (let ((f0-10 (/ f4-0 1536))) (set! (-> arg0 times 2 w) f0-10) (set! (-> arg0 light-group 3 dir1 extra x) f0-10) ) @@ -725,7 +725,7 @@ (if (nonzero? (-> s5-0 spec-hog-2-on)) (set! (-> s5-0 spec-hog-2-on initial-valuef) f0-19) ) - (set! (-> arg0 times 3 w) (+ 0.5 (* 0.0009765625 f0-19))) + (set! (-> arg0 times 3 w) (+ 0.5 (/ f0-19 1024))) ) (set! (-> arg0 light-group 4 dir1 extra x) (-> arg0 times 3 w)) (let ((v1-6 (mod v1-5 600))) @@ -738,7 +738,7 @@ (if (nonzero? (-> s5-0 spec-hiphog-on2)) (set! (-> s5-0 spec-hiphog-on2 initial-valuef) f0-24) ) - (set! (-> arg0 times 4 w) (* 0.001953125 f0-24)) + (set! (-> arg0 times 4 w) (/ f0-24 512)) ) ) (else @@ -759,7 +759,7 @@ (if (nonzero? (-> s5-0 spec-clock-moon)) (set! (-> s5-0 spec-clock-moon initial-valuef) f0-31) ) - (set-vector! (-> arg0 times 5) 0.471 0.722 1.0 (+ 0.5 (* 0.001953125 f0-31))) + (set-vector! (-> arg0 times 5) 0.471 0.722 1.0 (+ 0.5 (/ f0-31 512))) ) ) (else @@ -767,7 +767,7 @@ (if (nonzero? (-> s5-0 spec-clock-sun)) (set! (-> s5-0 spec-clock-sun initial-valuef) f0-35) ) - (set-vector! (-> arg0 times 5) 1.0 0.99 0.54 (+ 0.5 (* 0.0009765625 f0-35))) + (set-vector! (-> arg0 times 5) 1.0 0.99 0.54 (+ 0.5 (/ f0-35 1024))) ) ) ) @@ -2803,7 +2803,7 @@ ) (when (!= (-> gp-0 explosion) 0.0) (set! (-> arg0 times 7 w) (-> gp-0 explosion)) - (let ((f0-15 (- 1.0 (* 0.5 (-> gp-0 explosion))))) + (let ((f0-15 (- 1.0 (/ (-> gp-0 explosion) 2)))) (set! (-> arg0 times 2 w) (* (-> arg0 times 2 w) f0-15)) (set! (-> arg0 times 3 w) (* (-> arg0 times 3 w) f0-15)) (set! (-> arg0 times 0 w) (* (-> arg0 times 0 w) f0-15)) @@ -2939,7 +2939,7 @@ ((< 0.0 (-> gp-1 flash)) (set! (-> gp-1 level) (-> gp-1 flash)) (set-vector! (-> gp-1 dir) 0.0 0.0 1.0 0.0) - (set! (-> gp-1 flash) (- (-> gp-1 flash) (* 0.5 (-> *display* base-clock seconds-per-frame)))) + (set! (-> gp-1 flash) (- (-> gp-1 flash) (/ (-> *display* base-clock seconds-per-frame) 2))) (set! (-> gp-1 time) 0.0) ) (else @@ -2963,7 +2963,7 @@ (let ((f30-0 (vector-length (-> gp-1 pos)))) (set! (-> gp-1 dir quad) (-> gp-1 pos quad)) (vector-normalize! (-> gp-1 dir) 1.0) - (set! (-> gp-1 level) (* (-> gp-1 scale) (- 1.0 (fmin 1.0 (* 0.000009765625 f30-0))))) + (set! (-> gp-1 level) (* (-> gp-1 scale) (- 1.0 (fmin 1.0 (/ f30-0 (meters 25)))))) ) (set! (-> gp-1 pos z) (- (-> gp-1 pos z) (* (-> gp-1 delta) (-> *display* base-clock seconds-per-frame)))) ) @@ -3077,7 +3077,7 @@ (set! (-> arg0 times 5 w) (+ (-> gp-1 purple) (-> gp-1 purple-noise))) (when (not (paused?)) (seek! (-> gp-1 purple) 0.0 (* 4.0 (seconds-per-frame))) - (set! (-> gp-1 purple-noise) (rand-vu-float-range 0.0 (* 0.2 (-> gp-1 purple)))) + (set! (-> gp-1 purple-noise) (rand-vu-float-range 0.0 (/ (-> gp-1 purple) 5))) (+! (-> gp-1 rot) (* 16384.0 (seconds-per-frame))) ) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc index f44a1902020..966b50e85b4 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc @@ -649,7 +649,7 @@ ) (cond ((< f0-3 15.0) - (set! (-> gp-1 blink) (* 0.06666667 f0-3)) + (set! (-> gp-1 blink) (/ f0-3 15)) ) ((< 45.0 f0-3) (set! (-> gp-1 blink) (* 0.06666667 (- 60.0 f0-3))) @@ -721,7 +721,7 @@ (set! (-> v1-12 r) 1.0) ) (let ((f0-8 (- 1.0 (get-sphere-interp a0-9 a1-3 1024000.0 2048000.0)))) - (update-mood-weather! *mood-control* (+ 0.25 (* 0.75 f0-8)) (+ 0.5 (* 0.5 f0-8)) 30.0 30.0) + (update-mood-weather! *mood-control* (+ 0.25 (* 0.75 f0-8)) (+ 0.5 (/ f0-8 2)) 30.0 30.0) ) ) ) @@ -1712,7 +1712,7 @@ (let ((v1-1 (level-get *level* 'palent))) (when v1-1 (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) - (set! (-> (the-as palent-states v1-2) turret-value) (* 0.5 arg0)) + (set! (-> (the-as palent-states v1-2) turret-value) (/ arg0 2)) ) ) ) @@ -1828,9 +1828,9 @@ ;; definition for function update-village1-lights (defun update-village1-lights ((arg0 mood-context)) (let ((v1-0 (-> arg0 light-group))) - (set! (-> v1-0 0 dir0 extra x) (* 0.5 (-> v1-0 0 dir0 extra x))) - (set! (-> v1-0 0 dir1 extra x) (* 0.5 (-> v1-0 0 dir1 extra x))) - (set! (-> v1-0 0 dir2 extra x) (* 0.5 (-> v1-0 0 dir2 extra x))) + (set! (-> v1-0 0 dir0 extra x) (/ (-> v1-0 0 dir0 extra x) 2)) + (set! (-> v1-0 0 dir1 extra x) (/ (-> v1-0 0 dir1 extra x) 2)) + (set! (-> v1-0 0 dir2 extra x) (/ (-> v1-0 0 dir2 extra x) 2)) (set! (-> v1-0 0 ambi extra x) (* 0.75 (-> v1-0 0 ambi extra x))) ) ) @@ -1848,7 +1848,7 @@ (set! (-> arg0 times 6 w) (- 1.0 f0-0)) (set! (-> arg0 times 7 w) f0-0) (if (!= f0-0 0.0) - (set-filter-color! (- 1.0 (* 0.25 f0-0)) (- 1.0 (* 0.5 f0-0)) 1.0) + (set-filter-color! (- 1.0 (/ f0-0 4)) (- 1.0 (/ f0-0 2)) 1.0) ) ) (when (not (paused?)) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables2_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables2_REF.gc index 7f193187cf2..71710bc1849 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables2_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables2_REF.gc @@ -428,8 +428,8 @@ (format 0 " :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%" - (* 0.00024414062 (-> *overide-table* mood-fog-table data _fog-idx fog-dists x)) - (* 0.00024414062 (-> *overide-table* mood-fog-table data _fog-idx fog-dists y)) + (/ (-> *overide-table* mood-fog-table data _fog-idx fog-dists x) METER_LENGTH) + (/ (-> *overide-table* mood-fog-table data _fog-idx fog-dists y) METER_LENGTH) (-> *overide-table* mood-fog-table data _fog-idx fog-dists w) (-> *overide-table* mood-fog-table data _fog-idx fog-dists z) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc index ef07fcabe76..cae9492d5f3 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc @@ -807,8 +807,8 @@ (set! (-> arg0 times arg1 w) f30-1) (when (not (paused?)) (if (< 0.75 f30-1) - (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.04 (-> pp clock time-adjust-ratio)))) - (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.02 (-> pp clock time-adjust-ratio)))) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (/ (-> pp clock time-adjust-ratio) 25))) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (/ (-> pp clock time-adjust-ratio) 50))) ) ) ) @@ -1661,11 +1661,11 @@ (format *stdcon* "overide fog ~f~%" (-> this overide fog)) ) (else - (format *stdcon* "time until random cloud ~f~%" (* 0.0033333334 (-> this time-until-random cloud))) + (format *stdcon* "time until random cloud ~f~%" (/ (-> this time-until-random cloud) 300)) (format *stdcon* "current cloud ~f~%" (-> this current-interp cloud)) (format *stdcon* "target cloud ~f~%" (-> this target-interp cloud)) (format *stdcon* "speed cloud ~f~%" (* (/ 1.0 (-> this speed-interp cloud)) (seconds-per-frame))) - (format *stdcon* "time until random fog ~f~%" (* 0.0033333334 (-> this time-until-random fog))) + (format *stdcon* "time until random fog ~f~%" (/ (-> this time-until-random fog) 300)) (format *stdcon* "current fog ~f~%" (-> this current-interp fog)) (format *stdcon* "target fog ~f~%" (-> this target-interp fog)) (format *stdcon* "speed fog ~f~%" (* (/ 1.0 (-> this speed-interp fog)) (seconds-per-frame))) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc index b2b21c735a7..6f9cc385459 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc @@ -198,7 +198,7 @@ (-> self time-of-day) ) (('time-of-day-norm) - (* 0.041666668 (-> self time-of-day)) + (/ (-> self time-of-day) 24) ) (('hour) (-> self hours) @@ -311,10 +311,10 @@ (set! (-> *overide-mood-color-table* data v1-8 amb-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-8 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-8 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-8 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-8 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-8 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-8 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-8 fog-dists y) METER_LENGTH) ) (set-vector! (-> *time-of-day-context* times v1-8) 1.0 1.0 1.0 1.0) ) @@ -376,7 +376,7 @@ ) (let* ((f0-23 (fmax (fmax (-> s4-0 x) (-> s4-0 y)) (-> s4-0 z))) (f2-14 (fmax (fmax (-> s5-0 x) (-> s5-0 y)) (-> s5-0 z))) - (f0-27 (fmin 0.85 (- 1.0 (/ (* 0.5 f2-14) (+ f0-23 f2-14))))) + (f0-27 (fmin 0.85 (- 1.0 (/ (/ f2-14 2) (+ f0-23 f2-14))))) (v0-1 (-> arg0 current-shadow-color)) ) (set! (-> v0-1 x) f0-27) @@ -643,8 +643,8 @@ (v1-1 (-> *time-of-day-context* current-fog)) (f1-0 (-> v1-1 fog-dists x)) (f2-0 (-> v1-1 fog-dists y)) - (f3-1 (* 0.003921569 (-> v1-1 fog-dists w))) - (f4-2 (* 0.003921569 (-> v1-1 fog-dists z))) + (f3-1 (/ (-> v1-1 fog-dists w) 255)) + (f4-2 (/ (-> v1-1 fog-dists z) 255)) ) (+ f4-2 (* (fmax 0.0 (fmin 1.0 (/ (- f0-0 f1-0) (- f2-0 f1-0)))) (- f3-1 f4-2))) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc index c937b962849..c3db5a1be42 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc @@ -17,7 +17,7 @@ (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 393216.0) (let* ((s4-0 (-> (matrix-local->world #f #f) vector 2)) (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + (f1-1 (+ 0.5 (/ (-> s4-0 y) -2))) ) (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 0.0) ) @@ -269,7 +269,7 @@ (let ((f0-16 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) (if (-> *time-of-day-context* sky) (set-vector! (-> arg0 env-color) f0-16 f0-16 f0-16 f0-16) - (set-vector! (-> arg0 env-color) f0-16 f0-16 (* 0.5 f0-16) f0-16) + (set-vector! (-> arg0 env-color) f0-16 f0-16 (/ f0-16 2) f0-16) ) ) (set-vector! (-> arg0 index-table 0) 63 84 66 0) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc index bfd27db5293..7414aa3d493 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc @@ -47,7 +47,7 @@ (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 0.000010172526) (let* ((s4-0 (-> (matrix-local->world #f #f) vector 2)) (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + (f1-1 (+ 0.5 (/ (-> s4-0 y) -2))) ) (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 128.0) ) @@ -344,7 +344,7 @@ (let ((f0-28 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) (if (-> *time-of-day-context* sky) (set-vector! (-> arg0 env-color) f0-28 f0-28 f0-28 f0-28) - (set-vector! (-> arg0 env-color) f0-28 f0-28 (* 0.5 f0-28) f0-28) + (set-vector! (-> arg0 env-color) f0-28 f0-28 (/ f0-28 2) f0-28) ) ) (set! (-> arg0 drw2-adgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1)) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc index e4eb470ffc8..e832bf6e3e7 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc @@ -597,8 +597,8 @@ ;; WARN: Return type mismatch int vs none. (defmethod ocean-method-84 ((this ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) (when (>= (-> arg1 sun 0 pos y) -150.0) - (let* ((f2-0 (* 0.00010050251 (-> arg1 sun 0 pos x))) - (f1-3 (* 0.00010050251 (-> arg1 sun 0 pos z))) + (let* ((f2-0 (/ (-> arg1 sun 0 pos x) 9950)) + (f1-3 (/ (-> arg1 sun 0 pos z) 9950)) (f0-6 (if (< 0.0 (-> arg1 sun 0 pos y)) 1.0 (* 0.006666667 (+ 150.0 (-> arg1 sun 0 pos y))) @@ -773,7 +773,7 @@ (vector--float*! s2-0 arg2 (-> s3-0 sun1-normal) 9.0) (vector--float*! s4-0 arg2 (-> s3-0 moon-normal) 9.0) (vector-float*! s5-0 s5-0 (* (-> s3-0 sun0-scale) f28-0)) - (vector+float*! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> s3-0 sun1-scale))) + (vector+float*! s5-0 s5-0 s2-0 (* (/ f28-0 4) (-> s3-0 sun1-scale))) (vector+float*! s5-0 s5-0 s4-0 (* (-> s3-0 moon-scale) f28-0)) ) (+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0))) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc index 8e0f351639d..2ea5ca5c398 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc @@ -3,8 +3,8 @@ ;; definition for method 21 of type ocean (defmethod set-corners! ((this ocean) (corner-x float) (corner-z float)) - (let* ((f2-0 (* 0.00008138021 corner-x)) - (f3-0 (* 0.00008138021 corner-z)) + (let* ((f2-0 (/ corner-x (meters 3))) + (f3-0 (/ corner-z (meters 3))) (f0-2 f2-0) (f0-4 (- f0-2 (the float (the int f0-2)))) (f1-6 f3-0) @@ -35,8 +35,8 @@ ((and (-> this heights) *ocean-map*) (let* ((f30-0 (- (-> arg0 x) (-> this start-corner x))) (f28-0 (- (-> arg0 z) (-> this start-corner z))) - (v1-3 (the int (* 0.0000025431316 f30-0))) - (a0-2 (the int (* 0.0000025431316 f28-0))) + (v1-3 (the int (/ f30-0 (meters 96)))) + (a0-2 (the int (/ f28-0 (meters 96)))) (v1-7 (-> this ocean-trans-indices data (+ (* 48 a0-2) v1-3))) ) (cond @@ -47,8 +47,8 @@ ) ) ((begin - (let ((a0-8 (logand (the int (* 0.000010172526 f30-0)) 3)) - (a3-4 (logand (the int (* 0.000010172526 f28-0)) 3)) + (let ((a0-8 (logand (the int (/ f30-0 (meters 24))) 3)) + (a3-4 (logand (the int (/ f28-0 (meters 24))) 3)) (v1-10 (-> this ocean-near-indices data (-> v1-7 child))) ) (set! v1-12 (-> (the-as (pointer int16) (+ (* (+ (* a3-4 4) a0-8) 2) (the-as int v1-10))))) @@ -61,14 +61,12 @@ ) ) (else - (let ((a0-14 (logand (the int (* 0.00008138021 f30-0)) 7))) + (let ((a0-14 (logand (the int (/ f30-0 (meters 3))) 7))) (cond - ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) - (ash 1 a0-14) - ) + ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (/ f28-0 (meters 3))) 7)) (ash 1 a0-14)) ) (let* ((f1-2 (vector-vector-distance arg0 (math-camera-pos))) - (f26-0 (- 1.0 (fmin 1.0 (* 0.000010172526 f1-2)))) + (f26-0 (- 1.0 (fmin 1.0 (/ f1-2 (meters 24))))) ) (if (-> this ocean-near-translucent?) (+ (* f26-0 (set-corners! this f30-0 f28-0)) (-> this start-corner y)) @@ -1241,7 +1239,7 @@ (vector-! (the-as vector s1-0) v1-5 (-> this start-corner)) ) (vector4-scale! s1-0 s1-0 0.0000025431316) - (set! (-> s3-0 y) (* 0.0000025431316 (-> this start-corner y))) + (set! (-> s3-0 y) (/ (-> this start-corner y) (meters 96))) (.lvf vf16 (&-> this constant quad)) (.lvf vf3 (&-> s2-0 quad)) (.lvf vf4 (&-> s1-0 quad)) diff --git a/test/decompiler/reference/jak2/engine/gfx/sky/sky-tng_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sky/sky-tng_REF.gc index bddea60ee61..013a2a2a3d1 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sky/sky-tng_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sky/sky-tng_REF.gc @@ -206,7 +206,7 @@ (vector--float*! (the-as vector s2-0) arg2 (-> arg3 sun1-normal) 9.0) (vector--float*! (the-as vector s4-0) arg2 (-> arg3 moon-normal) 9.0) (vector4-scale! s5-0 s5-0 (* (-> arg3 sun0-scale) f28-0)) - (vector4-madd! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> arg3 sun1-scale))) + (vector4-madd! s5-0 s5-0 s2-0 (* (/ f28-0 4) (-> arg3 sun1-scale))) (vector4-madd! s5-0 s5-0 s4-0 (* (-> arg3 moon-scale) f28-0)) (+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0))) (+! (-> arg0 y) (fmax (fmin (-> s5-0 z) f30-0) (- f30-0))) @@ -251,7 +251,7 @@ (vector4-scale! (the-as vector4 (-> s4-0 sun1-color)) (the-as vector4 (-> this sun1-color)) - (* 0.5 (-> s4-0 sun1-scale)) + (/ (-> s4-0 sun1-scale) 2) ) (vector4-scale! (the-as vector4 (-> s4-0 moon-color)) @@ -434,7 +434,7 @@ (vector4-scale! (the-as vector4 (-> s4-0 sun1-color)) (the-as vector4 (-> this sun1-color)) - (* 0.5 (-> s4-0 sun1-scale)) + (/ (-> s4-0 sun1-scale) 2) ) (vector4-scale! (the-as vector4 (-> s4-0 moon-color)) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc index e5915f6411d..1a2485256f7 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc @@ -301,8 +301,8 @@ (set! (-> arg1 radius) f28-0) (let ((f24-0 (sin f26-0)) (f26-1 (cos f26-0)) - (f22-0 (sin (* 0.5 f30-0))) - (f0-5 (cos (* 0.5 f30-0))) + (f22-0 (sin (/ f30-0 2))) + (f0-5 (cos (/ f30-0 2))) (a1-1 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc index f21d1f9cb8e..272ca24db70 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc @@ -58,13 +58,7 @@ (let ((rot (* 65536.0 (/ (the float turn) (the float turns))))) (set-vector! (-> tbls entry entry-idx) (* (sin rot) cam-aspx) (* (cos rot) cam-aspy) 0.0 0.0) (let ((s3-1 (+ entry-idx 1))) - (set-vector! - (-> tbls entry s3-1) - (* 0.001953125 cam-aspx (sin rot)) - (* 0.001953125 cam-aspy (cos rot)) - 0.0 - 0.0 - ) + (set-vector! (-> tbls entry s3-1) (* (/ cam-aspx 512) (sin rot)) (* (/ cam-aspy 512) (cos rot)) 0.0 0.0) (set! entry-idx (+ s3-1 1)) ) ) @@ -73,7 +67,7 @@ ) (set-vector! (-> tbls entry entry-idx) 0.0 cam-aspy 0.0 0.0) (let ((v1-20 (+ entry-idx 1))) - (set-vector! (-> tbls entry v1-20) 0.0 (* 0.001953125 cam-aspy) 0.0 0.0) + (set-vector! (-> tbls entry v1-20) 0.0 (/ cam-aspy 512) 0.0 0.0) (+ v1-20 1) ) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-glow_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-glow_REF.gc index cd93f191569..be92888460e 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-glow_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-glow_REF.gc @@ -659,7 +659,7 @@ 1.0 ) (else - (let* ((f1-1 (* 0.00024414062 a0-5)) + (let* ((f1-1 (/ a0-5 METER_LENGTH)) (f0-4 (- f1-1 (the float (the int f1-1)))) ) (let ((f1-3 (* 4096.0 (- f1-1 f0-4)))) diff --git a/test/decompiler/reference/jak2/engine/math/math_REF.gc b/test/decompiler/reference/jak2/engine/math/math_REF.gc index c2d9a8c16ae..8cc4ced3179 100644 --- a/test/decompiler/reference/jak2/engine/math/math_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/math_REF.gc @@ -76,9 +76,7 @@ (* arg0 (+ 0.33333334 (* arg0 - (+ -0.25 - (* arg0 (+ 0.2 (* arg0 (+ -0.16666666 (* arg0 (+ 0.14285715 (* arg0 (+ -0.125 (* 0.11111111 arg0))))))))) - ) + (+ -0.25 (* arg0 (+ 0.2 (* arg0 (+ -0.16666666 (* arg0 (+ 0.14285715 (* arg0 (+ -0.125 (/ arg0 9)))))))))) ) ) ) @@ -106,9 +104,7 @@ (* f0-5 (+ 0.33333334 (* f0-5 - (+ -0.25 - (* f0-5 (+ 0.2 (* f0-5 (+ -0.16666666 (* f0-5 (+ 0.14285715 (* f0-5 (+ -0.125 (* 0.11111111 f0-5))))))))) - ) + (+ -0.25 (* f0-5 (+ 0.2 (* f0-5 (+ -0.16666666 (* f0-5 (+ 0.14285715 (* f0-5 (+ -0.125 (/ f0-5 9)))))))))) ) ) ) @@ -141,9 +137,7 @@ (* f0-5 (+ 0.33333334 (* f0-5 - (+ -0.25 - (* f0-5 (+ 0.2 (* f0-5 (+ -0.16666666 (* f0-5 (+ 0.14285715 (* f0-5 (+ -0.125 (* 0.11111111 f0-5))))))))) - ) + (+ -0.25 (* f0-5 (+ 0.2 (* f0-5 (+ -0.16666666 (* f0-5 (+ 0.14285715 (* f0-5 (+ -0.125 (/ f0-5 9)))))))))) ) ) ) @@ -285,7 +279,7 @@ 0 0 (let* ((f0-1 (* 0.0033333334 (the float arg1))) - (a2-0 (the int (* 0.016666668 f0-1))) + (a2-0 (the int (/ f0-1 60))) (f0-2 (- f0-1 (* 60.0 (the float a2-0)))) (a3-0 (the int f0-2)) (f0-3 (- f0-2 (the float a3-0))) diff --git a/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc b/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc index 88453cd20e5..106f8d43dab 100644 --- a/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc @@ -19,7 +19,7 @@ (defun quaternion-axis-angle! ((arg0 quaternion) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) "Construct a quaternion from an axis and angle. The axis should be normalized." (let ((s5-0 (new 'stack-no-clear 'vector))) - (sincos! s5-0 (* 0.5 arg4)) + (sincos! s5-0 (/ arg4 2)) (let ((f0-2 (-> s5-0 x))) (set! (-> arg0 x) (* arg1 f0-2)) (set! (-> arg0 y) (* arg2 f0-2)) @@ -34,7 +34,7 @@ (defun quaternion-vector-angle! ((arg0 quaternion) (arg1 vector) (arg2 float)) "Construct a quaternion from an axis and angle. The axis should be normalized." (let ((s5-0 (new 'stack-no-clear 'vector))) - (sincos! s5-0 (* 0.5 arg2)) + (sincos! s5-0 (/ arg2 2)) (let ((f0-2 (-> s5-0 x))) (set! (-> arg0 x) (* (-> arg1 x) f0-2)) (set! (-> arg0 y) (* (-> arg1 y) f0-2)) @@ -480,7 +480,7 @@ (cond ((< 0.0 f0-2) (let ((f0-4 (sqrtf (+ 1.0 f0-2)))) - (set! (-> arg0 w) (* 0.5 f0-4)) + (set! (-> arg0 w) (/ f0-4 2)) (let ((f0-5 (/ 0.5 f0-4))) (set! (-> arg0 x) (* f0-5 (- (-> arg1 vector 1 z) (-> arg1 vector 2 y)))) (set! (-> arg0 y) (* f0-5 (- (-> arg1 vector 2 x) (-> arg1 vector 0 z)))) @@ -515,7 +515,7 @@ ) ) ) - (set! (-> arg0 data a2-0) (* 0.5 f0-12)) + (set! (-> arg0 data a2-0) (/ f0-12 2)) (if (!= f0-12 0.0) (set! f0-12 (/ 0.5 f0-12)) ) diff --git a/test/decompiler/reference/jak2/engine/math/transformq_REF.gc b/test/decompiler/reference/jak2/engine/math/transformq_REF.gc index 306dd404a6d..86728fa030b 100644 --- a/test/decompiler/reference/jak2/engine/math/transformq_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/transformq_REF.gc @@ -47,7 +47,7 @@ f30-0 ) (else - (* 0.000000001 f30-0) + (/ f30-0 1000000000) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc index b5bf70a05a3..a0e782ae960 100644 --- a/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc @@ -45,7 +45,7 @@ ;; definition for function time-to-apex (defun time-to-apex ((arg0 float) (arg1 float)) - (the int (/ arg0 (- (* 0.0033333334 arg1)))) + (the int (/ arg0 (- (/ arg1 300)))) ) ;; definition for function time-to-ground @@ -54,8 +54,8 @@ (v0-0 0) ) (while (< (- arg2) f0-0) - (set! arg0 (- arg0 (* 0.0033333334 arg1))) - (+! f0-0 (* 0.0033333334 arg0)) + (set! arg0 (- arg0 (/ arg1 300))) + (+! f0-0 (/ arg0 300)) (+! v0-0 1) ) v0-0 diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc index 31677255ec9..f3d52e72840 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc @@ -51,7 +51,7 @@ ) (matrix-identity! (-> this inertial-tensor)) (matrix-identity! (-> this inv-inertial-tensor)) - (let ((f0-4 (* 0.083333336 f24-0))) + (let ((f0-4 (/ f24-0 12))) (let* ((f1-1 f30-0) (f1-3 (* f1-1 f1-1)) (f2-0 f26-0) @@ -1515,7 +1515,7 @@ (f0-9 (/ 163840.0 (get-inv-mass a0-38))) ) (vector-reset! (-> this player-force)) - (set! (-> this player-force y) (* -0.1 f0-9 f30-2)) + (set! (-> this player-force y) (* (/ f0-9 -10) f30-2)) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc b/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc index 92d6de9b3e0..fb6f505d29e 100644 --- a/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc @@ -4,7 +4,7 @@ ;; definition for method 9 of type trajectory (defmethod compute-trans-at-time ((this trajectory) (arg0 float) (arg1 vector)) (vector+float*! arg1 (-> this initial-position) (-> this initial-velocity) arg0) - (+! (-> arg1 y) (* 0.5 arg0 arg0 (-> this gravity))) + (+! (-> arg1 y) (* (/ arg0 2) arg0 (-> this gravity))) arg1 ) @@ -32,7 +32,7 @@ (vector-! (-> this initial-velocity) arg1 arg0) (vector-xz-normalize! (-> this initial-velocity) f0-3) ) - (set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* 0.5 arg2 (-> this gravity)))) + (set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* (/ arg2 2) (-> this gravity)))) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc b/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc index 9af19d5a473..8d61a67d9cf 100644 --- a/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc @@ -160,9 +160,9 @@ ) ) ) - (set! (-> this time-adjust-ratio) (* 0.2 f0-6)) + (set! (-> this time-adjust-ratio) (/ f0-6 5)) ) - (set! (-> this seconds-per-frame) (* 0.016666668 (-> this time-adjust-ratio))) + (set! (-> this seconds-per-frame) (/ (-> this time-adjust-ratio) 60)) (set! (-> this frames-per-second) (if (= (-> this time-adjust-ratio) 0.0) 0.0 (* 60.0 (/ 1.0 (-> this time-adjust-ratio))) diff --git a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc index 996bb43b844..1ab7c9692a7 100644 --- a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc @@ -785,7 +785,7 @@ ) (let* ((v1-28 (-> s3-0 base)) (a2-23 - (+ (- 1793 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (* 0.5 (-> arg1 width))))) + (+ (- 1793 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2)))) ) (a3-8 (+ (the int (-> arg1 origin y)) 1841)) (a0-23 (+ a2-23 (-> arg0 width))) @@ -802,7 +802,7 @@ (&+! (-> s3-0 base) 112) (let* ((v1-32 (-> s3-0 base)) (a1-38 - (+ (- 1792 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (* 0.5 (-> arg1 width))))) + (+ (- 1792 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2)))) ) (a3-11 (+ (the int (-> arg1 origin y)) 1840)) (a0-30 (+ a1-38 (-> arg0 width))) diff --git a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc index b08b71fc59a..bc2d4100fe0 100644 --- a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc @@ -631,9 +631,9 @@ ) ) ) - (set! (-> arg0 x) (the int (* 0.0625 (-> v1-0 x)))) - (set! (-> arg0 y) (the int (* 0.0625 (-> v1-0 y)))) - (set! (-> arg0 z) (the int (* 0.0625 (-> v1-0 z)))) + (set! (-> arg0 x) (the int (/ (-> v1-0 x) 16))) + (set! (-> arg0 y) (the int (/ (-> v1-0 y) 16))) + (set! (-> arg0 z) (the int (/ (-> v1-0 z) 16))) ) 0 ) @@ -1162,7 +1162,7 @@ ;; definition for method 14 of type ambient-sound ;; WARN: Return type mismatch int vs none. (defmethod set-falloff-far! ((this ambient-sound) (arg0 float)) - (set! (-> this falloff-far) (the int (* 0.00024414062 arg0))) + (set! (-> this falloff-far) (the int (/ arg0 METER_LENGTH))) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc index c3e50488ab0..dc30cc94236 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc @@ -40,8 +40,8 @@ ) ) (set! (-> self board turn-anim-targ) (+ (lerp-scale - (* 0.5 (-> *TARGET_BOARD-bank* turn-frames)) - (* -0.5 (-> *TARGET_BOARD-bank* turn-frames)) + (/ (-> *TARGET_BOARD-bank* turn-frames) 2) + (/ (-> *TARGET_BOARD-bank* turn-frames) -2) f26-0 -5461.3335 5461.3335 @@ -54,8 +54,8 @@ 32768.0 ) (lerp-scale - (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) - (* -0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (/ (-> *TARGET_BOARD-bank* turn-frames) 5) + (/ (-> *TARGET_BOARD-bank* turn-frames) -5) (-> self board turn-anim-mag) 1.0 -1.0 @@ -63,7 +63,7 @@ ) ) (when (and (or (< (* f30-0 (-> self board turn-anim-targ)) 0.0) (= f30-0 0.0)) - (and (< (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) (fabs (- f30-0 (-> self board turn-anim-targ)))) + (and (< (/ (-> *TARGET_BOARD-bank* turn-frames) 5) (fabs (- f30-0 (-> self board turn-anim-targ)))) (>= (current-time) (-> self control turn-lockout-end-time)) ) ) @@ -2210,7 +2210,7 @@ (else (let ((f30-1 (* (lerp-scale 0.7 1.0 (fabs (-> self board ride-lean)) 0.0 1.0) - (lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (* 0.5 (-> self control mod-surface transv-max))) + (lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (/ (-> self control mod-surface transv-max) 2)) ) ) (f0-23 diff --git a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc index 3f33ba8c026..624d923278e 100644 --- a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc @@ -47,7 +47,7 @@ (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) (set! (-> arg0 seek0) (lerp-scale - (* 0.1 (-> arg0 seek0)) + (/ (-> arg0 seek0) 10) (-> arg0 seek0) (the float (- (current-time) (-> self board spin-time))) 0.0 @@ -56,7 +56,7 @@ ) (set! (-> arg0 seek90) (lerp-scale - (* 0.1 (-> arg0 seek90)) + (/ (-> arg0 seek90) 10) (-> arg0 seek90) (the float (- (current-time) (-> self board spin-time))) 0.0 @@ -72,8 +72,8 @@ (when (not (time-elapsed? (-> self board spin-ground-start-time) (seconds 0.3))) (set-time! (-> self control last-attack-end-time)) (set-time! (-> self board spin-ground-time)) - (set! (-> arg0 seek0) (* 0.1 (-> arg0 seek0))) - (set! (-> arg0 seek90) (* 0.1 (-> arg0 seek90))) + (set! (-> arg0 seek0) (/ (-> arg0 seek0) 10)) + (set! (-> arg0 seek90) (/ (-> arg0 seek90) 10)) (set! (-> arg0 vel-turn) 131072.0) (set! (-> arg0 turnv) 91022.22) ) @@ -1678,7 +1678,7 @@ (< 0.98 (vector-dot (-> self board unknown-vector01) (-> self control standard-dynamics gravity-normal))) (< f26-0 8192.0) (< f30-0 8192.0) - (or (< (* 0.2 f28-0) f30-0) (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)))) + (or (< (/ f28-0 5) f30-0) (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)))) ) (vector+float*! (-> self control transv) @@ -1999,7 +1999,7 @@ (set! (-> s2-0 start-pos quad) (-> v1-2 prim-core world-sphere quad)) (set! (-> s2-0 move-dist quad) (-> arg1 quad)) (let ((a0-3 s2-0)) - (set! (-> a0-3 radius) (* 0.5 (-> v1-2 prim-core world-sphere w))) + (set! (-> a0-3 radius) (/ (-> v1-2 prim-core world-sphere w) 2)) (set! (-> a0-3 collide-with) (-> v1-2 prim-core collide-with)) (set! (-> a0-3 ignore-process0) (-> arg0 process)) (set! (-> a0-3 ignore-process1) #f) @@ -2404,7 +2404,7 @@ (let* ((f30-0 (-> self board ride-speed)) (f0-4 (lerp-scale (-> self control current-surface fric) - (* 0.2 (-> self control current-surface fric)) + (/ (-> self control current-surface fric) 5) f30-0 0.0 (-> self control current-surface transv-max) diff --git a/test/decompiler/reference/jak2/engine/target/collide-reaction-target_REF.gc b/test/decompiler/reference/jak2/engine/target/collide-reaction-target_REF.gc index 9b7bcca1d35..1bfae6fbb51 100644 --- a/test/decompiler/reference/jak2/engine/target/collide-reaction-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/collide-reaction-target_REF.gc @@ -162,7 +162,7 @@ ) (when (and (or (and (< f0-27 0.95) (>= f30-0 0.0)) (and (logtest? sv-32 (cshape-reaction-flags csrf05)) (< f0-27 0.3)) - (< f1-11 (* -0.25 (-> arg1 best-my-prim local-sphere w))) + (< f1-11 (/ (-> arg1 best-my-prim local-sphere w) -4)) ) (>= (vector-dot tangent contact-normal) -0.000001) ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-yellow-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-yellow-shot_REF.gc index bb49ba5a7ab..073b3691976 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-yellow-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-yellow-shot_REF.gc @@ -122,7 +122,7 @@ (vector-normalize! s5-1 1.0) (launch-particles (-> *part-id-table* 224) gp-0) (let ((s3-0 (new 'stack-no-clear 'matrix)) - (f28-1 (* 0.000015258789 f30-0)) + (f28-1 (/ f30-0 (meters 16))) (f30-1 (-> *part-id-table* 226 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-0 s5-1 *up-vector*) diff --git a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc index c44ee51d70b..752b3a61051 100644 --- a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc @@ -622,7 +622,7 @@ (set! f2-0 (-> a1-3 a2-6 w)) ) ) - (let ((f1-1 (* 0.0625 f1-0))) + (let ((f1-1 (/ f1-0 16))) (set! (-> self control idx-of-fastest-xz-vel) a0-3) (set! (-> self control average-xz-vel) f1-1) (if (logtest? (-> self control current-surface flags) (surface-flag no-turn-around)) diff --git a/test/decompiler/reference/jak2/engine/target/mech/mech-part_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/mech-part_REF.gc index 74807024310..ef46d1d0600 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/mech-part_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/mech-part_REF.gc @@ -158,7 +158,7 @@ (quaternion-rotate-local-x! s1-0 s1-0 32768.0) (let ((a0-3 s0-0)) (let ((v1-10 arg1)) - (let ((a1-4 (* 0.5 arg4))) + (let ((a1-4 (/ arg4 2))) (.mov vf7 a1-4) ) (.lvf vf5 (&-> arg2 quad)) diff --git a/test/decompiler/reference/jak2/engine/target/mech/mech-states_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/mech-states_REF.gc index 0c56e56825a..7977192d6d0 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/mech-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/mech-states_REF.gc @@ -798,7 +798,7 @@ (else (seek! (-> self mech jump-thrust) 0.0 (* 491520.0 (seconds-per-frame))) (set! (-> self mech thruster-flame-width) (* 0.021428572 (-> self mech jump-thrust))) - (set! (-> self mech thruster-flame-length) (* 0.028571429 (-> self mech jump-thrust))) + (set! (-> self mech thruster-flame-length) (/ (-> self mech jump-thrust) 35)) ) ) ) @@ -1323,7 +1323,7 @@ (dotimes (s4-0 1) ((method-of-type sphere new) (the-as symbol (+ (the-as uint s5-0) (* s4-0 16))) sphere) ) - (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> (the-as sphere (&-> s5-0 x)) quad) (-> self control collision-spheres 2 prim-core world-sphere quad) ) @@ -2164,7 +2164,7 @@ (* 491520.0 (seconds-per-frame)) ) (set! (-> self mech thruster-flame-width) (* 0.021428572 (-> self mech jump-thrust))) - (set! (-> self mech thruster-flame-length) (* 0.028571429 (-> self mech jump-thrust))) + (set! (-> self mech thruster-flame-length) (/ (-> self mech jump-thrust) 35)) (let ((v1-120 (ja-group))) (if (and v1-120 (or (= v1-120 jakb-mech-push-ja) (= v1-120 jakb-mech-pull-ja))) (ja :num! (loop! f26-1)) diff --git a/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc b/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc index 5076adc16f3..3472804086a 100644 --- a/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc @@ -190,19 +190,19 @@ on impact, during touch, on exit, etc." ;; definition for function calc-terminal-vel (defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float)) - (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1) + (- (* (/ (- (/ arg0 60) arg1) arg2) (- 1.0 arg2)) arg1) ) ;; definition for function calc-terminal2-vel (defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))) + (let ((f0-4 (sqrtf (/ (- (/ arg0 60) arg1) arg2)))) (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))) ) ) ;; definition for function calc-terminal4-vel (defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float)) - (let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))) + (let ((f0-5 (sqrtf (sqrtf (/ (- (/ arg0 60) arg1) arg2))))) (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-anim_REF.gc b/test/decompiler/reference/jak2/engine/target/target-anim_REF.gc index 6ef41ac71b5..5ef8c403bcc 100644 --- a/test/decompiler/reference/jak2/engine/target/target-anim_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-anim_REF.gc @@ -674,7 +674,7 @@ ) ((lambda :behavior target () - (let ((f30-0 (fmax 0.8 (fmin 1.0 (* 0.000048828126 (-> self control ctrl-xz-vel)))))) + (let ((f30-0 (fmax 0.8 (fmin 1.0 (/ (-> self control ctrl-xz-vel) (meters 5)))))) (cond ((and (rand-vu-percent? 0.3) (< 20480.0 (-> self control ctrl-xz-vel))) (ja-no-eval :group! jakb-attack-from-stance-alt-end-ja :num! (seek! (ja-aframe 29.0 0) f30-0) :frame-num 0.0) @@ -1031,10 +1031,10 @@ ) ) (let ((f0-37 (fabs (- f20-0 f30-0)))) - (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-37))))) + (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (/ f0-37 4))))) ) (let ((f0-42 (fabs (- f22-1 f28-0)))) - (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (* 0.25 f0-42))))) + (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (/ f0-42 4))))) ) ) (set! (-> self control unknown-float-n12iuh3n1) f30-0) @@ -1572,7 +1572,7 @@ (let ((f0-11 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not (or (and (< (fabs (/ f0-11 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) + (while (not (or (and (< (fabs (/ f0-11 (/ f1-1 300))) 150.0) (< f1-1 0.0)) (time-elapsed? (-> self state-time) (seconds 1.7)) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-carry_REF.gc b/test/decompiler/reference/jak2/engine/target/target-carry_REF.gc index 23a3e1273a1..28c96806bca 100644 --- a/test/decompiler/reference/jak2/engine/target/target-carry_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-carry_REF.gc @@ -80,7 +80,7 @@ (dotimes (s4-0 1) ((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere) ) - (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> s5-0 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) (set! (-> s5-0 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-0 0.0 1.0)) (let ((v1-17 gp-0)) diff --git a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc index 76987cb849d..d98b11b35f4 100644 --- a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc @@ -603,7 +603,7 @@ (set-setting! 'rapid-tracking #f 0.0 0) ((lambda :behavior target () - (set! (-> self control bend-target) (* 0.5 (-> self control bend-target))) + (set! (-> self control bend-target) (/ (-> self control bend-target) 2)) (if (logtest? (water-flags touch-water) (-> self water flags)) (sound-play "swim-stroke") ) @@ -1943,7 +1943,3 @@ ) :post (-> target-grab post) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc index b155054831e..789a2fe35d7 100644 --- a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc @@ -981,7 +981,7 @@ (set! (-> sv-32 vector y) (-> sv-32 shove-up)) ) (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) - (set! (-> sv-32 damage) (fmax 1.0 (ceil (* 0.5 (-> sv-32 damage))))) + (set! (-> sv-32 damage) (fmax 1.0 (ceil (/ (-> sv-32 damage) 2)))) (if (< (- (-> self fact health) (-> sv-32 damage)) 1.0) (set! (-> sv-32 damage) (+ -1.0 (-> self fact health))) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc b/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc index dfae2a9332f..127f8e1e390 100644 --- a/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc @@ -1659,7 +1659,7 @@ (dotimes (s4-1 1) ((method-of-type sphere new) (the-as symbol (-> s5-2 s4-1)) sphere) ) - (let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> s5-2 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) (set! (-> s5-2 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-1 0.0 1.0)) (let ((v1-212 gp-3)) @@ -1748,7 +1748,7 @@ (let* ((f0-28 (deg-diff (y-angle (-> self control)) (vector-y-angle (-> self control to-target-pt-xz)))) (f0-30 (fmax -5461.3335 (fmin 5461.3335 f0-28))) ) - (seek! (-> self upper-body twist z) f0-30 (fabs (* 0.2 f0-30))) + (seek! (-> self upper-body twist z) f0-30 (fabs (/ f0-30 5))) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc b/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc index b9998230a1a..4a9b553b302 100644 --- a/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc @@ -187,10 +187,10 @@ (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x))))) ) (let ((f1-4 (fabs (- f0-10 f28-0)))) - (set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (* 0.25 f1-4))))) + (set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (/ f1-4 4))))) ) (let ((f0-14 (fabs (- f24-0 f26-0)))) - (set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))) + (set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (/ f0-14 4))))) ) ) (ja :chan 3 :group! jakb-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist)) diff --git a/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc b/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc index 71a27dade5a..77902b175bb 100644 --- a/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc @@ -862,7 +862,7 @@ (f2-0 f1-2) ) (if (< f0-2 0.0) - (set! f0-2 (* 0.5 f0-2)) + (set! f0-2 (/ f0-2 2)) ) (vector+! (-> arg1 vector) diff --git a/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc index 4755c94e325..f75833ce8c3 100644 --- a/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc @@ -293,7 +293,7 @@ (launch-particles (-> *part-id-table* 608) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 923 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 923 init-specs 4 initial-valuef)) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc b/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc index 51d2329178e..eb1559192e2 100644 --- a/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc @@ -408,7 +408,7 @@ ) ) (set! (-> this sprites 28 color w) - (the int (* 0.00390625 (-> this fade-interp) (the float (-> this values 2 current)))) + (the int (* (/ (-> this fade-interp) 256) (the float (-> this values 2 current)))) ) (set-as-offset-from! (-> this sprites 28) diff --git a/test/decompiler/reference/jak2/engine/target/target-util_REF.gc b/test/decompiler/reference/jak2/engine/target/target-util_REF.gc index ba5246a15c6..21975fa2cba 100644 --- a/test/decompiler/reference/jak2/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-util_REF.gc @@ -1208,7 +1208,7 @@ ) ) ) - (* 0.125 f30-0) + (/ f30-0 8) ) ) @@ -1890,10 +1890,10 @@ (f30-0 (fmax -1.0 (fmin 1.0 arg2))) ) (let ((f1-5 (fabs (- f0-1 (-> arg0 blend 1))))) - (seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + (seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (/ arg3 5))) ) (let ((f0-9 (fabs (- f30-0 (-> arg0 blend 2))))) - (seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + (seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (/ arg3 5))) ) ) (cond @@ -2073,8 +2073,8 @@ (cond ((and (< 0.0 f0-4) (focus-test? this in-air)) (let* ((v0-1 (new 'static 'vector)) - (f0-5 (+ (* 0.0016666667 (-> v1-0 dynam gravity-length)) f0-4)) - (f0-8 (/ (* 0.5 f0-5 f0-5) (-> v1-0 dynam gravity-length))) + (f0-5 (+ (/ (-> v1-0 dynam gravity-length) 600) f0-4)) + (f0-8 (/ (* (/ f0-5 2) f0-5) (-> v1-0 dynam gravity-length))) ) (vector+float*! v0-1 (-> v1-0 trans) (-> v1-0 dynam gravity-normal) f0-8) ) diff --git a/test/decompiler/reference/jak2/engine/target/target2_REF.gc b/test/decompiler/reference/jak2/engine/target/target2_REF.gc index 9634b554da1..4e2ef08d926 100644 --- a/test/decompiler/reference/jak2/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target2_REF.gc @@ -658,7 +658,7 @@ (let ((f0-1 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not (and (< (fabs (/ f0-1 (* 0.0033333334 f1-1))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) + (while (not (and (< (fabs (/ f0-1 (/ f1-1 300))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) (suspend) (ja :num! (loop!)) (set! f0-1 (target-height-above-ground)) diff --git a/test/decompiler/reference/jak2/engine/target/target_REF.gc b/test/decompiler/reference/jak2/engine/target/target_REF.gc index d5ebe179123..035bef60743 100644 --- a/test/decompiler/reference/jak2/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target_REF.gc @@ -564,11 +564,11 @@ (delete-back-vel) (let* ((f0-4 arg5) (f1-2 0.0) - (f2-2 (+ (* 0.0016666667 (-> self control dynam gravity-length)) + (f2-2 (+ (/ (-> self control dynam gravity-length) 600) (fmax 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) ) - (f0-5 (* f0-4 (fmax f1-2 (/ (* 0.5 f2-2 f2-2) (-> self control dynam gravity-length))))) + (f0-5 (* f0-4 (fmax f1-2 (/ (* (/ f2-2 2) f2-2) (-> self control dynam gravity-length))))) (s3-1 (+ arg0 f0-5)) ) (let ((s2-1 (+ arg1 f0-5))) @@ -698,7 +698,7 @@ (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) (darkjak-stage giant)) ) - (set! (-> v1-62 y) (* 0.5 (-> v1-62 y))) + (set! (-> v1-62 y) (/ (-> v1-62 y) 2)) ) (set! v0-1 (-> self control anim-collide-offset-local)) (set! (-> v0-1 quad) (-> v1-62 quad)) @@ -2772,7 +2772,7 @@ ) (else (let* ((f1-5 (/ f0-2 (* (-> self control dynam gravity-length) (seconds-per-frame)))) - (f0-7 (* 0.5 f1-5 (seconds-per-frame) f0-2)) + (f0-7 (* (/ f1-5 2) (seconds-per-frame) f0-2)) ) (let ((v1-22 (ja-group))) (if (and v1-22 diff --git a/test/decompiler/reference/jak2/engine/ui/bigmap_REF.gc b/test/decompiler/reference/jak2/engine/ui/bigmap_REF.gc index 967d5cb64db..1006b182d21 100644 --- a/test/decompiler/reference/jak2/engine/ui/bigmap_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/bigmap_REF.gc @@ -400,8 +400,8 @@ (let ((f1-2 (* 20.0 f1-0 f0-0)) (f0-1 (* 20.0 f0-0)) ) - (set! (-> a0-23 x) (the float (the int (- (-> a2-1 x) (* 0.5 f1-2))))) - (set! (-> a0-23 y) (the float (the int (- (-> a2-1 y) (* 0.5 f0-1))))) + (set! (-> a0-23 x) (the float (the int (- (-> a2-1 x) (/ f1-2 2))))) + (set! (-> a0-23 y) (the float (the int (- (-> a2-1 y) (/ f0-1 2))))) (set! (-> v1-21 x) (+ (-> a0-23 x) f1-2)) (set! (-> v1-21 y) (+ (-> a0-23 y) f0-1)) ) diff --git a/test/decompiler/reference/jak2/engine/ui/hud_REF.gc b/test/decompiler/reference/jak2/engine/ui/hud_REF.gc index 579af88ad39..1cee353ee01 100644 --- a/test/decompiler/reference/jak2/engine/ui/hud_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/hud_REF.gc @@ -1249,7 +1249,7 @@ :code (behavior () (until #f (if (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask pause))) - (seek! (-> self offset) 0.0 (* 0.1 (-> self clock time-adjust-ratio))) + (seek! (-> self offset) 0.0 (/ (-> self clock time-adjust-ratio) 10)) ) (if (>= 0.0 (-> self offset)) (go hud-in) @@ -1499,7 +1499,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc b/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc index bff78bba322..5ee117a2b46 100644 --- a/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc @@ -1399,7 +1399,7 @@ (set! (-> this target-inv-scale) 0.5) ) ) - (seek! (-> this offset y) (-> this target-inv-scale) (* 0.5 f30-2)) + (seek! (-> this offset y) (-> this target-inv-scale) (/ f30-2 2)) ) (run-pending-updates! (-> this engine) (-> *display* base-clock frame-counter)) (when (and (-> this ctywide) (and (= (-> this ctywide status) 'active) (!= (-> this offset w) 0.0))) @@ -1992,23 +1992,23 @@ (set-vector! (-> arg0 mat vector 2) (* (-> s1-0 x) f30-0) 0.0 (-> s1-0 z) 0.0) ) (vector-! s2-0 (target-pos 0) (-> this minimap-corner)) - (set! (-> s2-0 x) (* 0.00000023841858 (-> s2-0 x))) - (set! (-> s2-0 z) (* 0.00000023841858 (-> s2-0 z))) + (set! (-> s2-0 x) (/ (-> s2-0 x) (meters 1024))) + (set! (-> s2-0 z) (/ (-> s2-0 z) (meters 1024))) (vector+! (-> arg0 mat trans) s2-0 (-> this offset)) ) ) (set! (-> arg0 mat trans y) 0.0) - (set! (-> arg0 corner 0 x) (* 0.25 (-> this offset y))) - (set! (-> arg0 corner 0 z) (* 0.25 (-> this offset y))) + (set! (-> arg0 corner 0 x) (/ (-> this offset y) 4)) + (set! (-> arg0 corner 0 z) (/ (-> this offset y) 4)) (set! (-> arg0 corner 0 w) 1.0) - (set! (-> arg0 corner 1 x) (* -0.25 (-> this offset y))) - (set! (-> arg0 corner 1 z) (* 0.25 (-> this offset y))) + (set! (-> arg0 corner 1 x) (/ (-> this offset y) -4)) + (set! (-> arg0 corner 1 z) (/ (-> this offset y) 4)) (set! (-> arg0 corner 1 w) 1.0) - (set! (-> arg0 corner 2 x) (* 0.25 (-> this offset y))) - (set! (-> arg0 corner 2 z) (* -0.25 (-> this offset y))) + (set! (-> arg0 corner 2 x) (/ (-> this offset y) 4)) + (set! (-> arg0 corner 2 z) (/ (-> this offset y) -4)) (set! (-> arg0 corner 2 w) 1.0) - (set! (-> arg0 corner 3 x) (* -0.25 (-> this offset y))) - (set! (-> arg0 corner 3 z) (* -0.25 (-> this offset y))) + (set! (-> arg0 corner 3 x) (/ (-> this offset y) -4)) + (set! (-> arg0 corner 3 z) (/ (-> this offset y) -4)) (set! (-> arg0 corner 3 w) 1.0) (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) (-> arg0 mat)) (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) (-> arg0 mat)) @@ -2516,8 +2516,8 @@ (let ((f1-16 (* 20.0 (-> *video-params* relative-x-scale) f0-48)) (f0-49 (* 20.0 f0-48)) ) - (set! (-> arg0 corner 0 x) (the float (the int (- (-> s3-2 x) (* 0.5 f1-16))))) - (set! (-> arg0 corner 0 z) (the float (the int (- (-> s3-2 z) (* 0.5 f0-49))))) + (set! (-> arg0 corner 0 x) (the float (the int (- (-> s3-2 x) (/ f1-16 2))))) + (set! (-> arg0 corner 0 z) (the float (the int (- (-> s3-2 z) (/ f0-49 2))))) (set! (-> arg0 corner 1 x) (+ (-> arg0 corner 0 x) f1-16)) (set! (-> arg0 corner 1 z) (+ (-> arg0 corner 0 z) f0-49)) ) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc index 2d0635a59e8..39a63200bf0 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc @@ -5256,7 +5256,7 @@ 0 0 0 - (let* ((minutes (the int (* 0.016666668 time))) + (let* ((minutes (the int (/ time 60))) (remainder-minutes (- time (* 60.0 (the float minutes)))) (seconds (the int remainder-minutes)) (remainder-seconds (- remainder-minutes (the float seconds))) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc index d7d07761601..16b5a85e046 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc @@ -1167,14 +1167,14 @@ (seek-ease (-> self menu-transition) 0.0 - (* 0.1 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 10) 0.4 - (* 0.01 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 100) ) ) ) (else - (seek! (-> self menu-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))) + (seek! (-> self menu-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)) (when (and (= (-> self menu-transition) 1.0) (or (and (nonzero? (-> self state-pos)) (= (-> self anim-frame) 1.0)) (or (and (zero? (-> self state-pos)) (= (-> self anim-frame) 0.0)) @@ -1215,12 +1215,12 @@ (if (= (-> self ring-angle) (-> self ring-want-angle)) (respond-to-cpad self) ) - (let ((f30-0 (* 0.005 (-> self clock time-adjust-ratio)))) + (let ((f30-0 (/ (-> self clock time-adjust-ratio) 200))) (cond ((= (-> self menu-transition) 1.0) (if (and (zero? (-> self state-pos)) (= (-> *progress-state* starting-state) 'main)) - (seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) - (seek! (-> self anim-frame) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 50)) + (seek! (-> self anim-frame) 1.0 (/ (-> self clock time-adjust-ratio) 50)) ) (let ((f0-27 (if (and (zero? (-> self state-pos)) (!= (-> *progress-state* starting-state) 'title)) 0.0 @@ -1230,14 +1230,14 @@ ) (when (= (-> self next) 'bigmap) (set! f0-27 0.4) - (set! f30-0 (* 0.008 (-> self clock time-adjust-ratio))) + (set! f30-0 (/ (-> self clock time-adjust-ratio) 125)) ) (seek! (-> self pos-transition) f0-27 f30-0) ) ) ((zero? (-> self state-pos)) (if (= (-> self current) 'bigmap) - (set! f30-0 (* 0.05 (-> self clock time-adjust-ratio))) + (set! f30-0 (/ (-> self clock time-adjust-ratio) 20)) ) (if (!= (-> *progress-state* starting-state) 'title) (seek! (-> self pos-transition) 0.0 f30-0) @@ -1288,9 +1288,9 @@ (set! (-> self swing) (seek-ease (-> self swing) 4.0 - (* 0.05 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 20) 0.5 - (* 0.005 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 200) ) ) (set! (-> self swing) (seek-ease @@ -1464,9 +1464,9 @@ (set! (-> self scanlines-alpha) (seek-ease (-> self scanlines-alpha) (- 1.0 (-> self menu-transition)) - (* 0.05 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 20) 0.3 - (* 0.001 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 1000) ) ) (end-scan sv-152 (-> self scanlines-alpha)) @@ -1769,16 +1769,16 @@ ) ) :trans (behavior () - (seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 50)) (cond ((= (-> self anim-frame) 0.0) - (seek! (-> self pos-transition) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self pos-transition) 1.0 (/ (-> self clock time-adjust-ratio) 50)) (if (= (-> self pos-transition) 1.0) (go-virtual gone) ) ) (else - (seek! (-> self pos-transition) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self pos-transition) 0.0 (/ (-> self clock time-adjust-ratio) 50)) ) ) (set-ring-position self) @@ -1926,13 +1926,13 @@ (arg1 (cond ((cpad-hold? 0 left l-analog-left) - (seek! (-> (the-as (pointer float) gp-0)) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> (the-as (pointer float) gp-0)) 0.0 (/ (-> self clock time-adjust-ratio) 50)) (if (!= (-> (the-as (pointer float) gp-0)) 0.0) (set! s4-0 #t) ) ) ((cpad-hold? 0 right l-analog-right) - (seek! (-> (the-as (pointer float) gp-0)) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> (the-as (pointer float) gp-0)) 1.0 (/ (-> self clock time-adjust-ratio) 50)) (if (!= (-> (the-as (pointer float) gp-0)) 1.0) (set! s4-0 #t) ) @@ -1945,13 +1945,13 @@ (else (cond ((cpad-hold? 0 left l-analog-left) - (seek! (-> (the-as (pointer float) gp-0)) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> (the-as (pointer float) gp-0)) 0.0 (/ (-> self clock time-adjust-ratio) 50)) (if (!= (-> (the-as (pointer float) gp-0)) 0.0) (set! s4-0 #t) ) ) ((cpad-hold? 0 right l-analog-right) - (seek! (-> (the-as (pointer float) gp-0)) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> (the-as (pointer float) gp-0)) 1.0 (/ (-> self clock time-adjust-ratio) 50)) (if (!= (-> (the-as (pointer float) gp-0)) 1.0) (set! s4-0 #t) ) @@ -2952,9 +2952,9 @@ (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) 0.0 - (* 0.1 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 10) 0.3 - (* 0.001 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 1000) ) ) (let ((s4-0 #f)) @@ -3048,9 +3048,9 @@ (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) 0.0 - (* 0.1 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 10) 0.3 - (* 0.01 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 100) ) ) (let ((gp-0 #f)) @@ -3133,9 +3133,9 @@ (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) 0.0 - (* 0.1 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 10) 0.3 - (* 0.01 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 100) ) ) (let ((s5-0 #f)) @@ -3183,17 +3183,17 @@ (set! (-> progress sliding) (seek-ease (-> progress sliding) 0.0 - (* 0.1 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 10) 0.3 - (* 0.001 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 1000) ) ) (set! (-> progress sliding-off) (seek-ease (-> progress sliding-off) 1.0 - (* 0.1 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 10) -0.3 - (* 0.001 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 1000) ) ) (when (-> *bigmap* progress-minimap) @@ -3263,9 +3263,9 @@ (set! (-> arg0 sliding) (seek-ease (-> arg0 sliding) 0.0 - (* 0.1 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 10) 0.3 - (* 0.001 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 1000) ) ) (cond diff --git a/test/decompiler/reference/jak2/engine/ui/text_REF.gc b/test/decompiler/reference/jak2/engine/ui/text_REF.gc index 0b12a53ed55..8fb2d6b56cb 100644 --- a/test/decompiler/reference/jak2/engine/ui/text_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/text_REF.gc @@ -536,7 +536,7 @@ ) (set! sv-64 0) (if (logtest? (-> arg1 flags) (font-flags middle)) - (+! (-> arg1 origin x) (* 0.5 (-> arg1 width))) + (+! (-> arg1 origin x) (/ (-> arg1 width) 2)) ) (set! sv-72 (-> sv-32 0)) (set! sv-80 0) diff --git a/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc b/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc index 9db8845c5ed..d1debffb5ce 100644 --- a/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc @@ -123,7 +123,7 @@ (damp-period float) (clock clock) ) - (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) + (when (>= (fabs (/ (-> this amp) 5)) (fabs (get-no-update this))) (set! (-> this amp) amplitude) (set! (-> this period) (the float period)) (set! (-> this duration) (the float duration)) diff --git a/test/decompiler/reference/jak2/engine/util/sync-info_REF.gc b/test/decompiler/reference/jak2/engine/util/sync-info_REF.gc index 7aa6430bfe1..492b12031ea 100644 --- a/test/decompiler/reference/jak2/engine/util/sync-info_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/sync-info_REF.gc @@ -440,7 +440,7 @@ (defmethod set-params! ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this max-val) (* 0.5 arg2)) + (set! (-> this max-val) (/ arg2 2)) (set! (-> this start-time) 0) (set! (-> this timer) 0) (set! (-> this value) 0.0) @@ -550,8 +550,8 @@ (defmethod set-params! ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this xz-max) (* 0.5 arg2)) - (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this xz-max) (/ arg2 2)) + (set! (-> this y-max) (/ arg3 2)) (set! (-> this start-time) 0) (set! (-> this timer) 0) (vector-reset! (-> this value)) diff --git a/test/decompiler/reference/jak2/kernel/gstring_REF.gc b/test/decompiler/reference/jak2/kernel/gstring_REF.gc index eab4c942f13..0bed39b62a8 100644 --- a/test/decompiler/reference/jak2/kernel/gstring_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gstring_REF.gc @@ -695,7 +695,7 @@ (cond (a0-2 (dotimes (a0-3 (the int f1-5)) - (set! f2-6 (* 0.1 f2-6)) + (set! f2-6 (/ f2-6 10)) (nop!) (nop!) ) diff --git a/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc b/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc index 7736d4adc82..dc36b9abc26 100644 --- a/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc @@ -294,7 +294,7 @@ (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* (-> self rotspeed) (seconds-per-frame))) (let ((f1-2 (- (-> self dest-height) (-> self root trans y)))) (if (< 0.0 f1-2) - (+! (-> self root trans y) (* (fmax 6144.0 (* 0.5 f1-2)) (seconds-per-frame))) + (+! (-> self root trans y) (* (fmax 6144.0 (/ f1-2 2)) (seconds-per-frame))) ) ) (update! (-> self sound)) @@ -314,7 +314,7 @@ (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* (-> self rotspeed) (seconds-per-frame))) (let ((f1-2 (- (-> self dest-height) (-> self root trans y)))) (if (< 0.0 f1-2) - (+! (-> self root trans y) (* (fmax 6144.0 (* 0.5 f1-2)) (seconds-per-frame))) + (+! (-> self root trans y) (* (fmax 6144.0 (/ f1-2 2)) (seconds-per-frame))) ) ) (update! (-> self sound)) diff --git a/test/decompiler/reference/jak2/levels/castle/boss/casboss-texture_REF.gc b/test/decompiler/reference/jak2/levels/castle/boss/casboss-texture_REF.gc index 701dda45749..0d68dc61589 100644 --- a/test/decompiler/reference/jak2/levels/castle/boss/casboss-texture_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/boss/casboss-texture_REF.gc @@ -160,8 +160,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) diff --git a/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc b/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc index 1133e0fd53b..a32288ac909 100644 --- a/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc @@ -1134,7 +1134,7 @@ (f2-2 f1-1) (f2-4 (/ 1.0 f2-2)) ) - (+ 1.0 (* 0.2 f0-0)) + (+ 1.0 (/ f0-0 5)) (set! (-> this delta-wiggle-angle) (* 182.04445 f1-1)) (set! (-> this wiggle-factor) (* 2.0 f2-4)) ) diff --git a/test/decompiler/reference/jak2/levels/castle/castle-texture_REF.gc b/test/decompiler/reference/jak2/levels/castle/castle-texture_REF.gc index 5278050010e..84e1772ce4a 100644 --- a/test/decompiler/reference/jak2/levels/castle/castle-texture_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/castle-texture_REF.gc @@ -736,7 +736,7 @@ (set! (-> a1-4 data 0 end-time) f0-3) (set! (-> a1-4 data 1 end-time) f0-3) ) - (set! f0-3 (* 0.5 f0-3)) + (set! f0-3 (/ f0-3 2)) ) ) #f diff --git a/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc b/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc index c1f3ae9f13a..1f11b97eb50 100644 --- a/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc @@ -495,10 +495,10 @@ (ja-channel-push! 1 (seconds 0.2)) (let ((f30-0 (rnd-float-range self 0.9 1.1))) (until #f - (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (* 0.1 f30-0)) :frame-num 9.0) + (ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (/ f30-0 10)) :frame-num 9.0) (until (ja-done? 0) (suspend) - (ja :num! (seek! 10.0 (* 0.1 f30-0))) + (ja :num! (seek! 10.0 (/ f30-0 10))) ) ) ) @@ -1153,7 +1153,7 @@ s5-1 s5-1 gp-0 - (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame)) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc index 020497ee9bb..ac53696c2a3 100644 --- a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc @@ -1121,7 +1121,7 @@ (set! (-> t0-0 z) 0.0) (set! (-> t0-0 w) 1.0) (let ((v0-5 (t9-5 a0-31 a1-16 a2-22 a3-1 t0-0 (/ f28-0 f30-0)))) - (set! (-> s1-0 delta-y) (* 0.05 (-> v0-5 y) (vector-length (-> s1-0 speed)))) + (set! (-> s1-0 delta-y) (* (/ (-> v0-5 y) 20) (vector-length (-> s1-0 speed)))) ) ) ) @@ -2625,7 +2625,7 @@ ) (set! (-> v1-3 main-y) (- (-> s4-0 feet s0-0 real-position y) (-> s4-0 root trans y))) (set! (-> v1-3 main-y) (-> v1-3 delta-y)) - (+! f30-0 (* 0.25 (-> v1-3 main-y))) + (+! f30-0 (/ (-> v1-3 main-y) 4)) (set! (-> s1-0 quad) (-> v1-3 pos-offset quad)) (set! (-> s1-0 y) (* -2.0 (-> v1-3 main-y))) (new 'stack-no-clear 'vector) diff --git a/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc b/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc index 7be06a606c2..003cf382780 100644 --- a/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc @@ -12,7 +12,7 @@ ;; definition for method 17 of type nav-branch ;; WARN: Return type mismatch int vs none. (defmethod set-speed-limit ((this nav-branch) (arg0 float)) - (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 1024))))))) 0 (none) ) @@ -20,7 +20,7 @@ ;; definition for method 18 of type nav-branch ;; WARN: Return type mismatch int vs none. (defmethod set-width ((this nav-branch) (arg0 float)) - (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) + (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 256))))))) 0 (none) ) @@ -328,7 +328,7 @@ ;; definition for method 16 of type nav-node ;; WARN: Return type mismatch int vs none. (defmethod set-radius ((this nav-node) (arg0 float)) - (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 1024))))))) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/common/trail_REF.gc b/test/decompiler/reference/jak2/levels/city/common/trail_REF.gc index 7a19f69c895..4cb1c6021e3 100644 --- a/test/decompiler/reference/jak2/levels/city/common/trail_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/trail_REF.gc @@ -508,7 +508,7 @@ ) 0 (let* ((f0-0 (-> v1-0 cell-width)) - (f1-1 (* 0.5 f0-0)) + (f1-1 (/ (the float f0-0) 2)) ) (let ((f3-0 (- (-> arg0 x) f1-1)) (f2-2 (- (-> arg0 z) f1-1)) diff --git a/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc index 8a10237b4a5..c17f0a9943c 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc @@ -495,11 +495,11 @@ ) (vector+! (-> s1-0 trans) s4-0 s3-0) (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) - (+! (-> s1-0 trans y) (* 0.5 arg1)) + (+! (-> s1-0 trans y) (/ arg1 2)) (vector-! (the-as vector (-> s2-2 vector)) s3-0 s4-0) (let ((f30-1 (vector-normalize-ret-len! (the-as vector (-> s2-2 vector)) 1.0))) - (set! (-> s1-0 scale x) (* 0.00024414062 f30-1)) - (set! (-> s1-0 scale y) (* 0.00024414062 arg1)) + (set! (-> s1-0 scale x) (/ f30-1 METER_LENGTH)) + (set! (-> s1-0 scale y) (/ arg1 METER_LENGTH)) (set! (-> s1-0 scale z) 1.0) (set! (-> s2-2 vector 1 quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) (vector-cross! (-> s2-2 vector 2) (the-as vector (-> s2-2 vector)) (-> s2-2 vector 1)) @@ -509,7 +509,7 @@ (set! (-> this plane w) (- (vector-dot (-> s2-2 vector 2) (-> this root trans)))) (let ((v0-8 (-> this root root-prim local-sphere))) (set! (-> v0-8 x) 0.0) - (set! (-> v0-8 y) (* 0.00024414062 (* 0.5 arg1))) + (set! (-> v0-8 y) (* 0.00024414062 (/ arg1 2))) (set! (-> v0-8 z) 0.0) (let ((f0-20 0.5) (f1-7 (* f30-1 f30-1)) @@ -684,7 +684,7 @@ 0.0 0.0 0.0 - (let* ((f28-0 (/ 1.0 (* 0.00024414062 (-> arg1 omega)))) + (let* ((f28-0 (/ 1.0 (/ (-> arg1 omega) METER_LENGTH))) (f26-0 (* (rand-vu-float-range -136.53334 136.53334) f28-0)) (f30-0 (* (rand-vu-float-range 0.0 136.53334) f28-0)) (f0-8 (* (rand-vu-float-range -13.653334 54.613335) f28-0)) @@ -1866,7 +1866,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> s0-0 quad) vf6) (let ((f30-0 (vector-vector-xz-distance s4-0 s0-0))) - (let ((f0-2 (* 0.0000012207031 f30-0)) + (let ((f0-2 (/ f30-0 (meters 200))) (a0-7 s4-0) ) (let ((v1-10 s4-0)) @@ -1940,7 +1940,7 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'quaternion))) - (let ((f0-42 (/ 45511.11 (* 0.00024414062 f30-0)))) + (let ((f0-42 (/ 45511.11 (/ f30-0 METER_LENGTH)))) (quaternion-axis-angle! s5-1 1.0 0.0 0.0 (fmax (fmin (-> this angle-guns) f0-42) (- f0-42))) ) (quaternion*! diff --git a/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc b/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc index 7839c1a2ef9..958ab277c98 100644 --- a/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc @@ -1090,8 +1090,8 @@ (let* ((a0-1 (-> arg4 control)) (v1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg2 x-y-z-sx) (-> a0-1 origin trans))) ) - (set! (-> arg1 vel-sxvel x) (* 0.083333336 (-> v1-1 x))) - (set! (-> arg1 vel-sxvel y) (* 0.083333336 (-> v1-1 y))) + (set! (-> arg1 vel-sxvel x) (/ (-> v1-1 x) 12)) + (set! (-> arg1 vel-sxvel y) (/ (-> v1-1 y) 12)) ) 0 (none) @@ -1451,9 +1451,9 @@ (let* ((a0-1 (-> arg4 control)) (v1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg2 x-y-z-sx) (-> a0-1 origin trans))) ) - (set! (-> arg1 vel-sxvel x) (* -0.008333334 (-> v1-1 x))) - (set! (-> arg1 vel-sxvel y) (* -0.008333334 (-> v1-1 y))) - (set! (-> arg1 vel-sxvel z) (* -0.008333334 (-> v1-1 z))) + (set! (-> arg1 vel-sxvel x) (/ (-> v1-1 x) -120)) + (set! (-> arg1 vel-sxvel y) (/ (-> v1-1 y) -120)) + (set! (-> arg1 vel-sxvel z) (/ (-> v1-1 z) -120)) ) 0 (none) diff --git a/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc index 8eaf19aae14..5b7f54cd42d 100644 --- a/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc @@ -241,9 +241,9 @@ (format 0 "trans ~F ~F ~F~%" - (* 0.00024414062 (-> v1-10 trans x)) - (* 0.00024414062 (-> v1-10 trans y)) - (* 0.00024414062 (-> v1-10 trans z)) + (/ (-> v1-10 trans x) METER_LENGTH) + (/ (-> v1-10 trans y) METER_LENGTH) + (/ (-> v1-10 trans z) METER_LENGTH) ) ) (set! (-> this ent) arg0) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kid3-course_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kid3-course_REF.gc index 0b316821878..c42018052df 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kid3-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kid3-course_REF.gc @@ -95,7 +95,7 @@ (quaternion-vector-angle! (-> arg1 root quat) *up-vector* - (* 182.04445 (* 0.00024414062 (-> arg1 course spots 1 center w))) + (* 182.04445 (/ (-> arg1 course spots 1 center w) METER_LENGTH)) ) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 5 #f) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kor3-course_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kor3-course_REF.gc index 9c9683d5947..502da273d7b 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kor3-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kor3-course_REF.gc @@ -95,7 +95,7 @@ (quaternion-vector-angle! (-> arg1 root quat) *up-vector* - (* 182.04445 (* 0.00024414062 (-> arg1 course spots 1 center w))) + (* 182.04445 (/ (-> arg1 course spots 1 center w) METER_LENGTH)) ) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 5 #f) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc index fa4402b414b..44d07d8cdf5 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc @@ -450,7 +450,7 @@ (if (or (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) (= (-> this incoming knocked-type) (knocked-type knocked-type-3)) ) - (set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed))) + (set! (-> arg0 anim-speed) (/ (-> arg0 anim-speed) 2)) ) (let ((a0-47 (-> this skel root-channel 0))) (set! (-> a0-47 frame-group) (the-as art-joint-anim s4-0)) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc index b85ef8037cb..a46551da3ca 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc @@ -618,7 +618,7 @@ s5-1 s5-1 gp-0 - (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame)) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc index 741012fc911..83fb2b36878 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc @@ -1053,7 +1053,7 @@ ) (if (and (-> self allow-dive) (< (vector-length v1-8) (* (-> self dive-reaction) (vector-length (-> self cp-vec)))) - (< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (* 0.5 (-> self cp-sphere r))) + (< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (/ (-> self cp-sphere r) 2)) ) (go-dive self) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc index 30e8108ce3e..967de0b9500 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc @@ -1083,7 +1083,7 @@ (((knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-17 (-> this draw art-group data (-> this info knocked (-> this hit-face))))) - (set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed))) + (set! (-> arg0 anim-speed) (/ (-> arg0 anim-speed) 2)) (let ((a0-36 (-> this skel root-channel 0))) (set! (-> a0-36 frame-group) (the-as art-joint-anim a1-17)) (set! (-> a0-36 param 0) (the float (+ (-> (the-as art-joint-anim a1-17) frames num-frames) -1))) @@ -1668,7 +1668,7 @@ (set! (-> this target-vel) (vector-length (-> this target-vel-vec))) (let ((s5-4 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this target-pos)))) (let* ((f0-3 (vector-length s5-4)) - (f0-4 (* 0.0000012207031 f0-3)) + (f0-4 (/ f0-3 (meters 200))) (a1-9 (-> this target-pos-predict)) ) (let ((v1-62 (-> this target-pos))) @@ -2082,7 +2082,7 @@ (.svf (&-> a1-6 quad) vf6) ) (let ((f30-2 (* 0.5 (vector-vector-xz-distance s5-0 s3-0)))) - (vector-normalize! s4-0 (* 0.5 f30-2)) + (vector-normalize! s4-0 (/ f30-2 2)) (vector-normalize! s2-0 (* 2.0 f30-2)) ) (do-spline gp-0 s5-0 s4-0 s3-0 s2-0 0.9) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc index 98d8022a85a..ab4bd539fd8 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc @@ -581,7 +581,7 @@ (set! (-> this last-change-dir) (the-as uint (current-time))) (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) + (f0-9 (* (/ f30-0 2) (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) (if (-> this heading) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc index 05a5b578f35..f10949d29d6 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc @@ -751,7 +751,7 @@ (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-240 quad) vf6) (let* ((f0-5 (vector-length sv-240)) - (f0-6 (* 0.0000018780048 f0-5)) + (f0-6 (/ f0-5 (meters 130))) ) (set! sv-256 (new 'stack-no-clear 'vector)) (let ((s0-0 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine_REF.gc index c43543382f3..1271be7a18e 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine_REF.gc @@ -663,9 +663,8 @@ (+! (-> s4-0 params position z) (* (-> s4-0 vector 0 x) f0-6)) ) ) - (set! (-> s4-0 vector 2 y) (+ (* 0.5 (-> s4-0 vector 2 x)) - (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing)) - ) + (set! (-> s4-0 vector 2 y) + (+ (/ (-> s4-0 vector 2 x) 2) (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing))) ) (vector-float*! (-> s4-0 params velocity) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 x)) (vector-float*! (-> s4-0 vector 1) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 y)) @@ -1418,7 +1417,7 @@ (set! decay-rate 1.5) ) ) - (set! (-> v1-1 0 decay-rate) (* 0.1 decay-rate)) + (set! (-> v1-1 0 decay-rate) (/ decay-rate 10)) (when (< (-> v1-1 0 danger-level) danger-level) (set! (-> v1-1 0 danger-level) danger-level) (set! (-> v1-1 0 sphere r) danger-radius) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/bike_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/bike_REF.gc index f52cbac2752..1fb386ba82b 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/bike_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/bike_REF.gc @@ -1151,10 +1151,10 @@ (f28-0 (* -13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (* -0.2 f26-0) f30-0)) - (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (* 0.2 f26-0) f30-0)) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (/ f26-0 -5) f30-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (/ f26-0 5) f30-0)) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 f28-0) (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) @@ -1309,8 +1309,8 @@ (f28-0 (* 13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this rudder-f rotation) s5-0 (- f30-0)) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) @@ -1488,8 +1488,8 @@ (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f26-0) (quaternion-vector-angle! (-> this fin2-fl rotation) s5-0 (- f26-0)) (quaternion-vector-angle! (-> this fin2-fr rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/car_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/car_REF.gc index 761ec77e064..47c64396970 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/car_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/car_REF.gc @@ -1606,10 +1606,10 @@ (quaternion-vector-angle! (-> this steering-wheel rotation) s5-0 f0-3) (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f28-0)) (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (* 0.2 f28-0) (* -0.8 f30-0))) - (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (* -0.2 f28-0) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (/ f30-0 -5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (/ f30-0 -5))) + (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (/ f28-0 5) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (/ f28-0 -5) (* -0.8 f30-0))) ) 0 (none) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-effects_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-effects_REF.gc index be455e5dca6..961886a9973 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-effects_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-effects_REF.gc @@ -171,7 +171,7 @@ ;; WARN: Return type mismatch object vs none. (defun calc-fade-vals ((arg0 float)) "@unused just a debugging print function" - (let* ((f1-1 (* 0.00024414062 arg0)) + (let* ((f1-1 (/ arg0 METER_LENGTH)) (f0-3 (- f1-1 (the float (the int f1-1)))) (f1-3 (* 4096.0 (- f1-1 f0-3))) (f1-5 (/ -1.0 (* (- 1.0 f0-3) f1-3))) @@ -234,14 +234,14 @@ (init-vf0-vector) (let* ((f0-0 (rand-vu-float-range 1.0 1.33)) (s4-1 (* arg3 f0-0)) - (s0-0 (fmin (* arg2 f0-0) (* 0.5 s4-1))) + (s0-0 (fmin (* arg2 f0-0) (/ s4-1 2))) (s3-1 (new 'stack-no-clear 'inline-array 'vehicle-control-point 3)) (s2-0 (-> this info)) ) (let ((a1-2 (-> s3-1 0 normal))) (let ((v1-2 arg0)) (let ((a0-2 arg1)) - (let ((a2-2 (* 0.25 s4-1))) + (let ((a2-2 (/ s4-1 4))) (.mov vf7 a2-2) ) (.lvf vf5 (&-> a0-2 quad)) @@ -269,13 +269,13 @@ (let ((f0-14 (* 4.0 s0-0))) (set! (-> s3-1 1 local-pos w) f0-14) (set! (-> s3-1 1 normal w) f0-14) - (set! (-> s3-1 1 normal x) (* 0.025 f0-14)) + (set! (-> s3-1 1 normal x) (/ f0-14 40)) ) (add! *simple-sprite-system* (the-as sprite-glow-data (-> s3-1 1))) (forward-up->quaternion (the-as quaternion (-> s3-1 0)) arg1 (the-as vector (-> this rbody state matrix))) (quaternion-rotate-local-x! (the-as quaternion (-> s3-1 0)) (the-as quaternion (-> s3-1 0)) 32768.0) (let ((v1-16 (-> s3-1 0 normal))) - (let ((a0-10 (* 0.5 s4-1))) + (let ((a0-10 (/ s4-1 2))) (.mov vf7 a0-10) ) (.lvf vf5 (&-> arg1 quad)) @@ -458,7 +458,7 @@ (-> this info part-vel) (-> this rbody state lin-velocity) (-> s5-0 0 vector 1) - (* 0.2 (-> this info max-engine-thrust) (+ 0.5 (-> this engine-power-factor))) + (* (/ (-> this info max-engine-thrust) 5) (+ 0.5 (-> this engine-power-factor))) ) (let ((v1-117 (-> this info part-vel)) (a0-45 (-> this info part-vel)) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc index 40972bd02c5..49d95bce3e1 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc @@ -388,7 +388,7 @@ (-> gp-0 vec-12 x) ) ) - (set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (* 0.1 (-> gp-0 vec-12 x)))))) + (set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (/ (-> gp-0 vec-12 x) 10))))) (+! (-> this aim-rot s3-1) (* (-> this aim-rot-vel s3-1) (-> gp-0 vec-12 x))) (when (or (zero? s3-1) (not (logtest? (-> this flags) (turret-flag no-rot-y-clamp)))) (let ((f0-31 (-> this info rot-min s3-1))) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-physics_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-physics_REF.gc index 14cf49cf222..1625f61b425 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-physics_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-physics_REF.gc @@ -26,7 +26,7 @@ (let ((f1-5 (fmin (-> this water-height) (+ (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))))) 0.0 (let* ((f2-5 (fmax -1.0 (fmin 1.0 (/ (- (-> this water-height) (-> s0-0 world-sphere y)) (-> s0-0 world-sphere w))))) - (f30-0 (+ 0.5 (* -0.25 f2-5 f2-5 f2-5) (* 0.75 f2-5))) + (f30-0 (+ 0.5 (* (/ f2-5 -4) f2-5 f2-5) (* 0.75 f2-5))) ) (set! (-> s4-0 local-pos 0 y) (* 0.5 (+ f0-2 f1-5))) (let ((v1-18 (-> this rbody)) @@ -354,8 +354,8 @@ (let ((f1-20 (fmax 0.0 f0-38))) (+! (-> this lift-thrust s2-1) f1-20) (when (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) - (+! (-> this roll-thrust 0) (* 0.05 f1-20)) - (+! (-> this roll-thrust 1) (* 0.05 f1-20)) + (+! (-> this roll-thrust 0) (/ f1-20 20)) + (+! (-> this roll-thrust 1) (/ f1-20 20)) ) ) (vector-reset! (-> arg1 force)) @@ -377,7 +377,7 @@ (and (> (-> this flight-level-index) 0) (< f0-40 0.0) (< (-> arg1 velocity y) 0.0)) ) (vector-reset! (-> arg1 force)) - (let ((f0-43 (* -0.25 (-> this info inv-lift-thruster-count))) + (let ((f0-43 (/ (-> this info inv-lift-thruster-count) -4)) (f1-28 arg0) ) (set! (-> arg1 force y) (* f0-43 (/ 1.0 f1-28) (-> this info info mass) (-> arg1 velocity y))) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc index 70934668c4f..b3d518cd4de 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc @@ -478,7 +478,7 @@ (let* ((v1-1 (-> this rbody state lin-velocity)) (f0-4 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) (f0-6 (/ (- arg0 f0-4) arg0)) - (f1-6 (* 0.005 f0-6)) + (f1-6 (/ f0-6 200)) ) (set! (-> this controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> this controls throttle) f1-6)))) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc index 092b0e07396..c2f87858194 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc @@ -478,7 +478,7 @@ (set! f1-6 (* f0-23 f0-23)) ) (if (not (logtest? (-> this flags) (rigid-body-object-flag riding))) - (set! f1-6 (* 0.5 f1-6)) + (set! f1-6 (/ f1-6 2)) ) ) (+! (-> this power-level) @@ -1272,7 +1272,7 @@ ) (when (< f0-9 (* f1-8 f1-8)) (let ((f0-10 (vector-length (-> this root transv)))) - (seek! (-> this engine-power-factor) (* 0.000016276043 f0-10) (* 6.0 (seconds-per-frame))) + (seek! (-> this engine-power-factor) (/ f0-10 (meters 15)) (* 6.0 (seconds-per-frame))) ) (do-engine-sounds this) ) @@ -1542,7 +1542,7 @@ ((or (logtest? (penetrate dark-giant) arg3) (and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'eco-dark)) ) - (set! (-> s5-0 vector 2 y) (* 0.1 (-> s5-0 vector 2 y))) + (set! (-> s5-0 vector 2 y) (/ (-> s5-0 vector 2 y) 10)) (set! f0-2 (* 409600.0 (-> this info info mass))) (/ 0.4 (-> this info damage-factor)) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-plasma_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-plasma_REF.gc index aa3c42ac946..d218fa009f4 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-plasma_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-plasma_REF.gc @@ -193,7 +193,7 @@ (static-sound-name "sig-gun-powerup") (-> this powerup-sound-id) (the int (* 1024.0 f28-0)) - (the int (* 1524.0 (+ 0.5 (* 0.5 f30-0)))) + (the int (* 1524.0 (+ 0.5 (/ f30-0 2)))) 0 (sound-group sfx) s4-0 diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-states_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-states_REF.gc index ab086df9bf2..c3ec7d93586 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-states_REF.gc @@ -1507,7 +1507,7 @@ (until #f (suspend) (let* ((f0-1 (vector-length (-> self root transv))) - (f0-3 (fmax 0.1 (* 0.000020345053 f0-1))) + (f0-3 (fmax 0.1 (/ f0-1 (meters 12)))) ) (ja :num! (loop! f0-3)) ) @@ -1628,14 +1628,14 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.15)) (let* ((f0-0 (vector-length (-> self root transv))) - (f0-2 (fmax 0.1 (* 0.000020345053 f0-0))) + (f0-2 (fmax 0.1 (/ f0-0 (meters 12)))) ) (ja-no-eval :group! sig-chased-run-jump-land0-ja :num! (seek! max f0-2) :frame-num 0.0) ) (until (ja-done? 0) (suspend) (let* ((f0-4 (vector-length (-> self root transv))) - (f0-6 (fmax 0.1 (* 0.000020345053 f0-4))) + (f0-6 (fmax 0.1 (/ f0-4 (meters 12)))) ) (ja :num! (seek! max f0-6)) ) @@ -1762,14 +1762,14 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.15)) (let* ((f0-0 (vector-length (-> self root transv))) - (f0-2 (fmax 0.1 (* 0.000020345053 f0-0))) + (f0-2 (fmax 0.1 (/ f0-0 (meters 12)))) ) (ja-no-eval :group! sig-chased-shoot-jump-land0-ja :num! (seek! max f0-2) :frame-num 0.0) ) (until (ja-done? 0) (suspend) (let* ((f0-4 (vector-length (-> self root transv))) - (f0-6 (fmax 0.1 (* 0.000020345053 f0-4))) + (f0-6 (fmax 0.1 (/ f0-4 (meters 12)))) ) (ja :num! (seek! max f0-6)) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc index 6103b25ebb6..c6a937cf673 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc @@ -1009,19 +1009,19 @@ (cond ((or (not (and v1-6 (= v1-6 (-> this draw art-group data 3)))) (or (= (-> this jump-why) 4) (>= f2-1 8192.0))) (logior! (-> this bot-flags) (bot-flags bf23)) - (let ((f2-3 (fmax 12288.0 (* 0.5 f1-0))) + (let ((f2-3 (fmax 12288.0 (/ f1-0 2))) (f1-3 (fmax (-> arg0 start-pos y) (-> arg0 dest-pos y))) ) (- (fmax (+ (fmin (-> arg0 start-pos y) (-> arg0 dest-pos y)) f2-3) (+ 10240.0 f1-3)) f1-3) ) ) (else - (fmax 2048.0 (* 0.2 f1-0)) + (fmax 2048.0 (/ f1-0 5)) ) ) ) ) - (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f1-4 (* 0.000011111111 f0-2)) + (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f1-4 (/ f0-2 90000)) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc b/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc index 161ab0cbc7e..3b12ced1b53 100644 --- a/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc @@ -925,7 +925,7 @@ (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp) ) ) - (set! (-> this wall-xz) (* 0.5 (-> this wall-xz))) + (set! (-> this wall-xz) (/ (-> this wall-xz) 2)) (+! (-> this wall-xz) 4096.0) (set! (-> this wall-y) (fabs diff --git a/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc index 9f53ed1fb62..66f8fc7f94d 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc @@ -768,7 +768,7 @@ (set! (-> s2-0 quad) (-> (get-trans (the-as process-focusable s0-0) 3) quad)) (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s2-0))) (let* ((f0-0 (vector-length s1-2)) - (f0-1 (* 0.0000030517579 f0-0)) + (f0-1 (/ f0-0 (meters 80))) (a0-7 s2-0) ) (let ((v1-17 s2-0)) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc index 5b20a50e1ef..e83334570d3 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc @@ -902,7 +902,7 @@ (set! (-> this last-change-dir) (the-as uint (current-time))) (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) + (f0-9 (* (/ f30-0 2) (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) (if (-> this heading) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc index b200b64106b..795f1454c32 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc @@ -1469,10 +1469,10 @@ (-> arg0 thrust s3-0) (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) (fmax 0.0 (-> v0-6 y)) - (fabs (* 0.2 (-> v0-6 z))) + (fabs (/ (-> v0-6 z) 5)) (fmax 0.0 (-> s1-1 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) @@ -1494,7 +1494,7 @@ (set! (-> *part-id-table* 721 init-specs 0 initial-valuef) (* f24-0 f0-14)) (set! (-> arg0 thrust s3-0) f28-0) (let ((f0-15 (* f26-0 f0-14))) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (* -0.5 f0-15)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (/ f0-15 -2)) ) ) ) @@ -1572,7 +1572,7 @@ ) (set! (-> *part-id-table* 721 init-specs 0 initial-valuef) f1-0) ) - (let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (* -0.5 f0-0)))) + (let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (/ f0-0 -2)))) (vector+! (-> s5-0 trans) s4-0 v1-29) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc index e92e8876ce5..d258d4fc71c 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc @@ -1561,7 +1561,7 @@ (vector-normalize-copy! (-> s5-0 curve-matrix vector 2) s3-0 1.0) (vector-normalize-copy! (-> s5-0 curve-matrix trans) s4-0 1.0) (set! (-> s5-0 pos-index 0) (vector-dot s3-0 (-> s5-0 curve-matrix trans))) - (set! (-> s5-0 pos-index 1) (/ (* 0.5 (-> s5-0 pos-index 0) (-> s5-0 pos-index 0)) (* 0.2 f28-0))) + (set! (-> s5-0 pos-index 1) (/ (* (/ (-> s5-0 pos-index 0) 2) (-> s5-0 pos-index 0)) (/ f28-0 5))) (set! (-> s5-0 dist) (vector-dot (-> this dest-vel) (-> s5-0 curve-matrix trans))) (vector-normalize-copy! (-> s5-0 curve-matrix vector 1) s4-0 (-> this target-speed)) (vector-! (the-as vector (-> s5-0 curve-matrix)) (-> s5-0 curve-matrix vector 1) s3-0) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-edit_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-edit_REF.gc index 80f6dd81de9..b760fec940c 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-edit_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-edit_REF.gc @@ -22,7 +22,7 @@ (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> arg0 quad)) (let* ((f0-2 (vector-vector-distance s4-0 arg1)) - (s3-1 (+ (the int (* 0.000008138021 f0-2)) 1)) + (s3-1 (+ (the int (/ f0-2 (meters 30))) 1)) (s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) 110592.0)) ) (dotimes (s1-0 s3-1) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc index a7567068b63..113d9d9c6ea 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc @@ -1278,10 +1278,10 @@ (-> arg0 thrust s3-0) (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) (fmax 0.0 (-> v0-6 y)) - (fabs (* 0.2 (-> v0-6 z))) + (fabs (/ (-> v0-6 z) 5)) (fmax 0.0 (-> s1-1 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) @@ -1305,7 +1305,7 @@ (set! (-> *part-id-table* 721 init-specs 0 initial-valuef) (* f24-0 f0-15)) (set! (-> arg0 thrust s3-0) f28-0) (let ((f0-16 (* f26-0 f0-15))) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (* -0.5 f0-16)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (/ f0-16 -2)) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc index 119fb94d8a1..1a228c416ac 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc @@ -1110,7 +1110,7 @@ ) ) (let ((v1-17 (-> self nav))) - (set! (-> v1-17 max-rotation-rate) (* 0.05 (-> *spyder-nav-enemy-info* maximum-rotation-rate))) + (set! (-> v1-17 max-rotation-rate) (/ (-> *spyder-nav-enemy-info* maximum-rotation-rate) 20)) ) 0 (ja-channel-push! 2 (seconds 0.2)) diff --git a/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc index 988526aca14..b95c1264d67 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc @@ -564,7 +564,7 @@ (* 40.96 (seconds-per-frame)) ) ) - (let ((f30-0 (- 1.0 (fabs (* 0.000012207031 (-> self y-offset)))))) + (let ((f30-0 (- 1.0 (fabs (/ (-> self y-offset) (meters 20)))))) (let ((f0-7 (* f30-0 f30-0))) (set-vector! (-> self root scale) f30-0 f30-0 f30-0 1.0) (let ((t9-1 vector-lerp!) @@ -601,7 +601,7 @@ :code sleep-code :post (behavior () (seek! (-> self y-offset) -81920.0 (* 49152.0 (seconds-per-frame))) - (let ((f30-0 (- 1.0 (fabs (* 0.000012207031 (-> self y-offset)))))) + (let ((f30-0 (- 1.0 (fabs (/ (-> self y-offset) (meters 20)))))) (let ((f0-5 (* f30-0 f30-0))) (set-vector! (-> self root scale) f30-0 f30-0 f30-0 1.0) (let ((t9-1 vector-lerp!) @@ -1162,7 +1162,7 @@ (f1-1 (-> this elev-angle)) (f0-7 (fmax -728.1778 (fmin 728.1778 f1-1))) (f1-2 (- f1-1 f0-7)) - (f2-3 (* 0.2 f1-2)) + (f2-3 (/ f1-2 5)) (f30-0 (+ f0-7 (* 0.8 f1-2))) ) (quaternion-vector-angle! s5-1 *x-vector* f2-3) diff --git a/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc index bddf951eb38..82f70227237 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc @@ -752,7 +752,7 @@ (set! (-> this old-y-deg) f0-5) ) (set! (-> this desire-turn) - (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) + (< (+ 0.5 (/ (-> this nav state speed) METER_LENGTH)) (* 0.005493164 (fabs (-> this diff-angle)))) ) (if (and (< (-> this root trans y) (+ -122880.0 (-> this floor))) (-> this next-state) @@ -1092,7 +1092,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-43 (ja-group))) @@ -1148,7 +1148,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-27 (ja-group))) @@ -1205,7 +1205,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-27 (ja-group))) diff --git a/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc b/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc index 182e20f8d02..418e9cfe4d4 100644 --- a/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc @@ -417,7 +417,7 @@ (launch-particles (-> *part-id-table* 608) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 609 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 609 init-specs 4 initial-valuef)) ) diff --git a/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc b/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc index e1388588104..1c398eee345 100644 --- a/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc @@ -401,7 +401,7 @@ (launch-particles (-> *part-id-table* 622) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000020345053 f30-0)) + (f26-0 (/ f30-0 (meters 12))) (f30-1 (-> *part-id-table* 623 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 623 init-specs 5 initial-valuef)) ) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc index ae4fdd447c2..0b0392178b8 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc @@ -835,7 +835,7 @@ (let ((v1-3 (new 'stack-no-clear 'mystery-race-manager-type))) (set! (-> v1-3 vec1 z) 81920.0) (set! (-> v1-3 word) 4) - (set! (-> v1-3 vec0 z) (* -0.5 (-> v1-3 vec1 z))) + (set! (-> v1-3 vec0 z) (/ (-> v1-3 vec1 z) -2)) (set! (-> v1-3 vec0 w) -20480.0) (set! (-> v1-3 vec1 x) (/ (-> v1-3 vec1 z) (the float (+ (-> v1-3 word) -1)))) (set! (-> v1-3 vec1 y) -40960.0) @@ -1266,7 +1266,7 @@ (let ((v1-6 gp-1)) (set! (-> v1-6 height) (the float 70)) ) - (set! (-> gp-1 origin x) (the float (- 256 (the int (* 0.5 (-> gp-1 width)))))) + (set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2))))) (set! (-> gp-1 origin y) 320.0) (set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s5-0 print-game-text)) @@ -1296,7 +1296,7 @@ (let ((v1-6 gp-1)) (set! (-> v1-6 height) (the float 35)) ) - (set! (-> gp-1 origin x) (the float (- 256 (the int (* 0.5 (-> gp-1 width)))))) + (set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2))))) (set! (-> gp-1 origin y) 320.0) (set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s5-0 print-game-text)) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-mesh_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-mesh_REF.gc index 7cc15f6d505..eac5f2c89a2 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-mesh_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-mesh_REF.gc @@ -884,7 +884,7 @@ (set! (-> s3-0 cell-bits 0 quad) (the-as uint128 0)) (set! (-> s3-0 cell-bits 1 quad) (the-as uint128 0)) (let ((f0-1 (/ 1.0 (-> s4-0 cell-length))) - (f1-2 (fmin (-> arg0 search-sphere r) (* 0.5 (-> s4-0 cell-length)))) + (f1-2 (fmin (-> arg0 search-sphere r) (/ (-> s4-0 cell-length) 2))) ) (let ((f3-1 (- (-> arg0 search-sphere x) f1-2)) (f2-4 (- (-> arg0 search-sphere z) f1-2)) @@ -918,7 +918,7 @@ (+! s2-0 1) ) ) - (when (and (= (-> arg0 slice-id) -1) (< (* 0.5 (-> s4-0 cell-length)) (-> arg0 search-sphere r))) + (when (and (= (-> arg0 slice-id) -1) (< (/ (-> s4-0 cell-length) 2) (-> arg0 search-sphere r))) (while (= (-> arg0 slice-id) -1) (set! (-> s3-0 bounds min x) (max 0 (+ (-> s3-0 bounds min x) -1))) (set! (-> s3-0 bounds min z) (max 0 (+ (-> s3-0 bounds min z) -1))) diff --git a/test/decompiler/reference/jak2/levels/consite/consite-scenes_REF.gc b/test/decompiler/reference/jak2/levels/consite/consite-scenes_REF.gc index d693c09399b..41048e15e2e 100644 --- a/test/decompiler/reference/jak2/levels/consite/consite-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/consite/consite-scenes_REF.gc @@ -654,7 +654,7 @@ (launch-particles (-> *part-id-table* 622) s3-2) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000020345053 f30-0)) + (f26-0 (/ f30-0 (meters 12))) (f30-1 (-> *part-id-table* 623 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 623 init-specs 5 initial-valuef)) ) diff --git a/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc index 60479cdb137..a91dee2e63b 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc @@ -1122,7 +1122,7 @@ (set! (-> gp-0 vector 2 w) 0.0) (matrix->quaternion (-> self root quat) gp-0) ) - (set! (-> self root scale z) (* 0.000003937752 f30-0)) + (set! (-> self root scale z) (/ f30-0 (meters 62))) (when (!= (-> self old-dist) 0.0) (let ((f2-0 (fabs (- f30-0 (-> self old-dist))))) (set! (-> self frame target) (fmin 1.0 (fmax 0.0 (* 0.0008719308 (- 573.44 f2-0))))) diff --git a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc index 8affddffd59..0f73244bd57 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc @@ -953,7 +953,7 @@ (let* ((f30-0 (the float (ja-num-frames 0))) (f0-10 (+ (* 1.5 f30-0 (get-norm! (-> self parent-ptr 0 swing-sync) 0)) (if (= (-> self parent-ptr 0 options) 1) - (* 0.5 f30-0) + (/ f30-0 2) 0.0 ) ) @@ -972,7 +972,7 @@ 1.0 0.0 ) - (* 0.02 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 50) ) (dig-balloon-lurker-trapeze-method-21 self) (suspend) @@ -1182,7 +1182,7 @@ -0.5 0.5 ) - (* 0.01 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 100) ) (let ((f0-7 (+ -1.0 (fabs (* 2.0 (-> self pedal-anim-speed))))) (f1-5 (* 2.0 (fabs (-> self pedal-anim-speed)))) @@ -1399,7 +1399,7 @@ ) ) ) - (set! (-> this anim-speed) (* 0.000015258789 f0-18)) + (set! (-> this anim-speed) (/ f0-18 (meters 16))) ) (go (method-of-object this idle)) (none) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc index f32627e7d1c..01f38a608d2 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc @@ -1362,7 +1362,7 @@ (* (-> self inc-y) (-> self clock time-adjust-ratio)) (-> self ease-y) (-> self ease-y) - (* 0.05 (-> self clock time-adjust-ratio) (-> self inc-y)) + (* (/ (-> self clock time-adjust-ratio) 20) (-> self inc-y)) ) ) (set! (-> self root trans y) @@ -1444,8 +1444,8 @@ (else (set! (-> self from-y) (-> self current-y-position)) (let ((f0-6 (fabs (- (+ f30-0 (-> v1-35 ship-y-offset)) (-> self from-y))))) - (set! (-> self inc-y) (* 0.02 f0-6)) - (set! (-> self ease-y) (* 0.2 f0-6)) + (set! (-> self inc-y) (/ f0-6 50)) + (set! (-> self ease-y) (/ f0-6 5)) ) ) ) @@ -1462,7 +1462,7 @@ (* (-> self inc-y) (-> self clock time-adjust-ratio)) (-> self ease-y) (-> self ease-y) - (* 0.05 (-> self clock time-adjust-ratio) (-> self inc-y)) + (* (/ (-> self clock time-adjust-ratio) 20) (-> self inc-y)) ) ) (if (and (= (-> self current-y-position) f28-0) (-> s5-0 alive)) @@ -1517,7 +1517,7 @@ 0.0 (* 5.0 (-> pp clock time-adjust-ratio)) 90.0 - (* 0.1 (-> pp clock time-adjust-ratio)) + (/ (-> pp clock time-adjust-ratio) 10) ) ) ) @@ -1960,7 +1960,7 @@ ) ) (until #f - (seek! (-> self anim-frame) 1.0 (* 0.01 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 1.0 (/ (-> self clock time-adjust-ratio) 100)) (let ((v1-12 (-> self skel root-channel 0))) (set! (-> v1-12 num-func) num-func-identity) (let ((f0-4 (-> self anim-frame)) @@ -2100,7 +2100,7 @@ ) :code (behavior () (until #f - (seek! (-> self anim-frame) 0.0 (* 0.01 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 100)) (let ((v1-4 (-> self skel root-channel 0))) (set! (-> v1-4 num-func) num-func-identity) (let ((f0-4 (-> self anim-frame)) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc index 86b6bad4826..30e91051adf 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc @@ -407,7 +407,7 @@ (until #f (let ((f30-0 (- (-> self extent 1 y) (-> self extent 0 y)))) (when (!= f30-0 (-> self length)) - (let ((f0-3 (* 0.000010172526 f30-0))) + (let ((f0-3 (/ f30-0 (meters 24)))) (ja :num! (identity f0-3)) ) (transform-post) @@ -869,16 +869,16 @@ (set! (-> s0-0 random-rangef) f30-0) ) (if s5-0 - (set! (-> s5-0 random-rangef) (* 0.5 f28-0)) + (set! (-> s5-0 random-rangef) (/ f28-0 2)) ) (if gp-0 - (set! (-> gp-0 random-rangef) (* 0.5 f30-0)) + (set! (-> gp-0 random-rangef) (/ f30-0 2)) ) (if s4-0 - (set! (-> s5-0 random-rangef) (* 0.5 f28-0)) + (set! (-> s5-0 random-rangef) (/ f28-0 2)) ) (if v1-22 - (set! (-> gp-0 random-rangef) (* 0.5 f30-0)) + (set! (-> gp-0 random-rangef) (/ f30-0 2)) ) ) (spawn-with-matrix (-> self part) (-> self local-to-world)) @@ -901,10 +901,10 @@ (set! (-> s4-1 random-rangef) f30-0) ) (if gp-1 - (set! (-> gp-1 random-rangef) (* 0.5 f28-0)) + (set! (-> gp-1 random-rangef) (/ f28-0 2)) ) (if v1-39 - (set! (-> v1-39 random-rangef) (* 0.5 f30-0)) + (set! (-> v1-39 random-rangef) (/ f30-0 2)) ) ) (spawn-with-matrix (-> self part-off) (-> self local-to-world)) @@ -1021,9 +1021,9 @@ (set! (-> this deadly-length) (vector-vector-distance (-> s4-1 vector 2) (the-as vector (-> s4-1 vector)))) (let ((v1-39 (-> this root root-prim))) (vector-reset! (-> v1-39 local-sphere)) - (let* ((f0-14 (* 0.5 (-> this deadly-width))) + (let* ((f0-14 (/ (-> this deadly-width) 2)) (f0-16 (* f0-14 f0-14)) - (f1-7 (* 0.5 (-> this deadly-length))) + (f1-7 (/ (-> this deadly-length) 2)) ) (set! (-> v1-39 local-sphere w) (sqrtf (+ f0-16 (* f1-7 f1-7)))) ) diff --git a/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc b/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc index 42e0b5893cf..dcea9678e20 100644 --- a/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc @@ -568,7 +568,7 @@ s4-0 s4-0 s5-3 - (* (fmax 0.5 (* 0.00024414062 (-> this nav state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> this nav state speed) METER_LENGTH)) (seconds-per-frame)) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc b/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc index 3d7f2d920db..98ad80c12f5 100644 --- a/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc @@ -187,7 +187,7 @@ (go-virtual dormant) ) ) - (set! (-> *game-info* bot-health 0) (* 0.11111111 (-> self hit-points))) + (set! (-> *game-info* bot-health 0) (/ (-> self hit-points) 9)) (transform-post) (none) ) diff --git a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc index 56dce0dd06c..2a4d0c5f1d9 100644 --- a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc @@ -694,7 +694,7 @@ (if (not (time-elapsed? (-> self targetted-timer) (seconds 5))) (set! interpolated-speed (fmax 163840.0 interpolated-speed)) ) - (let ((movement-speed (* 0.0033333334 interpolated-speed))) + (let ((movement-speed (/ interpolated-speed 300))) (cond ((< (vector-dot dir-to-target (-> self tangent)) 0.0) (if (< 0.0 (-> self speed)) diff --git a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc index 03ae47e508e..07a3300f318 100644 --- a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc @@ -770,7 +770,7 @@ (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-224 quad) vf6) (let* ((f0-5 (vector-length sv-224)) - (f0-6 (* 0.0000018780048 f0-5)) + (f0-6 (/ f0-5 (meters 130))) ) (set! sv-240 (new 'stack-no-clear 'vector)) (let ((s0-0 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/jak2/levels/forest/wren_REF.gc b/test/decompiler/reference/jak2/levels/forest/wren_REF.gc index e834d79dc4a..6854b03a3d5 100644 --- a/test/decompiler/reference/jak2/levels/forest/wren_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/wren_REF.gc @@ -330,7 +330,7 @@ (seek! (-> self fly-interp) (lerp-scale 0.0 1.0 f0-11 -0.2 0.5) (seconds-per-frame)) ) (let ((f30-1 (-> self fly-interp))) - (seek! (-> self path-du-mod) (+ 0.9 (* 0.2 f30-1)) (* 0.5 (seconds-per-frame))) + (seek! (-> self path-du-mod) (+ 0.9 (/ f30-1 5)) (* 0.5 (seconds-per-frame))) (set! (-> self bob-level-seek) (+ -12288.0 (* 24576.0 f30-1))) (let ((v1-59 (-> self skel root-channel 0))) (let ((f0-23 (- 1.0 f30-1))) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc index 051ec05fd1c..a942fe47a19 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc @@ -238,8 +238,8 @@ :code (behavior () (until #f (when (and (not (paused?)) (time-elapsed? (-> self state-time) (seconds 1))) - (seek! (-> self anim-frame) 0.0 (* 0.2 (-> self clock time-adjust-ratio))) - (seek! (-> self transition) 1.0 (* 0.01 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 5)) + (seek! (-> self transition) 1.0 (/ (-> self clock time-adjust-ratio) 100)) ) (set-roboscreen-alpha! (-> self transition)) (ja :num-func num-func-identity :frame-num (-> self anim-frame)) @@ -266,7 +266,7 @@ :code (behavior () (until #f (when (not (paused?)) - (seek! (-> self anim-frame) 15.0 (* 0.2 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 15.0 (/ (-> self clock time-adjust-ratio) 5)) (seek! (-> self transition) 0.0 (* 0.015 (-> self clock time-adjust-ratio))) ) (set-roboscreen-alpha! (-> self transition)) @@ -313,7 +313,7 @@ (gp-0 (new 'stack-no-clear 'vector)) (f30-0 4096.0) ) - (let ((f0-4 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) + (let ((f0-4 (* 0.00013563369 (tan (/ (-> *math-camera* fov) 2)) f30-0))) (set-vector! (-> this root scale) f0-4 f0-4 f0-4 1.0) ) (set! (-> gp-0 quad) (-> (camera-pos) quad)) @@ -494,7 +494,7 @@ (let ((f0-0 (vector-length (vector-! (new 'stack-no-clear 'vector) (the-as vector gp-0) (the-as vector s5-0)))) (gp-1 (-> self sight-scale)) ) - (set! (-> gp-1 z) (* 0.000024414063 f0-0)) + (set! (-> gp-1 z) (/ f0-0 (meters 10))) (let ((f0-1 (lerp-scale 0.1 6.0 f0-0 61440.0 163840.0))) (set! (-> gp-1 x) f0-1) (set! (-> gp-1 y) f0-1) @@ -1163,7 +1163,7 @@ (let* ((f0-29 (fmax -4551.1113 (fmin 4551.1113 (- 16384.0 (acos (- (vector-dot gp-2 *y-vector*))))))) (f2-1 (- (-> self gun-elev-cam) f0-29)) (f1-12 (if (< f2-1 0.0) - (fmin 3640.889 (* (fabs (* 0.1 f2-1)) (-> self clock frames-per-second))) + (fmin 3640.889 (* (fabs (/ f2-1 10)) (-> self clock frames-per-second))) 910.2222 ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc index 3e4db6ce542..3abe303f3e7 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc @@ -486,7 +486,7 @@ (f1-16 (- 1.0 f0-44)) (f26-0 0.0) ) - (when (and (or (< f0-44 f24-0) (< f24-0 f1-16)) (time-elapsed? (-> self buzz-timer) (the int (* 0.5 f30-2)))) + (when (and (or (< f0-44 f24-0) (< f24-0 f1-16)) (time-elapsed? (-> self buzz-timer) (the int (/ f30-2 2)))) (let* ((gp-2 *target*) (a0-43 (if (type? gp-2 process-focusable) gp-2 @@ -503,7 +503,7 @@ (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (* 0.49 f26-0))) - (the-as time-frame (max 45 (the int (* 0.25 f30-2)))) + (the-as time-frame (max 45 (the int (/ f30-2 4)))) ) (set-time! (-> self buzz-timer)) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc index 0f3c2acd0dc..38cd09a4f7e 100644 --- a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc @@ -262,14 +262,14 @@ (+! (-> s4-1 y) (sqrtf (- f0-6 f2-2))) ) (let* ((f0-12 (* 2.0 (asin (/ f1-4 f30-0)))) - (f28-1 (* 0.0625 f0-12)) + (f28-1 (/ f0-12 16)) (s3-1 (new 'stack-no-clear 'vector)) ) (set! (-> s3-1 x) 0.0) (set! (-> s3-1 y) (- f30-0)) (set! (-> s3-1 z) 0.0) (set! (-> s3-1 w) 0.0) - (let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) gp-1 (* -0.5 f0-12)))) + (let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) gp-1 (/ f0-12 -2)))) (vector-orient-by-quat! s3-1 s3-1 a2-2) ) (dotimes (s2-1 17) diff --git a/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc b/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc index 9fedc3c0c69..60fecdffec2 100644 --- a/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc @@ -2377,7 +2377,7 @@ (let ((f0-2 1.0)) (cond ((< f30-0 2.0) - (set! f0-2 (* 0.5 f30-0)) + (set! f0-2 (/ f30-0 2)) ) ((< 3.0 f30-0) (set! f0-2 (* 0.5 (- 5.0 f30-0))) @@ -2497,7 +2497,7 @@ (let ((f0-6 1.0)) (cond ((< f30-0 2.0) - (set! f0-6 (* 0.5 f30-0)) + (set! f0-6 (/ f30-0 2)) ) ((< 6.0 f30-0) (set! f0-6 (* 0.5 (- 8.0 f30-0))) diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc index bf7d4f6c85b..5df66a958ec 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc @@ -522,8 +522,8 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a2-2 quad) vf6) ) - (let* ((a0-30 (the int (* 0.00024414062 (-> s0-1 x)))) - (a1-20 (the int (* 0.00024414062 (-> s0-1 z)))) + (let* ((a0-30 (the int (/ (-> s0-1 x) METER_LENGTH))) + (a1-20 (the int (/ (-> s0-1 z) METER_LENGTH))) (a0-32 (/ (- *dice-offset-x* a0-30) -4)) ) (if (not (logtest? (-> *dice-blocked-array* (/ (- *dice-offset-z* a1-20) -4)) (ash 1 (- 15 a0-32)))) @@ -562,8 +562,8 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-13 quad) vf6) ) - (let* ((v1-15 (the int (* 0.00024414062 (-> s0-1 x)))) - (a0-48 (the int (* 0.00024414062 (-> s0-1 z)))) + (let* ((v1-15 (the int (/ (-> s0-1 x) METER_LENGTH))) + (a0-48 (the int (/ (-> s0-1 z) METER_LENGTH))) (v1-17 (/ (- *dice-offset-x* v1-15) -4)) (a1-31 (/ (- *dice-offset-z* a0-48) -4)) ) @@ -939,8 +939,8 @@ (set! (-> self color z) (-> self color x)) (set! (-> self draw color-mult quad) (-> self color quad)) (when (zero? (-> self active)) - (let* ((v1-15 (the int (* 0.00024414062 (-> self root trans x)))) - (a0-5 (the int (* 0.00024414062 (-> self root trans z)))) + (let* ((v1-15 (the int (/ (-> self root trans x) METER_LENGTH))) + (a0-5 (the int (/ (-> self root trans z) METER_LENGTH))) (s5-0 (/ (- *dice-offset-x* v1-15) -4)) (gp-0 (/ (- *dice-offset-z* a0-5) -4)) ) @@ -1143,8 +1143,8 @@ (set! (-> v1-9 quad 2) a2-1) (set! (-> v1-9 trans quad) a3-1) ) - (let ((v1-12 (the int (+ 2.0 (* 0.00024414062 (-> s1-0 trans x))))) - (a0-14 (the int (+ 2.0 (* 0.00024414062 (-> s1-0 trans z))))) + (let ((v1-12 (the int (+ 2.0 (/ (-> s1-0 trans x) METER_LENGTH)))) + (a0-14 (the int (+ 2.0 (/ (-> s1-0 trans z) METER_LENGTH)))) ) (set! sv-544 (/ (- *dice-offset-x* v1-12) -4)) (let ((s0-0 (/ (- *dice-offset-z* a0-14) -4))) @@ -1231,8 +1231,8 @@ (set! (-> sv-608 y) (get-ripple-height s0-1 sv-608)) (vector-! sv-576 sv-576 sv-560) (vector-! sv-608 sv-608 sv-560) - (set! (-> sv-576 y) (* 0.5 (-> sv-576 y))) - (set! (-> sv-608 y) (* 0.5 (-> sv-608 y))) + (set! (-> sv-576 y) (/ (-> sv-576 y) 2)) + (set! (-> sv-608 y) (/ (-> sv-608 y) 2)) (set! (-> sv-576 w) 0.0) (set! (-> sv-592 w) 0.0) (set! (-> sv-608 w) 0.0) @@ -1444,9 +1444,9 @@ (set! (-> this first) (the-as uint 1)) ) ) - (let* ((a0-48 (the int (* 0.00024414062 (-> this root trans x)))) - (v1-37 (the int (* 0.00024414062 (-> this root trans y)))) - (a1-21 (the int (* 0.00024414062 (-> this root trans z)))) + (let* ((a0-48 (the int (/ (-> this root trans x) METER_LENGTH))) + (v1-37 (the int (/ (-> this root trans y) METER_LENGTH))) + (a1-21 (the int (/ (-> this root trans z) METER_LENGTH))) (a0-49 (- a0-48 *dice-offset-x*)) (a2-13 (- a1-21 *dice-offset-z*)) (a1-22 (+ a0-49 1)) @@ -2214,7 +2214,7 @@ (gp-0 (-> self draw shadow-ctrl)) ) (vector<-cspace! (-> self root trans) s5-0) - (let ((f0-1 (* 0.5 (-> s5-0 bone scale y)))) + (let ((f0-1 (/ (-> s5-0 bone scale y) 2))) (set-vector! (-> self root scale) f0-1 f0-1 f0-1 1.0) ) (cond @@ -2529,7 +2529,7 @@ ) ) (when (< f30-0 122880.0) - (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (- 1.0 (* 0.000008138021 f30-0)))) (seconds 0.2)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (- 1.0 (/ f30-0 (meters 30))))) (seconds 0.2)) (activate! *camera-smush-control* (lerp-scale 1638.4 0.0 f30-0 0.0 122880.0) diff --git a/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc b/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc index 980d855a320..0df643b08e4 100644 --- a/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc @@ -991,7 +991,7 @@ (the int (* 2.0 f30-0)) ) (else - (the int (* 0.5 f30-0)) + (the int (/ f30-0 2)) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc index 58d65fefc62..370e7451ca2 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc @@ -654,7 +654,7 @@ (set! (-> self foot-locks s4-0 lock target) 1.0) ) (else - (vector+float*! s3-0 (-> gp-0 start-pos) (-> gp-0 move-dist) (- f0-12 (* 0.000013563368 f1-2))) + (vector+float*! s3-0 (-> gp-0 start-pos) (-> gp-0 move-dist) (- f0-12 (/ f1-2 (meters 18)))) (set! (-> self foot-locks s4-0 lock target) 0.0) ) ) @@ -1010,7 +1010,7 @@ (set! f28-0 0.0) ) (else - (* 0.5 f26-0) + (/ f26-0 2) ) ) ) @@ -1862,7 +1862,7 @@ (f30-0 (vector-normalize-ret-len! gp-1 1.0)) ) (quaternion-from-two-vectors! (-> self root quat) (new 'static 'vector :y -1.0) gp-1) - (set! (-> self root scale y) (* 0.000009042245 f30-0)) + (set! (-> self root scale y) (/ f30-0 (meters 27))) ) ) :code sleep-code @@ -1923,7 +1923,7 @@ (gp-2 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> self target-pos))) ) (let ((f0-4 (vector-normalize-ret-len! gp-2 1.0))) - (set! (-> self root scale y) (* 0.000009042245 f0-4)) + (set! (-> self root scale y) (/ f0-4 (meters 27))) (vector+float*! (-> self root trans) s5-0 gp-2 (- f0-4)) ) (quaternion-from-two-vectors! (-> self root quat) (new 'static 'vector :y -1.0) gp-2) @@ -2110,7 +2110,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (let ((f30-0 4096.0)) - (let ((f28-1 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) + (let ((f28-1 (* 0.00013563369 (tan (/ (-> *math-camera* fov) 2)) f30-0))) (matrix->quaternion (-> self root quat) s5-0) (set-vector! (-> self root scale) f28-1 f28-1 f28-1 1.0) ) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc index 0320bc0460d..15ee99b30cb 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc @@ -708,10 +708,10 @@ ) ) ((= (-> self stage) 3) - (* 0.004 f28-0) + (/ f28-0 250) ) (else - (* 0.008 f28-0) + (/ f28-0 125) ) ) ) @@ -1408,7 +1408,7 @@ ) ) (when (!= f30-0 0.0) - (matrix-axis-angle! s5-0 (-> gp-0 vector 1) (* 0.5 (-> self clock time-adjust-ratio) f30-0)) + (matrix-axis-angle! s5-0 (-> gp-0 vector 1) (* (/ (-> self clock time-adjust-ratio) 2) f30-0)) (matrix*! gp-0 gp-0 s5-0) (matrix-remove-z-rot gp-0 (new 'static 'vector :y -1.0)) (matrix->quaternion (-> self root quat) gp-0) @@ -1992,7 +1992,7 @@ (s4-0 (new 'stack-no-clear 'vector)) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (let ((f30-0 (* 4096.0 (* 0.25 (-> self clock time-adjust-ratio)))) + (let ((f30-0 (* 4096.0 (/ (-> self clock time-adjust-ratio) 4))) (s1-0 #f) ) (set! (-> s3-0 quad) (-> self root trans quad)) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc index ee0d8bf0c8a..21e8d6c211e 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc @@ -432,7 +432,7 @@ (launch-particles (-> *part-id-table* 622) s3-2) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000020345053 f30-0)) + (f26-0 (/ f30-0 (meters 12))) (f30-1 (-> *part-id-table* 623 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 623 init-specs 5 initial-valuef)) ) diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc index 3b7c6d0d2dc..ae453a5ee90 100644 --- a/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc @@ -3133,7 +3133,7 @@ (launch-particles (-> *part-id-table* 4859) s4-1) ) (let ((s4-2 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000012207031 f30-0)) + (f26-0 (/ f30-0 (meters 20))) (f30-1 (-> *part-id-table* 4860 init-specs 3 initial-valuef)) (f28-0 (-> *part-id-table* 4860 init-specs 4 initial-valuef)) ) diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc index dfd274418d9..f3e1c876188 100644 --- a/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc @@ -1456,7 +1456,7 @@ ) ) (set! (-> self gun-tilt) (fmin 8192.0 (fmax -8192.0 (-> self gun-tilt)))) - (let ((f30-2 (* 0.5 (-> self gun-tilt)))) + (let ((f30-2 (/ (-> self gun-tilt) 2))) (quaternion-set! (-> self gun-tilt-left-jm quat) (sin f30-2) 0.0 0.0 (cos f30-2)) ) (quaternion-copy! (-> self gun-tilt-right-jm quat) (-> self gun-tilt-left-jm quat)) diff --git a/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc index 1b2b34f10ac..5df5b4b0e7d 100644 --- a/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc @@ -183,7 +183,7 @@ (s1-0 (quaternion-rotate-local-z! (new 'stack-no-clear 'quaternion) (-> self root quat) - (+ (-> s4-0 z-rotate) (* 0.2 f28-0)) + (+ (-> s4-0 z-rotate) (/ f28-0 5)) ) ) ) @@ -627,7 +627,7 @@ (launch-particles (-> *part-id-table* 608) s4-1) ) (let ((s4-2 (new 'stack-no-clear 'matrix)) - (f22-0 (* 0.000027126736 f30-0)) + (f22-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 609 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 609 init-specs 4 initial-valuef)) (f26-1 (-> *part-id-table* 609 init-specs 1 initial-valuef)) diff --git a/test/decompiler/reference/jak2/levels/palace/throne/metalkor-texture_REF.gc b/test/decompiler/reference/jak2/levels/palace/throne/metalkor-texture_REF.gc index c151974a860..e08e63147f1 100644 --- a/test/decompiler/reference/jak2/levels/palace/throne/metalkor-texture_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/throne/metalkor-texture_REF.gc @@ -160,8 +160,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) diff --git a/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc index dbfea2b084b..5578396ab14 100644 --- a/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc @@ -211,7 +211,7 @@ ) ) ) - (vector-float*! (-> s4-0 transv) s3-0 (* 0.1 (-> self clock frames-per-second))) + (vector-float*! (-> s4-0 transv) s3-0 (/ (-> self clock frames-per-second) 10)) ) (let ((v1-35 (-> s4-0 root-prim))) (set! (-> v1-35 prim-core collide-as) (-> s4-0 backup-collide-as)) diff --git a/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc b/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc index 4c9ee63545d..aa5f7182610 100644 --- a/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc @@ -82,7 +82,7 @@ (a0-8 (-> gp-1 mode)) (v1-6 (cond ((= a0-8 'mech-punch) - (and (< f1-1 0.0) (< (fabs (* 0.5 f0-3)) (fabs f1-1))) + (and (< f1-1 0.0) (< (fabs (/ f0-3 2)) (fabs f1-1))) ) ((= a0-8 'crush) (< (sqrtf (+ (* (-> v1-4 x) (-> v1-4 x)) (* (-> v1-4 z) (-> v1-4 z)))) 40960.0) diff --git a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc index 70525406a2e..cb723bcc4e1 100644 --- a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc @@ -862,7 +862,7 @@ (seek-to-point-toward-point! (-> self root) (get-trans (the-as process-focusable a0-2) 3) - (* 0.5 (-> self nav max-rotation-rate)) + (/ (-> self nav max-rotation-rate) 2) (seconds 0.5) ) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc index e6098c93054..78701d038f8 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc @@ -338,7 +338,7 @@ (f28-0 (seek-ease f0-8 0.0 - (* (lerp 21299.2 8192.0 (* 0.000005086263 (-> self spin-rate))) (seconds-per-frame)) + (* (lerp 21299.2 8192.0 (/ (-> self spin-rate) (meters 48))) (seconds-per-frame)) 12288.0 2.0 ) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc index 226d6d44295..3ae62b20486 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc @@ -681,7 +681,7 @@ ) (rigid-body-method-18 (-> v1-27 state) a1-12 a2-3) ) - (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> this escort-force 0 y))) + (vector-normalize-copy! s5-0 *y-vector* (* (/ f30-0 2) f28-0 (-> this escort-force 0 y))) (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 1) (-> this root quat)) (vector+! gp-0 gp-0 (-> this root trans)) (let ((v1-34 (-> this rbody)) @@ -698,7 +698,7 @@ ) (rigid-body-method-18 (-> v1-40 state) a1-21 a2-8) ) - (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> this escort-force 1 y))) + (vector-normalize-copy! s5-0 *y-vector* (* (/ f30-0 2) f28-0 (-> this escort-force 1 y))) ) ) (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 3) (-> this root quat)) @@ -1787,7 +1787,7 @@ (ja-no-eval :group! (-> self draw art-group data (-> self walk-anim)) :num! (loop!) :frame-num 0.0) (until #f (suspend) - (let ((f0-3 (fmax 0.2 (* 0.00008138021 (-> self observed-speed))))) + (let ((f0-3 (fmax 0.2 (/ (-> self observed-speed) (meters 3))))) (ja :num! (loop! f0-3)) ) ) @@ -2292,7 +2292,7 @@ ) (until #f (suspend) - (let ((f30-0 (fmax 0.2 (* 0.00008138021 (-> self observed-speed)))) + (let ((f30-0 (fmax 0.2 (/ (-> self observed-speed) (meters 3)))) (f28-0 0.0) ) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) diff --git a/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc index 52c7d261e76..f1217846a1a 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc @@ -148,8 +148,8 @@ (defmethod init ((this widow-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this xz-max) (* 0.5 arg2)) - (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this xz-max) (/ arg2 2)) + (set! (-> this y-max) (/ arg3 2)) (set! (-> this timer) 0) (vector-reset! (-> this value)) 0 diff --git a/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc index bc0904a2dfa..24b5efa139a 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc @@ -661,21 +661,21 @@ ) (let ((s3-0 quaternion-set!) (s2-0 s5-0) - (s1-0 (sin (* 0.5 (-> this x-rotate)))) + (s1-0 (sin (/ (-> this x-rotate) 2))) (s0-0 0.0) ) (set! sv-48 (the-as float 0.0)) - (let ((t0-0 (cos (* 0.5 (-> this x-rotate))))) + (let ((t0-0 (cos (/ (-> this x-rotate) 2)))) (s3-0 s2-0 s1-0 s0-0 sv-48 t0-0) ) ) (let ((s3-1 quaternion-set!) (s2-1 gp-0) (s1-1 0.0) - (s0-1 (sin (* 0.5 (-> this y-rotate)))) + (s0-1 (sin (/ (-> this y-rotate) 2))) ) (set! sv-64 (the-as float 0.0)) - (let ((t0-1 (cos (* 0.5 (-> this y-rotate))))) + (let ((t0-1 (cos (/ (-> this y-rotate) 2)))) (s3-1 s2-1 s1-1 s0-1 sv-64 t0-1) ) ) @@ -1357,7 +1357,7 @@ (vector-! v1-42 arg1 arg0) (set! (-> v1-42 y) 0.0) (let ((f30-1 (atan (-> v1-42 x) (-> v1-42 z)))) - (quaternion-set! (-> self root quat) 0.0 (sin (* 0.5 f30-1)) 0.0 (cos (* 0.5 f30-1))) + (quaternion-set! (-> self root quat) 0.0 (sin (/ f30-1 2)) 0.0 (cos (/ f30-1 2))) ) ) (set! (-> self which-trajectory) 0) diff --git a/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc b/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc index e9915eb9568..5cb1b78fa98 100644 --- a/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc @@ -1050,7 +1050,7 @@ (vector-normalize! s3-1 f28-0) (vector+! (-> this charge-pos) s5-0 s3-1) (let ((f30-0 f28-0) - (f28-1 (* 0.000024414063 f28-0)) + (f28-1 (/ f28-0 (meters 10))) (s3-2 0) (s2-0 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc b/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc index dbe5a5a50cb..1939d6eb646 100644 --- a/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc @@ -1504,7 +1504,7 @@ s5-1 ) (vector-normalize! s5-1 1.0) - (vector-seek-3d-smooth! (-> gp-1 vector 1) s5-1 (* 0.5 (-> self clock time-adjust-ratio)) 0.5) + (vector-seek-3d-smooth! (-> gp-1 vector 1) s5-1 (/ (-> self clock time-adjust-ratio) 2) 0.5) (vector-normalize! s5-1 1.0) (quaternion-from-two-vectors-partial! (-> self head-mod quat) diff --git a/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc b/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc index 06cd3170125..c722824b17c 100644 --- a/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc @@ -92,7 +92,7 @@ (gp-0 (new 'stack-no-clear 'vector)) (f30-0 4096.0) ) - (let ((f0-4 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) + (let ((f0-4 (* 0.00013563369 (tan (/ (-> *math-camera* fov) 2)) f30-0))) (set-vector! (-> this root scale) f0-4 f0-4 f0-4 1.0) ) (set! (-> gp-0 quad) (-> (camera-pos) quad)) diff --git a/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc index b84f5ccb707..e98d2f6c1b1 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc @@ -1230,7 +1230,7 @@ (defun fov->maya ((arg0 float)) (if (= arg0 0.0) 0.0 - (/ 12.700255 (tan (* 0.5 arg0))) + (/ 12.700255 (tan (/ arg0 2))) ) ) @@ -3713,7 +3713,3 @@ (cam-layout-stop) (cam-layout-start) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-master_REF.gc index a4427ce911d..d86d6d63278 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-master_REF.gc @@ -232,10 +232,10 @@ (let ((f30-0 (vector-dot s5-7 (-> self local-down)))) (vector--float*! s5-7 s5-7 (-> self local-down) f30-0) (if (< 0.0 f30-0) - (set! (-> self upspeed) (* 0.5 (-> self upspeed))) + (set! (-> self upspeed) (/ (-> self upspeed) 2)) ) (vector+! (-> self tpos-tgt) (-> self tpos-tgt) s5-7) - (let ((f0-26 (* 0.05 f30-0))) + (let ((f0-26 (/ f30-0 20))) (vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) f0-26) ) ) diff --git a/test/decompiler/reference/jak3/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-states-dbg_REF.gc index 209260bb2aa..4029cb9dcb1 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-states-dbg_REF.gc @@ -56,10 +56,10 @@ ) (cond ((cpad-hold? (-> *CAMERA-bank* joypad) r2) - (set! (-> s5-0 y) (- (-> s5-0 y) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) - (set! (-> s5-0 x) (- (-> s5-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0)))) - (+! (-> gp-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f28-0)) - (+! (-> gp-0 z) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f30-0)) + (set! (-> s5-0 y) (- (-> s5-0 y) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f26-0)))) + (set! (-> s5-0 x) (- (-> s5-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f0-0)))) + (+! (-> gp-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f28-0)) + (+! (-> gp-0 z) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f30-0)) ) (else (set! (-> s5-0 y) (- (-> s5-0 y) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0)))) @@ -237,9 +237,7 @@ (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) (if (cpad-hold? arg4 r1) (+! (-> arg2 y) - (+ (* 0.2 f30-0) - (analog-input (the-as int (-> *cpad-list* cpads arg4 abutton 9)) 0.0 32.0 230.0 (* 0.2 f30-0)) - ) + (+ (/ f30-0 5) (analog-input (the-as int (-> *cpad-list* cpads arg4 abutton 9)) 0.0 32.0 230.0 (/ f30-0 5))) ) ) ) @@ -247,9 +245,7 @@ (if (cpad-hold? arg4 l1) (set! (-> arg2 y) (- (-> arg2 y) - (+ (* 0.2 f30-0) - (analog-input (the-as int (-> *cpad-list* cpads arg4 abutton 8)) 0.0 32.0 230.0 (* 0.2 f30-0)) - ) + (+ (/ f30-0 5) (analog-input (the-as int (-> *cpad-list* cpads arg4 abutton 8)) 0.0 32.0 230.0 (/ f30-0 5))) ) ) ) @@ -318,16 +314,16 @@ ((logtest? (-> (the-as cpad-list (+ (* arg4 4) (the-as int *cpad-list*))) cpads 0 button0-abs 0) (pad-buttons l2) ) - (set! (-> arg1 y) (- (-> arg1 y) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f24-0)))) - (set! (-> arg1 x) (- (-> arg1 x) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f0-19)))) + (set! (-> arg1 y) (- (-> arg1 y) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f24-0)))) + (set! (-> arg1 x) (- (-> arg1 x) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f0-19)))) ) (else (set! (-> arg1 y) (- (-> arg1 y) (* (- f24-0) (-> *CAM_FREE-bank* rot-speed)))) (set! (-> arg1 x) (- (-> arg1 x) (* (- f0-19) (-> *CAM_FREE-bank* rot-speed)))) ) ) - (+! (-> arg2 x) (* 0.2 f30-0 f26-2)) - (+! (-> arg2 z) (* 0.2 f30-0 f28-4)) + (+! (-> arg2 x) (* (/ f30-0 5) f26-2)) + (+! (-> arg2 z) (* (/ f30-0 5) f28-4)) ) ((and (not s3-0) (cpad-hold? arg4 l2)) (+! (-> arg2 x) (* f26-2 f30-0)) @@ -462,7 +458,3 @@ #f ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-states_REF.gc index fb6000c50b1..ce2a1aaf1d3 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-states_REF.gc @@ -2571,7 +2571,7 @@ (set! f28-0 0.0) ) (if (-> self have-phony-joystick) - (set! f28-0 (* 0.05 (-> self phony-joystick-y))) + (set! f28-0 (/ (-> self phony-joystick-y) 20)) ) (if (and (-> *camera* being-attacked) (not (time-elapsed? (-> *camera* attack-start) (seconds 0.25)))) (set! f28-0 0.05) @@ -2594,7 +2594,7 @@ (let ((f0-23 f26-0)) (when (and (< f26-0 0.0) (not (logtest? (cam-slave-options BOMBBOT) (-> *camera* settings slave-options)))) (let ((f0-26 - (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (* 0.5 (-> self string-min-val z))) + (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (/ (-> self string-min-val z) 2)) ) ) (set! f0-23 (fmin 0.75 f0-26)) @@ -3964,7 +3964,3 @@ #f ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/camera/camera_REF.gc b/test/decompiler/reference/jak3/engine/camera/camera_REF.gc index a05873c5807..abe29b7e447 100644 --- a/test/decompiler/reference/jak3/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/camera_REF.gc @@ -291,7 +291,7 @@ 0.0 ) ((>= 0.25 arg0) - (* 0.5 arg0) + (/ arg0 2) ) ((>= arg0 0.75) (- 1.0 (* 0.5 (- 1.0 arg0))) @@ -822,7 +822,7 @@ (the-as vector (-> this point (-> this end-point))) ) (let* ((f0-0 (vector-length s3-0)) - (f1-1 (* 0.33333334 (- 1.5 (* 0.00024414062 f0-0)))) + (f1-1 (* 0.33333334 (- 1.5 (/ f0-0 METER_LENGTH)))) ) 0.0 (let* ((f1-2 (fmax 0.0 f1-1)) @@ -852,7 +852,7 @@ (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-18))) ) (let* ((f0-5 (vector-normalize-ret-len! s2-0 1.0)) - (f0-6 (* 0.5 f0-5)) + (f0-6 (/ f0-5 2)) (f26-0 (* (fmin 1.0 f0-6) f30-0 (vector-dot arg0 s2-0))) ) (let ((f1-14 (vector-dot s2-0 s3-0))) @@ -930,7 +930,7 @@ (tracking-spline-method-19 this (* (-> this max-move) (-> pp clock time-adjust-ratio)) arg0 arg5 s3-0) (tracking-spline-method-14 this s3-0) (dotimes (s2-0 63) - (tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 arg5 s3-0) + (tracking-spline-method-18 this (/ (-> this sample-len) 64) arg0 arg5 s3-0) ) (vector-float*! arg0 arg0 0.015625) (vector-float*! arg5 arg5 0.015625) @@ -1335,7 +1335,7 @@ (vector-! s2-0 s2-0 (-> arg0 follow-off)) (vector-float*! s2-0 s2-0 f0-23) ) - (+! (-> arg0 follow-blend) (* 0.016666668 (-> pp clock time-adjust-ratio))) + (+! (-> arg0 follow-blend) (/ (-> pp clock time-adjust-ratio) 60)) (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s2-0) ) (else @@ -1576,7 +1576,7 @@ (let ((f28-0 (vector-dot s3-0 (-> arg0 rvec)))) (set! sv-128 s2-0) (set! sv-112 (-> arg0 rvec)) - (let ((f0-7 (* 0.8 (tan (* 0.5 arg2))))) + (let ((f0-7 (* 0.8 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-112 quad)) (let ((v1-11 f0-7)) (.mov vf2 v1-11) @@ -1609,7 +1609,7 @@ (let ((f28-1 (vector-dot s3-0 (-> arg0 uvec)))) (set! sv-160 s2-0) (set! sv-144 (-> arg0 uvec)) - (let ((f0-16 (* 0.525 (tan (* 0.5 arg2))))) + (let ((f0-16 (* 0.525 (tan (/ arg2 2))))) (.lvf vf1 (&-> sv-144 quad)) (let ((v1-32 f0-16)) (.mov vf2 v1-32) @@ -1635,7 +1635,7 @@ (let ((f28-2 (vector-dot s3-0 (-> arg0 uvec)))) (let ((s0-1 s2-0)) (set! sv-176 (-> arg0 uvec)) - (let ((f0-26 (* 0.525 (tan (* 0.5 arg2))))) + (let ((f0-26 (* 0.525 (tan (/ arg2 2))))) (vector-float*! s0-1 sv-176 f0-26) ) ) @@ -1800,7 +1800,7 @@ (set! sv-256 vector-into-frustum-nosmooth!) (set! sv-272 s1-0) (set! sv-288 arg1) - (let ((a2-5 (lerp-clamp arg3 (* 0.25 arg3) (-> arg0 underwater-blend value)))) + (let ((a2-5 (lerp-clamp arg3 (/ arg3 4) (-> arg0 underwater-blend value)))) (sv-256 sv-272 sv-288 a2-5) ) (cond @@ -2067,7 +2067,3 @@ ) arg0 ) - - - - diff --git a/test/decompiler/reference/jak3/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-touch_REF.gc index fcb16c7fc48..234f42fe3f6 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-touch_REF.gc @@ -515,7 +515,7 @@ ) ) (let ((f1-2 (- (- (vector-length gp-1) (-> v1-0 prim-core world-sphere w)) (-> s4-0 prim-core world-sphere w)))) - (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2))) + (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (/ f1-2 2))) ) (vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core))) ) @@ -546,7 +546,3 @@ ) arg0 ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/blocking-plane_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/blocking-plane_REF.gc index 9715b516675..4c0ddc0da17 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/blocking-plane_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/blocking-plane_REF.gc @@ -167,11 +167,11 @@ ) (vector+! (-> s2-1 trans) s3-0 s4-0) (vector-float*! (-> s2-1 trans) (-> s2-1 trans) 0.5) - (+! (-> s2-1 trans y) (* 0.5 arg1)) + (+! (-> s2-1 trans y) (/ arg1 2)) (vector-! (-> s1-0 rvec) s4-0 s3-0) (let ((f30-1 (vector-normalize-ret-len! (-> s1-0 rvec) 1.0))) - (set! (-> s2-1 scale x) (* 0.00024414062 f30-1)) - (set! (-> s2-1 scale y) (* 0.00024414062 arg1)) + (set! (-> s2-1 scale x) (/ f30-1 METER_LENGTH)) + (set! (-> s2-1 scale y) (/ arg1 METER_LENGTH)) (set! (-> s2-1 scale z) 0.0) (set! (-> s1-0 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) (vector-cross! (-> s1-0 fvec) (-> s1-0 rvec) (-> s1-0 uvec)) @@ -179,7 +179,7 @@ (matrix->quaternion (-> s2-1 quat) s1-0) (let ((v1-20 (-> this root root-prim local-sphere))) (set! (-> v1-20 x) 0.0) - (set! (-> v1-20 y) (* 0.00024414062 (* 0.5 arg1))) + (set! (-> v1-20 y) (* 0.00024414062 (/ arg1 2))) (set! (-> v1-20 z) 0.0) (let ((f0-17 0.5) (f1-7 (* f30-1 f30-1)) @@ -286,7 +286,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc index 3a91e18c443..9406632b9fb 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc @@ -978,7 +978,7 @@ (set! (-> self root trans y) (-> self base y)) (cond ((< (-> self root transv y) -8192.0) - (set! (-> self root transv y) (* -0.5 (-> self root transv y))) + (set! (-> self root transv y) (/ (-> self root transv y) -2)) ) (else (if (and (logtest? (-> self fact options) (actor-option suck-in)) @@ -1122,7 +1122,7 @@ ) (else (if (nonzero? (-> self part)) - (set! (-> self part local-space-binding) (the-as particle-local-space-info (* 0.0033333334 f0-1))) + (set! (-> self part local-space-binding) (the-as particle-local-space-info (/ f0-1 300))) ) (when (nonzero? (-> self draw)) (logior! (-> self draw status) (draw-control-status force-fade)) @@ -1937,7 +1937,7 @@ (set! (-> a0-6 y) 0.0) (vector-normalize! a0-6 1.0) ) - (vector-float*! gp-2 gp-2 (rand-vu-float-range (* 0.25 f30-0) (* 0.75 f30-0))) + (vector-float*! gp-2 gp-2 (rand-vu-float-range (/ f30-0 4) (* 0.75 f30-0))) ) (set! (-> self root transv quad) (-> gp-2 quad)) ) @@ -3269,7 +3269,7 @@ ((and (>= f24-1 f0-10) (logtest? s2-0 (game-feature gun-red-1 gun-red-2 gun-red-3))) (set! (-> arg1 0) (pickup-type ammo-red)) (if (>= 1 (mod (the-as int (rand-uint31-gen *random-generator*)) 3)) - (set! (-> arg2 0) (* 0.5 (-> arg2 0))) + (set! (-> arg2 0) (/ (-> arg2 0) 2)) ) ) ((and (>= f28-1 f0-10) (logtest? s2-0 (game-feature gun-blue-1 gun-blue-2 gun-blue-3))) @@ -3279,7 +3279,7 @@ ) ((and (>= f30-1 f0-10) (logtest? (game-feature gun-dark-1 gun-dark-2 gun-dark-3) s2-0)) (set! (-> arg1 0) (pickup-type ammo-dark)) - (set! (-> arg2 0) (the float (the int (fmax 1.0 (* 0.06666667 (-> arg2 0)))))) + (set! (-> arg2 0) (the float (the int (fmax 1.0 (/ (-> arg2 0) 15))))) ) (else (pickup-dark-set! arg0 arg1 arg2 arg3) diff --git a/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc index 144334993ab..5c7152e1df5 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc @@ -1431,9 +1431,9 @@ ;; WARN: Return type mismatch int vs none. (defmethod smush-update! ((this crate)) (let ((f0-0 (update! (-> this smush)))) - (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale x) (+ 1.0 (/ f0-0 -2))) (set! (-> this root scale y) (+ 1.0 f0-0)) - (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale z) (+ 1.0 (/ f0-0 -2))) ) 0 (none) diff --git a/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc index 207cfc96ea0..528ba7c6de3 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc @@ -1206,7 +1206,7 @@ (f26-1 (fmax 0.0 (fmin 1.0 f0-12))) (f28-1 (* f28-0 f26-1)) ) - (let* ((f1-8 (* 0.000061035156 (-> self root root-prim local-sphere w))) + (let* ((f1-8 (/ (-> self root root-prim local-sphere w) (meters 4))) (f0-21 (fmax 0.0 (fmin 1.0 f1-8))) ) (* f30-0 (lerp 2.0 1.0 f0-21)) @@ -1236,7 +1236,7 @@ (f0-34 (/ (- f0-32 (* (the float (the int (/ f0-32 f30-3))) f30-3)) f30-3)) (f0-36 (cos (* 65536.0 f0-34))) (f0-37 (+ 1.0 f0-36)) - (f28-3 (* 0.5 f0-37)) + (f28-3 (/ f0-37 2)) ) (ja :num! identity :frame-interp0 f28-3 :frame-interp1 f28-3) (let ((a0-20 (-> self skel root-channel 1))) diff --git a/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc index fbb7f03ec4b..03edf47f32b 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc @@ -405,7 +405,7 @@ (launch-particles (-> *part-id-table* 852) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 853 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 853 init-specs 4 initial-valuef)) ) @@ -662,7 +662,3 @@ (the-as (pointer guard-shot) (spawn-projectile guard-shot gp-0 arg0 *default-dead-pool*)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/metalhead-projectile_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/metalhead-projectile_REF.gc index 7d4f178da8a..6893336c864 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/metalhead-projectile_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/metalhead-projectile_REF.gc @@ -399,7 +399,7 @@ (launch-particles (-> *part-id-table* 864) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000020345053 f30-0)) + (f26-0 (/ f30-0 (meters 12))) (f30-1 (-> *part-id-table* 865 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 865 init-specs 5 initial-valuef)) ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/water_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/water_REF.gc index 5702c700638..1e39ff6866b 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/water_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/water_REF.gc @@ -646,7 +646,7 @@ ) (set-time! (-> this drip-time)) (logclear! (-> this flags) (water-flag spawn-drip)) - (seek! (-> this drip-wetness) 0.0 (* 0.001 (-> this drip-speed))) + (seek! (-> this drip-wetness) 0.0 (/ (-> this drip-speed) 1000)) (set! (-> this drip-speed) (* 1.05 (-> this drip-speed))) (if (= (-> this drip-wetness) 0.0) (set! (-> this drip-height) 0.0) @@ -801,7 +801,7 @@ (set! (-> *part-id-table* 759 init-specs 4 initial-valuef) (+ 24576.0 arg0)) (set! (-> *part-id-table* 759 init-specs 19 initial-valuef) (+ 49152.0 arg0)) (set! (-> *part-id-table* 759 init-specs 1 initial-valuef) (* 0.0000036621095 f30-0)) - (set! (-> *part-id-table* 759 init-specs 2 initial-valuef) (* 0.1 f30-0)) + (set! (-> *part-id-table* 759 init-specs 2 initial-valuef) (/ f30-0 10)) (set! (-> *part-id-table* 759 init-specs 13 initial-valuef) 0.7111111) (set! (-> *part-id-table* 759 init-specs 3 initial-valuef) arg3) (set! (-> *part-id-table* 759 init-specs 5 initial-valuef) arg3) diff --git a/test/decompiler/reference/jak3/engine/debug/collision-editor_REF.gc b/test/decompiler/reference/jak3/engine/debug/collision-editor_REF.gc index c827bd94692..0534cae2f23 100644 --- a/test/decompiler/reference/jak3/engine/debug/collision-editor_REF.gc +++ b/test/decompiler/reference/jak3/engine/debug/collision-editor_REF.gc @@ -796,7 +796,7 @@ (when (= (-> this analog-func) (collision-editor-func analog)) (set! f30-0 (* -409.6 f30-0)) (set! f28-0 (* -409.6 f28-0)) - (let ((f0-8 (+ (* 0.01 f24-0) (* -0.01 f26-0)))) + (let ((f0-8 (+ (/ f24-0 100) (/ f26-0 -100)))) (set! f24-0 (+ 1.0 f0-8)) ) (set! f26-0 0.0) diff --git a/test/decompiler/reference/jak3/engine/debug/default-menu_REF.gc b/test/decompiler/reference/jak3/engine/debug/default-menu_REF.gc index 85ce2649a76..2b564097fb8 100644 --- a/test/decompiler/reference/jak3/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak3/engine/debug/default-menu_REF.gc @@ -269,13 +269,13 @@ (case arg0 (('close) (if (and *math-camera* *subdivide-settings*) - (* 0.00024414062 (-> *subdivide-settings* close 0)) + (/ (-> *subdivide-settings* close 0) METER_LENGTH) arg3 ) ) (('far) (if (and *math-camera* *subdivide-settings*) - (* 0.00024414062 (-> *subdivide-settings* far 0)) + (/ (-> *subdivide-settings* far 0) METER_LENGTH) arg3 ) ) @@ -558,7 +558,7 @@ (if (= arg1 (debug-menu-msg press)) (set! (-> v1-0 camera-to-bbox-dist) (* 4096.0 arg2)) ) - (* 0.00024414062 (-> v1-0 camera-to-bbox-dist)) + (/ (-> v1-0 camera-to-bbox-dist) METER_LENGTH) ) ) @@ -1119,7 +1119,7 @@ ) ) ) - (set! f30-0 (* 0.00024414062 f1-2)) + (set! f30-0 (/ f1-2 METER_LENGTH)) ) ) ) @@ -1155,7 +1155,7 @@ (set! (-> (the-as prototype-bucket-tie s2-0) tie-vanish-far) f0-0) ) ) - (set! f30-0 (* 0.00024414062 f0-0)) + (set! f30-0 (/ f0-0 METER_LENGTH)) ) ) ) @@ -2699,7 +2699,7 @@ (set! (-> s2-0 dists x) (* 4096.0 arg2)) (prototype-bucket-recalc-fields s2-0) ) - (set! f30-0 (* 0.00024414062 (-> s2-0 dists x))) + (set! f30-0 (/ (-> s2-0 dists x) METER_LENGTH)) ) ) ) @@ -2733,7 +2733,7 @@ (set! (-> s2-0 dists w) (* 4096.0 arg2)) (prototype-bucket-recalc-fields s2-0) ) - (set! f30-0 (* 0.00024414062 (-> s2-0 dists w))) + (set! f30-0 (/ (-> s2-0 dists w) METER_LENGTH)) ) ) ) @@ -6208,13 +6208,13 @@ fog-dists x ) - (* 0.00024414062 - (-> *overide-mood-fog-table* + (/ (-> *overide-mood-fog-table* data (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) fog-dists x ) + METER_LENGTH ) ) (set! (-> *overide-mood-fog-table* @@ -6223,13 +6223,13 @@ fog-dists y ) - (* 0.00024414062 - (-> *overide-mood-fog-table* + (/ (-> *overide-mood-fog-table* data (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) fog-dists y ) + METER_LENGTH ) ) ) @@ -6242,10 +6242,10 @@ (dotimes (v1-0 8) (set! (-> *overide-mood-fog-table* data v1-0 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-0 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-0 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-0 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-0 fog-dists y) METER_LENGTH) ) ) #f @@ -6568,10 +6568,10 @@ (set! (-> *overide-mood-color-table* data v1-0 amb-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-0 fog-color w) 1.0) (set! (-> *overide-mood-fog-table* data v1-0 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists x)) + (/ (-> *overide-mood-fog-table* data v1-0 fog-dists x) METER_LENGTH) ) (set! (-> *overide-mood-fog-table* data v1-0 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists y)) + (/ (-> *overide-mood-fog-table* data v1-0 fog-dists y) METER_LENGTH) ) (set-vector! (-> *time-of-day-context* times v1-0) 1.0 1.0 1.0 1.0) ) diff --git a/test/decompiler/reference/jak3/engine/debug/manipulator_REF.gc b/test/decompiler/reference/jak3/engine/debug/manipulator_REF.gc index 0e52a25d51a..1e2cf16c8d5 100644 --- a/test/decompiler/reference/jak3/engine/debug/manipulator_REF.gc +++ b/test/decompiler/reference/jak3/engine/debug/manipulator_REF.gc @@ -125,7 +125,7 @@ ) (v1-22 (vector-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 a2-3)) ) - (let ((a0-13 (* 0.25 arg3))) + (let ((a0-13 (/ arg3 4))) (.mov vf7 a0-13) ) (.lvf vf5 (&-> v1-22 quad)) @@ -145,7 +145,7 @@ ) (v1-29 (vector-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 a2-7)) ) - (let ((a0-17 (* 0.25 arg3))) + (let ((a0-17 (/ arg3 4))) (.mov vf7 a0-17) ) (.lvf vf5 (&-> v1-29 quad)) @@ -207,7 +207,7 @@ s5-0 (the-as vector (-> this mat)) f30-1 - (* 0.25 f30-1) + (/ f30-1 4) (if (= (-> this action) (manipulator-action ma1)) *color-yellow* *color-red* @@ -215,17 +215,17 @@ ) ) (if s3-0 - (draw-axis s5-0 (-> this mat uvec) f30-1 (* 0.25 f30-1) (if (= (-> this action) (manipulator-action ma2)) - *color-yellow* - *color-green* - ) + (draw-axis s5-0 (-> this mat uvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma2)) + *color-yellow* + *color-green* + ) ) ) (if s2-0 - (draw-axis s5-0 (-> this mat fvec) f30-1 (* 0.25 f30-1) (if (= (-> this action) (manipulator-action ma3)) - *color-yellow* - *color-blue* - ) + (draw-axis s5-0 (-> this mat fvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma3)) + *color-yellow* + *color-blue* + ) ) ) (let ((s1-0 (new 'stack-no-clear 'vector)) @@ -683,7 +683,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak3/engine/draw/drawable_REF.gc index 632214f330a..1a12fa69958 100644 --- a/test/decompiler/reference/jak3/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak3/engine/draw/drawable_REF.gc @@ -409,7 +409,7 @@ ) ) (set! (-> arg0 rdists z) (/ 1.0 (- (-> arg0 dists w) (-> arg0 dists z)))) - (set! (-> arg0 dists y) (* 0.5 (-> arg0 dists x))) + (set! (-> arg0 dists y) (/ (-> arg0 dists x) 2)) (set! (-> arg0 rdists y) (/ 1.0 (-> arg0 dists y))) arg0 ) diff --git a/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc b/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc index c6270f699c1..f896771b49a 100644 --- a/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc @@ -1075,7 +1075,7 @@ (sound-play-by-name (sound-name-with-material "zoom-land" (-> self control ground-pat) "") (new-sound-id) - (the int (* 1024.0 (* 0.000016276043 (-> self control ground-impact-vel)))) + (the int (* 1024.0 (/ (-> self control ground-impact-vel) (meters 15)))) 0 0 (sound-group) diff --git a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc index ef71a8624a0..71e0d5da800 100644 --- a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc @@ -68,10 +68,10 @@ ) (set! f0-0 (-> *FACT-bank* ammo-yellow-max)) (if (logtest? (game-feature gun-upgrade-yellow-ammo-1) (-> this features)) - (set! f0-0 (+ (the-as float f0-0) (* 0.5 (-> *FACT-bank* ammo-yellow-max)))) + (set! f0-0 (+ (the-as float f0-0) (/ (-> *FACT-bank* ammo-yellow-max) 2))) ) (if (logtest? (game-feature gun-upgrade-yellow-ammo-2) (-> this features)) - (set! f0-0 (+ (the-as float f0-0) (* 0.5 (-> *FACT-bank* ammo-yellow-max)))) + (set! f0-0 (+ (the-as float f0-0) (/ (-> *FACT-bank* ammo-yellow-max) 2))) ) (if (logtest? (game-secrets gun-upgrade-ammo-yellow) (-> this secrets)) (set! f0-0 (+ (the-as float f0-0) (-> *FACT-bank* ammo-yellow-max))) @@ -85,10 +85,10 @@ ) (set! f0-0 (-> *FACT-bank* ammo-red-max)) (if (logtest? (game-feature gun-upgrade-red-ammo-1) (-> this features)) - (set! f0-0 (+ (the-as float f0-0) (* 0.5 (-> *FACT-bank* ammo-red-max)))) + (set! f0-0 (+ (the-as float f0-0) (/ (-> *FACT-bank* ammo-red-max) 2))) ) (if (logtest? (game-feature gun-upgrade-red-ammo-2) (-> this features)) - (set! f0-0 (+ (the-as float f0-0) (* 0.5 (-> *FACT-bank* ammo-red-max)))) + (set! f0-0 (+ (the-as float f0-0) (/ (-> *FACT-bank* ammo-red-max) 2))) ) (if (logtest? (game-secrets gun-upgrade-ammo-red) (-> this secrets)) (set! f0-0 (+ (the-as float f0-0) (-> *FACT-bank* ammo-red-max))) @@ -102,10 +102,10 @@ ) (set! f0-0 (-> *FACT-bank* ammo-blue-max)) (if (logtest? (game-feature gun-upgrade-blue-ammo-1) (-> this features)) - (set! f0-0 (+ (the-as float f0-0) (* 0.5 (-> *FACT-bank* ammo-blue-max)))) + (set! f0-0 (+ (the-as float f0-0) (/ (-> *FACT-bank* ammo-blue-max) 2))) ) (if (logtest? (game-feature gun-upgrade-blue-ammo-2) (-> this features)) - (set! f0-0 (+ (the-as float f0-0) (* 0.5 (-> *FACT-bank* ammo-blue-max)))) + (set! f0-0 (+ (the-as float f0-0) (/ (-> *FACT-bank* ammo-blue-max) 2))) ) (if (logtest? (game-secrets gun-upgrade-ammo-blue) (-> this secrets)) (set! f0-0 (+ (the-as float f0-0) (-> *FACT-bank* ammo-blue-max))) diff --git a/test/decompiler/reference/jak3/engine/game/settings_REF.gc b/test/decompiler/reference/jak3/engine/game/settings_REF.gc index 0c63088b632..8f0fe186880 100644 --- a/test/decompiler/reference/jak3/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/settings_REF.gc @@ -1754,7 +1754,7 @@ (seek! (-> s5-0 dust-storm-sound-scalar) (-> s4-0 dust-storm-sound-scalar) - (* 0.5 (-> *display* real-clock seconds-per-frame)) + (/ (-> *display* real-clock seconds-per-frame) 2) ) (set! (-> s5-0 ambient-wind-scalar) (-> s4-0 ambient-wind-scalar)) (set! (-> s5-0 halfpipe-jump-mult) (-> s4-0 halfpipe-jump-mult)) diff --git a/test/decompiler/reference/jak3/engine/game/task/task-arrow_REF.gc b/test/decompiler/reference/jak3/engine/game/task/task-arrow_REF.gc index 0774fac2258..e639a0d108e 100644 --- a/test/decompiler/reference/jak3/engine/game/task/task-arrow_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/task/task-arrow_REF.gc @@ -229,11 +229,11 @@ (* (-> this alpha) (rand-vu-float-range 80.0 96.0)) ) (let ((f1-18 (lerp-scale 18432.0 44236.8 (- (-> (math-camera-pos) y) (-> this root trans y)) 12288.0 49152.0)) - (f0-56 (* 0.16666667 (-> this base-scale) f30-1)) + (f0-56 (* (/ (-> this base-scale) 6) f30-1)) ) (set! (-> *part-id-table* 410 init-specs 3 initial-valuef) (* f1-18 f0-56)) (set! (-> *part-id-table* 410 init-specs 5 initial-valuef) (* 73728.0 f0-56)) - (set! (-> *part-id-table* 411 init-specs 3 initial-valuef) (* 0.25 f0-56 f1-18)) + (set! (-> *part-id-table* 411 init-specs 3 initial-valuef) (* (/ f0-56 4) f1-18)) (set! (-> *part-id-table* 411 init-specs 5 initial-valuef) (* 18432.0 f0-56)) (if (or (not (logtest? (-> this flags) (task-arrow-flags taf4))) (< 0.0 f0-56)) (spawn (-> this part) (-> this root trans)) diff --git a/test/decompiler/reference/jak3/engine/geometry/geometry_REF.gc b/test/decompiler/reference/jak3/engine/geometry/geometry_REF.gc index 067a8bdf170..f6f8288502d 100644 --- a/test/decompiler/reference/jak3/engine/geometry/geometry_REF.gc +++ b/test/decompiler/reference/jak3/engine/geometry/geometry_REF.gc @@ -96,7 +96,7 @@ (.svf (&-> arg0 quad) vf3) (let* ((f0-0 (vector-length arg0)) (f1-1 (vector-dot arg0 arg2)) - (f0-2 (- (* 0.02 f0-0) f1-1)) + (f0-2 (- (/ f0-0 50) f1-1)) ) (vector+float*! arg0 arg0 arg2 (fmin 16384.0 (* 16.0 f0-2))) ) @@ -1352,7 +1352,7 @@ ) (while (> s3-0 0) (+! s3-0 -1) - (set! f28-0 (* 0.5 f28-0)) + (set! f28-0 (/ f28-0 2)) (let ((v1-6 (cond ((< f22-0 f20-0) (curve-get-pos! s1-0 s0-1 arg0) diff --git a/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-work_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-work_REF.gc index a26257f4180..ffbceed6c1f 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-work_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-work_REF.gc @@ -254,7 +254,7 @@ ) (let ((f2-1 (* 0.14285715 (- f0-0 f1-0)))) (set! (-> this dists x) (- f1-0)) - (set! (-> this dists y) (- (+ f1-0 (* 0.5 f2-1)))) + (set! (-> this dists y) (- (+ f1-0 (/ f2-1 2)))) (set! (-> this dists z) (- (+ f1-0 (* 2.0 f2-1)))) ) (set! (-> this dists w) (- f0-0)) @@ -953,7 +953,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag_REF.gc index 111f1467770..4e8eaa86d95 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag_REF.gc @@ -121,7 +121,7 @@ 0 (let ((s4-0 *math-camera*)) (vector-! s2-0 (camera-pos) (-> s5-0 start-corner)) - (+ (* (the int (* 0.0000019073486 (-> s2-0 y))) 32) (the int (* 0.0000019073486 (-> s2-0 x)))) + (+ (* (the int (/ (-> s2-0 y) (meters 128))) 32) (the int (/ (-> s2-0 x) (meters 128)))) (.lvf vf16 (&-> s4-0 plane 0 quad)) (.lvf vf17 (&-> s4-0 plane 1 quad)) (.lvf vf18 (&-> s4-0 plane 2 quad)) @@ -776,8 +776,8 @@ (set! sv-24 (the int (* 0.000030517578 (- (-> arg1 bbox min z) (-> this start-corner z))))) (set! sv-32 (the int (* 0.000030517578 (- (-> arg1 bbox max x) (-> this start-corner x))))) (set! sv-40 (the int (* 0.000030517578 (- (-> arg1 bbox max z) (-> this start-corner z))))) - (set! sv-48 (the int (* 0.125 (-> arg1 bbox min y)))) - (set! sv-56 (the int (* 0.125 (-> arg1 bbox max y)))) + (set! sv-48 (the int (/ (-> arg1 bbox min y) 8))) + (set! sv-56 (the int (/ (-> arg1 bbox max y) 8))) (set! sv-16 (max 0 (min 511 sv-16))) (set! sv-32 (max 0 (min 511 sv-32))) (set! sv-24 (max 0 (min 511 sv-24))) @@ -832,7 +832,7 @@ (set! sv-68 (new 'stack-no-clear 'vector)) (set! sv-72 (new 'stack-no-clear 'vector)) (set! sv-76 (the-as float 0.000030517578)) - (set! sv-80 (* 0.000030517578 (-> arg1 radius))) + (set! sv-80 (/ (-> arg1 radius) (meters 8))) (vector-! sv-64 (-> arg1 start-pos) (-> this start-corner)) (vector-float*! sv-64 sv-64 sv-76) (vector-float*! sv-72 (-> arg1 move-dist) sv-76) diff --git a/test/decompiler/reference/jak3/engine/gfx/background/subdivide_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/subdivide_REF.gc index c66f88a6896..27e24cf8bcf 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/subdivide_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/subdivide_REF.gc @@ -151,7 +151,7 @@ (set! (-> arg0 meters 0) (-> arg0 far arg2)) (set! (-> arg0 meters 4) (-> arg0 close arg2)) (let ((f0-3 (* 0.14285715 (- (-> arg0 meters 0) (-> arg0 meters 4))))) - (set! (-> arg0 meters 3) (+ (-> arg0 meters 4) (* 0.5 f0-3))) + (set! (-> arg0 meters 3) (+ (-> arg0 meters 4) (/ f0-3 2))) (set! (-> arg0 meters 2) (+ (-> arg0 meters 3) f0-3)) (set! (-> arg0 meters 1) (+ (-> arg0 meters 2) (* 2.0 f0-3))) ) @@ -187,16 +187,16 @@ ) (set! (-> arg0 data 1) (the-as uint (- f4-1))) (set! (-> arg0 data 5) (the-as uint (- f3-2))) - (set! (-> arg0 data 0) (the-as uint (* 0.5 f4-1))) - (set! (-> arg0 data 4) (the-as uint (* 0.5 f3-2))) + (set! (-> arg0 data 0) (the-as uint (/ f4-1 2))) + (set! (-> arg0 data 4) (the-as uint (/ f3-2 2))) (let ((f2-1 (* f2-0 f4-1)) (f5-7 (* f1-0 f3-2)) ) (set! (-> arg0 data 9) (the-as uint f2-1)) (set! (-> arg0 data 13) (the-as uint f5-7)) ) - (set! (-> arg0 data 8) (the-as uint (* -0.5 f4-1 f1-0))) - (set! (-> arg0 data 12) (the-as uint (* -0.5 f3-2 f0-0))) + (set! (-> arg0 data 8) (the-as uint (* (/ f4-1 -2) f1-0))) + (set! (-> arg0 data 12) (the-as uint (* (/ f3-2 -2) f0-0))) ) ) (none) diff --git a/test/decompiler/reference/jak3/engine/gfx/blit-displays_REF.gc b/test/decompiler/reference/jak3/engine/gfx/blit-displays_REF.gc index 6f271d85ff2..5c7151e59b6 100644 --- a/test/decompiler/reference/jak3/engine/gfx/blit-displays_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/blit-displays_REF.gc @@ -327,9 +327,9 @@ (cond ((-> this zoom-blur-2d) (set! (-> s5-0 quad) (-> this zoom-blur-pos quad)) - (let* ((f2-0 (* 0.001953125 f28-0 (-> s5-0 x))) + (let* ((f2-0 (* (/ f28-0 512) (-> s5-0 x))) (f0-6 (- f26-0 (- f28-0 f2-0))) - (f3-1 (* 0.0024038462 f28-0 (-> s5-0 y))) + (f3-1 (* (/ f28-0 416) (-> s5-0 y))) (f1-4 (- f30-0 (- f28-0 f3-1))) ) (set! (-> (the-as (inline-array vector4w) s2-0) 0 quad) (-> this sprite-slow-tmpl dma-vif quad)) @@ -355,10 +355,10 @@ ) (+! (-> s5-0 x) -1792.0) (+! (-> s5-0 y) -1840.0) - (let* ((f1-10 (* 0.001953125 f28-0 (-> s5-0 x))) + (let* ((f1-10 (* (/ f28-0 512) (-> s5-0 x))) (f2-8 (fmax 0.0 (fmin f1-10 f28-0))) (f0-22 (- f26-0 (- f28-0 f2-8))) - (f3-4 (* 0.0024038462 f28-0 (-> s5-0 y))) + (f3-4 (* (/ f28-0 416) (-> s5-0 y))) (f3-6 (fmax 0.0 (fmin f3-4 f28-0))) (f1-16 (- f30-0 (- f28-0 f3-6))) ) @@ -934,7 +934,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/foreground/foreground_REF.gc b/test/decompiler/reference/jak3/engine/gfx/foreground/foreground_REF.gc index a68c48b67a5..983c23a096b 100644 --- a/test/decompiler/reference/jak3/engine/gfx/foreground/foreground_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/foreground/foreground_REF.gc @@ -1295,7 +1295,7 @@ ) ) (else - (let ((envmap-rgba-multiplier (* 0.0078125 envmap-strength))) + (let ((envmap-rgba-multiplier (/ envmap-strength 128))) (dotimes (a2-26 3) (set! (-> envmap-rgba-out a2-26) (the-as @@ -1428,7 +1428,7 @@ (if (< dist-until-gone 81920.0) (set! fade-enable #t) ) - (set! fade-amount (the int (* 0.0015625 dist-until-gone))) + (set! fade-amount (the int (/ dist-until-gone 640))) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/foreground/ripple_REF.gc b/test/decompiler/reference/jak3/engine/gfx/foreground/ripple_REF.gc index c0986c27ff7..267323bdbfd 100644 --- a/test/decompiler/reference/jak3/engine/gfx/foreground/ripple_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/foreground/ripple_REF.gc @@ -222,7 +222,7 @@ (if (< f0-23 0.0) (set! f0-23 (-> gp-0 global-scale)) ) - (+ f30-0 (* 0.0078125 f1-12 f0-23)) + (+ f30-0 (* (/ f1-12 128) f0-23)) ) ) ) @@ -230,7 +230,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new_REF.gc index 0f614f338f0..d4fe7494361 100644 --- a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new_REF.gc @@ -739,10 +739,10 @@ (v1-13 (matrix-f-u-compose (new 'stack-no-clear 'matrix) (the-as vector arg4) a2-4)) (f26-1 6.0) ) - (set! sv-160 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (* 0.5 f22-0))) - (set! sv-164 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (* -0.5 f22-0))) - (set! sv-168 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (* 0.5 f22-0))) - (set! sv-172 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (* -0.5 f22-0))) + (set! sv-160 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (/ f22-0 2))) + (set! sv-164 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (/ f22-0 -2))) + (set! sv-168 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (/ f22-0 2))) + (set! sv-172 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (/ f22-0 -2))) (set! sv-176 (the-as rgba (new 'stack-no-clear 'array 'rgba 1))) (set! sv-176 (-> this base-color)) (set! sv-176 (copy-and-set-field sv-176 a (the int (* 128.0 f24-0)))) diff --git a/test/decompiler/reference/jak3/engine/gfx/hw/video_REF.gc b/test/decompiler/reference/jak3/engine/gfx/hw/video_REF.gc index 920def006aa..dbd8ef4aa8a 100644 --- a/test/decompiler/reference/jak3/engine/gfx/hw/video_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/hw/video_REF.gc @@ -26,7 +26,7 @@ (set! (-> *video-params* reset-video-mode) #t) (set! (-> *math-camera* isometric uvec y) 0.5) (set! (-> *math-camera* y-clip) 416.0) - (set! (-> *math-camera* y-pix) (* 0.5 (-> *math-camera* y-clip))) + (set! (-> *math-camera* y-pix) (/ (-> *math-camera* y-clip) 2)) (set! *profile-y* 1848) (set! (-> *video-params* set-video-mode) #t) 0 diff --git a/test/decompiler/reference/jak3/engine/gfx/math-camera_REF.gc b/test/decompiler/reference/jak3/engine/gfx/math-camera_REF.gc index 5f4379ae526..25cd5d0d83d 100644 --- a/test/decompiler/reference/jak3/engine/gfx/math-camera_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/math-camera_REF.gc @@ -55,7 +55,7 @@ Without this corrector, the fogginess of the world would change as the FOV chang "Compute some one-time camera constants. These should only change when changing aspect ratio." (local-vars (sv-16 float)) - (set! (-> arg0 x-ratio) (tan (* 0.5 arg3))) + (set! (-> arg0 x-ratio) (tan (/ arg3 2))) (if (= arg2 'aspect4x3) (set! (-> arg0 y-ratio) (* 0.75 (-> arg0 x-ratio))) (set! (-> arg0 y-ratio) (* 0.5625 (-> arg0 x-ratio))) @@ -640,7 +640,3 @@ Without this corrector, the fogginess of the world would change as the FOV chang (none) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/mood/mood-tables2_REF.gc b/test/decompiler/reference/jak3/engine/gfx/mood/mood-tables2_REF.gc index 6c2a41139cd..e24b87ab104 100644 --- a/test/decompiler/reference/jak3/engine/gfx/mood/mood-tables2_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/mood/mood-tables2_REF.gc @@ -428,8 +428,8 @@ (format 0 " :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%" - (* 0.00024414062 (-> *overide-table* mood-fog-table data _fog-idx fog-dists x)) - (* 0.00024414062 (-> *overide-table* mood-fog-table data _fog-idx fog-dists y)) + (/ (-> *overide-table* mood-fog-table data _fog-idx fog-dists x) METER_LENGTH) + (/ (-> *overide-table* mood-fog-table data _fog-idx fog-dists y) METER_LENGTH) (-> *overide-table* mood-fog-table data _fog-idx fog-dists w) (-> *overide-table* mood-fog-table data _fog-idx fog-dists z) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/mood/mood_REF.gc b/test/decompiler/reference/jak3/engine/gfx/mood/mood_REF.gc index dde6a468eb6..8eb3b0be459 100644 --- a/test/decompiler/reference/jak3/engine/gfx/mood/mood_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/mood/mood_REF.gc @@ -829,8 +829,8 @@ (set! (-> arg0 times arg1 w) f28-0) (when (not (paused?)) (if (< 0.75 f28-0) - (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.04 (-> pp clock time-adjust-ratio)))) - (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.02 (-> pp clock time-adjust-ratio)))) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (/ (-> pp clock time-adjust-ratio) 25))) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (/ (-> pp clock time-adjust-ratio) 50))) ) ) ) @@ -1881,11 +1881,11 @@ (format *stdcon* "overide fog ~f~%" (-> this overide fog)) ) (else - (format *stdcon* "time until random cloud ~f~%" (* 0.0033333334 (-> this time-until-random cloud))) + (format *stdcon* "time until random cloud ~f~%" (/ (-> this time-until-random cloud) 300)) (format *stdcon* "current cloud ~f~%" (-> this current-interp cloud)) (format *stdcon* "target cloud ~f~%" (-> this target-interp cloud)) (format *stdcon* "speed cloud ~f~%" (* (/ 1.0 (-> this speed-interp cloud)) (seconds-per-frame))) - (format *stdcon* "time until random fog ~f~%" (* 0.0033333334 (-> this time-until-random fog))) + (format *stdcon* "time until random fog ~f~%" (/ (-> this time-until-random fog) 300)) (format *stdcon* "current fog ~f~%" (-> this current-interp fog)) (format *stdcon* "target fog ~f~%" (-> this target-interp fog)) (format *stdcon* "speed fog ~f~%" (* (/ 1.0 (-> this speed-interp fog)) (seconds-per-frame))) diff --git a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-mid_REF.gc b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-mid_REF.gc index 0010123b1f1..f694d3e455f 100644 --- a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-mid_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-mid_REF.gc @@ -17,7 +17,7 @@ (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 393216.0) (let* ((s4-0 (-> (matrix-local->world #f #f) fvec)) (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + (f1-1 (+ 0.5 (/ (-> s4-0 y) -2))) ) (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 0.0) ) @@ -269,7 +269,7 @@ (let ((f0-16 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) (if (-> *time-of-day-context* sky) (set-vector! (-> arg0 env-color) f0-16 f0-16 f0-16 f0-16) - (set-vector! (-> arg0 env-color) f0-16 f0-16 (* 0.5 f0-16) f0-16) + (set-vector! (-> arg0 env-color) f0-16 f0-16 (/ f0-16 2) f0-16) ) ) (set-vector! (-> arg0 index-table 0) 63 84 66 0) diff --git a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-near_REF.gc b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-near_REF.gc index 555be41bbb8..3209c66ebd2 100644 --- a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-near_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-near_REF.gc @@ -47,7 +47,7 @@ (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 0.000010172526) (let* ((s4-0 (-> (matrix-local->world #f #f) fvec)) (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + (f1-1 (+ 0.5 (/ (-> s4-0 y) -2))) ) (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 128.0) ) @@ -344,7 +344,7 @@ (let ((f0-28 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) (if (-> *time-of-day-context* sky) (set-vector! (-> arg0 env-color) f0-28 f0-28 f0-28 f0-28) - (set-vector! (-> arg0 env-color) f0-28 f0-28 (* 0.5 f0-28) f0-28) + (set-vector! (-> arg0 env-color) f0-28 f0-28 (/ f0-28 2) f0-28) ) ) (set! (-> arg0 drw2-adgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1)) @@ -718,7 +718,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-texture_REF.gc b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-texture_REF.gc index 8fff2a54a67..c89ad3dbe3e 100644 --- a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-texture_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-texture_REF.gc @@ -606,8 +606,8 @@ ;; WARN: Return type mismatch int vs none. (defmethod ocean-method-83 ((this ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) (when (>= (-> arg1 sun 0 pos y) -150.0) - (let* ((f2-0 (* 0.00010050251 (-> arg1 sun 0 pos x))) - (f1-3 (* 0.00010050251 (-> arg1 sun 0 pos z))) + (let* ((f2-0 (/ (-> arg1 sun 0 pos x) 9950)) + (f1-3 (/ (-> arg1 sun 0 pos z) 9950)) (f0-6 (if (< 0.0 (-> arg1 sun 0 pos y)) 1.0 (* 0.006666667 (+ 150.0 (-> arg1 sun 0 pos y))) @@ -782,7 +782,7 @@ (vector--float*! s2-0 arg2 (-> s3-0 sun1-normal) 9.0) (vector--float*! s4-0 arg2 (-> s3-0 moon-normal) 9.0) (vector-float*! s5-0 s5-0 (* (-> s3-0 sun0-scale) f28-0)) - (vector+float*! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> s3-0 sun1-scale))) + (vector+float*! s5-0 s5-0 s2-0 (* (/ f28-0 4) (-> s3-0 sun1-scale))) (vector+float*! s5-0 s5-0 s4-0 (* (-> s3-0 moon-scale) f28-0)) ) (+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0))) @@ -1374,7 +1374,3 @@ v0-0 ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean_REF.gc b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean_REF.gc index aebe5202f22..67f5121a128 100644 --- a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean_REF.gc @@ -3,8 +3,8 @@ ;; definition for method 21 of type ocean (defmethod set-corners! ((this ocean) (arg0 float) (arg1 float)) - (let* ((f2-0 (* 0.00008138021 arg0)) - (f3-0 (* 0.00008138021 arg1)) + (let* ((f2-0 (/ arg0 (meters 3))) + (f3-0 (/ arg1 (meters 3))) (f0-2 f2-0) (f0-4 (- f0-2 (the float (the int f0-2)))) (f1-6 f3-0) @@ -35,8 +35,8 @@ ((and (-> this heights) *ocean-map*) (let* ((f30-0 (- (-> arg0 x) (-> this start-corner x))) (f28-0 (- (-> arg0 z) (-> this start-corner z))) - (v1-3 (the int (* 0.0000025431316 f30-0))) - (a0-2 (the int (* 0.0000025431316 f28-0))) + (v1-3 (the int (/ f30-0 (meters 96)))) + (a0-2 (the int (/ f28-0 (meters 96)))) (v1-7 (-> this ocean-trans-indices data (+ (* 48 a0-2) v1-3))) ) (cond @@ -47,8 +47,8 @@ ) ) ((begin - (let ((a0-8 (logand (the int (* 0.000010172526 f30-0)) 3)) - (a3-4 (logand (the int (* 0.000010172526 f28-0)) 3)) + (let ((a0-8 (logand (the int (/ f30-0 (meters 24))) 3)) + (a3-4 (logand (the int (/ f28-0 (meters 24))) 3)) (v1-10 (-> this ocean-near-indices data (-> v1-7 child))) ) (set! v1-12 (-> (the-as (pointer int16) (+ (* (+ (* a3-4 4) a0-8) 2) (the-as int v1-10))))) @@ -61,14 +61,12 @@ ) ) (else - (let ((a0-14 (logand (the int (* 0.00008138021 f30-0)) 7))) + (let ((a0-14 (logand (the int (/ f30-0 (meters 3))) 7))) (cond - ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) - (ash 1 a0-14) - ) + ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (/ f28-0 (meters 3))) 7)) (ash 1 a0-14)) ) (let* ((f1-2 (vector-vector-distance arg0 (math-camera-pos))) - (f26-0 (- 1.0 (fmin 1.0 (* 0.000010172526 f1-2)))) + (f26-0 (- 1.0 (fmin 1.0 (/ f1-2 (meters 24))))) ) (if (-> this ocean-near-translucent?) (+ (* f26-0 (set-corners! this f30-0 f28-0)) (-> this start-corner y)) diff --git a/test/decompiler/reference/jak3/engine/gfx/sky/sky-tng_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sky/sky-tng_REF.gc index 9f790be342f..7affb7663d3 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sky/sky-tng_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sky/sky-tng_REF.gc @@ -205,7 +205,7 @@ (vector--float*! (the-as vector s2-0) arg2 (-> arg3 sun1-normal) 9.0) (vector--float*! (the-as vector s4-0) arg2 (-> arg3 moon-normal) 9.0) (vector4-scale! s5-0 s5-0 (* (-> arg3 sun0-scale) f28-0)) - (vector4-madd! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> arg3 sun1-scale))) + (vector4-madd! s5-0 s5-0 s2-0 (* (/ f28-0 4) (-> arg3 sun1-scale))) (vector4-madd! s5-0 s5-0 s4-0 (* (-> arg3 moon-scale) f28-0)) (+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0))) (+! (-> arg0 y) (fmax (fmin (-> s5-0 z) f30-0) (- f30-0))) @@ -250,7 +250,7 @@ (vector4-scale! (the-as vector4 (-> s4-0 sun1-color)) (the-as vector4 (-> this sun1-color)) - (* 0.5 (-> s4-0 sun1-scale)) + (/ (-> s4-0 sun1-scale) 2) ) (vector4-scale! (the-as vector4 (-> s4-0 moon-color)) @@ -435,7 +435,7 @@ (vector4-scale! (the-as vector4 (-> s4-0 sun1-color)) (the-as vector4 (-> this sun1-color)) - (* 0.5 (-> s4-0 sun1-scale)) + (/ (-> s4-0 sun1-scale) 2) ) (vector4-scale! (the-as vector4 (-> s4-0 moon-color)) diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/light-trails_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/light-trails_REF.gc index 9253a49f566..7c63346bfbb 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/light-trails_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/light-trails_REF.gc @@ -171,7 +171,7 @@ ((= (-> this appearance lie-mode) (lie-mode use-two-strips)) (let ((s1-0 (new 'stack-no-clear 'vector))) (set! (-> s1-0 quad) (-> this cache-vector 0 quad)) - (vector-normalize! s1-0 (* 0.5 arg2)) + (vector-normalize! s1-0 (/ arg2 2)) (add-vert-to-prim-strip! this (-> this strip) @@ -191,7 +191,7 @@ ) (let ((s1-1 (new 'stack-no-clear 'vector))) (set! (-> s1-1 quad) (-> this cache-vector 1 quad)) - (vector-normalize! s1-1 (* 0.5 arg2)) + (vector-normalize! s1-1 (/ arg2 2)) (add-vert-to-prim-strip! this (-> this strip2) @@ -213,7 +213,7 @@ (else (let ((s1-2 (new 'stack-no-clear 'vector))) (set! (-> s1-2 quad) (-> arg3 quad)) - (vector-normalize! s1-2 (* 0.5 arg2)) + (vector-normalize! s1-2 (/ arg2 2)) (add-vert-to-prim-strip! this (-> this strip) diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle_REF.gc index b1ec32fb49f..109ef1a5171 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle_REF.gc @@ -301,8 +301,8 @@ (set! (-> arg1 radius) f28-0) (let ((f24-0 (sin f26-0)) (f26-1 (cos f26-0)) - (f22-0 (sin (* 0.5 f30-0))) - (f0-5 (cos (* 0.5 f30-0))) + (f22-0 (sin (/ f30-0 2))) + (f0-5 (cos (/ f30-0 2))) (a2-1 (new 'stack-no-clear 'quaternion)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -733,7 +733,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/sprite-distort_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/sprite-distort_REF.gc index 3f20424db17..251a6a1b729 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/sprite-distort_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/sprite-distort_REF.gc @@ -60,7 +60,7 @@ (let ((f26-0 (* 65536.0 (/ (the float s2-0) (the float s4-0))))) (set-vector! (-> gp-0 entry s3-0) (* (sin f26-0) f28-0) (* (cos f26-0) f30-0) 0.0 0.0) (let ((s3-1 (+ s3-0 1))) - (set-vector! (-> gp-0 entry s3-1) (* 0.001953125 f28-0 (sin f26-0)) (* 0.001953125 f30-0 (cos f26-0)) 0.0 0.0) + (set-vector! (-> gp-0 entry s3-1) (* (/ f28-0 512) (sin f26-0)) (* (/ f30-0 512) (cos f26-0)) 0.0 0.0) (set! s3-0 (+ s3-1 1)) ) ) @@ -69,7 +69,7 @@ ) (set-vector! (-> gp-0 entry s3-0) 0.0 f30-0 0.0 0.0) (let ((v1-20 (+ s3-0 1))) - (set-vector! (-> gp-0 entry v1-20) 0.0 (* 0.001953125 f30-0) 0.0 0.0) + (set-vector! (-> gp-0 entry v1-20) 0.0 (/ f30-0 512) 0.0 0.0) (+ v1-20 1) ) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/sprite-glow_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/sprite-glow_REF.gc index da203da5e23..69bb72fe66c 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/sprite-glow_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/sprite-glow_REF.gc @@ -669,7 +669,7 @@ 1.0 ) (else - (let* ((f1-1 (* 0.00024414062 a0-5)) + (let* ((f1-1 (/ a0-5 METER_LENGTH)) (f0-4 (- f1-1 (the float (the int f1-1)))) ) (let ((f1-3 (* 4096.0 (- f1-1 f0-4)))) diff --git a/test/decompiler/reference/jak3/engine/math/math_REF.gc b/test/decompiler/reference/jak3/engine/math/math_REF.gc index f5a5d8dd1aa..04a8d8b651b 100644 --- a/test/decompiler/reference/jak3/engine/math/math_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/math_REF.gc @@ -94,9 +94,7 @@ (* arg0 (+ 0.33333334 (* arg0 - (+ -0.25 - (* arg0 (+ 0.2 (* arg0 (+ -0.16666666 (* arg0 (+ 0.14285715 (* arg0 (+ -0.125 (* 0.11111111 arg0))))))))) - ) + (+ -0.25 (* arg0 (+ 0.2 (* arg0 (+ -0.16666666 (* arg0 (+ 0.14285715 (* arg0 (+ -0.125 (/ arg0 9)))))))))) ) ) ) @@ -124,9 +122,7 @@ (* f0-5 (+ 0.33333334 (* f0-5 - (+ -0.25 - (* f0-5 (+ 0.2 (* f0-5 (+ -0.16666666 (* f0-5 (+ 0.14285715 (* f0-5 (+ -0.125 (* 0.11111111 f0-5))))))))) - ) + (+ -0.25 (* f0-5 (+ 0.2 (* f0-5 (+ -0.16666666 (* f0-5 (+ 0.14285715 (* f0-5 (+ -0.125 (/ f0-5 9)))))))))) ) ) ) @@ -159,9 +155,7 @@ (* f0-5 (+ 0.33333334 (* f0-5 - (+ -0.25 - (* f0-5 (+ 0.2 (* f0-5 (+ -0.16666666 (* f0-5 (+ 0.14285715 (* f0-5 (+ -0.125 (* 0.11111111 f0-5))))))))) - ) + (+ -0.25 (* f0-5 (+ 0.2 (* f0-5 (+ -0.16666666 (* f0-5 (+ 0.14285715 (* f0-5 (+ -0.125 (/ f0-5 9)))))))))) ) ) ) @@ -304,7 +298,7 @@ 0 0 (let* ((f0-1 (* 0.0033333334 (the float arg1))) - (a2-0 (the int (* 0.016666668 f0-1))) + (a2-0 (the int (/ f0-1 60))) (f0-2 (- f0-1 (* 60.0 (the float a2-0)))) (a3-0 (the int f0-2)) (f0-3 (- f0-2 (the float a3-0))) @@ -769,7 +763,3 @@ - f'(arg3) = f'(arg4) = 0" (+ arg0 (* (- arg1 arg0) (smooth-step (/ (- arg2 arg3) (- arg4 arg3))))) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/math/quaternion_REF.gc b/test/decompiler/reference/jak3/engine/math/quaternion_REF.gc index 28489aeb664..501eb8f645b 100644 --- a/test/decompiler/reference/jak3/engine/math/quaternion_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/quaternion_REF.gc @@ -20,7 +20,7 @@ (defun quaternion-axis-angle! ((arg0 quaternion) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) "Construct a quaternion from an axis and angle. The axis should be normalized." (let ((s5-0 (new 'stack-no-clear 'vector))) - (sincos! s5-0 (* 0.5 arg4)) + (sincos! s5-0 (/ arg4 2)) (let ((f0-2 (-> s5-0 x))) (set! (-> arg0 x) (* arg1 f0-2)) (set! (-> arg0 y) (* arg2 f0-2)) @@ -35,7 +35,7 @@ (defun quaternion-vector-angle! ((arg0 quaternion) (arg1 vector) (arg2 float)) "Construct a quaternion from an axis and angle. The axis should be normalized." (let ((s5-0 (new 'stack-no-clear 'vector))) - (sincos! s5-0 (* 0.5 arg2)) + (sincos! s5-0 (/ arg2 2)) (let ((f0-2 (-> s5-0 x))) (set! (-> arg0 x) (* (-> arg1 x) f0-2)) (set! (-> arg0 y) (* (-> arg1 y) f0-2)) @@ -481,7 +481,7 @@ (cond ((< 0.0 f0-2) (let ((f0-4 (sqrtf (+ 1.0 f0-2)))) - (set! (-> arg0 w) (* 0.5 f0-4)) + (set! (-> arg0 w) (/ f0-4 2)) (let ((f0-5 (/ 0.5 f0-4))) (set! (-> arg0 x) (* f0-5 (- (-> arg1 uvec z) (-> arg1 fvec y)))) (set! (-> arg0 y) (* f0-5 (- (-> arg1 fvec x) (-> arg1 rvec z)))) @@ -516,7 +516,7 @@ ) ) ) - (set! (-> arg0 data a2-0) (* 0.5 f0-12)) + (set! (-> arg0 data a2-0) (/ f0-12 2)) (if (!= f0-12 0.0) (set! f0-12 (/ 0.5 f0-12)) ) @@ -1086,7 +1086,3 @@ (vector-y-angle s5-0) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/math/transformq_REF.gc b/test/decompiler/reference/jak3/engine/math/transformq_REF.gc index 7f475029efc..7f4000d741f 100644 --- a/test/decompiler/reference/jak3/engine/math/transformq_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/transformq_REF.gc @@ -55,7 +55,7 @@ f30-0 ) (else - (* 0.000000001 f30-0) + (/ f30-0 1000000000) ) ) ) @@ -491,7 +491,3 @@ arg0 ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/nav/nav-mesh_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-mesh_REF.gc index a604dc8242f..405f878aa6f 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-mesh_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-mesh_REF.gc @@ -868,7 +868,7 @@ ) (set! (-> s5-0 word02) (the int - (+ 1.0 (* (fmax 1.0 (* 0.000015258789 (-> s5-0 float00))) (fmax 1.0 (* 0.000015258789 (-> s5-0 float01))))) + (+ 1.0 (* (fmax 1.0 (/ (-> s5-0 float00) (meters 16))) (fmax 1.0 (/ (-> s5-0 float01) (meters 16))))) ) ) (set! (-> s5-0 word03) (min 4096 (* (-> s5-0 word01) (-> s5-0 word02)))) diff --git a/test/decompiler/reference/jak3/engine/physics/cloth_REF.gc b/test/decompiler/reference/jak3/engine/physics/cloth_REF.gc index 483b87b0216..4c45b258507 100644 --- a/test/decompiler/reference/jak3/engine/physics/cloth_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/cloth_REF.gc @@ -750,7 +750,7 @@ ) (set! (-> s4-0 one-over-two-times-constraint-length) (/ 1.0 (* 2.0 f0-1))) (set! (-> s4-0 constraint-length-sqd) (* f0-1 f0-1)) - (set! (-> s4-0 constraint-length-half) (* 0.5 f0-1)) + (set! (-> s4-0 constraint-length-half) (/ f0-1 2)) ) ) ) @@ -1021,7 +1021,7 @@ (let* ((f1-4 (/ (+ f1-2 (vector-dot a3-4 a3-4)) (* 2.0 f0-1))) (f0-3 (/ (- f1-4 f0-1) f1-4)) ) - (vector-float*! a3-4 a3-4 (* 0.5 f0-3)) + (vector-float*! a3-4 a3-4 (/ f0-3 2)) ) ) (let ((f1-6 1.0) @@ -2113,7 +2113,7 @@ (-> this collision-constraints data s5-0 r) *color-cyan* ) - (format *stdcon* "Transform ~d, size ~f~%" s5-0 (* 0.00024414062 (-> this collision-constraints data s5-0 r))) + (format *stdcon* "Transform ~d, size ~f~%" s5-0 (/ (-> this collision-constraints data s5-0 r) METER_LENGTH)) ) (dotimes (s5-1 (-> this disc-collision-constraints length)) (add-debug-sphere @@ -2278,7 +2278,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/physics/dynamics-h_REF.gc b/test/decompiler/reference/jak3/engine/physics/dynamics-h_REF.gc index 5c3d0f15f56..a0e782ae960 100644 --- a/test/decompiler/reference/jak3/engine/physics/dynamics-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/dynamics-h_REF.gc @@ -45,7 +45,7 @@ ;; definition for function time-to-apex (defun time-to-apex ((arg0 float) (arg1 float)) - (the int (/ arg0 (- (* 0.0033333334 arg1)))) + (the int (/ arg0 (- (/ arg1 300)))) ) ;; definition for function time-to-ground @@ -54,8 +54,8 @@ (v0-0 0) ) (while (< (- arg2) f0-0) - (set! arg0 (- arg0 (* 0.0033333334 arg1))) - (+! f0-0 (* 0.0033333334 arg0)) + (set! arg0 (- arg0 (/ arg1 300))) + (+! f0-0 (/ arg0 300)) (+! v0-0 1) ) v0-0 @@ -76,7 +76,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/physics/ragdoll-edit_REF.gc b/test/decompiler/reference/jak3/engine/physics/ragdoll-edit_REF.gc index 14478350100..a6c6d4e9632 100644 --- a/test/decompiler/reference/jak3/engine/physics/ragdoll-edit_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/ragdoll-edit_REF.gc @@ -1030,13 +1030,13 @@ (set! f26-0 (* 546.13336 f26-0)) ) ((= v1-135 2) - (let ((f0-25 (* 0.01 f30-0))) + (let ((f0-25 (/ f30-0 100))) (set! f30-0 (+ 1.0 f0-25)) ) - (let ((f0-27 (* -0.01 f28-0))) + (let ((f0-27 (/ f28-0 -100))) (set! f28-0 (+ 1.0 f0-27)) ) - (let ((f0-29 (* 0.01 f26-0))) + (let ((f0-29 (/ f26-0 100))) (set! f26-0 (+ 1.0 f0-29)) ) ) diff --git a/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc b/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc index 1bc0d6def0f..0d26053f5b6 100644 --- a/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc @@ -51,7 +51,7 @@ ) (matrix-identity! (-> this inertial-tensor)) (matrix-identity! (-> this inv-inertial-tensor)) - (let ((f0-4 (* 0.083333336 f24-0))) + (let ((f0-4 (/ f24-0 12))) (let* ((f1-1 f30-0) (f1-3 (* f1-1 f1-1)) (f2-0 f26-0) @@ -1523,7 +1523,7 @@ (f0-9 (/ 163840.0 (get-inv-mass (the-as process-focusable s4-1)))) ) (vector-reset! (-> this player-force)) - (set! (-> this player-force y) (* -0.1 f0-9 f30-2)) + (set! (-> this player-force y) (* (/ f0-9 -10) f30-2)) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc b/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc index 166185caaed..6eb27af2f73 100644 --- a/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc @@ -4,7 +4,7 @@ ;; definition for method 9 of type trajectory (defmethod compute-trans-at-time ((this trajectory) (arg0 float) (arg1 vector)) (vector+float*! arg1 (-> this initial-position) (-> this initial-velocity) arg0) - (+! (-> arg1 y) (* 0.5 arg0 arg0 (-> this gravity))) + (+! (-> arg1 y) (* (/ arg0 2) arg0 (-> this gravity))) arg1 ) @@ -32,7 +32,7 @@ (vector-! (-> this initial-velocity) arg1 arg0) (vector-xz-normalize! (-> this initial-velocity) f0-3) ) - (set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* 0.5 arg2 (-> this gravity)))) + (set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* (/ arg2 2) (-> this gravity)))) 0 (none) ) diff --git a/test/decompiler/reference/jak3/engine/ps2/timer_REF.gc b/test/decompiler/reference/jak3/engine/ps2/timer_REF.gc index 68151992113..e916aca6721 100644 --- a/test/decompiler/reference/jak3/engine/ps2/timer_REF.gc +++ b/test/decompiler/reference/jak3/engine/ps2/timer_REF.gc @@ -160,9 +160,9 @@ ) ) ) - (set! (-> this time-adjust-ratio) (* 0.2 f0-6)) + (set! (-> this time-adjust-ratio) (/ f0-6 5)) ) - (set! (-> this seconds-per-frame) (* 0.016666668 (-> this time-adjust-ratio))) + (set! (-> this seconds-per-frame) (/ (-> this time-adjust-ratio) 60)) (set! (-> this frames-per-second) (if (= (-> this time-adjust-ratio) 0.0) 0.0 (* 60.0 (/ 1.0 (-> this time-adjust-ratio))) @@ -253,7 +253,3 @@ (set! (-> this clock-ratio) (-> arg0 clock-ratio)) this ) - - - - diff --git a/test/decompiler/reference/jak3/engine/scene/scene_REF.gc b/test/decompiler/reference/jak3/engine/scene/scene_REF.gc index 0e0980d8995..87af2983b77 100644 --- a/test/decompiler/reference/jak3/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak3/engine/scene/scene_REF.gc @@ -937,7 +937,7 @@ ) (let* ((v1-28 (-> s3-0 base)) (a2-23 - (+ (- 1793 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (* 0.5 (-> arg1 width))))) + (+ (- 1793 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2)))) ) (a3-8 (+ (the int (-> arg1 origin y)) 1841)) (a0-23 (+ a2-23 (-> arg0 width))) @@ -954,7 +954,7 @@ (&+! (-> s3-0 base) 112) (let* ((v1-32 (-> s3-0 base)) (a1-38 - (+ (- 1792 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (* 0.5 (-> arg1 width))))) + (+ (- 1792 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2)))) ) (a3-11 (+ (the int (-> arg1 origin y)) 1840)) (a0-30 (+ a1-38 (-> arg0 width))) diff --git a/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc index 10bea89a44b..d082a129ee1 100644 --- a/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc @@ -660,9 +660,9 @@ ) ) ) - (set! (-> int-trans 0) (the int (* 0.0625 (-> v1-0 x)))) - (set! (-> int-trans 1) (the int (* 0.0625 (-> v1-0 y)))) - (set! (-> int-trans 2) (the int (* 0.0625 (-> v1-0 z)))) + (set! (-> int-trans 0) (the int (/ (-> v1-0 x) 16))) + (set! (-> int-trans 1) (the int (/ (-> v1-0 y) 16))) + (set! (-> int-trans 2) (the int (/ (-> v1-0 z) 16))) ) 0 ) @@ -1223,7 +1223,7 @@ ;; definition for method 14 of type ambient-sound ;; WARN: Return type mismatch int vs none. (defmethod set-falloff-far! ((this ambient-sound) (arg0 float)) - (set! (-> this falloff-far) (the int (* 0.00024414062 arg0))) + (set! (-> this falloff-far) (the int (/ arg0 METER_LENGTH))) 0 (none) ) diff --git a/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc b/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc index 0878f5d2e98..2bfe07731c2 100644 --- a/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc @@ -40,8 +40,8 @@ ) ) (set! (-> self board turn-anim-targ) (+ (lerp-scale - (* 0.5 (-> *TARGET_BOARD-bank* turn-frames)) - (* -0.5 (-> *TARGET_BOARD-bank* turn-frames)) + (/ (-> *TARGET_BOARD-bank* turn-frames) 2) + (/ (-> *TARGET_BOARD-bank* turn-frames) -2) f26-0 -5461.3335 5461.3335 @@ -54,8 +54,8 @@ 32768.0 ) (lerp-scale - (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) - (* -0.2 (-> *TARGET_BOARD-bank* turn-frames)) + (/ (-> *TARGET_BOARD-bank* turn-frames) 5) + (/ (-> *TARGET_BOARD-bank* turn-frames) -5) (-> self board turn-anim-mag) 1.0 -1.0 @@ -63,7 +63,7 @@ ) ) (when (and (or (< (* f30-0 (-> self board turn-anim-targ)) 0.0) (= f30-0 0.0)) - (and (< (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) (fabs (- f30-0 (-> self board turn-anim-targ)))) + (and (< (/ (-> *TARGET_BOARD-bank* turn-frames) 5) (fabs (- f30-0 (-> self board turn-anim-targ)))) (>= (current-time) (-> self control turn-lockout-end-time)) ) ) @@ -661,7 +661,7 @@ (vector-float*! (-> self control transv) (-> self control transv) - (+ 1.0 (* 0.5 (-> *setting-control* user-current halfpipe-jump-mult))) + (+ 1.0 (/ (-> *setting-control* user-current halfpipe-jump-mult) 2)) ) ) (else @@ -879,7 +879,7 @@ (vector-float*! (-> self control transv) (-> self control transv) - (+ 1.0 f30-0 (* 0.5 (-> *setting-control* user-current halfpipe-jump-mult))) + (+ 1.0 f30-0 (/ (-> *setting-control* user-current halfpipe-jump-mult) 2)) ) ) ) @@ -1373,7 +1373,7 @@ (vector-float*! (-> self control transv) (-> self control transv) - (+ 1.0 (* 0.5 (-> *setting-control* user-current halfpipe-jump-mult))) + (+ 1.0 (/ (-> *setting-control* user-current halfpipe-jump-mult) 2)) ) ) (target-board-spin-check) @@ -2467,7 +2467,7 @@ (compute-alignment! (-> self align)) (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) (set! (-> self control ctrl-xz-vel) - (* f30-0 (* 0.000024414063 (-> self clock frames-per-second) (-> self align delta trans z))) + (* f30-0 (* (/ (-> self clock frames-per-second) (meters 10)) (-> self align delta trans z))) ) (vector-float*! (-> self control transv) gp-0 (-> self control ctrl-xz-vel)) (let ((v1-31 (new-stack-vector0)) @@ -2692,7 +2692,7 @@ (else (let ((f30-1 (* (lerp-scale 0.7 1.0 (fabs (-> self board ride-lean)) 0.0 1.0) - (lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (* 0.5 (-> self control mod-surface transv-max))) + (lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (/ (-> self control mod-surface transv-max) 2)) ) ) (f28-1 diff --git a/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc b/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc index 90a79c47428..2c59f0b9d8b 100644 --- a/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc @@ -66,7 +66,7 @@ (set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor)) (set! (-> arg0 seek0) (lerp-scale - (* 0.1 (-> arg0 seek0)) + (/ (-> arg0 seek0) 10) (-> arg0 seek0) (the float (- (current-time) (-> self board spin-time))) 0.0 @@ -75,7 +75,7 @@ ) (set! (-> arg0 seek90) (lerp-scale - (* 0.1 (-> arg0 seek90)) + (/ (-> arg0 seek90) 10) (-> arg0 seek90) (the float (- (current-time) (-> self board spin-time))) 0.0 @@ -91,8 +91,8 @@ (when (not (time-elapsed? (-> self board spin-ground-start-time) (seconds 0.3))) (set-time! (-> self control last-attack-end-time)) (set-time! (-> self board spin-ground-time)) - (set! (-> arg0 seek0) (* 0.1 (-> arg0 seek0))) - (set! (-> arg0 seek90) (* 0.1 (-> arg0 seek90))) + (set! (-> arg0 seek0) (/ (-> arg0 seek0) 10)) + (set! (-> arg0 seek90) (/ (-> arg0 seek90) 10)) (set! (-> arg0 vel-turn) 131072.0) (set! (-> arg0 turnv) 91022.22) ) @@ -814,7 +814,7 @@ (set! f26-0 (-> s5-1 v1-18 w)) ) ) - (let ((f28-1 (* 0.0625 f28-0))) + (let ((f28-1 (/ f28-0 16))) (vector-normalize! s4-0 1.0) (set! (-> self control idx-of-fastest-xz-vel) s2-0) (set! (-> self control average-xz-vel) f28-1) @@ -1945,7 +1945,7 @@ (< 0.98 (vector-dot (-> self board probe-normal) (-> self control standard-dynamics gravity-normal))) (< f26-0 8192.0) (< f30-0 8192.0) - (or (< (* 0.2 f28-0) f30-0) (not (time-elapsed? (-> self board last-jump-time) (seconds 0.1)))) + (or (< (/ f28-0 5) f30-0) (not (time-elapsed? (-> self board last-jump-time) (seconds 0.1)))) ) (vector+float*! (-> self control transv) @@ -2350,7 +2350,7 @@ (set! (-> s2-0 start-pos quad) (-> v1-2 prim-core world-sphere quad)) (set! (-> s2-0 move-dist quad) (-> arg1 quad)) (let ((a0-3 s2-0)) - (set! (-> a0-3 radius) (* 0.5 (-> v1-2 prim-core world-sphere w))) + (set! (-> a0-3 radius) (/ (-> v1-2 prim-core world-sphere w) 2)) (set! (-> a0-3 collide-with) (-> v1-2 prim-core collide-with)) (set! (-> a0-3 ignore-process0) (-> arg0 process)) (set! (-> a0-3 ignore-process1) #f) @@ -2736,7 +2736,7 @@ (let* ((f30-0 (-> self board ride-speed)) (f0-4 (lerp-scale (-> self control current-surface fric) - (* 0.2 (-> self control current-surface fric)) + (/ (-> self control current-surface fric) 5) f30-0 0.0 (-> self control current-surface transv-max) diff --git a/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc b/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc index 6b22ca80104..206c4d9231f 100644 --- a/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc @@ -149,7 +149,7 @@ ) (when (and (or (and (< f0-27 0.95) (>= f30-0 0.0)) (and (logtest? sv-32 (cshape-reaction-flags csrf05)) (< f0-27 0.3)) - (< f1-11 (* -0.25 (-> arg1 best-my-prim local-sphere w))) + (< f1-11 (/ (-> arg1 best-my-prim local-sphere w) -4)) ) (>= (vector-dot tangent contact-normal) -0.000001) ) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc index f2887318d7d..0097298980c 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc @@ -12,7 +12,7 @@ (set! (-> v1-0 y) (- (-> arg2 rvec y) (-> a0-1 y))) (set! (-> v1-0 z) (- (-> arg2 rvec z) (-> a0-1 z))) (let ((f1-3 (vector-length v1-0))) - (set! (-> arg2 fvec w) (* 128.0 (- 1.0 (* 0.0000024414062 f1-3)))) + (set! (-> arg2 fvec w) (* 128.0 (- 1.0 (/ f1-3 (meters 100))))) ) ) 0 @@ -262,7 +262,7 @@ (let ((s3-0 (new 'stack-no-clear 'dist-dot-val))) (get-dist-and-dot (the-as gun-blue-shot arg0) s3-0) (when (< (-> s3-0 dist) 49152.0) - (let ((f0-12 (* 0.000020345053 (-> s3-0 dist))) + (let ((f0-12 (/ (-> s3-0 dist) (meters 12))) (f24-1 (* 0.5 (+ 1.0 (-> s3-0 dot)))) ) (set! f24-0 (* (lerp 65536.0 131072.0 f0-12) (- 2.0 f24-1))) @@ -620,7 +620,7 @@ (set! f30-0 (+ 28.0 f30-0)) ) (if (logtest? (process-mask vehicle civilian) (-> s4-1 mask)) - (set! f30-0 (* 0.25 f30-0)) + (set! f30-0 (/ f30-0 4)) ) (set! (-> sv-1284 sv-1288 value) f30-0) (set! sv-1296 (+ sv-1296 f30-0)) @@ -681,7 +681,7 @@ (set! f30-1 (+ 28.0 f30-1)) ) (if (logtest? (process-mask vehicle civilian) (-> gp-1 mask)) - (set! f30-1 (* 0.25 f30-1)) + (set! f30-1 (/ f30-1 4)) ) (set! (-> sv-1284 sv-1288 value) f30-1) (set! sv-1296 (+ sv-1296 f30-1)) @@ -1126,7 +1126,7 @@ (set! sv-80 (new 'stack-no-clear 'vector)) 0.0 (let* ((f28-0 (acos f0-2)) - (f0-4 (* 0.000030517578 f28-0)) + (f0-4 (/ f28-0 (meters 8))) ) 0.0 0.0 diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc index c6f863f995a..777b9d75a39 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc @@ -257,13 +257,7 @@ ) (set! (-> self root trans quad) (-> arg0 pos quad)) (quaternion-identity! (-> self root quat)) - (set-vector! - (-> self root scale) - (* 0.00024414062 (-> arg0 size-x)) - (* 0.00024414062 (-> arg0 size-y)) - 1.0 - 1.0 - ) + (set-vector! (-> self root scale) (/ (-> arg0 size-x) METER_LENGTH) (/ (-> arg0 size-y) METER_LENGTH) 1.0 1.0) (go-virtual active) ) @@ -275,13 +269,7 @@ (('set-pos-and-size) (let ((v1-2 (the-as gun-dark-3-sphere-init-params (-> block param 0)))) (set! (-> self root trans quad) (-> v1-2 pos quad)) - (set-vector! - (-> self root scale) - (* 0.00024414062 (-> v1-2 size-x)) - (* 0.00024414062 (-> v1-2 size-y)) - 1.0 - 1.0 - ) + (set-vector! (-> self root scale) (/ (-> v1-2 size-x) METER_LENGTH) (/ (-> v1-2 size-y) METER_LENGTH) 1.0 1.0) (vector-float*! (-> self root scale) (-> self root scale) 1.7) (set! (-> self alpha-val) (-> v1-2 alpha-val)) ) @@ -1862,7 +1850,7 @@ (set! f30-0 (lerp-scale 4096.0 1228.8 f0-9 30.0 300.0)) ) ) - (let ((f30-1 (* 0.5 f30-0))) + (let ((f30-1 (/ f30-0 2))) (vector-normalize! (-> self spin-vector) f30-1) (vector-normalize! (-> self core-velocity) 7372.8) (set! (-> s5-0 fvec quad) (-> s4-0 quad)) @@ -2726,7 +2714,7 @@ ) (s3-1 s2-2 (the-as quaternion s1-0) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-40)))) *up-vector*) ) - (let ((f0-18 (* 0.000061035156 (-> self obj-radius)))) + (let ((f0-18 (/ (-> self obj-radius) (meters 4)))) 0.0 (let* ((f30-1 (lerp 1.0 0.2 f0-18)) (s3-2 s5-4) @@ -3014,7 +3002,7 @@ (let* ((f0-1 (vector-normalize-ret-len! s5-1 1.0)) (f0-2 (* 182.04445 f0-1)) (f0-3 (* 360.0 f0-2)) - (f0-4 (* 0.2 f0-3)) + (f0-4 (/ f0-3 5)) (f30-0 (fmin 116508.445 f0-4)) (s4-0 (handle->process (-> this parent-hand))) ) @@ -3117,7 +3105,7 @@ (until (< (-> self end-time) (current-time)) (suspend) ) - (let* ((f0-1 (+ 0.5 (* 0.0625 (-> self cached-damage)))) + (let* ((f0-1 (+ 0.5 (/ (-> self cached-damage) 16))) (f0-2 (fmin 0.9 f0-1)) ) (send-event (handle->process (-> self parent-hand)) 'gun-dark-2-off f0-2) @@ -3234,7 +3222,7 @@ (let ((f0-0 (vector-length (the-as vector (-> block param 1))))) 0.0 (when (< 40960.0 f0-0) - (let ((f30-0 (* 0.000024414063 f0-0))) + (let ((f30-0 (/ f0-0 (meters 10)))) (format 0 "Receving impact damage ~f~%" f30-0) (+! (-> self cached-damage) f30-0) ) @@ -3387,7 +3375,7 @@ ) 0.0 (set! (-> self cached-damage) (* 2.0 (-> self cached-damage))) - (let* ((f0-6 (* 0.00012207031 f0-5)) + (let* ((f0-6 (/ f0-5 (meters 2))) (f0-7 (fmax 1.0 f0-6)) ) (+! (-> self cached-damage) f0-7) @@ -3573,8 +3561,8 @@ (vector4-lerp! s5-0 (-> v1-0 0 dir0 color) (-> v1-0 0 dir1 color) (-> v1-0 0 dir1 extra x)) (fmax (fmax (-> s4-0 x) (-> s4-0 y)) (-> s4-0 z)) (fmax (fmax (-> s5-0 x) (-> s5-0 y)) (-> s5-0 z)) - (let* ((f0-10 (+ (* 0.2 (-> s4-0 x)) (* 0.75 (-> s4-0 y)) (* 0.05 (-> s4-0 z)))) - (f1-12 (+ (* 0.2 (-> s5-0 x)) (* 0.75 (-> s5-0 y)) (* 0.05 (-> s5-0 z)))) + (let* ((f0-10 (+ (/ (-> s4-0 x) 5) (* 0.75 (-> s4-0 y)) (/ (-> s4-0 z) 20))) + (f1-12 (+ (/ (-> s5-0 x) 5) (* 0.75 (-> s5-0 y)) (/ (-> s5-0 z) 20))) (f0-12 (* 0.5 (+ f0-10 f1-12))) (f30-0 (lerp-scale-clamp 0.0 1.0 f0-12 0.0 1.0)) (s5-1 (new 'stack 'rgbaf)) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-part_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-part_REF.gc index 248a70bd778..7c7e7f7c55d 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-part_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-part_REF.gc @@ -4154,7 +4154,7 @@ gun (let* ((f0-4 (vector-normalize-ret-len! s5-0 1.0)) (f0-6 (- (* 300.0 f0-4) (* f30-0 (seconds-per-frame)))) (f0-7 (fmax 0.0 f0-6)) - (f0-8 (* 0.0033333334 f0-7)) + (f0-8 (/ f0-7 300)) ) (vector-normalize! s5-0 f0-8) ) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc index 7056c5fc74f..4ca43950596 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc @@ -1572,9 +1572,9 @@ ) ) (let ((v1-8 (new 'stack-no-clear 'vector))) - (set! (-> v1-8 x) (* 0.00024414062 (-> this current-warp-radius))) + (set! (-> v1-8 x) (/ (-> this current-warp-radius) METER_LENGTH)) (set! (-> v1-8 y) 1.0) - (set! (-> v1-8 z) (* 0.00024414062 (-> this current-warp-radius))) + (set! (-> v1-8 z) (/ (-> this current-warp-radius) METER_LENGTH)) (set! (-> v1-8 w) 1.0) (send-event (handle->process (-> this explosion-1)) 'scale v1-8) ) @@ -1718,7 +1718,7 @@ (set-time! (-> self state-time)) (set! (-> self max-radius) (lerp (-> self min-charge-radius) (-> self max-charge-radius) (-> self strength))) (/ (-> self max-radius) (-> self max-charge-radius)) - (let ((f0-15 (* 0.000012207031 (-> self max-radius)))) + (let ((f0-15 (/ (-> self max-radius) (meters 20)))) 0.0 (let ((f1-5 (/ (* 2.0 (- (* 163840.0 f0-15) (-> self max-radius))) (* f0-15 f0-15)))) (set! (-> *part-id-table* 353 init-specs 9 initial-valuef) (* 1.2 f1-5)) @@ -1816,7 +1816,7 @@ (lerp 20480.0 24576.0 (/ (-> self max-radius) (-> self max-charge-radius))) ) (set! (-> *part-id-table* 226 init-specs 3 initial-valuef) - (* 0.5 (-> *part-id-table* 226 init-specs 3 initial-valuef)) + (/ (-> *part-id-table* 226 init-specs 3 initial-valuef) 2) ) (set! (-> *part-id-table* 226 init-specs 3 random-rangef) (lerp 0.0 20480.0 (/ (-> self max-radius) (-> self max-charge-radius))) @@ -2302,7 +2302,7 @@ (let ((gp-6 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (math-camera-pos)))) 0.0 (let* ((f0-2 (vector-length gp-6)) - (f30-0 (* 0.0000016276042 f0-2)) + (f30-0 (/ f0-2 (meters 150))) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc index 9d7bcf465ea..c3b4c4347db 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc @@ -365,7 +365,7 @@ (set! f0-11 (+ 28.0 f0-11)) ) (if (logtest? (process-mask vehicle civilian) (-> s3-1 mask)) - (set! f0-11 (* 0.25 f0-11)) + (set! f0-11 (/ f0-11 4)) ) (set! (-> sv-1076 sv-1080 value) f0-11) (set! sv-1088 (+ sv-1088 f0-11)) @@ -416,7 +416,7 @@ (set! f0-16 (+ 28.0 f0-16)) ) (if (logtest? (process-mask vehicle civilian) (-> s5-1 mask)) - (set! f0-16 (* 0.25 f0-16)) + (set! f0-16 (/ f0-16 4)) ) (set! (-> sv-1076 sv-1080 value) f0-16) (set! sv-1088 (+ sv-1088 f0-16)) @@ -1318,7 +1318,7 @@ (spawn-particles this s3-0) ) (let ((s3-1 (new 'stack-no-clear 'matrix)) - (f30-1 (fmin 1.0 (* 0.000015258789 f30-0))) + (f30-1 (fmin 1.0 (/ f30-0 (meters 16)))) (f28-0 (-> *part-id-table* 267 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-1 gp-1 *up-vector*) @@ -2134,7 +2134,7 @@ (set! (-> this damage) 2.0) (when (logtest? (game-feature feature22) (-> *game-info* features)) (set! (-> this damage) (* 2.0 (-> this damage))) - (set! (-> this vehicle-impulse-factor) (* 0.5 (-> this vehicle-impulse-factor))) + (set! (-> this vehicle-impulse-factor) (/ (-> this vehicle-impulse-factor) 2)) ) (logior! (-> this options) (projectile-options po13)) (set! (-> this muzzle-flash-part) (-> *part-id-table* 275)) @@ -2296,7 +2296,7 @@ (launch-particles (-> *part-id-table* 270) s3-0) ) (let ((s3-1 (new 'stack-no-clear 'matrix)) - (f30-1 (fmin 1.0 (* 0.000015258789 f30-0))) + (f30-1 (fmin 1.0 (/ f30-0 (meters 16)))) (f28-0 (-> *part-id-table* 267 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-1 s4-1 *up-vector*) diff --git a/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc index 6e47f04aee6..46b6b530bd3 100644 --- a/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc @@ -803,7 +803,7 @@ (set! f2-0 (-> a1-3 a2-6 w)) ) ) - (let ((f1-1 (* 0.0625 f1-0))) + (let ((f1-1 (/ f1-0 16))) (set! (-> self control idx-of-fastest-xz-vel) a0-3) (set! (-> self control average-xz-vel) f1-1) (if (logtest? (-> self control current-surface flags) (surface-flag no-turn-around)) diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech-part_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech-part_REF.gc index 17fd17fcbe8..679c080b80d 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/mech-part_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/mech-part_REF.gc @@ -157,7 +157,7 @@ (quaternion-rotate-local-x! s1-0 s1-0 32768.0) (let ((a0-3 s0-0)) (let ((v1-10 arg1)) - (let ((a1-4 (* 0.5 arg4))) + (let ((a1-4 (/ arg4 2))) (.mov vf7 a1-4) ) (.lvf vf5 (&-> arg2 quad)) @@ -429,7 +429,3 @@ (:conerot-y (degrees 0) (degrees 3600)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc index 3a8dc2171a6..fed1d6673d4 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc @@ -1312,7 +1312,7 @@ (dotimes (s4-0 1) ((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere) ) - (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> s5-0 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) (set! (-> s5-0 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 11468.8 f30-0 0.0 1.0)) (let ((v1-17 gp-0)) diff --git a/test/decompiler/reference/jak3/engine/target/surface-h_REF.gc b/test/decompiler/reference/jak3/engine/target/surface-h_REF.gc index 2a317351932..5516ae024e1 100644 --- a/test/decompiler/reference/jak3/engine/target/surface-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/surface-h_REF.gc @@ -193,19 +193,19 @@ on impact, during touch, on exit, etc." ;; definition for function calc-terminal-vel (defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float)) - (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1) + (- (* (/ (- (/ arg0 60) arg1) arg2) (- 1.0 arg2)) arg1) ) ;; definition for function calc-terminal2-vel (defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))) + (let ((f0-4 (sqrtf (/ (- (/ arg0 60) arg1) arg2)))) (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))) ) ) ;; definition for function calc-terminal4-vel (defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float)) - (let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))) + (let ((f0-5 (sqrtf (sqrtf (/ (- (/ arg0 60) arg1) arg2))))) (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-anim_REF.gc b/test/decompiler/reference/jak3/engine/target/target-anim_REF.gc index 17b23247ba1..5c7cb7a4dda 100644 --- a/test/decompiler/reference/jak3/engine/target/target-anim_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-anim_REF.gc @@ -827,7 +827,7 @@ ) ((lambda :behavior target () - (let ((f30-0 (fmax 0.8 (fmin 1.0 (* 0.000048828126 (-> self control ctrl-xz-vel)))))) + (let ((f30-0 (fmax 0.8 (fmin 1.0 (/ (-> self control ctrl-xz-vel) (meters 5)))))) (cond ((and (rand-vu-percent? 0.3) (and (< 20480.0 (-> self control ctrl-xz-vel)) (zero? (-> self ext-anim)))) (ja-no-eval :group! jakb-attack-from-stance-alt-end-ja :num! (seek! (ja-aframe 29.0 0) f30-0) :frame-num 0.0) @@ -1199,10 +1199,10 @@ ) ) (let ((f0-37 (fabs (- f20-0 f30-0)))) - (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-37))))) + (set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (/ f0-37 4))))) ) (let ((f0-42 (fabs (- f22-1 f28-0)))) - (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (* 0.25 f0-42))))) + (set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (/ f0-42 4))))) ) ) (set! (-> self control unknown-float-n12iuh3n1) f30-0) @@ -1785,7 +1785,7 @@ (let ((f0-11 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not (or (and (< (fabs (/ f0-11 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) + (while (not (or (and (< (fabs (/ f0-11 (/ f1-1 300))) 150.0) (< f1-1 0.0)) (time-elapsed? (-> self state-time) (seconds 1.7)) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc index fd7e1da9b96..8a5b01339ec 100644 --- a/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc @@ -239,12 +239,12 @@ (let ((v1-16 (-> (the-as collide-shape-prim-group (-> arg0 root root-prim)) child 0)) (a0-10 (-> (the-as collide-shape-prim-group (-> arg0 root root-prim)) child 1)) ) - (set! (-> v1-16 local-sphere w) (* 0.1 (-> arg0 root root-prim local-sphere w))) + (set! (-> v1-16 local-sphere w) (/ (-> arg0 root root-prim local-sphere w) 10)) (set! (-> a0-10 local-sphere w) (-> arg0 root root-prim local-sphere w)) ) (let ((s5-0 (new 'stack-no-clear 'collide-query)) (v1-20 (new 'stack-no-clear 'vector)) - (f30-0 (* 0.5 (-> arg0 root root-prim local-sphere w))) + (f30-0 (/ (-> arg0 root root-prim local-sphere w) 2)) ) (set! (-> v1-20 quad) (-> arg0 root trans quad)) (vector+float*! (-> s5-0 start-pos) v1-20 *up-vector* 0.0) @@ -1296,7 +1296,7 @@ (set-setting! 'rapid-tracking #f 0.0 0) ((lambda :behavior target () - (set! (-> self control bend-target) (* 0.5 (-> self control bend-target))) + (set! (-> self control bend-target) (/ (-> self control bend-target) 2)) (if (logtest? (water-flag touch-water) (-> self water flags)) (sound-play "swim-stroke") ) diff --git a/test/decompiler/reference/jak3/engine/target/target-death_REF.gc b/test/decompiler/reference/jak3/engine/target/target-death_REF.gc index acf55b00383..391d5e16a95 100644 --- a/test/decompiler/reference/jak3/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-death_REF.gc @@ -1440,7 +1440,7 @@ (set! (-> sv-32 vector y) (-> sv-32 shove-up)) ) (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) - (set! (-> sv-32 damage) (fmax 1.0 (ceil (* 0.5 (-> sv-32 damage))))) + (set! (-> sv-32 damage) (fmax 1.0 (ceil (/ (-> sv-32 damage) 2)))) 0 ) (set! (-> sv-36 quad) (-> sv-32 vector quad)) diff --git a/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc b/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc index a9633f5e68d..bbf0e6345a3 100644 --- a/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc @@ -2104,7 +2104,7 @@ (dotimes (s4-1 1) ((method-of-type sphere new) (the-as symbol (-> s5-2 s4-1)) sphere) ) - (let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))))) + (let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)))) (set! (-> s5-2 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) (set! (-> s5-2 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-1 0.0 1.0)) (let ((v1-214 gp-3)) @@ -2193,7 +2193,7 @@ (let* ((f0-28 (deg-diff (y-angle (-> self control)) (vector-y-angle (-> self control to-target-pt-xz)))) (f0-30 (fmax -5461.3335 (fmin 5461.3335 f0-28))) ) - (seek! (-> self upper-body twist z) f0-30 (fabs (* 0.2 f0-30))) + (seek! (-> self upper-body twist z) f0-30 (fabs (/ f0-30 5))) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc b/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc index ce2e91ba8da..58b8b7c39fd 100644 --- a/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc @@ -204,8 +204,8 @@ (vector+! s4-0 s4-0 s3-0) ) (set! (-> *part-id-table* 659 init-specs 2 initial-valuef) (-> *invis-joint-list* s5-0 size)) - (set! (-> *part-id-table* 659 init-specs 3 initial-valuef) (* 0.5 (-> *invis-joint-list* s5-0 size))) - (set! (-> *part-id-table* 659 init-specs 4 initial-valuef) (* 0.5 (-> *invis-joint-list* s5-0 size))) + (set! (-> *part-id-table* 659 init-specs 3 initial-valuef) (/ (-> *invis-joint-list* s5-0 size) 2)) + (set! (-> *part-id-table* 659 init-specs 4 initial-valuef) (/ (-> *invis-joint-list* s5-0 size) 2)) (launch-particles (-> *part-id-table* 659) s4-0) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-launch_REF.gc b/test/decompiler/reference/jak3/engine/target/target-launch_REF.gc index ec0ced4b2d0..286a5c7a069 100644 --- a/test/decompiler/reference/jak3/engine/target/target-launch_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-launch_REF.gc @@ -49,7 +49,7 @@ (f0-5 (- 1.0 f0-4)) ) (let ((f1-5 (* 1.4 f0-5 (/ f30-0 (* 0.0033333334 (the float (-> self control sliding-start-time))))))) - (* 0.0033333334 f1-5 (the float (- (current-time) (-> self clock old-frame-counter)))) + (* (/ f1-5 300) (the float (- (current-time) (-> self clock old-frame-counter)))) ) (let ((f0-6 (- 1.0 f0-5))) (vector+float*! @@ -58,7 +58,7 @@ (-> self control unknown-vector37) f0-6 ) - (+! (-> self control trans y) (* 0.5 f0-6 f0-6 (the-as float (-> self control unknown-word04)))) + (+! (-> self control trans y) (* (/ f0-6 2) f0-6 (the-as float (-> self control unknown-word04)))) (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self control transv quad) (-> self control unknown-vector37 quad)) (+! (-> self control transv y) (* f0-6 (the-as float (-> self control unknown-word04)))) diff --git a/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc b/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc index 2af58bda196..ab2450448b2 100644 --- a/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc @@ -1425,12 +1425,7 @@ (set! (-> self fact shield-attack-id) a0-46) ) (if (not (logtest? (-> self lightjak stage) (lightjak-stage ls1))) - (send-event - self - 'get-pickup - (pickup-type eco-pill-light) - (* -0.33333334 (-> *FACT-bank* lightjak-shield-inc)) - ) + (send-event self 'get-pickup (pickup-type eco-pill-light) (/ (-> *FACT-bank* lightjak-shield-inc) -3)) ) (set-time! (-> self lightjak shield-count-time)) ) @@ -2371,7 +2366,7 @@ (gp-0 (new 'stack-no-clear 'vector)) (f30-0 4096.0) ) - (let ((f0-4 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) + (let ((f0-4 (* 0.00013563369 (tan (/ (-> *math-camera* fov) 2)) f30-0))) (set-vector! (-> this root scale) f0-4 f0-4 f0-4 1.0) ) (set! (-> gp-0 quad) (-> (camera-pos) quad)) @@ -2889,7 +2884,7 @@ ) (else (let* ((f1-5 (/ f0-1 (* (-> self control dynam gravity-length) (seconds-per-frame)))) - (f0-6 (* 0.5 f1-5 (seconds-per-frame) f0-1)) + (f0-6 (* (/ f1-5 2) (seconds-per-frame) f0-1)) (v1-25 (new-stack-vector0)) ) (let ((f1-9 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) diff --git a/test/decompiler/reference/jak3/engine/target/target-swim_REF.gc b/test/decompiler/reference/jak3/engine/target/target-swim_REF.gc index e819716cbbb..9e41bf90fe6 100644 --- a/test/decompiler/reference/jak3/engine/target/target-swim_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-swim_REF.gc @@ -193,10 +193,10 @@ (f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x))))) ) (let ((f1-4 (fabs (- f0-10 f28-0)))) - (set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (* 0.25 f1-4))))) + (set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (/ f1-4 4))))) ) (let ((f0-14 (fabs (- f24-0 f26-0)))) - (set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14))))) + (set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (/ f0-14 4))))) ) ) (ja :chan 3 :group! jakb-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist)) diff --git a/test/decompiler/reference/jak3/engine/target/target-tube_REF.gc b/test/decompiler/reference/jak3/engine/target/target-tube_REF.gc index 416bbaf17b5..5de354bc1aa 100644 --- a/test/decompiler/reference/jak3/engine/target/target-tube_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-tube_REF.gc @@ -901,7 +901,7 @@ (f2-0 f1-2) ) (if (< f0-2 0.0) - (set! f0-2 (* 0.5 f0-2)) + (set! f0-2 (/ f0-2 2)) ) (vector+! (-> arg1 vector) diff --git a/test/decompiler/reference/jak3/engine/target/target-turret-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/target-turret-shot_REF.gc index 95f3dec60f8..99d968e0e2f 100644 --- a/test/decompiler/reference/jak3/engine/target/target-turret-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-turret-shot_REF.gc @@ -298,7 +298,7 @@ (launch-particles (-> *part-id-table* 852) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 1021 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 1021 init-specs 4 initial-valuef)) ) @@ -450,7 +450,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/target/target-util_REF.gc b/test/decompiler/reference/jak3/engine/target/target-util_REF.gc index 3ca742af098..379c58cc4e5 100644 --- a/test/decompiler/reference/jak3/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-util_REF.gc @@ -1393,7 +1393,7 @@ ) ) ) - (* 0.125 f30-0) + (/ f30-0 8) ) ) @@ -2115,10 +2115,10 @@ (f30-0 (fmax -1.0 (fmin 1.0 arg2))) ) (let ((f1-5 (fabs (- f0-1 (-> arg0 blend 1))))) - (seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + (seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (/ arg3 5))) ) (let ((f0-9 (fabs (- f30-0 (-> arg0 blend 2))))) - (seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (* 0.2 arg3))) + (seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (/ arg3 5))) ) ) (cond @@ -2310,8 +2310,8 @@ (cond ((and (< 0.0 f0-5) (focus-test? this in-air)) (let* ((v0-1 (new 'static 'vector)) - (f0-6 (+ (* 0.0016666667 (-> v1-0 dynam gravity-length)) f0-5)) - (f0-9 (/ (* 0.5 f0-6 f0-6) (-> v1-0 dynam gravity-length))) + (f0-6 (+ (/ (-> v1-0 dynam gravity-length) 600) f0-5)) + (f0-9 (/ (* (/ f0-6 2) f0-6) (-> v1-0 dynam gravity-length))) ) (vector+float*! v0-1 (-> v1-0 trans) (-> v1-0 dynam gravity-normal) f0-9) ) diff --git a/test/decompiler/reference/jak3/engine/target/target2_REF.gc b/test/decompiler/reference/jak3/engine/target/target2_REF.gc index 9ec48cc7283..127463c4db8 100644 --- a/test/decompiler/reference/jak3/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target2_REF.gc @@ -837,7 +837,7 @@ (let ((f0-1 (target-height-above-ground)) (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (while (not (and (< (fabs (/ f0-1 (* 0.0033333334 f1-1))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) + (while (not (and (< (fabs (/ f0-1 (/ f1-1 300))) 40.0) (and (< f1-1 0.0) (ja-min? 0)))) (suspend) (ja :num! (loop!)) (set! f0-1 (target-height-above-ground)) diff --git a/test/decompiler/reference/jak3/engine/target/target_REF.gc b/test/decompiler/reference/jak3/engine/target/target_REF.gc index 290574cc728..78447ce9a78 100644 --- a/test/decompiler/reference/jak3/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target_REF.gc @@ -663,11 +663,11 @@ (delete-back-vel) (let* ((f0-0 arg5) (f1-0 0.0) - (f2-2 (+ (* 0.0016666667 (-> self control dynam gravity-length)) + (f2-2 (+ (/ (-> self control dynam gravity-length) 600) (fmax 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) ) - (f0-1 (* f0-0 (fmax f1-0 (/ (* 0.5 f2-2 f2-2) (-> self control dynam gravity-length))))) + (f0-1 (* f0-0 (fmax f1-0 (/ (* (/ f2-2 2) f2-2) (-> self control dynam gravity-length))))) (s5-1 (+ arg0 f0-1)) ) (let ((s2-1 (+ arg1 f0-1))) @@ -3032,7 +3032,7 @@ ) (else (let* ((f1-5 (/ f0-4 (* (-> self control dynam gravity-length) (seconds-per-frame)))) - (f0-9 (* 0.5 f1-5 (seconds-per-frame) f0-4)) + (f0-9 (* (/ f1-5 2) (seconds-per-frame) f0-4)) ) (let ((v1-36 (ja-group))) (if (and v1-36 diff --git a/test/decompiler/reference/jak3/engine/ui/bigmap_REF.gc b/test/decompiler/reference/jak3/engine/ui/bigmap_REF.gc index d96ed88b233..adf868f6998 100644 --- a/test/decompiler/reference/jak3/engine/ui/bigmap_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/bigmap_REF.gc @@ -326,8 +326,8 @@ (let ((f0-12 (* 20.0 f26-0 f30-0)) (f1-8 (* 20.0 f28-0 f30-0)) ) - (set! (-> s2-0 x) (the float (the int (- (-> s0-0 x) (* 0.5 f0-12))))) - (set! (-> s2-0 y) (the float (the int (- (-> s0-0 y) (* 0.5 f1-8))))) + (set! (-> s2-0 x) (the float (the int (- (-> s0-0 x) (/ f0-12 2))))) + (set! (-> s2-0 y) (the float (the int (- (-> s0-0 y) (/ f1-8 2))))) (set! (-> s3-2 x) (+ (-> s2-0 x) f0-12)) (set! (-> s3-2 y) (+ (-> s2-0 y) f1-8)) ) @@ -681,7 +681,7 @@ (let* ((f0-63 (s5-1 *temp-string* s3-1 #t 44 (bucket-id hud-draw-hud-alpha))) (v1-142 s3-1) (a0-106 (- 256 (the int (* 200.0 f30-2)))) - (a1-52 (- 208 (the int (* 0.5 f0-63)))) + (a1-52 (- 208 (the int (/ f0-63 2)))) ) (set! (-> v1-142 origin x) (the float a0-106)) (set! (-> v1-142 origin y) (the float a1-52)) @@ -957,7 +957,3 @@ ;; failed to figure out what this is: (kmemclose) - - - - diff --git a/test/decompiler/reference/jak3/engine/ui/hud-classes_REF.gc b/test/decompiler/reference/jak3/engine/ui/hud-classes_REF.gc index a5889ea55ce..3005108919a 100644 --- a/test/decompiler/reference/jak3/engine/ui/hud-classes_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/hud-classes_REF.gc @@ -183,7 +183,7 @@ ) ) (set! (-> this sprites 2 color x) (the int (* 0.35 f1-17 f0-27))) - (set! (-> this sprites 2 color y) (the int (* 0.1 f1-17 f0-27))) + (set! (-> this sprites 2 color y) (the int (* (/ f1-17 10) f0-27))) (set! (-> this sprites 2 color z) (the int (* 0.8 f1-17 f0-27))) ) ) diff --git a/test/decompiler/reference/jak3/engine/ui/hud_REF.gc b/test/decompiler/reference/jak3/engine/ui/hud_REF.gc index bcc5349ac52..c479cabebec 100644 --- a/test/decompiler/reference/jak3/engine/ui/hud_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/hud_REF.gc @@ -1158,7 +1158,7 @@ :code (behavior () (until #f (if (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask pause))) - (seek! (-> self offset) 0.0 (* 0.1 (-> self clock time-adjust-ratio))) + (seek! (-> self offset) 0.0 (/ (-> self clock time-adjust-ratio) 10)) ) (if (>= 0.0 (-> self offset)) (go hud-in) @@ -1433,7 +1433,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/ui/minimap_REF.gc b/test/decompiler/reference/jak3/engine/ui/minimap_REF.gc index 355b034ce0c..b21e27dd5bf 100644 --- a/test/decompiler/reference/jak3/engine/ui/minimap_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/minimap_REF.gc @@ -2332,7 +2332,7 @@ (set! (-> this target-inv-scale) 0.5) ) ) - (seek! (-> this offset y) (-> this target-inv-scale) (* 0.5 f30-2)) + (seek! (-> this offset y) (-> this target-inv-scale) (/ f30-2 2)) ) (set! (-> this icon-inv-scale) (/ (* 32768.0 (-> this offset y)) (-> this meters-per-texel))) (set! (-> this map-inv-scale) @@ -3019,17 +3019,17 @@ ) ) (set! (-> arg0 mat trans y) 0.0) - (set! (-> arg0 corner 0 x) (* 0.25 (-> this map-inv-scale))) - (set! (-> arg0 corner 0 z) (* 0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 0 x) (/ (-> this map-inv-scale) 4)) + (set! (-> arg0 corner 0 z) (/ (-> this map-inv-scale) 4)) (set! (-> arg0 corner 0 w) 1.0) - (set! (-> arg0 corner 1 x) (* -0.25 (-> this map-inv-scale))) - (set! (-> arg0 corner 1 z) (* 0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 1 x) (/ (-> this map-inv-scale) -4)) + (set! (-> arg0 corner 1 z) (/ (-> this map-inv-scale) 4)) (set! (-> arg0 corner 1 w) 1.0) - (set! (-> arg0 corner 2 x) (* 0.25 (-> this map-inv-scale))) - (set! (-> arg0 corner 2 z) (* -0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 2 x) (/ (-> this map-inv-scale) 4)) + (set! (-> arg0 corner 2 z) (/ (-> this map-inv-scale) -4)) (set! (-> arg0 corner 2 w) 1.0) - (set! (-> arg0 corner 3 x) (* -0.25 (-> this map-inv-scale))) - (set! (-> arg0 corner 3 z) (* -0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 3 x) (/ (-> this map-inv-scale) -4)) + (set! (-> arg0 corner 3 z) (/ (-> this map-inv-scale) -4)) (set! (-> arg0 corner 3 w) 1.0) (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) (-> arg0 mat)) (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) (-> arg0 mat)) @@ -3556,8 +3556,8 @@ (let ((f1-16 (* 20.0 (-> *video-params* relative-x-scale) f0-52)) (f0-53 (* 20.0 f0-52)) ) - (set! (-> arg0 corner 0 x) (the float (the int (- (-> s3-2 x) (* 0.5 f1-16))))) - (set! (-> arg0 corner 0 z) (the float (the int (- (-> s3-2 z) (* 0.5 f0-53))))) + (set! (-> arg0 corner 0 x) (the float (the int (- (-> s3-2 x) (/ f1-16 2))))) + (set! (-> arg0 corner 0 z) (the float (the int (- (-> s3-2 z) (/ f0-53 2))))) (set! (-> arg0 corner 1 x) (+ (-> arg0 corner 0 x) f1-16)) (set! (-> arg0 corner 1 z) (+ (-> arg0 corner 0 z) f0-53)) ) diff --git a/test/decompiler/reference/jak3/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak3/engine/ui/progress/progress-draw_REF.gc index c1db9abbe02..988f6d4e7fe 100644 --- a/test/decompiler/reference/jak3/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/progress/progress-draw_REF.gc @@ -602,9 +602,9 @@ (t1-1 s1-0) (f28-0 (sv-48 s0-1 sv-64 sv-80 sv-96 t0-1 t1-1 t2-1 t3-1)) ) - (set! f30-0 (* 0.5 f28-0)) + (set! f30-0 (/ f28-0 2)) (let ((v1-17 arg0)) - (set! (-> v1-17 scale) (* 0.5 (-> arg0 scale))) + (set! (-> v1-17 scale) (/ (-> arg0 scale) 2)) ) (let* ((a0-7 this) (t9-3 (method-of-object a0-7 progress-method-40)) @@ -789,7 +789,7 @@ 0 ) ) - (the int (* 0.5 f30-0)) + (the int (/ f30-0 2)) ) ) ) @@ -1327,7 +1327,7 @@ 0 0 0 - (let* ((gp-0 (the int (* 0.016666668 arg0))) + (let* ((gp-0 (the int (/ arg0 60))) (v1-5 (- arg0 (* 60.0 (the float gp-0)))) (s5-0 (the int v1-5)) (v1-6 (- v1-5 (the float s5-0))) @@ -1351,13 +1351,7 @@ ) (cond ((logtest? (-> v1-3 flags) (highscore-flags hf2)) - (print-game-text - (highscore-time->string this (* 0.0033333334 arg1)) - arg0 - #f - 44 - (bucket-id hud-draw-hud-alpha) - ) + (print-game-text (highscore-time->string this (/ arg1 300)) arg0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ((logtest? (-> v1-3 flags) (highscore-flags hf3)) (let ((s4-1 print-game-text)) @@ -1916,8 +1910,8 @@ (f28-0 (- (-> s0-1 z) (-> s0-1 x))) (s1-2 (init-text! this)) ) - (let* ((f30-0 (* 0.5 f28-0)) - (f28-1 (* 0.5 f28-0)) + (let* ((f30-0 (/ f28-0 2)) + (f28-1 (/ f28-0 2)) (f26-0 (+ sv-16 (-> s0-1 x))) (f24-0 (+ sv-16 (-> s0-1 x) f30-0)) ) @@ -2336,7 +2330,7 @@ (f2-4 (+ (-> s4-0 x) (* 0.5 (- (-> s4-0 z) (-> s4-0 x))))) (f30-1 (+ f2-4 f1-6)) (f28-0 (- f2-4 f1-6)) - (f26-0 (+ -8.0 (* 0.5 f0-7) (-> arg1 origin y))) + (f26-0 (+ -8.0 (/ f0-7 2) (-> arg1 origin y))) ) (let ((f1-10 (+ -15.0 (-> arg1 origin y))) (f24-0 (+ 3.0 f0-7 (-> arg1 origin y))) @@ -2626,7 +2620,7 @@ (let ((a0-23 arg1)) (set! (-> a0-23 color) (font-color font-color-32)) ) - (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float (the int (* 0.5 f30-2))))) + (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float (the int (/ f30-2 2))))) (let ((s5-1 print-game-text)) (format (clear *temp-string*) "~33L~C" 163) (s5-1 *temp-string* arg1 #f 44 (bucket-id hud-draw-hud-alpha)) @@ -5237,7 +5231,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc index c66b1d12bb0..31b30899fa5 100644 --- a/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc @@ -1136,14 +1136,14 @@ (seek-ease (-> self menu-transition) 0.0 - (* 0.1 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 10) 0.4 - (* 0.01 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 100) ) ) ) (else - (seek! (-> self menu-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))) + (seek! (-> self menu-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10)) (when (and (= (-> self menu-transition) 1.0) (or (and (nonzero? (-> self state-pos)) (= (-> self anim-frame) 1.0)) (or (and (zero? (-> self state-pos)) (= (-> self anim-frame) 0.0)) @@ -1186,12 +1186,12 @@ (if (= (-> self ring-angle) (-> self ring-want-angle)) (respond-to-cpad self) ) - (let ((f30-0 (* 0.005 (-> self clock time-adjust-ratio)))) + (let ((f30-0 (/ (-> self clock time-adjust-ratio) 200))) (cond ((= (-> self menu-transition) 1.0) (if (and (zero? (-> self state-pos)) (= (-> self starting-state) 'main)) - (seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) - (seek! (-> self anim-frame) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 50)) + (seek! (-> self anim-frame) 1.0 (/ (-> self clock time-adjust-ratio) 50)) ) (let ((f0-27 (if (and (zero? (-> self state-pos)) (!= (-> self starting-state) 'title)) 0.0 @@ -1201,14 +1201,14 @@ ) (when (= (-> self next) 'bigmap) (set! f0-27 0.4) - (set! f30-0 (* 0.008 (-> self clock time-adjust-ratio))) + (set! f30-0 (/ (-> self clock time-adjust-ratio) 125)) ) (seek! (-> self pos-transition) f0-27 f30-0) ) ) ((zero? (-> self state-pos)) (if (= (-> self current) 'bigmap) - (set! f30-0 (* 0.05 (-> self clock time-adjust-ratio))) + (set! f30-0 (/ (-> self clock time-adjust-ratio) 20)) ) (if (!= (-> self starting-state) 'title) (seek! (-> self pos-transition) 0.0 f30-0) @@ -1259,9 +1259,9 @@ (set! (-> self swing) (seek-ease (-> self swing) 4.0 - (* 0.05 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 20) 0.5 - (* 0.005 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 200) ) ) (set! (-> self swing) (seek-ease @@ -1553,9 +1553,9 @@ (set! (-> self scanlines-alpha) (seek-ease (-> self scanlines-alpha) (- 1.0 (-> self menu-transition)) - (* 0.05 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 20) 0.3 - (* 0.001 (-> self clock time-adjust-ratio)) + (/ (-> self clock time-adjust-ratio) 1000) ) ) ) @@ -1877,16 +1877,16 @@ ) ) :trans (behavior () - (seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 0.0 (/ (-> self clock time-adjust-ratio) 50)) (cond ((= (-> self anim-frame) 0.0) - (seek! (-> self pos-transition) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self pos-transition) 1.0 (/ (-> self clock time-adjust-ratio) 50)) (if (= (-> self pos-transition) 1.0) (go-virtual gone) ) ) (else - (seek! (-> self pos-transition) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self pos-transition) 0.0 (/ (-> self clock time-adjust-ratio) 50)) ) ) (set-ring-position self) @@ -1936,11 +1936,11 @@ (let ((s5-0 (&+ (the-as (pointer float) *setting-control*) (-> this setting-offset))) (s3-0 #f) ) - (let ((f30-0 (* 0.02 (-> pp clock time-adjust-ratio))) + (let ((f30-0 (/ (-> pp clock time-adjust-ratio) 50)) (f28-0 0.0) ) (when (type? this menu-picture-slider-option) - (set! f30-0 (* 0.005 (-> pp clock time-adjust-ratio))) + (set! f30-0 (/ (-> pp clock time-adjust-ratio) 200)) (set! f28-0 0.25) ) (cond @@ -4239,7 +4239,3 @@ ) 0 ) - - - - diff --git a/test/decompiler/reference/jak3/engine/ui/text_REF.gc b/test/decompiler/reference/jak3/engine/ui/text_REF.gc index 64b1d16c07c..f7fc7364f4f 100644 --- a/test/decompiler/reference/jak3/engine/ui/text_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/text_REF.gc @@ -471,7 +471,7 @@ ) (set! sv-64 0) (if (logtest? (-> arg1 flags) (font-flags middle)) - (+! (-> arg1 origin x) (* 0.5 (-> arg1 width))) + (+! (-> arg1 origin x) (/ (-> arg1 width) 2)) ) (set! sv-72 (-> sv-32 0)) (set! sv-80 0) @@ -616,7 +616,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/util/smush-control-h_REF.gc b/test/decompiler/reference/jak3/engine/util/smush-control-h_REF.gc index 594388c77e9..9d0f4a3eeae 100644 --- a/test/decompiler/reference/jak3/engine/util/smush-control-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/util/smush-control-h_REF.gc @@ -128,7 +128,7 @@ (clock clock) ) "Start the smush with the given parameters." - (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) + (when (>= (fabs (/ (-> this amp) 5)) (fabs (get-no-update this))) (set! (-> this amp) amplitude) (set! (-> this period) (the float period)) (set! (-> this duration) (the float duration)) @@ -139,7 +139,3 @@ ) this ) - - - - diff --git a/test/decompiler/reference/jak3/engine/util/sync-info_REF.gc b/test/decompiler/reference/jak3/engine/util/sync-info_REF.gc index 22ce8b1d866..860494ae18a 100644 --- a/test/decompiler/reference/jak3/engine/util/sync-info_REF.gc +++ b/test/decompiler/reference/jak3/engine/util/sync-info_REF.gc @@ -424,7 +424,7 @@ (defmethod set-params! ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this max-val) (* 0.5 arg2)) + (set! (-> this max-val) (/ arg2 2)) (set! (-> this start-time) 0) (set! (-> this timer) 0) (set! (-> this value) 0.0) @@ -532,8 +532,8 @@ (defmethod set-params! ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) - (set! (-> this xz-max) (* 0.5 arg2)) - (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this xz-max) (/ arg2 2)) + (set! (-> this y-max) (/ arg3 2)) (set! (-> this start-time) 0) (set! (-> this timer) 0) (vector-reset! (-> this value)) @@ -614,7 +614,3 @@ (-> this value) ) ) - - - - diff --git a/test/decompiler/reference/jak3/kernel/gstring_REF.gc b/test/decompiler/reference/jak3/kernel/gstring_REF.gc index f1d5d32e015..dccb3bd919e 100644 --- a/test/decompiler/reference/jak3/kernel/gstring_REF.gc +++ b/test/decompiler/reference/jak3/kernel/gstring_REF.gc @@ -701,7 +701,7 @@ (cond (a0-2 (dotimes (a0-3 (the int f1-5)) - (set! f2-6 (* 0.1 f2-6)) + (set! f2-6 (/ f2-6 10)) (nop!) (nop!) ) diff --git a/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs2_REF.gc b/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs2_REF.gc index 892403beb0e..11086a74c67 100644 --- a/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs2_REF.gc @@ -206,7 +206,7 @@ (f0-6 (+ -1.0 (the-as float v1-35))) ) (cond - ((< f0-6 (* 0.5 f30-0)) + ((< f0-6 (/ f30-0 2)) (set! s5-1 (logior s5-1 2)) ) ((< f0-6 f30-0) @@ -833,7 +833,7 @@ (let ((f30-0 0.3)) (set! (-> (new 'stack-no-clear 'vector) quad) (-> this bob-vec quad)) (set! (-> this xz-dir x) (-> this bobbers 0 current-speed)) - (set! (-> this xz-dir z) (* 0.25 (-> this bobbers 2 current-speed))) + (set! (-> this xz-dir z) (/ (-> this bobbers 2 current-speed) 4)) (let ((f26-0 (lerp-scale 0.0 10922.667 (-> this xz-dir z) f30-0 1.0)) (f24-0 (lerp-scale 0.0 -10922.667 (-> this xz-dir z) (- f30-0) -1.0)) (f28-0 (lerp-scale 0.0 -10922.667 (-> this xz-dir x) f30-0 1.0)) @@ -2641,9 +2641,9 @@ (let ((s4-4 (new 'stack-no-clear 'quaternion))) (vector-normalize! s3-3 1.0) (+! (-> s3-3 y) 1.0) - (set! (-> s3-3 y) (* 0.5 (-> s3-3 y))) + (set! (-> s3-3 y) (/ (-> s3-3 y) 2)) (+! (-> s3-3 x) 1.0) - (set! (-> s3-3 x) (* 0.5 (-> s3-3 x))) + (set! (-> s3-3 x) (/ (-> s3-3 x) 2)) (quaternion-rotate-x! s4-4 (quaternion-identity! (new 'stack-no-clear 'quaternion)) @@ -2778,6 +2778,7 @@ ) ;; definition for method 52 of type bt-grunt +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this bt-grunt)) (local-vars (f0-0 float)) (let ((gp-0 (the-as ragdoll-proc (handle->process (-> this ragdoll-proc))))) @@ -2910,10 +2911,10 @@ (-> arg0 thrust s3-0) (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) (fmax 0.0 (-> v0-6 y)) - (fabs (* 0.2 (-> v0-6 z))) + (fabs (/ (-> v0-6 z) 5)) (fmax 0.0 (-> s1-1 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs_REF.gc index c918a8560b9..737e8e9d762 100644 --- a/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs_REF.gc @@ -1518,7 +1518,7 @@ (f0-2 (evaluate *curve-linear-up-down* f0-1 (loop-behavior use-default))) (f0-3 (sin (lerp -16384.0 16384.0 f0-2))) (f0-4 (+ 1.0 f0-3)) - (f0-5 (* 0.5 f0-4)) + (f0-5 (/ f0-4 2)) (f0-6 (* 0.8 f0-5)) (f0-7 (+ 0.3 f0-6)) ) @@ -2018,11 +2018,11 @@ (set! (-> v1-4 quad) (-> sv-52 quad)) (set! sv-80 v1-4) ) - (let* ((f30-0 (- (* 0.5 arg2))) + (let* ((f30-0 (- (/ arg2 2))) (v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-7 (the-as number (logior #x3f800000 v1-6))) ) - (set! sv-84 (+ f30-0 (* (+ -1.0 (the-as float v1-7)) (+ (* 0.5 arg2) (* 0.5 arg2))))) + (set! sv-84 (+ f30-0 (* (+ -1.0 (the-as float v1-7)) (+ (/ arg2 2) (/ arg2 2))))) ) (vector+float*! sv-80 sv-80 (vector-cross! (new 'stack-no-clear 'vector) sv-48 *up-vector*) (* sv-84 arg3)) (bt-barrel-ground-probe sv-80) @@ -2046,10 +2046,10 @@ ) (set! sv-128 sv-48) (let* ((f30-1 arg3) - (f28-0 (- (* 0.25 arg2))) + (f28-0 (- (/ arg2 4))) (v1-30 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-31 (the-as number (logior #x3f800000 v1-30))) - (f0-18 (* f30-1 (+ f28-0 (* (+ -1.0 (the-as float v1-31)) (+ (* 0.25 arg2) (* 0.25 arg2)))))) + (f0-18 (* f30-1 (+ f28-0 (* (+ -1.0 (the-as float v1-31)) (+ (/ arg2 4) (/ arg2 4)))))) ) (vector+float*! s1-1 s0-1 sv-128 f0-18) ) diff --git a/test/decompiler/reference/jak3/levels/city/blow-tower/cty-blow-tower_REF.gc b/test/decompiler/reference/jak3/levels/city/blow-tower/cty-blow-tower_REF.gc index 2a9fb21eed1..20f8b425894 100644 --- a/test/decompiler/reference/jak3/levels/city/blow-tower/cty-blow-tower_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/blow-tower/cty-blow-tower_REF.gc @@ -1422,7 +1422,7 @@ (set! arg0 (-> arg1 control)) ) (let ((f28-0 (* 409.6 arg0)) - (f30-0 (lerp 0.05 1.0 (* 0.2 arg0))) + (f30-0 (lerp 0.05 1.0 (/ arg0 5))) ) (activate! *camera-smush-control* f28-0 45 (the int (* 300.0 f30-0)) 1.0 0.9 (-> *display* camera-clock)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (the-as time-frame (the int (* 150.0 f30-0)))) @@ -1486,7 +1486,7 @@ ) (let* ((f30-0 5461.3335) (s5-0 (the int (/ 65536.0 f30-0))) - (f28-0 (* 0.5 f30-0)) + (f28-0 (/ f30-0 2)) ) (dotimes (s4-0 s5-0) (vector-rotate-around-y! @@ -1622,7 +1622,7 @@ (matrix->quaternion arg2 a1-16) ) ) - (quaternion-rotate-local-x! arg2 arg2 (* 0.5 (-> this roll-amount))) + (quaternion-rotate-local-x! arg2 arg2 (/ (-> this roll-amount) 2)) ) ) (vector-! s1-0 s2-0 (-> this root trans)) @@ -2126,7 +2126,7 @@ (set! (-> this hud-target angle) 0.0) (set! (-> this hud-target flags) (hud-sprite-flags hsf3)) (set! (-> this hud-target-inner flags) (hud-sprite-flags hsf3)) - (let* ((f0-46 (* 0.03125 (-> this onscreen-targets s5-1 size))) + (let* ((f0-46 (/ (-> this onscreen-targets s5-1 size) 32)) (f0-48 (fmax 0.4 (fmin 2.0 f0-46))) (f0-49 (* 2.0 f0-48)) ) @@ -2555,7 +2555,7 @@ ) (let* ((f0-24 (vector-dot s4-12 s2-2)) (f0-25 (+ 1.0 f0-24)) - (f0-26 (* 0.5 f0-25)) + (f0-26 (/ f0-25 2)) (f0-27 (* f0-26 f0-26)) (f0-28 (lerp 0.0 2.0 f0-27)) (f30-0 (fmax 0.3 (fmin 2.0 f0-28))) @@ -2640,7 +2640,7 @@ (vector-y-angle (vector-z-quaternion! (new 'stack-no-clear 'vector) arg0)) ) ) - (f0-2 (* 0.000061035156 f0-1)) + (f0-2 (/ f0-1 (meters 4))) (f0-3 (+ 0.5 f0-2)) (f0-4 (floor f0-3)) ) @@ -3542,7 +3542,7 @@ ) (let ((f0-38 (-> this path-height-vel))) 0.0 - (let ((f0-41 (fmax -1.0 (fmin 1.0 (* 0.000024414063 f0-38))))) + (let ((f0-41 (fmax -1.0 (fmin 1.0 (/ f0-38 (meters 10)))))) (quaternion-rotate-local-x! s4-2 s4-2 (* -4551.1113 f0-41)) ) ) @@ -3876,7 +3876,7 @@ ) (let ((f0-17 (-> this path-height-vel))) 0.0 - (let ((f0-20 (fmax -1.0 (fmin 1.0 (* 0.000024414063 f0-17))))) + (let ((f0-20 (fmax -1.0 (fmin 1.0 (/ f0-17 (meters 10)))))) (quaternion-rotate-local-x! s4-1 s4-1 (* -4551.1113 f0-20)) ) ) @@ -5049,7 +5049,7 @@ (f0-18 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-17))) f30-0)) ) (set! (-> *part-id-table* 4825 init-specs 4 initial-valuef) f0-18) - (set! (-> *part-id-table* 4825 init-specs 3 initial-valuef) (* 0.5 f0-18)) + (set! (-> *part-id-table* 4825 init-specs 3 initial-valuef) (/ f0-18 2)) ) (draw-beam (-> *part-id-table* 4825) diff --git a/test/decompiler/reference/jak3/levels/city/bombbot/bombbot_REF.gc b/test/decompiler/reference/jak3/levels/city/bombbot/bombbot_REF.gc index b4135227d84..08cd6ac8255 100644 --- a/test/decompiler/reference/jak3/levels/city/bombbot/bombbot_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/bombbot/bombbot_REF.gc @@ -648,7 +648,7 @@ (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) (damage 20.0) (vehicle-damage-factor 1.0) - (vehicle-impulse-factor (* 0.000012207031 f30-0)) + (vehicle-impulse-factor (/ f30-0 (meters 20))) (attacker-velocity s4-2) ) ) @@ -1774,7 +1774,7 @@ (set! (-> t0-0 z) 0.0) (set! (-> t0-0 w) 1.0) (let ((v0-6 (t9-6 a0-32 a1-17 a2-23 a3-1 t0-0 (/ f28-0 f30-0)))) - (set! (-> s1-0 delta-y) (* 0.05 (-> v0-6 y) (vector-length (-> s1-0 speed)))) + (set! (-> s1-0 delta-y) (* (/ (-> v0-6 y) 20) (vector-length (-> s1-0 speed)))) ) ) ) @@ -3518,7 +3518,7 @@ ) (set! (-> v1-3 main-y) (- (-> s4-0 feet s0-0 real-position y) (-> s4-0 root trans y))) (set! (-> v1-3 main-y) (-> v1-3 delta-y)) - (+! f30-0 (* 0.25 (-> v1-3 main-y))) + (+! f30-0 (/ (-> v1-3 main-y) 4)) (set! (-> s1-0 quad) (-> v1-3 pos-offset quad)) (set! (-> s1-0 y) (* -2.0 (-> v1-3 main-y))) (new 'stack-no-clear 'vector) diff --git a/test/decompiler/reference/jak3/levels/city/common/guard-grenade_REF.gc b/test/decompiler/reference/jak3/levels/city/common/guard-grenade_REF.gc index a7fbbaea9fd..e02a6047a72 100644 --- a/test/decompiler/reference/jak3/levels/city/common/guard-grenade_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/guard-grenade_REF.gc @@ -362,7 +362,7 @@ (set! (-> self reloading-ammo) (the-as handle #f)) ) :trans (behavior () - (when (>= (* 0.5 (-> self grenade-guard-min-player-dist)) (-> self target-self-xz-dist)) + (when (>= (/ (-> self grenade-guard-min-player-dist) 2) (-> self target-self-xz-dist)) (cond ((not (time-elapsed? (-> self state-time) (seconds 1.5))) (+! (-> self num-times-reloading-interrupted) 1) @@ -559,7 +559,3 @@ (crimson-guard-method-254 self) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/common/guard-states_REF.gc b/test/decompiler/reference/jak3/levels/city/common/guard-states_REF.gc index 4a970c4418b..42e43bbe5dc 100644 --- a/test/decompiler/reference/jak3/levels/city/common/guard-states_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/guard-states_REF.gc @@ -557,7 +557,7 @@ (.svf (&-> a1-2 quad) vf6) ) (let ((f30-2 (* 0.5 (vector-vector-xz-distance s3-0 s1-0)))) - (vector-normalize! s2-0 (* 0.5 f30-2)) + (vector-normalize! s2-0 (/ f30-2 2)) (vector-normalize! s0-0 (* 2.0 f30-2)) ) (set! sv-144 0) @@ -1196,7 +1196,3 @@ ) 0 ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/common/nav-graph_REF.gc b/test/decompiler/reference/jak3/levels/city/common/nav-graph_REF.gc index c488066935f..152100753ed 100644 --- a/test/decompiler/reference/jak3/levels/city/common/nav-graph_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/nav-graph_REF.gc @@ -12,7 +12,7 @@ ;; definition for method 17 of type nav-branch ;; WARN: Return type mismatch int vs none. (defmethod set-speed-limit ((this nav-branch) (arg0 float)) - (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 1024))))))) 0 (none) ) @@ -20,7 +20,7 @@ ;; definition for method 18 of type nav-branch ;; WARN: Return type mismatch int vs none. (defmethod set-width ((this nav-branch) (arg0 float)) - (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) + (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 256))))))) 0 (none) ) @@ -322,7 +322,7 @@ ;; definition for method 16 of type nav-node ;; WARN: Return type mismatch int vs none. (defmethod set-radius ((this nav-node) (arg0 float)) - (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) + (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 1024))))))) 0 (none) ) @@ -1462,7 +1462,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/common/trail_REF.gc b/test/decompiler/reference/jak3/levels/city/common/trail_REF.gc index b2391987616..8741a910f1f 100644 --- a/test/decompiler/reference/jak3/levels/city/common/trail_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/trail_REF.gc @@ -558,7 +558,7 @@ ) 0 (let* ((f0-0 (-> v1-0 cell-width)) - (f1-1 (* 0.5 f0-0)) + (f1-1 (/ (the float f0-0) 2)) ) (let ((f3-0 (- (-> arg0 x) f1-1)) (f2-2 (- (-> arg0 z) f1-1)) @@ -1194,7 +1194,3 @@ (if (not (trail-graph-method-23 *trail-graph*)) (set! *trail-graph* #f) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc index 35c0fa44666..3bd2be38cbf 100644 --- a/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc @@ -526,11 +526,11 @@ ) (vector+! (-> s1-0 trans) arg0 arg1) (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) - (+! (-> s1-0 trans y) (* 0.5 arg2)) + (+! (-> s1-0 trans y) (/ arg2 2)) (vector-! (-> s2-1 rvec) arg1 arg0) (let ((f30-1 (vector-normalize-ret-len! (-> s2-1 rvec) 1.0))) - (set! (-> s1-0 scale x) (* 0.00024414062 f30-1)) - (set! (-> s1-0 scale y) (* 0.00024414062 arg2)) + (set! (-> s1-0 scale x) (/ f30-1 METER_LENGTH)) + (set! (-> s1-0 scale y) (/ arg2 METER_LENGTH)) (set! (-> s1-0 scale z) 1.0) (set! (-> s2-1 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) (vector-cross! (-> s2-1 fvec) (-> s2-1 rvec) (-> s2-1 uvec)) @@ -540,7 +540,7 @@ (set! (-> this plane w) (- (vector-dot (-> s2-1 fvec) (-> this root trans)))) (let ((v0-6 (-> this root root-prim local-sphere))) (set! (-> v0-6 x) 0.0) - (set! (-> v0-6 y) (* 0.00024414062 (* 0.5 arg2))) + (set! (-> v0-6 y) (* 0.00024414062 (/ arg2 2))) (set! (-> v0-6 z) 0.0) (let ((f0-20 0.5) (f1-7 (* f30-1 f30-1)) diff --git a/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc index 020b6ffc8de..a1d754e9525 100644 --- a/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc @@ -1314,7 +1314,7 @@ ) 0.0 (let* ((f0-3 (sin (* 65536.0 f0-1))) - (f0-4 (* 0.125 f0-3)) + (f0-4 (/ f0-3 8)) ) (set! (-> self draw color-emissive x) (+ 0.375 f0-4)) ) diff --git a/test/decompiler/reference/jak3/levels/city/hijack/guide-arrow_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/guide-arrow_REF.gc index bb604a27e1e..ec373c050fd 100644 --- a/test/decompiler/reference/jak3/levels/city/hijack/guide-arrow_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/hijack/guide-arrow_REF.gc @@ -101,7 +101,7 @@ (logior! (-> this draw status) (draw-control-status force-fade)) (let ((f0-8 (vector-vector-distance (-> this root trans) (math-camera-pos)))) 0.0 - (let* ((f1-2 (* 0.0000027126737 f0-8)) + (let* ((f1-2 (/ f0-8 (meters 90))) (f1-4 (fmax 0.0 (fmin 1.0 f1-2))) (f0-11 (- 1.0 (* (- 1.0 f1-4) (- 1.0 f1-4)))) ) @@ -153,7 +153,3 @@ (defun spawn-guide-arrow ((arg0 guide-arrow-init-params) (arg1 process)) (process-spawn guide-arrow arg0 :name "guide-arrow" :to arg1) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc index 9e1e28445b3..d7139c00933 100644 --- a/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc @@ -2862,11 +2862,8 @@ (cond ((-> arg0 inout?) (let* ((f0-2 (* 0.0033333334 (the float (- (current-time) (-> this mine-clock))))) - (f1-3 (* 0.0033333334 (-> arg0 period))) - (f0-5 (+ (/ (- f0-2 (* (the float (the int (/ f0-2 f1-3))) f1-3)) (* 0.0033333334 (-> arg0 period))) - (-> arg0 offset) - ) - ) + (f1-3 (/ (-> arg0 period) 300)) + (f0-5 (+ (/ (- f0-2 (* (the float (the int (/ f0-2 f1-3))) f1-3)) (/ (-> arg0 period) 300)) (-> arg0 offset))) (f0-6 (- f0-5 (* (the float (the int (/ f0-5 1.0))) 1.0))) ) (if (< 0.5 f0-6) @@ -2882,7 +2879,7 @@ ) ) (if (-> arg0 spin?) - (+! f30-0 (* 0.0033333334 (-> arg0 spinrate) (the float (- (current-time) (-> this mine-clock))))) + (+! f30-0 (* (/ (-> arg0 spinrate) 300) (the float (- (current-time) (-> this mine-clock))))) ) (vector-rotate-around-y! s4-0 s4-0 f30-0) ) diff --git a/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc b/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc index 40c60bd8578..71785fa01e8 100644 --- a/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc @@ -751,14 +751,14 @@ (when #t (cond ((< 0.0 (-> this down-force)) - (let* ((f1-3 (* 0.0000024414062 (-> this down-force))) + (let* ((f1-3 (/ (-> this down-force) (meters 100))) (f0-7 (fmax 0.0 (fmin 1.0 f1-3))) ) (set! (-> this target-pitch) (lerp 0.0 -7281.778 f0-7)) ) ) (else - (let* ((f1-6 (* -0.0000024414062 (-> this down-force))) + (let* ((f1-6 (/ (-> this down-force) (meters -100))) (f0-11 (fmax 0.0 (fmin 1.0 f1-6))) ) (set! (-> this target-pitch) (lerp 0.0 7281.778 f0-11)) @@ -781,8 +781,8 @@ (vector+float*! v1-16 a0-7 a1-5 a2-3) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) - (let* ((s2-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 s4-0 (* 0.5 f30-0))) - (s1-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 s4-0 (* -0.5 f30-0))) + (let* ((s2-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 s4-0 (/ f30-0 2))) + (s1-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 s4-0 (/ f30-0 -2))) (f28-0 (probe-ground this s2-1 a2-3)) (f0-24 (probe-ground this s1-1 a2-3)) ) @@ -956,7 +956,7 @@ (when (not (-> this on-water?)) (set! f26-0 10.0) (when (< (-> this down-force) -204800.0) - (let* ((f1-11 (* -0.0000012207031 (-> this down-force))) + (let* ((f1-11 (/ (-> this down-force) (meters -200))) (f24-0 (fmax 0.0 (fmin 1.0 f1-11))) ) (cpad-set-buzz! @@ -999,14 +999,14 @@ ) ) (when (-> this on-water?) - (let ((f0-42 (* -0.0000012207031 (-> this down-force)))) + (let ((f0-42 (/ (-> this down-force) (meters -200)))) (if (< 0.1 f0-42) (set! (-> this spawn-splash?) #t) ) ) ) (when (and (-> this on-water?) (>= (current-time) (-> this next-bob-cam-time))) - (let ((f0-44 (* -0.0000012207031 (-> this down-force)))) + (let ((f0-44 (/ (-> this down-force) (meters -200)))) (cond ((< 0.2 f0-44) (let ((f24-1 (fmax 0.0 (fmin 1.0 f0-44))) @@ -1098,7 +1098,7 @@ (vector-z-quaternion! s4-0 (the-as quaternion (-> this rbody rot))) (vector-float*! (-> this rbody lin-momentum) s4-0 (* (-> this speed) (-> this info info mass))) ) - (+! (-> this rbody lin-momentum y) (* 0.5 (-> this down-force) (-> this info info mass))) + (+! (-> this rbody lin-momentum y) (* (/ (-> this down-force) 2) (-> this info info mass))) (if (< (-> this rbody position y) -6144.0) (set! (-> this rbody lin-momentum y) (fmax 0.0 (-> this rbody lin-momentum y))) ) @@ -1935,16 +1935,16 @@ (seek! (-> this ground-vol-current) f30-0 (* 5.4 (seconds-per-frame))) ) ) - (let* ((f0-27 (* 0.00000012207032 (-> this rbody lin-momentum y))) + (let* ((f0-27 (/ (-> this rbody lin-momentum y) (meters 2000))) (f0-29 (fmax -1.0 (fmin 1.0 f0-27))) - (f0-30 (* 0.5 f0-29)) + (f0-30 (/ f0-29 2)) ) (if (< f0-30 (-> this pitch-current)) (seek! (-> this pitch-current) f0-30 (* 0.25 (seconds-per-frame))) (seek! (-> this pitch-current) f0-30 (* 4.0 (seconds-per-frame))) ) ) - (let* ((f1-25 (* 0.00000012207032 (-> this rbody lin-momentum y))) + (let* ((f1-25 (/ (-> this rbody lin-momentum y) (meters 2000))) (f30-2 (fmax 0.0 (fmin 1.0 f1-25))) ) (sound-play-by-name diff --git a/test/decompiler/reference/jak3/levels/city/protect/assault-task_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/assault-task_REF.gc index f239a2289f8..2d469b40d03 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/assault-task_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/assault-task_REF.gc @@ -250,7 +250,7 @@ (let* ((f30-0 (- 1.0 (* (- 1.0 f0-1) (- 1.0 f0-1)))) (f0-2 (sin (lerp -16384.0 16384.0 f0-1))) (f0-3 (+ 1.0 f0-2)) - (f0-4 (* 0.5 f0-3)) + (f0-4 (/ f0-3 2)) ) (set! (-> *display* force-sync) (the-as uint 2)) (when s5-0 diff --git a/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc index addd88e0825..ebbec5e2170 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc @@ -478,7 +478,7 @@ ) (vector+float*! (-> this root transv) (-> this root transv) s5-1 (* f28-0 (seconds-per-frame))) (let* ((f0-19 (fmax 61440.0 (* (vector-length s5-1) f28-0))) - (f28-1 (* 0.000008138021 f0-19)) + (f28-1 (/ f0-19 (meters 30))) (f26-0 0.8) (f24-0 0.40000004) (v1-53 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -492,7 +492,7 @@ ) (else (let* ((f0-30 (fmax 61440.0 (* 3.0 (vector-length (-> this root transv))))) - (f28-2 (* 0.000008138021 f0-30)) + (f28-2 (/ f0-30 (meters 30))) (f26-1 0.8) (f24-1 0.40000004) (v1-68 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -599,7 +599,7 @@ ) (let ((f0-8 (* (lerp 3072.0 8601.6 f0-6) (-> this thruster-intensity-scalar)))) (set! (-> *part-id-table* 4709 init-specs 4 initial-valuef) f0-8) - (set! (-> *part-id-table* 4709 init-specs 3 initial-valuef) (* 0.5 f0-8)) + (set! (-> *part-id-table* 4709 init-specs 3 initial-valuef) (/ f0-8 2)) ) ) (draw-beam (-> *part-id-table* 4709) gp-0 s5-0 #f) @@ -620,7 +620,7 @@ ) (flying-turret-method-227 this) (let* ((f0-0 (vector-length (-> this root transv))) - (f0-1 (* 0.000016276043 f0-0)) + (f0-1 (/ f0-0 (meters 15))) ) 0.0 0.0 diff --git a/test/decompiler/reference/jak3/levels/city/protect/protect-gunship_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/protect-gunship_REF.gc index 060ccd5ac8e..408df58b3aa 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/protect-gunship_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/protect-gunship_REF.gc @@ -2161,7 +2161,7 @@ (set-time! (-> self state-time)) (let ((gp-2 (vector-! (new 'stack-no-clear 'vector) (-> self dest-pos) (-> self root trans)))) 0.0 - (set! (-> self travel-speed) (/ (vector-normalize-ret-len! gp-2 1.0) (* 0.0033333334 (-> self attack-time)))) + (set! (-> self travel-speed) (/ (vector-normalize-ret-len! gp-2 1.0) (/ (-> self attack-time) 300))) (let ((a1-3 (matrix-f-compose (new 'stack-no-clear 'matrix) gp-2))) (matrix->quaternion (-> self root quat) a1-3) ) @@ -2540,9 +2540,9 @@ (let* ((v1-121 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-122 (the-as number (logior #x3f800000 v1-121))) (f0-35 (- (* (+ -1.0 (the-as float v1-122)) (-> this missile-info probe-angle-shift)))) - (f24-1 (* 0.25 f0-35)) + (f24-1 (/ f0-35 4)) (f0-38 (floor (the float (/ s5-5 3)))) - (f2-0 (* 0.000016276043 f30-3)) + (f2-0 (/ f30-3 (meters 15))) (f1-15 (fmax 0.0 (fmin 1.0 f2-0))) (f1-16 (* f1-15 f1-15)) (f0-39 (* f0-38 (- 1.0 f1-16))) @@ -2750,7 +2750,7 @@ (vector-float*! s5-0 s5-0 0.5) (set! (-> s5-0 y) 0.0) (let* ((f0-11 (vector-normalize-ret-len! s5-0 1.0)) - (f1-6 (* 0.000009765625 f0-11)) + (f1-6 (/ f0-11 (meters 25))) (f0-13 (fmax 0.0 (fmin 1.0 f1-6))) (f0-14 (* f0-13 f0-13)) ) @@ -2867,7 +2867,7 @@ (f0-51 (+ f28-1 (* f26-0 (+ -1.0 (the-as float v1-118))) f30-2)) ) (set! (-> *part-id-table* 4785 init-specs 4 initial-valuef) f0-51) - (set! (-> *part-id-table* 4785 init-specs 3 initial-valuef) (* 0.5 f0-51)) + (set! (-> *part-id-table* 4785 init-specs 3 initial-valuef) (/ f0-51 2)) ) (draw-beam (-> *part-id-table* 4785) @@ -3029,7 +3029,7 @@ (vector-float*! s5-1 s5-1 -1.0) (let ((f30-1 (- (vector-y-angle s4-1) (vector-y-angle s5-1)))) (format 0 "Doing inverse rotate~%") - (set! (-> this rotate-rate) (* 0.25 f30-1)) + (set! (-> this rotate-rate) (/ f30-1 4)) ) ) ) @@ -3786,7 +3786,7 @@ 0.0 0.0 (let* ((f0-6 (vector-length v1-8)) - (f0-7 (* 0.000009765625 f0-6)) + (f0-7 (/ f0-6 (meters 25))) (f1-3 (* f0-7 f0-7 (seconds-per-frame))) (f0-10 (fmax 0.0 (fmin 1.0 f1-3))) ) @@ -3812,7 +3812,7 @@ (set! (-> s5-3 y) 0.0) (let ((f1-6 (vector-normalize-ret-len! s5-3 1.0))) (when (< f1-6 122880.0) - (let* ((f0-21 (* 0.000008138021 f1-6)) + (let* ((f0-21 (/ f1-6 (meters 30))) (f0-22 (- 1.0 f0-21)) (f0-23 (* f0-22 f0-22)) ) diff --git a/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc index 889f2f23329..1d678d96630 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc @@ -968,7 +968,7 @@ (-> self move-dest) self (-> self target-status handle) - (* 0.5 (-> self attack-distance)) + (/ (-> self attack-distance) 2) (-> self random-offset-search) ) (roboguard-city-method-239 self) @@ -1097,7 +1097,7 @@ (-> this move-dest) this (-> this target-status handle) - (* 0.5 (-> this attack-distance)) + (/ (-> this attack-distance) 2) (-> this random-offset-search) ) (roboguard-city-method-239 this) @@ -1117,7 +1117,7 @@ (-> this move-dest) this (-> this target-status handle) - (* 0.5 (-> this attack-distance)) + (/ (-> this attack-distance) 2) (-> this random-offset-search) ) (roboguard-city-method-235 this) @@ -2025,7 +2025,7 @@ (-> this move-dest) this (-> this target-status handle) - (* 0.5 (-> this attack-distance)) + (/ (-> this attack-distance) 2) (-> this random-offset-search) ) (roboguard-city-method-239 this) @@ -2042,7 +2042,7 @@ 0.0 (let* ((f0-8 (vector-dot s5-3 v1-35)) (f0-9 (+ 1.0 f0-8)) - (f0-10 (* 0.5 f0-9)) + (f0-10 (/ f0-9 2)) (f0-11 (lerp -0.2 0.0 f0-10)) ) (sound-play-by-name @@ -2184,7 +2184,7 @@ (f0-21 (+ -1.0 (the-as float v1-61))) ) (cond - ((< f0-21 (* 0.5 f30-1)) + ((< f0-21 (/ f30-1 2)) (set! s5-0 (logior s5-0 2)) ) ((< f0-21 f30-1) diff --git a/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc index 9efc4dffa2b..4c03081e0cb 100644 --- a/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc @@ -1283,7 +1283,7 @@ (launch-particles (-> *part-id-table* 4846) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f28-1 (* 0.000015258789 f30-0)) + (f28-1 (/ f30-0 (meters 16))) (f30-1 (-> *part-id-table* 4847 init-specs 3 initial-valuef)) ) (-> *part-id-table* 4847 init-specs 4 initial-valuef) @@ -2757,7 +2757,7 @@ ) (quaternion-copy! (-> self gun-shoulder-jmod rotation) (new 'static 'quaternion :x 0.5 :w 0.8660254)) (quaternion-copy! (-> self gun-elbow-jmod rotation) (new 'static 'quaternion :x -0.5 :w 0.8660254)) - (set! (-> self fov-mult) (lerp-clamp 1.3 0.45 (* 0.0000048828124 f30-0))) + (set! (-> self fov-mult) (lerp-clamp 1.3 0.45 (/ f30-0 (meters 50)))) (set-setting! 'fov 'rel (-> self fov-mult) 0) ) ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-norm_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-norm_REF.gc index 747f9006c02..98ad4f34a5b 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-norm_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-norm_REF.gc @@ -663,7 +663,7 @@ (if (or (= (-> this incoming knocked-type) (knocked-type explode-or-darkjak)) (= (-> this incoming knocked-type) (knocked-type dark-shot)) ) - (set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed))) + (set! (-> arg0 anim-speed) (/ (-> arg0 anim-speed) 2)) ) (let ((a0-47 (-> this skel root-channel 0))) (set! (-> a0-47 frame-group) (the-as art-joint-anim s4-0)) @@ -1168,7 +1168,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen_REF.gc index 4126fbcdfec..80ef2e8fd9e 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen_REF.gc @@ -790,7 +790,7 @@ s5-1 s5-1 gp-0 - (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame)) ) ) 0 @@ -1943,7 +1943,3 @@ (defmethod enemy-method-152 ((this citizen)) 0.5 ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc index 1476b5c5ed1..6591056465e 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc @@ -980,7 +980,7 @@ ) (if (and (-> self allow-dive) (< (vector-length v1-8) (* (-> self dive-reaction) (vector-length (-> self cp-vec)))) - (< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (* 0.5 (-> self cp-sphere r))) + (< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (/ (-> self cp-sphere r) 2)) ) (civilian-method-231 self) ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc index 353c86be74a..316e0a00108 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc @@ -513,7 +513,7 @@ (set-time! (-> this last-change-dir)) (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) + (f0-9 (* (/ f30-0 2) (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) (if (-> this heading) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-predator_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-predator_REF.gc index 06f39d9d8f9..d8595e35796 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-predator_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-predator_REF.gc @@ -767,7 +767,7 @@ (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-272 quad) vf6) (let* ((f0-5 (vector-length sv-272)) - (f0-6 (* 0.0000018780048 f0-5)) + (f0-6 (/ f0-5 (meters 130))) ) (set! sv-288 (new 'stack-no-clear 'vector)) (let ((s0-0 (new 'stack-no-clear 'vector)) @@ -1259,7 +1259,3 @@ (go-inactive self) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine_REF.gc index f6586ae482b..9569bcc00e4 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine_REF.gc @@ -337,7 +337,7 @@ ) ) (set! (-> s4-0 vec2 y) - (+ (* 0.5 (-> s4-0 vec2 x)) (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing))) + (+ (/ (-> s4-0 vec2 x) 2) (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing))) ) (vector-float*! (-> s4-0 params velocity) (-> s4-0 vec0) (-> s4-0 vec2 x)) (vector-float*! (-> s4-0 vec1) (-> s4-0 vec0) (-> s4-0 vec2 y)) @@ -1016,7 +1016,7 @@ (set! f3-0 1.5) ) ) - (set! (-> v1-1 0 decay-rate) (* 0.1 f3-0)) + (set! (-> v1-1 0 decay-rate) (/ f3-0 10)) (when (< (-> v1-1 0 danger-level) f2-0) (set! (-> v1-1 0 danger-level) f2-0) (set! (-> v1-1 0 sphere r) f1-0) @@ -1929,7 +1929,3 @@ s5-0 ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/bike_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/bike_REF.gc index e632082125c..b680d827b3f 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/bike_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/bike_REF.gc @@ -1655,10 +1655,10 @@ (f26-0 (* -13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f28-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f28-0) (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (* -0.2 f28-0) f30-0)) - (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (* 0.2 f28-0) f30-0)) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f28-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f28-0) (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (/ f28-0 -5) f30-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (/ f28-0 5) f30-0)) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 f26-0) (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f26-0) @@ -1784,8 +1784,8 @@ (f28-0 (* 13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this rudder-f rotation) s5-0 (- f30-0)) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) @@ -1925,8 +1925,8 @@ (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f26-0) (quaternion-vector-angle! (-> this fin2-fl rotation) s5-0 (- f26-0)) (quaternion-vector-angle! (-> this fin2-fr rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5))) (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/car_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/car_REF.gc index 3c6db364d51..02d2f828847 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/car_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/car_REF.gc @@ -2045,10 +2045,10 @@ (quaternion-vector-angle! (-> this steering-wheel rotation) s5-0 f0-3) (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f28-0)) (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (* 0.2 f28-0) (* -0.8 f30-0))) - (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (* -0.2 f28-0) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (/ f30-0 -5))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (/ f30-0 -5))) + (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (/ f28-0 5) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (/ f28-0 -5) (* -0.8 f30-0))) ) 0 (none) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-effects_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-effects_REF.gc index 33ada103978..2b9f08f2d06 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-effects_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-effects_REF.gc @@ -35,7 +35,7 @@ ;; definition for function calc-fade-vals ;; WARN: Return type mismatch object vs none. (defun calc-fade-vals ((arg0 float)) - (let* ((f1-1 (* 0.00024414062 arg0)) + (let* ((f1-1 (/ arg0 METER_LENGTH)) (f0-3 (- f1-1 (the float (the int f1-1)))) (f1-3 (* 4096.0 (- f1-1 f0-3))) (f1-5 (/ -1.0 (* (- 1.0 f0-3) f1-3))) @@ -236,7 +236,7 @@ (set! (-> *part-id-table* 923 init-specs 9 random-rangef) (* 48.0 f0-40)) ) (set! (-> s5-0 float0) - (* 0.2 (-> this info handling max-engine-thrust) (+ 0.5 (-> this engine-power-factor))) + (* (/ (-> this info handling max-engine-thrust) 5) (+ 0.5 (-> this engine-power-factor))) ) (let ((s4-2 (-> *part-id-table* 923))) (dotimes (s3-0 2) @@ -365,12 +365,12 @@ (set! (-> s5-0 vec4 quad) (-> s5-0 vec0 quad)) (let ((f0-0 (rand-vu-float-range 1.0 1.33))) (set! (-> s5-0 float0) (* f0-0 (-> arg1 length) (-> arg1 thrust))) - (set! (-> s5-0 float1) (fmin (* (-> arg1 width) f0-0) (* 0.5 (-> s5-0 float0)))) + (set! (-> s5-0 float1) (fmin (* (-> arg1 width) f0-0) (/ (-> s5-0 float0) 2))) ) (let ((a1-5 (-> s5-0 vec3))) (let ((v1-4 (-> arg1 trans))) (let ((a0-9 (-> s5-0 vec4))) - (let ((a2-2 (* 0.25 (-> s5-0 float0)))) + (let ((a2-2 (/ (-> s5-0 float0) 4))) (.mov vf7 a2-2) ) (.lvf vf5 (&-> a0-9 quad)) @@ -396,13 +396,13 @@ (let ((f0-13 (* 4.0 (-> s5-0 float1)))) (set! (-> s5-0 glow position w) f0-13) (set! (-> s5-0 glow size-y) f0-13) - (set! (-> s5-0 glow size-probe) (* 0.025 f0-13)) + (set! (-> s5-0 glow size-probe) (/ f0-13 40)) ) (add! *simple-sprite-system* (-> s5-0 glow)) (let ((v1-15 (-> s5-0 vec3))) (let ((a0-14 (-> arg1 trans))) (let ((a1-11 (-> s5-0 vec4))) - (let ((a2-5 (* 0.5 (-> s5-0 float0)))) + (let ((a2-5 (/ (-> s5-0 float0) 2))) (.mov vf7 a2-5) ) (.lvf vf5 (&-> a1-11 quad)) @@ -446,7 +446,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-physics_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-physics_REF.gc index 6632f520db9..f04c7e3fd43 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-physics_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-physics_REF.gc @@ -14,7 +14,7 @@ ) 0.0 (let* ((f2-4 (fmax -1.0 (fmin 1.0 (/ (- (-> this water-height) (-> arg0 y)) (-> arg0 w))))) - (f30-0 (+ 0.5 (* -0.25 f2-4 f2-4 f2-4) (* 0.75 f2-4))) + (f30-0 (+ 0.5 (* (/ f2-4 -4) f2-4 f2-4) (* 0.75 f2-4))) ) (set! (-> s5-0 rvec y) (* 0.5 (+ f0-1 f1-3))) (rigid-body-control-method-23 (-> this rbody) (-> s5-0 rvec) (-> s5-0 fvec)) @@ -86,7 +86,3 @@ (apply-gravity! this arg0) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc index 9ba73a9fa48..69c35a06338 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc @@ -658,7 +658,7 @@ (set! arg0 0.0) ) (if (logtest? (game-secrets vehicle-hit-points) (-> *game-info* secrets)) - (set! arg0 (* 0.5 arg0)) + (set! arg0 (/ arg0 2)) ) ) (set! (-> this hit-points) (- (-> this hit-points) (* arg0 (-> this damage-factor)))) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc index 36f96a6ae07..b73855e2010 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc @@ -304,7 +304,7 @@ (set! f1-6 (* f0-23 f0-23)) ) (if (not (logtest? (-> this v-flags) (vehicle-flag riding))) - (set! f1-6 (* 0.5 f1-6)) + (set! f1-6 (/ f1-6 2)) ) ) (+! (-> this power-level) @@ -1143,7 +1143,7 @@ (and (logtest? (penetrate dark-skin) arg3) (logtest? arg3 (penetrate punch spin))) ) (set! f30-0 (* 204800.0 (-> this info info mass))) - (* 0.2 (-> this info damage hit-points)) + (/ (-> this info damage hit-points) 5) ) ((logtest? (penetrate jak-red-shockwave) arg3) (case (-> arg1 mode) diff --git a/test/decompiler/reference/jak3/levels/city/vinroom/ljkdxvin-texture_REF.gc b/test/decompiler/reference/jak3/levels/city/vinroom/ljkdxvin-texture_REF.gc index 0d12fb661bd..c80c11b7f21 100644 --- a/test/decompiler/reference/jak3/levels/city/vinroom/ljkdxvin-texture_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/vinroom/ljkdxvin-texture_REF.gc @@ -160,8 +160,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) @@ -207,7 +207,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/comb/comb-field_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-field_REF.gc index 03b03b72b04..12b198cde26 100644 --- a/test/decompiler/reference/jak3/levels/comb/comb-field_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/comb-field_REF.gc @@ -323,8 +323,8 @@ (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) (vector-! (-> s2-2 rvec) s4-0 s3-0) (let ((f30-1 (vector-normalize-ret-len! (-> s2-2 rvec) 1.0))) - (set! (-> s1-0 scale x) (* 0.00024414062 f30-1)) - (set! (-> s1-0 scale y) (* 0.00024414062 arg1)) + (set! (-> s1-0 scale x) (/ f30-1 METER_LENGTH)) + (set! (-> s1-0 scale y) (/ arg1 METER_LENGTH)) (set! (-> s1-0 scale z) 1.0) (set! (-> s2-2 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) (vector-cross! (-> s2-2 fvec) (-> s2-2 rvec) (-> s2-2 uvec)) @@ -334,7 +334,7 @@ (set! (-> this plane w) (- (vector-dot (-> s2-2 fvec) (-> this root trans)))) (let ((v0-8 (-> this root root-prim local-sphere))) (set! (-> v0-8 x) 0.0) - (set! (-> v0-8 y) (* 0.00024414062 (* 0.5 arg1))) + (set! (-> v0-8 y) (* 0.00024414062 (/ arg1 2))) (set! (-> v0-8 z) 0.0) (let ((f0-18 0.5) (f1-5 (* f30-1 f30-1)) @@ -377,7 +377,3 @@ (transform-post) (go (method-of-object this idle-close)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc index 31bd020abf0..f5118d51aff 100644 --- a/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc @@ -79,7 +79,7 @@ (launch-particles (-> *part-id-table* 4238) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 4239 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 4239 init-specs 4 initial-valuef)) ) diff --git a/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc b/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc index 8332b584c85..31c37ba6e45 100644 --- a/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc @@ -265,7 +265,7 @@ (launch-particles (-> *part-id-table* 4232) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix))) - (* 0.000027126736 f30-0) + (/ f30-0 (meters 9)) (-> *part-id-table* 4233 init-specs 3 initial-valuef) (-> *part-id-table* 4233 init-specs 4 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) @@ -1309,19 +1309,20 @@ (set! (-> gp-0 tmp z) (-> this ai-target-speed)) (set! (-> gp-0 world-pos quad) (-> this ai-target-pos quad)) (vector-! (-> gp-0 lift-dir) (-> gp-0 world-pos) (-> gp-0 mat fvec)) - (set! (-> gp-0 tmp w) (* 0.00036621094 - (- (-> gp-0 tmp z) (-> gp-0 p-body x)) - (-> this info handling ai-throttle-factor) - (-> gp-0 p-body y) - ) + (set! (-> gp-0 tmp w) + (* 0.00036621094 + (- (-> gp-0 tmp z) (-> gp-0 p-body x)) + (-> this info handling ai-throttle-factor) + (-> gp-0 p-body y) + ) ) (set! (-> gp-0 mat rvec y) (fmax 0.0 (fmin 1.0 (+ (-> this controls throttle) (-> gp-0 tmp w))))) - (set! (-> gp-0 mat rvec x) (fmax -1.0 (fmin 1.0 (* 0.000012207031 - (-> this info handling ai-steering-factor) - (vector-dot (-> gp-0 local-pos) (-> gp-0 lift-dir)) - ) - ) - ) + (set! (-> gp-0 mat rvec x) + (fmax -1.0 (fmin 1.0 (* (/ (-> this info handling ai-steering-factor) (meters 20)) + (vector-dot (-> gp-0 local-pos) (-> gp-0 lift-dir)) + ) + ) + ) ) (vehicle-method-92 this (the-as vehicle-controls (-> gp-0 mat))) ) @@ -1445,7 +1446,7 @@ ) (cond ((logtest? (vehicle-flag ignition) (-> this v-flags)) - (let ((f1-4 (+ 0.75 (* 0.25 (-> this controls throttle))))) + (let ((f1-4 (+ 0.75 (/ (-> this controls throttle) 4)))) (if (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) (set! f1-4 (+ 1.0 (* (-> this turbo-boost-factor) (-> this info handling turbo-boost-factor)))) ) @@ -1590,7 +1591,7 @@ (set! (-> s5-1 1 x) (fmax 0.0 (fmin 1.0 (+ -1.0 (-> s5-1 0 x))))) (set! (-> s5-1 1 y) (* 0.0 (-> s5-1 1 x))) (set! (-> s5-1 1 z) (-> s5-1 0 y)) - (set! (-> s5-1 1 w) (* 0.5 (-> s5-1 0 y))) + (set! (-> s5-1 1 w) (/ (-> s5-1 0 y) 2)) (set! (-> s5-1 0 z) (cube-root (-> s5-1 0 z))) (set! (-> s5-1 1 x) (cube-root (-> s5-1 1 x))) (set! (-> s5-1 1 z) (cube-root (-> s5-1 1 z))) @@ -1905,7 +1906,11 @@ ) ) (vector-matrix*! (-> s4-0 world-pos) (-> s4-0 local-pos) (-> s4-0 mat)) - (vector-float*! (-> s4-0 force) (-> this impact-normal) (* -0.5 (-> s2-0 extra gravity) (-> s2-0 info mass))) + (vector-float*! + (-> s4-0 force) + (-> this impact-normal) + (* (/ (-> s2-0 extra gravity) -2) (-> s2-0 info mass)) + ) (rigid-body-control-method-22 s3-0 (-> s4-0 world-pos) (-> s4-0 force)) ) (when (logtest? (-> this v-flags) (vehicle-flag on-ground)) @@ -1993,7 +1998,7 @@ (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) - (set! (-> gp-2 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-2 scale) (/ (-> self draw bounds w) 11264)) (set! (-> gp-2 group) (-> *part-group-id-table* (-> self info explosion-part))) (set! (-> gp-2 collide-with) (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) diff --git a/test/decompiler/reference/jak3/levels/comb/railx-mood_REF.gc b/test/decompiler/reference/jak3/levels/comb/railx-mood_REF.gc index 500259503b4..7469d1aab1e 100644 --- a/test/decompiler/reference/jak3/levels/comb/railx-mood_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/railx-mood_REF.gc @@ -97,7 +97,7 @@ (the-as vector (-> gp-0 ambi color)) (the-as vector (-> gp-0 ambi color)) s2-0 - (* 0.5 (-> (the-as railx-states s3-0) yellow brightness)) + (/ (-> (the-as railx-states s3-0) yellow brightness) 2) ) (vector-float*! (the-as vector (-> gp-0 dir0 color)) s4-0 (-> (the-as railx-states s3-0) blue brightness)) (set! (-> gp-0 dir1 color quad) (-> gp-0 ambi color quad)) @@ -172,7 +172,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common-obs/ladder_REF.gc b/test/decompiler/reference/jak3/levels/common-obs/ladder_REF.gc index 721f905bb8f..cfce9277a9b 100644 --- a/test/decompiler/reference/jak3/levels/common-obs/ladder_REF.gc +++ b/test/decompiler/reference/jak3/levels/common-obs/ladder_REF.gc @@ -126,8 +126,8 @@ (-> self rider-unit) ) (('stance) - (let* ((f0-8 (/ (* 0.5 (-> self meters-per-rung)) (-> self meters-per-unit))) - (f1-12 (* (the float (the int (/ (+ (-> self rider-unit) (* 0.5 f0-8)) f0-8))) f0-8)) + (let* ((f0-8 (/ (/ (-> self meters-per-rung) 2) (-> self meters-per-unit))) + (f1-12 (* (the float (the int (/ (+ (-> self rider-unit) (/ f0-8 2)) f0-8))) f0-8)) ) (+! (-> self rider-unit) (* 0.1 (- f1-12 (-> self rider-unit)))) (set! (-> self rider-unit) (seek (-> self rider-unit) f1-12 (* 2.0 (seconds-per-frame) f0-8))) @@ -245,13 +245,9 @@ (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) (set! (-> this root scale y) (/ (-> this set-height) (-> this art-height))) - (set! (-> this draw bounds y) (/ (* 0.5 (-> this set-height)) (-> this root scale y))) - (set! (-> this draw bounds w) (+ 2048.0 (* 0.5 (-> this set-height)))) - (set! (-> this root root-prim local-sphere y) (/ (* 0.5 (-> this set-height)) (-> this root scale y))) - (set! (-> this root root-prim local-sphere w) (+ 2048.0 (* 0.5 (-> this set-height)))) + (set! (-> this draw bounds y) (/ (/ (-> this set-height) 2) (-> this root scale y))) + (set! (-> this draw bounds w) (+ 2048.0 (/ (-> this set-height) 2))) + (set! (-> this root root-prim local-sphere y) (/ (/ (-> this set-height) 2) (-> this root scale y))) + (set! (-> this root root-prim local-sphere w) (+ 2048.0 (/ (-> this set-height) 2))) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc b/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc index b8c2d2816e9..1eaafc3b5fb 100644 --- a/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc @@ -1000,7 +1000,7 @@ (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp) ) ) - (set! (-> this wall-xz) (* 0.5 (-> this wall-xz))) + (set! (-> this wall-xz) (/ (-> this wall-xz) 2)) (+! (-> this wall-xz) 4096.0) (set! (-> this wall-y) (fabs diff --git a/test/decompiler/reference/jak3/levels/common/enemy/darkprec/dp-bipedal_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/darkprec/dp-bipedal_REF.gc index 39f91f3ba66..947dd72b187 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/darkprec/dp-bipedal_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/darkprec/dp-bipedal_REF.gc @@ -2667,7 +2667,7 @@ (set! (-> s2-0 4 x) (/ (-> s2-0 3 w) (+ (fmax 0.0 (vector-dot arg2 (-> s2-0 5))) arg5))) (vector+float*! arg0 (-> s2-0 0) (-> s2-0 1) (-> s2-0 4 x)) (let ((f1-19 (/ (-> s2-0 2 x) arg5))) - (set! (-> arg0 y) (+ 10240.0 (* 0.25 arg6 (* f1-19 f1-19)) (-> arg3 y))) + (set! (-> arg0 y) (+ 10240.0 (* (/ arg6 4) (* f1-19 f1-19)) (-> arg3 y))) ) #t ) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/darkprec/neo-wasp_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/darkprec/neo-wasp_REF.gc index ce67a63ddf3..9341eb55d6f 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/darkprec/neo-wasp_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/darkprec/neo-wasp_REF.gc @@ -897,10 +897,10 @@ (-> this thrust 0) (+ (* 0.4 (fmax 0.0 (* (-> v1-2 x) f0-0))) (fmax 0.0 (-> v1-2 y)) - (fabs (* 0.2 (-> v1-2 z))) + (fabs (/ (-> v1-2 z) 5)) (fmax 0.0 (-> s5-0 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/flitter_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/flitter_REF.gc index 58544338fb0..8d8efd7656a 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/flitter_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/flitter_REF.gc @@ -904,7 +904,7 @@ (set-time! (-> this last-change-dir)) (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) + (f0-9 (* (/ f30-0 2) (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) (if (-> this heading) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/hover/robo-hover_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/hover/robo-hover_REF.gc index 023336b6637..572b99d5126 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/hover/robo-hover_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/hover/robo-hover_REF.gc @@ -1374,10 +1374,10 @@ (-> arg0 thrust s3-0) (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) (fmax 0.0 (-> v0-6 y)) - (fabs (* 0.2 (-> v0-6 z))) + (fabs (/ (-> v0-6 z) 5)) (fmax 0.0 (-> s1-1 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) @@ -1399,7 +1399,7 @@ (set! (-> *part-id-table* 2213 init-specs 0 initial-valuef) (* f24-0 f0-14)) (set! (-> arg0 thrust s3-0) f28-0) (let ((f0-15 (* f26-0 f0-14))) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (* -0.5 f0-15)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (/ f0-15 -2)) ) ) ) @@ -1476,7 +1476,7 @@ ) (set! (-> *part-id-table* 2213 init-specs 0 initial-valuef) f1-0) ) - (let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (* -0.5 f0-0)))) + (let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (/ f0-0 -2)))) (vector+! (-> s5-0 trans) s4-0 v1-29) ) ) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/mantis_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/mantis_REF.gc index bebca2d00d2..b777d7ae944 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/mantis_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/mantis_REF.gc @@ -1477,7 +1477,7 @@ ((method-of-type sphere new) (the-as symbol (-> s4-0 s3-0)) sphere) ) (set! (-> s4-0 0 quad) (-> this root trans quad)) - (set! (-> s4-0 0 y) (+ (-> this base-height) (* 0.5 (-> this root root-prim prim-core world-sphere w)))) + (set! (-> s4-0 0 y) (+ (-> this base-height) (/ (-> this root root-prim prim-core world-sphere w) 2))) (set! (-> s4-0 0 r) (-> this root root-prim prim-core world-sphere w)) (let ((v1-16 s5-1)) (set! (-> v1-16 best-dist) (the-as float s4-0)) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc index c55e0d0cd46..ea9ca4b9a7e 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc @@ -819,7 +819,7 @@ ) (set! (-> this old-y-deg) f0-0) ) - (if (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) + (if (< (+ 0.5 (/ (-> this nav state speed) METER_LENGTH)) (* 0.005493164 (fabs (-> this diff-angle)))) (logior! (-> this flags) (eco-creature-flag ecf0)) (logclear! (-> this flags) (eco-creature-flag ecf0)) ) @@ -1086,7 +1086,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) (else (prebot-large-eco-creature-method-194 self) @@ -1119,7 +1119,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) (else (prebot-large-eco-creature-method-194 self) @@ -1153,7 +1153,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) (else (prebot-large-eco-creature-method-194 self) @@ -1321,7 +1321,7 @@ (vector-! v1-27 (the-as vector gp-0) (the-as vector s5-0)) (set! (-> v1-27 y) 0.0) (let ((f30-1 (atan (-> v1-27 x) (-> v1-27 z)))) - (quaternion-set! (-> self root quat) 0.0 (sin (* 0.5 f30-1)) 0.0 (cos (* 0.5 f30-1))) + (quaternion-set! (-> self root quat) 0.0 (sin (/ f30-1 2)) 0.0 (cos (/ f30-1 2))) ) ) (set! (-> self which-trajectory) 0) @@ -1396,8 +1396,8 @@ (let ((s5-0 (new 'stack-no-clear 'quaternion)) (gp-0 (new 'stack-no-clear 'quaternion)) ) - (quaternion-set! s5-0 (sin (* 0.5 (-> self x-rotate))) 0.0 0.0 (cos (* 0.5 (-> self x-rotate)))) - (quaternion-set! gp-0 0.0 (sin (* 0.5 (-> self y-rotate))) 0.0 (cos (* 0.5 (-> self y-rotate)))) + (quaternion-set! s5-0 (sin (/ (-> self x-rotate) 2)) 0.0 0.0 (cos (/ (-> self x-rotate) 2))) + (quaternion-set! gp-0 0.0 (sin (/ (-> self y-rotate) 2)) 0.0 (cos (/ (-> self y-rotate) 2))) (quaternion-normalize! (quaternion*! (-> self spin-jm quat) gp-0 s5-0)) ) (cond diff --git a/test/decompiler/reference/jak3/levels/common/enemy/spyder_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/spyder_REF.gc index 84da69deaac..f9d8a046a30 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/spyder_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/spyder_REF.gc @@ -1094,7 +1094,7 @@ ) ) (let ((v1-17 (-> self nav))) - (set! (-> v1-17 max-rotation-rate) (* 0.05 (-> *spyder-nav-enemy-info* maximum-rotation-rate))) + (set! (-> v1-17 max-rotation-rate) (/ (-> *spyder-nav-enemy-info* maximum-rotation-rate) 20)) ) 0 (ja-channel-push! 2 (seconds 0.2)) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc index 4259908006c..097df14a7ae 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc @@ -832,7 +832,7 @@ ) (set! (-> this old-y-deg) f0-5) ) - (if (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) + (if (< (+ 0.5 (/ (-> this nav state speed) METER_LENGTH)) (* 0.005493164 (fabs (-> this diff-angle)))) (logior! (-> this flags) (spydroid-orig-flag sof1)) (logclear! (-> this flags) (spydroid-orig-flag sof1)) ) @@ -1347,7 +1347,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-44 (ja-group))) @@ -1403,7 +1403,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-28 (ja-group))) @@ -1460,7 +1460,7 @@ (ja :group! (-> self draw art-group data (-> self enemy-info walk-anim)) :num! min) ) ) - (ja :num! (loop! (/ (-> self nav state speed) (* 0.5 (-> self enemy-info run-travel-speed))))) + (ja :num! (loop! (/ (-> self nav state speed) (/ (-> self enemy-info run-travel-speed) 2)))) ) ((< 0.0 (-> self diff-angle)) (let ((v1-28 (ja-group))) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc index fb3fbd6f91e..ed2789bc704 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc @@ -707,7 +707,7 @@ (set! (-> gp-0 quad) (-> (get-trans a0-2 3) quad)) (set! f0-0 (spydroid-method-234 self gp-0)) ) - (set! f28-0 (* 0.00024414062 f0-0)) + (set! f28-0 (/ f0-0 METER_LENGTH)) ) ) (if (logtest? (enemy-flag drawn-mirrored) (-> self enemy-flags)) @@ -921,7 +921,7 @@ (f0-2 (-> s4-1 y)) ) (if (not (logtest? (-> this draw status) (draw-control-status on-screen))) - (set! f30-0 (* 0.1 f30-0)) + (set! f30-0 (/ f30-0 10)) ) (when (< f0-2 40960.0) (set! (-> s4-1 y) 0.0) diff --git a/test/decompiler/reference/jak3/levels/common/external-player-control_REF.gc b/test/decompiler/reference/jak3/levels/common/external-player-control_REF.gc index 3859b58df63..b5c49455377 100644 --- a/test/decompiler/reference/jak3/levels/common/external-player-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/external-player-control_REF.gc @@ -40,8 +40,8 @@ (set! (-> arg0 stick0-speed) arg2) (+! (-> s5-0 x) 1.0) (+! (-> s5-0 z) 1.0) - (set! (-> s5-0 x) (* 0.5 (-> s5-0 x))) - (set! (-> s5-0 z) (* 0.5 (-> s5-0 z))) + (set! (-> s5-0 x) (/ (-> s5-0 x) 2)) + (set! (-> s5-0 z) (/ (-> s5-0 z) 2)) (set! (-> arg0 leftx) (the-as uint (the int (* 255.0 (-> s5-0 x))))) (if (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) (set! (-> arg0 leftx) (the-as uint (* (the-as uint -1) (-> arg0 leftx)))) @@ -446,7 +446,3 @@ ) :code sleep-code ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc b/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc index 332bbec8bd4..052e7f76b59 100644 --- a/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc @@ -508,7 +508,7 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-40 vf1) (let ((f0-17 v1-40) - (f1-4 (* 0.5 arg3)) + (f1-4 (/ arg3 2)) ) (when (< (* f1-4 f1-4) f0-17) (vector+! s5-0 s5-0 (-> s2-0 vec0)) diff --git a/test/decompiler/reference/jak3/levels/common/hvehicle/turret-control_REF.gc b/test/decompiler/reference/jak3/levels/common/hvehicle/turret-control_REF.gc index 6805408e97c..8a8cf5096ab 100644 --- a/test/decompiler/reference/jak3/levels/common/hvehicle/turret-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/hvehicle/turret-control_REF.gc @@ -408,7 +408,7 @@ (-> gp-0 vec-12 x) ) ) - (set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (* 0.1 (-> gp-0 vec-12 x)))))) + (set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (/ (-> gp-0 vec-12 x) 10))))) (+! (-> this aim-rot s3-1) (* (-> this aim-rot-vel s3-1) (-> gp-0 vec-12 x))) (when (or (zero? s3-1) (not (logtest? (-> this flags) (turret-flag no-rot-y-clamp)))) (let ((f0-31 (-> this info rot-min s3-1))) @@ -642,7 +642,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/race/race-manager_REF.gc b/test/decompiler/reference/jak3/levels/common/race/race-manager_REF.gc index a2bf9122e24..704e945a9ff 100644 --- a/test/decompiler/reference/jak3/levels/common/race/race-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/race/race-manager_REF.gc @@ -877,7 +877,7 @@ (let ((v1-8 (new 'stack-no-clear 'race-manager-stack-var0))) (set! (-> v1-8 vec1 z) 61440.0) (set! (-> v1-8 word) 1) - (set! (-> v1-8 vec0 z) (* -0.5 (-> v1-8 vec1 z))) + (set! (-> v1-8 vec0 z) (/ (-> v1-8 vec1 z) -2)) (set! (-> v1-8 vec0 w) -20480.0) (set! (-> v1-8 vec1 x) (/ (-> v1-8 vec1 z) (the float (max 1 (+ (-> v1-8 word) -1))))) (set! (-> v1-8 vec1 y) -40960.0) @@ -1240,7 +1240,7 @@ (let ((v1-12 gp-1)) (set! (-> v1-12 height) (the float 70)) ) - (set! (-> gp-1 origin x) (the float (- 256 (the int (* 0.5 (-> gp-1 width)))))) + (set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2))))) (set! (-> gp-1 origin y) 320.0) (set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s5-1 print-game-text)) @@ -1298,7 +1298,7 @@ (let ((v1-12 gp-1)) (set! (-> v1-12 height) (the float 35)) ) - (set! (-> gp-1 origin x) (the float (- 256 (the int (* 0.5 (-> gp-1 width)))))) + (set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2))))) (set! (-> gp-1 origin y) 320.0) (set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s5-1 print-game-text)) diff --git a/test/decompiler/reference/jak3/levels/common/race/race-mesh_REF.gc b/test/decompiler/reference/jak3/levels/common/race/race-mesh_REF.gc index b7fd293bab8..c377f5f23e0 100644 --- a/test/decompiler/reference/jak3/levels/common/race/race-mesh_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/race/race-mesh_REF.gc @@ -880,7 +880,7 @@ (set! (-> s3-0 cell-bits 0 quad) (the-as uint128 0)) (set! (-> s3-0 cell-bits 1 quad) (the-as uint128 0)) (let ((f0-1 (/ 1.0 (-> s4-0 cell-length))) - (f1-2 (fmin (-> arg0 search-sphere r) (* 0.5 (-> s4-0 cell-length)))) + (f1-2 (fmin (-> arg0 search-sphere r) (/ (-> s4-0 cell-length) 2))) ) (let ((f3-1 (- (-> arg0 search-sphere x) f1-2)) (f2-4 (- (-> arg0 search-sphere z) f1-2)) @@ -914,7 +914,7 @@ (+! s2-0 1) ) ) - (when (and (= (-> arg0 slice-id) -1) (< (* 0.5 (-> s4-0 cell-length)) (-> arg0 search-sphere r))) + (when (and (= (-> arg0 slice-id) -1) (< (/ (-> s4-0 cell-length) 2) (-> arg0 search-sphere r))) (while (= (-> arg0 slice-id) -1) (set! (-> s3-0 bounds min x) (max 0 (+ (-> s3-0 bounds min x) -1))) (set! (-> s3-0 bounds min z) (max 0 (+ (-> s3-0 bounds min z) -1))) @@ -981,7 +981,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/boss/terraformer-setup_REF.gc b/test/decompiler/reference/jak3/levels/desert/boss/terraformer-setup_REF.gc index ef9e5ca1e91..21928bb495e 100644 --- a/test/decompiler/reference/jak3/levels/desert/boss/terraformer-setup_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/boss/terraformer-setup_REF.gc @@ -1011,8 +1011,8 @@ (let ((s5-0 (new 'stack-no-clear 'quaternion)) (gp-0 (new 'stack-no-clear 'quaternion)) ) - (quaternion-set! s5-0 (sin (* 0.5 (-> self x-rotate))) 0.0 0.0 (cos (* 0.5 (-> self x-rotate)))) - (quaternion-set! gp-0 0.0 (sin (* 0.5 (-> self y-rotate))) 0.0 (cos (* 0.5 (-> self y-rotate)))) + (quaternion-set! s5-0 (sin (/ (-> self x-rotate) 2)) 0.0 0.0 (cos (/ (-> self x-rotate) 2))) + (quaternion-set! gp-0 0.0 (sin (/ (-> self y-rotate) 2)) 0.0 (cos (/ (-> self y-rotate) 2))) (quaternion-normalize! (quaternion*! (-> self root quat) gp-0 s5-0)) ) (cond diff --git a/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc index d40693c5625..2df6ae4ab63 100644 --- a/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc @@ -1065,7 +1065,7 @@ ) (else (set! (-> *part-id-table* 1585 init-specs 11 initial-valuef) f0-4) - (set! (-> *part-id-table* 1586 init-specs 11 initial-valuef) (* 0.5 f0-4)) + (set! (-> *part-id-table* 1586 init-specs 11 initial-valuef) (/ f0-4 2)) (spawn-from-cspace (-> this part) (-> this node-list data 4)) (spawn-from-cspace (-> this part) (-> this node-list data 5)) ) diff --git a/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc index 8d990e515ce..4321725855e 100644 --- a/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc @@ -1947,7 +1947,7 @@ (set! (-> this fail-radius) (res-lump-float s5-2 'fail-radius :default 655360.0)) (set! (-> this chase-distance) (res-lump-float s5-2 'chase-distance :default 102400.0)) (set! (-> this start-offset-vel) (res-lump-float s5-2 'start-offset-vel :default 20480.0)) - (format #t "new-vel: ~f~%" (* 0.00024414062 (-> this start-offset-vel))) + (format #t "new-vel: ~f~%" (/ (-> this start-offset-vel) METER_LENGTH)) (set! (-> this entity) (the-as entity-actor s5-2)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-19 (res-lump-data s5-2 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -1966,7 +1966,7 @@ (set-sbanks this) (set! (-> this sound-id) (new 'static 'sound-id)) (set! (-> this current-spirit-vel) (-> this min-spirit-vel)) - (format #t "min-spirit-vel: ~f~%" (* 0.00024414062 (-> this min-spirit-vel))) + (format #t "min-spirit-vel: ~f~%" (/ (-> this min-spirit-vel) METER_LENGTH)) (none) ) diff --git a/test/decompiler/reference/jak3/levels/desert/des-cactus_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-cactus_REF.gc index f68134502d4..6e4aef37016 100644 --- a/test/decompiler/reference/jak3/levels/desert/des-cactus_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/des-cactus_REF.gc @@ -92,8 +92,8 @@ (quaternion-conjugate! (-> s5-0 1) (-> this root quat)) (quaternion->matrix (the-as matrix (-> s5-0 2)) (-> s5-0 1)) (set! (-> s5-0 7 x) 2730.6667) - (set! (-> s5-0 7 z) (sin (* 0.5 (-> s5-0 7 x)))) - (set! (-> s5-0 7 y) (cos (* 0.5 (-> s5-0 7 x)))) + (set! (-> s5-0 7 z) (sin (/ (-> s5-0 7 x) 2))) + (set! (-> s5-0 7 y) (cos (/ (-> s5-0 7 x) 2))) (vector-rotate90-around-y! (the-as vector (-> s5-0 6)) (-> this spring-pos)) (vector-float*! (the-as vector (-> s5-0 6)) (the-as vector (-> s5-0 6)) (* -1.0 (-> s5-0 7 z))) (vector-rotate*! (the-as vector (-> s5-0 6)) (the-as vector (-> s5-0 6)) (the-as matrix (-> s5-0 2))) diff --git a/test/decompiler/reference/jak3/levels/desert/desert-dust-storm_REF.gc b/test/decompiler/reference/jak3/levels/desert/desert-dust-storm_REF.gc index ab595b77484..3e35fe92076 100644 --- a/test/decompiler/reference/jak3/levels/desert/desert-dust-storm_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/desert-dust-storm_REF.gc @@ -492,7 +492,7 @@ (set! f0-44 (+ 65536.0 f0-44)) ) (let* ((f0-46 (+ (* 5.0 f0-44) (* 5.0 (- (-> this current-wind-angle-speed))))) - (f1-23 (* 0.2 f0-46 f28-3)) + (f1-23 (* (/ f0-46 5) f28-3)) ) (+! (-> this current-wind-angle-speed) (* f1-23 (seconds-per-frame))) ) @@ -637,7 +637,7 @@ (vector+float*! s4-0 s4-0 (get-transv *target*) 0.2) ) (vector+float*! s4-0 s4-0 (-> (math-camera-matrix) fvec) 20480.0) - (let ((f30-4 (* 0.000061035156 (-> this stretch-val)))) + (let ((f30-4 (/ (-> this stretch-val) (meters 4)))) (set! (-> *part-id-table* 1421 init-specs 2 initial-valuef) (lerp 20480.0 61440.0 f30-4)) (set! (-> *part-id-table* 1422 init-specs 2 initial-valuef) (lerp 20480.0 61440.0 f30-4)) ) @@ -694,7 +694,7 @@ #t (let* ((f0-12 (vector-dot s5-2 (-> this fog-plane-dir))) (f0-13 (fmax 0.0 f0-12)) - (f1-5 (* 0.000016276043 f0-13)) + (f1-5 (/ f0-13 (meters 15))) (f0-15 (fmax 0.0 (fmin 1.0 f1-5))) ) (set! f28-0 (lerp (fmin 0.8 (-> this intensity)) (-> this intensity) f0-15)) @@ -751,7 +751,7 @@ (send-event *target* 'push-trans - (vector-float*! (new 'stack-no-clear 'vector) *duststorm-wind-vec* (* 0.02 *duststorm-wind-vel*)) + (vector-float*! (new 'stack-no-clear 'vector) *duststorm-wind-vec* (/ (the float *duststorm-wind-vel*) 50)) (seconds 0.11) ) ) @@ -826,7 +826,3 @@ (set! (-> *game-info* dust-storm) (the-as handle #f)) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/hover/des-beast-2_REF.gc b/test/decompiler/reference/jak3/levels/desert/hover/des-beast-2_REF.gc index 231241b26ad..d87cee5b1f0 100644 --- a/test/decompiler/reference/jak3/levels/desert/hover/des-beast-2_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/hover/des-beast-2_REF.gc @@ -43,9 +43,9 @@ (let ((v1-1 (the-as object (-> block param 0)))) (let ((a0-4 (-> self entity extra perm))) (logior! (-> a0-4 status) (entity-perm-status bit-5)) - (set! (-> a0-4 user-int16 0) (the int (* 0.00024414062 (-> (the-as vector v1-1) x)))) - (set! (-> a0-4 user-int16 1) (the int (* 0.00024414062 (-> (the-as vector v1-1) y)))) - (set! (-> a0-4 user-int16 2) (the int (* 0.00024414062 (-> (the-as vector v1-1) z)))) + (set! (-> a0-4 user-int16 0) (the int (/ (-> (the-as vector v1-1) x) METER_LENGTH))) + (set! (-> a0-4 user-int16 1) (the int (/ (-> (the-as vector v1-1) y) METER_LENGTH))) + (set! (-> a0-4 user-int16 2) (the int (/ (-> (the-as vector v1-1) z) METER_LENGTH))) ) (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) ) @@ -731,7 +731,7 @@ (vector+float*! gp-1 (-> s5-1 0) (-> s5-1 1) (-> s5-1 4 x)) 0 ) - (let ((f1-20 (* 0.000008138021 (-> s5-1 2 x)))) + (let ((f1-20 (/ (-> s5-1 2 x) (meters 30)))) (set! (-> gp-1 y) (fmin (+ 327680.0 (-> self root trans y)) (+ 20480.0 (* 9216.0 (* f1-20 f1-20)) (-> gp-1 y))) ) diff --git a/test/decompiler/reference/jak3/levels/desert/hover/des-beast_REF.gc b/test/decompiler/reference/jak3/levels/desert/hover/des-beast_REF.gc index 572d4701a5f..f45671072a1 100644 --- a/test/decompiler/reference/jak3/levels/desert/hover/des-beast_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/hover/des-beast_REF.gc @@ -2004,7 +2004,7 @@ (let ((f30-0 (lerp-scale 3276.8 0.0 (vector-vector-distance (camera-pos) (-> this root trans)) 81920.0 573440.0))) (when (!= f30-0 0.0) (activate! *camera-smush-control* f30-0 37 600 1.0 0.1 (-> *display* camera-clock)) - (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (* 0.00024414062 f30-0))) (seconds 0.2)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 (/ f30-0 METER_LENGTH))) (seconds 0.2)) ) ) ) @@ -2131,7 +2131,7 @@ (static-attack-info :mask (vehicle-impulse-factor) ((id (-> this attack-id)) (damage 2.0) (vehicle-damage-factor 0.01) - (vehicle-impulse-factor (* 0.00012207031 f30-2)) + (vehicle-impulse-factor (/ f30-2 (meters 2))) (attacker-velocity s3-4) ) ) diff --git a/test/decompiler/reference/jak3/levels/desert/hover/deshover-texture_REF.gc b/test/decompiler/reference/jak3/levels/desert/hover/deshover-texture_REF.gc index 954fb10018e..6fbac4f5cba 100644 --- a/test/decompiler/reference/jak3/levels/desert/hover/deshover-texture_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/hover/deshover-texture_REF.gc @@ -160,8 +160,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) @@ -207,7 +207,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/race/turtle-training_REF.gc b/test/decompiler/reference/jak3/levels/desert/race/turtle-training_REF.gc index 918c05d4790..3900f948272 100644 --- a/test/decompiler/reference/jak3/levels/desert/race/turtle-training_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/race/turtle-training_REF.gc @@ -310,7 +310,7 @@ (let ((v1-3 s5-0)) (set! (-> v1-3 height) (the float 70)) ) - (set! (-> s5-0 origin x) (the float (- 201 (the int (* 0.5 (-> s5-0 width)))))) + (set! (-> s5-0 origin x) (the float (- 201 (the int (/ (-> s5-0 width) 2))))) (set! (-> s5-0 origin y) 290.0) (set! (-> s5-0 flags) (font-flags shadow kerning middle-vert large)) (let ((s4-0 print-game-text)) diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc index 3606006b4c4..6959dddcf15 100644 --- a/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc @@ -1445,8 +1445,8 @@ (vector+float*! s4-0 (-> this root trans) s3-0 0.0) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) - (let* ((s5-1 (vector+float*! (new 'stack-no-clear 'vector) s4-0 s3-0 (* 0.5 f30-0))) - (s2-1 (vector+float*! (new 'stack-no-clear 'vector) s4-0 s3-0 (* -0.5 f30-0))) + (let* ((s5-1 (vector+float*! (new 'stack-no-clear 'vector) s4-0 s3-0 (/ f30-0 2))) + (s2-1 (vector+float*! (new 'stack-no-clear 'vector) s4-0 s3-0 (/ f30-0 -2))) (f28-0 (probe-ground this s5-1)) (f0-6 (probe-ground this s2-1)) ) @@ -1804,7 +1804,7 @@ ) (when (or (logtest? (-> self draw status) (draw-control-status on-screen)) (< f0-0 1024000.0)) 0.0 - (let* ((f0-1 (* 0.0000048828124 f0-0)) + (let* ((f0-1 (/ f0-0 (meters 50))) (f0-3 (fmax 1.0 (+ -2.0 f0-1))) ) (set! (-> self move-speed) (/ 245760.0 f0-3)) diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/neo-satellite_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/neo-satellite_REF.gc index f4916ef3556..549431c4423 100644 --- a/test/decompiler/reference/jak3/levels/desert/rescue/neo-satellite_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/rescue/neo-satellite_REF.gc @@ -2011,7 +2011,7 @@ ;; definition for method 201 of type neo-sat (defmethod neo-sat-method-201 ((this neo-sat)) (when (and (-> this next-state) (= (-> this next-state name) 'neo-sat-drill-prepare)) - (let ((f0-1 (* 0.000010172526 (-> this spin-current)))) + (let ((f0-1 (/ (-> this spin-current) (meters 24)))) (sound-play-by-name (static-sound-name "sat-hover") (-> this snd-hover) @@ -2507,7 +2507,7 @@ (set! (-> s2-3 y) 0.0) (vector-normalize! s2-3 1.0) (let* ((f0-23 (acos (vector-dot s2-3 s3-0))) - (f0-24 (* 0.000030517578 f0-23)) + (f0-24 (/ f0-23 (meters 8))) (f22-0 (- 1.0 f0-24)) (f1-10 (+ (lerp 0.0 0.75 (* f22-0 f22-0)) (lerp -0.25 0.25 f26-1))) (f24-1 (fmax 0.0 (fmin 1.0 f1-10))) @@ -2715,7 +2715,7 @@ (seconds-per-frame) ) ) - (f0-11 (* 0.05 f0-10)) + (f0-11 (/ f0-10 20)) ) (+! (-> this spin-speed) f0-11) ) @@ -2973,7 +2973,7 @@ ) (vector+float*! s1-0 (-> this shockwave-origin) s0-0 f28-1) (set! (-> s1-0 y) (neo-sat-method-218 this s1-0)) - (set! (-> *part-id-table* 1679 init-specs 3 initial-valuef) (lerp 409.6 2457.6 (* 0.0000061035157 f28-1))) + (set! (-> *part-id-table* 1679 init-specs 3 initial-valuef) (lerp 409.6 2457.6 (/ f28-1 (meters 40)))) (let* ((f26-2 (-> *part-id-table* 1679 init-specs 3 initial-valuef)) (f24-1 1.0) (v1-41 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -3966,12 +3966,12 @@ ;; definition for method 215 of type neo-sat (defmethod neo-sat-method-215 ((this neo-sat) (arg0 float)) - (* 0.000108506945 arg0) + (/ arg0 9216) ) ;; definition for method 216 of type neo-sat (defmethod neo-sat-method-216 ((this neo-sat) (arg0 float)) - (* 0.000108506945 arg0) + (/ arg0 9216) ) ;; definition for method 213 of type neo-sat @@ -4447,7 +4447,3 @@ (the-as search-info-flag v0-0) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc index afb95280c41..bc295e03c31 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc @@ -258,7 +258,7 @@ (-> s5-1 2 trans) (-> (the-as process-drawable s4-0) root trans) (-> s5-1 2 uvec) - (* 0.5 (-> s5-1 3 uvec y)) + (/ (-> s5-1 3 uvec y) 2) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-marauder_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-marauder_REF.gc index 558a8223fef..953349a7bb2 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-marauder_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-marauder_REF.gc @@ -141,7 +141,7 @@ (let ((s5-0 (-> this target-status))) (when (< 122880.0 (vector-vector-distance (-> s5-0 position) (-> this root trans))) (let ((f1-0 (vector-length (-> s5-0 velocity)))) - (set! (-> this turret-control inaccuracy) (* (-> this inaccuracy-factor) (fmax 1.0 (* 0.000012207031 f1-0)))) + (set! (-> this turret-control inaccuracy) (* (-> this inaccuracy-factor) (fmax 1.0 (/ f1-0 (meters 20))))) ) (turret-control-method-11 (-> this turret-control) this (-> s5-0 position) (-> s5-0 velocity)) ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-mirage_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-mirage_REF.gc index 6b882f8e837..3d6a09becc8 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-mirage_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-mirage_REF.gc @@ -92,7 +92,7 @@ (set! (-> gp-1 vec11 w) (fmax 0.1 (/ (-> gp-1 vec11 x) (fmax 4096.0 (- (-> gp-1 vec11 y)))))) (set! (-> gp-1 vec11 z) (+ (-> gp-1 vec6 y) (* (-> gp-1 vec11 w) (-> gp-1 vec7 y)))) (set! (-> gp-1 vec4 y) (+ (* (/ 1.0 (-> gp-1 vec11 w)) (- (-> gp-1 vec11 z) (-> gp-1 vec0 y))) - (* 0.5 (-> gp-1 vec11 w) (-> gp-1 vec10 w)) + (* (/ (-> gp-1 vec11 w) 2) (-> gp-1 vec10 w)) ) ) (set! (-> gp-1 vec4 y) (* (-> gp-1 vec4 y) (/ 1.0 (fmax 0.1 (-> gp-1 mat0 uvec y))))) @@ -238,7 +238,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-projectiles_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-projectiles_REF.gc index 42484821925..11e5cb16997 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-projectiles_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-projectiles_REF.gc @@ -358,7 +358,7 @@ (launch-particles (-> *part-id-table* 981) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000008138021 f30-0)) + (f26-0 (/ f30-0 (meters 30))) (f30-1 (-> *part-id-table* 982 init-specs 3 initial-valuef)) (f28-0 (-> *part-id-table* 982 init-specs 5 initial-valuef)) ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-rhino_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-rhino_REF.gc index c778987e586..3ab630ade07 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-rhino_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-rhino_REF.gc @@ -197,7 +197,7 @@ (not (-> *setting-control* cam-current entity-name)) ) ) - (activate! *camera-smush-control* (fmin 1331.2 (* 0.5 f0-0)) 120 360 1.0 0.9 (-> *display* camera-clock)) + (activate! *camera-smush-control* (fmin 1331.2 (/ f0-0 2)) 120 360 1.0 0.9 (-> *display* camera-clock)) ) ) ((method-of-type wcar-base vehicle-method-94) this) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-scorpion_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-scorpion_REF.gc index 0a91086c6ad..a4309a56879 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-scorpion_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-scorpion_REF.gc @@ -223,7 +223,7 @@ (defmethod vehicle-method-94 ((this v-scorpion)) (let ((f0-0 (vector-length (-> this lin-acceleration)))) (if (and (< 327680.0 f0-0) (not (logtest? (-> this controls flags) (vehicle-controls-flag vcf0)))) - (activate! *camera-smush-control* (fmin 2048.0 (* 0.5 f0-0)) 60 210 1.0 0.9 (-> *display* camera-clock)) + (activate! *camera-smush-control* (fmin 2048.0 (/ f0-0 2)) 60 210 1.0 0.9 (-> *display* camera-clock)) ) ) ((method-of-type wcar-base vehicle-method-94) this) @@ -296,11 +296,11 @@ ) 0 (let ((v1-44 (-> this jmod-shock-mids s4-1))) - (set! (-> v1-44 transform trans y) (* -0.5 (-> s5-1 ground-pos z) (-> s3-0 x-scale))) + (set! (-> v1-44 transform trans y) (* (/ (-> s5-1 ground-pos z) -2) (-> s3-0 x-scale))) ) 0 (let ((v1-48 (-> this jmod-shock-bots s4-1))) - (set! (-> v1-48 transform trans y) (* -1.0 (+ -2048.0 (* 0.5 (-> s5-1 ground-pos z))) (-> s3-0 x-scale))) + (set! (-> v1-48 transform trans y) (* -1.0 (+ -2048.0 (/ (-> s5-1 ground-pos z) 2)) (-> s3-0 x-scale))) ) ) 0 diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-toad_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-toad_REF.gc index d798df4027a..9cdfe8831a3 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-toad_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-toad_REF.gc @@ -101,7 +101,7 @@ (set! (-> gp-1 vec11 w) (fmax 0.1 (/ (-> gp-1 vec11 x) (fmax 4096.0 (- (-> gp-1 vec11 y)))))) (set! (-> gp-1 vec11 z) (+ (-> gp-1 vec6 y) (* (-> gp-1 vec11 w) (-> gp-1 vec7 y)))) (set! (-> gp-1 vec4 y) (+ (* (/ 1.0 (-> gp-1 vec11 w)) (- (-> gp-1 vec11 z) (-> gp-1 vec0 y))) - (* 0.5 (-> gp-1 vec11 w) (-> gp-1 vec10 w)) + (* (/ (-> gp-1 vec11 w) 2) (-> gp-1 vec10 w)) ) ) (set! (-> gp-1 vec4 y) (* (-> gp-1 vec4 y) (/ 1.0 (fmax 0.1 (-> gp-1 mat0 uvec y))))) @@ -311,7 +311,7 @@ (set! (-> gp-0 wsphere z) 13590.528) (set! (-> gp-0 wsphere r) 0.0) (set! (-> gp-0 friction-coef) - (+ (-> gp-0 wsphere r) (* 2.0 (asin (/ (* 0.5 (-> arg1 travel)) (-> gp-0 wsphere z))))) + (+ (-> gp-0 wsphere r) (* 2.0 (asin (/ (/ (-> arg1 travel) 2) (-> gp-0 wsphere z))))) ) (set! (-> gp-0 steering-axis quad) (-> (new 'static 'vector :x 10649.6 :y 2662.4 :z 7618.56 :w 1.0) quad)) (set-vector! @@ -540,7 +540,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-turtle_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-turtle_REF.gc index 95196686620..df17bbc67c5 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-turtle_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-turtle_REF.gc @@ -172,7 +172,7 @@ (-> this spring-vel) (-> this spring-vel) (-> s5-1 mat fvec) - (* -0.00024414062 (-> s5-1 mat trans x)) + (/ (-> s5-1 mat trans x) (meters -1)) ) (set! (-> s5-1 mat trans y) 500.0) (set! (-> s5-1 mat trans z) 5.0) @@ -207,8 +207,8 @@ (quaternion-conjugate! (-> s5-2 quat1) (-> this root quat)) (quaternion->matrix (-> s5-2 mat0) (-> s5-2 quat1)) (set! (-> s5-2 float0) 8192.0) - (set! (-> s5-2 float2) (sin (* 0.5 (-> s5-2 float0)))) - (set! (-> s5-2 float1) (cos (* 0.5 (-> s5-2 float0)))) + (set! (-> s5-2 float2) (sin (/ (-> s5-2 float0) 2))) + (set! (-> s5-2 float1) (cos (/ (-> s5-2 float0) 2))) (vector-rotate90-around-y! (-> s5-2 vec0) (-> this spring-pos)) (vector-float*! (-> s5-2 vec0) (-> s5-2 vec0) (* -1.0 (-> s5-2 float2))) (vector-rotate*! (-> s5-2 vec0) (-> s5-2 vec0) (-> s5-2 mat0)) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-ai_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-ai_REF.gc index da02febddb2..8dda8e7074f 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-ai_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-ai_REF.gc @@ -168,7 +168,7 @@ (vector-! (-> gp-0 world-normal) (-> gp-0 axis) (-> gp-0 p-body)) (vector-normalize! (-> gp-0 world-normal) 1.0) (vector+float*! (-> gp-0 velocity) (the-as vector (-> gp-0 mat)) (-> gp-0 world-normal) 163840.0) - (set! (-> gp-0 wheel-axis x) (* 0.5 (-> gp-0 wheel-axis x))) + (set! (-> gp-0 wheel-axis x) (/ (-> gp-0 wheel-axis x) 2)) 0 ) ) @@ -272,7 +272,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-hud_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-hud_REF.gc index 89339c23d11..a25a84e38f7 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-hud_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-hud_REF.gc @@ -42,7 +42,7 @@ ) (else (set! (-> a1-3 tid) (the-as texture-id (-> this tex-off))) - (set! (-> a1-3 color w) (the int (* 0.5 f0-7))) + (set! (-> a1-3 color w) (the int (/ f0-7 2))) ) ) ) @@ -111,7 +111,3 @@ (the-as hud-vehicle-turbo gp-0) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc index e961d48cce9..389f8dd9fa3 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc @@ -305,7 +305,9 @@ ) ) (f1-29 - (/ (* 0.5 (-> s2-1 inertia) (-> s2-1 forward-slip-vel)) (* arg0 (-> arg1 probe-work-array 0 world-normal y))) + (/ (* (/ (-> s2-1 inertia) 2) (-> s2-1 forward-slip-vel)) + (* arg0 (-> arg1 probe-work-array 0 world-normal y)) + ) ) ) (if (logtest? (-> s1-1 flags) (vehicle-wheel-flag vwf0)) @@ -335,7 +337,7 @@ ) ) (if (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) - (set! f0-57 (* 0.05 f0-57)) + (set! f0-57 (/ f0-57 20)) ) (+! (-> arg1 probe-work-array 0 ground-pos y) f0-57) ) @@ -425,7 +427,7 @@ (vector-rotate*! (-> arg1 normal) (-> arg1 normal) (-> sv-16 inv-i-world)) (vector-cross! (-> arg1 normal) (-> arg1 normal) (-> arg1 tmp)) (set! (-> arg1 probe-work-array 0 world-normal z) - (/ (* -0.5 (-> s1-2 side-vel)) + (/ (/ (-> s1-2 side-vel) -2) (* arg0 (+ (-> sv-16 info inv-mass) (vector-dot (the-as vector (-> arg1 probe-work-array)) (-> arg1 normal)))) ) ) @@ -437,7 +439,7 @@ (vector-rotate*! (-> arg1 normal) (-> arg1 normal) (-> sv-16 inv-i-world)) (vector-cross! (-> arg1 normal) (-> arg1 normal) (-> arg1 tmp)) (let ((f0-94 - (/ (* -0.25 (-> s1-2 forward-slip-vel)) + (/ (/ (-> s1-2 forward-slip-vel) -4) (* arg0 (+ (-> sv-16 info inv-mass) (vector-dot (the-as vector (&-> arg1 impulse)) (-> arg1 normal)))) ) ) @@ -619,7 +621,7 @@ ) (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) (vector-reset! (-> gp-0 force)) - (set! (-> gp-0 force y) (* -0.5 (-> s4-0 extra gravity) (-> s4-0 info mass))) + (set! (-> gp-0 force y) (* (/ (-> s4-0 extra gravity) -2) (-> s4-0 info mass))) (rigid-body-control-method-22 s5-0 (-> gp-0 world-pos) (-> gp-0 force)) ) ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc index 4c189d7090f..ee1769c0e5b 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc @@ -113,7 +113,7 @@ (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) - (set! (-> gp-2 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-2 scale) (/ (-> self draw bounds w) 11264)) (set! (-> gp-2 group) (-> *part-group-id-table* (-> self info explosion-part))) (set! (-> gp-2 collide-with) (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) @@ -171,7 +171,7 @@ (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 4096.0) - (set! (-> gp-0 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-0 scale) (/ (-> self draw bounds w) 11264)) (set! (-> gp-0 group) (-> *part-group-id-table* (-> self info explosion-part))) (set! (-> gp-0 collide-with) (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc index 96cbb741ddc..c6169efd3c0 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc @@ -756,13 +756,13 @@ (when (< 18.204445 (fabs (-> s5-0 0 fvec z))) (cond ((logtest? (-> s4-0 physics-model rear-wheel flags) (vehicle-wheel-flag vwf4)) - (set! (-> s5-0 1 rvec w) (/ (* 0.5 (-> s5-0 1 uvec z)) (sin (fabs (-> s5-0 0 fvec z))))) + (set! (-> s5-0 1 rvec w) (/ (/ (-> s5-0 1 uvec z) 2) (sin (fabs (-> s5-0 0 fvec z))))) (let ((f0-32 (- (* (-> s5-0 1 rvec w) (cos (fabs (-> s5-0 0 fvec z)))) (* 2.0 (+ (-> s4-0 physics-model rear-wheel local-pos x) (-> s4-0 physics-model rear-wheel susp-arm-length))) ) ) - (f1-22 (* 0.5 (-> s5-0 1 uvec z))) + (f1-22 (/ (-> s5-0 1 uvec z) 2)) ) (set! (-> s5-0 1 rvec z) (sqrtf (+ (* f1-22 f1-22) (* f0-32 f0-32)))) ) @@ -775,7 +775,7 @@ (- (-> s5-0 1 rvec w) (+ (-> s4-0 physics-model front-wheel local-pos x) (-> s4-0 physics-model front-wheel susp-arm-length) - (* -0.5 (-> s5-0 1 uvec y)) + (/ (-> s5-0 1 uvec y) -2) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/factory/car/hvehicle-physics_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/hvehicle-physics_REF.gc index 838dc38663a..6589e7e0f43 100644 --- a/test/decompiler/reference/jak3/levels/factory/car/hvehicle-physics_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/car/hvehicle-physics_REF.gc @@ -184,8 +184,8 @@ (let ((f1-20 (fmax 0.0 f0-38))) (+! (-> this lift-thrust s2-1) f1-20) (when (logtest? (vehicle-flag flight-level-transition) (-> this v-flags)) - (+! (-> this roll-thrust 0) (* 0.05 f1-20)) - (+! (-> this roll-thrust 1) (* 0.05 f1-20)) + (+! (-> this roll-thrust 0) (/ f1-20 20)) + (+! (-> this roll-thrust 1) (/ f1-20 20)) ) ) (vector-reset! (-> arg1 force)) @@ -202,7 +202,7 @@ (and (> (-> this flight-level-index) 0) (< f0-40 0.0) (< (-> arg1 velocity y) 0.0)) ) (vector-reset! (-> arg1 force)) - (let ((f0-43 (* -0.25 (-> this info physics-model inv-lift-thruster-count))) + (let ((f0-43 (/ (-> this info physics-model inv-lift-thruster-count) -4)) (f1-28 arg0) ) (set! (-> arg1 force y) (* f0-43 (/ 1.0 f1-28) (-> this info info mass) (-> arg1 velocity y))) @@ -305,7 +305,7 @@ ) ) ) - (set! (-> arg1 impulse) (/ (* -0.5 (-> arg1 vel-dot-norm)) + (set! (-> arg1 impulse) (/ (/ (-> arg1 vel-dot-norm) -2) (* arg0 (+ (-> s3-0 info inv-mass) (vector-dot (-> arg1 normal) (-> arg1 tmp)))) ) ) @@ -598,7 +598,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/car/hvehicle-util_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/hvehicle-util_REF.gc index 05312aac36a..63abc5041c7 100644 --- a/test/decompiler/reference/jak3/levels/factory/car/hvehicle-util_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/car/hvehicle-util_REF.gc @@ -307,7 +307,7 @@ (let* ((v1-1 (-> this rbody lin-velocity)) (f0-4 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) (f0-6 (/ (- arg0 f0-4) arg0)) - (f1-6 (* 0.005 f0-6)) + (f1-6 (/ f0-6 200)) ) (set! (-> this controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> this controls throttle) f1-6)))) ) diff --git a/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc index 6f3453383ac..afda55cf4c1 100644 --- a/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc @@ -935,7 +935,7 @@ (cond ((< f0-9 (* f1-8 f1-8)) (let ((f0-10 (vector-length (-> this root transv)))) - (seek! (-> this engine-power-factor) (* 0.000016276043 f0-10) (* 6.0 (seconds-per-frame))) + (seek! (-> this engine-power-factor) (/ f0-10 (meters 15)) (* 6.0 (seconds-per-frame))) ) (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag sounds) (-> this v-flags)))) (rigid-body-object-method-38 this) @@ -1088,7 +1088,7 @@ (set! (-> this outgoing-attack-id) a0-18) ) ) - (let ((f0-11 (+ 0.5 (* 0.000024414063 (-> s5-0 mat trans x))))) + (let ((f0-11 (+ 0.5 (/ (-> s5-0 mat trans x) (meters 10))))) (when (send-event arg0 'attack @@ -1288,7 +1288,7 @@ (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) - (set! (-> gp-2 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-2 scale) (/ (-> self draw bounds w) 11264)) (set! (-> gp-2 group) (-> *part-group-id-table* (-> self info explosion-part))) (set! (-> gp-2 collide-with) (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) diff --git a/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc index 51c62ed6256..1da12a0ef55 100644 --- a/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc @@ -216,7 +216,7 @@ (let ((f0-0 (vector-length (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0))) (gp-1 (-> self sight-scale)) ) - (set! (-> gp-1 z) (* 0.000024414063 f0-0)) + (set! (-> gp-1 z) (/ f0-0 (meters 10))) (let ((f0-1 (lerp-scale 0.1 6.0 f0-0 61440.0 163840.0))) (set! (-> gp-1 x) f0-1) (set! (-> gp-1 y) f0-1) @@ -668,7 +668,7 @@ (let* ((f0-28 (fmax -16384.0 (fmin 16384.0 (- 16384.0 (acos (- (vector-dot gp-2 *y-vector*))))))) (f2-1 (- (-> self gun-elev-cam) f0-28)) (f1-12 (if (< f2-1 0.0) - (fmin 3640.889 (* (fabs (* 0.1 f2-1)) (-> self clock frames-per-second))) + (fmin 3640.889 (* (fabs (/ f2-1 10)) (-> self clock frames-per-second))) 910.2222 ) ) diff --git a/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc index 391ebd0e4e9..f6aa3c7d5dd 100644 --- a/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc @@ -419,7 +419,7 @@ (f1-13 (- 1.0 f0-32)) ) 0.0 - (when (and (or (< f0-32 f26-0) (< f26-0 f1-13)) (time-elapsed? (-> self buzz-timer) (the int (* 0.5 f28-1)))) + (when (and (or (< f0-32 f26-0) (< f26-0 f1-13)) (time-elapsed? (-> self buzz-timer) (the int (/ f28-1 2)))) (let* ((gp-1 *target*) (a0-37 (if (type? gp-1 process-focusable) gp-1 diff --git a/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc index f77749884f5..14922c9a08e 100644 --- a/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc @@ -879,7 +879,7 @@ (static-sound-name "gtower-openloop") (-> this rotate-sound) 1024 - (the int (* 1524.0 (+ 1.0 (* 0.00001 (-> this yawvel))))) + (the int (* 1524.0 (+ 1.0 (/ (-> this yawvel) 100000)))) 0 (sound-group) (-> this root trans) @@ -887,8 +887,8 @@ (sound-play-by-name (static-sound-name "gtower-blade") (-> this blade-sound) - (the int (* 1024.0 (fmax 0.0 (fmin 0.5 (* 0.00001 (-> this yawvel)))))) - (the int (* 1524.0 (+ 1.3 (* 0.00001 (-> this yawvel))))) + (the int (* 1024.0 (fmax 0.0 (fmin 0.5 (/ (-> this yawvel) 100000))))) + (the int (* 1524.0 (+ 1.3 (/ (-> this yawvel) 100000)))) 0 (sound-group) (-> this root trans) diff --git a/test/decompiler/reference/jak3/levels/factory/factory-boss-states_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-boss-states_REF.gc index 918f32805b7..2389d1d7dd7 100644 --- a/test/decompiler/reference/jak3/levels/factory/factory-boss-states_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/factory-boss-states_REF.gc @@ -95,9 +95,9 @@ (quaternion-set! (-> self root quat) 0.0 - (sin (* 0.5 (-> self root-angle))) + (sin (/ (-> self root-angle) 2)) 0.0 - (cos (* 0.5 (-> self root-angle))) + (cos (/ (-> self root-angle) 2)) ) (none) ) @@ -1860,7 +1860,3 @@ ) :code sleep-code ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc index aa143346e83..490309f1021 100644 --- a/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc @@ -827,7 +827,7 @@ (vector-normalize! s4-0 1.0) (vector-! s3-0 s2-0 (-> this pvel)) (set! (-> this pvel quad) (-> s2-0 quad)) - (vector-float*! s3-0 s3-0 (* 0.000016276043 f28-0)) + (vector-float*! s3-0 s3-0 (/ f28-0 (meters 15))) (cond ((< 0.0 (-> this blendpath)) (let ((v1-52 (new 'stack-no-clear 'vector))) diff --git a/test/decompiler/reference/jak3/levels/factory/ffight-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/ffight-projectile_REF.gc index 8de0ddfb790..e7c0c7a1aa0 100644 --- a/test/decompiler/reference/jak3/levels/factory/ffight-projectile_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/ffight-projectile_REF.gc @@ -393,7 +393,7 @@ (launch-particles (-> *part-id-table* 2853) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f28-1 (* 0.000015258789 f30-0)) + (f28-1 (/ f30-0 (meters 16))) (f30-1 (-> *part-id-table* 2854 init-specs 3 initial-valuef)) ) (-> *part-id-table* 2854 init-specs 4 initial-valuef) diff --git a/test/decompiler/reference/jak3/levels/factory/ftank-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/ftank-projectile_REF.gc index 7c59935fa39..44578309558 100644 --- a/test/decompiler/reference/jak3/levels/factory/ftank-projectile_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/ftank-projectile_REF.gc @@ -320,7 +320,7 @@ (launch-particles (-> *part-id-table* 2868) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f28-1 (* 0.000015258789 f30-0)) + (f28-1 (/ f30-0 (meters 16))) (f30-1 (-> *part-id-table* 2869 init-specs 3 initial-valuef)) ) (-> *part-id-table* 2869 init-specs 4 initial-valuef) @@ -668,7 +668,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/fturret-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/fturret-projectile_REF.gc index d5ad2640e3c..e459db8428b 100644 --- a/test/decompiler/reference/jak3/levels/factory/fturret-projectile_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fturret-projectile_REF.gc @@ -431,7 +431,7 @@ (launch-particles (-> *part-id-table* 2880) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000027126736 f30-0)) + (f26-0 (/ f30-0 (meters 9))) (f30-1 (-> *part-id-table* 2881 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 2881 init-specs 4 initial-valuef)) ) @@ -755,7 +755,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc b/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc index 4447262ddd2..ea524b12a2b 100644 --- a/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc @@ -547,13 +547,13 @@ ) ((< arg0 1638400.0) (let ((f0-15 (- 1.0 (* 0.0000034877232 (- 1638400.0 arg0))))) - (set! (-> v0-0 x) (+ 1.0 (* -0.5 f0-15))) + (set! (-> v0-0 x) (+ 1.0 (/ f0-15 -2))) (set! (-> v0-0 y) (+ 1.0 (* 0.0 f0-15))) ) ) ((< arg0 1761280.0) (let ((f0-20 (- 1.0 (* 0.000008138021 (- 1761280.0 arg0))))) - (set! (-> v0-0 x) (+ 0.5 (* -0.5 f0-20))) + (set! (-> v0-0 x) (+ 0.5 (/ f0-20 -2))) (set! (-> v0-0 y) (+ 1.0 (* 0.0 f0-20))) ) ) @@ -826,7 +826,7 @@ (t9-0 this) ) 0.0 - (let ((f0-2 (+ 1.0 (fmax 0.0 (fmin 1.0 (* 0.0000024414062 (-> this speed))))))) + (let ((f0-2 (+ 1.0 (fmax 0.0 (fmin 1.0 (/ (-> this speed) (meters 100))))))) (sound-play-by-name (static-sound-name "hellcat-engine") (-> this engine-sound) @@ -870,7 +870,7 @@ (static-sound-name "hellcat-bank") (-> this wind-noise-sound) (the int (* 1024.0 (-> this wind))) - (the int (* 1524.0 (+ 0.7 (* 0.25 (-> this wind))))) + (the int (* 1524.0 (+ 0.7 (/ (-> this wind) 4)))) 0 (sound-group) (-> this root trans) @@ -1274,7 +1274,7 @@ (set! (-> s5-0 z) (fabs (-> s5-0 z))) 0.0 (let* ((f1-1 (atan (-> s2-0 x) (- (-> s2-0 z)))) - (f30-0 (fmax -1.0 (fmin 1.0 (* 0.000030517578 f1-1)))) + (f30-0 (fmax -1.0 (fmin 1.0 (/ f1-1 (meters 8))))) ) (matrix-transpose! s3-0 (-> this rbody matrix)) (vector-rotate*! arg0 (-> this forward) s3-0) @@ -1414,7 +1414,7 @@ (set-vector! s3-0 4096.0 0.0 0.0 1.0) 0.0 (let ((s1-2 (new 'stack-no-clear 'matrix))) - (let ((f0-76 (* 16384.0 (fmax -1.0 (fmin 1.0 (* 0.0000000012207031 (-> this rbody ang-velocity y) (fabs f30-1)))))) + (let ((f0-76 (* 16384.0 (fmax -1.0 (fmin 1.0 (* (/ (-> this rbody ang-velocity y) (meters 200000)) (fabs f30-1)))))) ) (matrix-rotate-y! s1-2 f0-76) ) @@ -1670,7 +1670,7 @@ (set! (-> this outgoing-attack-id) a0-18) ) ) - (let ((f0-10 (+ 0.5 (* 0.000024414063 (-> s5-0 impulse))))) + (let ((f0-10 (+ 0.5 (/ (-> s5-0 impulse) (meters 10))))) (when (send-event arg0 'attack diff --git a/test/decompiler/reference/jak3/levels/factory/missile-bot_REF.gc b/test/decompiler/reference/jak3/levels/factory/missile-bot_REF.gc index 3191a582f26..3c1b71eed09 100644 --- a/test/decompiler/reference/jak3/levels/factory/missile-bot_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/missile-bot_REF.gc @@ -596,7 +596,7 @@ ) (vector-! gp-0 gp-0 (-> self root trans)) (let* ((f0-2 (vector-length gp-0)) - (f30-0 (fmin 16384.0 (* 0.2 f0-2))) + (f30-0 (fmin 16384.0 (/ f0-2 5))) (f0-3 (missile-bot-get-kick-time f0-2)) ) (vector+! gp-0 gp-0 (-> self root trans)) @@ -1366,7 +1366,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc index 9109d5d16dc..a6cd648644a 100644 --- a/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc @@ -485,7 +485,7 @@ (warf-projectile-method-42 this s3-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix))) - (fmin 1.0 (* 0.0000061035157 f30-0)) + (fmin 1.0 (/ f30-0 (meters 40))) (-> *part-id-table* 2895 init-specs 3 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) (set! (-> s4-1 trans quad) (-> gp-0 quad)) @@ -1150,7 +1150,7 @@ (launch-part this s3-0) ) (let ((s3-1 (new 'stack-no-clear 'matrix)) - (f30-1 (fmin 1.0 (* 0.000008138021 f30-0))) + (f30-1 (fmin 1.0 (/ f30-0 (meters 30)))) (f28-0 (-> *part-id-table* 2895 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-1 s4-1 *up-vector*) diff --git a/test/decompiler/reference/jak3/levels/forest/for-turret-shot_REF.gc b/test/decompiler/reference/jak3/levels/forest/for-turret-shot_REF.gc index 575ca2a54f1..4b4a031b636 100644 --- a/test/decompiler/reference/jak3/levels/forest/for-turret-shot_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/for-turret-shot_REF.gc @@ -407,7 +407,7 @@ (launch-particles (-> *part-id-table* 1066) s4-0) ) (let ((s4-1 (new 'stack-no-clear 'matrix)) - (f26-0 (* 0.000008138021 f30-0)) + (f26-0 (/ f30-0 (meters 30))) (f30-1 (-> *part-id-table* 1067 init-specs 3 initial-valuef)) (f28-1 (-> *part-id-table* 1067 init-specs 5 initial-valuef)) ) @@ -631,7 +631,3 @@ (the-as (pointer for-turret-shot) (spawn-projectile for-turret-shot gp-0 arg0 *default-dead-pool*)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/forest/for-turret_REF.gc b/test/decompiler/reference/jak3/levels/forest/for-turret_REF.gc index 0ff76b3e511..1321ab5e78e 100644 --- a/test/decompiler/reference/jak3/levels/forest/for-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/for-turret_REF.gc @@ -302,7 +302,7 @@ ) (vector-cvt.w.s! (the-as vector (-> this sprites 28 color-ptr)) sv-312) (set! (-> this sprites 28 color w) - (the int (* 0.0078125 (-> this fade-interp) (lerp-scale 0.0 128.0 f30-0 1820.4445 3640.889))) + (the int (* (/ (-> this fade-interp) 128) (lerp-scale 0.0 128.0 f30-0 1820.4445 3640.889))) ) ) (let ((s2-6 set-as-offset-from!) diff --git a/test/decompiler/reference/jak3/levels/forest/foresta-obs_REF.gc b/test/decompiler/reference/jak3/levels/forest/foresta-obs_REF.gc index 42c2b6cb88c..aee12b580b7 100644 --- a/test/decompiler/reference/jak3/levels/forest/foresta-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/foresta-obs_REF.gc @@ -622,7 +622,7 @@ (let ((f0-7 1.0)) (let ((f1-3 (- (-> self extend-height) (-> self root trans y)))) (if (< f1-3 4096.0) - (set! f0-7 (* 0.00024414062 f1-3)) + (set! f0-7 (/ f1-3 METER_LENGTH)) ) ) (sound-play-by-name diff --git a/test/decompiler/reference/jak3/levels/glider/glider-manager_REF.gc b/test/decompiler/reference/jak3/levels/glider/glider-manager_REF.gc index ccf40949ef8..7bb11f87b75 100644 --- a/test/decompiler/reference/jak3/levels/glider/glider-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/glider/glider-manager_REF.gc @@ -1155,7 +1155,7 @@ (b! (not s3-1) cfg-86 :delay (nop!)) (let ((f0-16 (vector-vector-xz-distance (-> s3-1 rbody matrix trans) (-> s5-2 pos)))) (let ((f1-1 (- (-> s3-1 rbody matrix trans y) (-> s5-2 pos y)))) - (if (< (* 0.5 (-> s5-2 hheight)) f1-1) + (if (< (/ (-> s5-2 hheight) 2) f1-1) (set! (-> s5-2 hheight) (* 2.0 f1-1)) ) ) @@ -1165,7 +1165,7 @@ (when (not (cpad-hold? 0 r2)) (vector+! s4-3 (-> s3-1 rbody matrix trans) (-> s5-2 pos)) (vector-float*! (-> s5-2 pos) s4-3 0.5) - (set! (-> s5-2 pos w) (* 0.5 f0-16)) + (set! (-> s5-2 pos w) (/ f0-16 2)) (set! (-> s5-2 thermal-time) (- (current-time) (-> this thermal-start-time))) (set! (-> this creating-thermal?) #f) ) @@ -1282,10 +1282,10 @@ (set! (-> arg0 min-thermal-time) (-> s3-0 thermal-time)) (set! (-> this last-active-thermal) s2-0) ) - (if (< (-> s4-1 y) (- (+ (-> s3-0 pos y) (-> s3-0 hheight)) (* 0.5 (-> s3-0 hheight)))) + (if (< (-> s4-1 y) (- (+ (-> s3-0 pos y) (-> s3-0 hheight)) (/ (-> s3-0 hheight) 2))) (set! (-> arg0 thermal-strength) 1.0) (set! (-> arg0 thermal-strength) - (/ (- (+ (-> s3-0 pos y) (-> s3-0 hheight)) (-> s4-1 y)) (* 0.5 (-> s3-0 hheight))) + (/ (- (+ (-> s3-0 pos y) (-> s3-0 hheight)) (-> s4-1 y)) (/ (-> s3-0 hheight) 2)) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/glider/h-glider_REF.gc b/test/decompiler/reference/jak3/levels/glider/h-glider_REF.gc index 4a8005992bb..de010fd2f5e 100644 --- a/test/decompiler/reference/jak3/levels/glider/h-glider_REF.gc +++ b/test/decompiler/reference/jak3/levels/glider/h-glider_REF.gc @@ -1013,7 +1013,7 @@ (set-vector! s3-0 4096.0 0.0 0.0 1.0) 0.0 (let ((s1-3 (new 'stack-no-clear 'matrix))) - (let ((f0-56 (* 16384.0 (fmax -1.0 (fmin 1.0 (* 0.0000000012207031 (-> this rbody ang-velocity y) (fabs f30-2)))))) + (let ((f0-56 (* 16384.0 (fmax -1.0 (fmin 1.0 (* (/ (-> this rbody ang-velocity y) (meters 200000)) (fabs f30-2)))))) ) (matrix-rotate-y! s1-3 f0-56) ) diff --git a/test/decompiler/reference/jak3/levels/hiphog/ltnfxhip-texture_REF.gc b/test/decompiler/reference/jak3/levels/hiphog/ltnfxhip-texture_REF.gc index b772fef9b24..2f93cb24d36 100644 --- a/test/decompiler/reference/jak3/levels/hiphog/ltnfxhip-texture_REF.gc +++ b/test/decompiler/reference/jak3/levels/hiphog/ltnfxhip-texture_REF.gc @@ -160,8 +160,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) @@ -207,7 +207,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc b/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc index a927ca337e1..12548fea1db 100644 --- a/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc +++ b/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc @@ -963,7 +963,7 @@ (cspace<-parented-transformq-joint! arg0 arg1) (dotimes (s4-0 (length *dark-eco-tower-waves*)) (let* ((s3-0 (-> *dark-eco-tower-waves* s4-0)) - (f0-2 (- (* 0.000012207031 (-> arg0 bone transform trans y)) + (f0-2 (- (/ (-> arg0 bone transform trans y) (meters 20)) (* 0.0033333334 (the float (current-time)) (-> s3-0 freq)) ) ) diff --git a/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc b/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc index 55220c63358..ada9d697e07 100644 --- a/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc @@ -1774,7 +1774,7 @@ :event enemy-event-handler :enter (behavior () (set! (-> self move-speed) (vector-length (-> self root transv))) - (set! (-> self move-decel) (fmax 163840.0 (* 0.00012207031 (-> self move-speed) (-> self move-speed)))) + (set! (-> self move-decel) (fmax 163840.0 (* (/ (-> self move-speed) (meters 2)) (-> self move-speed)))) (set-time! (-> self state-time)) ) :trans (behavior () @@ -2124,7 +2124,7 @@ ) (set! (-> a0-2 0 quad) (-> s3-0 trans quad)) (set! (-> a0-2 0 w) - (+ 409.6 sv-560 (sqrtf (+ (* 25600.0 (-> gp-0 scale) (-> gp-0 scale)) (* 0.25 f30-0 f30-0)))) + (+ 409.6 sv-560 (sqrtf (+ (* 25600.0 (-> gp-0 scale) (-> gp-0 scale)) (* (/ f30-0 4) f30-0)))) ) (let ((a1-6 s2-0)) (set! (-> a1-6 best-dist) (the-as float a0-2)) @@ -2156,7 +2156,7 @@ ) ) ) - (vector+float*! (-> s2-0 start-pos) sv-1008 v1-28 (* 0.5 f30-0)) + (vector+float*! (-> s2-0 start-pos) sv-1008 v1-28 (/ f30-0 2)) (vector-float*! (-> s2-0 move-dist) v1-28 (- f30-0)) ) (let ((v1-29 s2-0)) @@ -2778,6 +2778,7 @@ ) ;; definition for method 125 of type gekko +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this gekko)) (local-vars (v1-18 gekko-shadow-spot)) (let ((s5-0 (handle->process (-> this ragdoll-proc)))) diff --git a/test/decompiler/reference/jak3/levels/mine/manta_REF.gc b/test/decompiler/reference/jak3/levels/mine/manta_REF.gc index 72aadefcc2a..a106591baf8 100644 --- a/test/decompiler/reference/jak3/levels/mine/manta_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/manta_REF.gc @@ -1265,7 +1265,7 @@ ) (vector-! (-> this move-matrix trans) (-> this focus-pos) (-> this move-matrix uvec)) (vector-normalize! (-> this move-matrix trans) 24576.0) - (set! (-> this move-matrix trans y) (* -0.5 (-> this move-matrix trans y))) + (set! (-> this move-matrix trans y) (/ (-> this move-matrix trans y) -2)) (matrix*! (-> this curve-matrix) *hermite-matrix* (-> this move-matrix)) 0 (none) diff --git a/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc index be59ef7f028..71aaa657dab 100644 --- a/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc @@ -687,7 +687,7 @@ (the float (sar (shl - (the int (+ (-> this wheel-angle) (* 182.04445 (seconds-per-frame) (* 0.00024414062 (-> this ang-momentum))))) + (the int (+ (-> this wheel-angle) (* 182.04445 (seconds-per-frame) (/ (-> this ang-momentum) METER_LENGTH)))) 48 ) 48 diff --git a/test/decompiler/reference/jak3/levels/mine/prebot-extras_REF.gc b/test/decompiler/reference/jak3/levels/mine/prebot-extras_REF.gc index e3a1314a0c1..4d8ea1c3e4e 100644 --- a/test/decompiler/reference/jak3/levels/mine/prebot-extras_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/prebot-extras_REF.gc @@ -512,7 +512,7 @@ ) ) ) - (let ((f0-13 (* 0.002 f28-0))) + (let ((f0-13 (/ f28-0 500))) (fmin 0.1 f0-13) ) (let ((f28-4 (+ 0.0 @@ -523,7 +523,7 @@ ) ) (when (-> self use-pos-pitch) - (+! f28-4 (* 0.2 f26-0)) + (+! f28-4 (/ f26-0 5)) (when (and (-> self allow-whoosh) (< (fabs (-> s3-2 x)) (-> self whoosh-lead))) (set! (-> self allow-whoosh) #f) (sound-play "sword-whoosh-by" :position gp-0) diff --git a/test/decompiler/reference/jak3/levels/mine/prebot-states_REF.gc b/test/decompiler/reference/jak3/levels/mine/prebot-states_REF.gc index d8f1e3cef7b..1d6973a3ab6 100644 --- a/test/decompiler/reference/jak3/levels/mine/prebot-states_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/prebot-states_REF.gc @@ -129,7 +129,6 @@ ;; definition for function prebot-common ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. (defbehavior prebot-common prebot () (dotimes (gp-0 20) (cond @@ -1053,7 +1052,7 @@ ) (if (= f30-0 0.0) (prebot-light-pulse-off) - (prebot-light-pulse-on (+ 0.2 (* 0.1 f30-0)) (+ 0.1 (* 0.04 f30-0)) 0.0) + (prebot-light-pulse-on (+ 0.2 (/ f30-0 10)) (+ 0.1 (/ f30-0 25)) 0.0) ) ) (when (>= (-> self num-attacks) (the-as uint (min 5 (-> gp-0 length)))) @@ -2582,6 +2581,7 @@ ) ;; definition for method 21 of type task-manager-prebot +;; WARN: Return type mismatch connection vs none. (defmethod set-time-limit ((this task-manager-prebot)) (let ((t9-0 (method-of-type task-manager set-time-limit))) (t9-0 this) @@ -2590,7 +2590,3 @@ (set-setting! 'music 'mineboss 0.0 0) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mine/rat_REF.gc b/test/decompiler/reference/jak3/levels/mine/rat_REF.gc index 12c960d8751..86b72ada171 100644 --- a/test/decompiler/reference/jak3/levels/mine/rat_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/rat_REF.gc @@ -990,7 +990,7 @@ (seek-toward-heading-vec! (-> self root) (-> self face-dir) - (* 0.5 (-> self nav max-rotation-rate)) + (/ (-> self nav max-rotation-rate) 2) (seconds 0.02) ) (nav-enemy-simple-post) diff --git a/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc b/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc index 2b15e4ee765..a50bfe56d2b 100644 --- a/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc +++ b/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc @@ -814,7 +814,7 @@ s5-1 s5-1 gp-0 - (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame)) ) ) 0 @@ -929,7 +929,7 @@ (set-time! (-> this last-change-dir)) (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-14 (* 0.5 f30-0 (tan (-> this move-angle)))) + (f0-14 (* (/ f30-0 2) (tan (-> this move-angle)))) (s2-1 (new 'stack-no-clear 'vector)) ) (if (-> this heading) diff --git a/test/decompiler/reference/jak3/levels/nest/mh-centipede_REF.gc b/test/decompiler/reference/jak3/levels/nest/mh-centipede_REF.gc index 10a653d8f7f..78e2e1110b2 100644 --- a/test/decompiler/reference/jak3/levels/nest/mh-centipede_REF.gc +++ b/test/decompiler/reference/jak3/levels/nest/mh-centipede_REF.gc @@ -787,10 +787,10 @@ (v1-3 (-> self entity extra perm)) ) (logior! (-> v1-3 status) (entity-perm-status bit-5)) - (set! (-> v1-3 user-int16 0) (the int (* 0.00024414062 (-> (the-as vector a1-1) x)))) - (set! (-> v1-3 user-int16 1) (the int (* 0.00024414062 (-> (the-as vector a1-1) z)))) - (set! (-> v1-3 user-int16 2) (the int (* 0.00024414062 (-> (the-as vector a0-3) x)))) - (set! (-> v1-3 user-int16 3) (the int (* 0.00024414062 (-> (the-as vector a0-3) z)))) + (set! (-> v1-3 user-int16 0) (the int (/ (-> (the-as vector a1-1) x) METER_LENGTH))) + (set! (-> v1-3 user-int16 1) (the int (/ (-> (the-as vector a1-1) z) METER_LENGTH))) + (set! (-> v1-3 user-int16 2) (the int (/ (-> (the-as vector a0-3) x) METER_LENGTH))) + (set! (-> v1-3 user-int16 3) (the int (/ (-> (the-as vector a0-3) z) METER_LENGTH))) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual idle) @@ -2047,7 +2047,7 @@ (set! f0-14 (-> v1-50 damage)) ) (if (and (-> self next-state) (= (-> self next-state name) 'shooting)) - (set! f0-14 (* 0.5 f0-14)) + (set! f0-14 (/ f0-14 2)) ) (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) (set! f0-14 (* 0.6666667 f0-14)) @@ -2398,7 +2398,7 @@ (when (nonzero? (-> self breach-part)) (let ((f30-0 (-> *part-id-table* 2499 init-specs 2 initial-valuef))) (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) - (lerp-scale f30-0 (* 0.1 f30-0) (the float (- (current-time) (-> self state-time))) 0.0 150.0) + (lerp-scale f30-0 (/ f30-0 10) (the float (- (current-time) (-> self state-time))) 0.0 150.0) ) (spawn (-> self breach-part) (-> self launch-position)) (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) f30-0) @@ -2566,7 +2566,7 @@ (f28-1 (-> *part-id-table* 2508 init-specs 2 initial-valuef)) ) (set! (-> *part-id-table* 2507 init-specs 2 initial-valuef) - (lerp-scale f30-10 (* 0.05 f30-10) (the float (- (current-time) (-> self nose-smack-time))) 0.0 30.0) + (lerp-scale f30-10 (/ f30-10 20) (the float (- (current-time) (-> self nose-smack-time))) 0.0 30.0) ) (set! (-> *part-id-table* 2508 init-specs 2 initial-valuef) (lerp-scale f28-1 (* 0.0 f28-1) (the float (- (current-time) (-> self nose-smack-time))) 0.0 150.0) @@ -2685,7 +2685,7 @@ (when (nonzero? (-> self breach-part)) (let ((f30-1 (-> *part-id-table* 2499 init-specs 2 initial-valuef))) (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) - (lerp-scale f30-1 (* 0.1 f30-1) (the float (- (current-time) (-> self state-time))) 0.0 150.0) + (lerp-scale f30-1 (/ f30-1 10) (the float (- (current-time) (-> self state-time))) 0.0 150.0) ) (spawn (-> self breach-part) (-> self launch-position)) (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) f30-1) @@ -2851,7 +2851,7 @@ (f28-1 (-> *part-id-table* 2508 init-specs 2 initial-valuef)) ) (set! (-> *part-id-table* 2507 init-specs 2 initial-valuef) - (lerp-scale f30-11 (* 0.05 f30-11) (the float (- (current-time) (-> self nose-smack-time))) 0.0 30.0) + (lerp-scale f30-11 (/ f30-11 20) (the float (- (current-time) (-> self nose-smack-time))) 0.0 30.0) ) (set! (-> *part-id-table* 2508 init-specs 2 initial-valuef) (lerp-scale f28-1 (* 0.0 f28-1) (the float (- (current-time) (-> self nose-smack-time))) 0.0 150.0) @@ -3703,7 +3703,3 @@ (set-setting! 'goggles 'abs 1.0 0) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/precursor/precura-obs2_REF.gc b/test/decompiler/reference/jak3/levels/precursor/precura-obs2_REF.gc index 35da5d3d35b..f5fcbe3f7b3 100644 --- a/test/decompiler/reference/jak3/levels/precursor/precura-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/precursor/precura-obs2_REF.gc @@ -383,7 +383,7 @@ ) ) ) - (vector-float*! (-> s4-0 transv) s3-0 (* 0.1 (-> self clock frames-per-second))) + (vector-float*! (-> s4-0 transv) s3-0 (/ (-> self clock frames-per-second) 10)) ) (let ((v1-35 (-> s4-0 root-prim))) (set! (-> v1-35 prim-core collide-as) (-> s4-0 backup-collide-as)) @@ -961,7 +961,7 @@ (set! (-> gp-1 quad) (-> self root transv quad)) (let ((f0-9 32768.0)) (set! (-> gp-1 y) 0.0) - (let* ((f0-11 (* 0.000048828126 f0-9 (vector-length gp-1))) + (let* ((f0-11 (* (/ f0-9 (meters 5)) (vector-length gp-1))) (f30-0 (fmin 32768.0 f0-11)) ) (vector-normalize! gp-1 1.0) @@ -971,7 +971,7 @@ ) ) (quaternion*! (-> self root quat) (-> self spin-quat) (-> self root quat)) - (if (< (* 0.00024414062 (-> self root trans y)) 500.0) + (if (< (/ (-> self root trans y) METER_LENGTH) 500.0) (go-virtual explode) ) ) diff --git a/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc b/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc index e6c8543e9a9..ba1adb27be9 100644 --- a/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc @@ -1067,10 +1067,10 @@ (-> arg0 thrust s3-0) (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) (fmax 0.0 (-> v0-6 y)) - (fabs (* 0.2 (-> v0-6 z))) + (fabs (/ (-> v0-6 z) 5)) (fmax 0.0 (-> s1-1 y)) ) - (* 0.2 f30-0) + (/ f30-0 5) ) ) ) @@ -1094,7 +1094,7 @@ (set! (-> *part-id-table* 5032 init-specs 0 initial-valuef) (* f24-0 f0-15)) (set! (-> arg0 thrust s3-0) f28-0) (let ((f0-16 (* f26-0 f0-15))) - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (* -0.5 f0-16)) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (/ f0-16 -2)) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc b/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc index e14f9f4a5ee..0d34e4eba3d 100644 --- a/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc @@ -1662,7 +1662,7 @@ ) ) (until #f - (let* ((f0-1 (* 0.000061035156 (-> self swim-final-rotate-deg))) + (let* ((f0-1 (/ (-> self swim-final-rotate-deg) (meters 4))) (f0-2 (fmin 1.0 f0-1)) ) (let ((v1-19 (-> self skel root-channel 0)) @@ -3669,6 +3669,7 @@ ) ;; definition for method 125 of type saberfish +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this saberfish)) (let* ((s5-0 (handle->process (-> this ragdoll-proc))) (v0-0 diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc index 4acd27d7bda..9dd6d9acbe7 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc @@ -586,7 +586,7 @@ (let ((a1-3 (new 'stack-no-clear 'vector))) (-> a0-2 y) (set! (-> a1-3 quad) (-> this node-list data arg1 bone transform fvec quad)) - (set! (-> a1-3 y) (* 0.5 (-> a1-3 y))) + (set! (-> a1-3 y) (/ (-> a1-3 y) 2)) (fire-laser! a0-2 a1-3 (the-as sew-laser-guard this) 491520.0) ) ) diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-whirlpool_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-whirlpool_REF.gc index 333ce317bd0..47e2eff5d9e 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sew-whirlpool_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sew-whirlpool_REF.gc @@ -41,7 +41,7 @@ (let* ((f26-0 (* 0.000016276043 (- 61440.0 f30-0))) (f24-0 98304.0) (f0-6 (atan (- (-> gp-0 x) (-> self root trans x)) (- (-> gp-0 z) (-> self root trans z)))) - (f28-0 (* 0.5 f26-0 f24-0 (seconds-per-frame))) + (f28-0 (* (/ f26-0 2) f24-0 (seconds-per-frame))) (f22-0 (+ f0-6 f28-0)) (f26-1 (- f30-0 (fmin f30-0 (* 0.16874999 f26-0 (fabs f24-0) (seconds-per-frame))))) (s5-0 (new 'stack-no-clear 'vector)) @@ -117,7 +117,3 @@ ) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-move-turret_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-move-turret_REF.gc index f0583a5b83d..36cd8bc05a0 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sewer-move-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-move-turret_REF.gc @@ -132,7 +132,7 @@ (let ((f1-1 1228.8)) (cond ((< f0-0 5.0) - (set! f1-1 (* 0.2 f0-0 f1-1)) + (set! f1-1 (* (/ f0-0 5) f1-1)) ) ((< 40.0 f0-0) (set! f1-1 (* 0.2 (- 45.0 f0-0) f1-1)) @@ -590,7 +590,3 @@ (call-parent-method this) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc b/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc index 7ff400e7d3a..bda1e864aef 100644 --- a/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc +++ b/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc @@ -782,7 +782,7 @@ s5-1 s5-1 gp-0 - (* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame)) + (* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame)) ) ) 0 diff --git a/test/decompiler/reference/jak3/levels/stadium/rubble-part_REF.gc b/test/decompiler/reference/jak3/levels/stadium/rubble-part_REF.gc index 50b7b535428..af20ae9a23a 100644 --- a/test/decompiler/reference/jak3/levels/stadium/rubble-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/stadium/rubble-part_REF.gc @@ -266,8 +266,8 @@ ;; definition for function rub-elec-gate-adjust-particles ;; WARN: Return type mismatch int vs none. (defun rub-elec-gate-adjust-particles ((arg0 float) (arg1 float) (arg2 float)) - (* 0.5 arg0) - (set! (-> *part-id-table* 3729 init-specs 3 initial-valuef) (- (* 0.5 arg1))) + (/ arg0 2) + (set! (-> *part-id-table* 3729 init-specs 3 initial-valuef) (- (/ arg1 2))) (set! (-> *part-id-table* 3729 init-specs 4 initial-valuef) arg0) (set! (-> *part-id-table* 3729 init-specs 5 initial-valuef) arg1) (set! (-> *part-id-table* 3729 init-specs 9 initial-valuef) (* 48.0 arg2)) @@ -670,7 +670,3 @@ (:func 'sparticle-texture-animate) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/temple/temple-obs2_REF.gc b/test/decompiler/reference/jak3/levels/temple/temple-obs2_REF.gc index 40ff0a9b3e8..705e14aa043 100644 --- a/test/decompiler/reference/jak3/levels/temple/temple-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/temple-obs2_REF.gc @@ -865,7 +865,7 @@ ) ) (v1-10 (vector-! (new 'stack-no-clear 'vector) s3-0 (-> self root trans))) - (f30-0 (* 0.000024414063 f0-0)) + (f30-0 (/ f0-0 (meters 10))) (s2-0 vector-xz-normalize!) (a0-7 v1-10) ) @@ -2235,7 +2235,3 @@ ((method-of-type process-focusable deactivate) (the-as process-focusable this)) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc b/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc index d892fd1a57a..f59635ded15 100644 --- a/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc @@ -1120,7 +1120,7 @@ ) (set! (-> self root scale x) (* f0-11 f0-11)) ) - (set! (-> self root scale y) (+ 1.0 (* 0.5 (-> self root scale x)))) + (set! (-> self root scale y) (+ 1.0 (/ (-> self root scale x) 2))) (set! (-> self root scale z) (-> self root scale x)) (when (= (-> self root scale x) 0.0) (send-event (handle->process (-> self perm-part)) 'die) diff --git a/test/decompiler/reference/jak3/levels/temple/templea-texture_REF.gc b/test/decompiler/reference/jak3/levels/temple/templea-texture_REF.gc index dd0c7758380..b8a0fc9157a 100644 --- a/test/decompiler/reference/jak3/levels/temple/templea-texture_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/templea-texture_REF.gc @@ -307,8 +307,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) @@ -514,8 +514,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) @@ -652,7 +652,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/volcano/volcano-obs2_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcano-obs2_REF.gc index fec736909d3..c6329631457 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcano-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcano-obs2_REF.gc @@ -930,7 +930,7 @@ ) ) ) - (set! (-> self player-force y) (* 0.1 (-> self player-force y))) + (set! (-> self player-force y) (/ (-> self player-force y) 10)) (if (and (logtest? (-> self rbody flags) (rigid-body-flag enable-physics)) (< (vector-length (-> self root transv)) 4096.0) (< (* (vector-length (-> self rbody lin-momentum)) (-> self info info inv-mass)) 2457.6) @@ -1001,7 +1001,7 @@ (set! (-> s4-1 quad) (-> this to-hole-vec quad)) (let ((s3-1 (new 'stack-no-clear 'vector))) (set! (-> s3-1 quad) (-> this rbody position quad)) - (set! (-> s4-1 y) (* -0.1 (-> s4-1 y))) + (set! (-> s4-1 y) (/ (-> s4-1 y) -10)) (vector-float*! s4-1 s4-1 (lerp-scale 0.0 30.0 (-> this hole-dist-xz) 20480.0 4096.0)) (apply-impact! (-> this rbody) s3-1 s4-1) ) diff --git a/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc index df0bab4b8a7..c03b3bd23ba 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc @@ -79,7 +79,7 @@ :code sleep-code :post (behavior () (let ((f0-0 (cos (get-scaled-val! (-> self sync) 32768.0 0))) - (f1-1 (* 0.5 (-> self amplitude))) + (f1-1 (/ (-> self amplitude) 2)) ) (set! (-> self root trans y) (- (- (-> self init-y) f1-1) (* f0-0 f1-1))) ) @@ -1877,7 +1877,7 @@ (send-event (handle->process (-> self ball)) 'push (* f28-0 f30-1)) (set! (-> *part-id-table* 4612 init-specs 2 initial-valuef) (* 10.0 f30-1 (- 1.0 f28-0))) (set! (-> *part-id-table* 4612 init-specs 13 initial-valuef) - (+ (* 6826.6665 f30-1 f28-0) (* 0.002 (-> self ball-height) f30-1 (- 1.0 f28-0))) + (+ (* 6826.6665 f30-1 f28-0) (* (/ (-> self ball-height) 500) f30-1 (- 1.0 f28-0))) ) ) 0 diff --git a/test/decompiler/reference/jak3/levels/volcano/volcano-scenes_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcano-scenes_REF.gc index 8bdd5a1413d..18292de36e4 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcano-scenes_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcano-scenes_REF.gc @@ -543,8 +543,8 @@ (vector+! s4-0 s4-0 s3-0) ) (set! (-> *part-id-table* 659 init-specs 2 initial-valuef) (-> *vol-invis-joint-list* s5-0 size)) - (set! (-> *part-id-table* 659 init-specs 3 initial-valuef) (* 0.5 (-> *vol-invis-joint-list* s5-0 size))) - (set! (-> *part-id-table* 659 init-specs 4 initial-valuef) (* 0.5 (-> *vol-invis-joint-list* s5-0 size))) + (set! (-> *part-id-table* 659 init-specs 3 initial-valuef) (/ (-> *vol-invis-joint-list* s5-0 size) 2)) + (set! (-> *part-id-table* 659 init-specs 4 initial-valuef) (/ (-> *vol-invis-joint-list* s5-0 size) 2)) (launch-particles (-> *part-id-table* 659) s4-0) ) ) @@ -1073,7 +1073,3 @@ (:rotate-y (degrees 0) (degrees 3600)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/volcano/volcanox-obs_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcanox-obs_REF.gc index c79643097ab..c14e6dce135 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcanox-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcanox-obs_REF.gc @@ -415,7 +415,7 @@ ) (set! (-> self root scale x) (* f0-11 f0-11)) ) - (set! (-> self root scale y) (+ 1.0 (* 0.5 (-> self root scale x)))) + (set! (-> self root scale y) (+ 1.0 (/ (-> self root scale x) 2))) (set! (-> self root scale z) (-> self root scale x)) (when (= (-> self root scale x) 0.0) (send-event (handle->process (-> self perm-part)) 'die) diff --git a/test/decompiler/reference/jak3/levels/volcano/volcanox-texture_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcanox-texture_REF.gc index 2315a5f9038..ba3c4eadf00 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcanox-texture_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcanox-texture_REF.gc @@ -160,8 +160,8 @@ ) (else (let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z)))))))) - (set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) - (set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) + (set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0) ) (set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame)))) ) @@ -207,7 +207,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/ctymark-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/ctymark-obs_REF.gc index 385baa5a14e..b4dfde36859 100644 --- a/test/decompiler/reference/jak3/levels/wascity/ctymark-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/ctymark-obs_REF.gc @@ -1223,7 +1223,7 @@ 0.0 0.0 0.0 - (let* ((f28-0 (/ 1.0 (* 0.00024414062 (-> arg1 omega)))) + (let* ((f28-0 (/ 1.0 (/ (-> arg1 omega) METER_LENGTH))) (f26-0 (* (rand-vu-float-range -136.53334 136.53334) f28-0)) (f30-0 (* (rand-vu-float-range 0.0 136.53334) f28-0)) (f0-8 (* (rand-vu-float-range -13.653334 54.613335) f28-0)) diff --git a/test/decompiler/reference/jak3/levels/wascity/defend/was-pre-game_REF.gc b/test/decompiler/reference/jak3/levels/wascity/defend/was-pre-game_REF.gc index 9712e171b11..0e6bf4cb5fd 100644 --- a/test/decompiler/reference/jak3/levels/wascity/defend/was-pre-game_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/defend/was-pre-game_REF.gc @@ -624,8 +624,8 @@ (let* ((a0-1 (-> arg4 control)) (v1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg2 x-y-z-sx) (-> a0-1 origin trans))) ) - (set! (-> arg1 vel-sxvel x) (* 0.083333336 (-> v1-1 x))) - (set! (-> arg1 vel-sxvel y) (* 0.083333336 (-> v1-1 y))) + (set! (-> arg1 vel-sxvel x) (/ (-> v1-1 x) 12)) + (set! (-> arg1 vel-sxvel y) (/ (-> v1-1 y) 12)) ) 0 (none) @@ -985,9 +985,9 @@ (let* ((a0-1 (-> arg4 control)) (v1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg2 x-y-z-sx) (-> a0-1 origin trans))) ) - (set! (-> arg1 vel-sxvel x) (* -0.008333334 (-> v1-1 x))) - (set! (-> arg1 vel-sxvel y) (* -0.008333334 (-> v1-1 y))) - (set! (-> arg1 vel-sxvel z) (* -0.008333334 (-> v1-1 z))) + (set! (-> arg1 vel-sxvel x) (/ (-> v1-1 x) -120)) + (set! (-> arg1 vel-sxvel y) (/ (-> v1-1 y) -120)) + (set! (-> arg1 vel-sxvel z) (/ (-> v1-1 z) -120)) ) 0 (none) @@ -3282,19 +3282,19 @@ ) (cond ((zero? a0-7) - (set-vector! v1-6 0.0 (* 90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 1.0) + (set-vector! v1-6 0.0 (* 90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 1.0) ) ((= a0-7 1) - (set-vector! v1-6 (* 90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 0.0 1.0) + (set-vector! v1-6 (* 90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 0.0 1.0) ) ((= a0-7 2) - (set-vector! v1-6 0.0 (* -90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 1.0) + (set-vector! v1-6 0.0 (* -90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 1.0) ) ((= a0-7 2) - (set-vector! v1-6 0.0 (* 90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 1.0) + (set-vector! v1-6 0.0 (* 90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 1.0) ) ((= a0-7 3) - (set-vector! v1-6 (* -90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 0.0 1.0) + (set-vector! v1-6 (* -90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 0.0 1.0) ) ) ) @@ -3345,16 +3345,16 @@ ) (cond ((zero? a0-7) - (set-vector! v1-6 0.0 (* 90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 1.0) + (set-vector! v1-6 0.0 (* 90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 1.0) ) ((= a0-7 1) - (set-vector! v1-6 (* 90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 0.0 1.0) + (set-vector! v1-6 (* 90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 0.0 1.0) ) ((= a0-7 2) - (set-vector! v1-6 0.0 (* -90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 1.0) + (set-vector! v1-6 0.0 (* -90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 1.0) ) ((= a0-7 3) - (set-vector! v1-6 (* -90.0 (+ (-> a1-1 min) (* 0.5 (-> a1-1 size)))) 0.0 0.0 1.0) + (set-vector! v1-6 (* -90.0 (+ (-> a1-1 min) (/ (-> a1-1 size) 2))) 0.0 0.0 1.0) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/dm-flyer_REF.gc b/test/decompiler/reference/jak3/levels/wascity/dm-flyer_REF.gc index 40a17d7735d..f7824354acd 100644 --- a/test/decompiler/reference/jak3/levels/wascity/dm-flyer_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/dm-flyer_REF.gc @@ -384,7 +384,7 @@ ) ((= v1-0 (projectile-options po0 po1)) (let* ((f0-0 (vector-vector-distance (target-pos 0) (-> this root trans))) - (f0-2 (+ 0.3 (* 0.0000012207031 f0-0))) + (f0-2 (+ 0.3 (/ f0-0 (meters 200)))) ) (sound-play-by-name (static-sound-name "missile-travel") diff --git a/test/decompiler/reference/jak3/levels/wascity/tizard_REF.gc b/test/decompiler/reference/jak3/levels/wascity/tizard_REF.gc index 76fca82e390..eebe50d449f 100644 --- a/test/decompiler/reference/jak3/levels/wascity/tizard_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/tizard_REF.gc @@ -208,7 +208,7 @@ ) (quaternion-normalize! s4-1) (quaternion-normalize! s3-0) - (dotimes (s2-0 (the int (* 0.000061035156 f30-0))) + (dotimes (s2-0 (the int (/ f30-0 (meters 4)))) (cond (s5-0 (ja-no-eval :group! tizard-turn-left0-ja :num! (seek!) :frame-num 0.0) diff --git a/test/decompiler/reference/jak3/levels/wascity/wascity-turret_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wascity-turret_REF.gc index 1733b3d662d..7c8d48fded4 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wascity-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wascity-turret_REF.gc @@ -392,7 +392,7 @@ (if (< (-> s2-0 z) 0.0) (set! f0-6 (- f0-6)) ) - (set! (-> s3-1 x) (* 0.000061035156 f0-6)) + (set! (-> s3-1 x) (/ f0-6 (meters 4))) ) (let ((f0-13 (atan (-> s2-0 y) (sqrtf (+ (* (-> s2-0 x) (-> s2-0 x)) (* (-> s2-0 z) (-> s2-0 z))))))) (set! (-> s3-1 y) (* -0.00014085036 f0-13)) @@ -1354,7 +1354,7 @@ (set! (-> s0-1 quad) (-> s1-1 quad)) (when (= (-> s2-2 type) skeet) (set! sv-960 s2-2) - (let ((f28-1 (* 0.00000013563368 f28-0))) + (let ((f28-1 (/ f28-0 (meters 1800)))) (if #f (add-debug-sphere #t (bucket-id debug) s1-1 (meters 12) *color-red*) ) @@ -1626,7 +1626,7 @@ (if (< (-> s4-0 z) 0.0) (set! f0-4 (- f0-4)) ) - (set! (-> s5-0 x) (* 0.000061035156 f0-4)) + (set! (-> s5-0 x) (/ f0-4 (meters 4))) ) (let ((f0-11 (atan (-> s4-0 y) (sqrtf (+ (* (-> s4-0 x) (-> s4-0 x)) (* (-> s4-0 z) (-> s4-0 z))))))) (set! (-> s5-0 y) (* -0.00014085036 f0-11)) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasdef-manager_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasdef-manager_REF.gc index cf67ac94786..53ee46760a4 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasdef-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasdef-manager_REF.gc @@ -1397,7 +1397,7 @@ 0.0 (set-vector! v1-0 6583861.5 0.0 -1960301.9 1.0) (let ((f0-5 (vector-vector-xz-distance v1-0 arg0))) - (- 36864.0 (* 0.1 f0-5)) + (- 36864.0 (/ f0-5 10)) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasgun-hud_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasgun-hud_REF.gc index eb48e9cbb9c..3fc69f8b018 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasgun-hud_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasgun-hud_REF.gc @@ -148,7 +148,7 @@ (set! (-> s4-2 y) (+ (the int (-> s3-3 y)) -50)) 1.0 (let ((s2-3 (min 2 (the int (* 3.0 (-> this minfo s5-3 hit-points)))))) - (let ((f0-48 (* 0.00005 (-> s3-3 z)))) + (let ((f0-48 (/ (-> s3-3 z) 20000))) (set! (-> this reticle s2-3 scale-x) f0-48) (set! (-> this reticle s2-3 scale-y) f0-48) ) @@ -328,7 +328,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/wasgun-manager_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasgun-manager_REF.gc index a33215d7abf..02dd25f48cf 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasgun-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasgun-manager_REF.gc @@ -2412,10 +2412,10 @@ (format #t "((sktpos ~f ~f) ~f ~f)~%" - (* 0.00024414062 (-> arg2 x)) - (* 0.00024414062 (-> arg2 z)) + (/ (-> arg2 x) METER_LENGTH) + (/ (-> arg2 z) METER_LENGTH) (* 0.005493164 arg3) - (* 0.00024414062 s2-1) + (/ s2-1 METER_LENGTH) ) (spawn-skeet arg0 arg1 arg2 arg3 s2-1) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadb-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadb-obs_REF.gc index 0b2f333689c..2777960c23b 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadb-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadb-obs_REF.gc @@ -1146,7 +1146,7 @@ (let ((v1-6 gp-1)) (set! (-> v1-6 height) (the float 70)) ) - (set! (-> gp-1 origin x) (the float (- 256 (the int (* 0.5 (-> gp-1 width)))))) + (set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2))))) (set! (-> gp-1 origin y) 320.0) (set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s5-0 print-game-text)) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadc-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadc-obs_REF.gc index fd701b5880a..110ba4f8c96 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadc-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadc-obs_REF.gc @@ -833,7 +833,7 @@ (goto cfg-20) ) (let ((f0-2 (lerp-scale 0.0 1.0 (-> self root trans y) 49152.0 40960.0))) - (set-vector! (-> self draw color-mult) (+ 1.0 f0-2) (- 1.0 (* 0.5 f0-2)) (- 1.0 f0-2) 1.0) + (set-vector! (-> self draw color-mult) (+ 1.0 f0-2) (- 1.0 (/ f0-2 2)) (- 1.0 f0-2) 1.0) ) (set! (-> self delta-y) (* (-> self depth) (- (sin f30-0)))) (+! f30-0 (* 3276.8 (seconds-per-frame))) @@ -867,7 +867,7 @@ (set! f30-0 0.0) ) (let ((f0-21 (lerp-scale 0.0 1.0 (-> self root trans y) 49152.0 40960.0))) - (set-vector! (-> self draw color-mult) (+ 1.0 f0-21) (- 1.0 (* 0.5 f0-21)) (- 1.0 f0-21) 1.0) + (set-vector! (-> self draw color-mult) (+ 1.0 f0-21) (- 1.0 (/ f0-21 2)) (- 1.0 f0-21) 1.0) ) (sound-play-by-spec gp-1 (-> self ambient-sound-id) (-> self root trans)) (suspend) diff --git a/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc index 28a6b37cf62..57a32e4d927 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc @@ -94,6 +94,7 @@ ;; definition for method 125 of type wlander ;; INFO: this function exists in multiple non-identical object files +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this wlander)) (let ((s5-0 (handle->process (-> this ragdoll-proc)))) (or (not s5-0) @@ -418,7 +419,7 @@ s5-0 s5-0 gp-0 - (* (+ 1.0 (* 0.00024414062 (-> this nav state speed))) (seconds-per-frame)) + (* (+ 1.0 (/ (-> this nav state speed) METER_LENGTH)) (seconds-per-frame)) ) ) 0