diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index bbcbd5cf91..c96de62d1c 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -12529,7 +12529,7 @@ ) (deftype shrub-view-data (structure) - ((data uint128 3 :offset-assert 0) + ((data shrub-view-data 3 :offset-assert 0) (texture-giftag qword :inline :offset 0) (consts vector :inline :offset 16) (fog-clamp vector :inline :offset 32) @@ -16734,19 +16734,19 @@ ;; - Functions (define-extern upload-generic-shrub (function dma-buffer generic-shrub-fragment int int dma-buffer)) -(define-extern shrub-num-tris (function shrubbery int)) -(define-extern shrub-init-frame function) -(define-extern shrub-upload-model function) -(define-extern shrub-do-init-frame function) -(define-extern shrub-upload-view-data function) -(define-extern shrub-init-view-data function) -(define-extern mem-usage-shrub-walk function) -(define-extern shrub-make-perspective-matrix (function matrix none)) -(define-extern shrub-time function) +(define-extern shrub-num-tris (function shrubbery uint)) +(define-extern shrub-init-frame (function dma-buffer int none)) +(define-extern shrub-upload-model (function shrubbery shrub-view-data int symbol)) ;; third arg is `start-bank` from shrub-work +(define-extern shrub-do-init-frame (function dma-buffer symbol)) +(define-extern shrub-upload-view-data (function shrub-view-data symbol)) +(define-extern shrub-init-view-data (function shrub-view-data symbol)) +(define-extern mem-usage-shrub-walk (function draw-node drawable-group memory-usage-block int draw-node)) +(define-extern shrub-make-perspective-matrix (function matrix matrix)) +(define-extern shrub-time (function int int int int int int)) ;; unused (define-extern draw-inline-array-instance-shrub function) -(define-extern draw-prototype-inline-array-shrub function) +(define-extern draw-prototype-inline-array-shrub (function int shrub-near-packet none)) (define-extern shrub-upload-test (function generic-shrub-fragment none)) -(define-extern test-func function) +(define-extern test-func (function none)) ;; - Unknowns @@ -19433,7 +19433,7 @@ (define-extern camera-line-rel (function vector vector vector4w none)) (define-extern camera-fov-draw (function int int vector float float vector4w symbol)) (define-extern cam-line-dma (function pointer)) -(define-extern camera-line2d (function (pointer vector4w) (pointer vector4w) pointer)) +(define-extern camera-line2d (function dma-buffer dma-buffer pointer)) (define-extern camera-plot-float-func (function float float float float (function float float) vector4w none)) (define-extern cam-debug-add-coll-tri (function cam-debug-tri vector cam-debug-tri none)) (define-extern debug-euler (function cam-dbg-scratch object)) @@ -23420,7 +23420,7 @@ (:methods (get-lit-skel (_type_) skeleton-group 27) (dummy-28 () none 28) - (wad () _type_ :state 29) + (notice-blue () _type_ :state 29) (plat-startup (plat) _type_ :state 30) ;; state (plat-idle () _type_ :state 31) ;; state (plat-path-active (plat) _type_ :state 32) ;; state diff --git a/decompiler/config/jak1_ntsc_black_label/hacks.jsonc b/decompiler/config/jak1_ntsc_black_label/hacks.jsonc index 9345c6d0a5..cc8bd21309 100644 --- a/decompiler/config/jak1_ntsc_black_label/hacks.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/hacks.jsonc @@ -190,8 +190,8 @@ "draw-node-cull", // shrubbery - "test-func", - "draw-inline-array-instance-shrub", + "draw-inline-array-instance-shrub", // CFG + "draw-drawable-tree-instance-shrub", // CFG // tfrag "stats-tfrag-asm", diff --git a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc index 654e33341d..996b7df69b 100644 --- a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc @@ -1996,6 +1996,10 @@ ["L38", "vector"] ], + "shrubbery": [ + ["L133", "vu-function"] + ], + // please do not add things after this entry! git is dumb. "object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index fb40c9066d..08891e840d 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -7393,5 +7393,32 @@ [31, "s4", "energyarm"] ], + "test-func": [ + [7, "f1", "float"] + ], + + "(method 14 drawable-tree-instance-shrub)": [ + [[12, 151], "gp", "prototype-bucket-shrub"], + [15, "a1", "drawable-group"], + [39, "v1", "drawable-group"], + [61, "s3", "shrubbery"], + [85, "v1", "drawable-group"], + [107, "s3", "shrubbery"], + [151, "gp", "(inline-array prototype-bucket-shrub)"] + ], + + "(method 10 drawable-tree-instance-shrub)": [ + [3, "a1", "terrain-context"] + ], + + "draw-prototype-inline-array-shrub": [ + [156, "v1", "terrain-context"], + [277, "v1", "terrain-context"] + ], + + "(method 8 drawable-tree-instance-shrub)": [ + [54, "v1", "drawable-group"] + ], + "placeholder-do-not-add-below": [] }