[Decomp] Some more collision header files and speed up tests (#296)

* some more

* faster tests

* on by default
This commit is contained in:
water111 2021-03-01 11:15:24 -05:00 committed by GitHub
parent b0686b1ea7
commit 8f68d35cbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 1115 additions and 391 deletions

View file

@ -29,4 +29,10 @@ else()
target_link_libraries(common stdc++fs) target_link_libraries(common stdc++fs)
endif() endif()
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
elseif(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2")
endif()
install(TARGETS common) install(TARGETS common)

View file

@ -4316,7 +4316,7 @@
:flag-assert #x1200000020 :flag-assert #x1200000020
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -4336,7 +4336,7 @@
:flag-assert #x1200000024 :flag-assert #x1200000024
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -4364,7 +4364,7 @@
:flag-assert #x1200000020 :flag-assert #x1200000020
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -4391,7 +4391,7 @@
;; field distance is a float printed as hex? ;; field distance is a float printed as hex?
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -4434,7 +4434,7 @@
:flag-assert #x1200000020 :flag-assert #x1200000020
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -4468,7 +4468,7 @@
:flag-assert #x1300000020 :flag-assert #x1300000020
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -7388,7 +7388,7 @@
:flag-assert #x1200000040 :flag-assert #x1200000040
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -9134,219 +9134,223 @@
) )
) )
; ;; collide-touch-h ;; collide-touch-h
; (deftype touching-prim (structure) (deftype touching-prim (structure)
; ((cprim basic :offset-assert 0) ((cprim basic :offset-assert 0)
; (has-tri? basic :offset-assert 4) (has-tri? basic :offset-assert 4)
; (tri collide-tri-result :inline :offset-assert 16) (tri collide-tri-result :inline :offset-assert 16)
; ) )
; :method-count-assert 9 :method-count-assert 9
; :size-assert #x64 :size-assert #x64
; :flag-assert #x900000064 :flag-assert #x900000064
; ) )
; ;; collide-touch-h ;; collide-touch-h
; (deftype touching-prims-entry (structure) (deftype touching-prims-entry (structure)
; ((next touching-prims-entry :offset-assert 0) ((next touching-prims-entry :offset-assert 0)
; (prev touching-prims-entry :offset-assert 4) (prev touching-prims-entry :offset-assert 4)
; (allocated? basic :offset-assert 8) (allocated? basic :offset-assert 8)
; (u float :offset-assert 12) (u float :offset-assert 12)
; (prim1 touching-prim :inline :offset-assert 16) (prim1 touching-prim :inline :offset-assert 16)
; (prim2 touching-prim :inline :offset-assert 128) (prim2 touching-prim :inline :offset-assert 128)
; ) )
; :method-count-assert 13 :method-count-assert 13
; :size-assert #xe4 :size-assert #xe4
; :flag-assert #xd000000e4 :flag-assert #xd000000e4
; (:methods (:methods
; (dummy-9 () none 9) (dummy-9 () none 9)
; (dummy-10 () none 10) (dummy-10 () none 10)
; (dummy-11 () none 11) (dummy-11 () none 11)
; (dummy-12 () none 12) (dummy-12 () none 12)
; ) )
; ) )
; ;; collide-touch-h ;; collide-touch-h
; (deftype touching-prims-entry-pool (structure) (deftype touching-prims-entry-pool (structure)
; ((head touching-prims-entry :offset-assert 0) ((head touching-prims-entry :offset-assert 0)
; (nodes UNKNOWN 64 :offset-assert 16) (nodes touching-prims-entry 64 :inline :offset-assert 16)
; ) )
; :method-count-assert 13 :method-count-assert 13
; :size-assert #x3c10 :size-assert #x3c10
; :flag-assert #xd00003c10 :flag-assert #xd00003c10
; (:methods (:methods
; (dummy-9 () none 9) (new (symbol type) _type_ 0)
; (dummy-10 () none 10) (dummy-9 () none 9)
; (dummy-11 () none 11) (dummy-10 () none 10)
; (dummy-12 () none 12) (init-list! (_type_) none 11)
; ) (dummy-12 () none 12)
; ) )
)
; ;; collide-touch-h ;; collide-touch-h
; (deftype touching-shapes-entry (structure) (deftype touching-shapes-entry (structure)
; ((cshape1 basic :offset-assert 0) ((cshape1 basic :offset-assert 0)
; (cshape2 basic :offset-assert 4) (cshape2 basic :offset-assert 4)
; (resolve-u int8 :offset-assert 8) (resolve-u int8 :offset-assert 8)
; (head touching-prims-entry :offset-assert 12) (head touching-prims-entry :offset-assert 12)
; ) )
; :method-count-assert 18 :allow-misaligned
; :size-assert #x10 :method-count-assert 18
; :flag-assert #x1200000010 :size-assert #x10
; (:methods :flag-assert #x1200000010
; (dummy-9 () none 9) (:methods
; (dummy-10 () none 10) (dummy-9 () none 9)
; (dummy-11 () none 11) (dummy-10 () none 10)
; (dummy-12 () none 12) (dummy-11 () none 11)
; (dummy-13 () none 13) (dummy-12 () none 12)
; (dummy-14 () none 14) (dummy-13 () none 13)
; (dummy-15 () none 15) (dummy-14 () none 14)
; (dummy-16 () none 16) (dummy-15 () none 15)
; (dummy-17 () none 17) (get-head (_type_) touching-prims-entry 16)
; ) (unknown1 (_type_ (xx (pointer uint32))) uint 17)
; ) )
)
; ;; collide-touch-h ;; collide-touch-h
; (deftype touching-list (structure) (deftype touching-list (structure)
; ((num-touching-shapes int32 :offset-assert 0) ((num-touching-shapes int32 :offset-assert 0)
; (resolve-u int8 :offset-assert 4) (resolve-u int8 :offset-assert 4)
; (touching-shapes UNKNOWN 32 :offset-assert 8) (touching-shapes touching-shapes-entry 32 :inline :offset-assert 8)
; ) )
; :method-count-assert 15 :method-count-assert 15
; :size-assert #x208 :size-assert #x208
; :flag-assert #xf00000208 :flag-assert #xf00000208
; (:methods (:methods
; (dummy-9 () none 9) (new (symbol type) _type_ 0)
; (dummy-10 () none 10) (dummy-9 () none 9)
; (dummy-11 () none 11) (dummy-10 () none 10)
; (dummy-12 () none 12) (dummy-11 () none 11)
; (dummy-13 () none 13) (dummy-12 () none 12)
; (dummy-14 () none 14) (dummy-13 () none 13)
; ) (dummy-14 () none 14)
; ) )
)
; ;; collide-edge-grab-h ;; collide-edge-grab-h
; (deftype edge-grab-info (structure) (deftype edge-grab-info (structure)
; ((world-vertex UNKNOWN 6 :offset-assert 0) ((world-vertex vector 6 :inline :offset-assert 0)
; (local-vertex UNKNOWN 6 :offset-assert 96) (local-vertex vector 6 :inline :offset-assert 96)
; (actor-cshape-prim-offset int32 :offset-assert 192) (actor-cshape-prim-offset int32 :offset-assert 192)
; (actor-handle uint64 :offset-assert 200) (actor-handle uint64 :offset-assert 200)
; (hanging-matrix matrix :inline :offset-assert 208) (hanging-matrix matrix :inline :offset-assert 208)
; (edge-vertex UNKNOWN 2 :offset-assert 0) (edge-vertex vector 2 :inline :offset 0)
; (center-hold vector :inline :offset-assert 32) (center-hold vector :inline :offset 32)
; (tri-vertex UNKNOWN 3 :offset-assert 48) (tri-vertex vector 3 :inline :offset 48)
; (left-hand-hold vector :inline :offset-assert 272) (left-hand-hold vector :inline :offset-assert 272)
; (right-hand-hold vector :inline :offset-assert 288) (right-hand-hold vector :inline :offset-assert 288)
; (center-hold-old vector :inline :offset-assert 304) (center-hold-old vector :inline :offset-assert 304)
; (edge-tri-pat uint32 :offset-assert 320) (edge-tri-pat uint32 :offset-assert 320)
; ) )
; :method-count-assert 11 :method-count-assert 11
; :size-assert #x144 :size-assert #x144
; :flag-assert #xb00000144 :flag-assert #xb00000144
; (:methods (:methods
; (dummy-9 () none 9) (dummy-9 () none 9)
; (dummy-10 () none 10) (dummy-10 () none 10)
; ) )
; ) )
; ;; collide-edge-grab-h ;; collide-edge-grab-h
; (deftype collide-edge-tri (structure) (declare-type collide-cache-tri structure)
; ((ctri collide-cache-tri :offset-assert 0) (deftype collide-edge-tri (structure)
; (normal vector :inline :offset-assert 16) ((ctri collide-cache-tri :offset-assert 0)
; ) (normal vector :inline :offset-assert 16)
; :method-count-assert 9 )
; :size-assert #x20 :method-count-assert 9
; :flag-assert #x900000020 :size-assert #x20
; ) :flag-assert #x900000020
)
; ;; collide-edge-grab-h ;; collide-edge-grab-h
; (deftype collide-edge-edge (structure) (deftype collide-edge-edge (structure)
; ((ignore basic :offset-assert 0) ((ignore basic :offset-assert 0)
; (etri collide-edge-tri :offset-assert 4) (etri collide-edge-tri :offset-assert 4)
; (vertex-ptr UNKNOWN 2 :offset-assert 8) (vertex-ptr vector 2 :offset-assert 8)
; (outward vector :inline :offset-assert 16) (outward vector :inline :offset-assert 16)
; (edge-vec-norm vector :inline :offset-assert 32) (edge-vec-norm vector :inline :offset-assert 32)
; ) )
; :method-count-assert 9 :method-count-assert 9
; :size-assert #x30 :size-assert #x30
; :flag-assert #x900000030 :flag-assert #x900000030
; ) )
; ;; collide-edge-grab-h ;; collide-edge-grab-h
; (deftype collide-edge-hold-item (structure) (deftype collide-edge-hold-item (structure)
; ((next collide-edge-hold-item :offset-assert 0) ((next collide-edge-hold-item :offset-assert 0)
; (rating float :offset-assert 4) (rating float :offset-assert 4)
; (split int8 :offset-assert 8) (split int8 :offset-assert 8)
; (edge collide-edge-edge :offset-assert 12) (edge collide-edge-edge :offset-assert 12)
; (center-pt vector :inline :offset-assert 16) (center-pt vector :inline :offset-assert 16)
; (outward-pt vector :inline :offset-assert 32) (outward-pt vector :inline :offset-assert 32)
; ) )
; :method-count-assert 9 :method-count-assert 9
; :size-assert #x30 :size-assert #x30
; :flag-assert #x900000030 :flag-assert #x900000030
; ) )
; ;; collide-edge-grab-h ;; collide-edge-grab-h
; (deftype collide-edge-hold-list (structure) (deftype collide-edge-hold-list (structure)
; ((num-allocs uint32 :offset-assert 0) ((num-allocs uint32 :offset-assert 0)
; (num-attempts uint32 :offset-assert 4) (num-attempts uint32 :offset-assert 4)
; (head collide-edge-hold-item :offset-assert 8) (head collide-edge-hold-item :offset-assert 8)
; (items UNKNOWN 32 :offset-assert 16) (items collide-edge-hold-item 32 :inline :offset-assert 16)
; (attempts UNKNOWN 32 :offset-assert 1552) (attempts qword 32 :inline :offset-assert 1552)
; ) )
; :method-count-assert 11 :method-count-assert 11
; :size-assert #x810 :size-assert #x810
; :flag-assert #xb00000810 :flag-assert #xb00000810
; (:methods (:methods
; (dummy-9 () none 9) (dummy-9 () none 9)
; (dummy-10 () none 10) (dummy-10 () none 10)
; ) )
; ) )
; ;; collide-edge-grab-h ;; collide-edge-grab-h
; (deftype collide-edge-work (structure) (deftype collide-edge-work (structure)
; ((ccache basic :offset-assert 0) ((ccache basic :offset-assert 0)
; (cshape basic :offset-assert 4) (cshape basic :offset-assert 4)
; (num-verts uint32 :offset-assert 8) (num-verts uint32 :offset-assert 8)
; (num-edges uint32 :offset-assert 12) (num-edges uint32 :offset-assert 12)
; (num-tris uint32 :offset-assert 16) (num-tris uint32 :offset-assert 16)
; (cache-fill-box bounding-box :inline :offset-assert 32) (cache-fill-box bounding-box :inline :offset-assert 32)
; (within-reach-box bounding-box :inline :offset-assert 64) (within-reach-box bounding-box :inline :offset-assert 64)
; (within-reach-box4w bounding-box4w :inline :offset-assert 96) (within-reach-box4w bounding-box4w :inline :offset-assert 96)
; (search-pt vector :inline :offset-assert 128) (search-pt vector :inline :offset-assert 128)
; (search-dir-vec vector :inline :offset-assert 144) (search-dir-vec vector :inline :offset-assert 144)
; (max-dist-sqrd-to-outward-pt float :offset-assert 160) (max-dist-sqrd-to-outward-pt float :offset-assert 160)
; (max-dir-cosa-delta float :offset-assert 164) (max-dir-cosa-delta float :offset-assert 164)
; (split-dists UNKNOWN 2 :offset-assert 168) (split-dists float 2 :offset-assert 168)
; (outward-offset vector :inline :offset-assert 176) (outward-offset vector :inline :offset-assert 176)
; (local-cache-fill-box bounding-box :inline :offset-assert 192) (local-cache-fill-box bounding-box :inline :offset-assert 192)
; (local-within-reach-box bounding-box :inline :offset-assert 224) (local-within-reach-box bounding-box :inline :offset-assert 224)
; (local-player-spheres UNKNOWN 12 :offset-assert 256) (local-player-spheres sphere 12 :inline :offset-assert 256)
; (world-player-spheres UNKNOWN 12 :offset-assert 448) (world-player-spheres sphere 12 :inline :offset-assert 448)
; (local-player-hanging-spheres UNKNOWN 6 :offset-assert 256) (local-player-hanging-spheres sphere 6 :inline :offset 256)
; (world-player-hanging-spheres UNKNOWN 6 :offset-assert 448) (world-player-hanging-spheres sphere 6 :inline :offset 448)
; (local-player-leap-up-spheres UNKNOWN 6 :offset-assert 352) (local-player-leap-up-spheres sphere 6 :inline :offset 352)
; (world-player-leap-up-spheres UNKNOWN 6 :offset-assert 544) (world-player-leap-up-spheres sphere 6 :inline :offset 544)
; (verts UNKNOWN 64 :offset-assert 640) (verts vector 64 :inline :offset-assert 640)
; (edges UNKNOWN 96 :offset-assert 1664) (edges collide-edge-edge 96 :inline :offset-assert 1664)
; (tris UNKNOWN 48 :offset-assert 6272) (tris collide-edge-tri 48 :inline :offset-assert 6272)
; (hold-list collide-edge-hold-list :inline :offset-assert 7808) (hold-list collide-edge-hold-list :inline :offset-assert 7808)
; ) )
; :method-count-assert 20 :method-count-assert 20
; :size-assert #x2690 :size-assert #x2690
; :flag-assert #x1400002690 :flag-assert #x1400002690
; (:methods (:methods
; (dummy-9 () none 9) (dummy-9 () none 9)
; (dummy-10 () none 10) (dummy-10 () none 10)
; (dummy-11 () none 11) (dummy-11 () none 11)
; (dummy-12 () none 12) (dummy-12 () none 12)
; (dummy-13 () none 13) (dummy-13 () none 13)
; (dummy-14 () none 14) (dummy-14 () none 14)
; (dummy-15 () none 15) (dummy-15 () none 15)
; (dummy-16 () none 16) (dummy-16 () none 16)
; (dummy-17 () none 17) (dummy-17 () none 17)
; (dummy-18 () none 18) (dummy-18 () none 18)
; (dummy-19 () none 19) (dummy-19 () none 19)
; ) )
; ) )
; ;; effect-control-h ; ;; effect-control-h
; (deftype effect-control (basic) ; (deftype effect-control (basic)
@ -9671,16 +9675,13 @@
) )
) )
; ;; stats-h ;; stats-h
; (deftype perf-stat-array (inline-array-class) (deftype perf-stat-array (inline-array-class)
; ((length int32 :offset-assert 4) ()
; (allocated-length int32 :offset-assert 8) :method-count-assert 9
; (data UNKNOWN :dynamic :offset-assert 16) :size-assert #x10
; ) :flag-assert #x900000010
; :method-count-assert 9 )
; :size-assert #x10
; :flag-assert #x900000010
; )
;; bsp-h ;; bsp-h
(deftype bsp-node (structure) (deftype bsp-node (structure)
@ -9720,15 +9721,20 @@
:flag-assert #x900000080 :flag-assert #x900000080
) )
; ;; bsp-h ;; bsp-h
; (deftype bsp-header (drawable) ; (deftype bsp-header (drawable)
; () ; ((all-visible-list pointer :offset-assert 32)
; (visible-list-length int32 :offset-assert 36)
; (drawable-trees basic :offset-assert 40)
; (pat uint32 :offset-assert 44)
; (pat-length int32 :offset-asert 48)
; )
; :method-count-assert 20 ; :method-count-assert 20
; :size-assert #x190 ; :size-assert #x190
; :flag-assert #x1400000190 ; :flag-assert #x1400000190
; (:methods ; (:methods
; (dummy-9 () none 9) ; (dummy-9 () none 9)
; (dummy-10 () none 10) ; (dummy-10 (_type_) int 10)
; (dummy-11 () none 11) ; (dummy-11 () none 11)
; (dummy-12 () none 12) ; (dummy-12 () none 12)
; (dummy-13 () none 13) ; (dummy-13 () none 13)
@ -9809,99 +9815,99 @@
) )
) )
; ;; collide-cache-h ;; collide-cache-h
; (deftype collide-puyp-work (structure) (deftype collide-puyp-work (structure)
; ((best-u float :offset-assert 0) ((best-u float :offset-assert 0)
; (ignore-pat uint32 :offset-assert 4) (ignore-pat uint32 :offset-assert 4)
; (tri-out collide-tri-result :offset-assert 8) (tri-out collide-tri-result :offset-assert 8)
; (start-pos vector :inline :offset-assert 16) (start-pos vector :inline :offset-assert 16)
; (move-dist vector :inline :offset-assert 32) (move-dist vector :inline :offset-assert 32)
; ) )
; :method-count-assert 9 :method-count-assert 9
; :size-assert #x30 :size-assert #x30
; :flag-assert #x900000030 :flag-assert #x900000030
; ) )
; ;; collide-cache-h ;; collide-cache-h
; (deftype collide-cache-tri (structure) (deftype collide-cache-tri (structure)
; ((vertex UNKNOWN 3 :offset-assert 0) ((vertex vector 3 :inline :offset-assert 0)
; (extra-quad UNKNOWN 16 :offset-assert 48) ;(extra-quad UNKNOWN 16 :offset-assert 48)
; (pat uint32 :offset-assert 48) (pat uint32 :offset-assert 48)
; (prim-index uint16 :offset-assert 52) (prim-index uint16 :offset-assert 52)
; (user16 uint16 :offset-assert 54) (user16 uint16 :offset-assert 54)
; (user32 UNKNOWN 2 :offset-assert 56) (user32 uint32 2 :offset-assert 56)
; ) )
; :method-count-assert 9 :method-count-assert 9
; :size-assert #x40 :size-assert #x40
; :flag-assert #x900000040 :flag-assert #x900000040
; ) )
; ;; collide-cache-h ;; collide-cache-h
; (deftype collide-cache-prim (structure) (deftype collide-cache-prim (structure)
; ((prim-core collide-prim-core :inline :offset-assert 0) ((prim-core collide-prim-core :inline :offset-assert 0)
; (extra-quad UNKNOWN 16 :offset-assert 32) ;;(extra-quad UNKNOWN 16 :offset-assert 32)
; (ccache basic :offset-assert 32) (ccache basic :offset-assert 32)
; (prim basic :offset-assert 36) (prim basic :offset-assert 36)
; (first-tri uint16 :offset-assert 40) (first-tri uint16 :offset-assert 40)
; (num-tris uint16 :offset-assert 42) (num-tris uint16 :offset-assert 42)
; (unused UNKNOWN 4 :offset-assert 44) (unused uint8 4 :offset-assert 44)
; (world-sphere vector :inline :offset-assert 0) (world-sphere vector :inline :offset 0)
; (collide-as uint64 :offset-assert 16) (collide-as uint64 :offset 16)
; (action uint32 :offset-assert 24) (action uint32 :offset 24)
; (offense int8 :offset-assert 28) (offense int8 :offset 28)
; (prim-type int8 :offset-assert 29) (prim-type int8 :offset 29)
; ) )
; :method-count-assert 11 :method-count-assert 11
; :size-assert #x30 :size-assert #x30
; :flag-assert #xb00000030 :flag-assert #xb00000030
; (:methods (:methods
; (dummy-9 () none 9) (dummy-9 () none 9)
; (dummy-10 () none 10) (dummy-10 () none 10)
; ) )
; ) )
; ;; collide-cache-h ;; collide-cache-h
; (deftype collide-cache (basic) (deftype collide-cache (basic)
; ((num-tris int32 :offset-assert 4) ((num-tris int32 :offset-assert 4)
; (num-prims int32 :offset-assert 8) (num-prims int32 :offset-assert 8)
; (ignore-mask uint32 :offset-assert 12) (ignore-mask uint32 :offset-assert 12)
; (proc basic :offset-assert 16) (proc basic :offset-assert 16)
; (collide-box bounding-box :inline :offset-assert 32) (collide-box bounding-box :inline :offset-assert 32)
; (collide-box4w bounding-box4w :inline :offset-assert 64) (collide-box4w bounding-box4w :inline :offset-assert 64)
; (collide-with uint64 :offset-assert 96) (collide-with uint64 :offset-assert 96)
; (prims UNKNOWN 100 :offset-assert 112) (prims collide-cache-prim 100 :inline :offset-assert 112)
; (tris UNKNOWN 461 :offset-assert 4912) (tris collide-cache-tri 461 :inline :offset-assert 4912)
; ) )
; :method-count-assert 33 :method-count-assert 33
; :size-assert #x8670 :size-assert #x8670
; :flag-assert #x2100008670 :flag-assert #x2100008670
; (:methods (:methods
; (dummy-9 () none 9) (dummy-9 () none 9)
; (dummy-10 () none 10) (dummy-10 () none 10)
; (dummy-11 () none 11) (dummy-11 () none 11)
; (dummy-12 () none 12) (dummy-12 () none 12)
; (dummy-13 () none 13) (dummy-13 () none 13)
; (dummy-14 () none 14) (dummy-14 () none 14)
; (dummy-15 () none 15) (dummy-15 () none 15)
; (dummy-16 () none 16) (dummy-16 () none 16)
; (dummy-17 () none 17) (dummy-17 () none 17)
; (dummy-18 () none 18) (dummy-18 () none 18)
; (dummy-19 () none 19) (dummy-19 () none 19)
; (dummy-20 () none 20) (dummy-20 () none 20)
; (dummy-21 () none 21) (dummy-21 () none 21)
; (dummy-22 () none 22) (dummy-22 () none 22)
; (dummy-23 () none 23) (dummy-23 () none 23)
; (dummy-24 () none 24) (dummy-24 () none 24)
; (dummy-25 () none 25) (dummy-25 () none 25)
; (dummy-26 () none 26) (dummy-26 () none 26)
; (dummy-27 () none 27) (dummy-27 () none 27)
; (dummy-28 () none 28) (dummy-28 () none 28)
; (dummy-29 () none 29) (dummy-29 () none 29)
; (dummy-30 () none 30) (dummy-30 () none 30)
; (dummy-31 () none 31) (dummy-31 () none 31)
; (dummy-32 () none 32) (dummy-32 () none 32)
; ) )
; ) )
;; collide-cache-h ;; collide-cache-h
(deftype collide-list-item (structure) (deftype collide-list-item (structure)
@ -9943,7 +9949,7 @@
:flag-assert #x1200000070 :flag-assert #x1200000070
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -9992,7 +9998,7 @@
:flag-assert #x1200000020 :flag-assert #x1200000020
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -10014,7 +10020,7 @@
:flag-assert #x1200000050 :flag-assert #x1200000050
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -10043,7 +10049,7 @@
:flag-assert #x1200000020 :flag-assert #x1200000020
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -33353,13 +33359,13 @@
;;(define-extern collide-history object) ;; unknown type ;;(define-extern collide-history object) ;; unknown type
;;(define-extern touching-list object) ;; unknown type ;;(define-extern touching-list object) ;; unknown type
;;(define-extern touching-shapes-entry object) ;; unknown type ;;(define-extern touching-shapes-entry object) ;; unknown type
;;(define-extern *touching-prims-entry-pool* object) ;; unknown type (define-extern *touching-prims-entry-pool* touching-prims-entry-pool) ;; unknown type
;;(define-extern touching-prims-entry object) ;; unknown type ;;(define-extern touching-prims-entry object) ;; unknown type
;;(define-extern touching-prims-entry-pool object) ;; unknown type ;;(define-extern touching-prims-entry-pool object) ;; unknown type
;;(define-extern *touching-list* object) ;; unknown type (define-extern *touching-list* touching-list) ;; unknown type
;;(define-extern touching-prim object) ;; unknown type ;;(define-extern touching-prim object) ;; unknown type
;;(define-extern collide-edge-tri object) ;; unknown type ;;(define-extern collide-edge-tri object) ;; unknown type
;;(define-extern *edge-grab-info* object) ;; unknown type (define-extern *edge-grab-info* edge-grab-info) ;; unknown type
;;(define-extern collide-edge-edge object) ;; unknown type ;;(define-extern collide-edge-edge object) ;; unknown type
;;(define-extern edge-grab-info object) ;; unknown type ;;(define-extern edge-grab-info object) ;; unknown type
;;(define-extern collide-edge-hold-list object) ;; unknown type ;;(define-extern collide-edge-hold-list object) ;; unknown type
@ -33407,14 +33413,14 @@
;;(define-extern view-frustum object) ;; unknown type ;;(define-extern view-frustum object) ;; unknown type
;;(define-extern collide-stats object) ;; unknown type ;;(define-extern collide-stats object) ;; unknown type
;;(define-extern collide-cache-tri object) ;; unknown type ;;(define-extern collide-cache-tri object) ;; unknown type
;;(define-extern *collide-cache* object) ;; unknown type (define-extern *collide-cache* collide-cache) ;; unknown type
;;(define-extern collide-list-item object) ;; unknown type ;;(define-extern collide-list-item object) ;; unknown type
;;(define-extern *collide-work* object) ;; unknown type (define-extern *collide-work* collide-work) ;; unknown type
;;(define-extern collide-using-spheres-params object) ;; unknown type ;;(define-extern collide-using-spheres-params object) ;; unknown type
;;(define-extern collide-puss-work object) ;; unknown type ;;(define-extern collide-puss-work object) ;; unknown type
;;(define-extern collide-puss-sphere object) ;; unknown type ;;(define-extern collide-puss-sphere object) ;; unknown type
;;(define-extern collide-puyp-work object) ;; unknown type ;;(define-extern collide-puyp-work object) ;; unknown type
;;(define-extern *collide-list* object) ;; unknown type (define-extern *collide-list* collide-list) ;; unknown type
;;(define-extern collide-work object) ;; unknown type ;;(define-extern collide-work object) ;; unknown type
;;(define-extern collide-cache-prim object) ;; unknown type ;;(define-extern collide-cache-prim object) ;; unknown type
;;(define-extern collide-list object) ;; unknown type ;;(define-extern collide-list object) ;; unknown type
@ -33627,32 +33633,32 @@
;;(define-extern nav-max-users object) ;; unknown type ;;(define-extern nav-max-users object) ;; unknown type
;;(define-extern nav-engine object) ;; unknown type ;;(define-extern nav-engine object) ;; unknown type
;;(define-extern nearest-y-threshold object) ;; unknown type ;;(define-extern nearest-y-threshold object) ;; unknown type
(define-extern dgo-load-begin function) (define-extern dgo-load-begin (function int int int int int))
(define-extern dgo-load-continue function) (define-extern dgo-load-continue function)
(define-extern destroy-mem function) (define-extern destroy-mem function)
(define-extern str-load (function string int pointer int symbol)) (define-extern str-load (function string int pointer int symbol))
;;(define-extern *load-str-rpc* object) ;; unknown type (define-extern *load-str-rpc* rpc-buffer-pair) ;; unknown type
;;(define-extern load-chunk-msg object) ;; unknown type ;;(define-extern load-chunk-msg object) ;; unknown type
;;(define-extern *dgo-name* object) ;; unknown type ;;(define-extern *dgo-name* object) ;; unknown type
(define-extern str-ambient-play function) (define-extern str-ambient-play (function string none))
;;(define-extern *load-str-lock* object) ;; unknown type (define-extern *load-str-lock* symbol) ;; unknown type
(define-extern str-load-status (function (pointer int32) symbol)) (define-extern str-load-status (function (pointer int32) symbol))
(define-extern str-load-cancel function) (define-extern str-load-cancel (function none))
(define-extern str-play-queue function) (define-extern str-play-queue (function string none))
(define-extern str-ambient-stop function) (define-extern str-ambient-stop (function string none))
(define-extern dgo-load-get-next function) (define-extern dgo-load-get-next function)
(define-extern find-temp-buffer function) (define-extern find-temp-buffer function)
(define-extern str-play-kick function) (define-extern str-play-kick (function none))
;;(define-extern load-dgo-msg object) ;; unknown type ;;(define-extern load-dgo-msg object) ;; unknown type
;;(define-extern *load-dgo-rpc* object) ;; unknown type (define-extern *load-dgo-rpc* rpc-buffer-pair) ;; unknown type
;;(define-extern *que-str-lock* object) ;; unknown type (define-extern *que-str-lock* symbol) ;; unknown type
(define-extern dgo-load-cancel function) (define-extern dgo-load-cancel function)
(define-extern dgo-load-link function) (define-extern dgo-load-link function)
;;(define-extern *dgo-time* object) ;; unknown type ;;(define-extern *dgo-time* object) ;; unknown type
;;(define-extern dgo-header object) ;; unknown type ;;(define-extern dgo-header object) ;; unknown type
(define-extern str-play-async function) (define-extern str-play-async (function string int none))
(define-extern str-play-stop function) (define-extern str-play-stop (function string none))
;;(define-extern *play-str-rpc* object) ;; unknown type (define-extern *play-str-rpc* rpc-buffer-pair) ;; unknown type
(define-extern string->sound-name function) (define-extern string->sound-name function)
;;(define-extern complete object) ;; unknown type ;;(define-extern complete object) ;; unknown type
;;(define-extern busy object) ;; unknown type ;;(define-extern busy object) ;; unknown type
@ -36486,7 +36492,7 @@
(define-extern anim-test-obj-init function) (define-extern anim-test-obj-init function)
(define-extern anim-test-anim-list-handler function) (define-extern anim-test-anim-list-handler function)
(define-extern anim-tester-add-sequence function) (define-extern anim-tester-add-sequence function)
(define-extern anim-tester-num-print function) (define-extern anim-tester-num-print (function symbol float none))
;;(define-extern *anim-tester* object) ;; unknown type ;;(define-extern *anim-tester* object) ;; unknown type
;;(define-extern list-control object) ;; unknown type ;;(define-extern list-control object) ;; unknown type
(define-extern anim-test-edit-seq-insert-item function) (define-extern anim-test-edit-seq-insert-item function)

View file

@ -272,7 +272,10 @@
["L27", "float", true], ["L27", "float", true],
["L25", "_auto_", true], ["L25", "_auto_", true],
["L24", "_auto_", true] ["L24", "_auto_", true]
] ],
"collide-edge-grab-h":[
["L1", "collide-edge-work", true]]

