target code bugfixes (#2034)

This commit is contained in:
water111
2022-11-21 20:25:20 -05:00
committed by GitHub
parent a0a85eb60a
commit 7a1a64acba
47 changed files with 5957 additions and 311 deletions
+44 -23
View File
@@ -717,6 +717,31 @@ void LoadSourceElement::update_from_stack(const Env& env,
result->push_back(this);
}
namespace {
FormElement* label_to_form_element(const Env& env, const SimpleAtom& atom, FormPool& pool) {
auto lab = env.file->labels.at(atom.label());
if (env.file->is_string(lab.target_segment, lab.offset)) {
auto str = env.file->get_goal_string(lab.target_segment, lab.offset / 4 - 1, false);
return pool.alloc_element<StringConstantElement>(str);
} else {
// look for a label hint:
const auto& hint = env.file->label_db->lookup(lab.name);
if (!hint.known) {
throw std::runtime_error(
fmt::format("Label {} was unknown in FormExpressionAnalysis.", hint.name));
}
if (hint.is_value) {
return nullptr;
}
if (hint.result_type.base_type() == "function") {
return nullptr;
} else {
return pool.alloc_element<DecompiledDataElement>(lab, hint);
}
}
}
} // namespace
void SimpleExpressionElement::update_from_stack_identity(const Env& env,
FormPool& pool,
FormStack& stack,
@@ -729,30 +754,13 @@ void SimpleExpressionElement::update_from_stack_identity(const Env& env,
result->push_back(x);
}
} else if (arg.is_static_addr()) {
auto lab = env.file->labels.at(arg.label());
if (env.file->is_string(lab.target_segment, lab.offset)) {
auto str = env.file->get_goal_string(lab.target_segment, lab.offset / 4 - 1, false);
result->push_back(pool.alloc_element<StringConstantElement>(str));
auto as_label_form_element = label_to_form_element(env, arg, pool);
if (as_label_form_element) {
result->push_back(as_label_form_element);
} else {
// look for a label hint:
const auto& hint = env.file->label_db->lookup(lab.name);
if (!hint.known) {
throw std::runtime_error(
fmt::format("Label {} was unknown in FormExpressionAnalysis.", hint.name));
}
if (hint.is_value) {
result->push_back(this);
return;
}
if (hint.result_type.base_type() == "function") {
result->push_back(this);
return;
} else {
result->push_back(pool.alloc_element<DecompiledDataElement>(lab, hint));
return;
}
result->push_back(this);
}
return;
} else if (arg.is_sym_ptr() || arg.is_sym_val() || arg.is_int() || arg.is_empty_list() ||
arg.is_sym_val_ptr()) {
result->push_back(this);
@@ -1035,8 +1043,21 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
args = pop_to_forms({m_expr.get_arg(0).var(), m_expr.get_arg(1).var()}, env, pool, stack,
allow_side_effects);
} else {
// arg1 might be a label.
// do arg0 like a normal var
args = pop_to_forms({m_expr.get_arg(0).var()}, env, pool, stack, allow_side_effects);
args.push_back(pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
// then try to simplify the label
if (m_expr.get_arg(1).is_label()) {
auto as_lab = label_to_form_element(env, m_expr.get_arg(1), pool);
if (as_lab) {
args.push_back(pool.alloc_single_form(nullptr, as_lab));
} else {
args.push_back(pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
}
} else {
args.push_back(pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
}
}
bool arg0_ptr = is_ptr_or_child(env, m_my_idx, m_expr.get_arg(0).var(), true);
+22
View File
@@ -1098,6 +1098,28 @@ std::unique_ptr<AtomicOp> convert_daddiu_2(const Instruction& i0,
return std::make_unique<SetVarConditionOp>(make_dst_var(dest, idx),
IR2_Condition(kind, make_src_atom(src, idx)), idx);
}
// daddiu v1, v1, L152
// daddu v1, v1, fp
if (i1.kind == InstructionKind::DADDU && i0.get_src(1).is_label()) {
auto dest = i0.get_src(0).get_reg();
if (!i0.get_src(0).is_reg(dest)) {
return nullptr;
}
if (!i1.get_src(0).is_reg(dest)) {
return nullptr;
}
if (!i1.get_src(0).is_reg(dest)) {
return nullptr;
}
if (!i1.get_src(1).is_reg(rfp())) {
return nullptr;
}
auto stat = SimpleAtom::make_static_address(i0.get_src(1).get_label());
auto expr = SimpleExpression(SimpleExpression::Kind::ADD, make_src_atom(dest, idx), stat);
return std::make_unique<SetVarOp>(make_dst_var(dest, idx), expr, idx);
}
return nullptr;
}
+97 -85
View File
@@ -1888,6 +1888,9 @@
(sm-unk1)
(sm-unk2)
(reg0)
(reg1)
(reg2)
(unk)
)
@@ -8106,6 +8109,9 @@
;; main-h ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(deftype frame-stats (structure)
((field-time time-frame 2 :offset-assert 0) ;; guessed by decompiler
(field int32 :offset-assert 16)
@@ -8135,6 +8141,76 @@
)
)
(defenum collide-spec
:bitfield #t
:type uint32
(backgnd 0) ;; 1
(jak 1) ;; 2
(bot 2) ;; 4
(crate 3) ;; 8
(civilian 4) ;; 16
(enemy 5) ;; 32
(obstacle 6) ;; 64
(vehicle-sphere 7) ;; 128
(hit-by-player-list 8) ;; 256
(hit-by-others-list 9) ;; 512
(player-list 10) ;; 1024
(water 11) ;; 2048
(collectable 12) ;; 4096
(blocking-plane 13) ;; 8192
(projectile 14) ;; 16384
(jak-vulnerable 15) ;; 32768
(camera-blocker 16) ;; hi 1
(notice-blue-eco-powerup 17) ;; hi 2
(tobot 18) ;; hi 4
(pusher 19) ;; hi 8
(vehicle-mesh 20) ;; hi 16
(bot-targetable 21) ;; hi 32
(jak-vehicle 22) ;; hi 64
(special-obstacle 23) ;; hi 128
(mech-punch 24) ;; hi 256
(obstacle-for-jak 25) ;; hi 512
(vehicle-mesh-probeable 26) ;; hi 1024
(unknown-27 27)
(unknown-28 28)
(unknown-29 29)
(unknown-30 30)
(unknown-31 31)
(unknown-32 32)
(unknown-33 33)
(unknown-34 34)
(unknown-35 35)
(unknown-36 36)
(unknown-37 37)
(unknown-38 38)
(unknown-39 39)
(unknown-40 40)
(unknown-41 41)
(unknown-42 42)
(unknown-43 43)
(unknown-44 44)
(unknown-45 45)
(unknown-46 46)
(unknown-47 47)
(unknown-48 48)
(unknown-49 49)
(unknown-50 50)
(unknown-51 51)
(unknown-52 52)
(unknown-53 53)
(unknown-54 54)
(unknown-55 55)
(unknown-56 56)
(unknown-57 57)
(unknown-58 58)
(unknown-59 59)
(unknown-60 60)
(unknown-61 61)
(unknown-62 62)
(unknown-63 63)
)
(deftype col-rend (basic)
((draw? symbol :offset-assert 4)
(outline? symbol :offset-assert 8)
@@ -8142,7 +8218,7 @@
(show-normals? symbol :offset-assert 16)
(ghost-hidden? symbol :offset-assert 20)
(show-only uint32 :offset-assert 24)
(cspec uint32 :offset-assert 28)
(cspec collide-spec :offset-assert 28)
(track uint8 :offset-assert 32)
(bbox-radius float :offset-assert 36)
(bbox-center vector :inline :offset-assert 48)
@@ -8152,7 +8228,7 @@
:size-assert #x44
:flag-assert #xa00000044
(:methods
(col-rend-method-9 () none 9)
(col-rend-method-9 (_type_) none 9)
)
)
@@ -15859,75 +15935,6 @@
(declare-type collide-shape-moving collide-shape)
(declare-type touching-list structure)
(defenum collide-spec
:bitfield #t
:type uint32
(backgnd 0) ;; 1
(jak 1) ;; 2
(bot 2) ;; 4
(crate 3) ;; 8
(civilian 4) ;; 16
(enemy 5) ;; 32
(obstacle 6) ;; 64
(vehicle-sphere 7) ;; 128
(hit-by-player-list 8) ;; 256
(hit-by-others-list 9) ;; 512
(player-list 10) ;; 1024
(water 11) ;; 2048
(collectable 12) ;; 4096
(blocking-plane 13) ;; 8192
(projectile 14) ;; 16384
(jak-vulnerable 15) ;; 32768
(camera-blocker 16) ;; hi 1
(notice-blue-eco-powerup 17) ;; hi 2
(tobot 18) ;; hi 4
(pusher 19) ;; hi 8
(vehicle-mesh 20) ;; hi 16
(bot-targetable 21) ;; hi 32
(jak-vehicle 22) ;; hi 64
(special-obstacle 23) ;; hi 128
(mech-punch 24) ;; hi 256
(obstacle-for-jak 25) ;; hi 512
(vehicle-mesh-probeable 26) ;; hi 1024
(unknown-27 27)
(unknown-28 28)
(unknown-29 29)
(unknown-30 30)
(unknown-31 31)
(unknown-32 32)
(unknown-33 33)
(unknown-34 34)
(unknown-35 35)
(unknown-36 36)
(unknown-37 37)
(unknown-38 38)
(unknown-39 39)
(unknown-40 40)
(unknown-41 41)
(unknown-42 42)
(unknown-43 43)
(unknown-44 44)
(unknown-45 45)
(unknown-46 46)
(unknown-47 47)
(unknown-48 48)
(unknown-49 49)
(unknown-50 50)
(unknown-51 51)
(unknown-52 52)
(unknown-53 53)
(unknown-54 54)
(unknown-55 55)
(unknown-56 56)
(unknown-57 57)
(unknown-58 58)
(unknown-59 59)
(unknown-60 60)
(unknown-61 61)
(unknown-62 62)
(unknown-63 63)
)
(defenum collide-action
:bitfield #t
@@ -17359,7 +17366,7 @@
(find-grabbable-tris (_type_) none 17) ;; (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 17)
(should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 18)
(find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol 19)
(check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) none 20)
(check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol 20)
)
)
@@ -17514,6 +17521,13 @@
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; effect-control ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-extern *footstep-surface* pat-surface)
(define-extern sound-name-with-material (function string pat-surface string sound-name))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; effect-control-h ;;
@@ -17571,12 +17585,12 @@
:flag-assert #xf00000024
(:methods
(new (symbol type process-drawable) _type_ 0)
(effect-control-method-9 (_type_) none 9) ;; (TODO-RENAME-9 (_type_) none 9)
(update-effects (_type_) none 9) ;; (TODO-RENAME-9 (_type_) none 9)
(do-effect (_type_ symbol float int) none 10) ;; (dummy-10 (_type_ symbol float int) object 10)
(effect-control-method-11 () none 11) ;; (dummy-11 (_type_ symbol float int basic pat-surface) none 11)
(do-effect-for-surface (_type_ symbol float int basic pat-surface) none 11) ;; (dummy-11 (_type_ symbol float int basic pat-surface) none 11)
(play-effect-sound (_type_ symbol float int basic sound-name) int 12) ;; (dummy-12 (_type_ symbol float int basic sound-name) int 12)
(set-channel-offset! (_type_ int) none 13)
(effect-control-method-14 () none 14) ;; (TODO-RENAME-14 (_type_ float float float) none 14)
(play-effects-from-res-lump (_type_ float float float) none 14) ;; (TODO-RENAME-14 (_type_ float float float) none 14)
)
)
@@ -22951,7 +22965,7 @@
;; ghost function
(define-extern *debug-effect-control* symbol)
(define-extern effect-param->sound-spec (function sound-spec (pointer float) int sound-spec))
(define-extern effect-param->sound-spec (function sound-spec (pointer float) int process-focusable sound-spec))
(deftype engine-sound-pers (engine-pers)
()
@@ -28870,7 +28884,7 @@
(define-extern want-to-darkjak? (function symbol :behavior target))
(define-extern *darkjak-trans-mods* surface)
(define-extern target-darkjak-end-mode (function none :behavior target))
(define-extern target-darkjak-process (function object object object object object object float none :behavior target)) ;; only arg6 used
(define-extern target-darkjak-process (function none :behavior target)) ;; only arg6 used
(define-extern target-darkjak-get-on (state int target))
(define-extern target-darkjak-get-off (state target))
(define-extern target-darkjak-running-attack (state target))
@@ -29471,7 +29485,7 @@
(define-extern prototype-bucket-type (function prototype-bucket type))
(define-extern prototype-bucket-recalc-fields (function prototype-bucket prototype-bucket))
(define-extern print-prototype-list (function none))
;; (define-extern draw-instance-info function) ;; (function string none)
(define-extern draw-instance-info (function string none))
;; (define-extern set-shadow-by-name function)
;; (define-extern get-shadow-by-name function)
;; (define-extern teleport-camera-by-name function)
@@ -29480,8 +29494,8 @@
;; (define-extern dma-add-process-drawable-hud function) ;; (function process-drawable draw-control symbol dma-buffer none)
(define-extern add-process-drawable (function process-drawable draw-control symbol dma-buffer none))
(define-extern foreground-engine-execute (function engine display-frame none))
;; (define-extern main-debug-hook function) ;; (function none)
;; (define-extern *debug-hook* object) ;; (function none)
(define-extern main-debug-hook (function none))
;(define-extern *debug-hook* (function none))
(define-extern *add-sphere* symbol)
(define-extern *generic-effect-mode* int)
(define-extern foreground-initialize-engines (function none))
@@ -29617,19 +29631,17 @@
;; collide-debug ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#|
(deftype col-rend-filter (structure)
((show-pat-set uint32 :offset-assert 0)
(show-pat-clear uint32 :offset-assert 4)
((show-pat-set pat-surface :offset-assert 0)
(show-pat-clear pat-surface :offset-assert 4)
(event-mask uint32 :offset-assert 8)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
|#
;; (define-extern col-rend-draw function)
(define-extern col-rend-draw (function col-rend col-rend-filter none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; relocate ;;
-4
View File
@@ -109,10 +109,6 @@
// CFG failed
"draw-inline-array-instance-shrub",
"target-land-effect",
"(method 12 effect-control)",
"(method 11 effect-control)",
"(method 10 effect-control)",
"(method 10 bigmap)",
"(method 9 editable-region)", // condition branch assert hit
"(anon-function 10 meet-brutter)",
+3 -2
View File
@@ -56,7 +56,7 @@
// "DGO/SWB.DGO",
// "DGO/LPOWER.DGO",
// "DGO/FOB.DGO",
// "DGO/CIB.DGO",
"DGO/CIB.DGO",
// "DGO/LSHUTTLE.DGO",
// "DGO/LJAKDAX.DGO",
// "DGO/FORDUMPC.DGO",
@@ -189,6 +189,7 @@
"CTA.DGO",
"CWI.DGO",
"LWIDEA.DGO",
"VI1.DGO"
"VI1.DGO",
"CIB.DGO"
]
}
@@ -1199,5 +1199,8 @@
[304, "quaternion"],
[384, "vector"]
],
"(method 20 collide-cache)": [[16, "matrix"]]
"(method 20 collide-cache)": [[16, "matrix"]],
"col-rend-draw": [
[16, "matrix"]
]
}
+34 -6
View File
@@ -3248,11 +3248,8 @@
[97, "v1", "fact-info-target"]
],
"cloud-track": [
[32, "s1", "handle"],
[45, "s2", "handle"],
[81, "s1", "handle"],
[83, "s2", "handle"],
[107, "s2", "handle"]
[[19, 83], "s1", "handle"],
[[29, 116], "s2", "handle"]
],
"(code target-darkjak-bomb1)": [
[408, "v1", "art-joint-anim"],
@@ -4682,7 +4679,7 @@
"(method 10 flow-control)": [["_stack_", 32, "flow-section"]],
"(method 9 lod-set)": [["_stack_", 16, "res-tag"]],
"execute-math-engine": [[[15, 28], "v1", "process-drawable"]],
"(method 14 draw-control)": [[13, "v1", "process-drawable"]],
"(method 14 draw-control)": [[13, "v1", "process-drawable"], [[58, 64], "t9", "(function object object object none)"]],
"(method 17 process-drawable)": [[7, "v1", "collide-shape"]],
"(method 10 process-drawable)": [[32, "a0", "collide-shape"]],
"(code process-drawable-art-error)": [[[18, 50], "v1", "collide-shape"]],
@@ -4950,5 +4947,36 @@
[51, "s1", "collide-shape"],
[114, "v1", "connection"],
[115, "s1", "collide-shape"]
],
"(method 9 collide-cache)": [
//[[28, 56], "gp", "collide-shape-prim"],
[33, "gp", "collide-cache-prim"],
[35, "gp", "collide-shape-prim"],
[[50, 56], "gp", "collide-cache-prim"],
[36, "v1", "collide-shape-prim-sphere"],
[[4, 26], "gp", "collide-cache-tri"]
],
"col-rend-draw": [
[[161, 217], "s5", "collide-cache-prim"],
[164, "v1", "collide-shape-prim-sphere"],
[[14, 152], "s3", "collide-cache-tri"]
],
"effect-param->sound-spec": [
[178, "v1", "collide-shape-moving"]
],
"(method 10 effect-control)": [
[128, "v1", "collide-shape-moving"],
[183, "s3", "(pointer object)"],
[187, "s3", "basic"],
[340, "s3", "basic"],
[390, "s3", "basic"],
[462, "s3", "basic"],
[483, "s3", "basic"],
[[497, 575], "s3", "death-info"]
],
"(method 12 effect-control)": [
[99, "gp", "(pointer int8)"],
["_stack_", 112, "res-tag"]
]
}
+2 -2
View File
@@ -7,8 +7,8 @@
// if you want to filter to only some object names.
// it will make the decompiler much faster.
"allowed_objects": ["editable-player"],
"banned_objects": ["effect-control", "ctywide-scenes", "texture-anim-tables", "traffic-engine"],
"allowed_objects": [],
"banned_objects": ["ctywide-scenes", "texture-anim-tables", "traffic-engine"],
////////////////////////////
// CODE ANALYSIS OPTIONS
+2
View File
@@ -212,6 +212,8 @@ std::optional<TP_Type> try_get_type_of_atom(const types2::TypeState& type_state,
case SimpleAtom::Kind::INTEGER_CONSTANT: {
return TP_Type::make_from_integer(atom.get_int());
} break;
case SimpleAtom::Kind::STATIC_ADDRESS:
return try_get_type_of_label(atom.label(), env);
default:
ASSERT_MSG(false,
fmt::format("unknown kind in try_get_type_of_atom: {}", atom.to_string(env)));
@@ -107,6 +107,11 @@ void OpenGLRenderer::init_bucket_renderers_jak2() {
init_bucket_renderer<Tie3>("tie-l1-tfrag", BucketCategory::TIE, BucketId::TIE_L1_TFRAG, 1);
// 30
// 40
init_bucket_renderer<TextureUploadHandler>("tex-l3-tfrag", BucketCategory::TEX,
BucketId::TEX_L3_TFRAG);
init_bucket_renderer<TFragment>("tfrag-l3-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L3_TFRAG,
std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 3);
init_bucket_renderer<Tie3>("tie-l3-tfrag", BucketCategory::TIE, BucketId::TIE_L3_TFRAG, 3);
// 50
// 60
// 70
@@ -119,6 +124,9 @@ void OpenGLRenderer::init_bucket_renderers_jak2() {
init_bucket_renderer<Shrub>("shrub-l1-shrub", BucketCategory::SHRUB, BucketId::SHRUB_L1_SHRUB);
// 90
// 100
init_bucket_renderer<TextureUploadHandler>("tex-l3-shrub", BucketCategory::TEX,
BucketId::TEX_L3_SHRUB);
init_bucket_renderer<Shrub>("shrub-l3-shrub", BucketCategory::SHRUB, BucketId::SHRUB_L3_SHRUB);
// 110
// 120
init_bucket_renderer<TextureUploadHandler>("tex-l0-alpha", BucketCategory::TEX,
@@ -143,6 +151,8 @@ void OpenGLRenderer::init_bucket_renderers_jak2() {
// 200
init_bucket_renderer<TextureUploadHandler>("tex-l2-pris", BucketCategory::TEX,
BucketId::TEX_L2_PRIS);
init_bucket_renderer<TextureUploadHandler>("tex-l3-pris", BucketCategory::TEX,
BucketId::TEX_L3_PRIS);
// 210
// 220
init_bucket_renderer<TextureUploadHandler>("tex-lcom-pris", BucketCategory::TEX,
+6
View File
@@ -90,16 +90,22 @@ enum class BucketId {
TEX_L1_TFRAG = 18,
TFRAG_L1_TFRAG = 19,
TIE_L1_TFRAG = 20,
TEX_L3_TFRAG = 40,
TFRAG_L3_TFRAG = 41,
TIE_L3_TFRAG = 42,
TEX_L0_SHRUB = 73,
SHRUB_L0_SHRUB = 74,
TEX_L1_SHRUB = 82,
SHRUB_L1_SHRUB = 83,
TEX_L3_SHRUB = 100,
SHRUB_L3_SHRUB = 101,
TEX_L0_ALPHA = 127,
TFRAG_T_L0_ALPHA = 128,
TEX_LCOM_TFRAG = 187,
TEX_LCOM_SHRUB = 191,
TEX_L0_PRIS = 196,
TEX_L2_PRIS = 204,
TEX_L3_PRIS = 208,
TEX_LCOM_PRIS = 220,
TEX_L0_WATER = 252,
TFRAG_W_L0_WATER = 255,
+1
View File
@@ -289,6 +289,7 @@
("collide-reaction-target.o" "collide-reaction-target")
("logic-target.o" "logic-target")
("sidekick.o" "sidekick")
("effect-control.o" "effect-control")
("voicebox.o" "voicebox")
("collectables-part.o" "collectables-part")
("debug-part.o" "debug-part")
+1
View File
@@ -289,6 +289,7 @@
("collide-reaction-target.o" "collide-reaction-target")
("logic-target.o" "logic-target")
("sidekick.o" "sidekick")
("effect-control.o" "effect-control")
("voicebox.o" "voicebox")
("collectables-part.o" "collectables-part")
("debug-part.o" "debug-part")
@@ -7,3 +7,314 @@
;; DECOMP BEGINS
(declare-file (debug))
(when *debug-segment*
;; definition for method 9 of type collide-cache
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw collide-cache ((obj collide-cache))
(let ((gp-0 (the-as object (-> obj tris))))
(countdown (s4-0 (-> obj num-tris))
(let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-cache-tri gp-0) pat mode) color) a 64)))
(add-debug-flat-triangle
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> (the-as collide-cache-tri gp-0) vertex))
(-> (the-as collide-cache-tri gp-0) vertex 1)
(-> (the-as collide-cache-tri gp-0) vertex 2)
t1-0
)
)
(set! gp-0 (&+ (the-as collide-cache-tri gp-0) 64))
)
)
(let ((gp-1 (the-as object (-> obj prims))))
(countdown (s5-1 (-> obj num-prims))
(when (= (-> (the-as collide-cache-prim gp-1) prim-core prim-type) (prim-type sphere))
(let ((t0-1
(copy-and-set-field
(-> *pat-mode-info*
(-> (the-as collide-shape-prim-sphere (-> (the-as collide-shape-prim gp-1) prim-core action)) pat mode)
color
)
a
64
)
)
)
(add-debug-sphere
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> (the-as collide-cache-prim gp-1) prim-core))
(-> (the-as collide-cache-prim gp-1) prim-core world-sphere w)
t0-1
)
)
)
(set! gp-1 (&+ (the-as collide-cache-prim gp-1) 48))
)
)
(print-collide-cache-tri-count)
0
(none)
)
;; definition of type col-rend-filter
(deftype col-rend-filter (structure)
((show-pat-set pat-surface :offset-assert 0)
(show-pat-clear pat-surface :offset-assert 4)
(event-mask uint32 :offset-assert 8)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; definition for method 3 of type col-rend-filter
(defmethod inspect col-rend-filter ((obj col-rend-filter))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'col-rend-filter)
(format #t "~1Tshow-pat-set: ~D~%" (-> obj show-pat-set))
(format #t "~1Tshow-pat-clear: ~D~%" (-> obj show-pat-clear))
(format #t "~1Tevent-mask: ~D~%" (-> obj event-mask))
(label cfg-4)
obj
)
;; definition for function col-rend-draw
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defun col-rend-draw ((arg0 col-rend) (arg1 col-rend-filter))
(let ((s4-0 (new 'stack-no-clear 'matrix)))
(set! (-> s4-0 vector 0 quad) (-> (math-camera-matrix) vector 2 quad))
(vector-normalize! (the-as vector (-> s4-0 vector)) 1.0)
(let ((s3-1 (the-as collide-cache-tri (-> *collide-cache* tris))))
(countdown (s2-0 (-> *collide-cache* num-tris))
(vector-3pt-cross! (-> s4-0 vector 1) (the-as vector (-> s3-1 vertex)) (-> s3-1 vertex 1) (-> s3-1 vertex 2))
(vector-normalize! (-> s4-0 vector 1) 1.0)
(when (or (-> arg0 show-back-faces?) (>= 0.0 (vector-dot (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1))))
(let ((v1-9 (-> s3-1 pat)))
(cond
((and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-9 (-> arg1 show-pat-set)))
(or (zero? (-> arg1 show-pat-clear)) (zero? (logand v1-9 (-> arg1 show-pat-clear))))
(or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (-> v1-9 event))))
)
(let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-9 mode) color) a 64)))
(add-debug-flat-triangle
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> s3-1 vertex))
(-> s3-1 vertex 1)
(-> s3-1 vertex 2)
t1-0
)
)
(if (-> arg0 outline?)
(add-debug-outline-triangle
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> s3-1 vertex))
(-> s3-1 vertex 1)
(-> s3-1 vertex 2)
(new 'static 'rgba :r #x10 :g #x10 :b #x10 :a #x80)
)
)
(when (-> arg0 show-normals?)
(vector+! (-> s4-0 vector 2) (the-as vector (-> s3-1 vertex)) (-> s3-1 vertex 1))
(vector+! (-> s4-0 vector 2) (-> s4-0 vector 2) (-> s3-1 vertex 2))
(vector-float/! (-> s4-0 vector 2) (-> s4-0 vector 2) 3.0)
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s4-0 vector 2)
(-> s4-0 vector 1)
(meters 0.75)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
)
)
)
((-> arg0 ghost-hidden?)
(add-debug-flat-triangle
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> s3-1 vertex))
(-> s3-1 vertex 1)
(-> s3-1 vertex 2)
(new 'static 'rgba :r #x20 :g #x20 :b #x20 :a #x20)
)
(if (-> arg0 outline?)
(add-debug-outline-triangle
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> s3-1 vertex))
(-> s3-1 vertex 1)
(-> s3-1 vertex 2)
(new 'static 'rgba :r #x10 :g #x10 :b #x10 :a #x10)
)
)
)
)
)
)
(&+! s3-1 64)
)
)
)
(let ((s5-1 (the-as object (-> *collide-cache* prims))))
(countdown (s4-1 (-> *collide-cache* num-prims))
(when (= (-> (the-as collide-cache-prim s5-1) prim-core prim-type) (prim-type sphere))
(let ((v1-37 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s5-1) prim)) pat)))
(when (and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-37 (-> arg1 show-pat-set)))
(or (zero? (-> arg1 show-pat-clear)) (zero? (logand v1-37 (-> arg1 show-pat-clear))))
(or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (-> v1-37 event))))
)
(let ((t0-5 (copy-and-set-field (-> *pat-mode-info* (-> v1-37 mode) color) a 64)))
(add-debug-sphere
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> (the-as collide-cache-prim s5-1) prim-core))
(-> (the-as collide-cache-prim s5-1) prim-core world-sphere w)
t0-5
)
)
)
)
)
(set! s5-1 (&+ (the-as collide-cache-prim s5-1) 48))
)
)
(none)
)
;; definition for method 9 of type col-rend
;; INFO: Used lq/sq
(defmethod col-rend-method-9 col-rend ((obj col-rend))
(with-pp
(let ((s5-0 (new 'stack-no-clear 'collide-query)))
(let ((f30-0 (-> obj bbox-radius)))
(let ((v1-0 (-> obj track)))
(cond
((zero? v1-0)
(set! (-> obj bbox-center quad) (-> (target-pos 0) quad))
(+! (-> obj bbox-center y) (* 0.7 f30-0))
)
((= v1-0 1)
(position-in-front-of-camera! (-> obj bbox-center) (+ (-> obj camera-to-bbox-dist) (-> obj bbox-radius)) 0.0)
)
)
)
(set! (-> s5-0 bbox min quad) (-> obj bbox-center quad))
(set! (-> s5-0 bbox min x) (- (-> s5-0 bbox min x) f30-0))
(set! (-> s5-0 bbox min y) (- (-> s5-0 bbox min y) f30-0))
(set! (-> s5-0 bbox min z) (- (-> s5-0 bbox min z) f30-0))
(set! (-> s5-0 bbox max quad) (-> obj bbox-center quad))
(+! (-> s5-0 bbox max x) f30-0)
(+! (-> s5-0 bbox max y) f30-0)
(+! (-> s5-0 bbox max z) f30-0)
)
(let ((v1-9 -1))
(let ((a0-9 (-> obj cspec)))
(if (not (logtest? a0-9 (collide-spec crate)))
(set! v1-9 (logxor v1-9 1))
)
(if (not (logtest? a0-9 (collide-spec civilian)))
(set! v1-9 (logxor v1-9 64))
)
(if (not (logtest? a0-9 (collide-spec enemy)))
(set! v1-9 (logxor #x80000 v1-9))
)
(if (not (logtest? a0-9 (collide-spec obstacle)))
(set! v1-9 (logxor v1-9 2))
)
(if (not (logtest? a0-9 (collide-spec vehicle-sphere)))
(set! v1-9 (logand #x80743 v1-9))
)
)
(set! (-> s5-0 collide-with) (the-as collide-spec v1-9))
)
(set! (-> s5-0 ignore-pat) (new 'static 'pat-surface))
(set! (-> s5-0 ignore-process0) #f)
(set! (-> s5-0 ignore-process1) #f)
(add-debug-box
#t
(bucket-id debug2)
(the-as vector (-> s5-0 bbox))
(-> s5-0 bbox max)
(if (logtest? (-> pp clock frame-counter) 128)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x20)
(new 'static 'rgba :a #x20)
)
)
(fill-using-bounding-box *collide-cache* s5-0)
)
(let ((s5-1 (-> obj show-only))
(a1-17 (new 'stack 'col-rend-filter))
)
(when (nonzero? s5-1)
(cond
((logtest? s5-1 8)
(set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :noboard #x1))
)
((logtest? s5-1 16)
(set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :nogrind #x1))
)
((logtest? s5-1 32)
(set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :nogrind #x1))
(set! (-> a1-17 show-pat-set) (new 'static 'pat-surface :nojak #x1))
)
(else
(if (logtest? s5-1 8192)
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :nolineofsight #x1) (-> a1-17 show-pat-set)))
)
(if (logtest? s5-1 1024)
(set! (-> a1-17 show-pat-set noentity) 1)
)
(if (logtest? s5-1 64)
(set! (-> a1-17 show-pat-set noboard) 1)
)
(if (logtest? s5-1 2048)
(set! (-> a1-17 show-pat-set nogrind) 1)
)
(if (logtest? s5-1 128)
(set! (-> a1-17 show-pat-set nocamera) 1)
)
(if (logtest? s5-1 4096)
(set! (-> a1-17 show-pat-set nojak) 1)
)
(if (logtest? s5-1 256)
(set! (-> a1-17 show-pat-set noedge) 1)
)
(if (logtest? s5-1 #x8000)
(set! (-> a1-17 show-pat-set nopilot) 1)
)
(if (logtest? s5-1 512)
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> a1-17 show-pat-set)))
)
(if (logtest? s5-1 #x4000)
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :nomech #x1) (-> a1-17 show-pat-set)))
)
(if (logtest? #x10000 s5-1)
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :noproj #x1) (-> a1-17 show-pat-set)))
)
(if (logtest? #x40000 s5-1)
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :probe #x1) (-> a1-17 show-pat-set)))
)
(if (logtest? #x20000 s5-1)
(logior! (-> a1-17 event-mask) 64)
)
)
)
)
(col-rend-draw obj a1-17)
)
(none)
)
)
)
@@ -170,7 +170,7 @@
(find-grabbable-tris (_type_) none 17)
(should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 18)
(find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol 19)
(check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) none 20)
(check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol 20)
)
)
@@ -160,7 +160,7 @@
)
(let ((f0-1 (get-best-hand-point obj (-> arg1 right-hand-hold) s0-0 (the-as int s4-0))))
(if (< 491.52 f0-1)
(return #f)
(return (the-as symbol #f))
)
)
(set! sv-672 s0-0)
@@ -178,7 +178,7 @@
(.svf (&-> sv-672 quad) vf6)
(let ((f0-3 (get-best-hand-point obj (-> arg1 left-hand-hold) s0-0 (the-as int s4-0))))
(if (< 491.52 f0-3)
(return #f)
(return (the-as symbol #f))
)
)
)
@@ -228,7 +228,7 @@
(set! (-> v1-28 action-mask) (collide-action solid))
)
(if (probe-using-spheres (-> obj ccache) a1-12)
(return #f)
(return (the-as symbol #f))
)
)
(set! (-> arg1 status) (the-as uint 0))
@@ -260,8 +260,7 @@
)
)
)
0
(none)
(the-as symbol 0)
)
)
@@ -105,7 +105,7 @@
(do-joint-math (-> self draw) (-> self node-list) (-> self skel))
(let ((a0-22 (-> self skel effect)))
(if a0-22
(effect-control-method-9 a0-22)
(update-effects a0-22)
)
)
(if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid))
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -1624,9 +1624,9 @@
(set! (-> arg0 flags) (water-flags))
(set! (-> arg0 handle) (the-as handle #f))
(set! (-> s3-0 extra-flags) (the-as uint 0))
(set! (-> (the-as region-prim-area #x70000000) region-prim-list num-items) 0)
(set! (-> (the-as region-prim-area #x70000000) region-inside-count) 0)
(set! (-> (the-as region-prim-area #x70000000) pos quad) (-> obj root-prim prim-core world-sphere quad))
(set! (-> (scratchpad-object region-prim-area) region-prim-list num-items) 0)
(set! (-> (scratchpad-object region-prim-area) region-inside-count) 0)
(set! (-> (scratchpad-object region-prim-area) pos quad) (-> obj root-prim prim-core world-sphere quad))
(dotimes (s2-0 (-> *level* length))
(let ((v1-8 (-> *level* level s2-0)))
(when (= (-> v1-8 status) 'active)
@@ -1639,9 +1639,9 @@
(if (= (-> a0-10 name) 'water)
(collect-regions
a0-10
(the-as sphere (-> (the-as region-prim-area #x70000000) pos))
(the-as sphere (-> (scratchpad-object region-prim-area) pos))
0
(-> (the-as region-prim-area #x70000000) region-prim-list)
(-> (scratchpad-object region-prim-area) region-prim-list)
)
)
(set! sv-80 (+ sv-80 1))
@@ -1654,8 +1654,8 @@
)
)
)
(countdown (s2-1 (-> (the-as region-prim-area #x70000000) region-prim-list num-items))
(water-info<-region s3-0 (-> (the-as region-prim-area #x70000000) region-prim-list items s2-1) obj arg1)
(countdown (s2-1 (-> (scratchpad-object region-prim-area) region-prim-list num-items))
(water-info<-region s3-0 (-> (scratchpad-object region-prim-area) region-prim-list items s2-1) obj arg1)
(when (and (logtest? (-> s3-0 flags) (water-flags active))
(logtest? (water-flags touch-water) (-> s3-0 flags))
(zero? (logand (-> s3-0 extra-flags) 1))
+15
View File
@@ -274,6 +274,21 @@
(defun find-instance-by-name ((a0-0 string))
(the prototype-bucket #f))
(defun main-debug-hook ()
(when (not (or (= *master-mode* 'menu) (= *master-mode* 'progress)))
(let ((a0-3 *col-rend*))
(if (-> a0-3 draw?)
(col-rend-method-9 a0-3)
)
)
(execute-connections *debug-engine* #f)
;(draw-instance-info *stdcon*)
)
(none)
)
(define *debug-hook* (cons main-debug-hook '()))
(defun real-main-draw-hook ()
(local-vars (a0-96 int) (a0-98 int))
(with-pp
+11 -11
View File
@@ -45,26 +45,26 @@
;; DECOMP BEGINS
(deftype effect-control (basic)
((process process-drawable :offset-assert 4)
(flags effect-control-flag :offset-assert 8)
(last-frame-group art-joint-anim :offset-assert 12)
(last-frame-num float :offset-assert 16)
(channel-offset int32 :offset-assert 20)
(res res-lump :offset-assert 24)
(name (pointer res-tag) :offset-assert 28)
(param uint32 :offset-assert 32)
((process process-drawable :offset-assert 4)
(flags effect-control-flag :offset-assert 8)
(last-frame-group art-joint-anim :offset-assert 12)
(last-frame-num float :offset-assert 16)
(channel-offset int32 :offset-assert 20)
(res res-lump :offset-assert 24)
(name (pointer res-tag) :offset-assert 28)
(param uint32 :offset-assert 32)
)
:method-count-assert 15
:size-assert #x24
:flag-assert #xf00000024
(:methods
(new (symbol type process-drawable) _type_ 0)
(effect-control-method-9 (_type_) none 9)
(update-effects (_type_) none 9)
(do-effect (_type_ symbol float int) none 10)
(effect-control-method-11 () none 11)
(do-effect-for-surface (_type_ symbol float int basic pat-surface) none 11)
(play-effect-sound (_type_ symbol float int basic sound-name) int 12)
(set-channel-offset! (_type_ int) none 13)
(effect-control-method-14 () none 14)
(play-effects-from-res-lump (_type_ float float float) none 14)
)
)
File diff suppressed because it is too large Load Diff
+83 -12
View File
@@ -279,28 +279,99 @@
)
)
(defenum collide-spec
:bitfield #t
:type uint32
(backgnd 0) ;; 1
(jak 1) ;; 2
(bot 2) ;; 4
(crate 3) ;; 8
(civilian 4) ;; 16
(enemy 5) ;; 32
(obstacle 6) ;; 64
(vehicle-sphere 7) ;; 128
(hit-by-player-list 8) ;; 256
(hit-by-others-list 9) ;; 512
(player-list 10) ;; 1024
(water 11) ;; 2048
(collectable 12) ;; 4096
(blocking-plane 13) ;; 8192
(projectile 14) ;; 16384
(jak-vulnerable 15) ;; 32768
(camera-blocker 16) ;; hi 1
(notice-blue-eco-powerup 17) ;; hi 2
(tobot 18) ;; hi 4
(pusher 19) ;; hi 8
(vehicle-mesh 20) ;; hi 16
(bot-targetable 21) ;; hi 32
(jak-vehicle 22) ;; hi 64
(special-obstacle 23) ;; hi 128
(mech-punch 24) ;; hi 256
(obstacle-for-jak 25) ;; hi 512
(vehicle-mesh-probeable 26) ;; hi 1024
(unknown-27 27)
(unknown-28 28)
(unknown-29 29)
(unknown-30 30)
(unknown-31 31)
(unknown-32 32)
(unknown-33 33)
(unknown-34 34)
(unknown-35 35)
(unknown-36 36)
(unknown-37 37)
(unknown-38 38)
(unknown-39 39)
(unknown-40 40)
(unknown-41 41)
(unknown-42 42)
(unknown-43 43)
(unknown-44 44)
(unknown-45 45)
(unknown-46 46)
(unknown-47 47)
(unknown-48 48)
(unknown-49 49)
(unknown-50 50)
(unknown-51 51)
(unknown-52 52)
(unknown-53 53)
(unknown-54 54)
(unknown-55 55)
(unknown-56 56)
(unknown-57 57)
(unknown-58 58)
(unknown-59 59)
(unknown-60 60)
(unknown-61 61)
(unknown-62 62)
(unknown-63 63)
)
;; collision renderer settings.
(deftype col-rend (basic)
((draw? symbol :offset-assert 4)
(outline? symbol :offset-assert 8)
(show-back-faces? symbol :offset-assert 12)
(show-normals? symbol :offset-assert 16)
(ghost-hidden? symbol :offset-assert 20)
(show-only uint32 :offset-assert 24)
(cspec uint32 :offset-assert 28)
(track uint8 :offset-assert 32)
(bbox-radius float :offset-assert 36)
(bbox-center vector :inline :offset-assert 48)
(camera-to-bbox-dist float :offset-assert 64)
((draw? symbol :offset-assert 4)
(outline? symbol :offset-assert 8)
(show-back-faces? symbol :offset-assert 12)
(show-normals? symbol :offset-assert 16)
(ghost-hidden? symbol :offset-assert 20)
(show-only uint32 :offset-assert 24)
(cspec collide-spec :offset-assert 28)
(track uint8 :offset-assert 32)
(bbox-radius float :offset-assert 36)
(bbox-center vector :inline :offset-assert 48)
(camera-to-bbox-dist float :offset-assert 64)
)
:method-count-assert 10
:size-assert #x44
:flag-assert #xa00000044
(:methods
(col-rend-method-9 () none 9)
(col-rend-method-9 (_type_) none 9)
)
)
(define *col-rend* (new 'static 'col-rend
:draw? #f
:outline? #t
+1 -2
View File
@@ -898,8 +898,7 @@
)
(defmethod apply-settings setting-control ((obj setting-control))
;; (speech-control-method-11 *speech-control*)
(format #t "skip *speech-control* method 11 in apply-settings~%")
(speech-control-method-11 *speech-control*)
(let ((s5-0 (-> obj user-current)))
(let ((s4-0 (-> obj user-target)))
(mem-copy! (the-as pointer s4-0) (the-as pointer (-> obj user-default)) 528)
+1 -1
View File
@@ -16,6 +16,6 @@
)
(defun merc-eye-anim ((arg0 process-drawable))
(format *stdcon* "no eyes for you ~A~%" arg0)
;; (format *stdcon* "no eyes for you ~A~%" arg0)
(none)
)
@@ -8,6 +8,6 @@
;; DECOMP BEGINS
(defun merc-blend-shape ((obj process-drawable))
(format *stdcon* "no mbs for you ~A~%" obj)
;; (format *stdcon* "no mbs for you ~A~%" obj)
(the object #f)
)
@@ -795,7 +795,6 @@
;; WARN: Return type mismatch object vs sparticle-launch-control.
(defmethod create-launch-control sparticle-launch-group ((obj sparticle-launch-group) (arg0 process))
(format 0 "create launch control: ~A ~D~%" arg0 (-> obj length))
(let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> obj length)))))
(when (zero? (the-as sparticle-launch-control gp-0))
(go process-drawable-art-error "memory")
+6 -9
View File
@@ -2222,10 +2222,9 @@
)
(start-debug "PLAY: starting dproc~%")
(on #t)
(format 0 "SKIP: initialize game info~%")
; (if arg1
; (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f))
; )
(if arg1
(initialize! *game-info* 'game (the-as game-save #f) (the-as string #f))
)
(kmemclose)
(kmemclose)
0
@@ -2664,10 +2663,10 @@
(local-vars (v1-101 symbol))
(camera-pos)
(new 'static 'boxed-array :type symbol :length 0 :allocated-length 6)
;; (update *setting-control*)
(update *setting-control*)
;; (update *gui-control* #t)
;; (update *art-control* #t)
;; (clear-rec *art-control*)
(update *art-control* #t)
(clear-rec *art-control*)
(dotimes (s5-0 6)
(load-continue (-> obj level s5-0))
)
@@ -2683,7 +2682,6 @@
)
(update! *load-state*)
#|
(dotimes (s5-2 (-> obj length))
(let ((s4-1 (-> obj level s5-2)))
(when (= (-> s4-1 status) 'active)
@@ -2745,7 +2743,6 @@
)
)
)
|#
(dotimes (v1-88 (-> obj length))
(let ((a0-48 (-> obj level v1-88)))
(when (= (-> a0-48 status) 'active)
@@ -407,16 +407,11 @@
)
(dotimes (s1-1 1)
(let* ((v1-20 (-> arg0 data s1-1))
(t9-3 (-> v1-20 param0))
(t9-3 (the-as function (-> v1-20 param0)))
)
(when t9-3
(let ((a0-9 v1-20)
(a1-5 (-> v1-20 param1))
)
(-> v1-20 param2)
(t9-3 a0-9 (the-as matrix a1-5))
(if (the-as (function cspace matrix none) t9-3)
((the-as (function object object object none) t9-3) v1-20 (-> v1-20 param1) (-> v1-20 param2))
)
)
)
)
(dotimes (s1-2 2)
@@ -1314,8 +1309,7 @@
(label cfg-45)
(let ((a0-26 (-> gp-0 effect)))
(if a0-26
(format 0 "skip effect control~%")
;(effect-control-method-9 a0-26)
(update-effects a0-26)
)
)
)
+7 -1
View File
@@ -5,6 +5,9 @@
;; name in dgo: gsound-h
;; dgos: ENGINE, GAME
(declare-type process-drawable process)
(declare-type process-focusable process-drawable)
(defenum sound-command
:type uint16
(iop-store 0) ;; sound-rpc-bank-cmd
@@ -88,6 +91,9 @@
(sm-unk1)
(sm-unk2)
(reg0)
(reg1)
(reg2)
(unk)
)
(defenum stream-status
@@ -179,7 +185,7 @@
;; ghost function
(define-extern *debug-effect-control* symbol)
(declare-type sound-spec basic)
(define-extern effect-param->sound-spec (function sound-spec (pointer float) int sound-spec))
(define-extern effect-param->sound-spec (function sound-spec (pointer float) int process-focusable sound-spec))
;; DECOMP BEGINS
+5 -9
View File
@@ -691,13 +691,9 @@
(set! (-> s5-1 sound-name) (-> obj name))
(set! (-> s5-1 fo-max) (-> obj falloff-far))
(set! (-> s5-1 mask) (sound-mask))
(when (-> obj params)
;; ADDED - the function after this has been removed in jak 2, and calling it will crash.
(format 0 "bad case in update! ambient-sound~%")
(return (the-as int #f))
pp
(effect-param->sound-spec s5-1 (-> obj params) (-> obj param-count))
)
(if (-> obj params)
(effect-param->sound-spec s5-1 (-> obj params) (-> obj param-count) (the-as process-focusable pp))
)
)
(let ((v1-23 (-> s5-1 fo-max)))
(if (and (nonzero? v1-23) (< (* 4096.0 (the float v1-23)) (vector-vector-distance (ear-trans 0) (-> obj trans))))
@@ -734,7 +730,7 @@
(-> obj pitch)
0
(sound-group sfx)
(the-as symbol (-> obj trans))
(-> obj trans)
)
)
)
@@ -748,7 +744,7 @@
(-> obj pitch)
0
(sound-group sfx)
(the-as symbol (-> obj trans))
(-> obj trans)
)
)
(set! (-> obj play-time)
+9 -7
View File
@@ -10,22 +10,24 @@
;; DECOMP BEGINS
(defskelgroup skel-sidekick daxter daxter-lod0-jg -1
((daxter-lod0-mg (meters 999999)))
;; failed to figure out what this is:
(defskelgroup skel-sidekick daxter 0 -1
((1 (meters 999999)))
:bounds (static-spherem 0 0 0 3)
:longest-edge (meters 1)
:shadow daxter-shadow-mg
:shadow 3
:texture-level 6
:sort 1
:origin-joint-index 6
:shadow-joint-index 6
)
(defskelgroup skel-sidekick-highres daxter-highres daxter-highres-lod0-jg -1
((daxter-highres-lod0-mg (meters 999999)))
;; failed to figure out what this is:
(defskelgroup skel-sidekick-highres daxter-highres 0 -1
((1 (meters 999999)))
:bounds (static-spherem 0 0 0 3)
:longest-edge (meters 1)
:shadow daxter-highres-shadow-mg
:shadow 2
:sort 1
:origin-joint-index 6
:shadow-joint-index 6
@@ -447,7 +449,7 @@
)
(let ((a0-53 (-> self skel effect)))
(if a0-53
(effect-control-method-9 a0-53)
(update-effects a0-53)
)
)
(if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid))
+39 -33
View File
@@ -103,19 +103,23 @@
(none)
)
(defbehavior target-darkjak-process target ((arg0 object) (arg1 object) (arg2 object) (arg3 object) (arg4 object) (arg5 object) (arg6 float))
(local-vars (gp-0 vector))
;; definition for function target-darkjak-process
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; ERROR: Function may read a register that is not set: t2
(defbehavior target-darkjak-process target ()
(local-vars (t2-0 none) (gp-0 vector))
(cond
((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))
(let ((a1-1 'eco-red))
(target-danger-set! (-> self control danger-mode) a1-1)
(let ((a1-0 'eco-red))
(target-danger-set! (-> self control danger-mode) a1-0)
)
(update-transforms (-> self control))
(let ((a1-2 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a1-2 options) (overlaps-others-options))
(set! (-> a1-2 collide-with-filter) (the-as collide-spec -1))
(set! (-> a1-2 tlist) *touching-list*)
(find-overlapping-shapes (-> self control) a1-2)
(let ((a1-1 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a1-1 options) (overlaps-others-options))
(set! (-> a1-1 collide-with-filter) (the-as collide-spec -1))
(set! (-> a1-1 tlist) *touching-list*)
(find-overlapping-shapes (-> self control) a1-1)
)
(target-danger-set! (-> self control danger-mode) #f)
(update-transforms (-> self control))
@@ -143,12 +147,12 @@
(f26-0 (lerp-scale 1.0 (* 0.20000002 (+ 5.0 (-> self darkjak-giant-interp))) f30-0 0.0 1.0))
)
(set-vector! (-> self control scale) f28-0 f28-0 f28-0 1.0)
(let ((a3-3 (new 'stack-no-clear 'vector)))
(set! (-> a3-3 x) f26-0)
(set! (-> a3-3 y) 1.0)
(set! (-> a3-3 z) f26-0)
(set! (-> a3-3 w) 1.0)
(trs-set! (-> self upper-body) (the-as vector #f) (the-as quaternion #f) a3-3)
(let ((a3-2 (new 'stack-no-clear 'vector)))
(set! (-> a3-2 x) f26-0)
(set! (-> a3-2 y) 1.0)
(set! (-> a3-2 z) f26-0)
(set! (-> a3-2 w) 1.0)
(trs-set! (-> self upper-body) (the-as vector #f) (the-as quaternion #f) a3-2)
)
(let ((f26-1 (* 1.1 f26-0)))
(cond
@@ -185,19 +189,21 @@
)
)
(trs-set! (-> self neck) (the-as vector #f) (the-as quaternion #f) gp-0)
(let* ((a0-44 (-> self horns))
(t9-14 (method-of-object a0-44 trs-set!))
(a1-12 #f)
(a2-9 #f)
(a3-8 (new 'stack-no-clear 'vector))
(let* ((a0-43 (-> self horns))
(t9-14 (method-of-object a0-43 trs-set!))
(a1-11 #f)
(a2-8 #f)
(a3-7 (new 'stack-no-clear 'vector))
)
(set! (-> a3-8 x) f30-0)
(set! (-> a3-8 y) f30-0)
(set! (-> a3-8 z) f30-0)
(set! (-> a3-8 w) 1.0)
(t9-14 a0-44 (the-as vector a1-12) (the-as quaternion a2-9) a3-8)
(set! (-> a3-7 x) f30-0)
(set! (-> a3-7 y) f30-0)
(set! (-> a3-7 z) f30-0)
(set! (-> a3-7 w) 1.0)
(t9-14 a0-43 (the-as vector a1-11) (the-as quaternion a2-8) a3-7)
)
(when (nonzero? set-darkjak-texture-morph!)
(set-darkjak-texture-morph! f30-0)
)
(set-darkjak-texture-morph! f30-0)
(cond
((and (= f30-0 0.0) (< (- (-> self clock frame-counter) (-> self teleport-time)) (seconds 0.5)))
(set! (-> self skel override 0) 0.00001)
@@ -230,11 +236,11 @@
(s2-0 *launch-matrix*)
)
(set! (-> s2-0 trans quad) (-> (process-drawable-random-point! self (new 'stack-no-clear 'vector)) quad))
(let ((a3-9 #f)
(t0-6 #f)
(t1-1 1.0)
(let ((a3-8 #f)
(t0-5 #f)
(t1-0 1.0)
)
(gp-1 s5-0 s4-0 s2-0 (the-as sparticle-launch-state a3-9) (the-as sparticle-launch-control t0-6) t1-1)
(gp-1 s5-0 s4-0 s2-0 (the-as sparticle-launch-state a3-8) (the-as sparticle-launch-control t0-5) t1-0)
(cond
((rand-vu-percent? 0.25)
(when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.02))
@@ -244,9 +250,9 @@
(-> *lightning-spec-id-table* 8)
lightning-probe-callback
(-> *part-id-table* 179)
(the-as int t0-6)
(the-as int t1-1)
arg6
(the-as int t0-5)
(the-as int t1-0)
(the-as float t2-0)
)
)
)
+22
View File
@@ -504,6 +504,7 @@
"target/collide-reaction-target.gc"
"target/logic-target.gc"
"target/sidekick.gc"
"game/effect-control.gc"
"common_objs/voicebox.gc"
"common_objs/collectables-part.gc"
"debug/debug-part.gc"
@@ -837,6 +838,27 @@
"ctysluma-vis"
)
;;;;;;;;;;;;;;;;;;;;;
;; CITY INDUSTRIAL B
;;;;;;;;;;;;;;;;;;;;;
(cgo "CIB.DGO" "cib.gd")
(goal-src-sequence
"levels/city/industrial/"
:deps ("$OUT/obj/los-control.o")
"ctyindb-part.gc"
"ctyindb-obs.gc"
)
(copy-textures 1565 1577 1601 1614 1642)
(copy-gos
"com-airlock-outer-ag"
"ctyindb-vis"
)
;;;;;;;;;;;;;;;;;;;;;
;; VILLAGE 1
;;;;;;;;;;;;;;;;;;;;;
+314
View File
@@ -0,0 +1,314 @@
;;-*-Lisp-*-
(in-package goal)
;; this file is debug only
(declare-file (debug))
(when *debug-segment*
;; definition for method 9 of type collide-cache
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw collide-cache ((obj collide-cache))
(let ((gp-0 (the-as object (-> obj tris))))
(countdown (s4-0 (-> obj num-tris))
(let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-cache-tri gp-0) pat mode) color) a 64)))
(add-debug-flat-triangle
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> (the-as collide-cache-tri gp-0) vertex))
(-> (the-as collide-cache-tri gp-0) vertex 1)
(-> (the-as collide-cache-tri gp-0) vertex 2)
t1-0
)
)
(set! gp-0 (&+ (the-as collide-cache-tri gp-0) 64))
)
)
(let ((gp-1 (the-as object (-> obj prims))))
(countdown (s5-1 (-> obj num-prims))
(when (= (-> (the-as collide-cache-prim gp-1) prim-core prim-type) (prim-type sphere))
(let ((t0-1
(copy-and-set-field
(-> *pat-mode-info*
(-> (the-as collide-shape-prim-sphere (-> (the-as collide-shape-prim gp-1) prim-core action)) pat mode)
color
)
a
64
)
)
)
(add-debug-sphere
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> (the-as collide-cache-prim gp-1) prim-core))
(-> (the-as collide-cache-prim gp-1) prim-core world-sphere w)
t0-1
)
)
)
(set! gp-1 (&+ (the-as collide-cache-prim gp-1) 48))
)
)
(print-collide-cache-tri-count)
0
(none)
)
;; definition of type col-rend-filter
(deftype col-rend-filter (structure)
((show-pat-set pat-surface :offset-assert 0)
(show-pat-clear pat-surface :offset-assert 4)
(event-mask uint32 :offset-assert 8)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; definition for method 3 of type col-rend-filter
(defmethod inspect col-rend-filter ((obj col-rend-filter))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'col-rend-filter)
(format #t "~1Tshow-pat-set: ~D~%" (-> obj show-pat-set))
(format #t "~1Tshow-pat-clear: ~D~%" (-> obj show-pat-clear))
(format #t "~1Tevent-mask: ~D~%" (-> obj event-mask))
(label cfg-4)
obj
)
;; definition for function col-rend-draw
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defun col-rend-draw ((arg0 col-rend) (arg1 col-rend-filter))
(let ((s4-0 (new 'stack-no-clear 'matrix)))
(set! (-> s4-0 vector 0 quad) (-> (math-camera-matrix) vector 2 quad))
(vector-normalize! (the-as vector (-> s4-0 vector)) 1.0)
(let ((s3-1 (the-as collide-cache-tri (-> *collide-cache* tris))))
(countdown (s2-0 (-> *collide-cache* num-tris))
(vector-3pt-cross! (-> s4-0 vector 1) (the-as vector (-> s3-1 vertex)) (-> s3-1 vertex 1) (-> s3-1 vertex 2))
(vector-normalize! (-> s4-0 vector 1) 1.0)
(when (or (-> arg0 show-back-faces?) (>= 0.0 (vector-dot (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1))))
(let ((v1-9 (-> s3-1 pat)))
(cond
((and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-9 (-> arg1 show-pat-set)))
(or (zero? (-> arg1 show-pat-clear)) (zero? (logand v1-9 (-> arg1 show-pat-clear))))
(or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (-> v1-9 event))))
)
(let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-9 mode) color) a 64)))
(add-debug-flat-triangle
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> s3-1 vertex))
(-> s3-1 vertex 1)
(-> s3-1 vertex 2)
t1-0
)
)
(if (-> arg0 outline?)
(add-debug-outline-triangle
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> s3-1 vertex))
(-> s3-1 vertex 1)
(-> s3-1 vertex 2)
(new 'static 'rgba :r #x10 :g #x10 :b #x10 :a #x80)
)
)
(when (-> arg0 show-normals?)
(vector+! (-> s4-0 vector 2) (the-as vector (-> s3-1 vertex)) (-> s3-1 vertex 1))
(vector+! (-> s4-0 vector 2) (-> s4-0 vector 2) (-> s3-1 vertex 2))
(vector-float/! (-> s4-0 vector 2) (-> s4-0 vector 2) 3.0)
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s4-0 vector 2)
(-> s4-0 vector 1)
(meters 0.75)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
)
)
)
((-> arg0 ghost-hidden?)
(add-debug-flat-triangle
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> s3-1 vertex))
(-> s3-1 vertex 1)
(-> s3-1 vertex 2)
(new 'static 'rgba :r #x20 :g #x20 :b #x20 :a #x20)
)
(if (-> arg0 outline?)
(add-debug-outline-triangle
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> s3-1 vertex))
(-> s3-1 vertex 1)
(-> s3-1 vertex 2)
(new 'static 'rgba :r #x10 :g #x10 :b #x10 :a #x10)
)
)
)
)
)
)
(&+! s3-1 64)
)
)
)
(let ((s5-1 (the-as object (-> *collide-cache* prims))))
(countdown (s4-1 (-> *collide-cache* num-prims))
(when (= (-> (the-as collide-cache-prim s5-1) prim-core prim-type) (prim-type sphere))
(let ((v1-37 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s5-1) prim)) pat)))
(when (and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-37 (-> arg1 show-pat-set)))
(or (zero? (-> arg1 show-pat-clear)) (zero? (logand v1-37 (-> arg1 show-pat-clear))))
(or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (-> v1-37 event))))
)
(let ((t0-5 (copy-and-set-field (-> *pat-mode-info* (-> v1-37 mode) color) a 64)))
(add-debug-sphere
#t
(bucket-id debug-no-zbuf1)
(the-as vector (-> (the-as collide-cache-prim s5-1) prim-core))
(-> (the-as collide-cache-prim s5-1) prim-core world-sphere w)
t0-5
)
)
)
)
)
(set! s5-1 (&+ (the-as collide-cache-prim s5-1) 48))
)
)
(none)
)
;; definition for method 9 of type col-rend
;; INFO: Used lq/sq
(defmethod col-rend-method-9 col-rend ((obj col-rend))
(with-pp
(let ((s5-0 (new 'stack-no-clear 'collide-query)))
(let ((f30-0 (-> obj bbox-radius)))
(let ((v1-0 (-> obj track)))
(cond
((zero? v1-0)
(set! (-> obj bbox-center quad) (-> (target-pos 0) quad))
(+! (-> obj bbox-center y) (* 0.7 f30-0))
)
((= v1-0 1)
(position-in-front-of-camera! (-> obj bbox-center) (+ (-> obj camera-to-bbox-dist) (-> obj bbox-radius)) 0.0)
)
)
)
(set! (-> s5-0 bbox min quad) (-> obj bbox-center quad))
(set! (-> s5-0 bbox min x) (- (-> s5-0 bbox min x) f30-0))
(set! (-> s5-0 bbox min y) (- (-> s5-0 bbox min y) f30-0))
(set! (-> s5-0 bbox min z) (- (-> s5-0 bbox min z) f30-0))
(set! (-> s5-0 bbox max quad) (-> obj bbox-center quad))
(+! (-> s5-0 bbox max x) f30-0)
(+! (-> s5-0 bbox max y) f30-0)
(+! (-> s5-0 bbox max z) f30-0)
)
(let ((v1-9 -1))
(let ((a0-9 (-> obj cspec)))
(if (not (logtest? a0-9 (collide-spec crate)))
(set! v1-9 (logxor v1-9 1))
)
(if (not (logtest? a0-9 (collide-spec civilian)))
(set! v1-9 (logxor v1-9 64))
)
(if (not (logtest? a0-9 (collide-spec enemy)))
(set! v1-9 (logxor #x80000 v1-9))
)
(if (not (logtest? a0-9 (collide-spec obstacle)))
(set! v1-9 (logxor v1-9 2))
)
(if (not (logtest? a0-9 (collide-spec vehicle-sphere)))
(set! v1-9 (logand #x80743 v1-9))
)
)
(set! (-> s5-0 collide-with) (the-as collide-spec v1-9))
)
(set! (-> s5-0 ignore-pat) (new 'static 'pat-surface))
(set! (-> s5-0 ignore-process0) #f)
(set! (-> s5-0 ignore-process1) #f)
(add-debug-box
#t
(bucket-id debug2)
(the-as vector (-> s5-0 bbox))
(-> s5-0 bbox max)
(if (logtest? (-> pp clock frame-counter) 128)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x20)
(new 'static 'rgba :a #x20)
)
)
(fill-using-bounding-box *collide-cache* s5-0)
)
(let ((s5-1 (-> obj show-only))
(a1-17 (new 'stack 'col-rend-filter))
)
(when (nonzero? s5-1)
(cond
((logtest? s5-1 8)
(set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :noboard #x1))
)
((logtest? s5-1 16)
(set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :nogrind #x1))
)
((logtest? s5-1 32)
(set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :nogrind #x1))
(set! (-> a1-17 show-pat-set) (new 'static 'pat-surface :nojak #x1))
)
(else
(if (logtest? s5-1 8192)
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :nolineofsight #x1) (-> a1-17 show-pat-set)))
)
(if (logtest? s5-1 1024)
(set! (-> a1-17 show-pat-set noentity) 1)
)
(if (logtest? s5-1 64)
(set! (-> a1-17 show-pat-set noboard) 1)
)
(if (logtest? s5-1 2048)
(set! (-> a1-17 show-pat-set nogrind) 1)
)
(if (logtest? s5-1 128)
(set! (-> a1-17 show-pat-set nocamera) 1)
)
(if (logtest? s5-1 4096)
(set! (-> a1-17 show-pat-set nojak) 1)
)
(if (logtest? s5-1 256)
(set! (-> a1-17 show-pat-set noedge) 1)
)
(if (logtest? s5-1 #x8000)
(set! (-> a1-17 show-pat-set nopilot) 1)
)
(if (logtest? s5-1 512)
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> a1-17 show-pat-set)))
)
(if (logtest? s5-1 #x4000)
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :nomech #x1) (-> a1-17 show-pat-set)))
)
(if (logtest? #x10000 s5-1)
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :noproj #x1) (-> a1-17 show-pat-set)))
)
(if (logtest? #x40000 s5-1)
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :probe #x1) (-> a1-17 show-pat-set)))
)
(if (logtest? #x20000 s5-1)
(logior! (-> a1-17 event-mask) 64)
)
)
)
)
(col-rend-draw obj a1-17)
)
(none)
)
)
)
+1 -1
View File
@@ -290,7 +290,7 @@
(find-grabbable-tris (_type_) none 17)
(should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 18)
(find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol 19)
(check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) none 20)
(check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol 20)
)
)
+5 -7
View File
@@ -149,8 +149,7 @@
;; definition for method 20 of type collide-edge-work
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; WARN: Function (method 20 collide-edge-work) has a return type of none, but the expression builder found a return statement.
;; WARN: Return type mismatch int vs symbol.
(defmethod check-grab-for-collisions collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info))
(local-vars (sv-656 vector) (sv-672 vector))
(rlet ((acc :class vf)
@@ -183,7 +182,7 @@
)
(let ((f0-1 (get-best-hand-point obj (-> arg1 right-hand-hold) s0-0 (the-as int s4-0))))
(if (< 491.52 f0-1)
(return #f)
(return (the-as symbol #f))
)
)
(set! sv-672 s0-0)
@@ -201,7 +200,7 @@
(.svf (&-> sv-672 quad) vf6)
(let ((f0-3 (get-best-hand-point obj (-> arg1 left-hand-hold) s0-0 (the-as int s4-0))))
(if (< 491.52 f0-3)
(return #f)
(return (the-as symbol #f))
)
)
)
@@ -251,7 +250,7 @@
(set! (-> v1-28 action-mask) (collide-action solid))
)
(if (probe-using-spheres (-> obj ccache) a1-12)
(return #f)
(return (the-as symbol #f))
)
)
(set! (-> arg1 status) (the-as uint 0))
@@ -283,8 +282,7 @@
)
)
)
0
(none)
(the-as symbol 0)
)
)
+1 -1
View File
@@ -97,7 +97,7 @@
(do-joint-math (-> self draw) (-> self node-list) (-> self skel))
(let ((a0-22 (-> self skel effect)))
(if a0-22
(effect-control-method-9 a0-22)
(update-effects a0-22)
)
)
(if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid))
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -478,7 +478,7 @@
(defun dm-col-rend-cspec-toggle ((arg0 uint) (arg1 debug-menu-msg))
(let ((v1-0 *col-rend*))
(if (= arg1 (debug-menu-msg press))
(logxor! (-> v1-0 cspec) arg0)
(logxor! (-> v1-0 cspec) (the-as uint arg0))
)
(logtest? (-> v1-0 cspec) arg0)
)
+3 -3
View File
@@ -17,12 +17,12 @@
:flag-assert #xf00000024
(:methods
(new (symbol type process-drawable) _type_ 0)
(effect-control-method-9 (_type_) none 9)
(update-effects (_type_) none 9)
(do-effect (_type_ symbol float int) none 10)
(effect-control-method-11 () none 11)
(do-effect-for-surface (_type_ symbol float int basic pat-surface) none 11)
(play-effect-sound (_type_ symbol float int basic sound-name) int 12)
(set-channel-offset! (_type_ int) none 13)
(effect-control-method-14 () none 14)
(play-effects-from-res-lump (_type_ float float float) none 14)
)
)
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -406,23 +406,23 @@
;; definition of type col-rend
(deftype col-rend (basic)
((draw? symbol :offset-assert 4)
(outline? symbol :offset-assert 8)
(show-back-faces? symbol :offset-assert 12)
(show-normals? symbol :offset-assert 16)
(ghost-hidden? symbol :offset-assert 20)
(show-only uint32 :offset-assert 24)
(cspec uint32 :offset-assert 28)
(track uint8 :offset-assert 32)
(bbox-radius float :offset-assert 36)
(bbox-center vector :inline :offset-assert 48)
(camera-to-bbox-dist float :offset-assert 64)
((draw? symbol :offset-assert 4)
(outline? symbol :offset-assert 8)
(show-back-faces? symbol :offset-assert 12)
(show-normals? symbol :offset-assert 16)
(ghost-hidden? symbol :offset-assert 20)
(show-only uint32 :offset-assert 24)
(cspec collide-spec :offset-assert 28)
(track uint8 :offset-assert 32)
(bbox-radius float :offset-assert 36)
(bbox-center vector :inline :offset-assert 48)
(camera-to-bbox-dist float :offset-assert 64)
)
:method-count-assert 10
:size-assert #x44
:flag-assert #xa00000044
(:methods
(col-rend-method-9 () none 9)
(col-rend-method-9 (_type_) none 9)
)
)
@@ -455,7 +455,7 @@
:show-back-faces? #t
:show-normals? #f
:ghost-hidden? #t
:cspec #x38
:cspec (collide-spec crate civilian enemy)
:track #x1
:bbox-radius 24576.0
:camera-to-bbox-dist 65536.0
@@ -394,16 +394,11 @@
)
(dotimes (s1-1 1)
(let* ((v1-20 (-> arg0 data s1-1))
(t9-3 (-> v1-20 param0))
(t9-3 (the-as function (-> v1-20 param0)))
)
(when t9-3
(let ((a0-9 v1-20)
(a1-5 (-> v1-20 param1))
)
(-> v1-20 param2)
(t9-3 a0-9 (the-as matrix a1-5))
(if (the-as (function cspace matrix none) t9-3)
((the-as (function object object object none) t9-3) v1-20 (-> v1-20 param1) (-> v1-20 param2))
)
)
)
)
(dotimes (s1-2 2)
@@ -1339,7 +1334,7 @@
(label cfg-45)
(let ((a0-26 (-> gp-0 effect)))
(if a0-26
(effect-control-method-9 a0-26)
(update-effects a0-26)
)
)
)
+3 -4
View File
@@ -981,10 +981,9 @@
(set! (-> s5-1 sound-name) (-> obj name))
(set! (-> s5-1 fo-max) (-> obj falloff-far))
(set! (-> s5-1 mask) (sound-mask))
(when (-> obj params)
pp
(effect-param->sound-spec s5-1 (-> obj params) (-> obj param-count))
)
(if (-> obj params)
(effect-param->sound-spec s5-1 (-> obj params) (-> obj param-count) (the-as process-focusable pp))
)
)
(let ((v1-23 (-> s5-1 fo-max)))
(if (and (nonzero? v1-23) (< (* 4096.0 (the float v1-23)) (vector-vector-distance (ear-trans 0) (-> obj trans))))
+1 -1
View File
@@ -445,7 +445,7 @@
)
(let ((a0-53 (-> self skel effect)))
(if a0-53
(effect-control-method-9 a0-53)
(update-effects a0-53)
)
)
(if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid))
+33 -32
View File
@@ -100,19 +100,20 @@
;; definition for function target-darkjak-process
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defbehavior target-darkjak-process target ((arg0 object) (arg1 object) (arg2 object) (arg3 object) (arg4 object) (arg5 object) (arg6 float))
(local-vars (gp-0 vector))
;; ERROR: Function may read a register that is not set: t2
(defbehavior target-darkjak-process target ()
(local-vars (t2-0 none) (gp-0 vector))
(cond
((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))
(let ((a1-1 'eco-red))
(target-danger-set! (-> self control danger-mode) a1-1)
(let ((a1-0 'eco-red))
(target-danger-set! (-> self control danger-mode) a1-0)
)
(update-transforms (-> self control))
(let ((a1-2 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a1-2 options) (overlaps-others-options))
(set! (-> a1-2 collide-with-filter) (the-as collide-spec -1))
(set! (-> a1-2 tlist) *touching-list*)
(find-overlapping-shapes (-> self control) a1-2)
(let ((a1-1 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a1-1 options) (overlaps-others-options))
(set! (-> a1-1 collide-with-filter) (the-as collide-spec -1))
(set! (-> a1-1 tlist) *touching-list*)
(find-overlapping-shapes (-> self control) a1-1)
)
(target-danger-set! (-> self control danger-mode) #f)
(update-transforms (-> self control))
@@ -140,12 +141,12 @@
(f26-0 (lerp-scale 1.0 (* 0.20000002 (+ 5.0 (-> self darkjak-giant-interp))) f30-0 0.0 1.0))
)
(set-vector! (-> self control scale) f28-0 f28-0 f28-0 1.0)
(let ((a3-3 (new 'stack-no-clear 'vector)))
(set! (-> a3-3 x) f26-0)
(set! (-> a3-3 y) 1.0)
(set! (-> a3-3 z) f26-0)
(set! (-> a3-3 w) 1.0)
(trs-set! (-> self upper-body) (the-as vector #f) (the-as quaternion #f) a3-3)
(let ((a3-2 (new 'stack-no-clear 'vector)))
(set! (-> a3-2 x) f26-0)
(set! (-> a3-2 y) 1.0)
(set! (-> a3-2 z) f26-0)
(set! (-> a3-2 w) 1.0)
(trs-set! (-> self upper-body) (the-as vector #f) (the-as quaternion #f) a3-2)
)
(let ((f26-1 (* 1.1 f26-0)))
(cond
@@ -182,17 +183,17 @@
)
)
(trs-set! (-> self neck) (the-as vector #f) (the-as quaternion #f) gp-0)
(let* ((a0-44 (-> self horns))
(t9-14 (method-of-object a0-44 trs-set!))
(a1-12 #f)
(a2-9 #f)
(a3-8 (new 'stack-no-clear 'vector))
(let* ((a0-43 (-> self horns))
(t9-14 (method-of-object a0-43 trs-set!))
(a1-11 #f)
(a2-8 #f)
(a3-7 (new 'stack-no-clear 'vector))
)
(set! (-> a3-8 x) f30-0)
(set! (-> a3-8 y) f30-0)
(set! (-> a3-8 z) f30-0)
(set! (-> a3-8 w) 1.0)
(t9-14 a0-44 (the-as vector a1-12) (the-as quaternion a2-9) a3-8)
(set! (-> a3-7 x) f30-0)
(set! (-> a3-7 y) f30-0)
(set! (-> a3-7 z) f30-0)
(set! (-> a3-7 w) 1.0)
(t9-14 a0-43 (the-as vector a1-11) (the-as quaternion a2-8) a3-7)
)
(set-darkjak-texture-morph! f30-0)
(cond
@@ -227,11 +228,11 @@
(s2-0 *launch-matrix*)
)
(set! (-> s2-0 trans quad) (-> (process-drawable-random-point! self (new 'stack-no-clear 'vector)) quad))
(let ((a3-9 #f)
(t0-6 #f)
(t1-1 1.0)
(let ((a3-8 #f)
(t0-5 #f)
(t1-0 1.0)
)
(gp-1 s5-0 s4-0 s2-0 (the-as sparticle-launch-state a3-9) (the-as sparticle-launch-control t0-6) t1-1)
(gp-1 s5-0 s4-0 s2-0 (the-as sparticle-launch-state a3-8) (the-as sparticle-launch-control t0-5) t1-0)
(cond
((rand-vu-percent? 0.25)
(when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.02))
@@ -241,9 +242,9 @@
(-> *lightning-spec-id-table* 8)
lightning-probe-callback
(-> *part-id-table* 179)
(the-as int t0-6)
(the-as int t1-1)
arg6
(the-as int t0-5)
(the-as int t1-0)
(the-as float t2-0)
)
)
)