diff --git a/.gitignore b/.gitignore index 686a0a9a97..18641cbe36 100644 --- a/.gitignore +++ b/.gitignore @@ -24,8 +24,9 @@ linux-default/ *.log *.p2s savestate-out/ +savestate_out/ failures/ -ee-results.json +ee-results*.json .env # graphics debug diff --git a/.vs/launch.vs.json b/.vs/launch.vs.json index 37fef37d82..afe5cd74ae 100644 --- a/.vs/launch.vs.json +++ b/.vs/launch.vs.json @@ -30,6 +30,13 @@ "name": "Tests - TypeConsistency - Verbose", "args": ["--gtest_brief=0", "--gtest_filter=\"*TypeConsistency*\""] }, + { + "type": "default", + "project": "CMakeLists.txt", + "projectTarget": "goalc-test.exe (bin\\goalc-test.exe)", + "name": "Tests - TypeConsistency - Jak 2 - Verbose", + "args": ["--gtest_brief=0", "--gtest_filter=\"*Jak2TypeConsistency*\""] + }, { "type": "default", "project": "CMakeLists.txt", diff --git a/Taskfile.yml b/Taskfile.yml index 2d0d4b4faf..ba25f23205 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -74,6 +74,8 @@ tasks: # npm install -g prettier - cmd: npx prettier --write ./decompiler/config/jak1_ntsc_black_label/*.jsonc ignore_error: true + - cmd: npx prettier --write ./decompiler/config/jak2/*.jsonc + ignore_error: true run-game-headless: cmds: - "{{.GK_BIN_RELEASE_DIR}}/gk -fakeiso -debug -nodisplay" @@ -86,14 +88,15 @@ tasks: - rm ./decompiler_out/**/*.asm - rm ./decompiler_out/**/*disasm.gc # TOOLS - # analyze-ee-memory: - # cmds: - # - '{{.MEMDUMP_BIN_RELEASE_DIR}}/memory_dump_tool "{{.FILE}}" ./ > ee-analysis.log' - # watch-pcsx2: - # cmds: - # - watchmedo shell-command --drop --patterns="*.p2s" --recursive --command='task analyze-ee-memory FILE="${watch_src_path}"' "{{.SAVESTATE_DIR}}" - # vars: - # SAVESTATE_DIR: '{{default "." .SAVESTATE_DIR}}' + analyze-ee-memory: + cmds: + - python ./scripts/tasks/extract-zip.py --file "{{.FILE}}" --out ./savestate_out/ + - '{{.MEMDUMP_BIN_RELEASE_DIR}}/memory_dump_tool ./savestate_out/eeMemory.bin --output-path ./ --game {{.GAME}} > ee-analysis.log' + watch-pcsx2: + cmds: + - watchmedo shell-command --drop --patterns="*.p2s" --recursive --command='task analyze-ee-memory FILE="${watch_src_path}"' "{{.SAVESTATE_DIR}}" + vars: + SAVESTATE_DIR: '{{default "." .SAVESTATE_DIR}}' # TESTS offline-tests: cmds: diff --git a/common/type_system/deftype.cpp b/common/type_system/deftype.cpp index 38ebc6e36b..b5f8cea431 100644 --- a/common/type_system/deftype.cpp +++ b/common/type_system/deftype.cpp @@ -408,9 +408,9 @@ StructureDefResult parse_structure_def( } if (size_assert != -1 && flags.size != u16(size_assert)) { - throw std::runtime_error("Type " + type->get_name() + " came out to size " + - std::to_string(int(flags.size)) + " but size-assert was set to " + - std::to_string(size_assert)); + throw std::runtime_error( + fmt::format("Type {} came out to size {}[{:#x}] but size-assert was set to {}", + type->get_name(), int(flags.size), int(flags.size), size_assert)); } flags.methods = ts->get_next_method_id(type); @@ -497,9 +497,9 @@ BitFieldTypeDefResult parse_bitfield_type_def(BitFieldType* type, } if (size_assert != -1 && flags.size != u16(size_assert)) { - throw std::runtime_error("Type " + type->get_name() + " came out to size " + - std::to_string(int(flags.size)) + " but size-assert was set to " + - std::to_string(size_assert)); + throw std::runtime_error( + fmt::format("Type {} came out to size {}[{:#x}] but size-assert was set to {}", + type->get_name(), int(flags.size), int(flags.size), size_assert)); } flags.methods = ts->get_next_method_id(type); diff --git a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp index 70563bbec8..50ff4c7cf8 100644 --- a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp +++ b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp @@ -565,7 +565,7 @@ void ObjectFileDB::ir2_type_analysis_pass(int seg, const Config& config, ObjectF } } else { lg::warn("Function {} didn't know its type", func.name()); - func.warnings.warning("Function {} has unknown type", func.name()); + func.warnings.error("Function {} has unknown type", func.name()); } } }); diff --git a/decompiler/config/jak1_ntsc_black_label/import_deps.jsonc b/decompiler/config/jak1_ntsc_black_label/import_deps.jsonc index 1a7b7a5156..4db8d0e6cf 100644 --- a/decompiler/config/jak1_ntsc_black_label/import_deps.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/import_deps.jsonc @@ -152,7 +152,10 @@ "snow-bumper": ["goal_src/jak1/import/snow-bumper-ag.gc"], "darkcave-obs": ["goal_src/jak1/import/cavecrystal-ag.gc"], "junglesnake": ["goal_src/jak1/import/junglesnake-ag.gc"], - "evilbro": ["goal_src/jak1/import/evilbro-ag.gc", "goal_src/jak1/import/evilsis-ag.gc"], + "evilbro": [ + "goal_src/jak1/import/evilbro-ag.gc", + "goal_src/jak1/import/evilsis-ag.gc" + ], "bully": ["goal_src/jak1/import/bully-ag.gc"], "square-platform": ["goal_src/jak1/import/square-platform-ag.gc"], "dark-crystal": ["goal_src/jak1/import/dark-crystal-ag.gc"], @@ -161,7 +164,10 @@ "goal_src/jak1/import/sage-village3-ag.gc", "goal_src/jak1/import/evilbro-village3-ag.gc" ], - "yakow": ["goal_src/jak1/import/village1cam-ag.gc", "goal_src/jak1/import/yakow-ag.gc"], + "yakow": [ + "goal_src/jak1/import/village1cam-ag.gc", + "goal_src/jak1/import/yakow-ag.gc" + ], "plat-button": ["goal_src/jak1/import/plat-button-ag.gc"], "hud-classes": ["goal_src/jak1/import/fuelcell-naked-ag.gc"], "misty-obs": [ diff --git a/decompiler/config/jak1_ntsc_black_label/inputs.jsonc b/decompiler/config/jak1_ntsc_black_label/inputs.jsonc index 980908810c..fb67422669 100644 --- a/decompiler/config/jak1_ntsc_black_label/inputs.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/inputs.jsonc @@ -47,7 +47,8 @@ ], // some objects are part of STR files (streaming data). In Jak 1 this is just animations - "str_file_names": [/* + "str_file_names": [ + /* "STR/BAFCELL.STR", "STR/SWTE4.STR", "STR/SWTE3.STR", @@ -245,7 +246,8 @@ "STR/GRSOPREB.STR", "STR/GRSOBBB.STR", "STR/SA3INTRO.STR" - */], + */ + ], // some objects are directly stored as files on the DVD. This is just text files. "object_file_names": [ diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index a5690714dd..7a3d7a31ad 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -1067,7 +1067,7 @@ ) (deftype vector4 (structure) - ((data float 4 :offset-assert 0) + ((data float 4 :offset-assert 0 :score -1) (x float :offset 0) (y float :offset 4) (z float :offset 8) @@ -4441,7 +4441,7 @@ (define-extern vector4-array-scale! (function (inline-array vector4) (inline-array vector4) float int none)) (define-extern vector4-array-madd! (function (inline-array vector4) (inline-array vector4) (inline-array vector4) float int none)) (define-extern vector4-array-msub! (function (inline-array vector4) (inline-array vector4) (inline-array vector4) float int none)) -(define-extern vector4-array-lerp! (function (inline-array vector4) (inline-array vector4) (inline-array vector4) float int none)) +(define-extern vector4-array-lerp! (function (inline-array vector4) (inline-array vector4) (inline-array vector4) float int symbol)) (define-extern spheres-overlap? (function sphere sphere symbol)) (define-extern sphere<-vector! (function sphere vector sphere)) (define-extern sphere<-vector+r! (function sphere vector float sphere)) @@ -5198,7 +5198,7 @@ (deftype mood-channel (structure) ((data float 24 :offset-assert 0) - (vecs vector4 6 :inline :offset 0) + (vecs vector4 6 :inline :offset 0 :score 999) ) :method-count-assert 9 :size-assert #x60 @@ -5364,7 +5364,7 @@ (deftype mood-context (mood-context-core3) ((itimes vector4w 4 :inline :offset-assert 1776) - (state uint32 32 :offset-assert 1840) + (state uint32 32 :offset-assert 1840) ;; arbitrary data - can be floats | symbols ) :method-count-assert 9 :size-assert #x7b0 @@ -5405,31 +5405,52 @@ (lightning-time int32 :offset-assert 128) (lightning-time2 float :offset-assert 132) (lightning-flash float :offset-assert 136) - (lightning-id uint32 :offset-assert 140) + (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 9 :offset-assert 164) ;; these 4 are guesses - (colors mood-color 3 :offset-assert 200) - (channels mood-channel 3 :offset-assert 212) + (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) ) :method-count-assert 19 :size-assert #x104 :flag-assert #x1300000104 (:methods - (mood-control-method-9 () none 9) - (mood-control-method-10 () none 10) - (mood-control-method-11 () none 11) - (mood-control-method-12 () none 12) - (mood-control-method-13 () none 13) - (mood-control-method-14 () none 14) - (mood-control-method-15 () none 15) - (mood-control-method-16 () none 16) - (mood-control-method-17 () none 17) - (mood-control-method-18 () none 18) + (init-weather! + ;; TODO - local-vars mess up docstring placement + ;; "A bunch of setup around moods and weather depending on a variety of conditions" + (_type_) none :behavior process 9) + (update-mood-weather! + "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]]" + (_type_ float float float float) none 10) + (update-mood-range! + "Set the minimum and maximum ranges of clouds and fog + See [[mood-range]]" + (_type_ float float float float) none 11) + (set-time-for-random-weather! + "Set the `time-until-random`'s cloud and fog values + See [[mood-weather]]" + (_type_ float float) none 12) + (apply-mood-clouds-and-fog (_type_ mood-control-work) none 13) + (apply-mood-color (_type_ mood-control-work) none 14) + (apply-mood-channels (_type_ mood-control-work) none 15) + (adjust-num-clouds! (_type_ mood-control-work) none 16) + (gen-lightning-and-thunder! + ;; TODO - docstrings with behaviors! + ;; "Generates the lightning and thunder to play, kicks off the associated sounds" + (_type_) number 17) + (play-or-stop-lightning! + "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`" + (_type_ sound-spec vector) sound-id 18) ) ) @@ -5761,6 +5782,10 @@ (level4 level :inline :offset 21184) (level5 level :inline :offset 26416) (default-level level :inline :offset 31648) + + (unknown-inline-vec-01 (inline-array vector) :offset 32064) + (unknown-inline-vec-02 (inline-array vector) :offset 33712) + (pad2 uint8 4) ) :method-count-assert 31 @@ -9540,7 +9565,6 @@ :flag-assert #x900000014 ) - (deftype time-of-day-context (basic) ((interp float 6 :offset-assert 4) ;; guessed by decompiler (current-fog mood-fog :inline :offset-assert 32) @@ -9560,7 +9584,7 @@ (sky symbol :offset-assert 2060) ;; guessed by decompiler (use-camera-other basic :offset-assert 2064) (title-updated symbol :offset-assert 2068) ;; guessed by decompiler - (mode uint32 :offset-assert 2072) + (mode uint32 :offset-assert 2072) ;; TODO - bitfield? (overide-enable basic :offset-assert 2076) (overide-palette uint32 :offset-assert 2080) (max-rain float :offset-assert 2084) @@ -16110,7 +16134,7 @@ ; (boxes box8s-array :offset-assert 148) ; (current-bsp-back-flags uint32 :offset-assert 152) (unk-byte uint8 :offset 152) - ; (ambients drawable-inline-array-ambient :offset-assert 156) ;; now just #t? + (ambients symbol :offset-assert 156) ;; now just #t? (unk-data-4 float :offset 160) (unk-data-5 float :offset-assert 164) ; (adgifs adgif-shader-array :offset-assert 168) @@ -17910,8 +17934,8 @@ :size-assert #x10 :flag-assert #xb00000010 (:methods - (sparticle-launcher-method-9 () none 9) - (sparticle-launcher-method-10 () none 10) + (sparticle-launcher-method-9 (_type_ int) uint 9) + (sparticle-launcher-method-10 (_type_) none 10) ) ) @@ -20523,7 +20547,7 @@ |# ;; (define-extern *sound-loop-engine* object) -;; (define-extern *sound-player-rpc* object) ;; rpc-buffer-pair +(define-extern *sound-player-rpc* rpc-buffer-pair) ;; (define-extern *sound-loader-rpc* object) ;; rpc-buffer-pair ;; (define-extern sound-name= function) ;; (function sound-name sound-name symbol) ;; (define-extern *sound-iop-info* object) ;; sound-iop-info @@ -20547,9 +20571,9 @@ ;; (define-extern list-sounds function) ;; (function int) ;; (define-extern sound-command->string function) ;; (function sound-command string) ;; (define-extern sound-buffer-dump function) ;; (function int) -;; (define-extern *sound-player-enable* object) ;; symbol +(define-extern *sound-player-enable* symbol) (define-extern swap-sound-buffers (function vector vector float int)) -;; (define-extern get-sound-buffer-entry function) ;; (function pointer) +(define-extern get-sound-buffer-entry (function pointer)) ;; (define-extern free-last-sound-buffer-entry function) ;; (function int) ;; (define-extern sound-basic-cb function) ;; (function int (pointer int32) none) ;; (define-extern sound-trans-convert function) ;; (function vector3w vector int) @@ -20558,10 +20582,10 @@ ;; (define-extern sound-set-volume function) ;; (function sound-group float int) ;; (define-extern sound-set-reverb function) ;; (function int float float uint int) ;; (define-extern sound-set-ear-trans function) ;; (function vector vector float int) -;; (define-extern sound-play-by-name function) ;; (function sound-name sound-id int int int sound-group symbol sound-id) +(define-extern sound-play-by-name (function sound-name sound-id int int int sound-group symbol sound-id)) (define-extern sound-play-by-spec (function sound-spec sound-id vector sound-id)) ;; (define-extern sound-pause function) ;; (function sound-id int) -;; (define-extern sound-stop function) ;; (function sound-id int) +(define-extern sound-stop "Stops a sound identified by the given id" (function sound-id int)) ;; (define-extern sound-continue function) ;; (function sound-id int) (define-extern sound-group-pause (function sound-group int)) ;; (define-extern sound-group-stop function) ;; (function sound-group int) @@ -22352,7 +22376,7 @@ ) |# -;; (define-extern *part-id-table* object) ;; (array sparticle-launcher) +(define-extern *part-id-table* (array sparticle-launcher)) ;; (define-extern *part-group-id-table* object) ;; (array sparticle-launch-group) ;; (define-extern *sp-temp* object) ;; (define-extern lookup-part-group-by-name function) ;; (function string basic) @@ -22662,80 +22686,85 @@ ;; mood-tables ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *no-cloud-haze-mood-fog-table* object) -;; (define-extern *no-cloud-clear-mood-fog-table* object) -;; (define-extern *no-cloud-smog-mood-fog-table* object) -;; (define-extern *overcast-fog-mood-fog-table* object) -;; (define-extern *overcast-clear-mood-fog-table* object) -;; (define-extern *overcast-rain-mood-fog-table* object) -;; (define-extern *storm-fog-mood-fog-table* object) -;; (define-extern *storm-clear-mood-fog-table* object) -;; (define-extern *storm-rain-mood-fog-table* object) -;; (define-extern *no-cloud-mood-color-table* object) -;; (define-extern *overcast-mood-color-table* object) -;; (define-extern *storm-mood-color-table* object) -;; (define-extern *no-cloud-mood-channel-group* object) -;; (define-extern *overcast-mood-channel-group* object) -;; (define-extern *stormy-mood-channel-group* object) -;; (define-extern *clouds-000* object) -;; (define-extern *clouds-125* object) -;; (define-extern *clouds-250* object) -;; (define-extern *clouds-375* object) -;; (define-extern *clouds-500* object) -;; (define-extern *clouds-625* object) -;; (define-extern *clouds-750* object) -;; (define-extern *clouds-875* object) -;; (define-extern *clouds-1000* object) -;; (define-extern *drill-mood-fog-table* object) -;; (define-extern *drill-mood-color-table* object) -;; (define-extern *drill-mood-direction-table* object) -;; (define-extern *mood-direction-table* object) -;; (define-extern *mood-sky-table* object) -;; (define-extern *mood-interp-table* object) -;; (define-extern init-mood-control function) +(define-extern *no-cloud-haze-mood-fog-table* mood-fog-table) +(define-extern *no-cloud-clear-mood-fog-table* mood-fog-table) +(define-extern *no-cloud-smog-mood-fog-table* mood-fog-table) +(define-extern *overcast-fog-mood-fog-table* mood-fog-table) +(define-extern *overcast-clear-mood-fog-table* mood-fog-table) +(define-extern *overcast-rain-mood-fog-table* mood-fog-table) +(define-extern *storm-fog-mood-fog-table* mood-fog-table) +(define-extern *storm-clear-mood-fog-table* mood-fog-table) +(define-extern *storm-rain-mood-fog-table* mood-fog-table) +(define-extern *no-cloud-mood-color-table* mood-color-table) +(define-extern *overcast-mood-color-table* mood-color-table) +(define-extern *storm-mood-color-table* mood-color-table) +(define-extern *no-cloud-mood-channel-group* mood-channel-group) +(define-extern *overcast-mood-channel-group* mood-channel-group) +(define-extern *stormy-mood-channel-group* mood-channel-group) +(define-extern *clouds-000* mood-clouds) +(define-extern *clouds-125* mood-clouds) +(define-extern *clouds-250* mood-clouds) +(define-extern *clouds-375* mood-clouds) +(define-extern *clouds-500* mood-clouds) +(define-extern *clouds-625* mood-clouds) +(define-extern *clouds-750* mood-clouds) +(define-extern *clouds-875* mood-clouds) +(define-extern *clouds-1000* mood-clouds) +(define-extern *drill-mood-fog-table* mood-fog-table) +(define-extern *drill-mood-color-table* mood-color-table) +(define-extern *drill-mood-direction-table* mood-direction-table) +(define-extern *mood-direction-table* mood-direction-table) +(define-extern *mood-sky-table* mood-sky-table) +(define-extern *mood-interp-table* sky-color-day) +(define-extern init-mood-control (function mood-control none)) (define-extern *mood-control* mood-control) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mood-tables2 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *overide-mood-color-table* object) -;; (define-extern *overide-mood-fog-table* object) -;; (define-extern init-overide-table function) -;; (define-extern *overide-table* mood-table) -;; (define-extern print-mood-tables function) -;; (define-extern desaturate-mood-colors function) -;; (define-extern desaturate-mood-fog function) +(define-extern *overide-mood-color-table* mood-color-table) +(define-extern *overide-mood-fog-table* mood-fog-table) +(define-extern init-overide-table (function mood-table none)) +(define-extern *overide-table* mood-table) +(define-extern print-mood-tables + "Print out the contents of the [[*overide-table*]]" + (function none)) +(define-extern desaturate-mood-colors + "Unused - Generate GOAL code for a new [[*overide-mood-color-table*]] definition that desaturates the color + Apply said overrides to the [[*overide-table*]]" + (function float float float none)) +(define-extern desaturate-mood-fog + "Unused - Generate GOAL code for a new [[*overide-mood-fog-table*]] definition that desaturates the fog color + Apply said overrides to the [[*overide-table*]]" + (function (pointer mood-fog-table) float float none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mood ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype flames-state (structure) ((time float :offset-assert 0) ;; uint8 (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 ) -|# -#| (deftype light-state (structure) ((time float :offset-assert 0) (fade float :offset-assert 4) ;; uint8 ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype lava-state (structure) ((lava float :offset-assert 0) ) @@ -22743,9 +22772,7 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype flicker-state (structure) ((flicker-off uint8 :offset-assert 0) (flicker-on uint8 :offset-assert 1) @@ -22754,9 +22781,7 @@ :size-assert #x2 :flag-assert #x900000002 ) -|# -#| (deftype florescent-state (structure) ((value float :offset-assert 0) (delay int8 :offset-assert 4) @@ -22766,30 +22791,26 @@ :size-assert #x6 :flag-assert #x900000006 ) -|# -#| (deftype electricity-state (structure) ((value float :offset-assert 0) (scale float :offset-assert 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype pulse-state (structure) ((pulse float :offset-assert 0) ) + :pack-me :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype strobe-state (structure) ((time float :offset-assert 0) ) @@ -22797,87 +22818,77 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -;; (define-extern palette-select-special function) -;; (define-extern clear-mood-times function) ;; (function mood-context symbol) -;; (define-extern update-mood-itimes function) ;; (function mood-context none) -;; (define-extern update-mood-direction function) -;; (define-extern update-mood-exterior function) -;; (define-extern copy-mood-exterior function) -;; (define-extern copy-mood-exterior-ambi function) +(define-extern palette-select-special "Use the `special` time-of-day mode palette" (function mood-context-core3 symbol)) +(define-extern clear-mood-times "Clear all of the mood times on the given context" (function mood-context symbol)) +(define-extern update-mood-itimes (function mood-context none)) +(define-extern update-mood-direction (function mood-context-core3 mood-table float float)) +(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 int none)) ;; (define-extern update-mood-interior function) -;; (define-extern update-mood-flames function) ;; (function mood-context int int int float float float none) -;; (define-extern *flash0* array) ;; (array float) -;; (define-extern *flash1* array) ;; (array float) -;; (define-extern *flash2* array) ;; (array float) -;; (define-extern *flash3* array) ;; (array float) -;; (define-extern *flash4* array) ;; (array float) -;; (define-extern *flash5* array) ;; (array float) -;; (define-extern *flash6* array) ;; (array float) -;; (define-extern *flash7* array) ;; (array float) -;; (define-extern update-mood-light function) ;; (function mood-context int int int float float float int none) +(define-extern update-mood-flames (function mood-context int int int float float float float :behavior process)) +(define-extern *flash0* (array float)) +(define-extern *flash1* (array float)) +(define-extern *flash2* (array float)) +(define-extern *flash3* (array float)) +(define-extern *flash4* (array float)) +(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) -;; (define-extern update-mood-pulse 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-caustics function) ;; (function mood-context int int none) +(define-extern update-mood-caustics (function mood-context int float float float float float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mood-funcs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype ruins-states (UNKNOWN) +(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 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 ) -|# -#| -(deftype strip-states (UNKNOWN) +(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 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 ) -|# -#| -(deftype ctywide-states (UNKNOWN) +(deftype ctywide-states (structure) ((light light-state :inline :offset-assert 0) (flame 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 ctyind-states (UNKNOWN) +(deftype ctyind-states (structure) ((light light-state :inline :offset-assert 0) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 ) -|# -#| -(deftype ctysluma-states (UNKNOWN) +(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) @@ -22885,131 +22896,109 @@ (spec-1 sp-field-init-spec :offset-assert 28) (neon-min-bright 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 ctyslumb-states (UNKNOWN) +(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 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 ) -|# -#| -(deftype ctyslumc-states (UNKNOWN) +(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 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 ) -|# -#| -(deftype ctyport-states (UNKNOWN) +(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 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 ) -|# -#| -(deftype ctymarka-states (UNKNOWN) +(deftype ctymarka-states (structure) ((light light-state :inline :offset-assert 0) (blink float :offset-assert 8) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c ) -|# -#| -(deftype ctymarkb-states (UNKNOWN) +(deftype ctymarkb-states (structure) ((light light-state :inline :offset-assert 0) (blink float :offset-assert 8) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c ) -|# -#| -(deftype palcab-states (UNKNOWN) +(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 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 ) -|# -#| -(deftype stadium-states (UNKNOWN) +(deftype stadium-states (structure) ((light light-state :inline :offset-assert 0) (flame 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 stadiumb-states (UNKNOWN) +(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 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 ) -|# -#| -(deftype skatea-states (UNKNOWN) +(deftype skatea-states (structure) ((light light-state :inline :offset-assert 0) (flame 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 ltentout-states (UNKNOWN) +(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 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x17 + :flag-assert #x900000017 ) -|# -#| -(deftype mountain-states (UNKNOWN) +(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) @@ -23020,235 +23009,209 @@ (spec-5 sp-field-init-spec :offset-assert 36) (spec-6 sp-field-init-spec :offset-assert 40) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c ) -|# -#| -(deftype forest-states (UNKNOWN) +(deftype forest-states (structure) ((light light-state :inline :offset-assert 0) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 ) -|# -#| -(deftype atoll-states (UNKNOWN) +(deftype atoll-states (structure) ((light light-state :inline :offset-assert 0) (explosion float :offset-assert 8) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c ) -|# -#| -(deftype drill-states (UNKNOWN) +(deftype drill-states (structure) ((fire-floor float :offset-assert 0) (fire-floor-fade float :offset-assert 4) (fire-floor-flag basic :offset-assert 8) (flame flames-state :inline :offset-assert 12) - (electricity UNKNOWN 2 :offset-assert 20) - (pulse pulse-state :inline :offset-assert 52) + (electricity electricity-state 2 :inline :offset-assert 20) ;; TODO - probably wrong, elec-wall? (but its an array....) + (pulse pulse-state :inline :offset 52) (light-flag basic :offset-assert 56) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x3c + :flag-assert #x90000003c ) -|# -#| -(deftype drillb-states (UNKNOWN) +(deftype drillb-states (structure) ((fire-floor float :offset-assert 0) (fire-floor-fade float :offset-assert 4) (fire-floor-flag basic :offset-assert 8) (pulse pulse-state :inline :offset-assert 12) (light-flag basic :offset-assert 16) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 ) -|# -#| -(deftype casboss-states (UNKNOWN) +(deftype casboss-states (structure) ((light light-state :inline :offset-assert 0) (explosion float :offset-assert 8) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c ) -|# -#| -(deftype caspad-states (UNKNOWN) +(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 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 ) -|# -#| -(deftype palout-states (UNKNOWN) +(deftype palout-states (structure) ((light light-state :inline :offset-assert 0) (flame 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 palroof-states (UNKNOWN) - ((electricity UNKNOWN 2 :offset-assert 0) +(deftype palroof-states (structure) + ((electricity vector 2 :inline :offset-assert 0) ;; TODO - probably wrong, elec-wall? (but its an array....) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 ) -|# -#| -(deftype palent-states (UNKNOWN) +(deftype palent-states (structure) ((flame flames-state :inline :offset-assert 0) (turret-value float :offset-assert 8) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c ) -|# -#| -(deftype nest-states (UNKNOWN) +(deftype nest-states (structure) ((light light-state :inline :offset-assert 0) (green-flag basic :offset-assert 8) (green float :offset-assert 12) (green-noise float :offset-assert 16) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 ) -|# -#| -(deftype village1-states (UNKNOWN) +(deftype village1-states (structure) ((interp float :offset-assert 0) (interp-flag basic :offset-assert 4) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 ) -|# -#| -(deftype consite-states (UNKNOWN) +(deftype consite-states (structure) ((light light-state :inline :offset-assert 0) (flash float :offset-assert 8) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c ) -|# -#| -(deftype mincan-states (UNKNOWN) - ((beams UNKNOWN 2 :offset-assert 0) +(deftype mincan-states (structure) + ((beams strobe-state 2 :offset-assert 0) ;; a guess! ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 ) -|# -;; (define-extern update-mood-default function) ;; (function mood-context float int none) -;; (define-extern get-sphere-interp function) -;; (define-extern init-mood-ruins function) -;; (define-extern update-mood-ruins function) -;; (define-extern init-mood-strip function) -;; (define-extern update-mood-strip function) -;; (define-extern update-mood-ctywide function) -;; (define-extern update-mood-copy-ctywide function) -;; (define-extern update-mood-ctyind function) -;; (define-extern init-mood-ctysluma function) -;; (define-extern update-mood-ctysluma function) -;; (define-extern init-mood-ctyslumb function) -;; (define-extern update-mood-ctyslumb function) -;; (define-extern init-mood-ctyslumc function) -;; (define-extern update-mood-ctyslumc function) -;; (define-extern init-mood-ctyport function) -;; (define-extern init-mood-ctyport-no-part function) -;; (define-extern update-mood-ctyport function) -;; (define-extern update-mood-ctymarka function) -;; (define-extern update-mood-ctymarkb function) -;; (define-extern init-mood-palcab function) -;; (define-extern update-mood-palcab function) -;; (define-extern set-palcab-turret-flash! function) -;; (define-extern update-stadium-lights function) -;; (define-extern update-mood-stadium function) -;; (define-extern update-mood-copy-stadium function) -;; (define-extern update-stadiumb-lights function) -;; (define-extern update-mood-stadiumb function) -;; (define-extern update-mood-skatea function) -;; (define-extern update-ltentout-lights function) -;; (define-extern update-mood-ltentout function) -;; (define-extern init-mood-mountain function) -;; (define-extern update-mood-mountain function) -;; (define-extern update-mood-forest function) -;; (define-extern init-mood-atoll function) -;; (define-extern update-mood-atoll function) -;; (define-extern set-atoll-explosion! function) -;; (define-extern update-mood-atollext function) -;; (define-extern init-mood-drill function) -;; (define-extern update-drill-lights function) -;; (define-extern update-mood-drill function) -;; (define-extern set-drill-fire-floor! function) -;; (define-extern set-drill-electricity-scale! function) -;; (define-extern update-mood-drillmnt function) -;; (define-extern init-mood-drillb function) -;; (define-extern update-mood-drillb function) -;; (define-extern update-casboss-lights function) -;; (define-extern update-mood-casboss function) -;; (define-extern set-casboss-explosion! function) -;; (define-extern update-mood-caspad function) -;; (define-extern init-mood-palout function) -;; (define-extern update-mood-palout function) -;; (define-extern init-mood-palroof function) -;; (define-extern update-mood-palroof function) -;; (define-extern set-palroof-electricity-scale! function) -;; (define-extern update-mood-palent function) -;; (define-extern set-palent-turret-flash! function) -;; (define-extern init-mood-nest function) -;; (define-extern update-nest-lights function) -;; (define-extern update-mood-nest function) -;; (define-extern set-nest-green-flag! function) -;; (define-extern init-mood-village1 function) -;; (define-extern update-village1-lights function) -;; (define-extern update-mood-village1 function) ;; (function mood-context float int none) -;; (define-extern update-mood-copy-village1 function) -;; (define-extern clear-village1-interp! function) -;; (define-extern set-village1-interp! function) -;; (define-extern update-mood-consite function) -;; (define-extern set-consite-flash! function) -;; (define-extern update-mood-mincan function) -;; (define-extern set-mincan-beam! function) + +(define-extern update-mood-default (function mood-context float int none)) +(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 init-mood-ctysluma (function mood-context float)) +(define-extern update-mood-ctysluma (function mood-context float int none)) +(define-extern init-mood-ctyslumb (function mood-context uint)) +(define-extern update-mood-ctyslumb (function mood-context float int none)) +(define-extern init-mood-ctyslumc (function mood-context none)) +(define-extern update-mood-ctyslumc (function mood-context float int none)) +(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 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-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-ltentout-lights (function mood-context none)) +(define-extern update-mood-ltentout (function mood-context float int none)) +(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 init-mood-atoll (function mood-context float)) +(define-extern update-mood-atoll (function mood-context float int none)) +(define-extern set-atoll-explosion! (function float float)) +(define-extern update-mood-atollext (function mood-context float int none)) +(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 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 init-mood-drillb (function mood-context symbol)) +(define-extern update-mood-drillb (function mood-context float int none)) +(define-extern update-casboss-lights (function mood-context float)) +(define-extern update-mood-casboss (function mood-context float int none)) +(define-extern set-casboss-explosion! (function float)) +(define-extern update-mood-caspad (function mood-context float int none)) +(define-extern init-mood-palout (function mood-context vector)) +(define-extern update-mood-palout (function mood-context float int none)) +(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 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 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 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 set-consite-flash! (function float)) +(define-extern update-mood-mincan (function mood-context float int none)) +(define-extern set-mincan-beam! (function int float float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mood-funcs2 ;; @@ -23767,7 +23730,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 none)) -;; (define-extern set-filter-color! function) +(define-extern set-filter-color! (function float float int none)) ;; (define-extern tod-madd! function) ;; (define-extern update-environment-colors function) (define-extern update-time-of-day (function time-of-day-context none)) @@ -24469,8 +24432,8 @@ ;; (define-extern matrix-local->world function) ;; (function symbol symbol matrix) ;; (define-extern matrix-world->local function) ;; (function matrix) ;; (define-extern *camera-dummy-vector* object) ;; vector -(define-extern camera-pos (function vector)) ;; -;; (define-extern math-camera-pos function) ;; (function vector) +(define-extern camera-pos (function vector)) +(define-extern math-camera-pos (function vector)) ;; (define-extern camera-matrix function) ;; (define-extern math-camera-matrix function) (define-extern camera-angle (function float)) @@ -24715,16 +24678,16 @@ ;; vol-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype plane-volume (structure) ((volume-type symbol :offset-assert 0) ;; guessed by decompiler (point-count int16 :offset-assert 4) (normal-count int16 :offset-assert 6) - (first-point vector :offset-assert 8) ;; (pointer vector) - (first-normal vector :offset-assert 12) ;; (pointer vector) + (first-point (pointer vector) :offset-assert 8) ;; (pointer vector) + (first-normal (pointer vector) :offset-assert 12) ;; (pointer vector) (num-planes int32 :offset-assert 16) (plane (inline-array plane) :offset-assert 20) ;; guessed by decompiler ) + :pack-me :method-count-assert 12 :size-assert #x18 :flag-assert #xc00000018 @@ -24734,30 +24697,35 @@ (plane-volume-method-11 () none 11) ;; (dummy-11 (_type_ vector float) symbol 11) ) ) -|# -#| +(defenum vol-flags + :bitfield #t + :type uint32 + (display?) + ) + (deftype vol-control (basic) - ((flags uint32 :offset-assert 4) - (process process-drawable :offset-assert 8) ;; guessed by decompiler - (pos-vol-count int32 :offset-assert 12) - (pos-vol plane-volume 32 :offset-assert 16) ;; guessed by decompiler - (neg-vol-count int32 :offset-assert 784) - (neg-vol plane-volume 32 :offset-assert 788) ;; guessed by decompiler - (debug-point vector-array :offset-assert 1556) ;; guessed by decompiler - (debug-normal vector-array :offset-assert 1560) ;; guessed by decompiler + ((flags vol-flags :offset-assert 4) + (process process-drawable :offset-assert 8) + (pos-vol-count int32 :offset-assert 12) + (pos-vol plane-volume 32 :inline :offset-assert 16) + (neg-vol-count int32 :offset-assert 784) + (neg-vol plane-volume 32 :inline :offset-assert 788) + (debug-point vector-array :offset-assert 1556) + (debug-normal vector-array :offset-assert 1560) ) :method-count-assert 12 :size-assert #x61c :flag-assert #xc0000061c (:methods - ;; (new (symbol type process-drawable) _type_ 0) - (vol-control-method-9 () none 9) ;; (dummy-9 (_type_) symbol 9) - (vol-control-method-10 () none 10) ;; (dummy-10 (_type_ vector) symbol 10) - (vol-control-method-11 () none 11) ;; (TODO-RENAME-11 (_type_) symbol 11) + (new (symbol type process-drawable) _type_ 0) + (vol-control-method-9 (_type_) symbol 9) ;; (dummy-9 (_type_) symbol 9) + (vol-control-method-10 (_type_ vector) symbol 10) ;; (dummy-10 (_type_ vector) symbol 10) + (should-display? + "Returns true/false if the volume's marks should be displayed" + (_type_) symbol 11) ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -27453,7 +27421,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) +(define-extern task-node-closed? (function int symbol)) ;; TODO - probably the task id? ;; (define-extern task-node-close! function) ;; (define-extern task-node-open? function) ;; (define-extern task-node-open! function) diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index d594ac7895..30d69fd0ec 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -7,15 +7,9 @@ [23, "(function process symbol)"], [17, "(function process symbol)"] ], - "level": [ - [5, "(function none)"] - ], - "main": [ - [3, "(function none :behavior process)"] - ], - "profile": [ - [9, "(function profile-segment-array profile-collapse none)"] - ], + "level": [[5, "(function none)"]], + "main": [[3, "(function none :behavior process)"]], + "profile": [[9, "(function profile-segment-array profile-collapse none)"]], "bigmap-h": [ [1, "(function external-art-buffer none)"], [2, "(function external-art-buffer none)"] @@ -43,4 +37,4 @@ [5, "(function none)"], [24, "(function level-group int symbol)"] ] -} \ No newline at end of file +} diff --git a/decompiler/config/jak2/art_info.jsonc b/decompiler/config/jak2/art_info.jsonc index 779d289cff..7a115d726a 100644 --- a/decompiler/config/jak2/art_info.jsonc +++ b/decompiler/config/jak2/art_info.jsonc @@ -1,4 +1,4 @@ { - "files":{}, - "functions":{} -} \ No newline at end of file + "files": {}, + "functions": {} +} diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 793cf0413f..860bc3a186 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -35,41 +35,135 @@ "asm_functions_by_name": [ // checking boxed type is different now - these make the cfg stuff sad - "name=", "joint-control-remap!", "(method 21 game-info)", - "(anon-function 2 cam-combiner)", "cspace-inspect-tree", "command-get-process", "command-get-trans", "(method 10 script-context)", - "(method 11 script-context)", "(method 9 script-context)", "(anon-function 64 script)", "(anon-function 61 script)", "(anon-function 60 script)", - "(anon-function 54 script)", "(anon-function 52 script)", "(anon-function 49 script)", "(anon-function 33 script)", "debug-menu-func-decode", - "scene-player-init", "(method 77 spyder)", "(method 77 flamer)", "(method 77 grenadier)", "(method 224 bot)", "(method 77 rapid-gunner)", + "name=", + "joint-control-remap!", + "(method 21 game-info)", + "(anon-function 2 cam-combiner)", + "cspace-inspect-tree", + "command-get-process", + "command-get-trans", + "(method 10 script-context)", + "(method 11 script-context)", + "(method 9 script-context)", + "(anon-function 64 script)", + "(anon-function 61 script)", + "(anon-function 60 script)", + "(anon-function 54 script)", + "(anon-function 52 script)", + "(anon-function 49 script)", + "(anon-function 33 script)", + "debug-menu-func-decode", + "scene-player-init", + "(method 77 spyder)", + "(method 77 flamer)", + "(method 77 grenadier)", + "(method 224 bot)", + "(method 77 rapid-gunner)", // until loop without nop: - "(method 9 history)", "history-print", "history-draw", - "(method 9 sparticle-launcher)", "(method 18 tracking-spline)", "cam-string-find-position-rel!", "cam-layout-entity-volume-info-create", - "process-drawable-shock-skel-effect", "target-history-print", "display-list-control", "anim-test-anim-list-handler", - "anim-test-sequence-list-handler", "anim-tester-get-playing-item", "(method 9 mysql-nav-graph)", "(method 58 nav-graph-editor)", - "(method 120 enemy)", "start-pilot-recorder", "(anon-function 10 pilot-recorder)", "(method 0 hover-nav-control)", - "(method 24 nav-network)", "(method 11 predator-manager)", "(method 9 bot-speech-list)", "(method 9 bot-speech-list-shuffle)", - "(anon-function 10 sig-recorder)", "(method 14 trail-graph)", "(method 12 trail-graph)", "(method 11 trail-graph)", + "(method 9 history)", + "history-print", + "history-draw", + "(method 9 sparticle-launcher)", + "(method 18 tracking-spline)", + "cam-string-find-position-rel!", + "cam-layout-entity-volume-info-create", + "process-drawable-shock-skel-effect", + "target-history-print", + "display-list-control", + "anim-test-anim-list-handler", + "anim-test-sequence-list-handler", + "anim-tester-get-playing-item", + "(method 9 mysql-nav-graph)", + "(method 58 nav-graph-editor)", + "(method 120 enemy)", + "start-pilot-recorder", + "(anon-function 10 pilot-recorder)", + "(method 0 hover-nav-control)", + "(method 24 nav-network)", + "(method 11 predator-manager)", + "(method 9 bot-speech-list)", + "(method 9 bot-speech-list-shuffle)", + "(anon-function 10 sig-recorder)", + "(method 14 trail-graph)", + "(method 12 trail-graph)", + "(method 11 trail-graph)", // actual asm - "quad-copy!", "return-from-thread", "return-from-thread-dead", "reset-and-call", "(method 10 cpu-thread)", - "(method 11 cpu-thread)", "(method 0 catch-frame)", "throw-dispatch", "throw", "run-function-in-process", - "set-to-run-bootstrap", "return-from-exception", "exp", "(method 17 bounding-box)", "(method 9 bounding-box)", - "(method 9 matrix)", "quaternion->matrix-2", "sin-rad", "cos-rad", "atan-series-rad", "sign-float", "dma-count-until-done", + "quad-copy!", + "return-from-thread", + "return-from-thread-dead", + "reset-and-call", + "(method 10 cpu-thread)", + "(method 11 cpu-thread)", + "(method 0 catch-frame)", + "throw-dispatch", + "throw", + "run-function-in-process", + "set-to-run-bootstrap", + "return-from-exception", + "exp", + "(method 17 bounding-box)", + "(method 9 bounding-box)", + "(method 9 matrix)", + "quaternion->matrix-2", + "sin-rad", + "cos-rad", + "atan-series-rad", + "sign-float", + "dma-count-until-done", "(method 11 collide-mesh-cache)", - "symlink2", "blerc-a-fragment", "blerc-execute", "foreground-check-longest-edge-asm", "generic-light-proc", - "shadow-add-single-edges","shadow-add-facing-single-tris", "shadow-add-double-tris", "shadow-add-double-edges", - "(method 12 collide-mesh)", "(method 17 collide-edge-work)", "(method 42 collide-shape)", "(method 12 collide-shape-prim-sphere)", - "(method 12 collide-shape-prim-mesh)", "(method 18 collide-shape-prim-mesh)", "(method 10 collide-cache-prim)", - "(method 17 collide-cache)", "(method 16 ocean)", + "symlink2", + "blerc-a-fragment", + "blerc-execute", + "foreground-check-longest-edge-asm", + "generic-light-proc", + "shadow-add-single-edges", + "shadow-add-facing-single-tris", + "shadow-add-double-tris", + "shadow-add-double-edges", + "(method 12 collide-mesh)", + "(method 17 collide-edge-work)", + "(method 42 collide-shape)", + "(method 12 collide-shape-prim-sphere)", + "(method 12 collide-shape-prim-mesh)", + "(method 18 collide-shape-prim-mesh)", + "(method 10 collide-cache-prim)", + "(method 17 collide-cache)", + "(method 16 ocean)", // unknown bug - "joint-mod-polar-look-at-guts", "(method 13 external-art-control)", "update-mood-copy-ctywide", "update-mood-copy-stadium", - "update-mood-drillb", "reset-target-tracking", "(anon-function 1 target)", "find-nearest-entity", "target-land-effect", - "(method 12 effect-control)", "(method 11 effect-control)", "(method 10 effect-control)", - "(anon-function 2 scene)", "progress-trans", "(method 10 bigmap)", "(method 9 editable-region)", "(method 57 enemy)", - "(anon-function 10 meet-brutter)", "(method 154 vehicle-racer)", "(method 188 predator)", "(anon-function 13 sig0-course)", - "(method 228 hal-sewer)", "(method 154 vehicle-city-racer)", "(method 53 squid)", "(anon-function 11 fort-floor-spike)", - "(method 29 gun-dummy)", "vehicle-explode-post", "(method 158 vehicle-guard)", "(method 207 metalhead-predator)", - "(anon-function 4 gun-states)", "(anon-function 28 grenadier)", "(anon-function 24 grenadier)" + "joint-mod-polar-look-at-guts", + "(method 13 external-art-control)", + "update-mood-copy-ctywide", + "update-mood-copy-stadium", + "update-mood-drillb", + "reset-target-tracking", + "(anon-function 1 target)", + "find-nearest-entity", + "target-land-effect", + "(method 12 effect-control)", + "(method 11 effect-control)", + "(method 10 effect-control)", + "(anon-function 2 scene)", + "progress-trans", + "(method 10 bigmap)", + "(method 9 editable-region)", + "(method 57 enemy)", + "(anon-function 10 meet-brutter)", + "(method 154 vehicle-racer)", + "(method 188 predator)", + "(anon-function 13 sig0-course)", + "(method 228 hal-sewer)", + "(method 154 vehicle-city-racer)", + "(method 53 squid)", + "(anon-function 11 fort-floor-spike)", + "(method 29 gun-dummy)", + "vehicle-explode-post", + "(method 158 vehicle-guard)", + "(method 207 metalhead-predator)", + "(anon-function 4 gun-states)", + "(anon-function 28 grenadier)", + "(anon-function 24 grenadier)" ], // these functions use pairs and the decompiler @@ -103,10 +197,10 @@ "bad_format_strings": { "~170h~5d~220h~5d~280h~5,,2f": 3, "~338h~5d~388h~5d~448h~5,,2f": 3, - "~1k~%":0, - "~30Htf: ~8D~134Hpr: ~8D~252Hsh: ~8D~370Hhd: ~8D~%":4, - "~30Hal: ~8D~131Hwa: ~8D~252Hsp: ~8D~370Hwp: ~8D~%":4, - "~0Kload ~16S ~5S ~5DK ~5,,2fs ~5,,2fs~1K ~5,,0f k/s~%":6 + "~1k~%": 0, + "~30Htf: ~8D~134Hpr: ~8D~252Hsh: ~8D~370Hhd: ~8D~%": 4, + "~30Hal: ~8D~131Hwa: ~8D~252Hsp: ~8D~370Hwp: ~8D~%": 4, + "~0Kload ~16S ~5S ~5DK ~5,,2fs ~5,,2fs~1K ~5,,0f k/s~%": 6 }, "blocks_ending_in_asm_branch": { @@ -133,18 +227,11 @@ // Add information about those format instructions here. // e.g. "function-name":[[op, argc], [op, argc], ...] // where "op" is the op number for the call to format. - "dynamic_format_arg_counts": { + "dynamic_format_arg_counts": {}, - }, + "mips2c_functions_by_name": [], - "mips2c_functions_by_name": [ - - - ], - - "mips2c_jump_table_functions": { - - }, + "mips2c_jump_table_functions": {}, // there are some missing textures. I don't know what the game actually does here. // the format for entries is [level, tpage, index] @@ -153,7 +240,5 @@ // some object files have garbage pad data at the end which makes the decompiler // assume they must be different files, such as the art group for orb-cache-top. // this just suppresses a message. - "expected_merged_objs": [ - - ] + "expected_merged_objs": [] } diff --git a/decompiler/config/jak2/import_deps.jsonc b/decompiler/config/jak2/import_deps.jsonc index 0e0dcd235c..0967ef424b 100644 --- a/decompiler/config/jak2/import_deps.jsonc +++ b/decompiler/config/jak2/import_deps.jsonc @@ -1,3 +1 @@ -{ - -} \ No newline at end of file +{} diff --git a/decompiler/config/jak2/inputs.jsonc b/decompiler/config/jak2/inputs.jsonc index f7e28d62cd..b3b988a81f 100644 --- a/decompiler/config/jak2/inputs.jsonc +++ b/decompiler/config/jak2/inputs.jsonc @@ -161,11 +161,10 @@ "DGO/CASCITY.DGO", "DGO/LYSAMSAM.DGO", "DGO/VI1.DGO" -], + ], // some objects are part of STR files (streaming data). - "str_file_names": [ - ], + "str_file_names": [], // some objects are directly stored as files on the DVD. This is just text files. "object_file_names": [ @@ -177,7 +176,7 @@ "TEXT/5COMMON.TXT", "TEXT/6COMMON.TXT", "TEXT/7COMMON.TXT" -], + ], // uncomment the next line to extract audio to wave files. //"audio_dir_file_name": "jak1/VAG", diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 392de23831..dec1add70f 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -1,45 +1,31 @@ { - "profile": [ - ["L14", "profile-work"] - ], - + "profile": [["L14", "profile-work"]], "math": [ ["L103", "(pointer float)", 32], ["L102", "(pointer float)", 32] ], - "trigonometry": [ - ["L93", "vector"], - ["L92", "vector"], - ["L91", "vector"] - ], - "video-h": [ - ["L1", "video-params"] - ], - "geometry": [ - ["L132", "vector"] + ["L93", "vector"], + ["L92", "vector"], + ["L91", "vector"] ], + "video-h": [["L1", "video-params"]], + "geometry": [["L132", "vector"]], "texture-h": [ - ["L10", "texture-base"], - ["L9", "texture-base"], - ["L8", "texture-base"], - ["L7", "texture-base"], - ["L6", "texture-base"], - ["L5", "texture-base"] - ], - "texture-anim-h": [ - ["L1", "(pointer uint32)", 64] - ], - "main-h": [ - ["L3", "frame-stats"] + ["L10", "texture-base"], + ["L9", "texture-base"], + ["L8", "texture-base"], + ["L7", "texture-base"], + ["L6", "texture-base"], + ["L5", "texture-base"] ], + "texture-anim-h": [["L1", "(pointer uint32)", 64]], + "main-h": [["L3", "frame-stats"]], "font-h": [ - ["L20", "matrix"], - ["L19", "font-work"] + ["L20", "matrix"], + ["L19", "font-work"] ], - "capture": [ - ["L4", "gs-store-image-packet"]], - + "capture": [["L4", "gs-store-image-packet"]], "task-control-h": [ ["L877", "uint64", true], ["L878", "uint64", true], @@ -49,7 +35,6 @@ ["L882", "uint64", true], ["L883", "uint64", true] ], - "ocean-trans-tables": [ ["L1", "(inline-array vector)", 4], ["L2", "(pointer float)", 160], @@ -74,7 +59,19 @@ "ocean-frames": [["L1", "(pointer uint32)", 16384]], "ambient-h": [["L1", "(inline-array talker-speech-class)", 188]], "pat-h": [["L1", "(inline-array pat-mode-info)", 4]], - "joint-mod-h": [ - ["L43", "(inline-array vector)", 6] + "joint-mod-h": [["L43", "(inline-array vector)", 6]], + "mood-funcs": [ + ["L231", "vector"], + ["L358", "(pointer uint64)", 1], + ["L361", "(pointer uint64)", 1], + ["L359", "(pointer uint64)", 1], + ["L365", "(pointer uint64)", 1], + ["L360", "(pointer uint64)", 1], + ["L366", "(pointer uint64)", 1], + ["L363", "(pointer uint64)", 1], + ["L368", "(pointer uint64)", 1], + ["L364", "(pointer uint64)", 1], + ["L367", "(pointer uint64)", 1], + ["L362", "(pointer uint64)", 1] ] -} \ No newline at end of file +} diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index 487915f6d5..2365acc1aa 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -1,24 +1,18 @@ { - "quaternion-exp!": [[16, "vector"]], - "quaternion-axis-angle!": [ - [16, "vector"] - ], - "quaternion-vector-angle!": [ - [16, "vector"] - ], - "quaternion-look-at!": [ - [16, "matrix"] - ], - "quaternion-smooth-seek!": [ - [16, ["inline-array", "quaternion", 2]] - ], + "quaternion-axis-angle!": [[16, "vector"]], + "quaternion-vector-angle!": [[16, "vector"]], + "quaternion-look-at!": [[16, "matrix"]], + "quaternion-smooth-seek!": [[16, ["inline-array", "quaternion", 2]]], // possible for automatic detection: "eul->matrix": [[16, "vector"]], "vector-sincos!": [[16, "vector"]], - "vector-reflect-flat-gravity!": [[16, "vector"], [32, "vector"]], + "vector-reflect-flat-gravity!": [ + [16, "vector"], + [32, "vector"] + ], "vector-line-distance": [ [16, "vector"], [32, "vector"], @@ -58,34 +52,22 @@ [144, "quaternion"] ], "vector-segment-overlap": [ - [16, "vector"], - [32, "vector"], - [48, "vector"], - [64, "vector"] + [16, "vector"], + [32, "vector"], + [48, "vector"], + [64, "vector"] ], "line-sphere-intersection?": [ - [16, "vector"], - [32, "vector"], - [48, "vector"] - ], - "forward-up->inv-matrix": [ - [16, "vector"] - ], - "quaternion-from-two-vectors-partial!": [ - [16, "vector"] - ], - "quaternion-from-two-vectors-max-angle-partial!": [ - [16, "vector"] - ], - "matrix-from-two-vectors-smooth!": [ - [16, "vector"] - ], - "matrix-from-two-vectors-the-long-way-smooth!": [ - [16, "vector"] - ], - "quaternion-from-two-vectors-smooth!": [ - [16, "matrix"] + [16, "vector"], + [32, "vector"], + [48, "vector"] ], + "forward-up->inv-matrix": [[16, "vector"]], + "quaternion-from-two-vectors-partial!": [[16, "vector"]], + "quaternion-from-two-vectors-max-angle-partial!": [[16, "vector"]], + "matrix-from-two-vectors-smooth!": [[16, "vector"]], + "matrix-from-two-vectors-the-long-way-smooth!": [[16, "vector"]], + "quaternion-from-two-vectors-smooth!": [[16, "matrix"]], "vector-deg-seek": [[16, "matrix"]], "vector-deg-slerp": [ [16, "matrix"], @@ -107,9 +89,9 @@ [96, "vector"] ], "vector-circle-tangent-new": [ - [16, "sphere"], - [32, "vector"], - [48, "vector"] + [16, "sphere"], + [32, "vector"], + [48, "vector"] ], "vector-circle-tangent": [ [16, "sphere"], @@ -132,7 +114,10 @@ ], "vector-plane-distance": [[16, "vector"]], "vector-smooth-seek!": [[16, "vector"]], - "vector-vector-angle-safe": [[16, "vector"], [32, "vector"]], + "vector-vector-angle-safe": [ + [16, "vector"], + [32, "vector"] + ], "move-target-from-pad": [ [16, "vector"], [32, "vector"], @@ -150,34 +135,20 @@ [192, "vector"], [208, "vector4s-3"] ], - "draw-sprite2d-xy": [ - [16, "draw-context"] - ], - "screen-gradient": [ - [16, "draw-context"] - ], + "draw-sprite2d-xy": [[16, "draw-context"]], + "screen-gradient": [[16, "draw-context"]], "play": [ [16, "event-message-block"], [96, ["array", "symbol", 10]] ], - "store-image": [ - [16, "file-stream"] - ], + "store-image": [[16, "file-stream"]], - "joint-mod-blend-world-callback": [ - [160, "vector"] - ], - "joint-mod-rotate-local-callback": [ - [16, "vector"] - ], - "light-hash-get-bucket-index": [ - [16, "vector4w"] - ], - "(method 10 cam-vector-seeker)": [ - [16, "vector"] - ], + "joint-mod-blend-world-callback": [[160, "vector"]], + "joint-mod-rotate-local-callback": [[16, "vector"]], + "light-hash-get-bucket-index": [[16, "vector4w"]], + "(method 10 cam-vector-seeker)": [[16, "vector"]], - "(method 39 nav-mesh)" : [ + "(method 39 nav-mesh)": [ [16, "vector"], [32, "vector"] ], @@ -187,9 +158,11 @@ [32, "vector"] ], - "show-level": [ - [16, ["array", "symbol", 10]] - ], + "show-level": [[16, ["array", "symbol", 10]]], + + "(method 17 mood-control)": [[16, "vector"]], + + "(method 9 mood-control)": [[16, "mood-control-work "]], "placeholder-do-not-add-below!": [] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index da2cafb741..cd879cf932 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -1,14 +1,7 @@ { - // auto find-parent-method possible - "(method 3 entity-actor)" : [ - [7, "t9", "(function entity entity)"] - ], - - "(method 3 entity)" : [ - [7, "t9", "(function entity entity)"] - ], - + "(method 3 entity-actor)": [[7, "t9", "(function entity entity)"]], + "(method 3 entity)": [[7, "t9", "(function entity entity)"]], // "(method 2 array)": [ [23, "gp", "(array int32)"], @@ -58,10 +51,8 @@ [13, "a0", "pointer"], [25, "v1", "pointer"] ], - "method-state": [ - [12, "a2", "state"] - ], - "(method 9 process)": [[[46,49], "s5", "process"]], + "method-state": [[12, "a2", "state"]], + "(method 9 process)": [[[46, 49], "s5", "process"]], "(method 10 process)": [[[24, 30], "s4", "protect-frame"]], "(method 0 protect-frame)": [ [0, "a0", "int"], @@ -76,7 +67,6 @@ [101, "t9", "(function object object object object object object none)"] ], "send-event-function": [[[7, 15], "a0", "process"]], - // MATH "logf": [ [12, "f0", "float"], @@ -95,14 +85,10 @@ [17, "f1", "float"], [18, "f0", "float"], [18, "f1", "float"], - [[23,32], "f0", "float"] + [[23, 32], "f0", "float"] ], - // Quaternion - "quaternion-look-at!": [ - [15, "v1", "vector"] - ], - + "quaternion-look-at!": [[15, "v1", "vector"]], "vector-x-quaternion!": [[10, "v1", "(pointer uint128)"]], "vector-y-quaternion!": [[10, "v1", "(pointer uint128)"]], "vector-z-quaternion!": [[10, "v1", "(pointer uint128)"]], @@ -114,22 +100,21 @@ [11, "v1", "pointer"] ], "dma-buffer-patch-buckets": [ - [[6,8], "a0", "(inline-array dma-bucket)"], + [[6, 8], "a0", "(inline-array dma-bucket)"], [8, "a3", "pointer"], [14, "a0", "(inline-array dma-bucket)"], [3, "a0", "(inline-array dma-bucket)"], [36, "a0", "(inline-array dma-bucket)"], [10, "a0", "(inline-array dma-bucket)"], [18, "a0", "(inline-array dma-bucket)"], - [[29,33], "a0", "dma-packet"], + [[29, 33], "a0", "dma-packet"], [34, "a0", "(inline-array dma-bucket)"] ], "dma-bucket-insert-tag": [ [[2, 6], "v1", "dma-bucket"], [3, "a0", "dma-bucket"] ], - - "disasm-vif-details": [ + "disasm-vif-details": [ [[62, 94], "s3", "(pointer uint32)"], [[98, 130], "s3", "(pointer uint16)"], [[134, 164], "s3", "(pointer uint32)"], @@ -168,35 +153,38 @@ "vector4-array-add!": [ [11, "s5", "(inline-array vector4)"], [12, "s4", "(inline-array vector4)"], - [13, "gp", "(inline-array vector4)"]], + [13, "gp", "(inline-array vector4)"] + ], "vector4-array-sub!": [ [11, "s5", "(inline-array vector4)"], [12, "s4", "(inline-array vector4)"], - [13, "gp", "(inline-array vector4)"]], + [13, "gp", "(inline-array vector4)"] + ], "vector4-array-mul!": [ [11, "s5", "(inline-array vector4)"], [12, "s4", "(inline-array vector4)"], - [13, "gp", "(inline-array vector4)"]], + [13, "gp", "(inline-array vector4)"] + ], "vector4-array-scale!": [ [11, "s5", "(inline-array vector4)"], - [12, "gp", "(inline-array vector4)"]], + [12, "gp", "(inline-array vector4)"] + ], "vector4-array-madd!": [ [13, "s5", "(inline-array vector4)"], [14, "s4", "(inline-array vector4)"], - [15, "gp", "(inline-array vector4)"]], + [15, "gp", "(inline-array vector4)"] + ], "vector4-array-msub!": [ [13, "s5", "(inline-array vector4)"], [14, "s4", "(inline-array vector4)"], - [15, "gp", "(inline-array vector4)"]], + [15, "gp", "(inline-array vector4)"] + ], "vector4-array-lerp!": [ [13, "s5", "(inline-array vector4)"], [14, "s4", "(inline-array vector4)"], - [15, "gp", "(inline-array vector4)"]], - - "vector-segment-distance-point!": [ - [[21,30], "f1", "float"] + [15, "gp", "(inline-array vector4)"] ], - + "vector-segment-distance-point!": [[[21, 30], "f1", "float"]], "(method 10 profile-array)": [ [[6, 10], "a0", "dma-packet"], [[16, 19], "a0", "gs-gif-tag"], @@ -231,7 +219,6 @@ [[225, 231], "a2", "vector4w"], [[231, 237], "a2", "vector4w"] ], - "draw-sprite2d-xy": [ [[35, 39], "t0", "dma-packet"], [[45, 48], "t0", "gs-gif-tag"], @@ -241,7 +228,6 @@ [87, "t0", "(pointer gs-xyzf)"], [[96, 108], "v1", "(pointer uint64)"] ], - "draw-sprite2d-xy-absolute": [ [[6, 10], "t3", "dma-packet"], [[16, 19], "t3", "gs-gif-tag"], @@ -251,7 +237,6 @@ [49, "t3", "(pointer gs-xyzf)"], [[62, 69], "v1", "(pointer uint64)"] ], - "draw-quad2d": [ [[18, 22], "t2", "dma-packet"], [[28, 31], "t2", "gs-gif-tag"], @@ -321,20 +306,20 @@ [46, "a1", "(pointer uint64)"], [48, "a1", "(pointer gs-reg64)"] ], - - "(method 3 connection-pers)": [ - [97, "f0", "float"] - ], - + "(method 3 connection-pers)": [[97, "f0", "float"]], "(method 9 connection)": [[8, "a0", "pointer"]], "(method 10 connection)": [[8, "a0", "pointer"]], "(method 11 connection)": [[5, "a1", "pointer"]], - "(method 0 engine)": [[44, "v1", "pointer"], [47, "v1", "pointer"], [53, "v1", "connectable"], [65, "v1", "connectable"]], + "(method 0 engine)": [ + [44, "v1", "pointer"], + [47, "v1", "pointer"], + [53, "v1", "connectable"], + [65, "v1", "connectable"] + ], "(method 12 engine)": [ [[5, 18], "s4", "connection"], [13, "t9", "(function object object object object object)"] ], - "(method 13 engine)": [ [[5, 28], "s4", "connection"], [13, "t9", "(function object object object object object)"] @@ -343,43 +328,40 @@ "(method 19 engine)": [[8, "a0", "connection"]], "(method 20 engine)": [[8, "a0", "connection"]], "(method 21 engine)": [[8, "a0", "connection"]], - "(method 0 engine-pers)": [[32, "v1", "pointer"], [23, "v1", "pointer"], [26, "v1", "pointer"], [24, "v1", "(pointer pointer)"]], - "(method 3 connection-minimap)" : [[97, "f0", "float"]], + "(method 0 engine-pers)": [ + [32, "v1", "pointer"], + [23, "v1", "pointer"], + [26, "v1", "pointer"], + [24, "v1", "(pointer pointer)"] + ], + "(method 3 connection-minimap)": [[97, "f0", "float"]], "dma-buffer-add-ref-texture": [ [[25, 29], "a3", "dma-packet"], [[32, 44], "a3", "gs-gif-tag"], [[47, 62], "a2", "dma-packet"] ], - "texture-page-default-allocate": [ - [51, "a3", "texture-page"] - ], - "texture-page-font-allocate": [ - [33, "a3", "texture-page"] - ], + "texture-page-default-allocate": [[51, "a3", "texture-page"]], + "texture-page-font-allocate": [[33, "a3", "texture-page"]], "(method 24 texture-pool)": [ [67, "a1", "shader-ptr"], [[70, 91], "a1", "adgif-shader"], [92, "a1", "adgif-shader"] ], - - "(method 3 generic-tie-interp-point)":[ - [19, "gp", "(pointer uint128)"] - ], + "(method 3 generic-tie-interp-point)": [[19, "gp", "(pointer uint128)"]], "(method 19 res-lump)": [ [46, "t2", "(pointer uint64)"], [100, "t3", "(pointer uint64)"], [184, "t5", "(pointer uint64)"], [64, "t6", "(pointer uint64)"] ], - "(method 20 res-lump)": [[331, "a3", "(inline-array vector)"]], + "(method 20 res-lump)": [[341, "t0", "(pointer uint128)"]], "(method 16 res-lump)": [ [22, "t1", "(pointer uint64)"], [29, "t2", "(pointer uint64)"] ], "(method 15 res-lump)": [[132, "s5", "res-tag-pair"]], "(method 17 res-lump)": [[22, "s4", "(pointer pointer)"]], - - "(method 0 script-context)" : [[[8, 17], "v0", "script-context"]], + "(method 0 script-context)": [[[8, 17], "v0", "script-context"]], "joint-mod-wheel-callback": [[[2, 63], "s4", "joint-mod-wheel"]], "joint-mod-set-local-callback": [[[0, 23], "v1", "joint-mod-set-local"]], "joint-mod-add-local-callback": [[[2, 33], "s4", "joint-mod-add-local"]], @@ -387,11 +369,19 @@ "joint-mod-blend-local-callback": [[[2, 63], "gp", "joint-mod-blend-local"]], "joint-mod-spinner-callback": [[[2, 63], "gp", "joint-mod-spinner"]], "joint-mod-blend-world-callback": [[[2, 148], "gp", "joint-mod-blend-world"]], - "joint-mod-rotate-local-callback": [[[2, 16], "v1", "joint-mod-rotate-local"]], - "(method 0 collide-shape-prim-sphere)": [[[3, 8], "v0", "collide-shape-prim-sphere"]], - "(method 0 collide-shape-prim-mesh)": [[[3, 11], "v0", "collide-shape-prim-mesh"]], - "(method 0 collide-shape-prim-group)": [[[3, 12], "v0", "collide-shape-prim-group"]], - "(method 0 collide-shape-moving)" : [[[2, 12], "v0", "collide-shape-moving"]], + "joint-mod-rotate-local-callback": [ + [[2, 16], "v1", "joint-mod-rotate-local"] + ], + "(method 0 collide-shape-prim-sphere)": [ + [[3, 8], "v0", "collide-shape-prim-sphere"] + ], + "(method 0 collide-shape-prim-mesh)": [ + [[3, 11], "v0", "collide-shape-prim-mesh"] + ], + "(method 0 collide-shape-prim-group)": [ + [[3, 12], "v0", "collide-shape-prim-group"] + ], + "(method 0 collide-shape-moving)": [[[2, 12], "v0", "collide-shape-moving"]], "(method 11 touching-prims-entry-pool)": [ [[0, 8], "v1", "touching-prims-entry"], [8, "v1", "pointer"], @@ -400,14 +390,15 @@ ], "(method 0 touching-list)": [[[6, 9], "v0", "touching-list"]], "display-loop-main": [[223, "t9", "(function none)"]], - "end-display": [[205, "f1", "float"], [205, "f0", "float"]], - + "end-display": [ + [205, "f1", "float"], + [205, "f0", "float"] + ], "(method 18 res-lump)": [["_stack_", 16, "object"]], "(method 21 res-lump)": [ ["_stack_", 16, "res-tag"], ["_stack_", 32, "res-tag"] ], - "(method 8 res-lump)": [ [258, "s0", "array"], // [[0, 100], "s0", "basic"], @@ -416,46 +407,24 @@ [[157, 239], "s0", "(array object)"] // [235, "s0", "basic"] ], - "(method 20 res-lump)": [ - [341, "t0", "(pointer uint128)"] - ], - "(method 0 fact-info-enemy)": [ [[0, 196], "gp", "fact-info-enemy"], ["_stack_", 16, "res-tag"], ["_stack_", 32, "res-tag"] ], - - "(method 0 fact-info)": [ - [87, "v1", "(pointer int32)"] - ], - - "(method 0 fact-info-crate)": [ - [[0, 17], "gp", "fact-info-crate"] - ], - - - "(method 0 fact-info-target)": [ - [[0, 17], "gp", "fact-info-target"] - ], - + "(method 0 fact-info)": [[87, "v1", "(pointer int32)"]], + "(method 0 fact-info-crate)": [[[0, 17], "gp", "fact-info-crate"]], + "(method 0 fact-info-target)": [[[0, 17], "gp", "fact-info-target"]], "joint-channel-float-delete!": [ [7, "a0", "pointer"], [7, "a1", "pointer"] ], - - "num-func-chan": [ - [7, "v1", "joint-control-channel"] - ], - + "num-func-chan": [[7, "v1", "joint-control-channel"]], "(method 20 process-focusable)": [ [15, "gp", "collide-shape-moving"], [31, "gp", "collide-shape"] ], - - "(method 10 focus)": [ - [19, "v1", "collide-shape"] - ], + "(method 10 focus)": [[19, "v1", "collide-shape"]], "shrubbery-login-post-texture": [ [[13, 15], "a3", "qword"], [16, "a3", "pointer"], @@ -468,25 +437,13 @@ [[35, 37], "a3", "qword"], [[35, 37], "a2", "qword"] ], - - "(top-level-login eye-h)": [ - [[69, 77], "a1", "eye-control"] - ], - - "entity-actor-lookup": [ - ["_stack_", 16, "res-tag"] - ], - - - "entity-actor-count": [ - ["_stack_", 16, "res-tag"] - ], - + "(top-level-login eye-h)": [[[69, 77], "a1", "eye-control"]], + "entity-actor-lookup": [["_stack_", 16, "res-tag"]], + "entity-actor-count": [["_stack_", 16, "res-tag"]], "(method 0 path-control)": [["_stack_", 16, "res-tag"]], - -"(method 9 actor-link-info)": [[[0, 36], "s3", "entity-actor"]], -"(method 41 nav-mesh)": [["_stack_", 56, "float"]], -"(method 39 nav-mesh)": [["_stack_", 56, "float"]], + "(method 9 actor-link-info)": [[[0, 36], "s3", "entity-actor"]], + "(method 41 nav-mesh)": [["_stack_", 56, "float"]], + "(method 39 nav-mesh)": [["_stack_", 56, "float"]], "str-load": [[[18, 44], "s2", "load-chunk-msg"]], "str-load-status": [ [[18, 22], "v1", "load-chunk-msg"], @@ -500,21 +457,26 @@ "dgo-load-begin": [[[19, 41], "s2", "load-dgo-msg"]], "dgo-load-get-next": [[[14, 31], "v1", "load-dgo-msg"]], "dgo-load-continue": [[[5, 23], "gp", "load-dgo-msg"]], - "dgo-load-link": [[7, "s4", "uint"], [17, "s4", "uint"], [55, "s4", "uint"], [27, "s4", "uint"], [37, "s4", "uint"]], - - "lookup-level-info": [[3, "a1", "symbol"], [[4, 24], "a1", "level-load-info"]], + "dgo-load-link": [ + [7, "s4", "uint"], + [17, "s4", "uint"], + [55, "s4", "uint"], + [27, "s4", "uint"], + [37, "s4", "uint"] + ], + "lookup-level-info": [ + [3, "a1", "symbol"], + [[4, 24], "a1", "level-load-info"] + ], "(method 30 level-group)": [[87, "v0", "level"]], "(method 19 level-group)": [ [223, "s3", "continue-point"], [[177, 209], "s1", "continue-point"], [[182, 224], "s3", "continue-point"], - [434, "v1", "symbol"]], - "(method 18 level)": [ - [[82, 89], "a1", "level"] - ], - "(method 19 level)": [ - [[45, 48], "a0", "texture-anim-array"] + [434, "v1", "symbol"] ], + "(method 18 level)": [[[82, 89], "a1", "level"]], + "(method 19 level)": [[[45, 48], "a0", "texture-anim-array"]], "level-update-after-load": [ [[123, 152], "s0", "drawable-inline-array-tfrag"], [[155, 158], "s0", "drawable-tree-instance-tie"], @@ -525,8 +487,28 @@ [97, "t9", "(function object none)"], [169, "t9", "(function object symbol none)"] ], - "(method 9 level)": [ - [54, "t9", "(function object none)"] + "(method 9 level)": [[54, "t9", "(function object none)"]], + "copy-mood-exterior": [ + [[15, 19], "a1", "(inline-array vector)"], + [[16, 18], "v1", "(inline-array vector)"], + [[30, 32], "v1", "(inline-array vector)"], + [[29, 33], "a0", "(inline-array vector)"] ], - "placeholder-do-not-add-below": [] + "update-mood-ruins": [[[30, 46], "gp", "(pointer float)"]], + "update-mood-strip": [[[63, 80], "s4", "(pointer float)"]], + "placeholder-do-not-add-below": [], + "update-mood-ctysluma": [[[23, 81], "gp", "(pointer float)"]], + "update-mood-ctyslumb": [[[19, 59], "s5", "(pointer float)"]], + "update-mood-ctyslumc": [[[19, 47], "s5", "(pointer float)"]], + "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)"]], + "desaturate-mood-colors": [[[20, 92], "a0", "(inline-array mood-color)"]] } diff --git a/decompiler/config/jak2/var_names.jsonc b/decompiler/config/jak2/var_names.jsonc index dbae062519..49f60e88f7 100644 --- a/decompiler/config/jak2/var_names.jsonc +++ b/decompiler/config/jak2/var_names.jsonc @@ -1,5 +1,4 @@ { - "(method 15 res-lump)": { "vars": { "s5-0": ["tag-pair", "res-tag-pair"], @@ -10,9 +9,9 @@ }, "(method 0 lightning-control)": { - "vars": { - "gp-0": ["obj", "lightning-control"] - } + "vars": { + "gp-0": ["obj", "lightning-control"] + } }, "(method 0 align-control)": { @@ -38,7 +37,46 @@ "sv-60": "adj-edge-dz", "sv-64": "adj-edge-minus-dx", "f0-10": "heading-dot" + } + }, + "(method 18 mood-control)": { + "vars": { + "v0-3": ["lightning-sound-id", "sound-id"] + } + }, + + "(method 10 mood-control)": { + "args": ["obj", "cloud-target", "fog-target", "cloud-speed", "fog-speed"] + }, + + "(method 11 mood-control)": { + "args": ["obj", "min-cloud", "max-cloud", "min-fog", "max-fog"] + }, + + "copy-mood-exterior": { + "vars": { + "a1-4": ["a1-4", "(inline-array vector)"], + "v1-5": ["v1-5", "(inline-array vector)"], + "a0-2": ["a0-2", "(inline-array vector)"] + } + }, + + "update-mood-strip": { + "vars": { + "s4-1": ["s4-1", "(pointer float)"] + } + }, + + "update-mood-ruins": { + "vars": { + "gp-1": ["gp-1", "(pointer float)"] + } + }, + + "desaturate-mood-colors": { + "vars": { + "a0-8": ["mood-colors", "(inline-array mood-color)"] } } -} \ No newline at end of file +} diff --git a/decompiler/config/jak2_ntsc_v1.jsonc b/decompiler/config/jak2_ntsc_v1.jsonc index 308f636a5a..d80f54495b 100644 --- a/decompiler/config/jak2_ntsc_v1.jsonc +++ b/decompiler/config/jak2_ntsc_v1.jsonc @@ -7,7 +7,7 @@ // if you want to filter to only some object names. // it will make the decompiler much faster. - "allowed_objects": ["math"], + "allowed_objects": ["mood-tables"], "banned_objects": ["effect-control"], //////////////////////////// @@ -16,7 +16,7 @@ // set to true to generate plain .asm files with MIPS disassembly, with no fancy decompilation. // this is fast and should succeed 100% of the time. - "disassemble_code": true, + "disassemble_code": false, // Run the decompiler "decompile_code": true, diff --git a/goal_src/jak2/engine/geometry/vol-h.gc b/goal_src/jak2/engine/geometry/vol-h.gc index 7759fea9a1..d5b9c04580 100644 --- a/goal_src/jak2/engine/geometry/vol-h.gc +++ b/goal_src/jak2/engine/geometry/vol-h.gc @@ -5,5 +5,117 @@ ;; name in dgo: vol-h ;; dgos: ENGINE, GAME +(defenum vol-flags + :bitfield #t + :type uint32 + (display?) + ) + ;; DECOMP BEGINS +(deftype plane-volume (structure) + ((volume-type symbol :offset-assert 0) + (point-count int16 :offset-assert 4) + (normal-count int16 :offset-assert 6) + (first-point (pointer vector) :offset-assert 8) + (first-normal (pointer vector) :offset-assert 12) + (num-planes int32 :offset-assert 16) + (plane (inline-array plane) :offset-assert 20) + ) + :pack-me + :method-count-assert 12 + :size-assert #x18 + :flag-assert #xc00000018 + (:methods + (plane-volume-method-9 () none 9) + (plane-volume-method-10 () none 10) + (plane-volume-method-11 () none 11) + ) + ) + +(deftype vol-control (basic) + ((flags vol-flags :offset-assert 4) + (process process-drawable :offset-assert 8) + (pos-vol-count int32 :offset-assert 12) + (pos-vol plane-volume 32 :inline :offset-assert 16) + (neg-vol-count int32 :offset-assert 784) + (neg-vol plane-volume 32 :inline :offset-assert 788) + (debug-point vector-array :offset-assert 1556) + (debug-normal vector-array :offset-assert 1560) + ) + :method-count-assert 12 + :size-assert #x61c + :flag-assert #xc0000061c + (:methods + (new (symbol type process-drawable) _type_ 0) + (vol-control-method-9 (_type_) symbol 9) + (vol-control-method-10 (_type_ vector) symbol 10) + (should-display? (_type_) symbol 11) + ) + ) + +(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)) + (go process-drawable-art-error "memory") + (set! gp-0 0) + (goto cfg-13) + ) + (set! (-> (the-as vol-control gp-0) process) arg0) + (let* ((s5-1 (-> (the-as vol-control gp-0) process entity)) + (s4-0 (-> ((method-of-type res-lump lookup-tag-idx) s5-1 'vol 'base -1000000000.0) lo)) + ) + (when (>= (the-as int s4-0) 0) + (let ((s3-0 (the-as int s4-0)) + (s2-0 (-> s5-1 tag s4-0)) + ) + 0 + (while (= (-> s2-0 name) (-> s5-1 tag s4-0 name)) + (let ((v1-12 (make-property-data s5-1 0.0 (the-as res-tag-pair s3-0) (the-as pointer #f))) + (a0-8 (-> (the-as vol-control gp-0) pos-vol (-> (the-as vol-control gp-0) pos-vol-count))) + ) + (set! (-> a0-8 num-planes) (the-as int (-> s2-0 elt-count))) + (set! (-> a0-8 plane) (the-as (inline-array plane) v1-12)) + ) + (+! (-> (the-as vol-control gp-0) pos-vol-count) 1) + (+! s3-0 1) + (set! s2-0 (-> s5-1 tag s3-0)) + ) + ) + ) + ) + (let* ((s5-2 (-> (the-as vol-control gp-0) process entity)) + (s4-1 (-> ((method-of-type res-lump lookup-tag-idx) s5-2 'cutoutvol 'base -1000000000.0) lo)) + ) + (when (>= (the-as int s4-1) 0) + (let ((s3-1 (the-as int s4-1)) + (s2-1 (-> s5-2 tag s4-1)) + ) + 0 + (while (= (-> s2-1 name) (-> s5-2 tag s4-1 name)) + (let ((v1-31 (make-property-data s5-2 0.0 (the-as res-tag-pair s3-1) (the-as pointer #f))) + (a0-19 (-> (the-as vol-control gp-0) neg-vol (-> (the-as vol-control gp-0) neg-vol-count))) + ) + (set! (-> a0-19 num-planes) (the-as int (-> s2-1 elt-count))) + (set! (-> a0-19 plane) (the-as (inline-array plane) v1-31)) + ) + (+! (-> (the-as vol-control gp-0) neg-vol-count) 1) + (+! s3-1 1) + (set! s2-1 (-> s5-2 tag s3-1)) + ) + ) + ) + ) + (label cfg-13) + (the-as vol-control gp-0) + ) + ) + +(defmethod should-display? vol-control ((obj vol-control)) + "Returns true/false if the volume's marks should be displayed" + (and *display-vol-marks* (logtest? (-> obj flags) (vol-flags display?))) + ) + + + + diff --git a/goal_src/jak2/engine/gfx/mood/mood-h.gc b/goal_src/jak2/engine/gfx/mood/mood-h.gc index 86b9e55c4d..65dce059e8 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-h.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-h.gc @@ -218,31 +218,31 @@ (lightning-time int32 :offset-assert 128) (lightning-time2 float :offset-assert 132) (lightning-flash float :offset-assert 136) - (lightning-id uint32 :offset-assert 140) + (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 9 :offset-assert 164) - (colors mood-color 3 :offset-assert 200) - (channels mood-channel 3 :offset-assert 212) + (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) ) :method-count-assert 19 :size-assert #x104 :flag-assert #x1300000104 (:methods - (mood-control-method-9 () none 9) - (mood-control-method-10 () none 10) - (mood-control-method-11 () none 11) - (mood-control-method-12 () none 12) - (mood-control-method-13 () none 13) - (mood-control-method-14 () none 14) - (mood-control-method-15 () none 15) - (mood-control-method-16 () none 16) - (mood-control-method-17 () none 17) - (mood-control-method-18 () none 18) + (init-weather! (_type_) none :behavior process 9) + (update-mood-weather! (_type_ float float float float) none 10) + (update-mood-range! (_type_ float float float float) none 11) + (set-time-for-random-weather! (_type_ float float) none 12) + (apply-mood-clouds-and-fog (_type_ mood-control-work) none 13) + (apply-mood-color (_type_ mood-control-work) none 14) + (apply-mood-channels (_type_ mood-control-work) none 15) + (adjust-num-clouds! (_type_ mood-control-work) none 16) + (gen-lightning-and-thunder! (_type_) number 17) + (play-or-stop-lightning! (_type_ sound-spec vector) sound-id 18) ) ) diff --git a/goal_src/jak2/engine/gfx/mood/mood-tables.gc b/goal_src/jak2/engine/gfx/mood/mood-tables.gc index 0b6d33dbc6..c712c152f4 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-tables.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-tables.gc @@ -7,3 +7,861 @@ ;; DECOMP BEGINS +(define *no-cloud-haze-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 24.0 :z 64.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 44.7999 :z 57.5999 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +(define *no-cloud-clear-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 12.7999 :y 25.5999 :z 80.0 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 19.1999 :z 51.1999 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 44.7999 :z 57.5999 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +(define *no-cloud-smog-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 108.75 :y 87.5 :z 61.5 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 105.625 :y 100.3437 :z 84.5 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 105.625 :y 104.9648 :z 103.6445 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 105.625 :y 100.3437 :z 84.5 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 108.75 :y 90.0 :z 61.5 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 54.0 :y 62.0 :z 108.0 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 18.5625 :y 24.75 :z 37.125 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 38.5 :z 49.5 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +(define *overcast-fog-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 84.5625 :y 83.875 :z 80.7124 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 4.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 103.7812 :y 116.2734 :z 117.2343 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 4.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 108.9843 :y 116.25 :z 124.2421 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 4.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 103.7812 :y 116.2734 :z 117.2343 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 4.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 84.082 :y 84.7656 :z 79.5703 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 4.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 34.0 :y 40.0 :z 61.0 :w 128.0) + :fog-dists (new 'static 'vector :x 196608.0 :y 1024000.0 :z 196.0 :w 4.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 16.7343 :y 18.7031 :z 26.5781 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 8.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 18.75 :y 28.75 :z 33.75 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 8.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +(define *overcast-clear-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 136.0 :y 130.0 :z 160.0 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 134.0 :y 143.0 :z 176.0 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 125.4 :y 156.5999 :z 194.3999 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 134.0 :y 143.0 :z 176.0 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 136.0 :y 130.0 :z 160.0 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 23.68 :y 31.3599 :z 64.0 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 10.2399 :y 21.7599 :z 40.9599 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 11.5199 :y 38.3999 :z 46.0799 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +(define *overcast-rain-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 69.4938 :y 84.6425 :z 100.0708 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 77.0012 :y 108.5625 :z 126.4826 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 82.6313 :y 108.699 :z 132.716 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 77.0012 :y 108.5625 :z 126.4826 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 68.186 :y 85.1003 :z 99.9291 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 33.2822 :y 41.2822 :z 67.5448 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 2.0 :y 18.25 :z 26.5 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 2.4022 :y 24.8554 :z 29.6991 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +(define *storm-fog-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 51.4475 :y 60.0221 :z 72.8841 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 37.0013 :y 69.5625 :z 75.4827 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 46.6313 :y 70.6991 :z 76.7161 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 37.0013 :y 69.5625 :z 75.4827 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 56.1861 :y 62.1004 :z 73.9291 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 29.2823 :y 29.2823 :z 40.5449 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 2.0 :y 10.25 :z 18.5 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 2.4023 :y 15.8554 :z 19.6992 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +(define *storm-clear-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 115.0 :y 115.0 :z 110.0 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 122.5 :y 127.5 :z 127.5 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 127.5 :y 127.5 :z 127.5 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 122.5 :y 127.5 :z 127.5 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 110.0 :y 110.0 :z 105.0 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 90.0 :y 85.0 :z 90.0 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 12.0 :z 32.0 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 28.0 :z 36.0 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +(define *storm-rain-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 51.4475 :y 60.0221 :z 72.8841 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 37.0013 :y 69.5625 :z 75.4827 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 46.6313 :y 70.6991 :z 76.7161 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 37.0013 :y 69.5625 :z 75.4827 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 56.1861 :y 62.1004 :z 73.9291 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 29.2823 :y 29.2823 :z 40.5449 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 2.0 :y 10.25 :z 18.5 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 2.4023 :y 15.8554 :z 19.6992 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +(define *no-cloud-mood-color-table* + (new 'static 'mood-color-table :data (new 'static 'inline-array mood-color 8 + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.5092 :y 1.2699) + :amb-color (new 'static 'vector :x 0.498 :y 0.4406 :z 0.5777 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.6168 :y 1.4675 :z 1.0976) + :amb-color (new 'static 'vector :x 0.4199 :y 0.5195 :z 0.5976 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.8412 :y 1.685 :z 1.4374) + :amb-color (new 'static 'vector :x 0.4199 :y 0.5195 :z 0.5976 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.6168 :y 1.4675 :z 1.0976) + :amb-color (new 'static 'vector :x 0.4199 :y 0.5195 :z 0.5976 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.6464 :y 1.2601) + :amb-color (new 'static 'vector :x 0.3984 :y 0.4478 :z 0.5976 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.3312 :y 0.149 :z 0.5) + :amb-color (new 'static 'vector :x 0.2788 :y 0.3593 :z 0.498 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1097 :y 0.384 :z 0.8232) + :amb-color (new 'static 'vector :x 0.2695 :y 0.3143 :z 0.4492 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1 :y 0.5749 :z 0.4) + :amb-color (new 'static 'vector :x 0.239 :y 0.3386 :z 0.3984 :w 1.0) + ) + ) + ) + ) + +(define *overcast-mood-color-table* + (new 'static 'mood-color-table :data (new 'static 'inline-array mood-color 8 + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.3772 :y 0.3473 :z 0.1886) + :amb-color (new 'static 'vector :x 0.5378 :y 0.4605 :z 0.5976 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.4041 :y 0.3855 :z 0.3392) + :amb-color (new 'static 'vector :x 0.5087 :y 0.5639 :z 0.642 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.4602 :y 0.4407 :z 0.4098) + :amb-color (new 'static 'vector :x 0.5087 :y 0.5639 :z 0.642 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.4041 :y 0.3855 :z 0.3392) + :amb-color (new 'static 'vector :x 0.5087 :y 0.5639 :z 0.642 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.4115 :y 0.3633 :z 0.2057) + :amb-color (new 'static 'vector :x 0.4979 :y 0.4975 :z 0.6473 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1038 :y 0.0811 :z 0.125) + :amb-color (new 'static 'vector :x 0.3883 :y 0.414 :z 0.5527 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1166 :y 0.1508 :z 0.2057) + :amb-color (new 'static 'vector :x 0.3593 :y 0.3592 :z 0.4941 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.0843 :y 0.1437 :z 0.1218) + :amb-color (new 'static 'vector :x 0.3186 :y 0.3784 :z 0.4382 :w 1.0) + ) + ) + ) + ) + +(define *storm-mood-color-table* + (new 'static 'mood-color-table :data (new 'static 'inline-array mood-color 8 + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1509 :y 0.1449 :z 0.1131) + :amb-color (new 'static 'vector :x 0.3714 :y 0.3964 :z 0.4877 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1616 :y 0.1579 :z 0.1486) + :amb-color (new 'static 'vector :x 0.3684 :y 0.4604 :z 0.5124 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1841 :y 0.1802 :z 0.174) + :amb-color (new 'static 'vector :x 0.3684 :y 0.4604 :z 0.5124 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1616 :y 0.1579 :z 0.1486) + :amb-color (new 'static 'vector :x 0.3684 :y 0.4604 :z 0.5124 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1646 :y 0.1549 :z 0.1234) + :amb-color (new 'static 'vector :x 0.3648 :y 0.4145 :z 0.5142 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.0457 :y 0.0412 :z 0.0499) + :amb-color (new 'static 'vector :x 0.2951 :y 0.3406 :z 0.4329 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.0644 :y 0.0713 :z 0.0823) + :amb-color (new 'static 'vector :x 0.3593 :y 0.3592 :z 0.4941 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.0456 :y 0.0574 :z 0.0531) + :amb-color (new 'static 'vector :x 0.3186 :y 0.3784 :z 0.4382 :w 1.0) + ) + ) + ) + ) + +(define *no-cloud-mood-channel-group* + (new 'static 'mood-channel-group + :data (new 'static 'inline-array mood-channel 4 + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4) + (new 'static 'vector4 :y 0.2 :z 0.4 :w 1.0) + (new 'static 'vector4 :x 0.5 :y 0.25) + (new 'static 'vector4) + (new 'static 'vector4) + (new 'static 'vector4) + ) + ) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4 :x 0.8 :y 0.6 :z 0.4 :w 0.2) + (new 'static 'vector4) + (new 'static 'vector4 :x 0.5 :y 0.75 :z 1.0 :w 0.75) + (new 'static 'vector4 :x 0.5 :y 0.25) + (new 'static 'vector4 :w 0.75) + (new 'static 'vector4 :x 0.82 :y 0.88 :z 0.94 :w 1.0) + ) + ) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4 :x 0.2 :y 0.4 :z 0.6 :w 0.8) + (new 'static 'vector4 :x 1.0 :y 0.8 :z 0.6) + (new 'static 'vector4 :w 0.25) + (new 'static 'vector4 :x 0.5 :y 0.75 :z 1.0 :w 0.84) + (new 'static 'vector4 :x 0.67 :y 0.5) + (new 'static 'vector4) + ) + ) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4) + (new 'static 'vector4) + (new 'static 'vector4) + (new 'static 'vector4 :w 0.16) + (new 'static 'vector4 :x 0.33 :y 0.5 :z 1.0 :w 0.25) + (new 'static 'vector4 :x 0.18 :y 0.12 :z 0.06) + ) + ) + ) + ) + ) + +(define *overcast-mood-channel-group* + (new 'static 'mood-channel-group + :data (new 'static 'inline-array mood-channel 4 + (new 'static 'mood-channel) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4 :x 0.5 :y 0.42 :z 0.34 :w 0.25) + (new 'static 'vector4 :x 0.17 :y 0.08 :w 1.0) + (new 'static 'vector4 :x 0.9 :y 0.8 :z 0.7 :w 0.6) + (new 'static 'vector4 :x 0.5 :y 0.42 :z 0.34 :w 0.25) + (new 'static 'vector4 :x 0.17 :y 0.08 :w 1.0) + (new 'static 'vector4 :x 0.9 :y 0.8 :z 0.7 :w 0.6) + ) + ) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4 :x 0.5 :y 0.58 :z 0.66 :w 0.75) + (new 'static 'vector4 :x 0.83 :y 0.92 :z 1.0) + (new 'static 'vector4 :x 0.1 :y 0.2 :z 0.3 :w 0.4) + (new 'static 'vector4 :x 0.5 :y 0.58 :z 0.66 :w 0.75) + (new 'static 'vector4 :x 0.83 :y 0.92 :z 1.0) + (new 'static 'vector4 :x 0.1 :y 0.2 :z 0.3 :w 0.4) + ) + ) + (new 'static 'mood-channel) + ) + ) + ) + +(define *stormy-mood-channel-group* + (new 'static 'mood-channel-group + :data (new 'static 'inline-array mood-channel 4 + (new 'static 'mood-channel) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + ) + ) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + ) + ) + (new 'static 'mood-channel) + ) + ) + ) + +(define *clouds-000* (new 'static 'mood-clouds :cloud-min 1.0 :cloud-max 1.0)) + +(define *clouds-125* (new 'static 'mood-clouds :cloud-min 0.333 :cloud-max 1.0)) + +(define *clouds-250* (new 'static 'mood-clouds :cloud-min 0.333 :cloud-max 0.555)) + +(define *clouds-375* (new 'static 'mood-clouds :cloud-min 0.167 :cloud-max 0.605)) + +(define *clouds-500* (new 'static 'mood-clouds :cloud-max 0.655)) + +(define *clouds-625* (new 'static 'mood-clouds :cloud-max 0.605)) + +(define *clouds-750* (new 'static 'mood-clouds :cloud-max 0.555)) + +(define *clouds-875* (new 'static 'mood-clouds :cloud-max 0.505)) + +(define *clouds-1000* (new 'static 'mood-clouds :cloud-max 0.455)) + +(define *drill-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 41.6796 :y 52.6679 :z 72.75 :w 128.0) + :fog-dists (new 'static 'vector :y 2007040.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 53.7656 :y 72.6562 :z 93.0 :w 128.0) + :fog-dists (new 'static 'vector :y 2007040.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 59.0 :y 70.5 :z 89.0 :w 128.0) + :fog-dists (new 'static 'vector :y 2007040.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 50.5859 :y 72.2656 :z 92.5 :w 128.0) + :fog-dists (new 'static 'vector :y 2129920.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 40.8203 :y 51.582 :z 71.25 :w 128.0) + :fog-dists (new 'static 'vector :y 2007040.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 27.6093 :y 28.3359 :z 47.9531 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2007040.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 15.0 :z 25.0 :w 128.0) + :fog-dists (new 'static 'vector :y 2129920.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 23.0 :z 28.0 :w 128.0) + :fog-dists (new 'static 'vector :y 2129920.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +(define *drill-mood-color-table* + (new 'static 'mood-color-table :data (new 'static 'inline-array mood-color 8 + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.4153 :y 0.3906 :z 0.1171) + :amb-color (new 'static 'vector :x 0.3607 :y 0.4216 :z 0.5583 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.5676 :y 0.4026 :z 0.1406) + :amb-color (new 'static 'vector :x 0.25 :y 0.4483 :z 0.601 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.6106 :y 0.5588 :z 0.375) + :amb-color (new 'static 'vector :x 0.3729 :y 0.4561 :z 0.6127 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.5676 :y 0.3947 :z 0.1406) + :amb-color (new 'static 'vector :x 0.2518 :y 0.4404 :z 0.601 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.4114 :y 0.3166) + :amb-color (new 'static 'vector :x 0.3256 :y 0.4202 :z 0.5609 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.2082 :y 0.1115 :z 0.173) + :amb-color (new 'static 'vector :x 0.3416 :y 0.4248 :z 0.5776 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1516 :y 0.2634 :z 0.4248) + :amb-color (new 'static 'vector :x 0.2694 :y 0.3532 :z 0.449 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.0686 :y 0.2877 :z 0.2748) + :amb-color (new 'static 'vector :x 0.2388 :y 0.3384 :z 0.3982 :w 1.0) + ) + ) + ) + ) + +(define *drill-mood-direction-table* + (new 'static 'mood-direction-table :data (new 'static 'inline-array vector 4 + (new 'static 'vector :y 1.0) + (new 'static 'vector :y 1.0) + (new 'static 'vector :y 1.0) + (new 'static 'vector :y 1.0) + ) + ) + ) + +(define *mood-direction-table* + (new 'static 'mood-direction-table :data (new 'static 'inline-array vector 4 + (new 'static 'vector :x 0.906 :y 0.397 :z 0.143) + (new 'static 'vector :x 0.5 :y 0.814 :z 0.296) + (new 'static 'vector :x -0.5 :y 0.814 :z 0.296) + (new 'static 'vector :x -0.906 :y 0.397 :z 0.143) + ) + ) + ) + +(define *mood-sky-table* + (new 'static 'mood-sky-table :data (new 'static 'inline-array vector 8 + (new 'static 'vector :x 83.0 :y 103.0 :z 190.0 :w 128.0) + (new 'static 'vector :x 86.0 :y 108.0 :z 195.0 :w 128.0) + (new 'static 'vector :x 89.0 :y 113.0 :z 200.0 :w 128.0) + (new 'static 'vector :x 86.0 :y 108.0 :z 195.0 :w 128.0) + (new 'static 'vector :x 83.0 :y 103.0 :z 190.0 :w 128.0) + (new 'static 'vector :x 41.0 :y 64.0 :z 166.0 :w 128.0) + (new 'static 'vector :z 8.0 :w 128.0) + (new 'static 'vector :y 29.0 :z 33.0 :w 128.0) + ) + ) + ) + +(define *mood-interp-table* + (new 'static 'sky-color-day + :hour (new 'static 'inline-array sky-color-hour 24 + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.2 :morph-end 0.4) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.4 :morph-end 0.6) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.6 :morph-end 0.8) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.8 :morph-end 0.99) + (new 'static 'sky-color-hour :snapshot2 7 :morph-start 0.99 :morph-end 0.8) + (new 'static 'sky-color-hour :snapshot2 7 :morph-start 0.8 :morph-end 0.6) + (new 'static 'sky-color-hour :snapshot2 7 :morph-start 0.6) + (new 'static 'sky-color-hour :snapshot2 1 :morph-end 0.5) + (new 'static 'sky-color-hour :snapshot2 1 :morph-start 0.5 :morph-end 0.75) + (new 'static 'sky-color-hour :snapshot2 1 :morph-start 0.75 :morph-end 0.99) + (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 1 :morph-start 0.99 :morph-end 0.5) + (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 1 :morph-start 0.5) + (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 3 :morph-end 0.5) + (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 3 :morph-start 0.5 :morph-end 0.99) + (new 'static 'sky-color-hour :snapshot1 4 :snapshot2 3 :morph-start 0.99 :morph-end 0.84) + (new 'static 'sky-color-hour :snapshot1 4 :snapshot2 3 :morph-start 0.84 :morph-end 0.66) + (new 'static 'sky-color-hour :snapshot1 4 :snapshot2 3 :morph-start 0.66 :morph-end 0.5) + (new 'static 'sky-color-hour :snapshot1 4 :snapshot2 3 :morph-start 0.5) + (new 'static 'sky-color-hour :snapshot1 4 :snapshot2 5 :morph-end 0.99) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 5 :morph-start 0.99 :morph-end 0.75) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 5 :morph-start 0.75 :morph-end 0.5) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 5 :morph-start 0.5 :morph-end 0.25) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 5 :morph-start 0.25) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-end 0.2) + ) + ) + ) + +(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)) + (set! (-> arg0 mood-channel-group) (new 'global 'mood-channel-group)) + (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*)) + (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) + (mem-copy! (the-as pointer (-> arg0 mood-clouds)) (the-as pointer *clouds-250*) 8) + (set! (-> arg0 fogs 0) *no-cloud-haze-mood-fog-table*) + (set! (-> arg0 fogs 1) *no-cloud-clear-mood-fog-table*) + (set! (-> arg0 fogs 2) *no-cloud-smog-mood-fog-table*) + (set! (-> arg0 fogs 3) *overcast-fog-mood-fog-table*) + (set! (-> arg0 fogs 4) *overcast-clear-mood-fog-table*) + (set! (-> arg0 fogs 5) *overcast-rain-mood-fog-table*) + (set! (-> arg0 fogs 6) *storm-fog-mood-fog-table*) + (set! (-> arg0 fogs 7) *storm-clear-mood-fog-table*) + (set! (-> arg0 fogs 8) *storm-rain-mood-fog-table*) + (set! (-> arg0 colors 0) *no-cloud-mood-color-table*) + (set! (-> arg0 colors 1) *overcast-mood-color-table*) + (set! (-> arg0 colors 2) *storm-mood-color-table*) + (set! (-> arg0 channels 0) *no-cloud-mood-channel-group*) + (set! (-> arg0 channels 1) *overcast-mood-channel-group*) + (set! (-> arg0 channels 2) *stormy-mood-channel-group*) + (set! (-> arg0 clouds 0) *clouds-000*) + (set! (-> arg0 clouds 1) *clouds-125*) + (set! (-> arg0 clouds 2) *clouds-250*) + (set! (-> arg0 clouds 3) *clouds-375*) + (set! (-> arg0 clouds 4) *clouds-500*) + (set! (-> arg0 clouds 5) *clouds-625*) + (set! (-> arg0 clouds 6) *clouds-750*) + (set! (-> arg0 clouds 7) *clouds-875*) + (set! (-> arg0 clouds 8) *clouds-1000*) + (set! (-> arg0 current-interp cloud) 0.25) + (set! (-> arg0 current-interp fog) 0.5) + (set! (-> arg0 target-interp cloud) 0.25) + (set! (-> arg0 target-interp fog) 0.5) + (set! (-> arg0 speed-interp cloud) 0.0005555556) + (set! (-> arg0 speed-interp fog) 0.0005555556) + (set! (-> arg0 range min-cloud) 0.0) + (set! (-> arg0 range max-cloud) 1.0) + (set! (-> arg0 range min-fog) 0.0) + (set! (-> arg0 range max-fog) 1.0) + (set! (-> arg0 time-until-random cloud) 36000.0) + (set! (-> arg0 time-until-random-min cloud) 36000.0) + (set! (-> arg0 time-until-random-max cloud) 72000.0) + (set! (-> arg0 time-until-random fog) 216000.0) + (set! (-> arg0 time-until-random-min fog) 36000.0) + (set! (-> arg0 time-until-random-max fog) 72000.0) + (set! (-> arg0 overide cloud) 0.25) + (set! (-> arg0 overide fog) 0.0) + (set! (-> arg0 overide-weather-flag) (the-as basic #t)) + (set! (-> arg0 display-flag) #f) + (none) + ) + +(define *mood-control* (new 'static 'mood-control)) + +(init-mood-control *mood-control*) + + + + diff --git a/goal_src/jak2/engine/gfx/mood/mood-tables2.gc b/goal_src/jak2/engine/gfx/mood/mood-tables2.gc index 6c19d54511..9b61682884 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-tables2.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-tables2.gc @@ -7,3 +7,419 @@ ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +(define *overide-mood-color-table* + (new 'static 'mood-color-table :data (new 'static 'inline-array mood-color 8 + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.375 :y 1.157) + :amb-color (new 'static 'vector :x 0.625 :y 0.553 :z 0.725 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.473 :y 1.337 :z 1.0) + :amb-color (new 'static 'vector :x 0.527 :y 0.652 :z 0.75 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.473 :y 1.348 :z 1.15) + :amb-color (new 'static 'vector :x 0.527 :y 0.652 :z 0.75 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.473 :y 1.337 :z 1.0) + :amb-color (new 'static 'vector :x 0.527 :y 0.652 :z 0.75 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.5 :y 1.148) + :amb-color (new 'static 'vector :x 0.5 :y 0.562 :z 0.75 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.05 :y 0.149 :z 0.375) + :amb-color (new 'static 'vector :x 0.35 :y 0.451 :z 0.625 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1 :y 0.35 :z 0.5) + :amb-color (new 'static 'vector :x 0.3 :y 0.35 :z 0.5 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1 :y 0.575 :z 0.4) + :amb-color (new 'static 'vector :x 0.3 :y 0.425 :z 0.5 :w 1.0) + ) + ) + ) + ) + +(define *overide-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 24.0 :z 64.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 56.0 :z 72.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +(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*)) + (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) + ) + +(define *overide-table* (new 'static 'mood-table)) + +(init-overide-table *overide-table*) + +(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) + (mem-copy! + (the-as pointer (-> *overide-table* mood-color-table)) + (the-as pointer *overide-mood-color-table*) + 256 + ) + (dotimes (v1-2 8) + (vector-float*! + (the-as vector (-> *overide-table* mood-fog-table data v1-2)) + (the-as vector (-> *overide-table* mood-fog-table data v1-2)) + (-> *overide-table* mood-fog-table data v1-2 fog-color w) + ) + (vector-float*! + (the-as vector (-> *overide-table* mood-color-table data v1-2)) + (the-as vector (-> *overide-table* mood-color-table data v1-2)) + (-> *overide-table* mood-color-table data v1-2 lgt-color w) + ) + (vector-float*! + (the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* v1-2 32))) + (the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* v1-2 32))) + (-> *overide-table* mood-color-table data v1-2 amb-color w) + ) + (set! (-> *overide-table* mood-fog-table data v1-2 fog-color w) 128.0) + (set! (-> *overide-table* mood-color-table data v1-2 lgt-color w) 0.0) + (set! (-> *overide-table* mood-color-table data v1-2 amb-color w) 1.0) + ) + (format 0 "(define *overide-mood-color-table*~%") + (format 0 " (new 'static 'mood-color-table~%") + (format 0 " :data (new 'static 'inline-array 'mood-color 0~%") + (dotimes (gp-0 8) + (format 0 " (new 'static 'mood-color") + (let ((v1-5 gp-0)) + (cond + ((zero? v1-5) + (format 0 " ; sun rise~%") + ) + ((= v1-5 1) + (format 0 " ; morning~%") + ) + ((= v1-5 2) + (format 0 " ; noon~%") + ) + ((= v1-5 3) + (format 0 " ; afternoon~%") + ) + ((= v1-5 4) + (format 0 " ; sunset~%") + ) + ((= v1-5 5) + (format 0 " ; twilight~%") + ) + ((= v1-5 6) + (format 0 " ; evening~%") + ) + ((= v1-5 7) + (format 0 " ; green sun~%") + ) + ) + ) + (format + 0 + " :lgt-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" + (-> *overide-table* mood-color-table data gp-0 lgt-color x) + (-> *overide-table* mood-color-table data gp-0 lgt-color y) + (-> *overide-table* mood-color-table data gp-0 lgt-color z) + (-> *overide-table* mood-color-table data gp-0 lgt-color w) + ) + (format + 0 + " :amb-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" + (-> *overide-table* mood-color-table data gp-0 amb-color x) + (-> *overide-table* mood-color-table data gp-0 amb-color y) + (-> *overide-table* mood-color-table data gp-0 amb-color z) + (-> *overide-table* mood-color-table data gp-0 amb-color w) + ) + (format 0 " )~%") + ) + (format 0 " )~%") + (format 0 " )~%") + (format 0 " )~%") + (format 0 "(define *overide-mood-fog-table*~%") + (format 0 " (new 'static 'mood-fog-table~%") + (format 0 " :data (new 'static 'inline-array 'mood-fog 0~%") + (dotimes (gp-1 8) + (format 0 " (new 'static 'mood-fog") + (let ((v1-33 gp-1)) + (cond + ((zero? v1-33) + (format 0 " ; sun rise~%") + ) + ((= v1-33 1) + (format 0 " ; morning~%") + ) + ((= v1-33 2) + (format 0 " ; noon~%") + ) + ((= v1-33 3) + (format 0 " ; afternoon~%") + ) + ((= v1-33 4) + (format 0 " ; sunset~%") + ) + ((= v1-33 5) + (format 0 " ; twilight~%") + ) + ((= v1-33 6) + (format 0 " ; evening~%") + ) + ((= v1-33 7) + (format 0 " ; green sun~%") + ) + ) + ) + (format + 0 + " :fog-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" + (-> *overide-table* mood-fog-table data gp-1 fog-color x) + (-> *overide-table* mood-fog-table data gp-1 fog-color y) + (-> *overide-table* mood-fog-table data gp-1 fog-color z) + (-> *overide-table* mood-fog-table data gp-1 fog-color w) + ) + (format + 0 + " :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%" + (-> *overide-table* mood-fog-table data gp-1 fog-dists x) + (-> *overide-table* mood-fog-table data gp-1 fog-dists y) + (-> *overide-table* mood-fog-table data gp-1 fog-dists w) + (-> *overide-table* mood-fog-table data gp-1 fog-dists z) + ) + (format 0 " :erase-color (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 128.0)~%") + (format 0 " )~%") + ) + (format 0 " )~%") + (format 0 " )~%") + (format 0 " )~%") + (format 0 "(define *overide-table* (new 'static 'mood-table))~%") + (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*]]" + (mem-copy! + (the-as pointer (-> *overide-table* mood-color-table)) + (the-as pointer *no-cloud-mood-color-table*) + 256 + ) + (dotimes (v1-1 8) + (let ((a1-3 (-> *overide-table* mood-color-table data v1-1)) + (mood-colors + (the-as + (inline-array mood-color) + (-> (the-as (inline-array mood-color) (-> *overide-table* mood-color-table data 0 amb-color)) v1-1) + ) + ) + ) + (let ((f1-2 (fmax (fmax (-> a1-3 lgt-color x) (-> a1-3 lgt-color y)) (-> a1-3 lgt-color z))) + (f0-4 + (fmax (fmax (-> mood-colors 0 lgt-color x) (-> mood-colors 0 lgt-color y)) (-> mood-colors 0 lgt-color z)) + ) + ) + (set! (-> a1-3 lgt-color x) (* (+ (-> a1-3 lgt-color x) (* (- f1-2 (-> a1-3 lgt-color x)) arg0)) arg1)) + (set! (-> a1-3 lgt-color y) (* (+ (-> a1-3 lgt-color y) (* (- f1-2 (-> a1-3 lgt-color y)) arg0)) arg1)) + (set! (-> a1-3 lgt-color z) (* (+ (-> a1-3 lgt-color z) (* (- f1-2 (-> a1-3 lgt-color z)) arg0)) arg1)) + (set! (-> a1-3 lgt-color w) 0.0) + (set! (-> mood-colors 0 lgt-color x) + (* (+ (-> mood-colors 0 lgt-color x) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2) + ) + (set! (-> mood-colors 0 lgt-color y) + (* (+ (-> mood-colors 0 lgt-color y) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2) + ) + (set! (-> mood-colors 0 lgt-color z) + (* (+ (-> mood-colors 0 lgt-color z) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2) + ) + ) + (set! (-> mood-colors 0 lgt-color w) 1.0) + ) + ) + (format 0 "(define *overide-mood-color-table*~%") + (format 0 " (new 'static 'mood-color-table~%") + (format 0 " :data (new 'static 'inline-array 'mood-color 0~%") + (dotimes (gp-1 8) + (format 0 " (new 'static 'mood-color") + (let ((v1-4 gp-1)) + (cond + ((zero? v1-4) + (format 0 " ; sun rise~%") + ) + ((= v1-4 1) + (format 0 " ; morning~%") + ) + ((= v1-4 2) + (format 0 " ; noon~%") + ) + ((= v1-4 3) + (format 0 " ; afternoon~%") + ) + ((= v1-4 4) + (format 0 " ; sunset~%") + ) + ((= v1-4 5) + (format 0 " ; twilight~%") + ) + ((= v1-4 6) + (format 0 " ; evening~%") + ) + ((= v1-4 7) + (format 0 " ; green sun~%") + ) + ) + ) + (format + 0 + " :lgt-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" + (-> *overide-table* mood-color-table data gp-1 lgt-color x) + (-> *overide-table* mood-color-table data gp-1 lgt-color y) + (-> *overide-table* mood-color-table data gp-1 lgt-color z) + (-> *overide-table* mood-color-table data gp-1 lgt-color w) + ) + (format + 0 + " :amb-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" + (-> *overide-table* mood-color-table data gp-1 amb-color x) + (-> *overide-table* mood-color-table data gp-1 amb-color y) + (-> *overide-table* mood-color-table data gp-1 amb-color z) + (-> *overide-table* mood-color-table data gp-1 amb-color w) + ) + (format 0 " )~%") + ) + (format 0 " )~%") + (format 0 " )~%") + (format 0 " )~%") + (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*]]" + (mem-copy! (the-as pointer (-> *overide-table* mood-fog-table)) arg0 384) + (dotimes (v1-2 8) + (let ((a0-5 (-> *overide-table* mood-fog-table data v1-2))) + (let ((f0-2 (fmax (fmax (-> a0-5 fog-color x) (-> a0-5 fog-color y)) (-> a0-5 fog-color z)))) + (set! (-> a0-5 fog-color x) (* (+ (-> a0-5 fog-color x) (* (- f0-2 (-> a0-5 fog-color x)) arg1)) arg2)) + (set! (-> a0-5 fog-color y) (* (+ (-> a0-5 fog-color y) (* (- f0-2 (-> a0-5 fog-color y)) arg1)) arg2)) + (set! (-> a0-5 fog-color z) (* (+ (-> a0-5 fog-color z) (* (- f0-2 (-> a0-5 fog-color z)) arg1)) arg2)) + ) + (set! (-> a0-5 fog-color w) 1.0) + ) + ) + (format 0 "(define *overide-mood-fog-table*~%") + (format 0 " (new 'static 'mood-fog-table~%") + (format 0 " :data (new 'static 'inline-array 'mood-fog 0~%") + (dotimes (gp-1 8) + (format 0 " (new 'static 'mood-fog") + (let ((v1-5 gp-1)) + (cond + ((zero? v1-5) + (format 0 " ; sun rise~%") + ) + ((= v1-5 1) + (format 0 " ; morning~%") + ) + ((= v1-5 2) + (format 0 " ; noon~%") + ) + ((= v1-5 3) + (format 0 " ; afternoon~%") + ) + ((= v1-5 4) + (format 0 " ; sunset~%") + ) + ((= v1-5 5) + (format 0 " ; twilight~%") + ) + ((= v1-5 6) + (format 0 " ; evening~%") + ) + ((= v1-5 7) + (format 0 " ; green sun~%") + ) + ) + ) + (format + 0 + " :fog-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" + (-> *overide-table* mood-fog-table data gp-1 fog-color x) + (-> *overide-table* mood-fog-table data gp-1 fog-color y) + (-> *overide-table* mood-fog-table data gp-1 fog-color z) + (-> *overide-table* mood-fog-table data gp-1 fog-color w) + ) + (format + 0 + " :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%" + (* 0.00024414062 (-> *overide-table* mood-fog-table data gp-1 fog-dists x)) + (* 0.00024414062 (-> *overide-table* mood-fog-table data gp-1 fog-dists y)) + (-> *overide-table* mood-fog-table data gp-1 fog-dists w) + (-> *overide-table* mood-fog-table data gp-1 fog-dists z) + ) + (format 0 " :erase-color (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 128.0)~%") + (format 0 " )~%") + ) + (format 0 " )~%") + (format 0 " )~%") + (format 0 " )~%") + (none) + ) + +) + + + diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc index b3bbe76a9f..fb14b722cf 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc @@ -179,8 +179,8 @@ :size-assert #x10 :flag-assert #xb00000010 (:methods - (sparticle-launcher-method-9 () none 9) - (sparticle-launcher-method-10 () none 10) + (sparticle-launcher-method-9 (_type_ int) uint 9) + (sparticle-launcher-method-10 (_type_) none 10) ) ) diff --git a/goal_src/jak2/engine/level/bsp-h.gc b/goal_src/jak2/engine/level/bsp-h.gc index 2eea355da1..d107bf2acd 100644 --- a/goal_src/jak2/engine/level/bsp-h.gc +++ b/goal_src/jak2/engine/level/bsp-h.gc @@ -48,6 +48,7 @@ (level level :offset-assert 124) (unk-data-2 uint16 9 :offset 130) (unk-byte uint8 :offset 152) + (ambients symbol :offset-assert 156) (unk-data-4 float :offset 160) (unk-data-5 float :offset-assert 164) (race-meshes (array entity-race-mesh) :offset 168) diff --git a/goal_src/jak2/engine/level/level-h.gc b/goal_src/jak2/engine/level/level-h.gc index e965e36304..5ee0c35b95 100644 --- a/goal_src/jak2/engine/level/level-h.gc +++ b/goal_src/jak2/engine/level/level-h.gc @@ -442,39 +442,41 @@ ) (deftype level-group (basic) - ((length int32 :offset-assert 4) - (log-in-level-bsp bsp-header :offset-assert 8) - (loading-level level :offset-assert 12) - (entity-link entity-links :offset 16) - (border? symbol :offset-assert 20) - (vis? symbol :offset-assert 24) - (want-level basic :offset-assert 28) - (receiving-level basic :offset-assert 32) - (load-commands pair :offset-assert 36) - (play? symbol :offset-assert 40) - (target-pos vector 2 :inline :offset-assert 48) - (camera-pos vector 2 :inline :offset-assert 80) - (heap kheap :inline :offset-assert 112) - (sound-bank basic 4 :offset-assert 128) - (disk-load-timing? symbol :offset-assert 144) - (load-level basic :offset-assert 148) - (load-size uint32 :offset-assert 152) - (load-time float :offset-assert 156) - (load-login-time float :offset-assert 160) - (draw-level-count int32 :offset-assert 164) - (draw-level basic 7 :offset-assert 168) - (draw-index-map uint8 7 :offset-assert 196) - (load-order uint64 :offset-assert 208) - (pad uint8 30 :offset-assert 216) - (level level 7 :inline :offset-assert 256) - (level0 level :inline :offset 256) - (level1 level :inline :offset 5488) - (level2 level :inline :offset 10720) - (level3 level :inline :offset 15952) - (level4 level :inline :offset 21184) - (level5 level :inline :offset 26416) - (default-level level :inline :offset 31648) - (pad2 uint8 4 :offset-assert 36880) + ((length int32 :offset-assert 4) + (log-in-level-bsp bsp-header :offset-assert 8) + (loading-level level :offset-assert 12) + (entity-link entity-links :offset 16) + (border? symbol :offset-assert 20) + (vis? symbol :offset-assert 24) + (want-level basic :offset-assert 28) + (receiving-level basic :offset-assert 32) + (load-commands pair :offset-assert 36) + (play? symbol :offset-assert 40) + (target-pos vector 2 :inline :offset-assert 48) + (camera-pos vector 2 :inline :offset-assert 80) + (heap kheap :inline :offset-assert 112) + (sound-bank basic 4 :offset-assert 128) + (disk-load-timing? symbol :offset-assert 144) + (load-level basic :offset-assert 148) + (load-size uint32 :offset-assert 152) + (load-time float :offset-assert 156) + (load-login-time float :offset-assert 160) + (draw-level-count int32 :offset-assert 164) + (draw-level basic 7 :offset-assert 168) + (draw-index-map uint8 7 :offset-assert 196) + (load-order uint64 :offset-assert 208) + (pad uint8 30 :offset-assert 216) + (level level 7 :inline :offset-assert 256) + (level0 level :inline :offset 256) + (level1 level :inline :offset 5488) + (level2 level :inline :offset 10720) + (level3 level :inline :offset 15952) + (level4 level :inline :offset 21184) + (level5 level :inline :offset 26416) + (default-level level :inline :offset 31648) + (unknown-inline-vec-01 (inline-array vector) :offset 32064) + (unknown-inline-vec-02 (inline-array vector) :offset 33712) + (pad2 uint8 4 :offset-assert 36880) ) :method-count-assert 31 :size-assert #x9014 diff --git a/goal_src/jak2/engine/math/vector.gc b/goal_src/jak2/engine/math/vector.gc index 5faea9332c..d196bc0c99 100644 --- a/goal_src/jak2/engine/math/vector.gc +++ b/goal_src/jak2/engine/math/vector.gc @@ -1651,7 +1651,7 @@ (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) ) - (none) + #f ) (defun spheres-overlap? ((arg0 sphere) (arg1 sphere)) diff --git a/scripts/tasks/extract-zip.py b/scripts/tasks/extract-zip.py new file mode 100644 index 0000000000..a0a9f743c8 --- /dev/null +++ b/scripts/tasks/extract-zip.py @@ -0,0 +1,10 @@ +import argparse +import zipfile + +parser = argparse.ArgumentParser() +parser.add_argument("--file") +parser.add_argument("--out") +args = parser.parse_args() + +with zipfile.ZipFile(args.file, 'r') as p2s: + p2s.extractall(args.out) diff --git a/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc new file mode 100644 index 0000000000..226e84e4aa --- /dev/null +++ b/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc @@ -0,0 +1,152 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type plane-volume +(deftype plane-volume (structure) + ((volume-type symbol :offset-assert 0) + (point-count int16 :offset-assert 4) + (normal-count int16 :offset-assert 6) + (first-point (pointer vector) :offset-assert 8) + (first-normal (pointer vector) :offset-assert 12) + (num-planes int32 :offset-assert 16) + (plane (inline-array plane) :offset-assert 20) + ) + :pack-me + :method-count-assert 12 + :size-assert #x18 + :flag-assert #xc00000018 + (:methods + (plane-volume-method-9 () none 9) + (plane-volume-method-10 () none 10) + (plane-volume-method-11 () none 11) + ) + ) + +;; definition for method 3 of type plane-volume +(defmethod inspect plane-volume ((obj plane-volume)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'plane-volume) + (format #t "~1Tvolume-type: ~A~%" (-> obj volume-type)) + (format #t "~1Tpoint-count: ~D~%" (-> obj point-count)) + (format #t "~1Tnormal-count: ~D~%" (-> obj normal-count)) + (format #t "~1Tfirst-point: #~%" (-> obj first-point)) + (format #t "~1Tfirst-normal: #~%" (-> obj first-normal)) + (format #t "~1Tnum-planes: ~D~%" (-> obj num-planes)) + (format #t "~1Tplane: #x~X~%" (-> obj plane)) + (label cfg-4) + obj + ) + +;; definition of type vol-control +(deftype vol-control (basic) + ((flags vol-flags :offset-assert 4) + (process process-drawable :offset-assert 8) + (pos-vol-count int32 :offset-assert 12) + (pos-vol plane-volume 32 :inline :offset-assert 16) + (neg-vol-count int32 :offset-assert 784) + (neg-vol plane-volume 32 :inline :offset-assert 788) + (debug-point vector-array :offset-assert 1556) + (debug-normal vector-array :offset-assert 1560) + ) + :method-count-assert 12 + :size-assert #x61c + :flag-assert #xc0000061c + (:methods + (new (symbol type process-drawable) _type_ 0) + (vol-control-method-9 (_type_) symbol 9) + (vol-control-method-10 (_type_ vector) symbol 10) + (should-display? (_type_) symbol 11) + ) + ) + +;; definition for method 3 of type vol-control +(defmethod inspect vol-control ((obj vol-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tflags: #x~X~%" (-> obj flags)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Tpos-vol-count: ~D~%" (-> obj pos-vol-count)) + (format #t "~1Tpos-vol[32] @ #x~X~%" (-> obj pos-vol)) + (format #t "~1Tneg-vol-count: ~D~%" (-> obj neg-vol-count)) + (format #t "~1Tneg-vol[32] @ #x~X~%" (-> obj neg-vol)) + (format #t "~1Tdebug-point: ~A~%" (-> obj debug-point)) + (format #t "~1Tdebug-normal: ~A~%" (-> obj debug-normal)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type vol-control +;; INFO: Used lq/sq +;; INFO: 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)) + (go process-drawable-art-error "memory") + (set! gp-0 0) + (goto cfg-13) + ) + (set! (-> (the-as vol-control gp-0) process) arg0) + (let* ((s5-1 (-> (the-as vol-control gp-0) process entity)) + (s4-0 (-> ((method-of-type res-lump lookup-tag-idx) s5-1 'vol 'base -1000000000.0) lo)) + ) + (when (>= (the-as int s4-0) 0) + (let ((s3-0 (the-as int s4-0)) + (s2-0 (-> s5-1 tag s4-0)) + ) + 0 + (while (= (-> s2-0 name) (-> s5-1 tag s4-0 name)) + (let ((v1-12 (make-property-data s5-1 0.0 (the-as res-tag-pair s3-0) (the-as pointer #f))) + (a0-8 (-> (the-as vol-control gp-0) pos-vol (-> (the-as vol-control gp-0) pos-vol-count))) + ) + (set! (-> a0-8 num-planes) (the-as int (-> s2-0 elt-count))) + (set! (-> a0-8 plane) (the-as (inline-array plane) v1-12)) + ) + (+! (-> (the-as vol-control gp-0) pos-vol-count) 1) + (+! s3-0 1) + (set! s2-0 (-> s5-1 tag s3-0)) + ) + ) + ) + ) + (let* ((s5-2 (-> (the-as vol-control gp-0) process entity)) + (s4-1 (-> ((method-of-type res-lump lookup-tag-idx) s5-2 'cutoutvol 'base -1000000000.0) lo)) + ) + (when (>= (the-as int s4-1) 0) + (let ((s3-1 (the-as int s4-1)) + (s2-1 (-> s5-2 tag s4-1)) + ) + 0 + (while (= (-> s2-1 name) (-> s5-2 tag s4-1 name)) + (let ((v1-31 (make-property-data s5-2 0.0 (the-as res-tag-pair s3-1) (the-as pointer #f))) + (a0-19 (-> (the-as vol-control gp-0) neg-vol (-> (the-as vol-control gp-0) neg-vol-count))) + ) + (set! (-> a0-19 num-planes) (the-as int (-> s2-1 elt-count))) + (set! (-> a0-19 plane) (the-as (inline-array plane) v1-31)) + ) + (+! (-> (the-as vol-control gp-0) neg-vol-count) 1) + (+! s3-1 1) + (set! s2-1 (-> s5-2 tag s3-1)) + ) + ) + ) + ) + (label cfg-13) + (the-as vol-control gp-0) + ) + ) + +;; definition for method 11 of type vol-control +(defmethod should-display? vol-control ((obj vol-control)) + "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/mood/mood-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc index a31d6d8597..8bdbcec704 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 @@ -18,8 +18,8 @@ (goto cfg-4) ) (format #t "[~8x] ~A~%" obj 'mood-channel) - (format #t "~1Tdata[24] @ #x~X~%" (-> obj data)) - (format #t "~1Tvecs[6] @ #x~X~%" (-> obj data)) + (format #t "~1Tdata[24] @ #x~X~%" (-> obj vecs)) + (format #t "~1Tvecs[6] @ #x~X~%" (-> obj vecs)) (label cfg-4) obj ) @@ -498,47 +498,47 @@ ;; definition of type mood-control (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 basic :offset-assert 104) - (overide-weather-flag basic :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 uint32 :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 9 :offset-assert 164) - (colors mood-color 3 :offset-assert 200) - (channels mood-channel 3 :offset-assert 212) - (clouds mood-clouds 9 :offset-assert 224) + ((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 basic :offset-assert 104) + (overide-weather-flag basic :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) ) :method-count-assert 19 :size-assert #x104 :flag-assert #x1300000104 (:methods - (mood-control-method-9 () none 9) - (mood-control-method-10 () none 10) - (mood-control-method-11 () none 11) - (mood-control-method-12 () none 12) - (mood-control-method-13 () none 13) - (mood-control-method-14 () none 14) - (mood-control-method-15 () none 15) - (mood-control-method-16 () none 16) - (mood-control-method-17 () none 17) - (mood-control-method-18 () none 18) + (init-weather! (_type_) none :behavior process 9) + (update-mood-weather! (_type_ float float float float) none 10) + (update-mood-range! (_type_ float float float float) none 11) + (set-time-for-random-weather! (_type_ float float) none 12) + (apply-mood-clouds-and-fog (_type_ mood-control-work) none 13) + (apply-mood-color (_type_ mood-control-work) none 14) + (apply-mood-channels (_type_ mood-control-work) none 15) + (adjust-num-clouds! (_type_ mood-control-work) none 16) + (gen-lightning-and-thunder! (_type_) number 17) + (play-or-stop-lightning! (_type_ sound-spec vector) sound-id 18) ) ) @@ -587,7 +587,3 @@ ;; failed to figure out what this is: 0 - - - - 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 new file mode 100644 index 0000000000..7445566a50 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables2_REF.gc @@ -0,0 +1,428 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +;; definition for symbol *overide-mood-color-table*, type mood-color-table +(define *overide-mood-color-table* + (new 'static 'mood-color-table :data (new 'static 'inline-array mood-color 8 + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.375 :y 1.157) + :amb-color (new 'static 'vector :x 0.625 :y 0.553 :z 0.725 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.473 :y 1.337 :z 1.0) + :amb-color (new 'static 'vector :x 0.527 :y 0.652 :z 0.75 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.473 :y 1.348 :z 1.15) + :amb-color (new 'static 'vector :x 0.527 :y 0.652 :z 0.75 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.473 :y 1.337 :z 1.0) + :amb-color (new 'static 'vector :x 0.527 :y 0.652 :z 0.75 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.5 :y 1.148) + :amb-color (new 'static 'vector :x 0.5 :y 0.562 :z 0.75 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.05 :y 0.149 :z 0.375) + :amb-color (new 'static 'vector :x 0.35 :y 0.451 :z 0.625 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1 :y 0.35 :z 0.5) + :amb-color (new 'static 'vector :x 0.3 :y 0.35 :z 0.5 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1 :y 0.575 :z 0.4) + :amb-color (new 'static 'vector :x 0.3 :y 0.425 :z 0.5 :w 1.0) + ) + ) + ) + ) + +;; definition for symbol *overide-mood-fog-table*, type mood-fog-table +(define *overide-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 24.0 :z 64.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 56.0 :z 72.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 3690496.0 :z 255.0 :w 64.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +;; definition for function init-overide-table +;; INFO: 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*)) + (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) + ) + +;; definition for symbol *overide-table*, type mood-table +(define *overide-table* (new 'static 'mood-table)) + +;; failed to figure out what this is: +(init-overide-table *overide-table*) + +;; definition for function print-mood-tables +;; INFO: 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) + (mem-copy! + (the-as pointer (-> *overide-table* mood-color-table)) + (the-as pointer *overide-mood-color-table*) + 256 + ) + (dotimes (v1-2 8) + (vector-float*! + (the-as vector (-> *overide-table* mood-fog-table data v1-2)) + (the-as vector (-> *overide-table* mood-fog-table data v1-2)) + (-> *overide-table* mood-fog-table data v1-2 fog-color w) + ) + (vector-float*! + (the-as vector (-> *overide-table* mood-color-table data v1-2)) + (the-as vector (-> *overide-table* mood-color-table data v1-2)) + (-> *overide-table* mood-color-table data v1-2 lgt-color w) + ) + (vector-float*! + (the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* v1-2 32))) + (the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* v1-2 32))) + (-> *overide-table* mood-color-table data v1-2 amb-color w) + ) + (set! (-> *overide-table* mood-fog-table data v1-2 fog-color w) 128.0) + (set! (-> *overide-table* mood-color-table data v1-2 lgt-color w) 0.0) + (set! (-> *overide-table* mood-color-table data v1-2 amb-color w) 1.0) + ) + (format 0 "(define *overide-mood-color-table*~%") + (format 0 " (new 'static 'mood-color-table~%") + (format 0 " :data (new 'static 'inline-array 'mood-color 0~%") + (dotimes (gp-0 8) + (format 0 " (new 'static 'mood-color") + (let ((v1-5 gp-0)) + (cond + ((zero? v1-5) + (format 0 " ; sun rise~%") + ) + ((= v1-5 1) + (format 0 " ; morning~%") + ) + ((= v1-5 2) + (format 0 " ; noon~%") + ) + ((= v1-5 3) + (format 0 " ; afternoon~%") + ) + ((= v1-5 4) + (format 0 " ; sunset~%") + ) + ((= v1-5 5) + (format 0 " ; twilight~%") + ) + ((= v1-5 6) + (format 0 " ; evening~%") + ) + ((= v1-5 7) + (format 0 " ; green sun~%") + ) + ) + ) + (format + 0 + " :lgt-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" + (-> *overide-table* mood-color-table data gp-0 lgt-color x) + (-> *overide-table* mood-color-table data gp-0 lgt-color y) + (-> *overide-table* mood-color-table data gp-0 lgt-color z) + (-> *overide-table* mood-color-table data gp-0 lgt-color w) + ) + (format + 0 + " :amb-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" + (-> *overide-table* mood-color-table data gp-0 amb-color x) + (-> *overide-table* mood-color-table data gp-0 amb-color y) + (-> *overide-table* mood-color-table data gp-0 amb-color z) + (-> *overide-table* mood-color-table data gp-0 amb-color w) + ) + (format 0 " )~%") + ) + (format 0 " )~%") + (format 0 " )~%") + (format 0 " )~%") + (format 0 "(define *overide-mood-fog-table*~%") + (format 0 " (new 'static 'mood-fog-table~%") + (format 0 " :data (new 'static 'inline-array 'mood-fog 0~%") + (dotimes (gp-1 8) + (format 0 " (new 'static 'mood-fog") + (let ((v1-33 gp-1)) + (cond + ((zero? v1-33) + (format 0 " ; sun rise~%") + ) + ((= v1-33 1) + (format 0 " ; morning~%") + ) + ((= v1-33 2) + (format 0 " ; noon~%") + ) + ((= v1-33 3) + (format 0 " ; afternoon~%") + ) + ((= v1-33 4) + (format 0 " ; sunset~%") + ) + ((= v1-33 5) + (format 0 " ; twilight~%") + ) + ((= v1-33 6) + (format 0 " ; evening~%") + ) + ((= v1-33 7) + (format 0 " ; green sun~%") + ) + ) + ) + (format + 0 + " :fog-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" + (-> *overide-table* mood-fog-table data gp-1 fog-color x) + (-> *overide-table* mood-fog-table data gp-1 fog-color y) + (-> *overide-table* mood-fog-table data gp-1 fog-color z) + (-> *overide-table* mood-fog-table data gp-1 fog-color w) + ) + (format + 0 + " :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%" + (-> *overide-table* mood-fog-table data gp-1 fog-dists x) + (-> *overide-table* mood-fog-table data gp-1 fog-dists y) + (-> *overide-table* mood-fog-table data gp-1 fog-dists w) + (-> *overide-table* mood-fog-table data gp-1 fog-dists z) + ) + (format 0 " :erase-color (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 128.0)~%") + (format 0 " )~%") + ) + (format 0 " )~%") + (format 0 " )~%") + (format 0 " )~%") + (format 0 "(define *overide-table* (new 'static 'mood-table))~%") + (none) + ) + +;; definition for function desaturate-mood-colors +;; INFO: 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*]]" + (mem-copy! + (the-as pointer (-> *overide-table* mood-color-table)) + (the-as pointer *no-cloud-mood-color-table*) + 256 + ) + (dotimes (v1-1 8) + (let ((a1-3 (-> *overide-table* mood-color-table data v1-1)) + (mood-colors + (the-as + (inline-array mood-color) + (-> (the-as (inline-array mood-color) (-> *overide-table* mood-color-table data 0 amb-color)) v1-1) + ) + ) + ) + (let ((f1-2 (fmax (fmax (-> a1-3 lgt-color x) (-> a1-3 lgt-color y)) (-> a1-3 lgt-color z))) + (f0-4 + (fmax (fmax (-> mood-colors 0 lgt-color x) (-> mood-colors 0 lgt-color y)) (-> mood-colors 0 lgt-color z)) + ) + ) + (set! (-> a1-3 lgt-color x) (* (+ (-> a1-3 lgt-color x) (* (- f1-2 (-> a1-3 lgt-color x)) arg0)) arg1)) + (set! (-> a1-3 lgt-color y) (* (+ (-> a1-3 lgt-color y) (* (- f1-2 (-> a1-3 lgt-color y)) arg0)) arg1)) + (set! (-> a1-3 lgt-color z) (* (+ (-> a1-3 lgt-color z) (* (- f1-2 (-> a1-3 lgt-color z)) arg0)) arg1)) + (set! (-> a1-3 lgt-color w) 0.0) + (set! (-> mood-colors 0 lgt-color x) + (* (+ (-> mood-colors 0 lgt-color x) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2) + ) + (set! (-> mood-colors 0 lgt-color y) + (* (+ (-> mood-colors 0 lgt-color y) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2) + ) + (set! (-> mood-colors 0 lgt-color z) + (* (+ (-> mood-colors 0 lgt-color z) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2) + ) + ) + (set! (-> mood-colors 0 lgt-color w) 1.0) + ) + ) + (format 0 "(define *overide-mood-color-table*~%") + (format 0 " (new 'static 'mood-color-table~%") + (format 0 " :data (new 'static 'inline-array 'mood-color 0~%") + (dotimes (gp-1 8) + (format 0 " (new 'static 'mood-color") + (let ((v1-4 gp-1)) + (cond + ((zero? v1-4) + (format 0 " ; sun rise~%") + ) + ((= v1-4 1) + (format 0 " ; morning~%") + ) + ((= v1-4 2) + (format 0 " ; noon~%") + ) + ((= v1-4 3) + (format 0 " ; afternoon~%") + ) + ((= v1-4 4) + (format 0 " ; sunset~%") + ) + ((= v1-4 5) + (format 0 " ; twilight~%") + ) + ((= v1-4 6) + (format 0 " ; evening~%") + ) + ((= v1-4 7) + (format 0 " ; green sun~%") + ) + ) + ) + (format + 0 + " :lgt-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" + (-> *overide-table* mood-color-table data gp-1 lgt-color x) + (-> *overide-table* mood-color-table data gp-1 lgt-color y) + (-> *overide-table* mood-color-table data gp-1 lgt-color z) + (-> *overide-table* mood-color-table data gp-1 lgt-color w) + ) + (format + 0 + " :amb-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" + (-> *overide-table* mood-color-table data gp-1 amb-color x) + (-> *overide-table* mood-color-table data gp-1 amb-color y) + (-> *overide-table* mood-color-table data gp-1 amb-color z) + (-> *overide-table* mood-color-table data gp-1 amb-color w) + ) + (format 0 " )~%") + ) + (format 0 " )~%") + (format 0 " )~%") + (format 0 " )~%") + (none) + ) + +;; definition for function desaturate-mood-fog +;; INFO: 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*]]" + (mem-copy! (the-as pointer (-> *overide-table* mood-fog-table)) arg0 384) + (dotimes (v1-2 8) + (let ((a0-5 (-> *overide-table* mood-fog-table data v1-2))) + (let ((f0-2 (fmax (fmax (-> a0-5 fog-color x) (-> a0-5 fog-color y)) (-> a0-5 fog-color z)))) + (set! (-> a0-5 fog-color x) (* (+ (-> a0-5 fog-color x) (* (- f0-2 (-> a0-5 fog-color x)) arg1)) arg2)) + (set! (-> a0-5 fog-color y) (* (+ (-> a0-5 fog-color y) (* (- f0-2 (-> a0-5 fog-color y)) arg1)) arg2)) + (set! (-> a0-5 fog-color z) (* (+ (-> a0-5 fog-color z) (* (- f0-2 (-> a0-5 fog-color z)) arg1)) arg2)) + ) + (set! (-> a0-5 fog-color w) 1.0) + ) + ) + (format 0 "(define *overide-mood-fog-table*~%") + (format 0 " (new 'static 'mood-fog-table~%") + (format 0 " :data (new 'static 'inline-array 'mood-fog 0~%") + (dotimes (gp-1 8) + (format 0 " (new 'static 'mood-fog") + (let ((v1-5 gp-1)) + (cond + ((zero? v1-5) + (format 0 " ; sun rise~%") + ) + ((= v1-5 1) + (format 0 " ; morning~%") + ) + ((= v1-5 2) + (format 0 " ; noon~%") + ) + ((= v1-5 3) + (format 0 " ; afternoon~%") + ) + ((= v1-5 4) + (format 0 " ; sunset~%") + ) + ((= v1-5 5) + (format 0 " ; twilight~%") + ) + ((= v1-5 6) + (format 0 " ; evening~%") + ) + ((= v1-5 7) + (format 0 " ; green sun~%") + ) + ) + ) + (format + 0 + " :fog-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%" + (-> *overide-table* mood-fog-table data gp-1 fog-color x) + (-> *overide-table* mood-fog-table data gp-1 fog-color y) + (-> *overide-table* mood-fog-table data gp-1 fog-color z) + (-> *overide-table* mood-fog-table data gp-1 fog-color w) + ) + (format + 0 + " :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%" + (* 0.00024414062 (-> *overide-table* mood-fog-table data gp-1 fog-dists x)) + (* 0.00024414062 (-> *overide-table* mood-fog-table data gp-1 fog-dists y)) + (-> *overide-table* mood-fog-table data gp-1 fog-dists w) + (-> *overide-table* mood-fog-table data gp-1 fog-dists z) + ) + (format 0 " :erase-color (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 128.0)~%") + (format 0 " )~%") + ) + (format 0 " )~%") + (format 0 " )~%") + (format 0 " )~%") + (none) + ) + +) 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 new file mode 100644 index 0000000000..16f069cb22 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-tables_REF.gc @@ -0,0 +1,895 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *no-cloud-haze-mood-fog-table*, type mood-fog-table +(define *no-cloud-haze-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 262144.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 16.0 :y 32.0 :z 100.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 24.0 :z 64.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 44.7999 :z 57.5999 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 1843200.0 :z 255.0 :w 128.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +;; definition for symbol *no-cloud-clear-mood-fog-table*, type mood-fog-table +(define *no-cloud-clear-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 128.0 :y 180.0 :z 243.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 150.0 :y 165.0 :z 220.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 160.0 :y 150.0 :z 200.0 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 12.7999 :y 25.5999 :z 80.0 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 19.1999 :z 51.1999 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 44.7999 :z 57.5999 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +;; definition for symbol *no-cloud-smog-mood-fog-table*, type mood-fog-table +(define *no-cloud-smog-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 108.75 :y 87.5 :z 61.5 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 105.625 :y 100.3437 :z 84.5 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 105.625 :y 104.9648 :z 103.6445 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 105.625 :y 100.3437 :z 84.5 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 108.75 :y 90.0 :z 61.5 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 54.0 :y 62.0 :z 108.0 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 18.5625 :y 24.75 :z 37.125 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 38.5 :z 49.5 :w 128.0) + :fog-dists (new 'static 'vector :x 65536.0 :y 1572864.0 :z 255.0 :w 96.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +;; definition for symbol *overcast-fog-mood-fog-table*, type mood-fog-table +(define *overcast-fog-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 84.5625 :y 83.875 :z 80.7124 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 4.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 103.7812 :y 116.2734 :z 117.2343 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 4.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 108.9843 :y 116.25 :z 124.2421 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 4.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 103.7812 :y 116.2734 :z 117.2343 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 4.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 84.082 :y 84.7656 :z 79.5703 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 4.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 34.0 :y 40.0 :z 61.0 :w 128.0) + :fog-dists (new 'static 'vector :x 196608.0 :y 1024000.0 :z 196.0 :w 4.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 16.7343 :y 18.7031 :z 26.5781 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 8.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 18.75 :y 28.75 :z 33.75 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 196.0 :w 8.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +;; definition for symbol *overcast-clear-mood-fog-table*, type mood-fog-table +(define *overcast-clear-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 136.0 :y 130.0 :z 160.0 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 134.0 :y 143.0 :z 176.0 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 125.4 :y 156.5999 :z 194.3999 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 134.0 :y 143.0 :z 176.0 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 136.0 :y 130.0 :z 160.0 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 23.68 :y 31.3599 :z 64.0 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 10.2399 :y 21.7599 :z 40.9599 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 11.5199 :y 38.3999 :z 46.0799 :w 1.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 4096000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +;; definition for symbol *overcast-rain-mood-fog-table*, type mood-fog-table +(define *overcast-rain-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 69.4938 :y 84.6425 :z 100.0708 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 77.0012 :y 108.5625 :z 126.4826 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 82.6313 :y 108.699 :z 132.716 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 77.0012 :y 108.5625 :z 126.4826 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 68.186 :y 85.1003 :z 99.9291 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 33.2822 :y 41.2822 :z 67.5448 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 2.0 :y 18.25 :z 26.5 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 2.4022 :y 24.8554 :z 29.6991 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +;; definition for symbol *storm-fog-mood-fog-table*, type mood-fog-table +(define *storm-fog-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 51.4475 :y 60.0221 :z 72.8841 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 37.0013 :y 69.5625 :z 75.4827 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 46.6313 :y 70.6991 :z 76.7161 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 37.0013 :y 69.5625 :z 75.4827 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 56.1861 :y 62.1004 :z 73.9291 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 29.2823 :y 29.2823 :z 40.5449 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 2.0 :y 10.25 :z 18.5 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 2.4023 :y 15.8554 :z 19.6992 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +;; definition for symbol *storm-clear-mood-fog-table*, type mood-fog-table +(define *storm-clear-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 115.0 :y 115.0 :z 110.0 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 122.5 :y 127.5 :z 127.5 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 127.5 :y 127.5 :z 127.5 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 122.5 :y 127.5 :z 127.5 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 110.0 :y 110.0 :z 105.0 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 90.0 :y 85.0 :z 90.0 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 12.0 :z 32.0 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 28.0 :z 36.0 :w 128.0) + :fog-dists (new 'static 'vector :x 32768.0 :y 2048000.0 :z 255.0 :w 162.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +;; definition for symbol *storm-rain-mood-fog-table*, type mood-fog-table +(define *storm-rain-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 51.4475 :y 60.0221 :z 72.8841 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 37.0013 :y 69.5625 :z 75.4827 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 46.6313 :y 70.6991 :z 76.7161 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 37.0013 :y 69.5625 :z 75.4827 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 56.1861 :y 62.1004 :z 73.9291 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 29.2823 :y 29.2823 :z 40.5449 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 2.0 :y 10.25 :z 18.5 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 2.4023 :y 15.8554 :z 19.6992 :w 128.0) + :fog-dists (new 'static 'vector :y 1024000.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +;; definition for symbol *no-cloud-mood-color-table*, type mood-color-table +(define *no-cloud-mood-color-table* + (new 'static 'mood-color-table :data (new 'static 'inline-array mood-color 8 + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.5092 :y 1.2699) + :amb-color (new 'static 'vector :x 0.498 :y 0.4406 :z 0.5777 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.6168 :y 1.4675 :z 1.0976) + :amb-color (new 'static 'vector :x 0.4199 :y 0.5195 :z 0.5976 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.8412 :y 1.685 :z 1.4374) + :amb-color (new 'static 'vector :x 0.4199 :y 0.5195 :z 0.5976 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.6168 :y 1.4675 :z 1.0976) + :amb-color (new 'static 'vector :x 0.4199 :y 0.5195 :z 0.5976 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 1.6464 :y 1.2601) + :amb-color (new 'static 'vector :x 0.3984 :y 0.4478 :z 0.5976 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.3312 :y 0.149 :z 0.5) + :amb-color (new 'static 'vector :x 0.2788 :y 0.3593 :z 0.498 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1097 :y 0.384 :z 0.8232) + :amb-color (new 'static 'vector :x 0.2695 :y 0.3143 :z 0.4492 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1 :y 0.5749 :z 0.4) + :amb-color (new 'static 'vector :x 0.239 :y 0.3386 :z 0.3984 :w 1.0) + ) + ) + ) + ) + +;; definition for symbol *overcast-mood-color-table*, type mood-color-table +(define *overcast-mood-color-table* + (new 'static 'mood-color-table :data (new 'static 'inline-array mood-color 8 + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.3772 :y 0.3473 :z 0.1886) + :amb-color (new 'static 'vector :x 0.5378 :y 0.4605 :z 0.5976 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.4041 :y 0.3855 :z 0.3392) + :amb-color (new 'static 'vector :x 0.5087 :y 0.5639 :z 0.642 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.4602 :y 0.4407 :z 0.4098) + :amb-color (new 'static 'vector :x 0.5087 :y 0.5639 :z 0.642 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.4041 :y 0.3855 :z 0.3392) + :amb-color (new 'static 'vector :x 0.5087 :y 0.5639 :z 0.642 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.4115 :y 0.3633 :z 0.2057) + :amb-color (new 'static 'vector :x 0.4979 :y 0.4975 :z 0.6473 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1038 :y 0.0811 :z 0.125) + :amb-color (new 'static 'vector :x 0.3883 :y 0.414 :z 0.5527 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1166 :y 0.1508 :z 0.2057) + :amb-color (new 'static 'vector :x 0.3593 :y 0.3592 :z 0.4941 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.0843 :y 0.1437 :z 0.1218) + :amb-color (new 'static 'vector :x 0.3186 :y 0.3784 :z 0.4382 :w 1.0) + ) + ) + ) + ) + +;; definition for symbol *storm-mood-color-table*, type mood-color-table +(define *storm-mood-color-table* + (new 'static 'mood-color-table :data (new 'static 'inline-array mood-color 8 + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1509 :y 0.1449 :z 0.1131) + :amb-color (new 'static 'vector :x 0.3714 :y 0.3964 :z 0.4877 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1616 :y 0.1579 :z 0.1486) + :amb-color (new 'static 'vector :x 0.3684 :y 0.4604 :z 0.5124 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1841 :y 0.1802 :z 0.174) + :amb-color (new 'static 'vector :x 0.3684 :y 0.4604 :z 0.5124 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1616 :y 0.1579 :z 0.1486) + :amb-color (new 'static 'vector :x 0.3684 :y 0.4604 :z 0.5124 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1646 :y 0.1549 :z 0.1234) + :amb-color (new 'static 'vector :x 0.3648 :y 0.4145 :z 0.5142 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.0457 :y 0.0412 :z 0.0499) + :amb-color (new 'static 'vector :x 0.2951 :y 0.3406 :z 0.4329 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.0644 :y 0.0713 :z 0.0823) + :amb-color (new 'static 'vector :x 0.3593 :y 0.3592 :z 0.4941 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.0456 :y 0.0574 :z 0.0531) + :amb-color (new 'static 'vector :x 0.3186 :y 0.3784 :z 0.4382 :w 1.0) + ) + ) + ) + ) + +;; definition for symbol *no-cloud-mood-channel-group*, type mood-channel-group +(define *no-cloud-mood-channel-group* + (new 'static 'mood-channel-group + :data (new 'static 'inline-array mood-channel 4 + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4) + (new 'static 'vector4 :y 0.2 :z 0.4 :w 1.0) + (new 'static 'vector4 :x 0.5 :y 0.25) + (new 'static 'vector4) + (new 'static 'vector4) + (new 'static 'vector4) + ) + ) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4 :x 0.8 :y 0.6 :z 0.4 :w 0.2) + (new 'static 'vector4) + (new 'static 'vector4 :x 0.5 :y 0.75 :z 1.0 :w 0.75) + (new 'static 'vector4 :x 0.5 :y 0.25) + (new 'static 'vector4 :w 0.75) + (new 'static 'vector4 :x 0.82 :y 0.88 :z 0.94 :w 1.0) + ) + ) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4 :x 0.2 :y 0.4 :z 0.6 :w 0.8) + (new 'static 'vector4 :x 1.0 :y 0.8 :z 0.6) + (new 'static 'vector4 :w 0.25) + (new 'static 'vector4 :x 0.5 :y 0.75 :z 1.0 :w 0.84) + (new 'static 'vector4 :x 0.67 :y 0.5) + (new 'static 'vector4) + ) + ) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4) + (new 'static 'vector4) + (new 'static 'vector4) + (new 'static 'vector4 :w 0.16) + (new 'static 'vector4 :x 0.33 :y 0.5 :z 1.0 :w 0.25) + (new 'static 'vector4 :x 0.18 :y 0.12 :z 0.06) + ) + ) + ) + ) + ) + +;; definition for symbol *overcast-mood-channel-group*, type mood-channel-group +(define *overcast-mood-channel-group* + (new 'static 'mood-channel-group + :data (new 'static 'inline-array mood-channel 4 + (new 'static 'mood-channel) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4 :x 0.5 :y 0.42 :z 0.34 :w 0.25) + (new 'static 'vector4 :x 0.17 :y 0.08 :w 1.0) + (new 'static 'vector4 :x 0.9 :y 0.8 :z 0.7 :w 0.6) + (new 'static 'vector4 :x 0.5 :y 0.42 :z 0.34 :w 0.25) + (new 'static 'vector4 :x 0.17 :y 0.08 :w 1.0) + (new 'static 'vector4 :x 0.9 :y 0.8 :z 0.7 :w 0.6) + ) + ) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4 :x 0.5 :y 0.58 :z 0.66 :w 0.75) + (new 'static 'vector4 :x 0.83 :y 0.92 :z 1.0) + (new 'static 'vector4 :x 0.1 :y 0.2 :z 0.3 :w 0.4) + (new 'static 'vector4 :x 0.5 :y 0.58 :z 0.66 :w 0.75) + (new 'static 'vector4 :x 0.83 :y 0.92 :z 1.0) + (new 'static 'vector4 :x 0.1 :y 0.2 :z 0.3 :w 0.4) + ) + ) + (new 'static 'mood-channel) + ) + ) + ) + +;; definition for symbol *stormy-mood-channel-group*, type mood-channel-group +(define *stormy-mood-channel-group* + (new 'static 'mood-channel-group + :data (new 'static 'inline-array mood-channel 4 + (new 'static 'mood-channel) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + ) + ) + (new 'static 'mood-channel :vecs (new 'static 'inline-array vector4 6 + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + (new 'static 'vector4 :x 0.5 :y 0.5 :z 0.5 :w 0.5) + ) + ) + (new 'static 'mood-channel) + ) + ) + ) + +;; definition for symbol *clouds-000*, type mood-clouds +(define *clouds-000* (new 'static 'mood-clouds :cloud-min 1.0 :cloud-max 1.0)) + +;; definition for symbol *clouds-125*, type mood-clouds +(define *clouds-125* (new 'static 'mood-clouds :cloud-min 0.333 :cloud-max 1.0)) + +;; definition for symbol *clouds-250*, type mood-clouds +(define *clouds-250* (new 'static 'mood-clouds :cloud-min 0.333 :cloud-max 0.555)) + +;; definition for symbol *clouds-375*, type mood-clouds +(define *clouds-375* (new 'static 'mood-clouds :cloud-min 0.167 :cloud-max 0.605)) + +;; definition for symbol *clouds-500*, type mood-clouds +(define *clouds-500* (new 'static 'mood-clouds :cloud-max 0.655)) + +;; definition for symbol *clouds-625*, type mood-clouds +(define *clouds-625* (new 'static 'mood-clouds :cloud-max 0.605)) + +;; definition for symbol *clouds-750*, type mood-clouds +(define *clouds-750* (new 'static 'mood-clouds :cloud-max 0.555)) + +;; definition for symbol *clouds-875*, type mood-clouds +(define *clouds-875* (new 'static 'mood-clouds :cloud-max 0.505)) + +;; definition for symbol *clouds-1000*, type mood-clouds +(define *clouds-1000* (new 'static 'mood-clouds :cloud-max 0.455)) + +;; definition for symbol *drill-mood-fog-table*, type mood-fog-table +(define *drill-mood-fog-table* + (new 'static 'mood-fog-table :data (new 'static 'inline-array mood-fog 8 + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 41.6796 :y 52.6679 :z 72.75 :w 128.0) + :fog-dists (new 'static 'vector :y 2007040.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 53.7656 :y 72.6562 :z 93.0 :w 128.0) + :fog-dists (new 'static 'vector :y 2007040.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 59.0 :y 70.5 :z 89.0 :w 128.0) + :fog-dists (new 'static 'vector :y 2007040.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 50.5859 :y 72.2656 :z 92.5 :w 128.0) + :fog-dists (new 'static 'vector :y 2129920.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 40.8203 :y 51.582 :z 71.25 :w 128.0) + :fog-dists (new 'static 'vector :y 2007040.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :x 27.6093 :y 28.3359 :z 47.9531 :w 128.0) + :fog-dists (new 'static 'vector :x 131072.0 :y 2007040.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 15.0 :z 25.0 :w 128.0) + :fog-dists (new 'static 'vector :y 2129920.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + (new 'static 'mood-fog + :fog-color (new 'static 'vector :y 23.0 :z 28.0 :w 128.0) + :fog-dists (new 'static 'vector :y 2129920.0 :z 255.0 :w 16.0) + :erase-color (new 'static 'vector :w 128.0) + ) + ) + ) + ) + +;; definition for symbol *drill-mood-color-table*, type mood-color-table +(define *drill-mood-color-table* + (new 'static 'mood-color-table :data (new 'static 'inline-array mood-color 8 + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.4153 :y 0.3906 :z 0.1171) + :amb-color (new 'static 'vector :x 0.3607 :y 0.4216 :z 0.5583 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.5676 :y 0.4026 :z 0.1406) + :amb-color (new 'static 'vector :x 0.25 :y 0.4483 :z 0.601 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.6106 :y 0.5588 :z 0.375) + :amb-color (new 'static 'vector :x 0.3729 :y 0.4561 :z 0.6127 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.5676 :y 0.3947 :z 0.1406) + :amb-color (new 'static 'vector :x 0.2518 :y 0.4404 :z 0.601 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.4114 :y 0.3166) + :amb-color (new 'static 'vector :x 0.3256 :y 0.4202 :z 0.5609 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.2082 :y 0.1115 :z 0.173) + :amb-color (new 'static 'vector :x 0.3416 :y 0.4248 :z 0.5776 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.1516 :y 0.2634 :z 0.4248) + :amb-color (new 'static 'vector :x 0.2694 :y 0.3532 :z 0.449 :w 1.0) + ) + (new 'static 'mood-color + :lgt-color (new 'static 'vector :x 0.0686 :y 0.2877 :z 0.2748) + :amb-color (new 'static 'vector :x 0.2388 :y 0.3384 :z 0.3982 :w 1.0) + ) + ) + ) + ) + +;; definition for symbol *drill-mood-direction-table*, type mood-direction-table +(define *drill-mood-direction-table* + (new 'static 'mood-direction-table :data (new 'static 'inline-array vector 4 + (new 'static 'vector :y 1.0) + (new 'static 'vector :y 1.0) + (new 'static 'vector :y 1.0) + (new 'static 'vector :y 1.0) + ) + ) + ) + +;; definition for symbol *mood-direction-table*, type mood-direction-table +(define *mood-direction-table* + (new 'static 'mood-direction-table :data (new 'static 'inline-array vector 4 + (new 'static 'vector :x 0.906 :y 0.397 :z 0.143) + (new 'static 'vector :x 0.5 :y 0.814 :z 0.296) + (new 'static 'vector :x -0.5 :y 0.814 :z 0.296) + (new 'static 'vector :x -0.906 :y 0.397 :z 0.143) + ) + ) + ) + +;; definition for symbol *mood-sky-table*, type mood-sky-table +(define *mood-sky-table* + (new 'static 'mood-sky-table :data (new 'static 'inline-array vector 8 + (new 'static 'vector :x 83.0 :y 103.0 :z 190.0 :w 128.0) + (new 'static 'vector :x 86.0 :y 108.0 :z 195.0 :w 128.0) + (new 'static 'vector :x 89.0 :y 113.0 :z 200.0 :w 128.0) + (new 'static 'vector :x 86.0 :y 108.0 :z 195.0 :w 128.0) + (new 'static 'vector :x 83.0 :y 103.0 :z 190.0 :w 128.0) + (new 'static 'vector :x 41.0 :y 64.0 :z 166.0 :w 128.0) + (new 'static 'vector :z 8.0 :w 128.0) + (new 'static 'vector :y 29.0 :z 33.0 :w 128.0) + ) + ) + ) + +;; definition for symbol *mood-interp-table*, type sky-color-day +(define *mood-interp-table* + (new 'static 'sky-color-day + :hour (new 'static 'inline-array sky-color-hour 24 + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.2 :morph-end 0.4) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.4 :morph-end 0.6) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.6 :morph-end 0.8) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-start 0.8 :morph-end 0.99) + (new 'static 'sky-color-hour :snapshot2 7 :morph-start 0.99 :morph-end 0.8) + (new 'static 'sky-color-hour :snapshot2 7 :morph-start 0.8 :morph-end 0.6) + (new 'static 'sky-color-hour :snapshot2 7 :morph-start 0.6) + (new 'static 'sky-color-hour :snapshot2 1 :morph-end 0.5) + (new 'static 'sky-color-hour :snapshot2 1 :morph-start 0.5 :morph-end 0.75) + (new 'static 'sky-color-hour :snapshot2 1 :morph-start 0.75 :morph-end 0.99) + (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 1 :morph-start 0.99 :morph-end 0.5) + (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 1 :morph-start 0.5) + (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 3 :morph-end 0.5) + (new 'static 'sky-color-hour :snapshot1 2 :snapshot2 3 :morph-start 0.5 :morph-end 0.99) + (new 'static 'sky-color-hour :snapshot1 4 :snapshot2 3 :morph-start 0.99 :morph-end 0.84) + (new 'static 'sky-color-hour :snapshot1 4 :snapshot2 3 :morph-start 0.84 :morph-end 0.66) + (new 'static 'sky-color-hour :snapshot1 4 :snapshot2 3 :morph-start 0.66 :morph-end 0.5) + (new 'static 'sky-color-hour :snapshot1 4 :snapshot2 3 :morph-start 0.5) + (new 'static 'sky-color-hour :snapshot1 4 :snapshot2 5 :morph-end 0.99) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 5 :morph-start 0.99 :morph-end 0.75) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 5 :morph-start 0.75 :morph-end 0.5) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 5 :morph-start 0.5 :morph-end 0.25) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 5 :morph-start 0.25) + (new 'static 'sky-color-hour :snapshot1 6 :snapshot2 7 :morph-end 0.2) + ) + ) + ) + +;; definition for function init-mood-control +;; INFO: 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)) + (set! (-> arg0 mood-channel-group) (new 'global 'mood-channel-group)) + (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*)) + (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) + (mem-copy! (the-as pointer (-> arg0 mood-clouds)) (the-as pointer *clouds-250*) 8) + (set! (-> arg0 fogs 0) *no-cloud-haze-mood-fog-table*) + (set! (-> arg0 fogs 1) *no-cloud-clear-mood-fog-table*) + (set! (-> arg0 fogs 2) *no-cloud-smog-mood-fog-table*) + (set! (-> arg0 fogs 3) *overcast-fog-mood-fog-table*) + (set! (-> arg0 fogs 4) *overcast-clear-mood-fog-table*) + (set! (-> arg0 fogs 5) *overcast-rain-mood-fog-table*) + (set! (-> arg0 fogs 6) *storm-fog-mood-fog-table*) + (set! (-> arg0 fogs 7) *storm-clear-mood-fog-table*) + (set! (-> arg0 fogs 8) *storm-rain-mood-fog-table*) + (set! (-> arg0 colors 0) *no-cloud-mood-color-table*) + (set! (-> arg0 colors 1) *overcast-mood-color-table*) + (set! (-> arg0 colors 2) *storm-mood-color-table*) + (set! (-> arg0 channels 0) *no-cloud-mood-channel-group*) + (set! (-> arg0 channels 1) *overcast-mood-channel-group*) + (set! (-> arg0 channels 2) *stormy-mood-channel-group*) + (set! (-> arg0 clouds 0) *clouds-000*) + (set! (-> arg0 clouds 1) *clouds-125*) + (set! (-> arg0 clouds 2) *clouds-250*) + (set! (-> arg0 clouds 3) *clouds-375*) + (set! (-> arg0 clouds 4) *clouds-500*) + (set! (-> arg0 clouds 5) *clouds-625*) + (set! (-> arg0 clouds 6) *clouds-750*) + (set! (-> arg0 clouds 7) *clouds-875*) + (set! (-> arg0 clouds 8) *clouds-1000*) + (set! (-> arg0 current-interp cloud) 0.25) + (set! (-> arg0 current-interp fog) 0.5) + (set! (-> arg0 target-interp cloud) 0.25) + (set! (-> arg0 target-interp fog) 0.5) + (set! (-> arg0 speed-interp cloud) 0.0005555556) + (set! (-> arg0 speed-interp fog) 0.0005555556) + (set! (-> arg0 range min-cloud) 0.0) + (set! (-> arg0 range max-cloud) 1.0) + (set! (-> arg0 range min-fog) 0.0) + (set! (-> arg0 range max-fog) 1.0) + (set! (-> arg0 time-until-random cloud) 36000.0) + (set! (-> arg0 time-until-random-min cloud) 36000.0) + (set! (-> arg0 time-until-random-max cloud) 72000.0) + (set! (-> arg0 time-until-random fog) 216000.0) + (set! (-> arg0 time-until-random-min fog) 36000.0) + (set! (-> arg0 time-until-random-max fog) 72000.0) + (set! (-> arg0 overide cloud) 0.25) + (set! (-> arg0 overide fog) 0.0) + (set! (-> arg0 overide-weather-flag) (the-as basic #t)) + (set! (-> arg0 display-flag) #f) + (none) + ) + +;; definition for symbol *mood-control*, type mood-control +(define *mood-control* (new 'static 'mood-control)) + +;; failed to figure out what this is: +(init-mood-control *mood-control*) + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc index db94684229..102c60e757 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc @@ -95,8 +95,8 @@ :size-assert #x10 :flag-assert #xb00000010 (:methods - (sparticle-launcher-method-9 () none 9) - (sparticle-launcher-method-10 () none 10) + (sparticle-launcher-method-9 (_type_ int) uint 9) + (sparticle-launcher-method-10 (_type_) none 10) ) ) @@ -310,7 +310,3 @@ ;; failed to figure out what this is: 0 - - - - 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 2826e2503e..b3102cfea0 100644 --- a/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc @@ -51,6 +51,7 @@ (level level :offset-assert 124) (unk-data-2 uint16 9 :offset 130) (unk-byte uint8 :offset 152) + (ambients symbol :offset-assert 156) (unk-data-4 float :offset 160) (unk-data-5 float :offset-assert 164) (race-meshes (array entity-race-mesh) :offset 168) 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 df20e8b943..9c5059de71 100644 --- a/test/decompiler/reference/jak2/engine/level/level-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/level-h_REF.gc @@ -643,39 +643,41 @@ ;; definition of type level-group (deftype level-group (basic) - ((length int32 :offset-assert 4) - (log-in-level-bsp bsp-header :offset-assert 8) - (loading-level level :offset-assert 12) - (entity-link entity-links :offset 16) - (border? symbol :offset-assert 20) - (vis? symbol :offset-assert 24) - (want-level basic :offset-assert 28) - (receiving-level basic :offset-assert 32) - (load-commands pair :offset-assert 36) - (play? symbol :offset-assert 40) - (target-pos vector 2 :inline :offset-assert 48) - (camera-pos vector 2 :inline :offset-assert 80) - (heap kheap :inline :offset-assert 112) - (sound-bank basic 4 :offset-assert 128) - (disk-load-timing? symbol :offset-assert 144) - (load-level basic :offset-assert 148) - (load-size uint32 :offset-assert 152) - (load-time float :offset-assert 156) - (load-login-time float :offset-assert 160) - (draw-level-count int32 :offset-assert 164) - (draw-level basic 7 :offset-assert 168) - (draw-index-map uint8 7 :offset-assert 196) - (load-order uint64 :offset-assert 208) - (pad uint8 30 :offset-assert 216) - (level level 7 :inline :offset-assert 256) - (level0 level :inline :offset 256) - (level1 level :inline :offset 5488) - (level2 level :inline :offset 10720) - (level3 level :inline :offset 15952) - (level4 level :inline :offset 21184) - (level5 level :inline :offset 26416) - (default-level level :inline :offset 31648) - (pad2 uint8 4 :offset-assert 36880) + ((length int32 :offset-assert 4) + (log-in-level-bsp bsp-header :offset-assert 8) + (loading-level level :offset-assert 12) + (entity-link entity-links :offset 16) + (border? symbol :offset-assert 20) + (vis? symbol :offset-assert 24) + (want-level basic :offset-assert 28) + (receiving-level basic :offset-assert 32) + (load-commands pair :offset-assert 36) + (play? symbol :offset-assert 40) + (target-pos vector 2 :inline :offset-assert 48) + (camera-pos vector 2 :inline :offset-assert 80) + (heap kheap :inline :offset-assert 112) + (sound-bank basic 4 :offset-assert 128) + (disk-load-timing? symbol :offset-assert 144) + (load-level basic :offset-assert 148) + (load-size uint32 :offset-assert 152) + (load-time float :offset-assert 156) + (load-login-time float :offset-assert 160) + (draw-level-count int32 :offset-assert 164) + (draw-level basic 7 :offset-assert 168) + (draw-index-map uint8 7 :offset-assert 196) + (load-order uint64 :offset-assert 208) + (pad uint8 30 :offset-assert 216) + (level level 7 :inline :offset-assert 256) + (level0 level :inline :offset 256) + (level1 level :inline :offset 5488) + (level2 level :inline :offset 10720) + (level3 level :inline :offset 15952) + (level4 level :inline :offset 21184) + (level5 level :inline :offset 26416) + (default-level level :inline :offset 31648) + (unknown-inline-vec-01 (inline-array vector) :offset 32064) + (unknown-inline-vec-02 (inline-array vector) :offset 33712) + (pad2 uint8 4 :offset-assert 36880) ) :method-count-assert 31 :size-assert #x9014 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 f82cd70622..d28d6069ba 100644 --- a/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc @@ -495,12 +495,12 @@ (goto cfg-4) ) (format #t "[~8x] ~A~%" obj 'vector4) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) (format #t "~1Tx: ~f~%" (-> obj x)) (format #t "~1Ty: ~f~%" (-> obj y)) (format #t "~1Tz: ~f~%" (-> obj z)) (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tdword[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tdword[2] @ #x~X~%" (&-> obj x)) (format #t "~1Tquad: ~D~%" (-> obj quad)) (label cfg-4) obj diff --git a/test/decompiler/reference/jak2/engine/math/vector_REF.gc b/test/decompiler/reference/jak2/engine/math/vector_REF.gc index 84c6ad3a58..4384d53533 100644 --- a/test/decompiler/reference/jak2/engine/math/vector_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/vector_REF.gc @@ -1540,7 +1540,6 @@ ) ;; definition for function vector4-array-lerp! -;; INFO: Return type mismatch symbol vs none. (defun vector4-array-lerp! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 (inline-array vector4)) @@ -1553,7 +1552,7 @@ (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) ) - (none) + #f ) ;; definition for function spheres-overlap?