diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 0ec67d9dd..b66e9ff3d 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -9828,9 +9828,7 @@ ], "(event idle turbo-ring)": [[4, "s5", "vehicle"]], "(anon-function 2 errol-chal)": [[17, "v1", "process-drawable"]], - "generic-add-constants": [ - [[3, 17], "a0", "dma-packet"] - ], + "generic-add-constants": [[[3, 17], "a0", "dma-packet"]], "generic-init-buf": [ [[8, 15], "a0", "dma-packet"], [[17, 24], "a0", "gs-gif-tag"], @@ -9839,7 +9837,9 @@ [[36, 44], "a0", "dma-packet"], [[47, 57], "v1", "(pointer uint32)"] ], - "generic-vu1-init-buf": [ - [[24, 32], "v1", "dma-packet"] + "generic-vu1-init-buf": [[[24, 32], "v1", "dma-packet"]], + "(method 11 drill-wall)": [ + [159, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"] ] } diff --git a/decompiler/config/jak2/var_names.jsonc b/decompiler/config/jak2/var_names.jsonc index 16b663f60..7dd98b735 100644 --- a/decompiler/config/jak2/var_names.jsonc +++ b/decompiler/config/jak2/var_names.jsonc @@ -4109,13 +4109,13 @@ }, "generic-add-constants": { "vars": { - "a1-4":["a1-4", "vif-tag"] + "a1-4": ["a1-4", "vif-tag"] } }, "generic-vu1-init-buffers": { "vars": { - "s5-0":["s5-0", "gs-zbuf"], - "gp-0":["gp-0", "gs-zbuf"] + "s5-0": ["s5-0", "gs-zbuf"], + "gp-0": ["gp-0", "gs-zbuf"] } } } diff --git a/goal_src/jak2/levels/drill_platform/drill-spool.gc b/goal_src/jak2/levels/drill_platform/drill-spool.gc index 853072b64..9e36c2700 100644 --- a/goal_src/jak2/levels/drill_platform/drill-spool.gc +++ b/goal_src/jak2/levels/drill_platform/drill-spool.gc @@ -918,7 +918,7 @@ This commonly includes things such as: - collision information - loading the skeleton group / bones - sounds" - (local-vars (r0-0 uint128) (a0-20 object) (a1-14 uint128) (sv-16 int)) + (local-vars (sv-16 res-tag)) (stack-size-set! (-> obj main-thread) 512) (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) (let ((s3-0 ((method-of-type res-lump get-property-struct) @@ -974,22 +974,11 @@ This commonly includes things such as: (format (clear *temp-string*) "~S-idle" (-> obj art-name)) (set! (-> s5-1 frame-group) (the-as art-joint-anim (s3-1 s4-1 *temp-string* (the-as type #f)))) ) - (set! sv-16 0) - (let ((v1-35 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (the-as (pointer res-tag) (& sv-16))))) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-35 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (cond - ((and v1-35 (begin - (let ((a0-21 #t)) - (let ((a1-13 (the-as uint128 sv-16))) - (.pcpyud a1-14 a1-13 r0-0) - ) - (let ((a1-16 (the-as int (shr (* (the-as int a1-14) 2) 49)))) - (cmove-#f-zero a0-20 a1-16 a0-21) - ) - ) - a0-20 - ) - ) - (set! (-> obj egg-group) (the-as actor-group (-> (the-as (pointer uint32) v1-35)))) + ((and v1-35 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj egg-group) (-> v1-35 0)) ) (else ) @@ -1209,7 +1198,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (stack-size-set! (-> obj main-thread) 1024) ;; increased from 512 + (stack-size-set! (-> obj main-thread) 2048) ;; increased from 512 (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) (let ((s3-0 "drill-crane-break") (s4-0 (art-group-get-by-name *level* "skel-drill-crane" (the-as (pointer uint32) #f))) diff --git a/test/decompiler/reference/jak2/levels/drill_platform/drill-spool_REF.gc b/test/decompiler/reference/jak2/levels/drill_platform/drill-spool_REF.gc index 85462cda3..6ecb5454f 100644 --- a/test/decompiler/reference/jak2/levels/drill_platform/drill-spool_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill_platform/drill-spool_REF.gc @@ -915,7 +915,7 @@ This commonly includes things such as: - collision information - loading the skeleton group / bones - sounds" - (local-vars (r0-0 uint128) (a0-20 object) (a1-14 uint128) (sv-16 int)) + (local-vars (sv-16 res-tag)) (stack-size-set! (-> obj main-thread) 512) (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) (let ((s3-0 ((method-of-type res-lump get-property-struct) @@ -971,22 +971,11 @@ This commonly includes things such as: (format (clear *temp-string*) "~S-idle" (-> obj art-name)) (set! (-> s5-1 frame-group) (the-as art-joint-anim (s3-1 s4-1 *temp-string* (the-as type #f)))) ) - (set! sv-16 0) - (let ((v1-35 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (the-as (pointer res-tag) (& sv-16))))) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-35 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (cond - ((and v1-35 (begin - (let ((a0-21 #t)) - (let ((a1-13 (the-as uint128 sv-16))) - (.pcpyud a1-14 a1-13 r0-0) - ) - (let ((a1-16 (the-as int (shr (* (the-as int a1-14) 2) 49)))) - (cmove-#f-zero a0-20 a1-16 a0-21) - ) - ) - a0-20 - ) - ) - (set! (-> obj egg-group) (the-as actor-group (-> (the-as (pointer uint32) v1-35)))) + ((and v1-35 (nonzero? (-> sv-16 elt-count))) + (set! (-> obj egg-group) (-> v1-35 0)) ) (else )