From 4c61343cb7d8a31d60ad4117b8d33f8bdba6b830 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sun, 22 Aug 2021 21:03:47 -0400 Subject: [PATCH] decomp: `evilbro` (#774) * add script to make adding lambda label casts a bit easier * decomp: almost finish `evil-bro` blocked by handle -> process conversion it seems: `No method or function named .asm.sllv.r0 for type (pointer process-tree)` * so close! SLLV issue (not a simple handle scenario) * decomp: finalize `evilbro` blocked by func return type * decomp: finish `evilbro` --- decompiler/config/all-types.gc | 148 ++------ .../anonymous_function_types.jsonc | 6 + .../jak1_ntsc_black_label/label_types.jsonc | 17 + .../stack_structures.jsonc | 8 + .../jak1_ntsc_black_label/type_casts.jsonc | 12 +- goal_src/engine/game/task/task-control-h.gc | 20 +- goal_src/levels/intro/evilbro.gc | 312 ++++++++++++++++ .../engine/game/task/task-control-h_REF.gc | 16 +- .../reference/levels/intro/evilbro_REF.gc | 332 ++++++++++++++++++ .../reference/levels/misty/mud_REF.gc | 4 - test/offline/offline_test_main.cpp | 2 +- 11 files changed, 733 insertions(+), 144 deletions(-) create mode 100644 test/decompiler/reference/levels/intro/evilbro_REF.gc diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index e7ee63b520..a513dcc8df 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -994,6 +994,7 @@ ;; - Types +(declare-type res-lump basic) (define-extern process-tree type) ; deftype provided by C Kernel (declare-type process basic) (declare-type res-lump basic) @@ -16518,25 +16519,25 @@ (cell-for-task game-task :offset-assert 256) (cell-x uint64 :offset-assert 264) (cam-joint-index int32 :offset-assert 272) - (skippable basic :offset-assert 276) - (blend-on-exit basic :offset-assert 280) + (skippable basic :offset-assert 276) ;; probably a symbol + (blend-on-exit basic :offset-assert 280) ;; probably a symbol? (camera uint64 :offset-assert 288) - (will-talk basic :offset-assert 296) + (will-talk symbol :offset-assert 296) (talk-message uint32 :offset-assert 300) (last-talk uint64 :offset-assert 304) - (bounce-away basic :offset-assert 312) + (bounce-away symbol :offset-assert 312) (ambient ambient-control :inline :offset-assert 320) (center-joint-index int32 :offset-assert 336) (draw-bounds-y-offset float :offset-assert 340) (neck-joint-index int32 :offset-assert 344) - (fuel-cell-anim basic :offset-assert 348) + (fuel-cell-anim spool-anim :offset-assert 348) (sound-flava uint8 :offset-assert 352) - (have-flava basic :offset-assert 356) + (have-flava symbol :offset-assert 356) ;; probably (music basic :offset-assert 360) - (have-music basic :offset-assert 364) - (been-kicked basic :offset-assert 368) - (cur-trans-hook basic :offset-assert 372) - (shadow-backup basic :offset-assert 376) + (have-music symbol :offset-assert 364) ;; probably + (been-kicked symbol :offset-assert 368) ;; probably + (cur-trans-hook function :offset-assert 372) + (shadow-backup shadow-geo :offset-assert 376) ) :heap-base #x110 :method-count-assert 53 @@ -28550,116 +28551,23 @@ ;; - Types -; (deftype evilbro (process-taskable) -; ((evilsis basic :offset-assert 380) -; ) -; :method-count-assert 53 -; :size-assert #x180 -; :heap-base #x110 -; :flag-assert #x3501100180 -; ;; inherited inspect of process-taskable -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(declare-type evilsis process-taskable) +(deftype evilbro (process-taskable) + ((evilsis evilsis :offset-assert 380) + ) + :method-count-assert 53 + :heap-base #x110 + :size-assert #x180 + :flag-assert #x3501100180 + ) -; (deftype evilsis (process-taskable) -; () -; :method-count-assert 53 -; :size-assert #x17c -; :heap-base #x110 -; :flag-assert #x350110017c -; ;; not enough basic ops -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; (dummy-12 () none 12) -; (dummy-13 () none 13) -; (dummy-14 () none 14) -; (dummy-15 () none 15) -; (dummy-16 () none 16) -; (dummy-17 () none 17) -; (dummy-18 () none 18) -; (dummy-19 () none 19) -; (dummy-20 () none 20) -; (dummy-21 () none 21) -; (dummy-22 () none 22) -; (dummy-23 () none 23) -; (dummy-24 () none 24) -; (dummy-25 () none 25) -; (dummy-26 () none 26) -; (dummy-27 () none 27) -; (dummy-28 () none 28) -; (dummy-29 () none 29) -; (dummy-30 () none 30) -; (dummy-31 () none 31) -; (dummy-32 () none 32) -; (dummy-33 () none 33) -; (dummy-34 () none 34) -; (dummy-35 () none 35) -; (dummy-36 () none 36) -; (dummy-37 () none 37) -; (dummy-38 () none 38) -; (dummy-39 () none 39) -; (dummy-40 () none 40) -; (dummy-41 () none 41) -; (dummy-42 () none 42) -; (dummy-43 () none 43) -; (dummy-44 () none 44) -; (dummy-45 () none 45) -; (dummy-46 () none 46) -; (dummy-47 () none 47) -; (dummy-48 () none 48) -; (dummy-49 () none 49) -; (dummy-50 () none 50) -; (dummy-51 () none 51) -; (dummy-52 () none 52) -; ) -; ) +(deftype evilsis (process-taskable) + () + :method-count-assert 53 + :heap-base #x110 + :size-assert #x17c + :flag-assert #x350110017c + ) ;; - Unknowns @@ -31231,8 +31139,8 @@ (deftype farmer (process-taskable) () - :heap-base #x110 :method-count-assert 53 + :heap-base #x110 :size-assert #x17c :flag-assert #x350110017c ) diff --git a/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc b/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc index 4b53535913..59a5f1c5f2 100644 --- a/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/anonymous_function_types.jsonc @@ -681,5 +681,11 @@ [12, "(function sparticle-system sparticle-cpuinfo int none)"] ], + "evilbro": [ + [1, "(function object :behavior evilbro)"], + [5, "(function none :behavior evilbro)"], + [6, "(function object :behavior evilbro)"] + ], + "placeholder-do-not-add-below": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc index eb018c4970..9580bf5031 100644 --- a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc @@ -1988,6 +1988,23 @@ ["L383", "uint64", true] ], + "evilbro": [ + ["L25", "vector", true], + ["L30", "vector", true], + ["L26", "state", true], + ["L28", "skeleton-group", true], + ["L31", "state", true], + ["L32", "state", true], + ["L33", "spool-anim", true], + ["L35", "skeleton-group", true], + ["L40", "float", true], + ["L42", "float", true], + ["L43", "float", true], + ["L2", "_lambda_", true], + ["L7", "_lambda_", true], + ["L18", "_lambda_", true] + ], + // please do not add things after this entry! git is dumb. "object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc index 0300dd8923..1acdb76c25 100644 --- a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc @@ -1365,5 +1365,13 @@ [48, ["inline-array", "sphere", 2]] ], + "(method 32 evilbro)": [ + [16, "event-message-block"] + ], + + "(exit play-anim evilbro)": [ + [16, "event-message-block"] + ], + "placeholder-do-not-add-below!": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index 9de4483c79..75e41b7b03 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -1834,7 +1834,7 @@ "do-target-shadow": [ [46, "v1", "collide-shape-prim"] // `event-other` from collide-shape ], - + "draw-string": [ [[93, 96], "a0", "(pointer uint8)"], [[206, 209], "t3", "font-work"], @@ -2333,5 +2333,15 @@ [38, "f1", "float"] ], + "(method 32 evilbro)": [ + [19, "v1", "handle"] + ], + + "(code idle evilbro)": [ + [27, "v1", "art-joint-anim"], + [84, "v1", "float"], + [171, "v1", "float"] + ], + "placeholder-do-not-add-below": [] } diff --git a/goal_src/engine/game/task/task-control-h.gc b/goal_src/engine/game/task/task-control-h.gc index 34dae29a2f..75eb1453e8 100644 --- a/goal_src/engine/game/task/task-control-h.gc +++ b/goal_src/engine/game/task/task-control-h.gc @@ -107,25 +107,25 @@ (cell-for-task game-task :offset-assert 256) (cell-x uint64 :offset-assert 264) (cam-joint-index int32 :offset-assert 272) - (skippable basic :offset-assert 276) - (blend-on-exit basic :offset-assert 280) + (skippable basic :offset-assert 276) ;; probably a symbol + (blend-on-exit basic :offset-assert 280) ;; probably a symbol? (camera uint64 :offset-assert 288) - (will-talk basic :offset-assert 296) + (will-talk symbol :offset-assert 296) (talk-message uint32 :offset-assert 300) (last-talk uint64 :offset-assert 304) - (bounce-away basic :offset-assert 312) + (bounce-away symbol :offset-assert 312) (ambient ambient-control :inline :offset-assert 320) (center-joint-index int32 :offset-assert 336) (draw-bounds-y-offset float :offset-assert 340) (neck-joint-index int32 :offset-assert 344) - (fuel-cell-anim basic :offset-assert 348) + (fuel-cell-anim spool-anim :offset-assert 348) (sound-flava uint8 :offset-assert 352) - (have-flava basic :offset-assert 356) + (have-flava symbol :offset-assert 356) ;; probably (music basic :offset-assert 360) - (have-music basic :offset-assert 364) - (been-kicked basic :offset-assert 368) - (cur-trans-hook basic :offset-assert 372) - (shadow-backup basic :offset-assert 376) + (have-music symbol :offset-assert 364) ;; probably + (been-kicked symbol :offset-assert 368) ;; probably + (cur-trans-hook function :offset-assert 372) + (shadow-backup shadow-geo :offset-assert 376) ) :heap-base #x110 :method-count-assert 53 diff --git a/goal_src/levels/intro/evilbro.gc b/goal_src/levels/intro/evilbro.gc index 5649b31b77..ae273b7126 100644 --- a/goal_src/levels/intro/evilbro.gc +++ b/goal_src/levels/intro/evilbro.gc @@ -5,3 +5,315 @@ ;; name in dgo: evilbro ;; dgos: INT, L1 +(define-extern *evilsis-intro-sg* skeleton-group) +(define-extern *evilbro-intro-sg* skeleton-group) + +;; definition of type evilbro +(declare-type evilsis process-taskable) +(deftype evilbro (process-taskable) + ((evilsis evilsis :offset-assert 380) + ) + :heap-base #x110 + :method-count-assert 53 + :size-assert #x180 + :flag-assert #x3501100180 + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "evilbro" + :bounds (new 'static 'vector :w 16384.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 3) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *evilbro-intro-sg* v1-1) + ) + +;; definition for method 32 of type evilbro +;; INFO: Return type mismatch spool-anim vs basic. +(defmethod play-anim! evilbro ((obj evilbro) (arg0 symbol)) + (with-pp + (cond + (arg0 + (close-specific-task! + (game-task leaving-misty) + (task-status need-introduction) + ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) pp) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'clone) + (let ((v1-2 (process->ppointer obj))) + (set! + (-> a1-2 param 0) + (the-as + uint + (logior (shl (-> v1-2 0 pid) 32) (new 'static 'handle :process v1-2)) + ) + ) + ) + (send-event-function (-> obj evilsis ppointer 3) a1-2) + ) + ) + (else + (set! (-> obj will-talk) #t) + ) + ) + (the-as + basic + (new 'static 'spool-anim + :name "evilbro-misty-end" + :index 5 + :parts 9 + :command-list '() + ) + ) + ) + ) + +;; definition for method 31 of type evilbro +(defmethod get-art-elem evilbro ((obj evilbro)) + (-> obj draw art-group data 3) + ) + +;; failed to figure out what this is: +(defstate play-anim (evilbro) + :virtual #t + :exit + (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) self) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'end-mode) + (send-event-function (-> self evilsis ppointer 3) a1-0) + ) + ((-> (method-of-type process-taskable play-anim) exit)) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (evilbro) + :virtual #t + :code + (behavior () + (if (!= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) + (ja-channel-push! 1 15) + ) + (while #t + (let ((a0-7 (-> self skel root-channel 0))) + (set! + (-> a0-7 frame-group) + (the-as art-joint-anim (-> self draw art-group data 3)) + ) + (set! + (-> a0-7 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 3)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-7 param 1) 1.0) + (set! (-> a0-7 frame-num) 0.0) + (joint-control-channel-group! + a0-7 + (the-as art-joint-anim (-> self draw art-group data 3)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-8 (-> self skel root-channel 0))) + (set! + (-> a0-8 param 0) + (the float (+ (-> a0-8 frame-group data 0 length) -1)) + ) + (set! (-> a0-8 param 1) 1.0) + (joint-control-channel-group-eval! + a0-8 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((gp-0 (-> *display* base-frame-counter))) + (while (let* ((s5-0 (-> *display* base-frame-counter)) + (f30-0 300.0) + (f28-0 0.16) + (f26-0 0.17000002) + (v1-29 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-30 (the-as number (logior #x3f800000 v1-29))) + ) + (< + (- + s5-0 + (the + int + (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-30))))) + ) + ) + gp-0 + ) + ) + (suspend) + ) + ) + (let ((gp-1 (-> self skel root-channel 0))) + (set! (-> gp-1 frame-group) (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! (-> gp-1 param 0) (ja-aframe 0.0 0)) + (set! (-> gp-1 param 1) 1.0) + (set! (-> gp-1 frame-num) (ja-aframe 16.0 0)) + (joint-control-channel-group! gp-1 (if (> (-> self skel active-channels) 0) + (-> + self + skel + root-channel + 0 + frame-group + ) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((gp-2 (-> self skel root-channel 0))) + (set! (-> gp-2 param 0) (ja-aframe 0.0 0)) + (set! (-> gp-2 param 1) 1.0) + (joint-control-channel-group-eval! + gp-2 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((gp-3 (-> *display* base-frame-counter))) + (while (let* ((s5-1 (-> *display* base-frame-counter)) + (f30-1 300.0) + (f28-1 0.16) + (f26-1 0.17000002) + (v1-54 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-55 (the-as number (logior #x3f800000 v1-54))) + ) + (< + (- + s5-1 + (the + int + (* f30-1 (+ f28-1 (* f26-1 (+ -1.0 (the-as float v1-55))))) + ) + ) + gp-3 + ) + ) + (suspend) + ) + ) + ) + (none) + ) + ) + +;; definition for method 11 of type evilbro +(defmethod copy-defaults! evilbro ((obj evilbro) (arg0 res-lump)) + (dummy-40 obj arg0 *evilbro-intro-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task leaving-misty))) + (set! + (-> obj evilsis) + (the-as evilsis (entity-actor-lookup arg0 'alt-actor 0)) + ) + (dummy-42 obj) + (none) + ) + +;; definition of type evilsis +(deftype evilsis (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; failed to figure out what this is: +(let + ((v1-7 + (new 'static 'skeleton-group + :art-group-name "evilsis" + :bounds (new 'static 'vector :w 16384.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-7 jgeo) 0) + (set! (-> v1-7 janim) 3) + (set! (-> v1-7 mgeo 0) (the-as uint 1)) + (set! (-> v1-7 lod-dist 0) 4095996000.0) + (set! *evilsis-intro-sg* v1-7) + ) + +;; definition for method 32 of type evilsis +;; INFO: Return type mismatch art-element vs basic. +(defmethod play-anim! evilsis ((obj evilsis) (arg0 symbol)) + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (the-as task-status (current-status (-> obj tasks)))) + ) + ) + (the-as basic (get-art-elem obj)) + ) + +;; definition for method 31 of type evilsis +(defmethod get-art-elem evilsis ((obj evilsis)) + (-> obj draw art-group data 3) + ) + +;; failed to figure out what this is: +(defstate idle (evilsis) + :virtual #t + :trans + (behavior () + (set! (-> self will-talk) #f) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) + ) + +;; definition for method 11 of type evilsis +(defmethod copy-defaults! evilsis ((obj evilsis) (arg0 res-lump)) + (dummy-40 obj arg0 *evilsis-intro-sg* 3 0 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task leaving-misty))) + (dummy-42 obj) + (none) + ) diff --git a/test/decompiler/reference/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/engine/game/task/task-control-h_REF.gc index 244bce2a72..e661a257ea 100644 --- a/test/decompiler/reference/engine/game/task/task-control-h_REF.gc +++ b/test/decompiler/reference/engine/game/task/task-control-h_REF.gc @@ -98,22 +98,22 @@ (skippable basic :offset-assert 276) (blend-on-exit basic :offset-assert 280) (camera uint64 :offset-assert 288) - (will-talk basic :offset-assert 296) + (will-talk symbol :offset-assert 296) (talk-message uint32 :offset-assert 300) (last-talk uint64 :offset-assert 304) - (bounce-away basic :offset-assert 312) + (bounce-away symbol :offset-assert 312) (ambient ambient-control :inline :offset-assert 320) (center-joint-index int32 :offset-assert 336) (draw-bounds-y-offset float :offset-assert 340) (neck-joint-index int32 :offset-assert 344) - (fuel-cell-anim basic :offset-assert 348) + (fuel-cell-anim spool-anim :offset-assert 348) (sound-flava uint8 :offset-assert 352) - (have-flava basic :offset-assert 356) + (have-flava symbol :offset-assert 356) (music basic :offset-assert 360) - (have-music basic :offset-assert 364) - (been-kicked basic :offset-assert 368) - (cur-trans-hook basic :offset-assert 372) - (shadow-backup basic :offset-assert 376) + (have-music symbol :offset-assert 364) + (been-kicked symbol :offset-assert 368) + (cur-trans-hook function :offset-assert 372) + (shadow-backup shadow-geo :offset-assert 376) ) :heap-base #x110 :method-count-assert 53 diff --git a/test/decompiler/reference/levels/intro/evilbro_REF.gc b/test/decompiler/reference/levels/intro/evilbro_REF.gc new file mode 100644 index 0000000000..5b5f14d42d --- /dev/null +++ b/test/decompiler/reference/levels/intro/evilbro_REF.gc @@ -0,0 +1,332 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type evilbro +(deftype evilbro (process-taskable) + ((evilsis evilsis :offset-assert 380) + ) + :heap-base #x110 + :method-count-assert 53 + :size-assert #x180 + :flag-assert #x3501100180 + ) + +;; definition for method 3 of type evilbro +(defmethod inspect evilbro ((obj evilbro)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + (format #t "~T~Tevilsis: ~A~%" (-> obj evilsis)) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-1 + (new 'static 'skeleton-group + :art-group-name "evilbro" + :bounds (new 'static 'vector :w 16384.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-1 jgeo) 0) + (set! (-> v1-1 janim) 3) + (set! (-> v1-1 mgeo 0) (the-as uint 1)) + (set! (-> v1-1 lod-dist 0) 4095996000.0) + (set! *evilbro-intro-sg* v1-1) + ) + +;; definition for method 32 of type evilbro +;; INFO: Return type mismatch spool-anim vs basic. +(defmethod play-anim! evilbro ((obj evilbro) (arg0 symbol)) + (with-pp + (cond + (arg0 + (close-specific-task! + (game-task leaving-misty) + (task-status need-introduction) + ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) pp) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'clone) + (let ((v1-2 (process->ppointer obj))) + (set! + (-> a1-2 param 0) + (the-as + uint + (logior (shl (-> v1-2 0 pid) 32) (new 'static 'handle :process v1-2)) + ) + ) + ) + (send-event-function (-> obj evilsis ppointer 3) a1-2) + ) + ) + (else + (set! (-> obj will-talk) #t) + ) + ) + (the-as + basic + (new 'static 'spool-anim + :name "evilbro-misty-end" + :index 5 + :parts 9 + :command-list '() + ) + ) + ) + ) + +;; definition for method 31 of type evilbro +(defmethod get-art-elem evilbro ((obj evilbro)) + (-> obj draw art-group data 3) + ) + +;; failed to figure out what this is: +(defstate play-anim (evilbro) + :virtual #t + :exit + (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) self) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'end-mode) + (send-event-function (-> self evilsis ppointer 3) a1-0) + ) + ((-> (method-of-type process-taskable play-anim) exit)) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate idle (evilbro) + :virtual #t + :code + (behavior () + (if (!= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) + (ja-channel-push! 1 15) + ) + (while #t + (let ((a0-7 (-> self skel root-channel 0))) + (set! + (-> a0-7 frame-group) + (the-as art-joint-anim (-> self draw art-group data 3)) + ) + (set! + (-> a0-7 param 0) + (the + float + (+ + (-> + (the-as art-joint-anim (-> self draw art-group data 3)) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-7 param 1) 1.0) + (set! (-> a0-7 frame-num) 0.0) + (joint-control-channel-group! + a0-7 + (the-as art-joint-anim (-> self draw art-group data 3)) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-8 (-> self skel root-channel 0))) + (set! + (-> a0-8 param 0) + (the float (+ (-> a0-8 frame-group data 0 length) -1)) + ) + (set! (-> a0-8 param 1) 1.0) + (joint-control-channel-group-eval! + a0-8 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((gp-0 (-> *display* base-frame-counter))) + (while (let* ((s5-0 (-> *display* base-frame-counter)) + (f30-0 300.0) + (f28-0 0.16) + (f26-0 0.17000002) + (v1-29 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-30 (the-as number (logior #x3f800000 v1-29))) + ) + (< + (- + s5-0 + (the + int + (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-30))))) + ) + ) + gp-0 + ) + ) + (suspend) + ) + ) + (let ((gp-1 (-> self skel root-channel 0))) + (set! (-> gp-1 frame-group) (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! (-> gp-1 param 0) (ja-aframe 0.0 0)) + (set! (-> gp-1 param 1) 1.0) + (set! (-> gp-1 frame-num) (ja-aframe 16.0 0)) + (joint-control-channel-group! gp-1 (if (> (-> self skel active-channels) 0) + (-> + self + skel + root-channel + 0 + frame-group + ) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((gp-2 (-> self skel root-channel 0))) + (set! (-> gp-2 param 0) (ja-aframe 0.0 0)) + (set! (-> gp-2 param 1) 1.0) + (joint-control-channel-group-eval! + gp-2 + (the-as art-joint-anim #f) + num-func-seek! + ) + ) + ) + (let ((gp-3 (-> *display* base-frame-counter))) + (while (let* ((s5-1 (-> *display* base-frame-counter)) + (f30-1 300.0) + (f28-1 0.16) + (f26-1 0.17000002) + (v1-54 + (/ (the-as int (rand-uint31-gen *random-generator*)) 256) + ) + (v1-55 (the-as number (logior #x3f800000 v1-54))) + ) + (< + (- + s5-1 + (the + int + (* f30-1 (+ f28-1 (* f26-1 (+ -1.0 (the-as float v1-55))))) + ) + ) + gp-3 + ) + ) + (suspend) + ) + ) + ) + (none) + ) + ) + +;; definition for method 11 of type evilbro +(defmethod copy-defaults! evilbro ((obj evilbro) (arg0 res-lump)) + (dummy-40 obj arg0 *evilbro-intro-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task leaving-misty))) + (set! + (-> obj evilsis) + (the-as evilsis (entity-actor-lookup arg0 'alt-actor 0)) + ) + (dummy-42 obj) + (none) + ) + +;; definition of type evilsis +(deftype evilsis (process-taskable) + () + :heap-base #x110 + :method-count-assert 53 + :size-assert #x17c + :flag-assert #x350110017c + ) + +;; definition for method 3 of type evilsis +(defmethod inspect evilsis ((obj evilsis)) + (let ((t9-0 (method-of-type process-taskable inspect))) + (t9-0 obj) + ) + obj + ) + +;; failed to figure out what this is: +(let + ((v1-7 + (new 'static 'skeleton-group + :art-group-name "evilsis" + :bounds (new 'static 'vector :w 16384.0) + :version #x6 + :shadow 2 + ) + ) + ) + (set! (-> v1-7 jgeo) 0) + (set! (-> v1-7 janim) 3) + (set! (-> v1-7 mgeo 0) (the-as uint 1)) + (set! (-> v1-7 lod-dist 0) 4095996000.0) + (set! *evilsis-intro-sg* v1-7) + ) + +;; definition for method 32 of type evilsis +;; INFO: Return type mismatch art-element vs basic. +(defmethod play-anim! evilsis ((obj evilsis) (arg0 symbol)) + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (the-as task-status (current-status (-> obj tasks)))) + ) + ) + (the-as basic (get-art-elem obj)) + ) + +;; definition for method 31 of type evilsis +(defmethod get-art-elem evilsis ((obj evilsis)) + (-> obj draw art-group data 3) + ) + +;; failed to figure out what this is: +(defstate idle (evilsis) + :virtual #t + :trans + (behavior () + (set! (-> self will-talk) #f) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) + ) + +;; definition for method 11 of type evilsis +(defmethod copy-defaults! evilsis ((obj evilsis) (arg0 res-lump)) + (dummy-40 obj arg0 *evilsis-intro-sg* 3 0 (new 'static 'vector :w 4096.0) 5) + (set! (-> obj tasks) (get-task-control (game-task leaving-misty))) + (dummy-42 obj) + (none) + ) + + + + diff --git a/test/decompiler/reference/levels/misty/mud_REF.gc b/test/decompiler/reference/levels/misty/mud_REF.gc index 341536e634..170f80015a 100644 --- a/test/decompiler/reference/levels/misty/mud_REF.gc +++ b/test/decompiler/reference/levels/misty/mud_REF.gc @@ -106,7 +106,3 @@ ) ) ) - - - - diff --git a/test/offline/offline_test_main.cpp b/test/offline/offline_test_main.cpp index fdbc1ef843..f616a72ddd 100644 --- a/test/offline/offline_test_main.cpp +++ b/test/offline/offline_test_main.cpp @@ -271,7 +271,7 @@ class OfflineDecompilation : public ::testing::Test { config->generate_symbol_definition_map = false; std::vector dgos = {"CGO/KERNEL.CGO", "CGO/ENGINE.CGO", "CGO/GAME.CGO", - "DGO/BEA.DGO", "CGO/L1.CGO"}; + "DGO/BEA.DGO", "CGO/L1.CGO", "DGO/INT.DGO"}; std::vector dgo_paths; if (g_iso_data_path.empty()) { for (auto& x : dgos) {