[decomp2] joint-mod, chain-physics, loader (#1816)

* prep

* Update repo-settings-mark.bat

* Update repo-settings-unmark.bat

* decomp `joint-mod`

* add `joint-mod-ik-callback` to ref exceptions

* `chain-physics`

* Update jak2_ntsc_v1.jsonc

* update bat scripts

* `loader`

* pretty

* refs

* support `process->handle` (and `ppointer->handle`?)

* refs

* source and fixes

* fix `ja` detect

* `ja` macro implement

* fix a method

* update source

* merge fixes

* annoying fixes

* format

* arg

* hack

* fix test
This commit is contained in:
ManDude
2022-09-02 23:13:38 +01:00
committed by GitHub
parent 909bde8b1e
commit f1f18e7e05
64 changed files with 10273 additions and 1004 deletions
+19 -6
View File
@@ -1860,20 +1860,33 @@ void SimpleExpressionElement::update_from_stack_logor_or_logand(const Env& env,
return;
}
// jak 1:
// (logior (shl (-> v1-61 0 pid) 32) (.asm.sllv.r0 v1-61))
// jak 2:
// (logior (if v1-61 (shl (-> v1-61 0 pid) 32) 0) (.asm.sllv.r0 v1-61))
auto pid_deref_matcher = Matcher::op_fixed(
FixedOperatorKind::SHL,
{Matcher::deref(Matcher::any_reg(0), false,
{DerefTokenMatcher::integer(0), DerefTokenMatcher::string("pid")}),
Matcher::integer(32)});
auto make_handle_matcher = Matcher::op_fixed(
FixedOperatorKind::LOGIOR,
{Matcher::op_fixed(
FixedOperatorKind::SHL,
{Matcher::deref(Matcher::any_reg(0), false,
{DerefTokenMatcher::integer(0), DerefTokenMatcher::string("pid")}),
Matcher::integer(32)}),
{env.version == GameVersion::Jak1
? pid_deref_matcher
: Matcher::if_with_else(
Matcher::op(GenericOpMatcher::condition(IR2_Condition::Kind::TRUTHY),
{Matcher::any_reg(2)}),
pid_deref_matcher, Matcher::integer(0)),
Matcher::op_fixed(FixedOperatorKind::ASM_SLLV_R0, {Matcher::any_reg(1)})});
auto handle_mr = match(make_handle_matcher, element);
if (handle_mr.matched) {
auto var_a = handle_mr.maps.regs.at(0).value();
auto var_b = handle_mr.maps.regs.at(1).value();
if (env.get_variable_name(var_a) == env.get_variable_name(var_b) &&
const auto& var_name = env.get_variable_name(var_a);
if (var_name == env.get_variable_name(var_b) &&
(env.version == GameVersion::Jak1 ||
var_name == env.get_variable_name(handle_mr.maps.regs.at(2).value())) &&
env.dts->ts.tc(TypeSpec("pointer", {TypeSpec("process")}),
env.get_variable_type(var_a, true))) {
auto* menv = const_cast<Env*>(&env);
+19 -12
View File
@@ -1130,19 +1130,26 @@ FormElement* rewrite_joint_macro(LetElement* in, const Env& env, FormPool& pool)
}
auto form_fg = set_fg ? set_fg : arg_group;
// jak 1: (the float (+ (-> a0-14 frame-group data 0 length) -1))
// jak 2: (the float (+ (-> a0-14 frame-group frames num-frames) -1))
auto matcher_cur_group_max_frames =
env.version == GameVersion::Jak1
? Matcher::deref(
Matcher::any_reg(0), false,
{DerefTokenMatcher::string("frame-group"), DerefTokenMatcher::string("data"),
DerefTokenMatcher::integer(0), DerefTokenMatcher::string("length")})
: Matcher::deref(
Matcher::any_reg(0), false,
{DerefTokenMatcher::string("frame-group"), DerefTokenMatcher::string("frames"),
DerefTokenMatcher::string("num-frames")});
auto matcher_max_num = Matcher::cast(
"float",
Matcher::op_fixed(
FixedOperatorKind::ADDITION,
{form_fg
? Matcher::deref(Matcher::any(1), false,
{DerefTokenMatcher::string("data"), DerefTokenMatcher::integer(0),
DerefTokenMatcher::string("length")})
: Matcher::deref(
Matcher::any_reg(0), false,
{DerefTokenMatcher::string("frame-group"), DerefTokenMatcher::string("data"),
DerefTokenMatcher::integer(0), DerefTokenMatcher::string("length")}),
Matcher::integer(-1)}));
"float", Matcher::op_fixed(FixedOperatorKind::ADDITION,
{form_fg ? Matcher::deref(Matcher::any(1), false,
{DerefTokenMatcher::string("data"),
DerefTokenMatcher::integer(0),
DerefTokenMatcher::string("length")})
: matcher_cur_group_max_frames,
Matcher::integer(-1)}));
// DONE CHECKING EVERYTHING!!! Now write the goddamn macro.
std::vector<Form*> args;
+184 -164
View File
@@ -1390,7 +1390,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(deftype matrix (structure)
((data float 16 :offset-assert 0 :score -1)
((data float 16 :offset-assert 0 :score -10)
(vector vector 4 :inline :offset 0)
(quad uint128 4 :offset 0)
(trans vector :inline :offset 48)
@@ -4356,7 +4356,7 @@
(define-extern quaternion-from-two-vectors-smooth! (function quaternion vector vector float int quaternion))
(define-extern matrix-from-two-vectors-max-angle-partial! (function matrix vector vector float float matrix))
(define-extern matrix-from-two-vectors-partial-linear! (function matrix vector vector float matrix))
(define-extern matrix-remove-z-rot (function matrix matrix matrix))
(define-extern matrix-remove-z-rot (function matrix vector matrix))
(define-extern matrix-rot-diff! (function vector matrix matrix float))
(define-extern quaternion-seek (function quaternion quaternion quaternion float float quaternion))
(define-extern vector-deg-seek (function vector vector vector float vector))
@@ -4562,7 +4562,7 @@
;; Failed to read fields.
(:methods
(new (symbol type int level) _type_ 0)
(load-dir-method-9 () none 9) ;; (load-to-heap-by-name (_type_ string symbol kheap int) art-group 9)
(load-to-heap-by-name (_type_ string symbol kheap int) art-group 9)
(set-loaded-art (_type_ art-group) art-group 10)
)
)
@@ -4583,7 +4583,7 @@
(locked? symbol :offset-assert 16) ;; guessed by decompiler
(login? symbol :offset-assert 20)
(frame-lock symbol :offset-assert 24) ;; guessed by decompiler
(init-heap function :offset-assert 28)
(init-heap (function external-art-buffer object) :offset-assert 28)
(heap kheap :inline :offset-assert 32)
(pending-load-file string :offset-assert 48) ;; guessed by decompiler
(pending-load-file-part int32 :offset-assert 52)
@@ -4603,23 +4603,24 @@
:flag-assert #x1000000068
(:methods
(new (symbol type int function symbol) _type_ 0)
(external-art-buffer-method-9 () none 9) ;; (set-pending-file (_type_ string int handle float) int 9)
(external-art-buffer-method-10 () none 10) ;; (update (_type_) int 10)
(external-art-buffer-method-11 () none 11) ;; (inactive? (_type_) symbol 11)
(external-art-buffer-method-12 () none 12) ;; (file-status (_type_ string int) symbol 12)
(external-art-buffer-method-13 () none 13) ;; (link-file (_type_ art-group) art-group 13)
(external-art-buffer-method-14 () none 14) ;; (unlink-file (_type_ art-group) int 14)
(external-art-buffer-method-15 () none 15) ;; (unlock! (_type_) symbol 15)
(set-pending-file (_type_ string int handle float) int 9)
(update (_type_) int 10)
(inactive? (_type_) symbol 11)
(file-status (_type_ string int) symbol 12)
(link-file (_type_ art-group) art-group 13)
(unlink-file (_type_ art-group) int 14)
(unlock! (_type_) int 15)
)
)
(deftype spool-anim (basic)
((name string :offset 16) ;; guessed by decompiler
(anim-name basic :offset-assert 20)
(buffer external-art-buffer :offset 20 :score 10) ;; added
(parts int32 :offset-assert 24)
(hint-id int32 :offset 24)
(priority float :offset-assert 28)
(owner uint64 :offset-assert 32) ;; handle
(owner handle :offset-assert 32)
(command-list pair :offset-assert 40) ;; guessed by decompiler
)
:method-count-assert 9
@@ -4627,6 +4628,7 @@
:flag-assert #x90000002c
)
(declare-type process-drawable process)
(deftype external-art-control (basic)
((buffer external-art-buffer 2 :offset-assert 4) ;; guessed by decompiler
(rec spool-anim 3 :inline :offset-assert 16) ;; guessed by decompiler
@@ -4646,11 +4648,11 @@
(new (symbol type) _type_ 0)
(update (_type_ symbol) int 9)
(clear-rec (_type_) int 10)
(external-art-control-method-11 () none 11) ;; (spool-push (_type_ string int process float) int 11)
(external-art-control-method-12 () none 12) ;; (file-status (_type_ string int) symbol 12)
(external-art-control-method-13 () none 13) ;; (reserve-alloc (_type_) kheap 13)
(external-art-control-method-14 () none 14) ;; (reserve-free (_type_ kheap) int 14)
(external-art-control-method-15 () none 15) ;; (none-reserved? (_type_) symbol 15)
(spool-push (_type_ string int process float) int 11)
(file-status (_type_ string int) symbol 12)
(reserve-alloc (_type_) kheap 13)
(reserve-free (_type_ kheap) int 14)
(none-reserved? (_type_) symbol 15)
)
)
@@ -7079,7 +7081,7 @@
(stereo-mode int32)
(music symbol)
(sound-stinger int32 :offset-assert 236)
(spool-anim symbol)
(spool-anim spool-anim)
(sound-mode uint32)
(task-manager (pointer process))
(task symbol)
@@ -9983,7 +9985,7 @@
(:methods
(relocate (_type_ kheap (pointer uint8)) none :replace 7)
(link-art! (_type_) art-group 13)
(art-group-method-14 () none 14) ;; (unlink-art! (_type_) int 14)
(unlink-art! (_type_) int 14)
)
)
@@ -11442,16 +11444,16 @@
(reset! (_type_) _type_ 9)
(update! (_type_) int 10)
(want-levels (_type_ (pointer symbol)) int 11)
(want-sound-banks (_type_ (pointer symbol)) none 12) ;; (want-display-level (_type_ symbol symbol) int 12)
(want-sound-banks (_type_ (pointer symbol)) none 12)
(want-display-level (_type_ symbol symbol) int 13)
(want-vis-level (_type_ symbol) none 14) ;; (want-force-vis (_type_ symbol symbol) int 14)
(load-state-method-15 () none 15) ;; (execute-command (_type_ pair) none 15)
(load-state-method-16 () none 16) ;; (execute-commands-up-to (_type_ float) int 16)
(load-state-method-17 () none 17) ;; (backup-load-state-and-set-cmds (_type_ pair) int 17)
(load-state-method-18 () none 18) ;; (restore-load-state-and-cleanup (_type_) int 18)
(load-state-method-19 () none 19) ;; (restore-load-state (_type_) int 19)
(load-state-method-20 () none 20) ;; (set-force-inside! (_type_ symbol symbol) none 20)
(load-state-method-21 () none 21)
(want-vis-level (_type_ symbol) none 14)
(want-force-vis (_type_ symbol symbol) int 15)
(execute-command (_type_ pair) none 16)
(execute-commands-up-to (_type_ float) none 17)
(backup-load-state-and-set-cmds (_type_ pair) int 18)
(restore-load-state-and-cleanup (_type_) int 19)
(restore-load-state (_type_) int 20)
(set-force-inside! (_type_ symbol symbol) none 21)
)
)
@@ -11801,8 +11803,8 @@
(channel gui-channel :offset 21)
(anim-part uint8 :offset 22)
(flags uint8 :offset 23)
(name object :offset 24)
(id uint32 :offset 28)
(name string :offset 24)
(id sound-id :offset 28)
(handle handle :offset 0)
(time-stamp time-frame :offset 8)
(hold-time time-frame :offset-assert 32)
@@ -11824,29 +11826,35 @@
(deftype gui-control (basic)
((engine engine)
(data uint8 3272)
(update-time time-frame :offset-assert 8)
(connections gui-connection 32 :inline :offset-assert 16)
(spool-connections gui-connection 4 :inline :offset-assert 1552)
(ids sound-id 96 :offset-assert 1744)
(times time-frame 96 :offset-assert 2128)
(cmd pair 96 :offset-assert 2896)
)
:method-count-assert 25
:size-assert #xcd0
:flag-assert #x1900000cd0
;; Failed to read fields.
(:methods
(gui-control-method-9 () none 9)
(gui-control-method-10 () none 10)
(gui-control-method-11 () none 11)
(gui-control-method-12 () none 12)
(update (_type_ symbol) none 13)
(gui-control-method-14 () none 14)
(gui-control-method-15 () none 15)
(gui-control-method-16 () none 16)
(gui-control-method-17 () none 17)
(gui-control-method-18 () none 18)
(gui-control-method-19 () none 19)
(gui-control-method-20 () none 20)
(gui-control-method-21 () none 21)
(gui-control-method-22 () none 22)
(gui-control-method-23 () none 23)
(gui-control-method-24 () none 24)
(new (symbol type int) _type_ 0)
(gui-control-method-9 (_type_ process gui-channel gui-action int float time-frame) sound-id 9)
(gui-control-method-10 (_type_ process gui-channel) none 10)
(gui-control-method-11 (_type_ gui-connection) int 11)
(gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id 12)
(update (_type_ symbol) int 13)
(gui-control-method-14 (_type_ string gui-channel gui-action) int 14)
(gui-control-method-15 (_type_ process gui-channel string sound-id) gui-connection 15)
(gui-control-method-16 (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int 16)
(gui-control-method-17 (_type_ sound-id) gui-action 17)
(gui-control-method-18 (_type_ gui-channel) symbol 18)
(gui-control-method-19 (_type_ gui-channel gui-connection) symbol 19)
(gui-control-method-20 (_type_ sound-id symbol int int int) gui-connection 20)
(gui-control-method-21 (_type_ gui-connection vector) int 21)
(gui-control-method-22 (_type_ gui-connection process symbol) none 22)
(gui-control-method-23 (_type_ gui-channel gui-channel symbol gui-connection) symbol 23)
(channel-id-set! (_type_ gui-connection sound-id) int 24)
)
)
@@ -13286,7 +13294,6 @@
)
(declare-type target process-focusable)
(declare-type process-drawable process)
(deftype fact-info-target (fact-info)
((eco-type int32)
@@ -14297,16 +14304,21 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defenum joint-mod-mode
:bitfield #t
:type uint32
(flex-blend 0) ;; 1
(look-at 1) ;; 2
(world-look-at 2) ;; 4
(rotate 3) ;; 8
(joint-set 4) ;; 16
(joint-set* 5) ;; 32
;; ?? ;; 64
(reset 7) ;; 128
:bitfield #t
:type uint32
(flex-blend)
(look-at)
(world-look-at)
(rotate)
(joint-set)
(joint-set*)
(rotate2) ;; ??
(reset)
(polar-look-at)
(joint-set*-world)
(gun-look-at)
(foot-rot)
(joint-set-world)
)
;; +++joint-mod-h:track-mode
@@ -14325,12 +14337,12 @@
(deftype joint-mod (basic)
((mode joint-mod-mode)
(process process)
(process process-drawable)
(joint cspace)
(target vector :inline :offset 16)
(twist vector :inline :offset 32)
;;(twist-max vector :inline)
(twist-max float 4)
(target vector :inline)
(twist vector :inline)
(twist-max vector :inline)
;; (twist-max float 4)
(extra-twist degrees :offset 40)
(track-mode track-mode :offset 44)
(loock-at-count uint16 :offset 46)
@@ -14369,18 +14381,18 @@
;; Failed to read fields.
(:methods
(new (symbol type joint-mod-mode process-drawable int) _type_ 0)
(joint-mod-method-9 () none 9) ;; (set-mode! (_type_ joint-mod-handler-mode) _type_ 9)
(joint-mod-method-10 () none 10) ;; (set-target! (_type_ vector) none 10)
(joint-mod-method-11 () none 11) ;; (look-at-enemy! (_type_ vector symbol process) none 11)
(mode-set! (_type_ joint-mod-mode) none 9)
(target-set! (_type_ vector) none 10)
(look-at! (_type_ vector symbol process) none :behavior process 11)
(reset-blend! (_type_) _type_ 12)
(joint-mod-method-13 () none 13) ;; (set-twist! (_type_ float float float) vector 13)
(joint-mod-method-14 () none 14) ;; (set-trs! (_type_ vector quaternion vector) none 14)
(joint-mod-method-15 () none 15) ;; (shut-down! (_type_) float 15)
(twist-set! (_type_ float float float) vector 13)
(trs-set! (_type_ vector quaternion vector) none 14)
(shut-down (_type_) none 15)
)
)
(deftype try-to-look-at-info (basic)
((who handle :offset-assert 8) ;; handle
((who handle :offset-assert 8)
(horz float :offset-assert 16)
(vert float :offset-assert 20)
)
@@ -14476,10 +14488,18 @@
:flag-assert #x90000002c
)
(defenum joint-mod-blend-flags
:bitfield #t
:type uint32
(trans)
(scale)
(rotation)
)
(deftype joint-mod-blend-world (basic)
((transform transformq :inline :offset-assert 16)
(blend-transform transformq :inline :offset-assert 64)
(blend-flags uint32 :offset-assert 112)
(blend-flags joint-mod-blend-flags :offset-assert 112)
(node-index int32 :offset-assert 116)
(blend float :offset-assert 120)
(enable symbol :offset-assert 124)
@@ -14504,9 +14524,17 @@
:flag-assert #x900000020
)
(defenum joint-mod-ik-flags
:bitfield #t
:type uint32
(enable)
(elbow-trans-neg)
(elbow-rot-neg)
)
(deftype joint-mod-ik (basic)
((flags uint32 :offset-assert 4)
(process basic :offset-assert 8)
((flags joint-mod-ik-flags :offset-assert 4)
(process process-drawable :offset-assert 8)
(hand-dist float :offset-assert 12)
(handle-pos vector :inline :offset-assert 16)
(elbow-pole-vector-axis uint32 :offset-assert 32)
@@ -14515,7 +14543,7 @@
(user-normal vector :inline :offset-assert 64)
(user-blend float :offset-assert 80)
(user-float float :offset-assert 84)
(callback basic :offset-assert 88)
(callback (function joint-mod-ik matrix matrix vector object) :offset-assert 88)
(shoulder-matrix-no-ik matrix :inline :offset-assert 96)
(elbow-matrix-no-ik matrix :inline :offset-assert 160)
(blend float :offset-assert 224)
@@ -14525,8 +14553,9 @@
:size-assert #xe8
:flag-assert #xb000000e8
(:methods
(joint-mod-ik-method-9 () none 9)
(joint-mod-ik-method-10 () none 10)
(new (symbol type process-drawable int float) _type_)
(handle-copy! (_type_ vector) none 9)
(enable-set! (_type_ symbol) none 10)
)
)
@@ -15684,18 +15713,18 @@
(define-extern cspace-by-name-no-fail (function process-drawable string cspace))
(define-extern cspace-index-by-name-no-fail (function process-drawable string int))
(define-extern num-func-none (function joint-control-channel float float float))
(define-extern num-func-+! (function joint-control-channel float float float))
(define-extern num-func--! (function joint-control-channel float float float))
(define-extern num-func-loop! (function joint-control-channel float float float))
(define-extern num-func-loop-speedless! (function joint-control-channel float float float))
(define-extern num-func-seek! (function joint-control-channel float float float))
(define-extern num-func-blend-in! (function joint-control-channel float float float))
(define-extern num-func-none (function joint-control-channel float float float float :behavior process))
(define-extern num-func-+! (function joint-control-channel float float float float :behavior process))
(define-extern num-func--! (function joint-control-channel float float float float :behavior process))
(define-extern num-func-loop! (function joint-control-channel float float float float :behavior process))
(define-extern num-func-loop-speedless! (function joint-control-channel float float float float :behavior process))
(define-extern num-func-seek! (function joint-control-channel float float float float :behavior process))
(define-extern num-func-blend-in! (function joint-control-channel float float float float :behavior process))
(define-extern joint-channel-float-delete! (function joint-control-channel none))
(define-extern num-func-interp-play! (function joint-control-channel float float float float))
(define-extern num-func-interp1-play! (function joint-control-channel float float float float))
(define-extern num-func-chan (function joint-control-channel float float float))
(define-extern num-func-identity (function joint-control-channel float float float))
(define-extern num-func-interp-play! (function joint-control-channel float float float float :behavior process))
(define-extern num-func-interp1-play! (function joint-control-channel float float float float :behavior process))
(define-extern num-func-chan (function joint-control-channel float float float float :behavior process))
(define-extern num-func-identity (function joint-control-channel float float float float :behavior process))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; process-focusable ;;
@@ -16041,7 +16070,7 @@
((position vector :inline :offset-assert 0)
(velocity vector :inline :offset-assert 16)
(old-x vector :inline :offset-assert 32)
(joint-mod basic :offset-assert 48)
(joint-mod joint-mod :offset-assert 48)
)
:method-count-assert 9
:size-assert #x34
@@ -16062,22 +16091,22 @@
(negate-y basic :offset-assert 1360)
(axial-slop float :offset-assert 1364)
(maximum-stretch float :offset-assert 1368)
(turn-off-start uint64 :offset-assert 1376)
(turn-off-duration uint64 :offset-assert 1384)
(turn-off-start time-frame :offset-assert 1376)
(turn-off-duration time-frame :offset-assert 1384)
)
:method-count-assert 18
:size-assert #x570
:flag-assert #x1200000570
(:methods
(chain-physics-method-9 () none 9)
(chain-physics-method-10 () none 10)
(chain-physics-method-11 () none 11)
(chain-physics-method-12 () none 12)
(chain-physics-method-13 () none 13)
(chain-physics-method-14 () none 14)
(chain-physics-method-15 () none 15)
(chain-physics-method-16 () none 16)
(chain-physics-method-17 () none 17)
(initialize-chain-joints (_type_) symbol 9)
(turn-off (_type_ time-frame) none :behavior process 10)
(update (_type_ process-drawable) none :behavior process 11)
(gravity-update (_type_) none 12)
(apply-gravity (_type_ vector int) none :behavior process 13)
(chain-physics-method-14 (_type_ vector int) none 14)
(clamp-length (_type_ vector vector) vector 15)
(chain-physics-method-16 (_type_ int) float 16)
(chain-physics-method-17 (_type_ vector) none 17)
)
)
@@ -20936,14 +20965,16 @@
(defenum stream-status
:type uint32
:bitfield #t
(zero 0)
(one 1) ;; another way to be playing
(two 2)
(three 3)
(four 4) ;; is playing?
(five 5)
(six 6) ;; another way to be playing.
(seven 7)
(ststatus-zero 0)
(ststatus-one 1) ;; another way to be playing
(ststatus-two 2)
(ststatus-three 3)
(ststatus-four 4) ;; is playing?
(ststatus-five 5)
(ststatus-six 6) ;; another way to be playing.
(ststatus-seven 7)
(ststatus-eight 8)
(ststatus-nine 9)
)
(defenum stereo-mode
@@ -20969,7 +21000,8 @@
(stream-position uint32 4 :offset 272)
(stream-status stream-status 4 :offset-assert 288)
(stream-name sound-stream-name 4 :inline :offset-assert 304)
(stream-id uint32 4 :offset-assert 496)
(stream-id sound-id 4 :offset-assert 496)
(stream-id-int32 int32 4 :offset 496) ;; ughhhh...
(music-register uint8 17 :offset-assert 512)
(music-excite int8 :offset 528)
(ramdisk-name uint8 48 :offset-assert 529)
@@ -21116,27 +21148,27 @@
;; joint-mod ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (define-extern joint-mod-ik-callback function)
;; (define-extern real-joint-mod-gun-look-at-handler function)
;; (define-extern joint-mod-gun-look-at-handler function)
;; (define-extern joint-mod-foot-rot-handler function)
(define-extern joint-mod-ik-callback (function cspace transformq none :behavior process))
(define-extern real-joint-mod-gun-look-at-handler (function cspace transformq none :behavior process))
(define-extern joint-mod-gun-look-at-handler (function cspace transformq none :behavior process))
(define-extern joint-mod-foot-rot-handler (function cspace transformq none :behavior process))
(define-extern last-try-to-look-at-data try-to-look-at-info)
;; (define-extern joint-mod-look-at-handler function) ;; (function cspace transformq none)
;; (define-extern joint-mod-polar-look-at-guts function)
;; (define-extern joint-mod-polar-look-at-handler function)
;; (define-extern joint-mod-world-look-at-handler function) ;; (function cspace transformq none)
;; (define-extern joint-mod-rotate-handler function) ;; (function cspace transformq none)
;; (define-extern joint-mod-scale-handler function)
;; (define-extern joint-mod-joint-set-handler function) ;; (function cspace transformq none)
;; (define-extern joint-mod-joint-set-world-handler function)
;; (define-extern joint-mod-joint-set*-handler function) ;; (function cspace transformq none)
;; (define-extern joint-mod-joint-set*-world-handler function)
(define-extern joint-mod-look-at-handler (function cspace transformq none :behavior process))
(define-extern joint-mod-polar-look-at-guts (function cspace transformq none :behavior process))
(define-extern joint-mod-polar-look-at-handler (function cspace transformq none :behavior process))
(define-extern joint-mod-world-look-at-handler (function cspace transformq none :behavior process))
(define-extern joint-mod-rotate-handler (function cspace transformq none :behavior process))
(define-extern joint-mod-scale-handler (function cspace transformq none :behavior process))
(define-extern joint-mod-joint-set-handler (function cspace transformq none :behavior process))
(define-extern joint-mod-joint-set-world-handler (function cspace transformq none :behavior process))
(define-extern joint-mod-joint-set*-handler (function cspace transformq none :behavior process))
(define-extern joint-mod-joint-set*-world-handler (function cspace transformq none :behavior process))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; chain-physics ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (define-extern chain-physics-initialize function)
(define-extern chain-physics-initialize (function process-drawable chain-physics int float (array chain-physics-setup) int))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; cylinder ;;
@@ -21575,7 +21607,7 @@
(define-extern add-debug-text-3d (function symbol bucket-id string vector font-color vector2h symbol))
;; (define-extern add-debug-sphere-with-transform function) ;; (function symbol bucket-id vector meters matrix rgba symbol)
(define-extern add-debug-sphere (function symbol bucket-id vector float rgba symbol))
;; (define-extern add-debug-text-sphere function) ;; (function symbol bucket-id vector float string rgba symbol)
(define-extern add-debug-text-sphere (function symbol bucket-id vector float string rgba symbol))
;; (define-extern add-debug-spheres function) ;; (function symbol bucket-id (inline-array vector) int rgba symbol)
;; (define-extern add-debug-line-sphere function)
;; (define-extern add-debug-circle function) ;; (function symbol bucket-id vector float rgba matrix symbol)
@@ -22959,27 +22991,11 @@
;; loader ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#|
(deftype load-dir (basic)
()
:method-count-assert 11
:size-assert #x10
:flag-assert #xb00000010
;; Failed to read fields.
(:methods
;; (new (symbol type int level) _type_ 0)
(load-dir-method-9 () none 9) ;; (load-to-heap-by-name (_type_ string symbol kheap int) art-group 9)
(load-dir-method-10 () none 10) ;; (set-loaded-art (_type_ art-group) art-group 10)
)
)
|#
#|
(deftype spooler-block (basic)
((anim basic :offset-assert 4)
(idle basic :offset-assert 8)
(exit basic :offset-assert 12)
(break-func basic :offset-assert 16)
((anim spool-anim :offset-assert 4)
(idle art-joint-anim :offset-assert 8)
(exit art-joint-anim :offset-assert 12)
(break-func (function process-drawable object) :offset-assert 16)
(part int32 :offset-assert 20)
(part-audio-start float :offset-assert 24)
(old-status uint16 :offset-assert 28)
@@ -22987,25 +23003,31 @@
(good-time time-frame :offset-assert 40)
(old-time time-frame :offset-assert 48)
(good-count int32 :offset-assert 56)
(sid uint32 :offset-assert 60)
(sid sound-id :offset-assert 60)
(real-start-time time-frame :offset-assert 64)
(paused? basic :offset-assert 72)
(paused? symbol :offset-assert 72)
)
:method-count-assert 9
:size-assert #x4c
:flag-assert #x90000004c
(:methods
(new (symbol type art-joint-anim (function process-drawable symbol)) _type_ 0)
)
)
|#
;; (define-extern drawable-load function) ;; (function drawable kheap drawable)
;; (define-extern art-load function) ;; (function string kheap art)
;; (define-extern art-group-load-check function) ;; (function string kheap int art-group)
(define-extern external-art-buffer-init function)
;; (define-extern *preload-spool-anims* object) ;; symbol
;; (define-extern ja-play-spooled-anim function) ;; (function spool-anim art-joint-anim art-joint-anim (function process-drawable symbol) int :behavior process-drawable)
;; (define-extern ja-abort-spooled-anim function) ;; (function spool-anim art-joint-anim int int :behavior process-drawable)
(define-extern drawable-load (function drawable kheap drawable))
(define-extern art-load (function string kheap art))
(define-extern art-group-load-check (function string kheap int art-group))
(define-extern external-art-buffer-init (function external-art-buffer int))
(define-extern *preload-spool-anims* symbol)
(define-extern ja-play-spooled-anim (function spool-anim art-joint-anim art-joint-anim (function process-drawable symbol) int :behavior process-drawable))
(define-extern ja-abort-spooled-anim (function spool-anim art-joint-anim int int :behavior process-drawable))
(define-extern *gui-control* gui-control)
(define-extern *art-control* external-art-control)
(define-extern *stack-top* pointer)
(define-extern *kernel-sp* pointer)
(define-extern loado (function string kheap object))
(define-extern link (function pointer pointer int kheap int pointer))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; game-info ;;
@@ -25611,7 +25633,7 @@
(define-extern cspace-by-name (function process-drawable string cspace))
(define-extern cspace-index-by-name (function process-drawable string int))
(define-extern vector<-cspace! (function vector cspace vector))
;; (define-extern vector<-matrix! function)
(define-extern vector<-matrix! (function vector matrix vector))
;; (define-extern vector<-cspace+vector! function) ;; (function vector cspace vector vector)
;; (define-extern cspace-children function) ;; (function process-drawable int pair)
;; (define-extern cspace-inspect-tree function) ;; (function process-drawable cspace int int object object)
@@ -25626,8 +25648,8 @@
;; (define-extern ja-min? function) ;; (function int symbol :behavior process-drawable)
;; (define-extern ja-max? function) ;; (function int symbol :behavior process-drawable)
;; (define-extern ja-num-frames function) ;; (function int int :behavior process-drawable)
;; (define-extern ja-frame-num function) ;; (function int float :behavior process-drawable)
;; (define-extern ja-aframe-num function) ;; (function int float :behavior process-drawable)
(define-extern ja-frame-num (function int float :behavior process-drawable))
(define-extern ja-aframe-num (function int float :behavior process-drawable))
(define-extern ja-aframe (function float int float :behavior process-drawable))
;; (define-extern ja-speed function) ;; (function int float :behavior process-drawable)
;; (define-extern ja-step function) ;; (function int float :behavior process-drawable)
@@ -25658,7 +25680,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (define-extern can-display-query? function)
;; (define-extern talker-surpress! function)
(define-extern talker-surpress! (function none))
;; (define-extern talker-displayed? function)
;; (define-extern kill-current-talker function)
;; (define-extern string->talker-speech function)
@@ -45948,12 +45970,11 @@
)
|#
#|
(deftype under-mine (process-drawable)
((chain basic :offset-assert 196)
(chain-initialized basic :offset-assert 200)
(main-mod basic :offset-assert 204)
(head-mod basic :offset-assert 208)
((chain chain-physics :offset-assert 200)
(chain-initialized symbol :offset-assert 204)
(main-mod joint-mod :offset-assert 208)
(head-mod joint-mod :offset-assert 212)
)
:method-count-assert 22
:size-assert #xd8
@@ -45963,7 +45984,6 @@
(idle () _type_ :state 21)
)
)
|#
#|
(deftype under-lift (elevator)
@@ -42,6 +42,8 @@
[6, "(function engine-pers connection-pers object object symbol)"]
],
"joint-mod": [[16, "(function cspace transformq none)"]],
"relocate": [[7, "(function sparticle-system sparticle-cpuinfo none)"]],
"default-menu": [
+5 -7
View File
@@ -125,8 +125,6 @@
"(method 16 ocean)",
// unknown bug
"joint-mod-polar-look-at-guts",
"(method 13 external-art-control)",
"update-mood-copy-ctywide",
"update-mood-copy-stadium",
"update-mood-drillb",
@@ -191,7 +189,8 @@
"debug-menu-make-continue-sub-menu",
"debug-menu-make-from-template",
"debug-menu-context-make-default-menus",
"debug-menu-make-task-menu"
"debug-menu-make-task-menu",
"(method 19 gui-control)"
],
// If format is used with the wrong number of arguments,
@@ -201,11 +200,9 @@
"bad_format_strings": {
"~170h~5d~220h~5d~280h~5,,2f": 3,
"~338h~5d~388h~5d~448h~5,,2f": 3,
"~1k~%": 0,
"~0K": 0,
"~30Htf: ~8D~134Hpr: ~8D~252Hsh: ~8D~370Hhd: ~8D~%": 4,
"~30Hal: ~8D~131Hwa: ~8D~252Hsp: ~8D~370Hwp: ~8D~%": 4,
"~0Kload ~16S ~5S ~5DK ~5,,2fs ~5,,2fs~1K ~5,,0f k/s~%": 6
"ERROR: <asg> ~A in spool anim loop for ~A ~D, but not loaded.~": 3
},
"blocks_ending_in_asm_branch": {
@@ -226,7 +223,8 @@
"sprite-draw-distorters": [4, 5],
"(method 12 perf-stat)": [0],
"(method 11 perf-stat)": [0]
"(method 11 perf-stat)": [0],
"(method 22 gui-control)": [117, 121, 127, 128, 129, 139]
},
// Sometimes the game might use format strings that are fetched dynamically,
+150 -150
View File
@@ -8,159 +8,159 @@
// the DGOs will be processed in this order. Usually it's best to have KERNEL, ENGINE, then the levels when
// you want to run on the entire game.
"dgo_names": [
"CGO/ART.CGO",
// "CGO/ART.CGO",
"CGO/KERNEL.CGO",
"CGO/ENGINE.CGO",
"CGO/GAME.CGO",
"CGO/COMMON.CGO",
"DGO/LWIDEB.DGO",
"DGO/LMEETBRT.DGO",
"DGO/CTA.DGO",
"DGO/PALOUT.DGO",
"DGO/STD.DGO",
"DGO/FOR.DGO",
"DGO/CASEXT.DGO",
"DGO/HIDEOUT.DGO",
"DGO/LWIDESTA.DGO",
"DGO/LRACELIT.DGO",
"DGO/CTB.DGO",
"DGO/KIOSK.DGO",
"DGO/DG1.DGO",
"DGO/FEB.DGO",
"DGO/DMI.DGO",
"DGO/ORACLE.DGO",
"DGO/LERLTESS.DGO",
"DGO/DRI.DGO",
"DGO/LBRNERMK.DGO",
"DGO/LRACECF.DGO",
"DGO/CTC.DGO",
"DGO/LTHRNOUT.DGO",
"DGO/FRA.DGO",
"DGO/LGARCSTA.DGO",
"DGO/MTN.DGO",
"DGO/INTROCST.DGO",
"DGO/DRB.DGO",
"DGO/ATE.DGO",
"DGO/LERROL.DGO",
"DGO/LTRNYSAM.DGO",
"DGO/LOUTCSTB.DGO",
"DGO/LASHTHRN.DGO",
"DGO/TOC.DGO",
"DGO/CFB.DGO",
"DGO/CAB.DGO",
"DGO/STC.DGO",
"DGO/STR.DGO",
"DGO/ATO.DGO",
"DGO/SEB.DGO",
"DGO/LPRSNCST.DGO",
"DGO/SWB.DGO",
"DGO/LPOWER.DGO",
"DGO/FOB.DGO",
"DGO/CIB.DGO",
"DGO/LSHUTTLE.DGO",
"DGO/LJAKDAX.DGO",
"DGO/FORDUMPC.DGO",
"DGO/LTRNTESS.DGO",
"DGO/TBO.DGO",
"DGO/THR.DGO",
"DGO/PRI.DGO",
"DGO/LKIDDOGE.DGO",
"DGO/NESTT.DGO",
"DGO/LWIDEC.DGO",
"DGO/SAG.DGO",
"DGO/NEB.DGO",
"DGO/COB.DGO",
"DGO/LBOMBBOT.DGO",
"DGO/DEMO.DGO",
"DGO/LRACEDF.DGO",
"DGO/LERLCHAL.DGO",
"DGO/LHIPOUT.DGO",
"DGO/OUTROCST.DGO",
"DGO/NES.DGO",
"DGO/PAR.DGO",
"DGO/LERBRNGD.DGO",
"DGO/MTX.DGO",
"DGO/FDA.DGO",
"DGO/LKEIRIFT.DGO",
"DGO/LWHACK.DGO",
"DGO/LJKDXASH.DGO",
"DGO/CAS.DGO",
"DGO/COA.DGO",
"DGO/LTESS.DGO",
"DGO/CFA.DGO",
"DGO/TOMBEXT.DGO",
"DGO/LCGUARD.DGO",
"DGO/TOE.DGO",
"DGO/PALBOSS.DGO",
"DGO/FRB.DGO",
"DGO/PAE.DGO",
"DGO/TITLE.DGO",
"DGO/FORDUMPD.DGO",
"DGO/D3A.DGO",
"DGO/DRILLMTN.DGO",
"DGO/PAC.DGO",
"DGO/LTENTOB.DGO",
"DGO/LRACEBF.DGO",
"DGO/LPROTECT.DGO",
"DGO/FEA.DGO",
"DGO/ONINTENT.DGO",
"DGO/STA.DGO",
"DGO/CGC.DGO",
"DGO/CMA.DGO",
"DGO/FDB.DGO",
"DGO/SKA.DGO",
"DGO/LTRNKRKD.DGO",
"DGO/CIA.DGO",
"DGO/TOB.DGO",
"DGO/LRACEDB.DGO",
"DGO/LDJAKBRN.DGO",
"DGO/TOA.DGO",
"DGO/STADBLMP.DGO",
"DGO/UND.DGO",
"DGO/LYSKDCD.DGO",
"DGO/HALFPIPE.DGO",
"DGO/LSAMERGD.DGO",
"DGO/PAS.DGO",
"DGO/LBBUSH.DGO",
"DGO/LPACKAGE.DGO",
"DGO/LINTCSTB.DGO",
"DGO/LPORTRUN.DGO",
"DGO/LASHGRD.DGO",
"DGO/CGB.DGO",
"DGO/D3B.DGO",
"DGO/STB.DGO",
"DGO/GARAGE.DGO",
"DGO/PORTWALL.DGO",
"DGO/LHELLDOG.DGO",
"DGO/SWE.DGO",
"DGO/LRACECB.DGO",
"DGO/GGA.DGO",
"DGO/TOD.DGO",
"DGO/MCN.DGO",
"DGO/SEW.DGO",
"DGO/VIN.DGO",
"DGO/CGA.DGO",
"DGO/CMB.DGO",
"DGO/LGUARD.DGO",
"DGO/CPA.DGO",
"DGO/LCITYLOW.DGO",
"DGO/LTENTOUT.DGO",
"DGO/UNB.DGO",
"DGO/CPO.DGO",
"DGO/CAP.DGO",
"DGO/CWI.DGO",
"DGO/CTYKORA.DGO",
"DGO/RUI.DGO",
"DGO/LSACK.DGO",
"DGO/CTYASHA.DGO",
"DGO/LPRTRACE.DGO",
"DGO/LWIDEA.DGO",
"DGO/HIPHOG.DGO",
"DGO/LSMYSBRT.DGO",
"DGO/LRACEBB.DGO",
"DGO/CASCITY.DGO",
"DGO/LYSAMSAM.DGO",
"DGO/VI1.DGO"
"CGO/COMMON.CGO" // ,
// "DGO/LWIDEB.DGO",
// "DGO/LMEETBRT.DGO",
// "DGO/CTA.DGO",
// "DGO/PALOUT.DGO",
// "DGO/STD.DGO",
// "DGO/FOR.DGO",
// "DGO/CASEXT.DGO",
// "DGO/HIDEOUT.DGO",
// "DGO/LWIDESTA.DGO",
// "DGO/LRACELIT.DGO",
// "DGO/CTB.DGO",
// "DGO/KIOSK.DGO",
// "DGO/DG1.DGO",
// "DGO/FEB.DGO",
// "DGO/DMI.DGO",
// "DGO/ORACLE.DGO",
// "DGO/LERLTESS.DGO",
// "DGO/DRI.DGO",
// "DGO/LBRNERMK.DGO",
// "DGO/LRACECF.DGO",
// "DGO/CTC.DGO",
// "DGO/LTHRNOUT.DGO",
// "DGO/FRA.DGO",
// "DGO/LGARCSTA.DGO",
// "DGO/MTN.DGO",
// "DGO/INTROCST.DGO",
// "DGO/DRB.DGO",
// "DGO/ATE.DGO",
// "DGO/LERROL.DGO",
// "DGO/LTRNYSAM.DGO",
// "DGO/LOUTCSTB.DGO",
// "DGO/LASHTHRN.DGO",
// "DGO/TOC.DGO",
// "DGO/CFB.DGO",
// "DGO/CAB.DGO",
// "DGO/STC.DGO",
// "DGO/STR.DGO",
// "DGO/ATO.DGO",
// "DGO/SEB.DGO",
// "DGO/LPRSNCST.DGO",
// "DGO/SWB.DGO",
// "DGO/LPOWER.DGO",
// "DGO/FOB.DGO",
// "DGO/CIB.DGO",
// "DGO/LSHUTTLE.DGO",
// "DGO/LJAKDAX.DGO",
// "DGO/FORDUMPC.DGO",
// "DGO/LTRNTESS.DGO",
// "DGO/TBO.DGO",
// "DGO/THR.DGO",
// "DGO/PRI.DGO",
// "DGO/LKIDDOGE.DGO",
// "DGO/NESTT.DGO",
// "DGO/LWIDEC.DGO",
// "DGO/SAG.DGO",
// "DGO/NEB.DGO",
// "DGO/COB.DGO",
// "DGO/LBOMBBOT.DGO",
// "DGO/DEMO.DGO",
// "DGO/LRACEDF.DGO",
// "DGO/LERLCHAL.DGO",
// "DGO/LHIPOUT.DGO",
// "DGO/OUTROCST.DGO",
// "DGO/NES.DGO",
// "DGO/PAR.DGO",
// "DGO/LERBRNGD.DGO",
// "DGO/MTX.DGO",
// "DGO/FDA.DGO",
// "DGO/LKEIRIFT.DGO",
// "DGO/LWHACK.DGO",
// "DGO/LJKDXASH.DGO",
// "DGO/CAS.DGO",
// "DGO/COA.DGO",
// "DGO/LTESS.DGO",
// "DGO/CFA.DGO",
// "DGO/TOMBEXT.DGO",
// "DGO/LCGUARD.DGO",
// "DGO/TOE.DGO",
// "DGO/PALBOSS.DGO",
// "DGO/FRB.DGO",
// "DGO/PAE.DGO",
// "DGO/TITLE.DGO",
// "DGO/FORDUMPD.DGO",
// "DGO/D3A.DGO",
// "DGO/DRILLMTN.DGO",
// "DGO/PAC.DGO",
// "DGO/LTENTOB.DGO",
// "DGO/LRACEBF.DGO",
// "DGO/LPROTECT.DGO",
// "DGO/FEA.DGO",
// "DGO/ONINTENT.DGO",
// "DGO/STA.DGO",
// "DGO/CGC.DGO",
// "DGO/CMA.DGO",
// "DGO/FDB.DGO",
// "DGO/SKA.DGO",
// "DGO/LTRNKRKD.DGO",
// "DGO/CIA.DGO",
// "DGO/TOB.DGO",
// "DGO/LRACEDB.DGO",
// "DGO/LDJAKBRN.DGO",
// "DGO/TOA.DGO",
// "DGO/STADBLMP.DGO",
// "DGO/UND.DGO",
// "DGO/LYSKDCD.DGO",
// "DGO/HALFPIPE.DGO",
// "DGO/LSAMERGD.DGO",
// "DGO/PAS.DGO",
// "DGO/LBBUSH.DGO",
// "DGO/LPACKAGE.DGO",
// "DGO/LINTCSTB.DGO",
// "DGO/LPORTRUN.DGO",
// "DGO/LASHGRD.DGO",
// "DGO/CGB.DGO",
// "DGO/D3B.DGO",
// "DGO/STB.DGO",
// "DGO/GARAGE.DGO",
// "DGO/PORTWALL.DGO",
// "DGO/LHELLDOG.DGO",
// "DGO/SWE.DGO",
// "DGO/LRACECB.DGO",
// "DGO/GGA.DGO",
// "DGO/TOD.DGO",
// "DGO/MCN.DGO",
// "DGO/SEW.DGO",
// "DGO/VIN.DGO",
// "DGO/CGA.DGO",
// "DGO/CMB.DGO",
// "DGO/LGUARD.DGO",
// "DGO/CPA.DGO",
// "DGO/LCITYLOW.DGO",
// "DGO/LTENTOUT.DGO",
// "DGO/UNB.DGO",
// "DGO/CPO.DGO",
// "DGO/CAP.DGO",
// "DGO/CWI.DGO",
// "DGO/CTYKORA.DGO",
// "DGO/RUI.DGO",
// "DGO/LSACK.DGO",
// "DGO/CTYASHA.DGO",
// "DGO/LPRTRACE.DGO",
// "DGO/LWIDEA.DGO",
// "DGO/HIPHOG.DGO",
// "DGO/LSMYSBRT.DGO",
// "DGO/LRACEBB.DGO",
// "DGO/CASCITY.DGO",
// "DGO/LYSAMSAM.DGO" //,
// "DGO/VI1.DGO"
],
// some objects are part of STR files (streaming data).
+1
View File
@@ -89,6 +89,7 @@
["L95", "matrix"],
["L96", "vector4w"]
],
"joint-mod": [["L189", "(inline-array quaternion)", 3]],
"sky-data": [
["L26", "(inline-array sky-vertex)", 12],
["L25", "(inline-array sky-vertex)", 12],
+58 -1
View File
@@ -345,5 +345,62 @@
[16, "bounding-box"]
],
// placeholder
"placeholder-do-not-add-below": []
"placeholder-do-not-add-below": [],
"joint-mod-ik-callback": [
[16, "matrix"],
[80, "matrix"],
[144, "vector"],
[160, "vector"],
[176, "vector"],
[192, "vector"],
[208, "vector"],
[224, "vector"],
[272, "vector"],
[256, "vector"],
[288, "vector"],
[304, "vector"],
[320, "quaternion"],
[336, "quaternion"],
[352, "vector"],
[448, "vector"],
[464, "vector"],
[480, "vector"],
[496, "quaternion"],
[512, "matrix"],
[576, "vector"],
[592, "matrix"],
[656, "matrix"],
[720, "matrix"]
],
"joint-mod-look-at-handler": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"],
[96, "vector"],
[112, "vector"],
[128, "vector"]
],
"joint-mod-polar-look-at-guts": [[32, "vector"]],
"joint-mod-world-look-at-handler": [[16, "vector"]],
"joint-mod-joint-set-world-handler": [
[32, "vector"],
[48, "vector"]
],
"joint-mod-joint-set*-world-handler": [[16, "matrix"]],
"(method 11 chain-physics)": [
[16, "matrix"],
[80, "vector"],
[128, "vector"],
[144, "vector"],
[160, "vector"],
[176, "vector"],
[192, "vector"],
[208, "vector"],
[224, "vector"],
[240, "vector"],
[256, "vector"]
],
"(method 13 gui-control)": [[16, ["array", "sound-id", 4]]],
"ja-play-spooled-anim": [[96, "event-message-block"]]
}
+80 -1
View File
@@ -654,6 +654,11 @@
[[285, 289], "a1", "vector4w"],
[[293, 298], "v1", "dma-packet"]
],
"(method 10 history)": [[[8, 10], "a1", "history-elt"]],
"(method 10 history-iterator)": [[[20, 35], "a2", "history-elt"]],
"command-get-time": [[119, "gp", "(pointer float)"]],
"command-get-param": [[122, "gp", "(pointer float)"]],
"command-get-entity": [[10, "gp", "process"]],
"print-game-text": [
[225, "v1", "float"],
[241, "v1", "float"]
@@ -900,6 +905,40 @@
[34, "v1", "texture-id"],
[[42, 44], "v1", "adgif-shader"]
],
"joint-mod-ik-callback": [
[6, "gp", "joint-mod-ik"],
[9, "gp", "joint-mod-ik"],
[[1, 35], "gp", "joint-mod-ik"],
[[1, 433], "gp", "joint-mod-ik"]
],
"(method 11 joint-mod)": [
[20, "s0", "fact-info-enemy"],
[12, "s2", "process-drawable"]
],
"joint-mod-look-at-handler": [[[2, 406], "gp", "joint-mod"]],
"real-joint-mod-gun-look-at-handler": [
[1, "v1", "joint-mod"],
[2, "v1", "joint-mod"]
],
"joint-mod-foot-rot-handler": [
[[0, 7], "s5", "joint-mod"],
[[36, 59], "s5", "joint-mod"],
[[63, 97], "s5", "joint-mod"],
[119, "s5", "joint-mod"],
[[119, 152], "s5", "joint-mod"]
],
"joint-mod-polar-look-at-guts": [
[1, "gp", "joint-mod"],
[[1, 334], "gp", "joint-mod"],
[334, "gp", "joint-mod"]
],
"joint-mod-world-look-at-handler": [[[0, 217], "gp", "joint-mod"]],
"joint-mod-rotate-handler": [[[2, 114], "s5", "joint-mod"]],
"joint-mod-scale-handler": [[[1, 14], "s5", "joint-mod"]],
"joint-mod-joint-set-handler": [[[2, 23], "s4", "joint-mod"]],
"joint-mod-joint-set-world-handler": [[[6, 197], "s5", "joint-mod"]],
"joint-mod-joint-set*-handler": [[[2, 39], "s5", "joint-mod"]],
"joint-mod-joint-set*-world-handler": [[[4, 53], "s5", "joint-mod"]],
"glst-find-node-by-name": [
[6, "s5", "glst-named-node"],
[7, "v1", "glst-named-node"]
@@ -1383,5 +1422,45 @@
[137, "f0", "float"]
],
// placeholder
"placeholder-do-not-add-below": []
"placeholder-do-not-add-below": [],
"drawable-load": [[[25, 28], "s5", "drawable"]],
"art-load": [[[13, 16], "s5", "art"]],
"art-group-load-check": [[[43, 53], "s3", "art-group"]],
"(method 13 art-group)": [[13, "s3", "art-joint-anim"]],
"(method 14 art-group)": [[13, "s3", "art-joint-anim"]],
"(method 13 gui-control)": [
[[52, 81], "s3", "gui-connection"],
[[202, 228], "a0", "connection"]
],
"(method 21 gui-control)": [[43, "s2", "process-drawable"]],
"(method 12 gui-control)": [
[128, "v1", "gui-connection"],
[214, "v1", "gui-connection"],
[167, "s2", "process-drawable"]
],
"(method 16 gui-control)": [[[10, 119], "s1", "gui-connection"]],
"(method 17 gui-control)": [
[[1, 262], "gp", "gui-connection"],
[13, "v1", "gui-connection"]
],
"(method 14 gui-control)": [[[5, 41], "s2", "gui-connection"]],
"(method 15 gui-control)": [[[6, 56], "s1", "gui-connection"]],
"(method 11 external-art-control)": [[19, "s5", "process-drawable"]],
"ja-abort-spooled-anim": [[[3, 24], "s3", "sound-id"]],
"(method 19 gui-control)": [
[[32, 35], "a2", "gui-channel"],
[113, "a2", "gui-channel"]
],
"(method 9 gui-control)": [
[110, "v0", "gui-connection"],
[10, "v1", "gui-connection"],
[17, "v1", "gui-connection"],
[24, "v1", "gui-connection"],
[131, "v1", "gui-connection"],
[35, "v1", "gui-connection"],
[40, "v1", "gui-connection"],
[44, "v1", "gui-connection"],
[14, "v1", "gui-connection"]
],
"(method 10 gui-control)": [[[4, 32], "s3", "gui-connection"]]
}
-15
View File
@@ -7,19 +7,16 @@
"v1-25": "resource-mem"
}
},
"(method 0 lightning-control)": {
"vars": {
"gp-0": ["obj", "lightning-control"]
}
},
"(method 0 align-control)": {
"vars": {
"v0-0": ["obj", "align-control"]
}
},
"(method 16 nav-mesh)": {
"args": ["obj", "ray"],
"vars": {
@@ -220,15 +217,12 @@
"v0-3": ["lightning-sound-id", "sound-id"]
}
},
"(method 10 mood-control)": {
"args": ["obj", "cloud-target", "fog-target", "cloud-speed", "fog-speed"]
},
"(method 11 mood-control)": {
"args": ["obj", "min-cloud", "max-cloud", "min-fog", "max-fog"]
},
"copy-mood-exterior": {
"vars": {
"a1-4": ["a1-4", "(inline-array vector)"],
@@ -236,19 +230,16 @@
"a0-2": ["a0-2", "(inline-array vector)"]
}
},
"update-mood-strip": {
"vars": {
"s4-1": ["s4-1", "(pointer float)"]
}
},
"update-mood-ruins": {
"vars": {
"gp-1": ["gp-1", "(pointer float)"]
}
},
"desaturate-mood-colors": {
"vars": {
"a0-8": ["mood-colors", "(inline-array mood-color)"]
@@ -259,19 +250,15 @@
"v1-2": "current-gun"
}
},
"(method 10 cylinder)": {
"args": ["obj", "ray1", "ray2"]
},
"ripple-make-request": {
"args": ["waveform", "effect"]
},
"command-get-entity": {
"args": ["search", "fallback"]
},
"(method 10 cam-setting-data)": {
"vars": {
"v1-5": ["v1-5", "handle"],
@@ -282,13 +269,11 @@
"v1-112": ["v1-112", "handle"]
}
},
"(method 17 setting-control)": {
"vars": {
"v1-84": ["v1-84", "task-mask"]
}
},
"(method 18 setting-control)": {
"vars": {
"a0-147": ["a0-147", "process-focusable"]
+1 -1
View File
@@ -92,7 +92,7 @@
// optional: a predetermined object file name map from a file.
// this will make decompilation naming consistent even if you only run on some objects.
// "obj_file_name_map_file": "goal_src/jak2/build/all_objs.json",
"obj_file_name_map_file": "goal_src/jak2/build/all_objs.json",
////////////////////////////
// LEVEL EXTRACTION
+2 -2
View File
@@ -421,8 +421,8 @@ int DecompilerTypeSystem::get_format_arg_count(const std::string& str) const {
}
static const std::vector<char> single_char_ignore_list = {'%', 'T'};
static const std::vector<std::string> multi_char_ignore_list = {"0L", "1L", "3L", "1K", "2j",
"0k", "30L", "1T", "2T"};
static const std::vector<std::string> multi_char_ignore_list = {
"0L", "1L", "3L", "1k", "1K", "2j", "0k", "0K", "30L", "1T", "2T"};
int arg_count = 0;
for (size_t i = 0; i < str.length(); i++) {
+2 -1
View File
@@ -756,7 +756,8 @@ goos::Object decompile_structure(const TypeSpec& type,
const LinkedObjectFile* file,
bool use_fancy_macros) {
// some structures we want to decompile to fancy macros instead of a raw static definiton
if (use_fancy_macros) {
// temp hack!!
if (use_fancy_macros && file && file->version == GameVersion::Jak1) {
if (type == TypeSpec("sp-field-init-spec")) {
ASSERT(file->version == GameVersion::Jak1); // need to update enums
return decompile_sparticle_field_init(type, label, labels, words, ts, file);
+1 -1
View File
@@ -53,7 +53,7 @@
(define-extern process-level-heap kheap) ;; not a kheap at boot
(define-extern stack symbol)
(define-extern scratch symbol)
(define-extern *stratch-top* pointer)
(define-extern *scratch-top* pointer)
(define-extern zero-func (function int))
;; asize-of-basic-func - has a bug
;; copy-basic-func - has a bug
@@ -991,6 +991,7 @@
)
)
(define-extern talker-surpress! (function none))
+10
View File
@@ -52,6 +52,7 @@
:flag-assert #x900000040
)
(deftype top-anim-joint-control (basic)
((process uint32 :offset-assert 4)
(interp-select uint64 2 :offset-assert 8)
@@ -84,6 +85,7 @@
)
)
(deftype joint-control (basic)
((status joint-control-status :offset-assert 4)
(allocated-length uint8 :offset-assert 6)
@@ -137,6 +139,7 @@
:flag-assert #x900000018
)
(deftype joint-work (structure)
((temp-mtx matrix :inline :offset-assert 0)
(joint-stack matrix-stack :inline :offset-assert 64)
@@ -157,3 +160,10 @@
:size-assert #x3640
:flag-assert #x900003640
)
0
+101 -79
View File
@@ -5,17 +5,38 @@
;; name in dgo: joint-mod-h
;; dgos: ENGINE, GAME
(defenum joint-mod-blend-flags
:bitfield #t
:type uint32
(trans)
(scale)
(rotation)
)
(defenum joint-mod-mode
:bitfield #t
:type uint32
(flex-blend 0) ;; 1
(look-at 1) ;; 2
(world-look-at 2) ;; 4
(rotate 3) ;; 8
(joint-set 4) ;; 16
(joint-set* 5) ;; 32
;; ?? ;; 64
(reset 7) ;; 128
:bitfield #t
:type uint32
(flex-blend)
(look-at)
(world-look-at)
(rotate)
(joint-set)
(joint-set*)
(rotate2) ;; ??
(reset)
(polar-look-at)
(joint-set*-world)
(gun-look-at)
(foot-rot)
(joint-set-world)
)
(defenum joint-mod-ik-flags
:bitfield #t
:type uint32
(enable)
(elbow-trans-neg)
(elbow-rot-neg)
)
;; +++track-mode
@@ -39,56 +60,56 @@
;; DECOMP BEGINS
(deftype joint-mod (basic)
((mode joint-mod-mode :offset-assert 4)
(process process :offset-assert 8)
(joint cspace :offset-assert 12)
(target vector :inline :offset 16)
(twist vector :inline :offset 32)
(twist-max float 4 :offset-assert 48)
(extra-twist degrees :offset 40)
(track-mode track-mode :offset 44)
(loock-at-count uint16 :offset 46)
(twist-range-x meters :offset 56)
(twist-range-y meters :offset 60)
(twist-speed-x float :offset 64)
(twist-speed-y float :offset 68)
(twist-min-x float :offset 72)
(twist-min-y float :offset 76)
(trans vector :inline :offset-assert 80)
(shmushy-old float :offset 80)
(smushy-off float :offset 84)
(smushyv float :offset 88)
(quat quaternion :inline :offset-assert 96)
(scale vector :inline :offset-assert 112)
(notice-time time-frame :offset-assert 128)
(flex-blend float :offset-assert 136)
(blend float :offset-assert 140)
(max-dist meters :offset-assert 144)
(ignore-angle degrees :offset-assert 148)
(up uint8 :offset-assert 152)
(nose uint8 :offset-assert 153)
(ear uint8 :offset-assert 154)
(base-joint uint8 :offset-assert 155)
(base-nose uint8 :offset-assert 156)
(shutting-down? symbol :offset-assert 160)
(parented-scale? symbol :offset-assert 164)
(polar-internal-tilt-max float :offset-assert 168)
(polar-internal-radius float :offset-assert 172)
(polar-external-tilt-max float :offset-assert 176)
(polar-external-radius float :offset-assert 180)
((mode joint-mod-mode :offset-assert 4)
(process process-drawable :offset-assert 8)
(joint cspace :offset-assert 12)
(target vector :inline :offset-assert 16)
(twist vector :inline :offset-assert 32)
(twist-max vector :inline :offset-assert 48)
(extra-twist degrees :offset 40)
(track-mode track-mode :offset 44)
(loock-at-count uint16 :offset 46)
(twist-range-x meters :offset 56)
(twist-range-y meters :offset 60)
(twist-speed-x float :offset 64)
(twist-speed-y float :offset 68)
(twist-min-x float :offset 72)
(twist-min-y float :offset 76)
(trans vector :inline :offset-assert 80)
(shmushy-old float :offset 80)
(smushy-off float :offset 84)
(smushyv float :offset 88)
(quat quaternion :inline :offset-assert 96)
(scale vector :inline :offset-assert 112)
(notice-time time-frame :offset-assert 128)
(flex-blend float :offset-assert 136)
(blend float :offset-assert 140)
(max-dist meters :offset-assert 144)
(ignore-angle degrees :offset-assert 148)
(up uint8 :offset-assert 152)
(nose uint8 :offset-assert 153)
(ear uint8 :offset-assert 154)
(base-joint uint8 :offset-assert 155)
(base-nose uint8 :offset-assert 156)
(shutting-down? symbol :offset-assert 160)
(parented-scale? symbol :offset-assert 164)
(polar-internal-tilt-max float :offset-assert 168)
(polar-internal-radius float :offset-assert 172)
(polar-external-tilt-max float :offset-assert 176)
(polar-external-radius float :offset-assert 180)
)
:method-count-assert 16
:size-assert #xb8
:flag-assert #x10000000b8
(:methods
(new (symbol type joint-mod-mode process-drawable int) _type_ 0)
(joint-mod-method-9 () none 9)
(joint-mod-method-10 () none 10)
(joint-mod-method-11 () none 11)
(mode-set! (_type_ joint-mod-mode) none 9)
(target-set! (_type_ vector) none 10)
(look-at! (_type_ vector symbol process) none :behavior process 11)
(reset-blend! (_type_) _type_ 12)
(joint-mod-method-13 () none 13)
(joint-mod-method-14 () none 14)
(joint-mod-method-15 () none 15)
(twist-set! (_type_ float float float) vector 13)
(trs-set! (_type_ vector quaternion vector) none 14)
(shut-down (_type_) none 15)
)
)
@@ -447,12 +468,12 @@
)
(deftype joint-mod-blend-world (basic)
((transform transformq :inline :offset-assert 16)
(blend-transform transformq :inline :offset-assert 64)
(blend-flags uint32 :offset-assert 112)
(node-index int32 :offset-assert 116)
(blend float :offset-assert 120)
(enable symbol :offset-assert 124)
((transform transformq :inline :offset-assert 16)
(blend-transform transformq :inline :offset-assert 64)
(blend-flags joint-mod-blend-flags :offset-assert 112)
(node-index int32 :offset-assert 116)
(blend float :offset-assert 120)
(enable symbol :offset-assert 124)
)
:method-count-assert 9
:size-assert #x80
@@ -473,17 +494,17 @@
(let ((gp-0 (the-as joint-mod-blend-world (-> arg0 param1))))
(cond
((-> gp-0 enable)
(let ((f30-0 (if (logtest? (-> gp-0 blend-flags) 1)
(let ((f30-0 (if (logtest? (-> gp-0 blend-flags) (joint-mod-blend-flags trans))
(-> gp-0 blend)
0.0
)
)
(f28-0 (if (logtest? (-> gp-0 blend-flags) 2)
(f28-0 (if (logtest? (-> gp-0 blend-flags) (joint-mod-blend-flags scale))
(-> gp-0 blend)
0.0
)
)
(f26-0 (if (logtest? (-> gp-0 blend-flags) 4)
(f26-0 (if (logtest? (-> gp-0 blend-flags) (joint-mod-blend-flags rotation))
(-> gp-0 blend)
0.0
)
@@ -593,28 +614,29 @@
)
(deftype joint-mod-ik (basic)
((flags uint32 :offset-assert 4)
(process basic :offset-assert 8)
(hand-dist float :offset-assert 12)
(handle-pos vector :inline :offset-assert 16)
(elbow-pole-vector-axis uint32 :offset-assert 32)
(elbow-rotation-axis uint32 :offset-assert 36)
(user-position vector :inline :offset-assert 48)
(user-normal vector :inline :offset-assert 64)
(user-blend float :offset-assert 80)
(user-float float :offset-assert 84)
(callback basic :offset-assert 88)
(shoulder-matrix-no-ik matrix :inline :offset-assert 96)
(elbow-matrix-no-ik matrix :inline :offset-assert 160)
(blend float :offset-assert 224)
(blend-interp float :offset-assert 228)
((flags joint-mod-ik-flags :offset-assert 4)
(process process-drawable :offset-assert 8)
(hand-dist float :offset-assert 12)
(handle-pos vector :inline :offset-assert 16)
(elbow-pole-vector-axis uint32 :offset-assert 32)
(elbow-rotation-axis uint32 :offset-assert 36)
(user-position vector :inline :offset-assert 48)
(user-normal vector :inline :offset-assert 64)
(user-blend float :offset-assert 80)
(user-float float :offset-assert 84)
(callback (function joint-mod-ik matrix matrix vector object) :offset-assert 88)
(shoulder-matrix-no-ik matrix :inline :offset-assert 96)
(elbow-matrix-no-ik matrix :inline :offset-assert 160)
(blend float :offset-assert 224)
(blend-interp float :offset-assert 228)
)
:method-count-assert 11
:size-assert #xe8
:flag-assert #xb000000e8
(:methods
(joint-mod-ik-method-9 () none 9)
(joint-mod-ik-method-10 () none 10)
(new (symbol type process-drawable int float) _type_ 0)
(handle-copy! (_type_ vector) none 9)
(enable-set! (_type_ symbol) none 10)
)
)
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -158,7 +158,7 @@
(set! (-> v0-0 allocated-length) (the-as uint arg0))
(set! (-> v0-0 active-channels) (the-as uint 0))
(set! (-> v0-0 float-channels) (the-as uint 0))
(set! (-> v0-0 root-channel) (the-as (inline-array joint-control-channel) (-> v0-0 channel)))
(set! (-> v0-0 root-channel) (-> v0-0 channel))
(set! (-> v0-0 generate-frame-function) create-interpolated-joint-animation-frame)
(set! (-> v0-0 prebind-function) #f)
(set! (-> v0-0 postbind-function) #f)
@@ -1138,9 +1138,9 @@
(set! (-> gp-0 vector 2 quad) a1-1)
(set! (-> gp-0 trans quad) a2-1)
)
(vector-normalize! (the-as vector (-> gp-0 data)) 1.0)
(vector-normalize! (the-as vector (&-> gp-0 data 4)) 1.0)
(vector-normalize! (the-as vector (&-> gp-0 data 8)) 1.0)
(vector-normalize! (the-as vector (-> gp-0 vector)) 1.0)
(vector-normalize! (-> gp-0 vector 1) 1.0)
(vector-normalize! (-> gp-0 vector 2) 1.0)
gp-0
)
)
+2
View File
@@ -59,6 +59,8 @@
(declare-type camera-master process)
(define-extern cam-master-init (function none :behavior camera-master))
(define-extern parameter-ease-sin-clamp (function float float))
;; DECOMP BEGINS
(deftype cam-index (structure)
+2 -2
View File
@@ -221,7 +221,7 @@
(:methods
(relocate (_type_ kheap (pointer uint8)) none :replace 7)
(link-art! (_type_) art-group 13)
(art-group-method-14 () none 14)
(unlink-art! (_type_) int 14)
)
)
@@ -396,7 +396,7 @@
(defmethod get-skeleton-origin draw-control ((obj draw-control))
(-> obj skeleton bones 0 transform vector 3)
(-> obj skeleton bones 0 transform trans)
)
0
+6
View File
@@ -11,6 +11,12 @@
(define-extern transform-float-point (function vector vector4w vector4w))
(define-extern add-debug-line (function symbol bucket-id vector vector rgba symbol rgba symbol))
(define-extern add-debug-line2d (function symbol bucket-id vector vector vector symbol))
(define-extern add-debug-sphere (function symbol bucket-id vector float rgba symbol))
(define-extern add-debug-text-3d (function symbol bucket-id string vector font-color vector2h symbol))
(define-extern add-debug-text-sphere (function symbol bucket-id vector float string rgba symbol))
;; DECOMP BEGINS
(deftype pos-history (structure)
+5 -1
View File
@@ -5,7 +5,11 @@
;; name in dgo: debug
;; dgos: ENGINE, GAME
(define-extern add-debug-line2d (function symbol bucket-id vector vector vector symbol))
(defun add-debug-text-sphere ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 float) (arg4 string) (arg5 rgba))
(add-debug-sphere arg0 arg1 arg2 arg3 arg5)
(add-debug-text-3d arg0 arg1 arg4 arg2 (font-color default) (the-as vector2h #f))
#f
)
;; DECOMP BEGINS
+7 -7
View File
@@ -207,13 +207,13 @@
(want-sound-banks (_type_ (pointer symbol)) none 12)
(want-display-level (_type_ symbol symbol) int 13)
(want-vis-level (_type_ symbol) none 14)
(load-state-method-15 () none 15)
(load-state-method-16 () none 16)
(load-state-method-17 () none 17)
(load-state-method-18 () none 18)
(load-state-method-19 () none 19)
(load-state-method-20 () none 20)
(load-state-method-21 () none 21)
(want-force-vis (_type_ symbol symbol) int 15)
(execute-command (_type_ pair) none 16)
(execute-commands-up-to (_type_ float) none 17)
(backup-load-state-and-set-cmds (_type_ pair) int 18)
(restore-load-state-and-cleanup (_type_) int 19)
(restore-load-state (_type_) int 20)
(set-force-inside! (_type_ symbol symbol) none 21)
)
)
+1 -1
View File
@@ -136,7 +136,7 @@
(stereo-mode int32 :offset-assert 228)
(music symbol :offset-assert 232)
(sound-stinger int32 :offset-assert 236)
(spool-anim symbol :offset-assert 240)
(spool-anim spool-anim :offset-assert 240)
(sound-mode uint32 :offset-assert 244)
(task-manager (pointer process) :offset-assert 248)
(task symbol :offset-assert 252)
+1 -1
View File
@@ -357,7 +357,7 @@
(set! (-> obj spooling) (the-as (pointer process) arg1))
)
(('spool-anim)
(set! (-> obj spool-anim) arg1)
(set! (-> obj spool-anim) (the-as spool-anim arg1))
)
(('hint)
(set! (-> obj hint) (the-as (pointer process) arg1))
+39 -102
View File
@@ -370,35 +370,31 @@
(defun forward-down->inv-matrix ((arg0 matrix) (arg1 vector) (arg2 vector))
"Create a matrix representing an inverse transform where arg1 is forward (+z) and arg2 is down (-y). Will have the pitch of forward"
(vector-normalize-copy! (the-as vector (&-> arg0 data 8)) arg1 1.0)
(vector-cross! (the-as vector (-> arg0 data)) (the-as vector (&-> arg0 data 8)) arg2)
(vector-normalize! (the-as vector (-> arg0 data)) 1.0)
(vector-cross! (the-as vector (&-> arg0 data 4)) arg1 (the-as vector (-> arg0 data)))
(vector-normalize! (the-as vector (&-> arg0 data 4)) 1.0)
(vector-normalize-copy! (-> arg0 vector 2) arg1 1.0)
(vector-cross! (the-as vector (-> arg0 vector)) (-> arg0 vector 2) arg2)
(vector-normalize! (the-as vector (-> arg0 vector)) 1.0)
(vector-cross! (-> arg0 vector 1) arg1 (the-as vector (-> arg0 vector)))
(vector-normalize! (-> arg0 vector 1) 1.0)
(set! (-> arg0 trans quad) (the-as uint128 0))
(set! (-> arg0 data 3) 0.0)
(set! (-> arg0 data 7) 0.0)
(set! (-> arg0 data 11) 0.0)
(set! (-> arg0 vector 0 w) 0.0)
(set! (-> arg0 vector 1 w) 0.0)
(set! (-> arg0 vector 2 w) 0.0)
(set! (-> arg0 trans w) 1.0)
arg0
)
(defun forward-down-nopitch->inv-matrix ((arg0 matrix) (arg1 vector) (arg2 vector))
"Create a matrix representing an inverse transform where arg1 is forward (+z) and arg2 is down (-y). Will not use the pitch of forward"
(vector-normalize-copy! (the-as vector (&-> arg0 data 4)) arg2 1.0)
(vector-negate! (the-as vector (&-> arg0 data 4)) (the-as vector (&-> arg0 data 4)))
(vector-cross! (the-as vector (-> arg0 data)) (the-as vector (&-> arg0 data 4)) arg1)
(vector-normalize! (the-as vector (-> arg0 data)) 1.0)
(vector-cross!
(the-as vector (&-> arg0 data 8))
(the-as vector (-> arg0 data))
(the-as vector (&-> arg0 data 4))
)
(vector-normalize! (the-as vector (&-> arg0 data 8)) 1.0)
(vector-normalize-copy! (-> arg0 vector 1) arg2 1.0)
(vector-negate! (-> arg0 vector 1) (-> arg0 vector 1))
(vector-cross! (the-as vector (-> arg0 vector)) (-> arg0 vector 1) arg1)
(vector-normalize! (the-as vector (-> arg0 vector)) 1.0)
(vector-cross! (-> arg0 vector 2) (the-as vector (-> arg0 vector)) (-> arg0 vector 1))
(vector-normalize! (-> arg0 vector 2) 1.0)
(set! (-> arg0 trans quad) (the-as uint128 0))
(set! (-> arg0 data 3) 0.0)
(set! (-> arg0 data 7) 0.0)
(set! (-> arg0 data 11) 0.0)
(set! (-> arg0 vector 0 w) 0.0)
(set! (-> arg0 vector 1 w) 0.0)
(set! (-> arg0 vector 2 w) 0.0)
(set! (-> arg0 trans w) 1.0)
arg0
)
@@ -639,23 +635,23 @@
)
)
(defun matrix-remove-z-rot ((arg0 matrix) (arg1 matrix))
(defun matrix-remove-z-rot ((arg0 matrix) (arg1 vector))
"Remove the z rotation component of a rotation."
(let ((s4-0 (new-stack-vector0)))
0.0
0.0
(let ((s5-0 (new-stack-matrix0)))
(vector-negate! s4-0 (the-as vector arg1))
(vector-flatten! s4-0 s4-0 (the-as vector (&-> arg0 data 8)))
(vector-negate! s4-0 arg1)
(vector-flatten! s4-0 s4-0 (-> arg0 vector 2))
(vector-normalize! s4-0 1.0)
(let ((f30-0 (vector-dot (the-as vector (&-> arg0 data 4)) s4-0)))
(let ((f30-0 (vector-dot (-> arg0 vector 1) s4-0)))
(when (< f30-0 0.99999)
(vector-cross! s4-0 (the-as vector (&-> arg0 data 4)) s4-0)
(vector-cross! s4-0 (-> arg0 vector 1) s4-0)
(let ((f0-4 (vector-length s4-0)))
(if (< 0.0 (vector-dot s4-0 (the-as vector (&-> arg0 data 8))))
(if (< 0.0 (vector-dot s4-0 (-> arg0 vector 2)))
(set! f0-4 (- f0-4))
)
(matrix-axis-sin-cos! s5-0 (the-as vector (&-> arg0 data 8)) f0-4 f30-0)
(matrix-axis-sin-cos! s5-0 (-> arg0 vector 2) f0-4 f30-0)
)
(matrix*! arg0 arg0 s5-0)
)
@@ -699,12 +695,7 @@
(quaternion->matrix s5-0 arg1)
(quaternion->matrix s4-0 arg2)
(let ((s2-1 (new-stack-quaternion0)))
(quaternion-from-two-vectors-max-angle!
s2-1
(the-as vector (&-> s5-0 data 8))
(the-as vector (&-> s4-0 data 8))
arg4
)
(quaternion-from-two-vectors-max-angle! s2-1 (-> s5-0 vector 2) (-> s4-0 vector 2) arg4)
(quaternion-normalize! (quaternion*! arg0 arg0 s2-1))
)
)
@@ -917,96 +908,42 @@
(b! #t cfg-24 :delay (.svf (&-> arg0 quad) vf18))
(nop!)
(label cfg-3)
(b! (nonzero? v1-4) cfg-6 :delay (set! v1-5 (the-as uint (+ v1-4 -1))))
(vector-segment-distance-point!
arg1
(the-as vector (-> arg2 vector))
(-> arg2 vector 1)
arg0
)
(b! (nonzero? v1-4) cfg-6 :delay (set! v1-5 (+ v1-4 -1)))
(vector-segment-distance-point! arg1 (the-as vector (-> arg2 vector)) (-> arg2 vector 1) arg0)
(goto cfg-24)
(label cfg-6)
(b! (nonzero? v1-5) cfg-9 :delay (set! v1-6 (the-as uint (+ v1-5 -1))))
(vector-segment-distance-point!
arg1
(-> arg2 vector 1)
(-> arg2 vector 2)
arg0
)
(b! (nonzero? v1-5) cfg-9 :delay (set! v1-6 (+ v1-5 -1)))
(vector-segment-distance-point! arg1 (-> arg2 vector 1) (-> arg2 vector 2) arg0)
(goto cfg-24)
(label cfg-9)
(b! (nonzero? v1-6) cfg-14 :delay (set! v1-7 (the-as uint (+ v1-6 -1))))
(let ((f30-0 (vector-segment-distance-point!
arg1
(-> arg2 vector 1)
(the-as vector (-> arg2 vector))
arg0
)
)
(b! (nonzero? v1-6) cfg-14 :delay (set! v1-7 (+ v1-6 -1)))
(let ((f30-0 (vector-segment-distance-point! arg1 (-> arg2 vector 1) (the-as vector (-> arg2 vector)) arg0))
(s3-0 (new 'stack-no-clear 'vector))
)
(if (< (vector-segment-distance-point!
arg1
(-> arg2 vector 1)
(-> arg2 vector 2)
s3-0
)
f30-0
)
(if (< (vector-segment-distance-point! arg1 (-> arg2 vector 1) (-> arg2 vector 2) s3-0) f30-0)
(set! (-> arg0 quad) (-> s3-0 quad))
)
)
(goto cfg-24)
(label cfg-14)
(b! (nonzero? v1-7) cfg-17 :delay (set! v1-10 (the-as uint (+ v1-7 -1))))
(vector-segment-distance-point!
arg1
(-> arg2 vector 2)
(the-as vector (-> arg2 vector))
arg0
)
(b! (nonzero? v1-7) cfg-17 :delay (set! v1-10 (+ v1-7 -1)))
(vector-segment-distance-point! arg1 (-> arg2 vector 2) (the-as vector (-> arg2 vector)) arg0)
(goto cfg-24)
(label cfg-17)
(b! (nonzero? v1-10) cfg-22)
(let ((f30-1 (vector-segment-distance-point!
arg1
(the-as vector (-> arg2 vector))
(-> arg2 vector 1)
arg0
)
)
(b! (nonzero? v1-10) cfg-22 :delay (nop!))
(let ((f30-1 (vector-segment-distance-point! arg1 (the-as vector (-> arg2 vector)) (-> arg2 vector 1) arg0))
(s3-1 (new 'stack-no-clear 'vector))
)
(if (< (vector-segment-distance-point!
arg1
(the-as vector (-> arg2 vector))
(-> arg2 vector 2)
s3-1
)
f30-1
)
(if (< (vector-segment-distance-point! arg1 (the-as vector (-> arg2 vector)) (-> arg2 vector 2) s3-1) f30-1)
(set! (-> arg0 quad) (-> s3-1 quad))
)
)
(goto cfg-24)
(label cfg-22)
(let ((f30-2 (vector-segment-distance-point!
arg1
(-> arg2 vector 2)
(the-as vector (-> arg2 vector))
arg0
)
)
(let ((f30-2 (vector-segment-distance-point! arg1 (-> arg2 vector 2) (the-as vector (-> arg2 vector)) arg0))
(s3-2 (new 'stack-no-clear 'vector))
)
(if (< (vector-segment-distance-point!
arg1
(-> arg2 vector 2)
(-> arg2 vector 1)
s3-2
)
f30-2
)
(if (< (vector-segment-distance-point! arg1 (-> arg2 vector 2) (-> arg2 vector 1) s3-2) f30-2)
(set! (-> arg0 quad) (-> s3-2 quad))
)
)
+53 -68
View File
@@ -7,8 +7,7 @@
;; TODO: document this stuff when doing loader.gc
;; todo: more specific
(define-extern external-art-buffer-init function)
(define-extern external-art-buffer-init (function external-art-buffer int))
(declare-type art basic)
(declare-type art-group art)
@@ -24,7 +23,7 @@
:flag-assert #xb00000010
(:methods
(new (symbol type int level) _type_ 0)
(load-dir-method-9 () none 9)
(load-to-heap-by-name (_type_ string symbol kheap int) art-group 9)
(set-loaded-art (_type_ art-group) art-group 10)
)
)
@@ -61,46 +60,47 @@
)
(deftype external-art-buffer (basic)
((index int32 :offset-assert 4)
(other external-art-buffer :offset-assert 8)
(status symbol :offset-assert 12)
(locked? symbol :offset-assert 16)
(login? symbol :offset-assert 20)
(frame-lock symbol :offset-assert 24)
(init-heap function :offset-assert 28)
(heap kheap :inline :offset-assert 32)
(pending-load-file string :offset-assert 48)
(pending-load-file-part int32 :offset-assert 52)
(pending-load-file-owner handle :offset-assert 56)
(pending-load-file-priority float :offset-assert 64)
(load-file string :offset-assert 68)
(load-file-part int32 :offset-assert 72)
(load-file-owner handle :offset-assert 80)
(load-file-priority float :offset-assert 88)
(buf pointer :offset-assert 92)
(len int32 :offset-assert 96)
(art-group art-group :offset-assert 100)
(art-data uint32 :offset 100)
((index int32 :offset-assert 4)
(other external-art-buffer :offset-assert 8)
(status symbol :offset-assert 12)
(locked? symbol :offset-assert 16)
(login? symbol :offset-assert 20)
(frame-lock symbol :offset-assert 24)
(init-heap (function external-art-buffer object) :offset-assert 28)
(heap kheap :inline :offset-assert 32)
(pending-load-file string :offset-assert 48)
(pending-load-file-part int32 :offset-assert 52)
(pending-load-file-owner handle :offset-assert 56)
(pending-load-file-priority float :offset-assert 64)
(load-file string :offset-assert 68)
(load-file-part int32 :offset-assert 72)
(load-file-owner handle :offset-assert 80)
(load-file-priority float :offset-assert 88)
(buf pointer :offset-assert 92)
(len int32 :offset-assert 96)
(art-group art-group :offset-assert 100)
(art-data uint32 :offset 100)
)
:method-count-assert 16
:size-assert #x68
:flag-assert #x1000000068
(:methods
(new (symbol type int function symbol) _type_ 0)
(external-art-buffer-method-9 () none 9)
(external-art-buffer-method-10 () none 10)
(external-art-buffer-method-11 () none 11)
(external-art-buffer-method-12 () none 12)
(external-art-buffer-method-13 () none 13)
(external-art-buffer-method-14 () none 14)
(external-art-buffer-method-15 () none 15)
(set-pending-file (_type_ string int handle float) int 9)
(update (_type_) int 10)
(inactive? (_type_) symbol 11)
(file-status (_type_ string int) symbol 12)
(link-file (_type_ art-group) art-group 13)
(unlink-file (_type_ art-group) int 14)
(unlock! (_type_) int 15)
)
)
(defmethod new external-art-buffer ((allocation symbol) (type-to-make type) (arg0 int) (arg1 function) (arg2 symbol))
(let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(set! (-> v0-0 index) arg0)
(set! (-> v0-0 init-heap) arg1)
(set! (-> v0-0 init-heap) (the-as (function external-art-buffer object) arg1))
(set! (-> v0-0 login?) arg2)
(set! (-> v0-0 load-file) #f)
(set! (-> v0-0 load-file-part) -1)
@@ -119,19 +119,21 @@
)
(deftype spool-anim (basic)
((name string :offset 16)
(anim-name basic :offset-assert 20)
(parts int32 :offset-assert 24)
(hint-id int32 :offset 24)
(priority float :offset-assert 28)
(owner uint64 :offset-assert 32)
(command-list pair :offset-assert 40)
((name string :offset 16)
(anim-name basic :offset-assert 20)
(buffer external-art-buffer :offset 20)
(parts int32 :offset-assert 24)
(hint-id int32 :offset 24)
(priority float :offset-assert 28)
(owner handle :offset-assert 32)
(command-list pair :offset-assert 40)
)
:method-count-assert 9
:size-assert #x2c
:flag-assert #x90000002c
)
(deftype external-art-control (basic)
((buffer external-art-buffer 2 :offset-assert 4)
(rec spool-anim 3 :inline :offset-assert 16)
@@ -151,14 +153,15 @@
(new (symbol type) _type_ 0)
(update (_type_ symbol) int 9)
(clear-rec (_type_) int 10)
(external-art-control-method-11 () none 11)
(external-art-control-method-12 () none 12)
(external-art-control-method-13 () none 13)
(external-art-control-method-14 () none 14)
(external-art-control-method-15 () none 15)
(spool-push (_type_ string int process float) int 11)
(file-status (_type_ string int) symbol 12)
(reserve-alloc (_type_) kheap 13)
(reserve-free (_type_ kheap) int 14)
(none-reserved? (_type_) symbol 15)
)
)
(defmethod new external-art-control ((allocation symbol) (type-to-make type))
(let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(dotimes (s4-0 2)
@@ -171,7 +174,7 @@
(dotimes (v1-9 3)
(set! (-> gp-0 rec v1-9 name) #f)
(set! (-> gp-0 rec v1-9 priority) 100000000.0)
(set! (-> gp-0 rec v1-9 owner) (the-as uint #f))
(set! (-> gp-0 rec v1-9 owner) (the-as handle #f))
)
(set! (-> gp-0 spool-lock) (the-as handle #f))
(set! (-> gp-0 reserve-buffer) #f)
@@ -195,19 +198,6 @@
:flag-assert #x90000002c
)
(defmethod inspect subtitle-range ((obj subtitle-range))
(when (not obj)
(return obj)
)
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~1Tstart-frame: ~f~%" (-> obj start-frame))
(format #t "~1Tend-frame: ~f~%" (-> obj end-frame))
(format #t "~1Tmessage[8] @ #x~X~%" (-> obj message))
(dotimes (s5-0 8)
(format #t "~T [~D]~1Tmessage: ~`object`P~%" s5-0 (-> obj message s5-0))
)
obj
)
(deftype subtitle-image (basic)
((width uint16 :offset-assert 4)
@@ -220,14 +210,9 @@
:flag-assert #x900000050
)
(defmethod inspect subtitle-image ((obj subtitle-image))
(when (not obj)
(return obj)
)
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~1Twidth: ~D~%" (-> obj width))
(format #t "~1Theight: ~D~%" (-> obj height))
(format #t "~1Tpalette[16] @ #x~X~%" (-> obj palette))
(format #t "~1Tdata[0] @ #x~X~%" (-> obj data))
obj
)
(define-extern *art-control* external-art-control)
File diff suppressed because it is too large Load Diff
+24 -15
View File
@@ -15,17 +15,19 @@
:flag-assert #x900000004
)
(deftype chain-physics-joint (structure)
((position vector :inline :offset-assert 0)
(velocity vector :inline :offset-assert 16)
(old-x vector :inline :offset-assert 32)
(joint-mod basic :offset-assert 48)
((position vector :inline :offset-assert 0)
(velocity vector :inline :offset-assert 16)
(old-x vector :inline :offset-assert 32)
(joint-mod joint-mod :offset-assert 48)
)
:method-count-assert 9
:size-assert #x34
:flag-assert #x900000034
)
(deftype chain-physics (basic)
((chain-joints chain-physics-joint 20 :inline :offset-assert 16)
(num-joints uint8 :offset-assert 1296)
@@ -40,21 +42,28 @@
(negate-y basic :offset-assert 1360)
(axial-slop float :offset-assert 1364)
(maximum-stretch float :offset-assert 1368)
(turn-off-start uint64 :offset-assert 1376)
(turn-off-duration uint64 :offset-assert 1384)
(turn-off-start time-frame :offset-assert 1376)
(turn-off-duration time-frame :offset-assert 1384)
)
:method-count-assert 18
:size-assert #x570
:flag-assert #x1200000570
(:methods
(chain-physics-method-9 () none 9)
(chain-physics-method-10 () none 10)
(chain-physics-method-11 () none 11)
(chain-physics-method-12 () none 12)
(chain-physics-method-13 () none 13)
(chain-physics-method-14 () none 14)
(chain-physics-method-15 () none 15)
(chain-physics-method-16 () none 16)
(chain-physics-method-17 () none 17)
(initialize-chain-joints (_type_) symbol 9)
(turn-off (_type_ time-frame) none :behavior process 10)
(update (_type_ process-drawable) none :behavior process 11)
(gravity-update (_type_) none 12)
(apply-gravity (_type_ vector int) none :behavior process 13)
(chain-physics-method-14 (_type_ vector int) none 14)
(clamp-length (_type_ vector vector) vector 15)
(chain-physics-method-16 (_type_ int) float 16)
(chain-physics-method-17 (_type_ vector) none 17)
)
)
0
@@ -7,3 +7,390 @@
;; DECOMP BEGINS
(defmethod gravity-update chain-physics ((obj chain-physics))
(vector-seek-3d-smooth! (-> obj gravity) (-> obj gravity-target) 0.05 0.1)
0
(none)
)
(defmethod apply-gravity chain-physics ((obj chain-physics) (arg0 vector) (arg1 int))
(vector-float*!
arg0
(-> obj gravity)
(* 4096.0 (-> self clock time-adjust-ratio) (fmax 0.2 (lerp-scale 0.38 0.18 (the float arg1) 0.0 5.0)))
)
0
(none)
)
(defmethod chain-physics-method-14 chain-physics ((obj chain-physics) (arg0 vector) (arg1 int))
(vector-float*!
arg0
(the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ arg1 1) 64)))
(fmin 0.9 (lerp-scale 0.2 1.0 (the float arg1) 0.0 4.0))
)
0
(none)
)
(defmethod clamp-length chain-physics ((obj chain-physics) (arg0 vector) (arg1 vector))
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-! gp-0 arg0 arg1)
(vector-normalize! gp-0 (-> obj joint-length))
(vector+! arg0 gp-0 arg1)
)
)
(defmethod chain-physics-method-16 chain-physics ((obj chain-physics) (arg0 int))
(lerp-scale 5461.3335 10922.667 (the float arg0) 0.0 8.0)
)
(defmethod chain-physics-method-17 chain-physics ((obj chain-physics) (arg0 vector))
0
(none)
)
(defmethod initialize-chain-joints chain-physics ((obj chain-physics))
(set! (-> obj turn-off-start) 0)
(dotimes (s5-0 (the-as int (-> obj num-joints)))
(let ((s4-0 (-> obj chain-joints s5-0)))
(vector<-cspace! (-> s4-0 position) (-> s4-0 joint-mod joint))
(vector-reset! (-> s4-0 velocity))
(mode-set! (-> s4-0 joint-mod) (joint-mod-mode joint-set-world))
)
)
#f
)
(defmethod turn-off chain-physics ((obj chain-physics) (arg0 time-frame))
(set! (-> obj turn-off-start) (-> self clock frame-counter))
(set! (-> obj turn-off-duration) arg0)
0
(none)
)
(defmethod update chain-physics ((obj chain-physics) (arg0 process-drawable))
(local-vars
(v1-77 float)
(f0-11 float)
(sv-272 chain-physics-joint)
(sv-288 vector)
(sv-304 vector)
(sv-320 (function vector float vector))
(sv-336 vector)
(sv-352 vector)
(sv-368 vector)
(sv-384 vector)
(sv-400 vector)
(sv-416 vector)
(sv-432 vector)
(sv-448 (inline-array vector))
(sv-464 (inline-array vector))
(sv-480 (inline-array vector))
(sv-496 vector)
(sv-512 (inline-array vector))
(sv-528 vector)
)
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(gravity-update obj)
(let ((s4-0 (new 'stack-no-clear 'matrix))
(s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg0 node-list data (-> obj root-joint-index))))
(s2-0 (vector-normalize-copy!
(new 'stack-no-clear 'vector)
(-> arg0 node-list data (-> obj root-joint-index) bone transform vector 2)
1.0
)
)
(s1-0 (vector-normalize-copy!
(new 'stack-no-clear 'vector)
(-> arg0 node-list data (-> obj root-joint-index) bone transform vector 1)
1.0
)
)
)
(new 'stack-no-clear 'vector)
(let ((f30-0 1.0))
(if (nonzero? (-> obj turn-off-start))
(set! f30-0
(fmax
0.0
(fmin
1.0
(parameter-ease-sin-clamp (- 1.0 (/ (the float (- (-> self clock frame-counter) (-> obj turn-off-start)))
(the float (-> obj turn-off-duration))
)
)
)
)
)
)
)
(dotimes (s0-0 (the-as int (-> obj num-joints)))
(set! sv-272 (-> obj chain-joints s0-0))
(set! sv-528 (new 'stack-no-clear 'vector))
(let ((v1-27 (-> sv-272 position quad)))
(set! (-> sv-528 quad) v1-27)
)
(set! (-> sv-272 joint-mod flex-blend) f30-0)
(if (-> obj negate-y)
(vector-negate! s1-0 s1-0)
)
(set! sv-288 (new 'stack-no-clear 'vector))
(apply-gravity obj sv-288 s0-0)
(let ((v1-34 sv-528))
(let ((a0-10 sv-528))
(.mov.vf vf6 vf0 :mask #b1000)
(.lvf vf4 (&-> a0-10 quad))
)
(.lvf vf5 (&-> sv-288 quad))
(.add.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> v1-34 quad) vf6)
)
(when (< s0-0 (the-as int (+ (-> obj root-joint-index) -1)))
(set! sv-304 (new 'stack-no-clear 'vector))
(chain-physics-method-14 obj sv-304 s0-0)
(let ((v1-40 sv-528))
(let ((a0-13 sv-528))
(.mov.vf vf6 vf0 :mask #b1000)
(.lvf vf4 (&-> a0-13 quad))
)
(.lvf vf5 (&-> sv-304 quad))
(.add.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> v1-40 quad) vf6)
)
)
(clamp-length obj sv-528 s3-0)
(set! sv-400 (new 'stack-no-clear 'vector))
(let ((v1-43 sv-528)
(a0-16 s3-0)
)
(.lvf vf4 (&-> v1-43 quad))
(.lvf vf5 (&-> a0-16 quad))
)
(.mov.vf vf6 vf0 :mask #b1000)
(.sub.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> sv-400 quad) vf6)
(let ((f28-1 (vector-normalize-ret-len! sv-400 1.0))
(f24-0 (vector-dot sv-400 s1-0))
(f26-0 (chain-physics-method-16 obj s0-0))
)
(when (< f24-0 (cos f26-0))
(vector--float*! sv-400 sv-400 s1-0 f24-0)
(set! sv-320 vector-normalize!)
(set! sv-336 sv-400)
(let ((a1-17 (sin f26-0)))
(sv-320 sv-336 a1-17)
)
(set! sv-384 sv-400)
(set! sv-352 sv-400)
(set! sv-368 s1-0)
(let ((f0-6 (cos f26-0)))
(.lvf vf2 (&-> sv-368 quad))
(.lvf vf1 (&-> sv-352 quad))
(let ((v1-55 f0-6))
(.mov vf3 v1-55)
)
)
(.add.x.vf vf4 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111)
(.svf (&-> sv-384 quad) vf4)
(let ((v1-57 sv-528))
(let ((a0-25 s3-0))
(.lvf vf2 (&-> sv-400 quad))
(.lvf vf1 (&-> a0-25 quad))
)
(let ((a0-26 f28-1))
(.mov vf3 a0-26)
)
(.add.x.vf vf4 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111)
(.svf (&-> v1-57 quad) vf4)
)
)
)
(chain-physics-method-17 obj sv-528)
(set! sv-432 (new 'stack-no-clear 'vector))
(let ((v1-60 s3-0)
(a0-28 sv-528)
)
(.lvf vf4 (&-> v1-60 quad))
(.lvf vf5 (&-> a0-28 quad))
)
(.mov.vf vf6 vf0 :mask #b1000)
(.sub.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> sv-432 quad) vf6)
(vector-normalize-ret-len! sv-432 1.0)
(set! sv-416 (new 'stack-no-clear 'vector))
(let ((v1-63 sv-528)
(a0-31 (-> sv-272 position))
)
(.lvf vf4 (&-> v1-63 quad))
(.lvf vf5 (&-> a0-31 quad))
)
(.mov.vf vf6 vf0 :mask #b1000)
(.sub.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> sv-416 quad) vf6)
(let ((f28-2 (vector-dot sv-432 sv-416)))
(vector--float*! sv-416 sv-416 sv-432 f28-2)
(cond
((< f28-2 0.0)
(set! f0-11 (* f28-2 (-> obj compress-vel-parallel)))
(vector-float*! sv-416 sv-416 (-> obj compress-vel))
)
(else
(set! f0-11 (* f28-2 (-> obj stretch-vel-parallel)))
(vector-float*! sv-416 sv-416 (-> obj stretch-vel))
)
)
)
(let ((v1-72 (-> sv-272 velocity)))
(.lvf vf2 (&-> sv-432 quad))
(.lvf vf1 (&-> sv-416 quad))
(let ((a0-38 f0-11))
(.mov vf3 a0-38)
)
(.add.x.vf vf4 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111)
(.svf (&-> v1-72 quad) vf4)
)
(vector+! sv-528 (-> sv-272 position) (-> sv-272 velocity))
(let ((a2-9 (vector-! (new 'stack-no-clear 'vector) s3-0 sv-528)))
(.lvf vf1 (&-> a2-9 quad))
(.add.w.vf vf2 vf0 vf0 :mask #b1)
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf acc vf2 vf1 :mask #b1)
(.add.mul.y.vf acc vf2 vf1 acc :mask #b1)
(.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1)
(.mov v1-77 vf1)
(let* ((f0-13 v1-77)
(f1-6 (* (-> obj maximum-stretch) (-> obj joint-length)))
(f2-3 f1-6)
)
(if (< (* f2-3 f2-3) f0-13)
(vector--float*! sv-528 s3-0 a2-9 (/ f1-6 (sqrtf f0-13)))
)
)
)
(set! (-> sv-272 position quad) (-> sv-528 quad))
(if (-> sv-272 joint-mod)
(set! (-> sv-272 joint-mod trans quad) (-> sv-528 quad))
)
(when (< s0-0 (the-as int (-> obj num-joints)))
(vector-! (-> s4-0 vector 1) sv-528 s3-0)
(vector-normalize! (-> s4-0 vector 1) 1.0)
(if (-> obj negate-y)
(vector-negate! (-> s4-0 vector 1) (-> s4-0 vector 1))
)
(vector-cross! (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) s2-0)
(vector-normalize! (the-as vector (-> s4-0 vector)) 1.0)
(set! sv-496 (new 'stack-no-clear 'vector))
(let ((v1-96 (-> sv-272 old-x))
(a0-52 (-> s4-0 vector))
)
(.lvf vf1 (&-> v1-96 quad))
(.lvf vf2 (&-> a0-52 0 quad))
)
(.outer.product.a.vf acc vf1 vf2)
(.outer.product.b.vf vf3 vf2 vf1 acc)
(.svf (&-> sv-496 quad) vf3)
(vector-flatten! sv-496 (-> sv-272 old-x) (-> s4-0 vector 1))
(vector-normalize! sv-496 1.0)
(cond
((< (vector-dot (the-as vector (-> s4-0 vector)) sv-496) (cos (-> obj axial-slop)))
(vector-cross! sv-496 sv-496 (the-as vector (-> s4-0 vector)))
(vector-cross! sv-496 (the-as vector (-> s4-0 vector)) sv-496)
(vector-normalize! sv-496 1.0)
(set! sv-464 (-> s4-0 vector))
(set! sv-448 (-> s4-0 vector))
(let ((f0-20 (cos (-> obj axial-slop))))
(.lvf vf1 (&-> sv-448 0 quad))
(let ((v1-106 f0-20))
(.mov vf2 v1-106)
)
)
(.add.x.vf vf1 vf0 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> sv-464 0 quad) vf1)
(set! sv-512 (-> s4-0 vector))
(set! sv-480 (-> s4-0 vector))
(let ((f0-22 (sin (-> obj axial-slop))))
(.lvf vf2 (&-> sv-496 quad))
(.lvf vf1 (&-> sv-480 0 quad))
(let ((v1-112 f0-22))
(.mov vf3 v1-112)
)
)
(.add.x.vf vf4 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111)
(.svf (&-> sv-512 0 quad) vf4)
(set! (-> sv-272 old-x quad) (-> s4-0 vector 0 quad))
)
(else
(set! (-> s4-0 vector 0 quad) (-> sv-496 quad))
(set! (-> sv-272 old-x quad) (-> s4-0 vector 0 quad))
)
)
(vector-cross! (-> s4-0 vector 2) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1))
(matrix->quaternion (-> sv-272 joint-mod quat) s4-0)
(set! (-> s1-0 quad) (-> s4-0 vector 1 quad))
(set! (-> s2-0 quad) (-> s4-0 vector 2 quad))
0
)
(set! (-> s3-0 quad) (-> sv-528 quad))
0
)
)
)
0
(none)
)
)
(defmethod relocate chain-physics ((obj chain-physics) (arg0 int))
(dotimes (v1-0 (the-as int (-> obj num-joints)))
(if (nonzero? (-> obj chain-joints v1-0 joint-mod))
(&+! (-> obj chain-joints v1-0 joint-mod) arg0)
)
)
obj
)
(defun chain-physics-initialize ((arg0 process-drawable) (arg1 chain-physics) (arg2 int) (arg3 float) (arg4 (array chain-physics-setup)))
(set! (-> arg1 num-joints) (the-as uint (min 20 (-> arg4 length))))
(dotimes (s1-0 (the-as int (-> arg1 num-joints)))
(set! (-> arg1 chain-joints s1-0 joint-mod)
(new 'process 'joint-mod (joint-mod-mode flex-blend) arg0 (-> arg4 s1-0 joint-index))
)
(set! (-> arg1 chain-joints s1-0 joint-mod track-mode) (track-mode no-scale))
)
(set! (-> arg1 root-joint-index) (the-as uint arg2))
(set! (-> arg1 joint-length) arg3)
(set-vector! (-> arg1 gravity) 0.0 -1.0 0.0 1.0)
(set! (-> arg1 gravity-target quad) (-> arg1 gravity quad))
(set! (-> arg1 stretch-vel) 0.7)
(set! (-> arg1 stretch-vel-parallel) 0.8)
(set! (-> arg1 compress-vel) 0.85)
(set! (-> arg1 compress-vel-parallel) 0.75)
(set! (-> arg1 negate-y) #f)
(set! (-> arg1 axial-slop) 3640.889)
(set! (-> arg1 maximum-stretch) 1.5)
(set! (-> arg1 turn-off-start) 0)
0
)
@@ -8,6 +8,12 @@
(define-extern cspace-by-name (function process-drawable string cspace))
(define-extern cspace-index-by-name (function process-drawable string int))
(define-extern joint-control-reset! (function joint-control joint-control-channel none :behavior process-drawable))
(define-extern ja-channel-push! (function int time-frame int :behavior process-drawable))
(define-extern ja-channel-set! (function int int :behavior process-drawable))
(define-extern ja-aframe-num (function int float :behavior process-drawable))
(define-extern ja-frame-num (function int float :behavior process-drawable))
(define-extern ja-aframe (function float int float :behavior process-drawable))
(define-extern vector<-matrix! (function vector matrix vector))
;; DECOMP BEGINS
@@ -42,11 +48,11 @@
)
)
(defun num-func-none ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func-none process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(-> arg0 frame-num)
)
(defun num-func-+! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func-+! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(with-pp
(let ((f0-1 (+ (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio))))))
(set! (-> arg0 frame-num) f0-1)
@@ -55,7 +61,7 @@
)
)
(defun num-func--! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func--! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(with-pp
(let ((f0-1 (- (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio))))))
(set! (-> arg0 frame-num) f0-1)
@@ -64,7 +70,7 @@
)
)
(defun num-func-loop! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func-loop! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(with-pp
(let* ((f0-1 (the float (+ (-> arg0 frame-group frames num-frames) -1)))
(f1-2 (+ (-> arg0 frame-num) f0-1 (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio)))))
@@ -76,7 +82,7 @@
)
)
(defun num-func-loop-speedless! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func-loop-speedless! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(let* ((f0-1 (the float (+ (-> arg0 frame-group frames num-frames) -1)))
(f1-2 (+ (-> arg0 frame-num) f0-1 arg1))
(f0-3 (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)))
@@ -86,7 +92,7 @@
)
)
(defun num-func-seek! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func-seek! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(with-pp
(let ((f0-3
(seek (-> arg0 frame-num) arg1 (* arg2 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio))))
@@ -98,7 +104,7 @@
)
)
(defun num-func-blend-in! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func-blend-in! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(with-pp
(let ((f30-0 (seek (-> arg0 frame-interp 0) 1.0 (* arg1 (-> pp clock time-adjust-ratio)))))
(set! (-> arg0 frame-interp 0) f30-0)
@@ -130,7 +136,7 @@
(none)
)
(defun num-func-interp-play! ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(defbehavior num-func-interp-play! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(with-pp
(let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1)))
(f28-0 (* arg3 (-> arg0 frame-group speed)))
@@ -157,7 +163,7 @@
)
)
(defun num-func-interp1-play! ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(defbehavior num-func-interp1-play! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(with-pp
(let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1)))
(f28-0 (* arg3 (-> arg0 frame-group speed)))
@@ -183,7 +189,7 @@
)
)
(defun num-func-chan ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func-chan process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(let ((f0-2
(-> (the-as joint-control-channel (+ (the-as uint arg0) (* (- (the int arg1) (-> arg0 group-sub-index)) 64)))
frame-num
@@ -195,6 +201,138 @@
)
)
(defun num-func-identity ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func-identity process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(-> arg0 frame-num)
)
;; these are mostly the same as jak 1?
(defmacro ja-group (&key (chan 0))
"get the frame group for self. default channel is 0, the base channel. returns #f if no frame group."
`(if (> (-> self skel active-channels) ,chan)
(-> self skel root-channel ,chan frame-group))
)
(defmacro ja-group? (group &key (chan 0))
"is self in this frame group on this channel? default is channel 0, which is the base channel."
`(= (ja-group) ,group)
)
(defmacro ja (&key (chan 0)
&key (group! #f)
&key (num! #f)
&key (param0 #f)
&key (param1 #f)
&key (num-func #f)
&key (frame-num #f)
&key (frame-interp #f)
&key (dist #f)
&key (eval? #t)
)
"set various joint anim parameters for self and eval them.
you can use this for playing animations!
chan = the channel to modify. defaults to 0 (base channel). this is usually what you want.
group! = when not #f, set this as the new frame-group. defaults to #f
num! = set the frame playback function. this is what determines what frame an animation is at. funcs below.
#f = no func will be set, and there wont be a frame eval.
num-func = sets the num-func field for the channel. this lets you change the function with eval'ing.
param0 = 1st parameter for the playback function. ONLY USE THESE WITH num-func !!
param1 = 2nd parameter for the playback function. ONLY USE THESE WITH num-func !!
frame-num = set the frame-num field.
frame-interp = set the frame-interp field.
dist = set the dist field.
available num! functions:
- (+!) = advance anim.
- (-!) = reverse anim.
- (identity num) = play 'num' frame.
- (seek! target speed) = animate towards frame target at a speed.
speed is optional and defaults to 1.0 when not provided.
target is optional and defaults to the last frame of the animation.
if you want to set the speed, you therefore must also set the target.
target can be max (no quote), which is just the same as the default value.
- (loop! speed) = loop animation at a speed. default speed is 1.0 when not provided.
- (chan channel) = copy frame from another channel.
- min = the start of the animation.
- max = the end of the animation.
"
(let* ((num-args (if (pair? num!) (cdr num!) '()))
(num! (if (pair? num!) (car num!) num!))
(nf (cond
((or (eq? num! 'identity)
(eq? num! 'min)
(eq? num! 'max)
)
'num-func-identity)
((eq? num! 'none) 'num-func-none)
((eq? num! '+!) 'num-func-+!)
((eq? num! '-!) 'num-func--!)
((eq? num! 'seek!) 'num-func-seek!)
((eq? num! 'loop!) 'num-func-loop!)
((eq? num! 'blend-in!) 'num-func-blend-in!)
((eq? num! 'chan) 'num-func-chan)
))
(p0 (if param0 param0
(cond
((eq? num! 'chan) `(the float ,(car num-args)))
((eq? num! '+!) (if (null? num-args) 1.0 (car num-args)))
((eq? num! '-!) (if (null? num-args) 1.0 (car num-args)))
((eq? num! 'loop!) (if (null? num-args) 1.0 (if (eq? 'max (car num-args))
(if group!
`(the float (1- (-> (the art-joint-anim ,group!) frames num-frames)))
`(the float (1- (-> ja-ch frame-group frames num-frames)))
)
(car num-args))))
((eq? num! 'seek!) (if (or (null? num-args) (eq? (car num-args) 'max))
(if group!
`(the float (1- (-> (the art-joint-anim ,group!) frames num-frames)))
`(the float (1- (-> ja-ch frame-group frames num-frames)))
)
(car num-args)))
)))
(p1 (if param1 param1
(cond
((eq? num! 'seek!) (if (or (null? num-args) (null? (cdr num-args))) 1.0 (cadr num-args)))
)))
(frame-num (if (eq? 'max frame-num) (if group!
`(the float (1- (-> (the art-joint-anim ,group!) frames num-frames)))
`(the float (1- (-> ja-ch frame-group frames num-frames)))
)
frame-num))
(frame-group (if (or p0 p1 frame-num (not nf)) group! #f))
)
`(let ((ja-ch (-> self skel root-channel ,chan)))
,(if frame-interp `(set! (-> ja-ch frame-interp) ,frame-interp) `(none))
,(if dist `(set! (-> ja-ch dist) ,dist) `(none))
,(if frame-group `(set! (-> ja-ch frame-group) (the art-joint-anim ,frame-group)) `(none))
,(if p0 `(set! (-> ja-ch param 0) ,p0) `(none))
,(if p1 `(set! (-> ja-ch param 1) ,p1) `(none))
,(if num-func `(set! (-> ja-ch num-func) ,num-func) `(none))
,(if frame-num `(set! (-> ja-ch frame-num) ,frame-num) `(none))
,(if nf
`(,(if eval? 'joint-control-channel-group-eval! 'joint-control-channel-group!)
ja-ch (the art-joint-anim ,group!) ,nf)
`(none))
,(cond
((eq? num! 'min) `(set! (-> ja-ch frame-num) 0.0))
((eq? num! 'max) (if group!
`(set! (-> ja-ch frame-num) (the float (1- (-> (the art-joint-anim ,group!) frames num-frames))))
`(set! (-> ja-ch frame-num) (the float (1- (-> ja-ch frame-group frames num-frames))))
))
((eq? num! 'identity) `(set! (-> ja-ch frame-num) ,(car num-args)))
(#t `(none))
)
))
)
(defmacro ja-no-eval (&key (chan 0)
&key (group! #f)
&key (num! #f)
&key (param0 #f)
&key (param1 #f)
&key (num-func #f)
&key (frame-num #f)
&key (frame-interp #f)
&key (dist #f)
)
`(ja :eval? #f :chan ,chan :group! ,group! :num! ,num! :param0 ,param0 :param1 ,param1 :num-func ,num-func :frame-num ,frame-num :frame-interp ,frame-interp :dist ,dist)
)
@@ -15,5 +15,28 @@
obj
)
(defun vector<-matrix! ((arg0 vector) (arg1 matrix))
(rlet ((Q :class vf)
(vf0 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(.lvf vf2 (&-> arg1 trans quad))
(.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11)
(.wait.vf)
(.mul.vf vf2 vf2 Q :mask #b111)
(.nop.vf)
(.nop.vf)
(.mov.vf vf2 vf0 :mask #b1000)
(.svf (&-> arg0 quad) vf2)
arg0
)
)
;; DECOMP BEGINS
;; ERROR: top level function was not converted to expressions. Cannot decompile.
+10 -8
View File
@@ -98,14 +98,16 @@
(defenum stream-status
:type uint32
:bitfield #t
(zero 0)
(one 1) ;; another way to be playing
(two 2)
(three 3)
(four 4) ;; is playing?
(five 5)
(six 6) ;; another way to be playing.
(seven 7)
(ststatus-zero 0)
(ststatus-one 1) ;; another way to be playing
(ststatus-two 2)
(ststatus-three 3)
(ststatus-four 4) ;; is playing?
(ststatus-five 5)
(ststatus-six 6) ;; another way to be playing.
(ststatus-seven 7)
(ststatus-eight 8)
(ststatus-nine 9)
)
(defenum stereo-mode
+4 -3
View File
@@ -60,7 +60,8 @@
(stream-position uint32 4 :offset 272)
(stream-status stream-status 4 :offset-assert 288)
(stream-name sound-stream-name 4 :inline :offset-assert 304)
(stream-id uint32 4 :offset-assert 496)
(stream-id sound-id 4 :offset-assert 496)
(stream-id-int32 int32 4 :overlay-at stream-id)
(music-register uint8 17 :offset-assert 512)
(music-excite int8 :offset 528)
(ramdisk-name uint8 48 :offset-assert 529)
@@ -75,7 +76,7 @@
(defun str-is-playing? ()
(countdown (v1-0 4)
(if (and (>= (-> *sound-iop-info* stream-id v1-0) 0)
(logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status four))
(logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status ststatus-four))
)
(return #t)
)
@@ -86,7 +87,7 @@
(defun str-id-is-playing? ((arg0 int))
(countdown (v1-0 4)
(if (and (= arg0 (-> *sound-iop-info* stream-id v1-0))
(logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status one six))
(logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status ststatus-one ststatus-six))
)
(return #t)
)
+1
View File
@@ -294,5 +294,6 @@
)
(define-extern *bigmap* bigmap)
+35 -21
View File
@@ -78,8 +78,8 @@
(channel gui-channel :offset 21)
(anim-part uint8 :offset 22)
(flags uint8 :offset 23)
(name object :offset 24)
(id uint32 :offset 28)
(name string :offset 24)
(id sound-id :offset 28)
(handle handle :offset 0)
(time-stamp time-frame :offset 8)
(hold-time time-frame :offset-assert 32)
@@ -94,29 +94,43 @@
:flag-assert #xe00000030
)
(deftype gui-control (basic)
((engine engine :offset-assert 4)
(data uint8 3272 :offset-assert 8)
((engine engine :offset-assert 4)
(update-time time-frame :offset-assert 8)
(connections gui-connection 32 :inline :offset-assert 16)
(spool-connections gui-connection 4 :inline :offset-assert 1552)
(ids sound-id 96 :offset-assert 1744)
(times time-frame 96 :offset-assert 2128)
(cmd pair 96 :offset-assert 2896)
)
:method-count-assert 25
:size-assert #xcd0
:flag-assert #x1900000cd0
(:methods
(gui-control-method-9 () none 9)
(gui-control-method-10 () none 10)
(gui-control-method-11 () none 11)
(gui-control-method-12 () none 12)
(update (_type_ symbol) none 13)
(gui-control-method-14 () none 14)
(gui-control-method-15 () none 15)
(gui-control-method-16 () none 16)
(gui-control-method-17 () none 17)
(gui-control-method-18 () none 18)
(gui-control-method-19 () none 19)
(gui-control-method-20 () none 20)
(gui-control-method-21 () none 21)
(gui-control-method-22 () none 22)
(gui-control-method-23 () none 23)
(gui-control-method-24 () none 24)
(new (symbol type int) _type_ 0)
(gui-control-method-9 (_type_ process gui-channel gui-action int float time-frame) sound-id 9)
(gui-control-method-10 (_type_ process gui-channel) none 10)
(gui-control-method-11 (_type_ gui-connection) int 11)
(gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id 12)
(update (_type_ symbol) int 13)
(gui-control-method-14 (_type_ string gui-channel gui-action) int 14)
(gui-control-method-15 (_type_ process gui-channel string sound-id) gui-connection 15)
(gui-control-method-16 (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int 16)
(gui-control-method-17 (_type_ sound-id) gui-action 17)
(gui-control-method-18 (_type_ gui-channel) symbol 18)
(gui-control-method-19 (_type_ gui-channel gui-connection) symbol 19)
(gui-control-method-20 (_type_ sound-id symbol int int int) gui-connection 20)
(gui-control-method-21 (_type_ gui-connection vector) int 21)
(gui-control-method-22 (_type_ gui-connection process symbol) none 22)
(gui-control-method-23 (_type_ gui-channel gui-channel symbol gui-connection) symbol 23)
(channel-id-set! (_type_ gui-connection sound-id) int 24)
)
)
)
(define-extern *gui-control* gui-control)
+3 -1
View File
@@ -86,7 +86,7 @@
(define-extern process-level-heap kheap) ;; not a kheap at boot
(define-extern stack symbol)
(define-extern scratch symbol)
(define-extern *stratch-top* pointer)
(define-extern *scratch-top* pointer)
(define-extern zero-func (function int))
;; InitHeapAndSymbol
@@ -102,6 +102,8 @@
(define-extern dgo-load (function string kheap link-flag int none))
(define-extern malloc (function symbol int pointer))
(define-extern loado (function string kheap object))
(define-extern link (function pointer pointer int kheap int pointer))
(declare-type cpad-info basic)
(define-extern cpad-open (function cpad-info int cpad-info))
+4
View File
@@ -0,0 +1,4 @@
@echo off
cd ..\..
out\build\Release\bin\goalc --auto-lt --user-auto
pause
-4
View File
@@ -1,4 +0,0 @@
@echo off
cd ..\..
out\build\Release\bin\goalc --user-auto
pause
+1 -1
View File
@@ -1,4 +1,4 @@
@echo off
cd ..\..
out\build\Release\bin\goalc --auto-lt --user-auto
out\build\Release\bin\goalc --user-auto
pause
+4
View File
@@ -0,0 +1,4 @@
@echo off
cd ..\..
out\build\Release\bin\goalc --user-auto --game jak2
pause
+1 -1
View File
@@ -1,2 +1,2 @@
cd ..\..
git update-index --assume-unchanged decompiler\config\jak1_ntsc_black_label.jsonc
git update-index --assume-unchanged decompiler\config\jak1_ntsc_black_label.jsonc decompiler\config\jak2_ntsc_v1.jsonc
+1 -1
View File
@@ -1,2 +1,2 @@
cd ..\..
git update-index --no-assume-unchanged decompiler\config\jak1_ntsc_black_label.jsonc
git update-index --no-assume-unchanged decompiler\config\jak1_ntsc_black_label.jsonc decompiler\config\jak2_ntsc_v1.jsonc
+4
View File
@@ -0,0 +1,4 @@
@echo off
cd ..\..
out\build\Release\bin\goalc-test --gtest_filter="Jak2TypeConsistency.TypeConsistency"
pause
@@ -0,0 +1,6 @@
@echo off
cd ..\..
out\build\Release\bin\offline-test -d --iso_data_path iso_data\jak2\ --game jak2
scripts\update_decomp_reference.py failures\ test\decompiler\reference\
RMDIR /Q/S failures
pause
+132
View File
@@ -766,3 +766,135 @@
"Helper macro for casting the result of get-art-by-name-method. Generated by decompiler."
`(the-as ,type (get-art-by-name-method ,obj ,name ,type))
)
(defmacro ja-group (&key (chan 0))
"get the frame group for self. default channel is 0, the base channel. returns #f if no frame group."
`(if (> (-> self skel active-channels) ,chan)
(-> self skel root-channel ,chan frame-group))
)
(defmacro ja-group? (group &key (chan 0))
"is self in this frame group on this channel? default is channel 0, which is the base channel."
`(= (ja-group) ,group)
)
(defmacro ja (&key (chan 0)
&key (group! #f)
&key (num! #f)
&key (param0 #f)
&key (param1 #f)
&key (num-func #f)
&key (frame-num #f)
&key (frame-interp #f)
&key (dist #f)
&key (eval? #t)
)
"set various joint anim parameters for self and eval them.
you can use this for playing animations!
chan = the channel to modify. defaults to 0 (base channel). this is usually what you want.
group! = when not #f, set this as the new frame-group. defaults to #f
num! = set the frame playback function. this is what determines what frame an animation is at. funcs below.
#f = no func will be set, and there wont be a frame eval.
num-func = sets the num-func field for the channel. this lets you change the function with eval'ing.
param0 = 1st parameter for the playback function. ONLY USE THESE WITH num-func !!
param1 = 2nd parameter for the playback function. ONLY USE THESE WITH num-func !!
frame-num = set the frame-num field.
frame-interp = set the frame-interp field.
dist = set the dist field.
available num! functions:
- (+!) = advance anim.
- (-!) = reverse anim.
- (identity num) = play 'num' frame.
- (seek! target speed) = animate towards frame target at a speed.
speed is optional and defaults to 1.0 when not provided.
target is optional and defaults to the last frame of the animation.
if you want to set the speed, you therefore must also set the target.
target can be max (no quote), which is just the same as the default value.
- (loop! speed) = loop animation at a speed. default speed is 1.0 when not provided.
- (chan channel) = copy frame from another channel.
- min = the start of the animation.
- max = the end of the animation.
"
(let* ((num-args (if (pair? num!) (cdr num!) '()))
(num! (if (pair? num!) (car num!) num!))
(nf (cond
((or (eq? num! 'identity)
(eq? num! 'min)
(eq? num! 'max)
)
'num-func-identity)
((eq? num! 'none) 'num-func-none)
((eq? num! '+!) 'num-func-+!)
((eq? num! '-!) 'num-func--!)
((eq? num! 'seek!) 'num-func-seek!)
((eq? num! 'loop!) 'num-func-loop!)
((eq? num! 'blend-in!) 'num-func-blend-in!)
((eq? num! 'chan) 'num-func-chan)
))
(p0 (if param0 param0
(cond
((eq? num! 'chan) `(the float ,(car num-args)))
((eq? num! '+!) (if (null? num-args) 1.0 (car num-args)))
((eq? num! '-!) (if (null? num-args) 1.0 (car num-args)))
((eq? num! 'loop!) (if (null? num-args) 1.0 (if (eq? 'max (car num-args))
(if group!
`(the float (1- (-> (the art-joint-anim ,group!) frames num-frames)))
`(the float (1- (-> ja-ch frame-group frames num-frames)))
)
(car num-args))))
((eq? num! 'seek!) (if (or (null? num-args) (eq? (car num-args) 'max))
(if group!
`(the float (1- (-> (the art-joint-anim ,group!) frames num-frames)))
`(the float (1- (-> ja-ch frame-group frames num-frames)))
)
(car num-args)))
)))
(p1 (if param1 param1
(cond
((eq? num! 'seek!) (if (or (null? num-args) (null? (cdr num-args))) 1.0 (cadr num-args)))
)))
(frame-num (if (eq? 'max frame-num) (if group!
`(the float (1- (-> (the art-joint-anim ,group!) frames num-frames)))
`(the float (1- (-> ja-ch frame-group frames num-frames)))
)
frame-num))
(frame-group (if (or p0 p1 frame-num (not nf)) group! #f))
)
`(let ((ja-ch (-> self skel root-channel ,chan)))
,(if frame-interp `(set! (-> ja-ch frame-interp) ,frame-interp) `(none))
,(if dist `(set! (-> ja-ch dist) ,dist) `(none))
,(if frame-group `(set! (-> ja-ch frame-group) (the art-joint-anim ,frame-group)) `(none))
,(if p0 `(set! (-> ja-ch param 0) ,p0) `(none))
,(if p1 `(set! (-> ja-ch param 1) ,p1) `(none))
,(if num-func `(set! (-> ja-ch num-func) ,num-func) `(none))
,(if frame-num `(set! (-> ja-ch frame-num) ,frame-num) `(none))
,(if nf
`(,(if eval? 'joint-control-channel-group-eval! 'joint-control-channel-group!)
ja-ch (the art-joint-anim ,group!) ,nf)
`(none))
,(cond
((eq? num! 'min) `(set! (-> ja-ch frame-num) 0.0))
((eq? num! 'max) (if group!
`(set! (-> ja-ch frame-num) (the float (1- (-> (the art-joint-anim ,group!) frames num-frames))))
`(set! (-> ja-ch frame-num) (the float (1- (-> ja-ch frame-group frames num-frames))))
))
((eq? num! 'identity) `(set! (-> ja-ch frame-num) ,(car num-args)))
(#t `(none))
)
))
)
(defmacro ja-no-eval (&key (chan 0)
&key (group! #f)
&key (num! #f)
&key (param0 #f)
&key (param1 #f)
&key (num-func #f)
&key (frame-num #f)
&key (frame-interp #f)
&key (dist #f)
)
`(ja :eval? #f :chan ,chan :group! ,group! :num! ,num! :param0 ,param0 :param1 ,param1 :num-func ,num-func :frame-num ,frame-num :frame-interp ,frame-interp :dist ,dist)
)
+72 -71
View File
@@ -3,56 +3,56 @@
;; definition of type joint-mod
(deftype joint-mod (basic)
((mode joint-mod-mode :offset-assert 4)
(process process :offset-assert 8)
(joint cspace :offset-assert 12)
(target vector :inline :offset 16)
(twist vector :inline :offset 32)
(twist-max float 4 :offset-assert 48)
(extra-twist degrees :offset 40)
(track-mode track-mode :offset 44)
(loock-at-count uint16 :offset 46)
(twist-range-x meters :offset 56)
(twist-range-y meters :offset 60)
(twist-speed-x float :offset 64)
(twist-speed-y float :offset 68)
(twist-min-x float :offset 72)
(twist-min-y float :offset 76)
(trans vector :inline :offset-assert 80)
(shmushy-old float :offset 80)
(smushy-off float :offset 84)
(smushyv float :offset 88)
(quat quaternion :inline :offset-assert 96)
(scale vector :inline :offset-assert 112)
(notice-time time-frame :offset-assert 128)
(flex-blend float :offset-assert 136)
(blend float :offset-assert 140)
(max-dist meters :offset-assert 144)
(ignore-angle degrees :offset-assert 148)
(up uint8 :offset-assert 152)
(nose uint8 :offset-assert 153)
(ear uint8 :offset-assert 154)
(base-joint uint8 :offset-assert 155)
(base-nose uint8 :offset-assert 156)
(shutting-down? symbol :offset-assert 160)
(parented-scale? symbol :offset-assert 164)
(polar-internal-tilt-max float :offset-assert 168)
(polar-internal-radius float :offset-assert 172)
(polar-external-tilt-max float :offset-assert 176)
(polar-external-radius float :offset-assert 180)
((mode joint-mod-mode :offset-assert 4)
(process process-drawable :offset-assert 8)
(joint cspace :offset-assert 12)
(target vector :inline :offset-assert 16)
(twist vector :inline :offset-assert 32)
(twist-max vector :inline :offset-assert 48)
(extra-twist degrees :offset 40)
(track-mode track-mode :offset 44)
(loock-at-count uint16 :offset 46)
(twist-range-x meters :offset 56)
(twist-range-y meters :offset 60)
(twist-speed-x float :offset 64)
(twist-speed-y float :offset 68)
(twist-min-x float :offset 72)
(twist-min-y float :offset 76)
(trans vector :inline :offset-assert 80)
(shmushy-old float :offset 80)
(smushy-off float :offset 84)
(smushyv float :offset 88)
(quat quaternion :inline :offset-assert 96)
(scale vector :inline :offset-assert 112)
(notice-time time-frame :offset-assert 128)
(flex-blend float :offset-assert 136)
(blend float :offset-assert 140)
(max-dist meters :offset-assert 144)
(ignore-angle degrees :offset-assert 148)
(up uint8 :offset-assert 152)
(nose uint8 :offset-assert 153)
(ear uint8 :offset-assert 154)
(base-joint uint8 :offset-assert 155)
(base-nose uint8 :offset-assert 156)
(shutting-down? symbol :offset-assert 160)
(parented-scale? symbol :offset-assert 164)
(polar-internal-tilt-max float :offset-assert 168)
(polar-internal-radius float :offset-assert 172)
(polar-external-tilt-max float :offset-assert 176)
(polar-external-radius float :offset-assert 180)
)
:method-count-assert 16
:size-assert #xb8
:flag-assert #x10000000b8
(:methods
(new (symbol type joint-mod-mode process-drawable int) _type_ 0)
(joint-mod-method-9 () none 9)
(joint-mod-method-10 () none 10)
(joint-mod-method-11 () none 11)
(mode-set! (_type_ joint-mod-mode) none 9)
(target-set! (_type_ vector) none 10)
(look-at! (_type_ vector symbol process) none :behavior process 11)
(reset-blend! (_type_) _type_ 12)
(joint-mod-method-13 () none 13)
(joint-mod-method-14 () none 14)
(joint-mod-method-15 () none 15)
(twist-set! (_type_ float float float) vector 13)
(trs-set! (_type_ vector quaternion vector) none 14)
(shut-down (_type_) none 15)
)
)
@@ -96,8 +96,8 @@
)
(format #t ")~%")
(format #t "~1Tlook-at-count: ~D~%" (-> obj loock-at-count))
(format #t "~1Ttwist-range-x: (meters ~m)~%" (-> obj twist-range-x))
(format #t "~1Ttwist-range-y: (meters ~m)~%" (-> obj twist-range-y))
(format #t "~1Ttwist-range-x: (meters ~m)~%" (-> obj twist-max z))
(format #t "~1Ttwist-range-y: (meters ~m)~%" (-> obj twist-max w))
(format #t "~1Ttwist-speed-x: ~f~%" (-> obj twist-speed-x))
(format #t "~1Ttwist-speed-y: ~f~%" (-> obj twist-speed-y))
(format #t "~1Ttwist-min-x: ~f~%" (-> obj twist-min-x))
@@ -613,12 +613,12 @@
;; definition of type joint-mod-blend-world
(deftype joint-mod-blend-world (basic)
((transform transformq :inline :offset-assert 16)
(blend-transform transformq :inline :offset-assert 64)
(blend-flags uint32 :offset-assert 112)
(node-index int32 :offset-assert 116)
(blend float :offset-assert 120)
(enable symbol :offset-assert 124)
((transform transformq :inline :offset-assert 16)
(blend-transform transformq :inline :offset-assert 64)
(blend-flags joint-mod-blend-flags :offset-assert 112)
(node-index int32 :offset-assert 116)
(blend float :offset-assert 120)
(enable symbol :offset-assert 124)
)
:method-count-assert 9
:size-assert #x80
@@ -656,17 +656,17 @@
(let ((gp-0 (the-as joint-mod-blend-world (-> arg0 param1))))
(cond
((-> gp-0 enable)
(let ((f30-0 (if (logtest? (-> gp-0 blend-flags) 1)
(let ((f30-0 (if (logtest? (-> gp-0 blend-flags) (joint-mod-blend-flags trans))
(-> gp-0 blend)
0.0
)
)
(f28-0 (if (logtest? (-> gp-0 blend-flags) 2)
(f28-0 (if (logtest? (-> gp-0 blend-flags) (joint-mod-blend-flags scale))
(-> gp-0 blend)
0.0
)
)
(f26-0 (if (logtest? (-> gp-0 blend-flags) 4)
(f26-0 (if (logtest? (-> gp-0 blend-flags) (joint-mod-blend-flags rotation))
(-> gp-0 blend)
0.0
)
@@ -794,28 +794,29 @@
;; definition of type joint-mod-ik
(deftype joint-mod-ik (basic)
((flags uint32 :offset-assert 4)
(process basic :offset-assert 8)
(hand-dist float :offset-assert 12)
(handle-pos vector :inline :offset-assert 16)
(elbow-pole-vector-axis uint32 :offset-assert 32)
(elbow-rotation-axis uint32 :offset-assert 36)
(user-position vector :inline :offset-assert 48)
(user-normal vector :inline :offset-assert 64)
(user-blend float :offset-assert 80)
(user-float float :offset-assert 84)
(callback basic :offset-assert 88)
(shoulder-matrix-no-ik matrix :inline :offset-assert 96)
(elbow-matrix-no-ik matrix :inline :offset-assert 160)
(blend float :offset-assert 224)
(blend-interp float :offset-assert 228)
((flags joint-mod-ik-flags :offset-assert 4)
(process process-drawable :offset-assert 8)
(hand-dist float :offset-assert 12)
(handle-pos vector :inline :offset-assert 16)
(elbow-pole-vector-axis uint32 :offset-assert 32)
(elbow-rotation-axis uint32 :offset-assert 36)
(user-position vector :inline :offset-assert 48)
(user-normal vector :inline :offset-assert 64)
(user-blend float :offset-assert 80)
(user-float float :offset-assert 84)
(callback (function joint-mod-ik matrix matrix vector object) :offset-assert 88)
(shoulder-matrix-no-ik matrix :inline :offset-assert 96)
(elbow-matrix-no-ik matrix :inline :offset-assert 160)
(blend float :offset-assert 224)
(blend-interp float :offset-assert 228)
)
:method-count-assert 11
:size-assert #xe8
:flag-assert #xb000000e8
(:methods
(joint-mod-ik-method-9 () none 9)
(joint-mod-ik-method-10 () none 10)
(new (symbol type process-drawable int float) _type_ 0)
(handle-copy! (_type_ vector) none 9)
(enable-set! (_type_ symbol) none 10)
)
)
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -351,7 +351,7 @@
(:methods
(relocate (_type_ kheap (pointer uint8)) none :replace 7)
(link-art! (_type_) art-group 13)
(art-group-method-14 () none 14)
(unlink-art! (_type_) int 14)
)
)
+7 -7
View File
@@ -130,13 +130,13 @@
(want-sound-banks (_type_ (pointer symbol)) none 12)
(want-display-level (_type_ symbol symbol) int 13)
(want-vis-level (_type_ symbol) none 14)
(load-state-method-15 () none 15)
(load-state-method-16 () none 16)
(load-state-method-17 () none 17)
(load-state-method-18 () none 18)
(load-state-method-19 () none 19)
(load-state-method-20 () none 20)
(load-state-method-21 () none 21)
(want-force-vis (_type_ symbol symbol) int 15)
(execute-command (_type_ pair) none 16)
(execute-commands-up-to (_type_ float) none 17)
(backup-load-state-and-set-cmds (_type_ pair) int 18)
(restore-load-state-and-cleanup (_type_) int 19)
(restore-load-state (_type_) int 20)
(set-force-inside! (_type_ symbol symbol) none 21)
)
)
+1 -1
View File
@@ -60,7 +60,7 @@
(stereo-mode int32 :offset-assert 228)
(music symbol :offset-assert 232)
(sound-stinger int32 :offset-assert 236)
(spool-anim symbol :offset-assert 240)
(spool-anim spool-anim :offset-assert 240)
(sound-mode uint32 :offset-assert 244)
(task-manager (pointer process) :offset-assert 248)
(task symbol :offset-assert 252)
+1 -1
View File
@@ -351,7 +351,7 @@
(set! (-> obj spooling) (the-as (pointer process) arg1))
)
(('spool-anim)
(set! (-> obj spool-anim) arg1)
(set! (-> obj spool-anim) (the-as spool-anim arg1))
)
(('hint)
(set! (-> obj hint) (the-as (pointer process) arg1))
+2 -2
View File
@@ -624,12 +624,12 @@
;; definition for function matrix-remove-z-rot
;; INFO: Used lq/sq
(defun matrix-remove-z-rot ((arg0 matrix) (arg1 matrix))
(defun matrix-remove-z-rot ((arg0 matrix) (arg1 vector))
(let ((s4-0 (new-stack-vector0)))
0.0
0.0
(let ((s5-0 (new-stack-matrix0)))
(vector-negate! s4-0 (the-as vector arg1))
(vector-negate! s4-0 arg1)
(vector-flatten! s4-0 s4-0 (-> arg0 vector 2))
(vector-normalize! s4-0 1.0)
(let ((f30-0 (vector-dot (-> arg0 vector 1) s4-0)))
+44 -43
View File
@@ -12,7 +12,7 @@
:flag-assert #xb00000010
(:methods
(new (symbol type int level) _type_ 0)
(load-dir-method-9 () none 9)
(load-to-heap-by-name (_type_ string symbol kheap int) art-group 9)
(set-loaded-art (_type_ art-group) art-group 10)
)
)
@@ -54,39 +54,39 @@
;; definition of type external-art-buffer
(deftype external-art-buffer (basic)
((index int32 :offset-assert 4)
(other external-art-buffer :offset-assert 8)
(status symbol :offset-assert 12)
(locked? symbol :offset-assert 16)
(login? symbol :offset-assert 20)
(frame-lock symbol :offset-assert 24)
(init-heap function :offset-assert 28)
(heap kheap :inline :offset-assert 32)
(pending-load-file string :offset-assert 48)
(pending-load-file-part int32 :offset-assert 52)
(pending-load-file-owner handle :offset-assert 56)
(pending-load-file-priority float :offset-assert 64)
(load-file string :offset-assert 68)
(load-file-part int32 :offset-assert 72)
(load-file-owner handle :offset-assert 80)
(load-file-priority float :offset-assert 88)
(buf pointer :offset-assert 92)
(len int32 :offset-assert 96)
(art-group art-group :offset-assert 100)
(art-data uint32 :offset 100)
((index int32 :offset-assert 4)
(other external-art-buffer :offset-assert 8)
(status symbol :offset-assert 12)
(locked? symbol :offset-assert 16)
(login? symbol :offset-assert 20)
(frame-lock symbol :offset-assert 24)
(init-heap (function external-art-buffer object) :offset-assert 28)
(heap kheap :inline :offset-assert 32)
(pending-load-file string :offset-assert 48)
(pending-load-file-part int32 :offset-assert 52)
(pending-load-file-owner handle :offset-assert 56)
(pending-load-file-priority float :offset-assert 64)
(load-file string :offset-assert 68)
(load-file-part int32 :offset-assert 72)
(load-file-owner handle :offset-assert 80)
(load-file-priority float :offset-assert 88)
(buf pointer :offset-assert 92)
(len int32 :offset-assert 96)
(art-group art-group :offset-assert 100)
(art-data uint32 :offset 100)
)
:method-count-assert 16
:size-assert #x68
:flag-assert #x1000000068
(:methods
(new (symbol type int function symbol) _type_ 0)
(external-art-buffer-method-9 () none 9)
(external-art-buffer-method-10 () none 10)
(external-art-buffer-method-11 () none 11)
(external-art-buffer-method-12 () none 12)
(external-art-buffer-method-13 () none 13)
(external-art-buffer-method-14 () none 14)
(external-art-buffer-method-15 () none 15)
(set-pending-file (_type_ string int handle float) int 9)
(update (_type_) int 10)
(inactive? (_type_) symbol 11)
(file-status (_type_ string int) symbol 12)
(link-file (_type_ art-group) art-group 13)
(unlink-file (_type_ art-group) int 14)
(unlock! (_type_) int 15)
)
)
@@ -125,7 +125,7 @@
(defmethod new external-art-buffer ((allocation symbol) (type-to-make type) (arg0 int) (arg1 function) (arg2 symbol))
(let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(set! (-> v0-0 index) arg0)
(set! (-> v0-0 init-heap) arg1)
(set! (-> v0-0 init-heap) (the-as (function external-art-buffer object) arg1))
(set! (-> v0-0 login?) arg2)
(set! (-> v0-0 load-file) #f)
(set! (-> v0-0 load-file-part) -1)
@@ -145,13 +145,14 @@
;; definition of type spool-anim
(deftype spool-anim (basic)
((name string :offset 16)
(anim-name basic :offset-assert 20)
(parts int32 :offset-assert 24)
(hint-id int32 :offset 24)
(priority float :offset-assert 28)
(owner uint64 :offset-assert 32)
(command-list pair :offset-assert 40)
((name string :offset 16)
(anim-name basic :offset-assert 20)
(buffer external-art-buffer :offset 20)
(parts int32 :offset-assert 24)
(hint-id int32 :offset 24)
(priority float :offset-assert 28)
(owner handle :offset-assert 32)
(command-list pair :offset-assert 40)
)
:method-count-assert 9
:size-assert #x2c
@@ -166,7 +167,7 @@
)
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~1Tname: ~A~%" (-> obj name))
(format #t "~1Tanim-name: ~A~%" (-> obj anim-name))
(format #t "~1Tanim-name: ~A~%" (-> obj buffer))
(format #t "~1Tparts: ~D~%" (-> obj parts))
(format #t "~1Thint-id: ~D~%" (-> obj parts))
(format #t "~1Tpriority: ~f~%" (-> obj priority))
@@ -196,11 +197,11 @@
(new (symbol type) _type_ 0)
(update (_type_ symbol) int 9)
(clear-rec (_type_) int 10)
(external-art-control-method-11 () none 11)
(external-art-control-method-12 () none 12)
(external-art-control-method-13 () none 13)
(external-art-control-method-14 () none 14)
(external-art-control-method-15 () none 15)
(spool-push (_type_ string int process float) int 11)
(file-status (_type_ string int) symbol 12)
(reserve-alloc (_type_) kheap 13)
(reserve-free (_type_ kheap) int 14)
(none-reserved? (_type_) symbol 15)
)
)
@@ -238,7 +239,7 @@
(dotimes (v1-9 3)
(set! (-> gp-0 rec v1-9 name) #f)
(set! (-> gp-0 rec v1-9 priority) 100000000.0)
(set! (-> gp-0 rec v1-9 owner) (the-as uint #f))
(set! (-> gp-0 rec v1-9 owner) (the-as handle #f))
)
(set! (-> gp-0 spool-lock) (the-as handle #f))
(set! (-> gp-0 reserve-buffer) #f)
File diff suppressed because it is too large Load Diff
+15 -19
View File
@@ -24,10 +24,10 @@
;; definition of type chain-physics-joint
(deftype chain-physics-joint (structure)
((position vector :inline :offset-assert 0)
(velocity vector :inline :offset-assert 16)
(old-x vector :inline :offset-assert 32)
(joint-mod basic :offset-assert 48)
((position vector :inline :offset-assert 0)
(velocity vector :inline :offset-assert 16)
(old-x vector :inline :offset-assert 32)
(joint-mod joint-mod :offset-assert 48)
)
:method-count-assert 9
:size-assert #x34
@@ -64,22 +64,22 @@
(negate-y basic :offset-assert 1360)
(axial-slop float :offset-assert 1364)
(maximum-stretch float :offset-assert 1368)
(turn-off-start uint64 :offset-assert 1376)
(turn-off-duration uint64 :offset-assert 1384)
(turn-off-start time-frame :offset-assert 1376)
(turn-off-duration time-frame :offset-assert 1384)
)
:method-count-assert 18
:size-assert #x570
:flag-assert #x1200000570
(:methods
(chain-physics-method-9 () none 9)
(chain-physics-method-10 () none 10)
(chain-physics-method-11 () none 11)
(chain-physics-method-12 () none 12)
(chain-physics-method-13 () none 13)
(chain-physics-method-14 () none 14)
(chain-physics-method-15 () none 15)
(chain-physics-method-16 () none 16)
(chain-physics-method-17 () none 17)
(initialize-chain-joints (_type_) symbol 9)
(turn-off (_type_ time-frame) none :behavior process 10)
(update (_type_ process-drawable) none :behavior process 11)
(gravity-update (_type_) none 12)
(apply-gravity (_type_ vector int) none :behavior process 13)
(chain-physics-method-14 (_type_ vector int) none 14)
(clamp-length (_type_ vector vector) vector 15)
(chain-physics-method-16 (_type_ int) float 16)
(chain-physics-method-17 (_type_ vector) none 17)
)
)
@@ -111,7 +111,3 @@
;; failed to figure out what this is:
0
+409
View File
@@ -0,0 +1,409 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for method 12 of type chain-physics
;; INFO: Return type mismatch int vs none.
(defmethod gravity-update chain-physics ((obj chain-physics))
(vector-seek-3d-smooth! (-> obj gravity) (-> obj gravity-target) 0.05 0.1)
0
(none)
)
;; definition for method 13 of type chain-physics
;; INFO: Return type mismatch int vs none.
(defmethod apply-gravity chain-physics ((obj chain-physics) (arg0 vector) (arg1 int))
(vector-float*!
arg0
(-> obj gravity)
(* 4096.0 (-> self clock time-adjust-ratio) (fmax 0.2 (lerp-scale 0.38 0.18 (the float arg1) 0.0 5.0)))
)
0
(none)
)
;; definition for method 14 of type chain-physics
;; INFO: Return type mismatch int vs none.
(defmethod chain-physics-method-14 chain-physics ((obj chain-physics) (arg0 vector) (arg1 int))
(vector-float*!
arg0
(the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ arg1 1) 64)))
(fmin 0.9 (lerp-scale 0.2 1.0 (the float arg1) 0.0 4.0))
)
0
(none)
)
;; definition for method 15 of type chain-physics
(defmethod clamp-length chain-physics ((obj chain-physics) (arg0 vector) (arg1 vector))
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-! gp-0 arg0 arg1)
(vector-normalize! gp-0 (-> obj joint-length))
(vector+! arg0 gp-0 arg1)
)
)
;; definition for method 16 of type chain-physics
(defmethod chain-physics-method-16 chain-physics ((obj chain-physics) (arg0 int))
(lerp-scale 5461.3335 10922.667 (the float arg0) 0.0 8.0)
)
;; definition for method 17 of type chain-physics
;; INFO: Return type mismatch int vs none.
(defmethod chain-physics-method-17 chain-physics ((obj chain-physics) (arg0 vector))
0
(none)
)
;; definition for method 9 of type chain-physics
(defmethod initialize-chain-joints chain-physics ((obj chain-physics))
(set! (-> obj turn-off-start) 0)
(dotimes (s5-0 (the-as int (-> obj num-joints)))
(let ((s4-0 (-> obj chain-joints s5-0)))
(vector<-cspace! (-> s4-0 position) (-> s4-0 joint-mod joint))
(vector-reset! (-> s4-0 velocity))
(mode-set! (-> s4-0 joint-mod) (joint-mod-mode joint-set-world))
)
)
#f
)
;; definition for method 10 of type chain-physics
;; INFO: Return type mismatch int vs none.
(defmethod turn-off chain-physics ((obj chain-physics) (arg0 time-frame))
(set! (-> obj turn-off-start) (-> self clock frame-counter))
(set! (-> obj turn-off-duration) arg0)
0
(none)
)
;; definition for method 11 of type chain-physics
;; INFO: Used lq/sq
;; INFO: Return type mismatch int vs none.
(defmethod update chain-physics ((obj chain-physics) (arg0 process-drawable))
(local-vars
(v1-77 float)
(f0-11 float)
(sv-272 chain-physics-joint)
(sv-288 vector)
(sv-304 vector)
(sv-320 (function vector float vector))
(sv-336 vector)
(sv-352 vector)
(sv-368 vector)
(sv-384 vector)
(sv-400 vector)
(sv-416 vector)
(sv-432 vector)
(sv-448 (inline-array vector))
(sv-464 (inline-array vector))
(sv-480 (inline-array vector))
(sv-496 vector)
(sv-512 (inline-array vector))
(sv-528 vector)
)
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(gravity-update obj)
(let ((s4-0 (new 'stack-no-clear 'matrix))
(s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg0 node-list data (-> obj root-joint-index))))
(s2-0 (vector-normalize-copy!
(new 'stack-no-clear 'vector)
(-> arg0 node-list data (-> obj root-joint-index) bone transform vector 2)
1.0
)
)
(s1-0 (vector-normalize-copy!
(new 'stack-no-clear 'vector)
(-> arg0 node-list data (-> obj root-joint-index) bone transform vector 1)
1.0
)
)
)
(new 'stack-no-clear 'vector)
(let ((f30-0 1.0))
(if (nonzero? (-> obj turn-off-start))
(set! f30-0
(fmax
0.0
(fmin
1.0
(parameter-ease-sin-clamp (- 1.0 (/ (the float (- (-> self clock frame-counter) (-> obj turn-off-start)))
(the float (-> obj turn-off-duration))
)
)
)
)
)
)
)
(dotimes (s0-0 (the-as int (-> obj num-joints)))
(set! sv-272 (-> obj chain-joints s0-0))
(set! sv-528 (new 'stack-no-clear 'vector))
(let ((v1-27 (-> sv-272 position quad)))
(set! (-> sv-528 quad) v1-27)
)
(set! (-> sv-272 joint-mod flex-blend) f30-0)
(if (-> obj negate-y)
(vector-negate! s1-0 s1-0)
)
(set! sv-288 (new 'stack-no-clear 'vector))
(apply-gravity obj sv-288 s0-0)
(let ((v1-34 sv-528))
(let ((a0-10 sv-528))
(.mov.vf vf6 vf0 :mask #b1000)
(.lvf vf4 (&-> a0-10 quad))
)
(.lvf vf5 (&-> sv-288 quad))
(.add.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> v1-34 quad) vf6)
)
(when (< s0-0 (the-as int (+ (-> obj root-joint-index) -1)))
(set! sv-304 (new 'stack-no-clear 'vector))
(chain-physics-method-14 obj sv-304 s0-0)
(let ((v1-40 sv-528))
(let ((a0-13 sv-528))
(.mov.vf vf6 vf0 :mask #b1000)
(.lvf vf4 (&-> a0-13 quad))
)
(.lvf vf5 (&-> sv-304 quad))
(.add.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> v1-40 quad) vf6)
)
)
(clamp-length obj sv-528 s3-0)
(set! sv-400 (new 'stack-no-clear 'vector))
(let ((v1-43 sv-528)
(a0-16 s3-0)
)
(.lvf vf4 (&-> v1-43 quad))
(.lvf vf5 (&-> a0-16 quad))
)
(.mov.vf vf6 vf0 :mask #b1000)
(.sub.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> sv-400 quad) vf6)
(let ((f28-1 (vector-normalize-ret-len! sv-400 1.0))
(f24-0 (vector-dot sv-400 s1-0))
(f26-0 (chain-physics-method-16 obj s0-0))
)
(when (< f24-0 (cos f26-0))
(vector--float*! sv-400 sv-400 s1-0 f24-0)
(set! sv-320 vector-normalize!)
(set! sv-336 sv-400)
(let ((a1-17 (sin f26-0)))
(sv-320 sv-336 a1-17)
)
(set! sv-384 sv-400)
(set! sv-352 sv-400)
(set! sv-368 s1-0)
(let ((f0-6 (cos f26-0)))
(.lvf vf2 (&-> sv-368 quad))
(.lvf vf1 (&-> sv-352 quad))
(let ((v1-55 f0-6))
(.mov vf3 v1-55)
)
)
(.add.x.vf vf4 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111)
(.svf (&-> sv-384 quad) vf4)
(let ((v1-57 sv-528))
(let ((a0-25 s3-0))
(.lvf vf2 (&-> sv-400 quad))
(.lvf vf1 (&-> a0-25 quad))
)
(let ((a0-26 f28-1))
(.mov vf3 a0-26)
)
(.add.x.vf vf4 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111)
(.svf (&-> v1-57 quad) vf4)
)
)
)
(chain-physics-method-17 obj sv-528)
(set! sv-432 (new 'stack-no-clear 'vector))
(let ((v1-60 s3-0)
(a0-28 sv-528)
)
(.lvf vf4 (&-> v1-60 quad))
(.lvf vf5 (&-> a0-28 quad))
)
(.mov.vf vf6 vf0 :mask #b1000)
(.sub.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> sv-432 quad) vf6)
(vector-normalize-ret-len! sv-432 1.0)
(set! sv-416 (new 'stack-no-clear 'vector))
(let ((v1-63 sv-528)
(a0-31 (-> sv-272 position))
)
(.lvf vf4 (&-> v1-63 quad))
(.lvf vf5 (&-> a0-31 quad))
)
(.mov.vf vf6 vf0 :mask #b1000)
(.sub.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> sv-416 quad) vf6)
(let ((f28-2 (vector-dot sv-432 sv-416)))
(vector--float*! sv-416 sv-416 sv-432 f28-2)
(cond
((< f28-2 0.0)
(set! f0-11 (* f28-2 (-> obj compress-vel-parallel)))
(vector-float*! sv-416 sv-416 (-> obj compress-vel))
)
(else
(set! f0-11 (* f28-2 (-> obj stretch-vel-parallel)))
(vector-float*! sv-416 sv-416 (-> obj stretch-vel))
)
)
)
(let ((v1-72 (-> sv-272 velocity)))
(.lvf vf2 (&-> sv-432 quad))
(.lvf vf1 (&-> sv-416 quad))
(let ((a0-38 f0-11))
(.mov vf3 a0-38)
)
(.add.x.vf vf4 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111)
(.svf (&-> v1-72 quad) vf4)
)
(vector+! sv-528 (-> sv-272 position) (-> sv-272 velocity))
(let ((a2-9 (vector-! (new 'stack-no-clear 'vector) s3-0 sv-528)))
(.lvf vf1 (&-> a2-9 quad))
(.add.w.vf vf2 vf0 vf0 :mask #b1)
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf acc vf2 vf1 :mask #b1)
(.add.mul.y.vf acc vf2 vf1 acc :mask #b1)
(.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1)
(.mov v1-77 vf1)
(let* ((f0-13 v1-77)
(f1-6 (* (-> obj maximum-stretch) (-> obj joint-length)))
(f2-3 f1-6)
)
(if (< (* f2-3 f2-3) f0-13)
(vector--float*! sv-528 s3-0 a2-9 (/ f1-6 (sqrtf f0-13)))
)
)
)
(set! (-> sv-272 position quad) (-> sv-528 quad))
(if (-> sv-272 joint-mod)
(set! (-> sv-272 joint-mod trans quad) (-> sv-528 quad))
)
(when (< s0-0 (the-as int (-> obj num-joints)))
(vector-! (-> s4-0 vector 1) sv-528 s3-0)
(vector-normalize! (-> s4-0 vector 1) 1.0)
(if (-> obj negate-y)
(vector-negate! (-> s4-0 vector 1) (-> s4-0 vector 1))
)
(vector-cross! (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) s2-0)
(vector-normalize! (the-as vector (-> s4-0 vector)) 1.0)
(set! sv-496 (new 'stack-no-clear 'vector))
(let ((v1-96 (-> sv-272 old-x))
(a0-52 (-> s4-0 vector))
)
(.lvf vf1 (&-> v1-96 quad))
(.lvf vf2 (&-> a0-52 0 quad))
)
(.outer.product.a.vf acc vf1 vf2)
(.outer.product.b.vf vf3 vf2 vf1 acc)
(.svf (&-> sv-496 quad) vf3)
(vector-flatten! sv-496 (-> sv-272 old-x) (-> s4-0 vector 1))
(vector-normalize! sv-496 1.0)
(cond
((< (vector-dot (the-as vector (-> s4-0 vector)) sv-496) (cos (-> obj axial-slop)))
(vector-cross! sv-496 sv-496 (the-as vector (-> s4-0 vector)))
(vector-cross! sv-496 (the-as vector (-> s4-0 vector)) sv-496)
(vector-normalize! sv-496 1.0)
(set! sv-464 (-> s4-0 vector))
(set! sv-448 (-> s4-0 vector))
(let ((f0-20 (cos (-> obj axial-slop))))
(.lvf vf1 (&-> sv-448 0 quad))
(let ((v1-106 f0-20))
(.mov vf2 v1-106)
)
)
(.add.x.vf vf1 vf0 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> sv-464 0 quad) vf1)
(set! sv-512 (-> s4-0 vector))
(set! sv-480 (-> s4-0 vector))
(let ((f0-22 (sin (-> obj axial-slop))))
(.lvf vf2 (&-> sv-496 quad))
(.lvf vf1 (&-> sv-480 0 quad))
(let ((v1-112 f0-22))
(.mov vf3 v1-112)
)
)
(.add.x.vf vf4 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111)
(.svf (&-> sv-512 0 quad) vf4)
(set! (-> sv-272 old-x quad) (-> s4-0 vector 0 quad))
)
(else
(set! (-> s4-0 vector 0 quad) (-> sv-496 quad))
(set! (-> sv-272 old-x quad) (-> s4-0 vector 0 quad))
)
)
(vector-cross! (-> s4-0 vector 2) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1))
(matrix->quaternion (-> sv-272 joint-mod quat) s4-0)
(set! (-> s1-0 quad) (-> s4-0 vector 1 quad))
(set! (-> s2-0 quad) (-> s4-0 vector 2 quad))
0
)
(set! (-> s3-0 quad) (-> sv-528 quad))
0
)
)
)
0
(none)
)
)
;; definition for method 7 of type chain-physics
(defmethod relocate chain-physics ((obj chain-physics) (arg0 int))
(dotimes (v1-0 (the-as int (-> obj num-joints)))
(if (nonzero? (-> obj chain-joints v1-0 joint-mod))
(&+! (-> obj chain-joints v1-0 joint-mod) arg0)
)
)
obj
)
;; definition for function chain-physics-initialize
;; INFO: Used lq/sq
(defun chain-physics-initialize ((arg0 process-drawable) (arg1 chain-physics) (arg2 int) (arg3 float) (arg4 (array chain-physics-setup)))
(set! (-> arg1 num-joints) (the-as uint (min 20 (-> arg4 length))))
(dotimes (s1-0 (the-as int (-> arg1 num-joints)))
(set! (-> arg1 chain-joints s1-0 joint-mod)
(new 'process 'joint-mod (joint-mod-mode flex-blend) arg0 (-> arg4 s1-0 joint-index))
)
(set! (-> arg1 chain-joints s1-0 joint-mod track-mode) (track-mode no-scale))
)
(set! (-> arg1 root-joint-index) (the-as uint arg2))
(set! (-> arg1 joint-length) arg3)
(set-vector! (-> arg1 gravity) 0.0 -1.0 0.0 1.0)
(set! (-> arg1 gravity-target quad) (-> arg1 gravity quad))
(set! (-> arg1 stretch-vel) 0.7)
(set! (-> arg1 stretch-vel-parallel) 0.8)
(set! (-> arg1 compress-vel) 0.85)
(set! (-> arg1 compress-vel-parallel) 0.75)
(set! (-> arg1 negate-y) #f)
(set! (-> arg1 axial-slop) 3640.889)
(set! (-> arg1 maximum-stretch) 1.5)
(set! (-> arg1 turn-off-start) 0)
0
)
@@ -36,45 +36,39 @@
)
;; definition for function num-func-none
(defun num-func-none ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func-none process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(-> arg0 frame-num)
)
;; definition for function num-func-+!
(defun num-func-+! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(with-pp
(let ((f0-1 (+ (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio))))))
(set! (-> arg0 frame-num) f0-1)
f0-1
)
(defbehavior num-func-+! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(let ((f0-1 (+ (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> self clock time-adjust-ratio))))))
(set! (-> arg0 frame-num) f0-1)
f0-1
)
)
;; definition for function num-func--!
(defun num-func--! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(with-pp
(let ((f0-1 (- (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio))))))
(set! (-> arg0 frame-num) f0-1)
f0-1
)
(defbehavior num-func--! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(let ((f0-1 (- (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> self clock time-adjust-ratio))))))
(set! (-> arg0 frame-num) f0-1)
f0-1
)
)
;; definition for function num-func-loop!
(defun num-func-loop! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(with-pp
(let* ((f0-1 (the float (+ (-> arg0 frame-group frames num-frames) -1)))
(f1-2 (+ (-> arg0 frame-num) f0-1 (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio)))))
(f0-3 (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)))
)
(set! (-> arg0 frame-num) f0-3)
f0-3
)
(defbehavior num-func-loop! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(let* ((f0-1 (the float (+ (-> arg0 frame-group frames num-frames) -1)))
(f1-2 (+ (-> arg0 frame-num) f0-1 (* arg1 (* (-> arg0 frame-group speed) (-> self clock time-adjust-ratio)))))
(f0-3 (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)))
)
(set! (-> arg0 frame-num) f0-3)
f0-3
)
)
;; definition for function num-func-loop-speedless!
(defun num-func-loop-speedless! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func-loop-speedless! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(let* ((f0-1 (the float (+ (-> arg0 frame-group frames num-frames) -1)))
(f1-2 (+ (-> arg0 frame-num) f0-1 arg1))
(f0-3 (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)))
@@ -85,29 +79,25 @@
)
;; definition for function num-func-seek!
(defun num-func-seek! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(with-pp
(let ((f0-3
(seek (-> arg0 frame-num) arg1 (* arg2 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio))))
)
(defbehavior num-func-seek! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(let ((f0-3
(seek (-> arg0 frame-num) arg1 (* arg2 (* (-> arg0 frame-group speed) (-> self clock time-adjust-ratio))))
)
(set! (-> arg0 frame-num) f0-3)
f0-3
)
)
(set! (-> arg0 frame-num) f0-3)
f0-3
)
)
;; definition for function num-func-blend-in!
(defun num-func-blend-in! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(with-pp
(let ((f30-0 (seek (-> arg0 frame-interp 0) 1.0 (* arg1 (-> pp clock time-adjust-ratio)))))
(set! (-> arg0 frame-interp 0) f30-0)
(set! (-> arg0 frame-interp 1) f30-0)
(if (= f30-0 1.0)
(joint-control-reset! (-> arg0 parent) arg0)
)
f30-0
)
(defbehavior num-func-blend-in! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(let ((f30-0 (seek (-> arg0 frame-interp 0) 1.0 (* arg1 (-> self clock time-adjust-ratio)))))
(set! (-> arg0 frame-interp 0) f30-0)
(set! (-> arg0 frame-interp 1) f30-0)
(if (= f30-0 1.0)
(joint-control-reset! (-> arg0 parent) arg0)
)
f30-0
)
)
@@ -133,62 +123,58 @@
)
;; definition for function num-func-interp-play!
(defun num-func-interp-play! ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(with-pp
(let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1)))
(f28-0 (* arg3 (-> arg0 frame-group speed)))
)
(seek! (-> arg0 frame-num) f30-0 (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio))))
(cond
((< (-> arg0 frame-num) f28-0)
(set! (-> arg0 frame-interp 0) (/ (* (-> arg0 frame-num) arg2) f28-0))
(defbehavior num-func-interp-play! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1)))
(f28-0 (* arg3 (-> arg0 frame-group speed)))
)
(seek! (-> arg0 frame-num) f30-0 (* arg1 (* (-> arg0 frame-group speed) (-> self clock time-adjust-ratio))))
(cond
((< (-> arg0 frame-num) f28-0)
(set! (-> arg0 frame-interp 0) (/ (* (-> arg0 frame-num) arg2) f28-0))
)
((< (- f30-0 f28-0) (-> arg0 frame-num))
(set! (-> arg0 frame-interp 0) (/ (* (- f30-0 (-> arg0 frame-num)) arg2) f28-0))
(when (and (= (-> arg0 frame-num) f30-0) (logtest? (-> arg0 command) (joint-control-command eight)))
(joint-channel-float-delete! arg0)
(return 0.0)
)
((< (- f30-0 f28-0) (-> arg0 frame-num))
(set! (-> arg0 frame-interp 0) (/ (* (- f30-0 (-> arg0 frame-num)) arg2) f28-0))
(when (and (= (-> arg0 frame-num) f30-0) (logtest? (-> arg0 command) (joint-control-command eight)))
(joint-channel-float-delete! arg0)
(return 0.0)
)
)
(else
(set! (-> arg0 frame-interp 0) arg2)
)
)
(else
(set! (-> arg0 frame-interp 0) arg2)
)
)
(set! (-> arg0 frame-interp 1) (-> arg0 frame-interp 0))
(-> arg0 frame-num)
)
(set! (-> arg0 frame-interp 1) (-> arg0 frame-interp 0))
(-> arg0 frame-num)
)
;; definition for function num-func-interp1-play!
(defun num-func-interp1-play! ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(with-pp
(let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1)))
(f28-0 (* arg3 (-> arg0 frame-group speed)))
)
(seek! (-> arg0 frame-num) f30-0 (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio))))
(cond
((< (-> arg0 frame-num) f28-0)
(set! (-> arg0 frame-interp 1) (/ (* (-> arg0 frame-num) arg2) f28-0))
(defbehavior num-func-interp1-play! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1)))
(f28-0 (* arg3 (-> arg0 frame-group speed)))
)
(seek! (-> arg0 frame-num) f30-0 (* arg1 (* (-> arg0 frame-group speed) (-> self clock time-adjust-ratio))))
(cond
((< (-> arg0 frame-num) f28-0)
(set! (-> arg0 frame-interp 1) (/ (* (-> arg0 frame-num) arg2) f28-0))
)
((< (- f30-0 f28-0) (-> arg0 frame-num))
(set! (-> arg0 frame-interp 1) (/ (* (- f30-0 (-> arg0 frame-num)) arg2) f28-0))
(when (and (= (-> arg0 frame-num) f30-0) (logtest? (-> arg0 command) (joint-control-command eight)))
(joint-channel-float-delete! arg0)
(return 0.0)
)
((< (- f30-0 f28-0) (-> arg0 frame-num))
(set! (-> arg0 frame-interp 1) (/ (* (- f30-0 (-> arg0 frame-num)) arg2) f28-0))
(when (and (= (-> arg0 frame-num) f30-0) (logtest? (-> arg0 command) (joint-control-command eight)))
(joint-channel-float-delete! arg0)
(return 0.0)
)
)
(else
(set! (-> arg0 frame-interp 1) arg2)
)
)
(else
(set! (-> arg0 frame-interp 1) arg2)
)
)
(-> arg0 frame-num)
)
(-> arg0 frame-num)
)
;; definition for function num-func-chan
(defun num-func-chan ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func-chan process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(let ((f0-2
(-> (the-as joint-control-channel (+ (the-as uint arg0) (* (- (the int arg1) (-> arg0 group-sub-index)) 64)))
frame-num
@@ -201,13 +187,9 @@
)
;; definition for function num-func-identity
(defun num-func-identity ((arg0 joint-control-channel) (arg1 float) (arg2 float))
(defbehavior num-func-identity process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float))
(-> arg0 frame-num)
)
;; failed to figure out what this is:
0
@@ -0,0 +1,8 @@
;;-*-Lisp-*-
(in-package goal)
;; ERROR: top level function was not converted to expressions. Cannot decompile.
+5 -4
View File
@@ -90,7 +90,8 @@
(stream-position uint32 4 :offset 272)
(stream-status stream-status 4 :offset-assert 288)
(stream-name sound-stream-name 4 :inline :offset-assert 304)
(stream-id uint32 4 :offset-assert 496)
(stream-id sound-id 4 :offset-assert 496)
(stream-id-int32 int32 4 :offset 496)
(music-register uint8 17 :offset-assert 512)
(music-excite int8 :offset 528)
(ramdisk-name uint8 48 :offset-assert 529)
@@ -151,8 +152,8 @@
;; definition for function str-is-playing?
(defun str-is-playing? ()
(countdown (v1-0 4)
(if (and (>= (-> *sound-iop-info* stream-id v1-0) 0)
(logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status four))
(if (and (>= (the-as uint (-> *sound-iop-info* stream-id v1-0)) 0)
(logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status ststatus-four))
)
(return #t)
)
@@ -164,7 +165,7 @@
(defun str-id-is-playing? ((arg0 int))
(countdown (v1-0 4)
(if (and (= arg0 (-> *sound-iop-info* stream-id v1-0))
(logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status one six))
(logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status ststatus-one ststatus-six))
)
(return #t)
)
+12 -53
View File
@@ -115,42 +115,18 @@
(ja-channel-push! 1 (seconds 0.1))
(cond
(arg0
(let ((gp-1 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
gp-1
(the-as art-joint-anim (-> self draw art-group data 4))
(the-as (function joint-control-channel float float float float) num-func-identity)
(ja :group! (-> self draw art-group data 4)
:num! (identity (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1)))
)
(set! (-> gp-1 frame-num)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))
)
)
)
(else
(let ((a0-3 (-> self skel root-channel 0)))
(set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 4)))
(set! (-> a0-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1))
)
(set! (-> a0-3 param 1) 1.0)
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group!
a0-3
(the-as art-joint-anim (-> self draw art-group data 4))
(the-as (function joint-control-channel float float float float) num-func-seek!)
)
)
(ja-no-eval :group! (-> self draw art-group data 4)
:num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1)))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(let ((a0-4 (-> self skel root-channel 0)))
(set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1)))
(set! (-> a0-4 param 1) 1.0)
(joint-control-channel-group-eval!
a0-4
(the-as art-joint-anim #f)
(the-as (function joint-control-channel float float float float) num-func-seek!)
)
)
(ja :num! (seek!))
)
)
)
@@ -210,30 +186,13 @@
:code (behavior ()
(set! (-> self draw shadow) (-> self shadow-backup))
(ja-channel-push! 1 (seconds 0.1))
(let ((a0-2 (-> self skel root-channel 0)))
(set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3)))
(set! (-> a0-2 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1))
)
(set! (-> a0-2 param 1) 1.0)
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group!
a0-2
(the-as art-joint-anim (-> self draw art-group data 3))
(the-as (function joint-control-channel float float float float) num-func-seek!)
)
)
(ja-no-eval :group! (-> self draw art-group data 3)
:num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1)))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(let ((a0-3 (-> self skel root-channel 0)))
(set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group frames num-frames) -1)))
(set! (-> a0-3 param 1) 1.0)
(joint-control-channel-group-eval!
a0-3
(the-as art-joint-anim #f)
(the-as (function joint-control-channel float float float float) num-func-seek!)
)
)
(ja :num! (seek!))
)
(sleep-code)
(none)
+26 -20
View File
@@ -8,8 +8,8 @@
(channel gui-channel :offset 21)
(anim-part uint8 :offset 22)
(flags uint8 :offset 23)
(name object :offset 24)
(id uint32 :offset 28)
(name string :offset 24)
(id sound-id :offset 28)
(handle handle :offset 0)
(time-stamp time-frame :offset 8)
(hold-time time-frame :offset-assert 32)
@@ -249,29 +249,35 @@
;; definition of type gui-control
(deftype gui-control (basic)
((engine engine :offset-assert 4)
(data uint8 3272 :offset-assert 8)
((engine engine :offset-assert 4)
(update-time time-frame :offset-assert 8)
(connections gui-connection 32 :inline :offset-assert 16)
(spool-connections gui-connection 4 :inline :offset-assert 1552)
(ids sound-id 96 :offset-assert 1744)
(times time-frame 96 :offset-assert 2128)
(cmd pair 96 :offset-assert 2896)
)
:method-count-assert 25
:size-assert #xcd0
:flag-assert #x1900000cd0
(:methods
(gui-control-method-9 () none 9)
(gui-control-method-10 () none 10)
(gui-control-method-11 () none 11)
(gui-control-method-12 () none 12)
(update (_type_ symbol) none 13)
(gui-control-method-14 () none 14)
(gui-control-method-15 () none 15)
(gui-control-method-16 () none 16)
(gui-control-method-17 () none 17)
(gui-control-method-18 () none 18)
(gui-control-method-19 () none 19)
(gui-control-method-20 () none 20)
(gui-control-method-21 () none 21)
(gui-control-method-22 () none 22)
(gui-control-method-23 () none 23)
(gui-control-method-24 () none 24)
(new (symbol type int) _type_ 0)
(gui-control-method-9 (_type_ process gui-channel gui-action int float time-frame) sound-id 9)
(gui-control-method-10 (_type_ process gui-channel) none 10)
(gui-control-method-11 (_type_ gui-connection) int 11)
(gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id 12)
(update (_type_ symbol) int 13)
(gui-control-method-14 (_type_ string gui-channel gui-action) int 14)
(gui-control-method-15 (_type_ process gui-channel string sound-id) gui-connection 15)
(gui-control-method-16 (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int 16)
(gui-control-method-17 (_type_ sound-id) gui-action 17)
(gui-control-method-18 (_type_ gui-channel) symbol 18)
(gui-control-method-19 (_type_ gui-channel gui-connection) symbol 19)
(gui-control-method-20 (_type_ sound-id symbol int int int) gui-connection 20)
(gui-control-method-21 (_type_ gui-connection vector) int 21)
(gui-control-method-22 (_type_ gui-connection process symbol) none 22)
(gui-control-method-23 (_type_ gui-channel gui-channel symbol gui-connection) symbol 23)
(channel-id-set! (_type_ gui-connection sound-id) int 24)
)
)
+6
View File
@@ -50,6 +50,12 @@
"print-game-text",
// joint asm
"cspace<-parented-transformq-joint!", "(method 11 art-joint-anim-manager)", "make-joint-jump-tables", "joint-channel-copy!",
// vector-dot in stack vars
"joint-mod-ik-callback",
"joint-mod-look-at-handler",
// bad stack-no-clear decomp
"ja-play-spooled-anim",
// default menu
// - causes a decompiler hang
"dm-cam-setting-float",