diff --git a/Taskfile.yml b/Taskfile.yml index e6b9c26666..c5f719a9b9 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -53,6 +53,6 @@ tasks: cmds: - cmd: ./out/build/Release/bin/offline-test.exe "./iso_data/jak1" --dump-mode ignore_error: true - - python ./scripts/update_decomp_reference.py ./failures\ ./test/decompiler/reference/ + - python ./scripts/update_decomp_reference.py ./failures ./test/decompiler/reference/ - task: offline-tests diff --git a/common/type_system/TypeSystem.cpp b/common/type_system/TypeSystem.cpp index 821d8239b5..ea224cfa09 100644 --- a/common/type_system/TypeSystem.cpp +++ b/common/type_system/TypeSystem.cpp @@ -817,7 +817,7 @@ void TypeSystem::add_builtin_types() { declare_method(obj_type, "copy", false, make_function_typespec({"_type_", "symbol"}, "_type_")); declare_method(obj_type, "relocate", false, make_function_typespec({"_type_", "int"}, "_type_")); declare_method(obj_type, "mem-usage", false, - make_function_typespec({"_type_", "memory-usage-block"}, "_type_")); + make_function_typespec({"_type_", "memory-usage-block", "int"}, "_type_")); // STRUCTURE // structure new doesn't support dynamic sizing, which is kinda weird - it grabs the size from @@ -1598,4 +1598,4 @@ bool TypeSystem::should_use_virtual_methods(const Type* type, int method_id) con bool TypeSystem::should_use_virtual_methods(const TypeSpec& type, int method_id) const { return should_use_virtual_methods(lookup_type(type), method_id); -} \ No newline at end of file +} diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index cebb66eab4..1bcd918917 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -798,7 +798,7 @@ (pid int32 :offset-assert #x28) (main-thread cpu-thread :offset-assert #x2c) (top-thread thread :offset-assert #x30) - (entity basic :offset-assert #x34) ;; entity + (entity basic :offset-assert #x34) ;; likely a res-lump (state state :offset-assert #x38) (trans-hook function :offset-assert #x3c) (post-hook function :offset-assert #x40) @@ -4987,8 +4987,8 @@ (spooling (pointer process) :offset-assert 56) ;; special print (hint (pointer process) :offset-assert 60) ;; special print (ambient (pointer process) :offset-assert 64) ;; special print - (video-mode basic :offset-assert 68) - (aspect-ratio basic :offset-assert 72) + (video-mode symbol :offset-assert 68) + (aspect-ratio symbol :offset-assert 72) ;; a guess but, anything besides this doesnt make sense (sound-flava uint8 :offset-assert 76) (auto-save basic :offset-assert 80) (music-volume-movie float :offset-assert 84) @@ -8581,7 +8581,7 @@ (flags uint32 :offset-assert 8) (in-level uint16 :offset-assert 12) (utextures uint16 :offset-assert 14) - (geometry uint32 4 :offset-assert 16) + (geometry drawable 4 :offset-assert 16) (dists vector :inline :offset-assert 32) (rdists vector :inline :offset-assert 48) (next uint32 4 :offset-assert 64) @@ -8624,7 +8624,7 @@ (deftype prototype-array-shrub-info (basic) ((prototype-inline-array-shrub basic :offset-assert 4) - (wind-vectors uint32 :offset-assert 8) + (wind-vectors uint32 :offset-assert 8) ; likely a pointer ) :method-count-assert 9 :size-assert #xc @@ -8653,18 +8653,19 @@ ) (deftype prototype-array-tie (array) - () + ((array-data prototype-bucket-tie :dynamic :offset 16) ;; NOTE - field added, not 100% positive on the type + ) :method-count-assert 10 :size-assert #x10 :flag-assert #xa00000010 (:methods - (dummy-9 () none 9) + (TODO-RENAME-9 (_type_) none 9) ) ) (deftype proxy-prototype-array-tie (basic) ((prototype-array-tie basic :offset-assert 4) - (wind-vectors uint32 :offset-assert 8) + (wind-vectors uint32 :offset-assert 8) ; likely a pointer ) :method-count-assert 9 :size-assert #xc @@ -13846,7 +13847,7 @@ (dummy-20 () none 20) (dummy-21 () none 21) (dummy-22 () none 22) - (dummy-23 () none 23) + (TODO-RENAME-23 (_type_ symbol symbol) none 23) (dummy-24 () none 24) (dummy-25 () none 25) (dummy-26 () none 26) @@ -15450,7 +15451,7 @@ ;; - Unknowns ;;(define-extern shadow-vu0-block object) ;; unknown type -;;(define-extern *shadow-data* object) ;; unknown type +(define-extern *shadow-data* shadow-data) ;; ---------------------- @@ -16311,7 +16312,7 @@ (define-extern auto-save-command function) (define-extern auto-save-init-by-other function) -(define-extern get-aspect-ratio function) +(define-extern get-aspect-ratio (function symbol)) (define-extern get-task-status function) (define-extern calculate-completion function) (define-extern game-save-elt->string function) @@ -16334,8 +16335,8 @@ ;; - Symbols -(define-extern set-aspect-ratio function) -(define-extern set-video-mode function) +(define-extern set-aspect-ratio (function symbol none)) +(define-extern set-video-mode (function symbol none)) ;; - Unknowns @@ -17852,6 +17853,7 @@ (num-planes int32 :offset-assert 16) (plane uint32 :offset-assert 20) ) + :pack-me :method-count-assert 12 :size-assert #x18 :flag-assert #xc00000018 @@ -17862,25 +17864,26 @@ ) ) -; (deftype vol-control (basic) -; ((flags uint32 :offset-assert 4) -; (process basic :offset-assert 8) -; (pos-vol-count int32 :offset-assert 12) -; (pos-vol UNKNOWN 32 :offset-assert 16) -; (neg-vol-count int32 :offset-assert 784) -; (neg-vol UNKNOWN 32 :offset-assert 788) -; (debug-point basic :offset-assert 1556) -; (debug-normal basic :offset-assert 1560) -; ) -; :method-count-assert 12 -; :size-assert #x61c -; :flag-assert #xc0000061c -; (:methods -; (dummy-9 () none 9) -; (dummy-10 () none 10) -; (dummy-11 () none 11) -; ) -; ) +(deftype vol-control (basic) + ((flags uint32 :offset-assert 4) + (process process-drawable :offset-assert 8) + (pos-vol-count int32 :offset-assert 12) + (pos-vol plane-volume 32 :inline :offset-assert 16) + (neg-vol-count int32 :offset-assert 784) + (neg-vol plane-volume 32 :inline :offset-assert 788) + (debug-point basic :offset-assert 1556) + (debug-normal basic :offset-assert 1560) + ) + :method-count-assert 12 + :size-assert #x61c + :flag-assert #xc0000061c + (:methods + (new (symbol type process-drawable) _type_ 0) + (dummy-9 () none 9) + (dummy-10 () none 10) + (TODO-RENAME-11 (_type_) symbol 11) + ) + ) @@ -19318,7 +19321,7 @@ ;; - Symbols -(define-extern set-hud-aspect-ratio function) +(define-extern set-hud-aspect-ratio (function symbol symbol none)) ;; TODO return type not validated yet ;; ---------------------- @@ -21416,57 +21419,57 @@ ;; - Types -; (deftype rigid-body (structure) -; ((mass float :offset-assert 0) -; (inv-mass float :offset-assert 4) -; (lin-momentum-damping-factor float :offset-assert 8) -; (ang-momentum-damping-factor float :offset-assert 12) -; (inertial-tensor matrix :inline :offset-assert 16) -; (inv-inertial-tensor matrix :inline :offset-assert 80) -; (cm-offset-joint vector :inline :offset-assert 144) -; (position vector :inline :offset-assert 160) -; (rotation quaternion :inline :offset-assert 176) -; (lin-momentum vector :inline :offset-assert 192) -; (ang-momentum vector :inline :offset-assert 208) -; (lin-velocity vector :inline :offset-assert 224) -; (ang-velocity vector :inline :offset-assert 240) -; (inv-i-world matrix :inline :offset-assert 256) -; (matrix matrix :inline :offset-assert 320) -; (force vector :inline :offset-assert 384) -; (torque vector :inline :offset-assert 400) -; (max-ang-momentum float :offset-assert 416) -; (max-ang-velocity float :offset-assert 420) -; ) -; :method-count-assert 23 -; :size-assert #x1a8 -; :flag-assert #x17000001a8 -; (: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) -; ) -; ) +(deftype rigid-body (structure) + ((mass float :offset-assert 0) + (inv-mass float :offset-assert 4) + (lin-momentum-damping-factor float :offset-assert 8) + (ang-momentum-damping-factor float :offset-assert 12) + (inertial-tensor matrix :inline :offset-assert 16) + (inv-inertial-tensor matrix :inline :offset-assert 80) + (cm-offset-joint vector :inline :offset-assert 144) + (position vector :inline :offset-assert 160) + (rotation quaternion :inline :offset-assert 176) + (lin-momentum vector :inline :offset-assert 192) + (ang-momentum vector :inline :offset-assert 208) + (lin-velocity vector :inline :offset-assert 224) + (ang-velocity vector :inline :offset-assert 240) + (inv-i-world matrix :inline :offset-assert 256) + (matrix matrix :inline :offset-assert 320) + (force vector :inline :offset-assert 384) + (torque vector :inline :offset-assert 400) + (max-ang-momentum float :offset-assert 416) + (max-ang-velocity float :offset-assert 420) + ) + :method-count-assert 23 + :size-assert #x1a8 + :flag-assert #x17000001a8 + (: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) + ) + ) -; (deftype rigid-body-control-point (structure) -; ((local-pos vector :inline :offset-assert 0) -; (world-pos vector :inline :offset-assert 16) -; (velocity vector :inline :offset-assert 32) -; ) -; :method-count-assert 9 -; :size-assert #x30 -; :flag-assert #x900000030 -; ) +(deftype rigid-body-control-point (structure) + ((local-pos vector :inline :offset-assert 0) + (world-pos vector :inline :offset-assert 16) + (velocity vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) @@ -21744,164 +21747,154 @@ ;; - Types -; (deftype nav-enemy-info (basic) -; ((idle-anim int32 :offset-assert 4) -; (walk-anim int32 :offset-assert 8) -; (turn-anim int32 :offset-assert 12) -; (notice-anim int32 :offset-assert 16) -; (run-anim int32 :offset-assert 20) -; (jump-anim int32 :offset-assert 24) -; (jump-land-anim int32 :offset-assert 28) -; (victory-anim int32 :offset-assert 32) -; (taunt-anim int32 :offset-assert 36) -; (die-anim int32 :offset-assert 40) -; (neck-joint int32 :offset-assert 44) -; (player-look-at-joint int32 :offset-assert 48) -; (run-travel-speed meters :offset-assert 52) -; (run-rotate-speed deg :offset-assert 56) -; (run-acceleration meters :offset-assert 60) -; (run-turn-time useconds :offset-assert 64) -; (walk-travel-speed meters :offset-assert 72) -; (walk-rotate-speed deg :offset-assert 76) -; (walk-acceleration meters :offset-assert 80) -; (walk-turn-time useconds :offset-assert 88) -; (attack-shove-back meters :offset-assert 96) -; (attack-shove-up meters :offset-assert 100) -; (shadow-size meters :offset-assert 104) -; (notice-nav-radius meters :offset-assert 108) -; (nav-nearest-y-threshold meters :offset-assert 112) -; (notice-distance meters :offset-assert 116) -; (proximity-notice-distance meters :offset-assert 120) -; (stop-chase-distance meters :offset-assert 124) -; (frustration-distance meters :offset-assert 128) -; (frustration-time uint64 :offset-assert 136) -; (die-anim-hold-frame float :offset-assert 144) -; (jump-anim-start-frame float :offset-assert 148) -; (jump-land-anim-end-frame float :offset-assert 152) -; (jump-height-min meters :offset-assert 156) -; (jump-height-factor float :offset-assert 160) -; (jump-start-anim-speed float :offset-assert 164) -; (shadow-max-y meters :offset-assert 168) -; (shadow-min-y meters :offset-assert 172) -; (shadow-locus-dist meters :offset-assert 176) -; (use-align basic :offset-assert 180) -; (draw-shadow basic :offset-assert 184) -; (move-to-ground basic :offset-assert 188) -; (hover-if-no-ground basic :offset-assert 192) -; (use-momentum basic :offset-assert 196) -; (use-flee basic :offset-assert 200) -; (use-proximity-notice basic :offset-assert 204) -; (use-jump-blocked basic :offset-assert 208) -; (use-jump-patrol basic :offset-assert 212) -; (gnd-collide-with uint64 :offset-assert 216) -; (debug-draw-neck basic :offset-assert 224) -; (debug-draw-jump basic :offset-assert 228) -; ) -; :method-count-assert 9 -; :size-assert #xe8 -; :flag-assert #x9000000e8 -; ) - -; (deftype nav-enemy (process-drawable) -; ((hit-from-dir vector :inline :offset-assert 176) -; (event-param-point vector :inline :offset-assert 192) -; (frustration-point vector :inline :offset-assert 208) -; (jump-dest vector :inline :offset-assert 224) -; (jump-trajectory trajectory :inline :offset-assert 240) -; (jump-time uint64 :offset-assert 280) -; (nav-info basic :offset-assert 288) -; (target-speed float :offset-assert 292) -; (momentum-speed float :offset-assert 296) -; (acceleration float :offset-assert 300) -; (rotate-speed float :offset-assert 304) -; (turn-time uint64 :offset-assert 312) -; (frustration-time uint64 :offset-assert 320) -; (speed-scale float :offset-assert 328) -; (neck basic :offset-assert 332) -; (reaction-time uint64 :offset-assert 336) -; (notice-time uint64 :offset-assert 344) -; (state-timeout uint64 :offset-assert 352) -; (free-time uint64 :offset-assert 360) -; (touch-time uint64 :offset-assert 368) -; (nav-enemy-flags uint32 :offset-assert 376) -; (incomming-attack-id uint64 :offset-assert 384) -; (jump-return-state basic :offset-assert 392) -; (rand-gen basic :offset-assert 396) -; ) -; :method-count-assert 76 -; :size-assert #x190 -; :flag-assert #x4c01200190 -; ;; inherited inspect of process-drawable -; (: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) -; (dummy-53 () none 53) -; (dummy-54 () none 54) -; (dummy-55 () none 55) -; (dummy-56 () none 56) -; (dummy-57 () none 57) -; (dummy-58 () none 58) -; (dummy-59 () none 59) -; (dummy-60 () none 60) -; (dummy-61 () none 61) -; (dummy-62 () none 62) -; (dummy-63 () none 63) -; (dummy-64 () none 64) -; (dummy-65 () none 65) -; (dummy-66 () none 66) -; (dummy-67 () none 67) -; (dummy-68 () none 68) -; (dummy-69 () none 69) -; (dummy-70 () none 70) -; (dummy-71 () none 71) -; (dummy-72 () none 72) -; (dummy-73 () none 73) -; (dummy-74 () none 74) -; (dummy-75 () none 75) -; ) -; ) +(deftype nav-enemy-info (basic) + ((idle-anim int32 :offset-assert 4) + (walk-anim int32 :offset-assert 8) + (turn-anim int32 :offset-assert 12) + (notice-anim int32 :offset-assert 16) + (run-anim int32 :offset-assert 20) + (jump-anim int32 :offset-assert 24) + (jump-land-anim int32 :offset-assert 28) + (victory-anim int32 :offset-assert 32) + (taunt-anim int32 :offset-assert 36) + (die-anim int32 :offset-assert 40) + (neck-joint int32 :offset-assert 44) + (player-look-at-joint int32 :offset-assert 48) + (run-travel-speed float :offset-assert 52) ; meters + (run-rotate-speed float :offset-assert 56) ; deg + (run-acceleration float :offset-assert 60) ; meters + (run-turn-time uint64 :offset-assert 64) ; seconds + (walk-travel-speed float :offset-assert 72) ; meters + (walk-rotate-speed float :offset-assert 76) ; deg + (walk-acceleration float :offset-assert 80) ; meters + (walk-turn-time uint64 :offset-assert 88) ; seconds + (attack-shove-back float :offset-assert 96) ; meters + (attack-shove-up float :offset-assert 100) ; meters + (shadow-size float :offset-assert 104) ; meters + (notice-nav-radius float :offset-assert 108) ; meters + (nav-nearest-y-threshold float :offset-assert 112) ; meters + (notice-distance float :offset-assert 116) ; meters + (proximity-notice-distance float :offset-assert 120) ; meters + (stop-chase-distance float :offset-assert 124) ; meters + (frustration-distance float :offset-assert 128) ; meters + (frustration-time uint64 :offset-assert 136) + (die-anim-hold-frame float :offset-assert 144) + (jump-anim-start-frame float :offset-assert 148) + (jump-land-anim-end-frame float :offset-assert 152) + (jump-height-min float :offset-assert 156) ; meters + (jump-height-factor float :offset-assert 160) + (jump-start-anim-speed float :offset-assert 164) + (shadow-max-y float :offset-assert 168) ; meters + (shadow-min-y float :offset-assert 172) ; meters + (shadow-locus-dist float :offset-assert 176) ; meters + (use-align basic :offset-assert 180) + (draw-shadow basic :offset-assert 184) + (move-to-ground basic :offset-assert 188) + (hover-if-no-ground basic :offset-assert 192) + (use-momentum basic :offset-assert 196) + (use-flee basic :offset-assert 200) + (use-proximity-notice basic :offset-assert 204) + (use-jump-blocked basic :offset-assert 208) + (use-jump-patrol basic :offset-assert 212) + (gnd-collide-with uint64 :offset-assert 216) + (debug-draw-neck basic :offset-assert 224) + (debug-draw-jump basic :offset-assert 228) + ) + :method-count-assert 9 + :size-assert #xe8 + :flag-assert #x9000000e8 + ) + +(deftype nav-enemy (process-drawable) + ((hit-from-dir vector :inline :offset-assert 176) + (event-param-point vector :inline :offset-assert 192) + (frustration-point vector :inline :offset-assert 208) + (jump-dest vector :inline :offset-assert 224) + (jump-trajectory trajectory :inline :offset-assert 240) + (jump-time uint64 :offset-assert 280) + (nav-info basic :offset-assert 288) + (target-speed float :offset-assert 292) + (momentum-speed float :offset-assert 296) + (acceleration float :offset-assert 300) + (rotate-speed float :offset-assert 304) + (turn-time uint64 :offset-assert 312) + (frustration-time uint64 :offset-assert 320) + (speed-scale float :offset-assert 328) + (neck basic :offset-assert 332) + (reaction-time uint64 :offset-assert 336) + (notice-time uint64 :offset-assert 344) + (state-timeout uint64 :offset-assert 352) + (free-time uint64 :offset-assert 360) + (touch-time uint64 :offset-assert 368) + (nav-enemy-flags uint32 :offset-assert 376) + (incomming-attack-id uint64 :offset-assert 384) + (jump-return-state basic :offset-assert 392) + (rand-gen basic :offset-assert 396) + ) + :heap-base #x120 + :method-count-assert 76 + :size-assert #x190 + :flag-assert #x4c01200190 + ;; inherited inspect of process-drawable + (:methods + (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) + (dummy-53 () none 53) + (dummy-54 () none 54) + (dummy-55 () none 55) + (dummy-56 () none 56) + (dummy-57 () none 57) + (dummy-58 () none 58) + (dummy-59 () none 59) + (dummy-60 () none 60) + (dummy-61 () none 61) + (dummy-62 () none 62) + (dummy-63 () none 63) + (dummy-64 () none 64) + (dummy-65 () none 65) + (dummy-66 () none 66) + (dummy-67 () none 67) + (dummy-68 () none 68) + (dummy-69 () none 69) + (dummy-70 () none 70) + (dummy-71 () none 71) + (dummy-72 () none 72) + (dummy-73 () none 73) + (dummy-74 () none 74) + (dummy-75 () none 75) + ) + ) @@ -23147,26 +23140,26 @@ ;; - Types -; (deftype air-box (structure) -; ((vecs UNKNOWN 2 :offset-assert 0) -; (x-pos float :offset-assert 0) -; (height-level float :offset-assert 4) -; (z-pos float :offset-assert 8) -; (cos-angle float :offset-assert 12) -; (x-length float :offset-assert 16) -; (z-length float :offset-assert 24) -; (sin-angle float :offset-assert 28) -; ) -; :method-count-assert 9 -; :size-assert #x20 -; :flag-assert #x900000020 -; ) +(deftype air-box (structure) + ((vecs vector 2 :inline :offset-assert 0) + (x-pos float :offset 0) + (height-level float :offset 4) + (z-pos float :offset 8) + (cos-angle float :offset 12) + (x-length float :offset 16) + (z-length float :offset 24) + (sin-angle float :offset 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) ;; - Symbols -(define-extern point-in-air-box-area? function) -(define-extern point-in-air-box? function) +(define-extern point-in-air-box-area? (function float float air-box symbol)) +(define-extern point-in-air-box? (function vector air-box symbol)) ;; ---------------------- diff --git a/decompiler/config/jak1_ntsc_black_label.jsonc b/decompiler/config/jak1_ntsc_black_label.jsonc index d62f9dd68a..d3c4a896a6 100644 --- a/decompiler/config/jak1_ntsc_black_label.jsonc +++ b/decompiler/config/jak1_ntsc_black_label.jsonc @@ -3,7 +3,7 @@ // if you want to filter to only some object names. // it will make the decompiler much faster. - "allowed_objects": ["effect-control-h"], + "allowed_objects": ["vol-h"], //////////////////////////// // CODE ANALYSIS OPTIONS diff --git a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc index 5e21c96e60..fcf1934988 100644 --- a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc @@ -543,5 +543,9 @@ ["L276", "uint64", true], ["L275", "uint64", true], ["L133", "_auto_", true] + ], + + "vol-h": [ + ["L13", "float", true] ] } diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index 29b5071aba..84b24ac355 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -542,7 +542,6 @@ "(method 9 actor-link-info)": [[[0, 36], "s3", "entity-actor"]], "alt-actor-list-subtask-incomplete-count": [[19, "a0", "entity-links"]], "actor-link-dead-hook": [[1, "v1", "entity-links"]], - "actor-link-subtask-complete-hook": [[1, "v1", "entity-links"]], "check-irx-version": [[[6, 37], "gp", "sound-rpc-get-irx-version"]], "sound-bank-load": [[[9, 11], "v1", "sound-rpc-load-bank"]], @@ -588,5 +587,28 @@ [[12, 44], "gp", "sound-rpc-set-param"] ], "(method 12 ambient-sound)": [[[8, 20], "v1", "sound-rpc-set-param"]], - "sound-buffer-dump": [[[14, 25], "s3", "sound-rpc-play"]] + "sound-buffer-dump": [[[14, 25], "s3", "sound-rpc-play"]], + "actor-link-subtask-complete-hook": [[1, "v1", "entity-links"]], + + "(method 0 vol-control)": [ + [[9, 14], "t9", "(function object object)"], + [30, "s5", "res-lump"], + [36, "s5", "res-lump"], + [58, "s5", "res-lump"], + [62, "s5", "res-lump"], + [85, "s5", "res-lump"], + [91, "s5", "res-lump"], + [113, "s5", "res-lump"], + [117, "s5", "res-lump"] + ], + + "point-in-air-box?": [ + [5, "f1", "float"] + ], + + "(method 3 air-box)": [ + [16, "f0", "float"], + [22, "f0", "float"], + [28, "f0", "float"] + ] } diff --git a/decompiler/config/jak1_ntsc_black_label/var_names.jsonc b/decompiler/config/jak1_ntsc_black_label/var_names.jsonc index ed8a316c02..eabfd955f5 100644 --- a/decompiler/config/jak1_ntsc_black_label/var_names.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/var_names.jsonc @@ -1572,13 +1572,13 @@ "shrubbery-login-post-texture": { "args": ["obj"], "vars": { - "v1-1":"shader-count", - "a1-1":["dst", "qword"], - "a2-5":["tex-dst", "qword"], - "a3-0":["src", "qword"], - "a2-6":["text-dst2", "qword"], - "a3-1":["src-2", "qword"], - "a3-2":["src-3", "qword"] + "v1-1": "shader-count", + "a1-1": ["dst", "qword"], + "a2-5": ["tex-dst", "qword"], + "a3-0": ["src", "qword"], + "a2-6": ["text-dst2", "qword"], + "a3-1": ["src-2", "qword"], + "a3-2": ["src-3", "qword"] } }, diff --git a/goal_src/engine/game/settings-h.gc b/goal_src/engine/game/settings-h.gc index 8bf5a0b79f..88c37a7c45 100644 --- a/goal_src/engine/game/settings-h.gc +++ b/goal_src/engine/game/settings-h.gc @@ -23,8 +23,8 @@ (spooling (pointer process) :offset-assert 56) ;; special print (hint (pointer process) :offset-assert 60) ;; special print (ambient (pointer process) :offset-assert 64) ;; special print - (video-mode basic :offset-assert 68) - (aspect-ratio basic :offset-assert 72) + (video-mode symbol :offset-assert 68) + (aspect-ratio symbol :offset-assert 72) (sound-flava uint8 :offset-assert 76) (auto-save basic :offset-assert 80) (music-volume-movie float :offset-assert 84) diff --git a/goal_src/engine/game/settings.gc b/goal_src/engine/game/settings.gc index 8484231ef1..4f3475ca56 100644 --- a/goal_src/engine/game/settings.gc +++ b/goal_src/engine/game/settings.gc @@ -5,3 +5,5 @@ ;; name in dgo: settings ;; dgos: GAME, ENGINE +;; TODO - for video +(define-extern *setting-control* setting-control) diff --git a/goal_src/engine/game/video.gc b/goal_src/engine/game/video.gc index 2b51a3f6c2..d53fca680f 100644 --- a/goal_src/engine/game/video.gc +++ b/goal_src/engine/game/video.gc @@ -5,3 +5,102 @@ ;; name in dgo: video ;; dgos: GAME, ENGINE +;; definition for function set-video-mode +;; INFO: Return type mismatch int vs none. +(defun set-video-mode ((arg0 symbol)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 'ntsc) + (set! (-> *video-parms* screen-sy) 224) + (set! (-> *setting-control* default screenx) 0) + (set! (-> *setting-control* default screeny) 8) + (set! (-> *video-parms* screen-pages-high) 7) + (set! (-> *video-parms* relative-y-scale) 1.0) + (set! *ticks-per-frame* 9765) + (set! (-> *math-camera* isometric vector 1 y) 0.5) + (set! (-> *math-camera* y-pix) 112.0) + (set! (-> *math-camera* y-clip) 448.0) + (set! (-> *shadow-data* texoffset y) 112.5) + ) + ((= v1-0 'pal) + (set! (-> *video-parms* screen-sy) 256) + (set! (-> *setting-control* default screenx) 0) + (set! (-> *setting-control* default screeny) 24) + (set! (-> *video-parms* screen-pages-high) 8) + (set! (-> *video-parms* relative-y-scale) 1.1428572) + (set! *ticks-per-frame* #x2dc6) + (set! (-> *math-camera* isometric vector 1 y) 0.4375) + (set! (-> *math-camera* y-pix) 128.0) + (set! (-> *math-camera* y-clip) 512.0) + (set! (-> *shadow-data* texoffset y) 128.5) + ) + ) + ) + (set-time-ratios *display* (-> *display* time-ratio)) + (set! (-> *video-parms* reset-video-mode) #t) + (set! (-> *video-parms* screen-hy) (/ (-> *video-parms* screen-sy) 2)) + (set! (-> *video-parms* screen-miny) (- 2048 (-> *video-parms* screen-hy))) + (set! (-> *video-parms* screen-maxy) (+ (-> *video-parms* screen-hy) 2048)) + (set! (-> *video-parms* screen-masky) (+ (-> *video-parms* screen-sy) -1)) + (set! + (-> *pause-context* origin y) + (the float (+ (-> *video-parms* screen-sy) -54)) + ) + (set! (-> *pause-context* height) (the float (-> *video-parms* screen-sy))) + (set! + (-> *font-default-matrix* vector 1 y) + (-> *video-parms* relative-y-scale) + ) + (set! + (-> *font-default-matrix* vector 3 y) + (- (the float (-> *video-parms* screen-hy))) + ) + (set! (-> *video-parms* relative-y-scale-reciprical) 1.0) + (set! *profile-y* (+ (-> *video-parms* screen-miny) 8)) + (set! (-> *video-parms* set-video-mode) #t) + (set-hud-aspect-ratio (get-aspect-ratio) arg0) + (if *progress-process* + (TODO-RENAME-23 (-> *progress-process* 0) (get-aspect-ratio) arg0) + ) + (let ((v0-3 0)) + ) + (none) + ) + +;; definition for function get-video-mode +(defun get-video-mode () + (-> *setting-control* current video-mode) + ) + +;; definition for function set-aspect-ratio +;; INFO: Return type mismatch int vs none. +(defun set-aspect-ratio ((arg0 symbol)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 'aspect4x3) + (set! (-> *video-parms* relative-x-scale) 1.0) + (set! (-> *video-parms* relative-x-scale-reciprical) 1.0) + ) + ((= v1-0 'aspect16x9) + (set! (-> *video-parms* relative-x-scale) 0.75) + (set! (-> *video-parms* relative-x-scale-reciprical) 1.3333334) + ) + ) + ) + (set! + (-> *font-default-matrix* vector 0 x) + (-> *video-parms* relative-x-scale) + ) + (set-hud-aspect-ratio arg0 (get-video-mode)) + (if *progress-process* + (TODO-RENAME-23 (-> *progress-process* 0) arg0 (get-video-mode)) + ) + (let ((v0-2 0)) + ) + (none) + ) + +;; definition for function get-aspect-ratio +(defun get-aspect-ratio () + (-> *setting-control* current aspect-ratio) + ) diff --git a/goal_src/engine/geometry/vol-h.gc b/goal_src/engine/geometry/vol-h.gc index 027f3026a3..112f858601 100644 --- a/goal_src/engine/geometry/vol-h.gc +++ b/goal_src/engine/geometry/vol-h.gc @@ -5,3 +5,184 @@ ;; name in dgo: vol-h ;; dgos: GAME, ENGINE +;; definition of type plane-volume +(deftype plane-volume (structure) + ((volume-type basic :offset-assert 0) + (point-count int16 :offset-assert 4) + (normal-count int16 :offset-assert 6) + (first-point vector :offset-assert 8) + (first-normal vector :offset-assert 12) + (num-planes int32 :offset-assert 16) + (plane uint32 :offset-assert 20) + ) + :pack-me + :method-count-assert 12 + :size-assert #x18 + :flag-assert #xc00000018 + (:methods + (dummy-9 () none 9) + (dummy-10 () none 10) + (dummy-11 () none 11) + ) + ) + +;; definition of type vol-control +(deftype vol-control (basic) + ((flags uint32 :offset-assert 4) + (process process-drawable :offset-assert 8) + (pos-vol-count int32 :offset-assert 12) + (pos-vol plane-volume 32 :inline :offset-assert 16) + (neg-vol-count int32 :offset-assert 784) + (neg-vol plane-volume 32 :inline :offset-assert 788) + (debug-point basic :offset-assert 1556) + (debug-normal basic :offset-assert 1560) + ) + :method-count-assert 12 + :size-assert #x61c + :flag-assert #xc0000061c + (:methods + (new (symbol type process-drawable) _type_ 0) + (dummy-9 () none 9) + (dummy-10 () none 10) + (TODO-RENAME-11 (_type_) symbol 11) + ) + ) + +;; definition for method 0 of type vol-control +;; INFO: Return type mismatch object vs vol-control. +;; Used lq/sq +(defmethod + new + vol-control + ((allocation symbol) (type-to-make type) (arg0 process-drawable)) + (local-vars (pp process)) + (let + ((gp-0 + (the-as + object + (object-new allocation type-to-make (the-as int (-> type-to-make size))) + ) + ) + ) + (if (zero? (the-as vol-control gp-0)) + (begin + (let ((t9-1 (the-as (function object object) enter-state)) + (a0-1 "memory") + ) + (set! (-> pp next-state) process-drawable-art-error) + (t9-1 a0-1) + ) + (set! gp-0 0) + (goto cfg-13) + ) + ) + (set! (-> (the-as vol-control gp-0) process) arg0) + (let* ((s5-1 (-> (the-as vol-control gp-0) process entity)) + (s4-0 + (-> + ((method-of-type res-lump lookup-tag-idx) + (the-as res-lump s5-1) + 'vol + 'exact + 0.0 + ) + lo + ) + ) + ) + (when (>= s4-0 0) + (let ((s3-0 s4-0) + (s2-0 (-> (-> (the-as res-lump s5-1) tag) s4-0)) + ) + (let ((v1-10 0)) + ) + (while (= (-> s2-0 name) (-> (-> (the-as res-lump s5-1) tag) s4-0 name)) + (let + ((v1-12 + (make-property-data + (the-as res-lump s5-1) + 0.0 + (the-as res-tag-pair s3-0) + (the-as pointer #f) + ) + ) + (a0-8 + (-> + (the-as vol-control gp-0) + pos-vol + (-> (the-as vol-control gp-0) pos-vol-count) + ) + ) + ) + (set! (-> a0-8 num-planes) (the-as int (-> s2-0 elt-count))) + (set! (-> a0-8 plane) (the-as uint v1-12)) + ) + (set! + (-> (the-as vol-control gp-0) pos-vol-count) + (+ (-> (the-as vol-control gp-0) pos-vol-count) 1) + ) + (+! s3-0 1) + (set! s2-0 (-> (-> (the-as res-lump s5-1) tag) s3-0)) + ) + ) + ) + ) + (let* ((s5-2 (-> (the-as vol-control gp-0) process entity)) + (s4-1 + (-> + ((method-of-type res-lump lookup-tag-idx) + (the-as res-lump s5-2) + 'cutoutvol + 'exact + 0.0 + ) + lo + ) + ) + ) + (when (>= s4-1 0) + (let ((s3-1 s4-1) + (s2-1 (-> (-> (the-as res-lump s5-2) tag) s4-1)) + ) + (let ((v1-29 0)) + ) + (while (= (-> s2-1 name) (-> (-> (the-as res-lump s5-2) tag) s4-1 name)) + (let + ((v1-31 + (make-property-data + (the-as res-lump s5-2) + 0.0 + (the-as res-tag-pair s3-1) + (the-as pointer #f) + ) + ) + (a0-19 + (-> + (the-as vol-control gp-0) + neg-vol + (-> (the-as vol-control gp-0) neg-vol-count) + ) + ) + ) + (set! (-> a0-19 num-planes) (the-as int (-> s2-1 elt-count))) + (set! (-> a0-19 plane) (the-as uint v1-31)) + ) + (set! + (-> (the-as vol-control gp-0) neg-vol-count) + (+ (-> (the-as vol-control gp-0) neg-vol-count) 1) + ) + (+! s3-1 1) + (set! s2-1 (-> (-> (the-as res-lump s5-2) tag) s3-1)) + ) + ) + ) + ) + (label cfg-13) + (the-as vol-control gp-0) + ) + ) + +;; definition for method 11 of type vol-control +(defmethod TODO-RENAME-11 vol-control ((obj vol-control)) + (and *display-vol-marks* (nonzero? (logand (-> obj flags) 1))) + ) diff --git a/goal_src/engine/gfx/hw/video-h.gc b/goal_src/engine/gfx/hw/video-h.gc index 61155a87e0..da8a90e758 100644 --- a/goal_src/engine/gfx/hw/video-h.gc +++ b/goal_src/engine/gfx/hw/video-h.gc @@ -46,5 +46,9 @@ :relative-y-scale-reciprical 0.0 ;; ?? ) ) - + (define-extern get-video-mode (function symbol)) +;; NOTE - Not in actual output, but the first function in video.gc calls it before it's defined +(define-extern get-aspect-ratio (function symbol)) +;; TODO - for video, actually defined in hud-classes though! +(define-extern set-hud-aspect-ratio (function symbol symbol none)) diff --git a/goal_src/engine/gfx/shadow/shadow-cpu.gc b/goal_src/engine/gfx/shadow/shadow-cpu.gc index e0af314b02..6e155eb001 100644 --- a/goal_src/engine/gfx/shadow/shadow-cpu.gc +++ b/goal_src/engine/gfx/shadow/shadow-cpu.gc @@ -5,3 +5,5 @@ ;; name in dgo: shadow-cpu ;; dgos: GAME, ENGINE +;; TODO - for video +(define-extern *shadow-data* shadow-data) diff --git a/goal_src/engine/gfx/texture.gc b/goal_src/engine/gfx/texture.gc index 592df514e8..444cad3c01 100644 --- a/goal_src/engine/gfx/texture.gc +++ b/goal_src/engine/gfx/texture.gc @@ -108,7 +108,7 @@ (the-as int (+ (-> obj type size) (the-as uint (shl (-> obj length) 2)))) ) -(defmethod mem-usage texture-page ((obj texture-page) (arg0 memory-usage-block)) +(defmethod mem-usage texture-page ((obj texture-page) (arg0 memory-usage-block) (arg1 int)) "Update the mem-usage for a texture." ;; some setup for texture memory usage. diff --git a/goal_src/engine/gfx/tie/prototype-h.gc b/goal_src/engine/gfx/tie/prototype-h.gc index dc7efd7472..8c1a89fd8a 100644 --- a/goal_src/engine/gfx/tie/prototype-h.gc +++ b/goal_src/engine/gfx/tie/prototype-h.gc @@ -6,25 +6,25 @@ ;; dgos: GAME, ENGINE (deftype prototype-bucket (basic) - ((name basic :offset-assert 4) - (flags uint32 :offset-assert 8) - (in-level uint16 :offset-assert 12) - (utextures uint16 :offset-assert 14) - (geometry uint32 4 :offset-assert 16) - (dists vector :inline :offset-assert 32) - (rdists vector :inline :offset-assert 48) - (next uint32 4 :offset-assert 64) - (count uint16 4 :offset-assert 80) - (near-plane float :offset 32) - (near-stiff float :offset 36) - (mid-plane float :offset 40) - (far-plane float :offset 44) - (rlength-near float :offset 48) - (rlength-stiff float :offset 52) - (rlength-mid float :offset 56) - (stiffness float :offset 60) - (next-clear uint128 :offset 64) - (count-clear uint64 :offset 80) + ((name basic :offset-assert 4) + (flags uint32 :offset-assert 8) + (in-level uint16 :offset-assert 12) + (utextures uint16 :offset-assert 14) + (geometry drawable 4 :offset-assert 16) + (dists vector :inline :offset-assert 32) + (rdists vector :inline :offset-assert 48) + (next uint32 4 :offset-assert 64) + (count uint16 4 :offset-assert 80) + (near-plane float :offset 32) + (near-stiff float :offset 36) + (mid-plane float :offset 40) + (far-plane float :offset 44) + (rlength-near float :offset 48) + (rlength-stiff float :offset 52) + (rlength-mid float :offset 56) + (stiffness float :offset 60) + (next-clear uint128 :offset 64) + (count-clear uint64 :offset 80) ) :method-count-assert 9 :size-assert #x58 @@ -51,6 +51,18 @@ :flag-assert #x1200000094 ) +(defmethod + inspect + prototype-inline-array-shrub + ((obj prototype-inline-array-shrub)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Tid: ~D~%" (-> obj id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~Tlength: ~D~%" (-> obj length)) + (format #t "~Tdata[1] @ #x~X~%" (-> obj data)) + obj + ) + (deftype prototype-array-shrub-info (basic) ((prototype-inline-array-shrub basic :offset-assert 4) (wind-vectors uint32 :offset-assert 8) @@ -82,12 +94,13 @@ ) (deftype prototype-array-tie (array) - () + ((array-data prototype-bucket-tie :dynamic :offset 16) + ) :method-count-assert 10 :size-assert #x10 :flag-assert #xa00000010 (:methods - (dummy-9 () none 9) + (TODO-RENAME-9 (_type_) none 9) ) ) diff --git a/goal_src/engine/ui/progress-h.gc b/goal_src/engine/ui/progress-h.gc index 2ce1572ebc..82428854c7 100644 --- a/goal_src/engine/ui/progress-h.gc +++ b/goal_src/engine/ui/progress-h.gc @@ -129,7 +129,7 @@ (dummy-20 () none 20) (dummy-21 () none 21) (dummy-22 () none 22) - (dummy-23 () none 23) + (TODO-RENAME-23 (_type_ symbol symbol) none 23) (dummy-24 () none 24) (dummy-25 () none 25) (dummy-26 () none 26) diff --git a/goal_src/levels/beach/air-h.gc b/goal_src/levels/beach/air-h.gc index ba795c3423..76da8e8d01 100644 --- a/goal_src/levels/beach/air-h.gc +++ b/goal_src/levels/beach/air-h.gc @@ -5,3 +5,64 @@ ;; name in dgo: air-h ;; dgos: BEA, L1 +;; definition of type air-box +(deftype air-box (structure) + ((vecs vector 2 :inline :offset-assert 0) + (x-pos float :offset 0) + (height-level float :offset 4) + (z-pos float :offset 8) + (cos-angle float :offset 12) + (x-length float :offset 16) + (z-length float :offset 24) + (sin-angle float :offset 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for function point-in-air-box-area? +(defun point-in-air-box-area? ((arg0 float) (arg1 float) (arg2 air-box)) + (let ((v0-0 #f)) + (let ((f0-2 (+ (* arg0 (-> arg2 vecs 0 w)) (* arg1 (-> arg2 vecs 1 w)))) + (f1-5 (- (* arg1 (-> arg2 vecs 0 w)) (* arg0 (-> arg2 vecs 1 w)))) + ) + (if + (and + (>= f0-2 0.0) + (>= f1-5 0.0) + (< f0-2 (-> arg2 vecs 1 x)) + (< f1-5 (-> arg2 vecs 1 z)) + ) + (set! v0-0 #t) + ) + ) + v0-0 + ) + ) + +;; definition for function point-in-air-box? +(defun point-in-air-box? ((arg0 vector) (arg1 air-box)) + (when (< (-> arg1 vecs 0 y) (-> arg0 y)) + (let ((f1-2 (- (-> arg0 x) (the-as float (-> arg1 vecs 0 x)))) + (f2-1 (- (-> arg0 z) (-> arg1 vecs 0 z))) + (v1-0 arg1) + (v0-0 #f) + ) + (let ((f0-5 (+ (* f1-2 (-> v1-0 vecs 0 w)) (* f2-1 (-> v1-0 vecs 1 w)))) + (f1-4 (- (* f2-1 (-> v1-0 vecs 0 w)) (* f1-2 (-> v1-0 vecs 1 w)))) + ) + (if + (and + (>= f0-5 0.0) + (>= f1-4 0.0) + (< f0-5 (-> v1-0 vecs 1 x)) + (< f1-4 (-> v1-0 vecs 1 z)) + ) + (set! v0-0 #t) + ) + ) + v0-0 + ) + ) + ) diff --git a/goal_src/levels/common/nav-enemy-h.gc b/goal_src/levels/common/nav-enemy-h.gc index fba3c7d00c..acaaa6f39d 100644 --- a/goal_src/levels/common/nav-enemy-h.gc +++ b/goal_src/levels/common/nav-enemy-h.gc @@ -5,3 +5,152 @@ ;; name in dgo: nav-enemy-h ;; dgos: GAME, COMMON, L1 +;; definition of type nav-enemy-info +(deftype nav-enemy-info (basic) + ((idle-anim int32 :offset-assert 4) + (walk-anim int32 :offset-assert 8) + (turn-anim int32 :offset-assert 12) + (notice-anim int32 :offset-assert 16) + (run-anim int32 :offset-assert 20) + (jump-anim int32 :offset-assert 24) + (jump-land-anim int32 :offset-assert 28) + (victory-anim int32 :offset-assert 32) + (taunt-anim int32 :offset-assert 36) + (die-anim int32 :offset-assert 40) + (neck-joint int32 :offset-assert 44) + (player-look-at-joint int32 :offset-assert 48) + (run-travel-speed float :offset-assert 52) + (run-rotate-speed float :offset-assert 56) + (run-acceleration float :offset-assert 60) + (run-turn-time uint64 :offset-assert 64) + (walk-travel-speed float :offset-assert 72) + (walk-rotate-speed float :offset-assert 76) + (walk-acceleration float :offset-assert 80) + (walk-turn-time uint64 :offset-assert 88) + (attack-shove-back float :offset-assert 96) + (attack-shove-up float :offset-assert 100) + (shadow-size float :offset-assert 104) + (notice-nav-radius float :offset-assert 108) + (nav-nearest-y-threshold float :offset-assert 112) + (notice-distance float :offset-assert 116) + (proximity-notice-distance float :offset-assert 120) + (stop-chase-distance float :offset-assert 124) + (frustration-distance float :offset-assert 128) + (frustration-time uint64 :offset-assert 136) + (die-anim-hold-frame float :offset-assert 144) + (jump-anim-start-frame float :offset-assert 148) + (jump-land-anim-end-frame float :offset-assert 152) + (jump-height-min float :offset-assert 156) + (jump-height-factor float :offset-assert 160) + (jump-start-anim-speed float :offset-assert 164) + (shadow-max-y float :offset-assert 168) + (shadow-min-y float :offset-assert 172) + (shadow-locus-dist float :offset-assert 176) + (use-align basic :offset-assert 180) + (draw-shadow basic :offset-assert 184) + (move-to-ground basic :offset-assert 188) + (hover-if-no-ground basic :offset-assert 192) + (use-momentum basic :offset-assert 196) + (use-flee basic :offset-assert 200) + (use-proximity-notice basic :offset-assert 204) + (use-jump-blocked basic :offset-assert 208) + (use-jump-patrol basic :offset-assert 212) + (gnd-collide-with uint64 :offset-assert 216) + (debug-draw-neck basic :offset-assert 224) + (debug-draw-jump basic :offset-assert 228) + ) + :method-count-assert 9 + :size-assert #xe8 + :flag-assert #x9000000e8 + ) + +;; definition of type nav-enemy +(deftype nav-enemy (process-drawable) + ((hit-from-dir vector :inline :offset-assert 176) + (event-param-point vector :inline :offset-assert 192) + (frustration-point vector :inline :offset-assert 208) + (jump-dest vector :inline :offset-assert 224) + (jump-trajectory trajectory :inline :offset-assert 240) + (jump-time uint64 :offset-assert 280) + (nav-info basic :offset-assert 288) + (target-speed float :offset-assert 292) + (momentum-speed float :offset-assert 296) + (acceleration float :offset-assert 300) + (rotate-speed float :offset-assert 304) + (turn-time uint64 :offset-assert 312) + (frustration-time uint64 :offset-assert 320) + (speed-scale float :offset-assert 328) + (neck basic :offset-assert 332) + (reaction-time uint64 :offset-assert 336) + (notice-time uint64 :offset-assert 344) + (state-timeout uint64 :offset-assert 352) + (free-time uint64 :offset-assert 360) + (touch-time uint64 :offset-assert 368) + (nav-enemy-flags uint32 :offset-assert 376) + (incomming-attack-id uint64 :offset-assert 384) + (jump-return-state basic :offset-assert 392) + (rand-gen basic :offset-assert 396) + ) + :heap-base #x120 + :method-count-assert 76 + :size-assert #x190 + :flag-assert #x4c01200190 + (:methods + (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) + (dummy-53 () none 53) + (dummy-54 () none 54) + (dummy-55 () none 55) + (dummy-56 () none 56) + (dummy-57 () none 57) + (dummy-58 () none 58) + (dummy-59 () none 59) + (dummy-60 () none 60) + (dummy-61 () none 61) + (dummy-62 () none 62) + (dummy-63 () none 63) + (dummy-64 () none 64) + (dummy-65 () none 65) + (dummy-66 () none 66) + (dummy-67 () none 67) + (dummy-68 () none 68) + (dummy-69 () none 69) + (dummy-70 () none 70) + (dummy-71 () none 71) + (dummy-72 () none 72) + (dummy-73 () none 73) + (dummy-74 () none 74) + (dummy-75 () none 75) + ) + ) diff --git a/goal_src/levels/common/rigid-body-h.gc b/goal_src/levels/common/rigid-body-h.gc index a8fc4dffeb..de995e7800 100644 --- a/goal_src/levels/common/rigid-body-h.gc +++ b/goal_src/levels/common/rigid-body-h.gc @@ -5,3 +5,56 @@ ;; name in dgo: rigid-body-h ;; dgos: GAME, COMMON, L1 +;; definition of type rigid-body +(deftype rigid-body (structure) + ((mass float :offset-assert 0) + (inv-mass float :offset-assert 4) + (lin-momentum-damping-factor float :offset-assert 8) + (ang-momentum-damping-factor float :offset-assert 12) + (inertial-tensor matrix :inline :offset-assert 16) + (inv-inertial-tensor matrix :inline :offset-assert 80) + (cm-offset-joint vector :inline :offset-assert 144) + (position vector :inline :offset-assert 160) + (rotation quaternion :inline :offset-assert 176) + (lin-momentum vector :inline :offset-assert 192) + (ang-momentum vector :inline :offset-assert 208) + (lin-velocity vector :inline :offset-assert 224) + (ang-velocity vector :inline :offset-assert 240) + (inv-i-world matrix :inline :offset-assert 256) + (matrix matrix :inline :offset-assert 320) + (force vector :inline :offset-assert 384) + (torque vector :inline :offset-assert 400) + (max-ang-momentum float :offset-assert 416) + (max-ang-velocity float :offset-assert 420) + ) + :method-count-assert 23 + :size-assert #x1a8 + :flag-assert #x17000001a8 + (: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) + ) + ) + +;; definition of type rigid-body-control-point +(deftype rigid-body-control-point (structure) + ((local-pos vector :inline :offset-assert 0) + (world-pos vector :inline :offset-assert 16) + (velocity vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) diff --git a/test/decompiler/reference/all_forward_declarations.gc b/test/decompiler/reference/all_forward_declarations.gc index 316291a15c..9b1ed5e83a 100644 --- a/test/decompiler/reference/all_forward_declarations.gc +++ b/test/decompiler/reference/all_forward_declarations.gc @@ -20,7 +20,7 @@ (pid int32 :offset-assert #x28) (main-thread cpu-thread :offset-assert #x2c) (top-thread thread :offset-assert #x30) - (entity basic :offset-assert #x34) + (entity basic :offset-assert #x34) ;; Pretty sure this needs to be a res-lump, but get `not fully defined error`s (state state :offset-assert #x38) (trans-hook function :offset-assert #x3c) (post-hook function :offset-assert #x40) @@ -937,3 +937,126 @@ ) (declare-type entity basic) + +;; TODO - for prototype +(declare-type adgif-shader basic) +(define-extern adgif-shader-login-no-remap (function adgif-shader none)) + +;; TODO - for video +(declare-type setting-control basic) +(define-extern *setting-control* setting-control) +(declare-type shadow-control basic) +(define-extern *shadow-data* shadow-data) +(define-extern *pause-context* font-context) +(define-extern *profile-y* int) +(define-extern get-aspect-ratio (function symbol)) +(declare-type video-parms basic) +(define-extern set-hud-aspect-ratio (function symbol symbol none)) +(deftype progress (process) + ((current-debug-string int32 :offset-assert 112) + (current-debug-language int32 :offset-assert 116) + (current-debug-group int32 :offset-assert 120) + (in-out-position int32 :offset-assert 124) + (display-state uint64 :offset-assert 128) + (next-display-state uint64 :offset-assert 136) + (option-index int32 :offset-assert 144) + (selected-option basic :offset-assert 148) + (completion-percentage float :offset-assert 152) + (ready-to-run basic :offset-assert 156) + (display-level-index int32 :offset-assert 160) + (next-level-index int32 :offset-assert 164) + (task-index int32 :offset-assert 168) + (in-transition basic :offset-assert 172) + (last-in-transition basic :offset-assert 176) + (force-transition basic :offset-assert 180) + (stat-transition basic :offset-assert 184) + (level-transition int32 :offset-assert 188) + (language-selection uint64 :offset-assert 192) + (language-direction basic :offset-assert 200) + (language-transition basic :offset-assert 204) + (language-x-offset int32 :offset-assert 208) + (sides-x-scale float :offset-assert 212) + (sides-y-scale float :offset-assert 216) + (left-x-offset int32 :offset-assert 220) + (right-x-offset int32 :offset-assert 224) + (button-scale float :offset-assert 228) + (slot-scale float :offset-assert 232) + (left-side-x-scale float :offset-assert 236) + (left-side-y-scale float :offset-assert 240) + (right-side-x-scale float :offset-assert 244) + (right-side-y-scale float :offset-assert 248) + (small-orb-y-offset int32 :offset-assert 252) + (big-orb-y-offset int32 :offset-assert 256) + (transition-offset int32 :offset-assert 260) + (transition-offset-invert int32 :offset-assert 264) + (transition-percentage float :offset-assert 268) + (transition-percentage-invert float :offset-assert 272) + (transition-speed float :offset-assert 276) + (total-nb-of-power-cells int32 :offset-assert 280) + (total-nb-of-orbs int32 :offset-assert 284) + (total-nb-of-buzzers int32 :offset-assert 288) + (card-info mc-slot-info :offset-assert 292) + (last-option-index-change uint64 :offset-assert 296) + (video-mode-timeout uint64 :offset-assert 304) + (display-state-stack uint64 5 :offset-assert 312) + (option-index-stack uint32 5 :offset-assert 352) + (display-state-pos int32 :offset-assert 372) + (nb-of-icons int32 :offset-assert 376) + (icons uint32 6 :offset-assert 380) + (max-nb-of-particles int32 :offset-assert 404) + (nb-of-particles int32 :offset-assert 408) + (particles uint32 40 :offset-assert 412) + (particle-state uint32 40 :offset-assert 572) + ) + :method-count-assert 59 + :size-assert #x2dc + :flag-assert #x3b000002dc + (:methods + (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) + (TODO-RENAME-23 (_type_ symbol symbol) 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) + (dummy-53 () none 53) + (dummy-54 () none 54) + (dummy-55 () none 55) + (dummy-56 () none 56) + (dummy-57 () none 57) + (dummy-58 () none 58) + ) + ) +(define-extern *progress-process* (pointer progress)) diff --git a/test/decompiler/reference/engine/game/fact-h_REF.gc b/test/decompiler/reference/engine/game/fact-h_REF.gc index a60db1e340..111a9cb993 100644 --- a/test/decompiler/reference/engine/game/fact-h_REF.gc +++ b/test/decompiler/reference/engine/game/fact-h_REF.gc @@ -508,7 +508,3 @@ obj ) ) - - - - diff --git a/test/decompiler/reference/engine/game/settings-h_REF.gc b/test/decompiler/reference/engine/game/settings-h_REF.gc index 2ad93cf077..6d92edfe09 100644 --- a/test/decompiler/reference/engine/game/settings-h_REF.gc +++ b/test/decompiler/reference/engine/game/settings-h_REF.gc @@ -19,8 +19,8 @@ (spooling (pointer process) :offset-assert 56) (hint (pointer process) :offset-assert 60) (ambient (pointer process) :offset-assert 64) - (video-mode basic :offset-assert 68) - (aspect-ratio basic :offset-assert 72) + (video-mode symbol :offset-assert 68) + (aspect-ratio symbol :offset-assert 72) (sound-flava uint8 :offset-assert 76) (auto-save basic :offset-assert 80) (music-volume-movie float :offset-assert 84) diff --git a/test/decompiler/reference/engine/game/video_REF.gc b/test/decompiler/reference/engine/game/video_REF.gc new file mode 100644 index 0000000000..4fd9c78f0c --- /dev/null +++ b/test/decompiler/reference/engine/game/video_REF.gc @@ -0,0 +1,106 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function set-video-mode +;; INFO: Return type mismatch int vs none. +(defun set-video-mode ((arg0 symbol)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 'ntsc) + (set! (-> *video-parms* screen-sy) 224) + (set! (-> *setting-control* default screenx) 0) + (set! (-> *setting-control* default screeny) 8) + (set! (-> *video-parms* screen-pages-high) 7) + (set! (-> *video-parms* relative-y-scale) 1.0) + (set! *ticks-per-frame* 9765) + (set! (-> *math-camera* isometric vector 1 y) 0.5) + (set! (-> *math-camera* y-pix) 112.0) + (set! (-> *math-camera* y-clip) 448.0) + (set! (-> *shadow-data* texoffset y) 112.5) + ) + ((= v1-0 'pal) + (set! (-> *video-parms* screen-sy) 256) + (set! (-> *setting-control* default screenx) 0) + (set! (-> *setting-control* default screeny) 24) + (set! (-> *video-parms* screen-pages-high) 8) + (set! (-> *video-parms* relative-y-scale) 1.1428572) + (set! *ticks-per-frame* #x2dc6) + (set! (-> *math-camera* isometric vector 1 y) 0.4375) + (set! (-> *math-camera* y-pix) 128.0) + (set! (-> *math-camera* y-clip) 512.0) + (set! (-> *shadow-data* texoffset y) 128.5) + ) + ) + ) + (set-time-ratios *display* (-> *display* time-ratio)) + (set! (-> *video-parms* reset-video-mode) #t) + (set! (-> *video-parms* screen-hy) (/ (-> *video-parms* screen-sy) 2)) + (set! (-> *video-parms* screen-miny) (- 2048 (-> *video-parms* screen-hy))) + (set! (-> *video-parms* screen-maxy) (+ (-> *video-parms* screen-hy) 2048)) + (set! (-> *video-parms* screen-masky) (+ (-> *video-parms* screen-sy) -1)) + (set! + (-> *pause-context* origin y) + (the float (+ (-> *video-parms* screen-sy) -54)) + ) + (set! (-> *pause-context* height) (the float (-> *video-parms* screen-sy))) + (set! + (-> *font-default-matrix* vector 1 y) + (-> *video-parms* relative-y-scale) + ) + (set! + (-> *font-default-matrix* vector 3 y) + (- (the float (-> *video-parms* screen-hy))) + ) + (set! (-> *video-parms* relative-y-scale-reciprical) 1.0) + (set! *profile-y* (+ (-> *video-parms* screen-miny) 8)) + (set! (-> *video-parms* set-video-mode) #t) + (set-hud-aspect-ratio (get-aspect-ratio) arg0) + (if *progress-process* + (TODO-RENAME-23 (-> *progress-process* 0) (get-aspect-ratio) arg0) + ) + (let ((v0-5 0)) + ) + (none) + ) + +;; definition for function get-video-mode +(defun get-video-mode () + (-> *setting-control* current video-mode) + ) + +;; definition for function set-aspect-ratio +;; INFO: Return type mismatch int vs none. +(defun set-aspect-ratio ((arg0 symbol)) + (let ((v1-0 arg0)) + (cond + ((= v1-0 'aspect4x3) + (set! (-> *video-parms* relative-x-scale) 1.0) + (set! (-> *video-parms* relative-x-scale-reciprical) 1.0) + ) + ((= v1-0 'aspect16x9) + (set! (-> *video-parms* relative-x-scale) 0.75) + (set! (-> *video-parms* relative-x-scale-reciprical) 1.3333334) + ) + ) + ) + (set! + (-> *font-default-matrix* vector 0 x) + (-> *video-parms* relative-x-scale) + ) + (set-hud-aspect-ratio arg0 (get-video-mode)) + (if *progress-process* + (TODO-RENAME-23 (-> *progress-process* 0) arg0 (get-video-mode)) + ) + (let ((v0-4 0)) + ) + (none) + ) + +;; definition for function get-aspect-ratio +(defun get-aspect-ratio () + (-> *setting-control* current aspect-ratio) + ) + + + + diff --git a/test/decompiler/reference/engine/geometry/vol-h_REF.gc b/test/decompiler/reference/engine/geometry/vol-h_REF.gc new file mode 100644 index 0000000000..26dd6ac0b1 --- /dev/null +++ b/test/decompiler/reference/engine/geometry/vol-h_REF.gc @@ -0,0 +1,215 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type plane-volume +(deftype plane-volume (structure) + ((volume-type basic :offset-assert 0) + (point-count int16 :offset-assert 4) + (normal-count int16 :offset-assert 6) + (first-point vector :offset-assert 8) + (first-normal vector :offset-assert 12) + (num-planes int32 :offset-assert 16) + (plane uint32 :offset-assert 20) + ) + :pack-me + :method-count-assert 12 + :size-assert #x18 + :flag-assert #xc00000018 + (:methods + (dummy-9 () none 9) + (dummy-10 () none 10) + (dummy-11 () none 11) + ) + ) + +;; definition for method 3 of type plane-volume +(defmethod inspect plane-volume ((obj plane-volume)) + (format #t "[~8x] ~A~%" obj 'plane-volume) + (format #t "~Tvolume-type: ~A~%" (-> obj volume-type)) + (format #t "~Tpoint-count: ~D~%" (-> obj point-count)) + (format #t "~Tnormal-count: ~D~%" (-> obj normal-count)) + (format #t "~Tfirst-point: #~%" (-> obj first-point)) + (format #t "~Tfirst-normal: #~%" (-> obj first-normal)) + (format #t "~Tnum-planes: ~D~%" (-> obj num-planes)) + (format #t "~Tplane: #x~X~%" (-> obj plane)) + obj + ) + +;; definition of type vol-control +(deftype vol-control (basic) + ((flags uint32 :offset-assert 4) + (process process-drawable :offset-assert 8) + (pos-vol-count int32 :offset-assert 12) + (pos-vol plane-volume 32 :inline :offset-assert 16) + (neg-vol-count int32 :offset-assert 784) + (neg-vol plane-volume 32 :inline :offset-assert 788) + (debug-point basic :offset-assert 1556) + (debug-normal basic :offset-assert 1560) + ) + :method-count-assert 12 + :size-assert #x61c + :flag-assert #xc0000061c + (:methods + (new (symbol type process-drawable) _type_ 0) + (dummy-9 () none 9) + (dummy-10 () none 10) + (TODO-RENAME-11 (_type_) symbol 11) + ) + ) + +;; definition for method 3 of type vol-control +(defmethod inspect vol-control ((obj vol-control)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Tflags: #x~X~%" (-> obj flags)) + (format #t "~Tprocess: ~A~%" (-> obj process)) + (format #t "~Tpos-vol-count: ~D~%" (-> obj pos-vol-count)) + (format #t "~Tpos-vol[32] @ #x~X~%" (-> obj pos-vol)) + (format #t "~Tneg-vol-count: ~D~%" (-> obj neg-vol-count)) + (format #t "~Tneg-vol[32] @ #x~X~%" (-> obj neg-vol)) + (format #t "~Tdebug-point: ~A~%" (-> obj debug-point)) + (format #t "~Tdebug-normal: ~A~%" (-> obj debug-normal)) + obj + ) + +;; definition for method 0 of type vol-control +;; INFO: Return type mismatch object vs vol-control. +;; Used lq/sq +(defmethod + new + vol-control + ((allocation symbol) (type-to-make type) (arg0 process-drawable)) + (local-vars (pp process)) + (let + ((gp-0 + (the-as + object + (object-new allocation type-to-make (the-as int (-> type-to-make size))) + ) + ) + ) + (if (zero? (the-as vol-control gp-0)) + (begin + (let ((t9-1 (the-as (function object object) enter-state)) + (a0-1 "memory") + ) + (set! (-> pp next-state) process-drawable-art-error) + (t9-1 a0-1) + ) + (set! gp-0 0) + (goto cfg-13) + ) + ) + (set! (-> (the-as vol-control gp-0) process) arg0) + (let* ((s5-1 (-> (the-as vol-control gp-0) process entity)) + (s4-0 + (-> + ((method-of-type res-lump lookup-tag-idx) + (the-as res-lump s5-1) + 'vol + 'exact + 0.0 + ) + lo + ) + ) + ) + (when (>= s4-0 0) + (let ((s3-0 s4-0) + (s2-0 (-> (-> (the-as res-lump s5-1) tag) s4-0)) + ) + (let ((v1-10 0)) + ) + (while (= (-> s2-0 name) (-> (-> (the-as res-lump s5-1) tag) s4-0 name)) + (let + ((v1-12 + (make-property-data + (the-as res-lump s5-1) + 0.0 + (the-as res-tag-pair s3-0) + (the-as pointer #f) + ) + ) + (a0-8 + (-> + (the-as vol-control gp-0) + pos-vol + (-> (the-as vol-control gp-0) pos-vol-count) + ) + ) + ) + (set! (-> a0-8 num-planes) (the-as int (-> s2-0 elt-count))) + (set! (-> a0-8 plane) (the-as uint v1-12)) + ) + (set! + (-> (the-as vol-control gp-0) pos-vol-count) + (+ (-> (the-as vol-control gp-0) pos-vol-count) 1) + ) + (+! s3-0 1) + (set! s2-0 (-> (-> (the-as res-lump s5-1) tag) s3-0)) + ) + ) + ) + ) + (let* ((s5-2 (-> (the-as vol-control gp-0) process entity)) + (s4-1 + (-> + ((method-of-type res-lump lookup-tag-idx) + (the-as res-lump s5-2) + 'cutoutvol + 'exact + 0.0 + ) + lo + ) + ) + ) + (when (>= s4-1 0) + (let ((s3-1 s4-1) + (s2-1 (-> (-> (the-as res-lump s5-2) tag) s4-1)) + ) + (let ((v1-29 0)) + ) + (while (= (-> s2-1 name) (-> (-> (the-as res-lump s5-2) tag) s4-1 name)) + (let + ((v1-31 + (make-property-data + (the-as res-lump s5-2) + 0.0 + (the-as res-tag-pair s3-1) + (the-as pointer #f) + ) + ) + (a0-19 + (-> + (the-as vol-control gp-0) + neg-vol + (-> (the-as vol-control gp-0) neg-vol-count) + ) + ) + ) + (set! (-> a0-19 num-planes) (the-as int (-> s2-1 elt-count))) + (set! (-> a0-19 plane) (the-as uint v1-31)) + ) + (set! + (-> (the-as vol-control gp-0) neg-vol-count) + (+ (-> (the-as vol-control gp-0) neg-vol-count) 1) + ) + (+! s3-1 1) + (set! s2-1 (-> (-> (the-as res-lump s5-2) tag) s3-1)) + ) + ) + ) + ) + (label cfg-13) + (the-as vol-control gp-0) + ) + ) + +;; definition for method 11 of type vol-control +(defmethod TODO-RENAME-11 vol-control ((obj vol-control)) + (and *display-vol-marks* (nonzero? (logand (-> obj flags) 1))) + ) + + + + diff --git a/test/decompiler/reference/engine/gfx/tie/prototype-h_REF.gc b/test/decompiler/reference/engine/gfx/tie/prototype-h_REF.gc index 8bda5df92b..078d698f49 100644 --- a/test/decompiler/reference/engine/gfx/tie/prototype-h_REF.gc +++ b/test/decompiler/reference/engine/gfx/tie/prototype-h_REF.gc @@ -3,25 +3,25 @@ ;; definition of type prototype-bucket (deftype prototype-bucket (basic) - ((name basic :offset-assert 4) - (flags uint32 :offset-assert 8) - (in-level uint16 :offset-assert 12) - (utextures uint16 :offset-assert 14) - (geometry uint32 4 :offset-assert 16) - (dists vector :inline :offset-assert 32) - (rdists vector :inline :offset-assert 48) - (next uint32 4 :offset-assert 64) - (count uint16 4 :offset-assert 80) - (near-plane float :offset 32) - (near-stiff float :offset 36) - (mid-plane float :offset 40) - (far-plane float :offset 44) - (rlength-near float :offset 48) - (rlength-stiff float :offset 52) - (rlength-mid float :offset 56) - (stiffness float :offset 60) - (next-clear uint128 :offset 64) - (count-clear uint64 :offset 80) + ((name basic :offset-assert 4) + (flags uint32 :offset-assert 8) + (in-level uint16 :offset-assert 12) + (utextures uint16 :offset-assert 14) + (geometry drawable 4 :offset-assert 16) + (dists vector :inline :offset-assert 32) + (rdists vector :inline :offset-assert 48) + (next uint32 4 :offset-assert 64) + (count uint16 4 :offset-assert 80) + (near-plane float :offset 32) + (near-stiff float :offset 36) + (mid-plane float :offset 40) + (far-plane float :offset 44) + (rlength-near float :offset 48) + (rlength-stiff float :offset 52) + (rlength-mid float :offset 56) + (stiffness float :offset 60) + (next-clear uint128 :offset 64) + (count-clear uint64 :offset 80) ) :method-count-assert 9 :size-assert #x58 @@ -204,12 +204,13 @@ ;; definition of type prototype-array-tie (deftype prototype-array-tie (array) - () + ((array-data prototype-bucket-tie :dynamic :offset 16) + ) :method-count-assert 10 :size-assert #x10 :flag-assert #xa00000010 (:methods - (dummy-9 () none 9) + (TODO-RENAME-9 (_type_) none 9) ) ) diff --git a/test/decompiler/reference/engine/gfx/tie/prototype_REF.gc b/test/decompiler/reference/engine/gfx/tie/prototype_REF.gc new file mode 100644 index 0000000000..63ffba07ca --- /dev/null +++ b/test/decompiler/reference/engine/gfx/tie/prototype_REF.gc @@ -0,0 +1,174 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type prototype-array-tie +;; INFO: Return type mismatch prototype-array-tie vs none. +(defmethod TODO-RENAME-9 prototype-array-tie ((obj prototype-array-tie)) + (dotimes (s5-0 (-> obj length)) + (let ((s4-0 (-> obj array-data s5-0))) + (dotimes (s3-0 4) + (let ((a0-1 (-> s4-0 geometry s3-0))) + (if (nonzero? a0-1) + (dummy-9 a0-1) + ) + ) + ) + (let ((s4-1 (-> s4-0 envmap-shader))) + (when (nonzero? s4-1) + (adgif-shader-login-no-remap s4-1) + (set! (-> s4-1 quad 1 dword 0) (the-as uint 96)) + (set! (-> s4-1 quad 3 dword 0) (the-as uint 5)) + (set! (-> s4-1 quad 4 dword 0) (the-as uint 88)) + (set! (-> s4-1 quad 0 dword 1) (the-as uint 6)) + (set! (-> s4-1 quad 1 dword 1) (the-as uint 20)) + (set! (-> s4-1 quad 2 dword 1) (the-as uint 52)) + (set! (-> s4-1 quad 3 dword 1) (the-as uint 8)) + (set! (-> s4-1 quad 4 dword 1) (the-as uint 66)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 9 of type prototype-inline-array-shrub +(defmethod + dummy-9 + prototype-inline-array-shrub + ((obj prototype-inline-array-shrub)) + (dotimes (s5-0 (-> obj length)) + (let ((s4-0 (-> obj data s5-0))) + (dotimes (s3-0 4) + (let ((a0-1 (-> s4-0 geometry s3-0))) + (if (nonzero? a0-1) + (dummy-9 a0-1) + ) + ) + ) + ) + ) + obj + ) + +;; definition for method 8 of type prototype-array-tie +(defmethod + mem-usage + prototype-array-tie + ((obj prototype-array-tie) (arg0 memory-usage-block) (arg1 int)) + (set! (-> arg0 length) (max 1 (-> arg0 length))) + (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) + (set! (-> arg0 data 0 count) (+ (-> arg0 data 0 count) 1)) + (let ((v1-8 (asize-of obj))) + (set! (-> arg0 data 0 used) (+ (-> arg0 data 0 used) v1-8)) + (set! + (-> arg0 data 0 total) + (+ (-> arg0 data 0 total) (logand -16 (+ v1-8 15))) + ) + ) + (dotimes (s3-0 (-> obj length)) + (mem-usage (-> obj array-data s3-0) arg0 arg1) + ) + obj + ) + +;; definition for method 8 of type prototype-bucket-tie +(defmethod + mem-usage + prototype-bucket-tie + ((obj prototype-bucket-tie) (arg0 memory-usage-block) (arg1 int)) + (dotimes (s3-0 4) + (let ((a0-1 (-> obj geometry s3-0))) + (if (nonzero? a0-1) + (mem-usage a0-1 arg0 (logior arg1 1)) + ) + ) + ) + (set! (-> arg0 length) (max 81 (-> arg0 length))) + (set! (-> arg0 data 80 name) "string") + (set! (-> arg0 data 80 count) (+ (-> arg0 data 80 count) 1)) + (let + ((v1-13 ((method-of-type string asize-of) (the-as string (-> obj name))))) + (set! (-> arg0 data 80 used) (+ (-> arg0 data 80 used) v1-13)) + (set! + (-> arg0 data 80 total) + (+ (-> arg0 data 80 total) (logand -16 (+ v1-13 15))) + ) + ) + (when (nonzero? (-> obj tie-colors)) + (set! (-> arg0 length) (max 17 (-> arg0 length))) + (set! (-> arg0 data 16 name) "tie-pal") + (set! (-> arg0 data 16 count) (+ (-> arg0 data 16 count) 1)) + (let ((v1-25 (asize-of (-> obj tie-colors)))) + (set! (-> arg0 data 16 used) (+ (-> arg0 data 16 used) v1-25)) + (set! + (-> arg0 data 16 total) + (+ (-> arg0 data 16 total) (logand -16 (+ v1-25 15))) + ) + ) + ) + (if (nonzero? (-> obj collide-frag)) + (mem-usage (-> obj collide-frag) arg0 (logior arg1 1)) + ) + obj + ) + +;; definition for method 8 of type prototype-inline-array-shrub +(defmethod + mem-usage + prototype-inline-array-shrub + ((obj prototype-inline-array-shrub) (arg0 memory-usage-block) (arg1 int)) + (set! (-> arg0 length) (max 1 (-> arg0 length))) + (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) + (set! (-> arg0 data 0 count) (+ (-> arg0 data 0 count) 1)) + (let ((v1-8 (asize-of obj))) + (set! (-> arg0 data 0 used) (+ (-> arg0 data 0 used) v1-8)) + (set! + (-> arg0 data 0 total) + (+ (-> arg0 data 0 total) (logand -16 (+ v1-8 15))) + ) + ) + (dotimes (s3-0 (-> obj length)) + (mem-usage (-> obj data s3-0) arg0 arg1) + ) + obj + ) + +;; definition for method 8 of type prototype-bucket-shrub +(defmethod + mem-usage + prototype-bucket-shrub + ((obj prototype-bucket-shrub) (arg0 memory-usage-block) (arg1 int)) + (set! (-> arg0 length) (max 25 (-> arg0 length))) + (set! (-> arg0 data 24 name) "prototype-bucket-shrub") + (set! (-> arg0 data 24 count) (+ (-> arg0 data 24 count) 1)) + (let ((v1-5 112)) + (set! (-> arg0 data 24 used) (+ (-> arg0 data 24 used) v1-5)) + (set! + (-> arg0 data 24 total) + (+ (-> arg0 data 24 total) (logand -16 (+ v1-5 15))) + ) + ) + (dotimes (s3-0 4) + (let ((a0-5 (-> obj geometry s3-0))) + (if (nonzero? a0-5) + (mem-usage a0-5 arg0 (logior arg1 1)) + ) + ) + ) + (set! (-> arg0 length) (max 81 (-> arg0 length))) + (set! (-> arg0 data 80 name) "string") + (set! (-> arg0 data 80 count) (+ (-> arg0 data 80 count) 1)) + (let + ((v1-22 ((method-of-type string asize-of) (the-as string (-> obj name))))) + (set! (-> arg0 data 80 used) (+ (-> arg0 data 80 used) v1-22)) + (set! + (-> arg0 data 80 total) + (+ (-> arg0 data 80 total) (logand -16 (+ v1-22 15))) + ) + ) + obj + ) + + + + diff --git a/test/decompiler/reference/levels/beach/air-h_REF.gc b/test/decompiler/reference/levels/beach/air-h_REF.gc new file mode 100644 index 0000000000..63f2302622 --- /dev/null +++ b/test/decompiler/reference/levels/beach/air-h_REF.gc @@ -0,0 +1,86 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type air-box +(deftype air-box (structure) + ((vecs vector 2 :inline :offset-assert 0) + (x-pos float :offset 0) + (height-level float :offset 4) + (z-pos float :offset 8) + (cos-angle float :offset 12) + (x-length float :offset 16) + (z-length float :offset 24) + (sin-angle float :offset 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type air-box +(defmethod inspect air-box ((obj air-box)) + (format #t "[~8x] ~A~%" obj 'air-box) + (format #t "~Tvecs[2] @ #x~X~%" (-> obj vecs)) + (format #t "~Tx-pos: ~f~%" (the-as float (-> obj vecs 0 x))) + (format #t "~Theight-level: ~f~%" (the-as float (-> obj vecs 0 y))) + (format #t "~Tz-pos: ~f~%" (the-as float (-> obj vecs 0 z))) + (format #t "~Tcos-angle: ~f~%" (-> obj vecs 0 w)) + (format #t "~Tx-length: ~f~%" (-> obj vecs 1 x)) + (format #t "~Tz-length: ~f~%" (-> obj vecs 1 z)) + (format #t "~Tsin-angle: ~f~%" (-> obj vecs 1 w)) + obj + ) + +;; definition for function point-in-air-box-area? +(defun point-in-air-box-area? ((arg0 float) (arg1 float) (arg2 air-box)) + (let ((v0-0 #f)) + (let ((f0-2 (+ (* arg0 (-> arg2 vecs 0 w)) (* arg1 (-> arg2 vecs 1 w)))) + (f1-5 (- (* arg1 (-> arg2 vecs 0 w)) (* arg0 (-> arg2 vecs 1 w)))) + ) + (if + (and + (>= f0-2 0.0) + (>= f1-5 0.0) + (< f0-2 (-> arg2 vecs 1 x)) + (< f1-5 (-> arg2 vecs 1 z)) + ) + (set! v0-0 #t) + ) + ) + v0-0 + ) + ) + +;; definition for function point-in-air-box? +(defun point-in-air-box? ((arg0 vector) (arg1 air-box)) + (when (< (-> arg1 vecs 0 y) (-> arg0 y)) + (let ((f1-2 (- (-> arg0 x) (the-as float (-> arg1 vecs 0 x)))) + (f2-1 (- (-> arg0 z) (-> arg1 vecs 0 z))) + (v1-0 arg1) + (v0-0 #f) + ) + (let ((f0-5 (+ (* f1-2 (-> v1-0 vecs 0 w)) (* f2-1 (-> v1-0 vecs 1 w)))) + (f1-4 (- (* f2-1 (-> v1-0 vecs 0 w)) (* f1-2 (-> v1-0 vecs 1 w)))) + ) + (if + (and + (>= f0-5 0.0) + (>= f1-4 0.0) + (< f0-5 (-> v1-0 vecs 1 x)) + (< f1-4 (-> v1-0 vecs 1 z)) + ) + (set! v0-0 #t) + ) + ) + v0-0 + ) + ) + ) + +;; failed to figure out what this is: +(let ((v0-2 0)) + ) + + + + diff --git a/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc b/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc new file mode 100644 index 0000000000..59c67dd10b --- /dev/null +++ b/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc @@ -0,0 +1,269 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type nav-enemy-info +(deftype nav-enemy-info (basic) + ((idle-anim int32 :offset-assert 4) + (walk-anim int32 :offset-assert 8) + (turn-anim int32 :offset-assert 12) + (notice-anim int32 :offset-assert 16) + (run-anim int32 :offset-assert 20) + (jump-anim int32 :offset-assert 24) + (jump-land-anim int32 :offset-assert 28) + (victory-anim int32 :offset-assert 32) + (taunt-anim int32 :offset-assert 36) + (die-anim int32 :offset-assert 40) + (neck-joint int32 :offset-assert 44) + (player-look-at-joint int32 :offset-assert 48) + (run-travel-speed float :offset-assert 52) + (run-rotate-speed float :offset-assert 56) + (run-acceleration float :offset-assert 60) + (run-turn-time uint64 :offset-assert 64) + (walk-travel-speed float :offset-assert 72) + (walk-rotate-speed float :offset-assert 76) + (walk-acceleration float :offset-assert 80) + (walk-turn-time uint64 :offset-assert 88) + (attack-shove-back float :offset-assert 96) + (attack-shove-up float :offset-assert 100) + (shadow-size float :offset-assert 104) + (notice-nav-radius float :offset-assert 108) + (nav-nearest-y-threshold float :offset-assert 112) + (notice-distance float :offset-assert 116) + (proximity-notice-distance float :offset-assert 120) + (stop-chase-distance float :offset-assert 124) + (frustration-distance float :offset-assert 128) + (frustration-time uint64 :offset-assert 136) + (die-anim-hold-frame float :offset-assert 144) + (jump-anim-start-frame float :offset-assert 148) + (jump-land-anim-end-frame float :offset-assert 152) + (jump-height-min float :offset-assert 156) + (jump-height-factor float :offset-assert 160) + (jump-start-anim-speed float :offset-assert 164) + (shadow-max-y float :offset-assert 168) + (shadow-min-y float :offset-assert 172) + (shadow-locus-dist float :offset-assert 176) + (use-align basic :offset-assert 180) + (draw-shadow basic :offset-assert 184) + (move-to-ground basic :offset-assert 188) + (hover-if-no-ground basic :offset-assert 192) + (use-momentum basic :offset-assert 196) + (use-flee basic :offset-assert 200) + (use-proximity-notice basic :offset-assert 204) + (use-jump-blocked basic :offset-assert 208) + (use-jump-patrol basic :offset-assert 212) + (gnd-collide-with uint64 :offset-assert 216) + (debug-draw-neck basic :offset-assert 224) + (debug-draw-jump basic :offset-assert 228) + ) + :method-count-assert 9 + :size-assert #xe8 + :flag-assert #x9000000e8 + ) + +;; definition for method 3 of type nav-enemy-info +(defmethod inspect nav-enemy-info ((obj nav-enemy-info)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Tidle-anim: ~D~%" (-> obj idle-anim)) + (format #t "~Twalk-anim: ~D~%" (-> obj walk-anim)) + (format #t "~Tturn-anim: ~D~%" (-> obj turn-anim)) + (format #t "~Tnotice-anim: ~D~%" (-> obj notice-anim)) + (format #t "~Trun-anim: ~D~%" (-> obj run-anim)) + (format #t "~Tjump-anim: ~D~%" (-> obj jump-anim)) + (format #t "~Tjump-land-anim: ~D~%" (-> obj jump-land-anim)) + (format #t "~Tvictory-anim: ~D~%" (-> obj victory-anim)) + (format #t "~Ttaunt-anim: ~D~%" (-> obj taunt-anim)) + (format #t "~Tdie-anim: ~D~%" (-> obj die-anim)) + (format #t "~Tneck-joint: ~D~%" (-> obj neck-joint)) + (format #t "~Tplayer-look-at-joint: ~D~%" (-> obj player-look-at-joint)) + (format #t "~Trun-travel-speed: (meters ~m)~%" (-> obj run-travel-speed)) + (format #t "~Trun-rotate-speed: (deg ~r)~%" (-> obj run-rotate-speed)) + (format #t "~Trun-acceleration: (meters ~m)~%" (-> obj run-acceleration)) + (format #t "~Trun-turn-time: (seconds ~e)~%" (-> obj run-turn-time)) + (format #t "~Twalk-travel-speed: (meters ~m)~%" (-> obj walk-travel-speed)) + (format #t "~Twalk-rotate-speed: (deg ~r)~%" (-> obj walk-rotate-speed)) + (format #t "~Twalk-acceleration: (meters ~m)~%" (-> obj walk-acceleration)) + (format #t "~Twalk-turn-time: (seconds ~e)~%" (-> obj walk-turn-time)) + (format #t "~Tattack-shove-back: (meters ~m)~%" (-> obj attack-shove-back)) + (format #t "~Tattack-shove-up: (meters ~m)~%" (-> obj attack-shove-up)) + (format #t "~Tshadow-size: (meters ~m)~%" (-> obj shadow-size)) + (format #t "~Tnotice-nav-radius: (meters ~m)~%" (-> obj notice-nav-radius)) + (format + #t + "~Tnav-nearest-y-threshold: (meters ~m)~%" + (-> obj nav-nearest-y-threshold) + ) + (format #t "~Tnotice-distance: (meters ~m)~%" (-> obj notice-distance)) + (format + #t + "~Tproximity-notice-distance: (meters ~m)~%" + (-> obj proximity-notice-distance) + ) + (format + #t + "~Tstop-chase-distance: (meters ~m)~%" + (-> obj stop-chase-distance) + ) + (format + #t + "~Tfrustration-distance: (meters ~m)~%" + (-> obj frustration-distance) + ) + (format #t "~Tfrustration-time: ~D~%" (-> obj frustration-time)) + (format #t "~Tdie-anim-hold-frame: ~f~%" (-> obj die-anim-hold-frame)) + (format #t "~Tjump-anim-start-frame: ~f~%" (-> obj jump-anim-start-frame)) + (format + #t + "~Tjump-land-anim-end-frame: ~f~%" + (-> obj jump-land-anim-end-frame) + ) + (format #t "~Tjump-height-min: (meters ~m)~%" (-> obj jump-height-min)) + (format #t "~Tjump-height-factor: ~f~%" (-> obj jump-height-factor)) + (format #t "~Tjump-start-anim-speed: ~f~%" (-> obj jump-start-anim-speed)) + (format #t "~Tshadow-max-y: (meters ~m)~%" (-> obj shadow-max-y)) + (format #t "~Tshadow-min-y: (meters ~m)~%" (-> obj shadow-min-y)) + (format #t "~Tshadow-locus-dist: (meters ~m)~%" (-> obj shadow-locus-dist)) + (format #t "~Tuse-align: ~A~%" (-> obj use-align)) + (format #t "~Tdraw-shadow: ~A~%" (-> obj draw-shadow)) + (format #t "~Tmove-to-ground: ~A~%" (-> obj move-to-ground)) + (format #t "~Thover-if-no-ground: ~A~%" (-> obj hover-if-no-ground)) + (format #t "~Tuse-momentum: ~A~%" (-> obj use-momentum)) + (format #t "~Tuse-flee: ~A~%" (-> obj use-flee)) + (format #t "~Tuse-proximity-notice: ~A~%" (-> obj use-proximity-notice)) + (format #t "~Tuse-jump-blocked: ~A~%" (-> obj use-jump-blocked)) + (format #t "~Tuse-jump-patrol: ~A~%" (-> obj use-jump-patrol)) + (format #t "~Tgnd-collide-with: ~D~%" (-> obj gnd-collide-with)) + (format #t "~Tdebug-draw-neck: ~A~%" (-> obj debug-draw-neck)) + (format #t "~Tdebug-draw-jump: ~A~%" (-> obj debug-draw-jump)) + obj + ) + +;; definition of type nav-enemy +(deftype nav-enemy (process-drawable) + ((hit-from-dir vector :inline :offset-assert 176) + (event-param-point vector :inline :offset-assert 192) + (frustration-point vector :inline :offset-assert 208) + (jump-dest vector :inline :offset-assert 224) + (jump-trajectory trajectory :inline :offset-assert 240) + (jump-time uint64 :offset-assert 280) + (nav-info basic :offset-assert 288) + (target-speed float :offset-assert 292) + (momentum-speed float :offset-assert 296) + (acceleration float :offset-assert 300) + (rotate-speed float :offset-assert 304) + (turn-time uint64 :offset-assert 312) + (frustration-time uint64 :offset-assert 320) + (speed-scale float :offset-assert 328) + (neck basic :offset-assert 332) + (reaction-time uint64 :offset-assert 336) + (notice-time uint64 :offset-assert 344) + (state-timeout uint64 :offset-assert 352) + (free-time uint64 :offset-assert 360) + (touch-time uint64 :offset-assert 368) + (nav-enemy-flags uint32 :offset-assert 376) + (incomming-attack-id uint64 :offset-assert 384) + (jump-return-state basic :offset-assert 392) + (rand-gen basic :offset-assert 396) + ) + :heap-base #x120 + :method-count-assert 76 + :size-assert #x190 + :flag-assert #x4c01200190 + (:methods + (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) + (dummy-53 () none 53) + (dummy-54 () none 54) + (dummy-55 () none 55) + (dummy-56 () none 56) + (dummy-57 () none 57) + (dummy-58 () none 58) + (dummy-59 () none 59) + (dummy-60 () none 60) + (dummy-61 () none 61) + (dummy-62 () none 62) + (dummy-63 () none 63) + (dummy-64 () none 64) + (dummy-65 () none 65) + (dummy-66 () none 66) + (dummy-67 () none 67) + (dummy-68 () none 68) + (dummy-69 () none 69) + (dummy-70 () none 70) + (dummy-71 () none 71) + (dummy-72 () none 72) + (dummy-73 () none 73) + (dummy-74 () none 74) + (dummy-75 () none 75) + ) + ) + +;; definition for method 3 of type nav-enemy +(defmethod inspect nav-enemy ((obj nav-enemy)) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~T~Thit-from-dir: ~`vector`P~%" (&-> obj stack 64)) + (format #t "~T~Tevent-param-point: ~`vector`P~%" (&-> obj stack 80)) + (format #t "~T~Tfrustration-point: ~`vector`P~%" (&-> obj stack 96)) + (format #t "~T~Tjump-dest: ~`vector`P~%" (&-> obj stack 112)) + (format #t "~T~Tjump-trajectory: #~%" (&-> obj stack 128)) + (format #t "~T~Tjump-time: ~D~%" (-> obj jump-time)) + (format #t "~T~Tnav-info: ~A~%" (-> obj nav-info)) + (format #t "~T~Ttarget-speed: ~f~%" (-> obj target-speed)) + (format #t "~T~Tmomentum-speed: ~f~%" (-> obj momentum-speed)) + (format #t "~T~Tacceleration: ~f~%" (-> obj acceleration)) + (format #t "~T~Trotate-speed: ~f~%" (-> obj rotate-speed)) + (format #t "~T~Tturn-time: ~D~%" (-> obj turn-time)) + (format #t "~T~Tfrustration-time: ~D~%" (-> obj frustration-time)) + (format #t "~T~Tspeed-scale: ~f~%" (-> obj speed-scale)) + (format #t "~T~Tneck: ~A~%" (-> obj neck)) + (format #t "~T~Treaction-time: ~D~%" (-> obj reaction-time)) + (format #t "~T~Tnotice-time: ~D~%" (-> obj notice-time)) + (format #t "~T~Tstate-timeout: ~D~%" (-> obj state-timeout)) + (format #t "~T~Tfree-time: ~D~%" (-> obj free-time)) + (format #t "~T~Ttouch-time: ~D~%" (-> obj touch-time)) + (format #t "~T~Tnav-enemy-flags: ~D~%" (-> obj nav-enemy-flags)) + (format #t "~T~Tincomming-attack-id: ~D~%" (-> obj incomming-attack-id)) + (format #t "~T~Tjump-return-state: ~A~%" (-> obj jump-return-state)) + (format #t "~T~Trand-gen: ~A~%" (-> obj rand-gen)) + obj + ) + +;; failed to figure out what this is: +(let ((v0-4 0)) + ) + + + + diff --git a/test/decompiler/reference/levels/common/rigid-body-h_REF.gc b/test/decompiler/reference/levels/common/rigid-body-h_REF.gc new file mode 100644 index 0000000000..853b45b4fd --- /dev/null +++ b/test/decompiler/reference/levels/common/rigid-body-h_REF.gc @@ -0,0 +1,110 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type rigid-body +(deftype rigid-body (structure) + ((mass float :offset-assert 0) + (inv-mass float :offset-assert 4) + (lin-momentum-damping-factor float :offset-assert 8) + (ang-momentum-damping-factor float :offset-assert 12) + (inertial-tensor matrix :inline :offset-assert 16) + (inv-inertial-tensor matrix :inline :offset-assert 80) + (cm-offset-joint vector :inline :offset-assert 144) + (position vector :inline :offset-assert 160) + (rotation quaternion :inline :offset-assert 176) + (lin-momentum vector :inline :offset-assert 192) + (ang-momentum vector :inline :offset-assert 208) + (lin-velocity vector :inline :offset-assert 224) + (ang-velocity vector :inline :offset-assert 240) + (inv-i-world matrix :inline :offset-assert 256) + (matrix matrix :inline :offset-assert 320) + (force vector :inline :offset-assert 384) + (torque vector :inline :offset-assert 400) + (max-ang-momentum float :offset-assert 416) + (max-ang-velocity float :offset-assert 420) + ) + :method-count-assert 23 + :size-assert #x1a8 + :flag-assert #x17000001a8 + (: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) + ) + ) + +;; definition for method 3 of type rigid-body +(defmethod inspect rigid-body ((obj rigid-body)) + (format #t "[~8x] ~A~%" obj 'rigid-body) + (format #t "~Tmass: ~f~%" (-> obj mass)) + (format #t "~Tinv-mass: ~f~%" (-> obj inv-mass)) + (format + #t + "~Tlin-momentum-damping-factor: ~f~%" + (-> obj lin-momentum-damping-factor) + ) + (format + #t + "~Tang-momentum-damping-factor: ~f~%" + (-> obj ang-momentum-damping-factor) + ) + (format #t "~Tinertial-tensor: #~%" (-> obj inertial-tensor)) + (format + #t + "~Tinv-inertial-tensor: #~%" + (-> obj inv-inertial-tensor) + ) + (format #t "~Tcm-offset-joint: #~%" (-> obj cm-offset-joint)) + (format #t "~Tposition: #~%" (-> obj position)) + (format #t "~Trotation: #~%" (-> obj rotation)) + (format #t "~Tlin-momentum: #~%" (-> obj lin-momentum)) + (format #t "~Tang-momentum: #~%" (-> obj ang-momentum)) + (format #t "~Tlin-velocity: #~%" (-> obj lin-velocity)) + (format #t "~Tang-velocity: #~%" (-> obj ang-velocity)) + (format #t "~Tinv-i-world: #~%" (-> obj inv-i-world)) + (format #t "~Tmatrix: #~%" (-> obj matrix)) + (format #t "~Tforce: #~%" (-> obj force)) + (format #t "~Ttorque: #~%" (-> obj torque)) + (format #t "~Tmax-ang-momentum: ~f~%" (-> obj max-ang-momentum)) + (format #t "~Tmax-ang-velocity: ~f~%" (-> obj max-ang-velocity)) + obj + ) + +;; definition of type rigid-body-control-point +(deftype rigid-body-control-point (structure) + ((local-pos vector :inline :offset-assert 0) + (world-pos vector :inline :offset-assert 16) + (velocity vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type rigid-body-control-point +(defmethod inspect rigid-body-control-point ((obj rigid-body-control-point)) + (format #t "[~8x] ~A~%" obj 'rigid-body-control-point) + (format #t "~Tlocal-pos: #~%" (-> obj local-pos)) + (format #t "~Tworld-pos: #~%" (-> obj world-pos)) + (format #t "~Tvelocity: #~%" (-> obj velocity)) + obj + ) + +;; failed to figure out what this is: +(let ((v0-4 0)) + ) + + + + diff --git a/test/offline/offline_test_main.cpp b/test/offline/offline_test_main.cpp index 8d56fa4551..dfc1f37cf4 100644 --- a/test/offline/offline_test_main.cpp +++ b/test/offline/offline_test_main.cpp @@ -249,7 +249,8 @@ class OfflineDecompilation : public ::testing::Test { // don't try to do this because we can't write the file config->generate_symbol_definition_map = false; - std::vector dgos = {"CGO/KERNEL.CGO", "CGO/ENGINE.CGO"}; + std::vector dgos = {"CGO/KERNEL.CGO", "CGO/ENGINE.CGO", "CGO/GAME.CGO", + "DGO/BEA.DGO"}; std::vector dgo_paths; if (g_iso_data_path.empty()) { for (auto& x : dgos) {