Files
jak-project/test/decompiler/reference/levels/village2/sunken-elevator_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

298 lines
8.3 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type sunken-elevator
(deftype sunken-elevator (plat-button)
((play-at-top-going-up-camera? symbol :offset-assert 240)
(teleport-if-below-y float :offset-assert 244)
(teleport-if-above-y float :offset-assert 248)
)
:heap-base #x90
:method-count-assert 33
:size-assert #xfc
:flag-assert #x21009000fc
)
;; definition for method 3 of type sunken-elevator
(defmethod inspect sunken-elevator ((obj sunken-elevator))
(let ((t9-0 (method-of-type plat-button inspect)))
(t9-0 obj)
)
(format
#t
"~T~Tplay-at-top-going-up-camera?: ~A~%"
(-> obj play-at-top-going-up-camera?)
)
(format #t "~T~Tteleport-if-below-y: ~f~%" (-> obj teleport-if-below-y))
(format #t "~T~Tteleport-if-above-y: ~f~%" (-> obj teleport-if-above-y))
obj
)
;; failed to figure out what this is:
(defskelgroup *sunken-elevator-sg* sunken-elevator
0
2
((1 (meters 999999)))
:bounds (static-spherem 0 -1 0 6.599999904632568)
:longest-edge (meters 0)
)
;; definition for method 30 of type sunken-elevator
(defmethod should-teleport? sunken-elevator ((obj sunken-elevator))
(let ((f0-0 (-> (camera-pos) y)))
(case (-> obj path-pos)
((0.0)
(if (< f0-0 (-> obj teleport-if-below-y))
(return #t)
)
)
((1.0)
(if (< (-> obj teleport-if-above-y) f0-0)
(return #t)
)
)
)
)
#f
)
;; failed to figure out what this is:
(defstate plat-button-pressed (sunken-elevator)
:virtual #t
:enter
(behavior ()
(let ((t9-0 (-> (method-of-type plat-button plat-button-pressed) enter)))
(if t9-0
(t9-0)
)
)
(case (-> self path-pos)
((0.0)
(load-state-want-display-level 'sunken 'display)
(let ((gp-0 (get-process *default-dead-pool* village2cam #x4000)))
(set! (-> (the-as village2cam (-> (when gp-0
(let
((t9-3
(method-of-type
village2cam
activate
)
)
)
(t9-3
(the-as village2cam gp-0)
self
'village2cam
(the-as pointer #x70004000)
)
)
(run-now-in-process
gp-0
pov-camera-init-by-other
(-> self spawn-pos)
*village2cam-sg*
"elevator-at-top-going-down"
0
#f
'()
)
(-> gp-0 ppointer)
)
0
)
)
seq
)
(the-as uint 0)
)
)
0
)
((1.0)
(let* ((gp-1 (get-process *default-dead-pool* village2cam #x4000))
(v1-10 (when gp-1
(let ((t9-6 (method-of-type village2cam activate)))
(t9-6
(the-as village2cam gp-1)
self
'village2cam
(the-as pointer #x70004000)
)
)
(run-now-in-process
gp-1
pov-camera-init-by-other
(-> self spawn-pos)
*village2cam-sg*
"elevator-at-top-going-down"
0
#f
'()
)
(-> gp-1 ppointer)
)
)
)
(set! (-> (the-as village2cam (-> v1-10 0)) seq) (the-as uint 1))
)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-button-move-upward (sunken-elevator)
:virtual #t
:enter
(behavior ()
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) enter)))
(if t9-0
(t9-0)
)
)
(set! (-> self play-at-top-going-up-camera?) #t)
(none)
)
:trans
(behavior ()
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans)))
(if t9-0
(t9-0)
)
)
(when
(and (-> self play-at-top-going-up-camera?) (>= 0.14 (-> self path-pos)))
(set! *teleport* #t)
(set! (-> self play-at-top-going-up-camera?) #f)
(load-state-want-display-level 'sunken 'special)
(let* ((gp-0 (get-process *default-dead-pool* village2cam #x4000))
(v1-8 (when gp-0
(let ((t9-3 (method-of-type village2cam activate)))
(t9-3
(the-as village2cam gp-0)
self
'village2cam
(the-as pointer #x70004000)
)
)
(run-now-in-process
gp-0
pov-camera-init-by-other
(-> self spawn-pos)
*village2cam-sg*
"elevator-at-top-going-down"
0
#f
'()
)
(-> gp-0 ppointer)
)
)
)
(set! (-> (the-as village2cam (-> v1-8 0)) seq) (the-as uint 2))
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-button-move-downward (sunken-elevator)
:virtual #t
:trans
(behavior ()
(let ((s5-0 (new 'stack-no-clear 'vector))
(gp-0 (new 'stack-no-clear 'vector))
)
(set! *teleport* #t)
(set! (-> s5-0 quad) (-> self root-override trans quad))
(let
((t9-1
(->
(the-as (state sunken-elevator) (find-parent-method sunken-elevator 23))
trans
)
)
)
(if t9-1
(t9-1)
)
)
(vector-! gp-0 (-> self root-override trans) s5-0)
)
(when (< (-> self path-pos) 0.9)
(TODO-RENAME-28 (-> *target* control))
(send-event *target* 'reset-height)
)
(none)
)
)
;; definition for method 29 of type sunken-elevator
;; INFO: Return type mismatch float vs symbol.
(defmethod can-target-move? sunken-elevator ((obj sunken-elevator))
(set! (-> obj play-at-top-going-up-camera?) #f)
(let ((s5-0 (new 'stack-no-clear 'vector)))
(eval-path-curve! (-> obj path) s5-0 0.4 'interp)
(set! (-> obj teleport-if-above-y) (-> s5-0 y))
(eval-path-curve! (-> obj path) s5-0 0.6 'interp)
(let ((f0-1 (-> s5-0 y)))
(set! (-> obj teleport-if-below-y) f0-1)
(the-as symbol f0-1)
)
)
)
;; definition for method 27 of type sunken-elevator
(defmethod TODO-RENAME-27 sunken-elevator ((obj sunken-elevator))
(ja-channel-set! 1)
(cond
((can-activate? obj)
(let ((s5-0 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-0
(the-as art-joint-anim (-> obj draw art-group data 2))
num-func-identity
)
(set! (-> s5-0 frame-num) 0.0)
)
)
(else
(let ((s5-1 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> obj draw art-group data 2))
num-func-identity
)
(set!
(-> s5-1 frame-num)
(the
float
(+
(->
(the-as art-joint-anim (-> obj draw art-group data 2))
data
0
length
)
-1
)
)
)
)
)
)
(ja-post)
(dummy-47 (-> obj root-override))
(none)
)
;; definition for method 31 of type sunken-elevator
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-31 sunken-elevator ((obj sunken-elevator))
(initialize-skeleton obj *sunken-elevator-sg* '())
0
(none)
)