mirror of
https://github.com/open-goal/jak-project
synced 2026-09-08 03:46:51 -04:00
[Decompile] file-io, loader-h, texture-h, level-h, math-camera-h (#397)
* file-io and loader-h * add test for level-h * math camera-h
This commit is contained in:
@@ -292,3 +292,23 @@
|
||||
;; vector
|
||||
;; only because trig isn't in the reference yet.
|
||||
(define-extern deg-lerp-clamp (function float float float float))
|
||||
|
||||
;; file-io
|
||||
(defenum file-kind
|
||||
:bitfield #f
|
||||
(level-bt 0) ;; aka bsp-header.
|
||||
(art-group 1)
|
||||
(tpage 2)
|
||||
(dir-tpage 3)
|
||||
(level-vs 4)
|
||||
(tx 5)
|
||||
(vis 6)
|
||||
)
|
||||
|
||||
;; loader-h
|
||||
(declare-type art-group basic)
|
||||
|
||||
;; level-h
|
||||
(declare-type entity-links structure)
|
||||
(declare-type level-group basic)
|
||||
(define-extern *level* level-group)
|
||||
@@ -0,0 +1,217 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type file-stream
|
||||
(deftype file-stream (basic)
|
||||
((flags uint32 :offset-assert 4)
|
||||
(mode basic :offset-assert 8)
|
||||
(name string :offset-assert 12)
|
||||
(file uint32 :offset-assert 16)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x14
|
||||
:flag-assert #x900000014
|
||||
(:methods
|
||||
(new (symbol type string basic) _type_ 0)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type file-stream
|
||||
(defmethod inspect file-stream ((obj file-stream))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tflags: #x~X~%" (-> obj flags))
|
||||
(format #t "~Tmode: ~A~%" (-> obj mode))
|
||||
(format #t "~Tname: ~A~%" (-> obj name))
|
||||
(format #t "~Tfile: ~D~%" (-> obj file))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 0 of type file-stream
|
||||
(defmethod
|
||||
new
|
||||
file-stream
|
||||
((allocation symbol) (type-to-make type) (arg0 string) (arg1 basic))
|
||||
(let
|
||||
((a0-1
|
||||
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
|
||||
)
|
||||
)
|
||||
(file-stream-open a0-1 arg0 arg1)
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> file-stream method-table 4) file-stream-length)
|
||||
|
||||
;; definition for function file-stream-read-string
|
||||
(defun file-stream-read-string ((arg0 file-stream) (arg1 string))
|
||||
(clear arg1)
|
||||
(file-stream-read arg0 (-> arg1 data) (length arg0))
|
||||
arg1
|
||||
)
|
||||
|
||||
;; definition of type file-info
|
||||
(deftype file-info (basic)
|
||||
((file-type symbol :offset-assert 4)
|
||||
(file-name basic :offset-assert 8)
|
||||
(major-version uint32 :offset-assert 12)
|
||||
(minor-version uint32 :offset-assert 16)
|
||||
(maya-file-name basic :offset-assert 20)
|
||||
(tool-debug basic :offset-assert 24)
|
||||
(mdb-file-name basic :offset-assert 28)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x20
|
||||
:flag-assert #x900000020
|
||||
)
|
||||
|
||||
;; definition for method 3 of type file-info
|
||||
(defmethod inspect file-info ((obj file-info))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tfile-type: ~A~%" (-> obj file-type))
|
||||
(format #t "~Tfile-name: ~A~%" (-> obj file-name))
|
||||
(format #t "~Tmajor-version: ~D~%" (-> obj major-version))
|
||||
(format #t "~Tminor-version: ~D~%" (-> obj minor-version))
|
||||
(format #t "~Tmaya-file-name: ~A~%" (-> obj maya-file-name))
|
||||
(format #t "~Ttool-debug: ~A~%" (-> obj tool-debug))
|
||||
(format #t "~Tmdb-file-name: ~A~%" (-> obj mdb-file-name))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 2 of type file-info
|
||||
(defmethod print file-info ((obj file-info))
|
||||
(format
|
||||
#t
|
||||
"#<~A ~A :version ~D.~D @ #x~X>"
|
||||
(-> obj type)
|
||||
(-> obj file-name)
|
||||
(-> obj major-version)
|
||||
(-> obj minor-version)
|
||||
obj
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for symbol *file-temp-string*, type string
|
||||
(define *file-temp-string* (new 'global 'string 128 (the-as string #f)))
|
||||
|
||||
;; definition for function make-file-name
|
||||
(defun make-file-name ((kind file-kind) (name string) (art-group-version int))
|
||||
(clear *file-temp-string*)
|
||||
(cond
|
||||
((= kind (file-kind dir-tpage))
|
||||
(format *file-temp-string* "texture-page~D/dir-tpages" 7)
|
||||
)
|
||||
((= kind (file-kind tpage))
|
||||
(format *file-temp-string* "texture-page~D/tpage-~S" 7 name)
|
||||
)
|
||||
((zero? kind)
|
||||
(format *file-temp-string* "level~D/~S-bt" 30 name)
|
||||
)
|
||||
((= kind (file-kind tx))
|
||||
(format *file-temp-string* "res~D/~S-tx" 1 name)
|
||||
)
|
||||
((= kind (file-kind level-vs))
|
||||
(format *file-temp-string* "level~D/~S-vs" 30 name)
|
||||
)
|
||||
((= kind (file-kind vis))
|
||||
(format *file-temp-string* "~S.VIS" name)
|
||||
)
|
||||
((= kind (file-kind art-group))
|
||||
(format *file-temp-string* "art-group~D/~S-ag" (cond
|
||||
((> art-group-version 0)
|
||||
(empty)
|
||||
art-group-version
|
||||
)
|
||||
(else
|
||||
6
|
||||
)
|
||||
)
|
||||
name
|
||||
)
|
||||
)
|
||||
)
|
||||
*file-temp-string*
|
||||
)
|
||||
|
||||
;; definition for function make-vfile-name
|
||||
(defun make-vfile-name ((kind file-kind) (name string))
|
||||
(clear *file-temp-string*)
|
||||
(cond
|
||||
((zero? kind)
|
||||
(format *file-temp-string* "$LEVEL/~S" name)
|
||||
)
|
||||
((= kind (file-kind art-group))
|
||||
(format *file-temp-string* "$ART_GROUP/~S" name)
|
||||
)
|
||||
)
|
||||
*file-temp-string*
|
||||
)
|
||||
|
||||
;; definition for function file-info-correct-version?
|
||||
(defun
|
||||
file-info-correct-version?
|
||||
((info file-info) (kind file-kind) (version-override int))
|
||||
(let* ((expected-version (if (zero? version-override)
|
||||
(let ((v1-0 kind))
|
||||
(cond
|
||||
((or
|
||||
(= v1-0 (file-kind tpage))
|
||||
(= v1-0 (file-kind dir-tpage))
|
||||
)
|
||||
7
|
||||
)
|
||||
((zero? v1-0)
|
||||
30
|
||||
)
|
||||
((= v1-0 (file-kind art-group))
|
||||
6
|
||||
)
|
||||
)
|
||||
)
|
||||
version-override
|
||||
)
|
||||
)
|
||||
(v1-1 kind)
|
||||
(kind-name (cond
|
||||
((= v1-1 (file-kind tpage))
|
||||
"texture-page"
|
||||
)
|
||||
((zero? v1-1)
|
||||
"bsp-header"
|
||||
)
|
||||
((= v1-1 (file-kind art-group))
|
||||
"art-group"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((not (name= (the-as basic (-> info file-type value)) kind-name))
|
||||
(format
|
||||
0
|
||||
"ERROR: file ~A is of type ~S but needs to be ~S.~%"
|
||||
(-> info file-name)
|
||||
(-> info file-type)
|
||||
kind-name
|
||||
)
|
||||
#f
|
||||
)
|
||||
((!= expected-version (-> info major-version))
|
||||
(format
|
||||
0
|
||||
"ERROR: file ~A is version ~D.~D, but needs to be ~D.x~%"
|
||||
(-> info file-name)
|
||||
(-> info major-version)
|
||||
(-> info minor-version)
|
||||
expected-version
|
||||
)
|
||||
#f
|
||||
)
|
||||
(else
|
||||
#t
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -0,0 +1,508 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type level-vis-info
|
||||
(deftype level-vis-info (basic)
|
||||
((level basic :offset-assert 4)
|
||||
(from-level basic :offset-assert 8)
|
||||
(from-bsp basic :offset-assert 12)
|
||||
(flags uint32 :offset-assert 16)
|
||||
(length uint32 :offset-assert 20)
|
||||
(allocated-length uint32 :offset-assert 24)
|
||||
(dictionary-length uint32 :offset-assert 28)
|
||||
(dictionary uint32 :offset-assert 32)
|
||||
(string-block uint32 :offset-assert 36)
|
||||
(ramdisk uint32 :offset-assert 40)
|
||||
(vis-bits uint32 :offset-assert 44)
|
||||
(current-vis-string uint32 :offset-assert 48)
|
||||
(vis-string uint8 :dynamic :offset-assert 52)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x34
|
||||
:flag-assert #x900000034
|
||||
)
|
||||
|
||||
;; definition for method 3 of type level-vis-info
|
||||
(defmethod inspect level-vis-info ((obj level-vis-info))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tlevel: ~A~%" (-> obj level))
|
||||
(format #t "~Tfrom-level: ~A~%" (-> obj from-level))
|
||||
(format #t "~Tfrom-bsp: ~A~%" (-> obj from-bsp))
|
||||
(format #t "~Tflags: #x~X~%" (-> obj flags))
|
||||
(format #t "~Tlength: ~D~%" (-> obj length))
|
||||
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
|
||||
(format #t "~Tdictionary-length: ~D~%" (-> obj dictionary-length))
|
||||
(format #t "~Tdictionary: #x~X~%" (-> obj dictionary))
|
||||
(format #t "~Tstring-block: #x~X~%" (-> obj string-block))
|
||||
(format #t "~Tramdisk: ~D~%" (-> obj ramdisk))
|
||||
(format #t "~Tvis-bits: #x~X~%" (-> obj vis-bits))
|
||||
(format #t "~Tcurrent-vis-string: ~D~%" (-> obj current-vis-string))
|
||||
(format #t "~Tvis-string[0] @ #x~X~%" (-> obj vis-string))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 5 of type level-vis-info
|
||||
;; INFO: Return type mismatch uint vs int.
|
||||
(defmethod asize-of level-vis-info ((obj level-vis-info))
|
||||
(the-as int (+ (-> level-vis-info size) (-> obj dictionary-length)))
|
||||
)
|
||||
|
||||
;; definition of type level-load-info
|
||||
(deftype level-load-info (basic)
|
||||
((name-list basic 3 :offset-assert 4)
|
||||
(index int32 :offset-assert 16)
|
||||
(name basic :offset 4)
|
||||
(visname basic :offset 8)
|
||||
(nickname basic :offset 12)
|
||||
(packages pair :offset-assert 20)
|
||||
(sound-banks pair :offset-assert 24)
|
||||
(music-bank basic :offset-assert 28)
|
||||
(ambient-sounds pair :offset-assert 32)
|
||||
(mood basic :offset-assert 36)
|
||||
(mood-func basic :offset-assert 40)
|
||||
(ocean basic :offset-assert 44)
|
||||
(sky basic :offset-assert 48)
|
||||
(sun-fade float :offset-assert 52)
|
||||
(continues pair :offset-assert 56)
|
||||
(tasks pair :offset-assert 60)
|
||||
(priority int32 :offset-assert 64)
|
||||
(load-commands pair :offset-assert 68)
|
||||
(alt-load-commands pair :offset-assert 72)
|
||||
(bsp-mask uint64 :offset-assert 80)
|
||||
(bsphere sphere :offset-assert 88)
|
||||
(buzzer int32 :offset-assert 92)
|
||||
(bottom-height float :offset-assert 96)
|
||||
(run-packages pair :offset-assert 100)
|
||||
(prev-level basic :offset-assert 104)
|
||||
(next-level basic :offset-assert 108)
|
||||
(wait-for-load basic :offset-assert 112)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x74
|
||||
:flag-assert #x900000074
|
||||
)
|
||||
|
||||
;; definition for method 3 of type level-load-info
|
||||
(defmethod inspect level-load-info ((obj level-load-info))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tname-list[3] @ #x~X~%" (-> obj name-list))
|
||||
(format #t "~Tindex: ~D~%" (-> obj index))
|
||||
(format #t "~Tname: ~A~%" (-> obj name-list 0))
|
||||
(format #t "~Tvisname: ~A~%" (-> obj name-list 1))
|
||||
(format #t "~Tnickname: ~A~%" (-> obj name-list 2))
|
||||
(format #t "~Tpackages: ~A~%" (-> obj packages))
|
||||
(format #t "~Tsound-banks: ~A~%" (-> obj sound-banks))
|
||||
(format #t "~Tmusic-bank: ~A~%" (-> obj music-bank))
|
||||
(format #t "~Tambient-sounds: ~A~%" (-> obj ambient-sounds))
|
||||
(format #t "~Tmood: ~A~%" (-> obj mood))
|
||||
(format #t "~Tmood-func: ~A~%" (-> obj mood-func))
|
||||
(format #t "~Tocean: ~A~%" (-> obj ocean))
|
||||
(format #t "~Tsky: ~A~%" (-> obj sky))
|
||||
(format #t "~Tsun-fade: ~f~%" (-> obj sun-fade))
|
||||
(format #t "~Tcontinues: ~A~%" (-> obj continues))
|
||||
(format #t "~Ttasks: ~A~%" (-> obj tasks))
|
||||
(format #t "~Tpriority: ~D~%" (-> obj priority))
|
||||
(format #t "~Tload-commands: ~A~%" (-> obj load-commands))
|
||||
(format #t "~Talt-load-commands: ~A~%" (-> obj alt-load-commands))
|
||||
(format #t "~Tbsp-mask: ~D~%" (-> obj bsp-mask))
|
||||
(format #t "~Tbsphere: #<sphere @ #x~X>~%" (-> obj bsphere))
|
||||
(format #t "~Tbuzzer: ~D~%" (-> obj buzzer))
|
||||
(format #t "~Tbottom-height: (meters ~m)~%" (-> obj bottom-height))
|
||||
(format #t "~Trun-packages: ~A~%" (-> obj run-packages))
|
||||
(format #t "~Tprev-level: ~A~%" (-> obj prev-level))
|
||||
(format #t "~Tnext-level: ~A~%" (-> obj next-level))
|
||||
(format #t "~Twait-for-load: ~A~%" (-> obj wait-for-load))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type login-state
|
||||
(deftype login-state (basic)
|
||||
((state int32 :offset-assert 4)
|
||||
(pos uint32 :offset-assert 8)
|
||||
(elts uint32 :offset-assert 12)
|
||||
(elt uint32 16 :offset-assert 16)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x50
|
||||
:flag-assert #x900000050
|
||||
)
|
||||
|
||||
;; definition for method 3 of type login-state
|
||||
(defmethod inspect login-state ((obj login-state))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tstate: ~D~%" (-> obj state))
|
||||
(format #t "~Tpos: ~D~%" (-> obj pos))
|
||||
(format #t "~Telts: ~D~%" (-> obj elts))
|
||||
(format #t "~Telt[16] @ #x~X~%" (-> obj elt))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type level
|
||||
(deftype level (basic)
|
||||
((name basic :offset-assert 4)
|
||||
(load-name basic :offset-assert 8)
|
||||
(nickname basic :offset-assert 12)
|
||||
(index int32 :offset-assert 16)
|
||||
(status basic :offset-assert 20)
|
||||
(other basic :offset-assert 24)
|
||||
(heap kheap :inline :offset-assert 32)
|
||||
(bsp basic :offset-assert 48)
|
||||
(art-group basic :offset-assert 52)
|
||||
(info basic :offset-assert 56)
|
||||
(texture-page basic 9 :offset-assert 60)
|
||||
(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)
|
||||
(foreground-draw-engine basic 3 :offset-assert 272)
|
||||
(entity basic :offset-assert 284)
|
||||
(ambient basic :offset-assert 288)
|
||||
(closest-object basic 9 :offset-assert 292)
|
||||
(upload-size uint32 9 :offset-assert 328)
|
||||
(level-distance float :offset-assert 364)
|
||||
(inside-sphere? basic :offset-assert 368)
|
||||
(inside-boxes? basic :offset-assert 372)
|
||||
(display? basic :offset-assert 376)
|
||||
(meta-inside? basic :offset-assert 380)
|
||||
(mood basic :offset-assert 384)
|
||||
(mood-func basic :offset-assert 388)
|
||||
(vis-bits uint32 :offset-assert 392)
|
||||
(all-visible? basic :offset-assert 396)
|
||||
(force-all-visible? basic :offset-assert 400)
|
||||
(linking basic :offset-assert 404)
|
||||
(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)
|
||||
(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)
|
||||
(force-inside? basic :offset-assert 2548)
|
||||
(pad uint8 56 :offset-assert 2552)
|
||||
)
|
||||
:method-count-assert 29
|
||||
:size-assert #xa30
|
||||
:flag-assert #x1d00000a30
|
||||
(: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)
|
||||
(dummy-27 () none 27)
|
||||
(dummy-28 () none 28)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type level
|
||||
(defmethod inspect level ((obj level))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tname: ~A~%" (-> obj name))
|
||||
(format #t "~Tload-name: ~A~%" (-> obj load-name))
|
||||
(format #t "~Tnickname: ~A~%" (-> obj nickname))
|
||||
(format #t "~Tindex: ~D~%" (-> obj index))
|
||||
(format #t "~Tstatus: ~A~%" (-> obj status))
|
||||
(format #t "~Tother: ~A~%" (-> obj other))
|
||||
(format #t "~Theap: #<kheap @ #x~X>~%" (-> obj heap))
|
||||
(format #t "~Tbsp: ~A~%" (-> obj bsp))
|
||||
(format #t "~Tart-group: ~A~%" (-> obj art-group))
|
||||
(format #t "~Tinfo: ~A~%" (-> obj info))
|
||||
(format #t "~Ttexture-page[9] @ #x~X~%" (-> obj texture-page))
|
||||
(format #t "~Tloaded-texture-page[16] @ #x~X~%" (-> obj loaded-texture-page))
|
||||
(format
|
||||
#t
|
||||
"~Tloaded-texture-page-count: ~D~%"
|
||||
(-> obj loaded-texture-page-count)
|
||||
)
|
||||
(format
|
||||
#t
|
||||
"~Tforeground-sink-group[3] @ #x~X~%"
|
||||
(-> obj foreground-sink-group)
|
||||
)
|
||||
(format
|
||||
#t
|
||||
"~Tforeground-draw-engine[3] @ #x~X~%"
|
||||
(-> obj foreground-draw-engine)
|
||||
)
|
||||
(format #t "~Tentity: ~A~%" (-> obj entity))
|
||||
(format #t "~Tambient: ~A~%" (-> obj ambient))
|
||||
(format #t "~Tclosest-object[9] @ #x~X~%" (-> obj closest-object))
|
||||
(format #t "~Tupload-size[9] @ #x~X~%" (-> obj upload-size))
|
||||
(format #t "~Tlevel-distance: (meters ~m)~%" (-> obj level-distance))
|
||||
(format #t "~Tinside-sphere?: ~A~%" (-> obj inside-sphere?))
|
||||
(format #t "~Tinside-boxes?: ~A~%" (-> obj inside-boxes?))
|
||||
(format #t "~Tdisplay?: ~A~%" (-> obj display?))
|
||||
(format #t "~Tmeta-inside?: ~A~%" (-> obj meta-inside?))
|
||||
(format #t "~Tmood: ~A~%" (-> obj mood))
|
||||
(format #t "~Tmood-func: ~A~%" (-> obj mood-func))
|
||||
(format #t "~Tvis-bits: #x~X~%" (-> obj vis-bits))
|
||||
(format #t "~Tall-visible?: ~A~%" (-> obj all-visible?))
|
||||
(format #t "~Tforce-all-visible?: ~A~%" (-> obj force-all-visible?))
|
||||
(format #t "~Tlinking: ~A~%" (-> obj linking))
|
||||
(format #t "~Tvis-info[8] @ #x~X~%" (-> obj vis-info))
|
||||
(format #t "~Tvis-self-index: ~D~%" (-> obj vis-self-index))
|
||||
(format #t "~Tvis-adj-index: ~D~%" (-> obj vis-adj-index))
|
||||
(format #t "~Tvis-buffer[2048] @ #x~X~%" (-> obj vis-buffer))
|
||||
(format #t "~Tmem-usage-block: ~A~%" (-> obj mem-usage-block))
|
||||
(format #t "~Tmem-usage: ~D~%" (-> obj mem-usage))
|
||||
(format #t "~Tcode-memory-start: #x~X~%" (-> obj code-memory-start))
|
||||
(format #t "~Tcode-memory-end: #x~X~%" (-> obj code-memory-end))
|
||||
(format #t "~Ttexture-mask[9] @ #x~X~%" (-> obj texture-mask))
|
||||
(format #t "~Tforce-inside?: ~A~%" (-> obj force-inside?))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type level-group
|
||||
(deftype level-group (basic)
|
||||
((length int32 :offset-assert 4)
|
||||
(unknown-field-1 basic :offset-assert 8)
|
||||
(unknown-field-2 basic :offset-assert 12)
|
||||
(entity-link entity-links :offset 16)
|
||||
(border? basic :offset-assert 20)
|
||||
(vis? basic :offset-assert 24)
|
||||
(want-level basic :offset-assert 28)
|
||||
(receiving-level basic :offset-assert 32)
|
||||
(load-commands pair :offset-assert 36)
|
||||
(play? basic :offset-assert 40)
|
||||
(hack-pad uint8 :offset 90)
|
||||
(level0 level :inline :offset-assert 96)
|
||||
(level1 level :inline :offset-assert 2704)
|
||||
(level-default level :inline :offset-assert 5312)
|
||||
(level level 3 :inline :offset 96)
|
||||
(pad uint32 :offset-assert 7920)
|
||||
)
|
||||
:method-count-assert 27
|
||||
:size-assert #x1ef4
|
||||
:flag-assert #x1b00001ef4
|
||||
(: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)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type level-group
|
||||
(defmethod inspect level-group ((obj level-group))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tlength: ~D~%" (-> obj length))
|
||||
(format #t "~Tentity-link: ~`entity-links`P~%" (-> obj entity-link))
|
||||
(format #t "~Tborder?: ~A~%" (-> obj border?))
|
||||
(format #t "~Tvis?: ~A~%" (-> obj vis?))
|
||||
(format #t "~Twant-level: ~A~%" (-> obj want-level))
|
||||
(format #t "~Treceiving-level: ~A~%" (-> obj receiving-level))
|
||||
(format #t "~Tload-commands: ~A~%" (-> obj load-commands))
|
||||
(format #t "~Tplay?: ~A~%" (-> obj play?))
|
||||
(format #t "~Tlevel[3] @ #x~X~%" (-> obj level0))
|
||||
(format #t "~Tdata[3] @ #x~X~%" (-> obj level0))
|
||||
(format #t "~Tlevel0: ~`level`P~%" (-> obj level0))
|
||||
(format #t "~Tlevel1: ~`level`P~%" (-> obj level1))
|
||||
(format #t "~Tlevel-default: ~`level`P~%" (-> obj level-default))
|
||||
obj
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(if (zero? *level*)
|
||||
(set!
|
||||
*level*
|
||||
(new 'static 'level-group
|
||||
:length 2
|
||||
:unknown-field-1 #f
|
||||
:unknown-field-2 #f
|
||||
:entity-link #f
|
||||
:border? #f
|
||||
:want-level #f
|
||||
:load-commands '()
|
||||
:play? #f
|
||||
:level0
|
||||
(new 'static 'level
|
||||
:name #f
|
||||
:status 'inactive
|
||||
:foreground-sink-group
|
||||
(new 'static 'inline-array dma-foreground-sink-group 3
|
||||
(new 'static 'dma-foreground-sink-group
|
||||
:sink
|
||||
(new 'static 'array dma-foreground-sink 3
|
||||
(new 'static 'dma-foreground-sink :bucket 10)
|
||||
(new 'static 'generic-dma-foreground-sink
|
||||
:bucket 11
|
||||
:foreground-output-bucket 1
|
||||
)
|
||||
)
|
||||
)
|
||||
(new 'static 'dma-foreground-sink-group
|
||||
:sink
|
||||
(new 'static 'array dma-foreground-sink 3
|
||||
(new 'static 'dma-foreground-sink :bucket 49 :foreground-texture-page 1)
|
||||
(new 'static 'generic-dma-foreground-sink
|
||||
:bucket 50
|
||||
:foreground-texture-page 1
|
||||
:foreground-output-bucket 1
|
||||
)
|
||||
)
|
||||
)
|
||||
(new 'static 'dma-foreground-sink-group
|
||||
:sink
|
||||
(new 'static 'array dma-foreground-sink 3
|
||||
(new 'static 'dma-foreground-sink :bucket 58 :foreground-texture-page 2)
|
||||
(new 'static 'generic-dma-foreground-sink
|
||||
:bucket 59
|
||||
:foreground-texture-page 2
|
||||
:foreground-output-bucket 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
:inside-sphere? #f
|
||||
:inside-boxes? #f
|
||||
:force-inside? #f
|
||||
)
|
||||
:level1
|
||||
(new 'static 'level
|
||||
:name #f
|
||||
:index 1
|
||||
:status 'inactive
|
||||
:foreground-sink-group
|
||||
(new 'static 'inline-array dma-foreground-sink-group 3
|
||||
(new 'static 'dma-foreground-sink-group
|
||||
:sink
|
||||
(new 'static 'array dma-foreground-sink 3
|
||||
(new 'static 'dma-foreground-sink
|
||||
:bucket 17
|
||||
:foreground-texture-level 1
|
||||
)
|
||||
(new 'static 'generic-dma-foreground-sink
|
||||
:bucket 18
|
||||
:foreground-texture-level 1
|
||||
:foreground-output-bucket 1
|
||||
)
|
||||
)
|
||||
)
|
||||
(new 'static 'dma-foreground-sink-group
|
||||
:sink
|
||||
(new 'static 'array dma-foreground-sink 3
|
||||
(new 'static 'dma-foreground-sink
|
||||
:bucket 52
|
||||
:foreground-texture-page 1
|
||||
:foreground-texture-level 1
|
||||
)
|
||||
(new 'static 'generic-dma-foreground-sink
|
||||
:bucket 53
|
||||
:foreground-texture-page 1
|
||||
:foreground-texture-level 1
|
||||
:foreground-output-bucket 1
|
||||
)
|
||||
)
|
||||
)
|
||||
(new 'static 'dma-foreground-sink-group
|
||||
:sink
|
||||
(new 'static 'array dma-foreground-sink 3
|
||||
(new 'static 'dma-foreground-sink
|
||||
:bucket 61
|
||||
:foreground-texture-page 2
|
||||
:foreground-texture-level 1
|
||||
)
|
||||
(new 'static 'generic-dma-foreground-sink
|
||||
:bucket 62
|
||||
:foreground-texture-page 2
|
||||
:foreground-texture-level 1
|
||||
:foreground-output-bucket 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
:inside-sphere? #f
|
||||
:inside-boxes? #f
|
||||
:force-inside? #f
|
||||
)
|
||||
:level-default
|
||||
(new 'static 'level
|
||||
:name 'default
|
||||
:index 2
|
||||
:status 'reserved
|
||||
:foreground-sink-group
|
||||
(new 'static 'inline-array dma-foreground-sink-group 3
|
||||
(new 'static 'dma-foreground-sink-group
|
||||
:sink
|
||||
(new 'static 'array dma-foreground-sink 3
|
||||
(new 'static 'dma-foreground-sink
|
||||
:bucket 45
|
||||
:foreground-texture-level 2
|
||||
)
|
||||
(new 'static 'generic-dma-foreground-sink
|
||||
:bucket 46
|
||||
:foreground-texture-level 2
|
||||
:foreground-output-bucket 1
|
||||
)
|
||||
)
|
||||
)
|
||||
(new 'static 'dma-foreground-sink-group
|
||||
:sink
|
||||
(new 'static 'array dma-foreground-sink 3
|
||||
(new 'static 'dma-foreground-sink
|
||||
:bucket 55
|
||||
:foreground-texture-page 1
|
||||
:foreground-texture-level 2
|
||||
)
|
||||
(new 'static 'generic-dma-foreground-sink
|
||||
:bucket 56
|
||||
:foreground-texture-page 1
|
||||
:foreground-texture-level 2
|
||||
:foreground-output-bucket 1
|
||||
)
|
||||
)
|
||||
)
|
||||
(new 'static 'dma-foreground-sink-group
|
||||
:sink
|
||||
(new 'static 'array dma-foreground-sink 3
|
||||
(new 'static 'dma-foreground-sink
|
||||
:bucket 58
|
||||
:foreground-texture-page 2
|
||||
:foreground-texture-level 2
|
||||
)
|
||||
(new 'static 'generic-dma-foreground-sink
|
||||
:bucket 59
|
||||
:foreground-texture-page 2
|
||||
:foreground-texture-level 2
|
||||
:foreground-output-bucket 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
:inside-sphere? #f
|
||||
:inside-boxes? #f
|
||||
:force-inside? #f
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,280 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type load-dir
|
||||
(deftype load-dir (basic)
|
||||
((unknown basic :offset-assert 4)
|
||||
(string-array (array string) :offset-assert 8)
|
||||
(data-array (array basic) :offset-assert 12)
|
||||
)
|
||||
:method-count-assert 11
|
||||
:size-assert #x10
|
||||
:flag-assert #xb00000010
|
||||
(:methods
|
||||
(new (symbol type int basic) _type_ 0)
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type load-dir-art-group
|
||||
(deftype load-dir-art-group (load-dir)
|
||||
()
|
||||
:method-count-assert 11
|
||||
:size-assert #x10
|
||||
:flag-assert #xb00000010
|
||||
(:methods
|
||||
(new (symbol type int basic) _type_ 0)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 0 of type load-dir
|
||||
(defmethod
|
||||
new
|
||||
load-dir
|
||||
((allocation symbol) (type-to-make type) (length int) (unk basic))
|
||||
(let
|
||||
((obj
|
||||
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
|
||||
)
|
||||
)
|
||||
(set! (-> obj unknown) unk)
|
||||
(set!
|
||||
(-> obj string-array)
|
||||
(the-as
|
||||
(array string)
|
||||
((method-of-type array new) allocation array string length)
|
||||
)
|
||||
)
|
||||
(set! (-> obj string-array length) 0)
|
||||
(set!
|
||||
(-> obj data-array)
|
||||
(the-as
|
||||
(array basic)
|
||||
((method-of-type array new) allocation array basic length)
|
||||
)
|
||||
)
|
||||
(set! (-> obj data-array length) 0)
|
||||
obj
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 0 of type load-dir-art-group
|
||||
;; INFO: Return type mismatch load-dir vs load-dir-art-group.
|
||||
(defmethod
|
||||
new
|
||||
load-dir-art-group
|
||||
((allocation symbol) (type-to-make type) (length int) (unk basic))
|
||||
(let
|
||||
((obj ((method-of-type load-dir new) allocation type-to-make length unk)))
|
||||
(set! (-> obj data-array content-type) art-group)
|
||||
(the-as load-dir-art-group obj)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type external-art-buffer
|
||||
(deftype external-art-buffer (basic)
|
||||
((index int32 :offset-assert 4)
|
||||
(other external-art-buffer :offset-assert 8)
|
||||
(status basic :offset-assert 12)
|
||||
(locked? basic :offset-assert 16)
|
||||
(frame-lock basic :offset-assert 20)
|
||||
(heap kheap :inline :offset-assert 32)
|
||||
(pending-load-file basic :offset-assert 48)
|
||||
(pending-load-file-part int32 :offset-assert 52)
|
||||
(pending-load-file-owner uint64 :offset-assert 56)
|
||||
(pending-load-file-priority float :offset-assert 64)
|
||||
(load-file basic :offset-assert 68)
|
||||
(load-file-part int32 :offset-assert 72)
|
||||
(load-file-owner uint64 :offset-assert 80)
|
||||
(load-file-priority float :offset-assert 88)
|
||||
(buf uint32 :offset-assert 92)
|
||||
(len int32 :offset-assert 96)
|
||||
(art-group basic :offset-assert 100)
|
||||
)
|
||||
:method-count-assert 16
|
||||
:size-assert #x68
|
||||
:flag-assert #x1000000068
|
||||
(:methods
|
||||
(new (symbol type int) _type_ 0)
|
||||
(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)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type external-art-buffer
|
||||
(defmethod inspect external-art-buffer ((obj external-art-buffer))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tindex: ~D~%" (-> obj index))
|
||||
(format #t "~Tother: ~A~%" (-> obj other))
|
||||
(format #t "~Tstatus: ~A~%" (-> obj status))
|
||||
(format #t "~Tlocked?: ~A~%" (-> obj locked?))
|
||||
(format #t "~Tframe-lock: ~A~%" (-> obj frame-lock))
|
||||
(format #t "~Theap: #<kheap @ #x~X>~%" (-> obj heap))
|
||||
(format #t "~Tpending-load-file: ~A~%" (-> obj pending-load-file))
|
||||
(format #t "~Tpending-load-file-part: ~D~%" (-> obj pending-load-file-part))
|
||||
(format #t "~Tpending-load-file-owner: ~D~%" (-> obj pending-load-file-owner))
|
||||
(format
|
||||
#t
|
||||
"~Tpending-load-file-priority: ~f~%"
|
||||
(-> obj pending-load-file-priority)
|
||||
)
|
||||
(format #t "~Tload-file: ~A~%" (-> obj load-file))
|
||||
(format #t "~Tload-file-part: ~D~%" (-> obj load-file-part))
|
||||
(format #t "~Tload-file-owner: ~D~%" (-> obj load-file-owner))
|
||||
(format #t "~Tload-file-priority: ~f~%" (-> obj load-file-priority))
|
||||
(format #t "~Tbuf: #x~X~%" (-> obj buf))
|
||||
(format #t "~Tlen: ~D~%" (-> obj len))
|
||||
(format #t "~Tart-group: ~A~%" (-> obj art-group))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 0 of type external-art-buffer
|
||||
(defmethod
|
||||
new
|
||||
external-art-buffer
|
||||
((allocation symbol) (type-to-make type) (idx int))
|
||||
(let
|
||||
((obj
|
||||
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
|
||||
)
|
||||
)
|
||||
(set! (-> obj index) idx)
|
||||
(set! (-> obj load-file) #f)
|
||||
(set! (-> obj load-file-part) -1)
|
||||
(set! (-> obj load-file-owner) (the-as uint #f))
|
||||
(set! (-> obj load-file-priority) 100000000.0)
|
||||
(set! (-> obj pending-load-file) #f)
|
||||
(set! (-> obj pending-load-file-part) -1)
|
||||
(set! (-> obj pending-load-file-owner) (the-as uint #f))
|
||||
(set! (-> obj pending-load-file-priority) 100000000.0)
|
||||
(set! (-> obj art-group) #f)
|
||||
(set! (-> obj status) 'initialize)
|
||||
(set! (-> obj locked?) #f)
|
||||
(set! (-> obj other) #f)
|
||||
obj
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type spool-anim
|
||||
(deftype spool-anim (basic)
|
||||
((name basic :offset 16)
|
||||
(index int32 :offset-assert 20)
|
||||
(parts int32 :offset-assert 24)
|
||||
(priority float :offset-assert 28)
|
||||
(owner uint64 :offset-assert 32)
|
||||
(command-list basic :offset-assert 40)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x2c
|
||||
:flag-assert #x90000002c
|
||||
)
|
||||
|
||||
;; definition for method 3 of type spool-anim
|
||||
(defmethod inspect spool-anim ((obj spool-anim))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tname: ~A~%" (-> obj name))
|
||||
(format #t "~Tindex: ~D~%" (-> obj index))
|
||||
(format #t "~Tparts: ~D~%" (-> obj parts))
|
||||
(format #t "~Tpriority: ~f~%" (-> obj priority))
|
||||
(format #t "~Towner: ~D~%" (-> obj owner))
|
||||
(format #t "~Tcommand-list: ~A~%" (-> obj command-list))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type external-art-control
|
||||
(deftype external-art-control (basic)
|
||||
((buffer external-art-buffer 2 :offset-assert 4)
|
||||
(rec spool-anim 3 :inline :offset-assert 16)
|
||||
(spool-lock uint64 :offset-assert 160)
|
||||
(reserve-buffer basic :offset-assert 168)
|
||||
(reserve-buffer-count int32 :offset-assert 172)
|
||||
(active-stream basic :offset-assert 176)
|
||||
(preload-stream spool-anim :inline :offset-assert 184)
|
||||
(last-preload-stream spool-anim :inline :offset-assert 232)
|
||||
(end-pad uint32 :offset-assert 276)
|
||||
)
|
||||
:method-count-assert 17
|
||||
:size-assert #x118
|
||||
:flag-assert #x1100000118
|
||||
(:methods
|
||||
(new (symbol type) _type_ 0)
|
||||
(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)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type external-art-control
|
||||
(defmethod inspect external-art-control ((obj external-art-control))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tbuffer[2] @ #x~X~%" (-> obj buffer))
|
||||
(format #t "~Trec[3] @ #x~X~%" (-> obj rec))
|
||||
(format #t "~Tspool-lock: ~D~%" (-> obj spool-lock))
|
||||
(format #t "~Treserve-buffer: ~A~%" (-> obj reserve-buffer))
|
||||
(format #t "~Treserve-buffer-count: ~D~%" (-> obj reserve-buffer-count))
|
||||
(format #t "~Tactive-stream: ~A~%" (-> obj active-stream))
|
||||
(format #t "~Tpreload-stream: #<spool-anim @ #x~X>~%" (-> obj preload-stream))
|
||||
(format
|
||||
#t
|
||||
"~Tlast-preload-stream: #<spool-anim @ #x~X>~%"
|
||||
(-> obj last-preload-stream)
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 0 of type external-art-control
|
||||
(defmethod new external-art-control ((allocation symbol) (type-to-make type))
|
||||
(let
|
||||
((obj
|
||||
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
|
||||
)
|
||||
)
|
||||
(dotimes (buff-idx 2)
|
||||
(set!
|
||||
(-> obj buffer buff-idx)
|
||||
((method-of-type external-art-buffer new)
|
||||
allocation
|
||||
external-art-buffer
|
||||
buff-idx
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> obj buffer 0 other) (-> obj buffer 1))
|
||||
(set! (-> obj buffer 1 other) (-> obj buffer 0))
|
||||
(dotimes (rec-idx 3)
|
||||
(set! (-> obj rec rec-idx name) #f)
|
||||
(set! (-> obj rec rec-idx priority) 100000000.0)
|
||||
(set! (-> obj rec rec-idx owner) (the-as uint #f))
|
||||
)
|
||||
(set! (-> obj spool-lock) (the-as uint #f))
|
||||
(set! (-> obj reserve-buffer) #f)
|
||||
(set! (-> obj active-stream) #f)
|
||||
(set! (-> obj preload-stream name) #f)
|
||||
(set! (-> obj preload-stream priority) 100000000.0)
|
||||
(set! (-> obj preload-stream owner) (the-as uint #f))
|
||||
(set! (-> obj last-preload-stream name) #f)
|
||||
(set! (-> obj last-preload-stream priority) 100000000.0)
|
||||
(set! (-> obj last-preload-stream owner) (the-as uint #f))
|
||||
obj
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(let ((v0-5 0))
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type vis-gif-tag
|
||||
(deftype vis-gif-tag (structure)
|
||||
((fog0 uint32 :offset-assert 0)
|
||||
(strip uint32 :offset-assert 4)
|
||||
(regs uint32 :offset-assert 8)
|
||||
(fan uint32 :offset-assert 12)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;; definition for method 3 of type vis-gif-tag
|
||||
(defmethod inspect vis-gif-tag ((obj vis-gif-tag))
|
||||
(format #t "[~8x] ~A~%" obj 'vis-gif-tag)
|
||||
(format #t "~Tfog0: ~D~%" (-> obj fog0))
|
||||
(format #t "~Tstrip: ~D~%" (-> obj strip))
|
||||
(format #t "~Tregs: ~D~%" (-> obj regs))
|
||||
(format #t "~Tfan: ~D~%" (-> obj fan))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type cull-info
|
||||
(deftype cull-info (structure)
|
||||
((x-fact float :offset-assert 0)
|
||||
(y-fact float :offset-assert 4)
|
||||
(z-fact float :offset-assert 8)
|
||||
(cam-radius float :offset-assert 12)
|
||||
(cam-x float :offset-assert 16)
|
||||
(cam-y float :offset-assert 20)
|
||||
(xz-dir-ax float :offset-assert 24)
|
||||
(xz-dir-az float :offset-assert 28)
|
||||
(xz-dir-bx float :offset-assert 32)
|
||||
(xz-dir-bz float :offset-assert 36)
|
||||
(xz-cross-ab float :offset-assert 40)
|
||||
(yz-dir-ay float :offset-assert 44)
|
||||
(yz-dir-az float :offset-assert 48)
|
||||
(yz-dir-by float :offset-assert 52)
|
||||
(yz-dir-bz float :offset-assert 56)
|
||||
(yz-cross-ab float :offset-assert 60)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x40
|
||||
:flag-assert #x900000040
|
||||
)
|
||||
|
||||
;; definition for method 3 of type cull-info
|
||||
(defmethod inspect cull-info ((obj cull-info))
|
||||
(format #t "[~8x] ~A~%" obj 'cull-info)
|
||||
(format #t "~Tx-fact: ~f~%" (-> obj x-fact))
|
||||
(format #t "~Ty-fact: ~f~%" (-> obj y-fact))
|
||||
(format #t "~Tz-fact: ~f~%" (-> obj z-fact))
|
||||
(format #t "~Tcam-radius: ~f~%" (-> obj cam-radius))
|
||||
(format #t "~Tcam-x: ~f~%" (-> obj cam-x))
|
||||
(format #t "~Tcam-y: ~f~%" (-> obj cam-y))
|
||||
(format #t "~Txz-dir-ax: ~f~%" (-> obj xz-dir-ax))
|
||||
(format #t "~Txz-dir-az: ~f~%" (-> obj xz-dir-az))
|
||||
(format #t "~Txz-dir-bx: ~f~%" (-> obj xz-dir-bx))
|
||||
(format #t "~Txz-dir-bz: ~f~%" (-> obj xz-dir-bz))
|
||||
(format #t "~Txz-cross-ab: ~f~%" (-> obj xz-cross-ab))
|
||||
(format #t "~Tyz-dir-ay: ~f~%" (-> obj yz-dir-ay))
|
||||
(format #t "~Tyz-dir-az: ~f~%" (-> obj yz-dir-az))
|
||||
(format #t "~Tyz-dir-by: ~f~%" (-> obj yz-dir-by))
|
||||
(format #t "~Tyz-dir-bz: ~f~%" (-> obj yz-dir-bz))
|
||||
(format #t "~Tyz-cross-ab: ~f~%" (-> obj yz-cross-ab))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type math-camera
|
||||
(deftype math-camera (basic)
|
||||
((d float :offset-assert 4)
|
||||
(f float :offset-assert 8)
|
||||
(fov float :offset-assert 12)
|
||||
(x-ratio float :offset-assert 16)
|
||||
(y-ratio float :offset-assert 20)
|
||||
(x-pix float :offset-assert 24)
|
||||
(x-clip float :offset-assert 28)
|
||||
(x-clip-ratio-in float :offset-assert 32)
|
||||
(x-clip-ratio-over float :offset-assert 36)
|
||||
(y-pix float :offset-assert 40)
|
||||
(y-clip float :offset-assert 44)
|
||||
(y-clip-ratio-in float :offset-assert 48)
|
||||
(y-clip-ratio-over float :offset-assert 52)
|
||||
(cull-info cull-info :inline :offset-assert 56)
|
||||
(fog-start float :offset-assert 120)
|
||||
(fog-end float :offset-assert 124)
|
||||
(fog-max float :offset-assert 128)
|
||||
(fog-min float :offset-assert 132)
|
||||
(reset int32 :offset-assert 136)
|
||||
(smooth-step float :offset-assert 140)
|
||||
(smooth-t float :offset-assert 144)
|
||||
(perspective matrix :inline :offset-assert 160)
|
||||
(isometric matrix :inline :offset-assert 224)
|
||||
(sprite-2d matrix :inline :offset-assert 288)
|
||||
(sprite-2d-hvdf vector :inline :offset-assert 352)
|
||||
(camera-rot matrix :inline :offset-assert 368)
|
||||
(inv-camera-rot matrix :inline :offset-assert 432)
|
||||
(inv-camera-rot-smooth matrix :inline :offset-assert 496)
|
||||
(inv-camera-rot-smooth-from quaternion :inline :offset-assert 560)
|
||||
(camera-temp matrix :inline :offset-assert 576)
|
||||
(prev-camera-temp matrix :inline :offset-assert 640)
|
||||
(hmge-scale vector :inline :offset-assert 704)
|
||||
(inv-hmge-scale vector :inline :offset-assert 720)
|
||||
(hvdf-off vector :inline :offset-assert 736)
|
||||
(guard vector :inline :offset-assert 752)
|
||||
(vis-gifs vis-gif-tag 4 :inline :offset-assert 768)
|
||||
(giftex uint128 :offset 768)
|
||||
(gifgr uint128 :offset 784)
|
||||
(giftex-trans uint128 :offset 800)
|
||||
(gifgr-trans uint128 :offset 816)
|
||||
(pfog0 float :offset-assert 832)
|
||||
(pfog1 float :offset-assert 836)
|
||||
(trans vector :inline :offset-assert 848)
|
||||
(plane uint128 4 :offset-assert 864)
|
||||
(guard-plane uint128 4 :offset-assert 928)
|
||||
(shrub-mat matrix :inline :offset-assert 992)
|
||||
(fov-correction-factor float :offset-assert 1056)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x424
|
||||
:flag-assert #x900000424
|
||||
(:methods
|
||||
(new (symbol type) _type_ 0)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type math-camera
|
||||
;; Used lq/sq
|
||||
(defmethod inspect math-camera ((obj math-camera))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Td: (meters ~m)~%" (-> obj d))
|
||||
(format #t "~Tf: (meters ~m)~%" (-> obj f))
|
||||
(format #t "~Tfov: (deg ~r)~%" (-> obj fov))
|
||||
(format #t "~Tx-ratio: ~f~%" (-> obj x-ratio))
|
||||
(format #t "~Ty-ratio: ~f~%" (-> obj y-ratio))
|
||||
(format #t "~Tx-pix: ~f~%" (-> obj x-pix))
|
||||
(format #t "~Tx-clip: ~f~%" (-> obj x-clip))
|
||||
(format #t "~Tx-clip-ratio-in: ~f~%" (-> obj x-clip-ratio-in))
|
||||
(format #t "~Tx-clip-ratio-over: ~f~%" (-> obj x-clip-ratio-over))
|
||||
(format #t "~Ty-pix: ~f~%" (-> obj y-pix))
|
||||
(format #t "~Ty-clip: ~f~%" (-> obj y-clip))
|
||||
(format #t "~Ty-clip-ratio-in: ~f~%" (-> obj y-clip-ratio-in))
|
||||
(format #t "~Ty-clip-ratio-over: ~f~%" (-> obj y-clip-ratio-over))
|
||||
(format #t "~Tcull-info: #<cull-info @ #x~X>~%" (-> obj cull-info))
|
||||
(format #t "~Tfog-start: (meters ~m)~%" (-> obj fog-start))
|
||||
(format #t "~Tfog-end: (meters ~m)~%" (-> obj fog-end))
|
||||
(format #t "~Tfog-max: ~f~%" (-> obj fog-max))
|
||||
(format #t "~Tfog-min: ~f~%" (-> obj fog-min))
|
||||
(format #t "~Treset: ~D~%" (-> obj reset))
|
||||
(format #t "~Tsmooth-step: ~f~%" (-> obj smooth-step))
|
||||
(format #t "~Tsmooth-t: ~f~%" (-> obj smooth-t))
|
||||
(format #t "~Tperspective: #<matrix @ #x~X>~%" (-> obj perspective))
|
||||
(format #t "~Tisometric: #<matrix @ #x~X>~%" (-> obj isometric))
|
||||
(format #t "~Tsprite-2d: #<matrix @ #x~X>~%" (-> obj sprite-2d))
|
||||
(format #t "~Tsprite-2d-hvdf: #<vector @ #x~X>~%" (-> obj sprite-2d-hvdf))
|
||||
(format #t "~Tcamera-rot: #<matrix @ #x~X>~%" (-> obj camera-rot))
|
||||
(format #t "~Tinv-camera-rot: #<matrix @ #x~X>~%" (-> obj inv-camera-rot))
|
||||
(format
|
||||
#t
|
||||
"~Tinv-camera-rot-smooth: #<matrix @ #x~X>~%"
|
||||
(-> obj inv-camera-rot-smooth)
|
||||
)
|
||||
(format
|
||||
#t
|
||||
"~Tinv-camera-rot-smooth-from: #<quaternion @ #x~X>~%"
|
||||
(-> obj inv-camera-rot-smooth-from)
|
||||
)
|
||||
(format #t "~Tcamera-temp: #<matrix @ #x~X>~%" (-> obj camera-temp))
|
||||
(format #t "~Tprev-camera-temp: #<matrix @ #x~X>~%" (-> obj prev-camera-temp))
|
||||
(format #t "~Thmge-scale: #<vector @ #x~X>~%" (-> obj hmge-scale))
|
||||
(format #t "~Tinv-hmge-scale: #<vector @ #x~X>~%" (-> obj inv-hmge-scale))
|
||||
(format #t "~Thvdf-off: #<vector @ #x~X>~%" (-> obj hvdf-off))
|
||||
(format #t "~Tguard: #<vector @ #x~X>~%" (-> obj guard))
|
||||
(format #t "~Tvis-gifs[4] @ #x~X~%" (-> obj vis-gifs))
|
||||
(format #t "~Tgiftex: ~D~%" (-> obj giftex))
|
||||
(format #t "~Tgifgr: ~D~%" (-> obj gifgr))
|
||||
(format #t "~Tgiftex-trans: ~D~%" (-> obj giftex-trans))
|
||||
(format #t "~Tgifgr-trans: ~D~%" (-> obj gifgr-trans))
|
||||
(format #t "~Tpfog0: ~f~%" (-> obj pfog0))
|
||||
(format #t "~Tpfog1: ~f~%" (-> obj pfog1))
|
||||
(format #t "~Ttrans: ~`vector`P~%" (-> obj trans))
|
||||
(format #t "~Tplane[4] @ #x~X~%" (-> obj plane))
|
||||
(format #t "~Tguard-plane[4] @ #x~X~%" (-> obj guard-plane))
|
||||
(format #t "~Tshrub-mat: #<matrix @ #x~X>~%" (-> obj shrub-mat))
|
||||
(format #t "~Tfov-correction-factor: ~f~%" (-> obj fov-correction-factor))
|
||||
obj
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(let ((v0-3 0))
|
||||
)
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
(set! (-> pad button0-rel 0) (the-as uint 0))
|
||||
(dotimes (v1-2 12)
|
||||
(nop!)
|
||||
(set! (-> pad abutton v1-2) 0)
|
||||
(set! (-> pad abutton v1-2) (the-as uint 0))
|
||||
)
|
||||
(set! (-> pad stick0-dir) 0.0)
|
||||
(set! (-> pad stick0-speed) 0.0)
|
||||
@@ -118,7 +118,7 @@
|
||||
(set! (-> pad align 4) (the-as uint 255))
|
||||
(set! (-> pad align 5) (the-as uint 255))
|
||||
(dotimes (v1-14 6)
|
||||
(set! (-> pad direct v1-14) 0)
|
||||
(set! (-> pad direct v1-14) (the-as uint 0))
|
||||
)
|
||||
(dotimes (v1-17 2)
|
||||
(set! (-> pad buzz-val 0) (the-as uint 0))
|
||||
@@ -209,7 +209,7 @@
|
||||
((pad cpad-info) (buzz-idx int) (buzz-amount int) (duration int))
|
||||
(cond
|
||||
((zero? buzz-amount)
|
||||
(set! (-> pad buzz-val buzz-idx) 0)
|
||||
(set! (-> pad buzz-val buzz-idx) (the-as uint 0))
|
||||
(let ((v1-2 0))
|
||||
)
|
||||
)
|
||||
@@ -223,7 +223,7 @@
|
||||
)
|
||||
)
|
||||
((< (-> pad buzz-val buzz-idx) (the-as uint buzz-amount))
|
||||
(set! (-> pad buzz-val buzz-idx) buzz-amount)
|
||||
(set! (-> pad buzz-val buzz-idx) (the-as uint buzz-amount))
|
||||
(set!
|
||||
(-> pad buzz-time buzz-idx)
|
||||
(+ (get-current-time) (the-as uint duration))
|
||||
@@ -280,8 +280,8 @@
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! (-> pad buzz-val buzz-idx) 0)
|
||||
(set! (-> pad direct buzz-idx) 0)
|
||||
(set! (-> pad buzz-val buzz-idx) (the-as uint 0))
|
||||
(set! (-> pad direct buzz-idx) (the-as uint 0))
|
||||
(let ((v1-22 0))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
(+! idx -1)
|
||||
(nop!)
|
||||
(nop!)
|
||||
(set! (-> obj bytes idx) 0)
|
||||
(set! (-> obj bytes idx) (the-as uint 0))
|
||||
)
|
||||
)
|
||||
obj
|
||||
|
||||
Reference in New Issue
Block a user