decomp: Re-attempting previously blocked state decomp files (#907)

* blocked: `part-tester` - `code` handler thinks it returns nothing

* blocked: `crates` finished but `go` is returning none causing issues

* blocked: `(event ram-boss-idle)::snow-ram-boss` expression building fails due to delay slot issue

* decomp: finish `snow-ram` | `seagull` blocked, new static data issue

* decomp: finish `snow-bumper`

* stuck: `snow-ball` close, can't figure out a type made on the stack

* decomp: finish `spider-egg`

* decomp: finish `puffer`

* decomp: finish `driller-lurker`

* decomp: finish `dark-crystal`

* stuck: `kermit` - mostly done but stuck on a joint related callback arg

* decomp: finish `gnawer`

* decomp: finish `mother-spider-egg`

* decomp: finish `swamp-blimp`

* stuck: `mistycannon` prebind function signature

* decomp: finish `citb-plat`

* decomp: finish `darkvine`

* blocked: `jungle-mirrors` - issues with `link` macro

* decomp: finish `launcherdoor`

* decomp: finish `quicksandlurker` except for 1 unused function

* stuck: `balloonlurker` - `(code balloonlurker-mine-explode)` has some weird joint related code

* stuck: need to decompile an asm func in `orbit-plat`

* decomp: finish `voicebox`

* blocked: `mother-spider` has issues where `go` returns none

* decomp: finish `bully`

* decomp: finish `seagull`

* fixed up after merge conflicts

* decomp: finish `jungle-mirrors`

* update gsrc

* double checked files, fixed issues

* decomp: revert change to projectile methods

* decomp: some more fixes

* address feedback

* fix up remaining method calls in `cam-states`

* fix jungle-mirrors
This commit is contained in:
Tyler Wilding
2021-12-11 13:27:24 -05:00
committed by GitHub
parent fe9c5c10d1
commit 7edfc8bcec
84 changed files with 54467 additions and 19070 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -416,7 +416,7 @@
(saved-pt vector :inline :offset-assert 2464)
(spline-tt float :offset-assert 2480)
(spline-follow-dist float :offset-assert 2484)
(change-event-from uint32 :offset-assert 2488)
(change-event-from (pointer process-drawable) :offset-assert 2488) ;; mistycannon
(enter-has-run symbol :offset-assert 2492)
(blend-from-type uint64 :offset-assert 2496)
(blend-to-type uint64 :offset-assert 2504)
+5 -2
View File
@@ -1089,11 +1089,14 @@
(cond
(*camera*
(set! (-> self options) (-> *camera* slave-options))
(set! (-> self change-event-from) (-> *camera* changer))
(set!
(-> self change-event-from)
(the-as (pointer process-drawable) (-> *camera* changer))
)
)
(else
(set! (-> self options) (the-as uint 0))
(set! (-> self change-event-from) (the-as uint #f))
(set! (-> self change-event-from) (the-as (pointer process-drawable) #f))
)
)
(cond
+1 -1
View File
@@ -117,7 +117,7 @@
:flag-assert #x2100008670
(:methods
(dummy-9 (_type_) none 9)
(dummy-10 (_type_ vector vector float int process collide-mesh-cache-tri int) float 10)
(dummy-10 (_type_ vector vector float int process collide-tri-result int) float 10)
(dummy-11 (_type_ collide-using-spheres-params) none 11)
(fill-and-probe-using-y-probe (_type_ vector float uint process collide-tri-result uint) float 12)
(dummy-13 (_type_ bounding-box uint process-drawable uint) none 13)
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -27,7 +27,7 @@
(deftype part-tester (process)
((root trsqv :offset-assert 112)
(part sparticle-launch-control :offset-assert 116)
(old-group basic :offset-assert 120)
(old-group sparticle-launch-group :offset-assert 120)
)
:heap-base #x100
:method-count-assert 14
@@ -158,4 +158,4 @@
(none)
)
)
)
+8
View File
@@ -16,6 +16,14 @@
(define-extern process-drawable-from-entity! (function process-drawable entity-actor none))
;; TODO - for citb-plat
(define-extern *particle-quat* quaternion)
;; TODO - for jungle-mirrors
(define-extern line-in-view-frustum? (function vector vector symbol))
;; decomp begins
(declare-type beach-part part-spawner)
(define-extern beach-part-grotto-1 (state beach-part))
+36 -29
View File
@@ -8,43 +8,42 @@
(declare-type projectile process-drawable)
(define-extern projectile-init-by-other (function entity vector vector uint handle none :behavior projectile)) ;; 4th arg is `options`, 5th is `last-target`
;; decomp begins
;; DECOMP BEGINS
(deftype projectile (process-drawable)
((root-override collide-shape-moving :score 100 :offset 112)
(base-trans vector :inline :offset-assert 176)
(target vector :inline :offset-assert 192)
(target-base vector :inline :offset-assert 208)
(parent-base vector :inline :offset-assert 224)
(parent-quat vector :inline :offset-assert 240)
(base-vector vector :inline :offset-assert 256)
(timeout uint64 :offset-assert 272)
(options uint64 :offset-assert 280)
(last-target handle :offset-assert 288)
(notify-handle handle :offset-assert 296)
(max-speed float :offset-assert 304)
(max-turn float :offset-assert 308)
(old-dist float 16 :offset-assert 312)
(old-dist-count int32 :offset-assert 376)
(hits int32 :offset-assert 380)
(max-hits int32 :offset-assert 384)
(tween float :offset-assert 388)
(attack-mode symbol :offset-assert 392)
(update-velocity (function projectile none) :offset-assert 396)
(counter int32 :offset-assert 400)
(target-count int32 :offset-assert 404)
(sound-id sound-id :offset-assert 408)
((root-override collide-shape-moving :offset 112)
(base-trans vector :inline :offset-assert 176)
(target vector :inline :offset-assert 192)
(target-base vector :inline :offset-assert 208)
(parent-base vector :inline :offset-assert 224)
(parent-quat vector :inline :offset-assert 240)
(base-vector vector :inline :offset-assert 256)
(timeout uint64 :offset-assert 272)
(options uint64 :offset-assert 280)
(last-target handle :offset-assert 288)
(notify-handle handle :offset-assert 296)
(max-speed float :offset-assert 304)
(max-turn float :offset-assert 308)
(old-dist float 16 :offset-assert 312)
(old-dist-count int32 :offset-assert 376)
(hits int32 :offset-assert 380)
(max-hits int32 :offset-assert 384)
(tween float :offset-assert 388)
(attack-mode symbol :offset-assert 392)
(update-velocity (function projectile none) :offset-assert 396)
(counter int32 :offset-assert 400)
(target-count int32 :offset-assert 404)
(sound-id sound-id :offset-assert 408)
)
:heap-base #x130
:method-count-assert 29
:size-assert #x19c
:flag-assert #x1d0130019c
;; inherited inspect of process-drawable
(:methods
(projectile-die () _type_ :state 20) ;; state - sound related?
(projectile-dissipate () _type_ :state 21) ;; state
(projectile-impact () _type_ :state 22) ;; state
(projectile-moving () _type_ :state 23) ;; state
(projectile-die () _type_ :state 20)
(projectile-dissipate () _type_ :state 21)
(projectile-impact () _type_ :state 22)
(projectile-moving () _type_ :state 23)
(dummy-24 (_type_) none 24)
(dummy-25 (_type_) none 25)
(dummy-26 (_type_) none 26)
@@ -53,6 +52,7 @@
)
)
(deftype projectile-yellow (projectile)
((mode int32 :offset-assert 412)
(angle float :offset-assert 416)
@@ -63,6 +63,7 @@
:flag-assert #x1d014001a4
)
(deftype projectile-blue (projectile)
((mode int32 :offset-assert 412)
(joint-num int32 :offset-assert 416)
@@ -73,3 +74,9 @@
:flag-assert #x1d014001a4
)
0
+330
View File
@@ -5,3 +5,333 @@
;; name in dgo: voicebox
;; dgos: GAME, ENGINE
(define-extern *voicebox-sg* skeleton-group)
(define-extern empty-state (state process))
;; DECOMP BEGINS
(deftype camera-voicebox (camera-slave)
()
:heap-base #x9a0
:method-count-assert 14
:size-assert #xa04
:flag-assert #xe09a00a04
)
(deftype voicebox (process-drawable)
((parent-override (pointer camera-voicebox) :offset 12)
(base-trans vector :inline :offset-assert 176)
(seeker cam-float-seeker :inline :offset-assert 192)
(blend float :offset-assert 216)
(twist float :offset-assert 220)
(hint handle :offset-assert 224)
)
:heap-base #x80
:method-count-assert 23
:size-assert #xe8
:flag-assert #x17008000e8
(:methods
(enter () _type_ :state 20)
(idle () _type_ :state 21)
(exit () _type_ :state 22)
)
)
(defstate empty-state (process)
:code
(the-as (function none :behavior process) nothing)
)
(defskelgroup *voicebox-sg* speaker
0
2
((1 (meters 999999)))
:bounds (static-spherem 0 0 0 4)
:longest-edge (meters 0)
)
(defbehavior voicebox-track voicebox ()
(let ((gp-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))
)
(set! (-> gp-0 quad) (-> self parent-override 0 trans quad))
(set! (-> s5-0 quad) (-> (target-pos 68) quad))
(when *target*
(let
((a2-0
(vector-z-quaternion!
(new-stack-vector0)
(-> *target* control unknown-quaternion00)
)
)
)
(vector+float*! s5-0 s5-0 a2-0 (* -16384.0 (- 1.0 (-> self blend))))
)
)
(vector-lerp! (-> self root trans) gp-0 s5-0 (-> self blend))
)
(+!
(-> self root trans y)
(*
1638.4
(sin (* 54.613335 (the float (mod (-> *display* base-frame-counter) 1200))))
)
)
(let ((gp-1 (new 'stack-no-clear 'quaternion)))
(forward-up->quaternion
gp-1
(vector-normalize!
(vector-!
(new 'stack-no-clear 'vector)
(target-pos 37)
(-> self root trans)
)
1.0
)
(new 'static 'vector :y 1.0 :w 1.0)
)
(rotate-toward-orientation! (-> self root) gp-1 65536.0 5461.3335)
)
(when *target*
(let* ((gp-2 (-> *target* control))
(s4-2 (-> self root trans))
(f0-8
(deg-diff
(y-angle gp-2)
(vector-y-angle
(vector-! (new 'stack-no-clear 'vector) s4-2 (-> gp-2 trans))
)
)
)
)
(if (< 0.0 f0-8)
(set!
(-> self twist)
(seek (-> self twist) -0.4 (* 0.3 (-> *display* seconds-per-frame)))
)
(set!
(-> self twist)
(seek (-> self twist) 0.4 (* 0.3 (-> *display* seconds-per-frame)))
)
)
)
(let ((a1-9 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-9 from) self)
(set! (-> a1-9 num-params) 0)
(set! (-> a1-9 message) 'blocked-side?)
(case
(send-event-function (ppointer->process (-> self parent-override)) a1-9)
((1)
(set! (-> self twist) 0.5)
)
((2)
(set! (-> self twist) -0.5)
)
((3)
(set! (-> self twist) 0.0)
)
)
)
(send-event
(ppointer->process (-> self parent-override))
'joystick
(-> self twist)
-1.0
)
)
(set! (-> self root scale x) (lerp-scale 1.0 0.0 (-> self blend) 0.8 1.0))
(set! (-> self root scale y) (-> self root scale x))
(set! (-> self root scale z) (-> self root scale x))
0
(none)
)
(defstate enter (voicebox)
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('die)
(go-virtual exit)
)
)
)
:trans
(behavior ()
(voicebox-track)
(if (< 0.1 (-> self blend))
(point-toward-point-clear-roll-pitch! (-> self root) (target-pos 0))
)
(none)
)
:code
(behavior ()
(set-setting! *setting-control* self 'sound-flava #f 20.0 6)
(if
(and
*target*
(logtest? (-> *target* control root-prim prim-core action) 512)
)
(send-event
(ppointer->process (-> self parent-override))
'set-dist
(new 'static 'vector :z 8192.0 :w 1.0)
(new 'static 'vector :y 20480.0 :z 12288.0 :w 1.0)
)
(send-event
(ppointer->process (-> self parent-override))
'set-dist
(new 'static 'vector :z 16384.0 :w 1.0)
(new 'static 'vector :y 20480.0 :z 40960.0 :w 1.0)
)
)
(init-cam-float-seeker (-> self seeker) 1.0 0.01 0.022222223 0.1)
(set! (-> self seeker target) 0.0)
(while (< 0.0001 (-> self blend))
(update! (-> self seeker) 0.0)
(set! (-> self blend) (-> self seeker value))
(suspend)
)
(set! (-> self blend) 0.0)
(go-virtual idle)
(none)
)
:post
(the-as (function none :behavior voicebox) ja-post)
)
(defstate idle (voicebox)
:virtual #t
:event
(-> (method-of-type voicebox enter) event)
:trans
voicebox-track
:code
(behavior ()
(while #t
(suspend)
(let ((a0-0 (-> self skel root-channel 0)))
(set! (-> a0-0 param 0) 1.0)
(joint-control-channel-group-eval!
a0-0
(the-as art-joint-anim #f)
num-func-loop!
)
)
)
(none)
)
:post
(the-as (function none :behavior voicebox) ja-post)
)
(defstate exit (voicebox)
:virtual #t
:trans
voicebox-track
:code
(behavior ()
(clear-pending-settings-from-process *setting-control* self 'sound-flava)
(set! (-> self state-time) (-> *display* base-frame-counter))
(set! (-> self seeker target) 1.0)
(while
(and
(< (-> self blend) 0.9999)
(not
(and
(not (handle->process (-> self hint)))
(>= (- (-> *display* base-frame-counter) (-> self state-time)) 15)
(-> *setting-control* current hint)
)
)
)
(update! (-> self seeker) 0.0)
(set! (-> self blend) (-> self seeker value))
(suspend)
)
(set! (-> self blend) 1.0)
(send-event (ppointer->process (-> self parent-override)) 'go empty-state)
(suspend)
0
(none)
)
:post
(the-as (function none :behavior voicebox) ja-post)
)
(defbehavior voicebox-init-by-other voicebox ((arg0 vector) (arg1 handle))
(set! (-> self root) (new 'process 'trsqv))
(set! (-> self hint) arg1)
(set! (-> self root trans quad) (-> arg0 quad))
(set! (-> self base-trans quad) (-> arg0 quad))
(initialize-skeleton self *voicebox-sg* '())
(set! (-> self blend) 1.0)
(go-virtual enter)
(none)
)
(defstate cam-voicebox (camera-voicebox)
:event
(-> cam-string event)
:enter
(-> cam-string enter)
:trans
(behavior ()
(if (zero? (logand (-> *camera* master-options) 2))
(deactivate self)
)
(none)
)
:code
(-> cam-string code)
)
(defun voicebox-spawn ((arg0 process) (arg1 vector))
(with-pp
(let* ((s3-0 (get-process *camera-dead-pool* camera-voicebox #x4000))
(s4-0 (when s3-0
(let ((t9-1 (method-of-type camera-voicebox activate)))
(t9-1
(the-as camera-voicebox s3-0)
arg0
'camera-voicebox
(the-as pointer #x70004000)
)
)
(run-now-in-process s3-0 cam-slave-init cam-voicebox #f)
(-> s3-0 ppointer)
)
)
)
(when s4-0
(let ((s5-1 (get-process *default-dead-pool* voicebox #x4000)))
(when s5-1
(let ((t9-4 (method-of-type voicebox activate)))
(t9-4
(the-as voicebox s5-1)
(ppointer->process s4-0)
'voicebox
(the-as pointer #x70004000)
)
)
(run-now-in-process
s5-1
voicebox-init-by-other
arg1
(process->handle pp)
)
(-> s5-1 ppointer)
)
)
)
)
)
)
+2 -2
View File
@@ -242,7 +242,7 @@
(point-in-bounds? (_type_ vector) symbol 10)
(dummy-11 (_type_ vector) none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-13 (_type_ vector vector) vector 13) ;; see - puffer::20
(set-current-poly! (_type_ nav-poly) none 14)
(set-target-pos! (_type_ vector) none 15)
(dummy-16 (_type_ vector) nav-poly 16) ; see - nav-enemy-test-point-in-nav-mesh?
@@ -256,7 +256,7 @@
(dummy-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24)
(dummy-25 (_type_ vector float) symbol 25) ; see - nav-enemy-test-point-near-nav-mesh?
(dummy-26 (_type_) none 26)
(dummy-27 () none 27)
(dummy-27 (_type_) none 27)
(dummy-28 (_type_ int) none 28)
(should-display? (_type_) symbol 29)
(dummy-30 () none 30)
+1
View File
@@ -24,6 +24,7 @@
(bit1 1) ;; village1-part
(bit2 2) ;; cleared after an aux has its func set to add-to-sprite-aux-lst
(bit3 3)
(bit4 4) ;; see - swamp-blimp
(ready-to-launch 6) ;; maybe just just death?
(bit7 7)
(aux-list 8) ;; prevents relaunch, adds to aux
+6 -6
View File
@@ -2485,9 +2485,9 @@
(-> self control unknown-vector11)
(-> self control unknown-vector14)
)
(let ((a1-3 (new 'stack-no-clear 'collide-edge-hold-list)))
(set! (-> a1-3 num-allocs) (the-as uint 1))
(set! (-> a1-3 num-attempts) (the-as uint *touching-list*))
(let ((a1-3 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a1-3 options) (the-as uint 1))
(set! (-> a1-3 tlist) *touching-list*)
(dummy-40 (-> self control) a1-3)
)
(post-flag-setup)
@@ -2609,9 +2609,9 @@
(-> self control unknown-vector11)
(-> self control unknown-vector14)
)
(let ((a1-2 (new 'stack-no-clear 'collide-edge-hold-list)))
(set! (-> a1-2 num-allocs) (the-as uint 1))
(set! (-> a1-2 num-attempts) (the-as uint *touching-list*))
(let ((a1-2 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a1-2 options) (the-as uint 1))
(set! (-> a1-2 tlist) *touching-list*)
(dummy-40 (-> self control) a1-2)
)
(target-calc-camera-pos)
+42 -17
View File
@@ -156,12 +156,18 @@
(jungle-precursorbridge-hint #x25b)
(daxter-launcher-no-eco #x25c)
(jungle-mirrors-completion-talk-to-mayor #x25e)
(beach-gimmie #x262)
(beach-sentinel #x263)
(jungle-canyon-end #x264)
(jungle-temple-door #x265)
(misty-bike-jump #x266)
(misty-eco-challenge #x267)
(beach-seagull-chased-one #x268)
(beach-seagull-chased-two #x26a)
(beach-seagull-chased-three #x26b)
(beach-seagull-chased-four #x26c)
(misty-daxter-scared #x26f)
@@ -172,33 +178,37 @@
(beach-flutflutegg-hint #x275)
(sidekick-hint-fish-powerup #x278)
(misty-racer-hit-the-ballon-lurkers #x27e)
(misty-daxter-hit-lurkers-not-mines #x27f)
(sidekick-speech-hint-crate-darkeco1 #x281)
(beach-collectors-unblocked #x288)
(misty-stopped-lurkers-at-silo #x28a)
(misty-stopped-balloon-lurkers #x28b)
(sidekick-speech-crate-steel-break1 #x283)
(sidekick-speech-hint-crate-iron #x284)
(sidekick-speech-hint-crate-steel #x285)
(beach-collectors-unblocked #x288)
(misty-stopped-lurkers-at-silo #x28a)
(misty-stopped-balloon-lurkers #x28b)
(jungleb-eco-vents-opened #x289)
(sidekick-speech-crate-steel-break2 #x28e)
(sidekick-speech-hint-crate-darkeco2 #x28f)
(daxter-screaming-jump #x290)
(daxter-wahoo-jump #x291)
(collectables-scout-flies-red-boxes #x295)
(found-all-scout-flies #x296)
(yakow-owed-powercell #x297)
(jungle-mirrors-tutorial #x29c)
(jungle-mirrors-break-the-mirror-jak #x29d)
(jungle-mirrors-go-to-the-next-tower #x29f)
(jungle-mirrors-follow-the-beam #x2a0)
(misty-teetertotter-bonk-dax-tutorial #x2a4)
(sidekick-hint-misty-get-red-eco #x2a5)
(red-eco-tutorial #x2a6)
(daxter-blue-eco-plat-tutorial #x2a7)
(misty-bone-bridge-hint #x2aa)
@@ -211,10 +221,9 @@
(missed #x2b5)
(lose! #x2b6)
(daxter-screaming-jump #x290)
(daxter-wahoo-jump #x291)
(red-eco-tutorial #x2a6)
(village2-gambler-money #x300)
(village2-geologist-money #x301)
@@ -272,16 +281,28 @@
(sunken-take-it-easy-hot-pipes #x34e)
(sunken-double-lurker-hint #x347)
(sunken-qbert-plat-hint #x34a)
(sunken-bully-dive-hint #x34b)
(sunken-blue-eco-charger-all-hint #x34d)
(swamp-tethers-advice-hint #x352)
(kermit-break-tongue #x357)
(swamp-rats-nest-hint #x358)
(daxter-you-can-shoot-with-yellow-eco #x359)
(swamp-bats-hint #x364) ;; maybe we can ???? the bats. lol
(kermit-run-away-jak #x35f)
(swamp-bats-hint #x364) ;; maybe we can duck the bats
(swamp-tethers-three-to-go #x365)
(swamp-tethers-two-to-go #x366)
(swamp-tethers-lefts-find-the-last #x367)
(flutflut-reminder #x368)
(sage-golfclap-i-have-low-expectations #x36a) ;; where was this said?
(swamp-tethers-completion-sage-precursor-arm #x36b)
(village2-warp-gate-reminder #x36f)
(village2-warp-gate-reminder-annoyed #x370)
@@ -334,13 +355,17 @@
(snow-frozen-crate #x42b) ;; task name?
(snow-bumpers #x42c)
(dark-crystal-last-one #x432)
(daxter-maybe-you-can-shoot-better-goggles #x433)
(darkcave-light-crystal-low-light-hint #x437)
(darkcave-light-crystal-hint #x438)
(dark-crystal-run-away #x439)
(cave-trap-nest-hint #x440)
(snow-fort-reminder #x443)
(ram-boss-red-eco-hint #x444)
(ice-cube-hint #x448)
@@ -352,8 +377,8 @@
(fire-canyon-end #x500)
(fire-canyon-buzzer #x501)
(sidekick-speech-hint-firecanyon-crate-darkeco1 #x506)
(sidekick-speech-hint-firecanyon-crate-darkeco2 #x507)
(daxter-maybe-i-should-drive #x506)
(daxter-you-are-trying-to-avoid-dark-eco #x507)
(fire-canyon-level-name #x50c)