diff --git a/decompiler/IR2/AtomicOpTypeAnalysis.cpp b/decompiler/IR2/AtomicOpTypeAnalysis.cpp index c843bfbdee..2ee3aaec58 100644 --- a/decompiler/IR2/AtomicOpTypeAnalysis.cpp +++ b/decompiler/IR2/AtomicOpTypeAnalysis.cpp @@ -1434,8 +1434,8 @@ TypeState StackSpillLoadOp::propagate_types_internal(const TypeState& input, // stack slot load auto& info = env.stack_spills().lookup(m_offset); if (info.size != m_size) { - env.func->warnings.error("Stack slot load at {} mismatch: defined as size {}, got size {}", - m_offset, info.size, m_size); + env.func->warnings.warning("Stack slot load at {} mismatch: defined as size {}, got size {}", + m_offset, info.size, m_size); } if (info.is_signed != m_is_signed) { diff --git a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp index bec79dc107..2bb1006b93 100644 --- a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp +++ b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp @@ -609,7 +609,7 @@ void ObjectFileDB::ir2_register_usage_pass(int seg, ObjectFileData& data) { } lg::error("Bad register dependency on {} in {}", x.to_charp(), func.name()); - func.warnings.error("Function may read a register that is not set: {}", x.to_string()); + func.warnings.warning("Function may read a register that is not set: {}", x.to_string()); } } } diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 1ff15677ae..ed55caef67 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -5286,6 +5286,7 @@ (deftype mood-fog-table (structure) ((data mood-fog 8 :inline :offset-assert 0) + (data-raw uint128 24 :offset 0 :score -1) ) :method-count-assert 9 :size-assert #x180 @@ -5311,6 +5312,7 @@ (deftype mood-color-table (structure) ((data mood-color 8 :inline :offset-assert 0) + (data-raw uint128 16 :offset 0 :score -1) ) :method-count-assert 9 :size-assert #x100 @@ -5378,13 +5380,14 @@ :flag-assert #x900000080 ) +(declare-type sky-color-day structure) (deftype mood-table (basic) ((mood-fog-table mood-fog-table :offset-assert 4) (mood-color-table mood-color-table :offset-assert 8) (mood-channel-group mood-channel-group :offset-assert 12) (mood-direction-table mood-direction-table :offset-assert 16) (mood-sky-table mood-sky-table :offset-assert 20) - (mood-interp-table basic :offset-assert 24) + (mood-interp-table sky-color-day :offset-assert 24) ) :method-count-assert 9 :size-assert #x1c @@ -5420,9 +5423,11 @@ ) (deftype mood-context (mood-context-core3) + "`state` holds an arbitrary state structure, ie `[[sewer-states]]` and is used + when updating the mood. This means that an individual state structure must be less than 128 bytes" ((itimes vector4w 4 :inline :offset-assert 1776) - (state uint32 32 :offset-assert 1840) ;; arbitrary data - can be floats | symbols - (clear uint128 123 :offset 0) ;; added + (state uint32 32 :offset-assert 1840) + (data uint128 123 :offset 0 :score -1) ;; added ) :method-count-assert 9 :size-assert #x7b0 @@ -8162,6 +8167,7 @@ ;; game-task-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +++game-task-h:game-task (defenum game-task :type uint8 :bitfield #f @@ -8275,8 +8281,19 @@ (stadium-burning-bush-race-class3-r 107) (stadium-burning-bush-race-class2-r 108) (stadium-burning-bush-race-class1-r 109) - (max 110) - ) + (max 110)) +;; ---game-task-h:game-task + +;; +++game-task-h:game-task-node +(defenum game-task-node + :type uint32 + :bitfield #f + (dig-knock-down-resolution 113) + (tomb-boss-torches 167) + (fortress-save-friends-resolution 172) + (drill-mech-resolution 204) + (drill-mech-started-smashing 205)) +;; ---game-task-h:game-task-node (defenum game-task-actor :bitfield #f @@ -11851,7 +11868,7 @@ ;; Failed to read fields. (:methods (new (symbol type int) _type_ 0) - (gui-control-method-9 (_type_ process gui-channel gui-action int float time-frame) sound-id 9) + (gui-control-method-9 (_type_ process gui-channel gui-action string float time-frame) sound-id 9) (gui-control-method-10 (_type_ process gui-channel) none 10) (gui-control-method-11 (_type_ gui-connection) int 11) (gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id 12) @@ -13901,7 +13918,7 @@ ;; Failed to read fields. (:methods (new (symbol type basic process vector) _type_ 0) - (script-context-method-9 () none 9) + (eval! (_type_ structure) pair 9) (script-context-method-10 () none 10) (script-context-method-11 () none 11) ) @@ -14821,7 +14838,7 @@ (deftype collide-prim-core (structure) ((world-sphere vector :inline :offset-assert 0) (collide-as collide-spec :offset-assert 16) ;; guessed by decompiler - (collide-with uint32 :offset-assert 20) + (collide-with collide-spec :offset-assert 20) (action collide-action :offset-assert 24) ;; guessed by decompiler (prim-type prim-type :offset-assert 28) (unused1 uint8 3 :offset-assert 29) @@ -16539,7 +16556,7 @@ (texture-flags texture-page-flag 10 :offset 130) ;; 0 (maybe padding) 150 ;; 0 (was boxes, current back flags?, byte?) 152 - ;; #t (was ambients?) 156 + (ambients symbol :offset 156) ;; now just #t? (subdivide-close float :offset 160) (subdivide-far float :offset-assert 164) (race-meshes (array entity-race-mesh) :offset-assert 168) @@ -23335,7 +23352,7 @@ ((value float :offset-assert 0) (scale float :offset-assert 4) ) - :pack-me + :allow-misaligned :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 @@ -23344,7 +23361,7 @@ (deftype pulse-state (structure) ((pulse float :offset-assert 0) ) - :pack-me + :allow-misaligned :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 @@ -23353,6 +23370,7 @@ (deftype strobe-state (structure) ((time float :offset-assert 0) ) + :pack-me :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 @@ -23365,9 +23383,9 @@ (define-extern update-mood-exterior (function mood-context-core3 mood-table float int object)) ;; TODO - so many potential return values... (define-extern copy-mood-exterior (function mood-context symbol)) (define-extern copy-mood-exterior-ambi (function mood-context symbol none)) -(define-extern clear-mood-context (function mood-context none)) -;; (define-extern update-mood-interior function) -(define-extern update-mood-flames (function mood-context int int int float float float float :behavior process)) +(define-extern clear-mood-context (function mood-context symbol)) +(define-extern update-mood-interior (function mood-context float)) +(define-extern update-mood-flames (function mood-context int int int float float float float :behavior time-of-day-proc)) (define-extern *flash0* (array float)) (define-extern *flash1* (array float)) (define-extern *flash2* (array float)) @@ -23376,13 +23394,13 @@ (define-extern *flash5* (array float)) (define-extern *flash6* (array float)) (define-extern *flash7* (array float)) -(define-extern update-mood-light (function mood-context int int int float float float int none)) -;; (define-extern update-mood-lava function) ;; (function mood-context int int symbol none) -;; (define-extern update-mood-flicker function) -;; (define-extern update-mood-florescent function) -(define-extern update-mood-electricity (function mood-context int int int float float float int none)) -(define-extern update-mood-pulse (function mood-context int int int float float float int none)) -;; (define-extern update-mood-strobe function) +(define-extern update-mood-light (function mood-context int int float float float float float float)) +(define-extern update-mood-lava "Unused" (function mood-context int int float float float float float float)) ;; +(define-extern update-mood-flicker "Unused" (function mood-context int int none)) +(define-extern update-mood-florescent "Unused" (function mood-context int int float)) +(define-extern update-mood-electricity (function mood-context int int float float none)) +(define-extern update-mood-pulse (function mood-context int int float float float float none)) +(define-extern update-mood-strobe (function mood-context int int int float float)) (define-extern update-mood-caustics (function mood-context int float float float float float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -23573,7 +23591,7 @@ (deftype drill-states (structure) ((fire-floor float :offset-assert 0) (fire-floor-fade float :offset-assert 4) - (fire-floor-flag basic :offset-assert 8) + (fire-floor-flag symbol :offset-assert 8) (flame flames-state :inline :offset-assert 12) (electricity electricity-state 2 :inline :offset-assert 20) ;; TODO - probably wrong, elec-wall? (but its an array....) (pulse pulse-state :inline :offset 52) @@ -23587,9 +23605,9 @@ (deftype drillb-states (structure) ((fire-floor float :offset-assert 0) (fire-floor-fade float :offset-assert 4) - (fire-floor-flag basic :offset-assert 8) + (fire-floor-flag symbol :offset-assert 8) (pulse pulse-state :inline :offset-assert 12) - (light-flag basic :offset-assert 16) + (light-flag symbol :offset-assert 16) ) :method-count-assert 9 :size-assert #x14 @@ -23626,7 +23644,7 @@ ) (deftype palroof-states (structure) - ((electricity vector 2 :inline :offset-assert 0) ;; TODO - probably wrong, elec-wall? (but its an array....) + ((electricity electricity-state 2 :inline :offset-assert 0) ) :method-count-assert 9 :size-assert #x20 @@ -23644,7 +23662,7 @@ (deftype nest-states (structure) ((light light-state :inline :offset-assert 0) - (green-flag basic :offset-assert 8) + (green-flag symbol :offset-assert 8) (green float :offset-assert 12) (green-noise float :offset-assert 16) ) @@ -23655,7 +23673,7 @@ (deftype village1-states (structure) ((interp float :offset-assert 0) - (interp-flag basic :offset-assert 4) + (interp-flag symbol :offset-assert 4) ) :method-count-assert 9 :size-assert #x8 @@ -23672,7 +23690,7 @@ ) (deftype mincan-states (structure) - ((beams strobe-state 2 :offset-assert 0) ;; a guess! + ((beams float 2 :offset-assert 0) ) :method-count-assert 9 :size-assert #x8 @@ -23680,117 +23698,112 @@ ) -(define-extern update-mood-default (function mood-context float int none)) +(define-extern update-mood-default (function mood-context float int none :behavior time-of-day-proc)) (define-extern get-sphere-interp (function sphere vector float float float)) (define-extern init-mood-ruins (function mood-context none)) -(define-extern update-mood-ruins (function mood-context int int none)) -(define-extern init-mood-strip "TODO - returns element at offset 20 in the context's state" (function mood-context uint)) -(define-extern update-mood-strip (function mood-context int int none)) -(define-extern update-mood-ctywide (function mood-context int int none)) -(define-extern update-mood-copy-ctywide (function mood-context int int none)) -(define-extern update-mood-ctyind (function mood-context float int none)) +(define-extern update-mood-ruins (function mood-context float int none :behavior time-of-day-proc)) +(define-extern init-mood-strip (function mood-context uint)) +(define-extern update-mood-strip (function mood-context float int none :behavior time-of-day-proc)) +(define-extern update-mood-ctywide (function mood-context float int none :behavior time-of-day-proc)) +(define-extern update-mood-copy-ctywide (function mood-context float int none :behavior time-of-day-proc)) +(define-extern update-mood-ctyind (function mood-context float int none :behavior time-of-day-proc)) (define-extern init-mood-ctysluma (function mood-context float)) -(define-extern update-mood-ctysluma (function mood-context float int none)) +(define-extern update-mood-ctysluma (function mood-context float int none :behavior time-of-day-proc)) (define-extern init-mood-ctyslumb (function mood-context uint)) -(define-extern update-mood-ctyslumb (function mood-context float int none)) +(define-extern update-mood-ctyslumb (function mood-context float int none :behavior time-of-day-proc)) (define-extern init-mood-ctyslumc (function mood-context none)) -(define-extern update-mood-ctyslumc (function mood-context float int none)) +(define-extern update-mood-ctyslumc (function mood-context float int none :behavior time-of-day-proc)) (define-extern init-mood-ctyport (function mood-context uint)) -(define-extern init-mood-ctyport-no-part (function mood-context none)) ;; seems like the return is the particle (group) id perhaps implied by this name? -(define-extern update-mood-ctyport (function mood-context float int none)) -(define-extern update-mood-ctymarka (function mood-context float int none)) -(define-extern update-mood-ctymarkb (function mood-context float int none)) -(define-extern init-mood-palcab (function mood-context float)) ;; sometimes they are floats though -(define-extern update-mood-palcab (function mood-context float int none)) +(define-extern init-mood-ctyport-no-part (function mood-context none)) +(define-extern update-mood-ctyport (function mood-context float int none :behavior time-of-day-proc)) +(define-extern update-mood-ctymarka (function mood-context float int none :behavior time-of-day-proc)) +(define-extern update-mood-ctymarkb (function mood-context float int none :behavior time-of-day-proc)) +(define-extern init-mood-palcab (function mood-context float)) +(define-extern update-mood-palcab (function mood-context float int none :behavior time-of-day-proc)) (define-extern set-palcab-turret-flash! (function float float)) (define-extern update-stadium-lights (function mood-context none)) -(define-extern update-mood-stadium (function mood-context float int none)) -(define-extern update-mood-copy-stadium (function mood-context float int none)) +(define-extern update-mood-stadium (function mood-context float int none :behavior time-of-day-proc)) +(define-extern update-mood-copy-stadium (function mood-context float int none :behavior time-of-day-proc)) (define-extern update-stadiumb-lights (function mood-context none)) -(define-extern update-mood-stadiumb (function mood-context float int none :behavior process)) ;; process - time of day? -(define-extern update-mood-skatea (function mood-context float int none)) +(define-extern update-mood-stadiumb (function mood-context float int none :behavior time-of-day-proc)) +(define-extern update-mood-skatea (function mood-context float int none :behavior time-of-day-proc)) (define-extern update-ltentout-lights (function mood-context none)) -(define-extern update-mood-ltentout (function mood-context float int none)) +(define-extern update-mood-ltentout (function mood-context float int none :behavior time-of-day-proc)) (define-extern init-mood-mountain (function mood-context uint)) -(define-extern update-mood-mountain (function mood-context float int none)) -(define-extern update-mood-forest (function mood-context float int none)) +(define-extern update-mood-mountain (function mood-context float int none :behavior time-of-day-proc)) +(define-extern update-mood-forest (function mood-context float int none :behavior time-of-day-proc)) (define-extern init-mood-atoll (function mood-context float)) -(define-extern update-mood-atoll (function mood-context float int none)) +(define-extern update-mood-atoll (function mood-context float int none :behavior time-of-day-proc)) (define-extern set-atoll-explosion! (function float float)) -(define-extern update-mood-atollext (function mood-context float int none)) +(define-extern update-mood-atollext (function mood-context float int none :behavior time-of-day-proc)) (define-extern init-mood-drill (function mood-context symbol)) (define-extern update-drill-lights (function mood-context none)) -(define-extern update-mood-drill (function mood-context float int object object float float int none)) +(define-extern update-mood-drill (function mood-context object int none :behavior time-of-day-proc)) (define-extern set-drill-fire-floor! (function symbol symbol)) -(define-extern set-drill-electricity-scale! (function float float float)) -(define-extern update-mood-drillmnt (function mood-context float int none)) +(define-extern set-drill-electricity-scale! (function float int float)) +(define-extern update-mood-drillmnt (function mood-context float int none :behavior time-of-day-proc)) (define-extern init-mood-drillb (function mood-context symbol)) -(define-extern update-mood-drillb (function mood-context float int none)) +(define-extern update-mood-drillb (function mood-context none :behavior time-of-day-proc)) (define-extern update-casboss-lights (function mood-context float)) -(define-extern update-mood-casboss (function mood-context float int none)) +(define-extern update-mood-casboss (function mood-context float int none :behavior time-of-day-proc)) (define-extern set-casboss-explosion! (function float)) -(define-extern update-mood-caspad (function mood-context float int none)) +(define-extern update-mood-caspad (function mood-context float int none :behavior time-of-day-proc)) (define-extern init-mood-palout (function mood-context vector)) -(define-extern update-mood-palout (function mood-context float int none)) +(define-extern update-mood-palout (function mood-context float int none :behavior time-of-day-proc)) (define-extern init-mood-palroof (function mood-context float)) -(define-extern update-mood-palroof (function mood-context object int object object float float float none)) -(define-extern set-palroof-electricity-scale! "TODO - guess on vector, comes from palroof-elec-gate and is probably a pointer to palettes?" (function float (inline-array vector) float)) -(define-extern update-mood-palent (function mood-context float int none)) +(define-extern update-mood-palroof (function mood-context object int none :behavior time-of-day-proc)) +(define-extern set-palroof-electricity-scale! (function float int float)) +(define-extern update-mood-palent (function mood-context float int none :behavior time-of-day-proc)) (define-extern set-palent-turret-flash! (function float float)) (define-extern init-mood-nest (function mood-context symbol)) (define-extern update-nest-lights (function mood-context pointer)) -(define-extern update-mood-nest (function mood-context float int none)) +(define-extern update-mood-nest (function mood-context float int none :behavior time-of-day-proc)) (define-extern set-nest-green-flag! (function symbol symbol)) (define-extern init-mood-village1 (function mood-context symbol)) (define-extern update-village1-lights (function mood-context float)) -(define-extern update-mood-village1 (function mood-context float int none)) -(define-extern update-mood-copy-village1 (function mood-context float int none)) +(define-extern update-mood-village1 (function mood-context float int none :behavior time-of-day-proc)) +(define-extern update-mood-copy-village1 (function mood-context float int none :behavior time-of-day-proc)) (define-extern clear-village1-interp! (function symbol)) (define-extern set-village1-interp! (function symbol)) -(define-extern update-mood-consite (function mood-context float int none)) +(define-extern update-mood-consite (function mood-context float int none :behavior time-of-day-proc)) (define-extern set-consite-flash! (function float)) -(define-extern update-mood-mincan (function mood-context float int none)) +(define-extern update-mood-mincan (function mood-context float int none :behavior time-of-day-proc)) (define-extern set-mincan-beam! (function int float float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mood-funcs2 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype default-interior-states (UNKNOWN) +(deftype default-interior-states (structure) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x0 ;; TODO - is it actually empty? + :flag-assert #x900000000 ) -|# -#| -(deftype vinroom-states (UNKNOWN) +(deftype vinroom-states (structure) ((main float :offset-assert 0) (flicker1 float :offset-assert 4) (flicker2 float :offset-assert 8) (warp float :offset-assert 12) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 ) -|# -#| -(deftype hideout-states (UNKNOWN) +(deftype hideout-states (structure) ((flame0 flames-state :inline :offset-assert 0) (flame1 flames-state :inline :offset-assert 8) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #xf + :flag-assert #x90000000f ) -|# -#| -(deftype hiphog-states (UNKNOWN) +(declare-type com-airlock process-drawable) +(declare-type hip-door-a com-airlock) +(deftype hiphog-states (structure) ((spec-m-on sp-field-init-spec :offset-assert 0) (spec-o-on sp-field-init-spec :offset-assert 4) (spec-r-on sp-field-init-spec :offset-assert 8) @@ -23811,7 +23824,7 @@ (spec-hiphog-off2 sp-field-init-spec :offset-assert 68) (spec-clock-sun sp-field-init-spec :offset-assert 72) (spec-clock-moon sp-field-init-spec :offset-assert 76) - (door basic :offset-assert 80) + (door entity :offset-assert 80) (m-on uint8 :offset-assert 84) (o-on uint8 :offset-assert 85) (r-on uint8 :offset-assert 86) @@ -23830,29 +23843,25 @@ (clock-sun uint8 :offset-assert 99) (clock-moon uint8 :offset-assert 100) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x65 + :flag-assert #x900000065 ) -|# -#| -(deftype sewer-states (UNKNOWN) - ((light-flag basic :offset-assert 0) +(deftype sewer-states (structure) + ((light-flag symbol :offset-assert 0) (light-count uint32 :offset-assert 4) (turret-value float :offset-assert 8) (spec-light-center sp-field-init-spec :offset-assert 12) (spec-light sp-field-init-spec :offset-assert 16) (explosion float :offset-assert 20) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 ) -|# -#| -(deftype onintent-states (UNKNOWN) +(deftype onintent-states (structure) ((flame0 flames-state :inline :offset-assert 0) (flame1 flames-state :inline :offset-assert 8) (flame2 flames-state :inline :offset-assert 16) @@ -23860,185 +23869,157 @@ (totem0 flames-state :inline :offset-assert 32) (totem1 flames-state :inline :offset-assert 40) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x2f + :flag-assert #x90000002f ) -|# -#| -(deftype oracle-states (UNKNOWN) +(deftype oracle-states (structure) ((flame0 flames-state :inline :offset-assert 0) (flame1 flames-state :inline :offset-assert 8) (flame2 flames-state :inline :offset-assert 16) (blue-flame flames-state :inline :offset-assert 24) - (door-entity basic :offset-assert 32) + (door-entity entity :offset-assert 32) (door-current float :offset-assert 36) (door-target float :offset-assert 40) - (purple-flag basic :offset-assert 44) + (purple-flag symbol :offset-assert 44) (purple float :offset-assert 48) (purple-noise float :offset-assert 52) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x38 + :flag-assert #x900000038 ) -|# -#| -(deftype tomba-states (UNKNOWN) +(deftype tomba-states (structure) ((flame0 flames-state :inline :offset-assert 0) (flame1 flames-state :inline :offset-assert 8) (flame2 flames-state :inline :offset-assert 16) (light light-state :inline :offset-assert 24) (gem-light float :offset-assert 32) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 ) -|# -#| -(deftype tombb-states (UNKNOWN) +(deftype tombb-states (structure) ((flame0 flames-state :inline :offset-assert 0) (flame1 flames-state :inline :offset-assert 8) (flame2 flames-state :inline :offset-assert 16) (light light-state :inline :offset-assert 24) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 ) -|# -#| -(deftype tombc-states (UNKNOWN) +(deftype tombc-states (structure) ((flame0 flames-state :inline :offset-assert 0) (flame1 flames-state :inline :offset-assert 8) (flame2 flames-state :inline :offset-assert 16) (electricity electricity-state :inline :offset-assert 24) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 ) -|# -#| -(deftype tombd-states (UNKNOWN) +(deftype tombd-states (structure) ((flame0 flames-state :inline :offset-assert 0) (flame1 flames-state :inline :offset-assert 8) (flame2 flames-state :inline :offset-assert 16) (light light-state :inline :offset-assert 24) (gem-light float :offset-assert 32) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 ) -|# -#| -(deftype tombe-states (UNKNOWN) +(deftype tombe-states (structure) ((flame0 flames-state :inline :offset-assert 0) (flame1 flames-state :inline :offset-assert 8) (flame2 flames-state :inline :offset-assert 16) (light light-state :inline :offset-assert 24) (gem-light float :offset-assert 32) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 ) -|# -#| -(deftype tombboss-states (UNKNOWN) +(deftype tombboss-states (structure) ((flame0 flames-state :inline :offset-assert 0) (flame1 flames-state :inline :offset-assert 8) (flame2 flames-state :inline :offset-assert 16) (light light-state :inline :offset-assert 24) (gem-light float :offset-assert 32) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 ) -|# -#| -(deftype fortress-states (UNKNOWN) +(deftype fortress-states (structure) ((pulse pulse-state :inline :offset-assert 0) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 ) -|# -#| -(deftype fordumpa-states (UNKNOWN) - ((turret-value UNKNOWN 4 :offset-assert 0) +(deftype fordumpa-states (structure) + ((turret-value float 4 :offset-assert 0) (pulse pulse-state :inline :offset-assert 16) (electricity electricity-state :inline :offset-assert 20) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c ) -|# -#| -(deftype fordumpc-states (UNKNOWN) - ((light-flag basic :offset-assert 0) +(deftype fordumpc-states (structure) + ((light-flag symbol :offset-assert 0) (pulse0 pulse-state :inline :offset-assert 4) (pulse1 pulse-state :inline :offset-assert 8) (strobe strobe-state :inline :offset-assert 12) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 ) -|# -#| -(deftype forresca-states (UNKNOWN) +(deftype forresca-states (structure) ((pulse pulse-state :inline :offset-assert 0) - (electricity UNKNOWN 2 :offset-assert 4) + (electricity electricity-state 2 :inline :offset 4) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 ) -|# -#| -(deftype forrescb-states (UNKNOWN) - ((electricity UNKNOWN 2 :offset-assert 0) - (turret UNKNOWN 4 :offset-assert 32) +(deftype forrescb-states (structure) + ((electricity electricity-state 2 :inline :offset-assert 0) + (turret float 4 :offset-assert 32) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 ) -|# -#| -(deftype prison-states (UNKNOWN) +(deftype prison-states (structure) ((pulse float :offset-assert 0) (angle float :offset-assert 4) (torture float :offset-assert 8) - (torture-flag basic :offset-assert 12) + (torture-flag symbol :offset-assert 12) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 ) -|# -#| -(deftype under-states (UNKNOWN) +(deftype under-states (structure) ((flame0 flames-state :inline :offset-assert 0) (flame1 flames-state :inline :offset-assert 8) (rot float :offset-assert 16) @@ -24048,197 +24029,180 @@ (fog-interp float :offset-assert 32) (flicker float :offset-assert 36) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 ) -|# -#| -(deftype gungame-states (UNKNOWN) +(deftype gungame-states (structure) ((florescent florescent-state :inline :offset-assert 0) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 ) -|# -#| -(deftype dig1-states (UNKNOWN) +(deftype dig1-states (structure) ((pulse0 pulse-state :inline :offset-assert 0) (pulse1 pulse-state :inline :offset-assert 4) (explosion float :offset-assert 8) (drillbit float :offset-assert 12) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 ) -|# -#| -(deftype vortex-states (UNKNOWN) +(deftype vortex-states (structure) ((time float :offset-assert 0) (level float :offset-assert 4) (delta float :offset-assert 8) (scale float :offset-assert 12) (flash float :offset-assert 16) (num int32 :offset-assert 20) - (white basic :offset-assert 24) + (white symbol :offset-assert 24) (white-count float :offset-assert 28) (pos vector :inline :offset-assert 32) (dir vector :inline :offset-assert 48) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 ) -|# -#| -(deftype nestb-states (UNKNOWN) +(deftype nestb-states (structure) ((pulse pulse-state :inline :offset-assert 0) (rot float :offset-assert 4) (purple float :offset-assert 8) (purple-noise float :offset-assert 12) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 ) -|# -#| -(deftype consiteb-states (UNKNOWN) +(deftype consiteb-states (structure) ((flicker float :offset-assert 0) (flicker-count float :offset-assert 4) (flicker-state int32 :offset-assert 8) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c ) -|# -#| -(deftype castle-states (UNKNOWN) +(deftype castle-states (structure) ((electricity electricity-state :inline :offset-assert 0) - (pulse UNKNOWN 2 :offset-assert 8) + (pulse pulse-state 2 :inline :offset-assert 8) (rot float :offset-assert 40) (robot-rot float :offset-assert 44) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 ) -|# -#| -(deftype garage-states (UNKNOWN) +(deftype garage-states (structure) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x0 ;; TODO - is it actually empty? + :flag-assert #x900000000 ) -|# -#| -(deftype palshaft-states (UNKNOWN) +(deftype palshaft-states (structure) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x0 ;; TODO - is it actually empty? + :flag-assert #x900000000 ) -|# -;; (define-extern update-mood-default-interior function) -;; (define-extern update-vinroom-lights function) -;; (define-extern update-mood-vinroom function) -;; (define-extern update-hideout-lights function) -;; (define-extern update-mood-hideout function) -;; (define-extern update-mood-copy-hideout function) -;; (define-extern init-mood-hiphog function) -;; (define-extern update-hiphog-lights function) -;; (define-extern update-mood-hiphog function) -;; (define-extern update-mood-copy-hiphog function) -;; (define-extern update-sewer-lights function) -;; (define-extern init-mood-sewer function) -;; (define-extern update-mood-sewer function) -;; (define-extern update-mood-copy-sewerb function) -;; (define-extern update-mood-copy-sewescb function) -;; (define-extern set-sewer-lights-flag! function) -;; (define-extern set-sewer-turret-flash! function) -;; (define-extern set-sewesc-explosion! function) -;; (define-extern update-onintent-lights function) -;; (define-extern update-mood-onintent function) -;; (define-extern init-mood-oracle function) -;; (define-extern update-mood-oracle function) -;; (define-extern set-oracle-purple-flag! function) -;; (define-extern update-tomba-lights function) -;; (define-extern update-mood-tomba function) -;; (define-extern update-tombb-lights function) -;; (define-extern update-mood-tombb function) -;; (define-extern init-mood-tombc function) -;; (define-extern update-mood-tombc function) -;; (define-extern set-tombc-electricity-scale! function) -;; (define-extern update-tombd-lights function) -;; (define-extern update-mood-tombd function) -;; (define-extern update-mood-tombe function) -;; (define-extern update-tombboss-lights function) -;; (define-extern update-mood-tombboss function) -;; (define-extern set-tombboss-gem-light! function) -;; (define-extern update-fortress-lights function) -;; (define-extern update-mood-fortress function) -;; (define-extern init-mood-fordumpa function) -;; (define-extern update-mood-fordumpa function) -;; (define-extern set-fordumpa-turret-flash! function) -;; (define-extern set-fordumpa-electricity-scale! function) -;; (define-extern init-mood-fordumpc function) -;; (define-extern update-mood-fordumpc function) -;; (define-extern set-fordumpc-light-flag! function) -;; (define-extern init-mood-forresca function) -;; (define-extern update-mood-forresca function) -;; (define-extern set-forresca-electricity-scale! function) -;; (define-extern init-mood-forrescb function) -;; (define-extern update-mood-forrescb function) -;; (define-extern set-forrescb-turret-flash! function) -;; (define-extern set-forrescb-electricity-scale! function) -;; (define-extern update-prison-lights function) -;; (define-extern init-mood-prison function) -;; (define-extern update-mood-prison function) -;; (define-extern update-mood-copy-prison function) -;; (define-extern set-prison-torture-flag! function) -;; (define-extern update-under-lights function) -;; (define-extern update-mood-under function) -;; (define-extern update-mood-copy-underb function) -;; (define-extern set-under-laser! function) -;; (define-extern set-under-fog-interp! function) -;; (define-extern update-gungame-lights function) -;; (define-extern update-mood-gungame function) -;; (define-extern init-mood-dig1 function) -;; (define-extern update-dig1-lights function) -;; (define-extern update-mood-dig1 function) -;; (define-extern set-dig1-explosion! function) -;; (define-extern update-vortex-lights function) -;; (define-extern update-mood-vortex function) -;; (define-extern set-vortex-flash! function) -;; (define-extern set-vortex-white! function) -;; (define-extern update-nestb-lights function) -;; (define-extern update-mood-nestb function) -;; (define-extern set-nestb-purple! function) -;; (define-extern get-nestb-purple function) -;; (define-extern init-mood-consiteb function) -;; (define-extern update-mood-consiteb function) -;; (define-extern update-castle-lights function) -;; (define-extern init-mood-castle function) -;; (define-extern update-mood-castle function) -;; (define-extern set-castle-electricity-scale! function) -;; (define-extern init-mood-garage function) -;; (define-extern update-garage-lights function) -;; (define-extern update-mood-garage function) -;; (define-extern update-mood-copy-garage function) -;; (define-extern update-mood-palshaft function) +(define-extern update-mood-default-interior (function mood-context none :behavior time-of-day-proc)) +(define-extern update-vinroom-lights (function mood-context none)) +(define-extern update-mood-vinroom (function mood-context none :behavior time-of-day-proc)) +(define-extern update-hideout-lights (function mood-context none)) +(define-extern update-mood-hideout (function mood-context none :behavior time-of-day-proc)) +(define-extern update-mood-copy-hideout (function mood-context none :behavior time-of-day-proc)) +(define-extern init-mood-hiphog (function mood-context none)) +(define-extern update-hiphog-lights (function mood-context none)) +(define-extern update-mood-hiphog (function mood-context float none :behavior time-of-day-proc)) +(define-extern update-mood-copy-hiphog (function mood-context none :behavior time-of-day-proc)) +(define-extern update-sewer-lights (function mood-context none)) +(define-extern init-mood-sewer (function mood-context none)) +(define-extern update-mood-sewer (function mood-context none :behavior time-of-day-proc)) +(define-extern update-mood-copy-sewerb (function mood-context none :behavior time-of-day-proc)) +(define-extern update-mood-copy-sewescb (function mood-context none :behavior time-of-day-proc)) +(define-extern set-sewer-lights-flag! (function symbol symbol)) +(define-extern set-sewer-turret-flash! (function float)) +(define-extern set-sewesc-explosion! (function float)) +(define-extern update-onintent-lights (function mood-context none)) +(define-extern update-mood-onintent (function mood-context none :behavior time-of-day-proc)) +(define-extern init-mood-oracle (function mood-context symbol)) +(define-extern update-mood-oracle (function mood-context none :behavior time-of-day-proc)) +(define-extern set-oracle-purple-flag! (function symbol symbol)) +(define-extern update-tomba-lights (function mood-context none)) +(define-extern update-mood-tomba (function mood-context none :behavior time-of-day-proc)) +(define-extern update-tombb-lights (function mood-context none)) +(define-extern update-mood-tombb (function mood-context none :behavior time-of-day-proc)) +(define-extern init-mood-tombc (function mood-context float)) +(define-extern update-mood-tombc (function mood-context none :behavior time-of-day-proc)) +(define-extern set-tombc-electricity-scale! (function float float)) +(define-extern update-tombd-lights (function mood-context none)) +(define-extern update-mood-tombd (function mood-context none :behavior time-of-day-proc)) +(define-extern update-mood-tombe (function mood-context none :behavior time-of-day-proc)) +(define-extern update-tombboss-lights (function mood-context none)) +(define-extern update-mood-tombboss (function mood-context none :behavior time-of-day-proc)) +(define-extern set-tombboss-gem-light! (function float float)) +(define-extern update-fortress-lights (function mood-context none)) +(define-extern update-mood-fortress (function mood-context none :behavior time-of-day-proc)) +(define-extern init-mood-fordumpa (function mood-context float)) +(define-extern update-mood-fordumpa (function mood-context none :behavior time-of-day-proc)) +(define-extern set-fordumpa-turret-flash! (function int float)) +(define-extern set-fordumpa-electricity-scale! (function float float)) +(define-extern init-mood-fordumpc (function mood-context symbol)) +(define-extern update-mood-fordumpc (function mood-context none :behavior time-of-day-proc)) +(define-extern set-fordumpc-light-flag! (function symbol symbol)) +(define-extern init-mood-forresca (function mood-context float)) +(define-extern update-mood-forresca (function mood-context none :behavior time-of-day-proc)) +(define-extern set-forresca-electricity-scale! (function float int float)) +(define-extern init-mood-forrescb (function mood-context float)) +(define-extern update-mood-forrescb (function mood-context none :behavior time-of-day-proc)) +(define-extern set-forrescb-turret-flash! (function int float)) +(define-extern set-forrescb-electricity-scale! (function float int float)) +(define-extern update-prison-lights (function mood-context none)) +(define-extern init-mood-prison (function mood-context float)) +(define-extern update-mood-prison (function mood-context none :behavior time-of-day-proc)) +(define-extern update-mood-copy-prison (function mood-context none :behavior time-of-day-proc)) +(define-extern set-prison-torture-flag! (function symbol symbol)) +(define-extern update-under-lights (function mood-context float)) +(define-extern update-mood-under (function mood-context none :behavior time-of-day-proc)) +(define-extern update-mood-copy-underb (function mood-context none :behavior time-of-day-proc)) +(define-extern set-under-laser! (function float float)) +(define-extern set-under-fog-interp! (function float float)) +(define-extern update-gungame-lights (function mood-context none)) +(define-extern update-mood-gungame (function mood-context none :behavior time-of-day-proc)) +(define-extern init-mood-dig1 (function mood-context float)) +(define-extern update-dig1-lights (function mood-context none)) +(define-extern update-mood-dig1 (function mood-context none :behavior time-of-day-proc)) +(define-extern set-dig1-explosion! (function float float)) +(define-extern update-vortex-lights (function mood-context none)) +(define-extern update-mood-vortex (function mood-context none :behavior time-of-day-proc)) +(define-extern set-vortex-flash! (function float float)) +(define-extern set-vortex-white! (function symbol float)) +(define-extern update-nestb-lights (function mood-context none)) +(define-extern update-mood-nestb (function mood-context object int none :behavior time-of-day-proc)) +(define-extern set-nestb-purple! (function float float)) +(define-extern get-nestb-purple (function float)) +(define-extern init-mood-consiteb (function mood-context none)) +(define-extern update-mood-consiteb (function mood-context object int none :behavior time-of-day-proc)) +(define-extern update-castle-lights (function mood-context none)) +(define-extern init-mood-castle (function mood-context float)) +(define-extern update-mood-castle (function mood-context none :behavior time-of-day-proc)) +(define-extern set-castle-electricity-scale! (function float float)) +(define-extern init-mood-garage (function mood-context symbol)) +(define-extern update-garage-lights (function mood-context none)) +(define-extern update-mood-garage (function mood-context object int none :behavior time-of-day-proc)) +(define-extern update-mood-copy-garage (function mood-context none :behavior time-of-day-proc)) +(define-extern update-mood-palshaft (function mood-context none :behavior time-of-day-proc)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; weather-part ;; @@ -24269,7 +24233,7 @@ ;; (define-extern time-of-day-interp-colors function) ;; (function (pointer rgba) uint mood-context none) ;; (define-extern time-of-day-interp-colors-scratch function) ;; (function (pointer rgba) time-of-day-palette mood-context none) (define-extern init-time-of-day-context (function time-of-day-context symbol)) -(define-extern set-filter-color! (function float float int none)) +(define-extern set-filter-color! (function float float float none)) (define-extern tod-madd! (function vector vector vector float)) (define-extern update-environment-colors (function time-of-day-context vector)) (define-extern update-time-of-day (function time-of-day-context none)) @@ -24315,7 +24279,7 @@ ;; level-info ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(define-extern *task-level* array) +(define-extern *task-level* (array symbol)) (define-extern default-level level-load-info) ;; level-load-info (define-extern intro level-load-info) ;; level-load-info (define-extern demo level-load-info) ;; level-load-info @@ -25681,8 +25645,8 @@ ;; (define-extern process-drawable-idle state) ;; (state process-drawable) ;; (define-extern skeleton-group->draw-control function) (define-extern ja-done? (function int symbol :behavior process-drawable)) -;; (define-extern ja-min? function) ;; (function int symbol :behavior process-drawable) -;; (define-extern ja-max? function) ;; (function int symbol :behavior process-drawable) +(define-extern ja-min? (function int symbol :behavior process-drawable)) ;; +(define-extern ja-max? (function int symbol :behavior process-drawable)) ;; ;; (define-extern ja-num-frames function) ;; (function int int :behavior process-drawable) (define-extern ja-frame-num (function int float :behavior process-drawable)) (define-extern ja-aframe-num (function int float :behavior process-drawable)) @@ -25700,7 +25664,7 @@ (define-extern sleep-code (function symbol)) ;; (define-extern transform-and-sleep function) ;; (define-extern transform-and-sleep-code function) -;; (define-extern transform-post function) ;; (function int :behavior process-drawable) +(define-extern transform-post (function int :behavior process-drawable)) ;; ;; (define-extern rider-trans function) ;; (function int :behavior process-drawable) ;; (define-extern rider-post function) ;; (function int :behavior process-drawable) ;; (define-extern pusher-post function) ;; (function int :behavior process-drawable) @@ -26540,7 +26504,7 @@ ;; (define-extern bend-gravity function) ;; (function symbol :behavior target) ;; (define-extern target-compute-edge function) ;; (function none :behavior target) ;; (define-extern target-compute-edge-rider function) ;; (function none :behavior target) -;; (define-extern target-compute-pole function) ;; (function none :behavior target) +(define-extern target-compute-pole (function none :behavior target)) ;; ;; (define-extern target-calc-camera-pos function) ;; (function none :behavior target) ;; (define-extern joint-points function) ;; (function none :behavior target) ;; (define-extern do-target-gspot function) @@ -27702,13 +27666,13 @@ ;; (define-extern entity-deactivate-handler function) ;; (function process entity-actor none) ;; (define-extern check-for-rougue-process function) ;; (define-extern process-drawable-scale-from-entity! function) -;; (define-extern process-drawable-from-entity! function) ;; (function process-drawable entity-actor none) +(define-extern process-drawable-from-entity! (function process-drawable entity-actor none)) ;; (define-extern reset-actors (function symbol none)) (define-extern reset-cameras (function none)) ;; (define-extern entity-birth-no-kill function) ;; (function entity none) ;; (define-extern entity-task-complete-on function) ;; (function entity none) ;; (define-extern entity-task-complete-off function) ;; (function entity none) -;; (define-extern process-entity-status! function) ;; (function process entity-perm-status symbol int) +(define-extern process-entity-status! (function process entity-perm-status symbol int)) ;; ;; (define-extern find-nearest-entity function) ;; (define-extern entity-speed-test function) ;; (function string none) ;; (define-extern dump-entity-remap function) @@ -28171,7 +28135,7 @@ ;; (define-extern task-close! function) ;; (define-extern task-closed? function) ;; (function game-task task-status symbol) ;; (define-extern open-task-nodes function) -(define-extern task-node-closed? (function game-task symbol)) +(define-extern task-node-closed? (function game-task-node symbol)) (define-extern task-node-close! (function game-task none)) (define-extern task-node-open? (function game-task symbol)) (define-extern task-node-open! (function game-task none)) @@ -29774,64 +29738,63 @@ ;; airlock ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype com-airlock (process-drawable) - ((level-name basic :offset-assert 196) - (open-test basic :offset-assert 200) - (were-behind? basic :offset-assert 204) - (inner? basic :offset-assert 208) - (sound-behind? basic :offset-assert 212) - (visible-move? basic :offset-assert 216) - (saw-pilot? uint64 :offset-assert 220) - (last-distance meters :offset-assert 228) - (y-height uint32 :offset-assert 232) - (pre-open-speed float :offset-assert 236) - (latch-closed-time time-frame :offset-assert 244) - (latch-open-time time-frame :offset-assert 252) - (gear basic :offset-assert 260) - (gear-rot deg :offset-assert 264) - (gear-rotv deg :offset-assert 268) - (open-frame float :offset-assert 272) - (pre-open-frame float :offset-assert 276) - (lock-frame float :offset-assert 280) - (open-distance meters :offset-assert 284) - (active-distance meters :offset-assert 288) - (sound-id uint32 :offset-assert 292) - (gear-sound-id uint32 :offset-assert 296) - (sound-gear basic :offset-assert 300) - (sound-pre-open basic :offset-assert 304) - (sound-pre-open-stop basic :offset-assert 308) - (sound-lock-loop basic :offset-assert 312) - (sound-lock-stop basic :offset-assert 316) - (sound-open basic :offset-assert 320) - (sound-open-loop basic :offset-assert 324) - (sound-open-stop basic :offset-assert 328) - (sound-close basic :offset-assert 332) - (sound-close-loop basic :offset-assert 336) - (sound-close-stop basic :offset-assert 340) - (sound-post-close basic :offset-assert 344) - (sound-post-close-stop basic :offset-assert 348) - (spool-sound-time time-frame :offset-assert 356) - (door-radius meters :offset-assert 364) + ((child-override basic :offset 24) ;; what is this! + (root-override collide-shape :offset 128 :score 999) + (level-name string :offset-assert 200) + (open-test symbol :offset-assert 204) + (were-behind? symbol :offset-assert 208) + (inner? symbol :offset-assert 212) + (sound-behind? symbol :offset-assert 216) + (visible-move? symbol :offset-assert 220) + (saw-pilot? handle :offset-assert 224) + (last-distance meters :offset-assert 232) + (y-height vector :offset-assert 236) ;; a guess + (pre-open-speed float :offset-assert 240) + (latch-closed-time time-frame :offset-assert 248) + (latch-open-time time-frame :offset-assert 256) + (gear joint-mod :offset-assert 264) + (gear-rot degrees :offset-assert 268) + (gear-rotv degrees :offset-assert 272) + (open-frame float :offset-assert 276) + (pre-open-frame float :offset-assert 280) + (lock-frame float :offset-assert 284) + (open-distance meters :offset-assert 288) + (active-distance meters :offset-assert 292) + (sound-id sound-id :offset-assert 296) + (gear-sound-id sound-id :offset-assert 300) + (sound-gear sound-spec :offset-assert 304) + (sound-pre-open sound-spec :offset-assert 308) + (sound-pre-open-stop sound-spec :offset-assert 312) + (sound-lock-loop sound-spec :offset-assert 316) + (sound-lock-stop sound-spec :offset-assert 320) + (sound-open sound-spec :offset-assert 324) + (sound-open-loop sound-spec :offset-assert 328) + (sound-open-stop sound-spec :offset-assert 332) + (sound-close sound-spec :offset-assert 336) + (sound-close-loop sound-spec :offset-assert 340) + (sound-close-stop sound-spec :offset-assert 344) + (sound-post-close sound-spec :offset-assert 348) + (sound-post-close-stop sound-spec :offset-assert 352) + (spool-sound-time time-frame :offset-assert 360) + (door-radius meters :offset-assert 368) ) :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 ;; field level-name uses ~A with a signed load field open-test uses ~A with a signed load (:methods - (open () _type_ :state 20) - (close () _type_ :state 21) - (com-airlock-method-22 () none 22) - (com-airlock-method-23 () none 23) - (com-airlock-method-24 () none 24) - (com-airlock-method-25 () none 25) - (com-airlock-method-26 () none 26) - (com-airlock-method-27 () none 27) + (open (symbol) _type_ :state 20) + (close (symbol) _type_ :state 21) + (init-airlock! (_type_) _type_ 22) + (want-cross-airlock? (_type_) symbol :behavior com-airlock 23) + (destination-loaded? (_type_ symbol) symbol 24) + (check-crossing-distance (_type_ vector symbol) float :behavior com-airlock 25) + (rotate-gear! (_type_ float) degrees :behavior com-airlock 26) + (play-city-voice-sound (_type_ symbol) none :behavior com-airlock 27) ;; TODO - really weird usage of a string array / sound-array? ) ) -|# -#| (deftype com-airlock-outer (com-airlock) () :method-count-assert 28 @@ -29840,9 +29803,7 @@ (:methods ) ) -|# -#| (deftype com-airlock-inner (com-airlock) () :method-count-assert 28 @@ -29851,9 +29812,7 @@ (:methods ) ) -|# -#| (deftype fort-entry-gate (com-airlock) () :method-count-assert 28 @@ -29862,9 +29821,7 @@ (:methods ) ) -|# -#| (deftype hip-door-a (com-airlock) () :method-count-assert 28 @@ -29873,9 +29830,7 @@ (:methods ) ) -|# -#| (deftype tomb-mar-door (com-airlock) () :method-count-assert 28 @@ -29884,9 +29839,7 @@ (:methods ) ) -|# -#| (deftype cas-front-door (com-airlock-outer) () :method-count-assert 28 @@ -29895,9 +29848,7 @@ (:methods ) ) -|# -#| (deftype pal-throne-door (com-airlock) () :method-count-assert 28 @@ -29906,9 +29857,7 @@ (:methods ) ) -|# -#| (deftype vin-door-ctyinda (com-airlock) () :method-count-assert 28 @@ -29917,9 +29866,7 @@ (:methods ) ) -|# -#| (deftype under-door (com-airlock) () :method-count-assert 28 @@ -29928,9 +29875,7 @@ (:methods ) ) -|# -#| (deftype oracle-door (com-airlock) () :method-count-assert 28 @@ -29939,7 +29884,6 @@ (:methods ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index ccdd701de2..e6b6bb1ec3 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -225,5 +225,6 @@ [199, "(function debug-menu debug-menu symbol)"], [200, "(function debug-menu debug-menu symbol)"], [201, "(function debug-menu debug-menu symbol)"] - ] + ], + "airlock": [[13, "(function pair :behavior com-airlock)"]] } diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 2a5e5ea016..8218ad8ed8 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -123,10 +123,6 @@ "(method 17 collide-cache)", "(method 16 ocean)", - // unknown bug - "update-mood-copy-ctywide", - "update-mood-copy-stadium", - "update-mood-drillb", // "reset-target-tracking", "(anon-function 1 target)", "find-nearest-entity", @@ -189,7 +185,9 @@ "debug-menu-make-from-template", "debug-menu-context-make-default-menus", "debug-menu-make-task-menu", - "(method 19 gui-control)" + "(method 19 gui-control)", + // airlock + "(method 24 com-airlock)" ], // If format is used with the wrong number of arguments, diff --git a/decompiler/config/jak2/inputs.jsonc b/decompiler/config/jak2/inputs.jsonc index 32d6a88d91..c7532cbb78 100644 --- a/decompiler/config/jak2/inputs.jsonc +++ b/decompiler/config/jak2/inputs.jsonc @@ -179,7 +179,7 @@ ], // uncomment the next line to extract audio to wave files. - //"audio_dir_file_name": "jak1/VAG", + // "audio_dir_file_name": "jak2/VAG", "audio_dir_file_name": "", "streamed_audio_file_names": [], diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 02beca4b74..ae9cfb5db4 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -111,5 +111,24 @@ ["L775", "(pointer uint64)", 1] ], "collide-cache": [["L171", "vector"]], - "emerc-vu1": [["L1", "vu-function"]] + "emerc-vu1": [["L1", "vu-function"]], + "mood-funcs2": [ + ["L496", "(pointer uint64)", 1], + ["L497", "(pointer uint64)", 1], + ["L498", "(pointer uint64)", 1], + ["L499", "(pointer uint64)", 1], + ["L500", "(pointer uint64)", 1], + ["L501", "(pointer uint64)", 1], + ["L502", "(pointer uint64)", 1], + ["L503", "(pointer uint64)", 1], + ["L504", "(pointer uint64)", 1], + ["L505", "(pointer uint64)", 1], + ["L506", "(pointer uint64)", 1], + ["L507", "(pointer uint64)", 1], + ["L508", "(pointer uint64)", 1], + ["L509", "(pointer uint64)", 1], + ["L510", "(pointer uint64)", 1], + ["L312", "(pointer uint64)", 1], + ["L307", "vector"] + ] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index c85dc96016..65f6bf758b 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -187,7 +187,6 @@ [608, "vector"] ], "(method 10 cam-setting-data)": [[16, "event-message-block"]], - "(method 18 tracking-spline)": [ [16, "tracking-spline-sampler"], [32, "tracking-spline-sampler"] @@ -303,20 +302,17 @@ ], "cam-debug-draw-tris": [[16, "vector4w"]], "draw-string-xy": [[16, "font-context"]], - "(code die gun)": [ [16, "matrix"], [112, "vector"], [128, "vector"], [144, "vector"] ], - "draw-beam": [ [16, "vector"], [32, "vector"], [48, "vector"] ], - "gun-post": [ [16, "vector"], [32, "vector"], @@ -325,7 +321,6 @@ [160, "vector"], [176, "vector"] ], - "(method 9 gun-info)": [ [16, "collide-query"], [560, "vector"], @@ -336,12 +331,10 @@ [640, "vector"], [656, "vector"] ], - "target-gun-fire-yellow": [ [16, "matrix"], [112, "event-message-block"] ], - "(method 14 collide-cache)": [[16, "bounding-box"]], "sp-adjust-launch": [[16, "matrix"]], "sp-launch-particles-death": [[16, "matrix"]], @@ -417,6 +410,20 @@ ], "(method 13 gui-control)": [[16, ["array", "sound-id", 4]]], "ja-play-spooled-anim": [[96, "event-message-block"]], + "(method 24 com-airlock)": [[16, "script-context"]], + "(code close com-airlock)": [[32, "script-context"]], + "(code open com-airlock)": [[16, "script-context"]], + "(method 23 com-airlock)": [[16, "script-context"]], + "update-under-lights": [ + [16, "matrix"], + [64, "vector"] + ], + "(method 25 com-airlock)": [[48, "script-context"]], + "(anon-function 13 airlock)": [ + [176, "script-context"], + [16, "script-context"] + ], + "(trans close com-airlock)": [[16, "script-context"]], // placeholder "placeholder-do-not-add-below": [] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 3b1ecfb10d..c12be45f8c 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -496,21 +496,7 @@ [[30, 32], "v1", "(inline-array vector)"], [[29, 33], "a0", "(inline-array vector)"] ], - "update-mood-ruins": [[[30, 46], "gp", "(pointer float)"]], - "update-mood-strip": [[[63, 80], "s4", "(pointer float)"]], - "update-mood-ctysluma": [[[23, 81], "gp", "(pointer float)"]], - "update-mood-ctyslumb": [[[19, 59], "s5", "(pointer float)"]], - "update-mood-ctyslumc": [[[19, 47], "s5", "(pointer float)"]], - "update-mood-palcab": [[[23, 53], "s4", "(pointer float)"]], - "update-mood-stadiumb": [[[22, 61], "gp", "(pointer float)"]], - "update-mood-atoll": [[[19, 48], "s4", "(pointer float)"]], - "update-mood-drill": [[[22, 121], "gp", "(pointer float)"]], - "update-mood-casboss": [[[22, 46], "s4", "(pointer float)"]], - "update-mood-caspad": [[[19, 77], "gp", "(pointer float)"]], - "update-mood-palent": [[[18, 43], "s5", "(pointer float)"]], - "update-mood-nest": [[[21, 74], "s5", "(pointer float)"]], - "update-mood-village1": [[[21, 66], "gp", "(pointer float)"]], - "update-mood-consite": [[[84, 110], "s4", "(pointer float)"]], + "update-mood-ruins": [[[19, 46], "gp", "ruins-states"]], "desaturate-mood-colors": [[[20, 92], "a0", "(inline-array mood-color)"]], "ramdisk-load": [[[7, 12], "v1", "ramdisk-rpc-load"]], "(method 10 engine-sound-pers)": [[[2, 19], "v1", "sound-rpc-set-param"]], @@ -1555,5 +1541,153 @@ [73, "t1", "(pointer gs-reg64)"], [[82, 85], "a1", "dma-packet"] //[85, "a1", "dma-bucket"] - ] + ], + "update-mood-vinroom": [[[16, 140], "gp", "(pointer float)"]], + "update-mood-hiphog": [[[26, 458], "s5", "hiphog-states"]], + "update-mood-sewer": [[[25, 149], "s4", "sewer-states"]], + "update-mood-oracle": [[[17, 134], "s5", "oracle-states"]], + "(exit close com-airlock)": [ + [[4, 18], "v1", "sound-rpc-set-param"], + [[24, 38], "v1", "sound-rpc-set-param"] + ], + "(trans close com-airlock)": [[[52, 66], "v1", "sound-rpc-set-param"]], + "init-mood-hiphog": [[[0, 239], "gp", "hiphog-states"]], + "init-mood-sewer": [[[0, 20], "gp", "sewer-states"]], + "set-sewer-lights-flag!": [[[9, 17], "v1", "sewer-states"]], + "set-sewer-turret-flash!": [[[8, 11], "v1", "sewer-states"]], + "set-sewesc-explosion!": [[[8, 11], "v1", "sewer-states"]], + "init-mood-oracle": [[[0, 7], "v1", "oracle-states"]], + "set-oracle-purple-flag!": [[9, "v1", "oracle-states"]], + "init-mood-tombc": [[[1, 4], "v1", "tombc-states"]], + "set-tombc-electricity-scale!": [[[9, 11], "v1", "tombc-states"]], + "set-tombboss-gem-light!": [[[9, 11], "v1", "tombboss-states"]], + "init-mood-fordumpa": [[[1, 3], "v1", "fordumpa-states"]], + "update-mood-fordumpa": [[[44, 67], "s5", "fordumpa-states"]], + "set-fordumpa-turret-flash!": [[[9, 13], "v1", "fordumpa-states"]], + "set-fordumpa-electricity-scale!": [[[9, 11], "v1", "fordumpa-states"]], + "init-mood-fordumpc": [[1, "v1", "fordumpc-states"]], + "set-fordumpc-light-flag!": [[9, "v1", "fordumpc-states"]], + "init-mood-forresca": [[[1, 7], "v1", "forresca-states"]], + "set-forresca-electricity-scale!": [[12, "v1", "forresca-states"]], + "init-mood-forrescb": [[[1, 7], "v1", "forrescb-states"]], + "update-mood-forrescb": [[[17, 60], "gp", "forrescb-states"]], + "set-forrescb-turret-flash!": [[13, "v1", "forrescb-states"]], + "set-forrescb-electricity-scale!": [[12, "v1", "forrescb-states"]], + "init-mood-prison": [[[1, 4], "v1", "prison-states"]], + "update-mood-prison": [[[17, 105], "gp", "prison-states"]], + "set-prison-torture-flag!": [[9, "v1", "prison-states"]], + "update-under-lights": [[[1, 5], "v1", "under-states"]], + "update-mood-under": [[[16, 112], "gp", "under-states"]], + "set-under-laser!": [ + [10, "v1", "under-states"], + [21, "v1", "under-states"] + ], + "set-under-fog-interp!": [ + [21, "v1", "under-states"], + [10, "v1", "under-states"] + ], + "init-mood-dig1": [[2, "v1", "dig1-states"]], + "update-mood-dig1": [ + [[15, 135], "gp", "dig1-states"], + [28, "v1", "float"], + [56, "v1", "float"] + ], + "set-dig1-explosion!": [[10, "v1", "dig1-states"]], + "update-mood-vortex": [[[10, 299], "gp", "vortex-states"]], + "set-vortex-flash!": [ + [22, "v1", "vortex-states"], + [10, "v1", "vortex-states"] + ], + "set-vortex-white!": [ + [23, "v1", "vortex-states"], + [11, "v1", "vortex-states"], + [9, "v1", "vortex-states"], + [21, "v1", "vortex-states"] + ], + "update-mood-nestb": [[[25, 99], "gp", "nestb-states"]], + "set-nestb-purple!": [[10, "v1", "nestb-states"]], + "get-nestb-purple": [[8, "v1", "nestb-states"]], + "init-mood-consiteb": [[[0, 5], "v1", "consiteb-states"]], + "update-mood-consiteb": [[[22, 117], "gp", "consiteb-states"]], + "init-mood-castle": [[3, "v1", "castle-states"]], + "update-mood-castle": [[[13, 109], "s5", "castle-states"]], + "set-castle-electricity-scale!": [[10, "v1", "castle-states"]], + "init-mood-ruins": [[[1, 22], "gp", "ruins-states"]], + "init-mood-strip": [[[0, 22], "gp", "strip-states"]], + "update-mood-strip": [[[22, 79], "s4", "strip-states"]], + "init-mood-ctysluma": [[[0, 29], "gp", "ctysluma-states"]], + "update-mood-ctysluma": [[[23, 81], "gp", "ctysluma-states"]], + "update-mood-ctyslumb": [[[19, 58], "s5", "ctyslumb-states"]], + "init-mood-ctyslumc": [[[0, 22], "gp", "ctyslumc-states"]], + "update-mood-ctyslumc": [[[19, 46], "gp", "ctyslumc-states"]], + "init-mood-ctyport": [[[1, 11], "gp", "ctyport-states"]], + "init-mood-ctyport-no-part": [[1, "v1", "ctyport-states"]], + "update-mood-ctyport": [[[23, 70], "s5", "ctyport-states"]], + "update-mood-ctymarkb": [[[23, 76], "gp", "ctymarkb-states"]], + "init-mood-palcab": [[3, "v1", "palcab-states"]], + "update-mood-palcab": [[[23, 53], "s4", "palcab-states"]], + "set-palcab-turret-flash!": [[10, "v1", "palcab-states"]], + "update-mood-stadiumb": [[[22, 61], "gp", "stadiumb-states"]], + "init-mood-mountain": [[[0, 77], "gp", "mountain-states"]], + "update-mood-mountain": [[[19, 83], "gp", "mountain-states"]], + "init-mood-atoll": [[2, "v1", "atoll-states"]], + "update-mood-atoll": [[[19, 48], "s4", "atoll-states"]], + "set-atoll-explosion!": [[10, "v1", "atoll-states"]], + "init-mood-drill": [[1, "v1", "drill-states"]], + "update-mood-drill": [[[22, 121], "gp", "drill-states"]], + "set-drill-fire-floor!": [ + [9, "v1", "drill-states"], + [19, "v1", "drill-states"] + ], + "set-drill-electricity-scale!": [ + [12, "v1", "drill-states"], + [25, "v1", "drill-states"] + ], + "init-mood-drillb": [[1, "v1", "drillb-states"]], + "update-mood-drillb": [[[17, 93], "gp", "drillb-states"]], + "update-mood-casboss": [[[22, 46], "s4", "casboss-states"]], + "set-casboss-explosion!": [[10, "v1", "casboss-states"]], + "update-mood-caspad": [[[19, 77], "gp", "caspad-states"]], + "init-mood-palroof": [[[0, 7], "v1", "palroof-states"]], + "set-palroof-electricity-scale!": [[12, "v1", "palroof-states"]], + "update-mood-palent": [[[18, 43], "s5", "palent-states"]], + "set-palent-turret-flash!": [[13, "v1", "palent-states"]], + "init-mood-nest": [[1, "v1", "nest-states"]], + "update-mood-nest": [[[21, 72], "s5", "nest-states"]], + "set-nest-green-flag!": [[9, "v1", "nest-states"]], + "init-mood-village1": [[[0, 4], "v1", "village1-states"]], + "update-mood-village1": [[[21, 66], "gp", "village1-states"]], + "clear-village1-interp!": [[[9, 11], "v1", "village1-states"]], + "set-village1-interp!": [[9, "v1", "village1-states"]], + "update-mood-consite": [[[84, 110], "s4", "consite-states"]], + "set-consite-flash!": [[10, "v1", "consite-states"]], + "update-mood-mincan": [[[18, 22], "v1", "mincan-states"]], + "set-mincan-beam!": [[13, "v1", "mincan-states"]], + "copy-mood-exterior-ambi": [ + [[12, 16], "a2", "mood-context"], + [[13, 16], "v1", "mood-context"] + ], + "update-mood-light": [[[6, 144], "gp", "light-state"]], + "update-mood-lava": [[[6, 36], "gp", "lava-state"]], + "update-mood-flicker": [[[1, 58], "gp", "flicker-state"]], + "update-mood-florescent": [[[1, 48], "gp", "florescent-state"]], + "update-mood-electricity": [[[3, 19], "gp", "electricity-state"]], + "update-mood-pulse": [[[5, 27], "gp", "pulse-state"]], + "update-mood-strobe": [[[2, 42], "gp", "strobe-state"]], + "update-mood-flames": [[[5, 102], "gp", "flames-state"]], + "(method 9 mood-control)": [[636, "v0", "sound-rpc-set-param"]], + "(method 27 com-airlock)": [[35, "v1", "(array string)"]], + "(code close com-airlock)": [ + [190, "v0", "sound-rpc-set-param"], + [297, "v0", "sound-rpc-set-param"], + [389, "v0", "sound-rpc-set-param"] + ], + "(code open com-airlock)": [ + [117, "v0", "sound-rpc-set-param"], + [226, "v0", "sound-rpc-set-param"], + [420, "v0", "sound-rpc-set-param"], + [440, "v0", "sound-rpc-set-param"] + ], + // placeholder + "placeholder-do-not-add-below": [] } diff --git a/decompiler/types2/types2.cpp b/decompiler/types2/types2.cpp index 68f46ca442..59f5920231 100644 --- a/decompiler/types2/types2.cpp +++ b/decompiler/types2/types2.cpp @@ -687,8 +687,8 @@ end_type_pass: input.func->ir2.env.types_succeeded = true; auto last_type = out.op_end_types.back().get(Register(Reg::GPR, Reg::V0)).typespec(); if (last_type != input.function_type.last_arg()) { - input.func->warnings.info("Return type mismatch {} vs {}.", last_type.print(), - input.function_type.last_arg().print()); + input.func->warnings.warning("Return type mismatch {} vs {}.", last_type.print(), + input.function_type.last_arg().print()); } } diff --git a/goal_src/jak2/engine/collide/collide-shape-h.gc b/goal_src/jak2/engine/collide/collide-shape-h.gc index 529570bc58..21cb3f1e16 100644 --- a/goal_src/jak2/engine/collide/collide-shape-h.gc +++ b/goal_src/jak2/engine/collide/collide-shape-h.gc @@ -208,6 +208,7 @@ :flag-assert #x900000020 ) + (deftype collide-rider-pool (basic) ((alloc-count int32 :offset-assert 4) (riders collide-rider 20 :inline :offset-assert 16) @@ -221,6 +222,8 @@ ) ) + +;; WARN: Return type mismatch int vs none. (defmethod prepare collide-rider-pool ((obj collide-rider-pool)) "Gets this pool ready to be used to allow allocations. This should be called once at the start of every frame." (set! (-> obj alloc-count) 0) @@ -239,10 +242,15 @@ :flag-assert #x900000020 ) + (kmemopen global "collide-lists") + (define *collide-hit-by-player-list* (new 'global 'engine 'collide-hit-by-player-list 640 connection)) + (define *collide-hit-by-others-list* (new 'global 'engine 'collide-hit-by-others-list 768 connection)) + (define *collide-player-list* (new 'global 'engine 'collide-player-list 32 connection)) + (kmemclose) (deftype overlaps-others-params (structure) @@ -258,6 +266,7 @@ :flag-assert #x900000018 ) + (deftype move-above-ground-params (structure) ((gnd-collide-with collide-spec :offset-assert 0) (popup float :offset-assert 4) @@ -276,10 +285,11 @@ :flag-assert #x90000006c ) + (deftype collide-prim-core (structure) ((world-sphere vector :inline :offset-assert 0) (collide-as collide-spec :offset-assert 16) - (collide-with uint32 :offset-assert 20) + (collide-with collide-spec :offset-assert 20) (action collide-action :offset-assert 24) (prim-type prim-type :offset-assert 28) (unused1 uint8 3 :offset-assert 29) @@ -290,6 +300,7 @@ :flag-assert #x900000020 ) + (deftype collide-shape-prim (basic) ((cshape collide-shape :offset-assert 4) (prim-id uint32 :offset-assert 8) @@ -324,6 +335,7 @@ ) ) + (deftype collide-shape-prim-sphere (collide-shape-prim) ((pat pat-surface :offset 64) (nav-radius float :offset 68) @@ -351,6 +363,7 @@ ) ) + (deftype collide-shape-prim-group (collide-shape-prim) ((num-children uint8 :offset 64) (num-alloc-children uint8 :offset 65) @@ -364,6 +377,7 @@ ) ) + (deftype collide-shape (trsqv) ((actor-hash-index int16 :offset 12) (process process :offset-assert 140) @@ -418,6 +432,7 @@ ) ) + (deftype collide-shape-moving (collide-shape) ((rider-time time-frame :offset-assert 200) (rider-last-move vector :inline :offset-assert 208) @@ -474,13 +489,14 @@ (set! (-> v0-0 prim-id) arg1) (set! (-> v0-0 prim-core action) (collide-action)) (set! (-> v0-0 prim-core collide-as) (collide-spec)) - (set! (-> v0-0 prim-core collide-with) (the-as uint 0)) + (set! (-> v0-0 prim-core collide-with) (collide-spec)) (set! (-> v0-0 transform-index) -2) (set! (-> v0-0 prim-core prim-type) (prim-type prim)) v0-0 ) ) +;; WARN: Return type mismatch collide-shape-prim vs collide-shape-prim-sphere. (defmethod new collide-shape-prim-sphere ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint)) (let ((v0-0 ((method-of-type collide-shape-prim new) allocation type-to-make arg0 arg1 80))) (set! (-> (the-as collide-shape-prim-sphere v0-0) pat) @@ -491,6 +507,7 @@ ) ) +;; WARN: Return type mismatch collide-shape-prim vs collide-shape-prim-mesh. (defmethod new collide-shape-prim-mesh ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint) (arg2 uint)) (let ((v0-0 ((method-of-type collide-shape-prim new) allocation type-to-make arg0 arg2 80))) (set! (-> (the-as collide-shape-prim-mesh v0-0) mesh) #f) @@ -501,6 +518,7 @@ ) ) +;; WARN: Return type mismatch collide-shape-prim vs collide-shape-prim-group. (defmethod new collide-shape-prim-group ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint) (arg2 int)) (let ((v0-0 ((method-of-type collide-shape-prim new) allocation type-to-make arg0 (the-as uint arg2) 80))) (set! (-> (the-as collide-shape-prim-group v0-0) num-children) arg1) @@ -513,6 +531,7 @@ ) ) +;; WARN: Return type mismatch uint8 vs int. (defmethod length collide-shape-prim-group ((obj collide-shape-prim-group)) (the-as int (-> obj num-children)) ) @@ -565,6 +584,7 @@ ) ) +;; WARN: Return type mismatch collide-shape vs collide-shape-moving. (defmethod new collide-shape-moving ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 collide-list-enum)) (let ((v0-0 ((method-of-type collide-shape new) allocation type-to-make arg0 arg1))) (set! (-> (the-as collide-shape-moving v0-0) gspot-pos y) -40959590.0) @@ -602,3 +622,8 @@ (define-perm *collide-rider-pool* collide-rider-pool (new 'global 'collide-rider-pool)) +0 + + + + diff --git a/goal_src/jak2/engine/debug/default-menu.gc b/goal_src/jak2/engine/debug/default-menu.gc index 36bff4030a..5ff0f8c5c1 100644 --- a/goal_src/jak2/engine/debug/default-menu.gc +++ b/goal_src/jak2/engine/debug/default-menu.gc @@ -5,5 +5,7 @@ ;; name in dgo: default-menu ;; dgos: ENGINE, GAME +(declare-type debug-menu-context basic) + ;; DECOMP BEGINS diff --git a/goal_src/jak2/engine/entity/entity-h.gc b/goal_src/jak2/engine/entity/entity-h.gc index 6d0b15c9cc..65578d3a70 100644 --- a/goal_src/jak2/engine/entity/entity-h.gc +++ b/goal_src/jak2/engine/entity/entity-h.gc @@ -26,6 +26,10 @@ ;; NOTE - for cam-start (define-extern reset-cameras (function none)) +;; NOTE - for airlock +(define-extern process-entity-status! (function process entity-perm-status symbol int)) +(define-extern process-drawable-from-entity! (function process-drawable entity-actor none)) + ;; DECOMP BEGINS (define *generate-actor-vis* #f) diff --git a/goal_src/jak2/engine/game/task/game-task-h.gc b/goal_src/jak2/engine/game/task/game-task-h.gc index d298103918..461bc03e98 100644 --- a/goal_src/jak2/engine/game/task/game-task-h.gc +++ b/goal_src/jak2/engine/game/task/game-task-h.gc @@ -5,5 +5,136 @@ ;; name in dgo: game-task-h ;; dgos: ENGINE, GAME +;; +++game-task +(defenum game-task + :type uint8 + :bitfield #f + (none 0) + (complete 1) + (dummy0 2) + (eco-blue-button 3) + (eco-yellow-button 4) + (eco-red-button 5) + (fortress-escape 6) + (city-help-kid 7) + (city-vehicle-training 8) + (ruins-tower 9) + (atoll-water 10) + (fortress-dump 11) + (city-krew-delivery 12) + (city-red-gun-training 13) + (atoll-sig 14) + (sewer-enemy 15) + (strip-rescue 16) + (atoll-battle 17) + (mountain-lens 18) + (mountain-gear 19) + (mountain-shard 20) + (mountain-collection 21) + (city-keira-delivery 22) + (stadium-board1 23) + (city-krew-collection 24) + (city-yellow-gun-training 25) + (drill-eggs 26) + (city-power 27) + (palace-cable 28) + (palace-boss 29) + (city-shuttle 30) + (ruins-enemy 31) + (city-blue-gun-training 32) + (forest-scouts 33) + (city-escort-kid 34) + (dig-knock-down 35) + (strip-grenade 36) + (drill-ship 37) + (city-port-run 38) + (city-meet-brutter 39) + (sewer-board 40) + (forest-hunt 41) + (city-intercept-tanker 42) + (stadium-race-class3 43) + (city-protect-water-slums 44) + (dig-find-totem 45) + (city-destroy-guard-vehicles 46) + (city-play-onin-game 47) + (canyon-insert-items 48) + (tomb-poles 49) + (tomb-water 50) + (tomb-boss 51) + (fortress-save-friends 52) + (sewer-escort 53) + (city-dark-gun-training 54) + (stadium-race-class2 55) + (city-stop-bomb-bots 56) + (city-errol-challenge 57) + (strip-drop 58) + (ruins-mech 59) + (forest-protect 60) + (drill-mech 61) + (city-save-lurkers 62) + (stadium-race-class 63) + (palace-sneak-in 64) + (castle-break-in 65) + (castle-boss 66) + (city-whack 67) + (under-mech 68) + (under-sig 69) + (city-defend-stadium 70) + (consite-find-baron 71) + (nest-get-to-gun 72) + (nest-enter 73) + (nest-boss 74) + (city-win 75) + (city-oracle 76) + (city-burning-bush-ring-1 77) + (city-burning-bush-get-to-1 78) + (city-burning-bush-get-to-2 79) + (city-burning-bush-get-to-3 80) + (city-burning-bush-get-to-4 81) + (city-burning-bush-collection-1 82) + (city-burning-bush-racepoint-1 83) + (city-burning-bush-ring-2 84) + (city-burning-bush-get-to-5 85) + (city-burning-bush-get-to-6 86) + (city-burning-bush-shuttle-1 87) + (city-burning-bush-get-to-7 88) + (city-burning-bush-get-to-8 89) + (city-burning-bush-get-to-9 90) + (city-burning-bush-collection-2 91) + (city-burning-bush-get-to-10 92) + (city-burning-bush-get-to-11 93) + (city-burning-bush-ring-3 94) + (city-burning-bush-get-to-12 95) + (city-burning-bush-bombbot-1 96) + (city-burning-bush-get-to-13 97) + (city-burning-bush-get-to-14 98) + (city-burning-bush-get-to-15 99) + (city-burning-bush-collection-3 100) + (city-burning-bush-race-errol 101) + (city-burning-bush-race-port 102) + (stadium-burning-bush-race-board 103) + (stadium-burning-bush-race-class3 104) + (stadium-burning-bush-race-class2 105) + (stadium-burning-bush-race-class1 106) + (stadium-burning-bush-race-class3-r 107) + (stadium-burning-bush-race-class2-r 108) + (stadium-burning-bush-race-class1-r 109) + (max 110)) +;; ---game-task + +;; +++game-task-node +(defenum game-task-node + :type uint32 + :bitfield #f + (dig-knock-down-resolution 113) + (tomb-boss-torches 167) + (fortress-save-friends-resolution 172) + (drill-mech-resolution 204) + (drill-mech-started-smashing 205)) +;; ---game-task-node + +;; NOTE - for mood-funcs +(define-extern task-node-closed? (function game-task-node symbol)) + ;; DECOMP BEGINS diff --git a/goal_src/jak2/engine/game/task/task-control-h.gc b/goal_src/jak2/engine/game/task/task-control-h.gc index ed16c2fc18..9dd0368492 100644 --- a/goal_src/jak2/engine/game/task/task-control-h.gc +++ b/goal_src/jak2/engine/game/task/task-control-h.gc @@ -5,123 +5,6 @@ ;; name in dgo: task-control-h ;; dgos: ENGINE, GAME - -(defenum game-task - :type uint8 - :bitfield #f - (none 0) - (complete 1) - (dummy0 2) - (eco-blue-button 3) - (eco-yellow-button 4) - (eco-red-button 5) - (fortress-escape 6) - (city-help-kid 7) - (city-vehicle-training 8) - (ruins-tower 9) - (atoll-water 10) - (fortress-dump 11) - (city-krew-delivery 12) - (city-red-gun-training 13) - (atoll-sig 14) - (sewer-enemy 15) - (strip-rescue 16) - (atoll-battle 17) - (mountain-lens 18) - (mountain-gear 19) - (mountain-shard 20) - (mountain-collection 21) - (city-keira-delivery 22) - (stadium-board1 23) - (city-krew-collection 24) - (city-yellow-gun-training 25) - (drill-eggs 26) - (city-power 27) - (palace-cable 28) - (palace-boss 29) - (city-shuttle 30) - (ruins-enemy 31) - (city-blue-gun-training 32) - (forest-scouts 33) - (city-escort-kid 34) - (dig-knock-down 35) - (strip-grenade 36) - (drill-ship 37) - (city-port-run 38) - (city-meet-brutter 39) - (sewer-board 40) - (forest-hunt 41) - (city-intercept-tanker 42) - (stadium-race-class3 43) - (city-protect-water-slums 44) - (dig-find-totem 45) - (city-destroy-guard-vehicles 46) - (city-play-onin-game 47) - (canyon-insert-items 48) - (tomb-poles 49) - (tomb-water 50) - (tomb-boss 51) - (fortress-save-friends 52) - (sewer-escort 53) - (city-dark-gun-training 54) - (stadium-race-class2 55) - (city-stop-bomb-bots 56) - (city-errol-challenge 57) - (strip-drop 58) - (ruins-mech 59) - (forest-protect 60) - (drill-mech 61) - (city-save-lurkers 62) - (stadium-race-class 63) - (palace-sneak-in 64) - (castle-break-in 65) - (castle-boss 66) - (city-whack 67) - (under-mech 68) - (under-sig 69) - (city-defend-stadium 70) - (consite-find-baron 71) - (nest-get-to-gun 72) - (nest-enter 73) - (nest-boss 74) - (city-win 75) - (city-oracle 76) - (city-burning-bush-ring-1 77) - (city-burning-bush-get-to-1 78) - (city-burning-bush-get-to-2 79) - (city-burning-bush-get-to-3 80) - (city-burning-bush-get-to-4 81) - (city-burning-bush-collection-1 82) - (city-burning-bush-racepoint-1 83) - (city-burning-bush-ring-2 84) - (city-burning-bush-get-to-5 85) - (city-burning-bush-get-to-6 86) - (city-burning-bush-shuttle-1 87) - (city-burning-bush-get-to-7 88) - (city-burning-bush-get-to-8 89) - (city-burning-bush-get-to-9 90) - (city-burning-bush-collection-2 91) - (city-burning-bush-get-to-10 92) - (city-burning-bush-get-to-11 93) - (city-burning-bush-ring-3 94) - (city-burning-bush-get-to-12 95) - (city-burning-bush-bombbot-1 96) - (city-burning-bush-get-to-13 97) - (city-burning-bush-get-to-14 98) - (city-burning-bush-get-to-15 99) - (city-burning-bush-collection-3 100) - (city-burning-bush-race-errol 101) - (city-burning-bush-race-port 102) - (stadium-burning-bush-race-board 103) - (stadium-burning-bush-race-class3 104) - (stadium-burning-bush-race-class2 105) - (stadium-burning-bush-race-class1 106) - (stadium-burning-bush-race-class3-r 107) - (stadium-burning-bush-race-class2-r 108) - (stadium-burning-bush-race-class1-r 109) - (max 110) - ) - (defenum game-task-actor :bitfield #f :type uint8 @@ -627,6 +510,7 @@ ) ) +;; WARN: Return type mismatch int vs game-task. (defun c-string->game-task ((arg0 string)) (the-as game-task (cond ((string= arg0 "GAME_TASK_FOREST_PROTECT") @@ -1226,21 +1110,6 @@ :flag-assert #x900000010 ) -(defmethod inspect game-task-event ((obj game-task-event)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tactor: #x~X : ~S~%" (-> obj actor) (game-task-actor->string (-> obj actor))) - (format #t "~1Taction: #x~X : ~S~%" (-> obj action) (game-task-action->string (-> obj action))) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Ticon: ~D~%" (-> obj icon)) - (format #t "~1Tscene: ~A~%" (-> obj scene)) - (format #t "~1Tdistance: (meters ~m)~%" (-> obj distance)) - (label cfg-4) - obj - ) (deftype task-manager-info (structure) ((mask task-manager-mask :offset-assert 0) @@ -1276,64 +1145,8 @@ :flag-assert #x900000080 ) -(defmethod inspect task-manager-info ((obj task-manager-info)) - (when (not obj) - (set! obj obj) - (goto cfg-16) - ) - (format #t "[~8x] ~A~%" obj 'task-manager-info) - (format #t "~1Tmask: #x~X : (task-manager-mask " (-> obj mask)) - (let ((s5-0 (-> obj mask))) - (if (= (logand s5-0 (task-manager-mask intro-scene)) (task-manager-mask intro-scene)) - (format #t "intro-scene ") - ) - (if (= (logand s5-0 (task-manager-mask resolution-scene)) (task-manager-mask resolution-scene)) - (format #t "resolution-scene ") - ) - (if (= (logand s5-0 (task-manager-mask fail-message)) (task-manager-mask fail-message)) - (format #t "fail-message ") - ) - (if (= (logand s5-0 (task-manager-mask begin-sphere)) (task-manager-mask begin-sphere)) - (format #t "begin-sphere ") - ) - (if (= (logand s5-0 (task-manager-mask retry-message)) (task-manager-mask retry-message)) - (format #t "retry-message ") - ) - (if (= (logand s5-0 (task-manager-mask end-sphere)) (task-manager-mask end-sphere)) - (format #t "end-sphere ") - ) - ) - (format #t ")~%") - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tmanager: ~`handle`P~%" (-> obj manager)) - (format #t "~1Tfail-message: ~D~%" (-> obj fail-message)) - (format #t "~1Tretry-message: ~D~%" (-> obj retry-message)) - (format #t "~1Tintro-scene: ~A~%" (-> obj intro-scene)) - (format #t "~1Tresolution-scene: ~A~%" (-> obj resolution-scene)) - (format #t "~1Tresolution-scene-continue: ~A~%" (-> obj resolution-scene-continue)) - (format #t "~1Tretry-continue: ~A~%" (-> obj retry-continue)) - (format #t "~1Tfail-continue: ~A~%" (-> obj fail-continue)) - (format #t "~1Tinit-hook: ~A~%" (-> obj init-hook)) - (format #t "~1Tcleanup-hook: ~A~%" (-> obj cleanup-hook)) - (format #t "~1Tupdate-hook: ~A~%" (-> obj update-hook)) - (format #t "~1Tcode-hook: ~A~%" (-> obj code-hook)) - (format #t "~1Tcomplete-hook: ~A~%" (-> obj complete-hook)) - (format #t "~1Tfail-hook: ~A~%" (-> obj fail-hook)) - (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~1Tfinal-node: ~D~%" (-> obj final-node)) - (format #t "~1Ttime-limit: ~D~%" (-> obj time-limit)) - (format #t "~1Tsphere-count: ~D~%" (-> obj sphere-count)) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tintro-delay: ~D~%" (-> obj intro-delay)) - (format #t "~1Tsphere-array: #x~X~%" (-> obj sphere-array)) - (format #t "~1Ton-complete: ~A~%" (-> obj on-complete)) - (format #t "~1Ton-fail: ~A~%" (-> obj on-fail)) - (format #t "~1Tbegin-sphere: #~%" (-> obj begin-sphere)) - (format #t "~1Tend-sphere: #~%" (-> obj end-sphere)) - (label cfg-16) - obj - ) +;; WARN: Return type mismatch object vs none. (defun-debug game-task-node-flag->string ((arg0 game-task-node-flag)) (if (= (logand arg0 (game-task-node-flag clear-task-mask)) (game-task-node-flag clear-task-mask)) (format #t "clear-task-mask ") @@ -1508,99 +1321,6 @@ ) ) -(defmethod inspect game-task-node-info ((obj game-task-node-info)) - (when (not obj) - (set! obj obj) - (goto cfg-45) - ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Ttask: #x~X : ~S~%" (-> obj task) (game-task->string (-> obj task))) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Twhen-open: ~A~%" (-> obj when-open)) - (format #t "~1Tflags: #x~X : (game-task-node-flag " (-> obj flags)) - (game-task-node-flag->string (-> obj flags)) - (format #t ")~%") - (format #t "~1Tparent-node[4] @ #x~X~%" (-> obj parent-node)) - (dotimes (s5-1 4) - (format #t "~T [~D]~1Tparent-node: ~D~%" s5-1 (-> obj parent-node s5-1)) - ) - (format #t "~1Ttask-mask: #x~X : (task-mask " (-> obj task-mask)) - (let ((s5-2 (-> obj task-mask))) - (if (= (logand s5-2 (task-mask task0)) (task-mask task0)) - (format #t "task0 ") - ) - (if (= (logand s5-2 (task-mask task2)) (task-mask task2)) - (format #t "task2 ") - ) - (if (= (logand s5-2 (task-mask task4)) (task-mask task4)) - (format #t "task4 ") - ) - (if (= (logand s5-2 (task-mask task6)) (task-mask task6)) - (format #t "task6 ") - ) - (if (= (logand s5-2 (task-mask ctywide)) (task-mask ctywide)) - (format #t "ctywide ") - ) - (if (= (logand s5-2 (task-mask never)) (task-mask never)) - (format #t "never ") - ) - (if (= (logand (task-mask movie1) s5-2) (task-mask movie1)) - (format #t "movie1 ") - ) - (if (= (logand s5-2 (task-mask dummy1)) (task-mask dummy1)) - (format #t "dummy1 ") - ) - (if (= (logand s5-2 (task-mask primary0)) (task-mask primary0)) - (format #t "primary0 ") - ) - (if (= (logand s5-2 (task-mask task1)) (task-mask task1)) - (format #t "task1 ") - ) - (if (= (logand s5-2 (task-mask task3)) (task-mask task3)) - (format #t "task3 ") - ) - (if (= (logand s5-2 (task-mask task5)) (task-mask task5)) - (format #t "task5 ") - ) - (if (= (logand s5-2 (task-mask task7)) (task-mask task7)) - (format #t "task7 ") - ) - (if (= (logand (task-mask movie2) s5-2) (task-mask movie2)) - (format #t "movie2 ") - ) - (if (= (logand s5-2 (task-mask dummy2)) (task-mask dummy2)) - (format #t "dummy2 ") - ) - (if (= (logand s5-2 (task-mask done)) (task-mask done)) - (format #t "done ") - ) - (if (= (logand s5-2 (task-mask special)) (task-mask special)) - (format #t "special ") - ) - (if (= (logand (task-mask movie0) s5-2) (task-mask movie0)) - (format #t "movie0 ") - ) - (if (= (logand s5-2 (task-mask dummy0)) (task-mask dummy0)) - (format #t "dummy0 ") - ) - ) - (format #t ")~%") - (format #t "~1Ton-open: ~A~%" (-> obj on-open)) - (format #t "~1Tinfo: #~%" (-> obj info)) - (format #t "~1Tborrow: ~A~%" (-> obj borrow)) - (format #t "~1Topen?: ~A~%" (-> obj open?)) - (format #t "~1Ton-close: ~A~%" (-> obj on-close)) - (format #t "~1Tclose-time: ~D~%" (-> obj close-time)) - (format #t "~1Tdeath-count: ~D~%" (-> obj death-count)) - (format #t "~1Tgem-count: ~D~%" (-> obj gem-count)) - (format #t "~1Tskill-count: ~D~%" (-> obj skill-count)) - (format #t "~1Tsuck-death-count: ~D~%" (-> obj suck-death-count)) - (format #t "~1Tadd: #x~X : ~S~%" (-> obj add) (game-task-node-command->string (-> obj add))) - (format #t "~1Tdescription: ~D~%" (-> obj description)) - (label cfg-45) - obj - ) (deftype game-task-info (basic) ((name basic :offset-assert 4) @@ -1617,6 +1337,7 @@ :flag-assert #x900000020 ) + (deftype game-task-control (basic) ((counter uint32 :offset-assert 4) (actor game-task-actor :offset-assert 8) @@ -1631,21 +1352,7 @@ ) ) -(defmethod inspect game-task-control ((obj game-task-control)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcounter: ~D~%" (-> obj counter)) - (format #t "~1Tactor: #x~X : ~S~%" (-> obj actor) (game-task-actor->string (-> obj actor))) - (format #t "~1Tcurrent-node: ~D~%" (-> obj current-node)) - (format #t "~1Tcurrent-event: ~A~%" (-> obj current-event)) - (label cfg-4) - obj - ) -;; definition of type task-manager (deftype task-manager (process) ((node-info basic :offset-assert 128) (info task-manager-info :offset-assert 132) @@ -1713,9 +1420,10 @@ ) -;; definition for symbol *traffic-engine*, type object (define *traffic-engine* (the-as object #f)) +0 + diff --git a/goal_src/jak2/engine/gfx/mood/mood-funcs.gc b/goal_src/jak2/engine/gfx/mood/mood-funcs.gc index 68798d5bea..165d8725fe 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-funcs.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-funcs.gc @@ -7,3 +7,1694 @@ ;; DECOMP BEGINS +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-default time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + 0 + (none) + ) + +(defun get-sphere-interp ((arg0 sphere) (arg1 vector) (arg2 float) (arg3 float)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + 0.0 + (set! (-> v1-0 quad) (-> arg0 quad)) + (vector-! v1-0 arg1 v1-0) + (let ((f1-0 (vector-length v1-0))) + (/ (fmax 0.0 (fmin (- f1-0 arg2) arg3)) arg3) + ) + ) + ) + +(deftype ruins-states (structure) + ((light light-state :inline :offset-assert 0) + (spec-0 sp-field-init-spec :offset-assert 8) + (spec-1 sp-field-init-spec :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +;; WARN: Return type mismatch sp-field-init-spec vs none. +(defun init-mood-ruins ((arg0 mood-context)) + (let ((gp-0 (the-as ruins-states (-> arg0 state)))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (let ((a0-1 (-> *part-id-table* 1))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-0) (get-field-spec-by-id a0-1 (sp-field-id spt-a))) + ) + ) + (let ((a0-2 (-> *part-id-table* 2))) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 spec-1) (get-field-spec-by-id a0-2 (sp-field-id spt-a))) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ruins time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as (pointer float) (-> arg0 state)))) + (update-mood-light arg0 6 0 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> (the-as ruins-states gp-1) spec-0)) + (set! (-> (the-as ruins-states gp-1) spec-0 initial-valuef) + (* 32.0 (-> (the-as ruins-states gp-1) light fade)) + ) + ) + (if (nonzero? (-> (the-as ruins-states gp-1) spec-1)) + (set! (-> (the-as ruins-states gp-1) spec-1 initial-valuef) + (* 8.0 (-> (the-as ruins-states gp-1) light fade)) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype strip-states (structure) + ((light0 light-state :inline :offset-assert 0) + (light1 light-state :inline :offset-assert 8) + (spec-0 sp-field-init-spec :offset-assert 16) + (spec-1 sp-field-init-spec :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + + +;; WARN: Return type mismatch sp-field-init-spec vs uint. +(defun init-mood-strip ((arg0 mood-context)) + (let ((gp-0 (the-as strip-states (-> arg0 state)))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (let ((a0-1 (-> *part-id-table* 3))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-0) (get-field-spec-by-id a0-1 (sp-field-id spt-a))) + ) + ) + (let ((a0-2 (-> *part-id-table* 4))) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (the-as uint (when (nonzero? a0-2) + (let ((v0-1 (get-field-spec-by-id a0-2 (sp-field-id spt-a)))) + (set! (-> gp-0 spec-1) v0-1) + v0-1 + ) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-strip time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (set! (-> arg0 times 5 w) 1.0) + (let ((s4-1 (the-as (pointer float) (-> arg0 state)))) + (if (task-complete? *game-info* (game-task strip-grenade)) + (update-mood-light arg0 6 0 0.875 0.25 8.0 0.0 2.0) + (update-mood-light arg0 6 0 0.875 0.25 20.0 0.0 2.0) + ) + (update-mood-light arg0 7 8 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> (the-as strip-states s4-1) spec-0)) + (set! (-> (the-as strip-states s4-1) spec-0 initial-valuef) + (* 32.0 (-> (the-as strip-states s4-1) light1 fade)) + ) + ) + (if (nonzero? (-> (the-as strip-states s4-1) spec-1)) + (set! (-> (the-as strip-states s4-1) spec-1 initial-valuef) + (* 8.0 (-> (the-as strip-states s4-1) light1 fade)) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype ctywide-states (structure) + ((light light-state :inline :offset-assert 0) + (flame flames-state :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xf + :flag-assert #x90000000f + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctywide time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 2 8 0.5 0.0009765625 1.5) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-ctywide time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((v1-1 (level-get *level* 'ctywide))) + (cond + ((and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + (else + (update-mood-ctywide arg0 arg1 arg2) + (if (or (>= arg1 18.0) (>= 6.0 arg1)) + (set! (-> arg0 times 5 w) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype ctyind-states (structure) + ((light light-state :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyind time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (set! (-> arg0 times 6 w) 1.0) + (let ((f0-1 0.5)) + (let ((f1-0 1.0)) + (cond + ((or (>= 6.0 arg1) (>= arg1 18.0)) + (set! f0-1 f1-0) + ) + ((and (< 6.0 arg1) (< arg1 7.0)) + (+! f0-1 (* (- f1-0 f0-1) (- 7.0 arg1))) + ) + ((and (< 17.0 arg1) (< arg1 18.0)) + (+! f0-1 (* (- f1-0 f0-1) (+ -17.0 arg1))) + ) + ) + ) + (set! (-> arg0 times 7 w) f0-1) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + ) + 0 + (none) + ) + +(deftype ctysluma-states (structure) + ((light light-state :inline :offset-assert 0) + (neon light-state :inline :offset-assert 8) + (flame flames-state :inline :offset-assert 16) + (spec-0 sp-field-init-spec :offset-assert 24) + (spec-1 sp-field-init-spec :offset-assert 28) + (neon-min-bright float :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + + +(defun init-mood-ctysluma ((arg0 mood-context)) + (let ((gp-0 (the-as ctysluma-states (-> arg0 state)))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (let ((a0-1 (-> *part-id-table* 5))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-0) (get-field-spec-by-id a0-1 (sp-field-id spt-a))) + ) + ) + (let ((a0-2 (-> *part-id-table* 6))) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 spec-1) (get-field-spec-by-id a0-2 (sp-field-id spt-a))) + ) + ) + (let ((f0-0 (rand-vu-float-range 0.8 1.0))) + (set! (-> gp-0 neon-min-bright) f0-0) + f0-0 + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctysluma time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (!= arg2 -1) + (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as ctysluma-states (-> arg0 state)))) + (update-mood-flames arg0 6 1 16 0.5 0.001953125 2.0) + (update-mood-light arg0 7 8 (-> gp-1 neon-min-bright) 0.0 arg1 32.0 2.0) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> gp-1 spec-0)) + (set! (-> gp-1 spec-0 initial-valuef) (* 32.0 (-> gp-1 light fade))) + ) + (if (nonzero? (-> gp-1 spec-1)) + (set! (-> gp-1 spec-1 initial-valuef) (* 8.0 (-> gp-1 light fade))) + ) + (if (not (paused?)) + (set! (-> gp-1 neon-min-bright) (rand-vu-float-range 0.8 1.0)) + ) + ) + ) + 0 + (none) + ) + +(deftype ctyslumb-states (structure) + ((light light-state :inline :offset-assert 0) + (flame flames-state :inline :offset-assert 8) + (spec-0 sp-field-init-spec :offset-assert 16) + (spec-1 sp-field-init-spec :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + + +;; WARN: Return type mismatch sp-field-init-spec vs uint. +(defun init-mood-ctyslumb ((arg0 mood-context)) + (let ((gp-0 (-> arg0 state))) + (set! (-> gp-0 4) (the-as uint 0)) + (set! (-> gp-0 5) (the-as uint 0)) + (let ((a0-1 (-> *part-id-table* 7))) + (set! (-> gp-0 4) (the-as uint 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 4) (the-as uint (get-field-spec-by-id a0-1 (sp-field-id spt-a)))) + ) + ) + (let ((a0-2 (-> *part-id-table* 8))) + (set! (-> gp-0 5) (the-as uint 0)) + (the-as uint (when (nonzero? a0-2) + (let ((v0-1 (get-field-spec-by-id a0-2 (sp-field-id spt-a)))) + (set! (-> gp-0 5) (the-as uint v0-1)) + v0-1 + ) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyslumb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as ctyslumb-states (-> arg0 state)))) + (update-mood-flames arg0 6 1 8 0.5 0.001953125 2.0) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 7 w) 1.0) + (if (nonzero? (-> s5-1 spec-0)) + (set! (-> s5-1 spec-0 initial-valuef) (* 32.0 (-> s5-1 light fade))) + ) + (if (nonzero? (-> s5-1 spec-1)) + (set! (-> s5-1 spec-1 initial-valuef) (* 8.0 (-> s5-1 light fade))) + ) + ) + ) + 0 + (none) + ) + +(deftype ctyslumc-states (structure) + ((light light-state :inline :offset-assert 0) + (spec-0 sp-field-init-spec :offset-assert 8) + (spec-1 sp-field-init-spec :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +;; WARN: Return type mismatch sp-field-init-spec vs none. +(defun init-mood-ctyslumc ((arg0 mood-context)) + (let ((gp-0 (the-as ctyslumc-states (-> arg0 state)))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (let ((a0-1 (-> *part-id-table* 9))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-0) (get-field-spec-by-id a0-1 (sp-field-id spt-a))) + ) + ) + (let ((a0-2 (-> *part-id-table* 10))) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 spec-1) (get-field-spec-by-id a0-2 (sp-field-id spt-a))) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyslumc time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as ctyslumc-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> gp-1 spec-0)) + (set! (-> gp-1 spec-0 initial-valuef) (* 32.0 (-> gp-1 light fade))) + ) + (if (nonzero? (-> gp-1 spec-1)) + (set! (-> gp-1 spec-1 initial-valuef) (* 8.0 (-> gp-1 light fade))) + ) + ) + ) + 0 + (none) + ) + +(deftype ctyport-states (structure) + ((light light-state :inline :offset-assert 0) + (spec-0 sp-field-init-spec :offset-assert 8) + (neon-min-bright float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +;; WARN: Return type mismatch sp-field-init-spec vs uint. +(defun init-mood-ctyport ((arg0 mood-context)) + (let ((gp-0 (the-as ctyport-states (-> arg0 state)))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (let ((a0-1 (-> *part-id-table* 11))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (the-as uint (when (nonzero? a0-1) + (let ((v0-0 (get-field-spec-by-id a0-1 (sp-field-id spt-r)))) + (set! (-> gp-0 spec-0) v0-0) + v0-0 + ) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defun init-mood-ctyport-no-part ((arg0 mood-context)) + (set! (-> (the-as ctyport-states (-> arg0 state)) spec-0) (the-as sp-field-init-spec 0)) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyport time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (!= arg2 -1) + (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as ctyport-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (if (= (-> s5-1 neon-min-bright) 0.0) + 0.0 + 1.0 + ) + ) + (if (nonzero? (-> s5-1 spec-0)) + (set! (-> s5-1 spec-0 initial-valuef) (-> s5-1 neon-min-bright)) + ) + (set! (-> arg0 times 7 w) 1.0) + (when (not (paused?)) + (if (< (mod (-> *display* part-clock frame-counter) 600) 300) + (set! (-> s5-1 neon-min-bright) 0.0) + (set! (-> s5-1 neon-min-bright) (rand-vu-float-range 128.0 255.0)) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype ctymarka-states (structure) + ((light light-state :inline :offset-assert 0) + (blink float :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctymarka time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (-> arg0 state))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (the-as float (-> gp-1 2))) + (set! (-> arg0 times 7 w) 0.75) + (when (not (paused?)) + (let ((v1-11 (-> *display* part-clock frame-counter))) + (if (< (* 0.2 (the float (mod v1-11 600))) 60.0) + (set! (-> gp-1 2) (the-as uint 0.0)) + (set! (-> gp-1 2) (the-as uint 1.0)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype ctymarkb-states (structure) + ((light light-state :inline :offset-assert 0) + (blink float :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctymarkb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (!= arg2 -1) + (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as ctymarkb-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (-> gp-1 blink)) + (set! (-> arg0 times 7 w) 0.75) + (when (not (paused?)) + (let* ((v1-12 (-> *display* part-clock frame-counter)) + (f0-3 (* 0.2 (the float (mod v1-12 300)))) + ) + (cond + ((< f0-3 15.0) + (set! (-> gp-1 blink) (* 0.06666667 f0-3)) + ) + ((< 45.0 f0-3) + (set! (-> gp-1 blink) (* 0.06666667 (- 60.0 f0-3))) + ) + (else + (set! (-> gp-1 blink) 1.0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype palcab-states (structure) + ((light light-state :inline :offset-assert 0) + (turret-value float :offset-assert 8) + (electricity electricity-state :inline :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + + +(defun init-mood-palcab ((arg0 mood-context)) + (let ((v1-0 (the-as object (-> arg0 state))) + (f0-0 1.0) + ) + (set! (-> (the-as palcab-states v1-0) electricity scale) f0-0) + f0-0 + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-palcab time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (!= arg2 -1) + (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s4-1 (the-as palcab-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (-> s4-1 turret-value)) + (update-mood-electricity arg0 7 12 0.8 1.0) + (if (not (paused?)) + (set! (-> s4-1 turret-value) (fmax 0.0 (+ -0.2 (-> s4-1 turret-value)))) + ) + ) + (let ((a0-9 (new 'stack-no-clear 'sphere)) + (a1-3 (-> *math-camera* trans)) + ) + (set-vector! a0-9 786432.0 1818624.0 2498560.0 1.0) + (let ((f0-8 (- 1.0 (get-sphere-interp a0-9 a1-3 1024000.0 2048000.0)))) + (update-mood-weather! *mood-control* (+ 0.25 (* 0.75 f0-8)) (+ 0.5 (* 0.5 f0-8)) 30.0 30.0) + ) + ) + ) + 0 + (none) + ) + +(defun set-palcab-turret-flash! ((arg0 float)) + (let ((v1-1 (level-get *level* 'palcab))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as palcab-states v1-2) turret-value) f0-0) + f0-0 + ) + ) + ) + ) + +(deftype stadium-states (structure) + ((light light-state :inline :offset-assert 0) + (flame flames-state :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xf + :flag-assert #x90000000f + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-stadium-lights ((arg0 mood-context)) + (let ((a1-0 (-> arg0 light-group)) + (gp-0 (-> arg0 light-group 2)) + ) + (mem-copy! (the-as pointer gp-0) (the-as pointer a1-0) 192) + (set! (-> gp-0 dir0 extra x) 0.0) + (set! (-> gp-0 dir1 extra x) 0.0) + (set! (-> gp-0 dir2 extra x) 0.0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-stadium time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (update-stadium-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 1 8 0.5 0.001953125 2.0) + (set! (-> arg0 times 7 w) 1.0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-stadium time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((v1-1 (level-get *level* 'stadium))) + (cond + ((and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + (else + (copy-mood-exterior arg0) + (update-stadium-lights arg0) + (if (or (>= arg1 18.0) (>= 6.0 arg1)) + (set! (-> arg0 times 5 w) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype stadiumb-states (structure) + ((light light-state :inline :offset-assert 0) + (shield-count float :offset-assert 8) + (shield float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-stadiumb-lights ((arg0 mood-context)) + (let ((gp-0 (-> arg0 light-group))) + (let ((a0-1 (-> arg0 light-group 1))) + (mem-copy! (the-as pointer a0-1) (the-as pointer gp-0) 192) + ) + (set! (-> gp-0 0 dir0 extra x) 0.0) + (set! (-> gp-0 0 dir1 extra x) 0.0) + (set! (-> gp-0 0 dir2 extra x) 0.0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-stadiumb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (update-stadiumb-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as stadiumb-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (-> gp-1 shield)) + (set! (-> arg0 times 7 w) 1.0) + (when (not (paused?)) + (+! (-> gp-1 shield-count) (* 262144.0 (-> self clock seconds-per-frame))) + (set! (-> gp-1 shield) (+ 0.875 (* 0.125 (cos (-> gp-1 shield-count))))) + ) + ) + ) + 0 + (none) + ) + +(deftype skatea-states (structure) + ((light light-state :inline :offset-assert 0) + (flame flames-state :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xf + :flag-assert #x90000000f + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-skatea time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 1 8 0.5 0.0009765625 1.5) + (set! (-> arg0 times 7 w) 1.0) + ) + 0 + (none) + ) + +(deftype ltentout-states (structure) + ((light light-state :inline :offset-assert 0) + (flame flames-state :inline :offset-assert 8) + (totem flames-state :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x17 + :flag-assert #x900000017 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-ltentout-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group 2))) + (set-vector! (-> v1-0 dir0 color) 0.822 0.694 0.613 1.0) + (set-vector! (-> v1-0 ambi color) 0.21 0.188 0.163 1.0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ltentout time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (update-ltentout-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 1 8 0.75 0.0009765625 2.0) + (update-mood-flames arg0 7 1 16 0.333 0.001953125 2.0) + ) + 0 + (none) + ) + +(deftype mountain-states (structure) + ((light0 light-state :inline :offset-assert 0) + (light1 light-state :inline :offset-assert 8) + (spec-0 sp-field-init-spec :offset-assert 16) + (spec-1 sp-field-init-spec :offset-assert 20) + (spec-2 sp-field-init-spec :offset-assert 24) + (spec-3 sp-field-init-spec :offset-assert 28) + (spec-4 sp-field-init-spec :offset-assert 32) + (spec-5 sp-field-init-spec :offset-assert 36) + (spec-6 sp-field-init-spec :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + + +;; WARN: Return type mismatch sp-field-init-spec vs uint. +(defun init-mood-mountain ((arg0 mood-context)) + (let ((gp-0 (the-as mountain-states (-> arg0 state)))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-2) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-3) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-4) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-5) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-6) (the-as sp-field-init-spec 0)) + (let ((a0-1 (-> *part-id-table* 12))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-0) (get-field-spec-by-id a0-1 (sp-field-id spt-a))) + ) + ) + (let ((a0-2 (-> *part-id-table* 13))) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 spec-1) (get-field-spec-by-id a0-2 (sp-field-id spt-a))) + ) + ) + (let ((a0-3 (-> *part-id-table* 14))) + (set! (-> gp-0 spec-2) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-3) + (set! (-> gp-0 spec-2) (get-field-spec-by-id a0-3 (sp-field-id spt-a))) + ) + ) + (let ((a0-4 (-> *part-id-table* 15))) + (set! (-> gp-0 spec-3) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-4) + (set! (-> gp-0 spec-3) (get-field-spec-by-id a0-4 (sp-field-id spt-a))) + ) + ) + (let ((a0-5 (-> *part-id-table* 16))) + (set! (-> gp-0 spec-4) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-5) + (set! (-> gp-0 spec-4) (get-field-spec-by-id a0-5 (sp-field-id spt-a))) + ) + ) + (let ((a0-6 (-> *part-id-table* 17))) + (set! (-> gp-0 spec-5) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-6) + (set! (-> gp-0 spec-5) (get-field-spec-by-id a0-6 (sp-field-id spt-a))) + ) + ) + (let ((a0-7 (-> *part-id-table* 18))) + (set! (-> gp-0 spec-6) (the-as sp-field-init-spec 0)) + (the-as uint (when (nonzero? a0-7) + (let ((v0-6 (get-field-spec-by-id a0-7 (sp-field-id spt-a)))) + (set! (-> gp-0 spec-6) v0-6) + v0-6 + ) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-mountain time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as mountain-states (-> arg0 state)))) + (update-mood-light arg0 5 0 0.875 0.25 2.0 0.0 1.0) + (update-mood-light arg0 6 8 1.0 0.0 arg1 0.0 1.0) + (set! (-> arg0 times 7 w) 1.0) + (let* ((f0-1 (-> arg0 times 5 w)) + (f1-1 (* 24.0 f0-1)) + (f0-2 (* 20.0 f0-1)) + ) + (if (nonzero? (-> gp-1 spec-0)) + (set! (-> gp-1 spec-0 initial-valuef) f1-1) + ) + (if (nonzero? (-> gp-1 spec-1)) + (set! (-> gp-1 spec-1 initial-valuef) f0-2) + ) + (if (nonzero? (-> gp-1 spec-2)) + (set! (-> gp-1 spec-2 initial-valuef) f0-2) + ) + (if (nonzero? (-> gp-1 spec-3)) + (set! (-> gp-1 spec-3 initial-valuef) f0-2) + ) + (if (nonzero? (-> gp-1 spec-4)) + (set! (-> gp-1 spec-4 initial-valuef) f0-2) + ) + (if (nonzero? (-> gp-1 spec-5)) + (set! (-> gp-1 spec-5 initial-valuef) f0-2) + ) + (if (nonzero? (-> gp-1 spec-6)) + (set! (-> gp-1 spec-6 initial-valuef) f0-2) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype forest-states (structure) + ((light light-state :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-forest time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 0.875 0.25 2.0 0.0 1.0) + ) + 0 + (none) + ) + +(deftype atoll-states (structure) + ((light light-state :inline :offset-assert 0) + (explosion float :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + + +(defun init-mood-atoll ((arg0 mood-context)) + (let ((v1-0 (the-as object (-> arg0 state))) + (f0-0 0.0) + ) + (set! (-> (the-as atoll-states v1-0) explosion) f0-0) + f0-0 + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-atoll time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s4-1 (the-as atoll-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 7 w) (-> s4-1 explosion)) + (if (not (paused?)) + (seek! (-> s4-1 explosion) 0.0 (* 2.0 (-> self clock seconds-per-frame))) + ) + ) + ) + 0 + (none) + ) + +(defun set-atoll-explosion! ((arg0 float)) + (let ((v1-1 (level-get *level* 'atoll))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as atoll-states v1-2) explosion) f0-0) + f0-0 + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-atollext time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior-ambi arg0 #t) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (set-vector! (-> arg0 times 1) 1.0 1.0 1.0 1.0) + (set! (-> arg0 times 2 w) 0.0) + (set! (-> arg0 times 3 w) 0.0) + (set! (-> arg0 times 4 w) 0.0) + (set! (-> arg0 times 5 w) 0.0) + (set! (-> arg0 times 6 w) 0.0) + (set! (-> arg0 times 7 w) 0.0) + ) + 0 + (none) + ) + +(deftype drill-states (structure) + ((fire-floor float :offset-assert 0) + (fire-floor-fade float :offset-assert 4) + (fire-floor-flag symbol :offset-assert 8) + (flame flames-state :inline :offset-assert 12) + (electricity electricity-state 2 :inline :offset-assert 20) + (pulse pulse-state :inline :offset 52) + (light-flag basic :offset-assert 56) + ) + :method-count-assert 9 + :size-assert #x3c + :flag-assert #x90000003c + ) + + +(defun init-mood-drill ((arg0 mood-context)) + (set! (-> (the-as drill-states (-> arg0 state)) light-flag) #f) + #f + ) + +;; WARN: Return type mismatch int vs none. +(defun update-drill-lights ((arg0 mood-context)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((a1-0 (-> arg0 light-group)) + (s5-0 (-> arg0 light-group 1)) + (gp-0 (-> arg0 light-group 2)) + ) + (mem-copy! (the-as pointer s5-0) (the-as pointer a1-0) 192) + (let ((a0-2 (new 'static 'vector :x 0.902 :y 0.675)) + (v1-0 (-> s5-0 ambi color)) + ) + (let ((a1-1 (-> s5-0 ambi color)) + (f0-0 0.3) + ) + (.lvf vf2 (&-> a0-2 quad)) + (.lvf vf1 (&-> a1-1 quad)) + (let ((a0-3 f0-0)) + (.mov vf3 a0-3) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-0 quad) vf4) + ) + (let ((v1-1 (-> gp-0 dir0))) + (set! (-> v1-1 direction x) 0.0) + (set! (-> v1-1 direction y) 1.0) + (set! (-> v1-1 direction z) 0.0) + (set! (-> v1-1 direction w) 1.0) + ) + (set-vector! (-> gp-0 dir0 color) 0.3 0.3 0.35 1.0) + (set-vector! (-> gp-0 ambi color) 0.3 0.3 0.35 1.0) + (set! (-> gp-0 dir0 extra x) 0.5) + (set! (-> gp-0 ambi extra x) 0.5) + ) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-drill time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) + (copy-mood-exterior-ambi arg0 #t) + (update-drill-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as drill-states (-> arg0 state)))) + (update-mood-electricity arg0 2 20 0.75 1.0) + (update-mood-electricity arg0 3 36 0.75 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 4 w) (-> gp-1 fire-floor)) + (update-mood-flames arg0 6 1 12 0.9 0.0009765625 2.0) + (if (and (task-node-closed? (game-task-node drill-mech-resolution)) + (not (task-node-closed? (game-task-node drill-mech-started-smashing))) + ) + (update-mood-pulse arg0 7 52 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 16384.0) + ) + (when (not (paused?)) + (if (-> gp-1 fire-floor-flag) + (seek! (-> gp-1 fire-floor-fade) 1.5 (* 3.0 (-> self clock seconds-per-frame))) + (seek! (-> gp-1 fire-floor-fade) 0.5 (* 3.0 (-> self clock seconds-per-frame))) + ) + (set! (-> gp-1 fire-floor) + (+ (-> gp-1 fire-floor-fade) (* (-> gp-1 fire-floor-fade) (rand-vu-float-range 0.0 0.1))) + ) + ) + ) + ) + 0 + (none) + ) + +(defun set-drill-fire-floor! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'drillmid))) + (if v1-1 + (set! (-> (the-as drill-states (-> v1-1 mood-context state)) fire-floor-flag) arg0) + ) + ) + (let ((v1-4 (level-get *level* 'drillb))) + (when v1-4 + (set! (-> (the-as drill-states (-> v1-4 mood-context state)) fire-floor-flag) arg0) + arg0 + ) + ) + ) + +(defun set-drill-electricity-scale! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'drill))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as drill-states v1-2) electricity arg1 scale) arg0) + ) + ) + ) + (let ((v1-5 (level-get *level* 'drillmid))) + (when v1-5 + (let ((v1-6 (the-as object (-> v1-5 mood-context state))) + (f0-1 arg0) + ) + (set! (-> (the-as drill-states v1-6) electricity arg1 scale) f0-1) + f0-1 + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-drillmnt time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior-ambi arg0 #t) + (update-drill-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 *math-camera*)) + (set! (-> arg0 times 5 w) 1.0) + (if (not (paused?)) + (quaternion-rotate-y! + (-> s5-1 quat-other) + (-> s5-1 quat-other) + (* 273.06668 (-> self clock seconds-per-frame)) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype drillb-states (structure) + ((fire-floor float :offset-assert 0) + (fire-floor-fade float :offset-assert 4) + (fire-floor-flag symbol :offset-assert 8) + (pulse pulse-state :inline :offset-assert 12) + (light-flag symbol :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + + +(defun init-mood-drillb ((arg0 mood-context)) + (set! (-> (the-as drillb-states (-> arg0 state)) light-flag) #f) + #f + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-drillb time-of-day-proc ((arg0 mood-context)) + (copy-mood-exterior-ambi arg0 #f) + (update-drill-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as drillb-states (-> arg0 state)))) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 4 w) (-> gp-0 fire-floor)) + (if (and (task-node-closed? (game-task-node drill-mech-resolution)) + (not (task-node-closed? (game-task-node drill-mech-started-smashing))) + ) + (update-mood-pulse arg0 7 12 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 16384.0) + ) + (when (not (paused?)) + (if (-> gp-0 fire-floor-flag) + (seek! (-> gp-0 fire-floor-fade) 1.5 (* 3.0 (-> self clock seconds-per-frame))) + (seek! (-> gp-0 fire-floor-fade) 0.5 (* 3.0 (-> self clock seconds-per-frame))) + ) + (set! (-> gp-0 fire-floor) + (+ (-> gp-0 fire-floor-fade) (* (-> gp-0 fire-floor-fade) (rand-vu-float-range 0.0 0.1))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype casboss-states (structure) + ((light light-state :inline :offset-assert 0) + (explosion float :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + + +(defun update-casboss-lights ((arg0 mood-context)) + (let ((s4-0 (-> arg0 light-group 1)) + (s5-0 (-> arg0 light-group 2)) + (gp-0 (-> arg0 light-group 3)) + ) + (let ((v1-0 (-> s4-0 dir0))) + (set! (-> v1-0 direction x) 0.707) + (set! (-> v1-0 direction y) -0.5) + (set! (-> v1-0 direction z) 0.707) + (set! (-> v1-0 direction w) 1.0) + ) + (vector-normalize! (the-as vector (-> s4-0 dir0)) 1.0) + (set-vector! (-> s4-0 dir0 color) 0.0 1.9921875 0.0 1.0) + (set! (-> s4-0 dir0 extra x) 1.0) + (set! (-> s4-0 ambi extra x) 0.0) + (set-vector! (-> s5-0 ambi color) 0.3 0.3 0.5 1.0) + (set! (-> s5-0 dir0 extra x) 0.0) + (set! (-> s5-0 ambi extra x) 1.0) + (let ((v1-5 (-> gp-0 dir0))) + (set! (-> v1-5 direction x) 0.6499) + (set! (-> v1-5 direction y) 0.7134) + (set! (-> v1-5 direction z) 0.2619) + (set! (-> v1-5 direction w) 1.0) + ) + (set-vector! (-> gp-0 dir0 color) 0.65 0.575 0.575 1.0) + (let ((v1-7 (-> gp-0 dir1))) + (set! (-> v1-7 direction x) -0.6499) + (set! (-> v1-7 direction y) 0.7134) + (set! (-> v1-7 direction z) -0.2619) + (set! (-> v1-7 direction w) 1.0) + ) + (set-vector! (-> gp-0 dir1 color) 0.75 0.6 0.5 1.0) + (set-vector! (-> gp-0 ambi color) 0.2 0.2 0.25 1.0) + (set! (-> gp-0 dir0 extra x) 0.65) + (set! (-> gp-0 dir1 extra x) 1.0) + (let ((f0-38 0.7)) + (set! (-> gp-0 ambi extra x) f0-38) + f0-38 + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-casboss time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (update-casboss-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s4-1 (the-as casboss-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 0.0) + (if (not (paused?)) + (set! (-> s4-1 explosion) (- (-> s4-1 explosion) (-> self clock seconds-per-frame))) + ) + ) + ) + 0 + (none) + ) + +(defun set-casboss-explosion! () + (let ((v1-1 (level-get *level* 'ctywide))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 1.0) + ) + (set! (-> (the-as casboss-states v1-2) explosion) f0-0) + f0-0 + ) + ) + ) + ) + +(deftype caspad-states (structure) + ((light light-state :inline :offset-assert 0) + (red float :offset-assert 8) + (white float :offset-assert 12) + (white-count int32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-caspad time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as caspad-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (-> gp-1 red)) + (set! (-> arg0 times 7 w) (-> gp-1 white)) + (set! (-> arg0 times 5 w) 1.0) + (when (not (paused?)) + (let* ((v1-11 (-> *display* part-clock frame-counter)) + (f0-4 (* 0.006666667 (the float (mod v1-11 150)))) + ) + (set! (-> gp-1 red) (+ 0.75 (* 0.25 (cos (* 65536.0 f0-4))))) + ) + (when (<= (-> gp-1 white-count) 0) + (set! (-> gp-1 white) (rand-vu-float-range 0.85 1.05)) + (set! (-> gp-1 white-count) 2) + ) + (+! (-> gp-1 white-count) -1) + ) + ) + ) + 0 + (none) + ) + +(deftype palout-states (structure) + ((light light-state :inline :offset-assert 0) + (flame flames-state :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xf + :flag-assert #x90000000f + ) + + +(defun init-mood-palout ((arg0 mood-context)) + (let ((v0-0 (-> *math-camera* trans-other))) + (set! (-> v0-0 x) 760754.2) + (set! (-> v0-0 y) 0.0) + (set! (-> v0-0 z) 2471944.2) + (set! (-> v0-0 w) 1.0) + v0-0 + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-palout time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior-ambi arg0 #t) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 2 8 0.5 0.0009765625 1.5) + (let ((gp-1 *math-camera*)) + (if (not (paused?)) + (quaternion-rotate-y! + (-> gp-1 quat-other) + (-> gp-1 quat-other) + (* 273.06668 (-> self clock seconds-per-frame)) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype palroof-states (structure) + ((electricity electricity-state 2 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + + +(defun init-mood-palroof ((arg0 mood-context)) + (let ((v1-0 (the-as palroof-states (-> arg0 state)))) + (set! (-> v1-0 electricity 0 scale) 1.0) + (let ((f0-1 1.0)) + (set! (-> v1-0 electricity 1 scale) f0-1) + f0-1 + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-palroof time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (set! (-> arg0 times 7 w) 1.0) + (update-mood-electricity arg0 5 0 1.2 1.7) + (update-mood-electricity arg0 6 16 1.2 1.7) + ) + 0 + (none) + ) + +(defun set-palroof-electricity-scale! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'palroof))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as palroof-states v1-2) electricity arg1 scale) f0-0) + f0-0 + ) + ) + ) + ) + +(deftype palent-states (structure) + ((flame flames-state :inline :offset-assert 0) + (turret-value float :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-palent time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as palent-states (-> arg0 state)))) + (update-mood-flames arg0 6 1 0 0.75 0.00048828125 2.0) + (set! (-> arg0 times 5 w) (-> s5-1 turret-value)) + (set! (-> arg0 times 7 w) 1.0) + (if (not (paused?)) + (set! (-> s5-1 turret-value) (fmax 0.0 (+ -0.025 (-> s5-1 turret-value)))) + ) + ) + ) + 0 + (none) + ) + +(defun set-palent-turret-flash! ((arg0 float)) + (let ((v1-1 (level-get *level* 'palent))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-1 (* 0.5 arg0)) + ) + (set! (-> (the-as palent-states v1-2) turret-value) f0-1) + f0-1 + ) + ) + ) + ) + +(deftype nest-states (structure) + ((light light-state :inline :offset-assert 0) + (green-flag symbol :offset-assert 8) + (green float :offset-assert 12) + (green-noise float :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + + +(defun init-mood-nest ((arg0 mood-context)) + (set! (-> (the-as nest-states (-> arg0 state)) green-flag) #f) + #f + ) + +(defun update-nest-lights ((arg0 mood-context)) + (let ((a2-0 (new 'stack-no-clear 'vector4))) + (set-vector! a2-0 0.53660715 0.26964286 1.0 1.0) + (vector4-mul! (the-as vector4 (-> arg0 current-fog)) (the-as vector4 (-> arg0 current-fog)) a2-0) + ) + (mem-copy! (the-as pointer (-> arg0 light-group 1)) (the-as pointer (-> arg0 light-group)) 192) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-nest time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (update-nest-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as nest-states (-> arg0 state)))) + (when (not (paused?)) + (cond + ((-> s5-1 green-flag) + (set! (-> s5-1 green) (fmin 1.9 (+ (-> s5-1 green) (* 2.0 (-> self clock seconds-per-frame))))) + (set! (-> s5-1 green-noise) (rand-vu-float-range 0.0 (-> s5-1 green))) + ) + (else + (set! (-> s5-1 green) (fmax 0.0 (- (-> s5-1 green) (* 2.0 (-> self clock seconds-per-frame))))) + (set! (-> s5-1 green-noise) 0.0) + ) + ) + ) + (update-mood-light arg0 5 0 1.0 0.25 20.0 0.0 1.0) + (set! (-> arg0 times 6 w) (+ (-> s5-1 green) (-> s5-1 green-noise))) + ) + ) + 0 + (none) + ) + +(defun set-nest-green-flag! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'nest))) + (when v1-1 + (set! (-> (the-as nest-states (-> v1-1 mood-context state)) green-flag) arg0) + arg0 + ) + ) + ) + +(deftype village1-states (structure) + ((interp float :offset-assert 0) + (interp-flag symbol :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +(defun init-mood-village1 ((arg0 mood-context)) + (let ((v1-0 (the-as village1-states (-> arg0 state)))) + (set! (-> v1-0 interp) 0.0) + (set! (-> v1-0 interp-flag) #f) + ) + #f + ) + +(defun update-village1-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (set! (-> v1-0 0 dir0 extra x) (* 0.5 (-> v1-0 0 dir0 extra x))) + (set! (-> v1-0 0 dir1 extra x) (* 0.5 (-> v1-0 0 dir1 extra x))) + (set! (-> v1-0 0 dir2 extra x) (* 0.5 (-> v1-0 0 dir2 extra x))) + (let ((f0-7 (* 0.75 (-> v1-0 0 ambi extra x)))) + (set! (-> v1-0 0 ambi extra x) f0-7) + f0-7 + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-village1 time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (update-village1-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as village1-states (-> arg0 state)))) + (let ((f0-0 (-> gp-1 interp))) + (set! (-> arg0 times 6 w) (- 1.0 f0-0)) + (set! (-> arg0 times 7 w) f0-0) + (if (!= f0-0 0.0) + (set-filter-color! (- 1.0 (* 0.25 f0-0)) (- 1.0 (* 0.5 f0-0)) 1.0) + ) + ) + (when (not (paused?)) + (if (-> gp-1 interp-flag) + (seek! (-> gp-1 interp) 1.0 (* 0.5 (-> self clock seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-village1 time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((v1-1 (level-get *level* 'village1))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +(defun clear-village1-interp! () + (let ((v1-1 (level-get *level* 'village1))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as village1-states v1-2) interp) 0.0) + (set! (-> (the-as village1-states v1-2) interp-flag) #f) + ) + #f + ) + ) + ) + +(defun set-village1-interp! () + (let ((v1-1 (level-get *level* 'village1))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (v0-1 #t) + ) + (set! (-> (the-as village1-states v1-2) interp-flag) v0-1) + v0-1 + ) + ) + ) + ) + +(deftype consite-states (structure) + ((light light-state :inline :offset-assert 0) + (flash float :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-consite time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((f0-0 0.5)) + (let ((f1-0 1.0)) + (cond + ((or (>= 6.0 arg1) (>= arg1 18.0)) + (set! f0-0 f1-0) + ) + ((and (< 6.0 arg1) (< arg1 7.0)) + (+! f0-0 (* (- f1-0 f0-0) (- 7.0 arg1))) + ) + ((and (< 17.0 arg1) (< arg1 18.0)) + (+! f0-0 (* (- f1-0 f0-0) (+ -17.0 arg1))) + ) + ) + ) + (set! (-> arg0 times 7 w) f0-0) + ) + (let ((s4-1 (the-as consite-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (-> s4-1 flash)) + (if (not (paused?)) + (set! (-> s4-1 flash) (fmax 0.0 (- (-> s4-1 flash) (* 2.0 (-> self clock seconds-per-frame))))) + ) + ) + ) + 0 + (none) + ) + +(defun set-consite-flash! () + (let ((v1-1 (level-get *level* 'consite))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 2.0) + ) + (set! (-> (the-as consite-states v1-2) flash) f0-0) + f0-0 + ) + ) + ) + ) + +(deftype mincan-states (structure) + ((beams float 2 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-mincan time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((v1-7 (the-as mincan-states (-> arg0 state)))) + (set! (-> arg0 times 5 w) (-> v1-7 beams 0)) + (set! (-> arg0 times 6 w) (-> v1-7 beams 1)) + ) + ) + 0 + (none) + ) + +(defun set-mincan-beam! ((arg0 int) (arg1 float)) + (let ((v1-1 (level-get *level* 'mincan))) + (when v1-1 + (let ((v1-2 (-> v1-1 mood-context state)) + (f0-0 arg1) + ) + (set! (-> (the-as mincan-states (+ (* arg0 4) (the-as int v1-2))) beams 0) f0-0) + f0-0 + ) + ) + ) + ) + + + + diff --git a/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc b/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc index 8acae7145e..406fb634ce 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc @@ -7,3 +7,3068 @@ ;; DECOMP BEGINS +(deftype default-interior-states (structure) + () + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-default-interior time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 2 w) 1.0) + (set! (-> arg0 times 3 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +(deftype vinroom-states (structure) + ((main float :offset-assert 0) + (flicker1 float :offset-assert 4) + (flicker2 float :offset-assert 8) + (warp float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-vinroom-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (set-vector! (-> arg0 current-env-color) 48.0 60.0 96.0 255.0) + (set-vector! (-> v1-0 0 dir0 color) 0.061 0.854 1.0 1.0) + (set-vector! (-> v1-0 0 dir1 color) 0.858 0.932 1.0 1.0) + (let ((a0-4 (-> v1-0 0 dir1))) + (set! (-> a0-4 direction x) -0.6499) + (set! (-> a0-4 direction y) 0.7134) + (set! (-> a0-4 direction z) -0.2619) + (set! (-> a0-4 direction w) 1.0) + ) + (set-vector! (-> v1-0 0 dir2 color) 0.858 0.932 1.0 1.0) + (let ((a0-6 (-> v1-0 0 dir2))) + (set! (-> a0-6 direction x) 0.4634) + (set! (-> a0-6 direction y) 0.7718) + (set! (-> a0-6 direction z) -0.4352) + (set! (-> a0-6 direction w) 1.0) + ) + (set-vector! (-> v1-0 0 ambi color) 0.282 0.42 0.637 1.0) + (set! (-> v1-0 0 dir1 extra x) 1.0) + (set! (-> v1-0 0 dir2 extra x) 1.0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-vinroom time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-vinroom-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as (pointer float) (-> arg0 state)))) + (let ((s4-0 (-> arg0 light-group))) + (set! (-> arg0 times 1 w) (+ 0.875 (* 0.175 (cos (-> gp-0 0))))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> s4-0 0 dir0 extra x) (-> arg0 times 1 w)) + (set! (-> arg0 times 2 w) (if (< 36408.89 (-> gp-0 1)) + 0.475 + 0.5 + ) + ) + (set! (-> s4-0 0 dir1 extra x) (-> arg0 times 2 w)) + (set! (-> arg0 times 3 w) (if (< 21845.334 (-> gp-0 2)) + 0.475 + 0.5 + ) + ) + (set! (-> s4-0 0 dir2 extra x) (-> arg0 times 3 w)) + ) + (set! (-> arg0 times 4 w) (+ 1.2 (* 0.2 (cos (-> gp-0 3))))) + (when (not (paused?)) + (let ((f0-17 (+ (-> gp-0 0) (* 18204.445 (-> self clock seconds-per-frame))))) + (set! (-> gp-0 0) (- f0-17 (* (the float (the int (/ f0-17 65536.0))) 65536.0))) + ) + (let ((f0-20 (+ (-> gp-0 1) (* 196608.0 (-> self clock seconds-per-frame))))) + (set! (-> gp-0 1) (- f0-20 (* (the float (the int (/ f0-20 65536.0))) 65536.0))) + ) + (let ((f0-23 (+ (-> gp-0 2) (* 163840.0 (-> self clock seconds-per-frame))))) + (set! (-> gp-0 2) (- f0-23 (* (the float (the int (/ f0-23 65536.0))) 65536.0))) + ) + (let ((f0-26 (+ (-> gp-0 3) (* 32768.0 (-> self clock seconds-per-frame))))) + (set! (-> gp-0 3) (- f0-26 (* (the float (the int (/ f0-26 65536.0))) 65536.0))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype hideout-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xf + :flag-assert #x90000000f + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-hideout-lights ((arg0 mood-context)) + (let ((a2-0 (-> arg0 light-group)) + (a1-0 (-> arg0 light-group 1)) + (v1-0 (-> arg0 light-group 2)) + ) + (set-vector! (-> a2-0 0 dir0 color) 0.0 0.0 0.0 1.0) + (set-vector! (-> a2-0 0 ambi color) 0.22 0.219 0.35 1.0) + (let ((a0-3 (-> a1-0 dir0))) + (set! (-> a0-3 direction x) 0.0) + (set! (-> a0-3 direction y) -1.0) + (set! (-> a0-3 direction z) 0.0) + (set! (-> a0-3 direction w) 1.0) + ) + (set-vector! (-> a1-0 dir0 color) 1.0 0.8 0.4 1.0) + (set! (-> a1-0 dir0 extra x) 1.0) + (set-vector! (-> a1-0 ambi color) 0.22 0.219 0.35 1.0) + (set! (-> a1-0 ambi extra x) 1.0) + (let ((a0-8 (-> v1-0 dir0))) + (set! (-> a0-8 direction x) 0.331) + (set! (-> a0-8 direction y) 0.943) + (set! (-> a0-8 direction z) 0.0) + (set! (-> a0-8 direction w) 1.0) + ) + (set-vector! (-> v1-0 dir0 color) 0.256 0.685 0.573 1.0) + (set! (-> v1-0 dir0 extra x) 1.0) + (let ((a0-11 (-> v1-0 dir1))) + (set! (-> a0-11 direction x) -1.0) + (set! (-> a0-11 direction y) 0.0) + (set! (-> a0-11 direction z) 0.0) + (set! (-> a0-11 direction w) 1.0) + ) + (set-vector! (-> v1-0 dir1 color) 0.202 0.205 0.15 1.0) + (set! (-> v1-0 dir1 extra x) 1.0) + (set-vector! (-> v1-0 ambi color) 0.22 0.219 0.35 1.0) + (set! (-> v1-0 ambi extra x) 1.0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-hideout time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-hideout-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (cond + ((movie?) + (update-mood-flames arg0 1 2 0 0.333 0.0005859375 2.0) + (update-mood-flames arg0 3 2 8 0.333 0.0005859375 3.0) + ) + (else + (update-mood-flames arg0 1 2 0 0.333 0.001953125 2.0) + (update-mood-flames arg0 3 2 8 0.333 0.001953125 3.0) + ) + ) + (let ((a0-10 (new 'stack-no-clear 'sphere)) + (a1-4 (-> *math-camera* trans)) + ) + (set-vector! a0-10 4898816.0 32768.0 245760.0 1.0) + (let ((f0-5 (get-sphere-interp a0-10 a1-4 61440.0 69632.0))) + (set-vector! (-> arg0 times 0) 1.0 1.0 1.0 1.0) + (vector-lerp! + (the-as vector (-> arg0 times)) + (the-as vector (-> arg0 times)) + (the-as vector (+ #x83ac (the-as int *level*))) + f0-5 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-hideout time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'hideout))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +(deftype hiphog-states (structure) + ((spec-m-on sp-field-init-spec :offset-assert 0) + (spec-o-on sp-field-init-spec :offset-assert 4) + (spec-r-on sp-field-init-spec :offset-assert 8) + (spec-g-on sp-field-init-spec :offset-assert 12) + (spec-a-on sp-field-init-spec :offset-assert 16) + (spec-n-on sp-field-init-spec :offset-assert 20) + (spec-m-off sp-field-init-spec :offset-assert 24) + (spec-o-off sp-field-init-spec :offset-assert 28) + (spec-r-off sp-field-init-spec :offset-assert 32) + (spec-g-off sp-field-init-spec :offset-assert 36) + (spec-a-off sp-field-init-spec :offset-assert 40) + (spec-n-off sp-field-init-spec :offset-assert 44) + (spec-hog-1-on sp-field-init-spec :offset-assert 48) + (spec-hog-2-on sp-field-init-spec :offset-assert 52) + (spec-hiphog-on sp-field-init-spec :offset-assert 56) + (spec-hiphog-off sp-field-init-spec :offset-assert 60) + (spec-hiphog-on2 sp-field-init-spec :offset-assert 64) + (spec-hiphog-off2 sp-field-init-spec :offset-assert 68) + (spec-clock-sun sp-field-init-spec :offset-assert 72) + (spec-clock-moon sp-field-init-spec :offset-assert 76) + (door entity :offset-assert 80) + (m-on uint8 :offset-assert 84) + (o-on uint8 :offset-assert 85) + (r-on uint8 :offset-assert 86) + (g-on uint8 :offset-assert 87) + (a-on uint8 :offset-assert 88) + (n-on uint8 :offset-assert 89) + (m-off uint8 :offset-assert 90) + (o-off uint8 :offset-assert 91) + (r-off uint8 :offset-assert 92) + (g-off uint8 :offset-assert 93) + (a-off uint8 :offset-assert 94) + (n-off uint8 :offset-assert 95) + (hog-on uint8 :offset-assert 96) + (hiphog-on uint8 :offset-assert 97) + (hiphog-off uint8 :offset-assert 98) + (clock-sun uint8 :offset-assert 99) + (clock-moon uint8 :offset-assert 100) + ) + :method-count-assert 9 + :size-assert #x65 + :flag-assert #x900000065 + ) + + +;; WARN: Return type mismatch entity vs none. +(defun init-mood-hiphog ((arg0 mood-context)) + (let ((gp-0 (the-as hiphog-states (-> arg0 state)))) + (let ((a0-1 (-> *part-id-table* 19))) + (set! (-> gp-0 spec-m-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-m-on) (get-field-spec-by-id a0-1 (sp-field-id spt-r))) + ) + ) + (let ((a0-2 (-> *part-id-table* 20))) + (set! (-> gp-0 spec-o-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 spec-o-on) (get-field-spec-by-id a0-2 (sp-field-id spt-r))) + ) + ) + (let ((a0-3 (-> *part-id-table* 21))) + (set! (-> gp-0 spec-r-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-3) + (set! (-> gp-0 spec-r-on) (get-field-spec-by-id a0-3 (sp-field-id spt-r))) + ) + ) + (let ((a0-4 (-> *part-id-table* 22))) + (set! (-> gp-0 spec-g-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-4) + (set! (-> gp-0 spec-g-on) (get-field-spec-by-id a0-4 (sp-field-id spt-r))) + ) + ) + (let ((a0-5 (-> *part-id-table* 23))) + (set! (-> gp-0 spec-a-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-5) + (set! (-> gp-0 spec-a-on) (get-field-spec-by-id a0-5 (sp-field-id spt-r))) + ) + ) + (let ((a0-6 (-> *part-id-table* 24))) + (set! (-> gp-0 spec-n-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-6) + (set! (-> gp-0 spec-n-on) (get-field-spec-by-id a0-6 (sp-field-id spt-r))) + ) + ) + (let ((a0-7 (-> *part-id-table* 25))) + (set! (-> gp-0 spec-m-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-7) + (set! (-> gp-0 spec-m-off) (get-field-spec-by-id a0-7 (sp-field-id spt-r))) + ) + ) + (let ((a0-8 (-> *part-id-table* 26))) + (set! (-> gp-0 spec-o-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-8) + (set! (-> gp-0 spec-o-off) (get-field-spec-by-id a0-8 (sp-field-id spt-r))) + ) + ) + (let ((a0-9 (-> *part-id-table* 27))) + (set! (-> gp-0 spec-r-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-9) + (set! (-> gp-0 spec-r-off) (get-field-spec-by-id a0-9 (sp-field-id spt-r))) + ) + ) + (let ((a0-10 (-> *part-id-table* 28))) + (set! (-> gp-0 spec-g-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-10) + (set! (-> gp-0 spec-g-off) (get-field-spec-by-id a0-10 (sp-field-id spt-r))) + ) + ) + (let ((a0-11 (-> *part-id-table* 29))) + (set! (-> gp-0 spec-a-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-11) + (set! (-> gp-0 spec-a-off) (get-field-spec-by-id a0-11 (sp-field-id spt-r))) + ) + ) + (let ((a0-12 (-> *part-id-table* 30))) + (set! (-> gp-0 spec-n-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-12) + (set! (-> gp-0 spec-n-off) (get-field-spec-by-id a0-12 (sp-field-id spt-r))) + ) + ) + (let ((a0-13 (-> *part-id-table* 31))) + (set! (-> gp-0 spec-hog-1-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-13) + (set! (-> gp-0 spec-hog-1-on) (get-field-spec-by-id a0-13 (sp-field-id spt-r))) + ) + ) + (let ((a0-14 (-> *part-id-table* 32))) + (set! (-> gp-0 spec-hog-2-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-14) + (set! (-> gp-0 spec-hog-2-on) (get-field-spec-by-id a0-14 (sp-field-id spt-r))) + ) + ) + (let ((a0-15 (-> *part-id-table* 33))) + (set! (-> gp-0 spec-hiphog-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-15) + (set! (-> gp-0 spec-hiphog-on) (get-field-spec-by-id a0-15 (sp-field-id spt-r))) + ) + ) + (let ((a0-16 (-> *part-id-table* 34))) + (set! (-> gp-0 spec-hiphog-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-16) + (set! (-> gp-0 spec-hiphog-off) (get-field-spec-by-id a0-16 (sp-field-id spt-r))) + ) + ) + (let ((a0-17 (-> *part-id-table* 35))) + (set! (-> gp-0 spec-hiphog-on2) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-17) + (set! (-> gp-0 spec-hiphog-on2) (get-field-spec-by-id a0-17 (sp-field-id spt-r))) + ) + ) + (let ((a0-18 (-> *part-id-table* 36))) + (set! (-> gp-0 spec-hiphog-off2) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-18) + (set! (-> gp-0 spec-hiphog-off2) (get-field-spec-by-id a0-18 (sp-field-id spt-r))) + ) + ) + (let ((a0-19 (-> *part-id-table* 37))) + (set! (-> gp-0 spec-clock-sun) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-19) + (set! (-> gp-0 spec-clock-sun) (get-field-spec-by-id a0-19 (sp-field-id spt-r))) + ) + ) + (let ((a0-20 (-> *part-id-table* 38))) + (set! (-> gp-0 spec-clock-moon) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-20) + (set! (-> gp-0 spec-clock-moon) (get-field-spec-by-id a0-20 (sp-field-id spt-r))) + ) + ) + (set! (-> gp-0 m-on) (the-as uint 128)) + (set! (-> gp-0 o-on) (the-as uint 128)) + (set! (-> gp-0 r-on) (the-as uint 128)) + (set! (-> gp-0 g-on) (the-as uint 128)) + (set! (-> gp-0 a-on) (the-as uint 128)) + (set! (-> gp-0 n-on) (the-as uint 128)) + (set! (-> gp-0 m-off) (the-as uint 128)) + (set! (-> gp-0 o-off) (the-as uint 128)) + (set! (-> gp-0 r-off) (the-as uint 128)) + (set! (-> gp-0 g-off) (the-as uint 128)) + (set! (-> gp-0 a-off) (the-as uint 128)) + (set! (-> gp-0 n-off) (the-as uint 128)) + (set! (-> gp-0 hog-on) (the-as uint 128)) + (set! (-> gp-0 hiphog-on) (the-as uint 128)) + (set! (-> gp-0 hiphog-off) (the-as uint 128)) + (set! (-> gp-0 clock-sun) (the-as uint 128)) + (set! (-> gp-0 clock-moon) (the-as uint 128)) + (set! (-> gp-0 door) (entity-by-name "hip-door-b-1")) + ) + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defun update-hiphog-lights ((arg0 mood-context)) + (let ((t1-0 (-> arg0 light-group)) + (t0-0 (-> arg0 light-group 1)) + (a3-0 (-> arg0 light-group 2)) + (a2-0 (-> arg0 light-group 3)) + (a1-0 (-> arg0 light-group 4)) + (v1-0 (-> arg0 light-group 5)) + ) + (set-vector! (-> t1-0 0 dir0 color) 0.0 0.0 0.0 1.0) + (set-vector! (-> t1-0 0 ambi color) 0.11 0.109 0.175 1.0) + (set-vector! (-> t0-0 dir0 color) 0.945 0.648 0.523 1.0) + (let ((a0-4 (-> t0-0 dir0))) + (set! (-> a0-4 direction x) 0.0) + (set! (-> a0-4 direction y) 1.0) + (set! (-> a0-4 direction z) 0.0) + (set! (-> a0-4 direction w) 1.0) + ) + (set! (-> t0-0 dir0 extra x) 1.0) + (set-vector! (-> t0-0 ambi color) 0.197 0.124 0.062 1.0) + (set! (-> t0-0 ambi extra x) 1.0) + (set-vector! (-> a3-0 dir0 color) 0.945 0.648 0.523 1.0) + (set-vector! (-> a3-0 dir1 color) 1.0 0.237 0.386 1.0) + (set-vector! (-> a3-0 ambi color) 0.197 0.124 0.062 1.0) + (let ((a0-11 (-> a3-0 dir0))) + (set! (-> a0-11 direction x) 0.0) + (set! (-> a0-11 direction y) 1.0) + (set! (-> a0-11 direction z) 0.0) + (set! (-> a0-11 direction w) 1.0) + ) + (let ((a0-12 (-> a3-0 dir1))) + (set! (-> a0-12 direction x) 0.0) + (set! (-> a0-12 direction y) -1.0) + (set! (-> a0-12 direction z) 0.0) + (set! (-> a0-12 direction w) 1.0) + ) + (set! (-> a3-0 dir0 extra x) 1.0) + (set! (-> a3-0 dir1 extra x) 1.0) + (set! (-> a3-0 ambi extra x) 1.0) + (set-vector! (-> a2-0 dir0 color) 0.945 0.648 0.523 1.0) + (set-vector! (-> a2-0 dir1 color) 0.02 0.97 0.0 1.0) + (set-vector! (-> a2-0 dir2 color) 1.0 0.237 0.386 1.0) + (set-vector! (-> a2-0 ambi color) 0.197 0.124 0.062 1.0) + (let ((a0-20 (-> a2-0 dir0))) + (set! (-> a0-20 direction x) 0.0) + (set! (-> a0-20 direction y) 1.0) + (set! (-> a0-20 direction z) 0.0) + (set! (-> a0-20 direction w) 1.0) + ) + (let ((a0-21 (-> a2-0 dir1))) + (set! (-> a0-21 direction x) 0.0) + (set! (-> a0-21 direction y) -1.0) + (set! (-> a0-21 direction z) 0.0) + (set! (-> a0-21 direction w) 1.0) + ) + (let ((a0-22 (-> a2-0 dir2))) + (set! (-> a0-22 direction x) 1.0) + (set! (-> a0-22 direction y) 0.0) + (set! (-> a0-22 direction z) 0.0) + (set! (-> a0-22 direction w) 1.0) + ) + (set! (-> a2-0 dir0 extra x) 1.0) + (set! (-> a2-0 dir1 extra x) 1.0) + (set! (-> a2-0 dir2 extra x) 1.0) + (set! (-> a2-0 ambi extra x) 1.0) + (set-vector! (-> a1-0 dir0 color) 0.945 0.648 0.523 1.0) + (set-vector! (-> a1-0 dir1 color) 0.02 0.97 0.0 1.0) + (set-vector! (-> a1-0 dir2 color) 1.0 0.237 0.386 1.0) + (set-vector! (-> a1-0 ambi color) 0.197 0.124 0.062 1.0) + (let ((a0-31 (-> a1-0 dir0))) + (set! (-> a0-31 direction x) 0.0) + (set! (-> a0-31 direction y) 1.0) + (set! (-> a0-31 direction z) 0.0) + (set! (-> a0-31 direction w) 1.0) + ) + (let ((a0-32 (-> a1-0 dir1))) + (set! (-> a0-32 direction x) 0.0) + (set! (-> a0-32 direction y) -1.0) + (set! (-> a0-32 direction z) 0.0) + (set! (-> a0-32 direction w) 1.0) + ) + (let ((a0-33 (-> a1-0 dir2))) + (set! (-> a0-33 direction x) -1.0) + (set! (-> a0-33 direction y) 0.0) + (set! (-> a0-33 direction z) 0.0) + (set! (-> a0-33 direction w) 1.0) + ) + (set! (-> a1-0 dir0 extra x) 1.0) + (set! (-> a1-0 dir1 extra x) 1.0) + (set! (-> a1-0 dir2 extra x) 1.0) + (set! (-> a1-0 ambi extra x) 1.0) + (set-vector! (-> v1-0 dir0 color) 0.9992 0.6868 0.7258 1.0) + (set-vector! (-> v1-0 dir1 color) 0.9992 0.6868 0.7258 1.0) + (set-vector! (-> v1-0 dir2 color) 0.9 0.9 0.9 1.0) + (set-vector! (-> v1-0 ambi color) 0.197 0.124 0.062 1.0) + (let ((a0-42 (-> v1-0 dir0))) + (set! (-> a0-42 direction x) 0.028) + (set! (-> a0-42 direction y) 0.731) + (set! (-> a0-42 direction z) -0.681) + (set! (-> a0-42 direction w) 1.0) + ) + (let ((a0-43 (-> v1-0 dir1))) + (set! (-> a0-43 direction x) -0.472) + (set! (-> a0-43 direction y) 0.719) + (set! (-> a0-43 direction z) 0.519) + (set! (-> a0-43 direction w) 1.0) + ) + (let ((a0-44 (-> v1-0 dir2))) + (set! (-> a0-44 direction x) 0.242) + (set! (-> a0-44 direction y) 0.786) + (set! (-> a0-44 direction z) 0.567) + (set! (-> a0-44 direction w) 1.0) + ) + (set! (-> v1-0 dir0 extra x) 1.0) + (set! (-> v1-0 dir1 extra x) 0.75) + (set! (-> v1-0 dir2 extra x) 0.0) + (set! (-> v1-0 ambi extra x) 1.0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-hiphog time-of-day-proc ((arg0 mood-context) (arg1 float)) + (update-mood-interior arg0) + (update-hiphog-lights arg0) + (set! (-> arg0 light-group 0 dir0 extra x) 0.0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 1 w) 1.0) + (let ((v1-5 (-> *display* part-clock frame-counter)) + (s5-0 (the-as hiphog-states (-> arg0 state))) + ) + (let ((f6-0 (the float (-> s5-0 m-on))) + (f5-0 (the float (-> s5-0 o-on))) + (f3-0 (the float (-> s5-0 r-on))) + (f2-0 (the float (-> s5-0 g-on))) + (f1-0 (the float (-> s5-0 a-on))) + (f0-8 (the float (-> s5-0 n-on))) + ) + (if (nonzero? (-> s5-0 spec-m-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f6-0) + ) + (if (nonzero? (-> s5-0 spec-o-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f5-0) + ) + (if (nonzero? (-> s5-0 spec-r-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f3-0) + ) + (if (nonzero? (-> s5-0 spec-g-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f2-0) + ) + (if (nonzero? (-> s5-0 spec-a-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f1-0) + ) + (if (nonzero? (-> s5-0 spec-n-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f0-8) + ) + (let ((a0-37 (mod v1-5 800)) + (f4-0 0.0) + ) + (if (or (and (>= a0-37 100) (< a0-37 400)) (>= a0-37 500)) + (+! f4-0 f6-0) + ) + (if (or (and (>= a0-37 150) (< a0-37 400)) (>= a0-37 500)) + (+! f4-0 f5-0) + ) + (if (or (and (>= a0-37 200) (< a0-37 400)) (>= a0-37 500)) + (+! f4-0 f3-0) + ) + (if (or (and (>= a0-37 250) (< a0-37 400)) (>= a0-37 500)) + (+! f4-0 f2-0) + ) + (if (or (and (>= a0-37 300) (< a0-37 400)) (>= a0-37 500)) + (+! f4-0 f1-0) + ) + (if (or (and (>= a0-37 350) (< a0-37 400)) (>= a0-37 500)) + (+! f4-0 f0-8) + ) + (let ((f0-10 (* 0.0006510417 f4-0))) + (set! (-> arg0 times 2 w) f0-10) + (set! (-> arg0 light-group 3 dir1 extra x) f0-10) + ) + ) + ) + (let ((f5-1 (the float (-> s5-0 m-off))) + (f4-1 (the float (-> s5-0 o-off))) + (f3-1 (the float (-> s5-0 r-off))) + (f2-1 (the float (-> s5-0 g-off))) + (f1-1 (the float (-> s5-0 a-off))) + (f0-17 (the float (-> s5-0 n-off))) + ) + (if (nonzero? (-> s5-0 spec-m-off)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f5-1) + ) + (if (nonzero? (-> s5-0 spec-o-off)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f4-1) + ) + (if (nonzero? (-> s5-0 spec-r-off)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f3-1) + ) + (if (nonzero? (-> s5-0 spec-g-off)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f2-1) + ) + (if (nonzero? (-> s5-0 spec-a-off)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f1-1) + ) + (if (nonzero? (-> s5-0 spec-n-off)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f0-17) + ) + ) + (let ((f0-19 (the float (-> s5-0 hog-on)))) + (if (nonzero? (-> s5-0 spec-hog-1-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f0-19) + ) + (if (nonzero? (-> s5-0 spec-hog-2-on)) + (set! (-> s5-0 spec-hog-2-on initial-valuef) f0-19) + ) + (set! (-> arg0 times 3 w) (+ 0.5 (* 0.0009765625 f0-19))) + ) + (set! (-> arg0 light-group 4 dir1 extra x) (-> arg0 times 3 w)) + (let ((v1-6 (mod v1-5 600))) + (cond + ((< 300 v1-6) + (let ((f0-24 (the float (-> s5-0 hiphog-on)))) + (if (nonzero? (-> s5-0 spec-hiphog-on)) + (set! (-> s5-0 spec-hiphog-on initial-valuef) f0-24) + ) + (if (nonzero? (-> s5-0 spec-hiphog-on2)) + (set! (-> s5-0 spec-hiphog-on2 initial-valuef) f0-24) + ) + (set! (-> arg0 times 4 w) (* 0.001953125 f0-24)) + ) + ) + (else + (let ((f0-27 (the float (-> s5-0 hiphog-off)))) + (if (nonzero? (-> s5-0 spec-hiphog-off)) + (set! (-> s5-0 spec-hiphog-off initial-valuef) f0-27) + ) + (if (nonzero? (-> s5-0 spec-hiphog-off2)) + (set! (-> s5-0 spec-hiphog-off2 initial-valuef) f0-27) + ) + ) + ) + ) + ) + (cond + ((or (>= arg1 18.0) (>= 6.0 arg1)) + (let ((f0-31 (the float (-> s5-0 clock-moon)))) + (if (nonzero? (-> s5-0 spec-clock-moon)) + (set! (-> s5-0 spec-clock-moon initial-valuef) f0-31) + ) + (set-vector! (-> arg0 times 5) 0.471 0.722 1.0 (+ 0.5 (* 0.001953125 f0-31))) + ) + ) + (else + (let ((f0-35 (the float (-> s5-0 clock-sun)))) + (if (nonzero? (-> s5-0 spec-clock-sun)) + (set! (-> s5-0 spec-clock-sun initial-valuef) f0-35) + ) + (set-vector! (-> arg0 times 5) 1.0 0.99 0.54 (+ 0.5 (* 0.0009765625 f0-35))) + ) + ) + ) + (when (not (paused?)) + (set! (-> s5-0 m-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 o-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 r-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 g-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 a-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 n-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 m-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 o-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 r-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 g-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 a-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 n-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 hog-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 hiphog-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 hiphog-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 clock-sun) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 clock-moon) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + ) + (if (and (-> s5-0 door) (zero? (logand (-> s5-0 door extra perm status) (entity-perm-status subtask-complete)))) + (set! (-> arg0 times 0 quad) (-> (the-as (pointer uint128) (+ #x83ac (the-as int *level*))))) + ) + ) + (let ((a0-121 (new 'stack-no-clear 'sphere)) + (a1-40 (-> *math-camera* trans)) + ) + (set-vector! a0-121 -364544.0 0.0 5324800.0 1.0) + (let ((f0-76 (get-sphere-interp a0-121 a1-40 139264.0 24576.0))) + (vector-lerp! + (the-as vector (-> arg0 times)) + (the-as vector (-> arg0 times)) + (the-as vector (+ #x83ac (the-as int *level*))) + f0-76 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-hiphog time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'hiphog))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +(deftype sewer-states (structure) + ((light-flag symbol :offset-assert 0) + (light-count uint32 :offset-assert 4) + (turret-value float :offset-assert 8) + (spec-light-center sp-field-init-spec :offset-assert 12) + (spec-light sp-field-init-spec :offset-assert 16) + (explosion float :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-sewer-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (set-vector! (-> v1-0 0 dir0 color) 0.822 0.694 0.613 1.0) + (set-vector! (-> v1-0 0 ambi color) 0.083 0.139 0.157 1.0) + ) + (let ((a3-0 (-> arg0 light-group 1)) + (a2-4 (-> arg0 light-group 2)) + (a1-5 (-> arg0 light-group 3)) + (v1-2 (-> arg0 light-group 4)) + ) + (set-vector! (-> a3-0 ambi color) 0.083 0.139 0.157 1.0) + (set! (-> a3-0 ambi extra x) 1.0) + (let ((a0-3 (-> a3-0 dir0))) + (set! (-> a0-3 direction x) 0.0) + (set! (-> a0-3 direction y) 1.0) + (set! (-> a0-3 direction z) 0.0) + (set! (-> a0-3 direction w) 1.0) + ) + (set-vector! (-> a3-0 dir0 color) 0.822 0.694 0.613 1.0) + (set! (-> a3-0 dir0 extra x) 1.0) + (set-vector! (-> a2-4 ambi color) 0.8 0.8 0.8 1.0) + (set! (-> a2-4 ambi extra x) 1.0) + (let ((a0-8 (-> a2-4 dir0))) + (set! (-> a0-8 direction x) 0.0) + (set! (-> a0-8 direction y) 1.0) + (set! (-> a0-8 direction z) 0.0) + (set! (-> a0-8 direction w) 1.0) + ) + (set-vector! (-> a2-4 dir0 color) 0.822 0.694 0.613 1.0) + (set! (-> a2-4 dir0 extra x) 1.0) + (let ((a0-11 (-> a2-4 dir1))) + (set! (-> a0-11 direction x) -0.751) + (set! (-> a0-11 direction y) 0.658) + (set! (-> a0-11 direction z) -0.035) + (set! (-> a0-11 direction w) 1.0) + ) + (set-vector! (-> a2-4 dir1 color) 1.0 0.65 0.65 1.0) + (set! (-> a2-4 dir1 extra x) 0.6) + (set-vector! (-> a1-5 ambi color) 0.35 0.35 0.35 1.0) + (set! (-> a1-5 ambi extra x) 1.0) + (let ((a0-16 (-> a1-5 dir0))) + (set! (-> a0-16 direction x) 0.0) + (set! (-> a0-16 direction y) 1.0) + (set! (-> a0-16 direction z) 0.0) + (set! (-> a0-16 direction w) 1.0) + ) + (set-vector! (-> a1-5 dir0 color) 0.822 0.694 0.613 1.0) + (set! (-> a1-5 dir0 extra x) 1.0) + (let ((a0-19 (-> v1-2 dir0))) + (set! (-> a0-19 direction x) 0.0) + (set! (-> a0-19 direction y) 1.0) + (set! (-> a0-19 direction z) 0.0) + (set! (-> a0-19 direction w) 1.0) + ) + (set-vector! (-> v1-2 dir0 color) 0.725 0.924 0.982 1.0) + (set! (-> v1-2 dir0 extra x) 0.4) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch sp-field-init-spec vs none. +(defun init-mood-sewer ((arg0 mood-context)) + (let ((gp-0 (the-as sewer-states (-> arg0 state)))) + (let ((a0-1 (-> *part-id-table* 39))) + (set! (-> gp-0 spec-light-center) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-light-center) (get-field-spec-by-id a0-1 (sp-field-id spt-a))) + ) + ) + (let ((a0-2 (-> *part-id-table* 40))) + (set! (-> gp-0 spec-light) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 spec-light) (get-field-spec-by-id a0-2 (sp-field-id spt-a))) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-sewer time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-sewer-lights arg0) + (let ((s5-0 (-> arg0 light-group 2))) + (set! (-> arg0 light-group 0 dir0 extra x) 0.0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 2 w) 1.0) + (let ((s4-0 (the-as sewer-states (-> arg0 state)))) + (when (-> s4-0 light-flag) + (let ((v1-6 (-> s4-0 light-count))) + (cond + ((> v1-6 0) + (let ((f0-4 (+ 0.2 (* 0.0066666673 (the float v1-6)))) + (f1-3 (+ 0.4 (* 0.013333335 (the float v1-6)))) + ) + (set! (-> arg0 times 1 w) (rand-vu-float-range f0-4 f1-3)) + ) + (+! (-> s4-0 light-count) -1) + (set! (-> *display* force-sync) (the-as uint 2)) + ) + (else + (set! (-> arg0 times 1 w) 1.0) + ) + ) + ) + ) + (let ((f0-7 (-> arg0 times 1 w))) + (if (nonzero? (-> s4-0 spec-light-center)) + (set! (-> s4-0 spec-light-center initial-valuef) (* 12.0 f0-7)) + ) + (if (nonzero? (-> s4-0 spec-light)) + (set! (-> s4-0 spec-light initial-valuef) (* 12.0 f0-7)) + ) + (if *ocean-map-sewer* + (set! (-> *ocean-map-sewer* ocean-colors colors 1271) + (the-as + rgba + (logior (logand (logior (logand (logior (logand (logior (logand 0 -256) (shr (shl (the int (* 19.0 f0-7)) 56) 56)) -65281) + (shr (shl (the int (* 24.5 f0-7)) 56) 48) + ) + -16711681 + ) + (shr (shl (the int (* 16.0 f0-7)) 56) 40) + ) + (-> (new 'static 'array uint64 1 #xffffffff00ffffff) 0) + ) + (shl #x8000 16) + ) + ) + ) + ) + ) + (set! (-> arg0 times 6 w) (-> s4-0 explosion)) + (set! (-> arg0 times 7 w) (-> s4-0 turret-value)) + (when (not (paused?)) + (set! (-> s4-0 turret-value) (fmax 0.0 (+ -0.2 (-> s4-0 turret-value)))) + (seek! (-> s4-0 explosion) 0.0 (* 2.5 (-> self clock seconds-per-frame))) + ) + ) + (when *ocean-map-sewer* + (let ((f0-18 (-> *ocean-map-sewer* start-corner y))) + (let ((f1-19 (fmax 0.0 (fmin 1.0 (- 1.0 (* 0.000020345053 (+ 314802.2 f0-18))))))) + (set! (-> arg0 times 3 w) (fmax 0.0 (fmin 1.0 (- 1.0 (* 0.000020345053 (+ 265650.2 f0-18)))))) + (set! (-> arg0 times 4 w) f1-19) + (set! (-> s5-0 dir0 extra x) f1-19) + (set! (-> s5-0 ambi extra x) f1-19) + ) + (set! (-> arg0 times 5 w) (fmax 0.0 (fmin 1.0 (- 1.0 (* 0.000018780049 (+ 368050.2 f0-18)))))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-sewerb time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'sewerb))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-sewescb time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'sewescb))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +(defun set-sewer-lights-flag! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'sewerb))) + (when v1-1 + (let ((v1-2 (the-as sewer-states (-> v1-1 mood-context state)))) + (if (and (not (-> v1-2 light-flag)) arg0) + (set! (-> v1-2 light-count) (the-as uint 30)) + ) + (set! (-> v1-2 light-flag) arg0) + ) + arg0 + ) + ) + ) + +(defun set-sewer-turret-flash! () + (let ((v1-1 (level-get *level* 'sewerb))) + (when v1-1 + (let ((v1-2 (the-as sewer-states (-> v1-1 mood-context state))) + (f0-0 1.0) + ) + (set! (-> v1-2 turret-value) f0-0) + f0-0 + ) + ) + ) + ) + +(defun set-sewesc-explosion! () + (let ((v1-1 (level-get *level* 'sewescb))) + (when v1-1 + (let ((v1-2 (the-as sewer-states (-> v1-1 mood-context state))) + (f0-0 1.9921875) + ) + (set! (-> v1-2 explosion) f0-0) + f0-0 + ) + ) + ) + ) + +(deftype onintent-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (green-flame flames-state :inline :offset-assert 24) + (totem0 flames-state :inline :offset-assert 32) + (totem1 flames-state :inline :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2f + :flag-assert #x90000002f + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-onintent-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (set-vector! (-> v1-0 0 dir0 color) 0.822 0.694 0.613 1.0) + (set-vector! (-> v1-0 0 ambi color) 0.21 0.188 0.163 1.0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-onintent time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-onintent-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 3.0) + (update-mood-flames arg0 4 1 16 0.75 0.0009765625 4.0) + (update-mood-flames arg0 5 1 24 0.75 0.0009765625 2.0) + (update-mood-flames arg0 6 1 32 0.333 0.001953125 2.0) + (update-mood-flames arg0 7 1 40 0.75 0.0009765625 2.0) + ) + ) + 0 + (none) + ) + +(deftype oracle-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (blue-flame flames-state :inline :offset-assert 24) + (door-entity entity :offset-assert 32) + (door-current float :offset-assert 36) + (door-target float :offset-assert 40) + (purple-flag symbol :offset-assert 44) + (purple float :offset-assert 48) + (purple-noise float :offset-assert 52) + ) + :method-count-assert 9 + :size-assert #x38 + :flag-assert #x900000038 + ) + + +(defun init-mood-oracle ((arg0 mood-context)) + (let ((v1-0 (the-as oracle-states (-> arg0 state)))) + (set! (-> v1-0 door-entity) #f) + (set! (-> v1-0 door-current) 0.0) + (set! (-> v1-0 door-target) 0.0) + (set! (-> v1-0 purple-flag) #f) + ) + #f + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-oracle time-of-day-proc ((arg0 mood-context)) + (copy-mood-exterior-ambi arg0 #f) + (update-mood-interior arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((s5-0 (the-as oracle-states (-> arg0 state)))) + (cond + ((-> s5-0 door-entity) + (if (logtest? (-> s5-0 door-entity extra perm status) (entity-perm-status subtask-complete)) + (set! (-> s5-0 door-target) 1.0) + (set! (-> s5-0 door-target) 0.0) + ) + ) + (else + (set! (-> s5-0 door-entity) (entity-by-name "oracle-door-1")) + ) + ) + (when (not (paused?)) + (seek! (-> s5-0 door-current) (-> s5-0 door-target) (* 4.0 (-> self clock seconds-per-frame))) + (cond + ((-> s5-0 purple-flag) + (set! (-> s5-0 purple) (fmin 1.9 (+ (-> s5-0 purple) (* 2.0 (-> self clock seconds-per-frame))))) + (set! (-> s5-0 purple-noise) (rand-vu-float-range 0.0 (-> s5-0 purple))) + ) + (else + (set! (-> s5-0 purple) (fmax 0.0 (- (-> s5-0 purple) (* 2.0 (-> self clock seconds-per-frame))))) + (set! (-> s5-0 purple-noise) 0.0) + ) + ) + ) + (set! (-> arg0 times 0 w) (-> s5-0 door-current)) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 3.0) + (update-mood-flames arg0 4 1 16 0.75 0.0009765625 4.0) + (update-mood-flames arg0 5 1 24 0.75 0.0009765625 2.0) + (set! (-> arg0 times 6 w) (+ (-> s5-0 purple) (-> s5-0 purple-noise))) + ) + ) + ) + 0 + (none) + ) + +(defun set-oracle-purple-flag! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'oracle))) + (when v1-1 + (set! (-> (the-as oracle-states (-> v1-1 mood-context state)) purple-flag) arg0) + arg0 + ) + ) + ) + +(deftype tomba-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (light light-state :inline :offset-assert 24) + (gem-light float :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-tomba-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 current-fog))) + (set! (-> v1-0 fog-color x) 0.0) + (set! (-> v1-0 fog-color y) 0.0) + (set! (-> v1-0 fog-color z) 0.0) + (set! (-> v1-0 fog-color w) 128.0) + ) + (let ((a1-0 (-> arg0 light-group)) + (s5-0 (-> arg0 light-group 1)) + ) + (let ((v1-1 (-> a1-0 0))) + (set! (-> v1-1 dir0 direction x) -0.69) + (set! (-> v1-1 dir0 direction y) 0.487) + (set! (-> v1-1 dir0 direction z) -0.53) + (set! (-> v1-1 dir0 direction w) 0.0) + ) + (set-vector! (-> a1-0 0 dir0 color) 0.878 0.7656 0.6875 1.0) + (set! (-> a1-0 0 dir0 extra x) 1.0) + (let ((v1-4 (-> a1-0 0 dir1))) + (set! (-> v1-4 direction x) 0.743) + (set! (-> v1-4 direction y) 0.51) + (set! (-> v1-4 direction z) 0.431) + (set! (-> v1-4 direction w) 0.0) + ) + (set-vector! (-> a1-0 0 dir1 color) 1.0 0.8046 0.648 1.0) + (set! (-> a1-0 0 dir1 extra x) 0.8) + (set-vector! (-> a1-0 0 ambi color) 0.3 0.2 0.1 1.0) + (set! (-> a1-0 0 ambi extra x) 0.55) + (mem-copy! (the-as pointer s5-0) (the-as pointer a1-0) 192) + (set! (-> s5-0 ambi extra x) 0.35) + ) + (cond + ((task-node-closed? (game-task-node tomb-boss-torches)) + ) + (else + (set-vector! (-> arg0 current-env-color) 0.0 0.0 0.0 0.0) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-tomba time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-tomba-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (when (not (task-node-closed? (game-task-node tomb-boss-torches))) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 2.0) + ) + (update-mood-flames arg0 4 2 16 0.5 0.001953125 2.0) + (update-mood-light arg0 6 24 0.8 0.2 19.0 0.0 1.0) + ) + ) + 0 + (none) + ) + +(deftype tombb-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (light light-state :inline :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-tombb-lights ((arg0 mood-context)) + (update-tomba-lights arg0) + (let ((v1-0 (-> arg0 light-group 1))) + (let ((a0-2 (-> v1-0 dir0))) + (set! (-> a0-2 direction x) 0.0) + (set! (-> a0-2 direction y) 0.0) + (set! (-> a0-2 direction z) 1.0) + (set! (-> a0-2 direction w) 0.0) + ) + (set-vector! (-> v1-0 dir0 color) 1.6 1.07 0.725 1.0) + (set! (-> v1-0 dir0 extra x) 0.5) + (let ((a0-5 (-> v1-0 dir1))) + (set! (-> a0-5 direction x) -0.473) + (set! (-> a0-5 direction y) 0.707) + (set! (-> a0-5 direction z) -0.523) + (set! (-> a0-5 direction w) 0.0) + ) + (set-vector! (-> v1-0 dir1 color) 1.4 0.9 0.5 1.0) + (set! (-> v1-0 dir1 extra x) 0.55) + (let ((a0-8 (-> v1-0 dir2))) + (set! (-> a0-8 direction x) 0.473) + (set! (-> a0-8 direction y) 0.707) + (set! (-> a0-8 direction z) -0.523) + (set! (-> a0-8 direction w) 0.0) + ) + (set-vector! (-> v1-0 dir2 color) 1.4 0.9 0.7 1.0) + (set! (-> v1-0 dir2 extra x) 0.55) + (set-vector! (-> v1-0 ambi color) 0.4 0.2 0.2 1.0) + (set! (-> v1-0 ambi extra x) 0.2) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-tombb time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-tombb-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 2.0) + (update-mood-flames arg0 4 2 16 0.5 0.001953125 2.0) + (update-mood-light arg0 6 24 0.75 0.5 19.0 0.0 1.0) + ) + ) + 0 + (none) + ) + +(deftype tombc-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (electricity electricity-state :inline :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + + +(defun init-mood-tombc ((arg0 mood-context)) + (let ((v1-0 (the-as tombc-states (-> arg0 state))) + (f0-0 1.0) + ) + (set! (-> v1-0 electricity scale) f0-0) + f0-0 + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-tombc time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-tomba-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 2.0) + (update-mood-flames arg0 4 2 16 0.5 0.001953125 2.0) + (update-mood-electricity arg0 6 24 0.8 1.0) + ) + ) + 0 + (none) + ) + +(defun set-tombc-electricity-scale! ((arg0 float)) + (let ((v1-1 (level-get *level* 'tombc))) + (when v1-1 + (let ((v1-2 (the-as tombc-states (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> v1-2 electricity scale) f0-0) + f0-0 + ) + ) + ) + ) + +(deftype tombd-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (light light-state :inline :offset-assert 24) + (gem-light float :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-tombd-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 current-fog))) + (set! (-> v1-0 fog-color x) 0.0) + (set! (-> v1-0 fog-color y) 0.0) + (set! (-> v1-0 fog-color z) 0.0) + (set! (-> v1-0 fog-color w) 128.0) + ) + (let ((a1-1 (-> arg0 light-group)) + (gp-0 (-> arg0 light-group 1)) + ) + (let ((v1-1 (-> a1-1 0))) + (set! (-> v1-1 dir0 direction x) -0.69) + (set! (-> v1-1 dir0 direction y) 0.487) + (set! (-> v1-1 dir0 direction z) -0.53) + (set! (-> v1-1 dir0 direction w) 0.0) + ) + (set-vector! (-> a1-1 0 dir0 color) 0.85 0.7656 0.6875 1.0) + (set! (-> a1-1 0 dir0 extra x) 1.0) + (let ((v1-4 (-> a1-1 0 dir1))) + (set! (-> v1-4 direction x) 0.743) + (set! (-> v1-4 direction y) 0.51) + (set! (-> v1-4 direction z) 0.431) + (set! (-> v1-4 direction w) 0.0) + ) + (set-vector! (-> a1-1 0 dir1 color) 0.85 0.8046 0.7 1.0) + (set! (-> a1-1 0 dir1 extra x) 0.8) + (set-vector! (-> a1-1 0 ambi color) 0.3 0.2 0.1 1.0) + (set! (-> a1-1 0 ambi extra x) 0.55) + (mem-copy! (the-as pointer gp-0) (the-as pointer a1-1) 192) + (set! (-> gp-0 ambi extra x) 0.35) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-tombd time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-tombd-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (when (not (task-node-closed? (game-task-node tomb-boss-torches))) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 2.0) + ) + (update-mood-flames arg0 4 2 16 0.5 0.001953125 2.0) + (update-mood-light arg0 6 24 0.8 0.2 19.0 0.0 1.0) + ) + ) + 0 + (none) + ) + +(deftype tombe-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (light light-state :inline :offset-assert 24) + (gem-light float :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-tombe time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-tomba-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 2.0) + (update-mood-flames arg0 4 2 16 0.5 0.001953125 2.0) + (update-mood-light arg0 6 24 0.8 0.2 19.0 0.0 1.0) + ) + ) + 0 + (none) + ) + +(deftype tombboss-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (light light-state :inline :offset-assert 24) + (gem-light float :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-tombboss-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (let ((a1-0 (-> v1-0 0))) + (set! (-> a1-0 dir0 direction x) -0.671) + (set! (-> a1-0 dir0 direction y) 0.568) + (set! (-> a1-0 dir0 direction z) -0.474) + (set! (-> a1-0 dir0 direction w) 0.0) + ) + (set-vector! (-> v1-0 0 dir0 color) 0.7 0.5 0.25 1.0) + (set! (-> v1-0 0 dir0 extra x) 1.2) + (let ((a1-3 (-> v1-0 0 dir1))) + (set! (-> a1-3 direction x) 0.734) + (set! (-> a1-3 direction y) 0.678) + (set! (-> a1-3 direction z) -0.019) + (set! (-> a1-3 direction w) 0.0) + ) + (set-vector! (-> v1-0 0 dir1 color) 0.7 0.5 0.25 1.0) + (set! (-> v1-0 0 dir1 extra x) 0.9) + (set-vector! (-> v1-0 0 ambi color) 0.2 0.2 0.4 1.0) + (set! (-> v1-0 0 ambi extra x) 0.8) + ) + (let ((v1-2 (-> arg0 light-group 1))) + (let ((a1-8 (-> v1-2 dir0))) + (set! (-> a1-8 direction x) -0.823) + (set! (-> a1-8 direction y) 0.491) + (set! (-> a1-8 direction z) -0.283) + (set! (-> a1-8 direction w) 0.0) + ) + (set-vector! (-> v1-2 dir0 color) 0.878 0.7656 0.6875 1.0) + (set! (-> v1-2 dir0 extra x) 1.0) + (let ((a1-11 (-> v1-2 dir1))) + (set! (-> a1-11 direction x) 0.661) + (set! (-> a1-11 direction y) 0.411) + (set! (-> a1-11 direction z) -0.626) + (set! (-> a1-11 direction w) 0.0) + ) + (set-vector! (-> v1-2 dir1 color) 1.0 0.8046 0.648 1.0) + (set! (-> v1-2 dir1 extra x) 0.8) + (set-vector! (-> v1-2 ambi color) 0.375 0.0 0.2 1.0) + (set! (-> v1-2 ambi extra x) 0.332) + ) + (let ((v1-4 (-> arg0 light-group 2))) + (let ((a1-16 (-> v1-4 dir0))) + (set! (-> a1-16 direction x) -0.671) + (set! (-> a1-16 direction y) 0.568) + (set! (-> a1-16 direction z) -0.474) + (set! (-> a1-16 direction w) 0.0) + ) + (set-vector! (-> v1-4 dir0 color) 0.7 0.5 0.25 1.0) + (set! (-> v1-4 dir0 extra x) 1.0) + (let ((a1-19 (-> v1-4 dir1))) + (set! (-> a1-19 direction x) 0.734) + (set! (-> a1-19 direction y) 0.678) + (set! (-> a1-19 direction z) -0.019) + (set! (-> a1-19 direction w) 0.0) + ) + (set-vector! (-> v1-4 dir1 color) 0.7 0.5 0.25 1.0) + (set! (-> v1-4 dir1 extra x) 0.7) + (set-vector! (-> v1-4 ambi color) 0.2 0.2 0.4 1.0) + (set! (-> v1-4 ambi extra x) 0.4) + ) + (let ((v1-6 (-> arg0 light-group 3))) + (let ((a1-24 (-> v1-6 dir0))) + (set! (-> a1-24 direction x) -0.671) + (set! (-> a1-24 direction y) 0.568) + (set! (-> a1-24 direction z) -0.474) + (set! (-> a1-24 direction w) 0.0) + ) + (set-vector! (-> v1-6 dir0 color) 0.7 0.5 0.25 1.0) + (set! (-> v1-6 dir0 extra x) 1.2) + (let ((a1-27 (-> v1-6 dir1))) + (set! (-> a1-27 direction x) 0.734) + (set! (-> a1-27 direction y) 0.678) + (set! (-> a1-27 direction z) -0.019) + (set! (-> a1-27 direction w) 0.0) + ) + (set-vector! (-> v1-6 dir1 color) 0.7 0.5 0.25 1.0) + (set! (-> v1-6 dir1 extra x) 0.9) + (set-vector! (-> v1-6 ambi color) 0.2 0.2 0.4 1.0) + (set! (-> v1-6 ambi extra x) 0.8) + ) + (let ((v1-8 (-> arg0 light-group 4))) + (let ((a0-1 (-> v1-8 dir0))) + (set! (-> a0-1 direction x) -0.69) + (set! (-> a0-1 direction y) 0.487) + (set! (-> a0-1 direction z) -0.53) + (set! (-> a0-1 direction w) 0.0) + ) + (set-vector! (-> v1-8 dir0 color) 0.878 0.7656 0.6875 1.0) + (set! (-> v1-8 dir0 extra x) 1.0) + (let ((a0-4 (-> v1-8 dir1))) + (set! (-> a0-4 direction x) 0.743) + (set! (-> a0-4 direction y) 0.51) + (set! (-> a0-4 direction z) 0.431) + (set! (-> a0-4 direction w) 0.0) + ) + (set-vector! (-> v1-8 dir1 color) 1.0 0.8046 0.648 1.0) + (set! (-> v1-8 dir1 extra x) 0.8) + (set-vector! (-> v1-8 ambi color) 0.4 0.2 0.2 1.0) + (set! (-> v1-8 ambi extra x) 0.4) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-tombboss time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-tombboss-lights arg0) + (let ((s5-0 (new 'static 'vector :x 790528.0 :y -262144.0 :z 6053888.0 :w 274432.0))) + (if (< (vector-vector-distance (target-pos 0) s5-0) (-> s5-0 w)) + (mem-copy! (the-as pointer (-> arg0 light-group)) (the-as pointer (-> arg0 light-group 3)) 192) + (mem-copy! (the-as pointer (-> arg0 light-group)) (the-as pointer (-> arg0 light-group 4)) 192) + ) + ) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((v1-4 (-> arg0 state))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 7 w) (the-as float (-> v1-4 8))) + ) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 2.0) + (update-mood-flames arg0 4 2 16 0.5 0.001953125 2.0) + (update-mood-light arg0 6 24 0.8 0.2 19.0 0.0 1.0) + ) + ) + 0 + (none) + ) + +(defun set-tombboss-gem-light! ((arg0 float)) + (let ((v1-1 (level-get *level* 'tombboss))) + (when v1-1 + (let ((v1-2 (the-as tombboss-states (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> v1-2 gem-light) f0-0) + f0-0 + ) + ) + ) + ) + +(deftype fortress-states (structure) + ((pulse pulse-state :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-fortress-lights ((arg0 mood-context)) + (let ((a3-0 (-> arg0 light-group)) + (a2-0 (-> arg0 light-group 1)) + (a1-0 (-> arg0 light-group 2)) + (v1-0 (-> arg0 light-group 3)) + ) + (set-vector! (-> a3-0 0 dir0 color) 0.822 0.694 0.65 1.0) + (set-vector! (-> a3-0 0 ambi color) 0.35 0.425 0.4 1.0) + (set! (-> a3-0 0 ambi extra x) 0.8) + (let ((a0-4 (-> a2-0 dir0))) + (set! (-> a0-4 direction x) 0.0) + (set! (-> a0-4 direction y) 1.0) + (set! (-> a0-4 direction z) 0.0) + (set! (-> a0-4 direction w) 0.0) + ) + (set-vector! (-> a2-0 dir0 color) 0.822 0.694 0.65 1.0) + (set-vector! (-> a2-0 ambi color) 0.35 0.425 0.4 1.0) + (set! (-> a2-0 dir0 extra x) 0.7) + (set! (-> a2-0 ambi extra x) 0.8) + (let ((a0-9 (-> a1-0 dir0))) + (set! (-> a0-9 direction x) 0.0) + (set! (-> a0-9 direction y) 1.0) + (set! (-> a0-9 direction z) 0.0) + (set! (-> a0-9 direction w) 0.0) + ) + (set-vector! (-> a1-0 dir0 color) 0.822 0.694 0.65 1.0) + (set-vector! (-> a1-0 ambi color) 0.35 0.425 0.4 1.0) + (set! (-> a1-0 dir0 extra x) 0.4) + (set! (-> a1-0 ambi extra x) 0.4) + (let ((a0-14 (-> v1-0 dir0))) + (set! (-> a0-14 direction x) 0.0) + (set! (-> a0-14 direction y) 1.0) + (set! (-> a0-14 direction z) 0.0) + (set! (-> a0-14 direction w) 0.0) + ) + (set-vector! (-> v1-0 dir0 color) 0.822 0.5 0.65 1.0) + (set-vector! (-> v1-0 ambi color) 0.35 0.425 0.4 1.0) + (set! (-> v1-0 dir0 extra x) 0.25) + (set! (-> v1-0 ambi extra x) 0.2) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-fortress time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-fortress-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-pulse arg0 7 0 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 0.0) + ) + ) + 0 + (none) + ) + +(deftype fordumpa-states (structure) + ((turret-value float 4 :offset-assert 0) + (pulse pulse-state :inline :offset-assert 16) + (electricity electricity-state :inline :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + + +(defun init-mood-fordumpa ((arg0 mood-context)) + (let ((v1-0 (the-as fordumpa-states (-> arg0 state))) + (f0-0 0.0) + ) + (set! (-> v1-0 electricity scale) f0-0) + f0-0 + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-fordumpa time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-fortress-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-pulse arg0 7 16 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 0.0) + (update-mood-electricity arg0 6 20 0.8 1.0) + (let ((s5-0 (the-as fordumpa-states (-> arg0 state)))) + (set! (-> arg0 times 2 w) (-> s5-0 turret-value 0)) + (set! (-> arg0 times 3 w) (-> s5-0 turret-value 1)) + (set! (-> arg0 times 4 w) (-> s5-0 turret-value 2)) + (set! (-> arg0 times 5 w) (-> s5-0 turret-value 3)) + (when (not (paused?)) + (dotimes (v1-7 4) + (set! (-> s5-0 turret-value v1-7) (fmax 0.0 (+ -0.2 (-> s5-0 turret-value v1-7)))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defun set-fordumpa-turret-flash! ((arg0 int)) + (let ((v1-1 (level-get *level* 'fordumpa))) + (when v1-1 + (let ((v1-2 (the-as fordumpa-states (-> v1-1 mood-context state))) + (f0-0 1.0) + ) + (set! (-> v1-2 turret-value arg0) f0-0) + f0-0 + ) + ) + ) + ) + +(defun set-fordumpa-electricity-scale! ((arg0 float)) + (let ((v1-1 (level-get *level* 'fordumpa))) + (when v1-1 + (let ((v1-2 (the-as fordumpa-states (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> v1-2 electricity scale) f0-0) + f0-0 + ) + ) + ) + ) + +(deftype fordumpc-states (structure) + ((light-flag symbol :offset-assert 0) + (pulse0 pulse-state :inline :offset-assert 4) + (pulse1 pulse-state :inline :offset-assert 8) + (strobe strobe-state :inline :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +(defun init-mood-fordumpc ((arg0 mood-context)) + (set! (-> (the-as fordumpc-states (-> arg0 state)) light-flag) #f) + #f + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-fordumpc time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-fortress-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + ((begin + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-pulse arg0 3 4 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 0.0) + (-> arg0 state 0) + ) + (set! (-> arg0 times 2 w) 0.0) + (update-mood-pulse arg0 4 8 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 16384.0) + (update-mood-strobe arg0 5 12 85 (* 16.0 (-> self clock seconds-per-frame))) + ) + (else + (set! (-> arg0 times 2 w) 1.0) + (set! (-> arg0 times 4 w) 0.0) + (set! (-> arg0 times 5 w) 0.0) + ) + ) + 0 + (none) + ) + +(defun set-fordumpc-light-flag! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'fordumpc))) + (when v1-1 + (set! (-> (the-as fordumpc-states (-> v1-1 mood-context state)) light-flag) arg0) + arg0 + ) + ) + ) + +(deftype forresca-states (structure) + ((pulse pulse-state :inline :offset-assert 0) + (electricity electricity-state 2 :inline :offset 4) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + + +(defun init-mood-forresca ((arg0 mood-context)) + (let ((v1-0 (the-as forresca-states (-> arg0 state)))) + (set! (-> v1-0 electricity 0 scale) 1.0) + (let ((f0-1 1.0)) + (set! (-> v1-0 electricity 1 scale) f0-1) + f0-1 + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-forresca time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-fortress-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-electricity arg0 5 4 0.8 1.0) + (update-mood-electricity arg0 6 20 0.8 1.0) + (update-mood-pulse arg0 7 0 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 0.0) + ) + ) + 0 + (none) + ) + +(defun set-forresca-electricity-scale! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'forresca))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as forresca-states v1-2) electricity arg1 scale) f0-0) + f0-0 + ) + ) + ) + ) + +(deftype forrescb-states (structure) + ((electricity electricity-state 2 :inline :offset-assert 0) + (turret float 4 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + + +(defun init-mood-forrescb ((arg0 mood-context)) + (let ((v1-0 (the-as forrescb-states (-> arg0 state)))) + (set! (-> v1-0 electricity 0 scale) 1.0) + (let ((f0-1 1.0)) + (set! (-> v1-0 electricity 1 scale) f0-1) + f0-1 + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-forrescb time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-fortress-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as forrescb-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-electricity arg0 6 0 0.8 1.0) + (update-mood-electricity arg0 7 16 0.8 1.0) + (set! (-> arg0 times 2 w) (-> gp-0 turret 0)) + (set! (-> arg0 times 3 w) (-> gp-0 turret 1)) + (set! (-> arg0 times 4 w) (-> gp-0 turret 2)) + (set! (-> arg0 times 5 w) (-> gp-0 turret 3)) + (when (not (paused?)) + (dotimes (v1-5 4) + (set! (-> gp-0 turret v1-5) (fmax 0.0 (+ -0.2 (-> gp-0 turret v1-5)))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defun set-forrescb-turret-flash! ((arg0 int)) + (let ((v1-1 (level-get *level* 'forrescb))) + (when v1-1 + (let ((v1-2 (-> v1-1 mood-context state)) + (f0-0 1.0) + ) + (set! (-> (the-as forrescb-states (+ (* arg0 4) (the-as int v1-2))) turret 0) f0-0) + f0-0 + ) + ) + ) + ) + +(defun set-forrescb-electricity-scale! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'forrescb))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as forrescb-states v1-2) electricity arg1 scale) f0-0) + f0-0 + ) + ) + ) + ) + +(deftype prison-states (structure) + ((pulse float :offset-assert 0) + (angle float :offset-assert 4) + (torture float :offset-assert 8) + (torture-flag symbol :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-prison-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (set-vector! (-> v1-0 0 dir0 color) 0.0 0.0 0.0 1.0) + (set-vector! (-> v1-0 0 ambi color) 0.2 0.2 0.2 1.0) + ) + (set! (-> arg0 light-group 0 dir0 extra x) 0.0) + 0 + (none) + ) + +(defun init-mood-prison ((arg0 mood-context)) + (let ((v1-0 (the-as prison-states (-> arg0 state)))) + (set! (-> v1-0 torture-flag) #f) + (let ((f0-0 0.0)) + (set! (-> v1-0 torture) f0-0) + f0-0 + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-prison time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-prison-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as prison-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 3 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) (-> gp-0 pulse)) + (if (task-node-closed? (game-task-node fortress-save-friends-resolution)) + (set! (-> arg0 times 7 w) 1.0) + (set! (-> arg0 times 7 w) 0.0) + ) + (set! (-> arg0 times 2 w) (-> gp-0 torture)) + (when (not (paused?)) + (set! (-> gp-0 pulse) (+ 1.125 (* 0.125 (cos (-> gp-0 angle))))) + (let ((f0-14 (+ (-> gp-0 angle) (* 32768.0 (-> self clock seconds-per-frame))))) + (set! (-> gp-0 angle) (- f0-14 (* (the float (the int (/ f0-14 65536.0))) 65536.0))) + ) + (if (-> gp-0 torture-flag) + (seek! (-> gp-0 torture) 1.0 (-> self clock seconds-per-frame)) + (seek! (-> gp-0 torture) 0.0 (-> self clock seconds-per-frame)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-prison time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'prison))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +(defun set-prison-torture-flag! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'prison))) + (when v1-1 + (set! (-> (the-as prison-states (-> v1-1 mood-context state)) torture-flag) arg0) + arg0 + ) + ) + ) + +(deftype under-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (rot float :offset-assert 16) + (rot2 float :offset-assert 20) + (time float :offset-assert 24) + (laser float :offset-assert 28) + (fog-interp float :offset-assert 32) + (flicker float :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + + +(defun update-under-lights ((arg0 mood-context)) + (local-vars (sv-80 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let* ((v1-0 (the-as under-states (-> arg0 state))) + (a2-0 (new 'stack-no-clear 'matrix)) + (a1-0 (-> arg0 current-fog)) + (f0-0 (-> v1-0 fog-interp)) + ) + (set-vector! (-> a2-0 vector 0) 0.0 40.2343 59.5468 128.0) + (set-vector! (-> a2-0 vector 1) 0.0 524288.0 200.0 8.0) + (set-vector! (-> a2-0 vector 2) 0.0 40.2343 59.5468 128.0) + (set-vector! (-> a1-0 fog-color) 0.0 40.2343 59.5468 128.0) + (set-vector! (-> a1-0 fog-dists) 524288.0 1048576.0 255.0 8.0) + (set-vector! (-> a1-0 erase-color) 0.0 40.2343 59.5468 128.0) + (set-vector! (-> a1-0 erase-color) 0.0 40.2343 59.5468 128.0) + (vector4-array-lerp! + (the-as (inline-array vector4) a1-0) + (the-as (inline-array vector4) a1-0) + (the-as (inline-array vector4) a2-0) + f0-0 + 3 + ) + ) + (let ((s2-0 (-> arg0 light-group)) + (s3-0 (-> arg0 light-group 1)) + (s4-0 (-> arg0 light-group 2)) + (s5-0 (-> arg0 light-group 3)) + (gp-1 (-> arg0 light-group 4)) + ) + (let ((s1-0 (new 'static 'vector :x 0.8645 :z -0.5294))) + (set! sv-80 (new 'static 'vector :x -2.0 :z 1950.0)) + (let ((v0-1 (target-pos 0)) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-10 s0-0)) + (.lvf vf4 (&-> v0-1 quad)) + (.lvf vf5 (&-> sv-80 quad)) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-10 quad) vf6) + ) + (vector-normalize! s0-0 1.0) + (cond + ((>= (vector-dot s1-0 s0-0) 0.0) + (set-vector! (-> s2-0 0 dir0 color) 0.6 0.5 0.7 1.0) + (set-vector! (-> s2-0 0 ambi color) 0.3 0.3 0.3 1.0) + ) + (else + (set-vector! (-> s2-0 0 dir0 color) 0.2 0.2 0.4 1.0) + (set-vector! (-> s2-0 0 ambi color) 0.2 0.2 0.2 1.0) + ) + ) + ) + ) + (let ((v1-16 (-> s3-0 dir0))) + (set! (-> v1-16 direction x) 0.0) + (set! (-> v1-16 direction y) 1.0) + (set! (-> v1-16 direction z) 0.0) + (set! (-> v1-16 direction w) 0.0) + ) + (set-vector! (-> s3-0 dir0 color) 0.0 0.0 0.0 1.0) + (set-vector! (-> s3-0 ambi color) 1.0 1.0 1.0 1.0) + (set! (-> s3-0 dir0 extra x) 0.0) + (set! (-> s3-0 dir1 extra x) 0.0) + (set! (-> s3-0 dir2 extra x) 0.0) + (set! (-> s3-0 ambi extra x) 1.0) + (let ((v1-20 (-> s4-0 dir0))) + (set! (-> v1-20 direction x) 0.0) + (set! (-> v1-20 direction y) -1.0) + (set! (-> v1-20 direction z) 0.0) + (set! (-> v1-20 direction w) 0.0) + ) + (let ((v1-21 (-> s4-0 dir1))) + (set! (-> v1-21 direction x) 0.0) + (set! (-> v1-21 direction y) 1.0) + (set! (-> v1-21 direction z) 0.0) + (set! (-> v1-21 direction w) 0.0) + ) + (set-vector! (-> s4-0 dir0 color) 0.3 0.4 0.6 1.0) + (set-vector! (-> s4-0 dir1 color) 0.3 0.4 0.6 1.0) + (set-vector! (-> s4-0 ambi color) 0.15 0.3 0.6 1.0) + (set! (-> s4-0 dir0 extra x) 1.0) + (set! (-> s4-0 dir1 extra x) 1.0) + (set! (-> s4-0 dir2 extra x) 0.0) + (set! (-> s4-0 ambi extra x) 1.0) + (let ((v1-28 (-> s5-0 dir0))) + (set! (-> v1-28 direction x) 0.0) + (set! (-> v1-28 direction y) 1.0) + (set! (-> v1-28 direction z) 0.0) + (set! (-> v1-28 direction w) 0.0) + ) + (set-vector! (-> s5-0 dir0 color) 0.3 0.25 0.35 1.0) + (set-vector! (-> s5-0 ambi color) 0.3 0.3 0.3 1.0) + (set! (-> s5-0 dir0 extra x) 0.65) + (set! (-> s5-0 dir1 extra x) 0.0) + (set! (-> s5-0 dir2 extra x) 0.0) + (set! (-> s5-0 ambi extra x) 1.0) + (let ((v1-33 (-> gp-1 dir0))) + (set! (-> v1-33 direction x) 0.0) + (set! (-> v1-33 direction y) 1.0) + (set! (-> v1-33 direction z) 0.0) + (set! (-> v1-33 direction w) 0.0) + ) + (set-vector! (-> gp-1 dir0 color) 0.3 0.25 0.45 1.0) + (set-vector! (-> gp-1 ambi color) 0.3 0.3 0.3 1.0) + (set! (-> gp-1 dir0 extra x) 0.5) + (set! (-> gp-1 dir1 extra x) 0.0) + (set! (-> gp-1 dir2 extra x) 0.0) + (let ((f0-90 0.5)) + (set! (-> gp-1 ambi extra x) f0-90) + f0-90 + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-under time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-under-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as under-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-caustics arg0 6 (-> gp-0 rot) 0.0 0.75 0.5) + (update-mood-caustics arg0 7 (-> gp-0 rot) 21845.334 0.75 0.5) + (update-mood-caustics arg0 3 (-> gp-0 rot2) 43690.668 0.75 0.25) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (let ((f0-6 (fmin 1.0 (+ (-> gp-0 flicker) (-> gp-0 laser))))) + (set! (-> arg0 times 4 w) f0-6) + (set! (-> arg0 times 5 w) (- 1.0 f0-6)) + ) + (when (movie?) + (set! (-> arg0 times 4 w) 0.0) + (set! (-> arg0 times 5 w) 0.0) + ) + (when (not (paused?)) + (+! (-> gp-0 time) (* 300.0 (-> self clock seconds-per-frame))) + (+! (-> gp-0 rot) (* 32768.0 (-> self clock seconds-per-frame))) + (+! (-> gp-0 rot2) (* 16384.0 (-> self clock seconds-per-frame))) + (set! (-> gp-0 flicker) (rand-vu-float-range 0.0 0.1)) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-underb time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'underb))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +(defun set-under-laser! ((arg0 float)) + (let ((v1-1 (level-get *level* 'under))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as under-states v1-2) laser) arg0) + ) + ) + ) + (let ((v1-4 (level-get *level* 'underb))) + (when v1-4 + (let ((v1-5 (the-as object (-> v1-4 mood-context state))) + (f0-1 arg0) + ) + (set! (-> (the-as under-states v1-5) laser) f0-1) + f0-1 + ) + ) + ) + ) + +(defun set-under-fog-interp! ((arg0 float)) + (let ((v1-1 (level-get *level* 'under))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as under-states v1-2) fog-interp) arg0) + ) + ) + ) + (let ((v1-4 (level-get *level* 'underb))) + (when v1-4 + (let ((v1-5 (the-as object (-> v1-4 mood-context state))) + (f0-1 arg0) + ) + (set! (-> (the-as under-states v1-5) fog-interp) f0-1) + f0-1 + ) + ) + ) + ) + +(deftype gungame-states (structure) + ((florescent florescent-state :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-gungame-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (let ((a0-1 (-> v1-0 0))) + (set! (-> a0-1 dir0 direction x) 0.0) + (set! (-> a0-1 dir0 direction y) 0.955) + (set! (-> a0-1 dir0 direction z) 0.3) + (set! (-> a0-1 dir0 direction w) 1.0) + ) + (set-vector! (-> v1-0 0 dir0 color) 1.0 1.0 0.7 1.0) + (set-vector! (-> v1-0 0 ambi color) 0.65 0.589 0.406 1.0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-gungame time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-gungame-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + ) + ) + 0 + (none) + ) + +(deftype dig1-states (structure) + ((pulse0 pulse-state :inline :offset-assert 0) + (pulse1 pulse-state :inline :offset-assert 4) + (explosion float :offset-assert 8) + (drillbit float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +(defun init-mood-dig1 ((arg0 mood-context)) + (let ((v1-0 (the-as object (-> arg0 state))) + (f0-0 0.0) + ) + (set! (-> (the-as dig1-states v1-0) explosion) f0-0) + f0-0 + ) + ) + +;; WARN: Return type mismatch int vs none. +(defun update-dig1-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 current-fog))) + (set-vector! (-> v1-0 fog-color) 205.0 90.0 90.0 128.0) + (set-vector! (-> v1-0 fog-dists) 294912.0 1802240.0 255.0 187.5) + (set-vector! (-> v1-0 erase-color) 54.2635 23.823 23.823 128.0) + ) + (set-vector! (-> arg0 current-env-color) 0.0 0.0 0.0 0.0) + (let ((t2-0 (-> arg0 light-group)) + (t1-0 (-> arg0 light-group 1)) + (t0-0 (-> arg0 light-group 2)) + (a3-0 (-> arg0 light-group 3)) + (a2-8 (-> arg0 light-group 4)) + (a1-6 (-> arg0 light-group 5)) + (v1-3 (-> arg0 light-group 6)) + ) + (let ((a0-1 (-> t2-0 0))) + (set! (-> a0-1 dir0 direction x) 0.0) + (set! (-> a0-1 dir0 direction y) 0.955) + (set! (-> a0-1 dir0 direction z) 0.3) + (set! (-> a0-1 dir0 direction w) 1.0) + ) + (set-vector! (-> t2-0 0 dir0 color) 0.9 0.6 0.6 1.0) + (let ((a0-3 (-> t2-0 0 dir1))) + (set! (-> a0-3 direction x) 0.0) + (set! (-> a0-3 direction y) -1.0) + (set! (-> a0-3 direction z) 0.0) + (set! (-> a0-3 direction w) 1.0) + ) + (set-vector! (-> t2-0 0 dir1 color) 0.9 0.3 0.3 1.0) + (set-vector! (-> t2-0 0 ambi color) 0.65 0.589 0.406 1.0) + (set! (-> t2-0 0 dir0 extra x) 0.9) + (set! (-> t2-0 0 dir1 extra x) 0.3) + (set! (-> t2-0 0 ambi extra x) 0.45) + (let ((a0-9 (-> t1-0 dir0))) + (set! (-> a0-9 direction x) 0.0) + (set! (-> a0-9 direction y) 0.955) + (set! (-> a0-9 direction z) 0.3) + (set! (-> a0-9 direction w) 1.0) + ) + (set-vector! (-> t1-0 dir0 color) 1.0 0.6 0.6 1.0) + (let ((a0-11 (-> t1-0 dir1))) + (set! (-> a0-11 direction x) 0.0) + (set! (-> a0-11 direction y) -0.955) + (set! (-> a0-11 direction z) -0.3) + (set! (-> a0-11 direction w) 1.0) + ) + (set-vector! (-> t1-0 dir1 color) 0.9 0.4 0.3 1.0) + (set-vector! (-> t1-0 ambi color) 0.65 0.55 0.25 1.0) + (set! (-> t1-0 dir0 extra x) 0.2) + (set! (-> t1-0 dir1 extra x) 0.85) + (set! (-> t1-0 ambi extra x) 0.5) + (let ((a0-17 (-> t0-0 dir0))) + (set! (-> a0-17 direction x) 0.0) + (set! (-> a0-17 direction y) 0.955) + (set! (-> a0-17 direction z) 0.3) + (set! (-> a0-17 direction w) 1.0) + ) + (set-vector! (-> t0-0 dir0 color) 0.8 0.5 0.4 1.0) + (set-vector! (-> t0-0 ambi color) 0.6 0.4 0.3 1.0) + (set! (-> t0-0 dir0 extra x) 0.5) + (set! (-> t0-0 ambi extra x) 0.4) + (let ((a0-22 (-> a3-0 dir0))) + (set! (-> a0-22 direction x) 0.5299) + (set! (-> a0-22 direction y) 0.8479) + (set! (-> a0-22 direction z) 0.0) + (set! (-> a0-22 direction w) 1.0) + ) + (set-vector! (-> a3-0 dir0 color) 1.0 1.0 1.0 1.0) + (let ((a0-24 (-> a3-0 dir1))) + (set! (-> a0-24 direction x) 0.0) + (set! (-> a0-24 direction y) -1.0) + (set! (-> a0-24 direction z) 0.0) + (set! (-> a0-24 direction w) 1.0) + ) + (set-vector! (-> a3-0 dir1 color) 0.9 0.3 0.3 1.0) + (set-vector! (-> a3-0 ambi color) 0.5 0.5 0.5 1.0) + (set! (-> a3-0 dir0 extra x) 1.0) + (set! (-> a3-0 dir1 extra x) 0.5) + (set! (-> a3-0 ambi extra x) 0.6) + (let ((a0-30 (-> a2-8 dir0))) + (set! (-> a0-30 direction x) 0.3) + (set! (-> a0-30 direction y) 0.955) + (set! (-> a0-30 direction z) 0.0) + (set! (-> a0-30 direction w) 1.0) + ) + (set-vector! (-> a2-8 dir0 color) 1.0 1.0 1.0 1.0) + (let ((a0-32 (-> a2-8 dir1))) + (set! (-> a0-32 direction x) 0.0) + (set! (-> a0-32 direction y) -1.0) + (set! (-> a0-32 direction z) 0.0) + (set! (-> a0-32 direction w) 1.0) + ) + (set-vector! (-> a2-8 dir1 color) 0.9 0.3 0.3 1.0) + (set-vector! (-> a2-8 ambi color) 0.5 0.5 0.5 1.0) + (set! (-> a2-8 dir0 extra x) 1.0) + (set! (-> a2-8 dir1 extra x) 0.5) + (set! (-> a2-8 ambi extra x) 0.6) + (let ((a0-38 (-> a1-6 dir0))) + (set! (-> a0-38 direction x) 0.3) + (set! (-> a0-38 direction y) 0.955) + (set! (-> a0-38 direction z) 0.0) + (set! (-> a0-38 direction w) 1.0) + ) + (set-vector! (-> a1-6 dir0 color) 1.0 1.0 1.0 1.0) + (let ((a0-40 (-> a1-6 dir1))) + (set! (-> a0-40 direction x) 0.0) + (set! (-> a0-40 direction y) -1.0) + (set! (-> a0-40 direction z) 0.0) + (set! (-> a0-40 direction w) 1.0) + ) + (set-vector! (-> a1-6 dir1 color) 0.8 0.5 0.3 1.0) + (set-vector! (-> a1-6 ambi color) 0.5 0.4 0.4 1.0) + (set! (-> a1-6 dir0 extra x) 1.0) + (set! (-> a1-6 dir1 extra x) 1.4) + (set! (-> a1-6 ambi extra x) 0.6) + (let ((a0-46 (-> v1-3 dir0))) + (set! (-> a0-46 direction x) 0.3) + (set! (-> a0-46 direction y) 0.955) + (set! (-> a0-46 direction z) 0.0) + (set! (-> a0-46 direction w) 1.0) + ) + (set-vector! (-> v1-3 dir0 color) 0.8 0.9 0.5 1.0) + (let ((a0-48 (-> v1-3 dir1))) + (set! (-> a0-48 direction x) 0.5299) + (set! (-> a0-48 direction y) 0.8479) + (set! (-> a0-48 direction z) 0.0) + (set! (-> a0-48 direction w) 1.0) + ) + (set-vector! (-> v1-3 dir1 color) 0.6 0.4 0.3 1.0) + (set-vector! (-> v1-3 ambi color) 0.6 0.5 0.4 1.0) + (set! (-> v1-3 dir0 extra x) 0.6) + (set! (-> v1-3 dir1 extra x) 0.55) + (set! (-> v1-3 ambi extra x) 0.5) + ) + 0 + (none) + ) + +;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-dig1 time-of-day-proc ((arg0 mood-context)) + (local-vars (sv-16 float) (sv-32 float)) + (update-mood-interior arg0) + (update-dig1-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as dig1-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (let ((s4-0 update-mood-pulse) + (s3-0 arg0) + (s2-0 2) + (s1-0 0) + (s0-0 0.85) + ) + (set! sv-16 0.15) + (let ((t1-0 (* 182.04445 (-> self clock seconds-per-frame) (rand-vu-float-range 60.0 200.0))) + (t2-0 0.0) + ) + (s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0 t2-0) + ) + ) + (let ((s4-1 update-mood-pulse) + (s3-1 arg0) + (s2-1 3) + (s1-1 4) + (s0-1 0.85) + ) + (set! sv-32 0.15) + (let ((t1-1 (* 182.04445 (-> self clock seconds-per-frame) (rand-vu-float-range 120.0 180.0))) + (t2-1 16384.0) + ) + (s4-1 s3-1 s2-1 s1-1 s0-1 sv-32 t1-1 t2-1) + ) + ) + (set! (-> arg0 times 6 w) 1.0) + (if (not (task-node-closed? (game-task-node dig-knock-down-resolution))) + (set! (-> arg0 times 5 w) (-> gp-0 drillbit)) + ) + (when (!= (-> gp-0 explosion) 0.0) + (set! (-> arg0 times 7 w) (-> gp-0 explosion)) + (let ((f0-15 (- 1.0 (* 0.5 (-> gp-0 explosion))))) + (set! (-> arg0 times 2 w) (* (-> arg0 times 2 w) f0-15)) + (set! (-> arg0 times 3 w) (* (-> arg0 times 3 w) f0-15)) + (set! (-> arg0 times 0 w) (* (-> arg0 times 0 w) f0-15)) + (set! (-> arg0 times 1 w) (* (-> arg0 times 1 w) f0-15)) + ) + ) + (when (not (paused?)) + (set! (-> gp-0 drillbit) (rand-vu-float-range 0.5 1.0)) + (seek! (-> gp-0 explosion) 0.0 (* 2.5 (-> self clock seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + +(defun set-dig1-explosion! ((arg0 float)) + (let ((v1-1 (level-get *level* 'dig1))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 1.9921875) + ) + (set! (-> (the-as dig1-states v1-2) explosion) f0-0) + f0-0 + ) + ) + ) + ) + +(deftype vortex-states (structure) + ((time float :offset-assert 0) + (level float :offset-assert 4) + (delta float :offset-assert 8) + (scale float :offset-assert 12) + (flash float :offset-assert 16) + (num int32 :offset-assert 20) + (white symbol :offset-assert 24) + (white-count float :offset-assert 28) + (pos vector :inline :offset-assert 32) + (dir vector :inline :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-vortex-lights ((arg0 mood-context)) + (set-vector! (-> arg0 current-env-color) 96.0 48.0 196.0 255.0) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-vortex time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-vortex-lights arg0) + (let ((a1-0 (-> arg0 light-group)) + (s5-0 (-> arg0 light-group 1)) + (gp-1 (the-as vortex-states (-> arg0 state))) + ) + (set-vector! (-> a1-0 0 ambi color) 0.2 0.2 0.5 1.0) + (set! (-> a1-0 0 ambi extra x) 1.0) + (set-vector! (-> a1-0 0 dir0 color) 0.5 0.4 0.8 1.0) + (set! (-> a1-0 0 dir0 direction quad) (-> gp-1 dir quad)) + (set! (-> a1-0 0 dir0 extra x) (-> gp-1 level)) + (set-vector! (-> a1-0 0 dir1 color) 0.0 0.0 0.0 0.0) + (let ((v1-5 (-> a1-0 0 dir1))) + (set! (-> v1-5 direction x) 0.0) + (set! (-> v1-5 direction y) 0.0) + (set! (-> v1-5 direction z) 1.0) + (set! (-> v1-5 direction w) 0.0) + ) + (set! (-> a1-0 0 dir1 extra x) 0.0) + (set! (-> a1-0 0 dir2 extra x) 0.0) + (mem-copy! (the-as pointer s5-0) (the-as pointer a1-0) 192) + (cond + ((-> gp-1 white) + (set-vector! (-> s5-0 dir1 color) 1.0 1.0 1.0 1.0) + (set-vector! (-> s5-0 dir2 color) 1.0 1.0 1.0 1.0) + (let ((v1-9 (-> s5-0 dir1))) + (set! (-> v1-9 direction x) 0.0) + (set! (-> v1-9 direction y) -0.707) + (set! (-> v1-9 direction z) 0.707) + (set! (-> v1-9 direction w) 0.0) + ) + (let ((v1-10 (-> s5-0 dir2))) + (set! (-> v1-10 direction x) 0.0) + (set! (-> v1-10 direction y) 0.707) + (set! (-> v1-10 direction z) 0.707) + (set! (-> v1-10 direction w) 0.0) + ) + (set! (-> s5-0 dir1 extra x) (fmin 1.0 (* 0.21739131 (-> gp-1 white-count)))) + (set! (-> s5-0 dir2 extra x) (-> s5-0 dir1 extra x)) + ) + (else + (set-vector! (-> s5-0 dir1 color) 0.1 0.3 0.5 1.0) + (let ((v1-15 (-> s5-0 dir1))) + (set! (-> v1-15 direction x) 0.0) + (set! (-> v1-15 direction y) -0.177) + (set! (-> v1-15 direction z) 0.984) + (set! (-> v1-15 direction w) 0.0) + ) + (set! (-> s5-0 dir1 extra x) 1.0) + ) + ) + (when (not (paused?)) + (if (-> gp-1 white) + (+! (-> gp-1 white-count) (-> *display* base-clock seconds-per-frame)) + ) + (cond + ((< 0.0 (-> gp-1 flash)) + (set! (-> gp-1 level) (-> gp-1 flash)) + (set-vector! (-> gp-1 dir) 0.0 0.0 1.0 0.0) + (set! (-> gp-1 flash) (- (-> gp-1 flash) (* 0.5 (-> *display* base-clock seconds-per-frame)))) + (set! (-> gp-1 time) 0.0) + ) + (else + (when (>= 0.0 (-> gp-1 time)) + (set! (-> gp-1 num) (the int (rand-vu-float-range 0.0 4.0))) + (set! (-> gp-1 scale) (rand-vu-float-range 0.75 1.5)) + (if (< (-> gp-1 num) 3) + (set! (-> gp-1 time) (rand-vu-float-range 0.25 0.5)) + (set! (-> gp-1 time) (rand-vu-float-range 0.0 0.5)) + ) + (set-vector! + (-> gp-1 pos) + (rand-vu-float-range -8192.0 8192.0) + (rand-vu-float-range -8192.0 8192.0) + 102400.0 + 0.0 + ) + (set! (-> gp-1 delta) (/ 204800.0 (-> gp-1 time))) + ) + (when (< (-> gp-1 num) 3) + (let ((f30-0 (vector-length (-> gp-1 pos)))) + (set! (-> gp-1 dir quad) (-> gp-1 pos quad)) + (vector-normalize! (-> gp-1 dir) 1.0) + (set! (-> gp-1 level) (* (-> gp-1 scale) (- 1.0 (fmin 1.0 (* 0.000009765625 f30-0))))) + ) + (set! (-> gp-1 pos z) (- (-> gp-1 pos z) (* (-> gp-1 delta) (-> *display* base-clock seconds-per-frame)))) + ) + (set! (-> gp-1 time) (- (-> gp-1 time) (-> *display* base-clock seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + +(defun set-vortex-flash! ((arg0 float)) + (let ((v1-1 (level-get *level* 'introcst))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as vortex-states v1-2) flash) 1.0) + ) + ) + ) + (let ((v1-4 (level-get *level* 'lintcstb))) + (when v1-4 + (let ((v1-5 (the-as object (-> v1-4 mood-context state))) + (f0-1 1.0) + ) + (set! (-> (the-as vortex-states v1-5) flash) f0-1) + f0-1 + ) + ) + ) + ) + +(defun set-vortex-white! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'introcst))) + (when v1-1 + (let ((v1-2 (the-as vortex-states (-> v1-1 mood-context state)))) + (set! (-> v1-2 white) arg0) + (set! (-> v1-2 white-count) 0.0) + ) + ) + ) + (let ((v1-4 (level-get *level* 'lintcstb))) + (when v1-4 + (let ((v1-5 (the-as vortex-states (-> v1-4 mood-context state)))) + (set! (-> v1-5 white) arg0) + (let ((f0-1 0.0)) + (set! (-> v1-5 white-count) f0-1) + f0-1 + ) + ) + ) + ) + ) + +(deftype nestb-states (structure) + ((pulse pulse-state :inline :offset-assert 0) + (rot float :offset-assert 4) + (purple float :offset-assert 8) + (purple-noise float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +;; WARN: Return type mismatch pointer vs none. +(defun update-nestb-lights ((arg0 mood-context)) + (let ((gp-0 (-> arg0 light-group 1))) + (let ((v1-0 (-> arg0 current-fog))) + (set! (-> v1-0 fog-color x) 37.5625) + (set! (-> v1-0 fog-color y) 18.875) + (set! (-> v1-0 fog-color z) 70.0) + (set! (-> v1-0 fog-color w) 128.0) + ) + (set-vector! (-> arg0 current-fog fog-dists) 0.0 819200.0 255.0 16.0) + (set-vector! (-> arg0 current-fog erase-color) 33.806248 16.9875 63.0 128.0) + (let ((v1-4 (level-get *level* 'nest))) + (if v1-4 + (mem-copy! (the-as pointer gp-0) (the-as pointer (-> v1-4 mood-context light-group)) 192) + (mem-copy! (the-as pointer gp-0) (the-as pointer (-> *level* default-level mood-context light-group)) 192) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-nestb time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) + (copy-mood-exterior-ambi arg0 #f) + (update-mood-interior arg0) + (update-nestb-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as nestb-states (-> arg0 state)))) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-caustics arg0 2 (-> gp-1 rot) 10922.667 0.75 0.25) + (update-mood-caustics arg0 3 (-> gp-1 rot) 0.0 0.75 0.25) + (update-mood-pulse arg0 4 0 0.875 0.125 (* 196608.0 (-> self clock seconds-per-frame)) 0.0) + (set! (-> arg0 times 5 w) (+ (-> gp-1 purple) (-> gp-1 purple-noise))) + (when (not (paused?)) + (seek! (-> gp-1 purple) 0.0 (* 4.0 (-> self clock seconds-per-frame))) + (set! (-> gp-1 purple-noise) (rand-vu-float-range 0.0 (* 0.2 (-> gp-1 purple)))) + (+! (-> gp-1 rot) (* 16384.0 (-> self clock seconds-per-frame))) + ) + ) + ) + 0 + (none) + ) + +(defun set-nestb-purple! ((arg0 float)) + (let ((v1-1 (level-get *level* 'nestb))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as nestb-states v1-2) purple) f0-0) + f0-0 + ) + ) + ) + ) + +(defun get-nestb-purple () + (let ((v1-1 (level-get *level* 'nestb))) + (if v1-1 + (-> (the-as nestb-states (-> v1-1 mood-context state)) purple) + 0.0 + ) + ) + ) + +(deftype consiteb-states (structure) + ((flicker float :offset-assert 0) + (flicker-count float :offset-assert 4) + (flicker-state int32 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + + +;; WARN: Return type mismatch int vs none. +(defun init-mood-consiteb ((arg0 mood-context)) + (let ((v1-0 (the-as consiteb-states (-> arg0 state)))) + (set! (-> v1-0 flicker) 1.0) + (set! (-> v1-0 flicker-state) 0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-consiteb time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) + (copy-mood-exterior-ambi arg0 #f) + (update-mood-interior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as consiteb-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 0.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 2 w) (-> gp-1 flicker)) + (when (not (paused?)) + (let ((v1-9 (-> gp-1 flicker-state))) + (cond + ((zero? v1-9) + (set! (-> gp-1 flicker) (rand-vu-float-range 0.2 0.4)) + (set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (-> self clock seconds-per-frame))) + (when (>= 0.0 (-> gp-1 flicker-count)) + (set! (-> gp-1 flicker-count) (rand-vu-float-range 0.25 1.0)) + (set! (-> gp-1 flicker-state) 1) + ) + ) + ((= v1-9 1) + (set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (-> self clock seconds-per-frame))) + (when (>= 0.0 (-> gp-1 flicker-count)) + (set! (-> gp-1 flicker-count) (rand-vu-float-range 0.1 0.5)) + (set! (-> gp-1 flicker-state) 2) + ) + ) + ((= v1-9 2) + (set! (-> gp-1 flicker) (rand-vu-float-range 0.25 0.75)) + (set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (-> self clock seconds-per-frame))) + (when (>= 0.0 (-> gp-1 flicker-count)) + (set! (-> gp-1 flicker-count) (rand-vu-float-range 0.25 1.0)) + (set! (-> gp-1 flicker-state) 3) + ) + ) + (else + (set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (-> self clock seconds-per-frame))) + (when (>= 0.0 (-> gp-1 flicker-count)) + (set! (-> gp-1 flicker-count) (rand-vu-float-range 0.1 0.5)) + (set! (-> gp-1 flicker-state) 0) + 0 + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype castle-states (structure) + ((electricity electricity-state :inline :offset-assert 0) + (pulse pulse-state 2 :inline :offset-assert 8) + (rot float :offset-assert 40) + (robot-rot float :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-castle-lights ((arg0 mood-context)) + (let ((a2-0 (-> arg0 light-group)) + (a1-0 (-> arg0 light-group 1)) + (v1-0 (-> arg0 light-group 2)) + ) + (let ((a3-0 (-> arg0 current-fog))) + (set! (-> a3-0 fog-color x) 95.625) + (set! (-> a3-0 fog-color y) 135.4687) + (set! (-> a3-0 fog-color z) 69.0625) + (set! (-> a3-0 fog-color w) 1.0) + ) + (set-vector! (-> arg0 current-fog fog-dists) 253952.0 901120.0 255.0 147.0) + (set-vector! (-> arg0 current-fog erase-color) 0.0 0.0 0.0 128.0) + (set-vector! (-> arg0 current-env-color) 96.0 96.0 96.0 255.0) + (let ((a3-4 (-> a2-0 0))) + (set! (-> a3-4 dir0 direction x) 0.6499) + (set! (-> a3-4 dir0 direction y) 0.7134) + (set! (-> a3-4 dir0 direction z) 0.2619) + (set! (-> a3-4 dir0 direction w) 1.0) + ) + (set-vector! (-> a2-0 0 dir0 color) 0.65 0.575 0.575 1.0) + (let ((a3-6 (-> a2-0 0 dir1))) + (set! (-> a3-6 direction x) -0.6499) + (set! (-> a3-6 direction y) 0.7134) + (set! (-> a3-6 direction z) -0.2619) + (set! (-> a3-6 direction w) 1.0) + ) + (set-vector! (-> a2-0 0 dir1 color) 0.75 0.6 0.5 1.0) + (set-vector! (-> a2-0 0 ambi color) 0.2 0.2 0.25 1.0) + (set! (-> a2-0 0 dir0 extra x) 0.65) + (set! (-> a2-0 0 dir1 extra x) 1.0) + (set! (-> a2-0 0 ambi extra x) 0.7) + (let ((a2-1 (-> a1-0 dir0))) + (set! (-> a2-1 direction x) 0.0) + (set! (-> a2-1 direction y) 1.0) + (set! (-> a2-1 direction z) 0.0) + (set! (-> a2-1 direction w) 1.0) + ) + (set-vector! (-> a1-0 dir0 color) 0.7 0.8 0.5 1.0) + (let ((a2-3 (-> a1-0 dir1))) + (set! (-> a2-3 direction x) 0.5299) + (set! (-> a2-3 direction y) -0.8479) + (set! (-> a2-3 direction z) 0.0) + (set! (-> a2-3 direction w) 1.0) + ) + (set-vector! (-> a1-0 dir1 color) 0.5 0.6 0.0 1.0) + (let ((a2-5 (-> a1-0 dir2))) + (set! (-> a2-5 direction x) -0.5299) + (set! (-> a2-5 direction y) -0.8479) + (set! (-> a2-5 direction z) 0.0) + (set! (-> a2-5 direction w) 1.0) + ) + (set-vector! (-> a1-0 dir2 color) 0.5 0.6 0.0 1.0) + (set-vector! (-> a1-0 ambi color) 0.2 0.2 0.25 1.0) + (set! (-> a1-0 dir0 extra x) 0.7) + (set! (-> a1-0 dir1 extra x) 0.8) + (set! (-> a1-0 dir2 extra x) 0.8) + (set! (-> a1-0 ambi extra x) 0.7) + (let ((a1-1 (-> v1-0 dir0))) + (set! (-> a1-1 direction x) 0.0) + (set! (-> a1-1 direction y) 0.717) + (set! (-> a1-1 direction z) 0.717) + (set! (-> a1-1 direction w) 1.0) + ) + (set-vector! (-> v1-0 dir0 color) 0.5 0.5 0.7 1.0) + (let ((a1-3 (-> v1-0 dir1))) + (set! (-> a1-3 direction x) 0.0) + (set! (-> a1-3 direction y) 0.717) + (set! (-> a1-3 direction z) -0.717) + (set! (-> a1-3 direction w) 1.0) + ) + (set-vector! (-> v1-0 dir1 color) 0.5 0.5 0.8 1.0) + (set-vector! (-> v1-0 ambi color) 0.2 0.2 0.25 1.0) + (set! (-> v1-0 dir0 extra x) (-> arg0 times 4 w)) + (set! (-> v1-0 dir1 extra x) (-> arg0 times 5 w)) + (set! (-> v1-0 ambi extra x) 0.75) + ) + 0 + (none) + ) + +(defun init-mood-castle ((arg0 mood-context)) + (let ((v1-0 (the-as object (-> arg0 state))) + (f0-0 1.0) + ) + (set! (-> (the-as castle-states v1-0) electricity scale) f0-0) + f0-0 + ) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-castle time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((s5-0 (the-as castle-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-caustics arg0 2 (-> s5-0 rot) 0.0 0.8 0.5) + (update-mood-caustics arg0 3 (-> s5-0 rot) 32768.0 0.8 0.5) + (let ((f0-7 (+ 0.75 (* 0.25 (sin (-> s5-0 robot-rot)))))) + (set! (-> arg0 times 6 x) f0-7) + (set! (-> arg0 times 6 y) f0-7) + ) + (set! (-> arg0 times 6 w) 1.0) + (update-mood-pulse arg0 4 8 1.15 0.15 (* 43690.668 (-> self clock seconds-per-frame)) 0.0) + (update-mood-pulse arg0 5 24 1.3 0.2 (* 54613.332 (-> self clock seconds-per-frame)) 0.0) + (update-mood-electricity arg0 7 0 0.9 1.0) + (when (not (paused?)) + (+! (-> s5-0 rot) (* 13107.2 (-> self clock seconds-per-frame))) + (+! (-> s5-0 robot-rot) (* 32768.0 (-> self clock seconds-per-frame))) + ) + ) + ) + ) + (update-castle-lights arg0) + 0 + (none) + ) + +(defun set-castle-electricity-scale! ((arg0 float)) + (let ((v1-1 (level-get *level* 'castle))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as castle-states v1-2) electricity scale) f0-0) + f0-0 + ) + ) + ) + ) + +(deftype garage-states (structure) + () + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + + +(defun init-mood-garage ((arg0 mood-context)) + (-> arg0 state) + #f + ) + +;; WARN: Return type mismatch int vs none. +(defun update-garage-lights ((arg0 mood-context)) + (let ((a1-0 (-> *level* default-level mood-context)) + (a0-1 (-> arg0 current-fog)) + ) + (mem-copy! (the-as pointer a0-1) (the-as pointer a1-0) 48) + ) + (let ((s4-0 (-> *level* default-level mood-context light-group)) + (a1-1 (-> arg0 light-group)) + (s5-0 (-> arg0 light-group 1)) + (gp-1 (-> arg0 light-group 2)) + ) + (mem-copy! (the-as pointer s5-0) (the-as pointer a1-1) 192) + (set! (-> s5-0 dir0 extra x) 0.5) + (set! (-> s5-0 ambi extra x) 0.0) + (mem-copy! (the-as pointer gp-1) (the-as pointer s4-0) 192) + (set! (-> gp-1 dir0 extra x) 0.0) + (set! (-> gp-1 dir1 extra x) 0.0) + (set! (-> gp-1 dir2 extra x) 0.0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-garage time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) + (copy-mood-exterior-ambi arg0 #f) + (update-mood-interior arg0) + (update-garage-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (set! (-> arg0 times 6 w) 0.75) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-garage time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'garage))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +(deftype palshaft-states (structure) + () + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + + +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-palshaft time-of-day-proc ((arg0 mood-context)) + (copy-mood-exterior-ambi arg0 #f) + (update-mood-interior arg0) + (if (< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + (set! (-> arg0 times 1 w) 1.0) + ) + 0 + (none) + ) + + + + diff --git a/goal_src/jak2/engine/gfx/mood/mood-h.gc b/goal_src/jak2/engine/gfx/mood/mood-h.gc index af6b6f1e1e..478f91fab9 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-h.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-h.gc @@ -7,6 +7,8 @@ ;; todo docs and method names. +(declare-type sky-color-day structure) + ;; DECOMP BEGINS (deftype mood-channel (structure) @@ -18,6 +20,7 @@ :flag-assert #x900000060 ) + (deftype mood-channel-group (structure) ((data mood-channel 4 :inline :offset-assert 0) ) @@ -26,6 +29,7 @@ :flag-assert #x900000180 ) + (deftype mood-fog (structure) ((fog-color vector :inline :offset-assert 0) (fog-dists vector :inline :offset-assert 16) @@ -40,14 +44,17 @@ :flag-assert #x900000030 ) + (deftype mood-fog-table (structure) - ((data mood-fog 8 :inline :offset-assert 0) + ((data mood-fog 8 :inline :offset-assert 0) + (data-raw uint128 24 :offset 0) ) :method-count-assert 9 :size-assert #x180 :flag-assert #x900000180 ) + (deftype mood-color (structure) ((lgt-color vector :inline :offset-assert 0) (amb-color vector :inline :offset-assert 16) @@ -57,6 +64,7 @@ :flag-assert #x900000020 ) + (deftype mood-direction-table (structure) ((data vector 4 :inline :offset-assert 0) ) @@ -65,14 +73,17 @@ :flag-assert #x900000040 ) + (deftype mood-color-table (structure) - ((data mood-color 8 :inline :offset-assert 0) + ((data mood-color 8 :inline :offset-assert 0) + (data-raw uint128 16 :offset 0) ) :method-count-assert 9 :size-assert #x100 :flag-assert #x900000100 ) + (deftype mood-sky-table (structure) ((data vector 8 :inline :offset-assert 0) ) @@ -81,6 +92,7 @@ :flag-assert #x900000080 ) + (deftype mood-clouds (structure) ((cloud-min float :offset-assert 0) (cloud-max float :offset-assert 4) @@ -90,6 +102,7 @@ :flag-assert #x900000008 ) + (deftype mood-weather (structure) ((data float 2 :offset-assert 0) (cloud float :offset 0) @@ -102,6 +115,7 @@ :flag-assert #x900000008 ) + (deftype mood-iweather (structure) ((data int32 2 :offset-assert 0) (cloud int32 :offset 0) @@ -113,6 +127,7 @@ :flag-assert #x900000008 ) + (deftype mood-range (structure) ((data float 4 :offset-assert 0) (min-cloud float :offset 0) @@ -126,6 +141,7 @@ :flag-assert #x900000010 ) + (deftype mood-filters-table (structure) ((data vector 8 :inline :offset-assert 0) ) @@ -134,19 +150,21 @@ :flag-assert #x900000080 ) + (deftype mood-table (basic) ((mood-fog-table mood-fog-table :offset-assert 4) (mood-color-table mood-color-table :offset-assert 8) (mood-channel-group mood-channel-group :offset-assert 12) (mood-direction-table mood-direction-table :offset-assert 16) (mood-sky-table mood-sky-table :offset-assert 20) - (mood-interp-table basic :offset-assert 24) + (mood-interp-table sky-color-day :offset-assert 24) ) :method-count-assert 9 :size-assert #x1c :flag-assert #x90000001c ) + (deftype mood-context-core (structure) ((current-fog mood-fog :inline :offset-assert 0) (current-sky-color vector :inline :offset-assert 48) @@ -159,6 +177,7 @@ :flag-assert #x900000070 ) + (deftype mood-context-core2 (mood-context-core) ((light-group light-group 8 :inline :offset-assert 112) ) @@ -167,6 +186,7 @@ :flag-assert #x900000670 ) + (deftype mood-context-core3 (mood-context-core2) ((times vector 8 :inline :offset-assert 1648) ) @@ -175,16 +195,20 @@ :flag-assert #x9000006f0 ) + (deftype mood-context (mood-context-core3) + "`state` holds an arbitrary state structure, ie `[[sewer-states]]` and is used + when updating the mood. This means that an individual state structure must be less than 128 bytes" ((itimes vector4w 4 :inline :offset-assert 1776) (state uint32 32 :offset-assert 1840) - (clear uint128 123 :offset 0) ;; added + (data uint128 123 :offset 0) ) :method-count-assert 9 :size-assert #x7b0 :flag-assert #x9000007b0 ) + (deftype mood-control-work (structure) ((weather mood-weather :inline :offset-assert 0) (iweather mood-iweather :inline :offset-assert 8) @@ -202,33 +226,34 @@ :flag-assert #x90000004c ) + (deftype mood-control (mood-table) - ((mood-clouds mood-clouds :offset-assert 28) - (current-interp mood-weather :inline :offset-assert 32) - (target-interp mood-weather :inline :offset-assert 40) - (speed-interp mood-weather :inline :offset-assert 48) - (range mood-range :inline :offset-assert 64) - (time-until-random mood-weather :inline :offset-assert 80) - (time-until-random-min mood-weather :inline :offset-assert 88) - (time-until-random-max mood-weather :inline :offset-assert 96) - (display-flag symbol :offset-assert 104) - (overide-weather-flag symbol :offset-assert 108) - (overide mood-weather :inline :offset-assert 112) - (lightning-index int32 :offset-assert 120) - (lightning-val int32 :offset-assert 124) - (lightning-time int32 :offset-assert 128) - (lightning-time2 float :offset-assert 132) - (lightning-flash float :offset-assert 136) - (lightning-id sound-id :offset-assert 140) - (lightning-count0 uint32 :offset-assert 144) - (lightning-count1 uint32 :offset-assert 148) - (lightning-count2 uint32 :offset-assert 152) - (rain-id uint32 :offset-assert 156) - (sound-pitch float :offset-assert 160) + ((mood-clouds mood-clouds :offset-assert 28) + (current-interp mood-weather :inline :offset-assert 32) + (target-interp mood-weather :inline :offset-assert 40) + (speed-interp mood-weather :inline :offset-assert 48) + (range mood-range :inline :offset-assert 64) + (time-until-random mood-weather :inline :offset-assert 80) + (time-until-random-min mood-weather :inline :offset-assert 88) + (time-until-random-max mood-weather :inline :offset-assert 96) + (display-flag symbol :offset-assert 104) + (overide-weather-flag symbol :offset-assert 108) + (overide mood-weather :inline :offset-assert 112) + (lightning-index int32 :offset-assert 120) + (lightning-val int32 :offset-assert 124) + (lightning-time int32 :offset-assert 128) + (lightning-time2 float :offset-assert 132) + (lightning-flash float :offset-assert 136) + (lightning-id sound-id :offset-assert 140) + (lightning-count0 uint32 :offset-assert 144) + (lightning-count1 uint32 :offset-assert 148) + (lightning-count2 uint32 :offset-assert 152) + (rain-id uint32 :offset-assert 156) + (sound-pitch float :offset-assert 160) (fogs mood-fog-table 9 :offset-assert 164) (colors mood-color-table 3 :offset-assert 200) (channels mood-channel-group 3 :offset-assert 212) - (clouds mood-clouds 9 :offset-assert 224) + (clouds mood-clouds 9 :offset-assert 224) ) :method-count-assert 19 :size-assert #x104 @@ -247,3 +272,9 @@ ) ) + +0 + + + + diff --git a/goal_src/jak2/engine/gfx/mood/mood-tables.gc b/goal_src/jak2/engine/gfx/mood/mood-tables.gc index 9e81110c67..e0a3370d7a 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-tables.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-tables.gc @@ -5,6 +5,8 @@ ;; name in dgo: mood-tables ;; dgos: ENGINE, GAME +;; og:ignore-from-loc + ;; DECOMP BEGINS (define *no-cloud-haze-mood-fog-table* @@ -799,6 +801,7 @@ ) ) +;; WARN: Return type mismatch symbol vs none. (defun init-mood-control ((arg0 mood-control)) (set! (-> arg0 mood-fog-table) (new 'global 'mood-fog-table)) (set! (-> arg0 mood-color-table) (new 'global 'mood-color-table)) @@ -806,7 +809,7 @@ (set! (-> arg0 mood-clouds) (new 'global 'mood-clouds)) (set! (-> arg0 mood-direction-table) *mood-direction-table*) (set! (-> arg0 mood-sky-table) *mood-sky-table*) - (set! (-> arg0 mood-interp-table) (the-as basic *mood-interp-table*)) + (set! (-> arg0 mood-interp-table) *mood-interp-table*) (mem-copy! (the-as pointer (-> arg0 mood-fog-table)) (the-as pointer *no-cloud-clear-mood-fog-table*) 384) (mem-copy! (the-as pointer (-> arg0 mood-color-table)) (the-as pointer *no-cloud-mood-color-table*) 256) (mem-copy! (the-as pointer (-> arg0 mood-channel-group)) (the-as pointer *no-cloud-mood-channel-group*) 384) diff --git a/goal_src/jak2/engine/gfx/mood/mood-tables2.gc b/goal_src/jak2/engine/gfx/mood/mood-tables2.gc index 9b61682884..d105a1e3bb 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-tables2.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-tables2.gc @@ -5,6 +5,8 @@ ;; name in dgo: mood-tables2 ;; dgos: ENGINE, GAME +;; og:ignore-from-loc + ;; DECOMP BEGINS ;; this file is debug only @@ -94,13 +96,14 @@ ) ) +;; WARN: Return type mismatch pointer vs none. (defun init-overide-table ((arg0 mood-table)) (set! (-> arg0 mood-fog-table) (new 'debug 'mood-fog-table)) (set! (-> arg0 mood-color-table) (new 'debug 'mood-color-table)) (set! (-> arg0 mood-channel-group) *no-cloud-mood-channel-group*) (set! (-> arg0 mood-direction-table) *mood-direction-table*) (set! (-> arg0 mood-sky-table) *mood-sky-table*) - (set! (-> arg0 mood-interp-table) (the-as basic *mood-interp-table*)) + (set! (-> arg0 mood-interp-table) *mood-interp-table*) (mem-copy! (the-as pointer (-> arg0 mood-fog-table)) (the-as pointer *no-cloud-clear-mood-fog-table*) 384) (mem-copy! (the-as pointer (-> arg0 mood-color-table)) (the-as pointer *no-cloud-mood-color-table*) 256) (none) @@ -110,6 +113,7 @@ (init-overide-table *overide-table*) +;; WARN: Return type mismatch object vs none. (defun print-mood-tables () "Print out the contents of the [[*overide-table*]]" (mem-copy! (the-as pointer (-> *overide-table* mood-fog-table)) (the-as pointer *overide-mood-fog-table*) 384) @@ -251,6 +255,7 @@ (none) ) +;; WARN: Return type mismatch object vs none. (defun desaturate-mood-colors ((arg0 float) (arg1 float) (arg2 float)) "Unused - Generate GOAL code for a new [[*overide-mood-color-table*]] definition that desaturates the color Apply said overrides to the [[*overide-table*]]" @@ -347,6 +352,7 @@ (none) ) +;; WARN: Return type mismatch object vs none. (defun desaturate-mood-fog ((arg0 (pointer mood-fog-table)) (arg1 float) (arg2 float)) "Unused - Generate GOAL code for a new [[*overide-mood-fog-table*]] definition that desaturates the fog color Apply said overrides to the [[*overide-table*]]" @@ -423,3 +429,4 @@ + diff --git a/goal_src/jak2/engine/gfx/mood/mood.gc b/goal_src/jak2/engine/gfx/mood/mood.gc index 14b55b5741..29a5155f8e 100644 --- a/goal_src/jak2/engine/gfx/mood/mood.gc +++ b/goal_src/jak2/engine/gfx/mood/mood.gc @@ -5,16 +5,990 @@ ;; name in dgo: mood ;; dgos: ENGINE, GAME +;; og:ignore-form:update-mood-direction +;; og:ignore-form:(defmethod gen-lightning-and-thunder! +;; og:ignore-form:(defmethod init-weather! + +(define-extern update-mood-direction (function mood-context-core3 mood-table float float)) + ;; DECOMP BEGINS +(defun palette-select-special ((arg0 mood-context-core3)) + "Use the `special` time-of-day mode palette" + (dotimes (v1-0 8) + (if (logtest? (-> *time-of-day-context* mode) (ash 16 v1-0)) + (set! (-> arg0 times v1-0 w) (-> *time-of-day-context* times v1-0 w)) + (set! (-> arg0 times v1-0 w) 0.0) + ) + ) + #f + ) + +(defun clear-mood-times ((arg0 mood-context)) + "Clear all of the mood times on the given context" + (dotimes (v1-0 8) + (set! (-> arg0 times v1-0 w) 0.0) + ) + #f + ) + +;; WARN: Return type mismatch int vs none. +;; WARN: Function may read a register that is not set: f31 +(defun update-mood-itimes ((arg0 mood-context)) + (local-vars + (r0-0 int) + (r0-1 int) + (r0-2 int) + (v1-1 uint128) + (v1-2 uint128) + (v1-3 uint128) + (v1-4 uint128) + (a1-0 uint128) + (a1-1 uint128) + (a1-2 uint128) + (a1-3 uint128) + (a2-0 uint128) + (a2-1 uint128) + (a3-0 uint128) + (a3-1 uint128) + (t0-0 uint128) + (t0-1 uint128) + (t1-0 uint128) + (t1-1 uint128) + (t2-0 uint128) + (t2-1 uint128) + (t3-0 uint128) + (t3-1 uint128) + (f31-0 none) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + ) + (nop!) + (nop!) + *time-of-day-context* + (nop!) + (.lvf vf1 (&-> arg0 times 0 quad)) + (nop!) + (.lvf vf2 (&-> arg0 times 1 quad)) + (.mul.w.vf vf1 vf1 vf1 :mask #b111) + (.lvf vf3 (&-> arg0 times 2 quad)) + (.mul.w.vf vf2 vf2 vf2 :mask #b111) + (.lvf vf4 (&-> arg0 times 3 quad)) + (.mul.w.vf vf3 vf3 vf3 :mask #b111) + (.lvf vf5 (&-> arg0 times 4 quad)) + (.mul.w.vf vf4 vf4 vf4 :mask #b111) + (.lvf vf6 (&-> arg0 times 5 quad)) + (.mul.w.vf vf5 vf5 vf5 :mask #b111) + (.lvf vf7 (&-> arg0 times 6 quad)) + (.mul.w.vf vf6 vf6 vf6 :mask #b111) + (.lvf vf8 (&-> arg0 times 7 quad)) + (.mul.w.vf vf7 vf7 vf7 :mask #b111) + (nop!) + (.mul.w.vf vf8 vf8 vf8 :mask #b111) + (nop!) + (vftoi12.xyzw vf1 vf1) + (nop!) + (vftoi12.xyzw vf2 vf2) + (nop!) + (vftoi12.xyzw vf3 vf3) + (nop!) + (vftoi12.xyzw vf4 vf4) + (nop!) + (vftoi12.xyzw vf5 vf5) + (nop!) + (vftoi12.xyzw vf6 vf6) + (nop!) + (vftoi12.xyzw vf7 vf7) + (nop!) + (vftoi12.xyzw vf8 vf8) + (nop!) + (.mov v1-1 vf1) + (nop!) + (.mov a1-0 vf2) + (nop!) + (.mov a2-0 vf3) + (.pw.sra v1-2 v1-1 6) + (.mov a3-0 vf4) + (.pw.sra a1-1 a1-0 6) + (.mov t0-0 vf5) + (.pw.sra a2-1 a2-0 6) + (.mov t1-0 vf6) + (.pw.sra a3-1 a3-0 6) + (.mov t2-0 vf7) + (.pw.sra t0-1 t0-0 6) + (.mov t3-0 vf8) + (.pw.sra t1-1 t1-0 6) + (.pw.sra t2-1 t2-0 6) + (.mov r0-0 f31-0) + (.pw.sra t3-1 t3-0 6) + (.mov r0-1 f31-0) + (.ppach v1-3 a1-1 v1-2) + (.mov r0-2 f31-0) + (.ppach a1-2 a3-1 a2-1) + (set! (-> arg0 itimes 0 quad) v1-3) + (.ppach v1-4 t1-1 t0-1) + (set! (-> arg0 itimes 1 quad) a1-2) + (.ppach a1-3 t3-1 t2-1) + (set! (-> arg0 itimes 2 quad) v1-4) + (nop!) + (set! (-> arg0 itimes 3 quad) a1-3) + 0 + (none) + ) + ) + +;; ERROR: Expression building failed: In update-mood-direction: Failed to match non-power of two case: t3-14 + +(defun update-mood-exterior ((arg0 mood-context-core3) (arg1 mood-table) (arg2 float) (arg3 int)) + (local-vars (v0-1 object) (sv-32 mood-color) (sv-48 mood-color) (sv-64 vector)) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + 0 + 0 + 0.0 + (let* ((v1-3 (the int arg2)) + (f0-4 (- arg2 (the float v1-3))) + (f1-3 (- 1.0 f0-4)) + (a0-6 (/ v1-3 24)) + (v1-7 (-> arg1 mood-interp-table hour (- v1-3 (* 24 a0-6)))) + (s3-0 (-> v1-7 snapshot1)) + (s2-0 (-> v1-7 snapshot2)) + (f30-0 (+ (* f1-3 (-> v1-7 morph-start)) (* f0-4 (-> v1-7 morph-end)))) + ) + (set! v0-1 + (cond + ((and (-> *level* level arg3 bsp) + (nonzero? (-> *level* level arg3 bsp)) + (not (-> *level* level arg3 bsp ambients)) + ) + (set! v0-1 (-> arg0 times)) + (set! (-> (the-as (inline-array vector) v0-1) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v0-1) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v0-1) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v0-1) 0 w) 1.0) + v0-1 + ) + ((= s3-0 s2-0) + (let ((a2-1 (-> arg1 mood-color-table data s3-0)) + (v1-26 (-> arg0 times)) + (a1-2 (-> arg0 times 1)) + (a0-16 (-> arg0 light-group)) + ) + (set! (-> v1-26 0 quad) (-> a2-1 amb-color quad)) + (set! (-> a1-2 quad) (-> a2-1 lgt-color quad)) + (set! (-> arg0 times 2 quad) (-> a1-2 quad)) + (set! (-> arg0 times 3 quad) (-> a1-2 quad)) + (set! (-> arg0 times 4 quad) (-> a1-2 quad)) + (set! (-> a0-16 0 ambi color quad) (-> v1-26 0 quad)) + ) + (set! (-> arg0 current-sky-color quad) (-> arg1 mood-sky-table data s3-0 quad)) + (mem-copy! (the-as pointer (-> arg0 current-fog)) (the-as pointer (-> arg1 mood-fog-table data s3-0)) 48) + ) + (else + (set! sv-32 (-> arg1 mood-color-table data s3-0)) + (set! sv-48 (-> arg1 mood-color-table data s2-0)) + (let ((s1-0 (-> arg0 times))) + (set! sv-64 (-> arg0 times 1)) + (let ((s0-0 (-> arg0 light-group))) + (vector4-lerp! (the-as vector s1-0) (-> sv-32 amb-color) (-> sv-48 amb-color) f30-0) + (vector4-lerp! sv-64 (-> sv-32 lgt-color) (-> sv-48 lgt-color) f30-0) + (set! (-> arg0 times 2 quad) (-> sv-64 quad)) + (set! (-> arg0 times 3 quad) (-> sv-64 quad)) + (set! (-> arg0 times 4 quad) (-> sv-64 quad)) + (set! (-> s0-0 0 ambi color quad) (-> s1-0 0 quad)) + ) + ) + (vector4-lerp! + (-> arg0 current-sky-color) + (-> arg1 mood-sky-table data s3-0) + (-> arg1 mood-sky-table data s2-0) + f30-0 + ) + (vector4-array-lerp! + (the-as (inline-array vector4) (-> arg0 current-fog)) + (the-as (inline-array vector4) (-> arg1 mood-fog-table data s3-0)) + (the-as (inline-array vector4) (-> arg1 mood-fog-table data s2-0)) + f30-0 + 3 + ) + ) + ) + ) + ) + (set-vector! (-> arg0 current-prt-color) 0.0 0.0 0.0 0.0) + (set-vector! (-> arg0 current-env-color) 0.0 0.0 0.0 0.0) + (let ((f0-18 (-> *mood-control* lightning-flash)) + (a0-36 (-> *mood-control* lightning-index)) + ) + (when (and (!= f0-18 0.0) (< a0-36 4)) + (let ((v1-64 (new 'stack-no-clear 'vector)) + (a0-40 (-> arg0 times (+ a0-36 1))) + ) + (set-vector! v1-64 f0-18 f0-18 f0-18 0.0) + (vector+! a0-40 a0-40 v1-64) + ) + ) + ) + (update-mood-direction arg0 arg1 arg2) + ) + ) + ) + +(defun copy-mood-exterior ((arg0 mood-context)) + (set! (-> *time-of-day-context* exterior-level) (the-as basic #t)) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((v1-2 (the-as object arg0)) + (a1-4 (the-as (inline-array vector) (-> *level* default-level mood-context))) + ) + (dotimes (a2-0 31) + (set! (-> (the-as (inline-array vector) v1-2) 0 quad) (-> a1-4 0 quad)) + (set! v1-2 (-> (the-as (inline-array vector) v1-2) 1)) + (set! a1-4 (the-as (inline-array vector) (-> a1-4 1))) + ) + ) + (let ((v1-5 (-> arg0 times)) + (a0-2 (the-as (inline-array vector) (+ #x83ac (the-as int *level*)))) + ) + (dotimes (a1-6 5) + (set! (-> v1-5 0 quad) (-> a0-2 0 quad)) + (set! v1-5 (the-as (inline-array vector) (-> v1-5 1))) + (set! a0-2 (the-as (inline-array vector) (-> a0-2 1))) + ) + ) + #f + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defun copy-mood-exterior-ambi ((arg0 mood-context) (arg1 symbol)) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((v1-1 arg0) + (a2-3 (the-as structure (-> *level* default-level mood-context))) + ) + (dotimes (a3-0 31) + (set! (-> v1-1 current-fog fog-color quad) (-> (the-as mood-context a2-3) current-fog fog-color quad)) + (set! v1-1 (the-as mood-context (-> v1-1 current-fog fog-dists))) + (set! a2-3 (-> (the-as mood-context a2-3) current-fog fog-dists)) + ) + ) + (set! (-> arg0 times 0 quad) (-> (the-as (pointer uint128) (+ #x83ac (the-as int *level*))))) + (when arg1 + (set! (-> arg0 times 1 quad) (-> (the-as (pointer uint128) (+ #x83bc (the-as int *level*))))) + (set! (-> arg0 times 1 w) 1.0) + ) + ) + ) + (none) + ) + (defun clear-mood-context ((arg0 mood-context)) (let ((v1-0 arg0)) (dotimes (a1-0 123) - (set! (-> v1-0 clear a1-0) (the-as uint128 0)) + (set! (-> v1-0 data a1-0) (the-as uint128 0)) ) ) (dotimes (v1-3 8) (set-vector! (-> arg0 times v1-3) 1.0 1.0 1.0 0.0) ) + #f + ) + +(defun update-mood-interior ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (set! (-> arg0 current-fog fog-color quad) (-> *level* default-level mood-context current-fog fog-color quad)) + (set-vector! (-> arg0 current-fog fog-dists) 98304.0 3072000.0 255.0 150.0) + (set-vector! (-> arg0 current-fog erase-color) 0.0 0.0 0.0 128.0) + (set-vector! (-> arg0 current-prt-color) 0.0 0.0 0.0 0.0) + (set-vector! (-> arg0 current-env-color) 96.0 96.0 96.0 128.0) + (set-vector! (-> arg0 current-sky-color) 0.0 0.0 0.0 1.0) + (let ((a0-2 (-> v1-0 0))) + (set! (-> a0-2 dir0 direction x) 0.0) + (set! (-> a0-2 dir0 direction y) 1.0) + (set! (-> a0-2 dir0 direction z) 0.0) + (set! (-> a0-2 dir0 direction w) 0.0) + ) + (set-vector! (-> v1-0 0 dir0 color) 0.667 0.667 0.667 1.0) + (set-vector! (-> v1-0 0 ambi color) 0.333 0.333 0.333 1.0) + (set! (-> v1-0 0 dir0 extra x) 1.0) + (set! (-> v1-0 0 dir1 extra x) 0.0) + (set! (-> v1-0 0 dir2 extra x) 0.0) + (let ((f0-35 1.0)) + (set! (-> v1-0 0 ambi extra x) f0-35) + f0-35 + ) + ) + ) + +(deftype flames-state (structure) + ((time float :offset-assert 0) + (index uint8 :offset-assert 4) + (length uint8 :offset-assert 5) + (height uint8 :offset-assert 6) + ) + :pack-me + :method-count-assert 9 + :size-assert #x7 + :flag-assert #x900000007 + ) + + +(defbehavior update-mood-flames time-of-day-proc ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 int) (arg4 float) (arg5 float) (arg6 float)) + (let* ((gp-0 (the-as flames-state (+ (+ arg3 1840) (the-as int arg0)))) + (s4-0 (+ (-> gp-0 index) arg1)) + (f0-0 (-> gp-0 time)) + (v1-2 (-> gp-0 length)) + (s0-0 (-> gp-0 height)) + ) + (dotimes (a0-1 arg2) + (set! (-> arg0 times (+ arg1 a0-1) w) arg4) + ) + (cond + ((>= f0-0 (the float v1-2)) + (set! (-> gp-0 index) (the-as uint (the int (rand-vu-float-range 0.0 (+ -0.01 (the float arg2)))))) + (set! (-> gp-0 time) 0.0) + (set! (-> gp-0 length) (the-as uint (the int (* (rand-vu-float-range 7.0 15.0) arg6)))) + (set! (-> gp-0 height) (the-as uint (the int (rand-vu-float-range 0.0 255.0)))) + (let ((f0-11 arg4)) + (set! (-> arg0 times s4-0 w) f0-11) + f0-11 + ) + ) + (else + (let ((f0-14 (sin (* 32768.0 (/ f0-0 (the float v1-2)))))) + (set! (-> arg0 times s4-0 w) (+ (* (the float s0-0) f0-14 arg5) arg4)) + ) + (when (not (paused?)) + (let ((f0-19 (+ (-> gp-0 time) (if (= (-> *display* bg-clock clock-ratio) 0.0) + 1.0 + (-> self clock time-adjust-ratio) + ) + ) + ) + ) + (set! (-> gp-0 time) f0-19) + f0-19 + ) + ) + ) + ) + ) + ) + +(define *flash0* + (the-as (array float) + (new 'static 'boxed-array :type float 1.0 0.0 0.5 1.0 0.5 0.0 0.5 0.35 0.4 0.35 0.25 0.1 0.04) + ) + ) + +(define *flash1* + (the-as (array float) (new 'static 'boxed-array :type float 1.0 0.8 0.0 1.0 0.5 1.0 0.4 0.2 0.1)) + ) + +(define *flash2* + (the-as (array float) (new 'static 'boxed-array :type float 1.0 0.9 0.8 0.7 0.0 0.0 1.0 0.0 1.0 0.5)) + ) + +(define *flash3* + (the-as (array float) + (new 'static 'boxed-array :type float 0.5 0.0 1.0 0.9 1.0 0.8 0.3 0.0 0.0 0.5 0.1 0.5 0.35) + ) + ) + +(define *flash4* + (the-as (array float) + (new 'static 'boxed-array :type float 1.0 0.0 1.0 0.0 1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.5 0.4 0.3 0.2 0.1) + ) + ) + +(define *flash5* (the-as (array float) (new 'static 'boxed-array :type float + 1.0 + 0.0 + 1.0 + 0.0 + 1.0 + 0.95 + 0.9 + 0.85 + 0.8 + 0.75 + 0.7 + 0.65 + 0.6 + 0.55 + 0.5 + 0.45 + 0.4 + 0.35 + 0.3 + 0.25 + 0.2 + 0.5 + 0.45 + 0.4 + 0.35 + 0.3 + 0.25 + 0.2 + 0.15 + 0.1 + 0.05 + ) + ) + ) + +(define *flash6* + (the-as (array float) + (new 'static 'boxed-array :type float 1.0 0.0 1.0 0.0 0.5 0.0 0.5 0.35 0.0 0.0 1.0 0.0 0.2 0.1) + ) + ) + +(define *flash7* + (the-as (array float) + (new 'static 'boxed-array :type float 1.0 0.8 0.3 0.0 0.6 0.5 0.4 0.3 0.2 0.5 0.4 0.3 0.2 0.1) + ) + ) + +(deftype light-state (structure) + ((time float :offset-assert 0) + (fade float :offset-assert 4) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +(defun update-mood-light ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 float) (arg6 float) (arg7 float)) + (with-pp + (let ((gp-0 (the-as light-state (+ (+ arg2 1840) (the-as int arg0))))) + (let* ((f0-0 512.0) + (f1-1 (+ (-> gp-0 time) arg6)) + (f28-0 (* f0-0 (- f1-1 (* (the float (the int (/ f1-1 256.0))) 256.0)))) + (f0-3 (+ arg3 (* (cos f28-0) arg4))) + (f30-1 (-> gp-0 fade)) + ) + (cond + ((or (>= arg5 18.0) (>= 6.0 arg5)) + (cond + ((< f28-0 3640.889) + (set! (-> arg0 times arg1 w) f0-3) + (set! (-> gp-0 fade) 1.0) + ) + ((= f30-1 1.0) + (set! (-> arg0 times arg1 w) f0-3) + ) + ) + ) + ((= f30-1 1.0) + (cond + ((< f28-0 3640.889) + (set! (-> arg0 times arg1 w) f0-3) + (set! (-> gp-0 fade) 0.99) + ) + (else + (set! (-> arg0 times arg1 w) f0-3) + ) + ) + ) + ((and (< f30-1 1.0) (< 0.0 f30-1)) + (set! (-> arg0 times arg1 w) f30-1) + (when (not (paused?)) + (if (< 0.75 f30-1) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.04 (-> pp clock time-adjust-ratio)))) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.02 (-> pp clock time-adjust-ratio)))) + ) + ) + ) + (else + (set! (-> gp-0 fade) 0.0) + (set! (-> gp-0 time) 0.0) + ) + ) + ) + (when (not (paused?)) + (let ((f0-15 (-> gp-0 time))) + (set! arg7 (cond + ((= (-> *display* bg-clock clock-ratio) 0.0) + (empty) + arg7 + ) + (else + (* arg7 (-> pp clock time-adjust-ratio)) + ) + ) + ) + (let ((f0-16 (+ f0-15 arg7))) + (set! (-> gp-0 time) f0-16) + f0-16 + ) + ) + ) + ) + ) + ) + +(deftype lava-state (structure) + ((lava float :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + + +(defun update-mood-lava ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 float) (arg6 float) (arg7 float)) + "Unused" + (let ((gp-0 (the-as lava-state (+ (+ arg2 1840) (the-as int arg0))))) + (let ((f0-1 (cos (-> gp-0 lava)))) + (set! (-> arg0 times arg1 w) (+ arg3 (* f0-1 arg4))) + (set! (-> arg0 times (+ arg1 1) w) (+ arg3 (* (- f0-1) arg4))) + ) + (when (not (paused?)) + (let ((f0-6 (+ (-> gp-0 lava) arg5))) + (set! (-> gp-0 lava) f0-6) + f0-6 + ) + ) + ) + ) + +(deftype flicker-state (structure) + ((flicker-off uint8 :offset-assert 0) + (flicker-on uint8 :offset-assert 1) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + + +;; WARN: Return type mismatch int vs none. +(defun update-mood-flicker ((arg0 mood-context) (arg1 int) (arg2 int)) + "Unused" + (let ((gp-0 (the-as flicker-state (+ (+ arg2 1840) (the-as int arg0))))) + (cond + ((nonzero? (-> gp-0 flicker-on)) + (set! (-> arg0 times arg1 w) 1.0) + (if (not (paused?)) + (+! (-> gp-0 flicker-on) -1) + ) + ) + ((nonzero? (-> gp-0 flicker-off)) + (if (not (paused?)) + (+! (-> gp-0 flicker-off) -1) + ) + ) + (else + (set! (-> gp-0 flicker-on) (the-as uint (the int (rand-vu-float-range 2.0 20.0)))) + (if (zero? (the int (rand-vu-float-range 0.0 3.0))) + (set! (-> gp-0 flicker-off) (the-as uint (the int (rand-vu-float-range 2.0 120.0)))) + (set! (-> gp-0 flicker-off) (the-as uint (the int (rand-vu-float-range 2.0 20.0)))) + ) + ) + ) + ) (none) - ) \ No newline at end of file + ) + +(deftype florescent-state (structure) + ((value float :offset-assert 0) + (delay int8 :offset-assert 4) + (delay2 int8 :offset-assert 5) + ) + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 + ) + + +(defun update-mood-florescent ((arg0 mood-context) (arg1 int) (arg2 int)) + "Unused" + (let ((gp-0 (the-as florescent-state (+ (+ arg2 1840) (the-as int arg0))))) + (set! (-> arg0 times arg1 w) (-> gp-0 value)) + (when (not (paused?)) + (cond + ((zero? (-> gp-0 delay)) + (set! (-> gp-0 delay2) (the int (rand-vu-float-range 10.0 60.0))) + (set! (-> gp-0 delay) (the int (rand-vu-float-range 60.0 120.0))) + ) + (else + (+! (-> gp-0 delay) -1) + ) + ) + (cond + ((>= (-> gp-0 delay2) (-> gp-0 delay)) + (let ((f0-5 (rand-vu-float-range 1.0 1.5))) + (set! (-> gp-0 value) f0-5) + f0-5 + ) + ) + ((< (-> gp-0 delay2) (-> gp-0 delay)) + (let ((f0-6 1.5)) + (set! (-> gp-0 value) f0-6) + f0-6 + ) + ) + ) + ) + ) + ) + +(deftype electricity-state (structure) + ((value float :offset-assert 0) + (scale float :offset-assert 4) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +;; WARN: Return type mismatch float vs none. +(defun update-mood-electricity ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 float) (arg4 float)) + (let ((gp-0 (the-as electricity-state (+ (+ arg2 1840) (the-as int arg0))))) + (set! (-> arg0 times arg1 w) (* (-> gp-0 value) (-> gp-0 scale))) + (if (not (paused?)) + (set! (-> gp-0 value) (rand-vu-float-range arg3 arg4)) + ) + ) + (none) + ) + +(deftype pulse-state (structure) + ((pulse float :offset-assert 0) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + + +;; WARN: Return type mismatch float vs none. +(defun update-mood-pulse ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) + (let ((gp-0 (the-as pulse-state (+ (+ arg2 1840) (the-as int arg0))))) + (set! (-> arg0 times arg1 w) (+ arg3 (* (cos (+ (-> gp-0 pulse) arg6)) arg4))) + (if (not (paused?)) + (+! (-> gp-0 pulse) arg5) + ) + ) + (none) + ) + +(deftype strobe-state (structure) + ((time float :offset-assert 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + + +(defun update-mood-strobe ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 int) (arg4 float)) + (let ((gp-0 (the-as strobe-state (+ (+ arg2 1840) (the-as int arg0))))) + (let ((a2-1 (the int (-> gp-0 time)))) + (if (logtest? arg3 (ash 1 a2-1)) + (set! (-> arg0 times arg1 w) 1.0) + (set! (-> arg0 times arg1 w) 0.3) + ) + ) + (when (not (paused?)) + (let* ((f0-5 (+ (-> gp-0 time) arg4)) + (f0-6 (- f0-5 (* (the float (the int (/ f0-5 32.0))) 32.0))) + ) + (set! (-> gp-0 time) f0-6) + f0-6 + ) + ) + ) + ) + +(defun update-mood-caustics ((arg0 mood-context) (arg1 int) (arg2 float) (arg3 float) (arg4 float) (arg5 float)) + (let* ((f0-2 (sin (+ arg2 arg3))) (f0-4 (+ arg4 (* f0-2 arg5)))) (set! (-> arg0 times arg1 w) f0-4) f0-4) + ) + +;; WARN: Return type mismatch int vs none. +(defmethod apply-mood-clouds-and-fog mood-control ((obj mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> obj mood-fog-table))) + (dotimes (a0-1 24) + (set! (-> v1-0 data-raw a0-1) (the-as uint128 0)) + ) + ) + (let ((s4-0 (-> obj mood-fog-table))) + (let ((f30-0 (- 1.0 (-> arg0 interp cloud)))) + (when (!= f30-0 0.0) + (let ((f0-4 (* (- 1.0 (-> arg0 interp fog)) f30-0)) + (a2-0 (-> obj fogs (-> arg0 index 0))) + ) + (if (!= f0-4 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-0) + f0-4 + 24 + ) + ) + ) + (let ((f0-6 (* (-> arg0 interp fog) f30-0)) + (a2-1 (-> obj fogs (-> arg0 index 1))) + ) + (if (!= f0-6 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-1) + f0-6 + 24 + ) + ) + ) + ) + ) + (let ((f30-1 (-> arg0 interp cloud))) + (when (!= f30-1 0.0) + (let ((f0-10 (* (- 1.0 (-> arg0 interp fog)) f30-1)) + (a2-2 (-> obj fogs (-> arg0 index 2))) + ) + (if (!= f0-10 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-2) + f0-10 + 24 + ) + ) + ) + (let ((f0-12 (* (-> arg0 interp fog) f30-1)) + (a2-3 (-> obj fogs (-> arg0 index 3))) + ) + (if (!= f0-12 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-3) + f0-12 + 24 + ) + ) + ) + ) + ) + ) + (let ((f0-13 (-> *time-of-day-context* fog-mult)) + (v1-29 (-> obj mood-fog-table)) + ) + (dotimes (a0-6 8) + (set! (-> v1-29 data a0-6 fog-dists y) (* (-> v1-29 data a0-6 fog-dists y) f0-13)) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defmethod apply-mood-color mood-control ((obj mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> obj mood-color-table))) + (dotimes (a0-1 16) + (set! (-> v1-0 data-raw a0-1) (the-as uint128 0)) + ) + ) + (let ((s4-0 (-> obj mood-color-table))) + (let ((f0-1 (- 1.0 (-> arg0 color-interp))) + (a2-0 (-> obj colors (-> arg0 color-index 0))) + ) + (if (!= f0-1 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-0) + f0-1 + 16 + ) + ) + ) + (let ((f0-2 (-> arg0 color-interp)) + (a2-1 (-> obj colors (-> arg0 color-index 1))) + ) + (if (!= f0-2 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-1) + f0-2 + 16 + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defmethod apply-mood-channels mood-control ((obj mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> obj mood-channel-group))) + (dotimes (a0-1 24) + (set! (-> v1-0 data 0 vecs a0-1 quad) (the-as uint128 0)) + ) + ) + (let ((s4-0 (-> obj mood-channel-group))) + (let ((f0-1 (- 1.0 (-> arg0 channel-interp))) + (a2-0 (-> obj channels (-> arg0 channel-index 0))) + ) + (if (!= f0-1 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-0) + f0-1 + 24 + ) + ) + ) + (let ((f0-2 (-> arg0 channel-interp)) + (a2-1 (-> obj channels (-> arg0 channel-index 1))) + ) + (if (!= f0-2 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-1) + f0-2 + 24 + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defmethod adjust-num-clouds! mood-control ((obj mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> obj mood-clouds))) + (set! (-> v1-0 cloud-min) 0.0) + (set! (-> v1-0 cloud-max) 0.0) + (let ((f0-3 (- 1.0 (-> arg0 cloud-interp))) + (a2-4 (-> obj clouds (-> arg0 cloud-index 0))) + ) + (when (!= f0-3 0.0) + (set! (-> v1-0 cloud-min) (* (-> a2-4 cloud-min) f0-3)) + (set! (-> v1-0 cloud-max) (* (-> a2-4 cloud-max) f0-3)) + ) + ) + (let ((f0-5 (-> arg0 cloud-interp)) + (a0-2 (-> obj clouds (-> arg0 cloud-index 1))) + ) + (when (!= f0-5 0.0) + (+! (-> v1-0 cloud-min) (* (-> a0-2 cloud-min) f0-5)) + (+! (-> v1-0 cloud-max) (* (-> a0-2 cloud-max) f0-5)) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs sound-id. +(defmethod play-or-stop-lightning! mood-control ((obj mood-control) (arg0 sound-spec) (arg1 vector)) + "Handles playing/stopping of the lightning sound + - Plays the lightning sound if we are not loading and `lightning-id` is zero + - Stops the lightning sound first if `lightning-id` is non-zero + Returns the current value of `lightning-id`" + (vector+! (new 'stack-no-clear 'vector) arg1 (math-camera-pos)) + (the-as sound-id (cond + ((or (load-in-progress? *level*) (movie?)) + (the-as sound-id (when (nonzero? (-> obj lightning-id)) + (sound-stop (-> obj lightning-id)) + (set! (-> obj lightning-id) (new 'static 'sound-id)) + (new 'static 'sound-id) + ) + ) + ) + (else + (when (nonzero? (-> obj lightning-id)) + (sound-stop (-> obj lightning-id)) + (set! (-> obj lightning-id) (new 'static 'sound-id)) + 0 + ) + (let ((lightning-sound-id (sound-play-by-spec arg0 (new-sound-id) arg1))) + (set! (-> obj lightning-id) lightning-sound-id) + lightning-sound-id + ) + ) + ) + ) + ) + +;; WARN: disable def twice: 141. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. + +;; WARN: Return type mismatch int vs none. + +;; WARN: Return type mismatch int vs none. +(defmethod update-mood-weather! mood-control ((obj mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float)) + "Set the `target-interp` and `speed-interp` for the clouds and fog + If `*-speed` is 0.0, use the `*-target` args to set `current-interp` + See [[mood-weather]]" + (set! (-> obj target-interp cloud) cloud-target) + (set! (-> obj target-interp fog) fog-target) + (set! (-> obj speed-interp cloud) cloud-speed) + (set! (-> obj speed-interp fog) fog-speed) + (if (= cloud-speed 0.0) + (set! (-> obj current-interp cloud) cloud-target) + ) + (if (= fog-speed 0.0) + (set! (-> obj current-interp fog) fog-target) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defmethod update-mood-range! mood-control ((obj mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float)) + "Set the minimum and maximum ranges of clouds and fog + See [[mood-range]]" + (set! (-> obj range min-cloud) min-cloud) + (set! (-> obj range max-cloud) max-cloud) + (set! (-> obj range min-fog) min-fog) + (set! (-> obj range max-fog) max-fog) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs none. +(defmethod set-time-for-random-weather! mood-control ((obj mood-control) (arg0 float) (arg1 float)) + "Set the `time-until-random`'s cloud and fog values + See [[mood-weather]]" + (set! (-> obj time-until-random cloud) arg0) + (set! (-> obj time-until-random fog) arg1) + 0 + (none) + ) + + + + diff --git a/goal_src/jak2/engine/gfx/mood/time-of-day-h.gc b/goal_src/jak2/engine/gfx/mood/time-of-day-h.gc index d96c7ad170..c175963baa 100644 --- a/goal_src/jak2/engine/gfx/mood/time-of-day-h.gc +++ b/goal_src/jak2/engine/gfx/mood/time-of-day-h.gc @@ -24,6 +24,9 @@ (palette-7 11) ;; 2048 ) +;; NOTE - for mood-funcs +(define-extern set-filter-color! (function float float float none)) + ;; DECOMP BEGINS (deftype palette-fade-control (structure) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-h.gc b/goal_src/jak2/engine/gfx/ocean/ocean-h.gc index 9d23f97a23..aa1960867f 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-h.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-h.gc @@ -5,6 +5,10 @@ ;; name in dgo: ocean-h ;; dgos: ENGINE, GAME +;; NOTE - for mood-funcs2 +(declare-type ocean-map structure) +(define-extern *ocean-map-sewer* ocean-map) + ;; DECOMP BEGINS (deftype ocean-corner (structure) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc index 7f7d1934e4..fc1f515a20 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc @@ -42,6 +42,9 @@ (declare-type sparticle-launch-control inline-array-class) (define-extern forall-particles-with-key (function sparticle-launch-control (function sparticle-system sparticle-cpuinfo none) symbol symbol none)) +;; NOTE - for many things +(define-extern *part-id-table* (array sparticle-launcher)) + ;; NOTE - for sparticle-launcher (define-extern sp-get-particle (function sparticle-system int sparticle-launch-state sparticle-cpuinfo)) (define-extern kill-all-particles-with-key (function sparticle-launch-control none)) diff --git a/goal_src/jak2/engine/level/bsp-h.gc b/goal_src/jak2/engine/level/bsp-h.gc index 9b9132b7a8..ed036ddbab 100644 --- a/goal_src/jak2/engine/level/bsp-h.gc +++ b/goal_src/jak2/engine/level/bsp-h.gc @@ -65,7 +65,7 @@ (texture-flags texture-page-flag 10 :offset 130) ;; 0 (maybe padding) 150 ;; 0 (was boxes, current back flags?, byte?) 152 - ;; #t (was ambients?) 156 + (ambients symbol :offset 156) (subdivide-close float :offset 160) (subdivide-far float :offset-assert 164) (race-meshes (array entity-race-mesh) :offset-assert 168) diff --git a/goal_src/jak2/engine/load/loader.gc b/goal_src/jak2/engine/load/loader.gc index 3b25294913..cc9b4dad2f 100644 --- a/goal_src/jak2/engine/load/loader.gc +++ b/goal_src/jak2/engine/load/loader.gc @@ -1805,7 +1805,7 @@ (arg0 process) (arg1 gui-channel) (arg2 gui-action) - (arg3 int) + (arg3 string) (arg4 float) (arg5 time-frame) ) @@ -1823,7 +1823,7 @@ (set! sv-64 (the-as gui-connection (-> sv-48 next0))) (while (!= sv-48 (-> obj engine alive-list-end)) (when (and (= arg1 (-> (the-as gui-connection sv-48) channel)) - (string= (the-as string arg3) (-> (the-as gui-connection sv-48) name)) + (string= arg3 (-> (the-as gui-connection sv-48) name)) (= (get-process sv-48) arg0) ) (set! sv-32 (the-as gui-connection sv-48)) @@ -1842,7 +1842,7 @@ (set! sv-20 (-> obj connections sv-80)) (if (and (nonzero? (-> sv-20 id)) (= arg1 (-> sv-20 channel)) - (string= (the-as string arg3) (-> sv-20 name)) + (string= arg3 (-> sv-20 name)) (>= (-> sv-20 priority) -1.0) ) (set! sv-16 (the-as int (-> sv-20 id))) @@ -1859,7 +1859,7 @@ (set! (-> sv-32 priority) arg4) (set! (-> sv-32 channel) arg1) (set! (-> sv-32 action) arg2) - (set! (-> sv-32 param2) arg3) + (set! (-> sv-32 param2) (the-as int arg3)) (set! (-> sv-32 hold-time) arg5) (set! (-> sv-32 flags) (the-as uint 1)) (set! (-> sv-32 fade) (the-as uint 0)) diff --git a/goal_src/jak2/engine/process-drawable/process-drawable-h.gc b/goal_src/jak2/engine/process-drawable/process-drawable-h.gc index acb0a85186..b34e3d9ce8 100644 --- a/goal_src/jak2/engine/process-drawable/process-drawable-h.gc +++ b/goal_src/jak2/engine/process-drawable/process-drawable-h.gc @@ -15,6 +15,11 @@ (define-extern ja-aframe (function float int float :behavior process-drawable)) (define-extern vector<-matrix! (function vector matrix vector)) +;; NOTE - for airlock +(define-extern transform-post (function int :behavior process-drawable)) +(define-extern ja-min? (function int symbol :behavior process-drawable)) +(define-extern ja-max? (function int symbol :behavior process-drawable)) + ;; DECOMP BEGINS (defun cspace-by-name-no-fail ((arg0 process-drawable) (arg1 string)) diff --git a/goal_src/jak2/engine/sound/gsound-h.gc b/goal_src/jak2/engine/sound/gsound-h.gc index 72418bc66f..3a42044f97 100644 --- a/goal_src/jak2/engine/sound/gsound-h.gc +++ b/goal_src/jak2/engine/sound/gsound-h.gc @@ -114,6 +114,26 @@ :type int32 ) +(defmacro static-sound-name (str) + "Convert a string constant to a static sound-name." + + ;; all this is done at compile-time so we can come up with 2 + ;; 64-bit constants to use + (when (> (string-length str) 16) + (error "static-sound-name got a string that is too long") + ) + (let ((lo-val 0) + (hi-val 0) + ) + (dotimes (i (string-length str)) + (if (>= i 8) + (+! hi-val (ash (string-ref str i) (* 8 (- i 8)))) + (+! lo-val (ash (string-ref str i) (* 8 i))) + ) + ) + `(new 'static 'sound-name :lo ,lo-val :hi ,hi-val) + ) + ) ;; DECOMP BEGINS @@ -497,4 +517,4 @@ ;; ghost function (define-extern *debug-effect-control* symbol) -(define-extern effect-param->sound-spec (function sound-spec (pointer float) int sound-spec)) \ No newline at end of file +(define-extern effect-param->sound-spec (function sound-spec (pointer float) int sound-spec)) diff --git a/goal_src/jak2/engine/target/board/board-h.gc b/goal_src/jak2/engine/target/board/board-h.gc index 60601dda92..915fe2cf4e 100644 --- a/goal_src/jak2/engine/target/board/board-h.gc +++ b/goal_src/jak2/engine/target/board/board-h.gc @@ -8,9 +8,9 @@ ;; DECOMP BEGINS (deftype board (process-drawable) - ((control control-info :offset 128) - (shadow-backup shadow-geo :offset 208) - (main joint-mod :offset 212) + ((control control-info :offset 128) + (shadow-backup shadow-geo :offset 208) + (main joint-mod :offset 212) ) :heap-base #x60 :method-count-assert 23 @@ -23,6 +23,7 @@ ) ) + (deftype board-info (basic) ((board uint32 :offset-assert 4) (camera-interp float :offset-assert 8) @@ -160,6 +161,7 @@ ) ) + (deftype target-board-bank (basic) ((jump-height-min meters :offset-assert 4) (jump-height-max meters :offset-assert 8) @@ -178,6 +180,7 @@ :flag-assert #x900000034 ) + (define *TARGET_BOARD-bank* (new 'static 'target-board-bank :jump-height-min (meters 1.01) :jump-height-max (meters 3.5) @@ -194,7 +197,6 @@ ) (defbehavior want-to-board? target () - "Can we get on the jetboard?" (and (logtest? (-> self game features) (game-feature board)) (or (and (cpad-pressed? (-> self control unknown-cpad-info00 number) r2) (or (!= *cheat-mode* 'debug) @@ -243,8 +245,10 @@ (let ((v1-55 gp-0)) (set! (-> v1-55 spheres) s5-0) (set! (-> v1-55 num-spheres) (the-as uint 3)) - (set! (-> v1-55 collide-with) - (the-as collide-spec (logand -16561 (-> self control root-prim prim-core collide-with))) + (set! (-> v1-55 collide-with) (logclear + (-> self control root-prim prim-core collide-with) + (collide-spec civilian enemy vehicle-sphere projectile) + ) ) (set! (-> v1-55 ignore-process0) #f) (set! (-> v1-55 ignore-process1) #f) @@ -294,4 +298,8 @@ :top-plane (new 'static 'plane :y 1.0 :w 2048.0) ) ) - ) \ No newline at end of file + ) + + + + diff --git a/goal_src/jak2/engine/ui/gui-h.gc b/goal_src/jak2/engine/ui/gui-h.gc index 682912dd4a..dab3a61258 100644 --- a/goal_src/jak2/engine/ui/gui-h.gc +++ b/goal_src/jak2/engine/ui/gui-h.gc @@ -70,6 +70,9 @@ (max 96) ) +(declare-type gui-control basic) +(define-extern *gui-control* gui-control) + ;; DECOMP BEGINS (deftype gui-connection (connection) @@ -109,7 +112,7 @@ :flag-assert #x1900000cd0 (:methods (new (symbol type int) _type_ 0) - (gui-control-method-9 (_type_ process gui-channel gui-action int float time-frame) sound-id 9) + (gui-control-method-9 (_type_ process gui-channel gui-action string float time-frame) sound-id 9) (gui-control-method-10 (_type_ process gui-channel) none 10) (gui-control-method-11 (_type_ gui-connection) int 11) (gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id 12) @@ -128,8 +131,7 @@ ) ) - -(define-extern *gui-control* gui-control) +0 diff --git a/goal_src/jak2/engine/util/script-h.gc b/goal_src/jak2/engine/util/script-h.gc index 9a81c0e4a5..fc3bff83ec 100644 --- a/goal_src/jak2/engine/util/script-h.gc +++ b/goal_src/jak2/engine/util/script-h.gc @@ -23,6 +23,7 @@ ) ) + (deftype script-context (structure) ((load-state load-state :offset-assert 0) (key basic :offset-assert 4) @@ -40,36 +41,14 @@ :flag-assert #xc000000a0 (:methods (new (symbol type basic process vector) _type_ 0) - (script-context-method-9 () none 9) + (eval! (_type_ structure) pair 9) (script-context-method-10 () none 10) (script-context-method-11 () none 11) ) ) -(defmethod inspect script-context ((obj script-context)) - (when (not obj) - (return obj) - ) - (format #t "[~8x] ~A~%" obj 'script-context) - (format #t "~1Tload-state: ~A~%" (-> obj load-state)) - (format #t "~1Tkey: ~A~%" (-> obj key)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Ttrans: #~%" (-> obj trans)) - (format #t "~1Tside-effect?: ~A~%" (-> obj side-effect?)) - (format #t "~1Tgot-error?: ~A~%" (-> obj got-error?)) - (format #t "~1Texpr: ~A~%" (-> obj expr)) - (format #t "~1Tparam-count: ~D~%" (-> obj param-count)) - (format #t "~1Tparam[16] @ #x~X~%" (-> obj param)) - (dotimes (s5-0 (-> obj param-count)) - (format #t "~T [~D]~1Tparam: ~`object`P~%" s5-0 (-> obj param s5-0)) - ) - (format #t "~1Tparam-type[16] @ #x~X~%" (-> obj param-type)) - (dotimes (s5-1 (-> obj param-count)) - (format #t "~T [~D]~1Tparam-type: ~`object`P~%" s5-1 (-> obj param-type s5-1)) - ) - obj - ) +;; WARN: Return type mismatch structure vs script-context. (defmethod new script-context ((allocation symbol) (type-to-make type) (arg0 basic) (arg1 process) (arg2 vector)) (let ((t9-0 (method-of-type structure new)) (v1-1 type-to-make) @@ -87,3 +66,8 @@ ) ) +0 + + + + diff --git a/goal_src/jak2/levels/common/airlock.gc b/goal_src/jak2/levels/common/airlock.gc index 65740c4e72..96a47f2109 100644 --- a/goal_src/jak2/levels/common/airlock.gc +++ b/goal_src/jak2/levels/common/airlock.gc @@ -7,3 +7,1744 @@ ;; DECOMP BEGINS +(deftype com-airlock (process-drawable) + ((child-override basic :offset 24) + (root-override collide-shape :offset 128) + (level-name string :offset-assert 200) + (open-test symbol :offset-assert 204) + (were-behind? symbol :offset-assert 208) + (inner? symbol :offset-assert 212) + (sound-behind? symbol :offset-assert 216) + (visible-move? symbol :offset-assert 220) + (saw-pilot? handle :offset-assert 224) + (last-distance meters :offset-assert 232) + (y-height vector :offset-assert 236) + (pre-open-speed float :offset-assert 240) + (latch-closed-time time-frame :offset-assert 248) + (latch-open-time time-frame :offset-assert 256) + (gear joint-mod :offset-assert 264) + (gear-rot degrees :offset-assert 268) + (gear-rotv degrees :offset-assert 272) + (open-frame float :offset-assert 276) + (pre-open-frame float :offset-assert 280) + (lock-frame float :offset-assert 284) + (open-distance meters :offset-assert 288) + (active-distance meters :offset-assert 292) + (sound-id sound-id :offset-assert 296) + (gear-sound-id sound-id :offset-assert 300) + (sound-gear sound-spec :offset-assert 304) + (sound-pre-open sound-spec :offset-assert 308) + (sound-pre-open-stop sound-spec :offset-assert 312) + (sound-lock-loop sound-spec :offset-assert 316) + (sound-lock-stop sound-spec :offset-assert 320) + (sound-open sound-spec :offset-assert 324) + (sound-open-loop sound-spec :offset-assert 328) + (sound-open-stop sound-spec :offset-assert 332) + (sound-close sound-spec :offset-assert 336) + (sound-close-loop sound-spec :offset-assert 340) + (sound-close-stop sound-spec :offset-assert 344) + (sound-post-close sound-spec :offset-assert 348) + (sound-post-close-stop sound-spec :offset-assert 352) + (spool-sound-time time-frame :offset-assert 360) + (door-radius meters :offset-assert 368) + ) + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + (:methods + (open (symbol) _type_ :state 20) + (close (symbol) _type_ :state 21) + (init-airlock! (_type_) _type_ 22) + (want-cross-airlock? (_type_) symbol :behavior com-airlock 23) + (destination-loaded? (_type_ symbol) symbol 24) + (check-crossing-distance (_type_ vector symbol) float :behavior com-airlock 25) + (rotate-gear! (_type_ float) degrees :behavior com-airlock 26) + (play-city-voice-sound (_type_ symbol) none :behavior com-airlock 27) + ) + ) + + +(defmethod deactivate com-airlock ((obj com-airlock)) + (process-entity-status! obj (entity-perm-status subtask-complete) #f) + (if (nonzero? (-> obj sound-id)) + (sound-stop (-> obj sound-id)) + ) + (if (nonzero? (-> obj gear-sound-id)) + (sound-stop (-> obj gear-sound-id)) + ) + ((method-of-type process-drawable deactivate) obj) + (none) + ) + +;; WARN: Return type mismatch process-drawable vs com-airlock. +(defmethod relocate com-airlock ((obj com-airlock) (arg0 int)) + (if (nonzero? (-> obj gear)) + (&+! (-> obj gear) arg0) + ) + (the-as com-airlock ((method-of-type process-drawable relocate) obj arg0)) + ) + +(defmethod init-airlock! com-airlock ((obj com-airlock)) + (process-entity-status! obj (entity-perm-status subtask-complete) #f) + (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj were-behind?) #f) + (set! (-> obj inner?) + (logtest? (the-as int (res-lump-value (-> obj entity) 'options uint128 :time -1000000000.0)) 1) + ) + (set! (-> obj sound-behind?) #f) + (set! (-> obj saw-pilot?) (the-as handle #f)) + (set! (-> obj open-frame) 0.0) + (set! (-> obj pre-open-frame) 0.0) + (set! (-> obj lock-frame) 0.0) + (set! (-> obj pre-open-speed) 2.0) + (set! (-> obj open-distance) (res-lump-float (-> obj entity) 'distance :default 143360.0)) + (set! (-> obj active-distance) + (res-lump-float (-> obj entity) 'idle-distance :default (+ 143360.0 (-> obj open-distance))) + ) + (set! (-> obj y-height) (res-lump-data (-> obj entity) 'height vector)) + (set! (-> obj level-name) (res-lump-struct (-> obj entity) 'on-notice string)) + (set! (-> obj open-test) + (the-as symbol ((method-of-type res-lump get-property-struct) + (-> obj entity) + 'open-test + 'interp + -1000000000.0 + (the-as structure '(not (or (scene-player?) (focus-test? *target* grabbed)))) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (set! (-> obj sound-gear) #f) + (set! (-> obj sound-pre-open) #f) + (set! (-> obj sound-pre-open-stop) #f) + (set! (-> obj sound-lock-loop) #f) + (set! (-> obj sound-lock-stop) #f) + (set! (-> obj sound-post-close) #f) + (set! (-> obj sound-post-close-stop) #f) + (set! (-> obj sound-open) #f) + (set! (-> obj sound-close) #f) + (set! (-> obj sound-open-loop) #f) + (set! (-> obj sound-close-loop) #f) + (set! (-> obj sound-open-stop) #f) + (set! (-> obj sound-close-stop) #f) + (set! (-> obj door-radius) 20480.0) + obj + ) + +(defmethod check-crossing-distance com-airlock ((obj com-airlock) (arg0 vector) (arg1 symbol)) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override quat))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj root-override trans))) + ) + (set! (-> s4-1 y) 0.0) + (let ((f30-0 (vector-dot s4-1 s5-0))) + (cond + ((not arg1) + ) + ((or (< (vector-vector-xz-distance (-> obj root-override trans) arg0) 40960.0) + (< 0.7 (fabs (vector-dot s5-0 (vector-normalize! s4-1 1.0)))) + ) + (when (and (< f30-0 0.0) (< 0.0 (-> obj last-distance))) + (let ((s5-1 (res-lump-struct (-> obj entity) 'on-cross structure))) + (if s5-1 + (eval! (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) s5-1) + ) + ) + ) + (set! (-> obj last-distance) f30-0) + ) + ((< 0.0 (-> obj last-distance)) + (set! f30-0 (fmax 4096.0 f30-0)) + ) + ((< (-> obj last-distance) 0.0) + (set! f30-0 (fmin -4096.0 f30-0)) + ) + ) + f30-0 + ) + ) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod want-cross-airlock? com-airlock ((obj com-airlock)) + (local-vars (a0-12 entity-actor)) + (let* ((s4-0 (target-pos 0)) + (f30-0 (check-crossing-distance obj s4-0 #t)) + (s5-0 (>= (-> obj latch-open-time) (-> self clock frame-counter))) + ) + (the-as + symbol + (and (or s5-0 (< (vector-vector-xz-distance (-> obj root-override trans) s4-0) (-> obj active-distance))) + (or s5-0 (not (-> obj y-height)) (and (>= (-> s4-0 y) (- (-> obj root-override trans y) (-> obj y-height y))) + (< (-> s4-0 y) (+ (-> obj root-override trans y) (-> obj y-height x))) + ) + ) + (begin + (if (and (not (-> obj were-behind?)) (and (< f30-0 0.0) (-> obj inner?))) + (set! (-> obj were-behind?) #t) + ) + (and (< (-> obj latch-closed-time) (-> self clock frame-counter)) + (or (not (and *target* (logtest? (focus-status fs20 fs30) (-> *target* focus-status)))) (< f30-0 -409.6)) + (or (and (< f30-0 (-> obj open-distance)) + (or (not (-> obj were-behind?)) (< f30-0 20480.0)) + (and (or (< 409.6 f30-0) + (begin + (let ((a0-11 (-> obj entity))) + (set! a0-12 (entity-actor-lookup a0-11 'next-actor 0)) + ) + (not a0-12) + ) + (logtest? (-> a0-12 extra perm status) (entity-perm-status subtask-complete)) + ) + (and (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + (the-as structure (-> obj open-test)) + ) + (-> *setting-control* user-current airlock) + ) + ) + ) + s5-0 + (let ((f0-8 (check-crossing-distance obj (camera-pos) #f))) + (and (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status fs8)))) + (or (< (* f30-0 f0-8) 0.0) + (and (< (fabs f0-8) 4096.0) + (< (vector-vector-xz-distance (camera-pos) (-> obj root-override trans)) (-> obj door-radius)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +(defmethod destination-loaded? com-airlock ((obj com-airlock) (arg0 symbol)) + (with-pp + (let ((gp-1 (eval! + (new 'stack 'script-context (the-as basic (process->ppointer pp)) pp (the-as vector #f)) + (-> obj level-name) + ) + ) + (s4-0 #f) + ) + (cond + ((not gp-1) + (if arg0 + 'unknown + #f + ) + ) + (arg0 + (let* ((s3-0 gp-1) (s2-0 (car s3-0))) (while (not (null? s3-0)) + (let ((v1-4 (level-status *level* (the-as symbol s2-0)))) + (if (not (or (= v1-4 'loaded) (= v1-4 'active))) + (return #f) + ) + ) + (if (= s2-0 'ctywide) + (set! s4-0 (-> ctywide borrow-level 1)) + ) + (set! s3-0 (cdr s3-0)) + (set! s2-0 (car s3-0)) + ) + ) + (when s4-0 + (let ((v1-17 (level-status *level* s4-0))) + (if (not (or (= v1-17 'loaded) (= v1-17 'active))) + (return #f) + ) + ) + ) + (if (!= arg0 'display) + (return #t) + ) + (let ((a1-7 (car gp-1))) + (while (not (null? gp-1)) + (let ((v1-26 (level-get *level* (the-as symbol a1-7)))) + (if (not (and v1-26 (= (-> v1-26 status) 'active) (-> v1-26 display?))) + (return #f) + ) + ) + (set! gp-1 (cdr gp-1)) + (set! a1-7 (car gp-1)) + ) + ) + #t + ) + (else + (let* ((v1-33 gp-1) (a0-11 (car v1-33))) (while (not (null? v1-33)) + (dotimes (a1-10 6) + (if (= a0-11 (-> *load-state* want a1-10 name)) + (goto cfg-50) + ) + ) + #t + (return #f) + (label cfg-50) + (set! v1-33 (cdr v1-33)) + (set! a0-11 (car v1-33)) + ) + ) + #t + ) + ) + ) + ) + ) + +(defmethod rotate-gear! com-airlock ((obj com-airlock) (arg0 float)) + (when (nonzero? (-> obj gear)) + (if (and (zero? (-> obj gear-sound-id)) + (-> obj sound-gear) + (and (-> obj next-state) (= (-> obj next-state name) 'open)) + (>= (check-crossing-distance obj (target-pos 0) #f) 0.0) + ) + (set! (-> obj gear-sound-id) (sound-play-by-spec (-> obj sound-gear) (new-sound-id) (the-as vector #t))) + ) + (seek! (-> obj gear-rotv) arg0 (* 131072.0 (-> self clock seconds-per-frame))) + (+! (-> obj gear-rot) (* (-> obj gear-rotv) (-> self clock seconds-per-frame))) + (twist-set! (-> obj gear) (the-as float #f) (the-as float #f) (-> obj gear-rot)) + ) + (-> obj gear-rotv) + ) + +;; WARN: Return type mismatch int vs none. +(defmethod play-city-voice-sound com-airlock ((obj com-airlock) (arg0 symbol)) + (let ((gp-0 (the-as array #f))) + (case arg0 + (('enter) + (set! gp-0 (new 'static 'boxed-array :type string "cityv005" "cityv006" "cityv007" "cityv008" "cityv009")) + ) + (('exit) + (set! gp-0 (new 'static 'boxed-array :type string "cityv001" "cityv002" "cityv003" "cityv004")) + ) + ) + (cond + ((and gp-0 (>= (- (-> self clock frame-counter) (-> obj spool-sound-time)) (seconds 2))) + (set! (-> obj spool-sound-time) (-> self clock frame-counter)) + (gui-control-method-9 + *gui-control* + obj + (gui-channel alert) + (gui-action play) + (-> (the-as (array string) (+ (* (rand-vu-int-range 0 (+ (-> gp-0 length) -1)) 4) (the-as int gp-0))) 0) + -99.0 + 0 + ) + ) + (else + 0 + ) + ) + ) + (none) + ) + +(let ((a0-10 (new 'static 'skeleton-group + :name "skel-com-airlock-outer" + :extra #f + :info #f + :art-group-name "com-airlock-outer" + :bounds (new 'static 'vector :y 20480.0 :w 57344.0) + :version #x7 + ) + ) + ) + (set! (-> a0-10 jgeo) 0) + (set! (-> a0-10 janim) 2) + (set! (-> a0-10 mgeo 0) 1) + (set! (-> a0-10 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-10) + ) + +(let ((a0-11 (new 'static 'skeleton-group + :name "skel-com-airlock-inner" + :extra #f + :info #f + :art-group-name "com-airlock-inner" + :bounds (new 'static 'vector :y 20480.0 :w 57344.0) + :version #x7 + ) + ) + ) + (set! (-> a0-11 jgeo) 0) + (set! (-> a0-11 janim) 2) + (set! (-> a0-11 mgeo 0) 1) + (set! (-> a0-11 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-11) + ) + +(defstate close (com-airlock) + :virtual #t + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((v1-0 arg2)) + (the-as + object + (cond + ((= v1-0 'close) + (set! (-> self latch-closed-time) (+ (-> self clock frame-counter) (if (>= arg1 1) + (the-as int (-> arg3 param 0)) + 3000 + ) + ) + ) + (if (and (>= arg1 2) (and (= (-> arg3 param 1) #t) (not (want-cross-airlock? self)))) + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min) + ) + (and (-> self next-state) (= (-> self next-state name) 'open)) + ) + ((= v1-0 'open) + (set! (-> self latch-open-time) (+ (-> self clock frame-counter) (if (>= arg1 1) + (the-as int (-> arg3 param 0)) + 3000 + ) + ) + ) + (if (and (>= arg1 2) (and (= (-> arg3 param 1) #t) (want-cross-airlock? self) (destination-loaded? self #f))) + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) + :num! (identity + (the float (+ (-> (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) frames num-frames) -1)) + ) + ) + ) + (and (-> self next-state) (= (-> self next-state name) 'close)) + ) + ((= v1-0 'front) + (let ((f30-0 (check-crossing-distance self (target-pos 0) #f)) + (f0-3 (check-crossing-distance self (camera-pos) #f)) + ) + (and (< 2048.0 f30-0) (>= (* f30-0 f0-3) 0.0)) + ) + ) + ((= v1-0 'back) + (let ((f30-1 (check-crossing-distance self (target-pos 0) #f)) + (f0-5 (check-crossing-distance self (camera-pos) #f)) + ) + (and (< f30-1 -2048.0) (>= (* f30-1 f0-5) 0.0)) + ) + ) + ((= v1-0 'sound) + (if (>= (check-crossing-distance self (target-pos 0) #f) 0.0) + (play-city-voice-sound self (the-as symbol (-> arg3 param 0))) + ) + ) + ((= v1-0 'distance) + (* (the int (check-crossing-distance self (target-pos 0) #f)) 8) + ) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set! (-> self visible-move?) #f) + (none) + ) + :exit (behavior () + (when (nonzero? (-> self sound-id)) + (let ((v1-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-2 command) (sound-command set-param)) + (set! (-> v1-2 id) (-> self sound-id)) + (set! (-> v1-2 params volume) -4) + (set! (-> v1-2 auto-time) 24) + (set! (-> v1-2 auto-from) 2) + (set! (-> v1-2 params mask) (the-as uint 17)) + (-> v1-2 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + (when (nonzero? (-> self gear-sound-id)) + (let ((v1-6 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-6 command) (sound-command set-param)) + (set! (-> v1-6 id) (-> self gear-sound-id)) + (set! (-> v1-6 params volume) -4) + (set! (-> v1-6 auto-time) 24) + (set! (-> v1-6 auto-from) 2) + (set! (-> v1-6 params mask) (the-as uint 17)) + (-> v1-6 id) + ) + (set! (-> self gear-sound-id) (new 'static 'sound-id)) + 0 + ) + (none) + ) + :trans (behavior () + (if (logtest? (-> self draw status) (draw-control-status on-screen)) + (set! (-> self visible-move?) #t) + ) + (when (and (want-cross-airlock? self) + (begin + (let ((gp-0 (res-lump-struct (-> self entity) 'on-activate structure))) + (if gp-0 + (eval! (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) gp-0) + ) + ) + (destination-loaded? self #f) + ) + ) + (when (nonzero? (-> self sound-id)) + (let ((v1-17 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-17 command) (sound-command set-param)) + (set! (-> v1-17 id) (-> self sound-id)) + (set! (-> v1-17 params volume) -4) + (set! (-> v1-17 auto-time) 24) + (set! (-> v1-17 auto-from) 2) + (set! (-> v1-17 params mask) (the-as uint 17)) + (-> v1-17 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + (go-virtual open #f) + ) + (none) + ) + :code (behavior ((arg0 symbol)) + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (when (not arg0) + (if (and (-> self sound-close) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (sound-play-by-spec (-> self sound-close) (new-sound-id) (the-as vector #t)) + ) + (if (and (-> self sound-close-loop) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (set! (-> self sound-id) (sound-play-by-spec (-> self sound-close-loop) (new-sound-id) (the-as vector #t))) + ) + (while (< (-> self open-frame) (ja-aframe-num 0)) + (rotate-gear! self 65536.0) + (when (and (-> self were-behind?) + (< 0.4 (vector-dot + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override quat)) + (-> (math-camera-matrix) vector 2) + ) + ) + (< 0.0 (check-crossing-distance self (target-pos 0) #f)) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe (-> self open-frame) 0)) + (goto cfg-42) + ) + (suspend) + (ja :num! (seek! 0.0 2.0)) + (transform-post) + ) + (label cfg-42) + (if (< 0.0 (check-crossing-distance self (target-pos 0) #f)) + ((lambda :behavior com-airlock + () + (let ((gp-0 (res-lump-struct (-> self entity) 'on-exit structure))) + (if (and gp-0 (not *scene-player*)) + (eval! (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) gp-0) + ) + ) + (when (-> self were-behind?) + (let ((gp-1 (res-lump-struct (-> self entity) 'on-inside structure))) + (set! (-> self were-behind?) #f) + (if (and gp-1 (not *scene-player*)) + (eval! (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) gp-1) + ) + ) + ) + ) + ) + ) + (when (nonzero? (-> self sound-id)) + (let ((v1-46 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-46 command) (sound-command set-param)) + (set! (-> v1-46 id) (-> self sound-id)) + (set! (-> v1-46 params volume) -4) + (set! (-> v1-46 auto-time) 24) + (set! (-> v1-46 auto-from) 2) + (set! (-> v1-46 params mask) (the-as uint 17)) + (-> v1-46 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + (if (and (-> self sound-close-stop) (not arg0) (-> self visible-move?)) + (sound-play-by-spec (-> self sound-close-stop) (new-sound-id) (the-as vector #t)) + ) + (while (not (ja-min? 0)) + (if (and (zero? (-> self sound-id)) + (-> self sound-post-close) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (set! (-> self sound-id) (sound-play-by-spec (-> self sound-post-close) (new-sound-id) (the-as vector #t))) + ) + (rotate-gear! self 65536.0) + (suspend) + (ja :num! (seek! 0.0)) + (transform-post) + ) + (when (nonzero? (-> self sound-id)) + (let ((v1-71 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-71 command) (sound-command set-param)) + (set! (-> v1-71 id) (-> self sound-id)) + (set! (-> v1-71 params volume) -4) + (set! (-> v1-71 auto-time) 24) + (set! (-> v1-71 auto-from) 2) + (set! (-> v1-71 params mask) (the-as uint 17)) + (-> v1-71 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + (if (-> self sound-post-close-stop) + (sound-play-by-spec (-> self sound-post-close-stop) (new-sound-id) (the-as vector #t)) + ) + ) + (when (< 0.0 (check-crossing-distance self (target-pos 0) #f)) + (let ((gp-3 (res-lump-struct (-> self entity) 'on-deactivate structure))) + (if (and gp-3 (not *scene-player*)) + (eval! (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) gp-3) + ) + ) + ) + (while (!= (-> self gear-rotv) 0.0) + (rotate-gear! self 0.0) + (suspend) + (transform-post) + ) + (when (nonzero? (-> self gear-sound-id)) + (let ((v1-91 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-91 command) (sound-command set-param)) + (set! (-> v1-91 id) (-> self gear-sound-id)) + (set! (-> v1-91 params volume) -4) + (set! (-> v1-91 auto-time) 24) + (set! (-> v1-91 auto-from) 2) + (set! (-> v1-91 params mask) (the-as uint 17)) + (-> v1-91 id) + ) + (set! (-> self gear-sound-id) (new 'static 'sound-id)) + 0 + ) + ) + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min) + (transform-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) + ) + +(defstate open (com-airlock) + :virtual #t + :event (-> (method-of-type com-airlock close) event) + :enter (behavior ((arg0 symbol)) + (set! (-> self visible-move?) #f) + (none) + ) + :exit (-> (method-of-type com-airlock close) exit) + :trans (behavior () + (if (logtest? (-> self draw status) (draw-control-status on-screen)) + (set! (-> self visible-move?) #t) + ) + (if (not (want-cross-airlock? self)) + (go-virtual close #f) + ) + (when (logtest? (-> self mask) (process-mask sleep-code)) + (let ((v1-14 (destination-loaded? self 'display))) + (when (or (not v1-14) (= v1-14 'unknown)) + (if (and (not v1-14) (< (-> self open-frame) (ja-aframe-num 0))) + (ja :num-func num-func-identity :frame-num (ja-aframe (-> self open-frame) 0)) + ) + (go-virtual close #f) + ) + ) + ) + (none) + ) + :code (behavior ((arg0 symbol)) + (when (not arg0) + (when (< (check-crossing-distance self (target-pos 0) #f) 0.0) + (if (< (ja-aframe-num 0) (-> self pre-open-frame)) + (ja :num-func num-func-identity :frame-num (ja-aframe (-> self pre-open-frame) 0)) + ) + ) + (while (< (ja-aframe-num 0) (-> self lock-frame)) + (if (and (zero? (-> self sound-id)) + (-> self sound-pre-open) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (set! (-> self sound-id) (sound-play-by-spec (-> self sound-pre-open) (new-sound-id) (the-as vector #t))) + ) + (rotate-gear! self 65536.0) + (suspend) + (ja :num! (seek! (ja-aframe (-> self lock-frame) 0) (-> self pre-open-speed))) + (transform-post) + ) + (when (nonzero? (-> self sound-id)) + (let ((v1-26 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-26 command) (sound-command set-param)) + (set! (-> v1-26 id) (-> self sound-id)) + (set! (-> v1-26 params volume) -4) + (set! (-> v1-26 auto-time) 24) + (set! (-> v1-26 auto-from) 2) + (set! (-> v1-26 params mask) (the-as uint 17)) + (-> v1-26 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + (if (-> self sound-pre-open-stop) + (sound-play-by-spec (-> self sound-pre-open-stop) (new-sound-id) (the-as vector #t)) + ) + ) + (while (< (ja-aframe-num 0) (-> self open-frame)) + (if (and (zero? (-> self sound-id)) + (-> self sound-lock-loop) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (set! (-> self sound-id) (sound-play-by-spec (-> self sound-lock-loop) (new-sound-id) (the-as vector #t))) + ) + (rotate-gear! self 65536.0) + (suspend) + (ja :num! (seek! (ja-aframe (-> self open-frame) 0) 2.0)) + (transform-post) + ) + (when (nonzero? (-> self sound-id)) + (let ((v1-49 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-49 command) (sound-command set-param)) + (set! (-> v1-49 id) (-> self sound-id)) + (set! (-> v1-49 params volume) -4) + (set! (-> v1-49 auto-time) 24) + (set! (-> v1-49 auto-from) 2) + (set! (-> v1-49 params mask) (the-as uint 17)) + (-> v1-49 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + (if (-> self sound-lock-stop) + (sound-play-by-spec (-> self sound-lock-stop) (new-sound-id) (the-as vector #t)) + ) + ) + (while (not (destination-loaded? self #t)) + (rotate-gear! self 65536.0) + (suspend) + (transform-post) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((s5-10 (res-lump-struct (-> self entity) 'on-enter structure))) + (if s5-10 + (eval! (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) s5-10) + ) + ) + (if (and (-> self sound-open) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (sound-play-by-spec (-> self sound-open) (new-sound-id) (the-as vector #t)) + ) + (if (and (-> self sound-open-loop) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (set! (-> self sound-id) (sound-play-by-spec (-> self sound-open-loop) (new-sound-id) (the-as vector #t))) + ) + (set! (-> *ACTOR-bank* birth-max) 1000) + (while (not (ja-max? 0)) + (rotate-gear! self 65536.0) + (suspend) + (ja :num! (seek!)) + (transform-post) + ) + (when (nonzero? (-> self sound-id)) + (let ((v1-94 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-94 command) (sound-command set-param)) + (set! (-> v1-94 id) (-> self sound-id)) + (set! (-> v1-94 params volume) -4) + (set! (-> v1-94 auto-time) 24) + (set! (-> v1-94 auto-from) 2) + (set! (-> v1-94 params mask) (the-as uint 17)) + (-> v1-94 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + (when (nonzero? (-> self gear-sound-id)) + (let ((v1-99 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-99 command) (sound-command set-param)) + (set! (-> v1-99 id) (-> self gear-sound-id)) + (set! (-> v1-99 params volume) -4) + (set! (-> v1-99 auto-time) 24) + (set! (-> v1-99 auto-from) 2) + (set! (-> v1-99 params mask) (the-as uint 17)) + (-> v1-99 id) + ) + (set! (-> self gear-sound-id) (new 'static 'sound-id)) + 0 + ) + (if (and (-> self sound-open-stop) (not arg0) (-> self visible-move?)) + (sound-play-by-spec (-> self sound-open-stop) (new-sound-id) (the-as vector #t)) + ) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) + :num! (identity + (the float (+ (-> (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) frames num-frames) -1)) + ) + ) + (transform-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) + ) + +(deftype com-airlock-outer (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! com-airlock-outer ((obj com-airlock-outer) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 20480.0 0.0 57344.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 20480.0 0.0 32768.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 7) + (set-vector! (-> v1-10 local-sphere) 0.0 20480.0 0.0 32768.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (init-airlock! obj) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-com-airlock-outer" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj pre-open-frame) 35.0) + (set! (-> obj lock-frame) 45.0) + (set! (-> obj open-frame) 45.0) + (set! (-> obj sound-pre-open) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-slider") + :volume #x400 + ) + ) + (set! (-> obj sound-pre-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-slide-e") + :volume #x400 + ) + ) + (set! (-> obj sound-open) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-seal") + :volume #x400 + ) + ) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-open") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-post-close) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-slider") + :volume #x400 + ) + ) + (set! (-> obj sound-post-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-slide-e") + :volume #x400 + ) + ) + (go (method-of-object obj close) #t) + (none) + ) + +(deftype com-airlock-inner (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! com-airlock-inner ((obj com-airlock-inner) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 20480.0 0.0 57344.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 20480.0 0.0 32768.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 8) + (set-vector! (-> v1-10 local-sphere) 0.0 20480.0 0.0 32768.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-com-airlock-inner" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj lock-frame) 37.0) + (set! (-> obj pre-open-frame) 65.0) + (set! (-> obj open-frame) 75.0) + (set! (-> obj gear) (new 'process 'joint-mod (joint-mod-mode rotate) obj 12)) + (set! (-> obj inner?) + (logtest? (the-as int (res-lump-value (-> obj entity) 'options uint128 :default (the-as uint128 1) :time -1000000000.0)) + 1 + ) + ) + (set! (-> obj pre-open-speed) 0.9) + (set! (-> obj sound-gear) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-gear") + :volume #x400 + ) + ) + (set! (-> obj sound-pre-open) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-slider") + :volume #x400 + ) + ) + (set! (-> obj sound-pre-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-slide-e") + :volume #x400 + ) + ) + (set! (-> obj sound-lock-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-turn") + :volume #x400 + ) + ) + (set! (-> obj sound-lock-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-unlock") + :volume #x400 + ) + ) + (set! (-> obj sound-open) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-seal") + :volume #x400 + ) + ) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-open") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-hit") + :volume #x400 + ) + ) + (go (method-of-object obj close) #t) + (none) + ) + +(let ((a0-20 (new 'static 'skeleton-group + :name "skel-fort-entry-gate" + :extra #f + :info #f + :art-group-name "fort-entry-gate" + :bounds (new 'static 'vector :y 12288.0 :w 40960.0) + :version #x7 + ) + ) + ) + (set! (-> a0-20 jgeo) 0) + (set! (-> a0-20 janim) 2) + (set! (-> a0-20 mgeo 0) 1) + (set! (-> a0-20 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-20) + ) + +(deftype fort-entry-gate (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! fort-entry-gate ((obj fort-entry-gate) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 40960.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 8192.0 16384.0 0.0 20480.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) -8192.0 16384.0 0.0 20480.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-entry-gate" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "door-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "door-stop-open") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "door-close") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "door-stop-close") + :volume #x400 + ) + ) + (go (method-of-object obj close) #t) + (none) + ) + +(let ((a0-24 (new 'static 'skeleton-group + :name "skel-hip-door-a" + :extra #f + :info #f + :art-group-name "hip-door-a" + :bounds (new 'static 'vector :y 8192.0 :w 20480.0) + :version #x7 + ) + ) + ) + (set! (-> a0-24 jgeo) 0) + (set! (-> a0-24 janim) 2) + (set! (-> a0-24 mgeo 0) 1) + (set! (-> a0-24 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-24) + ) + +(deftype hip-door-a (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-door-a ((obj hip-door-a) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-door-a" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-open-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-close") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-close-hit") + :volume #x400 + ) + ) + (set! (-> obj door-radius) 8192.0) + (go (method-of-object obj close) #t) + (none) + ) + +(let ((a0-28 (new 'static 'skeleton-group + :name "skel-tomb-mar-door" + :extra #f + :info #f + :art-group-name "tomb-mar-door" + :bounds (new 'static 'vector :y 24576.0 :w 73728.0) + :version #x7 + :origin-joint-index 3 + ) + ) + ) + (set! (-> a0-28 jgeo) 0) + (set! (-> a0-28 janim) 2) + (set! (-> a0-28 mgeo 0) 1) + (set! (-> a0-28 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-28) + ) + +(deftype tomb-mar-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-mar-door ((obj tomb-mar-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 24576.0 0.0 73728.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-mar-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wing-door-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wing-open-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wing-door-close") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wing-close-hit") + :volume #x400 + ) + ) + (go (method-of-object obj close) #t) + (none) + ) + +(deftype cas-front-door (com-airlock-outer) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +(let ((a0-34 (new 'static 'skeleton-group + :name "skel-pal-throne-door" + :extra #f + :info #f + :art-group-name "pal-throne-door" + :bounds (new 'static 'vector :y 24576.0 :w 98304.0) + :version #x7 + :origin-joint-index 3 + ) + ) + ) + (set! (-> a0-34 jgeo) 0) + (set! (-> a0-34 janim) 2) + (set! (-> a0-34 mgeo 0) 1) + (set! (-> a0-34 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-34) + ) + +(deftype pal-throne-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-throne-door ((obj pal-throne-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 24576.0 0.0 73728.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 5) + (set-vector! (-> v1-8 local-sphere) 0.0 -24576.0 0.0 65536.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 4) + (set-vector! (-> v1-10 local-sphere) 0.0 -24576.0 0.0 65536.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-throne-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-slide") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-slide") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-behind?) #t) + (go (method-of-object obj close) #t) + (none) + ) + +(let ((a0-38 (new 'static 'skeleton-group + :name "skel-vin-door-ctyinda" + :extra #f + :info #f + :art-group-name "vin-door-ctyinda" + :bounds (new 'static 'vector :y 12288.0 :w 24576.0) + :version #x7 + ) + ) + ) + (set! (-> a0-38 jgeo) 0) + (set! (-> a0-38 janim) 2) + (set! (-> a0-38 mgeo 0) 1) + (set! (-> a0-38 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-38) + ) + +(deftype vin-door-ctyinda (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! vin-door-ctyinda ((obj vin-door-ctyinda) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 24576.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 8192.0 16384.0 0.0 20480.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) -8192.0 16384.0 0.0 20480.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-vin-door-ctyinda" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-open-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-close") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-close-hit") + :volume #x400 + ) + ) + (set! (-> obj door-radius) 8192.0) + (go (method-of-object obj close) #t) + (none) + ) + +(let ((a0-42 (new 'static 'skeleton-group + :name "skel-under-door" + :extra #f + :info #f + :art-group-name "hip-door-a" + :bounds (new 'static 'vector :y 8192.0 :w 20480.0) + :version #x7 + ) + ) + ) + (set! (-> a0-42 jgeo) 0) + (set! (-> a0-42 janim) 2) + (set! (-> a0-42 mgeo 0) 1) + (set! (-> a0-42 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-42) + ) + +(deftype under-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! under-door ((obj under-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-under-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-open-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-close") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-close-hit") + :volume #x400 + ) + ) + (set! (-> obj door-radius) 8192.0) + (go (method-of-object obj close) #t) + (none) + ) + +(let ((a0-46 (new 'static 'skeleton-group + :name "skel-oracle-door" + :extra #f + :info #f + :art-group-name "oracle-door" + :bounds (new 'static 'vector :y 16384.0 :w 40960.0) + :version #x7 + ) + ) + ) + (set! (-> a0-46 jgeo) 0) + (set! (-> a0-46 janim) 2) + (set! (-> a0-46 mgeo 0) 1) + (set! (-> a0-46 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-46) + ) + +(deftype oracle-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! oracle-door ((obj oracle-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-oracle-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-open-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-close") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-close-hit") + :volume #x400 + ) + ) + (go (method-of-object obj close) #t) + (none) + ) + + + + diff --git a/scripts/gsrc/code_retention/code_retention.py b/scripts/gsrc/code_retention/code_retention.py index 986d35f41d..a2c2a44293 100644 --- a/scripts/gsrc/code_retention/code_retention.py +++ b/scripts/gsrc/code_retention/code_retention.py @@ -114,7 +114,7 @@ def lookahead_for_code(lines, index): # returns form, or none def is_line_start_of_form(line): - if line.rstrip().startswith(";"): + if line.lstrip().startswith(";"): return None matches = re.search(r"\(\s*([^\s.]*)\s+", line) if matches is not None: diff --git a/scripts/gsrc/update-from-decomp.py b/scripts/gsrc/update-from-decomp.py index be55ef4c12..3b10d1b8ac 100644 --- a/scripts/gsrc/update-from-decomp.py +++ b/scripts/gsrc/update-from-decomp.py @@ -142,10 +142,10 @@ with open(decomp_file_path) as f: if not skip_form: decomp_form_def_lines.append(decomp_within_form) decomp_lines.append(line) - while i < len(lines): + while i + 1 < len(lines): i = i + 1 line = lines[i] - if not skip_form: + if not skip_form and not should_ignore_line(line): decomp_lines.append(line) if has_form_ended(decomp_form_paren_stack, line): decomp_within_form = None diff --git a/test/decompiler/reference/jak1/engine/ambient/mood_REF.gc b/test/decompiler/reference/jak1/engine/ambient/mood_REF.gc index 80b9cb9469..7f947e2221 100644 --- a/test/decompiler/reference/jak1/engine/ambient/mood_REF.gc +++ b/test/decompiler/reference/jak1/engine/ambient/mood_REF.gc @@ -32,7 +32,7 @@ ;; definition for function update-mood-itimes ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -;; ERROR: Function may read a register that is not set: f31 +;; WARN: Function may read a register that is not set: f31 (defun update-mood-itimes ((arg0 mood-context)) (local-vars (r0-0 int) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc index 3be71105b0..5fe9369cc5 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc @@ -2583,12 +2583,12 @@ ;; definition for function cam-string-move ;; INFO: Used lq/sq -;; ERROR: Stack slot load at 240 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 256 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 240 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 256 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 240 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 256 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 240 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 256 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 240 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 256 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 240 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 256 mismatch: defined as size 4, got size 16 (defbehavior cam-string-move camera-slave () (local-vars (sv-240 float) (sv-256 float)) (vector-! (-> self velocity) (-> self desired-pos) (-> self string-trans)) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-mesh_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-mesh_REF.gc index 49e014c904..511365005c 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-mesh_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-mesh_REF.gc @@ -357,7 +357,7 @@ ;; definition for method 10 of type collide-mesh ;; INFO: Used lq/sq -;; ERROR: Function may read a register that is not set: f31 +;; WARN: Function may read a register that is not set: f31 (defmethod overlap-test collide-mesh ((obj collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) (local-vars (r0-0 int) diff --git a/test/decompiler/reference/jak1/engine/collide/main-collide_REF.gc b/test/decompiler/reference/jak1/engine/collide/main-collide_REF.gc index 4ac8d486f2..f121e6c9e9 100644 --- a/test/decompiler/reference/jak1/engine/collide/main-collide_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/main-collide_REF.gc @@ -3,7 +3,7 @@ ;; definition for function drawable-sphere-box-intersect? ;; INFO: Used lq/sq -;; ERROR: Function may read a register that is not set: f31 +;; WARN: Function may read a register that is not set: f31 (defun drawable-sphere-box-intersect? ((arg0 drawable) (arg1 bounding-box4w)) (local-vars (r0-0 int) @@ -57,7 +57,7 @@ ;; definition for function instance-sphere-box-intersect? ;; INFO: Used lq/sq -;; ERROR: Function may read a register that is not set: f31 +;; WARN: Function may read a register that is not set: f31 (defun instance-sphere-box-intersect? ((arg0 drawable) (arg1 instance-tie) (arg2 bounding-box4w)) (local-vars (r0-0 int) diff --git a/test/decompiler/reference/jak1/engine/debug/debug_REF.gc b/test/decompiler/reference/jak1/engine/debug/debug_REF.gc index 15c6e33b33..57ee349422 100644 --- a/test/decompiler/reference/jak1/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/debug_REF.gc @@ -1043,7 +1043,7 @@ ;; definition (debug) for function add-debug-yrot-vector ;; INFO: Used lq/sq ;; WARN: Stack slot offset 32 signed mismatch -;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 32 mismatch: defined as size 4, got size 16 (defun-debug add-debug-yrot-vector ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 float) (arg4 float) (arg5 rgba)) (local-vars (sv-32 float)) (set! sv-32 arg3) diff --git a/test/decompiler/reference/jak1/engine/debug/menu_REF.gc b/test/decompiler/reference/jak1/engine/debug/menu_REF.gc index a305c91530..ae80477cbf 100644 --- a/test/decompiler/reference/jak1/engine/debug/menu_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/menu_REF.gc @@ -640,14 +640,14 @@ ;; definition for function debug-menu-make-from-template ;; INFO: Used lq/sq -;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 80 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 80 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 48 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 64 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 80 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 48 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 64 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 80 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 96 mismatch: defined as size 4, got size 16 (defun debug-menu-make-from-template ((arg0 debug-menu-context) (arg1 pair)) (local-vars (s5-0 basic) (sv-16 object) (sv-32 int) (sv-48 float) (sv-64 float) (sv-80 float) (sv-96 float)) (when (or (not arg1) (null? arg1)) diff --git a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-mid_REF.gc b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-mid_REF.gc index a243b0ac0f..866afd8849 100644 --- a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-mid_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-mid_REF.gc @@ -661,7 +661,7 @@ ;; definition for function ocean-mid-add-upload-table ;; INFO: Used lq/sq -;; ERROR: Function may read a register that is not set: f31 +;; WARN: Function may read a register that is not set: f31 (defun ocean-mid-add-upload-table ((arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 (pointer float)) (arg4 int) (arg5 symbol)) (local-vars (r0-0 int) diff --git a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-near_REF.gc b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-near_REF.gc index 18c81effcd..bceff0a5e8 100644 --- a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-near_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-near_REF.gc @@ -435,7 +435,7 @@ ;; definition for function ocean-near-add-upload ;; INFO: Used lq/sq ;; INFO: Return type mismatch pointer vs none. -;; ERROR: Function may read a register that is not set: f31 +;; WARN: Function may read a register that is not set: f31 (defun ocean-near-add-upload ((arg0 dma-buffer) (arg1 uint) (arg2 uint)) (local-vars (r0-0 int) diff --git a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-transition_REF.gc b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-transition_REF.gc index 93f2e69f9f..7165170d94 100644 --- a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-transition_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-transition_REF.gc @@ -100,7 +100,7 @@ ;; definition for function ocean-trans-add-upload-table ;; INFO: Used lq/sq -;; ERROR: Function may read a register that is not set: f31 +;; WARN: Function may read a register that is not set: f31 (defun ocean-trans-add-upload-table ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 (pointer float)) (arg4 int) (arg5 symbol)) (local-vars (r0-0 int) @@ -302,7 +302,7 @@ ;; definition for function ocean-trans-add-upload-strip ;; INFO: Used lq/sq -;; ERROR: Function may read a register that is not set: f31 +;; WARN: Function may read a register that is not set: f31 (defun ocean-trans-add-upload-strip ((arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 uint) (arg4 uint) (arg5 uint)) (local-vars (r0-0 int) diff --git a/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc index 992c390dda..ca2e0afd84 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc @@ -149,7 +149,7 @@ ;; definition for function close-sky-buffer ;; INFO: Used lq/sq ;; INFO: Return type mismatch pointer vs none. -;; ERROR: Function may read a register that is not set: ra +;; WARN: Function may read a register that is not set: ra ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] (defun close-sky-buffer ((arg0 dma-buffer)) (local-vars (ra-0 none)) diff --git a/test/decompiler/reference/jak1/engine/gfx/vis/bsp_REF.gc b/test/decompiler/reference/jak1/engine/gfx/vis/bsp_REF.gc index d268a64212..643cbdbcf7 100644 --- a/test/decompiler/reference/jak1/engine/gfx/vis/bsp_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/vis/bsp_REF.gc @@ -396,7 +396,7 @@ ;; definition for function bsp-camera-asm ;; INFO: Return type mismatch int vs none. -;; ERROR: Function may read a register that is not set: a2 +;; WARN: Function may read a register that is not set: a2 (defun bsp-camera-asm ((bsp-hdr bsp-header) (camera-pos vector)) (local-vars (v1-1 float) (real-node bsp-node)) (rlet ((vf1 :class vf) diff --git a/test/decompiler/reference/jak1/engine/math/matrix_REF.gc b/test/decompiler/reference/jak1/engine/math/matrix_REF.gc index a47de06b3f..3e698ffe02 100644 --- a/test/decompiler/reference/jak1/engine/math/matrix_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/matrix_REF.gc @@ -228,7 +228,7 @@ ;; definition for function matrix-transpose! ;; INFO: Used lq/sq -;; ERROR: Function may read a register that is not set: f31 +;; WARN: Function may read a register that is not set: f31 (defun matrix-transpose! ((dst matrix) (src matrix)) (local-vars (r0-0 int) diff --git a/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc index ffe17be289..d7745f415b 100644 --- a/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc @@ -264,10 +264,10 @@ ;; definition (debug) for function target-print-stats ;; INFO: Used lq/sq -;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 -;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 160 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 176 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 160 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 176 mismatch: defined as size 4, got size 16 (defun-debug target-print-stats ((arg0 target) (arg1 symbol)) (local-vars (sv-64 string) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc index 10bd3b7187..f0bfbc062f 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc @@ -1458,7 +1458,7 @@ ;; definition for function robotboss-redshot ;; INFO: Used lq/sq -;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 +;; WARN: Stack slot load at 64 mismatch: defined as size 4, got size 16 (defbehavior robotboss-redshot robotboss ((arg0 redshot-launch-info) (arg1 symbol)) (local-vars (sv-32 redshot-launch-info) (sv-48 vector) (sv-64 float) (sv-80 time-frame) (sv-96 time-frame)) (set! sv-32 arg0) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc index 76cc8a3149..aab9e62d5f 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc @@ -873,7 +873,7 @@ ;; definition for function race-time-save ;; ERROR: Type Propagation failed: Failed type prop at op 6 ((set! v1 (l.wu (+ a0 -4)))): Could not get type of load: (set! v1 (l.wu (+ a0 -4))). ;; ERROR: Type analysis failed -;; ERROR: Function may read a register that is not set: a2 +;; WARN: Function may read a register that is not set: a2 (defun race-time-save ((a0-0 race-time) (a1-0 task-control)) (local-vars (v0-0 none) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc index 286b0d5ef8..0255fcb62f 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc @@ -943,7 +943,7 @@ swamp-rat-nest-default-event-handler ;; definition for function swamp-rat-nest-spawn-rat ;; INFO: Used lq/sq ;; INFO: Return type mismatch (pointer process) vs (pointer swamp-rat). -;; ERROR: Function may read a register that is not set: t2 +;; WARN: Function may read a register that is not set: t2 (defbehavior swamp-rat-nest-spawn-rat swamp-rat-nest () (local-vars (t2-0 none)) (the-as diff --git a/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc b/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc index 885f764838..cc20bdd07b 100644 --- a/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc @@ -80,7 +80,7 @@ ) ;; definition for method 11 of type traffic-suppression-params -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defmethod has-valid-id? traffic-suppression-params ((obj traffic-suppression-params)) (!= (-> obj id) -1) (none) diff --git a/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc index a99afd1433..f2dfc4363e 100644 --- a/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc @@ -47,7 +47,7 @@ ) ;; definition for method 0 of type align-control -;; INFO: Return type mismatch object vs align-control. +;; WARN: Return type mismatch object vs align-control. (defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process)) (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (when (zero? obj) @@ -58,7 +58,3 @@ (the-as align-control obj) ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc index 128f925fb0..fb7c6cdb8b 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc @@ -154,7 +154,7 @@ ) ;; definition (debug) for function joint-mod-debug-draw -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun-debug joint-mod-debug-draw ((arg0 joint-mod)) (add-debug-matrix #t (bucket-id bucket-318) (-> arg0 joint bone transform) 8192.0) 0 diff --git a/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc index 6d8b553a82..3358fb716d 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc @@ -3,7 +3,7 @@ ;; definition for function joint-mod-ik-callback ;; INFO: Used lq/sq -;; INFO: Return type mismatch matrix vs none. +;; WARN: Return type mismatch matrix vs none. ;; WARN: Function joint-mod-ik-callback has a return type of none, but the expression builder found a return statement. ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] @@ -310,7 +310,7 @@ ;; definition for method 9 of type joint-mod-ik ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod handle-copy! joint-mod-ik ((obj joint-mod-ik) (arg0 vector)) (set! (-> obj handle-pos quad) (-> arg0 quad)) 0 @@ -318,7 +318,7 @@ ) ;; definition for method 10 of type joint-mod-ik -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod enable-set! joint-mod-ik ((obj joint-mod-ik) (arg0 symbol)) (if arg0 (logior! (-> obj flags) (joint-mod-ik-flags enable)) @@ -329,7 +329,7 @@ ) ;; definition for function real-joint-mod-gun-look-at-handler -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior real-joint-mod-gun-look-at-handler process ((arg0 cspace) (arg1 transformq)) (local-vars (sv-16 joint-mod) @@ -517,7 +517,7 @@ ;; definition for function joint-mod-foot-rot-handler ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior joint-mod-foot-rot-handler process ((arg0 cspace) (arg1 transformq)) (let ((s5-0 (the-as joint-mod (-> arg0 param1))) (gp-0 (-> arg0 bone transform)) @@ -604,7 +604,7 @@ ) ;; definition for method 9 of type joint-mod -;; INFO: Return type mismatch joint-mod vs none. +;; WARN: Return type mismatch joint-mod vs none. (defmethod mode-set! joint-mod ((obj joint-mod) (arg0 joint-mod-mode)) (set! (-> obj mode) arg0) (let ((v1-0 (-> obj joint))) @@ -713,7 +713,7 @@ ) ;; definition for method 15 of type joint-mod -;; INFO: Return type mismatch joint-mod vs none. +;; WARN: Return type mismatch joint-mod vs none. (defmethod shut-down joint-mod ((obj joint-mod)) (set! (-> obj shutting-down?) #t) (set! (-> obj blend) 0.0) @@ -736,7 +736,7 @@ ;; definition for method 14 of type joint-mod ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod trs-set! joint-mod ((obj joint-mod) (arg0 vector) (arg1 quaternion) (arg2 vector)) (if arg0 (set! (-> obj trans quad) (-> arg0 quad)) @@ -753,7 +753,7 @@ ;; definition for method 10 of type joint-mod ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod target-set! joint-mod ((obj joint-mod) (arg0 vector)) (if (= (-> obj mode) (joint-mod-mode reset)) (mode-set! obj (joint-mod-mode look-at)) @@ -775,7 +775,7 @@ ;; definition for method 11 of type joint-mod ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod look-at! joint-mod ((obj joint-mod) (arg0 vector) (arg1 symbol) (arg2 process)) (when (= arg1 'attacking) (let* ((s2-0 arg2) @@ -834,7 +834,7 @@ ;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 176 mismatch: defined as size 4, got size 16 -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] @@ -1019,7 +1019,7 @@ ;; definition for function joint-mod-polar-look-at-guts ;; INFO: Used lq/sq -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defbehavior joint-mod-polar-look-at-guts process ((arg0 cspace) (arg1 transformq)) (let ((gp-0 (the-as joint-mod (-> arg0 param1)))) (cspace<-parented-transformq-joint! arg0 arg1) @@ -1143,7 +1143,7 @@ ) ;; definition for function joint-mod-polar-look-at-handler -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior joint-mod-polar-look-at-handler process ((arg0 cspace) (arg1 transformq)) (joint-mod-polar-look-at-guts arg0 arg1) 0 @@ -1152,7 +1152,7 @@ ;; definition for function joint-mod-world-look-at-handler ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior joint-mod-world-look-at-handler process ((arg0 cspace) (arg1 transformq)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 vector)) (let ((gp-0 (the-as joint-mod (-> arg0 param1)))) @@ -1261,7 +1261,7 @@ ) ;; definition for function joint-mod-rotate-handler -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior joint-mod-rotate-handler process ((arg0 cspace) (arg1 transformq)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1343,7 +1343,7 @@ ) ;; definition for function joint-mod-scale-handler -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior joint-mod-scale-handler process ((arg0 cspace) (arg1 transformq)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1375,7 +1375,7 @@ ;; definition for function joint-mod-joint-set-handler ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior joint-mod-joint-set-handler process ((arg0 cspace) (arg1 transformq)) (let ((s4-0 (the-as joint-mod (-> arg0 param1)))) (if (zero? (logand (-> s4-0 track-mode) (track-mode no-trans))) @@ -1395,7 +1395,7 @@ ;; definition for function joint-mod-joint-set-world-handler ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; WARN: Function joint-mod-joint-set-world-handler has a return type of none, but the expression builder found a return statement. (defbehavior joint-mod-joint-set-world-handler process ((arg0 cspace) (arg1 transformq)) (cspace<-parented-transformq-joint! arg0 arg1) @@ -1480,7 +1480,7 @@ ) ;; definition for function joint-mod-joint-set*-handler -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior joint-mod-joint-set*-handler process ((arg0 cspace) (arg1 transformq)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1519,7 +1519,7 @@ ) ;; definition for function joint-mod-joint-set*-world-handler -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior joint-mod-joint-set*-world-handler process ((arg0 cspace) (arg1 transformq)) (cspace<-parented-transformq-joint! arg0 arg1) (let ((s5-0 (the-as joint-mod (-> arg0 param1)))) diff --git a/test/decompiler/reference/jak2/engine/anim/joint_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint_REF.gc index 42a86f3a65..8ca36e0df2 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint_REF.gc @@ -31,19 +31,19 @@ ) ;; definition for method 5 of type joint-anim-matrix -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of joint-anim-matrix ((obj joint-anim-matrix)) (the-as int (+ (-> joint-anim-matrix size) (* (-> obj length) 64))) ) ;; definition for method 5 of type joint-anim-transformq -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of joint-anim-transformq ((obj joint-anim-transformq)) (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> obj length)))) ) ;; definition for method 5 of type joint-anim-drawable -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of joint-anim-drawable ((obj joint-anim-drawable)) (the-as int (+ (-> joint-anim-drawable size) (* (-> obj length) 4))) ) @@ -156,7 +156,7 @@ ) ;; definition for method 5 of type joint-control -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of joint-control ((obj joint-control)) (the-as int (+ (-> obj type size) (* (-> obj allocated-length) 64))) ) @@ -276,13 +276,13 @@ ) ;; definition for method 10 of type art -;; INFO: Return type mismatch symbol vs basic. +;; WARN: Return type mismatch symbol vs basic. (defmethod get-art-by-name-method art ((obj art) (arg0 string) (arg1 type)) (the-as basic #f) ) ;; definition for method 11 of type art -;; INFO: Return type mismatch symbol vs int. +;; WARN: Return type mismatch symbol vs int. (defmethod get-art-idx-by-name-method art ((obj art) (arg0 string) (arg1 type)) (the-as int #f) ) @@ -350,7 +350,7 @@ ) ;; definition for method 5 of type art-joint-anim -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of art-joint-anim ((obj art-joint-anim)) (the-as int (+ (-> art size) (* (-> obj length) 4))) ) @@ -381,7 +381,7 @@ ) ;; definition for method 10 of type art-group -;; INFO: Return type mismatch art-element vs basic. +;; WARN: Return type mismatch art-element vs basic. (defmethod get-art-by-name-method art-group ((obj art-group) (arg0 string) (arg1 type)) (cond (arg1 @@ -466,7 +466,7 @@ ) ;; definition for method 7 of type art-group -;; INFO: Return type mismatch art-group vs none. +;; WARN: Return type mismatch art-group vs none. (defmethod relocate art-group ((obj art-group) (arg0 kheap) (arg1 (pointer uint8))) (let ((s4-0 (clear *temp-string*))) (string<-charp s4-0 arg1) @@ -533,7 +533,7 @@ ) ;; definition for method 5 of type art-mesh-geo -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of art-mesh-geo ((obj art-mesh-geo)) (the-as int (+ (-> art size) (* (-> obj length) 4))) ) @@ -579,13 +579,13 @@ ) ;; definition for method 5 of type art-joint-geo -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of art-joint-geo ((obj art-joint-geo)) (the-as int (+ (-> art size) (* (-> obj length) 4))) ) ;; definition for method 10 of type art-joint-geo -;; INFO: Return type mismatch joint vs basic. +;; WARN: Return type mismatch joint vs basic. (defmethod get-art-by-name-method art-joint-geo ((obj art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 @@ -727,7 +727,7 @@ ;; definition for function joint-control-remap! ;; INFO: Used lq/sq -;; INFO: Return type mismatch symbol vs object. +;; WARN: Return type mismatch symbol vs object. ;; WARN: Using new Jak 2 rtype-of (defun joint-control-remap! ((arg0 joint-control) (arg1 art-group) (arg2 art-group) (arg3 pair) (arg4 int) (arg5 string)) (local-vars @@ -986,7 +986,7 @@ ) ;; definition for function matrix-from-joint-anim-frame -;; INFO: Return type mismatch object vs matrix. +;; WARN: Return type mismatch object vs matrix. (defun matrix-from-joint-anim-frame ((arg0 joint-anim-compressed-control) (arg1 int) (arg2 int)) (let ((v1-1 (the-as object (-> arg0 fixed data))) (v0-0 (the-as object (-> arg0 data arg2 data))) @@ -1083,7 +1083,7 @@ ;; definition for function matrix-from-control! ;; INFO: Used lq/sq -;; INFO: Return type mismatch (inline-array matrix) vs matrix. +;; WARN: Return type mismatch (inline-array matrix) vs matrix. (defun matrix-from-control! ((arg0 matrix-stack) (arg1 joint) (arg2 joint-control) (arg3 symbol)) (set! (-> arg0 top) (the-as matrix (-> arg0 data))) (dotimes (s2-0 (the-as int (+ (-> arg2 active-channels) (-> arg2 float-channels)))) @@ -1438,7 +1438,7 @@ ) ;; definition for function cspace<-matrix-joint-flip-z! -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun cspace<-matrix-joint-flip-z! ((arg0 cspace) (arg1 matrix)) (local-vars (v1-2 float)) (rlet ((vf0 :class vf) @@ -1459,7 +1459,7 @@ ) ;; definition for function cspace<-parented-transformq-joint! -;; ERROR: Function may read a register that is not set: ra +;; WARN: Function may read a register that is not set: ra ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] (defun cspace<-parented-transformq-joint! ((arg0 cspace) (arg1 transformq)) @@ -1606,7 +1606,7 @@ ) ;; definition for function cspace<-parented-transformq-joint-flip-z! -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun cspace<-parented-transformq-joint-flip-z! ((arg0 cspace) (arg1 transformq)) (cspace<-parented-transformq-joint! arg0 arg1) (cspace<-matrix-joint-flip-z! arg0 (-> arg0 bone transform)) @@ -2135,7 +2135,7 @@ ) ;; definition for method 13 of type art-joint-anim-manager -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod unload-from-level art-joint-anim-manager ((obj art-joint-anim-manager) (arg0 level)) (let ((s5-0 (-> arg0 heap base)) (s4-0 (-> arg0 heap top-base)) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-combiner_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-combiner_REF.gc index e40028b98a..66d936f800 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-combiner_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-combiner_REF.gc @@ -432,7 +432,7 @@ ;; definition for function cam-combiner-init ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior cam-combiner-init camera-combiner () (stack-size-set! (-> self main-thread) 512) (vector-reset! (-> self trans)) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-debug-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-debug-h_REF.gc index e87200dbce..7cfed9a907 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-debug-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-debug-h_REF.gc @@ -11,7 +11,7 @@ (define *redline-index* 0) ;; definition for function float-save-redline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun float-save-redline ((arg0 float)) (set! (-> *redline-table* *redline-index*) arg0) (set! *redline-index* (+ *redline-index* 1)) @@ -36,7 +36,7 @@ (define *blueline-index* 0) ;; definition for function float-save-blueline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun float-save-blueline ((arg0 float)) (set! (-> *blueline-table* *blueline-index*) arg0) (set! *blueline-index* (+ *blueline-index* 1)) @@ -61,7 +61,7 @@ (define *greenline-index* 0) ;; definition for function float-save-greenline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun float-save-greenline ((arg0 float)) (set! (-> *greenline-table* *greenline-index*) arg0) (set! *greenline-index* (+ *greenline-index* 1)) @@ -86,7 +86,7 @@ (define *yellowline-index* 0) ;; definition for function float-save-yellowline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun float-save-yellowline ((arg0 float)) (set! (-> *yellowline-table* *yellowline-index*) arg0) (set! *yellowline-index* (+ *yellowline-index* 1)) @@ -111,7 +111,7 @@ (define *timeplot-index* 0) ;; definition for function float-save-timeplot -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun float-save-timeplot ((arg0 float)) (set! (-> *timeplot-table* *timeplot-index*) arg0) (set! *timeplot-index* (+ *timeplot-index* 1)) @@ -136,6 +136,3 @@ 0 ) - - - diff --git a/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc index 79bf117f5c..9aa4c07d16 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc @@ -86,7 +86,7 @@ ) ;; definition for function cam-slave-options->string -;; INFO: Return type mismatch object vs string. +;; WARN: Return type mismatch object vs string. (defun cam-slave-options->string ((arg0 cam-slave-options) (arg1 object)) (if (= (logand arg0 (cam-slave-options SAME_SIDE)) (cam-slave-options SAME_SIDE)) (format arg1 "SAME_SIDE ") @@ -166,7 +166,7 @@ ) ;; definition for function cam-index-options->string -;; INFO: Return type mismatch object vs string. +;; WARN: Return type mismatch object vs string. (defun cam-index-options->string ((arg0 cam-index-options) (arg1 object)) (if (= (logand arg0 (cam-index-options SPHERICAL)) (cam-index-options SPHERICAL)) (format arg1 "RADIAL ") @@ -297,7 +297,7 @@ ;; definition for function camera-plot-float-func ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun camera-plot-float-func ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 (function float float)) (arg5 vector4w)) (let ((f30-0 (- arg1 arg0)) (f24-0 (- arg3 arg2)) @@ -400,7 +400,7 @@ ;; definition for function camera-line-setup ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun camera-line-setup ((arg0 vector4w)) (let ((v1-0 (-> arg0 quad))) (set! (-> (the-as cam-dbg-scratch #x70000000) color quad) v1-0) @@ -412,7 +412,7 @@ ;; definition for function camera-line-draw ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; WARN: Function camera-line-draw has a return type of none, but the expression builder found a return statement. (defun camera-line-draw ((arg0 vector) (arg1 vector)) (set! (-> (the-as (pointer uint128) (+ 80 (the-as int (the-as cam-dbg-scratch #x70000000))))) (-> arg0 quad)) @@ -441,7 +441,7 @@ ) ;; definition for function camera-line -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun camera-line ((arg0 vector) (arg1 vector) (arg2 vector4w)) (camera-line-setup arg2) (camera-line-draw arg0 arg1) @@ -469,7 +469,7 @@ ) ;; definition for function camera-sphere -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun camera-sphere ((arg0 vector) (arg1 float) (arg2 vector4w)) (camera-line-setup arg2) (dotimes (s4-0 10) @@ -584,7 +584,7 @@ ;; definition for function camera-bounding-box-draw ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun camera-bounding-box-draw ((arg0 bounding-box) (arg1 basic) (arg2 rgba)) (camera-line-setup (new 'static 'vector4w :x #x7f :y #x7f :z #x7f :w #x80)) (set! (-> (the-as (pointer uint128) (+ 240 (the-as int (the-as cam-dbg-scratch #x70000000))))) @@ -683,7 +683,7 @@ (define *cam-debug-coll-tri* (the-as (inline-array cam-debug-tri) (malloc 'debug #x8fc0))) ;; definition for function cam-debug-reset-coll-tri -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun cam-debug-reset-coll-tri () (set! *cam-debug-los-tri-current* 0) (set! *cam-debug-coll-tri-current* 0) @@ -693,7 +693,7 @@ ;; definition for function cam-debug-add-los-tri ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun cam-debug-add-los-tri ((arg0 (inline-array collide-cache-tri)) (arg1 vector) (arg2 vector)) (cond ((>= *cam-debug-los-tri-current* 460) @@ -718,7 +718,7 @@ ;; definition for function cam-debug-add-coll-tri ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun cam-debug-add-coll-tri ((arg0 cam-debug-tri) (arg1 vector) (arg2 cam-debug-tri)) (cond ((>= *cam-debug-coll-tri-current* 460) @@ -891,7 +891,7 @@ ;; definition for function camera-fov-frame ;; INFO: Used lq/sq -;; INFO: Return type mismatch none vs symbol. +;; WARN: Return type mismatch none vs symbol. (defun camera-fov-frame ((arg0 matrix) (arg1 vector) (arg2 float) (arg3 float) (arg4 float) (arg5 vector4w)) (vector-float*! (the-as vector (+ 432 (the-as int (the-as cam-dbg-scratch #x70000000)))) @@ -998,7 +998,7 @@ ) ;; definition for method 11 of type tracking-spline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod debug-point-info tracking-spline ((obj tracking-spline) (arg0 int)) (if (= arg0 (-> obj used-point)) (format 0 "u") @@ -1028,7 +1028,7 @@ ) ;; definition for method 12 of type tracking-spline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod debug-all-points tracking-spline ((obj tracking-spline)) (let ((s5-0 (-> obj used-point))) (while (!= s5-0 -134250495) @@ -1042,7 +1042,7 @@ ) ;; definition for method 23 of type tracking-spline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod debug-draw-spline tracking-spline ((obj tracking-spline)) (let ((s5-0 (-> obj used-point))) (let ((s4-0 (-> obj point (-> obj used-point) next))) @@ -1202,7 +1202,7 @@ ;; definition for function camera-slave-debug ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun camera-slave-debug ((arg0 camera-slave)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1551,7 +1551,7 @@ ;; definition for function master-draw-coordinates ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun master-draw-coordinates ((arg0 vector)) (let ((s5-0 (new-stack-vector0)) (gp-0 (new-stack-vector0)) @@ -1706,7 +1706,7 @@ ;; definition for function cam-collision-record-save ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun cam-collision-record-save ((arg0 vector) (arg1 vector) (arg2 int) (arg3 symbol) (arg4 camera-slave)) (with-pp (when *record-cam-collide-history* @@ -1746,7 +1746,7 @@ ) ;; definition for function cam-collision-record-step -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun cam-collision-record-step ((arg0 int)) (set! *cam-collision-record-show* (+ *cam-collision-record-show* arg0)) (while (>= *cam-collision-record-show* 600) @@ -1761,11 +1761,11 @@ ;; definition for function cam-collision-record-draw ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. -;; ERROR: Function may read a register that is not set: t0 -;; ERROR: Function may read a register that is not set: t1 -;; ERROR: Function may read a register that is not set: t2 -;; ERROR: Function may read a register that is not set: t3 +;; WARN: Return type mismatch int vs none. +;; WARN: Function may read a register that is not set: t0 +;; WARN: Function may read a register that is not set: t1 +;; WARN: Function may read a register that is not set: t2 +;; WARN: Function may read a register that is not set: t3 (defun cam-collision-record-draw () (local-vars (t0-0 none) (t1-0 none) (t2-0 none) (t3-0 none)) (cond @@ -1939,7 +1939,7 @@ ) ;; definition for function camera-master-debug -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun camera-master-debug ((arg0 camera-master)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2079,7 +2079,7 @@ ;; definition (debug) for function cam-restore ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun-debug cam-restore () (let ((a0-0 (new-stack-vector0)) (a1-0 (new-stack-matrix0)) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-interface_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-interface_REF.gc index ec5c1580ba..fcd3bb018e 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-interface_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-interface_REF.gc @@ -113,7 +113,7 @@ ;; definition for function camera-teleport-to-entity ;; INFO: Used lq/sq -;; INFO: Return type mismatch object vs none. +;; WARN: Return type mismatch object vs none. (defbehavior camera-teleport-to-entity process ((arg0 entity-actor)) (let ((gp-0 (new 'stack 'transformq))) (set! (-> gp-0 trans quad) (-> arg0 extra trans quad)) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-start_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-start_REF.gc index 0c26a3d01a..179eb3e3e0 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-start_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-start_REF.gc @@ -12,7 +12,7 @@ ) ;; definition for function cam-start -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun cam-start ((arg0 symbol)) (cam-stop) (set! *camera-combiner* diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc index 1aab0e6f3c..ecba37e526 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc @@ -186,7 +186,7 @@ ) ;; definition for function cam-free-floating-input -;; INFO: Return type mismatch uint vs vector. +;; WARN: Return type mismatch uint vs vector. (defun cam-free-floating-input ((arg0 vector) (arg1 vector) (arg2 symbol) (arg3 int)) (with-pp (the-as diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc index 8f785d3f5c..728d591f38 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc @@ -1010,7 +1010,7 @@ ;; definition for function cam-circular-code ;; INFO: Used lq/sq ;; ERROR: failed type prop at 56: Called a function, but we do not know its type -;; INFO: Return type mismatch none vs float. +;; WARN: Return type mismatch none vs float. (defbehavior cam-circular-code camera-slave () (local-vars (v0-0 vector) @@ -1253,10 +1253,10 @@ ;; definition for function cam-string-find-position-rel! ;; INFO: Used lq/sq -;; ERROR: Function may read a register that is not set: t0 -;; ERROR: Function may read a register that is not set: t1 -;; ERROR: Function may read a register that is not set: t2 -;; ERROR: Function may read a register that is not set: t3 +;; WARN: Function may read a register that is not set: t0 +;; WARN: Function may read a register that is not set: t1 +;; WARN: Function may read a register that is not set: t2 +;; WARN: Function may read a register that is not set: t3 ;; WARN: new jak 2 until loop case, check carefully (defun cam-string-find-position-rel! ((arg0 vector)) (local-vars (t0-0 none) (t1-0 none) (t2-0 none) (t3-0 none)) @@ -1329,7 +1329,7 @@ ;; definition for function cam-string-set-position-rel! ;; INFO: Used lq/sq -;; INFO: Return type mismatch uint vs cam-slave-options. +;; WARN: Return type mismatch uint vs cam-slave-options. (defbehavior cam-string-set-position-rel! camera-slave ((arg0 vector)) (vector-flatten! (-> self view-flat) arg0 (-> *camera* local-down)) (set! (-> self min-z-override) (vector-length (-> self view-flat))) @@ -1349,7 +1349,7 @@ ) ;; definition (debug) for function cam-draw-collide-cache -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun-debug cam-draw-collide-cache ((arg0 collide-cache)) (let ((gp-0 (the-as object (-> arg0 tris)))) (countdown (s5-0 (-> arg0 num-tris)) @@ -1433,7 +1433,7 @@ ) ;; definition for function dist-info-init -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun dist-info-init ((arg0 collide-los-dist-info)) (set! (-> arg0 min-par) 1.0) (set! (-> arg0 max-par) 0.0) @@ -1448,7 +1448,7 @@ ) ;; definition for function dist-info-append -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun dist-info-append ((arg0 collide-los-dist-info) (arg1 vector)) (cond ((dist-info-valid? arg0) @@ -1875,7 +1875,7 @@ ;; definition for function cam-los-collide ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs symbol. +;; WARN: Return type mismatch int vs symbol. ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f2, f5] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f3, f6] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f2, f4, f7] @@ -2375,7 +2375,7 @@ ;; definition for function cam-string-joystick ;; INFO: Used lq/sq ;; ERROR: failed type prop at 785: Could not figure out load: (set! v1 (l.wu (+ v1 124))) -;; INFO: Return type mismatch symbol vs vector. +;; WARN: Return type mismatch symbol vs vector. ;; ERROR: Unsupported inline assembly instruction kind - [sllv a0, v1, r0] ;; ERROR: Unsupported inline assembly instruction kind - [sllv a0, v1, r0] (defbehavior cam-string-joystick camera-slave () @@ -4232,11 +4232,11 @@ ;; definition for function cam-string-find-hidden ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. -;; ERROR: Function may read a register that is not set: t0 -;; ERROR: Function may read a register that is not set: t1 -;; ERROR: Function may read a register that is not set: t2 -;; ERROR: Function may read a register that is not set: t3 +;; WARN: Return type mismatch int vs none. +;; WARN: Function may read a register that is not set: t0 +;; WARN: Function may read a register that is not set: t1 +;; WARN: Function may read a register that is not set: t2 +;; WARN: Function may read a register that is not set: t3 (defbehavior cam-string-find-hidden camera-slave () (local-vars (t0-0 none) (t1-0 none) (t2-0 none) (t3-0 none)) (let* ((s5-0 (new 'stack-no-clear 'collide-query)) @@ -4294,11 +4294,11 @@ ;; definition for function cam-string-move ;; INFO: Used lq/sq -;; ERROR: Function may read a register that is not set: a3 -;; ERROR: Function may read a register that is not set: t0 -;; ERROR: Function may read a register that is not set: t1 -;; ERROR: Function may read a register that is not set: t2 -;; ERROR: Function may read a register that is not set: t3 +;; WARN: Function may read a register that is not set: a3 +;; WARN: Function may read a register that is not set: t0 +;; WARN: Function may read a register that is not set: t1 +;; WARN: Function may read a register that is not set: t2 +;; WARN: Function may read a register that is not set: t3 (defbehavior cam-string-move camera-slave () (local-vars (a3-0 object) (t0-0 object) (t1-0 float) (t2-0 none) (t3-0 none)) (rlet ((acc :class vf) @@ -4530,7 +4530,7 @@ ;; definition for function cam-string-code ;; INFO: Used lq/sq ;; ERROR: failed type prop at 11: Called a function, but we do not know its type -;; INFO: Return type mismatch none vs vector. +;; WARN: Return type mismatch none vs vector. (defbehavior cam-string-code camera-slave () (local-vars (v0-0 none) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-update_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-update_REF.gc index b52c598030..9d7a7803f2 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-update_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-update_REF.gc @@ -96,7 +96,7 @@ ;; definition for function update-visible ;; INFO: Used lq/sq ;; ERROR: failed type prop at 93: Could not figure out load: (set! a1 (l.hu (+ a1 124))) -;; INFO: Return type mismatch none vs symbol. +;; WARN: Return type mismatch none vs symbol. (defun update-visible ((a0-0 math-camera)) (local-vars (v0-0 none) @@ -1007,7 +1007,7 @@ ;; definition for function external-cam-reset! ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun external-cam-reset! () (when (not (movie?)) (vector-reset! (-> *math-camera* trans)) diff --git a/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc index df48bbd12f..3918475167 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc @@ -183,7 +183,7 @@ ) ;; definition for method 9 of type cam-float-seeker -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod init cam-float-seeker ((obj cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (set! (-> obj target) arg0) (set! (-> obj value) arg0) @@ -196,7 +196,7 @@ ) ;; definition for method 10 of type cam-float-seeker -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod copy-to cam-float-seeker ((obj cam-float-seeker) (arg0 cam-float-seeker)) (set! (-> obj target) (-> arg0 target)) (set! (-> obj value) (-> arg0 value)) @@ -209,7 +209,7 @@ ) ;; definition for method 11 of type cam-float-seeker -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod update! cam-float-seeker ((obj cam-float-seeker) (arg0 float)) (with-pp 0.0 @@ -280,7 +280,7 @@ ;; definition for method 9 of type cam-vector-seeker ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod init cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 @@ -301,7 +301,7 @@ ) ;; definition for method 10 of type cam-vector-seeker -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod update! cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vector))) diff --git a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc index b287c4ac39..68594b567f 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc @@ -50,7 +50,7 @@ ) ;; definition for function cam-slave-get-flags -;; INFO: Return type mismatch uint128 vs uint. +;; WARN: Return type mismatch uint128 vs uint. (defun cam-slave-get-flags ((arg0 entity) (arg1 symbol)) (let ((s5-0 (res-lump-value arg0 arg1 uint128 :time -1000000000.0)) (s3-0 (method-of-type res-lump get-property-value)) @@ -474,7 +474,7 @@ ;; definition for method 10 of type tracking-spline ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod tracking-spline-method-10 tracking-spline ((obj tracking-spline) (arg0 vector)) (set! (-> obj point 0 position quad) (-> arg0 quad)) (set! (-> obj point 0 next) -134250495) @@ -500,7 +500,7 @@ ) ;; definition for method 13 of type tracking-spline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod tracking-spline-method-13 tracking-spline ((obj tracking-spline) (arg0 int)) (let ((v1-3 (-> obj point arg0 next))) (cond @@ -535,7 +535,7 @@ ) ;; definition for method 14 of type tracking-spline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod tracking-spline-method-14 tracking-spline ((obj tracking-spline) (arg0 tracking-spline-sampler)) (let ((v1-0 (-> obj used-point))) (set! (-> obj partial-point) (-> arg0 partial-pt)) @@ -574,7 +574,7 @@ ) ;; definition for method 15 of type tracking-spline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod tracking-spline-method-15 tracking-spline ((obj tracking-spline)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) @@ -622,7 +622,7 @@ ) ;; definition for method 16 of type tracking-spline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod tracking-spline-method-16 tracking-spline ((obj tracking-spline) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) @@ -757,7 +757,7 @@ ) ;; definition for method 20 of type tracking-spline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod tracking-spline-method-20 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-! @@ -892,7 +892,7 @@ ) ;; definition for method 22 of type tracking-spline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod tracking-spline-method-22 tracking-spline ((obj tracking-spline) (arg0 float)) (when (< arg0 (-> obj summed-len)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) @@ -909,7 +909,7 @@ ) ;; definition for method 9 of type tracking-spline -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod tracking-spline-method-9 tracking-spline ((obj tracking-spline)) (let ((v1-0 (-> obj used-point)) (s4-0 0) @@ -1032,7 +1032,7 @@ ) ;; definition for function cam-slave-go -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior cam-slave-go camera-slave ((arg0 (state camera-slave))) (cam-slave-init-vars) (go arg0) @@ -1041,7 +1041,7 @@ ) ;; definition for function cam-slave-init -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior cam-slave-init camera-slave ((arg0 (state camera-slave)) (arg1 entity)) (stack-size-set! (-> self main-thread) 512) (if (and (nonzero? camera-slave-debug) *debug-segment*) @@ -1163,7 +1163,7 @@ ) ;; definition for function cam-curve-setup -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior cam-curve-setup camera-slave ((arg0 vector)) (when (get-curve-data! (-> self cam-entity) (-> self spline-curve) 'campath 'campath-k -1000000000.0) (curve-get-pos! (-> self spline-offset) 0.0 (-> self spline-curve)) @@ -1609,7 +1609,7 @@ ;; definition for function slave-set-rotation! ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc index d5332a246a..56765c0e47 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc @@ -56,7 +56,7 @@ ) ;; definition for method 10 of type collide-rider-pool -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod prepare collide-rider-pool ((obj collide-rider-pool)) "Gets this pool ready to be used to allow allocations. This should be called once at the start of every frame." (set! (-> obj alloc-count) 0) @@ -182,7 +182,7 @@ (deftype collide-prim-core (structure) ((world-sphere vector :inline :offset-assert 0) (collide-as collide-spec :offset-assert 16) - (collide-with uint32 :offset-assert 20) + (collide-with collide-spec :offset-assert 20) (action collide-action :offset-assert 24) (prim-type prim-type :offset-assert 28) (unused1 uint8 3 :offset-assert 29) @@ -348,85 +348,85 @@ (format #t ")~%") (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> obj prim-core collide-with)) (let ((s5-1 (-> obj prim-core collide-with))) - (if (= (logand #x800000 s5-1) #x800000) + (if (= (logand (collide-spec special-obstacle) s5-1) (collide-spec special-obstacle)) (format #t "special-obstacle ") ) - (if (= (logand #x200000 s5-1) #x200000) + (if (= (logand (collide-spec bot-targetable) s5-1) (collide-spec bot-targetable)) (format #t "bot-targetable ") ) - (if (= (logand (the-as int s5-1) 4096) 4096) + (if (= (logand s5-1 (collide-spec collectable)) (collide-spec collectable)) (format #t "collectable ") ) - (if (= (logand (the-as int s5-1) #x4000) #x4000) + (if (= (logand s5-1 (collide-spec projectile)) (collide-spec projectile)) (format #t "projectile ") ) - (if (= (logand #x1000000 s5-1) #x1000000) + (if (= (logand (collide-spec mech-punch) s5-1) (collide-spec mech-punch)) (format #t "mech-punch ") ) - (if (= (logand #x4000000 s5-1) #x4000000) + (if (= (logand (collide-spec vehicle-mesh-probeable) s5-1) (collide-spec vehicle-mesh-probeable)) (format #t "vehicle-mesh-probeable ") ) - (if (= (logand #x2000000 s5-1) #x2000000) + (if (= (logand (collide-spec obstacle-for-jak) s5-1) (collide-spec obstacle-for-jak)) (format #t "obstacle-for-jak ") ) - (if (= (logand (the-as int s5-1) 4) 4) + (if (= (logand s5-1 (collide-spec bot)) (collide-spec bot)) (format #t "bot ") ) - (if (= (logand (the-as int s5-1) 8192) 8192) + (if (= (logand s5-1 (collide-spec blocking-plane)) (collide-spec blocking-plane)) (format #t "blocking-plane ") ) - (if (= (logand (the-as int s5-1) 32) 32) + (if (= (logand s5-1 (collide-spec enemy)) (collide-spec enemy)) (format #t "enemy ") ) - (if (= (logand (the-as int s5-1) 256) 256) + (if (= (logand s5-1 (collide-spec hit-by-player-list)) (collide-spec hit-by-player-list)) (format #t "hit-by-player-list ") ) - (if (= (logand (the-as int s5-1) 64) 64) + (if (= (logand s5-1 (collide-spec obstacle)) (collide-spec obstacle)) (format #t "obstacle ") ) - (if (= (logand #x400000 s5-1) #x400000) + (if (= (logand (collide-spec jak-vehicle) s5-1) (collide-spec jak-vehicle)) (format #t "jak-vehicle ") ) - (if (= (logand #x100000 s5-1) #x100000) + (if (= (logand (collide-spec vehicle-mesh) s5-1) (collide-spec vehicle-mesh)) (format #t "vehicle-mesh ") ) - (if (= (logand (the-as int s5-1) 2048) 2048) + (if (= (logand s5-1 (collide-spec water)) (collide-spec water)) (format #t "water ") ) - (if (= (logand #x20000 s5-1) #x20000) + (if (= (logand (collide-spec notice-blue-eco-powerup) s5-1) (collide-spec notice-blue-eco-powerup)) (format #t "notice-blue-eco-powerup ") ) - (if (= (logand (the-as int s5-1) 16) 16) + (if (= (logand s5-1 (collide-spec civilian)) (collide-spec civilian)) (format #t "civilian ") ) - (if (= (logand (the-as int s5-1) 1024) 1024) + (if (= (logand s5-1 (collide-spec player-list)) (collide-spec player-list)) (format #t "player-list ") ) - (if (= (logand (the-as int s5-1) 1) 1) + (if (= (logand s5-1 (collide-spec backgnd)) (collide-spec backgnd)) (format #t "backgnd ") ) - (if (= (logand (the-as int s5-1) 2) 2) + (if (= (logand s5-1 (collide-spec jak)) (collide-spec jak)) (format #t "jak ") ) - (if (= (logand #x80000 s5-1) #x80000) + (if (= (logand (collide-spec pusher) s5-1) (collide-spec pusher)) (format #t "pusher ") ) - (if (= (logand (the-as int s5-1) #x8000) #x8000) + (if (= (logand s5-1 (collide-spec jak-vulnerable)) (collide-spec jak-vulnerable)) (format #t "jak-vulnerable ") ) - (if (= (logand #x10000 s5-1) #x10000) + (if (= (logand (collide-spec camera-blocker) s5-1) (collide-spec camera-blocker)) (format #t "camera-blocker ") ) - (if (= (logand (the-as int s5-1) 512) 512) + (if (= (logand s5-1 (collide-spec hit-by-others-list)) (collide-spec hit-by-others-list)) (format #t "hit-by-others-list ") ) - (if (= (logand (the-as int s5-1) 8) 8) + (if (= (logand s5-1 (collide-spec crate)) (collide-spec crate)) (format #t "crate ") ) - (if (= (logand #x40000 s5-1) #x40000) + (if (= (logand (collide-spec tobot) s5-1) (collide-spec tobot)) (format #t "tobot ") ) - (if (= (logand (the-as int s5-1) 128) 128) + (if (= (logand s5-1 (collide-spec vehicle-sphere)) (collide-spec vehicle-sphere)) (format #t "vehicle-sphere ") ) ) @@ -607,85 +607,85 @@ (format #t ")~%") (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> obj prim-core collide-with)) (let ((s5-1 (-> obj prim-core collide-with))) - (if (= (logand #x800000 s5-1) #x800000) + (if (= (logand (collide-spec special-obstacle) s5-1) (collide-spec special-obstacle)) (format #t "special-obstacle ") ) - (if (= (logand #x200000 s5-1) #x200000) + (if (= (logand (collide-spec bot-targetable) s5-1) (collide-spec bot-targetable)) (format #t "bot-targetable ") ) - (if (= (logand (the-as int s5-1) 4096) 4096) + (if (= (logand s5-1 (collide-spec collectable)) (collide-spec collectable)) (format #t "collectable ") ) - (if (= (logand (the-as int s5-1) #x4000) #x4000) + (if (= (logand s5-1 (collide-spec projectile)) (collide-spec projectile)) (format #t "projectile ") ) - (if (= (logand #x1000000 s5-1) #x1000000) + (if (= (logand (collide-spec mech-punch) s5-1) (collide-spec mech-punch)) (format #t "mech-punch ") ) - (if (= (logand #x4000000 s5-1) #x4000000) + (if (= (logand (collide-spec vehicle-mesh-probeable) s5-1) (collide-spec vehicle-mesh-probeable)) (format #t "vehicle-mesh-probeable ") ) - (if (= (logand #x2000000 s5-1) #x2000000) + (if (= (logand (collide-spec obstacle-for-jak) s5-1) (collide-spec obstacle-for-jak)) (format #t "obstacle-for-jak ") ) - (if (= (logand (the-as int s5-1) 4) 4) + (if (= (logand s5-1 (collide-spec bot)) (collide-spec bot)) (format #t "bot ") ) - (if (= (logand (the-as int s5-1) 8192) 8192) + (if (= (logand s5-1 (collide-spec blocking-plane)) (collide-spec blocking-plane)) (format #t "blocking-plane ") ) - (if (= (logand (the-as int s5-1) 32) 32) + (if (= (logand s5-1 (collide-spec enemy)) (collide-spec enemy)) (format #t "enemy ") ) - (if (= (logand (the-as int s5-1) 256) 256) + (if (= (logand s5-1 (collide-spec hit-by-player-list)) (collide-spec hit-by-player-list)) (format #t "hit-by-player-list ") ) - (if (= (logand (the-as int s5-1) 64) 64) + (if (= (logand s5-1 (collide-spec obstacle)) (collide-spec obstacle)) (format #t "obstacle ") ) - (if (= (logand #x400000 s5-1) #x400000) + (if (= (logand (collide-spec jak-vehicle) s5-1) (collide-spec jak-vehicle)) (format #t "jak-vehicle ") ) - (if (= (logand #x100000 s5-1) #x100000) + (if (= (logand (collide-spec vehicle-mesh) s5-1) (collide-spec vehicle-mesh)) (format #t "vehicle-mesh ") ) - (if (= (logand (the-as int s5-1) 2048) 2048) + (if (= (logand s5-1 (collide-spec water)) (collide-spec water)) (format #t "water ") ) - (if (= (logand #x20000 s5-1) #x20000) + (if (= (logand (collide-spec notice-blue-eco-powerup) s5-1) (collide-spec notice-blue-eco-powerup)) (format #t "notice-blue-eco-powerup ") ) - (if (= (logand (the-as int s5-1) 16) 16) + (if (= (logand s5-1 (collide-spec civilian)) (collide-spec civilian)) (format #t "civilian ") ) - (if (= (logand (the-as int s5-1) 1024) 1024) + (if (= (logand s5-1 (collide-spec player-list)) (collide-spec player-list)) (format #t "player-list ") ) - (if (= (logand (the-as int s5-1) 1) 1) + (if (= (logand s5-1 (collide-spec backgnd)) (collide-spec backgnd)) (format #t "backgnd ") ) - (if (= (logand (the-as int s5-1) 2) 2) + (if (= (logand s5-1 (collide-spec jak)) (collide-spec jak)) (format #t "jak ") ) - (if (= (logand #x80000 s5-1) #x80000) + (if (= (logand (collide-spec pusher) s5-1) (collide-spec pusher)) (format #t "pusher ") ) - (if (= (logand (the-as int s5-1) #x8000) #x8000) + (if (= (logand s5-1 (collide-spec jak-vulnerable)) (collide-spec jak-vulnerable)) (format #t "jak-vulnerable ") ) - (if (= (logand #x10000 s5-1) #x10000) + (if (= (logand (collide-spec camera-blocker) s5-1) (collide-spec camera-blocker)) (format #t "camera-blocker ") ) - (if (= (logand (the-as int s5-1) 512) 512) + (if (= (logand s5-1 (collide-spec hit-by-others-list)) (collide-spec hit-by-others-list)) (format #t "hit-by-others-list ") ) - (if (= (logand (the-as int s5-1) 8) 8) + (if (= (logand s5-1 (collide-spec crate)) (collide-spec crate)) (format #t "crate ") ) - (if (= (logand #x40000 s5-1) #x40000) + (if (= (logand (collide-spec tobot) s5-1) (collide-spec tobot)) (format #t "tobot ") ) - (if (= (logand (the-as int s5-1) 128) 128) + (if (= (logand s5-1 (collide-spec vehicle-sphere)) (collide-spec vehicle-sphere)) (format #t "vehicle-sphere ") ) ) @@ -870,85 +870,85 @@ (format #t ")~%") (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> obj prim-core collide-with)) (let ((s5-1 (-> obj prim-core collide-with))) - (if (= (logand #x800000 s5-1) #x800000) + (if (= (logand (collide-spec special-obstacle) s5-1) (collide-spec special-obstacle)) (format #t "special-obstacle ") ) - (if (= (logand #x200000 s5-1) #x200000) + (if (= (logand (collide-spec bot-targetable) s5-1) (collide-spec bot-targetable)) (format #t "bot-targetable ") ) - (if (= (logand (the-as int s5-1) 4096) 4096) + (if (= (logand s5-1 (collide-spec collectable)) (collide-spec collectable)) (format #t "collectable ") ) - (if (= (logand (the-as int s5-1) #x4000) #x4000) + (if (= (logand s5-1 (collide-spec projectile)) (collide-spec projectile)) (format #t "projectile ") ) - (if (= (logand #x1000000 s5-1) #x1000000) + (if (= (logand (collide-spec mech-punch) s5-1) (collide-spec mech-punch)) (format #t "mech-punch ") ) - (if (= (logand #x4000000 s5-1) #x4000000) + (if (= (logand (collide-spec vehicle-mesh-probeable) s5-1) (collide-spec vehicle-mesh-probeable)) (format #t "vehicle-mesh-probeable ") ) - (if (= (logand #x2000000 s5-1) #x2000000) + (if (= (logand (collide-spec obstacle-for-jak) s5-1) (collide-spec obstacle-for-jak)) (format #t "obstacle-for-jak ") ) - (if (= (logand (the-as int s5-1) 4) 4) + (if (= (logand s5-1 (collide-spec bot)) (collide-spec bot)) (format #t "bot ") ) - (if (= (logand (the-as int s5-1) 8192) 8192) + (if (= (logand s5-1 (collide-spec blocking-plane)) (collide-spec blocking-plane)) (format #t "blocking-plane ") ) - (if (= (logand (the-as int s5-1) 32) 32) + (if (= (logand s5-1 (collide-spec enemy)) (collide-spec enemy)) (format #t "enemy ") ) - (if (= (logand (the-as int s5-1) 256) 256) + (if (= (logand s5-1 (collide-spec hit-by-player-list)) (collide-spec hit-by-player-list)) (format #t "hit-by-player-list ") ) - (if (= (logand (the-as int s5-1) 64) 64) + (if (= (logand s5-1 (collide-spec obstacle)) (collide-spec obstacle)) (format #t "obstacle ") ) - (if (= (logand #x400000 s5-1) #x400000) + (if (= (logand (collide-spec jak-vehicle) s5-1) (collide-spec jak-vehicle)) (format #t "jak-vehicle ") ) - (if (= (logand #x100000 s5-1) #x100000) + (if (= (logand (collide-spec vehicle-mesh) s5-1) (collide-spec vehicle-mesh)) (format #t "vehicle-mesh ") ) - (if (= (logand (the-as int s5-1) 2048) 2048) + (if (= (logand s5-1 (collide-spec water)) (collide-spec water)) (format #t "water ") ) - (if (= (logand #x20000 s5-1) #x20000) + (if (= (logand (collide-spec notice-blue-eco-powerup) s5-1) (collide-spec notice-blue-eco-powerup)) (format #t "notice-blue-eco-powerup ") ) - (if (= (logand (the-as int s5-1) 16) 16) + (if (= (logand s5-1 (collide-spec civilian)) (collide-spec civilian)) (format #t "civilian ") ) - (if (= (logand (the-as int s5-1) 1024) 1024) + (if (= (logand s5-1 (collide-spec player-list)) (collide-spec player-list)) (format #t "player-list ") ) - (if (= (logand (the-as int s5-1) 1) 1) + (if (= (logand s5-1 (collide-spec backgnd)) (collide-spec backgnd)) (format #t "backgnd ") ) - (if (= (logand (the-as int s5-1) 2) 2) + (if (= (logand s5-1 (collide-spec jak)) (collide-spec jak)) (format #t "jak ") ) - (if (= (logand #x80000 s5-1) #x80000) + (if (= (logand (collide-spec pusher) s5-1) (collide-spec pusher)) (format #t "pusher ") ) - (if (= (logand (the-as int s5-1) #x8000) #x8000) + (if (= (logand s5-1 (collide-spec jak-vulnerable)) (collide-spec jak-vulnerable)) (format #t "jak-vulnerable ") ) - (if (= (logand #x10000 s5-1) #x10000) + (if (= (logand (collide-spec camera-blocker) s5-1) (collide-spec camera-blocker)) (format #t "camera-blocker ") ) - (if (= (logand (the-as int s5-1) 512) 512) + (if (= (logand s5-1 (collide-spec hit-by-others-list)) (collide-spec hit-by-others-list)) (format #t "hit-by-others-list ") ) - (if (= (logand (the-as int s5-1) 8) 8) + (if (= (logand s5-1 (collide-spec crate)) (collide-spec crate)) (format #t "crate ") ) - (if (= (logand #x40000 s5-1) #x40000) + (if (= (logand (collide-spec tobot) s5-1) (collide-spec tobot)) (format #t "tobot ") ) - (if (= (logand (the-as int s5-1) 128) 128) + (if (= (logand s5-1 (collide-spec vehicle-sphere)) (collide-spec vehicle-sphere)) (format #t "vehicle-sphere ") ) ) @@ -1134,85 +1134,85 @@ (format #t ")~%") (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> obj prim-core collide-with)) (let ((s5-1 (-> obj prim-core collide-with))) - (if (= (logand #x800000 s5-1) #x800000) + (if (= (logand (collide-spec special-obstacle) s5-1) (collide-spec special-obstacle)) (format #t "special-obstacle ") ) - (if (= (logand #x200000 s5-1) #x200000) + (if (= (logand (collide-spec bot-targetable) s5-1) (collide-spec bot-targetable)) (format #t "bot-targetable ") ) - (if (= (logand (the-as int s5-1) 4096) 4096) + (if (= (logand s5-1 (collide-spec collectable)) (collide-spec collectable)) (format #t "collectable ") ) - (if (= (logand (the-as int s5-1) #x4000) #x4000) + (if (= (logand s5-1 (collide-spec projectile)) (collide-spec projectile)) (format #t "projectile ") ) - (if (= (logand #x1000000 s5-1) #x1000000) + (if (= (logand (collide-spec mech-punch) s5-1) (collide-spec mech-punch)) (format #t "mech-punch ") ) - (if (= (logand #x4000000 s5-1) #x4000000) + (if (= (logand (collide-spec vehicle-mesh-probeable) s5-1) (collide-spec vehicle-mesh-probeable)) (format #t "vehicle-mesh-probeable ") ) - (if (= (logand #x2000000 s5-1) #x2000000) + (if (= (logand (collide-spec obstacle-for-jak) s5-1) (collide-spec obstacle-for-jak)) (format #t "obstacle-for-jak ") ) - (if (= (logand (the-as int s5-1) 4) 4) + (if (= (logand s5-1 (collide-spec bot)) (collide-spec bot)) (format #t "bot ") ) - (if (= (logand (the-as int s5-1) 8192) 8192) + (if (= (logand s5-1 (collide-spec blocking-plane)) (collide-spec blocking-plane)) (format #t "blocking-plane ") ) - (if (= (logand (the-as int s5-1) 32) 32) + (if (= (logand s5-1 (collide-spec enemy)) (collide-spec enemy)) (format #t "enemy ") ) - (if (= (logand (the-as int s5-1) 256) 256) + (if (= (logand s5-1 (collide-spec hit-by-player-list)) (collide-spec hit-by-player-list)) (format #t "hit-by-player-list ") ) - (if (= (logand (the-as int s5-1) 64) 64) + (if (= (logand s5-1 (collide-spec obstacle)) (collide-spec obstacle)) (format #t "obstacle ") ) - (if (= (logand #x400000 s5-1) #x400000) + (if (= (logand (collide-spec jak-vehicle) s5-1) (collide-spec jak-vehicle)) (format #t "jak-vehicle ") ) - (if (= (logand #x100000 s5-1) #x100000) + (if (= (logand (collide-spec vehicle-mesh) s5-1) (collide-spec vehicle-mesh)) (format #t "vehicle-mesh ") ) - (if (= (logand (the-as int s5-1) 2048) 2048) + (if (= (logand s5-1 (collide-spec water)) (collide-spec water)) (format #t "water ") ) - (if (= (logand #x20000 s5-1) #x20000) + (if (= (logand (collide-spec notice-blue-eco-powerup) s5-1) (collide-spec notice-blue-eco-powerup)) (format #t "notice-blue-eco-powerup ") ) - (if (= (logand (the-as int s5-1) 16) 16) + (if (= (logand s5-1 (collide-spec civilian)) (collide-spec civilian)) (format #t "civilian ") ) - (if (= (logand (the-as int s5-1) 1024) 1024) + (if (= (logand s5-1 (collide-spec player-list)) (collide-spec player-list)) (format #t "player-list ") ) - (if (= (logand (the-as int s5-1) 1) 1) + (if (= (logand s5-1 (collide-spec backgnd)) (collide-spec backgnd)) (format #t "backgnd ") ) - (if (= (logand (the-as int s5-1) 2) 2) + (if (= (logand s5-1 (collide-spec jak)) (collide-spec jak)) (format #t "jak ") ) - (if (= (logand #x80000 s5-1) #x80000) + (if (= (logand (collide-spec pusher) s5-1) (collide-spec pusher)) (format #t "pusher ") ) - (if (= (logand (the-as int s5-1) #x8000) #x8000) + (if (= (logand s5-1 (collide-spec jak-vulnerable)) (collide-spec jak-vulnerable)) (format #t "jak-vulnerable ") ) - (if (= (logand #x10000 s5-1) #x10000) + (if (= (logand (collide-spec camera-blocker) s5-1) (collide-spec camera-blocker)) (format #t "camera-blocker ") ) - (if (= (logand (the-as int s5-1) 512) 512) + (if (= (logand s5-1 (collide-spec hit-by-others-list)) (collide-spec hit-by-others-list)) (format #t "hit-by-others-list ") ) - (if (= (logand (the-as int s5-1) 8) 8) + (if (= (logand s5-1 (collide-spec crate)) (collide-spec crate)) (format #t "crate ") ) - (if (= (logand #x40000 s5-1) #x40000) + (if (= (logand (collide-spec tobot) s5-1) (collide-spec tobot)) (format #t "tobot ") ) - (if (= (logand (the-as int s5-1) 128) 128) + (if (= (logand s5-1 (collide-spec vehicle-sphere)) (collide-spec vehicle-sphere)) (format #t "vehicle-sphere ") ) ) @@ -1907,7 +1907,7 @@ (set! (-> v0-0 prim-id) arg1) (set! (-> v0-0 prim-core action) (collide-action)) (set! (-> v0-0 prim-core collide-as) (collide-spec)) - (set! (-> v0-0 prim-core collide-with) (the-as uint 0)) + (set! (-> v0-0 prim-core collide-with) (collide-spec)) (set! (-> v0-0 transform-index) -2) (set! (-> v0-0 prim-core prim-type) (prim-type prim)) v0-0 @@ -1915,7 +1915,7 @@ ) ;; definition for method 0 of type collide-shape-prim-sphere -;; INFO: Return type mismatch collide-shape-prim vs collide-shape-prim-sphere. +;; WARN: Return type mismatch collide-shape-prim vs collide-shape-prim-sphere. (defmethod new collide-shape-prim-sphere ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint)) (let ((v0-0 ((method-of-type collide-shape-prim new) allocation type-to-make arg0 arg1 80))) (set! (-> (the-as collide-shape-prim-sphere v0-0) pat) @@ -1927,7 +1927,7 @@ ) ;; definition for method 0 of type collide-shape-prim-mesh -;; INFO: Return type mismatch collide-shape-prim vs collide-shape-prim-mesh. +;; WARN: Return type mismatch collide-shape-prim vs collide-shape-prim-mesh. (defmethod new collide-shape-prim-mesh ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint) (arg2 uint)) (let ((v0-0 ((method-of-type collide-shape-prim new) allocation type-to-make arg0 arg2 80))) (set! (-> (the-as collide-shape-prim-mesh v0-0) mesh) #f) @@ -1939,7 +1939,7 @@ ) ;; definition for method 0 of type collide-shape-prim-group -;; INFO: Return type mismatch collide-shape-prim vs collide-shape-prim-group. +;; WARN: Return type mismatch collide-shape-prim vs collide-shape-prim-group. (defmethod new collide-shape-prim-group ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint) (arg2 int)) (let ((v0-0 ((method-of-type collide-shape-prim new) allocation type-to-make arg0 (the-as uint arg2) 80))) (set! (-> (the-as collide-shape-prim-group v0-0) num-children) arg1) @@ -1953,7 +1953,7 @@ ) ;; definition for method 4 of type collide-shape-prim-group -;; INFO: Return type mismatch uint8 vs int. +;; WARN: Return type mismatch uint8 vs int. (defmethod length collide-shape-prim-group ((obj collide-shape-prim-group)) (the-as int (-> obj num-children)) ) @@ -2009,7 +2009,7 @@ ;; definition for method 0 of type collide-shape-moving ;; INFO: Used lq/sq -;; INFO: Return type mismatch collide-shape vs collide-shape-moving. +;; WARN: Return type mismatch collide-shape vs collide-shape-moving. (defmethod new collide-shape-moving ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 collide-list-enum)) (let ((v0-0 ((method-of-type collide-shape new) allocation type-to-make arg0 arg1))) (set! (-> (the-as collide-shape-moving v0-0) gspot-pos y) -40959590.0) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc index 3b7d817510..3dfb25e4ed 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc @@ -93,7 +93,7 @@ ) ;; definition for method 11 of type touching-prims-entry-pool -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod init-list! touching-prims-entry-pool ((obj touching-prims-entry-pool)) (let ((v1-0 (the-as touching-prims-entry #f))) (let ((a1-0 (the-as touching-prims-entry (-> obj nodes)))) @@ -115,7 +115,7 @@ ) ;; definition for method 0 of type touching-prims-entry-pool -;; INFO: Return type mismatch structure vs touching-prims-entry-pool. +;; WARN: Return type mismatch structure vs touching-prims-entry-pool. (defmethod new touching-prims-entry-pool ((allocation symbol) (type-to-make type)) (let ((t9-0 (method-of-type structure new)) (v1-1 type-to-make) @@ -202,7 +202,7 @@ ) ;; definition for method 0 of type touching-list -;; INFO: Return type mismatch structure vs touching-list. +;; WARN: Return type mismatch structure vs touching-list. (defmethod new touching-list ((allocation symbol) (type-to-make type)) (let ((t9-0 (method-of-type structure new)) (v1-1 type-to-make) @@ -222,7 +222,7 @@ ) ;; definition for method 10 of type touching-shapes-entry -;; INFO: Return type mismatch collide-shape vs touching-prims-entry. +;; WARN: Return type mismatch collide-shape vs touching-prims-entry. (defmethod get-next touching-shapes-entry ((obj touching-shapes-entry) (arg0 touching-shapes-entry)) (the-as touching-prims-entry (-> arg0 cshape1)) ) diff --git a/test/decompiler/reference/jak2/engine/data/art-h_REF.gc b/test/decompiler/reference/jak2/engine/data/art-h_REF.gc index fd1181f064..6ac0fa0c0a 100644 --- a/test/decompiler/reference/jak2/engine/data/art-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/data/art-h_REF.gc @@ -113,7 +113,7 @@ ) ;; definition for method 0 of type joint-anim-frame -;; INFO: Return type mismatch structure vs joint-anim-frame. +;; WARN: Return type mismatch structure vs joint-anim-frame. (defmethod new joint-anim-frame ((allocation symbol) (type-to-make type) (arg0 int)) (let ((v1-1 (max 0 (+ arg0 -2)))) (the-as diff --git a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc index de8bd02eca..a81d68d0e8 100644 --- a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc @@ -883,7 +883,7 @@ ) ;; definition for function all-texture-tweak-adjust -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun all-texture-tweak-adjust ((arg0 texture-page-dir) (arg1 float)) (dotimes (s4-0 (-> arg0 length)) (let ((s3-0 (-> arg0 entries s4-0 page))) @@ -995,7 +995,7 @@ ) ;; definition for function dm-bug-report-report-pick-func -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun dm-bug-report-report-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) (if (= arg1 (debug-menu-msg press)) (bug-report-display) @@ -1026,7 +1026,7 @@ (define *shader-pick-menu* (the-as debug-menu #f)) ;; definition for function build-shader-list -;; INFO: Return type mismatch pair vs none. +;; WARN: Return type mismatch pair vs none. (defun build-shader-list () (debug-menu-remove-all-items *shader-pick-menu*) (when *texture-page-dir* @@ -1059,7 +1059,7 @@ ) ;; definition for function dm-instance-pick-func -;; INFO: Return type mismatch object vs basic. +;; WARN: Return type mismatch object vs basic. (defun dm-instance-pick-func ((arg0 string) (arg1 debug-menu-msg)) (when (= arg1 (debug-menu-msg press)) (if (find-instance-by-name arg0) @@ -1100,7 +1100,7 @@ (define *enable-instance-tie-menu* (the-as debug-menu #f)) ;; definition for function build-instance-list -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun build-instance-list ((arg0 object)) (debug-menu-remove-all-items *instance-shrub-menu*) (debug-menu-remove-all-items *instance-tie-menu*) @@ -1233,7 +1233,7 @@ ) ;; definition for function debug-create-cam-restore -;; INFO: Return type mismatch object vs none. +;; WARN: Return type mismatch object vs none. (defun debug-create-cam-restore () (cond (*math-camera* @@ -3384,10 +3384,10 @@ (task-node-close! (the-as game-task gp-0)) ) ) - (if (and (not (task-node-closed? (the-as game-task gp-0))) (not (task-node-open? (the-as game-task gp-0)))) + (if (and (not (task-node-closed? (the-as game-task-node gp-0))) (not (task-node-open? (the-as game-task gp-0)))) (return 'invalid) ) - (task-node-closed? (the-as game-task gp-0)) + (task-node-closed? (the-as game-task-node gp-0)) ) ) @@ -3471,7 +3471,7 @@ ;; definition for function debug-menu-make-task-sub-menu ;; INFO: Used lq/sq ;; ERROR: failed type prop at 11: Could not figure out load: (set! a0 (l.wu v1)) -;; INFO: Return type mismatch pair vs debug-menu-node. +;; WARN: Return type mismatch pair vs debug-menu-node. (defun debug-menu-make-task-sub-menu ((a0-0 debug-menu-context)) (local-vars (v0-0 none) @@ -3723,7 +3723,7 @@ ) ;; definition for function dm-play-task-with-continue -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun dm-play-task-with-continue ((arg0 game-task) (arg1 string)) (let* ((t9-0 play-task) (a1-1 'debug) @@ -3823,7 +3823,7 @@ ;; definition for function debug-menu-make-play-menu ;; INFO: Used lq/sq ;; ERROR: failed type prop at 12: Could not figure out load: (set! a0 (l.wu (+ v1 20))) -;; INFO: Return type mismatch debug-menu-node vs none. +;; WARN: Return type mismatch debug-menu-node vs none. (defun debug-menu-make-play-menu ((a0-0 symbol)) (local-vars (v0-0 none) @@ -4066,7 +4066,7 @@ ) ;; definition for function dm-pilot-mode -;; INFO: Return type mismatch object vs none. +;; WARN: Return type mismatch object vs none. (defun dm-pilot-mode ((arg0 object)) "TODO - what is the third arg to target's change-mode?" (if (not *target*) @@ -4077,7 +4077,7 @@ ) ;; definition for function dm-pilot-race-mode -;; INFO: Return type mismatch object vs none. +;; WARN: Return type mismatch object vs none. (defun dm-pilot-race-mode ((arg0 object)) "TODO - what is the third arg to target's change-mode?" (if (not *target*) diff --git a/test/decompiler/reference/jak2/engine/debug/history_REF.gc b/test/decompiler/reference/jak2/engine/debug/history_REF.gc index 3914a5d448..2cbd3266ad 100644 --- a/test/decompiler/reference/jak2/engine/debug/history_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/history_REF.gc @@ -166,7 +166,7 @@ ) ;; definition for method 5 of type history -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of history ((obj history)) (the-as int (+ (-> obj type size) (* 48 (-> obj allocated-length)))) ) @@ -180,7 +180,7 @@ ) ;; definition for method 10 of type history -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod clear-history-entries! history ((obj history)) "Iterates through each [[history-elt]] in the `elt` dynamic array For each entry: @@ -469,7 +469,7 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; WARN: new jak 2 until loop case, check carefully (defun history-print ((arg0 history-iterator)) (local-vars @@ -627,7 +627,7 @@ ) ;; definition for function history-draw -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Expression building failed: In history-draw: Unmatched field: start bit 24, size 40, signed? true, type rgba (defun history-draw ((arg0 history-iterator)) (local-vars diff --git a/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc b/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc index 8b2efab522..b7ba66a1d1 100644 --- a/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc @@ -298,7 +298,7 @@ (set! (-> perf-stat-array heap-base) (the-as uint 52)) ;; definition for method 11 of type perf-stat -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Perf, r0] ;; ERROR: Unsupported inline assembly instruction kind - [sync.l] ;; ERROR: Unsupported inline assembly instruction kind - [sync.p] @@ -330,7 +330,7 @@ ) ;; definition for method 12 of type perf-stat -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Perf, r0] ;; ERROR: Unsupported inline assembly instruction kind - [sync.l] ;; ERROR: Unsupported inline assembly instruction kind - [sync.p] @@ -352,7 +352,7 @@ ) ;; definition for method 13 of type perf-stat -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod update-wait-stats perf-stat ((obj perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) (when (nonzero? (-> obj ctrl)) (+! (-> obj to-vu0-waits) arg0) @@ -369,7 +369,3 @@ (set! (-> perf-stat method-table 12) nothing) (set! (-> perf-stat method-table 13) nothing) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/dma/dma-bucket_REF.gc b/test/decompiler/reference/jak2/engine/dma/dma-bucket_REF.gc index 86fc1bb6dd..7828f146d3 100644 --- a/test/decompiler/reference/jak2/engine/dma/dma-bucket_REF.gc +++ b/test/decompiler/reference/jak2/engine/dma/dma-bucket_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for function dma-buffer-add-buckets -;; INFO: Return type mismatch pointer vs (inline-array dma-bucket). +;; WARN: Return type mismatch pointer vs (inline-array dma-bucket). (defun dma-buffer-add-buckets ((arg0 dma-buffer) (arg1 int)) (let ((v0-0 (-> arg0 base))) (let ((v1-0 (the-as object v0-0))) @@ -20,7 +20,7 @@ ) ;; definition for function dma-buffer-patch-buckets -;; INFO: Return type mismatch object vs (inline-array dma-bucket). +;; WARN: Return type mismatch object vs (inline-array dma-bucket). (defun dma-buffer-patch-buckets ((arg0 (inline-array dma-bucket)) (arg1 int)) (when (nonzero? arg0) (dotimes (v1-1 arg1) @@ -61,7 +61,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc b/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc index e37a47efd9..3ebf1697c0 100644 --- a/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc +++ b/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc @@ -449,7 +449,7 @@ ) ;; definition for function disasm-dma-tag -;; INFO: Return type mismatch object vs none. +;; WARN: Return type mismatch object vs none. (defun disasm-dma-tag ((arg0 dma-tag) (arg1 symbol)) (format arg1 "(dma-tag ") (let ((t9-1 format) @@ -728,6 +728,3 @@ ) ) - - - diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc index 772cc03e37..60ebab34b0 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc @@ -43,7 +43,7 @@ ) ;; definition for method 10 of type drawable-tree-actor -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod draw drawable-tree-actor ((obj drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc b/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc index 94e2c56160..9d451c1960 100644 --- a/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc @@ -3,7 +3,7 @@ ;; definition for function entity-actor-lookup ;; INFO: Used lq/sq -;; INFO: Return type mismatch entity vs entity-actor. +;; WARN: Return type mismatch entity vs entity-actor. (defun entity-actor-lookup ((arg0 res-lump) (arg1 symbol) (arg2 int)) (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) @@ -116,13 +116,13 @@ ) ;; definition for method 14 of type actor-link-info -;; INFO: Return type mismatch basic vs process. +;; WARN: Return type mismatch basic vs process. (defmethod get-next-process actor-link-info ((obj actor-link-info)) (the-as process (and (-> obj next) (-> obj next extra process))) ) ;; definition for method 15 of type actor-link-info -;; INFO: Return type mismatch basic vs process. +;; WARN: Return type mismatch basic vs process. (defmethod get-prev-process actor-link-info ((obj actor-link-info)) (the-as process (and (-> obj prev) (-> obj prev extra process))) ) @@ -233,7 +233,7 @@ ) ;; definition for method 23 of type actor-link-info -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defmethod send-to-next actor-link-info ((obj actor-link-info) (arg0 symbol)) (let ((a0-1 (-> obj next))) (when a0-1 @@ -248,7 +248,7 @@ ) ;; definition for method 24 of type actor-link-info -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defmethod send-to-prev actor-link-info ((obj actor-link-info) (arg0 symbol)) (let ((a0-1 (-> obj prev))) (when a0-1 @@ -263,7 +263,7 @@ ) ;; definition for method 22 of type actor-link-info -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defmethod send-to-next-and-prev actor-link-info ((obj actor-link-info) (arg0 symbol)) (send-to-next obj arg0) (send-to-prev obj arg0) @@ -271,7 +271,7 @@ ) ;; definition for method 19 of type actor-link-info -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defmethod send-to-all actor-link-info ((obj actor-link-info) (arg0 symbol)) (send-to-all-after obj arg0) (send-to-all-before obj arg0) diff --git a/test/decompiler/reference/jak2/engine/entity/entity-table_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity-table_REF.gc index 8f632fe724..e665f75eb5 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity-table_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity-table_REF.gc @@ -190,7 +190,7 @@ ) ;; definition for function entity-info-lookup -;; INFO: Return type mismatch basic vs entity-info. +;; WARN: Return type mismatch basic vs entity-info. (defun entity-info-lookup ((arg0 type)) "Given a type, return the [[entity-info]] from [[*entity-info*]] whos type matches the `ptype` field. Set's `method 13` on said type that returns the `length` diff --git a/test/decompiler/reference/jak2/engine/entity/relocate_REF.gc b/test/decompiler/reference/jak2/engine/entity/relocate_REF.gc index f4888b39b1..4bfd5f3d6d 100644 --- a/test/decompiler/reference/jak2/engine/entity/relocate_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/relocate_REF.gc @@ -95,7 +95,7 @@ ) ;; definition for method 7 of type process-drawable -;; INFO: Return type mismatch process vs process-drawable. +;; WARN: Return type mismatch process vs process-drawable. (defmethod relocate process-drawable ((obj process-drawable) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) obj) @@ -163,7 +163,7 @@ ) ;; definition for method 7 of type collide-shape-moving -;; INFO: Return type mismatch collide-shape vs collide-shape-moving. +;; WARN: Return type mismatch collide-shape vs collide-shape-moving. (defmethod relocate collide-shape-moving ((obj collide-shape-moving) (arg0 int)) (if (-> obj dynam) (&+! (-> obj dynam) arg0) @@ -340,7 +340,7 @@ ) ;; definition for method 7 of type camera-master -;; INFO: Return type mismatch process vs camera-master. +;; WARN: Return type mismatch process vs camera-master. (defmethod relocate camera-master ((obj camera-master) (arg0 int)) (if (nonzero? (-> obj water-drip)) (&+! (-> obj water-drip) arg0) @@ -349,7 +349,7 @@ ) ;; definition for method 7 of type time-of-day-proc -;; INFO: Return type mismatch process vs time-of-day-proc. +;; WARN: Return type mismatch process vs time-of-day-proc. (defmethod relocate time-of-day-proc ((obj time-of-day-proc) (arg0 int)) (if (nonzero? (-> obj sun)) (&+! (-> obj sun) arg0) @@ -364,7 +364,7 @@ ) ;; definition for method 7 of type part-tracker -;; INFO: Return type mismatch process vs part-tracker. +;; WARN: Return type mismatch process vs part-tracker. (defmethod relocate part-tracker ((obj part-tracker) (arg0 int)) (if (nonzero? (-> obj root)) (&+! (-> obj root) arg0) @@ -376,7 +376,7 @@ ) ;; definition for method 7 of type part-spawner -;; INFO: Return type mismatch process vs part-spawner. +;; WARN: Return type mismatch process vs part-spawner. (defmethod relocate part-spawner ((obj part-spawner) (arg0 int)) (if (nonzero? (-> obj root)) (&+! (-> obj root) arg0) @@ -391,7 +391,7 @@ ) ;; definition for method 7 of type lightning-tracker -;; INFO: Return type mismatch process vs lightning-tracker. +;; WARN: Return type mismatch process vs lightning-tracker. (defmethod relocate lightning-tracker ((obj lightning-tracker) (arg0 int)) (if (nonzero? (-> obj root)) (&+! (-> obj root) arg0) @@ -403,7 +403,7 @@ ) ;; definition for method 7 of type manipy -;; INFO: Return type mismatch process-drawable vs manipy. +;; WARN: Return type mismatch process-drawable vs manipy. (defmethod relocate manipy ((obj manipy) (arg0 int)) (if (nonzero? (-> obj joint 0)) (&+! (-> obj joint 0) arg0) diff --git a/test/decompiler/reference/jak2/engine/entity/res_REF.gc b/test/decompiler/reference/jak2/engine/entity/res_REF.gc index 4712937b14..368d29e715 100644 --- a/test/decompiler/reference/jak2/engine/entity/res_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/res_REF.gc @@ -25,7 +25,7 @@ ) ;; definition for method 4 of type res-tag -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod length res-tag ((obj res-tag)) (the-as int (if (zero? (-> obj inlined?)) (* (-> obj elt-count) 4) @@ -63,7 +63,7 @@ ) ;; definition for method 5 of type res-lump -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of res-lump ((obj res-lump)) (the-as int (+ (-> obj type psize) (* (-> obj allocated-length) 16) (-> obj data-size))) ) @@ -112,7 +112,7 @@ ;; definition for method 19 of type res-lump ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs res-tag-pair. +;; WARN: Return type mismatch int vs res-tag-pair. (defmethod lookup-tag-idx res-lump ((obj res-lump) (arg0 symbol) (arg1 symbol) (arg2 float)) (local-vars (t4-1 int)) (when (or (= arg0 'id) @@ -421,7 +421,7 @@ ;; definition for method 10 of type res-lump ;; INFO: Used lq/sq -;; INFO: Return type mismatch object vs structure. +;; WARN: Return type mismatch object vs structure. (defmethod get-property-struct res-lump ((obj res-lump) (arg0 symbol) (arg1 symbol) @@ -454,7 +454,7 @@ ;; definition for method 11 of type res-lump ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs uint128. +;; WARN: Return type mismatch int vs uint128. (defmethod get-property-value res-lump ((obj res-lump) (arg0 symbol) (arg1 symbol) @@ -770,7 +770,7 @@ ;; definition for method 8 of type res-lump ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs res-lump. +;; WARN: Return type mismatch int vs res-lump. ;; WARN: Using new Jak 2 rtype-of ;; WARN: Using new Jak 2 rtype-of ;; WARN: Using new Jak 2 rtype-of diff --git a/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc b/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc index fd1fc47bc2..402f2a7e3b 100644 --- a/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc @@ -62,7 +62,7 @@ ) ;; definition for method 13 of type effect-control -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod set-channel-offset! effect-control ((obj effect-control) (arg0 int)) (set! (-> obj channel-offset) arg0) 0 @@ -71,7 +71,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc b/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc index 118a0ff72c..e3866cb53d 100644 --- a/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc @@ -1340,7 +1340,7 @@ ;; definition for method 0 of type fact-info ;; INFO: Used lq/sq -;; INFO: Return type mismatch object vs fact-info. +;; WARN: Return type mismatch object vs fact-info. (defmethod new fact-info ((allocation symbol) (type-to-make type) (arg0 process) (arg1 pickup-type) (arg2 float)) (local-vars (sv-16 fact-info) (sv-20 entity) (sv-24 task-mask)) (set! sv-16 (object-new allocation type-to-make (the-as int (-> type-to-make size)))) @@ -1478,7 +1478,7 @@ ) ;; definition for method 12 of type fact-info-enemy -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod clear-mask-bits fact-info-enemy ((obj fact-info-enemy) (arg0 int)) (let ((v1-0 (lognot arg0))) (dotimes (a1-1 (-> obj trig-mask-count)) diff --git a/test/decompiler/reference/jak2/engine/game/penetrate-h_REF.gc b/test/decompiler/reference/jak2/engine/game/penetrate-h_REF.gc index dc2ad46c44..d1e6da1649 100644 --- a/test/decompiler/reference/jak2/engine/game/penetrate-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/penetrate-h_REF.gc @@ -43,7 +43,7 @@ ) ;; definition for function penetrated-by-all&hit-points->penetrated-by -;; INFO: Return type mismatch uint vs penetrate. +;; WARN: Return type mismatch uint vs penetrate. (defun penetrated-by-all&hit-points->penetrated-by ((arg0 penetrate) (arg1 int)) (let ((a0-1 arg1)) (the-as penetrate (logior (logclear arg0 (penetrate @@ -116,7 +116,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/game/settings_REF.gc b/test/decompiler/reference/jak2/engine/game/settings_REF.gc index 276434bbee..0db25ccaac 100644 --- a/test/decompiler/reference/jak2/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/settings_REF.gc @@ -544,7 +544,7 @@ ;; definition for method 10 of type cam-setting-data ;; INFO: Used lq/sq -;; INFO: Return type mismatch cam-setting-data vs none. +;; WARN: Return type mismatch cam-setting-data vs none. (defmethod cam-setting-data-method-10 cam-setting-data ((obj cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int)) (case arg0 (('fov) @@ -804,7 +804,7 @@ ) ;; definition for method 9 of type setting-control -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod add-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) 0 @@ -812,7 +812,7 @@ ) ;; definition for method 11 of type setting-control -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod set-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) (remove-setting obj arg0 arg1) (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) @@ -821,7 +821,7 @@ ) ;; definition for method 10 of type setting-control -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod persist-with-delay setting-control ((obj setting-control) (arg0 process) (arg1 time-frame) @@ -843,7 +843,7 @@ ) ;; definition for method 12 of type setting-control -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod remove-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol)) (when arg0 (let ((s5-0 (-> obj engine)) @@ -864,7 +864,7 @@ ) ;; definition for method 13 of type setting-control -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod kill-persister setting-control ((obj setting-control) (arg0 engine-pers) (arg1 object)) "Calls [[engine-pers::kill-matching]]" (kill-matching @@ -898,7 +898,7 @@ ) ;; definition for method 15 of type setting-control -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod remove-setting-by-arg0 setting-control ((obj setting-control) (arg0 object)) "Calls [[engine::remove-by-param0]] on `engine-hi`" (remove-by-param0 (-> obj engine-hi) arg0) diff --git a/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc b/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc index 2e15a7bca1..cc9c8ac1c2 100644 --- a/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc @@ -44,7 +44,7 @@ ) ;; definition for method 13 of type bounding-box -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod set-from-point-offset! bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -69,7 +69,7 @@ ) ;; definition for method 11 of type bounding-box -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod add-point! bounding-box ((obj bounding-box) (arg0 vector)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -108,7 +108,7 @@ ;; definition for method 15 of type bounding-box ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod set-to-point! bounding-box ((obj bounding-box) (arg0 vector)) (set! (-> obj min quad) (-> arg0 quad)) (set! (-> obj max quad) (-> arg0 quad)) @@ -144,7 +144,7 @@ ) ;; definition for method 16 of type bounding-box -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod set-from-sphere! bounding-box ((obj bounding-box) (arg0 sphere)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -264,7 +264,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc b/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc index 89887772f1..5f5e0d963a 100644 --- a/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc @@ -73,7 +73,7 @@ ;; definition for method 9 of type cylinder ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod debug-draw cylinder ((obj cylinder) (arg0 vector4w)) (local-vars (sv-896 matrix) @@ -318,7 +318,7 @@ ;; definition for method 9 of type cylinder-flat ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod debug-draw cylinder-flat ((obj cylinder-flat) (arg0 vector4w)) (local-vars (sv-448 vector)) (rlet ((acc :class vf) diff --git a/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc b/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc index 9fbdd74195..c62981d6cb 100644 --- a/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc @@ -816,7 +816,7 @@ ;; definition for function closest-pt-in-triangle ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun closest-pt-in-triangle ((arg0 vector) (arg1 vector) (arg2 matrix) (arg3 vector)) (local-vars (v1-0 float) @@ -1031,7 +1031,7 @@ ) ;; definition for function circle-circle-xz-intersect -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f5, f5] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f1] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f0, f0] @@ -1241,7 +1241,7 @@ ;; definition for function circle-test ;; INFO: Used lq/sq -;; INFO: Return type mismatch object vs none. +;; WARN: Return type mismatch object vs none. (defun circle-test () (let ((s4-0 (new 'stack 'sphere)) (a1-2 (new 'stack 'sphere)) @@ -1261,7 +1261,7 @@ ;; definition for function vector-circle-tangent-new ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun vector-circle-tangent-new ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (rlet ((Q :class vf) (vf0 :class vf) @@ -1300,7 +1300,7 @@ ) ;; definition for function vector-circle-tangent -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun vector-circle-tangent ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (let* ((s3-1 (vector-! (the-as vector (new 'stack-no-clear 'sphere)) arg1 arg0)) (f0-0 (vector-xz-length s3-1)) diff --git a/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc index dfac1d96e6..f32f217fb9 100644 --- a/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc @@ -88,7 +88,7 @@ ;; INFO: Used lq/sq ;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 -;; INFO: Return type mismatch object vs path-control. +;; WARN: Return type mismatch object vs path-control. (defmethod new path-control ((allocation symbol) (type-to-make type) (arg0 process) @@ -176,7 +176,7 @@ ) ;; definition for method 19 of type path-control -;; INFO: Return type mismatch int32 vs int. +;; WARN: Return type mismatch int32 vs int. (defmethod get-num-verts path-control ((obj path-control)) (the-as int (-> obj curve num-cverts)) ) @@ -236,7 +236,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc index 226e84e4aa..05d399d8be 100644 --- a/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc @@ -83,7 +83,7 @@ ;; definition for method 0 of type vol-control ;; INFO: Used lq/sq -;; INFO: Return type mismatch object vs vol-control. +;; WARN: Return type mismatch object vs vol-control. (defmethod new vol-control ((allocation symbol) (type-to-make type) (arg0 process-drawable)) (let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) (when (zero? (the-as vol-control gp-0)) @@ -146,7 +146,3 @@ "Returns true/false if the volume's marks should be displayed" (and *display-vol-marks* (logtest? (-> obj flags) (vol-flags display?))) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc index fc672a8b83..9fa1821295 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc @@ -74,7 +74,7 @@ ) ;; definition for function draw-sprite2d-xy -;; INFO: Return type mismatch pointer vs none. +;; WARN: Return type mismatch pointer vs none. (defun draw-sprite2d-xy ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 rgba)) (let* ((t2-1 (new 'stack 'draw-context arg1 arg2 arg3 arg4 arg5)) (a1-3 (max 1792 (min 2304 (+ (-> t2-1 orgx) 1792)))) @@ -132,7 +132,7 @@ ) ;; definition for function draw-sprite2d-xy-absolute -;; INFO: Return type mismatch pointer vs none. +;; WARN: Return type mismatch pointer vs none. (defun draw-sprite2d-xy-absolute ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 rgba)) (let ((t2-0 (+ arg1 1792)) (a1-1 (+ arg2 1840)) @@ -186,7 +186,7 @@ ) ;; definition for function draw-quad2d -;; INFO: Return type mismatch pointer vs none. +;; WARN: Return type mismatch pointer vs none. (defun draw-quad2d ((arg0 dma-buffer) (arg1 draw-context)) (let ((a3-1 (max 1792 (min 2304 (+ (-> arg1 orgx) 1792)))) (a2-3 (max 1840 (min 2256 (+ (-> arg1 orgy) 1840)))) diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc index fd181458c2..fb1cf92649 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc @@ -820,7 +820,7 @@ ) ;; definition for method 3 of type gif-tag -;; INFO: Return type mismatch object vs gif-tag. +;; WARN: Return type mismatch object vs gif-tag. (defmethod inspect gif-tag ((obj gif-tag)) (format #t "[~8x] gif-tag~%" obj) (format #t "~Tnloop: ~4d~%" (-> obj nloop)) @@ -894,7 +894,7 @@ ) ;; definition for function add-reg-gif-packet -;; INFO: Return type mismatch gif-packet vs none. +;; WARN: Return type mismatch gif-packet vs none. (defun add-reg-gif-packet ((arg0 gif-packet) (arg1 int) (arg2 int)) (let ((v1-0 (-> arg0 gif-tag))) (logior! (-> v1-0 regs) (ash arg1 (* (-> arg0 reg-count) 4))) @@ -960,7 +960,7 @@ ) ;; definition for function draw-context-set-xy -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun draw-context-set-xy ((arg0 draw-context) (arg1 int) (arg2 int)) (set! (-> arg0 orgx) arg1) (set! (-> arg0 orgy) arg2) diff --git a/test/decompiler/reference/jak2/engine/gfx/lightning-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/lightning-h_REF.gc index 970c5d06e6..52d44f00d5 100644 --- a/test/decompiler/reference/jak2/engine/gfx/lightning-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/lightning-h_REF.gc @@ -176,7 +176,7 @@ ;; definition for method 11 of type lightning-control ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod set-point lightning-control ((obj lightning-control) (arg0 int) (arg1 vector)) (let ((v1-0 (-> obj state))) (when (and (-> v1-0 path) (>= arg0 0) (< arg0 (-> v1-0 path length))) @@ -201,7 +201,7 @@ ;; definition for method 12 of type lightning-control ;; INFO: Used lq/sq -;; INFO: Return type mismatch (inline-array vector) vs none. +;; WARN: Return type mismatch (inline-array vector) vs none. (defmethod set-first-meet-point lightning-control ((obj lightning-control) (arg0 vector)) (set! (-> obj state meet data 0 quad) (-> arg0 quad)) (none) @@ -209,7 +209,7 @@ ;; definition for method 13 of type lightning-control ;; INFO: Used lq/sq -;; INFO: Return type mismatch vector vs none. +;; WARN: Return type mismatch vector vs none. (defmethod set-last-meet-point lightning-control ((obj lightning-control) (arg0 vector)) (set! (-> obj state meet data (+ (-> obj state points-to-draw) -1) quad) (-> arg0 quad)) (none) @@ -233,7 +233,7 @@ ) ;; definition for method 0 of type lightning-control -;; INFO: Return type mismatch object vs lightning-control. +;; WARN: Return type mismatch object vs lightning-control. (defmethod new lightning-control ((allocation symbol) (type-to-make type) (arg0 lightning-spec) (arg1 process) (arg2 float)) (with-pp (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) @@ -321,7 +321,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc b/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc index 3241bb1aa2..b165783463 100644 --- a/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc @@ -25,7 +25,7 @@ ) ;; definition for function fog-corrector-setup -;; INFO: Return type mismatch float vs none. +;; WARN: Return type mismatch float vs none. (defun fog-corrector-setup ((arg0 fog-corrector) (arg1 math-camera)) (set! (-> arg0 fog-end) (* (-> arg1 fog-end) (-> arg1 fov-correction-factor))) (set! (-> arg0 fog-start) (* (-> arg1 fog-start) (-> arg1 fov-correction-factor))) @@ -477,7 +477,7 @@ ) ;; definition for function reverse-transform-point! -;; INFO: Return type mismatch vector vs none. +;; WARN: Return type mismatch vector vs none. (defun reverse-transform-point! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (let* ((v1-1 (-> *math-camera* perspective)) (s2-0 (-> *math-camera* camera-rot)) @@ -506,7 +506,7 @@ ;; definition for function init-for-transform ;; INFO: Used lq/sq -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defun init-for-transform ((arg0 matrix)) (local-vars (v1-14 float)) (rlet ((vf1 :class vf) diff --git a/test/decompiler/reference/jak2/engine/gfx/merc/emerc_REF.gc b/test/decompiler/reference/jak2/engine/gfx/merc/emerc_REF.gc index 6d70161ce3..6f2502d042 100644 --- a/test/decompiler/reference/jak2/engine/gfx/merc/emerc_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/merc/emerc_REF.gc @@ -47,7 +47,7 @@ ) ;; definition for function emerc-vu1-init-buffer -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun emerc-vu1-init-buffer ((dma-bucket bucket-id) (test gs-test) (arg2 int)) (let ((bucket (-> *display* frames (-> *display* on-screen) bucket-group dma-bucket))) (when (!= bucket (-> bucket last)) @@ -113,7 +113,7 @@ ) ;; definition for function emerc-vu1-init-buffers -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun emerc-vu1-init-buffers () (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask rn14)) (emerc-vu1-init-buffer (bucket-id bucket-15) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal)) 0) @@ -254,7 +254,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/merc/merc-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/merc/merc-h_REF.gc index 2f18cf1bb5..e412089035 100644 --- a/test/decompiler/reference/jak2/engine/gfx/merc/merc-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/merc/merc-h_REF.gc @@ -185,7 +185,7 @@ ) ;; definition for function merc-fragment-fp-data -;; INFO: Return type mismatch int vs merc-fp-header. +;; WARN: Return type mismatch int vs merc-fp-header. (defun merc-fragment-fp-data ((arg0 merc-fragment)) (the-as merc-fp-header (+ (the-as uint arg0) (* (-> arg0 header mm-quadword-fp-off) 16))) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc new file mode 100644 index 0000000000..082803ccdc --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc @@ -0,0 +1,3607 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type default-interior-states +(deftype default-interior-states (structure) + () + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + +;; definition for method 3 of type default-interior-states +(defmethod inspect default-interior-states ((obj default-interior-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'default-interior-states) + (label cfg-4) + obj + ) + +;; definition for function update-mood-default-interior +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-default-interior time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 2 w) 1.0) + (set! (-> arg0 times 3 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +;; definition of type vinroom-states +(deftype vinroom-states (structure) + ((main float :offset-assert 0) + (flicker1 float :offset-assert 4) + (flicker2 float :offset-assert 8) + (warp float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type vinroom-states +(defmethod inspect vinroom-states ((obj vinroom-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vinroom-states) + (format #t "~1Tmain: ~f~%" (-> obj main)) + (format #t "~1Tflicker1: ~f~%" (-> obj flicker1)) + (format #t "~1Tflicker2: ~f~%" (-> obj flicker2)) + (format #t "~1Twarp: ~f~%" (-> obj warp)) + (label cfg-4) + obj + ) + +;; definition for function update-vinroom-lights +;; WARN: Return type mismatch int vs none. +(defun update-vinroom-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (set-vector! (-> arg0 current-env-color) 48.0 60.0 96.0 255.0) + (set-vector! (-> v1-0 0 dir0 color) 0.061 0.854 1.0 1.0) + (set-vector! (-> v1-0 0 dir1 color) 0.858 0.932 1.0 1.0) + (let ((a0-4 (-> v1-0 0 dir1))) + (set! (-> a0-4 direction x) -0.6499) + (set! (-> a0-4 direction y) 0.7134) + (set! (-> a0-4 direction z) -0.2619) + (set! (-> a0-4 direction w) 1.0) + ) + (set-vector! (-> v1-0 0 dir2 color) 0.858 0.932 1.0 1.0) + (let ((a0-6 (-> v1-0 0 dir2))) + (set! (-> a0-6 direction x) 0.4634) + (set! (-> a0-6 direction y) 0.7718) + (set! (-> a0-6 direction z) -0.4352) + (set! (-> a0-6 direction w) 1.0) + ) + (set-vector! (-> v1-0 0 ambi color) 0.282 0.42 0.637 1.0) + (set! (-> v1-0 0 dir1 extra x) 1.0) + (set! (-> v1-0 0 dir2 extra x) 1.0) + ) + 0 + (none) + ) + +;; definition for function update-mood-vinroom +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-vinroom time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-vinroom-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as (pointer float) (-> arg0 state)))) + (let ((s4-0 (-> arg0 light-group))) + (set! (-> arg0 times 1 w) (+ 0.875 (* 0.175 (cos (-> gp-0 0))))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> s4-0 0 dir0 extra x) (-> arg0 times 1 w)) + (set! (-> arg0 times 2 w) (if (< 36408.89 (-> gp-0 1)) + 0.475 + 0.5 + ) + ) + (set! (-> s4-0 0 dir1 extra x) (-> arg0 times 2 w)) + (set! (-> arg0 times 3 w) (if (< 21845.334 (-> gp-0 2)) + 0.475 + 0.5 + ) + ) + (set! (-> s4-0 0 dir2 extra x) (-> arg0 times 3 w)) + ) + (set! (-> arg0 times 4 w) (+ 1.2 (* 0.2 (cos (-> gp-0 3))))) + (when (not (paused?)) + (let ((f0-17 (+ (-> gp-0 0) (* 18204.445 (-> self clock seconds-per-frame))))) + (set! (-> gp-0 0) (- f0-17 (* (the float (the int (/ f0-17 65536.0))) 65536.0))) + ) + (let ((f0-20 (+ (-> gp-0 1) (* 196608.0 (-> self clock seconds-per-frame))))) + (set! (-> gp-0 1) (- f0-20 (* (the float (the int (/ f0-20 65536.0))) 65536.0))) + ) + (let ((f0-23 (+ (-> gp-0 2) (* 163840.0 (-> self clock seconds-per-frame))))) + (set! (-> gp-0 2) (- f0-23 (* (the float (the int (/ f0-23 65536.0))) 65536.0))) + ) + (let ((f0-26 (+ (-> gp-0 3) (* 32768.0 (-> self clock seconds-per-frame))))) + (set! (-> gp-0 3) (- f0-26 (* (the float (the int (/ f0-26 65536.0))) 65536.0))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type hideout-states +(deftype hideout-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xf + :flag-assert #x90000000f + ) + +;; definition for method 3 of type hideout-states +(defmethod inspect hideout-states ((obj hideout-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'hideout-states) + (format #t "~1Tflame0: #~%" (-> obj flame0)) + (format #t "~1Tflame1: #~%" (-> obj flame1)) + (label cfg-4) + obj + ) + +;; definition for function update-hideout-lights +;; WARN: Return type mismatch int vs none. +(defun update-hideout-lights ((arg0 mood-context)) + (let ((a2-0 (-> arg0 light-group)) + (a1-0 (-> arg0 light-group 1)) + (v1-0 (-> arg0 light-group 2)) + ) + (set-vector! (-> a2-0 0 dir0 color) 0.0 0.0 0.0 1.0) + (set-vector! (-> a2-0 0 ambi color) 0.22 0.219 0.35 1.0) + (let ((a0-3 (-> a1-0 dir0))) + (set! (-> a0-3 direction x) 0.0) + (set! (-> a0-3 direction y) -1.0) + (set! (-> a0-3 direction z) 0.0) + (set! (-> a0-3 direction w) 1.0) + ) + (set-vector! (-> a1-0 dir0 color) 1.0 0.8 0.4 1.0) + (set! (-> a1-0 dir0 extra x) 1.0) + (set-vector! (-> a1-0 ambi color) 0.22 0.219 0.35 1.0) + (set! (-> a1-0 ambi extra x) 1.0) + (let ((a0-8 (-> v1-0 dir0))) + (set! (-> a0-8 direction x) 0.331) + (set! (-> a0-8 direction y) 0.943) + (set! (-> a0-8 direction z) 0.0) + (set! (-> a0-8 direction w) 1.0) + ) + (set-vector! (-> v1-0 dir0 color) 0.256 0.685 0.573 1.0) + (set! (-> v1-0 dir0 extra x) 1.0) + (let ((a0-11 (-> v1-0 dir1))) + (set! (-> a0-11 direction x) -1.0) + (set! (-> a0-11 direction y) 0.0) + (set! (-> a0-11 direction z) 0.0) + (set! (-> a0-11 direction w) 1.0) + ) + (set-vector! (-> v1-0 dir1 color) 0.202 0.205 0.15 1.0) + (set! (-> v1-0 dir1 extra x) 1.0) + (set-vector! (-> v1-0 ambi color) 0.22 0.219 0.35 1.0) + (set! (-> v1-0 ambi extra x) 1.0) + ) + 0 + (none) + ) + +;; definition for function update-mood-hideout +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-hideout time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-hideout-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (cond + ((movie?) + (update-mood-flames arg0 1 2 0 0.333 0.0005859375 2.0) + (update-mood-flames arg0 3 2 8 0.333 0.0005859375 3.0) + ) + (else + (update-mood-flames arg0 1 2 0 0.333 0.001953125 2.0) + (update-mood-flames arg0 3 2 8 0.333 0.001953125 3.0) + ) + ) + (let ((a0-10 (new 'stack-no-clear 'sphere)) + (a1-4 (-> *math-camera* trans)) + ) + (set-vector! a0-10 4898816.0 32768.0 245760.0 1.0) + (let ((f0-5 (get-sphere-interp a0-10 a1-4 61440.0 69632.0))) + (set-vector! (-> arg0 times 0) 1.0 1.0 1.0 1.0) + (vector-lerp! + (the-as vector (-> arg0 times)) + (the-as vector (-> arg0 times)) + (the-as vector (+ #x83ac (the-as int *level*))) + f0-5 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function update-mood-copy-hideout +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-hideout time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'hideout))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +;; definition of type hiphog-states +(deftype hiphog-states (structure) + ((spec-m-on sp-field-init-spec :offset-assert 0) + (spec-o-on sp-field-init-spec :offset-assert 4) + (spec-r-on sp-field-init-spec :offset-assert 8) + (spec-g-on sp-field-init-spec :offset-assert 12) + (spec-a-on sp-field-init-spec :offset-assert 16) + (spec-n-on sp-field-init-spec :offset-assert 20) + (spec-m-off sp-field-init-spec :offset-assert 24) + (spec-o-off sp-field-init-spec :offset-assert 28) + (spec-r-off sp-field-init-spec :offset-assert 32) + (spec-g-off sp-field-init-spec :offset-assert 36) + (spec-a-off sp-field-init-spec :offset-assert 40) + (spec-n-off sp-field-init-spec :offset-assert 44) + (spec-hog-1-on sp-field-init-spec :offset-assert 48) + (spec-hog-2-on sp-field-init-spec :offset-assert 52) + (spec-hiphog-on sp-field-init-spec :offset-assert 56) + (spec-hiphog-off sp-field-init-spec :offset-assert 60) + (spec-hiphog-on2 sp-field-init-spec :offset-assert 64) + (spec-hiphog-off2 sp-field-init-spec :offset-assert 68) + (spec-clock-sun sp-field-init-spec :offset-assert 72) + (spec-clock-moon sp-field-init-spec :offset-assert 76) + (door entity :offset-assert 80) + (m-on uint8 :offset-assert 84) + (o-on uint8 :offset-assert 85) + (r-on uint8 :offset-assert 86) + (g-on uint8 :offset-assert 87) + (a-on uint8 :offset-assert 88) + (n-on uint8 :offset-assert 89) + (m-off uint8 :offset-assert 90) + (o-off uint8 :offset-assert 91) + (r-off uint8 :offset-assert 92) + (g-off uint8 :offset-assert 93) + (a-off uint8 :offset-assert 94) + (n-off uint8 :offset-assert 95) + (hog-on uint8 :offset-assert 96) + (hiphog-on uint8 :offset-assert 97) + (hiphog-off uint8 :offset-assert 98) + (clock-sun uint8 :offset-assert 99) + (clock-moon uint8 :offset-assert 100) + ) + :method-count-assert 9 + :size-assert #x65 + :flag-assert #x900000065 + ) + +;; definition for method 3 of type hiphog-states +(defmethod inspect hiphog-states ((obj hiphog-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'hiphog-states) + (format #t "~1Tspec-m-on: #~%" (-> obj spec-m-on)) + (format #t "~1Tspec-o-on: #~%" (-> obj spec-o-on)) + (format #t "~1Tspec-r-on: #~%" (-> obj spec-r-on)) + (format #t "~1Tspec-g-on: #~%" (-> obj spec-g-on)) + (format #t "~1Tspec-a-on: #~%" (-> obj spec-a-on)) + (format #t "~1Tspec-n-on: #~%" (-> obj spec-n-on)) + (format #t "~1Tspec-m-off: #~%" (-> obj spec-m-off)) + (format #t "~1Tspec-o-off: #~%" (-> obj spec-o-off)) + (format #t "~1Tspec-r-off: #~%" (-> obj spec-r-off)) + (format #t "~1Tspec-g-off: #~%" (-> obj spec-g-off)) + (format #t "~1Tspec-a-off: #~%" (-> obj spec-a-off)) + (format #t "~1Tspec-n-off: #~%" (-> obj spec-n-off)) + (format #t "~1Tspec-hog-1-on: #~%" (-> obj spec-hog-1-on)) + (format #t "~1Tspec-hog-2-on: #~%" (-> obj spec-hog-2-on)) + (format #t "~1Tspec-hiphog-on: #~%" (-> obj spec-hiphog-on)) + (format #t "~1Tspec-hiphog-off: #~%" (-> obj spec-hiphog-off)) + (format #t "~1Tspec-hiphog-on2: #~%" (-> obj spec-hiphog-on2)) + (format #t "~1Tspec-hiphog-off2: #~%" (-> obj spec-hiphog-off2)) + (format #t "~1Tspec-clock-sun: #~%" (-> obj spec-clock-sun)) + (format #t "~1Tspec-clock-moon: #~%" (-> obj spec-clock-moon)) + (format #t "~1Tdoor: ~A~%" (-> obj door)) + (format #t "~1Tm-on: ~D~%" (-> obj m-on)) + (format #t "~1To-on: ~D~%" (-> obj o-on)) + (format #t "~1Tr-on: ~D~%" (-> obj r-on)) + (format #t "~1Tg-on: ~D~%" (-> obj g-on)) + (format #t "~1Ta-on: ~D~%" (-> obj a-on)) + (format #t "~1Tn-on: ~D~%" (-> obj n-on)) + (format #t "~1Tm-off: ~D~%" (-> obj m-off)) + (format #t "~1To-off: ~D~%" (-> obj o-off)) + (format #t "~1Tr-off: ~D~%" (-> obj r-off)) + (format #t "~1Tg-off: ~D~%" (-> obj g-off)) + (format #t "~1Ta-off: ~D~%" (-> obj a-off)) + (format #t "~1Tn-off: ~D~%" (-> obj n-off)) + (format #t "~1Thog-on: ~D~%" (-> obj hog-on)) + (format #t "~1Thiphog-on: ~D~%" (-> obj hiphog-on)) + (format #t "~1Thiphog-off: ~D~%" (-> obj hiphog-off)) + (format #t "~1Tclock-sun: ~D~%" (-> obj clock-sun)) + (format #t "~1Tclock-moon: ~D~%" (-> obj clock-moon)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-hiphog +;; WARN: Return type mismatch entity vs none. +(defun init-mood-hiphog ((arg0 mood-context)) + (let ((gp-0 (the-as hiphog-states (-> arg0 state)))) + (let ((a0-1 (-> *part-id-table* 19))) + (set! (-> gp-0 spec-m-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-m-on) (get-field-spec-by-id a0-1 (sp-field-id spt-r))) + ) + ) + (let ((a0-2 (-> *part-id-table* 20))) + (set! (-> gp-0 spec-o-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 spec-o-on) (get-field-spec-by-id a0-2 (sp-field-id spt-r))) + ) + ) + (let ((a0-3 (-> *part-id-table* 21))) + (set! (-> gp-0 spec-r-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-3) + (set! (-> gp-0 spec-r-on) (get-field-spec-by-id a0-3 (sp-field-id spt-r))) + ) + ) + (let ((a0-4 (-> *part-id-table* 22))) + (set! (-> gp-0 spec-g-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-4) + (set! (-> gp-0 spec-g-on) (get-field-spec-by-id a0-4 (sp-field-id spt-r))) + ) + ) + (let ((a0-5 (-> *part-id-table* 23))) + (set! (-> gp-0 spec-a-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-5) + (set! (-> gp-0 spec-a-on) (get-field-spec-by-id a0-5 (sp-field-id spt-r))) + ) + ) + (let ((a0-6 (-> *part-id-table* 24))) + (set! (-> gp-0 spec-n-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-6) + (set! (-> gp-0 spec-n-on) (get-field-spec-by-id a0-6 (sp-field-id spt-r))) + ) + ) + (let ((a0-7 (-> *part-id-table* 25))) + (set! (-> gp-0 spec-m-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-7) + (set! (-> gp-0 spec-m-off) (get-field-spec-by-id a0-7 (sp-field-id spt-r))) + ) + ) + (let ((a0-8 (-> *part-id-table* 26))) + (set! (-> gp-0 spec-o-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-8) + (set! (-> gp-0 spec-o-off) (get-field-spec-by-id a0-8 (sp-field-id spt-r))) + ) + ) + (let ((a0-9 (-> *part-id-table* 27))) + (set! (-> gp-0 spec-r-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-9) + (set! (-> gp-0 spec-r-off) (get-field-spec-by-id a0-9 (sp-field-id spt-r))) + ) + ) + (let ((a0-10 (-> *part-id-table* 28))) + (set! (-> gp-0 spec-g-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-10) + (set! (-> gp-0 spec-g-off) (get-field-spec-by-id a0-10 (sp-field-id spt-r))) + ) + ) + (let ((a0-11 (-> *part-id-table* 29))) + (set! (-> gp-0 spec-a-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-11) + (set! (-> gp-0 spec-a-off) (get-field-spec-by-id a0-11 (sp-field-id spt-r))) + ) + ) + (let ((a0-12 (-> *part-id-table* 30))) + (set! (-> gp-0 spec-n-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-12) + (set! (-> gp-0 spec-n-off) (get-field-spec-by-id a0-12 (sp-field-id spt-r))) + ) + ) + (let ((a0-13 (-> *part-id-table* 31))) + (set! (-> gp-0 spec-hog-1-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-13) + (set! (-> gp-0 spec-hog-1-on) (get-field-spec-by-id a0-13 (sp-field-id spt-r))) + ) + ) + (let ((a0-14 (-> *part-id-table* 32))) + (set! (-> gp-0 spec-hog-2-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-14) + (set! (-> gp-0 spec-hog-2-on) (get-field-spec-by-id a0-14 (sp-field-id spt-r))) + ) + ) + (let ((a0-15 (-> *part-id-table* 33))) + (set! (-> gp-0 spec-hiphog-on) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-15) + (set! (-> gp-0 spec-hiphog-on) (get-field-spec-by-id a0-15 (sp-field-id spt-r))) + ) + ) + (let ((a0-16 (-> *part-id-table* 34))) + (set! (-> gp-0 spec-hiphog-off) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-16) + (set! (-> gp-0 spec-hiphog-off) (get-field-spec-by-id a0-16 (sp-field-id spt-r))) + ) + ) + (let ((a0-17 (-> *part-id-table* 35))) + (set! (-> gp-0 spec-hiphog-on2) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-17) + (set! (-> gp-0 spec-hiphog-on2) (get-field-spec-by-id a0-17 (sp-field-id spt-r))) + ) + ) + (let ((a0-18 (-> *part-id-table* 36))) + (set! (-> gp-0 spec-hiphog-off2) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-18) + (set! (-> gp-0 spec-hiphog-off2) (get-field-spec-by-id a0-18 (sp-field-id spt-r))) + ) + ) + (let ((a0-19 (-> *part-id-table* 37))) + (set! (-> gp-0 spec-clock-sun) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-19) + (set! (-> gp-0 spec-clock-sun) (get-field-spec-by-id a0-19 (sp-field-id spt-r))) + ) + ) + (let ((a0-20 (-> *part-id-table* 38))) + (set! (-> gp-0 spec-clock-moon) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-20) + (set! (-> gp-0 spec-clock-moon) (get-field-spec-by-id a0-20 (sp-field-id spt-r))) + ) + ) + (set! (-> gp-0 m-on) (the-as uint 128)) + (set! (-> gp-0 o-on) (the-as uint 128)) + (set! (-> gp-0 r-on) (the-as uint 128)) + (set! (-> gp-0 g-on) (the-as uint 128)) + (set! (-> gp-0 a-on) (the-as uint 128)) + (set! (-> gp-0 n-on) (the-as uint 128)) + (set! (-> gp-0 m-off) (the-as uint 128)) + (set! (-> gp-0 o-off) (the-as uint 128)) + (set! (-> gp-0 r-off) (the-as uint 128)) + (set! (-> gp-0 g-off) (the-as uint 128)) + (set! (-> gp-0 a-off) (the-as uint 128)) + (set! (-> gp-0 n-off) (the-as uint 128)) + (set! (-> gp-0 hog-on) (the-as uint 128)) + (set! (-> gp-0 hiphog-on) (the-as uint 128)) + (set! (-> gp-0 hiphog-off) (the-as uint 128)) + (set! (-> gp-0 clock-sun) (the-as uint 128)) + (set! (-> gp-0 clock-moon) (the-as uint 128)) + (set! (-> gp-0 door) (entity-by-name "hip-door-b-1")) + ) + (none) + ) + +;; definition for function update-hiphog-lights +;; WARN: Return type mismatch int vs none. +(defun update-hiphog-lights ((arg0 mood-context)) + (let ((t1-0 (-> arg0 light-group)) + (t0-0 (-> arg0 light-group 1)) + (a3-0 (-> arg0 light-group 2)) + (a2-0 (-> arg0 light-group 3)) + (a1-0 (-> arg0 light-group 4)) + (v1-0 (-> arg0 light-group 5)) + ) + (set-vector! (-> t1-0 0 dir0 color) 0.0 0.0 0.0 1.0) + (set-vector! (-> t1-0 0 ambi color) 0.11 0.109 0.175 1.0) + (set-vector! (-> t0-0 dir0 color) 0.945 0.648 0.523 1.0) + (let ((a0-4 (-> t0-0 dir0))) + (set! (-> a0-4 direction x) 0.0) + (set! (-> a0-4 direction y) 1.0) + (set! (-> a0-4 direction z) 0.0) + (set! (-> a0-4 direction w) 1.0) + ) + (set! (-> t0-0 dir0 extra x) 1.0) + (set-vector! (-> t0-0 ambi color) 0.197 0.124 0.062 1.0) + (set! (-> t0-0 ambi extra x) 1.0) + (set-vector! (-> a3-0 dir0 color) 0.945 0.648 0.523 1.0) + (set-vector! (-> a3-0 dir1 color) 1.0 0.237 0.386 1.0) + (set-vector! (-> a3-0 ambi color) 0.197 0.124 0.062 1.0) + (let ((a0-11 (-> a3-0 dir0))) + (set! (-> a0-11 direction x) 0.0) + (set! (-> a0-11 direction y) 1.0) + (set! (-> a0-11 direction z) 0.0) + (set! (-> a0-11 direction w) 1.0) + ) + (let ((a0-12 (-> a3-0 dir1))) + (set! (-> a0-12 direction x) 0.0) + (set! (-> a0-12 direction y) -1.0) + (set! (-> a0-12 direction z) 0.0) + (set! (-> a0-12 direction w) 1.0) + ) + (set! (-> a3-0 dir0 extra x) 1.0) + (set! (-> a3-0 dir1 extra x) 1.0) + (set! (-> a3-0 ambi extra x) 1.0) + (set-vector! (-> a2-0 dir0 color) 0.945 0.648 0.523 1.0) + (set-vector! (-> a2-0 dir1 color) 0.02 0.97 0.0 1.0) + (set-vector! (-> a2-0 dir2 color) 1.0 0.237 0.386 1.0) + (set-vector! (-> a2-0 ambi color) 0.197 0.124 0.062 1.0) + (let ((a0-20 (-> a2-0 dir0))) + (set! (-> a0-20 direction x) 0.0) + (set! (-> a0-20 direction y) 1.0) + (set! (-> a0-20 direction z) 0.0) + (set! (-> a0-20 direction w) 1.0) + ) + (let ((a0-21 (-> a2-0 dir1))) + (set! (-> a0-21 direction x) 0.0) + (set! (-> a0-21 direction y) -1.0) + (set! (-> a0-21 direction z) 0.0) + (set! (-> a0-21 direction w) 1.0) + ) + (let ((a0-22 (-> a2-0 dir2))) + (set! (-> a0-22 direction x) 1.0) + (set! (-> a0-22 direction y) 0.0) + (set! (-> a0-22 direction z) 0.0) + (set! (-> a0-22 direction w) 1.0) + ) + (set! (-> a2-0 dir0 extra x) 1.0) + (set! (-> a2-0 dir1 extra x) 1.0) + (set! (-> a2-0 dir2 extra x) 1.0) + (set! (-> a2-0 ambi extra x) 1.0) + (set-vector! (-> a1-0 dir0 color) 0.945 0.648 0.523 1.0) + (set-vector! (-> a1-0 dir1 color) 0.02 0.97 0.0 1.0) + (set-vector! (-> a1-0 dir2 color) 1.0 0.237 0.386 1.0) + (set-vector! (-> a1-0 ambi color) 0.197 0.124 0.062 1.0) + (let ((a0-31 (-> a1-0 dir0))) + (set! (-> a0-31 direction x) 0.0) + (set! (-> a0-31 direction y) 1.0) + (set! (-> a0-31 direction z) 0.0) + (set! (-> a0-31 direction w) 1.0) + ) + (let ((a0-32 (-> a1-0 dir1))) + (set! (-> a0-32 direction x) 0.0) + (set! (-> a0-32 direction y) -1.0) + (set! (-> a0-32 direction z) 0.0) + (set! (-> a0-32 direction w) 1.0) + ) + (let ((a0-33 (-> a1-0 dir2))) + (set! (-> a0-33 direction x) -1.0) + (set! (-> a0-33 direction y) 0.0) + (set! (-> a0-33 direction z) 0.0) + (set! (-> a0-33 direction w) 1.0) + ) + (set! (-> a1-0 dir0 extra x) 1.0) + (set! (-> a1-0 dir1 extra x) 1.0) + (set! (-> a1-0 dir2 extra x) 1.0) + (set! (-> a1-0 ambi extra x) 1.0) + (set-vector! (-> v1-0 dir0 color) 0.9992 0.6868 0.7258 1.0) + (set-vector! (-> v1-0 dir1 color) 0.9992 0.6868 0.7258 1.0) + (set-vector! (-> v1-0 dir2 color) 0.9 0.9 0.9 1.0) + (set-vector! (-> v1-0 ambi color) 0.197 0.124 0.062 1.0) + (let ((a0-42 (-> v1-0 dir0))) + (set! (-> a0-42 direction x) 0.028) + (set! (-> a0-42 direction y) 0.731) + (set! (-> a0-42 direction z) -0.681) + (set! (-> a0-42 direction w) 1.0) + ) + (let ((a0-43 (-> v1-0 dir1))) + (set! (-> a0-43 direction x) -0.472) + (set! (-> a0-43 direction y) 0.719) + (set! (-> a0-43 direction z) 0.519) + (set! (-> a0-43 direction w) 1.0) + ) + (let ((a0-44 (-> v1-0 dir2))) + (set! (-> a0-44 direction x) 0.242) + (set! (-> a0-44 direction y) 0.786) + (set! (-> a0-44 direction z) 0.567) + (set! (-> a0-44 direction w) 1.0) + ) + (set! (-> v1-0 dir0 extra x) 1.0) + (set! (-> v1-0 dir1 extra x) 0.75) + (set! (-> v1-0 dir2 extra x) 0.0) + (set! (-> v1-0 ambi extra x) 1.0) + ) + 0 + (none) + ) + +;; definition for function update-mood-hiphog +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-hiphog time-of-day-proc ((arg0 mood-context) (arg1 float)) + (update-mood-interior arg0) + (update-hiphog-lights arg0) + (set! (-> arg0 light-group 0 dir0 extra x) 0.0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 1 w) 1.0) + (let ((v1-5 (-> *display* part-clock frame-counter)) + (s5-0 (the-as hiphog-states (-> arg0 state))) + ) + (let ((f6-0 (the float (-> s5-0 m-on))) + (f5-0 (the float (-> s5-0 o-on))) + (f3-0 (the float (-> s5-0 r-on))) + (f2-0 (the float (-> s5-0 g-on))) + (f1-0 (the float (-> s5-0 a-on))) + (f0-8 (the float (-> s5-0 n-on))) + ) + (if (nonzero? (-> s5-0 spec-m-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f6-0) + ) + (if (nonzero? (-> s5-0 spec-o-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f5-0) + ) + (if (nonzero? (-> s5-0 spec-r-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f3-0) + ) + (if (nonzero? (-> s5-0 spec-g-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f2-0) + ) + (if (nonzero? (-> s5-0 spec-a-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f1-0) + ) + (if (nonzero? (-> s5-0 spec-n-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f0-8) + ) + (let ((a0-37 (mod v1-5 800)) + (f4-0 0.0) + ) + (if (or (and (>= a0-37 100) (< a0-37 400)) (>= a0-37 500)) + (+! f4-0 f6-0) + ) + (if (or (and (>= a0-37 150) (< a0-37 400)) (>= a0-37 500)) + (+! f4-0 f5-0) + ) + (if (or (and (>= a0-37 200) (< a0-37 400)) (>= a0-37 500)) + (+! f4-0 f3-0) + ) + (if (or (and (>= a0-37 250) (< a0-37 400)) (>= a0-37 500)) + (+! f4-0 f2-0) + ) + (if (or (and (>= a0-37 300) (< a0-37 400)) (>= a0-37 500)) + (+! f4-0 f1-0) + ) + (if (or (and (>= a0-37 350) (< a0-37 400)) (>= a0-37 500)) + (+! f4-0 f0-8) + ) + (let ((f0-10 (* 0.0006510417 f4-0))) + (set! (-> arg0 times 2 w) f0-10) + (set! (-> arg0 light-group 3 dir1 extra x) f0-10) + ) + ) + ) + (let ((f5-1 (the float (-> s5-0 m-off))) + (f4-1 (the float (-> s5-0 o-off))) + (f3-1 (the float (-> s5-0 r-off))) + (f2-1 (the float (-> s5-0 g-off))) + (f1-1 (the float (-> s5-0 a-off))) + (f0-17 (the float (-> s5-0 n-off))) + ) + (if (nonzero? (-> s5-0 spec-m-off)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f5-1) + ) + (if (nonzero? (-> s5-0 spec-o-off)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f4-1) + ) + (if (nonzero? (-> s5-0 spec-r-off)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f3-1) + ) + (if (nonzero? (-> s5-0 spec-g-off)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f2-1) + ) + (if (nonzero? (-> s5-0 spec-a-off)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f1-1) + ) + (if (nonzero? (-> s5-0 spec-n-off)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f0-17) + ) + ) + (let ((f0-19 (the float (-> s5-0 hog-on)))) + (if (nonzero? (-> s5-0 spec-hog-1-on)) + (set! (-> s5-0 spec-hog-1-on initial-valuef) f0-19) + ) + (if (nonzero? (-> s5-0 spec-hog-2-on)) + (set! (-> s5-0 spec-hog-2-on initial-valuef) f0-19) + ) + (set! (-> arg0 times 3 w) (+ 0.5 (* 0.0009765625 f0-19))) + ) + (set! (-> arg0 light-group 4 dir1 extra x) (-> arg0 times 3 w)) + (let ((v1-6 (mod v1-5 600))) + (cond + ((< 300 v1-6) + (let ((f0-24 (the float (-> s5-0 hiphog-on)))) + (if (nonzero? (-> s5-0 spec-hiphog-on)) + (set! (-> s5-0 spec-hiphog-on initial-valuef) f0-24) + ) + (if (nonzero? (-> s5-0 spec-hiphog-on2)) + (set! (-> s5-0 spec-hiphog-on2 initial-valuef) f0-24) + ) + (set! (-> arg0 times 4 w) (* 0.001953125 f0-24)) + ) + ) + (else + (let ((f0-27 (the float (-> s5-0 hiphog-off)))) + (if (nonzero? (-> s5-0 spec-hiphog-off)) + (set! (-> s5-0 spec-hiphog-off initial-valuef) f0-27) + ) + (if (nonzero? (-> s5-0 spec-hiphog-off2)) + (set! (-> s5-0 spec-hiphog-off2 initial-valuef) f0-27) + ) + ) + ) + ) + ) + (cond + ((or (>= arg1 18.0) (>= 6.0 arg1)) + (let ((f0-31 (the float (-> s5-0 clock-moon)))) + (if (nonzero? (-> s5-0 spec-clock-moon)) + (set! (-> s5-0 spec-clock-moon initial-valuef) f0-31) + ) + (set-vector! (-> arg0 times 5) 0.471 0.722 1.0 (+ 0.5 (* 0.001953125 f0-31))) + ) + ) + (else + (let ((f0-35 (the float (-> s5-0 clock-sun)))) + (if (nonzero? (-> s5-0 spec-clock-sun)) + (set! (-> s5-0 spec-clock-sun initial-valuef) f0-35) + ) + (set-vector! (-> arg0 times 5) 1.0 0.99 0.54 (+ 0.5 (* 0.0009765625 f0-35))) + ) + ) + ) + (when (not (paused?)) + (set! (-> s5-0 m-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 o-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 r-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 g-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 a-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 n-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 m-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 o-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 r-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 g-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 a-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 n-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 hog-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 hiphog-on) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 hiphog-off) (the-as uint (the int (rand-vu-float-range 116.0 132.0)))) + (set! (-> s5-0 clock-sun) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + (set! (-> s5-0 clock-moon) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) + ) + (if (and (-> s5-0 door) (zero? (logand (-> s5-0 door extra perm status) (entity-perm-status subtask-complete)))) + (set! (-> arg0 times 0 quad) (-> (the-as (pointer uint128) (+ #x83ac (the-as int *level*))))) + ) + ) + (let ((a0-121 (new 'stack-no-clear 'sphere)) + (a1-40 (-> *math-camera* trans)) + ) + (set-vector! a0-121 -364544.0 0.0 5324800.0 1.0) + (let ((f0-76 (get-sphere-interp a0-121 a1-40 139264.0 24576.0))) + (vector-lerp! + (the-as vector (-> arg0 times)) + (the-as vector (-> arg0 times)) + (the-as vector (+ #x83ac (the-as int *level*))) + f0-76 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function update-mood-copy-hiphog +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-hiphog time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'hiphog))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +;; definition of type sewer-states +(deftype sewer-states (structure) + ((light-flag symbol :offset-assert 0) + (light-count uint32 :offset-assert 4) + (turret-value float :offset-assert 8) + (spec-light-center sp-field-init-spec :offset-assert 12) + (spec-light sp-field-init-spec :offset-assert 16) + (explosion float :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type sewer-states +(defmethod inspect sewer-states ((obj sewer-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sewer-states) + (format #t "~1Tlight-flag: ~A~%" (-> obj light-flag)) + (format #t "~1Tlight-count: ~D~%" (-> obj light-count)) + (format #t "~1Tturret-value: ~f~%" (-> obj turret-value)) + (format #t "~1Tspec-light-center: #~%" (-> obj spec-light-center)) + (format #t "~1Tspec-light: #~%" (-> obj spec-light)) + (format #t "~1Texplosion: ~f~%" (-> obj explosion)) + (label cfg-4) + obj + ) + +;; definition for function update-sewer-lights +;; WARN: Return type mismatch int vs none. +(defun update-sewer-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (set-vector! (-> v1-0 0 dir0 color) 0.822 0.694 0.613 1.0) + (set-vector! (-> v1-0 0 ambi color) 0.083 0.139 0.157 1.0) + ) + (let ((a3-0 (-> arg0 light-group 1)) + (a2-4 (-> arg0 light-group 2)) + (a1-5 (-> arg0 light-group 3)) + (v1-2 (-> arg0 light-group 4)) + ) + (set-vector! (-> a3-0 ambi color) 0.083 0.139 0.157 1.0) + (set! (-> a3-0 ambi extra x) 1.0) + (let ((a0-3 (-> a3-0 dir0))) + (set! (-> a0-3 direction x) 0.0) + (set! (-> a0-3 direction y) 1.0) + (set! (-> a0-3 direction z) 0.0) + (set! (-> a0-3 direction w) 1.0) + ) + (set-vector! (-> a3-0 dir0 color) 0.822 0.694 0.613 1.0) + (set! (-> a3-0 dir0 extra x) 1.0) + (set-vector! (-> a2-4 ambi color) 0.8 0.8 0.8 1.0) + (set! (-> a2-4 ambi extra x) 1.0) + (let ((a0-8 (-> a2-4 dir0))) + (set! (-> a0-8 direction x) 0.0) + (set! (-> a0-8 direction y) 1.0) + (set! (-> a0-8 direction z) 0.0) + (set! (-> a0-8 direction w) 1.0) + ) + (set-vector! (-> a2-4 dir0 color) 0.822 0.694 0.613 1.0) + (set! (-> a2-4 dir0 extra x) 1.0) + (let ((a0-11 (-> a2-4 dir1))) + (set! (-> a0-11 direction x) -0.751) + (set! (-> a0-11 direction y) 0.658) + (set! (-> a0-11 direction z) -0.035) + (set! (-> a0-11 direction w) 1.0) + ) + (set-vector! (-> a2-4 dir1 color) 1.0 0.65 0.65 1.0) + (set! (-> a2-4 dir1 extra x) 0.6) + (set-vector! (-> a1-5 ambi color) 0.35 0.35 0.35 1.0) + (set! (-> a1-5 ambi extra x) 1.0) + (let ((a0-16 (-> a1-5 dir0))) + (set! (-> a0-16 direction x) 0.0) + (set! (-> a0-16 direction y) 1.0) + (set! (-> a0-16 direction z) 0.0) + (set! (-> a0-16 direction w) 1.0) + ) + (set-vector! (-> a1-5 dir0 color) 0.822 0.694 0.613 1.0) + (set! (-> a1-5 dir0 extra x) 1.0) + (let ((a0-19 (-> v1-2 dir0))) + (set! (-> a0-19 direction x) 0.0) + (set! (-> a0-19 direction y) 1.0) + (set! (-> a0-19 direction z) 0.0) + (set! (-> a0-19 direction w) 1.0) + ) + (set-vector! (-> v1-2 dir0 color) 0.725 0.924 0.982 1.0) + (set! (-> v1-2 dir0 extra x) 0.4) + ) + 0 + (none) + ) + +;; definition for function init-mood-sewer +;; WARN: Return type mismatch sp-field-init-spec vs none. +(defun init-mood-sewer ((arg0 mood-context)) + (let ((gp-0 (the-as sewer-states (-> arg0 state)))) + (let ((a0-1 (-> *part-id-table* 39))) + (set! (-> gp-0 spec-light-center) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-light-center) (get-field-spec-by-id a0-1 (sp-field-id spt-a))) + ) + ) + (let ((a0-2 (-> *part-id-table* 40))) + (set! (-> gp-0 spec-light) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 spec-light) (get-field-spec-by-id a0-2 (sp-field-id spt-a))) + ) + ) + ) + (none) + ) + +;; definition for function update-mood-sewer +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-sewer time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-sewer-lights arg0) + (let ((s5-0 (-> arg0 light-group 2))) + (set! (-> arg0 light-group 0 dir0 extra x) 0.0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 2 w) 1.0) + (let ((s4-0 (the-as sewer-states (-> arg0 state)))) + (when (-> s4-0 light-flag) + (let ((v1-6 (-> s4-0 light-count))) + (cond + ((> v1-6 0) + (let ((f0-4 (+ 0.2 (* 0.0066666673 (the float v1-6)))) + (f1-3 (+ 0.4 (* 0.013333335 (the float v1-6)))) + ) + (set! (-> arg0 times 1 w) (rand-vu-float-range f0-4 f1-3)) + ) + (+! (-> s4-0 light-count) -1) + (set! (-> *display* force-sync) (the-as uint 2)) + ) + (else + (set! (-> arg0 times 1 w) 1.0) + ) + ) + ) + ) + (let ((f0-7 (-> arg0 times 1 w))) + (if (nonzero? (-> s4-0 spec-light-center)) + (set! (-> s4-0 spec-light-center initial-valuef) (* 12.0 f0-7)) + ) + (if (nonzero? (-> s4-0 spec-light)) + (set! (-> s4-0 spec-light initial-valuef) (* 12.0 f0-7)) + ) + (if *ocean-map-sewer* + (set! (-> *ocean-map-sewer* ocean-colors colors 1271) + (the-as + rgba + (logior (logand (logior (logand (logior (logand (logior (logand 0 -256) (shr (shl (the int (* 19.0 f0-7)) 56) 56)) -65281) + (shr (shl (the int (* 24.5 f0-7)) 56) 48) + ) + -16711681 + ) + (shr (shl (the int (* 16.0 f0-7)) 56) 40) + ) + (-> (new 'static 'array uint64 1 #xffffffff00ffffff) 0) + ) + (shl #x8000 16) + ) + ) + ) + ) + ) + (set! (-> arg0 times 6 w) (-> s4-0 explosion)) + (set! (-> arg0 times 7 w) (-> s4-0 turret-value)) + (when (not (paused?)) + (set! (-> s4-0 turret-value) (fmax 0.0 (+ -0.2 (-> s4-0 turret-value)))) + (seek! (-> s4-0 explosion) 0.0 (* 2.5 (-> self clock seconds-per-frame))) + ) + ) + (when *ocean-map-sewer* + (let ((f0-18 (-> *ocean-map-sewer* start-corner y))) + (let ((f1-19 (fmax 0.0 (fmin 1.0 (- 1.0 (* 0.000020345053 (+ 314802.2 f0-18))))))) + (set! (-> arg0 times 3 w) (fmax 0.0 (fmin 1.0 (- 1.0 (* 0.000020345053 (+ 265650.2 f0-18)))))) + (set! (-> arg0 times 4 w) f1-19) + (set! (-> s5-0 dir0 extra x) f1-19) + (set! (-> s5-0 ambi extra x) f1-19) + ) + (set! (-> arg0 times 5 w) (fmax 0.0 (fmin 1.0 (- 1.0 (* 0.000018780049 (+ 368050.2 f0-18)))))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function update-mood-copy-sewerb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-sewerb time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'sewerb))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +;; definition for function update-mood-copy-sewescb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-sewescb time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'sewescb))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +;; definition for function set-sewer-lights-flag! +(defun set-sewer-lights-flag! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'sewerb))) + (when v1-1 + (let ((v1-2 (the-as sewer-states (-> v1-1 mood-context state)))) + (if (and (not (-> v1-2 light-flag)) arg0) + (set! (-> v1-2 light-count) (the-as uint 30)) + ) + (set! (-> v1-2 light-flag) arg0) + ) + arg0 + ) + ) + ) + +;; definition for function set-sewer-turret-flash! +(defun set-sewer-turret-flash! () + (let ((v1-1 (level-get *level* 'sewerb))) + (when v1-1 + (let ((v1-2 (the-as sewer-states (-> v1-1 mood-context state))) + (f0-0 1.0) + ) + (set! (-> v1-2 turret-value) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition for function set-sewesc-explosion! +(defun set-sewesc-explosion! () + (let ((v1-1 (level-get *level* 'sewescb))) + (when v1-1 + (let ((v1-2 (the-as sewer-states (-> v1-1 mood-context state))) + (f0-0 1.9921875) + ) + (set! (-> v1-2 explosion) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition of type onintent-states +(deftype onintent-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (green-flame flames-state :inline :offset-assert 24) + (totem0 flames-state :inline :offset-assert 32) + (totem1 flames-state :inline :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2f + :flag-assert #x90000002f + ) + +;; definition for method 3 of type onintent-states +(defmethod inspect onintent-states ((obj onintent-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'onintent-states) + (format #t "~1Tflame0: #~%" (-> obj flame0)) + (format #t "~1Tflame1: #~%" (-> obj flame1)) + (format #t "~1Tflame2: #~%" (-> obj flame2)) + (format #t "~1Tgreen-flame: #~%" (-> obj green-flame)) + (format #t "~1Ttotem0: #~%" (-> obj totem0)) + (format #t "~1Ttotem1: #~%" (-> obj totem1)) + (label cfg-4) + obj + ) + +;; definition for function update-onintent-lights +;; WARN: Return type mismatch int vs none. +(defun update-onintent-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (set-vector! (-> v1-0 0 dir0 color) 0.822 0.694 0.613 1.0) + (set-vector! (-> v1-0 0 ambi color) 0.21 0.188 0.163 1.0) + ) + 0 + (none) + ) + +;; definition for function update-mood-onintent +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-onintent time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-onintent-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 3.0) + (update-mood-flames arg0 4 1 16 0.75 0.0009765625 4.0) + (update-mood-flames arg0 5 1 24 0.75 0.0009765625 2.0) + (update-mood-flames arg0 6 1 32 0.333 0.001953125 2.0) + (update-mood-flames arg0 7 1 40 0.75 0.0009765625 2.0) + ) + ) + 0 + (none) + ) + +;; definition of type oracle-states +(deftype oracle-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (blue-flame flames-state :inline :offset-assert 24) + (door-entity entity :offset-assert 32) + (door-current float :offset-assert 36) + (door-target float :offset-assert 40) + (purple-flag symbol :offset-assert 44) + (purple float :offset-assert 48) + (purple-noise float :offset-assert 52) + ) + :method-count-assert 9 + :size-assert #x38 + :flag-assert #x900000038 + ) + +;; definition for method 3 of type oracle-states +(defmethod inspect oracle-states ((obj oracle-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'oracle-states) + (format #t "~1Tflame0: #~%" (-> obj flame0)) + (format #t "~1Tflame1: #~%" (-> obj flame1)) + (format #t "~1Tflame2: #~%" (-> obj flame2)) + (format #t "~1Tblue-flame: #~%" (-> obj blue-flame)) + (format #t "~1Tdoor-entity: ~A~%" (-> obj door-entity)) + (format #t "~1Tdoor-current: ~f~%" (-> obj door-current)) + (format #t "~1Tdoor-target: ~f~%" (-> obj door-target)) + (format #t "~1Tpurple-flag: ~A~%" (-> obj purple-flag)) + (format #t "~1Tpurple: ~f~%" (-> obj purple)) + (format #t "~1Tpurple-noise: ~f~%" (-> obj purple-noise)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-oracle +(defun init-mood-oracle ((arg0 mood-context)) + (let ((v1-0 (the-as oracle-states (-> arg0 state)))) + (set! (-> v1-0 door-entity) #f) + (set! (-> v1-0 door-current) 0.0) + (set! (-> v1-0 door-target) 0.0) + (set! (-> v1-0 purple-flag) #f) + ) + #f + ) + +;; definition for function update-mood-oracle +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-oracle time-of-day-proc ((arg0 mood-context)) + (copy-mood-exterior-ambi arg0 #f) + (update-mood-interior arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((s5-0 (the-as oracle-states (-> arg0 state)))) + (cond + ((-> s5-0 door-entity) + (if (logtest? (-> s5-0 door-entity extra perm status) (entity-perm-status subtask-complete)) + (set! (-> s5-0 door-target) 1.0) + (set! (-> s5-0 door-target) 0.0) + ) + ) + (else + (set! (-> s5-0 door-entity) (entity-by-name "oracle-door-1")) + ) + ) + (when (not (paused?)) + (seek! (-> s5-0 door-current) (-> s5-0 door-target) (* 4.0 (-> self clock seconds-per-frame))) + (cond + ((-> s5-0 purple-flag) + (set! (-> s5-0 purple) (fmin 1.9 (+ (-> s5-0 purple) (* 2.0 (-> self clock seconds-per-frame))))) + (set! (-> s5-0 purple-noise) (rand-vu-float-range 0.0 (-> s5-0 purple))) + ) + (else + (set! (-> s5-0 purple) (fmax 0.0 (- (-> s5-0 purple) (* 2.0 (-> self clock seconds-per-frame))))) + (set! (-> s5-0 purple-noise) 0.0) + ) + ) + ) + (set! (-> arg0 times 0 w) (-> s5-0 door-current)) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 3.0) + (update-mood-flames arg0 4 1 16 0.75 0.0009765625 4.0) + (update-mood-flames arg0 5 1 24 0.75 0.0009765625 2.0) + (set! (-> arg0 times 6 w) (+ (-> s5-0 purple) (-> s5-0 purple-noise))) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-oracle-purple-flag! +(defun set-oracle-purple-flag! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'oracle))) + (when v1-1 + (set! (-> (the-as oracle-states (-> v1-1 mood-context state)) purple-flag) arg0) + arg0 + ) + ) + ) + +;; definition of type tomba-states +(deftype tomba-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (light light-state :inline :offset-assert 24) + (gem-light float :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type tomba-states +(defmethod inspect tomba-states ((obj tomba-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tomba-states) + (format #t "~1Tflame0: #~%" (-> obj flame0)) + (format #t "~1Tflame1: #~%" (-> obj flame1)) + (format #t "~1Tflame2: #~%" (-> obj flame2)) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tgem-light: ~f~%" (-> obj gem-light)) + (label cfg-4) + obj + ) + +;; definition for function update-tomba-lights +;; WARN: Return type mismatch int vs none. +(defun update-tomba-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 current-fog))) + (set! (-> v1-0 fog-color x) 0.0) + (set! (-> v1-0 fog-color y) 0.0) + (set! (-> v1-0 fog-color z) 0.0) + (set! (-> v1-0 fog-color w) 128.0) + ) + (let ((a1-0 (-> arg0 light-group)) + (s5-0 (-> arg0 light-group 1)) + ) + (let ((v1-1 (-> a1-0 0))) + (set! (-> v1-1 dir0 direction x) -0.69) + (set! (-> v1-1 dir0 direction y) 0.487) + (set! (-> v1-1 dir0 direction z) -0.53) + (set! (-> v1-1 dir0 direction w) 0.0) + ) + (set-vector! (-> a1-0 0 dir0 color) 0.878 0.7656 0.6875 1.0) + (set! (-> a1-0 0 dir0 extra x) 1.0) + (let ((v1-4 (-> a1-0 0 dir1))) + (set! (-> v1-4 direction x) 0.743) + (set! (-> v1-4 direction y) 0.51) + (set! (-> v1-4 direction z) 0.431) + (set! (-> v1-4 direction w) 0.0) + ) + (set-vector! (-> a1-0 0 dir1 color) 1.0 0.8046 0.648 1.0) + (set! (-> a1-0 0 dir1 extra x) 0.8) + (set-vector! (-> a1-0 0 ambi color) 0.3 0.2 0.1 1.0) + (set! (-> a1-0 0 ambi extra x) 0.55) + (mem-copy! (the-as pointer s5-0) (the-as pointer a1-0) 192) + (set! (-> s5-0 ambi extra x) 0.35) + ) + (cond + ((task-node-closed? (game-task-node tomb-boss-torches)) + ) + (else + (set-vector! (-> arg0 current-env-color) 0.0 0.0 0.0 0.0) + ) + ) + 0 + (none) + ) + +;; definition for function update-mood-tomba +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-tomba time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-tomba-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (when (not (task-node-closed? (game-task-node tomb-boss-torches))) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 2.0) + ) + (update-mood-flames arg0 4 2 16 0.5 0.001953125 2.0) + (update-mood-light arg0 6 24 0.8 0.2 19.0 0.0 1.0) + ) + ) + 0 + (none) + ) + +;; definition of type tombb-states +(deftype tombb-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (light light-state :inline :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type tombb-states +(defmethod inspect tombb-states ((obj tombb-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tombb-states) + (format #t "~1Tflame0: #~%" (-> obj flame0)) + (format #t "~1Tflame1: #~%" (-> obj flame1)) + (format #t "~1Tflame2: #~%" (-> obj flame2)) + (format #t "~1Tlight: #~%" (-> obj light)) + (label cfg-4) + obj + ) + +;; definition for function update-tombb-lights +;; WARN: Return type mismatch int vs none. +(defun update-tombb-lights ((arg0 mood-context)) + (update-tomba-lights arg0) + (let ((v1-0 (-> arg0 light-group 1))) + (let ((a0-2 (-> v1-0 dir0))) + (set! (-> a0-2 direction x) 0.0) + (set! (-> a0-2 direction y) 0.0) + (set! (-> a0-2 direction z) 1.0) + (set! (-> a0-2 direction w) 0.0) + ) + (set-vector! (-> v1-0 dir0 color) 1.6 1.07 0.725 1.0) + (set! (-> v1-0 dir0 extra x) 0.5) + (let ((a0-5 (-> v1-0 dir1))) + (set! (-> a0-5 direction x) -0.473) + (set! (-> a0-5 direction y) 0.707) + (set! (-> a0-5 direction z) -0.523) + (set! (-> a0-5 direction w) 0.0) + ) + (set-vector! (-> v1-0 dir1 color) 1.4 0.9 0.5 1.0) + (set! (-> v1-0 dir1 extra x) 0.55) + (let ((a0-8 (-> v1-0 dir2))) + (set! (-> a0-8 direction x) 0.473) + (set! (-> a0-8 direction y) 0.707) + (set! (-> a0-8 direction z) -0.523) + (set! (-> a0-8 direction w) 0.0) + ) + (set-vector! (-> v1-0 dir2 color) 1.4 0.9 0.7 1.0) + (set! (-> v1-0 dir2 extra x) 0.55) + (set-vector! (-> v1-0 ambi color) 0.4 0.2 0.2 1.0) + (set! (-> v1-0 ambi extra x) 0.2) + ) + 0 + (none) + ) + +;; definition for function update-mood-tombb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-tombb time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-tombb-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 2.0) + (update-mood-flames arg0 4 2 16 0.5 0.001953125 2.0) + (update-mood-light arg0 6 24 0.75 0.5 19.0 0.0 1.0) + ) + ) + 0 + (none) + ) + +;; definition of type tombc-states +(deftype tombc-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (electricity electricity-state :inline :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type tombc-states +(defmethod inspect tombc-states ((obj tombc-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tombc-states) + (format #t "~1Tflame0: #~%" (-> obj flame0)) + (format #t "~1Tflame1: #~%" (-> obj flame1)) + (format #t "~1Tflame2: #~%" (-> obj flame2)) + (format #t "~1Telectricity: #~%" (-> obj electricity)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-tombc +(defun init-mood-tombc ((arg0 mood-context)) + (let ((v1-0 (the-as tombc-states (-> arg0 state))) + (f0-0 1.0) + ) + (set! (-> v1-0 electricity scale) f0-0) + f0-0 + ) + ) + +;; definition for function update-mood-tombc +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-tombc time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-tomba-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 2.0) + (update-mood-flames arg0 4 2 16 0.5 0.001953125 2.0) + (update-mood-electricity arg0 6 24 0.8 1.0) + ) + ) + 0 + (none) + ) + +;; definition for function set-tombc-electricity-scale! +(defun set-tombc-electricity-scale! ((arg0 float)) + (let ((v1-1 (level-get *level* 'tombc))) + (when v1-1 + (let ((v1-2 (the-as tombc-states (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> v1-2 electricity scale) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition of type tombd-states +(deftype tombd-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (light light-state :inline :offset-assert 24) + (gem-light float :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type tombd-states +(defmethod inspect tombd-states ((obj tombd-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tombd-states) + (format #t "~1Tflame0: #~%" (-> obj flame0)) + (format #t "~1Tflame1: #~%" (-> obj flame1)) + (format #t "~1Tflame2: #~%" (-> obj flame2)) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tgem-light: ~f~%" (-> obj gem-light)) + (label cfg-4) + obj + ) + +;; definition for function update-tombd-lights +;; WARN: Return type mismatch int vs none. +(defun update-tombd-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 current-fog))) + (set! (-> v1-0 fog-color x) 0.0) + (set! (-> v1-0 fog-color y) 0.0) + (set! (-> v1-0 fog-color z) 0.0) + (set! (-> v1-0 fog-color w) 128.0) + ) + (let ((a1-1 (-> arg0 light-group)) + (gp-0 (-> arg0 light-group 1)) + ) + (let ((v1-1 (-> a1-1 0))) + (set! (-> v1-1 dir0 direction x) -0.69) + (set! (-> v1-1 dir0 direction y) 0.487) + (set! (-> v1-1 dir0 direction z) -0.53) + (set! (-> v1-1 dir0 direction w) 0.0) + ) + (set-vector! (-> a1-1 0 dir0 color) 0.85 0.7656 0.6875 1.0) + (set! (-> a1-1 0 dir0 extra x) 1.0) + (let ((v1-4 (-> a1-1 0 dir1))) + (set! (-> v1-4 direction x) 0.743) + (set! (-> v1-4 direction y) 0.51) + (set! (-> v1-4 direction z) 0.431) + (set! (-> v1-4 direction w) 0.0) + ) + (set-vector! (-> a1-1 0 dir1 color) 0.85 0.8046 0.7 1.0) + (set! (-> a1-1 0 dir1 extra x) 0.8) + (set-vector! (-> a1-1 0 ambi color) 0.3 0.2 0.1 1.0) + (set! (-> a1-1 0 ambi extra x) 0.55) + (mem-copy! (the-as pointer gp-0) (the-as pointer a1-1) 192) + (set! (-> gp-0 ambi extra x) 0.35) + ) + 0 + (none) + ) + +;; definition for function update-mood-tombd +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-tombd time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-tombd-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (when (not (task-node-closed? (game-task-node tomb-boss-torches))) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 2.0) + ) + (update-mood-flames arg0 4 2 16 0.5 0.001953125 2.0) + (update-mood-light arg0 6 24 0.8 0.2 19.0 0.0 1.0) + ) + ) + 0 + (none) + ) + +;; definition of type tombe-states +(deftype tombe-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (light light-state :inline :offset-assert 24) + (gem-light float :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type tombe-states +(defmethod inspect tombe-states ((obj tombe-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tombe-states) + (format #t "~1Tflame0: #~%" (-> obj flame0)) + (format #t "~1Tflame1: #~%" (-> obj flame1)) + (format #t "~1Tflame2: #~%" (-> obj flame2)) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tgem-light: ~f~%" (-> obj gem-light)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-tombe +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-tombe time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-tomba-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 2.0) + (update-mood-flames arg0 4 2 16 0.5 0.001953125 2.0) + (update-mood-light arg0 6 24 0.8 0.2 19.0 0.0 1.0) + ) + ) + 0 + (none) + ) + +;; definition of type tombboss-states +(deftype tombboss-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (flame2 flames-state :inline :offset-assert 16) + (light light-state :inline :offset-assert 24) + (gem-light float :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type tombboss-states +(defmethod inspect tombboss-states ((obj tombboss-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tombboss-states) + (format #t "~1Tflame0: #~%" (-> obj flame0)) + (format #t "~1Tflame1: #~%" (-> obj flame1)) + (format #t "~1Tflame2: #~%" (-> obj flame2)) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tgem-light: ~f~%" (-> obj gem-light)) + (label cfg-4) + obj + ) + +;; definition for function update-tombboss-lights +;; WARN: Return type mismatch int vs none. +(defun update-tombboss-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (let ((a1-0 (-> v1-0 0))) + (set! (-> a1-0 dir0 direction x) -0.671) + (set! (-> a1-0 dir0 direction y) 0.568) + (set! (-> a1-0 dir0 direction z) -0.474) + (set! (-> a1-0 dir0 direction w) 0.0) + ) + (set-vector! (-> v1-0 0 dir0 color) 0.7 0.5 0.25 1.0) + (set! (-> v1-0 0 dir0 extra x) 1.2) + (let ((a1-3 (-> v1-0 0 dir1))) + (set! (-> a1-3 direction x) 0.734) + (set! (-> a1-3 direction y) 0.678) + (set! (-> a1-3 direction z) -0.019) + (set! (-> a1-3 direction w) 0.0) + ) + (set-vector! (-> v1-0 0 dir1 color) 0.7 0.5 0.25 1.0) + (set! (-> v1-0 0 dir1 extra x) 0.9) + (set-vector! (-> v1-0 0 ambi color) 0.2 0.2 0.4 1.0) + (set! (-> v1-0 0 ambi extra x) 0.8) + ) + (let ((v1-2 (-> arg0 light-group 1))) + (let ((a1-8 (-> v1-2 dir0))) + (set! (-> a1-8 direction x) -0.823) + (set! (-> a1-8 direction y) 0.491) + (set! (-> a1-8 direction z) -0.283) + (set! (-> a1-8 direction w) 0.0) + ) + (set-vector! (-> v1-2 dir0 color) 0.878 0.7656 0.6875 1.0) + (set! (-> v1-2 dir0 extra x) 1.0) + (let ((a1-11 (-> v1-2 dir1))) + (set! (-> a1-11 direction x) 0.661) + (set! (-> a1-11 direction y) 0.411) + (set! (-> a1-11 direction z) -0.626) + (set! (-> a1-11 direction w) 0.0) + ) + (set-vector! (-> v1-2 dir1 color) 1.0 0.8046 0.648 1.0) + (set! (-> v1-2 dir1 extra x) 0.8) + (set-vector! (-> v1-2 ambi color) 0.375 0.0 0.2 1.0) + (set! (-> v1-2 ambi extra x) 0.332) + ) + (let ((v1-4 (-> arg0 light-group 2))) + (let ((a1-16 (-> v1-4 dir0))) + (set! (-> a1-16 direction x) -0.671) + (set! (-> a1-16 direction y) 0.568) + (set! (-> a1-16 direction z) -0.474) + (set! (-> a1-16 direction w) 0.0) + ) + (set-vector! (-> v1-4 dir0 color) 0.7 0.5 0.25 1.0) + (set! (-> v1-4 dir0 extra x) 1.0) + (let ((a1-19 (-> v1-4 dir1))) + (set! (-> a1-19 direction x) 0.734) + (set! (-> a1-19 direction y) 0.678) + (set! (-> a1-19 direction z) -0.019) + (set! (-> a1-19 direction w) 0.0) + ) + (set-vector! (-> v1-4 dir1 color) 0.7 0.5 0.25 1.0) + (set! (-> v1-4 dir1 extra x) 0.7) + (set-vector! (-> v1-4 ambi color) 0.2 0.2 0.4 1.0) + (set! (-> v1-4 ambi extra x) 0.4) + ) + (let ((v1-6 (-> arg0 light-group 3))) + (let ((a1-24 (-> v1-6 dir0))) + (set! (-> a1-24 direction x) -0.671) + (set! (-> a1-24 direction y) 0.568) + (set! (-> a1-24 direction z) -0.474) + (set! (-> a1-24 direction w) 0.0) + ) + (set-vector! (-> v1-6 dir0 color) 0.7 0.5 0.25 1.0) + (set! (-> v1-6 dir0 extra x) 1.2) + (let ((a1-27 (-> v1-6 dir1))) + (set! (-> a1-27 direction x) 0.734) + (set! (-> a1-27 direction y) 0.678) + (set! (-> a1-27 direction z) -0.019) + (set! (-> a1-27 direction w) 0.0) + ) + (set-vector! (-> v1-6 dir1 color) 0.7 0.5 0.25 1.0) + (set! (-> v1-6 dir1 extra x) 0.9) + (set-vector! (-> v1-6 ambi color) 0.2 0.2 0.4 1.0) + (set! (-> v1-6 ambi extra x) 0.8) + ) + (let ((v1-8 (-> arg0 light-group 4))) + (let ((a0-1 (-> v1-8 dir0))) + (set! (-> a0-1 direction x) -0.69) + (set! (-> a0-1 direction y) 0.487) + (set! (-> a0-1 direction z) -0.53) + (set! (-> a0-1 direction w) 0.0) + ) + (set-vector! (-> v1-8 dir0 color) 0.878 0.7656 0.6875 1.0) + (set! (-> v1-8 dir0 extra x) 1.0) + (let ((a0-4 (-> v1-8 dir1))) + (set! (-> a0-4 direction x) 0.743) + (set! (-> a0-4 direction y) 0.51) + (set! (-> a0-4 direction z) 0.431) + (set! (-> a0-4 direction w) 0.0) + ) + (set-vector! (-> v1-8 dir1 color) 1.0 0.8046 0.648 1.0) + (set! (-> v1-8 dir1 extra x) 0.8) + (set-vector! (-> v1-8 ambi color) 0.4 0.2 0.2 1.0) + (set! (-> v1-8 ambi extra x) 0.4) + ) + 0 + (none) + ) + +;; definition for function update-mood-tombboss +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-tombboss time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-tombboss-lights arg0) + (let ((s5-0 (new 'static 'vector :x 790528.0 :y -262144.0 :z 6053888.0 :w 274432.0))) + (if (< (vector-vector-distance (target-pos 0) s5-0) (-> s5-0 w)) + (mem-copy! (the-as pointer (-> arg0 light-group)) (the-as pointer (-> arg0 light-group 3)) 192) + (mem-copy! (the-as pointer (-> arg0 light-group)) (the-as pointer (-> arg0 light-group 4)) 192) + ) + ) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((v1-4 (-> arg0 state))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 7 w) (the-as float (-> v1-4 8))) + ) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (update-mood-flames arg0 3 1 8 0.75 0.0009765625 2.0) + (update-mood-flames arg0 4 2 16 0.5 0.001953125 2.0) + (update-mood-light arg0 6 24 0.8 0.2 19.0 0.0 1.0) + ) + ) + 0 + (none) + ) + +;; definition for function set-tombboss-gem-light! +(defun set-tombboss-gem-light! ((arg0 float)) + (let ((v1-1 (level-get *level* 'tombboss))) + (when v1-1 + (let ((v1-2 (the-as tombboss-states (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> v1-2 gem-light) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition of type fortress-states +(deftype fortress-states (structure) + ((pulse pulse-state :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type fortress-states +(defmethod inspect fortress-states ((obj fortress-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'fortress-states) + (format #t "~1Tpulse: #~%" (-> obj pulse)) + (label cfg-4) + obj + ) + +;; definition for function update-fortress-lights +;; WARN: Return type mismatch int vs none. +(defun update-fortress-lights ((arg0 mood-context)) + (let ((a3-0 (-> arg0 light-group)) + (a2-0 (-> arg0 light-group 1)) + (a1-0 (-> arg0 light-group 2)) + (v1-0 (-> arg0 light-group 3)) + ) + (set-vector! (-> a3-0 0 dir0 color) 0.822 0.694 0.65 1.0) + (set-vector! (-> a3-0 0 ambi color) 0.35 0.425 0.4 1.0) + (set! (-> a3-0 0 ambi extra x) 0.8) + (let ((a0-4 (-> a2-0 dir0))) + (set! (-> a0-4 direction x) 0.0) + (set! (-> a0-4 direction y) 1.0) + (set! (-> a0-4 direction z) 0.0) + (set! (-> a0-4 direction w) 0.0) + ) + (set-vector! (-> a2-0 dir0 color) 0.822 0.694 0.65 1.0) + (set-vector! (-> a2-0 ambi color) 0.35 0.425 0.4 1.0) + (set! (-> a2-0 dir0 extra x) 0.7) + (set! (-> a2-0 ambi extra x) 0.8) + (let ((a0-9 (-> a1-0 dir0))) + (set! (-> a0-9 direction x) 0.0) + (set! (-> a0-9 direction y) 1.0) + (set! (-> a0-9 direction z) 0.0) + (set! (-> a0-9 direction w) 0.0) + ) + (set-vector! (-> a1-0 dir0 color) 0.822 0.694 0.65 1.0) + (set-vector! (-> a1-0 ambi color) 0.35 0.425 0.4 1.0) + (set! (-> a1-0 dir0 extra x) 0.4) + (set! (-> a1-0 ambi extra x) 0.4) + (let ((a0-14 (-> v1-0 dir0))) + (set! (-> a0-14 direction x) 0.0) + (set! (-> a0-14 direction y) 1.0) + (set! (-> a0-14 direction z) 0.0) + (set! (-> a0-14 direction w) 0.0) + ) + (set-vector! (-> v1-0 dir0 color) 0.822 0.5 0.65 1.0) + (set-vector! (-> v1-0 ambi color) 0.35 0.425 0.4 1.0) + (set! (-> v1-0 dir0 extra x) 0.25) + (set! (-> v1-0 ambi extra x) 0.2) + ) + 0 + (none) + ) + +;; definition for function update-mood-fortress +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-fortress time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-fortress-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-pulse arg0 7 0 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 0.0) + ) + ) + 0 + (none) + ) + +;; definition of type fordumpa-states +(deftype fordumpa-states (structure) + ((turret-value float 4 :offset-assert 0) + (pulse pulse-state :inline :offset-assert 16) + (electricity electricity-state :inline :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; definition for method 3 of type fordumpa-states +(defmethod inspect fordumpa-states ((obj fordumpa-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'fordumpa-states) + (format #t "~1Tturret-value[4] @ #x~X~%" (-> obj turret-value)) + (format #t "~1Tpulse: #~%" (-> obj pulse)) + (format #t "~1Telectricity: #~%" (-> obj electricity)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-fordumpa +(defun init-mood-fordumpa ((arg0 mood-context)) + (let ((v1-0 (the-as fordumpa-states (-> arg0 state))) + (f0-0 0.0) + ) + (set! (-> v1-0 electricity scale) f0-0) + f0-0 + ) + ) + +;; definition for function update-mood-fordumpa +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-fordumpa time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-fortress-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-pulse arg0 7 16 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 0.0) + (update-mood-electricity arg0 6 20 0.8 1.0) + (let ((s5-0 (the-as fordumpa-states (-> arg0 state)))) + (set! (-> arg0 times 2 w) (-> s5-0 turret-value 0)) + (set! (-> arg0 times 3 w) (-> s5-0 turret-value 1)) + (set! (-> arg0 times 4 w) (-> s5-0 turret-value 2)) + (set! (-> arg0 times 5 w) (-> s5-0 turret-value 3)) + (when (not (paused?)) + (dotimes (v1-7 4) + (set! (-> s5-0 turret-value v1-7) (fmax 0.0 (+ -0.2 (-> s5-0 turret-value v1-7)))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-fordumpa-turret-flash! +(defun set-fordumpa-turret-flash! ((arg0 int)) + (let ((v1-1 (level-get *level* 'fordumpa))) + (when v1-1 + (let ((v1-2 (the-as fordumpa-states (-> v1-1 mood-context state))) + (f0-0 1.0) + ) + (set! (-> v1-2 turret-value arg0) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition for function set-fordumpa-electricity-scale! +(defun set-fordumpa-electricity-scale! ((arg0 float)) + (let ((v1-1 (level-get *level* 'fordumpa))) + (when v1-1 + (let ((v1-2 (the-as fordumpa-states (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> v1-2 electricity scale) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition of type fordumpc-states +(deftype fordumpc-states (structure) + ((light-flag symbol :offset-assert 0) + (pulse0 pulse-state :inline :offset-assert 4) + (pulse1 pulse-state :inline :offset-assert 8) + (strobe strobe-state :inline :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type fordumpc-states +(defmethod inspect fordumpc-states ((obj fordumpc-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'fordumpc-states) + (format #t "~1Tlight-flag: ~A~%" (-> obj light-flag)) + (format #t "~1Tpulse0: #~%" (-> obj pulse0)) + (format #t "~1Tpulse1: #~%" (-> obj pulse1)) + (format #t "~1Tstrobe: #~%" (-> obj strobe)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-fordumpc +(defun init-mood-fordumpc ((arg0 mood-context)) + (set! (-> (the-as fordumpc-states (-> arg0 state)) light-flag) #f) + #f + ) + +;; definition for function update-mood-fordumpc +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-fordumpc time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-fortress-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + ((begin + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-pulse arg0 3 4 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 0.0) + (-> arg0 state 0) + ) + (set! (-> arg0 times 2 w) 0.0) + (update-mood-pulse arg0 4 8 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 16384.0) + (update-mood-strobe arg0 5 12 85 (* 16.0 (-> self clock seconds-per-frame))) + ) + (else + (set! (-> arg0 times 2 w) 1.0) + (set! (-> arg0 times 4 w) 0.0) + (set! (-> arg0 times 5 w) 0.0) + ) + ) + 0 + (none) + ) + +;; definition for function set-fordumpc-light-flag! +(defun set-fordumpc-light-flag! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'fordumpc))) + (when v1-1 + (set! (-> (the-as fordumpc-states (-> v1-1 mood-context state)) light-flag) arg0) + arg0 + ) + ) + ) + +;; definition of type forresca-states +(deftype forresca-states (structure) + ((pulse pulse-state :inline :offset-assert 0) + (electricity electricity-state 2 :inline :offset 4) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type forresca-states +(defmethod inspect forresca-states ((obj forresca-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'forresca-states) + (format #t "~1Tpulse: #~%" (-> obj pulse)) + (format #t "~1Telectricity[2] @ #x~X~%" (-> obj electricity)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-forresca +(defun init-mood-forresca ((arg0 mood-context)) + (let ((v1-0 (the-as forresca-states (-> arg0 state)))) + (set! (-> v1-0 electricity 0 scale) 1.0) + (let ((f0-1 1.0)) + (set! (-> v1-0 electricity 1 scale) f0-1) + f0-1 + ) + ) + ) + +;; definition for function update-mood-forresca +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-forresca time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-fortress-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-electricity arg0 5 4 0.8 1.0) + (update-mood-electricity arg0 6 20 0.8 1.0) + (update-mood-pulse arg0 7 0 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 0.0) + ) + ) + 0 + (none) + ) + +;; definition for function set-forresca-electricity-scale! +(defun set-forresca-electricity-scale! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'forresca))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as forresca-states v1-2) electricity arg1 scale) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition of type forrescb-states +(deftype forrescb-states (structure) + ((electricity electricity-state 2 :inline :offset-assert 0) + (turret float 4 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type forrescb-states +(defmethod inspect forrescb-states ((obj forrescb-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'forrescb-states) + (format #t "~1Telectricity[2] @ #x~X~%" (-> obj electricity)) + (format #t "~1Tturret[4] @ #x~X~%" (-> obj turret)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-forrescb +(defun init-mood-forrescb ((arg0 mood-context)) + (let ((v1-0 (the-as forrescb-states (-> arg0 state)))) + (set! (-> v1-0 electricity 0 scale) 1.0) + (let ((f0-1 1.0)) + (set! (-> v1-0 electricity 1 scale) f0-1) + f0-1 + ) + ) + ) + +;; definition for function update-mood-forrescb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-forrescb time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-fortress-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as forrescb-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-electricity arg0 6 0 0.8 1.0) + (update-mood-electricity arg0 7 16 0.8 1.0) + (set! (-> arg0 times 2 w) (-> gp-0 turret 0)) + (set! (-> arg0 times 3 w) (-> gp-0 turret 1)) + (set! (-> arg0 times 4 w) (-> gp-0 turret 2)) + (set! (-> arg0 times 5 w) (-> gp-0 turret 3)) + (when (not (paused?)) + (dotimes (v1-5 4) + (set! (-> gp-0 turret v1-5) (fmax 0.0 (+ -0.2 (-> gp-0 turret v1-5)))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-forrescb-turret-flash! +(defun set-forrescb-turret-flash! ((arg0 int)) + (let ((v1-1 (level-get *level* 'forrescb))) + (when v1-1 + (let ((v1-2 (-> v1-1 mood-context state)) + (f0-0 1.0) + ) + (set! (-> (the-as forrescb-states (+ (* arg0 4) (the-as int v1-2))) turret 0) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition for function set-forrescb-electricity-scale! +(defun set-forrescb-electricity-scale! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'forrescb))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as forrescb-states v1-2) electricity arg1 scale) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition of type prison-states +(deftype prison-states (structure) + ((pulse float :offset-assert 0) + (angle float :offset-assert 4) + (torture float :offset-assert 8) + (torture-flag symbol :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type prison-states +(defmethod inspect prison-states ((obj prison-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'prison-states) + (format #t "~1Tpulse: ~f~%" (-> obj pulse)) + (format #t "~1Tangle: ~f~%" (-> obj angle)) + (format #t "~1Ttorture: ~f~%" (-> obj torture)) + (format #t "~1Ttorture-flag: ~A~%" (-> obj torture-flag)) + (label cfg-4) + obj + ) + +;; definition for function update-prison-lights +;; WARN: Return type mismatch int vs none. +(defun update-prison-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (set-vector! (-> v1-0 0 dir0 color) 0.0 0.0 0.0 1.0) + (set-vector! (-> v1-0 0 ambi color) 0.2 0.2 0.2 1.0) + ) + (set! (-> arg0 light-group 0 dir0 extra x) 0.0) + 0 + (none) + ) + +;; definition for function init-mood-prison +(defun init-mood-prison ((arg0 mood-context)) + (let ((v1-0 (the-as prison-states (-> arg0 state)))) + (set! (-> v1-0 torture-flag) #f) + (let ((f0-0 0.0)) + (set! (-> v1-0 torture) f0-0) + f0-0 + ) + ) + ) + +;; definition for function update-mood-prison +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-prison time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-prison-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as prison-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 3 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) (-> gp-0 pulse)) + (if (task-node-closed? (game-task-node fortress-save-friends-resolution)) + (set! (-> arg0 times 7 w) 1.0) + (set! (-> arg0 times 7 w) 0.0) + ) + (set! (-> arg0 times 2 w) (-> gp-0 torture)) + (when (not (paused?)) + (set! (-> gp-0 pulse) (+ 1.125 (* 0.125 (cos (-> gp-0 angle))))) + (let ((f0-14 (+ (-> gp-0 angle) (* 32768.0 (-> self clock seconds-per-frame))))) + (set! (-> gp-0 angle) (- f0-14 (* (the float (the int (/ f0-14 65536.0))) 65536.0))) + ) + (if (-> gp-0 torture-flag) + (seek! (-> gp-0 torture) 1.0 (-> self clock seconds-per-frame)) + (seek! (-> gp-0 torture) 0.0 (-> self clock seconds-per-frame)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function update-mood-copy-prison +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-prison time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'prison))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +;; definition for function set-prison-torture-flag! +(defun set-prison-torture-flag! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'prison))) + (when v1-1 + (set! (-> (the-as prison-states (-> v1-1 mood-context state)) torture-flag) arg0) + arg0 + ) + ) + ) + +;; definition of type under-states +(deftype under-states (structure) + ((flame0 flames-state :inline :offset-assert 0) + (flame1 flames-state :inline :offset-assert 8) + (rot float :offset-assert 16) + (rot2 float :offset-assert 20) + (time float :offset-assert 24) + (laser float :offset-assert 28) + (fog-interp float :offset-assert 32) + (flicker float :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +;; definition for method 3 of type under-states +(defmethod inspect under-states ((obj under-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'under-states) + (format #t "~1Tflame0: #~%" (-> obj flame0)) + (format #t "~1Tflame1: #~%" (-> obj flame1)) + (format #t "~1Trot: ~f~%" (-> obj rot)) + (format #t "~1Trot2: ~f~%" (-> obj rot2)) + (format #t "~1Ttime: ~f~%" (-> obj time)) + (format #t "~1Tlaser: ~f~%" (-> obj laser)) + (format #t "~1Tfog-interp: ~f~%" (-> obj fog-interp)) + (format #t "~1Tflicker: ~f~%" (-> obj flicker)) + (label cfg-4) + obj + ) + +;; definition for function update-under-lights +;; INFO: Used lq/sq +(defun update-under-lights ((arg0 mood-context)) + (local-vars (sv-80 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let* ((v1-0 (the-as under-states (-> arg0 state))) + (a2-0 (new 'stack-no-clear 'matrix)) + (a1-0 (-> arg0 current-fog)) + (f0-0 (-> v1-0 fog-interp)) + ) + (set-vector! (-> a2-0 vector 0) 0.0 40.2343 59.5468 128.0) + (set-vector! (-> a2-0 vector 1) 0.0 524288.0 200.0 8.0) + (set-vector! (-> a2-0 vector 2) 0.0 40.2343 59.5468 128.0) + (set-vector! (-> a1-0 fog-color) 0.0 40.2343 59.5468 128.0) + (set-vector! (-> a1-0 fog-dists) 524288.0 1048576.0 255.0 8.0) + (set-vector! (-> a1-0 erase-color) 0.0 40.2343 59.5468 128.0) + (set-vector! (-> a1-0 erase-color) 0.0 40.2343 59.5468 128.0) + (vector4-array-lerp! + (the-as (inline-array vector4) a1-0) + (the-as (inline-array vector4) a1-0) + (the-as (inline-array vector4) a2-0) + f0-0 + 3 + ) + ) + (let ((s2-0 (-> arg0 light-group)) + (s3-0 (-> arg0 light-group 1)) + (s4-0 (-> arg0 light-group 2)) + (s5-0 (-> arg0 light-group 3)) + (gp-1 (-> arg0 light-group 4)) + ) + (let ((s1-0 (new 'static 'vector :x 0.8645 :z -0.5294))) + (set! sv-80 (new 'static 'vector :x -2.0 :z 1950.0)) + (let ((v0-1 (target-pos 0)) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-10 s0-0)) + (.lvf vf4 (&-> v0-1 quad)) + (.lvf vf5 (&-> sv-80 quad)) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-10 quad) vf6) + ) + (vector-normalize! s0-0 1.0) + (cond + ((>= (vector-dot s1-0 s0-0) 0.0) + (set-vector! (-> s2-0 0 dir0 color) 0.6 0.5 0.7 1.0) + (set-vector! (-> s2-0 0 ambi color) 0.3 0.3 0.3 1.0) + ) + (else + (set-vector! (-> s2-0 0 dir0 color) 0.2 0.2 0.4 1.0) + (set-vector! (-> s2-0 0 ambi color) 0.2 0.2 0.2 1.0) + ) + ) + ) + ) + (let ((v1-16 (-> s3-0 dir0))) + (set! (-> v1-16 direction x) 0.0) + (set! (-> v1-16 direction y) 1.0) + (set! (-> v1-16 direction z) 0.0) + (set! (-> v1-16 direction w) 0.0) + ) + (set-vector! (-> s3-0 dir0 color) 0.0 0.0 0.0 1.0) + (set-vector! (-> s3-0 ambi color) 1.0 1.0 1.0 1.0) + (set! (-> s3-0 dir0 extra x) 0.0) + (set! (-> s3-0 dir1 extra x) 0.0) + (set! (-> s3-0 dir2 extra x) 0.0) + (set! (-> s3-0 ambi extra x) 1.0) + (let ((v1-20 (-> s4-0 dir0))) + (set! (-> v1-20 direction x) 0.0) + (set! (-> v1-20 direction y) -1.0) + (set! (-> v1-20 direction z) 0.0) + (set! (-> v1-20 direction w) 0.0) + ) + (let ((v1-21 (-> s4-0 dir1))) + (set! (-> v1-21 direction x) 0.0) + (set! (-> v1-21 direction y) 1.0) + (set! (-> v1-21 direction z) 0.0) + (set! (-> v1-21 direction w) 0.0) + ) + (set-vector! (-> s4-0 dir0 color) 0.3 0.4 0.6 1.0) + (set-vector! (-> s4-0 dir1 color) 0.3 0.4 0.6 1.0) + (set-vector! (-> s4-0 ambi color) 0.15 0.3 0.6 1.0) + (set! (-> s4-0 dir0 extra x) 1.0) + (set! (-> s4-0 dir1 extra x) 1.0) + (set! (-> s4-0 dir2 extra x) 0.0) + (set! (-> s4-0 ambi extra x) 1.0) + (let ((v1-28 (-> s5-0 dir0))) + (set! (-> v1-28 direction x) 0.0) + (set! (-> v1-28 direction y) 1.0) + (set! (-> v1-28 direction z) 0.0) + (set! (-> v1-28 direction w) 0.0) + ) + (set-vector! (-> s5-0 dir0 color) 0.3 0.25 0.35 1.0) + (set-vector! (-> s5-0 ambi color) 0.3 0.3 0.3 1.0) + (set! (-> s5-0 dir0 extra x) 0.65) + (set! (-> s5-0 dir1 extra x) 0.0) + (set! (-> s5-0 dir2 extra x) 0.0) + (set! (-> s5-0 ambi extra x) 1.0) + (let ((v1-33 (-> gp-1 dir0))) + (set! (-> v1-33 direction x) 0.0) + (set! (-> v1-33 direction y) 1.0) + (set! (-> v1-33 direction z) 0.0) + (set! (-> v1-33 direction w) 0.0) + ) + (set-vector! (-> gp-1 dir0 color) 0.3 0.25 0.45 1.0) + (set-vector! (-> gp-1 ambi color) 0.3 0.3 0.3 1.0) + (set! (-> gp-1 dir0 extra x) 0.5) + (set! (-> gp-1 dir1 extra x) 0.0) + (set! (-> gp-1 dir2 extra x) 0.0) + (let ((f0-90 0.5)) + (set! (-> gp-1 ambi extra x) f0-90) + f0-90 + ) + ) + ) + ) + +;; definition for function update-mood-under +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-under time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-under-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as under-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-caustics arg0 6 (-> gp-0 rot) 0.0 0.75 0.5) + (update-mood-caustics arg0 7 (-> gp-0 rot) 21845.334 0.75 0.5) + (update-mood-caustics arg0 3 (-> gp-0 rot2) 43690.668 0.75 0.25) + (update-mood-flames arg0 2 1 0 0.75 0.0009765625 2.0) + (let ((f0-6 (fmin 1.0 (+ (-> gp-0 flicker) (-> gp-0 laser))))) + (set! (-> arg0 times 4 w) f0-6) + (set! (-> arg0 times 5 w) (- 1.0 f0-6)) + ) + (when (movie?) + (set! (-> arg0 times 4 w) 0.0) + (set! (-> arg0 times 5 w) 0.0) + ) + (when (not (paused?)) + (+! (-> gp-0 time) (* 300.0 (-> self clock seconds-per-frame))) + (+! (-> gp-0 rot) (* 32768.0 (-> self clock seconds-per-frame))) + (+! (-> gp-0 rot2) (* 16384.0 (-> self clock seconds-per-frame))) + (set! (-> gp-0 flicker) (rand-vu-float-range 0.0 0.1)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function update-mood-copy-underb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-underb time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'underb))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +;; definition for function set-under-laser! +(defun set-under-laser! ((arg0 float)) + (let ((v1-1 (level-get *level* 'under))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as under-states v1-2) laser) arg0) + ) + ) + ) + (let ((v1-4 (level-get *level* 'underb))) + (when v1-4 + (let ((v1-5 (the-as object (-> v1-4 mood-context state))) + (f0-1 arg0) + ) + (set! (-> (the-as under-states v1-5) laser) f0-1) + f0-1 + ) + ) + ) + ) + +;; definition for function set-under-fog-interp! +(defun set-under-fog-interp! ((arg0 float)) + (let ((v1-1 (level-get *level* 'under))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as under-states v1-2) fog-interp) arg0) + ) + ) + ) + (let ((v1-4 (level-get *level* 'underb))) + (when v1-4 + (let ((v1-5 (the-as object (-> v1-4 mood-context state))) + (f0-1 arg0) + ) + (set! (-> (the-as under-states v1-5) fog-interp) f0-1) + f0-1 + ) + ) + ) + ) + +;; definition of type gungame-states +(deftype gungame-states (structure) + ((florescent florescent-state :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 + ) + +;; definition for method 3 of type gungame-states +(defmethod inspect gungame-states ((obj gungame-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gungame-states) + (format #t "~1Tflorescent: #~%" (-> obj florescent)) + (label cfg-4) + obj + ) + +;; definition for function update-gungame-lights +;; WARN: Return type mismatch int vs none. +(defun update-gungame-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (let ((a0-1 (-> v1-0 0))) + (set! (-> a0-1 dir0 direction x) 0.0) + (set! (-> a0-1 dir0 direction y) 0.955) + (set! (-> a0-1 dir0 direction z) 0.3) + (set! (-> a0-1 dir0 direction w) 1.0) + ) + (set-vector! (-> v1-0 0 dir0 color) 1.0 1.0 0.7 1.0) + (set-vector! (-> v1-0 0 ambi color) 0.65 0.589 0.406 1.0) + ) + 0 + (none) + ) + +;; definition for function update-mood-gungame +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-gungame time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-gungame-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + ) + ) + 0 + (none) + ) + +;; definition of type dig1-states +(deftype dig1-states (structure) + ((pulse0 pulse-state :inline :offset-assert 0) + (pulse1 pulse-state :inline :offset-assert 4) + (explosion float :offset-assert 8) + (drillbit float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type dig1-states +(defmethod inspect dig1-states ((obj dig1-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dig1-states) + (format #t "~1Tpulse0: #~%" (-> obj pulse0)) + (format #t "~1Tpulse1: #~%" (-> obj pulse1)) + (format #t "~1Texplosion: ~f~%" (-> obj explosion)) + (format #t "~1Tdrillbit: ~f~%" (-> obj drillbit)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-dig1 +(defun init-mood-dig1 ((arg0 mood-context)) + (let ((v1-0 (the-as object (-> arg0 state))) + (f0-0 0.0) + ) + (set! (-> (the-as dig1-states v1-0) explosion) f0-0) + f0-0 + ) + ) + +;; definition for function update-dig1-lights +;; WARN: Return type mismatch int vs none. +(defun update-dig1-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 current-fog))) + (set-vector! (-> v1-0 fog-color) 205.0 90.0 90.0 128.0) + (set-vector! (-> v1-0 fog-dists) 294912.0 1802240.0 255.0 187.5) + (set-vector! (-> v1-0 erase-color) 54.2635 23.823 23.823 128.0) + ) + (set-vector! (-> arg0 current-env-color) 0.0 0.0 0.0 0.0) + (let ((t2-0 (-> arg0 light-group)) + (t1-0 (-> arg0 light-group 1)) + (t0-0 (-> arg0 light-group 2)) + (a3-0 (-> arg0 light-group 3)) + (a2-8 (-> arg0 light-group 4)) + (a1-6 (-> arg0 light-group 5)) + (v1-3 (-> arg0 light-group 6)) + ) + (let ((a0-1 (-> t2-0 0))) + (set! (-> a0-1 dir0 direction x) 0.0) + (set! (-> a0-1 dir0 direction y) 0.955) + (set! (-> a0-1 dir0 direction z) 0.3) + (set! (-> a0-1 dir0 direction w) 1.0) + ) + (set-vector! (-> t2-0 0 dir0 color) 0.9 0.6 0.6 1.0) + (let ((a0-3 (-> t2-0 0 dir1))) + (set! (-> a0-3 direction x) 0.0) + (set! (-> a0-3 direction y) -1.0) + (set! (-> a0-3 direction z) 0.0) + (set! (-> a0-3 direction w) 1.0) + ) + (set-vector! (-> t2-0 0 dir1 color) 0.9 0.3 0.3 1.0) + (set-vector! (-> t2-0 0 ambi color) 0.65 0.589 0.406 1.0) + (set! (-> t2-0 0 dir0 extra x) 0.9) + (set! (-> t2-0 0 dir1 extra x) 0.3) + (set! (-> t2-0 0 ambi extra x) 0.45) + (let ((a0-9 (-> t1-0 dir0))) + (set! (-> a0-9 direction x) 0.0) + (set! (-> a0-9 direction y) 0.955) + (set! (-> a0-9 direction z) 0.3) + (set! (-> a0-9 direction w) 1.0) + ) + (set-vector! (-> t1-0 dir0 color) 1.0 0.6 0.6 1.0) + (let ((a0-11 (-> t1-0 dir1))) + (set! (-> a0-11 direction x) 0.0) + (set! (-> a0-11 direction y) -0.955) + (set! (-> a0-11 direction z) -0.3) + (set! (-> a0-11 direction w) 1.0) + ) + (set-vector! (-> t1-0 dir1 color) 0.9 0.4 0.3 1.0) + (set-vector! (-> t1-0 ambi color) 0.65 0.55 0.25 1.0) + (set! (-> t1-0 dir0 extra x) 0.2) + (set! (-> t1-0 dir1 extra x) 0.85) + (set! (-> t1-0 ambi extra x) 0.5) + (let ((a0-17 (-> t0-0 dir0))) + (set! (-> a0-17 direction x) 0.0) + (set! (-> a0-17 direction y) 0.955) + (set! (-> a0-17 direction z) 0.3) + (set! (-> a0-17 direction w) 1.0) + ) + (set-vector! (-> t0-0 dir0 color) 0.8 0.5 0.4 1.0) + (set-vector! (-> t0-0 ambi color) 0.6 0.4 0.3 1.0) + (set! (-> t0-0 dir0 extra x) 0.5) + (set! (-> t0-0 ambi extra x) 0.4) + (let ((a0-22 (-> a3-0 dir0))) + (set! (-> a0-22 direction x) 0.5299) + (set! (-> a0-22 direction y) 0.8479) + (set! (-> a0-22 direction z) 0.0) + (set! (-> a0-22 direction w) 1.0) + ) + (set-vector! (-> a3-0 dir0 color) 1.0 1.0 1.0 1.0) + (let ((a0-24 (-> a3-0 dir1))) + (set! (-> a0-24 direction x) 0.0) + (set! (-> a0-24 direction y) -1.0) + (set! (-> a0-24 direction z) 0.0) + (set! (-> a0-24 direction w) 1.0) + ) + (set-vector! (-> a3-0 dir1 color) 0.9 0.3 0.3 1.0) + (set-vector! (-> a3-0 ambi color) 0.5 0.5 0.5 1.0) + (set! (-> a3-0 dir0 extra x) 1.0) + (set! (-> a3-0 dir1 extra x) 0.5) + (set! (-> a3-0 ambi extra x) 0.6) + (let ((a0-30 (-> a2-8 dir0))) + (set! (-> a0-30 direction x) 0.3) + (set! (-> a0-30 direction y) 0.955) + (set! (-> a0-30 direction z) 0.0) + (set! (-> a0-30 direction w) 1.0) + ) + (set-vector! (-> a2-8 dir0 color) 1.0 1.0 1.0 1.0) + (let ((a0-32 (-> a2-8 dir1))) + (set! (-> a0-32 direction x) 0.0) + (set! (-> a0-32 direction y) -1.0) + (set! (-> a0-32 direction z) 0.0) + (set! (-> a0-32 direction w) 1.0) + ) + (set-vector! (-> a2-8 dir1 color) 0.9 0.3 0.3 1.0) + (set-vector! (-> a2-8 ambi color) 0.5 0.5 0.5 1.0) + (set! (-> a2-8 dir0 extra x) 1.0) + (set! (-> a2-8 dir1 extra x) 0.5) + (set! (-> a2-8 ambi extra x) 0.6) + (let ((a0-38 (-> a1-6 dir0))) + (set! (-> a0-38 direction x) 0.3) + (set! (-> a0-38 direction y) 0.955) + (set! (-> a0-38 direction z) 0.0) + (set! (-> a0-38 direction w) 1.0) + ) + (set-vector! (-> a1-6 dir0 color) 1.0 1.0 1.0 1.0) + (let ((a0-40 (-> a1-6 dir1))) + (set! (-> a0-40 direction x) 0.0) + (set! (-> a0-40 direction y) -1.0) + (set! (-> a0-40 direction z) 0.0) + (set! (-> a0-40 direction w) 1.0) + ) + (set-vector! (-> a1-6 dir1 color) 0.8 0.5 0.3 1.0) + (set-vector! (-> a1-6 ambi color) 0.5 0.4 0.4 1.0) + (set! (-> a1-6 dir0 extra x) 1.0) + (set! (-> a1-6 dir1 extra x) 1.4) + (set! (-> a1-6 ambi extra x) 0.6) + (let ((a0-46 (-> v1-3 dir0))) + (set! (-> a0-46 direction x) 0.3) + (set! (-> a0-46 direction y) 0.955) + (set! (-> a0-46 direction z) 0.0) + (set! (-> a0-46 direction w) 1.0) + ) + (set-vector! (-> v1-3 dir0 color) 0.8 0.9 0.5 1.0) + (let ((a0-48 (-> v1-3 dir1))) + (set! (-> a0-48 direction x) 0.5299) + (set! (-> a0-48 direction y) 0.8479) + (set! (-> a0-48 direction z) 0.0) + (set! (-> a0-48 direction w) 1.0) + ) + (set-vector! (-> v1-3 dir1 color) 0.6 0.4 0.3 1.0) + (set-vector! (-> v1-3 ambi color) 0.6 0.5 0.4 1.0) + (set! (-> v1-3 dir0 extra x) 0.6) + (set! (-> v1-3 dir1 extra x) 0.55) + (set! (-> v1-3 ambi extra x) 0.5) + ) + 0 + (none) + ) + +;; definition for function update-mood-dig1 +;; INFO: Used lq/sq +;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-dig1 time-of-day-proc ((arg0 mood-context)) + (local-vars (sv-16 float) (sv-32 float)) + (update-mood-interior arg0) + (update-dig1-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as dig1-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (let ((s4-0 update-mood-pulse) + (s3-0 arg0) + (s2-0 2) + (s1-0 0) + (s0-0 0.85) + ) + (set! sv-16 0.15) + (let ((t1-0 (* 182.04445 (-> self clock seconds-per-frame) (rand-vu-float-range 60.0 200.0))) + (t2-0 0.0) + ) + (s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0 t2-0) + ) + ) + (let ((s4-1 update-mood-pulse) + (s3-1 arg0) + (s2-1 3) + (s1-1 4) + (s0-1 0.85) + ) + (set! sv-32 0.15) + (let ((t1-1 (* 182.04445 (-> self clock seconds-per-frame) (rand-vu-float-range 120.0 180.0))) + (t2-1 16384.0) + ) + (s4-1 s3-1 s2-1 s1-1 s0-1 sv-32 t1-1 t2-1) + ) + ) + (set! (-> arg0 times 6 w) 1.0) + (if (not (task-node-closed? (game-task-node dig-knock-down-resolution))) + (set! (-> arg0 times 5 w) (-> gp-0 drillbit)) + ) + (when (!= (-> gp-0 explosion) 0.0) + (set! (-> arg0 times 7 w) (-> gp-0 explosion)) + (let ((f0-15 (- 1.0 (* 0.5 (-> gp-0 explosion))))) + (set! (-> arg0 times 2 w) (* (-> arg0 times 2 w) f0-15)) + (set! (-> arg0 times 3 w) (* (-> arg0 times 3 w) f0-15)) + (set! (-> arg0 times 0 w) (* (-> arg0 times 0 w) f0-15)) + (set! (-> arg0 times 1 w) (* (-> arg0 times 1 w) f0-15)) + ) + ) + (when (not (paused?)) + (set! (-> gp-0 drillbit) (rand-vu-float-range 0.5 1.0)) + (seek! (-> gp-0 explosion) 0.0 (* 2.5 (-> self clock seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-dig1-explosion! +(defun set-dig1-explosion! ((arg0 float)) + (let ((v1-1 (level-get *level* 'dig1))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 1.9921875) + ) + (set! (-> (the-as dig1-states v1-2) explosion) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition of type vortex-states +(deftype vortex-states (structure) + ((time float :offset-assert 0) + (level float :offset-assert 4) + (delta float :offset-assert 8) + (scale float :offset-assert 12) + (flash float :offset-assert 16) + (num int32 :offset-assert 20) + (white symbol :offset-assert 24) + (white-count float :offset-assert 28) + (pos vector :inline :offset-assert 32) + (dir vector :inline :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type vortex-states +(defmethod inspect vortex-states ((obj vortex-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vortex-states) + (format #t "~1Ttime: ~f~%" (-> obj time)) + (format #t "~1Tlevel: ~f~%" (-> obj level)) + (format #t "~1Tdelta: ~f~%" (-> obj delta)) + (format #t "~1Tscale: ~f~%" (-> obj scale)) + (format #t "~1Tflash: ~f~%" (-> obj flash)) + (format #t "~1Tnum: ~D~%" (-> obj num)) + (format #t "~1Twhite: ~A~%" (-> obj white)) + (format #t "~1Twhite-count: ~f~%" (-> obj white-count)) + (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "~1Tdir: #~%" (-> obj dir)) + (label cfg-4) + obj + ) + +;; definition for function update-vortex-lights +;; WARN: Return type mismatch int vs none. +(defun update-vortex-lights ((arg0 mood-context)) + (set-vector! (-> arg0 current-env-color) 96.0 48.0 196.0 255.0) + 0 + (none) + ) + +;; definition for function update-mood-vortex +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-vortex time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (update-vortex-lights arg0) + (let ((a1-0 (-> arg0 light-group)) + (s5-0 (-> arg0 light-group 1)) + (gp-1 (the-as vortex-states (-> arg0 state))) + ) + (set-vector! (-> a1-0 0 ambi color) 0.2 0.2 0.5 1.0) + (set! (-> a1-0 0 ambi extra x) 1.0) + (set-vector! (-> a1-0 0 dir0 color) 0.5 0.4 0.8 1.0) + (set! (-> a1-0 0 dir0 direction quad) (-> gp-1 dir quad)) + (set! (-> a1-0 0 dir0 extra x) (-> gp-1 level)) + (set-vector! (-> a1-0 0 dir1 color) 0.0 0.0 0.0 0.0) + (let ((v1-5 (-> a1-0 0 dir1))) + (set! (-> v1-5 direction x) 0.0) + (set! (-> v1-5 direction y) 0.0) + (set! (-> v1-5 direction z) 1.0) + (set! (-> v1-5 direction w) 0.0) + ) + (set! (-> a1-0 0 dir1 extra x) 0.0) + (set! (-> a1-0 0 dir2 extra x) 0.0) + (mem-copy! (the-as pointer s5-0) (the-as pointer a1-0) 192) + (cond + ((-> gp-1 white) + (set-vector! (-> s5-0 dir1 color) 1.0 1.0 1.0 1.0) + (set-vector! (-> s5-0 dir2 color) 1.0 1.0 1.0 1.0) + (let ((v1-9 (-> s5-0 dir1))) + (set! (-> v1-9 direction x) 0.0) + (set! (-> v1-9 direction y) -0.707) + (set! (-> v1-9 direction z) 0.707) + (set! (-> v1-9 direction w) 0.0) + ) + (let ((v1-10 (-> s5-0 dir2))) + (set! (-> v1-10 direction x) 0.0) + (set! (-> v1-10 direction y) 0.707) + (set! (-> v1-10 direction z) 0.707) + (set! (-> v1-10 direction w) 0.0) + ) + (set! (-> s5-0 dir1 extra x) (fmin 1.0 (* 0.21739131 (-> gp-1 white-count)))) + (set! (-> s5-0 dir2 extra x) (-> s5-0 dir1 extra x)) + ) + (else + (set-vector! (-> s5-0 dir1 color) 0.1 0.3 0.5 1.0) + (let ((v1-15 (-> s5-0 dir1))) + (set! (-> v1-15 direction x) 0.0) + (set! (-> v1-15 direction y) -0.177) + (set! (-> v1-15 direction z) 0.984) + (set! (-> v1-15 direction w) 0.0) + ) + (set! (-> s5-0 dir1 extra x) 1.0) + ) + ) + (when (not (paused?)) + (if (-> gp-1 white) + (+! (-> gp-1 white-count) (-> *display* base-clock seconds-per-frame)) + ) + (cond + ((< 0.0 (-> gp-1 flash)) + (set! (-> gp-1 level) (-> gp-1 flash)) + (set-vector! (-> gp-1 dir) 0.0 0.0 1.0 0.0) + (set! (-> gp-1 flash) (- (-> gp-1 flash) (* 0.5 (-> *display* base-clock seconds-per-frame)))) + (set! (-> gp-1 time) 0.0) + ) + (else + (when (>= 0.0 (-> gp-1 time)) + (set! (-> gp-1 num) (the int (rand-vu-float-range 0.0 4.0))) + (set! (-> gp-1 scale) (rand-vu-float-range 0.75 1.5)) + (if (< (-> gp-1 num) 3) + (set! (-> gp-1 time) (rand-vu-float-range 0.25 0.5)) + (set! (-> gp-1 time) (rand-vu-float-range 0.0 0.5)) + ) + (set-vector! + (-> gp-1 pos) + (rand-vu-float-range -8192.0 8192.0) + (rand-vu-float-range -8192.0 8192.0) + 102400.0 + 0.0 + ) + (set! (-> gp-1 delta) (/ 204800.0 (-> gp-1 time))) + ) + (when (< (-> gp-1 num) 3) + (let ((f30-0 (vector-length (-> gp-1 pos)))) + (set! (-> gp-1 dir quad) (-> gp-1 pos quad)) + (vector-normalize! (-> gp-1 dir) 1.0) + (set! (-> gp-1 level) (* (-> gp-1 scale) (- 1.0 (fmin 1.0 (* 0.000009765625 f30-0))))) + ) + (set! (-> gp-1 pos z) (- (-> gp-1 pos z) (* (-> gp-1 delta) (-> *display* base-clock seconds-per-frame)))) + ) + (set! (-> gp-1 time) (- (-> gp-1 time) (-> *display* base-clock seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-vortex-flash! +(defun set-vortex-flash! ((arg0 float)) + (let ((v1-1 (level-get *level* 'introcst))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as vortex-states v1-2) flash) 1.0) + ) + ) + ) + (let ((v1-4 (level-get *level* 'lintcstb))) + (when v1-4 + (let ((v1-5 (the-as object (-> v1-4 mood-context state))) + (f0-1 1.0) + ) + (set! (-> (the-as vortex-states v1-5) flash) f0-1) + f0-1 + ) + ) + ) + ) + +;; definition for function set-vortex-white! +(defun set-vortex-white! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'introcst))) + (when v1-1 + (let ((v1-2 (the-as vortex-states (-> v1-1 mood-context state)))) + (set! (-> v1-2 white) arg0) + (set! (-> v1-2 white-count) 0.0) + ) + ) + ) + (let ((v1-4 (level-get *level* 'lintcstb))) + (when v1-4 + (let ((v1-5 (the-as vortex-states (-> v1-4 mood-context state)))) + (set! (-> v1-5 white) arg0) + (let ((f0-1 0.0)) + (set! (-> v1-5 white-count) f0-1) + f0-1 + ) + ) + ) + ) + ) + +;; definition of type nestb-states +(deftype nestb-states (structure) + ((pulse pulse-state :inline :offset-assert 0) + (rot float :offset-assert 4) + (purple float :offset-assert 8) + (purple-noise float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type nestb-states +(defmethod inspect nestb-states ((obj nestb-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nestb-states) + (format #t "~1Tpulse: #~%" (-> obj pulse)) + (format #t "~1Trot: ~f~%" (-> obj rot)) + (format #t "~1Tpurple: ~f~%" (-> obj purple)) + (format #t "~1Tpurple-noise: ~f~%" (-> obj purple-noise)) + (label cfg-4) + obj + ) + +;; definition for function update-nestb-lights +;; WARN: Return type mismatch pointer vs none. +(defun update-nestb-lights ((arg0 mood-context)) + (let ((gp-0 (-> arg0 light-group 1))) + (let ((v1-0 (-> arg0 current-fog))) + (set! (-> v1-0 fog-color x) 37.5625) + (set! (-> v1-0 fog-color y) 18.875) + (set! (-> v1-0 fog-color z) 70.0) + (set! (-> v1-0 fog-color w) 128.0) + ) + (set-vector! (-> arg0 current-fog fog-dists) 0.0 819200.0 255.0 16.0) + (set-vector! (-> arg0 current-fog erase-color) 33.806248 16.9875 63.0 128.0) + (let ((v1-4 (level-get *level* 'nest))) + (if v1-4 + (mem-copy! (the-as pointer gp-0) (the-as pointer (-> v1-4 mood-context light-group)) 192) + (mem-copy! (the-as pointer gp-0) (the-as pointer (-> *level* default-level mood-context light-group)) 192) + ) + ) + ) + (none) + ) + +;; definition for function update-mood-nestb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-nestb time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) + (copy-mood-exterior-ambi arg0 #f) + (update-mood-interior arg0) + (update-nestb-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as nestb-states (-> arg0 state)))) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-caustics arg0 2 (-> gp-1 rot) 10922.667 0.75 0.25) + (update-mood-caustics arg0 3 (-> gp-1 rot) 0.0 0.75 0.25) + (update-mood-pulse arg0 4 0 0.875 0.125 (* 196608.0 (-> self clock seconds-per-frame)) 0.0) + (set! (-> arg0 times 5 w) (+ (-> gp-1 purple) (-> gp-1 purple-noise))) + (when (not (paused?)) + (seek! (-> gp-1 purple) 0.0 (* 4.0 (-> self clock seconds-per-frame))) + (set! (-> gp-1 purple-noise) (rand-vu-float-range 0.0 (* 0.2 (-> gp-1 purple)))) + (+! (-> gp-1 rot) (* 16384.0 (-> self clock seconds-per-frame))) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-nestb-purple! +(defun set-nestb-purple! ((arg0 float)) + (let ((v1-1 (level-get *level* 'nestb))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as nestb-states v1-2) purple) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition for function get-nestb-purple +(defun get-nestb-purple () + (let ((v1-1 (level-get *level* 'nestb))) + (if v1-1 + (-> (the-as nestb-states (-> v1-1 mood-context state)) purple) + 0.0 + ) + ) + ) + +;; definition of type consiteb-states +(deftype consiteb-states (structure) + ((flicker float :offset-assert 0) + (flicker-count float :offset-assert 4) + (flicker-state int32 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type consiteb-states +(defmethod inspect consiteb-states ((obj consiteb-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'consiteb-states) + (format #t "~1Tflicker: ~f~%" (-> obj flicker)) + (format #t "~1Tflicker-count: ~f~%" (-> obj flicker-count)) + (format #t "~1Tflicker-state: ~D~%" (-> obj flicker-state)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-consiteb +;; WARN: Return type mismatch int vs none. +(defun init-mood-consiteb ((arg0 mood-context)) + (let ((v1-0 (the-as consiteb-states (-> arg0 state)))) + (set! (-> v1-0 flicker) 1.0) + (set! (-> v1-0 flicker-state) 0) + ) + 0 + (none) + ) + +;; definition for function update-mood-consiteb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-consiteb time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) + (copy-mood-exterior-ambi arg0 #f) + (update-mood-interior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as consiteb-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 0.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 2 w) (-> gp-1 flicker)) + (when (not (paused?)) + (let ((v1-9 (-> gp-1 flicker-state))) + (cond + ((zero? v1-9) + (set! (-> gp-1 flicker) (rand-vu-float-range 0.2 0.4)) + (set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (-> self clock seconds-per-frame))) + (when (>= 0.0 (-> gp-1 flicker-count)) + (set! (-> gp-1 flicker-count) (rand-vu-float-range 0.25 1.0)) + (set! (-> gp-1 flicker-state) 1) + ) + ) + ((= v1-9 1) + (set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (-> self clock seconds-per-frame))) + (when (>= 0.0 (-> gp-1 flicker-count)) + (set! (-> gp-1 flicker-count) (rand-vu-float-range 0.1 0.5)) + (set! (-> gp-1 flicker-state) 2) + ) + ) + ((= v1-9 2) + (set! (-> gp-1 flicker) (rand-vu-float-range 0.25 0.75)) + (set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (-> self clock seconds-per-frame))) + (when (>= 0.0 (-> gp-1 flicker-count)) + (set! (-> gp-1 flicker-count) (rand-vu-float-range 0.25 1.0)) + (set! (-> gp-1 flicker-state) 3) + ) + ) + (else + (set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (-> self clock seconds-per-frame))) + (when (>= 0.0 (-> gp-1 flicker-count)) + (set! (-> gp-1 flicker-count) (rand-vu-float-range 0.1 0.5)) + (set! (-> gp-1 flicker-state) 0) + 0 + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type castle-states +(deftype castle-states (structure) + ((electricity electricity-state :inline :offset-assert 0) + (pulse pulse-state 2 :inline :offset-assert 8) + (rot float :offset-assert 40) + (robot-rot float :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type castle-states +(defmethod inspect castle-states ((obj castle-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'castle-states) + (format #t "~1Telectricity: #~%" (-> obj electricity)) + (format #t "~1Tpulse[2] @ #x~X~%" (-> obj pulse)) + (format #t "~1Trot: ~f~%" (-> obj rot)) + (format #t "~1Trobot-rot: ~f~%" (-> obj robot-rot)) + (label cfg-4) + obj + ) + +;; definition for function update-castle-lights +;; WARN: Return type mismatch int vs none. +(defun update-castle-lights ((arg0 mood-context)) + (let ((a2-0 (-> arg0 light-group)) + (a1-0 (-> arg0 light-group 1)) + (v1-0 (-> arg0 light-group 2)) + ) + (let ((a3-0 (-> arg0 current-fog))) + (set! (-> a3-0 fog-color x) 95.625) + (set! (-> a3-0 fog-color y) 135.4687) + (set! (-> a3-0 fog-color z) 69.0625) + (set! (-> a3-0 fog-color w) 1.0) + ) + (set-vector! (-> arg0 current-fog fog-dists) 253952.0 901120.0 255.0 147.0) + (set-vector! (-> arg0 current-fog erase-color) 0.0 0.0 0.0 128.0) + (set-vector! (-> arg0 current-env-color) 96.0 96.0 96.0 255.0) + (let ((a3-4 (-> a2-0 0))) + (set! (-> a3-4 dir0 direction x) 0.6499) + (set! (-> a3-4 dir0 direction y) 0.7134) + (set! (-> a3-4 dir0 direction z) 0.2619) + (set! (-> a3-4 dir0 direction w) 1.0) + ) + (set-vector! (-> a2-0 0 dir0 color) 0.65 0.575 0.575 1.0) + (let ((a3-6 (-> a2-0 0 dir1))) + (set! (-> a3-6 direction x) -0.6499) + (set! (-> a3-6 direction y) 0.7134) + (set! (-> a3-6 direction z) -0.2619) + (set! (-> a3-6 direction w) 1.0) + ) + (set-vector! (-> a2-0 0 dir1 color) 0.75 0.6 0.5 1.0) + (set-vector! (-> a2-0 0 ambi color) 0.2 0.2 0.25 1.0) + (set! (-> a2-0 0 dir0 extra x) 0.65) + (set! (-> a2-0 0 dir1 extra x) 1.0) + (set! (-> a2-0 0 ambi extra x) 0.7) + (let ((a2-1 (-> a1-0 dir0))) + (set! (-> a2-1 direction x) 0.0) + (set! (-> a2-1 direction y) 1.0) + (set! (-> a2-1 direction z) 0.0) + (set! (-> a2-1 direction w) 1.0) + ) + (set-vector! (-> a1-0 dir0 color) 0.7 0.8 0.5 1.0) + (let ((a2-3 (-> a1-0 dir1))) + (set! (-> a2-3 direction x) 0.5299) + (set! (-> a2-3 direction y) -0.8479) + (set! (-> a2-3 direction z) 0.0) + (set! (-> a2-3 direction w) 1.0) + ) + (set-vector! (-> a1-0 dir1 color) 0.5 0.6 0.0 1.0) + (let ((a2-5 (-> a1-0 dir2))) + (set! (-> a2-5 direction x) -0.5299) + (set! (-> a2-5 direction y) -0.8479) + (set! (-> a2-5 direction z) 0.0) + (set! (-> a2-5 direction w) 1.0) + ) + (set-vector! (-> a1-0 dir2 color) 0.5 0.6 0.0 1.0) + (set-vector! (-> a1-0 ambi color) 0.2 0.2 0.25 1.0) + (set! (-> a1-0 dir0 extra x) 0.7) + (set! (-> a1-0 dir1 extra x) 0.8) + (set! (-> a1-0 dir2 extra x) 0.8) + (set! (-> a1-0 ambi extra x) 0.7) + (let ((a1-1 (-> v1-0 dir0))) + (set! (-> a1-1 direction x) 0.0) + (set! (-> a1-1 direction y) 0.717) + (set! (-> a1-1 direction z) 0.717) + (set! (-> a1-1 direction w) 1.0) + ) + (set-vector! (-> v1-0 dir0 color) 0.5 0.5 0.7 1.0) + (let ((a1-3 (-> v1-0 dir1))) + (set! (-> a1-3 direction x) 0.0) + (set! (-> a1-3 direction y) 0.717) + (set! (-> a1-3 direction z) -0.717) + (set! (-> a1-3 direction w) 1.0) + ) + (set-vector! (-> v1-0 dir1 color) 0.5 0.5 0.8 1.0) + (set-vector! (-> v1-0 ambi color) 0.2 0.2 0.25 1.0) + (set! (-> v1-0 dir0 extra x) (-> arg0 times 4 w)) + (set! (-> v1-0 dir1 extra x) (-> arg0 times 5 w)) + (set! (-> v1-0 ambi extra x) 0.75) + ) + 0 + (none) + ) + +;; definition for function init-mood-castle +(defun init-mood-castle ((arg0 mood-context)) + (let ((v1-0 (the-as object (-> arg0 state))) + (f0-0 1.0) + ) + (set! (-> (the-as castle-states v1-0) electricity scale) f0-0) + f0-0 + ) + ) + +;; definition for function update-mood-castle +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-castle time-of-day-proc ((arg0 mood-context)) + (update-mood-interior arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((s5-0 (the-as castle-states (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (update-mood-caustics arg0 2 (-> s5-0 rot) 0.0 0.8 0.5) + (update-mood-caustics arg0 3 (-> s5-0 rot) 32768.0 0.8 0.5) + (let ((f0-7 (+ 0.75 (* 0.25 (sin (-> s5-0 robot-rot)))))) + (set! (-> arg0 times 6 x) f0-7) + (set! (-> arg0 times 6 y) f0-7) + ) + (set! (-> arg0 times 6 w) 1.0) + (update-mood-pulse arg0 4 8 1.15 0.15 (* 43690.668 (-> self clock seconds-per-frame)) 0.0) + (update-mood-pulse arg0 5 24 1.3 0.2 (* 54613.332 (-> self clock seconds-per-frame)) 0.0) + (update-mood-electricity arg0 7 0 0.9 1.0) + (when (not (paused?)) + (+! (-> s5-0 rot) (* 13107.2 (-> self clock seconds-per-frame))) + (+! (-> s5-0 robot-rot) (* 32768.0 (-> self clock seconds-per-frame))) + ) + ) + ) + ) + (update-castle-lights arg0) + 0 + (none) + ) + +;; definition for function set-castle-electricity-scale! +(defun set-castle-electricity-scale! ((arg0 float)) + (let ((v1-1 (level-get *level* 'castle))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as castle-states v1-2) electricity scale) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition of type garage-states +(deftype garage-states (structure) + () + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + +;; definition for method 3 of type garage-states +(defmethod inspect garage-states ((obj garage-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'garage-states) + (label cfg-4) + obj + ) + +;; definition for function init-mood-garage +(defun init-mood-garage ((arg0 mood-context)) + (-> arg0 state) + #f + ) + +;; definition for function update-garage-lights +;; WARN: Return type mismatch int vs none. +(defun update-garage-lights ((arg0 mood-context)) + (let ((a1-0 (-> *level* default-level mood-context)) + (a0-1 (-> arg0 current-fog)) + ) + (mem-copy! (the-as pointer a0-1) (the-as pointer a1-0) 48) + ) + (let ((s4-0 (-> *level* default-level mood-context light-group)) + (a1-1 (-> arg0 light-group)) + (s5-0 (-> arg0 light-group 1)) + (gp-1 (-> arg0 light-group 2)) + ) + (mem-copy! (the-as pointer s5-0) (the-as pointer a1-1) 192) + (set! (-> s5-0 dir0 extra x) 0.5) + (set! (-> s5-0 ambi extra x) 0.0) + (mem-copy! (the-as pointer gp-1) (the-as pointer s4-0) 192) + (set! (-> gp-1 dir0 extra x) 0.0) + (set! (-> gp-1 dir1 extra x) 0.0) + (set! (-> gp-1 dir2 extra x) 0.0) + ) + 0 + (none) + ) + +;; definition for function update-mood-garage +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-garage time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) + (copy-mood-exterior-ambi arg0 #f) + (update-mood-interior arg0) + (update-garage-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (set! (-> arg0 times 6 w) 0.75) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + ) + 0 + (none) + ) + +;; definition for function update-mood-copy-garage +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-garage time-of-day-proc ((arg0 mood-context)) + (let ((v1-1 (level-get *level* 'garage))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +;; definition of type palshaft-states +(deftype palshaft-states (structure) + () + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + +;; definition for method 3 of type palshaft-states +(defmethod inspect palshaft-states ((obj palshaft-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'palshaft-states) + (label cfg-4) + obj + ) + +;; definition for function update-mood-palshaft +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-palshaft time-of-day-proc ((arg0 mood-context)) + (copy-mood-exterior-ambi arg0 #f) + (update-mood-interior arg0) + (if (< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + (set! (-> arg0 times 1 w) 1.0) + ) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc new file mode 100644 index 0000000000..4c8feed7b1 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc @@ -0,0 +1,2168 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function update-mood-default +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-default time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + 0 + (none) + ) + +;; definition for function get-sphere-interp +;; INFO: Used lq/sq +(defun get-sphere-interp ((arg0 sphere) (arg1 vector) (arg2 float) (arg3 float)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + 0.0 + (set! (-> v1-0 quad) (-> arg0 quad)) + (vector-! v1-0 arg1 v1-0) + (let ((f1-0 (vector-length v1-0))) + (/ (fmax 0.0 (fmin (- f1-0 arg2) arg3)) arg3) + ) + ) + ) + +;; definition of type ruins-states +(deftype ruins-states (structure) + ((light light-state :inline :offset-assert 0) + (spec-0 sp-field-init-spec :offset-assert 8) + (spec-1 sp-field-init-spec :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type ruins-states +(defmethod inspect ruins-states ((obj ruins-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ruins-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tspec-0: #~%" (-> obj spec-0)) + (format #t "~1Tspec-1: #~%" (-> obj spec-1)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-ruins +;; WARN: Return type mismatch sp-field-init-spec vs none. +(defun init-mood-ruins ((arg0 mood-context)) + (let ((gp-0 (the-as ruins-states (-> arg0 state)))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (let ((a0-1 (-> *part-id-table* 1))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-0) (get-field-spec-by-id a0-1 (sp-field-id spt-a))) + ) + ) + (let ((a0-2 (-> *part-id-table* 2))) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 spec-1) (get-field-spec-by-id a0-2 (sp-field-id spt-a))) + ) + ) + ) + (none) + ) + +;; definition for function update-mood-ruins +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ruins time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as (pointer float) (-> arg0 state)))) + (update-mood-light arg0 6 0 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> (the-as ruins-states gp-1) spec-0)) + (set! (-> (the-as ruins-states gp-1) spec-0 initial-valuef) + (* 32.0 (-> (the-as ruins-states gp-1) light fade)) + ) + ) + (if (nonzero? (-> (the-as ruins-states gp-1) spec-1)) + (set! (-> (the-as ruins-states gp-1) spec-1 initial-valuef) + (* 8.0 (-> (the-as ruins-states gp-1) light fade)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type strip-states +(deftype strip-states (structure) + ((light0 light-state :inline :offset-assert 0) + (light1 light-state :inline :offset-assert 8) + (spec-0 sp-field-init-spec :offset-assert 16) + (spec-1 sp-field-init-spec :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type strip-states +(defmethod inspect strip-states ((obj strip-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'strip-states) + (format #t "~1Tlight0: #~%" (-> obj light0)) + (format #t "~1Tlight1: #~%" (-> obj light1)) + (format #t "~1Tspec-0: #~%" (-> obj spec-0)) + (format #t "~1Tspec-1: #~%" (-> obj spec-1)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-strip +;; WARN: Return type mismatch sp-field-init-spec vs uint. +(defun init-mood-strip ((arg0 mood-context)) + (let ((gp-0 (the-as strip-states (-> arg0 state)))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (let ((a0-1 (-> *part-id-table* 3))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-0) (get-field-spec-by-id a0-1 (sp-field-id spt-a))) + ) + ) + (let ((a0-2 (-> *part-id-table* 4))) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (the-as uint (when (nonzero? a0-2) + (let ((v0-1 (get-field-spec-by-id a0-2 (sp-field-id spt-a)))) + (set! (-> gp-0 spec-1) v0-1) + v0-1 + ) + ) + ) + ) + ) + ) + +;; definition for function update-mood-strip +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-strip time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (set! (-> arg0 times 5 w) 1.0) + (let ((s4-1 (the-as (pointer float) (-> arg0 state)))) + (if (task-complete? *game-info* (game-task strip-grenade)) + (update-mood-light arg0 6 0 0.875 0.25 8.0 0.0 2.0) + (update-mood-light arg0 6 0 0.875 0.25 20.0 0.0 2.0) + ) + (update-mood-light arg0 7 8 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> (the-as strip-states s4-1) spec-0)) + (set! (-> (the-as strip-states s4-1) spec-0 initial-valuef) + (* 32.0 (-> (the-as strip-states s4-1) light1 fade)) + ) + ) + (if (nonzero? (-> (the-as strip-states s4-1) spec-1)) + (set! (-> (the-as strip-states s4-1) spec-1 initial-valuef) + (* 8.0 (-> (the-as strip-states s4-1) light1 fade)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type ctywide-states +(deftype ctywide-states (structure) + ((light light-state :inline :offset-assert 0) + (flame flames-state :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xf + :flag-assert #x90000000f + ) + +;; definition for method 3 of type ctywide-states +(defmethod inspect ctywide-states ((obj ctywide-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ctywide-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tflame: #~%" (-> obj flame)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-ctywide +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctywide time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 2 8 0.5 0.0009765625 1.5) + ) + 0 + (none) + ) + +;; definition for function update-mood-copy-ctywide +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-ctywide time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((v1-1 (level-get *level* 'ctywide))) + (cond + ((and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + (else + (update-mood-ctywide arg0 arg1 arg2) + (if (or (>= arg1 18.0) (>= 6.0 arg1)) + (set! (-> arg0 times 5 w) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type ctyind-states +(deftype ctyind-states (structure) + ((light light-state :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type ctyind-states +(defmethod inspect ctyind-states ((obj ctyind-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ctyind-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-ctyind +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyind time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (set! (-> arg0 times 6 w) 1.0) + (let ((f0-1 0.5)) + (let ((f1-0 1.0)) + (cond + ((or (>= 6.0 arg1) (>= arg1 18.0)) + (set! f0-1 f1-0) + ) + ((and (< 6.0 arg1) (< arg1 7.0)) + (+! f0-1 (* (- f1-0 f0-1) (- 7.0 arg1))) + ) + ((and (< 17.0 arg1) (< arg1 18.0)) + (+! f0-1 (* (- f1-0 f0-1) (+ -17.0 arg1))) + ) + ) + ) + (set! (-> arg0 times 7 w) f0-1) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + ) + 0 + (none) + ) + +;; definition of type ctysluma-states +(deftype ctysluma-states (structure) + ((light light-state :inline :offset-assert 0) + (neon light-state :inline :offset-assert 8) + (flame flames-state :inline :offset-assert 16) + (spec-0 sp-field-init-spec :offset-assert 24) + (spec-1 sp-field-init-spec :offset-assert 28) + (neon-min-bright float :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type ctysluma-states +(defmethod inspect ctysluma-states ((obj ctysluma-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ctysluma-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tneon: #~%" (-> obj neon)) + (format #t "~1Tflame: #~%" (-> obj flame)) + (format #t "~1Tspec-0: #~%" (-> obj spec-0)) + (format #t "~1Tspec-1: #~%" (-> obj spec-1)) + (format #t "~1Tneon-min-bright: ~f~%" (-> obj neon-min-bright)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-ctysluma +(defun init-mood-ctysluma ((arg0 mood-context)) + (let ((gp-0 (the-as ctysluma-states (-> arg0 state)))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (let ((a0-1 (-> *part-id-table* 5))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-0) (get-field-spec-by-id a0-1 (sp-field-id spt-a))) + ) + ) + (let ((a0-2 (-> *part-id-table* 6))) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 spec-1) (get-field-spec-by-id a0-2 (sp-field-id spt-a))) + ) + ) + (let ((f0-0 (rand-vu-float-range 0.8 1.0))) + (set! (-> gp-0 neon-min-bright) f0-0) + f0-0 + ) + ) + ) + +;; definition for function update-mood-ctysluma +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctysluma time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (!= arg2 -1) + (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as ctysluma-states (-> arg0 state)))) + (update-mood-flames arg0 6 1 16 0.5 0.001953125 2.0) + (update-mood-light arg0 7 8 (-> gp-1 neon-min-bright) 0.0 arg1 32.0 2.0) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> gp-1 spec-0)) + (set! (-> gp-1 spec-0 initial-valuef) (* 32.0 (-> gp-1 light fade))) + ) + (if (nonzero? (-> gp-1 spec-1)) + (set! (-> gp-1 spec-1 initial-valuef) (* 8.0 (-> gp-1 light fade))) + ) + (if (not (paused?)) + (set! (-> gp-1 neon-min-bright) (rand-vu-float-range 0.8 1.0)) + ) + ) + ) + 0 + (none) + ) + +;; definition of type ctyslumb-states +(deftype ctyslumb-states (structure) + ((light light-state :inline :offset-assert 0) + (flame flames-state :inline :offset-assert 8) + (spec-0 sp-field-init-spec :offset-assert 16) + (spec-1 sp-field-init-spec :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type ctyslumb-states +(defmethod inspect ctyslumb-states ((obj ctyslumb-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ctyslumb-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tflame: #~%" (-> obj flame)) + (format #t "~1Tspec-0: #~%" (-> obj spec-0)) + (format #t "~1Tspec-1: #~%" (-> obj spec-1)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-ctyslumb +;; WARN: Return type mismatch sp-field-init-spec vs uint. +(defun init-mood-ctyslumb ((arg0 mood-context)) + (let ((gp-0 (-> arg0 state))) + (set! (-> gp-0 4) (the-as uint 0)) + (set! (-> gp-0 5) (the-as uint 0)) + (let ((a0-1 (-> *part-id-table* 7))) + (set! (-> gp-0 4) (the-as uint 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 4) (the-as uint (get-field-spec-by-id a0-1 (sp-field-id spt-a)))) + ) + ) + (let ((a0-2 (-> *part-id-table* 8))) + (set! (-> gp-0 5) (the-as uint 0)) + (the-as uint (when (nonzero? a0-2) + (let ((v0-1 (get-field-spec-by-id a0-2 (sp-field-id spt-a)))) + (set! (-> gp-0 5) (the-as uint v0-1)) + v0-1 + ) + ) + ) + ) + ) + ) + +;; definition for function update-mood-ctyslumb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyslumb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as ctyslumb-states (-> arg0 state)))) + (update-mood-flames arg0 6 1 8 0.5 0.001953125 2.0) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 7 w) 1.0) + (if (nonzero? (-> s5-1 spec-0)) + (set! (-> s5-1 spec-0 initial-valuef) (* 32.0 (-> s5-1 light fade))) + ) + (if (nonzero? (-> s5-1 spec-1)) + (set! (-> s5-1 spec-1 initial-valuef) (* 8.0 (-> s5-1 light fade))) + ) + ) + ) + 0 + (none) + ) + +;; definition of type ctyslumc-states +(deftype ctyslumc-states (structure) + ((light light-state :inline :offset-assert 0) + (spec-0 sp-field-init-spec :offset-assert 8) + (spec-1 sp-field-init-spec :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type ctyslumc-states +(defmethod inspect ctyslumc-states ((obj ctyslumc-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ctyslumc-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tspec-0: #~%" (-> obj spec-0)) + (format #t "~1Tspec-1: #~%" (-> obj spec-1)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-ctyslumc +;; WARN: Return type mismatch sp-field-init-spec vs none. +(defun init-mood-ctyslumc ((arg0 mood-context)) + (let ((gp-0 (the-as ctyslumc-states (-> arg0 state)))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (let ((a0-1 (-> *part-id-table* 9))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-0) (get-field-spec-by-id a0-1 (sp-field-id spt-a))) + ) + ) + (let ((a0-2 (-> *part-id-table* 10))) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 spec-1) (get-field-spec-by-id a0-2 (sp-field-id spt-a))) + ) + ) + ) + (none) + ) + +;; definition for function update-mood-ctyslumc +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyslumc time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as ctyslumc-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (if (nonzero? (-> gp-1 spec-0)) + (set! (-> gp-1 spec-0 initial-valuef) (* 32.0 (-> gp-1 light fade))) + ) + (if (nonzero? (-> gp-1 spec-1)) + (set! (-> gp-1 spec-1 initial-valuef) (* 8.0 (-> gp-1 light fade))) + ) + ) + ) + 0 + (none) + ) + +;; definition of type ctyport-states +(deftype ctyport-states (structure) + ((light light-state :inline :offset-assert 0) + (spec-0 sp-field-init-spec :offset-assert 8) + (neon-min-bright float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type ctyport-states +(defmethod inspect ctyport-states ((obj ctyport-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ctyport-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tspec-0: #~%" (-> obj spec-0)) + (format #t "~1Tneon-min-bright: ~f~%" (-> obj neon-min-bright)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-ctyport +;; WARN: Return type mismatch sp-field-init-spec vs uint. +(defun init-mood-ctyport ((arg0 mood-context)) + (let ((gp-0 (the-as ctyport-states (-> arg0 state)))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (let ((a0-1 (-> *part-id-table* 11))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (the-as uint (when (nonzero? a0-1) + (let ((v0-0 (get-field-spec-by-id a0-1 (sp-field-id spt-r)))) + (set! (-> gp-0 spec-0) v0-0) + v0-0 + ) + ) + ) + ) + ) + ) + +;; definition for function init-mood-ctyport-no-part +;; WARN: Return type mismatch int vs none. +(defun init-mood-ctyport-no-part ((arg0 mood-context)) + (set! (-> (the-as ctyport-states (-> arg0 state)) spec-0) (the-as sp-field-init-spec 0)) + 0 + (none) + ) + +;; definition for function update-mood-ctyport +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctyport time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (!= arg2 -1) + (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as ctyport-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (if (= (-> s5-1 neon-min-bright) 0.0) + 0.0 + 1.0 + ) + ) + (if (nonzero? (-> s5-1 spec-0)) + (set! (-> s5-1 spec-0 initial-valuef) (-> s5-1 neon-min-bright)) + ) + (set! (-> arg0 times 7 w) 1.0) + (when (not (paused?)) + (if (< (mod (-> *display* part-clock frame-counter) 600) 300) + (set! (-> s5-1 neon-min-bright) 0.0) + (set! (-> s5-1 neon-min-bright) (rand-vu-float-range 128.0 255.0)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type ctymarka-states +(deftype ctymarka-states (structure) + ((light light-state :inline :offset-assert 0) + (blink float :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type ctymarka-states +(defmethod inspect ctymarka-states ((obj ctymarka-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ctymarka-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tblink: ~f~%" (-> obj blink)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-ctymarka +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctymarka time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (-> arg0 state))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (the-as float (-> gp-1 2))) + (set! (-> arg0 times 7 w) 0.75) + (when (not (paused?)) + (let ((v1-11 (-> *display* part-clock frame-counter))) + (if (< (* 0.2 (the float (mod v1-11 600))) 60.0) + (set! (-> gp-1 2) (the-as uint 0.0)) + (set! (-> gp-1 2) (the-as uint 1.0)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type ctymarkb-states +(deftype ctymarkb-states (structure) + ((light light-state :inline :offset-assert 0) + (blink float :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type ctymarkb-states +(defmethod inspect ctymarkb-states ((obj ctymarkb-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ctymarkb-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tblink: ~f~%" (-> obj blink)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-ctymarkb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ctymarkb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (!= arg2 -1) + (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as ctymarkb-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (-> gp-1 blink)) + (set! (-> arg0 times 7 w) 0.75) + (when (not (paused?)) + (let* ((v1-12 (-> *display* part-clock frame-counter)) + (f0-3 (* 0.2 (the float (mod v1-12 300)))) + ) + (cond + ((< f0-3 15.0) + (set! (-> gp-1 blink) (* 0.06666667 f0-3)) + ) + ((< 45.0 f0-3) + (set! (-> gp-1 blink) (* 0.06666667 (- 60.0 f0-3))) + ) + (else + (set! (-> gp-1 blink) 1.0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type palcab-states +(deftype palcab-states (structure) + ((light light-state :inline :offset-assert 0) + (turret-value float :offset-assert 8) + (electricity electricity-state :inline :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type palcab-states +(defmethod inspect palcab-states ((obj palcab-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'palcab-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tturret-value: ~f~%" (-> obj turret-value)) + (format #t "~1Telectricity: #~%" (-> obj electricity)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-palcab +(defun init-mood-palcab ((arg0 mood-context)) + (let ((v1-0 (the-as object (-> arg0 state))) + (f0-0 1.0) + ) + (set! (-> (the-as palcab-states v1-0) electricity scale) f0-0) + f0-0 + ) + ) + +;; definition for function update-mood-palcab +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-palcab time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (!= arg2 -1) + (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s4-1 (the-as palcab-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (-> s4-1 turret-value)) + (update-mood-electricity arg0 7 12 0.8 1.0) + (if (not (paused?)) + (set! (-> s4-1 turret-value) (fmax 0.0 (+ -0.2 (-> s4-1 turret-value)))) + ) + ) + (let ((a0-9 (new 'stack-no-clear 'sphere)) + (a1-3 (-> *math-camera* trans)) + ) + (set-vector! a0-9 786432.0 1818624.0 2498560.0 1.0) + (let ((f0-8 (- 1.0 (get-sphere-interp a0-9 a1-3 1024000.0 2048000.0)))) + (update-mood-weather! *mood-control* (+ 0.25 (* 0.75 f0-8)) (+ 0.5 (* 0.5 f0-8)) 30.0 30.0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-palcab-turret-flash! +(defun set-palcab-turret-flash! ((arg0 float)) + (let ((v1-1 (level-get *level* 'palcab))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as palcab-states v1-2) turret-value) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition of type stadium-states +(deftype stadium-states (structure) + ((light light-state :inline :offset-assert 0) + (flame flames-state :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xf + :flag-assert #x90000000f + ) + +;; definition for method 3 of type stadium-states +(defmethod inspect stadium-states ((obj stadium-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'stadium-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tflame: #~%" (-> obj flame)) + (label cfg-4) + obj + ) + +;; definition for function update-stadium-lights +;; WARN: Return type mismatch int vs none. +(defun update-stadium-lights ((arg0 mood-context)) + (let ((a1-0 (-> arg0 light-group)) + (gp-0 (-> arg0 light-group 2)) + ) + (mem-copy! (the-as pointer gp-0) (the-as pointer a1-0) 192) + (set! (-> gp-0 dir0 extra x) 0.0) + (set! (-> gp-0 dir1 extra x) 0.0) + (set! (-> gp-0 dir2 extra x) 0.0) + ) + 0 + (none) + ) + +;; definition for function update-mood-stadium +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-stadium time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (update-stadium-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 1 8 0.5 0.001953125 2.0) + (set! (-> arg0 times 7 w) 1.0) + ) + 0 + (none) + ) + +;; definition for function update-mood-copy-stadium +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-stadium time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((v1-1 (level-get *level* 'stadium))) + (cond + ((and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + (else + (copy-mood-exterior arg0) + (update-stadium-lights arg0) + (if (or (>= arg1 18.0) (>= 6.0 arg1)) + (set! (-> arg0 times 5 w) 1.0) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type stadiumb-states +(deftype stadiumb-states (structure) + ((light light-state :inline :offset-assert 0) + (shield-count float :offset-assert 8) + (shield float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type stadiumb-states +(defmethod inspect stadiumb-states ((obj stadiumb-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'stadiumb-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tshield-count: ~f~%" (-> obj shield-count)) + (format #t "~1Tshield: ~f~%" (-> obj shield)) + (label cfg-4) + obj + ) + +;; definition for function update-stadiumb-lights +;; WARN: Return type mismatch int vs none. +(defun update-stadiumb-lights ((arg0 mood-context)) + (let ((gp-0 (-> arg0 light-group))) + (let ((a0-1 (-> arg0 light-group 1))) + (mem-copy! (the-as pointer a0-1) (the-as pointer gp-0) 192) + ) + (set! (-> gp-0 0 dir0 extra x) 0.0) + (set! (-> gp-0 0 dir1 extra x) 0.0) + (set! (-> gp-0 0 dir2 extra x) 0.0) + ) + 0 + (none) + ) + +;; definition for function update-mood-stadiumb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-stadiumb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (update-stadiumb-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as stadiumb-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (-> gp-1 shield)) + (set! (-> arg0 times 7 w) 1.0) + (when (not (paused?)) + (+! (-> gp-1 shield-count) (* 262144.0 (-> self clock seconds-per-frame))) + (set! (-> gp-1 shield) (+ 0.875 (* 0.125 (cos (-> gp-1 shield-count))))) + ) + ) + ) + 0 + (none) + ) + +;; definition of type skatea-states +(deftype skatea-states (structure) + ((light light-state :inline :offset-assert 0) + (flame flames-state :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xf + :flag-assert #x90000000f + ) + +;; definition for method 3 of type skatea-states +(defmethod inspect skatea-states ((obj skatea-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'skatea-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tflame: #~%" (-> obj flame)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-skatea +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-skatea time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 1 8 0.5 0.0009765625 1.5) + (set! (-> arg0 times 7 w) 1.0) + ) + 0 + (none) + ) + +;; definition of type ltentout-states +(deftype ltentout-states (structure) + ((light light-state :inline :offset-assert 0) + (flame flames-state :inline :offset-assert 8) + (totem flames-state :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x17 + :flag-assert #x900000017 + ) + +;; definition for method 3 of type ltentout-states +(defmethod inspect ltentout-states ((obj ltentout-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ltentout-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tflame: #~%" (-> obj flame)) + (format #t "~1Ttotem: #~%" (-> obj totem)) + (label cfg-4) + obj + ) + +;; definition for function update-ltentout-lights +;; WARN: Return type mismatch int vs none. +(defun update-ltentout-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group 2))) + (set-vector! (-> v1-0 dir0 color) 0.822 0.694 0.613 1.0) + (set-vector! (-> v1-0 ambi color) 0.21 0.188 0.163 1.0) + ) + 0 + (none) + ) + +;; definition for function update-mood-ltentout +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-ltentout time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (update-ltentout-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 1 8 0.75 0.0009765625 2.0) + (update-mood-flames arg0 7 1 16 0.333 0.001953125 2.0) + ) + 0 + (none) + ) + +;; definition of type mountain-states +(deftype mountain-states (structure) + ((light0 light-state :inline :offset-assert 0) + (light1 light-state :inline :offset-assert 8) + (spec-0 sp-field-init-spec :offset-assert 16) + (spec-1 sp-field-init-spec :offset-assert 20) + (spec-2 sp-field-init-spec :offset-assert 24) + (spec-3 sp-field-init-spec :offset-assert 28) + (spec-4 sp-field-init-spec :offset-assert 32) + (spec-5 sp-field-init-spec :offset-assert 36) + (spec-6 sp-field-init-spec :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +;; definition for method 3 of type mountain-states +(defmethod inspect mountain-states ((obj mountain-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mountain-states) + (format #t "~1Tlight0: #~%" (-> obj light0)) + (format #t "~1Tlight1: #~%" (-> obj light1)) + (format #t "~1Tspec-0: #~%" (-> obj spec-0)) + (format #t "~1Tspec-1: #~%" (-> obj spec-1)) + (format #t "~1Tspec-2: #~%" (-> obj spec-2)) + (format #t "~1Tspec-3: #~%" (-> obj spec-3)) + (format #t "~1Tspec-4: #~%" (-> obj spec-4)) + (format #t "~1Tspec-5: #~%" (-> obj spec-5)) + (format #t "~1Tspec-6: #~%" (-> obj spec-6)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-mountain +;; WARN: Return type mismatch sp-field-init-spec vs uint. +(defun init-mood-mountain ((arg0 mood-context)) + (let ((gp-0 (the-as mountain-states (-> arg0 state)))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-2) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-3) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-4) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-5) (the-as sp-field-init-spec 0)) + (set! (-> gp-0 spec-6) (the-as sp-field-init-spec 0)) + (let ((a0-1 (-> *part-id-table* 12))) + (set! (-> gp-0 spec-0) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-1) + (set! (-> gp-0 spec-0) (get-field-spec-by-id a0-1 (sp-field-id spt-a))) + ) + ) + (let ((a0-2 (-> *part-id-table* 13))) + (set! (-> gp-0 spec-1) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-2) + (set! (-> gp-0 spec-1) (get-field-spec-by-id a0-2 (sp-field-id spt-a))) + ) + ) + (let ((a0-3 (-> *part-id-table* 14))) + (set! (-> gp-0 spec-2) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-3) + (set! (-> gp-0 spec-2) (get-field-spec-by-id a0-3 (sp-field-id spt-a))) + ) + ) + (let ((a0-4 (-> *part-id-table* 15))) + (set! (-> gp-0 spec-3) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-4) + (set! (-> gp-0 spec-3) (get-field-spec-by-id a0-4 (sp-field-id spt-a))) + ) + ) + (let ((a0-5 (-> *part-id-table* 16))) + (set! (-> gp-0 spec-4) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-5) + (set! (-> gp-0 spec-4) (get-field-spec-by-id a0-5 (sp-field-id spt-a))) + ) + ) + (let ((a0-6 (-> *part-id-table* 17))) + (set! (-> gp-0 spec-5) (the-as sp-field-init-spec 0)) + (if (nonzero? a0-6) + (set! (-> gp-0 spec-5) (get-field-spec-by-id a0-6 (sp-field-id spt-a))) + ) + ) + (let ((a0-7 (-> *part-id-table* 18))) + (set! (-> gp-0 spec-6) (the-as sp-field-init-spec 0)) + (the-as uint (when (nonzero? a0-7) + (let ((v0-6 (get-field-spec-by-id a0-7 (sp-field-id spt-a)))) + (set! (-> gp-0 spec-6) v0-6) + v0-6 + ) + ) + ) + ) + ) + ) + +;; definition for function update-mood-mountain +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-mountain time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as mountain-states (-> arg0 state)))) + (update-mood-light arg0 5 0 0.875 0.25 2.0 0.0 1.0) + (update-mood-light arg0 6 8 1.0 0.0 arg1 0.0 1.0) + (set! (-> arg0 times 7 w) 1.0) + (let* ((f0-1 (-> arg0 times 5 w)) + (f1-1 (* 24.0 f0-1)) + (f0-2 (* 20.0 f0-1)) + ) + (if (nonzero? (-> gp-1 spec-0)) + (set! (-> gp-1 spec-0 initial-valuef) f1-1) + ) + (if (nonzero? (-> gp-1 spec-1)) + (set! (-> gp-1 spec-1 initial-valuef) f0-2) + ) + (if (nonzero? (-> gp-1 spec-2)) + (set! (-> gp-1 spec-2 initial-valuef) f0-2) + ) + (if (nonzero? (-> gp-1 spec-3)) + (set! (-> gp-1 spec-3 initial-valuef) f0-2) + ) + (if (nonzero? (-> gp-1 spec-4)) + (set! (-> gp-1 spec-4 initial-valuef) f0-2) + ) + (if (nonzero? (-> gp-1 spec-5)) + (set! (-> gp-1 spec-5 initial-valuef) f0-2) + ) + (if (nonzero? (-> gp-1 spec-6)) + (set! (-> gp-1 spec-6 initial-valuef) f0-2) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type forest-states +(deftype forest-states (structure) + ((light light-state :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type forest-states +(defmethod inspect forest-states ((obj forest-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'forest-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-forest +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-forest time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 0.875 0.25 2.0 0.0 1.0) + ) + 0 + (none) + ) + +;; definition of type atoll-states +(deftype atoll-states (structure) + ((light light-state :inline :offset-assert 0) + (explosion float :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type atoll-states +(defmethod inspect atoll-states ((obj atoll-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'atoll-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Texplosion: ~f~%" (-> obj explosion)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-atoll +(defun init-mood-atoll ((arg0 mood-context)) + (let ((v1-0 (the-as object (-> arg0 state))) + (f0-0 0.0) + ) + (set! (-> (the-as atoll-states v1-0) explosion) f0-0) + f0-0 + ) + ) + +;; definition for function update-mood-atoll +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-atoll time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s4-1 (the-as atoll-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 7 w) (-> s4-1 explosion)) + (if (not (paused?)) + (seek! (-> s4-1 explosion) 0.0 (* 2.0 (-> self clock seconds-per-frame))) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-atoll-explosion! +(defun set-atoll-explosion! ((arg0 float)) + (let ((v1-1 (level-get *level* 'atoll))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as atoll-states v1-2) explosion) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition for function update-mood-atollext +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-atollext time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior-ambi arg0 #t) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (set-vector! (-> arg0 times 1) 1.0 1.0 1.0 1.0) + (set! (-> arg0 times 2 w) 0.0) + (set! (-> arg0 times 3 w) 0.0) + (set! (-> arg0 times 4 w) 0.0) + (set! (-> arg0 times 5 w) 0.0) + (set! (-> arg0 times 6 w) 0.0) + (set! (-> arg0 times 7 w) 0.0) + ) + 0 + (none) + ) + +;; definition of type drill-states +(deftype drill-states (structure) + ((fire-floor float :offset-assert 0) + (fire-floor-fade float :offset-assert 4) + (fire-floor-flag symbol :offset-assert 8) + (flame flames-state :inline :offset-assert 12) + (electricity electricity-state 2 :inline :offset-assert 20) + (pulse pulse-state :inline :offset 52) + (light-flag basic :offset-assert 56) + ) + :method-count-assert 9 + :size-assert #x3c + :flag-assert #x90000003c + ) + +;; definition for method 3 of type drill-states +(defmethod inspect drill-states ((obj drill-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'drill-states) + (format #t "~1Tfire-floor: ~f~%" (-> obj fire-floor)) + (format #t "~1Tfire-floor-fade: ~f~%" (-> obj fire-floor-fade)) + (format #t "~1Tfire-floor-flag: ~A~%" (-> obj fire-floor-flag)) + (format #t "~1Tflame: #~%" (-> obj flame)) + (format #t "~1Telectricity[2] @ #x~X~%" (-> obj electricity)) + (format #t "~1Tpulse: #~%" (-> obj pulse)) + (format #t "~1Tlight-flag: ~A~%" (-> obj light-flag)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-drill +(defun init-mood-drill ((arg0 mood-context)) + (set! (-> (the-as drill-states (-> arg0 state)) light-flag) #f) + #f + ) + +;; definition for function update-drill-lights +;; WARN: Return type mismatch int vs none. +(defun update-drill-lights ((arg0 mood-context)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((a1-0 (-> arg0 light-group)) + (s5-0 (-> arg0 light-group 1)) + (gp-0 (-> arg0 light-group 2)) + ) + (mem-copy! (the-as pointer s5-0) (the-as pointer a1-0) 192) + (let ((a0-2 (new 'static 'vector :x 0.902 :y 0.675)) + (v1-0 (-> s5-0 ambi color)) + ) + (let ((a1-1 (-> s5-0 ambi color)) + (f0-0 0.3) + ) + (.lvf vf2 (&-> a0-2 quad)) + (.lvf vf1 (&-> a1-1 quad)) + (let ((a0-3 f0-0)) + (.mov vf3 a0-3) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-0 quad) vf4) + ) + (let ((v1-1 (-> gp-0 dir0))) + (set! (-> v1-1 direction x) 0.0) + (set! (-> v1-1 direction y) 1.0) + (set! (-> v1-1 direction z) 0.0) + (set! (-> v1-1 direction w) 1.0) + ) + (set-vector! (-> gp-0 dir0 color) 0.3 0.3 0.35 1.0) + (set-vector! (-> gp-0 ambi color) 0.3 0.3 0.35 1.0) + (set! (-> gp-0 dir0 extra x) 0.5) + (set! (-> gp-0 ambi extra x) 0.5) + ) + 0 + (none) + ) + ) + +;; definition for function update-mood-drill +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-drill time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) + (copy-mood-exterior-ambi arg0 #t) + (update-drill-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as drill-states (-> arg0 state)))) + (update-mood-electricity arg0 2 20 0.75 1.0) + (update-mood-electricity arg0 3 36 0.75 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 4 w) (-> gp-1 fire-floor)) + (update-mood-flames arg0 6 1 12 0.9 0.0009765625 2.0) + (if (and (task-node-closed? (game-task-node drill-mech-resolution)) + (not (task-node-closed? (game-task-node drill-mech-started-smashing))) + ) + (update-mood-pulse arg0 7 52 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 16384.0) + ) + (when (not (paused?)) + (if (-> gp-1 fire-floor-flag) + (seek! (-> gp-1 fire-floor-fade) 1.5 (* 3.0 (-> self clock seconds-per-frame))) + (seek! (-> gp-1 fire-floor-fade) 0.5 (* 3.0 (-> self clock seconds-per-frame))) + ) + (set! (-> gp-1 fire-floor) + (+ (-> gp-1 fire-floor-fade) (* (-> gp-1 fire-floor-fade) (rand-vu-float-range 0.0 0.1))) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-drill-fire-floor! +(defun set-drill-fire-floor! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'drillmid))) + (if v1-1 + (set! (-> (the-as drill-states (-> v1-1 mood-context state)) fire-floor-flag) arg0) + ) + ) + (let ((v1-4 (level-get *level* 'drillb))) + (when v1-4 + (set! (-> (the-as drill-states (-> v1-4 mood-context state)) fire-floor-flag) arg0) + arg0 + ) + ) + ) + +;; definition for function set-drill-electricity-scale! +(defun set-drill-electricity-scale! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'drill))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as drill-states v1-2) electricity arg1 scale) arg0) + ) + ) + ) + (let ((v1-5 (level-get *level* 'drillmid))) + (when v1-5 + (let ((v1-6 (the-as object (-> v1-5 mood-context state))) + (f0-1 arg0) + ) + (set! (-> (the-as drill-states v1-6) electricity arg1 scale) f0-1) + f0-1 + ) + ) + ) + ) + +;; definition for function update-mood-drillmnt +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-drillmnt time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior-ambi arg0 #t) + (update-drill-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 *math-camera*)) + (set! (-> arg0 times 5 w) 1.0) + (if (not (paused?)) + (quaternion-rotate-y! + (-> s5-1 quat-other) + (-> s5-1 quat-other) + (* 273.06668 (-> self clock seconds-per-frame)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type drillb-states +(deftype drillb-states (structure) + ((fire-floor float :offset-assert 0) + (fire-floor-fade float :offset-assert 4) + (fire-floor-flag symbol :offset-assert 8) + (pulse pulse-state :inline :offset-assert 12) + (light-flag symbol :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type drillb-states +(defmethod inspect drillb-states ((obj drillb-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'drillb-states) + (format #t "~1Tfire-floor: ~f~%" (-> obj fire-floor)) + (format #t "~1Tfire-floor-fade: ~f~%" (-> obj fire-floor-fade)) + (format #t "~1Tfire-floor-flag: ~A~%" (-> obj fire-floor-flag)) + (format #t "~1Tpulse: #~%" (-> obj pulse)) + (format #t "~1Tlight-flag: ~A~%" (-> obj light-flag)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-drillb +(defun init-mood-drillb ((arg0 mood-context)) + (set! (-> (the-as drillb-states (-> arg0 state)) light-flag) #f) + #f + ) + +;; definition for function update-mood-drillb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-drillb time-of-day-proc ((arg0 mood-context)) + (copy-mood-exterior-ambi arg0 #f) + (update-drill-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as drillb-states (-> arg0 state)))) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 4 w) (-> gp-0 fire-floor)) + (if (and (task-node-closed? (game-task-node drill-mech-resolution)) + (not (task-node-closed? (game-task-node drill-mech-started-smashing))) + ) + (update-mood-pulse arg0 7 12 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 16384.0) + ) + (when (not (paused?)) + (if (-> gp-0 fire-floor-flag) + (seek! (-> gp-0 fire-floor-fade) 1.5 (* 3.0 (-> self clock seconds-per-frame))) + (seek! (-> gp-0 fire-floor-fade) 0.5 (* 3.0 (-> self clock seconds-per-frame))) + ) + (set! (-> gp-0 fire-floor) + (+ (-> gp-0 fire-floor-fade) (* (-> gp-0 fire-floor-fade) (rand-vu-float-range 0.0 0.1))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type casboss-states +(deftype casboss-states (structure) + ((light light-state :inline :offset-assert 0) + (explosion float :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type casboss-states +(defmethod inspect casboss-states ((obj casboss-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'casboss-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Texplosion: ~f~%" (-> obj explosion)) + (label cfg-4) + obj + ) + +;; definition for function update-casboss-lights +(defun update-casboss-lights ((arg0 mood-context)) + (let ((s4-0 (-> arg0 light-group 1)) + (s5-0 (-> arg0 light-group 2)) + (gp-0 (-> arg0 light-group 3)) + ) + (let ((v1-0 (-> s4-0 dir0))) + (set! (-> v1-0 direction x) 0.707) + (set! (-> v1-0 direction y) -0.5) + (set! (-> v1-0 direction z) 0.707) + (set! (-> v1-0 direction w) 1.0) + ) + (vector-normalize! (the-as vector (-> s4-0 dir0)) 1.0) + (set-vector! (-> s4-0 dir0 color) 0.0 1.9921875 0.0 1.0) + (set! (-> s4-0 dir0 extra x) 1.0) + (set! (-> s4-0 ambi extra x) 0.0) + (set-vector! (-> s5-0 ambi color) 0.3 0.3 0.5 1.0) + (set! (-> s5-0 dir0 extra x) 0.0) + (set! (-> s5-0 ambi extra x) 1.0) + (let ((v1-5 (-> gp-0 dir0))) + (set! (-> v1-5 direction x) 0.6499) + (set! (-> v1-5 direction y) 0.7134) + (set! (-> v1-5 direction z) 0.2619) + (set! (-> v1-5 direction w) 1.0) + ) + (set-vector! (-> gp-0 dir0 color) 0.65 0.575 0.575 1.0) + (let ((v1-7 (-> gp-0 dir1))) + (set! (-> v1-7 direction x) -0.6499) + (set! (-> v1-7 direction y) 0.7134) + (set! (-> v1-7 direction z) -0.2619) + (set! (-> v1-7 direction w) 1.0) + ) + (set-vector! (-> gp-0 dir1 color) 0.75 0.6 0.5 1.0) + (set-vector! (-> gp-0 ambi color) 0.2 0.2 0.25 1.0) + (set! (-> gp-0 dir0 extra x) 0.65) + (set! (-> gp-0 dir1 extra x) 1.0) + (let ((f0-38 0.7)) + (set! (-> gp-0 ambi extra x) f0-38) + f0-38 + ) + ) + ) + +;; definition for function update-mood-casboss +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-casboss time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (update-casboss-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s4-1 (the-as casboss-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 0.0) + (if (not (paused?)) + (set! (-> s4-1 explosion) (- (-> s4-1 explosion) (-> self clock seconds-per-frame))) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-casboss-explosion! +(defun set-casboss-explosion! () + (let ((v1-1 (level-get *level* 'ctywide))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 1.0) + ) + (set! (-> (the-as casboss-states v1-2) explosion) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition of type caspad-states +(deftype caspad-states (structure) + ((light light-state :inline :offset-assert 0) + (red float :offset-assert 8) + (white float :offset-assert 12) + (white-count int32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type caspad-states +(defmethod inspect caspad-states ((obj caspad-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'caspad-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tred: ~f~%" (-> obj red)) + (format #t "~1Twhite: ~f~%" (-> obj white)) + (format #t "~1Twhite-count: ~D~%" (-> obj white-count)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-caspad +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-caspad time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as caspad-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (-> gp-1 red)) + (set! (-> arg0 times 7 w) (-> gp-1 white)) + (set! (-> arg0 times 5 w) 1.0) + (when (not (paused?)) + (let* ((v1-11 (-> *display* part-clock frame-counter)) + (f0-4 (* 0.006666667 (the float (mod v1-11 150)))) + ) + (set! (-> gp-1 red) (+ 0.75 (* 0.25 (cos (* 65536.0 f0-4))))) + ) + (when (<= (-> gp-1 white-count) 0) + (set! (-> gp-1 white) (rand-vu-float-range 0.85 1.05)) + (set! (-> gp-1 white-count) 2) + ) + (+! (-> gp-1 white-count) -1) + ) + ) + ) + 0 + (none) + ) + +;; definition of type palout-states +(deftype palout-states (structure) + ((light light-state :inline :offset-assert 0) + (flame flames-state :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xf + :flag-assert #x90000000f + ) + +;; definition for method 3 of type palout-states +(defmethod inspect palout-states ((obj palout-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'palout-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tflame: #~%" (-> obj flame)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-palout +(defun init-mood-palout ((arg0 mood-context)) + (let ((v0-0 (-> *math-camera* trans-other))) + (set! (-> v0-0 x) 760754.2) + (set! (-> v0-0 y) 0.0) + (set! (-> v0-0 z) 2471944.2) + (set! (-> v0-0 w) 1.0) + v0-0 + ) + ) + +;; definition for function update-mood-palout +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-palout time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior-ambi arg0 #t) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (update-mood-flames arg0 6 2 8 0.5 0.0009765625 1.5) + (let ((gp-1 *math-camera*)) + (if (not (paused?)) + (quaternion-rotate-y! + (-> gp-1 quat-other) + (-> gp-1 quat-other) + (* 273.06668 (-> self clock seconds-per-frame)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type palroof-states +(deftype palroof-states (structure) + ((electricity electricity-state 2 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type palroof-states +(defmethod inspect palroof-states ((obj palroof-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'palroof-states) + (format #t "~1Telectricity[2] @ #x~X~%" (-> obj electricity)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-palroof +(defun init-mood-palroof ((arg0 mood-context)) + (let ((v1-0 (the-as palroof-states (-> arg0 state)))) + (set! (-> v1-0 electricity 0 scale) 1.0) + (let ((f0-1 1.0)) + (set! (-> v1-0 electricity 1 scale) f0-1) + f0-1 + ) + ) + ) + +;; definition for function update-mood-palroof +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-palroof time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (-> arg0 state) + (set! (-> arg0 times 7 w) 1.0) + (update-mood-electricity arg0 5 0 1.2 1.7) + (update-mood-electricity arg0 6 16 1.2 1.7) + ) + 0 + (none) + ) + +;; definition for function set-palroof-electricity-scale! +(defun set-palroof-electricity-scale! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'palroof))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 arg0) + ) + (set! (-> (the-as palroof-states v1-2) electricity arg1 scale) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition of type palent-states +(deftype palent-states (structure) + ((flame flames-state :inline :offset-assert 0) + (turret-value float :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type palent-states +(defmethod inspect palent-states ((obj palent-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'palent-states) + (format #t "~1Tflame: #~%" (-> obj flame)) + (format #t "~1Tturret-value: ~f~%" (-> obj turret-value)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-palent +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-palent time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as palent-states (-> arg0 state)))) + (update-mood-flames arg0 6 1 0 0.75 0.00048828125 2.0) + (set! (-> arg0 times 5 w) (-> s5-1 turret-value)) + (set! (-> arg0 times 7 w) 1.0) + (if (not (paused?)) + (set! (-> s5-1 turret-value) (fmax 0.0 (+ -0.025 (-> s5-1 turret-value)))) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-palent-turret-flash! +(defun set-palent-turret-flash! ((arg0 float)) + (let ((v1-1 (level-get *level* 'palent))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-1 (* 0.5 arg0)) + ) + (set! (-> (the-as palent-states v1-2) turret-value) f0-1) + f0-1 + ) + ) + ) + ) + +;; definition of type nest-states +(deftype nest-states (structure) + ((light light-state :inline :offset-assert 0) + (green-flag symbol :offset-assert 8) + (green float :offset-assert 12) + (green-noise float :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type nest-states +(defmethod inspect nest-states ((obj nest-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nest-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tgreen-flag: ~A~%" (-> obj green-flag)) + (format #t "~1Tgreen: ~f~%" (-> obj green)) + (format #t "~1Tgreen-noise: ~f~%" (-> obj green-noise)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-nest +(defun init-mood-nest ((arg0 mood-context)) + (set! (-> (the-as nest-states (-> arg0 state)) green-flag) #f) + #f + ) + +;; definition for function update-nest-lights +(defun update-nest-lights ((arg0 mood-context)) + (let ((a2-0 (new 'stack-no-clear 'vector4))) + (set-vector! a2-0 0.53660715 0.26964286 1.0 1.0) + (vector4-mul! (the-as vector4 (-> arg0 current-fog)) (the-as vector4 (-> arg0 current-fog)) a2-0) + ) + (mem-copy! (the-as pointer (-> arg0 light-group 1)) (the-as pointer (-> arg0 light-group)) 192) + ) + +;; definition for function update-mood-nest +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-nest time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (update-nest-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((s5-1 (the-as nest-states (-> arg0 state)))) + (when (not (paused?)) + (cond + ((-> s5-1 green-flag) + (set! (-> s5-1 green) (fmin 1.9 (+ (-> s5-1 green) (* 2.0 (-> self clock seconds-per-frame))))) + (set! (-> s5-1 green-noise) (rand-vu-float-range 0.0 (-> s5-1 green))) + ) + (else + (set! (-> s5-1 green) (fmax 0.0 (- (-> s5-1 green) (* 2.0 (-> self clock seconds-per-frame))))) + (set! (-> s5-1 green-noise) 0.0) + ) + ) + ) + (update-mood-light arg0 5 0 1.0 0.25 20.0 0.0 1.0) + (set! (-> arg0 times 6 w) (+ (-> s5-1 green) (-> s5-1 green-noise))) + ) + ) + 0 + (none) + ) + +;; definition for function set-nest-green-flag! +(defun set-nest-green-flag! ((arg0 symbol)) + (let ((v1-1 (level-get *level* 'nest))) + (when v1-1 + (set! (-> (the-as nest-states (-> v1-1 mood-context state)) green-flag) arg0) + arg0 + ) + ) + ) + +;; definition of type village1-states +(deftype village1-states (structure) + ((interp float :offset-assert 0) + (interp-flag symbol :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type village1-states +(defmethod inspect village1-states ((obj village1-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'village1-states) + (format #t "~1Tinterp: ~f~%" (-> obj interp)) + (format #t "~1Tinterp-flag: ~A~%" (-> obj interp-flag)) + (label cfg-4) + obj + ) + +;; definition for function init-mood-village1 +(defun init-mood-village1 ((arg0 mood-context)) + (let ((v1-0 (the-as village1-states (-> arg0 state)))) + (set! (-> v1-0 interp) 0.0) + (set! (-> v1-0 interp-flag) #f) + ) + #f + ) + +;; definition for function update-village1-lights +(defun update-village1-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (set! (-> v1-0 0 dir0 extra x) (* 0.5 (-> v1-0 0 dir0 extra x))) + (set! (-> v1-0 0 dir1 extra x) (* 0.5 (-> v1-0 0 dir1 extra x))) + (set! (-> v1-0 0 dir2 extra x) (* 0.5 (-> v1-0 0 dir2 extra x))) + (let ((f0-7 (* 0.75 (-> v1-0 0 ambi extra x)))) + (set! (-> v1-0 0 ambi extra x) f0-7) + f0-7 + ) + ) + ) + +;; definition for function update-mood-village1 +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-village1 time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (update-village1-lights arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as village1-states (-> arg0 state)))) + (let ((f0-0 (-> gp-1 interp))) + (set! (-> arg0 times 6 w) (- 1.0 f0-0)) + (set! (-> arg0 times 7 w) f0-0) + (if (!= f0-0 0.0) + (set-filter-color! (- 1.0 (* 0.25 f0-0)) (- 1.0 (* 0.5 f0-0)) 1.0) + ) + ) + (when (not (paused?)) + (if (-> gp-1 interp-flag) + (seek! (-> gp-1 interp) 1.0 (* 0.5 (-> self clock seconds-per-frame))) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function update-mood-copy-village1 +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-copy-village1 time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (let ((v1-1 (level-get *level* 'village1))) + (if (and v1-1 (= (-> v1-1 status) 'active)) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> v1-1 mood-context)) 1968) + ) + ) + 0 + (none) + ) + +;; definition for function clear-village1-interp! +(defun clear-village1-interp! () + (let ((v1-1 (level-get *level* 'village1))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as village1-states v1-2) interp) 0.0) + (set! (-> (the-as village1-states v1-2) interp-flag) #f) + ) + #f + ) + ) + ) + +;; definition for function set-village1-interp! +(defun set-village1-interp! () + (let ((v1-1 (level-get *level* 'village1))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (v0-1 #t) + ) + (set! (-> (the-as village1-states v1-2) interp-flag) v0-1) + v0-1 + ) + ) + ) + ) + +;; definition of type consite-states +(deftype consite-states (structure) + ((light light-state :inline :offset-assert 0) + (flash float :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type consite-states +(defmethod inspect consite-states ((obj consite-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'consite-states) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tflash: ~f~%" (-> obj flash)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-consite +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-consite time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((f0-0 0.5)) + (let ((f1-0 1.0)) + (cond + ((or (>= 6.0 arg1) (>= arg1 18.0)) + (set! f0-0 f1-0) + ) + ((and (< 6.0 arg1) (< arg1 7.0)) + (+! f0-0 (* (- f1-0 f0-0) (- 7.0 arg1))) + ) + ((and (< 17.0 arg1) (< arg1 18.0)) + (+! f0-0 (* (- f1-0 f0-0) (+ -17.0 arg1))) + ) + ) + ) + (set! (-> arg0 times 7 w) f0-0) + ) + (let ((s4-1 (the-as consite-states (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (-> s4-1 flash)) + (if (not (paused?)) + (set! (-> s4-1 flash) (fmax 0.0 (- (-> s4-1 flash) (* 2.0 (-> self clock seconds-per-frame))))) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-consite-flash! +(defun set-consite-flash! () + (let ((v1-1 (level-get *level* 'consite))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state))) + (f0-0 2.0) + ) + (set! (-> (the-as consite-states v1-2) flash) f0-0) + f0-0 + ) + ) + ) + ) + +;; definition of type mincan-states +(deftype mincan-states (structure) + ((beams float 2 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type mincan-states +(defmethod inspect mincan-states ((obj mincan-states)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mincan-states) + (format #t "~1Tbeams[2] @ #x~X~%" (-> obj beams)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-mincan +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-mincan time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((v1-7 (the-as mincan-states (-> arg0 state)))) + (set! (-> arg0 times 5 w) (-> v1-7 beams 0)) + (set! (-> arg0 times 6 w) (-> v1-7 beams 1)) + ) + ) + 0 + (none) + ) + +;; definition for function set-mincan-beam! +(defun set-mincan-beam! ((arg0 int) (arg1 float)) + (let ((v1-1 (level-get *level* 'mincan))) + (when v1-1 + (let ((v1-2 (-> v1-1 mood-context state)) + (f0-0 arg1) + ) + (set! (-> (the-as mincan-states (+ (* arg0 4) (the-as int v1-2))) beams 0) f0-0) + f0-0 + ) + ) + ) + ) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc index efca5c895d..2944e2431e 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc @@ -80,7 +80,8 @@ ;; definition of type mood-fog-table (deftype mood-fog-table (structure) - ((data mood-fog 8 :inline :offset-assert 0) + ((data mood-fog 8 :inline :offset-assert 0) + (data-raw uint128 24 :offset 0) ) :method-count-assert 9 :size-assert #x180 @@ -145,7 +146,8 @@ ;; definition of type mood-color-table (deftype mood-color-table (structure) - ((data mood-color 8 :inline :offset-assert 0) + ((data mood-color 8 :inline :offset-assert 0) + (data-raw uint128 16 :offset 0) ) :method-count-assert 9 :size-assert #x100 @@ -321,7 +323,7 @@ (mood-channel-group mood-channel-group :offset-assert 12) (mood-direction-table mood-direction-table :offset-assert 16) (mood-sky-table mood-sky-table :offset-assert 20) - (mood-interp-table basic :offset-assert 24) + (mood-interp-table sky-color-day :offset-assert 24) ) :method-count-assert 9 :size-assert #x1c @@ -429,9 +431,11 @@ ;; definition of type mood-context (deftype mood-context (mood-context-core3) + "`state` holds an arbitrary state structure, ie `[[sewer-states]]` and is used + when updating the mood. This means that an individual state structure must be less than 128 bytes" ((itimes vector4w 4 :inline :offset-assert 1776) (state uint32 32 :offset-assert 1840) - (clear uint128 123 :offset 0) + (data uint128 123 :offset 0) ) :method-count-assert 9 :size-assert #x7b0 diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables2_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables2_REF.gc index 7445566a50..f04fe06254 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables2_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables2_REF.gc @@ -91,14 +91,14 @@ ) ;; definition for function init-overide-table -;; INFO: Return type mismatch pointer vs none. +;; WARN: Return type mismatch pointer vs none. (defun init-overide-table ((arg0 mood-table)) (set! (-> arg0 mood-fog-table) (new 'debug 'mood-fog-table)) (set! (-> arg0 mood-color-table) (new 'debug 'mood-color-table)) (set! (-> arg0 mood-channel-group) *no-cloud-mood-channel-group*) (set! (-> arg0 mood-direction-table) *mood-direction-table*) (set! (-> arg0 mood-sky-table) *mood-sky-table*) - (set! (-> arg0 mood-interp-table) (the-as basic *mood-interp-table*)) + (set! (-> arg0 mood-interp-table) *mood-interp-table*) (mem-copy! (the-as pointer (-> arg0 mood-fog-table)) (the-as pointer *no-cloud-clear-mood-fog-table*) 384) (mem-copy! (the-as pointer (-> arg0 mood-color-table)) (the-as pointer *no-cloud-mood-color-table*) 256) (none) @@ -111,7 +111,7 @@ (init-overide-table *overide-table*) ;; definition for function print-mood-tables -;; INFO: Return type mismatch object vs none. +;; WARN: Return type mismatch object vs none. (defun print-mood-tables () "Print out the contents of the [[*overide-table*]]" (mem-copy! (the-as pointer (-> *overide-table* mood-fog-table)) (the-as pointer *overide-mood-fog-table*) 384) @@ -254,7 +254,7 @@ ) ;; definition for function desaturate-mood-colors -;; INFO: Return type mismatch object vs none. +;; WARN: Return type mismatch object vs none. (defun desaturate-mood-colors ((arg0 float) (arg1 float) (arg2 float)) "Unused - Generate GOAL code for a new [[*overide-mood-color-table*]] definition that desaturates the color Apply said overrides to the [[*overide-table*]]" @@ -352,7 +352,7 @@ ) ;; definition for function desaturate-mood-fog -;; INFO: Return type mismatch object vs none. +;; WARN: Return type mismatch object vs none. (defun desaturate-mood-fog ((arg0 (pointer mood-fog-table)) (arg1 float) (arg2 float)) "Unused - Generate GOAL code for a new [[*overide-mood-fog-table*]] definition that desaturates the fog color Apply said overrides to the [[*overide-table*]]" diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables_REF.gc index 39a7a59499..289ccd5533 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables_REF.gc @@ -824,7 +824,7 @@ ) ;; definition for function init-mood-control -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defun init-mood-control ((arg0 mood-control)) (set! (-> arg0 mood-fog-table) (new 'global 'mood-fog-table)) (set! (-> arg0 mood-color-table) (new 'global 'mood-color-table)) @@ -832,7 +832,7 @@ (set! (-> arg0 mood-clouds) (new 'global 'mood-clouds)) (set! (-> arg0 mood-direction-table) *mood-direction-table*) (set! (-> arg0 mood-sky-table) *mood-sky-table*) - (set! (-> arg0 mood-interp-table) (the-as basic *mood-interp-table*)) + (set! (-> arg0 mood-interp-table) *mood-interp-table*) (mem-copy! (the-as pointer (-> arg0 mood-fog-table)) (the-as pointer *no-cloud-clear-mood-fog-table*) 384) (mem-copy! (the-as pointer (-> arg0 mood-color-table)) (the-as pointer *no-cloud-mood-color-table*) 256) (mem-copy! (the-as pointer (-> arg0 mood-channel-group)) (the-as pointer *no-cloud-mood-channel-group*) 384) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc new file mode 100644 index 0000000000..f88b524432 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc @@ -0,0 +1,1845 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function palette-select-special +(defun palette-select-special ((arg0 mood-context-core3)) + "Use the `special` time-of-day mode palette" + (dotimes (v1-0 8) + (if (logtest? (-> *time-of-day-context* mode) (ash 16 v1-0)) + (set! (-> arg0 times v1-0 w) (-> *time-of-day-context* times v1-0 w)) + (set! (-> arg0 times v1-0 w) 0.0) + ) + ) + #f + ) + +;; definition for function clear-mood-times +(defun clear-mood-times ((arg0 mood-context)) + "Clear all of the mood times on the given context" + (dotimes (v1-0 8) + (set! (-> arg0 times v1-0 w) 0.0) + ) + #f + ) + +;; definition for function update-mood-itimes +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function may read a register that is not set: f31 +(defun update-mood-itimes ((arg0 mood-context)) + (local-vars + (r0-0 int) + (r0-1 int) + (r0-2 int) + (v1-1 uint128) + (v1-2 uint128) + (v1-3 uint128) + (v1-4 uint128) + (a1-0 uint128) + (a1-1 uint128) + (a1-2 uint128) + (a1-3 uint128) + (a2-0 uint128) + (a2-1 uint128) + (a3-0 uint128) + (a3-1 uint128) + (t0-0 uint128) + (t0-1 uint128) + (t1-0 uint128) + (t1-1 uint128) + (t2-0 uint128) + (t2-1 uint128) + (t3-0 uint128) + (t3-1 uint128) + (f31-0 none) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + ) + (nop!) + (nop!) + *time-of-day-context* + (nop!) + (.lvf vf1 (&-> arg0 times 0 quad)) + (nop!) + (.lvf vf2 (&-> arg0 times 1 quad)) + (.mul.w.vf vf1 vf1 vf1 :mask #b111) + (.lvf vf3 (&-> arg0 times 2 quad)) + (.mul.w.vf vf2 vf2 vf2 :mask #b111) + (.lvf vf4 (&-> arg0 times 3 quad)) + (.mul.w.vf vf3 vf3 vf3 :mask #b111) + (.lvf vf5 (&-> arg0 times 4 quad)) + (.mul.w.vf vf4 vf4 vf4 :mask #b111) + (.lvf vf6 (&-> arg0 times 5 quad)) + (.mul.w.vf vf5 vf5 vf5 :mask #b111) + (.lvf vf7 (&-> arg0 times 6 quad)) + (.mul.w.vf vf6 vf6 vf6 :mask #b111) + (.lvf vf8 (&-> arg0 times 7 quad)) + (.mul.w.vf vf7 vf7 vf7 :mask #b111) + (nop!) + (.mul.w.vf vf8 vf8 vf8 :mask #b111) + (nop!) + (vftoi12.xyzw vf1 vf1) + (nop!) + (vftoi12.xyzw vf2 vf2) + (nop!) + (vftoi12.xyzw vf3 vf3) + (nop!) + (vftoi12.xyzw vf4 vf4) + (nop!) + (vftoi12.xyzw vf5 vf5) + (nop!) + (vftoi12.xyzw vf6 vf6) + (nop!) + (vftoi12.xyzw vf7 vf7) + (nop!) + (vftoi12.xyzw vf8 vf8) + (nop!) + (.mov v1-1 vf1) + (nop!) + (.mov a1-0 vf2) + (nop!) + (.mov a2-0 vf3) + (.pw.sra v1-2 v1-1 6) + (.mov a3-0 vf4) + (.pw.sra a1-1 a1-0 6) + (.mov t0-0 vf5) + (.pw.sra a2-1 a2-0 6) + (.mov t1-0 vf6) + (.pw.sra a3-1 a3-0 6) + (.mov t2-0 vf7) + (.pw.sra t0-1 t0-0 6) + (.mov t3-0 vf8) + (.pw.sra t1-1 t1-0 6) + (.pw.sra t2-1 t2-0 6) + (.mov r0-0 f31-0) + (.pw.sra t3-1 t3-0 6) + (.mov r0-1 f31-0) + (.ppach v1-3 a1-1 v1-2) + (.mov r0-2 f31-0) + (.ppach a1-2 a3-1 a2-1) + (set! (-> arg0 itimes 0 quad) v1-3) + (.ppach v1-4 t1-1 t0-1) + (set! (-> arg0 itimes 1 quad) a1-2) + (.ppach a1-3 t3-1 t2-1) + (set! (-> arg0 itimes 2 quad) v1-4) + (nop!) + (set! (-> arg0 itimes 3 quad) a1-3) + 0 + (none) + ) + ) + +;; definition for function update-mood-direction +;; INFO: Used lq/sq +;; ERROR: Expression building failed: In update-mood-direction: Failed to match non-power of two case: t3-14 +(defun update-mood-direction ((arg0 mood-context-core3) (arg1 mood-table) (arg2 float)) + (local-vars + (v0-0 pointer) + (v0-1 float) + (v1-0 mood-channel-group) + (v1-3 int) + (v1-4 float) + (v1-5 float) + (v1-6 float) + (v1-7 symbol) + (v1-8 symbol) + (v1-9 float) + (v1-12 float) + (v1-13 symbol) + (v1-14 symbol) + (v1-15 float) + (v1-17 float) + (v1-19 float) + (v1-20 symbol) + (v1-21 symbol) + (v1-22 float) + (v1-24 float) + (v1-26 light-group) + (v1-27 light-group) + (v1-28 light-group) + (v1-29 light-group) + (v1-30 light-group) + (v1-31 light-group) + (a0-1 light-group) + (a1-1 int) + (a1-2 float) + (a1-3 (inline-array light-group)) + (a2-1 mood-direction-table) + (a2-2 int) + (a3-0 int) + (t0-0 int) + (t0-1 int) + (t1-0 int) + (t2-0 light-group) + (t2-1 float) + (t2-2 int) + (t3-7 int) + (t3-8 int) + (t3-9 light) + (t3-10 int) + (t3-11 int) + (t3-12 int) + (t3-13 light-group) + (t3-14 int) + (t3-15 rgbaf) + (t3-16 int) + (t3-17 int) + (t3-18 int) + (t3-19 int) + (t4-5 int) + (t4-6 int) + (t4-7 light) + (t4-8 int) + (t4-9 int) + (t4-10 light) + (t4-11 int) + (t4-12 int) + (t4-13 int) + (t4-14 int) + (t4-15 vector) + (t4-16 uint128) + (t4-17 int) + (t4-18 int) + (t4-19 int) + (t4-20 int) + (t4-21 int) + (t4-22 vector) + (t4-23 uint128) + (t9-0 (function pointer pointer int pointer)) + (f0-0 float) + (f0-1 int) + (f0-2 float) + (f0-3 float) + (f0-4 float) + (f0-5 float) + (f1-0 int) + (f1-1 float) + (f1-2 float) + (f1-3 float) + (f1-4 float) + (f1-5 float) + (f1-6 float) + (f1-7 float) + (f1-8 float) + (f1-9 float) + (f1-10 float) + (f1-11 float) + (f1-12 float) + (f1-13 float) + (f2-0 float) + (f2-1 float) + (f2-2 float) + (f2-3 float) + (f2-6 float) + (f2-7 float) + (f2-8 float) + (f2-9 float) + (f2-10 float) + (f2-11 float) + (f2-12 float) + (f2-13 float) + (f2-14 float) + (f2-15 float) + (f2-16 float) + (f3-3 float) + (f3-4 float) + (f3-5 float) + (f3-6 float) + (f3-7 float) + (f3-8 float) + (f3-9 float) + (f3-10 float) + (sv-16 light-group) + ) + (cond + ((begin + (set! v1-0 (-> arg1 mood-channel-group)) + (set! a2-1 (-> arg1 mood-direction-table)) + (set! f0-0 arg2) + (set! f0-1 (the int arg2)) + (set! a3-0 (the int arg2)) + (set! a1-1 (+ a3-0 1)) + (set! t0-0 24) + (set! t0-1 (mod (+ a3-0 1) 24)) + (set! f0-2 arg2) + (set! f1-0 (gpr->fpr a3-0)) + (set! f1-1 (the float a3-0)) + (set! f0-3 (- arg2 (the float a3-0))) + (set! a1-2 1.0) + (set! f1-2 1.0) + (set! f1-3 (- 1.0 f0-3)) + (set! t1-0 0) + (set! a1-3 (-> arg0 light-group)) + (set! t2-0 (-> arg0 light-group 1)) + (set! sv-16 t2-0) + (set! t2-1 1.0) + (set! f2-0 1.0) + (set! (-> a1-3 0 ambi extra x) f2-0) + (set! f2-1 0.0) + (set! (-> a1-3 0 dir0 extra x) f2-1) + (set! f2-2 0.0) + (set! (-> a1-3 0 dir1 extra x) f2-2) + (set! f2-3 0.0) + (set! (-> a1-3 0 dir2 extra x) f2-3) + (set! t2-2 0) + (while (<.si t2-2 4) + (when (!= f2-6 0.0) + (set! t3-7 48) + (set! t3-8 (* 48 t1-0)) + (set! t3-9 (-> a1-3 0 lights t1-0)) + (set! (-> a1-3 0 lights t1-0 extra x) f2-6) + (set! t3-10 2) + (set! t3-11 (ash 2 t2-2)) + (set! t4-5 48) + (set! t4-6 (* 48 t1-0)) + (set! t4-7 (-> a1-3 0 lights t1-0)) + (set! (-> a1-3 0 lights t1-0 mask) (the-as uint t3-11)) + (set! t3-12 (+ t2-2 1)) + (set! t4-8 48) + (set! t4-9 (* 48 t1-0)) + (set! t4-10 (-> a1-3 0 lights t1-0)) + (set! (-> a1-3 0 lights t1-0 palette-index) t3-12) + (set! t3-13 (-> a1-3 0)) + (set! t4-11 48) + (set! t4-12 (* 48 t1-0)) + (set! t3-14 (+ (the-as uint (-> a1-3 0)) (* 48 t1-0))) + (set! t4-13 (* t2-2 16)) + (set! t4-14 (+ (* t2-2 16) 0)) + (set! t4-15 (-> a2-1 data t2-2)) + (set! t4-16 (-> a2-1 data t2-2 quad)) + (set! (dynamic-array-field-access t3-14 lights PLACEHOLDER direction quad) t4-16) + (set! t3-15 (-> a1-3 0 dir0 color)) + (set! t4-17 48) + (set! t4-18 (*.si t4-17 t1-0)) + (set! t3-16 (+ t3-15 t4-18)) + (set! t4-19 (+ t2-2 1)) + (set! t4-20 (sll t4-19 4)) + (set! t4-21 (+ t4-20 1648)) + (set! t4-22 (+ t4-21 arg0)) + (set! t4-23 (-> t4-22 quad)) + (set! (the-as (pointer uint128) (-> (the-as (pointer uint128) t3-16))) t4-23) + (set! t3-17 (+ t2-2 1)) + (set! t3-18 (sll t3-17 4)) + (set! t3-19 (+ arg0 t3-18)) + (set! (dynamic-array-field-access t3-19 times PLACEHOLDER w) f2-6) + (set! t1-0 (+ t1-0 1)) + (set! t3-20 t1-0) + ) + (set! t2-2 (+ t2-2 1)) + ) + (set! v1-3 1) + (set! (-> a1-3 0 ambi mask) (the-as uint v1-3)) + (set! (-> a1-3 0 ambi palette-index) 0) + (set! t9-0 mem-copy!) + (set! a0-1 sv-16) + (set! a2-2 192) + (call! a0-1 a1-3 a2-2) + (set! v1-4 1.0) + (set! f0-4 (gpr->fpr v1-4)) + (set! v1-5 1.1) + (set! f1-4 (gpr->fpr v1-5)) + (set! v1-6 6.0) + (set! f2-7 (gpr->fpr v1-6)) + (set! f3-3 (gpr->fpr arg2)) + (set! v1-7 (>=.s f2-7 f3-3)) + (or v1-7 + (begin (set! f2-8 (gpr->fpr arg2)) (set! v1-9 18.0) (set! f3-4 (gpr->fpr v1-9)) (set! v1-8 (>=.s f2-8 f3-4))) + ) + v1-8 + ) + (set! f0-4 f1-4) + (set! v1-11 (fpr->gpr f0-4)) + ) + ((begin + (and (begin + (set! v1-12 6.0) + (set! f2-9 (gpr->fpr v1-12)) + (set! f3-5 (gpr->fpr arg2)) + (set! v1-13 (<.s f2-9 f3-5)) + v1-13 + ) + (begin + (set! f2-10 (gpr->fpr arg2)) + (set! v1-15 7.0) + (set! f3-6 (gpr->fpr v1-15)) + (set! v1-14 (<.s f2-10 f3-6)) + ) + ) + v1-14 + ) + (set! f1-5 (-.s f1-4 f0-4)) + (set! v1-17 7.0) + (set! f2-11 (gpr->fpr v1-17)) + (set! f3-7 (gpr->fpr arg2)) + (set! f2-12 (-.s f2-11 f3-7)) + (set! f1-6 (*.s f1-5 f2-12)) + (set! f0-4 (+.s f0-4 f1-6)) + (set! v1-18 (fpr->gpr f0-4)) + ) + ((begin + (and (begin + (set! v1-19 17.0) + (set! f2-13 (gpr->fpr v1-19)) + (set! f3-8 (gpr->fpr arg2)) + (set! v1-20 (<.s f2-13 f3-8)) + v1-20 + ) + (begin + (set! f2-14 (gpr->fpr arg2)) + (set! v1-22 18.0) + (set! f3-9 (gpr->fpr v1-22)) + (set! v1-21 (<.s f2-14 f3-9)) + ) + ) + v1-21 + ) + (set! f1-7 (-.s f1-4 f0-4)) + (set! v1-24 -17.0) + (set! f2-15 (gpr->fpr v1-24)) + (set! f3-10 (gpr->fpr arg2)) + (set! f2-16 (+.s f2-15 f3-10)) + (set! f1-8 (*.s f1-7 f2-16)) + (set! f0-4 (+.s f0-4 f1-8)) + (set! v1-25 (fpr->gpr f0-4)) + ) + ) + (set! v1-26 sv-16) + (set! f1-9 (-> v1-26 dir0 extra x)) + (set! f1-10 (*.s f1-9 f0-4)) + (set! v1-27 sv-16) + (set! (-> v1-27 dir0 extra x) f1-10) + (set! v1-28 sv-16) + (set! f1-11 (-> v1-28 dir1 extra x)) + (set! f1-12 (*.s f1-11 f0-4)) + (set! v1-29 sv-16) + (set! (-> v1-29 dir1 extra x) f1-12) + (set! v1-30 sv-16) + (set! f1-13 (-> v1-30 dir2 extra x)) + (set! f0-5 (*.s f1-13 f0-4)) + (set! v1-31 sv-16) + (set! (-> v1-31 dir2 extra x) f0-5) + (set! v0-1 (fpr->gpr f0-5)) + (ret-value v0-1) + ) + +;; definition for function update-mood-exterior +;; INFO: Used lq/sq +(defun update-mood-exterior ((arg0 mood-context-core3) (arg1 mood-table) (arg2 float) (arg3 int)) + (local-vars (v0-1 object) (sv-32 mood-color) (sv-48 mood-color) (sv-64 vector)) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + 0 + 0 + 0.0 + (let* ((v1-3 (the int arg2)) + (f0-4 (- arg2 (the float v1-3))) + (f1-3 (- 1.0 f0-4)) + (a0-6 (/ v1-3 24)) + (v1-7 (-> arg1 mood-interp-table hour (- v1-3 (* 24 a0-6)))) + (s3-0 (-> v1-7 snapshot1)) + (s2-0 (-> v1-7 snapshot2)) + (f30-0 (+ (* f1-3 (-> v1-7 morph-start)) (* f0-4 (-> v1-7 morph-end)))) + ) + (set! v0-1 + (cond + ((and (-> *level* level arg3 bsp) + (nonzero? (-> *level* level arg3 bsp)) + (not (-> *level* level arg3 bsp ambients)) + ) + (set! v0-1 (-> arg0 times)) + (set! (-> (the-as (inline-array vector) v0-1) 0 x) 1.0) + (set! (-> (the-as (inline-array vector) v0-1) 0 y) 1.0) + (set! (-> (the-as (inline-array vector) v0-1) 0 z) 1.0) + (set! (-> (the-as (inline-array vector) v0-1) 0 w) 1.0) + v0-1 + ) + ((= s3-0 s2-0) + (let ((a2-1 (-> arg1 mood-color-table data s3-0)) + (v1-26 (-> arg0 times)) + (a1-2 (-> arg0 times 1)) + (a0-16 (-> arg0 light-group)) + ) + (set! (-> v1-26 0 quad) (-> a2-1 amb-color quad)) + (set! (-> a1-2 quad) (-> a2-1 lgt-color quad)) + (set! (-> arg0 times 2 quad) (-> a1-2 quad)) + (set! (-> arg0 times 3 quad) (-> a1-2 quad)) + (set! (-> arg0 times 4 quad) (-> a1-2 quad)) + (set! (-> a0-16 0 ambi color quad) (-> v1-26 0 quad)) + ) + (set! (-> arg0 current-sky-color quad) (-> arg1 mood-sky-table data s3-0 quad)) + (mem-copy! (the-as pointer (-> arg0 current-fog)) (the-as pointer (-> arg1 mood-fog-table data s3-0)) 48) + ) + (else + (set! sv-32 (-> arg1 mood-color-table data s3-0)) + (set! sv-48 (-> arg1 mood-color-table data s2-0)) + (let ((s1-0 (-> arg0 times))) + (set! sv-64 (-> arg0 times 1)) + (let ((s0-0 (-> arg0 light-group))) + (vector4-lerp! (the-as vector s1-0) (-> sv-32 amb-color) (-> sv-48 amb-color) f30-0) + (vector4-lerp! sv-64 (-> sv-32 lgt-color) (-> sv-48 lgt-color) f30-0) + (set! (-> arg0 times 2 quad) (-> sv-64 quad)) + (set! (-> arg0 times 3 quad) (-> sv-64 quad)) + (set! (-> arg0 times 4 quad) (-> sv-64 quad)) + (set! (-> s0-0 0 ambi color quad) (-> s1-0 0 quad)) + ) + ) + (vector4-lerp! + (-> arg0 current-sky-color) + (-> arg1 mood-sky-table data s3-0) + (-> arg1 mood-sky-table data s2-0) + f30-0 + ) + (vector4-array-lerp! + (the-as (inline-array vector4) (-> arg0 current-fog)) + (the-as (inline-array vector4) (-> arg1 mood-fog-table data s3-0)) + (the-as (inline-array vector4) (-> arg1 mood-fog-table data s2-0)) + f30-0 + 3 + ) + ) + ) + ) + ) + (set-vector! (-> arg0 current-prt-color) 0.0 0.0 0.0 0.0) + (set-vector! (-> arg0 current-env-color) 0.0 0.0 0.0 0.0) + (let ((f0-18 (-> *mood-control* lightning-flash)) + (a0-36 (-> *mood-control* lightning-index)) + ) + (when (and (!= f0-18 0.0) (< a0-36 4)) + (let ((v1-64 (new 'stack-no-clear 'vector)) + (a0-40 (-> arg0 times (+ a0-36 1))) + ) + (set-vector! v1-64 f0-18 f0-18 f0-18 0.0) + (vector+! a0-40 a0-40 v1-64) + ) + ) + ) + (update-mood-direction arg0 arg1 arg2) + ) + ) + ) + +;; definition for function copy-mood-exterior +;; INFO: Used lq/sq +(defun copy-mood-exterior ((arg0 mood-context)) + (set! (-> *time-of-day-context* exterior-level) (the-as basic #t)) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((v1-2 (the-as object arg0)) + (a1-4 (the-as (inline-array vector) (-> *level* default-level mood-context))) + ) + (dotimes (a2-0 31) + (set! (-> (the-as (inline-array vector) v1-2) 0 quad) (-> a1-4 0 quad)) + (set! v1-2 (-> (the-as (inline-array vector) v1-2) 1)) + (set! a1-4 (the-as (inline-array vector) (-> a1-4 1))) + ) + ) + (let ((v1-5 (-> arg0 times)) + (a0-2 (the-as (inline-array vector) (+ #x83ac (the-as int *level*)))) + ) + (dotimes (a1-6 5) + (set! (-> v1-5 0 quad) (-> a0-2 0 quad)) + (set! v1-5 (the-as (inline-array vector) (-> v1-5 1))) + (set! a0-2 (the-as (inline-array vector) (-> a0-2 1))) + ) + ) + #f + ) + ) + ) + +;; definition for function copy-mood-exterior-ambi +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defun copy-mood-exterior-ambi ((arg0 mood-context) (arg1 symbol)) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((v1-1 arg0) + (a2-3 (the-as structure (-> *level* default-level mood-context))) + ) + (dotimes (a3-0 31) + (set! (-> v1-1 current-fog fog-color quad) (-> (the-as mood-context a2-3) current-fog fog-color quad)) + (set! v1-1 (the-as mood-context (-> v1-1 current-fog fog-dists))) + (set! a2-3 (-> (the-as mood-context a2-3) current-fog fog-dists)) + ) + ) + (set! (-> arg0 times 0 quad) (-> (the-as (pointer uint128) (+ #x83ac (the-as int *level*))))) + (when arg1 + (set! (-> arg0 times 1 quad) (-> (the-as (pointer uint128) (+ #x83bc (the-as int *level*))))) + (set! (-> arg0 times 1 w) 1.0) + ) + ) + ) + (none) + ) + +;; definition for function clear-mood-context +;; INFO: Used lq/sq +(defun clear-mood-context ((arg0 mood-context)) + (let ((v1-0 arg0)) + (dotimes (a1-0 123) + (set! (-> v1-0 data a1-0) (the-as uint128 0)) + ) + ) + (dotimes (v1-3 8) + (set-vector! (-> arg0 times v1-3) 1.0 1.0 1.0 0.0) + ) + #f + ) + +;; definition for function update-mood-interior +;; INFO: Used lq/sq +(defun update-mood-interior ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group))) + (set! (-> arg0 current-fog fog-color quad) (-> *level* default-level mood-context current-fog fog-color quad)) + (set-vector! (-> arg0 current-fog fog-dists) 98304.0 3072000.0 255.0 150.0) + (set-vector! (-> arg0 current-fog erase-color) 0.0 0.0 0.0 128.0) + (set-vector! (-> arg0 current-prt-color) 0.0 0.0 0.0 0.0) + (set-vector! (-> arg0 current-env-color) 96.0 96.0 96.0 128.0) + (set-vector! (-> arg0 current-sky-color) 0.0 0.0 0.0 1.0) + (let ((a0-2 (-> v1-0 0))) + (set! (-> a0-2 dir0 direction x) 0.0) + (set! (-> a0-2 dir0 direction y) 1.0) + (set! (-> a0-2 dir0 direction z) 0.0) + (set! (-> a0-2 dir0 direction w) 0.0) + ) + (set-vector! (-> v1-0 0 dir0 color) 0.667 0.667 0.667 1.0) + (set-vector! (-> v1-0 0 ambi color) 0.333 0.333 0.333 1.0) + (set! (-> v1-0 0 dir0 extra x) 1.0) + (set! (-> v1-0 0 dir1 extra x) 0.0) + (set! (-> v1-0 0 dir2 extra x) 0.0) + (let ((f0-35 1.0)) + (set! (-> v1-0 0 ambi extra x) f0-35) + f0-35 + ) + ) + ) + +;; definition of type flames-state +(deftype flames-state (structure) + ((time float :offset-assert 0) + (index uint8 :offset-assert 4) + (length uint8 :offset-assert 5) + (height uint8 :offset-assert 6) + ) + :pack-me + :method-count-assert 9 + :size-assert #x7 + :flag-assert #x900000007 + ) + +;; definition for method 3 of type flames-state +(defmethod inspect flames-state ((obj flames-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'flames-state) + (format #t "~1Ttime: ~f~%" (-> obj time)) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Theight: ~D~%" (-> obj height)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-flames +(defbehavior update-mood-flames time-of-day-proc ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 int) (arg4 float) (arg5 float) (arg6 float)) + (let* ((gp-0 (the-as flames-state (+ (+ arg3 1840) (the-as int arg0)))) + (s4-0 (+ (-> gp-0 index) arg1)) + (f0-0 (-> gp-0 time)) + (v1-2 (-> gp-0 length)) + (s0-0 (-> gp-0 height)) + ) + (dotimes (a0-1 arg2) + (set! (-> arg0 times (+ arg1 a0-1) w) arg4) + ) + (cond + ((>= f0-0 (the float v1-2)) + (set! (-> gp-0 index) (the-as uint (the int (rand-vu-float-range 0.0 (+ -0.01 (the float arg2)))))) + (set! (-> gp-0 time) 0.0) + (set! (-> gp-0 length) (the-as uint (the int (* (rand-vu-float-range 7.0 15.0) arg6)))) + (set! (-> gp-0 height) (the-as uint (the int (rand-vu-float-range 0.0 255.0)))) + (let ((f0-11 arg4)) + (set! (-> arg0 times s4-0 w) f0-11) + f0-11 + ) + ) + (else + (let ((f0-14 (sin (* 32768.0 (/ f0-0 (the float v1-2)))))) + (set! (-> arg0 times s4-0 w) (+ (* (the float s0-0) f0-14 arg5) arg4)) + ) + (when (not (paused?)) + (let ((f0-19 (+ (-> gp-0 time) (if (= (-> *display* bg-clock clock-ratio) 0.0) + 1.0 + (-> self clock time-adjust-ratio) + ) + ) + ) + ) + (set! (-> gp-0 time) f0-19) + f0-19 + ) + ) + ) + ) + ) + ) + +;; definition for symbol *flash0*, type (array float) +(define *flash0* + (the-as (array float) + (new 'static 'boxed-array :type float 1.0 0.0 0.5 1.0 0.5 0.0 0.5 0.35 0.4 0.35 0.25 0.1 0.04) + ) + ) + +;; definition for symbol *flash1*, type (array float) +(define *flash1* + (the-as (array float) (new 'static 'boxed-array :type float 1.0 0.8 0.0 1.0 0.5 1.0 0.4 0.2 0.1)) + ) + +;; definition for symbol *flash2*, type (array float) +(define *flash2* + (the-as (array float) (new 'static 'boxed-array :type float 1.0 0.9 0.8 0.7 0.0 0.0 1.0 0.0 1.0 0.5)) + ) + +;; definition for symbol *flash3*, type (array float) +(define *flash3* + (the-as (array float) + (new 'static 'boxed-array :type float 0.5 0.0 1.0 0.9 1.0 0.8 0.3 0.0 0.0 0.5 0.1 0.5 0.35) + ) + ) + +;; definition for symbol *flash4*, type (array float) +(define *flash4* + (the-as (array float) + (new 'static 'boxed-array :type float 1.0 0.0 1.0 0.0 1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.5 0.4 0.3 0.2 0.1) + ) + ) + +;; definition for symbol *flash5*, type (array float) +(define *flash5* (the-as (array float) (new 'static 'boxed-array :type float + 1.0 + 0.0 + 1.0 + 0.0 + 1.0 + 0.95 + 0.9 + 0.85 + 0.8 + 0.75 + 0.7 + 0.65 + 0.6 + 0.55 + 0.5 + 0.45 + 0.4 + 0.35 + 0.3 + 0.25 + 0.2 + 0.5 + 0.45 + 0.4 + 0.35 + 0.3 + 0.25 + 0.2 + 0.15 + 0.1 + 0.05 + ) + ) + ) + +;; definition for symbol *flash6*, type (array float) +(define *flash6* + (the-as (array float) + (new 'static 'boxed-array :type float 1.0 0.0 1.0 0.0 0.5 0.0 0.5 0.35 0.0 0.0 1.0 0.0 0.2 0.1) + ) + ) + +;; definition for symbol *flash7*, type (array float) +(define *flash7* + (the-as (array float) + (new 'static 'boxed-array :type float 1.0 0.8 0.3 0.0 0.6 0.5 0.4 0.3 0.2 0.5 0.4 0.3 0.2 0.1) + ) + ) + +;; definition of type light-state +(deftype light-state (structure) + ((time float :offset-assert 0) + (fade float :offset-assert 4) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type light-state +(defmethod inspect light-state ((obj light-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'light-state) + (format #t "~1Ttime: ~f~%" (-> obj time)) + (format #t "~1Tfade: ~f~%" (-> obj fade)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-light +(defun update-mood-light ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 float) (arg6 float) (arg7 float)) + (with-pp + (let ((gp-0 (the-as light-state (+ (+ arg2 1840) (the-as int arg0))))) + (let* ((f0-0 512.0) + (f1-1 (+ (-> gp-0 time) arg6)) + (f28-0 (* f0-0 (- f1-1 (* (the float (the int (/ f1-1 256.0))) 256.0)))) + (f0-3 (+ arg3 (* (cos f28-0) arg4))) + (f30-1 (-> gp-0 fade)) + ) + (cond + ((or (>= arg5 18.0) (>= 6.0 arg5)) + (cond + ((< f28-0 3640.889) + (set! (-> arg0 times arg1 w) f0-3) + (set! (-> gp-0 fade) 1.0) + ) + ((= f30-1 1.0) + (set! (-> arg0 times arg1 w) f0-3) + ) + ) + ) + ((= f30-1 1.0) + (cond + ((< f28-0 3640.889) + (set! (-> arg0 times arg1 w) f0-3) + (set! (-> gp-0 fade) 0.99) + ) + (else + (set! (-> arg0 times arg1 w) f0-3) + ) + ) + ) + ((and (< f30-1 1.0) (< 0.0 f30-1)) + (set! (-> arg0 times arg1 w) f30-1) + (when (not (paused?)) + (if (< 0.75 f30-1) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.04 (-> pp clock time-adjust-ratio)))) + (set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.02 (-> pp clock time-adjust-ratio)))) + ) + ) + ) + (else + (set! (-> gp-0 fade) 0.0) + (set! (-> gp-0 time) 0.0) + ) + ) + ) + (when (not (paused?)) + (let ((f0-15 (-> gp-0 time))) + (set! arg7 (cond + ((= (-> *display* bg-clock clock-ratio) 0.0) + (empty) + arg7 + ) + (else + (* arg7 (-> pp clock time-adjust-ratio)) + ) + ) + ) + (let ((f0-16 (+ f0-15 arg7))) + (set! (-> gp-0 time) f0-16) + f0-16 + ) + ) + ) + ) + ) + ) + +;; definition of type lava-state +(deftype lava-state (structure) + ((lava float :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type lava-state +(defmethod inspect lava-state ((obj lava-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'lava-state) + (format #t "~1Tlava: ~f~%" (-> obj lava)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-lava +(defun update-mood-lava ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 float) (arg6 float) (arg7 float)) + "Unused" + (let ((gp-0 (the-as lava-state (+ (+ arg2 1840) (the-as int arg0))))) + (let ((f0-1 (cos (-> gp-0 lava)))) + (set! (-> arg0 times arg1 w) (+ arg3 (* f0-1 arg4))) + (set! (-> arg0 times (+ arg1 1) w) (+ arg3 (* (- f0-1) arg4))) + ) + (when (not (paused?)) + (let ((f0-6 (+ (-> gp-0 lava) arg5))) + (set! (-> gp-0 lava) f0-6) + f0-6 + ) + ) + ) + ) + +;; definition of type flicker-state +(deftype flicker-state (structure) + ((flicker-off uint8 :offset-assert 0) + (flicker-on uint8 :offset-assert 1) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +;; definition for method 3 of type flicker-state +(defmethod inspect flicker-state ((obj flicker-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'flicker-state) + (format #t "~1Tflicker-off: ~D~%" (-> obj flicker-off)) + (format #t "~1Tflicker-on: ~D~%" (-> obj flicker-on)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-flicker +;; WARN: Return type mismatch int vs none. +(defun update-mood-flicker ((arg0 mood-context) (arg1 int) (arg2 int)) + "Unused" + (let ((gp-0 (the-as flicker-state (+ (+ arg2 1840) (the-as int arg0))))) + (cond + ((nonzero? (-> gp-0 flicker-on)) + (set! (-> arg0 times arg1 w) 1.0) + (if (not (paused?)) + (+! (-> gp-0 flicker-on) -1) + ) + ) + ((nonzero? (-> gp-0 flicker-off)) + (if (not (paused?)) + (+! (-> gp-0 flicker-off) -1) + ) + ) + (else + (set! (-> gp-0 flicker-on) (the-as uint (the int (rand-vu-float-range 2.0 20.0)))) + (if (zero? (the int (rand-vu-float-range 0.0 3.0))) + (set! (-> gp-0 flicker-off) (the-as uint (the int (rand-vu-float-range 2.0 120.0)))) + (set! (-> gp-0 flicker-off) (the-as uint (the int (rand-vu-float-range 2.0 20.0)))) + ) + ) + ) + ) + (none) + ) + +;; definition of type florescent-state +(deftype florescent-state (structure) + ((value float :offset-assert 0) + (delay int8 :offset-assert 4) + (delay2 int8 :offset-assert 5) + ) + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 + ) + +;; definition for method 3 of type florescent-state +(defmethod inspect florescent-state ((obj florescent-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'florescent-state) + (format #t "~1Tvalue: ~f~%" (-> obj value)) + (format #t "~1Tdelay: ~D~%" (-> obj delay)) + (format #t "~1Tdelay2: ~D~%" (-> obj delay2)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-florescent +(defun update-mood-florescent ((arg0 mood-context) (arg1 int) (arg2 int)) + "Unused" + (let ((gp-0 (the-as florescent-state (+ (+ arg2 1840) (the-as int arg0))))) + (set! (-> arg0 times arg1 w) (-> gp-0 value)) + (when (not (paused?)) + (cond + ((zero? (-> gp-0 delay)) + (set! (-> gp-0 delay2) (the int (rand-vu-float-range 10.0 60.0))) + (set! (-> gp-0 delay) (the int (rand-vu-float-range 60.0 120.0))) + ) + (else + (+! (-> gp-0 delay) -1) + ) + ) + (cond + ((>= (-> gp-0 delay2) (-> gp-0 delay)) + (let ((f0-5 (rand-vu-float-range 1.0 1.5))) + (set! (-> gp-0 value) f0-5) + f0-5 + ) + ) + ((< (-> gp-0 delay2) (-> gp-0 delay)) + (let ((f0-6 1.5)) + (set! (-> gp-0 value) f0-6) + f0-6 + ) + ) + ) + ) + ) + ) + +;; definition of type electricity-state +(deftype electricity-state (structure) + ((value float :offset-assert 0) + (scale float :offset-assert 4) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type electricity-state +(defmethod inspect electricity-state ((obj electricity-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'electricity-state) + (format #t "~1Tvalue: ~f~%" (-> obj value)) + (format #t "~1Tscale: ~f~%" (-> obj scale)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-electricity +;; WARN: Return type mismatch float vs none. +(defun update-mood-electricity ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 float) (arg4 float)) + (let ((gp-0 (the-as electricity-state (+ (+ arg2 1840) (the-as int arg0))))) + (set! (-> arg0 times arg1 w) (* (-> gp-0 value) (-> gp-0 scale))) + (if (not (paused?)) + (set! (-> gp-0 value) (rand-vu-float-range arg3 arg4)) + ) + ) + (none) + ) + +;; definition of type pulse-state +(deftype pulse-state (structure) + ((pulse float :offset-assert 0) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type pulse-state +(defmethod inspect pulse-state ((obj pulse-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'pulse-state) + (format #t "~1Tpulse: ~f~%" (-> obj pulse)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-pulse +;; WARN: Return type mismatch float vs none. +(defun update-mood-pulse ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) + (let ((gp-0 (the-as pulse-state (+ (+ arg2 1840) (the-as int arg0))))) + (set! (-> arg0 times arg1 w) (+ arg3 (* (cos (+ (-> gp-0 pulse) arg6)) arg4))) + (if (not (paused?)) + (+! (-> gp-0 pulse) arg5) + ) + ) + (none) + ) + +;; definition of type strobe-state +(deftype strobe-state (structure) + ((time float :offset-assert 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type strobe-state +(defmethod inspect strobe-state ((obj strobe-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'strobe-state) + (format #t "~1Ttime: ~f~%" (-> obj time)) + (label cfg-4) + obj + ) + +;; definition for function update-mood-strobe +(defun update-mood-strobe ((arg0 mood-context) (arg1 int) (arg2 int) (arg3 int) (arg4 float)) + (let ((gp-0 (the-as strobe-state (+ (+ arg2 1840) (the-as int arg0))))) + (let ((a2-1 (the int (-> gp-0 time)))) + (if (logtest? arg3 (ash 1 a2-1)) + (set! (-> arg0 times arg1 w) 1.0) + (set! (-> arg0 times arg1 w) 0.3) + ) + ) + (when (not (paused?)) + (let* ((f0-5 (+ (-> gp-0 time) arg4)) + (f0-6 (- f0-5 (* (the float (the int (/ f0-5 32.0))) 32.0))) + ) + (set! (-> gp-0 time) f0-6) + f0-6 + ) + ) + ) + ) + +;; definition for function update-mood-caustics +(defun update-mood-caustics ((arg0 mood-context) (arg1 int) (arg2 float) (arg3 float) (arg4 float) (arg5 float)) + (let* ((f0-2 (sin (+ arg2 arg3))) (f0-4 (+ arg4 (* f0-2 arg5)))) (set! (-> arg0 times arg1 w) f0-4) f0-4) + ) + +;; definition for method 13 of type mood-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod apply-mood-clouds-and-fog mood-control ((obj mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> obj mood-fog-table))) + (dotimes (a0-1 24) + (set! (-> v1-0 data-raw a0-1) (the-as uint128 0)) + ) + ) + (let ((s4-0 (-> obj mood-fog-table))) + (let ((f30-0 (- 1.0 (-> arg0 interp cloud)))) + (when (!= f30-0 0.0) + (let ((f0-4 (* (- 1.0 (-> arg0 interp fog)) f30-0)) + (a2-0 (-> obj fogs (-> arg0 index 0))) + ) + (if (!= f0-4 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-0) + f0-4 + 24 + ) + ) + ) + (let ((f0-6 (* (-> arg0 interp fog) f30-0)) + (a2-1 (-> obj fogs (-> arg0 index 1))) + ) + (if (!= f0-6 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-1) + f0-6 + 24 + ) + ) + ) + ) + ) + (let ((f30-1 (-> arg0 interp cloud))) + (when (!= f30-1 0.0) + (let ((f0-10 (* (- 1.0 (-> arg0 interp fog)) f30-1)) + (a2-2 (-> obj fogs (-> arg0 index 2))) + ) + (if (!= f0-10 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-2) + f0-10 + 24 + ) + ) + ) + (let ((f0-12 (* (-> arg0 interp fog) f30-1)) + (a2-3 (-> obj fogs (-> arg0 index 3))) + ) + (if (!= f0-12 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-3) + f0-12 + 24 + ) + ) + ) + ) + ) + ) + (let ((f0-13 (-> *time-of-day-context* fog-mult)) + (v1-29 (-> obj mood-fog-table)) + ) + (dotimes (a0-6 8) + (set! (-> v1-29 data a0-6 fog-dists y) (* (-> v1-29 data a0-6 fog-dists y) f0-13)) + ) + ) + 0 + (none) + ) + +;; definition for method 14 of type mood-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod apply-mood-color mood-control ((obj mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> obj mood-color-table))) + (dotimes (a0-1 16) + (set! (-> v1-0 data-raw a0-1) (the-as uint128 0)) + ) + ) + (let ((s4-0 (-> obj mood-color-table))) + (let ((f0-1 (- 1.0 (-> arg0 color-interp))) + (a2-0 (-> obj colors (-> arg0 color-index 0))) + ) + (if (!= f0-1 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-0) + f0-1 + 16 + ) + ) + ) + (let ((f0-2 (-> arg0 color-interp)) + (a2-1 (-> obj colors (-> arg0 color-index 1))) + ) + (if (!= f0-2 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-1) + f0-2 + 16 + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 15 of type mood-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod apply-mood-channels mood-control ((obj mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> obj mood-channel-group))) + (dotimes (a0-1 24) + (set! (-> v1-0 data 0 vecs a0-1 quad) (the-as uint128 0)) + ) + ) + (let ((s4-0 (-> obj mood-channel-group))) + (let ((f0-1 (- 1.0 (-> arg0 channel-interp))) + (a2-0 (-> obj channels (-> arg0 channel-index 0))) + ) + (if (!= f0-1 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-0) + f0-1 + 24 + ) + ) + ) + (let ((f0-2 (-> arg0 channel-interp)) + (a2-1 (-> obj channels (-> arg0 channel-index 1))) + ) + (if (!= f0-2 0.0) + (vector4-array-madd! + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) s4-0) + (the-as (inline-array vector4) a2-1) + f0-2 + 24 + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 16 of type mood-control +;; WARN: Return type mismatch int vs none. +(defmethod adjust-num-clouds! mood-control ((obj mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> obj mood-clouds))) + (set! (-> v1-0 cloud-min) 0.0) + (set! (-> v1-0 cloud-max) 0.0) + (let ((f0-3 (- 1.0 (-> arg0 cloud-interp))) + (a2-4 (-> obj clouds (-> arg0 cloud-index 0))) + ) + (when (!= f0-3 0.0) + (set! (-> v1-0 cloud-min) (* (-> a2-4 cloud-min) f0-3)) + (set! (-> v1-0 cloud-max) (* (-> a2-4 cloud-max) f0-3)) + ) + ) + (let ((f0-5 (-> arg0 cloud-interp)) + (a0-2 (-> obj clouds (-> arg0 cloud-index 1))) + ) + (when (!= f0-5 0.0) + (+! (-> v1-0 cloud-min) (* (-> a0-2 cloud-min) f0-5)) + (+! (-> v1-0 cloud-max) (* (-> a0-2 cloud-max) f0-5)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 18 of type mood-control +;; WARN: Return type mismatch int vs sound-id. +(defmethod play-or-stop-lightning! mood-control ((obj mood-control) (arg0 sound-spec) (arg1 vector)) + "Handles playing/stopping of the lightning sound + - Plays the lightning sound if we are not loading and `lightning-id` is zero + - Stops the lightning sound first if `lightning-id` is non-zero + Returns the current value of `lightning-id`" + (vector+! (new 'stack-no-clear 'vector) arg1 (math-camera-pos)) + (the-as sound-id (cond + ((or (load-in-progress? *level*) (movie?)) + (the-as sound-id (when (nonzero? (-> obj lightning-id)) + (sound-stop (-> obj lightning-id)) + (set! (-> obj lightning-id) (new 'static 'sound-id)) + (new 'static 'sound-id) + ) + ) + ) + (else + (when (nonzero? (-> obj lightning-id)) + (sound-stop (-> obj lightning-id)) + (set! (-> obj lightning-id) (new 'static 'sound-id)) + 0 + ) + (let ((lightning-sound-id (sound-play-by-spec arg0 (new-sound-id) arg1))) + (set! (-> obj lightning-id) lightning-sound-id) + lightning-sound-id + ) + ) + ) + ) + ) + +;; definition for method 17 of type mood-control +;; INFO: Used lq/sq +;; WARN: disable def twice: 141. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod gen-lightning-and-thunder! mood-control ((obj mood-control)) + (local-vars (a1-1 (array float))) + (with-pp + (let ((v1-3 (-> obj mood-channel-group data (-> obj lightning-index) vecs)) + (a1-0 (-> obj lightning-val)) + (a0-4 (/ (-> obj lightning-time) 2)) + (f0-0 (-> obj lightning-time2)) + ) + (set! (-> obj lightning-flash) 0.0) + (cond + ((>= 0.0 f0-0) + (cond + ((zero? a1-0) + (set! a1-1 *flash0*) + ) + ((= a1-0 1) + (set! a1-1 *flash1*) + ) + ((= a1-0 2) + (set! a1-1 *flash2*) + ) + ((= a1-0 3) + (set! a1-1 *flash3*) + ) + ((= a1-0 4) + (set! a1-1 *flash4*) + ) + ((= a1-0 5) + (set! a1-1 *flash5*) + ) + ((= a1-0 6) + (set! a1-1 *flash6*) + ) + (else + (set! a1-1 *flash7*) + ) + ) + (cond + ((< a0-4 (-> a1-1 length)) + (let ((f30-0 (-> a1-1 a0-4)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((= (-> obj lightning-index) 4) + (set! (-> obj lightning-flash) f30-0) + ) + ((= (-> obj lightning-index) 5) + (set! (-> obj lightning-flash) f30-0) + (dotimes (s4-0 8) + (set-vector! s5-0 255.0 255.0 255.0 128.0) + (vector4-lerp! + (the-as vector (-> obj mood-fog-table data s4-0)) + (the-as vector (-> obj mood-fog-table data s4-0)) + s5-0 + f30-0 + ) + ) + ) + (else + (set! (-> obj lightning-flash) (* 1.9921875 f30-0)) + (set-vector! (-> v1-3 0) 1.0 1.0 1.0 1.0) + (set! (-> v1-3 1 quad) (-> v1-3 0 quad)) + (set! (-> v1-3 2 quad) (-> v1-3 0 quad)) + (set! (-> v1-3 3 quad) (-> v1-3 0 quad)) + (set! (-> v1-3 4 quad) (-> v1-3 0 quad)) + (set! (-> v1-3 5 quad) (-> v1-3 0 quad)) + ) + ) + ) + (when (not (paused?)) + (let ((v0-2 (the-as number (+ (-> obj lightning-time) 1)))) + (set! (-> obj lightning-time) (the-as int v0-2)) + v0-2 + ) + ) + ) + ((and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) name) 'nest)) + (let ((f0-11 (rand-vu-float-range 3.0 5.0))) + (set! (-> obj lightning-time2) f0-11) + f0-11 + ) + ) + (else + (let ((f0-12 (rand-vu-float-range 15.0 20.0))) + (set! (-> obj lightning-time2) f0-12) + f0-12 + ) + ) + ) + ) + (else + (when (not (paused?)) + (set! (-> obj lightning-time2) (- (-> obj lightning-time2) (-> pp clock seconds-per-frame))) + (when (>= 0.0 (-> obj lightning-time2)) + (set! (-> obj lightning-index) (mod (the-as int (rand-uint31-gen *random-generator*)) 6)) + (set! (-> obj lightning-val) (the-as int (logand (rand-uint31-gen *random-generator*) 7))) + (set! (-> obj lightning-time) 0) + (cond + ((zero? (-> obj lightning-index)) + (play-or-stop-lightning! + obj + (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "thunder-b") + :volume #x400 + ) + (new 'static 'vector :x 37109760.0 :y 16261120.0 :z 5857280.0) + ) + ) + ((= (-> obj lightning-index) 1) + (play-or-stop-lightning! + obj + (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "thunder-b") + :volume #x400 + ) + (new 'static 'vector :x 20480000.0 :y 33341440.0 :z 12124160.0) + ) + ) + ((= (-> obj lightning-index) 2) + (play-or-stop-lightning! + obj + (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "thunder-b") + :volume #x400 + ) + (new 'static 'vector :x -20480000.0 :y 33341440.0 :z 12124160.0) + ) + ) + ((= (-> obj lightning-index) 3) + (play-or-stop-lightning! + obj + (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "thunder-b") + :volume #x400 + ) + (new 'static 'vector :x -37109760.0 :y 16261120.0 :z 5857280.0) + ) + ) + ((= (-> obj lightning-index) 4) + (play-or-stop-lightning! + obj + (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "thunder-c") + :volume #x400 + ) + (new 'static 'vector :y 40960000.0) + ) + ) + ((= (-> obj lightning-index) 5) + (play-or-stop-lightning! + obj + (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "thunder-a") + :volume #x400 + ) + (new 'static 'vector :y 40960000.0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 9 of type mood-control +;; WARN: Return type mismatch int vs none. +(defmethod init-weather! mood-control ((obj mood-control)) + (local-vars (v1-39 int)) + (let ((s5-0 (level-get-target-inside *level*))) + (when s5-0 + (cond + ((= (-> s5-0 info taskname) 'drill) + (mem-copy! (the-as pointer (-> obj mood-fog-table)) (the-as pointer *drill-mood-fog-table*) 384) + (mem-copy! (the-as pointer (-> obj mood-color-table)) (the-as pointer *drill-mood-color-table*) 256) + (set! (-> obj mood-direction-table) *drill-mood-direction-table*) + (set! (-> obj mood-clouds cloud-min) (-> *clouds-1000* cloud-min)) + (set! (-> obj mood-clouds cloud-max) (-> *clouds-1000* cloud-max)) + ) + (else + (set! (-> obj mood-direction-table) *mood-direction-table*) + (let ((s4-0 (new 'stack-no-clear 'mood-control-work))) + (cond + ((and (-> obj overide-weather-flag) (not (movie?))) + (set! (-> s4-0 weather cloud) (* 2.0 (fmax 0.0 (fmin 1.0 (-> obj overide cloud))))) + (set! (-> s4-0 weather fog) (* 2.0 (-> obj overide fog))) + ) + (else + (set! (-> s4-0 weather cloud) (* 2.0 (fmax 0.0 (fmin 1.0 (-> obj current-interp cloud))))) + (set! (-> s4-0 weather fog) (* 2.0 (fmax 0.0 (fmin 1.0 (-> obj current-interp fog))))) + ) + ) + (set! (-> s4-0 iweather cloud) (the int (-> s4-0 weather cloud))) + (let ((f0-13 (- (-> s4-0 weather cloud) (the float (-> s4-0 iweather cloud))))) + (cond + ((zero? (-> s4-0 iweather cloud)) + (if (< f0-13 0.5) + (set! (-> s4-0 interp cloud) 0.0) + (set! (-> s4-0 interp cloud) (* 2.0 (+ -0.5 f0-13))) + ) + ) + (else + (set! (-> s4-0 interp cloud) f0-13) + ) + ) + ) + (set! (-> s4-0 iweather fog) (the int (-> s4-0 weather fog))) + (set! (-> s4-0 interp fog) (- (-> s4-0 weather fog) (the float (-> s4-0 iweather fog)))) + (let ((a0-6 (-> s4-0 iweather fog)) + (v1-30 (-> s4-0 iweather cloud)) + ) + (set! (-> s4-0 index 0) (+ (* 3 (the-as int v1-30)) (the-as int a0-6))) + (set! (-> s4-0 index 1) (the-as int (+ a0-6 1 (* 3 (the-as int v1-30))))) + (set! (-> s4-0 index 2) (+ (* 3 (the-as int (+ v1-30 1))) (the-as int a0-6))) + (set! (-> s4-0 index 3) (the-as int (+ a0-6 1 (* 3 (the-as int (+ v1-30 1)))))) + ) + (let ((v1-34 (-> s4-0 iweather cloud))) + (set! (-> s4-0 color-interp) (-> s4-0 interp cloud)) + (set! (-> s4-0 color-index 0) (the-as int v1-34)) + (set! (-> s4-0 color-index 1) (the-as int (+ v1-34 1))) + ) + 0 + (let ((f0-23 (- (-> s4-0 weather cloud) (the float (-> s4-0 iweather cloud))))) + (cond + ((zero? (-> s4-0 iweather cloud)) + (set! (-> s4-0 channel-interp) 0.0) + (set! v1-39 0) + ) + ((= (-> s4-0 iweather cloud) 2) + (set! (-> s4-0 channel-interp) 0.0) + (set! v1-39 2) + ) + ((< f0-23 0.5) + (set! (-> s4-0 channel-interp) (* 2.0 f0-23)) + (set! v1-39 0) + ) + (else + (set! (-> s4-0 channel-interp) (* 2.0 (+ -0.5 f0-23))) + (set! v1-39 1) + ) + ) + ) + (set! (-> s4-0 channel-index 0) v1-39) + (set! (-> s4-0 channel-index 1) (+ v1-39 1)) + (let* ((f0-33 (if (and (-> obj overide-weather-flag) (not (movie?))) + (* 8.0 (-> obj overide cloud)) + (* 8.0 (fmax 0.0 (fmin 1.0 (-> obj current-interp cloud)))) + ) + ) + (v1-52 (the int f0-33)) + ) + (set! (-> s4-0 cloud-interp) (- f0-33 (the float v1-52))) + (set! (-> s4-0 cloud-index 0) v1-52) + (set! (-> s4-0 cloud-index 1) (+ v1-52 1)) + ) + (apply-mood-clouds-and-fog obj s4-0) + (apply-mood-color obj s4-0) + (apply-mood-channels obj s4-0) + (adjust-num-clouds! obj s4-0) + ) + (when (not (or (paused?) (and (-> obj overide-weather-flag) (not (movie?))))) + (set! (-> obj target-interp cloud) + (fmax (fmin (-> obj target-interp cloud) (-> obj range max-cloud)) (-> obj range min-cloud)) + ) + (set! (-> obj target-interp fog) + (fmax (fmin (-> obj target-interp fog) (-> obj range max-fog)) (-> obj range min-fog)) + ) + (seek! + (-> obj current-interp cloud) + (-> obj target-interp cloud) + (* (/ 1.0 (-> obj speed-interp cloud)) (-> self clock seconds-per-frame)) + ) + (seek! + (-> obj current-interp fog) + (-> obj target-interp fog) + (* (/ 1.0 (-> obj speed-interp fog)) (-> self clock seconds-per-frame)) + ) + (when (!= (-> obj time-until-random cloud) -99.0) + (set! (-> obj time-until-random cloud) + (- (-> obj time-until-random cloud) (* 300.0 (-> self clock seconds-per-frame))) + ) + (when (< (-> obj time-until-random cloud) 0.0) + (set! (-> obj time-until-random cloud) + (rand-vu-float-range (-> obj time-until-random-min cloud) (-> obj time-until-random-max cloud)) + ) + (let ((f30-0 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) + (f28-0 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) + (f26-0 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) + (f24-0 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) + (f1-36 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) + ) + (set! (-> obj target-interp cloud) (fabs (+ -0.25 (* 0.25 (+ f30-0 f28-0 f26-0 f24-0 f1-36))))) + ) + (set! (-> obj speed-interp cloud) (rand-vu-float-range 30.0 120.0)) + (when (and (< 0.0 (-> *setting-control* user-current rain)) + (< (-> obj target-interp cloud) 0.5) + (< 0.25 (-> obj target-interp cloud)) + (or (< (-> obj target-interp fog) 0.25) (< 0.75 (-> obj target-interp fog))) + ) + (set! (-> obj speed-interp fog) + (fabs + (/ (* 1.25 (-> obj current-interp fog) (-> obj speed-interp cloud)) (+ -0.75 (-> obj current-interp cloud))) + ) + ) + (set! (-> obj target-interp fog) 0.5) + (set! (-> obj time-until-random fog) (-> obj time-until-random cloud)) + ) + ) + ) + (when (!= (-> obj time-until-random fog) -99.0) + (set! (-> obj time-until-random fog) + (- (-> obj time-until-random fog) (* 300.0 (-> self clock seconds-per-frame))) + ) + (when (< (-> obj time-until-random fog) 0.0) + (set! (-> obj time-until-random fog) + (rand-vu-float-range (-> obj time-until-random-min fog) (-> obj time-until-random-max fog)) + ) + (let ((f30-1 (rand-vu-float-range (-> obj range min-fog) (-> obj range max-fog))) + (f28-1 (rand-vu-float-range (-> obj range min-fog) (-> obj range max-fog))) + (f26-1 (rand-vu-float-range (-> obj range min-fog) (-> obj range max-fog))) + (f1-52 (rand-vu-float-range (-> obj range min-fog) (-> obj range max-fog))) + ) + (set! (-> obj target-interp fog) (fabs (+ -1.0 (* 0.5 (+ f30-1 f28-1 f26-1 f1-52))))) + ) + (set! (-> obj speed-interp fog) (rand-vu-float-range 30.0 120.0)) + ) + ) + ) + (let ((f30-2 (if (and (-> obj overide-weather-flag) (not (movie?))) + (-> obj overide cloud) + (-> obj current-interp cloud) + ) + ) + (f26-2 (if (and (-> obj overide-weather-flag) (not (movie?))) + (-> obj overide fog) + (-> obj current-interp fog) + ) + ) + (f28-2 (fmin (-> s5-0 info max-rain) (-> *time-of-day-context* max-rain))) + ) + (set! (-> obj sound-pitch) (* 1.442695 (logf (-> *display* bg-clock clock-ratio)))) + (let* ((f0-114 (fmax 0.0 (fmin (* 4.0 (fmax 0.0 (+ -0.5 f26-2)) (fmax 0.0 (+ -0.5 f30-2))) f28-2))) + (f30-3 (fmin 0.75 f0-114)) + ) + (set! (-> *setting-control* user-default rain) f30-3) + (cond + ((and (or (and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) name) 'nest)) + (< 0.0 (-> *setting-control* user-current rain)) + ) + (!= *master-mode* 'progress) + ) + (gen-lightning-and-thunder! obj) + (cond + ((zero? (-> obj rain-id)) + (set! (-> obj rain-id) (the-as uint (sound-play-by-name + (static-sound-name "rain-hiss") + (new-sound-id) + (the int (* 1024.0 f30-3)) + (the int (* 1524.0 (-> obj sound-pitch))) + 0 + (sound-group sfx) + #t + ) + ) + ) + ) + (else + (when *sound-player-enable* + (let ((v1-136 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-136 command) (sound-command set-param)) + (set! (-> v1-136 id) (the-as sound-id (-> obj rain-id))) + (set! (-> v1-136 params volume) (the int (* 1024.0 f30-3))) + (set! (-> v1-136 params pitch-mod) (the int (* 1524.0 (-> obj sound-pitch)))) + (set! (-> v1-136 params mask) (the-as uint 3)) + (-> v1-136 id) + ) + ) + ) + ) + ) + (else + (set! (-> obj lightning-flash) 0.0) + (when (nonzero? (-> obj rain-id)) + (sound-stop (the-as sound-id (-> obj rain-id))) + (set! (-> obj rain-id) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + (when (-> obj display-flag) + (cond + ((and (-> obj overide-weather-flag) (not (movie?))) + (format *stdcon* "overide cloud ~f~%" (-> obj overide cloud)) + (format *stdcon* "overide fog ~f~%" (-> obj overide fog)) + ) + (else + (format *stdcon* "time until random cloud ~f~%" (* 0.0033333334 (-> obj time-until-random cloud))) + (format *stdcon* "current cloud ~f~%" (-> obj current-interp cloud)) + (format *stdcon* "target cloud ~f~%" (-> obj target-interp cloud)) + (format *stdcon* "speed cloud ~f~%" (* (/ 1.0 (-> obj speed-interp cloud)) (-> self clock seconds-per-frame))) + (format *stdcon* "time until random fog ~f~%" (* 0.0033333334 (-> obj time-until-random fog))) + (format *stdcon* "current fog ~f~%" (-> obj current-interp fog)) + (format *stdcon* "target fog ~f~%" (-> obj target-interp fog)) + (format *stdcon* "speed fog ~f~%" (* (/ 1.0 (-> obj speed-interp fog)) (-> self clock seconds-per-frame))) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type mood-control +;; WARN: Return type mismatch int vs none. +(defmethod update-mood-weather! mood-control ((obj mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float)) + "Set the `target-interp` and `speed-interp` for the clouds and fog + If `*-speed` is 0.0, use the `*-target` args to set `current-interp` + See [[mood-weather]]" + (set! (-> obj target-interp cloud) cloud-target) + (set! (-> obj target-interp fog) fog-target) + (set! (-> obj speed-interp cloud) cloud-speed) + (set! (-> obj speed-interp fog) fog-speed) + (if (= cloud-speed 0.0) + (set! (-> obj current-interp cloud) cloud-target) + ) + (if (= fog-speed 0.0) + (set! (-> obj current-interp fog) fog-target) + ) + 0 + (none) + ) + +;; definition for method 11 of type mood-control +;; WARN: Return type mismatch int vs none. +(defmethod update-mood-range! mood-control ((obj mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float)) + "Set the minimum and maximum ranges of clouds and fog + See [[mood-range]]" + (set! (-> obj range min-cloud) min-cloud) + (set! (-> obj range max-cloud) max-cloud) + (set! (-> obj range min-fog) min-fog) + (set! (-> obj range max-fog) max-fog) + 0 + (none) + ) + +;; definition for method 12 of type mood-control +;; WARN: Return type mismatch int vs none. +(defmethod set-time-for-random-weather! mood-control ((obj mood-control) (arg0 float) (arg1 float)) + "Set the `time-until-random`'s cloud and fog values + See [[mood-weather]]" + (set! (-> obj time-until-random cloud) arg0) + (set! (-> obj time-until-random fog) arg1) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc index 63a2b2723e..4c308fb001 100644 --- a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc @@ -251,7 +251,7 @@ ;; definition for function shrubbery-login-post-texture ;; INFO: Used lq/sq -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defun shrubbery-login-post-texture ((arg0 shrubbery)) (let* ((v1-1 (-> arg0 header data 0)) (a1-1 (the-as object (+ (the-as uint (-> arg0 header)) (* (+ (-> arg0 header data 1) 1) 16)))) @@ -503,7 +503,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/sky/sky-data_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sky/sky-data_REF.gc index 5fcb93da27..b4c3b7f0d2 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sky/sky-data_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sky/sky-data_REF.gc @@ -640,7 +640,7 @@ (init-haze-vert-array) ;; definition for method 9 of type sky-work -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod init-sun-data! sky-work ((obj sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float)) "Sets the sun related upload data - the sun, halo and aurora" (let ((v1-0 (logand arg0 1))) @@ -653,7 +653,7 @@ ) ;; definition for method 10 of type sky-work -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod init-orbit-settings! sky-work ((obj sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) (set! (-> obj orbit arg0 high-noon) arg1) (set! (-> obj orbit arg0 tilt) (* 0.017453292 arg2)) @@ -666,7 +666,7 @@ ) ;; definition for function sky-make-sun-data -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sky-make-sun-data ((arg0 sky-work) (arg1 int) (arg2 float)) "Initialize `upload-data` with [[sky-sun-data]] in [[*sky-work*]]" (let* ((s4-0 (-> arg0 orbit arg1)) @@ -702,7 +702,7 @@ ) ;; definition for function sky-make-moon-data -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sky-make-moon-data ((arg0 sky-work) (arg1 float)) "Initialize `upload-data` with [[sky-moon-data]] in [[*sky-work*]]" (let* ((s5-0 (-> arg0 orbit 2)) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc index ade6d5ecec..4270b943ff 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 3 of type sparticle-launcher ;; INFO: this function exists in multiple non-identical object files -;; INFO: Return type mismatch int vs sparticle-launcher. +;; WARN: Return type mismatch int vs sparticle-launcher. (defmethod inspect sparticle-launcher ((obj sparticle-launcher)) (format #t "~X: sparticle-launcher~%" obj) (let ((s5-0 0)) @@ -289,7 +289,7 @@ ) ;; definition for function lookup-part-group-pointer-by-name -;; INFO: Return type mismatch (pointer sparticle-launch-group) vs (pointer object). +;; WARN: Return type mismatch (pointer sparticle-launch-group) vs (pointer object). (defun lookup-part-group-pointer-by-name ((arg0 string)) "Similar to [[lookup-part-group-by-name]] but returns a pointer instead" (let* ((s4-0 *part-group-id-table*) @@ -445,7 +445,7 @@ (kmemclose) ;; definition for function particle-adgif-cache-flush -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun particle-adgif-cache-flush () "Clear [[*particle-adgif-cache*]]" (set! (-> *particle-adgif-cache* used) 0) @@ -481,7 +481,7 @@ ) ;; definition for function sp-adjust-launch -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sp-adjust-launch ((arg0 sparticle-launchinfo) (arg1 sparticle-cpuinfo) (arg2 (inline-array sp-field-init-spec)) @@ -532,7 +532,7 @@ ) ;; definition for function sp-euler-convert -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sp-euler-convert ((arg0 sparticle-launchinfo) (arg1 sparticle-cpuinfo)) (local-vars (v1-1 float) (v1-2 float)) (rlet ((vf0 :class vf) @@ -581,7 +581,7 @@ ) ;; definition for function sp-rotate-system -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sp-rotate-system ((arg0 sparticle-launchinfo) (arg1 sparticle-cpuinfo) (arg2 transformq)) (let ((s5-0 (new 'stack-no-clear 'matrix))) (let ((a1-1 (new 'stack-no-clear 'quaternion))) @@ -668,7 +668,7 @@ ;; definition for function sp-launch-particles-death ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; WARN: Function sp-launch-particles-death has a return type of none, but the expression builder found a return statement. (defun sp-launch-particles-death ((arg0 sparticle-system) (arg1 sparticle-launcher) (arg2 vector)) (local-vars (v1-26 float) (v1-28 float)) @@ -771,7 +771,7 @@ ;; definition for function sp-clear-queue ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sp-clear-queue () (let ((gp-0 *sp-launch-queue*) (s5-0 *launch-matrix*) @@ -799,7 +799,7 @@ ) ;; definition for function sp-relaunch-setup-fields -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sp-relaunch-setup-fields ((arg0 object) (arg1 sparticle-launcher) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-3d)) (let ((a1-1 (-> arg1 init-specs 0)) (s4-0 (logand (-> arg2 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1))) @@ -898,7 +898,7 @@ ) ;; definition for function sp-relaunch-particle-2d -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sp-relaunch-particle-2d ((arg0 object) (arg1 sparticle-launcher) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-3d)) (sp-relaunch-setup-fields arg0 arg1 arg2 arg3) (when (logtest? (-> arg2 flags) (sp-cpuinfo-flag distort)) @@ -1134,7 +1134,7 @@ ) ;; definition for method 9 of type sparticle-launch-control -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod initialize sparticle-launch-control ((obj sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) (with-pp (let ((s5-0 0)) @@ -1220,7 +1220,7 @@ ) ;; definition for method 9 of type sparticle-launch-group -;; INFO: Return type mismatch object vs sparticle-launch-control. +;; WARN: Return type mismatch object vs sparticle-launch-control. (defmethod create-launch-control sparticle-launch-group ((obj sparticle-launch-group) (arg0 process)) (let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> obj length))))) (when (zero? (the-as sparticle-launch-control gp-0)) @@ -1235,7 +1235,7 @@ ) ;; definition for method 14 of type sparticle-launch-control -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod kill-and-free-particles sparticle-launch-control ((obj sparticle-launch-control)) (countdown (v1-0 (-> obj length)) (let ((a0-4 (-> obj data v1-0))) @@ -1253,7 +1253,7 @@ ) ;; definition for method 15 of type sparticle-launch-control -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod kill-particles sparticle-launch-control ((obj sparticle-launch-control)) (kill-all-particles-with-key obj) 0 @@ -1394,7 +1394,7 @@ ;; definition for function execute-part-engine ;; INFO: Used lq/sq ;; ERROR: failed type prop at 12: Could not figure out load: (set! a1 (l.wu (+ a0 132))) -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun execute-part-engine () (local-vars (v0-0 none) @@ -1670,7 +1670,7 @@ ) ;; definition for function sparticle-track-root -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-track-root ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 vector)) (let ((v1-3 (-> arg1 key proc root trans))) (set! (-> arg2 x) (-> v1-3 x)) @@ -1682,7 +1682,7 @@ ) ;; definition for function sparticle-track-root-prim -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-track-root-prim ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 vector)) (let ((v1-4 (-> (the-as collide-shape (-> arg1 key proc root)) root-prim prim-core))) (set! (-> arg2 x) (-> v1-4 world-sphere x)) @@ -1694,7 +1694,7 @@ ) ;; definition for function sparticle-track-joint -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-track-joint ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (let* ((v1-1 (-> arg1 key proc)) (a1-1 (the int (-> arg1 user-float))) @@ -1709,7 +1709,7 @@ ) ;; definition for function sparticle-turn-to-vel -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-turn-to-vel ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) (local-vars (v1-1 float) (v1-2 float)) (rlet ((vf0 :class vf) @@ -1742,7 +1742,7 @@ ) ;; definition for function birth-func-copy-rot-color -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun birth-func-copy-rot-color ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d) @@ -1801,7 +1801,7 @@ ;; definition for function birth-func-copy2-rot-color ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun birth-func-copy2-rot-color ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d) @@ -1865,7 +1865,7 @@ ) ;; definition for function birth-func-copy-omega-to-z -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun birth-func-copy-omega-to-z ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d) @@ -1880,7 +1880,7 @@ ) ;; definition for function birth-func-random-next-time -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun birth-func-random-next-time ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d) @@ -2561,7 +2561,7 @@ ;; definition for function sparticle-motion-blur ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Expression building failed: In sparticle-motion-blur: [OP: 78] - Floating point math attempted on invalid types: uint and float in op (-.s f2-0 f3-0). ;; ERROR: Inline assembly instruction marked with TODO - [TODO.VCLIP] ;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v1, Clipping] @@ -2763,7 +2763,7 @@ ) ;; definition (debug) for function sparticle-motion-blur-old -;; INFO: Return type mismatch int vs object. +;; WARN: Return type mismatch int vs object. (defun-debug sparticle-motion-blur-old ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) "Unused" (let ((s2-0 (new 'stack-no-clear 'vector)) @@ -2810,7 +2810,7 @@ ) ;; definition for function sparticle-set-conerot -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-set-conerot ((arg0 sparticle-launcher) (arg1 vector)) (let ((s5-0 (get-field-spec-by-id arg0 (sp-field-id spt-conerot-x))) (s4-0 (get-field-spec-by-id arg0 (sp-field-id spt-conerot-y))) @@ -2848,7 +2848,7 @@ ) ;; definition for function check-drop-group-center -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defun check-drop-group-center ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (let ((f0-0 (-> arg1 key origin trans y))) (if (< (-> arg2 launchrot y) f0-0) @@ -2859,7 +2859,7 @@ ) ;; definition for function birth-func-y->userdata -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun birth-func-y->userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (+! (-> arg1 user-float) (-> arg2 vector 0 y)) 0 @@ -2867,7 +2867,7 @@ ) ;; definition for function birth-func-ocean-height -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun birth-func-ocean-height ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (set! (-> arg2 vector 0 y) (+ (ocean-method-11 *ocean* (-> arg2 vector) #t) (-> arg1 user-float))) 0 @@ -2875,7 +2875,7 @@ ) ;; definition for function birth-func-camera-orient -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun birth-func-camera-orient ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (local-vars (v1-0 float) (v1-1 float)) (rlet ((vf0 :class vf) @@ -2917,7 +2917,7 @@ (define *particle-quat* (new 'static 'quaternion :w 1.0)) ;; definition for function birth-func-set-quat -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun birth-func-set-quat ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (local-vars (a0-2 float) (a0-3 float)) (rlet ((vf0 :class vf) @@ -2954,7 +2954,7 @@ (define *particle-vel* (new 'static 'vector :w 1.0)) ;; definition for function birth-func-set-vel -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun birth-func-set-vel ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (let ((v1-0 *particle-vel*)) (set! (-> arg1 vel-sxvel x) (-> v1-0 x)) @@ -2966,7 +2966,7 @@ ) ;; definition for function birth-func-texture-group -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun birth-func-texture-group ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (let ((s5-0 (the-as object (-> arg1 user-float)))) (when (nonzero? (the-as float s5-0)) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc index 9ed28e26a9..4649b0413c 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 2 of type sparticle-cpuinfo -;; INFO: Return type mismatch object vs sparticle-cpuinfo. +;; WARN: Return type mismatch object vs sparticle-cpuinfo. (defmethod print sparticle-cpuinfo ((obj sparticle-cpuinfo)) (format #t "~%") (dotimes (s5-0 16) @@ -14,7 +14,7 @@ ;; definition for function sp-particle-copy! ;; INFO: Used lq/sq -;; INFO: Return type mismatch (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) vs none. +;; WARN: Return type mismatch (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) vs none. (defun sp-particle-copy! ((arg0 sparticle-cpuinfo) (arg1 sparticle-cpuinfo)) (let ((v1-1 (-> arg1 sprite x-y-z-sx quad))) (set! (-> arg0 sprite x-y-z-sx quad) v1-1) @@ -144,7 +144,7 @@ ) ;; definition for function sp-free-particle -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sp-free-particle ((arg0 sparticle-system) (arg1 int) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-2d)) (if (and (-> arg2 binding) (nonzero? (-> arg2 binding))) (logclear! (-> arg2 binding flags) (sp-launch-state-flags launcher-active particles-active)) @@ -286,7 +286,7 @@ ) ;; definition for function sp-orbiter -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sp-orbiter ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (let* ((f2-0 (-> arg1 omega)) (f0-0 (-> arg1 radius)) @@ -333,7 +333,7 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for function sp-copy-to-spr -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sp-copy-to-spr ((arg0 int) (arg1 pointer) (arg2 int)) (let ((a2-1 (/ (+ arg2 15) 16))) (dma-send-to-spr-no-flush (the-as uint arg0) (the-as uint arg1) (the-as uint a2-1) #t) @@ -343,7 +343,7 @@ ) ;; definition for function sp-copy-from-spr -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sp-copy-from-spr ((arg0 int) (arg1 pointer) (arg2 int)) (let ((a2-1 (/ (+ arg2 15) 16))) (dma-send-from-spr-no-flush (the-as uint arg1) (the-as uint arg0) (the-as uint a2-1) #t) @@ -357,7 +357,7 @@ ;; definition for function sp-process-block ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sp-process-block ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d) (arg3 int)) (local-vars (sv-16 int) (sv-32 int) (sv-48 int) (sv-64 int)) (let ((s3-0 208) @@ -401,7 +401,7 @@ ;; definition for function sp-process-particle-system ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sp-process-particle-system ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d)) (countdown (v1-0 13) (let ((a0-4 (-> *display* clock v1-0 sparticle-data quad))) @@ -436,7 +436,7 @@ ;; definition for function forall-particles-with-key-runner ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun forall-particles-with-key-runner ((arg0 sparticle-launch-control) (arg1 (function sparticle-system sparticle-cpuinfo none)) (arg2 sparticle-system) @@ -471,7 +471,7 @@ ) ;; definition for function forall-particles-with-key -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun forall-particles-with-key ((arg0 sparticle-launch-control) (arg1 (function sparticle-system sparticle-cpuinfo none)) (arg2 symbol) @@ -488,7 +488,7 @@ ) ;; definition for function sparticle-kill-it -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-kill-it ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) (set! (-> arg1 timer) 0) (set! (-> arg1 sp-func) (the-as (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) 0)) @@ -501,7 +501,7 @@ ) ;; definition for function sparticle-kill-it-level0 -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-kill-it-level0 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) (if (zero? (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1))) (sparticle-kill-it arg0 arg1) @@ -511,7 +511,7 @@ ) ;; definition for function sparticle-kill-it-level1 -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-kill-it-level1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) (if (= (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1)) (sp-cpuinfo-flag sp-cpuinfo-flag-9) @@ -523,7 +523,7 @@ ) ;; definition for function sparticle-kill-it-level2 -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-kill-it-level2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) (if (= (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1)) (sp-cpuinfo-flag level0)) (sparticle-kill-it arg0 arg1) @@ -533,7 +533,7 @@ ) ;; definition for function sparticle-kill-it-level3 -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-kill-it-level3 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) (if (= (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1)) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0) @@ -545,7 +545,7 @@ ) ;; definition for function sparticle-kill-it-level4 -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-kill-it-level4 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) (if (= (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1)) (sp-cpuinfo-flag level1)) (sparticle-kill-it arg0 arg1) @@ -555,7 +555,7 @@ ) ;; definition for function sparticle-kill-it-level5 -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-kill-it-level5 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) (if (= (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1)) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level1) @@ -567,7 +567,7 @@ ) ;; definition for function sparticle-60-to-50 -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-60-to-50 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer)) (let ((gp-0 (-> arg1 rotvel3d)) (s5-0 (new 'stack-no-clear 'vector)) @@ -581,7 +581,7 @@ ) ;; definition for function sparticle-50-to-60 -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sparticle-50-to-60 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer)) (let ((gp-0 (-> arg1 rotvel3d)) (s5-0 (new 'stack-no-clear 'vector)) @@ -595,7 +595,7 @@ ) ;; definition for function kill-all-particles-with-key -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun kill-all-particles-with-key ((arg0 sparticle-launch-control)) (forall-particles-with-key arg0 sparticle-kill-it #t #t) 0 @@ -603,7 +603,7 @@ ) ;; definition for function forall-particles-runner -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun forall-particles-runner ((arg0 (function sparticle-system sparticle-cpuinfo pointer none)) (arg1 sparticle-system)) (let ((s4-0 (the-as object (-> arg1 cpuinfo-table 0))) (s3-0 (&+ (-> arg1 vecdata-table) 0)) @@ -632,7 +632,7 @@ ) ;; definition for function forall-particles -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun forall-particles ((arg0 function) (arg1 symbol) (arg2 symbol)) (if arg1 (forall-particles-runner @@ -696,7 +696,7 @@ ) ;; definition for function remap-particle -;; INFO: Return type mismatch gs-miptbp vs none. +;; WARN: Return type mismatch gs-miptbp vs none. (defun remap-particle ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer)) (let* ((gp-0 (-> arg1 adgif)) (a0-1 (-> gp-0 texture-id)) @@ -720,7 +720,7 @@ ) ;; definition for function process-particles -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 gp, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] (defun process-particles () diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc index 421529ed3f..83cf12a3f1 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc @@ -47,7 +47,7 @@ ;; definition for method 9 of type sprite-glow-data ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod set-trans sprite-glow-data ((obj sprite-glow-data) (arg0 vector)) (let ((f0-0 (-> obj position w))) (set! (-> obj position quad) (-> arg0 quad)) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc index d32fae5db0..db307ca13c 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc @@ -42,7 +42,7 @@ (kmemclose) ;; definition for function sprite-distorter-generate-tables -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sprite-distorter-generate-tables () (let ((tbls *sprite-distorter-sine-tables*)) (let ((entry-idx 0) @@ -120,7 +120,7 @@ (define sprite-distort-vu1-block (new 'static 'vu-function :length 63 :qlength 32)) ;; definition for function sprite-init-distorter -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sprite-init-distorter ((dma-buff dma-buffer)) (let* ((v1-0 dma-buff) (a1-0 (the-as object (-> v1-0 base))) @@ -201,7 +201,7 @@ ;; definition for function sprite-draw-distorters ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Inline assembly instruction marked with TODO - [TODO.VCLIP] ;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v1, Clipping] (defun sprite-draw-distorters ((dma-buff dma-buffer)) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc index e0b8895f09..e42b39647b 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc @@ -25,7 +25,7 @@ ) ;; definition for function sprite-setup-header -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sprite-setup-header ((hdr sprite-header) (num-sprites int)) (set! (-> hdr num-sprites) num-sprites) (none) @@ -143,7 +143,7 @@ ;; definition for method 3 of type sprite-aux-list ;; INFO: this function exists in multiple non-identical object files -;; INFO: Return type mismatch symbol vs sprite-aux-list. +;; WARN: Return type mismatch symbol vs sprite-aux-list. (defmethod inspect sprite-aux-list ((obj sprite-aux-list)) (format #t "[~X] sprite-aux-list:~%" obj) (format #t "~Tnum-entries: ~D~%" (-> obj num-entries)) @@ -155,7 +155,7 @@ ) ;; definition for function clear-sprite-aux-list -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun clear-sprite-aux-list () (set! (-> *sprite-aux-list* entry) 0) 0 @@ -163,7 +163,7 @@ ) ;; definition for function add-to-sprite-aux-list -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun add-to-sprite-aux-list ((system sparticle-system) (sprite-info sparticle-cpuinfo) (sprite-vec sprite-vec-data-3d) (arg3 uint)) (let ((s2-0 (-> sprite-info sp-func))) (if (and (nonzero? s2-0) (not (paused?))) @@ -285,7 +285,7 @@ ;; definition for function sprite-setup-frame-data ;; INFO: Used lq/sq -;; INFO: Return type mismatch float vs none. +;; WARN: Return type mismatch float vs none. (defun sprite-setup-frame-data ((data sprite-frame-data) (tbp-offset uint)) (set! (-> data hmge-scale quad) (-> *math-camera* hmge-scale quad)) (set! (-> data inv-hmge-scale quad) (-> *math-camera* inv-hmge-scale quad)) @@ -540,7 +540,7 @@ ;; definition for function sprite-add-matrix-data ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sprite-add-matrix-data ((dma-buff dma-buffer) (matrix-mode uint)) (let ((count 900)) (cond @@ -624,7 +624,7 @@ ) ;; definition for function sprite-add-frame-data -;; INFO: Return type mismatch pointer vs none. +;; WARN: Return type mismatch pointer vs none. (defun sprite-add-frame-data ((dma-buff dma-buffer) (tbp-offset uint)) (let ((s5-0 42)) (let* ((v1-0 dma-buff) @@ -642,7 +642,7 @@ ) ;; definition for function sprite-add-2d-chunk -;; INFO: Return type mismatch pointer vs none. +;; WARN: Return type mismatch pointer vs none. (defun sprite-add-2d-chunk ((sprites sprite-array-2d) (start-sprite-idx int) (num-sprites int) (dma-buff dma-buffer) (mscal-addr int)) (let ((qwc-pkt1 1)) (let* ((v1-0 dma-buff) @@ -717,7 +717,7 @@ ) ;; definition for function sprite-add-3d-chunk -;; INFO: Return type mismatch pointer vs none. +;; WARN: Return type mismatch pointer vs none. (defun sprite-add-3d-chunk ((sprites sprite-array-3d) (start-sprite-idx int) (num-sprites int) (dma-buff dma-buffer)) (let ((qwc-pkt1 1)) (let* ((v1-0 dma-buff) @@ -790,7 +790,7 @@ ) ;; definition for function sprite-draw -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sprite-draw ((disp display)) (let ((dma-mem-begin (-> *display* frames (-> *display* on-screen) global-buf base))) (let* ((dma-buff (-> *display* frames (-> *display* on-screen) global-buf)) @@ -947,7 +947,7 @@ ) ;; definition for function sprite-release-user-hvdf -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sprite-release-user-hvdf ((idx int)) (when (and (>= idx 1) (< idx 76)) (set! (-> *sprite-hvdf-control* alloc idx) 0) @@ -958,7 +958,7 @@ ) ;; definition for function sprite-get-user-hvdf -;; INFO: Return type mismatch qword vs vector. +;; WARN: Return type mismatch qword vs vector. (defun sprite-get-user-hvdf ((idx int)) (the-as vector (-> *sprite-hvdf-data* data idx)) ) diff --git a/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc b/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc index 0e83e08bc5..b5168ca386 100644 --- a/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc @@ -52,6 +52,7 @@ (nodes (inline-array bsp-node) :offset-assert 120) (level level :offset-assert 124) (texture-flags texture-page-flag 10 :offset 130) + (ambients symbol :offset 156) (subdivide-close float :offset 160) (subdivide-far float :offset-assert 164) (race-meshes (array entity-race-mesh) :offset-assert 168) @@ -142,7 +143,7 @@ ) ;; definition (debug) for function inspect-bsp-tree -;; INFO: Return type mismatch bsp-header vs none. +;; WARN: Return type mismatch bsp-header vs none. (defun-debug inspect-bsp-tree ((arg0 bsp-header) (arg1 bsp-node)) (cond ((zero? arg1) @@ -168,7 +169,7 @@ ) ;; definition for function map-bsp-tree -;; INFO: Return type mismatch bsp-header vs none. +;; WARN: Return type mismatch bsp-header vs none. (defun map-bsp-tree ((arg0 (function bsp-node none)) (arg1 bsp-header) (arg2 bsp-node)) (cond ((zero? arg2) diff --git a/test/decompiler/reference/jak2/engine/level/level-h_REF.gc b/test/decompiler/reference/jak2/engine/level/level-h_REF.gc index 168c29faa8..8b234e6c21 100644 --- a/test/decompiler/reference/jak2/engine/level/level-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/level-h_REF.gc @@ -146,7 +146,7 @@ ) ;; definition for method 5 of type level-vis-info -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of level-vis-info ((obj level-vis-info)) (the-as int (+ (-> level-vis-info size) (-> obj dictionary-length))) ) diff --git a/test/decompiler/reference/jak2/engine/level/level-info_REF.gc b/test/decompiler/reference/jak2/engine/level/level-info_REF.gc index 43ef233ecc..fe806eb378 100644 --- a/test/decompiler/reference/jak2/engine/level/level-info_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/level-info_REF.gc @@ -1,27 +1,28 @@ ;;-*-Lisp-*- (in-package goal) -;; definition for symbol *task-level*, type array -(define *task-level* (new 'static 'boxed-array :type symbol - 'default - 'city - 'stadium - 'fortress - 'ruins - 'strip - 'atoll - 'sewer - 'mountain - 'forest - 'drill - 'palace - 'tomb - 'dig - 'castle - 'under - 'consite - 'nest - ) +;; definition for symbol *task-level*, type (array symbol) +(define *task-level* (the-as (array symbol) (new 'static 'boxed-array :type symbol + 'default + 'city + 'stadium + 'fortress + 'ruins + 'strip + 'atoll + 'sewer + 'mountain + 'forest + 'drill + 'palace + 'tomb + 'dig + 'castle + 'under + 'consite + 'nest + ) + ) ) ;; definition for symbol default-level, type level-load-info @@ -13261,7 +13262,7 @@ ) ;; definition (debug) for function city-start -;; INFO: Return type mismatch target vs none. +;; WARN: Return type mismatch target vs none. (defun-debug city-start () (let ((v1-1 (level-get-target-inside *level*))) (when v1-1 diff --git a/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc b/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc index 345eb51148..bfb7d5a191 100644 --- a/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc @@ -169,7 +169,7 @@ ) ;; definition for function str-load-cancel -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun str-load-cancel () (set! *load-str-lock* #f) (set! *que-str-lock* #t) @@ -178,7 +178,7 @@ ) ;; definition for function str-play-async -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun str-play-async ((arg0 string) (arg1 sound-id)) (set! *que-str-lock* #t) (let ((s4-0 (the-as play-chunk-msg (add-element *play-str-rpc*)))) @@ -198,7 +198,7 @@ ) ;; definition for function str-play-stop -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun str-play-stop ((arg0 string) (arg1 sound-id)) (set! *que-str-lock* #t) (let ((s4-0 (the-as play-chunk-msg (add-element *play-str-rpc*)))) @@ -217,7 +217,7 @@ ) ;; definition for function str-play-queue -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun str-play-queue ((arg0 string) (arg1 string) (arg2 string) (arg3 string) (arg4 (pointer uint32)) (arg5 pointer)) (when (and (not (check-busy *play-str-rpc*)) (not *load-str-lock*) (not *que-str-lock*)) (let ((s4-0 (the-as play-chunk-msg (add-element *play-str-rpc*)))) @@ -250,7 +250,7 @@ ) ;; definition for function str-ambient-play -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun str-ambient-play ((arg0 string)) (set! *que-str-lock* #t) (let ((s5-0 (the-as load-chunk-msg (add-element *play-str-rpc*)))) @@ -264,7 +264,7 @@ ) ;; definition for function str-ambient-stop -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun str-ambient-stop ((arg0 string)) (set! *que-str-lock* #t) (let ((s5-0 (the-as load-chunk-msg (add-element *play-str-rpc*)))) @@ -277,7 +277,7 @@ ) ;; definition for function str-play-kick -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun str-play-kick () (cond ((check-busy *play-str-rpc*) @@ -353,7 +353,7 @@ ) ;; definition for function dgo-load-cancel -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun dgo-load-cancel () (sync *load-dgo-rpc* #t) (let ((a2-0 (add-element *load-dgo-rpc*))) @@ -438,7 +438,7 @@ ) ;; definition for function destroy-mem -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun destroy-mem ((arg0 (pointer uint32)) (arg1 (pointer uint32))) (while (< (the-as int arg0) (the-as int arg1)) (set! (-> arg0 0) (the-as uint #xffffffff)) @@ -447,7 +447,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc b/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc index bf39034c35..380fa478a4 100644 --- a/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc @@ -44,7 +44,7 @@ ) ;; definition for method 0 of type load-dir-art-group -;; INFO: Return type mismatch load-dir vs load-dir-art-group. +;; WARN: Return type mismatch load-dir vs load-dir-art-group. (defmethod new load-dir-art-group ((allocation symbol) (type-to-make type) (arg0 int) (arg1 level)) (let ((v0-0 ((method-of-type load-dir new) allocation type-to-make arg0 arg1))) (set! (-> v0-0 data-array content-type) art-group) diff --git a/test/decompiler/reference/jak2/engine/load/loader_REF.gc b/test/decompiler/reference/jak2/engine/load/loader_REF.gc index 48089c5e6b..ac2c5ba02c 100644 --- a/test/decompiler/reference/jak2/engine/load/loader_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/loader_REF.gc @@ -38,7 +38,7 @@ ) ;; definition for method 8 of type load-dir -;; INFO: Return type mismatch symbol vs load-dir. +;; WARN: Return type mismatch symbol vs load-dir. (defmethod mem-usage load-dir ((obj load-dir) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 85 (-> arg0 length))) (set! (-> arg0 data 84 name) "array") @@ -1553,7 +1553,7 @@ ) ;; definition for method 18 of type gui-control -;; INFO: Return type mismatch object vs symbol. +;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 34. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod gui-control-method-18 gui-control ((obj gui-control) (arg0 gui-channel)) (let ((v1-0 arg0)) @@ -1716,7 +1716,7 @@ ) ;; definition for method 17 of type gui-control -;; INFO: Return type mismatch int vs gui-action. +;; WARN: Return type mismatch int vs gui-action. (defmethod gui-control-method-17 gui-control ((obj gui-control) (arg0 sound-id)) (let ((gp-0 (the-as gui-connection #f))) (if (zero? arg0) @@ -1901,12 +1901,12 @@ ;; definition for method 9 of type gui-control ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs sound-id. +;; WARN: Return type mismatch int vs sound-id. (defmethod gui-control-method-9 gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel) (arg2 gui-action) - (arg3 int) + (arg3 string) (arg4 float) (arg5 time-frame) ) @@ -1924,7 +1924,7 @@ (set! sv-64 (the-as gui-connection (-> sv-48 next0))) (while (!= sv-48 (-> obj engine alive-list-end)) (when (and (= arg1 (-> (the-as gui-connection sv-48) channel)) - (string= (the-as string arg3) (-> (the-as gui-connection sv-48) name)) + (string= arg3 (-> (the-as gui-connection sv-48) name)) (= (get-process sv-48) arg0) ) (set! sv-32 (the-as gui-connection sv-48)) @@ -1943,7 +1943,7 @@ (set! sv-20 (-> obj connections sv-80)) (if (and (nonzero? (-> sv-20 id)) (= arg1 (-> sv-20 channel)) - (string= (the-as string arg3) (-> sv-20 name)) + (string= arg3 (-> sv-20 name)) (>= (-> sv-20 priority) -1.0) ) (set! sv-16 (the-as int (-> sv-20 id))) @@ -1960,7 +1960,7 @@ (set! (-> sv-32 priority) arg4) (set! (-> sv-32 channel) arg1) (set! (-> sv-32 action) arg2) - (set! (-> sv-32 param2) arg3) + (set! (-> sv-32 param2) (the-as int arg3)) (set! (-> sv-32 hold-time) arg5) (set! (-> sv-32 flags) (the-as uint 1)) (set! (-> sv-32 fade) (the-as uint 0)) @@ -1975,7 +1975,7 @@ ) ;; definition for method 10 of type gui-control -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod gui-control-method-10 gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel)) (let ((s3-0 (the-as gui-connection (-> obj engine alive-list next0)))) (-> obj engine) @@ -1996,7 +1996,7 @@ ;; definition for method 12 of type gui-control ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs sound-id. +;; WARN: Return type mismatch int vs sound-id. (defmethod gui-control-method-12 gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel) diff --git a/test/decompiler/reference/jak2/engine/load/ramdisk_REF.gc b/test/decompiler/reference/jak2/engine/load/ramdisk_REF.gc index 401bf86dc3..981fd6cfd1 100644 --- a/test/decompiler/reference/jak2/engine/load/ramdisk_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/ramdisk_REF.gc @@ -104,7 +104,7 @@ ) ;; definition for function ramdisk-sync -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun ramdisk-sync () (sync *ramdisk-rpc* #t) 0 @@ -113,7 +113,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/math/math_REF.gc b/test/decompiler/reference/jak2/engine/math/math_REF.gc index 8bb86cac99..ba90606820 100644 --- a/test/decompiler/reference/jak2/engine/math/math_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/math_REF.gc @@ -238,7 +238,7 @@ ) ;; definition for function print-exp -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun print-exp ((arg0 float)) (let* ((f30-1 (floor (/ (logf (fabs arg0)) (logf 10.0)))) (f0-4 (pow 10.0 f30-1)) @@ -278,7 +278,7 @@ ) ;; definition for function print-time -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun print-time ((arg0 object) (arg1 time-frame)) 0 0 @@ -297,7 +297,7 @@ ) ;; definition for function log2 -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defun log2 ((arg0 int)) (the-as int (+ (sar (the-as int (the float arg0)) 23) -127)) ) @@ -439,7 +439,7 @@ ) ;; definition for function rand-vu-init -;; INFO: Return type mismatch int vs float. +;; WARN: Return type mismatch int vs float. ;; ERROR: Unsupported inline assembly instruction kind - [ctc2.i vi_R, a0] ;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v0, vi_R] (defun rand-vu-init ((arg0 float)) @@ -664,7 +664,3 @@ (defun smooth-interp ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) (+ arg0 (* (- arg1 arg0) (smooth-step (/ (- arg2 arg3) (- arg4 arg3))))) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/math/matrix_REF.gc b/test/decompiler/reference/jak2/engine/math/matrix_REF.gc index 831213a973..5a1110c7fd 100644 --- a/test/decompiler/reference/jak2/engine/math/matrix_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/matrix_REF.gc @@ -228,7 +228,7 @@ ;; definition for function matrix-transpose! ;; INFO: Used lq/sq -;; ERROR: Function may read a register that is not set: f31 +;; WARN: Function may read a register that is not set: f31 (defun matrix-transpose! ((arg0 matrix) (arg1 matrix)) (local-vars (r0-0 int) @@ -785,8 +785,8 @@ ;; definition for function matrix-axis-sin-cos-vu! ;; INFO: Used lq/sq -;; INFO: Return type mismatch matrix vs none. -;; ERROR: Function may read a register that is not set: f31 +;; WARN: Return type mismatch matrix vs none. +;; WARN: Function may read a register that is not set: f31 ;; ERROR: Unsupported inline assembly instruction kind - [prot3w a1, v1] ;; ERROR: Unsupported inline assembly instruction kind - [prot3w a2, a1] (defun matrix-axis-sin-cos-vu! ((arg0 matrix) (arg1 vector) (arg2 float) (arg3 float)) @@ -906,7 +906,7 @@ ;; definition for function matrix-axis-sin-cos! ;; INFO: Used lq/sq -;; ERROR: Function may read a register that is not set: f31 +;; WARN: Function may read a register that is not set: f31 ;; ERROR: Unsupported inline assembly instruction kind - [prot3w a0, v1] ;; ERROR: Unsupported inline assembly instruction kind - [prot3w a1, a0] (defun matrix-axis-sin-cos! ((arg0 matrix) (arg1 vector) (arg2 float) (arg3 float)) @@ -1036,7 +1036,7 @@ ) ;; definition for function matrix-axis-angle! -;; INFO: Return type mismatch matrix vs none. +;; WARN: Return type mismatch matrix vs none. (defun matrix-axis-angle! ((arg0 matrix) (arg1 vector) (arg2 float)) (matrix-axis-sin-cos! arg0 arg1 (sin arg2) (cos arg2)) (none) diff --git a/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc b/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc index c67eed4b61..31c8a30a4a 100644 --- a/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc @@ -980,7 +980,7 @@ ) ;; definition (debug) for function quaternion-validate -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun-debug quaternion-validate ((arg0 quaternion)) (with-pp (let ((f0-0 (quaternion-norm arg0))) diff --git a/test/decompiler/reference/jak2/engine/math/trigonometry_REF.gc b/test/decompiler/reference/jak2/engine/math/trigonometry_REF.gc index f375bc91ea..3273c51014 100644 --- a/test/decompiler/reference/jak2/engine/math/trigonometry_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/trigonometry_REF.gc @@ -309,7 +309,7 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for function vector-rad<-vector-deg! -;; INFO: Return type mismatch float vs none. +;; WARN: Return type mismatch float vs none. (defun vector-rad<-vector-deg! ((arg0 vector) (arg1 vector)) (local-vars (v0-0 float) (v1-1 uint128) (v1-2 uint128) (v1-3 uint128)) (rlet ((vf1 :class vf) @@ -333,7 +333,7 @@ ) ;; definition for function vector-rad<-vector-deg/2! -;; INFO: Return type mismatch float vs int. +;; WARN: Return type mismatch float vs int. (defun vector-rad<-vector-deg/2! ((arg0 vector) (arg1 vector)) (local-vars (v0-0 float) (v1-1 uint128) (v1-2 uint128) (v1-3 uint128)) (rlet ((vf1 :class vf) @@ -610,7 +610,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc b/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc index d28d6069ba..afd65819c3 100644 --- a/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc @@ -48,7 +48,7 @@ ) ;; definition for method 5 of type bit-array -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of bit-array ((obj bit-array)) (the-as int (+ (-> obj type size) (/ (logand -8 (+ (-> obj allocated-length) 7)) 8))) ) diff --git a/test/decompiler/reference/jak2/engine/math/vector_REF.gc b/test/decompiler/reference/jak2/engine/math/vector_REF.gc index 4384d53533..c3755cc110 100644 --- a/test/decompiler/reference/jak2/engine/math/vector_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/vector_REF.gc @@ -580,7 +580,7 @@ ) ;; definition for function vector-v*float! -;; INFO: Return type mismatch uint vs vector. +;; WARN: Return type mismatch uint vs vector. (defun vector-v*float! ((arg0 vector) (arg1 vector) (arg2 float)) (with-pp (the-as vector (vector-float*! arg0 arg1 (* arg2 (-> pp clock seconds-per-frame)))) @@ -1256,7 +1256,7 @@ ) ;; definition for function vector-deg-diff -;; INFO: Return type mismatch float vs none. +;; WARN: Return type mismatch float vs none. (defun vector-deg-diff ((arg0 vector) (arg1 vector) (arg2 vector)) (local-vars (v0-0 float) @@ -1345,7 +1345,7 @@ ) ;; definition for function vector4-add! -;; INFO: Return type mismatch float vs none. +;; WARN: Return type mismatch float vs none. (defun vector4-add! ((arg0 vector4) (arg1 vector4) (arg2 vector4)) (local-vars (v0-0 float)) (rlet ((vf4 :class vf) @@ -1362,7 +1362,7 @@ ) ;; definition for function vector4-sub! -;; INFO: Return type mismatch float vs none. +;; WARN: Return type mismatch float vs none. (defun vector4-sub! ((arg0 vector4) (arg1 vector4) (arg2 vector4)) (local-vars (v0-0 float)) (rlet ((vf4 :class vf) @@ -1379,7 +1379,7 @@ ) ;; definition for function vector4-mul! -;; INFO: Return type mismatch float vs none. +;; WARN: Return type mismatch float vs none. (defun vector4-mul! ((arg0 vector4) (arg1 vector4) (arg2 vector4)) (local-vars (v0-0 float)) (rlet ((vf4 :class vf) @@ -1396,7 +1396,7 @@ ) ;; definition for function vector4-scale! -;; INFO: Return type mismatch float vs none. +;; WARN: Return type mismatch float vs none. (defun vector4-scale! ((arg0 vector4) (arg1 vector4) (arg2 float)) (local-vars (v0-0 float)) (rlet ((vf4 :class vf) @@ -1413,7 +1413,7 @@ ) ;; definition for function vector4-madd! -;; INFO: Return type mismatch float vs none. +;; WARN: Return type mismatch float vs none. (defun vector4-madd! ((arg0 vector4) (arg1 vector4) (arg2 vector4) (arg3 float)) (local-vars (v0-0 float)) (rlet ((acc :class vf) @@ -1436,7 +1436,7 @@ ) ;; definition for function vector4-msub! -;; INFO: Return type mismatch float vs none. +;; WARN: Return type mismatch float vs none. (defun vector4-msub! ((arg0 vector4) (arg1 vector4) (arg2 vector4) (arg3 float)) (local-vars (v0-0 float)) (rlet ((acc :class vf) @@ -1459,7 +1459,7 @@ ) ;; definition for function vector4-array-add! -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defun vector4-array-add! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 (inline-array vector4)) (arg3 int)) (dotimes (s2-0 arg3) (vector4-add! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2)) @@ -1471,7 +1471,7 @@ ) ;; definition for function vector4-array-sub! -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defun vector4-array-sub! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 (inline-array vector4)) (arg3 int)) (dotimes (s2-0 arg3) (vector4-sub! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2)) @@ -1483,7 +1483,7 @@ ) ;; definition for function vector4-array-mul! -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defun vector4-array-mul! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 (inline-array vector4)) (arg3 int)) (dotimes (s2-0 arg3) (vector4-mul! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2)) @@ -1495,7 +1495,7 @@ ) ;; definition for function vector4-array-scale! -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defun vector4-array-scale! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 float) (arg3 int)) (dotimes (s2-0 arg3) (vector4-scale! (the-as vector4 arg0) (the-as vector4 arg1) arg2) @@ -1506,7 +1506,7 @@ ) ;; definition for function vector4-array-madd! -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defun vector4-array-madd! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 (inline-array vector4)) @@ -1523,7 +1523,7 @@ ) ;; definition for function vector4-array-msub! -;; INFO: Return type mismatch symbol vs none. +;; WARN: Return type mismatch symbol vs none. (defun vector4-array-msub! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 (inline-array vector4)) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc index 90a5185641..324876feb0 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc @@ -565,7 +565,7 @@ ) ;; definition for function init-ray -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun init-ray ((arg0 nav-ray)) (rlet ((acc :class vf) (Q :class vf) @@ -665,7 +665,7 @@ ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Stack slot offset 56 signed mismatch -;; INFO: Return type mismatch vector vs none. +;; WARN: Return type mismatch vector vs none. (defmethod closest-point-on-boundary nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (set! sv-48 (new 'stack-no-clear 'vector)) @@ -694,7 +694,7 @@ ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Stack slot offset 56 signed mismatch -;; INFO: Return type mismatch vector vs none. +;; WARN: Return type mismatch vector vs none. (defmethod project-point-into-poly-2d nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (cond @@ -776,7 +776,7 @@ ;; WARN: Stack slot offset 64 signed mismatch ;; WARN: Stack slot offset 44 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod move-along-nav-ray! nav-mesh ((obj nav-mesh) (ray nav-ray)) (local-vars (next-poly-idx int) @@ -862,7 +862,7 @@ ) ;; definition (debug) for function nav-sphere-from-cam -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun-debug nav-sphere-from-cam () (let ((v1-0 (camera-pos))) (format #t "SPHEREM(~4,,1M, ~4,,1M, ~4,,1M, 1.0)~%" (-> v1-0 x) (-> v1-0 y) (-> v1-0 z)) diff --git a/test/decompiler/reference/jak2/engine/physics/chain-physics_REF.gc b/test/decompiler/reference/jak2/engine/physics/chain-physics_REF.gc index 441c0cebe4..5b171773a4 100644 --- a/test/decompiler/reference/jak2/engine/physics/chain-physics_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/chain-physics_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 12 of type chain-physics -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod gravity-update chain-physics ((obj chain-physics)) (vector-seek-3d-smooth! (-> obj gravity) (-> obj gravity-target) 0.05 0.1) 0 @@ -10,7 +10,7 @@ ) ;; definition for method 13 of type chain-physics -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod apply-gravity chain-physics ((obj chain-physics) (arg0 vector) (arg1 int)) (vector-float*! arg0 @@ -22,7 +22,7 @@ ) ;; definition for method 14 of type chain-physics -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod chain-physics-method-14 chain-physics ((obj chain-physics) (arg0 vector) (arg1 int)) (vector-float*! arg0 @@ -48,7 +48,7 @@ ) ;; definition for method 17 of type chain-physics -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod chain-physics-method-17 chain-physics ((obj chain-physics) (arg0 vector)) 0 (none) @@ -68,7 +68,7 @@ ) ;; definition for method 10 of type chain-physics -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod turn-off chain-physics ((obj chain-physics) (arg0 time-frame)) (set! (-> obj turn-off-start) (-> self clock frame-counter)) (set! (-> obj turn-off-duration) arg0) @@ -78,7 +78,7 @@ ;; definition for method 11 of type chain-physics ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod update chain-physics ((obj chain-physics) (arg0 process-drawable)) (local-vars (v1-77 float) @@ -403,7 +403,3 @@ (set! (-> arg1 turn-off-start) 0) 0 ) - - - - diff --git a/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc index 2ed6bcef1f..233dfb966a 100644 --- a/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc @@ -38,7 +38,7 @@ ) ;; definition for method 9 of type dynamics -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod set-gravity-length dynamics ((obj dynamics) (arg0 float)) (set! (-> obj gravity-length) arg0) (vector-float*! (-> obj gravity) (-> obj gravity-normal) arg0) @@ -79,7 +79,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable-h_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable-h_REF.gc index 9fc682cc72..431134ab68 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable-h_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for function cspace-by-name-no-fail -;; INFO: Return type mismatch object vs cspace. +;; WARN: Return type mismatch object vs cspace. (defun cspace-by-name-no-fail ((arg0 process-drawable) (arg1 string)) (let ((v0-0 (the-as object (cspace-by-name arg0 arg1)))) (the-as cspace (cond @@ -102,7 +102,7 @@ ) ;; definition for function joint-channel-float-delete! -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun joint-channel-float-delete! ((arg0 joint-control-channel)) (let ((v1-0 (-> arg0 parent))) (+! (-> v1-0 float-channels) -1) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc index ae11425ed4..ee7316bbb8 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc @@ -35,7 +35,7 @@ ) ;; definition for method 20 of type process-focusable -;; INFO: Return type mismatch structure vs vector. +;; WARN: Return type mismatch structure vs vector. (defmethod get-trans process-focusable ((obj process-focusable) (arg0 int)) (let ((gp-0 (-> obj root))) (the-as vector (cond @@ -67,21 +67,21 @@ ) ;; definition for method 23 of type process-focusable -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod process-focusable-method-23 process-focusable ((obj process-focusable)) 0 (none) ) ;; definition for method 24 of type process-focusable -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod process-focusable-method-24 process-focusable ((obj process-focusable)) 0 (none) ) ;; definition for method 26 of type process-focusable -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod process-focusable-method-26 process-focusable ((obj process-focusable)) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc index 90e4746ca6..c9eaac6346 100644 --- a/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc @@ -110,7 +110,7 @@ ) ;; definition for function show-mc-info -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun show-mc-info ((arg0 dma-buffer)) (let ((s5-0 (new 'stack-no-clear 'mc-slot-info))) (dotimes (s4-0 2) @@ -162,7 +162,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc b/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc index d9a03b7396..d2f34c00eb 100644 --- a/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc @@ -259,7 +259,7 @@ ) ;; definition for function cpad-set-buzz! -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun cpad-set-buzz! ((arg0 cpad-info) (arg1 int) (arg2 int) (arg3 time-frame)) (cond ((zero? arg2) @@ -525,7 +525,7 @@ ) ;; definition for function buzz-stop! -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun buzz-stop! ((arg0 int)) (cpad-set-buzz! (-> *cpad-list* cpads arg0) 0 0 0) (cpad-set-buzz! (-> *cpad-list* cpads arg0) 1 0 0) @@ -613,7 +613,7 @@ ;; definition for function service-mouse ;; INFO: Used lq/sq -;; INFO: Return type mismatch mouse-info vs none. +;; WARN: Return type mismatch mouse-info vs none. (defun service-mouse () (let ((gp-0 *mouse*)) (mouse-get-data gp-0) @@ -657,7 +657,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc b/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc index 0b856f4c4f..8246088f7c 100644 --- a/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc @@ -13,7 +13,7 @@ ) ;; definition for function disable-irq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v0, Status] ;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Status, v0] ;; ERROR: Unsupported inline assembly instruction kind - [sync.p] @@ -31,7 +31,7 @@ ) ;; definition for function enable-irq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v0, Status] ;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Status, v0] ;; ERROR: Unsupported inline assembly instruction kind - [sync.p] @@ -80,7 +80,7 @@ ) ;; definition for function stopwatch-stop -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 a1, Count] (defun stopwatch-stop ((arg0 stopwatch)) (local-vars (a1-0 int)) @@ -108,7 +108,7 @@ ) ;; definition for function stopwatch-end -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 a1, Count] (defun stopwatch-end ((arg0 stopwatch)) (local-vars (a1-0 int)) @@ -197,7 +197,7 @@ ) ;; definition for method 14 of type clock -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod reset! clock ((obj clock)) (set! (-> obj frame-counter) (seconds 1000)) (set! (-> obj integral-frame-counter) (the-as uint #x493e0)) @@ -226,7 +226,3 @@ (set! (-> obj old-integral-frame-counter) (-> obj integral-frame-counter)) 16 ) - - - - diff --git a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc index ce943db7a4..d6d67c0ee1 100644 --- a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc @@ -29,7 +29,7 @@ ) ;; definition for method 10 of type engine-sound-pers -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod kill-callback engine-sound-pers ((obj engine-sound-pers) (arg0 connection-pers)) (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) @@ -336,7 +336,7 @@ ) ;; definition for function sound-set-stereo-mode -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sound-set-stereo-mode ((arg0 stereo-mode)) (let ((v1-1 (the-as sound-rpc-set-stereo-mode (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command set-stereo-mode)) @@ -348,7 +348,7 @@ ) ;; definition for function list-sounds -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun list-sounds () (let ((v1-1 (the-as sound-rpc-list-sounds (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) (sound-command list-sounds)) @@ -587,7 +587,7 @@ ) ;; definition for function free-last-sound-buffer-entry -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun free-last-sound-buffer-entry () (decrement-elt-used *sound-player-rpc*) 0 @@ -595,7 +595,7 @@ ) ;; definition for function sound-basic-cb -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sound-basic-cb ((arg0 int) (arg1 (pointer int32))) (set! (-> arg1 0) arg0) 0 @@ -634,7 +634,7 @@ ;; definition for function string->sound-name ;; INFO: Used lq/sq -;; INFO: Return type mismatch uint128 vs sound-name. +;; WARN: Return type mismatch uint128 vs sound-name. (defun string->sound-name ((arg0 string)) (let ((v1-0 (new 'stack-no-clear 'qword))) (set! (-> v1-0 quad) (the-as uint128 0)) @@ -853,7 +853,7 @@ ;; definition for method 0 of type ambient-sound ;; INFO: Used lq/sq -;; INFO: Return type mismatch object vs ambient-sound. +;; WARN: Return type mismatch object vs ambient-sound. (defmethod new ambient-sound ((allocation symbol) (type-to-make type) (arg0 basic) (arg1 vector)) (local-vars (sv-16 sound-spec) @@ -1102,7 +1102,7 @@ ) ;; definition for method 13 of type ambient-sound -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod update-pitch-mod! ambient-sound ((obj ambient-sound) (arg0 float)) (when (nonzero? (-> obj playing-id)) (when *sound-player-enable* @@ -1121,7 +1121,7 @@ ) ;; definition for method 14 of type ambient-sound -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod set-falloff-far! ambient-sound ((obj ambient-sound) (arg0 float)) (set! (-> obj falloff-far) (the int (* 0.00024414062 arg0))) 0 @@ -1266,7 +1266,7 @@ ) ;; definition for function loader-test-command -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun loader-test-command ((arg0 sound-command) (arg1 uint)) (let ((v1-1 (the-as sound-rpc-test-cmd (add-element *sound-loader-rpc*)))) (set! (-> v1-1 command) arg0) @@ -1296,7 +1296,7 @@ ) ;; definition for function sound-bank-reload -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun sound-bank-reload () (process-spawn-function process diff --git a/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc index faeaecfaf8..223bc2c489 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc @@ -432,8 +432,10 @@ (let ((v1-55 gp-0)) (set! (-> v1-55 spheres) s5-0) (set! (-> v1-55 num-spheres) (the-as uint 3)) - (set! (-> v1-55 collide-with) - (the-as collide-spec (logand -16561 (-> self control root-prim prim-core collide-with))) + (set! (-> v1-55 collide-with) (logclear + (-> self control root-prim prim-core collide-with) + (collide-spec civilian enemy vehicle-sphere projectile) + ) ) (set! (-> v1-55 ignore-process0) #f) (set! (-> v1-55 ignore-process1) #f) @@ -486,7 +488,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc index ba07c5a1d7..4294becfa6 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 7 of type board -;; INFO: Return type mismatch process-drawable vs board. +;; WARN: Return type mismatch process-drawable vs board. (defmethod relocate board ((obj board) (arg0 int)) (if (nonzero? (-> obj main)) (&+! (-> obj main) arg0) @@ -12,7 +12,7 @@ ;; definition for function board-post ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior board-post board () (let* ((a0-0 (-> self parent)) (v1-0 (if a0-0 @@ -202,7 +202,7 @@ ;; definition for function board-init ;; INFO: Used lq/sq -;; INFO: Return type mismatch object vs none. +;; WARN: Return type mismatch object vs none. (defbehavior board-init board () (set! (-> self root) (new 'process 'trsqv)) (initialize-skeleton diff --git a/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc b/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc index ca95383cbe..faa946ee80 100644 --- a/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc @@ -208,7 +208,7 @@ ) ;; definition for method 2 of type surface -;; ERROR: Function may read a register that is not set: t3 +;; WARN: Function may read a register that is not set: t3 (defmethod print surface ((obj surface)) (local-vars (t3-0 none)) (format @@ -278,7 +278,7 @@ ) ;; definition for function surface-clamp-speed -;; INFO: Return type mismatch float vs none. +;; WARN: Return type mismatch float vs none. (defun surface-clamp-speed ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) (when (= arg3 1) (set! (-> arg0 transv-max) (fmin (-> arg0 transv-max) (-> arg1 transv-max))) @@ -1316,7 +1316,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/task/task-control-h_REF.gc b/test/decompiler/reference/jak2/engine/task/task-control-h_REF.gc index deaa363a66..8ff9020217 100644 --- a/test/decompiler/reference/jak2/engine/task/task-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/task/task-control-h_REF.gc @@ -344,7 +344,7 @@ ) ;; definition for function c-string->game-task -;; INFO: Return type mismatch int vs game-task. +;; WARN: Return type mismatch int vs game-task. (defun c-string->game-task ((arg0 string)) (the-as game-task (cond ((string= arg0 "GAME_TASK_FOREST_PROTECT") @@ -1059,7 +1059,7 @@ ) ;; definition (debug) for function game-task-node-flag->string -;; INFO: Return type mismatch object vs none. +;; WARN: Return type mismatch object vs none. (defun-debug game-task-node-flag->string ((arg0 game-task-node-flag)) (if (= (logand arg0 (game-task-node-flag clear-task-mask)) (game-task-node-flag clear-task-mask)) (format #t "clear-task-mask ") diff --git a/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc index 3ba08b9869..774d99f9db 100644 --- a/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc @@ -262,7 +262,7 @@ :flag-assert #x1900000cd0 (:methods (new (symbol type int) _type_ 0) - (gui-control-method-9 (_type_ process gui-channel gui-action int float time-frame) sound-id 9) + (gui-control-method-9 (_type_ process gui-channel gui-action string float time-frame) sound-id 9) (gui-control-method-10 (_type_ process gui-channel) none 10) (gui-control-method-11 (_type_ gui-connection) int 11) (gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id 12) diff --git a/test/decompiler/reference/jak2/engine/ui/text_REF.gc b/test/decompiler/reference/jak2/engine/ui/text_REF.gc index de4d407476..30de3d258c 100644 --- a/test/decompiler/reference/jak2/engine/ui/text_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/text_REF.gc @@ -52,7 +52,7 @@ ) ;; definition for method 5 of type game-text-info -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of game-text-info ((obj game-text-info)) (the-as int (+ (-> obj type size) (* (-> obj length) 8))) ) @@ -260,7 +260,7 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for function load-level-text-files -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun load-level-text-files ((arg0 int)) "Load the text files needed for level idx. This function made more sense back when text files were split up, but in the end they put everything @@ -273,7 +273,7 @@ ) ;; definition for function draw-debug-text-box -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun draw-debug-text-box ((arg0 font-context)) "Draws some lines" (when *cheat-mode* @@ -332,7 +332,7 @@ ) ;; definition for function print-game-text-scaled -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun print-game-text-scaled ((arg0 string) (arg1 float) (arg2 font-context) (arg3 int)) "Print text, with a given scaling" (let ((f26-0 (-> arg2 width)) @@ -625,7 +625,7 @@ ) ;; definition for function disable-level-text-file-loading -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun disable-level-text-file-loading () "Disables [[*level-text-file-load-flag*]]" (set! *level-text-file-load-flag* #f) @@ -634,7 +634,7 @@ ) ;; definition for function enable-level-text-file-loading -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun enable-level-text-file-loading () "Disables [[*level-text-file-load-flag*]]" (set! *level-text-file-load-flag* #t) diff --git a/test/decompiler/reference/jak2/engine/util/profile_REF.gc b/test/decompiler/reference/jak2/engine/util/profile_REF.gc index 6d4a85ec93..23d59744d1 100644 --- a/test/decompiler/reference/jak2/engine/util/profile_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/profile_REF.gc @@ -61,7 +61,7 @@ (define *profile-ticks* #f) ;; definition for method 10 of type profile-segment-array -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod start-frame! profile-segment-array ((obj profile-segment-array)) (set! (-> obj count) 0) (set! (-> obj depth) 0) @@ -73,7 +73,7 @@ ) ;; definition for method 11 of type profile-segment-array -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod start-segment! profile-segment-array ((obj profile-segment-array) (arg0 symbol) (arg1 rgba)) (when (and *dproc* *debug-segment*) (let ((s4-0 (-> obj data (-> obj count)))) @@ -94,7 +94,7 @@ ) ;; definition for method 12 of type profile-segment-array -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod end-segment! profile-segment-array ((obj profile-segment-array)) (when (and *dproc* *debug-segment*) (let* ((v1-4 (+ (-> obj depth) -1)) @@ -386,7 +386,7 @@ ) ;; definition for method 9 of type profile-array -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod setup-categories! profile-array ((obj profile-array)) (dotimes (s5-0 2) (let ((s3-0 (-> *profile-array* data s5-0)) @@ -545,7 +545,7 @@ ;; definition for method 10 of type profile-array ;; INFO: Used lq/sq -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod draw-bars! profile-array ((obj profile-array) (arg0 dma-buffer) (arg1 int)) (local-vars (sv-16 (function _varargs_ object)) (sv-32 (function _varargs_ object))) (let* ((v1-0 arg0) @@ -774,7 +774,7 @@ ) ;; definition for method 11 of type profile-array -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod draw-text! profile-array ((obj profile-array)) (let ((gp-0 *profile-collapse*)) (dotimes (s5-0 (-> gp-0 count)) @@ -808,7 +808,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/util/script-h_REF.gc b/test/decompiler/reference/jak2/engine/util/script-h_REF.gc index ac37f7e703..7d675efa01 100644 --- a/test/decompiler/reference/jak2/engine/util/script-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/script-h_REF.gc @@ -47,7 +47,7 @@ :flag-assert #xc000000a0 (:methods (new (symbol type basic process vector) _type_ 0) - (script-context-method-9 () none 9) + (eval! (_type_ structure) pair 9) (script-context-method-10 () none 10) (script-context-method-11 () none 11) ) @@ -81,7 +81,7 @@ ) ;; definition for method 0 of type script-context -;; INFO: Return type mismatch structure vs script-context. +;; WARN: Return type mismatch structure vs script-context. (defmethod new script-context ((allocation symbol) (type-to-make type) (arg0 basic) (arg1 process) (arg2 vector)) (let ((t9-0 (method-of-type structure new)) (v1-1 type-to-make) diff --git a/test/decompiler/reference/jak2/kernel/gcommon_REF.gc b/test/decompiler/reference/jak2/kernel/gcommon_REF.gc index ce8ad86182..65bacf3b23 100644 --- a/test/decompiler/reference/jak2/kernel/gcommon_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gcommon_REF.gc @@ -193,7 +193,7 @@ ) ;; definition for method 5 of type type -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of type ((obj type)) (the-as int (logand (the-as uint #xfffffff0) (+ (* (-> obj allocated-length) 4) 43))) ) @@ -297,7 +297,7 @@ ) ;; definition for method 5 of type pair -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of pair ((obj pair)) (the-as int (-> pair size)) ) @@ -417,7 +417,7 @@ ) ;; definition for function delete! -;; INFO: Return type mismatch object vs pair. +;; WARN: Return type mismatch object vs pair. (defun delete! ((arg0 object) (arg1 object)) (the-as pair (cond ((= arg0 (car arg1)) @@ -546,7 +546,7 @@ ) ;; definition for method 5 of type inline-array-class -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of inline-array-class ((obj inline-array-class)) (the-as int (+ (-> obj type size) (* (-> obj allocated-length) (the-as int (-> obj type heap-base))))) ) @@ -806,7 +806,7 @@ ) ;; definition for method 5 of type array -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of array ((obj array)) (the-as int diff --git a/test/decompiler/reference/jak2/kernel/gkernel_REF.gc b/test/decompiler/reference/jak2/kernel/gkernel_REF.gc index b18655d66c..cc62dcc72a 100644 --- a/test/decompiler/reference/jak2/kernel/gkernel_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gkernel_REF.gc @@ -74,7 +74,7 @@ (define *null-kernel-context* (new 'static 'kernel-context)) ;; definition for method 1 of type thread -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod delete thread ((obj thread)) (when (= obj (-> obj process main-thread)) (break!) @@ -92,7 +92,7 @@ ) ;; definition for method 9 of type thread -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod stack-size-set! thread ((obj thread) (arg0 int)) (let ((a2-0 (-> obj process))) (cond @@ -115,7 +115,7 @@ ) ;; definition for method 0 of type cpu-thread -;; INFO: Return type mismatch pointer vs cpu-thread. +;; WARN: Return type mismatch pointer vs cpu-thread. (defmethod new cpu-thread ((allocation symbol) (type-to-make type) (arg0 process) (arg1 symbol) (arg2 int) (arg3 pointer)) (let ((v0-0 (cond ((-> arg0 top-thread) @@ -145,13 +145,13 @@ ) ;; definition for method 5 of type cpu-thread -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of cpu-thread ((obj cpu-thread)) (the-as int (+ (-> obj type size) (-> obj stack-size))) ) ;; definition for function remove-exit -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defbehavior remove-exit process () (if (-> self stack-frame-top) (set! (-> self stack-frame-top) (-> self stack-frame-top next)) @@ -305,7 +305,7 @@ ) ;; definition for method 0 of type process -;; INFO: Return type mismatch object vs process. +;; WARN: Return type mismatch object vs process. (defmethod new process ((allocation symbol) (type-to-make type) (arg0 string) (arg1 int)) (let ((v0-0 (if (logtest? (the-as int allocation) 1) (object-new allocation type-to-make (the-as int (+ (-> process size) arg1))) @@ -396,7 +396,7 @@ ) ;; definition for method 5 of type process -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of process ((obj process)) (the-as int (+ (-> process size) (-> obj allocated-length))) ) @@ -510,7 +510,7 @@ ) ;; definition for method 15 of type dead-pool -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod return-process dead-pool ((obj dead-pool) (arg0 process)) (change-parent arg0 obj) 0 @@ -534,7 +534,7 @@ ) ;; definition for method 16 of type dead-pool-heap -;; INFO: Return type mismatch dead-pool-heap vs none. +;; WARN: Return type mismatch dead-pool-heap vs none. (defmethod init dead-pool-heap ((obj dead-pool-heap) (arg0 symbol) (arg1 int)) (countdown (v1-0 (-> obj allocated-length)) (let ((a0-4 (-> obj process-list v1-0))) @@ -569,7 +569,7 @@ ) ;; definition for method 25 of type dead-pool-heap -;; INFO: Return type mismatch object vs pointer. +;; WARN: Return type mismatch object vs pointer. (defmethod gap-location dead-pool-heap ((obj dead-pool-heap) (arg0 dead-pool-heap-rec)) (the-as pointer @@ -657,7 +657,7 @@ ) ;; definition for method 5 of type dead-pool-heap -;; INFO: Return type mismatch uint vs int. +;; WARN: Return type mismatch uint vs int. (defmethod asize-of dead-pool-heap ((obj dead-pool-heap)) (the-as int (+ (-> obj type size) (* 12 (-> obj allocated-length)))) ) @@ -760,7 +760,7 @@ ) ;; definition for method 15 of type dead-pool-heap -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod return-process dead-pool-heap ((obj dead-pool-heap) (arg0 process)) (if (!= obj (-> arg0 pool)) (format 0 "ERROR: process ~A does not belong to dead-pool-heap ~A.~%" arg0 obj) @@ -817,7 +817,7 @@ ) ;; definition for method 17 of type dead-pool-heap -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 17 dead-pool-heap) has a return type of none, but the expression builder found a return statement. (defmethod compact dead-pool-heap ((obj dead-pool-heap) (arg0 int)) (if (zero? (-> obj heap base)) @@ -879,7 +879,7 @@ ) ;; definition for method 19 of type dead-pool-heap -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod churn dead-pool-heap ((obj dead-pool-heap) (arg0 int)) (while (nonzero? arg0) (+! arg0 -1) @@ -923,7 +923,7 @@ ) ;; definition for function method-state -;; INFO: Return type mismatch function vs state. +;; WARN: Return type mismatch function vs state. (defun method-state ((arg0 type) (arg1 basic)) (dotimes (v1-0 (the-as int (-> arg0 allocated-length))) (let ((a2-2 (the-as basic (-> arg0 method-table v1-0)))) @@ -945,7 +945,7 @@ (define *global-search-count* 0) ;; definition for function process-by-name -;; INFO: Return type mismatch process-tree vs process. +;; WARN: Return type mismatch process-tree vs process. (defun process-by-name ((arg0 string) (arg1 process-tree)) (set! *global-search-name* arg0) (the-as process (search-process-tree @@ -956,7 +956,7 @@ ) ;; definition for function process-not-name -;; INFO: Return type mismatch process-tree vs process. +;; WARN: Return type mismatch process-tree vs process. (defun process-not-name ((arg0 string) (arg1 process-tree)) (set! *global-search-name* arg0) (the-as @@ -1173,7 +1173,7 @@ ) ;; definition for function sync-dispatcher -;; INFO: Return type mismatch symbol vs object. +;; WARN: Return type mismatch symbol vs object. (defun sync-dispatcher () (let ((t9-0 *listener-function*)) (the-as object (when t9-0 @@ -1245,7 +1245,7 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for method 0 of type protect-frame -;; INFO: Return type mismatch int vs protect-frame. +;; WARN: Return type mismatch int vs protect-frame. (defmethod new protect-frame ((allocation symbol) (type-to-make type) (arg0 (function none))) (with-pp (let ((v0-0 (the-as object (+ (the-as int allocation) 4)))) @@ -1260,7 +1260,7 @@ ) ;; definition for function previous-brother -;; INFO: Return type mismatch (pointer process-tree) vs object. +;; WARN: Return type mismatch (pointer process-tree) vs object. (defun previous-brother ((arg0 process-tree)) (let ((v1-0 (-> arg0 parent))) (when v1-0 @@ -1468,7 +1468,7 @@ ) ;; definition for method 10 of type process-tree -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod deactivate process-tree ((obj process-tree)) 0 (none) @@ -1483,7 +1483,7 @@ (define entity-deactivate-handler (the-as (function process entity-actor none) nothing)) ;; definition for method 10 of type process -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] (defmethod deactivate process ((obj process)) diff --git a/test/decompiler/reference/jak2/kernel/gstate_REF.gc b/test/decompiler/reference/jak2/kernel/gstate_REF.gc index 219ab13e6b..161a1131e0 100644 --- a/test/decompiler/reference/jak2/kernel/gstate_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gstate_REF.gc @@ -150,7 +150,7 @@ ) ;; definition for method 9 of type event-message-block-array -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defmethod send-all! event-message-block-array ((obj event-message-block-array)) (dotimes (s5-0 (-> obj length)) (let* ((a1-0 (-> obj data s5-0)) diff --git a/test/decompiler/reference/jak2/kernel/gstring_REF.gc b/test/decompiler/reference/jak2/kernel/gstring_REF.gc index cf6400a461..7265e421c9 100644 --- a/test/decompiler/reference/jak2/kernel/gstring_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gstring_REF.gc @@ -205,7 +205,7 @@ ) ;; definition for function copyn-charp<-string -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun copyn-charp<-string ((arg0 (pointer uint8)) (arg1 string) (arg2 int)) (let ((v1-0 (-> arg1 data))) (while (and (nonzero? (-> v1-0 0)) (< 1 arg2)) @@ -484,7 +484,7 @@ ) ;; definition for function string-upcase -;; INFO: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs none. (defun string-upcase ((arg0 string) (arg1 string)) (let* ((a0-1 (-> arg0 data)) (a3-0 (-> a0-1 0)) @@ -754,7 +754,3 @@ ;; failed to figure out what this is: (kmemclose) - - - - diff --git a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc new file mode 100644 index 0000000000..5d4cb664de --- /dev/null +++ b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc @@ -0,0 +1,1948 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type com-airlock +(deftype com-airlock (process-drawable) + ((child-override basic :offset 24) + (root-override collide-shape :offset 128) + (level-name string :offset-assert 200) + (open-test symbol :offset-assert 204) + (were-behind? symbol :offset-assert 208) + (inner? symbol :offset-assert 212) + (sound-behind? symbol :offset-assert 216) + (visible-move? symbol :offset-assert 220) + (saw-pilot? handle :offset-assert 224) + (last-distance meters :offset-assert 232) + (y-height vector :offset-assert 236) + (pre-open-speed float :offset-assert 240) + (latch-closed-time time-frame :offset-assert 248) + (latch-open-time time-frame :offset-assert 256) + (gear joint-mod :offset-assert 264) + (gear-rot degrees :offset-assert 268) + (gear-rotv degrees :offset-assert 272) + (open-frame float :offset-assert 276) + (pre-open-frame float :offset-assert 280) + (lock-frame float :offset-assert 284) + (open-distance meters :offset-assert 288) + (active-distance meters :offset-assert 292) + (sound-id sound-id :offset-assert 296) + (gear-sound-id sound-id :offset-assert 300) + (sound-gear sound-spec :offset-assert 304) + (sound-pre-open sound-spec :offset-assert 308) + (sound-pre-open-stop sound-spec :offset-assert 312) + (sound-lock-loop sound-spec :offset-assert 316) + (sound-lock-stop sound-spec :offset-assert 320) + (sound-open sound-spec :offset-assert 324) + (sound-open-loop sound-spec :offset-assert 328) + (sound-open-stop sound-spec :offset-assert 332) + (sound-close sound-spec :offset-assert 336) + (sound-close-loop sound-spec :offset-assert 340) + (sound-close-stop sound-spec :offset-assert 344) + (sound-post-close sound-spec :offset-assert 348) + (sound-post-close-stop sound-spec :offset-assert 352) + (spool-sound-time time-frame :offset-assert 360) + (door-radius meters :offset-assert 368) + ) + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + (:methods + (open (symbol) _type_ :state 20) + (close (symbol) _type_ :state 21) + (init-airlock! (_type_) _type_ 22) + (want-cross-airlock? (_type_) symbol :behavior com-airlock 23) + (destination-loaded? (_type_ symbol) symbol 24) + (check-crossing-distance (_type_ vector symbol) float :behavior com-airlock 25) + (rotate-gear! (_type_ float) degrees :behavior com-airlock 26) + (play-city-voice-sound (_type_ symbol) none :behavior com-airlock 27) + ) + ) + +;; definition for method 3 of type com-airlock +(defmethod inspect com-airlock ((obj com-airlock)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tlevel-name: ~A~%" (-> obj level-name)) + (format #t "~2Topen-test: ~A~%" (-> obj open-test)) + (format #t "~2Twere-behind?: ~A~%" (-> obj were-behind?)) + (format #t "~2Tinner?: ~A~%" (-> obj inner?)) + (format #t "~2Tsound-behind?: ~A~%" (-> obj sound-behind?)) + (format #t "~2Tvisible-move?: ~A~%" (-> obj visible-move?)) + (format #t "~2Tsaw-pilot?: ~D~%" (-> obj saw-pilot?)) + (format #t "~2Tlast-distance: (meters ~m)~%" (-> obj last-distance)) + (format #t "~2Ty-height: #x~X~%" (-> obj y-height)) + (format #t "~2Tpre-open-speed: ~f~%" (-> obj pre-open-speed)) + (format #t "~2Tlatch-closed-time: ~D~%" (-> obj latch-closed-time)) + (format #t "~2Tlatch-open-time: ~D~%" (-> obj latch-open-time)) + (format #t "~2Tgear: ~A~%" (-> obj gear)) + (format #t "~2Tgear-rot: (deg ~r)~%" (-> obj gear-rot)) + (format #t "~2Tgear-rotv: (deg ~r)~%" (-> obj gear-rotv)) + (format #t "~2Topen-frame: ~f~%" (-> obj open-frame)) + (format #t "~2Tpre-open-frame: ~f~%" (-> obj pre-open-frame)) + (format #t "~2Tlock-frame: ~f~%" (-> obj lock-frame)) + (format #t "~2Topen-distance: (meters ~m)~%" (-> obj open-distance)) + (format #t "~2Tactive-distance: (meters ~m)~%" (-> obj active-distance)) + (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tgear-sound-id: ~D~%" (-> obj gear-sound-id)) + (format #t "~2Tsound-gear: ~A~%" (-> obj sound-gear)) + (format #t "~2Tsound-pre-open: ~A~%" (-> obj sound-pre-open)) + (format #t "~2Tsound-pre-open-stop: ~A~%" (-> obj sound-pre-open-stop)) + (format #t "~2Tsound-lock-loop: ~A~%" (-> obj sound-lock-loop)) + (format #t "~2Tsound-lock-stop: ~A~%" (-> obj sound-lock-stop)) + (format #t "~2Tsound-open: ~A~%" (-> obj sound-open)) + (format #t "~2Tsound-open-loop: ~A~%" (-> obj sound-open-loop)) + (format #t "~2Tsound-open-stop: ~A~%" (-> obj sound-open-stop)) + (format #t "~2Tsound-close: ~A~%" (-> obj sound-close)) + (format #t "~2Tsound-close-loop: ~A~%" (-> obj sound-close-loop)) + (format #t "~2Tsound-close-stop: ~A~%" (-> obj sound-close-stop)) + (format #t "~2Tsound-post-close: ~A~%" (-> obj sound-post-close)) + (format #t "~2Tsound-post-close-stop: ~A~%" (-> obj sound-post-close-stop)) + (format #t "~2Tspool-sound-time: ~D~%" (-> obj spool-sound-time)) + (format #t "~2Tdoor-radius: (meters ~m)~%" (-> obj door-radius)) + (label cfg-4) + obj + ) + +;; definition for method 10 of type com-airlock +(defmethod deactivate com-airlock ((obj com-airlock)) + (process-entity-status! obj (entity-perm-status subtask-complete) #f) + (if (nonzero? (-> obj sound-id)) + (sound-stop (-> obj sound-id)) + ) + (if (nonzero? (-> obj gear-sound-id)) + (sound-stop (-> obj gear-sound-id)) + ) + ((method-of-type process-drawable deactivate) obj) + (none) + ) + +;; definition for method 7 of type com-airlock +;; WARN: Return type mismatch process-drawable vs com-airlock. +(defmethod relocate com-airlock ((obj com-airlock) (arg0 int)) + (if (nonzero? (-> obj gear)) + (&+! (-> obj gear) arg0) + ) + (the-as com-airlock ((method-of-type process-drawable relocate) obj arg0)) + ) + +;; definition for method 22 of type com-airlock +(defmethod init-airlock! com-airlock ((obj com-airlock)) + (process-entity-status! obj (entity-perm-status subtask-complete) #f) + (process-drawable-from-entity! obj (the-as entity-actor (-> obj entity))) + (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> obj were-behind?) #f) + (set! (-> obj inner?) + (logtest? (the-as int (res-lump-value (-> obj entity) 'options uint128 :time -1000000000.0)) 1) + ) + (set! (-> obj sound-behind?) #f) + (set! (-> obj saw-pilot?) (the-as handle #f)) + (set! (-> obj open-frame) 0.0) + (set! (-> obj pre-open-frame) 0.0) + (set! (-> obj lock-frame) 0.0) + (set! (-> obj pre-open-speed) 2.0) + (set! (-> obj open-distance) (res-lump-float (-> obj entity) 'distance :default 143360.0)) + (set! (-> obj active-distance) + (res-lump-float (-> obj entity) 'idle-distance :default (+ 143360.0 (-> obj open-distance))) + ) + (set! (-> obj y-height) (res-lump-data (-> obj entity) 'height vector)) + (set! (-> obj level-name) (res-lump-struct (-> obj entity) 'on-notice string)) + (set! (-> obj open-test) + (the-as symbol ((method-of-type res-lump get-property-struct) + (-> obj entity) + 'open-test + 'interp + -1000000000.0 + (the-as structure '(not (or (scene-player?) (focus-test? *target* grabbed)))) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (set! (-> obj sound-gear) #f) + (set! (-> obj sound-pre-open) #f) + (set! (-> obj sound-pre-open-stop) #f) + (set! (-> obj sound-lock-loop) #f) + (set! (-> obj sound-lock-stop) #f) + (set! (-> obj sound-post-close) #f) + (set! (-> obj sound-post-close-stop) #f) + (set! (-> obj sound-open) #f) + (set! (-> obj sound-close) #f) + (set! (-> obj sound-open-loop) #f) + (set! (-> obj sound-close-loop) #f) + (set! (-> obj sound-open-stop) #f) + (set! (-> obj sound-close-stop) #f) + (set! (-> obj door-radius) 20480.0) + obj + ) + +;; definition for method 25 of type com-airlock +(defmethod check-crossing-distance com-airlock ((obj com-airlock) (arg0 vector) (arg1 symbol)) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override quat))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj root-override trans))) + ) + (set! (-> s4-1 y) 0.0) + (let ((f30-0 (vector-dot s4-1 s5-0))) + (cond + ((not arg1) + ) + ((or (< (vector-vector-xz-distance (-> obj root-override trans) arg0) 40960.0) + (< 0.7 (fabs (vector-dot s5-0 (vector-normalize! s4-1 1.0)))) + ) + (when (and (< f30-0 0.0) (< 0.0 (-> obj last-distance))) + (let ((s5-1 (res-lump-struct (-> obj entity) 'on-cross structure))) + (if s5-1 + (eval! (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) s5-1) + ) + ) + ) + (set! (-> obj last-distance) f30-0) + ) + ((< 0.0 (-> obj last-distance)) + (set! f30-0 (fmax 4096.0 f30-0)) + ) + ((< (-> obj last-distance) 0.0) + (set! f30-0 (fmin -4096.0 f30-0)) + ) + ) + f30-0 + ) + ) + ) + +;; definition for method 23 of type com-airlock +;; WARN: Return type mismatch object vs symbol. +(defmethod want-cross-airlock? com-airlock ((obj com-airlock)) + (local-vars (a0-12 entity-actor)) + (let* ((s4-0 (target-pos 0)) + (f30-0 (check-crossing-distance obj s4-0 #t)) + (s5-0 (>= (-> obj latch-open-time) (-> self clock frame-counter))) + ) + (the-as + symbol + (and (or s5-0 (< (vector-vector-xz-distance (-> obj root-override trans) s4-0) (-> obj active-distance))) + (or s5-0 (not (-> obj y-height)) (and (>= (-> s4-0 y) (- (-> obj root-override trans y) (-> obj y-height y))) + (< (-> s4-0 y) (+ (-> obj root-override trans y) (-> obj y-height x))) + ) + ) + (begin + (if (and (not (-> obj were-behind?)) (and (< f30-0 0.0) (-> obj inner?))) + (set! (-> obj were-behind?) #t) + ) + (and (< (-> obj latch-closed-time) (-> self clock frame-counter)) + (or (not (and *target* (logtest? (focus-status fs20 fs30) (-> *target* focus-status)))) (< f30-0 -409.6)) + (or (and (< f30-0 (-> obj open-distance)) + (or (not (-> obj were-behind?)) (< f30-0 20480.0)) + (and (or (< 409.6 f30-0) + (begin + (let ((a0-11 (-> obj entity))) + (set! a0-12 (entity-actor-lookup a0-11 'next-actor 0)) + ) + (not a0-12) + ) + (logtest? (-> a0-12 extra perm status) (entity-perm-status subtask-complete)) + ) + (and (eval! + (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) + (the-as structure (-> obj open-test)) + ) + (-> *setting-control* user-current airlock) + ) + ) + ) + s5-0 + (let ((f0-8 (check-crossing-distance obj (camera-pos) #f))) + (and (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status fs8)))) + (or (< (* f30-0 f0-8) 0.0) + (and (< (fabs f0-8) 4096.0) + (< (vector-vector-xz-distance (camera-pos) (-> obj root-override trans)) (-> obj door-radius)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 24 of type com-airlock +(defmethod destination-loaded? com-airlock ((obj com-airlock) (arg0 symbol)) + (with-pp + (let ((gp-1 (eval! + (new 'stack 'script-context (the-as basic (process->ppointer pp)) pp (the-as vector #f)) + (-> obj level-name) + ) + ) + (s4-0 #f) + ) + (cond + ((not gp-1) + (if arg0 + 'unknown + #f + ) + ) + (arg0 + (let* ((s3-0 gp-1) (s2-0 (car s3-0))) (while (not (null? s3-0)) + (let ((v1-4 (level-status *level* (the-as symbol s2-0)))) + (if (not (or (= v1-4 'loaded) (= v1-4 'active))) + (return #f) + ) + ) + (if (= s2-0 'ctywide) + (set! s4-0 (-> ctywide borrow-level 1)) + ) + (set! s3-0 (cdr s3-0)) + (set! s2-0 (car s3-0)) + ) + ) + (when s4-0 + (let ((v1-17 (level-status *level* s4-0))) + (if (not (or (= v1-17 'loaded) (= v1-17 'active))) + (return #f) + ) + ) + ) + (if (!= arg0 'display) + (return #t) + ) + (let ((a1-7 (car gp-1))) + (while (not (null? gp-1)) + (let ((v1-26 (level-get *level* (the-as symbol a1-7)))) + (if (not (and v1-26 (= (-> v1-26 status) 'active) (-> v1-26 display?))) + (return #f) + ) + ) + (set! gp-1 (cdr gp-1)) + (set! a1-7 (car gp-1)) + ) + ) + #t + ) + (else + (let* ((v1-33 gp-1) (a0-11 (car v1-33))) (while (not (null? v1-33)) + (dotimes (a1-10 6) + (if (= a0-11 (-> *load-state* want a1-10 name)) + (goto cfg-50) + ) + ) + #t + (return #f) + (label cfg-50) + (set! v1-33 (cdr v1-33)) + (set! a0-11 (car v1-33)) + ) + ) + #t + ) + ) + ) + ) + ) + +;; definition for method 26 of type com-airlock +(defmethod rotate-gear! com-airlock ((obj com-airlock) (arg0 float)) + (when (nonzero? (-> obj gear)) + (if (and (zero? (-> obj gear-sound-id)) + (-> obj sound-gear) + (and (-> obj next-state) (= (-> obj next-state name) 'open)) + (>= (check-crossing-distance obj (target-pos 0) #f) 0.0) + ) + (set! (-> obj gear-sound-id) (sound-play-by-spec (-> obj sound-gear) (new-sound-id) (the-as vector #t))) + ) + (seek! (-> obj gear-rotv) arg0 (* 131072.0 (-> self clock seconds-per-frame))) + (+! (-> obj gear-rot) (* (-> obj gear-rotv) (-> self clock seconds-per-frame))) + (twist-set! (-> obj gear) (the-as float #f) (the-as float #f) (-> obj gear-rot)) + ) + (-> obj gear-rotv) + ) + +;; definition for method 27 of type com-airlock +;; WARN: Return type mismatch int vs none. +(defmethod play-city-voice-sound com-airlock ((obj com-airlock) (arg0 symbol)) + (let ((gp-0 (the-as array #f))) + (case arg0 + (('enter) + (set! gp-0 (new 'static 'boxed-array :type string "cityv005" "cityv006" "cityv007" "cityv008" "cityv009")) + ) + (('exit) + (set! gp-0 (new 'static 'boxed-array :type string "cityv001" "cityv002" "cityv003" "cityv004")) + ) + ) + (cond + ((and gp-0 (>= (- (-> self clock frame-counter) (-> obj spool-sound-time)) (seconds 2))) + (set! (-> obj spool-sound-time) (-> self clock frame-counter)) + (gui-control-method-9 + *gui-control* + obj + (gui-channel alert) + (gui-action play) + (-> (the-as (array string) (+ (* (rand-vu-int-range 0 (+ (-> gp-0 length) -1)) 4) (the-as int gp-0))) 0) + -99.0 + 0 + ) + ) + (else + 0 + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(let ((a0-10 (new 'static 'skeleton-group + :name "skel-com-airlock-outer" + :extra #f + :info #f + :art-group-name "com-airlock-outer" + :bounds (new 'static 'vector :y 20480.0 :w 57344.0) + :version #x7 + ) + ) + ) + (set! (-> a0-10 jgeo) 0) + (set! (-> a0-10 janim) 2) + (set! (-> a0-10 mgeo 0) 1) + (set! (-> a0-10 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-10) + ) + +;; failed to figure out what this is: +(let ((a0-11 (new 'static 'skeleton-group + :name "skel-com-airlock-inner" + :extra #f + :info #f + :art-group-name "com-airlock-inner" + :bounds (new 'static 'vector :y 20480.0 :w 57344.0) + :version #x7 + ) + ) + ) + (set! (-> a0-11 jgeo) 0) + (set! (-> a0-11 janim) 2) + (set! (-> a0-11 mgeo 0) 1) + (set! (-> a0-11 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-11) + ) + +;; failed to figure out what this is: +(defstate close (com-airlock) + :virtual #t + :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((v1-0 arg2)) + (the-as + object + (cond + ((= v1-0 'close) + (set! (-> self latch-closed-time) (+ (-> self clock frame-counter) (if (>= arg1 1) + (the-as int (-> arg3 param 0)) + 3000 + ) + ) + ) + (if (and (>= arg1 2) (and (= (-> arg3 param 1) #t) (not (want-cross-airlock? self)))) + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min) + ) + (and (-> self next-state) (= (-> self next-state name) 'open)) + ) + ((= v1-0 'open) + (set! (-> self latch-open-time) (+ (-> self clock frame-counter) (if (>= arg1 1) + (the-as int (-> arg3 param 0)) + 3000 + ) + ) + ) + (if (and (>= arg1 2) (and (= (-> arg3 param 1) #t) (want-cross-airlock? self) (destination-loaded? self #f))) + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) + :num! (identity + (the float (+ (-> (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) frames num-frames) -1)) + ) + ) + ) + (and (-> self next-state) (= (-> self next-state name) 'close)) + ) + ((= v1-0 'front) + (let ((f30-0 (check-crossing-distance self (target-pos 0) #f)) + (f0-3 (check-crossing-distance self (camera-pos) #f)) + ) + (and (< 2048.0 f30-0) (>= (* f30-0 f0-3) 0.0)) + ) + ) + ((= v1-0 'back) + (let ((f30-1 (check-crossing-distance self (target-pos 0) #f)) + (f0-5 (check-crossing-distance self (camera-pos) #f)) + ) + (and (< f30-1 -2048.0) (>= (* f30-1 f0-5) 0.0)) + ) + ) + ((= v1-0 'sound) + (if (>= (check-crossing-distance self (target-pos 0) #f) 0.0) + (play-city-voice-sound self (the-as symbol (-> arg3 param 0))) + ) + ) + ((= v1-0 'distance) + (* (the int (check-crossing-distance self (target-pos 0) #f)) 8) + ) + ) + ) + ) + ) + :enter (behavior ((arg0 symbol)) + (set! (-> self visible-move?) #f) + (none) + ) + :exit (behavior () + (when (nonzero? (-> self sound-id)) + (let ((v1-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-2 command) (sound-command set-param)) + (set! (-> v1-2 id) (-> self sound-id)) + (set! (-> v1-2 params volume) -4) + (set! (-> v1-2 auto-time) 24) + (set! (-> v1-2 auto-from) 2) + (set! (-> v1-2 params mask) (the-as uint 17)) + (-> v1-2 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + (when (nonzero? (-> self gear-sound-id)) + (let ((v1-6 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-6 command) (sound-command set-param)) + (set! (-> v1-6 id) (-> self gear-sound-id)) + (set! (-> v1-6 params volume) -4) + (set! (-> v1-6 auto-time) 24) + (set! (-> v1-6 auto-from) 2) + (set! (-> v1-6 params mask) (the-as uint 17)) + (-> v1-6 id) + ) + (set! (-> self gear-sound-id) (new 'static 'sound-id)) + 0 + ) + (none) + ) + :trans (behavior () + (if (logtest? (-> self draw status) (draw-control-status on-screen)) + (set! (-> self visible-move?) #t) + ) + (when (and (want-cross-airlock? self) + (begin + (let ((gp-0 (res-lump-struct (-> self entity) 'on-activate structure))) + (if gp-0 + (eval! (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) gp-0) + ) + ) + (destination-loaded? self #f) + ) + ) + (when (nonzero? (-> self sound-id)) + (let ((v1-17 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-17 command) (sound-command set-param)) + (set! (-> v1-17 id) (-> self sound-id)) + (set! (-> v1-17 params volume) -4) + (set! (-> v1-17 auto-time) 24) + (set! (-> v1-17 auto-from) 2) + (set! (-> v1-17 params mask) (the-as uint 17)) + (-> v1-17 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + (go-virtual open #f) + ) + (none) + ) + :code (behavior ((arg0 symbol)) + (process-entity-status! self (entity-perm-status subtask-complete) #f) + (when (not arg0) + (if (and (-> self sound-close) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (sound-play-by-spec (-> self sound-close) (new-sound-id) (the-as vector #t)) + ) + (if (and (-> self sound-close-loop) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (set! (-> self sound-id) (sound-play-by-spec (-> self sound-close-loop) (new-sound-id) (the-as vector #t))) + ) + (while (< (-> self open-frame) (ja-aframe-num 0)) + (rotate-gear! self 65536.0) + (when (and (-> self were-behind?) + (< 0.4 (vector-dot + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override quat)) + (-> (math-camera-matrix) vector 2) + ) + ) + (< 0.0 (check-crossing-distance self (target-pos 0) #f)) + ) + (ja :num-func num-func-identity :frame-num (ja-aframe (-> self open-frame) 0)) + (goto cfg-42) + ) + (suspend) + (ja :num! (seek! 0.0 2.0)) + (transform-post) + ) + (label cfg-42) + (if (< 0.0 (check-crossing-distance self (target-pos 0) #f)) + ((lambda :behavior com-airlock + () + (let ((gp-0 (res-lump-struct (-> self entity) 'on-exit structure))) + (if (and gp-0 (not *scene-player*)) + (eval! (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) gp-0) + ) + ) + (when (-> self were-behind?) + (let ((gp-1 (res-lump-struct (-> self entity) 'on-inside structure))) + (set! (-> self were-behind?) #f) + (if (and gp-1 (not *scene-player*)) + (eval! (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) gp-1) + ) + ) + ) + ) + ) + ) + (when (nonzero? (-> self sound-id)) + (let ((v1-46 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-46 command) (sound-command set-param)) + (set! (-> v1-46 id) (-> self sound-id)) + (set! (-> v1-46 params volume) -4) + (set! (-> v1-46 auto-time) 24) + (set! (-> v1-46 auto-from) 2) + (set! (-> v1-46 params mask) (the-as uint 17)) + (-> v1-46 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + (if (and (-> self sound-close-stop) (not arg0) (-> self visible-move?)) + (sound-play-by-spec (-> self sound-close-stop) (new-sound-id) (the-as vector #t)) + ) + (while (not (ja-min? 0)) + (if (and (zero? (-> self sound-id)) + (-> self sound-post-close) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (set! (-> self sound-id) (sound-play-by-spec (-> self sound-post-close) (new-sound-id) (the-as vector #t))) + ) + (rotate-gear! self 65536.0) + (suspend) + (ja :num! (seek! 0.0)) + (transform-post) + ) + (when (nonzero? (-> self sound-id)) + (let ((v1-71 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-71 command) (sound-command set-param)) + (set! (-> v1-71 id) (-> self sound-id)) + (set! (-> v1-71 params volume) -4) + (set! (-> v1-71 auto-time) 24) + (set! (-> v1-71 auto-from) 2) + (set! (-> v1-71 params mask) (the-as uint 17)) + (-> v1-71 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + (if (-> self sound-post-close-stop) + (sound-play-by-spec (-> self sound-post-close-stop) (new-sound-id) (the-as vector #t)) + ) + ) + (when (< 0.0 (check-crossing-distance self (target-pos 0) #f)) + (let ((gp-3 (res-lump-struct (-> self entity) 'on-deactivate structure))) + (if (and gp-3 (not *scene-player*)) + (eval! (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) gp-3) + ) + ) + ) + (while (!= (-> self gear-rotv) 0.0) + (rotate-gear! self 0.0) + (suspend) + (transform-post) + ) + (when (nonzero? (-> self gear-sound-id)) + (let ((v1-91 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-91 command) (sound-command set-param)) + (set! (-> v1-91 id) (-> self gear-sound-id)) + (set! (-> v1-91 params volume) -4) + (set! (-> v1-91 auto-time) 24) + (set! (-> v1-91 auto-from) 2) + (set! (-> v1-91 params mask) (the-as uint 17)) + (-> v1-91 id) + ) + (set! (-> self gear-sound-id) (new 'static 'sound-id)) + 0 + ) + ) + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) :num! min) + (transform-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate open (com-airlock) + :virtual #t + :event (-> (method-of-type com-airlock close) event) + :enter (behavior ((arg0 symbol)) + (set! (-> self visible-move?) #f) + (none) + ) + :exit (-> (method-of-type com-airlock close) exit) + :trans (behavior () + (if (logtest? (-> self draw status) (draw-control-status on-screen)) + (set! (-> self visible-move?) #t) + ) + (if (not (want-cross-airlock? self)) + (go-virtual close #f) + ) + (when (logtest? (-> self mask) (process-mask sleep-code)) + (let ((v1-14 (destination-loaded? self 'display))) + (when (or (not v1-14) (= v1-14 'unknown)) + (if (and (not v1-14) (< (-> self open-frame) (ja-aframe-num 0))) + (ja :num-func num-func-identity :frame-num (ja-aframe (-> self open-frame) 0)) + ) + (go-virtual close #f) + ) + ) + ) + (none) + ) + :code (behavior ((arg0 symbol)) + (when (not arg0) + (when (< (check-crossing-distance self (target-pos 0) #f) 0.0) + (if (< (ja-aframe-num 0) (-> self pre-open-frame)) + (ja :num-func num-func-identity :frame-num (ja-aframe (-> self pre-open-frame) 0)) + ) + ) + (while (< (ja-aframe-num 0) (-> self lock-frame)) + (if (and (zero? (-> self sound-id)) + (-> self sound-pre-open) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (set! (-> self sound-id) (sound-play-by-spec (-> self sound-pre-open) (new-sound-id) (the-as vector #t))) + ) + (rotate-gear! self 65536.0) + (suspend) + (ja :num! (seek! (ja-aframe (-> self lock-frame) 0) (-> self pre-open-speed))) + (transform-post) + ) + (when (nonzero? (-> self sound-id)) + (let ((v1-26 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-26 command) (sound-command set-param)) + (set! (-> v1-26 id) (-> self sound-id)) + (set! (-> v1-26 params volume) -4) + (set! (-> v1-26 auto-time) 24) + (set! (-> v1-26 auto-from) 2) + (set! (-> v1-26 params mask) (the-as uint 17)) + (-> v1-26 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + (if (-> self sound-pre-open-stop) + (sound-play-by-spec (-> self sound-pre-open-stop) (new-sound-id) (the-as vector #t)) + ) + ) + (while (< (ja-aframe-num 0) (-> self open-frame)) + (if (and (zero? (-> self sound-id)) + (-> self sound-lock-loop) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (set! (-> self sound-id) (sound-play-by-spec (-> self sound-lock-loop) (new-sound-id) (the-as vector #t))) + ) + (rotate-gear! self 65536.0) + (suspend) + (ja :num! (seek! (ja-aframe (-> self open-frame) 0) 2.0)) + (transform-post) + ) + (when (nonzero? (-> self sound-id)) + (let ((v1-49 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-49 command) (sound-command set-param)) + (set! (-> v1-49 id) (-> self sound-id)) + (set! (-> v1-49 params volume) -4) + (set! (-> v1-49 auto-time) 24) + (set! (-> v1-49 auto-from) 2) + (set! (-> v1-49 params mask) (the-as uint 17)) + (-> v1-49 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + (if (-> self sound-lock-stop) + (sound-play-by-spec (-> self sound-lock-stop) (new-sound-id) (the-as vector #t)) + ) + ) + (while (not (destination-loaded? self #t)) + (rotate-gear! self 65536.0) + (suspend) + (transform-post) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((s5-10 (res-lump-struct (-> self entity) 'on-enter structure))) + (if s5-10 + (eval! (new 'stack 'script-context (the-as basic (process->ppointer self)) self (the-as vector #f)) s5-10) + ) + ) + (if (and (-> self sound-open) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (sound-play-by-spec (-> self sound-open) (new-sound-id) (the-as vector #t)) + ) + (if (and (-> self sound-open-loop) + (and (or (-> self sound-behind?) (>= (check-crossing-distance self (target-pos 0) #f) 0.0)) + (not arg0) + (-> self visible-move?) + ) + ) + (set! (-> self sound-id) (sound-play-by-spec (-> self sound-open-loop) (new-sound-id) (the-as vector #t))) + ) + (set! (-> *ACTOR-bank* birth-max) 1000) + (while (not (ja-max? 0)) + (rotate-gear! self 65536.0) + (suspend) + (ja :num! (seek!)) + (transform-post) + ) + (when (nonzero? (-> self sound-id)) + (let ((v1-94 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-94 command) (sound-command set-param)) + (set! (-> v1-94 id) (-> self sound-id)) + (set! (-> v1-94 params volume) -4) + (set! (-> v1-94 auto-time) 24) + (set! (-> v1-94 auto-from) 2) + (set! (-> v1-94 params mask) (the-as uint 17)) + (-> v1-94 id) + ) + (set! (-> self sound-id) (new 'static 'sound-id)) + 0 + ) + (when (nonzero? (-> self gear-sound-id)) + (let ((v1-99 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-99 command) (sound-command set-param)) + (set! (-> v1-99 id) (-> self gear-sound-id)) + (set! (-> v1-99 params volume) -4) + (set! (-> v1-99 auto-time) 24) + (set! (-> v1-99 auto-from) 2) + (set! (-> v1-99 params mask) (the-as uint 17)) + (-> v1-99 id) + ) + (set! (-> self gear-sound-id) (new 'static 'sound-id)) + 0 + ) + (if (and (-> self sound-open-stop) (not arg0) (-> self visible-move?)) + (sound-play-by-spec (-> self sound-open-stop) (new-sound-id) (the-as vector #t)) + ) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (ja :group! (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) + :num! (identity + (the float (+ (-> (get-art-by-name (-> self draw art-group) "idle" art-joint-anim) frames num-frames) -1)) + ) + ) + (transform-post) + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) + ) + +;; definition of type com-airlock-outer +(deftype com-airlock-outer (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type com-airlock-outer +(defmethod inspect com-airlock-outer ((obj com-airlock-outer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type com-airlock-outer +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! com-airlock-outer ((obj com-airlock-outer) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 20480.0 0.0 57344.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 20480.0 0.0 32768.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 7) + (set-vector! (-> v1-10 local-sphere) 0.0 20480.0 0.0 32768.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (init-airlock! obj) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-com-airlock-outer" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (set! (-> obj pre-open-frame) 35.0) + (set! (-> obj lock-frame) 45.0) + (set! (-> obj open-frame) 45.0) + (set! (-> obj sound-pre-open) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-slider") + :volume #x400 + ) + ) + (set! (-> obj sound-pre-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-slide-e") + :volume #x400 + ) + ) + (set! (-> obj sound-open) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-seal") + :volume #x400 + ) + ) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-open") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-post-close) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-slider") + :volume #x400 + ) + ) + (set! (-> obj sound-post-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-slide-e") + :volume #x400 + ) + ) + (go (method-of-object obj close) #t) + (none) + ) + +;; definition of type com-airlock-inner +(deftype com-airlock-inner (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type com-airlock-inner +(defmethod inspect com-airlock-inner ((obj com-airlock-inner)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type com-airlock-inner +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! com-airlock-inner ((obj com-airlock-inner) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 20480.0 0.0 57344.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 20480.0 0.0 32768.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 8) + (set-vector! (-> v1-10 local-sphere) 0.0 20480.0 0.0 32768.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-com-airlock-inner" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj lock-frame) 37.0) + (set! (-> obj pre-open-frame) 65.0) + (set! (-> obj open-frame) 75.0) + (set! (-> obj gear) (new 'process 'joint-mod (joint-mod-mode rotate) obj 12)) + (set! (-> obj inner?) + (logtest? (the-as int (res-lump-value (-> obj entity) 'options uint128 :default (the-as uint128 1) :time -1000000000.0)) + 1 + ) + ) + (set! (-> obj pre-open-speed) 0.9) + (set! (-> obj sound-gear) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-gear") + :volume #x400 + ) + ) + (set! (-> obj sound-pre-open) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-slider") + :volume #x400 + ) + ) + (set! (-> obj sound-pre-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-slide-e") + :volume #x400 + ) + ) + (set! (-> obj sound-lock-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-turn") + :volume #x400 + ) + ) + (set! (-> obj sound-lock-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-unlock") + :volume #x400 + ) + ) + (set! (-> obj sound-open) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-seal") + :volume #x400 + ) + ) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-open") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "airlock-hit") + :volume #x400 + ) + ) + (go (method-of-object obj close) #t) + (none) + ) + +;; failed to figure out what this is: +(let ((a0-20 (new 'static 'skeleton-group + :name "skel-fort-entry-gate" + :extra #f + :info #f + :art-group-name "fort-entry-gate" + :bounds (new 'static 'vector :y 12288.0 :w 40960.0) + :version #x7 + ) + ) + ) + (set! (-> a0-20 jgeo) 0) + (set! (-> a0-20 janim) 2) + (set! (-> a0-20 mgeo 0) 1) + (set! (-> a0-20 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-20) + ) + +;; definition of type fort-entry-gate +(deftype fort-entry-gate (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type fort-entry-gate +(defmethod inspect fort-entry-gate ((obj fort-entry-gate)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type fort-entry-gate +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! fort-entry-gate ((obj fort-entry-gate) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 40960.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 8192.0 16384.0 0.0 20480.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) -8192.0 16384.0 0.0 20480.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-entry-gate" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "door-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "door-stop-open") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "door-close") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "door-stop-close") + :volume #x400 + ) + ) + (go (method-of-object obj close) #t) + (none) + ) + +;; failed to figure out what this is: +(let ((a0-24 (new 'static 'skeleton-group + :name "skel-hip-door-a" + :extra #f + :info #f + :art-group-name "hip-door-a" + :bounds (new 'static 'vector :y 8192.0 :w 20480.0) + :version #x7 + ) + ) + ) + (set! (-> a0-24 jgeo) 0) + (set! (-> a0-24 janim) 2) + (set! (-> a0-24 mgeo 0) 1) + (set! (-> a0-24 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-24) + ) + +;; definition of type hip-door-a +(deftype hip-door-a (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type hip-door-a +(defmethod inspect hip-door-a ((obj hip-door-a)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type hip-door-a +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! hip-door-a ((obj hip-door-a) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-door-a" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-open-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-close") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-close-hit") + :volume #x400 + ) + ) + (set! (-> obj door-radius) 8192.0) + (go (method-of-object obj close) #t) + (none) + ) + +;; failed to figure out what this is: +(let ((a0-28 (new 'static 'skeleton-group + :name "skel-tomb-mar-door" + :extra #f + :info #f + :art-group-name "tomb-mar-door" + :bounds (new 'static 'vector :y 24576.0 :w 73728.0) + :version #x7 + :origin-joint-index 3 + ) + ) + ) + (set! (-> a0-28 jgeo) 0) + (set! (-> a0-28 janim) 2) + (set! (-> a0-28 mgeo 0) 1) + (set! (-> a0-28 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-28) + ) + +;; definition of type tomb-mar-door +(deftype tomb-mar-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type tomb-mar-door +(defmethod inspect tomb-mar-door ((obj tomb-mar-door)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type tomb-mar-door +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! tomb-mar-door ((obj tomb-mar-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 24576.0 0.0 73728.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-mar-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wing-door-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wing-open-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wing-door-close") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wing-close-hit") + :volume #x400 + ) + ) + (go (method-of-object obj close) #t) + (none) + ) + +;; definition of type cas-front-door +(deftype cas-front-door (com-airlock-outer) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type cas-front-door +(defmethod inspect cas-front-door ((obj cas-front-door)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock-outer inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(let ((a0-34 (new 'static 'skeleton-group + :name "skel-pal-throne-door" + :extra #f + :info #f + :art-group-name "pal-throne-door" + :bounds (new 'static 'vector :y 24576.0 :w 98304.0) + :version #x7 + :origin-joint-index 3 + ) + ) + ) + (set! (-> a0-34 jgeo) 0) + (set! (-> a0-34 janim) 2) + (set! (-> a0-34 mgeo 0) 1) + (set! (-> a0-34 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-34) + ) + +;; definition of type pal-throne-door +(deftype pal-throne-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type pal-throne-door +(defmethod inspect pal-throne-door ((obj pal-throne-door)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type pal-throne-door +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! pal-throne-door ((obj pal-throne-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 24576.0 0.0 73728.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 5) + (set-vector! (-> v1-8 local-sphere) 0.0 -24576.0 0.0 65536.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 4) + (set-vector! (-> v1-10 local-sphere) 0.0 -24576.0 0.0 65536.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-throne-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-slide") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-slide") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-behind?) #t) + (go (method-of-object obj close) #t) + (none) + ) + +;; failed to figure out what this is: +(let ((a0-38 (new 'static 'skeleton-group + :name "skel-vin-door-ctyinda" + :extra #f + :info #f + :art-group-name "vin-door-ctyinda" + :bounds (new 'static 'vector :y 12288.0 :w 24576.0) + :version #x7 + ) + ) + ) + (set! (-> a0-38 jgeo) 0) + (set! (-> a0-38 janim) 2) + (set! (-> a0-38 mgeo 0) 1) + (set! (-> a0-38 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-38) + ) + +;; definition of type vin-door-ctyinda +(deftype vin-door-ctyinda (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type vin-door-ctyinda +(defmethod inspect vin-door-ctyinda ((obj vin-door-ctyinda)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type vin-door-ctyinda +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! vin-door-ctyinda ((obj vin-door-ctyinda) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 12288.0 0.0 24576.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 8192.0 16384.0 0.0 20480.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) -8192.0 16384.0 0.0 20480.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-vin-door-ctyinda" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-open-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-close") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-close-hit") + :volume #x400 + ) + ) + (set! (-> obj door-radius) 8192.0) + (go (method-of-object obj close) #t) + (none) + ) + +;; failed to figure out what this is: +(let ((a0-42 (new 'static 'skeleton-group + :name "skel-under-door" + :extra #f + :info #f + :art-group-name "hip-door-a" + :bounds (new 'static 'vector :y 8192.0 :w 20480.0) + :version #x7 + ) + ) + ) + (set! (-> a0-42 jgeo) 0) + (set! (-> a0-42 janim) 2) + (set! (-> a0-42 mgeo 0) 1) + (set! (-> a0-42 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-42) + ) + +;; definition of type under-door +(deftype under-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type under-door +(defmethod inspect under-door ((obj under-door)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type under-door +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! under-door ((obj under-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-under-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-open-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-close") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-close-hit") + :volume #x400 + ) + ) + (set! (-> obj door-radius) 8192.0) + (go (method-of-object obj close) #t) + (none) + ) + +;; failed to figure out what this is: +(let ((a0-46 (new 'static 'skeleton-group + :name "skel-oracle-door" + :extra #f + :info #f + :art-group-name "oracle-door" + :bounds (new 'static 'vector :y 16384.0 :w 40960.0) + :version #x7 + ) + ) + ) + (set! (-> a0-46 jgeo) 0) + (set! (-> a0-46 janim) 2) + (set! (-> a0-46 mgeo 0) 1) + (set! (-> a0-46 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-46) + ) + +;; definition of type oracle-door +(deftype oracle-door (com-airlock) + () + :heap-base #x100 + :method-count-assert 28 + :size-assert #x174 + :flag-assert #x1c01000174 + ) + +;; definition for method 3 of type oracle-door +(defmethod inspect oracle-door ((obj oracle-door)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type com-airlock inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition for method 11 of type oracle-door +;; WARN: Return type mismatch object vs none. +(defmethod init-from-entity! oracle-door ((obj oracle-door) (arg0 entity-actor)) + (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 4) + (set-vector! (-> v1-8 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 5) + (set-vector! (-> v1-10 local-sphere) 0.0 8192.0 0.0 16384.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-13 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s5-0 backup-collde-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> obj root-override) s5-0) + ) + (initialize-skeleton + obj + (the-as skeleton-group (art-group-get-by-name *level* "skel-oracle-door" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (init-airlock! obj) + (set! (-> obj sound-open-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-open") + :volume #x400 + ) + ) + (set! (-> obj sound-open-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-open-hit") + :volume #x400 + ) + ) + (set! (-> obj sound-close-loop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-door-close") + :volume #x400 + ) + ) + (set! (-> obj sound-close-stop) (new 'static 'sound-spec + :num 1.0 + :group (sound-group sfx) + :sound-name (static-sound-name "wood-close-hit") + :volume #x400 + ) + ) + (go (method-of-object obj close) #t) + (none) + ) diff --git a/test/goalc/test_type_consistency.cpp b/test/goalc/test_type_consistency.cpp index 175de4decc..3d4a17ff31 100644 --- a/test/goalc/test_type_consistency.cpp +++ b/test/goalc/test_type_consistency.cpp @@ -40,3 +40,11 @@ TEST(Jak2TypeConsistency, TypeConsistency) { compiler.run_test_no_load("decompiler/config/jak2/all-types.gc"); compiler.run_test_no_load("test/goalc/source_templates/with_game/test-build-all-code.gc"); } + +TEST(Jak2TypeConsistency, MANUAL_TEST_TypeConsistencyWithBuildFirst) { + Compiler compiler(GameVersion::Jak2); + compiler.enable_throw_on_redefines(); + add_common_expected_type_mismatches(compiler); + compiler.run_test_no_load("test/goalc/source_templates/with_game/test-build-all-code.gc"); + compiler.run_test_no_load("decompiler/config/jak2/all-types.gc"); +} diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index f81cc95082..f0a41c1a89 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -1,7 +1,8 @@ { "dgos": [ "CGO/KERNEL.CGO", - "CGO/ENGINE.CGO" + "CGO/ENGINE.CGO", + "CGO/COMMON.CGO" ], "skip_compile_files": [], @@ -106,10 +107,10 @@ "sparticle-motion-blur", // clipping "birth-func-texture-group", "(method 10 sparticle-launcher)", // very strange handling of ambiguous type - // placeholder - // gun-util "draw-beam", "(method 9 gun-info)", + // mood + "update-mood-direction", // power of two case "i-hopefully-will-never-exist-dont-add-anything-after-me-please" ],