View file

@ -232,7 +232,37 @@
], ],
"(method 0 collide-shape-prim-group)":[ "(method 0 collide-shape-prim-group)":[
[11, ["v0", "collide-shape-prim-group"]] [11, ["v0", "collide-shape-prim-group"]]
] ],
"(method 11 touching-prims-entry-pool)":[
[5, ["a1", "(inline-array touching-prims-entry)"]]],
"(method 0 touching-list)":[
[6, ["v0", "touching-list"]]],
"str-load":[
[21, ["s2", "load-chunk-msg"]]
],
"str-play-async":[
[13, ["s4", "load-chunk-msg"]]
],
"str-play-stop":[
[7, ["v0", "load-chunk-msg"]]
],
"str-play-queue":[
[19, ["v0", "load-chunk-msg"]]
],
"str-ambient-play":[
[7, ["v0", "load-chunk-msg"]]
],
"str-ambient-stop":[
[7, ["v0", "load-chunk-msg"]]
]

View file

@ -598,6 +598,9 @@
"(method 0 collide-shape)":{ "(method 0 collide-shape)":{
"args":["allocation", "type-to-make", "proc", "collide-list-kind", "prim-id"], "args":["allocation", "type-to-make", "proc", "collide-list-kind", "prim-id"],
"vars":{"s5-0":"obj"} "vars":{"s5-0":"obj"}
},
"(method 11 touching-prims-entry-pool)":{
"vars":{"a1-0":"current", "v1-0":"prev", "a2-0":"next"}
} }

