[decomp] prepare joint stuff (#594)

* [decomp] prepare `joint` stuff

* fix types

* fix a missing declaration

* update references
This commit is contained in:
ManDude 2021-06-15 04:45:21 +01:00 committed by GitHub
parent 0aa474f12b
commit 928673cd13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 334 additions and 291 deletions

View File

@ -4406,7 +4406,7 @@
)
(declare-type bsp-header basic)
(declare-type art-group basic)
(deftype level (basic)
((name basic :offset-assert 4)
(load-name basic :offset-assert 8)
@ -4416,7 +4416,7 @@
(other basic :offset-assert 24)
(heap kheap :inline :offset-assert 32)
(bsp bsp-header :offset-assert 48)
(art-group basic :offset-assert 52)
(art-group art-group :offset-assert 52)
(info basic :offset-assert 56)
(texture-page texture-page 9 :offset-assert 60)
(loaded-texture-page basic 16 :offset-assert 96)
@ -5101,7 +5101,7 @@
;; - Types
(deftype memory-usage-info (structure)
((name basic :offset-assert 0)
((name string :offset-assert 0)
(count int32 :offset-assert 4)
(used int32 :offset-assert 8)
(total int32 :offset-assert 12)
@ -5383,21 +5383,22 @@
)
(deftype cspace (structure)
((parent cspace :offset-assert 0)
(joint joint :offset-assert 4)
(joint-num int16 :offset-assert 8)
(geo basic :offset-assert 12)
(bone bone :offset-assert 16)
(param0 basic :offset-assert 20)
(param1 basic :offset-assert 24)
(param2 basic :offset-assert 28)
((parent cspace :offset-assert 0)
(joint joint :offset-assert 4)
(joint-num int16 :offset-assert 8)
(geo basic :offset-assert 12)
(bone bone :offset-assert 16)
(param0 function :offset-assert 20)
(param1 basic :offset-assert 24)
(param2 basic :offset-assert 28)
)
:method-count-assert 10
:size-assert #x20
:flag-assert #xa00000020
;; field param1 is a basic loaded with a signed load field param2 is a basic loaded with a signed load
(:methods
(dummy-9 () none 9)
(new (symbol type basic) _type_ 0)
(dummy-9 (_type_ basic) _type_ 9)
)
)
@ -6953,7 +6954,7 @@
;; - Types
(deftype joint-anim (basic)
((name basic :offset-assert 4)
((name string :offset-assert 4)
(number int16 :offset-assert 8)
(length int16 :offset-assert 10)
)
@ -6963,32 +6964,33 @@
)
(deftype joint-anim-matrix (joint-anim)
((matrix matrix :offset-assert 12)) ;; guess
;; inspect in joint
((data matrix :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(deftype joint-anim-transformq (joint-anim)
((transformq transformq :offset-assert 12)) ;; guess
;; inspect in joint
((data transformq :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
;; too many basic blocks
)
(deftype joint-anim-drawable (joint-anim)
((data uint32 :inline :dynamic :offset-assert 12) ;; guess
((data drawable :dynamic :offset-assert 12) ;; guess
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
(declare-type joint-anim-compressed-hdr structure)
(deftype joint-anim-compressed (joint-anim)
()
((data joint-anim-compressed-hdr :dynamic :offset-assert 12) ;; guess
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
@ -7053,19 +7055,22 @@
:flag-assert #x900000014
)
(declare-type res-lump basic)
(declare-type art-element basic)
(deftype art (basic)
((name basic :offset 8)
(length int32 :offset-assert 12)
(extra basic :offset-assert 16) ; possible types: [res-lump]
((name string :offset 8)
(length int32 :offset-assert 12)
(extra entity :offset-assert 16) ; possible types: [res-lump]
; this field is very strange
)
:method-count-assert 13
:size-assert #x14
:flag-assert #xd00000014
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-9 (_type_) _type_ 9)
(dummy-10 (_type_ string type) art-element 10)
(dummy-11 (_type_ string type) int 11)
(dummy-12 (_type_) symbol 12)
)
)
@ -7075,10 +7080,10 @@
:size-assert #x20
:flag-assert #xd00000020
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-9 (_type_) _type_ 9)
(dummy-10 (_type_ string type) art-element 10)
(dummy-11 (_type_ string type) int 11)
(dummy-12 (_type_) symbol 12)
)
)
@ -7091,45 +7096,48 @@
(deftype art-joint-anim (art-element)
;; figured out manually from custom inspect.
((speed float :offset 20)
((_unknown (pointer int16) :offset 4) ;; no clue. used in mem-usage
(speed float :offset 20)
(artist-base float :offset 24)
(artist-step float :offset 28)
(master-art-group-name basic :offset 32)
(master-art-group-name string :offset 32)
(master-art-group-index int32 :offset 36)
(frames pointer :offset 44)
(data joint-anim-compressed :dynamic)
(frames pointer :offset 44) ;; this structure doesn't exist? it's a structure with an array of joint-anim-compressed-hdr starting at offset 12
(data joint-anim-compressed :dynamic :offset-assert 48)
)
;; inspect in joint
:method-count-assert 13
:size-assert #x30
:flag-assert #xd00000030
)
(deftype art-group (art)
((pad2 uint8 12))
;; inspect in join
((info file-info :offset 4)
(data art-element :dynamic :offset 32)
)
:method-count-assert 15
:size-assert #x20
:flag-assert #xf00000020
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-9 (_type_) _type_ 9)
(dummy-10 (_type_ string type) art-element 10)
(dummy-11 (_type_ string type) int 11)
(dummy-12 (_type_) symbol 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
)
)
(deftype art-mesh-geo (art-element)
()
((data basic :dynamic :offset-assert 32)
)
:method-count-assert 13
:size-assert #x20
:flag-assert #xd00000020
)
(deftype art-joint-geo (art-element)
()
((data joint :dynamic :offset-assert 32)
)
:method-count-assert 13
:size-assert #x20
:flag-assert #xd00000020
@ -7190,7 +7198,7 @@
(global-effect uint8 :offset-assert 7)
(art-group art-group :offset-assert 8)
(jgeo art-joint-geo :offset-assert 12)
(mgeo art-mesh-geo :offset-assert 16)
(mgeo merc-ctrl :offset-assert 16)
(dma-add-func function :offset-assert 20)
(skeleton skeleton-group :offset-assert 24)
(lod-set lod-set :inline :offset-assert 28)
@ -7574,12 +7582,6 @@
:method-count-assert 13
:size-assert #x70
:flag-assert #xd00000070
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
)
)
(deftype merc-vu1-low-mem (structure)
@ -8705,12 +8707,12 @@
(declare-type joint-control basic)
(deftype joint-control-channel (structure)
((parent joint-control :offset-assert 0)
(command basic :offset-assert 4)
(command symbol :offset-assert 4)
(frame-interp float :offset-assert 8)
(frame-group art-joint-anim :offset-assert 12)
(frame-num float :offset-assert 16)
(num-func basic :offset-assert 20)
(param uint32 2 :offset-assert 24)
(num-func (function joint-control-channel float float float) :offset-assert 20)
(param float 2 :offset-assert 24)
(group-sub-index int16 :offset-assert 32)
(group-size int16 :offset-assert 34)
(dist float :offset-assert 36) ;; meters
@ -8721,14 +8723,14 @@
:size-assert #x30
:flag-assert #xa00000030
(:methods
(dummy-9 () none 9)
(dummy-9 (_type_) _type_ 9)
)
)
(deftype joint-control (basic)
((status uint16 :offset-assert 4)
(allocated-length int16 :offset-assert 6)
(root-channel uint32 :offset 16)
(root-channel joint-control-channel :offset 16)
(blend-index int32 :offset-assert 20)
(active-channels int32 :offset-assert 24)
(generate-frame-function basic :offset-assert 28)
@ -8736,13 +8738,13 @@
(postbind-function basic :offset-assert 36)
(effect basic :offset-assert 40)
(channel joint-control-channel 3 :inline :offset-assert 48) ;; actually dynamic?
(frame-group0 basic :offset 60)
(frame-group0 art-joint-anim :offset 60)
(frame-num0 float :offset 64)
(frame-interp0 float :offset 56)
(frame-group1 basic :offset 108)
(frame-group1 art-joint-anim :offset 108)
(frame-num1 float :offset 112)
(frame-interp1 float :offset 104)
(frame-group2 basic :offset 156)
(frame-group2 art-joint-anim :offset 156)
(frame-num2 float :offset 160)
(frame-interp2 float :offset 152)
)
@ -8750,8 +8752,9 @@
:size-assert #xc0
:flag-assert #xb000000c0
(:methods
(new (symbol type int) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-10 (_type_ symbol) int 10)
)
)
@ -8781,9 +8784,9 @@
(deftype joint-work (structure)
((temp-mtx matrix :inline :offset-assert 0)
(joint-stack matrix-stack :inline :offset-assert 64)
(fix-jmp-table uint32 16 :offset-assert 1616)
(frm-jmp-table uint32 16 :offset-assert 1680)
(pair-jmp-table uint32 16 :offset-assert 1744)
(fix-jmp-table (function none) 16 :offset-assert 1616)
(frm-jmp-table (function none) 16 :offset-assert 1680)
(pair-jmp-table (function none) 16 :offset-assert 1744)
(uploads channel-upload-info 24 :inline :offset-assert 1808)
(num-uploads int32 :offset-assert 2384)
(mtx-acc matrix 2 :inline :offset-assert 2400)
@ -9352,20 +9355,21 @@
;; - Types
(declare-type water-control basic)
(deftype process-drawable (process)
((root trsqv :offset-assert 112)
(node-list cspace-array :offset-assert 116)
(draw draw-control :offset-assert 120)
(skel basic :offset-assert 124)
(node-list cspace-array :offset-assert 116)
(draw draw-control :offset-assert 120)
(skel joint-control :offset-assert 124)
(nav basic :offset-assert 128)
(align basic :offset-assert 132)
(align align-control :offset-assert 132)
(path basic :offset-assert 136)
(vol basic :offset-assert 140)
(fact basic :offset-assert 144)
(fact fact-info :offset-assert 144)
(link basic :offset-assert 148)
(part basic :offset-assert 152)
(water basic :offset-assert 156)
(sound basic :offset-assert 160)
(water water-control :offset-assert 156)
(sound ambient-sound :offset-assert 160)
(state-flags uint32 :offset-assert 164)
(state-time uint64 :offset-assert 168)
)
@ -14562,36 +14566,36 @@
;; - Symbols
(define-extern flatten-joint-control-to-spr function)
(define-extern make-joint-jump-tables function)
(define-extern calc-animation-from-spr function)
(define-extern decompress-fixed-data-to-accumulator function)
(define-extern decompress-frame-data-to-accumulator function)
(define-extern decompress-frame-data-pair-to-accumulator function)
(define-extern matrix-from-control! function)
(define-extern matrix-from-control-channel! function)
(define-extern matrix-from-control-pair! function)
(define-extern matrix-from-joint-anim-frame function)
(define-extern create-interpolated-joint-animation-frame function)
(define-extern mem-size function)
(define-extern jacc-mem-usage function)
(define-extern joint-anim-inspect-elt function)
(define-extern joint-anim-login function)
(define-extern joint-control-channel-eval function)
(define-extern joint-control-channel-eval! function)
(define-extern joint-control-channel-group-eval! function)
(define-extern joint-control-channel-group! function)
(define-extern joint-control-copy! function)
(define-extern joint-control-remap! function)
(define-extern cspace<-cspace! function)
(define-extern cspace<-rot-yxy! function)
(define-extern cspace<-transform-yxy! function)
(define-extern cspace<-transformq+trans! function)
(define-extern cspace<-transformq+world-trans! function)
(define-extern cspace-calc-total-matrix! function)
(define-extern cspace<-matrix-no-push-joint! function)
(define-extern cspace<-matrix-joint! function)
(define-extern cspace<-parented-matrix-joint! function)
(define-extern flatten-joint-control-to-spr (function joint-control int))
(define-extern make-joint-jump-tables (function int))
(define-extern calc-animation-from-spr (function joint-control int int))
(define-extern decompress-fixed-data-to-accumulator (function none))
(define-extern decompress-frame-data-to-accumulator (function none))
(define-extern decompress-frame-data-pair-to-accumulator (function none))
(define-extern matrix-from-control! (function matrix-stack joint matrix symbol matrix))
(define-extern matrix-from-control-channel! (function matrix joint joint-control-channel matrix))
(define-extern matrix-from-control-pair! (function matrix matrix joint matrix))
(define-extern matrix-from-joint-anim-frame (function pointer int int matrix)) ;; ???
(define-extern create-interpolated-joint-animation-frame (function joint-control int process-drawable int))
(define-extern mem-size (function basic symbol int int))
(define-extern jacc-mem-usage (function pointer memory-usage-block int int))
(define-extern joint-anim-inspect-elt (function joint-anim float int))
(define-extern joint-anim-login (function joint-anim-drawable joint-anim-drawable))
(define-extern joint-control-channel-eval (function joint-control-channel float))
(define-extern joint-control-channel-eval! (function joint-control-channel (function joint-control-channel float float float) float))
(define-extern joint-control-channel-group-eval! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int))
(define-extern joint-control-channel-group! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int))
(define-extern joint-control-copy! (function joint-control joint-control joint-control))
(define-extern joint-control-remap! (function joint-control art-group art-group pair int string object))
(define-extern cspace<-cspace! (function cspace cspace matrix))
(define-extern cspace<-rot-yxy! function) ;; unused
(define-extern cspace<-transform-yxy! function) ;; unused
(define-extern cspace<-transformq+trans! (function cspace transformq vector matrix))
(define-extern cspace<-transformq+world-trans! (function cspace transformq vector matrix))
(define-extern cspace-calc-total-matrix! (function cspace matrix matrix))
(define-extern cspace<-matrix-no-push-joint! (function cspace matrix matrix))
(define-extern cspace<-matrix-joint! (function cspace matrix matrix))
(define-extern cspace<-parented-matrix-joint! (function cspace matrix matrix))
(define-extern clear-frame-accumulator function)
(define-extern normalize-frame-quaternions function)

View File

@ -548,6 +548,11 @@
"vol-h": [
["L13", "float", true]
],
"joint": [
["L330", "float", true],
["L329", "float", true]
],
"assert-h": [
["L4", "__assert-info-private-struct", true]

View File

@ -609,6 +609,12 @@
[22, "f0", "float"],
[28, "f0", "float"]
],
"joint-anim-inspect-elt": [
[9, "gp", "joint-anim-matrix"],
[26, "gp", "joint-anim-transformq"]
],
"(method 12 art-group)": [[13, "a0", "art-joint-anim"]],
"(method 0 path-control)": [
[15, "t9", "(function string none)"],

View File

@ -7,59 +7,60 @@
(declare-type joint-control basic)
(deftype joint-control-channel (structure)
((parent joint-control :offset-assert 0)
(command basic :offset-assert 4)
(frame-interp float :offset-assert 8)
(frame-group art-joint-anim :offset-assert 12)
(frame-num float :offset-assert 16)
(num-func basic :offset-assert 20)
(param uint32 2 :offset-assert 24)
(group-sub-index int16 :offset-assert 32)
(group-size int16 :offset-assert 34)
(dist float :offset-assert 36)
(eval-time uint32 :offset-assert 40)
(inspector-amount float :offset-assert 44)
((parent joint-control :offset-assert 0)
(command symbol :offset-assert 4)
(frame-interp float :offset-assert 8)
(frame-group art-joint-anim :offset-assert 12)
(frame-num float :offset-assert 16)
(num-func (function joint-control-channel float float float) :offset-assert 20)
(param float 2 :offset-assert 24)
(group-sub-index int16 :offset-assert 32)
(group-size int16 :offset-assert 34)
(dist float :offset-assert 36) ;; meters
(eval-time uint32 :offset-assert 40)
(inspector-amount float :offset-assert 44)
)
:method-count-assert 10
:size-assert #x30
:flag-assert #xa00000030
(:methods
(dummy-9 () none 9)
(dummy-9 (_type_) _type_ 9)
)
)
(deftype joint-control (basic)
((status uint16 :offset-assert 4)
(allocated-length int16 :offset-assert 6)
(root-channel uint32 :offset 16)
(blend-index int32 :offset-assert 20)
(active-channels int32 :offset-assert 24)
(generate-frame-function basic :offset-assert 28)
(prebind-function basic :offset-assert 32)
(postbind-function basic :offset-assert 36)
(effect basic :offset-assert 40)
(channel joint-control-channel 3 :inline :offset-assert 48)
(frame-group0 basic :offset 60)
(frame-num0 float :offset 64)
(frame-interp0 float :offset 56)
(frame-group1 basic :offset 108)
(frame-num1 float :offset 112)
(frame-interp1 float :offset 104)
(frame-group2 basic :offset 156)
(frame-num2 float :offset 160)
(frame-interp2 float :offset 152)
((status uint16 :offset-assert 4)
(allocated-length int16 :offset-assert 6)
(root-channel joint-control-channel :offset 16)
(blend-index int32 :offset-assert 20)
(active-channels int32 :offset-assert 24)
(generate-frame-function basic :offset-assert 28)
(prebind-function basic :offset-assert 32)
(postbind-function basic :offset-assert 36)
(effect basic :offset-assert 40)
(channel joint-control-channel 3 :inline :offset-assert 48) ;; actually dynamic?
(frame-group0 art-joint-anim :offset 60)
(frame-num0 float :offset 64)
(frame-interp0 float :offset 56)
(frame-group1 art-joint-anim :offset 108)
(frame-num1 float :offset 112)
(frame-interp1 float :offset 104)
(frame-group2 art-joint-anim :offset 156)
(frame-num2 float :offset 160)
(frame-interp2 float :offset 152)
)
:method-count-assert 11
:size-assert #xc0
:flag-assert #xb000000c0
(:methods
(new (symbol type int) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-10 (_type_ symbol) int 10)
)
)
(deftype matrix-stack (structure)
((top matrix :offset-assert 0)
((top matrix :offset-assert 0)
(data matrix 24 :inline :offset-assert 16)
)
:method-count-assert 9
@ -82,18 +83,20 @@
)
(deftype joint-work (structure)
((temp-mtx matrix :inline :offset-assert 0)
(joint-stack matrix-stack :inline :offset-assert 64)
(fix-jmp-table uint32 16 :offset-assert 1616)
(frm-jmp-table uint32 16 :offset-assert 1680)
(pair-jmp-table uint32 16 :offset-assert 1744)
(uploads channel-upload-info 24 :inline :offset-assert 1808)
(num-uploads int32 :offset-assert 2384)
(mtx-acc matrix 2 :inline :offset-assert 2400)
(tq-acc transformq 100 :inline :offset-assert 2528)
(jacp-hdr joint-anim-compressed-hdr :inline :offset-assert 7328)
(fixed-data joint-anim-compressed-fixed :inline :offset-assert 7392)
(frame-data joint-anim-compressed-frame 2 :inline :offset-assert 9600)
((temp-mtx matrix :inline :offset-assert 0)
(joint-stack matrix-stack :inline :offset-assert 64)
(fix-jmp-table (function none) 16 :offset-assert 1616)
(frm-jmp-table (function none) 16 :offset-assert 1680)
(pair-jmp-table (function none) 16 :offset-assert 1744)
(uploads channel-upload-info 24 :inline :offset-assert 1808)
(num-uploads int32 :offset-assert 2384)
(mtx-acc matrix 2 :inline :offset-assert 2400)
(tq-acc transformq 100 :inline :offset-assert 2528)
(jacp-hdr joint-anim-compressed-hdr :inline :offset-assert 7328)
(fixed-data joint-anim-compressed-fixed :inline :offset-assert 7392)
(frame-data joint-anim-compressed-frame 2 :inline :offset-assert 9600)
;(flatten-array UNKNOWN 576 :offset-assert 2400) no clue!
;(flattened UNKNOWN 24 :offset-assert 2400) no clue!
)
:method-count-assert 9
:size-assert #x3640

View File

@ -47,21 +47,22 @@
(set! (-> skeleton heap-base) 96)
(deftype cspace (structure)
((parent cspace :offset-assert 0)
(joint joint :offset-assert 4)
(joint-num int16 :offset-assert 8)
(geo basic :offset-assert 12)
(bone bone :offset-assert 16)
(param0 basic :offset-assert 20)
(param1 basic :offset-assert 24)
(param2 basic :offset-assert 28)
((parent cspace :offset-assert 0)
(joint joint :offset-assert 4)
(joint-num int16 :offset-assert 8)
(geo basic :offset-assert 12)
(bone bone :offset-assert 16)
(param0 function :offset-assert 20)
(param1 basic :offset-assert 24)
(param2 basic :offset-assert 28)
)
:method-count-assert 10
:size-assert #x20
:flag-assert #xa00000020
;; params are loaded with signed loads.
(:methods
(dummy-9 () none 9)
(new (symbol type basic) _type_ 0)
(dummy-9 (_type_ basic) _type_ 9)
)
)

View File

@ -6,7 +6,7 @@
;; dgos: GAME, ENGINE
(deftype joint-anim (basic)
((name basic :offset-assert 4)
((name string :offset-assert 4)
(number int16 :offset-assert 8)
(length int16 :offset-assert 10)
)
@ -16,32 +16,33 @@
)
(deftype joint-anim-matrix (joint-anim)
((matrix matrix :offset-assert 12)) ;; guess
;; inspect in joint
((data matrix :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(deftype joint-anim-transformq (joint-anim)
((transformq transformq :offset-assert 12)) ;; guess
;; inspect in joint
((data transformq :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
;; too many basic blocks
)
(deftype joint-anim-drawable (joint-anim)
((data uint32 :inline :dynamic :offset-assert 12) ;; guess
((data drawable :dynamic :offset-assert 12) ;; guess
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
(declare-type joint-anim-compressed-hdr structure)
(deftype joint-anim-compressed (joint-anim)
()
((data joint-anim-compressed-hdr :dynamic :offset-assert 12) ;; guess
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
@ -117,19 +118,21 @@
:flag-assert #x900000014
)
(declare-type art-element basic)
(declare-type entity basic)
(deftype art (basic)
((name basic :offset 8)
(length int32 :offset-assert 12)
(extra basic :offset-assert 16)
((name string :offset 8)
(length int32 :offset-assert 12)
(extra entity :offset-assert 16)
)
:method-count-assert 13
:size-assert #x14
:flag-assert #xd00000014
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-9 (_type_) _type_ 9)
(dummy-10 (_type_ string type) art-element 10)
(dummy-11 (_type_ string type) int 11)
(dummy-12 (_type_) symbol 12)
)
)
@ -139,10 +142,10 @@
:size-assert #x20
:flag-assert #xd00000020
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-9 (_type_) _type_ 9)
(dummy-10 (_type_ string type) art-element 10)
(dummy-11 (_type_ string type) int 11)
(dummy-12 (_type_) symbol 12)
)
)
@ -155,22 +158,23 @@
(deftype art-joint-anim (art-element)
;; figured out manually from custom inspect.
((speed float :offset 20)
((_unknown (pointer int16) :offset 4) ;; no clue. used in mem-usage
(speed float :offset 20)
(artist-base float :offset 24)
(artist-step float :offset 28)
(master-art-group-name basic :offset 32)
(master-art-group-name string :offset 32)
(master-art-group-index int32 :offset 36)
(frames pointer :offset 44)
(data joint-anim-compressed :dynamic)
)
;; inspect in joint
:method-count-assert 13
:size-assert #x30
:flag-assert #xd00000030
)
(deftype art-group (art)
((pad2 uint8 12 :offset-assert 20)
((info file-info :offset 4)
(data art-element :dynamic :offset 32)
)
:method-count-assert 15
:size-assert #x20
@ -182,14 +186,16 @@
)
(deftype art-mesh-geo (art-element)
()
((data basic :dynamic :offset-assert 32)
)
:method-count-assert 13
:size-assert #x20
:flag-assert #xd00000020
)
(deftype art-joint-geo (art-element)
()
((data joint :dynamic :offset-assert 32)
)
:method-count-assert 13
:size-assert #x20
:flag-assert #xd00000020
@ -250,7 +256,7 @@
(global-effect uint8 :offset-assert 7)
(art-group art-group :offset-assert 8)
(jgeo art-joint-geo :offset-assert 12)
(mgeo art-mesh-geo :offset-assert 16)
(mgeo merc-ctrl :offset-assert 16)
(dma-add-func function :offset-assert 20)
(skeleton skeleton-group :offset-assert 24)
(lod-set lod-set :inline :offset-assert 28)

View File

@ -6,7 +6,7 @@
;; dgos: GAME, ENGINE
(deftype memory-usage-info (structure)
((name basic :offset-assert 0)
((name string :offset-assert 0)
(count int32 :offset-assert 4)
(used int32 :offset-assert 8)
(total int32 :offset-assert 12)

View File

@ -6,22 +6,23 @@
;; dgos: GAME, ENGINE
(declare-type water-control basic)
(deftype process-drawable (process)
((root trsqv :offset-assert 112)
(node-list cspace-array :offset-assert 116)
(draw draw-control :offset-assert 120)
(skel basic :offset-assert 124)
(nav basic :offset-assert 128)
(align basic :offset-assert 132)
(path basic :offset-assert 136)
(vol basic :offset-assert 140)
(fact basic :offset-assert 144)
(link basic :offset-assert 148)
(part basic :offset-assert 152)
(water basic :offset-assert 156)
(sound basic :offset-assert 160)
(state-flags uint32 :offset-assert 164)
(state-time uint64 :offset-assert 168)
((root trsqv :offset-assert 112)
(node-list cspace-array :offset-assert 116)
(draw draw-control :offset-assert 120)
(skel joint-control :offset-assert 124)
(nav basic :offset-assert 128)
(align align-control :offset-assert 132)
(path basic :offset-assert 136)
(vol basic :offset-assert 140)
(fact fact-info :offset-assert 144)
(link basic :offset-assert 148)
(part basic :offset-assert 152)
(water water-control :offset-assert 156)
(sound ambient-sound :offset-assert 160)
(state-flags uint32 :offset-assert 164)
(state-time uint64 :offset-assert 168)
)
:heap-base #x40
:method-count-assert 20

View File

@ -290,12 +290,6 @@
:method-count-assert 13
:size-assert #x70
:flag-assert #xd00000070
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
)
)
(deftype merc-vu1-low-mem (structure)

View File

@ -122,6 +122,7 @@
)
(declare-type bsp-header basic)
(declare-type art-group basic)
;; Per level-buffer info about the current loaded level.
(deftype level (basic)
((name basic :offset-assert 4)
@ -132,18 +133,22 @@
(other basic :offset-assert 24)
(heap kheap :inline :offset-assert 32)
(bsp bsp-header :offset-assert 48)
(art-group basic :offset-assert 52)
(art-group art-group :offset-assert 52)
(info basic :offset-assert 56)
(texture-page texture-page 9 :offset-assert 60)
(loaded-texture-page basic 16 :offset-assert 96)
(loaded-texture-page basic 16 :offset-assert 96)
(loaded-texture-page-count int32 :offset-assert 160)
(foreground-sink-group dma-foreground-sink-group 3 :inline :offset-assert 176) ;; inline basic, todo check stride.
(foreground-draw-engine basic 3 :offset-assert 272)
; (foreground-sink-group-0 dma-foreground-sink-group :inline :offset-assert 176)
; (foreground-sink-group-1 dma-foreground-sink-group :inline :offset-assert 208)
; (foreground-sink-group-2 dma-foreground-sink-group :inline :offset-assert 240)
; (array-pad uint8 12)
(foreground-sink-group dma-foreground-sink-group 3 :inline :offset-assert 176) ;; inline basic
(foreground-draw-engine basic 3 :offset-assert 272)
(entity basic :offset-assert 284)
(ambient basic :offset-assert 288)
(closest-object float 9 :offset-assert 292)
(upload-size int32 9 :offset-assert 328)
(level-distance float :offset-assert 364) ; meters
(closest-object float 9 :offset-assert 292)
(upload-size int32 9 :offset-assert 328)
(level-distance float :offset-assert 364) ; meters
(inside-sphere? basic :offset-assert 368)
(inside-boxes? basic :offset-assert 372)
(display? basic :offset-assert 376)
@ -157,12 +162,12 @@
(vis-info level-vis-info 8 :offset-assert 408)
(vis-self-index int32 :offset-assert 440)
(vis-adj-index int32 :offset-assert 444)
(vis-buffer uint8 2048 :offset-assert 448)
(vis-buffer uint8 2048 :offset-assert 448)
(mem-usage-block basic :offset-assert 2496)
(mem-usage int32 :offset-assert 2500)
(code-memory-start uint32 :offset-assert 2504)
(code-memory-end uint32 :offset-assert 2508)
(texture-mask uint32 9 :offset-assert 2512)
(texture-mask uint32 9 :offset-assert 2512)
(force-inside? basic :offset-assert 2548)
(pad uint8 56)
)

View File

@ -6,8 +6,8 @@
;; dgos: GAME, ENGINE
(define *sound-player-rpc* (new 'global 'rpc-buffer-pair (the-as uint 80) (the-as uint 128) RPC-SOUND-PLAYER))
(define *sound-loader-rpc* (new 'global 'rpc-buffer-pair (the-as uint 80) (the-as uint 1) RPC-SOUND-LOADER))
(define *sound-player-rpc* (new 'global 'rpc-buffer-pair (the uint (size-of sound-rpc-union)) (the-as uint 128) RPC-SOUND-PLAYER))
(define *sound-loader-rpc* (new 'global 'rpc-buffer-pair (the uint (size-of sound-rpc-union)) (the-as uint 1) RPC-SOUND-LOADER))
(defun sound-name= ((arg0 sound-name) (arg1 sound-name))
"Return #t if both are the same name"
@ -87,7 +87,7 @@
(let ((cmd (the sound-rpc-get-irx-version (add-element *sound-loader-rpc*))))
(set! (-> cmd command) (sound-command get-irx-version))
(set! (-> cmd ee-addr) (&-> *sound-iop-info* frame))
(call *sound-loader-rpc* (the-as uint 0) (the-as pointer cmd) (the-as uint 80))
(call *sound-loader-rpc* (the-as uint 0) (the-as pointer cmd) (the uint (size-of sound-rpc-union)))
(sync *sound-loader-rpc* #f)
(format 0 "IRX version ~D.~D~%" (-> cmd major) (-> cmd minor))
@ -529,10 +529,10 @@
(set! name (string->sound-name (symbol->string bc)))
(set! sound-times (res-lump-data (the entity src) 'cycle-speed (pointer float)))
(set! spec *ambient-spec*)
(let ((sv-64 (new 'static 'res-tag)))
(swhen (res-lump-data-exact (the entity src) 'effect-param sound-play-parms :tag-ptr (& sv-64))
(let ((tag (new 'static 'res-tag)))
(swhen (res-lump-data-exact (the entity src) 'effect-param sound-play-parms :tag-ptr (& tag))
(set! params bc)
(set! param-count (the int (-> sv-64 elt-count)))
(set! param-count (the int (-> tag elt-count)))
)
)
)
@ -634,7 +634,7 @@
(-> pp name)
(-> spec sound-name-char))
(format #t "volume: ~f pitch-mod: ~f~%"
(* 0.09765625 (the float (-> spec volume)))
(* (1/ 10.24) (the float (-> spec volume)))
(* 0.000656168 (the float (-> spec pitch-mod))))
)
)

View File

@ -0,0 +1,6 @@
@echo off
cd ..\..
out\build\Release\bin\offline-test --dump-mode iso_data\jak1\
scripts\update_decomp_reference.py failures\ test\decompiler\reference\
RMDIR /Q/S failures
pause

View File

@ -1,4 +1,4 @@
@echo off
cd ..\..
out\build\Release\bin\offline-test iso_data\jak1\
out\build\Release\bin\offline-test --dump-mode iso_data\jak1\
pause

View File

@ -1061,6 +1061,11 @@
)
)
(define-extern *progress-process* (pointer progress))
(declare-type art-element basic)
(declare-type water-control basic)
(declare-type joint-anim-compressed-hdr structure)
(define-extern entity-by-name (function string entity))
(define-extern entity-by-aid (function uint entity))

View File

@ -3,24 +3,24 @@
;; definition of type joint-control-channel
(deftype joint-control-channel (structure)
((parent joint-control :offset-assert 0)
(command basic :offset-assert 4)
(frame-interp float :offset-assert 8)
(frame-group art-joint-anim :offset-assert 12)
(frame-num float :offset-assert 16)
(num-func basic :offset-assert 20)
(param uint32 2 :offset-assert 24)
(group-sub-index int16 :offset-assert 32)
(group-size int16 :offset-assert 34)
(dist float :offset-assert 36)
(eval-time uint32 :offset-assert 40)
(inspector-amount float :offset-assert 44)
((parent joint-control :offset-assert 0)
(command symbol :offset-assert 4)
(frame-interp float :offset-assert 8)
(frame-group art-joint-anim :offset-assert 12)
(frame-num float :offset-assert 16)
(num-func (function joint-control-channel float float float) :offset-assert 20)
(param float 2 :offset-assert 24)
(group-sub-index int16 :offset-assert 32)
(group-size int16 :offset-assert 34)
(dist float :offset-assert 36)
(eval-time uint32 :offset-assert 40)
(inspector-amount float :offset-assert 44)
)
:method-count-assert 10
:size-assert #x30
:flag-assert #xa00000030
(:methods
(dummy-9 () none 9)
(dummy-9 (_type_) _type_ 9)
)
)
@ -46,7 +46,7 @@
(deftype joint-control (basic)
((status uint16 :offset-assert 4)
(allocated-length int16 :offset-assert 6)
(root-channel uint32 :offset 16)
(root-channel joint-control-channel :offset 16)
(blend-index int32 :offset-assert 20)
(active-channels int32 :offset-assert 24)
(generate-frame-function basic :offset-assert 28)
@ -54,13 +54,13 @@
(postbind-function basic :offset-assert 36)
(effect basic :offset-assert 40)
(channel joint-control-channel 3 :inline :offset-assert 48)
(frame-group0 basic :offset 60)
(frame-group0 art-joint-anim :offset 60)
(frame-num0 float :offset 64)
(frame-interp0 float :offset 56)
(frame-group1 basic :offset 108)
(frame-group1 art-joint-anim :offset 108)
(frame-num1 float :offset 112)
(frame-interp1 float :offset 104)
(frame-group2 basic :offset 156)
(frame-group2 art-joint-anim :offset 156)
(frame-num2 float :offset 160)
(frame-interp2 float :offset 152)
)
@ -68,8 +68,9 @@
:size-assert #xc0
:flag-assert #xb000000c0
(:methods
(new (symbol type int) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-10 (_type_ symbol) int 10)
)
)
@ -147,9 +148,9 @@
(deftype joint-work (structure)
((temp-mtx matrix :inline :offset-assert 0)
(joint-stack matrix-stack :inline :offset-assert 64)
(fix-jmp-table uint32 16 :offset-assert 1616)
(frm-jmp-table uint32 16 :offset-assert 1680)
(pair-jmp-table uint32 16 :offset-assert 1744)
(fix-jmp-table (function none) 16 :offset-assert 1616)
(frm-jmp-table (function none) 16 :offset-assert 1680)
(pair-jmp-table (function none) 16 :offset-assert 1744)
(uploads channel-upload-info 24 :inline :offset-assert 1808)
(num-uploads int32 :offset-assert 2384)
(mtx-acc matrix 2 :inline :offset-assert 2400)

View File

@ -89,20 +89,21 @@
;; definition of type cspace
(deftype cspace (structure)
((parent cspace :offset-assert 0)
(joint joint :offset-assert 4)
(joint-num int16 :offset-assert 8)
(geo basic :offset-assert 12)
(bone bone :offset-assert 16)
(param0 basic :offset-assert 20)
(param1 basic :offset-assert 24)
(param2 basic :offset-assert 28)
((parent cspace :offset-assert 0)
(joint joint :offset-assert 4)
(joint-num int16 :offset-assert 8)
(geo basic :offset-assert 12)
(bone bone :offset-assert 16)
(param0 function :offset-assert 20)
(param1 basic :offset-assert 24)
(param2 basic :offset-assert 28)
)
:method-count-assert 10
:size-assert #x20
:flag-assert #xa00000020
(:methods
(dummy-9 () none 9)
(new (symbol type basic) _type_ 0)
(dummy-9 (_type_ basic) _type_ 9)
)
)

View File

@ -3,9 +3,9 @@
;; definition of type joint-anim
(deftype joint-anim (basic)
((name basic :offset-assert 4)
(number int16 :offset-assert 8)
(length int16 :offset-assert 10)
((name string :offset-assert 4)
(number int16 :offset-assert 8)
(length int16 :offset-assert 10)
)
:method-count-assert 9
:size-assert #xc
@ -23,7 +23,7 @@
;; definition of type joint-anim-matrix
(deftype joint-anim-matrix (joint-anim)
((matrix matrix :offset-assert 12)
((data matrix :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
@ -32,7 +32,7 @@
;; definition of type joint-anim-transformq
(deftype joint-anim-transformq (joint-anim)
((transformq transformq :offset-assert 12)
((data transformq :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
@ -41,7 +41,7 @@
;; definition of type joint-anim-drawable
(deftype joint-anim-drawable (joint-anim)
((data uint32 :inline :dynamic :offset-assert 12)
((data drawable :dynamic :offset-assert 12)
)
:method-count-assert 9
:size-assert #xc
@ -60,7 +60,8 @@
;; definition of type joint-anim-compressed
(deftype joint-anim-compressed (joint-anim)
()
((data joint-anim-compressed-hdr :dynamic :offset-assert 12)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
@ -219,18 +220,18 @@
;; definition of type art
(deftype art (basic)
((name basic :offset 8)
(length int32 :offset-assert 12)
(extra basic :offset-assert 16)
((name string :offset 8)
(length int32 :offset-assert 12)
(extra entity :offset-assert 16)
)
:method-count-assert 13
:size-assert #x14
:flag-assert #xd00000014
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-9 (_type_) _type_ 9)
(dummy-10 (_type_ string type) art-element 10)
(dummy-11 (_type_ string type) int 11)
(dummy-12 (_type_) symbol 12)
)
)
@ -271,10 +272,11 @@
;; definition of type art-joint-anim
(deftype art-joint-anim (art-element)
((speed float :offset 20)
((_unknown (pointer int16) :offset 4)
(speed float :offset 20)
(artist-base float :offset 24)
(artist-step float :offset 28)
(master-art-group-name basic :offset 32)
(master-art-group-name string :offset 32)
(master-art-group-index int32 :offset 36)
(frames pointer :offset 44)
(data joint-anim-compressed :dynamic :offset-assert 48)
@ -286,7 +288,8 @@
;; definition of type art-group
(deftype art-group (art)
((pad2 uint8 12 :offset-assert 20)
((info file-info :offset 4)
(data art-element :dynamic :offset 32)
)
:method-count-assert 15
:size-assert #x20
@ -299,7 +302,8 @@
;; definition of type art-mesh-geo
(deftype art-mesh-geo (art-element)
()
((data basic :dynamic :offset-assert 32)
)
:method-count-assert 13
:size-assert #x20
:flag-assert #xd00000020
@ -307,7 +311,8 @@
;; definition of type art-joint-geo
(deftype art-joint-geo (art-element)
()
((data joint :dynamic :offset-assert 32)
)
:method-count-assert 13
:size-assert #x20
:flag-assert #xd00000020
@ -403,7 +408,7 @@
(global-effect uint8 :offset-assert 7)
(art-group art-group :offset-assert 8)
(jgeo art-joint-geo :offset-assert 12)
(mgeo art-mesh-geo :offset-assert 16)
(mgeo merc-ctrl :offset-assert 16)
(dma-add-func function :offset-assert 20)
(skeleton skeleton-group :offset-assert 24)
(lod-set lod-set :inline :offset-assert 28)

View File

@ -5,10 +5,10 @@
(when *debug-segment*
;; definition of type memory-usage-info
(deftype memory-usage-info (structure)
((name basic :offset-assert 0)
(count int32 :offset-assert 4)
(used int32 :offset-assert 8)
(total int32 :offset-assert 12)
((name string :offset-assert 0)
(count int32 :offset-assert 4)
(used int32 :offset-assert 8)
(total int32 :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10

View File

@ -47,7 +47,7 @@
((allocation symbol) (type-to-make type) (arg0 process-drawable))
(cond
(((method-of-type res-lump get-property-struct)
(the-as res-lump (-> arg0 draw jgeo extra))
(-> arg0 draw jgeo extra)
'effect-name
'interp
-1000000000.0

View File

@ -3,21 +3,21 @@
;; definition of type process-drawable
(deftype process-drawable (process)
((root trsqv :offset-assert 112)
(node-list cspace-array :offset-assert 116)
(draw draw-control :offset-assert 120)
(skel basic :offset-assert 124)
(nav basic :offset-assert 128)
(align basic :offset-assert 132)
(path basic :offset-assert 136)
(vol basic :offset-assert 140)
(fact basic :offset-assert 144)
(link basic :offset-assert 148)
(part basic :offset-assert 152)
(water basic :offset-assert 156)
(sound basic :offset-assert 160)
(state-flags uint32 :offset-assert 164)
(state-time uint64 :offset-assert 168)
((root trsqv :offset-assert 112)
(node-list cspace-array :offset-assert 116)
(draw draw-control :offset-assert 120)
(skel joint-control :offset-assert 124)
(nav basic :offset-assert 128)
(align align-control :offset-assert 132)
(path basic :offset-assert 136)
(vol basic :offset-assert 140)
(fact fact-info :offset-assert 144)
(link basic :offset-assert 148)
(part basic :offset-assert 152)
(water water-control :offset-assert 156)
(sound ambient-sound :offset-assert 160)
(state-flags uint32 :offset-assert 164)
(state-time uint64 :offset-assert 168)
)
:heap-base #x40
:method-count-assert 20

View File

@ -147,7 +147,7 @@
(other basic :offset-assert 24)
(heap kheap :inline :offset-assert 32)
(bsp bsp-header :offset-assert 48)
(art-group basic :offset-assert 52)
(art-group art-group :offset-assert 52)
(info basic :offset-assert 56)
(texture-page texture-page 9 :offset-assert 60)
(loaded-texture-page basic 16 :offset-assert 96)