From a7eee4fdc91faf91d83dad9277b421e9b142d38d Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Mon, 11 Apr 2022 23:38:54 +0100 Subject: [PATCH] [game] pc port progress menu (#1281) * fix typo * more typo * shorten discord rpc text * allow expanding enums after the fact (untested) * make `game_text` work similar to subtitles * update progress decomp * update some types + `do-not-decompile` in bitfield * fixes and fall back to original progress code * update `progress` decomp with new enums * update config files * fix enums and debug menu * always allocate (but not use) a lot of particles * small rework to display mode options * revert resolution/aspect-ratio symbol mess * begin the override stuff * make `progress-draw` more readable * more fixes * codacy good boy points * first step overriding code * finish progress overrides, game options menu fully functional! * minor fixes * Update game.gp * Update sparticle-launcher.gc * clang * change camera controls text * oops * some cleanup * derp * nice job * implement menu scrolling lol * make scrollable menus less cramped, fix arrows * make some carousell things i guess * add msaa carousell to test * oops * Update progress-pc.gc * make `pc-get-screen-size` (untested) * resolution menu * input fixes * return when selecting resolution * scroll fixes * Update progress-pc.gc * add "fit to screen" button * bug * complete resolutions menu * aspect ratio menu * subtitles language * subtitle speaker * final adjustments * ref test * fix tests * fix ref! * reduce redundancy a bit * fix mem leaks? * save settings on progress exit * fix init reorder * remove unused code * rename goal project-like files to the project extension * sha display toggle * aspect ratio settings fixes * dont store text db's in compiler * properly save+load native aspect stuff --- common/cross_os_debug/xdbg.cpp | 4 +- common/goos/PrettyPrinter2.cpp | 11 +- common/type_system/Type.cpp | 15 +- common/type_system/Type.h | 4 +- common/type_system/TypeSystem.cpp | 5 +- common/type_system/TypeSystem.h | 3 +- common/type_system/defenum.cpp | 4 +- common/type_system/deftype.cpp | 6 +- decompiler/IR2/AtomicOpForm.cpp | 4 +- decompiler/config.cpp | 12 - decompiler/config.h | 3 - decompiler/config/all-types.gc | 294 +- decompiler/config/jak1_ntsc_black_label.jsonc | 1 - .../config/jak1_ntsc_black_label/hacks.jsonc | 3 +- .../config/jak1_ntsc_black_label/inputs.jsonc | 9 +- .../jak1_ntsc_black_label/label_types.jsonc | 24 +- .../jak1_ntsc_black_label/new_strings.jsonc | 57 - .../jak1_ntsc_black_label/type_casts.jsonc | 1 + decompiler/data/game_text.cpp | 28 +- decompiler/util/data_decompile.cpp | 3 +- .../{game_subtitle.txt => game_subtitle.gp} | 4 +- game/assets/game_text.gp | 11 + .../subtitle}/game_subtitle_en.txt | 0 .../subtitle}/game_subtitle_es.txt | 0 game/assets/jak1/text/game_text_en.txt | 143 + game/graphics/display.cpp | 10 +- game/graphics/display.h | 20 +- game/graphics/gfx.cpp | 16 +- game/graphics/gfx.h | 7 +- game/graphics/opengl_renderer/Profiler.cpp | 4 +- game/graphics/pipelines/opengl.cpp | 42 +- game/kernel/kmachine.cpp | 61 +- game/system/Deci2Server.cpp | 4 +- goal_src/dgos/engine.gd | 1 + goal_src/dgos/game.gd | 1 + goal_src/engine/collide/collide-cache-h.gc | 6 +- goal_src/engine/collide/collide-cache.gc | 17 +- goal_src/engine/collide/collide-shape-h.gc | 17 +- goal_src/engine/collide/collide-shape.gc | 2 +- goal_src/engine/debug/default-menu.gc | 6 +- goal_src/engine/draw/drawable.gc | 2 +- goal_src/engine/game/collectables.gc | 6 +- goal_src/engine/game/game-save.gc | 8 +- goal_src/engine/game/main.gc | 15 +- goal_src/engine/game/projectiles.gc | 2 +- goal_src/engine/gfx/shadow/shadow-h.gc | 13 +- goal_src/engine/gfx/shadow/shadow.gc | 21 +- goal_src/engine/gfx/sprite/sprite.gc | 12 +- goal_src/engine/nav/navigate-h.gc | 38 +- goal_src/engine/nav/navigate.gc | 62 +- goal_src/engine/ps2/pad.gc | 2 +- .../engine/sparticle/sparticle-launcher.gc | 10 +- goal_src/engine/sparticle/sparticle.gc | 6 +- goal_src/engine/target/target-death.gc | 2 +- goal_src/engine/target/target-part.gc | 2 +- goal_src/engine/ui/progress-h.gc | 249 +- goal_src/engine/ui/progress/progress-draw.gc | 508 +-- goal_src/engine/ui/progress/progress-part.gc | 8 +- .../engine/ui/progress/progress-static.gc | 202 +- goal_src/engine/ui/progress/progress.gc | 772 +++-- goal_src/engine/ui/text-h.gc | 64 +- goal_src/engine/ui/text.gc | 3 + goal_src/game.gp | 15 +- goal_src/goal-lib.gc | 2 +- goal_src/goos-lib.gs | 2 +- goal_src/kernel-defs.gc | 4 +- goal_src/levels/beach/lurkercrab.gc | 38 +- goal_src/levels/beach/lurkerpuppy.gc | 24 +- goal_src/levels/citadel/citb-bunny.gc | 2 +- goal_src/levels/common/babak.gc | 10 +- goal_src/levels/common/battlecontroller.gc | 6 +- goal_src/levels/common/joint-exploder.gc | 2 +- goal_src/levels/common/nav-enemy-h.gc | 141 +- goal_src/levels/common/nav-enemy.gc | 190 +- goal_src/levels/common/sharkey.gc | 10 +- goal_src/levels/finalboss/green-eco-lurker.gc | 88 +- goal_src/levels/finalboss/robotboss.gc | 4 +- goal_src/levels/jungle/hopper.gc | 41 +- goal_src/levels/jungle/junglefish.gc | 2 +- goal_src/levels/jungleb/aphid.gc | 20 +- goal_src/levels/maincave/baby-spider.gc | 12 +- goal_src/levels/maincave/mother-spider-egg.gc | 15 +- .../levels/maincave/mother-spider-proj.gc | 2 +- goal_src/levels/maincave/mother-spider.gc | 6 +- goal_src/levels/misty/babak-with-cannon.gc | 16 +- goal_src/levels/misty/bonelurker.gc | 45 +- goal_src/levels/misty/mistycannon.gc | 2 +- goal_src/levels/misty/muse.gc | 8 +- goal_src/levels/misty/quicksandlurker.gc | 4 +- goal_src/levels/ogre/ogreboss.gc | 4 +- goal_src/levels/racer_common/racer-states.gc | 2 +- goal_src/levels/robocave/cave-trap.gc | 4 +- .../levels/rolling/rolling-lightning-mole.gc | 8 +- goal_src/levels/snow/ice-cube.gc | 20 +- goal_src/levels/snow/snow-bunny.gc | 36 +- goal_src/levels/snow/snow-ram-boss.gc | 34 +- goal_src/levels/snow/yeti.gc | 16 +- goal_src/levels/sunken/bully.gc | 2 +- goal_src/levels/sunken/double-lurker.gc | 18 +- goal_src/levels/sunken/orbit-plat.gc | 12 +- goal_src/levels/sunken/puffer.gc | 7 +- goal_src/levels/swamp/billy.gc | 8 +- goal_src/levels/swamp/kermit.gc | 10 +- goal_src/levels/swamp/swamp-rat-nest.gc | 2 +- goal_src/levels/swamp/swamp-rat.gc | 8 +- goal_src/levels/village1/village-obs.gc | 4 +- goal_src/levels/village1/yakow.gc | 12 +- goal_src/pc/engine/ui/progress-h.gc | 271 -- .../pc/engine/ui/progress/progress-draw.gc | 2157 ------------- .../pc/engine/ui/progress/progress-static.gc | 1498 --------- goal_src/pc/engine/ui/progress/progress.gc | 2762 ---------------- goal_src/pc/engine/ui/text-h.gc | 562 ---- goal_src/pc/pckernel-h.gc | 56 +- goal_src/pc/pckernel.gc | 220 +- goal_src/pc/progress-pc.gc | 1549 +++++++++ goal_src/pc/subtitle.gc | 12 +- goalc/compiler/Compiler.cpp | 1 - goalc/compiler/Compiler.h | 3 +- .../compiler/compilation/CompilerControl.cpp | 17 +- goalc/data_compiler/game_subtitle.cpp | 18 +- goalc/data_compiler/game_subtitle.h | 21 +- goalc/data_compiler/game_text.cpp | 152 +- goalc/data_compiler/game_text.h | 60 +- goalc/make/MakeSystem.cpp | 5 +- goalc/make/Tools.cpp | 34 +- goalc/make/Tools.h | 6 +- .../engine/collide/collide-cache-h_REF.gc | 6 +- .../engine/collide/collide-shape-h_REF.gc | 8 +- .../reference/engine/draw/drawable_REF.gc | 2 +- .../reference/engine/game/collectables_REF.gc | 4 +- .../reference/engine/game/game-save_REF.gc | 8 +- .../reference/engine/game/projectiles_REF.gc | 2 +- .../reference/engine/gfx/shadow/shadow_REF.gc | 21 +- .../reference/engine/nav/navigate-h_REF.gc | 2 +- .../reference/engine/nav/navigate_REF.gc | 62 +- .../engine/target/target-death_REF.gc | 2 +- .../engine/target/target-part_REF.gc | 2 +- .../reference/engine/ui/progress-h_REF.gc | 40 +- .../engine/ui/progress/progress-draw_REF.gc | 420 +-- .../engine/ui/progress/progress-static_REF.gc | 2781 +++++++++-------- .../engine/ui/progress/progress_REF.gc | 278 +- .../reference/levels/beach/lurkercrab_REF.gc | 38 +- .../reference/levels/beach/lurkerpuppy_REF.gc | 24 +- .../levels/citadel/citb-bunny_REF.gc | 2 +- .../reference/levels/common/babak_REF.gc | 10 +- .../levels/common/battlecontroller_REF.gc | 6 +- .../levels/common/joint-exploder_REF.gc | 2 +- .../levels/common/nav-enemy-h_REF.gc | 104 +- .../reference/levels/common/nav-enemy_REF.gc | 190 +- .../reference/levels/common/sharkey_REF.gc | 10 +- .../levels/finalboss/green-eco-lurker_REF.gc | 35 +- .../levels/finalboss/robotboss_REF.gc | 4 +- .../reference/levels/jungle/hopper_REF.gc | 39 +- .../reference/levels/jungle/junglefish_REF.gc | 2 +- .../reference/levels/jungleb/aphid_REF.gc | 20 +- .../levels/maincave/baby-spider_REF.gc | 12 +- .../levels/maincave/mother-spider-egg_REF.gc | 10 +- .../levels/maincave/mother-spider-proj_REF.gc | 2 +- .../levels/maincave/mother-spider_REF.gc | 6 +- .../levels/misty/babak-with-cannon_REF.gc | 16 +- .../reference/levels/misty/bonelurker_REF.gc | 45 +- .../reference/levels/misty/mistycannon_REF.gc | 2 +- .../reference/levels/misty/muse_REF.gc | 8 +- .../levels/misty/quicksandlurker_REF.gc | 4 +- .../reference/levels/ogre/ogreboss_REF.gc | 2 +- .../levels/racer_common/racer-states_REF.gc | 2 +- .../levels/robocave/cave-trap_REF.gc | 4 +- .../rolling/rolling-lightning-mole_REF.gc | 8 +- .../reference/levels/snow/ice-cube_REF.gc | 22 +- .../reference/levels/snow/snow-bunny_REF.gc | 36 +- .../levels/snow/snow-ram-boss_REF.gc | 34 +- .../reference/levels/snow/yeti_REF.gc | 16 +- .../reference/levels/sunken/bully_REF.gc | 2 +- .../levels/sunken/double-lurker_REF.gc | 20 +- .../reference/levels/sunken/orbit-plat_REF.gc | 12 +- .../reference/levels/sunken/puffer_REF.gc | 2 +- .../reference/levels/swamp/billy_REF.gc | 8 +- .../reference/levels/swamp/kermit_REF.gc | 10 +- .../levels/swamp/swamp-rat-nest_REF.gc | 2 +- .../reference/levels/swamp/swamp-rat_REF.gc | 8 +- .../levels/village1/village-obs_REF.gc | 4 +- .../reference/levels/village1/yakow_REF.gc | 12 +- test/goalc/test_with_game.cpp | 2 +- test/test_data/test_game_text.txt | 2 +- test/test_reader.cpp | 8 +- 185 files changed, 6172 insertions(+), 11465 deletions(-) delete mode 100644 decompiler/config/jak1_ntsc_black_label/new_strings.jsonc rename game/assets/{game_subtitle.txt => game_subtitle.gp} (66%) create mode 100644 game/assets/game_text.gp rename game/assets/{subtitle/jak1 => jak1/subtitle}/game_subtitle_en.txt (100%) rename game/assets/{subtitle/jak1 => jak1/subtitle}/game_subtitle_es.txt (100%) create mode 100644 game/assets/jak1/text/game_text_en.txt delete mode 100644 goal_src/pc/engine/ui/progress-h.gc delete mode 100644 goal_src/pc/engine/ui/progress/progress-draw.gc delete mode 100644 goal_src/pc/engine/ui/progress/progress-static.gc delete mode 100644 goal_src/pc/engine/ui/progress/progress.gc delete mode 100644 goal_src/pc/engine/ui/text-h.gc create mode 100644 goal_src/pc/progress-pc.gc diff --git a/common/cross_os_debug/xdbg.cpp b/common/cross_os_debug/xdbg.cpp index c3179cad15..f8989b13a1 100644 --- a/common/cross_os_debug/xdbg.cpp +++ b/common/cross_os_debug/xdbg.cpp @@ -38,9 +38,7 @@ ThreadID::ThreadID(pid_t _id) : id(_id) {} /*! * In Linux, the string representation of a ThreadID is just the number printed in base 10 */ -ThreadID::ThreadID(const std::string& str) { - id = std::stoi(str); -} +ThreadID::ThreadID(const std::string& str) : id(std::stoi(str)) {} std::string ThreadID::to_string() const { return std::to_string(id); diff --git a/common/goos/PrettyPrinter2.cpp b/common/goos/PrettyPrinter2.cpp index e0f64641f7..a3e06fc1aa 100644 --- a/common/goos/PrettyPrinter2.cpp +++ b/common/goos/PrettyPrinter2.cpp @@ -17,15 +17,10 @@ namespace v2 { struct Node { Node() = default; - Node(const std::string& str) { - kind = Kind::ATOM; - atom_str = str; - } + Node(const std::string& str) : kind(Kind::ATOM), atom_str(str) {} - Node(std::vector&& list, bool is_list) { - kind = is_list ? Kind::LIST : Kind::IMPROPER_LIST; - child_nodes = std::move(list); - } + Node(std::vector&& list, bool is_list) + : kind(is_list ? Kind::LIST : Kind::IMPROPER_LIST), child_nodes(std::move(list)) {} enum class Kind : u8 { ATOM, LIST, IMPROPER_LIST, INVALID } kind = Kind::INVALID; std::vector child_nodes; diff --git a/common/type_system/Type.cpp b/common/type_system/Type.cpp index d7e0366040..29282a5daa 100644 --- a/common/type_system/Type.cpp +++ b/common/type_system/Type.cpp @@ -936,12 +936,16 @@ std::string BasicType::diff_impl(const Type& other_) const { // Bitfield ///////////////// -BitField::BitField(TypeSpec type, std::string name, int offset, int size) - : m_type(std::move(type)), m_name(std::move(name)), m_offset(offset), m_size(size) {} +BitField::BitField(TypeSpec type, std::string name, int offset, int size, bool skip_in_decomp) + : m_type(std::move(type)), + m_name(std::move(name)), + m_offset(offset), + m_size(size), + m_skip_in_static_decomp(skip_in_decomp) {} bool BitField::operator==(const BitField& other) const { return m_type == other.m_type && m_name == other.m_name && m_offset == other.m_offset && - other.m_size == m_size; + m_size == other.m_size; } std::string BitField::diff(const BitField& other) const { @@ -963,6 +967,11 @@ std::string BitField::diff(const BitField& other) const { result += fmt::format("size: {} vs. {}\n", m_size, other.m_size); } + if (m_skip_in_static_decomp != other.m_skip_in_static_decomp) { + result += fmt::format("skip_in_static_decomp: {} vs. {}\n", m_skip_in_static_decomp, + other.m_skip_in_static_decomp); + } + return result; } diff --git a/common/type_system/Type.h b/common/type_system/Type.h index cb101a5bb5..02a544bbe1 100644 --- a/common/type_system/Type.h +++ b/common/type_system/Type.h @@ -325,11 +325,12 @@ class BasicType : public StructureType { class BitField { public: BitField() = default; - BitField(TypeSpec type, std::string name, int offset, int size); + BitField(TypeSpec type, std::string name, int offset, int size, bool skip_in_decomp); const std::string name() const { return m_name; } int offset() const { return m_offset; } int size() const { return m_size; } const TypeSpec& type() const { return m_type; } + bool skip_in_decomp() const { return m_skip_in_static_decomp; } bool operator==(const BitField& other) const; bool operator!=(const BitField& other) const { return !((*this) == other); } std::string diff(const BitField& other) const; @@ -340,6 +341,7 @@ class BitField { std::string m_name; int m_offset = -1; // in bits int m_size = -1; // in bits. + bool m_skip_in_static_decomp = false; }; class BitFieldType : public ValueType { diff --git a/common/type_system/TypeSystem.cpp b/common/type_system/TypeSystem.cpp index 17dfc90c7e..4493324bd7 100644 --- a/common/type_system/TypeSystem.cpp +++ b/common/type_system/TypeSystem.cpp @@ -1588,7 +1588,8 @@ void TypeSystem::add_field_to_bitfield(BitFieldType* type, const std::string& field_name, const TypeSpec& field_type, int offset, - int field_size) { + int field_size, + bool skip_in_decomp) { // in bits auto load_size = lookup_type(field_type)->get_load_size() * 8; if (field_size == -1) { @@ -1616,7 +1617,7 @@ void TypeSystem::add_field_to_bitfield(BitFieldType* type, type->get_name(), field_name, offset, offset + field_size); } - BitField field(field_type, field_name, offset, field_size); + BitField field(field_type, field_name, offset, field_size, skip_in_decomp); type->m_fields.push_back(field); } diff --git a/common/type_system/TypeSystem.h b/common/type_system/TypeSystem.h index b47f90b726..8943d6548f 100644 --- a/common/type_system/TypeSystem.h +++ b/common/type_system/TypeSystem.h @@ -222,7 +222,8 @@ class TypeSystem { const std::string& field_name, const TypeSpec& field_type, int offset, - int field_size); + int field_size, + bool skip_in_decomp); bool should_use_virtual_methods(const Type* type, int method_id) const; bool should_use_virtual_methods(const TypeSpec& type, int method_id) const; diff --git a/common/type_system/defenum.cpp b/common/type_system/defenum.cpp index 268ada104d..c0a83c3e14 100644 --- a/common/type_system/defenum.cpp +++ b/common/type_system/defenum.cpp @@ -60,7 +60,7 @@ EnumType* parse_defenum(const goos::Object& defenum, TypeSystem* ts) { while (current.is_symbol() && symbol_string(current).at(0) == ':') { auto option_name = symbol_string(current); iter = cdr(iter); - auto option_value = car(iter); + auto& option_value = car(iter); iter = cdr(iter); if (option_name == ":type") { @@ -82,7 +82,7 @@ EnumType* parse_defenum(const goos::Object& defenum, TypeSystem* ts) { } for (auto& e : other_info->entries()) { if (entries.find(e.first) != entries.end()) { - throw std::runtime_error(fmt::format("Entry {} appears multiple times.", e.first)); + throw std::runtime_error(fmt::format("Entry {} appears multiple times", e.first)); } entries[e.first] = e.second; } diff --git a/common/type_system/deftype.cpp b/common/type_system/deftype.cpp index b3dc903103..075a2077ec 100644 --- a/common/type_system/deftype.cpp +++ b/common/type_system/deftype.cpp @@ -163,6 +163,7 @@ void add_bitfield(BitFieldType* bitfield_type, TypeSystem* ts, const goos::Objec int offset_override = -1; int size_override = -1; + bool skip_in_decomp = false; if (!rest->is_empty_list()) { while (!rest->is_empty_list()) { @@ -175,6 +176,8 @@ void add_bitfield(BitFieldType* bitfield_type, TypeSystem* ts, const goos::Objec } else if (opt_name == ":size") { size_override = get_int(car(rest)); rest = cdr(rest); + } else if (opt_name == ":do-not-decompile") { + skip_in_decomp = true; } else { throw std::runtime_error("Invalid option in field specification: " + opt_name); } @@ -186,7 +189,8 @@ void add_bitfield(BitFieldType* bitfield_type, TypeSystem* ts, const goos::Objec } // it's fine if the size is -1, that means it'll just use the type's size. - ts->add_field_to_bitfield(bitfield_type, name, type, offset_override, size_override); + ts->add_field_to_bitfield(bitfield_type, name, type, offset_override, size_override, + skip_in_decomp); } void declare_method(Type* type, TypeSystem* type_system, const goos::Object& def) { diff --git a/decompiler/IR2/AtomicOpForm.cpp b/decompiler/IR2/AtomicOpForm.cpp index 9b8ec33f85..5179253a34 100644 --- a/decompiler/IR2/AtomicOpForm.cpp +++ b/decompiler/IR2/AtomicOpForm.cpp @@ -524,8 +524,8 @@ FormElement* make_label_load(int label_idx, if (as_bitfield && load_kind != LoadVarOp::Kind::FLOAT && load_size == 8) { // get the data ASSERT((label.offset % 8) == 0); - auto word0 = env.file->words_by_seg.at(label.target_segment).at(label.offset / 4); - auto word1 = env.file->words_by_seg.at(label.target_segment).at(1 + (label.offset / 4)); + auto& word0 = env.file->words_by_seg.at(label.target_segment).at(label.offset / 4); + auto& word1 = env.file->words_by_seg.at(label.target_segment).at(1 + (label.offset / 4)); ASSERT(word0.kind() == LinkedWord::PLAIN_DATA); ASSERT(word1.kind() == LinkedWord::PLAIN_DATA); u64 value; diff --git a/decompiler/config.cpp b/decompiler/config.cpp index c5b6b724a6..9654568f21 100644 --- a/decompiler/config.cpp +++ b/decompiler/config.cpp @@ -224,18 +224,6 @@ Config read_config_file(const std::string& path_to_config_file, config.levels_to_extract = inputs_json.at("levels_to_extract").get>(); config.levels_extract = cfg.at("levels_extract").get(); - // get new strings - if (!cfg.contains("new_strings_file")) { - return config; - } - - auto new_strings_json = read_json_file_from_config(cfg, "new_strings_file"); - config.new_strings_same_across_langs = new_strings_json.at("same_across_languages") - .get>(); - config.new_strings_different_across_langs = - new_strings_json.at("different_across_languages") - .get>>(); - return config; } diff --git a/decompiler/config.h b/decompiler/config.h index 9cf1eb26f5..52a61c6e23 100644 --- a/decompiler/config.h +++ b/decompiler/config.h @@ -130,9 +130,6 @@ struct Config { std::unordered_map> stack_structure_hints_by_function; - std::unordered_map new_strings_same_across_langs; - std::unordered_map> new_strings_different_across_langs; - std::unordered_map bad_format_strings; std::vector levels_to_extract; diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index 0ccf426857..c41bdff0a4 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -703,24 +703,24 @@ :bitfield #t :type uint32 (display-marks 0) - (bit1 1) ;; TODO - nav-control::9 - (bit2 2) ;; TODO - nav-control::9 - (bit3 3) ;; TODO - nav-enemy::45 | nav-control::9 - (bit4 4) ;; TODO - nav-control::9 - (bit5 5) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 - (bit6 6) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 - (bit7 7) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 - (bit8 8) - (bit9 9) ;; TODO - nav-control::14 | 11 - (bit10 10) ;; TODO - nav-enemy::nav-enemy-patrol-post - (bit11 11) ;; TODO - nav-control::28 - (bit12 12) ;; TODO - rolling-lightning-mole::(enter nav-enemy-chase fleeing-nav-enemy) - (bit13 13) - (bit17 17) ;; TODO - nav-control::11 - (bit18 18) ;; TODO - nav-control::11 - (bit19 19) ;; TODO - nav-control::11 | 17 - (bit20 20) ;; TODO - nav-mesh::28 - (bit21 21) ;; TODO - nav-control::19 + (navcf1 1) ;; TODO - nav-control::9 + (navcf2 2) ;; TODO - nav-control::9 + (navcf3 3) ;; TODO - nav-enemy::45 | nav-control::9 + (navcf4 4) ;; TODO - nav-control::9 + (navcf5 5) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 + (navcf6 6) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 + (navcf7 7) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 + (navcf8 8) + (navcf9 9) ;; TODO - nav-control::14 | 11 + (navcf10 10) ;; TODO - nav-enemy::nav-enemy-patrol-post + (navcf11 11) ;; TODO - nav-control::28 + (navcf12 12) ;; TODO - rolling-lightning-mole::(enter nav-enemy-chase fleeing-nav-enemy) + (navcf13 13) + (navcf17 17) ;; TODO - nav-control::11 + (navcf18 18) ;; TODO - nav-control::11 + (navcf19 19) ;; TODO - nav-control::11 | 17 + (navcf20 20) ;; TODO - nav-mesh::28 + (navcf21 21) ;; TODO - nav-control::19 ) (defenum task-status @@ -1300,6 +1300,68 @@ (inc #xf10) (europe #xf11) + + ;; extra IDs for pc port + (camera-options #x1000) + (normal #x1001) + (inverted #x1002) + (camera-controls-horz #x1003) + (camera-controls-vert #x1004) + (misc-options #x100f) + (accessibility-options #x1010) + (money-starburst #x1011) + (ps2-options #x1020) + (ps2-load-speed #x1021) + (ps2-parts #x1022) + (discord-rpc #x1030) + (display-mode #x1031) + (windowed #x1032) + (borderless #x1033) + (fullscreen #x1034) + (game-resolution #x1035) + (resolution-fmt #x1036) + (ps2-aspect-ratio #x1037) + (ps2-aspect-ratio-msg #x1038) + (aspect-ratio-ps2 #x1039) + (fit-to-screen #x103a) + (msaa #x1050) + (x-times-fmt #x1051) + (2-times #x1052) + (4-times #x1053) + (8-times #x1054) + (16-times #x1055) + (frame-rate #x1060) + (lod-bg #x1070) + (lod-fg #x1071) + (lod-highest #x1072) + (lod-high #x1073) + (lod-mid #x1074) + (lod-low #x1075) + (lod-lowest #x1076) + (lod-ps2 #x1077) + (subtitles #x1078) + (hinttitles #x1079) + (subtitles-language #x107a) + (subtitles-speaker #x107b) + (speaker-always #x107c) + (speaker-never #x107d) + (speaker-auto #x107e) + (hint-log #x107f) + (cheats #x1080) + (cheat-eco-blue #x1090) + (cheat-eco-red #x1091) + (cheat-eco-green #x1092) + (cheat-eco-yellow #x1093) + (cheat-sidekick-alt #x1094) + (cheat-invinc #x1095) + (music-player #x10c0) + (scene-player #x10c1) + (play-credits #x10c2) + (scrapbook #x10c3) + (scene-0 #x1100) + (scene-255 #x11ff) + (hint-0 #x1200) + (hint-511 #x13ff) ;; GAME-TEXT-ID ENUM ENDS ) @@ -10111,7 +10173,7 @@ ;; - Types (deftype pat-surface (uint32) - ((skip uint8 :offset 0 :size 3) + ((skip uint8 :offset 0 :size 3 :do-not-decompile) (mode pat-mode :offset 3 :size 3) (material pat-material :offset 6 :size 6) (camera uint8 :offset 12 :size 2) @@ -11478,13 +11540,26 @@ ) ) +(defenum nav-flags + :bitfield #t + :type uint8 + (navf0 0) + (navf1 1) + (navf2 2) + (navf3 3) + (navf4 4) + (navf5 5) + (navf6 6) + (navf7 7) + ) + (declare-type collide-edge-hold-list structure) (declare-type collide-work structure) (declare-type touching-shapes-entry structure) (deftype collide-shape (trsqv) - ((process process-drawable :offset-assert 140) + ((process process-drawable :offset-assert 140) (max-iteration-count uint8 :offset-assert 144) - (nav-flags uint8 :offset-assert 145) + (nav-flags nav-flags :offset-assert 145) (pad-byte uint8 2 :offset-assert 146) (pat-ignore-mask pat-surface :offset-assert 148) (event-self basic :offset-assert 152) @@ -12722,15 +12797,15 @@ (debug-draw (_type_) none 9) (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result int) float 10) (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol 11) - (fill-and-probe-using-y-probe (_type_ vector float collide-kind process collide-tri-result uint) float 12) + (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12) (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13) (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable int) none 14) (fill-using-spheres (_type_ collide-using-spheres-params) none 15) - (fill-using-y-probe (_type_ vector float collide-kind process-drawable uint) none 16) + (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16) (initialize (_type_) none 17) (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result int) float 18) (probe-using-spheres (_type_ collide-using-spheres-params) symbol 19) - (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result uint) float 20) + (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20) (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) ;; second functiom is method 28 (fill-from-foreground-using-box (_type_) none 22) (fill-from-foreground-using-line-sphere (_type_) none 23) @@ -15133,20 +15208,6 @@ :flag-assert #x900000034 ) -(deftype game-option (basic) - ((option-type uint64 :offset-assert 8) - (name game-text-id :offset-assert 16) - (scale basic :offset-assert 20) - (param1 float :offset-assert 24) - (param2 float :offset-assert 28) - (param3 int32 :offset-assert 32) - (value-to-modify pointer :offset-assert 36) ;; pointer to - symbol | ? - ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 - ) - (defenum progress-screen :type int64 (invalid -1) @@ -15185,6 +15246,70 @@ (no-disc 32) (bad-disc 33) (quit 34) + + ;; extra screens for pc port + (camera-options) + (accessibility-options) + (game-ps2-options) + (misc-options) + (resolution) + (aspect-msg) + (aspect-ratio) + (gfx-ps2-options) + (secrets) + (hint-log) + (cheats) + (scrapbook) + (music-player) + (scene-player) + (credits) + + ;; the last one! + (max) + ) + +(defenum game-option-type + :type uint64 + (slider 0) + (language 1) + (on-off 2) + (center-screen 3) + (aspect-ratio 4) + (video-mode 5) + (menu 6) + (yes-no 7) + (button 8) + + ;; extra types for pc port + (normal-inverted) + (display-mode) + (msaa) + (frame-rate) + (lod-bg) + (lod-fg) + (resolution) + (aspect-new) + (language-subtitles) + (speaker) + (aspect-native) + ) + +(defenum game-option-menu + :type int32 + :copy-entries progress-screen) + +(deftype game-option (basic) + ((option-type game-option-type :offset-assert 8) + (name game-text-id :offset-assert 16) + (scale symbol :offset-assert 20) + (param1 float :offset-assert 24) + (param2 float :offset-assert 28) + (param3 game-option-menu :offset-assert 32) + (value-to-modify pointer :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 ) (deftype progress (process) @@ -15206,8 +15331,8 @@ (force-transition basic :offset-assert 180) (stat-transition basic :offset-assert 184) (level-transition int32 :offset-assert 188) - (language-selection uint64 :offset-assert 192) - (language-direction basic :offset-assert 200) + (language-selection language-enum :offset-assert 192) + (language-direction symbol :offset-assert 200) (language-transition basic :offset-assert 204) (language-x-offset int32 :offset-assert 208) (sides-x-scale float :offset-assert 212) @@ -15231,8 +15356,8 @@ (total-nb-of-orbs int32 :offset-assert 284) (total-nb-of-buzzers int32 :offset-assert 288) (card-info mc-slot-info :offset-assert 292) - (last-option-index-change time-frame :offset-assert 296) - (video-mode-timeout time-frame :offset-assert 304) + (last-option-index-change time-frame :offset-assert 296) + (video-mode-timeout time-frame :offset-assert 304) (display-state-stack progress-screen 5 :offset-assert 312) (option-index-stack int32 5 :offset-assert 352) (display-state-pos int32 :offset-assert 372) @@ -15248,12 +15373,12 @@ :heap-base #x270 :flag-assert #x3b027002dc (:methods - (dummy-14 (_type_) none 14) - (dummy-15 (_type_) none 15) - (dummy-16 (_type_) none 16) + (progress-dummy-14 (_type_) none 14) ;; unused + (progress-dummy-15 (_type_) none 15) ;; unused + (progress-dummy-16 (_type_) none 16) ;; unused (draw-progress (_type_) none 17) - (dummy-18 () none 18) - (dummy-19 (_type_) symbol 19) + (progress-dummy-18 () none 18) ;; unused + (visible? (_type_) symbol 19) (hidden? (_type_) symbol 20) (adjust-sprites (_type_) none 21) (adjust-icons (_type_) none 22) @@ -15263,10 +15388,10 @@ (draw-buzzer-screen (_type_ int) none 26) (draw-notice-screen (_type_) none 27) (draw-options (_type_ int int float) none 28) - (dummy-29 (_type_) none 29) + (respond-common (_type_) none 29) (respond-progress (_type_) none 30) - (dummy-31 (_type_) none 31) - (dummy-32 (_type_) symbol 32) + (respond-memcard (_type_) none 31) + (can-go-back? (_type_) symbol 32) (initialize-icons (_type_) none 33) (initialize-particles (_type_) none 34) (draw-memcard-storage-error (_type_ font-context) none 35) @@ -15278,16 +15403,16 @@ (draw-memcard-auto-save-error (_type_ font-context) none 41) (draw-memcard-removed (_type_ font-context) none 42) (draw-memcard-error (_type_ font-context) none 43) - (dummy-44 (_type_) none 44) + (progress-dummy-44 (_type_) none 44) ;; unused (push! (_type_) none 45) (pop! (_type_) none 46) - (dummy-47 (_type_) none 47) + (progress-dummy-47 (_type_) none 47) ;; unused (enter! (_type_ progress-screen int) none 48) (draw-memcard-format (_type_ font-context) none 49) (draw-auto-save (_type_ font-context) none 50) (set-transition-progress! (_type_ int) none 51) (set-transition-speed! (_type_) none 52) - (dummy-53 (_type_ progress-screen) progress-screen 53) + (set-memcard-screen (_type_ progress-screen) progress-screen 53) (draw-pal-change-to-60hz (_type_ font-context) none 54) (draw-pal-now-60hz (_type_ font-context) none 55) (draw-no-disc (_type_ font-context) none 56) @@ -17669,7 +17794,7 @@ (life 201) (money 202) (money-total 203) - (moeny-per-level 204) + (money-per-level 204) (buzzer-total 205) (fuel-cell 206) (death-movie-tick 207) @@ -21631,7 +21756,7 @@ (starting-state progress-screen :offset-assert 24) (last-slot-saved int32 :offset-assert 32) (slider-backup float :offset-assert 36) - (language-backup int64 :offset-assert 40) + (language-backup language-enum :offset-assert 40) (on-off-backup symbol :offset-assert 48) (center-x-backup int32 :offset-assert 52) (center-y-backup int32 :offset-assert 56) @@ -21710,7 +21835,7 @@ (define-extern projectile-collision-reaction (function collide-shape-moving collide-shape-intersect vector vector uint)) (define-extern projectile-update-velocity-space-wars (function projectile none)) (define-extern find-nearest-attackable (function vector float uint uint vector float projectile)) ;; Whatever te search returns (match from search-info) -(define-extern find-ground-and-draw-shadow (function vector vector float collide-kind process float float none)) +(define-extern find-ground-and-draw-shadow (function vector vector float collide-kind process-drawable float float none)) (define-extern spawn-projectile-blue (function target none)) ;; - Unknowns @@ -22676,7 +22801,7 @@ (use-proximity-notice symbol :offset-assert 204) (use-jump-blocked symbol :offset-assert 208) (use-jump-patrol symbol :offset-assert 212) - (gnd-collide-with uint64 :offset-assert 216) + (gnd-collide-with collide-kind :offset-assert 216) (debug-draw-neck symbol :offset-assert 224) (debug-draw-jump symbol :offset-assert 228) ) @@ -22685,6 +22810,43 @@ :flag-assert #x9000000e8 ) +(defenum nav-enemy-flags + :bitfield #t + :type uint32 + (navenmf0 0) + (navenmf1 1) + (navenmf2 2) + (enable-rotate 3) + (enable-travel 4) + (navenmf5 5) + (navenmf6 6) + (navenmf7 7) + (navenmf8 8) + (standing-jump 9) + (drop-jump 10) + (navenmf11 11) + (navenmf12 12) + (navenmf13 13) + (navenmf14 14) + (navenmf15 15) + (navenmf16 16) + (navenmf17 17) + (navenmf18 18) + (navenmf19 19) + (navenmf20 20) + (navenmf21 21) + (navenmf22 22) + (navenmf23 23) + (navenmf24 24) + (navenmf25 25) + (navenmf26 26) + (navenmf27 27) + (navenmf28 28) + (navenmf29 29) + (navenmf30 30) + (navenmf31 31) + ) + (deftype nav-enemy (process-drawable) ((collide-info collide-shape-moving :score 100 :offset 112) (enemy-info fact-info-enemy :score 100 :offset 144) @@ -22693,22 +22855,22 @@ (frustration-point vector :inline :offset-assert 208) (jump-dest vector :inline :offset-assert 224) (jump-trajectory trajectory :inline :offset-assert 240) - (jump-time time-frame :offset-assert 280) + (jump-time time-frame :offset-assert 280) (nav-info nav-enemy-info :offset-assert 288) (target-speed float :offset-assert 292) (momentum-speed float :offset-assert 296) (acceleration float :offset-assert 300) (rotate-speed float :offset-assert 304) - (turn-time time-frame :offset-assert 312) - (frustration-time time-frame :offset-assert 320) + (turn-time time-frame :offset-assert 312) + (frustration-time time-frame :offset-assert 320) (speed-scale float :offset-assert 328) (neck joint-mod :offset-assert 332) - (reaction-time time-frame :offset-assert 336) - (notice-time time-frame :offset-assert 344) - (state-timeout time-frame :offset-assert 352) - (free-time time-frame :offset-assert 360) - (touch-time time-frame :offset-assert 368) - (nav-enemy-flags uint32 :offset-assert 376) + (reaction-time time-frame :offset-assert 336) + (notice-time time-frame :offset-assert 344) + (state-timeout time-frame :offset-assert 352) + (free-time time-frame :offset-assert 360) + (touch-time time-frame :offset-assert 368) + (nav-enemy-flags nav-enemy-flags :offset-assert 376) (incomming-attack-id handle :offset-assert 384) (jump-return-state (state process) :offset-assert 392) (rand-gen random-generator :offset-assert 396) diff --git a/decompiler/config/jak1_ntsc_black_label.jsonc b/decompiler/config/jak1_ntsc_black_label.jsonc index 5682405412..ef42a305e6 100644 --- a/decompiler/config/jak1_ntsc_black_label.jsonc +++ b/decompiler/config/jak1_ntsc_black_label.jsonc @@ -74,7 +74,6 @@ "stack_structures_file": "decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc", "hacks_file": "decompiler/config/jak1_ntsc_black_label/hacks.jsonc", "inputs_file": "decompiler/config/jak1_ntsc_black_label/inputs.jsonc", - "new_strings_file": "decompiler/config/jak1_ntsc_black_label/new_strings.jsonc", // optional: a predetermined object file name map from a file. // this will make decompilation naming consistent even if you only run on some objects. diff --git a/decompiler/config/jak1_ntsc_black_label/hacks.jsonc b/decompiler/config/jak1_ntsc_black_label/hacks.jsonc index fbaccc3a63..254a73b49f 100644 --- a/decompiler/config/jak1_ntsc_black_label/hacks.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/hacks.jsonc @@ -18,7 +18,8 @@ "cond_with_else_max_lengths": [ ["(method 20 res-lump)", "b0", 2], ["(method 11 res-lump)", "b0", 1], - ["(method 12 res-lump)", "b0", 1] + ["(method 12 res-lump)", "b0", 1], + ["(method 31 progress)", "b35", 1] ], // if a cond with an else case is being used a value in a place where it looks wrong diff --git a/decompiler/config/jak1_ntsc_black_label/inputs.jsonc b/decompiler/config/jak1_ntsc_black_label/inputs.jsonc index 957a623564..58293804f8 100644 --- a/decompiler/config/jak1_ntsc_black_label/inputs.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/inputs.jsonc @@ -262,7 +262,14 @@ //"audio_dir_file_name": "jak1/VAG", "audio_dir_file_name": "", - "streamed_audio_file_names": ["VAGWAD.ENG", "VAGWAD.JAP"], + "streamed_audio_file_names": [ + "VAGWAD.ENG", + "VAGWAD.FRE", + "VAGWAD.SPA", + "VAGWAD.GER", + "VAGWAD.ITA", + "VAGWAD.JAP" + ], "levels_to_extract": [ "BEA.DGO", diff --git a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc index 355241485e..1fb1823595 100644 --- a/decompiler/config/jak1_ntsc_black_label/label_types.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/label_types.jsonc @@ -244,7 +244,29 @@ ["L231", "(pointer uint64)", 1] ], - "progress-static": [["L121", "(array game-text-id)"]], + "progress-static": [ + ["L121", "(array game-text-id)"], + ["L195", "(array game-option)"], + ["L190", "(array game-option)"], + ["L185", "(array game-option)"], + ["L180", "(array game-option)"], + ["L174", "(array game-option)"], + ["L169", "(array game-option)"], + ["L165", "(array game-option)"], + ["L161", "(array game-option)"], + ["L157", "(array game-option)"], + ["L152", "(array game-option)"], + ["L147", "(array game-option)"], + ["L145", "(array game-option)"], + ["L143", "(array game-option)"], + ["L137", "(array game-option)"], + ["L131", "(array game-option)"], + ["L124", "(array game-option)"], + ["L123", "(array (array game-option))"], + ["L122", "(array int32)"], + ["L3", "(array level-tasks-info)"], + ["L2", "(array int32)"] + ], "rigid-body": [["L89", "rigid-body-platform-constants"]], diff --git a/decompiler/config/jak1_ntsc_black_label/new_strings.jsonc b/decompiler/config/jak1_ntsc_black_label/new_strings.jsonc deleted file mode 100644 index eed40d182b..0000000000 --- a/decompiler/config/jak1_ntsc_black_label/new_strings.jsonc +++ /dev/null @@ -1,57 +0,0 @@ -{ - "same_across_languages": { - "1008": "UK ENGLISH", - "1009": "PORTUGUÊS", - "1010": "SUOMALAINEN", - "1011": "SVENSKA", - "1012": "DANSK", - "1013": "NORSK", - "1014": "KOREAN", - "1015": "RUSSIAN", - "1022": "4:3", - "1023": "5:4", - "1024": "16:9", - "1025": "21:9", - "1026": "32:9", - "1027": "640X480", - "1028": "800X600", - "1029": "1024X768", - "1030": "1280X960", - "1031": "1600X1200", - "1032": "960X768", - "1033": "1280X1024", - "1034": "1500X1200", - "1035": "854X480", - "1036": "1280X720", - "1037": "1920X1080", - "1038": "2560X1440", - "1039": "2880X1620", - "1040": "3840X2160", - "1041": "5120X2880", - "1042": "2560X1080", - "1043": "3120X1440", - "1044": "3200X1440", - "1045": "3440X1440", - "1046": "3840X1600", - "1047": "5120X2160", - "1048": "5120X1440" - }, - // will pad the rest of the array with 'TODO' placeholder - "different_across_languages": { - "1000": ["RESOLUTION"], - "1001": ["DISPLAY MODE"], - "1002": ["LETTERBOX"], - "1003": ["SUBTITLES"], - "1004": ["SUBTITLE SPEAKER"], - "1005": ["DISCORD RPC"], - "1006": ["LANGUAGE OPTIONS"], - "1007": ["SUBTITLE LANGUAGE"], - "1016": ["ON"], - "1017": ["OFF"], - "1018": ["AUTO"], - "1019": ["BORDERLESS"], - "1020": ["FULLSCREEN"], - "1021": ["WINDOWED"], - "1049": ["USE ORIGINAL ASPECT"] - } -} diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index 2b01113675..ba4a567d55 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -7024,6 +7024,7 @@ [608, "a1", "(pointer symbol)"], [617, "v1", "(pointer symbol)"], [626, "a1", "(pointer symbol)"], + [883, "a0", "(pointer language-enum)"], [894, "a0", "(pointer symbol)"], [921, "a0", "(pointer symbol)"] ], diff --git a/decompiler/data/game_text.cpp b/decompiler/data/game_text.cpp index 7883c1c9a6..7fbe7e83a4 100644 --- a/decompiler/data/game_text.cpp +++ b/decompiler/data/game_text.cpp @@ -153,8 +153,12 @@ std::string write_game_text( // write! std::string result; // = "\xEF\xBB\xBF"; // UTF-8 encode (don't need this anymore) - result += fmt::format("(language-count {})\n", languages.size()); result += "(group-name \"common\")\n"; + result += "(language-id"; + for (auto lang : languages) { + result += fmt::format(" {}", lang); + } + result += ")\n"; for (auto& x : text_by_id) { result += fmt::format("(#x{:04x}\n ", x.first); for (auto& y : x.second) { @@ -163,28 +167,6 @@ std::string write_game_text( result += ")\n\n"; } - // add our own custom text additions from new_strings.jsonc - // - first add the strings that are the same across all languages - for (auto const& [key, val] : cfg.new_strings_same_across_langs) { - result += fmt::format("(#x{}\n ", key); - for (u32 i = 0; i < languages.size(); i++) { - result += fmt::format("\"{}\"\n ", val); - } - result += ")\n\n"; - } - // - now add the ones that are different, if they do not have all languages defined, pad with - // placeholders - for (auto const& [key, val] : cfg.new_strings_different_across_langs) { - result += fmt::format("(#x{}\n ", key); - for (auto const& str : val) { - result += fmt::format("\"{}\"\n ", str); - } - for (u32 i = 0; i < languages.size() - val.size(); i++) { - result += fmt::format("\"{}\"\n ", "TODO"); - } - result += ")\n\n"; - } - return result; } } // namespace decompiler diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index 1c1ce1da43..8f226774a8 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -1475,7 +1475,8 @@ std::optional> try_decompile_bitfield_from_int( int end_bit = 64 + start_bit; for (auto& field : type_info->fields()) { - if (field.offset() < start_bit || (field.offset() + field.size()) > end_bit) { + if (field.skip_in_decomp() || field.offset() < start_bit || + (field.offset() + field.size()) > end_bit) { continue; } diff --git a/game/assets/game_subtitle.txt b/game/assets/game_subtitle.gp similarity index 66% rename from game/assets/game_subtitle.txt rename to game/assets/game_subtitle.gp index 9db0711a4d..dedcad416b 100644 --- a/game/assets/game_subtitle.txt +++ b/game/assets/game_subtitle.gp @@ -4,8 +4,8 @@ ;; you can find the game-text-version parsing in .cpp and an enum in goal-lib.gc (subtitle - (jak1-v1 "game/assets/subtitle/jak1/game_subtitle_en.txt") - (jak1-v1 "game/assets/subtitle/jak1/game_subtitle_es.txt") + (jak1-v1 "game/assets/jak1/subtitle/game_subtitle_en.txt") + (jak1-v1 "game/assets/jak1/subtitle/game_subtitle_es.txt") ) diff --git a/game/assets/game_text.gp b/game/assets/game_text.gp new file mode 100644 index 0000000000..728481ca1c --- /dev/null +++ b/game/assets/game_text.gp @@ -0,0 +1,11 @@ +;; "project file" for text make tool. +;; it's very simple... a list of (version file) +;; eventually should also include output filename +;; you can find the game-text-version parsing in .cpp and an enum in goal-lib.gc + +(text + (jak1-v1 "assets/game_text.txt") + (jak1-v1 "game/assets/jak1/text/game_text_en.txt") + ) + + diff --git a/game/assets/subtitle/jak1/game_subtitle_en.txt b/game/assets/jak1/subtitle/game_subtitle_en.txt similarity index 100% rename from game/assets/subtitle/jak1/game_subtitle_en.txt rename to game/assets/jak1/subtitle/game_subtitle_en.txt diff --git a/game/assets/subtitle/jak1/game_subtitle_es.txt b/game/assets/jak1/subtitle/game_subtitle_es.txt similarity index 100% rename from game/assets/subtitle/jak1/game_subtitle_es.txt rename to game/assets/jak1/subtitle/game_subtitle_es.txt diff --git a/game/assets/jak1/text/game_text_en.txt b/game/assets/jak1/text/game_text_en.txt new file mode 100644 index 0000000000..6b19d8509c --- /dev/null +++ b/game/assets/jak1/text/game_text_en.txt @@ -0,0 +1,143 @@ +(group-name "common") +(language-id 0 6) + +;; ----------------- +;; progress menu (insanity) + +(#x1000 "CAMERA OPTIONS" + "CAMERA OPTIONS") +(#x1001 "NORMAL" + "NORMAL") +(#x1002 "INVERTED" + "INVERTED") +(#x1003 "HORIZONTAL CAMERA CONTROL" + "HORIZONTAL CAMERA CONTROL") +(#x1004 "VERTICAL CAMERA CONTROL" + "VERTICAL CAMERA CONTROL") + +(#x100f "MISCELLANEOUS" + "MISCELLANEOUS") + +(#x1010 "ACCESSIBILITY" + "ACCESSIBILITY") +(#x1011 "PRECURSOR ORB GLOW" + "PRECURSOR ORB GLOW") + +(#x1020 "PS2 OPTIONS" + "PS2 OPTIONS") +(#x1021 "PS2 LOAD SPEED" + "PS2 LOAD SPEED") +(#x1022 "PARTICLE CULLING" + "PARTICLE CULLING") + +(#x1030 "DISCORD RICH-PRESENCE" + "DISCORD RICH-PRESENCE") + +(#x1031 "DISPLAY MODE" + "DISPLAY MODE") +(#x1032 "WINDOWED" + "WINDOWED") +(#x1033 "BORDERLESS" + "BORDERLESS") +(#x1034 "FULLSCREEN" + "FULLSCREEN") + +(#x1035 "GAME RESOLUTION" + "GAME RESOLUTION") +(#x1036 "~D X ~D" + "~D X ~D") + +(#x1037 "PS2 ASPECT RATIO" + "PS2 ASPECT RATIO") +(#x1038 "WHEN PS2 ASPECT RATIO IS ENABLED, ONLY 4X3 AND 16X9 ASPECT RATIO CAN BE SELECTED. CONTINUE?" + "WHEN PS2 ASPECT RATIO IS ENABLED, ONLY 4X3 AND 16X9 ASPECT RATIO CAN BE SELECTED. CONTINUE?") +(#x1039 "ASPECT RATIO (PS2)" + "ASPECT RATIO (PS2)") +(#x103a "FIT TO SCREEN" + "FIT TO SCREEN") + +(#x1050 "MSAA" + "MSAA") +(#x1051 "~DX" + "~DX") +(#x1052 "2X" + "2X") +(#x1053 "4X" + "4X") +(#x1054 "8X" + "8X") +(#x1055 "16X" + "16X") + +(#x1060 "FRAME RATE" + "FRAME RATE") + +(#x1070 "LEVEL OF DETAIL (BACKGROUND)" + "LEVEL OF DETAIL (BACKGROUND)") +(#x1071 "LEVEL OF DETAIL (FOREGROUND)" + "LEVEL OF DETAIL (FOREGROUND)") +(#x1072 "HIGHEST" + "HIGHEST") +(#x1073 "HIGH" + "HIGH") +(#x1074 "MID" + "MID") +(#x1075 "LOW" + "LOW") +(#x1076 "LOWEST" + "LOWEST") +(#x1077 "PS2" + "PS2") + +(#x1078 "SUBTITLES" + "SUBTITLES") +(#x1079 "HINT SUBTITLES" + "HINT SUBTITLES") +(#x107a "SUBTITLES LANGUAGE" + "SUBTITLES LANGUAGE") +(#x107b "SUBTITLES SPEAKER" + "SUBTITLES SPEAKER") +(#x107c "ALWAYS" + "ALWAYS") +(#x107d "NEVER" + "NEVER") +(#x107e "OFF-SCREEN" + "OFF-SCREEN") + +(#x107f "HINT LOG" + "HINT LOG") + +(#x1080 "CHEATS" + "CHEATS") +(#x1090 "INFINITE BLUE ECO" + "INFINITE BLUE ECO") +(#x1091 "INFINITE RED ECO" + "INFINITE RED ECO") +(#x1092 "INFINITE GREEN ECO" + "INFINITE GREEN ECO") +(#x1093 "INFINITE YELLOW ECO" + "INFINITE YELLOW ECO") +(#x1094 "ALTERNATE DAXTER" + "ALTERNATE DAXTER") +(#x1095 "INVINCIBILITY" + "INVINCIBILITY") + +(#x10c0 "MUSIC PLAYER" + "MUSIC PLAYER") +(#x10c1 "SCENE PLAYER" + "SCENE PLAYER") +(#x10c2 "PLAY CREDITS" + "PLAY CREDITS") +(#x10c3 "SCRAPBOOK" + "SCRAPBOOK") + + +;; ----------------- +;; test + +(#x7fff + "ARMOR" + "ARMOUR" + ) + + diff --git a/game/graphics/display.cpp b/game/graphics/display.cpp index a7248945d6..430ffade63 100644 --- a/game/graphics/display.cpp +++ b/game/graphics/display.cpp @@ -95,7 +95,7 @@ int GfxDisplay::height() { int h; m_renderer->display_size(this, NULL, &h); #ifdef _WIN32 - if (fullscreen_mode() == 2) { + if (fullscreen_mode() == Gfx::DisplayMode::Borderless) { // windows borderless hack h--; } @@ -103,14 +103,6 @@ int GfxDisplay::height() { return h; } -void GfxDisplay::set_size(int w, int h) { - m_renderer->display_set_size(this, w, h); -} - -void GfxDisplay::get_scale(float* x, float* y) { - m_renderer->display_scale(this, x, y); -} - void GfxDisplay::backup_params() { m_renderer->display_size(this, &m_width, &m_height); m_renderer->display_position(this, &m_xpos, &m_ypos); diff --git a/game/graphics/display.h b/game/graphics/display.h index a811dacb92..d1983ac44f 100644 --- a/game/graphics/display.h +++ b/game/graphics/display.h @@ -25,9 +25,9 @@ class GfxDisplay { int m_xpos; int m_ypos; - int m_fullscreen_mode = 0; + Gfx::DisplayMode m_fullscreen_mode = Gfx::DisplayMode::Windowed; + Gfx::DisplayMode m_fullscreen_target_mode = Gfx::DisplayMode::Windowed; int m_fullscreen_screen; - int m_fullscreen_target_mode = 0; int m_fullscreen_target_screen; public: @@ -45,22 +45,26 @@ class GfxDisplay { void set_renderer(GfxPipeline pipeline); void set_window(GLFWwindow* window); void set_title(const char* title); - void set_size(int w, int h); - void get_scale(float* w, float* h); + void set_size(int w, int h) { m_renderer->display_set_size(this, w, h); } + void get_scale(float* x, float* y) { m_renderer->display_scale(this, x, y); } + void get_screen_size(s64 vmode_idx, s32* w, s32* h, s32* c) { + m_renderer->screen_size(this, vmode_idx, 0, w, h, c); + } const char* title() const { return m_title; } - bool fullscreen_pending() { return m_fullscreen_mode != m_fullscreen_target_mode; } + bool fullscreen_pending() const { return m_fullscreen_mode != m_fullscreen_target_mode; } void fullscreen_flush() { m_renderer->set_fullscreen(this, m_fullscreen_target_mode, m_fullscreen_target_screen); m_fullscreen_mode = m_fullscreen_target_mode; m_fullscreen_screen = m_fullscreen_target_screen; } - void set_fullscreen(int mode, int screen) { + void set_fullscreen(Gfx::DisplayMode mode, int screen) { m_fullscreen_target_mode = mode; m_fullscreen_target_screen = screen; } - int fullscreen_mode() { return m_fullscreen_mode; } - int fullscreen_screen() { return m_fullscreen_screen; } + int fullscreen_mode() const { return m_fullscreen_mode; } + int fullscreen_screen() const { return m_fullscreen_screen; } + bool windowed() const { return m_fullscreen_mode == Gfx::DisplayMode::Windowed; } void backup_params(); int width_backup() { return m_width; } int height_backup() { return m_height; } diff --git a/game/graphics/gfx.cpp b/game/graphics/gfx.cpp index 50813fb627..03f08aa6e0 100644 --- a/game/graphics/gfx.cpp +++ b/game/graphics/gfx.cpp @@ -215,12 +215,26 @@ void get_window_scale(float* x, float* y) { } } +int get_fullscreen() { + if (Display::GetMainDisplay()) { + return Display::GetMainDisplay()->fullscreen_mode(); + } else { + return DisplayMode::Windowed; + } +} + +void get_screen_size(s64 vmode_idx, s32* w, s32* h, s32* c) { + if (Display::GetMainDisplay()) { + Display::GetMainDisplay()->get_screen_size(vmode_idx, w, h, c); + } +} + void set_letterbox(int w, int h) { g_global_settings.lbox_w = w; g_global_settings.lbox_h = h; } -void set_fullscreen(int mode, int screen) { +void set_fullscreen(DisplayMode mode, int screen) { if (Display::GetMainDisplay()) { Display::GetMainDisplay()->set_fullscreen(mode, screen); } diff --git a/game/graphics/gfx.h b/game/graphics/gfx.h index b1d2ee24b0..ff6985792e 100644 --- a/game/graphics/gfx.h +++ b/game/graphics/gfx.h @@ -31,6 +31,7 @@ struct GfxRendererModule { std::function display_set_size; std::function display_scale; std::function set_fullscreen; + std::function screen_size; std::function exit; std::function vsync; std::function sync_path; @@ -87,6 +88,8 @@ extern GfxSettings g_settings; const GfxRendererModule* GetRenderer(GfxPipeline pipeline); const GfxRendererModule* GetCurrentRenderer(); +enum DisplayMode { Windowed = 0, Fullscreen = 1, Borderless = 2 }; + u32 Init(); void Loop(std::function f); u32 Exit(); @@ -102,8 +105,10 @@ u64 get_window_width(); u64 get_window_height(); void set_window_size(u64 w, u64 h); void get_window_scale(float* x, float* y); +int get_fullscreen(); +void get_screen_size(s64 vmode_idx, s32* w, s32* h, s32* c); void set_letterbox(int w, int h); -void set_fullscreen(int mode, int screen); +void set_fullscreen(DisplayMode mode, int screen); void input_mode_set(u32 enable); void input_mode_save(); s64 get_mapped_button(s64 pad, s64 button); diff --git a/game/graphics/opengl_renderer/Profiler.cpp b/game/graphics/opengl_renderer/Profiler.cpp index 3a6d1d82d3..269478fe19 100644 --- a/game/graphics/opengl_renderer/Profiler.cpp +++ b/game/graphics/opengl_renderer/Profiler.cpp @@ -185,7 +185,7 @@ void FramePlot::draw(float max) { auto* me = (FramePlot*)data; return me->m_buffer[(me->m_idx + idx) % SIZE]; }, - (void*)this, SIZE, 0, nullptr, 0, max, ImVec2(300, 40)); + (void*)this, SIZE, 0, nullptr, 0, max, ImVec2(300, 20)); } void SmallProfiler::draw(const std::string& status, const SmallProfilerStats& stats) { @@ -219,4 +219,4 @@ void SmallProfiler::draw(const std::string& status, const SmallProfilerStats& st } } ImGui::End(); -} \ No newline at end of file +} diff --git a/game/graphics/pipelines/opengl.cpp b/game/graphics/pipelines/opengl.cpp index ade6f5c909..414aa0eecc 100644 --- a/game/graphics/pipelines/opengl.cpp +++ b/game/graphics/pipelines/opengl.cpp @@ -126,7 +126,7 @@ static int gl_init(GfxSettings& settings) { glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_FALSE); } glfwWindowHint(GLFW_DOUBLEBUFFER, GLFW_TRUE); - glfwWindowHint(GLFW_SAMPLES, 4); + glfwWindowHint(GLFW_SAMPLES, 1); return 0; } @@ -285,7 +285,7 @@ static void gl_set_fullscreen(GfxDisplay* display, int mode, int /*screen*/) { GLFWmonitor* monitor = glfwGetPrimaryMonitor(); // todo auto window = display->window_glfw; switch (mode) { - case 0: { + case Gfx::DisplayMode::Windowed: { // windowed glfwSetWindowAttrib(window, GLFW_DECORATED, GLFW_TRUE); glfwSetWindowFocusCallback(window, NULL); @@ -293,18 +293,18 @@ static void gl_set_fullscreen(GfxDisplay* display, int mode, int /*screen*/) { glfwSetWindowMonitor(window, NULL, display->xpos_backup(), display->ypos_backup(), display->width_backup(), display->height_backup(), GLFW_DONT_CARE); } break; - case 1: { + case Gfx::DisplayMode::Fullscreen: { // fullscreen - if (display->fullscreen_mode() == 0) { + if (display->windowed()) { display->backup_params(); } const GLFWvidmode* vmode = glfwGetVideoMode(monitor); glfwSetWindowMonitor(window, monitor, 0, 0, vmode->width, vmode->height, 60); glfwSetWindowFocusCallback(window, FocusCallback); } break; - case 2: { + case Gfx::DisplayMode::Borderless: { // borderless fullscreen - if (display->fullscreen_mode() == 0) { + if (display->windowed()) { display->backup_params(); } int x, y; @@ -322,6 +322,35 @@ static void gl_set_fullscreen(GfxDisplay* display, int mode, int /*screen*/) { } } +static void gl_screen_size(GfxDisplay* display, + int vmode_idx, + int /*screen*/, + s32* w_out, + s32* h_out, + s32* count_out) { + int count = 0; + auto vmode = glfwGetVideoMode(glfwGetPrimaryMonitor()); + auto vmodes = glfwGetVideoModes(glfwGetPrimaryMonitor(), &count); + if (vmode_idx >= 0) { + vmode = &vmodes[vmode_idx]; + } else { + for (int i = 0; i < count; ++i) { + if (!vmode || vmode->height < vmodes[i].height) { + vmode = &vmodes[i]; + } + } + } + if (count_out) { + *count_out = count; + } + if (w_out) { + *w_out = vmode->width; + } + if (h_out) { + *h_out = vmode->height; + } +} + static void gl_render_display(GfxDisplay* display) { GLFWwindow* window = display->window_glfw; @@ -504,6 +533,7 @@ const GfxRendererModule moduleOpenGL = { gl_display_set_size, // display_set_size gl_display_scale, // display_scale gl_set_fullscreen, // set_fullscreen + gl_screen_size, // screen_size gl_exit, // exit gl_vsync, // vsync gl_sync_path, // sync_path diff --git a/game/kernel/kmachine.cpp b/game/kernel/kmachine.cpp index e323127485..477bf40882 100644 --- a/game/kernel/kmachine.cpp +++ b/game/kernel/kmachine.cpp @@ -737,7 +737,10 @@ void PutDisplayEnv(u32 ptr) { } /*! - * PC Port function to get a 300MHz timer value. + * PC PORT FUNCTIONS BEGIN + */ +/*! + * Get a 300MHz timer value. */ u64 read_ee_timer() { u64 ns = ee_clock_timer.getNs(); @@ -745,14 +748,14 @@ u64 read_ee_timer() { } /*! - * PC Port function to do a fast memory copy. + * Do a fast memory copy. */ void c_memmove(u32 dst, u32 src, u32 size) { memmove(Ptr(dst).c(), Ptr(src).c(), size); } /*! - * PC Port function to return the current OS as a symbol. + * Return the current OS as a symbol. Actually returns what it was compiled for! */ u64 get_os() { #ifdef _WIN32 @@ -765,7 +768,7 @@ u64 get_os() { } /*! - * PC Port function + * Returns size of window. */ void get_window_size(u32 w_ptr, u32 h_ptr) { if (w_ptr) { @@ -779,7 +782,7 @@ void get_window_size(u32 w_ptr, u32 h_ptr) { } /*! - * PC Port function + * Returns scale of window. This is for DPI stuff. */ void get_window_scale(u32 x_ptr, u32 y_ptr) { float* x = x_ptr ? Ptr(x_ptr).c() : NULL; @@ -787,6 +790,23 @@ void get_window_scale(u32 x_ptr, u32 y_ptr) { Gfx::get_window_scale(x, y); } +/*! + * Returns resolution of the monitor. + */ +void get_screen_size(s64 vmode_idx, u32 w_ptr, u32 h_ptr, u32 c_ptr) { + s32 *w_out = 0, *h_out = 0, *c_out = 0; + if (w_ptr) { + w_out = Ptr(w_ptr).c(); + } + if (h_ptr) { + h_out = Ptr(h_ptr).c(); + } + if (c_ptr) { + c_out = Ptr(c_ptr).c(); + } + Gfx::get_screen_size(vmode_idx, w_out, h_out, c_out); +} + void update_discord_rpc(u32 discord_info) { if (gDiscordRpcEnabled) { DiscordRichPresence rpc; @@ -814,7 +834,7 @@ void update_discord_rpc(u32 discord_info) { strcat(state, std::to_string(cells).c_str()); strcat(state, " | Orbs: "); strcat(state, std::to_string(orbs).c_str()); - strcat(state, " | Scout flies: "); + strcat(state, " | Flies: "); strcat(state, std::to_string(scout_flies).c_str()); } rpc.state = state; @@ -846,6 +866,28 @@ void mkdir_path(u32 filepath) { file_util::create_dir_if_needed_for_file(filepath_str); } +u32 get_fullscreen() { + switch (Gfx::get_fullscreen()) { + default: + case Gfx::DisplayMode::Windowed: + return intern_from_c("windowed").offset; + case Gfx::DisplayMode::Borderless: + return intern_from_c("borderless").offset; + case Gfx::DisplayMode::Fullscreen: + return intern_from_c("fullscreen").offset; + } +} + +void set_fullscreen(u32 symptr, s64 screen) { + if (symptr == intern_from_c("windowed").offset || symptr == s7.offset) { + Gfx::set_fullscreen(Gfx::DisplayMode::Windowed, screen); + } else if (symptr == intern_from_c("borderless").offset) { + Gfx::set_fullscreen(Gfx::DisplayMode::Borderless, screen); + } else if (symptr == intern_from_c("fullscreen").offset) { + Gfx::set_fullscreen(Gfx::DisplayMode::Fullscreen, screen); + } +} + void InitMachine_PCPort() { // PC Port added functions make_function_symbol_from_c("__read-ee-timer", (void*)read_ee_timer); @@ -869,9 +911,11 @@ void InitMachine_PCPort() { make_function_symbol_from_c("pc-get-os", (void*)get_os); make_function_symbol_from_c("pc-get-window-size", (void*)get_window_size); make_function_symbol_from_c("pc-get-window-scale", (void*)get_window_scale); + make_function_symbol_from_c("pc-get-fullscreen", (void*)get_fullscreen); + make_function_symbol_from_c("pc-get-screen-size", (void*)get_screen_size); make_function_symbol_from_c("pc-set-window-size", (void*)Gfx::set_window_size); make_function_symbol_from_c("pc-set-letterbox", (void*)Gfx::set_letterbox); - make_function_symbol_from_c("pc-set-fullscreen", (void*)Gfx::set_fullscreen); + make_function_symbol_from_c("pc-set-fullscreen", (void*)set_fullscreen); make_function_symbol_from_c("pc-renderer-tree-set-lod", (void*)Gfx::SetLod); // file related functions @@ -897,6 +941,9 @@ void InitMachine_PCPort() { intern_from_c("*pc-settings-folder*")->value = make_string_from_c(settings_path.string().c_str()); intern_from_c("*pc-settings-built-sha*")->value = make_string_from_c(GIT_SHORT_SHA); } +/*! + * PC PORT FUNCTIONS END + */ void vif_interrupt_callback() { // added for the PC port for faking VIF interrupts from the graphics system. diff --git a/game/system/Deci2Server.cpp b/game/system/Deci2Server.cpp index 87b66f50cd..a67d5cbe56 100644 --- a/game/system/Deci2Server.cpp +++ b/game/system/Deci2Server.cpp @@ -25,9 +25,9 @@ #include "Deci2Server.h" #include "common/util/Assert.h" -Deci2Server::Deci2Server(std::function shutdown_callback) { +Deci2Server::Deci2Server(std::function shutdown_callback) + : want_exit(std::move(shutdown_callback)) { buffer = new char[BUFFER_SIZE]; - want_exit = std::move(shutdown_callback); } Deci2Server::~Deci2Server() { diff --git a/goal_src/dgos/engine.gd b/goal_src/dgos/engine.gd index 7abbc3cad0..c00085d8f9 100644 --- a/goal_src/dgos/engine.gd +++ b/goal_src/dgos/engine.gd @@ -279,6 +279,7 @@ ("progress-part.o" "progress-part") ("progress-draw.o" "progress-draw") ("progress.o" "progress") + ("progress-pc.o" "progress-pc") ;; added ("credits.o" "credits") ("projectiles.o" "projectiles") ("ocean.o" "ocean") diff --git a/goal_src/dgos/game.gd b/goal_src/dgos/game.gd index 7b3573d782..44feb49583 100644 --- a/goal_src/dgos/game.gd +++ b/goal_src/dgos/game.gd @@ -275,6 +275,7 @@ ("progress-part.o" "progress-part") ("progress-draw.o" "progress-draw") ("progress.o" "progress") + ("progress-pc.o" "progress-pc") ;; added ("credits.o" "credits") ("projectiles.o" "projectiles") ("ocean.o" "ocean") diff --git a/goal_src/engine/collide/collide-cache-h.gc b/goal_src/engine/collide/collide-cache-h.gc index 992b7ce9f6..f5c31b4f37 100644 --- a/goal_src/engine/collide/collide-cache-h.gc +++ b/goal_src/engine/collide/collide-cache-h.gc @@ -133,15 +133,15 @@ (debug-draw (_type_) none 9) (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result int) float 10) (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol 11) - (fill-and-probe-using-y-probe (_type_ vector float collide-kind process collide-tri-result uint) float 12) + (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12) (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13) (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable int) none 14) (fill-using-spheres (_type_ collide-using-spheres-params) none 15) - (fill-using-y-probe (_type_ vector float collide-kind process-drawable uint) none 16) + (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16) (initialize (_type_) none 17) (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result int) float 18) (probe-using-spheres (_type_ collide-using-spheres-params) symbol 19) - (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result uint) float 20) + (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20) (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) ;; second functiom is method 28 (fill-from-foreground-using-box (_type_) none 22) (fill-from-foreground-using-line-sphere (_type_) none 23) diff --git a/goal_src/engine/collide/collide-cache.gc b/goal_src/engine/collide/collide-cache.gc index 93ec127b5c..b0ead97c4e 100644 --- a/goal_src/engine/collide/collide-cache.gc +++ b/goal_src/engine/collide/collide-cache.gc @@ -427,7 +427,7 @@ ;; Y PROBE ;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod fill-using-y-probe collide-cache ((obj collide-cache) (arg0 vector) (arg1 float) (arg2 collide-kind) (arg3 process-drawable) (arg4 uint)) +(defmethod fill-using-y-probe collide-cache ((obj collide-cache) (arg0 vector) (arg1 float) (arg2 collide-kind) (arg3 process-drawable) (arg4 pat-surface)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -2214,15 +2214,15 @@ (arg0 vector) (arg1 float) (arg2 collide-kind) - (arg3 process) + (arg3 process-drawable) (arg4 collide-tri-result) - (arg5 uint) + (arg5 pat-surface) ) - (fill-using-y-probe obj arg0 arg1 arg2 (the-as process-drawable arg3) arg5) + (fill-using-y-probe obj arg0 arg1 arg2 arg3 arg5) (probe-using-y-probe obj arg0 arg1 arg2 arg4 arg5) ) -(defmethod probe-using-y-probe collide-cache ((obj collide-cache) (arg0 vector) (arg1 float) (arg2 collide-kind) (arg3 collide-tri-result) (arg4 uint)) +(defmethod probe-using-y-probe collide-cache ((obj collide-cache) (arg0 vector) (arg1 float) (arg2 collide-kind) (arg3 collide-tri-result) (arg4 pat-surface)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf3 :class vf) @@ -2232,7 +2232,7 @@ (.mov vf3 arg1) (.lvf vf1 (&-> arg0 quad)) (set! (-> gp-0 best-u) 2.0) - (set! (-> gp-0 ignore-pat) (the-as pat-surface arg4)) + (set! (-> gp-0 ignore-pat) arg4) (set! (-> gp-0 tri-out) arg3) (.sub.x.vf vf3 vf0 vf3 :mask #b10) (.svf (&-> gp-0 start-pos quad) vf1) @@ -2248,10 +2248,7 @@ (puyp-mesh obj gp-0 (the-as collide-cache-prim s2-0)) ) (else - (if (zero? (logand (the-as pat-surface arg4) - (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s2-0) prim)) pat) - ) - ) + (if (zero? (logand arg4 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s2-0) prim)) pat))) (puyp-sphere obj gp-0 (the-as collide-cache-prim s2-0)) ) ) diff --git a/goal_src/engine/collide/collide-shape-h.gc b/goal_src/engine/collide/collide-shape-h.gc index f52ba9e9cb..7e79589629 100644 --- a/goal_src/engine/collide/collide-shape-h.gc +++ b/goal_src/engine/collide/collide-shape-h.gc @@ -476,11 +476,24 @@ (declare-type collide-work structure) (declare-type touching-shapes-entry structure) +(defenum nav-flags + :bitfield #t + :type uint8 + (navf0 0) + (navf1 1) + (navf2 2) + (navf3 3) + (navf4 4) + (navf5 5) + (navf6 6) + (navf7 7) + ) + ;; we're a child of trsqv, so we store a full transform + derivative. (deftype collide-shape (trsqv) ((process process-drawable :offset-assert 140) (max-iteration-count uint8 :offset-assert 144) - (nav-flags uint8 :offset-assert 145) + (nav-flags nav-flags :offset-assert 145) (pad-byte uint8 2 :offset-assert 146) (pat-ignore-mask pat-surface :offset-assert 148) (event-self basic :offset-assert 152) @@ -647,7 +660,7 @@ (let ((obj (object-new allocation type-to-make (the int (-> type-to-make size))))) (set! (-> obj process) proc) (set! (-> obj max-iteration-count) 1) - (set! (-> obj nav-flags) #x1) + (set! (-> obj nav-flags) (nav-flags navf0)) (set! (-> obj event-self) #f) (set! (-> obj event-other) #f) (set! (-> obj riders) #f) diff --git a/goal_src/engine/collide/collide-shape.gc b/goal_src/engine/collide/collide-shape.gc index 4f3df579d5..a5105626e4 100644 --- a/goal_src/engine/collide/collide-shape.gc +++ b/goal_src/engine/collide/collide-shape.gc @@ -1641,7 +1641,7 @@ (+! (-> s4-0 y) arg0) 0.0 ;; find the ground - (let ((f0-4 (fill-and-probe-using-y-probe *collide-cache* s4-0 f30-0 arg3 (-> obj process) s3-0 (the-as uint 1)))) + (let ((f0-4 (fill-and-probe-using-y-probe *collide-cache* s4-0 f30-0 arg3 (-> obj process) s3-0 (new 'static 'pat-surface :noentity #x1)))) (when (< f0-4 0.0) (if arg2 (format 0 "WARNING: move-to-ground: (~f ~f) failed to locate ground [~S type ~S]~%" diff --git a/goal_src/engine/debug/default-menu.gc b/goal_src/engine/debug/default-menu.gc index 2624755135..5a105ec7bf 100644 --- a/goal_src/engine/debug/default-menu.gc +++ b/goal_src/engine/debug/default-menu.gc @@ -4433,9 +4433,10 @@ ;(flag "Alt load boundaries" #f ,(dm-lambda-boolean-flag (-> *pc-settings* new-lb?))) (flag "All actors" #f ,(dm-lambda-boolean-flag (-> *pc-settings* force-actors?))) (flag "Display actor counts" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-actor-counts))) + (flag "Display git commit" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-sha))) (function "Reset" #f (lambda () (reset *pc-settings*))) - (function "Save" #f (lambda () (write-to-file *pc-settings* PC_SETTINGS_FILE_NAME))) - (function "Load" #f (lambda () (read-from-file *pc-settings* PC_SETTINGS_FILE_NAME))) + (function "Save" #f (lambda () (commit-to-file *pc-settings*))) + (function "Load" #f (lambda () (load-settings *pc-settings*))) ) ) ) @@ -4452,6 +4453,7 @@ (float-var "Actor birth dist" #f ,(dm-lambda-meters-var (-> *ACTOR-bank* birth-dist)) 20 1 #t 0 10000 1) (float-var "Actor pause dist" #f ,(dm-lambda-meters-var (-> *ACTOR-bank* pause-dist)) 20 1 #t 0 10000 1) (flag "Heap status" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-heap-status))) + (flag "Text boxes" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-text-box))) (flag "Bug report" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-bug-report))) (menu "Mood override" (function "-- SIMPLE OVERRIDE" #f nothing) diff --git a/goal_src/engine/draw/drawable.gc b/goal_src/engine/draw/drawable.gc index 2da7fe1cb1..ff2deab428 100644 --- a/goal_src/engine/draw/drawable.gc +++ b/goal_src/engine/draw/drawable.gc @@ -1544,7 +1544,7 @@ ) (toggle-pause) ) - (when (or (not *progress-process*) (dummy-32 (-> *progress-process* 0))) + (when (or (not *progress-process*) (can-go-back? (-> *progress-process* 0))) (if (or (logtest? (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons select r3 start)) ;; push pause (and ;; controller lost (logtest? (-> *cpad-list* cpads 0 valid) 128) diff --git a/goal_src/engine/game/collectables.gc b/goal_src/engine/game/collectables.gc index fde83563a7..b9a37a4070 100644 --- a/goal_src/engine/game/collectables.gc +++ b/goal_src/engine/game/collectables.gc @@ -2828,9 +2828,9 @@ s2-1 (the-as float 81920.0) (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) s1-1 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) @@ -2841,7 +2841,7 @@ (if (= (the-as int s3-0) 6) (set! (-> s2-1 y) (+ 6144.0 (-> s2-1 y))) ) - (birth-pickup-at-point s2-1 (the-as pickup-type s3-0) f30-0 arg0 (the-as process-drawable arg1) obj) + (birth-pickup-at-point s2-1 (the-as pickup-type s3-0) f30-0 arg0 arg1 obj) ) ) ) diff --git a/goal_src/engine/game/game-save.gc b/goal_src/engine/game/game-save.gc index 11998b6dd5..8722d03aff 100644 --- a/goal_src/engine/game/game-save.gc +++ b/goal_src/engine/game/game-save.gc @@ -57,7 +57,7 @@ (life 201) (money 202) (money-total 203) - (moeny-per-level 204) + (money-per-level 204) (buzzer-total 205) (fuel-cell 206) (death-movie-tick 207) @@ -227,7 +227,7 @@ (when detail (let ((v1-4 (-> tag elt-type))) (cond - ((or (= v1-4 (game-save-elt moeny-per-level)) (= v1-4 (game-save-elt deaths-per-level))) + ((or (= v1-4 (game-save-elt money-per-level)) (= v1-4 (game-save-elt deaths-per-level))) ;; per level u8's (dotimes (prog-lev-idx (-> tag elt-count)) (let ((lev-name (progress-level-index->string prog-lev-idx))) @@ -421,7 +421,7 @@ ) (let ((v1-56 (&+ v1-55 16))) (let ((a0-30 (the-as game-save-tag (&+ v1-56 0)))) - (set! (-> a0-30 elt-type) (game-save-elt moeny-per-level)) + (set! (-> a0-30 elt-type) (game-save-elt money-per-level)) (set! (-> a0-30 elt-count) 32) (set! (-> a0-30 elt-size) (the-as uint 1)) ) @@ -861,7 +861,7 @@ (((game-save-elt money-total)) (set! (-> obj money-total) (-> data user-float0)) ) - (((game-save-elt moeny-per-level)) + (((game-save-elt money-per-level)) (let ((v1-34 (min 32 (-> data elt-count)))) (dotimes (a0-76 v1-34) (set! (-> obj money-per-level a0-76) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-76)) diff --git a/goal_src/engine/game/main.gc b/goal_src/engine/game/main.gc index 4c04bff803..106794de10 100644 --- a/goal_src/engine/game/main.gc +++ b/goal_src/engine/game/main.gc @@ -356,7 +356,7 @@ ;; cheat mode (check-cheat-code (-> *cheat-temp* 0) 0 (up up down down left right left right x x square circle square circle) - (cpad-clear-buttons! 0 r1) + (cpad-clear! 0 r1) ;; toggle! (not! *cheat-mode*) (cheats-sound-play *cheat-mode*) @@ -366,7 +366,7 @@ (when *cheat-mode* (check-cheat-code (-> *cheat-temp* 1) 0 (circle square circle square x x right left right left down down up up) - (cpad-clear-buttons! 0 r1) + (cpad-clear! 0 r1) ;; toggle between #t and debug. (set! *cheat-mode* (if (= *cheat-mode* 'debug) #t @@ -382,7 +382,7 @@ ((GAME_TERRITORY_SCEI) (check-cheat-code (-> *cheat-temp* 2) 0 (l1 r1 l1 r1 triangle circle x square) - (cpad-clear-buttons! 0 r1) + (cpad-clear! 0 r1) (set! *progress-cheat* (if *progress-cheat* #f 'language @@ -397,7 +397,7 @@ (when *debug-segment* (check-cheat-code (-> *cheat-temp* 3) 0 (x square triangle circle x square triangle circle) - (cpad-clear-buttons! 0 r1) + (cpad-clear! 0 r1) (set! *progress-cheat* (if *progress-cheat* #f 'pal @@ -408,7 +408,7 @@ ;; added in PAL (check-cheat-code (-> *cheat-temp* 4) 0 ;; they erroneously used (-> *cheat-temp* 5) here! (triangle x circle square triangle x circle square) - (cpad-clear-buttons! 0 r1) + (cpad-clear! 0 r1) (set! *cheat-mode* (if (= *cheat-mode* 'camera) #f 'camera @@ -665,8 +665,9 @@ (*draw-hook*) (add-ee-profile-frame 'draw :g #x80) - (#when PC_PORT - (draw-build-revision)) + (with-pc + (if (-> *pc-settings* display-sha) + (draw-build-revision))) (*menu-hook*) (add-ee-profile-frame 'draw :g #x40) diff --git a/goal_src/engine/game/projectiles.gc b/goal_src/engine/game/projectiles.gc index 04f8047adb..08f3b2c129 100644 --- a/goal_src/engine/game/projectiles.gc +++ b/goal_src/engine/game/projectiles.gc @@ -1033,7 +1033,7 @@ (-> obj root-override shadow-pos) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 12288.0 81920.0 ) diff --git a/goal_src/engine/gfx/shadow/shadow-h.gc b/goal_src/engine/gfx/shadow/shadow-h.gc index 4a7fd20945..904cb49c30 100644 --- a/goal_src/engine/gfx/shadow/shadow-h.gc +++ b/goal_src/engine/gfx/shadow/shadow-h.gc @@ -5,10 +5,7 @@ ;; name in dgo: shadow-h ;; dgos: GAME, ENGINE -;; forward def - projectiles -(define-extern find-ground-and-draw-shadow (function vector vector float collide-kind process float float none)) -;; definition of type fake-shadow (deftype fake-shadow (structure) ((px float :offset-assert 0) (py float :offset-assert 4) @@ -25,7 +22,6 @@ :flag-assert #x900000020 ) -;; definition of type fake-shadow-buffer (deftype fake-shadow-buffer (basic) ((num-shadows int32 :offset-assert 4) (data fake-shadow 32 :inline :offset-assert 8) @@ -35,13 +31,10 @@ :flag-assert #x900000408 ) -;; definition for symbol *fake-shadow-buffer-1*, type fake-shadow-buffer (define *fake-shadow-buffer-1* (new 'global 'fake-shadow-buffer)) - -;; definition for symbol *fake-shadow-buffer-2*, type fake-shadow-buffer (define *fake-shadow-buffer-2* (new 'global 'fake-shadow-buffer)) - -;; definition for symbol *fake-shadow-buffer*, type fake-shadow-buffer (define *fake-shadow-buffer* *fake-shadow-buffer-1*) -(define-extern swap-fake-shadow-buffers (function none)) \ No newline at end of file +(define-extern swap-fake-shadow-buffers (function none)) + +(define-extern find-ground-and-draw-shadow (function vector vector float collide-kind process-drawable float float none)) \ No newline at end of file diff --git a/goal_src/engine/gfx/shadow/shadow.gc b/goal_src/engine/gfx/shadow/shadow.gc index 15f19eb4fb..11f21620da 100644 --- a/goal_src/engine/gfx/shadow/shadow.gc +++ b/goal_src/engine/gfx/shadow/shadow.gc @@ -109,14 +109,31 @@ ) ) -(defun find-ground-and-draw-shadow ((arg0 vector) (arg1 vector) (arg2 float) (arg3 collide-kind) (arg4 process) (arg5 float) (arg6 float)) +(defun find-ground-and-draw-shadow ((arg0 vector) + (arg1 vector) + (arg2 float) + (arg3 collide-kind) + (arg4 process-drawable) + (arg5 float) + (arg6 float) + ) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg0 quad)) (new 'stack-no-clear 'vector) (+! (-> s2-0 y) arg5) (let ((s4-0 (new 'stack-no-clear 'collide-tri-result))) (cond - ((>= (fill-and-probe-using-y-probe *collide-cache* s2-0 arg6 arg3 arg4 s4-0 (the-as uint 1)) 0.0) + ((>= (fill-and-probe-using-y-probe + *collide-cache* + s2-0 + arg6 + arg3 + arg4 + s4-0 + (new 'static 'pat-surface :noentity #x1) + ) + 0.0 + ) (if (!= arg2 0.0) (compute-and-draw-shadow s2-0 (-> s4-0 intersect) (-> s4-0 normal) (the-as vector arg2) arg6 (the-as float 0)) ) diff --git a/goal_src/engine/gfx/sprite/sprite.gc b/goal_src/engine/gfx/sprite/sprite.gc index 11efc89472..434ad6280c 100644 --- a/goal_src/engine/gfx/sprite/sprite.gc +++ b/goal_src/engine/gfx/sprite/sprite.gc @@ -394,10 +394,8 @@ (defmethod new sprite-array-2d ((allocation symbol) (type-to-make type) (group-0-size int) (group-1-size int)) "Allocate a sprite-array for 2d sprites. There are two groups, each can contain the given number." (#when PC_BIG_MEMORY - (when (not (-> *pc-settings* ps2-parts?)) - (*! group-0-size 16) ;; 16x more particles! - (*! group-1-size 16) ;; 16x more particles! - ) + (*! group-0-size 16) ;; 16x more particles! + (*! group-1-size 16) ;; 16x more particles! ) (let* ((sprite-count (+ group-0-size group-1-size)) (vec-data-size (* 3 sprite-count)) ;; 3 quadwords of vec-data per sprite @@ -423,10 +421,8 @@ "Allocate a sprite-array for 3d sprites. There are two groups, each can contain the given number of sprites. Group 1 size is zero in practice for 3d." (#when PC_BIG_MEMORY - (when (and *pc-settings* (not (-> *pc-settings* ps2-parts?))) - (*! group-0-size 16) ;; 16x more particles! - (*! group-1-size 16) ;; 16x more particles! - ) + (*! group-0-size 16) ;; 16x more particles! + (*! group-1-size 16) ;; 16x more particles! ) (let* ((sprite-count (+ group-0-size group-1-size)) (vec-data-size (* 3 sprite-count)) diff --git a/goal_src/engine/nav/navigate-h.gc b/goal_src/engine/nav/navigate-h.gc index 809114854a..bd22c7f6e1 100644 --- a/goal_src/engine/nav/navigate-h.gc +++ b/goal_src/engine/nav/navigate-h.gc @@ -13,24 +13,24 @@ :bitfield #t :type uint32 (display-marks 0) - (bit1 1) ;; TODO - nav-control::9 - (bit2 2) ;; TODO - nav-control::9 - (bit3 3) ;; TODO - nav-enemy::45 | nav-control::9 - (bit4 4) ;; TODO - nav-control::9 - (bit5 5) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 - (bit6 6) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 - (bit7 7) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 - (bit8 8) - (bit9 9) ;; TODO - nav-control::14 | 11 - (bit10 10) ;; TODO - nav-enemy::nav-enemy-patrol-post - (bit11 11) ;; TODO - nav-control::28 - (bit12 12) ;; TODO - rolling-lightning-mole::(enter nav-enemy-chase fleeing-nav-enemy) - (bit13 13) - (bit17 17) ;; TODO - nav-control::11 - (bit18 18) ;; TODO - nav-control::11 - (bit19 19) ;; TODO - nav-control::11 | 17 - (bit20 20) ;; TODO - nav-mesh::28 - (bit21 21) ;; TODO - nav-control::19 + (navcf1 1) ;; TODO - nav-control::9 + (navcf2 2) ;; TODO - nav-control::9 + (navcf3 3) ;; TODO - nav-enemy::45 | nav-control::9 + (navcf4 4) ;; TODO - nav-control::9 + (navcf5 5) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 + (navcf6 6) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 + (navcf7 7) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9 + (navcf8 8) + (navcf9 9) ;; TODO - nav-control::14 | 11 + (navcf10 10) ;; TODO - nav-enemy::nav-enemy-patrol-post + (navcf11 11) ;; TODO - nav-control::28 + (navcf12 12) ;; TODO - rolling-lightning-mole::(enter nav-enemy-chase fleeing-nav-enemy) + (navcf13 13) + (navcf17 17) ;; TODO - nav-control::11 + (navcf18 18) ;; TODO - nav-control::11 + (navcf19 19) ;; TODO - nav-control::11 | 17 + (navcf20 20) ;; TODO - nav-mesh::28 + (navcf21 21) ;; TODO - nav-control::19 ) (deftype nav-poly (structure) @@ -371,7 +371,7 @@ (goto cfg-4) ) (set! (-> obj max-spheres) sphere-count) - (set! (-> obj flags) (nav-control-flags bit8 bit13)) + (set! (-> obj flags) (nav-control-flags navcf8 navcf13)) (set! (-> obj mesh) (nav-mesh-connect (-> shape process) shape obj)) (let ((ent (-> shape process entity))) (set! (-> obj nearest-y-threshold) diff --git a/goal_src/engine/nav/navigate.gc b/goal_src/engine/nav/navigate.gc index 679f9e3e0b..f6ad510afd 100644 --- a/goal_src/engine/nav/navigate.gc +++ b/goal_src/engine/nav/navigate.gc @@ -1177,14 +1177,14 @@ (let ((v1-1 (find-poly-fast obj arg0 arg1))) (when v1-1 (if arg2 - (set! (-> arg2 0) (logior (nav-control-flags bit20) (-> arg2 0))) + (set! (-> arg2 0) (logior (nav-control-flags navcf20) (-> arg2 0))) ) (set! s3-1 v1-1) (goto cfg-14) ) ) (if arg2 - (logclear! (-> arg2 0) (nav-control-flags bit20)) + (logclear! (-> arg2 0) (nav-control-flags navcf20)) ) (let ((s2-0 (new 'stack-no-clear 'inline-array 'nav-vertex 3))) (set! s3-1 (the-as nav-poly #f)) @@ -1632,7 +1632,7 @@ (when #t (set! (-> s5-0 debug-time) (the-as uint (-> *display* actual-frame-counter))) (add-debug-sphere - (logtest? (-> obj flags) (nav-control-flags bit1)) + (logtest? (-> obj flags) (nav-control-flags navcf1)) (bucket-id debug-draw0) (-> s5-0 bounds) (-> s5-0 bounds w) @@ -1640,7 +1640,7 @@ ) (add-debug-vector #t (bucket-id debug-draw1) (-> s5-0 origin) *x-vector* (meters 1.0) *color-red*) (add-debug-vector #t (bucket-id debug-draw1) (-> s5-0 origin) *z-vector* (meters 1.0) *color-blue*) - (when (logtest? (-> obj flags) (nav-control-flags bit2)) + (when (logtest? (-> obj flags) (nav-control-flags navcf2)) (dotimes (s3-0 (-> s5-0 vertex-count)) (add-debug-x #t @@ -1695,7 +1695,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit3)) + (when (logtest? (-> obj flags) (nav-control-flags navcf3)) (dotimes (s3-2 (-> s5-0 poly-count)) (let ((s2-1 (-> s5-0 poly s3-2))) (debug-draw-poly s5-0 s2-1 (the-as rgba (cond @@ -1720,7 +1720,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit4)) + (when (logtest? (-> obj flags) (nav-control-flags navcf4)) (let ((s1-1 add-debug-text-3d) (s0-1 #t) ) @@ -1744,7 +1744,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit5)) + (when (logtest? (-> obj flags) (nav-control-flags navcf5)) (if (-> obj next-poly) (debug-draw-poly s5-0 (-> obj next-poly) *color-cyan*) ) @@ -1755,7 +1755,7 @@ (debug-draw-poly s5-0 (-> obj current-poly) *color-red*) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit7)) + (when (logtest? (-> obj flags) (nav-control-flags navcf7)) (dotimes (s3-3 (the-as int (-> s5-0 static-sphere-count))) (let ((s2-2 (-> s5-0 static-sphere s3-3))) (add-debug-sphere #t (bucket-id debug-draw0) (the-as vector s2-2) (-> s2-2 trans w) *color-blue*) @@ -1788,7 +1788,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit6)) + (when (logtest? (-> obj flags) (nav-control-flags navcf6)) (when (and (-> obj portal 0) (-> obj portal 1)) (let ((v1-80 (-> s5-0 origin)) (a2-22 (new 'stack-no-clear 'vector)) @@ -1828,7 +1828,7 @@ (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit7)) + (when (logtest? (-> obj flags) (nav-control-flags navcf7)) (add-debug-sphere #t (bucket-id debug-draw1) @@ -1890,7 +1890,7 @@ (defmethod set-current-poly! nav-control ((obj nav-control) (arg0 nav-poly)) (set! (-> obj current-poly) arg0) - (logior! (-> obj flags) (nav-control-flags bit9)) + (logior! (-> obj flags) (nav-control-flags navcf9)) 0 (none) ) @@ -1937,7 +1937,7 @@ ) (defun add-collide-shape-spheres ((arg0 nav-control) (arg1 collide-shape) (arg2 vector)) - (when (logtest? (-> arg1 nav-flags) 1) + (when (logtest? (-> arg1 nav-flags) (nav-flags navf0)) (set! (-> arg2 quad) (-> arg1 root-prim prim-core world-sphere quad)) (set! (-> arg2 w) (-> arg1 nav-radius)) (let ((s4-0 arg0) @@ -1959,7 +1959,7 @@ ) 0 ) - (when (logtest? (-> arg1 nav-flags) 2) + (when (logtest? (-> arg1 nav-flags) (nav-flags navf1)) (let ((s5-1 (-> arg1 process nav extra-nav-sphere))) (when (< (-> arg0 num-spheres) (-> arg0 max-spheres)) (let* ((s4-1 (-> arg0 sphere (-> arg0 num-spheres))) @@ -1995,13 +1995,13 @@ (s3-0 (new 'stack-no-clear 'vector)) ) (when (and *target* - (or (logtest? (-> obj flags) (nav-control-flags bit11)) (logtest? (-> *target* state-flags) #x80f8)) + (or (logtest? (-> obj flags) (nav-control-flags navcf11)) (logtest? (-> *target* state-flags) #x80f8)) ) (let ((s2-0 obj) (s1-0 (-> *target* control)) ) (let ((s0-0 s3-0)) - (when (logtest? (-> s1-0 nav-flags) 1) + (when (logtest? (-> s1-0 nav-flags) (nav-flags navf0)) (set! (-> s0-0 quad) (-> s1-0 root-prim prim-core world-sphere quad)) (set! (-> s0-0 w) (-> s1-0 nav-radius)) (set! sv-32 s2-0) @@ -2021,7 +2021,7 @@ 0 ) ) - (when (logtest? (-> s1-0 nav-flags) 2) + (when (logtest? (-> s1-0 nav-flags) (nav-flags navf1)) (let ((s1-1 (-> s1-0 process nav extra-nav-sphere))) (when (< (-> s2-0 num-spheres) (-> s2-0 max-spheres)) (let* ((s0-1 (-> s2-0 sphere (-> s2-0 num-spheres))) @@ -2041,7 +2041,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit13)) + (when (logtest? (-> obj flags) (nav-control-flags navcf13)) (countdown (s2-1 (-> obj mesh static-sphere-count)) (let ((s1-2 obj) (s0-2 (-> obj mesh static-sphere s2-1)) @@ -2071,7 +2071,7 @@ (when (not (or (= s0-3 (-> obj shape)) (zero? (logand arg0 (-> s0-3 root-prim prim-core collide-as))))) (let ((s1-3 obj)) (set! sv-112 s3-0) - (when (logtest? (-> s0-3 nav-flags) 1) + (when (logtest? (-> s0-3 nav-flags) (nav-flags navf0)) (set! (-> sv-112 quad) (-> s0-3 root-prim prim-core world-sphere quad)) (set! (-> sv-112 w) (-> s0-3 nav-radius)) (set! sv-80 s1-3) @@ -2094,7 +2094,7 @@ ) 0 ) - (when (logtest? (-> s0-3 nav-flags) 2) + (when (logtest? (-> s0-3 nav-flags) (nav-flags navf1)) (let ((s0-4 (-> s0-3 process nav extra-nav-sphere))) (when (< (-> s1-3 num-spheres) (-> s1-3 max-spheres)) (set! sv-128 (-> s1-3 sphere (-> s1-3 num-spheres))) @@ -2466,7 +2466,7 @@ (set! (-> obj blocked-travel quad) (-> obj travel quad)) (let ((f0-0 (vector-xz-length (-> obj travel)))) (when (and (>= f30-0 f0-0) (< f0-0 204.8)) - (set! (-> obj flags) (logior (nav-control-flags bit17) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf17) (-> obj flags))) (set! (-> obj block-time) (-> *display* base-frame-counter)) (set! (-> obj block-count) (+ 1.0 (-> obj block-count))) (if (-> obj block-event) @@ -2504,21 +2504,21 @@ ) (cond ((or (vector= arg2 (-> obj target-pos)) (< (fabs f28-0) 364.0889)) - (set! (-> obj flags) (logior (nav-control-flags bit21) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf21) (-> obj flags))) (set! (-> arg0 quad) (-> arg2 quad)) ) (else (let ((s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg1 quat)))) (vector-rotate-y! s2-1 s2-1 (fmax (fmin f28-0 f30-0) (- f30-0))) (vector-normalize! s2-1 819.2) - (logclear! (-> obj flags) (nav-control-flags bit21)) + (logclear! (-> obj flags) (nav-control-flags navcf21)) (vector+! arg0 (-> arg1 trans) s2-1) ) (when (or (not (dummy-16 obj arg0)) - (logtest? (nav-control-flags bit17) (-> obj flags)) - (zero? (logand (-> obj flags) (nav-control-flags bit10))) + (logtest? (nav-control-flags navcf17) (-> obj flags)) + (zero? (logand (-> obj flags) (nav-control-flags navcf10))) ) - (set! (-> obj flags) (logior (nav-control-flags bit21) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf21) (-> obj flags))) (vector-! (-> obj travel) arg2 (-> arg1 trans)) (set! (-> arg0 quad) (-> arg2 quad)) ) @@ -2718,7 +2718,7 @@ v1-0 (-> obj current-poly) (-> obj travel) - (zero? (logand (-> obj flags) (nav-control-flags bit12))) + (zero? (logand (-> obj flags) (nav-control-flags navcf12))) arg0 arg1 ) @@ -2925,7 +2925,7 @@ sv-84 sv-88 (-> obj travel) - (zero? (logand (-> obj flags) (nav-control-flags bit12))) + (zero? (logand (-> obj flags) (nav-control-flags navcf12))) 204.8 s5-1 ) @@ -2966,9 +2966,9 @@ (set! (-> obj old-travel quad) (-> obj travel quad)) (-> obj block-count) (set! (-> obj block-count) (seek (-> obj block-count) 0.0 0.016666668)) - (logclear! (-> obj flags) (nav-control-flags bit9 bit17 bit18 bit19)) + (logclear! (-> obj flags) (nav-control-flags navcf9 navcf17 navcf18 navcf19)) (TODO-RENAME-27 obj) - (if (logtest? (-> obj flags) (nav-control-flags bit8)) + (if (logtest? (-> obj flags) (nav-control-flags navcf8)) (TODO-RENAME-28 obj (collide-kind background cak-1 @@ -3043,7 +3043,7 @@ (let ((s5-1 (new 'stack-no-clear 'nav-gap-info))) (when (< (vector-xz-length (-> obj travel)) 204.8) (cond - ((logtest? (nav-control-flags bit17) (-> obj flags)) + ((logtest? (nav-control-flags navcf17) (-> obj flags)) ) ((-> obj next-poly) (cond @@ -3061,7 +3061,7 @@ ) ) (else - (set! (-> obj flags) (logior (nav-control-flags bit19) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf19) (-> obj flags))) ) ) ) diff --git a/goal_src/engine/ps2/pad.gc b/goal_src/engine/ps2/pad.gc index 245c8294b4..2a9ad56298 100644 --- a/goal_src/engine/ps2/pad.gc +++ b/goal_src/engine/ps2/pad.gc @@ -359,7 +359,7 @@ `(logtest? (cpad-hold ,pad-idx) (pad-buttons ,@buttons)) ) -(defmacro cpad-clear-buttons! (pad-idx &rest buttons) +(defmacro cpad-clear! (pad-idx &rest buttons) `(begin (logclear! (cpad-pressed ,pad-idx) (pad-buttons ,@buttons)) (logclear! (cpad-hold ,pad-idx) (pad-buttons ,@buttons)) diff --git a/goal_src/engine/sparticle/sparticle-launcher.gc b/goal_src/engine/sparticle/sparticle-launcher.gc index 6435ed20d2..5edfd7139a 100644 --- a/goal_src/engine/sparticle/sparticle-launcher.gc +++ b/goal_src/engine/sparticle/sparticle-launcher.gc @@ -935,10 +935,10 @@ ;; can we see it? (#if (not PC_PORT) (sphere-in-view-frustum? (the-as sphere gp-1)) - (if (and (not (-> *pc-settings* ps2-parts?)) (not (-> *pc-settings* use-vis?)) (> (-> *sprite-array-2d* num-sprites 0) 1920)) - ;; pc port : launchers have larger bsphere if you have pc rendering on and ps2 parts off - (sphere-in-view-frustum? (the-as sphere (let ((bsph (new-stack-vector0))) (vector-copy! bsph gp-1) (*! (-> bsph w) 4.0) bsph))) - (sphere-in-view-frustum? (the-as sphere gp-1))) + (if (-> *pc-settings* ps2-parts?) + ;; pc port : launchers have larger bsphere if you have ps2 parts off + (sphere-in-view-frustum? (the-as sphere gp-1)) + (sphere-in-view-frustum? (the-as sphere (let ((bsph (new-stack-vector0))) (vector-copy! bsph gp-1) (*! (-> bsph w) 4.0) bsph)))) ) ) ) @@ -992,7 +992,7 @@ ;; pc hack for more particles. (with-pc - (if (and (> (-> *sprite-array-2d* num-sprites 0) 1920) (not (-> *pc-settings* ps2-parts?))) + (if (not (-> *pc-settings* ps2-parts?)) (/! f30-0 256.0))) ;; loop over particles in the group. diff --git a/goal_src/engine/sparticle/sparticle.gc b/goal_src/engine/sparticle/sparticle.gc index 78e6e84eb3..0265b8f302 100644 --- a/goal_src/engine/sparticle/sparticle.gc +++ b/goal_src/engine/sparticle/sparticle.gc @@ -63,10 +63,8 @@ arg3: pointer to sprite allocations arg4: pointer to adgif allocation" (#when PC_BIG_MEMORY - (when (not (-> *pc-settings* ps2-parts?)) - (*! arg0 16) ;; 16x more particles! - (*! arg1 16) ;; 16x more particles! - ) + (*! arg0 16) ;; 16x more particles! + (*! arg1 16) ;; 16x more particles! ) (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (let* ((v1-3 (/ (+ arg0 63) 64)) ;; num blocks diff --git a/goal_src/engine/target/target-death.gc b/goal_src/engine/target/target-death.gc index 486cebaf97..80548d12de 100644 --- a/goal_src/engine/target/target-death.gc +++ b/goal_src/engine/target/target-death.gc @@ -1202,7 +1202,7 @@ (clear-pending-settings-from-process *setting-control* self 'process-mask) (clear-pending-settings-from-process *setting-control* self 'allow-progress) (restore-collide-with-as (-> self control)) - (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (none) diff --git a/goal_src/engine/target/target-part.gc b/goal_src/engine/target/target-part.gc index c5126df955..13917373d5 100644 --- a/goal_src/engine/target/target-part.gc +++ b/goal_src/engine/target/target-part.gc @@ -43,7 +43,7 @@ (collide-kind background cak-1 cak-2 cak-3 water powerup crate enemy wall-object ground-object mother-spider) s5-0 s3-0 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/goal_src/engine/ui/progress-h.gc b/goal_src/engine/ui/progress-h.gc index 555baa45cb..ff111dc071 100644 --- a/goal_src/engine/ui/progress-h.gc +++ b/goal_src/engine/ui/progress-h.gc @@ -5,68 +5,163 @@ ;; name in dgo: progress-h ;; dgos: GAME, ENGINE +;; PC port adds new menus and option types +(#cond + ((not PC_PORT) + (defenum progress-screen + :type int64 + (invalid -1) + (fuel-cell 0) + (money 1) + (buzzer 2) + (settings 3) + (game-settings 4) + (graphic-settings 5) + (sound-settings 6) + (memcard-no-space 7) + (memcard-not-inserted 8) + (memcard-not-formatted 9) + (memcard-format 10) + (memcard-data-exists 11) + (memcard-loading 12) + (memcard-saving 13) + (memcard-formatting 14) + (memcard-creating 15) + (load-game 16) + (save-game 17) + (save-game-title 18) + (memcard-insert 19) + (memcard-error-loading 20) + (memcard-error-saving 21) + (memcard-removed 22) + (memcard-no-data 23) + (memcard-error-formatting 24) + (memcard-error-creating 25) + (memcard-auto-save-error 26) + (title 27) + (settings-title 28) + (auto-save 29) + (pal-change-to-60hz 30) + (pal-now-60hz 31) + (no-disc 32) + (bad-disc 33) + (quit 34) + (max 35) + ) -(defenum progress-screen - :type int64 - (invalid -1) - (fuel-cell 0) - (money 1) - (buzzer 2) - (settings 3) - (game-settings 4) - (graphic-settings 5) - (sound-settings 6) - (memcard-no-space 7) - (memcard-not-inserted 8) - (memcard-not-formatted 9) - (memcard-format 10) - (memcard-data-exists 11) - (memcard-loading 12) - (memcard-saving 13) - (memcard-formatting 14) - (memcard-creating 15) - (load-game 16) - (save-game 17) - (save-game-title 18) - (memcard-insert 19) - (memcard-error-loading 20) - (memcard-error-saving 21) - (memcard-removed 22) - (memcard-no-data 23) - (memcard-error-formatting 24) - (memcard-error-creating 25) - (memcard-auto-save-error 26) - (title 27) - (settings-title 28) - (auto-save 29) - (pal-change-to-60hz 30) - (pal-now-60hz 31) - (no-disc 32) - (bad-disc 33) - (quit 34) + (defenum game-option-type + :type uint64 + (slider 0) + (language 1) + (on-off 2) + (center-screen 3) + (aspect-ratio 4) + (video-mode 5) + (menu 6) + (yes-no 7) + (button 8) + ) + ) + (#t + (defenum progress-screen + :type int64 + (invalid -1) + (fuel-cell 0) + (money 1) + (buzzer 2) + (settings 3) + (game-settings 4) + (graphic-settings 5) + (sound-settings 6) + (memcard-no-space 7) + (memcard-not-inserted 8) + (memcard-not-formatted 9) + (memcard-format 10) + (memcard-data-exists 11) + (memcard-loading 12) + (memcard-saving 13) + (memcard-formatting 14) + (memcard-creating 15) + (load-game 16) + (save-game 17) + (save-game-title 18) + (memcard-insert 19) + (memcard-error-loading 20) + (memcard-error-saving 21) + (memcard-removed 22) + (memcard-no-data 23) + (memcard-error-formatting 24) + (memcard-error-creating 25) + (memcard-auto-save-error 26) + (title 27) + (settings-title 28) + (auto-save 29) + (pal-change-to-60hz 30) + (pal-now-60hz 31) + (no-disc 32) + (bad-disc 33) + (quit 34) + + ;; extra screens for pc port + (camera-options) + (accessibility-options) + (game-ps2-options) + (misc-options) + (resolution) + (aspect-msg) + (aspect-ratio) + (gfx-ps2-options) + (secrets) + (hint-log) + (cheats) + (scrapbook) + (music-player) + (scene-player) + (credits) + + ;; the last one! + (max) + ) + + (defenum game-option-type + :type uint64 + (slider 0) + (language 1) + (on-off 2) + (center-screen 3) + (aspect-ratio 4) + (video-mode 5) + (menu 6) + (yes-no 7) + (button 8) + + ;; extra types for pc port + (normal-inverted) + (display-mode) + (msaa) + (frame-rate) + (lod-bg) + (lod-fg) + (resolution) + (aspect-new) + (language-subtitles) + (speaker) + (aspect-native) + ) + ) ) +(defenum game-option-menu + :type int32 + :copy-entries progress-screen) + (defun-extern activate-progress process progress-screen none) (defun-extern hide-progress-screen none) (defun-extern hide-progress-icons none) -(declare-type level-tasks-info basic) - -(define-extern *level-task-data* (array level-tasks-info)) -(define-extern *level-task-data-remap* (array int32)) - -(declare-type count-info structure) - -(defun-extern get-game-count int count-info) (defun-extern progress-allowed? symbol) (defun-extern pause-allowed? symbol) -(declare-type progress process) - -(defun-extern deactivate-progress none) -(defun-extern calculate-completion progress float) -(defun-extern make-current-level-available-to-progress none) - ;; DECOMP BEGINS (deftype count-info (structure) @@ -115,13 +210,13 @@ (deftype game-option (basic) - ((option-type uint64 :offset-assert 8) - (name game-text-id :offset-assert 16) - (scale basic :offset-assert 20) - (param1 float :offset-assert 24) - (param2 float :offset-assert 28) - (param3 int32 :offset-assert 32) - (value-to-modify pointer :offset-assert 36) + ((option-type game-option-type :offset-assert 8) + (name game-text-id :offset-assert 16) + (scale symbol :offset-assert 20) + (param1 float :offset-assert 24) + (param2 float :offset-assert 28) + (param3 game-option-menu :offset-assert 32) + (value-to-modify pointer :offset-assert 36) ) :method-count-assert 9 :size-assert #x28 @@ -148,8 +243,8 @@ (force-transition basic :offset-assert 180) (stat-transition basic :offset-assert 184) (level-transition int32 :offset-assert 188) - (language-selection uint64 :offset-assert 192) - (language-direction basic :offset-assert 200) + (language-selection language-enum :offset-assert 192) + (language-direction symbol :offset-assert 200) (language-transition basic :offset-assert 204) (language-x-offset int32 :offset-assert 208) (sides-x-scale float :offset-assert 212) @@ -190,12 +285,12 @@ :size-assert #x2dc :flag-assert #x3b027002dc (:methods - (dummy-14 (_type_) none 14) - (dummy-15 (_type_) none 15) - (dummy-16 (_type_) none 16) + (progress-dummy-14 (_type_) none 14) ;; unused + (progress-dummy-15 (_type_) none 15) ;; unused + (progress-dummy-16 (_type_) none 16) ;; unused (draw-progress (_type_) none 17) - (dummy-18 () none 18) - (dummy-19 (_type_) symbol 19) + (progress-dummy-18 () none 18) ;; unused + (visible? (_type_) symbol 19) (hidden? (_type_) symbol 20) (adjust-sprites (_type_) none 21) (adjust-icons (_type_) none 22) @@ -205,10 +300,10 @@ (draw-buzzer-screen (_type_ int) none 26) (draw-notice-screen (_type_) none 27) (draw-options (_type_ int int float) none 28) - (dummy-29 (_type_) none 29) + (respond-common (_type_) none 29) (respond-progress (_type_) none 30) - (dummy-31 (_type_) none 31) - (dummy-32 (_type_) symbol 32) + (respond-memcard (_type_) none 31) + (can-go-back? (_type_) symbol 32) (initialize-icons (_type_) none 33) (initialize-particles (_type_) none 34) (draw-memcard-storage-error (_type_ font-context) none 35) @@ -220,16 +315,16 @@ (draw-memcard-auto-save-error (_type_ font-context) none 41) (draw-memcard-removed (_type_ font-context) none 42) (draw-memcard-error (_type_ font-context) none 43) - (dummy-44 (_type_) none 44) + (progress-dummy-44 (_type_) none 44) ;; unused (push! (_type_) none 45) (pop! (_type_) none 46) - (dummy-47 (_type_) none 47) + (progress-dummy-47 (_type_) none 47) ;; unused (enter! (_type_ progress-screen int) none 48) (draw-memcard-format (_type_ font-context) none 49) (draw-auto-save (_type_ font-context) none 50) (set-transition-progress! (_type_ int) none 51) (set-transition-speed! (_type_) none 52) - (dummy-53 (_type_ progress-screen) progress-screen 53) + (set-memcard-screen (_type_ progress-screen) progress-screen 53) (draw-pal-change-to-60hz (_type_ font-context) none 54) (draw-pal-now-60hz (_type_ font-context) none 55) (draw-no-disc (_type_ font-context) none 56) @@ -251,7 +346,15 @@ (define *progress-last-task-index* 0) -0 + +(defun-extern get-game-count int count-info) + +(define-extern *level-task-data* (array level-tasks-info)) +(define-extern *level-task-data-remap* (array int32)) + +(defun-extern deactivate-progress none) +(defun-extern calculate-completion progress float) +(defun-extern make-current-level-available-to-progress none) diff --git a/goal_src/engine/ui/progress/progress-draw.gc b/goal_src/engine/ui/progress/progress-draw.gc index 8235f15f56..16cd6833b3 100644 --- a/goal_src/engine/ui/progress/progress-draw.gc +++ b/goal_src/engine/ui/progress/progress-draw.gc @@ -1510,432 +1510,207 @@ ) (defmethod draw-options progress ((obj progress) (arg0 int) (arg1 int) (arg2 float)) - (local-vars - (sv-112 font-context) - (sv-128 int) - (sv-144 int) - (sv-160 (function _varargs_ object)) - (sv-176 string) - (sv-192 string) - (sv-208 string) - (sv-224 (function _varargs_ object)) - (sv-240 string) - (sv-256 string) - (sv-272 string) - (sv-288 (function string font-context symbol int int float)) - (sv-304 (function _varargs_ object)) - (sv-320 (function _varargs_ object)) - (sv-336 string) - (sv-352 string) - (sv-368 string) - (sv-384 (function _varargs_ object)) - (sv-400 string) - (sv-416 string) - (sv-432 string) - (sv-448 uint) - (sv-464 int) - (sv-480 int) - (sv-496 int) - (sv-512 uint) - (sv-528 (function _varargs_ object)) - (sv-544 string) - (sv-560 string) - (sv-576 string) - (sv-592 (function _varargs_ object)) - (sv-608 string) - (sv-624 string) - (sv-640 string) - (sv-656 (function _varargs_ object)) - (sv-672 string) - (sv-688 string) - (sv-704 string) - (sv-720 (function _varargs_ object)) - (sv-736 string) - (sv-752 string) - (sv-768 string) - (sv-784 (function _varargs_ object)) - (sv-800 string) - (sv-816 string) - (sv-832 string) - (sv-848 (function _varargs_ object)) - (sv-864 string) - (sv-880 string) - (sv-896 string) - (sv-912 string) - ) (let ((s3-0 (-> *options-remap* (-> obj display-state)))) (when s3-0 (let ((s2-1 (- arg0 (/ (* arg1 (length s3-0)) 2))) (s1-0 0) + (unkx 27) + (unk2 0) + (font (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning))) ) - 27 - 0 - (set! sv-112 - (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) - ) - (let ((v1-11 sv-112)) - (set! (-> v1-11 width) (the float 350)) - ) - (let ((v1-12 sv-112)) - (set! (-> v1-12 height) (the float 25)) - ) - (set! (-> sv-112 flags) (font-flags shadow kerning middle left large)) + (set-width! font 350) + (set-height! font 25) + (set! (-> font flags) (font-flags shadow kerning middle left large)) (dotimes (s0-0 (length s3-0)) - (set! sv-912 (the-as string #f)) - (set! sv-128 27) - (set! sv-144 s2-1) + (let ((option-str (the string #f)) + (x-off 27) + (y-off s2-1) + ) (let ((v1-18 (-> s3-0 s0-0 option-type))) (cond - ((= v1-18 7) - (cond - ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (set! sv-160 format) - (set! sv-176 (clear *temp-string*)) - (set! sv-192 "~30L~S~0L ~S") - (set! sv-208 (lookup-text! *common-text* (game-text-id yes) #f)) - (let ((a3-2 (lookup-text! *common-text* (game-text-id no) #f))) - (sv-160 sv-176 sv-192 sv-208 a3-2) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-224 format) - (set! sv-240 (clear *temp-string*)) - (set! sv-256 "~0L~S ~30L~S~1L") - (set! sv-272 (lookup-text! *common-text* (game-text-id yes) #f)) - (let ((a3-3 (lookup-text! *common-text* (game-text-id no) #f))) - (sv-224 sv-240 sv-256 sv-272 a3-3) - ) - (set! sv-912 *temp-string*) - sv-912 + ((= v1-18 (game-option-type yes-no)) + (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id yes) #f) (lookup-text! *common-text* (game-text-id no) #f))) + (set! option-str (string-format "~0L~S ~30L~S~1L" (lookup-text! *common-text* (game-text-id yes) #f) (lookup-text! *common-text* (game-text-id no) #f))) ) - ) ) - ((or (= v1-18 6) (= v1-18 8)) + ((or (= v1-18 (game-option-type menu)) (= v1-18 (game-option-type button))) (cond ((nonzero? (-> s3-0 s0-0 name)) - (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - sv-912 + (set! option-str (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) ) (else - (set! sv-912 (the-as string #f)) - (the-as symbol sv-912) + (set! option-str (the-as string #f)) ) ) ) ((and (-> obj selected-option) (= (-> obj option-index) s0-0)) - (let ((a0-19 sv-112)) - (set! (-> a0-19 color) (font-color default)) - ) - (set! (-> sv-112 origin x) (the float (- sv-128 (-> obj left-x-offset)))) + (set-color! font (font-color default)) + (set! (-> font origin x) (the float (- x-off (-> obj left-x-offset)))) (case (-> s3-0 s0-0 option-type) - ((3) - (set! (-> sv-112 origin y) (the float (+ s2-1 -20))) + (((game-option-type center-screen)) + (set! (-> font origin y) (the float (+ s2-1 -20))) ) (else - (set! (-> sv-112 origin y) (the float (+ s2-1 -8))) + (set! (-> font origin y) (the float (+ s2-1 -8))) ) ) - (let ((v1-64 sv-112)) - (set! (-> v1-64 scale) 0.6) - ) - (set! sv-288 print-game-text) - (let ((a0-23 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (a1-11 sv-112) - (a2-10 #f) - (a3-4 128) - (t0-1 22) - ) - (sv-288 a0-23 a1-11 a2-10 a3-4 t0-1) - ) + (set-scale! font 0.6) + (print-game-text (lookup-text! *common-text* (-> s3-0 s0-0 name) #f) font #f 128 22) (case (-> s3-0 s0-0 option-type) - ((3) - (set! sv-144 (+ s2-1 3)) - sv-144 + (((game-option-type center-screen)) + (set! y-off (+ s2-1 3)) ) (else - (set! sv-144 (+ s2-1 7)) - sv-144 + (set! y-off (+ s2-1 7)) ) ) - (let ((v1-81 (-> s3-0 s0-0 option-type))) - (cond - ((zero? v1-81) - (let* ((v1-82 (the-as uint #x8000ffff)) - (f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) - (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) - (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) - ) - (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as int a3-5)) - ) - (set! sv-304 format) - (let ((a0-42 (clear *temp-string*)) - (a1-13 "~D") - (a2-12 (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) - ) - (sv-304 a0-42 a1-13 a2-12) - ) - (set! sv-912 *temp-string*) - (set! sv-128 (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100)) - sv-128 - ) - ((= v1-81 2) - (cond - ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (set! sv-320 format) - (set! sv-336 (clear *temp-string*)) - (set! sv-352 "~30L~S~0L ~S") - (set! sv-368 (lookup-text! *common-text* (game-text-id on) #f)) - (let ((a3-6 (lookup-text! *common-text* (game-text-id off) #f))) - (sv-320 sv-336 sv-352 sv-368 a3-6) + (case (-> s3-0 s0-0 option-type) + (((game-option-type slider)) + (let* ((v1-82 (the-as uint #x8000ffff)) + (f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) + (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) + (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-384 format) - (set! sv-400 (clear *temp-string*)) - (set! sv-416 "~0L~S ~30L~S~1L") - (set! sv-432 (lookup-text! *common-text* (game-text-id on) #f)) - (let ((a3-7 (lookup-text! *common-text* (game-text-id off) #f))) - (sv-384 sv-400 sv-416 sv-432 a3-7) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ) + (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as int a3-5)) ) - ((= v1-81 1) - (set! sv-512 (-> obj language-selection)) - (set! sv-448 (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) - (if (and (zero? (scf-get-territory)) - (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) - ) - (set! sv-464 5) - (set! sv-464 6) - ) - (if (-> obj language-transition) - (set! (-> obj language-x-offset) - (seekl (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio)))) - ) - ) - (when (>= (-> obj language-x-offset) 100) - (set! (-> obj language-selection) sv-448) - (set! sv-512 sv-448) - (set! (-> obj language-transition) #f) - (set! (-> obj language-x-offset) 0) - 0 + (set! option-str (string-format "~D" (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify)))))) + (set! x-off (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100)) + x-off + ) + (((game-option-type on-off)) + (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id on) #f) (lookup-text! *common-text* (game-text-id off) #f))) + (set! option-str (string-format "~0L~S ~30L~S~1L" (lookup-text! *common-text* (game-text-id on) #f) (lookup-text! *common-text* (game-text-id off) #f))) ) - (set! (-> sv-112 origin y) (the float (+ s2-1 3))) - (let ((a0-62 sv-112)) - (set! (-> a0-62 color) (font-color lighter-lighter-blue)) - ) - 0 - (set! sv-480 (mod (the-as int (+ sv-512 1)) sv-464)) - (let ((a0-66 (mod (+ sv-464 -1 sv-512) sv-464)) - (v1-153 (mod (the-as int (+ sv-512 2)) sv-464)) - ) - (set! sv-496 (mod (+ sv-464 -2 sv-512) sv-464)) - (cond - ((-> obj language-direction) - (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) - (print-language-name a0-66 sv-112 a2-22 #f) - ) - (let ((a2-23 (+ (-> obj language-x-offset) 100))) - (cond - ((< a2-23 150) - (let ((t9-27 print-language-name) - (a1-30 sv-112) - (a3-9 #t) - ) - (t9-27 sv-480 a1-30 a2-23 a3-9) - ) - ) - (else - (let ((a2-24 (- 200 (-> obj language-x-offset))) - (t9-28 print-language-name) - (a1-31 sv-112) - (a3-10 #f) - ) - (t9-28 sv-496 a1-31 a2-24 a3-10) - ) + ) + (((game-option-type language)) + (let ((old-lang (-> obj language-selection)) + (new-lang (-> (the-as (pointer language-enum) (-> s3-0 s0-0 value-to-modify)))) + (max-lang (if (and (= (scf-get-territory) GAME_TERRITORY_SCEA) + (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))) + 5 + 6 + )) + ) + (if (-> obj language-transition) + (set! (-> obj language-x-offset) + (seekl (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio)))))) + (when (>= (-> obj language-x-offset) 100) + (set! (-> obj language-selection) new-lang) + (set! old-lang new-lang) + (set! (-> obj language-transition) #f) + (set! (-> obj language-x-offset) 0) + ) + (set! (-> font origin y) (the float (+ s2-1 3))) + (set-color! font (font-color lighter-lighter-blue)) + 0 + (let ((next-lang (mod (+ old-lang 1) max-lang)) + (a0-66 (mod (+ max-lang -1 old-lang) max-lang)) + (v1-153 (mod (+ old-lang 2) max-lang)) + (prev-lang (mod (+ max-lang -2 old-lang) max-lang)) + ) + (cond + ((-> obj language-direction) + (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) + (print-language-name a0-66 font a2-22 #f) + ) + (let ((a2-23 (+ (-> obj language-x-offset) 100))) + (cond + ((< a2-23 150) + (print-language-name (the int next-lang) font a2-23 #t) + ) + (else + (let ((a2-24 (- 200 (-> obj language-x-offset)))) + (print-language-name prev-lang font a2-24 #f) ) ) ) ) - (else - (let ((a2-25 (+ (-> obj language-x-offset) 100))) - (cond - ((< a2-25 150) - (print-language-name a0-66 sv-112 a2-25 #f) - ) - (else - (let ((a2-26 (- 200 (-> obj language-x-offset)))) - (print-language-name v1-153 sv-112 a2-26 #t) - ) + ) + (else + (let ((a2-25 (+ (-> obj language-x-offset) 100))) + (cond + ((< a2-25 150) + (print-language-name a0-66 font a2-25 #f) + ) + (else + (let ((a2-26 (- 200 (-> obj language-x-offset)))) + (print-language-name (the int v1-153) font a2-26 #t) ) ) ) - (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) - (print-language-name sv-480 sv-112 a2-27 #t) - ) + ) + (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) + (print-language-name (the int next-lang) font a2-27 #t) ) ) ) - (when (not (-> obj language-transition)) - (let ((a0-75 sv-112)) - (set! (-> a0-75 color) (font-color yellow-green-2)) - ) - ) - (let ((t9-32 print-language-name) - (a1-37 sv-112) - (a2-28 (-> obj language-x-offset)) - (a3-14 (-> obj language-direction)) - ) - (t9-32 (the-as int sv-512) a1-37 a2-28 (the-as symbol a3-14)) - ) ) - ((= v1-81 3) - (set! sv-912 (lookup-text! *common-text* (game-text-id move-dpad) #f)) - sv-912 - ) - ((= v1-81 4) - (cond - ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3) - (set! sv-528 format) - (set! sv-544 (clear *temp-string*)) - (set! sv-560 "~30L~S~0L ~S") - (set! sv-576 (lookup-text! *common-text* (game-text-id 4x3) #f)) - (let ((a3-15 (lookup-text! *common-text* (game-text-id 16x9) #f))) - (sv-528 sv-544 sv-560 sv-576 a3-15) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-592 format) - (set! sv-608 (clear *temp-string*)) - (set! sv-624 "~0L~S ~30L~S~1L") - (set! sv-640 (lookup-text! *common-text* (game-text-id 4x3) #f)) - (let ((a3-16 (lookup-text! *common-text* (game-text-id 16x9) #f))) - (sv-592 sv-608 sv-624 sv-640 a3-16) - ) - (set! sv-912 *temp-string*) - sv-912 - ) + (if (not (-> obj language-transition)) + (set-color! font (font-color yellow-green-2))) + (print-language-name (the-as int old-lang) font (-> obj language-x-offset) (-> obj language-direction)) + )) + (((game-option-type center-screen)) + (set! option-str (lookup-text! *common-text* (game-text-id move-dpad) #f)) + ) + (((game-option-type aspect-ratio)) + (if (= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id 4x3) #f) (lookup-text! *common-text* (game-text-id 16x9) #f))) + (set! option-str (string-format "~0L~S ~30L~S~1L" (lookup-text! *common-text* (game-text-id 4x3) #f) (lookup-text! *common-text* (game-text-id 16x9) #f))) ) - ) - ((= v1-81 5) - (cond - ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc) - (set! sv-656 format) - (set! sv-672 (clear *temp-string*)) - (set! sv-688 "~0L~S ~30L~S~1L") - (set! sv-704 (lookup-text! *common-text* (game-text-id 50hz) #f)) - (let ((a3-17 (lookup-text! *common-text* (game-text-id 60hz) #f))) - (sv-656 sv-672 sv-688 sv-704 a3-17) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-720 format) - (set! sv-736 (clear *temp-string*)) - (set! sv-752 "~30L~S~0L ~S") - (set! sv-768 (lookup-text! *common-text* (game-text-id 50hz) #f)) - (let ((a3-18 (lookup-text! *common-text* (game-text-id 60hz) #f))) - (sv-720 sv-736 sv-752 sv-768 a3-18) - ) - (set! sv-912 *temp-string*) - sv-912 - ) + ) + (((game-option-type video-mode)) + (if (= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc) + (set! option-str (string-format "~0L~S ~30L~S~1L" (lookup-text! *common-text* (game-text-id 50hz) #f) (lookup-text! *common-text* (game-text-id 60hz) #f))) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id 50hz) #f) (lookup-text! *common-text* (game-text-id 60hz) #f))) ) - ) - ) + ) ) ) (else - (let ((v1-195 (-> s3-0 s0-0 option-type))) - (cond - ((or (zero? v1-195) (= v1-195 3) (= v1-195 4) (= v1-195 5)) - (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - sv-912 - ) - ((= v1-195 2) - (set! sv-784 format) - (set! sv-800 (clear *temp-string*)) - (set! sv-816 "~S: ~S") - (set! sv-832 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (let ((a3-19 (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (lookup-text! *common-text* (game-text-id on) #f) - (lookup-text! *common-text* (game-text-id off) #f) - ) - ) - ) - (sv-784 sv-800 sv-816 sv-832 a3-19) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ((= v1-195 1) - (set! sv-848 format) - (set! sv-864 (clear *temp-string*)) - (set! sv-880 "~S: ~S") - (set! sv-896 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (let ((a3-20 (lookup-text! - *common-text* - (-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) - #f - ) - ) - ) - (sv-848 sv-864 sv-880 sv-896 a3-20) - ) - (set! sv-912 *temp-string*) - sv-912 - ) + (case (-> s3-0 s0-0 option-type) + (((game-option-type slider) + (game-option-type center-screen) + (game-option-type aspect-ratio) + (game-option-type video-mode) ) + (set! option-str (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) + ) + (((game-option-type on-off)) + (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> s3-0 s0-0 name) #f) + (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) + (lookup-text! *common-text* (game-text-id on) #f) + (lookup-text! *common-text* (game-text-id off) #f) + ))) + ) + (((game-option-type language)) + (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> s3-0 s0-0 name) #f) + (lookup-text! *common-text* (-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) #f))) + ) ) ) ) ) - (when sv-912 + (when option-str (let ((f0-23 (-> obj transition-percentage-invert))) - (let ((v1-235 sv-112)) - (set! (-> v1-235 color) - (the-as font-color (if (and (= s0-0 (-> obj option-index)) (not (-> obj in-transition))) - 30 - 0 - ) - ) + (set-color! font (if (and (= s0-0 (-> obj option-index)) (not (-> obj in-transition))) + (font-color yellow-green-2) + (font-color default) + ) ) - ) - (set! (-> sv-112 origin x) (the float (- sv-128 (-> obj left-x-offset)))) - (set! (-> sv-112 origin y) (the float (the int (* (the float sv-144) (if (-> s3-0 s0-0 scale) + (set! (-> font origin x) (the float (- x-off (-> obj left-x-offset)))) + (set! (-> font origin y) (the float (the int (* (the float y-off) (if (-> s3-0 s0-0 scale) f0-23 1.0 - ) - ) - ) - ) - ) - (let ((v1-246 sv-112)) - (set! (-> v1-246 scale) (* arg2 f0-23)) - ) - (let ((t9-60 print-game-text) - (a1-64 sv-112) - (a2-50 #f) - (a3-21 (the int (* 128.0 f0-23))) - (t0-2 22) - ) - (t9-60 sv-912 a1-64 a2-50 a3-21 t0-2) - ) + ))))) + (set-scale! font (* arg2 f0-23)) + (print-game-text option-str font #f (the int (* 128.0 f0-23)) 22) ) ) (+! s2-1 arg1) (+! s1-0 1) - ) + )) ) ) ) @@ -2156,3 +1931,4 @@ + diff --git a/goal_src/engine/ui/progress/progress-part.gc b/goal_src/engine/ui/progress/progress-part.gc index 90168e6b6d..fe4a70a904 100644 --- a/goal_src/engine/ui/progress/progress-part.gc +++ b/goal_src/engine/ui/progress/progress-part.gc @@ -993,8 +993,8 @@ (progress-new-particle :part 90 :x 256.0 :y 224.0 :z 16.0) ;; tint (progress-new-particle :part 88 :x -42.0 :y (#if PC_PORT 256.0 254.0) :z 5.0) ;; left (progress-new-particle :part 89 :x 610.0 :y (#if PC_PORT 256.0 254.0) :z 5.0) ;; right - (progress-new-particle :part 85 :x -320.0 :y 40.0 :z 14.0) - (progress-new-particle :part 86 :x -320.0 :y 400.0 :z 14.0) + (progress-new-particle :part 85 :x -320.0 :y 40.0 :z 14.0) ;; prev + (progress-new-particle :part 86 :x -320.0 :y 400.0 :z 14.0) ;; next (progress-new-particle :part 87 :x -320.0 :y 194.0 :z 15.0) (progress-new-particle :part 97 :x -320.0 :y 194.0 :z 14.0) (progress-new-particle :part 97 :x -320.0 :y 194.0 :z 14.0) @@ -1022,6 +1022,10 @@ (progress-new-particle :part 572 :x -320.0 :y 338.0 :z 4.0) (progress-new-particle :part 573 :x -320.0 :y 338.0 :z 4.0) (progress-new-particle :part 615 :x -320.0 :y 180.0 :z 4.0) + (#when PC_PORT + (progress-new-particle :part 85 :x -320.0 :y 32.0 :z 14.0) ;; prev + (progress-new-particle :part 86 :x -320.0 :y 412.0 :z 14.0) ;; next + ) 0 (none) ) diff --git a/goal_src/engine/ui/progress/progress-static.gc b/goal_src/engine/ui/progress/progress-static.gc index 122b5ec991..b87c990629 100644 --- a/goal_src/engine/ui/progress/progress-static.gc +++ b/goal_src/engine/ui/progress/progress-static.gc @@ -9,154 +9,152 @@ ;; options in the start menu options (define *main-options* - (new 'static 'boxed-array :type game-option :length 7 :allocated-length 7 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x6 :name (game-text-id load-game) :scale #t :param3 16) - (new 'static 'game-option :option-type #x6 :name (game-text-id save-game) :scale #t :param3 17) - (new 'static 'game-option :option-type #x6 :name (game-text-id quit-game) :scale #t :param3 34) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option :length 7 :allocated-length 7 + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-options) :scale #t :param3 (game-option-menu game-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id graphic-options) :scale #t :param3 (game-option-menu graphic-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id sound-options) :scale #t :param3 (game-option-menu sound-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id load-game) :scale #t :param3 (game-option-menu load-game)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id save-game) :scale #t :param3 (game-option-menu save-game)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id quit-game) :scale #t :param3 (game-option-menu quit)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *title* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id new-game) :scale #t :param3 18) - (new 'static 'game-option :option-type #x6 :name (game-text-id load-game) :scale #t :param3 16) - (new 'static 'game-option :option-type #x6 :name (game-text-id options) :scale #t :param3 28) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id new-game) :scale #t :param3 (game-option-menu save-game-title)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id load-game) :scale #t :param3 (game-option-menu load-game)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id options) :scale #t :param3 (game-option-menu settings-title)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *options* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-options) :scale #t :param3 (game-option-menu game-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id graphic-options) :scale #t :param3 (game-option-menu graphic-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id sound-options) :scale #t :param3 (game-option-menu sound-settings)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *main-options-demo* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-options) :scale #t :param3 (game-option-menu game-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id graphic-options) :scale #t :param3 (game-option-menu graphic-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id sound-options) :scale #t :param3 (game-option-menu sound-settings)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *main-options-demo-shared* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id exit-demo) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-options) :scale #t :param3 (game-option-menu game-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id graphic-options) :scale #t :param3 (game-option-menu graphic-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id sound-options) :scale #t :param3 (game-option-menu sound-settings)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id exit-demo) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *game-options* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x1 :name (game-text-id language) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type language) :name (game-text-id language) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *game-options-japan* - (new 'static 'boxed-array :type game-option :length 3 :allocated-length 3 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option :length 3 :allocated-length 3 + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *game-options-demo* - (new 'static 'boxed-array :type game-option :length 3 :allocated-length 3 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option :length 3 :allocated-length 3 + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *graphic-options* - (new 'static 'boxed-array :type game-option :length 3 :allocated-length 3 - (new 'static 'game-option :option-type #x3 :name (game-text-id center-screen) :scale #t) - (new 'static 'game-option :option-type #x4 :name (game-text-id aspect-ratio) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option :length 3 :allocated-length 3 + (new 'static 'game-option :option-type (game-option-type center-screen) :name (game-text-id center-screen) :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-ratio) :name (game-text-id aspect-ratio) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *graphic-title-options-pal* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x3 :name (game-text-id center-screen) :scale #t) - (new 'static 'game-option :option-type #x5 :name (game-text-id video-mode) :scale #t) - (new 'static 'game-option :option-type #x4 :name (game-text-id aspect-ratio) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option :option-type (game-option-type center-screen) :name (game-text-id center-screen) :scale #t) + (new 'static 'game-option :option-type (game-option-type video-mode) :name (game-text-id video-mode) :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-ratio) :name (game-text-id aspect-ratio) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) (define *sound-options* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) ) -(define *yes-no-options* - (new 'static 'boxed-array :type game-option :length 1 :allocated-length 1 - (new 'static 'game-option :option-type #x7 :scale #f) - ) - ) +(define *yes-no-options* (new 'static 'boxed-array :type game-option :length 1 :allocated-length 1 + (new 'static 'game-option :option-type (game-option-type yes-no) :scale #f) + ) + ) (define *ok-options* - (new 'static 'boxed-array :type game-option :length 1 :allocated-length 1 - (new 'static 'game-option :option-type #x8 :name (game-text-id ok) :scale #f) - ) + (new 'static 'boxed-array :type game-option :length 1 :allocated-length 1 + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id ok) :scale #f) + ) ) (define *load-options* - (new 'static 'boxed-array - :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) + (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #f) + ) ) (define *save-options* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) + (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #f) + ) ) (define *save-options-title* - (new 'static 'boxed-array - :type game-option :length 6 :allocated-length 6 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id continue-without-saving) :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) + (new 'static 'boxed-array :type game-option :length 6 :allocated-length 6 + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id continue-without-saving) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #f) + ) ) ;; maps options to a progress screen -(define *options-remap* - (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length 35) - ) +(#if (not PC_PORT) + (define *options-remap* (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length 35)) + (define *options-remap* (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length 50)) + ) ;; TODO probably an enum. ;; maps "levels" to the appropriate offset in *level-task-data* diff --git a/goal_src/engine/ui/progress/progress.gc b/goal_src/engine/ui/progress/progress.gc index ef35fb5f50..eede5ed1b0 100644 --- a/goal_src/engine/ui/progress/progress.gc +++ b/goal_src/engine/ui/progress/progress.gc @@ -15,7 +15,7 @@ (starting-state progress-screen :offset-assert 24) (last-slot-saved int32 :offset-assert 32) (slider-backup float :offset-assert 36) - (language-backup int64 :offset-assert 40) + (language-backup language-enum :offset-assert 40) (on-off-backup symbol :offset-assert 48) (center-x-backup int32 :offset-assert 52) (center-y-backup int32 :offset-assert 56) @@ -75,12 +75,12 @@ "Set the options for all of the menus." ;; start off by making them all invalid - (dotimes (i 35) + (dotimes (i (progress-screen max)) (set! (-> *options-remap* i) #f) ) ;; main menu - (set! (-> *options-remap* 3) + (set! (-> *options-remap* (progress-screen settings)) (case *kernel-boot-message* (('demo) ;; game demo @@ -96,7 +96,7 @@ ) ) ) - (set! (-> *options-remap* 4) + (set! (-> *options-remap* (progress-screen game-settings)) (cond ((!= *kernel-boot-message* 'play) (if (= (scf-get-territory) GAME_TERRITORY_SCEE) @@ -106,7 +106,7 @@ ) ((and (= (scf-get-territory) GAME_TERRITORY_SCEI) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))) - ;; if ntsc-j and we're not using language cheat (needs l2+r2) + ;; if ntsc-j and we're not using language cheat (and holding l2+r2) *game-options-japan* ) (else @@ -114,45 +114,40 @@ ) ) ) - (set! (-> *options-remap* 5) - (if (and (= (-> *progress-state* starting-state) 27) + (set! (-> *options-remap* (progress-screen graphic-settings)) + (if (and (= (-> *progress-state* starting-state) (progress-screen title)) (or (= (scf-get-territory) GAME_TERRITORY_SCEE) - (and (= *progress-cheat* 'pal) - (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l2)) - (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons r2)) - ) - ) - ) - ;; (only if we came from title) if PAL or we're using the PAL cheat (needs l2+r2) + (and (= *progress-cheat* 'pal) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))) + ;; (only if we came from title) if PAL or we're using the PAL cheat (and holding l2+r2) *graphic-title-options-pal* *graphic-options* ) ) - (set! (-> *options-remap* 6) *sound-options*) - (set! (-> *options-remap* 7) *ok-options*) - (set! (-> *options-remap* 8) *ok-options*) - (set! (-> *options-remap* 9) *ok-options*) - (set! (-> *options-remap* 10) *yes-no-options*) - (set! (-> *options-remap* 11) *yes-no-options*) - (set! (-> *options-remap* 19) *ok-options*) - (set! (-> *options-remap* 16) *load-options*) - (set! (-> *options-remap* 17) *save-options*) - (set! (-> *options-remap* 18) *save-options-title*) - (set! (-> *options-remap* 20) *ok-options*) - (set! (-> *options-remap* 21) *ok-options*) - (set! (-> *options-remap* 24) *ok-options*) - (set! (-> *options-remap* 25) *ok-options*) - (set! (-> *options-remap* 26) *ok-options*) - (set! (-> *options-remap* 22) *ok-options*) - (set! (-> *options-remap* 23) *yes-no-options*) - (set! (-> *options-remap* 27) *title*) - (set! (-> *options-remap* 28) *options*) - (set! (-> *options-remap* 29) *ok-options*) - (set! (-> *options-remap* 30) *yes-no-options*) - (set! (-> *options-remap* 31) *yes-no-options*) - (set! (-> *options-remap* 32) *ok-options*) - (set! (-> *options-remap* 33) *ok-options*) - (set! (-> *options-remap* 34) *yes-no-options*) + (set! (-> *options-remap* (progress-screen sound-settings)) *sound-options*) + (set! (-> *options-remap* (progress-screen memcard-no-space)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-not-inserted)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-not-formatted)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-format)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen memcard-data-exists)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen memcard-insert)) *ok-options*) + (set! (-> *options-remap* (progress-screen load-game)) *load-options*) + (set! (-> *options-remap* (progress-screen save-game)) *save-options*) + (set! (-> *options-remap* (progress-screen save-game-title)) *save-options-title*) + (set! (-> *options-remap* (progress-screen memcard-error-loading)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-error-saving)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-error-formatting)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-error-creating)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-auto-save-error)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-removed)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-no-data)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen title)) *title*) + (set! (-> *options-remap* (progress-screen settings-title)) *options*) + (set! (-> *options-remap* (progress-screen auto-save)) *ok-options*) + (set! (-> *options-remap* (progress-screen pal-change-to-60hz)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen pal-now-60hz)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen no-disc)) *ok-options*) + (set! (-> *options-remap* (progress-screen bad-disc)) *ok-options*) + (set! (-> *options-remap* (progress-screen quit)) *yes-no-options*) (set! (-> *progress-state* aspect-ratio-choice) (get-aspect-ratio)) (set! (-> *progress-state* video-mode-choice) (get-video-mode)) (set! (-> *progress-state* yes-no-choice) #f) @@ -299,51 +294,43 @@ Buzzers are tallied 10% Orbs are tallied 10%" - (local-vars - (current-cells int) - (current-buzzers int) - (current-orbs int) - (total-cells int) - (total-buzzers int) - (total-orbs int) - ) - (set! current-cells 0) - (set! current-buzzers 0) - (set! current-orbs 0) - (set! total-cells 0) - (set! total-buzzers 0) - (set! total-orbs 0) - (dotimes (s5-0 (length *level-task-data*)) - (let ((s4-0 (-> *level-task-data* s5-0))) - (when (!= s4-0 #f) - (when (or (= *kernel-boot-message* 'play) (= (-> s4-0 level-name-id) (game-text-id misty-level-name))) - (dotimes (s3-0 (-> s4-0 nb-of-tasks)) - (if (= (get-task-status (-> s4-0 task-info s3-0 task-id)) (task-status invalid)) - (set! current-cells (+ current-cells 1)) + (let ((current-cells 0) + (current-buzzers 0) + (current-orbs 0) + (total-cells 0) + (total-buzzers 0) + (total-orbs 0)) + (dotimes (s5-0 (length *level-task-data*)) + (let ((s4-0 (-> *level-task-data* s5-0))) + (when (!= s4-0 #f) + (when (or (= *kernel-boot-message* 'play) (= (-> s4-0 level-name-id) (game-text-id misty-level-name))) + (dotimes (s3-0 (-> s4-0 nb-of-tasks)) + (if (= (get-task-status (-> s4-0 task-info s3-0 task-id)) (task-status invalid)) + (1+! current-cells) + ) + ) + (set! total-cells (+ total-cells (-> s4-0 nb-of-tasks))) + (set! current-orbs (+ current-orbs (-> *game-info* money-per-level s5-0))) + (set! total-orbs (+ total-orbs (-> *game-counts* data s5-0 money-count))) + (let ((v1-20 (-> s4-0 buzzer-task-index))) + (when (!= v1-20 -1) + (set! current-buzzers (+ current-buzzers (buzzer-count *game-info* (-> s4-0 task-info v1-20 task-id)))) + (set! total-buzzers (+ total-buzzers (-> *game-counts* data s5-0 buzzer-count))) ) - ) - (set! total-cells (+ total-cells (-> s4-0 nb-of-tasks))) - (set! current-orbs (+ current-orbs (-> *game-info* money-per-level s5-0))) - (set! total-orbs (+ total-orbs (-> *game-counts* data s5-0 money-count))) - (let ((v1-20 (-> s4-0 buzzer-task-index))) - (when (!= v1-20 -1) - (set! current-buzzers (+ current-buzzers (buzzer-count *game-info* (-> s4-0 task-info v1-20 task-id)))) - (set! total-buzzers (+ total-buzzers (-> *game-counts* data s5-0 buzzer-count))) ) ) ) ) ) - ) - (when the-progress - (set! (-> the-progress total-nb-of-power-cells) total-cells) - (set! (-> the-progress total-nb-of-buzzers) total-buzzers) - (set! (-> the-progress total-nb-of-orbs) total-orbs) - ) - (+ (/ (* 80.0 (the float current-cells)) (the float total-cells)) - (/ (* 10.0 (the float current-orbs)) (the float total-orbs)) - (/ (* 10.0 (the float current-buzzers)) (the float total-buzzers)) - ) + (when the-progress + (set! (-> the-progress total-nb-of-power-cells) total-cells) + (set! (-> the-progress total-nb-of-buzzers) total-buzzers) + (set! (-> the-progress total-nb-of-orbs) total-orbs) + ) + (+ (/ (* 80.0 (the float current-cells)) (the float total-cells)) + (/ (* 10.0 (the float current-orbs)) (the float total-orbs)) + (/ (* 10.0 (the float current-buzzers)) (the float total-buzzers)) + )) ) (define *progress-save-info* (new 'global 'mc-slot-info)) @@ -467,7 +454,6 @@ ) (((progress-screen memcard-removed)) (set! (-> *progress-state* last-slot-saved) 0) - 0 ) ) ) @@ -513,7 +499,7 @@ (defmethod set-transition-progress! progress ((obj progress) (arg0 int)) (set! (-> obj transition-offset) arg0) (set! (-> obj transition-offset-invert) (- 512 arg0)) - (set! (-> obj transition-percentage) (* 0.001953125 (the float arg0))) + (set! (-> obj transition-percentage) (* (1/ 512) (the float arg0))) (set! (-> obj transition-percentage-invert) (- 1.0 (-> obj transition-percentage))) 0 (none) @@ -857,7 +843,7 @@ (none) ) -(defmethod dummy-32 progress ((obj progress)) +(defmethod can-go-back? progress ((obj progress)) (let ((v1-2 (-> *progress-process* 0 display-state)) (a1-1 (-> *progress-state* starting-state)) ) @@ -872,20 +858,35 @@ (= a1-1 (progress-screen buzzer)) (= a1-1 (progress-screen title)) ) - (or (= v1-2 (progress-screen settings)) - (= v1-2 (progress-screen game-settings)) - (= v1-2 (progress-screen graphic-settings)) - (= v1-2 (progress-screen sound-settings)) - (= v1-2 (progress-screen title)) - (= v1-2 (progress-screen settings-title)) - ) + (#if (not PC_PORT) + (or (= v1-2 (progress-screen settings)) + (= v1-2 (progress-screen game-settings)) + (= v1-2 (progress-screen graphic-settings)) + (= v1-2 (progress-screen sound-settings)) + (= v1-2 (progress-screen title)) + (= v1-2 (progress-screen settings-title))) + (or (= v1-2 (progress-screen settings)) + (= v1-2 (progress-screen game-settings)) + (= v1-2 (progress-screen graphic-settings)) + (= v1-2 (progress-screen sound-settings)) + (= v1-2 (progress-screen title)) + (= v1-2 (progress-screen settings-title)) + (= v1-2 (progress-screen camera-options)) + (= v1-2 (progress-screen accessibility-options)) + (= v1-2 (progress-screen misc-options)) + (= v1-2 (progress-screen game-ps2-options)) + (= v1-2 (progress-screen gfx-ps2-options)) + (= v1-2 (progress-screen resolution)) + (= v1-2 (progress-screen aspect-ratio)) + ) + ) ) ) ) ) ) -(defmethod dummy-19 progress ((obj progress)) +(defmethod visible? progress ((obj progress)) (the-as symbol (and *progress-process* (zero? (-> *progress-process* 0 in-out-position)))) ) @@ -933,7 +934,7 @@ ) ) -(defmethod dummy-53 progress ((obj progress) (arg0 progress-screen)) +(defmethod set-memcard-screen progress ((obj progress) (arg0 progress-screen)) (let ((s4-0 (-> obj card-info)) (gp-0 arg0) ) @@ -1034,14 +1035,12 @@ ) ) -(defmethod dummy-31 progress ((obj progress)) +(defmethod respond-memcard progress ((obj progress)) (let ((s5-0 (-> obj card-info))) (when (and s5-0 (not (-> obj in-transition))) (when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) + (cpad-clear! 0 x) + (cpad-clear! 0 circle) (case (-> obj display-state) (((progress-screen load-game)) (cond @@ -1091,14 +1090,12 @@ (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) (set! (-> obj next-display-state) (progress-screen memcard-saving)) ) - ((begin - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (= (-> obj display-state-stack 0) (progress-screen title)) - ) - (set! (-> obj next-display-state) (progress-screen save-game-title)) - ) (else - (set! (-> obj next-display-state) (progress-screen save-game)) + (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (if (= (-> obj display-state-stack 0) (progress-screen title)) + (set! (-> obj next-display-state) (progress-screen save-game-title)) + (set! (-> obj next-display-state) (progress-screen save-game)) + ) ) ) ) @@ -1225,7 +1222,7 @@ (none) ) -(defmethod dummy-29 progress ((obj progress)) +(defmethod respond-common progress ((obj progress)) (mc-get-slot-info 0 *progress-save-info*) (set! (-> obj card-info) *progress-save-info*) (let ((s5-0 (-> *options-remap* (-> obj display-state)))) @@ -1249,7 +1246,7 @@ (when (-> obj selected-option) (let ((v1-34 #f)) (case (-> s5-0 (-> obj option-index) option-type) - ((3) + (((game-option-type center-screen)) (when (< -48 (-> *setting-control* current screeny)) (set! v1-34 #t) (+! (-> *setting-control* default screeny) -1) @@ -1290,7 +1287,7 @@ (when (-> obj selected-option) (let ((v1-69 #f)) (case (-> s5-0 (-> obj option-index) option-type) - ((3) + (((game-option-type center-screen)) (when (< (-> *setting-control* current screeny) 48) (set! v1-69 #t) (+! (-> *setting-control* default screeny) 1) @@ -1311,11 +1308,11 @@ ((cpad-hold? 0 left) (cond ((cpad-pressed? 0 left) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7)) + (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))) (let ((s4-5 #f)) (case (-> s5-0 (-> obj option-index) option-type) - ((2 7) - (when (not (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)))) + (((game-option-type on-off) (game-option-type yes-no)) + (when (not (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) (set! s4-5 #t) (if (= (-> s5-0 (-> obj option-index) value-to-modify) (&-> *setting-control* current vibration)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) @@ -1323,15 +1320,15 @@ ) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #t) ) - ((4) - (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect16x9)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect4x3) + (((game-option-type aspect-ratio)) + (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3) ) - ((5) - (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'ntsc)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'pal) + (((game-option-type video-mode)) + (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal) ) - ((1) + (((game-option-type language)) (if (> (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) 0) (+! (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify))) -1) (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) @@ -1357,35 +1354,33 @@ (else (when (-> obj selected-option) (let ((v1-157 #f)) - (let ((a0-101 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? a0-101) - (cond - ((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> s5-0 (-> obj option-index) param1)) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (cond + ((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (+ 1.0 (-> s5-0 (-> obj option-index) param1)) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (+ -1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ -1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - (set! v1-157 #t) - ) - ((< (-> s5-0 (-> obj option-index) param1) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param1) - ) - (set! v1-157 #t) - ) - ) + (set! v1-157 #t) + ) + ((< (-> s5-0 (-> obj option-index) param1) + (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> s5-0 (-> obj option-index) param1) + ) + (set! v1-157 #t) + ) ) - ((= a0-101 3) - (when (< -96 (-> *setting-control* default screenx)) - (set! v1-157 #t) - (+! (-> *setting-control* default screenx) -1) - ) + ) + (((game-option-type center-screen)) + (when (< -96 (-> *setting-control* default screenx)) + (set! v1-157 #t) + (+! (-> *setting-control* default screenx) -1) ) - ) + ) ) (when v1-157 (let ((f30-0 100.0)) @@ -1408,22 +1403,22 @@ ((cpad-hold? 0 right) (cond ((cpad-pressed? 0 right) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7)) + (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))) (let ((v1-217 (the-as object #f))) (case (-> s5-0 (-> obj option-index) option-type) - ((2 7) - (set! v1-217 (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)))) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #f) + (((game-option-type on-off) (game-option-type yes-no)) + (set! v1-217 (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) #f) ) - ((4) - (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect4x3)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect16x9) + (((game-option-type aspect-ratio)) + (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9) ) - ((5) - (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'pal)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'ntsc) + (((game-option-type video-mode)) + (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc) ) - ((1) + (((game-option-type language)) (let ((v1-243 (if (and (zero? (scf-get-territory)) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) ) @@ -1456,35 +1451,33 @@ (else (when (-> obj selected-option) (let ((v1-263 #f)) - (let ((a0-177 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? a0-177) - (cond - ((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2)) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (cond + ((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2)) + (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (+ 1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - (set! v1-263 #t) - ) - ((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) - ) - (set! v1-263 #t) - ) - ) + (set! v1-263 #t) + ) + ((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> s5-0 (-> obj option-index) param2) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> s5-0 (-> obj option-index) param2) + ) + (set! v1-263 #t) + ) ) - ((= a0-177 3) - (when (< (-> *setting-control* default screenx) 96) - (set! v1-263 #t) - (+! (-> *setting-control* default screenx) 1) - ) + ) + (((game-option-type center-screen)) + (when (< (-> *setting-control* default screenx) 96) + (set! v1-263 #t) + (+! (-> *setting-control* default screenx) 1) ) - ) + ) ) (when v1-263 (let ((f30-1 100.0)) @@ -1507,38 +1500,36 @@ ((or (cpad-pressed? 0 square) (cpad-pressed? 0 triangle)) (cond ((-> obj selected-option) - (let ((v1-319 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? v1-319) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* slider-backup) - ) - ) - ((= v1-319 1) - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* language-backup) - ) - ) - ((= v1-319 2) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* on-off-backup) - ) - ) - ((= v1-319 3) - (set! (-> *setting-control* default screenx) (-> *progress-state* center-x-backup)) - (set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup)) - ) - ((or (= v1-319 4) (= v1-319 5)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* aspect-ratio-backup) - ) - ) - ) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> *progress-state* slider-backup) + ) + ) + (((game-option-type language)) + (set! (-> (the-as (pointer language-enum) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> *progress-state* language-backup) + ) + ) + (((game-option-type on-off)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (-> *progress-state* on-off-backup) + ) + ) + (((game-option-type center-screen)) + (set! (-> *setting-control* default screenx) (-> *progress-state* center-x-backup)) + (set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup)) + ) + (((game-option-type aspect-ratio) (game-option-type video-mode)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (-> *progress-state* aspect-ratio-backup) + ) + ) ) (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) (set! (-> obj selected-option) #f) ) - ((or (dummy-32 obj) + ((or (can-go-back? obj) (= (-> obj display-state) (progress-screen load-game)) (= (-> obj display-state) (progress-screen save-game)) (= (-> obj display-state) (progress-screen save-game-title)) @@ -1560,7 +1551,7 @@ (cond ((not (-> obj selected-option)) (cond - ((= (-> s5-0 (-> obj option-index) option-type) 6) + ((= (-> s5-0 (-> obj option-index) option-type) (game-option-type menu)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) @@ -1570,11 +1561,11 @@ (set! (-> obj next-display-state) (the-as progress-screen (-> s5-0 (-> obj option-index) param3))) (case (-> obj next-display-state) (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) - (set! (-> obj next-display-state) (dummy-53 obj (-> obj next-display-state))) + (set! (-> obj next-display-state) (set-memcard-screen obj (-> obj next-display-state))) ) ) ) - ((= (-> s5-0 (-> obj option-index) option-type) 8) + ((= (-> s5-0 (-> obj option-index) option-type) (game-option-type button)) (cond ((= (-> s5-0 (-> obj option-index) name) (game-text-id exit-demo)) (set! *master-exit* 'force) @@ -1590,34 +1581,32 @@ ) ) ) - ((!= (-> s5-0 (-> obj option-index) option-type) 7) - (let ((v1-427 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? v1-427) - (set! (-> *progress-state* slider-backup) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - ) - ((= v1-427 1) - (set! (-> *progress-state* language-backup) - (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ((= v1-427 2) - (set! (-> *progress-state* on-off-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ((= v1-427 3) - (set! (-> *progress-state* center-x-backup) (-> *setting-control* default screenx)) - (set! (-> *progress-state* center-y-backup) (-> *setting-control* default screeny)) - ) - ((or (= v1-427 4) (= v1-427 5)) - (set! (-> *progress-state* aspect-ratio-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ) + ((!= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no)) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (set! (-> *progress-state* slider-backup) + (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + ) + (((game-option-type language)) + (set! (-> *progress-state* language-backup) + (-> (the-as (pointer language-enum) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + ) + (((game-option-type on-off)) + (set! (-> *progress-state* on-off-backup) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + ) + ) + (((game-option-type center-screen)) + (set! (-> *progress-state* center-x-backup) (-> *setting-control* default screenx)) + (set! (-> *progress-state* center-y-backup) (-> *setting-control* default screeny)) + ) + (((game-option-type aspect-ratio) (game-option-type video-mode)) + (set! (-> *progress-state* aspect-ratio-backup) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + ) + ) ) (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) @@ -1625,8 +1614,8 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) (set! (-> obj selected-option) #t) - (when (= (-> s5-0 (-> obj option-index) option-type) 1) - (set! (-> obj language-selection) (the-as uint (-> *setting-control* current language))) + (when (= (-> s5-0 (-> obj option-index) option-type) (game-option-type language)) + (set! (-> obj language-selection) (-> *setting-control* current language)) (set! (-> obj language-direction) #t) (set! (-> obj language-transition) #f) (set! (-> obj language-x-offset) 0) @@ -1639,12 +1628,12 @@ (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) (set! (-> obj selected-option) #f) (case (-> s5-0 (-> obj option-index) option-type) - ((4) + (((game-option-type aspect-ratio)) (set! (-> *setting-control* default aspect-ratio) (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) ) ) - ((5) + (((game-option-type video-mode)) (case (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))) (('pal) (set! (-> *setting-control* default video-mode) @@ -1657,7 +1646,7 @@ ) ) ) - ((1) + (((game-option-type language)) (if (not (-> obj language-transition)) (load-level-text-files (-> obj display-level-index)) ) @@ -1992,7 +1981,7 @@ (case (-> self display-state) (((progress-screen fuel-cell) (progress-screen money) (progress-screen buzzer)) (let ((s5-0 (-> self display-level-index))) - (when (and (< (mod (-> *display* real-frame-counter) 60) 30) + (when (and (< (mod (-> *display* real-frame-counter) (seconds 0.2)) (seconds 0.1)) (zero? (-> *progress-process* 0 in-out-position)) (not (-> self in-transition)) (zero? (-> self transition-offset)) @@ -2017,8 +2006,8 @@ ) ) ) - (dummy-29 self) - (set! (-> self next-display-state) (dummy-53 self (-> self next-display-state))) + (respond-common self) + (set! (-> self next-display-state) (set-memcard-screen self (-> self next-display-state))) (let ((v1-74 (-> self display-state))) (cond ((or (= v1-74 (progress-screen fuel-cell)) @@ -2049,7 +2038,7 @@ (= v1-74 (progress-screen bad-disc)) (= v1-74 (progress-screen quit)) ) - (dummy-31 self) + (respond-memcard self) ) ) ) @@ -2061,158 +2050,157 @@ (behavior () (let* ((a1-0 (-> self display-level-index)) (gp-0 (-> *level-task-data* a1-0)) + (unk #t) + (s5-0 #f) ) - #t - (let ((s5-0 #f)) - (case (-> self display-state) - (((progress-screen fuel-cell)) - (set! s5-0 #t) - (draw-fuel-cell-screen self a1-0) - ) - (((progress-screen money)) - (set! s5-0 #t) - (draw-money-screen self a1-0) - ) - (((progress-screen buzzer)) - (set! s5-0 #t) - (draw-buzzer-screen self a1-0) - ) - (((progress-screen game-settings) (progress-screen settings)) - (hide-progress-icons) - (draw-options self 115 30 0.82) - ) - (((progress-screen graphic-settings) - (progress-screen sound-settings) - (progress-screen settings-title) - (progress-screen title) - ) - (hide-progress-icons) - (draw-options self 115 30 0.82) - ) - (((progress-screen memcard-removed) (progress-screen memcard-auto-save-error)) - (draw-notice-screen self) - (draw-options self 192 0 0.82) - ) - (((progress-screen memcard-no-data)) - (draw-notice-screen self) - (draw-options self 165 0 0.82) - ) - (((progress-screen memcard-format)) - (draw-notice-screen self) - (draw-options self 172 0 0.82) - ) - (((progress-screen memcard-no-space) - (progress-screen memcard-not-inserted) - (progress-screen memcard-not-formatted) - ) - (draw-notice-screen self) - (draw-options self 195 0 0.82) - ) - (((progress-screen memcard-error-loading) - (progress-screen memcard-error-saving) - (progress-screen memcard-error-formatting) - (progress-screen memcard-error-creating) - (progress-screen memcard-auto-save-error) - ) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen pal-change-to-60hz)) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen pal-now-60hz)) - (when (< (seconds 10) (- (-> *display* real-frame-counter) (-> self video-mode-timeout))) - (set! (-> *progress-state* video-mode-choice) 'pal) - (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (set! (-> self next-display-state) (progress-screen invalid)) - ) - (draw-notice-screen self) - (draw-options self 140 0 0.82) - ) - (((progress-screen no-disc) (progress-screen bad-disc)) - (draw-notice-screen self) - (if (is-cd-in?) - (draw-options self 170 0 0.82) - ) - ) - (((progress-screen quit)) - (draw-notice-screen self) - (draw-options self 110 0 0.82) - ) - (((progress-screen auto-save)) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen memcard-insert)) - (draw-notice-screen self) - (draw-options self 165 0 0.82) - ) - (((progress-screen memcard-data-exists)) - (draw-notice-screen self) - (draw-options self 168 0 0.82) - ) - (((progress-screen memcard-loading) - (progress-screen memcard-saving) - (progress-screen memcard-formatting) - (progress-screen memcard-creating) - ) - (draw-notice-screen self) - ) - (((progress-screen load-game) (progress-screen save-game)) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen save-game-title)) - (draw-notice-screen self) - (draw-options self 169 15 0.6) - ) + (case (-> self display-state) + (((progress-screen fuel-cell)) + (set! s5-0 #t) + (draw-fuel-cell-screen self a1-0) + ) + (((progress-screen money)) + (set! s5-0 #t) + (draw-money-screen self a1-0) + ) + (((progress-screen buzzer)) + (set! s5-0 #t) + (draw-buzzer-screen self a1-0) + ) + (((progress-screen game-settings) (progress-screen settings)) + (hide-progress-icons) + (draw-options self 115 30 0.82) + ) + (((progress-screen graphic-settings) + (progress-screen sound-settings) + (progress-screen settings-title) + (progress-screen title) ) - (when s5-0 - (let* ((v1-98 (cond - ((-> self stat-transition) - 0 - ) - ((= (-> self level-transition) 1) - (- (-> self transition-offset)) - ) - (else - (-> self transition-offset) - ) + (hide-progress-icons) + (draw-options self 115 30 0.82) + ) + (((progress-screen memcard-removed) (progress-screen memcard-auto-save-error)) + (draw-notice-screen self) + (draw-options self 192 0 0.82) + ) + (((progress-screen memcard-no-data)) + (draw-notice-screen self) + (draw-options self 165 0 0.82) + ) + (((progress-screen memcard-format)) + (draw-notice-screen self) + (draw-options self 172 0 0.82) + ) + (((progress-screen memcard-no-space) + (progress-screen memcard-not-inserted) + (progress-screen memcard-not-formatted) + ) + (draw-notice-screen self) + (draw-options self 195 0 0.82) + ) + (((progress-screen memcard-error-loading) + (progress-screen memcard-error-saving) + (progress-screen memcard-error-formatting) + (progress-screen memcard-error-creating) + (progress-screen memcard-auto-save-error) + ) + (draw-notice-screen self) + (draw-options self 190 0 0.82) + ) + (((progress-screen pal-change-to-60hz)) + (draw-notice-screen self) + (draw-options self 190 0 0.82) + ) + (((progress-screen pal-now-60hz)) + (when (< (seconds 10) (- (-> *display* real-frame-counter) (-> self video-mode-timeout))) + (set! (-> *progress-state* video-mode-choice) 'pal) + (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) + (set! (-> self next-display-state) (progress-screen invalid)) + ) + (draw-notice-screen self) + (draw-options self 140 0 0.82) + ) + (((progress-screen no-disc) (progress-screen bad-disc)) + (draw-notice-screen self) + (if (is-cd-in?) + (draw-options self 170 0 0.82) + ) + ) + (((progress-screen quit)) + (draw-notice-screen self) + (draw-options self 110 0 0.82) + ) + (((progress-screen auto-save)) + (draw-notice-screen self) + (draw-options self 190 0 0.82) + ) + (((progress-screen memcard-insert)) + (draw-notice-screen self) + (draw-options self 165 0 0.82) + ) + (((progress-screen memcard-data-exists)) + (draw-notice-screen self) + (draw-options self 168 0 0.82) + ) + (((progress-screen memcard-loading) + (progress-screen memcard-saving) + (progress-screen memcard-formatting) + (progress-screen memcard-creating) + ) + (draw-notice-screen self) + ) + (((progress-screen load-game) (progress-screen save-game)) + (draw-notice-screen self) + (draw-options self 190 0 0.82) + ) + (((progress-screen save-game-title)) + (draw-notice-screen self) + (draw-options self 169 15 0.6) + ) + ) + (when s5-0 + (let* ((v1-98 (cond + ((-> self stat-transition) + 0 + ) + ((= (-> self level-transition) 1) + (- (-> self transition-offset)) + ) + (else + (-> self transition-offset) ) ) - (f30-0 (the-as float (if (-> self stat-transition) - 1.0 - (-> self transition-percentage-invert) - ) - ) - ) - (s5-1 - (new - 'stack - 'font-context - *font-default-matrix* - (- 32 (-> self left-x-offset)) - (the int (* (+ 42.0 (the float (/ v1-98 2))) f30-0)) - 8325000.0 - (font-color lighter-lighter-blue) - (font-flags shadow kerning) - ) + ) + (f30-0 (the-as float (if (-> self stat-transition) + 1.0 + (-> self transition-percentage-invert) + ) + ) + ) + (s5-1 + (new + 'stack + 'font-context + *font-default-matrix* + (- 32 (-> self left-x-offset)) + (the int (* (+ 42.0 (the float (/ v1-98 2))) f30-0)) + 8325000.0 + (font-color lighter-lighter-blue) + (font-flags shadow kerning) ) ) - (let ((v1-103 s5-1)) - (set! (-> v1-103 width) (the float 328)) - ) - (let ((v1-104 s5-1)) - (set! (-> v1-104 height) (the float 45)) - ) - (set! (-> s5-1 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (-> gp-0 level-name-id) #f) - f30-0 - s5-1 - (the int (* 128.0 f30-0)) - ) + ) + (let ((v1-103 s5-1)) + (set! (-> v1-103 width) (the float 328)) + ) + (let ((v1-104 s5-1)) + (set! (-> v1-104 height) (the float 45)) + ) + (set! (-> s5-1 flags) (font-flags shadow kerning middle left large)) + (print-game-text-scaled + (lookup-text! *common-text* (-> gp-0 level-name-id) #f) + f30-0 + s5-1 + (the int (* 128.0 f30-0)) ) ) ) diff --git a/goal_src/engine/ui/text-h.gc b/goal_src/engine/ui/text-h.gc index 62252845c5..3e444f6c2f 100644 --- a/goal_src/engine/ui/text-h.gc +++ b/goal_src/engine/ui/text-h.gc @@ -455,11 +455,73 @@ (inc #xf10) (europe #xf11) + + ;; extra IDs for pc port + (camera-options #x1000) + (normal #x1001) + (inverted #x1002) + (camera-controls-horz #x1003) + (camera-controls-vert #x1004) + (misc-options #x100f) + (accessibility-options #x1010) + (money-starburst #x1011) + (ps2-options #x1020) + (ps2-load-speed #x1021) + (ps2-parts #x1022) + (discord-rpc #x1030) + (display-mode #x1031) + (windowed #x1032) + (borderless #x1033) + (fullscreen #x1034) + (game-resolution #x1035) + (resolution-fmt #x1036) + (ps2-aspect-ratio #x1037) + (ps2-aspect-ratio-msg #x1038) + (aspect-ratio-ps2 #x1039) + (fit-to-screen #x103a) + (msaa #x1050) + (x-times-fmt #x1051) + (2-times #x1052) + (4-times #x1053) + (8-times #x1054) + (16-times #x1055) + (frame-rate #x1060) + (lod-bg #x1070) + (lod-fg #x1071) + (lod-highest #x1072) + (lod-high #x1073) + (lod-mid #x1074) + (lod-low #x1075) + (lod-lowest #x1076) + (lod-ps2 #x1077) + (subtitles #x1078) + (hinttitles #x1079) + (subtitles-language #x107a) + (subtitles-speaker #x107b) + (speaker-always #x107c) + (speaker-never #x107d) + (speaker-auto #x107e) + (hint-log #x107f) + (cheats #x1080) + (cheat-eco-blue #x1090) + (cheat-eco-red #x1091) + (cheat-eco-green #x1092) + (cheat-eco-yellow #x1093) + (cheat-sidekick-alt #x1094) + (cheat-invinc #x1095) + (music-player #x10c0) + (scene-player #x10c1) + (play-credits #x10c2) + (scrapbook #x10c3) + (scene-0 #x1100) + (scene-255 #x11ff) + (hint-0 #x1200) + (hint-511 #x13ff) ;; GAME-TEXT-ID ENUM ENDS ) -;; an individual string. +;; an individual string. (deftype game-text (structure) ((id game-text-id :offset-assert 0) (text string :offset-assert 4) diff --git a/goal_src/engine/ui/text.gc b/goal_src/engine/ui/text.gc index 77749e9a16..fa4e903234 100644 --- a/goal_src/engine/ui/text.gc +++ b/goal_src/engine/ui/text.gc @@ -647,6 +647,9 @@ (set! (-> *video-parms* relative-y-scale) sv-124) (set! (-> *video-parms* relative-x-scale-reciprical) sv-128) (set! (-> *video-parms* relative-y-scale-reciprical) sv-132) + (with-pc + (if (and *debug-segment* (-> *pc-settings* display-text-box)) + (draw-debug-text-box font-ctxt))) (if (> sv-168 0) (* sv-164 (the float sv-168)) 0.0 diff --git a/goal_src/game.gp b/goal_src/game.gp index 2a75dfb9a0..672aed5602 100644 --- a/goal_src/game.gp +++ b/goal_src/game.gp @@ -324,7 +324,7 @@ ;; Text ;;;;;;;;;;;;;;;;;;;;; -(defstep :in "assets/game_text.txt" +(defstep :in "game/assets/game_text.gp" :tool 'text :out '("out/iso/0COMMON.TXT" "out/iso/1COMMON.TXT" @@ -335,7 +335,7 @@ "out/iso/6COMMON.TXT") ) -(defstep :in "game/assets/game_subtitle.txt" +(defstep :in "game/assets/game_subtitle.gp" :tool 'subtitle :out '("out/iso/0SUBTIT.TXT" "out/iso/3SUBTIT.TXT" @@ -1632,6 +1632,7 @@ "gfx/decomp-h.gc" "gfx/hw/display.gc" "engine/connect.gc" + "ui/text-h.gc" "game/settings-h.gc" "gfx/capture.gc" "debug/memory-usage-h.gc" @@ -1721,6 +1722,7 @@ "camera/cam-update-h.gc" "debug/assert-h.gc" "ui/hud-h.gc" + "ui/progress-h.gc" "ps2/rpc-h.gc" "nav/path-h.gc" "nav/navigate-h.gc" @@ -1854,7 +1856,10 @@ "game/crates.gc" "ui/hud.gc" "ui/hud-classes.gc" + "ui/progress/progress-static.gc" "ui/progress/progress-part.gc" + "ui/progress/progress-draw.gc" + "ui/progress/progress.gc" "ui/credits.gc" "game/projectiles.gc" "gfx/ocean/ocean.gc" @@ -1931,10 +1936,6 @@ (goal-src "pc/pckernel-h.gc" "dma-disasm") (goal-src "pc/pckernel.gc" "settings") (goal-src "pc/subtitle.gc" "text") +(goal-src "pc/progress-pc.gc" "progress" "pckernel") -(goal-src "pc/engine/ui/text-h.gc" "connect") -(goal-src "pc/engine/ui/progress-h.gc" "hud-h") -(goal-src "pc/engine/ui/progress/progress-static.gc" "hud-classes") -(goal-src "pc/engine/ui/progress/progress-draw.gc" "progress-part") -(goal-src "pc/engine/ui/progress/progress.gc" "progress-draw") diff --git a/goal_src/goal-lib.gc b/goal_src/goal-lib.gc index a359c54cd9..cc913939b3 100644 --- a/goal_src/goal-lib.gc +++ b/goal_src/goal-lib.gc @@ -535,7 +535,7 @@ ) (defmacro 1-! (place) - `(set! ,place (- 1 ,place)) + `(set! ,place (+ -1 ,place)) ) (defmacro *! (place amount) diff --git a/goal_src/goos-lib.gs b/goal_src/goos-lib.gs index 8a29a18b0b..1acae5258a 100644 --- a/goal_src/goos-lib.gs +++ b/goal_src/goos-lib.gs @@ -377,7 +377,7 @@ (desfun enum-max (enum) "get the highest value in an enum" - (let ((max-val -999999999)) + (let ((max-val -999999999999)) (doenum (name val enum) (when (> val max-val) (set! max-val val)) diff --git a/goal_src/kernel-defs.gc b/goal_src/kernel-defs.gc index d3d445f536..2fa9b2d728 100644 --- a/goal_src/kernel-defs.gc +++ b/goal_src/kernel-defs.gc @@ -326,12 +326,14 @@ (define-extern pc-pad-input-index-get (function int)) (define-extern pc-pad-input-map-save! (function none)) (define-extern pc-pad-get-mapped-button (function int int int)) +(define-extern pc-get-fullscreen (function symbol)) +(define-extern pc-get-screen-size (function int (pointer int32) (pointer int32) (pointer int32) none)) (define-extern pc-get-os (function symbol)) (define-extern pc-get-window-size (function (pointer int32) (pointer int32) none)) (define-extern pc-get-window-scale (function (pointer float) (pointer float) none)) (define-extern pc-set-window-size (function int int none)) (define-extern pc-set-letterbox (function int int none)) -(define-extern pc-set-fullscreen (function int int none)) +(define-extern pc-set-fullscreen (function symbol int none)) (define-extern pc-renderer-tree-set-lod (function pc-renderer-tree-type int none)) (define-extern pc-discord-rpc-update (function discord-info none)) (define-extern pc-discord-rpc-set (function int none)) diff --git a/goal_src/levels/beach/lurkercrab.gc b/goal_src/levels/beach/lurkercrab.gc index 15b0620348..ce18412444 100644 --- a/goal_src/levels/beach/lurkercrab.gc +++ b/goal_src/levels/beach/lurkercrab.gc @@ -80,7 +80,7 @@ ) (defmethod dummy-44 lurkercrab ((obj lurkercrab) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) 64) + (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) (-> obj collide-info) @@ -97,7 +97,7 @@ 6144.0 16384.0 ) - (the-as object (if (zero? (logand (-> obj nav-enemy-flags) 256)) + (the-as object (if (zero? (logand (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> obj collide-info)) ) ) @@ -114,7 +114,7 @@ ) ((= v1-1 'punch) (cond - ((logtest? (-> obj nav-enemy-flags) 32) + ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) (logclear! (-> obj mask) (process-mask actor-pause)) (go (method-of-object obj nav-enemy-die)) ) @@ -136,7 +136,7 @@ ) ) ) - ((logtest? (-> obj nav-enemy-flags) 32) + ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) (logclear! (-> obj mask) (process-mask actor-pause)) (go (method-of-object obj nav-enemy-die)) ) @@ -164,7 +164,7 @@ nav-enemy-default-event-handler (defmethod TODO-RENAME-37 lurkercrab ((obj lurkercrab)) (when (-> obj orient) - (if (logtest? (nav-control-flags bit19) (-> obj nav flags)) + (if (logtest? (nav-control-flags navcf19) (-> obj nav flags)) (seek-to-point-toward-point! (-> obj collide-info) (-> obj nav target-pos) @@ -275,7 +275,7 @@ nav-enemy-default-event-handler ) (defbehavior lurkercrab-invulnerable lurkercrab () - (set! (-> self nav-enemy-flags) (logand -33 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (let ((v1-3 (find-prim-by-id (-> self collide-info) (the-as uint 2)))) (when v1-3 (let ((v0-1 4)) @@ -287,7 +287,7 @@ nav-enemy-default-event-handler ) (defbehavior lurkercrab-vulnerable lurkercrab () - (logior! (-> self nav-enemy-flags) 32) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (let ((v1-3 (find-prim-by-id (-> self collide-info) (the-as uint 2)))) (when v1-3 (let ((v0-1 1)) @@ -308,8 +308,8 @@ nav-enemy-default-event-handler :exit (behavior () (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 8) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (none) ) :code @@ -364,7 +364,7 @@ nav-enemy-default-event-handler (joint-control-channel-group! a0-12 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 180) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-rnd-int-range 2 6) (until (not (nav-enemy-rnd-go-idle? 0.2)) (let ((gp-1 (-> self skel root-channel 0))) @@ -381,7 +381,7 @@ nav-enemy-default-event-handler ) ) ) - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((a0-19 (-> self skel root-channel 0))) (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) (set! (-> a0-19 param 0) @@ -416,7 +416,7 @@ nav-enemy-default-event-handler ) ) (lurkercrab-vulnerable) - (logior! (-> self nav-enemy-flags) 64) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (dotimes (gp-5 2) (let ((s5-0 (-> self skel root-channel 0))) (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) @@ -435,7 +435,7 @@ nav-enemy-default-event-handler ) ) (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (let ((gp-6 (-> self skel root-channel 0))) (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) (set! (-> gp-6 param 0) (ja-aframe 90.0 0)) @@ -480,7 +480,7 @@ nav-enemy-default-event-handler :exit (behavior () (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (none) ) :trans @@ -495,7 +495,7 @@ nav-enemy-default-event-handler ) :code (behavior () - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (ja-channel-push! 1 22) (while #t (let ((a0-1 (-> self skel root-channel 0))) @@ -516,7 +516,7 @@ nav-enemy-default-event-handler ) ) (lurkercrab-vulnerable) - (logior! (-> self nav-enemy-flags) 64) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) (set! (-> gp-0 param 0) (ja-aframe 30.0 0)) @@ -578,7 +578,7 @@ nav-enemy-default-event-handler ) ) (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (let ((gp-8 (-> self skel root-channel 0))) (set! (-> gp-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) (set! (-> gp-8 param 0) (ja-aframe 90.0 0)) @@ -792,7 +792,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -845,7 +845,7 @@ nav-enemy-default-event-handler (TODO-RENAME-45 obj *lurkercrab-nav-enemy-info*) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 159) obj)) (set! (-> obj orient) #t) - (set! (-> obj nav-enemy-flags) (logand -97 (-> obj nav-enemy-flags))) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5 navenmf6)) (set! (-> obj target-speed) 0.0) (set! (-> obj momentum-speed) 0.0) (set! (-> obj draw force-lod) 2) diff --git a/goal_src/levels/beach/lurkerpuppy.gc b/goal_src/levels/beach/lurkerpuppy.gc index dfa78fa277..5ac4077323 100644 --- a/goal_src/levels/beach/lurkerpuppy.gc +++ b/goal_src/levels/beach/lurkerpuppy.gc @@ -117,7 +117,7 @@ nav-enemy-default-event-handler (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) ) (until (ja-done? 0) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-attack) ) (suspend) @@ -144,10 +144,10 @@ nav-enemy-default-event-handler (behavior () (set! (-> self rotate-speed) 1456355.5) (set! (-> self turn-time) (seconds 0.1)) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) (while #t - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 30) (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) @@ -158,9 +158,9 @@ nav-enemy-default-event-handler ) (until (ja-done? 0) (let ((f0-3 (ja-aframe-num 0))) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (if (and (>= f0-3 2.5) (>= 7.5 f0-3)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) ) (suspend) @@ -170,7 +170,7 @@ nav-enemy-default-event-handler (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) ) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((a0-11 (-> self skel root-channel 0))) (set! (-> a0-11 param 0) 1.0) (joint-control-channel-group! a0-11 (the-as art-joint-anim #f) num-func-loop!) @@ -230,7 +230,7 @@ nav-enemy-default-event-handler (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-7 (-> self skel root-channel 0))) (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) @@ -284,12 +284,12 @@ nav-enemy-default-event-handler ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (none) ) :code (behavior () - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 22) (dotimes (gp-0 4) (let ((a0-2 (-> self skel root-channel 0))) @@ -303,9 +303,9 @@ nav-enemy-default-event-handler ) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (if (and (>= f0-4 2.5) (>= 7.5 f0-4)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) ) (suspend) @@ -371,7 +371,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/citadel/citb-bunny.gc b/goal_src/levels/citadel/citb-bunny.gc index c44db07cdb..c6ae091fba 100644 --- a/goal_src/levels/citadel/citb-bunny.gc +++ b/goal_src/levels/citadel/citb-bunny.gc @@ -75,7 +75,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/common/babak.gc b/goal_src/levels/common/babak.gc index 4a09e372f6..7f988518fc 100644 --- a/goal_src/levels/common/babak.gc +++ b/goal_src/levels/common/babak.gc @@ -139,7 +139,7 @@ (behavior () (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) 256) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) ) (ja-channel-push! 1 30) @@ -161,7 +161,7 @@ ) (while #t (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((a0-9 (-> self skel root-channel 0))) (set! (-> a0-9 param 0) 1.0) (joint-control-channel-group! a0-9 (the-as art-joint-anim #f) num-func-loop!) @@ -182,7 +182,7 @@ (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-loop!) ) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) (if (not (= (if (> (-> self skel active-channels) 0) (-> self skel root-channel 0 frame-group) @@ -267,7 +267,7 @@ ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-12 (-> self skel root-channel 0))) (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) @@ -383,7 +383,7 @@ :use-proximity-notice #t :use-jump-blocked #t :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/common/battlecontroller.gc b/goal_src/levels/common/battlecontroller.gc index 13b9dcdb1c..6ee31768f0 100644 --- a/goal_src/levels/common/battlecontroller.gc +++ b/goal_src/levels/common/battlecontroller.gc @@ -150,7 +150,7 @@ battlecontroller-default-event-handler (let* ((s5-0 (-> self spawner-array gp-0)) (s4-0 (handle->process (-> s5-0 creature))) ) - (when (and s4-0 (logtest? (-> (the-as nav-enemy s4-0) nav-enemy-flags) 2048)) + (when (and s4-0 (logtest? (-> (the-as nav-enemy s4-0) nav-enemy-flags) (nav-enemy-flags navenmf11))) (cond ((< (-> s5-0 state) (-> s5-0 path curve num-cverts)) (when (or (-> self noticed-player) (= (-> s5-0 state) 1)) @@ -158,7 +158,7 @@ battlecontroller-default-event-handler (eval-path-curve-div! (-> s5-0 path) s3-0 (the float (-> s5-0 state)) 'interp) (send-event s4-0 'cue-jump-to-point s3-0) ) - (if (zero? (logand (-> (the-as nav-enemy s4-0) nav-enemy-flags) 2048)) + (if (zero? (logand (-> (the-as nav-enemy s4-0) nav-enemy-flags) (nav-enemy-flags navenmf11))) (+! (-> s5-0 state) 1) ) ) @@ -206,7 +206,7 @@ battlecontroller-default-event-handler (when (the-as (pointer nav-enemy) gp-0) (logclear! (-> (the-as (pointer nav-enemy) gp-0) 0 mask) (process-mask actor-pause)) (if (-> self misty-ambush-collision-hack) - (logior! (-> (the-as (pointer nav-enemy) gp-0) 0 nav-enemy-flags) #x8000) + (logior! (-> (the-as (pointer nav-enemy) gp-0) 0 nav-enemy-flags) (nav-enemy-flags navenmf15)) ) (+! (-> self spawn-count) 1) (-> self fact pickup-type) diff --git a/goal_src/levels/common/joint-exploder.gc b/goal_src/levels/common/joint-exploder.gc index feace80fbe..09ef5dabeb 100644 --- a/goal_src/levels/common/joint-exploder.gc +++ b/goal_src/levels/common/joint-exploder.gc @@ -412,7 +412,7 @@ (-> arg0 bbox) (collide-kind background) obj - (new 'static 'pat-surface :skip #x1 :noentity #x1) + (new 'static 'pat-surface :noentity #x1) ) (let ((gp-1 (-> obj joints)) (v1-2 (-> arg0 head)) diff --git a/goal_src/levels/common/nav-enemy-h.gc b/goal_src/levels/common/nav-enemy-h.gc index f245297a34..6ed761ad0a 100644 --- a/goal_src/levels/common/nav-enemy-h.gc +++ b/goal_src/levels/common/nav-enemy-h.gc @@ -11,60 +11,97 @@ (define-extern nav-enemy-get-new-patrol-point (function int :behavior nav-enemy)) (define-extern nav-enemy-test-point-near-nav-mesh? (function vector symbol :behavior nav-enemy)) +(defenum nav-enemy-flags + :bitfield #t + :type uint32 + (navenmf0 0) + (navenmf1 1) + (navenmf2 2) + (enable-rotate 3) + (enable-travel 4) + (navenmf5 5) + (navenmf6 6) + (navenmf7 7) + (navenmf8 8) + (standing-jump 9) + (drop-jump 10) + (navenmf11 11) + (navenmf12 12) + (navenmf13 13) + (navenmf14 14) + (navenmf15 15) + (navenmf16 16) + (navenmf17 17) + (navenmf18 18) + (navenmf19 19) + (navenmf20 20) + (navenmf21 21) + (navenmf22 22) + (navenmf23 23) + (navenmf24 24) + (navenmf25 25) + (navenmf26 26) + (navenmf27 27) + (navenmf28 28) + (navenmf29 29) + (navenmf30 30) + (navenmf31 31) + ) + ;; DECOMP BEGINS (deftype nav-enemy-info (basic) - ((idle-anim int32 :offset-assert 4) - (walk-anim int32 :offset-assert 8) - (turn-anim int32 :offset-assert 12) - (notice-anim int32 :offset-assert 16) - (run-anim int32 :offset-assert 20) - (jump-anim int32 :offset-assert 24) - (jump-land-anim int32 :offset-assert 28) - (victory-anim int32 :offset-assert 32) - (taunt-anim int32 :offset-assert 36) - (die-anim int32 :offset-assert 40) - (neck-joint int32 :offset-assert 44) - (player-look-at-joint int32 :offset-assert 48) - (run-travel-speed meters :offset-assert 52) - (run-rotate-speed degrees :offset-assert 56) - (run-acceleration meters :offset-assert 60) - (run-turn-time seconds :offset-assert 64) - (walk-travel-speed meters :offset-assert 72) - (walk-rotate-speed degrees :offset-assert 76) - (walk-acceleration meters :offset-assert 80) - (walk-turn-time seconds :offset-assert 88) - (attack-shove-back meters :offset-assert 96) - (attack-shove-up meters :offset-assert 100) - (shadow-size meters :offset-assert 104) - (notice-nav-radius meters :offset-assert 108) - (nav-nearest-y-threshold meters :offset-assert 112) - (notice-distance meters :offset-assert 116) - (proximity-notice-distance meters :offset-assert 120) - (stop-chase-distance meters :offset-assert 124) - (frustration-distance meters :offset-assert 128) - (frustration-time time-frame :offset-assert 136) - (die-anim-hold-frame float :offset-assert 144) - (jump-anim-start-frame float :offset-assert 148) - (jump-land-anim-end-frame float :offset-assert 152) - (jump-height-min meters :offset-assert 156) - (jump-height-factor float :offset-assert 160) - (jump-start-anim-speed float :offset-assert 164) - (shadow-max-y meters :offset-assert 168) - (shadow-min-y meters :offset-assert 172) - (shadow-locus-dist meters :offset-assert 176) - (use-align symbol :offset-assert 180) - (draw-shadow symbol :offset-assert 184) - (move-to-ground symbol :offset-assert 188) - (hover-if-no-ground symbol :offset-assert 192) - (use-momentum symbol :offset-assert 196) - (use-flee symbol :offset-assert 200) - (use-proximity-notice symbol :offset-assert 204) - (use-jump-blocked symbol :offset-assert 208) - (use-jump-patrol symbol :offset-assert 212) - (gnd-collide-with uint64 :offset-assert 216) - (debug-draw-neck symbol :offset-assert 224) - (debug-draw-jump symbol :offset-assert 228) + ((idle-anim int32 :offset-assert 4) + (walk-anim int32 :offset-assert 8) + (turn-anim int32 :offset-assert 12) + (notice-anim int32 :offset-assert 16) + (run-anim int32 :offset-assert 20) + (jump-anim int32 :offset-assert 24) + (jump-land-anim int32 :offset-assert 28) + (victory-anim int32 :offset-assert 32) + (taunt-anim int32 :offset-assert 36) + (die-anim int32 :offset-assert 40) + (neck-joint int32 :offset-assert 44) + (player-look-at-joint int32 :offset-assert 48) + (run-travel-speed meters :offset-assert 52) + (run-rotate-speed degrees :offset-assert 56) + (run-acceleration meters :offset-assert 60) + (run-turn-time seconds :offset-assert 64) + (walk-travel-speed meters :offset-assert 72) + (walk-rotate-speed degrees :offset-assert 76) + (walk-acceleration meters :offset-assert 80) + (walk-turn-time seconds :offset-assert 88) + (attack-shove-back meters :offset-assert 96) + (attack-shove-up meters :offset-assert 100) + (shadow-size meters :offset-assert 104) + (notice-nav-radius meters :offset-assert 108) + (nav-nearest-y-threshold meters :offset-assert 112) + (notice-distance meters :offset-assert 116) + (proximity-notice-distance meters :offset-assert 120) + (stop-chase-distance meters :offset-assert 124) + (frustration-distance meters :offset-assert 128) + (frustration-time time-frame :offset-assert 136) + (die-anim-hold-frame float :offset-assert 144) + (jump-anim-start-frame float :offset-assert 148) + (jump-land-anim-end-frame float :offset-assert 152) + (jump-height-min meters :offset-assert 156) + (jump-height-factor float :offset-assert 160) + (jump-start-anim-speed float :offset-assert 164) + (shadow-max-y meters :offset-assert 168) + (shadow-min-y meters :offset-assert 172) + (shadow-locus-dist meters :offset-assert 176) + (use-align symbol :offset-assert 180) + (draw-shadow symbol :offset-assert 184) + (move-to-ground symbol :offset-assert 188) + (hover-if-no-ground symbol :offset-assert 192) + (use-momentum symbol :offset-assert 196) + (use-flee symbol :offset-assert 200) + (use-proximity-notice symbol :offset-assert 204) + (use-jump-blocked symbol :offset-assert 208) + (use-jump-patrol symbol :offset-assert 212) + (gnd-collide-with collide-kind :offset-assert 216) + (debug-draw-neck symbol :offset-assert 224) + (debug-draw-jump symbol :offset-assert 228) ) :method-count-assert 9 :size-assert #xe8 @@ -95,7 +132,7 @@ (state-timeout time-frame :offset-assert 352) (free-time time-frame :offset-assert 360) (touch-time time-frame :offset-assert 368) - (nav-enemy-flags uint32 :offset-assert 376) + (nav-enemy-flags nav-enemy-flags :offset-assert 376) (incomming-attack-id handle :offset-assert 384) (jump-return-state (state process) :offset-assert 392) (rand-gen random-generator :offset-assert 396) diff --git a/goal_src/levels/common/nav-enemy.gc b/goal_src/levels/common/nav-enemy.gc index ca28648a40..7641802bb9 100644 --- a/goal_src/levels/common/nav-enemy.gc +++ b/goal_src/levels/common/nav-enemy.gc @@ -74,14 +74,14 @@ ) (defmethod common-post nav-enemy ((obj nav-enemy)) - (when (and (logtest? (-> obj nav-enemy-flags) 256) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) (>= (- (-> *display* base-frame-counter) (-> obj touch-time)) (seconds 0.05)) ) ) ) (set-collide-offense (-> obj collide-info) 2 (collide-offense touch)) - (set! (-> obj nav-enemy-flags) (logand -257 (-> obj nav-enemy-flags))) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) ) (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) (when *target* @@ -89,13 +89,13 @@ (look-at-enemy! (-> *target* neck) (the-as vector (-> obj collide-info root-prim prim-core)) - (if (logtest? (-> obj nav-enemy-flags) 4) + (if (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf2)) 'attacking ) obj ) ) - (if (and (nonzero? (-> obj neck)) (logtest? (-> obj nav-enemy-flags) #x4000)) + (if (and (nonzero? (-> obj neck)) (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf14))) (set-target! (-> obj neck) (target-pos (-> obj nav-info player-look-at-joint))) ) ) @@ -110,22 +110,24 @@ ) (defmethod dummy-44 nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) ) (defmethod nav-enemy-touch-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) @@ -140,7 +142,7 @@ (defmethod dummy-43 nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) (cond - ((logtest? (-> obj nav-enemy-flags) 32) + ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) (send-event arg0 'get-attack-count 1) (logclear! (-> obj mask) (process-mask actor-pause attackable)) (go (method-of-object obj nav-enemy-die)) @@ -165,7 +167,7 @@ ) (the-as object (when (send-event-function arg0 v1-0) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) 256) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) #t ) ) @@ -200,9 +202,9 @@ ) ) (('cue-jump-to-point) - (when (logtest? (-> self nav-enemy-flags) 2048) + (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (set! (-> self event-param-point quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> self nav-enemy-flags) (logand -2049 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) ) ) (('cue-chase) @@ -315,8 +317,10 @@ nav-enemy-default-event-handler ) (defmethod TODO-RENAME-37 nav-enemy ((obj nav-enemy)) - (when (logtest? (-> obj nav-enemy-flags) 16) - (if (or (logtest? (-> obj nav-enemy-flags) 128) (logtest? (nav-control-flags bit19) (-> obj nav flags))) + (when (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags enable-travel)) + (if (or (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf7)) + (logtest? (nav-control-flags navcf19) (-> obj nav flags)) + ) (seek-to-point-toward-point! (-> obj collide-info) (-> obj nav target-pos) @@ -335,11 +339,11 @@ nav-enemy-default-event-handler (integrate-for-enemy-with-move-to-ground! (-> obj collide-info) (-> obj collide-info transv) - (the-as collide-kind (-> obj nav-info gnd-collide-with)) + (-> obj nav-info gnd-collide-with) 8192.0 #f (-> obj nav-info hover-if-no-ground) - (logtest? (-> obj nav-enemy-flags) #x8000) + (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf15)) ) (dummy-58 (-> obj collide-info) (-> obj collide-info transv)) ) @@ -349,7 +353,7 @@ nav-enemy-default-event-handler (defbehavior nav-enemy-travel-post nav-enemy () (cond - ((logtest? (-> self nav-enemy-flags) 8) + ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (TODO-RENAME-9 (-> self align)) (dummy-40 self) (dummy-41 self) @@ -380,9 +384,9 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-patrol-post nav-enemy () - (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) + (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) (set! (-> self nav block-count) 2.0) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (nav-enemy-get-new-patrol-point) ) (dummy-19 @@ -392,8 +396,8 @@ nav-enemy-default-event-handler (-> self nav destination-pos) (-> self rotate-speed) ) - (if (logtest? (nav-control-flags bit21) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit10)) + (if (logtest? (nav-control-flags navcf21) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (nav-enemy-travel-post) 0 @@ -424,7 +428,7 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-face-player-post nav-enemy () - (if (and *target* (logtest? (-> self nav-enemy-flags) 16)) + (if (and *target* (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) (seek-to-point-toward-point! (-> self collide-info) (target-pos 0) (-> self rotate-speed) (-> self turn-time)) ) (nav-enemy-simple-post) @@ -459,7 +463,7 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-neck-control-look-at nav-enemy () - (logior! (-> self nav-enemy-flags) #x4000) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf14)) (if (nonzero? (-> self neck)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) ) @@ -468,8 +472,8 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-neck-control-inactive nav-enemy () - (when (and (nonzero? (-> self neck)) (logtest? (-> self nav-enemy-flags) #x4000)) - (set! (-> self nav-enemy-flags) (logand -16385 (-> self nav-enemy-flags))) + (when (and (nonzero? (-> self neck)) (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf14))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf14)) (shut-down! (-> self neck)) ) 0 @@ -483,7 +487,7 @@ nav-enemy-default-event-handler (defmethod TODO-RENAME-46 nav-enemy ((obj nav-enemy) (arg0 float)) (and *target* (zero? (logand (-> *target* state-flags) #x80f8)) - (and (or (zero? (logand (-> obj nav-enemy-flags) 4096)) + (and (or (zero? (logand (-> obj nav-enemy-flags) (nav-enemy-flags navenmf12))) (< (vector-vector-distance (target-pos 0) (-> obj collide-info trans)) arg0) ) (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) @@ -494,10 +498,10 @@ nav-enemy-default-event-handler (defbehavior nav-enemy-notice-player? nav-enemy () (let ((gp-0 #f)) (cond - ((logtest? (-> self nav-enemy-flags) 1) + ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (when (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) (set! gp-0 #t) - (set! (-> self nav-enemy-flags) (logand -2 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) ) (else @@ -509,7 +513,7 @@ nav-enemy-default-event-handler ) ) ) - (logior! (-> self nav-enemy-flags) 1) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (set! (-> self notice-time) (-> *display* base-frame-counter)) ) ) @@ -750,15 +754,9 @@ nav-enemy-default-event-handler (nav-enemy-neck-control-inactive) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (-> self nav-info move-to-ground) - (move-to-ground - (-> self collide-info) - 40960.0 - 40960.0 - #t - (the-as collide-kind (-> self nav-info gnd-collide-with)) - ) + (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (-> self nav-info gnd-collide-with)) ) - (set! (-> self nav-enemy-flags) (logand -7 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1 navenmf2)) (set! (-> self state-timeout) (seconds 1)) (none) ) @@ -814,10 +812,10 @@ nav-enemy-default-event-handler (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self nav flags) - (the-as nav-control-flags (the-as int (logior (nav-control-flags bit19) (-> self nav flags)))) + (the-as nav-control-flags (the-as int (logior (nav-control-flags navcf19) (-> self nav flags)))) ) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 8) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (set! (-> self state-timeout) (seconds 1)) (set! (-> self target-speed) (-> self nav-info walk-travel-speed)) (set! (-> self acceleration) (-> self nav-info walk-acceleration)) @@ -827,7 +825,7 @@ nav-enemy-default-event-handler ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (none) ) :trans @@ -905,7 +903,7 @@ nav-enemy-default-event-handler (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 180) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((a0-8 (-> self skel root-channel 0))) (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) @@ -959,7 +957,7 @@ nav-enemy-default-event-handler ) ) ) - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((a0-15 (-> self skel root-channel 0))) (set! (-> a0-15 param 0) 1.0) (joint-control-channel-group! a0-15 (the-as art-joint-anim #f) num-func-loop!) @@ -1009,12 +1007,12 @@ nav-enemy-default-event-handler ) :enter (behavior () - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-look-at) - (if (logtest? (-> self nav-enemy-flags) 2) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (let ((gp-0 (-> self nav)) (v1-10 (target-pos 0)) ) @@ -1175,7 +1173,7 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-reset-frustration nav-enemy () - (set! (-> self nav-enemy-flags) (logand -8193 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) (if *target* (set! (-> self frustration-point quad) (-> *target* control shadow-pos quad)) ) @@ -1191,7 +1189,9 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-frustrated? nav-enemy () - (and (logtest? (-> self nav-enemy-flags) 8192) (nav-enemy-player-at-frustration-point?)) + (and (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) + (nav-enemy-player-at-frustration-point?) + ) ) (defstate nav-enemy-chase (nav-enemy) @@ -1206,7 +1206,7 @@ nav-enemy-default-event-handler (nav-enemy-neck-control-look-at) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self free-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (set! (-> self target-speed) (-> self nav-info run-travel-speed)) (set! (-> self acceleration) (-> self nav-info run-acceleration)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) @@ -1219,7 +1219,7 @@ nav-enemy-default-event-handler (if (logtest? (-> *target* state-flags) 128) (go-virtual nav-enemy-patrol) ) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory) ) (if (or (not (nav-enemy-player-at-frustration-point?)) @@ -1233,15 +1233,15 @@ nav-enemy-default-event-handler (if (>= (- (-> *display* base-frame-counter) (-> self frustration-time)) (+ (-> self reaction-time) (-> self nav-info frustration-time)) ) - (logior! (-> self nav-enemy-flags) 8192) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) ) (if (or (not (TODO-RENAME-46 self (-> self nav-info stop-chase-distance))) - (logtest? (-> self nav-enemy-flags) 8192) + (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) ) (go-virtual nav-enemy-stop-chase) ) (cond - ((logtest? (nav-control-flags bit17) (-> self nav flags)) + ((logtest? (nav-control-flags navcf17) (-> self nav flags)) (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1)) (go-virtual nav-enemy-patrol) ) @@ -1315,7 +1315,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (logtest? (nav-control-flags bit17) (-> self nav flags)) + (logtest? (nav-control-flags navcf17) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) ) (go-virtual nav-enemy-stare) @@ -1360,7 +1360,7 @@ nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((f0-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0)))) (set! (-> self state-timeout) (the-as @@ -1376,7 +1376,7 @@ nav-enemy-default-event-handler ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (none) ) :trans @@ -1407,7 +1407,7 @@ nav-enemy-default-event-handler ) ) ) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) (go-virtual nav-enemy-give-up) ) @@ -1416,7 +1416,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (logtest? (nav-control-flags bit17) (-> self nav flags)) + (logtest? (nav-control-flags navcf17) (-> self nav flags)) ) (go-virtual nav-enemy-give-up) ) @@ -1443,7 +1443,7 @@ nav-enemy-default-event-handler (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-neck-control-inactive) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) :trans @@ -1605,7 +1605,7 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-jump-post nav-enemy () - (if (logtest? (-> self nav-enemy-flags) 16) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (seek-to-point-toward-point! (-> self collide-info) (-> self jump-dest) @@ -1613,7 +1613,7 @@ nav-enemy-default-event-handler (-> self turn-time) ) ) - (when (logtest? (-> self nav-enemy-flags) 8) + (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((f30-0 (the float (- (-> *display* base-frame-counter) (-> self jump-time))))) (let ((v1-12 (eval-position! (-> self jump-trajectory) f30-0 (new 'stack-no-clear 'vector)))) (set! (-> self collide-info trans quad) (-> v1-12 quad)) @@ -1641,24 +1641,24 @@ nav-enemy-default-event-handler (set! (-> s2-2 y) 0.0) (vector-xz-normalize! s1-1 1.0) (vector-xz-normalize! s2-2 1.0) - (set! (-> self nav-enemy-flags) (logand -1537 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump drop-jump)) (if (or (>= (* 0.5 (-> self nav-info run-travel-speed)) f24-0) (>= (cos 3640.889) (vector-dot s1-1 s2-2))) - (logior! (-> self nav-enemy-flags) 512) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) ) ) (if (or (and (< f26-0 0.0) (< f28-0 (fabs f26-0))) (and (< (fabs f26-0) 12288.0) (< f28-0 20480.0))) - (logior! (-> self nav-enemy-flags) 1024) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) ) ) - (when (and arg1 (logtest? (-> self nav-enemy-flags) 1024)) - (set! (-> self nav-enemy-flags) (logand -513 (-> self nav-enemy-flags))) + (when (and arg1 (logtest? (-> self nav-enemy-flags) (nav-enemy-flags drop-jump))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) (set! f30-0 2048.0) ) (setup-from-to-height! (-> self jump-trajectory) s4-0 arg0 f30-0 (* 0.000011111111 arg4)) ) (set! (-> self nav extra-nav-sphere quad) (-> arg0 quad)) (set! (-> self nav extra-nav-sphere w) (-> self collide-info nav-radius)) - (logior! (-> self collide-info nav-flags) 2) + (logior! (-> self collide-info nav-flags) (nav-flags navf1)) 0 (none) ) @@ -1676,13 +1676,13 @@ nav-enemy-default-event-handler ) (defbehavior nav-enemy-execute-custom-jump nav-enemy ((arg0 int) (arg1 float) (arg2 float)) - (when (logtest? (-> self nav-enemy-flags) 512) + (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) (let ((a0-1 (-> self skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 30) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((s3-0 (-> self skel root-channel 0))) (set! (-> s3-0 frame-group) (the-as art-joint-anim (-> self draw art-group data arg0))) (set! (-> s3-0 param 0) (ja-aframe arg1 0)) @@ -1702,9 +1702,9 @@ nav-enemy-default-event-handler ) (set! (-> self collide-info status) (logand -8 (-> self collide-info status))) (set! (-> self jump-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (cond - ((logtest? (-> self nav-enemy-flags) 1024) + ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) (cond ((= (if (> (-> self skel active-channels) 0) (-> self skel root-channel 0 frame-group) @@ -1756,7 +1756,7 @@ nav-enemy-default-event-handler ) (set! (-> self collide-info trans quad) (-> self jump-dest quad)) (set! (-> self collide-info transv y) 0.0) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) 0 (none) ) @@ -1825,7 +1825,7 @@ nav-enemy-default-event-handler ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) :code @@ -1862,7 +1862,9 @@ nav-enemy-default-event-handler (set! (-> self collide-info transv x) (-> v1-9 x)) (set! (-> self collide-info transv z) (-> v1-9 z)) ) - (if (or (logtest? (-> self nav-enemy-flags) 128) (logtest? (nav-control-flags bit19) (-> self nav flags))) + (if (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf7)) + (logtest? (nav-control-flags navcf19) (-> self nav flags)) + ) (seek-to-point-toward-point! (-> self collide-info) (-> self nav target-pos) @@ -1883,7 +1885,7 @@ nav-enemy-default-event-handler (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) - (the-as collide-kind (-> self nav-info gnd-collide-with)) + (-> self nav-info gnd-collide-with) 8192.0 #f (-> self nav-info hover-if-no-ground) @@ -1903,7 +1905,7 @@ nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self collide-info transv quad)) (set! (-> gp-0 y) 0.0) @@ -1917,7 +1919,7 @@ nav-enemy-default-event-handler :trans (behavior () (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (logtest? (nav-control-flags bit19) (-> self nav flags)) + (logtest? (nav-control-flags navcf19) (-> self nav flags)) ) (go-virtual nav-enemy-chase) ) @@ -2007,7 +2009,7 @@ nav-enemy-default-event-handler :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 2048) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (ja-channel-push! 1 30) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) (let ((v1-6 (-> self skel root-channel 0))) @@ -2019,7 +2021,7 @@ nav-enemy-default-event-handler (set! (-> v1-9 num-func) num-func-identity) (set! (-> v1-9 frame-num) 0.0) ) - (while (logtest? (-> self nav-enemy-flags) 2048) + (while (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (suspend) (let ((a0-8 (-> self skel root-channel 0))) (set! (-> a0-8 param 0) f30-0) @@ -2053,7 +2055,7 @@ nav-enemy-default-event-handler nav-enemy-jump-event-handler :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) :trans @@ -2066,15 +2068,15 @@ nav-enemy-default-event-handler (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-initialize-jump (-> self event-param-point)) (nav-enemy-neck-control-look-at) - (logior! (-> self nav-enemy-flags) 16) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335)) (ja-channel-push! 1 60) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-jump-land-anim) (go-virtual nav-enemy-wait-for-cue) (none) @@ -2117,7 +2119,7 @@ nav-enemy-default-event-handler ) (set! (-> obj align) (new 'process 'align-control obj)) (set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 16 (-> arg0 nav-nearest-y-threshold))) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav gap-event) 'jump) (TODO-RENAME-26 (-> obj nav)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) @@ -2127,7 +2129,7 @@ nav-enemy-default-event-handler ) (set! (-> obj reaction-time) (nav-enemy-rnd-int-range (seconds 0.1) (seconds 0.8))) (set! (-> obj speed-scale) 1.0) - (logior! (-> obj nav-enemy-flags) 4216) + (logior! (-> obj nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel navenmf5 navenmf6 navenmf12)) 0 (none) ) @@ -2165,8 +2167,8 @@ nav-enemy-default-event-handler (vector-identity! (-> self collide-info scale)) (set! (-> self entity) (-> arg0 entity)) (TODO-RENAME-48 self) - (set! (-> self nav-enemy-flags) (logand -4097 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 2) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf12)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-wait-for-cue) (none) ) diff --git a/goal_src/levels/common/sharkey.gc b/goal_src/levels/common/sharkey.gc index d167bedd1f..23d4302a30 100644 --- a/goal_src/levels/common/sharkey.gc +++ b/goal_src/levels/common/sharkey.gc @@ -229,7 +229,7 @@ nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self nav-enemy-flags) (logand -2 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (none) ) :exit @@ -251,8 +251,8 @@ nav-enemy-default-event-handler ) ) ((sharkey-notice-player?) - (when (zero? (logand (-> self nav-enemy-flags) 1)) - (logior! (-> self nav-enemy-flags) 1) + (when (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf0))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (set! (-> self notice-time) (-> *display* base-frame-counter)) ) (let ((a0-4 (dummy-16 (-> self nav) (-> *target* control trans)))) @@ -269,7 +269,7 @@ nav-enemy-default-event-handler ) (else (if (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (seconds 10)) - (set! (-> self nav-enemy-flags) (logand -2 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) ) ) @@ -810,7 +810,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/finalboss/green-eco-lurker.gc b/goal_src/levels/finalboss/green-eco-lurker.gc index 724a858abb..1eea85e807 100644 --- a/goal_src/levels/finalboss/green-eco-lurker.gc +++ b/goal_src/levels/finalboss/green-eco-lurker.gc @@ -101,7 +101,8 @@ :use-proximity-notice #f :use-jump-blocked #t :use-jump-patrol #f - :gnd-collide-with #x805 + :gnd-collide-with + (collide-kind background cak-2 ground-object) :debug-draw-neck #f :debug-draw-jump #f ) @@ -336,11 +337,12 @@ ) (defmethod dummy-44 green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) @@ -349,11 +351,12 @@ ) (defmethod nav-enemy-touch-handler green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) @@ -440,33 +443,34 @@ ) (defmethod dummy-53 green-eco-lurker ((obj green-eco-lurker)) - (the-as - symbol - (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) - (let ((f0-0 (-> obj appear-dest y)) - (v1-7 (-> obj draw shadow-ctrl)) - ) - (let ((a0-1 v1-7)) - (set! (-> a0-1 settings flags) (logand -33 (-> a0-1 settings flags))) - ) - 0 - (let ((a0-3 v1-7)) - (set! (-> a0-3 settings bot-plane w) (- (+ -6144.0 f0-0))) - ) - 0 - (set! (-> v1-7 settings top-plane w) (- (+ 6144.0 f0-0))) - ) - 0 - ) - (else - (let ((v1-9 (-> obj draw shadow-ctrl))) - (logior! (-> v1-9 settings flags) 32) + (the-as symbol (cond + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) + (let ((f0-0 (-> obj appear-dest y)) + (v1-7 (-> obj draw shadow-ctrl)) + ) + (let ((a0-1 v1-7)) + (set! (-> a0-1 settings flags) (logand -33 (-> a0-1 settings flags))) + ) + 0 + (let ((a0-3 v1-7)) + (set! (-> a0-3 settings bot-plane w) (- (+ -6144.0 f0-0))) + ) + 0 + (set! (-> v1-7 settings top-plane w) (- (+ 6144.0 f0-0))) + ) + 0 + ) + (else + (let ((v1-9 (-> obj draw shadow-ctrl))) + (logior! (-> v1-9 settings flags) 32) + ) + 0 + ) + ) ) - 0 - ) - ) - ) ) (defstate green-eco-lurker-appear (green-eco-lurker) @@ -480,7 +484,7 @@ (+ (-> (the-as green-eco-lurker-gen (-> self parent 0)) root trans x) (fmax -32768.0 (fmin 32768.0 f0-1))) ) ) - (logior! (-> self collide-info nav-flags) 2) + (logior! (-> self collide-info nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self appear-dest quad)) (set! (-> self nav extra-nav-sphere w) 8192.0) (setup-from-to-duration! (-> self traj) (-> self collide-info trans) (-> self appear-dest) 225.0 -9.102222) @@ -510,8 +514,8 @@ (let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self state-time))) (-> self traj time)))) (eval-position! (-> self traj) f30-0 (-> self collide-info trans)) (when (= f30-0 (-> self traj time)) - (logior! (-> self collide-info nav-flags) 1) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self collide-info nav-flags) (nav-flags navf0)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (go green-eco-lurker-appear-land) ) ) @@ -645,7 +649,7 @@ (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) ) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) (none) ) @@ -892,7 +896,7 @@ (defmethod TODO-RENAME-48 green-eco-lurker ((obj green-eco-lurker)) (initialize-skeleton obj *green-eco-lurker-sg* '()) (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj collide-info nav-flags) (logand -2 (-> obj collide-info nav-flags))) + (logclear! (-> obj collide-info nav-flags) (nav-flags navf0)) (TODO-RENAME-45 obj *green-eco-lurker-nav-enemy-info*) (logior! (-> obj draw shadow-ctrl settings flags) 4) (set! (-> obj neck up) (the-as uint 0)) diff --git a/goal_src/levels/finalboss/robotboss.gc b/goal_src/levels/finalboss/robotboss.gc index 000e15186e..74389005a9 100644 --- a/goal_src/levels/finalboss/robotboss.gc +++ b/goal_src/levels/finalboss/robotboss.gc @@ -4501,8 +4501,8 @@ (initialize-skeleton obj *robotboss-sg* '()) (aybabtu 2) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 (the-as float 40960.0))) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) - (set! (-> obj root-override nav-flags) (logand -2 (-> obj root-override nav-flags))) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) (set! (-> obj path) (new 'process 'path-control obj 'path (the-as float 0.0))) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (logclear! (-> obj mask) (process-mask actor-pause)) diff --git a/goal_src/levels/jungle/hopper.gc b/goal_src/levels/jungle/hopper.gc index a302e7cc14..6dac7904a6 100644 --- a/goal_src/levels/jungle/hopper.gc +++ b/goal_src/levels/jungle/hopper.gc @@ -27,7 +27,7 @@ :shadow 4 ) -(defstatehandler hopper :event nav-enemy-default-event-handler) +nav-enemy-default-event-handler (defmethod common-post hopper ((obj hopper)) (let ((v1-1 (-> obj draw shadow-ctrl))) @@ -46,9 +46,16 @@ ) (set! (-> s5-0 quad) (-> arg0 quad)) (set! (-> s5-0 y) (+ 20480.0 (-> s5-0 y))) - (let ((f0-2 - (fill-and-probe-using-y-probe *collide-cache* s5-0 f30-0 (collide-kind background) self t1-0 (the-as uint 1)) - ) + (let ((f0-2 (fill-and-probe-using-y-probe + *collide-cache* + s5-0 + f30-0 + (collide-kind background) + self + t1-0 + (new 'static 'pat-surface :noentity #x1) + ) + ) ) (if (< f0-2 0.0) (return (the-as object #f)) @@ -74,18 +81,18 @@ (-> self nav-info jump-height-factor) -409600.0 ) - (set! (-> self nav-enemy-flags) (logand -513 (-> self nav-enemy-flags))) - (set! (-> self nav-enemy-flags) (logand -1025 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 16) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335)) (ja-channel-push! 1 60) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) (set! (-> self shadow-min-y) (+ (-> self collide-info trans y) (-> self nav-info shadow-min-y))) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-jump-land-anim) 0 (none) @@ -163,7 +170,7 @@ ) :trans (behavior () - (if (zero? (logand (-> self nav-enemy-flags) 8)) + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) ) (none) @@ -172,7 +179,7 @@ (behavior () (vector-reset! (-> self collide-info transv)) (set! (-> self jump-length) 16384.0) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (while #t (cond ((= (if (> (-> self skel active-channels) 0) @@ -245,9 +252,9 @@ (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-loop!) ) ) - (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) + (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) (set! (-> self nav block-count) 0.0) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (nav-enemy-get-new-patrol-point) (set! (-> self nav target-pos quad) (-> self nav destination-pos quad)) ) @@ -282,7 +289,7 @@ ) :trans (behavior () - (if (zero? (logand (-> self nav-enemy-flags) 8)) + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) ) (none) @@ -291,7 +298,7 @@ (behavior () (vector-reset! (-> self collide-info transv)) (set! (-> self jump-length) 32768.0) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (while #t (cond ((= (if (> (-> self skel active-channels) 0) @@ -435,7 +442,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #t ) diff --git a/goal_src/levels/jungle/junglefish.gc b/goal_src/levels/jungle/junglefish.gc index c9e74046dc..eded00dc5c 100644 --- a/goal_src/levels/jungle/junglefish.gc +++ b/goal_src/levels/jungle/junglefish.gc @@ -377,7 +377,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/jungleb/aphid.gc b/goal_src/levels/jungleb/aphid.gc index 2b5ef5134f..ef18a7b415 100644 --- a/goal_src/levels/jungleb/aphid.gc +++ b/goal_src/levels/jungleb/aphid.gc @@ -27,20 +27,22 @@ ) (defbehavior aphid-invulnerable aphid () - (set! (-> self nav-enemy-flags) (logand -33 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (set-collide-offense (-> self collide-info) 2 (collide-offense indestructible)) (none) ) (defbehavior aphid-vulnerable aphid () - (logior! (-> self nav-enemy-flags) 32) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (set-collide-offense (-> self collide-info) 2 (collide-offense touch)) (none) ) (defmethod dummy-43 aphid ((obj aphid) (arg0 process) (arg1 event-message-block)) (cond - ((or (logtest? (-> obj nav-enemy-flags) 32) (= arg0 (ppointer->process (-> obj parent)))) + ((or (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) + (= arg0 (ppointer->process (-> obj parent))) + ) (send-event arg0 'get-attack-count 1) (logclear! (-> obj mask) (process-mask actor-pause attackable)) (go (method-of-object obj nav-enemy-die)) @@ -168,7 +170,7 @@ (behavior () (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) 256) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) ) (ja-channel-push! 1 30) @@ -192,7 +194,7 @@ ) (while #t (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((a0-7 (-> self skel root-channel 0))) (set! (-> a0-7 param 0) 1.0) (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-loop!) @@ -213,7 +215,7 @@ (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-loop!) ) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) (when (nav-enemy-rnd-percent? 0.3) (if (not (= (if (> (-> self skel active-channels) 0) @@ -282,7 +284,7 @@ ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-12 (-> self skel root-channel 0))) (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) @@ -360,7 +362,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -413,7 +415,7 @@ (vector-identity! (-> self collide-info scale)) (set! (-> self entity) (-> arg0 entity)) (TODO-RENAME-48 self) - (set! (-> self nav-enemy-flags) (logand -4097 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf12)) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) self) (set! (-> a1-3 num-params) 0) diff --git a/goal_src/levels/maincave/baby-spider.gc b/goal_src/levels/maincave/baby-spider.gc index 7c9088742e..b637de21db 100644 --- a/goal_src/levels/maincave/baby-spider.gc +++ b/goal_src/levels/maincave/baby-spider.gc @@ -115,7 +115,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -168,7 +168,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -599,7 +599,7 @@ baby-spider-default-event-handler (set! (-> self turn-time) (seconds 0.07333333)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) (while #t - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 30) (let ((a0-2 (-> self skel root-channel 0))) (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) @@ -622,7 +622,7 @@ baby-spider-default-event-handler (set! (-> a0-5 param 0) 1.0) (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600)) (s5-0 (-> *display* base-frame-counter)) ) @@ -678,7 +678,7 @@ baby-spider-default-event-handler (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-7 (-> self skel root-channel 0))) (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) @@ -904,7 +904,7 @@ baby-spider-default-event-handler (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) (logior! (-> obj mask) (process-mask actor-pause)) (set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 24 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (create-connection! diff --git a/goal_src/levels/maincave/mother-spider-egg.gc b/goal_src/levels/maincave/mother-spider-egg.gc index ee7e181d4f..852e958de1 100644 --- a/goal_src/levels/maincave/mother-spider-egg.gc +++ b/goal_src/levels/maincave/mother-spider-egg.gc @@ -173,7 +173,10 @@ (defmethod draw-egg-shadow mother-spider-egg ((obj mother-spider-egg) (arg0 vector) (arg1 symbol)) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((s5-0 (new 'stack-no-clear 'collide-tri-result)) (a1-1 (new 'stack-no-clear 'vector)) (a2-1 (new 'stack-no-clear 'vector)) @@ -581,8 +584,8 @@ (logior! (-> v1-8 settings flags) 32) ) 0 - (set! (-> self root-override nav-flags) (logand -2 (-> self root-override nav-flags))) - (set! (-> self root-override nav-flags) (logand -3 (-> self root-override nav-flags))) + (logclear! (-> self root-override nav-flags) (nav-flags navf0)) + (logclear! (-> self root-override nav-flags) (nav-flags navf1)) (clear-collide-with-as (-> self root-override)) (until (not (-> self child)) (suspend) @@ -625,9 +628,9 @@ (setup-lods! (-> self broken-look) *mother-spider-egg-broken-sg* (-> self draw art-group) (-> self entity)) (set! (-> self draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) (set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0)) - (logior! (-> self nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) - (set! (-> self root-override nav-flags) (logand -2 (-> self root-override nav-flags))) - (logior! (-> self root-override nav-flags) 2) + (logior! (-> self nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (logclear! (-> self root-override nav-flags) (nav-flags navf0)) + (logior! (-> self root-override nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self fall-dest quad)) (set! (-> self nav extra-nav-sphere w) 4096.0) (setup-from-to-height! (-> self traj) (-> self root-override trans) arg2 4096.0 -4.551111) diff --git a/goal_src/levels/maincave/mother-spider-proj.gc b/goal_src/levels/maincave/mother-spider-proj.gc index a618aec85a..18fd75116f 100644 --- a/goal_src/levels/maincave/mother-spider-proj.gc +++ b/goal_src/levels/maincave/mother-spider-proj.gc @@ -261,7 +261,7 @@ (the-as vector #f) f0-5 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) diff --git a/goal_src/levels/maincave/mother-spider.gc b/goal_src/levels/maincave/mother-spider.gc index 58e9f0e369..8038b6f4ad 100644 --- a/goal_src/levels/maincave/mother-spider.gc +++ b/goal_src/levels/maincave/mother-spider.gc @@ -2104,10 +2104,10 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *mother-spider-sg* '()) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav nearest-y-threshold) 409600.0) - (set! (-> obj root-override nav-flags) (logand -2 (-> obj root-override nav-flags))) - (set! (-> obj root-override nav-flags) (logand -3 (-> obj root-override nav-flags))) + (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) + (logclear! (-> obj root-override nav-flags) (nav-flags navf1)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (set! (-> obj fact) diff --git a/goal_src/levels/misty/babak-with-cannon.gc b/goal_src/levels/misty/babak-with-cannon.gc index 5d0ce12e70..bc99041b4a 100644 --- a/goal_src/levels/misty/babak-with-cannon.gc +++ b/goal_src/levels/misty/babak-with-cannon.gc @@ -139,7 +139,7 @@ nav-enemy-default-event-handler (if (nav-enemy-notice-player?) (go-virtual nav-enemy-chase) ) - (if (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (go babak-with-cannon-jump-onto-cannon) ) (none) @@ -230,7 +230,7 @@ nav-enemy-default-event-handler ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) :code @@ -238,7 +238,7 @@ nav-enemy-default-event-handler (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) - (set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (nav-enemy-neck-control-inactive) (let* ((v1-7 (-> self cannon-ent)) (gp-0 (if v1-7 @@ -264,9 +264,9 @@ nav-enemy-default-event-handler (ja-channel-push! 1 60) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) - (set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (let* ((v1-20 (-> self cannon-ent)) (gp-1 (if v1-20 (-> v1-20 extra process) @@ -320,7 +320,7 @@ nav-enemy-default-event-handler ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) :code @@ -328,7 +328,7 @@ nav-enemy-default-event-handler (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-initialize-jump (-> self entity extra trans)) (nav-enemy-neck-control-look-at) - (set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (let ((a0-2 (-> self skel root-channel 0))) (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) (set! (-> a0-2 param 0) 0.0) @@ -350,7 +350,7 @@ nav-enemy-default-event-handler (ja-channel-push! 1 60) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) (let ((a1-6 (dummy-16 (-> self nav) (-> self jump-dest)))) (set-current-poly! (-> self nav) a1-6) diff --git a/goal_src/levels/misty/bonelurker.gc b/goal_src/levels/misty/bonelurker.gc index a25911bd75..19be4cc918 100644 --- a/goal_src/levels/misty/bonelurker.gc +++ b/goal_src/levels/misty/bonelurker.gc @@ -44,20 +44,19 @@ ) (defmethod dummy-44 bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) - (the-as - object - (when (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) - ) - (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (set! (-> obj speed-scale) 0.5) - #t - ) - ) - ) + (the-as object (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) + ) + (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) + (set! (-> obj speed-scale) 0.5) + #t + ) + ) + ) ) (defmethod dummy-43 bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) @@ -124,7 +123,7 @@ (send-event-function arg0 a1-6) ) (set! (-> obj bump-player-time) (-> *display* base-frame-counter)) - (set! (-> obj nav-enemy-flags) (logand -65 (-> obj nav-enemy-flags))) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) 'push ) ) @@ -237,10 +236,10 @@ nav-enemy-default-event-handler :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) - (if (and (zero? (logand (-> self nav-enemy-flags) 64)) + (if (and (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf6))) (>= (- (-> *display* base-frame-counter) (-> self bump-player-time)) (seconds 0.5)) ) - (logior! (-> self nav-enemy-flags) 64) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) ) (none) ) @@ -344,7 +343,7 @@ nav-enemy-default-event-handler (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) ) ) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory) ) (let ((a0-25 (-> self skel root-channel 0))) @@ -364,7 +363,7 @@ nav-enemy-default-event-handler (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-seek!) ) ) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory) ) (let ((a0-28 (-> self skel root-channel 0))) @@ -435,7 +434,7 @@ nav-enemy-default-event-handler ) (while #t (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 60) (let ((v1-20 (-> self skel root-channel 0))) (set! (-> v1-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) @@ -452,7 +451,7 @@ nav-enemy-default-event-handler (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-loop!) ) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) (ja-channel-push! 1 75) (let ((a0-18 (-> self skel root-channel 0))) @@ -573,7 +572,7 @@ nav-enemy-default-event-handler ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-18 (-> self skel root-channel 0))) (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) @@ -707,7 +706,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #t :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/misty/mistycannon.gc b/goal_src/levels/misty/mistycannon.gc index 42506eb54a..fb937322cd 100644 --- a/goal_src/levels/misty/mistycannon.gc +++ b/goal_src/levels/misty/mistycannon.gc @@ -860,7 +860,7 @@ (-> self root-override shadow-pos) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) diff --git a/goal_src/levels/misty/muse.gc b/goal_src/levels/misty/muse.gc index 3690ab649b..6f1e4cacdf 100644 --- a/goal_src/levels/misty/muse.gc +++ b/goal_src/levels/misty/muse.gc @@ -368,8 +368,8 @@ nav-enemy-default-event-handler (-> self nav destination-pos) 546133.3 ) - (if (logtest? (nav-control-flags bit21) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit10)) + (if (logtest? (nav-control-flags navcf21) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (nav-enemy-travel-post) (none) @@ -386,7 +386,7 @@ nav-enemy-default-event-handler :enter (behavior () ((-> (method-of-type nav-enemy nav-enemy-jump) enter)) - (set! (-> self nav-enemy-flags) (logand -513 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) (none) ) :code @@ -596,7 +596,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/misty/quicksandlurker.gc b/goal_src/levels/misty/quicksandlurker.gc index 7761c5d6d5..33d8267a52 100644 --- a/goal_src/levels/misty/quicksandlurker.gc +++ b/goal_src/levels/misty/quicksandlurker.gc @@ -380,7 +380,7 @@ (the-as vector #f) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -1173,7 +1173,7 @@ (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (rand-vu-float-range 0.0 65536.0)) (initialize-skeleton obj *quicksandlurker-sg* '()) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj fact) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) diff --git a/goal_src/levels/ogre/ogreboss.gc b/goal_src/levels/ogre/ogreboss.gc index 3ff880704a..5db216bdd4 100644 --- a/goal_src/levels/ogre/ogreboss.gc +++ b/goal_src/levels/ogre/ogreboss.gc @@ -407,7 +407,7 @@ (-> self pickup-type) (-> *FACT-bank* eco-single-inc) #t - (the-as process-drawable *entity-pool*) + *entity-pool* t1-0 ) ) @@ -1135,7 +1135,7 @@ (the-as vector #f) (the-as float 49152.0) (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) (-> (new 'static 'array float 1 0.0) 0) (the-as float 409600.0) ) diff --git a/goal_src/levels/racer_common/racer-states.gc b/goal_src/levels/racer_common/racer-states.gc index 45ba20095a..ef3028d6d8 100644 --- a/goal_src/levels/racer_common/racer-states.gc +++ b/goal_src/levels/racer_common/racer-states.gc @@ -1070,7 +1070,7 @@ (send-event (ppointer->process (-> self manipy)) 'draw #t) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'clone-anim) (target-timed-invulnerable-off self) - (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) (restore-collide-with-as (-> self control)) ((-> target-racing-start exit)) (target-exit) diff --git a/goal_src/levels/robocave/cave-trap.gc b/goal_src/levels/robocave/cave-trap.gc index ea0bf03bc6..a585e1cc39 100644 --- a/goal_src/levels/robocave/cave-trap.gc +++ b/goal_src/levels/robocave/cave-trap.gc @@ -356,9 +356,9 @@ ) (process-drawable-from-entity! obj arg0) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav nearest-y-threshold) 409600.0) - (set! (-> obj root-override nav-flags) (logand -2 (-> obj root-override nav-flags))) + (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s4-1 (entity-actor-count arg0 'alt-actor))) diff --git a/goal_src/levels/rolling/rolling-lightning-mole.gc b/goal_src/levels/rolling/rolling-lightning-mole.gc index 9f2b78e7ea..dfeb95cb87 100644 --- a/goal_src/levels/rolling/rolling-lightning-mole.gc +++ b/goal_src/levels/rolling/rolling-lightning-mole.gc @@ -456,13 +456,13 @@ :virtual #t :enter (behavior () - (logior! (-> self nav flags) (nav-control-flags bit12)) + (logior! (-> self nav flags) (nav-control-flags navcf12)) ((-> (method-of-type nav-enemy nav-enemy-chase) enter)) (none) ) :exit (behavior () - (logclear! (-> self nav flags) (nav-control-flags bit12)) + (logclear! (-> self nav flags) (nav-control-flags navcf12)) (none) ) :trans @@ -1063,7 +1063,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -1091,7 +1091,7 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *lightning-mole-sg* '()) (TODO-RENAME-45 obj *lightning-mole-nav-enemy-info*) - (logclear! (-> obj nav flags) (nav-control-flags bit5 bit6 bit7)) + (logclear! (-> obj nav flags) (nav-control-flags navcf5 navcf6 navcf7)) (set! (-> obj draw origin-joint-index) (the-as uint 3)) (set! (-> obj reaction-time) (seconds 0.05)) (set! (-> obj last-reflection-time) 0) diff --git a/goal_src/levels/snow/ice-cube.gc b/goal_src/levels/snow/ice-cube.gc index 323db37e3c..795f6e9148 100644 --- a/goal_src/levels/snow/ice-cube.gc +++ b/goal_src/levels/snow/ice-cube.gc @@ -114,7 +114,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -427,7 +427,7 @@ (= (-> arg0 type) target) ) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) 256) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (level-hint-spawn (game-text-id ice-cube-hint) "sksp0350" (the-as entity #f) *entity-pool* (game-task none)) ) ) @@ -462,7 +462,7 @@ ) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) ;; NOTE fixed decompiler bug - (set! (-> self nav-enemy-flags) (logior (-> self nav-enemy-flags) 256)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) ) ) ((= v1-0 'touched) @@ -689,7 +689,7 @@ (collide-kind background) (-> obj collide-info process) s4-0 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -973,7 +973,7 @@ :code (behavior () (dummy-57 self) - (set! (-> self nav-enemy-flags) (logand -3 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (logclear! (-> self mask) (process-mask actor-pause)) (go ice-cube-face-player) (none) @@ -988,7 +988,7 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-57 self) (logclear! (-> self mask) (process-mask actor-pause)) (if (or (not *target*) @@ -1163,7 +1163,7 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-58 self) (if (or (not *target*) (logtest? (-> *target* state-flags) #x80f8) @@ -1276,7 +1276,7 @@ (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (dummy-58 self) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (set! (-> self next-skid-sound-time) (-> *display* base-frame-counter)) (if (or (not *target*) (logtest? (-> *target* state-flags) #x80f8) @@ -1288,7 +1288,7 @@ (set! (-> self acceleration) (-> self nav-info run-acceleration)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) - (logclear! (-> self nav flags) (nav-control-flags bit8)) + (logclear! (-> self nav flags) (nav-control-flags navcf8)) (set-root-prim-collide-with! (-> self collide-info) (collide-kind cak-2 cak-3 target crate enemy)) (set! (-> self track-target?) #t) (set! (-> self slow-down?) #f) @@ -1302,7 +1302,7 @@ ) :exit (behavior () - (logior! (-> self nav flags) (nav-control-flags bit8)) + (logior! (-> self nav flags) (nav-control-flags navcf8)) (set-root-prim-collide-with! (-> self collide-info) (collide-kind target)) (none) ) diff --git a/goal_src/levels/snow/snow-bunny.gc b/goal_src/levels/snow/snow-bunny.gc index f97259b980..b0f6ec0bce 100644 --- a/goal_src/levels/snow/snow-bunny.gc +++ b/goal_src/levels/snow/snow-bunny.gc @@ -100,7 +100,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -122,7 +122,7 @@ (when (send-event-function arg0 a1-5) (set! (-> self touch-time) (-> *display* base-frame-counter)) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) 256) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual snow-bunny-attack) ) ) @@ -254,8 +254,8 @@ (defbehavior snow-bunny-initialize-jump snow-bunny ((arg0 vector)) (nav-enemy-initialize-custom-jump arg0 #f (-> self jump-height-min) (-> self jump-height-factor) -307200.0) - (set! (-> self nav-enemy-flags) (logand -1025 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 512) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) 0 (none) ) @@ -431,9 +431,9 @@ (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (dummy-76 self #f) - (set! (-> self nav flags) (logior (nav-control-flags bit19) (-> self nav flags))) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 8) + (set! (-> self nav flags) (logior (nav-control-flags navcf19) (-> self nav flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (set! (-> self state-timeout) (seconds 0.1)) (none) ) @@ -533,7 +533,7 @@ (collide-kind background) (-> obj collide-info process) s4-0 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -664,8 +664,8 @@ ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (none) ) :trans @@ -697,12 +697,12 @@ snow-bunny-default-event-handler :enter (behavior () - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-look-at) - (if (logtest? (-> self nav-enemy-flags) 2) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (dummy-76 self #t) (set-vector! (-> self collide-info transv) 0.0 (nav-enemy-rnd-float-range 102400.0 131072.0) 0.0 1.0) (none) @@ -898,7 +898,7 @@ (go-virtual snow-bunny-defend) ) (when (not (dummy-52 self)) - (set! (-> self nav-enemy-flags) (logand -3 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-notice) ) (set-jump-height-factor! self 1) @@ -910,8 +910,8 @@ ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (none) ) :trans @@ -1193,8 +1193,8 @@ ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (none) ) :trans diff --git a/goal_src/levels/snow/snow-ram-boss.gc b/goal_src/levels/snow/snow-ram-boss.gc index 156127b702..4be24ad6e0 100644 --- a/goal_src/levels/snow/snow-ram-boss.gc +++ b/goal_src/levels/snow/snow-ram-boss.gc @@ -127,7 +127,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -180,7 +180,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -490,7 +490,7 @@ (the-as vector #f) f0-9 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -926,7 +926,7 @@ v0-4 ) ((begin - (if (zero? (logand (-> self nav-enemy-flags) 256)) + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> self collide-info)) ) (level-hint-spawn @@ -983,7 +983,7 @@ ) ) (('touch) - (if (zero? (logand (-> self nav-enemy-flags) 256)) + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> self collide-info)) ) (cond @@ -1233,7 +1233,7 @@ ) (else (ja-post) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go ram-boss-idle) ) ) @@ -1375,7 +1375,7 @@ ) :code (behavior () - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (while #t (clone-anim-once (ppointer->handle (-> self parent-override)) @@ -1415,7 +1415,7 @@ :enter (behavior ((arg0 basic)) (dummy-52 self) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (-> self node-list data 0 bone transform)) ) @@ -1497,7 +1497,7 @@ (-> ram-boss-jump-down event) :code (behavior () - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (activate! *camera-smush-control* 409.6 37 150 1.0 0.99) (let ((a0-1 (-> self skel root-channel 0))) (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) @@ -1516,7 +1516,7 @@ (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) ) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go ram-boss-nav-start) (none) ) @@ -1527,7 +1527,7 @@ (defstate ram-boss-already-down (ram-boss) :code (behavior ((arg0 basic)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-52 self) (let ((a1-0 (new 'stack-no-clear 'vector)) (a2-0 (-> self parent-override 0 node-list data 0 bone transform)) @@ -1646,7 +1646,7 @@ ) ) (cond - ((logtest? (nav-control-flags bit17) (-> self nav flags)) + ((logtest? (nav-control-flags navcf17) (-> self nav flags)) (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1)) (go-virtual nav-enemy-patrol) ) @@ -1705,7 +1705,7 @@ (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self facing-y) (quaternion-y-angle (-> self collide-info quat))) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) :trans @@ -1908,7 +1908,7 @@ :enter (behavior () (set! (-> self frustration) 0) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) :trans @@ -1948,7 +1948,7 @@ :enter (behavior () (set! (-> self frustration) 0) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) :trans @@ -2059,7 +2059,7 @@ ram-boss-on-ground-event-handler :enter (behavior () - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (let ((gp-0 (-> self child))) (while gp-0 (send-event (ppointer->process gp-0) 'launch) @@ -2128,7 +2128,7 @@ (defstate ram-boss-lose-shield (ram-boss) :enter (behavior () - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-inactive) (dummy-53 self) (TODO-RENAME-49 self *ram-boss-nav-enemy-info-no-shield*) diff --git a/goal_src/levels/snow/yeti.gc b/goal_src/levels/snow/yeti.gc index 83d317ce1a..d50f50435c 100644 --- a/goal_src/levels/snow/yeti.gc +++ b/goal_src/levels/snow/yeti.gc @@ -107,7 +107,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -229,7 +229,7 @@ (if (-> self nav-info move-to-ground) (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) ) - (set! (-> self nav-enemy-flags) (logand -7 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1 navenmf2)) (set! (-> self state-timeout) (seconds 1)) (set! (-> self ground-y) (-> self collide-info trans y)) (spawn (-> self part) (-> self collide-info trans)) @@ -388,7 +388,7 @@ (joint-control-channel-group! a0-14 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 180) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((gp-1 (nav-enemy-rnd-int-range 2 6))) (dotimes (s5-0 gp-1) (let ((a0-18 (-> self skel root-channel 0))) @@ -411,7 +411,7 @@ ) ) ) - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((a0-21 (-> self skel root-channel 0))) (set! (-> a0-21 param 0) 1.0) (joint-control-channel-group! a0-21 (the-as art-joint-anim #f) num-func-loop!) @@ -514,7 +514,7 @@ (behavior () (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) 256) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) ) (ja-channel-push! 1 30) @@ -536,7 +536,7 @@ ) (while #t (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((a0-9 (-> self skel root-channel 0))) (set! (-> a0-9 param 0) 1.0) (joint-control-channel-group! a0-9 (the-as art-joint-anim #f) num-func-loop!) @@ -557,7 +557,7 @@ (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-loop!) ) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) (if (not (= (if (> (-> self skel active-channels) 0) (-> self skel root-channel 0 frame-group) @@ -642,7 +642,7 @@ ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-12 (-> self skel root-channel 0))) (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) diff --git a/goal_src/levels/sunken/bully.gc b/goal_src/levels/sunken/bully.gc index 510e836a8e..868874cfd4 100644 --- a/goal_src/levels/sunken/bully.gc +++ b/goal_src/levels/sunken/bully.gc @@ -1056,7 +1056,7 @@ (initialize-skeleton obj *bully-sg* '()) (set! (-> obj draw shadow-ctrl) *bully-shadow-control*) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 454) obj)) (set! (-> obj fact-override) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) diff --git a/goal_src/levels/sunken/double-lurker.gc b/goal_src/levels/sunken/double-lurker.gc index 23d4c3c5f5..c2149d8968 100644 --- a/goal_src/levels/sunken/double-lurker.gc +++ b/goal_src/levels/sunken/double-lurker.gc @@ -119,7 +119,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -173,7 +173,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -227,7 +227,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -330,8 +330,8 @@ (set! (-> v1-3 settings flags) (logand -33 (-> v1-3 settings flags))) ) 0 - (set! (-> self collide-info nav-flags) (logand -2 (-> self collide-info nav-flags))) - (logior! (-> self collide-info nav-flags) 2) + (logclear! (-> self collide-info nav-flags) (nav-flags navf0)) + (logior! (-> self collide-info nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self fall-dest quad)) (set! (-> self nav extra-nav-sphere w) 9011.2) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -361,8 +361,8 @@ ) ) ) - (logior! (-> self collide-info nav-flags) 1) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self collide-info nav-flags) (nav-flags navf0)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (TODO-RENAME-27 (-> self nav)) (go double-lurker-top-resume) (none) @@ -440,7 +440,7 @@ (defmethod dummy-51 double-lurker-top ((obj double-lurker-top)) (restore-collide-with-as (-> obj collide-info)) - (logior! (-> obj collide-info nav-flags) 1) + (logior! (-> obj collide-info nav-flags) (nav-flags navf0)) (TODO-RENAME-27 (-> obj nav)) (none) ) @@ -524,7 +524,7 @@ (set-vector! (-> obj collide-info scale) 1.0 1.0 1.0 1.0) (quaternion-copy! (-> obj collide-info quat) (-> v1-5 0 collide-info quat)) ) - (set! (-> obj collide-info nav-flags) (logand -2 (-> obj collide-info nav-flags))) + (logclear! (-> obj collide-info nav-flags) (nav-flags navf0)) (none) ) diff --git a/goal_src/levels/sunken/orbit-plat.gc b/goal_src/levels/sunken/orbit-plat.gc index 567432d3d2..39625b0548 100644 --- a/goal_src/levels/sunken/orbit-plat.gc +++ b/goal_src/levels/sunken/orbit-plat.gc @@ -553,7 +553,7 @@ (defun get-nav-point! ((arg0 vector) (arg1 orbit-plat) (arg2 vector) (arg3 float)) (set! (-> arg1 nav target-pos quad) (-> arg2 quad)) - (logclear! (-> arg1 nav flags) (nav-control-flags bit19)) + (logclear! (-> arg1 nav flags) (nav-control-flags navcf19)) (dummy-11 (-> arg1 nav) (-> arg1 nav target-pos)) (let ((f0-0 (vector-length (-> arg1 nav travel)))) (if (< arg3 f0-0) @@ -717,7 +717,7 @@ ) ) (when (>= 614.4 (vector-vector-xz-distance (-> obj basetrans) (-> obj reset-trans))) - (set! v0-11 (logior (nav-control-flags bit19) (-> obj nav flags))) + (set! v0-11 (logior (nav-control-flags navcf19) (-> obj nav flags))) (set! (-> obj nav flags) (the-as nav-control-flags v0-11)) v0-11 ) @@ -744,7 +744,7 @@ (vector-normalize! s5-2 (-> obj reset-length)) (vector+! s5-2 s5-2 s4-1) (when (not (dummy-16 (-> obj nav) s5-2)) - (logclear! (-> obj nav flags) (nav-control-flags bit19)) + (logclear! (-> obj nav flags) (nav-control-flags navcf19)) (get-rotate-point! s5-2 s4-1 (-> obj basetrans) (the-as vector (-> obj reset-length)) 0.0 40960.0) (when (not (dummy-16 (-> obj nav) s5-2)) (get-rotate-point! @@ -812,13 +812,13 @@ :code (behavior () (set! (-> self plat-status) (the-as uint 3)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (let ((a0-3 (-> self skel root-channel 0))) (set! (-> a0-3 param 0) 0.0) (set! (-> a0-3 param 1) 1.0) (joint-control-channel-group! a0-3 (the-as art-joint-anim #f) num-func-seek!) ) - (while (zero? (logand (nav-control-flags bit19) (-> self nav flags))) + (while (zero? (logand (nav-control-flags navcf19) (-> self nav flags))) (dummy-27 self) (when (nonzero? (-> self root-override riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -927,7 +927,7 @@ (update-transforms! (-> obj root-override)) (dummy-21 obj) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav gap-event) 'blocked) (set! (-> obj other) (entity-actor-lookup arg0 'alt-actor 0)) (let ((f0-7 (res-lump-float arg0 'scale :default 1.0))) diff --git a/goal_src/levels/sunken/puffer.gc b/goal_src/levels/sunken/puffer.gc index b743df03a4..5f35c0f04d 100644 --- a/goal_src/levels/sunken/puffer.gc +++ b/goal_src/levels/sunken/puffer.gc @@ -155,7 +155,10 @@ (defmethod dummy-28 puffer ((obj puffer)) (cond - ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status was-drawn))) + ((and (-> obj draw shadow) + (zero? (-> obj draw cur-lod)) + (logtest? (-> obj draw status) (draw-status was-drawn)) + ) (let ((s5-0 (new 'stack-no-clear 'collide-tri-result)) (a1-0 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) @@ -1204,7 +1207,7 @@ (set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default 57344.0)) (set! (-> obj give-up-dist) (+ 20480.0 (-> obj notice-dist))) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (TODO-RENAME-26 (-> obj nav)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) diff --git a/goal_src/levels/swamp/billy.gc b/goal_src/levels/swamp/billy.gc index 6fce71ad4c..b374b4cdc3 100644 --- a/goal_src/levels/swamp/billy.gc +++ b/goal_src/levels/swamp/billy.gc @@ -281,7 +281,7 @@ ) ) (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (go-virtual nav-enemy-chase) (none) ) @@ -350,8 +350,8 @@ (t9-1) ) ) - (when (logtest? (nav-control-flags bit19) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (when (logtest? (nav-control-flags navcf19) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (if (rat-about-to-eat? self (-> self billy 0)) (go billy-rat-salivate) (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) @@ -375,7 +375,7 @@ :trans (behavior () (set! (-> self speed-scale) (-> self billy 0 rat-speed)) - (if (or (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self chase-rest-time)) ) (go-virtual nav-enemy-victory) diff --git a/goal_src/levels/swamp/kermit.gc b/goal_src/levels/swamp/kermit.gc index bcd064e98e..95f9eec7a4 100644 --- a/goal_src/levels/swamp/kermit.gc +++ b/goal_src/levels/swamp/kermit.gc @@ -604,7 +604,7 @@ (the-as vector #f) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -923,7 +923,7 @@ (defbehavior kermit-set-rotate-dir-to-nav-target kermit () (cond - ((logtest? (nav-control-flags bit19) (-> self nav flags)) + ((logtest? (nav-control-flags navcf19) (-> self nav flags)) (vector-! (-> self rotate-dir) (-> self nav target-pos) (-> self collide-info trans)) ) (else @@ -1076,7 +1076,7 @@ nav-enemy-default-event-handler (if (and (not (-> self airborne)) (nav-enemy-test-point-in-nav-mesh? (target-pos 0))) (go kermit-notice) ) - (if (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (kermit-get-new-patrol-point) ) (none) @@ -1193,7 +1193,7 @@ nav-enemy-default-event-handler (behavior () (when (not (-> self airborne)) (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - (and (logtest? (nav-control-flags bit19) (-> self nav flags)) + (and (logtest? (nav-control-flags navcf19) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) ) ) @@ -1627,7 +1627,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/swamp/swamp-rat-nest.gc b/goal_src/levels/swamp/swamp-rat-nest.gc index 8d5a065e51..1e9afbc147 100644 --- a/goal_src/levels/swamp/swamp-rat-nest.gc +++ b/goal_src/levels/swamp/swamp-rat-nest.gc @@ -910,7 +910,7 @@ (set! (-> self entity) gp-0) ) (set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0)) - (logior! (-> self nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> self nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set-current-poly! (-> self nav) (find-poly (-> self nav) (-> self root-override trans))) (+! (-> self parent-process 0 hit-points) 3) (dummy-21 self) diff --git a/goal_src/levels/swamp/swamp-rat.gc b/goal_src/levels/swamp/swamp-rat.gc index c691e60c73..c1399cb8f7 100644 --- a/goal_src/levels/swamp/swamp-rat.gc +++ b/goal_src/levels/swamp/swamp-rat.gc @@ -298,7 +298,7 @@ swamp-rat-default-event-handler (set! (-> self turn-time) (seconds 0.07333333)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) (while #t - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 30) (let ((a0-2 (-> self skel root-channel 0))) (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) @@ -321,7 +321,7 @@ swamp-rat-default-event-handler (set! (-> a0-5 param 0) 1.0) (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600)) (s5-0 (-> *display* base-frame-counter)) ) @@ -365,7 +365,7 @@ swamp-rat-default-event-handler (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-7 (-> self skel root-channel 0))) (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) @@ -561,7 +561,7 @@ swamp-rat-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/village1/village-obs.gc b/goal_src/levels/village1/village-obs.gc index 0a8cc9269b..2d76bb4453 100644 --- a/goal_src/levels/village1/village-obs.gc +++ b/goal_src/levels/village1/village-obs.gc @@ -739,7 +739,7 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self nav flags) (logior (nav-control-flags bit19) (-> self nav flags))) + (set! (-> self nav flags) (logior (nav-control-flags navcf19) (-> self nav flags))) (none) ) :trans @@ -829,7 +829,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/goal_src/levels/village1/yakow.gc b/goal_src/levels/village1/yakow.gc index 42e0d52c0c..092bdc1aca 100644 --- a/goal_src/levels/village1/yakow.gc +++ b/goal_src/levels/village1/yakow.gc @@ -618,7 +618,7 @@ yakow-default-event-handler :enter (behavior ((arg0 vector)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self nav destination-pos quad) (-> arg0 quad)) (set! (-> self rotate-speed) (-> *YAKOW-bank* walk-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* walk-turn-time)) @@ -637,7 +637,7 @@ yakow-default-event-handler (go yakow-notice) ) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) - (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) + (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< (vector-vector-xz-distance (-> self root-override trans) (-> self nav destination-pos)) 4096.0) ) (if (-> self in-pen) @@ -665,8 +665,8 @@ yakow-default-event-handler (-> self nav destination-pos) 131072.0 ) - (if (logtest? (nav-control-flags bit21) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit10)) + (if (logtest? (nav-control-flags navcf21) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (yakow-post) (none) @@ -796,7 +796,7 @@ yakow-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self rotate-speed) (-> *YAKOW-bank* run-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* run-turn-time)) (none) @@ -983,7 +983,7 @@ yakow-default-event-handler (process-drawable-from-entity! obj arg0) (set! (-> obj align) (new 'process 'align-control obj)) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav nearest-y-threshold) 409600.0) (set! (-> obj fact-override) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) diff --git a/goal_src/pc/engine/ui/progress-h.gc b/goal_src/pc/engine/ui/progress-h.gc deleted file mode 100644 index dd63829d43..0000000000 --- a/goal_src/pc/engine/ui/progress-h.gc +++ /dev/null @@ -1,271 +0,0 @@ -;;-*-Lisp-*- -(in-package goal) - -;; name: progress-h.gc -;; name in dgo: progress-h -;; dgos: GAME, ENGINE - - -(defenum progress-screen - :type int64 - (invalid -1) - (fuel-cell 0) - (money 1) - (buzzer 2) - (settings 3) - (game-settings 4) - (graphic-settings 5) - (sound-settings 6) - (memcard-no-space 7) - (memcard-not-inserted 8) - (memcard-not-formatted 9) - (memcard-format 10) - (memcard-data-exists 11) - (memcard-loading 12) - (memcard-saving 13) - (memcard-formatting 14) - (memcard-creating 15) - (load-game 16) - (save-game 17) - (save-game-title 18) - (memcard-insert 19) - (memcard-error-loading 20) - (memcard-error-saving 21) - (memcard-removed 22) - (memcard-no-data 23) - (memcard-error-formatting 24) - (memcard-error-creating 25) - (memcard-auto-save-error 26) - (title 27) - (settings-title 28) - (auto-save 29) - (pal-change-to-60hz 30) - (pal-now-60hz 31) - (no-disc 32) - (bad-disc 33) - (quit 34) - ;; custom - (language-options 35) - ) - -(defun-extern activate-progress process progress-screen none) -(defun-extern hide-progress-screen none) -(defun-extern hide-progress-icons none) - -(declare-type level-tasks-info basic) - -(define-extern *level-task-data* (array level-tasks-info)) -(define-extern *level-task-data-remap* (array int32)) - -(declare-type count-info structure) - -(defun-extern get-game-count int count-info) -(defun-extern progress-allowed? symbol) -(defun-extern pause-allowed? symbol) - -(declare-type progress process) - -(defun-extern deactivate-progress none) -(defun-extern calculate-completion progress float) -(defun-extern make-current-level-available-to-progress none) - -;; DECOMP BEGINS - -(deftype count-info (structure) - ((money-count int32 :offset-assert 0) - (buzzer-count int32 :offset-assert 4) - ) - :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 - ) - - -(deftype game-count-info (basic) - ((length int32 :offset-assert 4) - (data count-info :inline :dynamic :offset-assert 8) - ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 - ) - - -(deftype task-info-data (basic) - ((task-id game-task :offset-assert 4) - (task-name game-text-id 4 :offset-assert 8) - (text-index-when-resolved int32 :offset-assert 24) - ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c - ) - - -(deftype level-tasks-info (basic) - ((level-name-id game-text-id :offset-assert 4) - (text-group-index int32 :offset-assert 8) - (nb-of-tasks int32 :offset-assert 12) - (buzzer-task-index int32 :offset-assert 16) - (task-info task-info-data 8 :offset-assert 20) - ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 - ) - - -(deftype game-option (basic) - ((option-type uint64 :offset-assert 8) - (name game-text-id :offset-assert 16) - (scale basic :offset-assert 20) - (param1 float :offset-assert 24) - (param2 float :offset-assert 28) - (param3 int32 :offset-assert 32) - (value-to-modify pointer :offset-assert 36) - ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 - ) - -;; new custom type to extend the very limited progress-menu system -;; the user can only interact with one element at a time, so a single global is sufficient -(deftype progress-menu-list-tracker (basic) - ((direction symbol :offset-assert 4) ; 'left | 'right - (transition? symbol :offset-assert 8) ; '?? - (x-offset int32 :offset-assert 12) - (selected-index int32 :offset-assert 16))) - -;; why a new global? because i dont want to modify the type below....but that would get me what i want as well! -(define *progress-menu-list-tracker* (new 'static 'progress-menu-list-tracker)) - -(deftype progress (process) - ((current-debug-string int32 :offset-assert 112) - (current-debug-language int32 :offset-assert 116) - (current-debug-group int32 :offset-assert 120) - (in-out-position int32 :offset-assert 124) - (display-state progress-screen :offset-assert 128) - (next-display-state progress-screen :offset-assert 136) - (option-index int32 :offset-assert 144) - (selected-option basic :offset-assert 148) - (completion-percentage float :offset-assert 152) - (ready-to-run basic :offset-assert 156) - (display-level-index int32 :offset-assert 160) - (next-level-index int32 :offset-assert 164) - (task-index int32 :offset-assert 168) - (in-transition basic :offset-assert 172) - (last-in-transition basic :offset-assert 176) - (force-transition basic :offset-assert 180) - (stat-transition basic :offset-assert 184) - (level-transition int32 :offset-assert 188) - (language-selection uint64 :offset-assert 192) - ; true = left | false = right - (language-direction symbol :offset-assert 200) - (language-transition symbol :offset-assert 204) - (language-x-offset int32 :offset-assert 208) - (sides-x-scale float :offset-assert 212) - (sides-y-scale float :offset-assert 216) - (left-x-offset int32 :offset-assert 220) - (right-x-offset int32 :offset-assert 224) - (button-scale float :offset-assert 228) - (slot-scale float :offset-assert 232) - (left-side-x-scale float :offset-assert 236) - (left-side-y-scale float :offset-assert 240) - (right-side-x-scale float :offset-assert 244) - (right-side-y-scale float :offset-assert 248) - (small-orb-y-offset int32 :offset-assert 252) - (big-orb-y-offset int32 :offset-assert 256) - (transition-offset int32 :offset-assert 260) - (transition-offset-invert int32 :offset-assert 264) - (transition-percentage float :offset-assert 268) - (transition-percentage-invert float :offset-assert 272) - (transition-speed float :offset-assert 276) - (total-nb-of-power-cells int32 :offset-assert 280) - (total-nb-of-orbs int32 :offset-assert 284) - (total-nb-of-buzzers int32 :offset-assert 288) - (card-info mc-slot-info :offset-assert 292) - (last-option-index-change time-frame :offset-assert 296) - (video-mode-timeout time-frame :offset-assert 304) - (display-state-stack progress-screen 5 :offset-assert 312) - (option-index-stack int32 5 :offset-assert 352) - (display-state-pos int32 :offset-assert 372) - (nb-of-icons int32 :offset-assert 376) - (icons hud-icon 6 :offset-assert 380) - (max-nb-of-particles int32 :offset-assert 404) - (nb-of-particles int32 :offset-assert 408) - (particles hud-particle 40 :offset-assert 412) - (particle-state int32 40 :offset-assert 572) - ) - :heap-base #x270 - :method-count-assert 59 - :size-assert #x2dc - :flag-assert #x3b027002dc - (:methods - (dummy-14 (_type_) none 14) - (dummy-15 (_type_) none 15) - (dummy-16 (_type_) none 16) - (draw-progress (_type_) none 17) - (dummy-18 () none 18) - (dummy-19 (_type_) symbol 19) - (hidden? (_type_) symbol 20) - (adjust-sprites (_type_) none 21) - (adjust-icons (_type_) none 22) - (adjust-ratios (_type_ symbol symbol) none 23) - (draw-fuel-cell-screen (_type_ int) none 24) - (draw-money-screen (_type_ int) none 25) - (draw-buzzer-screen (_type_ int) none 26) - (draw-notice-screen (_type_) none 27) - (draw-options (_type_ int int float) none 28) - (dummy-29 (_type_) none 29) - (respond-progress (_type_) none 30) - (dummy-31 (_type_) none 31) - (dummy-32 (_type_) symbol 32) - (initialize-icons (_type_) none 33) - (initialize-particles (_type_) none 34) - (draw-memcard-storage-error (_type_ font-context) none 35) - (draw-memcard-data-exists (_type_ font-context) none 36) - (draw-memcard-no-data (_type_ font-context) none 37) - (draw-memcard-accessing (_type_ font-context) none 38) - (draw-memcard-insert (_type_ font-context) none 39) - (draw-memcard-file-select (_type_ font-context) none 40) - (draw-memcard-auto-save-error (_type_ font-context) none 41) - (draw-memcard-removed (_type_ font-context) none 42) - (draw-memcard-error (_type_ font-context) none 43) - (dummy-44 (_type_) none 44) - (push! (_type_) none 45) - (pop! (_type_) none 46) - (dummy-47 (_type_) none 47) - (enter! (_type_ progress-screen int) none 48) - (draw-memcard-format (_type_ font-context) none 49) - (draw-auto-save (_type_ font-context) none 50) - (set-transition-progress! (_type_ int) none 51) - (set-transition-speed! (_type_) none 52) - (dummy-53 (_type_ progress-screen) progress-screen 53) - (draw-pal-change-to-60hz (_type_ font-context) none 54) - (draw-pal-now-60hz (_type_ font-context) none 55) - (draw-no-disc (_type_ font-context) none 56) - (draw-bad-disc (_type_ font-context) none 57) - (draw-quit (_type_ font-context) none 58) - ) - (:states - progress-coming-in - progress-debug - progress-going-out - progress-gone - progress-normal - progress-waiting - ) - ) - - -(define *progress-process* (the-as (pointer progress) #f)) - -(define *progress-last-task-index* 0) - -0 - - - - diff --git a/goal_src/pc/engine/ui/progress/progress-draw.gc b/goal_src/pc/engine/ui/progress/progress-draw.gc deleted file mode 100644 index 44c76589f8..0000000000 --- a/goal_src/pc/engine/ui/progress/progress-draw.gc +++ /dev/null @@ -1,2157 +0,0 @@ -;;-*-Lisp-*- -(in-package goal) - -;; name: progress-draw.gc -;; name in dgo: progress-draw -;; dgos: GAME, ENGINE - -;; DECOMP BEGINS - -(defun adjust-pos ((arg0 int) (arg1 int)) - (if (< arg0 arg1) - 0 - (- arg0 arg1) - ) - ) - -(defmethod draw-fuel-cell-screen progress ((obj progress) (arg0 int)) - (local-vars - (sv-112 int) - (sv-128 int) - (sv-144 int) - (sv-160 (function trsqv float quaternion)) - (sv-176 trsqv) - (sv-192 int) - (sv-208 int) - (sv-224 (function string float font-context int none)) - ) - (hide-progress-icons) - (let ((s5-0 (-> *level-task-data* arg0))) - (if (and (= *cheat-mode* 'debug) (cpad-hold? 0 l3)) - (format *stdcon* "fcd:~d~%" (-> *game-info* fuel-cell-deaths)) - ) - (set! (-> *progress-process* 0 particles 14 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 15 init-pos x) -320.0) - (set! (-> *progress-process* 0 icons 4 icon-x) -320) - (when (and (!= s5-0 #f) (= (-> *game-info* level-opened arg0) 1)) - (set! sv-112 (- (-> *task-egg-starting-x* (-> s5-0 nb-of-tasks)) (-> obj left-x-offset))) - (set! sv-128 (the int (* 47.0 (-> obj transition-percentage-invert)))) - 0 - (let ((s0-0 6) - (s2-0 0) - (s4-1 (if (= (-> obj level-transition) 1) - (- (-> obj transition-offset)) - (-> obj transition-offset) - ) - ) - (f30-0 (-> obj transition-percentage-invert)) - (s1-0 0) - (s3-0 #f) - ) - (when (-> obj stat-transition) - (set! sv-128 47) - (set! s2-0 (if (!= (-> obj display-state) (-> obj next-display-state)) - (- (-> obj transition-offset)) - (-> obj transition-offset) - ) - ) - (set! s4-1 0) - (set! f30-0 1.0) - ) - (set! sv-144 0) - (while (< sv-144 4) - (let ((a0-18 (-> obj icons sv-144 icon 0 root))) - (set! sv-176 a0-18) - (set! sv-160 (method-of-object sv-176 set-yaw-angle-clear-roll-pitch!)) - (let ((a1-2 (+ (y-angle a0-18) (* 182.04445 (* 0.5 (-> *display* time-adjust-ratio)))))) - (sv-160 sv-176 a1-2) - ) - ) - (set! sv-144 (+ sv-144 1)) - ) - (set! sv-192 (+ sv-112 (/ (- (* 47 (-> s5-0 nb-of-tasks)) (* sv-128 (-> s5-0 nb-of-tasks))) 2))) - (set! sv-208 0) - (while (< sv-208 (-> s5-0 nb-of-tasks)) - (let ((v0-4 (get-task-status (-> s5-0 task-info sv-208 task-id))) - (v1-59 -1) - (a0-25 #f) - ) - (set! (-> obj particle-state s0-0) 2) - (cond - ((or (= v0-4 (task-status need-hint)) (= v0-4 (task-status unknown))) - (if (= *kernel-boot-message* 'play) - (set! (-> obj particle-state s0-0) 1) - ) - ) - ((= v0-4 (task-status invalid)) - (set! v1-59 (-> s5-0 task-info sv-208 text-index-when-resolved)) - (set! (-> obj particle-state s0-0) 3) - (set! a0-25 #t) - ) - ((= v0-4 (task-status need-introduction)) - (set! v1-59 0) - ) - ((= v0-4 (task-status need-reminder-a)) - (set! v1-59 0) - ) - ((= v0-4 (task-status need-reminder)) - (set! v1-59 1) - ) - ((= v0-4 (task-status need-reward-speech)) - (set! v1-59 2) - ) - ((= v0-4 (task-status need-resolution)) - (set! v1-59 2) - ) - ) - (if (and (!= *kernel-boot-message* 'play) (= v1-59 -1)) - (set! v1-59 0) - ) - (set! (-> obj particles s0-0 init-pos x) (the float (+ sv-192 s2-0))) - (set! (-> obj particles s0-0 init-pos y) (the float (+ s4-1 204))) - (+! s0-0 1) - (when (= sv-208 (-> obj task-index)) - (set! s1-0 v1-59) - (set! s3-0 a0-25) - (set! (-> obj particles 5 init-pos x) (the float (+ sv-192 s2-0))) - (set! (-> obj particles 5 init-pos y) (the float (+ s4-1 204))) - ) - ) - (set! sv-192 (+ sv-192 sv-128)) - (set! sv-208 (+ sv-208 1)) - ) - (dotimes (v1-77 (- 8 (-> s5-0 nb-of-tasks))) - (set! (-> *progress-process* 0 particles s0-0 init-pos x) (the float (+ s2-0 -320))) - (set! (-> obj particles s0-0 init-pos y) (the float (+ s4-1 194))) - (+! s0-0 1) - ) - (when *common-text* - (when (and (!= s1-0 -1) - (> (-> s5-0 nb-of-tasks) 0) - (>= (-> obj task-index) 0) - (< (-> obj task-index) (-> s5-0 nb-of-tasks)) - ) - (let ((s0-1 (new - 'stack - 'font-context - *font-default-matrix* - (- (+ s2-0 32) (-> obj left-x-offset)) - (+ (/ s4-1 2) 125) - 8325000.0 - (font-color yellow-orange) - (font-flags shadow kerning) - ) - ) - ) - (let ((v1-91 s0-1)) - (set! (-> v1-91 width) (the float 328)) - ) - (let ((v1-92 s0-1)) - (set! (-> v1-92 height) (the float 50)) - ) - (let ((v1-93 s0-1)) - (set! (-> v1-93 scale) 0.7) - ) - (set! (-> s0-1 flags) (font-flags shadow kerning middle left large)) - (set! sv-224 print-game-text-scaled) - (let ((a0-47 (lookup-text! *common-text* (-> s5-0 task-info (-> obj task-index) task-name s1-0) #f)) - (a1-57 f30-0) - (a2-15 s0-1) - (a3-2 (the int (* 128.0 f30-0))) - ) - (sv-224 a0-47 a1-57 a2-15 a3-2) - ) - (when s3-0 - (set! (-> s0-1 origin x) (the float (- (+ s2-0 32) (-> obj left-x-offset)))) - (set! (-> s0-1 origin y) (the float (+ (/ s4-1 2) 175))) - (let ((a0-49 s0-1)) - (set! (-> a0-49 color) (font-color lighter-lighter-blue)) - ) - (let ((v1-104 s0-1)) - (set! (-> v1-104 height) (the float 15)) - ) - (let ((v1-105 s0-1)) - (set! (-> v1-105 scale) 0.5) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id task-completed) #f) - f30-0 - s0-1 - (the int (* 128.0 f30-0)) - ) - ) - ) - ) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod draw-money-screen progress ((obj progress) (arg0 int)) - (hide-progress-icons) - (let* ((v1-1 (/ (-> obj transition-offset) 16)) - (s4-0 (if (= (-> obj level-transition) 1) - (- (-> obj transition-offset)) - (-> obj transition-offset) - ) - ) - (f30-0 (-> obj transition-percentage-invert)) - (s3-0 (- v1-1)) - ) - (when (-> obj stat-transition) - (set! v1-1 (if (!= (-> obj display-state) (-> obj next-display-state)) - (- (-> obj transition-offset)) - (-> obj transition-offset) - ) - ) - (set! s3-0 v1-1) - (set! s4-0 0) - (set! f30-0 1.0) - ) - (set! (-> obj particles 15 init-pos x) (the float (- (+ v1-1 150) (-> obj left-x-offset)))) - (set! (-> obj particles 15 init-pos y) (the float (+ s4-0 214))) - (set! (-> obj icons 4 icon-x) (- (+ v1-1 148) (-> obj left-x-offset))) - (set! (-> obj icons 4 icon-y) (+ (-> obj big-orb-y-offset) s4-0)) - (let ((a0-15 (-> obj icons 4 icon 0 root))) - (set-yaw-angle-clear-roll-pitch! - a0-15 - (- (y-angle a0-15) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio)))) - ) - ) - (let ((s4-1 - (new - 'stack - 'font-context - *font-default-matrix* - (- (+ s3-0 200) (-> obj left-x-offset)) - (+ (/ s4-0 2) 96) - 8325000.0 - (font-color default) - (font-flags shadow kerning) - ) - ) - ) - (let ((v1-19 s4-1)) - (set! (-> v1-19 width) (the float 328)) - ) - (let ((v1-20 s4-1)) - (set! (-> v1-20 height) (the float 70)) - ) - (set! (-> s4-1 flags) (font-flags shadow kerning large)) - (let ((s3-1 print-game-text-scaled)) - (format - (clear *temp-string*) - "~D/~D" - (-> *game-info* money-per-level arg0) - (-> *game-counts* data arg0 money-count) - ) - (s3-1 *temp-string* f30-0 s4-1 (the int (* 128.0 f30-0))) - ) - (let ((v1-26 s4-1)) - (set! (-> v1-26 width) (the float 428)) - ) - (set! (-> s4-1 origin x) (+ -220.0 (-> s4-1 origin x))) - (set! (-> s4-1 origin y) (+ 40.0 (-> s4-1 origin y))) - (set! (-> s4-1 flags) (font-flags shadow kerning middle large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id total-collected) #f) - (* 0.7 f30-0) - s4-1 - (the int (* 128.0 f30-0)) - ) - (set! (-> s4-1 origin y) (+ 15.0 (-> s4-1 origin y))) - (let ((s5-2 print-game-text-scaled)) - (format (clear *temp-string*) "~D/~D" (the int (-> *game-info* money-total)) (-> obj total-nb-of-orbs)) - (s5-2 *temp-string* f30-0 s4-1 (the int (* 128.0 f30-0))) - ) - ) - ) - 0 - (none) - ) - -(defmethod draw-buzzer-screen progress ((obj progress) (arg0 int)) - (hide-progress-icons) - (let* ((v1-2 (-> *level-task-data* arg0)) - (a0-3 (/ (-> obj transition-offset) 16)) - (s4-0 (if (= (-> obj level-transition) 1) - (- (-> obj transition-offset)) - (-> obj transition-offset) - ) - ) - (f30-0 (-> obj transition-percentage-invert)) - (s3-0 (- a0-3)) - ) - (when (-> obj stat-transition) - (set! a0-3 (if (!= (-> obj display-state) (-> obj next-display-state)) - (- (-> obj transition-offset)) - (-> obj transition-offset) - ) - ) - (set! s3-0 a0-3) - (set! s4-0 0) - (set! f30-0 1.0) - ) - (set! (-> obj particles 14 init-pos x) (the float (- (+ a0-3 150) (-> obj left-x-offset)))) - (set! (-> obj particles 14 init-pos y) (the float (+ s4-0 214))) - (let ((s2-0 0)) - (let ((a1-8 (-> v1-2 buzzer-task-index))) - (if (!= a1-8 -1) - (set! s2-0 (buzzer-count *game-info* (-> v1-2 task-info a1-8 task-id))) - ) - ) - (let ((s4-1 - (new - 'stack - 'font-context - *font-default-matrix* - (- (+ s3-0 200) (-> obj left-x-offset)) - (+ (/ s4-0 2) 96) - 8325000.0 - (font-color default) - (font-flags shadow kerning) - ) - ) - ) - (let ((v1-9 s4-1)) - (set! (-> v1-9 width) (the float 328)) - ) - (let ((v1-10 s4-1)) - (set! (-> v1-10 height) (the float 70)) - ) - (set! (-> s4-1 flags) (font-flags shadow kerning large)) - (let ((s3-1 print-game-text-scaled)) - (format (clear *temp-string*) "~D/~D" s2-0 (-> *game-counts* data arg0 buzzer-count)) - (s3-1 *temp-string* f30-0 s4-1 (the int (* 128.0 f30-0))) - ) - (let ((v1-14 s4-1)) - (set! (-> v1-14 width) (the float 428)) - ) - (set! (-> s4-1 origin x) (+ -220.0 (-> s4-1 origin x))) - (set! (-> s4-1 origin y) (+ 40.0 (-> s4-1 origin y))) - (set! (-> s4-1 flags) (font-flags shadow kerning middle large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id total-collected) #f) - (* 0.7 f30-0) - s4-1 - (the int (* 128.0 f30-0)) - ) - (set! (-> s4-1 origin y) (+ 15.0 (-> s4-1 origin y))) - (let ((s5-2 print-game-text-scaled)) - (format (clear *temp-string*) "~D/~D" (the int (-> *game-info* buzzer-total)) (-> obj total-nb-of-buzzers)) - (s5-2 *temp-string* f30-0 s4-1 (the int (* 128.0 f30-0))) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod draw-memcard-storage-error progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.55) - ) - (let ((v1-1 arg0)) - (set! (-> v1-1 width) (the float 265)) - ) - (let ((v1-2 arg0)) - (set! (-> v1-2 height) (the float 55)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (let ((s4-0 (game-text-id card-not-formatted-title))) - (case (-> obj display-state) - (((progress-screen memcard-no-space)) - (set! s4-0 (game-text-id memcard-no-space)) - ) - (((progress-screen memcard-not-inserted)) - (set! s4-0 (game-text-id memcard-not-inserted)) - ) - ) - (let ((s3-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* s4-0 #f) 1) - (s3-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 70.0) - (let ((v1-12 arg0)) - (set! (-> v1-12 width) (the float 350)) - ) - (let ((v1-13 arg0)) - (set! (-> v1-13 height) (the float 40)) - ) - (let ((s4-1 print-game-text-scaled)) - (format - (clear *temp-string*) - (lookup-text! *common-text* (game-text-id memcard-space-requirement1) #f) - (if (-> obj card-info) - (-> obj card-info mem-required) - 0 - ) - ) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (set! (-> arg0 origin y) 115.0) - (let ((v1-17 arg0)) - (set! (-> v1-17 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id memcard-space-requirement2) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-19 arg0)) - (set! (-> v1-19 scale) 0.65) - ) - (set! (-> arg0 origin y) 160.0) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-format progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin y) 35.0) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.55) - ) - (let ((v1-1 arg0)) - (set! (-> v1-1 width) (the float 265)) - ) - (let ((v1-2 arg0)) - (set! (-> v1-2 height) (the float 55)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (let ((s4-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id card-not-formatted-title) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 105.0) - (let ((v1-7 arg0)) - (set! (-> v1-7 width) (the float 360)) - ) - (let ((v1-8 arg0)) - (set! (-> v1-8 height) (the float 40)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id card-not-formatted-msg) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 scale) 0.65) - ) - (set! (-> arg0 origin y) 138.0) - (let ((v1-11 arg0)) - (set! (-> v1-11 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id format?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-data-exists progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.65) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 55.0) - (let ((v1-4 arg0)) - (set! (-> v1-4 width) (the float 365)) - ) - (let ((v1-5 arg0)) - (set! (-> v1-5 height) (the float 75)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id save-data-already-exists) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin y) 140.0) - (let ((v1-7 arg0)) - (set! (-> v1-7 width) (the float 360)) - ) - (let ((v1-8 arg0)) - (set! (-> v1-8 height) (the float 40)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id overwrite?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-no-data progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.65) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 40.0) - (let ((v1-4 arg0)) - (set! (-> v1-4 width) (the float 365)) - ) - (let ((v1-5 arg0)) - (set! (-> v1-5 height) (the float 75)) - ) - (let ((s4-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id no-save-data) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (set! (-> arg0 origin y) 130.0) - (let ((v1-7 arg0)) - (set! (-> v1-7 width) (the float 360)) - ) - (let ((v1-8 arg0)) - (set! (-> v1-8 height) (the float 40)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id create-save-data?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-accessing progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 1.0) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 35.0) - (let ((v1-4 arg0)) - (set! (-> v1-4 width) (the float 365)) - ) - (let ((v1-5 arg0)) - (set! (-> v1-5 height) (the float 75)) - ) - (when (or (< (mod (-> *display* real-frame-counter) 300) 150) (!= (-> obj transition-percentage-invert) 1.0)) - (let ((a1-1 (game-text-id loading-data))) - (case (-> obj display-state) - (((progress-screen memcard-saving)) - (set! a1-1 (game-text-id saving-data)) - ) - (((progress-screen memcard-formatting)) - (set! a1-1 (game-text-id formatting)) - ) - (((progress-screen memcard-creating)) - (set! a1-1 (game-text-id creating-save-data)) - ) - ) - (print-game-text-scaled (lookup-text! *common-text* a1-1 #f) (-> obj transition-percentage-invert) arg0 128) - ) - ) - (let ((v1-18 arg0)) - (set! (-> v1-18 scale) 0.65) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 15 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 100.0) - (let ((v1-22 arg0)) - (set! (-> v1-22 width) (the float 370)) - ) - (let ((v1-23 arg0)) - (set! (-> v1-23 height) (the float 75)) - ) - (let ((s4-1 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id do-not-remove-mem-card) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - 0 - (none) - ) - -(defmethod draw-memcard-insert progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.65) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 35.0) - (let ((v1-4 arg0)) - (set! (-> v1-4 width) (the float 310)) - ) - (let ((v1-5 arg0)) - (set! (-> v1-5 height) (the float 110)) - ) - (let ((s4-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id insert-memcard) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (let ((v1-7 arg0)) - (set! (-> v1-7 scale) 0.65) - ) - (set! (-> arg0 origin y) 130.0) - (let ((v1-8 arg0)) - (set! (-> v1-8 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id back?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-file-select progress ((obj progress) (arg0 font-context)) - (local-vars - (sv-16 (function _varargs_ object)) - (sv-32 (function _varargs_ object)) - (sv-48 (function _varargs_ object)) - (sv-64 (function _varargs_ object)) - (sv-80 (function _varargs_ object)) - (sv-96 (function _varargs_ object)) - (sv-112 (function _varargs_ object)) - (sv-128 (function _varargs_ object)) - (sv-144 (function _varargs_ object)) - ) - (let ((s4-0 (* (+ (-> obj transition-offset) -256) 2))) - (if (< s4-0 0) - (set! s4-0 0) - ) - (if (< 500 s4-0) - (set! s4-0 700) - ) - (set! (-> obj particles 19 init-pos x) (the float (- (- 202 (adjust-pos s4-0 150)) (-> obj left-x-offset)))) - (set! (-> obj particles 20 init-pos x) (the float (- (+ (adjust-pos s4-0 100) 202) (-> obj left-x-offset)))) - (set! (-> obj particles 21 init-pos x) (the float (- (- 202 (adjust-pos s4-0 50)) (-> obj left-x-offset)))) - (set! (-> obj particles 22 init-pos x) (the float (- (+ s4-0 202) (-> obj left-x-offset)))) - ) - (cond - ((= (-> *setting-control* current video-mode) 'pal) - (set! (-> obj particles 21 init-pos y) 256.0) - (set! (-> obj particles 22 init-pos y) 338.0) - ) - (else - (set! (-> obj particles 21 init-pos y) 255.0) - (set! (-> obj particles 22 init-pos y) 336.0) - ) - ) - (let ((f0-13 (* 2.0 (+ -0.5 (-> obj transition-percentage-invert))))) - 128 - (if (< f0-13 0.0) - (set! f0-13 0.0) - ) - (let ((s4-1 (the int (* 128.0 f0-13)))) - (let ((v1-29 arg0)) - (set! (-> v1-29 scale) 0.5) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 102 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 5.0) - (let ((v1-33 arg0)) - (set! (-> v1-33 width) (the float 200)) - ) - (let ((v1-34 arg0)) - (set! (-> v1-34 height) (the float 20)) - ) - (print-game-text - (lookup-text! - *common-text* - (the-as game-text-id (if (= (-> obj display-state) (progress-screen load-game)) - 321 - 320 - ) - ) - #f - ) - arg0 - #f - s4-1 - 22 - ) - (set! (-> arg0 origin y) 26.0) - (let ((v1-37 arg0)) - (set! (-> v1-37 height) (the float 20)) - ) - (let ((s3-3 (-> obj card-info)) - (s2-0 23) - ) - (dotimes (s1-0 4) - (set! (-> arg0 origin x) (the float (- 41 (-> obj left-x-offset)))) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (let ((a0-17 arg0)) - (set! (-> a0-17 color) (font-color default)) - ) - (let ((v1-42 arg0)) - (set! (-> v1-42 width) (the float 320)) - ) - (cond - ((and s3-3 (= (-> s3-3 formatted) 1) (= (-> s3-3 inited) 1) (= (-> s3-3 file s1-0 present) 1)) - (set! (-> obj particles s2-0 init-pos x) (the float (- 66 (-> obj left-x-offset)))) - (let ((v1-57 arg0)) - (set! (-> v1-57 scale) 0.6) - ) - (if (and (< (-> s3-3 file s1-0 level-index) (length *level-task-data-remap*)) - (> (-> s3-3 file s1-0 level-index) 0) - ) - (print-game-text - (lookup-text! - *common-text* - (-> *level-task-data* (-> *level-task-data-remap* (+ (-> s3-3 file s1-0 level-index) -1)) level-name-id) - #f - ) - arg0 - #f - s4-1 - 22 - ) - (print-game-text "OLD SAVE GAME" arg0 #f s4-1 22) - ) - (let ((a0-28 arg0)) - (set! (-> a0-28 color) (font-color blue-white)) - ) - (cond - ((or (>= (seconds 2) (- (-> *display* real-frame-counter) (-> obj last-option-index-change))) - (or (< (mod (- (-> *display* real-frame-counter) (-> obj last-option-index-change)) 1200) 600) - (!= (-> obj option-index) s1-0) - (-> obj in-transition) - ) - ) - (let ((v1-87 arg0)) - (set! (-> v1-87 scale) 0.5) - ) - (set! (-> arg0 origin y) (+ 16.0 (-> arg0 origin y))) - (set! (-> arg0 flags) (font-flags shadow kerning middle large)) - (set! (-> arg0 origin x) (the float (- -73 (-> obj left-x-offset)))) - (let ((v1-91 arg0)) - (set! (-> v1-91 width) (the float 350)) - ) - (let ((s0-2 print-game-text)) - (set! sv-16 format) - (let ((a0-40 (clear *temp-string*)) - (a1-13 "~D") - (a2-5 (the int (-> s3-3 file s1-0 fuel-cell-count))) - ) - (sv-16 a0-40 a1-13 a2-5) - ) - (s0-2 *temp-string* arg0 #f s4-1 22) - ) - (set! (-> arg0 origin x) (the float (- 1 (-> obj left-x-offset)))) - (let ((s0-3 print-game-text)) - (set! sv-32 format) - (let ((a0-44 (clear *temp-string*)) - (a1-15 "~D") - (a2-7 (the int (-> s3-3 file s1-0 money-count))) - ) - (sv-32 a0-44 a1-15 a2-7) - ) - (s0-3 *temp-string* arg0 #f s4-1 22) - ) - (set! (-> arg0 origin x) (the float (- 79 (-> obj left-x-offset)))) - (let ((s0-4 print-game-text)) - (set! sv-48 format) - (let ((a0-48 (clear *temp-string*)) - (a1-17 "~D") - (a2-9 (the int (-> s3-3 file s1-0 buzzer-count))) - ) - (sv-48 a0-48 a1-17 a2-9) - ) - (s0-4 *temp-string* arg0 #f s4-1 22) - ) - (set! (-> arg0 origin y) (+ 1.0 (-> arg0 origin y))) - (let ((v1-108 arg0)) - (set! (-> v1-108 scale) 1.0) - ) - (set! (-> arg0 flags) (font-flags shadow kerning right large)) - (set! (-> arg0 origin x) (the float (- 352 (-> obj left-x-offset)))) - (let ((s0-5 print-game-text)) - (set! sv-64 format) - (let ((a0-52 (clear *temp-string*)) - (a1-19 "~D%") - (a2-11 (the int (-> s3-3 file s1-0 completion-percentage))) - ) - (sv-64 a0-52 a1-19 a2-11) - ) - (s0-5 *temp-string* arg0 #f s4-1 22) - ) - (let ((v1-116 arg0)) - (set! (-> v1-116 scale) 0.5) - ) - (set! (-> arg0 origin y) (+ 9.0 (-> arg0 origin y))) - (set! (-> arg0 flags) (font-flags shadow kerning large)) - (set! (-> arg0 origin x) (the float (- 85 (-> obj left-x-offset)))) - (let ((s0-6 print-game-text)) - (set! sv-80 format) - (let ((a0-56 (clear *temp-string*)) - (a1-21 "/~D") - (a2-17 (if (< 100 (the int (-> s3-3 file s1-0 fuel-cell-count))) - (-> obj total-nb-of-power-cells) - 100 - ) - ) - ) - (sv-80 a0-56 a1-21 a2-17) - ) - (s0-6 *temp-string* arg0 #f s4-1 22) - ) - (set! (-> arg0 origin x) (the float (- 150 (-> obj left-x-offset)))) - (let ((s0-7 print-game-text)) - (set! sv-96 format) - (let ((a0-60 (clear *temp-string*)) - (a1-23 "/~D") - (a2-19 (-> obj total-nb-of-orbs)) - ) - (sv-96 a0-60 a1-23 a2-19) - ) - (s0-7 *temp-string* arg0 #f s4-1 22) - ) - (set! (-> arg0 origin x) (the float (- 238 (-> obj left-x-offset)))) - (let ((s0-8 print-game-text)) - (set! sv-112 format) - (let ((a0-64 (clear *temp-string*)) - (a1-25 "/~D") - (a2-21 (-> obj total-nb-of-buzzers)) - ) - (sv-112 a0-64 a1-25 a2-21) - ) - (s0-8 *temp-string* arg0 #f s4-1 22) - ) - (set! (-> arg0 origin y) (+ 15.0 (-> arg0 origin y))) - ) - (else - (set! (-> arg0 origin y) (+ 18.0 (-> arg0 origin y))) - (set! (-> arg0 origin x) (the float (- 28 (-> obj left-x-offset)))) - (let ((v1-131 arg0)) - (set! (-> v1-131 scale) 0.8) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle large)) - (let ((v1-133 arg0)) - (set! (-> v1-133 width) (the float 350)) - ) - (cond - ((= (scf-get-territory) 1) - (let ((s0-10 print-game-text)) - (set! sv-128 format) - (let ((a0-69 (clear *temp-string*)) - (a1-27 "~X/~X/20~2X ~2X:~2X") - (a2-23 (-> s3-3 file s1-0 day)) - (a3-10 (-> s3-3 file s1-0 month)) - (t0-10 (-> s3-3 file s1-0 year)) - (t1-0 (-> s3-3 file s1-0 hour)) - (t2-0 (-> s3-3 file s1-0 minute)) - ) - (sv-128 a0-69 a1-27 a2-23 a3-10 t0-10 t1-0 t2-0) - ) - (s0-10 *temp-string* arg0 #f s4-1 22) - ) - ) - (else - (let ((s0-11 print-game-text)) - (set! sv-144 format) - (let ((a0-72 (clear *temp-string*)) - (a1-29 "~X/~X/20~2X ~2X:~2X") - (a2-25 (-> s3-3 file s1-0 month)) - (a3-12 (-> s3-3 file s1-0 day)) - (t0-12 (-> s3-3 file s1-0 year)) - (t1-1 (-> s3-3 file s1-0 hour)) - (t2-1 (-> s3-3 file s1-0 minute)) - ) - (sv-144 a0-72 a1-29 a2-25 a3-12 t0-12 t1-1 t2-1) - ) - (s0-11 *temp-string* arg0 #f s4-1 22) - ) - ) - ) - (set! (-> obj particles s2-0 init-pos x) -320.0) - (set! (-> arg0 origin y) (+ 23.0 (-> arg0 origin y))) - ) - ) - ) - (else - (set! (-> obj particles s2-0 init-pos x) -320.0) - (set! (-> arg0 origin y) (+ 12.0 (-> arg0 origin y))) - (let ((v1-173 arg0)) - (set! (-> v1-173 scale) 0.7) - ) - (print-game-text (lookup-text! *common-text* (game-text-id empty) #f) arg0 #f s4-1 22) - (set! (-> arg0 origin y) (+ 29.0 (-> arg0 origin y))) - ) - ) - (+! s2-0 1) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod draw-memcard-auto-save-error progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.6) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 70 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 5.0) - (let ((v1-4 arg0)) - (set! (-> v1-4 width) (the float 265)) - ) - (let ((v1-5 arg0)) - (set! (-> v1-5 height) (the float 35)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id error-saving) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 34.0) - (let ((v1-9 arg0)) - (set! (-> v1-9 width) (the float 360)) - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 height) (the float 50)) - ) - (let ((s4-1 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id check-memcard) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (set! (-> arg0 origin y) 89.0) - (let ((v1-12 arg0)) - (set! (-> v1-12 width) (the float 360)) - ) - (let ((v1-13 arg0)) - (set! (-> v1-13 height) (the float 20)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id autosave-disabled-title) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin y) 118.0) - (let ((v1-15 arg0)) - (set! (-> v1-15 width) (the float 360)) - ) - (let ((v1-16 arg0)) - (set! (-> v1-16 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id autosave-disabled-msg) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-18 arg0)) - (set! (-> v1-18 scale) 0.65) - ) - (set! (-> arg0 origin y) 160.0) - (let ((v1-19 arg0)) - (set! (-> v1-19 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-removed progress ((obj progress) (arg0 font-context)) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.6) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (set! (-> arg0 origin x) (the float (- 70 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 10.0) - (let ((v1-4 arg0)) - (set! (-> v1-4 width) (the float 265)) - ) - (let ((v1-5 arg0)) - (set! (-> v1-5 height) (the float 55)) - ) - (let ((s4-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id memcard-removed) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 78.0) - (let ((v1-9 arg0)) - (set! (-> v1-9 width) (the float 360)) - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 height) (the float 20)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id autosave-disabled-title) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin y) 112.0) - (let ((v1-12 arg0)) - (set! (-> v1-12 width) (the float 360)) - ) - (let ((v1-13 arg0)) - (set! (-> v1-13 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id autosave-disabled-msg) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-15 arg0)) - (set! (-> v1-15 scale) 0.65) - ) - (set! (-> arg0 origin y) 160.0) - (let ((v1-16 arg0)) - (set! (-> v1-16 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-memcard-error progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin y) 15.0) - (let ((v1-0 arg0)) - (set! (-> v1-0 scale) 0.7) - ) - (let ((v1-1 arg0)) - (set! (-> v1-1 width) (the float 265)) - ) - (let ((v1-2 arg0)) - (set! (-> v1-2 height) (the float 55)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (let ((s4-0 (game-text-id error-loading))) - (case (-> obj display-state) - (((progress-screen memcard-error-saving)) - (set! s4-0 (game-text-id error-saving)) - ) - (((progress-screen memcard-error-formatting)) - (set! s4-0 (game-text-id error-formatting)) - ) - (((progress-screen memcard-error-creating)) - (set! s4-0 (game-text-id error-creating-data)) - ) - ) - (let ((s3-0 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* s4-0 #f) 1) - (s3-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 80.0) - (let ((v1-13 arg0)) - (set! (-> v1-13 width) (the float 360)) - ) - (let ((v1-14 arg0)) - (set! (-> v1-14 height) (the float 70)) - ) - (let ((s4-1 print-game-text-scaled)) - (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id check-memcard-and-retry) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) - ) - (let ((v1-16 arg0)) - (set! (-> v1-16 scale) 0.65) - ) - (set! (-> arg0 origin y) 155.0) - (let ((v1-17 arg0)) - (set! (-> v1-17 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-auto-save progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 35 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 18.0) - (let ((v1-2 arg0)) - (set! (-> v1-2 scale) 0.6) - ) - (let ((v1-3 arg0)) - (set! (-> v1-3 width) (the float 330)) - ) - (let ((v1-4 arg0)) - (set! (-> v1-4 height) (the float 60)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id autosave-warn-title) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin x) (the float (- 15 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 110.0) - (let ((v1-9 arg0)) - (set! (-> v1-9 width) (the float 370)) - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id autosave-warn-msg) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-12 arg0)) - (set! (-> v1-12 scale) 0.65) - ) - (set! (-> arg0 origin y) 175.0) - (let ((v1-13 arg0)) - (set! (-> v1-13 height) (the float 20)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> *progress-process* 0 particles 31 init-pos y) (the float (if (= (get-aspect-ratio) 'aspect16x9) - 170 - 180 - ) - ) - ) - (set! (-> *progress-process* 0 particles 31 init-pos x) - (the float - (- (if (or (< (mod (-> *display* real-frame-counter) 300) 270) (!= (-> obj transition-percentage-invert) 1.0)) - 205 - -320 - ) - (-> obj left-x-offset) - ) - ) - ) - 0 - (none) - ) - -(defmethod draw-pal-change-to-60hz progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 20.0) - (let ((v1-2 arg0)) - (set! (-> v1-2 scale) 0.6) - ) - (let ((v1-3 arg0)) - (set! (-> v1-3 width) (the float 300)) - ) - (let ((v1-4 arg0)) - (set! (-> v1-4 height) (the float 40)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id screen-change-to-60hz) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin x) (the float (- 15 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 60.0) - (let ((v1-9 arg0)) - (set! (-> v1-9 width) (the float 370)) - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id screen-60hz-warn-support) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin y) 120.0) - (let ((v1-12 arg0)) - (set! (-> v1-12 height) (the float 50)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id screen-60hz-warn-timer) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-14 arg0)) - (set! (-> v1-14 scale) 0.65) - ) - (set! (-> arg0 origin y) 175.0) - (let ((v1-15 arg0)) - (set! (-> v1-15 height) (the float 20)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-no-disc progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 50.0) - (let ((v1-2 arg0)) - (set! (-> v1-2 scale) 0.6) - ) - (let ((v1-3 arg0)) - (set! (-> v1-3 width) (the float 300)) - ) - (let ((v1-4 arg0)) - (set! (-> v1-4 height) (the float 40)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id no-disc-title) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 90.0) - (let ((v1-9 arg0)) - (set! (-> v1-9 width) (the float 360)) - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id no-disc-msg) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (when (is-cd-in?) - (let ((v1-13 arg0)) - (set! (-> v1-13 scale) 0.65) - ) - (set! (-> arg0 origin y) 155.0) - (let ((v1-14 arg0)) - (set! (-> v1-14 height) (the float 20)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - ) - 0 - (none) - ) - -(defmethod draw-bad-disc progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 50.0) - (let ((v1-2 arg0)) - (set! (-> v1-2 scale) 0.6) - ) - (let ((v1-3 arg0)) - (set! (-> v1-3 width) (the float 300)) - ) - (let ((v1-4 arg0)) - (set! (-> v1-4 height) (the float 40)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id bad-disc-title) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 90.0) - (let ((v1-9 arg0)) - (set! (-> v1-9 width) (the float 360)) - ) - (let ((v1-10 arg0)) - (set! (-> v1-10 height) (the float 60)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id bad-disc-msg) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (let ((v1-12 arg0)) - (set! (-> v1-12 scale) 0.65) - ) - (set! (-> arg0 origin y) 155.0) - (let ((v1-13 arg0)) - (set! (-> v1-13 height) (the float 20)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id continue?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-quit progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 70.0) - (let ((v1-2 arg0)) - (set! (-> v1-2 scale) 0.6) - ) - (let ((v1-3 arg0)) - (set! (-> v1-3 width) (the float 300)) - ) - (let ((v1-4 arg0)) - (set! (-> v1-4 height) (the float 40)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id quit?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-pal-now-60hz progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) - (set! (-> arg0 origin y) 45.0) - (let ((v1-2 arg0)) - (set! (-> v1-2 scale) 0.6) - ) - (let ((v1-3 arg0)) - (set! (-> v1-3 width) (the float 300)) - ) - (let ((v1-4 arg0)) - (set! (-> v1-4 height) (the float 50)) - ) - (set! (-> arg0 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id screen-now-60hz) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - (set! (-> arg0 origin y) 95.0) - (let ((v1-7 arg0)) - (set! (-> v1-7 height) (the float 50)) - ) - (print-game-text-scaled - (lookup-text! *common-text* (game-text-id screen-60hz-keep?) #f) - (-> obj transition-percentage-invert) - arg0 - 128 - ) - 0 - (none) - ) - -(defmethod draw-notice-screen progress ((obj progress)) - (hide-progress-icons) - (when *common-text* - (let ((a1-1 (new - 'stack - 'font-context - *font-default-matrix* - (- 70 (-> obj left-x-offset)) - 10 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) - ) - (case (-> obj display-state) - (((progress-screen memcard-format)) - (draw-memcard-format obj a1-1) - ) - (((progress-screen memcard-no-space) - (progress-screen memcard-not-inserted) - (progress-screen memcard-not-formatted) - ) - (draw-memcard-storage-error obj a1-1) - ) - (((progress-screen memcard-data-exists)) - (draw-memcard-data-exists obj a1-1) - ) - (((progress-screen memcard-no-data)) - (draw-memcard-no-data obj a1-1) - ) - (((progress-screen memcard-loading) - (progress-screen memcard-saving) - (progress-screen memcard-formatting) - (progress-screen memcard-creating) - ) - (draw-memcard-accessing obj a1-1) - ) - (((progress-screen memcard-insert)) - (draw-memcard-insert obj a1-1) - ) - (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) - (draw-memcard-file-select obj a1-1) - ) - (((progress-screen memcard-auto-save-error)) - (draw-memcard-auto-save-error obj a1-1) - ) - (((progress-screen memcard-removed)) - (draw-memcard-removed obj a1-1) - ) - (((progress-screen memcard-error-loading) - (progress-screen memcard-error-saving) - (progress-screen memcard-error-formatting) - (progress-screen memcard-error-creating) - ) - (draw-memcard-error obj a1-1) - ) - (((progress-screen auto-save)) - (draw-auto-save obj a1-1) - ) - (((progress-screen pal-change-to-60hz)) - (draw-pal-change-to-60hz obj a1-1) - ) - (((progress-screen pal-now-60hz)) - (draw-pal-now-60hz obj a1-1) - ) - (((progress-screen no-disc)) - (draw-no-disc obj a1-1) - ) - (((progress-screen bad-disc)) - (draw-bad-disc obj a1-1) - ) - (((progress-screen quit)) - (draw-quit obj a1-1) - ) - ) - ) - ) - 0 - (none) - ) - -(defun draw-percent-bar ((arg0 int) (arg1 int) (arg2 float) (arg3 int)) - (let* ((s2-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (gp-0 (-> s2-0 base)) - ) - (draw-sprite2d-xy s2-0 arg0 arg1 255 14 (new 'static 'rgba :a #x60)) - (draw-sprite2d-xy s2-0 arg0 (+ arg1 2) (the int (* 255.0 arg2)) 10 (the-as rgba arg3)) - (let ((a3-3 (-> s2-0 base))) - (let ((v1-3 (the-as dma-packet (-> s2-0 base)))) - (set! (-> v1-3 dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> v1-3 vif0) (new 'static 'vif-tag)) - (set! (-> v1-3 vif1) (new 'static 'vif-tag)) - (set! (-> s2-0 base) (&+ (the-as pointer v1-3) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id sprite) - gp-0 - (the-as (pointer dma-tag) a3-3) - ) - ) - ) - 0 - (none) - ) - -(defun print-list-item-name ((arg0 int) (arg1 font-context) (arg2 int) (arg3 symbol) (name-list (array game-text-id))) - (let ((s5-0 (if arg3 - arg2 - (- arg2) - ) - ) - ) - (+! (-> arg1 origin x) (the float s5-0)) - (let ((f30-0 (- 1.0 (* 0.0033333334 (the float arg2))))) - (print-game-text-scaled - (lookup-text! *common-text* (-> name-list arg0) #f) - f30-0 - arg1 - (the int (* 128.0 f30-0)) - ) - ) - (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float s5-0))) - ) - (set! (-> arg1 color) (font-color default)) - arg1 - ) - - -(defun draw-options-list ((obj progress) - (font-ctx font-context) - (something-unknown int) - (name-list (array game-text-id))) - "Given a progress object, draw it's arbitrarily sized list of options. This is option-type `1`" - (local-vars - (list-size int) - (curr-selection-index int) - (unknown-modified-index int) - (unknown-modified-index-2 int) - (unknown-modified-index-3 int) - (unknown-modified-index-4 int) - (screen-arr (array game-option))) - - (set! list-size (length name-list)) - (set! screen-arr (-> *options-remap* (-> obj display-state))) - (set! curr-selection-index (-> *progress-menu-list-tracker* selected-index)) - (if (-> *progress-menu-list-tracker* transition?) - (set! (-> *progress-menu-list-tracker* x-offset) - (seekl (-> *progress-menu-list-tracker* x-offset) - 200 - (the int (* 10.0 (-> *display* time-adjust-ratio)))))) - - (when (>= (-> *progress-menu-list-tracker* x-offset) 100) - (set! (-> *progress-menu-list-tracker* transition?) #f) - (set! (-> *progress-menu-list-tracker* x-offset) 0)) - - (set! (-> font-ctx origin y) (the float (+ something-unknown 3))) - (set! (-> font-ctx color) (font-color lighter-lighter-blue)) - (set! unknown-modified-index (mod (+ curr-selection-index 1) list-size)) - - (let ((unknown-modified-index-2 (mod (+ list-size -1 curr-selection-index) list-size)) - (unknown-modified-index-3 (mod (the-as int (+ curr-selection-index 2)) list-size))) - (set! unknown-modified-index-4 (mod (+ list-size -2 curr-selection-index) list-size)) - ; cleanup this logic, doesnt have to all be conds - (cond - ((= (-> *progress-menu-list-tracker* direction) 'left) - (let ((a2-22 (- 200 (+ (-> *progress-menu-list-tracker* x-offset) 100)))) - (print-list-item-name unknown-modified-index-2 font-ctx a2-22 #f name-list)) - (let ((a2-23 (+ (-> *progress-menu-list-tracker* x-offset) 100))) - (if (< a2-23 150) - (print-list-item-name unknown-modified-index font-ctx a2-23 #t name-list) - (print-list-item-name unknown-modified-index-4 font-ctx (- 200 (-> *progress-menu-list-tracker* x-offset)) #f name-list)))) - (else - (let ((a2-25 (+ (-> *progress-menu-list-tracker* x-offset) 100))) - (cond - ((< a2-25 150) - (print-list-item-name unknown-modified-index-2 font-ctx a2-25 #f name-list)) - (else - (let ((a2-26 (- 200 (-> *progress-menu-list-tracker* x-offset)))) - (print-list-item-name unknown-modified-index-3 font-ctx a2-26 #t name-list))))) - (let ((a2-27 (- 200 (+ (-> *progress-menu-list-tracker* x-offset) 100)))) - (print-list-item-name unknown-modified-index font-ctx a2-27 #t name-list))))) - (when (not (-> *progress-menu-list-tracker* transition?)) - (let ((a0-75 font-ctx)) - (set! (-> a0-75 color) (font-color yellow-green-2)))) - (print-list-item-name (the-as int curr-selection-index) - font-ctx - (-> *progress-menu-list-tracker* x-offset) - (-> *progress-menu-list-tracker* direction) - name-list)) - - -(defmethod draw-options progress ((obj progress) (arg0 int) (arg1 int) (arg2 float)) - (local-vars - (font-ctx font-context) - (sv-128 int) - (sv-144 int) - (sv-160 (function _varargs_ object)) - (sv-176 string) - (sv-192 string) - (sv-208 string) - (sv-224 (function _varargs_ object)) - (sv-240 string) - (sv-256 string) - (sv-272 string) - (sv-288 (function string font-context symbol int int float)) - (sv-304 (function _varargs_ object)) - (sv-320 (function _varargs_ object)) - (sv-336 string) - (sv-352 string) - (sv-368 string) - (sv-384 (function _varargs_ object)) - (sv-400 string) - (sv-416 string) - (sv-432 string) - (sv-448 uint) - (sv-464 int) - (sv-480 int) - (sv-496 int) - (sv-512 uint) - (sv-528 (function _varargs_ object)) - (sv-544 string) - (sv-560 string) - (sv-576 string) - (sv-592 (function _varargs_ object)) - (sv-608 string) - (sv-624 string) - (sv-640 string) - (sv-656 (function _varargs_ object)) - (sv-672 string) - (sv-688 string) - (sv-704 string) - (sv-720 (function _varargs_ object)) - (sv-736 string) - (sv-752 string) - (sv-768 string) - (sv-784 (function _varargs_ object)) - (sv-800 string) - (sv-816 string) - (sv-832 string) - (sv-848 (function _varargs_ object)) - (sv-864 string) - (sv-880 string) - (sv-896 string) - (sv-912 string) - ) - (let ((s3-0 (-> *options-remap* (-> obj display-state)))) - (when s3-0 - (let ((s2-1 (- arg0 (/ (* arg1 (length s3-0)) 2))) - (s1-0 0) - ) - 27 - 0 - (set! font-ctx - (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) - ) - (let ((v1-11 font-ctx)) - (set! (-> v1-11 width) (the float 350)) - ) - (let ((v1-12 font-ctx)) - (set! (-> v1-12 height) (the float 25)) - ) - (set! (-> font-ctx flags) (font-flags shadow kerning middle left large)) - (dotimes (s0-0 (length s3-0)) - (set! sv-912 (the-as string #f)) - (set! sv-128 27) - (set! sv-144 s2-1) - (let ((v1-18 (-> s3-0 s0-0 option-type))) - (cond - ((= v1-18 7) - (cond - ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (set! sv-160 format) - (set! sv-176 (clear *temp-string*)) - (set! sv-192 "~30L~S~0L ~S") - (set! sv-208 (lookup-text! *common-text* (game-text-id yes) #f)) - (let ((a3-2 (lookup-text! *common-text* (game-text-id no) #f))) - (sv-160 sv-176 sv-192 sv-208 a3-2) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-224 format) - (set! sv-240 (clear *temp-string*)) - (set! sv-256 "~0L~S ~30L~S~1L") - (set! sv-272 (lookup-text! *common-text* (game-text-id yes) #f)) - (let ((a3-3 (lookup-text! *common-text* (game-text-id no) #f))) - (sv-224 sv-240 sv-256 sv-272 a3-3) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ) - ) - ((or (= v1-18 6) (= v1-18 8)) - (cond - ((nonzero? (-> s3-0 s0-0 name)) - (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - sv-912 - ) - (else - (set! sv-912 (the-as string #f)) - (the-as symbol sv-912) - ) - ) - ) - ((and (-> obj selected-option) (= (-> obj option-index) s0-0)) - (let ((a0-19 font-ctx)) - (set! (-> a0-19 color) (font-color default)) - ) - (set! (-> font-ctx origin x) (the float (- sv-128 (-> obj left-x-offset)))) - (case (-> s3-0 s0-0 option-type) - ((3) - (set! (-> font-ctx origin y) (the float (+ s2-1 -20))) - ) - (else - (set! (-> font-ctx origin y) (the float (+ s2-1 -8))) - ) - ) - (let ((v1-64 font-ctx)) - (set! (-> v1-64 scale) 0.6) - ) - (set! sv-288 print-game-text) - (let ((a0-23 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (a1-11 font-ctx) - (a2-10 #f) - (a3-4 128) - (t0-1 22) - ) - (sv-288 a0-23 a1-11 a2-10 a3-4 t0-1) - ) - (case (-> s3-0 s0-0 option-type) - ((3) - (set! sv-144 (+ s2-1 3)) - sv-144 - ) - (else - (set! sv-144 (+ s2-1 7)) - sv-144 - ) - ) - (let ((v1-81 (-> s3-0 s0-0 option-type))) - (cond - ((zero? v1-81) - (let* ((v1-82 (the-as uint #x8000ffff)) - (f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) - (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) - (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) - ) - (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as int a3-5)) - ) - (set! sv-304 format) - (let ((a0-42 (clear *temp-string*)) - (a1-13 "~D") - (a2-12 (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) - ) - (sv-304 a0-42 a1-13 a2-12) - ) - (set! sv-912 *temp-string*) - (set! sv-128 (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100)) - sv-128 - ) - ((or (= v1-81 2) (= v1-81 #x15)) - (cond - ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (set! sv-320 format) - (set! sv-336 (clear *temp-string*)) - (set! sv-352 "~30L~S~0L ~S") - (set! sv-368 (lookup-text! *common-text* (game-text-id on) #f)) - (let ((a3-6 (lookup-text! *common-text* (game-text-id off) #f))) - (sv-320 sv-336 sv-352 sv-368 a3-6) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-384 format) - (set! sv-400 (clear *temp-string*)) - (set! sv-416 "~0L~S ~30L~S~1L") - (set! sv-432 (lookup-text! *common-text* (game-text-id on) #f)) - (let ((a3-7 (lookup-text! *common-text* (game-text-id off) #f))) - (sv-384 sv-400 sv-416 sv-432 a3-7) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ) - ) - ;; language selection - when selected - ((= v1-81 1) - (draw-options-list obj font-ctx s2-1 *language-name-remap*)) - ((= v1-81 #x10) - (if (-> *pc-settings* use-original-aspect-ratio?) - (draw-options-list obj font-ctx s2-1 *pc-graphics-original-aspect-ratio-mode-remap*) - (draw-options-list obj font-ctx s2-1 *pc-graphics-aspect-ratio-mode-remap*))) - ((= v1-81 #x11) - (case (-> *pc-settings* aspect-ratio-mode) - (('pc-aspect-4x3 'orig-aspect-4x3) - (draw-options-list obj font-ctx s2-1 *pc-graphics-4x3-valid-resolutions-names*)) - (('pc-aspect-5x4) - (draw-options-list obj font-ctx s2-1 *pc-graphics-5x4-valid-resolutions-names*)) - (('pc-aspect-16x9 'orig-aspect-16x9) - (draw-options-list obj font-ctx s2-1 *pc-graphics-16x9-valid-resolutions-names*)) - (('pc-aspect-21x9) - (draw-options-list obj font-ctx s2-1 *pc-graphics-21x9-valid-resolutions-names*)) - (('pc-aspect-32x9) - (draw-options-list obj font-ctx s2-1 *pc-graphics-32x9-valid-resolutions-names*)))) - ((= v1-81 #x12) - (draw-options-list obj font-ctx s2-1 *pc-graphics-display-mode-remap*)) - ((= v1-81 #x13) - (draw-options-list obj font-ctx s2-1 *pc-subtitle-language-name-remap*)) - ((= v1-81 #x14) - (draw-options-list obj font-ctx s2-1 *pc-subtitle-speaker-setting-remap*)) - ((= v1-81 3) - (set! sv-912 (lookup-text! *common-text* (game-text-id move-dpad) #f)) - sv-912 - ) - ;; aspect ratio - original - ((= v1-81 4) - (cond - ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3) - (format (clear *temp-string*) - "~30L~S~0L ~S" - (lookup-text! *common-text* (game-text-id 4x3) #f) - (lookup-text! *common-text* (game-text-id 16x9) #f)) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (format (clear *temp-string*) - "~0L~S ~30L~S~1L" - (lookup-text! *common-text* (game-text-id 4x3) #f) - (lookup-text! *common-text* (game-text-id 16x9) #f)) - (set! sv-912 *temp-string*) - sv-912 - ) - ) - ) - ;; pal refresh rate - ((= v1-81 5) - (cond - ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc) - (set! sv-656 format) - (set! sv-672 (clear *temp-string*)) - (set! sv-688 "~0L~S ~30L~S~1L") - (set! sv-704 (lookup-text! *common-text* (game-text-id 50hz) #f)) - (let ((a3-17 (lookup-text! *common-text* (game-text-id 60hz) #f))) - (sv-656 sv-672 sv-688 sv-704 a3-17) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-720 format) - (set! sv-736 (clear *temp-string*)) - (set! sv-752 "~30L~S~0L ~S") - (set! sv-768 (lookup-text! *common-text* (game-text-id 50hz) #f)) - (let ((a3-18 (lookup-text! *common-text* (game-text-id 60hz) #f))) - (sv-720 sv-736 sv-752 sv-768 a3-18) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ) - ) - ) - ) - ) - (else - (let ((v1-195 (-> s3-0 s0-0 option-type))) - (cond - ;; boolean flag - ((= v1-195 2) - (set! sv-784 format) - (set! sv-800 (clear *temp-string*)) - (set! sv-816 "~S: ~S") - (set! sv-832 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - ;; Danger -- assumes there is a value to be modified, iniitalized in progress! - (let ((a3-19 (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (lookup-text! *common-text* (game-text-id on) #f) - (lookup-text! *common-text* (game-text-id off) #f) - ) - ) - ) - (sv-784 sv-800 sv-816 sv-832 a3-19) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ;; language selection - ;; unfortunate everything is hard-coded with these ids.. - ((= v1-195 1) - (set! sv-848 format) - (set! sv-864 (clear *temp-string*)) - (set! sv-880 "~S: ~S") - (set! sv-896 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (let ((a3-20 (lookup-text! - *common-text* - (-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) - #f - ) - ) - ) - (sv-848 sv-864 sv-880 sv-896 a3-20) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - sv-912) - ) - ) - ) - ) - ) - (when sv-912 - (let ((f0-23 (-> obj transition-percentage-invert))) - (let ((v1-235 font-ctx)) - (set! (-> v1-235 color) - (the-as font-color (if (and (= s0-0 (-> obj option-index)) (not (-> obj in-transition))) - 30 - 0 - ) - ) - ) - ) - (set! (-> font-ctx origin x) (the float (- sv-128 (-> obj left-x-offset)))) - (set! (-> font-ctx origin y) (the float (the int (* (the float sv-144) (if (-> s3-0 s0-0 scale) - f0-23 - 1.0 - ) - ) - ) - ) - ) - (let ((v1-246 font-ctx)) - (set! (-> v1-246 scale) (* arg2 f0-23)) - ) - (let ((t9-60 print-game-text) - (a1-64 font-ctx) - (a2-50 #f) - (a3-21 (the int (* 128.0 f0-23))) - (t0-2 22) - ) - (t9-60 sv-912 a1-64 a2-50 a3-21 t0-2) - ) - ) - ) - (+! s2-1 arg1) - (+! s1-0 1) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod draw-progress progress ((obj progress)) - (let ((f30-0 (+ -409.0 (-> obj particles 2 init-pos x) (* 0.8 (the float (-> obj left-x-offset))))) - (s5-0 (if (or (-> obj stat-transition) (nonzero? (-> obj level-transition))) - 0 - (-> obj transition-offset) - ) - ) - ) - (let ((f28-0 (if (or (-> obj stat-transition) (nonzero? (-> obj level-transition))) - 1.0 - (-> obj transition-percentage-invert) - ) - ) - ) - (let* ((s3-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (s4-0 (-> s3-0 base)) - ) - (let ((s2-0 draw-string-xy)) - (format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* game money)))) - (s2-0 - *temp-string* - s3-0 - (the int (+ 428.0 (the float s5-0) f30-0)) - (- 12 (the int (* 0.16666667 f30-0))) - (font-color default) - (font-flags shadow kerning large) - ) - ) - (let ((s2-1 draw-string-xy)) - (format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* game fuel)))) - (s2-1 - *temp-string* - s3-0 - (the int (+ 456.0 (the float (adjust-pos s5-0 50)) f30-0)) - (- 48 (the int (* 0.125 f30-0))) - (font-color default) - (font-flags shadow kerning large) - ) - ) - (let ((s2-2 draw-string-xy)) - (format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* fact-info-target buzzer)))) - (s2-2 - *temp-string* - s3-0 - (the int (+ 469.0 (the float (adjust-pos s5-0 100)) f30-0)) - 89 - (font-color default) - (font-flags shadow kerning large) - ) - ) - (let ((a3-4 (-> s3-0 base))) - (let ((v1-20 (the-as object (-> s3-0 base)))) - (set! (-> (the-as dma-packet v1-20) dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> (the-as dma-packet v1-20) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-20) vif1) (new 'static 'vif-tag)) - (set! (-> s3-0 base) (&+ (the-as pointer v1-20) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - s4-0 - (the-as (pointer dma-tag) a3-4) - ) - ) - ) - (let ((s4-2 - (new - 'stack - 'font-context - *font-default-matrix* - (the int (+ (- 423.0 (the float (/ (-> obj left-x-offset) 2))) f30-0 (the float (adjust-pos s5-0 150)))) - 131 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) - ) - (let ((v1-29 s4-2)) - (set! (-> v1-29 width) (the float 100)) - ) - (let ((v1-30 s4-2)) - (set! (-> v1-30 height) (the float 15)) - ) - (let ((v1-31 s4-2)) - (set! (-> v1-31 scale) 0.5) - ) - (set! (-> s4-2 flags) (font-flags shadow kerning large)) - (print-game-text (lookup-text! *common-text* (game-text-id options) #f) s4-2 #f 128 22) - (let ((v1-34 s4-2)) - (set! (-> v1-34 width) (the float 160)) - ) - (let ((v1-35 s4-2)) - (set! (-> v1-35 height) (the float 22)) - ) - (let ((v1-36 s4-2)) - (set! (-> v1-36 scale) 1.3) - ) - (let ((a0-31 s4-2)) - (set! (-> a0-31 color) (font-color another-light-blue)) - ) - (set! (-> s4-2 origin x) - (+ (- 435.0 (the float (if (< (-> *progress-process* 0 completion-percentage) 10.0) - 93 - 80 - ) - ) - ) - f30-0 - ) - ) - (set! (-> s4-2 origin y) 180.0) - (set! (-> s4-2 flags) (font-flags shadow kerning middle left large)) - (let ((s3-3 print-game-text)) - (format (clear *temp-string*) "~2D%" (the int (-> *progress-process* 0 completion-percentage))) - (s3-3 *temp-string* s4-2 #f (the int (* 128.0 f28-0)) 22) - ) - ) - ) - 0.0 - (let ((f28-1 (+ -94.0 (-> obj particles 2 init-pos x))) - (s3-4 90) - (s4-3 224) - (s2-5 (/ s5-0 5)) - (f26-3 (-> obj button-scale)) - ) - (let ((f24-0 (* 182.04445 (- (/ -36.0 f26-3) (the float s2-5))))) - (set! (-> obj particles 27 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-0)))))) - (set! (-> obj particles 27 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-0)))))) - ) - (let ((f24-2 (* 182.04445 (- (/ -21.0 f26-3) (the float (adjust-pos s2-5 10)))))) - (set! (-> obj particles 28 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-2)))))) - (set! (-> obj particles 28 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-2)))))) - ) - (let ((f24-4 (* 182.04445 (- (/ -6.0 f26-3) (the float (adjust-pos s2-5 15)))))) - (set! (-> obj particles 29 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-4)))))) - (set! (-> obj particles 29 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-4)))))) - ) - (let ((f26-5 (* 182.04445 (- (/ 9.0 f26-3) (the float (adjust-pos s2-5 20)))))) - (set! (-> obj particles 30 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f26-5)))))) - (set! (-> obj particles 30 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f26-5)))))) - ) - ) - (when *cheat-mode* - (let ((a0-46 "AUTO SAVE OFF")) - (if (-> *setting-control* current auto-save) - (set! a0-46 "AUTO SAVE ON") - ) - (let* ((s3-5 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (s4-4 (-> s3-5 base)) - ) - (draw-string-xy - a0-46 - s3-5 - (the int (+ 430.0 f30-0)) - 200 - (font-color blue-white) - (font-flags shadow kerning middle) - ) - (let ((a3-9 (-> s3-5 base))) - (let ((v1-81 (the-as object (-> s3-5 base)))) - (set! (-> (the-as dma-packet v1-81) dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> (the-as dma-packet v1-81) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-81) vif1) (new 'static 'vif-tag)) - (set! (-> s3-5 base) (&+ (the-as pointer v1-81) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - s4-4 - (the-as (pointer dma-tag) a3-9) - ) - ) - ) - ) - ) - (let ((a0-52 (-> obj icons 5 icon 0 root))) - (set-yaw-angle-clear-roll-pitch! - a0-52 - (- (y-angle a0-52) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio)))) - ) - ) - (let* ((f28-2 (* 0.00024414062 (the float (-> *progress-process* 0 in-out-position)))) - (f30-1 (* 300.0 f28-2)) - ) - (set! (-> obj particles 18 init-pos x) - (the float (+ (the int (the float (adjust-pos s5-0 50))) 394 (the int f30-1) (-> obj right-x-offset))) - ) - (set! (-> obj particles 18 init-pos y) (the float (- 40 (the int (* 80.0 f28-2))))) - (set! (-> obj icons 5 icon-x) - (+ (the int (the float (adjust-pos s5-0 50))) 393 (the int f30-1) (-> obj right-x-offset)) - ) - (set! (-> obj icons 5 icon-y) (- (-> obj small-orb-y-offset) (the int (* 80.0 f28-2)))) - (set! (-> obj particles 16 init-pos x) - (the float (+ (the int (the float (adjust-pos s5-0 100))) 425 (the int f30-1) (-> obj right-x-offset))) - ) - (set! (-> obj particles 16 init-pos y) (the float (- 112 (the int (* 60.0 f28-2))))) - (set! (-> obj particles 17 init-pos x) (the float (+ (the int (the float (adjust-pos s5-0 150))) - 442 - (the int f30-1) - (the int (* 0.7 (the float (-> obj right-x-offset)))) - ) - ) - ) - ) - ) - (set! (-> obj particles 17 init-pos y) 193.0) - 0 - (none) - ) - - - - diff --git a/goal_src/pc/engine/ui/progress/progress-static.gc b/goal_src/pc/engine/ui/progress/progress-static.gc deleted file mode 100644 index e08952ce54..0000000000 --- a/goal_src/pc/engine/ui/progress/progress-static.gc +++ /dev/null @@ -1,1498 +0,0 @@ -;;-*-Lisp-*- -(in-package goal) - -;; name: progress-static.gc -;; name in dgo: progress-static -;; dgos: GAME, ENGINE - -;; This file contains the layouts for all of the menus. - -;; options in the start menu options -(define *main-options* - (new 'static 'boxed-array :type game-option :length 7 :allocated-length 7 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x6 :name (game-text-id load-game) :scale #t :param3 16) - (new 'static 'game-option :option-type #x6 :name (game-text-id save-game) :scale #t :param3 17) - (new 'static 'game-option :option-type #x6 :name (game-text-id quit-game) :scale #t :param3 34) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *title* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id new-game) :scale #t :param3 18) - (new 'static 'game-option :option-type #x6 :name (game-text-id load-game) :scale #t :param3 16) - (new 'static 'game-option :option-type #x6 :name (game-text-id options) :scale #t :param3 28) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *options* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *main-options-demo* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -;; param3 corresponds to the index defined in `*options-remap*` in progress.gc -;; it is the screen it should go to next, it's only used for type `6` - -(define *main-options-demo-shared* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id exit-demo) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -;; TODO - option type should be an enum -;; 1 - a list? (only used by language so there might be some bad assumptions here...) -;; 2 - boolean -;; 3 - dpad input (center screen) -;; 4 - used for aspect ratio, also a list -;; 6 - go forward a screen -;; 8 - go back a screen -;; --- -;; 10 - port aspect ratio -;; 11 - port resolution -;; 12 - port window type -;; 13 - port subtitle language -;; 14 - port subtitle speaker -;; 15 - original aspect ratio - -(define *game-options* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x6 :name (game-text-id progress-language-options) :scale #t :param3 35) - (new 'static 'game-option :option-type #x2 :name (game-text-id progress-discord-rpc) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *game-options-japan* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x1 :name (game-text-id progress-language-options) :scale #t :param3 35) - (new 'static 'game-option :option-type #x2 :name (game-text-id progress-discord-rpc) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *game-options-demo* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x1 :name (game-text-id progress-language-options) :scale #t :param3 35) - (new 'static 'game-option :option-type #x2 :name (game-text-id progress-discord-rpc) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *language-options* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x1 :name (game-text-id language) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id progress-subtitles) :scale #t) - (new 'static 'game-option :option-type #x13 :name (game-text-id progress-subtitles-language) :scale #t) - (new 'static 'game-option :option-type #x14 :name (game-text-id progress-subtitles-label-speaker) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - )) - -(define *graphic-options* - (new 'static 'boxed-array :type game-option :length 6 - (new 'static 'game-option :option-type #x15 :name (game-text-id progress-use-original-aspect) :scale #t) - (new 'static 'game-option :option-type #x12 :name (game-text-id progress-display-mode) :scale #t) - (new 'static 'game-option :option-type #x10 :name (game-text-id aspect-ratio) :scale #t) - (new 'static 'game-option :option-type #x11 :name (game-text-id progress-resolution) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id progress-letterbox) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *graphic-title-options-pal* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x3 :name (game-text-id center-screen) :scale #t) - (new 'static 'game-option :option-type #x5 :name (game-text-id video-mode) :scale #t) - (new 'static 'game-option :option-type #x4 :name (game-text-id aspect-ratio) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *sound-options* - (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) - ) - -(define *yes-no-options* - (new 'static 'boxed-array :type game-option :length 1 :allocated-length 1 - (new 'static 'game-option :option-type #x7 :scale #f) - ) - ) - -(define *ok-options* - (new 'static 'boxed-array :type game-option :length 1 :allocated-length 1 - (new 'static 'game-option :option-type #x8 :name (game-text-id ok) :scale #f) - ) - ) - -(define *load-options* - (new 'static 'boxed-array - :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) - ) - -(define *save-options* - (new 'static 'boxed-array :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) - ) - -(define *save-options-title* - (new 'static 'boxed-array - :type game-option :length 6 :allocated-length 6 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id continue-without-saving) :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) - ) - -;; maps options to a progress screen -(define *options-remap* - (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length 36) - ) - -;; TODO probably an enum. -;; maps "levels" to the appropriate offset in *level-task-data* -(define *level-task-data-remap* - (new 'static 'boxed-array :type int32 :length 23 :allocated-length 23 - 0 - 1 - 2 - 3 ;; jungle? - 3 ;; jungleb? - 4 - 5 - 6 - 7 ;; sunken? - 7 ;; sunkenb? - 8 - 9 - 10 - 11 - 12 - 13 ;; maincave? - 13 ;; robocave? - 13 ;; darkcave? - 14 - 15 ;; citadel? - 15 ;; finalboss? - 4 ;; demo? - 4 ;; intro? - ) - ) - -;; maps goal language ID to its name string ID -(define *language-name-remap* - (new 'static 'boxed-array :type game-text-id :length 6 :allocated-length 6 - (game-text-id english) - (game-text-id french) - (game-text-id german) - (game-text-id spanish) - (game-text-id italian) - (game-text-id japanese) - ) - ) - -(define *pc-subtitle-language-name-remap* - (new 'static 'boxed-array :type game-text-id :length 14 :allocated-length 14 - (game-text-id english) - (game-text-id french) - (game-text-id german) - (game-text-id spanish) - (game-text-id italian) - (game-text-id japanese) - (game-text-id progress-subtitle-language-uk-english) - (game-text-id progress-subtitle-language-portuguese) - (game-text-id progress-subtitle-language-finnish) - (game-text-id progress-subtitle-language-swedish) - (game-text-id progress-subtitle-language-danish) - (game-text-id progress-subtitle-language-norwegian) - (game-text-id progress-subtitle-language-korean) - (game-text-id progress-subtitle-language-russian))) - -(define *pc-subtitle-speaker-setting-remap* - (new 'static 'boxed-array :type game-text-id :length 3 :allocated-length 3 - (game-text-id progress-subtitles-label-speaker-on) - (game-text-id progress-subtitles-label-speaker-off) - (game-text-id progress-subtitles-label-speaker-auto))) - -(define *pc-graphics-display-mode-remap* - (new 'static 'boxed-array :type game-text-id :length 3 :allocated-length 3 - (game-text-id progress-display-mode-borderless) - (game-text-id progress-display-mode-fullscreen) - (game-text-id progress-display-mode-windowed))) - -(define *pc-graphics-original-aspect-ratio-mode-remap* - (new 'static 'boxed-array :type game-text-id :length 2 :allocated-length 2 - (game-text-id progress-aspect-ratio-4x3) - (game-text-id progress-aspect-ratio-16x9))) - -(define *pc-graphics-aspect-ratio-mode-remap* - (new 'static 'boxed-array :type game-text-id :length 5 :allocated-length 5 - (game-text-id progress-aspect-ratio-4x3) - (game-text-id progress-aspect-ratio-5x4) - (game-text-id progress-aspect-ratio-16x9) - (game-text-id progress-aspect-ratio-21x9) - (game-text-id progress-aspect-ratio-32x9))) - -(define *pc-graphics-4x3-valid-resolutions-names* - (new 'static 'boxed-array :type game-text-id :length 5 :allocated-length 5 - (game-text-id progress-res-4x3-640x480) - (game-text-id progress-res-4x3-800x600) - (game-text-id progress-res-4x3-1024x768) - (game-text-id progress-res-4x3-1280x960) - (game-text-id progress-res-4x3-1600x1200))) - -(define *pc-graphics-5x4-valid-resolutions-names* - (new 'static 'boxed-array :type game-text-id :length 3 :allocated-length 3 - (game-text-id progress-res-5x4-960x768) - (game-text-id progress-res-5x4-1280x1024) - (game-text-id progress-res-5x4-1500x1200))) - -(define *pc-graphics-16x9-valid-resolutions-names* - (new 'static 'boxed-array :type game-text-id :length 7 :allocated-length 7 - (game-text-id progress-res-16x9-854x480) - (game-text-id progress-res-16x9-1280x720) - (game-text-id progress-res-16x9-1920x1080) - (game-text-id progress-res-16x9-2560x1440) - (game-text-id progress-res-16x9-2880x1620) - (game-text-id progress-res-16x9-3840x2160) - (game-text-id progress-res-16x9-5120x2880))) - -(define *pc-graphics-21x9-valid-resolutions-names* - (new 'static 'boxed-array :type game-text-id :length 6 :allocated-length 6 - (game-text-id progress-res-21x9-2560x1080) - (game-text-id progress-res-21x9-3120x1440) - (game-text-id progress-res-21x9-3200x1440) - (game-text-id progress-res-21x9-3440x1440) - (game-text-id progress-res-21x9-3840x1600) - (game-text-id progress-res-21x9-5120x2160))) - -(define *pc-graphics-32x9-valid-resolutions-names* - (new 'static 'boxed-array :type game-text-id :length 1 :allocated-length 1 - (game-text-id progress-res-32x9-5120x1440))) - -;; all level tasks -(define *level-task-data* - (new 'static 'boxed-array :type level-tasks-info :length 16 :allocated-length 16 - (new 'static 'level-tasks-info - :level-name-id (game-text-id training-level-name) - :text-group-index 1 - :nb-of-tasks 4 - :buzzer-task-index 3 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task training-gimmie) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-gimmie-task-name) - (game-text-id training-gimmie-task-name) - (game-text-id training-gimmie-task-name) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task training-door) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-door-task-name) - (game-text-id training-door-task-name) - (game-text-id training-door-task-name) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task training-climb) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-climb-task-name) - (game-text-id training-climb-task-name) - (game-text-id training-climb-task-name) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task training-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-buzzer-task-name) - (game-text-id training-buzzer-task-name) - (game-text-id training-buzzer-task-name) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id village1-level-name) - :text-group-index 1 - :nb-of-tasks 6 - :buzzer-task-index 5 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task village1-mayor-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-mayor-money) - (game-text-id village1-mayor-money) - (game-text-id village1-mayor-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-uncle-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id vollage1-uncle-money) - (game-text-id vollage1-uncle-money) - (game-text-id vollage1-uncle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-yakow) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-yakow-herd) - (game-text-id village1-yakow-herd) - (game-text-id village1-yakow-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-oracle-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-oracle-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id beach-level-name) - :text-group-index 1 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task beach-ecorocks) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-ecorocks) - (game-text-id beach-ecorocks) - (game-text-id beach-ecorocks) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-flutflut) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-flutflut-push) - (game-text-id beach-flutflut-push) - (game-text-id beach-flutflut-meet) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-pelican) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-pelican) - (game-text-id beach-pelican) - (game-text-id beach-pelican) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-seagull) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-seagull) - (game-text-id beach-seagull) - (game-text-id beach-seagull-get) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-cannon) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-cannon) - (game-text-id beach-cannon) - (game-text-id beach-cannon) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-gimmie) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-gimmie) - (game-text-id beach-gimmie) - (game-text-id beach-gimmie) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-sentinel) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-sentinel) - (game-text-id beach-sentinel) - (game-text-id beach-sentinel) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id jungle-level-name) - :text-group-index 1 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task jungle-lurkerm) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-lurkerm-unblock) - (game-text-id jungle-lurkerm-connect) - (game-text-id jungle-lurkerm-return) - (game-text-id zero) - ) - :text-index-when-resolved 1 - ) - (new 'static 'task-info-data - :task-id (game-task jungle-tower) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-tower) - (game-text-id jungle-tower) - (game-text-id jungle-tower) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-eggtop) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-eggtop) - (game-text-id jungle-eggtop) - (game-text-id jungle-eggtop) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-plant) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-plant) - (game-text-id jungle-plant) - (game-text-id jungle-plant) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-fishgame) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-fishgame) - (game-text-id jungle-fishgame) - (game-text-id jungle-fishgame) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-canyon-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-canyon-end) - (game-text-id jungle-canyon-end) - (game-text-id jungle-canyon-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-temple-door) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-temple-door) - (game-text-id jungle-temple-door) - (game-text-id jungle-temple-door) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id misty-level-name) - :text-group-index 1 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task misty-muse) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-muse-catch) - (game-text-id misty-muse-catch) - (game-text-id misty-muse-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-boat) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-boat) - (game-text-id misty-boat) - (game-text-id misty-boat) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-cannon) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-cannon) - (game-text-id misty-cannon) - (game-text-id misty-cannon) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-warehouse) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-return-to-pool) - (game-text-id misty-return-to-pool) - (game-text-id misty-return-to-pool) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-bike) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-find-transpad) - (game-text-id misty-balloon-lurkers) - (game-text-id misty-find-transpad) - (game-text-id zero) - ) - :text-index-when-resolved 1 - ) - (new 'static 'task-info-data - :task-id (game-task misty-bike-jump) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-bike-jump) - (game-text-id misty-bike-jump) - (game-text-id misty-bike-jump) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-eco-challenge) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-eco-challenge) - (game-text-id misty-eco-challenge) - (game-text-id misty-eco-challenge) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id fire-canyon-level-name) - :text-group-index 5 - :nb-of-tasks 2 - :buzzer-task-index 1 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task firecanyon-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id fire-canyon-end) - (game-text-id fire-canyon-end) - (game-text-id fire-canyon-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task firecanyon-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id fire-canyon-buzzer) - (game-text-id fire-canyon-buzzer) - (game-text-id fire-canyon-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id village2-level-name) - :text-group-index 2 - :nb-of-tasks 6 - :buzzer-task-index 5 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task village2-gambler-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-gambler-money) - (game-text-id village2-gambler-money) - (game-text-id village2-gambler-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-geologist-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-geologist-money) - (game-text-id village2-geologist-money) - (game-text-id village2-geologist-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-warrior-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-warrior-money) - (game-text-id village2-warrior-money) - (game-text-id village2-warrior-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-oracle-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-oracle-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id sunken-level-name) - :text-group-index 2 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task sunken-room) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-elevator-raise) - (game-text-id sunken-elevator-raise) - (game-text-id sunken-elevator-get-to-roof) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-pipe) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-pipe) - (game-text-id sunken-pipe) - (game-text-id sunken-pipe) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-slide) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-bottom) - (game-text-id sunken-bottom) - (game-text-id sunken-bottom) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-sharks) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-pool) - (game-text-id sunken-pool) - (game-text-id sunken-pool) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-platforms) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-platforms) - (game-text-id sunken-platforms) - (game-text-id sunken-platforms) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-top-of-helix) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-climb-tube) - (game-text-id sunken-climb-tube) - (game-text-id sunken-climb-tube) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-spinning-room) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id reach-center) - (game-text-id reach-center) - (game-text-id reach-center) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id swamp-level-name) - :text-group-index 2 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task swamp-flutflut) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-flutflut) - (game-text-id swamp-flutflut) - (game-text-id swamp-flutflut) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-billy) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-billy) - (game-text-id swamp-billy) - (game-text-id swamp-billy) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-battle) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-battle) - (game-text-id swamp-battle) - (game-text-id swamp-battle) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-4) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-3) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id rolling-level-name) - :text-group-index 2 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task rolling-moles) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-moles) - (game-text-id rolling-moles) - (game-text-id rolling-moles-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-robbers) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-robbers) - (game-text-id rolling-robbers) - (game-text-id rolling-robbers) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-race) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-race) - (game-text-id rolling-race) - (game-text-id rolling-race-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-lake) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-lake) - (game-text-id rolling-lake) - (game-text-id rolling-lake) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-plants) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-plants) - (game-text-id rolling-plants) - (game-text-id rolling-plants) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-ring-chase-1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-ring-chase-1) - (game-text-id rolling-ring-chase-1) - (game-text-id rolling-ring-chase-1) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-ring-chase-2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-ring-chase-2) - (game-text-id rolling-ring-chase-2) - (game-text-id rolling-ring-chase-2) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id ogre-level-name) - :text-group-index 6 - :nb-of-tasks 4 - :buzzer-task-index 3 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task ogre-boss) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id ogre-boss) - (game-text-id ogre-boss) - (game-text-id ogre-boss) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task ogre-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id ogre-end) - (game-text-id ogre-end) - (game-text-id ogre-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task ogre-secret) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task ogre-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id ogre-buzzer) - (game-text-id ogre-buzzer) - (game-text-id ogre-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id village3-level-name) - :text-group-index 3 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task village3-miner-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-miner-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-miner-money3) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-miner-money4) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-oracle-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-oracle-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-extra1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id snowy-level-name) - :text-group-index 3 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task snow-eggtop) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-eggtop) - (game-text-id snow-eggtop) - (game-text-id snow-eggtop) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-ram) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-ram-3-left) - (game-text-id snow-ram-2-left) - (game-text-id snow-ram-1-left) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-bumpers) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-bumpers) - (game-text-id snow-bumpers) - (game-text-id snow-bumpers) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-cage) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-frozen-crate) - (game-text-id snow-frozen-crate) - (game-text-id snow-frozen-crate) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-fort) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-fort) - (game-text-id snow-fort) - (game-text-id snow-fort) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-ball) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-open-door) - (game-text-id snow-open-door) - (game-text-id snow-open-door) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-bunnies) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-bunnies) - (game-text-id snow-bunnies) - (game-text-id snow-bunnies) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id cave-level-name) - :text-group-index 3 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task cave-gnawers) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-gnawers) - (game-text-id cave-gnawers) - (game-text-id cave-gnawers) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-dark-crystals) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-dark-crystals) - (game-text-id cave-dark-crystals) - (game-text-id cave-dark-crystals) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-dark-climb) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-dark-climb) - (game-text-id cave-dark-climb) - (game-text-id cave-dark-climb) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-robot-climb) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-robot-climb) - (game-text-id cave-robot-climb) - (game-text-id cave-robot-climb) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-swing-poles) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-swing-poles) - (game-text-id cave-swing-poles) - (game-text-id cave-swing-poles) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-spider-tunnel) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-spider-tunnel) - (game-text-id cave-spider-tunnel) - (game-text-id cave-spider-tunnel) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-platforms) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-platforms) - (game-text-id cave-platforms) - (game-text-id cave-platforms) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id lavatube-level-name) - :text-group-index 3 - :nb-of-tasks 2 - :buzzer-task-index 1 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task lavatube-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id lavatube-end) - (game-text-id lavatube-end) - (game-text-id lavatube-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task lavatube-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id lavatube-buzzer) - (game-text-id lavatube-buzzer) - (game-text-id lavatube-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id citadel-level-name) - :text-group-index 4 - :nb-of-tasks 5 - :buzzer-task-index 4 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task citadel-sage-blue) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-blue) - (game-text-id citadel-sage-blue) - (game-text-id citadel-sage-blue) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-sage-red) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-red) - (game-text-id citadel-sage-red) - (game-text-id citadel-sage-red) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-sage-yellow) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-yellow) - (game-text-id citadel-sage-yellow) - (game-text-id citadel-sage-yellow) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-sage-green) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-green) - (game-text-id citadel-sage-green) - (game-text-id citadel-sage-green) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-buzzer) - (game-text-id citadel-buzzer) - (game-text-id citadel-buzzer) - (game-text-id zero) - ) - ) - ) - ) - ) - ) - -;; goes down by 24 or 23 every time -(define *task-egg-starting-x* - (new 'static 'boxed-array :type int32 :length 9 :allocated-length 9 - 218 - 194 - 171 - 147 - 124 - 100 - 77 - 53 - 30 - ) - ) - -(define *game-counts* (the-as game-count-info #f)) - - - - diff --git a/goal_src/pc/engine/ui/progress/progress.gc b/goal_src/pc/engine/ui/progress/progress.gc deleted file mode 100644 index 1fd0ac0f71..0000000000 --- a/goal_src/pc/engine/ui/progress/progress.gc +++ /dev/null @@ -1,2762 +0,0 @@ -;;-*-Lisp-*- -(in-package goal) - -;; name: progress.gc -;; name in dgo: progress -;; dgos: GAME, ENGINE - -;; DECOMP BEGINS - -(deftype progress-global-state (basic) - ((aspect-ratio-choice symbol :offset-assert 4) - (video-mode-choice symbol :offset-assert 8) - (yes-no-choice symbol :offset-assert 12) - (which int32 :offset-assert 16) - (starting-state progress-screen :offset-assert 24) - (last-slot-saved int32 :offset-assert 32) - (slider-backup float :offset-assert 36) - (language-backup int64 :offset-assert 40) - (on-off-backup symbol :offset-assert 48) - (center-x-backup int32 :offset-assert 52) - (center-y-backup int32 :offset-assert 56) - (aspect-ratio-backup symbol :offset-assert 60) - (last-slider-sound time-frame :offset-assert 64) - ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 - ) - -(define *progress-state* - (new 'static 'progress-global-state - :yes-no-choice #f - :which -1 - :last-slot-saved -1 - ) - ) - - -(defun get-game-count ((arg0 int)) - (-> *game-counts* data arg0) - ) - -(defun progress-allowed? () - (not (or (-> *setting-control* current talking) - (-> *setting-control* current movie) - (movie?) - (handle->process (-> *game-info* pov-camera-handle)) - (handle->process (-> *game-info* other-camera-handle)) - (< (-> *display* base-frame-counter) (-> *game-info* letterbox-time)) - (< (-> *display* base-frame-counter) (-> *game-info* blackout-time)) - (!= (-> *setting-control* current bg-a) 0.0) - (!= (-> *setting-control* current bg-a-force) 0.0) - (not (-> *setting-control* current allow-progress)) - (or (and (handle->process (-> *game-info* auto-save-proc)) - (not (send-event (handle->process (-> *game-info* auto-save-proc)) 'progress-allowed?)) - ) - (not *target*) - ) - ) - ) - ) - -(defun pause-allowed? () - (not (or (< (-> *display* base-frame-counter) (-> *game-info* blackout-time)) - (!= (-> *setting-control* current bg-a) 0.0) - (!= (-> *setting-control* current bg-a-force) 0.0) - (not (-> *setting-control* current allow-pause)) - (handle->process (-> *game-info* auto-save-proc)) - (not *target*) - ) - ) - ) - -(defun init-game-options ((obj progress)) - "Set the options for all of the menus." - - ;; start off by making them all invalid - (dotimes (i (-> *options-remap* allocated-length)) - (set! (-> *options-remap* i) #f) - ) - - ;; main menu - (set! (-> *options-remap* 3) - (case *kernel-boot-message* - (('demo) - ;; game demo - *main-options-demo* - ) - (('demo-shared) - ;; game demo with external launcher - *main-options-demo-shared* - ) - (else - ;; normal game - *main-options* - ) - ) - ) - (set! (-> *options-remap* 4) - (cond - ((!= *kernel-boot-message* 'play) - (if (= (scf-get-territory) GAME_TERRITORY_SCEE) - *game-options* - *game-options-demo* - ) - ) - ((and (= (scf-get-territory) GAME_TERRITORY_SCEI) - (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))) - ;; if ntsc-j and we're not using language cheat (needs l2+r2) - *game-options-japan* - ) - (else - *game-options* - ) - ) - ) - (set! (-> *options-remap* 5) - (if (and (= (-> *progress-state* starting-state) 27) - (or (= (scf-get-territory) GAME_TERRITORY_SCEE) - (and (= *progress-cheat* 'pal) - (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l2)) - (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons r2)) - ) - ) - ) - ;; (only if we came from title) if PAL or we're using the PAL cheat (needs l2+r2) - *graphic-title-options-pal* - *graphic-options* - ) - ) - (set! (-> *options-remap* 6) *sound-options*) - (set! (-> *options-remap* 7) *ok-options*) - (set! (-> *options-remap* 8) *ok-options*) - (set! (-> *options-remap* 9) *ok-options*) - (set! (-> *options-remap* 10) *yes-no-options*) - (set! (-> *options-remap* 11) *yes-no-options*) - (set! (-> *options-remap* 19) *ok-options*) - (set! (-> *options-remap* 16) *load-options*) - (set! (-> *options-remap* 17) *save-options*) - (set! (-> *options-remap* 18) *save-options-title*) - (set! (-> *options-remap* 20) *ok-options*) - (set! (-> *options-remap* 21) *ok-options*) - (set! (-> *options-remap* 24) *ok-options*) - (set! (-> *options-remap* 25) *ok-options*) - (set! (-> *options-remap* 26) *ok-options*) - (set! (-> *options-remap* 22) *ok-options*) - (set! (-> *options-remap* 23) *yes-no-options*) - (set! (-> *options-remap* 27) *title*) - (set! (-> *options-remap* 28) *options*) - (set! (-> *options-remap* 29) *ok-options*) - (set! (-> *options-remap* 30) *yes-no-options*) - (set! (-> *options-remap* 31) *yes-no-options*) - (set! (-> *options-remap* 32) *ok-options*) - (set! (-> *options-remap* 33) *ok-options*) - (set! (-> *options-remap* 34) *yes-no-options*) - (set! (-> *progress-state* video-mode-choice) (get-video-mode)) - (set! (-> *progress-state* yes-no-choice) #f) - (set! (-> *game-options* 0 value-to-modify) (&-> *setting-control* default vibration)) - (set! (-> *game-options* 1 value-to-modify) (&-> *setting-control* default play-hints)) - (set! (-> *game-options-japan* 0 value-to-modify) (&-> *setting-control* default vibration)) - (set! (-> *game-options-japan* 1 value-to-modify) (&-> *setting-control* default play-hints)) - (set! (-> *game-options-demo* 0 value-to-modify) (&-> *setting-control* default vibration)) - (set! (-> *game-options-demo* 1 value-to-modify) (&-> *setting-control* default play-hints)) - (set! (-> *graphic-title-options-pal* 1 value-to-modify) (&-> *progress-state* video-mode-choice)) - (set! (-> *graphic-title-options-pal* 2 value-to-modify) (&-> *progress-state* aspect-ratio-choice)) - (set! (-> *sound-options* 0 value-to-modify) (&-> *setting-control* default sfx-volume)) - (set! (-> *sound-options* 1 value-to-modify) (&-> *setting-control* default music-volume)) - (set! (-> *sound-options* 2 value-to-modify) (&-> *setting-control* default dialog-volume)) - (set! (-> *yes-no-options* 0 value-to-modify) (&-> *progress-state* yes-no-choice)) - - ;; new stuff - (set! (-> *options-remap* 35) *language-options*) - (set! (-> *game-options* 3 value-to-modify) (&-> *pc-settings* discord-rpc?)) - (set! (-> *language-options* 0 value-to-modify) (&-> *setting-control* default language)) - (set! (-> *language-options* 1 value-to-modify) (&-> *pc-settings* subtitles?)) - (set! (-> *language-options* 2 value-to-modify) (&-> *pc-settings* subtitle-language)) - (set! (-> *language-options* 3 value-to-modify) (&-> *pc-settings* subtitle-speaker?)) ;; TODO - refactor this like i did with display-mode - (set! (-> *graphic-options* 0 value-to-modify) (&-> *progress-state* aspect-ratio-choice)) - (set! (-> *graphic-options* 1 value-to-modify) (&-> *pc-settings* display-mode)) - (set! (-> *graphic-options* 2 value-to-modify) (&-> *pc-settings* aspect-ratio-mode)) - (set! (-> *graphic-options* 3 value-to-modify) (&-> *pc-settings* resolution)) - (set! (-> *graphic-options* 4 value-to-modify) (&-> *pc-settings* letterbox?)) - - (none) - ) - -(defun make-current-level-available-to-progress () - "exactly what it says on the tin." - - (when (and *target* (-> *level* border?)) - (let* ((cur-lev (-> *target* current-level)) - (lev-idx (+ (-> cur-lev info index) -1)) - ) - (if (and (>= lev-idx 0) - (< lev-idx (-> *level-task-data-remap* length)) - (zero? (-> *game-info* level-opened (-> *level-task-data-remap* lev-idx))) - (or (= *kernel-boot-message* 'play) (= (-> cur-lev nickname) 'mis)) - ) - (set! (-> *game-info* level-opened (-> *level-task-data-remap* lev-idx)) (the-as uint 1)) - ) - ) - ) - 0 - (none) - ) - -(defun make-levels-with-tasks-available-to-progress () - "Open levels that have tasks to do!" - - ;; go through EVERY LEVEL'S TASKS - (dotimes (i (length *level-task-data*)) - ;; level tasks - (let ((tasks (-> *level-task-data* i))) - ;; unless there's no tasks or the level is already open... - (unless (or (= tasks #f) (= (-> *game-info* level-opened i) 1)) - (cond - ((!= *kernel-boot-message* 'play) - (if (= (-> tasks level-name-id) (game-text-id misty-level-name)) - (set! (-> *game-info* level-opened i) (the-as uint 1)) - ) - ) - (*cheat-mode* - (set! (-> *game-info* level-opened i) (the-as uint 1)) - ) - (else - (dotimes (ii (-> tasks nb-of-tasks)) - (if (and (zero? (-> *game-info* level-opened ii)) - (!= ii (-> tasks buzzer-task-index)) - (task-known? (-> tasks task-info ii task-id)) - ) - (set! (-> *game-info* level-opened ii) (the-as uint 1)) - ) - ) - ) - ) - ) - ) - ) - 0 - (none) - ) - -(defun get-next-task-up ((cur-task-idx int) (lev-idx int)) - "find next available task. skips over unknown tasks and doesn't do anything if none are found" - - (let ((gp-0 cur-task-idx)) - (let ((s4-0 (+ cur-task-idx 1)) - (s3-0 (-> *level-task-data* lev-idx)) - ) - (while (and (< s4-0 (-> s3-0 nb-of-tasks)) (= gp-0 cur-task-idx)) - (if (or *cheat-mode* (task-known? (-> s3-0 task-info s4-0 task-id))) - (set! gp-0 s4-0) - ) - (+! s4-0 1) - ) - ) - gp-0 - ) - ) - -(defun get-next-task-down ((cur-task-idx int) (lev-idx int)) - "find previous available task. skips over unknown tasks and doesn't do anything if none are found" - - (let ((gp-0 cur-task-idx)) - (let ((s4-0 (+ cur-task-idx -1)) - (s3-0 (-> *level-task-data* lev-idx)) - ) - (while (and (>= s4-0 0) (= gp-0 cur-task-idx)) - (if (or *cheat-mode* (task-known? (-> s3-0 task-info s4-0 task-id))) - (set! gp-0 s4-0) - ) - (+! s4-0 -1) - ) - ) - gp-0 - ) - ) - -(defun get-next-level-up ((lev-idx int)) - (let ((gp-0 lev-idx)) - (let ((s4-0 (+ lev-idx 1))) - (while (and (< s4-0 (length *level-task-data*)) (= gp-0 lev-idx)) - (if (= (-> *game-info* level-opened s4-0) 1) - (set! gp-0 s4-0) - ) - (+! s4-0 1) - ) - ) - gp-0 - ) - ) - -(defun get-next-level-down ((lev-idx int)) - (let ((v0-0 lev-idx)) - (let ((v1-0 (+ lev-idx -1))) - (while (and (>= v1-0 0) (= v0-0 lev-idx)) - (if (= (-> *game-info* level-opened v1-0) 1) - (set! v0-0 v1-0) - ) - (+! v1-0 -1) - ) - ) - v0-0 - ) - ) - -(defun calculate-completion ((the-progress progress)) - "Updates counters and calculates game completion. - Cells are tallied 80% - Buzzers are tallied 10% - Orbs are tallied 10%" - - (local-vars - (current-cells int) - (current-buzzers int) - (current-orbs int) - (total-cells int) - (total-buzzers int) - (total-orbs int) - ) - (set! current-cells 0) - (set! current-buzzers 0) - (set! current-orbs 0) - (set! total-cells 0) - (set! total-buzzers 0) - (set! total-orbs 0) - (dotimes (s5-0 (length *level-task-data*)) - (let ((s4-0 (-> *level-task-data* s5-0))) - (when (!= s4-0 #f) - (when (or (= *kernel-boot-message* 'play) (= (-> s4-0 level-name-id) (game-text-id misty-level-name))) - (dotimes (s3-0 (-> s4-0 nb-of-tasks)) - (if (= (get-task-status (-> s4-0 task-info s3-0 task-id)) (task-status invalid)) - (set! current-cells (+ current-cells 1)) - ) - ) - (set! total-cells (+ total-cells (-> s4-0 nb-of-tasks))) - (set! current-orbs (+ current-orbs (-> *game-info* money-per-level s5-0))) - (set! total-orbs (+ total-orbs (-> *game-counts* data s5-0 money-count))) - (let ((v1-20 (-> s4-0 buzzer-task-index))) - (when (!= v1-20 -1) - (set! current-buzzers (+ current-buzzers (buzzer-count *game-info* (-> s4-0 task-info v1-20 task-id)))) - (set! total-buzzers (+ total-buzzers (-> *game-counts* data s5-0 buzzer-count))) - ) - ) - ) - ) - ) - ) - (when the-progress - (set! (-> the-progress total-nb-of-power-cells) total-cells) - (set! (-> the-progress total-nb-of-buzzers) total-buzzers) - (set! (-> the-progress total-nb-of-orbs) total-orbs) - ) - (+ (/ (* 80.0 (the float current-cells)) (the float total-cells)) - (/ (* 10.0 (the float current-orbs)) (the float total-orbs)) - (/ (* 10.0 (the float current-buzzers)) (the float total-buzzers)) - ) - ) - -(define *progress-save-info* (new 'global 'mc-slot-info)) - -(defmacro progress-make-manipy-icon (obj &key skel - &key x - &key y - &key z - &key scale-x - &key scale-y - ) - `(when (< (-> ,obj nb-of-icons) 6) - (let ((icon-idx (-> ,obj nb-of-icons))) - (set! (-> ,obj icons icon-idx) (new 'static 'hud-icon)) - (let ((new-manipy (make-init-process manipy manipy-init (new 'static 'vector :w 1.0) #f ,skel #f - :to ,obj - :stack *scratch-memory-top* - ))) - (when new-manipy - (set! (-> (-> new-manipy) draw dma-add-func) dma-add-process-drawable-hud) - (set-vector! (-> (-> new-manipy) root trans) 0.0 0.0 0.0 1.0) - (set-vector! (-> (-> new-manipy) root scale) ,scale-x ,scale-y ,scale-x 1.0) - (when #f - (send-event (ppointer->process new-manipy) 'trans-hook #f) - ) - ) - (set! (-> ,obj icons icon-idx icon) new-manipy) - (when new-manipy - (logior! (-> new-manipy 0 mask) (process-mask pause)) - (logclear! (-> new-manipy 0 mask) (process-mask menu progress)) - (set! (-> (-> new-manipy) root trans z) ,z) - (set! (-> ,obj icons icon-idx icon-x) ,x) - (set! (-> ,obj icons icon-idx icon-y) ,y) - (set! (-> ,obj icons icon-idx icon-z) 0) - (set! (-> ,obj icons icon-idx scale-x) ,scale-x) - (set! (-> ,obj icons icon-idx scale-y) ,scale-y) - ) - ) - ) - (+! (-> ,obj nb-of-icons) 1) - ) - ) - -(defmethod initialize-icons progress ((obj progress)) - (progress-make-manipy-icon obj :skel *fuelcell-naked-sg* - :x 256 - :y 77 - :z (meters 0.5) - :scale-x 0.006 - :scale-y 0.006 - ) - (progress-make-manipy-icon obj :skel *fuelcell-naked-sg* - :x 256 - :y 77 - :z (meters 0.5) - :scale-x 0.006 - :scale-y 0.006 - ) - (progress-make-manipy-icon obj :skel *fuelcell-naked-sg* - :x 256 - :y 77 - :z (meters 0.5) - :scale-x 0.006 - :scale-y 0.006 - ) - (progress-make-manipy-icon obj :skel *fuelcell-naked-sg* - :x 256 - :y 77 - :z (meters 0.5) - :scale-x 0.006 - :scale-y 0.006 - ) - (progress-make-manipy-icon obj :skel *money-sg* - :x -320 - :y 253 - :z (meters 17) - :scale-x 0.013 - :scale-y -0.015 - ) - (progress-make-manipy-icon obj :skel *money-sg* - :x -320 - :y 253 - :z (meters 0.25) - :scale-x 0.008 - :scale-y -0.009 - ) - (send-event (ppointer->process (-> obj icons 1 icon)) 'set-frame-num 2.5) - (send-event (ppointer->process (-> obj icons 2 icon)) 'set-frame-num 10.0) - (send-event (ppointer->process (-> obj icons 3 icon)) 'set-frame-num 15.5) - 0 - (none) - ) - -(defmethod enter! progress ((obj progress) (screen progress-screen) (option int)) - (when (!= (-> obj display-state) screen) - (set! (-> *progress-state* yes-no-choice) #f) - (set! (-> obj selected-option) #f) - (set! (-> obj option-index) option) - (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) - (set! (-> obj display-state) screen) - (set! (-> obj next-display-state) screen) - (set-transition-speed! obj) - (case (-> obj display-state) - (((progress-screen memcard-creating)) - (auto-save-command 'create-file 0 0 obj) - ) - (((progress-screen memcard-loading)) - (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which)) - (sound-volume-off) - (auto-save-command 'restore 0 (-> *progress-state* which) obj) - ) - (((progress-screen memcard-saving)) - (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which)) - (auto-save-command 'save 0 (-> *progress-state* which) obj) - ) - (((progress-screen memcard-formatting)) - (auto-save-command 'format-card 0 0 obj) - ) - (((progress-screen save-game) (progress-screen load-game)) - (set! (-> obj option-index) (max 0 (-> *progress-state* last-slot-saved))) - ) - (((progress-screen memcard-removed)) - (set! (-> *progress-state* last-slot-saved) 0) - 0 - ) - ) - ) - 0 - (none) - ) - -(defmethod push! progress ((obj progress)) - (let ((v1-0 (-> obj display-state-pos))) - (cond - ((< v1-0 5) - (set! (-> obj display-state-stack v1-0) (-> obj display-state)) - (set! (-> obj option-index-stack v1-0) (-> obj option-index)) - (set! (-> obj display-state-pos) (+ v1-0 1)) - ) - (else - (format #t "ERROR: Can't push any more states on the display-state-stack.~%") - ) - ) - ) - 0 - (none) - ) - -(defmethod pop! progress ((obj progress)) - (let ((v1-0 (-> obj display-state-pos))) - (cond - ((> v1-0 0) - (let ((a2-0 (+ v1-0 -1))) - (set! (-> obj display-state-pos) a2-0) - (enter! obj (-> obj display-state-stack a2-0) (-> obj option-index-stack a2-0)) - ) - ) - (else - (set-master-mode 'game) - ) - ) - ) - 0 - (none) - ) - -(defmethod set-transition-progress! progress ((obj progress) (arg0 int)) - (set! (-> obj transition-offset) arg0) - (set! (-> obj transition-offset-invert) (- 512 arg0)) - (set! (-> obj transition-percentage) (* 0.001953125 (the float arg0))) - (set! (-> obj transition-percentage-invert) (- 1.0 (-> obj transition-percentage))) - 0 - (none) - ) - -(defmethod set-transition-speed! progress ((obj progress)) - (case (-> obj display-state) - (((progress-screen fuel-cell) - (progress-screen money) - (progress-screen buzzer) - (progress-screen load-game) - (progress-screen save-game) - (progress-screen save-game-title) - ) - (set! (-> obj transition-speed) 15.0) - ) - (else - (set! (-> obj transition-speed) 45.0) - ) - ) - 0 - (none) - ) - -(defbehavior progress-init-by-other progress () - (logclear! (-> self mask) (process-mask menu progress)) - (set! (-> self nb-of-particles) 0) - (set! (-> self max-nb-of-particles) 40) - (set! (-> self nb-of-icons) 0) - (set! (-> self in-out-position) 4096) - (set! (-> self current-debug-string) 0) - (set! (-> self current-debug-group) 0) - (set! (-> self display-level-index) 0) - (set! (-> self next-level-index) 0) - (set! (-> self option-index) 0) - (set! (-> self selected-option) #f) - (set! (-> self card-info) #f) - (set! (-> self last-option-index-change) (-> *display* real-frame-counter)) - (set! (-> self display-state-pos) 0) - (set! (-> self in-transition) #f) - (set! (-> self force-transition) #f) - (set! (-> self stat-transition) #f) - (set! (-> self level-transition) 0) - (set! (-> self left-side-x-scale) 0.0) - (set! (-> self left-side-y-scale) 0.0) - (set! (-> self right-side-x-scale) 0.0) - (set! (-> self right-side-y-scale) 0.0) - (dotimes (v1-6 5) - (set! (-> self display-state-stack v1-6) (progress-screen fuel-cell)) - ) - (init-game-options self) - (initialize-icons self) - (initialize-particles self) - (set! (-> self particle-state 0) 0) - (set! (-> self particle-state 1) 0) - (set! (-> self particle-state 2) 0) - (set! (-> self particle-state 3) 0) - (set! (-> self particle-state 4) 0) - (set! (-> self particle-state 5) 0) - (set! (-> self particle-state 6) 1) - (set! (-> self particle-state 7) 1) - (set! (-> self particle-state 8) 1) - (set! (-> self particle-state 9) 1) - (set! (-> self particle-state 10) 1) - (set! (-> self particle-state 11) 1) - (set! (-> self particle-state 12) 1) - (set! (-> self particle-state 13) 1) - (set! (-> self particle-state 14) 0) - (set! (-> self particle-state 15) 0) - (set! (-> self particle-state 16) 3) - (set! (-> self particle-state 17) 0) - (set! (-> self particle-state 18) 0) - (set! (-> self particle-state 19) 0) - (set! (-> self particle-state 20) 0) - (set! (-> self particle-state 21) 0) - (set! (-> self particle-state 22) 0) - (set! (-> self particle-state 23) 0) - (set! (-> self particle-state 24) 0) - (set! (-> self particle-state 25) 0) - (set! (-> self particle-state 26) 0) - (set! (-> self particle-state 27) 0) - (set! (-> self particle-state 28) 0) - (set! (-> self particle-state 29) 0) - (set! (-> self particle-state 30) 0) - (set! (-> self particle-state 31) 0) - (let ((gp-0 (new 'stack-no-clear 'quaternion))) - (quaternion-axis-angle! gp-0 0.0 1.0 0.0 16384.0) - (quaternion*! (-> self icons 0 icon 0 root quat) gp-0 (-> self icons 0 icon 0 root quat)) - (quaternion-axis-angle! gp-0 0.0 1.0 0.0 32768.0) - (quaternion*! (-> self icons 1 icon 0 root quat) gp-0 (-> self icons 1 icon 0 root quat)) - (quaternion-axis-angle! gp-0 0.0 1.0 0.0 49152.0) - (quaternion*! (-> self icons 2 icon 0 root quat) gp-0 (-> self icons 2 icon 0 root quat)) - (quaternion-axis-angle! gp-0 0.0 1.0 0.0 0.0) - (quaternion*! (-> self icons 3 icon 0 root quat) gp-0 (-> self icons 3 icon 0 root quat)) - ) - (adjust-ratios self (get-aspect-ratio) (get-video-mode)) - (adjust-icons self) - (set! (-> self event-hook) (-> progress-waiting event)) - (go progress-waiting) - (none) - ) - -(define *progress-stack* (the-as (pointer uint8) (malloc 'global #x3800))) -(defconstant *progress-stack-top* (&-> *progress-stack* #x3800)) - -(defun activate-progress ((creator process) (screen progress-screen)) - (when *target* - (cond - ((not *progress-process*) - (when (progress-allowed?) - (hide-hud) - (make-levels-with-tasks-available-to-progress) - (disable-level-text-file-loading) - (set! (-> *progress-state* starting-state) screen) - (let ((s4-0 (get-process *default-dead-pool* progress #x4000))) - (set! *progress-process* - (the-as (pointer progress) (when s4-0 - (let ((t9-5 (method-of-type progress activate))) - (t9-5 (the-as progress s4-0) creator 'progress (&-> *progress-stack* 14336)) - ) - (run-now-in-process s4-0 progress-init-by-other) - (-> s4-0 ppointer) - ) - ) - ) - ) - (let ((s5-1 *progress-process*)) - (set! (-> s5-1 0 completion-percentage) (calculate-completion (-> s5-1 0))) - (set! *master-mode* 'progress) - (let ((s4-1 (-> *target* current-level))) - (cond - ((!= *kernel-boot-message* 'play) - (set! (-> s5-1 0 display-level-index) 4) - ) - ((or (= s4-1 #f) (< (length *level-task-data-remap*) (-> s4-1 info index))) - (set! (-> s5-1 0 display-level-index) 0) - 0 - ) - (else - (set! (-> s5-1 0 display-level-index) (-> *level-task-data-remap* (+ (-> s4-1 info index) -1))) - ) - ) - ) - (set! (-> s5-1 0 next-level-index) (-> s5-1 0 display-level-index)) - (set! (-> s5-1 0 display-state) (progress-screen invalid)) - (set-transition-progress! (-> s5-1 0) 512) - (set! (-> s5-1 0 task-index) (get-next-task-up -1 (-> s5-1 0 display-level-index))) - ) - ) - (when *progress-process* - (enter! (-> *progress-process* 0) screen 0) - (set! (-> *progress-process* 0 card-info) #f) - ) - ) - (else - (push! (-> *progress-process* 0)) - (set! (-> *progress-process* 0 next-display-state) screen) - (set! (-> *progress-process* 0 card-info) #f) - ) - ) - ) - 0 - (none) - ) - -(defun deactivate-progress () - (when (and *progress-process* (= (-> *progress-process* 0 next-state name) 'progress-gone)) - (copy-settings-from-target! *setting-control*) - (dotimes (gp-0 (-> *progress-process* 0 nb-of-particles)) - (kill-and-free-particles (-> *progress-process* 0 particles gp-0 part)) - (set! (-> *progress-process* 0 particles gp-0 part matrix) -1) - ) - (set! (-> *progress-process* 0 nb-of-particles) 0) - (deactivate (-> *progress-process* 0)) - (set! *progress-process* (the-as (pointer progress) #f)) - (enable-level-text-file-loading) - ) - 0 - (none) - ) - -(defun hide-progress-screen () - "shoo!" - - (if *progress-process* - (send-event (ppointer->process *progress-process*) 'go-away) - ) - 0 - (none) - ) - -(defun hide-progress-icons () - (let ((v1-0 6)) - (dotimes (a0-0 8) - (set! (-> *progress-process* 0 particles v1-0 init-pos x) -320.0) - (+! v1-0 1) - ) - ) - (set! (-> *progress-process* 0 particles 5 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 14 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 15 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 19 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 20 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 21 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 22 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 23 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 24 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 25 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 26 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 27 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 28 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 29 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 30 init-pos x) -320.0) - (set! (-> *progress-process* 0 particles 31 init-pos x) -320.0) - (set! (-> *progress-process* 0 icons 4 icon-x) -320) - 0 - (none) - ) - -(defmethod relocate game-count-info ((obj game-count-info) (arg0 int)) - "Load in the game-count-info. This is a bit of a hack." - (set! *game-counts* obj) - ) - -(defmethod relocate progress ((obj progress) (arg0 int)) - (dotimes (v1-0 (-> obj nb-of-particles)) - (when (-> obj particles v1-0 part) - (if (nonzero? (-> obj particles v1-0 part)) - (set! (-> obj particles v1-0 part) - (the-as sparticle-launch-control (&+ (the-as pointer (-> obj particles v1-0 part)) arg0)) - ) - ) - ) - ) - (the-as progress ((method-of-type process relocate) obj arg0)) - ) - -(defmethod adjust-sprites progress ((obj progress)) - (let ((f0-1 (* (1/ METER_LENGTH) (the float (-> obj in-out-position))))) - (set! (-> obj particles 2 init-pos x) (the float (+ (-> obj right-x-offset) 409 (the int (* 301.5 f0-1))))) - (set! (-> obj particles 1 init-pos x) (the float (+ (-> obj left-x-offset) 59))) - (set! (-> obj left-side-x-scale) (meters (+ (/ 3.5 (-> obj sides-x-scale)) (* 10.0 f0-1)))) - (set! (-> obj left-side-y-scale) (meters (+ (-> obj sides-y-scale) (* 10.0 f0-1)))) - (set! (-> obj right-side-x-scale) (meters (+ (/ 6.0 (-> obj sides-x-scale)) (* 4.0 f0-1)))) - (set! (-> obj right-side-y-scale) (meters (+ (-> obj sides-y-scale) (* 4.0 f0-1)))) - ) - (dotimes (s5-0 (-> obj nb-of-particles)) - (set! (-> obj particles s5-0 pos x) (+ -256.0 (-> obj particles s5-0 init-pos x))) - (set! (-> obj particles s5-0 pos y) - (* 0.5 (- (* (-> obj particles s5-0 init-pos y) (-> *video-parms* relative-y-scale)) - (the float (-> *video-parms* screen-sy)) - ) - ) - ) - (set! (-> obj particles s5-0 pos z) (-> obj particles s5-0 init-pos z)) - (if (> (-> obj particles s5-0 part matrix) 0) - (set-vector! (sprite-get-user-hvdf (-> obj particles s5-0 part matrix)) - (the float (+ (the int (-> obj particles s5-0 pos x)) 2048)) - (the float (+ (the int (-> obj particles s5-0 pos y)) 2048)) - (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> obj particles s5-0 pos z))) - (-> *math-camera* hvdf-off w) - ) - ) - (spawn (-> obj particles s5-0 part) *null-vector*) - ) - 0 - (none) - ) - -(defmethod adjust-icons progress ((obj progress)) - (dotimes (v1-0 (-> obj nb-of-icons)) - (when (>= v1-0 4) - (set-vector! (-> obj icons v1-0 icon 0 root scale) - (* (-> obj icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) - (* (-> obj icons v1-0 scale-y) (-> *video-parms* relative-y-scale)) - (* (-> obj icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) - 1.0 - ) - (set! (-> obj icons v1-0 icon 0 root trans x) (the float (+ (-> obj icons v1-0 icon-x) -256))) - (set! (-> obj icons v1-0 icon 0 root trans y) - (* (-> *video-parms* relative-y-scale) - (- (* (-> *video-parms* relative-y-scale) (the float (-> obj icons v1-0 icon-y))) - (the float (-> *video-parms* screen-sy)) - ) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod adjust-ratios progress ((obj progress) (aspect symbol) (video-mode symbol)) - (case aspect - (('aspect4x3) - (set! (-> obj sides-x-scale) 1.0) - (set! (-> obj sides-y-scale) 13.0) - (set! (-> obj left-x-offset) 0) - (set! (-> obj right-x-offset) 0) - (set! (-> obj button-scale) 1.0) - (set! (-> obj slot-scale) 8192.0) - (set! (-> obj small-orb-y-offset) 58) - (set! (-> obj icons 5 scale-x) 0.008) - (set! (-> obj icons 5 scale-y) -0.009) - (set! (-> obj big-orb-y-offset) 243) - (set! (-> obj icons 4 scale-x) 0.013) - (set! (-> obj icons 4 scale-y) -0.015) - ) - (('aspect16x9) - (set! (-> obj sides-x-scale) 1.2) - (set! (-> obj sides-y-scale) 9.8) - (set! (-> obj left-x-offset) -10) - (set! (-> obj right-x-offset) 17) - (set! (-> obj button-scale) 1.05) - (set! (-> obj slot-scale) 6144.0) - (set! (-> obj small-orb-y-offset) 59) - (set! (-> obj icons 5 scale-x) 0.008) - (set! (-> obj icons 5 scale-y) -0.0098) - (set! (-> obj big-orb-y-offset) 255) - (set! (-> obj icons 4 scale-x) 0.017) - (set! (-> obj icons 4 scale-y) -0.0205) - ) - ) - (when (= video-mode 'pal) - (set! (-> obj icons 5 scale-y) (* 1.15 (-> obj icons 5 scale-y))) - (set! (-> obj icons 4 scale-x) (* 1.05 (-> obj icons 4 scale-x))) - (set! (-> obj icons 4 scale-y) (* (-> obj icons 4 scale-y) (the-as float (if (= aspect 'aspect16x9) - 1.18 - 1.15 - ) - ) - ) - ) - (+! (-> obj big-orb-y-offset) (if (= aspect 'aspect16x9) - 3 - 2 - ) - ) - ) - 0 - (none) - ) - -(defmethod dummy-32 progress ((obj progress)) - (let ((v1-2 (-> *progress-process* 0 display-state)) - (a1-1 (-> *progress-state* starting-state)) - ) - (and (= (-> obj next-state name) 'progress-normal) - (not (-> obj in-transition)) - (not (-> obj selected-option)) - (or (= v1-2 (progress-screen fuel-cell)) - (= v1-2 (progress-screen money)) - (= v1-2 (progress-screen buzzer)) - (and (or (= a1-1 (progress-screen fuel-cell)) - (= a1-1 (progress-screen money)) - (= a1-1 (progress-screen buzzer)) - (= a1-1 (progress-screen title)) - ) - (or (= v1-2 (progress-screen settings)) - (= v1-2 (progress-screen game-settings)) - (= v1-2 (progress-screen graphic-settings)) - (= v1-2 (progress-screen sound-settings)) - (= v1-2 (progress-screen title)) - (= v1-2 (progress-screen settings-title)) - (= v1-2 (progress-screen language-options)) - ) - ) - ) - ) - ) - ) - -(defmethod dummy-19 progress ((obj progress)) - (the-as symbol (and *progress-process* (zero? (-> *progress-process* 0 in-out-position)))) - ) - -(defmethod hidden? progress ((obj progress)) - (or (not *progress-process*) (= (-> *progress-process* 0 in-out-position) 4096)) - ) - -(defstate progress-waiting (progress) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('go-away) - (go progress-gone) - ) - ) - ) - :code - (behavior () - (loop - (when (hud-hidden?) - (dotimes (gp-0 (-> self nb-of-particles)) - (if (= (-> self particles gp-0 part matrix) -1) - (set! (-> self particles gp-0 part matrix) (sprite-allocate-user-hvdf)) - ) - ) - (set-setting! *setting-control* self 'common-page 'set 0.0 1) - (suspend) - (go progress-coming-in) - ) - (suspend) - ) - (none) - ) - ) - -(defstate progress-gone (progress) - :code - (behavior () - (clear-pending-settings-from-process *setting-control* self 'process-mask) - (copy-settings-from-target! *setting-control*) - (logior! (-> self mask) (process-mask sleep)) - (suspend) - 0 - (none) - ) - ) - -(defmethod dummy-53 progress ((obj progress) (arg0 progress-screen)) - "Changes the next progress screen if need be for saving related reasons" - (let ((s4-0 (-> obj card-info)) - (gp-0 arg0) - ) - (when s4-0 - (case arg0 - (((progress-screen memcard-no-space) - (progress-screen memcard-not-inserted) - (progress-screen memcard-not-formatted) - ) - (cond - ((zero? (-> s4-0 handle)) - (set! gp-0 (progress-screen memcard-not-inserted)) - ) - ((zero? (-> s4-0 formatted)) - (cond - ((or (zero? (-> obj display-state-pos)) - (and (!= (-> *progress-state* starting-state) 27) (nonzero? (-> *progress-state* starting-state))) - ) - (set-master-mode 'game) - ) - (else - (if (!= arg0 (progress-screen memcard-not-formatted)) - (set! gp-0 (progress-screen memcard-format)) - ) - ) - ) - ) - ((and (zero? (-> s4-0 inited)) (< (-> s4-0 mem-actual) (-> s4-0 mem-required))) - (set! gp-0 (progress-screen memcard-no-space)) - ) - ((or (zero? (-> obj display-state-pos)) - (and (!= (-> *progress-state* starting-state) 27) (nonzero? (-> *progress-state* starting-state))) - ) - (set-master-mode 'game) - ) - (else - (set! gp-0 (progress-screen save-game)) - ) - ) - ) - (((progress-screen memcard-insert)) - (if (= (-> s4-0 inited) 1) - (set! gp-0 (progress-screen load-game)) - ) - ) - ) - (cond - ((zero? (-> s4-0 handle)) - (cond - ((-> *setting-control* current auto-save) - (set! gp-0 (progress-screen memcard-removed)) - ) - (else - (cond - ((= arg0 (progress-screen load-game)) - (set! gp-0 (progress-screen memcard-insert)) - ) - ((or (= arg0 (progress-screen memcard-format)) - (= arg0 (progress-screen memcard-no-space)) - (= arg0 (progress-screen memcard-not-formatted)) - (= arg0 (progress-screen save-game)) - (= arg0 (progress-screen save-game-title)) - (= arg0 (progress-screen memcard-no-data)) - (= arg0 (progress-screen memcard-data-exists)) - ) - (set! gp-0 (progress-screen memcard-not-inserted)) - ) - ) - ) - ) - ) - ((zero? (-> s4-0 formatted)) - (case arg0 - (((progress-screen load-game)) - (set! gp-0 (progress-screen memcard-insert)) - ) - (((progress-screen save-game) (progress-screen save-game-title)) - (set! gp-0 (progress-screen memcard-format)) - ) - ) - ) - ((zero? (-> s4-0 inited)) - (case arg0 - (((progress-screen save-game) (progress-screen save-game-title)) - (if (>= (-> s4-0 mem-actual) (-> s4-0 mem-required)) - (set! gp-0 (progress-screen memcard-no-data)) - (set! gp-0 (progress-screen memcard-no-space)) - ) - ) - (((progress-screen load-game)) - (set! gp-0 (progress-screen memcard-insert)) - ) - ) - ) - ) - ) - gp-0 - ) - ) - -(defmethod dummy-31 progress ((obj progress)) - (let ((s5-0 (-> obj card-info))) - (when (and s5-0 (not (-> obj in-transition))) - (when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (case (-> obj display-state) - (((progress-screen load-game)) - (cond - ((< (-> obj option-index) 4) - (when (nonzero? (-> s5-0 file (-> obj option-index) present)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> *progress-state* which) (-> obj option-index)) - (set! (-> obj next-display-state) (progress-screen memcard-loading)) - ) - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - (((progress-screen save-game) (progress-screen save-game-title)) - (cond - ((< (-> obj option-index) 4) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> *progress-state* which) (-> obj option-index)) - (if (zero? (-> s5-0 file (-> obj option-index) present)) - (set! (-> obj next-display-state) (progress-screen memcard-saving)) - (set! (-> obj next-display-state) (progress-screen memcard-data-exists)) - ) - ) - ((and (= (-> obj display-state) (progress-screen save-game-title)) (= (-> obj option-index) 4)) - (sound-play-by-name (static-sound-name "starts-options") (new-sound-id) 1024 0 0 1 #t) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set-master-mode 'game) - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - (((progress-screen memcard-insert)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - (((progress-screen memcard-data-exists)) - (cond - ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen memcard-saving)) - ) - ((begin - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (= (-> obj display-state-stack 0) (progress-screen title)) - ) - (set! (-> obj next-display-state) (progress-screen save-game-title)) - ) - (else - (set! (-> obj next-display-state) (progress-screen save-game)) - ) - ) - ) - (((progress-screen memcard-no-data)) - (cond - ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen memcard-creating)) - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set-master-mode 'game) - ) - ) - ) - (((progress-screen memcard-no-space) - (progress-screen memcard-not-inserted) - (progress-screen memcard-not-formatted) - ) - (cond - ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set-master-mode 'game) - ) - ((nonzero? (-> obj display-state-stack 0)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set-master-mode 'game) - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - (((progress-screen memcard-error-loading) - (progress-screen memcard-error-saving) - (progress-screen memcard-error-formatting) - (progress-screen memcard-error-creating) - (progress-screen memcard-auto-save-error) - (progress-screen memcard-removed) - (progress-screen auto-save) - ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - (((progress-screen pal-change-to-60hz)) - (cond - ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (set! (-> obj video-mode-timeout) (-> *display* real-frame-counter)) - (set! (-> obj next-display-state) (progress-screen pal-now-60hz)) - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> *progress-state* video-mode-choice) 'pal) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - (((progress-screen pal-now-60hz)) - (cond - ((not (-> *progress-state* yes-no-choice)) - (set! (-> *progress-state* video-mode-choice) 'pal) - (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - ) - (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - ) - ) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - (((progress-screen no-disc) (progress-screen bad-disc)) - (when (is-cd-in?) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - (((progress-screen quit)) - (cond - ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "title-start") - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - (((progress-screen memcard-format)) - (cond - ((-> *progress-state* yes-no-choice) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen memcard-formatting)) - ) - ((= (-> obj display-state-stack 0) (progress-screen title)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set-master-mode 'game) - ) - (else - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod dummy-29 progress ((obj progress)) - (mc-get-slot-info 0 *progress-save-info*) - (set! (-> obj card-info) *progress-save-info*) - (let ((s5-0 (-> *options-remap* (-> obj display-state)))) - (when (and s5-0 (not (-> obj in-transition))) - (cond - ((cpad-hold? 0 up) - (cond - ((cpad-pressed? 0 up) - (when (not (-> obj selected-option)) - (if (!= (length s5-0) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) - ) - (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) - (if (> (-> obj option-index) 0) - (+! (-> obj option-index) -1) - (set! (-> obj option-index) (+ (length s5-0) -1)) - ) - ) - ) - (else - (when (-> obj selected-option) - (let ((v1-34 #f)) - (case (-> s5-0 (-> obj option-index) option-type) - ((3) - (when (< -48 (-> *setting-control* current screeny)) - (set! v1-34 #t) - (+! (-> *setting-control* default screeny) -1) - ) - ) - ) - (when v1-34 - (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) - (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) 1024 0 0 1 #t) - ) - ) - ) - ) - ) - ) - ) - ((cpad-hold? 0 down) - (cond - ((cpad-pressed? 0 down) - (when (not (-> obj selected-option)) - (if (!= (length s5-0) 1) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) - ) - (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) - (cond - ((< (-> obj option-index) (+ (length s5-0) -1)) - (+! (-> obj option-index) 1) - ) - (else - (set! (-> obj option-index) 0) - 0 - ) - ) - ) - ) - (else - (when (-> obj selected-option) - (let ((v1-69 #f)) - (case (-> s5-0 (-> obj option-index) option-type) - ((3) - (when (< (-> *setting-control* current screeny) 48) - (set! v1-69 #t) - (+! (-> *setting-control* default screeny) 1) - ) - ) - ) - (when v1-69 - (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) - (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) 1024 0 0 1 #t) - ) - ) - ) - ) - ) - ) - ) - ((cpad-hold? 0 left) - (cond - ((cpad-pressed? 0 left) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7)) - (let ((play-sound? #f)) - (case (-> s5-0 (-> obj option-index) option-type) - ((2 7) - (when (not (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)))) - (set! play-sound? #t) - (if (= (-> s5-0 (-> obj option-index) value-to-modify) (&-> *setting-control* current vibration)) - (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) - ) - ) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #t) - ) - ((4) - (set! play-sound? (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect16x9)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect4x3) - ) - ((5) - (set! play-sound? (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'ntsc)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'pal) - ) - ((#x15) - (set! play-sound? (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #f)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #t)) - ;; arbitrary list options - ((1 #x10 #x11 #x12 #x13 #x14) - ;; every list moves the same way, common logic - (set! (-> *progress-menu-list-tracker* transition?) #t) - (set! (-> *progress-menu-list-tracker* direction) 'left) - (set! play-sound? #t) - ;; now the per menu logic...this should all be refactored and made easier but...must resist - (case (-> s5-0 (-> obj option-index) option-type) - ;; language selection - ((1) - (if (= (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) (dec (length *language-name-remap*))) - (set! (-> *progress-menu-list-tracker* selected-index) (dec (-> *progress-menu-list-tracker* selected-index)))) - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-menu-list-tracker* selected-index))) - ;; display mode setting - ((#x12) - ;; get the current selected item - (let ((curr-val (-> *pc-graphics-display-mode-symbol-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (first-arr *pc-graphics-display-mode-symbol-options*)) - ;; if we've hit the beginning, wrap around to the end - (set! (-> *progress-menu-list-tracker* selected-index) - (last-idx-arr *pc-graphics-display-mode-symbol-options*)) - ;; else just move left - (set! (-> *progress-menu-list-tracker* selected-index) - (dec (-> *progress-menu-list-tracker* selected-index)))))) - ;; aspect ratio setting - ((#x10) - (if (-> *pc-settings* use-original-aspect-ratio?) - (let ((curr-val (-> *pc-graphics-original-aspect-ratio-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (first-arr *pc-graphics-original-aspect-ratio-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) - (last-idx-arr *pc-graphics-original-aspect-ratio-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) - (dec (-> *progress-menu-list-tracker* selected-index))))) - (let ((curr-val (-> *pc-graphics-aspect-ratio-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (first-arr *pc-graphics-aspect-ratio-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) - (last-idx-arr *pc-graphics-aspect-ratio-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) - (dec (-> *progress-menu-list-tracker* selected-index))))))) - ;; resolution setting - ;; this is a little more sophisticated -- only display the ones related to the aspect ratio - ((#x11) - (let ((curr-idx (-> *progress-menu-list-tracker* selected-index)) - (new-idx (dec (-> *progress-menu-list-tracker* selected-index)))) - (case (-> *pc-settings* aspect-ratio-mode) - (('orig-aspect-4x3) - (when (= (-> *pc-graphics-4x3-valid-resolutions* curr-idx) - (first-arr *pc-graphics-4x3-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-4x3-valid-resolutions*)))) - (('orig-aspect-16x9) - (when (= (-> *pc-graphics-16x9-valid-resolutions* curr-idx) - (first-arr *pc-graphics-16x9-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-16x9-valid-resolutions*)))) - (('pc-aspect-4x3) - (when (= (-> *pc-graphics-4x3-valid-resolutions* curr-idx) - (first-arr *pc-graphics-4x3-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-4x3-valid-resolutions*)))) - (('pc-aspect-5x4) - (when (= (-> *pc-graphics-5x4-valid-resolutions* curr-idx) - (first-arr *pc-graphics-5x4-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-5x4-valid-resolutions*)))) - (('pc-aspect-16x9) - (when (= (-> *pc-graphics-16x9-valid-resolutions* curr-idx) - (first-arr *pc-graphics-16x9-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-16x9-valid-resolutions*)))) - (('pc-aspect-21x9) - (when (= (-> *pc-graphics-21x9-valid-resolutions* curr-idx) - (first-arr *pc-graphics-21x9-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-21x9-valid-resolutions*)))) - (('pc-aspect-32x9) - (when (= (-> *pc-graphics-32x9-valid-resolutions* curr-idx) - (first-arr *pc-graphics-32x9-valid-resolutions*)) - (set! new-idx (last-idx-arr *pc-graphics-32x9-valid-resolutions*))))) - (set! (-> *progress-menu-list-tracker* selected-index) new-idx))) - ;; subtitle language selection - ((#x13) - (if (= (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) (dec (length *pc-subtitle-language-name-remap*))) - (set! (-> *progress-menu-list-tracker* selected-index) (dec (-> *progress-menu-list-tracker* selected-index))))) - ((#x14) - ;; get the current selected item - (let ((curr-val (-> *pc-subtitle-speaker-valid-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (first-arr *pc-subtitle-speaker-valid-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) - (last-idx-arr *pc-subtitle-speaker-valid-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) - (dec (-> *progress-menu-list-tracker* selected-index))))))) - (format 0 "VAS: Moving Left. New Index: ~D~%" (-> *progress-menu-list-tracker* selected-index)))) - (if play-sound? - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t))))) - (else - (when (-> obj selected-option) - (let ((v1-157 #f)) - (let ((a0-101 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? a0-101) - (cond - ((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> s5-0 (-> obj option-index) param1)) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ -1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - (set! v1-157 #t) - ) - ((< (-> s5-0 (-> obj option-index) param1) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param1) - ) - (set! v1-157 #t) - ) - ) - ) - ((= a0-101 3) - (when (< -96 (-> *setting-control* default screenx)) - (set! v1-157 #t) - (+! (-> *setting-control* default screenx) -1) - ) - ) - ) - ) - (when v1-157 - (let ((f30-0 100.0)) - (case (-> s5-0 (-> obj option-index) name) - (((game-text-id music-volume) (game-text-id speech-volume)) - (set! f30-0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) - (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 f30-0)) 0 0 1 #t) - ) - ) - ) - ) - ) - ) - ) - ) - ((cpad-hold? 0 right) - (cond - ((cpad-pressed? 0 right) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7)) - (let ((play-sound? #f)) - (case (-> s5-0 (-> obj option-index) option-type) - ((2 7) - (set! play-sound? (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)))) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #f) - ) - ((4) - (set! play-sound? (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect4x3)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'aspect16x9) - ) - ((5) - (set! play-sound? (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'pal)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) 'ntsc) - ) - ((#x15) - (set! play-sound? (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #t)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #f)) - ;; arbitrary list options - ((1 #x10 #x11 #x12 #x13 #x14) - ;; every list moves the same way, common logic - (set! (-> *progress-menu-list-tracker* transition?) #t) - (set! (-> *progress-menu-list-tracker* direction) 'right) - (set! play-sound? #t) - ;; now the per menu logic...this should all be refactored and made easier but...must resist - (case (-> s5-0 (-> obj option-index) option-type) - ;; language selection - ((1) - (if (= (-> *progress-menu-list-tracker* selected-index) (dec (length *language-name-remap*))) - (set! (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) (inc (-> *progress-menu-list-tracker* selected-index)))) - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-menu-list-tracker* selected-index))) - ;; display mode setting - ((#x12) - ;; get the current selected item - (let ((curr-val (-> *pc-graphics-display-mode-symbol-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (last-arr *pc-graphics-display-mode-symbol-options*)) - ;; if we've hit the end, wrap around to the beginning - (set! (-> *progress-menu-list-tracker* selected-index) 0) - ;; else just move right - (set! (-> *progress-menu-list-tracker* selected-index) - (inc (-> *progress-menu-list-tracker* selected-index)))))) - ;; aspect ratio setting - ((#x10) - (if (-> *pc-settings* use-original-aspect-ratio?) - (let ((curr-val (-> *pc-graphics-original-aspect-ratio-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (last-arr *pc-graphics-original-aspect-ratio-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) - (inc (-> *progress-menu-list-tracker* selected-index))))) - (let ((curr-val (-> *pc-graphics-aspect-ratio-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (last-arr *pc-graphics-aspect-ratio-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) - (inc (-> *progress-menu-list-tracker* selected-index))))))) - ;; resolution setting - ;; this is a little more sophisticated -- only display the ones related to the aspect ratio - ((#x11) - (let ((curr-idx (-> *progress-menu-list-tracker* selected-index)) - (new-idx (inc (-> *progress-menu-list-tracker* selected-index)))) - (case (-> *pc-settings* aspect-ratio-mode) - (('orig-aspect-4x3) - (when (= (-> *pc-graphics-4x3-valid-resolutions* curr-idx) - (last-arr *pc-graphics-4x3-valid-resolutions*)) - (set! new-idx 0))) - (('orig-aspect-16x9) - (when (= (-> *pc-graphics-16x9-valid-resolutions* curr-idx) - (last-arr *pc-graphics-16x9-valid-resolutions*)) - (set! new-idx 0))) - (('pc-aspect-4x3) - (when (= (-> *pc-graphics-4x3-valid-resolutions* curr-idx) - (last-arr *pc-graphics-4x3-valid-resolutions*)) - (set! new-idx 0))) - (('pc-aspect-5x4) - (when (= (-> *pc-graphics-5x4-valid-resolutions* curr-idx) - (last-arr *pc-graphics-5x4-valid-resolutions*)) - (set! new-idx 0))) - (('pc-aspect-16x9) - (when (= (-> *pc-graphics-16x9-valid-resolutions* curr-idx) - (last-arr *pc-graphics-16x9-valid-resolutions*)) - (set! new-idx 0))) - (('pc-aspect-21x9) - (when (= (-> *pc-graphics-21x9-valid-resolutions* curr-idx) - (last-arr *pc-graphics-21x9-valid-resolutions*)) - (set! new-idx 0))) - (('pc-aspect-32x9) - (when (= (-> *pc-graphics-32x9-valid-resolutions* curr-idx) - (last-arr *pc-graphics-32x9-valid-resolutions*)) - (set! new-idx 0)))) - (set! (-> *progress-menu-list-tracker* selected-index) new-idx))) - ;; subtitle language selection - ((#x13) - (if (= (-> *progress-menu-list-tracker* selected-index) (dec (length *pc-subtitle-language-name-remap*))) - (set! (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) (inc (-> *progress-menu-list-tracker* selected-index))))) - ((#x14) - ;; get the current selected item - (let ((curr-val (-> *pc-subtitle-speaker-valid-options* - (-> *progress-menu-list-tracker* selected-index)))) - (if (= curr-val (last-arr *pc-subtitle-speaker-valid-options*)) - (set! (-> *progress-menu-list-tracker* selected-index) 0) - (set! (-> *progress-menu-list-tracker* selected-index) - (inc (-> *progress-menu-list-tracker* selected-index))))))) - (format 0 "VAS: Moving Right. New Index: ~D~%" (-> *progress-menu-list-tracker* selected-index)))) - (if play-sound? - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t))))) - (else - (when (-> obj selected-option) - (let ((v1-263 #f)) - (let ((a0-177 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? a0-177) - (cond - ((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2)) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - (set! v1-263 #t) - ) - ((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) - ) - (set! v1-263 #t) - ) - ) - ) - ((= a0-177 3) - (when (< (-> *setting-control* default screenx) 96) - (set! v1-263 #t) - (+! (-> *setting-control* default screenx) 1) - ) - ) - ) - ) - (when v1-263 - (let ((f30-1 100.0)) - (case (-> s5-0 (-> obj option-index) name) - (((game-text-id music-volume) (game-text-id speech-volume)) - (set! f30-1 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) - (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) - (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 f30-1)) 0 0 1 #t) - ) - ) - ) - ) - ) - ) - ) - ) - ((or (cpad-pressed? 0 square) (cpad-pressed? 0 triangle)) - (cond - ((-> obj selected-option) - (let ((v1-319 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? v1-319) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* slider-backup) - ) - ) - ((= v1-319 1) - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* language-backup) - ) - ) - ((= v1-319 2) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* on-off-backup) - ) - ) - ((= v1-319 3) - (set! (-> *setting-control* default screenx) (-> *progress-state* center-x-backup)) - (set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup)) - ) - ((or (= v1-319 4) (= v1-319 5)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* aspect-ratio-backup) - ) - ) - ) - ) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj selected-option) #f) - ) - ((or (dummy-32 obj) - (= (-> obj display-state) (progress-screen load-game)) - (= (-> obj display-state) (progress-screen save-game)) - (= (-> obj display-state) (progress-screen save-game-title)) - ) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons square)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons square)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - ) - (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - ;; confirm selection - ((or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) - (cond - ((not (-> obj selected-option)) - (cond - ((= (-> s5-0 (-> obj option-index) option-type) 6) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (push! obj) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (the-as progress-screen (-> s5-0 (-> obj option-index) param3))) - (case (-> obj next-display-state) - (((progress-screen load-game) - (progress-screen save-game) - (progress-screen save-game-title)) - (set! (-> obj next-display-state) - (dummy-53 obj (-> obj next-display-state))) - ) - ) - ) - ((= (-> s5-0 (-> obj option-index) option-type) 8) - (cond - ((= (-> s5-0 (-> obj option-index) name) (game-text-id exit-demo)) - (set! *master-exit* 'force) - (set-master-mode 'game) - ) - ((= (-> s5-0 (-> obj option-index) name) (game-text-id back)) - (if (= (-> obj display-state) (progress-screen settings)) - (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - ) - (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) - (set! (-> obj next-display-state) (progress-screen invalid)) - ) - ) - ) - ((!= (-> s5-0 (-> obj option-index) option-type) 7) - (let ((v1-427 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? v1-427) - (set! (-> *progress-state* slider-backup) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - ) - ((= v1-427 1) - (set! (-> *progress-state* language-backup) - (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ((= v1-427 2) - (set! (-> *progress-state* on-off-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ((= v1-427 3) - (set! (-> *progress-state* center-x-backup) (-> *setting-control* default screenx)) - (set! (-> *progress-state* center-y-backup) (-> *setting-control* default screeny)) - ) - ((= v1-427 #x15) - (set! (-> *progress-state* aspect-ratio-choice) (-> *pc-settings* use-original-aspect-ratio?))))) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (set! (-> obj selected-option) #t) - ;; arbitrary sized list options, they always scroll in the same manner - (when (or (= (-> s5-0 (-> obj option-index) option-type) 1) - (= (-> s5-0 (-> obj option-index) option-type) #x10) - (= (-> s5-0 (-> obj option-index) option-type) #x11) - (= (-> s5-0 (-> obj option-index) option-type) #x12) - (= (-> s5-0 (-> obj option-index) option-type) #x13) - (= (-> s5-0 (-> obj option-index) option-type) #x14)) - (format 0 "VAS: list option opened~%") - ;; reset tracker to defaults ;; defaults to left? - (set! (-> *progress-menu-list-tracker* direction) 'left) - (set! (-> *progress-menu-list-tracker* transition?) #f) - (set! (-> *progress-menu-list-tracker* x-offset) 0) - ;; each one has a slightly different handling though - ;; set the currently selected item - (case (-> s5-0 (-> obj option-index) option-type) - ((1) - (set! (-> *progress-menu-list-tracker* selected-index) - (the-as int (-> *setting-control* current language)))) - ((#x10) - (if (-> *pc-settings* use-original-aspect-ratio?) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-original-aspect-ratio-options* (-> *pc-settings* aspect-ratio-mode) 0)) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-aspect-ratio-options* (-> *pc-settings* aspect-ratio-mode) 0)))) - ((#x11) - (case (-> *pc-settings* aspect-ratio-mode) - (('orig-aspect-4x3) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-4x3-valid-resolutions* (-> *pc-settings* resolution) 0))) - (('orig-aspect-16x9) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-16x9-valid-resolutions* (-> *pc-settings* resolution) 0))) - (('pc-aspect-4x3) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-4x3-valid-resolutions* (-> *pc-settings* resolution) 0))) - (('pc-aspect-5x4) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-5x4-valid-resolutions* (-> *pc-settings* resolution) 0))) - (('pc-aspect-16x9) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-16x9-valid-resolutions* (-> *pc-settings* resolution) 0))) - (('pc-aspect-21x9) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-21x9-valid-resolutions* (-> *pc-settings* resolution) 0))) - (('pc-aspect-32x9) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-32x9-valid-resolutions* (-> *pc-settings* resolution) 0))))) - ((#x12) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-graphics-display-mode-symbol-options* (-> *pc-settings* display-mode) 0))) - ((#x13) - (set! (-> *progress-menu-list-tracker* selected-index) - (the-as int (-> *pc-settings* subtitle-language)))) - ((#x14) - (set! (-> *progress-menu-list-tracker* selected-index) - (arr-idx-of *pc-subtitle-speaker-valid-options* (-> *pc-settings* subtitle-speaker?) 0))))) - ) - ) - ) - (else - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj selected-option) #f) - (format 0 "VAS: list selection confirmed!~%") - (case (-> s5-0 (-> obj option-index) option-type) - ((#x15) - (use-orig-aspect-ratio! *pc-settings* (-> *progress-state* aspect-ratio-choice))) - ((5) - (case (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))) - (('pal) - (set! (-> *setting-control* default video-mode) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - (('ntsc) - (push! obj) - (set! (-> obj next-display-state) (progress-screen pal-change-to-60hz)) - ) - ) - ) - ((1) - (when (not (-> *progress-menu-list-tracker* transition?)) - (load-level-text-files (-> obj display-level-index)))) - ((#x10) - (if (-> *pc-settings* use-original-aspect-ratio?) - (set-aspect-ratio-mode! *pc-settings* - (-> *pc-graphics-original-aspect-ratio-options* (-> *progress-menu-list-tracker* selected-index))) - (set-aspect-ratio-mode! *pc-settings* - (-> *pc-graphics-aspect-ratio-options* (-> *progress-menu-list-tracker* selected-index))))) - ((#x11) - (case (-> *pc-settings* aspect-ratio-mode) - (('orig-aspect-4x3) - (set-resolution! *pc-settings* - (-> *pc-graphics-4x3-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))) - (('orig-aspect-16x9) - (set-resolution! *pc-settings* - (-> *pc-graphics-16x9-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))) - (('pc-aspect-4x3) - (set-resolution! *pc-settings* - (-> *pc-graphics-4x3-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))) - (('pc-aspect-5x4) - (set-resolution! *pc-settings* - (-> *pc-graphics-5x4-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))) - (('pc-aspect-16x9) - (set-resolution! *pc-settings* - (-> *pc-graphics-16x9-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))) - (('pc-aspect-21x9) - (set-resolution! *pc-settings* - (-> *pc-graphics-21x9-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))) - (('pc-aspect-32x9) - (set-resolution! *pc-settings* - (-> *pc-graphics-32x9-valid-resolutions* (-> *progress-menu-list-tracker* selected-index)))))) - ((#x12) - (set-display-mode! *pc-settings* - (-> *pc-graphics-display-mode-symbol-options* (-> *progress-menu-list-tracker* selected-index)))) - ((#x13) - (set! (-> *pc-settings* subtitle-language) - (the pc-subtitle-lang (-> *progress-menu-list-tracker* selected-index)))) - ((#x14) - (set! (-> *pc-settings* subtitle-speaker?) - (-> *pc-subtitle-speaker-valid-options* (-> *progress-menu-list-tracker* selected-index)))) - ) - ;; persist pc-settings - (commit-to-file *pc-settings*) - ) - ) - ) - ) - ) - ) - 0 - (none) - ) - -(defmethod respond-progress progress ((obj progress)) - (when (not (-> obj in-transition)) - (cond - ((cpad-pressed? 0 up) - (let ((s5-0 (-> obj display-level-index))) - (set! (-> obj next-level-index) (get-next-level-down s5-0)) - (when (!= s5-0 (-> obj next-level-index)) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj level-transition) 2) - ) - ) - ) - ((cpad-pressed? 0 down) - (let ((s5-2 (-> obj next-level-index))) - (set! (-> obj next-level-index) (get-next-level-up s5-2)) - (when (!= s5-2 (-> obj next-level-index)) - (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj level-transition) 1) - ) - ) - ) - ((cpad-pressed? 0 square) - (when (nonzero? (-> obj display-state)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen fuel-cell)) - (set! (-> obj stat-transition) #t) - ) - ) - ((cpad-pressed? 0 x) - (when (!= (-> obj display-state) (progress-screen money)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen money)) - (set! (-> obj stat-transition) #t) - ) - ) - ((cpad-pressed? 0 triangle) - (when (!= (-> obj display-state) (progress-screen buzzer)) - (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) - (set! (-> obj next-display-state) (progress-screen buzzer)) - (set! (-> obj stat-transition) #t) - ) - ) - ((cpad-pressed? 0 circle) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) - (push! obj) - (set! (-> obj next-display-state) (progress-screen settings)) - ) - ((= (-> obj display-state) (progress-screen fuel-cell)) - (cond - ((cpad-pressed? 0 left) - (let ((s5-8 (-> obj task-index))) - (set! (-> obj task-index) (get-next-task-down (-> obj task-index) (-> obj display-level-index))) - (if (!= s5-8 (-> obj task-index)) - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) - ) - ) - ) - ((cpad-pressed? 0 right) - (let ((s5-10 (-> obj task-index))) - (set! (-> obj task-index) (get-next-task-up (-> obj task-index) (-> obj display-level-index))) - (if (!= s5-10 (-> obj task-index)) - (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) - ) - ) - ) - ) - ) - ) - ) - 0 - (none) - ) - -(defstate progress-normal (progress) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (local-vars (v0-0 none)) - (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'go-away) - (go progress-going-out) - ) - ((= v1-0 'notify) - (cond - ((= (-> arg3 param 0) 'done) - (case (-> self display-state) - (((progress-screen memcard-saving)) - (cond - ((= (-> self display-state-stack 0) (progress-screen title)) - (let ((gp-1 (-> *setting-control* default auto-save))) - (sound-volume-off) - (set! (-> *game-info* mode) 'play) - (initialize! *game-info* 'game (the-as game-save #f) "intro-start") - (set! (-> *setting-control* default auto-save) gp-1) - ) - (set-master-mode 'game) - ) - (else - (set! v0-0 (the-as none -1)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - ) - ) - (((progress-screen memcard-formatting)) - (set! (-> self force-transition) #t) - (set! v0-0 (the-as none 15)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-creating)) - (cond - ((= (-> self display-state-stack 0) (progress-screen title)) - (set! v0-0 (the-as none 18)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - ) - (else - (set! v0-0 (the-as none 17)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - ) - ) - v0-0 - ) - ) - ) - ((= (-> arg3 param 0) 'error) - (let ((t9-4 format) - (a0-17 #t) - (a1-2 "ERROR NOTIFY: ~S ~D~%") - (v1-13 (-> arg3 param 1)) - ) - (t9-4 - a0-17 - a1-2 - (cond - ((= v1-13 17) - "no-auto-save" - ) - ((= v1-13 16) - "no-process" - ) - ((= v1-13 15) - "bad-version" - ) - ((= v1-13 14) - "no-space" - ) - ((= v1-13 13) - "no-save" - ) - ((= v1-13 12) - "no-file" - ) - ((= v1-13 11) - "no-format" - ) - ((= v1-13 10) - "no-last" - ) - ((= v1-13 9) - "no-card" - ) - ((= v1-13 8) - "no-memory" - ) - ((= v1-13 7) - "new-game" - ) - ((= v1-13 6) - "read-error" - ) - ((= v1-13 5) - "write-error" - ) - ((= v1-13 4) - "internal-error" - ) - ((= v1-13 3) - "format-failed" - ) - ((= v1-13 2) - "bad-handle" - ) - ((= v1-13 1) - "ok" - ) - ((zero? v1-13) - "busy" - ) - (else - "*unknown*" - ) - ) - (-> self display-state) - ) - ) - (case (-> arg3 param 1) - ((14) - (set! v0-0 (the-as none 7)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (else - (case (-> self display-state) - (((progress-screen memcard-formatting)) - (set! v0-0 (the-as none 24)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-creating)) - (set! v0-0 (the-as none 25)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-saving)) - (set! v0-0 (the-as none 21)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - (((progress-screen memcard-loading)) - (set! v0-0 (the-as none 20)) - (set! (-> self next-display-state) (the-as progress-screen v0-0)) - v0-0 - ) - ) - ) - ) - ) - ) - ) - ) - ) - ) - ) - :code - (behavior () - (loop - (when (and (cpad-hold? 0 l1) (cpad-hold? 0 r1) *cheat-mode*) - (when (and (< (-> self task-index) (-> *level-task-data* (-> self display-level-index) nb-of-tasks)) - (>= (-> self task-index) 0) - ) - (let ((gp-0 (-> *level-task-data* (-> self display-level-index) task-info (-> self task-index) task-id))) - (close-specific-task! gp-0 (task-status need-resolution)) - (send-event *target* 'get-pickup 6 (the float gp-0)) - ) - ) - ) - (if (and (= (-> self display-state) (-> self next-display-state)) - (= (-> self display-level-index) (-> self next-level-index)) - ) - (set! (-> self transition-offset) - (seekl - (-> self transition-offset) - 0 - (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) - 2 - 1 - ) - ) - ) - ) - (set! (-> self transition-offset) - (seekl - (-> self transition-offset) - 512 - (* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - (if (or (-> self stat-transition) (nonzero? (-> self level-transition))) - 2 - 1 - ) - ) - ) - ) - ) - (set-transition-progress! self (-> self transition-offset)) - (set! (-> self in-transition) (or (-> self force-transition) (nonzero? (-> self transition-offset)))) - (when (and (not (handle->process (-> *game-info* auto-save-proc))) - (or (-> self force-transition) (-> self in-transition)) - (>= (-> self transition-offset) (if (and (zero? (-> self level-transition)) - (nonzero? (-> self next-display-state)) - (!= (-> self next-display-state) 1) - (!= (-> self next-display-state) 2) - ) - 512 - 256 - ) - ) - ) - (if (>= (the-as int (-> self next-display-state)) 0) - ;; transition to the next menu - (enter! self (-> self next-display-state) 0) - (pop! self) - ) - (set! (-> self display-level-index) (-> self next-level-index)) - (when (nonzero? (-> self level-transition)) - (set! (-> self task-index) (get-next-task-up -1 (-> self display-level-index))) - (case (-> self level-transition) - ((1) - (set! (-> self level-transition) 2) - ) - ((2) - (set! (-> self level-transition) 1) - ) - ) - ) - (set! (-> self force-transition) #f) - ) - (when (zero? (-> self transition-offset)) - (set! (-> self stat-transition) #f) - (set! (-> self level-transition) 0) - 0 - ) - (let ((gp-1 #f)) - (let ((v1-62 #f)) - (case (-> self display-state) - (((progress-screen fuel-cell) (progress-screen money) (progress-screen buzzer)) - (let ((s5-0 (-> self display-level-index))) - (when (and (< (mod (-> *display* real-frame-counter) 60) 30) - (zero? (-> *progress-process* 0 in-out-position)) - (not (-> self in-transition)) - (zero? (-> self transition-offset)) - ) - (set! gp-1 (!= s5-0 (get-next-level-up s5-0))) - (set! v1-62 (!= s5-0 (get-next-level-down s5-0))) - ) - ) - ) - ) - (set! (-> self particles 3 init-pos x) (the float (if v1-62 - (- 195 (-> *progress-process* 0 left-x-offset)) - -320 - ) - ) - ) - ) - (set! (-> self particles 4 init-pos x) (the float (if gp-1 - (- 195 (-> *progress-process* 0 left-x-offset)) - -320 - ) - ) - ) - ) - (dummy-29 self) - (set! (-> self next-display-state) - (dummy-53 self (-> self next-display-state))) - (let ((v1-74 (-> self display-state))) - (cond - ((or (= v1-74 (progress-screen fuel-cell)) - (or (= v1-74 (progress-screen money)) (= v1-74 (progress-screen buzzer))) - ) - (respond-progress self) - ) - ((or (= v1-74 (progress-screen memcard-no-space)) - (= v1-74 (progress-screen memcard-format)) - (= v1-74 (progress-screen memcard-data-exists)) - (= v1-74 (progress-screen memcard-insert)) - (= v1-74 (progress-screen load-game)) - (= v1-74 (progress-screen save-game)) - (= v1-74 (progress-screen save-game-title)) - (= v1-74 (progress-screen memcard-error-loading)) - (= v1-74 (progress-screen memcard-error-saving)) - (= v1-74 (progress-screen memcard-error-formatting)) - (= v1-74 (progress-screen memcard-error-creating)) - (= v1-74 (progress-screen memcard-auto-save-error)) - (= v1-74 (progress-screen memcard-removed)) - (= v1-74 (progress-screen memcard-no-data)) - (= v1-74 (progress-screen memcard-not-inserted)) - (= v1-74 (progress-screen memcard-not-formatted)) - (= v1-74 (progress-screen auto-save)) - (= v1-74 (progress-screen pal-change-to-60hz)) - (= v1-74 (progress-screen pal-now-60hz)) - (= v1-74 (progress-screen no-disc)) - (= v1-74 (progress-screen bad-disc)) - (= v1-74 (progress-screen quit)) - ) - (dummy-31 self) - ) - ) - ) - (suspend) - ) - (none) - ) - :post - (behavior () - (let* ((a1-0 (-> self display-level-index)) - (gp-0 (-> *level-task-data* a1-0)) - ) - #t - (let ((s5-0 #f)) - (case (-> self display-state) - (((progress-screen fuel-cell)) - (set! s5-0 #t) - (draw-fuel-cell-screen self a1-0) - ) - (((progress-screen money)) - (set! s5-0 #t) - (draw-money-screen self a1-0) - ) - (((progress-screen buzzer)) - (set! s5-0 #t) - (draw-buzzer-screen self a1-0) - ) - (((progress-screen game-settings) (progress-screen settings)) - (hide-progress-icons) - (draw-options self 115 30 0.82) - ) - (((progress-screen graphic-settings) - (progress-screen sound-settings) - (progress-screen settings-title) - (progress-screen title) - (progress-screen language-options) - ) - (hide-progress-icons) - (draw-options self 115 30 0.82) - ) - (((progress-screen memcard-removed) (progress-screen memcard-auto-save-error)) - (draw-notice-screen self) - (draw-options self 192 0 0.82) - ) - (((progress-screen memcard-no-data)) - (draw-notice-screen self) - (draw-options self 165 0 0.82) - ) - (((progress-screen memcard-format)) - (draw-notice-screen self) - (draw-options self 172 0 0.82) - ) - (((progress-screen memcard-no-space) - (progress-screen memcard-not-inserted) - (progress-screen memcard-not-formatted) - ) - (draw-notice-screen self) - (draw-options self 195 0 0.82) - ) - (((progress-screen memcard-error-loading) - (progress-screen memcard-error-saving) - (progress-screen memcard-error-formatting) - (progress-screen memcard-error-creating) - (progress-screen memcard-auto-save-error) - ) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen pal-change-to-60hz)) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen pal-now-60hz)) - (when (< (seconds 10) (- (-> *display* real-frame-counter) (-> self video-mode-timeout))) - (set! (-> *progress-state* video-mode-choice) 'pal) - (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (set! (-> self next-display-state) (progress-screen invalid)) - ) - (draw-notice-screen self) - (draw-options self 140 0 0.82) - ) - (((progress-screen no-disc) (progress-screen bad-disc)) - (draw-notice-screen self) - (if (is-cd-in?) - (draw-options self 170 0 0.82) - ) - ) - (((progress-screen quit)) - (draw-notice-screen self) - (draw-options self 110 0 0.82) - ) - (((progress-screen auto-save)) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen memcard-insert)) - (draw-notice-screen self) - (draw-options self 165 0 0.82) - ) - (((progress-screen memcard-data-exists)) - (draw-notice-screen self) - (draw-options self 168 0 0.82) - ) - (((progress-screen memcard-loading) - (progress-screen memcard-saving) - (progress-screen memcard-formatting) - (progress-screen memcard-creating) - ) - (draw-notice-screen self) - ) - (((progress-screen load-game) (progress-screen save-game)) - (draw-notice-screen self) - (draw-options self 190 0 0.82) - ) - (((progress-screen save-game-title)) - (draw-notice-screen self) - (draw-options self 169 15 0.6) - ) - ) - (when s5-0 - (let* ((v1-98 (cond - ((-> self stat-transition) - 0 - ) - ((= (-> self level-transition) 1) - (- (-> self transition-offset)) - ) - (else - (-> self transition-offset) - ) - ) - ) - (f30-0 (the-as float (if (-> self stat-transition) - 1.0 - (-> self transition-percentage-invert) - ) - ) - ) - (s5-1 - (new - 'stack - 'font-context - *font-default-matrix* - (- 32 (-> self left-x-offset)) - (the int (* (+ 42.0 (the float (/ v1-98 2))) f30-0)) - 8325000.0 - (font-color lighter-lighter-blue) - (font-flags shadow kerning) - ) - ) - ) - (let ((v1-103 s5-1)) - (set! (-> v1-103 width) (the float 328)) - ) - (let ((v1-104 s5-1)) - (set! (-> v1-104 height) (the float 45)) - ) - (set! (-> s5-1 flags) (font-flags shadow kerning middle left large)) - (print-game-text-scaled - (lookup-text! *common-text* (-> gp-0 level-name-id) #f) - f30-0 - s5-1 - (the int (* 128.0 f30-0)) - ) - ) - ) - ) - ) - (case (-> self display-state) - (((progress-screen fuel-cell) (progress-screen money) (progress-screen buzzer)) - (draw-progress self) - ) - ) - (adjust-sprites self) - (adjust-icons self) - (none) - ) - ) - -(defstate progress-coming-in (progress) - :event - (-> progress-waiting event) - :enter - (behavior () - (sound-group-pause (the-as uint 255)) - (logclear! (-> *setting-control* default process-mask) (process-mask pause menu)) - (push-setting! *setting-control* self 'process-mask 'set 0.0 16) - (copy-settings-from-target! *setting-control*) - (sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t) - (set-blackout-frames 0) - (set! *pause-lock* #f) - (none) - ) - :code - (behavior () - (loop - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 0 (the int (* 170.0 (-> *display* time-adjust-ratio)))) - ) - (when (< (-> self in-out-position) 2867) - (set! (-> self transition-offset) (seekl - (-> self transition-offset) - 0 - (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - ) - ) - (set-transition-progress! self (-> self transition-offset)) - ) - (if (zero? (-> self in-out-position)) - (go progress-normal) - ) - (suspend) - ) - (none) - ) - :post - (-> progress-normal post) - ) - -(defstate progress-going-out (progress) - :enter - (behavior () - (sound-play-by-name (static-sound-name "menu-close") (new-sound-id) 1024 0 0 1 #t) - (hide-progress-icons) - (set! (-> self particles 3 init-pos x) -320.0) - (set! (-> self particles 4 init-pos x) -320.0) - (case (-> self display-state) - (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) - (set! (-> self transition-speed) 30.0) - ) - ) - (none) - ) - :code - (behavior () - (loop - (set! (-> self transition-offset) (seekl - (-> self transition-offset) - 512 - (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio))) - ) - ) - (set-transition-progress! self (-> self transition-offset)) - (when (< 153 (-> self transition-offset)) - (set! (-> self in-out-position) - (seekl (-> self in-out-position) 4096 (the int (* 170.0 (-> *display* time-adjust-ratio)))) - ) - (if (= (-> self in-out-position) 4096) - (go progress-gone) - ) - ) - (suspend) - ) - (none) - ) - :post - (-> progress-normal post) - ) - -(defstate progress-debug (progress) - :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('go-away) - (go progress-going-out) - ) - ) - ) - :code - (behavior () - (loop - (cond - ((cpad-pressed? 0 left) - (if (> (-> self current-debug-string) 0) - (+! (-> self current-debug-string) -1) - ) - ) - ((cpad-pressed? 0 right) - (if (< (-> self current-debug-string) (+ (-> *common-text* length) -1)) - (+! (-> self current-debug-string) 1) - ) - ) - ((cpad-pressed? 0 up) - (when (> (-> self current-debug-group) 0) - (+! (-> self current-debug-group) -1) - (set! (-> self current-debug-string) 0) - 0 - ) - ) - ((cpad-pressed? 0 down) - (when (< (-> self current-debug-group) (+ (-> *text-group-names* length) -1)) - (+! (-> self current-debug-group) 1) - (set! (-> self current-debug-string) 0) - 0 - ) - ) - ((cpad-pressed? 0 l1) - (if (> (the-as int (-> *setting-control* default language)) 0) - (+! (-> *setting-control* default language) -1) - ) - ) - ((cpad-pressed? 0 r1) - (if (< (the-as int (-> *setting-control* default language)) 6) - (+! (-> *setting-control* default language) 1) - ) - ) - ((cpad-pressed? 0 l2) - (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l2)) - (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons l2)) - (go progress-normal) - ) - ) - (load-game-text-info (-> *text-group-names* (-> self current-debug-group)) '*common-text* *common-text-heap*) - (suspend) - ) - (none) - ) - :post - (behavior () - (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (gp-0 (-> s5-0 base)) - ) - (let ((s4-0 draw-string-xy)) - (let ((s3-0 format) - (a0-4 (clear *temp-string*)) - (a1-0 "TEXT DEBUG: LANGUAGE ~S ID 0x~X") - (v1-4 (-> *setting-control* current language)) - ) - (s3-0 - a0-4 - a1-0 - (cond - ((= v1-4 (language-enum uk-english)) - "uk-english" - ) - ((= v1-4 (language-enum japanese)) - "japanese" - ) - ((= v1-4 (language-enum italian)) - "italian" - ) - ((= v1-4 (language-enum spanish)) - "spanish" - ) - ((= v1-4 (language-enum german)) - "german" - ) - ((= v1-4 (language-enum french)) - "french" - ) - ((= v1-4 (language-enum english)) - "english" - ) - (else - "*unknown*" - ) - ) - (-> *common-text* data (-> self current-debug-string) id) - ) - ) - (s4-0 *temp-string* s5-0 40 40 (font-color default) (font-flags shadow kerning)) - ) - (let ((a3-4 (-> s5-0 base))) - (let ((v1-7 (the-as dma-packet (-> s5-0 base)))) - (set! (-> v1-7 dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> v1-7 vif0) (new 'static 'vif-tag)) - (set! (-> v1-7 vif1) (new 'static 'vif-tag)) - (set! (-> s5-0 base) (&+ (the-as pointer v1-7) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - gp-0 - (the-as (pointer dma-tag) a3-4) - ) - ) - ) - (let* ((s5-1 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (gp-1 (-> s5-1 base)) - ) - (let ((s4-1 draw-string-xy)) - (format (clear *temp-string*) "USE LEFT/RIGHT TO SELECT STRING") - (s4-1 *temp-string* s5-1 40 155 (font-color default) (font-flags shadow kerning)) - ) - (let ((a3-6 (-> s5-1 base))) - (let ((v1-16 (the-as dma-packet (-> s5-1 base)))) - (set! (-> v1-16 dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> v1-16 vif0) (new 'static 'vif-tag)) - (set! (-> v1-16 vif1) (new 'static 'vif-tag)) - (set! (-> s5-1 base) (the-as pointer (the-as dma-packet (&+ v1-16 16)))) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - gp-1 - (the-as (pointer dma-tag) a3-6) - ) - ) - ) - (let* ((s5-2 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (gp-2 (-> s5-2 base)) - ) - (let ((s4-2 draw-string-xy)) - (format (clear *temp-string*) "USE UP/DOWN TO SELECT GROUP") - (s4-2 *temp-string* s5-2 40 165 (font-color default) (font-flags shadow kerning)) - ) - (let ((a3-8 (-> s5-2 base))) - (let ((v1-25 (the-as dma-packet (-> s5-2 base)))) - (set! (-> v1-25 dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> v1-25 vif0) (new 'static 'vif-tag)) - (set! (-> v1-25 vif1) (new 'static 'vif-tag)) - (set! (-> s5-2 base) (the-as pointer (the-as dma-packet (&+ v1-25 16)))) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - gp-2 - (the-as (pointer dma-tag) a3-8) - ) - ) - ) - (let* ((s5-3 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (gp-3 (-> s5-3 base)) - ) - (let ((s4-3 draw-string-xy)) - (format (clear *temp-string*) "USE L1/R1 TO SELECT LANGUAGE") - (s4-3 *temp-string* s5-3 40 175 (font-color default) (font-flags shadow kerning)) - ) - (let ((a3-10 (-> s5-3 base))) - (let ((v1-34 (the-as dma-packet (-> s5-3 base)))) - (set! (-> v1-34 dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> v1-34 vif0) (new 'static 'vif-tag)) - (set! (-> v1-34 vif1) (new 'static 'vif-tag)) - (set! (-> s5-3 base) (the-as pointer (the-as dma-packet (&+ v1-34 16)))) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id debug-draw0) - gp-3 - (the-as (pointer dma-tag) a3-10) - ) - ) - ) - (let ((gp-4 (new - 'stack - 'font-context - *font-default-matrix* - 32 - 50 - 0.0 - (font-color default) - (font-flags shadow kerning) - ) - ) - ) - (let ((v1-42 gp-4)) - (set! (-> v1-42 width) (the float 328)) - ) - (let ((v1-43 gp-4)) - (set! (-> v1-43 height) (the float 100)) - ) - (logior! (-> gp-4 flags) (font-flags shadow kerning large)) - (draw-debug-text-box gp-4) - (print-game-text (-> *common-text* data (-> self current-debug-string) text) gp-4 #f 128 22) - ) - (none) - ) - ) - - diff --git a/goal_src/pc/engine/ui/text-h.gc b/goal_src/pc/engine/ui/text-h.gc deleted file mode 100644 index 753b58b036..0000000000 --- a/goal_src/pc/engine/ui/text-h.gc +++ /dev/null @@ -1,562 +0,0 @@ -;;-*-Lisp-*- -(in-package goal) - -;; name: text-h.gc -;; name in dgo: text-h -;; dgos: GAME, ENGINE - -;; This file contains types related to game text. -;; Each game string is assigned an ID number. -;; This ID is used to lookup the string for the currently selected language. -;; These ID's are shared with short spoken audio clips (daxter hints) -;; most (all?) of the daxter clips don't have text strings. - -(defenum game-text-id - :type uint32 - :bitfield #f -;; GAME-TEXT-ID ENUM BEGINS - (zero 0) - (one 1) - (confirm #x103) - (press-to-talk #x104) - (press-to-use #x105) - (confirm-play #x106) - (play-again? #x107) - (quit #x108) - (pause #x109) - (sfx-volume #x10a) - (music-volume #x10b) - (speech-volume #x10c) - (language #x10d) - (vibrations #x10e) - (play-hints #x10f) - (center-screen #x110) - (on #x111) - (off #x112) - (move-dpad #x113) - (english #x114) - (french #x115) - (german #x116) - (spanish #x117) - (italian #x118) - (japanese #x119) - (press-to-trade-money #x11a) - (press-to-trade-money-oracle #x11b) - (press-to-warp #x11c) - (press-to-exit #x11d) - (press-to-talk-to-sage #x123) - (press-to-talk-to-assistant #x124) - (aspect-ratio #x125) - (video-mode #x126) - (game-options #x127) - (graphic-options #x128) - (sound-options #x129) - (4x3 #x12a) - (16x9 #x12b) - (60hz #x12c) - (50hz #x12d) - (game-title #x12e) - (hidden-power-cell #x12f) ;; why is this here?? - (memcard-no-space #x130) - (memcard-not-inserted #x131) - (card-not-formatted-title #x132) - (memcard-space-requirement1 #x133) - (memcard-space-requirement2 #x134) - (card-not-formatted-msg #x135) - (saving-data #x136) - (loading-data #x137) - (do-not-remove-mem-card #x138) - (overwrite? #x139) - (format? #x13a) - - (yes #x13c) - (no #x13d) - (back #x13e) - (continue-without-saving #x13f) - (select-file-to-save #x140) - (select-file-to-load #x141) - (save-data-already-exists #x142) - (insert-memcard #x143) - (continue? #x144) - (load-game #x14b) - (save-game #x14c) - (formatting #x14d) - (creating-save-data #x14e) - (empty #x14f) - (options #x150) - (error-loading #x151) - (error-saving #x152) - (error-formatting #x153) - (error-creating-data #x154) - (memcard-removed #x156) - (autosave-disabled-title #x157) - (autosave-disabled-msg #x158) - (no-save-data #x159) - (create-save-data? #x15a) - (check-memcard #x15b) - (new-game #x15c) - (back? #x15d) - (ok #x15e) - (exit-demo #x15f) - (autosave-warn-title #x160) - (autosave-warn-msg #x161) - (task-completed #x162) - (check-memcard-and-retry #x163) - (screen-change-to-60hz #x164) - (screen-60hz-warn-support #x165) - (screen-60hz-warn-timer #x166) - (screen-now-60hz #x167) - (screen-60hz-keep? #x168) - (warp-gate-use-dpad #x169) - (no-disc-title #x16a) - (no-disc-msg #x16b) - (bad-disc-title #x16c) - (bad-disc-msg #x16d) - (press-start #x16e) - (quit-game #x16f) - (quit? #x170) - (total-collected #x171) - - (village1-mayor-money #x200) - (vollage1-uncle-money #x201) - (village1-yakow-herd #x202) - (village1-yakow-return #x203) - (village1-oracle #x204) - (beach-ecorocks #x205) - (beach-flutflut-push #x206) - (beach-flutflut-meet #x207) - (beach-pelican #x208) - (beach-seagull #x209) - (beach-cannon #x20a) - (beach-buzzer #x20b) - (jungle-lurkerm-connect #x20c) - (jungle-tower #x20d) - (jungle-eggtop #x20e) - (jungle-plant #x20f) - (jungle-fishgame #x210) - (misty-muse-catch #x211) - (misty-muse-return #x212) - (misty-boat #x213) - (misty-cannon #x214) - (misty-return-to-pool #x215) ;; task name?? - (misty-find-transpad #x216) ;; task name? - (misty-balloon-lurkers #x217) - - (village1-level-name #x220) - (beach-level-name #x221) - (jungle-level-name #x222) - (misty-level-name #x223) - - (beach-seagull-get #x22e) - - (jungle-lurkerm-unblock #x22f) - (jungle-lurkerm-return #x230) - - (MISSING-orb-hint #x233) - - (beach-eco-rock-increment #x239) - - (jungle-maindoor-hint #x23c) - - (firecanyon-not-enough-cells #x24f) - - (sidekick-hint-orb-cache-top #x251) - - (jungle-precursorbridge-hint #x25b) - (daxter-launcher-no-eco #x25c) - - (jungle-mirrors-completion-talk-to-mayor #x25e) - - (beach-gimmie #x262) - (beach-sentinel #x263) - (jungle-canyon-end #x264) - (jungle-temple-door #x265) - (misty-bike-jump #x266) - (misty-eco-challenge #x267) - (beach-seagull-chased-one #x268) - (beach-seagull-chased-two #x26a) - (beach-seagull-chased-three #x26b) - (beach-seagull-chased-four #x26c) - - (misty-daxter-scared #x26f) - - (beach-seagulls-avalanche #x273) - - (beach-pelican-quick-get-cell #x274) - - (beach-flutflutegg-hint #x275) - - (sidekick-hint-fish-powerup #x278) - (misty-racer-hit-the-ballon-lurkers #x27e) - (misty-daxter-hit-lurkers-not-mines #x27f) - - (sidekick-speech-hint-crate-darkeco1 #x281) - (sidekick-speech-crate-steel-break1 #x283) - (sidekick-speech-hint-crate-iron #x284) - (sidekick-speech-hint-crate-steel #x285) - (beach-collectors-unblocked #x288) - (misty-stopped-lurkers-at-silo #x28a) - (misty-stopped-balloon-lurkers #x28b) - (jungleb-eco-vents-opened #x289) - (sidekick-speech-crate-steel-break2 #x28e) - (sidekick-speech-hint-crate-darkeco2 #x28f) - - (daxter-screaming-jump #x290) - (daxter-wahoo-jump #x291) - (daxter-get-some #x292) - - (collectables-scout-flies-red-boxes #x295) - (found-all-scout-flies #x296) - (yakow-owed-powercell #x297) - - (jungle-mirrors-tutorial #x29c) - (jungle-mirrors-break-the-mirror-jak #x29d) - (jungle-mirrors-go-to-the-next-tower #x29f) - (jungle-mirrors-follow-the-beam #x2a0) - - (misty-teetertotter-bonk-dax-tutorial #x2a4) - (sidekick-hint-misty-get-red-eco #x2a5) - - (red-eco-tutorial #x2a6) - - (daxter-blue-eco-plat-tutorial #x2a7) - - (fish? #x2a9) - - (misty-bone-bridge-hint #x2aa) - - (beach-grottopole-increment #x2af) - - (firecanyon-collect-cells-collected #x2b1) - (firecanyon-collect-cells-collected-reminder #x2b2) - (firecanyon-collect-cells-text #x2b3) - (caught #x2b4) - (missed #x2b5) - (lose! #x2b6) - - (village2-gambler-money #x300) - (village2-geologist-money #x301) - (village2-warrior-money #x302) - (village2-oracle-money #x303) - (swamp-tether #x304) - - (swamp-flutflut #x307) - - (swamp-billy #x309) - - (sunken-elevator-raise #x30a) - (sunken-elevator-get-to-roof #x30b) - (sunken-pipe #x30c) - (sunken-climb-tube #x30d) ;; task name? - (sunken-pool #x30e) ;; task name? - (sunken-platforms #x30f) - - (rolling-moles #x310) - (rolling-moles-return #x311) - (rolling-robbers #x312) - (rolling-race #x313) - (rolling-race-return #x314) - (rolling-lake #x315) - (rolling-plants #x316) - - (unknown-buzzers #x317) - - (village2-level-name #x319) - - (rolling-level-name #x31b) - (swamp-level-name #x31c) - (sunken-level-name #x31d) - (ogre-level-name #x31e) - - (swamp-battle #x321) - (sunken-bottom #x322) ;; task name? - (reach-center #x323) ;; task name? - (rolling-ring-chase-1 #x324) - (rolling-ring-chase-2 #x325) - (sunken-kiera-you-raised-a-piece-of-lpc #x326) - (rolling-beat-lurkers #x327) - (swamp-finished-with-flutflut #x328) - (rolling-race-beat-record #x335) - (sidekick-speech-hint-rolling-crate-darkeco #x336) - (rolling-lightning-moles-completion #x338) - (rolling-dark-plants-location-hint #x339) - (rolling-dark-plants-hint #x33a) - (rolling-flying-lurker-intro #x33c) - (rolling-ring-hint-one-ring-down #x33f) - (rolling-ring-hint-be-quick-to-next #x340) - (rolling-ring-hint-be-quick-all #x341) - - (sunken-pipegame-follow-it #x343) - (sunken-helix-daxter-bad-feeling #x344) - (sunken-blue-eco-charger-hint #x345) - (sunken-double-lurker-hint #x347) - (sunken-helix-daxter-eco-rising #x348) - (sunken-qbert-plat-hint #x34a) - (sunken-bully-dive-hint #x34b) - (sunken-take-it-easy-hot-pipes #x34e) - - (sunken-blue-eco-charger-all-hint #x34d) - - (swamp-tethers-advice-hint #x352) - - (kermit-break-tongue #x357) - (swamp-rats-nest-hint #x358) - (daxter-you-can-shoot-with-yellow-eco #x359) - - (kermit-run-away-jak #x35f) - - (swamp-bats-hint #x364) ;; maybe we can duck the bats - (swamp-tethers-three-to-go #x365) - (swamp-tethers-two-to-go #x366) - (swamp-tethers-lefts-find-the-last #x367) - (flutflut-reminder #x368) - - (sage-golfclap-i-have-low-expectations #x36a) ;; where was this said? - - (swamp-tethers-completion-sage-precursor-arm #x36b) - - (village2-warp-gate-reminder #x36f) - (village2-warp-gate-reminder-annoyed #x370) - (village2-warp-gate-reminder-very-annoyed #x371) - - (village2-not-enough-cells-levitator #x36c) - (villlage2-levitator-cell-req-text #x372) - - (rolling-race-time-string-prefix #x373) - (rolling-race-record-string-prefix #x374) - (rolling-race-new-record-string-prefix #x375) - (rolling-race-try-again-string #x376) - (rolling-race-start-race-aborted #x377) ;; double check this - - (village3-miner-money #x400) - (village3-oracle-money #x401) - (snow-ram-3-left #x402) - (snow-ram-2-left #x403) - (snow-ram-1-left #x404) - (snow-fort #x405) - (snow-bunnies #x406) - (snow-open-door #x408) ;; task name? - - (cave-robot-climb #x40e) - (cave-dark-climb #x40f) ;; destroy crystals - - (cave-gnawers #x410) - (cave-dark-crystals #x411) - - (village3-buzzer #x413) - - (village3-level-name #x415) - - (snowy-level-name #x417) - - (cave-level-name #x419) - - (lavatube-level-name #x41b) - - (snow-eggtop #x421) - - (cave-spider-tunnel #x423) - (cave-platforms #x424) - - (cave-swing-poles #x426) - - (assistant-lavatube-powercell-hint #x428) - (village3-gondola-malfunctioning #x429) - (village3-gondola-reactivated #x42a) - - (snow-frozen-crate #x42b) ;; task name? - (snow-bumpers #x42c) - - (dark-crystal-last-one #x432) - (daxter-maybe-you-can-shoot-better-goggles #x433) - - (darkcave-light-crystal-low-light-hint #x437) - (darkcave-light-crystal-hint #x438) - (dark-crystal-run-away #x439) - (cave-trap-nest-hint #x440) - (snow-fort-reminder #x443) - (ram-boss-red-eco-hint #x444) - - (ice-cube-hint #x448) - - (snowy-turned-on-yellow-vents #x44c) - - (village3-warp-gate-reminder #x452) - (village3-warp-gate-reminder=annoyed #x453) - (village3-warp-gate-reminder-very-annoyed #x454) - (lavatube-powercell-req-text #x455) - - (fire-canyon-end #x500) - (fire-canyon-buzzer #x501) - - (daxter-maybe-i-should-drive #x506) - (daxter-you-are-trying-to-avoid-dark-eco #x507) - - (fire-canyon-level-name #x50c) - - (fire-canyon-we-made-it #x515) - - (collectables-theres-scout-flys-here-too #x516) - - (ogre-end #x600) - (ogre-buzzer #x601) - (ogre-boss #x603) - (ogre-boss-killed #x604) - - (assistant-voicebox-intro-ogre-race #x605) - - (sidekick-speech-hint-ogre-race #x61c) - (assistant-finished-mountain-pass-race #x61d) - - (lavatube-end #x700) - (lavatube-buzzer #x701) - - (lavatube-shoot-the-spheres #x70d) - - (lavatube-spheres-door-open #x710) - - (citadel-buzzer #x800) - (citadel-level-name #x801) - (citadel-sage-blue #x802) - (citadel-sage-red #x803) - (citadel-sage-yellow #x804) - (citadel-sage-green #x805) - (citadel-break-generator-hint #x806) - (citadel-lurker-bunny-alert #x808) - (citadel-break-generators-reminder #x809) - (citadel-climb-plat-hint #x80c) - - (daxter-dont-miss-the-next-launcher #x80d) - - (daxter-land-on-the-next-launcher #x812) - (misty-battle-finished #x813) - - (training-precursor-orbs #x901) - (training-power-cells #x902) - (training-assistant-found-scout-fly #x903) - (training-assistant-found-scout-fly-cell #x904) - (training-blue-eco-vent #x907) - (training-eco-green #x908) - (training-eco-blue #x909) - (training-more-eco-more-time #x90a) - (training-precursor-door #x90b) - (training-eco-opened-door #x90c) - (training-double-jump #x90e) - - (sage-voicebox-hint-crate-iron #x917) - (training-warp-gate-blocked #x919) - (training-warp-gate-reminder #x91a) - - (training-gimmie-task-name #x91b) - (training-buzzer-task-name #x91c) - (training-door-task-name #x91d) - (training-climb-task-name #x91e) - (training-level-name #x91f) - - (inc #xf10) - (europe #xf11) -;; GAME-TEXT-ID ENUM ENDS - - ; PC Port TEXT - (progress-resolution #x1000) - (progress-display-mode #x1001) - (progress-letterbox #x1002) - (progress-subtitles #x1003) - (progress-subtitles-label-speaker #x1004) - (progress-discord-rpc #x1005) - (progress-language-options #x1006) - ;; subtitle languages - (progress-subtitles-language #x1007) - (progress-subtitle-language-uk-english #x1008) - (progress-subtitle-language-portuguese #x1009) - (progress-subtitle-language-finnish #x1010) - (progress-subtitle-language-swedish #x1011) - (progress-subtitle-language-danish #x1012) - (progress-subtitle-language-norwegian #x1013) - (progress-subtitle-language-korean #x1014) - (progress-subtitle-language-russian #x1015) - (progress-subtitles-label-speaker-on #x1016) - (progress-subtitles-label-speaker-off #x1017) - (progress-subtitles-label-speaker-auto #x1018) - ;; display modes - (progress-display-mode-borderless #x1019) - (progress-display-mode-fullscreen #x1020) - (progress-display-mode-windowed #x1021) - ;; aspect ratios - (progress-aspect-ratio-4x3 #x1022) - (progress-aspect-ratio-5x4 #x1023) - (progress-aspect-ratio-16x9 #x1024) - (progress-aspect-ratio-21x9 #x1025) - (progress-aspect-ratio-32x9 #x1026) - ;; 4:3 resolutions - (progress-res-4x3-640x480 #x1027) - (progress-res-4x3-800x600 #x1028) - (progress-res-4x3-1024x768 #x1029) - (progress-res-4x3-1280x960 #x1030) - (progress-res-4x3-1600x1200 #x1031) - ;; 5:4 resolutions - (progress-res-5x4-960x768 #x1032) - (progress-res-5x4-1280x1024 #x1033) - (progress-res-5x4-1500x1200 #x1034) - ;; 16:9 resolutions - (progress-res-16x9-854x480 #x1035) - (progress-res-16x9-1280x720 #x1036) - (progress-res-16x9-1920x1080 #x1037) - (progress-res-16x9-2560x1440 #x1038) - (progress-res-16x9-2880x1620 #x1039) - (progress-res-16x9-3840x2160 #x1040) - (progress-res-16x9-5120x2880 #x1041) - ;; 21:9 resolutions - (progress-res-21x9-2560x1080 #x1042) - (progress-res-21x9-3120x1440 #x1043) - (progress-res-21x9-3200x1440 #x1044) - (progress-res-21x9-3440x1440 #x1045) - (progress-res-21x9-3840x1600 #x1046) - (progress-res-21x9-5120x2160 #x1047) - ;; 32:9 resolutions - (progress-res-32x9-5120x1440 #x1048) - ;; original aspect ratio - (progress-use-original-aspect #x1049) - ) - -;; an individual string. -(deftype game-text (structure) - ((id game-text-id :offset-assert 0) - (text string :offset-assert 4) - ) - :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 - ) - -;; A table of all strings. -(deftype game-text-info (basic) - ((length int32 :offset-assert 4) - (language-id int32 :offset-assert 8) - (group-name string :offset-assert 12) - (data game-text :inline :dynamic :offset-assert 16) - ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 - (:methods - (lookup-text! (_type_ game-text-id symbol) string 9) - ) - ) - -;; all text is stored in the COMMON text files (one file per language). -;; in theory, you could have multiple text files that are only loaded when needed, but they didn't do this. -(define *text-group-names* (new 'static 'boxed-array :type string :length 1 "common")) - -;; The heap for storing text -(define *common-text-heap* (new 'global 'kheap)) - -;; will store the COMMON text when it is loaded. -(define *common-text* (the-as game-text-info #f)) - - -(defun-extern print-game-text string font-context symbol int int float) - - - diff --git a/goal_src/pc/pckernel-h.gc b/goal_src/pc/pckernel-h.gc index c40f8803d5..8e56ca668c 100644 --- a/goal_src/pc/pckernel-h.gc +++ b/goal_src/pc/pckernel-h.gc @@ -32,9 +32,9 @@ (defglobalconstant PC_KERNEL_VERSION_BUILD #x0001) -(defglobalconstant PC_KERNEL_VERSION_REVISION #x0002) +(defglobalconstant PC_KERNEL_VERSION_REVISION #x0003) -(defglobalconstant PC_KERNEL_VERSION_MINOR #x0000) +(defglobalconstant PC_KERNEL_VERSION_MINOR #x0001) (defglobalconstant PC_KERNEL_VERSION_MAJOR #x0001) (defglobalconstant PC_KERNEL_VERSION (logior (ash PC_KERNEL_VERSION_MAJOR 48) @@ -55,33 +55,6 @@ (defconstant PC_SETTINGS_FILE_NAME "game_config/pc-settings.txt") -(define *pc-subtitle-speaker-valid-options* - (new 'static 'boxed-array :type symbol :length 3 :allocated-length 3 #t #f 'auto)) - -(define *pc-graphics-display-mode-symbol-options* - (new 'static 'boxed-array :type symbol :length 3 :allocated-length 3 'borderless 'fullscreen 'windowed)) - -(define *pc-graphics-original-aspect-ratio-options* - (new 'static 'boxed-array :type symbol :length 2 :allocated-length 2 'orig-aspect-4x3 'orig-aspect-16x9)) - -(define *pc-graphics-aspect-ratio-options* - (new 'static 'boxed-array :type symbol :length 5 :allocated-length 5 'pc-aspect-4x3 'pc-aspect-5x4 'pc-aspect-16x9 'pc-aspect-21x9 'pc-aspect-32x9)) - -(define *pc-graphics-4x3-valid-resolutions* - (new 'static 'boxed-array :type symbol :length 5 :allocated-length 5 '640x480 '800x600 '1024x768 '1280x960 '1600x1200)) - -(define *pc-graphics-5x4-valid-resolutions* - (new 'static 'boxed-array :type symbol :length 3 :allocated-length 3 '960x768 '1280x1024 '1500x1200)) - -(define *pc-graphics-16x9-valid-resolutions* - (new 'static 'boxed-array :type symbol :length 7 :allocated-length 7 '854x480 '1280x720 '1920x1080 '2560x1440 '2880x1620 '3840x2160 '5120x2880)) - -(define *pc-graphics-21x9-valid-resolutions* - (new 'static 'boxed-array :type symbol :length 6 :allocated-length 6 '2560x1080 '3120x1440 '3200x1440 '3440x1440 '3840x1600 '5120x2160)) - -(define *pc-graphics-32x9-valid-resolutions* - (new 'static 'boxed-array :type symbol :length 1 :allocated-length 1 '5120x1440)) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; types and enums ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -227,14 +200,11 @@ (win-height int32) (dpi-x float) ;; DPI width scale (dpi-y float) ;; DPI height scale - (use-original-aspect-ratio? symbol) - (aspect-ratio-auto? symbol) ;; if on, aspect ratio is calculated automatically. + (aspect-ratio-auto? symbol) ;; if on, aspect ratio is calculated automatically based on game display size. (aspect-ratio float) ;; the desired aspect ratio. set auto to off and then this to 4/3 to force 4x3 aspect. (aspect-ratio-scale float) ;; aspect ratio compared to 4x3 - (aspect-ratio-reciprocal float) ;; aspect ratio compared to 3x4 - (resolution symbol) ;; selected resolution + (aspect-ratio-reciprocal float) ;; reciprocal of that (display-mode symbol) ;; display mode. can be windowed, fullscreen or borderless - (aspect-ratio-mode symbol) ;; explicit vetted aspect ratios - 4:3 | 5:4 | 16:9 | 21:9 | 32:9 (letterbox? symbol) ;; letterbox. #f = stretched (vsync? symbol) ;; vsync. (font-scale float) ;; font scaling. @@ -252,6 +222,8 @@ (display-bug-report symbol) (display-heap-status symbol) (display-actor-counts symbol) + (display-text-box symbol) + (display-sha symbol) (mood-override? symbol) (mood-overrides float 8) (movie? symbol) @@ -274,6 +246,7 @@ (gfx-renderer pc-gfx-renderer) ;; the renderer to use (gfx-resolution float) ;; for supersampling (gfx-anisotropy float) ;; for anisotropy + (gfx-msaa int) ;; for MSAA ;; ps2 settings (ps2-read-speed? symbol) ;; emulate DVD loads @@ -333,10 +306,7 @@ (reset-fixes (_type_) none) (reset-extra (_type_) none) (draw (_type_ dma-buffer) none) - (use-orig-aspect-ratio! (_type_ symbol) none) - (set-display-mode! (_type_ symbol) none) - (set-aspect-ratio-mode! (_type_ symbol) none) - (set-resolution! (_type_ symbol) none) + (set-display-mode! (_type_ symbol) int) (set-size! (_type_ int int) none) (set-aspect! (_type_ int int) none) (set-aspect-ratio! (_type_ float) none) @@ -345,6 +315,7 @@ (actor-force-visible? (_type_) symbol) (update-cheats (_type_) int) (commit-to-file (_type_) none) + (load-settings (_type_) int) ) ) @@ -397,6 +368,8 @@ (set! (-> obj display-bug-report) #f) (set! (-> obj display-heap-status) #f) (set! (-> obj display-actor-counts) #f) + (set! (-> obj display-text-box) #f) + (set! (-> obj display-sha) *debug-segment*) (set! (-> obj mood-override?) #f) (set! (-> obj movie?) #f) (set! (-> obj font-scale) 1.0) @@ -422,14 +395,15 @@ (set! (-> obj width) PC_BASE_WIDTH) (set! (-> obj height) PC_BASE_HEIGHT) (set! (-> obj use-vis?) #f) - (set! (-> obj use-original-aspect-ratio?) #f) (set! (-> obj aspect-ratio-auto?) #f) (set! (-> obj vsync?) #t) (set! (-> obj letterbox?) #t) - (set-aspect-ratio-mode! obj 'pc-aspect-4x3) - (set-resolution! obj '640x480) + (set-size! obj 640 480) + (set-aspect! obj 4 3) (set-display-mode! obj 'windowed) + + (set! (-> obj gfx-msaa) 4) ;; 4x msaa (none)) diff --git a/goal_src/pc/pckernel.gc b/goal_src/pc/pckernel.gc index 3708ab193f..3bddc81056 100644 --- a/goal_src/pc/pckernel.gc +++ b/goal_src/pc/pckernel.gc @@ -3,7 +3,7 @@ #| - This file contains code that we need for the PC port of the game specifically. + This file contains new code that we need for the PC port of the game specifically. It should be included as part of the game engine package (engine.cgo). This file contains various types and functions to store PC-specific information @@ -22,7 +22,7 @@ |# - +;; is this necessary? (#when PC_PORT @@ -36,22 +36,17 @@ "sets the game's display mode" ;; changing to same mode, no-op - (if (= (-> obj display-mode) mode) + (if (= (pc-get-fullscreen) mode) (return 0)) ;; else change it and update it (set! (-> obj display-mode) mode) - (cond - ((= mode 'borderless) - (pc-set-fullscreen 2 0)) - ((= mode 'fullscreen) - (pc-set-fullscreen 1 0)) - (else ;; default to windowed - (pc-set-fullscreen 0 0))) - (none)) + (pc-set-fullscreen mode 0) + 0) (defmethod set-size! pc-settings ((obj pc-settings) (width int) (height int)) "sets the size of the display window" + (format #t "Setting size to ~D x ~D~%" width height) (pc-set-window-size width height) (none)) @@ -60,23 +55,13 @@ "set the aspect ratio used for rendering. this forces native widescreen and takes width and height ratios." (let ((aspect (/ (the float aw) (the float ah)))) (set-aspect-ratio! obj aspect) + (set! (-> obj aspect-custom-x) aw) + (set! (-> obj aspect-custom-y) ah) (set! (-> obj aspect-ratio-auto?) #f) (set! (-> obj use-vis?) #f) ) (none)) -(defmethod use-orig-aspect-ratio! pc-settings ((obj pc-settings) (val symbol)) - "whether to use the pc port's aspect ratio, or the original games 4:3/16:9" - (if (= (-> obj use-original-aspect-ratio?) val) - (return 0)) - (set! (-> obj use-original-aspect-ratio?) val) - ;; default to the simplist resolution if we are changing - (if val - (set-aspect-ratio-mode! obj 'orig-aspect-4x3) - (set-aspect-ratio-mode! obj 'pc-aspect-4x3)) - (set! (-> *pc-settings* use-vis?) val) - (none)) - (defmethod set-aspect-ratio! pc-settings ((obj pc-settings) (aspect float)) "set the aspect ratio used for rendering." (set! (-> obj aspect-ratio) aspect) @@ -84,95 +69,13 @@ (set! (-> obj aspect-ratio-reciprocal) (/ ASPECT_4X3 aspect)) (none)) -(defmethod set-aspect-ratio-mode! pc-settings ((obj pc-settings) (mode symbol)) - "sets the game's aspect ratio mode" - - ;; changing to same mode, no-op - (if (= (-> obj aspect-ratio-mode) mode) - (return 0)) - - ;; else change it and update it - (set! (-> obj aspect-ratio-mode) mode) - ;; also default to the lowest resolution option at the same time - (case mode - (('orig-aspect-4x3) - (set-resolution! obj (-> *pc-graphics-4x3-valid-resolutions* 0))) - (('orig-aspect-16x9) - (set-resolution! obj (-> *pc-graphics-16x9-valid-resolutions* 0))) - (('pc-aspect-4x3) - (set-aspect! obj 4 3) - (set-resolution! obj (-> *pc-graphics-4x3-valid-resolutions* 0))) - (('pc-aspect-5x4) - (set-aspect! obj 5 4) - (set-resolution! obj (-> *pc-graphics-5x4-valid-resolutions* 0))) - (('pc-aspect-16x9) - (set-aspect! obj 16 9) - (set-resolution! obj (-> *pc-graphics-16x9-valid-resolutions* 0))) - (('pc-aspect-21x9) - (set-aspect! obj 21 9) - (set-resolution! obj (-> *pc-graphics-21x9-valid-resolutions* 0))) - (('pc-aspect-32x9) - (set-aspect! obj 32 9) - (set-resolution! obj (-> *pc-graphics-32x9-valid-resolutions* 0)))) - - ;; NOTE - i believe this is a temporary workaround to get the hud looking decent on pc aspect ratios - ;; eventually i assume this will only be required for the original ones! - (case mode - (('orig-aspect-4x3 'pc-aspect-4x3) - (set! (-> *setting-control* default aspect-ratio) 'aspect4x3)) - (else - (set! (-> *setting-control* default aspect-ratio) 'aspect16x9))) - - ;; NOTE - it should not be necessarily to call `set-aspect-ratio` as that is - ;; done on a per frame basis as long as it differs from the "current" setting-control value - ;; - ;; However, if I'm wrong, then that needs to be fixed at the build/load level again - ;; as that function is defined in `video` later in the order. - (none)) - -(defmethod set-resolution! pc-settings ((obj pc-settings) (mode symbol)) - "sets the game's resolution" - - ;; TODO - implement a custom resolution mode which will enable resizing and use the values stored - ;; changing to same mode, no-op - (if (= (-> obj resolution) mode) - (none)) - - ;; else change it and update it - (set! (-> obj resolution) mode) - (case mode - (('640x480) (set-size! obj 640 480)) - (('800x600) (set-size! obj 800 600)) - (('1024x768) (set-size! obj 1024 768)) - (('1280x960) (set-size! obj 1280 960)) - (('1600x1200) (set-size! obj 1600 1200)) - (('960x768) (set-size! obj 960 768)) - (('1280x1024) (set-size! obj 1280 1024)) - (('1500x1200) (set-size! obj 1500 1200)) - (('854x480) (set-size! obj 854 480)) - (('1280x720) (set-size! obj 1280 720)) - (('1920x1080) (set-size! obj 1920 1080)) - (('2560x1440) (set-size! obj 2560 1440)) - (('2880x1620) (set-size! obj 2880 1620)) - (('3840x2160) (set-size! obj 3840 2160)) - (('5120x2880) (set-size! obj 5120 2880)) - (('2560x1080) (set-size! obj 2560 1080)) - (('3120x1440) (set-size! obj 3120 1440)) - (('3200x1440) (set-size! obj 3200 1440)) - (('3440x1440) (set-size! obj 3440 1440)) - (('3840x1600) (set-size! obj 3840 1600)) - (('5120x2160) (set-size! obj 5120 2160)) - (('5120x1440) (set-size! obj 5120 1440))) - (none)) - (defmethod commit-to-file pc-settings ((obj pc-settings)) "commits the current settings to the file" ;; auto load settings if available - (clear *pc-temp-string-1*) - (format *pc-temp-string-1* "~S/pc-settings.gc" *pc-settings-folder*) + + (format (clear *pc-temp-string-1*) "~S/pc-settings.gc" *pc-settings-folder*) (pc-mkdir-file-path *pc-temp-string-1*) (write-to-file obj *pc-temp-string-1*) - (clear *pc-temp-string-1*) (none)) (defmethod update-from-os pc-settings ((obj pc-settings)) @@ -181,6 +84,7 @@ (set! (-> obj os) (pc-get-os)) (pc-get-window-size (&-> obj win-width) (&-> obj win-height)) (pc-get-window-scale (&-> obj dpi-x) (&-> obj dpi-y)) + (set! (-> obj display-mode) 'windowed) (when (-> obj use-vis?) (if (= (-> *setting-control* default aspect-ratio) 'aspect4x3) @@ -223,6 +127,7 @@ (cond ((-> obj letterbox?) + ;; AGH bad idea, this is meant for resolution! TODO fix this crap (pc-set-letterbox (-> obj width) (-> obj height)) ) (else @@ -230,14 +135,7 @@ ) ) - (cond - ((-> obj discord-rpc?) - (pc-discord-rpc-set 1) - ) - (else - (pc-discord-rpc-set 0) - ) - ) + (pc-discord-rpc-set (if (-> obj discord-rpc?) 1 0)) (when #t ;; (not (-> obj ps2-lod-dist?)) (pc-renderer-tree-set-lod (pc-renderer-tree-type tfrag3) (-> obj lod-force-tfrag)) @@ -251,7 +149,7 @@ (define *pc-cheat-temp* (the-as (pointer int32) (malloc 'global 24))) (defmacro pc-cheat-toggle-and-tune (obj cheat) `(begin - (cpad-clear-buttons! 0 r1) + (cpad-clear! 0 r1) (logxor! (-> ,obj cheats) (pc-cheats ,cheat)) (cheats-sound-play (logtest? (-> ,obj cheats) (pc-cheats ,cheat))) ) @@ -270,13 +168,9 @@ (set! (-> info fuel) (&-> *game-info* fuel)) (set! (-> info money-total) (&-> *game-info* money-total)) (set! (-> info buzzer-total) (&-> *game-info* buzzer-total)) - (set! (-> info status) "Playing Jak and Daxter: TPL") - (set! (-> info level) (if *target* - (symbol->string (-> *target* current-level name)) ;; use target's level if it exists - (symbol->string (-> (level-get-target-inside *level*) name)) ;; use camera's level otherwise - ) - ) - (set! (-> info cutscene?) (movie?)) + (set! (-> info status) "Playing Jak and Daxter: The Precursor Legacy™") + (set! (-> info level) (symbol->string (-> (level-get-target-inside *level*) name))) ;; grab the name of level we're in + (set! (-> info cutscene?) (-> obj movie?)) (pc-discord-rpc-update info) ) @@ -291,8 +185,9 @@ (when *progress-process* ;; adjust sizes for progress. ;; video.gc sets the sizes in the normal game. + ;; this is a complete hack and i'm losing it (let ((pr (-> *progress-process*)) - (wide-adjust (* 4.0 (- (/ (-> obj aspect-ratio-scale) ASPECT_16X9_SCALE) (1/ ASPECT_16X9_SCALE)))) + ;(wide-adjust (* 4.0 (- (/ (-> obj aspect-ratio-scale) ASPECT_16X9_SCALE) (1/ ASPECT_16X9_SCALE)))) ) (set! (-> pr sides-x-scale) 1.0) (set! (-> pr sides-y-scale) 13.0) @@ -304,11 +199,12 @@ ) (cond ((actor-force-visible? obj) - (set! (-> *ACTOR-bank* birth-dist) (meters 10000)) - (set! (-> *ACTOR-bank* pause-dist) (meters 10000)) - (set! (-> *ACTOR-bank* birth-max) 1000) - ) - ((> (-> *ACTOR-bank* birth-dist) (meters 220)) + ;; kinda overkill. + (set! (-> *ACTOR-bank* birth-dist) (meters 10000)) + (set! (-> *ACTOR-bank* pause-dist) (meters 10000)) + (set! (-> *ACTOR-bank* birth-max) 1000) + ) + ((> (-> *ACTOR-bank* birth-dist) (meters 220)) ;; the original caps at 220m, exceeding that means it was using our hacks (set! (-> *ACTOR-bank* birth-dist) (meters 220)) (set! (-> *ACTOR-bank* pause-dist) (meters 220)) )) @@ -348,6 +244,7 @@ (when *target* + ;; TODO green eco hack here as well (when (and (pc-cheats? obj eco-blue) (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-blue)) (<= (-> *target* fact-info-target eco-level) 0.0))) @@ -562,6 +459,17 @@ (case-str *pc-temp-string* (("settings") (set! version (file-stream-read-int file)) + (cond + ((= (logand version #xffffffff00000000) (logand PC_KERNEL_VERSION #xffffffff00000000)) + ;; minor difference + ) + (else + ;; major difference + (format 0 "PC kernel version mismatch! Got ~D.~D vs ~D.~D~%" PC_KERNEL_VERSION_MAJOR PC_KERNEL_VERSION_MINOR (bit-field int version 32 16) (bit-field int version 48 16)) + (file-stream-close file) + (return #f) + ) + ) (dosettings (file) (case-str *pc-temp-string* (("fps") (set! (-> obj target-fps) (file-stream-read-int file))) @@ -569,18 +477,15 @@ (set! (-> obj width) (file-stream-read-int file)) (set! (-> obj height) (file-stream-read-int file)) (set-size! obj (-> obj width) (-> obj height)) - (set-aspect! obj (-> obj width) (-> obj height)) ) - (("use-original-aspect-ratio?") - (set! (-> obj use-original-aspect-ratio?) (file-stream-read-symbol file))) - (("aspect") + (("aspect") (set-aspect! obj (file-stream-read-int file) (file-stream-read-int file))) + (("aspect-test") (set! (-> obj aspect-custom-x) (file-stream-read-int file)) (set! (-> obj aspect-custom-y) (file-stream-read-int file)) ) (("aspect-auto") (set! (-> obj aspect-ratio-auto?) (file-stream-read-symbol file))) + (("aspect-game") (set! (-> *setting-control* default aspect-ratio) (file-stream-read-symbol file))) (("display-mode") (set-display-mode! obj (file-stream-read-symbol file))) - (("aspect-ratio-mode") (set-aspect-ratio-mode! obj (file-stream-read-symbol file))) - (("resolution") (set-resolution! obj (file-stream-read-symbol file))) (("letterbox") (set! (-> obj letterbox?) (file-stream-read-symbol file))) (("vsync") (set! (-> obj vsync?) (file-stream-read-symbol file))) (("font-scale") (set! (-> obj font-scale) (file-stream-read-float file))) @@ -672,18 +577,6 @@ ) ) - (when (!= PC_KERNEL_VERSION version) - (cond - ((= (logand version #xffffffff00000000) (logand PC_KERNEL_VERSION #xffffffff00000000)) - ;; minor difference - ) - (else - ;; major difference - (format 0 "PC kernel version mismatch! Got ~D.~D vs ~D.~D~%" PC_KERNEL_VERSION_MAJOR PC_KERNEL_VERSION_MINOR (bit-field int version 32 16) (bit-field int version 48 16)) - ) - ) - ) - ) (file-stream-close file) @@ -707,13 +600,12 @@ (format file "(settings #x~X~%" (-> obj version)) (format file " (fps ~D)~%" (-> obj target-fps)) - (format file " (size ~D ~D)~%" (-> obj width) (-> obj height)) - (format file " (use-original-aspect-ratio? ~A)~%" (-> obj use-original-aspect-ratio?)) - (format file " (aspect ~D ~D)~%" (-> obj aspect-custom-x) (-> obj aspect-custom-y)) + (format file " (size ~D ~D)~%" (-> obj win-width) (-> obj win-height)) + (format file " (aspect ~D ~D)~%" (-> obj width) (-> obj height)) + (format file " (aspect-test ~D ~D)~%" (-> obj aspect-custom-x) (-> obj aspect-custom-y)) (format file " (aspect-auto ~A)~%" (-> obj aspect-ratio-auto?)) + (format file " (aspect-game ~A)~%" (-> *setting-control* default aspect-ratio)) (format file " (display-mode ~A)~%" (-> obj display-mode)) - (format file " (aspect-ratio-mode ~A)~%" (-> obj aspect-ratio-mode)) - (format file " (resolution ~A)~%" (-> obj resolution)) (format file " (letterbox ~A)~%" (-> obj letterbox?)) (format file " (vsync ~A)~%" (-> obj vsync?)) (format file " (font-scale ~f)~%" (-> obj font-scale)) @@ -803,6 +695,18 @@ #t ) +(defmethod load-settings pc-settings ((obj pc-settings)) + "load" + + (format (clear *pc-temp-string-1*) "~S/pc-settings.gc" *pc-settings-folder*) + (if (pc-filepath-exists? *pc-temp-string-1*) + (begin + (format 0 "[PC] PC Settings found at '~S'...loading!~%" *pc-temp-string-1*) + (unless (read-from-file obj *pc-temp-string-1*) + (format 0 "[PC] PC Settings found at '~S' but could not be loaded, using defaults!~%" *pc-temp-string-1*) + (reset obj))) + (format 0 "[PC] PC Settings not found at '~S'...initializing with defaults!~%" *pc-temp-string-1*)) + 0) (defmethod new pc-settings ((allocation symbol) (type-to-make type)) "make a new pc-settings" @@ -810,19 +714,9 @@ (reset obj) ;; auto load settings if available ;; if saved settings are corrupted or not found, use defaults - (clear *pc-temp-string-1*) - (format *pc-temp-string-1* "~S/pc-settings.gc" *pc-settings-folder*) - (if (pc-filepath-exists? *pc-temp-string-1*) - (begin - (format 0 "[PC] PC Settings found at '~S'...loading!~%" *pc-temp-string-1*) - (unless (read-from-file obj *pc-temp-string-1*) - (begin - (format 0 "[PC] PC Settings found at '~S' but could not be loaded, using defaults!~%" *pc-temp-string-1*) - (reset obj)))) - (format 0 "[PC] PC Settings not found at '~S'...initializing with defaults!~%" *pc-temp-string-1*)) + (load-settings obj) - (clear *pc-temp-string-1*) obj)) diff --git a/goal_src/pc/progress-pc.gc b/goal_src/pc/progress-pc.gc new file mode 100644 index 0000000000..0da6d1c88e --- /dev/null +++ b/goal_src/pc/progress-pc.gc @@ -0,0 +1,1549 @@ +;;-*-Lisp-*- +(in-package goal) + +#| + + Code for the progress menu in the PC port. The original code is still loaded, this just has some overriden functions. + + |# + + +(#when PC_PORT + + +;;--------------------------- +;;--------------------------- +;; pc menu extra stuff + +(defconstant PROGRESS_PC_PAGE_HEIGHT 7) +(defconstant PROGRESS_SCROLL_DIR_UP -1) +(defconstant PROGRESS_SCROLL_DIR_DOWN 1) + +(defconstant GAME_MIN_RES_MULT 0.5) + + +(deftype progress-scroll (structure) + ((transition float) + (start-index int16) + (real-index int16) + (direction int8) + (last-screen progress-screen) + ) + ) +(define *progress-scroll* (new 'static 'progress-scroll)) + +(defmacro progress-scrolling? () `(< (-> *progress-scroll* transition) 1.0)) +(defmacro progress-scrolling-up? () `(and (progress-scrolling?) (= (-> *progress-scroll* direction) PROGRESS_SCROLL_DIR_UP))) +(defmacro progress-scrolling-down? () `(and (progress-scrolling?) (= (-> *progress-scroll* direction) PROGRESS_SCROLL_DIR_DOWN))) +(defconstant *progress-scroll-start* (-> *progress-scroll* start-index)) +(defconstant *progress-scroll-end* (+ -1 PROGRESS_PC_PAGE_HEIGHT (-> *progress-scroll* start-index))) +(defmacro progress-scroll-reset () + "resets scroll. nothing will be scrolling, as if it had finished." + `(begin + (set! (-> *progress-scroll* transition) 1.0) + (set! (-> *progress-scroll* direction) 0) + (set! (-> *progress-scroll* start-index) 0))) +(defmacro progress-scroll-up! () + `(begin + (set! (-> *progress-scroll* transition) 0.0) + (set! (-> *progress-scroll* direction) PROGRESS_SCROLL_DIR_UP) + (1-! (-> *progress-scroll* start-index)))) +(defmacro progress-scroll-down! () + `(begin + (set! (-> *progress-scroll* transition) 0.0) + (set! (-> *progress-scroll* direction) PROGRESS_SCROLL_DIR_DOWN) + (1+! (-> *progress-scroll* start-index)))) + + +;; ############################ +;; CAROUSELL STUFF +;; ############################ + +(deftype progress-carousell-state (structure) + ((int-backup int) + (symbol-backup symbol) + (subtitle-backup pc-subtitle-lang) + (aspect-native-choice symbol) + (current-carousell (array game-text-id)) + + (selection int) + (direction symbol) + (transition symbol) + (x-offset int32) + ) + ) +(define *progress-carousell* (new 'static 'progress-carousell-state)) + + +(define *carousell-display-mode* (new 'static 'boxed-array :type game-text-id :length 3 :allocated-length 3 + (game-text-id windowed) + (game-text-id fullscreen) + (game-text-id borderless) + )) + +(define *carousell-msaa* (new 'static 'boxed-array :type game-text-id :length 5 :allocated-length 5 + (game-text-id off) + (game-text-id 2-times) + (game-text-id 4-times) + (game-text-id 8-times) + (game-text-id 16-times) + )) + +(define *carousell-lod-bg* (new 'static 'boxed-array :type game-text-id :length 2 :allocated-length 2 + (game-text-id lod-high) + (game-text-id lod-low) + )) + +(define *carousell-lod-fg* (new 'static 'boxed-array :type game-text-id :length 3 :allocated-length 3 + (game-text-id lod-high) + (game-text-id lod-low) + (game-text-id lod-ps2) + )) + +(define *carousell-subtitle-language* (new 'static 'boxed-array :type game-text-id :length 6 :allocated-length 6 + (game-text-id english) + (game-text-id french) + (game-text-id german) + (game-text-id spanish) + (game-text-id italian) + (game-text-id japanese) + )) + +(define *carousell-speaker* (new 'static 'boxed-array :type game-text-id :length 3 :allocated-length 3 + (game-text-id speaker-always) + (game-text-id speaker-never) + (game-text-id speaker-auto) + )) + + + +;;--------------------------- +;;--------------------------- +;; pc menu defines + + +(define *game-options-pc* + (new 'static 'boxed-array :type game-option :length 6 :allocated-length 6 + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id camera-options) :scale #t :param3 (game-option-menu camera-options)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id accessibility-options) :scale #t :param3 (game-option-menu accessibility-options)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id misc-options) :scale #t :param3 (game-option-menu misc-options)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *graphic-options-pc* + (new 'static 'boxed-array :type game-option :length 8 :allocated-length 9 + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-resolution) :scale #t :param3 (game-option-menu resolution)) + (new 'static 'game-option :option-type (game-option-type display-mode) :name (game-text-id display-mode) :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-native) :name (game-text-id ps2-aspect-ratio) :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-ratio) :name (game-text-id aspect-ratio-ps2) :scale #t) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id aspect-ratio) :scale #t :param3 (game-option-menu aspect-ratio)) + (new 'static 'game-option :option-type (game-option-type msaa) :name (game-text-id msaa) :scale #t) + ;(new 'static 'game-option :option-type (game-option-type frame-rate) :name (game-text-id frame-rate) :scale #t) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id ps2-options) :scale #t :param3 (game-option-menu gfx-ps2-options)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *misc-options* + (new 'static 'boxed-array :type game-option :length 2 :allocated-length 2 + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id discord-rpc) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *camera-options* + (new 'static 'boxed-array :type game-option :length 3 :allocated-length 3 + (new 'static 'game-option :option-type (game-option-type normal-inverted) :name (game-text-id camera-controls-horz) :scale #t) + (new 'static 'game-option :option-type (game-option-type normal-inverted) :name (game-text-id camera-controls-vert) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *accessibility-options* + (new 'static 'boxed-array :type game-option :length 2 :allocated-length 2 + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id money-starburst) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *gfx-ps2-options* + (new 'static 'boxed-array :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option :option-type (game-option-type lod-bg) :name (game-text-id lod-bg) :scale #t) + (new 'static 'game-option :option-type (game-option-type lod-fg) :name (game-text-id lod-fg) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id ps2-parts) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *aspect-ratio-options* + (new 'static 'boxed-array :type game-option :length 6 :allocated-length 6 + (new 'static 'game-option :option-type (game-option-type aspect-new) :name (game-text-id fit-to-screen) :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-new) :name (game-text-id resolution-fmt) :param1 4.0 :param2 3.0 :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-new) :name (game-text-id resolution-fmt) :param1 16.0 :param2 9.0 :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-new) :name (game-text-id resolution-fmt) :param1 21.0 :param2 9.0 :scale #t) + (new 'static 'game-option :option-type (game-option-type aspect-new) :name (game-text-id resolution-fmt) :param1 64.0 :param2 27.0 :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *sound-options-pc* + (new 'static 'boxed-array :type game-option :length 9 :allocated-length 9 + (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) + (new 'static 'game-option :option-type (game-option-type language) :name (game-text-id language) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id subtitles) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id hinttitles) :scale #t) + (new 'static 'game-option :option-type (game-option-type language-subtitles) :name (game-text-id subtitles-language) :scale #t) + (new 'static 'game-option :option-type (game-option-type speaker) :name (game-text-id subtitles-speaker) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *back-button* (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t)) +(define-perm *temp-options-alloced* symbol #f) + +(defconstant RESOLUTIONS 6) +(define *resolutions* (new 'static 'array int32 RESOLUTIONS + 640 720 768 800 960 1080)) + +;; this is to avoid changing the value of *temp-options* or reallocating the options when reloading file +(unless *temp-options-alloced* +(define *temp-options* (new 'static 'boxed-array :type game-option :length 200 :allocated-length 200)) +(dotimes (i (-> *temp-options* length)) + (set! (-> *temp-options* i) (new 'global 'game-option))) +(true! *temp-options-alloced*)) + + +(defun find-highest-resolution () + + (let ((sx 0) (sy 0) (found #f) (mult GAME_MIN_RES_MULT) (lastr 0) (hir 0) (lor 0)) + (pc-get-screen-size -1 (the (pointer int32) (& sx)) (the (pointer int32) (& sy)) (the (pointer int32) 0)) + (if (> sy sx) + (set! sy sx)) + + (until found + + (dotimes (i RESOLUTIONS) + (let ((thisr (the int (* mult (the float (-> *resolutions* i)))))) + (cond + ((< sy thisr) + (if (zero? i) + (*! mult 0.5)) + (set! i RESOLUTIONS) + (true! found) + ) + (else + (set! lastr thisr)) + ) + )) + + (if (not found) + (*! mult 2)) + + ) + (set! hir lastr) + mult + ) + + ) + +(defmacro add-resolution-option (x y) + "add a resolution button to *temp-options* with specified size" + `(let ((option (-> *temp-options* (length *temp-options*)))) + (set! (-> option option-type) (game-option-type resolution)) + (set! (-> option name) (game-text-id resolution-fmt)) + (set! (-> option param1) (the float ,x)) + (set! (-> option param2) (the float ,y)) + (set! (-> option scale) #t) + + (1+! (-> *temp-options* length)) + ) + ) + +(defmacro add-back-option () + "add *back-button* to *temp-options*" + `(let ((option (-> *temp-options* (length *temp-options*)))) + (set! (-> option option-type) (game-option-type button)) + (set! (-> option name) (game-text-id back)) + (set! (-> option scale) #t) + + (1+! (-> *temp-options* length)) + ) + ) + +(defun build-resolution-options ((skip int) (amount int)) + + (set! (-> *temp-options* length) 0) + + (let ((done? #f) (mult (find-highest-resolution)) (sx 0) (sy 0) (vmodes 0) (flip? #f) (aspect 0.0) + ;; hack - do not use screen resolution in windowed mode, taskbar etc. messes it up and makes it useless! + (skip? (= 'windowed (pc-get-fullscreen))) + ;; shortcut + (max-options (1- (-> *temp-options* allocated-length)))) + + ;; portrait mode. unused + (set! flip? (> sy sx)) + ;; get screen size (for capping) + (pc-get-screen-size -1 (the (pointer int32) (& sx)) (the (pointer int32) (& sy)) (the (pointer int32) (& vmodes))) + + (case (pc-get-fullscreen) + (('fullscreen) + ;; insert psyched out trollface here + (set! sx 0) + (set! sy 0) + (countdown (i vmodes) + (let ((thisx 0) (thisy 0)) + (pc-get-screen-size i (the (pointer int32) (& thisx)) (the (pointer int32) (& thisy)) (the (pointer int32) 0)) + + (when (not (and (= thisx sx) (= thisy sy))) + (add-resolution-option thisx thisy) + ) + (set! sx thisx) + (set! sy thisy) + ) + ) + ) + + (else + ;; extra button when fullscreen + (when (not skip?) + (add-resolution-option sx sy) + (set! (-> *temp-options* (1- (length *temp-options*)) name) (game-text-id fit-to-screen)) + ) + ;; game aspect ratio + (set! aspect (-> *pc-settings* aspect-ratio)) + + (until (or done? (= (length *temp-options*) max-options)) + (countdown (i RESOLUTIONS) + (let ((thisr (the int (* mult (the float (-> *resolutions* i)))))) + + (when (and (< (length *temp-options*) max-options) (<= thisr sy) (not skip?)) + (add-resolution-option (* aspect (the float thisr)) thisr) + )) + (false! skip?) + ) + + (if (> mult GAME_MIN_RES_MULT) + (*! mult 0.5) + (true! done?)) + ) + ) + ) + (add-back-option) + ) + + + *temp-options* + ) + + +(defun print-string-in-carousell ((arg0 game-text-id) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((s5-0 (if arg3 + arg2 + (- arg2) + ) + ) + ) + (+! (-> arg1 origin x) (the float s5-0)) + (let ((f30-0 (- 1.0 (* 0.0033333334 (the float arg2))))) + (print-game-text-scaled (lookup-text! *common-text* arg0 #f) f30-0 arg1 (the int (* 128.0 f30-0))) + ) + (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float s5-0))) + ) + (set! (-> arg1 color) (font-color default)) + arg1 + ) + +(defun progress-draw-carousell-from-string-list ((options (array game-text-id)) (font font-context) (y-off int) (new-val int)) + "yep." + + (let ((old-lang (-> *progress-carousell* selection)) + (new-lang new-val) + (max-lang (length options)) + ) + (if (-> *progress-carousell* transition) + (seekl! (-> *progress-carousell* x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio))))) + (when (>= (-> *progress-carousell* x-offset) 100) + (set! (-> *progress-carousell* selection) new-lang) + (set! old-lang new-lang) + (set! (-> *progress-carousell* transition) #f) + (set! (-> *progress-carousell* x-offset) 0) + ) + (set! (-> font origin y) (the float (+ y-off 3))) + ;(set-color! font (font-color lighter-lighter-blue)) + 0 + (let ((next-lang (mod (+ old-lang 1) max-lang)) + (prev-lang (mod (+ max-lang -1 old-lang) max-lang)) + ;; these are used during the transition since it technically allows you to see 4 langs at once. + (next2-lang (mod (+ old-lang 2) max-lang)) + (prev2-lang (mod (+ max-lang -2 old-lang) max-lang)) + ) + (cond + ((-> *progress-carousell* direction) + (let ((a2-22 (- 200 (+ (-> *progress-carousell* x-offset) 100)))) + (print-string-in-carousell (-> options prev-lang) font a2-22 #f) + ) + (let ((a2-23 (+ (-> *progress-carousell* x-offset) 100))) + (cond + ((< a2-23 150) + (print-string-in-carousell (-> options next-lang) font a2-23 #t) + ) + (else + (let ((a2-24 (- 200 (-> *progress-carousell* x-offset)))) + (print-string-in-carousell (-> options prev2-lang) font a2-24 #f) + ) + ) + ) + ) + ) + (else + (let ((a2-25 (+ (-> *progress-carousell* x-offset) 100))) + (cond + ((< a2-25 150) + (print-string-in-carousell (-> options prev-lang) font a2-25 #f) + ) + (else + (let ((a2-26 (- 200 (-> *progress-carousell* x-offset)))) + (print-string-in-carousell (-> options next2-lang) font a2-26 #t) + ) + ) + ) + ) + (let ((a2-27 (- 200 (+ (-> *progress-carousell* x-offset) 100)))) + (print-string-in-carousell (-> options next-lang) font a2-27 #t) + ) + ) + ) + ) + (if (not (-> *progress-carousell* transition)) + (set-color! font (font-color yellow-green-2))) + (print-string-in-carousell (-> options old-lang) font (-> *progress-carousell* x-offset) (-> *progress-carousell* direction)) + ) + ) + +;;--------------------------- +;;--------------------------- +;; function overrides + +(defun init-game-options ((obj progress)) + "Set the options for all of the menus." + + ;; start off by making them all invalid + (dotimes (i (progress-screen max)) + (set! (-> *options-remap* i) #f) + ) + + ;; set up options for each screen + (set! (-> *options-remap* (progress-screen settings)) *main-options*) + (set! (-> *options-remap* (progress-screen game-settings)) *game-options-pc*) + (set! (-> *options-remap* (progress-screen graphic-settings)) *graphic-options-pc*) + + (set! (-> *options-remap* (progress-screen sound-settings)) *sound-options-pc*) + (set! (-> *options-remap* (progress-screen memcard-no-space)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-not-inserted)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-not-formatted)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-format)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen memcard-data-exists)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen memcard-insert)) *ok-options*) + (set! (-> *options-remap* (progress-screen load-game)) *load-options*) + (set! (-> *options-remap* (progress-screen save-game)) *save-options*) + (set! (-> *options-remap* (progress-screen save-game-title)) *save-options-title*) + (set! (-> *options-remap* (progress-screen memcard-error-loading)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-error-saving)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-error-formatting)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-error-creating)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-auto-save-error)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-removed)) *ok-options*) + (set! (-> *options-remap* (progress-screen memcard-no-data)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen title)) *title*) + (set! (-> *options-remap* (progress-screen settings-title)) *options*) + (set! (-> *options-remap* (progress-screen auto-save)) *ok-options*) + (set! (-> *options-remap* (progress-screen pal-change-to-60hz)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen pal-now-60hz)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen no-disc)) *ok-options*) + (set! (-> *options-remap* (progress-screen bad-disc)) *ok-options*) + (set! (-> *options-remap* (progress-screen quit)) *yes-no-options*) + ;; our screens! + (set! (-> *options-remap* (progress-screen aspect-msg)) *yes-no-options*) + (set! (-> *options-remap* (progress-screen camera-options)) *camera-options*) + (set! (-> *options-remap* (progress-screen misc-options)) *misc-options*) + (set! (-> *options-remap* (progress-screen accessibility-options)) *accessibility-options*) + (set! (-> *options-remap* (progress-screen gfx-ps2-options)) *gfx-ps2-options*) + (set! (-> *options-remap* (progress-screen resolution)) *temp-options*) + (set! (-> *options-remap* (progress-screen aspect-ratio)) *aspect-ratio-options*) + + ;; set default params + (set! (-> *progress-state* aspect-ratio-choice) (get-aspect-ratio)) + (set! (-> *progress-state* video-mode-choice) (get-video-mode)) + (set! (-> *progress-state* yes-no-choice) #f) + + ;; set variable pointers + (set! (-> *game-options* 0 value-to-modify) (&-> *setting-control* default vibration)) + (set! (-> *game-options* 1 value-to-modify) (&-> *setting-control* default play-hints)) + (set! (-> *game-options* 2 value-to-modify) (&-> *setting-control* default language)) + (set! (-> *game-options-japan* 0 value-to-modify) (&-> *setting-control* default vibration)) + (set! (-> *game-options-japan* 1 value-to-modify) (&-> *setting-control* default play-hints)) + (set! (-> *game-options-demo* 0 value-to-modify) (&-> *setting-control* default vibration)) + (set! (-> *game-options-demo* 1 value-to-modify) (&-> *setting-control* default play-hints)) + (set! (-> *graphic-options* 1 value-to-modify) (&-> *progress-state* aspect-ratio-choice)) + (set! (-> *graphic-title-options-pal* 1 value-to-modify) (&-> *progress-state* video-mode-choice)) + (set! (-> *graphic-title-options-pal* 2 value-to-modify) (&-> *progress-state* aspect-ratio-choice)) + (set! (-> *sound-options* 0 value-to-modify) (&-> *setting-control* default sfx-volume)) + (set! (-> *sound-options* 1 value-to-modify) (&-> *setting-control* default music-volume)) + (set! (-> *sound-options* 2 value-to-modify) (&-> *setting-control* default dialog-volume)) + (set! (-> *yes-no-options* 0 value-to-modify) (&-> *progress-state* yes-no-choice)) + ;; our options! + (set! (-> *game-options-pc* 0 value-to-modify) (&-> *setting-control* default vibration)) + (set! (-> *game-options-pc* 1 value-to-modify) (&-> *setting-control* default play-hints)) + (set! (-> *graphic-options-pc* 1 value-to-modify) (&-> *progress-carousell* int-backup)) + (set! (-> *graphic-options-pc* 2 value-to-modify) (&-> *progress-carousell* aspect-native-choice)) + (set! (-> *graphic-options-pc* 3 value-to-modify) (&-> *progress-state* aspect-ratio-choice)) + (set! (-> *graphic-options-pc* 5 value-to-modify) (&-> *progress-carousell* int-backup)) + (set! (-> *misc-options* 0 value-to-modify) (&-> *pc-settings* discord-rpc?)) + (set! (-> *camera-options* 0 value-to-modify) (&-> *pc-settings* camera-hflip?)) + (set! (-> *camera-options* 1 value-to-modify) (&-> *pc-settings* camera-vflip?)) + (set! (-> *accessibility-options* 0 value-to-modify) (&-> *pc-settings* money-starburst?)) + (set! (-> *gfx-ps2-options* 0 value-to-modify) (&-> *progress-carousell* int-backup)) + (set! (-> *gfx-ps2-options* 1 value-to-modify) (&-> *progress-carousell* int-backup)) + (set! (-> *gfx-ps2-options* 2 value-to-modify) (&-> *pc-settings* ps2-parts?)) + (set! (-> *sound-options-pc* 0 value-to-modify) (&-> *setting-control* default sfx-volume)) + (set! (-> *sound-options-pc* 1 value-to-modify) (&-> *setting-control* default music-volume)) + (set! (-> *sound-options-pc* 2 value-to-modify) (&-> *setting-control* default dialog-volume)) + (set! (-> *sound-options-pc* 3 value-to-modify) (&-> *setting-control* default language)) + (set! (-> *sound-options-pc* 4 value-to-modify) (&-> *pc-settings* subtitles?)) + (set! (-> *sound-options-pc* 5 value-to-modify) (&-> *pc-settings* hinttitles?)) + (set! (-> *sound-options-pc* 6 value-to-modify) (&-> *progress-carousell* subtitle-backup)) + (set! (-> *sound-options-pc* 7 value-to-modify) (&-> *progress-carousell* int-backup)) + (set! (-> *progress-carousell* aspect-native-choice) (-> *pc-settings* use-vis?)) + + ;; scroll stuff! + (progress-scroll-reset) + (none) + ) + + + +(defmethod respond-common progress ((obj progress)) + "common logic for navigating the progress menu. + this is the overriden version, purged of no longer necessary code and with additional new code." + + ;; read memcard + (mc-get-slot-info 0 *progress-save-info*) + (set! (-> obj card-info) *progress-save-info*) + ;; build custom dynamic menus + (case (-> obj display-state) + (((progress-screen resolution)) + ;; TODO infinite scrolling + (build-resolution-options 0 0) + ) + ) + ;; run nav code + (let ((options (-> *options-remap* (-> obj display-state)))) + ;; snap scroll if oob + (when (> (length options) PROGRESS_PC_PAGE_HEIGHT) + (set! (-> *progress-scroll* start-index) (max (-> *progress-scroll* start-index) + (- (-> obj option-index) (+ PROGRESS_PC_PAGE_HEIGHT -2)))) + ) + (when (and options (not (or (progress-scrolling?) (-> obj in-transition)))) + ;; only respond to inputs when transition is done (and also there's options at all) + (cond + ((cpad-pressed? 0 up) + ;; pressed up + ;; original code checked hold and then press, because hold can be used during center screen option. which we don't use. + (when (not (-> obj selected-option)) + (if (!= (length options) 1) + (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + ) + (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) + (cond + ((> (-> obj option-index) 0) + (1-! (-> obj option-index)) + (when (and (> (length options) PROGRESS_PC_PAGE_HEIGHT) (< (-> obj option-index) *progress-scroll-start*)) + (progress-scroll-up!) + ) + ) + (else + (set! (-> obj option-index) (1- (length options))) + (set! (-> *progress-scroll* start-index) (max 0 (- (length options) PROGRESS_PC_PAGE_HEIGHT -1))) + ) + ) + ) + ) + ((cpad-pressed? 0 down) + ;; pressed down. + (when (not (-> obj selected-option)) + (if (!= (length options) 1) + (sound-play-by-name (static-sound-name "cursor-up-down") (new-sound-id) 1024 0 0 1 #t) + ) + (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) + (cond + ((< (-> obj option-index) (1- (length options))) + (1+! (-> obj option-index)) + (when (and (> (length options) PROGRESS_PC_PAGE_HEIGHT) (>= (-> obj option-index) *progress-scroll-end*)) + (progress-scroll-down!) + ) + ) + (else + (set! (-> obj option-index) 0) + (set! (-> *progress-scroll* start-index) 0) + ) + ) + ) + ) + ((cpad-hold? 0 left) + ;; holding left. sliders use hold. + (cond + ((cpad-pressed? 0 left) + ;; navigate left. + (when (or (-> obj selected-option) (= (-> options (-> obj option-index) option-type) (game-option-type yes-no))) + (let ((sound? #f)) + (case (-> options (-> obj option-index) option-type) + (((game-option-type on-off) + (game-option-type yes-no) + (game-option-type normal-inverted) + (game-option-type aspect-native)) + ;; pressed left on an on/off yes/no option + (when (not (-> (the-as (pointer uint32) (-> options (-> obj option-index) value-to-modify)))) + ;; it was on 'off' or 'no' + (set! sound? #t) + ;; vibrate if this toggles vibration. broken in original game. + (if (= (-> options (-> obj option-index) value-to-modify) (&-> *setting-control* default vibration)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) + ) + ) + ;; it's on 'on' or 'yes' now + (set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) #t) + ) + (((game-option-type aspect-ratio)) + (set! sound? (= (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) 'aspect16x9)) + (set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) 'aspect4x3) + ) + (((game-option-type language)) + ;; language selection. if not on first language, go back. if on first language, go to last. + (if (> (the-as int (-> (the-as (pointer uint64) (-> options (-> obj option-index) value-to-modify)))) 0) + (+! (-> (the-as (pointer uint64) (-> options (-> obj option-index) value-to-modify))) -1) + (set! (-> (the-as (pointer int64) (-> options (-> obj option-index) value-to-modify))) 5) + ) + ;; language was updated. + (set! (-> obj language-transition) #t) + (set! (-> obj language-direction) #t) + (set! sound? #t) + ) + (((game-option-type display-mode) + (game-option-type msaa) + (game-option-type lod-bg) + (game-option-type lod-fg) + (game-option-type speaker) + ) + ;; a carousell like language + (if (> (-> (the-as (pointer int) (-> options (-> obj option-index) value-to-modify))) 0) + (+! (-> (the-as (pointer int) (-> options (-> obj option-index) value-to-modify))) -1) + (set! (-> (the-as (pointer int) (-> options (-> obj option-index) value-to-modify))) (1- (length (-> *progress-carousell* current-carousell)))) + ) + ;; updated. + (set! (-> *progress-carousell* transition) #t) + (set! (-> *progress-carousell* direction) #t) + (set! sound? #t) + ) + (((game-option-type language-subtitles)) + ;; a carousell like language + (if (> (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (the-as pc-subtitle-lang 0)) + (+! (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (the-as pc-subtitle-lang -1)) + (set! (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (the-as pc-subtitle-lang (1- (length (-> *progress-carousell* current-carousell))))) + ) + ;; updated. + (set! (-> *progress-carousell* transition) #t) + (set! (-> *progress-carousell* direction) #t) + (set! sound? #t) + ) + ) + (if sound? + (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + ) + ) + ) + ) + (else + ;; holding left + (when (-> obj selected-option) + (let ((sound? #f)) + (case (-> options (-> obj option-index) option-type) + (((game-option-type slider)) + ;; slider is selected + (cond + ((>= (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (+ 1.0 (-> options (-> obj option-index) param1))) + ;; we're 1 above minimum, so reduce by 1 + (set! (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (+ -1.0 (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))))) + (set! sound? #t) + ) + ((< (-> options (-> obj option-index) param1) + ;; not at least 1 above minimum, just set to minimum (why not just use max or something!!) + (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify)))) + (set! (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (-> options (-> obj option-index) param1)) + (set! sound? #t) + ) + ) + ) + ) + ;; play sound + (when sound? + (let ((vol 100.0)) + (case (-> options (-> obj option-index) name) + (((game-text-id music-volume) (game-text-id speech-volume)) + (set! vol (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify)))) + ) + ) + (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) + (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) + (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 vol)) 0 0 1 #t) + ) + ) + ) + ) + ) + ) + ) + ) + ((cpad-hold? 0 right) + ;; holding right + (cond + ((cpad-pressed? 0 right) + ;; pressed right + (when (or (-> obj selected-option) (= (-> options (-> obj option-index) option-type) (game-option-type yes-no))) + (let ((sound? #f)) + (case (-> options (-> obj option-index) option-type) + (((game-option-type on-off) + (game-option-type yes-no) + (game-option-type normal-inverted) + (game-option-type aspect-native) + ) + ;; play sound if it was on 'yes' because we're going to 'no' now + (set! sound? (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))) + ;; set to no + (set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) #f) + ) + (((game-option-type aspect-ratio)) + ;; same shit different toilet + (set! sound? (= (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) 'aspect4x3)) + (set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) 'aspect16x9) + ) + (((game-option-type language)) + ;; same thing as before. if at last, go to first. otherwise, keep going forward. + (if (< (the-as int (-> (the-as (pointer uint64) (-> options (-> obj option-index) value-to-modify)))) 5) + (1+! (-> (the-as (pointer uint64) (-> options (-> obj option-index) value-to-modify)))) + (set! (-> (the-as (pointer int64) (-> options (-> obj option-index) value-to-modify))) 0) + ) + (set! (-> obj language-transition) #t) + (set! (-> obj language-direction) #f) + (set! sound? #t) + ) + (((game-option-type display-mode) + (game-option-type msaa) + (game-option-type lod-bg) + (game-option-type lod-fg) + (game-option-type speaker) + ) + ;; same thing as before. if at last, go to first. otherwise, keep going forward. + (if (< (-> (the-as (pointer int) (-> options (-> obj option-index) value-to-modify))) (1- (length (-> *progress-carousell* current-carousell)))) + (1+! (-> (the-as (pointer int) (-> options (-> obj option-index) value-to-modify)))) + (set! (-> (the-as (pointer int) (-> options (-> obj option-index) value-to-modify))) 0) + ) + (set! (-> *progress-carousell* transition) #t) + (set! (-> *progress-carousell* direction) #f) + (set! sound? #t) + ) + (((game-option-type language-subtitles)) + ;; same thing as before. if at last, go to first. otherwise, keep going forward. + (if (< (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (1- (length (-> *progress-carousell* current-carousell)))) + (+! (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (the-as pc-subtitle-lang 1)) + (set! (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (the-as pc-subtitle-lang 0)) + ) + (set! (-> *progress-carousell* transition) #t) + (set! (-> *progress-carousell* direction) #f) + (set! sound? #t) + ) + ) + ;; play sound if desired + (if sound? + (sound-play-by-name (static-sound-name "cursor-l-r") (new-sound-id) 1024 0 0 1 #t) + ) + ) + ) + ) + (else + ;; holding right, but didnt just press it. same slider stuff as before + (when (-> obj selected-option) + (let ((sound? #f)) + (case (-> options (-> obj option-index) option-type) + (((game-option-type slider)) + (cond + ((>= (+ -1.0 (-> options (-> obj option-index) param2)) + (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify)))) + (set! (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (+ 1.0 (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))))) + (set! sound? #t) + ) + ((< (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (-> options (-> obj option-index) param2)) + (set! (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (-> options (-> obj option-index) param2)) + (set! sound? #t) + ) + ) + ) + ) + (when sound? + (let ((vol 100.0)) + (case (-> options (-> obj option-index) name) + (((game-text-id music-volume) (game-text-id speech-volume)) + (set! vol (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify)))) + ) + ) + (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) + (set! (-> *progress-state* last-slider-sound) (-> *display* real-frame-counter)) + (sound-play-by-name (static-sound-name "slider2001") (new-sound-id) (the int (* 10.24 vol)) 0 0 1 #t) + ) + ) + ) + ) + ) + ) + ) + ) + ((or (cpad-pressed? 0 square) (cpad-pressed? 0 triangle)) + ;; pressed square or triangle, cancel out! + (cond + ((-> obj selected-option) + ;; an option is selected. AHHH!!! just restore to whatever was on the backup + (case (-> options (-> obj option-index) option-type) + (((game-option-type slider)) + (set! (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify))) + (-> *progress-state* slider-backup)) + ) + (((game-option-type language)) + (set! (-> (the-as (pointer language-enum) (-> options (-> obj option-index) value-to-modify))) + (-> *progress-state* language-backup)) + ) + (((game-option-type on-off) (game-option-type normal-inverted)) + (set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) + (-> *progress-state* on-off-backup)) + ) + ) + ;; ding + (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (set! (-> obj selected-option) #f) + ) + ((or (can-go-back? obj) + (= (-> obj display-state) (progress-screen load-game)) + (= (-> obj display-state) (progress-screen save-game)) + (= (-> obj display-state) (progress-screen save-game-title)) + ) + ;; no option selected, go back + (cpad-clear! 0 square) + (cpad-clear! 0 triangle) + (if (= (-> obj display-state) (progress-screen settings)) + (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + ) + (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ) + ) + ((or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) + ;; pressed x or circle. advance! + (cond + ((not (-> obj selected-option)) + ;; no option already selected. + (cond + ((= (-> options (-> obj option-index) option-type) (game-option-type menu)) + ;; go to a menu + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (push! obj) + (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (set! (-> obj next-display-state) (the-as progress-screen (-> options (-> obj option-index) param3))) + (case (-> obj next-display-state) + (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) + (set! (-> obj next-display-state) (set-memcard-screen obj (-> obj next-display-state))) + ) + ) + ) + ((= (-> options (-> obj option-index) option-type) (game-option-type button)) + ;; a button. what? + (case (-> options (-> obj option-index) name) + (((game-text-id exit-demo)) + ;; exit demo! + (set! *master-exit* 'force) + (set-master-mode 'game) + ) + (((game-text-id back)) + ;; go back! + (if (= (-> obj display-state) (progress-screen settings)) + (sound-play-by-name (static-sound-name "menu-stats") (new-sound-id) 1024 0 0 1 #t) + (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + ) + (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ) + ;; other behaviors are hardcoded elsewhere because screw you. + ) + ((= (-> options (-> obj option-index) option-type) (game-option-type resolution)) + ;; resolution button. change resolution! + (let ((newx (the int (-> options (-> obj option-index) param1))) + (newy (the int (-> options (-> obj option-index) param2)))) + (set-size! *pc-settings* newx newy)) + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (cpad-clear! 0 square) + (cpad-clear! 0 triangle) + (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ((= (-> options (-> obj option-index) option-type) (game-option-type aspect-new)) + ;; resolution button. change resolution! + (let ((newx (the int (-> options (-> obj option-index) param1))) + (newy (the int (-> options (-> obj option-index) param2)))) + (if (= (-> options (-> obj option-index) name) (game-text-id fit-to-screen)) + (true! (-> *pc-settings* aspect-ratio-auto?)) + (set-aspect! *pc-settings* newx newy))) + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (cpad-clear! 0 square) + (cpad-clear! 0 triangle) + (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (set! (-> obj next-display-state) (progress-screen invalid)) + ) + ((!= (-> options (-> obj option-index) option-type) (game-option-type yes-no)) + ;; not yes-no + ;; set backups! we're entering some toggle or whatever + (case (-> options (-> obj option-index) option-type) + (((game-option-type slider)) + (set! (-> *progress-state* slider-backup) + (-> (the-as (pointer float) (-> options (-> obj option-index) value-to-modify)))) + ) + (((game-option-type language)) + (set! (-> *progress-state* language-backup) + (-> (the-as (pointer language-enum) (-> options (-> obj option-index) value-to-modify)))) + ) + (((game-option-type language-subtitles)) + (set! (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))) (-> *pc-settings* subtitle-language)) + ) + (((game-option-type on-off) (game-option-type normal-inverted)) + (set! (-> *progress-state* on-off-backup) + (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))) + ) + (((game-option-type display-mode)) + ;; display-mode just reuses language stuff + (case (pc-get-fullscreen) + (('windowed #f) (set! (-> *progress-carousell* int-backup) 0)) + (('fullscreen #t) (set! (-> *progress-carousell* int-backup) 1)) + (('borderless) (set! (-> *progress-carousell* int-backup) 2)) + ) + ) + (((game-option-type msaa)) + (case (-> *pc-settings* gfx-msaa) + ((2) (set! (-> *progress-carousell* int-backup) 1)) + ((4) (set! (-> *progress-carousell* int-backup) 2)) + ((8) (set! (-> *progress-carousell* int-backup) 3)) + ((16) (set! (-> *progress-carousell* int-backup) 4)) + (else (set! (-> *progress-carousell* int-backup) 0)) + ) + ) + (((game-option-type lod-bg)) + (case (-> *pc-settings* lod-force-tfrag) + ((0) (set! (-> *progress-carousell* int-backup) 0)) + ((1 2) (set! (-> *progress-carousell* int-backup) 1)) + (else (set! (-> *progress-carousell* int-backup) 2)) + ) + ) + (((game-option-type lod-fg)) + (cond + ((-> *pc-settings* ps2-lod-dist?) (set! (-> *progress-carousell* int-backup) 1)) + (else (set! (-> *progress-carousell* int-backup) 0)) + ) + ) + (((game-option-type speaker)) + (case (-> *pc-settings* subtitle-speaker?) + ((#t) (set! (-> *progress-carousell* int-backup) 0)) + ((#f) (set! (-> *progress-carousell* int-backup) 1)) + (('auto) (set! (-> *progress-carousell* int-backup) 2)) + ) + ) + ) + (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (set! (-> obj selected-option) #t) + (case (-> options (-> obj option-index) option-type) + (((game-option-type language)) + (set! (-> obj language-selection) (-> *setting-control* current language)) + (set! (-> obj language-direction) #t) + (set! (-> obj language-transition) #f) + (set! (-> obj language-x-offset) 0) + ) + (else + (set! (-> *progress-carousell* selection) (-> *progress-carousell* int-backup)) + (set! (-> *progress-carousell* direction) #t) + (set! (-> *progress-carousell* transition) #f) + (set! (-> *progress-carousell* x-offset) 0) + (case (-> options (-> obj option-index) option-type) + (((game-option-type display-mode)) (set! (-> *progress-carousell* current-carousell) *carousell-display-mode*)) + (((game-option-type msaa)) (set! (-> *progress-carousell* current-carousell) *carousell-msaa*)) + (((game-option-type lod-bg)) (set! (-> *progress-carousell* current-carousell) *carousell-lod-bg*)) + (((game-option-type lod-fg)) (set! (-> *progress-carousell* current-carousell) *carousell-lod-bg*)) + (((game-option-type speaker)) (set! (-> *progress-carousell* current-carousell) *carousell-speaker*)) + (((game-option-type language-subtitles)) + (set! (-> *progress-carousell* current-carousell) *carousell-subtitle-language*) + (set! (-> *progress-carousell* selection) (the int (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify))))) + ) + ) + ) + ) + ) + ) + ) + (else + ;; an option was selected. write stuff! + (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) + (set! (-> obj selected-option) #f) + (case (-> options (-> obj option-index) option-type) + (((game-option-type aspect-ratio)) + ;; aspect ratio is first written to the backup. so this is for applying the change if we went through with it. + (set! (-> *setting-control* default aspect-ratio) (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))) + ) + (((game-option-type aspect-native)) + (set! (-> *pc-settings* use-vis?) (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))) + (if (-> *pc-settings* use-vis?) + (set! (-> *setting-control* current aspect-ratio) #f) + (set-aspect! *pc-settings* (-> *pc-settings* aspect-custom-x) (-> *pc-settings* aspect-custom-y))) + ) + (((game-option-type display-mode)) + ;; same thing. + (case (-> *progress-carousell* int-backup) + ((0) (set-display-mode! *pc-settings* 'windowed)) + ((1) (set-display-mode! *pc-settings* 'fullscreen)) + ((2) (set-display-mode! *pc-settings* 'borderless)) + ) + ) + (((game-option-type msaa)) + (case (-> *progress-carousell* int-backup) + ((0) (set! (-> *pc-settings* gfx-msaa) 1)) + ((1) (set! (-> *pc-settings* gfx-msaa) 2)) + ((2) (set! (-> *pc-settings* gfx-msaa) 4)) + ((3) (set! (-> *pc-settings* gfx-msaa) 8)) + ((4) (set! (-> *pc-settings* gfx-msaa) 16)) + ) + ) + (((game-option-type lod-bg)) + (case (-> *progress-carousell* int-backup) + ((0) (set! (-> *pc-settings* lod-force-tfrag) 0) (set! (-> *pc-settings* lod-force-tie) 0)) + ((1) (set! (-> *pc-settings* lod-force-tfrag) 2) (set! (-> *pc-settings* lod-force-tie) 2)) + ((2) (set! (-> *pc-settings* lod-force-tfrag) 2) (set! (-> *pc-settings* lod-force-tie) 3)) + ) + ) + (((game-option-type lod-fg)) + (case (-> *progress-carousell* int-backup) + ((0) (set! (-> *pc-settings* lod-force-actor) 0) (set! (-> *pc-settings* ps2-lod-dist?) #f)) + ((1) (set! (-> *pc-settings* lod-force-actor) 0) (set! (-> *pc-settings* ps2-lod-dist?) #t)) + ) + ) + (((game-option-type language)) + (if (not (-> obj language-transition)) + (load-level-text-files (-> obj display-level-index))) + ) + (((game-option-type language-subtitles)) + (set! (-> *pc-settings* subtitle-language) (-> (the-as (pointer pc-subtitle-lang) (-> options (-> obj option-index) value-to-modify)))) + ) + (((game-option-type speaker)) + ;; same thing. + (case (-> *progress-carousell* int-backup) + ((0) (set! (-> *pc-settings* subtitle-speaker?) #t)) + ((1) (set! (-> *pc-settings* subtitle-speaker?) #f)) + ((2) (set! (-> *pc-settings* subtitle-speaker?) 'auto)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + + +(defmethod draw-options progress ((obj progress) (arg0 int) (arg1 int) (arg2 float)) + "common logic for drawing options menus." + + (let ((options (-> *options-remap* (-> obj display-state)))) + (when options + ;; this menu has options to draw omg + (let* ((line-amt (if (> (length options) PROGRESS_PC_PAGE_HEIGHT) (1- PROGRESS_PC_PAGE_HEIGHT) (length options))) + (y-off (- arg0 (/ (* arg1 line-amt) 2))) + (option-count 0) + (unkx 27) + (unk2 0) + (font (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning))) + ) + ;; set the common params for the text drawing + (set-width! font 370) + (set-height! font 25) + (set! (-> font flags) (font-flags shadow kerning middle left large)) + ;; when scrolling we draw an extra line + (cond + ((progress-scrolling-down?) (set! y-off (+ (- y-off arg1) (* (the float arg1) (- 1.0 (-> *progress-scroll* transition)))))) + ((progress-scrolling-up?) (set! y-off (+ (- y-off arg1) (* (the float arg1) (-> *progress-scroll* transition))))) + ) + (let ((draw-arrows (and (not (-> obj in-transition)) + (= (-> obj next-state name) 'progress-normal) + (> (length options) PROGRESS_PC_PAGE_HEIGHT) + (< (mod (-> *display* real-frame-counter) (seconds 0.2)) (seconds 0.1)))) + (draw-prev (< 0 *progress-scroll-start*)) + (draw-next (> (length options) *progress-scroll-end*))) + (set! (-> obj particles 32 init-pos x) (the float (if (and draw-arrows draw-prev) + (- 195 (-> *progress-process* 0 left-x-offset)) + -320 + ))) + (set! (-> obj particles 33 init-pos x) (the float (if (and draw-arrows draw-next) + (- 195 (-> *progress-process* 0 left-x-offset)) + -320 + ))) + ) + (dotimes (index (length options)) + (let ((option-str (the string #f)) ;; the option text + (option-x 17) + (option-y y-off) + ) + (case (-> options index option-type) + (((game-option-type yes-no)) + ;; yes-no option. text is either '->YES<- NO' or 'YES ->NO<-', not the most robust but this option is a strange hack anyway. + (if (-> (the-as (pointer uint32) (-> options index value-to-modify))) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id yes) #f) (lookup-text! *common-text* (game-text-id no) #f))) + (set! option-str (string-format "~0L~S ~30L~S" (lookup-text! *common-text* (game-text-id yes) #f) (lookup-text! *common-text* (game-text-id no) #f))) + ) + ) + (((game-option-type menu) (game-option-type button)) + ;; menu option or simple button. just draw its text! + (if (nonzero? (-> options index name)) + (set! option-str (lookup-text! *common-text* (-> options index name) #f)) + (set! option-str (the-as string #f)) + ) + ) + (((game-option-type resolution) (game-option-type aspect-new)) + ;; resolution settings + (set! option-str (string-format (lookup-text! *common-text* (-> options index name) #f) + (the int (-> options index param1)) (the int (-> options index param2)))) + ) + (else + (cond + ((and (-> obj selected-option) (= (-> obj option-index) index)) + ;; this option is SELECTED! + (set-color! font (font-color default)) + (set! (-> font origin x) (the float (- option-x (-> obj left-x-offset)))) + (set! (-> font origin y) (the float (+ y-off -8))) + (set-scale! font 0.6) + (print-game-text (lookup-text! *common-text* (-> options index name) #f) font #f 128 22) + (set! option-y (+ y-off 7)) + (case (-> options index option-type) + (((game-option-type slider)) + ;; draw a slider and its text. + ;; this ugliness is just decompiler stuff. all it does is fade the alpha according to value. + (let* ((v1-82 (the-as uint #x8000ffff)) + (f0-12 (* 0.01 (-> (the-as (pointer float) (-> options index value-to-modify))))) + (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) + (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) + ) + (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ y-off 8) f0-12 (the-as int a3-5)) + ) + (set! option-str (string-format "~D" (the int (-> (the-as (pointer float) (-> options index value-to-modify)))))) + (set! option-x (+ (the int (* 2.5 (-> (the-as (pointer float) (-> options index value-to-modify))))) -100)) + ) + (((game-option-type on-off) (game-option-type normal-inverted) (game-option-type aspect-native)) + ;; on-off option or some other toggle. same logic as yes-no. changed to cut down code duping. + (let ( + (on-str (case (-> options index option-type) + (((game-option-type on-off) (game-option-type aspect-native)) + (lookup-text! *common-text* (game-text-id on) #f)) + (((game-option-type normal-inverted)) + (lookup-text! *common-text* (game-text-id normal) #f)) + )) + (off-str (case (-> options index option-type) + (((game-option-type on-off) (game-option-type aspect-native)) + (lookup-text! *common-text* (game-text-id off) #f)) + (((game-option-type normal-inverted)) + (lookup-text! *common-text* (game-text-id inverted) #f)) + )) + ) + (if (-> (the-as (pointer symbol) (-> options index value-to-modify))) + (set! option-str (string-format "~30L~S~0L ~S" on-str off-str)) + (set! option-str (string-format "~0L~S ~30L~S" on-str off-str)) + ) + ) + ) + (((game-option-type display-mode) + (game-option-type msaa) + (game-option-type lod-bg) + (game-option-type lod-fg) + (game-option-type speaker) + ) + ;; crunched down to one generic function. + (progress-draw-carousell-from-string-list (-> *progress-carousell* current-carousell) font y-off (-> (the-as (pointer int) (-> options index value-to-modify)))) + ) + (((game-option-type language-subtitles)) + ;; crunched down to one generic function. + (progress-draw-carousell-from-string-list (-> *progress-carousell* current-carousell) font y-off (the int (-> (the-as (pointer pc-subtitle-lang) (-> options index value-to-modify))))) + ) + (((game-option-type language)) + ;; language carousell. who knew this could be so complicated. + (let ((old-lang (-> obj language-selection)) + (new-lang (-> (the-as (pointer language-enum) (-> options index value-to-modify)))) + (max-lang 6) + ) + (if (-> obj language-transition) + (seekl! (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio))))) + (when (>= (-> obj language-x-offset) 100) + (set! (-> obj language-selection) new-lang) + (set! old-lang new-lang) + (set! (-> obj language-transition) #f) + (set! (-> obj language-x-offset) 0) + ) + (set! (-> font origin y) (the float (+ y-off 3))) + ;(set-color! font (font-color lighter-lighter-blue)) + 0 + (let ((next-lang (mod (+ old-lang 1) max-lang)) + (prev-lang (mod (+ max-lang -1 old-lang) max-lang)) + ;; these are used during the transition since it technically allows you to see 4 langs at once. + (next2-lang (mod (+ old-lang 2) max-lang)) + (prev2-lang (mod (+ max-lang -2 old-lang) max-lang)) + ) + (cond + ((-> obj language-direction) + (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) + (print-language-name prev-lang font a2-22 #f) + ) + (let ((a2-23 (+ (-> obj language-x-offset) 100))) + (cond + ((< a2-23 150) + (print-language-name (the int next-lang) font a2-23 #t) + ) + (else + (let ((a2-24 (- 200 (-> obj language-x-offset)))) + (print-language-name prev2-lang font a2-24 #f) + ) + ) + ) + ) + ) + (else + (let ((a2-25 (+ (-> obj language-x-offset) 100))) + (cond + ((< a2-25 150) + (print-language-name prev-lang font a2-25 #f) + ) + (else + (let ((a2-26 (- 200 (-> obj language-x-offset)))) + (print-language-name (the int next2-lang) font a2-26 #t) + ) + ) + ) + ) + (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) + (print-language-name (the int next-lang) font a2-27 #t) + ) + ) + ) + ) + (if (not (-> obj language-transition)) + (set-color! font (font-color yellow-green-2))) + (print-language-name (the-as int old-lang) font (-> obj language-x-offset) (-> obj language-direction)) + )) + (((game-option-type aspect-ratio)) + ;; same as on-off but checks a different symbol + (if (= (-> (the-as (pointer symbol) (-> options index value-to-modify))) 'aspect4x3) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id 4x3) #f) (lookup-text! *common-text* (game-text-id 16x9) #f))) + (set! option-str (string-format "~0L~S ~30L~S" (lookup-text! *common-text* (game-text-id 4x3) #f) (lookup-text! *common-text* (game-text-id 16x9) #f))) + ) + ) + ) + ) + (else + ;; this option is not selected :-( + (case (-> options index option-type) + (((game-option-type slider) + (game-option-type aspect-ratio) + (game-option-type display-mode) + (game-option-type msaa) + (game-option-type lod-bg) + (game-option-type lod-fg) + (game-option-type speaker) + ) + ;; slider and aspect ratio options just show their text + (set! option-str (lookup-text! *common-text* (-> options index name) #f)) + ) + (((game-option-type on-off) (game-option-type aspect-native)) + ;; on-off options show their text + on or off + (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> options index name) #f) + (if (-> (the-as (pointer uint32) (-> options index value-to-modify))) + (lookup-text! *common-text* (game-text-id on) #f) + (lookup-text! *common-text* (game-text-id off) #f) + ))) + ) + (((game-option-type normal-inverted)) + ;; etc + (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> options index name) #f) + (if (-> (the-as (pointer uint32) (-> options index value-to-modify))) + (lookup-text! *common-text* (game-text-id normal) #f) + (lookup-text! *common-text* (game-text-id inverted) #f) + ))) + ) + (((game-option-type language)) + ;; language options show their text + language name + (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> options index name) #f) + (lookup-text! *common-text* (-> *language-name-remap* (-> (the-as (pointer uint64) (-> options index value-to-modify)))) #f))) + ) + (((game-option-type language-subtitles)) + (let ((stupidity (the int (-> (the-as (pointer pc-subtitle-lang) (-> options index value-to-modify)))))) + (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> options index name) #f) + (lookup-text! *common-text* (-> *carousell-subtitle-language* stupidity) #f))) + ) + ) + ) + ) + )) + ) + (when (or (<= (length options) PROGRESS_PC_PAGE_HEIGHT) + (and (not (progress-scrolling?)) + (>= index *progress-scroll-start*) + (< index *progress-scroll-end*)) + (and (progress-scrolling-down?) + (>= index (1- *progress-scroll-start*)) + (< index *progress-scroll-end*)) + (and (progress-scrolling-up?) + (>= index *progress-scroll-start*) + (< index (1+ *progress-scroll-end*))) + ) + (when option-str + ;; draw the actual text! + (let ((f0-23 (-> obj transition-percentage-invert)) + (scroll-amt (-> *progress-scroll* transition))) + (cond + ((or (and (progress-scrolling-up?) (= index *progress-scroll-start*)) + (and (progress-scrolling-down?) (= index (1- *progress-scroll-end*)))) + ) + ((or (and (progress-scrolling-down?) (= index (1- *progress-scroll-start*))) + (and (progress-scrolling-up?) (= index *progress-scroll-end*))) + (set! scroll-amt (- 1.0 scroll-amt)) + ) + (else + (set! scroll-amt 1.0) + ) + ) + (set-color! font (if (and (= index (-> obj option-index)) (not (or (progress-scrolling?) (-> obj in-transition)))) + (font-color yellow-green-2) + (font-color default) + )) + (set! (-> font origin x) (the float (- option-x (-> obj left-x-offset)))) + (set! (-> font origin y) (the float (the int (* (the float option-y) (if (-> options index scale) + f0-23 + 1.0 + ))))) + (set-scale! font (* arg2 f0-23 scroll-amt)) + (print-game-text option-str font #f (the int (* 128.0 f0-23 scroll-amt)) 22) + ) + ) + (+! y-off arg1) + (+! option-count 1) + ) + )) + ) + ) + ) + 0 + (none) + ) + + +;; override the post handler for progress-normal +(set! (-> progress-normal post) + (lambda :behavior progress () + ;; scroll stuff TODO time ratio + (when (progress-scrolling?) + (seek! (-> *progress-scroll* transition) 1.0 (* 1.75 (1/ 512) (-> self transition-speed) (-> *display* time-adjust-ratio))) + ) + (when (!= (-> self display-state) (-> *progress-scroll* last-screen)) + (progress-scroll-reset) + (set! (-> *progress-scroll* last-screen) (-> self display-state)) + ) + ;; draw the menus!! + (let* ((a1-0 (-> self display-level-index)) + (gp-0 (-> *level-task-data* a1-0)) + (unk #t) + (stats? #f) + ) + (case (-> self display-state) + (((progress-screen fuel-cell)) + (set! stats? #t) + (draw-fuel-cell-screen self a1-0) + ) + (((progress-screen money)) + (set! stats? #t) + (draw-money-screen self a1-0) + ) + (((progress-screen buzzer)) + (set! stats? #t) + (draw-buzzer-screen self a1-0) + ) + (((progress-screen graphic-settings) + (progress-screen settings-title) + (progress-screen title) + (progress-screen game-settings) + (progress-screen settings) + (progress-screen misc-options) + (progress-screen accessibility-options) + (progress-screen game-ps2-options) + (progress-screen resolution) + (progress-screen aspect-ratio) + ) + (hide-progress-icons) + (draw-options self 115 25 0.82) + ) + (((progress-screen camera-options)) + ;; camera options lines are a bit too big + (hide-progress-icons) + (draw-options self 115 36 0.77) + ) + (((progress-screen gfx-ps2-options)) + (hide-progress-icons) + (draw-options self 115 25 0.72) + ) + (((progress-screen sound-settings)) + (hide-progress-icons) + (draw-options self 115 25 0.76) + ) + (((progress-screen memcard-removed) (progress-screen memcard-auto-save-error)) + (draw-notice-screen self) + (draw-options self 192 0 0.82) + ) + (((progress-screen memcard-no-data)) + (draw-notice-screen self) + (draw-options self 165 0 0.82) + ) + (((progress-screen memcard-format)) + (draw-notice-screen self) + (draw-options self 172 0 0.82) + ) + (((progress-screen memcard-no-space) + (progress-screen memcard-not-inserted) + (progress-screen memcard-not-formatted) + ) + (draw-notice-screen self) + (draw-options self 195 0 0.82) + ) + (((progress-screen memcard-error-loading) + (progress-screen memcard-error-saving) + (progress-screen memcard-error-formatting) + (progress-screen memcard-error-creating) + (progress-screen memcard-auto-save-error) + (progress-screen auto-save) (progress-screen load-game) (progress-screen save-game) + ) + (draw-notice-screen self) + (draw-options self 190 0 0.82) + ) + (((progress-screen no-disc) (progress-screen bad-disc)) + (draw-notice-screen self) + (if (is-cd-in?) + (draw-options self 170 0 0.82) + ) + ) + (((progress-screen quit)) + (draw-notice-screen self) + (draw-options self 110 0 0.82) + ) + (((progress-screen memcard-insert)) + (draw-notice-screen self) + (draw-options self 165 0 0.82) + ) + (((progress-screen memcard-data-exists)) + (draw-notice-screen self) + (draw-options self 168 0 0.82) + ) + (((progress-screen memcard-loading) + (progress-screen memcard-saving) + (progress-screen memcard-formatting) + (progress-screen memcard-creating) + ) + (draw-notice-screen self) + ) + (((progress-screen save-game-title)) + (draw-notice-screen self) + (draw-options self 169 15 0.6) + ) + ) + (when stats? + (let* ((v1-98 (cond ((-> self stat-transition) 0) + ((= (-> self level-transition) 1) (- (-> self transition-offset))) + (else (-> self transition-offset)) + )) + (f30-0 (the-as float (if (-> self stat-transition) + 1.0 + (-> self transition-percentage-invert) + ))) + (s5-1 (new 'stack 'font-context *font-default-matrix* + (- 32 (-> self left-x-offset)) + (the int (* (+ 42.0 (the float (/ v1-98 2))) f30-0)) + 8325000.0 + (font-color lighter-lighter-blue) + (font-flags shadow kerning) + )) + ) + (set-width! s5-1 328) + (set-height! s5-1 45) + (set! (-> s5-1 flags) (font-flags shadow kerning middle left large)) + (print-game-text-scaled (lookup-text! *common-text* (-> gp-0 level-name-id) #f) f30-0 s5-1 (the int (* 128.0 f30-0))) + ) + ) + ) + (case (-> self display-state) + (((progress-screen fuel-cell) (progress-screen money) (progress-screen buzzer)) + (draw-progress self) + ) + ) + (adjust-sprites self) + (adjust-icons self) + (none) + )) + +;; override the enter handler for progress-going-out +(set! (-> progress-going-out enter) + (lambda :behavior progress () + (sound-play-by-name (static-sound-name "menu-close") (new-sound-id) 1024 0 0 1 #t) + (hide-progress-icons) + (commit-to-file *pc-settings*) + (set! (-> self particles 3 init-pos x) -320.0) + (set! (-> self particles 4 init-pos x) -320.0) + (set! (-> self particles 32 init-pos x) -320.0) + (set! (-> self particles 33 init-pos x) -320.0) + (case (-> self display-state) + (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) + (set! (-> self transition-speed) 30.0) + ) + ) + (none) + )) + + + +) + + + diff --git a/goal_src/pc/subtitle.gc b/goal_src/pc/subtitle.gc index 3c7c5eb595..9c8f94c0bc 100644 --- a/goal_src/pc/subtitle.gc +++ b/goal_src/pc/subtitle.gc @@ -199,6 +199,16 @@ ) 0) +(defun load-level-subtitle-files ((idx int)) + "If needed, load subtitles" + + ;; just load common. These flags are not yet understood. + (if (or *level-text-file-load-flag* (>= idx 0)) + (load-subtitle-text-info PC_SUBTITLE_FILE_NAME '*subtitle-text* *subtitle-text-heap*) + ) + (none) + ) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -246,7 +256,7 @@ (suspend)) ) :trans (behavior () - (load-subtitle-text-info PC_SUBTITLE_FILE_NAME '*subtitle-text* *subtitle-text-heap*) + (load-level-subtitle-files 0) ;; reset params (set! (-> self spool-name) #f) (set! (-> self cur-channel) (pc-subtitle-channel invalid)) diff --git a/goalc/compiler/Compiler.cpp b/goalc/compiler/Compiler.cpp index 6766d3db70..374155ce80 100644 --- a/goalc/compiler/Compiler.cpp +++ b/goalc/compiler/Compiler.cpp @@ -21,7 +21,6 @@ Compiler::Compiler(const std::string& user_profile, std::unique_ptr // let the build system run us m_make.add_tool(std::make_shared(this)); - m_make.add_tool(std::make_shared(this)); // load GOAL library Object library_code = m_goos.reader.read_from_file({"goal_src", "goal-lib.gc"}); diff --git a/goalc/compiler/Compiler.h b/goalc/compiler/Compiler.h index 7bd3d4abfe..081ab1d585 100644 --- a/goalc/compiler/Compiler.h +++ b/goalc/compiler/Compiler.h @@ -18,6 +18,7 @@ #include "goalc/emitter/Register.h" #include "goalc/listener/Listener.h" #include "goalc/make/MakeSystem.h" +#include "goalc/data_compiler/game_text.h" #include "goalc/data_compiler/game_subtitle.h" enum MathMode { MATH_INT, MATH_BINT, MATH_FLOAT, MATH_INVALID }; @@ -56,7 +57,6 @@ class Compiler { listener::Listener& listener() { return m_listener; } void poke_target() { m_listener.send_poke(); } bool connect_to_target(); - GameSubtitleDB& subtitle_db() { return m_subtitle_db; } Replxx::completions_t find_symbols_by_prefix(std::string const& context, int& contextLen, std::vector const& user_data); @@ -88,7 +88,6 @@ class Compiler { SymbolInfoMap m_symbol_info; std::unique_ptr m_repl; MakeSystem m_make; - GameSubtitleDB m_subtitle_db; struct DebugStats { int num_spills = 0; diff --git a/goalc/compiler/compilation/CompilerControl.cpp b/goalc/compiler/compilation/CompilerControl.cpp index ab975f8006..600bcbbf36 100644 --- a/goalc/compiler/compilation/CompilerControl.cpp +++ b/goalc/compiler/compilation/CompilerControl.cpp @@ -66,10 +66,7 @@ Val* Compiler::compile_asm_data_file(const goos::Object& form, const goos::Objec auto args = get_va(form, rest); va_check(form, args, {goos::ObjectType::SYMBOL, goos::ObjectType::STRING}, {}); auto kind = symbol_string(args.unnamed.at(0)); - if (kind == "game-text") { - // TODO version - compile_game_text(as_string(args.unnamed.at(1))); - } else if (kind == "game-count") { + if (kind == "game-count") { compile_game_count(as_string(args.unnamed.at(1))); } else if (kind == "dir-tpages") { compile_dir_tpages(as_string(args.unnamed.at(1))); @@ -97,7 +94,17 @@ Val* Compiler::compile_asm_text_file(const goos::Object& form, const goos::Objec throw_compiler_error(form, "Invalid object {} in asm-text-file files list.", o.print()); } }); - compile_game_subtitle(files, (GameTextVersion)args.unnamed.at(1).as_int(), m_subtitle_db); + compile_game_subtitle(files, (GameTextVersion)args.unnamed.at(1).as_int()); + } else if (kind == "text") { + std::vector files; + for_each_in_list(args.named.at("files"), [this, &files, &form](const goos::Object& o) { + if (o.is_string()) { + files.push_back(o.as_string()->data); + } else { + throw_compiler_error(form, "Invalid object {} in asm-text-file files list.", o.print()); + } + }); + compile_game_text(files, (GameTextVersion)args.unnamed.at(1).as_int()); } else { throw_compiler_error(form, "The option {} was not recognized for asm-text-file.", kind); } diff --git a/goalc/data_compiler/game_subtitle.cpp b/goalc/data_compiler/game_subtitle.cpp index d87058b2cb..7e319fd260 100644 --- a/goalc/data_compiler/game_subtitle.cpp +++ b/goalc/data_compiler/game_subtitle.cpp @@ -62,14 +62,13 @@ std::string uppercase(const std::string& in) { */ void parse(const goos::Object& data, GameTextVersion text_ver, GameSubtitleDB& db) { auto font = get_font_bank(text_ver); - std::map banks; - bool languages_set = false; + std::map> banks; for_each_in_list(data.as_pair()->cdr, [&](const goos::Object& obj) { if (obj.is_pair()) { auto& head = car(obj); if (head.is_symbol() && head.as_symbol()->name == "language-id") { - if (languages_set) { + if (banks.size() != 0) { throw std::runtime_error("Languages have been set multiple times."); } @@ -81,17 +80,15 @@ void parse(const goos::Object& data, GameTextVersion text_ver, GameSubtitleDB& d auto lang = get_int(obj); if (!db.bank_exists(lang)) { // database has no lang yet - banks[lang] = db.new_bank(lang); + banks[lang] = db.add_bank(std::make_shared(lang)); } else { banks[lang] = db.bank_by_id(lang); } }); - - languages_set = true; } else if (head.is_string()) { - if (!languages_set) { + if (banks.size() == 0) { throw std::runtime_error("At least one language must be set before defining entries."); } GameSubtitleSceneInfo scene(head.as_string()->data); @@ -127,7 +124,7 @@ void parse(const goos::Object& data, GameTextVersion text_ver, GameSubtitleDB& d throw std::runtime_error("Invalid game subtitles file"); } }); - if (!languages_set) { + if (banks.size() == 0) { throw std::runtime_error("At least one language must be set."); } } @@ -183,9 +180,8 @@ void compile(GameSubtitleDB& db) { } } // namespace -void compile_game_subtitle(const std::vector& filenames, - GameTextVersion text_ver, - GameSubtitleDB& db) { +void compile_game_subtitle(const std::vector& filenames, GameTextVersion text_ver) { + GameSubtitleDB db; goos::Reader reader; for (auto& filename : filenames) { fmt::print("[Build Game Subtitle] {}\n", filename.c_str()); diff --git a/goalc/data_compiler/game_subtitle.h b/goalc/data_compiler/game_subtitle.h index 59488fda45..7f4e590745 100644 --- a/goalc/data_compiler/game_subtitle.h +++ b/goalc/data_compiler/game_subtitle.h @@ -4,6 +4,7 @@ #include #include #include +#include class GameSubtitleSceneInfo { public: @@ -58,25 +59,21 @@ class GameSubtitleBank { }; /*! - * The subtitles database contains a subtitbles bank for each language. + * The subtitles database contains a subtitles bank for each language. * Each subtitles bank contains a series of subtitle scene infos. */ class GameSubtitleDB { public: - const std::map& banks() const { return m_banks; } + const std::map>& banks() const { return m_banks; } bool bank_exists(int id) const { return m_banks.find(id) != m_banks.end(); } - GameSubtitleBank* new_bank(int id) { - ASSERT(!bank_exists(id)); - m_banks[id] = new GameSubtitleBank(id); - return m_banks.at(id); - } - void add_bank(GameSubtitleBank* bank) { + std::shared_ptr add_bank(std::shared_ptr bank) { ASSERT(!bank_exists(bank->lang())); m_banks[bank->lang()] = bank; + return bank; } - GameSubtitleBank* bank_by_id(int id) { + std::shared_ptr bank_by_id(int id) { if (!bank_exists(id)) { return nullptr; } @@ -84,9 +81,7 @@ class GameSubtitleDB { } private: - std::map m_banks; + std::map> m_banks; }; -void compile_game_subtitle(const std::vector& filenames, - GameTextVersion text_ver, - GameSubtitleDB& db); +void compile_game_subtitle(const std::vector& filenames, GameTextVersion text_ver); diff --git a/goalc/data_compiler/game_text.cpp b/goalc/data_compiler/game_text.cpp index 175916ecf6..2cdb3d1dd0 100644 --- a/goalc/data_compiler/game_text.cpp +++ b/goalc/data_compiler/game_text.cpp @@ -60,34 +60,44 @@ std::string uppercase(const std::string& in) { } /*! - * Parse a game text file for all languages. - * The result is a vector> - * so result[lang_id][text_id] gets you the text in the given language. + * Parse a game text file. + * Information is added to the game text database. * - * The file should begin with (language-count x) with the given number of languages. - * Each entry should be (text-id "text-in-lang-0" "text-in-lang-1" ... ) - * The text id's can be out of order or missing entries. + * The file should begin with (language-id x y z...) with the given language IDs. + * Each entry should be (id "line for 1st language" "line for 2nd language" ...) + * This adds the text line to each of the specified languages. */ -std::vector> parse(const goos::Object& data, - std::string* group_name) { - std::vector> text; - bool languages_set = false; +void parse(const goos::Object& data, GameTextVersion text_ver, GameTextDB& db) { + auto font = get_font_bank(text_ver); + std::vector> banks; bool group_name_set = false; std::string possible_group_name; for_each_in_list(data.as_pair()->cdr, [&](const goos::Object& obj) { if (obj.is_pair()) { - auto& head = obj.as_pair()->car; - if (head.is_symbol() && head.as_symbol()->name == "language-count") { - if (languages_set) { - throw std::runtime_error("Languages has been set multiple times."); + auto& head = car(obj); + if (head.is_symbol() && head.as_symbol()->name == "language-id") { + if (banks.size() != 0) { + throw std::runtime_error("Languages have been set multiple times."); } - languages_set = true; - text.resize(get_int(car(cdr(obj)))); - if (!cdr(cdr(obj)).is_empty_list()) { - throw std::runtime_error("language-count has too many arguments"); + if (cdr(obj).is_empty_list()) { + throw std::runtime_error("At least one language must be set."); } + + if (!group_name_set) { + throw std::runtime_error("Text group must be set before languages."); + } + + for_each_in_list(cdr(obj), [&](const goos::Object& obj) { + auto lang = get_int(obj); + if (!db.bank_exists(possible_group_name, lang)) { + // database has no lang in this group yet + banks.push_back(db.add_bank(possible_group_name, std::make_shared(lang))); + } else { + banks.push_back(db.bank_by_id(possible_group_name, lang)); + } + }); } else if (head.is_symbol() && head.as_symbol()->name == "group-name") { if (group_name_set) { throw std::runtime_error("group-name has been set multiple times."); @@ -101,31 +111,26 @@ std::vector> parse(const goos::Object& data } else if (head.is_int()) { + if (banks.size() == 0) { + throw std::runtime_error("At least one language must be set before defining entries."); + } int i = 0; int id = head.as_int(); for_each_in_list(cdr(obj), [&](const goos::Object& entry) { - if (i >= int(text.size())) { - throw std::runtime_error( - "String has too many entries. There should be one per language"); - } - if (entry.is_string()) { - auto& map = text.at(i); - if (map.find(id) != map.end()) { - throw std::runtime_error("Entry appears more than once"); + if (i >= int(banks.size())) { + throw std::runtime_error(fmt::format("Too many strings in text id #x{:x}", id)); } - // TODO - auto font = get_font_bank(GameTextVersion::JAK1_V1); - map[id] = font->convert_utf8_to_game(entry.as_string()->data); + auto line = font->convert_utf8_to_game(entry.as_string()->data); + banks[i++]->set_line(id, line); } else { - throw std::runtime_error("Each entry must be a string"); + throw std::runtime_error(fmt::format("Non-string value in text id #x{:x}", id)); } - - i++; }); - if (i != int(text.size())) { - throw std::runtime_error("String did not have an entry for each language"); + if (i != int(banks.size())) { + throw std::runtime_error( + fmt::format("Not enough strings specified in text id #x{:x}", id)); } } else { throw std::runtime_error("Invalid game text file entry: " + head.print()); @@ -134,12 +139,9 @@ std::vector> parse(const goos::Object& data throw std::runtime_error("Invalid game text file"); } }); - - if (!group_name_set) { - throw std::runtime_error("group-name not set."); + if (banks.size() == 0) { + throw std::runtime_error("At least one language must be set."); } - *group_name = possible_group_name; - return text; } /* @@ -162,43 +164,33 @@ std::vector> parse(const goos::Object& data * Write game text data to a file. Uses the V2 object format which is identical between GOAL and * OpenGOAL, so this should produce exactly identical files to what is found in the game. */ -void compile(const std::vector>& text, - const std::string& group_name) { - if (text.empty()) { - return; - } - // get all text ID's we know - std::vector add_order; - add_order.reserve(text.front().size()); - for (auto& x : text.front()) { - add_order.push_back(x.first); - } - // and sort them to be added in order. This matches the game. - std::sort(add_order.begin(), add_order.end()); +void compile(GameTextDB& db) { + for (const auto& [group_name, banks] : db.groups()) { + for (const auto& [lang, bank] : banks) { + DataObjectGenerator gen; + gen.add_type_tag("game-text-info"); // type + gen.add_word(bank->lines().size()); // length + gen.add_word(lang); // language-id + // this string is found in the string pool. + gen.add_ref_to_string_in_pool(group_name); // group-name - for (int lang = 0; lang < int(text.size()); lang++) { - DataObjectGenerator gen; - gen.add_type_tag("game-text-info"); // type - gen.add_word(text.front().size()); // length - gen.add_word(lang); // language-id - // this string is found in the string pool. - gen.add_ref_to_string_in_pool(group_name); // group-name + // now add all the datas: (the lines are already sorted by id) + for (auto& [id, line] : bank->lines()) { + gen.add_word(id); // id + // these strings must be in the string pool, as sometimes there are duplicate + // strings in a single language, and these strings should be stored once and have multiple + // references to them. + gen.add_ref_to_string_in_pool(line); // text + } - // now add all the datas: - for (auto id : add_order) { - gen.add_word(id); // id - // these strings must be in the string pool, as sometimes there are duplicate - // strings in a single language, and these strings should be stored once and have multiple - // references to them. - gen.add_ref_to_string_in_pool(text.at(lang).at(id)); // text + auto data = gen.generate_v2(); + + file_util::create_dir_if_needed(file_util::get_file_path({"out", "iso"})); + file_util::write_binary_file( + file_util::get_file_path( + {"out", "iso", fmt::format("{}{}.TXT", lang, uppercase(group_name))}), + data.data(), data.size()); } - auto data = gen.generate_v2(); - - file_util::create_dir_if_needed(file_util::get_file_path({"out", "iso"})); - file_util::write_binary_file( - file_util::get_file_path( - {"out", "iso", fmt::format("{}{}.TXT", lang, uppercase(group_name))}), - data.data(), data.size()); } } } // namespace @@ -206,11 +198,13 @@ void compile(const std::vector>& text, /*! * Read a game text description file and generate GOAL objects. */ -void compile_game_text(const std::string& filename) { +void compile_game_text(const std::vector& filenames, GameTextVersion text_ver) { + GameTextDB db; goos::Reader reader; - auto code = reader.read_from_file({filename}); - printf("[Build Game Text] %s\n", filename.c_str()); - std::string group_name; - auto text_map = parse(code, &group_name); - compile(text_map, group_name); + for (auto& filename : filenames) { + fmt::print("[Build Game Text] {}\n", filename.c_str()); + auto code = reader.read_from_file({filename}); + parse(code, text_ver, db); + } + compile(db); } diff --git a/goalc/data_compiler/game_text.h b/goalc/data_compiler/game_text.h index d2aa968f64..4c419cbe3a 100644 --- a/goalc/data_compiler/game_text.h +++ b/goalc/data_compiler/game_text.h @@ -1,4 +1,62 @@ #pragma once +#include "common/util/FontUtils.h" +#include "common/util/Assert.h" #include +#include +#include +#include +#include -void compile_game_text(const std::string& filename); \ No newline at end of file +class GameTextBank { + public: + GameTextBank(int lang_id) : m_lang_id(lang_id) {} + + int lang() const { return m_lang_id; } + const std::map& lines() const { return m_lines; } + + bool line_exists(int id) const { return m_lines.find(id) != m_lines.end(); } + std::string line(int id) { return m_lines.at(id); } + void set_line(int id, std::string line) { m_lines[id] = line; } + + private: + int m_lang_id; + std::map m_lines; +}; + +/*! + * The text database contains a text bank for each language for each text group. + * Each text bank contains a list of text lines. Very simple. + */ +class GameTextDB { + public: + const std::unordered_map>>& groups() + const { + return m_banks; + } + const std::map>& banks(std::string group) const { + return m_banks.at(group); + } + + bool bank_exists(std::string group, int id) const { + if (m_banks.find(group) == m_banks.end()) + return false; + return m_banks.at(group).find(id) != m_banks.at(group).end(); + } + + std::shared_ptr add_bank(std::string group, std::shared_ptr bank) { + ASSERT(!bank_exists(group, bank->lang())); + m_banks[group][bank->lang()] = bank; + return bank; + } + std::shared_ptr bank_by_id(std::string group, int id) { + if (!bank_exists(group, id)) { + return nullptr; + } + return m_banks.at(group).at(id); + } + + private: + std::unordered_map>> m_banks; +}; + +void compile_game_text(const std::vector& filenames, GameTextVersion text_ver); diff --git a/goalc/make/MakeSystem.cpp b/goalc/make/MakeSystem.cpp index 75d282d41d..939400298c 100644 --- a/goalc/make/MakeSystem.cpp +++ b/goalc/make/MakeSystem.cpp @@ -63,8 +63,9 @@ MakeSystem::MakeSystem() { add_tool(); add_tool(); add_tool(); - add_tool(); add_tool(); + add_tool(); + add_tool(); } /*! @@ -376,4 +377,4 @@ void MakeSystem::set_constant(const std::string& name, const std::string& value) void MakeSystem::set_constant(const std::string& name, bool value) { m_goos.set_global_variable_to_symbol(name, value ? "#t" : "#f"); -} \ No newline at end of file +} diff --git a/goalc/make/Tools.cpp b/goalc/make/Tools.cpp index 2f90e549a4..e07dcd5b51 100644 --- a/goalc/make/Tools.cpp +++ b/goalc/make/Tools.cpp @@ -71,19 +71,20 @@ DgoDescription parse_desc_file(const std::string& filename, goos::Reader& reader static const std::unordered_map s_text_ver_enum_map = { {"jak1-v1", GameTextVersion::JAK1_V1}}; -std::unordered_map> open_subtitle_project( +std::unordered_map> open_text_project( + const std::string& kind, const std::string& filename) { goos::Reader reader; auto& proj = reader.read_from_file({filename}).as_pair()->cdr.as_pair()->car; if (!proj.is_pair() || !proj.as_pair()->car.is_symbol() || - proj.as_pair()->car.as_symbol()->name != "subtitle") { - throw std::runtime_error("invalid subtitle project"); + proj.as_pair()->car.as_symbol()->name != kind) { + throw std::runtime_error(fmt::format("invalid {} project", kind)); } std::unordered_map> inputs; goos::for_each_in_list(proj.as_pair()->cdr, [&](const goos::Object& o) { if (!o.is_pair()) { - throw std::runtime_error("invalid entry in subtitle project"); + throw std::runtime_error(fmt::format("invalid entry in {} project", kind)); } auto& ver = o.as_pair()->car.as_symbol()->name; @@ -152,11 +153,24 @@ bool GameCntTool::run(const ToolInput& task) { TextTool::TextTool() : Tool("text") {} -bool TextTool::run(const ToolInput& task) { +bool TextTool::needs_run(const ToolInput& task) { if (task.input.size() != 1) { throw std::runtime_error(fmt::format("Invalid amount of inputs to {} tool", name())); } - compile_game_text(task.input.at(0)); + + std::vector deps; + for (auto& [ver, inputs] : open_text_project("text", task.input.at(0))) { + for (auto& in : inputs) { + deps.push_back(in); + } + } + return Tool::needs_run({task.input, deps, task.output, task.arg}); +} + +bool TextTool::run(const ToolInput& task) { + for (auto& [ver, in] : open_text_project("text", task.input.at(0))) { + compile_game_text(in, ver); + } return true; } @@ -166,7 +180,7 @@ bool GroupTool::run(const ToolInput&) { return true; } -SubtitleTool::SubtitleTool(Compiler* compiler) : Tool("subtitle"), m_compiler(compiler) {} +SubtitleTool::SubtitleTool() : Tool("subtitle") {} bool SubtitleTool::needs_run(const ToolInput& task) { if (task.input.size() != 1) { @@ -174,7 +188,7 @@ bool SubtitleTool::needs_run(const ToolInput& task) { } std::vector deps; - for (auto& [ver, inputs] : open_subtitle_project(task.input.at(0))) { + for (auto& [ver, inputs] : open_text_project("subtitle", task.input.at(0))) { for (auto& in : inputs) { deps.push_back(in); } @@ -183,8 +197,8 @@ bool SubtitleTool::needs_run(const ToolInput& task) { } bool SubtitleTool::run(const ToolInput& task) { - for (auto& [ver, in] : open_subtitle_project(task.input.at(0))) { - compile_game_subtitle(in, ver, m_compiler->subtitle_db()); + for (auto& [ver, in] : open_text_project("subtitle", task.input.at(0))) { + compile_game_subtitle(in, ver); } return true; } diff --git a/goalc/make/Tools.h b/goalc/make/Tools.h index 49622d1320..f36df144f9 100644 --- a/goalc/make/Tools.h +++ b/goalc/make/Tools.h @@ -48,6 +48,7 @@ class TextTool : public Tool { public: TextTool(); bool run(const ToolInput& task) override; + bool needs_run(const ToolInput& task) override; }; class GroupTool : public Tool { @@ -58,10 +59,7 @@ class GroupTool : public Tool { class SubtitleTool : public Tool { public: - SubtitleTool(Compiler* compiler); + SubtitleTool(); bool run(const ToolInput& task) override; bool needs_run(const ToolInput& task) override; - - private: - Compiler* m_compiler; }; diff --git a/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc b/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc index fb6f9858c7..1829745414 100644 --- a/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc @@ -185,15 +185,15 @@ (debug-draw (_type_) none 9) (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result int) float 10) (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol 11) - (fill-and-probe-using-y-probe (_type_ vector float collide-kind process collide-tri-result uint) float 12) + (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12) (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13) (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable int) none 14) (fill-using-spheres (_type_ collide-using-spheres-params) none 15) - (fill-using-y-probe (_type_ vector float collide-kind process-drawable uint) none 16) + (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16) (initialize (_type_) none 17) (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result int) float 18) (probe-using-spheres (_type_ collide-using-spheres-params) symbol 19) - (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result uint) float 20) + (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20) (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) (fill-from-foreground-using-box (_type_) none 22) (fill-from-foreground-using-line-sphere (_type_) none 23) diff --git a/test/decompiler/reference/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/engine/collide/collide-shape-h_REF.gc index 23fe0d66a0..424b12a51d 100644 --- a/test/decompiler/reference/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-shape-h_REF.gc @@ -377,7 +377,7 @@ (deftype collide-shape (trsqv) ((process process-drawable :offset-assert 140) (max-iteration-count uint8 :offset-assert 144) - (nav-flags uint8 :offset-assert 145) + (nav-flags nav-flags :offset-assert 145) (pad-byte uint8 2 :offset-assert 146) (pat-ignore-mask pat-surface :offset-assert 148) (event-self basic :offset-assert 152) @@ -638,17 +638,17 @@ (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (set! (-> obj process) proc) (set! (-> obj max-iteration-count) (the-as uint 1)) - (set! (-> obj nav-flags) (the-as uint 1)) + (set! (-> obj nav-flags) (nav-flags navf0)) (set! (-> obj event-self) #f) (set! (-> obj event-other) #f) (set! (-> obj riders) #f) (set! (-> obj root-prim) #f) (case (-> proc type symbol) (('camera) - (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :skip #x2 :nocamera #x1)) + (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1)) ) (else - (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) ) ) (set! (-> obj trans w) 1.0) diff --git a/test/decompiler/reference/engine/draw/drawable_REF.gc b/test/decompiler/reference/engine/draw/drawable_REF.gc index 92c502e3d0..330beb78f1 100644 --- a/test/decompiler/reference/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/engine/draw/drawable_REF.gc @@ -1629,7 +1629,7 @@ ) (toggle-pause) ) - (when (or (not *progress-process*) (dummy-32 (-> *progress-process* 0))) + (when (or (not *progress-process*) (can-go-back? (-> *progress-process* 0))) (if (or (cpad-pressed? 0 select r3 start) (and (logtest? (-> *cpad-list* cpads 0 valid) 128) (= *master-mode* 'game) diff --git a/test/decompiler/reference/engine/game/collectables_REF.gc b/test/decompiler/reference/engine/game/collectables_REF.gc index 7b4bb8c7d6..a857724e62 100644 --- a/test/decompiler/reference/engine/game/collectables_REF.gc +++ b/test/decompiler/reference/engine/game/collectables_REF.gc @@ -3003,9 +3003,9 @@ s2-1 (the-as float 81920.0) (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) s1-1 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/test/decompiler/reference/engine/game/game-save_REF.gc b/test/decompiler/reference/engine/game/game-save_REF.gc index b46f74a558..63d6df7621 100644 --- a/test/decompiler/reference/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/engine/game/game-save_REF.gc @@ -219,7 +219,7 @@ (((game-save-elt buzzer-total)) "buzzer-total" ) - (((game-save-elt moeny-per-level)) + (((game-save-elt money-per-level)) "money-per-level" ) (((game-save-elt money-total)) @@ -312,7 +312,7 @@ ) (when detail (case (-> tag elt-type) - (((game-save-elt moeny-per-level) (game-save-elt deaths-per-level)) + (((game-save-elt money-per-level) (game-save-elt deaths-per-level)) (dotimes (prog-lev-idx (-> tag elt-count)) (let ((lev-name (progress-level-index->string prog-lev-idx))) (if lev-name @@ -510,7 +510,7 @@ ) (let ((v1-56 (&+ v1-55 16))) (let ((a0-30 (the-as game-save-tag (&+ v1-56 0)))) - (set! (-> a0-30 elt-type) (game-save-elt moeny-per-level)) + (set! (-> a0-30 elt-type) (game-save-elt money-per-level)) (set! (-> a0-30 elt-count) 32) (set! (-> a0-30 elt-size) (the-as uint 1)) ) @@ -944,7 +944,7 @@ (((game-save-elt money-total)) (set! (-> obj money-total) (-> data user-float0)) ) - (((game-save-elt moeny-per-level)) + (((game-save-elt money-per-level)) (let ((v1-34 (min 32 (-> data elt-count)))) (dotimes (a0-76 v1-34) (set! (-> obj money-per-level a0-76) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-76)) diff --git a/test/decompiler/reference/engine/game/projectiles_REF.gc b/test/decompiler/reference/engine/game/projectiles_REF.gc index d89f1b2f25..b2696513c4 100644 --- a/test/decompiler/reference/engine/game/projectiles_REF.gc +++ b/test/decompiler/reference/engine/game/projectiles_REF.gc @@ -1099,7 +1099,7 @@ (-> obj root-override shadow-pos) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 12288.0 81920.0 ) diff --git a/test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc b/test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc index 51c49fd558..234508baaf 100644 --- a/test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc +++ b/test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc @@ -115,14 +115,31 @@ ;; definition for function find-ground-and-draw-shadow ;; INFO: Return type mismatch int vs none. ;; Used lq/sq -(defun find-ground-and-draw-shadow ((arg0 vector) (arg1 vector) (arg2 float) (arg3 collide-kind) (arg4 process) (arg5 float) (arg6 float)) +(defun find-ground-and-draw-shadow ((arg0 vector) + (arg1 vector) + (arg2 float) + (arg3 collide-kind) + (arg4 process-drawable) + (arg5 float) + (arg6 float) + ) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg0 quad)) (new 'stack-no-clear 'vector) (+! (-> s2-0 y) arg5) (let ((s4-0 (new 'stack-no-clear 'collide-tri-result))) (cond - ((>= (fill-and-probe-using-y-probe *collide-cache* s2-0 arg6 arg3 arg4 s4-0 (the-as uint 1)) 0.0) + ((>= (fill-and-probe-using-y-probe + *collide-cache* + s2-0 + arg6 + arg3 + arg4 + s4-0 + (new 'static 'pat-surface :noentity #x1) + ) + 0.0 + ) (if (!= arg2 0.0) (compute-and-draw-shadow s2-0 (-> s4-0 intersect) (-> s4-0 normal) (the-as vector arg2) arg6 (the-as float 0)) ) diff --git a/test/decompiler/reference/engine/nav/navigate-h_REF.gc b/test/decompiler/reference/engine/nav/navigate-h_REF.gc index 8c8eb2be1a..1038161a94 100644 --- a/test/decompiler/reference/engine/nav/navigate-h_REF.gc +++ b/test/decompiler/reference/engine/nav/navigate-h_REF.gc @@ -499,7 +499,7 @@ (goto cfg-4) ) (set! (-> obj max-spheres) sphere-count) - (set! (-> obj flags) (nav-control-flags bit8 bit13)) + (set! (-> obj flags) (nav-control-flags navcf8 navcf13)) (set! (-> obj mesh) (nav-mesh-connect (-> shape process) shape obj)) (let ((ent (-> shape process entity))) (set! (-> obj nearest-y-threshold) diff --git a/test/decompiler/reference/engine/nav/navigate_REF.gc b/test/decompiler/reference/engine/nav/navigate_REF.gc index 89fa53b84c..851df7c3ad 100644 --- a/test/decompiler/reference/engine/nav/navigate_REF.gc +++ b/test/decompiler/reference/engine/nav/navigate_REF.gc @@ -1271,14 +1271,14 @@ (let ((v1-1 (find-poly-fast obj arg0 arg1))) (when v1-1 (if arg2 - (set! (-> arg2 0) (logior (nav-control-flags bit20) (-> arg2 0))) + (set! (-> arg2 0) (logior (nav-control-flags navcf20) (-> arg2 0))) ) (set! s3-1 v1-1) (goto cfg-14) ) ) (if arg2 - (logclear! (-> arg2 0) (nav-control-flags bit20)) + (logclear! (-> arg2 0) (nav-control-flags navcf20)) ) (let ((s2-0 (new 'stack-no-clear 'inline-array 'nav-vertex 3))) (set! s3-1 (the-as nav-poly #f)) @@ -1750,7 +1750,7 @@ (when #t (set! (-> s5-0 debug-time) (the-as uint (-> *display* actual-frame-counter))) (add-debug-sphere - (logtest? (-> obj flags) (nav-control-flags bit1)) + (logtest? (-> obj flags) (nav-control-flags navcf1)) (bucket-id debug-draw0) (-> s5-0 bounds) (-> s5-0 bounds w) @@ -1758,7 +1758,7 @@ ) (add-debug-vector #t (bucket-id debug-draw1) (-> s5-0 origin) *x-vector* (meters 1.0) *color-red*) (add-debug-vector #t (bucket-id debug-draw1) (-> s5-0 origin) *z-vector* (meters 1.0) *color-blue*) - (when (logtest? (-> obj flags) (nav-control-flags bit2)) + (when (logtest? (-> obj flags) (nav-control-flags navcf2)) (dotimes (s3-0 (-> s5-0 vertex-count)) (add-debug-x #t @@ -1813,7 +1813,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit3)) + (when (logtest? (-> obj flags) (nav-control-flags navcf3)) (dotimes (s3-2 (-> s5-0 poly-count)) (let ((s2-1 (-> s5-0 poly s3-2))) (debug-draw-poly s5-0 s2-1 (the-as rgba (cond @@ -1838,7 +1838,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit4)) + (when (logtest? (-> obj flags) (nav-control-flags navcf4)) (let ((s1-1 add-debug-text-3d) (s0-1 #t) ) @@ -1862,7 +1862,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit5)) + (when (logtest? (-> obj flags) (nav-control-flags navcf5)) (if (-> obj next-poly) (debug-draw-poly s5-0 (-> obj next-poly) *color-cyan*) ) @@ -1873,7 +1873,7 @@ (debug-draw-poly s5-0 (-> obj current-poly) *color-red*) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit7)) + (when (logtest? (-> obj flags) (nav-control-flags navcf7)) (dotimes (s3-3 (the-as int (-> s5-0 static-sphere-count))) (let ((s2-2 (-> s5-0 static-sphere s3-3))) (add-debug-sphere #t (bucket-id debug-draw0) (the-as vector s2-2) (-> s2-2 trans w) *color-blue*) @@ -1906,7 +1906,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit6)) + (when (logtest? (-> obj flags) (nav-control-flags navcf6)) (when (and (-> obj portal 0) (-> obj portal 1)) (let ((v1-80 (-> s5-0 origin)) (a2-22 (new 'stack-no-clear 'vector)) @@ -1946,7 +1946,7 @@ (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit7)) + (when (logtest? (-> obj flags) (nav-control-flags navcf7)) (add-debug-sphere #t (bucket-id debug-draw1) @@ -2012,7 +2012,7 @@ ;; INFO: Return type mismatch int vs none. (defmethod set-current-poly! nav-control ((obj nav-control) (arg0 nav-poly)) (set! (-> obj current-poly) arg0) - (logior! (-> obj flags) (nav-control-flags bit9)) + (logior! (-> obj flags) (nav-control-flags navcf9)) 0 (none) ) @@ -2066,7 +2066,7 @@ ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defun add-collide-shape-spheres ((arg0 nav-control) (arg1 collide-shape) (arg2 vector)) - (when (logtest? (-> arg1 nav-flags) 1) + (when (logtest? (-> arg1 nav-flags) (nav-flags navf0)) (set! (-> arg2 quad) (-> arg1 root-prim prim-core world-sphere quad)) (set! (-> arg2 w) (-> arg1 nav-radius)) (let ((s4-0 arg0) @@ -2088,7 +2088,7 @@ ) 0 ) - (when (logtest? (-> arg1 nav-flags) 2) + (when (logtest? (-> arg1 nav-flags) (nav-flags navf1)) (let ((s5-1 (-> arg1 process nav extra-nav-sphere))) (when (< (-> arg0 num-spheres) (-> arg0 max-spheres)) (let* ((s4-1 (-> arg0 sphere (-> arg0 num-spheres))) @@ -2127,13 +2127,13 @@ (s3-0 (new 'stack-no-clear 'vector)) ) (when (and *target* - (or (logtest? (-> obj flags) (nav-control-flags bit11)) (logtest? (-> *target* state-flags) #x80f8)) + (or (logtest? (-> obj flags) (nav-control-flags navcf11)) (logtest? (-> *target* state-flags) #x80f8)) ) (let ((s2-0 obj) (s1-0 (-> *target* control)) ) (let ((s0-0 s3-0)) - (when (logtest? (-> s1-0 nav-flags) 1) + (when (logtest? (-> s1-0 nav-flags) (nav-flags navf0)) (set! (-> s0-0 quad) (-> s1-0 root-prim prim-core world-sphere quad)) (set! (-> s0-0 w) (-> s1-0 nav-radius)) (set! sv-32 s2-0) @@ -2153,7 +2153,7 @@ 0 ) ) - (when (logtest? (-> s1-0 nav-flags) 2) + (when (logtest? (-> s1-0 nav-flags) (nav-flags navf1)) (let ((s1-1 (-> s1-0 process nav extra-nav-sphere))) (when (< (-> s2-0 num-spheres) (-> s2-0 max-spheres)) (let* ((s0-1 (-> s2-0 sphere (-> s2-0 num-spheres))) @@ -2173,7 +2173,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags bit13)) + (when (logtest? (-> obj flags) (nav-control-flags navcf13)) (countdown (s2-1 (-> obj mesh static-sphere-count)) (let ((s1-2 obj) (s0-2 (-> obj mesh static-sphere s2-1)) @@ -2203,7 +2203,7 @@ (when (not (or (= s0-3 (-> obj shape)) (zero? (logand arg0 (-> s0-3 root-prim prim-core collide-as))))) (let ((s1-3 obj)) (set! sv-112 s3-0) - (when (logtest? (-> s0-3 nav-flags) 1) + (when (logtest? (-> s0-3 nav-flags) (nav-flags navf0)) (set! (-> sv-112 quad) (-> s0-3 root-prim prim-core world-sphere quad)) (set! (-> sv-112 w) (-> s0-3 nav-radius)) (set! sv-80 s1-3) @@ -2226,7 +2226,7 @@ ) 0 ) - (when (logtest? (-> s0-3 nav-flags) 2) + (when (logtest? (-> s0-3 nav-flags) (nav-flags navf1)) (let ((s0-4 (-> s0-3 process nav extra-nav-sphere))) (when (< (-> s1-3 num-spheres) (-> s1-3 max-spheres)) (set! sv-128 (-> s1-3 sphere (-> s1-3 num-spheres))) @@ -2662,7 +2662,7 @@ (set! (-> obj blocked-travel quad) (-> obj travel quad)) (let ((f0-0 (vector-xz-length (-> obj travel)))) (when (and (>= f30-0 f0-0) (< f0-0 204.8)) - (set! (-> obj flags) (logior (nav-control-flags bit17) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf17) (-> obj flags))) (set! (-> obj block-time) (-> *display* base-frame-counter)) (set! (-> obj block-count) (+ 1.0 (-> obj block-count))) (if (-> obj block-event) @@ -2709,21 +2709,21 @@ ) (cond ((or (vector= arg2 (-> obj target-pos)) (< (fabs f28-0) 364.0889)) - (set! (-> obj flags) (logior (nav-control-flags bit21) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf21) (-> obj flags))) (set! (-> arg0 quad) (-> arg2 quad)) ) (else (let ((s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg1 quat)))) (vector-rotate-y! s2-1 s2-1 (fmax (fmin f28-0 f30-0) (- f30-0))) (vector-normalize! s2-1 819.2) - (logclear! (-> obj flags) (nav-control-flags bit21)) + (logclear! (-> obj flags) (nav-control-flags navcf21)) (vector+! arg0 (-> arg1 trans) s2-1) ) (when (or (not (dummy-16 obj arg0)) - (logtest? (nav-control-flags bit17) (-> obj flags)) - (zero? (logand (-> obj flags) (nav-control-flags bit10))) + (logtest? (nav-control-flags navcf17) (-> obj flags)) + (zero? (logand (-> obj flags) (nav-control-flags navcf10))) ) - (set! (-> obj flags) (logior (nav-control-flags bit21) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf21) (-> obj flags))) (vector-! (-> obj travel) arg2 (-> arg1 trans)) (set! (-> arg0 quad) (-> arg2 quad)) ) @@ -2938,7 +2938,7 @@ v1-0 (-> obj current-poly) (-> obj travel) - (zero? (logand (-> obj flags) (nav-control-flags bit12))) + (zero? (logand (-> obj flags) (nav-control-flags navcf12))) arg0 arg1 ) @@ -3149,7 +3149,7 @@ sv-84 sv-88 (-> obj travel) - (zero? (logand (-> obj flags) (nav-control-flags bit12))) + (zero? (logand (-> obj flags) (nav-control-flags navcf12))) 204.8 s5-1 ) @@ -3254,9 +3254,9 @@ (set! (-> obj old-travel quad) (-> obj travel quad)) (-> obj block-count) (set! (-> obj block-count) (seek (-> obj block-count) 0.0 0.016666668)) - (logclear! (-> obj flags) (nav-control-flags bit9 bit17 bit18 bit19)) + (logclear! (-> obj flags) (nav-control-flags navcf9 navcf17 navcf18 navcf19)) (TODO-RENAME-27 obj) - (if (logtest? (-> obj flags) (nav-control-flags bit8)) + (if (logtest? (-> obj flags) (nav-control-flags navcf8)) (TODO-RENAME-28 obj (collide-kind background cak-1 @@ -3331,7 +3331,7 @@ (let ((s5-1 (new 'stack-no-clear 'nav-gap-info))) (when (< (vector-xz-length (-> obj travel)) 204.8) (cond - ((logtest? (nav-control-flags bit17) (-> obj flags)) + ((logtest? (nav-control-flags navcf17) (-> obj flags)) ) ((-> obj next-poly) (cond @@ -3349,7 +3349,7 @@ ) ) (else - (set! (-> obj flags) (logior (nav-control-flags bit19) (-> obj flags))) + (set! (-> obj flags) (logior (nav-control-flags navcf19) (-> obj flags))) ) ) ) diff --git a/test/decompiler/reference/engine/target/target-death_REF.gc b/test/decompiler/reference/engine/target/target-death_REF.gc index b68f9ffe3a..585356e4c0 100644 --- a/test/decompiler/reference/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/engine/target/target-death_REF.gc @@ -1185,7 +1185,7 @@ (clear-pending-settings-from-process *setting-control* self 'process-mask) (clear-pending-settings-from-process *setting-control* self 'allow-progress) (restore-collide-with-as (-> self control)) - (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (none) diff --git a/test/decompiler/reference/engine/target/target-part_REF.gc b/test/decompiler/reference/engine/target/target-part_REF.gc index 676edd1a22..802ab89d84 100644 --- a/test/decompiler/reference/engine/target/target-part_REF.gc +++ b/test/decompiler/reference/engine/target/target-part_REF.gc @@ -43,7 +43,7 @@ (collide-kind background cak-1 cak-2 cak-3 water powerup crate enemy wall-object ground-object mother-spider) s5-0 s3-0 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) 0.0 ) diff --git a/test/decompiler/reference/engine/ui/progress-h_REF.gc b/test/decompiler/reference/engine/ui/progress-h_REF.gc index 0360733354..f9350cb6d5 100644 --- a/test/decompiler/reference/engine/ui/progress-h_REF.gc +++ b/test/decompiler/reference/engine/ui/progress-h_REF.gc @@ -84,13 +84,13 @@ ;; definition of type game-option (deftype game-option (basic) - ((option-type uint64 :offset-assert 8) - (name game-text-id :offset-assert 16) - (scale basic :offset-assert 20) - (param1 float :offset-assert 24) - (param2 float :offset-assert 28) - (param3 int32 :offset-assert 32) - (value-to-modify pointer :offset-assert 36) + ((option-type game-option-type :offset-assert 8) + (name game-text-id :offset-assert 16) + (scale symbol :offset-assert 20) + (param1 float :offset-assert 24) + (param2 float :offset-assert 28) + (param3 game-option-menu :offset-assert 32) + (value-to-modify pointer :offset-assert 36) ) :method-count-assert 9 :size-assert #x28 @@ -130,8 +130,8 @@ (force-transition basic :offset-assert 180) (stat-transition basic :offset-assert 184) (level-transition int32 :offset-assert 188) - (language-selection uint64 :offset-assert 192) - (language-direction basic :offset-assert 200) + (language-selection language-enum :offset-assert 192) + (language-direction symbol :offset-assert 200) (language-transition basic :offset-assert 204) (language-x-offset int32 :offset-assert 208) (sides-x-scale float :offset-assert 212) @@ -172,12 +172,12 @@ :size-assert #x2dc :flag-assert #x3b027002dc (:methods - (dummy-14 (_type_) none 14) - (dummy-15 (_type_) none 15) - (dummy-16 (_type_) none 16) + (progress-dummy-14 (_type_) none 14) + (progress-dummy-15 (_type_) none 15) + (progress-dummy-16 (_type_) none 16) (draw-progress (_type_) none 17) - (dummy-18 () none 18) - (dummy-19 (_type_) symbol 19) + (progress-dummy-18 () none 18) + (visible? (_type_) symbol 19) (hidden? (_type_) symbol 20) (adjust-sprites (_type_) none 21) (adjust-icons (_type_) none 22) @@ -187,10 +187,10 @@ (draw-buzzer-screen (_type_ int) none 26) (draw-notice-screen (_type_) none 27) (draw-options (_type_ int int float) none 28) - (dummy-29 (_type_) none 29) + (respond-common (_type_) none 29) (respond-progress (_type_) none 30) - (dummy-31 (_type_) none 31) - (dummy-32 (_type_) symbol 32) + (respond-memcard (_type_) none 31) + (can-go-back? (_type_) symbol 32) (initialize-icons (_type_) none 33) (initialize-particles (_type_) none 34) (draw-memcard-storage-error (_type_ font-context) none 35) @@ -202,16 +202,16 @@ (draw-memcard-auto-save-error (_type_ font-context) none 41) (draw-memcard-removed (_type_ font-context) none 42) (draw-memcard-error (_type_ font-context) none 43) - (dummy-44 (_type_) none 44) + (progress-dummy-44 (_type_) none 44) (push! (_type_) none 45) (pop! (_type_) none 46) - (dummy-47 (_type_) none 47) + (progress-dummy-47 (_type_) none 47) (enter! (_type_ progress-screen int) none 48) (draw-memcard-format (_type_ font-context) none 49) (draw-auto-save (_type_ font-context) none 50) (set-transition-progress! (_type_ int) none 51) (set-transition-speed! (_type_) none 52) - (dummy-53 (_type_ progress-screen) progress-screen 53) + (set-memcard-screen (_type_ progress-screen) progress-screen 53) (draw-pal-change-to-60hz (_type_ font-context) none 54) (draw-pal-now-60hz (_type_ font-context) none 55) (draw-no-disc (_type_ font-context) none 56) diff --git a/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc index 081bd9e4dd..96b069d6ea 100644 --- a/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc @@ -1579,7 +1579,7 @@ (sv-464 int) (sv-480 int) (sv-496 int) - (sv-512 uint) + (sv-512 int) (sv-528 (function _varargs_ object)) (sv-544 string) (sv-560 string) @@ -1629,7 +1629,7 @@ (set! sv-144 s2-1) (let ((v1-18 (-> s3-0 s0-0 option-type))) (cond - ((= v1-18 7) + ((= v1-18 (game-option-type yes-no)) (cond ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) (set! sv-160 format) @@ -1655,7 +1655,7 @@ ) ) ) - ((or (= v1-18 6) (= v1-18 8)) + ((or (= v1-18 (game-option-type menu)) (= v1-18 (game-option-type button))) (cond ((nonzero? (-> s3-0 s0-0 name)) (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) @@ -1673,7 +1673,7 @@ ) (set! (-> sv-112 origin x) (the float (- sv-128 (-> obj left-x-offset)))) (case (-> s3-0 s0-0 option-type) - ((3) + (((game-option-type center-screen)) (set! (-> sv-112 origin y) (the float (+ s2-1 -20))) ) (else @@ -1693,7 +1693,7 @@ (sv-288 a0-23 a1-11 a2-10 a3-4 t0-1) ) (case (-> s3-0 s0-0 option-type) - ((3) + (((game-option-type center-screen)) (set! sv-144 (+ s2-1 3)) sv-144 ) @@ -1702,243 +1702,243 @@ sv-144 ) ) - (let ((v1-81 (-> s3-0 s0-0 option-type))) - (cond - ((zero? v1-81) - (let* ((v1-82 (the-as uint #x8000ffff)) - (f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) - (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) - (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) - ) - (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as int a3-5)) - ) - (set! sv-304 format) - (let ((a0-42 (clear *temp-string*)) - (a1-13 "~D") - (a2-12 (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) - ) - (sv-304 a0-42 a1-13 a2-12) - ) - (set! sv-912 *temp-string*) - (set! sv-128 (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100)) - sv-128 - ) - ((= v1-81 2) - (cond - ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (set! sv-320 format) - (set! sv-336 (clear *temp-string*)) - (set! sv-352 "~30L~S~0L ~S") - (set! sv-368 (lookup-text! *common-text* (game-text-id on) #f)) - (let ((a3-6 (lookup-text! *common-text* (game-text-id off) #f))) - (sv-320 sv-336 sv-352 sv-368 a3-6) + (case (-> s3-0 s0-0 option-type) + (((game-option-type slider)) + (let* ((v1-82 (the-as uint #x8000ffff)) + (f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) + (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) + (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) ) - (set! sv-912 *temp-string*) - sv-912 - ) - (else - (set! sv-384 format) - (set! sv-400 (clear *temp-string*)) - (set! sv-416 "~0L~S ~30L~S~1L") - (set! sv-432 (lookup-text! *common-text* (game-text-id on) #f)) - (let ((a3-7 (lookup-text! *common-text* (game-text-id off) #f))) - (sv-384 sv-400 sv-416 sv-432 a3-7) - ) - (set! sv-912 *temp-string*) - sv-912 + (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as int a3-5)) + ) + (set! sv-304 format) + (let ((a0-42 (clear *temp-string*)) + (a1-13 "~D") + (a2-12 (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) ) + (sv-304 a0-42 a1-13 a2-12) + ) + (set! sv-912 *temp-string*) + (set! sv-128 (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100)) + sv-128 + ) + (((game-option-type on-off)) + (cond + ((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) + (set! sv-320 format) + (set! sv-336 (clear *temp-string*)) + (set! sv-352 "~30L~S~0L ~S") + (set! sv-368 (lookup-text! *common-text* (game-text-id on) #f)) + (let ((a3-6 (lookup-text! *common-text* (game-text-id off) #f))) + (sv-320 sv-336 sv-352 sv-368 a3-6) + ) + (set! sv-912 *temp-string*) + sv-912 + ) + (else + (set! sv-384 format) + (set! sv-400 (clear *temp-string*)) + (set! sv-416 "~0L~S ~30L~S~1L") + (set! sv-432 (lookup-text! *common-text* (game-text-id on) #f)) + (let ((a3-7 (lookup-text! *common-text* (game-text-id off) #f))) + (sv-384 sv-400 sv-416 sv-432 a3-7) + ) + (set! sv-912 *temp-string*) + sv-912 ) ) - ((= v1-81 1) - (set! sv-512 (-> obj language-selection)) - (set! sv-448 (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) - (if (and (zero? (scf-get-territory)) - (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) - ) - (set! sv-464 5) - (set! sv-464 6) - ) - (if (-> obj language-transition) - (set! (-> obj language-x-offset) - (seekl (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio)))) - ) - ) - (when (>= (-> obj language-x-offset) 100) - (set! (-> obj language-selection) sv-448) - (set! sv-512 sv-448) - (set! (-> obj language-transition) #f) - (set! (-> obj language-x-offset) 0) - 0 + ) + (((game-option-type language)) + (set! sv-512 (the-as int (-> obj language-selection))) + (set! sv-448 (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) + (if (and (zero? (scf-get-territory)) + (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) + ) + (set! sv-464 5) + (set! sv-464 6) ) - (set! (-> sv-112 origin y) (the float (+ s2-1 3))) - (let ((a0-62 sv-112)) - (set! (-> a0-62 color) (font-color lighter-lighter-blue)) + (if (-> obj language-transition) + (set! (-> obj language-x-offset) + (seekl (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio)))) + ) ) + (when (>= (-> obj language-x-offset) 100) + (set! (-> obj language-selection) (the-as language-enum sv-448)) + (set! sv-512 (the-as int sv-448)) + (set! (-> obj language-transition) #f) + (set! (-> obj language-x-offset) 0) 0 - (set! sv-480 (mod (the-as int (+ sv-512 1)) sv-464)) - (let ((a0-66 (mod (+ sv-464 -1 sv-512) sv-464)) - (v1-153 (mod (the-as int (+ sv-512 2)) sv-464)) - ) - (set! sv-496 (mod (+ sv-464 -2 sv-512) sv-464)) - (cond - ((-> obj language-direction) - (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) - (print-language-name a0-66 sv-112 a2-22 #f) - ) - (let ((a2-23 (+ (-> obj language-x-offset) 100))) - (cond - ((< a2-23 150) - (let ((t9-27 print-language-name) - (a1-30 sv-112) - (a3-9 #t) - ) - (t9-27 sv-480 a1-30 a2-23 a3-9) - ) + ) + (set! (-> sv-112 origin y) (the float (+ s2-1 3))) + (let ((a0-62 sv-112)) + (set! (-> a0-62 color) (font-color lighter-lighter-blue)) + ) + 0 + (set! sv-480 (mod (+ sv-512 1) sv-464)) + (let ((a0-66 (mod (+ sv-464 -1 sv-512) sv-464)) + (v1-153 (mod (+ sv-512 2) sv-464)) + ) + (set! sv-496 (mod (+ sv-464 -2 sv-512) sv-464)) + (cond + ((-> obj language-direction) + (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) + (print-language-name a0-66 sv-112 a2-22 #f) + ) + (let ((a2-23 (+ (-> obj language-x-offset) 100))) + (cond + ((< a2-23 150) + (let ((t9-27 print-language-name) + (a1-30 sv-112) + (a3-9 #t) + ) + (t9-27 sv-480 a1-30 a2-23 a3-9) ) - (else - (let ((a2-24 (- 200 (-> obj language-x-offset))) - (t9-28 print-language-name) - (a1-31 sv-112) - (a3-10 #f) - ) - (t9-28 sv-496 a1-31 a2-24 a3-10) - ) + ) + (else + (let ((a2-24 (- 200 (-> obj language-x-offset))) + (t9-28 print-language-name) + (a1-31 sv-112) + (a3-10 #f) + ) + (t9-28 sv-496 a1-31 a2-24 a3-10) ) ) ) ) - (else - (let ((a2-25 (+ (-> obj language-x-offset) 100))) - (cond - ((< a2-25 150) - (print-language-name a0-66 sv-112 a2-25 #f) - ) - (else - (let ((a2-26 (- 200 (-> obj language-x-offset)))) - (print-language-name v1-153 sv-112 a2-26 #t) - ) + ) + (else + (let ((a2-25 (+ (-> obj language-x-offset) 100))) + (cond + ((< a2-25 150) + (print-language-name a0-66 sv-112 a2-25 #f) + ) + (else + (let ((a2-26 (- 200 (-> obj language-x-offset)))) + (print-language-name v1-153 sv-112 a2-26 #t) ) ) ) - (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) - (print-language-name sv-480 sv-112 a2-27 #t) - ) + ) + (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) + (print-language-name sv-480 sv-112 a2-27 #t) ) ) ) - (when (not (-> obj language-transition)) - (let ((a0-75 sv-112)) - (set! (-> a0-75 color) (font-color yellow-green-2)) + ) + (when (not (-> obj language-transition)) + (let ((a0-75 sv-112)) + (set! (-> a0-75 color) (font-color yellow-green-2)) + ) + ) + (let ((t9-32 print-language-name) + (a1-37 sv-112) + (a2-28 (-> obj language-x-offset)) + (a3-14 (-> obj language-direction)) ) - ) - (let ((t9-32 print-language-name) - (a1-37 sv-112) - (a2-28 (-> obj language-x-offset)) - (a3-14 (-> obj language-direction)) - ) - (t9-32 (the-as int sv-512) a1-37 a2-28 (the-as symbol a3-14)) - ) + (t9-32 sv-512 a1-37 a2-28 a3-14) ) - ((= v1-81 3) - (set! sv-912 (lookup-text! *common-text* (game-text-id move-dpad) #f)) - sv-912 - ) - ((= v1-81 4) - (cond - ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3) - (set! sv-528 format) - (set! sv-544 (clear *temp-string*)) - (set! sv-560 "~30L~S~0L ~S") - (set! sv-576 (lookup-text! *common-text* (game-text-id 4x3) #f)) - (let ((a3-15 (lookup-text! *common-text* (game-text-id 16x9) #f))) - (sv-528 sv-544 sv-560 sv-576 a3-15) - ) - (set! sv-912 *temp-string*) - sv-912 + ) + (((game-option-type center-screen)) + (set! sv-912 (lookup-text! *common-text* (game-text-id move-dpad) #f)) + sv-912 + ) + (((game-option-type aspect-ratio)) + (cond + ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3) + (set! sv-528 format) + (set! sv-544 (clear *temp-string*)) + (set! sv-560 "~30L~S~0L ~S") + (set! sv-576 (lookup-text! *common-text* (game-text-id 4x3) #f)) + (let ((a3-15 (lookup-text! *common-text* (game-text-id 16x9) #f))) + (sv-528 sv-544 sv-560 sv-576 a3-15) ) - (else - (set! sv-592 format) - (set! sv-608 (clear *temp-string*)) - (set! sv-624 "~0L~S ~30L~S~1L") - (set! sv-640 (lookup-text! *common-text* (game-text-id 4x3) #f)) - (let ((a3-16 (lookup-text! *common-text* (game-text-id 16x9) #f))) - (sv-592 sv-608 sv-624 sv-640 a3-16) - ) - (set! sv-912 *temp-string*) - sv-912 + (set! sv-912 *temp-string*) + sv-912 + ) + (else + (set! sv-592 format) + (set! sv-608 (clear *temp-string*)) + (set! sv-624 "~0L~S ~30L~S~1L") + (set! sv-640 (lookup-text! *common-text* (game-text-id 4x3) #f)) + (let ((a3-16 (lookup-text! *common-text* (game-text-id 16x9) #f))) + (sv-592 sv-608 sv-624 sv-640 a3-16) ) + (set! sv-912 *temp-string*) + sv-912 ) ) - ((= v1-81 5) - (cond - ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc) - (set! sv-656 format) - (set! sv-672 (clear *temp-string*)) - (set! sv-688 "~0L~S ~30L~S~1L") - (set! sv-704 (lookup-text! *common-text* (game-text-id 50hz) #f)) - (let ((a3-17 (lookup-text! *common-text* (game-text-id 60hz) #f))) - (sv-656 sv-672 sv-688 sv-704 a3-17) - ) - (set! sv-912 *temp-string*) - sv-912 + ) + (((game-option-type video-mode)) + (cond + ((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc) + (set! sv-656 format) + (set! sv-672 (clear *temp-string*)) + (set! sv-688 "~0L~S ~30L~S~1L") + (set! sv-704 (lookup-text! *common-text* (game-text-id 50hz) #f)) + (let ((a3-17 (lookup-text! *common-text* (game-text-id 60hz) #f))) + (sv-656 sv-672 sv-688 sv-704 a3-17) ) - (else - (set! sv-720 format) - (set! sv-736 (clear *temp-string*)) - (set! sv-752 "~30L~S~0L ~S") - (set! sv-768 (lookup-text! *common-text* (game-text-id 50hz) #f)) - (let ((a3-18 (lookup-text! *common-text* (game-text-id 60hz) #f))) - (sv-720 sv-736 sv-752 sv-768 a3-18) - ) - (set! sv-912 *temp-string*) - sv-912 + (set! sv-912 *temp-string*) + sv-912 + ) + (else + (set! sv-720 format) + (set! sv-736 (clear *temp-string*)) + (set! sv-752 "~30L~S~0L ~S") + (set! sv-768 (lookup-text! *common-text* (game-text-id 50hz) #f)) + (let ((a3-18 (lookup-text! *common-text* (game-text-id 60hz) #f))) + (sv-720 sv-736 sv-752 sv-768 a3-18) ) + (set! sv-912 *temp-string*) + sv-912 ) ) - ) + ) ) ) (else - (let ((v1-195 (-> s3-0 s0-0 option-type))) - (cond - ((or (zero? v1-195) (= v1-195 3) (= v1-195 4) (= v1-195 5)) - (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - sv-912 - ) - ((= v1-195 2) - (set! sv-784 format) - (set! sv-800 (clear *temp-string*)) - (set! sv-816 "~S: ~S") - (set! sv-832 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (let ((a3-19 (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) - (lookup-text! *common-text* (game-text-id on) #f) - (lookup-text! *common-text* (game-text-id off) #f) - ) - ) - ) - (sv-784 sv-800 sv-816 sv-832 a3-19) - ) - (set! sv-912 *temp-string*) - sv-912 - ) - ((= v1-195 1) - (set! sv-848 format) - (set! sv-864 (clear *temp-string*)) - (set! sv-880 "~S: ~S") - (set! sv-896 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) - (let ((a3-20 (lookup-text! - *common-text* - (-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) - #f - ) - ) - ) - (sv-848 sv-864 sv-880 sv-896 a3-20) - ) - (set! sv-912 *temp-string*) - sv-912 - ) + (case (-> s3-0 s0-0 option-type) + (((game-option-type slider) + (game-option-type center-screen) + (game-option-type aspect-ratio) + (game-option-type video-mode) ) + (set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) + sv-912 + ) + (((game-option-type on-off)) + (set! sv-784 format) + (set! sv-800 (clear *temp-string*)) + (set! sv-816 "~S: ~S") + (set! sv-832 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) + (let ((a3-19 (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) + (lookup-text! *common-text* (game-text-id on) #f) + (lookup-text! *common-text* (game-text-id off) #f) + ) + ) + ) + (sv-784 sv-800 sv-816 sv-832 a3-19) + ) + (set! sv-912 *temp-string*) + sv-912 + ) + (((game-option-type language)) + (set! sv-848 format) + (set! sv-864 (clear *temp-string*)) + (set! sv-880 "~S: ~S") + (set! sv-896 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f)) + (let ((a3-20 (lookup-text! + *common-text* + (-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) + #f + ) + ) + ) + (sv-848 sv-864 sv-880 sv-896 a3-20) + ) + (set! sv-912 *temp-string*) + sv-912 + ) ) ) ) diff --git a/test/decompiler/reference/engine/ui/progress/progress-static_REF.gc b/test/decompiler/reference/engine/ui/progress/progress-static_REF.gc index 056b2d9ff9..c023341824 100644 --- a/test/decompiler/reference/engine/ui/progress/progress-static_REF.gc +++ b/test/decompiler/reference/engine/ui/progress/progress-static_REF.gc @@ -4,288 +4,370 @@ ;; definition for symbol *main-options*, type (array game-option) (define *main-options* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 7 :allocated-length 7 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x6 :name (game-text-id load-game) :scale #t :param3 16) - (new 'static 'game-option :option-type #x6 :name (game-text-id save-game) :scale #t :param3 17) - (new 'static 'game-option :option-type #x6 :name (game-text-id quit-game) :scale #t :param3 34) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) + (new + 'static + 'boxed-array + :type game-option :length 7 :allocated-length 7 + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id game-options) + :scale #t + :param3 (game-option-menu game-settings) ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id graphic-options) + :scale #t + :param3 (game-option-menu graphic-settings) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id sound-options) + :scale #t + :param3 (game-option-menu sound-settings) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id load-game) + :scale #t + :param3 (game-option-menu load-game) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id save-game) + :scale #t + :param3 (game-option-menu save-game) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id quit-game) + :scale #t + :param3 (game-option-menu quit) + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *title*, type (array game-option) (define *title* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id new-game) :scale #t :param3 18) - (new 'static 'game-option :option-type #x6 :name (game-text-id load-game) :scale #t :param3 16) - (new 'static 'game-option :option-type #x6 :name (game-text-id options) :scale #t :param3 28) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) + (new + 'static + 'boxed-array + :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id new-game) + :scale #t + :param3 (game-option-menu save-game-title) ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id load-game) + :scale #t + :param3 (game-option-menu load-game) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id options) + :scale #t + :param3 (game-option-menu settings-title) + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *options*, type (array game-option) (define *options* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) + (new + 'static + 'boxed-array + :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id game-options) + :scale #t + :param3 (game-option-menu game-settings) ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id graphic-options) + :scale #t + :param3 (game-option-menu graphic-settings) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id sound-options) + :scale #t + :param3 (game-option-menu sound-settings) + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *main-options-demo*, type (array game-option) (define *main-options-demo* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) + (new + 'static + 'boxed-array + :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id game-options) + :scale #t + :param3 (game-option-menu game-settings) ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id graphic-options) + :scale #t + :param3 (game-option-menu graphic-settings) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id sound-options) + :scale #t + :param3 (game-option-menu sound-settings) + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *main-options-demo-shared*, type (array game-option) (define *main-options-demo-shared* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x6 :name (game-text-id game-options) :scale #t :param3 4) - (new 'static 'game-option :option-type #x6 :name (game-text-id graphic-options) :scale #t :param3 5) - (new 'static 'game-option :option-type #x6 :name (game-text-id sound-options) :scale #t :param3 6) - (new 'static 'game-option :option-type #x8 :name (game-text-id exit-demo) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) + (new + 'static + 'boxed-array + :type game-option :length 5 :allocated-length 5 + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id game-options) + :scale #t + :param3 (game-option-menu game-settings) ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id graphic-options) + :scale #t + :param3 (game-option-menu graphic-settings) + ) + (new 'static 'game-option + :option-type (game-option-type menu) + :name (game-text-id sound-options) + :scale #t + :param3 (game-option-menu sound-settings) + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id exit-demo) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *game-options*, type (array game-option) (define *game-options* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x1 :name (game-text-id language) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new + 'static + 'boxed-array + :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type language) :name (game-text-id language) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *game-options-japan*, type (array game-option) (define *game-options-japan* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 3 :allocated-length 3 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new + 'static + 'boxed-array + :type game-option :length 3 :allocated-length 3 + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *game-options-demo*, type (array game-option) (define *game-options-demo* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 3 :allocated-length 3 - (new 'static 'game-option :option-type #x2 :name (game-text-id vibrations) :scale #t) - (new 'static 'game-option :option-type #x2 :name (game-text-id play-hints) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new + 'static + 'boxed-array + :type game-option :length 3 :allocated-length 3 + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *graphic-options*, type (array game-option) (define *graphic-options* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 3 :allocated-length 3 - (new 'static 'game-option :option-type #x3 :name (game-text-id center-screen) :scale #t) - (new 'static 'game-option :option-type #x4 :name (game-text-id aspect-ratio) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) + (new + 'static + 'boxed-array + :type game-option :length 3 :allocated-length 3 + (new 'static 'game-option + :option-type (game-option-type center-screen) + :name (game-text-id center-screen) + :scale #t ) + (new 'static 'game-option + :option-type (game-option-type aspect-ratio) + :name (game-text-id aspect-ratio) + :scale #t + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *graphic-title-options-pal*, type (array game-option) (define *graphic-title-options-pal* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :option-type #x3 :name (game-text-id center-screen) :scale #t) - (new 'static 'game-option :option-type #x5 :name (game-text-id video-mode) :scale #t) - (new 'static 'game-option :option-type #x4 :name (game-text-id aspect-ratio) :scale #t) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) + (new + 'static + 'boxed-array + :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option + :option-type (game-option-type center-screen) + :name (game-text-id center-screen) + :scale #t ) + (new 'static 'game-option + :option-type (game-option-type video-mode) + :name (game-text-id video-mode) + :scale #t + ) + (new 'static 'game-option + :option-type (game-option-type aspect-ratio) + :name (game-text-id aspect-ratio) + :scale #t + ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *sound-options*, type (array game-option) (define *sound-options* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 4 :allocated-length 4 - (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #t) - ) + (new + 'static + 'boxed-array + :type game-option :length 4 :allocated-length 4 + (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) ;; definition for symbol *yes-no-options*, type (array game-option) -(define *yes-no-options* (the-as (array game-option) (new - 'static - 'boxed-array - :type game-option :length 1 :allocated-length 1 - (new 'static 'game-option :option-type #x7 :scale #f) - ) - ) +(define *yes-no-options* (new + 'static + 'boxed-array + :type game-option :length 1 :allocated-length 1 + (new 'static 'game-option :option-type (game-option-type yes-no) :scale #f) + ) ) ;; definition for symbol *ok-options*, type (array game-option) (define *ok-options* - (the-as (array game-option) (new - 'static - 'boxed-array - :type game-option :length 1 :allocated-length 1 - (new 'static 'game-option :option-type #x8 :name (game-text-id ok) :scale #f) - ) - ) + (new + 'static + 'boxed-array + :type game-option :length 1 :allocated-length 1 + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id ok) :scale #f) + ) ) ;; definition for symbol *load-options*, type (array game-option) (define *load-options* - (the-as (array game-option) (new - 'static - 'boxed-array - :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) - ) + (new + 'static + 'boxed-array + :type game-option :length 5 :allocated-length 5 + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #f) + ) ) ;; definition for symbol *save-options*, type (array game-option) (define *save-options* - (the-as (array game-option) (new - 'static - 'boxed-array - :type game-option :length 5 :allocated-length 5 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) - ) - ) + (new + 'static + 'boxed-array + :type game-option :length 5 :allocated-length 5 + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #f) + ) ) ;; definition for symbol *save-options-title*, type (array game-option) (define *save-options-title* - (the-as (array game-option) - (new - 'static - 'boxed-array - :type game-option :length 6 :allocated-length 6 - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id continue-without-saving) :scale #f) - (new 'static 'game-option :option-type #x8 :name (game-text-id back) :scale #f) + (new + 'static + 'boxed-array + :type game-option :length 6 :allocated-length 6 + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option :option-type (game-option-type button) :scale #f) + (new 'static 'game-option + :option-type (game-option-type button) + :name (game-text-id continue-without-saving) + :scale #f ) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #f) ) ) ;; definition for symbol *options-remap*, type (array (array game-option)) -(define - *options-remap* - (the-as (array (array game-option)) (new 'static 'boxed-array :type array :length 0 :allocated-length 35)) - ) +(define *options-remap* (new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length 35)) ;; definition for symbol *level-task-data-remap*, type (array int32) -(define *level-task-data-remap* (the-as (array int32) (new - 'static - 'boxed-array - :type int32 :length 23 :allocated-length 23 - 0 - 1 - 2 - 3 - 3 - 4 - 5 - 6 - 7 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 13 - 13 - 14 - 15 - 15 - 4 - 4 - ) - ) +(define *level-task-data-remap* (new + 'static + 'boxed-array + :type int32 :length 23 :allocated-length 23 + 0 + 1 + 2 + 3 + 3 + 4 + 5 + 6 + 7 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 13 + 13 + 14 + 15 + 15 + 4 + 4 + ) ) ;; definition for symbol *language-name-remap*, type (array game-text-id) @@ -303,1178 +385,1173 @@ ) ;; definition for symbol *level-task-data*, type (array level-tasks-info) -(define - *level-task-data* - (the-as (array level-tasks-info) (new - 'static - 'boxed-array - :type level-tasks-info :length 16 :allocated-length 16 - (new 'static 'level-tasks-info - :level-name-id (game-text-id training-level-name) - :text-group-index 1 - :nb-of-tasks 4 - :buzzer-task-index 3 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task training-gimmie) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-gimmie-task-name) - (game-text-id training-gimmie-task-name) - (game-text-id training-gimmie-task-name) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task training-door) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-door-task-name) - (game-text-id training-door-task-name) - (game-text-id training-door-task-name) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task training-climb) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-climb-task-name) - (game-text-id training-climb-task-name) - (game-text-id training-climb-task-name) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task training-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id training-buzzer-task-name) - (game-text-id training-buzzer-task-name) - (game-text-id training-buzzer-task-name) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id village1-level-name) - :text-group-index 1 - :nb-of-tasks 6 - :buzzer-task-index 5 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task village1-mayor-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-mayor-money) - (game-text-id village1-mayor-money) - (game-text-id village1-mayor-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-uncle-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id vollage1-uncle-money) - (game-text-id vollage1-uncle-money) - (game-text-id vollage1-uncle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-yakow) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-yakow-herd) - (game-text-id village1-yakow-herd) - (game-text-id village1-yakow-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-oracle-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-oracle-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id village1-oracle) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village1-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id beach-level-name) - :text-group-index 1 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task beach-ecorocks) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-ecorocks) - (game-text-id beach-ecorocks) - (game-text-id beach-ecorocks) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-flutflut) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-flutflut-push) - (game-text-id beach-flutflut-push) - (game-text-id beach-flutflut-meet) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-pelican) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-pelican) - (game-text-id beach-pelican) - (game-text-id beach-pelican) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-seagull) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-seagull) - (game-text-id beach-seagull) - (game-text-id beach-seagull-get) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-cannon) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-cannon) - (game-text-id beach-cannon) - (game-text-id beach-cannon) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-gimmie) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-gimmie) - (game-text-id beach-gimmie) - (game-text-id beach-gimmie) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-sentinel) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-sentinel) - (game-text-id beach-sentinel) - (game-text-id beach-sentinel) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task beach-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id jungle-level-name) - :text-group-index 1 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task jungle-lurkerm) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-lurkerm-unblock) - (game-text-id jungle-lurkerm-connect) - (game-text-id jungle-lurkerm-return) - (game-text-id zero) - ) - :text-index-when-resolved 1 - ) - (new 'static 'task-info-data - :task-id (game-task jungle-tower) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-tower) - (game-text-id jungle-tower) - (game-text-id jungle-tower) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-eggtop) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-eggtop) - (game-text-id jungle-eggtop) - (game-text-id jungle-eggtop) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-plant) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-plant) - (game-text-id jungle-plant) - (game-text-id jungle-plant) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-fishgame) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-fishgame) - (game-text-id jungle-fishgame) - (game-text-id jungle-fishgame) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-canyon-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-canyon-end) - (game-text-id jungle-canyon-end) - (game-text-id jungle-canyon-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-temple-door) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id jungle-temple-door) - (game-text-id jungle-temple-door) - (game-text-id jungle-temple-door) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task jungle-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id misty-level-name) - :text-group-index 1 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task misty-muse) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-muse-catch) - (game-text-id misty-muse-catch) - (game-text-id misty-muse-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-boat) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-boat) - (game-text-id misty-boat) - (game-text-id misty-boat) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-cannon) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-cannon) - (game-text-id misty-cannon) - (game-text-id misty-cannon) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-warehouse) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-return-to-pool) - (game-text-id misty-return-to-pool) - (game-text-id misty-return-to-pool) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-bike) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-find-transpad) - (game-text-id misty-balloon-lurkers) - (game-text-id misty-find-transpad) - (game-text-id zero) - ) - :text-index-when-resolved 1 - ) - (new 'static 'task-info-data - :task-id (game-task misty-bike-jump) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-bike-jump) - (game-text-id misty-bike-jump) - (game-text-id misty-bike-jump) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-eco-challenge) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id misty-eco-challenge) - (game-text-id misty-eco-challenge) - (game-text-id misty-eco-challenge) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task misty-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id beach-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id fire-canyon-level-name) - :text-group-index 5 - :nb-of-tasks 2 - :buzzer-task-index 1 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task firecanyon-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id fire-canyon-end) - (game-text-id fire-canyon-end) - (game-text-id fire-canyon-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task firecanyon-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id fire-canyon-buzzer) - (game-text-id fire-canyon-buzzer) - (game-text-id fire-canyon-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id village2-level-name) - :text-group-index 2 - :nb-of-tasks 6 - :buzzer-task-index 5 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task village2-gambler-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-gambler-money) - (game-text-id village2-gambler-money) - (game-text-id village2-gambler-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-geologist-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-geologist-money) - (game-text-id village2-geologist-money) - (game-text-id village2-geologist-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-warrior-money) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-warrior-money) - (game-text-id village2-warrior-money) - (game-text-id village2-warrior-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-oracle-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-oracle-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id village2-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village2-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id sunken-level-name) - :text-group-index 2 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task sunken-room) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-elevator-raise) - (game-text-id sunken-elevator-raise) - (game-text-id sunken-elevator-get-to-roof) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-pipe) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-pipe) - (game-text-id sunken-pipe) - (game-text-id sunken-pipe) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-slide) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-bottom) - (game-text-id sunken-bottom) - (game-text-id sunken-bottom) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-sharks) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-pool) - (game-text-id sunken-pool) - (game-text-id sunken-pool) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-platforms) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-platforms) - (game-text-id sunken-platforms) - (game-text-id sunken-platforms) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-top-of-helix) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id sunken-climb-tube) - (game-text-id sunken-climb-tube) - (game-text-id sunken-climb-tube) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-spinning-room) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id reach-center) - (game-text-id reach-center) - (game-text-id reach-center) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task sunken-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id swamp-level-name) - :text-group-index 2 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task swamp-flutflut) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-flutflut) - (game-text-id swamp-flutflut) - (game-text-id swamp-flutflut) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-billy) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-billy) - (game-text-id swamp-billy) - (game-text-id swamp-billy) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-battle) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-battle) - (game-text-id swamp-battle) - (game-text-id swamp-battle) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-4) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-tether-3) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id swamp-tether) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task swamp-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id rolling-level-name) - :text-group-index 2 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task rolling-moles) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-moles) - (game-text-id rolling-moles) - (game-text-id rolling-moles-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-robbers) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-robbers) - (game-text-id rolling-robbers) - (game-text-id rolling-robbers) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-race) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-race) - (game-text-id rolling-race) - (game-text-id rolling-race-return) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-lake) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-lake) - (game-text-id rolling-lake) - (game-text-id rolling-lake) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-plants) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-plants) - (game-text-id rolling-plants) - (game-text-id rolling-plants) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-ring-chase-1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-ring-chase-1) - (game-text-id rolling-ring-chase-1) - (game-text-id rolling-ring-chase-1) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-ring-chase-2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id rolling-ring-chase-2) - (game-text-id rolling-ring-chase-2) - (game-text-id rolling-ring-chase-2) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task rolling-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id unknown-buzzers) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id ogre-level-name) - :text-group-index 6 - :nb-of-tasks 4 - :buzzer-task-index 3 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task ogre-boss) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id ogre-boss) - (game-text-id ogre-boss) - (game-text-id ogre-boss) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task ogre-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id ogre-end) - (game-text-id ogre-end) - (game-text-id ogre-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task ogre-secret) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task ogre-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id ogre-buzzer) - (game-text-id ogre-buzzer) - (game-text-id ogre-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id village3-level-name) - :text-group-index 3 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task village3-miner-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-miner-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-miner-money3) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-miner-money4) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id village3-miner-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-oracle-money1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-oracle-money2) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id village3-oracle-money) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-extra1) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id hidden-power-cell) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task village3-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id snowy-level-name) - :text-group-index 3 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task snow-eggtop) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-eggtop) - (game-text-id snow-eggtop) - (game-text-id snow-eggtop) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-ram) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-ram-3-left) - (game-text-id snow-ram-2-left) - (game-text-id snow-ram-1-left) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-bumpers) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-bumpers) - (game-text-id snow-bumpers) - (game-text-id snow-bumpers) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-cage) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-frozen-crate) - (game-text-id snow-frozen-crate) - (game-text-id snow-frozen-crate) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-fort) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-fort) - (game-text-id snow-fort) - (game-text-id snow-fort) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-ball) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-open-door) - (game-text-id snow-open-door) - (game-text-id snow-open-door) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-bunnies) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id snow-bunnies) - (game-text-id snow-bunnies) - (game-text-id snow-bunnies) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task snow-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id cave-level-name) - :text-group-index 3 - :nb-of-tasks 8 - :buzzer-task-index 7 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task cave-gnawers) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-gnawers) - (game-text-id cave-gnawers) - (game-text-id cave-gnawers) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-dark-crystals) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-dark-crystals) - (game-text-id cave-dark-crystals) - (game-text-id cave-dark-crystals) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-dark-climb) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-dark-climb) - (game-text-id cave-dark-climb) - (game-text-id cave-dark-climb) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-robot-climb) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-robot-climb) - (game-text-id cave-robot-climb) - (game-text-id cave-robot-climb) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-swing-poles) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-swing-poles) - (game-text-id cave-swing-poles) - (game-text-id cave-swing-poles) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-spider-tunnel) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-spider-tunnel) - (game-text-id cave-spider-tunnel) - (game-text-id cave-spider-tunnel) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-platforms) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id cave-platforms) - (game-text-id cave-platforms) - (game-text-id cave-platforms) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task cave-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id village3-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id lavatube-level-name) - :text-group-index 3 - :nb-of-tasks 2 - :buzzer-task-index 1 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task lavatube-end) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id lavatube-end) - (game-text-id lavatube-end) - (game-text-id lavatube-end) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task lavatube-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id lavatube-buzzer) - (game-text-id lavatube-buzzer) - (game-text-id lavatube-buzzer) - (game-text-id zero) - ) - ) - ) - ) - (new 'static 'level-tasks-info - :level-name-id (game-text-id citadel-level-name) - :text-group-index 4 - :nb-of-tasks 5 - :buzzer-task-index 4 - :task-info - (new 'static 'array task-info-data 8 - (new 'static 'task-info-data - :task-id (game-task citadel-sage-blue) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-blue) - (game-text-id citadel-sage-blue) - (game-text-id citadel-sage-blue) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-sage-red) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-red) - (game-text-id citadel-sage-red) - (game-text-id citadel-sage-red) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-sage-yellow) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-yellow) - (game-text-id citadel-sage-yellow) - (game-text-id citadel-sage-yellow) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-sage-green) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-sage-green) - (game-text-id citadel-sage-green) - (game-text-id citadel-sage-green) - (game-text-id zero) - ) - ) - (new 'static 'task-info-data - :task-id (game-task citadel-buzzer) - :task-name - (new 'static 'array game-text-id 4 - (game-text-id citadel-buzzer) - (game-text-id citadel-buzzer) - (game-text-id citadel-buzzer) - (game-text-id zero) - ) - ) - ) - ) - ) - ) - ) +(define *level-task-data* (new + 'static + 'boxed-array + :type level-tasks-info :length 16 :allocated-length 16 + (new 'static 'level-tasks-info + :level-name-id (game-text-id training-level-name) + :text-group-index 1 + :nb-of-tasks 4 + :buzzer-task-index 3 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task training-gimmie) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id training-gimmie-task-name) + (game-text-id training-gimmie-task-name) + (game-text-id training-gimmie-task-name) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task training-door) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id training-door-task-name) + (game-text-id training-door-task-name) + (game-text-id training-door-task-name) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task training-climb) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id training-climb-task-name) + (game-text-id training-climb-task-name) + (game-text-id training-climb-task-name) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task training-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id training-buzzer-task-name) + (game-text-id training-buzzer-task-name) + (game-text-id training-buzzer-task-name) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id village1-level-name) + :text-group-index 1 + :nb-of-tasks 6 + :buzzer-task-index 5 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task village1-mayor-money) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village1-mayor-money) + (game-text-id village1-mayor-money) + (game-text-id village1-mayor-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village1-uncle-money) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id vollage1-uncle-money) + (game-text-id vollage1-uncle-money) + (game-text-id vollage1-uncle-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village1-yakow) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village1-yakow-herd) + (game-text-id village1-yakow-herd) + (game-text-id village1-yakow-return) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village1-oracle-money1) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village1-oracle) + (game-text-id village1-oracle) + (game-text-id village1-oracle) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village1-oracle-money2) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village1-oracle) + (game-text-id village1-oracle) + (game-text-id village1-oracle) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village1-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id beach-level-name) + :text-group-index 1 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task beach-ecorocks) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id beach-ecorocks) + (game-text-id beach-ecorocks) + (game-text-id beach-ecorocks) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-flutflut) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id beach-flutflut-push) + (game-text-id beach-flutflut-push) + (game-text-id beach-flutflut-meet) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-pelican) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id beach-pelican) + (game-text-id beach-pelican) + (game-text-id beach-pelican) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-seagull) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id beach-seagull) + (game-text-id beach-seagull) + (game-text-id beach-seagull-get) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-cannon) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id beach-cannon) + (game-text-id beach-cannon) + (game-text-id beach-cannon) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-gimmie) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id beach-gimmie) + (game-text-id beach-gimmie) + (game-text-id beach-gimmie) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-sentinel) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id beach-sentinel) + (game-text-id beach-sentinel) + (game-text-id beach-sentinel) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task beach-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id jungle-level-name) + :text-group-index 1 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task jungle-lurkerm) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id jungle-lurkerm-unblock) + (game-text-id jungle-lurkerm-connect) + (game-text-id jungle-lurkerm-return) + (game-text-id zero) + ) + :text-index-when-resolved 1 + ) + (new 'static 'task-info-data + :task-id (game-task jungle-tower) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id jungle-tower) + (game-text-id jungle-tower) + (game-text-id jungle-tower) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task jungle-eggtop) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id jungle-eggtop) + (game-text-id jungle-eggtop) + (game-text-id jungle-eggtop) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task jungle-plant) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id jungle-plant) + (game-text-id jungle-plant) + (game-text-id jungle-plant) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task jungle-fishgame) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id jungle-fishgame) + (game-text-id jungle-fishgame) + (game-text-id jungle-fishgame) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task jungle-canyon-end) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id jungle-canyon-end) + (game-text-id jungle-canyon-end) + (game-text-id jungle-canyon-end) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task jungle-temple-door) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id jungle-temple-door) + (game-text-id jungle-temple-door) + (game-text-id jungle-temple-door) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task jungle-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id misty-level-name) + :text-group-index 1 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task misty-muse) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id misty-muse-catch) + (game-text-id misty-muse-catch) + (game-text-id misty-muse-return) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task misty-boat) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id misty-boat) + (game-text-id misty-boat) + (game-text-id misty-boat) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task misty-cannon) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id misty-cannon) + (game-text-id misty-cannon) + (game-text-id misty-cannon) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task misty-warehouse) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id misty-return-to-pool) + (game-text-id misty-return-to-pool) + (game-text-id misty-return-to-pool) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task misty-bike) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id misty-find-transpad) + (game-text-id misty-balloon-lurkers) + (game-text-id misty-find-transpad) + (game-text-id zero) + ) + :text-index-when-resolved 1 + ) + (new 'static 'task-info-data + :task-id (game-task misty-bike-jump) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id misty-bike-jump) + (game-text-id misty-bike-jump) + (game-text-id misty-bike-jump) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task misty-eco-challenge) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id misty-eco-challenge) + (game-text-id misty-eco-challenge) + (game-text-id misty-eco-challenge) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task misty-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id beach-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id fire-canyon-level-name) + :text-group-index 5 + :nb-of-tasks 2 + :buzzer-task-index 1 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task firecanyon-end) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id fire-canyon-end) + (game-text-id fire-canyon-end) + (game-text-id fire-canyon-end) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task firecanyon-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id fire-canyon-buzzer) + (game-text-id fire-canyon-buzzer) + (game-text-id fire-canyon-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id village2-level-name) + :text-group-index 2 + :nb-of-tasks 6 + :buzzer-task-index 5 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task village2-gambler-money) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village2-gambler-money) + (game-text-id village2-gambler-money) + (game-text-id village2-gambler-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village2-geologist-money) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village2-geologist-money) + (game-text-id village2-geologist-money) + (game-text-id village2-geologist-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village2-warrior-money) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village2-warrior-money) + (game-text-id village2-warrior-money) + (game-text-id village2-warrior-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village2-oracle-money1) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village2-oracle-money) + (game-text-id village2-oracle-money) + (game-text-id village2-oracle-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village2-oracle-money2) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village2-oracle-money) + (game-text-id village2-oracle-money) + (game-text-id village2-oracle-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village2-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id sunken-level-name) + :text-group-index 2 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task sunken-room) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id sunken-elevator-raise) + (game-text-id sunken-elevator-raise) + (game-text-id sunken-elevator-get-to-roof) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-pipe) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id sunken-pipe) + (game-text-id sunken-pipe) + (game-text-id sunken-pipe) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-slide) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id sunken-bottom) + (game-text-id sunken-bottom) + (game-text-id sunken-bottom) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-sharks) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id sunken-pool) + (game-text-id sunken-pool) + (game-text-id sunken-pool) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-platforms) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id sunken-platforms) + (game-text-id sunken-platforms) + (game-text-id sunken-platforms) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-top-of-helix) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id sunken-climb-tube) + (game-text-id sunken-climb-tube) + (game-text-id sunken-climb-tube) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-spinning-room) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id reach-center) + (game-text-id reach-center) + (game-text-id reach-center) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task sunken-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id swamp-level-name) + :text-group-index 2 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task swamp-flutflut) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id swamp-flutflut) + (game-text-id swamp-flutflut) + (game-text-id swamp-flutflut) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-billy) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id swamp-billy) + (game-text-id swamp-billy) + (game-text-id swamp-billy) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-battle) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id swamp-battle) + (game-text-id swamp-battle) + (game-text-id swamp-battle) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-tether-4) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-tether-1) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-tether-2) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-tether-3) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id swamp-tether) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task swamp-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id rolling-level-name) + :text-group-index 2 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task rolling-moles) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id rolling-moles) + (game-text-id rolling-moles) + (game-text-id rolling-moles-return) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-robbers) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id rolling-robbers) + (game-text-id rolling-robbers) + (game-text-id rolling-robbers) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-race) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id rolling-race) + (game-text-id rolling-race) + (game-text-id rolling-race-return) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-lake) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id rolling-lake) + (game-text-id rolling-lake) + (game-text-id rolling-lake) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-plants) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id rolling-plants) + (game-text-id rolling-plants) + (game-text-id rolling-plants) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-ring-chase-1) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id rolling-ring-chase-1) + (game-text-id rolling-ring-chase-1) + (game-text-id rolling-ring-chase-1) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-ring-chase-2) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id rolling-ring-chase-2) + (game-text-id rolling-ring-chase-2) + (game-text-id rolling-ring-chase-2) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task rolling-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id unknown-buzzers) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id ogre-level-name) + :text-group-index 6 + :nb-of-tasks 4 + :buzzer-task-index 3 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task ogre-boss) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id ogre-boss) + (game-text-id ogre-boss) + (game-text-id ogre-boss) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task ogre-end) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id ogre-end) + (game-text-id ogre-end) + (game-text-id ogre-end) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task ogre-secret) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id hidden-power-cell) + (game-text-id hidden-power-cell) + (game-text-id hidden-power-cell) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task ogre-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id ogre-buzzer) + (game-text-id ogre-buzzer) + (game-text-id ogre-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id village3-level-name) + :text-group-index 3 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task village3-miner-money1) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-miner-money2) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-miner-money3) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-miner-money4) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id village3-miner-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-oracle-money1) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village3-oracle-money) + (game-text-id village3-oracle-money) + (game-text-id village3-oracle-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-oracle-money2) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village3-oracle-money) + (game-text-id village3-oracle-money) + (game-text-id village3-oracle-money) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-extra1) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id hidden-power-cell) + (game-text-id hidden-power-cell) + (game-text-id hidden-power-cell) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task village3-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village3-buzzer) + (game-text-id village3-buzzer) + (game-text-id village3-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id snowy-level-name) + :text-group-index 3 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task snow-eggtop) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id snow-eggtop) + (game-text-id snow-eggtop) + (game-text-id snow-eggtop) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-ram) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id snow-ram-3-left) + (game-text-id snow-ram-2-left) + (game-text-id snow-ram-1-left) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-bumpers) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id snow-bumpers) + (game-text-id snow-bumpers) + (game-text-id snow-bumpers) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-cage) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id snow-frozen-crate) + (game-text-id snow-frozen-crate) + (game-text-id snow-frozen-crate) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-fort) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id snow-fort) + (game-text-id snow-fort) + (game-text-id snow-fort) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-ball) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id snow-open-door) + (game-text-id snow-open-door) + (game-text-id snow-open-door) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-bunnies) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id snow-bunnies) + (game-text-id snow-bunnies) + (game-text-id snow-bunnies) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task snow-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village3-buzzer) + (game-text-id village3-buzzer) + (game-text-id village3-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id cave-level-name) + :text-group-index 3 + :nb-of-tasks 8 + :buzzer-task-index 7 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task cave-gnawers) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id cave-gnawers) + (game-text-id cave-gnawers) + (game-text-id cave-gnawers) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-dark-crystals) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id cave-dark-crystals) + (game-text-id cave-dark-crystals) + (game-text-id cave-dark-crystals) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-dark-climb) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id cave-dark-climb) + (game-text-id cave-dark-climb) + (game-text-id cave-dark-climb) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-robot-climb) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id cave-robot-climb) + (game-text-id cave-robot-climb) + (game-text-id cave-robot-climb) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-swing-poles) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id cave-swing-poles) + (game-text-id cave-swing-poles) + (game-text-id cave-swing-poles) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-spider-tunnel) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id cave-spider-tunnel) + (game-text-id cave-spider-tunnel) + (game-text-id cave-spider-tunnel) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-platforms) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id cave-platforms) + (game-text-id cave-platforms) + (game-text-id cave-platforms) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task cave-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id village3-buzzer) + (game-text-id village3-buzzer) + (game-text-id village3-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id lavatube-level-name) + :text-group-index 3 + :nb-of-tasks 2 + :buzzer-task-index 1 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task lavatube-end) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id lavatube-end) + (game-text-id lavatube-end) + (game-text-id lavatube-end) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task lavatube-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id lavatube-buzzer) + (game-text-id lavatube-buzzer) + (game-text-id lavatube-buzzer) + (game-text-id zero) + ) + ) + ) + ) + (new 'static 'level-tasks-info + :level-name-id (game-text-id citadel-level-name) + :text-group-index 4 + :nb-of-tasks 5 + :buzzer-task-index 4 + :task-info + (new 'static 'array task-info-data 8 + (new 'static 'task-info-data + :task-id (game-task citadel-sage-blue) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id citadel-sage-blue) + (game-text-id citadel-sage-blue) + (game-text-id citadel-sage-blue) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task citadel-sage-red) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id citadel-sage-red) + (game-text-id citadel-sage-red) + (game-text-id citadel-sage-red) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task citadel-sage-yellow) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id citadel-sage-yellow) + (game-text-id citadel-sage-yellow) + (game-text-id citadel-sage-yellow) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task citadel-sage-green) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id citadel-sage-green) + (game-text-id citadel-sage-green) + (game-text-id citadel-sage-green) + (game-text-id zero) + ) + ) + (new 'static 'task-info-data + :task-id (game-task citadel-buzzer) + :task-name + (new 'static 'array game-text-id 4 + (game-text-id citadel-buzzer) + (game-text-id citadel-buzzer) + (game-text-id citadel-buzzer) + (game-text-id zero) + ) + ) + ) + ) + ) + ) ;; definition for symbol *task-egg-starting-x*, type (array int32) (define *task-egg-starting-x* - (the-as (array int32) - (new 'static 'boxed-array :type int32 :length 9 :allocated-length 9 #xda #xc2 #xab #x93 #x7c 100 77 53 30) - ) + (new 'static 'boxed-array :type int32 :length 9 :allocated-length 9 #xda #xc2 #xab #x93 #x7c 100 77 53 30) ) ;; definition for symbol *game-counts*, type game-count-info diff --git a/test/decompiler/reference/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/engine/ui/progress/progress_REF.gc index 8d459e890b..34b54cf694 100644 --- a/test/decompiler/reference/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/engine/ui/progress/progress_REF.gc @@ -10,7 +10,7 @@ (starting-state progress-screen :offset-assert 24) (last-slot-saved int32 :offset-assert 32) (slider-backup float :offset-assert 36) - (language-backup int64 :offset-assert 40) + (language-backup language-enum :offset-assert 40) (on-off-backup symbol :offset-assert 48) (center-x-backup int32 :offset-assert 52) (center-y-backup int32 :offset-assert 56) @@ -1065,7 +1065,7 @@ ) ;; definition for method 32 of type progress -(defmethod dummy-32 progress ((obj progress)) +(defmethod can-go-back? progress ((obj progress)) (let ((v1-2 (-> *progress-process* 0 display-state)) (a1-1 (-> *progress-state* starting-state)) ) @@ -1095,7 +1095,7 @@ ;; definition for method 19 of type progress ;; INFO: Return type mismatch object vs symbol. -(defmethod dummy-19 progress ((obj progress)) +(defmethod visible? progress ((obj progress)) (the-as symbol (and *progress-process* (zero? (-> *progress-process* 0 in-out-position)))) ) @@ -1147,7 +1147,7 @@ ) ;; definition for method 53 of type progress -(defmethod dummy-53 progress ((obj progress) (arg0 progress-screen)) +(defmethod set-memcard-screen progress ((obj progress) (arg0 progress-screen)) (let ((s4-0 (-> obj card-info)) (gp-0 arg0) ) @@ -1250,7 +1250,7 @@ ;; definition for method 31 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod dummy-31 progress ((obj progress)) +(defmethod respond-memcard progress ((obj progress)) (let ((s5-0 (-> obj card-info))) (when (and s5-0 (not (-> obj in-transition))) (when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) @@ -1307,14 +1307,12 @@ (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) (set! (-> obj next-display-state) (progress-screen memcard-saving)) ) - ((begin - (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) - (= (-> obj display-state-stack 0) (progress-screen title)) - ) - (set! (-> obj next-display-state) (progress-screen save-game-title)) - ) (else - (set! (-> obj next-display-state) (progress-screen save-game)) + (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) + (if (= (-> obj display-state-stack 0) (progress-screen title)) + (set! (-> obj next-display-state) (progress-screen save-game-title)) + (set! (-> obj next-display-state) (progress-screen save-game)) + ) ) ) ) @@ -1443,7 +1441,7 @@ ;; definition for method 29 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod dummy-29 progress ((obj progress)) +(defmethod respond-common progress ((obj progress)) (mc-get-slot-info 0 *progress-save-info*) (set! (-> obj card-info) *progress-save-info*) (let ((s5-0 (-> *options-remap* (-> obj display-state)))) @@ -1467,7 +1465,7 @@ (when (-> obj selected-option) (let ((v1-34 #f)) (case (-> s5-0 (-> obj option-index) option-type) - ((3) + (((game-option-type center-screen)) (when (< -48 (-> *setting-control* current screeny)) (set! v1-34 #t) (+! (-> *setting-control* default screeny) -1) @@ -1508,7 +1506,7 @@ (when (-> obj selected-option) (let ((v1-69 #f)) (case (-> s5-0 (-> obj option-index) option-type) - ((3) + (((game-option-type center-screen)) (when (< (-> *setting-control* current screeny) 48) (set! v1-69 #t) (+! (-> *setting-control* default screeny) 1) @@ -1529,10 +1527,10 @@ ((cpad-hold? 0 left) (cond ((cpad-pressed? 0 left) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7)) + (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))) (let ((s4-5 #f)) (case (-> s5-0 (-> obj option-index) option-type) - ((2 7) + (((game-option-type on-off) (game-option-type yes-no)) (when (not (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) (set! s4-5 #t) (if (= (-> s5-0 (-> obj option-index) value-to-modify) (&-> *setting-control* current vibration)) @@ -1541,15 +1539,15 @@ ) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) #t) ) - ((4) + (((game-option-type aspect-ratio)) (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9)) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3) ) - ((5) + (((game-option-type video-mode)) (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc)) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal) ) - ((1) + (((game-option-type language)) (if (> (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) 0) (+! (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify))) -1) (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) @@ -1575,35 +1573,33 @@ (else (when (-> obj selected-option) (let ((v1-157 #f)) - (let ((a0-101 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? a0-101) - (cond - ((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> s5-0 (-> obj option-index) param1)) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (cond + ((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (+ 1.0 (-> s5-0 (-> obj option-index) param1)) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (+ -1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ -1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - (set! v1-157 #t) - ) - ((< (-> s5-0 (-> obj option-index) param1) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param1) - ) - (set! v1-157 #t) - ) - ) + (set! v1-157 #t) + ) + ((< (-> s5-0 (-> obj option-index) param1) + (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> s5-0 (-> obj option-index) param1) + ) + (set! v1-157 #t) + ) ) - ((= a0-101 3) - (when (< -96 (-> *setting-control* default screenx)) - (set! v1-157 #t) - (+! (-> *setting-control* default screenx) -1) - ) + ) + (((game-option-type center-screen)) + (when (< -96 (-> *setting-control* default screenx)) + (set! v1-157 #t) + (+! (-> *setting-control* default screenx) -1) ) - ) + ) ) (when v1-157 (let ((f30-0 100.0)) @@ -1626,22 +1622,22 @@ ((cpad-hold? 0 right) (cond ((cpad-pressed? 0 right) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7)) + (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))) (let ((v1-217 (the-as object #f))) (case (-> s5-0 (-> obj option-index) option-type) - ((2 7) + (((game-option-type on-off) (game-option-type yes-no)) (set! v1-217 (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) #f) ) - ((4) + (((game-option-type aspect-ratio)) (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3)) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9) ) - ((5) + (((game-option-type video-mode)) (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal)) (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc) ) - ((1) + (((game-option-type language)) (let ((v1-243 (if (and (zero? (scf-get-territory)) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) ) @@ -1674,35 +1670,33 @@ (else (when (-> obj selected-option) (let ((v1-263 #f)) - (let ((a0-177 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? a0-177) - (cond - ((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2)) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (cond + ((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2)) + (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (+ 1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - (set! v1-263 #t) - ) - ((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) - ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) - ) - (set! v1-263 #t) - ) - ) + (set! v1-263 #t) + ) + ((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> s5-0 (-> obj option-index) param2) + ) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> s5-0 (-> obj option-index) param2) + ) + (set! v1-263 #t) + ) ) - ((= a0-177 3) - (when (< (-> *setting-control* default screenx) 96) - (set! v1-263 #t) - (+! (-> *setting-control* default screenx) 1) - ) + ) + (((game-option-type center-screen)) + (when (< (-> *setting-control* default screenx) 96) + (set! v1-263 #t) + (+! (-> *setting-control* default screenx) 1) ) - ) + ) ) (when v1-263 (let ((f30-1 100.0)) @@ -1725,38 +1719,36 @@ ((or (cpad-pressed? 0 square) (cpad-pressed? 0 triangle)) (cond ((-> obj selected-option) - (let ((v1-319 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? v1-319) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* slider-backup) - ) - ) - ((= v1-319 1) - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> *progress-state* language-backup) - ) - ) - ((= v1-319 2) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) - (-> *progress-state* on-off-backup) - ) - ) - ((= v1-319 3) - (set! (-> *setting-control* default screenx) (-> *progress-state* center-x-backup)) - (set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup)) - ) - ((or (= v1-319 4) (= v1-319 5)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) - (-> *progress-state* aspect-ratio-backup) - ) - ) - ) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> *progress-state* slider-backup) + ) + ) + (((game-option-type language)) + (set! (-> (the-as (pointer language-enum) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (-> *progress-state* language-backup) + ) + ) + (((game-option-type on-off)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (-> *progress-state* on-off-backup) + ) + ) + (((game-option-type center-screen)) + (set! (-> *setting-control* default screenx) (-> *progress-state* center-x-backup)) + (set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup)) + ) + (((game-option-type aspect-ratio) (game-option-type video-mode)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (-> *progress-state* aspect-ratio-backup) + ) + ) ) (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) (set! (-> obj selected-option) #f) ) - ((or (dummy-32 obj) + ((or (can-go-back? obj) (= (-> obj display-state) (progress-screen load-game)) (= (-> obj display-state) (progress-screen save-game)) (= (-> obj display-state) (progress-screen save-game-title)) @@ -1778,7 +1770,7 @@ (cond ((not (-> obj selected-option)) (cond - ((= (-> s5-0 (-> obj option-index) option-type) 6) + ((= (-> s5-0 (-> obj option-index) option-type) (game-option-type menu)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) @@ -1788,11 +1780,11 @@ (set! (-> obj next-display-state) (the-as progress-screen (-> s5-0 (-> obj option-index) param3))) (case (-> obj next-display-state) (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) - (set! (-> obj next-display-state) (dummy-53 obj (-> obj next-display-state))) + (set! (-> obj next-display-state) (set-memcard-screen obj (-> obj next-display-state))) ) ) ) - ((= (-> s5-0 (-> obj option-index) option-type) 8) + ((= (-> s5-0 (-> obj option-index) option-type) (game-option-type button)) (cond ((= (-> s5-0 (-> obj option-index) name) (game-text-id exit-demo)) (set! *master-exit* 'force) @@ -1808,34 +1800,32 @@ ) ) ) - ((!= (-> s5-0 (-> obj option-index) option-type) 7) - (let ((v1-427 (-> s5-0 (-> obj option-index) option-type))) - (cond - ((zero? v1-427) - (set! (-> *progress-state* slider-backup) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - ) - ) - ((= v1-427 1) - (set! (-> *progress-state* language-backup) - (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ((= v1-427 2) - (set! (-> *progress-state* on-off-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ((= v1-427 3) - (set! (-> *progress-state* center-x-backup) (-> *setting-control* default screenx)) - (set! (-> *progress-state* center-y-backup) (-> *setting-control* default screeny)) - ) - ((or (= v1-427 4) (= v1-427 5)) - (set! (-> *progress-state* aspect-ratio-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - ) - ) - ) + ((!= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no)) + (case (-> s5-0 (-> obj option-index) option-type) + (((game-option-type slider)) + (set! (-> *progress-state* slider-backup) + (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ) + ) + (((game-option-type language)) + (set! (-> *progress-state* language-backup) + (the-as language-enum (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) + ) + ) + (((game-option-type on-off)) + (set! (-> *progress-state* on-off-backup) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + ) + ) + (((game-option-type center-screen)) + (set! (-> *progress-state* center-x-backup) (-> *setting-control* default screenx)) + (set! (-> *progress-state* center-y-backup) (-> *setting-control* default screeny)) + ) + (((game-option-type aspect-ratio) (game-option-type video-mode)) + (set! (-> *progress-state* aspect-ratio-backup) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + ) + ) ) (sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) @@ -1843,8 +1833,8 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) (set! (-> obj selected-option) #t) - (when (= (-> s5-0 (-> obj option-index) option-type) 1) - (set! (-> obj language-selection) (the-as uint (-> *setting-control* current language))) + (when (= (-> s5-0 (-> obj option-index) option-type) (game-option-type language)) + (set! (-> obj language-selection) (-> *setting-control* current language)) (set! (-> obj language-direction) #t) (set! (-> obj language-transition) #f) (set! (-> obj language-x-offset) 0) @@ -1857,12 +1847,12 @@ (sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t) (set! (-> obj selected-option) #f) (case (-> s5-0 (-> obj option-index) option-type) - ((4) + (((game-option-type aspect-ratio)) (set! (-> *setting-control* default aspect-ratio) (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) ) ) - ((5) + (((game-option-type video-mode)) (case (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))) (('pal) (set! (-> *setting-control* default video-mode) @@ -1875,7 +1865,7 @@ ) ) ) - ((1) + (((game-option-type language)) (if (not (-> obj language-transition)) (load-level-text-files (-> obj display-level-index)) ) @@ -2238,8 +2228,8 @@ ) ) ) - (dummy-29 self) - (set! (-> self next-display-state) (dummy-53 self (-> self next-display-state))) + (respond-common self) + (set! (-> self next-display-state) (set-memcard-screen self (-> self next-display-state))) (let ((v1-74 (-> self display-state))) (cond ((or (= v1-74 (progress-screen fuel-cell)) @@ -2270,7 +2260,7 @@ (= v1-74 (progress-screen bad-disc)) (= v1-74 (progress-screen quit)) ) - (dummy-31 self) + (respond-memcard self) ) ) ) diff --git a/test/decompiler/reference/levels/beach/lurkercrab_REF.gc b/test/decompiler/reference/levels/beach/lurkercrab_REF.gc index 6c52171b24..23ad8d07ea 100644 --- a/test/decompiler/reference/levels/beach/lurkercrab_REF.gc +++ b/test/decompiler/reference/levels/beach/lurkercrab_REF.gc @@ -89,7 +89,7 @@ ;; definition for method 44 of type lurkercrab ;; INFO: Return type mismatch symbol vs object. (defmethod dummy-44 lurkercrab ((obj lurkercrab) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) 64) + (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) (-> obj collide-info) @@ -106,7 +106,7 @@ 6144.0 16384.0 ) - (the-as object (if (zero? (logand (-> obj nav-enemy-flags) 256)) + (the-as object (if (zero? (logand (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> obj collide-info)) ) ) @@ -125,7 +125,7 @@ ) ((= v1-1 'punch) (cond - ((logtest? (-> obj nav-enemy-flags) 32) + ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) (logclear! (-> obj mask) (process-mask actor-pause)) (go (method-of-object obj nav-enemy-die)) ) @@ -147,7 +147,7 @@ ) ) ) - ((logtest? (-> obj nav-enemy-flags) 32) + ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) (logclear! (-> obj mask) (process-mask actor-pause)) (go (method-of-object obj nav-enemy-die)) ) @@ -178,7 +178,7 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-37 lurkercrab ((obj lurkercrab)) (when (-> obj orient) - (if (logtest? (nav-control-flags bit19) (-> obj nav flags)) + (if (logtest? (nav-control-flags navcf19) (-> obj nav flags)) (seek-to-point-toward-point! (-> obj collide-info) (-> obj nav target-pos) @@ -293,7 +293,7 @@ nav-enemy-default-event-handler ;; definition for function lurkercrab-invulnerable (defbehavior lurkercrab-invulnerable lurkercrab () - (set! (-> self nav-enemy-flags) (logand -33 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (let ((v1-3 (find-prim-by-id (-> self collide-info) (the-as uint 2)))) (when v1-3 (let ((v0-1 4)) @@ -306,7 +306,7 @@ nav-enemy-default-event-handler ;; definition for function lurkercrab-vulnerable (defbehavior lurkercrab-vulnerable lurkercrab () - (logior! (-> self nav-enemy-flags) 32) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (let ((v1-3 (find-prim-by-id (-> self collide-info) (the-as uint 2)))) (when v1-3 (let ((v0-1 1)) @@ -328,8 +328,8 @@ nav-enemy-default-event-handler :exit (behavior () (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 8) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (none) ) :code @@ -384,7 +384,7 @@ nav-enemy-default-event-handler (joint-control-channel-group! a0-12 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 180) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-rnd-int-range 2 6) (until (not (nav-enemy-rnd-go-idle? 0.2)) (let ((gp-1 (-> self skel root-channel 0))) @@ -401,7 +401,7 @@ nav-enemy-default-event-handler ) ) ) - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((a0-19 (-> self skel root-channel 0))) (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) (set! (-> a0-19 param 0) @@ -436,7 +436,7 @@ nav-enemy-default-event-handler ) ) (lurkercrab-vulnerable) - (logior! (-> self nav-enemy-flags) 64) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (dotimes (gp-5 2) (let ((s5-0 (-> self skel root-channel 0))) (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) @@ -455,7 +455,7 @@ nav-enemy-default-event-handler ) ) (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (let ((gp-6 (-> self skel root-channel 0))) (set! (-> gp-6 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) (set! (-> gp-6 param 0) (ja-aframe 90.0 0)) @@ -502,7 +502,7 @@ nav-enemy-default-event-handler :exit (behavior () (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (none) ) :trans @@ -517,7 +517,7 @@ nav-enemy-default-event-handler ) :code (behavior () - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (ja-channel-push! 1 22) (while #t (let ((a0-1 (-> self skel root-channel 0))) @@ -538,7 +538,7 @@ nav-enemy-default-event-handler ) ) (lurkercrab-vulnerable) - (logior! (-> self nav-enemy-flags) 64) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) (set! (-> gp-0 param 0) (ja-aframe 30.0 0)) @@ -600,7 +600,7 @@ nav-enemy-default-event-handler ) ) (lurkercrab-invulnerable) - (set! (-> self nav-enemy-flags) (logand -65 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) (let ((gp-8 (-> self skel root-channel 0))) (set! (-> gp-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) (set! (-> gp-8 param 0) (ja-aframe 90.0 0)) @@ -819,7 +819,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -874,7 +874,7 @@ nav-enemy-default-event-handler (TODO-RENAME-45 obj *lurkercrab-nav-enemy-info*) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 159) obj)) (set! (-> obj orient) #t) - (set! (-> obj nav-enemy-flags) (logand -97 (-> obj nav-enemy-flags))) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5 navenmf6)) (set! (-> obj target-speed) 0.0) (set! (-> obj momentum-speed) 0.0) (set! (-> obj draw force-lod) 2) diff --git a/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc b/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc index 6057850018..3f191d6faf 100644 --- a/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc +++ b/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc @@ -123,7 +123,7 @@ nav-enemy-default-event-handler (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> self draw art-group data 7)) num-func-seek!) ) (until (ja-done? 0) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-attack) ) (suspend) @@ -151,10 +151,10 @@ nav-enemy-default-event-handler (behavior () (set! (-> self rotate-speed) 1456355.5) (set! (-> self turn-time) (seconds 0.1)) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) (while #t - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 30) (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) @@ -165,9 +165,9 @@ nav-enemy-default-event-handler ) (until (ja-done? 0) (let ((f0-3 (ja-aframe-num 0))) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (if (and (>= f0-3 2.5) (>= 7.5 f0-3)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) ) (suspend) @@ -177,7 +177,7 @@ nav-enemy-default-event-handler (joint-control-channel-group-eval! gp-1 (the-as art-joint-anim #f) num-func-seek!) ) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((a0-11 (-> self skel root-channel 0))) (set! (-> a0-11 param 0) 1.0) (joint-control-channel-group! a0-11 (the-as art-joint-anim #f) num-func-loop!) @@ -238,7 +238,7 @@ nav-enemy-default-event-handler (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-7 (-> self skel root-channel 0))) (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) @@ -294,12 +294,12 @@ nav-enemy-default-event-handler ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (none) ) :code (behavior () - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 22) (dotimes (gp-0 4) (let ((a0-2 (-> self skel root-channel 0))) @@ -313,9 +313,9 @@ nav-enemy-default-event-handler ) (until (ja-done? 0) (let ((f0-4 (ja-aframe-num 0))) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (if (and (>= f0-4 2.5) (>= 7.5 f0-4)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) ) (suspend) @@ -382,7 +382,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/citadel/citb-bunny_REF.gc b/test/decompiler/reference/levels/citadel/citb-bunny_REF.gc index 0a72302986..f117da816c 100644 --- a/test/decompiler/reference/levels/citadel/citb-bunny_REF.gc +++ b/test/decompiler/reference/levels/citadel/citb-bunny_REF.gc @@ -77,7 +77,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/common/babak_REF.gc b/test/decompiler/reference/levels/common/babak_REF.gc index c50a3e2f3b..36d566adeb 100644 --- a/test/decompiler/reference/levels/common/babak_REF.gc +++ b/test/decompiler/reference/levels/common/babak_REF.gc @@ -145,7 +145,7 @@ (behavior () (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) 256) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) ) (ja-channel-push! 1 30) @@ -167,7 +167,7 @@ ) (while #t (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((a0-9 (-> self skel root-channel 0))) (set! (-> a0-9 param 0) 1.0) (joint-control-channel-group! a0-9 (the-as art-joint-anim #f) num-func-loop!) @@ -188,7 +188,7 @@ (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-loop!) ) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) (if (not (= (if (> (-> self skel active-channels) 0) (-> self skel root-channel 0 frame-group) @@ -274,7 +274,7 @@ ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-12 (-> self skel root-channel 0))) (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) @@ -392,7 +392,7 @@ :use-proximity-notice #t :use-jump-blocked #t :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/common/battlecontroller_REF.gc b/test/decompiler/reference/levels/common/battlecontroller_REF.gc index 019ddbc45b..460842be66 100644 --- a/test/decompiler/reference/levels/common/battlecontroller_REF.gc +++ b/test/decompiler/reference/levels/common/battlecontroller_REF.gc @@ -208,7 +208,7 @@ battlecontroller-default-event-handler (let* ((s5-0 (-> self spawner-array gp-0)) (s4-0 (handle->process (-> s5-0 creature))) ) - (when (and s4-0 (logtest? (-> (the-as nav-enemy s4-0) nav-enemy-flags) 2048)) + (when (and s4-0 (logtest? (-> (the-as nav-enemy s4-0) nav-enemy-flags) (nav-enemy-flags navenmf11))) (cond ((< (-> s5-0 state) (-> s5-0 path curve num-cverts)) (when (or (-> self noticed-player) (= (-> s5-0 state) 1)) @@ -216,7 +216,7 @@ battlecontroller-default-event-handler (eval-path-curve-div! (-> s5-0 path) s3-0 (the float (-> s5-0 state)) 'interp) (send-event s4-0 'cue-jump-to-point s3-0) ) - (if (zero? (logand (-> (the-as nav-enemy s4-0) nav-enemy-flags) 2048)) + (if (zero? (logand (-> (the-as nav-enemy s4-0) nav-enemy-flags) (nav-enemy-flags navenmf11))) (+! (-> s5-0 state) 1) ) ) @@ -266,7 +266,7 @@ battlecontroller-default-event-handler (when (the-as (pointer nav-enemy) gp-0) (logclear! (-> (the-as (pointer nav-enemy) gp-0) 0 mask) (process-mask actor-pause)) (if (-> self misty-ambush-collision-hack) - (logior! (-> (the-as (pointer nav-enemy) gp-0) 0 nav-enemy-flags) #x8000) + (logior! (-> (the-as (pointer nav-enemy) gp-0) 0 nav-enemy-flags) (nav-enemy-flags navenmf15)) ) (+! (-> self spawn-count) 1) (-> self fact pickup-type) diff --git a/test/decompiler/reference/levels/common/joint-exploder_REF.gc b/test/decompiler/reference/levels/common/joint-exploder_REF.gc index 5280ae892c..a07684e18d 100644 --- a/test/decompiler/reference/levels/common/joint-exploder_REF.gc +++ b/test/decompiler/reference/levels/common/joint-exploder_REF.gc @@ -505,7 +505,7 @@ (-> arg0 bbox) (collide-kind background) obj - (new 'static 'pat-surface :skip #x1 :noentity #x1) + (new 'static 'pat-surface :noentity #x1) ) (let ((gp-1 (-> obj joints)) (v1-2 (-> arg0 head)) diff --git a/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc b/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc index a86789d0b5..40dc649660 100644 --- a/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc +++ b/test/decompiler/reference/levels/common/nav-enemy-h_REF.gc @@ -3,57 +3,57 @@ ;; definition of type nav-enemy-info (deftype nav-enemy-info (basic) - ((idle-anim int32 :offset-assert 4) - (walk-anim int32 :offset-assert 8) - (turn-anim int32 :offset-assert 12) - (notice-anim int32 :offset-assert 16) - (run-anim int32 :offset-assert 20) - (jump-anim int32 :offset-assert 24) - (jump-land-anim int32 :offset-assert 28) - (victory-anim int32 :offset-assert 32) - (taunt-anim int32 :offset-assert 36) - (die-anim int32 :offset-assert 40) - (neck-joint int32 :offset-assert 44) - (player-look-at-joint int32 :offset-assert 48) - (run-travel-speed meters :offset-assert 52) - (run-rotate-speed degrees :offset-assert 56) - (run-acceleration meters :offset-assert 60) - (run-turn-time seconds :offset-assert 64) - (walk-travel-speed meters :offset-assert 72) - (walk-rotate-speed degrees :offset-assert 76) - (walk-acceleration meters :offset-assert 80) - (walk-turn-time seconds :offset-assert 88) - (attack-shove-back meters :offset-assert 96) - (attack-shove-up meters :offset-assert 100) - (shadow-size meters :offset-assert 104) - (notice-nav-radius meters :offset-assert 108) - (nav-nearest-y-threshold meters :offset-assert 112) - (notice-distance meters :offset-assert 116) - (proximity-notice-distance meters :offset-assert 120) - (stop-chase-distance meters :offset-assert 124) - (frustration-distance meters :offset-assert 128) - (frustration-time time-frame :offset-assert 136) - (die-anim-hold-frame float :offset-assert 144) - (jump-anim-start-frame float :offset-assert 148) - (jump-land-anim-end-frame float :offset-assert 152) - (jump-height-min meters :offset-assert 156) - (jump-height-factor float :offset-assert 160) - (jump-start-anim-speed float :offset-assert 164) - (shadow-max-y meters :offset-assert 168) - (shadow-min-y meters :offset-assert 172) - (shadow-locus-dist meters :offset-assert 176) - (use-align symbol :offset-assert 180) - (draw-shadow symbol :offset-assert 184) - (move-to-ground symbol :offset-assert 188) - (hover-if-no-ground symbol :offset-assert 192) - (use-momentum symbol :offset-assert 196) - (use-flee symbol :offset-assert 200) - (use-proximity-notice symbol :offset-assert 204) - (use-jump-blocked symbol :offset-assert 208) - (use-jump-patrol symbol :offset-assert 212) - (gnd-collide-with uint64 :offset-assert 216) - (debug-draw-neck symbol :offset-assert 224) - (debug-draw-jump symbol :offset-assert 228) + ((idle-anim int32 :offset-assert 4) + (walk-anim int32 :offset-assert 8) + (turn-anim int32 :offset-assert 12) + (notice-anim int32 :offset-assert 16) + (run-anim int32 :offset-assert 20) + (jump-anim int32 :offset-assert 24) + (jump-land-anim int32 :offset-assert 28) + (victory-anim int32 :offset-assert 32) + (taunt-anim int32 :offset-assert 36) + (die-anim int32 :offset-assert 40) + (neck-joint int32 :offset-assert 44) + (player-look-at-joint int32 :offset-assert 48) + (run-travel-speed meters :offset-assert 52) + (run-rotate-speed degrees :offset-assert 56) + (run-acceleration meters :offset-assert 60) + (run-turn-time seconds :offset-assert 64) + (walk-travel-speed meters :offset-assert 72) + (walk-rotate-speed degrees :offset-assert 76) + (walk-acceleration meters :offset-assert 80) + (walk-turn-time seconds :offset-assert 88) + (attack-shove-back meters :offset-assert 96) + (attack-shove-up meters :offset-assert 100) + (shadow-size meters :offset-assert 104) + (notice-nav-radius meters :offset-assert 108) + (nav-nearest-y-threshold meters :offset-assert 112) + (notice-distance meters :offset-assert 116) + (proximity-notice-distance meters :offset-assert 120) + (stop-chase-distance meters :offset-assert 124) + (frustration-distance meters :offset-assert 128) + (frustration-time time-frame :offset-assert 136) + (die-anim-hold-frame float :offset-assert 144) + (jump-anim-start-frame float :offset-assert 148) + (jump-land-anim-end-frame float :offset-assert 152) + (jump-height-min meters :offset-assert 156) + (jump-height-factor float :offset-assert 160) + (jump-start-anim-speed float :offset-assert 164) + (shadow-max-y meters :offset-assert 168) + (shadow-min-y meters :offset-assert 172) + (shadow-locus-dist meters :offset-assert 176) + (use-align symbol :offset-assert 180) + (draw-shadow symbol :offset-assert 184) + (move-to-ground symbol :offset-assert 188) + (hover-if-no-ground symbol :offset-assert 192) + (use-momentum symbol :offset-assert 196) + (use-flee symbol :offset-assert 200) + (use-proximity-notice symbol :offset-assert 204) + (use-jump-blocked symbol :offset-assert 208) + (use-jump-patrol symbol :offset-assert 212) + (gnd-collide-with collide-kind :offset-assert 216) + (debug-draw-neck symbol :offset-assert 224) + (debug-draw-jump symbol :offset-assert 228) ) :method-count-assert 9 :size-assert #xe8 @@ -141,7 +141,7 @@ (state-timeout time-frame :offset-assert 352) (free-time time-frame :offset-assert 360) (touch-time time-frame :offset-assert 368) - (nav-enemy-flags uint32 :offset-assert 376) + (nav-enemy-flags nav-enemy-flags :offset-assert 376) (incomming-attack-id handle :offset-assert 384) (jump-return-state (state process) :offset-assert 392) (rand-gen random-generator :offset-assert 396) diff --git a/test/decompiler/reference/levels/common/nav-enemy_REF.gc b/test/decompiler/reference/levels/common/nav-enemy_REF.gc index 103119cac7..5cbc13f78a 100644 --- a/test/decompiler/reference/levels/common/nav-enemy_REF.gc +++ b/test/decompiler/reference/levels/common/nav-enemy_REF.gc @@ -79,14 +79,14 @@ ;; definition for method 39 of type nav-enemy ;; INFO: Return type mismatch int vs none. (defmethod common-post nav-enemy ((obj nav-enemy)) - (when (and (logtest? (-> obj nav-enemy-flags) 256) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) (>= (- (-> *display* base-frame-counter) (-> obj touch-time)) (seconds 0.05)) ) ) ) (set-collide-offense (-> obj collide-info) 2 (collide-offense touch)) - (set! (-> obj nav-enemy-flags) (logand -257 (-> obj nav-enemy-flags))) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) ) (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) (when *target* @@ -94,13 +94,13 @@ (look-at-enemy! (-> *target* neck) (the-as vector (-> obj collide-info root-prim prim-core)) - (if (logtest? (-> obj nav-enemy-flags) 4) + (if (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf2)) 'attacking ) obj ) ) - (if (and (nonzero? (-> obj neck)) (logtest? (-> obj nav-enemy-flags) #x4000)) + (if (and (nonzero? (-> obj neck)) (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf14))) (set-target! (-> obj neck) (target-pos (-> obj nav-info player-look-at-joint))) ) ) @@ -116,11 +116,12 @@ ;; definition for method 44 of type nav-enemy (defmethod dummy-44 nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) @@ -128,11 +129,12 @@ ;; definition for method 72 of type nav-enemy (defmethod nav-enemy-touch-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) @@ -150,7 +152,7 @@ ;; definition for method 43 of type nav-enemy (defmethod dummy-43 nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) (cond - ((logtest? (-> obj nav-enemy-flags) 32) + ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) (send-event arg0 'get-attack-count 1) (logclear! (-> obj mask) (process-mask actor-pause attackable)) (go (method-of-object obj nav-enemy-die)) @@ -177,7 +179,7 @@ ) (the-as object (when (send-event-function arg0 v1-0) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) 256) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) #t ) ) @@ -215,9 +217,9 @@ ) ) (('cue-jump-to-point) - (when (logtest? (-> self nav-enemy-flags) 2048) + (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (set! (-> self event-param-point quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> self nav-enemy-flags) (logand -2049 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) ) ) (('cue-chase) @@ -344,8 +346,10 @@ nav-enemy-default-event-handler ;; definition for method 37 of type nav-enemy ;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-37 nav-enemy ((obj nav-enemy)) - (when (logtest? (-> obj nav-enemy-flags) 16) - (if (or (logtest? (-> obj nav-enemy-flags) 128) (logtest? (nav-control-flags bit19) (-> obj nav flags))) + (when (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags enable-travel)) + (if (or (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf7)) + (logtest? (nav-control-flags navcf19) (-> obj nav flags)) + ) (seek-to-point-toward-point! (-> obj collide-info) (-> obj nav target-pos) @@ -366,11 +370,11 @@ nav-enemy-default-event-handler (integrate-for-enemy-with-move-to-ground! (-> obj collide-info) (-> obj collide-info transv) - (the-as collide-kind (-> obj nav-info gnd-collide-with)) + (-> obj nav-info gnd-collide-with) 8192.0 #f (-> obj nav-info hover-if-no-ground) - (logtest? (-> obj nav-enemy-flags) #x8000) + (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf15)) ) (dummy-58 (-> obj collide-info) (-> obj collide-info transv)) ) @@ -382,7 +386,7 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-travel-post nav-enemy () (cond - ((logtest? (-> self nav-enemy-flags) 8) + ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (TODO-RENAME-9 (-> self align)) (dummy-40 self) (dummy-41 self) @@ -415,9 +419,9 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-patrol-post ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-patrol-post nav-enemy () - (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) + (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) (set! (-> self nav block-count) 2.0) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (nav-enemy-get-new-patrol-point) ) (dummy-19 @@ -427,8 +431,8 @@ nav-enemy-default-event-handler (-> self nav destination-pos) (-> self rotate-speed) ) - (if (logtest? (nav-control-flags bit21) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit10)) + (if (logtest? (nav-control-flags navcf21) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (nav-enemy-travel-post) 0 @@ -467,7 +471,7 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-face-player-post ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-face-player-post nav-enemy () - (if (and *target* (logtest? (-> self nav-enemy-flags) 16)) + (if (and *target* (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))) (seek-to-point-toward-point! (-> self collide-info) (target-pos 0) (-> self rotate-speed) (-> self turn-time)) ) (nav-enemy-simple-post) @@ -510,7 +514,7 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-neck-control-look-at ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-neck-control-look-at nav-enemy () - (logior! (-> self nav-enemy-flags) #x4000) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf14)) (if (nonzero? (-> self neck)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) ) @@ -521,8 +525,8 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-neck-control-inactive ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-neck-control-inactive nav-enemy () - (when (and (nonzero? (-> self neck)) (logtest? (-> self nav-enemy-flags) #x4000)) - (set! (-> self nav-enemy-flags) (logand -16385 (-> self nav-enemy-flags))) + (when (and (nonzero? (-> self neck)) (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf14))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf14)) (shut-down! (-> self neck)) ) 0 @@ -539,7 +543,7 @@ nav-enemy-default-event-handler (defmethod TODO-RENAME-46 nav-enemy ((obj nav-enemy) (arg0 float)) (and *target* (zero? (logand (-> *target* state-flags) #x80f8)) - (and (or (zero? (logand (-> obj nav-enemy-flags) 4096)) + (and (or (zero? (logand (-> obj nav-enemy-flags) (nav-enemy-flags navenmf12))) (< (vector-vector-distance (target-pos 0) (-> obj collide-info trans)) arg0) ) (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) @@ -551,10 +555,10 @@ nav-enemy-default-event-handler (defbehavior nav-enemy-notice-player? nav-enemy () (let ((gp-0 #f)) (cond - ((logtest? (-> self nav-enemy-flags) 1) + ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (when (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) (set! gp-0 #t) - (set! (-> self nav-enemy-flags) (logand -2 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) ) (else @@ -566,7 +570,7 @@ nav-enemy-default-event-handler ) ) ) - (logior! (-> self nav-enemy-flags) 1) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (set! (-> self notice-time) (-> *display* base-frame-counter)) ) ) @@ -830,15 +834,9 @@ nav-enemy-default-event-handler (nav-enemy-neck-control-inactive) (set! (-> self state-time) (-> *display* base-frame-counter)) (if (-> self nav-info move-to-ground) - (move-to-ground - (-> self collide-info) - 40960.0 - 40960.0 - #t - (the-as collide-kind (-> self nav-info gnd-collide-with)) - ) + (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (-> self nav-info gnd-collide-with)) ) - (set! (-> self nav-enemy-flags) (logand -7 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1 navenmf2)) (set! (-> self state-timeout) (seconds 1)) (none) ) @@ -895,10 +893,10 @@ nav-enemy-default-event-handler (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self nav flags) - (the-as nav-control-flags (the-as int (logior (nav-control-flags bit19) (-> self nav flags)))) + (the-as nav-control-flags (the-as int (logior (nav-control-flags navcf19) (-> self nav flags)))) ) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 8) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (set! (-> self state-timeout) (seconds 1)) (set! (-> self target-speed) (-> self nav-info walk-travel-speed)) (set! (-> self acceleration) (-> self nav-info walk-acceleration)) @@ -908,7 +906,7 @@ nav-enemy-default-event-handler ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (none) ) :trans @@ -986,7 +984,7 @@ nav-enemy-default-event-handler (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 180) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((a0-8 (-> self skel root-channel 0))) (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> self draw art-group data (-> self nav-info idle-anim))) @@ -1040,7 +1038,7 @@ nav-enemy-default-event-handler ) ) ) - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((a0-15 (-> self skel root-channel 0))) (set! (-> a0-15 param 0) 1.0) (joint-control-channel-group! a0-15 (the-as art-joint-anim #f) num-func-loop!) @@ -1091,12 +1089,12 @@ nav-enemy-default-event-handler ) :enter (behavior () - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-look-at) - (if (logtest? (-> self nav-enemy-flags) 2) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (let ((gp-0 (-> self nav)) (v1-10 (target-pos 0)) ) @@ -1262,7 +1260,7 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defbehavior nav-enemy-reset-frustration nav-enemy () - (set! (-> self nav-enemy-flags) (logand -8193 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) (if *target* (set! (-> self frustration-point quad) (-> *target* control shadow-pos quad)) ) @@ -1280,7 +1278,9 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-frustrated? (defbehavior nav-enemy-frustrated? nav-enemy () - (and (logtest? (-> self nav-enemy-flags) 8192) (nav-enemy-player-at-frustration-point?)) + (and (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) + (nav-enemy-player-at-frustration-point?) + ) ) ;; failed to figure out what this is: @@ -1296,7 +1296,7 @@ nav-enemy-default-event-handler (nav-enemy-neck-control-look-at) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self free-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (set! (-> self target-speed) (-> self nav-info run-travel-speed)) (set! (-> self acceleration) (-> self nav-info run-acceleration)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) @@ -1309,7 +1309,7 @@ nav-enemy-default-event-handler (if (logtest? (-> *target* state-flags) 128) (go-virtual nav-enemy-patrol) ) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory) ) (if (or (not (nav-enemy-player-at-frustration-point?)) @@ -1323,15 +1323,15 @@ nav-enemy-default-event-handler (if (>= (- (-> *display* base-frame-counter) (-> self frustration-time)) (+ (-> self reaction-time) (-> self nav-info frustration-time)) ) - (logior! (-> self nav-enemy-flags) 8192) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) ) (if (or (not (TODO-RENAME-46 self (-> self nav-info stop-chase-distance))) - (logtest? (-> self nav-enemy-flags) 8192) + (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) ) (go-virtual nav-enemy-stop-chase) ) (cond - ((logtest? (nav-control-flags bit17) (-> self nav flags)) + ((logtest? (nav-control-flags navcf17) (-> self nav flags)) (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1)) (go-virtual nav-enemy-patrol) ) @@ -1406,7 +1406,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (logtest? (nav-control-flags bit17) (-> self nav flags)) + (logtest? (nav-control-flags navcf17) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) ) (go-virtual nav-enemy-stare) @@ -1452,7 +1452,7 @@ nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((f0-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0)))) (set! (-> self state-timeout) (the-as @@ -1468,7 +1468,7 @@ nav-enemy-default-event-handler ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (none) ) :trans @@ -1499,7 +1499,7 @@ nav-enemy-default-event-handler ) ) ) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) (go-virtual nav-enemy-give-up) ) @@ -1508,7 +1508,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (logtest? (nav-control-flags bit17) (-> self nav flags)) + (logtest? (nav-control-flags navcf17) (-> self nav flags)) ) (go-virtual nav-enemy-give-up) ) @@ -1536,7 +1536,7 @@ nav-enemy-default-event-handler (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-neck-control-inactive) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) :trans @@ -1705,7 +1705,7 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defbehavior nav-enemy-jump-post nav-enemy () - (if (logtest? (-> self nav-enemy-flags) 16) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (seek-to-point-toward-point! (-> self collide-info) (-> self jump-dest) @@ -1713,7 +1713,7 @@ nav-enemy-default-event-handler (-> self turn-time) ) ) - (when (logtest? (-> self nav-enemy-flags) 8) + (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((f30-0 (the float (- (-> *display* base-frame-counter) (-> self jump-time))))) (let ((v1-12 (eval-position! (-> self jump-trajectory) f30-0 (new 'stack-no-clear 'vector)))) (set! (-> self collide-info trans quad) (-> v1-12 quad)) @@ -1744,24 +1744,24 @@ nav-enemy-default-event-handler (set! (-> s2-2 y) 0.0) (vector-xz-normalize! s1-1 1.0) (vector-xz-normalize! s2-2 1.0) - (set! (-> self nav-enemy-flags) (logand -1537 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump drop-jump)) (if (or (>= (* 0.5 (-> self nav-info run-travel-speed)) f24-0) (>= (cos 3640.889) (vector-dot s1-1 s2-2))) - (logior! (-> self nav-enemy-flags) 512) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) ) ) (if (or (and (< f26-0 0.0) (< f28-0 (fabs f26-0))) (and (< (fabs f26-0) 12288.0) (< f28-0 20480.0))) - (logior! (-> self nav-enemy-flags) 1024) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) ) ) - (when (and arg1 (logtest? (-> self nav-enemy-flags) 1024)) - (set! (-> self nav-enemy-flags) (logand -513 (-> self nav-enemy-flags))) + (when (and arg1 (logtest? (-> self nav-enemy-flags) (nav-enemy-flags drop-jump))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) (set! f30-0 2048.0) ) (setup-from-to-height! (-> self jump-trajectory) s4-0 arg0 f30-0 (* 0.000011111111 arg4)) ) (set! (-> self nav extra-nav-sphere quad) (-> arg0 quad)) (set! (-> self nav extra-nav-sphere w) (-> self collide-info nav-radius)) - (logior! (-> self collide-info nav-flags) 2) + (logior! (-> self collide-info nav-flags) (nav-flags navf1)) 0 (none) ) @@ -1784,13 +1784,13 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defbehavior nav-enemy-execute-custom-jump nav-enemy ((arg0 int) (arg1 float) (arg2 float)) - (when (logtest? (-> self nav-enemy-flags) 512) + (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) (let ((a0-1 (-> self skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 30) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((s3-0 (-> self skel root-channel 0))) (set! (-> s3-0 frame-group) (the-as art-joint-anim (-> self draw art-group data arg0))) (set! (-> s3-0 param 0) (ja-aframe arg1 0)) @@ -1810,9 +1810,9 @@ nav-enemy-default-event-handler ) (set! (-> self collide-info status) (logand -8 (-> self collide-info status))) (set! (-> self jump-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (cond - ((logtest? (-> self nav-enemy-flags) 1024) + ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) (cond ((= (if (> (-> self skel active-channels) 0) (-> self skel root-channel 0 frame-group) @@ -1864,7 +1864,7 @@ nav-enemy-default-event-handler ) (set! (-> self collide-info trans quad) (-> self jump-dest quad)) (set! (-> self collide-info transv y) 0.0) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) 0 (none) ) @@ -1938,7 +1938,7 @@ nav-enemy-default-event-handler ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) :code @@ -1977,7 +1977,9 @@ nav-enemy-default-event-handler (set! (-> self collide-info transv x) (-> v1-9 x)) (set! (-> self collide-info transv z) (-> v1-9 z)) ) - (if (or (logtest? (-> self nav-enemy-flags) 128) (logtest? (nav-control-flags bit19) (-> self nav flags))) + (if (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf7)) + (logtest? (nav-control-flags navcf19) (-> self nav flags)) + ) (seek-to-point-toward-point! (-> self collide-info) (-> self nav target-pos) @@ -1998,7 +2000,7 @@ nav-enemy-default-event-handler (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) - (the-as collide-kind (-> self nav-info gnd-collide-with)) + (-> self nav-info gnd-collide-with) 8192.0 #f (-> self nav-info hover-if-no-ground) @@ -2019,7 +2021,7 @@ nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self collide-info transv quad)) (set! (-> gp-0 y) 0.0) @@ -2033,7 +2035,7 @@ nav-enemy-default-event-handler :trans (behavior () (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (logtest? (nav-control-flags bit19) (-> self nav flags)) + (logtest? (nav-control-flags navcf19) (-> self nav flags)) ) (go-virtual nav-enemy-chase) ) @@ -2125,7 +2127,7 @@ nav-enemy-default-event-handler :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 2048) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (ja-channel-push! 1 30) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) (let ((v1-6 (-> self skel root-channel 0))) @@ -2137,7 +2139,7 @@ nav-enemy-default-event-handler (set! (-> v1-9 num-func) num-func-identity) (set! (-> v1-9 frame-num) 0.0) ) - (while (logtest? (-> self nav-enemy-flags) 2048) + (while (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (suspend) (let ((a0-8 (-> self skel root-channel 0))) (set! (-> a0-8 param 0) f30-0) @@ -2172,7 +2174,7 @@ nav-enemy-default-event-handler nav-enemy-jump-event-handler :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) :trans @@ -2185,15 +2187,15 @@ nav-enemy-default-event-handler (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-initialize-jump (-> self event-param-point)) (nav-enemy-neck-control-look-at) - (logior! (-> self nav-enemy-flags) 16) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335)) (ja-channel-push! 1 60) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-jump-land-anim) (go-virtual nav-enemy-wait-for-cue) (none) @@ -2239,7 +2241,7 @@ nav-enemy-default-event-handler ) (set! (-> obj align) (new 'process 'align-control obj)) (set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 16 (-> arg0 nav-nearest-y-threshold))) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav gap-event) 'jump) (TODO-RENAME-26 (-> obj nav)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) @@ -2249,7 +2251,7 @@ nav-enemy-default-event-handler ) (set! (-> obj reaction-time) (nav-enemy-rnd-int-range (seconds 0.1) (seconds 0.8))) (set! (-> obj speed-scale) 1.0) - (logior! (-> obj nav-enemy-flags) 4216) + (logior! (-> obj nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel navenmf5 navenmf6 navenmf12)) 0 (none) ) @@ -2291,8 +2293,8 @@ nav-enemy-default-event-handler (vector-identity! (-> self collide-info scale)) (set! (-> self entity) (-> arg0 entity)) (TODO-RENAME-48 self) - (set! (-> self nav-enemy-flags) (logand -4097 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 2) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf12)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-wait-for-cue) (none) ) diff --git a/test/decompiler/reference/levels/common/sharkey_REF.gc b/test/decompiler/reference/levels/common/sharkey_REF.gc index 58ac7002e9..5c0560002a 100644 --- a/test/decompiler/reference/levels/common/sharkey_REF.gc +++ b/test/decompiler/reference/levels/common/sharkey_REF.gc @@ -273,7 +273,7 @@ nav-enemy-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self nav-enemy-flags) (logand -2 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (none) ) :exit @@ -295,8 +295,8 @@ nav-enemy-default-event-handler ) ) ((sharkey-notice-player?) - (when (zero? (logand (-> self nav-enemy-flags) 1)) - (logior! (-> self nav-enemy-flags) 1) + (when (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf0))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (set! (-> self notice-time) (-> *display* base-frame-counter)) ) (let ((a0-4 (dummy-16 (-> self nav) (-> *target* control trans)))) @@ -313,7 +313,7 @@ nav-enemy-default-event-handler ) (else (if (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (seconds 10)) - (set! (-> self nav-enemy-flags) (logand -2 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) ) ) @@ -863,7 +863,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc b/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc index 76c068bd70..1ee6719af5 100644 --- a/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc +++ b/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc @@ -120,7 +120,8 @@ :use-proximity-notice #f :use-jump-blocked #t :use-jump-patrol #f - :gnd-collide-with #x805 + :gnd-collide-with + (collide-kind background cak-2 ground-object) :debug-draw-neck #f :debug-draw-jump #f ) @@ -367,11 +368,12 @@ ;; definition for method 44 of type green-eco-lurker (defmethod dummy-44 green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) @@ -381,11 +383,12 @@ ;; definition for method 72 of type green-eco-lurker (defmethod nav-enemy-touch-handler green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) + (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) @@ -521,7 +524,7 @@ (+ (-> (the-as green-eco-lurker-gen (-> self parent 0)) root trans x) (fmax -32768.0 (fmin 32768.0 f0-1))) ) ) - (logior! (-> self collide-info nav-flags) 2) + (logior! (-> self collide-info nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self appear-dest quad)) (set! (-> self nav extra-nav-sphere w) 8192.0) (setup-from-to-duration! (-> self traj) (-> self collide-info trans) (-> self appear-dest) 225.0 -9.102222) @@ -551,8 +554,8 @@ (let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self state-time))) (-> self traj time)))) (eval-position! (-> self traj) f30-0 (-> self collide-info trans)) (when (= f30-0 (-> self traj time)) - (logior! (-> self collide-info nav-flags) 1) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self collide-info nav-flags) (nav-flags navf0)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (go green-eco-lurker-appear-land) ) ) @@ -687,7 +690,7 @@ (joint-control-channel-group-eval! a0-16 (the-as art-joint-anim #f) num-func-seek!) ) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) (none) ) @@ -942,7 +945,7 @@ (defmethod TODO-RENAME-48 green-eco-lurker ((obj green-eco-lurker)) (initialize-skeleton obj *green-eco-lurker-sg* '()) (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj collide-info nav-flags) (logand -2 (-> obj collide-info nav-flags))) + (logclear! (-> obj collide-info nav-flags) (nav-flags navf0)) (TODO-RENAME-45 obj *green-eco-lurker-nav-enemy-info*) (logior! (-> obj draw shadow-ctrl settings flags) 4) (set! (-> obj neck up) (the-as uint 0)) diff --git a/test/decompiler/reference/levels/finalboss/robotboss_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss_REF.gc index a793375441..9da1985ff0 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss_REF.gc @@ -4574,8 +4574,8 @@ (initialize-skeleton obj *robotboss-sg* '()) (aybabtu 2) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 (the-as float 40960.0))) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) - (set! (-> obj root-override nav-flags) (logand -2 (-> obj root-override nav-flags))) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) (set! (-> obj path) (new 'process 'path-control obj 'path (the-as float 0.0))) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (logclear! (-> obj mask) (process-mask actor-pause)) diff --git a/test/decompiler/reference/levels/jungle/hopper_REF.gc b/test/decompiler/reference/levels/jungle/hopper_REF.gc index c9a34325aa..573f782373 100644 --- a/test/decompiler/reference/levels/jungle/hopper_REF.gc +++ b/test/decompiler/reference/levels/jungle/hopper_REF.gc @@ -57,9 +57,16 @@ nav-enemy-default-event-handler ) (set! (-> s5-0 quad) (-> arg0 quad)) (set! (-> s5-0 y) (+ 20480.0 (-> s5-0 y))) - (let ((f0-2 - (fill-and-probe-using-y-probe *collide-cache* s5-0 f30-0 (collide-kind background) self t1-0 (the-as uint 1)) - ) + (let ((f0-2 (fill-and-probe-using-y-probe + *collide-cache* + s5-0 + f30-0 + (collide-kind background) + self + t1-0 + (new 'static 'pat-surface :noentity #x1) + ) + ) ) (if (< f0-2 0.0) (return (the-as object #f)) @@ -88,18 +95,18 @@ nav-enemy-default-event-handler (-> self nav-info jump-height-factor) -409600.0 ) - (set! (-> self nav-enemy-flags) (logand -513 (-> self nav-enemy-flags))) - (set! (-> self nav-enemy-flags) (logand -1025 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 16) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (when (not (nav-enemy-facing-point? (-> self jump-dest) 5461.3335)) (ja-channel-push! 1 60) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) (set! (-> self shadow-min-y) (+ (-> self collide-info trans y) (-> self nav-info shadow-min-y))) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (nav-enemy-jump-land-anim) 0 (none) @@ -181,7 +188,7 @@ nav-enemy-default-event-handler ) :trans (behavior () - (if (zero? (logand (-> self nav-enemy-flags) 8)) + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) ) (none) @@ -190,7 +197,7 @@ nav-enemy-default-event-handler (behavior () (vector-reset! (-> self collide-info transv)) (set! (-> self jump-length) 16384.0) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (while #t (cond ((= (if (> (-> self skel active-channels) 0) @@ -263,9 +270,9 @@ nav-enemy-default-event-handler (joint-control-channel-group-eval! a0-21 (the-as art-joint-anim #f) num-func-loop!) ) ) - (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) + (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< 2.0 (-> self nav block-count))) (set! (-> self nav block-count) 0.0) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (nav-enemy-get-new-patrol-point) (set! (-> self nav target-pos quad) (-> self nav destination-pos quad)) ) @@ -302,7 +309,7 @@ nav-enemy-default-event-handler ) :trans (behavior () - (if (zero? (logand (-> self nav-enemy-flags) 8)) + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) ) (none) @@ -311,7 +318,7 @@ nav-enemy-default-event-handler (behavior () (vector-reset! (-> self collide-info transv)) (set! (-> self jump-length) 32768.0) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (while #t (cond ((= (if (> (-> self skel active-channels) 0) @@ -457,7 +464,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #t ) diff --git a/test/decompiler/reference/levels/jungle/junglefish_REF.gc b/test/decompiler/reference/levels/jungle/junglefish_REF.gc index db0883cbf0..6275cad9ed 100644 --- a/test/decompiler/reference/levels/jungle/junglefish_REF.gc +++ b/test/decompiler/reference/levels/jungle/junglefish_REF.gc @@ -392,7 +392,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/jungleb/aphid_REF.gc b/test/decompiler/reference/levels/jungleb/aphid_REF.gc index 4fbaa44517..02e935535a 100644 --- a/test/decompiler/reference/levels/jungleb/aphid_REF.gc +++ b/test/decompiler/reference/levels/jungleb/aphid_REF.gc @@ -32,14 +32,14 @@ ;; definition for function aphid-invulnerable (defbehavior aphid-invulnerable aphid () - (set! (-> self nav-enemy-flags) (logand -33 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (set-collide-offense (-> self collide-info) 2 (collide-offense indestructible)) (none) ) ;; definition for function aphid-vulnerable (defbehavior aphid-vulnerable aphid () - (logior! (-> self nav-enemy-flags) 32) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf5)) (set-collide-offense (-> self collide-info) 2 (collide-offense touch)) (none) ) @@ -47,7 +47,9 @@ ;; definition for method 43 of type aphid (defmethod dummy-43 aphid ((obj aphid) (arg0 process) (arg1 event-message-block)) (cond - ((or (logtest? (-> obj nav-enemy-flags) 32) (= arg0 (ppointer->process (-> obj parent)))) + ((or (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) + (= arg0 (ppointer->process (-> obj parent))) + ) (send-event arg0 'get-attack-count 1) (logclear! (-> obj mask) (process-mask actor-pause attackable)) (go (method-of-object obj nav-enemy-die)) @@ -177,7 +179,7 @@ (behavior () (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) 256) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) ) (ja-channel-push! 1 30) @@ -201,7 +203,7 @@ ) (while #t (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((a0-7 (-> self skel root-channel 0))) (set! (-> a0-7 param 0) 1.0) (joint-control-channel-group! a0-7 (the-as art-joint-anim #f) num-func-loop!) @@ -222,7 +224,7 @@ (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-loop!) ) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) (when (nav-enemy-rnd-percent? 0.3) (if (not (= (if (> (-> self skel active-channels) 0) @@ -292,7 +294,7 @@ ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-12 (-> self skel root-channel 0))) (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) @@ -371,7 +373,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -431,7 +433,7 @@ (vector-identity! (-> self collide-info scale)) (set! (-> self entity) (-> arg0 entity)) (TODO-RENAME-48 self) - (set! (-> self nav-enemy-flags) (logand -4097 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf12)) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) self) (set! (-> a1-3 num-params) 0) diff --git a/test/decompiler/reference/levels/maincave/baby-spider_REF.gc b/test/decompiler/reference/levels/maincave/baby-spider_REF.gc index c4a5d034a1..d5e66580f7 100644 --- a/test/decompiler/reference/levels/maincave/baby-spider_REF.gc +++ b/test/decompiler/reference/levels/maincave/baby-spider_REF.gc @@ -146,7 +146,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -200,7 +200,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -656,7 +656,7 @@ baby-spider-default-event-handler (set! (-> self turn-time) (seconds 0.07333333)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) (while #t - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 30) (let ((a0-2 (-> self skel root-channel 0))) (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) @@ -679,7 +679,7 @@ baby-spider-default-event-handler (set! (-> a0-5 param 0) 1.0) (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600)) (s5-0 (-> *display* base-frame-counter)) ) @@ -736,7 +736,7 @@ baby-spider-default-event-handler (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-7 (-> self skel root-channel 0))) (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 6))) @@ -976,7 +976,7 @@ baby-spider-default-event-handler (set! (-> obj mask) (logior (process-mask enemy) (-> obj mask))) (logior! (-> obj mask) (process-mask actor-pause)) (set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 24 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (create-connection! diff --git a/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc index 3ed33f301f..169293aca9 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc @@ -605,8 +605,8 @@ (logior! (-> v1-8 settings flags) 32) ) 0 - (set! (-> self root-override nav-flags) (logand -2 (-> self root-override nav-flags))) - (set! (-> self root-override nav-flags) (logand -3 (-> self root-override nav-flags))) + (logclear! (-> self root-override nav-flags) (nav-flags navf0)) + (logclear! (-> self root-override nav-flags) (nav-flags navf1)) (clear-collide-with-as (-> self root-override)) (until (not (-> self child)) (suspend) @@ -652,9 +652,9 @@ (setup-lods! (-> self broken-look) *mother-spider-egg-broken-sg* (-> self draw art-group) (-> self entity)) (set! (-> self draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) (set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0)) - (logior! (-> self nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) - (set! (-> self root-override nav-flags) (logand -2 (-> self root-override nav-flags))) - (logior! (-> self root-override nav-flags) 2) + (logior! (-> self nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (logclear! (-> self root-override nav-flags) (nav-flags navf0)) + (logior! (-> self root-override nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self fall-dest quad)) (set! (-> self nav extra-nav-sphere w) 4096.0) (setup-from-to-height! (-> self traj) (-> self root-override trans) arg2 4096.0 -4.551111) diff --git a/test/decompiler/reference/levels/maincave/mother-spider-proj_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider-proj_REF.gc index 01dd1b9570..1dc1654e70 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider-proj_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider-proj_REF.gc @@ -275,7 +275,7 @@ (the-as vector #f) f0-5 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) diff --git a/test/decompiler/reference/levels/maincave/mother-spider_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider_REF.gc index 48075121c7..b03c6e6835 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider_REF.gc @@ -2150,10 +2150,10 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *mother-spider-sg* '()) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav nearest-y-threshold) 409600.0) - (set! (-> obj root-override nav-flags) (logand -2 (-> obj root-override nav-flags))) - (set! (-> obj root-override nav-flags) (logand -3 (-> obj root-override nav-flags))) + (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) + (logclear! (-> obj root-override nav-flags) (nav-flags navf1)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (set! (-> obj fact) diff --git a/test/decompiler/reference/levels/misty/babak-with-cannon_REF.gc b/test/decompiler/reference/levels/misty/babak-with-cannon_REF.gc index 6025751ac4..31b44fe6a1 100644 --- a/test/decompiler/reference/levels/misty/babak-with-cannon_REF.gc +++ b/test/decompiler/reference/levels/misty/babak-with-cannon_REF.gc @@ -145,7 +145,7 @@ nav-enemy-default-event-handler (if (nav-enemy-notice-player?) (go-virtual nav-enemy-chase) ) - (if (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (go babak-with-cannon-jump-onto-cannon) ) (none) @@ -243,7 +243,7 @@ nav-enemy-default-event-handler ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) :code @@ -251,7 +251,7 @@ nav-enemy-default-event-handler (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) - (set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (nav-enemy-neck-control-inactive) (let* ((v1-7 (-> self cannon-ent)) (gp-0 (if v1-7 @@ -277,9 +277,9 @@ nav-enemy-default-event-handler (ja-channel-push! 1 60) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) - (set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (let* ((v1-20 (-> self cannon-ent)) (gp-1 (if v1-20 (-> v1-20 extra process) @@ -334,7 +334,7 @@ nav-enemy-default-event-handler ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (none) ) :code @@ -342,7 +342,7 @@ nav-enemy-default-event-handler (set! (-> self state-time) (-> *display* base-frame-counter)) (nav-enemy-initialize-jump (-> self entity extra trans)) (nav-enemy-neck-control-look-at) - (set! (-> self nav-enemy-flags) (logand -25 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) (let ((a0-2 (-> self skel root-channel 0))) (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) (set! (-> a0-2 param 0) 0.0) @@ -364,7 +364,7 @@ nav-enemy-default-event-handler (ja-channel-push! 1 60) (nav-enemy-turn-to-face-point (-> self jump-dest) 1820.4445) ) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (nav-enemy-execute-jump) (let ((a1-6 (dummy-16 (-> self nav) (-> self jump-dest)))) (set-current-poly! (-> self nav) a1-6) diff --git a/test/decompiler/reference/levels/misty/bonelurker_REF.gc b/test/decompiler/reference/levels/misty/bonelurker_REF.gc index 9c0d936f20..89298303a1 100644 --- a/test/decompiler/reference/levels/misty/bonelurker_REF.gc +++ b/test/decompiler/reference/levels/misty/bonelurker_REF.gc @@ -52,20 +52,19 @@ ;; definition for method 44 of type bonelurker ;; INFO: Return type mismatch symbol vs object. (defmethod dummy-44 bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) - (the-as - object - (when (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) - ) - (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (set! (-> obj speed-scale) 0.5) - #t - ) - ) - ) + (the-as object (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) + ) + (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) + (set! (-> obj speed-scale) 0.5) + #t + ) + ) + ) ) ;; definition for method 43 of type bonelurker @@ -134,7 +133,7 @@ (send-event-function arg0 a1-6) ) (set! (-> obj bump-player-time) (-> *display* base-frame-counter)) - (set! (-> obj nav-enemy-flags) (logand -65 (-> obj nav-enemy-flags))) + (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) 'push ) ) @@ -256,10 +255,10 @@ nav-enemy-default-event-handler :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) - (if (and (zero? (logand (-> self nav-enemy-flags) 64)) + (if (and (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf6))) (>= (- (-> *display* base-frame-counter) (-> self bump-player-time)) (seconds 0.5)) ) - (logior! (-> self nav-enemy-flags) 64) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) ) (none) ) @@ -363,7 +362,7 @@ nav-enemy-default-event-handler (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-seek!) ) ) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory) ) (let ((a0-25 (-> self skel root-channel 0))) @@ -383,7 +382,7 @@ nav-enemy-default-event-handler (joint-control-channel-group-eval! a0-26 (the-as art-joint-anim #f) num-func-seek!) ) ) - (if (logtest? (-> self nav-enemy-flags) 256) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual nav-enemy-victory) ) (let ((a0-28 (-> self skel root-channel 0))) @@ -456,7 +455,7 @@ nav-enemy-default-event-handler ) (while #t (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 60) (let ((v1-20 (-> self skel root-channel 0))) (set! (-> v1-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) @@ -473,7 +472,7 @@ nav-enemy-default-event-handler (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-loop!) ) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) (ja-channel-push! 1 75) (let ((a0-18 (-> self skel root-channel 0))) @@ -595,7 +594,7 @@ nav-enemy-default-event-handler ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-18 (-> self skel root-channel 0))) (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> self draw art-group data 5))) @@ -732,7 +731,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #t :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/misty/mistycannon_REF.gc b/test/decompiler/reference/levels/misty/mistycannon_REF.gc index 44f4914c24..2f1c79bbc7 100644 --- a/test/decompiler/reference/levels/misty/mistycannon_REF.gc +++ b/test/decompiler/reference/levels/misty/mistycannon_REF.gc @@ -917,7 +917,7 @@ (-> self root-override shadow-pos) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) diff --git a/test/decompiler/reference/levels/misty/muse_REF.gc b/test/decompiler/reference/levels/misty/muse_REF.gc index 3558eb1971..366e9ae4c3 100644 --- a/test/decompiler/reference/levels/misty/muse_REF.gc +++ b/test/decompiler/reference/levels/misty/muse_REF.gc @@ -409,8 +409,8 @@ nav-enemy-default-event-handler (-> self nav destination-pos) 546133.3 ) - (if (logtest? (nav-control-flags bit21) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit10)) + (if (logtest? (nav-control-flags navcf21) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (nav-enemy-travel-post) (none) @@ -428,7 +428,7 @@ nav-enemy-default-event-handler :enter (behavior () ((-> (method-of-type nav-enemy nav-enemy-jump) enter)) - (set! (-> self nav-enemy-flags) (logand -513 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) (none) ) :code @@ -641,7 +641,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc b/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc index 4333127f5f..e01cc58a06 100644 --- a/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc +++ b/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc @@ -396,7 +396,7 @@ (the-as vector #f) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -1240,7 +1240,7 @@ (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (rand-vu-float-range 0.0 65536.0)) (initialize-skeleton obj *quicksandlurker-sg* '()) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj fact) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) diff --git a/test/decompiler/reference/levels/ogre/ogreboss_REF.gc b/test/decompiler/reference/levels/ogre/ogreboss_REF.gc index 0eaeb00ec5..6e2358f82a 100644 --- a/test/decompiler/reference/levels/ogre/ogreboss_REF.gc +++ b/test/decompiler/reference/levels/ogre/ogreboss_REF.gc @@ -1179,7 +1179,7 @@ (the-as vector #f) (the-as float 49152.0) (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) (-> (new 'static 'array float 1 0.0) 0) (the-as float 409600.0) ) diff --git a/test/decompiler/reference/levels/racer_common/racer-states_REF.gc b/test/decompiler/reference/levels/racer_common/racer-states_REF.gc index ca1a6064ac..c9978a2507 100644 --- a/test/decompiler/reference/levels/racer_common/racer-states_REF.gc +++ b/test/decompiler/reference/levels/racer_common/racer-states_REF.gc @@ -1073,7 +1073,7 @@ (send-event (ppointer->process (-> self manipy)) 'draw #t) (send-event (ppointer->process (-> self manipy)) 'anim-mode 'clone-anim) (target-timed-invulnerable-off self) - (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) (restore-collide-with-as (-> self control)) ((-> target-racing-start exit)) (target-exit) diff --git a/test/decompiler/reference/levels/robocave/cave-trap_REF.gc b/test/decompiler/reference/levels/robocave/cave-trap_REF.gc index 6560ed7c7d..00c4121ef2 100644 --- a/test/decompiler/reference/levels/robocave/cave-trap_REF.gc +++ b/test/decompiler/reference/levels/robocave/cave-trap_REF.gc @@ -398,9 +398,9 @@ ) (process-drawable-from-entity! obj arg0) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav nearest-y-threshold) 409600.0) - (set! (-> obj root-override nav-flags) (logand -2 (-> obj root-override nav-flags))) + (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s4-1 (entity-actor-count arg0 'alt-actor))) diff --git a/test/decompiler/reference/levels/rolling/rolling-lightning-mole_REF.gc b/test/decompiler/reference/levels/rolling/rolling-lightning-mole_REF.gc index afa746e30f..f5de402a0e 100644 --- a/test/decompiler/reference/levels/rolling/rolling-lightning-mole_REF.gc +++ b/test/decompiler/reference/levels/rolling/rolling-lightning-mole_REF.gc @@ -503,13 +503,13 @@ :virtual #t :enter (behavior () - (logior! (-> self nav flags) (nav-control-flags bit12)) + (logior! (-> self nav flags) (nav-control-flags navcf12)) ((-> (method-of-type nav-enemy nav-enemy-chase) enter)) (none) ) :exit (behavior () - (logclear! (-> self nav flags) (nav-control-flags bit12)) + (logclear! (-> self nav flags) (nav-control-flags navcf12)) (none) ) :trans @@ -1143,7 +1143,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -1173,7 +1173,7 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *lightning-mole-sg* '()) (TODO-RENAME-45 obj *lightning-mole-nav-enemy-info*) - (logclear! (-> obj nav flags) (nav-control-flags bit5 bit6 bit7)) + (logclear! (-> obj nav flags) (nav-control-flags navcf5 navcf6 navcf7)) (set! (-> obj draw origin-joint-index) (the-as uint 3)) (set! (-> obj reaction-time) (seconds 0.05)) (set! (-> obj last-reflection-time) 0) diff --git a/test/decompiler/reference/levels/snow/ice-cube_REF.gc b/test/decompiler/reference/levels/snow/ice-cube_REF.gc index 8d6eb1430a..428d1b6c37 100644 --- a/test/decompiler/reference/levels/snow/ice-cube_REF.gc +++ b/test/decompiler/reference/levels/snow/ice-cube_REF.gc @@ -135,7 +135,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -463,7 +463,7 @@ (= (-> arg0 type) target) ) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) 256) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (level-hint-spawn (game-text-id ice-cube-hint) "sksp0350" (the-as entity #f) *entity-pool* (game-task none)) ) ) @@ -497,8 +497,8 @@ (= (-> arg0 type) target) ) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (let ((v0-3 (the-as none (logior (-> self nav-enemy-flags) 256)))) - (set! (-> self nav-enemy-flags) (the-as uint v0-3)) + (let ((v0-3 (the-as none (logior (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))))) + (set! (-> self nav-enemy-flags) (the-as nav-enemy-flags v0-3)) v0-3 ) ) @@ -744,7 +744,7 @@ (collide-kind background) (-> obj collide-info process) s4-0 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -1038,7 +1038,7 @@ :code (behavior () (dummy-57 self) - (set! (-> self nav-enemy-flags) (logand -3 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (logclear! (-> self mask) (process-mask actor-pause)) (go ice-cube-face-player) (none) @@ -1054,7 +1054,7 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-57 self) (logclear! (-> self mask) (process-mask actor-pause)) (if (or (not *target*) @@ -1233,7 +1233,7 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-58 self) (if (or (not *target*) (logtest? (-> *target* state-flags) #x80f8) @@ -1347,7 +1347,7 @@ (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (dummy-58 self) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (set! (-> self next-skid-sound-time) (-> *display* base-frame-counter)) (if (or (not *target*) (logtest? (-> *target* state-flags) #x80f8) @@ -1359,7 +1359,7 @@ (set! (-> self acceleration) (-> self nav-info run-acceleration)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) - (logclear! (-> self nav flags) (nav-control-flags bit8)) + (logclear! (-> self nav flags) (nav-control-flags navcf8)) (set-root-prim-collide-with! (-> self collide-info) (collide-kind cak-2 cak-3 target crate enemy)) (set! (-> self track-target?) #t) (set! (-> self slow-down?) #f) @@ -1373,7 +1373,7 @@ ) :exit (behavior () - (logior! (-> self nav flags) (nav-control-flags bit8)) + (logior! (-> self nav flags) (nav-control-flags navcf8)) (set-root-prim-collide-with! (-> self collide-info) (collide-kind target)) (none) ) diff --git a/test/decompiler/reference/levels/snow/snow-bunny_REF.gc b/test/decompiler/reference/levels/snow/snow-bunny_REF.gc index dc6544ad27..7c973e28f0 100644 --- a/test/decompiler/reference/levels/snow/snow-bunny_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-bunny_REF.gc @@ -123,7 +123,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -147,7 +147,7 @@ (when (send-event-function arg0 a1-5) (set! (-> self touch-time) (-> *display* base-frame-counter)) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) - (logior! (-> self nav-enemy-flags) 256) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual snow-bunny-attack) ) ) @@ -292,8 +292,8 @@ ;; INFO: Return type mismatch int vs none. (defbehavior snow-bunny-initialize-jump snow-bunny ((arg0 vector)) (nav-enemy-initialize-custom-jump arg0 #f (-> self jump-height-min) (-> self jump-height-factor) -307200.0) - (set! (-> self nav-enemy-flags) (logand -1025 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 512) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags standing-jump)) 0 (none) ) @@ -479,9 +479,9 @@ (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (dummy-76 self #f) - (set! (-> self nav flags) (logior (nav-control-flags bit19) (-> self nav flags))) - (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) - (logior! (-> self nav-enemy-flags) 8) + (set! (-> self nav flags) (logior (nav-control-flags navcf19) (-> self nav flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (set! (-> self state-timeout) (seconds 0.1)) (none) ) @@ -583,7 +583,7 @@ (collide-kind background) (-> obj collide-info process) s4-0 - (the-as uint 1) + (new 'static 'pat-surface :noentity #x1) ) ) ) @@ -719,8 +719,8 @@ ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (none) ) :trans @@ -753,12 +753,12 @@ snow-bunny-default-event-handler :enter (behavior () - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-look-at) - (if (logtest? (-> self nav-enemy-flags) 2) + (if (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-chase) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (dummy-76 self #t) (set-vector! (-> self collide-info transv) 0.0 (nav-enemy-rnd-float-range 102400.0 131072.0) 0.0 1.0) (none) @@ -958,7 +958,7 @@ (go-virtual snow-bunny-defend) ) (when (not (dummy-52 self)) - (set! (-> self nav-enemy-flags) (logand -3 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-notice) ) (set-jump-height-factor! self 1) @@ -970,8 +970,8 @@ ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (none) ) :trans @@ -1268,8 +1268,8 @@ ) :exit (behavior () - (logior! (-> self nav-enemy-flags) 24) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (none) ) :trans diff --git a/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc b/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc index 289f3ba9f1..18e53ee293 100644 --- a/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-ram-boss_REF.gc @@ -157,7 +157,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -211,7 +211,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -537,7 +537,7 @@ (the-as vector #f) f0-9 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -998,7 +998,7 @@ v0-4 ) ((begin - (if (zero? (logand (-> self nav-enemy-flags) 256)) + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> self collide-info)) ) (level-hint-spawn @@ -1055,7 +1055,7 @@ ) ) (('touch) - (if (zero? (logand (-> self nav-enemy-flags) 256)) + (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> self collide-info)) ) (cond @@ -1320,7 +1320,7 @@ ) (else (ja-post) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go ram-boss-idle) ) ) @@ -1472,7 +1472,7 @@ ) :code (behavior () - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (while #t (clone-anim-once (ppointer->handle (-> self parent-override)) @@ -1513,7 +1513,7 @@ :enter (behavior ((arg0 basic)) (dummy-52 self) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (-> self node-list data 0 bone transform)) ) @@ -1596,7 +1596,7 @@ (-> ram-boss-jump-down event) :code (behavior () - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (activate! *camera-smush-control* 409.6 37 150 1.0 0.99) (let ((a0-1 (-> self skel root-channel 0))) (set! (-> a0-1 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) @@ -1615,7 +1615,7 @@ (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) ) ) - (logior! (-> self nav-enemy-flags) 2) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go ram-boss-nav-start) (none) ) @@ -1627,7 +1627,7 @@ (defstate ram-boss-already-down (ram-boss) :code (behavior ((arg0 basic)) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (dummy-52 self) (let ((a1-0 (new 'stack-no-clear 'vector)) (a2-0 (-> self parent-override 0 node-list data 0 bone transform)) @@ -1750,7 +1750,7 @@ ) ) (cond - ((logtest? (nav-control-flags bit17) (-> self nav flags)) + ((logtest? (nav-control-flags navcf17) (-> self nav flags)) (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1)) (go-virtual nav-enemy-patrol) ) @@ -1812,7 +1812,7 @@ (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self facing-y) (quaternion-y-angle (-> self collide-info quat))) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) :trans @@ -2016,7 +2016,7 @@ :enter (behavior () (set! (-> self frustration) 0) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) :trans @@ -2057,7 +2057,7 @@ :enter (behavior () (set! (-> self frustration) 0) - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (none) ) :trans @@ -2171,7 +2171,7 @@ ram-boss-on-ground-event-handler :enter (behavior () - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (let ((gp-0 (-> self child))) (while gp-0 (send-event (ppointer->process gp-0) 'launch) @@ -2241,7 +2241,7 @@ (defstate ram-boss-lose-shield (ram-boss) :enter (behavior () - (logior! (-> self nav-enemy-flags) 4) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-neck-control-inactive) (dummy-53 self) (TODO-RENAME-49 self *ram-boss-nav-enemy-info-no-shield*) diff --git a/test/decompiler/reference/levels/snow/yeti_REF.gc b/test/decompiler/reference/levels/snow/yeti_REF.gc index 791f9cc3e2..97dcc98826 100644 --- a/test/decompiler/reference/levels/snow/yeti_REF.gc +++ b/test/decompiler/reference/levels/snow/yeti_REF.gc @@ -122,7 +122,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -251,7 +251,7 @@ (if (-> self nav-info move-to-ground) (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) ) - (set! (-> self nav-enemy-flags) (logand -7 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1 navenmf2)) (set! (-> self state-timeout) (seconds 1)) (set! (-> self ground-y) (-> self collide-info trans y)) (spawn (-> self part) (-> self collide-info trans)) @@ -413,7 +413,7 @@ (joint-control-channel-group! a0-14 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 180) - (set! (-> self nav-enemy-flags) (logand -9 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((gp-1 (nav-enemy-rnd-int-range 2 6))) (dotimes (s5-0 gp-1) (let ((a0-18 (-> self skel root-channel 0))) @@ -436,7 +436,7 @@ ) ) ) - (logior! (-> self nav-enemy-flags) 8) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (let ((a0-21 (-> self skel root-channel 0))) (set! (-> a0-21 param 0) 1.0) (joint-control-channel-group! a0-21 (the-as art-joint-anim #f) num-func-loop!) @@ -541,7 +541,7 @@ (behavior () (set! (-> self turn-time) (seconds 0.2)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or (logtest? (-> self nav-enemy-flags) 256) + (when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) ) (ja-channel-push! 1 30) @@ -563,7 +563,7 @@ ) (while #t (when (not (nav-enemy-facing-player? 2730.6667)) - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((a0-9 (-> self skel root-channel 0))) (set! (-> a0-9 param 0) 1.0) (joint-control-channel-group! a0-9 (the-as art-joint-anim #f) num-func-loop!) @@ -584,7 +584,7 @@ (joint-control-channel-group-eval! a0-15 (the-as art-joint-anim #f) num-func-loop!) ) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) (if (not (= (if (> (-> self skel active-channels) 0) (-> self skel root-channel 0 frame-group) @@ -670,7 +670,7 @@ ) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-12 (-> self skel root-channel 0))) (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) diff --git a/test/decompiler/reference/levels/sunken/bully_REF.gc b/test/decompiler/reference/levels/sunken/bully_REF.gc index 4d57d2274e..7bcfbdc6d9 100644 --- a/test/decompiler/reference/levels/sunken/bully_REF.gc +++ b/test/decompiler/reference/levels/sunken/bully_REF.gc @@ -1106,7 +1106,7 @@ (initialize-skeleton obj *bully-sg* '()) (set! (-> obj draw shadow-ctrl) *bully-shadow-control*) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 454) obj)) (set! (-> obj fact-override) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) diff --git a/test/decompiler/reference/levels/sunken/double-lurker_REF.gc b/test/decompiler/reference/levels/sunken/double-lurker_REF.gc index ee679e5862..82fc4384ac 100644 --- a/test/decompiler/reference/levels/sunken/double-lurker_REF.gc +++ b/test/decompiler/reference/levels/sunken/double-lurker_REF.gc @@ -136,7 +136,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -191,7 +191,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -246,7 +246,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) @@ -352,8 +352,8 @@ (set! (-> v1-3 settings flags) (logand -33 (-> v1-3 settings flags))) ) 0 - (set! (-> self collide-info nav-flags) (logand -2 (-> self collide-info nav-flags))) - (logior! (-> self collide-info nav-flags) 2) + (logclear! (-> self collide-info nav-flags) (nav-flags navf0)) + (logior! (-> self collide-info nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self fall-dest quad)) (set! (-> self nav extra-nav-sphere w) 9011.2) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -383,8 +383,8 @@ ) ) ) - (logior! (-> self collide-info nav-flags) 1) - (set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags))) + (logior! (-> self collide-info nav-flags) (nav-flags navf0)) + (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) (TODO-RENAME-27 (-> self nav)) (go double-lurker-top-resume) (none) @@ -466,7 +466,7 @@ ;; definition for method 51 of type double-lurker-top (defmethod dummy-51 double-lurker-top ((obj double-lurker-top)) (restore-collide-with-as (-> obj collide-info)) - (logior! (-> obj collide-info nav-flags) 1) + (logior! (-> obj collide-info nav-flags) (nav-flags navf0)) (TODO-RENAME-27 (-> obj nav)) (none) ) @@ -543,7 +543,7 @@ ) ;; definition for method 48 of type double-lurker-top -;; INFO: Return type mismatch uint vs none. +;; INFO: Return type mismatch nav-flags vs none. ;; Used lq/sq (defmethod TODO-RENAME-48 double-lurker-top ((obj double-lurker-top)) (initialize-skeleton obj *double-lurker-top-sg* '()) @@ -554,7 +554,7 @@ (set-vector! (-> obj collide-info scale) 1.0 1.0 1.0 1.0) (quaternion-copy! (-> obj collide-info quat) (-> v1-5 0 collide-info quat)) ) - (set! (-> obj collide-info nav-flags) (logand -2 (-> obj collide-info nav-flags))) + (logclear! (-> obj collide-info nav-flags) (nav-flags navf0)) (none) ) diff --git a/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc b/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc index 95433dd76d..d5599c641c 100644 --- a/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc +++ b/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc @@ -591,7 +591,7 @@ ;; Used lq/sq (defun get-nav-point! ((arg0 vector) (arg1 orbit-plat) (arg2 vector) (arg3 float)) (set! (-> arg1 nav target-pos quad) (-> arg2 quad)) - (logclear! (-> arg1 nav flags) (nav-control-flags bit19)) + (logclear! (-> arg1 nav flags) (nav-control-flags navcf19)) (dummy-11 (-> arg1 nav) (-> arg1 nav target-pos)) (let ((f0-0 (vector-length (-> arg1 nav travel)))) (if (< arg3 f0-0) @@ -759,7 +759,7 @@ ) ) (when (>= 614.4 (vector-vector-xz-distance (-> obj basetrans) (-> obj reset-trans))) - (set! v0-11 (logior (nav-control-flags bit19) (-> obj nav flags))) + (set! v0-11 (logior (nav-control-flags navcf19) (-> obj nav flags))) (set! (-> obj nav flags) (the-as nav-control-flags v0-11)) v0-11 ) @@ -786,7 +786,7 @@ (vector-normalize! s5-2 (-> obj reset-length)) (vector+! s5-2 s5-2 s4-1) (when (not (dummy-16 (-> obj nav) s5-2)) - (logclear! (-> obj nav flags) (nav-control-flags bit19)) + (logclear! (-> obj nav flags) (nav-control-flags navcf19)) (get-rotate-point! s5-2 s4-1 (-> obj basetrans) (the-as vector (-> obj reset-length)) 0.0 40960.0) (when (not (dummy-16 (-> obj nav) s5-2)) (get-rotate-point! @@ -855,13 +855,13 @@ :code (behavior () (set! (-> self plat-status) (the-as uint 3)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (let ((a0-3 (-> self skel root-channel 0))) (set! (-> a0-3 param 0) 0.0) (set! (-> a0-3 param 1) 1.0) (joint-control-channel-group! a0-3 (the-as art-joint-anim #f) num-func-seek!) ) - (while (zero? (logand (nav-control-flags bit19) (-> self nav flags))) + (while (zero? (logand (nav-control-flags navcf19) (-> self nav flags))) (dummy-27 self) (when (nonzero? (-> self root-override riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -974,7 +974,7 @@ (update-transforms! (-> obj root-override)) (dummy-21 obj) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav gap-event) 'blocked) (set! (-> obj other) (entity-actor-lookup arg0 'alt-actor 0)) (let ((f0-7 (res-lump-float arg0 'scale :default 1.0))) diff --git a/test/decompiler/reference/levels/sunken/puffer_REF.gc b/test/decompiler/reference/levels/sunken/puffer_REF.gc index a205477759..bd2a20a0b4 100644 --- a/test/decompiler/reference/levels/sunken/puffer_REF.gc +++ b/test/decompiler/reference/levels/sunken/puffer_REF.gc @@ -1276,7 +1276,7 @@ (set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default 57344.0)) (set! (-> obj give-up-dist) (+ 20480.0 (-> obj notice-dist))) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (TODO-RENAME-26 (-> obj nav)) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) diff --git a/test/decompiler/reference/levels/swamp/billy_REF.gc b/test/decompiler/reference/levels/swamp/billy_REF.gc index 6217dd4b08..f2286b8fe0 100644 --- a/test/decompiler/reference/levels/swamp/billy_REF.gc +++ b/test/decompiler/reference/levels/swamp/billy_REF.gc @@ -329,7 +329,7 @@ ) ) (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (go-virtual nav-enemy-chase) (none) ) @@ -400,8 +400,8 @@ (t9-1) ) ) - (when (logtest? (nav-control-flags bit19) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) + (when (logtest? (nav-control-flags navcf19) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf19)) (if (rat-about-to-eat? self (-> self billy 0)) (go billy-rat-salivate) (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) @@ -427,7 +427,7 @@ :trans (behavior () (set! (-> self speed-scale) (-> self billy 0 rat-speed)) - (if (or (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self chase-rest-time)) ) (go-virtual nav-enemy-victory) diff --git a/test/decompiler/reference/levels/swamp/kermit_REF.gc b/test/decompiler/reference/levels/swamp/kermit_REF.gc index ad7429941b..7110dba8bc 100644 --- a/test/decompiler/reference/levels/swamp/kermit_REF.gc +++ b/test/decompiler/reference/levels/swamp/kermit_REF.gc @@ -650,7 +650,7 @@ (the-as vector #f) 8192.0 (collide-kind background) - (the-as process #f) + (the-as process-drawable #f) 0.0 81920.0 ) @@ -1016,7 +1016,7 @@ ;; Used lq/sq (defbehavior kermit-set-rotate-dir-to-nav-target kermit () (cond - ((logtest? (nav-control-flags bit19) (-> self nav flags)) + ((logtest? (nav-control-flags navcf19) (-> self nav flags)) (vector-! (-> self rotate-dir) (-> self nav target-pos) (-> self collide-info trans)) ) (else @@ -1180,7 +1180,7 @@ nav-enemy-default-event-handler (if (and (not (-> self airborne)) (nav-enemy-test-point-in-nav-mesh? (target-pos 0))) (go kermit-notice) ) - (if (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (logtest? (nav-control-flags navcf19) (-> self nav flags)) (kermit-get-new-patrol-point) ) (none) @@ -1300,7 +1300,7 @@ nav-enemy-default-event-handler (behavior () (when (not (-> self airborne)) (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - (and (logtest? (nav-control-flags bit19) (-> self nav flags)) + (and (logtest? (nav-control-flags navcf19) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) ) ) @@ -1739,7 +1739,7 @@ nav-enemy-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc b/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc index 13c281039b..b04b1721cb 100644 --- a/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc @@ -994,7 +994,7 @@ (set! (-> self entity) gp-0) ) (set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0)) - (logior! (-> self nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> self nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set-current-poly! (-> self nav) (find-poly (-> self nav) (-> self root-override trans))) (+! (-> self parent-process 0 hit-points) 3) (dummy-21 self) diff --git a/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc b/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc index 8809656567..4ca44f90a4 100644 --- a/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc @@ -327,7 +327,7 @@ swamp-rat-default-event-handler (set! (-> self turn-time) (seconds 0.07333333)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) (while #t - (logior! (-> self nav-enemy-flags) 16) + (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (ja-channel-push! 1 30) (let ((a0-2 (-> self skel root-channel 0))) (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) @@ -350,7 +350,7 @@ swamp-rat-default-event-handler (set! (-> a0-5 param 0) 1.0) (joint-control-channel-group! a0-5 (the-as art-joint-anim #f) num-func-loop!) ) - (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) + (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600)) (s5-0 (-> *display* base-frame-counter)) ) @@ -395,7 +395,7 @@ swamp-rat-default-event-handler (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-seek!) ) ) - (logclear! (-> self nav flags) (nav-control-flags bit17 bit19)) + (logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19)) (nav-enemy-get-new-patrol-point) (let ((a0-7 (-> self skel root-channel 0))) (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) @@ -595,7 +595,7 @@ swamp-rat-default-event-handler :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/village1/village-obs_REF.gc b/test/decompiler/reference/levels/village1/village-obs_REF.gc index 97686c851e..427f404dfe 100644 --- a/test/decompiler/reference/levels/village1/village-obs_REF.gc +++ b/test/decompiler/reference/levels/village1/village-obs_REF.gc @@ -827,7 +827,7 @@ :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self nav flags) (logior (nav-control-flags bit19) (-> self nav flags))) + (set! (-> self nav flags) (logior (nav-control-flags navcf19) (-> self nav flags))) (none) ) :trans @@ -918,7 +918,7 @@ :use-proximity-notice #f :use-jump-blocked #f :use-jump-patrol #f - :gnd-collide-with #x1 + :gnd-collide-with (collide-kind background) :debug-draw-neck #f :debug-draw-jump #f ) diff --git a/test/decompiler/reference/levels/village1/yakow_REF.gc b/test/decompiler/reference/levels/village1/yakow_REF.gc index 1405733244..f3ad0d6f1f 100644 --- a/test/decompiler/reference/levels/village1/yakow_REF.gc +++ b/test/decompiler/reference/levels/village1/yakow_REF.gc @@ -691,7 +691,7 @@ yakow-default-event-handler :enter (behavior ((arg0 vector)) (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self nav destination-pos quad) (-> arg0 quad)) (set! (-> self rotate-speed) (-> *YAKOW-bank* walk-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* walk-turn-time)) @@ -710,7 +710,7 @@ yakow-default-event-handler (go yakow-notice) ) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) - (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) + (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< (vector-vector-xz-distance (-> self root-override trans) (-> self nav destination-pos)) 4096.0) ) (if (-> self in-pen) @@ -738,8 +738,8 @@ yakow-default-event-handler (-> self nav destination-pos) 131072.0 ) - (if (logtest? (nav-control-flags bit21) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit10)) + (if (logtest? (nav-control-flags navcf21) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags navcf10)) ) (yakow-post) (none) @@ -872,7 +872,7 @@ yakow-default-event-handler :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) - (logior! (-> self nav flags) (nav-control-flags bit10)) + (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self rotate-speed) (-> *YAKOW-bank* run-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* run-turn-time)) (none) @@ -1064,7 +1064,7 @@ yakow-default-event-handler (process-drawable-from-entity! obj arg0) (set! (-> obj align) (new 'process 'align-control obj)) (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7)) + (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> obj nav nearest-y-threshold) 409600.0) (set! (-> obj fact-override) (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) diff --git a/test/goalc/test_with_game.cpp b/test/goalc/test_with_game.cpp index 0e8bb764ce..32a43b1e24 100644 --- a/test/goalc/test_with_game.cpp +++ b/test/goalc/test_with_game.cpp @@ -30,7 +30,7 @@ class WithGameTests : public ::testing::Test { shared_compiler->compiler.run_test_no_load( "test/goalc/source_templates/with_game/test-build-game.gc"); shared_compiler->compiler.run_front_end_on_string( - "(asm-data-file game-text \"test/test_data/test_game_text.txt\")"); + "(asm-text-file text 10 :files (\"test/test_data/test_game_text.txt\"))"); } catch (std::exception& e) { fprintf(stderr, "caught exception %s\n", e.what()); EXPECT_TRUE(false); diff --git a/test/test_data/test_game_text.txt b/test/test_data/test_game_text.txt index 2d22520fa1..6d8e660ad4 100644 --- a/test/test_data/test_game_text.txt +++ b/test/test_data/test_game_text.txt @@ -1,5 +1,5 @@ -(language-count 3) (group-name "test") +(language-id 0 1 2) (#x123 "language 0" "language 1" diff --git a/test/test_reader.cpp b/test/test_reader.cpp index 124a22acfc..d49d075e91 100644 --- a/test/test_reader.cpp +++ b/test/test_reader.cpp @@ -206,9 +206,9 @@ TEST(GoosReader, Symbol) { namespace { bool first_list_matches(Object o, std::vector stuff) { - auto lst = o.as_pair()->cdr.as_pair()->car; + auto& lst = o.as_pair()->cdr.as_pair()->car; for (const auto& x : stuff) { - const auto check = x.as_pair()->cdr.as_pair()->car; + const auto& check = x.as_pair()->cdr.as_pair()->car; if (lst.as_pair()->car != check) { return false; } @@ -233,11 +233,11 @@ bool first_array_matches(Object o, std::vector stuff) { } bool first_pair_matches(Object o, Object car, Object cdr) { - auto lst = o.as_pair()->cdr.as_pair()->car; + auto& lst = o.as_pair()->cdr.as_pair()->car; return (lst.as_pair()->car == car) && (lst.as_pair()->cdr == cdr); } -bool print_matches(Object o, std::string expected) { +bool print_matches(Object o, const std::string& expected) { return o.as_pair()->cdr.as_pair()->car.print() == expected; }