From b90b6c9aff8928e6d4c54dd6518aeedac0bd0b1d Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Fri, 11 Nov 2022 17:27:09 -0500 Subject: [PATCH] small cleanup on camera code (#2010) fixes https://github.com/open-goal/jak-project/issues/1960 and patches scratchpad use in cam-debug --- decompiler/IR2/FormExpressionAnalysis.cpp | 26 +- goal_src/jak2/engine/camera/cam-debug.gc | 396 +++++++-------- goal_src/jak2/engine/camera/cam-master.gc | 9 +- goal_src/jak2/engine/camera/cam-states.gc | 8 +- goal_src/jak2/engine/debug/default-menu.gc | 110 ++-- goal_src/jak2/engine/debug/editable-player.gc | 473 ++++-------------- .../jak2/engine/gfx/sprite/sprite-distort.gc | 2 +- .../jak2/engine/target/board/board-states.gc | 2 +- goal_src/jak2/engine/target/target.gc | 44 +- .../jak2/engine/camera/cam-states_REF.gc | 8 +- .../jak2/engine/debug/default-menu_REF.gc | 28 +- .../jak2/engine/debug/editable-player_REF.gc | 4 +- .../engine/gfx/sprite/sprite-distort_REF.gc | 2 +- .../engine/target/board/board-states_REF.gc | 2 +- .../jak2/engine/target/target_REF.gc | 44 +- 15 files changed, 431 insertions(+), 727 deletions(-) diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 1abd8f4db6..c82c885b71 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -4439,6 +4439,28 @@ std::vector cast_to_64_bit(const std::vector& forms, return result; } +std::vector cast_for_64bit_equality_check(const std::vector& forms, + const std::vector& types, + FormPool& pool, + const Env& env) { + if (env.version == GameVersion::Jak1) { + return cast_to_64_bit(forms, types, pool, env); + } + std::vector result; + for (size_t i = 0; i < forms.size(); i++) { + if (env.dts->ts.tc(TypeSpec("uint128"), types.at(i))) { + result.push_back(cast_form(forms[i], TypeSpec("uint"), pool, env)); + } else if (env.dts->ts.tc(TypeSpec("int128"), types.at(i))) { + result.push_back(cast_form(forms[i], TypeSpec("int"), pool, env)); + } else if (env.dts->ts.tc(TypeSpec("float"), types.at(i))) { + result.push_back(cast_form(forms[i], TypeSpec("int"), pool, env)); + } else { + result.push_back(forms[i]); + } + } + return result; +} + FormElement* try_make_nonzero_logtest(Form* in, FormPool& pool) { /* (defmacro logtest? (a b) @@ -4661,7 +4683,7 @@ FormElement* ConditionElement::make_equal_check_generic(const Env& env, } return pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::EQ), - cast_to_64_bit(source_forms, source_types, pool, env)); + cast_for_64bit_equality_check(source_forms, source_types, pool, env)); } } } @@ -4692,7 +4714,7 @@ FormElement* ConditionElement::make_not_equal_check_generic( } else { return pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::NEQ), - cast_to_64_bit(source_forms, source_types, pool, env)); + cast_for_64bit_equality_check(source_forms, source_types, pool, env)); } } } diff --git a/goal_src/jak2/engine/camera/cam-debug.gc b/goal_src/jak2/engine/camera/cam-debug.gc index 10bff722ec..b053d3f4c6 100644 --- a/goal_src/jak2/engine/camera/cam-debug.gc +++ b/goal_src/jak2/engine/camera/cam-debug.gc @@ -209,15 +209,15 @@ (let* ((a1-2 v1-5) (a3-4 (-> a1-2 base)) ) - (set! (-> (the-as (pointer uint128) a3-4) 0) (-> (the-as vector (+ 32 #x70000000)) quad)) - (set! (-> (the-as (pointer uint128) a3-4) 1) (-> (the-as vector (+ #x70000000 0)) quad)) + (set! (-> (the-as (pointer uint128) a3-4) 0) (-> (the-as vector (+ 32 (scratchpad-object int))) quad)) + (set! (-> (the-as (pointer uint128) a3-4) 1) (-> (the-as vector (+ (scratchpad-object int) 0)) quad)) (set! (-> a1-2 base) (&+ a3-4 32)) ) (let* ((a3-6 v1-5) (a1-3 (-> a3-6 base)) ) - (set! (-> (the-as (pointer uint128) a1-3) 0) (-> (the-as vector (+ 32 #x70000000)) quad)) - (set! (-> (the-as (pointer uint128) a1-3) 1) (-> (the-as vector (+ 16 #x70000000)) quad)) + (set! (-> (the-as (pointer uint128) a1-3) 0) (-> (the-as vector (+ 32 (scratchpad-object int))) quad)) + (set! (-> (the-as (pointer uint128) a1-3) 1) (-> (the-as vector (+ 16 (scratchpad-object int))) quad)) (set! (-> a3-6 base) (&+ a1-3 32)) ) (let ((a3-10 (/ (the-as int (+ (- -16 (the-as int a0-1)) (the-as int (-> v1-5 base)))) 16))) @@ -250,18 +250,18 @@ ) (defun camera-line2d ((arg0 vector4w) (arg1 vector4w)) - (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 0 x) (the-as int (* (+ (-> arg0 x) 1792) 16))) - (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 0 y) + (set! (-> (scratchpad-object cam-dbg-scratch) linevec4w 0 x) (the-as int (* (+ (-> arg0 x) 1792) 16))) + (set! (-> (scratchpad-object cam-dbg-scratch) linevec4w 0 y) (the-as int (* (- 2256 (the-as int (-> (the-as cam-dbg-scratch arg0) linevec4w 0 y))) 16)) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 0 z) #x7fffff) - (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 1 x) + (set! (-> (scratchpad-object cam-dbg-scratch) linevec4w 0 z) #x7fffff) + (set! (-> (scratchpad-object cam-dbg-scratch) linevec4w 1 x) (the-as int (* (+ (-> (the-as cam-dbg-scratch arg1) linevec4w 0 x) 1792) 16)) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 1 y) + (set! (-> (scratchpad-object cam-dbg-scratch) linevec4w 1 y) (the-as int (* (- 2256 (the-as int (-> (the-as cam-dbg-scratch arg1) linevec4w 0 y))) 16)) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 1 z) #x7fffff) + (set! (-> (scratchpad-object cam-dbg-scratch) linevec4w 1 z) #x7fffff) (cam-line-dma) ) @@ -274,87 +274,87 @@ (let ((f28-0 (/ 200.0 f24-0)) (f26-0 (/ 400.0 f30-0)) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) color x) 128) - (set! (-> (the-as cam-dbg-scratch #x70000000) color y) 128) - (set! (-> (the-as cam-dbg-scratch #x70000000) color z) 128) - (set! (-> (the-as cam-dbg-scratch #x70000000) color w) 128) + (set! (-> (scratchpad-object cam-dbg-scratch) color x) 128) + (set! (-> (scratchpad-object cam-dbg-scratch) color y) 128) + (set! (-> (scratchpad-object cam-dbg-scratch) color z) 128) + (set! (-> (scratchpad-object cam-dbg-scratch) color w) 128) (when (and (< arg0 0.0) (< 0.0 arg1)) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 x) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 x) (+ (the int (* f26-0 f30-0 (/ (- arg0) f30-0))) 20) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 y) 20) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 x) - (the-as int (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 x)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 y) 20) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 x) + (the-as int (-> (scratchpad-object cam-dbg-scratch) plotvec 0 x)) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 y) (+ (the int (* f28-0 f24-0)) 20)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 y) (+ (the int (* f28-0 f24-0)) 20)) (camera-line2d - (the-as vector4w (-> (the-as cam-dbg-scratch #x70000000) plotvec)) - (the-as vector4w (+ 64 #x70000000)) + (the-as vector4w (-> (scratchpad-object cam-dbg-scratch) plotvec)) + (the-as vector4w (+ 64 (scratchpad-object int))) ) ) (when (and (< arg2 0.0) (< 0.0 arg3)) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 x) 20) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 y) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 x) 20) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 y) (+ (the int (* f28-0 f24-0 (/ (- arg2) f24-0))) 20) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 x) (+ (the int (* f26-0 f30-0)) 20)) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 y) - (the-as int (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 y)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 x) (+ (the int (* f26-0 f30-0)) 20)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 y) + (the-as int (-> (scratchpad-object cam-dbg-scratch) plotvec 0 y)) ) (camera-line2d - (the-as vector4w (-> (the-as cam-dbg-scratch #x70000000) plotvec)) - (-> (the-as cam-dbg-scratch #x70000000) plotvec 1) + (the-as vector4w (-> (scratchpad-object cam-dbg-scratch) plotvec)) + (-> (scratchpad-object cam-dbg-scratch) plotvec 1) ) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 x) 20) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 y) 20) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 x) (+ (the int (* f26-0 f30-0)) 20)) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 y) 20) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 x) 20) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 y) 20) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 x) (+ (the int (* f26-0 f30-0)) 20)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 y) 20) (camera-line2d - (the-as vector4w (-> (the-as cam-dbg-scratch #x70000000) plotvec)) - (-> (the-as cam-dbg-scratch #x70000000) plotvec 1) + (the-as vector4w (-> (scratchpad-object cam-dbg-scratch) plotvec)) + (-> (scratchpad-object cam-dbg-scratch) plotvec 1) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 x) 20) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 y) (+ (the int (* f28-0 f24-0)) 20)) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 x) (+ (the int (* f26-0 f30-0)) 20)) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 y) (+ (the int (* f28-0 f24-0)) 20)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 x) 20) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 y) (+ (the int (* f28-0 f24-0)) 20)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 x) (+ (the int (* f26-0 f30-0)) 20)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 y) (+ (the int (* f28-0 f24-0)) 20)) (camera-line2d - (the-as vector4w (-> (the-as cam-dbg-scratch #x70000000) plotvec)) - (-> (the-as cam-dbg-scratch #x70000000) plotvec 1) + (the-as vector4w (-> (scratchpad-object cam-dbg-scratch) plotvec)) + (-> (scratchpad-object cam-dbg-scratch) plotvec 1) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 x) 20) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 y) 20) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 x) 20) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 y) (+ (the int (* f28-0 f24-0)) 20)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 x) 20) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 y) 20) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 x) 20) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 y) (+ (the int (* f28-0 f24-0)) 20)) (camera-line2d - (the-as vector4w (-> (the-as cam-dbg-scratch #x70000000) plotvec)) - (-> (the-as cam-dbg-scratch #x70000000) plotvec 1) + (the-as vector4w (-> (scratchpad-object cam-dbg-scratch) plotvec)) + (-> (scratchpad-object cam-dbg-scratch) plotvec 1) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 x) (+ (the int (* f26-0 f30-0)) 20)) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 y) 20) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 x) (+ (the int (* f26-0 f30-0)) 20)) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 y) (+ (the int (* f28-0 f24-0)) 20)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 x) (+ (the int (* f26-0 f30-0)) 20)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 y) 20) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 x) (+ (the int (* f26-0 f30-0)) 20)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 y) (+ (the int (* f28-0 f24-0)) 20)) (camera-line2d - (the-as vector4w (-> (the-as cam-dbg-scratch #x70000000) plotvec)) - (-> (the-as cam-dbg-scratch #x70000000) plotvec 1) + (the-as vector4w (-> (scratchpad-object cam-dbg-scratch) plotvec)) + (-> (scratchpad-object cam-dbg-scratch) plotvec 1) ) (let ((v1-64 (-> arg5 quad))) - (set! (-> (the-as cam-dbg-scratch #x70000000) color quad) v1-64) + (set! (-> (scratchpad-object cam-dbg-scratch) color quad) v1-64) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 x) 20) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 y) (+ (the int (* f28-0 (- (arg4 arg0) arg2))) 20)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 x) 20) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 y) (+ (the int (* f28-0 (- (arg4 arg0) arg2))) 20)) (let ((s3-1 1)) (while (>= (the int (* f26-0 f30-0)) s3-1) - (let ((v1-69 (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 quad))) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 quad) v1-69) + (let ((v1-69 (-> (scratchpad-object cam-dbg-scratch) plotvec 1 quad))) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 0 quad) v1-69) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 x) (+ s3-1 20)) - (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 y) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 x) (+ s3-1 20)) + (set! (-> (scratchpad-object cam-dbg-scratch) plotvec 1 y) (+ (the int (* f28-0 (- (arg4 (+ arg0 (* f30-0 (/ (the float s3-1) (* f26-0 f30-0))))) arg2))) 20) ) (camera-line2d - (the-as vector4w (-> (the-as cam-dbg-scratch #x70000000) plotvec)) - (-> (the-as cam-dbg-scratch #x70000000) plotvec 1) + (the-as vector4w (-> (scratchpad-object cam-dbg-scratch) plotvec)) + (-> (scratchpad-object cam-dbg-scratch) plotvec 1) ) (+! s3-1 1) ) @@ -367,7 +367,7 @@ (defun camera-line-setup ((arg0 vector4w)) (let ((v1-0 (-> arg0 quad))) - (set! (-> (the-as cam-dbg-scratch #x70000000) color quad) v1-0) + (set! (-> (scratchpad-object cam-dbg-scratch) color quad) v1-0) ) (init-for-transform *identity-matrix*) 0 @@ -375,23 +375,23 @@ ) (defun camera-line-draw ((arg0 vector) (arg1 vector)) - (set! (-> (the-as cam-dbg-scratch #x70000000) linevec 0 quad) (-> arg0 quad)) - (set! (-> (the-as cam-dbg-scratch #x70000000) linevec 1 quad) (-> arg1 quad)) - (set! (-> (the-as cam-dbg-scratch #x70000000) linevec 0 w) (the-as int 1.0)) - (set! (-> (the-as cam-dbg-scratch #x70000000) linevec 1 w) (the-as int 1.0)) + (set! (-> (scratchpad-object cam-dbg-scratch) linevec 0 quad) (-> arg0 quad)) + (set! (-> (scratchpad-object cam-dbg-scratch) linevec 1 quad) (-> arg1 quad)) + (set! (-> (scratchpad-object cam-dbg-scratch) linevec 0 w) (the-as int 1.0)) + (set! (-> (scratchpad-object cam-dbg-scratch) linevec 1 w) (the-as int 1.0)) (transform-float-point - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) linevec)) - (the-as vector4w (-> (the-as cam-dbg-scratch #x70000000) linevec4w)) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) linevec)) + (the-as vector4w (-> (scratchpad-object cam-dbg-scratch) linevec4w)) ) (transform-float-point - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) linevec 1)) - (-> (the-as cam-dbg-scratch #x70000000) linevec4w 1) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) linevec 1)) + (-> (scratchpad-object cam-dbg-scratch) linevec4w 1) ) (cond - ((< (the-as uint #xe00000) (the-as uint (-> (the-as cam-dbg-scratch #x70000000) linevec4w 0 z))) + ((< (the-as uint #xe00000) (the-as uint (-> (scratchpad-object cam-dbg-scratch) linevec4w 0 z))) (return #f) ) - ((< (the-as uint #xe00000) (the-as uint (-> (the-as cam-dbg-scratch #x70000000) linevec4w 1 z))) + ((< (the-as uint #xe00000) (the-as uint (-> (scratchpad-object cam-dbg-scratch) linevec4w 1 z))) (return #f) ) ) @@ -408,19 +408,19 @@ ) (defun camera-line-rel ((arg0 vector) (arg1 vector) (arg2 vector4w)) - (vector+! (-> (the-as cam-dbg-scratch #x70000000) rel-vec) arg0 arg1) - (camera-line arg0 (-> (the-as cam-dbg-scratch #x70000000) rel-vec) arg2) + (vector+! (-> (scratchpad-object cam-dbg-scratch) rel-vec) arg0 arg1) + (camera-line arg0 (-> (scratchpad-object cam-dbg-scratch) rel-vec) arg2) (none) ) (defun camera-line-rel-len ((arg0 vector) (arg1 vector) (arg2 float) (arg3 vector4w)) - (vector-normalize-copy! (-> (the-as cam-dbg-scratch #x70000000) rel-vec) arg1 arg2) + (vector-normalize-copy! (-> (scratchpad-object cam-dbg-scratch) rel-vec) arg1 arg2) (vector+! - (-> (the-as cam-dbg-scratch #x70000000) rel-vec) - (-> (the-as cam-dbg-scratch #x70000000) rel-vec) + (-> (scratchpad-object cam-dbg-scratch) rel-vec) + (-> (scratchpad-object cam-dbg-scratch) rel-vec) arg0 ) - (camera-line arg0 (-> (the-as cam-dbg-scratch #x70000000) rel-vec) arg3) + (camera-line arg0 (-> (scratchpad-object cam-dbg-scratch) rel-vec) arg3) (none) ) @@ -430,41 +430,41 @@ (let ((f30-1 (* arg1 (sin (* 3276.8 (the float s4-0))))) (f28-1 (* arg1 (sin (* 3276.8 (the float (+ s4-0 1)))))) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) sphere-v-start y) + (set! (-> (scratchpad-object cam-dbg-scratch) sphere-v-start y) (+ (-> arg0 y) (* (cos (* 3276.8 (the float s4-0))) arg1)) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) sphere-v-end y) - (-> (the-as cam-dbg-scratch #x70000000) sphere-v-start y) + (set! (-> (scratchpad-object cam-dbg-scratch) sphere-v-end y) + (-> (scratchpad-object cam-dbg-scratch) sphere-v-start y) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) sphere-v-down y) + (set! (-> (scratchpad-object cam-dbg-scratch) sphere-v-down y) (+ (-> arg0 y) (* (cos (* 3276.8 (the float (+ s4-0 1)))) arg1)) ) (dotimes (s3-0 10) - (set! (-> (the-as cam-dbg-scratch #x70000000) sphere-v-start x) + (set! (-> (scratchpad-object cam-dbg-scratch) sphere-v-start x) (+ (-> arg0 x) (* (cos (* 6553.6 (the float s3-0))) f30-1)) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) sphere-v-start z) + (set! (-> (scratchpad-object cam-dbg-scratch) sphere-v-start z) (+ (-> arg0 z) (* (sin (* 6553.6 (the float s3-0))) f30-1)) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) sphere-v-end x) + (set! (-> (scratchpad-object cam-dbg-scratch) sphere-v-end x) (+ (-> arg0 x) (* (cos (* 6553.6 (the float (+ s3-0 1)))) f30-1)) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) sphere-v-end z) + (set! (-> (scratchpad-object cam-dbg-scratch) sphere-v-end z) (+ (-> arg0 z) (* (sin (* 6553.6 (the float (+ s3-0 1)))) f30-1)) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) sphere-v-down x) + (set! (-> (scratchpad-object cam-dbg-scratch) sphere-v-down x) (+ (-> arg0 x) (* (cos (* 6553.6 (the float s3-0))) f28-1)) ) - (set! (-> (the-as cam-dbg-scratch #x70000000) sphere-v-down z) + (set! (-> (scratchpad-object cam-dbg-scratch) sphere-v-down z) (+ (-> arg0 z) (* (sin (* 6553.6 (the float s3-0))) f28-1)) ) (camera-line-draw - (-> (the-as cam-dbg-scratch #x70000000) sphere-v-start) - (-> (the-as cam-dbg-scratch #x70000000) sphere-v-end) + (-> (scratchpad-object cam-dbg-scratch) sphere-v-start) + (-> (scratchpad-object cam-dbg-scratch) sphere-v-end) ) (camera-line-draw - (-> (the-as cam-dbg-scratch #x70000000) sphere-v-start) - (-> (the-as cam-dbg-scratch #x70000000) sphere-v-down) + (-> (scratchpad-object cam-dbg-scratch) sphere-v-start) + (-> (scratchpad-object cam-dbg-scratch) sphere-v-down) ) ) ) @@ -474,62 +474,62 @@ ) (defun camera-cross ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector4w) (arg4 meters)) - (vector-normalize-copy! (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) arg0 arg4) + (vector-normalize-copy! (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) arg0 arg4) (vector+! - (-> (the-as cam-dbg-scratch #x70000000) crossvec 1) + (-> (scratchpad-object cam-dbg-scratch) crossvec 1) arg2 - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) ) (vector-! - (-> (the-as cam-dbg-scratch #x70000000) crossvec 2) + (-> (scratchpad-object cam-dbg-scratch) crossvec 2) arg2 - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) ) (camera-line - (-> (the-as cam-dbg-scratch #x70000000) crossvec 1) - (-> (the-as cam-dbg-scratch #x70000000) crossvec 2) + (-> (scratchpad-object cam-dbg-scratch) crossvec 1) + (-> (scratchpad-object cam-dbg-scratch) crossvec 2) arg3 ) (vector-cross! - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) arg1 ) - (vector-normalize! (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) arg4) + (vector-normalize! (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) arg4) (vector+! - (-> (the-as cam-dbg-scratch #x70000000) crossvec 1) + (-> (scratchpad-object cam-dbg-scratch) crossvec 1) arg2 - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) ) (vector-! - (-> (the-as cam-dbg-scratch #x70000000) crossvec 2) + (-> (scratchpad-object cam-dbg-scratch) crossvec 2) arg2 - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) ) (camera-line - (-> (the-as cam-dbg-scratch #x70000000) crossvec 1) - (-> (the-as cam-dbg-scratch #x70000000) crossvec 2) + (-> (scratchpad-object cam-dbg-scratch) crossvec 1) + (-> (scratchpad-object cam-dbg-scratch) crossvec 2) arg3 ) (vector-cross! - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) arg0 ) - (vector-normalize! (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) arg4) + (vector-normalize! (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) arg4) (vector+! - (-> (the-as cam-dbg-scratch #x70000000) crossvec 1) + (-> (scratchpad-object cam-dbg-scratch) crossvec 1) arg2 - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) ) (vector-! - (-> (the-as cam-dbg-scratch #x70000000) crossvec 2) + (-> (scratchpad-object cam-dbg-scratch) crossvec 2) arg2 - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) crossvec)) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) crossvec)) ) (camera-line - (-> (the-as cam-dbg-scratch #x70000000) crossvec 1) - (-> (the-as cam-dbg-scratch #x70000000) crossvec 2) + (-> (scratchpad-object cam-dbg-scratch) crossvec 1) + (-> (scratchpad-object cam-dbg-scratch) crossvec 2) arg3 ) (none) @@ -537,47 +537,47 @@ (defun camera-bounding-box-draw ((arg0 bounding-box) (arg1 basic) (arg2 rgba)) (camera-line-setup (new 'static 'vector4w :x #x7f :y #x7f :z #x7f :w #x80)) - (set! (-> (the-as cam-dbg-scratch #x70000000) bboxvec 0 quad) (-> arg0 min quad)) - (set! (-> (the-as cam-dbg-scratch #x70000000) bboxvec 0 x) (-> arg0 max x)) - (set! (-> (the-as cam-dbg-scratch #x70000000) bboxvec 1 quad) (-> arg0 min quad)) - (set! (-> (the-as cam-dbg-scratch #x70000000) bboxvec 1 y) (-> arg0 max y)) - (set! (-> (the-as cam-dbg-scratch #x70000000) bboxvec 2 quad) (-> arg0 min quad)) - (set! (-> (the-as cam-dbg-scratch #x70000000) bboxvec 2 z) (-> arg0 max z)) - (set! (-> (the-as cam-dbg-scratch #x70000000) bboxvec 3 quad) (-> arg0 max quad)) - (set! (-> (the-as cam-dbg-scratch #x70000000) bboxvec 3 x) (-> arg0 min x)) - (set! (-> (the-as cam-dbg-scratch #x70000000) bboxvec 4 quad) (-> arg0 max quad)) - (set! (-> (the-as cam-dbg-scratch #x70000000) bboxvec 4 y) (-> arg0 min y)) - (set! (-> (the-as cam-dbg-scratch #x70000000) bboxvec 5 quad) (-> arg0 max quad)) - (set! (-> (the-as cam-dbg-scratch #x70000000) bboxvec 5 z) (-> arg0 min z)) - (camera-line-draw (-> arg0 min) (the-as vector (-> (the-as cam-dbg-scratch #x70000000) bboxvec))) - (camera-line-draw (-> arg0 min) (-> (the-as cam-dbg-scratch #x70000000) bboxvec 1)) - (camera-line-draw (-> arg0 min) (-> (the-as cam-dbg-scratch #x70000000) bboxvec 2)) - (camera-line-draw (-> arg0 max) (-> (the-as cam-dbg-scratch #x70000000) bboxvec 3)) - (camera-line-draw (-> arg0 max) (-> (the-as cam-dbg-scratch #x70000000) bboxvec 4)) - (camera-line-draw (-> arg0 max) (-> (the-as cam-dbg-scratch #x70000000) bboxvec 5)) + (set! (-> (scratchpad-object cam-dbg-scratch) bboxvec 0 quad) (-> arg0 min quad)) + (set! (-> (scratchpad-object cam-dbg-scratch) bboxvec 0 x) (-> arg0 max x)) + (set! (-> (scratchpad-object cam-dbg-scratch) bboxvec 1 quad) (-> arg0 min quad)) + (set! (-> (scratchpad-object cam-dbg-scratch) bboxvec 1 y) (-> arg0 max y)) + (set! (-> (scratchpad-object cam-dbg-scratch) bboxvec 2 quad) (-> arg0 min quad)) + (set! (-> (scratchpad-object cam-dbg-scratch) bboxvec 2 z) (-> arg0 max z)) + (set! (-> (scratchpad-object cam-dbg-scratch) bboxvec 3 quad) (-> arg0 max quad)) + (set! (-> (scratchpad-object cam-dbg-scratch) bboxvec 3 x) (-> arg0 min x)) + (set! (-> (scratchpad-object cam-dbg-scratch) bboxvec 4 quad) (-> arg0 max quad)) + (set! (-> (scratchpad-object cam-dbg-scratch) bboxvec 4 y) (-> arg0 min y)) + (set! (-> (scratchpad-object cam-dbg-scratch) bboxvec 5 quad) (-> arg0 max quad)) + (set! (-> (scratchpad-object cam-dbg-scratch) bboxvec 5 z) (-> arg0 min z)) + (camera-line-draw (-> arg0 min) (the-as vector (-> (scratchpad-object cam-dbg-scratch) bboxvec))) + (camera-line-draw (-> arg0 min) (-> (scratchpad-object cam-dbg-scratch) bboxvec 1)) + (camera-line-draw (-> arg0 min) (-> (scratchpad-object cam-dbg-scratch) bboxvec 2)) + (camera-line-draw (-> arg0 max) (-> (scratchpad-object cam-dbg-scratch) bboxvec 3)) + (camera-line-draw (-> arg0 max) (-> (scratchpad-object cam-dbg-scratch) bboxvec 4)) + (camera-line-draw (-> arg0 max) (-> (scratchpad-object cam-dbg-scratch) bboxvec 5)) (camera-line-draw - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) bboxvec)) - (-> (the-as cam-dbg-scratch #x70000000) bboxvec 4) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) bboxvec)) + (-> (scratchpad-object cam-dbg-scratch) bboxvec 4) ) (camera-line-draw - (-> (the-as cam-dbg-scratch #x70000000) bboxvec 4) - (-> (the-as cam-dbg-scratch #x70000000) bboxvec 2) + (-> (scratchpad-object cam-dbg-scratch) bboxvec 4) + (-> (scratchpad-object cam-dbg-scratch) bboxvec 2) ) (camera-line-draw - (-> (the-as cam-dbg-scratch #x70000000) bboxvec 2) - (-> (the-as cam-dbg-scratch #x70000000) bboxvec 3) + (-> (scratchpad-object cam-dbg-scratch) bboxvec 2) + (-> (scratchpad-object cam-dbg-scratch) bboxvec 3) ) (camera-line-draw - (-> (the-as cam-dbg-scratch #x70000000) bboxvec 3) - (-> (the-as cam-dbg-scratch #x70000000) bboxvec 1) + (-> (scratchpad-object cam-dbg-scratch) bboxvec 3) + (-> (scratchpad-object cam-dbg-scratch) bboxvec 1) ) (camera-line-draw - (-> (the-as cam-dbg-scratch #x70000000) bboxvec 1) - (-> (the-as cam-dbg-scratch #x70000000) bboxvec 5) + (-> (scratchpad-object cam-dbg-scratch) bboxvec 1) + (-> (scratchpad-object cam-dbg-scratch) bboxvec 5) ) (camera-line-draw - (-> (the-as cam-dbg-scratch #x70000000) bboxvec 5) - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) bboxvec)) + (-> (scratchpad-object cam-dbg-scratch) bboxvec 5) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) bboxvec)) ) 0 (none) @@ -657,7 +657,7 @@ (when *display-cam-los-marks* (dotimes (gp-1 *cam-debug-los-tri-current*) (let ((v1-7 (-> *cam-debug-los-tri* gp-1 color quad))) - (set! (-> (the-as cam-dbg-scratch #x70000000) color quad) v1-7) + (set! (-> (scratchpad-object cam-dbg-scratch) color quad) v1-7) ) (camera-line-draw (the-as vector (+ (the-as uint (-> *cam-debug-los-tri* 0)) (* 80 gp-1))) @@ -683,7 +683,7 @@ (when *display-cam-coll-marks* (dotimes (gp-2 *cam-debug-coll-tri-current*) (let ((v1-34 (-> *cam-debug-coll-tri* gp-2 color quad))) - (set! (-> (the-as cam-dbg-scratch #x70000000) color quad) v1-34) + (set! (-> (scratchpad-object cam-dbg-scratch) color quad) v1-34) ) (camera-line-draw (the-as vector (+ (the-as uint (-> *cam-debug-coll-tri* 0)) (* 80 gp-2))) @@ -711,117 +711,117 @@ (defun camera-fov-draw ((arg0 int) (arg1 int) (arg2 vector) (arg3 float) (arg4 float) (arg5 vector4w)) (vector+float*! - (the-as vector (-> (the-as cam-dbg-scratch #x70000000) fov-vv)) + (the-as vector (-> (scratchpad-object cam-dbg-scratch) fov-vv)) arg2 (the-as vector arg1) arg3 ) - (vector+float*! (the-as vector (the-as (pointer vector) (+ 352 #x70000000))) arg2 (the-as vector arg0) arg3) - (vector+float*! (the-as vector (+ 368 #x70000000)) arg2 (the-as vector arg0) arg4) - (vector+float*! (the-as vector (+ 384 #x70000000)) arg2 (the-as vector arg1) arg4) + (vector+float*! (the-as vector (the-as (pointer vector) (+ 352 (scratchpad-object int)))) arg2 (the-as vector arg0) arg3) + (vector+float*! (the-as vector (+ 368 (scratchpad-object int))) arg2 (the-as vector arg0) arg4) + (vector+float*! (the-as vector (+ 384 (scratchpad-object int))) arg2 (the-as vector arg1) arg4) (camera-line-setup arg5) - (camera-line-draw (the-as vector (+ 336 #x70000000)) (the-as vector (+ 352 #x70000000))) + (camera-line-draw (the-as vector (+ 336 (scratchpad-object int))) (the-as vector (+ 352 (scratchpad-object int)))) (camera-line-draw - (the-as vector (&+ (the-as (pointer vector) 352) #x70000000)) - (the-as vector (+ 368 #x70000000)) + (the-as vector (&+ (the-as (pointer vector) 352) (scratchpad-object int))) + (the-as vector (+ 368 (scratchpad-object int))) ) - (camera-line-draw (the-as vector (+ 368 #x70000000)) (the-as vector (+ 384 #x70000000))) + (camera-line-draw (the-as vector (+ 368 (scratchpad-object int))) (the-as vector (+ 384 (scratchpad-object int)))) (none) ) (defun camera-fov-frame ((arg0 matrix) (arg1 vector) (arg2 float) (arg3 float) (arg4 float) (arg5 vector4w)) - (vector-float*! (-> (the-as cam-dbg-scratch #x70000000) fov-vert) (-> arg0 vector 1) (* arg3 (tan arg2))) + (vector-float*! (-> (scratchpad-object cam-dbg-scratch) fov-vert) (-> arg0 vector 1) (* arg3 (tan arg2))) (vector-float*! - (-> (the-as cam-dbg-scratch #x70000000) fov-horz) + (-> (scratchpad-object cam-dbg-scratch) fov-horz) (the-as vector (-> arg0 vector)) (* arg4 (tan arg2)) ) (vector+! - (-> (the-as cam-dbg-scratch #x70000000) fov-src) + (-> (scratchpad-object cam-dbg-scratch) fov-src) (-> arg0 vector 2) (vector+! - (-> (the-as cam-dbg-scratch #x70000000) fov-src) - (-> (the-as cam-dbg-scratch #x70000000) fov-vert) - (-> (the-as cam-dbg-scratch #x70000000) fov-horz) + (-> (scratchpad-object cam-dbg-scratch) fov-src) + (-> (scratchpad-object cam-dbg-scratch) fov-vert) + (-> (scratchpad-object cam-dbg-scratch) fov-horz) ) ) - (vector-normalize! (-> (the-as cam-dbg-scratch #x70000000) fov-src) 1.0) + (vector-normalize! (-> (scratchpad-object cam-dbg-scratch) fov-src) 1.0) (vector+! - (-> (the-as cam-dbg-scratch #x70000000) fov-dest) + (-> (scratchpad-object cam-dbg-scratch) fov-dest) (-> arg0 vector 2) (vector-! - (-> (the-as cam-dbg-scratch #x70000000) fov-dest) - (-> (the-as cam-dbg-scratch #x70000000) fov-vert) - (-> (the-as cam-dbg-scratch #x70000000) fov-horz) + (-> (scratchpad-object cam-dbg-scratch) fov-dest) + (-> (scratchpad-object cam-dbg-scratch) fov-vert) + (-> (scratchpad-object cam-dbg-scratch) fov-horz) ) ) - (vector-normalize! (-> (the-as cam-dbg-scratch #x70000000) fov-dest) 1.0) + (vector-normalize! (-> (scratchpad-object cam-dbg-scratch) fov-dest) 1.0) (camera-fov-draw - (the-as int (-> (the-as cam-dbg-scratch #x70000000) fov-src)) - (the-as int (-> (the-as cam-dbg-scratch #x70000000) fov-dest)) + (the-as int (-> (scratchpad-object cam-dbg-scratch) fov-src)) + (the-as int (-> (scratchpad-object cam-dbg-scratch) fov-dest)) arg1 4096.0 20480.0 arg5 ) - (set! (-> (the-as cam-dbg-scratch #x70000000) fov-src quad) - (-> (the-as vector4w (-> (the-as cam-dbg-scratch #x70000000) fov-dest)) quad) + (set! (-> (scratchpad-object cam-dbg-scratch) fov-src quad) + (-> (the-as vector4w (-> (scratchpad-object cam-dbg-scratch) fov-dest)) quad) ) (vector-! - (-> (the-as cam-dbg-scratch #x70000000) fov-dest) + (-> (scratchpad-object cam-dbg-scratch) fov-dest) (-> arg0 vector 2) (vector+! - (-> (the-as cam-dbg-scratch #x70000000) fov-dest) - (-> (the-as cam-dbg-scratch #x70000000) fov-vert) - (-> (the-as cam-dbg-scratch #x70000000) fov-horz) + (-> (scratchpad-object cam-dbg-scratch) fov-dest) + (-> (scratchpad-object cam-dbg-scratch) fov-vert) + (-> (scratchpad-object cam-dbg-scratch) fov-horz) ) ) - (vector-normalize! (-> (the-as cam-dbg-scratch #x70000000) fov-dest) 1.0) + (vector-normalize! (-> (scratchpad-object cam-dbg-scratch) fov-dest) 1.0) (camera-fov-draw - (the-as int (-> (the-as cam-dbg-scratch #x70000000) fov-src)) - (the-as int (-> (the-as cam-dbg-scratch #x70000000) fov-dest)) + (the-as int (-> (scratchpad-object cam-dbg-scratch) fov-src)) + (the-as int (-> (scratchpad-object cam-dbg-scratch) fov-dest)) arg1 4096.0 20480.0 arg5 ) - (set! (-> (the-as cam-dbg-scratch #x70000000) fov-src quad) - (-> (the-as vector4w (-> (the-as cam-dbg-scratch #x70000000) fov-dest)) quad) + (set! (-> (scratchpad-object cam-dbg-scratch) fov-src quad) + (-> (the-as vector4w (-> (scratchpad-object cam-dbg-scratch) fov-dest)) quad) ) (vector-! - (-> (the-as cam-dbg-scratch #x70000000) fov-dest) + (-> (scratchpad-object cam-dbg-scratch) fov-dest) (-> arg0 vector 2) (vector-! - (-> (the-as cam-dbg-scratch #x70000000) fov-dest) - (-> (the-as cam-dbg-scratch #x70000000) fov-vert) - (-> (the-as cam-dbg-scratch #x70000000) fov-horz) + (-> (scratchpad-object cam-dbg-scratch) fov-dest) + (-> (scratchpad-object cam-dbg-scratch) fov-vert) + (-> (scratchpad-object cam-dbg-scratch) fov-horz) ) ) - (vector-normalize! (-> (the-as cam-dbg-scratch #x70000000) fov-dest) 1.0) + (vector-normalize! (-> (scratchpad-object cam-dbg-scratch) fov-dest) 1.0) (camera-fov-draw - (the-as int (-> (the-as cam-dbg-scratch #x70000000) fov-src)) - (the-as int (-> (the-as cam-dbg-scratch #x70000000) fov-dest)) + (the-as int (-> (scratchpad-object cam-dbg-scratch) fov-src)) + (the-as int (-> (scratchpad-object cam-dbg-scratch) fov-dest)) arg1 4096.0 20480.0 arg5 ) - (set! (-> (the-as cam-dbg-scratch #x70000000) fov-src quad) - (-> (the-as vector4w (-> (the-as cam-dbg-scratch #x70000000) fov-dest)) quad) + (set! (-> (scratchpad-object cam-dbg-scratch) fov-src quad) + (-> (the-as vector4w (-> (scratchpad-object cam-dbg-scratch) fov-dest)) quad) ) (vector+! - (-> (the-as cam-dbg-scratch #x70000000) fov-dest) + (-> (scratchpad-object cam-dbg-scratch) fov-dest) (-> arg0 vector 2) (vector+! - (-> (the-as cam-dbg-scratch #x70000000) fov-dest) - (-> (the-as cam-dbg-scratch #x70000000) fov-vert) - (-> (the-as cam-dbg-scratch #x70000000) fov-horz) + (-> (scratchpad-object cam-dbg-scratch) fov-dest) + (-> (scratchpad-object cam-dbg-scratch) fov-vert) + (-> (scratchpad-object cam-dbg-scratch) fov-horz) ) ) - (vector-normalize! (-> (the-as cam-dbg-scratch #x70000000) fov-dest) 1.0) + (vector-normalize! (-> (scratchpad-object cam-dbg-scratch) fov-dest) 1.0) (the-as symbol (camera-fov-draw - (the-as int (-> (the-as cam-dbg-scratch #x70000000) fov-src)) - (the-as int (-> (the-as cam-dbg-scratch #x70000000) fov-dest)) + (the-as int (-> (scratchpad-object cam-dbg-scratch) fov-src)) + (the-as int (-> (scratchpad-object cam-dbg-scratch) fov-dest)) arg1 4096.0 20480.0 diff --git a/goal_src/jak2/engine/camera/cam-master.gc b/goal_src/jak2/engine/camera/cam-master.gc index 277ebbea2a..9ef9415244 100644 --- a/goal_src/jak2/engine/camera/cam-master.gc +++ b/goal_src/jak2/engine/camera/cam-master.gc @@ -5,7 +5,6 @@ ;; name in dgo: cam-master ;; dgos: ENGINE, GAME -;; TODO - waiting for particle code for cam-master-effect and such, two instances of commented out code here ;;og:ignore-form:camera-master-method-16 @@ -966,8 +965,7 @@ (-> self local-down) (vector-normalize-copy! (-> self local-down) (-> *standard-dynamics* gravity) 1.0) ) - ;; TODO - waiting for particle code - ;; (cam-master-effect) + (cam-master-effect) ) (none) ) @@ -1069,9 +1067,8 @@ (let ((a1-4 (new-stack-vector0))) (tracking-spline-method-10 (-> self target-spline) a1-4) ) - ;; TODO - waiting for particle code - ;; (set! (-> self water-drip) (create-launch-control group-rain-screend-drop self)) - ;; (set! (-> self water-drip-time) (seconds -60)) + (set! (-> self water-drip) (create-launch-control group-rain-screend-drop self)) + (set! (-> self water-drip-time) (seconds -60)) (go cam-master-active) 0 (none) diff --git a/goal_src/jak2/engine/camera/cam-states.gc b/goal_src/jak2/engine/camera/cam-states.gc index cb080a33f5..044f5e0e38 100644 --- a/goal_src/jak2/engine/camera/cam-states.gc +++ b/goal_src/jak2/engine/camera/cam-states.gc @@ -1524,7 +1524,7 @@ (set! sv-208 (+ sv-208 1)) ) (cond - ((and s0-0 (!= s4-0 -859915232)) + ((and s0-0 (!= (the-as int s4-0) -859915232)) (dotimes (s4-1 4) (dist-info-append (-> gp-0 straddle) (the-as vector (+ (the-as uint s5-0) (* s4-1 16)))) ) @@ -1613,7 +1613,7 @@ (set! s3-0 (-> (the-as (inline-array collide-cache-tri) s3-0) 1)) ) ) - (if (= f30-0 #x40000000) + (if (= (the-as int f30-0) #x40000000) (set! f30-0 -1.0) ) f30-0 @@ -1853,7 +1853,7 @@ (los-cw-ccw (the-as (inline-array collide-cache-tri) s1-1) s2-0 s4-0 f30-0 arg2 sv-800 f24-0) (when *debug-segment* (cond - ((= f24-0 -859915232) + ((= (the-as int f24-0) -859915232) (let ((t9-10 cam-debug-add-los-tri) (a0-20 s1-1) (a2-6 (new 'static 'vector :x (the-as float #x80) :w (the-as float #x80))) @@ -1888,7 +1888,7 @@ ) (los-cw-ccw (the-as (inline-array collide-cache-tri) s1-1) s2-0 s4-0 f30-0 arg2 sv-800 f24-1) (when *debug-segment* - (if (= f24-1 -859915232) + (if (= (the-as int f24-1) -859915232) (cam-debug-add-los-tri (the-as (inline-array collide-cache-tri) s1-1) sv-800 diff --git a/goal_src/jak2/engine/debug/default-menu.gc b/goal_src/jak2/engine/debug/default-menu.gc index 9d66705da8..158be30dec 100644 --- a/goal_src/jak2/engine/debug/default-menu.gc +++ b/goal_src/jak2/engine/debug/default-menu.gc @@ -202,23 +202,23 @@ (defun dm-cam-setting-float ((arg0 float) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) (when (= arg1 (debug-menu-msg press)) - (case arg0 - (('fov) - (if (not (setting-control-method-14 *setting-control* 'fov)) - (set! arg2 64.0) - ) - (set-setting-by-param *setting-control* 'fov #f (* 182.04445 arg2) 0) - (if *camera-combiner* - (set! (-> *camera-combiner* fov) (* 182.04445 arg2)) - ) - (if (and *camera* (-> *camera* slave)) - (set! (-> *camera* slave 0 fov) (* 182.04445 arg2)) - ) - ) + (let ((v1-2 arg0)) + (when (= (the-as int v1-2) 'fov) + (if (not (setting-control-method-14 *setting-control* 'fov)) + (set! arg2 64.0) + ) + (set-setting-by-param *setting-control* 'fov #f (* 182.04445 arg2) 0) + (if *camera-combiner* + (set! (-> *camera-combiner* fov) (* 182.04445 arg2)) + ) + (if (and *camera* (-> *camera* slave)) + (set! (-> *camera* slave 0 fov) (* 182.04445 arg2)) + ) + ) ) ) (cond - ((= arg0 'fov) + ((= (the-as int arg0) 'fov) (cond ((setting-control-method-14 *setting-control* 'fov) (empty) @@ -835,7 +835,7 @@ ) (defun dm-vu1-user-all-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) - (let ((v1-1 (-> (new 'static 'array uint64 1 #x5fffffff8) 0))) + (let ((v1-1 (the-as uint #x5fffffff8))) (if (= arg1 (debug-menu-msg press)) (set! (-> *display* vu1-enable-user-menu) (the-as vu1-renderer-mask v1-1)) ) @@ -1673,16 +1673,12 @@ (cond (a0-3 (when (= arg1 (debug-menu-msg press)) - ;; (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) - ;; (while (nonzero? (the-as int a1-8)) - ;; (set! (-> (the-as adgif-shader a1-8) tex1) - ;; (logior (logand (-> (the-as adgif-shader a1-8) tex1) (-> (new 'static 'array uint64 1 #xfffff000ffffffff) 0)) - ;; (shr (shl (the-as int arg2) 52) 20) - ;; ) - ;; ) - ;; (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ;; ) - ;; ) + (let ((a1-8 (the-as object (* (the-as int (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 k) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) ) (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) (if (nonzero? (the-as uint v1-8)) @@ -1875,16 +1871,12 @@ (cond (a0-3 (when (= arg1 (debug-menu-msg press)) - ;; (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) - ;; (while (nonzero? (the-as int a1-8)) - ;; (set! (-> (the-as adgif-shader a1-8) tex0) - ;; (logior (logand (-> (the-as adgif-shader a1-8) tex0) (-> (new 'static 'array uint64 1 #xffffffe7ffffffff) 0)) - ;; (shr (shl (the-as int arg2) 62) 27) - ;; ) - ;; ) - ;; (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ;; ) - ;; ) + (let ((a1-8 (the-as object (* (the-as int (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tfx) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) ) (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) (if (nonzero? (the-as uint v1-8)) @@ -2077,16 +2069,12 @@ (cond (a0-3 (when (= arg1 (debug-menu-msg press)) - ;; (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) - ;; (while (nonzero? (the-as int a1-8)) - ;; (set! (-> (the-as adgif-shader a1-8) tex0) - ;; (logior (logand (-> (the-as adgif-shader a1-8) tex0) (-> (new 'static 'array uint64 1 #xfffffffc3fffffff) 0)) - ;; (shr (shl (the-as int arg2) 60) 30) - ;; ) - ;; ) - ;; (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ;; ) - ;; ) + (let ((a1-8 (the-as object (* (the-as int (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 th) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) ) (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) (if (nonzero? (the-as uint v1-8)) @@ -2377,16 +2365,12 @@ (cond (a0-3 (when (= arg1 (debug-menu-msg press)) - ;; (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) - ;; (while (nonzero? (the-as int a1-8)) - ;; (set! (-> (the-as adgif-shader a1-8) clamp) - ;; (logior (logand (-> (the-as adgif-shader a1-8) clamp) (-> (new 'static 'array uint64 1 #xfffffffc00ffffff) 0)) - ;; (shr (shl (the-as int arg2) 54) 30) - ;; ) - ;; ) - ;; (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ;; ) - ;; ) + (let ((a1-8 (the-as object (* (the-as int (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp minv) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) ) (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) (if (nonzero? (the-as uint v1-8)) @@ -2432,16 +2416,12 @@ (cond (a0-3 (when (= arg1 (debug-menu-msg press)) - ;; (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) - ;; (while (nonzero? (the-as int a1-8)) - ;; (set! (-> (the-as adgif-shader a1-8) clamp) - ;; (logior (logand (-> (the-as adgif-shader a1-8) clamp) (-> (new 'static 'array uint64 1 #xfffff003ffffffff) 0)) - ;; (shr (shl (the-as int arg2) 54) 20) - ;; ) - ;; ) - ;; (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ;; ) - ;; ) + (let ((a1-8 (the-as object (* (the-as int (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp maxv) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) ) (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) (if (nonzero? (the-as uint v1-8)) diff --git a/goal_src/jak2/engine/debug/editable-player.gc b/goal_src/jak2/engine/debug/editable-player.gc index db927bd690..a695bcd306 100644 --- a/goal_src/jak2/engine/debug/editable-player.gc +++ b/goal_src/jak2/engine/debug/editable-player.gc @@ -44,6 +44,41 @@ (none) ) +;; WARN: Failed store: (s.w! (+ a0-9 120) v1-10) at op 39 +;; WARN: Failed store: (s.w! (+ a0-18 120) #f) at op 57 +;; WARN: Failed store: (s.w! (+ a0-24 120) v1-21) at op 93 +;; WARN: Failed store: (s.w! (+ a0-30 120) v1-24) at op 118 +;; WARN: Failed store: (s.w! (+ a0-36 120) v1-27) at op 143 +;; WARN: Failed store: (s.w! (+ a0-42 120) v1-30) at op 168 +;; WARN: Failed store: (s.w! (+ a0-48 120) v1-33) at op 193 +;; WARN: Failed store: (s.w! (+ a0-54 120) v1-36) at op 218 +;; WARN: Failed store: (s.w! (+ a0-60 120) v1-39) at op 243 +;; WARN: Failed store: (s.w! (+ a0-65 120) v1-42) at op 267 +;; WARN: Failed load: (set! a0-67 (l.wu (+ v1-47 120))) at op 278 +;; WARN: Failed load: (set! a0-68 (l.wu (+ v1-52 120))) at op 287 +;; WARN: Failed load: (set! a0-69 (l.wu (+ v1-57 120))) at op 296 +;; WARN: Failed load: (set! a0-70 (l.wu (+ v1-62 120))) at op 305 +;; WARN: Failed load: (set! a0-73 (l.wu (+ v1-71 120))) at op 329 +;; WARN: Failed load: (set! a0-74 (l.wu (+ v1-76 120))) at op 338 +;; WARN: Failed load: (set! a0-75 (l.wu (+ v1-81 120))) at op 347 +;; WARN: Failed load: (set! a0-76 (l.wu (+ v1-86 120))) at op 356 +;; WARN: Failed load: (set! a0-80 (l.wu (+ v1-97 120))) at op 387 +;; WARN: Failed load: (set! a0-81 (l.wu (+ v1-102 120))) at op 396 +;; WARN: Failed load: (set! a0-82 (l.wu (+ v1-107 120))) at op 405 +;; WARN: Failed load: (set! a0-83 (l.wu (+ v1-112 120))) at op 414 +;; WARN: Failed load: (set! a0-86 (l.wu (+ v1-121 120))) at op 438 +;; WARN: Failed load: (set! a0-87 (l.wu (+ v1-126 120))) at op 447 +;; WARN: Failed load: (set! a0-88 (l.wu (+ v1-131 120))) at op 456 +;; WARN: Failed load: (set! a0-89 (l.wu (+ v1-136 120))) at op 465 +;; WARN: Failed load: (set! a0-93 (l.wu (+ v1-147 120))) at op 496 +;; WARN: Failed load: (set! a0-94 (l.wu (+ v1-152 120))) at op 505 +;; WARN: Failed load: (set! a0-95 (l.wu (+ v1-157 120))) at op 514 +;; WARN: Failed load: (set! a0-96 (l.wu (+ v1-162 120))) at op 523 +;; WARN: Failed load: (set! a0-100 (l.wu (+ v1-173 120))) at op 554 +;; WARN: Failed load: (set! a0-101 (l.wu (+ v1-178 120))) at op 563 +;; WARN: Failed load: (set! a0-102 (l.wu (+ v1-183 120))) at op 572 +;; WARN: Failed load: (set! a0-103 (l.wu (+ v1-188 120))) at op 581 +;; WARN: Failed load: (set! a0-106 (l.wu (+ v1-199 120))) at op 610 ;; WARN: Function insert-box has a return type of none, but the expression builder found a return statement. (defun execute-select ((arg0 editable-array) (arg1 editable-command) (arg2 editable-array)) @@ -85,18 +120,7 @@ ) ) (((editable-command select-one)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-7 arg0) (t9-4 (method-of-object a0-7 editable-array-method-10)) (a1-12 (new 'stack-no-clear 'vector)) @@ -117,18 +141,7 @@ ) ) (((editable-command select-toggle)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-12 arg0) (t9-9 (method-of-object a0-12 editable-array-method-10)) (a1-16 (new 'stack-no-clear 'vector)) @@ -148,18 +161,7 @@ ) ) (((editable-command select-region)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-16 arg0) (t9-13 (method-of-object a0-16 editable-array-method-10)) (a1-19 (new 'stack-no-clear 'vector)) @@ -183,18 +185,7 @@ ) ) (((editable-command select-face)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-22 arg0) (t9-19 (method-of-object a0-22 editable-array-method-10)) (a1-24 (new 'stack-no-clear 'vector)) @@ -218,18 +209,7 @@ ) ) (((editable-command select-prim)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-28 arg0) (t9-25 (method-of-object a0-28 editable-array-method-10)) (a1-29 (new 'stack-no-clear 'vector)) @@ -253,18 +233,7 @@ ) ) (((editable-command select-current-region)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (when (-> arg0 region) (let ((s4-12 (-> arg0 region))) (editable-array-method-9 arg0 (editable-command select-none) arg2) @@ -417,18 +386,7 @@ (editable-array-method-13 arg0 (the-as uint 0) (the-as basic 0) (the-as string #f)) ) (((editable-command pick-target)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-71 arg0) (t9-41 (method-of-object a0-71 editable-array-method-10)) (a1-58 (new 'stack-no-clear 'vector)) @@ -447,50 +405,17 @@ (editable-array-method-13 arg0 (the-as uint 0) (the-as basic 0) (the-as string #f)) ) (((editable-command pick-loc) (editable-command pick-yes-no)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (editable-array-method-9 arg0 (the-as editable-command (-> arg0 target-command)) arg2) (editable-array-method-13 arg0 (the-as uint 0) (the-as basic 0) (the-as string #f)) ) (((editable-command edit-plane-clear)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (set! (-> arg0 edit-plane) #f) (editable-array-method-16 arg0) ) (((editable-command edit-plane-set)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (cond ((-> arg0 target) (let ((s5-11 (-> arg0 target))) @@ -875,18 +800,7 @@ (if (and (-> arg0 region) (-> arg0 region locked)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a2-3 (editable-array-method-17 arg0 (new 'stack-no-clear 'vector) (-> arg2 edit-plane-normal))) (s3-4 (new 'debug 'editable-sphere a2-3 2048.0 (-> arg0 region))) ) @@ -903,18 +817,7 @@ (if (and (-> arg0 region) (-> arg0 region locked)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a2-7 (editable-array-method-17 arg0 (new 'stack-no-clear 'vector) (-> arg2 edit-plane-normal))) (s3-6 (new 'debug 'editable-point a2-7 (-> arg0 region))) ) @@ -928,18 +831,7 @@ (((editable-command insert-sample)) (let ((s4-5 (editable-array-method-11 arg0))) (when (>= s4-5 0) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a2-11 (editable-array-method-17 arg0 (new 'stack-no-clear 'vector) (-> arg2 edit-plane-normal))) (s3-8 (new 'debug 'editable-sample a2-11 *editable-sample-region*)) ) @@ -953,18 +845,7 @@ (((editable-command insert-sample-camera)) (let ((s4-6 (editable-array-method-11 arg0))) (when (>= s4-6 0) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let ((s3-11 (new 'debug 'editable-sample (math-camera-pos) *editable-sample-region*))) (set! (-> arg0 data s4-6) s3-11) (editable-array-method-9 arg0 (editable-command select-none) arg2) @@ -976,18 +857,7 @@ (((editable-command insert-light)) (let ((s4-7 (editable-array-method-11 arg0))) (when (>= s4-7 0) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a2-18 (editable-array-method-17 arg0 (new 'stack-no-clear 'vector) (-> arg2 edit-plane-normal))) (s3-13 (new 'debug 'editable-light a2-18 2048.0 *editable-light-region*)) ) @@ -1003,18 +873,7 @@ (((editable-command insert-entity)) (let ((s4-8 (editable-array-method-11 arg0))) (when (>= s4-8 0) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a2-22 (editable-array-method-17 arg0 (new 'stack-no-clear 'vector) (-> arg2 edit-plane-normal))) (s3-15 (new 'debug 'editable-entity a2-22 *editable-entity-region*)) ) @@ -1026,18 +885,7 @@ ) ) (((editable-command insert-box)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (if (and (-> arg0 region) (-> arg0 region locked)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) @@ -1046,18 +894,7 @@ ) ) (((editable-command insert-face)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (if (and (-> arg0 region) (-> arg0 region locked)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) @@ -1117,18 +954,7 @@ (if (and (-> arg0 region) (-> arg0 region locked)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let ((s3-18 (editable-array-method-11 arg0))) 0 (editable-array-method-14 @@ -1200,18 +1026,7 @@ ) (cond ((= arg0 (editable-command copy)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (set! (-> obj selection length) 0) (let* ((s4-2 (-> obj length)) (s3-1 0) @@ -1245,18 +1060,7 @@ ) ) ((= arg0 (editable-command copy-region)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (when (and (-> obj region) (not (-> obj region locked))) (editable-array-method-9 obj (editable-command select-current-region) arg1) (let ((v1-52 (copy (-> obj region) 'debug))) @@ -1268,18 +1072,7 @@ ) ) ((= arg0 (editable-command delete)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((s5-3 (-> obj length)) (s4-6 0) (s3-3 (-> obj data s4-6)) @@ -1302,18 +1095,7 @@ ) ((= arg0 (editable-command delete-region)) (when (-> obj region) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (when (!= (-> obj region) *editable-light-region*) (editable-array-method-9 obj (editable-command select-current-region) arg1) (editable-array-method-9 obj (editable-command delete) arg1) @@ -1322,18 +1104,7 @@ ) ) ((= arg0 (editable-command snap-to-ground)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((s5-5 (new 'stack-no-clear 'vector)) (s4-9 (-> obj length)) (s3-5 0) @@ -1351,18 +1122,7 @@ ) ) ((= arg0 (editable-command snap-y)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (cond ((-> obj target) (let* ((s5-7 (edit-get-trans (-> obj target))) @@ -1385,18 +1145,7 @@ ) ) ((= arg0 (editable-command snap-xz)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (cond ((-> obj target) (let* ((s5-9 (edit-get-trans (-> obj target))) @@ -1420,18 +1169,7 @@ ) ((= arg0 (editable-command region-set)) (when (and (-> obj region) (not (-> obj region locked))) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((s5-11 (-> obj length)) (s4-15 0) (a0-44 (-> obj data s4-15)) @@ -1448,18 +1186,7 @@ ) ((= arg0 (editable-command region-add)) (when (and (-> obj region) (not (-> obj region locked))) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (if (-> obj target) (editable-method-21 (-> obj target) (-> obj region)) (editable-array-method-13 obj (the-as uint 14) (the-as basic 49) "pick the editable to add to current region") @@ -1476,18 +1203,7 @@ (editable-array-method-9 obj (editable-command region-set) arg1) ) ((= arg0 (editable-command flip-side)) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((s5-14 (-> obj length)) (s4-18 0) (a0-58 (-> obj data s4-18)) @@ -1791,14 +1507,14 @@ (defstate idle (editable-player) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (local-vars (v0-0 none)) - (let ((v1-0 arg2)) + (let ((v1-0 event-type)) (the-as object (cond ((= v1-0 'execute) - (let ((a2-1 (-> arg3 param 0))) + (let ((a2-1 (-> event param 0))) (case a2-1 ((28 27 35 29 31 32) (editable-array-method-13 @@ -1834,26 +1550,26 @@ (deactivate self) ) ((= v1-0 'menu) - (set! v0-0 (the-as none (+ (-> self clock frame-counter) (the-as time-frame (-> arg3 param 0))))) + (set! v0-0 (the-as none (+ (-> self clock frame-counter) (the-as time-frame (-> event param 0))))) (set! (-> self close-menu-time) (the-as time-frame v0-0)) v0-0 ) ((or (= v1-0 'on-enter) (= v1-0 'on-exit) (= v1-0 'on-inside)) (let ((s4-0 (-> self current region))) (when s4-0 - (let ((gp-1 (-> arg3 param 0))) + (let ((gp-1 (-> event param 0))) (set! (-> *syntax-context* got-error?) #f) (eval! *syntax-context* (the-as pair gp-1)) (when (not (-> *syntax-context* got-error?)) (set! (-> s4-0 changed) #t) (cond - ((= arg2 'on-enter) + ((= event-type 'on-enter) (set! (-> s4-0 on-enter) (the-as string gp-1)) ) - ((= arg2 'on-inside) + ((= event-type 'on-inside) (set! (-> s4-0 on-inside) (the-as string gp-1)) ) - ((= arg2 'on-exit) + ((= event-type 'on-exit) (set! (-> s4-0 on-exit) (the-as string gp-1)) ) ) @@ -1866,7 +1582,7 @@ ) ) ((= v1-0 'select) - (let ((gp-2 (-> arg3 param 0))) + (let ((gp-2 (-> event param 0))) (editable-array-method-9 (-> self current) (editable-command select-none) (the-as editable-array #f)) (let* ((s5-1 (-> self current length)) (s4-1 0) @@ -1904,7 +1620,7 @@ ) ) (when v1-60 - (set! (-> v1-60 name) (the-as string (-> arg3 param 0))) + (set! (-> v1-60 name) (the-as string (-> event param 0))) (logior! (-> v1-60 flags) (editable-flag changed)) (let ((v1-61 (-> v1-60 region))) (if v1-61 @@ -1921,7 +1637,7 @@ #f ) ((= v1-0 'level) - (let ((gp-3 (lookup-level-info (the-as symbol (-> arg3 param 0))))) + (let ((gp-3 (lookup-level-info (the-as symbol (-> event param 0))))) (when (-> gp-3 dbname) (let* ((s5-3 (-> self current length)) (s4-3 0) @@ -1952,10 +1668,10 @@ (-> self current level) ) ((= v1-0 'direction) - (let* ((f30-0 (the-as float (-> arg3 param 0))) - (f28-0 (the-as float (-> arg3 param 1))) - (f26-0 (the-as float (-> arg3 param 2))) - (f24-0 (if (and (zero? (-> arg3 param 0)) (zero? (-> arg3 param 1)) (zero? (-> arg3 param 2))) + (let* ((f30-0 (the-as float (-> event param 0))) + (f28-0 (the-as float (-> event param 1))) + (f26-0 (the-as float (-> event param 2))) + (f24-0 (if (and (zero? (-> event param 0)) (zero? (-> event param 1)) (zero? (-> event param 2))) 0.0 1.0 ) @@ -1990,10 +1706,10 @@ #f ) ((= v1-0 'color) - (let* ((f30-1 (the-as float (-> arg3 param 0))) - (f28-1 (the-as float (-> arg3 param 1))) - (f26-1 (the-as float (-> arg3 param 2))) - (f24-1 (the-as float (-> arg3 param 3))) + (let* ((f30-1 (the-as float (-> event param 0))) + (f28-1 (the-as float (-> event param 1))) + (f26-1 (the-as float (-> event param 2))) + (f24-1 (the-as float (-> event param 3))) (gp-5 (-> self current length)) (s5-5 0) (s4-5 (-> self current data s5-5)) @@ -2023,8 +1739,8 @@ #f ) ((= v1-0 'param) - (let ((s5-6 (-> arg3 param 0)) - (f30-2 (the-as float (-> arg3 param 1))) + (let ((s5-6 (-> event param 0)) + (f30-2 (the-as float (-> event param 1))) ) (when (and (>= (the-as int s5-6) 0) (>= 2 (the-as int s5-6))) (let* ((gp-6 (-> self current length)) @@ -2593,7 +2309,7 @@ "Region Lock" #f ,(lambda ((arg0 int) (arg1 float) (arg2 float)) - (if (= arg1 4) + (if (= (the-as int arg1) 4) (set! (-> *editable* 0 current region-lock?) (not (-> *editable* 0 current region-lock?))) ) (-> *editable* 0 current region-lock?) @@ -2688,7 +2404,7 @@ "Param" #f ,(lambda ((arg0 int) (arg1 float) (arg2 float)) (cond - ((= arg1 4) + ((= (the-as int arg1) 4) (if (and *editable* (nonzero? *editable*)) (set! (-> *editable* 0 current edit-param0) arg2) ) @@ -2764,18 +2480,7 @@ (return #f) ) ) - (sound-play-by-spec - (new 'static 'sound-spec - :mask (sound-mask fo-curve) - :num 1.0 - :group (sound-group sfx) - :sound-name (static-sound-name "beep") - :volume #x400 - :fo-curve 1 - ) - (new-sound-id) - (the-as vector #t) - ) + (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (format #t "EDITABLE: saved camera sample point for level ~A~%" arg0) ) (else @@ -2814,7 +2519,7 @@ (dotimes (gp-1 (-> *level* length)) (let ((v1-14 (-> *level* level gp-1))) (when (= (-> v1-14 status) 'active) - (if (zero? (logand *fix-visible-level-mask* (ash 1 (-> v1-14 index)))) + (if (not (logtest? *fix-visible-level-mask* (ash 1 (-> v1-14 index)))) (insert-sample-camera (-> v1-14 name)) ) ) diff --git a/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc b/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc index 53a3244534..69540594c8 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc @@ -281,7 +281,7 @@ (set! dma-st-flag (&+ (the-as pointer dma-position) 16)) (set! dma-color (&+ (the-as pointer dma-position) 32)) (cond - ((= (-> sprite flag-rot-sy y) 1) + ((= (the-as int (-> sprite flag-rot-sy y)) 1) (.lvf vf3 (&-> *math-camera* sprite-2d vector 0 quad)) (.lvf vf4 (&-> *math-camera* sprite-2d vector 1 quad)) (.lvf vf5 (&-> *math-camera* sprite-2d vector 2 quad)) diff --git a/goal_src/jak2/engine/target/board/board-states.gc b/goal_src/jak2/engine/target/board/board-states.gc index 8caa71b2e9..4751b828ed 100644 --- a/goal_src/jak2/engine/target/board/board-states.gc +++ b/goal_src/jak2/engine/target/board/board-states.gc @@ -1244,7 +1244,7 @@ (none) ) :trans (behavior () - (when (and (or (= (-> self control unknown-symbol02) #t) + (when (and (or (= (the-as int (-> self control unknown-symbol02)) #t) (and (< (- (-> self clock frame-counter) (-> self board halfpipe-lip-time)) (seconds 0.1)) (= (-> self board halfpipe-lip-event) 'lipramp) ) diff --git a/goal_src/jak2/engine/target/target.gc b/goal_src/jak2/engine/target/target.gc index 9874806d07..84a4de7e9a 100644 --- a/goal_src/jak2/engine/target/target.gc +++ b/goal_src/jak2/engine/target/target.gc @@ -1673,28 +1673,28 @@ :exit target-exit :trans (behavior () ((-> target-high-jump trans)) - (case (-> self control unknown-symbol03) - (('launch) - (when *sound-player-enable* - (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) - (set! (-> gp-0 command) (sound-command set-param)) - (set! (-> gp-0 id) (-> self control unknown-sound-id00)) - (let ((a1-0 (ear-trans 0))) - (let ((s5-0 self)) - (when (= a1-0 #t) - (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 control))) - (set! a1-0 (-> s5-0 control trans)) - (set! a1-0 (the-as vector #f)) - ) - ) - ) - (sound-trans-convert (the-as vector3w (-> gp-0 params trans)) a1-0) - ) - (set! (-> gp-0 params mask) (the-as uint 32)) - (-> gp-0 id) - ) - ) - ) + (let ((v1-2 (-> self control unknown-symbol03))) + (when (= (the-as int v1-2) 'launch) + (when *sound-player-enable* + (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> gp-0 command) (sound-command set-param)) + (set! (-> gp-0 id) (-> self control unknown-sound-id00)) + (let ((a1-0 (ear-trans 0))) + (let ((s5-0 self)) + (when (= a1-0 #t) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 control))) + (set! a1-0 (-> s5-0 control trans)) + (set! a1-0 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (the-as vector3w (-> gp-0 params trans)) a1-0) + ) + (set! (-> gp-0 params mask) (the-as uint 32)) + (-> gp-0 id) + ) + ) + ) ) (none) ) 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 49266a849a..94dc676836 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc @@ -1638,7 +1638,7 @@ (set! sv-208 (+ sv-208 1)) ) (cond - ((and s0-0 (!= s4-0 -859915232)) + ((and s0-0 (!= (the-as int s4-0) -859915232)) (dotimes (s4-1 4) (dist-info-append (-> gp-0 straddle) (the-as vector (+ (the-as uint s5-0) (* s4-1 16)))) ) @@ -1729,7 +1729,7 @@ (set! s3-0 (-> (the-as (inline-array collide-cache-tri) s3-0) 1)) ) ) - (if (= f30-0 #x40000000) + (if (= (the-as int f30-0) #x40000000) (set! f30-0 -1.0) ) f30-0 @@ -1971,7 +1971,7 @@ (los-cw-ccw (the-as (inline-array collide-cache-tri) s1-1) s2-0 s4-0 f30-0 arg2 sv-800 f24-0) (when *debug-segment* (cond - ((= f24-0 -859915232) + ((= (the-as int f24-0) -859915232) (let ((t9-10 cam-debug-add-los-tri) (a0-20 s1-1) (a2-6 (new 'static 'vector :x (the-as float #x80) :w (the-as float #x80))) @@ -2006,7 +2006,7 @@ ) (los-cw-ccw (the-as (inline-array collide-cache-tri) s1-1) s2-0 s4-0 f30-0 arg2 sv-800 f24-1) (when *debug-segment* - (if (= f24-1 -859915232) + (if (= (the-as int f24-1) -859915232) (cam-debug-add-los-tri (the-as (inline-array collide-cache-tri) s1-1) sv-800 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 d125aea1c9..fa059320ae 100644 --- a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc @@ -178,23 +178,23 @@ ;; definition for function dm-cam-setting-float (defun dm-cam-setting-float ((arg0 float) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) (when (= arg1 (debug-menu-msg press)) - (case arg0 - (('fov) - (if (not (setting-control-method-14 *setting-control* 'fov)) - (set! arg2 64.0) - ) - (set-setting-by-param *setting-control* 'fov #f (* 182.04445 arg2) 0) - (if *camera-combiner* - (set! (-> *camera-combiner* fov) (* 182.04445 arg2)) - ) - (if (and *camera* (-> *camera* slave)) - (set! (-> *camera* slave 0 fov) (* 182.04445 arg2)) - ) - ) + (let ((v1-2 arg0)) + (when (= (the-as int v1-2) 'fov) + (if (not (setting-control-method-14 *setting-control* 'fov)) + (set! arg2 64.0) + ) + (set-setting-by-param *setting-control* 'fov #f (* 182.04445 arg2) 0) + (if *camera-combiner* + (set! (-> *camera-combiner* fov) (* 182.04445 arg2)) + ) + (if (and *camera* (-> *camera* slave)) + (set! (-> *camera* slave 0 fov) (* 182.04445 arg2)) + ) + ) ) ) (cond - ((= arg0 'fov) + ((= (the-as int arg0) 'fov) (cond ((setting-control-method-14 *setting-control* 'fov) (empty) 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 1e0093d4dc..8e3f0caad7 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc @@ -2484,7 +2484,7 @@ "Region Lock" #f ,(lambda ((arg0 int) (arg1 float) (arg2 float)) - (if (= arg1 4) + (if (= (the-as int arg1) 4) (set! (-> *editable* 0 current region-lock?) (not (-> *editable* 0 current region-lock?))) ) (-> *editable* 0 current region-lock?) @@ -2579,7 +2579,7 @@ "Param" #f ,(lambda ((arg0 int) (arg1 float) (arg2 float)) (cond - ((= arg1 4) + ((= (the-as int arg1) 4) (if (and *editable* (nonzero? *editable*)) (set! (-> *editable* 0 current edit-param0) arg2) ) 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 650a5a5f80..8a210182df 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 @@ -227,7 +227,7 @@ (set! dma-st-flag (&+ (the-as pointer dma-position) 16)) (set! dma-color (&+ (the-as pointer dma-position) 32)) (cond - ((= (-> sprite flag-rot-sy y) 1) + ((= (the-as int (-> sprite flag-rot-sy y)) 1) (.lvf vf3 (&-> *math-camera* sprite-2d vector 0 quad)) (.lvf vf4 (&-> *math-camera* sprite-2d vector 1 quad)) (.lvf vf5 (&-> *math-camera* sprite-2d vector 2 quad)) 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 4ee146baa7..c125f15c3b 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 @@ -1234,7 +1234,7 @@ (none) ) :trans (behavior () - (when (and (or (= (-> self control unknown-symbol02) #t) + (when (and (or (= (the-as int (-> self control unknown-symbol02)) #t) (and (< (- (-> self clock frame-counter) (-> self board halfpipe-lip-time)) (seconds 0.1)) (= (-> self board halfpipe-lip-event) 'lipramp) ) diff --git a/test/decompiler/reference/jak2/engine/target/target_REF.gc b/test/decompiler/reference/jak2/engine/target/target_REF.gc index 95c0bcad68..7020b2a0b7 100644 --- a/test/decompiler/reference/jak2/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target_REF.gc @@ -1692,28 +1692,28 @@ :exit target-exit :trans (behavior () ((-> target-high-jump trans)) - (case (-> self control unknown-symbol03) - (('launch) - (when *sound-player-enable* - (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) - (set! (-> gp-0 command) (sound-command set-param)) - (set! (-> gp-0 id) (-> self control unknown-sound-id00)) - (let ((a1-0 (ear-trans 0))) - (let ((s5-0 self)) - (when (= a1-0 #t) - (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 control))) - (set! a1-0 (-> s5-0 control trans)) - (set! a1-0 (the-as vector #f)) - ) - ) - ) - (sound-trans-convert (the-as vector3w (-> gp-0 params trans)) a1-0) - ) - (set! (-> gp-0 params mask) (the-as uint 32)) - (-> gp-0 id) - ) - ) - ) + (let ((v1-2 (-> self control unknown-symbol03))) + (when (= (the-as int v1-2) 'launch) + (when *sound-player-enable* + (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> gp-0 command) (sound-command set-param)) + (set! (-> gp-0 id) (-> self control unknown-sound-id00)) + (let ((a1-0 (ear-trans 0))) + (let ((s5-0 self)) + (when (= a1-0 #t) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 control))) + (set! a1-0 (-> s5-0 control trans)) + (set! a1-0 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (the-as vector3w (-> gp-0 params trans)) a1-0) + ) + (set! (-> gp-0 params mask) (the-as uint 32)) + (-> gp-0 id) + ) + ) + ) ) (none) )