mirror of
https://github.com/open-goal/jak-project.git
synced 2024-11-28 00:40:42 +00:00
tests: add a bunch of missing ref tests (#1082)
* scripts: add a script to point out missing ref test files * tests: add a bunch of files to ref tests we were missing
This commit is contained in:
parent
54c6ddbab9
commit
e65c61f3e2
@ -9047,16 +9047,18 @@
|
||||
:flag-assert #x900000002
|
||||
)
|
||||
|
||||
; (deftype shadow-edge (structure)
|
||||
; ((ind-0 uint16 :offset-assert 0)
|
||||
; (ind-1 uint16 :offset-assert 2)
|
||||
; (tri-0 uint16 :offset-assert 4)
|
||||
; (tri-1 uint16 :offset-assert 6)
|
||||
; )
|
||||
; :method-count-assert 9
|
||||
; :size-assert #x4
|
||||
; :flag-assert #x900000004
|
||||
; )
|
||||
;; Defined twice, the second definition won?
|
||||
;; the fields here are wrong and need to be corrected assuming that is the case
|
||||
;; (deftype shadow-edge (structure)
|
||||
;; ((ind-0 uint16 :offset-assert 0)
|
||||
;; (ind-1 uint16 :offset-assert 2)
|
||||
;; (tri-0 uint16 :offset-assert 4)
|
||||
;; (tri-1 uint16 :offset-assert 6)
|
||||
;; )
|
||||
;; :method-count-assert 9
|
||||
;; :size-assert #x4
|
||||
;; :flag-assert #x900000008
|
||||
;; )
|
||||
|
||||
(deftype shadow-tri (structure)
|
||||
((ind-0 uint8 :offset-assert 0)
|
||||
@ -14971,7 +14973,7 @@
|
||||
(param1 float :offset-assert 24)
|
||||
(param2 float :offset-assert 28)
|
||||
(param3 int32 :offset-assert 32)
|
||||
(value-to-modify pointer :offset-assert 36)
|
||||
(value-to-modify pointer :offset-assert 36) ;; pointer to - symbol | ?
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x28
|
||||
|
@ -7756,5 +7756,20 @@
|
||||
[31, "s3", "process-drawable"]
|
||||
],
|
||||
|
||||
"(method 29 progress)": [
|
||||
[290, "a0", "(pointer symbol)"],
|
||||
[299, "v1", "(pointer symbol)"],
|
||||
[308, "a0", "(pointer symbol)"],
|
||||
[317, "v1", "(pointer symbol)"],
|
||||
[326, "a0", "(pointer symbol)"],
|
||||
[589, "a0", "(pointer symbol)"],
|
||||
[599, "v1", "(pointer symbol)"],
|
||||
[608, "a1", "(pointer symbol)"],
|
||||
[617, "v1", "(pointer symbol)"],
|
||||
[626, "a1", "(pointer symbol)"],
|
||||
[894, "a0", "(pointer symbol)"],
|
||||
[921, "a0", "(pointer symbol)"]
|
||||
],
|
||||
|
||||
"placeholder-do-not-add-below": []
|
||||
}
|
||||
|
@ -5,8 +5,8 @@
|
||||
;; name in dgo: static-screen
|
||||
;; dgos: DEM, L1, TIT
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
;; definition of type static-screen
|
||||
(deftype static-screen (process)
|
||||
((part sparticle-launch-control 1 :offset-assert 112)
|
||||
(state-time uint64 :offset-assert 120)
|
||||
@ -20,50 +20,40 @@
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 7 of type static-screen
|
||||
;; INFO: Return type mismatch process vs static-screen.
|
||||
|
||||
(defmethod relocate static-screen ((obj static-screen) (arg0 int))
|
||||
(let ((v1-0 *kernel-context*))
|
||||
(set! (-> v1-0 relocating-process) obj)
|
||||
(set! (-> v1-0 relocating-min) (the-as int (&-> obj type)))
|
||||
(set!
|
||||
(-> v1-0 relocating-max)
|
||||
(the-as
|
||||
int
|
||||
(+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))
|
||||
)
|
||||
(set! (-> v1-0 relocating-process) obj)
|
||||
(set! (-> v1-0 relocating-min) (the-as int (&-> obj type)))
|
||||
(set! (-> v1-0 relocating-max)
|
||||
(the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj)))
|
||||
)
|
||||
(set! (-> v1-0 relocating-offset) arg0)
|
||||
)
|
||||
(set! (-> v1-0 relocating-offset) arg0)
|
||||
)
|
||||
(dotimes (v1-2 1)
|
||||
(if (nonzero? (-> obj part v1-2))
|
||||
(&+! (-> obj part v1-2) arg0)
|
||||
(if (nonzero? (-> obj part v1-2))
|
||||
(&+! (-> obj part v1-2) arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(the-as static-screen ((method-of-type process relocate) obj arg0))
|
||||
)
|
||||
|
||||
;; definition for method 10 of type static-screen
|
||||
(defmethod deactivate static-screen ((obj static-screen))
|
||||
(dotimes (s5-0 1)
|
||||
(if (nonzero? (-> obj part s5-0))
|
||||
(kill-and-free-particles (-> obj part s5-0))
|
||||
(if (nonzero? (-> obj part s5-0))
|
||||
(kill-and-free-particles (-> obj part s5-0))
|
||||
)
|
||||
)
|
||||
)
|
||||
((method-of-type process deactivate) obj)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set!
|
||||
(-> *part-id-table* 2966)
|
||||
(new 'static 'sparticle-launcher
|
||||
:init-specs
|
||||
(new 'static 'inline-array sp-field-init-spec 12
|
||||
(sp-tex spt-texture (new 'static 'texture-id :page #x5c6))
|
||||
(defpart 2966
|
||||
:init-specs
|
||||
((sp-tex spt-texture (new 'static 'texture-id :page #x5c6))
|
||||
(sp-flt spt-num 1.0)
|
||||
(sp-flt spt-y (meters 1.18))
|
||||
(sp-flt spt-scale-x (meters 15.0))
|
||||
(sp-flt spt-scale-x (meters 15))
|
||||
(sp-flt spt-scale-y (meters 6.5))
|
||||
(sp-flt spt-r 128.0)
|
||||
(sp-flt spt-g 128.0)
|
||||
@ -71,21 +61,15 @@
|
||||
(sp-flt spt-a 128.0)
|
||||
(sp-int spt-timer -1)
|
||||
(sp-cpuinfo-flags bit2 bit9 bit13)
|
||||
(sp-end)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set!
|
||||
(-> *part-id-table* 2967)
|
||||
(new 'static 'sparticle-launcher
|
||||
:init-specs
|
||||
(new 'static 'inline-array sp-field-init-spec 12
|
||||
(sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x5c6))
|
||||
(defpart 2967
|
||||
:init-specs
|
||||
((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x5c6))
|
||||
(sp-flt spt-num 1.0)
|
||||
(sp-flt spt-y (meters -1.264))
|
||||
(sp-flt spt-scale-x (meters 15.0))
|
||||
(sp-flt spt-scale-x (meters 15))
|
||||
(sp-flt spt-scale-y (meters 3.25))
|
||||
(sp-flt spt-r 128.0)
|
||||
(sp-flt spt-g 128.0)
|
||||
@ -93,21 +77,15 @@
|
||||
(sp-flt spt-a 128.0)
|
||||
(sp-int spt-timer -1)
|
||||
(sp-cpuinfo-flags bit2 bit9 bit13)
|
||||
(sp-end)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set!
|
||||
(-> *part-id-table* 2968)
|
||||
(new 'static 'sparticle-launcher
|
||||
:init-specs
|
||||
(new 'static 'inline-array sp-field-init-spec 12
|
||||
(sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x5c6))
|
||||
(defpart 2968
|
||||
:init-specs
|
||||
((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x5c6))
|
||||
(sp-flt spt-num 1.0)
|
||||
(sp-flt spt-y (meters -2.482))
|
||||
(sp-flt spt-scale-x (meters 15.0))
|
||||
(sp-flt spt-scale-x (meters 15))
|
||||
(sp-flt spt-scale-y (meters 1.625))
|
||||
(sp-flt spt-r 128.0)
|
||||
(sp-flt spt-g 128.0)
|
||||
@ -115,159 +93,83 @@
|
||||
(sp-flt spt-a 128.0)
|
||||
(sp-int spt-timer -1)
|
||||
(sp-cpuinfo-flags bit2 bit9 bit13)
|
||||
(sp-end)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set!
|
||||
(-> *part-group-id-table* 707)
|
||||
(new 'static 'sparticle-launch-group
|
||||
:length 3
|
||||
:duration #xbb8
|
||||
:linger-duration #x5dc
|
||||
:flags (sp-group-flag screen-space)
|
||||
:name "group-part-screen1"
|
||||
:launcher
|
||||
(new 'static 'inline-array sparticle-group-item 3
|
||||
(sp-item 2966 :flags (launch-asap))
|
||||
(sp-item 2967 :flags (launch-asap))
|
||||
(sp-item 2968 :flags (launch-asap))
|
||||
)
|
||||
:bounds (new 'static 'sphere :w 4096.0)
|
||||
)
|
||||
(defpartgroup group-part-screen1
|
||||
:id 707
|
||||
:flags (screen-space)
|
||||
:bounds (static-bspherem 0 0 0 1)
|
||||
:parts
|
||||
((sp-item 2966 :flags (launch-asap)) (sp-item 2967 :flags (launch-asap)) (sp-item 2968 :flags (launch-asap)))
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate idle (static-screen)
|
||||
:virtual #t
|
||||
:enter
|
||||
(behavior ((arg0 int) (arg1 int) (arg2 symbol))
|
||||
(set! (-> *setting-control* current bg-a) 1.0)
|
||||
(set! (-> *setting-control* default bg-a) 0.0)
|
||||
(push-setting! *setting-control* self 'common-page 'set 0.0 (ash 1 (+ arg0 1)))
|
||||
(none)
|
||||
)
|
||||
(set! (-> *setting-control* current bg-a) 1.0)
|
||||
(set! (-> *setting-control* default bg-a) 0.0)
|
||||
(push-setting! *setting-control* self 'common-page 'set 0.0 (ash 1 (+ arg0 1)))
|
||||
(none)
|
||||
)
|
||||
:trans
|
||||
(behavior ()
|
||||
(hide-hud-quick)
|
||||
(spawn (-> self part 0) *zero-vector*)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(hide-hud-quick)
|
||||
(spawn (-> self part 0) *zero-vector*)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
:code
|
||||
(behavior ((arg0 int) (arg1 int) (arg2 symbol))
|
||||
(local-vars (v1-6 symbol))
|
||||
(set! (-> self state-time) (the-as uint (-> *display* base-frame-counter)))
|
||||
(until v1-6
|
||||
(suspend)
|
||||
(set!
|
||||
v1-6
|
||||
(or
|
||||
(and
|
||||
(> arg1 0)
|
||||
(>=
|
||||
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
|
||||
arg1
|
||||
)
|
||||
)
|
||||
(and
|
||||
arg2
|
||||
(>=
|
||||
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
|
||||
300
|
||||
)
|
||||
(logtest?
|
||||
(-> *cpad-list* cpads 0 button0-rel 0)
|
||||
(pad-buttons select start triangle circle x square)
|
||||
)
|
||||
)
|
||||
(local-vars (v1-6 symbol))
|
||||
(set! (-> self state-time) (the-as uint (-> *display* base-frame-counter)))
|
||||
(until v1-6
|
||||
(suspend)
|
||||
(set! v1-6
|
||||
(or (and (> arg1 0) (>= (- (-> *display* base-frame-counter) (the-as int (-> self state-time))) arg1))
|
||||
(and arg2
|
||||
(>= (- (-> *display* base-frame-counter) (the-as int (-> self state-time))) 300)
|
||||
(cpad-pressed? 0 select start triangle circle x square)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> *setting-control* default bg-a) 1.0)
|
||||
(while
|
||||
(!= (-> *setting-control* current bg-a) (-> *setting-control* default bg-a))
|
||||
(set! (-> *setting-control* default bg-a) 1.0)
|
||||
(while (!= (-> *setting-control* current bg-a) (-> *setting-control* default bg-a))
|
||||
(suspend)
|
||||
)
|
||||
(clear-pending-settings-from-process *setting-control* self 'common-page)
|
||||
(suspend)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(clear-pending-settings-from-process *setting-control* self 'common-page)
|
||||
(suspend)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function static-screen-init-by-other
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defbehavior
|
||||
static-screen-init-by-other static-screen
|
||||
((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 symbol))
|
||||
(defbehavior static-screen-init-by-other static-screen ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 symbol))
|
||||
(let ((s3-0 (lookup-part-group-by-name "group-part-screen1")))
|
||||
(when
|
||||
(and
|
||||
s3-0
|
||||
(nonzero? s3-0)
|
||||
(type-type? (-> s3-0 type) sparticle-launch-group)
|
||||
)
|
||||
(set!
|
||||
(-> *part-id-table* 2966 init-specs 0 initial-valuef)
|
||||
(the-as float arg1)
|
||||
)
|
||||
(set!
|
||||
(-> *part-id-table* 2967 init-specs 0 initial-valuef)
|
||||
(the-as float arg2)
|
||||
)
|
||||
(set!
|
||||
(-> *part-id-table* 2968 init-specs 0 initial-valuef)
|
||||
(the-as float arg3)
|
||||
)
|
||||
(set!
|
||||
(-> self part 0)
|
||||
(create-launch-control (the-as sparticle-launch-group s3-0) self)
|
||||
)
|
||||
(go-virtual idle arg0 arg4 arg5)
|
||||
(when (and s3-0 (nonzero? s3-0) (type-type? (-> s3-0 type) sparticle-launch-group))
|
||||
(set! (-> *part-id-table* 2966 init-specs 0 initial-valuef) (the-as float arg1))
|
||||
(set! (-> *part-id-table* 2967 init-specs 0 initial-valuef) (the-as float arg2))
|
||||
(set! (-> *part-id-table* 2968 init-specs 0 initial-valuef) (the-as float arg3))
|
||||
(set! (-> self part 0) (create-launch-control (the-as sparticle-launch-group s3-0) self))
|
||||
(go-virtual idle arg0 arg4 arg5)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function static-screen-spawn
|
||||
;; Used lq/sq
|
||||
(defun
|
||||
static-screen-spawn
|
||||
((arg0 int)
|
||||
(arg1 int)
|
||||
(arg2 int)
|
||||
(arg3 int)
|
||||
(arg4 int)
|
||||
(arg5 symbol)
|
||||
(arg6 target)
|
||||
)
|
||||
(defun static-screen-spawn ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 symbol) (arg6 target))
|
||||
(local-vars (sv-16 process))
|
||||
(set! sv-16 (get-process *default-dead-pool* static-screen #x4000))
|
||||
(when sv-16
|
||||
(let ((t9-1 (method-of-type static-screen activate)))
|
||||
(t9-1
|
||||
(the-as static-screen sv-16)
|
||||
arg6
|
||||
'static-screen
|
||||
(the-as pointer #x70004000)
|
||||
)
|
||||
(let ((t9-1 (method-of-type static-screen activate)))
|
||||
(t9-1 (the-as static-screen sv-16) arg6 'static-screen (the-as pointer #x70004000))
|
||||
)
|
||||
(run-now-in-process sv-16 static-screen-init-by-other arg0 arg1 arg2 arg3 arg4 arg5)
|
||||
(-> sv-16 ppointer)
|
||||
)
|
||||
(run-now-in-process
|
||||
sv-16
|
||||
static-screen-init-by-other
|
||||
arg0
|
||||
arg1
|
||||
arg2
|
||||
arg3
|
||||
arg4
|
||||
arg5
|
||||
)
|
||||
(-> sv-16 ppointer)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
27
scripts/find-missing-ref-tests.py
Normal file
27
scripts/find-missing-ref-tests.py
Normal file
@ -0,0 +1,27 @@
|
||||
# Find files that are added to gsrc, but not to ref tests
|
||||
from jak1_file_list import file_list
|
||||
import os
|
||||
|
||||
src_path = ""
|
||||
for f in file_list:
|
||||
if f[2] != 3:
|
||||
continue
|
||||
if f[4] == "kernel":
|
||||
continue
|
||||
src_path = f[4]
|
||||
gsrc_exists = False
|
||||
gsrc_path = "./goal_src/{}/{}.gc".format(src_path, f[0])
|
||||
if os.path.exists(gsrc_path):
|
||||
with open(gsrc_path, "r") as gsrc_file:
|
||||
lines = gsrc_file.readlines()
|
||||
line_count = len(lines)
|
||||
if line_count > 100:
|
||||
gsrc_exists = True
|
||||
|
||||
# now check if there is a ref test file
|
||||
if gsrc_exists:
|
||||
ref_path = "./test/decompiler/reference/{}/{}_REF.gc".format(src_path, f[0])
|
||||
if not os.path.exists(ref_path):
|
||||
print("No Ref Test for - {}".format(f[0]))
|
||||
print(gsrc_path)
|
||||
print(ref_path)
|
98
test/decompiler/reference/engine/draw/drawable-tree_REF.gc
generated
vendored
Normal file
98
test/decompiler/reference/engine/draw/drawable-tree_REF.gc
generated
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for method 10 of type drawable-tree-array
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod draw drawable-tree-array ((obj drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame))
|
||||
(let ((v1-1 (-> (the-as terrain-context #x70000000) bsp lev-index)))
|
||||
(case (-> *level* level v1-1 display?)
|
||||
(('special 'special-vis #f)
|
||||
)
|
||||
(else
|
||||
(dotimes (s3-0 (-> obj length))
|
||||
(draw (-> obj trees s3-0) (-> arg0 trees s3-0) arg1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 14 of type drawable-tree-array
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod collect-stats drawable-tree-array ((obj drawable-tree-array))
|
||||
(dotimes (s5-0 (-> obj length))
|
||||
(collect-stats (-> obj trees s5-0))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 15 of type drawable-tree-array
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod debug-draw drawable-tree-array ((obj drawable-tree-array) (arg0 drawable) (arg1 display-frame))
|
||||
(dotimes (s3-0 (-> obj length))
|
||||
(debug-draw (-> obj trees s3-0) (-> (the-as drawable-tree-array arg0) trees s3-0) arg1)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 16 of type drawable-tree
|
||||
;; WARN: Unsupported inline assembly instruction kind - [sra t4, t4, 1]
|
||||
(defmethod unpack-vis drawable-tree ((obj drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8)))
|
||||
(local-vars (t5-1 int))
|
||||
(let* ((v1-0 (the-as drawable-inline-array-node (-> obj data 0)))
|
||||
(a3-1 (/ (-> v1-0 data 0 id) 8))
|
||||
(t0-0 (-> v1-0 length))
|
||||
(v1-1 (&+ arg0 a3-1))
|
||||
(a3-3 (/ (+ t0-0 7) 8))
|
||||
)
|
||||
(dotimes (t0-1 a3-3)
|
||||
(let ((t1-0 (-> arg1 0)))
|
||||
(set! arg1 (&-> arg1 1))
|
||||
(set! (-> v1-1 0) t1-0)
|
||||
)
|
||||
(set! v1-1 (&-> v1-1 1))
|
||||
)
|
||||
)
|
||||
(let ((v1-5 (+ (-> obj length) -1)))
|
||||
(when (nonzero? v1-5)
|
||||
(dotimes (a3-5 v1-5)
|
||||
(let* ((t0-4 (-> obj data a3-5))
|
||||
(t2-0 (-> obj data (+ a3-5 1)))
|
||||
(t1-5 (/ (-> (the-as drawable-inline-array-node t0-4) data 0 id) 8))
|
||||
(t2-2 (/ (-> (the-as drawable-inline-array-node t2-0) data 0 id) 8))
|
||||
(t0-5 (-> (the-as drawable-inline-array-node t0-4) length))
|
||||
(t1-6 (&+ arg0 t1-5))
|
||||
(t2-3 (&+ arg0 t2-2))
|
||||
)
|
||||
(while #t
|
||||
(let ((t3-0 (-> t1-6 0)))
|
||||
(set! t1-6 (&-> t1-6 1))
|
||||
(let ((t4-0 128))
|
||||
(label cfg-7)
|
||||
(b! (zero? (logand t3-0 t4-0)) cfg-9 :delay (set! t5-1 (-> arg1 0)))
|
||||
(set! arg1 (&-> arg1 1))
|
||||
(set! (-> t2-3 0) t5-1)
|
||||
(label cfg-9)
|
||||
(+! t0-5 -1)
|
||||
(b! (zero? t0-5) cfg-12 :delay (.sra t4-0 t4-0 1))
|
||||
(b! (nonzero? t4-0) cfg-7 :delay (set! t2-3 (&-> t2-3 1)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(label cfg-12)
|
||||
(nop!)
|
||||
0
|
||||
)
|
||||
)
|
||||
)
|
||||
arg1
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
2211
test/decompiler/reference/engine/draw/drawable_REF.gc
generated
vendored
Normal file
2211
test/decompiler/reference/engine/draw/drawable_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1912
test/decompiler/reference/engine/entity/entity_REF.gc
generated
vendored
Normal file
1912
test/decompiler/reference/engine/entity/entity_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
16395
test/decompiler/reference/engine/gfx/ocean/ocean-frames_REF.gc
generated
vendored
Normal file
16395
test/decompiler/reference/engine/gfx/ocean/ocean-frames_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
11589
test/decompiler/reference/engine/gfx/ocean/ocean-tables_REF.gc
generated
vendored
Normal file
11589
test/decompiler/reference/engine/gfx/ocean/ocean-tables_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
202
test/decompiler/reference/engine/gfx/sky/sky_REF.gc
generated
vendored
Normal file
202
test/decompiler/reference/engine/gfx/sky/sky_REF.gc
generated
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for function sky-make-sun-data
|
||||
;; INFO: Return type mismatch symbol vs none.
|
||||
(defun sky-make-sun-data ((arg0 sky-parms) (arg1 int) (arg2 float))
|
||||
(let* ((s4-0 (-> arg0 orbit arg1))
|
||||
(s3-0 (-> arg0 upload-data sun arg1))
|
||||
(f0-1 (- arg2 (-> s4-0 high-noon)))
|
||||
(f30-0 (* 2730.6667 f0-1))
|
||||
(f28-0 (* (sin f30-0) (-> s4-0 dist)))
|
||||
(f30-1 (cos f30-0))
|
||||
)
|
||||
(let* ((f24-0 (* f30-1 (-> s4-0 dist)))
|
||||
(f26-0 (* f24-0 (cos-rad (-> s4-0 tilt))))
|
||||
(f24-1 (* f24-0 (sin-rad (-> s4-0 tilt))))
|
||||
(f22-0 (sin-rad (-> s4-0 rise)))
|
||||
(f0-10 (cos-rad (-> s4-0 rise)))
|
||||
)
|
||||
(set! (-> s3-0 pos z) (- (+ (* f28-0 f0-10) (* f24-1 f22-0))))
|
||||
(set! (-> s3-0 pos y) f26-0)
|
||||
(set! (-> s3-0 pos x) (- (* f24-1 f0-10) (* f28-0 f22-0)))
|
||||
)
|
||||
(let ((f0-14 (if (< f30-1 0.0)
|
||||
0.0
|
||||
f30-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> arg0 upload-data sun arg1 r-aurora)
|
||||
(+ (* (-> s4-0 min-halo) (- 1.0 f0-14)) (* (-> s4-0 max-halo) f0-14))
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function sky-make-moon-data
|
||||
;; INFO: Return type mismatch symbol vs none.
|
||||
(defun sky-make-moon-data ((arg0 sky-parms) (arg1 float))
|
||||
(let* ((s5-0 (-> arg0 orbit 2))
|
||||
(gp-0 (-> arg0 upload-data moon))
|
||||
(f0-1 (- arg1 (-> s5-0 high-noon)))
|
||||
(f28-0 (* 2730.6667 f0-1))
|
||||
(f30-0 (* (sin f28-0) (-> s5-0 dist)))
|
||||
(f26-0 (* (cos f28-0) (-> s5-0 dist)))
|
||||
(f28-1 (* f26-0 (cos-rad (-> s5-0 tilt))))
|
||||
(f26-1 (* f26-0 (sin-rad (-> s5-0 tilt))))
|
||||
(f24-0 (sin-rad (-> s5-0 rise)))
|
||||
(f0-10 (cos-rad (-> s5-0 rise)))
|
||||
)
|
||||
(set! (-> gp-0 pos z) (- (+ (* f30-0 f0-10) (* f26-1 f24-0))))
|
||||
(set! (-> gp-0 pos y) f28-1)
|
||||
(set! (-> gp-0 pos x) (- (* f26-1 f0-10) (* f30-0 f24-0)))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function sky-make-light
|
||||
;; INFO: Return type mismatch light vs none.
|
||||
(defun sky-make-light ((arg0 sky-parms) (arg1 light) (arg2 int) (arg3 rgba))
|
||||
(let* ((v1-2 (-> arg0 orbit arg2))
|
||||
(a0-1 (if (= arg2 2)
|
||||
(-> arg0 upload-data moon)
|
||||
(-> arg0 upload-data sun arg2)
|
||||
)
|
||||
)
|
||||
(f0-0 0.003921569)
|
||||
(f1-1 (/ 1.0 (-> v1-2 dist)))
|
||||
(v1-3 arg1)
|
||||
)
|
||||
(set! (-> v1-3 direction x) (* (-> (the-as sky-sun-data a0-1) pos x) f1-1))
|
||||
(set! (-> v1-3 direction y) (* (-> (the-as sky-sun-data a0-1) pos y) f1-1))
|
||||
(set! (-> v1-3 direction z) (* (-> (the-as sky-sun-data a0-1) pos z) f1-1))
|
||||
(set! (-> v1-3 color x) (* (the float (-> arg3 r)) f0-0))
|
||||
(set! (-> v1-3 color y) (* (the float (-> arg3 g)) f0-0))
|
||||
(set! (-> v1-3 color z) (* (the float (-> arg3 b)) f0-0))
|
||||
(set! (-> v1-3 color w) 1.0)
|
||||
(set! (-> v1-3 levels x) 1.0)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition of type sky-frame-data
|
||||
(deftype sky-frame-data (structure)
|
||||
((data uint128 18 :offset-assert 0)
|
||||
(world-homo-matrix matrix :inline :offset 0)
|
||||
(hmge-scale vector :inline :offset 64)
|
||||
(hvdf-offset vector :inline :offset 80)
|
||||
(consts vector :inline :offset 96)
|
||||
(pfog0 float :offset 96)
|
||||
(radius float :offset 100)
|
||||
(nokick float :offset 108)
|
||||
(strip-giftag qword :inline :offset 112)
|
||||
(col-adgif qword :inline :offset 128)
|
||||
(save uint128 5 :offset 144)
|
||||
(sun-fan-giftag qword :inline :offset 224)
|
||||
(sun-strip-giftag qword :inline :offset 240)
|
||||
(sun-alpha qword :inline :offset 256)
|
||||
(sun-alpha-giftag qword :inline :offset 272)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x120
|
||||
:flag-assert #x900000120
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sky-frame-data
|
||||
(defmethod inspect sky-frame-data ((obj sky-frame-data))
|
||||
(format #t "[~8x] ~A~%" obj 'sky-frame-data)
|
||||
(format #t "~Tdata[18] @ #x~X~%" (-> obj data))
|
||||
(format #t "~Tworld-homo-matrix: #<matrix @ #x~X>~%" (-> obj data))
|
||||
(format #t "~Thmge-scale: #<vector @ #x~X>~%" (-> obj hmge-scale))
|
||||
(format #t "~Thvdf-offset: #<vector @ #x~X>~%" (-> obj hvdf-offset))
|
||||
(format #t "~Tconsts: #<vector @ #x~X>~%" (-> obj consts))
|
||||
(format #t "~Tpfog0: ~f~%" (-> obj consts x))
|
||||
(format #t "~Tradius: ~f~%" (-> obj consts y))
|
||||
(format #t "~Tnokick: ~f~%" (-> obj consts w))
|
||||
(format #t "~Tstrip-giftag: #<qword @ #x~X>~%" (-> obj strip-giftag))
|
||||
(format #t "~Tcol-adgif: #<qword @ #x~X>~%" (-> obj col-adgif))
|
||||
(format #t "~Tsave[5] @ #x~X~%" (-> obj save))
|
||||
(format #t "~Tsun-fan-giftag: #<qword @ #x~X>~%" (-> obj sun-fan-giftag))
|
||||
(format #t "~Tsun-strip-giftag: #<qword @ #x~X>~%" (-> obj sun-strip-giftag))
|
||||
(format #t "~Tsun-alpha: #<qword @ #x~X>~%" (-> obj sun-alpha))
|
||||
(format #t "~Tsun-alpha-giftag: #<qword @ #x~X>~%" (-> obj sun-alpha-giftag))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for symbol sky-vu1-block, type vu-function
|
||||
(define sky-vu1-block (new 'static 'vu-function :length #xcd :qlength #x67))
|
||||
|
||||
;; definition for function sky-init-upload-data
|
||||
;; ERROR: function has no type analysis. Cannot decompile.
|
||||
|
||||
;; definition for function sky-add-frame-data
|
||||
;; ERROR: function has no type analysis. Cannot decompile.
|
||||
|
||||
;; definition for function sky-upload
|
||||
;; ERROR: function has no type analysis. Cannot decompile.
|
||||
|
||||
;; definition for function sky-draw
|
||||
;; WARN: Type Propagation failed: Failed type prop at op 12 ((set! a0 (+ a0 16))): Cannot get_type_int2: (+ a0 16), args float and <integer 16>
|
||||
;; WARN: Type Propagation failed: Type analysis failed
|
||||
(defun sky-draw ((a0-0 sky-parms))
|
||||
(local-vars
|
||||
(v0-0 none)
|
||||
(v1-0 sky-parms)
|
||||
(a0-1 float)
|
||||
(a0-2 none)
|
||||
(a1-0 int)
|
||||
(a1-1 int)
|
||||
(a1-2 int)
|
||||
(a1-3 int)
|
||||
(a2-0 int)
|
||||
(a2-1 int)
|
||||
(a2-2 int)
|
||||
)
|
||||
(set! v1-0 a0-0)
|
||||
(set! a0-1 (-> v1-0 orbit 0 tilt))
|
||||
(set! a1-0 #x10000000)
|
||||
(s.d! a0-1 a1-0)
|
||||
(set! a1-1 #x15000000)
|
||||
(set! a2-0 191)
|
||||
(set! a2-1 (sll a2-0 48))
|
||||
(set! a2-2 (srl a2-1 48))
|
||||
(set! a1-2 (logior a1-1 a2-2))
|
||||
(s.w! (+ a0-1 8) a1-2)
|
||||
(set! a1-3 #x10000000)
|
||||
(s.w! (+ a0-1 12) a1-3)
|
||||
(set! a0-2 (the-as none (+ a0-1 16)))
|
||||
(s.w! (+ v1-0 4) a0-2)
|
||||
(set! v0-0 (the-as none 0))
|
||||
(ret-none)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(sky-set-sun-radii *sky-parms* 0 60.0 200.0 300.0)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(sky-set-sun-radii *sky-parms* 1 15.0 20.0 300.0)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(sky-set-sun-colors
|
||||
*sky-parms*
|
||||
1
|
||||
(new 'static 'rgba :r #xc2 :g #xfe :b #x78 :a #x80)
|
||||
(new 'static 'rgba :r #xc2 :g #xfe :b #x78 :a #x80)
|
||||
(new 'static 'rgba :r #xc2 :g #xfe :b #x78 :a #x20)
|
||||
(new 'static 'rgba :r #xc2 :g #xfe :b #x78)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(sky-set-orbit *sky-parms* 0 12.5 -15.0 0.0 9950.0 300.0 300.0)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(sky-set-orbit *sky-parms* 1 4.0 0.0 60.0 9950.0 120.0 120.0)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(sky-set-orbit *sky-parms* 2 0.0 0.0 -10.0 9950.0 0.0 0.0)
|
||||
|
||||
|
||||
|
||||
|
153
test/decompiler/reference/engine/sparticle/sparticle-h_REF.gc
generated
vendored
Normal file
153
test/decompiler/reference/engine/sparticle/sparticle-h_REF.gc
generated
vendored
Normal file
@ -0,0 +1,153 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for symbol *sp-frame-time*, type vector
|
||||
(define *sp-frame-time* (new 'global 'vector))
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set-vector! *sp-frame-time* 0.00000000000000000000000000000000000001175495 5.0 1.0 1.0)
|
||||
|
||||
;; definition for symbol *sp-60-hz*, type symbol
|
||||
(define *sp-60-hz* #t)
|
||||
|
||||
;; definition of type sparticle-cpuinfo
|
||||
(deftype sparticle-cpuinfo (structure)
|
||||
((sprite sprite-vec-data-2d :offset-assert 0)
|
||||
(adgif adgif-shader :offset-assert 4)
|
||||
(radius float :offset-assert 8)
|
||||
(omega float :offset-assert 12)
|
||||
(vel-sxvel vector :inline :offset-assert 16)
|
||||
(rot-syvel vector :inline :offset-assert 32)
|
||||
(fade rgbaf :inline :offset-assert 48)
|
||||
(acc vector :inline :offset-assert 64)
|
||||
(rotvel3d quaternion :inline :offset-assert 80)
|
||||
(vel vector3s :inline :offset 16)
|
||||
(accel vector3s :inline :offset 64)
|
||||
(scalevelx float :offset 28)
|
||||
(scalevely float :offset 44)
|
||||
(friction float :offset-assert 96)
|
||||
(timer int32 :offset-assert 100)
|
||||
(flags sp-cpuinfo-flag :offset-assert 104)
|
||||
(user-int32 int32 :offset-assert 108)
|
||||
(user-uint32 uint32 :offset 108)
|
||||
(user-float float :offset 108)
|
||||
(user-pntr uint32 :offset 108)
|
||||
(user-sprite sprite-vec-data-2d :offset 108)
|
||||
(func basic :offset-assert 112)
|
||||
(next-time uint32 :offset-assert 116)
|
||||
(next-launcher basic :offset-assert 120)
|
||||
(cache-alpha float :offset-assert 124)
|
||||
(valid symbol :offset-assert 128)
|
||||
(key sparticle-launch-control :offset-assert 132)
|
||||
(binding sparticle-launch-state :offset-assert 136)
|
||||
(data uint32 1 :offset 12)
|
||||
(dataf float 1 :offset 12)
|
||||
(datac uint8 1 :offset 12)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x8c
|
||||
:flag-assert #x90000008c
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-cpuinfo
|
||||
(defmethod inspect sparticle-cpuinfo ((obj sparticle-cpuinfo))
|
||||
(format #t "[~8x] ~A~%" obj 'sparticle-cpuinfo)
|
||||
(format #t "~Tsprite: #<sprite-vec-data-2d @ #x~X>~%" (-> obj sprite))
|
||||
(format #t "~Tadgif: #<adgif-shader @ #x~X>~%" (-> obj adgif))
|
||||
(format #t "~Tradius: ~f~%" (-> obj radius))
|
||||
(format #t "~Tomega: ~f~%" (-> obj omega))
|
||||
(format #t "~Tvel-sxvel: #<vector @ #x~X>~%" (-> obj vel-sxvel))
|
||||
(format #t "~Trot-syvel: #<vector @ #x~X>~%" (-> obj rot-syvel))
|
||||
(format #t "~Tfade: #<rgbaf @ #x~X>~%" (-> obj fade))
|
||||
(format #t "~Tacc: #<vector @ #x~X>~%" (-> obj acc))
|
||||
(format #t "~Trotvel3d: #<quaternion @ #x~X>~%" (-> obj rotvel3d))
|
||||
(format #t "~Tvel: #<vector3s @ #x~X>~%" (-> obj vel-sxvel))
|
||||
(format #t "~Taccel: #<vector3s @ #x~X>~%" (-> obj acc))
|
||||
(format #t "~Tscalevelx: ~f~%" (-> obj vel-sxvel w))
|
||||
(format #t "~Tscalevely: ~f~%" (-> obj rot-syvel w))
|
||||
(format #t "~Tfriction: ~f~%" (-> obj friction))
|
||||
(format #t "~Ttimer: ~D~%" (-> obj timer))
|
||||
(format #t "~Tflags: ~D~%" (-> obj flags))
|
||||
(format #t "~Tuser-int32: ~D~%" (-> obj user-float))
|
||||
(format #t "~Tuser-uint32: ~D~%" (-> obj user-float))
|
||||
(format #t "~Tuser-float: ~f~%" (the-as float (-> obj user-float)))
|
||||
(format #t "~Tuser-pntr: #x~X~%" (-> obj user-float))
|
||||
(format #t "~Tuser-sprite: #<sprite-vec-data-2d @ #x~X>~%" (-> obj user-float))
|
||||
(format #t "~Tfunc: ~A~%" (-> obj func))
|
||||
(format #t "~Tnext-time: ~D~%" (-> obj next-time))
|
||||
(format #t "~Tnext-launcher: ~A~%" (-> obj next-launcher))
|
||||
(format #t "~Tcache-alpha: ~f~%" (-> obj cache-alpha))
|
||||
(format #t "~Tvalid: ~A~%" (-> obj valid))
|
||||
(format #t "~Tkey: ~A~%" (-> obj key))
|
||||
(format #t "~Tbinding: #<sparticle-launch-state @ #x~X>~%" (-> obj binding))
|
||||
(format #t "~Tdata[1] @ #x~X~%" (&-> obj omega))
|
||||
(format #t "~Tdataf[1] @ #x~X~%" (&-> obj omega))
|
||||
(format #t "~Tdatac[1] @ #x~X~%" (&-> obj omega))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type sparticle-launchinfo
|
||||
(deftype sparticle-launchinfo (structure)
|
||||
((launchrot vector :inline :offset-assert 0)
|
||||
(conerot vector :inline :offset-assert 16)
|
||||
(coneradius float :offset-assert 32)
|
||||
(rotate-y float :offset-assert 36)
|
||||
(data uint8 1 :offset 0)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x28
|
||||
:flag-assert #x900000028
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-launchinfo
|
||||
(defmethod inspect sparticle-launchinfo ((obj sparticle-launchinfo))
|
||||
(format #t "[~8x] ~A~%" obj 'sparticle-launchinfo)
|
||||
(format #t "~Tlaunchrot: #<vector @ #x~X>~%" (-> obj launchrot))
|
||||
(format #t "~Tconerot: #<vector @ #x~X>~%" (-> obj conerot))
|
||||
(format #t "~Tconeradius: ~f~%" (-> obj coneradius))
|
||||
(format #t "~Trotate-y: ~f~%" (-> obj rotate-y))
|
||||
(format #t "~Tdata[1] @ #x~X~%" (-> obj launchrot))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type sparticle-system
|
||||
(deftype sparticle-system (basic)
|
||||
((blocks int32 2 :offset-assert 4)
|
||||
(length int32 2 :offset-assert 12)
|
||||
(num-alloc int32 2 :offset-assert 20)
|
||||
(is-3d basic :offset-assert 28)
|
||||
(flags uint32 :offset-assert 32)
|
||||
(alloc-table (pointer uint64) :offset-assert 36)
|
||||
(cpuinfo-table (inline-array sparticle-cpuinfo) :offset-assert 40)
|
||||
(vecdata-table pointer :offset-assert 44)
|
||||
(adgifdata-table (inline-array adgif-shader) :offset-assert 48)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x34
|
||||
:flag-assert #x900000034
|
||||
(:methods
|
||||
(new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_ 0)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-system
|
||||
(defmethod inspect sparticle-system ((obj sparticle-system))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tblocks[2] @ #x~X~%" (-> obj blocks))
|
||||
(format #t "~Tlength[2] @ #x~X~%" (-> obj length))
|
||||
(format #t "~Tnum-alloc[2] @ #x~X~%" (-> obj num-alloc))
|
||||
(format #t "~Tis-3d: ~A~%" (-> obj is-3d))
|
||||
(format #t "~Tflags: ~D~%" (-> obj flags))
|
||||
(format #t "~Talloc-table: #x~X~%" (-> obj alloc-table))
|
||||
(format #t "~Tcpuinfo-table: #x~X~%" (-> obj cpuinfo-table))
|
||||
(format #t "~Tvecdata-table: #x~X~%" (-> obj vecdata-table))
|
||||
(format #t "~Tadgifdata-table: #x~X~%" (-> obj adgifdata-table))
|
||||
obj
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
218
test/decompiler/reference/engine/sparticle/sparticle-launcher-h_REF.gc
generated
vendored
Normal file
218
test/decompiler/reference/engine/sparticle/sparticle-launcher-h_REF.gc
generated
vendored
Normal file
@ -0,0 +1,218 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type sp-field-init-spec
|
||||
(deftype sp-field-init-spec (structure)
|
||||
((field sp-field-id :offset-assert 0)
|
||||
(flags sp-flag :offset-assert 2)
|
||||
(initial-valuef float :offset-assert 4)
|
||||
(random-rangef float :offset-assert 8)
|
||||
(random-multf float :offset-assert 12)
|
||||
(initial-value int32 :offset 4)
|
||||
(random-range int32 :offset 8)
|
||||
(random-mult int32 :offset 12)
|
||||
(sym symbol :offset 4)
|
||||
(func symbol :offset 4)
|
||||
(tex uint32 :offset 4)
|
||||
(pntr pointer :offset 4)
|
||||
(sound sound-spec :offset 4)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sp-field-init-spec
|
||||
(defmethod inspect sp-field-init-spec ((obj sp-field-init-spec))
|
||||
(format #t "[~8x] ~A~%" obj 'sp-field-init-spec)
|
||||
(format #t "~Tfield: ~D~%" (-> obj field))
|
||||
(format #t "~Tflags: ~D~%" (-> obj flags))
|
||||
(format #t "~Tinitial-valuef: ~f~%" (-> obj initial-valuef))
|
||||
(format #t "~Trandom-rangef: ~f~%" (-> obj random-rangef))
|
||||
(format #t "~Trandom-multf: ~f~%" (-> obj random-multf))
|
||||
(format #t "~Tinitial-value: ~D~%" (-> obj initial-valuef))
|
||||
(format #t "~Trandom-range: ~D~%" (-> obj random-rangef))
|
||||
(format #t "~Trandom-mult: ~D~%" (-> obj random-multf))
|
||||
(format #t "~Tfunc: ~A~%" (-> obj initial-valuef))
|
||||
(format #t "~Ttex: ~D~%" (-> obj initial-valuef))
|
||||
(format #t "~Tpntr: #x~X~%" (-> obj initial-valuef))
|
||||
(format #t "~Tsym: ~A~%" (-> obj initial-valuef))
|
||||
(format #t "~Tsound: ~A~%" (-> obj initial-valuef))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type sparticle-launcher
|
||||
(deftype sparticle-launcher (basic)
|
||||
((birthaccum float :offset-assert 4)
|
||||
(soundaccum float :offset-assert 8)
|
||||
(init-specs (inline-array sp-field-init-spec) :offset-assert 12)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-launcher
|
||||
(defmethod inspect sparticle-launcher ((obj sparticle-launcher))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tbirthaccum: ~f~%" (-> obj birthaccum))
|
||||
(format #t "~Tsoundaccum: ~f~%" (-> obj soundaccum))
|
||||
(format #t "~Tinit-specs: #x~X~%" (-> obj init-specs))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type sparticle-group-item
|
||||
(deftype sparticle-group-item (structure)
|
||||
((launcher uint32 :offset-assert 0)
|
||||
(fade-after meters :offset-assert 4)
|
||||
(falloff-to meters :offset-assert 8)
|
||||
(flags sp-group-item-flag :offset-assert 12)
|
||||
(period uint16 :offset-assert 14)
|
||||
(length uint16 :offset-assert 16)
|
||||
(offset uint16 :offset-assert 18)
|
||||
(hour-mask uint32 :offset-assert 20)
|
||||
(binding uint32 :offset-assert 24)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x1c
|
||||
:flag-assert #x90000001c
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-group-item
|
||||
(defmethod inspect sparticle-group-item ((obj sparticle-group-item))
|
||||
(format #t "[~8x] ~A~%" obj 'sparticle-group-item)
|
||||
(format #t "~Tlauncher: ~D~%" (-> obj launcher))
|
||||
(format #t "~Tfade-after: (meters ~m)~%" (-> obj fade-after))
|
||||
(format #t "~Tfalloff-to: (meters ~m)~%" (-> obj falloff-to))
|
||||
(format #t "~Tflags: ~D~%" (-> obj flags))
|
||||
(format #t "~Tperiod: ~D~%" (-> obj period))
|
||||
(format #t "~Tlength: ~D~%" (-> obj length))
|
||||
(format #t "~Toffset: ~D~%" (-> obj offset))
|
||||
(format #t "~Thour-mask: ~D~%" (-> obj hour-mask))
|
||||
(format #t "~Tbinding: ~D~%" (-> obj binding))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type sparticle-launch-state
|
||||
(deftype sparticle-launch-state (structure)
|
||||
((group-item sparticle-group-item :offset-assert 0)
|
||||
(flags sp-launch-state-flags :offset-assert 4)
|
||||
(randomize uint16 :offset-assert 6)
|
||||
(origin vector :offset-assert 8)
|
||||
(sprite3d sprite-vec-data-3d :offset-assert 12)
|
||||
(sprite sparticle-cpuinfo :offset-assert 16)
|
||||
(offset uint32 :offset-assert 20)
|
||||
(accum float :offset-assert 24)
|
||||
(spawn-time uint32 :offset-assert 28)
|
||||
(swarm basic :offset 20)
|
||||
(seed uint32 :offset 24)
|
||||
(time uint32 :offset 28)
|
||||
(spec basic :offset 16)
|
||||
(id uint32 :offset 12)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x20
|
||||
:flag-assert #x900000020
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-launch-state
|
||||
(defmethod inspect sparticle-launch-state ((obj sparticle-launch-state))
|
||||
(format #t "[~8x] ~A~%" obj 'sparticle-launch-state)
|
||||
(format #t "~Tgroup-item: #<sparticle-group-item @ #x~X>~%" (-> obj group-item))
|
||||
(format #t "~Tflags: ~D~%" (-> obj flags))
|
||||
(format #t "~Trandomize: ~D~%" (-> obj randomize))
|
||||
(format #t "~Torigin: #<vector @ #x~X>~%" (-> obj origin))
|
||||
(format #t "~Tsprite3d: #<sprite-vec-data-3d @ #x~X>~%" (-> obj sprite3d))
|
||||
(format #t "~Tsprite: ~A~%" (-> obj sprite))
|
||||
(format #t "~Toffset: ~D~%" (-> obj offset))
|
||||
(format #t "~Taccum: ~f~%" (-> obj accum))
|
||||
(format #t "~Tspawn-time: ~D~%" (-> obj spawn-time))
|
||||
(format #t "~Tswarm: ~A~%" (-> obj offset))
|
||||
(format #t "~Tseed: ~D~%" (-> obj accum))
|
||||
(format #t "~Ttime: ~D~%" (-> obj spawn-time))
|
||||
(format #t "~Tspec: ~A~%" (-> obj sprite))
|
||||
(format #t "~Tid: ~D~%" (-> obj sprite3d))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type sparticle-launch-group
|
||||
(deftype sparticle-launch-group (basic)
|
||||
((length int16 :offset-assert 4)
|
||||
(duration uint16 :offset-assert 6)
|
||||
(linger-duration uint16 :offset-assert 8)
|
||||
(flags sp-group-flag :offset-assert 10)
|
||||
(name string :offset-assert 12)
|
||||
(launcher (inline-array sparticle-group-item) :offset-assert 16)
|
||||
(bounds sphere :inline :offset-assert 32)
|
||||
)
|
||||
:method-count-assert 10
|
||||
:size-assert #x30
|
||||
:flag-assert #xa00000030
|
||||
(:methods
|
||||
(create-launch-control (_type_ process) sparticle-launch-control 9)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-launch-group
|
||||
(defmethod inspect sparticle-launch-group ((obj sparticle-launch-group))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tlength: ~D~%" (-> obj length))
|
||||
(format #t "~Tduration: ~D~%" (-> obj duration))
|
||||
(format #t "~Tlinger-duration: ~D~%" (-> obj linger-duration))
|
||||
(format #t "~Tflags: ~D~%" (-> obj flags))
|
||||
(format #t "~Tname: ~A~%" (-> obj name))
|
||||
(format #t "~Tlauncher: #x~X~%" (-> obj launcher))
|
||||
(format #t "~Tbounds: #<sphere @ #x~X>~%" (-> obj bounds))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type sparticle-launch-control
|
||||
(deftype sparticle-launch-control (inline-array-class)
|
||||
((group sparticle-launch-group :offset-assert 16)
|
||||
(proc process :offset-assert 20)
|
||||
(local-clock int32 :offset-assert 24)
|
||||
(fade float :offset-assert 28)
|
||||
(matrix int32 :offset-assert 32)
|
||||
(last-spawn-frame int32 :offset-assert 36)
|
||||
(last-spawn-time int32 :offset-assert 40)
|
||||
(center vector :inline :offset-assert 48)
|
||||
(data sparticle-launch-state :inline :dynamic :offset-assert 64)
|
||||
)
|
||||
:method-count-assert 14
|
||||
:size-assert #x40
|
||||
:flag-assert #xe00000040
|
||||
(:methods
|
||||
(initialize (_type_ sparticle-launch-group process) none 9)
|
||||
(is-visible? (_type_ vector) symbol 10)
|
||||
(spawn (_type_ vector) object 11)
|
||||
(kill-and-free-particles (_type_) none 12)
|
||||
(kill-particles (_type_) none 13)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-launch-control
|
||||
(defmethod inspect sparticle-launch-control ((obj sparticle-launch-control))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tlength: ~D~%" (-> obj length))
|
||||
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
|
||||
(format #t "~Tgroup: ~A~%" (-> obj group))
|
||||
(format #t "~Tproc: ~A~%" (-> obj proc))
|
||||
(format #t "~Tlocal-clock: ~D~%" (-> obj local-clock))
|
||||
(format #t "~Tfade: ~f~%" (-> obj fade))
|
||||
(format #t "~Tmatrix: ~D~%" (-> obj matrix))
|
||||
(format #t "~Tlast-spawn-frame: ~D~%" (-> obj last-spawn-frame))
|
||||
(format #t "~Tlast-spawn-time: ~D~%" (-> obj last-spawn-time))
|
||||
(format #t "~Tcenter: ~`vector`P~%" (-> obj center))
|
||||
(format #t "~Tdata[0] @ #x~X~%" (-> obj data))
|
||||
obj
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> sparticle-launch-control heap-base) (the-as uint 32))
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
1362
test/decompiler/reference/engine/sparticle/sparticle-launcher_REF.gc
generated
vendored
Normal file
1362
test/decompiler/reference/engine/sparticle/sparticle-launcher_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
741
test/decompiler/reference/engine/sparticle/sparticle_REF.gc
generated
vendored
Normal file
741
test/decompiler/reference/engine/sparticle/sparticle_REF.gc
generated
vendored
Normal file
@ -0,0 +1,741 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for method 2 of type sparticle-cpuinfo
|
||||
;; INFO: Return type mismatch object vs sparticle-cpuinfo.
|
||||
(defmethod print sparticle-cpuinfo ((obj sparticle-cpuinfo))
|
||||
(format #t "<sparticle-cpuinfo>~%")
|
||||
(dotimes (s5-0 16)
|
||||
(format #t "~D:~F~%" s5-0 (the-as float (-> obj data s5-0)))
|
||||
)
|
||||
(format #t "TIMER:~D~%" (-> obj timer))
|
||||
(the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> obj flags)))
|
||||
)
|
||||
|
||||
;; definition for function sp-particle-copy!
|
||||
;; INFO: Return type mismatch basic vs none.
|
||||
;; Used lq/sq
|
||||
(defun sp-particle-copy! ((arg0 sparticle-cpuinfo) (arg1 sparticle-cpuinfo))
|
||||
(let ((v1-1 (-> arg1 sprite x-y-z-sx quad)))
|
||||
(set! (-> arg0 sprite x-y-z-sx quad) v1-1)
|
||||
)
|
||||
(let ((v1-3 (-> arg1 sprite flag-rot-sy quad)))
|
||||
(set! (-> arg0 sprite flag-rot-sy quad) v1-3)
|
||||
)
|
||||
(let ((v1-5 (-> arg1 sprite color quad)))
|
||||
(set! (-> arg0 sprite color quad) v1-5)
|
||||
)
|
||||
(dotimes (v1-6 10)
|
||||
(set! (-> arg0 adgif prims v1-6) (-> arg1 adgif prims v1-6))
|
||||
)
|
||||
(set! (-> arg0 vel-sxvel quad) (-> arg1 vel-sxvel quad))
|
||||
(set! (-> arg0 rot-syvel quad) (-> arg1 rot-syvel quad))
|
||||
(set! (-> arg0 fade quad) (-> arg1 fade quad))
|
||||
(set! (-> arg0 acc quad) (-> arg1 acc quad))
|
||||
(set! (-> arg0 friction) (-> arg1 friction))
|
||||
(set! (-> arg0 timer) (-> arg1 timer))
|
||||
(set! (-> arg0 flags) (-> arg1 flags))
|
||||
(set! (-> arg0 user-float) (-> arg1 user-float))
|
||||
(set! (-> arg0 func) (-> arg1 func))
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 0 of type sparticle-system
|
||||
(defmethod new sparticle-system ((allocation symbol)
|
||||
(type-to-make type)
|
||||
(arg0 int)
|
||||
(arg1 int)
|
||||
(arg2 symbol)
|
||||
(arg3 pointer)
|
||||
(arg4 (inline-array adgif-shader))
|
||||
)
|
||||
(let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
|
||||
(let* ((v1-3 (/ (+ arg0 63) 64))
|
||||
(a0-2 (/ (+ arg1 63) 64))
|
||||
(a1-2 (* v1-3 64))
|
||||
(a2-2 (* a0-2 64))
|
||||
(s2-1 (+ v1-3 a0-2))
|
||||
(s5-1 (+ a1-2 a2-2))
|
||||
)
|
||||
(set! (-> gp-0 blocks 0) v1-3)
|
||||
(set! (-> gp-0 length 0) a1-2)
|
||||
(set! (-> gp-0 num-alloc 0) 0)
|
||||
(set! (-> gp-0 blocks 1) a0-2)
|
||||
(set! (-> gp-0 length 1) a2-2)
|
||||
(set! (-> gp-0 num-alloc 1) 0)
|
||||
(set! (-> gp-0 is-3d) arg2)
|
||||
(set! (-> gp-0 alloc-table) (the-as (pointer uint64) (malloc 'global (* s2-1 8))))
|
||||
(set! (-> gp-0 cpuinfo-table) (the-as (inline-array sparticle-cpuinfo) (malloc 'global (* 144 s5-1))))
|
||||
(set! (-> gp-0 vecdata-table) arg3)
|
||||
(set! (-> gp-0 adgifdata-table) arg4)
|
||||
(dotimes (v1-5 s2-1)
|
||||
(set! (-> gp-0 alloc-table v1-5) (the-as uint -1))
|
||||
)
|
||||
(dotimes (s4-1 s5-1)
|
||||
(set! (-> gp-0 cpuinfo-table s4-1 valid) #f)
|
||||
(set! (-> gp-0 cpuinfo-table s4-1 sprite)
|
||||
(the-as sprite-vec-data-2d (&+ (-> gp-0 vecdata-table) (* 48 s4-1)))
|
||||
)
|
||||
(set! (-> gp-0 cpuinfo-table s4-1 adgif) (-> gp-0 adgifdata-table s4-1))
|
||||
(adgif-shader<-texture-simple! (-> gp-0 adgifdata-table s4-1) (the-as texture #f))
|
||||
(set! (-> gp-0 adgifdata-table s4-1 alpha) (new 'static 'gs-miptbp :tbp1 #x48))
|
||||
)
|
||||
)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for symbol *sp-particle-system-2d*, type sparticle-system
|
||||
(define
|
||||
*sp-particle-system-2d*
|
||||
(new 'global 'sparticle-system 1920 128 #f (-> *sprite-array-2d* vec-data) (-> *sprite-array-2d* adgif-data))
|
||||
)
|
||||
|
||||
;; definition for symbol *sp-particle-system-3d*, type sparticle-system
|
||||
(define
|
||||
*sp-particle-system-3d*
|
||||
(new 'global 'sparticle-system 256 0 #t (-> *sprite-array-3d* vec-data) (-> *sprite-array-3d* adgif-data))
|
||||
)
|
||||
|
||||
;; definition for function sp-get-block-size
|
||||
(defun sp-get-block-size ((arg0 sparticle-system) (arg1 int))
|
||||
(let ((v0-0 0))
|
||||
(let ((v1-0 0)
|
||||
(a2-0 (-> arg0 blocks 0))
|
||||
)
|
||||
(when (= arg1 1)
|
||||
(set! v1-0 a2-0)
|
||||
(set! a2-0 (-> arg0 blocks 1))
|
||||
)
|
||||
(dotimes (a1-3 a2-0)
|
||||
(if (!= (-> arg0 alloc-table (+ v1-0 a1-3)) -1)
|
||||
(set! v0-0 (+ a1-3 1))
|
||||
)
|
||||
)
|
||||
)
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function sp-get-approx-alloc-size
|
||||
(defun sp-get-approx-alloc-size ((arg0 sparticle-system) (arg1 int))
|
||||
(let ((a3-0 arg1)
|
||||
(v1-0 0)
|
||||
)
|
||||
(let ((a1-1 0)
|
||||
(a2-0 (-> arg0 blocks 0))
|
||||
)
|
||||
(when (= a3-0 1)
|
||||
(set! a1-1 a2-0)
|
||||
(set! a2-0 (-> arg0 blocks 1))
|
||||
)
|
||||
(dotimes (a3-3 a2-0)
|
||||
(if (!= (-> arg0 alloc-table (+ a1-1 a3-3)) -1)
|
||||
(set! v1-0 (+ a3-3 1))
|
||||
)
|
||||
)
|
||||
)
|
||||
(* v1-0 64)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function sp-free-particle
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun sp-free-particle ((arg0 sparticle-system) (arg1 int) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-2d))
|
||||
(if (and (-> arg2 binding) (nonzero? (-> arg2 binding)))
|
||||
(logclear! (-> arg2 binding flags) (sp-launch-state-flags launcher-active particles-active))
|
||||
)
|
||||
(let ((v1-6 (/ arg1 64))
|
||||
(t0-4 (logand arg1 63))
|
||||
)
|
||||
(logior! (-> arg0 alloc-table v1-6) (ash 1 t0-4))
|
||||
)
|
||||
(if (< arg1 (-> arg0 length 0))
|
||||
(+! (-> arg0 num-alloc 0) -1)
|
||||
(+! (-> arg0 num-alloc 1) -1)
|
||||
)
|
||||
(set! (-> arg2 valid) #f)
|
||||
(set! (-> arg3 a) 0.0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function sp-get-particle
|
||||
;; WARN: Unsupported inline assembly instruction kind - [movn t1, t2, t2]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [movn t1, t2, t2]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [movn t1, t2, t2]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [movn t1, t2, t2]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [movn t1, t2, t2]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [movn t3, t1, t1]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t2, t1]
|
||||
(defun sp-get-particle ((arg0 sparticle-system) (arg1 int) (arg2 sparticle-launch-state))
|
||||
(local-vars
|
||||
(a2-3 int)
|
||||
(a2-4 int)
|
||||
(a2-5 int)
|
||||
(a2-6 int)
|
||||
(a2-7 int)
|
||||
(a2-8 int)
|
||||
(t1-16 int)
|
||||
(t1-17 int)
|
||||
(t1-18 int)
|
||||
(t1-19 int)
|
||||
(t1-20 int)
|
||||
(t3-5 int)
|
||||
)
|
||||
(let ((v1-0 0)
|
||||
(t0-0 (-> arg0 blocks 0))
|
||||
(a3-0 0)
|
||||
)
|
||||
(when (= arg1 1)
|
||||
(set! v1-0 t0-0)
|
||||
(set! t0-0 (-> arg0 blocks 1))
|
||||
)
|
||||
(when arg2
|
||||
(set! a3-0 (the-as int (-> arg2 randomize)))
|
||||
(+! (-> arg2 randomize) 1)
|
||||
(when (= (-> arg2 randomize) t0-0)
|
||||
(set! (-> arg2 randomize) (the-as uint 0))
|
||||
0
|
||||
)
|
||||
)
|
||||
(dotimes (a2-1 t0-0)
|
||||
(when (nonzero? (-> arg0 alloc-table (+ v1-0 a3-0)))
|
||||
(let ((a2-2 0)
|
||||
(t1-15 (-> arg0 alloc-table (+ v1-0 a3-0)))
|
||||
(t0-4 (* (+ v1-0 a3-0) 64))
|
||||
)
|
||||
0
|
||||
0
|
||||
(let ((t2-4 (shl t1-15 32))
|
||||
(t3-0 (+ a2-2 32))
|
||||
)
|
||||
(.movn t1-16 t2-4 t2-4 t1-15)
|
||||
(.movz a2-3 t3-0 t2-4 a2-2)
|
||||
)
|
||||
(let ((t2-5 (shl t1-16 16))
|
||||
(t3-1 (+ a2-3 16))
|
||||
)
|
||||
(.movn t1-17 t2-5 t2-5 t1-16)
|
||||
(.movz a2-4 t3-1 t2-5 a2-3)
|
||||
)
|
||||
(let ((t2-6 (* t1-17 256))
|
||||
(t3-2 (+ a2-4 8))
|
||||
)
|
||||
(.movn t1-18 t2-6 t2-6 t1-17)
|
||||
(.movz a2-5 t3-2 t2-6 a2-4)
|
||||
)
|
||||
(let ((t2-7 (* t1-18 16))
|
||||
(t3-3 (+ a2-5 4))
|
||||
)
|
||||
(.movn t1-19 t2-7 t2-7 t1-18)
|
||||
(.movz a2-6 t3-3 t2-7 a2-5)
|
||||
)
|
||||
(let ((t2-8 (* t1-19 4))
|
||||
(t3-4 (+ a2-6 2))
|
||||
)
|
||||
(.movn t1-20 t2-8 t2-8 t1-19)
|
||||
(.movz a2-7 t3-4 t2-8 a2-6)
|
||||
(let ((t1-21 (* t1-20 2))
|
||||
(t2-9 (+ a2-7 1))
|
||||
)
|
||||
(.movn t3-5 t1-21 t1-21 t3-4)
|
||||
(.movz a2-8 t2-9 t1-21 a2-7)
|
||||
)
|
||||
)
|
||||
(let ((t0-5 (+ t0-4 a2-8)))
|
||||
(set! (-> arg0 alloc-table (+ v1-0 a3-0))
|
||||
(logxor (-> arg0 alloc-table (+ v1-0 a3-0)) (the-as uint (ash 1 a2-8)))
|
||||
)
|
||||
(+! (-> arg0 num-alloc arg1) 1)
|
||||
(let ((v1-9 (-> arg0 cpuinfo-table t0-5)))
|
||||
(set! (-> v1-9 valid) #t)
|
||||
(return v1-9)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! a3-0 1)
|
||||
(if (= a3-0 t0-0)
|
||||
(set! a3-0 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(the-as sparticle-cpuinfo #f)
|
||||
)
|
||||
|
||||
;; definition for function sp-kill-particle
|
||||
;; INFO: Return type mismatch symbol vs none.
|
||||
;; WARN: Expression building failed: Function sp-kill-particle has a return type of none, but the expression builder found a return statement.
|
||||
(defun sp-kill-particle ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
|
||||
(cond
|
||||
((>= (the-as int arg1) #x70000000)
|
||||
(set! (-> arg1 timer) 0)
|
||||
0
|
||||
)
|
||||
(else
|
||||
(let ((a2-1 (/ (the-as int (- (the-as uint arg1) (the-as uint (-> arg0 cpuinfo-table 0)))) 144)))
|
||||
(when (or (< a2-1 0) (>= a2-1 (+ (-> arg0 length 0) (-> arg0 length 1))))
|
||||
(format 0 "Tried to release particle ~D~%" a2-1)
|
||||
(return #f)
|
||||
)
|
||||
(sp-free-particle arg0 a2-1 arg1 (-> arg1 sprite))
|
||||
)
|
||||
)
|
||||
)
|
||||
#t
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function sp-orbiter
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun sp-orbiter ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector))
|
||||
(let* ((f2-0 (-> arg1 omega))
|
||||
(f0-0 (-> arg1 radius))
|
||||
(f4-0 (-> arg1 vel-sxvel x))
|
||||
(f24-0 (-> arg1 vel-sxvel y))
|
||||
(f1-0 (-> arg1 vel-sxvel z))
|
||||
(f3-0 (-> *sp-frame-time* y))
|
||||
(f28-0 (+ f2-0 (* f4-0 f3-0)))
|
||||
)
|
||||
(set! (-> arg1 omega) f28-0)
|
||||
(let ((f30-0 (+ f0-0 (* f1-0 f3-0))))
|
||||
(set! (-> arg1 radius) f30-0)
|
||||
(let ((f26-0 (sin f28-0))
|
||||
(f28-1 (cos f28-0))
|
||||
(f22-0 (sin (* 0.5 f24-0)))
|
||||
(f0-5 (cos (* 0.5 f24-0)))
|
||||
(a1-1 (new 'stack-no-clear 'vector))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((s3-0 (new 'stack-no-clear 'matrix)))
|
||||
(set-vector! a1-1 (* f22-0 f28-1) 0.0 (* f22-0 f26-0) f0-5)
|
||||
(quaternion*! (-> arg1 rotvel3d) (the-as quaternion a1-1) (-> arg1 rotvel3d))
|
||||
(quaternion-normalize! (-> arg1 rotvel3d))
|
||||
(set-vector! s4-0 (* f26-0 f30-0) 0.0 (* f28-1 f30-0) 1.0)
|
||||
(quaternion->matrix s3-0 (-> arg1 rotvel3d))
|
||||
(vector-matrix*! s4-0 s4-0 s3-0)
|
||||
)
|
||||
(let ((v1-3 (the-as object (-> arg1 user-float))))
|
||||
(set! (-> arg2 x) (+ (-> s4-0 x) (-> (the-as sprite-vec-data-2d v1-3) x)))
|
||||
(set! (-> arg2 y) (+ (-> s4-0 y) (-> (the-as sprite-vec-data-2d v1-3) y)))
|
||||
(set! (-> arg2 z) (+ (-> s4-0 z) (-> (the-as sprite-vec-data-2d v1-3) z)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function sp-process-block-2d
|
||||
;; ERROR: function was not converted to expressions. Cannot decompile.
|
||||
|
||||
;; definition for function sp-process-block-3d
|
||||
;; ERROR: function was not converted to expressions. Cannot decompile.
|
||||
|
||||
;; definition for function sp-copy-to-spr
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun sp-copy-to-spr ((arg0 int) (arg1 pointer) (arg2 int))
|
||||
(let ((a2-1 (/ (+ arg2 15) 16)))
|
||||
(dma-send-to-spr-no-flush (the-as uint arg0) (the-as uint arg1) (the-as uint a2-1) #t)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function sp-copy-from-spr
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun sp-copy-from-spr ((arg0 int) (arg1 pointer) (arg2 int))
|
||||
(let ((a2-1 (/ (+ arg2 15) 16)))
|
||||
(dma-send-from-spr-no-flush (the-as uint arg1) (the-as uint arg0) (the-as uint a2-1) #t)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function memcpy
|
||||
;; ERROR: function was not converted to expressions. Cannot decompile.
|
||||
|
||||
;; definition for function sp-process-block
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
;; Used lq/sq
|
||||
(defun sp-process-block ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d) (arg3 int))
|
||||
(local-vars
|
||||
(sv-16 int)
|
||||
(sv-32 int)
|
||||
(sv-48 (function sparticle-system int int int int symbol none))
|
||||
(sv-64 sparticle-system)
|
||||
(sv-80 int)
|
||||
(sv-96 int)
|
||||
(sv-112 int)
|
||||
(sv-128 (function sparticle-system int int int int symbol none))
|
||||
(sv-144 sparticle-system)
|
||||
(sv-160 int)
|
||||
(sv-176 int)
|
||||
(sv-192 int)
|
||||
)
|
||||
(let ((s3-0 16)
|
||||
(s2-0 (* 144 arg3))
|
||||
(s5-0 (* 48 arg3))
|
||||
)
|
||||
(set! sv-32 (* 80 arg3))
|
||||
(let ((s1-0 (+ s3-0 s2-0)))
|
||||
(set! sv-16 (+ s1-0 s5-0))
|
||||
(sp-copy-to-spr s3-0 (the-as pointer (-> arg0 cpuinfo-table arg1)) s2-0)
|
||||
(sp-copy-to-spr s1-0 (&+ (-> arg0 vecdata-table) (* 48 arg1)) s5-0)
|
||||
(let ((t9-2 sp-copy-to-spr)
|
||||
(a1-7 (-> arg0 adgifdata-table arg1))
|
||||
)
|
||||
(t9-2 sv-16 (the-as pointer a1-7) sv-32)
|
||||
)
|
||||
(set! sv-80 (+ #x70000000 s3-0))
|
||||
(set! sv-96 (+ #x70000000 s1-0))
|
||||
(cond
|
||||
((-> arg0 is-3d)
|
||||
(set! sv-48 sp-process-block-3d)
|
||||
(set! sv-64 arg0)
|
||||
(set! sv-112 arg1)
|
||||
(let ((t1-0 (paused?)))
|
||||
(sv-48 sv-64 sv-80 sv-96 sv-112 arg3 t1-0)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! sv-128 sp-process-block-2d)
|
||||
(set! sv-144 arg0)
|
||||
(set! sv-160 sv-80)
|
||||
(set! sv-176 sv-96)
|
||||
(set! sv-192 arg1)
|
||||
(let ((t1-1 (paused?)))
|
||||
(sv-128 sv-144 sv-160 sv-176 sv-192 arg3 t1-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(sp-copy-from-spr s3-0 (the-as pointer (-> arg0 cpuinfo-table arg1)) s2-0)
|
||||
(sp-copy-from-spr s1-0 (&+ (-> arg0 vecdata-table) (* 48 arg1)) s5-0)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function sp-process-particle-system
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun sp-process-particle-system ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d))
|
||||
(let* ((v1-0 16)
|
||||
(s1-0 (/ (- #x4000 v1-0) 272))
|
||||
(s3-0 0)
|
||||
(s4-0 (sp-get-approx-alloc-size arg0 arg1))
|
||||
)
|
||||
(if (= arg1 1)
|
||||
(set! s3-0 (* (-> arg0 blocks 0) 64))
|
||||
)
|
||||
(set! (-> arg2 num-valid arg1) s4-0)
|
||||
(flush-cache 0)
|
||||
(while (>= s4-0 s1-0)
|
||||
(sp-process-block arg0 s3-0 arg2 s1-0)
|
||||
(set! s4-0 (- s4-0 s1-0))
|
||||
(+! s3-0 s1-0)
|
||||
)
|
||||
(if (> s4-0 0)
|
||||
(sp-process-block arg0 s3-0 arg2 s4-0)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition (perm) for symbol *particles-flag*, type symbol
|
||||
(define-perm *particles-flag* symbol #t)
|
||||
|
||||
;; definition for function forall-particles-with-key-runner
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
;; Used lq/sq
|
||||
(defun forall-particles-with-key-runner ((arg0 sparticle-launch-control)
|
||||
(arg1 (function sparticle-system sparticle-cpuinfo none))
|
||||
(arg2 sparticle-system)
|
||||
)
|
||||
(local-vars (sv-16 int))
|
||||
(let ((s3-0 (the-as object (-> arg2 cpuinfo-table 0)))
|
||||
(s2-0 (&+ (-> arg2 vecdata-table) 0))
|
||||
(s1-0 (+ (-> arg2 blocks 0) (-> arg2 blocks 1)))
|
||||
)
|
||||
(dotimes (s0-0 s1-0)
|
||||
(cond
|
||||
((!= (-> arg2 alloc-table s0-0) -1)
|
||||
(set! sv-16 0)
|
||||
(while (< sv-16 64)
|
||||
(if (and (-> (the-as sparticle-cpuinfo s3-0) valid) (= (-> (the-as sparticle-cpuinfo s3-0) key) arg0))
|
||||
(arg1 arg2 (the-as sparticle-cpuinfo s3-0))
|
||||
)
|
||||
(set! s3-0 (-> (the-as (inline-array sparticle-cpuinfo) s3-0) 1))
|
||||
(&+! s2-0 48)
|
||||
(set! sv-16 (+ sv-16 1))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! s3-0 (-> (the-as (inline-array sparticle-cpuinfo) s3-0) 64))
|
||||
(&+! s2-0 3072)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function forall-particles-with-key
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun forall-particles-with-key ((arg0 sparticle-launch-control)
|
||||
(arg1 (function sparticle-system sparticle-cpuinfo none))
|
||||
(arg2 symbol)
|
||||
(arg3 symbol)
|
||||
)
|
||||
(if arg2
|
||||
(forall-particles-with-key-runner arg0 arg1 *sp-particle-system-2d*)
|
||||
)
|
||||
(if arg3
|
||||
(forall-particles-with-key-runner arg0 arg1 *sp-particle-system-3d*)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function sparticle-kill-it
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun sparticle-kill-it ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
|
||||
(set! (-> arg1 timer) 0)
|
||||
(set! (-> arg1 func) (the-as basic 0))
|
||||
(when (and (-> arg1 binding) (nonzero? (-> arg1 binding)))
|
||||
(logclear! (-> arg1 binding flags) (sp-launch-state-flags launcher-active particles-active))
|
||||
(set! (-> arg1 binding) #f)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function sparticle-kill-it-level0
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun sparticle-kill-it-level0 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
|
||||
(if (logtest? (-> arg1 flags) (sp-cpuinfo-flag level0))
|
||||
(sparticle-kill-it arg0 arg1)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function sparticle-kill-it-level1
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun sparticle-kill-it-level1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
|
||||
(if (logtest? (-> arg1 flags) (sp-cpuinfo-flag level1))
|
||||
(sparticle-kill-it arg0 arg1)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function sparticle-60-to-50
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun sparticle-60-to-50 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer))
|
||||
(let ((gp-0 (-> arg1 rotvel3d))
|
||||
(s5-0 (new 'stack-no-clear 'quaternion))
|
||||
)
|
||||
(vector-angle<-quaternion! (the-as vector s5-0) gp-0)
|
||||
(set! (-> s5-0 w) (* 12516.455 (-> s5-0 w)))
|
||||
(quaternion-vector-angle! gp-0 (the-as vector s5-0) (-> s5-0 w))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function sparticle-50-to-60
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun sparticle-50-to-60 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer))
|
||||
(let ((gp-0 (-> arg1 rotvel3d))
|
||||
(s5-0 (new 'stack-no-clear 'quaternion))
|
||||
)
|
||||
(vector-angle<-quaternion! (the-as vector s5-0) gp-0)
|
||||
(set! (-> s5-0 w) (* 8691.982 (-> s5-0 w)))
|
||||
(quaternion-vector-angle! gp-0 (the-as vector s5-0) (-> s5-0 w))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function kill-all-particles-with-key
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun kill-all-particles-with-key ((arg0 sparticle-launch-control))
|
||||
(forall-particles-with-key arg0 sparticle-kill-it #t #t)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function forall-particles-runner
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun forall-particles-runner ((arg0 (function sparticle-system sparticle-cpuinfo pointer none)) (arg1 sparticle-system))
|
||||
(let ((s4-0 (the-as object (-> arg1 cpuinfo-table 0)))
|
||||
(s3-0 (&+ (-> arg1 vecdata-table) 0))
|
||||
(s2-0 (+ (-> arg1 blocks 0) (-> arg1 blocks 1)))
|
||||
)
|
||||
(dotimes (s1-0 s2-0)
|
||||
(cond
|
||||
((!= (-> arg1 alloc-table s1-0) -1)
|
||||
(dotimes (s0-0 64)
|
||||
(if (-> (the-as sparticle-cpuinfo s4-0) valid)
|
||||
(arg0 arg1 (the-as sparticle-cpuinfo s4-0) s3-0)
|
||||
)
|
||||
(set! s4-0 (+ (the-as uint s4-0) 144))
|
||||
(&+! s3-0 48)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! s4-0 (&+ (the-as pointer s4-0) 9216))
|
||||
(&+! s3-0 3072)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function forall-particles
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun forall-particles ((arg0 function) (arg1 symbol) (arg2 symbol))
|
||||
(if arg1
|
||||
(forall-particles-runner
|
||||
(the-as (function sparticle-system sparticle-cpuinfo pointer none) arg0)
|
||||
*sp-particle-system-2d*
|
||||
)
|
||||
)
|
||||
(if arg2
|
||||
(forall-particles-runner
|
||||
(the-as (function sparticle-system sparticle-cpuinfo pointer none) arg0)
|
||||
*sp-particle-system-3d*
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function kill-all-particles-in-level
|
||||
(defun kill-all-particles-in-level ((arg0 level))
|
||||
(forall-particles
|
||||
(if (zero? (-> arg0 index))
|
||||
sparticle-kill-it-level0
|
||||
sparticle-kill-it-level1
|
||||
)
|
||||
#t
|
||||
#t
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
;; definition for function all-particles-50-to-60
|
||||
(defun all-particles-50-to-60 ()
|
||||
(forall-particles-runner sparticle-50-to-60 *sp-particle-system-3d*)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function all-particles-60-to-50
|
||||
(defun all-particles-60-to-50 ()
|
||||
(forall-particles-runner sparticle-60-to-50 *sp-particle-system-3d*)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function set-particle-frame-time
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun set-particle-frame-time ((arg0 int))
|
||||
(cond
|
||||
((= arg0 5)
|
||||
(set-vector! *sp-frame-time* 0.00000000000000000000000000000000000001175495 5.0 1.0 1.0)
|
||||
)
|
||||
((= arg0 6)
|
||||
(set-vector! *sp-frame-time* 0.000000000000000000000000000000000000011754952 6.0 1.2 1.2)
|
||||
)
|
||||
((= arg0 10)
|
||||
(set-vector! *sp-frame-time* 0.000000000000000000000000000000000000011754958 10.0 2.0 2.0)
|
||||
)
|
||||
((= arg0 12)
|
||||
(set-vector! *sp-frame-time* 0.00000000000000000000000000000000000001175496 12.0 2.4 2.4)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function process-particles
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
;; WARN: Unsupported inline assembly instruction kind - [mfc0 gp, Count]
|
||||
;; WARN: Unsupported inline assembly instruction kind - [mfc0 v1, Count]
|
||||
(defun process-particles ()
|
||||
(local-vars (v1-29 int) (gp-0 int))
|
||||
(when *particles-flag*
|
||||
0
|
||||
0
|
||||
(.mfc0 gp-0 Count)
|
||||
(set! *sp-launcher-lock* #t)
|
||||
(if *debug-segment*
|
||||
(add-frame
|
||||
(-> *display* frames (-> *display* on-screen) frame profile-bar 0)
|
||||
'draw
|
||||
(new 'static 'rgba :r #x40 :b #x40 :a #x80)
|
||||
)
|
||||
)
|
||||
(let ((v1-14 (logand (the-as int (-> *sp-frame-time* x)) 255)))
|
||||
(set! *particle-300hz-timer* (+ *particle-300hz-timer* v1-14))
|
||||
(cond
|
||||
(*sp-60-hz*
|
||||
(when (or (= v1-14 6) (= v1-14 12))
|
||||
(set! *sp-60-hz* #f)
|
||||
(all-particles-60-to-50)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(when (or (= v1-14 5) (= v1-14 10))
|
||||
(set! *sp-60-hz* #t)
|
||||
(all-particles-50-to-60)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(clear-sprite-aux-list)
|
||||
(sp-process-particle-system *sp-particle-system-2d* 0 *sprite-array-2d*)
|
||||
(sp-process-particle-system *sp-particle-system-2d* 1 *sprite-array-2d*)
|
||||
(sp-process-particle-system *sp-particle-system-3d* 0 (the-as sprite-array-2d *sprite-array-3d*))
|
||||
(if *debug-segment*
|
||||
(add-frame
|
||||
(-> *display* frames (-> *display* on-screen) frame profile-bar 0)
|
||||
'draw
|
||||
(new 'static 'rgba :r #x80 :g #x80 :b #xff :a #x80)
|
||||
)
|
||||
)
|
||||
(set! *sp-launcher-lock* #f)
|
||||
(sp-clear-queue)
|
||||
(.mfc0 v1-29 Count)
|
||||
(let ((a2-5 (- v1-29 gp-0)))
|
||||
(if *display-sprite-info*
|
||||
(format
|
||||
*stdcon*
|
||||
"Particle time = ~D cycles for ~D 2D [~D warp] and ~D HUD and ~D 3D~%"
|
||||
a2-5
|
||||
(-> *sp-particle-system-2d* num-alloc 0)
|
||||
(-> *sprite-aux-list* entry)
|
||||
(-> *sp-particle-system-2d* num-alloc 1)
|
||||
(-> *sp-particle-system-3d* num-alloc 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
1125
test/decompiler/reference/engine/target/target-handler_REF.gc
generated
vendored
Normal file
1125
test/decompiler/reference/engine/target/target-handler_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2750
test/decompiler/reference/engine/ui/progress/progress_REF.gc
generated
vendored
Normal file
2750
test/decompiler/reference/engine/ui/progress/progress_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
125
test/decompiler/reference/engine/util/glist-h_REF.gc
generated
vendored
Normal file
125
test/decompiler/reference/engine/util/glist-h_REF.gc
generated
vendored
Normal file
@ -0,0 +1,125 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; this file is debug only
|
||||
(declare-file (debug))
|
||||
(when *debug-segment*
|
||||
;; definition of type glst-node
|
||||
(deftype glst-node (structure)
|
||||
((next glst-node :offset-assert 0)
|
||||
(prev glst-node :offset-assert 4)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x8
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
;; definition for method 3 of type glst-node
|
||||
(defmethod inspect glst-node ((obj glst-node))
|
||||
(format #t "[~8x] ~A~%" obj 'glst-node)
|
||||
(format #t "~Tnext: #<glst-node @ #x~X>~%" (-> obj next))
|
||||
(format #t "~Tprev: #<glst-node @ #x~X>~%" (-> obj prev))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type glst-named-node
|
||||
(deftype glst-named-node (glst-node)
|
||||
((privname string :offset-assert 8)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xc
|
||||
:flag-assert #x90000000c
|
||||
)
|
||||
|
||||
;; definition for method 3 of type glst-named-node
|
||||
(defmethod inspect glst-named-node ((obj glst-named-node))
|
||||
(format #t "[~8x] ~A~%" obj 'glst-named-node)
|
||||
(format #t "~Tnext: #<glst-node @ #x~X>~%" (-> obj next))
|
||||
(format #t "~Tprev: #<glst-node @ #x~X>~%" (-> obj prev))
|
||||
(format #t "~Tprivname: ~A~%" (-> obj privname))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type glst-list
|
||||
(deftype glst-list (structure)
|
||||
((head glst-node :offset-assert 0)
|
||||
(tail glst-node :offset-assert 4)
|
||||
(tailpred glst-node :offset-assert 8)
|
||||
(numelem int32 :offset-assert 12)
|
||||
)
|
||||
:allow-misaligned
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;; definition for method 3 of type glst-list
|
||||
(defmethod inspect glst-list ((obj glst-list))
|
||||
(format #t "[~8x] ~A~%" obj 'glst-list)
|
||||
(format #t "~Thead: #<glst-node @ #x~X>~%" (-> obj head))
|
||||
(format #t "~Ttail: #<glst-node @ #x~X>~%" (-> obj tail))
|
||||
(format #t "~Ttailpred: #<glst-node @ #x~X>~%" (-> obj tailpred))
|
||||
(format #t "~Tnumelem: ~D~%" (-> obj numelem))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for function glst-next
|
||||
(defun glst-next ((arg0 glst-node))
|
||||
"return the next node in the list"
|
||||
(-> arg0 next)
|
||||
)
|
||||
|
||||
;; definition for function glst-prev
|
||||
(defun glst-prev ((arg0 glst-node))
|
||||
"return the previous node in the list"
|
||||
(-> arg0 prev)
|
||||
)
|
||||
|
||||
;; definition for function glst-head
|
||||
(defun glst-head ((arg0 glst-list))
|
||||
"return the start of the list"
|
||||
(-> arg0 head)
|
||||
)
|
||||
|
||||
;; definition for function glst-tail
|
||||
(defun glst-tail ((arg0 glst-list))
|
||||
"return the tail of the list"
|
||||
(-> arg0 tailpred)
|
||||
)
|
||||
|
||||
;; definition for function glst-end-of-list?
|
||||
(defun glst-end-of-list? ((arg0 glst-node))
|
||||
"is this node the end of the list. #t = end"
|
||||
(not (-> arg0 next))
|
||||
)
|
||||
|
||||
;; definition for function glst-start-of-list?
|
||||
(defun glst-start-of-list? ((arg0 glst-node))
|
||||
"is this node the start of the list. #t = start"
|
||||
(not (-> arg0 prev))
|
||||
)
|
||||
|
||||
;; definition for function glst-empty?
|
||||
(defun glst-empty? ((arg0 glst-list))
|
||||
"is the list empty, #t = empty"
|
||||
(= (-> arg0 tailpred) arg0)
|
||||
)
|
||||
|
||||
;; definition for function glst-node-name
|
||||
(defun glst-node-name ((arg0 glst-named-node))
|
||||
(-> arg0 privname)
|
||||
)
|
||||
|
||||
;; definition for function glst-set-name!
|
||||
(defun glst-set-name! ((arg0 glst-named-node) (arg1 string))
|
||||
(set! (-> arg0 privname) arg1)
|
||||
arg1
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
1
test/decompiler/reference/kernel/gkernel_REF.gc
generated
vendored
1
test/decompiler/reference/kernel/gkernel_REF.gc
generated
vendored
@ -365,6 +365,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 2 of type process
|
||||
;; INFO: this function exists in multiple non-identical object files
|
||||
(defmethod print process ((obj process))
|
||||
(format #t "#<~A ~S ~A :state ~S " (-> obj type) (-> obj name) (-> obj status) (if (-> obj state)
|
||||
(-> obj state name)
|
||||
|
193
test/decompiler/reference/levels/demo/static-screen_REF.gc
generated
vendored
Normal file
193
test/decompiler/reference/levels/demo/static-screen_REF.gc
generated
vendored
Normal file
@ -0,0 +1,193 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type static-screen
|
||||
(deftype static-screen (process)
|
||||
((part sparticle-launch-control 1 :offset-assert 112)
|
||||
(state-time uint64 :offset-assert 120)
|
||||
)
|
||||
:heap-base #x10
|
||||
:method-count-assert 15
|
||||
:size-assert #x80
|
||||
:flag-assert #xf00100080
|
||||
(:methods
|
||||
(idle (int int symbol) _type_ :state 14)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type static-screen
|
||||
(defmethod inspect static-screen ((obj static-screen))
|
||||
(let ((t9-0 (method-of-type process inspect)))
|
||||
(t9-0 obj)
|
||||
)
|
||||
(format #t "~T~Tpart[1] @ #x~X~%" (-> obj stack))
|
||||
(format #t "~T~Tstate-time: ~D~%" (-> obj state-time))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 7 of type static-screen
|
||||
;; INFO: Return type mismatch process vs static-screen.
|
||||
(defmethod relocate static-screen ((obj static-screen) (arg0 int))
|
||||
(let ((v1-0 *kernel-context*))
|
||||
(set! (-> v1-0 relocating-process) obj)
|
||||
(set! (-> v1-0 relocating-min) (the-as int (&-> obj type)))
|
||||
(set! (-> v1-0 relocating-max)
|
||||
(the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj)))
|
||||
)
|
||||
(set! (-> v1-0 relocating-offset) arg0)
|
||||
)
|
||||
(dotimes (v1-2 1)
|
||||
(if (nonzero? (-> obj part v1-2))
|
||||
(&+! (-> obj part v1-2) arg0)
|
||||
)
|
||||
)
|
||||
(the-as static-screen ((method-of-type process relocate) obj arg0))
|
||||
)
|
||||
|
||||
;; definition for method 10 of type static-screen
|
||||
(defmethod deactivate static-screen ((obj static-screen))
|
||||
(dotimes (s5-0 1)
|
||||
(if (nonzero? (-> obj part s5-0))
|
||||
(kill-and-free-particles (-> obj part s5-0))
|
||||
)
|
||||
)
|
||||
((method-of-type process deactivate) obj)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defpart 2966
|
||||
:init-specs
|
||||
((sp-tex spt-texture (new 'static 'texture-id :page #x5c6))
|
||||
(sp-flt spt-num 1.0)
|
||||
(sp-flt spt-y (meters 1.18))
|
||||
(sp-flt spt-scale-x (meters 15))
|
||||
(sp-flt spt-scale-y (meters 6.5))
|
||||
(sp-flt spt-r 128.0)
|
||||
(sp-flt spt-g 128.0)
|
||||
(sp-flt spt-b 128.0)
|
||||
(sp-flt spt-a 128.0)
|
||||
(sp-int spt-timer -1)
|
||||
(sp-cpuinfo-flags bit2 bit9 bit13)
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defpart 2967
|
||||
:init-specs
|
||||
((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #x5c6))
|
||||
(sp-flt spt-num 1.0)
|
||||
(sp-flt spt-y (meters -1.264))
|
||||
(sp-flt spt-scale-x (meters 15))
|
||||
(sp-flt spt-scale-y (meters 3.25))
|
||||
(sp-flt spt-r 128.0)
|
||||
(sp-flt spt-g 128.0)
|
||||
(sp-flt spt-b 128.0)
|
||||
(sp-flt spt-a 128.0)
|
||||
(sp-int spt-timer -1)
|
||||
(sp-cpuinfo-flags bit2 bit9 bit13)
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defpart 2968
|
||||
:init-specs
|
||||
((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #x5c6))
|
||||
(sp-flt spt-num 1.0)
|
||||
(sp-flt spt-y (meters -2.482))
|
||||
(sp-flt spt-scale-x (meters 15))
|
||||
(sp-flt spt-scale-y (meters 1.625))
|
||||
(sp-flt spt-r 128.0)
|
||||
(sp-flt spt-g 128.0)
|
||||
(sp-flt spt-b 128.0)
|
||||
(sp-flt spt-a 128.0)
|
||||
(sp-int spt-timer -1)
|
||||
(sp-cpuinfo-flags bit2 bit9 bit13)
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defpartgroup group-part-screen1
|
||||
:id 707
|
||||
:flags (screen-space)
|
||||
:bounds (static-bspherem 0 0 0 1)
|
||||
:parts
|
||||
((sp-item 2966 :flags (launch-asap)) (sp-item 2967 :flags (launch-asap)) (sp-item 2968 :flags (launch-asap)))
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate idle (static-screen)
|
||||
:virtual #t
|
||||
:enter
|
||||
(behavior ((arg0 int) (arg1 int) (arg2 symbol))
|
||||
(set! (-> *setting-control* current bg-a) 1.0)
|
||||
(set! (-> *setting-control* default bg-a) 0.0)
|
||||
(push-setting! *setting-control* self 'common-page 'set 0.0 (ash 1 (+ arg0 1)))
|
||||
(none)
|
||||
)
|
||||
:trans
|
||||
(behavior ()
|
||||
(hide-hud-quick)
|
||||
(spawn (-> self part 0) *zero-vector*)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
:code
|
||||
(behavior ((arg0 int) (arg1 int) (arg2 symbol))
|
||||
(local-vars (v1-6 symbol))
|
||||
(set! (-> self state-time) (the-as uint (-> *display* base-frame-counter)))
|
||||
(until v1-6
|
||||
(suspend)
|
||||
(set! v1-6
|
||||
(or (and (> arg1 0) (>= (- (-> *display* base-frame-counter) (the-as int (-> self state-time))) arg1))
|
||||
(and arg2
|
||||
(>= (- (-> *display* base-frame-counter) (the-as int (-> self state-time))) 300)
|
||||
(cpad-pressed? 0 select start triangle circle x square)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> *setting-control* default bg-a) 1.0)
|
||||
(while (!= (-> *setting-control* current bg-a) (-> *setting-control* default bg-a))
|
||||
(suspend)
|
||||
)
|
||||
(clear-pending-settings-from-process *setting-control* self 'common-page)
|
||||
(suspend)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function static-screen-init-by-other
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defbehavior static-screen-init-by-other static-screen ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 symbol))
|
||||
(let ((s3-0 (lookup-part-group-by-name "group-part-screen1")))
|
||||
(when (and s3-0 (nonzero? s3-0) (type-type? (-> s3-0 type) sparticle-launch-group))
|
||||
(set! (-> *part-id-table* 2966 init-specs 0 initial-valuef) (the-as float arg1))
|
||||
(set! (-> *part-id-table* 2967 init-specs 0 initial-valuef) (the-as float arg2))
|
||||
(set! (-> *part-id-table* 2968 init-specs 0 initial-valuef) (the-as float arg3))
|
||||
(set! (-> self part 0) (create-launch-control (the-as sparticle-launch-group s3-0) self))
|
||||
(go-virtual idle arg0 arg4 arg5)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function static-screen-spawn
|
||||
;; Used lq/sq
|
||||
(defun static-screen-spawn ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 symbol) (arg6 target))
|
||||
(local-vars (sv-16 process))
|
||||
(set! sv-16 (get-process *default-dead-pool* static-screen #x4000))
|
||||
(when sv-16
|
||||
(let ((t9-1 (method-of-type static-screen activate)))
|
||||
(t9-1 (the-as static-screen sv-16) arg6 'static-screen (the-as pointer #x70004000))
|
||||
)
|
||||
(run-now-in-process sv-16 static-screen-init-by-other arg0 arg1 arg2 arg3 arg4 arg5)
|
||||
(-> sv-16 ppointer)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
532
test/decompiler/reference/levels/misty/babak-with-cannon_REF.gc
generated
vendored
Normal file
532
test/decompiler/reference/levels/misty/babak-with-cannon_REF.gc
generated
vendored
Normal file
@ -0,0 +1,532 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type babak-with-cannon
|
||||
(deftype babak-with-cannon (babak)
|
||||
((cannon-ent entity :offset-assert 400)
|
||||
(distance float :offset-assert 404)
|
||||
)
|
||||
:heap-base #x130
|
||||
:method-count-assert 76
|
||||
:size-assert #x198
|
||||
:flag-assert #x4c01300198
|
||||
(:states
|
||||
babak-with-cannon-jump-off-cannon
|
||||
babak-with-cannon-jump-onto-cannon
|
||||
babak-with-cannon-shooting
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type babak-with-cannon
|
||||
(defmethod inspect babak-with-cannon ((obj babak-with-cannon))
|
||||
(let ((t9-0 (method-of-type babak inspect)))
|
||||
(t9-0 obj)
|
||||
)
|
||||
(format #t "~T~Tcannon-ent: ~A~%" (-> obj cannon-ent))
|
||||
(format #t "~T~Tdistance: ~f~%" (-> obj distance))
|
||||
obj
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
nav-enemy-default-event-handler
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate nav-enemy-idle (babak-with-cannon)
|
||||
:virtual #t
|
||||
:event
|
||||
(the-as
|
||||
(function process int symbol event-message-block object :behavior babak-with-cannon)
|
||||
nav-enemy-default-event-handler
|
||||
)
|
||||
:trans
|
||||
(behavior ()
|
||||
(if (and (and *target* (>= (-> self enemy-info idle-distance)
|
||||
(vector-vector-distance (-> self collide-info trans) (-> *target* control trans))
|
||||
)
|
||||
)
|
||||
(>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout))
|
||||
)
|
||||
(go-virtual nav-enemy-patrol)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(ja-channel-push! 1 22)
|
||||
(let ((a0-1 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-1 frame-group)
|
||||
(the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim)))
|
||||
)
|
||||
(set! (-> a0-1 param 0)
|
||||
(the float
|
||||
(+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) data 0 length) -1)
|
||||
)
|
||||
)
|
||||
(set! (-> a0-1 param 1) 1.0)
|
||||
(set! (-> a0-1 frame-num) 0.0)
|
||||
(joint-control-channel-group!
|
||||
a0-1
|
||||
(the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim)))
|
||||
num-func-seek!
|
||||
)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(ja-post)
|
||||
(suspend)
|
||||
(let ((a0-2 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-2 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
)
|
||||
(anim-loop)
|
||||
(none)
|
||||
)
|
||||
:post
|
||||
(the-as (function none :behavior babak-with-cannon) #f)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate nav-enemy-patrol (babak-with-cannon)
|
||||
:virtual #t
|
||||
:event
|
||||
(the-as
|
||||
(function process int symbol event-message-block object :behavior babak-with-cannon)
|
||||
nav-enemy-default-event-handler
|
||||
)
|
||||
:trans
|
||||
(behavior ()
|
||||
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30)
|
||||
(let ((f30-0 (- (-> (target-pos 0) y) (-> self collide-info trans y))))
|
||||
(if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900)
|
||||
(or (or (not *target*)
|
||||
(< (-> self distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))
|
||||
)
|
||||
(< f30-0 -40960.0)
|
||||
)
|
||||
)
|
||||
(go babak-run-to-cannon)
|
||||
)
|
||||
)
|
||||
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout))
|
||||
(if (or (not *target*) (< (-> self enemy-info idle-distance)
|
||||
(vector-vector-distance (-> self collide-info trans) (-> *target* control trans))
|
||||
)
|
||||
)
|
||||
(go-virtual nav-enemy-idle)
|
||||
)
|
||||
)
|
||||
(if (nav-enemy-notice-player?)
|
||||
(go-virtual nav-enemy-notice)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:code
|
||||
(-> (method-of-type babak nav-enemy-patrol) code)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate babak-run-to-cannon (babak)
|
||||
:event
|
||||
(the-as
|
||||
(function process int symbol event-message-block object :behavior babak)
|
||||
nav-enemy-default-event-handler
|
||||
)
|
||||
:enter
|
||||
(behavior ()
|
||||
(set! (-> self state-time) (-> *display* base-frame-counter))
|
||||
(set! (-> self nav destination-pos quad) (-> self entity extra trans quad))
|
||||
(set! (-> self nav target-pos quad) (-> self entity extra trans quad))
|
||||
(none)
|
||||
)
|
||||
:trans
|
||||
(behavior ()
|
||||
(if (nav-enemy-notice-player?)
|
||||
(go-virtual nav-enemy-chase)
|
||||
)
|
||||
(if (logtest? (nav-control-flags bit19) (-> self nav flags))
|
||||
(go babak-with-cannon-jump-onto-cannon)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(ja-channel-push! 1 22)
|
||||
(while #t
|
||||
(let ((a0-1 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 8)))
|
||||
(set! (-> a0-1 param 0)
|
||||
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1))
|
||||
)
|
||||
(set! (-> a0-1 param 1) 1.0)
|
||||
(set! (-> a0-1 frame-num) 0.0)
|
||||
(joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(let ((a0-2 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-2 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:post
|
||||
(behavior ()
|
||||
(nav-enemy-travel-post)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function handle->process-safe
|
||||
(defun handle->process-safe ((arg0 handle))
|
||||
(let ((v0-0 (the-as process #f)))
|
||||
(if (handle->process arg0)
|
||||
(set! v0-0 (-> arg0 process 0))
|
||||
)
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function babak-with-cannon-compute-cannon-dir
|
||||
;; Used lq/sq
|
||||
(defun babak-with-cannon-compute-cannon-dir ((arg0 mistycannon) (arg1 vector))
|
||||
(set! (-> arg1 quad) (-> arg0 node-list data 3 bone transform vector 2 quad))
|
||||
arg1
|
||||
)
|
||||
|
||||
;; definition for function babak-with-cannon-compute-ride-point
|
||||
;; Used lq/sq
|
||||
(defun babak-with-cannon-compute-ride-point ((arg0 mistycannon) (arg1 vector))
|
||||
(set! (-> arg1 quad) (-> arg0 root-override trans quad))
|
||||
(let ((a1-4 (new 'static 'vector :y 18149.377 :z -17289.217 :w 1.0))
|
||||
(a2-0 (-> arg0 node-list data 3 bone transform))
|
||||
)
|
||||
(vector-matrix*! arg1 a1-4 a2-0)
|
||||
)
|
||||
arg1
|
||||
)
|
||||
|
||||
;; definition for function babak-with-cannon-ride-cannon-post
|
||||
(defbehavior babak-with-cannon-ride-cannon-post babak-with-cannon ()
|
||||
(let* ((v1-0 (-> self cannon-ent))
|
||||
(s5-0 (if v1-0
|
||||
(-> v1-0 extra process)
|
||||
)
|
||||
)
|
||||
(gp-0 (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable))
|
||||
s5-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(when gp-0
|
||||
(let ((s5-1 (new 'stack-no-clear 'vector)))
|
||||
(babak-with-cannon-compute-cannon-dir (the-as mistycannon gp-0) s5-1)
|
||||
(forward-up->quaternion (-> self collide-info quat) s5-1 *y-vector*)
|
||||
)
|
||||
(babak-with-cannon-compute-ride-point (the-as mistycannon gp-0) (-> self collide-info trans))
|
||||
)
|
||||
)
|
||||
(nav-enemy-simple-post)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate babak-with-cannon-jump-onto-cannon (babak-with-cannon)
|
||||
:event
|
||||
(the-as
|
||||
(function process int symbol event-message-block object :behavior babak-with-cannon)
|
||||
nav-enemy-jump-event-handler
|
||||
)
|
||||
:exit
|
||||
(behavior ()
|
||||
(logior! (-> self nav-enemy-flags) 24)
|
||||
(none)
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(set! (-> self state-time) (-> *display* base-frame-counter))
|
||||
(set! (-> self rotate-speed) (-> self nav-info run-rotate-speed))
|
||||
(set! (-> self turn-time) (the-as int (-> self nav-info run-turn-time)))
|
||||
(set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags)))
|
||||
(nav-enemy-neck-control-inactive)
|
||||
(let* ((v1-7 (-> self cannon-ent))
|
||||
(gp-0 (if v1-7
|
||||
(-> v1-7 extra process)
|
||||
)
|
||||
)
|
||||
(a0-2 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable))
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
(a0-2
|
||||
(babak-with-cannon-compute-ride-point (the-as mistycannon a0-2) (-> self event-param-point))
|
||||
(nav-enemy-initialize-jump (-> self event-param-point))
|
||||
)
|
||||
(else
|
||||
(go-virtual nav-enemy-idle)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335))
|
||||
(ja-channel-push! 1 60)
|
||||
(nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445)
|
||||
)
|
||||
(logior! (-> self nav-enemy-flags) 16)
|
||||
(nav-enemy-execute-jump)
|
||||
(set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags)))
|
||||
(let* ((v1-20 (-> self cannon-ent))
|
||||
(gp-1 (if v1-20
|
||||
(-> v1-20 extra process)
|
||||
)
|
||||
)
|
||||
(a0-9 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) process-drawable))
|
||||
gp-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(when a0-9
|
||||
(let ((gp-2 (babak-with-cannon-compute-cannon-dir (the-as mistycannon a0-9) (new 'stack-no-clear 'vector))))
|
||||
(when (not (nav-enemy-facing-direction? gp-2 1820.4445))
|
||||
(ja-channel-push! 1 60)
|
||||
(nav-enemy-turn-to-face-dir gp-2 182.04445)
|
||||
(forward-up->quaternion (-> self collide-info quat) gp-2 *y-vector*)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(ja-channel-push! 1 30)
|
||||
(let ((a0-15 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-15 frame-group) (the-as art-joint-anim (-> self draw art-group data 17)))
|
||||
(set! (-> a0-15 param 0)
|
||||
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1))
|
||||
)
|
||||
(set! (-> a0-15 param 1) 1.0)
|
||||
(set! (-> a0-15 frame-num) 0.0)
|
||||
(joint-control-channel-group! a0-15 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(let ((a0-16 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-16 param 0) (the float (+ (-> a0-16 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-16 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
)
|
||||
(go babak-with-cannon-shooting)
|
||||
(none)
|
||||
)
|
||||
:post
|
||||
(the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate babak-with-cannon-jump-off-cannon (babak-with-cannon)
|
||||
:event
|
||||
(the-as
|
||||
(function process int symbol event-message-block object :behavior babak-with-cannon)
|
||||
nav-enemy-jump-event-handler
|
||||
)
|
||||
:exit
|
||||
(behavior ()
|
||||
(logior! (-> self nav-enemy-flags) 24)
|
||||
(none)
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(set! (-> self state-time) (-> *display* base-frame-counter))
|
||||
(nav-enemy-initialize-jump (-> self entity extra trans))
|
||||
(nav-enemy-neck-control-look-at)
|
||||
(set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags)))
|
||||
(let ((a0-2 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 17)))
|
||||
(set! (-> a0-2 param 0) 0.0)
|
||||
(set! (-> a0-2 param 1) 2.0)
|
||||
(set! (-> a0-2 frame-num)
|
||||
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 17)) data 0 length) -1))
|
||||
)
|
||||
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-seek!)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(let ((a0-3 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-3 param 0) 0.0)
|
||||
(set! (-> a0-3 param 1) 2.0)
|
||||
(joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
)
|
||||
(when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335))
|
||||
(ja-channel-push! 1 60)
|
||||
(nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445)
|
||||
)
|
||||
(logior! (-> self nav-enemy-flags) 16)
|
||||
(nav-enemy-execute-jump)
|
||||
(let ((a1-6 (dummy-16 (-> self nav) (-> self jump-dest))))
|
||||
(set-current-poly! (-> self nav) a1-6)
|
||||
)
|
||||
(go-virtual nav-enemy-jump-land)
|
||||
(none)
|
||||
)
|
||||
:post
|
||||
(the-as (function none :behavior babak-with-cannon) nav-enemy-jump-post)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate babak-with-cannon-shooting (babak-with-cannon)
|
||||
:event
|
||||
(the-as
|
||||
(function process int symbol event-message-block object :behavior babak-with-cannon)
|
||||
nav-enemy-default-event-handler
|
||||
)
|
||||
:enter
|
||||
(behavior ()
|
||||
(set! (-> self state-time) (-> *display* base-frame-counter))
|
||||
(let ((v1-2 (entity-actor-lookup (-> self entity) 'alt-actor 0)))
|
||||
(if v1-2
|
||||
(logior! (-> v1-2 extra perm status) (entity-perm-status complete))
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:exit
|
||||
(behavior ()
|
||||
(let ((v1-0 (entity-actor-lookup (-> self entity) 'alt-actor 0)))
|
||||
(if v1-0
|
||||
(logclear! (-> v1-0 extra perm status) (entity-perm-status complete))
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:trans
|
||||
(behavior ()
|
||||
(let ((f0-1 (- (-> (target-pos 0) y) (-> self collide-info trans y))))
|
||||
(if (and (< -40960.0 f0-1)
|
||||
(and (and *target*
|
||||
(>= (-> self distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))
|
||||
)
|
||||
(>= (- (-> *display* base-frame-counter) (-> self state-time)) 900)
|
||||
)
|
||||
)
|
||||
(go babak-with-cannon-jump-off-cannon)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(suspend)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:post
|
||||
babak-with-cannon-ride-cannon-post
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate nav-enemy-die (babak-with-cannon)
|
||||
:virtual #t
|
||||
:event
|
||||
(the-as
|
||||
(function process int symbol event-message-block object :behavior babak-with-cannon)
|
||||
nav-enemy-default-event-handler
|
||||
)
|
||||
:trans
|
||||
(behavior ()
|
||||
(if (and *target* (= (-> *target* current-level name) 'beach))
|
||||
(spool-push *art-control* "beachcam-cannon" 0 self -1.0)
|
||||
)
|
||||
(if (and *target* (= (-> *target* current-level name) 'misty))
|
||||
(spool-push *art-control* "mistycam-cannon" 0 self -1.0)
|
||||
)
|
||||
(let ((t9-3 (-> (the-as (state nav-enemy) (find-parent-method babak-with-cannon 23)) trans)))
|
||||
(if t9-3
|
||||
(t9-3)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate nav-enemy-fuel-cell (babak-with-cannon)
|
||||
:virtual #t
|
||||
:event
|
||||
(the-as
|
||||
(function process int symbol event-message-block object :behavior babak-with-cannon)
|
||||
process-drawable-fuel-cell-handler
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(ja-channel-set! 0)
|
||||
(clear-collide-with-as (-> self collide-info))
|
||||
(ja-post)
|
||||
(when (not (task-complete? *game-info* (-> self entity extra perm task)))
|
||||
(when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))))
|
||||
(process-entity-status! self (entity-perm-status complete) #t)
|
||||
(if (and *target* (= (-> *target* current-level name) 'beach))
|
||||
(beachcam-spawn)
|
||||
)
|
||||
(if (and *target* (= (-> *target* current-level name) 'misty))
|
||||
(mistycam-spawn)
|
||||
)
|
||||
)
|
||||
(if (not (-> self child))
|
||||
(birth-pickup-at-point
|
||||
(-> self collide-info trans)
|
||||
(pickup-type fuel-cell)
|
||||
(the float (-> self entity extra perm task))
|
||||
#f
|
||||
self
|
||||
(the-as fact-info #f)
|
||||
)
|
||||
)
|
||||
(while (-> self child)
|
||||
(suspend)
|
||||
)
|
||||
)
|
||||
(dummy-18 self)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 39 of type babak-with-cannon
|
||||
(defmethod common-post babak-with-cannon ((obj babak-with-cannon))
|
||||
(cond
|
||||
((= (level-status *level* 'beach) 'active)
|
||||
(spool-push *art-control* "beachcam-cannon" 0 obj -99.0)
|
||||
)
|
||||
((= (level-status *level* 'misty) 'active)
|
||||
(spool-push *art-control* "mistycam-cannon" 0 obj -99.0)
|
||||
)
|
||||
)
|
||||
((method-of-type nav-enemy common-post) obj)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 11 of type babak-with-cannon
|
||||
;; INFO: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! babak-with-cannon ((obj babak-with-cannon) (arg0 entity-actor))
|
||||
(initialize-collision obj)
|
||||
(process-drawable-from-entity! obj arg0)
|
||||
(TODO-RENAME-48 obj)
|
||||
(set! (-> obj distance) (res-lump-float arg0 'distance :default 163840.0))
|
||||
(set! (-> obj cannon-ent) (entity-actor-lookup (-> obj entity) 'alt-actor 0))
|
||||
(logclear! (-> obj mask) (process-mask actor-pause))
|
||||
(if (or (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))))
|
||||
(zero? (logand (-> obj enemy-info options) (fact-options fop1)))
|
||||
)
|
||||
(go (method-of-object obj nav-enemy-idle))
|
||||
)
|
||||
(go (method-of-object obj nav-enemy-fuel-cell))
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
2133
test/decompiler/reference/levels/misty/mistycannon_REF.gc
generated
vendored
Normal file
2133
test/decompiler/reference/levels/misty/mistycannon_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
50
test/decompiler/reference/levels/ogre/ogreboss_REF.gc
generated
vendored
50
test/decompiler/reference/levels/ogre/ogreboss_REF.gc
generated
vendored
@ -100,15 +100,15 @@
|
||||
|
||||
;; definition of type ogreboss-missile
|
||||
(deftype ogreboss-missile (process-drawable)
|
||||
((parent-override (pointer ogreboss) :offset 12)
|
||||
(root-override collide-shape-moving :offset 112)
|
||||
(trajectory trajectory :inline :offset-assert 176)
|
||||
(src-pos vector :inline :offset-assert 224)
|
||||
(dest-pos vector :inline :offset-assert 240)
|
||||
(start-time int64 :offset-assert 256)
|
||||
(tumble-quat quaternion :inline :offset-assert 272)
|
||||
(blast-radius float :offset-assert 288)
|
||||
(pickup-type pickup-type :offset-assert 292)
|
||||
((parent-override (pointer process-drawable) :offset 12)
|
||||
(root-override collide-shape-moving :offset 112)
|
||||
(trajectory trajectory :inline :offset-assert 176)
|
||||
(src-pos vector :inline :offset-assert 224)
|
||||
(dest-pos vector :inline :offset-assert 240)
|
||||
(start-time int64 :offset-assert 256)
|
||||
(tumble-quat quaternion :inline :offset-assert 272)
|
||||
(blast-radius float :offset-assert 288)
|
||||
(pickup-type pickup-type :offset-assert 292)
|
||||
)
|
||||
:heap-base #xc0
|
||||
:method-count-assert 20
|
||||
@ -467,7 +467,7 @@
|
||||
(set! (-> self root-override trans quad) (-> arg0 src quad))
|
||||
(set! (-> self src-pos quad) (-> arg0 src quad))
|
||||
(set! (-> self dest-pos quad) (-> arg0 dest quad))
|
||||
(set! (-> self root-override quat vec quad) (-> self parent-override 0 root-override quat vec quad))
|
||||
(set! (-> self root-override quat vec quad) (-> self parent-override 0 root quat vec quad))
|
||||
(vector-identity! (-> self root-override scale))
|
||||
(initialize-skeleton self *ogreboss-shoot-boulder-sg* '())
|
||||
(set! (-> self mask) (logior (process-mask enemy projectile) (-> self mask)))
|
||||
@ -515,19 +515,19 @@
|
||||
|
||||
;; definition of type ogreboss-super-boulder
|
||||
(deftype ogreboss-super-boulder (process-drawable)
|
||||
((parent-override (pointer ogreboss) :offset 12)
|
||||
(root-override collide-shape-moving :offset 112)
|
||||
(orig-pos vector :inline :offset-assert 176)
|
||||
(src-pos vector :inline :offset-assert 192)
|
||||
(spin-axis vector :inline :offset-assert 208)
|
||||
(joint joint-mod-blend-local :offset-assert 224)
|
||||
(speed float :offset-assert 228)
|
||||
(size float :offset-assert 232)
|
||||
(grow-rate float :offset-assert 236)
|
||||
(lava entity-actor :offset-assert 240)
|
||||
(sound-id sound-id :offset-assert 244)
|
||||
(hit-boss symbol :offset-assert 248)
|
||||
(tumble-quat quaternion :inline :offset-assert 256)
|
||||
((parent-override (pointer process-drawable) :offset 12)
|
||||
(root-override collide-shape-moving :offset 112)
|
||||
(orig-pos vector :inline :offset-assert 176)
|
||||
(src-pos vector :inline :offset-assert 192)
|
||||
(spin-axis vector :inline :offset-assert 208)
|
||||
(joint joint-mod-blend-local :offset-assert 224)
|
||||
(speed float :offset-assert 228)
|
||||
(size float :offset-assert 232)
|
||||
(grow-rate float :offset-assert 236)
|
||||
(lava entity-actor :offset-assert 240)
|
||||
(sound-id sound-id :offset-assert 244)
|
||||
(hit-boss symbol :offset-assert 248)
|
||||
(tumble-quat quaternion :inline :offset-assert 256)
|
||||
)
|
||||
:heap-base #xa0
|
||||
:method-count-assert 20
|
||||
@ -1034,8 +1034,8 @@
|
||||
(set! (-> self root-override) s4-0)
|
||||
)
|
||||
(set! (-> self orig-pos quad) (-> arg0 quad))
|
||||
(set! (-> self root-override trans quad) (-> self parent-override 0 root-override trans quad))
|
||||
(set! (-> self root-override quat vec quad) (-> self parent-override 0 root-override quat vec quad))
|
||||
(set! (-> self root-override trans quad) (-> self parent-override 0 root trans quad))
|
||||
(set! (-> self root-override quat vec quad) (-> self parent-override 0 root quat vec quad))
|
||||
(vector-identity! (-> self root-override scale))
|
||||
(initialize-skeleton self *ogreboss-super-boulder-sg* '())
|
||||
(logclear! (-> self mask) (process-mask actor-pause))
|
||||
|
@ -183,6 +183,23 @@
|
||||
"display-loop",
|
||||
"on",
|
||||
|
||||
// target-handler
|
||||
"target-generic-event-handler", // return type forced to none
|
||||
|
||||
// shadow-cpu-h
|
||||
"(method 3 shadow-edge)", // defined twice in the same file, one is wrong and old
|
||||
|
||||
// sky - these are skipped and not used
|
||||
"sky-draw",
|
||||
"sky-upload",
|
||||
"sky-add-frame-data",
|
||||
|
||||
// drawable
|
||||
"vis-cull", // unsupported asm
|
||||
"draw-instance-info", // skipped for now, debug only
|
||||
"foreground-engine-execute",
|
||||
"real-main-draw-hook", // dma handling not complete
|
||||
|
||||
// generic-obs
|
||||
"command-get-process", // handle casts
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user