Skip to content

Commit

Permalink
decomp: decompile shrub-work | tie-work (#657)
Browse files Browse the repository at this point in the history
* decomp: finish `shrub-work`

* decomp: update reference tests

* decomp: update `goal_src` entries

* decomp: finish `tie-work`

* decomp: add to `goal_src`
  • Loading branch information
xTVaser authored Jul 1, 2021
1 parent 72ae39b commit 2556284
Show file tree
Hide file tree
Showing 11 changed files with 2,187 additions and 181 deletions.
57 changes: 30 additions & 27 deletions decompiler/config/all-types.gc
Original file line number Diff line number Diff line change
Expand Up @@ -11551,10 +11551,10 @@
(vtx-qwc uint8 :offset 13)
(col-qwc uint8 :offset 14)
(stq-qwc uint8 :offset 15)
(obj uint32 :offset 16)
(vtx uint32 :offset 20)
(col uint32 :offset 24)
(stq uint32 :offset 28)
(obj uint32 :score 999 :offset 16)
(vtx uint32 :score 999 :offset 20)
(col uint32 :score 999 :offset 24)
(stq uint32 :score 999 :offset 28)
)
:method-count-assert 18
:size-assert #x20
Expand Down Expand Up @@ -11588,16 +11588,16 @@
)

(deftype generic-shrub-fragment (drawable)
((textures (inline-array adgif-shader) :offset 4)
(vtx-cnt uint32 :offset 8)
(cnt-qwc uint8 :offset 12)
(vtx-qwc uint8 :offset 13)
(col-qwc uint8 :offset 14)
(stq-qwc uint8 :offset 15)
(cnt uint32 :offset 16)
(vtx uint32 :offset 20)
(col uint32 :offset 24)
(stq uint32 :offset 28)
((textures (inline-array adgif-shader) :score 999 :offset 4)
(vtx-cnt uint32 :score 999 :offset 8)
(cnt-qwc uint8 :score 999 :offset 12)
(vtx-qwc uint8 :score 999 :offset 13)
(col-qwc uint8 :score 999 :offset 14)
(stq-qwc uint8 :score 999 :offset 15)
(cnt uint32 :score 999 :offset 16)
(vtx uint32 :score 999 :offset 20)
(col uint32 :score 999 :offset 24)
(stq uint32 :score 999 :offset 28)
)
:method-count-assert 18
:size-assert #x20
Expand Down Expand Up @@ -11652,12 +11652,12 @@
)

(deftype instance-shrub-work (structure)
((dummy uint128 3 :offset-assert 0)
(chaina uint128 8 :offset-assert 48)
(chainb uint128 8 :offset-assert 176)
((dummy qword 3 :inline :offset-assert 0)
(chaina qword 8 :inline :offset-assert 48)
(chainb qword 8 :inline :offset-assert 176)
(colors rgba 1024 :offset-assert 304)
(matrix-tmpl uint128 20 :offset-assert 4400)
(count-tmpl uint128 20 :offset-assert 4720)
(matrix-tmpl qword 20 :inline :offset-assert 4400)
(count-tmpl qword 20 :inline :offset-assert 4720)
(mscalf-tmpl dma-packet :inline :offset-assert 5040)
(mscalf-ret-tmpl dma-packet :inline :offset-assert 5056)
(adgif-tmpl dma-gif-packet :inline :offset-assert 5072)
Expand Down Expand Up @@ -11926,7 +11926,7 @@

;; - Symbols

(define-extern *instance-tie-work-copy* basic)
(define-extern *instance-tie-work-copy* instance-tie-work)


;; ----------------------
Expand Down Expand Up @@ -15382,11 +15382,14 @@
(define-extern init-background function)
(define-extern finish-background function)

;; - Symbols

(define-extern *instance-shrub-work* instance-shrub-work)
(define-extern *background-work* background-work)
(define-extern *instance-tie-work* instance-tie-work)

;; - Unknowns

;;(define-extern *instance-shrub-work* object) ;; unknown type
;;(define-extern *background-work* object) ;; unknown type
;;(define-extern *instance-tie-work* object) ;; unknown type
;;(define-extern background-vu0-block object) ;; unknown type


Expand All @@ -15412,7 +15415,7 @@

;; - Functions

(define-extern upload-generic-shrub function)
(define-extern upload-generic-shrub (function dma-buffer generic-shrub-fragment int int dma-buffer))
(define-extern shrub-num-tris function)
(define-extern shrub-init-frame function)
(define-extern shrub-upload-model function)
Expand All @@ -15424,7 +15427,7 @@
(define-extern shrub-time function)
(define-extern draw-inline-array-instance-shrub function)
(define-extern draw-prototype-inline-array-shrub function)
(define-extern shrub-upload-test function)
(define-extern shrub-upload-test (function generic-shrub-fragment none))
(define-extern test-func function)

;; - Unknowns
Expand Down Expand Up @@ -15595,9 +15598,9 @@
;; Containing DGOs - ['GAME', 'ENGINE']
;; Version - 3

;; - Unknowns
;; - Symbols

;;(define-extern *prototype-tie-work* object) ;; unknown type
(define-extern *prototype-tie-work* prototype-tie-work)


;; ----------------------
Expand Down
27 changes: 18 additions & 9 deletions decompiler/config/jak1_ntsc_black_label/label_types.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,11 @@
["L275", "uint64", true],
["L133", "_auto_", true]
],

"vol-h": [
["L13", "float", true]
],

"joint": [
["L330", "float", true],
["L329", "float", true]
Expand All @@ -555,7 +555,7 @@
"navigate-h": [
["L20", "float", true]
],

"debug": [
["L221", "float", true],
["L217", "float", true],
Expand Down Expand Up @@ -586,40 +586,49 @@
"entity-table": [
["L8", "(array entity-info)", true]
],

"main": [
["L230", "_lambda_", true]
],

"geometry": [
["L125", "float", true]
],

"level": [
["L452", "_auto_", true],
["L482", "float", true],
["L483", "uint64", true],
["L484", "uint64", true],
["L485", "uint64", true]
],

"process-drawable": [
["L257", "float", true],
["L262", "float", true],
["L260", "float", true],
["L259", "float", true]
],

"logic-target": [
["L264", "float", true],
["L253", "float", true],
["L255", "float", true]
],

"load-boundary": [
["L327", "(inline-array lbvtx)", true, 3]
],


"shrub-work": [
["L3", "instance-shrub-work", true]
],

"tie-work": [
["L1", "prototype-tie-work", true],
["L2", "instance-tie-work", true]
],

// please do not add things after this entry! git is dumb.
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file":[]
}
16 changes: 14 additions & 2 deletions decompiler/config/jak1_ntsc_black_label/type_casts.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,18 @@
"rider-post": [[[0, 99999], "s6", "process-drawable"]],
"pusher-post": [[[0, 99999], "s6", "process-drawable"]],
"process-drawable-delay-player": [[[0, 99999], "s6", "process-drawable"]],

"init-target": [[[0, 99999], "s6", "target"]]
"init-target": [[[0, 99999], "s6", "target"]],

"upload-generic-shrub": [
[[3, 13], "t0", "dma-packet"],
[[15, 26], "v1", "matrix"],
[[31, 44], "t0", "vector4w-2"],
[[47, 71], "t0", "dma-packet"],
[[74, 98], "a2", "dma-packet"],
[[101, 125], "a2", "dma-packet"],
[[128, 152], "a2", "dma-packet"],
[[157, 162], "a1", "dma-packet"]
],

"placeholder-do-not-add-below": []
}
Loading

0 comments on commit 2556284

Please sign in to comment.