decomp: mostly finish misty-warehouse blocked by sllv from PP

This commit is contained in:
Tyler Wilding
2021-08-08 18:50:35 -04:00
parent a9816f9d28
commit e7c100e060
5 changed files with 535 additions and 64 deletions
+30 -64
View File
@@ -10010,9 +10010,7 @@
)
(deftype camera-tracker (process)
(
;(name basic :offset-assert 4)
(grab-target uint64 :offset 120)
((grab-target handle :offset 120)
(grab-event basic :offset-assert 128)
(release-event basic :offset-assert 132)
(old-global-mask uint32 :offset-assert 136)
@@ -18754,7 +18752,7 @@
(define-extern cam-launcher-long-joystick function)
(define-extern hide-hud-quick function)
(define-extern command-get-process function)
(define-extern camera-change-to function)
(define-extern camera-change-to (function string int symbol none)) ;; TODO - not confirmed yet
(define-extern camera-look-at function)
(define-extern camera-pov-from function)
(define-extern command-get-trans function)
@@ -18767,7 +18765,7 @@
(define-extern command-get-camera function)
(define-extern ja-anim-done? function)
(define-extern camera-anim function)
(define-extern camera-tracker-init function)
(define-extern camera-tracker-init (function function none)) ;; TODO - not confirmed, see misty-warehouse::camera-view
(define-extern cam-launcher-joystick function)
(define-extern launcher-init-by-other function)
(define-extern touch-tracker-init function)
@@ -22321,7 +22319,8 @@
)
(deftype eco-door (process-drawable)
((speed float :offset-assert 176)
((root-override collide-shape :score 100 :offset 112)
(speed float :offset-assert 176)
(open-distance float :offset-assert 180)
(close-distance float :offset-assert 184)
(out-dir vector :inline :offset-assert 192)
@@ -22329,9 +22328,9 @@
(close-sound uint128 :offset-assert 224)
(state-actor basic :offset-assert 240)
(flags int32 :offset-assert 244)
(locked basic :offset-assert 248)
(auto-close basic :offset-assert 252)
(one-way basic :offset-assert 256)
(locked symbol :offset-assert 248)
(auto-close symbol :offset-assert 252)
(one-way symbol :offset-assert 256)
)
:method-count-assert 27
:size-assert #x104
@@ -22343,8 +22342,8 @@
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(TODO-RENAME-24 (_type_) none 24)
(TODO-RENAME-25 (_type_) none 25)
(dummy-26 () none 26)
)
)
@@ -33111,68 +33110,35 @@
;; - Types
; (deftype silostep (process-drawable)
; ((anim-limit float :offset-assert 176)
; (cam-tracker uint64 :offset-assert 184)
; )
; :method-count-assert 20
; :size-assert #xc0
; :flag-assert #x14005000c0
; ;; inherited inspect of process-drawable
; (:methods
; (dummy-9 () none 9)
; (dummy-10 () none 10)
; (dummy-11 () none 11)
; (dummy-12 () none 12)
; (dummy-13 () none 13)
; (dummy-14 () none 14)
; (dummy-15 () none 15)
; (dummy-16 () none 16)
; (dummy-17 () none 17)
; (dummy-18 () none 18)
; (dummy-19 () none 19)
; )
; )
(deftype silostep (process-drawable)
((anim-limit float :offset-assert 176)
(cam-tracker uint64 :offset-assert 184)
)
:method-count-assert 20
:heap-base #x50
:size-assert #xc0
:flag-assert #x14005000c0
)
; (deftype rounddoor (eco-door)
; ()
; :method-count-assert 27
; :size-assert #x104
; :flag-assert #x1b00a00104
; ;; not enough basic ops
; (:methods
; (dummy-9 () none 9)
; (dummy-10 () none 10)
; (dummy-11 () none 11)
; (dummy-12 () none 12)
; (dummy-13 () none 13)
; (dummy-14 () none 14)
; (dummy-15 () none 15)
; (dummy-16 () none 16)
; (dummy-17 () none 17)
; (dummy-18 () none 18)
; (dummy-19 () none 19)
; (dummy-20 () none 20)
; (dummy-21 () none 21)
; (dummy-22 () none 22)
; (dummy-23 () none 23)
; (dummy-24 () none 24)
; (dummy-25 () none 25)
; (dummy-26 () none 26)
; )
; )
(deftype rounddoor (eco-door)
()
:method-count-assert 27
:heap-base #xa0
:size-assert #x104
:flag-assert #x1b00a00104
)
;; - Functions
(define-extern misty-camera-view function)
(define-extern misty-camera-view (function int :behavior silostep))
;; - Unknowns
(define-extern *rounddoor-sg* skeleton-group)
(define-extern *silostep-sg* skeleton-group)
;;(define-extern silostep-rise object) ;; unknown type
;;(define-extern silostep-idle object) ;; unknown type
;;(define-extern silostep-camera object) ;; unknown type
(define-extern silostep-rise (state none)) ;; unknown type
(define-extern silostep-idle (state none)) ;; unknown type
(define-extern silostep-camera (state none)) ;; unknown type
;; ----------------------
@@ -592,5 +592,13 @@
[5, "(function process int symbol event-message-block object :behavior teetertotter)"]
],
"misty-warehouse": [
[3, "(function symbol none :behavior silostep)"],
[4, "(function none :behavior silostep)"],
[6, "(function none :behavior camera-tracker)"],
[7, "(function none :behavior silostep)"],
[8, "(function process int symbol event-message-block none :behavior silostep)"]
],
"placeholder-do-not-add-below": []
}
@@ -1427,6 +1427,25 @@
["L30", "skeleton-group", true]
],
"misty-warehouse": [
["L7", "_lambda_", true],
["L11", "_lambda_", true],
["L15", "_lambda_", true],
["L23", "_lambda_", true],
["L25", "_lambda_", true],
["L29", "skeleton-group", true],
["L34", "state", true],
["L35", "skeleton-group", true],
["L31", "state", true],
["L32", "state", true],
["L37", "float", true],
["L46", "float", true],
["L48", "uint64", true],
["L49", "uint64", true],
["L50", "uint64", true],
["L51", "uint64", true]
],
// please do not add things after this entry! git is dumb.
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": []
}
@@ -1795,5 +1795,13 @@
[10, "v1", "art-joint-anim"]
],
"misty-camera-view": [
[19, "t9", "(function object object object object)"]
],
"(method 11 silostep)": [
[100, "v1", "art-joint-anim"]
],
"placeholder-do-not-add-below": []
}
@@ -0,0 +1,470 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type silostep
(deftype silostep (process-drawable)
((anim-limit float :offset-assert 176)
(cam-tracker uint64 :offset-assert 184)
)
:heap-base #x50
:method-count-assert 20
:size-assert #xc0
:flag-assert #x14005000c0
)
;; definition for method 3 of type silostep
(defmethod inspect silostep ((obj silostep))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tanim-limit: ~f~%" (-> obj anim-limit))
(format #t "~T~Tcam-tracker: ~D~%" (-> obj cam-tracker))
obj
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "silostep"
:bounds
(new 'static 'vector :y 8192.0 :w 32768.0)
:version #x6
)
)
)
(set! (-> v1-1 jgeo) 0)
(set! (-> v1-1 janim) 2)
(set! (-> v1-1 mgeo 0) (the-as uint 1))
(set! (-> v1-1 lod-dist 0) 4095996000.0)
(set! *silostep-sg* v1-1)
)
;; failed to figure out what this is:
(let
((v1-2
(new 'static 'state
:name 'silostep-idle
:next #f
:exit #f
:code #f
:trans #f
:post #f
:enter #f
:event #f
)
)
)
(set! silostep-idle (the-as (state none) v1-2))
(set!
(-> v1-2 event)
(the-as
(function process int symbol event-message-block object)
(lambda :behavior silostep
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('trigger)
(go silostep-camera)
)
(('trigger-rise)
enter-state
(go silostep-rise)
)
)
(none)
)
)
)
(set!
(-> v1-2 code)
(lambda :behavior silostep () (let ((gp-0 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
gp-0
(the-as
art-joint-anim
(-> self draw art-group data 2)
)
num-func-identity
)
(set! (-> gp-0 frame-num) 0.0)
)
(transform-post)
(while #t
(suspend)
)
(none)
)
)
(set! (-> v1-2 post) ja-post)
)
;; definition for function misty-camera-view
(defbehavior misty-camera-view silostep ()
(let* ((gp-0 (get-process *default-dead-pool* camera-tracker #x4000))
(v1-1 (when gp-0
(let ((t9-1 (method-of-type camera-tracker activate)))
(t9-1
(the-as camera-tracker gp-0)
self
'camera-tracker
(the-as pointer #x70004000)
)
)
((the-as
(function object object object object)
run-function-in-process
)
gp-0
camera-tracker-init
(lambda :behavior camera-tracker
()
(while (not (process-grab? *target*))
(suspend)
)
(camera-change-to "camera-160" 150 #f)
(let ((gp-0 (-> *display* base-frame-counter)))
(until (begin
(suspend)
(>=
(the-as
int
(- (-> *display* base-frame-counter) gp-0)
)
900
)
)
(empty)
)
)
(while
(not
(process-release? (handle->process (-> self grab-target)))
)
(suspend)
)
(camera-change-to (the-as string 'base) 150 #f)
(none)
)
)
(-> gp-0 ppointer)
)
)
(v0-3 (logior (shl (-> v1-1 0 pid) 32) (.asm.sllv.r0 v1-1)))
)
(set! (-> self cam-tracker) (the-as uint v0-3))
v0-3
)
)
;; failed to figure out what this is:
(let
((v1-4
(new 'static 'state
:name 'silostep-camera
:next #f
:exit #f
:code #f
:trans #f
:post #f
:enter #f
:event #f
)
)
)
(set! silostep-camera (the-as (state none) v1-4))
(set!
(-> v1-4 code)
(lambda :behavior silostep
()
(misty-camera-view)
(let* ((gp-0 (get-task-control (game-task misty-warehouse)))
(v1-1 (get-reminder gp-0 0))
)
(save-reminder gp-0 (logior v1-1 2) 0)
)
(set! (-> self state-time) (-> *display* base-frame-counter))
(let ((gp-1 (-> *display* base-frame-counter)))
(until (begin
(suspend)
(>= (the-as int (- (-> *display* base-frame-counter) gp-1)) 300)
)
(empty)
)
)
(sound-play-by-name
(static-sound-name "arena-steps")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(send-to-all-after (-> self link) 'trigger-rise)
enter-state
(go silostep-rise)
(none)
)
)
(set! (-> v1-4 post) ja-post)
)
;; failed to figure out what this is:
(let
((v1-5
(new 'static 'state
:name 'silostep-rise
:next #f
:exit #f
:code #f
:trans #f
:post #f
:enter #f
:event #f
)
)
)
(set! silostep-rise (the-as (state none) v1-5))
(set!
(-> v1-5 code)
(lambda :behavior silostep
((arg0 symbol))
(process-entity-status! self (entity-perm-status complete) #t)
(when (not arg0)
(let ((a0-2 (-> self skel root-channel 0)))
(set!
(-> a0-2 frame-group)
(the-as art-joint-anim (-> self draw art-group data 2))
)
(set! (-> a0-2 param 0) (-> self anim-limit))
(set! (-> a0-2 param 1) 1.0)
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group!
a0-2
(the-as art-joint-anim (-> self draw art-group data 2))
num-func-seek!
)
)
(until (begin
(rider-trans)
(rider-post)
(suspend)
(let ((a0-3 (-> self skel root-channel 0)))
(set! (-> a0-3 param 0) (-> self anim-limit))
(set! (-> a0-3 param 1) 1.0)
(joint-control-channel-group-eval!
a0-3
(the-as art-joint-anim #f)
num-func-seek!
)
)
(ja-done? 0)
)
(empty)
)
)
(let ((gp-1 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
gp-1
(the-as art-joint-anim (-> self draw art-group data 2))
num-func-identity
)
(set! (-> gp-1 frame-num) (-> self anim-limit))
)
(rider-post)
(while #t
(ja-post)
(suspend)
)
(none)
)
)
(set! (-> v1-5 post) #f)
)
;; definition for method 11 of type silostep
(defmethod dummy-method-11 silostep ((obj silostep) (arg0 object))
(logior! (-> obj mask) (process-mask movie-subject))
(let
((s4-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction) nothing)
(let ((t9-2 (method-of-object s4-0 dummy-29)))
1
(t9-2)
)
(let
((s3-0
(new
'process
'collide-shape-prim-mesh
s4-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s3-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 1))
(set! (-> s3-0 prim-core offense) 4)
(set! (-> s3-0 transform-index) 4)
(set-vector! (-> s3-0 local-sphere) 0.0 4096.0 0.0 18432.0)
)
((method-of-object s4-0 dummy-46))
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
((method-of-object s4-0 dummy-50))
(set! (-> obj root) s4-0)
)
(process-drawable-from-entity! obj arg0)
(dummy-14 obj *silostep-sg* '())
(set!
(-> obj anim-limit)
(*
((method-of-type res-lump get-property-value-float)
(the-as res-lump arg0)
'distance
'interp
-1000000000.0
1.0
(the-as (pointer res-tag) #f)
*res-static-buf*
)
(the
float
(+
(-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length)
-1
)
)
)
)
(set! (-> obj link) (new 'process 'actor-link-info obj))
(cond
((and
(-> obj entity)
(nonzero?
(logand (-> obj entity extra perm status) (entity-perm-status complete))
)
)
enter-state
#t
(go silostep-rise)
)
(else
(go silostep-idle)
)
)
(none)
)
;; failed to figure out what this is:
(let
((v1-6
(new 'static 'skeleton-group
:art-group-name "rounddoor"
:bounds (new 'static 'vector :w 32768.0)
:max-lod 1
:version #x6
)
)
)
(set! (-> v1-6 jgeo) 0)
(set! (-> v1-6 janim) 3)
(set! (-> v1-6 mgeo 0) (the-as uint 1))
(set! (-> v1-6 lod-dist 0) 81920.0)
(set! (-> v1-6 mgeo 1) (the-as uint 2))
(set! (-> v1-6 lod-dist 1) 4095996000.0)
(set! *rounddoor-sg* v1-6)
)
;; definition of type rounddoor
(deftype rounddoor (eco-door)
()
:heap-base #xa0
:method-count-assert 27
:size-assert #x104
:flag-assert #x1b00a00104
)
;; definition for method 3 of type rounddoor
(defmethod inspect rounddoor ((obj rounddoor))
(let ((t9-0 (method-of-type eco-door inspect)))
(t9-0 obj)
)
obj
)
;; definition for method 24 of type rounddoor
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-24 rounddoor ((obj rounddoor))
(let
((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others))))
(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 1))
(set! (-> s4-0 prim-core offense) 4)
(set! (-> s4-0 transform-index) 0)
(set-vector! (-> s4-0 local-sphere) -12288.0 0.0 0.0 40960.0)
)
((method-of-object s5-0 dummy-46))
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
((method-of-object s5-0 dummy-50))
(set! (-> obj root-override) s5-0)
)
0
(none)
)
;; definition for method 25 of type rounddoor
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defmethod TODO-RENAME-25 rounddoor ((obj rounddoor))
(dummy-14 obj *rounddoor-sg* '())
(set! (-> obj open-distance) 69632.0)
(set! (-> obj close-distance) 81920.0)
(set!
(-> obj open-sound)
(the-as
uint128
(make-u128 (the-as uint #x6e65706f2d72) (the-as uint #x6f6f64616e657261))
)
)
(set!
(-> obj close-sound)
(the-as
uint128
(make-u128 (the-as uint #x65736f6c632d72) (the-as uint #x6f6f64616e657261))
)
)
(set! (-> obj speed) 1.5)
(set! (-> obj auto-close) #t)
(set! (-> obj one-way) #t)
(vector-x-quaternion! (-> obj out-dir) (-> obj root-override quat))
(set!
(-> obj out-dir w)
(- 8192.0 (vector-dot (-> obj out-dir) (-> obj root-override trans)))
)
(dummy-47 (-> obj root-override))
0
(none)
)