From 8e58a5bb13bdd8f38b281fb032c479820d4ad7f6 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Mon, 21 Jun 2021 11:35:44 -0400 Subject: [PATCH 1/3] decomp: Good portion of `collide-frag` --- decompiler/config/all-types.gc | 122 +++++++++--------- .../jak1_ntsc_black_label/type_casts.jsonc | 32 ++--- 2 files changed, 77 insertions(+), 77 deletions(-) diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index e3d30e4595..ce84c15c87 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -5471,9 +5471,9 @@ (:methods (dummy-9 (_type_) _type_ 9) ;; probably login or init. (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) @@ -5489,9 +5489,9 @@ :flag-assert #x1200000024 (:methods (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) @@ -5536,9 +5536,9 @@ :flag-assert #x1200000020 (:methods (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) @@ -5567,9 +5567,9 @@ ;; field distance is a float printed as hex? (:methods (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) @@ -5641,9 +5641,9 @@ :flag-assert #x1200000020 (:methods (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) @@ -5679,9 +5679,9 @@ :flag-assert #x1300000020 (:methods (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) @@ -8728,9 +8728,9 @@ :flag-assert #x1200000040 (:methods (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) @@ -11009,9 +11009,9 @@ :size-assert #x20 :flag-assert #x1200000020 (:methods - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-17 () none 17) @@ -11026,9 +11026,9 @@ :size-assert #x44 :flag-assert #x1200000044 (:methods - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-17 () none 17) @@ -11612,9 +11612,9 @@ :flag-assert #x1200000070 (:methods (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) @@ -11658,9 +11658,9 @@ :flag-assert #x1200000020 (:methods (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) @@ -11678,9 +11678,9 @@ :flag-assert #x1200000050 (:methods (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) @@ -11722,9 +11722,9 @@ (:methods (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) @@ -11899,9 +11899,9 @@ :size-assert #x40 :flag-assert #x1200000040 (:methods - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-17 () none 17) @@ -11918,9 +11918,9 @@ :size-assert #x40 :flag-assert #x1200000040 (:methods - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-17 () none 17) @@ -11935,9 +11935,9 @@ :size-assert #x64 :flag-assert #x1200000064 (:methods - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-17 () none 17) @@ -11951,9 +11951,9 @@ :size-assert #x24 :flag-assert #x1200000024 (:methods - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-17 () none 17) @@ -11968,9 +11968,9 @@ :size-assert #x64 :flag-assert #x1200000064 (:methods - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-17 () none 17) @@ -12158,9 +12158,9 @@ :size-assert #x40 :flag-assert #x1200000040 (:methods - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-17 () none 17) @@ -12174,9 +12174,9 @@ :size-assert #x64 :flag-assert #x1200000064 (:methods - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-11 (_type_) none 11) + (dummy-12 (_type_) none 12) + (dummy-13 (_type_) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-17 () none 17) @@ -17169,7 +17169,7 @@ ;; - Functions -(define-extern sphere-cull function) +(define-extern sphere-cull (function vector symbol)) ;; ---------------------- diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index 84a5d2a1d6..8d4bdc6542 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -609,7 +609,7 @@ [22, "f0", "float"], [28, "f0", "float"] ], - + "joint-anim-inspect-elt": [ [9, "gp", "joint-anim-matrix"], [26, "gp", "joint-anim-transformq"] @@ -633,9 +633,7 @@ [77, "a0", "entity-links"] ], - "(method 0 nav-control)": [ - [17, "t9", "(function string none)"] - ], + "(method 0 nav-control)": [[17, "t9", "(function string none)"]], "add-debug-point": [ [125, "a3", "pointer"], @@ -675,19 +673,21 @@ [92, "a1", "pointer"], [[112, 117], "v1", "dma-packet"] ], - "debug-percent-bar": [ - [[32, 43], "v1", "dma-packet"] - ], - "debug-pad-display": [ - [[70, 75], "v1", "dma-packet"] - ], - "internal-draw-debug-text-3d": [ - [[54, 59], "v1", "dma-packet"] + "debug-percent-bar": [[[32, 43], "v1", "dma-packet"]], + "debug-pad-display": [[[70, 75], "v1", "dma-packet"]], + "internal-draw-debug-text-3d": [[[54, 59], "v1", "dma-packet"]], + "drawable-frag-count": [[[14, 20], "s5", "drawable-group"]], + "generic-init-buffers": [[[39, 44], "v1", "dma-packet"]], + + "(method 13 drawable-inline-array-collide-fragment)": [ + [1, "v1", "collide-fragment"] ], - "drawable-frag-count": [ - [[14, 20], "s5", "drawable-group"] + + "(method 12 drawable-inline-array-collide-fragment)": [ + [1, "v1", "collide-fragment"] ], - "generic-init-buffers": [ - [[39, 44], "v1", "dma-packet"] + + "(method 11 drawable-inline-array-collide-fragment)": [ + [1, "v1", "collide-fragment"] ] } From b05f7f5eae339ed465442b5cf4bc3b87dcfbe835 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Mon, 21 Jun 2021 13:18:07 -0400 Subject: [PATCH 2/3] decomp: Remove redundant method declarations for drawable types --- decompiler/config/all-types.gc | 179 +----------------- .../jak1_ntsc_black_label/type_casts.jsonc | 6 +- goal_src/engine/draw/drawable-actor-h.gc | 2 +- goal_src/engine/draw/drawable-ambient-h.gc | 2 +- goal_src/engine/draw/drawable-h.gc | 22 +-- .../engine/draw/drawable-actor-h_REF.gc | 5 +- .../engine/draw/drawable-ambient-h_REF.gc | 5 +- .../reference/engine/draw/drawable-h_REF.gc | 8 +- 8 files changed, 27 insertions(+), 202 deletions(-) diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index ce84c15c87..3f061ec7d4 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -5470,10 +5470,10 @@ :flag-assert #x1200000020 (:methods (dummy-9 (_type_) _type_ 9) ;; probably login or init. - (dummy-10 (_type_) int 10) - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) + (dummy-10 (_type_ drawable display-frame) int 10) ;; display-frame is from the method inspect tool + (dummy-11 (_type_ int) none 11) ; int - length + (dummy-12 (_type_ int) none 12) ; int - length + (dummy-13 (_type_ int) none 13) ; int - length (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) @@ -5487,16 +5487,6 @@ :method-count-assert 18 :size-assert #x24 :flag-assert #x1200000024 - (:methods - (dummy-10 (_type_) int 10) - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 (_type_ object object) object 16) - (dummy-17 () none 17) - ) ) @@ -5534,16 +5524,6 @@ :method-count-assert 18 :size-assert #x20 :flag-assert #x1200000020 - (:methods - (dummy-10 (_type_) int 10) - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 (_type_ object object) object 16) - (dummy-17 () none 17) - ) ) @@ -5565,16 +5545,6 @@ :size-assert #x20 :flag-assert #x1200000020 ;; field distance is a float printed as hex? - (:methods - (dummy-10 (_type_) int 10) - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 (_type_ object object) object 16) - (dummy-17 () none 17) - ) ) ; (deftype drawable-inline-array-node (drawable-inline-array) @@ -5639,16 +5609,6 @@ :method-count-assert 18 :size-assert #x20 :flag-assert #x1200000020 - (:methods - (dummy-10 (_type_) int 10) - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 (_type_ object object) object 16) - (dummy-17 () none 17) - ) ) (deftype drawable-tree-actor (drawable-tree) @@ -5678,14 +5638,6 @@ :size-assert #x20 :flag-assert #x1300000020 (:methods - (dummy-10 (_type_) int 10) - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 (_type_ object object) object 16) - (dummy-17 () none 17) (dummy-18 () none 18) ) ) @@ -8726,16 +8678,6 @@ :method-count-assert 18 :size-assert #x40 :flag-assert #x1200000040 - (:methods - (dummy-10 (_type_) int 10) - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 (_type_ object object) object 16) - (dummy-17 () none 17) - ) ) @@ -11008,14 +10950,6 @@ :method-count-assert 18 :size-assert #x20 :flag-assert #x1200000020 - (:methods - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-17 () none 17) - ) ) (deftype drawable-inline-array-collide-fragment (drawable-inline-array) @@ -11025,14 +10959,6 @@ :method-count-assert 18 :size-assert #x44 :flag-assert #x1200000044 - (:methods - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-17 () none 17) - ) ) (deftype drawable-tree-collide-fragment (drawable-tree) @@ -11610,16 +11536,6 @@ :method-count-assert 18 :size-assert #x70 :flag-assert #x1200000070 - (:methods - (dummy-10 (_type_) int 10) - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 (_type_ object object) object 16) - (dummy-17 () none 17) - ) ) (deftype shrub-view-data (structure) @@ -11656,16 +11572,6 @@ :method-count-assert 18 :size-assert #x20 :flag-assert #x1200000020 - (:methods - (dummy-10 (_type_) int 10) - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 (_type_ object object) object 16) - (dummy-17 () none 17) - ) ) (deftype instance-shrubbery (instance) @@ -11676,16 +11582,6 @@ :method-count-assert 18 :size-assert #x50 :flag-assert #x1200000050 - (:methods - (dummy-10 (_type_) int 10) - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 (_type_ object object) object 16) - (dummy-17 () none 17) - ) ) (deftype drawable-inline-array-instance-shrub (drawable-inline-array) @@ -11719,17 +11615,6 @@ :method-count-assert 18 :size-assert #x20 :flag-assert #x1200000020 - (:methods - - (dummy-10 (_type_) int 10) - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 (_type_ object object) object 16) - (dummy-17 () none 17) - ) ) (deftype prototype-shrubbery (drawable-inline-array) @@ -11898,14 +11783,6 @@ :method-count-assert 18 :size-assert #x40 :flag-assert #x1200000040 - (:methods - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-17 () none 17) - ) ) (deftype instance-tie (instance) @@ -11917,14 +11794,6 @@ :method-count-assert 18 :size-assert #x40 :flag-assert #x1200000040 - (:methods - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-17 () none 17) - ) ) (deftype drawable-inline-array-instance-tie (drawable-inline-array) @@ -11934,14 +11803,6 @@ :method-count-assert 18 :size-assert #x64 :flag-assert #x1200000064 - (:methods - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-17 () none 17) - ) ) (deftype drawable-tree-instance-tie (drawable-tree) @@ -11950,14 +11811,6 @@ :method-count-assert 18 :size-assert #x24 :flag-assert #x1200000024 - (:methods - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-17 () none 17) - ) ) (deftype prototype-tie (drawable-inline-array) @@ -11967,14 +11820,6 @@ :method-count-assert 18 :size-assert #x64 :flag-assert #x1200000064 - (:methods - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-17 () none 17) - ) ) (deftype tie-matrix (structure) @@ -12157,14 +12002,6 @@ :method-count-assert 18 :size-assert #x40 :flag-assert #x1200000040 - (:methods - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-17 () none 17) - ) ) (deftype drawable-inline-array-tfrag (drawable-inline-array) @@ -12173,14 +12010,6 @@ :method-count-assert 18 :size-assert #x64 :flag-assert #x1200000064 - (:methods - (dummy-11 (_type_) none 11) - (dummy-12 (_type_) none 12) - (dummy-13 (_type_) none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-17 () none 17) - ) ) (deftype drawable-inline-array-trans-tfrag (drawable-inline-array-tfrag) diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index 8d4bdc6542..fcff6d35d6 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -680,14 +680,14 @@ "generic-init-buffers": [[[39, 44], "v1", "dma-packet"]], "(method 13 drawable-inline-array-collide-fragment)": [ - [1, "v1", "collide-fragment"] + [[1, 5], "v1", "collide-fragment"] ], "(method 12 drawable-inline-array-collide-fragment)": [ - [1, "v1", "collide-fragment"] + [[1, 5], "v1", "collide-fragment"] ], "(method 11 drawable-inline-array-collide-fragment)": [ - [1, "v1", "collide-fragment"] + [[1, 5], "v1", "collide-fragment"] ] } diff --git a/goal_src/engine/draw/drawable-actor-h.gc b/goal_src/engine/draw/drawable-actor-h.gc index c3463ba01c..c0d41261b5 100644 --- a/goal_src/engine/draw/drawable-actor-h.gc +++ b/goal_src/engine/draw/drawable-actor-h.gc @@ -26,6 +26,6 @@ ) -(defmethod dummy-10 drawable-tree-actor ((obj _type_)) +(defmethod dummy-10 drawable-tree-actor ((obj _type_) (arg0 drawable) (arg1 display-frame)) 0 ) diff --git a/goal_src/engine/draw/drawable-ambient-h.gc b/goal_src/engine/draw/drawable-ambient-h.gc index bf84fcfce1..81da655330 100644 --- a/goal_src/engine/draw/drawable-ambient-h.gc +++ b/goal_src/engine/draw/drawable-ambient-h.gc @@ -45,7 +45,7 @@ ) ;; definition for method 10 of type drawable-tree-ambient -(defmethod dummy-10 drawable-tree-ambient ((obj drawable-tree-ambient)) +(defmethod dummy-10 drawable-tree-ambient ((obj _type_) (arg0 drawable) (arg1 display-frame)) 0 ) diff --git a/goal_src/engine/draw/drawable-h.gc b/goal_src/engine/draw/drawable-h.gc index dbd91c6a7d..f1f7718439 100644 --- a/goal_src/engine/draw/drawable-h.gc +++ b/goal_src/engine/draw/drawable-h.gc @@ -15,14 +15,14 @@ :size-assert #x20 :flag-assert #x1200000020 (:methods - (dummy-9 (_type_) _type_ 9) - (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-9 (_type_) _type_ 9) ;; probably login or init. + (dummy-10 (_type_ drawable display-frame) int 10) ;; display-frame is from the method inspect tool + (dummy-11 (_type_ int) none 11) ; int - length + (dummy-12 (_type_ int) none 12) ; int - length + (dummy-13 (_type_ int) none 13) ; int - length (dummy-14 () none 14) (dummy-15 () none 15) - (dummy-16 (_type_ object object) object 16) ;; takes at least 3 args, return type is same as the 3rd arg. + (dummy-16 (_type_ object object) object 16) (dummy-17 () none 17) ) ) @@ -33,16 +33,6 @@ :method-count-assert 18 :size-assert #x24 :flag-assert #x1200000024 - (:methods - (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 (_type_ object object) object 16) - (dummy-17 () none 17) - ) ) ;; NOTE - I'm guessing there was a define-extern earlier in the build process diff --git a/test/decompiler/reference/engine/draw/drawable-actor-h_REF.gc b/test/decompiler/reference/engine/draw/drawable-actor-h_REF.gc index c497df66e8..88a35ab2b0 100644 --- a/test/decompiler/reference/engine/draw/drawable-actor-h_REF.gc +++ b/test/decompiler/reference/engine/draw/drawable-actor-h_REF.gc @@ -38,6 +38,9 @@ ) ;; definition for method 10 of type drawable-tree-actor -(defmethod dummy-10 drawable-tree-actor ((obj drawable-tree-actor)) +(defmethod + dummy-10 + drawable-tree-actor + ((obj drawable-tree-actor) (arg0 drawable) (arg1 display-frame)) 0 ) diff --git a/test/decompiler/reference/engine/draw/drawable-ambient-h_REF.gc b/test/decompiler/reference/engine/draw/drawable-ambient-h_REF.gc index 633095ee99..0a6265cd67 100644 --- a/test/decompiler/reference/engine/draw/drawable-ambient-h_REF.gc +++ b/test/decompiler/reference/engine/draw/drawable-ambient-h_REF.gc @@ -41,7 +41,10 @@ ) ;; definition for method 10 of type drawable-tree-ambient -(defmethod dummy-10 drawable-tree-ambient ((obj drawable-tree-ambient)) +(defmethod + dummy-10 + drawable-tree-ambient + ((obj drawable-tree-ambient) (arg0 drawable) (arg1 display-frame)) 0 ) diff --git a/test/decompiler/reference/engine/draw/drawable-h_REF.gc b/test/decompiler/reference/engine/draw/drawable-h_REF.gc index 25c8dd1537..d15ac7a8b8 100644 --- a/test/decompiler/reference/engine/draw/drawable-h_REF.gc +++ b/test/decompiler/reference/engine/draw/drawable-h_REF.gc @@ -11,10 +11,10 @@ :flag-assert #x1200000020 (:methods (dummy-9 (_type_) _type_ 9) - (dummy-10 (_type_) int 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) + (dummy-10 (_type_ drawable display-frame) int 10) + (dummy-11 (_type_ int) none 11) + (dummy-12 (_type_ int) none 12) + (dummy-13 (_type_ int) none 13) (dummy-14 () none 14) (dummy-15 () none 15) (dummy-16 (_type_ object object) object 16) From 2896c3c98dcbc09329d9e43ef23d7b4f3dc5a7b0 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Mon, 21 Jun 2021 13:18:19 -0400 Subject: [PATCH 3/3] decomp: Finish `collide-frag` --- goal_src/engine/collide/collide-frag-h.gc | 3 + goal_src/engine/collide/collide-frag.gc | 207 ++++++++++++++++ .../engine/collide/collide-frag_REF.gc | 220 ++++++++++++++++++ 3 files changed, 430 insertions(+) create mode 100644 test/decompiler/reference/engine/collide/collide-frag_REF.gc diff --git a/goal_src/engine/collide/collide-frag-h.gc b/goal_src/engine/collide/collide-frag-h.gc index 03f70e68b1..9bb203e4ca 100644 --- a/goal_src/engine/collide/collide-frag-h.gc +++ b/goal_src/engine/collide/collide-frag-h.gc @@ -5,6 +5,9 @@ ;; name in dgo: collide-frag-h ;; dgos: GAME, ENGINE +; TODO - defined in drawable, but needed in collide-frag +(define-extern sphere-cull (function vector symbol)) + ;; definition of type collide-frag-vertex (deftype collide-frag-vertex (vector) () diff --git a/goal_src/engine/collide/collide-frag.gc b/goal_src/engine/collide/collide-frag.gc index e3974af415..c1ea009aa3 100644 --- a/goal_src/engine/collide/collide-frag.gc +++ b/goal_src/engine/collide/collide-frag.gc @@ -5,3 +5,210 @@ ;; name in dgo: collide-frag ;; dgos: GAME, ENGINE +;; definition for method 9 of type drawable-tree-collide-fragment +(defmethod + dummy-9 + drawable-tree-collide-fragment + ((obj drawable-tree-collide-fragment)) + obj + ) + +;; definition for method 10 of type drawable-tree-collide-fragment +(defmethod + dummy-10 + drawable-tree-collide-fragment + ((obj drawable-tree-collide-fragment) (arg0 drawable) (arg1 display-frame)) + (when *display-render-collision* + (dotimes (s4-0 (-> obj length)) + (dummy-10 (-> obj data s4-0) (-> obj data s4-0) arg1) + ) + ) + 0 + ) + +;; definition for method 16 of type drawable-tree-collide-fragment +(defmethod + dummy-16 + drawable-tree-collide-fragment + ((obj drawable-tree-collide-fragment) (arg0 object) (arg1 object)) + arg1 + ) + +;; definition for method 11 of type drawable-tree-collide-fragment +;; INFO: Return type mismatch int vs none. +(defmethod + dummy-11 + drawable-tree-collide-fragment + ((obj drawable-tree-collide-fragment) (arg0 int)) + (dummy-11 (-> obj data 0) (-> obj length)) + (let ((v0-1 0)) + ) + (none) + ) + +;; definition for method 12 of type drawable-tree-collide-fragment +;; INFO: Return type mismatch int vs none. +(defmethod + dummy-12 + drawable-tree-collide-fragment + ((obj drawable-tree-collide-fragment) (arg0 int)) + (dummy-12 (-> obj data 0) (-> obj length)) + (let ((v0-1 0)) + ) + (none) + ) + +;; definition for method 13 of type drawable-tree-collide-fragment +;; INFO: Return type mismatch int vs none. +(defmethod + dummy-13 + drawable-tree-collide-fragment + ((obj drawable-tree-collide-fragment) (arg0 int)) + (dummy-13 (-> obj data 0) (-> obj length)) + (let ((v0-1 0)) + ) + (none) + ) + +;; definition for method 8 of type collide-fragment +;; INFO: Return type mismatch int vs collide-fragment. +(defmethod + mem-usage + collide-fragment + ((obj collide-fragment) (arg0 memory-usage-block) (arg1 int)) + (let ((s5-0 (if (nonzero? (logand arg1 1)) + 53 + 50 + ) + ) + (s4-0 (-> obj mesh)) + ) + (set! (-> arg0 data s5-0 name) (symbol->string 'collide-fragment)) + (set! (-> arg0 data s5-0 count) (+ (-> arg0 data s5-0 count) 1)) + (let ((v1-11 (+ (asize-of obj) (asize-of s4-0)))) + (set! (-> arg0 data s5-0 used) (+ (-> arg0 data s5-0 used) v1-11)) + (set! + (-> arg0 data s5-0 total) + (+ (-> arg0 data s5-0 total) (logand -16 (+ v1-11 15))) + ) + ) + (set! (-> arg0 data (+ s5-0 1) name) "collision-poly") + (set! + (-> arg0 data (+ s5-0 1) count) + (+ (-> arg0 data (+ s5-0 1) count) (the-as int (-> s4-0 poly-count))) + ) + (let ((v1-22 (+ (-> s4-0 strip-data-len) (-> s4-0 poly-count)))) + (set! + (-> arg0 data (+ s5-0 1) used) + (+ (-> arg0 data (+ s5-0 1) used) (the-as int v1-22)) + ) + (set! + (-> arg0 data (+ s5-0 1) total) + (+ (-> arg0 data (+ s5-0 1) total) (the-as int v1-22)) + ) + ) + (set! (-> arg0 data (+ s5-0 2) name) "collision-vertex") + (set! + (-> arg0 data (+ s5-0 2) count) + (+ (-> arg0 data (+ s5-0 2) count) (the-as int (-> s4-0 vertex-count))) + ) + (let ((v1-31 (* (-> s4-0 vertex-data-qwc) 16))) + (set! + (-> arg0 data (+ s5-0 2) used) + (+ (-> arg0 data (+ s5-0 2) used) (the-as int v1-31)) + ) + (let ((v0-2 (+ (-> arg0 data (+ s5-0 2) total) (the-as int v1-31)))) + (set! (-> arg0 data (+ s5-0 2) total) v0-2) + (the-as collide-fragment v0-2) + ) + ) + ) + ) + +;; definition for method 9 of type drawable-inline-array-collide-fragment +(defmethod + dummy-9 + drawable-inline-array-collide-fragment + ((obj drawable-inline-array-collide-fragment)) + obj + ) + +;; definition for method 10 of type collide-fragment +(defmethod + dummy-10 + collide-fragment + ((obj collide-fragment) (arg0 drawable) (arg1 display-frame)) + 0 + ) + +;; definition for method 10 of type drawable-inline-array-collide-fragment +(defmethod + dummy-10 + drawable-inline-array-collide-fragment + ((obj drawable-inline-array-collide-fragment) + (arg0 drawable) + (arg1 display-frame) + ) + (dotimes (s4-0 (-> obj length)) + (let ((s3-0 (-> obj data s4-0))) + (if (sphere-cull (-> s3-0 bsphere)) + (dummy-10 s3-0 s3-0 arg1) + ) + ) + ) + 0 + ) + +;; definition for method 11 of type drawable-inline-array-collide-fragment +;; INFO: Return type mismatch int vs none. +(defmethod + dummy-11 + drawable-inline-array-collide-fragment + ((obj drawable-inline-array-collide-fragment) (arg0 int)) + (dummy-11 (the-as collide-fragment (-> obj data)) (-> obj length)) + (none) + ) + +;; definition for method 12 of type drawable-inline-array-collide-fragment +;; INFO: Return type mismatch int vs none. +(defmethod + dummy-12 + drawable-inline-array-collide-fragment + ((obj drawable-inline-array-collide-fragment) (arg0 int)) + (dummy-12 (the-as collide-fragment (-> obj data)) (-> obj length)) + (none) + ) + +;; definition for method 13 of type drawable-inline-array-collide-fragment +;; INFO: Return type mismatch int vs none. +(defmethod + dummy-13 + drawable-inline-array-collide-fragment + ((obj drawable-inline-array-collide-fragment) (arg0 int)) + (dummy-13 (the-as collide-fragment (-> obj data)) (-> obj length)) + (none) + ) + +;; definition for method 8 of type drawable-inline-array-collide-fragment +(defmethod + mem-usage + drawable-inline-array-collide-fragment + ((obj drawable-inline-array-collide-fragment) + (arg0 memory-usage-block) + (arg1 int) + ) + (set! (-> arg0 length) (max 1 (-> arg0 length))) + (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) + (set! (-> arg0 data 0 count) (+ (-> arg0 data 0 count) 1)) + (let ((v1-7 32)) + (set! (-> arg0 data 0 used) (+ (-> arg0 data 0 used) v1-7)) + (set! + (-> arg0 data 0 total) + (+ (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) + ) + ) + (dotimes (s3-0 (-> obj length)) + (mem-usage (-> obj data s3-0) arg0 arg1) + ) + obj + ) diff --git a/test/decompiler/reference/engine/collide/collide-frag_REF.gc b/test/decompiler/reference/engine/collide/collide-frag_REF.gc new file mode 100644 index 0000000000..6510371d00 --- /dev/null +++ b/test/decompiler/reference/engine/collide/collide-frag_REF.gc @@ -0,0 +1,220 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type drawable-tree-collide-fragment +(defmethod + dummy-9 + drawable-tree-collide-fragment + ((obj drawable-tree-collide-fragment)) + obj + ) + +;; definition for method 10 of type drawable-tree-collide-fragment +(defmethod + dummy-10 + drawable-tree-collide-fragment + ((obj drawable-tree-collide-fragment) (arg0 drawable) (arg1 display-frame)) + (when *display-render-collision* + (dotimes (s4-0 (-> obj length)) + (dummy-10 (-> obj data s4-0) (-> obj data s4-0) arg1) + ) + ) + 0 + ) + +;; definition for method 16 of type drawable-tree-collide-fragment +(defmethod + dummy-16 + drawable-tree-collide-fragment + ((obj drawable-tree-collide-fragment) (arg0 object) (arg1 object)) + arg1 + ) + +;; definition for method 11 of type drawable-tree-collide-fragment +;; INFO: Return type mismatch int vs none. +(defmethod + dummy-11 + drawable-tree-collide-fragment + ((obj drawable-tree-collide-fragment) (arg0 int)) + (dummy-11 (-> obj data 0) (-> obj length)) + (let ((v0-1 0)) + ) + (none) + ) + +;; definition for method 12 of type drawable-tree-collide-fragment +;; INFO: Return type mismatch int vs none. +(defmethod + dummy-12 + drawable-tree-collide-fragment + ((obj drawable-tree-collide-fragment) (arg0 int)) + (dummy-12 (-> obj data 0) (-> obj length)) + (let ((v0-1 0)) + ) + (none) + ) + +;; definition for method 13 of type drawable-tree-collide-fragment +;; INFO: Return type mismatch int vs none. +(defmethod + dummy-13 + drawable-tree-collide-fragment + ((obj drawable-tree-collide-fragment) (arg0 int)) + (dummy-13 (-> obj data 0) (-> obj length)) + (let ((v0-1 0)) + ) + (none) + ) + +;; definition for method 8 of type collide-fragment +;; INFO: Return type mismatch int vs collide-fragment. +(defmethod + mem-usage + collide-fragment + ((obj collide-fragment) (arg0 memory-usage-block) (arg1 int)) + (let ((s5-0 (if (nonzero? (logand arg1 1)) + 53 + 50 + ) + ) + (s4-0 (-> obj mesh)) + ) + (set! (-> arg0 data s5-0 name) (symbol->string 'collide-fragment)) + (set! (-> arg0 data s5-0 count) (+ (-> arg0 data s5-0 count) 1)) + (let ((v1-11 (+ (asize-of obj) (asize-of s4-0)))) + (set! (-> arg0 data s5-0 used) (+ (-> arg0 data s5-0 used) v1-11)) + (set! + (-> arg0 data s5-0 total) + (+ (-> arg0 data s5-0 total) (logand -16 (+ v1-11 15))) + ) + ) + (set! (-> arg0 data (+ s5-0 1) name) "collision-poly") + (set! + (-> arg0 data (+ s5-0 1) count) + (+ (-> arg0 data (+ s5-0 1) count) (the-as int (-> s4-0 poly-count))) + ) + (let ((v1-22 (+ (-> s4-0 strip-data-len) (-> s4-0 poly-count)))) + (set! + (-> arg0 data (+ s5-0 1) used) + (+ (-> arg0 data (+ s5-0 1) used) (the-as int v1-22)) + ) + (set! + (-> arg0 data (+ s5-0 1) total) + (+ (-> arg0 data (+ s5-0 1) total) (the-as int v1-22)) + ) + ) + (set! (-> arg0 data (+ s5-0 2) name) "collision-vertex") + (set! + (-> arg0 data (+ s5-0 2) count) + (+ (-> arg0 data (+ s5-0 2) count) (the-as int (-> s4-0 vertex-count))) + ) + (let ((v1-31 (* (-> s4-0 vertex-data-qwc) 16))) + (set! + (-> arg0 data (+ s5-0 2) used) + (+ (-> arg0 data (+ s5-0 2) used) (the-as int v1-31)) + ) + (let ((v0-2 (+ (-> arg0 data (+ s5-0 2) total) (the-as int v1-31)))) + (set! (-> arg0 data (+ s5-0 2) total) v0-2) + (the-as collide-fragment v0-2) + ) + ) + ) + ) + +;; definition for method 9 of type drawable-inline-array-collide-fragment +(defmethod + dummy-9 + drawable-inline-array-collide-fragment + ((obj drawable-inline-array-collide-fragment)) + obj + ) + +;; definition for method 10 of type collide-fragment +(defmethod + dummy-10 + collide-fragment + ((obj collide-fragment) (arg0 drawable) (arg1 display-frame)) + 0 + ) + +;; definition for method 10 of type drawable-inline-array-collide-fragment +(defmethod + dummy-10 + drawable-inline-array-collide-fragment + ((obj drawable-inline-array-collide-fragment) + (arg0 drawable) + (arg1 display-frame) + ) + (dotimes (s4-0 (-> obj length)) + (let ((s3-0 (-> obj data s4-0))) + (if (sphere-cull (-> s3-0 bsphere)) + (dummy-10 s3-0 s3-0 arg1) + ) + ) + ) + 0 + ) + +;; definition for method 11 of type drawable-inline-array-collide-fragment +;; INFO: Return type mismatch int vs none. +(defmethod + dummy-11 + drawable-inline-array-collide-fragment + ((obj drawable-inline-array-collide-fragment) (arg0 int)) + (dummy-11 (the-as collide-fragment (-> obj data)) (-> obj length)) + (let ((v0-1 0)) + ) + (none) + ) + +;; definition for method 12 of type drawable-inline-array-collide-fragment +;; INFO: Return type mismatch int vs none. +(defmethod + dummy-12 + drawable-inline-array-collide-fragment + ((obj drawable-inline-array-collide-fragment) (arg0 int)) + (dummy-12 (the-as collide-fragment (-> obj data)) (-> obj length)) + (let ((v0-1 0)) + ) + (none) + ) + +;; definition for method 13 of type drawable-inline-array-collide-fragment +;; INFO: Return type mismatch int vs none. +(defmethod + dummy-13 + drawable-inline-array-collide-fragment + ((obj drawable-inline-array-collide-fragment) (arg0 int)) + (dummy-13 (the-as collide-fragment (-> obj data)) (-> obj length)) + (let ((v0-1 0)) + ) + (none) + ) + +;; definition for method 8 of type drawable-inline-array-collide-fragment +(defmethod + mem-usage + drawable-inline-array-collide-fragment + ((obj drawable-inline-array-collide-fragment) + (arg0 memory-usage-block) + (arg1 int) + ) + (set! (-> arg0 length) (max 1 (-> arg0 length))) + (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) + (set! (-> arg0 data 0 count) (+ (-> arg0 data 0 count) 1)) + (let ((v1-7 32)) + (set! (-> arg0 data 0 used) (+ (-> arg0 data 0 used) v1-7)) + (set! + (-> arg0 data 0 total) + (+ (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) + ) + ) + (dotimes (s3-0 (-> obj length)) + (mem-usage (-> obj data s3-0) arg0 arg1) + ) + obj + ) + + + +