Files
jak-project/test/decompiler/reference/levels/common/plat_REF.gc
T
Tyler Wilding 5f1ed7ab60 decomp: decompile *-obs files (#856)
* decomp: mostly finish `cam-master`

* decomp/scripts: lots of work in cam-states

* stash

* Merge remote-tracking branch 'water111/master' into decomp/camera-master

Updated submodule third-party/googletest

* decompiler: Add support for non power of 2 offsets for inline arr access

* decomp: mostly finish `cam-states` need to fix a macro issue

* blocked: `cam-master` decompiler crash when adding casts

* decomp: finish `cam-states-dbg`

* decomp: mostly finish `pov-camera` with the exception of joint-related code

* decomp: `cam-debug` finished decompiling, no way does this compile yet though

* decomp: considerable work done in `cam-layout`

* decomp: `cam-layout` almost done!

* decomp: `pov-camera` finished, TC tests will fail for now

* decomp: working on resolving issues

* decomp: cam-layout decompiling

* fixing more issues in cam-master...one event handler remains

* skip problematic function in `cam-master` for now

* gsrc: update res macros

* decomp: finish `cam-states`

* decomp: giving up on `cam-debug`

* tests: allow skipping state handlers in ref tests

* decomp: working through cam-layout bugs

* decomp: allow for shifting non-integers

* decomp: finalize `cam-layout` and `cam-master`

* decomp: finalize `cam-states`

* cleanup: bi-annual formatting of the casting files

* formatting

* decomp: start working on beach-obs

* blocked: `beach-obs` mostly finished, but handle cast issues and unknown `prebind` func signature

* blocked: `villagep-obs` done, `s6` not being referred to as `self`

* decomp: finish `citadel-obs`

* decomp: finish `darkcave-obs`

* blocked: need to allow `hud-h` to decompile properly (#f as static pointer)

* decomp: finish `jungle-obs`

* decomp: finish `village-obs`

* blocked: `misty-obs` handle cast issues

* decomp: finish `village2-obs`

* decomp: 1 function left in `swamp-obs`, particle related -- maybe we know now?

* decomp: finish `swamp-obs`

* blocked: `maincave-obs` handle casts

* decomp: finish `sunken-obs`

* blocked: `rolling-obs` handle casts and hud-parts

* decomp: finish `firecanyon-obs`

* decomp: finish `ogre-obs`

* blocked: `village3-obs` gives up type analysis!

* blocked: `snow-obs` has hud-parts and handle casts code

* decomp: finish `snow-flutflut-obs`

* blocked: `lavatube-obs` has s6-1 issue

* blocked: `title-obs` handle cast issues

* fixed post merge problems

* decomp: finish `jungleb-obs`

* blocked: `training-obs` has `s6-1` issue

* fix type consistency

* scripts: Extend update script to handle the game-text-id enum as well

* git: Update git attributes to effectively halve PR burden

* fixed `sound-play-by-name` signature

* fix particle definitions in firecanyon-obs

* fix func signature in racer-states

* update ref tests

* tests: update current ref tests

* tests: add `joint` to ref-tests

* tests: add `process-drawable` to ref-tests

* updated gsrc

* add back manual fix

* address most feedback, update source files

* get rid of forward declarations in `darkcave-obs`

Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2021-11-05 21:29:32 -04:00

418 lines
10 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(set!
(-> *part-group-id-table* 107)
(new 'static 'sparticle-launch-group
:length 2
:duration #xbb8
:linger-duration #x5dc
:name "group-standard-plat"
:launcher
(new 'static 'inline-array sparticle-group-item 2
(sp-item 363 :fade-after (meters 60.0) :falloff-to (meters 60.0))
(sp-item 364 :fade-after (meters 160.0) :falloff-to (meters 160.0))
)
:bounds
(new 'static 'sphere :y -49152.0 :w 57344.0)
)
)
;; failed to figure out what this is:
(set!
(-> *part-id-table* 363)
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 14
(sp-flt spt-num 1.5)
(sp-flt spt-y (meters 1.0))
(sp-int spt-rot-x 5)
(sp-flt spt-r 5324.8)
(sp-flt spt-g 4096.0)
(sp-flt spt-b 3686.4)
(sp-flt spt-vel-y (meters 0.0033333334))
(sp-flt spt-fade-b -16.383999)
(sp-int spt-timer 25)
(sp-cpuinfo-flags aux-list)
(sp-rnd-flt spt-conerot-x (degrees 140.0) (degrees 40.0) 1.0)
(sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
(sp-flt spt-conerot-radius (meters 3.0))
(sp-end)
)
)
)
;; failed to figure out what this is:
(set!
(-> *part-id-table* 364)
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 19
(sp-tex spt-texture (new 'static 'texture-id :index #xf :page #x2))
(sp-flt spt-num 2.0)
(sp-flt spt-y (meters 1.5))
(sp-rnd-flt spt-scale-x (meters 2.0) (meters 1.0) 1.0)
(sp-copy-from-other spt-scale-y -4)
(sp-rnd-flt spt-g 0.0 64.0 1.0)
(sp-rnd-flt spt-b 128.0 128.0 1.0)
(sp-rnd-flt spt-a 16.0 32.0 1.0)
(sp-flt spt-vel-y (meters 0.01))
(sp-flt spt-fade-g -0.42666668)
(sp-flt spt-fade-a -0.32)
(sp-flt spt-accel-y -0.13653333)
(sp-flt spt-friction 0.96)
(sp-int spt-timer 150)
(sp-cpuinfo-flags bit2 bit3)
(sp-rnd-flt spt-conerot-x (degrees 130.0) (degrees 100.00001) 1.0)
(sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
(sp-flt spt-conerot-radius (meters 3.0))
(sp-end)
)
)
)
;; definition of type plat
(deftype plat (baseplat)
((path-pos float :offset-assert 228)
(sync sync-info-eased :inline :offset-assert 232)
(sound-id sound-id :offset-assert 260)
)
:heap-base #xa0
:method-count-assert 33
:size-assert #x108
:flag-assert #x2100a00108
(:methods
(get-lit-skel (_type_) skeleton-group 27)
(dummy-28 () none 28)
(wad () _type_ :state 29)
(plat-startup (plat) _type_ :state 30)
(plat-idle () _type_ :state 31)
(plat-path-active (plat) _type_ :state 32)
)
)
;; definition for method 3 of type plat
(defmethod inspect plat ((obj plat))
(let ((t9-0 (method-of-type baseplat inspect)))
(t9-0 obj)
)
(format #t "~T~Tpath-pos: ~f~%" (-> obj path-pos))
(format #t "~T~Tsync: #<sync-info-eased @ #x~X>~%" (-> obj sync))
(format #t "~T~Tsound-id: ~D~%" (-> obj sound-id))
obj
)
;; failed to figure out what this is:
(defskelgroup *plat-sg* plat
0
4
((1 (meters 20)) (2 (meters 40)) (3 (meters 999999)))
:bounds (static-spherem 0 -0.5 0 3)
:longest-edge (meters 0)
)
;; failed to figure out what this is:
(defskelgroup *plat-jungleb-sg* plat-jungleb
0
4
((1 (meters 999999)))
:bounds (static-spherem 0 -0.5 0 3)
:longest-edge (meters 0)
)
;; failed to figure out what this is:
(defskelgroup *plat-sunken-sg* plat-sunken
0
4
((1 (meters 999999)))
:bounds (static-spherem 0 -0.5 0 3.200000047683716)
:longest-edge (meters 0)
)
;; definition for method 23 of type plat
(defmethod get-unlit-skel plat ((obj plat))
(cond
((= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'jungleb
)
*plat-jungleb-sg*
)
((or (= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'sunken
)
(= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'sunkenb
)
)
*plat-sunken-sg*
)
(else
*plat-sg*
)
)
)
;; definition for method 24 of type plat
;; INFO: Return type mismatch int vs none.
(defmethod dummy-24 plat ((obj plat))
(let
((s5-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) default-collision-reaction)
(set! (-> s5-0 no-reaction) nothing)
(dummy-29 s5-0 1)
(let
((s4-0
(new
'process
'collide-shape-prim-mesh
s5-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s4-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s4-0 collide-with) (the-as uint 16))
(set! (-> s4-0 prim-core action) (the-as uint 3))
(set! (-> s4-0 prim-core offense) 4)
(set! (-> s4-0 transform-index) 0)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 13107.2)
)
(dummy-46 s5-0)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(dummy-50 s5-0)
(set! (-> obj root-override) s5-0)
)
0
(none)
)
;; definition for method 26 of type plat
;; INFO: Return type mismatch int vs none.
(defmethod dummy-26 plat ((obj plat))
0
(none)
)
;; definition for method 25 of type plat
;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group.
(defmethod TODO-RENAME-25 plat ((obj plat))
(the-as sparticle-launch-group (when (!= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'maincave
)
(let
((v0-0
(create-launch-control
(-> *part-group-id-table* 107)
obj
)
)
)
(set! (-> obj part) v0-0)
v0-0
)
)
)
)
;; failed to figure out what this is:
(defstate plat-startup (plat)
:virtual #t
:code
(behavior ((arg0 plat))
(cond
((logtest? (-> self path flags) (path-control-flag not-found))
(go-virtual plat-idle)
)
((> (-> self sync period) 0)
(go-virtual plat-path-active arg0)
)
(else
(go-virtual plat-idle)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-idle (plat)
:virtual #t
:event
(the-as
(function process int symbol event-message-block object :behavior plat)
plat-event
)
:trans
(behavior ()
(dummy-20 self)
(none)
)
:code
(behavior ()
(plat-trans)
(rider-post)
(suspend)
(while #t
(when (not (-> self bouncing))
(plat-trans)
(rider-post)
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
0
)
(while (-> self bouncing)
(plat-trans)
(rider-post)
(suspend)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-path-active (plat)
:virtual #t
:event
(the-as
(function process int symbol event-message-block object :behavior plat)
plat-event
)
:exit
(behavior ()
(sound-stop (-> self sound-id))
(none)
)
:trans
(behavior ()
(set! (-> self path-pos) (if (logtest? (-> self fact options) 8)
(get-current-phase (-> self sync))
(get-current-phase-with-mirror (-> self sync))
)
)
(eval-path-curve!
(-> self path)
(-> self basetrans)
(-> self path-pos)
'interp
)
(if
(<
(vector-vector-distance (-> self root-override trans) (ear-trans))
81920.0
)
(sound-play-by-name
(static-sound-name "eco-plat-hover")
(-> self sound-id)
1024
0
0
1
(the-as symbol (-> self root-override trans))
)
)
(plat-trans)
(none)
)
:code
(the-as (function plat none :behavior plat) anim-loop)
:post
(the-as (function none :behavior plat) plat-post)
)
;; definition for method 11 of type plat
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! plat ((obj plat) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(dummy-24 obj)
(process-drawable-from-entity! obj arg0)
(initialize-skeleton obj (get-unlit-skel obj) '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(dummy-21 obj)
(TODO-RENAME-25 obj)
(load-params! (-> obj sync) obj (the-as uint 0) 0.0 0.15 0.15)
(set!
(-> obj fact)
(new
'process
'fact-info
obj
(pickup-type eco-pill-random)
(-> *FACT-bank* default-pill-inc)
)
)
(set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0))
(logior!
(-> obj path flags)
(path-control-flag display draw-line draw-point draw-text)
)
(set! (-> obj sound-id) (new-sound-id))
(cond
((logtest? (-> obj path flags) (path-control-flag not-found))
(set! (-> obj path-pos) 0.0)
(let ((a0-14 obj))
(dummy-26 a0-14)
(go (method-of-object obj plat-startup) a0-14)
)
)
((> (-> obj sync period) 0)
(set! (-> obj path-pos) (if (logtest? (-> obj fact options) 8)
(get-current-phase (-> obj sync))
(get-current-phase-with-mirror (-> obj sync))
)
)
(eval-path-curve!
(-> obj path)
(-> obj root-override trans)
(-> obj path-pos)
'interp
)
(let ((a0-18 obj))
(dummy-26 a0-18)
(go (method-of-object obj plat-startup) a0-18)
)
)
(else
(set! (-> obj path-pos) 0.0)
(eval-path-curve!
(-> obj path)
(-> obj root-override trans)
(-> obj path-pos)
'interp
)
(let ((a0-20 obj))
(dummy-26 a0-20)
(go (method-of-object obj plat-startup) a0-20)
)
)
)
(none)
)