mirror of
https://github.com/open-goal/jak-project
synced 2026-08-04 17:19:49 -04:00
Jak2 decomp/hover formation (#2028)
This is a WIP while I'm learning the ins and outs of decompilation, but putting up what I have for 2 reasons: - Hoping someone can double check I'm on the right path (all functions have signatures, all reasonably safe guesses for types have been put in, using "object" for type where they're not) - Might be blocked by not being able to run the offline-tests as a PAL scrub I'm going to look at what might be involved in making tests work for PAL, but wouldn't be surprised if I have to wait to get a black label version and come back to this after :( --------- Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
This commit is contained in:
@@ -35299,25 +35299,22 @@
|
||||
;; hover-formation-h ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
#|
|
||||
(deftype form-search-info (structure)
|
||||
((form basic :offset-assert 0)
|
||||
(count int32 :offset-assert 4)
|
||||
(pos-table uint32 :offset-assert 8)
|
||||
(actor-position UNKNOWN 16 :offset-assert 16)
|
||||
(actor-valid? UNKNOWN 16 :offset-assert 272)
|
||||
(index-table UNKNOWN 16 :offset-assert 336)
|
||||
(dest-pos-table UNKNOWN 16 :offset-assert 400)
|
||||
(best-mapping UNKNOWN 16 :offset-assert 656)
|
||||
(best-cost float :offset-assert 720)
|
||||
((form uint32 :offset-assert 0)
|
||||
(count int32 :offset-assert 4)
|
||||
(pos-table (inline-array vector) :offset-assert 8)
|
||||
(actor-position vector 16 :inline :offset-assert 16)
|
||||
(actor-valid? symbol 16 :offset-assert 272)
|
||||
(index-table uint32 16 :offset-assert 336) ;; Guessing this based on other fields with this name
|
||||
(dest-pos-table vector 16 :inline :offset-assert 400)
|
||||
(best-mapping uint32 16 :offset-assert 656) ;; Guessing it's uint32 as it's 16 x 4
|
||||
(best-cost float :offset-assert 720)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x2d4
|
||||
:flag-assert #x9000002d4
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype hover-actor (structure)
|
||||
((handle uint64 :offset-assert 0)
|
||||
(offset vector :inline :offset-assert 16)
|
||||
@@ -35326,64 +35323,68 @@
|
||||
:size-assert #x20
|
||||
:flag-assert #x900000020
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
;; +++hover-formation-h:formation-type
|
||||
(defenum formation-type
|
||||
:type int64
|
||||
(unknown-0 0)
|
||||
(unknown-1 1)
|
||||
(unknown-2 2)
|
||||
(unknown-3 3)
|
||||
)
|
||||
;; ---hover-formation-h:formation-type
|
||||
|
||||
(deftype hover-formation-control (basic)
|
||||
((search-info form-search-info :inline :offset-assert 16)
|
||||
(entity basic :offset-assert 740)
|
||||
(anchor-proc uint64 :offset-assert 744)
|
||||
(actor-table UNKNOWN 16 :offset-assert 752)
|
||||
(entity entity :offset-assert 740)
|
||||
(anchor-proc handle :offset-assert 744)
|
||||
(actor-table handle 16 :offset-assert 752)
|
||||
;; NOTE These appear to be 2 different sets of flags, some functions (eg method 12 and 19) load from 884 instead
|
||||
(flags uint16 :offset-assert 880)
|
||||
(formation-type uint64 :offset-assert 888)
|
||||
(formation-type formation-type :offset-assert 888)
|
||||
(center vector :inline :offset-assert 896)
|
||||
(zone-to-world matrix :inline :offset-assert 912)
|
||||
(world-to-zone matrix :inline :offset-assert 976)
|
||||
(offset vector :inline :offset-assert 1040)
|
||||
(focus-quat quaternion :inline :offset-assert 1056)
|
||||
(notice-dist float :offset-assert 1072)
|
||||
(notice-dist meters :offset-assert 1072)
|
||||
(rotation-inc float :offset-assert 1076)
|
||||
)
|
||||
:method-count-assert 21
|
||||
:size-assert #x438
|
||||
:flag-assert #x1500000438
|
||||
(:methods
|
||||
(hover-formation-control-method-9 () none 9)
|
||||
(hover-formation-control-method-10 () none 10)
|
||||
(hover-formation-control-method-11 () none 11)
|
||||
(hover-formation-control-method-12 () none 12)
|
||||
(hover-formation-control-method-13 () none 13)
|
||||
(hover-formation-control-method-14 () none 14)
|
||||
(hover-formation-control-method-15 () none 15)
|
||||
(hover-formation-control-method-16 () none 16)
|
||||
(hover-formation-control-method-17 () none 17)
|
||||
(hover-formation-control-method-18 () none 18)
|
||||
(hover-formation-control-method-19 () none 19)
|
||||
(hover-formation-control-method-20 () none 20)
|
||||
(new (symbol type object entity float vector float handle) _type_ 0)
|
||||
(set-anchor-proc (_type_ handle) int 9)
|
||||
;; TODO This calls vector-rotate-y as its main function, check what it's rotating to rename
|
||||
(hover-formation-control-method-10 (_type_ vector vector float) symbol 10)
|
||||
(hover-formation-control-method-11 (_type_) int 11)
|
||||
;; TODO Check what the formation types are to see what this is really looking for
|
||||
(is-formation-type-in-range (_type_) symbol 12)
|
||||
(hover-formation-control-method-13 (_type_ vector) vector 13)
|
||||
(hover-formation-control-method-14 (_type_) none 14)
|
||||
(hover-formation-control-method-15 (_type_ vector vector) vector 15)
|
||||
(hover-formation-control-method-16 (_type_) object 16)
|
||||
(hover-formation-control-method-17 (_type_ process) int 17)
|
||||
(hover-formation-control-method-18 (_type_ process) int 18)
|
||||
(try-update-formation-type (_type_ formation-type) int 19)
|
||||
(hover-formation-control-method-20 (_type_ object object) none 20) ;; NOT DEFINED ANYWHERE!
|
||||
)
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype hover-formation (process)
|
||||
((formation basic :offset-assert 124)
|
||||
(path basic :offset-assert 128)
|
||||
(formation-timer uint64 :offset-assert 132)
|
||||
((formation hover-formation-control :offset-assert 128) ;; NOTE The original offset here was 124, all bumped up by 4 to match process parent
|
||||
(path path-control :offset-assert 132)
|
||||
(formation-timer uint64 :offset-assert 136)
|
||||
)
|
||||
:method-count-assert 16
|
||||
:size-assert #x90
|
||||
:flag-assert #x1000100090
|
||||
(:methods
|
||||
(hover-formation-method-9 () none 9)
|
||||
(hover-formation-method-10 () none 10)
|
||||
(hover-formation-method-11 () none 11)
|
||||
(hover-formation-method-12 () none 12)
|
||||
(hover-formation-method-13 () none 13)
|
||||
(hover-formation-method-14 () none 14)
|
||||
(hover-formation-method-15 () none 15)
|
||||
(idle () _type_ :state 14)
|
||||
(hover-formation-method-15 (_type_) int 15)
|
||||
)
|
||||
)
|
||||
|#
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
@@ -35825,7 +35826,6 @@
|
||||
;; hover-formation ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
#|
|
||||
(deftype gen-perms-context (structure)
|
||||
((num int32 :offset-assert 0)
|
||||
(table uint32 :offset-assert 4)
|
||||
@@ -35835,12 +35835,11 @@
|
||||
:size-assert #xc
|
||||
:flag-assert #x90000000c
|
||||
)
|
||||
|#
|
||||
|
||||
;; (define-extern odd? function)
|
||||
;; (define-extern even? function)
|
||||
;; (define-extern gen-perms function)
|
||||
;; (define-extern test-gen-perms function)
|
||||
(define-extern odd? (function int symbol))
|
||||
(define-extern even? (function int symbol))
|
||||
(define-extern gen-perms (function int (function int int form-search-info uint) (function form-search-info float) form-search-info symbol))
|
||||
(define-extern test-gen-perms (function int object))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; hover-nav-edit ;;
|
||||
|
||||
@@ -1164,5 +1164,11 @@
|
||||
[8, "(function none :behavior task-manager)"],
|
||||
[9, "(function none :behavior task-manager)"],
|
||||
[10, "(function none :behavior task-manager)"]
|
||||
],
|
||||
"hover-formation": [
|
||||
[10, "(function form-search-info float)"],
|
||||
[11, "(function int int form-search-info uint)"],
|
||||
[14, "(function vector object)"],
|
||||
[15, "(function int int (pointer object) int)"]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1913,5 +1913,9 @@
|
||||
[32, "vector"],
|
||||
[80, "vector"]
|
||||
],
|
||||
"(method 181 bombbot)": [[16, ["array", "collide-shape", 64]]]
|
||||
"(method 181 bombbot)": [[16, ["array", "collide-shape", 64]]],
|
||||
"test-gen-perms": [[16, "gen-perms-context"]],
|
||||
"gen-perms": [[16, "gen-perms-context"]],
|
||||
"(method 11 hover-formation-control)": [[16, ["inline-array", "vector", 16]]],
|
||||
"(method 11 hover-formation)": [[16, "vector"]]
|
||||
}
|
||||
|
||||
@@ -8956,5 +8956,17 @@
|
||||
],
|
||||
"(method 11 cas-switch)": [["_stack_", 16, "res-tag"]],
|
||||
"(method 11 cas-conveyor)": [["_stack_", 16, "res-tag"]],
|
||||
"(method 11 cas-conveyor-switch)": [["_stack_", 16, "res-tag"]]
|
||||
"(method 11 cas-conveyor-switch)": [["_stack_", 16, "res-tag"]],
|
||||
"(method 7 hover-formation)": [[19, "t9", "(function basic int basic)"]],
|
||||
"(method 11 hover-formation-control)": [[38, "s3", "process-focusable"]],
|
||||
"(method 16 hover-formation-control)": [[25, "s3", "process-focusable"]],
|
||||
"(method 13 hover-formation-control)": [
|
||||
[35, "s2", "process-focusable"],
|
||||
[16, "v0", "path-control"]
|
||||
],
|
||||
"(method 14 hover-formation-control)": [
|
||||
[37, "s4", "process-focusable"],
|
||||
[18, "v0", "path-control"]
|
||||
],
|
||||
"(method 10 hover-formation-control)": [[28, "s4", "process-focusable"]]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user