[decomp] load-dgo, ramdisk, gsound, transformq (#1798)

* temp

* cleanup after merge

* transformq too
This commit is contained in:
water111
2022-08-24 21:57:13 -04:00
committed by GitHub
parent c441e209d2
commit 7443520e88
37 changed files with 4865 additions and 204 deletions
+188 -109
View File
@@ -47,6 +47,19 @@
(force-debug 4)
(fast-link 5)
)
(defenum language-enum
:type int64
(english)
(french)
(german)
(spanish)
(italian)
(japanese)
(korean)
(uk-english)
)
(define-extern *debug-segment* symbol)
(define-extern nothing (function none))
(define-extern _format (function _varargs_ object))
@@ -82,6 +95,7 @@
(define-extern link-begin (function pointer (pointer uint8) int kheap link-flag int))
(define-extern link-resume (function int))
(define-extern link-reset (function none))
(define-extern kset-language (function language-enum int))
(define-extern loading-level kheap)
@@ -1552,7 +1566,7 @@
(set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14)
(set-roll-to-grav! (_type_ float) quaternion 15)
(set-roll-to-grav-2! (_type_ float) quaternion 16)
(rotate-toward-orientation! (_type_ quaternion float float) quaternion 17)
(rotate-toward-orientation! (_type_ quaternion float float int float float) quaternion 17)
(set-quaternion! (_type_ quaternion) quaternion 18)
(set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19)
(point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20)
@@ -1778,30 +1792,57 @@
(defenum sound-command
:type uint16
; (load-bank)
; (load-music)
; (unload-bank)
; (play)
; (pause-sound)
; (stop-sound)
; (continue-sound)
; (set-param)
; (set-master-volume)
; (pause-group)
; (stop-group)
; (continue-group)
; (get-irx-version)
; (set-falloff-curve)
; (set-sound-falloff)
; (reload-info)
; (set-language)
; (set-flava)
; (set-reverb)
; (set-ear-trans)
; (shutdown)
; (list-sounds)
; (unload-music)
; (set-fps)
(iop-store 0) ;; sound-rpc-bank-cmd
(iop-free 1) ;; sound-rpc-bank-cmd
(load-bank 2) ;; sound-rpc-load-bank
(load-bank-from-iop 3) ;; sound-rpc-load-bank
(load-bank-from-ee 4) ;; sound-rpc-load-bank
(load-music 5) ;; sound-rpc-load-music
(unload-bank 6) ;; sound-rpc-bank-cmd
(play 7) ;; sound-rpc-play
(pause-sound 8) ;; sound-rpc-pause-sound
(stop-sound 9) ;; sound-rpc-stop-sound
(continue-sound 10) ;; sound-rpc-continue-sound
(set-param 11)
(set-master-volume 12) ;; sound-rpc-set-master-volume
(pause-group 13) ;; sound-rpc-pause-group
(stop-group 14) ;; sound-rpc-stop-group
(continue-group 15) ;; sound-rpc-continue-group
(get-irx-version 16)
(set-falloff-curve 17)
(set-sound-falloff 18)
(reload-info 19)
(set-language 20) ;; sound-rpc-set-language
(set-flava 21) ;; sound-rpc-set-flava
(set-midi-reg 22) ;; sound-rpc-set-midi-reg
(set-reverb 23) ;; sound-rpc-set-reverb
(set-ear-trans 24) ;; sound-rpc-set-ear-trans
(shutdown 25)
(list-sounds 26) ;; sound-rpc-list-sounds
(unload-music 27) ;; sound-rpc-unload-music
(set-fps 28) ;; sound-rpc-set-fps
(boot-load 29)
(game-load 30)
(num-tests 31)
(num-testruns 32)
(num-sectors 33)
(num-streamsectors 34)
(num-streambanks 35)
(track-pitch 36)
(linvel-nom 37)
(linvel-stm 38)
(seek-nom 39)
(seek-stm 40)
(read-seq-nom 41)
(read-seq-stm 42)
(read-spr-nom 43)
(read-spr-stm 44)
(read-spr-strn-nom 45)
(rand-stm-abort 46)
(rand-nom-abort 47)
(iop-mem 48)
(cancel-dgo 49)
(set-stereo-mode 50) ;; sound-rpc-set-stereo-mode
)
(defenum sound-group
@@ -1844,6 +1885,7 @@
(deftype sound-stream-name (structure)
((name uint8 48 :offset-assert 0)
)
:pack-me
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
@@ -1870,6 +1912,7 @@
(trans int32 3 :offset-assert 16)
(group uint8 :offset-assert 28)
(reg uint8 3 :offset-assert 29)
(group-and-regs uint32 :offset 28)
)
:allow-misaligned
:method-count-assert 9
@@ -1906,8 +1949,8 @@
)
(deftype sound-rpc-test-cmd (sound-rpc-cmd)
((ee-addr uint32 :offset-assert 4)
(param0 uint16 :offset-assert 8)
((ee-addr pointer :offset-assert 4)
(param0 uint16 :offset-assert 8)
)
:method-count-assert 9
:size-assert #xa
@@ -1931,7 +1974,7 @@
)
(deftype sound-rpc-load-bank (sound-rpc-bank-cmd)
((ee-addr uint32 :offset-assert 32)
((ee-addr pointer :offset-assert 32)
)
:method-count-assert 9
:size-assert #x24
@@ -2150,6 +2193,7 @@
(num float :offset-assert 8)
(group sound-group :offset-assert 12)
(reg uint8 3 :offset-assert 13)
(group-and-regs uint32 :offset 12)
(sound-name-char uint8 16 :offset-assert 16)
(sound-name sound-name :offset 16 :score 1)
(trans int32 4 :offset-assert 32)
@@ -2190,14 +2234,14 @@
:size-assert #x6c
:flag-assert #x100000006c
(:methods
;; (new (symbol type basic vector) _type_ 0)
(ambient-sound-method-9 () none 9) ;; (update! (_type_) int 9)
(ambient-sound-method-10 () none 10) ;; (change-sound! (_type_ sound-name) int 10)
(ambient-sound-method-11 () none 11) ;; (update-trans! (_type_ vector) int 11)
(ambient-sound-method-12 () none 12) ;; (update-vol! (_type_ int) int 12)
(ambient-sound-method-13 () none 13) ;; (stop! (_type_) int 13)
(ambient-sound-method-14 () none 14)
(ambient-sound-method-15 () none 15)
(new (symbol type basic vector) _type_ 0)
(update! (_type_) int 9)
(change-sound! (_type_ sound-name) int 10)
(update-trans! (_type_ vector) int 11)
(update-vol! (_type_ float) int 12)
(update-pitch-mod! (_type_ float) none 13)
(set-falloff-far! (_type_ float) none 14)
(stop! (_type_) int 15)
)
)
@@ -6016,7 +6060,7 @@
(defenum font-color
:type uint32
(zero 0)
(default 0)
(one 1)
(orange-red 3)
)
@@ -6308,7 +6352,7 @@
(:methods
(new (symbol type symbol int type) _type_ 0)
(schedule-callback (_type_ object time-frame) connection-pers 9)
(kill-callback (_type_) none 10)
(kill-callback (_type_ connection-pers) none 10)
(kill-by-key (_type_ object) none 11)
(kill-matching (_type_ (function engine-pers connection-pers object object symbol) object object) none 12)
(update-callback (_type_) none 13)
@@ -7202,8 +7246,8 @@
(:methods
(new (symbol type int) _type_ 0)
(setting-control-method-9 () none 9) ;; (add-setting (_type_ process symbol object object object) none 9)
(setting-control-method-10 () none 10) ;; (set-setting (_type_ process symbol object object object) none 10)
(setting-control-method-11 () none 11) ;; (remove-setting (_type_ process symbol) none 11)
(setting-control-method-10 () none 10) ;;
(set-setting (_type_ process symbol object object object) none 11) ;; (remove-setting (_type_ process symbol) none 11)
(setting-control-method-12 () none 12) ;; (apply-settings (_type_) setting-data 12)
(setting-control-method-13 () none 13) ;; (update (_type_) setting-data 13)
(setting-control-method-14 () none 14)
@@ -11221,7 +11265,7 @@
(reset! (_type_) _type_ 9)
(update! (_type_) int 10)
(want-levels (_type_ (pointer symbol)) int 11)
(load-state-method-12 () none 12) ;; (want-display-level (_type_ symbol symbol) int 12)
(want-sound-banks (_type_ (pointer symbol)) none 12) ;; (want-display-level (_type_ symbol symbol) int 12)
(want-display-level (_type_ symbol symbol) int 13)
(want-vis-level (_type_ symbol) none 14) ;; (want-force-vis (_type_ symbol symbol) int 14)
(load-state-method-15 () none 15) ;; (execute-command (_type_ pair) none 15)
@@ -13051,7 +13095,7 @@
:flag-assert #xd00000110
;; Failed to read fields.
(:methods
;; (new (symbol type process-drawable pickup-type float) _type_ 0)
(new (symbol type process pickup-type float) _type_ 0)
(fact-info-target-method-12 () none 12)
)
)
@@ -13119,6 +13163,7 @@
:flag-assert #xc0000002c
;; Failed to read fields.
(:methods
(new (symbol type process pickup-type float) _type_ 0)
)
)
@@ -14718,6 +14763,7 @@
:flag-assert #x44000001dc
;; Failed to read fields.
(:methods
(new (symbol type process-drawable collide-list-enum) _type_ 0)
(collide-shape-moving-method-55 () none 55)
(collide-shape-moving-method-56 () none 56) ;; (set-and-handle-pat! (_type_ pat-surface) none 56)
(collide-shape-moving-method-57 () none 57) ;; (integrate-no-collide! (_type_ vector) none 57)
@@ -15135,7 +15181,7 @@
:size-assert #x3c10
:flag-assert #xd00003c10
(:methods
;; (new (symbol type) _type_ 0)
(new (symbol type) _type_ 0)
(touching-prims-entry-pool-method-9 () none 9) ;; (alloc-node (_type_) touching-prims-entry 9)
(touching-prims-entry-pool-method-10 () none 10) ;; (get-free-node-count (_type_) int 10)
(init-list! (_type_) none 11)
@@ -15174,7 +15220,7 @@
:size-assert #x408
:flag-assert #xe00000408
(:methods
;; (new (symbol type) _type_ 0)
(new (symbol type) _type_ 0)
(touching-list-method-9 () none 9) ;; (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none 9)
(touching-list-method-10 () none 10) ;; (dummy-10 () none 10)
(touching-list-method-11 () none 11) ;; (update-from-step-size (_type_ float) none 11)
@@ -20476,7 +20522,6 @@
;; ramdisk ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#|
(deftype ramdisk-rpc-fill (structure)
((rsvd1 int32 :offset-assert 0)
(ee-id int32 :offset-assert 4)
@@ -20487,9 +20532,7 @@
:size-assert #x20
:flag-assert #x900000020
)
|#
#|
(deftype ramdisk-rpc-load (structure)
((rsvd int32 :offset-assert 0)
(ee-id int32 :offset-assert 4)
@@ -20500,9 +20543,7 @@
:size-assert #x10
:flag-assert #x900000010
)
|#
#|
(deftype ramdisk-rpc-load-to-ee (structure)
((rsvd int32 :offset-assert 0)
(addr int32 :offset-assert 4)
@@ -20514,18 +20555,20 @@
:size-assert #x20
:flag-assert #x900000020
)
|#
;; (define-extern *ramdisk-rpc* object) ;; rpc-buffer-pair
;; (define-extern *current-ramdisk-id* object) ;; int
;; (define-extern ramdisk-load function) ;; (function int uint uint pointer int)
;; (define-extern ramdisk-sync function) ;; (function none)
(define-extern *ramdisk-rpc* rpc-buffer-pair)
(define-extern *current-ramdisk-id* int)
(define-extern ramdisk-load (function int uint uint pointer int))
(define-extern ramdisk-sync (function none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; gsound ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#|
;; ghost function
(define-extern *debug-effect-control* symbol)
(define-extern effect-param->sound-spec (function sound-spec (pointer float) int sound-spec))
(deftype engine-sound-pers (engine-pers)
()
:method-count-assert 15
@@ -20534,86 +20577,122 @@
(:methods
)
)
|#
#|
(defenum stream-status
:type uint32
:bitfield #t
(zero 0)
(one 1) ;; another way to be playing
(two 2)
(three 3)
(four 4) ;; is playing?
(five 5)
(six 6) ;; another way to be playing.
(seven 7)
)
(defenum stereo-mode
:type int32
)
(deftype sound-iop-info (structure)
()
((frame uint32 :offset-assert 0)
(strpos int32 :offset-assert 4)
(str-id uint32 :offset-assert 8)
(str-id-sign int32 :offset 8)
(freemem uint32 :offset-assert 12)
(chinfo uint8 48 :offset-assert 16)
(freemem2 uint32 :offset-assert 64)
(nocd uint32 :offset-assert 68)
(dirtycd uint32 :offset-assert 72)
(diskspeed uint32 2 :offset-assert 76)
(lastspeed uint32 :offset-assert 84)
(dupseg int32 :offset-assert 88)
(times int32 41 :offset-assert 92)
(times-seq uint32 :offset-assert 256)
(iop-ticks uint32 :offset-assert 260)
(stream-position uint32 4 :offset 272)
(stream-status stream-status 4 :offset-assert 288)
(stream-name sound-stream-name 4 :inline :offset-assert 304)
(stream-id uint32 4 :offset-assert 496)
(music-register uint8 17 :offset-assert 512)
(music-excite int8 :offset 528)
(ramdisk-name uint8 48 :offset-assert 529)
)
:method-count-assert 9
:size-assert #x241
:flag-assert #x900000241
;; Failed to read fields.
)
|#
;; (define-extern *sound-loop-engine* object)
(define-extern *sound-loop-engine* engine-sound-pers)
(define-extern *sound-player-rpc* rpc-buffer-pair)
;; (define-extern *sound-loader-rpc* object) ;; rpc-buffer-pair
;; (define-extern sound-name= function) ;; (function sound-name sound-name symbol)
;; (define-extern *sound-iop-info* object) ;; sound-iop-info
;; (define-extern str-is-playing? function) ;; (function symbol)
;; (define-extern str-id-is-playing? function)
;; (define-extern current-str-pos function) ;; (function sound-id int)
;; (define-extern is-ramdisk-loaded? function)
;; (define-extern is-cd-in? function) ;; (function symbol)
(define-extern *sound-loader-rpc* rpc-buffer-pair)
(define-extern sound-name= (function sound-name sound-name symbol))
(define-extern *sound-iop-info* sound-iop-info)
(define-extern str-is-playing? (function symbol))
(define-extern str-id-is-playing? (function int symbol))
(define-extern current-str-pos (function sound-id int))
(define-extern is-ramdisk-loaded? (function symbol symbol))
(define-extern is-cd-in? (function symbol))
(define-extern new-sound-id (function sound-id))
;; (define-extern check-irx-version function) ;; (function int)
;; (define-extern sound-bank-iop-store function)
;; (define-extern sound-bank-iop-free function)
;; (define-extern sound-bank-load function) ;; (function sound-name sound-id)
;; (define-extern sound-bank-load-from-iop function)
;; (define-extern sound-bank-load-from-ee function)
;; (define-extern sound-bank-unload function) ;; (function sound-name int)
;; (define-extern sound-music-load function) ;; (function sound-name int)
;; (define-extern sound-music-unload function) ;; (function int)
;; (define-extern set-language function) ;; (function language-enum int)
;; (define-extern sound-set-stereo-mode function)
;; (define-extern list-sounds function) ;; (function int)
;; (define-extern sound-command->string function) ;; (function sound-command string)
;; (define-extern sound-buffer-dump function) ;; (function int)
(define-extern check-irx-version (function int))
(define-extern sound-bank-iop-store (function sound-name sound-id))
(define-extern sound-bank-iop-free (function sound-name sound-id))
(define-extern sound-bank-load (function sound-name sound-id))
(define-extern sound-bank-load-from-iop (function sound-name sound-id))
(define-extern sound-bank-load-from-ee (function sound-name pointer sound-id))
(define-extern sound-bank-unload (function sound-name int))
(define-extern sound-music-load (function sound-name int))
(define-extern sound-music-unload (function int))
(define-extern set-language (function language-enum int))
(define-extern sound-set-stereo-mode (function stereo-mode none))
(define-extern list-sounds (function none))
(define-extern sound-command->string (function sound-command string))
(define-extern sound-buffer-dump (function int))
(define-extern *sound-player-enable* symbol)
(define-extern swap-sound-buffers (function vector vector float int))
(define-extern swap-sound-buffers (function vector vector vector float int))
(define-extern get-sound-buffer-entry (function pointer))
;; (define-extern free-last-sound-buffer-entry function) ;; (function int)
;; (define-extern sound-basic-cb function) ;; (function int (pointer int32) none)
;; (define-extern sound-trans-convert function) ;; (function vector3w vector int)
;; (define-extern sound-angle-convert function) ;; (function float int)
(define-extern free-last-sound-buffer-entry (function none))
(define-extern sound-basic-cb (function int (pointer int32) none))
(define-extern sound-trans-convert (function vector3w vector int))
(define-extern sound-angle-convert (function float int))
(define-extern string->sound-name (function string sound-name))
;; (define-extern sound-set-volume function) ;; (function sound-group float int)
;; (define-extern sound-set-reverb function) ;; (function int float float uint int)
;; (define-extern sound-set-ear-trans function) ;; (function vector vector float int)
(define-extern sound-set-volume (function sound-group float int))
(define-extern sound-set-reverb (function int float float uint int))
(define-extern sound-set-ear-trans (function vector vector vector float int))
(define-extern sound-play-by-name (function sound-name sound-id int int int sound-group symbol sound-id))
(define-extern sound-play-by-spec (function sound-spec sound-id vector sound-id))
;; (define-extern sound-pause function) ;; (function sound-id int)
(define-extern sound-stop "Stops a sound identified by the given id" (function sound-id int))
;; (define-extern sound-continue function) ;; (function sound-id int)
(define-extern sound-pause (function sound-id int))
(define-extern sound-stop (function sound-id int))
(define-extern sound-continue (function sound-id int))
(define-extern sound-group-pause (function sound-group int))
;; (define-extern sound-group-stop function) ;; (function sound-group int)
(define-extern sound-group-stop (function sound-group int))
(define-extern sound-group-continue (function sound-group int))
;; (define-extern sound-set-flava function) ;; (function uint int)
;; (define-extern sound-set-midi-reg function)
;; (define-extern sound-set-fps function) ;; (function int int)
;; (define-extern sound-volume-off function) ;; (function int)
;; (define-extern *ambient-spec* sound-spec) ;; sound-spec
(define-extern sound-set-flava (function uint uint int))
(define-extern sound-set-midi-reg (function int int int))
(define-extern sound-set-fps (function int int))
(define-extern sound-volume-off (function int))
(define-extern *ambient-spec* sound-spec)
(define-extern show-iop-info (function dma-buffer int))
(define-extern show-iop-memory (function dma-buffer int))
(define-extern ear-trans (function vector))
;; (define-extern make-sqrt-table function) ;; (function int)
;; (define-extern loader-test-command function)
;; (define-extern doppler-pitch-shift function)
;; (define-extern sound-bank-reload function)
(define-extern ear-trans (function int vector))
(define-extern make-sqrt-table (function int))
(define-extern loader-test-command (function sound-command uint none))
(define-extern doppler-pitch-shift (function vector vector float))
(define-extern sound-bank-reload (function none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; transformq ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (define-extern transformq-copy! function) ;; (function transformq transformq transformq)
(define-extern transformq-copy! (function transformq transformq transformq))
(define-extern matrix<-transformq! (function matrix transformq matrix))
;; (define-extern matrix<-no-trans-transformq! function) ;; (function matrix transformq matrix)
;; (define-extern matrix<-transformq+trans! function) ;; (function matrix transformq vector matrix)
;; (define-extern matrix<-transformq+world-trans! function) ;; (function matrix transformq vector matrix)
(define-extern matrix<-no-trans-transformq! (function matrix transformq matrix))
(define-extern matrix<-transformq+trans! (function matrix transformq vector matrix))
(define-extern matrix<-transformq+world-trans! (function matrix transformq vector matrix))
(define-extern matrix<-parented-transformq! (function matrix transformq vector matrix))
;; (define-extern matrix<-transformq+rot-offset! function)
(define-extern matrix<-transformq+rot-offset! (function matrix transformq vector matrix))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; collide-func ;;
@@ -36,5 +36,9 @@
"level": [
[5, "(function none)"],
[24, "(function level-group int symbol)"]
],
"gsound": [
[1, "(function none)"]
]
}
@@ -164,5 +164,18 @@
"(method 9 mood-control)": [[16, "mood-control-work "]],
"string->sound-name": [[16, "qword"]],
"doppler-pitch-shift": [
[16, ["inline-array", "vector", 2]]
],
"(anon-function 1 gsound)": [
[16, ["array", "symbol", 4]],
[32, ["array", "symbol", 4]]
],
"matrix<-parented-transformq!": [[16, "vector"]],
"placeholder-do-not-add-below!": []
}
+90 -2
View File
@@ -496,7 +496,6 @@
],
"update-mood-ruins": [[[30, 46], "gp", "(pointer float)"]],
"update-mood-strip": [[[63, 80], "s4", "(pointer float)"]],
"placeholder-do-not-add-below": [],
"update-mood-ctysluma": [[[23, 81], "gp", "(pointer float)"]],
"update-mood-ctyslumb": [[[19, 59], "s5", "(pointer float)"]],
"update-mood-ctyslumc": [[[19, 47], "s5", "(pointer float)"]],
@@ -510,5 +509,94 @@
"update-mood-nest": [[[21, 74], "s5", "(pointer float)"]],
"update-mood-village1": [[[21, 66], "gp", "(pointer float)"]],
"update-mood-consite": [[[84, 110], "s4", "(pointer float)"]],
"desaturate-mood-colors": [[[20, 92], "a0", "(inline-array mood-color)"]]
"desaturate-mood-colors": [[[20, 92], "a0", "(inline-array mood-color)"]],
"ramdisk-load": [
[[7, 12], "v1", "ramdisk-rpc-load"]
],
"(method 10 engine-sound-pers)": [
[[2, 19], "v1", "sound-rpc-set-param"]
],
"check-irx-version": [
[[3, 51], "gp", "sound-rpc-get-irx-version"]
],
"sound-bank-iop-store": [
[[7, 11], "v1", "sound-rpc-bank-cmd"]
],
"sound-bank-iop-free": [
[[7, 12], "v1", "sound-rpc-bank-cmd"]
],
"sound-bank-load": [
[[7, 12], "v1", "sound-rpc-load-bank"]
],
"sound-bank-load-from-iop": [
[[7, 12], "v1", "sound-rpc-load-bank"]
],
"sound-bank-load-from-ee": [
[[8, 14], "v1", "sound-rpc-load-bank"]
],
"sound-bank-unload": [
[[6, 11], "v1", "sound-rpc-unload-bank"]
],
"sound-music-load": [
[[6, 11], "v1", "sound-rpc-load-music"]
],
"sound-music-unload": [
[[3, 8], "v1", "sound-rpc-unload-music"]
],
"set-language": [
[[7, 12], "v1", "sound-rpc-set-language"]
],
"sound-set-stereo-mode": [
[[4, 9], "v1", "sound-rpc-set-stereo-mode"]
],
"list-sounds": [
[[3, 7], "v1", "sound-rpc-list-sounds"]
],
"string->sound-name": [[[2, 18], "a1", "(pointer uint8)"]],
"sound-set-volume": [[[3, 16], "v1", "sound-rpc-set-master-volume"]],
"sound-set-reverb": [[[5, 25], "v1", "sound-rpc-set-reverb"]],
"sound-set-ear-trans": [[[7, 26], "gp", "sound-rpc-set-ear-trans"]],
"sound-play-by-name": [
[[12, 45], "s5", "sound-rpc-play"],
[[22, 39], "s3", "process-drawable"]
],
"sound-play-by-spec": [
[[4, 54], "s5", "sound-rpc-play"],
[[31, 47], "s3", "process-drawable"]
],
"sound-pause": [[[3, 8], "v1", "sound-rpc-pause-sound"]],
"sound-stop": [[[3, 8], "v1", "sound-rpc-stop-sound"]],
"sound-continue": [[[3, 8], "v1", "sound-rpc-continue-sound"]],
"sound-group-pause": [[[3, 7], "v1", "sound-rpc-pause-group"]],
"sound-group-stop": [[[3, 7], "v1", "sound-rpc-stop-group"]],
"sound-group-continue": [[[3, 7], "v1", "sound-rpc-continue-group"]],
"sound-set-flava": [[[3, 10], "v1", "sound-rpc-set-flava"]],
"sound-set-midi-reg": [[[3, 10], "v1", "sound-rpc-set-midi-reg"]],
"sound-set-fps": [[[3, 10], "v1", "sound-rpc-set-fps"]],
"(method 0 ambient-sound)": [
[121, "v1", "sound-spec"],
[125, "v1", "sound-spec"],
[128, "v1", "sound-spec"],
[132, "v1", "sound-spec"],
// [143, "v1", "sound-spec"],
// [140, "v1", "sound-spec"],
// [147, "v1", "sound-spec"],
["_stack_", 16, "sound-spec"],
["_stack_", 32, "sound-name"],
["_stack_", 48, "(pointer float)"],
// ["_stack_", 52, "sound-play-parms"],
["_stack_", 64, "res-tag"]
],
"(method 11 ambient-sound)": [
[[18, 33], "s4", "process-drawable"],
[[11, 47], "s5", "sound-rpc-set-param"]
],
"(method 12 ambient-sound)": [[[7, 22], "v1", "sound-rpc-set-param"]],
"(method 13 ambient-sound)": [[[7, 23], "v1", "sound-rpc-set-param"]],
"loader-test-command": [[[5, 10], "v1", "sound-rpc-test-cmd"]],
"(anon-function 1 gsound)": [[[0, 45], "gp", "(array symbol)"]],
"sound-buffer-dump": [[[12, 39], "s3", "sound-rpc-play"]],
"placeholder-do-not-add-below": []
}
@@ -15,3 +15,4 @@
(define-perm *camera-combiner* camera-combiner #f)
(define-extern math-camera-pos (function vector))
@@ -450,6 +450,7 @@
:size-assert #x1dc
:flag-assert #x44000001dc
(:methods
(new (symbol type process-drawable collide-list-enum) _type_ 0)
(collide-shape-moving-method-55 () none 55)
(collide-shape-moving-method-56 () none 56)
(collide-shape-moving-method-57 () none 57)
@@ -43,6 +43,7 @@
:size-assert #x3c10
:flag-assert #xd00003c10
(:methods
(new (symbol type) _type_ 0)
(touching-prims-entry-pool-method-9 () none 9)
(touching-prims-entry-pool-method-10 () none 10)
(init-list! (_type_) none 11)
@@ -113,6 +114,7 @@
:size-assert #x408
:flag-assert #xe00000408
(:methods
(new (symbol type) _type_ 0)
(touching-list-method-9 () none 9)
(touching-list-method-10 () none 10)
(touching-list-method-11 () none 11)
+6 -5
View File
@@ -609,7 +609,7 @@
(:methods
(new (symbol type symbol int type) _type_ 0)
(schedule-callback (_type_ object time-frame) connection-pers 9)
(kill-callback (_type_) none 10)
(kill-callback (_type_ connection-pers) none 10)
(kill-by-key (_type_ object) none 11)
(kill-matching (_type_ (function engine-pers connection-pers object object symbol) object object) none 12)
(update-callback (_type_) none 13)
@@ -617,6 +617,7 @@
)
)
(defmethod new engine-pers ((allocation symbol) (type-to-make type) (arg0 symbol) (arg1 int) (arg2 type))
(let ((v0-0 (object-new
allocation
@@ -683,7 +684,7 @@
v0-0
)
(defmethod kill-callback engine-pers ((obj engine-pers))
(defmethod kill-callback engine-pers ((obj engine-pers) (arg0 connection-pers))
"Called when a connection is removed."
0
(none)
@@ -708,7 +709,7 @@
(set! s4-0 (&-> s2-0 next))
)
(else
(kill-callback obj)
(kill-callback obj s2-0)
(set! (-> s4-0 0) (-> s2-0 next))
(set! (-> s2-0 next) (-> obj dead-list))
(set! (-> obj dead-list) s2-0)
@@ -739,7 +740,7 @@
(set! s2-0 (&-> s0-0 next))
)
(else
(kill-callback obj)
(kill-callback obj s0-0)
(set! (-> s2-0 0) (-> s0-0 next))
(set! (-> s0-0 next) (-> obj dead-list))
(set! (-> obj dead-list) s0-0)
@@ -771,7 +772,7 @@
(set! s2-0 (&-> s1-0 next))
)
(else
(kill-callback obj)
(kill-callback obj s1-0)
(set! (-> s2-0 0) (-> s1-0 next))
(set! (-> s1-0 next) (-> obj dead-list))
(set! (-> obj dead-list) s1-0)
+4
View File
@@ -256,6 +256,7 @@
:size-assert #x110
:flag-assert #xd00000110
(:methods
(new (symbol type process pickup-type float) _type_ 0)
(fact-info-target-method-12 () none 12)
)
)
@@ -286,6 +287,9 @@
(deftype fact-info-crate (fact-info)
((suck-count int32 :offset-assert 40)
)
(:methods
(new (symbol type process pickup-type float) _type_ 0)
)
:method-count-assert 12
:size-assert #x2c
:flag-assert #xc0000002c
+1 -1
View File
@@ -141,7 +141,7 @@
(reset! (_type_) _type_ 9)
(update! (_type_) int 10)
(want-levels (_type_ (pointer symbol)) int 11)
(load-state-method-12 () none 12)
(want-sound-banks (_type_ (pointer symbol)) none 12)
(want-display-level (_type_ symbol symbol) int 13)
(want-vis-level (_type_ symbol) none 14)
(load-state-method-15 () none 15)
+1
View File
@@ -213,3 +213,4 @@
(= arg0 *debug-actor*)
)
(define-extern movie? (function symbol))
+30 -1
View File
@@ -423,7 +423,7 @@
(new (symbol type int) _type_ 0)
(setting-control-method-9 () none 9)
(setting-control-method-10 () none 10)
(setting-control-method-11 () none 11)
(set-setting (_type_ process symbol object object object) none 11)
(setting-control-method-12 () none 12)
(setting-control-method-13 () none 13)
(setting-control-method-14 () none 14)
@@ -446,3 +446,32 @@
)
)
;; DECOMP ENDS
(define-extern *setting-control* setting-control)
(defmacro setting-control-func! (func s &rest args)
(let ((argb #f)
(argi 0)
(argf 0.0)
(setting (car s)))
(cond
(#t
(set! argb (car args))
(set! argf (cadr args))
(set! argi (caddr args))
)
)
`(,func *setting-control* (with-pp pp) ,s ,argb ,argf ,argi)
)
)
(defmacro add-setting! (s &rest args)
`(setting-control-func! add-setting ,s ,@args)
)
(defmacro set-setting! (s &rest args)
`(setting-control-func! set-setting ,s ,@args)
)
(defmacro remove-setting! (s)
`(remove-setting *setting-control* (with-pp pp) ,s)
)
+1 -1
View File
@@ -11,7 +11,7 @@
(defenum font-color
:type uint32
(zero 0)
(default 0)
(one 1)
(orange-red 3)
)
+1 -1
View File
@@ -80,7 +80,7 @@
)
(define *font-context*
(new 'global 'font-context *font-default-matrix* 0 0 0.0 (font-color zero) (font-flags shadow kerning))
(new 'global 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning))
)
(defun draw-sprite2d-xy ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 rgba))
+361
View File
@@ -5,5 +5,366 @@
;; name in dgo: load-dgo
;; dgos: ENGINE, GAME
;; status flag sent from OVERLORD about a DGO load.
(defenum load-msg-result
:type uint16
:bitfield #f
(done 0) ;; dgo fully loaded!
(error 1) ;; loading failed (file not found, etc)
(more 2) ;; more files exist!
(aborted 3) ;; status returned after a request to cancel.
(invalid 666) ;; invalid status indicating a communication error.
)
;; DECOMP BEGINS
(deftype load-dgo-msg (structure)
((rsvd uint16 :offset-assert 0)
(result load-msg-result :offset-assert 2)
(b1 pointer :offset-assert 4)
(b2 pointer :offset-assert 8)
(bt pointer :offset-assert 12)
(name uint128 :offset-assert 16)
(address uint32 :offset 4)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
(deftype load-chunk-msg (structure)
((rsvd uint16 :offset-assert 0)
(result load-msg-result :offset-assert 2)
(address pointer :offset-assert 4)
(section uint32 :offset-assert 8)
(maxlen uint32 :offset-assert 12)
(dummy uint32 4 :offset-assert 16)
(basename sound-stream-name :inline :offset-assert 32)
)
:method-count-assert 9
:size-assert #x50
:flag-assert #x900000050
)
(deftype play-chunk-msg (structure)
((rsvd uint16 :offset-assert 0)
(result uint16 :offset-assert 2)
(address pointer :offset-assert 4)
(section uint32 :offset-assert 8)
(maxlen uint32 :offset-assert 12)
(id uint32 4 :offset-assert 16)
(basename sound-stream-name 4 :inline :offset-assert 32)
)
:method-count-assert 9
:size-assert #xe0
:flag-assert #x9000000e0
)
(deftype dgo-header (structure)
((length uint32 :offset-assert 0)
(rootname uint8 60 :offset-assert 4)
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
)
(define-extern *load-dgo-rpc* rpc-buffer-pair)
(when (zero? *load-dgo-rpc*)
(define *load-dgo-rpc* (new 'global 'rpc-buffer-pair (the-as uint 32) (the-as uint 1) 3))
(define *load-str-rpc* (new 'global 'rpc-buffer-pair (the-as uint 64) (the-as uint 1) 4))
(define *play-str-rpc* (new 'global 'rpc-buffer-pair (the-as uint 256) (the-as uint 2) 5))
(define *load-str-lock* #f)
(define *que-str-lock* #f)
(define *dgo-name* (new 'global 'string 64 (the-as string #f)))
)
(defun str-load ((arg0 string) (arg1 int) (arg2 pointer) (arg3 int))
(if (or (check-busy *load-str-rpc*) *load-str-lock*)
(return #f)
)
(let ((s2-0 (the-as load-chunk-msg (add-element *load-str-rpc*))))
(set! (-> s2-0 result) (load-msg-result invalid))
(set! (-> s2-0 address) arg2)
(set! (-> s2-0 section) (the-as uint arg1))
(set! (-> s2-0 maxlen) (the-as uint arg3))
(copyn-charp<-string (the-as (pointer uint8) (-> s2-0 basename)) arg0 48)
(call *load-str-rpc* (the-as uint 0) (the-as pointer s2-0) (the-as uint 32))
)
(set! *load-str-lock* #t)
(set! *que-str-lock* #t)
#t
)
(defun str-load-status ((arg0 (pointer int32)))
(if (check-busy *load-str-rpc*)
(return 'busy)
)
(set! *load-str-lock* #f)
(set! *que-str-lock* #t)
(let ((v1-7 (the-as load-chunk-msg (pop-last-received *load-str-rpc*))))
(if (= (-> v1-7 result) (load-msg-result error))
(return 'error)
)
(set! (-> arg0 0) (the-as int (-> v1-7 maxlen)))
)
'complete
)
(defun str-load-cancel ()
(set! *load-str-lock* #f)
(set! *que-str-lock* #t)
0
(none)
)
(defun str-play-async ((arg0 string) (arg1 sound-id))
(set! *que-str-lock* #t)
(let ((s4-0 (the-as play-chunk-msg (add-element *play-str-rpc*))))
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename)) arg0 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 1)) "" 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 2)) "" 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 3)) "" 48)
(set! (-> s4-0 id 0) (the-as uint arg1))
(set! (-> s4-0 id 1) (the-as uint 0))
(set! (-> s4-0 id 2) (the-as uint 0))
(set! (-> s4-0 id 3) (the-as uint 0))
(set! (-> s4-0 result) (the-as uint 0))
)
0
0
(none)
)
(defun str-play-stop ((arg0 string) (arg1 sound-id))
(set! *que-str-lock* #t)
(let ((s4-0 (the-as play-chunk-msg (add-element *play-str-rpc*))))
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename)) arg0 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 1)) "" 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 2)) "" 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 3)) "" 48)
(set! (-> s4-0 id 0) (the-as uint arg1))
(set! (-> s4-0 id 1) (the-as uint 0))
(set! (-> s4-0 id 2) (the-as uint 0))
(set! (-> s4-0 id 3) (the-as uint 0))
(set! (-> s4-0 result) (the-as uint 1))
)
0
(none)
)
(defun str-play-queue ((arg0 string) (arg1 string) (arg2 string) (arg3 string) (arg4 (pointer uint32)) (arg5 pointer))
(when (and (not (check-busy *play-str-rpc*)) (not *load-str-lock*) (not *que-str-lock*))
(let ((s4-0 (the-as play-chunk-msg (add-element *play-str-rpc*))))
(if arg0
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename)) arg0 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename)) "" 48)
)
(if arg1
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 1)) arg1 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 1)) "" 48)
)
(if arg2
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 2)) arg2 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 2)) "" 48)
)
(if arg3
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 3)) arg3 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 3)) "" 48)
)
(dotimes (v1-15 4)
(set! (-> s4-0 id v1-15) (-> arg4 v1-15))
)
(set! (-> s4-0 address) arg5)
(set! (-> s4-0 result) (the-as uint 2))
)
)
(set! *que-str-lock* #f)
0
(none)
)
(defun str-ambient-play ((arg0 string))
(set! *que-str-lock* #t)
(let ((s5-0 (the-as load-chunk-msg (add-element *play-str-rpc*))))
(set! (-> s5-0 basename name 0) (the-as uint 36))
(copyn-charp<-string (&-> s5-0 basename name 1) arg0 48)
(set! (-> s5-0 result) (load-msg-result done))
)
0
0
(none)
)
(defun str-ambient-stop ((arg0 string))
(set! *que-str-lock* #t)
(let ((s5-0 (the-as load-chunk-msg (add-element *play-str-rpc*))))
(set! (-> s5-0 basename name 0) (the-as uint 36))
(copyn-charp<-string (&-> s5-0 basename name 1) arg0 48)
(set! (-> s5-0 result) (load-msg-result error))
)
0
(none)
)
(defun str-play-kick ()
(cond
((check-busy *play-str-rpc*)
)
(else
(call *play-str-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0))
)
)
0
(none)
)
(define *dgo-time* (the-as time-frame 0))
(defun dgo-load-begin ((arg0 string) (arg1 pointer) (arg2 pointer) (arg3 pointer))
(set! *dgo-time* (the-as time-frame (-> *display* real-clock integral-frame-counter)))
(format 0 "Starting level load clock~%")
(sync *load-dgo-rpc* #t)
(let ((s2-0 (the-as load-dgo-msg (add-element *load-dgo-rpc*))))
(set! (-> s2-0 result) (load-msg-result invalid))
(set! (-> s2-0 b1) arg1)
(set! (-> s2-0 b2) arg2)
(set! (-> s2-0 bt) arg3)
(set! (-> s2-0 name) (string->sound-name arg0))
(call *load-dgo-rpc* (the-as uint 0) (the-as pointer s2-0) (the-as uint 32))
s2-0
)
)
(defun dgo-load-get-next ((arg0 (pointer symbol)))
(set! (-> arg0 0) #f)
(let ((gp-0 (the-as pointer #f)))
(when (not (check-busy *load-dgo-rpc*))
(let ((v1-4 (the-as load-dgo-msg (pop-last-received *load-dgo-rpc*))))
(when v1-4
(when (or (= (-> v1-4 result) (load-msg-result done)) (= (-> v1-4 result) (load-msg-result more)))
(set! gp-0 (-> v1-4 b1))
(set! (-> arg0 0) #t)
)
(if (= (-> v1-4 result) (load-msg-result more))
(set! (-> arg0 0) #f)
)
(if (= (-> v1-4 result) (load-msg-result done))
(format
0
"Elapsed time for level = ~Fs~%"
(* 0.016666668 (the float (- (-> *display* real-clock integral-frame-counter) (the-as uint *dgo-time*))))
)
)
)
)
)
gp-0
)
)
(defun dgo-load-continue ((arg0 pointer) (arg1 pointer) (arg2 pointer))
(let ((gp-0 (the-as load-dgo-msg (add-element *load-dgo-rpc*))))
(set! (-> gp-0 result) (load-msg-result invalid))
(set! (-> gp-0 b1) arg0)
(set! (-> gp-0 b2) arg1)
(set! (-> gp-0 bt) arg2)
(set! (-> gp-0 name) (the-as uint128 0))
(call *load-dgo-rpc* (the-as uint 1) (the-as pointer gp-0) (the-as uint 32))
gp-0
)
)
(defun dgo-load-cancel ()
(sync *load-dgo-rpc* #t)
(let ((a2-0 (add-element *load-dgo-rpc*)))
(call *load-dgo-rpc* (the-as uint 2) a2-0 (the-as uint 32))
)
0
(none)
)
(defun find-temp-buffer ((arg0 int))
(let ((gp-0 (+ (/ arg0 16) 2)))
(cond
((< (the-as uint gp-0)
(the-as uint (dma-buffer-free (-> *display* frames (-> *display* on-screen) global-buf)))
)
(logand -16 (&+ (-> *display* frames (-> *display* on-screen) global-buf base) 15))
)
((< (the-as uint gp-0)
(the-as uint (dma-buffer-free (-> *display* frames (-> *display* on-screen) global-buf)))
)
(logand -16 (&+ (-> *display* frames (-> *display* on-screen) global-buf base) 15))
)
)
)
)
(defun dgo-load-link ((arg0 dgo-header) (arg1 kheap) (arg2 uint) (arg3 symbol) (arg4 symbol))
(let ((s4-0 (the-as object (&+ arg0 64))))
(let ((v1-0 arg2))
(cond
((>= (the-as int (+ (the-as uint s4-0) (-> arg0 length))) (the-as int (-> arg1 top-base)))
(format
0
"ERROR: -----> dgo file header ~g #x~X has overrun heap #x~X by ~D bytes. This is very bad!~%"
(-> arg0 rootname)
arg0
arg1
(- (+ (the-as uint s4-0) (-> arg0 length)) (the-as uint (-> arg1 top-base)))
)
)
((and (< (the-as int arg0) (the-as int v1-0))
(>= (the-as int (+ (the-as uint s4-0) (-> arg0 length))) (the-as int v1-0))
)
(format
0
"ERROR: -----> dgo file header ~g #x~X has overrun heap #x~X by ~D bytes. This is very bad!~%"
(-> arg0 rootname)
arg0
arg1
(- (+ (the-as uint s4-0) (-> arg0 length)) v1-0)
)
)
)
)
(if arg4
(format
0
"NOTICE: loaded ~g, ~D bytes (~f K) at top ~D at #x~X~%"
(-> arg0 rootname)
(-> arg0 length)
(* 0.0009765625 (the float (-> arg0 length)))
(- (+ (the-as uint s4-0) (-> arg0 length)) (the-as uint (-> arg1 base)))
arg0
)
)
(string<-charp (clear *dgo-name*) (-> arg0 rootname))
(nonzero? (link-begin
(the-as pointer s4-0)
(-> *dgo-name* data)
(the-as int (-> arg0 length))
arg1
(the-as link-flag (if arg3
47
39
)
)
)
)
)
)
(defun destroy-mem ((arg0 (pointer uint32)) (arg1 (pointer uint32)))
(while (< (the-as int arg0) (the-as int arg1))
(set! (-> arg0 0) (the-as uint #xffffffff))
(set! arg0 (&-> arg0 1))
)
0
(none)
)
+54
View File
@@ -7,3 +7,57 @@
;; DECOMP BEGINS
(deftype ramdisk-rpc-fill (structure)
((rsvd1 int32 :offset-assert 0)
(ee-id int32 :offset-assert 4)
(rsvd2 int32 2 :offset-assert 8)
(filename uint128 :offset-assert 16)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
(deftype ramdisk-rpc-load (structure)
((rsvd int32 :offset-assert 0)
(ee-id int32 :offset-assert 4)
(offset uint32 :offset-assert 8)
(length uint32 :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(deftype ramdisk-rpc-load-to-ee (structure)
((rsvd int32 :offset-assert 0)
(addr int32 :offset-assert 4)
(offset int32 :offset-assert 8)
(length int32 :offset-assert 12)
(filename uint128 :offset-assert 16)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
(define *ramdisk-rpc* (new 'global 'rpc-buffer-pair (the-as uint 32) (the-as uint 1) 2))
(define *current-ramdisk-id* 0)
(defun ramdisk-load ((arg0 int) (arg1 uint) (arg2 uint) (arg3 pointer))
(let ((v1-1 (the-as ramdisk-rpc-load (add-element *ramdisk-rpc*))))
(set! (-> v1-1 offset) arg1)
(set! (-> v1-1 ee-id) arg0)
(set! (-> v1-1 length) arg2)
)
(call *ramdisk-rpc* (the-as uint 0) arg3 arg2)
0
)
(defun ramdisk-sync ()
(sync *ramdisk-rpc* #t)
0
(none)
)
+1 -1
View File
@@ -64,7 +64,7 @@
(set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14)
(set-roll-to-grav! (_type_ float) quaternion 15)
(set-roll-to-grav-2! (_type_ float) quaternion 16)
(rotate-toward-orientation! (_type_ quaternion float float) quaternion 17)
(rotate-toward-orientation! (_type_ quaternion float float int float float) quaternion 17)
(set-quaternion! (_type_ quaternion) quaternion 18)
(set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19)
(point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20)
+469
View File
@@ -7,3 +7,472 @@
;; DECOMP BEGINS
(defmethod print transformq ((obj transformq))
"Print a transformq"
(format #t "#<transformq @ #x~X~%" obj)
(format #t "~T~Ttrans:~F ~F ~F ~F ~%" (-> obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w))
(format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> obj quat x) (-> obj quat y) (-> obj quat z) (-> obj quat w))
(format #t "~T~Tscale:~F ~F ~F ~F>" (-> obj scale x) (-> obj scale y) (-> obj scale z) (-> obj scale w))
obj
)
(defmethod get-quaternion trsqv ((obj trsqv))
"Get the rotation as a quaternion."
(-> obj quat)
)
(defmethod set-quaternion! trsqv ((obj trsqv) (arg0 quaternion))
"Set the rotation as a quaternion"
(quaternion-copy! (get-quaternion obj) arg0)
)
(defmethod rot->dir-targ! trsqv ((obj trsqv))
"Set the dir-targ to our current orientation"
(quaternion-copy! (-> obj dir-targ) (get-quaternion obj))
)
(defmethod y-angle trsqv ((obj trsqv))
"Get our current y-angle (y is up, so yaw)"
(quaternion-y-angle (get-quaternion obj))
)
(defmethod seek-toward-heading-vec! trsqv ((obj trsqv) (arg0 vector) (arg1 float) (arg2 time-frame))
"Adjust the orientation to point along dir, only changing our yaw.
The vel is a maximum velocity limit.
The frame count is the time constant (first order).
There's some logic to avoid rapidly changing directions"
(with-pp
(let* ((f0-0 (deg-diff (quaternion-y-angle (-> obj quat)) (vector-y-angle arg0)))
(f1-2 (fmin (* arg1 (-> pp clock seconds-per-frame)) (/ (* 5.0 (fabs f0-0)) (the float arg2))))
(f30-0 (fmax (fmin f0-0 f1-2) (- f1-2)))
)
(let ((f0-2 (-> obj old-y-angle-diff)))
(set! f30-0 (cond
((or (= f0-2 0.0)
(and (< 0.0 f30-0) (< 0.0 f0-2))
(or (and (< f30-0 0.0) (< f0-2 0.0))
(>= (- (-> pp clock frame-counter) (-> obj angle-change-time)) (seconds 0.2))
)
)
(set! (-> obj angle-change-time) (-> pp clock frame-counter))
f30-0
)
(else
(* 0.000000001 f30-0)
)
)
)
)
(set! (-> obj old-y-angle-diff) f30-0)
(let ((a1-2 (get-quaternion obj)))
(quaternion-rotate-y! a1-2 a1-2 f30-0)
)
)
)
)
(defmethod set-heading-vec! trsqv ((obj trsqv) (arg0 vector))
"Makes us look in the arg0 direction immediately. Pitch will be unchanged."
(let ((s3-0 (get-quaternion obj)))
(forward-up-nopitch->quaternion
s3-0
(vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0)
(vector-y-quaternion! (new 'stack-no-clear 'vector) s3-0)
)
)
)
(defmethod seek-to-point-toward-point! trsqv ((obj trsqv) (arg0 vector) (arg1 float) (arg2 time-frame))
"Seek toward pointing toward arg0 from our current location."
(seek-toward-heading-vec! obj (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) arg1 arg2)
)
(defmethod point-toward-point! trsqv ((obj trsqv) (arg0 vector))
"Immediately point toward arg0"
(let ((s3-0 (get-quaternion obj)))
(forward-up-nopitch->quaternion
s3-0
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) 1.0)
(vector-y-quaternion! (new 'stack-no-clear 'vector) s3-0)
)
)
)
(defmethod seek-toward-yaw-angle! trsqv ((obj trsqv) (arg0 float) (arg1 float) (arg2 time-frame))
"Seek toward the given yaw angle."
(let ((s3-0 (method-of-object obj seek-toward-heading-vec!))
(s2-0 (new 'stack-no-clear 'vector))
)
(set! (-> s2-0 x) (sin arg0))
(set! (-> s2-0 y) 0.0)
(set! (-> s2-0 z) (cos arg0))
(set! (-> s2-0 w) 1.0)
(s3-0 obj s2-0 arg1 arg2)
)
)
(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((obj trsqv) (arg0 float))
"Immediately clear our roll and pitch and set yaw to the given angle"
(let ((s5-0 (method-of-object obj set-heading-vec-clear-roll-pitch!))
(s4-0 (new 'stack-no-clear 'vector))
)
(set! (-> s4-0 x) (sin arg0))
(set! (-> s4-0 y) 0.0)
(set! (-> s4-0 z) (cos arg0))
(set! (-> s4-0 w) 1.0)
(s5-0 obj s4-0)
)
)
(defmethod set-roll-to-grav! trsqv ((obj trsqv) (arg0 float))
"Set our roll so that our local down aligns with standard gravity"
(set-roll-to-grav-2! obj arg0)
)
(defmethod set-roll-to-grav-2! trsqv ((obj trsqv) (arg0 float))
"Set our roll so that our local down aligns with standard gravity"
(let* ((s5-0 (get-quaternion obj))
(s1-0 (-> *standard-dynamics* gravity-normal))
(s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) s5-0))
)
(let ((s4-0 (&-> s3-0 data 8)))
(vector-normalize! (vector-flatten! (the-as vector (&-> s3-0 data 4)) s1-0 (the-as vector s4-0)) 1.0)
(vector-cross! (the-as vector (-> s3-0 data)) (the-as vector (&-> s3-0 data 4)) (the-as vector s4-0))
)
(let ((a1-5 (matrix-rotate-z! (new 'stack-no-clear 'matrix) arg0)))
(matrix*! s3-0 a1-5 s3-0)
)
(matrix->quaternion s5-0 s3-0)
)
)
(defmethod roll-relative-to-gravity trsqv ((obj trsqv))
"Get our roll, relative to 'down' from gravity"
(let* ((s5-0 (get-quaternion obj))
(gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) s5-0))
(s5-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0))
(a1-2 (-> *standard-dynamics* gravity-normal))
(v1-2 (vector-normalize! (vector-flatten! (new 'stack-no-clear 'vector) a1-2 gp-0) 1.0))
(f0-1 (vector-dot v1-2 s5-1))
)
(if (< (vector-dot (vector-cross! (new 'stack-no-clear 'vector) v1-2 s5-1) gp-0) 0.0)
(- (acos f0-1))
(acos f0-1)
)
)
)
(defmethod rotate-toward-orientation! trsqv ((obj trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 float) (arg5 float))
"Adjust our orientation toward target, subject to some rate limits.
For jak 1, I said:
I don't think this is a very robust function and probably doesn't work right in cases
where an axis flips by 180 degrees.
But now they use matrix-from-two-vectors-the-long-way-smooth to fix it! Good job.
This additionally uses the fancy logic of matrix-from-two-vectors-smooth."
(local-vars
(f0-4 float)
(sv-192 (function quaternion vector vector float int quaternion))
(sv-208 quaternion)
(sv-224 vector)
(sv-240 float)
(sv-256 vector)
(sv-272 vector)
)
(set! sv-240 arg4)
(let ((s2-0 arg5)
(s5-0 (get-quaternion obj))
)
(let ((gp-0 (new 'stack-no-clear 'quaternion)))
(when (< 0.0 arg2)
(set! sv-192 quaternion-from-two-vectors-smooth!)
(set! sv-208 gp-0)
(set! sv-224 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0))
(let ((a2-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) arg0)))
(sv-192 sv-208 sv-224 a2-1 arg2 (the-as int sv-240))
)
(quaternion-normalize! (quaternion*! s5-0 gp-0 s5-0))
)
(when (< 0.0 arg1)
(set! sv-256 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0))
(let ((s1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) s5-0)))
(set! sv-272 (vector-z-quaternion! (new 'stack-no-clear 'vector) arg0))
(let ((s0-1 (new 'stack-no-clear 'matrix)))
(vector-flatten! s1-2 s1-2 sv-256)
(vector-flatten! sv-272 sv-272 sv-256)
(vector-normalize! s1-2 1.0)
(vector-normalize! sv-272 1.0)
(cond
((!= s2-0 0.0)
(let* ((v1-5 (vector-cross! (new 'stack-no-clear 'vector) s1-2 sv-272))
; (f0-3 (-> sv-256 x))
; (f1-3 (-> sv-256 y))
; (f2-0 (-> sv-256 z))
; (f3-0 (-> v1-5 x))
; (f4-0 (-> v1-5 y))
; (f5-0 (-> v1-5 z))
)
(set! f0-4 (vector-dot sv-256 v1-5))
; (.mula.s f0-3 f3-0)
; (.madda.s f1-3 f4-0)
; (.madd.s f0-4 f2-0 f5-0)
)
(if (< (* f0-4 s2-0) 0.0)
(matrix-from-two-vectors-the-long-way-smooth! s0-1 s1-2 sv-272 arg1 arg3)
(matrix-from-two-vectors-smooth! s0-1 s1-2 sv-272 arg1 arg3)
)
)
(else
(matrix-from-two-vectors-smooth! s0-1 s1-2 sv-272 arg1 arg3)
)
)
(matrix->quaternion gp-0 s0-1)
)
)
(quaternion-normalize! (quaternion*! s5-0 gp-0 s5-0))
)
)
s5-0
)
)
(defmethod set-heading-vec-clear-roll-pitch! trsqv ((obj trsqv) (arg0 vector))
"Set our rotation to point along the given heading, with no roll or pitch."
(forward-up->quaternion
(get-quaternion obj)
(vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0)
(new 'static 'vector :y 1.0 :w 1.0)
)
)
(defmethod point-toward-point-clear-roll-pitch! trsqv ((obj trsqv) (arg0 vector))
"Set our orientation to point toward arg0, clearing roll and pitch"
(forward-up->quaternion
(get-quaternion obj)
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) 1.0)
(new 'static 'vector :y 1.0 :w 1.0)
)
)
(defun transformq-copy! ((arg0 transformq) (arg1 transformq))
"Set arg0 = arg1"
(let ((v1-0 (-> arg1 trans quad))
(a2-0 (-> arg1 quat vec quad))
(a1-1 (-> arg1 scale quad))
)
(set! (-> arg0 trans quad) v1-0)
(set! (-> arg0 quat vec quad) a2-0)
(set! (-> arg0 scale quad) a1-1)
)
arg0
)
(defun matrix<-transformq! ((arg0 matrix) (arg1 transformq))
"Convert to 4x4 affine transform."
(local-vars (v1-1 float))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
)
(init-vf0-vector)
(quaternion->matrix arg0 (-> arg1 quat))
(cond
(#f
(set! (-> arg0 trans quad) (-> arg1 trans quad))
)
(else
(.lvf vf1 (&-> arg1 scale quad))
(.lvf vf2 (&-> arg1 trans quad))
(.lvf vf3 (&-> arg0 vector 0 quad))
(.lvf vf4 (&-> arg0 vector 1 quad))
(.lvf vf5 (&-> arg0 vector 2 quad))
(.mov.vf vf2 vf0 :mask #b1000)
(.mul.x.vf vf3 vf3 vf1)
(.mul.y.vf vf4 vf4 vf1)
(.mul.z.vf vf5 vf5 vf1)
(.svf (&-> arg0 trans quad) vf2)
(.svf (&-> arg0 vector 0 quad) vf3)
(.svf (&-> arg0 vector 1 quad) vf4)
(.svf (&-> arg0 vector 2 quad) vf5)
(.mov v1-1 vf5)
)
)
arg0
)
)
(defun matrix<-no-trans-transformq! ((arg0 matrix) (arg1 transformq))
"Create 4x4 affine transform with no translation."
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
)
(init-vf0-vector)
(quaternion->matrix arg0 (-> arg1 quat))
(.lvf vf1 (&-> arg1 scale quad))
(.lvf vf3 (&-> arg0 vector 0 quad))
(.lvf vf4 (&-> arg0 vector 1 quad))
(.lvf vf5 (&-> arg0 vector 2 quad))
(.mov.vf vf2 vf0)
(.mul.x.vf vf3 vf3 vf1)
(.mul.y.vf vf4 vf4 vf1)
(.mul.z.vf vf5 vf5 vf1)
(.svf (&-> arg0 trans quad) vf2)
(.svf (&-> arg0 vector 0 quad) vf3)
(.svf (&-> arg0 vector 1 quad) vf4)
(.svf (&-> arg0 vector 2 quad) vf5)
arg0
)
)
(defun matrix<-transformq+trans! ((arg0 matrix) (arg1 transformq) (arg2 vector))
"Convert to affine transform with an additional translation (in the local frame)."
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(quaternion->matrix arg0 (-> arg1 quat))
(.lvf vf1 (&-> arg1 scale quad))
(.lvf vf2 (&-> arg1 trans quad))
(.lvf vf6 (&-> arg2 quad))
(.lvf vf3 (&-> arg0 vector 0 quad))
(.lvf vf4 (&-> arg0 vector 1 quad))
(.lvf vf5 (&-> arg0 vector 2 quad))
(.mov.vf vf2 vf0 :mask #b1000)
(.mul.x.vf vf3 vf3 vf1)
(.mul.y.vf vf4 vf4 vf1)
(.mul.z.vf vf5 vf5 vf1)
(.mul.x.vf acc vf3 vf6)
(.add.mul.y.vf acc vf4 vf6 acc)
(.add.mul.z.vf acc vf5 vf6 acc)
(.add.mul.w.vf vf2 vf2 vf0 acc :mask #b111)
(.svf (&-> arg0 trans quad) vf2)
(.svf (&-> arg0 vector 0 quad) vf3)
(.svf (&-> arg0 vector 1 quad) vf4)
(.svf (&-> arg0 vector 2 quad) vf5)
arg0
)
)
(defun matrix<-transformq+world-trans! ((arg0 matrix) (arg1 transformq) (arg2 vector))
"Convert to affine transform with an additional translation in the world frame (not rotated)"
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(quaternion->matrix arg0 (-> arg1 quat))
(.lvf vf1 (&-> arg1 scale quad))
(.lvf vf2 (&-> arg1 trans quad))
(.lvf vf6 (&-> arg2 quad))
(.lvf vf3 (&-> arg0 vector 0 quad))
(.lvf vf4 (&-> arg0 vector 1 quad))
(.lvf vf5 (&-> arg0 vector 2 quad))
(.mov.vf vf2 vf0 :mask #b1000)
(.mul.x.vf vf3 vf3 vf1)
(.mul.y.vf vf4 vf4 vf1)
(.mul.z.vf vf5 vf5 vf1)
(.add.vf vf2 vf2 vf6 :mask #b111)
(.svf (&-> arg0 trans quad) vf2)
(.svf (&-> arg0 vector 0 quad) vf3)
(.svf (&-> arg0 vector 1 quad) vf4)
(.svf (&-> arg0 vector 2 quad) vf5)
arg0
)
)
(defun matrix<-parented-transformq! ((arg0 matrix) (arg1 transformq) (arg2 vector))
"Unused. Seems like the parented thing means there's an inverse scale in arg2."
(local-vars (v1-1 float))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(quaternion->matrix arg0 (-> arg1 quat))
(let ((v1-0 (new 'stack-no-clear 'vector)))
(set! (-> v1-0 x) (/ 1.0 (-> arg2 x)))
(set! (-> v1-0 y) (/ 1.0 (-> arg2 y)))
(set! (-> v1-0 z) (/ 1.0 (-> arg2 z)))
(.lvf vf1 (&-> arg1 scale quad))
(.lvf vf2 (&-> arg1 trans quad))
(.mov.vf vf2 vf0 :mask #b1000)
(.lvf vf4 (&-> arg0 vector 0 quad))
(.lvf vf5 (&-> arg0 vector 1 quad))
(.lvf vf6 (&-> arg0 vector 2 quad))
(.mul.x.vf vf4 vf4 vf1)
(.mul.y.vf vf5 vf5 vf1)
(.mul.z.vf vf6 vf6 vf1)
(.lvf vf3 (&-> v1-0 quad))
)
(.mul.vf vf4 vf4 vf3)
(.mul.vf vf5 vf5 vf3)
(.mul.vf vf6 vf6 vf3)
(.svf (&-> arg0 trans quad) vf2)
(.svf (&-> arg0 vector 0 quad) vf4)
(.svf (&-> arg0 vector 1 quad) vf5)
(.svf (&-> arg0 vector 2 quad) vf6)
(.mov v1-1 vf6)
arg0
)
)
(defun matrix<-transformq+rot-offset! ((arg0 matrix) (arg1 transformq) (arg2 vector))
"Affine transform for a point offset in the destination frame of the transformq (rather than just
adding an offset at the end)"
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(quaternion->matrix arg0 (-> arg1 quat))
(.lvf vf1 (&-> arg1 scale quad))
(.lvf vf2 (&-> arg1 trans quad))
(.lvf vf6 (&-> arg2 quad))
(.lvf vf3 (&-> arg0 vector 0 quad))
(.lvf vf4 (&-> arg0 vector 1 quad))
(.lvf vf5 (&-> arg0 vector 2 quad))
(.mov.vf vf2 vf0 :mask #b1000)
(.mul.x.vf vf3 vf3 vf1)
(.mul.y.vf vf4 vf4 vf1)
(.mul.z.vf vf5 vf5 vf1)
(.mul.x.vf acc vf3 vf6)
(.add.mul.y.vf acc vf4 vf6 acc)
(.add.mul.z.vf acc vf5 vf6 acc)
(.sub.mul.w.vf acc vf6 vf0 acc) ;; this line is added compared to the +trans! one
(.add.mul.w.vf vf2 vf2 vf0 acc :mask #b111)
(.svf (&-> arg0 trans quad) vf2)
(.svf (&-> arg0 vector 0 quad) vf3)
(.svf (&-> arg0 vector 1 quad) vf4)
(.svf (&-> arg0 vector 2 quad) vf5)
arg0
)
)
+101 -49
View File
@@ -5,34 +5,59 @@
;; name in dgo: gsound-h
;; dgos: ENGINE, GAME
;; TODO: methods for ambient-sound.
(defenum sound-command
:type uint16
; (load-bank)
; (load-music)
; (unload-bank)
; (play)
; (pause-sound)
; (stop-sound)
; (continue-sound)
; (set-param)
; (set-master-volume)
; (pause-group)
; (stop-group)
; (continue-group)
; (get-irx-version)
; (set-falloff-curve)
; (set-sound-falloff)
; (reload-info)
; (set-language)
; (set-flava)
; (set-reverb)
; (set-ear-trans)
; (shutdown)
; (list-sounds)
; (unload-music)
; (set-fps)
(iop-store 0) ;; sound-rpc-bank-cmd
(iop-free 1) ;; sound-rpc-bank-cmd
(load-bank 2) ;; sound-rpc-load-bank
(load-bank-from-iop 3) ;; sound-rpc-load-bank
(load-bank-from-ee 4) ;; sound-rpc-load-bank
(load-music 5) ;; sound-rpc-load-music
(unload-bank 6) ;; sound-rpc-bank-cmd
(play 7) ;; sound-rpc-play
(pause-sound 8) ;; sound-rpc-pause-sound
(stop-sound 9) ;; sound-rpc-stop-sound
(continue-sound 10) ;; sound-rpc-continue-sound
(set-param 11)
(set-master-volume 12) ;; sound-rpc-set-master-volume
(pause-group 13) ;; sound-rpc-pause-group
(stop-group 14) ;; sound-rpc-stop-group
(continue-group 15) ;; sound-rpc-continue-group
(get-irx-version 16)
(set-falloff-curve 17)
(set-sound-falloff 18)
(reload-info 19)
(set-language 20) ;; sound-rpc-set-language
(set-flava 21) ;; sound-rpc-set-flava
(set-midi-reg 22) ;; sound-rpc-set-midi-reg
(set-reverb 23) ;; sound-rpc-set-reverb
(set-ear-trans 24) ;; sound-rpc-set-ear-trans
(shutdown 25)
(list-sounds 26) ;; sound-rpc-list-sounds
(unload-music 27) ;; sound-rpc-unload-music
(set-fps 28) ;; sound-rpc-set-fps
(boot-load 29)
(game-load 30)
(num-tests 31)
(num-testruns 32)
(num-sectors 33)
(num-streamsectors 34)
(num-streambanks 35)
(track-pitch 36)
(linvel-nom 37)
(linvel-stm 38)
(seek-nom 39)
(seek-stm 40)
(read-seq-nom 41)
(read-seq-stm 42)
(read-spr-nom 43)
(read-spr-stm 44)
(read-spr-strn-nom 45)
(rand-stm-abort 46)
(rand-nom-abort 47)
(iop-mem 48)
(cancel-dgo 49)
(set-stereo-mode 50) ;; sound-rpc-set-stereo-mode
)
(defenum sound-group
@@ -70,12 +95,30 @@
(fo-curve)
)
(defenum stream-status
:type uint32
:bitfield #t
(zero 0)
(one 1) ;; another way to be playing
(two 2)
(three 3)
(four 4) ;; is playing?
(five 5)
(six 6) ;; another way to be playing.
(seven 7)
)
(defenum stereo-mode
:type int32
)
;; DECOMP BEGINS
(deftype sound-stream-name (structure)
((name uint8 48 :offset-assert 0)
)
:pack-me
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
@@ -117,17 +160,18 @@
)
(deftype sound-play-params (structure)
((mask uint16 :offset-assert 0)
(pitch-mod int16 :offset-assert 2)
(bend int16 :offset-assert 4)
(fo-min int16 :offset-assert 6)
(fo-max int16 :offset-assert 8)
(fo-curve int8 :offset-assert 10)
(priority int8 :offset-assert 11)
(volume int32 :offset-assert 12)
(trans int32 3 :offset-assert 16)
(group uint8 :offset-assert 28)
(reg uint8 3 :offset-assert 29)
((mask uint16 :offset-assert 0)
(pitch-mod int16 :offset-assert 2)
(bend int16 :offset-assert 4)
(fo-min int16 :offset-assert 6)
(fo-max int16 :offset-assert 8)
(fo-curve int8 :offset-assert 10)
(priority int8 :offset-assert 11)
(volume int32 :offset-assert 12)
(trans int32 3 :offset-assert 16)
(group uint8 :offset-assert 28)
(reg uint8 3 :offset-assert 29)
(group-and-regs uint32 :offset 28)
)
:allow-misaligned
:method-count-assert 9
@@ -135,7 +179,6 @@
:flag-assert #x900000020
)
(deftype sound-rpc-bank-cmd (sound-rpc-cmd)
((bank-name sound-name :offset-assert 16)
)
@@ -145,8 +188,8 @@
)
(deftype sound-rpc-test-cmd (sound-rpc-cmd)
((ee-addr uint32 :offset-assert 4)
(param0 uint16 :offset-assert 8)
((ee-addr pointer :offset-assert 4)
(param0 uint16 :offset-assert 8)
)
:method-count-assert 9
:size-assert #xa
@@ -170,7 +213,7 @@
)
(deftype sound-rpc-load-bank (sound-rpc-bank-cmd)
((ee-addr uint32 :offset-assert 32)
((ee-addr pointer :offset-assert 32)
)
:method-count-assert 9
:size-assert #x24
@@ -389,6 +432,7 @@
(num float :offset-assert 8)
(group sound-group :offset-assert 12)
(reg uint8 3 :offset-assert 13)
(group-and-regs uint32 :offset 12)
(sound-name-char uint8 16 :offset-assert 16)
(sound-name sound-name :offset 16)
(trans int32 4 :offset-assert 32)
@@ -406,7 +450,6 @@
:size-assert #x4c
:flag-assert #x90000004c
)
(define *current-sound-id* (the-as sound-id #x10000))
(deftype ambient-sound (basic)
@@ -431,16 +474,25 @@
:size-assert #x6c
:flag-assert #x100000006c
(:methods
(ambient-sound-method-9 () none 9)
(ambient-sound-method-10 () none 10)
(ambient-sound-method-11 () none 11)
(ambient-sound-method-12 () none 12)
(ambient-sound-method-13 () none 13)
(ambient-sound-method-14 () none 14)
(ambient-sound-method-15 () none 15)
(new (symbol type basic vector) _type_ 0)
(update! (_type_) int 9)
(change-sound! (_type_ sound-name) int 10)
(update-trans! (_type_ vector) int 11)
(update-vol! (_type_ float) int 12)
(update-pitch-mod! (_type_ float) none 13)
(set-falloff-far! (_type_ float) none 14)
(stop! (_type_) int 15)
)
)
;; DECOMP ENDS
(define-extern string->sound-name (function string sound-name))
(define-extern get-sound-buffer-entry (function pointer))
(define-extern sound-set-ear-trans (function vector vector vector float int))
(define-extern ear-trans (function int vector))
;; ghost function
(define-extern *debug-effect-control* symbol)
(define-extern effect-param->sound-spec (function sound-spec (pointer float) int sound-spec))
File diff suppressed because it is too large Load Diff
+1
View File
@@ -111,3 +111,4 @@
; what is this.
;(new 'static 'boxed-array :type type pilot-info mech-info turret-info indax-info tube-info)
(define-extern target-pos (function int vector))
@@ -504,3 +504,8 @@
:size-assert #x54
:flag-assert #xc00000054
)
;; DECOMP ENDS
(define-extern *progress-process* (pointer progress))
(define-extern activate-progress (function process symbol none))
+5
View File
@@ -140,6 +140,11 @@
(define-extern rpc-call (function int uint uint uint int uint int uint))
(define-extern string->symbol (function string symbol))
(define-extern link-begin (function pointer (pointer uint8) int kheap link-flag int))
(define-extern kset-language (function language-enum int))
(define-extern syncv (function int int))
;; PC stuff
(defenum pc-prof-event
(begin 0)
+97
View File
@@ -145,6 +145,30 @@
)
)
(defconstant *scratch-memory-top* (the pointer #x70004000))
(defconstant DPROCESS_STACK_SIZE #x8000)
;; gkernel
(defconstant *kernel-dram-stack* (&+ *dram-stack* DPROCESS_STACK_SIZE))
(defmacro process-spawn-function (proc-type func &key (from *default-dead-pool*) &key (to *default-pool*) &key (name #f) &key (stack-size #x4000) &key (stack *scratch-memory-top*) &rest args)
"Start a new process that runs a function on its main thread.
Returns a pointer to the new process (or #f? on error)."
(with-gensyms (new-proc)
`(let ((,new-proc (the-as ,proc-type (get-process ,from ,proc-type ,stack-size))))
(when ,new-proc
((method-of-type ,proc-type activate) ,new-proc ,to ,(if name name `(quote ,proc-type)) ,stack)
(run-next-time-in-process ,new-proc ,func ,@args)
(the (pointer ,proc-type) (-> ,new-proc ppointer))
)
)
)
)
(defmacro b! (pred destination &key (delay '()) &key (likely-delay '()))
"Branch!"
;; evaluate the predicate
@@ -695,4 +719,77 @@
,@(apply-i (lambda (x i) `(set! (-> event-data param ,i) (the-as uint ,x))) params)
(send-event-function ,proc event-data)
)
)
(defmacro setting-control-func! (func s &rest args)
(let ((argb #f)
(argi 0)
(argf 0.0)
(setting (cadr s)))
(cond
; ((or (eq? setting 'border-mode)
; (eq? setting 'allow-look-around)
; (eq? setting 'ocean-off)
; (eq? setting 'music)
; (eq? setting 'vibration)
; (eq? setting 'auto-save)
; (eq? setting 'allow-pause)
; (eq? setting 'allow-progress)
; (eq? setting 'play-hints)
; (eq? setting 'movie)
; (eq? setting 'talking)
; (eq? setting 'spooling)
; (eq? setting 'hint)
; (eq? setting 'ambient)
; )
; (set! argb (car args))
; )
; ((or (eq? setting 'bg-r)
; (eq? setting 'bg-g)
; (eq? setting 'bg-b)
; (eq? setting 'bg-a)
; (eq? setting 'bg-a-speed)
; (eq? setting 'bg-a-force)
; )
; (set! argf (car args))
; )
; ((or (eq? setting 'language)
; )
; (set! argi (car args))
; )
; ((or (eq? setting 'sound-flava)
; )
; (set! argi (car args))
; (set! argf (cadr args))
; )
; ((or (eq? setting 'process-mask)
; (eq? setting 'common-page)
; )
; (set! argb (car args))
; (set! argi (cadr args))
; )
; ((or (eq? setting 'sfx-volume)
; (eq? setting 'music-volume)
; (eq? setting 'ambient-volume)
; (eq? setting 'dialog-volume)
; (eq? setting 'sfx-volume-movie)
; (eq? setting 'music-volume-movie)
; (eq? setting 'ambient-volume-movie)
; (eq? setting 'dialog-volume-hint)
; )
; (set! argb (car args))
; (set! argf (cadr args))
; )
(#t
(set! argb (car args))
(set! argf (cadr args))
(set! argi (caddr args))
)
)
`(,func *setting-control* (with-pp pp) ,s ,argb ,argf ,argi)
)
)
(defmacro set-setting! (s &rest args)
`(setting-control-func! set-setting ,s ,@args)
)
+1
View File
@@ -1613,6 +1613,7 @@
:size-assert #x1dc
:flag-assert #x44000001dc
(:methods
(new (symbol type process-drawable collide-list-enum) _type_ 0)
(collide-shape-moving-method-55 () none 55)
(collide-shape-moving-method-56 () none 56)
(collide-shape-moving-method-57 () none 57)
+2 -4
View File
@@ -71,6 +71,7 @@
:size-assert #x3c10
:flag-assert #xd00003c10
(:methods
(new (symbol type) _type_ 0)
(touching-prims-entry-pool-method-9 () none 9)
(touching-prims-entry-pool-method-10 () none 10)
(init-list! (_type_) none 11)
@@ -177,6 +178,7 @@
:size-assert #x408
:flag-assert #xe00000408
(:methods
(new (symbol type) _type_ 0)
(touching-list-method-9 () none 9)
(touching-list-method-10 () none 10)
(touching-list-method-11 () none 11)
@@ -236,7 +238,3 @@
;; failed to figure out what this is:
(kmemclose)
+4
View File
@@ -515,6 +515,7 @@
:size-assert #x110
:flag-assert #xd00000110
(:methods
(new (symbol type process pickup-type float) _type_ 0)
(fact-info-target-method-12 () none 12)
)
)
@@ -1113,6 +1114,9 @@
:method-count-assert 12
:size-assert #x2c
:flag-assert #xc0000002c
(:methods
(new (symbol type process pickup-type float) _type_ 0)
)
)
;; definition for method 3 of type fact-info-crate
+1 -1
View File
@@ -127,7 +127,7 @@
(reset! (_type_) _type_ 9)
(update! (_type_) int 10)
(want-levels (_type_ (pointer symbol)) int 11)
(load-state-method-12 () none 12)
(want-sound-banks (_type_ (pointer symbol)) none 12)
(want-display-level (_type_ symbol symbol) int 13)
(want-vis-level (_type_ symbol) none 14)
(load-state-method-15 () none 15)
+1 -1
View File
@@ -549,7 +549,7 @@
(new (symbol type int) _type_ 0)
(setting-control-method-9 () none 9)
(setting-control-method-10 () none 10)
(setting-control-method-11 () none 11)
(set-setting (_type_ process symbol object object object) none 11)
(setting-control-method-12 () none 12)
(setting-control-method-13 () none 13)
(setting-control-method-14 () none 14)
+1 -5
View File
@@ -70,7 +70,7 @@
;; definition for symbol *font-context*, type font-context
(define *font-context*
(new 'global 'font-context *font-default-matrix* 0 0 0.0 (font-color zero) (font-flags shadow kerning))
(new 'global 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning))
)
;; definition for function draw-sprite2d-xy
@@ -491,7 +491,3 @@
;; failed to figure out what this is:
(kmemclose)
+453
View File
@@ -0,0 +1,453 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type load-dgo-msg
(deftype load-dgo-msg (structure)
((rsvd uint16 :offset-assert 0)
(result load-msg-result :offset-assert 2)
(b1 pointer :offset-assert 4)
(b2 pointer :offset-assert 8)
(bt pointer :offset-assert 12)
(name uint128 :offset-assert 16)
(address uint32 :offset 4)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; definition for method 3 of type load-dgo-msg
;; INFO: Used lq/sq
(defmethod inspect load-dgo-msg ((obj load-dgo-msg))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'load-dgo-msg)
(format #t "~1Trsvd: ~D~%" (-> obj rsvd))
(format #t "~1Tresult: ~D~%" (-> obj result))
(format #t "~1Tb1: #x~X~%" (-> obj b1))
(format #t "~1Tb2: #x~X~%" (-> obj b2))
(format #t "~1Tbt: #x~X~%" (-> obj bt))
(format #t "~1Tname: ~D~%" (-> obj name))
(format #t "~1Taddress: ~D~%" (-> obj b1))
(label cfg-4)
obj
)
;; definition of type load-chunk-msg
(deftype load-chunk-msg (structure)
((rsvd uint16 :offset-assert 0)
(result load-msg-result :offset-assert 2)
(address pointer :offset-assert 4)
(section uint32 :offset-assert 8)
(maxlen uint32 :offset-assert 12)
(dummy uint32 4 :offset-assert 16)
(basename sound-stream-name :inline :offset-assert 32)
)
:method-count-assert 9
:size-assert #x50
:flag-assert #x900000050
)
;; definition for method 3 of type load-chunk-msg
(defmethod inspect load-chunk-msg ((obj load-chunk-msg))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'load-chunk-msg)
(format #t "~1Trsvd: ~D~%" (-> obj rsvd))
(format #t "~1Tresult: ~D~%" (-> obj result))
(format #t "~1Taddress: ~D~%" (-> obj address))
(format #t "~1Tsection: ~D~%" (-> obj section))
(format #t "~1Tmaxlen: ~D~%" (-> obj maxlen))
(format #t "~1Tdummy[4] @ #x~X~%" (-> obj dummy))
(format #t "~1Tbasename: #<sound-stream-name @ #x~X>~%" (-> obj basename))
(label cfg-4)
obj
)
;; definition of type play-chunk-msg
(deftype play-chunk-msg (structure)
((rsvd uint16 :offset-assert 0)
(result uint16 :offset-assert 2)
(address pointer :offset-assert 4)
(section uint32 :offset-assert 8)
(maxlen uint32 :offset-assert 12)
(id uint32 4 :offset-assert 16)
(basename sound-stream-name 4 :inline :offset-assert 32)
)
:method-count-assert 9
:size-assert #xe0
:flag-assert #x9000000e0
)
;; definition for method 3 of type play-chunk-msg
(defmethod inspect play-chunk-msg ((obj play-chunk-msg))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'play-chunk-msg)
(format #t "~1Trsvd: ~D~%" (-> obj rsvd))
(format #t "~1Tresult: ~D~%" (-> obj result))
(format #t "~1Taddress: ~D~%" (-> obj address))
(format #t "~1Tsection: ~D~%" (-> obj section))
(format #t "~1Tmaxlen: ~D~%" (-> obj maxlen))
(format #t "~1Tid[4] @ #x~X~%" (-> obj id))
(format #t "~1Tbasename[4] @ #x~X~%" (-> obj basename))
(label cfg-4)
obj
)
;; definition of type dgo-header
(deftype dgo-header (structure)
((length uint32 :offset-assert 0)
(rootname uint8 60 :offset-assert 4)
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
)
;; definition for method 3 of type dgo-header
(defmethod inspect dgo-header ((obj dgo-header))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'dgo-header)
(format #t "~1Tlength: ~D~%" (-> obj length))
(format #t "~1Trootname[60] @ #x~X~%" (-> obj rootname))
(label cfg-4)
obj
)
;; failed to figure out what this is:
(when (zero? *load-dgo-rpc*)
(set! *load-dgo-rpc* (new 'global 'rpc-buffer-pair (the-as uint 32) (the-as uint 1) 3))
(set! *load-str-rpc* (new 'global 'rpc-buffer-pair (the-as uint 64) (the-as uint 1) 4))
(set! *play-str-rpc* (new 'global 'rpc-buffer-pair (the-as uint 256) (the-as uint 2) 5))
(set! *load-str-lock* #f)
(set! *que-str-lock* #f)
(set! *dgo-name* (new 'global 'string 64 (the-as string #f)))
)
;; definition for function str-load
(defun str-load ((arg0 string) (arg1 int) (arg2 pointer) (arg3 int))
(if (or (check-busy *load-str-rpc*) *load-str-lock*)
(return #f)
)
(let ((s2-0 (the-as load-chunk-msg (add-element *load-str-rpc*))))
(set! (-> s2-0 result) (load-msg-result invalid))
(set! (-> s2-0 address) arg2)
(set! (-> s2-0 section) (the-as uint arg1))
(set! (-> s2-0 maxlen) (the-as uint arg3))
(copyn-charp<-string (the-as (pointer uint8) (-> s2-0 basename)) arg0 48)
(call *load-str-rpc* (the-as uint 0) (the-as pointer s2-0) (the-as uint 32))
)
(set! *load-str-lock* #t)
(set! *que-str-lock* #t)
#t
)
;; definition for function str-load-status
(defun str-load-status ((arg0 (pointer int32)))
(if (check-busy *load-str-rpc*)
(return 'busy)
)
(set! *load-str-lock* #f)
(set! *que-str-lock* #t)
(let ((v1-7 (the-as load-chunk-msg (pop-last-received *load-str-rpc*))))
(if (= (-> v1-7 result) (load-msg-result error))
(return 'error)
)
(set! (-> arg0 0) (the-as int (-> v1-7 maxlen)))
)
'complete
)
;; definition for function str-load-cancel
;; INFO: Return type mismatch int vs none.
(defun str-load-cancel ()
(set! *load-str-lock* #f)
(set! *que-str-lock* #t)
0
(none)
)
;; definition for function str-play-async
;; INFO: Return type mismatch int vs none.
(defun str-play-async ((arg0 string) (arg1 sound-id))
(set! *que-str-lock* #t)
(let ((s4-0 (the-as play-chunk-msg (add-element *play-str-rpc*))))
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename)) arg0 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 1)) "" 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 2)) "" 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 3)) "" 48)
(set! (-> s4-0 id 0) (the-as uint arg1))
(set! (-> s4-0 id 1) (the-as uint 0))
(set! (-> s4-0 id 2) (the-as uint 0))
(set! (-> s4-0 id 3) (the-as uint 0))
(set! (-> s4-0 result) (the-as uint 0))
)
0
0
(none)
)
;; definition for function str-play-stop
;; INFO: Return type mismatch int vs none.
(defun str-play-stop ((arg0 string) (arg1 sound-id))
(set! *que-str-lock* #t)
(let ((s4-0 (the-as play-chunk-msg (add-element *play-str-rpc*))))
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename)) arg0 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 1)) "" 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 2)) "" 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 3)) "" 48)
(set! (-> s4-0 id 0) (the-as uint arg1))
(set! (-> s4-0 id 1) (the-as uint 0))
(set! (-> s4-0 id 2) (the-as uint 0))
(set! (-> s4-0 id 3) (the-as uint 0))
(set! (-> s4-0 result) (the-as uint 1))
)
0
(none)
)
;; definition for function str-play-queue
;; INFO: Return type mismatch int vs none.
(defun str-play-queue ((arg0 string) (arg1 string) (arg2 string) (arg3 string) (arg4 (pointer uint32)) (arg5 pointer))
(when (and (not (check-busy *play-str-rpc*)) (not *load-str-lock*) (not *que-str-lock*))
(let ((s4-0 (the-as play-chunk-msg (add-element *play-str-rpc*))))
(if arg0
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename)) arg0 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename)) "" 48)
)
(if arg1
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 1)) arg1 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 1)) "" 48)
)
(if arg2
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 2)) arg2 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 2)) "" 48)
)
(if arg3
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 3)) arg3 48)
(copyn-charp<-string (the-as (pointer uint8) (-> s4-0 basename 3)) "" 48)
)
(dotimes (v1-15 4)
(set! (-> s4-0 id v1-15) (-> arg4 v1-15))
)
(set! (-> s4-0 address) arg5)
(set! (-> s4-0 result) (the-as uint 2))
)
)
(set! *que-str-lock* #f)
0
(none)
)
;; definition for function str-ambient-play
;; INFO: Return type mismatch int vs none.
(defun str-ambient-play ((arg0 string))
(set! *que-str-lock* #t)
(let ((s5-0 (the-as load-chunk-msg (add-element *play-str-rpc*))))
(set! (-> s5-0 basename name 0) (the-as uint 36))
(copyn-charp<-string (&-> s5-0 basename name 1) arg0 48)
(set! (-> s5-0 result) (load-msg-result done))
)
0
0
(none)
)
;; definition for function str-ambient-stop
;; INFO: Return type mismatch int vs none.
(defun str-ambient-stop ((arg0 string))
(set! *que-str-lock* #t)
(let ((s5-0 (the-as load-chunk-msg (add-element *play-str-rpc*))))
(set! (-> s5-0 basename name 0) (the-as uint 36))
(copyn-charp<-string (&-> s5-0 basename name 1) arg0 48)
(set! (-> s5-0 result) (load-msg-result error))
)
0
(none)
)
;; definition for function str-play-kick
;; INFO: Return type mismatch int vs none.
(defun str-play-kick ()
(cond
((check-busy *play-str-rpc*)
)
(else
(call *play-str-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0))
)
)
0
(none)
)
;; definition for symbol *dgo-time*, type time-frame
(define *dgo-time* (the-as time-frame 0))
;; definition for function dgo-load-begin
;; INFO: Used lq/sq
(defun dgo-load-begin ((arg0 string) (arg1 pointer) (arg2 pointer) (arg3 pointer))
(set! *dgo-time* (the-as time-frame (-> *display* real-clock integral-frame-counter)))
(format 0 "Starting level load clock~%")
(sync *load-dgo-rpc* #t)
(let ((s2-0 (the-as load-dgo-msg (add-element *load-dgo-rpc*))))
(set! (-> s2-0 result) (load-msg-result invalid))
(set! (-> s2-0 b1) arg1)
(set! (-> s2-0 b2) arg2)
(set! (-> s2-0 bt) arg3)
(set! (-> s2-0 name) (string->sound-name arg0))
(call *load-dgo-rpc* (the-as uint 0) (the-as pointer s2-0) (the-as uint 32))
s2-0
)
)
;; definition for function dgo-load-get-next
(defun dgo-load-get-next ((arg0 (pointer symbol)))
(set! (-> arg0 0) #f)
(let ((gp-0 (the-as pointer #f)))
(when (not (check-busy *load-dgo-rpc*))
(let ((v1-4 (the-as load-dgo-msg (pop-last-received *load-dgo-rpc*))))
(when v1-4
(when (or (= (-> v1-4 result) (load-msg-result done)) (= (-> v1-4 result) (load-msg-result more)))
(set! gp-0 (-> v1-4 b1))
(set! (-> arg0 0) #t)
)
(if (= (-> v1-4 result) (load-msg-result more))
(set! (-> arg0 0) #f)
)
(if (= (-> v1-4 result) (load-msg-result done))
(format
0
"Elapsed time for level = ~Fs~%"
(* 0.016666668 (the float (- (-> *display* real-clock integral-frame-counter) (the-as uint *dgo-time*))))
)
)
)
)
)
gp-0
)
)
;; definition for function dgo-load-continue
;; INFO: Used lq/sq
(defun dgo-load-continue ((arg0 pointer) (arg1 pointer) (arg2 pointer))
(let ((gp-0 (the-as load-dgo-msg (add-element *load-dgo-rpc*))))
(set! (-> gp-0 result) (load-msg-result invalid))
(set! (-> gp-0 b1) arg0)
(set! (-> gp-0 b2) arg1)
(set! (-> gp-0 bt) arg2)
(set! (-> gp-0 name) (the-as uint128 0))
(call *load-dgo-rpc* (the-as uint 1) (the-as pointer gp-0) (the-as uint 32))
gp-0
)
)
;; definition for function dgo-load-cancel
;; INFO: Return type mismatch int vs none.
(defun dgo-load-cancel ()
(sync *load-dgo-rpc* #t)
(let ((a2-0 (add-element *load-dgo-rpc*)))
(call *load-dgo-rpc* (the-as uint 2) a2-0 (the-as uint 32))
)
0
(none)
)
;; definition for function find-temp-buffer
(defun find-temp-buffer ((arg0 int))
(let ((gp-0 (+ (/ arg0 16) 2)))
(cond
((< (the-as uint gp-0)
(the-as uint (dma-buffer-free (-> *display* frames (-> *display* on-screen) global-buf)))
)
(logand -16 (&+ (-> *display* frames (-> *display* on-screen) global-buf base) 15))
)
((< (the-as uint gp-0)
(the-as uint (dma-buffer-free (-> *display* frames (-> *display* on-screen) global-buf)))
)
(logand -16 (&+ (-> *display* frames (-> *display* on-screen) global-buf base) 15))
)
)
)
)
;; definition for function dgo-load-link
(defun dgo-load-link ((arg0 dgo-header) (arg1 kheap) (arg2 uint) (arg3 symbol) (arg4 symbol))
(let ((s4-0 (the-as object (&+ arg0 64))))
(let ((v1-0 arg2))
(cond
((>= (the-as int (+ (the-as uint s4-0) (-> arg0 length))) (the-as int (-> arg1 top-base)))
(format
0
"ERROR: -----> dgo file header ~g #x~X has overrun heap #x~X by ~D bytes. This is very bad!~%"
(-> arg0 rootname)
arg0
arg1
(- (+ (the-as uint s4-0) (-> arg0 length)) (the-as uint (-> arg1 top-base)))
)
)
((and (< (the-as int arg0) (the-as int v1-0))
(>= (the-as int (+ (the-as uint s4-0) (-> arg0 length))) (the-as int v1-0))
)
(format
0
"ERROR: -----> dgo file header ~g #x~X has overrun heap #x~X by ~D bytes. This is very bad!~%"
(-> arg0 rootname)
arg0
arg1
(- (+ (the-as uint s4-0) (-> arg0 length)) v1-0)
)
)
)
)
(if arg4
(format
0
"NOTICE: loaded ~g, ~D bytes (~f K) at top ~D at #x~X~%"
(-> arg0 rootname)
(-> arg0 length)
(* 0.0009765625 (the float (-> arg0 length)))
(- (+ (the-as uint s4-0) (-> arg0 length)) (the-as uint (-> arg1 base)))
arg0
)
)
(string<-charp (clear *dgo-name*) (-> arg0 rootname))
(nonzero? (link-begin
(the-as pointer s4-0)
(-> *dgo-name* data)
(the-as int (-> arg0 length))
arg1
(the-as link-flag (if arg3
47
39
)
)
)
)
)
)
;; definition for function destroy-mem
;; INFO: Return type mismatch int vs none.
(defun destroy-mem ((arg0 (pointer uint32)) (arg1 (pointer uint32)))
(while (< (the-as int arg0) (the-as int arg1))
(set! (-> arg0 0) (the-as uint #xffffffff))
(set! arg0 (&-> arg0 1))
)
0
(none)
)
+119
View File
@@ -0,0 +1,119 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type ramdisk-rpc-fill
(deftype ramdisk-rpc-fill (structure)
((rsvd1 int32 :offset-assert 0)
(ee-id int32 :offset-assert 4)
(rsvd2 int32 2 :offset-assert 8)
(filename uint128 :offset-assert 16)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; definition for method 3 of type ramdisk-rpc-fill
;; INFO: Used lq/sq
(defmethod inspect ramdisk-rpc-fill ((obj ramdisk-rpc-fill))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'ramdisk-rpc-fill)
(format #t "~1Trsvd1: ~D~%" (-> obj rsvd1))
(format #t "~1Tee-id: ~D~%" (-> obj ee-id))
(format #t "~1Trsvd2[2] @ #x~X~%" (-> obj rsvd2))
(format #t "~1Tfilename: ~D~%" (-> obj filename))
(label cfg-4)
obj
)
;; definition of type ramdisk-rpc-load
(deftype ramdisk-rpc-load (structure)
((rsvd int32 :offset-assert 0)
(ee-id int32 :offset-assert 4)
(offset uint32 :offset-assert 8)
(length uint32 :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type ramdisk-rpc-load
(defmethod inspect ramdisk-rpc-load ((obj ramdisk-rpc-load))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'ramdisk-rpc-load)
(format #t "~1Trsvd: ~D~%" (-> obj rsvd))
(format #t "~1Tee-id: ~D~%" (-> obj ee-id))
(format #t "~1Toffset: ~D~%" (-> obj offset))
(format #t "~1Tlength: ~D~%" (-> obj length))
(label cfg-4)
obj
)
;; definition of type ramdisk-rpc-load-to-ee
(deftype ramdisk-rpc-load-to-ee (structure)
((rsvd int32 :offset-assert 0)
(addr int32 :offset-assert 4)
(offset int32 :offset-assert 8)
(length int32 :offset-assert 12)
(filename uint128 :offset-assert 16)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; definition for method 3 of type ramdisk-rpc-load-to-ee
;; INFO: Used lq/sq
(defmethod inspect ramdisk-rpc-load-to-ee ((obj ramdisk-rpc-load-to-ee))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'ramdisk-rpc-load-to-ee)
(format #t "~1Trsvd: ~D~%" (-> obj rsvd))
(format #t "~1Taddr: ~D~%" (-> obj addr))
(format #t "~1Toffset: ~D~%" (-> obj offset))
(format #t "~1Tlength: ~D~%" (-> obj length))
(format #t "~1Tfilename: ~D~%" (-> obj filename))
(label cfg-4)
obj
)
;; definition for symbol *ramdisk-rpc*, type rpc-buffer-pair
(define *ramdisk-rpc* (new 'global 'rpc-buffer-pair (the-as uint 32) (the-as uint 1) 2))
;; definition for symbol *current-ramdisk-id*, type int
(define *current-ramdisk-id* 0)
;; definition for function ramdisk-load
(defun ramdisk-load ((arg0 int) (arg1 uint) (arg2 uint) (arg3 pointer))
(let ((v1-1 (the-as ramdisk-rpc-load (add-element *ramdisk-rpc*))))
(set! (-> v1-1 offset) arg1)
(set! (-> v1-1 ee-id) arg0)
(set! (-> v1-1 length) arg2)
)
(call *ramdisk-rpc* (the-as uint 0) arg3 arg2)
0
)
;; definition for function ramdisk-sync
;; INFO: Return type mismatch int vs none.
(defun ramdisk-sync ()
(sync *ramdisk-rpc* #t)
0
(none)
)
;; failed to figure out what this is:
0
+1 -1
View File
@@ -72,7 +72,7 @@
(set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14)
(set-roll-to-grav! (_type_ float) quaternion 15)
(set-roll-to-grav-2! (_type_ float) quaternion 16)
(rotate-toward-orientation! (_type_ quaternion float float) quaternion 17)
(rotate-toward-orientation! (_type_ quaternion float float int float float) quaternion 17)
(set-quaternion! (_type_ quaternion) quaternion 18)
(set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19)
(point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20)
+468
View File
@@ -0,0 +1,468 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for method 2 of type transformq
(defmethod print transformq ((obj transformq))
(format #t "#<transformq @ #x~X~%" obj)
(format #t "~T~Ttrans:~F ~F ~F ~F ~%" (-> obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w))
(format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> obj quat x) (-> obj quat y) (-> obj quat z) (-> obj quat w))
(format #t "~T~Tscale:~F ~F ~F ~F>" (-> obj scale x) (-> obj scale y) (-> obj scale z) (-> obj scale w))
obj
)
;; definition for method 27 of type trsqv
(defmethod get-quaternion trsqv ((obj trsqv))
(-> obj quat)
)
;; definition for method 18 of type trsqv
(defmethod set-quaternion! trsqv ((obj trsqv) (arg0 quaternion))
(quaternion-copy! (get-quaternion obj) arg0)
)
;; definition for method 21 of type trsqv
(defmethod rot->dir-targ! trsqv ((obj trsqv))
(quaternion-copy! (-> obj dir-targ) (get-quaternion obj))
)
;; definition for method 22 of type trsqv
(defmethod y-angle trsqv ((obj trsqv))
(quaternion-y-angle (get-quaternion obj))
)
;; definition for method 9 of type trsqv
(defmethod seek-toward-heading-vec! trsqv ((obj trsqv) (arg0 vector) (arg1 float) (arg2 time-frame))
(with-pp
(let* ((f0-0 (deg-diff (quaternion-y-angle (-> obj quat)) (vector-y-angle arg0)))
(f1-2 (fmin (* arg1 (-> pp clock seconds-per-frame)) (/ (* 5.0 (fabs f0-0)) (the float arg2))))
(f30-0 (fmax (fmin f0-0 f1-2) (- f1-2)))
)
(let ((f0-2 (-> obj old-y-angle-diff)))
(set! f30-0 (cond
((or (= f0-2 0.0)
(and (< 0.0 f30-0) (< 0.0 f0-2))
(or (and (< f30-0 0.0) (< f0-2 0.0))
(>= (- (-> pp clock frame-counter) (-> obj angle-change-time)) (seconds 0.2))
)
)
(set! (-> obj angle-change-time) (-> pp clock frame-counter))
f30-0
)
(else
(* 0.000000001 f30-0)
)
)
)
)
(set! (-> obj old-y-angle-diff) f30-0)
(let ((a1-2 (get-quaternion obj)))
(quaternion-rotate-y! a1-2 a1-2 f30-0)
)
)
)
)
;; definition for method 10 of type trsqv
(defmethod set-heading-vec! trsqv ((obj trsqv) (arg0 vector))
(let ((s3-0 (get-quaternion obj)))
(forward-up-nopitch->quaternion
s3-0
(vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0)
(vector-y-quaternion! (new 'stack-no-clear 'vector) s3-0)
)
)
)
;; definition for method 11 of type trsqv
(defmethod seek-to-point-toward-point! trsqv ((obj trsqv) (arg0 vector) (arg1 float) (arg2 time-frame))
(seek-toward-heading-vec! obj (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) arg1 arg2)
)
;; definition for method 12 of type trsqv
(defmethod point-toward-point! trsqv ((obj trsqv) (arg0 vector))
(let ((s3-0 (get-quaternion obj)))
(forward-up-nopitch->quaternion
s3-0
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) 1.0)
(vector-y-quaternion! (new 'stack-no-clear 'vector) s3-0)
)
)
)
;; definition for method 13 of type trsqv
(defmethod seek-toward-yaw-angle! trsqv ((obj trsqv) (arg0 float) (arg1 float) (arg2 time-frame))
(let ((s3-0 (method-of-object obj seek-toward-heading-vec!))
(s2-0 (new 'stack-no-clear 'vector))
)
(set! (-> s2-0 x) (sin arg0))
(set! (-> s2-0 y) 0.0)
(set! (-> s2-0 z) (cos arg0))
(set! (-> s2-0 w) 1.0)
(s3-0 obj s2-0 arg1 arg2)
)
)
;; definition for method 14 of type trsqv
(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((obj trsqv) (arg0 float))
(let ((s5-0 (method-of-object obj set-heading-vec-clear-roll-pitch!))
(s4-0 (new 'stack-no-clear 'vector))
)
(set! (-> s4-0 x) (sin arg0))
(set! (-> s4-0 y) 0.0)
(set! (-> s4-0 z) (cos arg0))
(set! (-> s4-0 w) 1.0)
(s5-0 obj s4-0)
)
)
;; definition for method 15 of type trsqv
(defmethod set-roll-to-grav! trsqv ((obj trsqv) (arg0 float))
(set-roll-to-grav-2! obj arg0)
)
;; definition for method 16 of type trsqv
(defmethod set-roll-to-grav-2! trsqv ((obj trsqv) (arg0 float))
(let* ((s5-0 (get-quaternion obj))
(s1-0 (-> *standard-dynamics* gravity-normal))
(s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) s5-0))
)
(let ((s4-0 (&-> s3-0 data 8)))
(vector-normalize! (vector-flatten! (the-as vector (&-> s3-0 data 4)) s1-0 (the-as vector s4-0)) 1.0)
(vector-cross! (the-as vector (-> s3-0 data)) (the-as vector (&-> s3-0 data 4)) (the-as vector s4-0))
)
(let ((a1-5 (matrix-rotate-z! (new 'stack-no-clear 'matrix) arg0)))
(matrix*! s3-0 a1-5 s3-0)
)
(matrix->quaternion s5-0 s3-0)
)
)
;; definition for method 25 of type trsqv
(defmethod roll-relative-to-gravity trsqv ((obj trsqv))
(let* ((s5-0 (get-quaternion obj))
(gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) s5-0))
(s5-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0))
(a1-2 (-> *standard-dynamics* gravity-normal))
(v1-2 (vector-normalize! (vector-flatten! (new 'stack-no-clear 'vector) a1-2 gp-0) 1.0))
(f0-1 (vector-dot v1-2 s5-1))
)
(if (< (vector-dot (vector-cross! (new 'stack-no-clear 'vector) v1-2 s5-1) gp-0) 0.0)
(- (acos f0-1))
(acos f0-1)
)
)
)
;; definition for method 17 of type trsqv
;; INFO: Used lq/sq
;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3]
;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4]
;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5]
(defmethod rotate-toward-orientation! trsqv ((obj trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 float) (arg5 float))
(local-vars
(f0-4 float)
(sv-192 (function quaternion vector vector float int quaternion))
(sv-208 quaternion)
(sv-224 vector)
(sv-240 float)
(sv-256 vector)
(sv-272 vector)
)
(set! sv-240 arg4)
(let ((s2-0 arg5)
(s5-0 (get-quaternion obj))
)
(let ((gp-0 (new 'stack-no-clear 'quaternion)))
(when (< 0.0 arg2)
(set! sv-192 quaternion-from-two-vectors-smooth!)
(set! sv-208 gp-0)
(set! sv-224 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0))
(let ((a2-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) arg0)))
(sv-192 sv-208 sv-224 a2-1 arg2 (the-as int sv-240))
)
(quaternion-normalize! (quaternion*! s5-0 gp-0 s5-0))
)
(when (< 0.0 arg1)
(set! sv-256 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0))
(let ((s1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) s5-0)))
(set! sv-272 (vector-z-quaternion! (new 'stack-no-clear 'vector) arg0))
(let ((s0-1 (new 'stack-no-clear 'matrix)))
(vector-flatten! s1-2 s1-2 sv-256)
(vector-flatten! sv-272 sv-272 sv-256)
(vector-normalize! s1-2 1.0)
(vector-normalize! sv-272 1.0)
(cond
((!= s2-0 0.0)
(let* ((v1-5 (vector-cross! (new 'stack-no-clear 'vector) s1-2 sv-272))
(f0-3 (-> sv-256 x))
(f1-3 (-> sv-256 y))
(f2-0 (-> sv-256 z))
(f3-0 (-> v1-5 x))
(f4-0 (-> v1-5 y))
(f5-0 (-> v1-5 z))
)
(.mula.s f0-3 f3-0)
(.madda.s f1-3 f4-0)
(.madd.s f0-4 f2-0 f5-0)
)
(if (< (* f0-4 s2-0) 0.0)
(matrix-from-two-vectors-the-long-way-smooth! s0-1 s1-2 sv-272 arg1 arg3)
(matrix-from-two-vectors-smooth! s0-1 s1-2 sv-272 arg1 arg3)
)
)
(else
(matrix-from-two-vectors-smooth! s0-1 s1-2 sv-272 arg1 arg3)
)
)
(matrix->quaternion gp-0 s0-1)
)
)
(quaternion-normalize! (quaternion*! s5-0 gp-0 s5-0))
)
)
s5-0
)
)
;; definition for method 19 of type trsqv
(defmethod set-heading-vec-clear-roll-pitch! trsqv ((obj trsqv) (arg0 vector))
(forward-up->quaternion
(get-quaternion obj)
(vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0)
(new 'static 'vector :y 1.0 :w 1.0)
)
)
;; definition for method 20 of type trsqv
(defmethod point-toward-point-clear-roll-pitch! trsqv ((obj trsqv) (arg0 vector))
(forward-up->quaternion
(get-quaternion obj)
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) 1.0)
(new 'static 'vector :y 1.0 :w 1.0)
)
)
;; definition for function transformq-copy!
;; INFO: Used lq/sq
(defun transformq-copy! ((arg0 transformq) (arg1 transformq))
(let ((v1-0 (-> arg1 trans quad))
(a2-0 (-> arg1 quat vec quad))
(a1-1 (-> arg1 scale quad))
)
(set! (-> arg0 trans quad) v1-0)
(set! (-> arg0 quat vec quad) a2-0)
(set! (-> arg0 scale quad) a1-1)
)
arg0
)
;; definition for function matrix<-transformq!
;; INFO: Used lq/sq
(defun matrix<-transformq! ((arg0 matrix) (arg1 transformq))
(local-vars (v1-1 float))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
)
(init-vf0-vector)
(quaternion->matrix arg0 (-> arg1 quat))
(cond
(#f
(set! (-> arg0 trans quad) (-> arg1 trans quad))
)
(else
(.lvf vf1 (&-> arg1 scale quad))
(.lvf vf2 (&-> arg1 trans quad))
(.lvf vf3 (&-> arg0 vector 0 quad))
(.lvf vf4 (&-> arg0 vector 1 quad))
(.lvf vf5 (&-> arg0 vector 2 quad))
(.mov.vf vf2 vf0 :mask #b1000)
(.mul.x.vf vf3 vf3 vf1)
(.mul.y.vf vf4 vf4 vf1)
(.mul.z.vf vf5 vf5 vf1)
(.svf (&-> arg0 trans quad) vf2)
(.svf (&-> arg0 vector 0 quad) vf3)
(.svf (&-> arg0 vector 1 quad) vf4)
(.svf (&-> arg0 vector 2 quad) vf5)
(.mov v1-1 vf5)
)
)
arg0
)
)
;; definition for function matrix<-no-trans-transformq!
(defun matrix<-no-trans-transformq! ((arg0 matrix) (arg1 transformq))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
)
(init-vf0-vector)
(quaternion->matrix arg0 (-> arg1 quat))
(.lvf vf1 (&-> arg1 scale quad))
(.lvf vf3 (&-> arg0 vector 0 quad))
(.lvf vf4 (&-> arg0 vector 1 quad))
(.lvf vf5 (&-> arg0 vector 2 quad))
(.mov.vf vf2 vf0)
(.mul.x.vf vf3 vf3 vf1)
(.mul.y.vf vf4 vf4 vf1)
(.mul.z.vf vf5 vf5 vf1)
(.svf (&-> arg0 trans quad) vf2)
(.svf (&-> arg0 vector 0 quad) vf3)
(.svf (&-> arg0 vector 1 quad) vf4)
(.svf (&-> arg0 vector 2 quad) vf5)
arg0
)
)
;; definition for function matrix<-transformq+trans!
(defun matrix<-transformq+trans! ((arg0 matrix) (arg1 transformq) (arg2 vector))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(quaternion->matrix arg0 (-> arg1 quat))
(.lvf vf1 (&-> arg1 scale quad))
(.lvf vf2 (&-> arg1 trans quad))
(.lvf vf6 (&-> arg2 quad))
(.lvf vf3 (&-> arg0 vector 0 quad))
(.lvf vf4 (&-> arg0 vector 1 quad))
(.lvf vf5 (&-> arg0 vector 2 quad))
(.mov.vf vf2 vf0 :mask #b1000)
(.mul.x.vf vf3 vf3 vf1)
(.mul.y.vf vf4 vf4 vf1)
(.mul.z.vf vf5 vf5 vf1)
(.mul.x.vf acc vf3 vf6)
(.add.mul.y.vf acc vf4 vf6 acc)
(.add.mul.z.vf acc vf5 vf6 acc)
(.add.mul.w.vf vf2 vf2 vf0 acc :mask #b111)
(.svf (&-> arg0 trans quad) vf2)
(.svf (&-> arg0 vector 0 quad) vf3)
(.svf (&-> arg0 vector 1 quad) vf4)
(.svf (&-> arg0 vector 2 quad) vf5)
arg0
)
)
;; definition for function matrix<-transformq+world-trans!
(defun matrix<-transformq+world-trans! ((arg0 matrix) (arg1 transformq) (arg2 vector))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(quaternion->matrix arg0 (-> arg1 quat))
(.lvf vf1 (&-> arg1 scale quad))
(.lvf vf2 (&-> arg1 trans quad))
(.lvf vf6 (&-> arg2 quad))
(.lvf vf3 (&-> arg0 vector 0 quad))
(.lvf vf4 (&-> arg0 vector 1 quad))
(.lvf vf5 (&-> arg0 vector 2 quad))
(.mov.vf vf2 vf0 :mask #b1000)
(.mul.x.vf vf3 vf3 vf1)
(.mul.y.vf vf4 vf4 vf1)
(.mul.z.vf vf5 vf5 vf1)
(.add.vf vf2 vf2 vf6 :mask #b111)
(.svf (&-> arg0 trans quad) vf2)
(.svf (&-> arg0 vector 0 quad) vf3)
(.svf (&-> arg0 vector 1 quad) vf4)
(.svf (&-> arg0 vector 2 quad) vf5)
arg0
)
)
;; definition for function matrix<-parented-transformq!
(defun matrix<-parented-transformq! ((arg0 matrix) (arg1 transformq) (arg2 vector))
(local-vars (v1-1 float))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(quaternion->matrix arg0 (-> arg1 quat))
(let ((v1-0 (new 'stack-no-clear 'vector)))
(set! (-> v1-0 x) (/ 1.0 (-> arg2 x)))
(set! (-> v1-0 y) (/ 1.0 (-> arg2 y)))
(set! (-> v1-0 z) (/ 1.0 (-> arg2 z)))
(.lvf vf1 (&-> arg1 scale quad))
(.lvf vf2 (&-> arg1 trans quad))
(.mov.vf vf2 vf0 :mask #b1000)
(.lvf vf4 (&-> arg0 vector 0 quad))
(.lvf vf5 (&-> arg0 vector 1 quad))
(.lvf vf6 (&-> arg0 vector 2 quad))
(.mul.x.vf vf4 vf4 vf1)
(.mul.y.vf vf5 vf5 vf1)
(.mul.z.vf vf6 vf6 vf1)
(.lvf vf3 (&-> v1-0 quad))
)
(.mul.vf vf4 vf4 vf3)
(.mul.vf vf5 vf5 vf3)
(.mul.vf vf6 vf6 vf3)
(.svf (&-> arg0 trans quad) vf2)
(.svf (&-> arg0 vector 0 quad) vf4)
(.svf (&-> arg0 vector 1 quad) vf5)
(.svf (&-> arg0 vector 2 quad) vf6)
(.mov v1-1 vf6)
arg0
)
)
;; definition for function matrix<-transformq+rot-offset!
(defun matrix<-transformq+rot-offset! ((arg0 matrix) (arg1 transformq) (arg2 vector))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(quaternion->matrix arg0 (-> arg1 quat))
(.lvf vf1 (&-> arg1 scale quad))
(.lvf vf2 (&-> arg1 trans quad))
(.lvf vf6 (&-> arg2 quad))
(.lvf vf3 (&-> arg0 vector 0 quad))
(.lvf vf4 (&-> arg0 vector 1 quad))
(.lvf vf5 (&-> arg0 vector 2 quad))
(.mov.vf vf2 vf0 :mask #b1000)
(.mul.x.vf vf3 vf3 vf1)
(.mul.y.vf vf4 vf4 vf1)
(.mul.z.vf vf5 vf5 vf1)
(.mul.x.vf acc vf3 vf6)
(.add.mul.y.vf acc vf4 vf6 acc)
(.add.mul.z.vf acc vf5 vf6 acc)
(.sub.mul.w.vf acc vf6 vf0 acc)
(.add.mul.w.vf vf2 vf2 vf0 acc :mask #b111)
(.svf (&-> arg0 trans quad) vf2)
(.svf (&-> arg0 vector 0 quad) vf3)
(.svf (&-> arg0 vector 1 quad) vf4)
(.svf (&-> arg0 vector 2 quad) vf5)
arg0
)
)
+25 -21
View File
@@ -5,6 +5,7 @@
(deftype sound-stream-name (structure)
((name uint8 48 :offset-assert 0)
)
:pack-me
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
@@ -76,17 +77,18 @@
;; definition of type sound-play-params
(deftype sound-play-params (structure)
((mask uint16 :offset-assert 0)
(pitch-mod int16 :offset-assert 2)
(bend int16 :offset-assert 4)
(fo-min int16 :offset-assert 6)
(fo-max int16 :offset-assert 8)
(fo-curve int8 :offset-assert 10)
(priority int8 :offset-assert 11)
(volume int32 :offset-assert 12)
(trans int32 3 :offset-assert 16)
(group uint8 :offset-assert 28)
(reg uint8 3 :offset-assert 29)
((mask uint16 :offset-assert 0)
(pitch-mod int16 :offset-assert 2)
(bend int16 :offset-assert 4)
(fo-min int16 :offset-assert 6)
(fo-max int16 :offset-assert 8)
(fo-curve int8 :offset-assert 10)
(priority int8 :offset-assert 11)
(volume int32 :offset-assert 12)
(trans int32 3 :offset-assert 16)
(group uint8 :offset-assert 28)
(reg uint8 3 :offset-assert 29)
(group-and-regs uint32 :offset 28)
)
:allow-misaligned
:method-count-assert 9
@@ -142,8 +144,8 @@
;; definition of type sound-rpc-test-cmd
(deftype sound-rpc-test-cmd (sound-rpc-cmd)
((ee-addr uint32 :offset-assert 4)
(param0 uint16 :offset-assert 8)
((ee-addr pointer :offset-assert 4)
(param0 uint16 :offset-assert 8)
)
:method-count-assert 9
:size-assert #xa
@@ -213,7 +215,7 @@
;; definition of type sound-rpc-load-bank
(deftype sound-rpc-load-bank (sound-rpc-bank-cmd)
((ee-addr uint32 :offset-assert 32)
((ee-addr pointer :offset-assert 32)
)
:method-count-assert 9
:size-assert #x24
@@ -829,6 +831,7 @@
(num float :offset-assert 8)
(group sound-group :offset-assert 12)
(reg uint8 3 :offset-assert 13)
(group-and-regs uint32 :offset 12)
(sound-name-char uint8 16 :offset-assert 16)
(sound-name sound-name :offset 16)
(trans int32 4 :offset-assert 32)
@@ -901,13 +904,14 @@
:size-assert #x6c
:flag-assert #x100000006c
(:methods
(ambient-sound-method-9 () none 9)
(ambient-sound-method-10 () none 10)
(ambient-sound-method-11 () none 11)
(ambient-sound-method-12 () none 12)
(ambient-sound-method-13 () none 13)
(ambient-sound-method-14 () none 14)
(ambient-sound-method-15 () none 15)
(new (symbol type basic vector) _type_ 0)
(update! (_type_) int 9)
(change-sound! (_type_ sound-name) int 10)
(update-trans! (_type_ vector) int 11)
(update-vol! (_type_ float) int 12)
(update-pitch-mod! (_type_ float) none 13)
(set-falloff-far! (_type_ float) none 14)
(stop! (_type_) int 15)
)
)
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -34,7 +34,10 @@
"(method 3 connection-minimap)",
"(method 3 sky-vertex)",
// cache asm
"invalidate-cache-line"
"invalidate-cache-line",
// asm, weird vector dot
"(method 17 trsqv)"
],
"skip_compile_states": {}