diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 8b4adffae3..2771b26d19 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -31247,7 +31247,7 @@ (define-extern get-eye-block (function int int int)) (define-extern convert-eye-data (function eye uint float)) (define-extern merc-eye-anim (function process-drawable none)) -(define-extern set-eye-draw-flag (function symbol int int none)) +(define-extern set-eye-draw-flag (function symbol int none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; glist-h ;; diff --git a/decompiler/config/jak2/ntsc_v1/anonymous_function_types.jsonc b/decompiler/config/jak2/ntsc_v1/anonymous_function_types.jsonc index 0c1794ea72..85af996320 100644 --- a/decompiler/config/jak2/ntsc_v1/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/ntsc_v1/anonymous_function_types.jsonc @@ -448,6 +448,7 @@ [26, "(function continue-point target)"] ], "warp-gate": [ + [0, "(function none :behavior scene-player)"], [8, "(function string none)"], [12, "(function none :behavior target)"] ], @@ -1806,5 +1807,9 @@ [11, "(function none :behavior task-manager)"], [12, "(function none :behavior task-manager)"], [13, "(function citizen-rebel object symbol none :behavior task-manager)"] + ], + "prison-obs": [ + [0, "(function none)"], + [1, "(function none)"] ] } diff --git a/goal_src/jak2/engine/gfx/foreground/eye.gc b/goal_src/jak2/engine/gfx/foreground/eye.gc index 35c727d9bc..b937c4cf6f 100644 --- a/goal_src/jak2/engine/gfx/foreground/eye.gc +++ b/goal_src/jak2/engine/gfx/foreground/eye.gc @@ -1312,7 +1312,7 @@ (none) ) -(defun set-eye-draw-flag ((arg0 symbol) (arg1 int) (arg2 int)) +(defun set-eye-draw-flag ((arg0 symbol) (arg1 int)) (let ((s5-0 (-> *eye-control-arrays* data (/ arg1 20) data (mod arg1 20))) ) (format 0 "flag: ~a eye-slot: ~d ~%" arg0 arg1) diff --git a/goal_src/jak2/levels/common/warp-gate.gc b/goal_src/jak2/levels/common/warp-gate.gc index e29fbb54f2..021516b1d9 100644 --- a/goal_src/jak2/levels/common/warp-gate.gc +++ b/goal_src/jak2/levels/common/warp-gate.gc @@ -1964,153 +1964,167 @@ This commonly includes things such as: ) ) -(scene-method-16 (new 'static 'scene - :name "caspad-air-train-out" - :extra #f - :info #f - :mask-to-clear (process-mask movie enemy platform projectile) - :entity "air-train-3" - :art-group "scenecamera" - :anim "caspad-air-train-out" - :parts 3 - :command-list '((0 - (kill "air-train-3") - (fadein (frame-time-30 (new 'static 'bfloat :data 10.0))) - (part-tracker - "group-airtrain-thruster" - entity - "air-train" - joint - "thruster_l" - track - #t - duration - (frame-range 0 195) - ) - (part-tracker - "group-airtrain-thruster" - entity - "air-train" - joint - "thruster_r" - track - #t - duration - (frame-range 0 195) - ) - ) - (80 (part-tracker - "group-airtrain-dust-plume" - entity - "particleman" - joint - "particleA" - track - #t - duration - (frame-range 80 190) - ) - ) - (180 - (part-tracker - "group-airtrain-thruster-off" - entity - "air-train" - joint - "thruster_l" - track - #t - duration - (frame-range 180 295) - ) - (part-tracker - "group-airtrain-thruster-off" - entity - "air-train" - joint - "thruster_r" - track - #t - duration - (frame-range 180 295) - ) - ) - (285 (fadeout (frame-time-30 (new 'static 'bfloat :data 10.0)))) - (10000 (apply )) - ) - :cut-list '(180) - :wait-ground-time (seconds 1) - :draw-target #f - :abort #t - :actor (new 'static 'boxed-array :type scene-actor - (new 'static 'scene-actor - :name "scenecamera" - :level #f - :art-group "skel-scenecamera" - :prefix "" - :draw-frames '((min max)) - :scissor-frames '() - :camera 4 - :shadow-flags -1 - :shadow-volume-joint #f - ) - (new 'static 'scene-actor - :name "sidekick-highres" - :level 'caspad - :art-group "skel-sidekick-highres" - :prefix "" - :draw-frames '((min max)) - :scissor-frames '() - :flags #x1 - :shadow-flags -1 - :shadow-volume-joint #f - ) - (new 'static 'scene-actor - :name "jak-highres" - :level 'caspad - :art-group "skel-jak-highres" - :prefix "" - :draw-frames '((min max)) - :scissor-frames '() - :flags #x1 - :shadow-flags -1 - :shadow-volume-joint #f - ) - (new 'static 'scene-actor - :name "air-train" - :level 'caspad - :art-group "skel-air-train" - :prefix "" - :draw-frames '((min max)) - :scissor-frames '() - :flags #x1 - :shadow-flags -1 - :shadow-volume-joint #f - ) - (new 'static 'scene-actor - :name "particleman" - :level 'caspad - :art-group "skel-particleman" - :prefix "" - :draw-frames '((min max)) - :scissor-frames '() - :flags #x1 - :shadow-flags -1 - :shadow-volume-joint #f - ) - ) - :load-point-obj "caspad-warp" - :end-point-obj "caspad-warp" - :borrow '() - :sfx-volume -1.0 - :ambient-volume -1.0 - :music-volume -1.0 - :blackout-end #t - :peaceful #t - :music-delay 1500.0 - :save #t +(scene-method-16 + (new 'static 'scene + :name "caspad-air-train-out" + :extra #f + :info #f + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "air-train-3" + :art-group "scenecamera" + :anim "caspad-air-train-out" + :parts 3 + :command-list '((0 + (kill "air-train-3") + (fadein (frame-time-30 (new 'static 'bfloat :data 10.0))) + (part-tracker + "group-airtrain-thruster" + entity + "air-train" + joint + "thruster_l" + track + #t + duration + (frame-range 0 195) + ) + (part-tracker + "group-airtrain-thruster" + entity + "air-train" + joint + "thruster_r" + track + #t + duration + (frame-range 0 195) + ) + ) + (80 + (part-tracker + "group-airtrain-dust-plume" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 80 190) + ) + ) + (180 + (part-tracker + "group-airtrain-thruster-off" + entity + "air-train" + joint + "thruster_l" + track + #t + duration + (frame-range 180 295) + ) + (part-tracker + "group-airtrain-thruster-off" + entity + "air-train" + joint + "thruster_r" + track + #t + duration + (frame-range 180 295) + ) + ) + (285 (fadeout (frame-time-30 (new 'static 'bfloat :data 10.0)))) + (10000 + (apply + ,(lambda :behavior scene-player + () + (set! (-> self scene end-point-obj) (if (task-node-closed? (game-task-node castle-break-in-introduction)) + "caspad-face-castle" + "caspad-warp" + ) ) - ) + (none) + ) + ) + ) + ) + :cut-list '(180) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'caspad + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'caspad + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "air-train" + :level 'caspad + :art-group "skel-air-train" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'caspad + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "caspad-warp" + :end-point-obj "caspad-warp" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) (scene-method-16 (new 'static 'scene :name "nest-air-train-in" diff --git a/goal_src/jak2/levels/fortress/prison/prison-obs.gc b/goal_src/jak2/levels/fortress/prison/prison-obs.gc index 42548f1746..e4adb8eeee 100644 --- a/goal_src/jak2/levels/fortress/prison/prison-obs.gc +++ b/goal_src/jak2/levels/fortress/prison/prison-obs.gc @@ -665,8 +665,8 @@ This commonly includes things such as: (75 (send-event "prsn-cell-door-2" 'open)) (75 (send-event "prsn-cell-door-1" 'open)) (75 (send-event "prsn-cell-door-4" 'open)) - (1143 (apply )) - (1189 (apply )) + (1143 (apply ,(lambda () (set-eye-draw-flag #f 100) (none)))) + (1189 (apply ,(lambda () (set-eye-draw-flag #t 100) (none)))) (2427 (send-event "warp-gate-b-1" 'effect) (sound-play "warpgate-mov")) (2445 (send-event "warp-gate-b-1" 'effect) (sound-play "warpgate-mov")) (2463 (send-event "warp-gate-b-1" 'effect) (sound-play "warpgate-mov")) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/eye_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/eye_REF.gc index 03420728e4..1eade3925b 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/eye_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/eye_REF.gc @@ -69,7 +69,6 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch -;; ERROR: Failed store: (s.w! (+ a0-6 8) 0) at op 79 (defun render-eyes-32 ((arg0 dma-buffer) (arg1 eye-control) (arg2 int)) (local-vars (sv-16 float)) (let ((s4-0 32) @@ -294,7 +293,6 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch -;; ERROR: Failed store: (s.w! (+ a0-6 8) 0) at op 79 (defun render-eyes-32-different ((arg0 dma-buffer) (arg1 eye-control) (arg2 int)) (local-vars (sv-16 float)) (let ((s4-0 32) @@ -576,7 +574,6 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch -;; ERROR: Failed store: (s.w! (+ a0-6 8) 0) at op 79 (defun render-eyes-64 ((arg0 dma-buffer) (arg1 eye-control) (arg2 int)) (local-vars (sv-16 float)) (let ((s4-0 64) @@ -801,7 +798,6 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch -;; ERROR: Failed store: (s.w! (+ a0-6 8) 0) at op 79 (defun render-eyes-64-different ((arg0 dma-buffer) (arg1 eye-control) (arg2 int)) (local-vars (sv-16 float)) (let ((s4-0 64) @@ -1072,7 +1068,22 @@ ;; definition for function debug-eyes ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs none. -;; ERROR: Failed store: (s.w! (+ a0-1 8) 0) at op 5 +;; ERROR: Failed store: (s.q! (+ v1-23 16) a0-10) at op 69 +;; ERROR: Failed store: (s.w! (+ a0-11 4) a1-6) at op 74 +;; ERROR: Failed store: (s.w! (+ a0-11 8) a1-7) at op 76 +;; ERROR: Failed store: (s.w! (+ a0-11 12) a1-8) at op 78 +;; ERROR: Failed store: (s.w! (+ a0-12 4) 0) at op 81 +;; ERROR: Failed store: (s.w! (+ a0-12 8) 0) at op 82 +;; ERROR: Failed store: (s.w! (+ a0-12 12) 0) at op 83 +;; ERROR: Failed store: (s.w! (+ a0-13 4) a1-10) at op 88 +;; ERROR: Failed store: (s.w! (+ a0-13 8) a1-11) at op 90 +;; ERROR: Failed store: (s.w! (+ a0-13 12) 0) at op 91 +;; ERROR: Failed store: (s.w! (+ a0-14 4) a1-13) at op 96 +;; ERROR: Failed store: (s.w! (+ a0-14 8) 0) at op 97 +;; ERROR: Failed store: (s.w! (+ a0-14 12) 0) at op 98 +;; ERROR: Failed store: (s.w! (+ v1-24 4) a0-16) at op 103 +;; ERROR: Failed store: (s.w! (+ v1-24 8) a0-17) at op 105 +;; ERROR: Failed store: (s.w! (+ v1-24 12) 0) at op 106 (defun debug-eyes ((arg0 dma-buffer)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) @@ -1142,7 +1153,6 @@ ;; definition for function update-eyes ;; WARN: Return type mismatch int vs none. -;; ERROR: Failed store: (s.w! (+ a0-38 8) 0) at op 160 (defun update-eyes () (when (not (-> *blit-displays-work* screen-copied)) (dotimes (gp-0 6) @@ -1455,7 +1465,7 @@ ;; definition for function set-eye-draw-flag ;; WARN: Return type mismatch int vs none. -(defun set-eye-draw-flag ((arg0 symbol) (arg1 int) (arg2 int)) +(defun set-eye-draw-flag ((arg0 symbol) (arg1 int)) (let ((s5-0 (the-as object (+ (+ (* 96 (mod arg1 20)) 28 (* 1552 (/ arg1 20))) (the-as int *eye-control-arrays*)))) ) (format 0 "flag: ~a eye-slot: ~d ~%" arg0 arg1) diff --git a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc index 0d6d38c474..30fed4b0a3 100644 --- a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc @@ -2043,153 +2043,167 @@ This commonly includes things such as: ) ;; failed to figure out what this is: -(scene-method-16 (new 'static 'scene - :name "caspad-air-train-out" - :extra #f - :info #f - :mask-to-clear (process-mask movie enemy platform projectile) - :entity "air-train-3" - :art-group "scenecamera" - :anim "caspad-air-train-out" - :parts 3 - :command-list '((0 - (kill "air-train-3") - (fadein (frame-time-30 (new 'static 'bfloat :data 10.0))) - (part-tracker - "group-airtrain-thruster" - entity - "air-train" - joint - "thruster_l" - track - #t - duration - (frame-range 0 195) - ) - (part-tracker - "group-airtrain-thruster" - entity - "air-train" - joint - "thruster_r" - track - #t - duration - (frame-range 0 195) - ) - ) - (80 (part-tracker - "group-airtrain-dust-plume" - entity - "particleman" - joint - "particleA" - track - #t - duration - (frame-range 80 190) - ) - ) - (180 - (part-tracker - "group-airtrain-thruster-off" - entity - "air-train" - joint - "thruster_l" - track - #t - duration - (frame-range 180 295) - ) - (part-tracker - "group-airtrain-thruster-off" - entity - "air-train" - joint - "thruster_r" - track - #t - duration - (frame-range 180 295) - ) - ) - (285 (fadeout (frame-time-30 (new 'static 'bfloat :data 10.0)))) - (10000 (apply )) - ) - :cut-list '(180) - :wait-ground-time (seconds 1) - :draw-target #f - :abort #t - :actor (new 'static 'boxed-array :type scene-actor - (new 'static 'scene-actor - :name "scenecamera" - :level #f - :art-group "skel-scenecamera" - :prefix "" - :draw-frames '((min max)) - :scissor-frames '() - :camera 4 - :shadow-flags -1 - :shadow-volume-joint #f - ) - (new 'static 'scene-actor - :name "sidekick-highres" - :level 'caspad - :art-group "skel-sidekick-highres" - :prefix "" - :draw-frames '((min max)) - :scissor-frames '() - :flags #x1 - :shadow-flags -1 - :shadow-volume-joint #f - ) - (new 'static 'scene-actor - :name "jak-highres" - :level 'caspad - :art-group "skel-jak-highres" - :prefix "" - :draw-frames '((min max)) - :scissor-frames '() - :flags #x1 - :shadow-flags -1 - :shadow-volume-joint #f - ) - (new 'static 'scene-actor - :name "air-train" - :level 'caspad - :art-group "skel-air-train" - :prefix "" - :draw-frames '((min max)) - :scissor-frames '() - :flags #x1 - :shadow-flags -1 - :shadow-volume-joint #f - ) - (new 'static 'scene-actor - :name "particleman" - :level 'caspad - :art-group "skel-particleman" - :prefix "" - :draw-frames '((min max)) - :scissor-frames '() - :flags #x1 - :shadow-flags -1 - :shadow-volume-joint #f - ) - ) - :load-point-obj "caspad-warp" - :end-point-obj "caspad-warp" - :borrow '() - :sfx-volume -1.0 - :ambient-volume -1.0 - :music-volume -1.0 - :blackout-end #t - :peaceful #t - :music-delay 1500.0 - :save #t +(scene-method-16 + (new 'static 'scene + :name "caspad-air-train-out" + :extra #f + :info #f + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "air-train-3" + :art-group "scenecamera" + :anim "caspad-air-train-out" + :parts 3 + :command-list '((0 + (kill "air-train-3") + (fadein (frame-time-30 (new 'static 'bfloat :data 10.0))) + (part-tracker + "group-airtrain-thruster" + entity + "air-train" + joint + "thruster_l" + track + #t + duration + (frame-range 0 195) + ) + (part-tracker + "group-airtrain-thruster" + entity + "air-train" + joint + "thruster_r" + track + #t + duration + (frame-range 0 195) + ) + ) + (80 + (part-tracker + "group-airtrain-dust-plume" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 80 190) + ) + ) + (180 + (part-tracker + "group-airtrain-thruster-off" + entity + "air-train" + joint + "thruster_l" + track + #t + duration + (frame-range 180 295) + ) + (part-tracker + "group-airtrain-thruster-off" + entity + "air-train" + joint + "thruster_r" + track + #t + duration + (frame-range 180 295) + ) + ) + (285 (fadeout (frame-time-30 (new 'static 'bfloat :data 10.0)))) + (10000 + (apply + ,(lambda :behavior scene-player + () + (set! (-> self scene end-point-obj) (if (task-node-closed? (game-task-node castle-break-in-introduction)) + "caspad-face-castle" + "caspad-warp" + ) ) - ) + (none) + ) + ) + ) + ) + :cut-list '(180) + :wait-ground-time (seconds 1) + :draw-target #f + :abort #t + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'caspad + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jak-highres" + :level 'caspad + :art-group "skel-jak-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "air-train" + :level 'caspad + :art-group "skel-air-train" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'caspad + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point-obj "caspad-warp" + :end-point-obj "caspad-warp" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-volume -1.0 + :blackout-end #t + :peaceful #t + :music-delay 1500.0 + :save #t + ) + ) ;; failed to figure out what this is: (scene-method-16 (new 'static 'scene diff --git a/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc index 9f738eb2e8..773796e4ed 100644 --- a/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc @@ -746,8 +746,8 @@ This commonly includes things such as: (75 (send-event "prsn-cell-door-2" 'open)) (75 (send-event "prsn-cell-door-1" 'open)) (75 (send-event "prsn-cell-door-4" 'open)) - (1143 (apply )) - (1189 (apply )) + (1143 (apply ,(lambda () (set-eye-draw-flag #f 100) (none)))) + (1189 (apply ,(lambda () (set-eye-draw-flag #t 100) (none)))) (2427 (send-event "warp-gate-b-1" 'effect) (sound-play "warpgate-mov")) (2445 (send-event "warp-gate-b-1" 'effect) (sound-play "warpgate-mov")) (2463 (send-event "warp-gate-b-1" 'effect) (sound-play "warpgate-mov"))