mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
decomp: shadow
(#681)
* decomp: Almost finish `shadow` blocked on static inline-array * decomp: Add support for `sparticle-launcher` static data * decomp: finalize `shadow` * add definitions for sparticle related symbols * actually fix the crash
This commit is contained in:
parent
ad695ed12b
commit
f438ba4e84
|
@ -4,6 +4,7 @@
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "third-party/dragonbox.h"
|
#include "third-party/dragonbox.h"
|
||||||
#include "print_float.h"
|
#include "print_float.h"
|
||||||
|
#include "common/util/assert.h"
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Convert a float to a string. The string is _always_ in this format:
|
* Convert a float to a string. The string is _always_ in this format:
|
||||||
|
@ -127,4 +128,4 @@ int float_to_cstr(float value, char* buffer) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11420,7 +11420,7 @@
|
||||||
(projectile-dissipate () none 21) ;; state
|
(projectile-dissipate () none 21) ;; state
|
||||||
(projectile-impact () none 22) ;; state
|
(projectile-impact () none 22) ;; state
|
||||||
(dummy-23 () none 23)
|
(dummy-23 () none 23)
|
||||||
(dummy-24 () none 24)
|
(dummy-24 (_type_ ) none 24)
|
||||||
(dummy-25 () none 25)
|
(dummy-25 () none 25)
|
||||||
(dummy-26 () none 26)
|
(dummy-26 () none 26)
|
||||||
(dummy-27 () none 27)
|
(dummy-27 () none 27)
|
||||||
|
@ -11852,15 +11852,15 @@
|
||||||
(dummy-9 () none 9)
|
(dummy-9 () none 9)
|
||||||
(dummy-10 () none 10)
|
(dummy-10 () none 10)
|
||||||
(dummy-11 () none 11)
|
(dummy-11 () none 11)
|
||||||
(dummy-12 () none 12)
|
(dummy-12 (_type_ vector float uint process bone uint) float 12) ;; TODO - bone not confirmed
|
||||||
(dummy-13 () none 13)
|
(dummy-13 () none 13)
|
||||||
(dummy-14 () none 14)
|
(dummy-14 () none 14)
|
||||||
(dummy-15 () none 15)
|
(dummy-15 () none 15)
|
||||||
(dummy-16 () none 16)
|
(dummy-16 (_type_ vector float uint process uint) none 16)
|
||||||
(dummy-17 () none 17)
|
(dummy-17 () none 17)
|
||||||
(dummy-18 () none 18)
|
(dummy-18 () none 18)
|
||||||
(dummy-19 () none 19)
|
(dummy-19 () none 19)
|
||||||
(dummy-20 () none 20)
|
(dummy-20 (_type_ vector float uint bone uint) none 20) ;; TODO - bone not confirmed
|
||||||
(dummy-21 () none 21)
|
(dummy-21 () none 21)
|
||||||
(dummy-22 () none 22)
|
(dummy-22 () none 22)
|
||||||
(dummy-23 () none 23)
|
(dummy-23 () none 23)
|
||||||
|
@ -13220,12 +13220,12 @@
|
||||||
(deftype sp-field-init-spec (structure)
|
(deftype sp-field-init-spec (structure)
|
||||||
((field uint16 :offset-assert 0)
|
((field uint16 :offset-assert 0)
|
||||||
(flags uint16 :offset-assert 2)
|
(flags uint16 :offset-assert 2)
|
||||||
(initial-valuef float :offset-assert 4)
|
(initial-value int32 :offset-assert 4)
|
||||||
(random-rangef float :offset-assert 8)
|
(random-range int32 :offset-assert 8)
|
||||||
(random-multf float :offset-assert 12)
|
(random-mult int32 :offset-assert 12)
|
||||||
(initial-value int32 :offset 4)
|
(initial-valuef float :offset 4) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
|
||||||
(random-range int32 :offset 8)
|
(random-rangef float :offset 8) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
|
||||||
(random-mult int32 :offset 12)
|
(random-multf float :offset 12) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
|
||||||
(func basic :offset 4)
|
(func basic :offset 4)
|
||||||
(tex uint32 :offset 4)
|
(tex uint32 :offset 4)
|
||||||
(pntr uint32 :offset 4)
|
(pntr uint32 :offset 4)
|
||||||
|
@ -13240,7 +13240,7 @@
|
||||||
(deftype sparticle-launcher (basic)
|
(deftype sparticle-launcher (basic)
|
||||||
((birthaccum float :offset-assert 4)
|
((birthaccum float :offset-assert 4)
|
||||||
(soundaccum float :offset-assert 8)
|
(soundaccum float :offset-assert 8)
|
||||||
(init-specs uint32 :offset-assert 12)
|
(init-specs (inline-array sp-field-init-spec) :offset-assert 12)
|
||||||
)
|
)
|
||||||
:method-count-assert 9
|
:method-count-assert 9
|
||||||
:size-assert #x10
|
:size-assert #x10
|
||||||
|
@ -18977,7 +18977,7 @@
|
||||||
(define-extern level-setup (function none))
|
(define-extern level-setup (function none))
|
||||||
(define-extern target-exit function)
|
(define-extern target-exit function)
|
||||||
(define-extern target-calc-camera-pos function)
|
(define-extern target-calc-camera-pos function)
|
||||||
(define-extern do-target-shadow function)
|
(define-extern do-target-shadow (function none :behavior target))
|
||||||
(define-extern target-powerup-process function)
|
(define-extern target-powerup-process function)
|
||||||
(define-extern flag-setup function)
|
(define-extern flag-setup function)
|
||||||
(define-extern build-conversions function)
|
(define-extern build-conversions function)
|
||||||
|
@ -20853,7 +20853,7 @@
|
||||||
(define-extern projectile-collision-reaction function)
|
(define-extern projectile-collision-reaction function)
|
||||||
(define-extern projectile-update-velocity-space-wars function)
|
(define-extern projectile-update-velocity-space-wars function)
|
||||||
(define-extern find-nearest-attackable function)
|
(define-extern find-nearest-attackable function)
|
||||||
(define-extern find-ground-and-draw-shadow function)
|
(define-extern find-ground-and-draw-shadow (function vector vector float uint process float float none))
|
||||||
(define-extern spawn-projectile-blue function)
|
(define-extern spawn-projectile-blue function)
|
||||||
|
|
||||||
;; - Unknowns
|
;; - Unknowns
|
||||||
|
@ -21010,9 +21010,9 @@
|
||||||
|
|
||||||
;; - Functions
|
;; - Functions
|
||||||
|
|
||||||
(define-extern compute-and-draw-shadow function)
|
(define-extern compute-and-draw-shadow (function vector vector vector vector float float none))
|
||||||
(define-extern draw-shadow function)
|
(define-extern draw-shadow (function vector vector vector float float float none))
|
||||||
(define-extern add-fake-shadow-to-buffer function)
|
(define-extern add-fake-shadow-to-buffer (function vector vector float int none))
|
||||||
(define-extern swap-fake-shadow-buffers (function none))
|
(define-extern swap-fake-shadow-buffers (function none))
|
||||||
|
|
||||||
|
|
||||||
|
@ -36957,36 +36957,15 @@
|
||||||
|
|
||||||
;; - Types
|
;; - Types
|
||||||
|
|
||||||
; (deftype mother-spider-proj (projectile)
|
(deftype mother-spider-proj (projectile)
|
||||||
; ((facing-dir vector :inline :offset-assert 416)
|
((facing-dir vector :inline :offset-assert 416)
|
||||||
; )
|
)
|
||||||
; :method-count-assert 29
|
:method-count-assert 29
|
||||||
; :size-assert #x1b0
|
:heap-base #x140
|
||||||
; :flag-assert #x1d014001b0
|
:size-assert #x1b0
|
||||||
; ;; inherited inspect of projectile
|
:flag-assert #x1d014001b0
|
||||||
; (:methods
|
;; inherited inspect of projectile
|
||||||
; (dummy-9 () none 9)
|
)
|
||||||
; (dummy-10 () none 10)
|
|
||||||
; (dummy-11 () none 11)
|
|
||||||
; (dummy-12 () none 12)
|
|
||||||
; (dummy-13 () none 13)
|
|
||||||
; (dummy-14 () none 14)
|
|
||||||
; (dummy-15 () none 15)
|
|
||||||
; (dummy-16 () none 16)
|
|
||||||
; (dummy-17 () none 17)
|
|
||||||
; (dummy-18 () none 18)
|
|
||||||
; (dummy-19 () none 19)
|
|
||||||
; (dummy-20 () none 20)
|
|
||||||
; (dummy-21 () none 21)
|
|
||||||
; (dummy-22 () none 22)
|
|
||||||
; (dummy-23 () none 23)
|
|
||||||
; (dummy-24 () none 24)
|
|
||||||
; (dummy-25 () none 25)
|
|
||||||
; (dummy-26 () none 26)
|
|
||||||
; (dummy-27 () none 27)
|
|
||||||
; (dummy-28 () none 28)
|
|
||||||
; )
|
|
||||||
; )
|
|
||||||
|
|
||||||
;; - Functions
|
;; - Functions
|
||||||
|
|
||||||
|
|
|
@ -1413,6 +1413,13 @@
|
||||||
["L508", "float", true]
|
["L508", "float", true]
|
||||||
],
|
],
|
||||||
|
|
||||||
|
"shadow": [
|
||||||
|
["L23", "sparticle-launcher", true],
|
||||||
|
["L26", "float", true],
|
||||||
|
["L27", "float", true],
|
||||||
|
["L28", "float", true]
|
||||||
|
],
|
||||||
|
|
||||||
// please do not add things after this entry! git is dumb.
|
// please do not add things after this entry! git is dumb.
|
||||||
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": []
|
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": []
|
||||||
}
|
}
|
||||||
|
|
|
@ -469,7 +469,6 @@
|
||||||
"(anon-function 286 task-control)": [[16, "event-message-block"]],
|
"(anon-function 286 task-control)": [[16, "event-message-block"]],
|
||||||
"(anon-function 227 task-control)": [[16, "event-message-block"]],
|
"(anon-function 227 task-control)": [[16, "event-message-block"]],
|
||||||
"(anon-function 38 task-control)": [[16, "event-message-block"]],
|
"(anon-function 38 task-control)": [[16, "event-message-block"]],
|
||||||
"(anon-function 28 task-control)": [[16, "event-message-block"]],
|
|
||||||
"(method 10 border-plane)": [[16, "vector"]],
|
"(method 10 border-plane)": [[16, "vector"]],
|
||||||
"(method 9 game-info)": [[16, "event-message-block"]],
|
"(method 9 game-info)": [[16, "event-message-block"]],
|
||||||
"(method 9 continue-point)": [[16, "vector"]],
|
"(method 9 continue-point)": [[16, "vector"]],
|
||||||
|
@ -821,5 +820,21 @@
|
||||||
[16, "sphere"]
|
[16, "sphere"]
|
||||||
],
|
],
|
||||||
|
|
||||||
|
"compute-and-draw-shadow": [
|
||||||
|
[16, "vector"],
|
||||||
|
[32, "vector"],
|
||||||
|
[48, "sparticle-cpuinfo"] // kinda a guess
|
||||||
|
],
|
||||||
|
|
||||||
|
"find-ground-and-draw-shadow": [
|
||||||
|
[16, "vector"],
|
||||||
|
[32, "vector"],
|
||||||
|
[48, "bone"] // what a guess!
|
||||||
|
],
|
||||||
|
|
||||||
|
"(method 20 collide-cache)": [
|
||||||
|
[16, "vector"]
|
||||||
|
],
|
||||||
|
|
||||||
"placeholder-do-not-add-below!": []
|
"placeholder-do-not-add-below!": []
|
||||||
}
|
}
|
||||||
|
|
|
@ -1787,9 +1787,10 @@
|
||||||
|
|
||||||
"draw-ocean-transition": [[255, "v1", "ocean-mid-mask"]],
|
"draw-ocean-transition": [[255, "v1", "ocean-mid-mask"]],
|
||||||
|
|
||||||
// "ocean-trans-mask-ptrs-bit?": [
|
"do-target-shadow": [
|
||||||
// [[32, 41], "a0", "(pointer ocean-trans-mask)"]
|
[[0, 999], "s6", "target"],
|
||||||
// ],
|
[46, "v1", "collide-shape-prim"] // `event-other` from collide-shape
|
||||||
|
],
|
||||||
|
|
||||||
"placeholder-do-not-add-below": []
|
"placeholder-do-not-add-below": []
|
||||||
}
|
}
|
||||||
|
|
|
@ -288,7 +288,7 @@ int index_of_closest_following_label_in_segment(int start_byte,
|
||||||
for (int i = 0; i < (int)labels.size(); i++) {
|
for (int i = 0; i < (int)labels.size(); i++) {
|
||||||
const auto& label = labels.at(i);
|
const auto& label = labels.at(i);
|
||||||
if (label.target_segment == seg) {
|
if (label.target_segment == seg) {
|
||||||
if (result_idx == -1) {
|
if (result_idx == -1 && label.offset > start_byte) {
|
||||||
result_idx = i;
|
result_idx = i;
|
||||||
closest_byte = label.offset;
|
closest_byte = label.offset;
|
||||||
} else {
|
} else {
|
||||||
|
@ -419,6 +419,20 @@ goos::Object ocean_mid_masks_decompile(const std::vector<LinkedWord>& words,
|
||||||
data_field, all_words, file,
|
data_field, all_words, file,
|
||||||
TypeSpec("ocean-mid-mask"), 8);
|
TypeSpec("ocean-mid-mask"), 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
goos::Object sp_field_init_spec_decompile(const std::vector<LinkedWord>& words,
|
||||||
|
const std::vector<DecompilerLabel>& labels,
|
||||||
|
int my_seg,
|
||||||
|
int field_location,
|
||||||
|
const TypeSystem& ts,
|
||||||
|
const Field& data_field,
|
||||||
|
const std::vector<std::vector<LinkedWord>>& all_words,
|
||||||
|
const LinkedObjectFile* file) {
|
||||||
|
return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts,
|
||||||
|
data_field, all_words, file,
|
||||||
|
TypeSpec("sp-field-init-spec"), 16);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
goos::Object decompile_structure(const TypeSpec& type,
|
goos::Object decompile_structure(const TypeSpec& type,
|
||||||
|
@ -608,6 +622,10 @@ goos::Object decompile_structure(const TypeSpec& type,
|
||||||
field_defs_out.emplace_back(
|
field_defs_out.emplace_back(
|
||||||
field.name(), ocean_mid_masks_decompile(obj_words, labels, label.target_segment,
|
field.name(), ocean_mid_masks_decompile(obj_words, labels, label.target_segment,
|
||||||
field_start, ts, field, words, file));
|
field_start, ts, field, words, file));
|
||||||
|
} else if (field.name() == "init-specs" && type.print() == "sparticle-launcher") {
|
||||||
|
field_defs_out.emplace_back(
|
||||||
|
field.name(), sp_field_init_spec_decompile(obj_words, labels, label.target_segment,
|
||||||
|
field_start, ts, field, words, file));
|
||||||
} else {
|
} else {
|
||||||
std::vector<u8> bytes_out;
|
std::vector<u8> bytes_out;
|
||||||
for (int byte_idx = field_start; byte_idx < field_end; byte_idx++) {
|
for (int byte_idx = field_start; byte_idx < field_end; byte_idx++) {
|
||||||
|
|
|
@ -110,15 +110,15 @@
|
||||||
(dummy-9 () none 9)
|
(dummy-9 () none 9)
|
||||||
(dummy-10 () none 10)
|
(dummy-10 () none 10)
|
||||||
(dummy-11 () none 11)
|
(dummy-11 () none 11)
|
||||||
(dummy-12 () none 12)
|
(dummy-12 (_type_ vector float uint process bone uint) float 12) ;; TODO - bone not confirmed
|
||||||
(dummy-13 () none 13)
|
(dummy-13 () none 13)
|
||||||
(dummy-14 () none 14)
|
(dummy-14 () none 14)
|
||||||
(dummy-15 () none 15)
|
(dummy-15 () none 15)
|
||||||
(dummy-16 () none 16)
|
(dummy-16 (_type_ vector float uint process uint) none 16)
|
||||||
(dummy-17 () none 17)
|
(dummy-17 () none 17)
|
||||||
(dummy-18 () none 18)
|
(dummy-18 () none 18)
|
||||||
(dummy-19 () none 19)
|
(dummy-19 () none 19)
|
||||||
(dummy-20 () none 20)
|
(dummy-20 (_type_ vector float uint bone uint) none 20) ;; TODO - bone not confirmed
|
||||||
(dummy-21 () none 21)
|
(dummy-21 () none 21)
|
||||||
(dummy-22 () none 22)
|
(dummy-22 () none 22)
|
||||||
(dummy-23 () none 23)
|
(dummy-23 () none 23)
|
||||||
|
|
|
@ -6,28 +6,28 @@
|
||||||
;; dgos: GAME, ENGINE
|
;; dgos: GAME, ENGINE
|
||||||
|
|
||||||
(deftype projectile (process-drawable)
|
(deftype projectile (process-drawable)
|
||||||
((base-trans vector :inline :offset-assert 176)
|
((base-trans vector :inline :offset-assert 176)
|
||||||
(target vector :inline :offset-assert 192)
|
(target vector :inline :offset-assert 192)
|
||||||
(target-base vector :inline :offset-assert 208)
|
(target-base vector :inline :offset-assert 208)
|
||||||
(parent-base vector :inline :offset-assert 224)
|
(parent-base vector :inline :offset-assert 224)
|
||||||
(parent-quat vector :inline :offset-assert 240)
|
(parent-quat vector :inline :offset-assert 240)
|
||||||
(base-vector vector :inline :offset-assert 256)
|
(base-vector vector :inline :offset-assert 256)
|
||||||
(timeout uint64 :offset-assert 272)
|
(timeout uint64 :offset-assert 272)
|
||||||
(options uint64 :offset-assert 280)
|
(options uint64 :offset-assert 280)
|
||||||
(last-target uint64 :offset-assert 288)
|
(last-target uint64 :offset-assert 288)
|
||||||
(notify-handle uint64 :offset-assert 296)
|
(notify-handle uint64 :offset-assert 296)
|
||||||
(max-speed float :offset-assert 304)
|
(max-speed float :offset-assert 304)
|
||||||
(max-turn float :offset-assert 308)
|
(max-turn float :offset-assert 308)
|
||||||
(old-dist float 16 :offset-assert 312)
|
(old-dist float 16 :offset-assert 312)
|
||||||
(old-dist-count int32 :offset-assert 376)
|
(old-dist-count int32 :offset-assert 376)
|
||||||
(hits int32 :offset-assert 380)
|
(hits int32 :offset-assert 380)
|
||||||
(max-hits int32 :offset-assert 384)
|
(max-hits int32 :offset-assert 384)
|
||||||
(tween float :offset-assert 388)
|
(tween float :offset-assert 388)
|
||||||
(attack-mode basic :offset-assert 392)
|
(attack-mode basic :offset-assert 392)
|
||||||
(update-velocity basic :offset-assert 396)
|
(update-velocity basic :offset-assert 396)
|
||||||
(counter int32 :offset-assert 400)
|
(counter int32 :offset-assert 400)
|
||||||
(target-count int32 :offset-assert 404)
|
(target-count int32 :offset-assert 404)
|
||||||
(sound-id sound-id :offset-assert 408)
|
(sound-id sound-id :offset-assert 408)
|
||||||
)
|
)
|
||||||
:heap-base #x130
|
:heap-base #x130
|
||||||
:method-count-assert 29
|
:method-count-assert 29
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
(projectile-dissipate () none 21) ;; state
|
(projectile-dissipate () none 21) ;; state
|
||||||
(projectile-impact () none 22) ;; state
|
(projectile-impact () none 22) ;; state
|
||||||
(dummy-23 () none 23)
|
(dummy-23 () none 23)
|
||||||
(dummy-24 () none 24)
|
(dummy-24 (_type_) none 24)
|
||||||
(dummy-25 () none 25)
|
(dummy-25 () none 25)
|
||||||
(dummy-26 () none 26)
|
(dummy-26 () none 26)
|
||||||
(dummy-27 () none 27)
|
(dummy-27 () none 27)
|
||||||
|
|
|
@ -5,3 +5,339 @@
|
||||||
;; name in dgo: shadow
|
;; name in dgo: shadow
|
||||||
;; dgos: GAME, ENGINE
|
;; dgos: GAME, ENGINE
|
||||||
|
|
||||||
|
;; definition for function add-fake-shadow-to-buffer
|
||||||
|
;; INFO: Return type mismatch int vs none.
|
||||||
|
(defun
|
||||||
|
add-fake-shadow-to-buffer
|
||||||
|
((arg0 vector) (arg1 vector) (arg2 float) (arg3 int))
|
||||||
|
(let ((v1-0 *fake-shadow-buffer*))
|
||||||
|
(when (< (-> v1-0 num-shadows) 32)
|
||||||
|
(let ((t0-5 (-> v1-0 data (-> v1-0 num-shadows))))
|
||||||
|
(set! (-> t0-5 px) (-> arg0 x))
|
||||||
|
(set! (-> t0-5 py) (-> arg0 y))
|
||||||
|
(set! (-> t0-5 pz) (-> arg0 z))
|
||||||
|
(set! (-> t0-5 scale) arg2)
|
||||||
|
(set! (-> t0-5 qx) (-> arg1 x))
|
||||||
|
(set! (-> t0-5 qy) (-> arg1 y))
|
||||||
|
(set! (-> t0-5 qz) (-> arg1 z))
|
||||||
|
(set! (-> t0-5 flags) arg3)
|
||||||
|
)
|
||||||
|
(+! (-> v1-0 num-shadows) 1)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
0
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for function swap-fake-shadow-buffers
|
||||||
|
;; INFO: Return type mismatch int vs none.
|
||||||
|
(defun swap-fake-shadow-buffers ()
|
||||||
|
(set! *fake-shadow-buffer* (if (= *fake-shadow-buffer* *fake-shadow-buffer-1*)
|
||||||
|
*fake-shadow-buffer-2*
|
||||||
|
*fake-shadow-buffer-1*
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(set! (-> *fake-shadow-buffer* num-shadows) 0)
|
||||||
|
0
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for function draw-shadow
|
||||||
|
;; INFO: Return type mismatch int vs none.
|
||||||
|
(defun
|
||||||
|
draw-shadow
|
||||||
|
((arg0 vector)
|
||||||
|
(arg1 vector)
|
||||||
|
(arg2 vector)
|
||||||
|
(arg3 float)
|
||||||
|
(arg4 float)
|
||||||
|
(arg5 float)
|
||||||
|
)
|
||||||
|
(let ((f0-1 (- (-> arg0 y) (-> arg1 y))))
|
||||||
|
(if (< f0-1 arg4)
|
||||||
|
(add-fake-shadow-to-buffer
|
||||||
|
arg1
|
||||||
|
arg2
|
||||||
|
(* (- 1.0 (/ f0-1 arg4)) arg3)
|
||||||
|
(the-as int arg5)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
0
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for function compute-and-draw-shadow
|
||||||
|
;; INFO: Return type mismatch int vs none.
|
||||||
|
;; Used lq/sq
|
||||||
|
(defun
|
||||||
|
compute-and-draw-shadow
|
||||||
|
((arg0 vector)
|
||||||
|
(arg1 vector)
|
||||||
|
(arg2 vector)
|
||||||
|
(arg3 vector)
|
||||||
|
(arg4 float)
|
||||||
|
(arg5 float)
|
||||||
|
)
|
||||||
|
(local-vars
|
||||||
|
(v1-10 float)
|
||||||
|
(v1-11 float)
|
||||||
|
(sv-96 vector)
|
||||||
|
(sv-112 (function quaternion vector float quaternion))
|
||||||
|
(sv-128 vector)
|
||||||
|
(sv-144 vector)
|
||||||
|
)
|
||||||
|
(rlet ((vf0 :class vf)
|
||||||
|
(vf1 :class vf)
|
||||||
|
(vf2 :class vf)
|
||||||
|
)
|
||||||
|
(init-vf0-vector)
|
||||||
|
(set! sv-96 arg2)
|
||||||
|
(let ((s4-0 arg3)
|
||||||
|
(s3-0 arg4)
|
||||||
|
(s2-0 arg5)
|
||||||
|
)
|
||||||
|
(when (< (- (-> arg0 y) (-> arg1 y)) s3-0)
|
||||||
|
(set! sv-144 (new 'stack-no-clear 'vector))
|
||||||
|
(let ((s0-0 (new 'stack-no-clear 'vector))
|
||||||
|
(s1-0 (new 'stack-no-clear 'sparticle-cpuinfo))
|
||||||
|
)
|
||||||
|
(set! (-> arg1 y) (+ 40.96 (-> arg1 y)))
|
||||||
|
(set! (-> sv-144 x) (-> sv-96 z))
|
||||||
|
(set! (-> sv-144 y) 0.0)
|
||||||
|
(set! (-> sv-144 z) (- (-> sv-96 x)))
|
||||||
|
(vector-normalize! sv-144 1.0)
|
||||||
|
(set! sv-112 quaternion-vector-angle!)
|
||||||
|
(set! sv-128 s0-0)
|
||||||
|
(let ((a2-1 (acos (-> sv-96 y))))
|
||||||
|
(sv-112 (the-as quaternion sv-128) sv-144 a2-1)
|
||||||
|
)
|
||||||
|
(let ((v1-9 s1-0))
|
||||||
|
(cond
|
||||||
|
((< (-> s0-0 w) 0.0)
|
||||||
|
(.lvf vf1 (&-> v1-9 vel-sxvel quad))
|
||||||
|
(.lvf vf2 (&-> s0-0 quad))
|
||||||
|
(.sub.vf vf1 vf0 vf2 :mask #b111)
|
||||||
|
(.svf (&-> v1-9 vel-sxvel quad) vf1)
|
||||||
|
(.mov v1-10 vf1)
|
||||||
|
)
|
||||||
|
(else
|
||||||
|
(.lvf vf1 (&-> v1-9 vel-sxvel quad))
|
||||||
|
(.lvf vf2 (&-> s0-0 quad))
|
||||||
|
(.add.vf vf1 vf0 vf2 :mask #b111)
|
||||||
|
(.svf (&-> v1-9 vel-sxvel quad) vf1)
|
||||||
|
(.mov v1-11 vf1)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(draw-shadow arg0 arg1 (-> s1-0 vel-sxvel) (the-as float s4-0) s3-0 s2-0)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
0
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for function find-ground-and-draw-shadow
|
||||||
|
;; INFO: Return type mismatch int vs none.
|
||||||
|
;; Used lq/sq
|
||||||
|
(defun
|
||||||
|
find-ground-and-draw-shadow
|
||||||
|
((arg0 vector)
|
||||||
|
(arg1 vector)
|
||||||
|
(arg2 float)
|
||||||
|
(arg3 uint)
|
||||||
|
(arg4 process)
|
||||||
|
(arg5 float)
|
||||||
|
(arg6 float)
|
||||||
|
)
|
||||||
|
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
||||||
|
(set! (-> s2-0 quad) (-> arg0 quad))
|
||||||
|
(new 'stack-no-clear 'vector)
|
||||||
|
(+! (-> s2-0 y) arg5)
|
||||||
|
(let ((s4-0 (new 'stack-no-clear 'bone)))
|
||||||
|
(cond
|
||||||
|
((>=
|
||||||
|
(dummy-12 *collide-cache* s2-0 arg6 arg3 arg4 s4-0 (the-as uint 1))
|
||||||
|
0.0
|
||||||
|
)
|
||||||
|
(if (!= arg2 0.0)
|
||||||
|
(compute-and-draw-shadow
|
||||||
|
s2-0
|
||||||
|
(-> s4-0 position)
|
||||||
|
(-> s4-0 scale)
|
||||||
|
(the-as vector arg2)
|
||||||
|
arg6
|
||||||
|
(the-as float 0)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(if (and arg1 (!= (shr (shl (-> s4-0 cache bone-matrix) 52) 58) 3))
|
||||||
|
(set! (-> arg1 quad) (-> s4-0 position quad))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(else
|
||||||
|
(if arg1
|
||||||
|
(vector+float*!
|
||||||
|
arg1
|
||||||
|
arg0
|
||||||
|
(-> *standard-dynamics* gravity-normal)
|
||||||
|
(- arg6)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
0
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for function do-target-shadow
|
||||||
|
;; INFO: Return type mismatch int vs none.
|
||||||
|
;; Used lq/sq
|
||||||
|
(defbehavior do-target-shadow target ()
|
||||||
|
(if
|
||||||
|
(and
|
||||||
|
(logtest? (-> self control status) 1)
|
||||||
|
(!= (-> self control unknown-surface mode) 'swim)
|
||||||
|
(!= (-> self control unknown-surface mode) 'dive)
|
||||||
|
(!= (-> self next-state name) 'target-flop)
|
||||||
|
(zero? (logand (-> self draw status) 38))
|
||||||
|
)
|
||||||
|
(set! (-> self control shadow-pos quad) (-> self control trans quad))
|
||||||
|
(find-ground-and-draw-shadow
|
||||||
|
(-> self control trans)
|
||||||
|
(-> self control shadow-pos)
|
||||||
|
0.0
|
||||||
|
(-> (the-as collide-shape-prim (-> self control root-prim)) collide-with)
|
||||||
|
self
|
||||||
|
0.0
|
||||||
|
81920.0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
0
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; failed to figure out what this is:
|
||||||
|
(set!
|
||||||
|
(-> *part-id-table* 362)
|
||||||
|
(new 'static 'sparticle-launcher
|
||||||
|
:init-specs
|
||||||
|
(new 'static 'inline-array sp-field-init-spec 20
|
||||||
|
(new 'static 'sp-field-init-spec :field #x1 :initial-value #x200000)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x6
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x41000000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #xd
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x4499999a
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x10
|
||||||
|
:flags #x1
|
||||||
|
:initial-value -956301312
|
||||||
|
:random-range #x47800000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x11
|
||||||
|
:flags #x3
|
||||||
|
:initial-value -4
|
||||||
|
:random-mult 1
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x12
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x42b40000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x13
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x42b40000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x14
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x42b40000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x15
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x41a00000
|
||||||
|
:random-range #x41a00000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x1a
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x4103126f
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x1c
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x41888889
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x20
|
||||||
|
:flags #x3
|
||||||
|
:initial-value -4
|
||||||
|
:random-mult 1
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x24
|
||||||
|
:flags #x1
|
||||||
|
:initial-value -1097229926
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x2e
|
||||||
|
:initial-value #x138c
|
||||||
|
:random-mult 1
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x2f
|
||||||
|
:initial-value 12
|
||||||
|
:random-mult 1
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x36
|
||||||
|
:flags #x1
|
||||||
|
:initial-value -983331271
|
||||||
|
:random-range #x452aaaab
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x3a
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x46800000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x3b
|
||||||
|
:flags #x1
|
||||||
|
:initial-value -956301312
|
||||||
|
:random-range #x47800000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x3e
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x444ccccd
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec :field #x43)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
|
@ -84,3 +84,7 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
(define-extern part-group-pointer? (function pointer symbol))
|
(define-extern part-group-pointer? (function pointer symbol))
|
||||||
|
|
||||||
|
;; TODO - for shadow
|
||||||
|
(define-extern *part-id-table* (array sparticle-launcher))
|
||||||
|
(define-extern *part-group-id-table* (array sparticle-launch-group))
|
||||||
|
|
|
@ -6,19 +6,19 @@
|
||||||
;; dgos: GAME, ENGINE
|
;; dgos: GAME, ENGINE
|
||||||
|
|
||||||
(deftype sp-field-init-spec (structure)
|
(deftype sp-field-init-spec (structure)
|
||||||
((field uint16 :offset-assert 0)
|
((field uint16 :offset-assert 0)
|
||||||
(flags uint16 :offset-assert 2)
|
(flags uint16 :offset-assert 2)
|
||||||
(initial-valuef float :offset-assert 4)
|
(initial-value int32 :offset-assert 4)
|
||||||
(random-rangef float :offset-assert 8)
|
(random-range int32 :offset-assert 8)
|
||||||
(random-multf float :offset-assert 12)
|
(random-mult int32 :offset-assert 12)
|
||||||
(initial-value int32 :offset 4)
|
(initial-valuef float :offset 4) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
|
||||||
(random-range int32 :offset 8)
|
(random-rangef float :offset 8) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
|
||||||
(random-mult int32 :offset 12)
|
(random-multf float :offset 12) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
|
||||||
(func basic :offset 4)
|
(func basic :offset 4)
|
||||||
(tex uint32 :offset 4)
|
(tex uint32 :offset 4)
|
||||||
(pntr uint32 :offset 4)
|
(pntr uint32 :offset 4)
|
||||||
(sym basic :offset 4)
|
(sym basic :offset 4)
|
||||||
(sound basic :offset 4)
|
(sound basic :offset 4)
|
||||||
)
|
)
|
||||||
:method-count-assert 9
|
:method-count-assert 9
|
||||||
:size-assert #x10
|
:size-assert #x10
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
(deftype sparticle-launcher (basic)
|
(deftype sparticle-launcher (basic)
|
||||||
((birthaccum float :offset-assert 4)
|
((birthaccum float :offset-assert 4)
|
||||||
(soundaccum float :offset-assert 8)
|
(soundaccum float :offset-assert 8)
|
||||||
(init-specs uint32 :offset-assert 12)
|
(init-specs (inline-array sp-field-init-spec) :offset-assert 12)
|
||||||
)
|
)
|
||||||
:method-count-assert 9
|
:method-count-assert 9
|
||||||
:size-assert #x10
|
:size-assert #x10
|
||||||
|
|
|
@ -5,3 +5,6 @@
|
||||||
;; name in dgo: sparticle-launcher
|
;; name in dgo: sparticle-launcher
|
||||||
;; dgos: GAME, ENGINE
|
;; dgos: GAME, ENGINE
|
||||||
|
|
||||||
|
;; TODO - for shadow
|
||||||
|
(define *part-id-table* (new 'global 'boxed-array sparticle-launcher 3584))
|
||||||
|
(define *part-group-id-table* (new 'global 'boxed-array sparticle-launch-group 1024))
|
||||||
|
|
|
@ -189,15 +189,15 @@
|
||||||
(dummy-9 () none 9)
|
(dummy-9 () none 9)
|
||||||
(dummy-10 () none 10)
|
(dummy-10 () none 10)
|
||||||
(dummy-11 () none 11)
|
(dummy-11 () none 11)
|
||||||
(dummy-12 () none 12)
|
(dummy-12 (_type_ vector float uint process bone uint) float 12)
|
||||||
(dummy-13 () none 13)
|
(dummy-13 () none 13)
|
||||||
(dummy-14 () none 14)
|
(dummy-14 () none 14)
|
||||||
(dummy-15 () none 15)
|
(dummy-15 () none 15)
|
||||||
(dummy-16 () none 16)
|
(dummy-16 (_type_ vector float uint process uint) none 16)
|
||||||
(dummy-17 () none 17)
|
(dummy-17 () none 17)
|
||||||
(dummy-18 () none 18)
|
(dummy-18 () none 18)
|
||||||
(dummy-19 () none 19)
|
(dummy-19 () none 19)
|
||||||
(dummy-20 () none 20)
|
(dummy-20 (_type_ vector float uint bone uint) none 20)
|
||||||
(dummy-21 () none 21)
|
(dummy-21 () none 21)
|
||||||
(dummy-22 () none 22)
|
(dummy-22 () none 22)
|
||||||
(dummy-23 () none 23)
|
(dummy-23 () none 23)
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
(projectile-dissipate () none 21)
|
(projectile-dissipate () none 21)
|
||||||
(projectile-impact () none 22)
|
(projectile-impact () none 22)
|
||||||
(dummy-23 () none 23)
|
(dummy-23 () none 23)
|
||||||
(dummy-24 () none 24)
|
(dummy-24 (_type_) none 24)
|
||||||
(dummy-25 () none 25)
|
(dummy-25 () none 25)
|
||||||
(dummy-26 () none 26)
|
(dummy-26 () none 26)
|
||||||
(dummy-27 () none 27)
|
(dummy-27 () none 27)
|
||||||
|
|
343
test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc
Normal file
343
test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc
Normal file
|
@ -0,0 +1,343 @@
|
||||||
|
;;-*-Lisp-*-
|
||||||
|
(in-package goal)
|
||||||
|
|
||||||
|
;; definition for function add-fake-shadow-to-buffer
|
||||||
|
;; INFO: Return type mismatch int vs none.
|
||||||
|
(defun
|
||||||
|
add-fake-shadow-to-buffer
|
||||||
|
((arg0 vector) (arg1 vector) (arg2 float) (arg3 int))
|
||||||
|
(let ((v1-0 *fake-shadow-buffer*))
|
||||||
|
(when (< (-> v1-0 num-shadows) 32)
|
||||||
|
(let ((t0-5 (-> v1-0 data (-> v1-0 num-shadows))))
|
||||||
|
(set! (-> t0-5 px) (-> arg0 x))
|
||||||
|
(set! (-> t0-5 py) (-> arg0 y))
|
||||||
|
(set! (-> t0-5 pz) (-> arg0 z))
|
||||||
|
(set! (-> t0-5 scale) arg2)
|
||||||
|
(set! (-> t0-5 qx) (-> arg1 x))
|
||||||
|
(set! (-> t0-5 qy) (-> arg1 y))
|
||||||
|
(set! (-> t0-5 qz) (-> arg1 z))
|
||||||
|
(set! (-> t0-5 flags) arg3)
|
||||||
|
)
|
||||||
|
(+! (-> v1-0 num-shadows) 1)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
0
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for function swap-fake-shadow-buffers
|
||||||
|
;; INFO: Return type mismatch int vs none.
|
||||||
|
(defun swap-fake-shadow-buffers ()
|
||||||
|
(set! *fake-shadow-buffer* (if (= *fake-shadow-buffer* *fake-shadow-buffer-1*)
|
||||||
|
*fake-shadow-buffer-2*
|
||||||
|
*fake-shadow-buffer-1*
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(set! (-> *fake-shadow-buffer* num-shadows) 0)
|
||||||
|
0
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for function draw-shadow
|
||||||
|
;; INFO: Return type mismatch int vs none.
|
||||||
|
(defun
|
||||||
|
draw-shadow
|
||||||
|
((arg0 vector)
|
||||||
|
(arg1 vector)
|
||||||
|
(arg2 vector)
|
||||||
|
(arg3 float)
|
||||||
|
(arg4 float)
|
||||||
|
(arg5 float)
|
||||||
|
)
|
||||||
|
(let ((f0-1 (- (-> arg0 y) (-> arg1 y))))
|
||||||
|
(if (< f0-1 arg4)
|
||||||
|
(add-fake-shadow-to-buffer
|
||||||
|
arg1
|
||||||
|
arg2
|
||||||
|
(* (- 1.0 (/ f0-1 arg4)) arg3)
|
||||||
|
(the-as int arg5)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
0
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for function compute-and-draw-shadow
|
||||||
|
;; INFO: Return type mismatch int vs none.
|
||||||
|
;; Used lq/sq
|
||||||
|
(defun
|
||||||
|
compute-and-draw-shadow
|
||||||
|
((arg0 vector)
|
||||||
|
(arg1 vector)
|
||||||
|
(arg2 vector)
|
||||||
|
(arg3 vector)
|
||||||
|
(arg4 float)
|
||||||
|
(arg5 float)
|
||||||
|
)
|
||||||
|
(local-vars
|
||||||
|
(v1-10 float)
|
||||||
|
(v1-11 float)
|
||||||
|
(sv-96 vector)
|
||||||
|
(sv-112 (function quaternion vector float quaternion))
|
||||||
|
(sv-128 vector)
|
||||||
|
(sv-144 vector)
|
||||||
|
)
|
||||||
|
(rlet ((vf0 :class vf)
|
||||||
|
(vf1 :class vf)
|
||||||
|
(vf2 :class vf)
|
||||||
|
)
|
||||||
|
(init-vf0-vector)
|
||||||
|
(set! sv-96 arg2)
|
||||||
|
(let ((s4-0 arg3)
|
||||||
|
(s3-0 arg4)
|
||||||
|
(s2-0 arg5)
|
||||||
|
)
|
||||||
|
(when (< (- (-> arg0 y) (-> arg1 y)) s3-0)
|
||||||
|
(set! sv-144 (new 'stack-no-clear 'vector))
|
||||||
|
(let ((s0-0 (new 'stack-no-clear 'vector))
|
||||||
|
(s1-0 (new 'stack-no-clear 'sparticle-cpuinfo))
|
||||||
|
)
|
||||||
|
(set! (-> arg1 y) (+ 40.96 (-> arg1 y)))
|
||||||
|
(set! (-> sv-144 x) (-> sv-96 z))
|
||||||
|
(set! (-> sv-144 y) 0.0)
|
||||||
|
(set! (-> sv-144 z) (- (-> sv-96 x)))
|
||||||
|
(vector-normalize! sv-144 1.0)
|
||||||
|
(set! sv-112 quaternion-vector-angle!)
|
||||||
|
(set! sv-128 s0-0)
|
||||||
|
(let ((a2-1 (acos (-> sv-96 y))))
|
||||||
|
(sv-112 (the-as quaternion sv-128) sv-144 a2-1)
|
||||||
|
)
|
||||||
|
(let ((v1-9 s1-0))
|
||||||
|
(cond
|
||||||
|
((< (-> s0-0 w) 0.0)
|
||||||
|
(.lvf vf1 (&-> v1-9 vel-sxvel quad))
|
||||||
|
(.lvf vf2 (&-> s0-0 quad))
|
||||||
|
(.sub.vf vf1 vf0 vf2 :mask #b111)
|
||||||
|
(.svf (&-> v1-9 vel-sxvel quad) vf1)
|
||||||
|
(.mov v1-10 vf1)
|
||||||
|
)
|
||||||
|
(else
|
||||||
|
(.lvf vf1 (&-> v1-9 vel-sxvel quad))
|
||||||
|
(.lvf vf2 (&-> s0-0 quad))
|
||||||
|
(.add.vf vf1 vf0 vf2 :mask #b111)
|
||||||
|
(.svf (&-> v1-9 vel-sxvel quad) vf1)
|
||||||
|
(.mov v1-11 vf1)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(draw-shadow arg0 arg1 (-> s1-0 vel-sxvel) (the-as float s4-0) s3-0 s2-0)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
0
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for function find-ground-and-draw-shadow
|
||||||
|
;; INFO: Return type mismatch int vs none.
|
||||||
|
;; Used lq/sq
|
||||||
|
(defun
|
||||||
|
find-ground-and-draw-shadow
|
||||||
|
((arg0 vector)
|
||||||
|
(arg1 vector)
|
||||||
|
(arg2 float)
|
||||||
|
(arg3 uint)
|
||||||
|
(arg4 process)
|
||||||
|
(arg5 float)
|
||||||
|
(arg6 float)
|
||||||
|
)
|
||||||
|
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
||||||
|
(set! (-> s2-0 quad) (-> arg0 quad))
|
||||||
|
(new 'stack-no-clear 'vector)
|
||||||
|
(+! (-> s2-0 y) arg5)
|
||||||
|
(let ((s4-0 (new 'stack-no-clear 'bone)))
|
||||||
|
(cond
|
||||||
|
((>=
|
||||||
|
(dummy-12 *collide-cache* s2-0 arg6 arg3 arg4 s4-0 (the-as uint 1))
|
||||||
|
0.0
|
||||||
|
)
|
||||||
|
(if (!= arg2 0.0)
|
||||||
|
(compute-and-draw-shadow
|
||||||
|
s2-0
|
||||||
|
(-> s4-0 position)
|
||||||
|
(-> s4-0 scale)
|
||||||
|
(the-as vector arg2)
|
||||||
|
arg6
|
||||||
|
(the-as float 0)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(if (and arg1 (!= (shr (shl (-> s4-0 cache bone-matrix) 52) 58) 3))
|
||||||
|
(set! (-> arg1 quad) (-> s4-0 position quad))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(else
|
||||||
|
(if arg1
|
||||||
|
(vector+float*!
|
||||||
|
arg1
|
||||||
|
arg0
|
||||||
|
(-> *standard-dynamics* gravity-normal)
|
||||||
|
(- arg6)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
0
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for function do-target-shadow
|
||||||
|
;; INFO: Return type mismatch int vs none.
|
||||||
|
;; Used lq/sq
|
||||||
|
(defbehavior do-target-shadow target ()
|
||||||
|
(if
|
||||||
|
(and
|
||||||
|
(logtest? (-> self control status) 1)
|
||||||
|
(!= (-> self control unknown-surface mode) 'swim)
|
||||||
|
(!= (-> self control unknown-surface mode) 'dive)
|
||||||
|
(!= (-> self next-state name) 'target-flop)
|
||||||
|
(zero? (logand (-> self draw status) 38))
|
||||||
|
)
|
||||||
|
(set! (-> self control shadow-pos quad) (-> self control trans quad))
|
||||||
|
(find-ground-and-draw-shadow
|
||||||
|
(-> self control trans)
|
||||||
|
(-> self control shadow-pos)
|
||||||
|
0.0
|
||||||
|
(-> (the-as collide-shape-prim (-> self control root-prim)) collide-with)
|
||||||
|
self
|
||||||
|
0.0
|
||||||
|
81920.0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
0
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; failed to figure out what this is:
|
||||||
|
(set!
|
||||||
|
(-> *part-id-table* 362)
|
||||||
|
(new 'static 'sparticle-launcher
|
||||||
|
:init-specs
|
||||||
|
(new 'static 'inline-array sp-field-init-spec 20
|
||||||
|
(new 'static 'sp-field-init-spec :field #x1 :initial-value #x200000)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x6
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x41000000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #xd
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x4499999a
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x10
|
||||||
|
:flags #x1
|
||||||
|
:initial-value -956301312
|
||||||
|
:random-range #x47800000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x11
|
||||||
|
:flags #x3
|
||||||
|
:initial-value -4
|
||||||
|
:random-mult 1
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x12
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x42b40000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x13
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x42b40000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x14
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x42b40000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x15
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x41a00000
|
||||||
|
:random-range #x41a00000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x1a
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x4103126f
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x1c
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x41888889
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x20
|
||||||
|
:flags #x3
|
||||||
|
:initial-value -4
|
||||||
|
:random-mult 1
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x24
|
||||||
|
:flags #x1
|
||||||
|
:initial-value -1097229926
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x2e
|
||||||
|
:initial-value #x138c
|
||||||
|
:random-mult 1
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x2f
|
||||||
|
:initial-value 12
|
||||||
|
:random-mult 1
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x36
|
||||||
|
:flags #x1
|
||||||
|
:initial-value -983331271
|
||||||
|
:random-range #x452aaaab
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x3a
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x46800000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x3b
|
||||||
|
:flags #x1
|
||||||
|
:initial-value -956301312
|
||||||
|
:random-range #x47800000
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec
|
||||||
|
:field #x3e
|
||||||
|
:flags #x1
|
||||||
|
:initial-value #x444ccccd
|
||||||
|
:random-mult #x3f800000
|
||||||
|
)
|
||||||
|
(new 'static 'sp-field-init-spec :field #x43)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
(deftype sp-field-init-spec (structure)
|
(deftype sp-field-init-spec (structure)
|
||||||
((field uint16 :offset-assert 0)
|
((field uint16 :offset-assert 0)
|
||||||
(flags uint16 :offset-assert 2)
|
(flags uint16 :offset-assert 2)
|
||||||
(initial-valuef float :offset-assert 4)
|
(initial-value int32 :offset-assert 4)
|
||||||
(random-rangef float :offset-assert 8)
|
(random-range int32 :offset-assert 8)
|
||||||
(random-multf float :offset-assert 12)
|
(random-mult int32 :offset-assert 12)
|
||||||
(initial-value int32 :offset 4)
|
(initial-valuef float :offset 4)
|
||||||
(random-range int32 :offset 8)
|
(random-rangef float :offset 8)
|
||||||
(random-mult int32 :offset 12)
|
(random-multf float :offset 12)
|
||||||
(func basic :offset 4)
|
(func basic :offset 4)
|
||||||
(tex uint32 :offset 4)
|
(tex uint32 :offset 4)
|
||||||
(pntr uint32 :offset 4)
|
(pntr uint32 :offset 4)
|
||||||
|
@ -30,9 +30,9 @@
|
||||||
(format #t "~Tinitial-valuef: ~f~%" (-> obj initial-valuef))
|
(format #t "~Tinitial-valuef: ~f~%" (-> obj initial-valuef))
|
||||||
(format #t "~Trandom-rangef: ~f~%" (-> obj random-rangef))
|
(format #t "~Trandom-rangef: ~f~%" (-> obj random-rangef))
|
||||||
(format #t "~Trandom-multf: ~f~%" (-> obj random-multf))
|
(format #t "~Trandom-multf: ~f~%" (-> obj random-multf))
|
||||||
(format #t "~Tinitial-value: ~D~%" (-> obj initial-valuef))
|
(format #t "~Tinitial-value: ~D~%" (-> obj initial-value))
|
||||||
(format #t "~Trandom-range: ~D~%" (-> obj random-rangef))
|
(format #t "~Trandom-range: ~D~%" (-> obj random-range))
|
||||||
(format #t "~Trandom-mult: ~D~%" (-> obj random-multf))
|
(format #t "~Trandom-mult: ~D~%" (-> obj random-mult))
|
||||||
(format #t "~Tfunc: ~A~%" (-> obj initial-valuef))
|
(format #t "~Tfunc: ~A~%" (-> obj initial-valuef))
|
||||||
(format #t "~Ttex: ~D~%" (-> obj initial-valuef))
|
(format #t "~Ttex: ~D~%" (-> obj initial-valuef))
|
||||||
(format #t "~Tpntr: #x~X~%" (-> obj initial-valuef))
|
(format #t "~Tpntr: #x~X~%" (-> obj initial-valuef))
|
||||||
|
@ -43,9 +43,9 @@
|
||||||
|
|
||||||
;; definition of type sparticle-launcher
|
;; definition of type sparticle-launcher
|
||||||
(deftype sparticle-launcher (basic)
|
(deftype sparticle-launcher (basic)
|
||||||
((birthaccum float :offset-assert 4)
|
((birthaccum float :offset-assert 4)
|
||||||
(soundaccum float :offset-assert 8)
|
(soundaccum float :offset-assert 8)
|
||||||
(init-specs uint32 :offset-assert 12)
|
(init-specs (inline-array sp-field-init-spec) :offset-assert 12)
|
||||||
)
|
)
|
||||||
:method-count-assert 9
|
:method-count-assert 9
|
||||||
:size-assert #x10
|
:size-assert #x10
|
||||||
|
|
Loading…
Reference in a new issue