View file

@ -5,3 +5,163 @@
;; name in dgo: collide-cache-h ;; name in dgo: collide-cache-h
;; dgos: GAME, ENGINE ;; dgos: GAME, ENGINE
(deftype collide-using-spheres-params (structure)
((spheres uint32 :offset-assert 0)
(num-spheres uint32 :offset-assert 4)
(collide-with uint64 :offset-assert 8)
(proc basic :offset-assert 16)
(ignore-pat uint32 :offset-assert 20)
(solid-only basic :offset-assert 24)
)
:method-count-assert 9
:size-assert #x1c
:flag-assert #x90000001c
)
(deftype collide-puss-sphere (structure)
((bsphere sphere :inline :offset-assert 0)
(bbox4w bounding-box4w :inline :offset-assert 16)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(deftype collide-puss-work (structure)
((closest-pt vector :inline :offset-assert 0)
(tri-normal vector :inline :offset-assert 16)
(tri-bbox4w bounding-box4w :inline :offset-assert 32)
(spheres-bbox4w bounding-box4w :inline :offset-assert 64)
(spheres collide-puss-sphere 64 :inline :offset-assert 96)
)
:method-count-assert 11
:size-assert #xc60
:flag-assert #xb00000c60
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
)
)
(deftype collide-puyp-work (structure)
((best-u float :offset-assert 0)
(ignore-pat uint32 :offset-assert 4)
(tri-out collide-tri-result :offset-assert 8)
(start-pos vector :inline :offset-assert 16)
(move-dist vector :inline :offset-assert 32)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(deftype collide-cache-tri (structure)
((vertex vector 3 :inline :offset-assert 0)
;(extra-quad UNKNOWN 16 :offset-assert 48)
(pat uint32 :offset-assert 48)
(prim-index uint16 :offset-assert 52)
(user16 uint16 :offset-assert 54)
(user32 uint32 2 :offset-assert 56)
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
)
(deftype collide-cache-prim (structure)
((prim-core collide-prim-core :inline :offset-assert 0)
;;(extra-quad UNKNOWN 16 :offset-assert 32)
(ccache basic :offset-assert 32)
(prim basic :offset-assert 36)
(first-tri uint16 :offset-assert 40)
(num-tris uint16 :offset-assert 42)
(unused uint8 4 :offset-assert 44)
(world-sphere vector :inline :offset 0)
(collide-as uint64 :offset 16)
(action uint32 :offset 24)
(offense int8 :offset 28)
(prim-type int8 :offset 29)
)
:method-count-assert 11
:size-assert #x30
:flag-assert #xb00000030
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
)
)
(deftype collide-cache (basic)
((num-tris int32 :offset-assert 4)
(num-prims int32 :offset-assert 8)
(ignore-mask uint32 :offset-assert 12)
(proc basic :offset-assert 16)
(collide-box bounding-box :inline :offset-assert 32)
(collide-box4w bounding-box4w :inline :offset-assert 64)
(collide-with uint64 :offset-assert 96)
(prims collide-cache-prim 100 :inline :offset-assert 112)
(tris collide-cache-tri 461 :inline :offset-assert 4912)
)
:method-count-assert 33
:size-assert #x8670
:flag-assert #x2100008670
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
(dummy-28 () none 28)
(dummy-29 () none 29)
(dummy-30 () none 30)
(dummy-31 () none 31)
(dummy-32 () none 32)
)
)
(deftype collide-list-item (structure)
((mesh basic :offset-assert 0)
(inst basic :offset-assert 4)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
(deftype collide-list (structure)
((num-items int32 :offset-assert 0)
(items collide-list-item 256 :inline :offset-assert 16)
)
:method-count-assert 9
:size-assert #x1010
:flag-assert #x900001010
)
(deftype collide-work (structure)
((collide-sphere-neg-r sphere :inline :offset-assert 0)
(collide-box4w bounding-box4w :inline :offset-assert 16)
(inv-mat matrix :inline :offset-assert 48)
)
:method-count-assert 9
:size-assert #x70
:flag-assert #x900000070
)
(define-perm *collide-work* collide-work (new 'global 'collide-work))
(define-perm *collide-cache* collide-cache (new 'global 'collide-cache))
(define-perm *collide-list* collide-list (new 'global 'collide-list))

View file

@ -5,3 +5,227 @@
;; name in dgo: collide-edge-grab-h ;; name in dgo: collide-edge-grab-h
;; dgos: GAME, ENGINE ;; dgos: GAME, ENGINE
(deftype edge-grab-info (structure)
((world-vertex vector 6 :inline :offset-assert 0)
(local-vertex vector 6 :inline :offset-assert 96)
(actor-cshape-prim-offset int32 :offset-assert 192)
(actor-handle uint64 :offset-assert 200)
(hanging-matrix matrix :inline :offset-assert 208)
(edge-vertex vector 2 :inline :offset 0)
(center-hold vector :inline :offset 32)
(tri-vertex vector 3 :inline :offset 48)
(left-hand-hold vector :inline :offset-assert 272)
(right-hand-hold vector :inline :offset-assert 288)
(center-hold-old vector :inline :offset-assert 304)
(edge-tri-pat uint32 :offset-assert 320)
)
:method-count-assert 11
:size-assert #x144
:flag-assert #xb00000144
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
)
)
(declare-type collide-cache-tri structure)
(deftype collide-edge-tri (structure)
((ctri collide-cache-tri :offset-assert 0)
(normal vector :inline :offset-assert 16)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
(deftype collide-edge-edge (structure)
((ignore basic :offset-assert 0)
(etri collide-edge-tri :offset-assert 4)
(vertex-ptr vector 2 :offset-assert 8)
(outward vector :inline :offset-assert 16)
(edge-vec-norm vector :inline :offset-assert 32)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(deftype collide-edge-hold-item (structure)
((next collide-edge-hold-item :offset-assert 0)
(rating float :offset-assert 4)
(split int8 :offset-assert 8)
(edge collide-edge-edge :offset-assert 12)
(center-pt vector :inline :offset-assert 16)
(outward-pt vector :inline :offset-assert 32)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(deftype collide-edge-hold-list (structure)
((num-allocs uint32 :offset-assert 0)
(num-attempts uint32 :offset-assert 4)
(head collide-edge-hold-item :offset-assert 8)
(items collide-edge-hold-item 32 :inline :offset-assert 16)
(attempts qword 32 :inline :offset-assert 1552)
)
:method-count-assert 11
:size-assert #x810
:flag-assert #xb00000810
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
)
)
(deftype collide-edge-work (structure)
((ccache basic :offset-assert 0)
(cshape basic :offset-assert 4)
(num-verts uint32 :offset-assert 8)
(num-edges uint32 :offset-assert 12)
(num-tris uint32 :offset-assert 16)
(cache-fill-box bounding-box :inline :offset-assert 32)
(within-reach-box bounding-box :inline :offset-assert 64)
(within-reach-box4w bounding-box4w :inline :offset-assert 96)
(search-pt vector :inline :offset-assert 128)
(search-dir-vec vector :inline :offset-assert 144)
(max-dist-sqrd-to-outward-pt float :offset-assert 160)
(max-dir-cosa-delta float :offset-assert 164)
(split-dists float 2 :offset-assert 168)
(outward-offset vector :inline :offset-assert 176)
(local-cache-fill-box bounding-box :inline :offset-assert 192)
(local-within-reach-box bounding-box :inline :offset-assert 224)
(local-player-spheres sphere 12 :inline :offset-assert 256)
(world-player-spheres sphere 12 :inline :offset-assert 448)
(local-player-hanging-spheres sphere 6 :inline :offset 256)
(world-player-hanging-spheres sphere 6 :inline :offset 448)
(local-player-leap-up-spheres sphere 6 :inline :offset 352)
(world-player-leap-up-spheres sphere 6 :inline :offset 544)
(verts vector 64 :inline :offset-assert 640)
(edges collide-edge-edge 96 :inline :offset-assert 1664)
(tris collide-edge-tri 48 :inline :offset-assert 6272)
(hold-list collide-edge-hold-list :inline :offset-assert 7808)
)
:method-count-assert 20
:size-assert #x2690
:flag-assert #x1400002690
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
)
)
(define *collide-edge-work*
(new 'static 'collide-edge-work
:max-dist-sqrd-to-outward-pt 37748736.000000
:max-dir-cosa-delta (the-as float #x3f19999a)
:split-dists (new 'static 'array float 2 1024.000000 (the-as float #x44b33333))
:outward-offset (new 'static 'vector
:x (the-as float #x443126e9)
:y 13312.000000
:w 1.000000
)
:local-cache-fill-box (new 'static 'bounding-box
:min (new 'static 'vector
:x -8192.000000
:y (the-as float #xc62ccccd)
:z -8192.000000
:w 1.000000
)
:max (new 'static 'vector
:x 8192.000000
:y 24576.000000
:z 8192.000000
:w 1.000000
)
)
:local-within-reach-box (new 'static 'bounding-box
:min (new 'static 'vector
:x -6144.000000
:y (the-as float #x45a66666)
:z -6144.000000
:w 1.000000
)
:max (new 'static 'vector
:x 6144.000000
:y (the-as float #x462ccccd)
:z 6144.000000
:w 1.000000
)
)
:local-player-spheres (new 'static 'inline-array sphere 12
(new 'static 'sphere
:x (the-as float #x44d70a3d)
:y (the-as float #xc44ccccd)
:w (the-as float #x44b33333)
)
(new 'static 'sphere
:x (the-as float #x450f5c29)
:y (the-as float #xc54ccccd)
:w (the-as float #x44eb851f)
)
(new 'static 'sphere
:x (the-as float #x44f5c28f)
:y -6144.000000
:w (the-as float #x44c28f5c)
)
(new 'static 'sphere
:x (the-as float #x44f5c28f)
:y (the-as float #xc6066666)
:w (the-as float #x44c28f5c)
)
(new 'static 'sphere
:x (the-as float #x44dc28f6)
:y (the-as float #xc62ccccd)
:w (the-as float #x44a8f5c3)
)
(new 'static 'sphere
:x (the-as float #x44d1eb85)
:y -13312.000000
:w (the-as float #x449eb852)
)
(new 'static 'sphere
:x (the-as float #xc43851ec)
:y 4096.000000
:w 3072.000000
)
(new 'static 'sphere
:x (the-as float #xc43851ec)
:y (the-as float #x45cccccd)
:w 3072.000000
)
(new 'static 'sphere
:x (the-as float #xc43851ec)
:y (the-as float #x46133333)
:w 3072.000000
)
(new 'static 'sphere
:x (the-as float #x44d70a3d)
:y (the-as float #x45666666)
:w (the-as float #x453851ec)
)
(new 'static 'sphere
:x (the-as float #x44d70a3d)
:y (the-as float #x45b33333)
:w (the-as float #x453851ec)
)
(new 'static 'sphere
:x (the-as float #x44d70a3d)
:y (the-as float #x46066666)
:w (the-as float #x453851ec)
)
)
)
)
(define-perm *edge-grab-info* edge-grab-info (new 'global 'edge-grab-info))

View file

@ -5,3 +5,4 @@
;; name in dgo: collide-h ;; name in dgo: collide-h
;; dgos: GAME, ENGINE ;; dgos: GAME, ENGINE
(define *collide-test-flag* #f)

View file

@ -5,3 +5,158 @@
;; name in dgo: collide-touch-h ;; name in dgo: collide-touch-h
;; dgos: GAME, ENGINE ;; dgos: GAME, ENGINE
(deftype touching-prim (structure)
((cprim basic :offset-assert 0)
(has-tri? basic :offset-assert 4)
(tri collide-tri-result :inline :offset-assert 16)
)
:method-count-assert 9
:size-assert #x64
:flag-assert #x900000064
)
(deftype touching-prims-entry (structure)
((next touching-prims-entry :offset-assert 0)
(prev touching-prims-entry :offset-assert 4)
(allocated? basic :offset-assert 8)
(u float :offset-assert 12)
(prim1 touching-prim :inline :offset-assert 16)
(prim2 touching-prim :inline :offset-assert 128)
)
:method-count-assert 13
:size-assert #xe4
:flag-assert #xd000000e4
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
)
)
(deftype touching-prims-entry-pool (structure)
((head touching-prims-entry :offset-assert 0)
(nodes touching-prims-entry 64 :inline :offset-assert 16)
)
:method-count-assert 13
:size-assert #x3c10
:flag-assert #xd00003c10
(:methods
(new (symbol type) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
(init-list! (_type_) none 11)
(dummy-12 () none 12)
)
)
(defmethod init-list! touching-prims-entry-pool ((obj touching-prims-entry-pool))
"Initialize all entries to be not allocated and in a linked list."
(local-vars
(prev touching-prims-entry)
(idx int)
(current (inline-array touching-prims-entry))
(next touching-prims-entry)
)
(set! prev #f)
(set! current (-> obj nodes))
(set! (-> obj head) (-> current 0))
(set! idx 64)
(while (nonzero? idx)
(+! idx -1)
(set! (-> current 0 prev) prev)
(set! next (-> current 1))
(set! (-> current 0 next) next)
(set! (-> current 0 allocated?) #f)
(set! prev (-> current 0))
(set! current (the (inline-array touching-prims-entry) next))
)
(set! (-> prev next) #f)
(none)
)
(defmethod new touching-prims-entry-pool ((allocation symbol) (type-to-make type))
"Allocate a new touching-prims-entry-pool"
;; Note - the original code passed (-> type-to-make size) as an argument.
;; however, the new method of structure doesn't have this argument.
;; it uses the same value for the size so it doesn't really matter.
(let ((obj (the touching-prims-entry-pool ((method-of-type structure new)
allocation
type-to-make
;; (-> type-to-make size) see note
)
)))
(init-list! obj)
obj
)
)
(deftype touching-shapes-entry (structure)
((cshape1 basic :offset-assert 0)
(cshape2 basic :offset-assert 4)
(resolve-u int8 :offset-assert 8)
(head touching-prims-entry :offset-assert 12)
)
:allow-misaligned
:method-count-assert 18
:size-assert #x10
:flag-assert #x1200000010
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(get-head (_type_) touching-prims-entry 16)
(unknown1 (_type_ (xx (pointer uint32))) uint 17)
)
)
(deftype touching-list (structure)
((num-touching-shapes int32 :offset-assert 0)
(resolve-u int8 :offset-assert 4)
(touching-shapes touching-shapes-entry 32 :inline :offset-assert 8)
)
:method-count-assert 15
:size-assert #x208
:flag-assert #xf00000208
(:methods
(new (symbol type) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
)
)
(defmethod new touching-list ((allocation symbol) (type-to-make type))
"See note in touching-prims-entry-pool"
(let ((obj (the touching-list ((method-of-type structure new)
allocation
type-to-make
;; (-> type-to-make size) see note
)
)))
(set! (-> obj num-touching-shapes) 0)
(set! (-> obj resolve-u) 0)
obj
)
)
(defmethod get-head touching-shapes-entry ((obj touching-shapes-entry))
(-> obj head)
)
(defmethod unknown1 touching-shapes-entry ((obj touching-shapes-entry) (arg0 (pointer uint32)))
(-> arg0 0)
)
(define-perm *touching-prims-entry-pool* touching-prims-entry-pool (new 'global 'touching-prims-entry-pool))
(define-perm *touching-list* touching-list (new 'global 'touching-list))

View file

@ -17,7 +17,7 @@
;; field distance is a float printed as hex? ;; field distance is a float printed as hex?
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)

View file

@ -13,7 +13,7 @@
:flag-assert #x1200000020 :flag-assert #x1200000020
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -35,6 +35,6 @@
:flag-assert #x1200000044 :flag-assert #x1200000044
) )
(defmethod dummy-10 drawable-tree-actor ((obj drawable)) (defmethod dummy-10 drawable-tree-actor ((obj _type_))
0 0
) )

View file

@ -13,7 +13,7 @@
:flag-assert #x1300000020 :flag-assert #x1300000020
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -35,7 +35,7 @@
:flag-assert #x1200000044 :flag-assert #x1200000044
) )
(defmethod dummy-10 drawable-tree-ambient ((obj drawable)) (defmethod dummy-10 drawable-tree-ambient ((obj _type_))
0 0
) )

View file

@ -16,7 +16,7 @@
:flag-assert #x1200000020 :flag-assert #x1200000020
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)
@ -35,7 +35,7 @@
:flag-assert #x1200000024 :flag-assert #x1200000024
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)

View file

@ -13,7 +13,7 @@
:flag-assert #x1200000020 :flag-assert #x1200000020
(:methods (:methods
(dummy-9 () none 9) (dummy-9 () none 9)
(dummy-10 (drawable) int 10) (dummy-10 (_type_) int 10)
(dummy-11 () none 11) (dummy-11 () none 11)
(dummy-12 () none 12) (dummy-12 () none 12)
(dummy-13 () none 13) (dummy-13 () none 13)

View file

@ -5,3 +5,31 @@
;; name in dgo: depth-cue-h ;; name in dgo: depth-cue-h
;; dgos: GAME, ENGINE ;; dgos: GAME, ENGINE
;; depth-cue-h
(deftype depth-cue-data (structure)
((data vector :inline :offset-assert 0)
(sharpness float :offset 0)
(alpha float :offset 4)
(distance float :offset 8)
(w float :offset 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; depth-cue-h
(deftype depth-cue-work (structure)
((texture-strip-tmpl dma-gif-packet :inline :offset-assert 0)
(temp-strip-tmpl dma-gif-packet :inline :offset-assert 32)
(stencil-tmpl dma-gif-packet :inline :offset-assert 64)
(clear-color vector4w :inline :offset-assert 96)
(set-color vector4w :inline :offset-assert 112)
(draw-color vector4w :inline :offset-assert 128)
(depth depth-cue-data :offset-assert 144)
(front depth-cue-data :offset-assert 148)
)
:method-count-assert 9
:size-assert #x98
:flag-assert #x900000098
)

View file

@ -33,12 +33,6 @@
(defconstant PI_OVER_2 (the-as float #x3fc90fda)) (defconstant PI_OVER_2 (the-as float #x3fc90fda))
(defconstant TWO_PI (the-as float #x40c90fda)) (defconstant TWO_PI (the-as float #x40c90fda))
;; convert number of degrees to a rotation.
(defmacro degrees (value)
`(* (/ (the float ,value) 360.0)
65536.0
)
)
(defun radmod ((arg0 float)) (defun radmod ((arg0 float))
"Wrap arg0 to be within (-pi, pi)." "Wrap arg0 to be within (-pi, pi)."

View file

@ -16,4 +16,40 @@
(deftype part-id (uint32) (deftype part-id (uint32)
() ()
:flag-assert #x900000004 :flag-assert #x900000004
) )
(defglobalconstant METER_LENGTH 4096.0)
(defmacro meters (x)
"Convert number to meters.
If the input is a constant float or integer, the result will be a
compile time constant float. Otherwise, it will not be constant."
(cond
((float? x)
(* METER_LENGTH x)
)
((integer? x)
(* METER_LENGTH x)
)
(#t
`(* METER_LENGTH ,x)
)
)
)
(defglobalconstant DEGREES_PER_ROT 65536.0)
(defmacro degrees (x)
"Convert number to degrees unit.
Will keep a constant float/int constant."
(cond
((or (float? x) (integer? x))
(* DEGREES_PER_ROT (/ (+ 0.0 x) 360.0))
)
(#t
`(* (/ (the float ,x) 360.0)
DEGREES_PER_ROT
)
)
)
)

View file

@ -15,19 +15,18 @@
;; BUILD SYSTEM ;; BUILD SYSTEM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; compile, color, and save a file
(defmacro m (file) (defmacro m (file)
"Make: compile a file fully and save the result"
`(asm-file ,file :color :write) `(asm-file ,file :color :write)
) )
;; compile, color, save, and disassemble a file.
;; make "debug".
(defmacro md (file) (defmacro md (file)
"Make Debug: make + print disassembly for a file"
`(asm-file ,file :color :write :disassemble) `(asm-file ,file :color :write :disassemble)
) )
;; compile, color, load and save a file
(defmacro ml (file) (defmacro ml (file)
"Make Load: make and load the file through the listener"
`(asm-file ,file :color :load :write) `(asm-file ,file :color :load :write)
) )
@ -37,6 +36,7 @@
(defmacro build-kernel () (defmacro build-kernel ()
"Build kernel and create the KERNEL CGO"
`(begin `(begin
,@(apply make-build-command all-kernel-goal-files) ,@(apply make-build-command all-kernel-goal-files)
(build-dgos "goal_src/build/kernel_dgos.txt") (build-dgos "goal_src/build/kernel_dgos.txt")
@ -44,6 +44,7 @@
) )
(defmacro build-game () (defmacro build-game ()
"Build all game code and all game CGOs"
`(begin `(begin
(build-kernel) (build-kernel)
,@(apply make-build-command all-goal-files) ,@(apply make-build-command all-goal-files)
@ -52,6 +53,7 @@
) )
(defmacro build-data () (defmacro build-data ()
"Build all game data"
`(begin `(begin
(asm-data-file game-text "assets/game_text.txt") (asm-data-file game-text "assets/game_text.txt")
(asm-data-file game-count "assets/game_count.txt") (asm-data-file game-count "assets/game_count.txt")
@ -59,6 +61,8 @@
) )
(defmacro blg () (defmacro blg ()
"Build engine and kernel CGOs (code only, no data for now) and load them in the listener
Uses the blocking dgo-load."
`(begin `(begin
(build-game) (build-game)
(dgo-load "kernel" global #xf #x200000) (dgo-load "kernel" global #xf #x200000)
@ -67,14 +71,17 @@
) )
(defmacro tc () (defmacro tc ()
"Typecheck against the all-types file"
`(m "decompiler/config/all-types.gc") `(m "decompiler/config/all-types.gc")
) )
(defmacro e () (defmacro e ()
"Exit the compiler"
`(:exit) `(:exit)
) )
(defmacro dbc () (defmacro dbc ()
"Put the compiler in debug mode"
`(begin `(begin
(set-config! print-ir #t) (set-config! print-ir #t)
(set-config! print-regalloc #t) (set-config! print-regalloc #t)
@ -93,14 +100,12 @@
`(#cond ((not ,clause) ,@body)) `(#cond ((not ,clause) ,@body))
) )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; TARGET CONTROL ;; TARGET CONTROL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmacro lt (&rest args) (defmacro lt (&rest args)
;; shortcut for listen-to-target. also sends a :status command to make sure "Listen to target. Opens a connection and flushes buffers"
;; all buffers on the target are flushed.
`(begin `(begin
(listen-to-target ,@args) (listen-to-target ,@args)
(:status) (:status)
@ -108,7 +113,7 @@
) )
(defmacro r (&rest args) (defmacro r (&rest args)
;; shortcut to completely reset the target and connect, regardless of current state "Reset the target state and reconnect."
`(begin `(begin
;; connect, so we can send reset. if we're already connected, does nothing ;; connect, so we can send reset. if we're already connected, does nothing
(listen-to-target ,@args) (listen-to-target ,@args)
@ -122,6 +127,7 @@
) )
(defmacro shutdown-target () (defmacro shutdown-target ()
"Make the target exit. The runtime itself will exit and not restart automatically."
`(begin `(begin
(reset-target :shutdown) (reset-target :shutdown)
) )
@ -132,30 +138,37 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmacro db (&rest args) (defmacro db (&rest args)
"Print bytes."
`(:pm 1 ,@args) `(:pm 1 ,@args)
) )
(defmacro dh (&rest args) (defmacro dh (&rest args)
"Print halfwords (16-bits)"
`(:pm 2 ,@args) `(:pm 2 ,@args)
) )
(defmacro dw (&rest args) (defmacro dw (&rest args)
"Print words (32-bits)"
`(:pm 4 ,@args) `(:pm 4 ,@args)
) )
(defmacro dd (&rest args) (defmacro dd (&rest args)
"Print doublewords (64-bits)"
`(:pm 8 ,@args) `(:pm 8 ,@args)
) )
(defmacro df (&rest args) (defmacro df (&rest args)
"Print floats (32-bit)"
`(:pm 4 ,@args :print-mode float) `(:pm 4 ,@args :print-mode float)
) )
(defmacro segfault () (defmacro segfault ()
"Dereference the GOAL 0 pointer, which should be a segfault"
`(-> (the (pointer int) 0)) `(-> (the (pointer int) 0))
) )
(defmacro fpe () (defmacro fpe ()
"Trigger a SIGFPE by doing integer division by zero"
`(/ 0 0) `(/ 0 0)
) )
@ -195,9 +208,8 @@
`(define-extern ,function-name (function ,@type-info)) `(define-extern ,function-name (function ,@type-info))
) )
;; Define a new function, but only if we're debugging.
;; TODO - should place the function in the debug segment!
(defmacro defun-debug (name bindings &rest body) (defmacro defun-debug (name bindings &rest body)
"Define a function which is only present in debug mode. Otherwise the function becomes nothing"
`(if *debug-segment* `(if *debug-segment*
,(if (and ,(if (and
(> (length body) 1) ;; more than one thing in function (> (length body) 1) ;; more than one thing in function
@ -215,7 +227,20 @@
) )
) )
(defmacro define-perm (name type value)
"Define 'permanent', meaning the original definition will not be blown away by a file reload.
If the value of the symbol is unset (zero) or set to false, it will be defined.
Otherwise, no effect, other than to inform the type system of the symbol type."
`(begin
(define-extern ,name ,type)
(if (or (not ,name) (zero? ,name))
(set! ,name ,value)
)
)
)
(defmacro while (test &rest body) (defmacro while (test &rest body)
"While loop. The test is evaluated before body."
(with-gensyms (reloop test-exit) (with-gensyms (reloop test-exit)
`(begin `(begin
(goto ,test-exit) (goto ,test-exit)
@ -229,6 +254,7 @@
) )
(defmacro until (test &rest body) (defmacro until (test &rest body)
"Until loop. The body is evaluated before the test."
(with-gensyms (reloop) (with-gensyms (reloop)
`(begin `(begin
(label ,reloop) (label ,reloop)
@ -239,6 +265,7 @@
) )
(defmacro dotimes (var &rest body) (defmacro dotimes (var &rest body)
"Loop like for (int i = 0; i < end; i++)"
`(let (( ,(first var) 0)) `(let (( ,(first var) 0))
(while (< ,(first var) ,(second var)) (while (< ,(first var) ,(second var))
,@body ,@body
@ -249,6 +276,7 @@
) )
(defmacro countdown (var &rest body) (defmacro countdown (var &rest body)
"Loop like for (int i = end; i-- > 0)"
`(let ((,(first var) ,(second var))) `(let ((,(first var) ,(second var)))
(while (!= ,(first var) 0) (while (!= ,(first var) 0)
(set! ,(first var) (- ,(first var) 1)) (set! ,(first var) (- ,(first var) 1))
@ -280,10 +308,6 @@
) )
) )
(defmacro +! (place amount)
`(set! ,place (+ ,place ,amount))
)
(defmacro if (condition true-case &rest others) (defmacro if (condition true-case &rest others)
(if (> (length others) 1) (if (> (length others) 1)
(error "got too many arguments to if") (error "got too many arguments to if")
@ -439,6 +463,7 @@
;; todo, make this better ;; todo, make this better
`(eq? ,arg '()) `(eq? ,arg '())
) )
(defmacro caar (arg) (defmacro caar (arg)
`(car (car ,arg)) `(car (car ,arg))
) )
@ -487,19 +512,6 @@
) )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Decompiler Macros
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmacro <.si (a b)
`(< (the-as int ,a) (the-as int ,b))
)
(defmacro <0.si (a)
`(< (the-as int ,a) (the-as int 0))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (Fake) MIPS Macros ;; (Fake) MIPS Macros
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -125,7 +125,15 @@
(defsmacro string? (x) (defsmacro string? (x)
`(type? 'string ,x)) `(type? 'string ,x))
(defsmacro float? (x)
`(type? 'float ,x)
)
(defsmacro integer? (x)
`(type? 'integer ,x)
)
(defsmacro ferror (&rest args) (defsmacro ferror (&rest args)
`(error (fmt #f ,@args)) `(error (fmt #f ,@args))
@ -159,4 +167,4 @@
) )
;; this is checked in a test to see if this file is loaded. ;; this is checked in a test to see if this file is loaded.
(define __goos-lib-loaded__ #t) (define __goos-lib-loaded__ #t)

View file

@ -13,7 +13,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; HACK ADDED ;; HACK ADDED
(define *use-old-listener-print* #t) (define *use-old-listener-print* #f)
;; Set version number symbols ;; Set version number symbols
(define *kernel-version* (the binteger (logior (ash *kernel-major-version* 16) *kernel-minor-version*))) (define *kernel-version* (the binteger (logior (ash *kernel-major-version* 16) *kernel-minor-version*)))

View file

@ -44,6 +44,12 @@ if(WIN32)
target_link_libraries(compiler mman) target_link_libraries(compiler mman)
endif() endif()
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
elseif(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2")
endif()
add_executable(goalc main.cpp) add_executable(goalc main.cpp)
target_link_libraries(goalc common Zydis compiler) target_link_libraries(goalc common Zydis compiler)

View file

@ -1,2 +1,2 @@
(build-game) (build-game)
1 1

View file

@ -1,2 +1,3 @@
(set! *use-old-listener-print* #t)
(dgo-load "kernel" global #xf #x200000) ; todo, remove once kernel loads itself. (dgo-load "kernel" global #xf #x200000) ; todo, remove once kernel loads itself.
(dgo-load "game" global #xf #x200000) (dgo-load "game" global #xf #x200000)

View file

@ -9,6 +9,8 @@ TEST(GameNoDebugSegment, Init) {
compiler.run_front_end_on_string("(build-kernel)"); compiler.run_front_end_on_string("(build-kernel)");
std::thread runtime_thread = std::thread(GoalTest::runtime_with_kernel_no_debug_segment); std::thread runtime_thread = std::thread(GoalTest::runtime_with_kernel_no_debug_segment);
compiler.run_test_from_string("(set! *use-old-listener-print* #t)");
// this shouldn't crash // this shouldn't crash
compiler.run_test_from_string("(inspect *kernel-context*)"); compiler.run_test_from_string("(inspect *kernel-context*)");

View file

@ -18,6 +18,7 @@ class KernelTest : public testing::Test {
printf("Starting GOAL Kernel...\n"); printf("Starting GOAL Kernel...\n");
runtime_thread = std::thread(GoalTest::runtime_with_kernel); runtime_thread = std::thread(GoalTest::runtime_with_kernel);
runner.c = &compiler; runner.c = &compiler;
compiler.run_test_from_string("(set! *use-old-listener-print* #t)");
} }
static void TearDownTestSuite() { static void TearDownTestSuite() {

View file

@ -34,6 +34,7 @@ class WithGameTests : public ::testing::Test {
runner.c = &compiler; runner.c = &compiler;
compiler.run_test_from_file("test/goalc/source_templates/with_game/test-load-game.gc"); compiler.run_test_from_file("test/goalc/source_templates/with_game/test-load-game.gc");
compiler.run_test_from_string("(set! *use-old-listener-print* #t)");
} }
static void TearDownTestSuite() { static void TearDownTestSuite() {
@ -61,6 +62,53 @@ std::thread WithGameTests::runtime_thread;
Compiler WithGameTests::compiler; Compiler WithGameTests::compiler;
GoalTest::CompilerTestRunner WithGameTests::runner; GoalTest::CompilerTestRunner WithGameTests::runner;
class WithMinimalGameTests : public ::testing::Test {
public:
static void SetUpTestSuite() {
try {
compiler.run_front_end_on_string("(build-kernel)");
} catch (std::exception& e) {
fprintf(stderr, "caught exception %s\n", e.what());
EXPECT_TRUE(false);
}
runtime_thread = std::thread((GoalTest::runtime_with_kernel));
runner.c = &compiler;
compiler.run_test_from_string("(dgo-load \"kernel\" global #xf #x200000)");
const auto minimal_files = {"goal_src/engine/math/vector-h.gc"};
for (auto& file : minimal_files) {
compiler.run_test_from_string(fmt::format("(ml \"{}\")", file));
}
compiler.run_test_from_string("(set! *use-old-listener-print* #t)");
}
static void TearDownTestSuite() {
compiler.shutdown_target();
runtime_thread.join();
}
void SetUp() {
GoalTest::createDirIfAbsent(GoalTest::getTemplateDir(testCategory));
GoalTest::createDirIfAbsent(GoalTest::getGeneratedDir(testCategory));
}
void TearDown() {}
static std::thread runtime_thread;
static Compiler compiler;
static GoalTest::CompilerTestRunner runner;
std::string testCategory = "with_game";
inja::Environment env{GoalTest::getTemplateDir(testCategory),
GoalTest::getGeneratedDir(testCategory)};
};
std::thread WithMinimalGameTests::runtime_thread;
Compiler WithMinimalGameTests::compiler;
GoalTest::CompilerTestRunner WithMinimalGameTests::runner;
namespace { namespace {
std::vector<std::string> get_test_pass_string(const std::string& name, int count) { std::vector<std::string> get_test_pass_string(const std::string& name, int count) {
return {fmt::format("Test \"{}\": {} Passes\n0\n", name, count)}; return {fmt::format("Test \"{}\": {} Passes\n0\n", name, count)};
@ -650,7 +698,7 @@ std::vector<VectorFloatTestCase_TwoOperand> vectorMathCaseGen_TwoOperand() {
} }
class VectorFloatParameterizedTestFixtureWithRunner_TwoOperand class VectorFloatParameterizedTestFixtureWithRunner_TwoOperand
: public WithGameTests, : public WithMinimalGameTests,
public ::testing::WithParamInterface<VectorFloatTestCase_TwoOperand> { public ::testing::WithParamInterface<VectorFloatTestCase_TwoOperand> {
protected: protected:
std::string templateFile = "test-vector-math-2-operand.template.gc"; std::string templateFile = "test-vector-math-2-operand.template.gc";
@ -778,7 +826,7 @@ std::vector<VectorFloatTestCase_SingleOperand> vectorMathCaseGen_SingleOperand_N
} }
class VectorFloatParameterizedTestFixtureWithRunner_SingleOperand class VectorFloatParameterizedTestFixtureWithRunner_SingleOperand
: public WithGameTests, : public WithMinimalGameTests,
public ::testing::WithParamInterface<VectorFloatTestCase_SingleOperand> { public ::testing::WithParamInterface<VectorFloatTestCase_SingleOperand> {
protected: protected:
std::string templateFile = "test-vector-math-1-operand.template.gc"; std::string templateFile = "test-vector-math-1-operand.template.gc";
@ -863,7 +911,7 @@ std::vector<VectorFloatTestCase_TwoOperandACC> vectorMathCaseGen_TwoOperandACC()
} }
class VectorFloatParameterizedTestFixtureWithRunner_TwoOperandACC class VectorFloatParameterizedTestFixtureWithRunner_TwoOperandACC
: public WithGameTests, : public WithMinimalGameTests,
public ::testing::WithParamInterface<VectorFloatTestCase_TwoOperandACC> { public ::testing::WithParamInterface<VectorFloatTestCase_TwoOperandACC> {
protected: protected:
std::string templateFile = "test-vector-math-2-operand-acc.template.gc"; std::string templateFile = "test-vector-math-2-operand-acc.template.gc";
@ -950,7 +998,7 @@ std::vector<VectorFloatTestCase_TwoOperandQuotient> vectorMathCaseGen_TwoOperand
} }
class VectorFloatParameterizedTestFixtureWithRunner_TwoOperandQuotient class VectorFloatParameterizedTestFixtureWithRunner_TwoOperandQuotient
: public WithGameTests, : public WithMinimalGameTests,
public ::testing::WithParamInterface<VectorFloatTestCase_TwoOperandQuotient> { public ::testing::WithParamInterface<VectorFloatTestCase_TwoOperandQuotient> {
protected: protected:
std::string templateFile = "test-vector-math-division.template.gc"; std::string templateFile = "test-vector-math-division.template.gc";
@ -1014,7 +1062,7 @@ std::vector<VectorFloatTestCase_OneOperandQuotient> vectorMathCaseGen_OneOperand
} }
class VectorFloatParameterizedTestFixtureWithRunner_OneOperandQuotient class VectorFloatParameterizedTestFixtureWithRunner_OneOperandQuotient
: public WithGameTests, : public WithMinimalGameTests,
public ::testing::WithParamInterface<VectorFloatTestCase_OneOperandQuotient> { public ::testing::WithParamInterface<VectorFloatTestCase_OneOperandQuotient> {
protected: protected:
std::string templateFile = "test-vector-math-sqrt.template.gc"; std::string templateFile = "test-vector-math-sqrt.template.gc";