diff --git a/.vs/launch.vs.json b/.vs/launch.vs.json index be38486881..8544beae0b 100644 --- a/.vs/launch.vs.json +++ b/.vs/launch.vs.json @@ -56,6 +56,20 @@ "jak1" ] }, + { + "type": "default", + "project": "CMakeLists.txt", + "projectTarget": "offline-test.exe (bin\\offline-test.exe)", + "name": "Tests - Offline Tests - Jak 2 - Specific File", + "args": [ + "--iso_data_path", + "${workspaceRoot}/iso_data/jak2", + "--game", + "jak2", + "--file", + "progress" + ] + }, { "type": "default", "project": "CMakeLists.txt", @@ -88,14 +102,14 @@ "type": "default", "project": "CMakeLists.txt", "projectTarget": "gk.exe (bin\\gk.exe)", - "name": "Game 2 - Runtime (boot)", + "name": "Game - Jak 2 - Runtime (boot)", "args": ["-boot", "-fakeiso", "-debug", "-v", "-jak2"] }, { "type": "default", "project": "CMakeLists.txt", "projectTarget": "gk.exe (bin\\gk.exe)", - "name": "Game 2 - Runtime (no boot)", + "name": "Game - Jak 2 - Runtime (no boot)", "args": ["-fakeiso", "-debug", "-v", "-jak2"] }, { @@ -152,6 +166,18 @@ "${workspaceRoot}/decompiler_out" ] }, + { + "type": "default", + "project": "CMakeLists.txt", + "projectTarget": "decompiler.exe (bin\\decompiler.exe)", + "name": "Decompiler - Jak 2 - Extract", + "args": [ + "${workspaceRoot}/decompiler/config/jak2_ntsc_v1.jsonc", + "${workspaceRoot}/iso_data", + "${workspaceRoot}/decompiler_out", + "--config-override \"{\\\"decompile_code\\\": false}\"" + ] + }, { "type": "default", "project": "CMakeLists.txt", diff --git a/Taskfile.yml b/Taskfile.yml index 4beddd2ead..0cf7d5c03d 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -34,7 +34,7 @@ tasks: - sh: test -f {{.DECOMP_BIN_RELEASE_DIR}}/decompiler{{.EXE_FILE_EXTENSION}} msg: "Couldn't locate decompiler executable in '{{.DECOMP_BIN_RELEASE_DIR}}/decompiler'" cmds: - - '{{.DECOMP_BIN_RELEASE_DIR}}/decompiler "./decompiler/config/{{.DECOMP_CONFIG}}" ./iso_data ./decompiler_out --config-override "{\\\"decompile_code\\\": false}"' + - '{{.DECOMP_BIN_RELEASE_DIR}}/decompiler "./decompiler/config/{{.DECOMP_CONFIG}}" ./iso_data ./decompiler_out --config-override "{\\\"decompile_code\\\":false,\\\"allowed_objects\\\":[]}"' boot-game: desc: "Boots the game, it will fail if it's not already compiled!" preconditions: @@ -89,6 +89,9 @@ tasks: decomp-clean: cmds: - python ./scripts/tasks/clean-decomp.py --game "{{.GAME}}" + lint-gsrc-file: + cmds: + - python ./scripts/gsrc/lint-gsrc-file.py --game {{.GAME}} --file {{.FILE}} update-gsrc: cmds: - python ./scripts/gsrc/update-gsrc-via-refs.py --game "{{.GAME}}" --decompiler "{{.DECOMP_BIN_RELEASE_DIR}}/decompiler" --decompiler_config {{.DECOMP_CONFIG}} @@ -96,6 +99,7 @@ tasks: cmds: - task: decomp-file - python ./scripts/gsrc/update-from-decomp.py --game "{{.GAME}}" --file {{.FILE}} + - task: lint-gsrc-file # TOOLS analyze-ee-memory: cmds: @@ -131,10 +135,6 @@ tasks: ignore_error: true - python ./scripts/update_decomp_reference.py ./failures ./test/decompiler/reference/ --game {{.GAME}} - task: offline-test-file - # check-gsrc-file: - # cmds: - # - python ./scripts/check-gsrc-file.py --files "{{.FILES}}" type-test: cmds: - cmd: '{{.GOALCTEST_BIN_RELEASE_DIR}}/goalc-test --gtest_brief=0 --gtest_filter="*Jak2TypeConsistency*"' - ignore_error: true diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index ae9f7d870c..7ce3a41e50 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -42,15 +42,15 @@ add_library(common util/DgoWriter.cpp util/diff.cpp util/FileUtil.cpp + util/FontUtils.cpp util/json_util.cpp util/read_iso_file.cpp util/SimpleThreadGroup.cpp util/Timer.cpp util/os.cpp util/print_float.cpp - util/FontUtils.cpp util/FrameLimiter.cpp - util/unicode_util.cpp) + util/unicode_util.cpp ) target_link_libraries(common fmt lzokay replxx libzstd_static) diff --git a/common/util/FontUtils.cpp b/common/util/FontUtils.cpp index 3f1bba4220..429a0fd8c3 100644 --- a/common/util/FontUtils.cpp +++ b/common/util/FontUtils.cpp @@ -29,7 +29,8 @@ bool hex_char(char c) { const std::unordered_map sTextVerEnumMap = { {"jak1-v1", GameTextVersion::JAK1_V1}, - {"jak1-v2", GameTextVersion::JAK1_V2}}; + {"jak1-v2", GameTextVersion::JAK1_V2}, + {"jak2", GameTextVersion::JAK2}}; const std::string& get_text_version_name(GameTextVersion version) { for (auto& [name, ver] : sTextVerEnumMap) { @@ -119,6 +120,10 @@ std::string GameTextFontBank::replace_to_utf8(std::string& str) const { } std::string GameTextFontBank::replace_to_game(std::string& str) const { for (auto& info : *m_replace_info) { + if (info.to.empty()) { + // Skip empty replacements, else it's an infinite loop + continue; + } auto pos = str.find(info.to); while (pos != std::string::npos) { str.replace(pos, info.to.size(), info.from); @@ -157,6 +162,19 @@ std::string GameTextFontBank::convert_utf8_to_game(std::string str) const { return str; } +bool GameTextFontBank::valid_char_range(const char in) const { + if (m_version == GameTextVersion::JAK1_V1 || m_version == GameTextVersion::JAK1_V2) { + return ((in >= '0' && in <= '9') || (in >= 'A' && in <= 'Z') || + m_passthrus->find(in) != m_passthrus->end()) && + in != '\\'; + } else if (m_version == GameTextVersion::JAK2) { + return ((in >= '0' && in <= '9') || (in >= 'A' && in <= 'Z') || (in >= 'a' && in <= 'z') || + m_passthrus->find(in) != m_passthrus->end()) && + in != '\\'; + } + return false; +} + /*! * Turn a normal readable string into a string readable in the in-game font encoding and converts * \cXX escape sequences @@ -219,9 +237,7 @@ std::string GameTextFontBank::convert_game_to_utf8(const char* in) const { if (remap != nullptr) { result.append(remap->chars); in += remap->bytes.size() - 1; - } else if (((*in >= '0' && *in <= '9') || (*in >= 'A' && *in <= 'Z') || - m_passthrus->find(*in) != m_passthrus->end()) && - *in != '\\') { + } else if (valid_char_range(*in)) { result.push_back(*in); } else if (*in == '\n') { result += "\\n"; @@ -250,9 +266,9 @@ static std::vector s_replace_info_null = {}; * - Jak & Daxter: The Precursor Legacy (Black Label) */ -static std::unordered_set s_passthrus = {'~', ' ', ',', '.', '-', '+', '(', ')', - '!', ':', '?', '=', '%', '*', '/', '#', - ';', '<', '>', '@', '[', '_'}; +static std::unordered_set s_passthrus_jak1 = {'~', ' ', ',', '.', '-', '+', '(', ')', + '!', ':', '?', '=', '%', '*', '/', '#', + ';', '<', '>', '@', '[', '_'}; static std::vector s_encode_info_jak1 = { // random @@ -578,10 +594,10 @@ static std::vector s_replace_info_jak1 = { {"~Y~22L<~Z~Y~24L#~Z~Y~1L>~Z~Y~23L[~Z~+26H", ""}, // custom }; -GameTextFontBank g_font_bank_jak1(GameTextVersion::JAK1_V1, - &s_encode_info_jak1, - &s_replace_info_jak1, - &s_passthrus); +GameTextFontBank g_font_bank_jak1_v1(GameTextVersion::JAK1_V1, + &s_encode_info_jak1, + &s_replace_info_jak1, + &s_passthrus_jak1); /*! * ================================ @@ -815,12 +831,281 @@ static std::vector s_encode_info_jak1_v2 = { GameTextFontBank g_font_bank_jak1_v2(GameTextVersion::JAK1_V2, &s_encode_info_jak1_v2, &s_replace_info_jak1, - &s_passthrus); + &s_passthrus_jak1); + +/*! + * ================================ + * GAME TEXT FONT BANK - JAK 2 + * ================================ + * This font is used in: + * - Jak 2 - NTSC - v1 + */ + +static std::unordered_set s_passthrus_jak2 = {'~', ' ', ',', '.', '-', '+', '(', ')', + '!', ':', '?', '=', '%', '*', '/', '#', + ';', '<', '>', '@', '[', '_'}; + +static std::vector s_replace_info_jak2 = { + // other + {"A~Y~-21H~-5Vº~Z", "Å"}, + {"N~Y~-6Hº~Z~+10H", "Nº"}, + {"~+4VÇ~-4V", "ç"}, + + // tildes + {"N~Y~-22H~-4V~Z", "Ñ"}, + {"n~Y~-24H~-4V~Z", "ñ"}, + {"A~Y~-21H~-5V~Z", "Ã"}, + {"O~Y~-22H~-4V~Z", "Õ"}, + + // acute accents + {"A~Y~-21H~-5V'~Z", "Á"}, + {"A~Y~-26H~-8V'~Z", "<Á_V2>"}, // unfortunate... + {"a~Y~-25H~-5V'~Z", "á"}, + {"E~Y~-23H~-9V'~Z", "É"}, + {"e~Y~-26H~-5V'~Z", "é"}, + {"I~Y~-19H~-5V'~Z", "Í"}, + {"i~Y~-19H~-8V'~Z", "í"}, + {"O~Y~-22H~-4V'~Z", "Ó"}, + {"o~Y~-26H~-4V'~Z", "ó"}, + {"U~Y~-24H~-3V'~Z", "Ú"}, + {"u~Y~-24H~-3V'~Z", "ú"}, + + // circumflex + {"A~Y~-20H~-4V^~Z", "Â"}, + {"a~Y~-24H~-5V^~Z", "â"}, + {"E~Y~-20H~-5V^~Z", "Ê"}, + {"e~Y~-25H~-4V^~Zt", "ê"}, + {"I~Y~-19H~-5V^~Z", "Î"}, + {"i~Y~-19H~-8V^~Z", "î"}, + {"O~Y~-20H~-4V^~Z", "Ô"}, + {"o~Y~-25H~-4V^~Z", "ô"}, + {"U~Y~-24H~-3V^~Z", "Û"}, + {"u~Y~-23H~-3V^~Z", "û"}, + + // grave accents + {"A~Y~-26H~-8V`~Z", "À"}, + {"a~Y~-25H~-5V`~Z", "à"}, + {"E~Y~-23H~-9V`~Z", "È"}, + {"e~Y~-26H~-5V`~Z", "è"}, + {"I~Y~-19H~-5V`~Z", "Ì"}, + {"i~Y~-19H~-8V`~Z", "ì"}, + {"O~Y~-22H~-4V`~Z", "Ò"}, + {"o~Y~-26H~-4V`~Z", "ò"}, + {"U~Y~-24H~-3V`~Z", "Ù"}, + {"u~Y~-24H~-3V`~Z", "ù"}, + + // umlaut + {"A~Y~-26H~-8V¨~Z", "Ä"}, + {"a~Y~-25H~-5V¨~Z", "ä"}, + {"E~Y~-20H~-5V¨~Z", "Ë"}, + {"I~Y~-19H~-5V¨~Z", "Ï"}, + {"O~Y~-26H~-8V¨~Z", "Ö"}, + {"o~Y~-26H~-4V¨~Z", "ö"}, + {"U~Y~-25H~-8V¨~Z", "Ü"}, + {"u~Y~-24H~-3V¨~Z", "ü"}, + + // dakuten katakana + {"~Yウ~Z゛", "ヴ"}, + {"~Yカ~Z゛", "ガ"}, + {"~Yキ~Z゛", "ギ"}, + {"~Yク~Z゛", "グ"}, + {"~Yケ~Z゛", "ゲ"}, + {"~Yコ~Z゛", "ゴ"}, + {"~Yサ~Z゛", "ザ"}, + {"~Yシ~Z゛", "ジ"}, + {"~Yス~Z゛", "ズ"}, + {"~Yセ~Z゛", "ゼ"}, + {"~Yソ~Z゛", "ゾ"}, + {"~Yタ~Z゛", "ダ"}, + {"~Yチ~Z゛", "ヂ"}, + {"~Yツ~Z゛", "ヅ"}, + {"~Yテ~Z゛", "デ"}, + {"~Yト~Z゛", "ド"}, + {"~Yハ~Z゛", "バ"}, + {"~Yヒ~Z゛", "ビ"}, + {"~Yフ~Z゛", "ブ"}, + {"~Yヘ~Z゛", "ベ"}, + {"~Yホ~Z゛", "ボ"}, + // handakuten katakana + {"~Yハ~Z゜", "パ"}, + {"~Yヒ~Z゜", "ピ"}, + {"~Yフ~Z゜", "プ"}, + {"~Yヘ~Z゜", "ペ"}, + {"~Yホ~Z゜", "ポ"}, + // dakuten hiragana + {"~Yか~Z゛", "が"}, + {"~Yき~Z゛", "ぎ"}, + {"~Yく~Z゛", "ぐ"}, + {"~Yけ~Z゛", "げ"}, + {"~Yこ~Z゛", "ご"}, + {"~Yさ~Z゛", "ざ"}, + {"~Yし~Z゛", "じ"}, + {"~Yす~Z゛", "ず"}, + {"~Yせ~Z゛", "ぜ"}, + {"~Yそ~Z゛", "ぞ"}, + {"~Yた~Z゛", "だ"}, + {"~Yち~Z゛", "ぢ"}, + {"~Yつ~Z゛", "づ"}, + {"~Yて~Z゛", "で"}, + {"~Yと~Z゛", "ど"}, + {"~Yは~Z゛", "ば"}, + {"~Yひ~Z゛", "び"}, + {"~Yふ~Z゛", "ぶ"}, + {"~Yへ~Z゛", "べ"}, + {"~Yほ~Z゛", "ぼ"}, + // handakuten hiragana + {"~Yは~Z゜", "ぱ"}, + {"~Yひ~Z゜", "ぴ"}, + {"~Yふ~Z゜", "ぷ"}, + {"~Yへ~Z゜", "ぺ"}, + {"~Yほ~Z゜", "ぽ"}, + // japanese punctuation + {",~+8H", "、"}, + {"~+8H ", " "}, + + // (hack) special case kanji + {"~~", "世"}, + + // playstation buttons + // - face + {"~Y~22L<~Z~Y~27L*~Z~Y~1L>~Z~Y~23L[~Z~+26H", ""}, + {"~Y~22L<~Z~Y~26L;~Z~Y~1L>~Z~Y~23L[~Z~+26H", ""}, + {"~Y~22L<~Z~Y~25L@~Z~Y~1L>~Z~Y~23L[~Z~+26H", ""}, + {"~Y~22L<~Z~Y~24L#~Z~Y~1L>~Z~Y~23L[~Z~+26H", ""}, + // - dpad + {"~Y~22L~Z~3L~+17H~-13V~Z~22L~+17H~+14V~Z~22L~+32H~Z~+56H", + ""}, + {"~Y~22L~Z~3L~+17H~-13V~Z~3L~+17H~+14V~Z~22L~+32H~Z~+56H", + ""}, + {"~Y~22L~Z~22L~+17H~-13V~Z~22L~+17H~+14V~Z~22L~+32H~Z~+56H", + ""}, + // - shoulder + {"~Y~22L~-2H~-12V~Z~22L~-2H~+17V~Z~1L~+4H~+3V~Z~+38H", + ""}, + {"~Y~22L~-2H~-12V~Z~22L~-2H~+17V~Z~1L~+6H~+3V~Z~+38H", + ""}, + {"~Y~22L~-2H~-6V~Z~22L~-2H~+16V~Z~1L~+5H~-2V~Z~+38H", + ""}, + {"~Y~22L~-2H~-6V~Z~22L~-2H~+16V~Z~1L~+5H~-2V~Z~+38H", + ""}, + // - analog + {"~1L~+8H~Y~Z~6L~-16H~Z~+16h~6L~Z~6L~-15V~Z~+13V~6L~Z~-10H~+" + "9V~" + "6L~Z~+10H~+9V~6L~Z~-10H~-11V~6L~Z~+10H~-11V~6L~Z~+32H", + ""}, + {"~Y~1L~+8H~Z~6L~-8H~Z~+24H~6L~Z~+40H", ""}, + {"~Y~1L~Z~6L~-15V~Z~+13V~6L~Z~+26H", ""}, + + // icons + {"~Y~6L<~Z~Y~1L>~Z~Y~23L[~Z~+26H", ""}, + {"~Y~3L<~Z~Y~1L>~Z~Y~23L[~Z~+26H", ""}, + + // flags + {"~Y~6L~Z~+15H~1L~Z~+30H~3L~Z~+45H", ""}, + {"~Y~5L~Z~3L~~-1H~Y~5L~Z~3L~Z~+26H", ""}, + {"~Y~39L~~~Z~3L~Z~5L~~-1H~Y~39L~~~Z~3L~Z~5L~Z~+26H", + ""}, + {"~Y~7L~Z~+15H~1L~Z~+30H~3L~Z~+47H", ""}, + {"~Y~1L~Z~3L~Z~7L~~-1H~Y~1L~Z~3L~Z~7L~Z~+26H", + ""}, + {"~Y~1L~Z~3L~Z~7L~~-1H~Y~1L~Z~3L~Z~+26H", + ""}, + {"~Y~1L~Z~39L~~-1H~Y~1L~Z~39L~Z~-11H~7L~Z~-11H~3L<" + "SYM43>~Z~+26H", + ""}, + {"~Y~1L~~-1H~Y~1L~Z~-11H~3L~Z~+26H", ""}, + + // weird stuff + // - descenders + {"~+7Vp~-7V", "p"}, + {"~+7Vy~-7V", "y"}, + {"~+7Vg~-7V", "g"}, + {"~+7Vq~-7V", "q"}, + {"~+1Vj~-1V", "j"}, + + {"\\\\\\\\", "\\n"}, + + // - symbols and ligatures + {"~-4H~-3V\\c19~+3V~-4H", + ""}, // used for the 4<__> place in spanish. the 5th uses the same + // character but looks different...? + {"~Y~-6Hº~Z~+10H", "°"}, + + // Color / Emphasis + {"~[~1L", ""}, + {"~[~32L", ""}}; + +static std::vector s_encode_info_jak2 = { + {"_", {0x03}}, // large space + {"ˇ", {0x10}}, // caron + {"`", {0x11}}, // grave accent + {"'", {0x12}}, // apostrophe + {"^", {0x13}}, // circumflex + {"", {0x14}}, // tilde + {"¨", {0x15}}, // umlaut + {"º", {0x16}}, // numero/overring + {"¡", {0x17}}, // inverted exclamation mark + {"¿", {0x18}}, // inverted question mark + {"Ç", {0x1d}}, // c-cedilla + + {"ß", {0x1f}}, // eszett + + {"œ", {0x5e}}, // ligature o+e + // Re-purposed japanese/korean symbols that are used as part of drawing icons/flags/pad buttons + // TODO - japanese and korean encodings + {"", {0x5d}}, + + {"", {0x7f}}, + {"", {0x80}}, + {"", {0x81}}, + + {"", {0x85}}, + {"", {0x86}}, + {"", {0x87}}, + {"", {0x88}}, + {"", {0x89}}, + {"", {0x8a}}, + {"", {0x8b}}, + {"", {0x8c}}, + {"", {0x8d}}, + {"", {0x8e}}, + {"", {0x8f}}, + {"", {0x90}}, + {"", {0x91}}, + + {"", {0x94}}, + {"", {0x95}}, + {"", {0x96}}, + {"", {0x97}}, + {"", {0x98}}, + {"", {0x99}}, + {"", {0x9a}}, + {"", {0x9b}}, + {"", {0x9c}}, + {"", {0x9d}}, + {"", {0x9e}}, + {"", {0x9f}}, + {"", {0xa0}}, + {"", {0xa1}}, + {"", {0xa2}}, + {"", {0xa3}}, + {"", {0xa4}}, + {"", {0xa5}}, + {"", {0xa6}}, + {"", {0xa7}}, + {"", {0xa8}}, + {"", {0xa9}}, + {"", {0xb0}}, + {"", {0xb1}}, + {"", {0xb3}}, + {"", {0xb2}}, +}; GameTextFontBank g_font_bank_jak2(GameTextVersion::JAK2, - &s_encode_info_null, - &s_replace_info_null, - &s_passthrus); + &s_encode_info_jak2, + //&s_replace_info_null, + &s_replace_info_jak2, + &s_passthrus_jak2); /*! * ======================== @@ -830,7 +1115,7 @@ GameTextFontBank g_font_bank_jak2(GameTextVersion::JAK2, */ std::map g_font_banks = { - {GameTextVersion::JAK1_V1, &g_font_bank_jak1}, + {GameTextVersion::JAK1_V1, &g_font_bank_jak1_v1}, {GameTextVersion::JAK1_V2, &g_font_bank_jak1_v2}, {GameTextVersion::JAK2, &g_font_bank_jak2}}; diff --git a/common/util/FontUtils.h b/common/util/FontUtils.h index fa23ddde2d..3d167fc150 100644 --- a/common/util/FontUtils.h +++ b/common/util/FontUtils.h @@ -75,6 +75,10 @@ class GameTextFontBank { GameTextVersion version() const { return m_version; } + // TODO - methods would help make this code a lot better for different game versions + // hacking it for now + bool valid_char_range(const char in) const; + std::string convert_utf8_to_game_with_escape(const std::string& str) const; std::string convert_utf8_to_game(std::string str) const; std::string convert_game_to_utf8(const char* in) const; diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 509d66b571..fe4a46229b 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -1360,23 +1360,41 @@ void SimpleExpressionElement::update_from_stack_mult_si(const Env& env, FormStack& stack, std::vector* result, bool allow_side_effects) { - auto arg0_i = is_int_type(env, m_my_idx, m_expr.get_arg(0).var()); - auto arg1_i = is_int_type(env, m_my_idx, m_expr.get_arg(1).var()); + if (m_expr.get_arg(0).is_int()) { + // annoyingly there's a mult3 v1, r0, v1 in jak 2. + auto arg1_i = is_int_type(env, m_my_idx, m_expr.get_arg(1).var()); - auto args = pop_to_forms({m_expr.get_arg(0).var(), m_expr.get_arg(1).var()}, env, pool, stack, - allow_side_effects); + auto args = pop_to_forms({m_expr.get_arg(1).var()}, env, pool, stack, allow_side_effects); - if (!arg0_i) { - args.at(0) = pool.form(TypeSpec("int"), args.at(0)); + if (!arg1_i) { + args.at(0) = pool.form(TypeSpec("int"), args.at(1)); + } + + auto new_form = pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::MULTIPLICATION), + pool.form(SimpleAtom::make_int_constant(m_expr.get_arg(0).get_int())), + args.at(0)); + + result->push_back(new_form); + } else { + auto arg0_i = is_int_type(env, m_my_idx, m_expr.get_arg(0).var()); + auto arg1_i = is_int_type(env, m_my_idx, m_expr.get_arg(1).var()); + + auto args = pop_to_forms({m_expr.get_arg(0).var(), m_expr.get_arg(1).var()}, env, pool, stack, + allow_side_effects); + + if (!arg0_i) { + args.at(0) = pool.form(TypeSpec("int"), args.at(0)); + } + + if (!arg1_i) { + args.at(1) = pool.form(TypeSpec("int"), args.at(1)); + } + + auto new_form = pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::MULTIPLICATION), args.at(0), args.at(1)); + result->push_back(new_form); } - - if (!arg1_i) { - args.at(1) = pool.form(TypeSpec("int"), args.at(1)); - } - - auto new_form = pool.alloc_element( - GenericOperator::make_fixed(FixedOperatorKind::MULTIPLICATION), args.at(0), args.at(1)); - result->push_back(new_form); } void SimpleExpressionElement::update_from_stack_force_si_2(const Env& env, diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index c5a3809053..61e5864c4c 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -1127,7 +1127,7 @@ (deftype vector4w-4 (structure) ((data int32 16 :offset-assert 0) (quad uint128 4 :offset 0) - (vector vector4w 4 :inline :offset 0) + (vector vector4w 4 :inline :offset 0 :score 999) ) :method-count-assert 9 :size-assert #x40 @@ -1648,7 +1648,7 @@ (define-extern matrix-rotate-yx! (function matrix float float matrix)) (define-extern matrix-axis-sin-cos-vu! (function matrix vector float float none)) (define-extern matrix-axis-sin-cos! (function matrix vector float float matrix)) -(define-extern matrix-axis-angle! (function matrix vector float none)) +(define-extern matrix-axis-angle! (function matrix vector float matrix)) (define-extern matrix-lerp! (function matrix matrix matrix float matrix)) (define-extern matrix-3x3-determinant (function matrix float)) (define-extern matrix3-determinant (function matrix float)) @@ -3081,7 +3081,7 @@ (debug-no-zbuf1 318) ;; debug, no zbuf (tex-all-map 319) ;; tex - (bucket-320 320) ;; hud + (bucket-320 320) ;; hud | progress (screen-filter 321) ;; hud letterbox, no zbuf (bucket-322 322) ;; hud (bucket-323 323) ;; hud @@ -5645,225 +5645,6 @@ ;; level-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defenum game-text-id - :type uint32 - :bitfield #f -;; GAME-TEXT-ID ENUM BEGINS - (null 0) - - (pause #x0101) - - (text-x180 #x0180) - (text-x181 #x0181) - (text-x182 #x0182) - (text-x183 #x0183) - (text-x184 #x0184) - (text-x185 #x0185) - (text-x186 #x0186) - (text-x187 #x0187) - (text-x188 #x0188) - (text-x189 #x0189) - (text-x18a #x018a) - (text-x18b #x018b) - (text-x18c #x018c) - (text-x18d #x018d) - (text-x18e #x018e) - (text-x18f #x018f) - (text-x190 #x0190) - (text-x191 #x0191) - (text-x192 #x0192) - (text-x193 #x0193) - (text-x194 #x0194) - (text-x195 #x0195) - (text-x196 #x0196) - (text-x197 #x0197) - (text-x198 #x0198) - (text-x199 #x0199) - (text-x19a #x019a) - (text-x19b #x019b) - (text-x19c #x019c) - (text-x19d #x019d) - (text-x19e #x019e) - (text-x19f #x019f) - (text-x1a0 #x01a0) - (text-x1a1 #x01a1) - (text-x1a2 #x01a2) - (text-x1a3 #x01a3) - (text-x1a4 #x01a4) - (text-x1a5 #x01a5) - (text-x1a6 #x01a6) - (text-x1a7 #x01a7) - (text-x1a8 #x01a8) - (text-x1a9 #x01a9) - (text-x1aa #x01aa) - (text-x1ab #x01ab) - (text-x1ac #x01ac) - (text-x1ad #x01ad) - (text-x1ae #x01ae) - (text-x1af #x01af) - (text-x1b0 #x01b0) - (text-x1b1 #x01b1) - (text-x1b2 #x01b2) - (text-x1b3 #x01b3) - (text-x1b4 #x01b4) - (text-x1b5 #x01b5) - (text-x1b6 #x01b6) - (text-x1b7 #x01b7) - (text-x1b8 #x01b8) - (text-x1b9 #x01b9) - (text-x1ba #x01ba) - (text-x1bb #x01bb) - (text-x1bc #x01bc) - (text-x1bd #x01bd) - (text-x1be #x01be) - (text-x1bf #x01bf) - (text-x1c0 #x01c0) - (text-x1c1 #x01c1) - (text-x1c2 #x01c2) - (text-x1c3 #x01c3) - (text-x1c4 #x01c4) - (text-x1c5 #x01c5) - (text-x1c6 #x01c6) - (text-x1c7 #x01c7) - (text-x1c8 #x01c8) - (text-x1c9 #x01c9) - (text-x1ca #x01ca) - (text-x1cb #x01cb) - (text-x1cc #x01cc) - (text-x1cd #x01cd) - (text-x1ce #x01ce) - (text-x1cf #x01cf) - (text-x1d0 #x01d0) - (text-x1d1 #x01d1) - (text-x1d2 #x01d2) - (text-x1d3 #x01d3) - (text-x1d4 #x01d4) - (text-x1d5 #x01d5) - (text-x1d6 #x01d6) - (text-x1d7 #x01d7) - (text-x1d8 #x01d8) - (text-x1d9 #x01d9) - (text-x1da #x01da) - (text-x1db #x01db) - (text-x1dc #x01dc) - (text-x1dd #x01dd) - (text-x1de #x01de) - (text-x1df #x01df) - (text-x1e0 #x01e0) - (text-x1e1 #x01e1) - (text-x1e2 #x01e2) - (text-x1e3 #x01e3) - (text-x1e4 #x01e4) - (text-x1e5 #x01e5) - (text-x1e6 #x01e6) - (text-x1e7 #x01e7) - (text-x1e8 #x01e8) - (text-x1e9 #x01e9) - (text-x1ea #x01ea) - (text-x1eb #x01eb) - (text-x1ec #x01ec) - (text-x1ed #x01ed) - (text-x1ee #x01ee) - (text-x1ef #x01ef) - (text-x1f0 #x01f0) - (text-x1f1 #x01f1) - (text-x1f2 #x01f2) - (text-x1f3 #x01f3) - (text-x1f4 #x01f4) - (text-x1f5 #x01f5) - (text-x1f6 #x01f6) - (text-x1f7 #x01f7) - (text-x1f8 #x01f8) - (text-x1f9 #x01f9) - (text-x1fa #x01fa) - (text-x1fb #x01fb) - (text-x1fc #x01fc) - (text-x1fd #x01fd) - (text-x1fe #x01fe) - (text-x1ff #x01ff) - (text-x200 #x0200) - (text-x201 #x0201) - (text-x202 #x0202) - (text-x203 #x0203) - (text-x204 #x0204) - (text-x205 #x0205) - (text-x206 #x0206) - (text-x207 #x0207) - (text-x208 #x0208) - (text-x209 #x0209) - (text-x20a #x020a) - (text-x20b #x020b) - (text-x20c #x020c) - (text-x20d #x020d) - (text-x20e #x020e) - (text-x20f #x020f) - (text-x210 #x0210) - (text-x211 #x0211) - (text-x212 #x0212) - (text-x213 #x0213) - (text-x214 #x0214) - (text-x215 #x0215) - (text-x216 #x0216) - (text-x217 #x0217) - (text-x218 #x0218) - (text-x219 #x0219) - (text-x21a #x021a) - (text-x21b #x021b) - (text-x21c #x021c) - (text-x21d #x021d) - (text-x21e #x021e) - (text-x21f #x021f) - (text-x220 #x0220) - (text-x221 #x0221) - (text-x222 #x0222) - (text-x223 #x0223) - (text-x224 #x0224) - (text-x225 #x0225) - (text-x226 #x0226) - (text-x227 #x0227) - (text-x228 #x0228) - (text-x229 #x0229) - (text-x22a #x022a) - (text-x22b #x022b) - (text-x22c #x022c) - (text-x22d #x022d) - (text-x22e #x022e) - (text-x22f #x022f) - (text-x230 #x0230) - (text-x231 #x0231) - (text-x232 #x0232) - (text-x233 #x0233) - (text-x234 #x0234) - (text-x235 #x0235) - (text-x236 #x0236) - (text-x237 #x0237) - (text-x238 #x0238) - (text-x239 #x0239) - (text-x23a #x023a) - (text-x23b #x023b) - (text-x23c #x023c) - (text-x23d #x023d) - (text-x23e #x023e) - (text-x23f #x023f) - (text-x240 #x0240) - (text-x241 #x0241) - (text-x242 #x0242) - (text-x243 #x0243) - (text-x244 #x0244) - (text-x245 #x0245) - (text-x246 #x0246) - (text-x247 #x0247) - (text-x248 #x0248) - (text-x249 #x0249) - (text-x24a #x024a) - (text-x24b #x024b) - (text-x24c #x024c) - (text-x24d #x024d) - (text-x24e #x024e) - (text-x24f #x024f) -;; GAME-TEXT-ID ENUM ENDS - ) - (declare-type bsp-header basic) (defenum vis-info-flag @@ -6069,6 +5850,7 @@ ) (declare-type engine basic) +(declare-type game-text-id uint32) (deftype level (basic) ((name symbol :offset-assert 4) (load-name string :offset-assert 8) @@ -6801,6 +6583,285 @@ ;; text-id-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +++text-id-h:game-text-id +(defenum game-text-id + :type uint32 + :bitfield #f + (null 0) + (pause 257) + (progress-sound-music-volume 264) + (progress-sound-speech-volume 265) + (progress-on 270) + (progress-off 271) + (progress-move-dpad 272) + (progress-aspect-ratio 280) + (progress-progressive-scan 281) + (progress-video-mode 282) + (progress-root-game-options 283) + (progress-root-graphic-options 284) + (progress-root-sound-options 285) + (progress-aspect-4x3 286) + (progress-aspect-16x9 287) + (progress-refresh-60hz 288) + (progress-refresh-50hz 289) + (progress-demo-exit 291) + (progress-yes 292) + (progress-no 293) + (progress-back 294) + (progress-ok 295) + (progress-next 296) + (progress-previous 297) + (progress-continue-without-saving 298) + (progress-select-file-to-save 299) + (progress-select-file-to-load 300) + (progress-load-game 301) + (progress-save-game 302) + (progress-slot-empty 303) + (progress-title-options 304) + (progress-title-new-game 305) + (progress-title-prompt 306) + (progress-quit 307) + (progress-root-show-map 308) + (progress-root-highscores 310) + (progress-highscores-1st 311) + (progress-highscores-2nd 312) + (progress-highscores-3rd 313) + (progress-highscores-4th 314) + (progress-highscores-5th 315) + (progress-highscores-6th 316) + (progress-highscores-7th 317) + (progress-highscores-8th 318) + (progress-root-secrets 339) + (progress-secrets-unlocked 340) + (progress-main-secrets-hero-mode 345) + (progress-main-secrets-sceneplayer-1 346) + (progress-main-secrets-sceneplayer-2 347) + (progress-main-secrets-sceneplayer-3 348) + (progress-main-secrets-scrapbook 349) + (progress-main-secrets-mega-scrapbook 350) + (progress-main-secrets-scrapbook-3 351) + (progress-main-secrets-levelselect 352) + (progress-secrets-orb-label 360) + (progress-root-missions 361) + (progress-root-restart-mission 366) + (progress-missions-icon-todo 367) + (progress-missions-icon-completed 368) + (progress-missions-none 369) + (progress-unknown-game 370) + (progress-unknown-square-to-reset 377) + (progress-unknown-oi1un23i13 380) + (progress-unknown-kjanskd 381) + (progress-unknown-retry? 382) + (progress-secrets-go-to-title-screen 383) + (text-x180 #x0180) + (text-x181 #x0181) + (text-x182 #x0182) + (text-x183 #x0183) + (text-x184 #x0184) + (text-x185 #x0185) + (text-x186 #x0186) + (text-x187 #x0187) + (text-x188 #x0188) + (text-x189 #x0189) + (text-x18a #x018a) + (text-x18b #x018b) + (progress-graphics-60hz-change-notice 395) + (progress-graphics-progressivescan-change-notice 396) + (progress-graphics-progressivescan-warning-1 397) + (progress-graphics-progressivescan-warning-2 398) + (progress-graphics-60hz-change-complete 399) + (progress-graphics-progressivescan-change-complete 400) + (progress-graphics-mode-revert? 401) + (progress-disc-removed-notice 402) + (progress-disc-removed-prompt 403) + (progress-disc-read-error 404) + (progress-disc-read-error-prompt 405) + (progress-quit-game-confirm 406) + (progress-memcard-not-found 409) + (progress-memcard-unformatted 410) + (progress-memcard-space-requirement 411) + (progress-memcard-insert-card-with-jak2 412) + (progress-memcard-insert-card-with-space-to-save 413) + (progress-memcard-formatting-required-notice 414) + (progress-memcard-loading-data 416) + (text-x1a1 #x01a1) + (text-x1a2 #x01a2) + (progress-memcard-dont-remove 419) + (progress-memcard-overwrite-warning 420) + (progress-memcard-overwrite-confirm 421) + (progress-memcard-format-prompt 422) + (progress-memcard-continue? 423) + (progress-memcard-go-back? 424) + (progress-memcard-error-while-saving 426) + (text-x1ab #x01ab) + (text-x1ac #x01ac) + (progress-memcard-check 429) + (progress-memcard-check-and-try-again 430) + (progress-memcard-was-removed 431) + (progress-autosave-disabled 432) + (progress-autosave-reenabling-info 433) + (progress-memcard-no-jak2-found 434) + (progress-memcard-create-jak2-file? 435) + (progress-autosave-explanation 436) + (progress-autosave-dont-remove 437) + (text-x1b6 #x01b6) + (text-x1b7 #x01b7) + (text-x1b8 #x01b8) + (text-x1b9 #x01b9) + (text-x1ba #x01ba) + (text-x1bb #x01bb) + (text-x1bc #x01bc) + (text-x1bd #x01bd) + (text-x1be #x01be) + (text-x1bf #x01bf) + (text-x1c0 #x01c0) + (text-x1c1 #x01c1) + (text-x1c2 #x01c2) + (text-x1c3 #x01c3) + (text-x1c4 #x01c4) + (text-x1c5 #x01c5) + (text-x1c6 #x01c6) + (text-x1c7 #x01c7) + (text-x1c8 #x01c8) + (text-x1c9 #x01c9) + (text-x1ca #x01ca) + (text-x1cb #x01cb) + (text-x1cc #x01cc) + (text-x1cd #x01cd) + (text-x1ce #x01ce) + (text-x1cf #x01cf) + (text-x1d0 #x01d0) + (text-x1d1 #x01d1) + (text-x1d2 #x01d2) + (text-x1d3 #x01d3) + (text-x1d4 #x01d4) + (text-x1d5 #x01d5) + (text-x1d6 #x01d6) + (text-x1d7 #x01d7) + (text-x1d8 #x01d8) + (text-x1d9 #x01d9) + (text-x1da #x01da) + (text-x1db #x01db) + (text-x1dc #x01dc) + (text-x1dd #x01dd) + (text-x1de #x01de) + (text-x1df #x01df) + (text-x1e0 #x01e0) + (text-x1e1 #x01e1) + (text-x1e2 #x01e2) + (text-x1e3 #x01e3) + (text-x1e4 #x01e4) + (text-x1e5 #x01e5) + (text-x1e6 #x01e6) + (text-x1e7 #x01e7) + (text-x1e8 #x01e8) + (text-x1e9 #x01e9) + (text-x1ea #x01ea) + (text-x1eb #x01eb) + (text-x1ec #x01ec) + (text-x1ed #x01ed) + (text-x1ee #x01ee) + (text-x1ef #x01ef) + (text-x1f0 #x01f0) + (text-x1f1 #x01f1) + (text-x1f2 #x01f2) + (text-x1f3 #x01f3) + (text-x1f4 #x01f4) + (text-x1f5 #x01f5) + (text-x1f6 #x01f6) + (text-x1f7 #x01f7) + (text-x1f8 #x01f8) + (text-x1f9 #x01f9) + (text-x1fa #x01fa) + (text-x1fb #x01fb) + (text-x1fc #x01fc) + (text-x1fd #x01fd) + (text-x1fe #x01fe) + (text-x1ff #x01ff) + (text-x200 #x0200) + (text-x201 #x0201) + (text-x202 #x0202) + (text-x203 #x0203) + (text-x204 #x0204) + (text-x205 #x0205) + (text-x206 #x0206) + (text-x207 #x0207) + (text-x208 #x0208) + (text-x209 #x0209) + (text-x20a #x020a) + (text-x20b #x020b) + (text-x20c #x020c) + (text-x20d #x020d) + (text-x20e #x020e) + (text-x20f #x020f) + (text-x210 #x0210) + (text-x211 #x0211) + (text-x212 #x0212) + (text-x213 #x0213) + (progress-locations-haven-city 531) + (progress-locations-fortress 532) + (progress-locations-landing-pad 533) + (progress-locations-palace-roof 534) + (progress-locations-palace 535) + (progress-locations-weapons-factory 536) + (progress-locations-dead-town 537) + (progress-locations-pumping-station 538) + (progress-locations-sewer 539) + (progress-locations-strip-mine 540) + (progress-locations-mountain-temple 541) + (progress-locations-haven-forest 542) + (progress-locations-drill-platform 543) + (progress-locations-mars-tomb 544) + (progress-locations-dig 545) + (progress-locations-underport 546) + (progress-locations-nest 547) + (text-x224 #x0224) + (text-x225 #x0225) + (text-x226 #x0226) + (text-x227 #x0227) + (text-x228 #x0228) + (text-x229 #x0229) + (text-x22a #x022a) + (text-x22b #x022b) + (text-x22c #x022c) + (text-x22d #x022d) + (text-x22e #x022e) + (text-x22f #x022f) + (text-x230 #x0230) + (text-x231 #x0231) + (text-x232 #x0232) + (text-x233 #x0233) + (text-x234 #x0234) + (text-x235 #x0235) + (text-x236 #x0236) + (text-x237 #x0237) + (text-x238 #x0238) + (text-x239 #x0239) + (text-x23a #x023a) + (text-x23b #x023b) + (text-x23c #x023c) + (text-x23d #x023d) + (text-x23e #x023e) + (text-x23f #x023f) + (text-x240 #x0240) + (text-x241 #x0241) + (text-x242 #x0242) + (text-x243 #x0243) + (text-x244 #x0244) + (text-x245 #x0245) + (text-x246 #x0246) + (text-x247 #x0247) + (text-x248 #x0248) + (text-x249 #x0249) + (text-x24a #x024a) + (text-x24b #x024b) + (text-x24c #x024c) + (text-x24d #x024d) + (text-x24e #x024e) + (text-x24f #x024f) + (progress-unknown-continue 784) +) +;; ---text-id-h:game-text-id ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; text-h ;; @@ -7402,7 +7463,7 @@ (new (symbol type) _type_ 0) (initialize (_type_) none 9) ;; some sort of init? (update (_type_) none 10) - (bigmap-method-11 () none 11) + (bigmap-method-11 (_type_ int int int int) none 11) (bigmap-method-12 () none 12) (bigmap-method-13 () none 13) (bigmap-method-14 (_type_) none 14) @@ -11083,7 +11144,7 @@ (get-skeleton-origin (_type_) vector 9) (draw-control-method-10 () none 10) ;; (lod-set! (_type_ int) none 10) (draw-control-method-11 () none 11) ;; (lods-assign! (_type_ lod-set) none 11) - (draw-control-method-12 (_type_ int int) none 12) + (draw-control-method-12 (_type_ uint int) none 12) (draw-control-method-13 () none 13) (draw-control-method-14 (_type_ cspace-array joint-control) none 14) ) @@ -12436,27 +12497,29 @@ ) ) +;; +++memcard-h:mc-status-code (defenum mc-status-code :type uint32 - ;; (busy 0) + (busy 0) (ok 1) - ; (bad-handle 2) - ; (format-failed 3) - ; (internal-error 4) - ; (write-error 5) - ; (read-error 6) - ; (new-game 7) - ; (no-memory 8) - ; (no-card 9) - ; (no-last 10) - ; (no-format 11) - ; (no-file 12) - ; (no-save 13) - ; (no-space 14) - ; (bad-version 15) - ; (no-process 16) - ; (no-auto-save 17) + (bad-handle 2) + (format-failed 3) + (internal-error 4) + (write-error 5) + (read-error 6) + (new-game 7) + (no-memory 8) + (no-card 9) + (no-last 10) + (no-format 11) + (no-file 12) + (no-save 13) + (no-space 14) + (bad-version 15) + (no-process 16) + (no-auto-save 17) ) +;; ---memcard-h:mc-status-code (declare-type entity-perm-array inline-array-class) (declare-type continue-point basic) @@ -12532,7 +12595,7 @@ (debug-features game-feature :offset-assert 136) (secrets game-secrets :offset-assert 144) (unknown-pad1 uint32) - (purchase-secrets uint32 :offset-assert 152) + (purchase-secrets game-secrets :offset-assert 152) (unknown-pad2 uint32 :offset-assert 156) (gun-type int32 :offset-assert 160) (gun-ammo float 4 :offset-assert 164) @@ -12551,7 +12614,7 @@ (last-continue continue-point :offset-assert 244) (play-list (array game-task-info) :offset-assert 248) (sub-task-list (array game-task-node-info) :offset-assert 252) - (unknown-pad5 (array game-task-node-info) :offset-assert 256) + (mission-list (array game-task-node-info) :offset-assert 256) (task-counter uint32 :offset-assert 260) (unknown-pad6 (array uint16) :offset-assert 264) (level-opened uint8 32 :offset-assert 268) @@ -12574,7 +12637,7 @@ (letterbox-time time-frame :offset-assert 400) (hint-play-time time-frame :offset-assert 408) (display-text-time time-frame :offset-assert 416) - (display-text-handle uint64 :offset-assert 424) + (display-text-handle handle :offset-assert 424) (death-movie-tick int32 :offset-assert 432) (want-auto-save symbol :offset-assert 436) (auto-save-proc handle :offset-assert 440) @@ -16961,11 +17024,11 @@ (get-trans "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]]" (_type_ int) vector 20) - (get-quat (_type_) quaternion 21) + (get-quat (_type_ int) quaternion 21) (get-transv (_type_) vector 22) (process-focusable-method-23 (_type_) none 23) - (process-focusable-method-24 (_type_) none 24) - (process-focusable-method-25 (_type_) int 25) + (process-focusable-method-24 (_type_) float 24) + (process-focusable-method-25 (_type_) time-frame 25) (process-focusable-method-26 (_type_) none 26) ) ) @@ -19977,7 +20040,7 @@ (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector 19) (tracking-spline-method-20 (_type_ vector int) none 20) (tracking-spline-method-21 (_type_ vector float float float) vector 21) - (tracking-spline-method-22 (_type_ float) none 22) + (tracking-spline-method-22 (_type_ float) symbol 22) ;; TODO - probably wrong! (debug-draw-spline (_type_) none 23) ) ) @@ -20195,7 +20258,7 @@ (:methods (camera-master-method-14 (_type_ vector) vector 14) (camera-master-method-15 (_type_ vector) vector 15) - (camera-master-method-16 (_type_ symbol) none 16) + (camera-master-method-16 (_type_ symbol) int 16) ) ) @@ -20282,7 +20345,7 @@ :size-assert #x34 :flag-assert #xb00000034 (:methods - (hud-sprite-method-9 () none 9) + (hud-sprite-method-9 (_type_ dma-buffer level) none 9) (hud-sprite-method-10 () none 10) ) ) @@ -20296,13 +20359,13 @@ :size-assert #x20 :flag-assert #x1000000020 (:methods - (hud-box-method-9 () none 9) + (hud-box-method-9 (_type_ dma-buffer) none 9) (hud-box-method-10 () none 10) (hud-box-method-11 () none 11) (hud-box-method-12 () none 12) (hud-box-method-13 (_type_ dma-buffer float) int 13) - (hud-box-method-14 () none 14) - (hud-box-method-15 () none 15) + (hud-box-method-14 (_type_) none 14) + (hud-box-method-15 (_type_) none 15) ) ) @@ -20852,22 +20915,28 @@ ) (deftype menu-option (basic) - ((name uint32 :offset-assert 4) - (scale basic :offset-assert 8) - (box bounding-box 1 :inline :offset-assert 16) ;; no idea + ((name game-text-id :offset-assert 4) + (scale float :offset-assert 8) + (unknown function :offset-assert 12) + ;; This is gross if im correct + ;; this HAS to have a bunch of `menu-option`s -- look at `(method 24 progress)` and `(method 25 progress)` + ;; - i think it might just be that each menu "page" can have 8 menu-options on it? + ;; but the drawing code also heavily implies it can also be a `hud-box` (finally the `box` name makes sense) + (box hud-box 1 :inline :offset-assert 16) + (options menu-option 8 :offset 16) ) :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 (:methods - (respond-progress "Handle progress menu navigation logic." (_type_ progress object symbol) int 9) - (menu-option-method-10 () none 10) + (respond-progress "Handle progress menu navigation logic." (_type_ progress object) int :behavior progress 9) + (menu-option-method-10 (_type_ progress font-context int symbol) none 10) (menu-option-method-11 () none 11) ) ) (deftype menu-on-off-option (menu-option) - ((value-to-modify pointer :offset-assert 48) + ((value-to-modify (pointer symbol) :offset-assert 48) ) :method-count-assert 12 :size-assert #x34 @@ -20887,8 +20956,8 @@ ) (deftype menu-language-option (menu-option) - ((language-selection uint64 :offset-assert 48) - (language-direction basic :offset-assert 56) + ((language-selection language-enum :offset-assert 48) + (language-direction symbol :offset-assert 56) (language-transition basic :offset-assert 60) (language-x-offset int32 :offset-assert 64) ) @@ -20979,7 +21048,7 @@ ) (deftype menu-memcard-slot-option (menu-option) - ((sprites hud-sprite 5 :inline :offset-assert 48) ;; total guess + ((sprites hud-sprite 5 :inline :offset-assert 48 :score 999) ;; total guess (pad uint8 32) ) :method-count-assert 12 @@ -21229,7 +21298,7 @@ (prev-item-index int32 :offset-assert 52) (num-items int32 :offset-assert 56) (num-hero-items int32 :offset-assert 60) - (secret-items basic :offset-assert 64) + (secret-items (array secret-item-option) :offset-assert 64) (last-move uint64 :offset-assert 72) (sprites hud-sprite 2 :inline :offset-assert 80) ) @@ -21240,11 +21309,13 @@ ) ) +;; ohhhh man i wish OpenGOAL had generics -- would be awesome if you could create a menu-option-list +;; for example, and then `options T ...` and then everything could just figure it out with type safety (deftype menu-option-list (basic) ((y-center int32 :offset-assert 4) (y-space int32 :offset-assert 8) (scale float :offset-assert 12) - (options menu-option :dynamic :offset-assert 16) ;; dynamic is a guess + (options menu-option :dynamic :offset-assert 16) ) :method-count-assert 9 :size-assert #x10 @@ -21253,7 +21324,7 @@ (deftype menu-qr-option (menu-option) ((last-move uint64 :offset-assert 48) - (value-to-modify uint32 :offset 60) + (value-to-modify function :offset 60) ) :method-count-assert 12 :size-assert #x40 @@ -22978,7 +23049,7 @@ (define-extern debug-reset-buffers (function symbol)) (define-extern debug-draw-buffers (function symbol)) (define-extern add-debug-line (function symbol bucket-id vector vector rgba symbol rgba symbol)) -(define-extern add-debug-line2d (function symbol bucket-id vector vector vector symbol)) +(define-extern add-debug-line2d (function symbol bucket-id vector4w vector4w vector4w symbol)) (define-extern add-debug-box (function symbol bucket-id vector vector rgba symbol)) (define-extern add-debug-box-with-transform (function symbol bucket-id bounding-box matrix rgba symbol)) ;; unsure if arg2 is bounding-box (define-extern add-debug-x (function symbol bucket-id vector rgba symbol)) @@ -25818,8 +25889,8 @@ (define-extern *expanded-text-line1* string) (define-extern *level-text-file-load-flag* symbol) (define-extern convert-korean-text - "Converts the provided [[game-text]] into korean. Returns a [[string]]" - (function game-text string)) + "Converts the provided [[string]] of [[game-text]] into korean. Returns a [[string]]" + (function string string)) (define-extern text-is-loading symbol) (define-extern load-game-text-info "Load text, if needed. txt-name is the group name, curr-text is the _symbol_ for @@ -26471,7 +26542,7 @@ (define-extern cam-standoff-calc-trans (function vector :behavior camera-slave)) (define-extern *CAM_EYE-bank* cam-eye-bank) (define-extern cam-circular-position-into-max-angle (function vector vector float vector :behavior camera-slave)) -;; (define-extern cam-circular-position (function symbol vector :behavior camera-slave)) ;; TODO - hang +(define-extern cam-circular-position (function symbol vector :behavior camera-slave)) (define-extern cam-circular-code (function float :behavior camera-slave)) (define-extern *CAM_STRING-bank* cam-string-bank) ;; cam-string-bank (define-extern cam-string-find-position-rel! (function vector symbol)) ;; @@ -26487,18 +26558,18 @@ (define-extern cam-los-setup-lateral (function collide-los-result vector vector symbol :behavior camera-slave)) ;; (define-extern cam-los-collide (function vector vector collide-los-result pat-surface symbol :behavior camera-slave)) ;; (define-extern cam-string-follow (function object :behavior camera-slave)) ;; -;; (define-extern cam-string-line-of-sight (function vector :behavior camera-slave)) ;; TODO - hang +(define-extern cam-string-line-of-sight (function vector :behavior camera-slave)) (define-extern cam-dist-analog-input (function int float float)) ;; -(define-extern cam-string-joystick (function vector :behavior camera-slave)) ;; +(define-extern cam-string-joystick (function float :behavior camera-slave)) ;; (define-extern cam-string-find-hidden (function none :behavior camera-slave)) ;; (define-extern cam-string-move (function object :behavior camera-slave)) ;; (define-extern cam-string-code (function vector :behavior camera-slave)) ;; (define-extern set-string-params (function vector :behavior camera-slave)) (define-extern *CAM_STICK-bank* cam-stick-bank) ;; cam-stick-bank -;; (define-extern cam-stick-code (function none :behavior camera-slave)) ;; TODO - hang +(define-extern cam-stick-code (function none :behavior camera-slave)) (define-extern *CAM_BIKE-bank* cam-bike-bank) ;; cam-bike-bank (define-extern cam-calc-bike-follow! (function cam-rotation-tracker vector symbol vector :behavior camera-slave)) ;; -;; (define-extern cam-bike-code (function none :behavior camera-slave)) ;; TODO - hang +(define-extern cam-bike-code (function none :behavior camera-slave)) @@ -29806,7 +29877,7 @@ (define-extern hide-hud-quick (function symbol none)) (define-extern show-hud (function object none)) (define-extern hud-hidden? (function symbol)) -;; (define-extern set-hud-piece-position! function) +(define-extern set-hud-piece-position! (function hud-sprite int int none)) ;; (define-extern set-as-offset-from! function) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -29821,10 +29892,13 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftype hud-scene-info (basic) - ((name basic :offset-assert 4) - (continue basic :offset-assert 8) - (info basic :offset-assert 12) - (text uint32 :offset-assert 16) + ((name string :offset-assert 4) + (continue string :offset-assert 8) + ;; TODO - the decompiler currently doesn't properly handle overlay fields from static data + (info object :offset-assert 12) + (info-str string :offset 12) + (info-list pair :offset 12) ;; a list of strings + (text uint32 :offset-assert 16) ) :method-count-assert 9 :size-assert #x14 @@ -29866,20 +29940,20 @@ (define-extern *progressive-mode-warning-options* menu-option-list) (define-extern *progressive-mode-ok-options* menu-option-list) (define-extern *quit-options* menu-option-list) -(define-extern *select-start-options* menu-option-list) -(define-extern *select-scene-options* menu-option-list) +(define-extern *select-start-options* "List of [[menu-select-start-option]]" menu-option-list) +(define-extern *select-scene-options* "List of [[menu-select-scene-option]]" menu-option-list) (define-extern *bigmap-options* menu-option-list) -(define-extern *missions-options* menu-option-list) -(define-extern *highscores-options* menu-option-list) +(define-extern *missions-options* "List of [[menu-missions-option]]" menu-option-list) +(define-extern *highscores-options* "List of [[menu-highscores-option]]" menu-option-list) (define-extern *secret-options* menu-option-list) (define-extern *language-name-remap* (array game-text-id)) -(define-extern *stereo-mode-name-remap* menu-option-list) -(define-extern *hud-ring-graphic-remap* menu-option-list) -(define-extern *hud-ring-kiosk-graphic-remap* menu-option-list) -(define-extern *hud-ring-demo-graphic-remap* menu-option-list) -(define-extern *hud-select-scene-act1* menu-option-list) -(define-extern *hud-select-scene-act2* menu-option-list) -(define-extern *hud-select-scene-act3* menu-option-list) +(define-extern *stereo-mode-name-remap* (array game-text-id)) +(define-extern *hud-ring-graphic-remap* (array uint64)) ;; these are probably bitfields of some kind +(define-extern *hud-ring-kiosk-graphic-remap* (array uint64)) +(define-extern *hud-ring-demo-graphic-remap* (array uint64)) +(define-extern *hud-select-scene-act1* (array hud-scene-info)) +(define-extern *hud-select-scene-act2* (array hud-scene-info)) +(define-extern *hud-select-scene-act3* (array hud-scene-info)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; progress ;; @@ -29930,7 +30004,7 @@ (total-num-tasks int32 :offset-assert 208) (scene-player-act int32 :offset-assert 212) (stereo-mode-backup int32 :offset-assert 216) - (secrets-unlocked basic :offset-assert 220) + (secrets-unlocked symbol :offset-assert 220) (missions-total-spacing float :offset-assert 224) (clear-screen basic :offset-assert 228) ) @@ -29940,7 +30014,8 @@ ) (deftype hud-ring-cell (process-drawable) - ((joint-idx int32 :offset-assert 200) + ((parent-override (pointer progress) :offset 16 :score 999) + (joint-idx int32 :offset-assert 200) (init-angle degrees :offset-assert 204) (graphic-index int32 :offset-assert 208) ) @@ -29965,8 +30040,8 @@ (define-extern deactivate-progress (function none)) (define-extern hide-progress-screen (function none)) (define-extern progress-allowed? (function symbol)) -(define-extern menu-update-purchase-secrets (function secret-item-option none)) -;; (define-extern progress-trans function) +(define-extern menu-update-purchase-secrets (function menu-secret-option none)) +(define-extern progress-trans (function none :behavior progress)) (define-extern begin-scan (function hud-box progress int)) (define-extern end-scan (function hud-box float int)) (define-extern progress-post (function none :behavior progress)) @@ -29978,13 +30053,13 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftype print-highscore-obj (basic) - ((self basic :offset-assert 4) + ((self texture-page :offset-assert 4) (index int32 :offset-assert 8) - (previous basic :offset-assert 12) + (previous texture-page :offset-assert 12) ; guess (place int32 :offset-assert 16) (score float :offset-assert 20) (game-score basic :offset-assert 24) - (context basic :offset-assert 28) + (context font-context :offset-assert 28) (local-scale float :offset-assert 32) (interp float :offset-assert 36) ) @@ -29993,61 +30068,63 @@ :flag-assert #x900000028 ) -(define-extern progress-selected (function int :behavior progress)) -;; (define-extern draw-percent-bar function) ;; (function int int float rgba none) -;; (define-extern draw-highlight function) -;; (define-extern draw-busy-loading function) -;; (define-extern draw-previous-next function) -;; (define-extern draw-up-down function) -;; (define-extern draw-missions-up-down function) -;; (define-extern draw-scene-up-down function) -;; (define-extern begin-scissor function) -;; (define-extern end-scissor function) -;; (define-extern begin-scissor-secret function) -;; (define-extern end-scissor-secret function) -;; (define-extern begin-scissor-missions function) -;; (define-extern end-scissor-missions function) -;; (define-extern begin-scissor-scene function) -;; (define-extern end-scissor-scene function) -;; (define-extern begin-scissor-level function) -;; (define-extern end-scissor-level function) -;; (define-extern print-language-name function) ;; (function int font-context int symbol font-context) -;; (define-extern unlocked-secret-menu? function) -(define-extern memcard-unlocked-secrets? (function symbol none)) -;; (define-extern num-unlocked-secret? function) -;; (define-extern print-menu-text function) -;; (define-extern draw-yes-no function) -;; (define-extern draw-continue-retry function) -;; (define-extern draw-savegame-box function) -;; (define-extern get-level-icon-id-01 function) -;; (define-extern get-level-icon-id-02 function) -;; (define-extern get-level-icon-id-03 function) -;; (define-extern get-level-icon-id-04 function) -;; (define-extern draw-decoration function) -;; (define-extern draw-missions-decoration function) -;; (define-extern draw-sound-options-decoration function) -;; (define-extern draw-decoration-secrets function) -;; (define-extern draw-decoration-load-save function) -;; (define-extern sort-task-node-result function) -;; (define-extern find-mission-text-at-index function) -;; (define-extern draw-secret-list function) -;; (define-extern draw-highscore-icon function) -;; (define-extern draw-highscore-cup function) -;; (define-extern get-highscore-score function) -;; (define-extern eval-highscore function) -;; (define-extern str-print-time function) -;; (define-extern print-highscore function) -;; (define-extern get-highscore-text function) -;; (define-extern get-highscore-text-sub function) -;; (define-extern get-highscore-icon function) -;; (define-extern get-highscore-type function) -(define-extern highscore-available? (function symbol)) +(define-extern progress-selected (function int int :behavior progress)) +(define-extern draw-percent-bar (function int int float rgba none)) ;; +(define-extern draw-highlight (function int int float pointer)) +(define-extern draw-busy-loading (function font-context float :behavior progress)) +(define-extern draw-previous-next (function menu-highscores-option font-context symbol none)) +(define-extern draw-up-down (function font-context none)) +(define-extern draw-missions-up-down (function font-context none)) +(define-extern draw-scene-up-down (function font-context none)) +(define-extern begin-scissor (function hud-box progress none)) +(define-extern end-scissor (function hud-box float none)) +(define-extern begin-scissor-secret (function hud-box progress none)) +(define-extern end-scissor-secret (function hud-box float none)) +(define-extern begin-scissor-missions (function hud-box float none)) +(define-extern end-scissor-missions (function hud-box float none)) +(define-extern begin-scissor-scene (function hud-box none)) +(define-extern end-scissor-scene (function hud-box float none)) +(define-extern begin-scissor-level (function hud-box none)) +(define-extern end-scissor-level (function hud-box float none)) +(define-extern print-language-name (function game-text-id font-context int symbol none)) +(define-extern unlocked-secret-menu? (function game-secrets symbol)) +(define-extern memcard-unlocked-secrets? (function symbol game-secrets)) +(define-extern num-unlocked-secret? + "@returns The number of secrets currently unlocked" + (function game-secrets int)) +(define-extern print-menu-text (function string float font-context progress none)) +(define-extern draw-yes-no (function progress font-context pointer)) +(define-extern draw-continue-retry (function progress font-context pointer)) +(define-extern draw-savegame-box (function menu-option float float float float pointer)) +(define-extern get-level-icon-id-01 "TODO - Icon id enum perhaps?" (function int texture-id)) +(define-extern get-level-icon-id-02 "TODO - Icon id enum perhaps?" (function int texture-id)) +(define-extern get-level-icon-id-03 "TODO - Icon id enum perhaps?" (function int texture-id)) +(define-extern get-level-icon-id-04 "TODO - Icon id enum perhaps?" (function int texture-id)) +(define-extern draw-decoration (function menu-option font-context float int symbol float pointer)) +(define-extern draw-missions-decoration (function menu-missions-option font-context float game-text-id pointer)) +(define-extern draw-sound-options-decoration (function menu-slider-option font-context float symbol game-text-id pointer)) +(define-extern draw-decoration-secrets (function menu-option font-context float game-text-id pointer)) +(define-extern draw-decoration-load-save (function menu-option font-context float int pointer)) +(define-extern sort-task-node-result (function int none)) +(define-extern find-mission-text-at-index (function int game-task-node-info)) +(define-extern draw-secret-list (function secret-item-option progress font-context int symbol float pointer)) +(define-extern draw-highscore-icon (function menu-highscores-option uint int int float pointer)) +(define-extern draw-highscore-cup "First int is an enum" (function texture-page int int int float float pointer)) +(define-extern get-highscore-score "TODO - takes and returns an enum?" (function int int)) +(define-extern eval-highscore (function print-highscore-obj int)) +(define-extern str-print-time (function float string)) +(define-extern print-highscore (function print-highscore-obj float)) +(define-extern get-highscore-text "TODO - takes an enum?" (function int game-text-id)) +(define-extern get-highscore-text-sub "TODO - takes an enum?" (function int game-text-id)) +(define-extern get-highscore-icon "TODO - Icon id enum perhaps?" (function int uint)) +(define-extern get-highscore-type "TODO - takes an enum?" (function int symbol)) +(define-extern highscore-available? (function int symbol)) (define-extern get-num-highscores (function int)) (define-extern get-next-highscore (function int int)) (define-extern get-prev-highscore (function int int)) -;; (define-extern get-highscore-icon-scale function) -;; (define-extern get-highscore-icon-xoffset function) -;; (define-extern get-highscore-icon-yoffset function) +(define-extern get-highscore-icon-scale "TODO - takes an enum?" (function int float)) +(define-extern get-highscore-icon-xoffset (function int int)) +(define-extern get-highscore-icon-yoffset "TODO - takes an enum?" (function int int)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ocean ;; diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 537678d6f4..62d612ea01 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -117,12 +117,11 @@ // CFG failed "draw-inline-array-instance-shrub", - // "reset-target-tracking", "target-land-effect", "(method 12 effect-control)", "(method 11 effect-control)", "(method 10 effect-control)", - "progress-trans", + "(anon-function 2 scene)", "(method 10 bigmap)", "(method 9 editable-region)", // condition branch assert hit "(method 57 enemy)", @@ -245,7 +244,17 @@ " textures ~192H~5DK ~280Htextures~456H~5DK~%": 2, " misc ~192H~5DK ~280Hsprite~456H~5DK~%": 2, " entity ~192H~5DK~%": 1, - " pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%": 2 + " pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%": 2, + "~33L~S~32L ~S": 2, + "~32L~S ~33L~S~1L": 2, + "~35L~S~33L ~S": 2, + "~1L~S~35L ~S": 2, + "~35L~S ~1L~S~1L": 2, + "~33L~S~35L ~S": 2, + "~33L~C~34L~S~33L~C": 3, + "~35L~S ~33L~S~1L": 2, + "~33L~S ~35L~S~1L": 2, + "~33L~C": 1 }, "blocks_ending_in_asm_branch": { @@ -254,6 +263,7 @@ "circle-circle-xz-intersect": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ], + "load-game-text-info": [15, 16, 17, 19, 20, 21], "find-knot-span": [0, 1, 2, 3, 5, 6, 7, 8, 9], @@ -331,7 +341,9 @@ ], "(method 27 conveyor)": [5, 14, 22], "(method 44 nav-graph)": [1, 3, 6, 13, 17], - "(method 11 sparticle-launch-control)": [18, 24, 25, 28, 29, 32, 33, 34, 36, 41, 55, 58, 93, 95] + "(method 11 sparticle-launch-control)": [ + 18, 24, 25, 28, 29, 32, 33, 34, 36, 41, 55, 58, 93, 95 + ] }, // Sometimes the game might use format strings that are fetched dynamically, @@ -340,6 +352,21 @@ // e.g. "function-name":[[op, argc], [op, argc], ...] // where "op" is the op number for the call to format. "dynamic_format_arg_counts": { + "(method 10 menu-loading-option)": [[118, 1]], + "(method 10 menu-insufficient-space-option)": [ + [63, 1], + [103, 1] + ], + "(method 10 menu-secrets-insufficient-space-option)": [[55, 1]], + "(method 10 menu-card-removed-option)": [[48, 1]], + "(method 10 menu-format-card-option)": [[49, 1]], + "(method 10 menu-create-game-option)": [[49, 1]], + "(method 10 menu-error-auto-saving-option)": [[72, 1]], + "(method 10 menu-error-loading-option)": [ + [64, 1], + [99, 1] + ], + "(method 10 menu-insert-card-option)": [[48, 1]], "(method 16 fail-mission)": [ [68, 1], [101, 1], diff --git a/decompiler/config/jak2/inputs.jsonc b/decompiler/config/jak2/inputs.jsonc index d23d3bae87..c53a7a1351 100644 --- a/decompiler/config/jak2/inputs.jsonc +++ b/decompiler/config/jak2/inputs.jsonc @@ -184,5 +184,11 @@ "streamed_audio_file_names": [], - "levels_to_extract": ["PRI.DGO", "CTA.DGO", "CWI.DGO", "LWIDEA.DGO", "VI1.DGO"] + "levels_to_extract": [ + "PRI.DGO", + "CTA.DGO", + "CWI.DGO", + "LWIDEA.DGO", + "VI1.DGO" + ] } diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 5d3bdd698c..593795ebf3 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -103,7 +103,7 @@ ], "text": [ ["L96", "vector4"], - ["L95", "matrix"], + ["L95", "vector4w-4"], ["L96", "vector4w"] ], "joint-mod": [["L189", "(inline-array quaternion)", 3]], @@ -275,5 +275,104 @@ "tie-methods": [["L328", "(inline-array tie-init-data)", 6]], "blocking-plane": [["L43", "vector"]], "elec-gate": [["L141", "attack-info"]], - "part-tester": [["L35", "uint64", true], ["L30", "uint64", true]] + "part-tester": [ + ["L35", "uint64", true], + ["L30", "uint64", true] + ], + "progress-draw": [ + ["L933", "uint64", true], + ["L934", "uint64", true], + ["L935", "uint64", true], + ["L936", "uint64", true], + ["L937", "uint64", true], + ["L938", "uint64", true], + ["L939", "uint64", true], + ["L940", "uint64", true], + ["L941", "uint64", true], + ["L942", "uint64", true], + ["L943", "uint64", true], + ["L944", "uint64", true], + ["L945", "uint64", true], + ["L946", "uint64", true], + ["L947", "uint64", true], + ["L948", "uint64", true], + ["L949", "uint64", true], + ["L950", "uint64", true], + ["L951", "uint64", true], + ["L952", "uint64", true], + ["L953", "uint64", true], + ["L954", "uint64", true], + ["L955", "uint64", true], + ["L956", "uint64", true], + ["L957", "uint64", true], + ["L958", "uint64", true], + ["L959", "uint64", true], + ["L960", "uint64", true], + ["L961", "uint64", true], + ["L962", "uint64", true], + ["L963", "uint64", true], + ["L964", "uint64", true], + ["L965", "uint64", true], + ["L966", "uint64", true], + ["L967", "uint64", true], + ["L968", "uint64", true], + ["L969", "uint64", true], + ["L970", "uint64", true], + ["L971", "uint64", true], + ["L972", "uint64", true], + ["L973", "uint64", true], + ["L974", "uint64", true], + ["L975", "uint64", true], + ["L976", "uint64", true], + ["L977", "uint64", true], + ["L978", "uint64", true], + ["L979", "uint64", true], + ["L980", "uint64", true], + ["L981", "uint64", true], + ["L982", "uint64", true], + ["L983", "uint64", true], + ["L984", "uint64", true], + ["L985", "uint64", true], + ["L986", "uint64", true], + ["L987", "uint64", true], + ["L988", "uint64", true], + ["L989", "uint64", true], + ["L990", "uint64", true], + ["L991", "uint64", true], + ["L992", "uint64", true], + ["L993", "uint64", true], + ["L994", "uint64", true], + ["L995", "uint64", true], + ["L996", "uint64", true], + ["L997", "uint64", true], + ["L998", "uint64", true], + ["L999", "uint64", true], + ["L1000", "uint64", true], + ["L1001", "uint64", true], + ["L1002", "uint64", true], + ["L1003", "uint64", true], + ["L1004", "uint64", true], + ["L1005", "uint64", true], + ["L1006", "uint64", true], + ["L1007", "uint64", true], + ["L1008", "uint64", true], + ["L1009", "uint64", true], + ["L1010", "uint64", true], + ["L1011", "uint64", true], + ["L1012", "uint64", true], + ["L1013", "uint64", true], + ["L1014", "uint64", true], + ["L1015", "uint64", true], + ["L1016", "uint64", true], + ["L1017", "uint64", true], + ["L1018", "uint64", true], + ["L1019", "uint64", true], + ["L1020", "uint64", true], + ["L1021", "uint64", true], + ["L1022", "uint64", true], + ["L1023", "uint64", true], + ["L1024", "uint64", true], + ["L1025", "uint64", true], + ["L1041", "uint64", true] + ] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index ee969d1c35..822e684922 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -928,16 +928,15 @@ [16, "vector"], [32, "vector"] ], - "particle-adgif-callback": [ - [16, ["inline-array", "vector", 4]] - ], - "sparticle-respawn-heights": [ - [16, "vector"] - ], - "sparticle-respawn-timer": [ - [16, "vector"] - ], - "check-drop-level-rain": [ - [16, "vector"] - ] + "particle-adgif-callback": [[16, ["inline-array", "vector", 4]]], + "sparticle-respawn-heights": [[16, "vector"]], + "sparticle-respawn-timer": [[16, "vector"]], + "check-drop-level-rain": [[16, "vector"]], + "progress-post": [[112, "hud-box"]], + "(method 10 menu-missions-option)": [[224, "hud-box"]], + "(method 10 menu-secret-option)": [[64, "hud-box"]], + "(method 10 menu-highscores-option)": [[16, "hud-box"]], + "master-track-target": [[16, "vector"]], + "cam-string-line-of-sight": [[192, "collide-query"]], + "(enter cam-circular)": [[32, "collide-query"]] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 6fac9ead78..b156540ad9 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -670,7 +670,8 @@ ], "print-game-text": [ [225, "v1", "float"], - [241, "v1", "float"] + [241, "v1", "float"], + [[324, 327], "v1", "dma-packet"] ], "warp-test": [[[18, 23], "v1", "dma-packet"]], "fx-copy-buf": [ @@ -964,7 +965,10 @@ [5, "s5", "glst-named-node"], [6, "v1", "glst-named-node"] ], - "(event time-of-day-tick)": [[10, "v1", "float"], [148, "v1", "float"]], + "(event time-of-day-tick)": [ + [10, "v1", "float"], + [148, "v1", "float"] + ], "cam-slave-get-vector-with-offset": [[[52, 61], "s3", "vector"]], "cam-slave-get-interp-time": [[43, "f0", "float"]], "cam-standard-event-handler": [ @@ -986,21 +990,14 @@ [542, "v1", "camera-slave"], [611, "a0", "vector"], [786, "v1", "float"], - [789, "v1", "float"] - ], - "master-track-target": [ - [53, "gp", "process-focusable"], - [100, "gp", "process-focusable"], - [121, "gp", "process-focusable"], - [132, "gp", "process-focusable"] - ], - "reset-target-tracking": [ - [14, "gp", "process-focusable"], - [40, "gp", "process-focusable"], - [51, "gp", "process-focusable"], - [65, "gp", "process-focusable"], - [86, "gp", "process-focusable"] + [789, "v1", "float"], + [589, "v1", "float"], + [593, "v1", "float"], + [602, "v1", "float"], + [606, "v1", "float"] ], + "master-track-target": [[[53, 526], "gp", "target"]], + "reset-target-tracking": [[[14, 138], "gp", "process-focusable"]], "reset-follow": [[[12, 18], "a0", "process-focusable"]], "(code cam-pov)": [ [15, "a1", "pov-camera"], @@ -1026,7 +1023,8 @@ [92, "s1", "(inline-array collide-cache-tri)"], [205, "s1", "(inline-array collide-cache-tri)"], [135, "s1", "(inline-array collide-cache-tri)"], - [175, "s1", "(inline-array collide-cache-tri)"] + [175, "s1", "(inline-array collide-cache-tri)"], + [375, "v1", "(inline-array tracking-spline)"] ], "cam-dist-analog-input": [[32, "f0", "float"]], "(event cam-string)": [ @@ -1466,9 +1464,7 @@ [[0, 31], "v1", "(array int32)"], [47, "v1", "(array int32)"] ], - "sparticle-texture-day-night": [ - [[21, 78], "s2", "(array int32)"] - ], + "sparticle-texture-day-night": [[[21, 78], "s2", "(array int32)"]], "sparticle-mode-animate": [ [5, "v1", "(array symbol)"], [[7, 16], "a1", "(array uint32)"], @@ -1480,7 +1476,6 @@ // [33, "a0", "(pointer int64)"], [44, "v1", "(pointer int32)"], [46, "v1", "(pointer int32)"] - ], "(method 2 sparticle-cpuinfo)": [[14, "f0", "float"]], "sp-kill-particle": [ @@ -1936,7 +1931,6 @@ [171, "v1", "float"], [195, "v1", "float"], [199, "v1", "float"], - // [281, "f0", "float"], [220, "v1", "float"] ], "(method 45 nav-mesh)": [[15, "v1", "entity-nav-mesh"]], @@ -2608,9 +2602,7 @@ [[58, 64], "v1", "dma-packet"], [66, "v1", "(pointer int32)"] ], - "(enter othercam-running)": [[[50, 60], "gp", "process-drawable"]], "(code othercam-running)": [[[2, 65], "s2", "process-drawable"]], - "(method 10 progress)": [[45, "t9", "(function progress none)"]], "hud-ring-cell-init-by-other": [ [36, "a0", "progress"], [45, "v1", "progress"], @@ -2619,6 +2611,7 @@ [159, "a1", "progress"], [178, "a1", "progress"] ], + "(enter othercam-running)": [[[50, 60], "gp", "process-drawable"]], "(post idle hud-ring-cell)": [ [8, "a1", "progress"], [13, "v1", "progress"], @@ -2797,9 +2790,7 @@ ["_stack_", 16, "res-tag"], [[29, 45], "v1", "(pointer float)"] ], - "unpack-comp-rle": [[[10, 26], "a0", "(pointer int8)"]], - "(method 16 level)": [ [222, "v1", "(pointer uint128)"], [223, "a1", "(pointer uint128)"], @@ -2811,12 +2802,8 @@ [[171, 193], "s2", "(pointer uint8)"], [227, "v1", "(pointer uint8)"] ], - "set-fog-height!": [ - [2, "v1", "(array texture-anim)"] - ], - "unpack-comp-huf": [ - [[21,23], "t3", "(pointer uint16)"] - ], + "set-fog-height!": [[2, "v1", "(array texture-anim)"]], + "unpack-comp-huf": [[[21, 23], "t3", "(pointer uint16)"]], "(method 10 elec-gate)": [[13, "t9", "(function process-drawable none)"]], "(method 11 elec-gate)": [ [180, "a0", "vector"], @@ -2977,7 +2964,123 @@ [99, "a0", "dma-packet"], [97, "a1", "dma-packet"] ], - "(code part-tester-idle)": [ - [[16, 22], "s5", "process-drawable"] - ] + "(code part-tester-idle)": [[[16, 22], "s5", "process-drawable"]], + "(method 25 progress)": [[[19, 31], "a0", "menu-option"]], + "(method 24 progress)": [ + [70, "a0", "(array menu-option)"], + [71, "a0", "menu-on-off-game-vibrations-option"], + [76, "a0", "(array menu-option)"], + [77, "a0", "menu-on-off-game-subtitles-option"], + [82, "a0", "(array menu-option)"], + [83, "a0", "menu-language-option"], + [87, "a0", "(array menu-option)"], + [88, "a0", "menu-language-option"], + [91, "v1", "(array menu-option)"], + [92, "v1", "menu-language-option"], + [95, "v1", "(array menu-option)"], + [96, "v1", "menu-language-option"], + [101, "a0", "(array menu-option)"], + [102, "a0", "menu-on-off-option"], + [107, "a0", "(array menu-option)"], + [108, "a0", "menu-on-off-option"], + [113, "a0", "(array menu-option)"], + [114, "a0", "menu-on-off-option"], + [119, "a0", "(array menu-option)"], + [120, "a0", "menu-on-off-option"], + [125, "a0", "(array menu-option)"], + [126, "a0", "menu-slider-option"], + [131, "a0", "(array menu-option)"], + [132, "a0", "menu-slider-option"], + [137, "a0", "(array menu-option)"], + [138, "a0", "menu-slider-option"], + [141, "v1", "(array menu-option)"], + [142, "v1", "menu-missions-option"] + ], + "(method 31 progress)": [ + [61, "v1", "(array menu-option)"], + [62, "v1", "menu-missions-option"] + ], + "(method 32 progress)": [ + [296, "v1", "(array menu-option)"], + [297, "v1", "menu-select-start-option"], + [306, "v1", "(array menu-option)"], + [307, "v1", "menu-select-scene-option"], + [371, "v1", "(array menu-option)"], + [372, "v1", "menu-missions-option"], + [380, "v1", "(array menu-option)"], + [381, "v1", "menu-highscores-option"], + [384, "v1", "(array menu-option)"], + [385, "v1", "menu-highscores-option"] + ], + "draw-highlight": [[[44, 47], "v1", "dma-packet"]], + "end-scissor": [[[16, 19], "v1", "dma-packet"]], + "begin-scissor-secret": [[[49, 52], "v1", "dma-packet"]], + "end-scissor-secret": [[[16, 19], "v1", "dma-packet"]], + "begin-scissor-missions": [[[49, 52], "v1", "dma-packet"]], + "end-scissor-missions": [[[16, 19], "v1", "dma-packet"]], + "begin-scissor-scene": [[[49, 52], "v1", "dma-packet"]], + "end-scissor-scene": [[[16, 19], "v1", "dma-packet"]], + "begin-scissor-level": [[[49, 52], "v1", "dma-packet"]], + "end-scissor-level": [[[16, 19], "v1", "dma-packet"]], + "(method 10 menu-highscores-option)": [ + [17, "v1", "float"], + [51, "f0", "float"], + [14, "v1", "float"] + ], + "draw-percent-bar": [[[38, 41], "v1", "dma-packet"]], + "draw-highscore-icon": [[[36, 39], "v1", "dma-packet"]], + "begin-scissor": [[[70, 73], "v1", "dma-packet"]], + "draw-savegame-box": [[[25, 28], "v1", "dma-packet"]], + "draw-decoration": [[[176, 179], "v1", "dma-packet"]], + "draw-missions-decoration": [[[137, 140], "v1", "dma-packet"]], + "draw-sound-options-decoration": [[[151, 154], "v1", "dma-packet"]], + "draw-decoration-secrets": [[[139, 142], "v1", "dma-packet"]], + "draw-decoration-load-save": [[[173, 176], "v1", "dma-packet"]], + "(method 10 menu-secret-option)": [ + [25, "v1", "float"], + [22, "v1", "float"], + [63, "f0", "float"], + [[137, 140], "v1", "dma-packet"] + ], + "(method 10 menu-memcard-slot-option)": [ + [[333, 336], "v1", "dma-packet"], + [[552, 555], "v1", "dma-packet"], + [[874, 877], "v1", "dma-packet"], + [[941, 944], "v1", "dma-packet"], + [[1034, 1037], "v1", "dma-packet"], + [[1107, 1110], "v1", "dma-packet"], + [[1186, 1189], "v1", "dma-packet"], + [59, "f0", "float"] + ], + "(method 10 menu-icon-info-option)": [[[71, 74], "v1", "dma-packet"]], + "find-mission-text-at-index": [ + [ + 201, + "v1", + "symbol" // this is a lie, but it's needed to work around the useless`cmove-#f-zero` it's not a symbol + ] + ], + "(method 10 menu-missions-option)": [[78, "f0", "float"]], + "draw-highscore-cup": [[[74, 77], "v1", "dma-packet"]], + "(method 10 menu-slider-option)": [ + [[415, 418], "v1", "dma-packet"], + [[768, 771], "v1", "dma-packet"] + ], + "(method 10 menu-sub-menu-option)": [ + [[237, 240], "v1", "dma-packet"], + [[334, 337], "v1", "dma-packet"] + ], + "(event idle progress)": [ + [[10, 80], "v1", "mc-status-code"], + [[147, 217], "v1", "mc-status-code"] + ], + "memcard-unlocked-secrets?": [[50, "s5", "int"]], + "(method 10 progress)": [[45, "t9", "(function progress none)"]], + "load-game-text-info": [[4, "v1", "game-text-info"]], + "(method 16 camera-master)": [[[11, 15], "a2", "target"]], + "master-choose-entity": [ + ["_stack_", 96, "res-tag"], + [[87, 247], "s3", "(pointer camera-slave)"] + ], + "cam-string-joystick": [[785, "v1", "process-drawable"]] } diff --git a/decompiler/config/jak2_ntsc_v1.jsonc b/decompiler/config/jak2_ntsc_v1.jsonc index 97951c7b49..4e3d7b149a 100644 --- a/decompiler/config/jak2_ntsc_v1.jsonc +++ b/decompiler/config/jak2_ntsc_v1.jsonc @@ -33,9 +33,9 @@ "disassemble_data": false, // unpack textures to assets folder - "process_tpages": false, + "process_tpages": true, // unpack game text to assets folder - "process_game_text": false, + "process_game_text": true, // unpack game count to assets folder "process_game_count": true, // write goal imports for art groups diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index 81d0b1a730..3be8d7530f 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -995,7 +995,12 @@ goos::Object decompile_structure(const TypeSpec& type, } if (all_zero) { - // field has nothing in it, just skip it. + // special case for dynamic arrays at the end of a type + // TODO - this causes an assert in Type.hL240 + // if (!(field_start == field_end && field.is_dynamic())) { + // // field has nothing in it, just skip it. + // continue; + //} continue; } @@ -1007,7 +1012,7 @@ goos::Object decompile_structure(const TypeSpec& type, // first, let's see if it's a value or reference auto field_type_info = ts.lookup_type_allow_partial_def(field.type()); - if (!field_type_info->is_reference()) { + if (!field_type_info->is_reference() && field.type() != TypeSpec("object")) { // value type. need to get bytes. ASSERT(!field.is_inline()); if (field.is_array()) { @@ -1201,9 +1206,15 @@ goos::Object decompile_structure(const TypeSpec& type, if (field.type() == TypeSpec("symbol")) { continue; } - field_defs_out.emplace_back( - field.name(), decompile_at_label(field.type(), labels.at(word.label_id()), labels, - words, ts, file, version)); + if (field.type() == TypeSpec("object")) { + field_defs_out.emplace_back( + field.name(), decompile_at_label_guess_type(labels.at(word.label_id()), labels, + words, ts, file, version)); + } else { + field_defs_out.emplace_back( + field.name(), decompile_at_label(field.type(), labels.at(word.label_id()), labels, + words, ts, file, version)); + } } else if (word.kind() == LinkedWord::PLAIN_DATA && word.data == 0) { // do nothing, the default is zero? field_defs_out.emplace_back(field.name(), pretty_print::to_symbol("0")); diff --git a/game/assets/game_subtitle.gp b/game/assets/jak1/game_subtitle.gp similarity index 100% rename from game/assets/game_subtitle.gp rename to game/assets/jak1/game_subtitle.gp diff --git a/game/assets/game_text.gp b/game/assets/jak1/game_text.gp similarity index 100% rename from game/assets/game_text.gp rename to game/assets/jak1/game_text.gp diff --git a/game/assets/jak2/game_text.gp b/game/assets/jak2/game_text.gp new file mode 100644 index 0000000000..978f13e157 --- /dev/null +++ b/game/assets/jak2/game_text.gp @@ -0,0 +1,12 @@ +;; "project file" for text make tool. +;; it's very simple... a list of (action args...) +;; currently the only action available is 'file' +;; and it takes 1 argument: input filename. + +(text + ;; NOTE : we compile using the fixed v2 encoding because it's what we use. + (file "$DECOMP/assets/game_text.txt") ;; this is the decompiler-generated file! + ;; add custom files down here + ) + + diff --git a/game/common/str_rpc_types.h b/game/common/str_rpc_types.h index d461176cd5..196f767eed 100644 --- a/game/common/str_rpc_types.h +++ b/game/common/str_rpc_types.h @@ -8,7 +8,22 @@ constexpr PerGameVersion STR_RPC_ID(0xdeb5, 0xfab4); constexpr int STR_RPC_CHANNEL = 4; -struct RPC_Str_Cmd { +/* +(deftype load-chunk-msg (structure) + ((rsvd uint16 :offset-assert 0) + (result load-msg-result :offset-assert 2) + (address pointer :offset-assert 4) + (section uint32 :offset-assert 8) + (maxlen uint32 :offset-assert 12) + (id uint32 :offset 4) + (basename uint8 48 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) +*/ +struct RPC_Str_Cmd_Jak1 { u16 rsvd; // 0, seems unused u16 result; // 2, return code. see STR_RPC_RESULT_XXX u32 ee_addr; // 4, GOAL address to load to. @@ -18,6 +33,31 @@ struct RPC_Str_Cmd { char name[64]; // file name }; +/* +(deftype load-chunk-msg (structure) + ((rsvd uint16 :offset-assert 0) + (result load-msg-result :offset-assert 2) + (address pointer :offset-assert 4) + (section uint32 :offset-assert 8) + (maxlen uint32 :offset-assert 12) + (dummy uint32 4 :offset-assert 16) + (basename sound-stream-name :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) +*/ +struct RPC_Str_Cmd_Jak2 { + u16 rsvd; + u16 result; // 2 + u32 address; + s32 section; // 8 + u32 maxlen; + u32 dummy[4]; + char basename[48]; // 32 +}; + struct RPC_Play_Cmd { u16 rsvd; u16 result; diff --git a/game/kernel/jak2/klink.h b/game/kernel/jak2/klink.h index 5417d9cead..a7036956a2 100644 --- a/game/kernel/jak2/klink.h +++ b/game/kernel/jak2/klink.h @@ -13,6 +13,7 @@ Ptr link_and_exec(Ptr data, Ptr heap, uint32_t flags, bool jump_from_c_to_goal); +u64 link_and_exec_wrapper(u64* args); u32 link_busy(); void link_reset(); uint64_t link_begin(u64* args); diff --git a/game/kernel/jak2/kscheme.cpp b/game/kernel/jak2/kscheme.cpp index 5e41a313e5..bccd4bd994 100644 --- a/game/kernel/jak2/kscheme.cpp +++ b/game/kernel/jak2/kscheme.cpp @@ -1652,7 +1652,7 @@ int InitHeapAndSymbol() { make_function_symbol_from_c("kmemclose", (void*)kmemclose); make_function_symbol_from_c("new-dynamic-structure", (void*)new_dynamic_structure); make_function_symbol_from_c("method-set!", (void*)method_set); - make_stack_arg_function_symbol_from_c("link", (void*)link_and_exec); + make_stack_arg_function_symbol_from_c("link", (void*)link_and_exec_wrapper); make_function_symbol_from_c("link-busy?", (void*)link_busy); make_function_symbol_from_c("link-reset", (void*)link_reset); make_function_symbol_from_c("dgo-load", (void*)load_and_link_dgo); @@ -1770,4 +1770,4 @@ s64 load_and_link(const char* /*filename*/, ASSERT(false); return 0; } -} // namespace jak2 \ No newline at end of file +} // namespace jak2 diff --git a/game/overlord/stream.cpp b/game/overlord/stream.cpp index b7055d32bf..be000e95c2 100644 --- a/game/overlord/stream.cpp +++ b/game/overlord/stream.cpp @@ -21,9 +21,11 @@ using namespace iop; -static RPC_Str_Cmd sSTRBuf; +static RPC_Str_Cmd_Jak1 sSTRBufJak1; +static RPC_Str_Cmd_Jak2 sSTRBufJak2; static RPC_Play_Cmd sPLAYBuf[2]; // todo type -void* RPC_STR(unsigned int fno, void* _cmd, int y); +void* RPC_STR_jak1(unsigned int fno, void* _cmd, int y); +void* RPC_STR_jak2(unsigned int fno, void* _cmd, int y); void* RPC_PLAY(unsigned int fno, void* _cmd, int y); static constexpr int PLAY_MSG_SIZE = 0x40; @@ -48,7 +50,8 @@ constexpr int STR_INDEX_CACHE_SIZE = 4; CacheEntry sCache[STR_INDEX_CACHE_SIZE]; void stream_init_globals() { - memset(&sSTRBuf, 0, sizeof(RPC_Str_Cmd)); + memset(&sSTRBufJak1, 0, sizeof(RPC_Str_Cmd_Jak1)); + memset(&sSTRBufJak2, 0, sizeof(RPC_Str_Cmd_Jak2)); memset(&sPLAYBuf, 0, sizeof(RPC_Play_Cmd)); } @@ -62,7 +65,16 @@ u32 STRThread() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, STR_RPC_ID[g_game_version], RPC_STR, &sSTRBuf, nullptr, nullptr, &dq); + if (g_game_version == GameVersion::Jak1) { + sceSifRegisterRpc(&serve, STR_RPC_ID[g_game_version], RPC_STR_jak1, &sSTRBufJak1, nullptr, + nullptr, &dq); + } else if (g_game_version == GameVersion::Jak2) { + sceSifRegisterRpc(&serve, STR_RPC_ID[g_game_version], RPC_STR_jak2, &sSTRBufJak2, nullptr, + nullptr, &dq); + } else { + ASSERT_MSG(false, "unsupported game version in STRThread initialization!"); + } + CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; @@ -84,10 +96,10 @@ u32 PLAYThread() { /*! * The STR RPC handler. */ -void* RPC_STR(unsigned int fno, void* _cmd, int y) { +void* RPC_STR_jak1(unsigned int fno, void* _cmd, int y) { (void)fno; (void)y; - auto* cmd = (RPC_Str_Cmd*)_cmd; + auto* cmd = (RPC_Str_Cmd_Jak1*)_cmd; if (cmd->chunk_id < 0) { // it's _not_ a stream file. So we just treat it like a normal load. @@ -162,6 +174,42 @@ void* RPC_STR(unsigned int fno, void* _cmd, int y) { return cmd; } +/*! + * The STR RPC handler. + */ +void* RPC_STR_jak2(unsigned int fno, void* _cmd, int y) { + (void)fno; + (void)y; + auto* cmd = (RPC_Str_Cmd_Jak2*)_cmd; + if (cmd->section < 0) { + // it's _not_ a stream file. So we just treat it like a normal load. + + // find the file with the given name + auto file_record = isofs->find(cmd->basename); + if (file_record == nullptr) { + // file not found! + printf("[OVERLORD STR] Failed to find file %s for loading.\n", cmd->basename); + cmd->result = STR_RPC_RESULT_ERROR; + } else { + // load directly to the EE + cmd->maxlen = LoadISOFileToEE(file_record, cmd->address, cmd->maxlen); + if (cmd->maxlen) { + // successful load! + cmd->result = STR_RPC_RESULT_DONE; + } else { + // there was an error loading. + cmd->result = STR_RPC_RESULT_ERROR; + } + } + } else { + // TODO - not yet implemented + ASSERT_MSG(false, "this branch of RPC_STR has not yet been implemented!"); + cmd->result = STR_RPC_RESULT_ERROR; + } + + return cmd; +} + void* RPC_PLAY([[maybe_unused]] unsigned int fno, void* _cmd, int size) { s32 n_messages = size / PLAY_MSG_SIZE; char namebuf[16]; diff --git a/goal_src/jak1/game.gp b/goal_src/jak1/game.gp index 9e08736160..980d66a168 100644 --- a/goal_src/jak1/game.gp +++ b/goal_src/jak1/game.gp @@ -380,7 +380,7 @@ ;; Text ;;;;;;;;;;;;;;;;;;;;; -(defstep :in "game/assets/game_text.gp" +(defstep :in "game/assets/jak1/game_text.gp" :tool 'text :out '("$OUT/iso/0COMMON.TXT" "$OUT/iso/1COMMON.TXT" @@ -391,7 +391,7 @@ "$OUT/iso/6COMMON.TXT") ) -(defstep :in "game/assets/game_subtitle.gp" +(defstep :in "game/assets/jak1/game_subtitle.gp" :tool 'subtitle :out '("$OUT/iso/0SUBTIT.TXT" "$OUT/iso/3SUBTIT.TXT" diff --git a/goal_src/jak2/engine/camera/cam-debug-h.gc b/goal_src/jak2/engine/camera/cam-debug-h.gc index 5bc568efed..b9e19aee6f 100644 --- a/goal_src/jak2/engine/camera/cam-debug-h.gc +++ b/goal_src/jak2/engine/camera/cam-debug-h.gc @@ -17,6 +17,9 @@ ;; NOTE - for cam-states (define-extern cam-collision-record-save (function vector vector int symbol camera-slave none)) +(define-extern cam-debug-add-los-tri (function (inline-array collide-cache-tri) vector vector none)) +(define-extern slave-los-state->string (function slave-los-state string)) +(define-extern cam-debug-reset-coll-tri (function none)) ;; NOTE - for cam-layout (define-extern camera-line-setup (function vector4w none)) diff --git a/goal_src/jak2/engine/camera/cam-master.gc b/goal_src/jak2/engine/camera/cam-master.gc index bfffe588d4..6df57da2e0 100644 --- a/goal_src/jak2/engine/camera/cam-master.gc +++ b/goal_src/jak2/engine/camera/cam-master.gc @@ -5,5 +5,1090 @@ ;; name in dgo: cam-master ;; dgos: ENGINE, GAME +;; TODO - waiting for particle code for cam-master-effect and such, two instances of commented out code here + +;;og:ignore-form:camera-master-method-16 + ;; DECOMP BEGINS + +(defbehavior reset-follow camera-master () + (let ((a0-1 (handle->process (-> self focus handle)))) + (when (the-as process-focusable a0-1) + (set! (-> self tpos-old quad) (-> (get-trans (the-as process-focusable a0-1) 4) quad)) + (set! (-> self tpos-curr quad) (-> self tpos-old quad)) + (set! (-> self tpos-old-adj quad) (-> self tpos-old quad)) + (set! (-> self tpos-curr-adj quad) (-> self tpos-old quad)) + (set! (-> self tpos-tgt quad) (-> self tpos-old quad)) + (set! (-> self upspeed) 0.0) + ) + ) + ) + +;; WARN: Return type mismatch none vs symbol. +(defbehavior reset-target-tracking camera-master () + (let ((gp-0 (handle->process (-> self focus handle)))) + (the-as + symbol + (when gp-0 + (set! (-> self tpos-old quad) (-> (get-trans (the-as process-focusable gp-0) 4) quad)) + (set! (-> self tpos-curr quad) (-> self tpos-old quad)) + (set! (-> self tpos-old-adj quad) (-> self tpos-old quad)) + (set! (-> self tpos-curr-adj quad) (-> self tpos-old quad)) + (set! (-> self tpos-tgt quad) (-> self tpos-old quad)) + (quaternion->matrix (-> self tgt-rot-mat) (get-quat (the-as process-focusable gp-0) 2)) + (quaternion->matrix (-> self tgt-face-mat) (get-quat (the-as process-focusable gp-0) 1)) + (vector-reset! (-> self pitch-off)) + (set! (-> self upspeed) 0.0) + (set! (-> self on-ground) + (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status in-air))) + ) + (set! (-> self on-pole) #f) + (set! (-> self ease-t) 1.0) + (set! (-> self string-max target y) (-> self settings string-max-height)) + (set! (-> self string-max target z) (-> self settings string-max-length)) + (set! (-> self string-push-z) (fmax (-> self string-min value z) (-> *CAMERA-bank* default-string-push-z))) + (cond + ((>= (- (-> self clock frame-counter) (process-focusable-method-25 (the-as process-focusable gp-0))) + (-> *CAMERA-bank* attack-timeout) + ) + (set! (-> self being-attacked) #f) + ) + (else + (set! (-> self attack-start) (-> self clock frame-counter)) + (set! (-> self being-attacked) #t) + (when (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) + (set! (-> self string-max target y) (fmax (-> self string-max target y) (-> last-try-to-look-at-data vert))) + (set! (-> self string-max target z) (fmax (-> self string-max target z) (-> last-try-to-look-at-data horz))) + (set! (-> self string-push-z) (fmax (-> self string-push-z) (-> self string-max target z))) + ) + ) + ) + (cond + ((logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status under-water)) + (set! (-> self under-water) 2) + ) + (else + (set! (-> self under-water) 0) + 0 + ) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (vector--float*! gp-1 (-> self tpos-curr-adj) (-> self local-down) (-> self settings target-height)) + (tracking-spline-method-10 (-> self target-spline) gp-1) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch object vs symbol. +(defbehavior master-track-target camera-master () + (let ((gp-0 (handle->process (-> self focus handle)))) + (the-as + symbol + (cond + ((and *target* (not gp-0)) + (try-update-focus (-> self focus) *target*) + (logior! (-> self master-options) 1) + (reset-target-tracking) + ) + ((and (logtest? (-> self master-options) 1) (not gp-0)) + (let ((v0-1 (the-as object (logand -2 (-> self master-options))))) + (set! (-> self master-options) (the-as uint v0-1)) + v0-1 + ) + ) + ((paused?) + #f + ) + (gp-0 + (logior! (-> self master-options) 1) + (cond + ((>= (- (-> self clock frame-counter) (process-focusable-method-25 (the-as target gp-0))) + (-> *CAMERA-bank* attack-timeout) + ) + (set! (-> self being-attacked) #f) + ) + (else + (if (not (-> self being-attacked)) + (set! (-> self attack-start) (-> self clock frame-counter)) + ) + (set! (-> self being-attacked) #t) + (when (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) + (set! (-> self string-max target y) (fmax (-> self string-max target y) (-> last-try-to-look-at-data vert))) + (set! (-> self string-max target z) (fmax (-> self string-max target z) (-> last-try-to-look-at-data horz))) + (set! (-> self string-push-z) (fmax (-> self string-push-z) (-> self string-max target z))) + ) + ) + ) + (cond + ((logtest? (-> (the-as target gp-0) focus-status) (focus-status under-water)) + (set! (-> self under-water) 2) + ) + ((> (-> self under-water) 0) + (+! (-> self under-water) -1) + ) + ) + (set! (-> self tpos-old quad) (-> self tpos-curr quad)) + (set! (-> self tpos-old-adj quad) (-> self tpos-curr-adj quad)) + (quaternion->matrix (-> self tgt-rot-mat) (get-quat (the-as target gp-0) 2)) + (quaternion->matrix (-> self tgt-face-mat) (get-quat (the-as target gp-0) 1)) + (cond + ((< (-> self ease-t) 1.0) + (new 'stack-no-clear 'vector) + (cond + ((logtest? (-> self master-options) 8) + (vector-lerp! + (-> self tpos-curr) + (-> self ease-from) + (-> self ease-to) + (parameter-ease-sin-clamp (-> self ease-t)) + ) + (set! (-> self master-options) (logand -9 (-> self master-options))) + ) + (else + (vector-lerp! + (-> self tpos-curr) + (-> self ease-from) + (get-trans (the-as target gp-0) 4) + (parameter-ease-sin-clamp (-> self ease-t)) + ) + ) + ) + (+! (-> self ease-t) (-> self ease-step)) + ) + (else + (set! (-> self tpos-curr quad) (-> (get-trans (the-as target gp-0) 4) quad)) + ) + ) + (when (logtest? (-> (the-as target gp-0) focus-status) (focus-status edge-grab)) + (if *display-cam-los-debug* + (format *stdcon* "ride edge~%") + ) + (let ((s5-6 (new 'stack-no-clear 'collide-query))) + (vector--float*! + (-> s5-6 start-pos) + (-> self tpos-curr) + (-> self local-down) + (-> self settings target-height) + ) + (vector-float*! (-> s5-6 move-dist) (the-as vector (&-> self stack 256)) 4915.2) + (vector-! (-> s5-6 start-pos) (-> s5-6 start-pos) (-> s5-6 move-dist)) + (let ((s4-4 s5-6)) + (set! (-> s4-4 radius) 4300.8) + (set! (-> s4-4 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) + (set! (-> s4-4 ignore-process0) #f) + (set! (-> s4-4 ignore-process1) #f) + (set! (-> s4-4 ignore-pat) (the-as pat-surface (camera-master-method-16 self #t))) + (set! (-> s4-4 action-mask) (collide-action solid)) + ) + (let ((f0-16 (fill-and-probe-using-line-sphere *collide-cache* s5-6))) + (if (and (< 0.0 f0-16) (< f0-16 1.0)) + (vector+float*! (-> self tpos-curr) (-> self tpos-curr) (-> s5-6 move-dist) (+ -1.0 f0-16)) + ) + ) + ) + ) + (set! (-> self on-ground) (zero? (logand (-> (the-as target gp-0) focus-status) (focus-status in-air)))) + (let ((s5-7 (new-stack-vector0))) + 0.0 + (cond + ((and (logtest? (-> (the-as target gp-0) focus-status) (focus-status in-air)) + (zero? (logand (focus-status halfpipe super) (-> (the-as target gp-0) focus-status))) + ) + (if *display-cam-los-debug* + (format *stdcon* "air tracking~%") + ) + (vector+float*! (-> self tpos-curr-adj) (-> self tpos-curr-adj) (-> self local-down) (-> self upspeed)) + (vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) (-> self upspeed)) + (vector-! s5-7 (-> self tpos-curr) (-> self tpos-tgt)) + (let ((f30-0 (vector-dot s5-7 (-> self local-down)))) + (vector--float*! s5-7 s5-7 (-> self local-down) f30-0) + (if (< 0.0 f30-0) + (set! (-> self upspeed) (* 0.5 (-> self upspeed))) + ) + (vector+! (-> self tpos-tgt) (-> self tpos-tgt) s5-7) + (let ((f0-26 (* 0.05 f30-0))) + (vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) f0-26) + ) + ) + (vector-! s5-7 (-> self tpos-curr-adj) (-> self tpos-tgt)) + (let* ((f0-28 (vector-dot s5-7 (-> self local-down))) + (f0-29 (if (< 0.0 f0-28) + (* f0-28 (-> *CAMERA_MASTER-bank* up-move-to-pitch-ratio-in-air)) + (* f0-28 (-> *CAMERA_MASTER-bank* down-move-to-pitch-ratio-in-air)) + ) + ) + ) + (vector+float*! (-> self tpos-curr-adj) (-> self tpos-tgt) (-> self local-down) f0-29) + ) + (vector-! s5-7 (get-trans (the-as target gp-0) 1) (-> self tpos-curr-adj)) + (let* ((f0-31 (vector-dot s5-7 (-> self local-down))) + (f0-32 (* 0.03 f0-31)) + ) + (if (and (< f0-32 0.0) (< f0-32 (-> self upspeed))) + (set! (-> self upspeed) f0-32) + ) + ) + ) + (else + (if *display-cam-los-debug* + (format *stdcon* "ground tracking~%") + ) + (vector-! s5-7 (-> self tpos-curr) (-> self tpos-old)) + (let ((f0-34 (vector-dot s5-7 (-> self local-down)))) + (cond + ((and (logtest? (-> (the-as target gp-0) focus-status) (focus-status touch-water)) + (zero? (logand (focus-status mech) (-> (the-as target gp-0) focus-status))) + ) + (set! (-> self upspeed) 0.0) + ) + ((< 0.0 f0-34) + (set! (-> self upspeed) 0.0) + ) + (else + (set! (-> self upspeed) f0-34) + ) + ) + ) + (set! (-> self tpos-tgt quad) (-> self tpos-curr quad)) + (vector-! s5-7 (-> self tpos-curr-adj) (-> self tpos-curr)) + (let* ((f0-38 (vector-dot s5-7 (-> self local-down))) + (f0-39 (cond + ((logtest? (cam-slave-options RAPID_TRACKING) (-> self settings slave-options)) + 0.0 + ) + ((< 0.0 f0-38) + (* f0-38 (-> *CAMERA_MASTER-bank* up-move-to-pitch-on-ground)) + ) + (else + (* f0-38 (-> *CAMERA_MASTER-bank* down-move-to-pitch-on-ground)) + ) + ) + ) + ) + (vector+float*! (-> self tpos-curr-adj) (-> self tpos-curr) (-> self local-down) f0-39) + ) + ) + ) + ) + (if (not (logtest? (-> self settings slave-options) (cam-slave-options JUMP_PITCHES))) + (reset-follow) + ) + (when (and (logtest? (-> (the-as target gp-0) focus-status) (focus-status on-water under-water)) + (zero? (logand (focus-status mech) (-> (the-as target gp-0) focus-status))) + ) + (let ((f0-41 (- (process-focusable-method-24 (the-as target gp-0)) (-> self settings target-height)))) + (if (< (-> self tpos-curr-adj y) f0-41) + (set! (-> self tpos-curr-adj y) f0-41) + ) + ) + ) + (vector+! (-> self pitch-off) (-> self pitch-off) (-> self tpos-curr)) + (vector-! (-> self pitch-off) (-> self pitch-off) (-> self tpos-old)) + (vector-float*! (-> self pitch-off) (-> self pitch-off) (-> *CAMERA_MASTER-bank* pitch-off-blend)) + (let ((s5-8 (new 'stack-no-clear 'vector))) + (vector--float*! s5-8 (-> self tpos-curr-adj) (-> self local-down) (-> self settings target-height)) + (let ((s4-7 (new 'stack-no-clear 'vector))) + 0.0 + (vector-! s4-7 (get-trans (the-as target gp-0) 1) s5-8) + (let* ((f0-46 (vector-dot s4-7 (-> self local-down))) + (f0-47 (+ -4096.0 f0-46)) + ) + (if (< f0-47 0.0) + (vector+float*! s5-8 s5-8 (-> self local-down) f0-47) + ) + ) + ) + (tracking-spline-method-17 (-> self target-spline) s5-8 2048.0 0.0 #f) + ) + (tracking-spline-method-22 (-> self target-spline) 40960.0) + ) + ) + ) + ) + ) + +(defun setup-slave-for-hopefull ((arg0 camera-slave)) + (when (= (-> arg0 blend-to-type) (camera-blend-to-type unknown-2)) + (cam-calc-follow! (-> arg0 tracking) (-> arg0 trans) #f) + (slave-set-rotation! (-> arg0 tracking) (-> arg0 trans) (the-as float (-> arg0 options)) (-> arg0 fov) #f) + ) + (none) + ) + +(defbehavior master-is-hopeful-better? camera-master ((arg0 camera-slave) (arg1 camera-slave)) + (cond + ((not *camera-combiner*) + #f + ) + ((not arg0) + #t + ) + (else + (< (vector-dot (the-as vector (&-> arg0 stack 112)) (-> *camera-combiner* inv-camera-rot vector 2)) + (vector-dot (the-as vector (&-> arg1 stack 112)) (-> *camera-combiner* inv-camera-rot vector 2)) + ) + ) + ) + ) + +(defbehavior master-choose-entity camera-master ((arg0 cam-setting-data)) + (local-vars + (v1-22 symbol) + (sv-96 res-tag) + (sv-112 process) + (sv-128 (pointer process)) + (sv-144 int) + (sv-160 string) + (sv-176 string) + (sv-192 uint) + ) + (let ((s5-0 (entity-by-name (-> arg0 entity-name)))) + (set! (-> arg0 real-entity-name) #f) + (when s5-0 + (let ((s2-0 (cam-state-from-entity s5-0))) + (cond + (s2-0 + (set! (-> arg0 real-entity-name) (-> arg0 entity-name)) + (set! (-> arg0 cam-mode) (the-as symbol s2-0)) + (if (-> arg0 teleport-on-entity-change) + (send-event *camera* 'teleport) + ) + ) + (else + (format 0 "ERROR : camera entity '~S' didn't produce a state~%" (res-lump-struct s5-0 'name structure)) + ) + ) + (set! sv-96 (new 'static 'res-tag)) + (let ((s4-1 (res-lump-data s5-0 'alternates pointer :tag-ptr (& sv-96)))) + (when s4-1 + (let* ((s1-1 (get-process *camera-dead-pool* camera-slave #x4000)) + (s3-1 (when s1-1 + (let ((t9-7 (method-of-type camera-slave activate))) + (t9-7 + (the-as camera-slave s1-1) + *camera* + (symbol->string (-> camera-slave symbol)) + (the-as pointer #x70004000) + ) + ) + (run-now-in-process s1-1 cam-slave-init s2-0 s5-0) + (the-as (pointer camera-slave) (-> s1-1 ppointer)) + ) + ) + ) + (if s3-1 + (setup-slave-for-hopefull (the-as camera-slave (ppointer->process s3-1))) + (format 0 "ERROR : primary region activate failed~%") + ) + (dotimes (s2-1 (the-as int (-> sv-96 elt-count))) + (let ((s0-0 (entity-by-name (the-as string (-> (the-as (pointer uint32) (&+ s4-1 (* s2-1 4)))))))) + (cond + (s0-0 + (let ((s1-2 (cam-state-from-entity s0-0))) + (cond + (s1-2 + (set! sv-112 (get-process *camera-dead-pool* camera-slave #x4000)) + (set! v1-22 (when sv-112 + (set! sv-128 (the-as (pointer process) v1-22)) + (let ((t9-14 (method-of-type camera-slave activate))) + (t9-14 + (the-as camera-slave sv-112) + *camera* + (symbol->string (-> camera-slave symbol)) + (the-as pointer #x70004000) + ) + ) + (run-now-in-process sv-112 cam-slave-init s1-2 s0-0) + (set! sv-128 (-> sv-112 ppointer)) + v1-22 + ) + ) + (cond + (sv-128 + (setup-slave-for-hopefull (the-as camera-slave (ppointer->process sv-128))) + (cond + ((master-is-hopeful-better? + (the-as camera-slave (ppointer->process s3-1)) + (the-as camera-slave (ppointer->process sv-128)) + ) + (if s3-1 + (deactivate (-> s3-1 0)) + ) + (set! s3-1 (the-as (pointer camera-slave) sv-128)) + (set! (-> arg0 real-entity-name) (the-as string (-> (the-as (pointer uint32) (&+ s4-1 (* s2-1 4)))))) + (set! (-> arg0 cam-mode) (the-as symbol s1-2)) + ) + (else + (deactivate (-> sv-128 0)) + ) + ) + ) + (else + (format 0 "ERROR : alternate region activate failed~%") + ) + ) + ) + (else + (let ((s1-5 format)) + (set! sv-144 0) + (set! sv-160 "ERROR : alternate camera region '~S' didn't produce a state~%") + (let ((a2-14 (res-lump-struct s0-0 'name structure))) + (s1-5 sv-144 sv-160 a2-14) + ) + ) + ) + ) + ) + ) + (else + (let ((s1-7 format) + (s0-1 0) + ) + (set! sv-176 "ERROR : alternate '~S' not found for '~S'~%") + (set! sv-192 (-> (the-as (pointer uint32) (&+ s4-1 (* s2-1 4))))) + (let ((a3-8 (res-lump-struct s5-0 'name structure))) + (s1-7 s0-1 sv-176 sv-192 a3-8) + ) + ) + ) + ) + ) + ) + (if s3-1 + (deactivate (-> s3-1 0)) + ) + ) + ) + ) + ) + ) + ) + (cond + ((-> arg0 real-entity-name) + #f + ) + ((-> arg0 mode-name) + (let ((s5-1 (-> arg0 mode-name value))) + (set! (-> arg0 cam-mode) (the-as symbol (if (type? s5-1 state) + s5-1 + ) + ) + ) + ) + (set! (-> arg0 real-entity-name) #f) + #f + ) + (else + (set! (-> arg0 cam-mode) (the-as symbol cam-free-floating)) + (set! (-> arg0 real-entity-name) #f) + #f + ) + ) + ) + +(defun cam-master-set-entity ((arg0 cam-setting-data)) + (if (-> arg0 entity-or-mode-changed) + (master-choose-entity arg0) + ) + (let ((s5-0 (entity-by-name (-> arg0 entity-name)))) + (when s5-0 + (set! (-> arg0 fov) (cam-slave-get-fov s5-0)) + (set! (-> arg0 string-min-height) + (cam-slave-get-float s5-0 'stringMinHeight (-> *CAMERA-bank* default-string-min-y)) + ) + (set! (-> arg0 string-max-height) + (cam-slave-get-float s5-0 'stringMaxHeight (-> *CAMERA-bank* default-string-max-y)) + ) + (set! (-> arg0 string-min-length) + (cam-slave-get-float s5-0 'stringMinLength (-> *CAMERA-bank* default-string-min-z)) + ) + (let ((f0-8 (cam-slave-get-float s5-0 'stringMaxLength (-> *CAMERA-bank* default-string-max-z)))) + (if (< 405504.0 f0-8) + (set! f0-8 (-> *CAMERA-bank* default-string-max-z)) + ) + (set! (-> arg0 string-max-length) f0-8) + ) + (set! (-> arg0 string-default) #f) + (set! (-> arg0 string-cliff-height) (cam-slave-get-float s5-0 'stringCliffHeight 163840.0)) + (let ((a1-5 (new 'stack-no-clear 'vector))) + (when (cam-slave-get-vector-with-offset (the-as entity-actor s5-0) a1-5 'interesting) + ) + ) + (set! (-> arg0 interp-time) (the-as uint (the int (* 300.0 (cam-slave-get-interp-time s5-0))))) + (let ((s4-0 (method-of-type res-lump get-property-value)) + (s3-0 s5-0) + ) + (format (clear *res-key-string*) "~S~S" 'flags '-on) + (let ((s4-1 (s4-0 + s3-0 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (s3-1 (method-of-type res-lump get-property-value)) + ) + (format (clear *res-key-string*) "~S~S" 'flags '-off) + (let ((v1-19 (s3-1 + s5-0 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (logior! (-> arg0 slave-options) s4-1) + (logclear! (-> arg0 slave-options) v1-19) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defun cam-master-activate-slave ((arg0 symbol)) + (when (and *camera* (or arg0 (not (-> *camera* slave)) (-> *camera* settings entity-or-mode-changed))) + (when (and arg0 (-> *camera* slave)) + (deactivate (-> *camera* slave 0)) + (set! (-> *camera* slave) (the-as (pointer camera-slave) #f)) + ) + (let* ((s5-0 (-> *camera* settings)) + (gp-0 (entity-by-name (-> s5-0 real-entity-name))) + (s5-1 (the-as object (-> s5-0 cam-mode))) + ) + (if (not (the-as symbol s5-1)) + (set! s5-1 cam-free-floating) + ) + (send-event + *camera* + 'set-slave + (ppointer->process + (process-spawn camera-slave :init cam-slave-init s5-1 gp-0 :from *camera-dead-pool* :to *camera*) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate cam-master-active (camera-master) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (local-vars (v0-0 none) (v1-125 uint)) + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (let ((v1-0 event-type)) + (the-as + object + (cond + ((= v1-0 'dist-from-interp-src) + (cond + ((not *camera-combiner*) + #x48c80000 + ) + ((= (-> *camera-combiner* interp-val) 0.0) + 0 + ) + (else + (-> *camera-combiner* dist-from-src) + ) + ) + ) + ((= v1-0 'dist-from-interp-dest) + (cond + ((not *camera-combiner*) + 0 + ) + ((= (-> *camera-combiner* interp-val) 0.0) + #x48c80000 + ) + (else + (-> *camera-combiner* dist-from-dest) + ) + ) + ) + ((= v1-0 'level-deactivate) + (format 0 "ERROR : *camera* level-deactivate event not supported anymore~%") + ) + ((= v1-0 'clear-entity) + (format 0 "ERROR : *camera* clear-entity event not supported anymore~%") + ) + ((= v1-0 'no-intro) + (format 0 "ERROR : *camera* no-intro event not supported anymore '~S'~%" (-> event param 0)) + ) + ((= v1-0 'force-blend) + (format 0 "ERROR : *camera* force-blend event not supported anymore '~S'~%" (-> event param 0)) + ) + ((= v1-0 'teleport-to-transformq) + (when (> arg1 0) + (let ((gp-1 (the-as object (-> event param 0)))) + (when (-> self slave) + (deactivate (-> self slave 0)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) + ) + (set! (-> *camera-combiner* trans quad) (-> (the-as matrix gp-1) vector 0 quad)) + (quaternion->matrix (-> *camera-combiner* inv-camera-rot) (the-as quaternion (+ (the-as uint gp-1) 16))) + ) + (send-event self 'teleport) + (cam-master-activate-slave #f) + #t + ) + ) + ((= v1-0 'teleport-to-other-start-string) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (when (-> self slave) + (deactivate (-> self slave 0)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) + ) + (set! (-> *camera-combiner* trans quad) (-> *camera-other-trans* quad)) + (vector-! gp-2 (-> self tpos-curr-adj) *camera-other-trans*) + (vector-normalize! gp-2 1.0) + (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-2 (new 'static 'vector :y -1.0)) + ) + (send-event self 'teleport) + (cam-master-activate-slave #f) + ) + ((= v1-0 'teleport-to-vector-start-string) + (when (> arg1 0) + (let ((s5-0 (the-as object (-> event param 0))) + (gp-3 (new 'stack-no-clear 'vector)) + ) + (when (-> self slave) + (deactivate (-> self slave 0)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) + ) + (set! (-> *camera-combiner* trans quad) (-> (the-as vector s5-0) quad)) + (vector-! gp-3 (-> self tpos-curr-adj) (the-as vector s5-0)) + (vector-normalize! gp-3 1.0) + (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-3 (new 'static 'vector :y -1.0)) + ) + (send-event self 'teleport) + (cam-master-activate-slave #f) + ) + ) + ((= v1-0 'change-target) + (let ((a1-15 (-> event param 0))) + (cond + ((not a1-15) + (clear-focused (-> self focus)) + (set! (-> self master-options) (logand -2 (-> self master-options))) + ) + (else + (try-update-focus (-> self focus) (the-as process-focusable a1-15)) + (logior! (-> self master-options) 1) + (reset-target-tracking) + ) + ) + ) + (set! (-> *camera-combiner* tracking no-follow) #f) + #f + ) + ((= v1-0 'intro-done?) + (or (not (-> self slave)) (>= (-> self slave 0 intro-t) 1.0)) + ) + ((= v1-0 'query-state) + (and (-> self slave) (= (-> self slave 0 next-state) (-> event param 0))) + ) + ((= v1-0 'change-to-entity-by-name) + (format + 0 + "ERROR : *camera* change-to-entity-by-name event not supported anymore '~S'~%" + (-> event param 0) + ) + ) + ((= v1-0 'change-state) + (format 0 "ERROR : *camera* change-state event not supported anymore ~A~%" (-> event param 0)) + ) + ((= v1-0 'set-slave) + (let ((s5-1 (process->ppointer (the-as process (-> event param 0)))) + (s4-0 (-> self settings interp-time)) + (gp-4 (-> self slave)) + ) + (when (and s5-1 (!= s5-1 gp-4)) + (set! (-> self slave) (the-as (pointer camera-slave) s5-1)) + (logior! (-> self master-options) 2) + (set! (-> *camera-combiner* tracking tilt-adjust target) (-> self slave 0 tracking tilt-adjust target)) + (cond + ((or (zero? s4-0) (not gp-4)) + (if *math-camera* + (set! (-> *math-camera* reset) 1) + ) + (send-event *camera-combiner* 'set-interpolation 0) + (send-event *camera-combiner* 'stop-tracking) + (if (= (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) (camera-blend-to-type unknown-2)) + (send-event *camera-combiner* 'start-tracking (ppointer->process s5-1)) + ) + ) + ((begin + (when (< 0.0 (-> gp-4 0 intro-t-step)) + (set! (-> self outro-t) (-> gp-4 0 intro-t)) + (set! (-> self outro-t-step) (/ -5.0 (the float s4-0))) + (set! (-> self outro-exit-value) (-> gp-4 0 outro-exit-value)) + (curve-copy! (-> self outro-curve) (-> gp-4 0 intro-curve)) + ) + (if (-> self settings no-intro) + (set! (-> self outro-t) 0.0) + ) + (send-event *camera-combiner* 'set-interpolation s4-0) + (cond + ((zero? (-> gp-4 0 blend-from-type)) + (send-event (ppointer->process (-> self decel)) 'change-state cam-fixed) + (send-event *camera-combiner* 'stop-tracking) + ) + (else + (send-event (ppointer->process (-> self decel)) 'change-state cam-decel) + ) + ) + (set! v1-125 (-> *camera-combiner* tracking-status)) + (zero? v1-125) + ) + (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) + (((camera-blend-to-type unknown-0)) + ) + (((camera-blend-to-type unknown-1)) + ) + (((camera-blend-to-type unknown-2)) + (if (= (-> gp-4 0 blend-from-type) 1) + (send-event *camera-combiner* 'copy-tracking (ppointer->process gp-4)) + (send-event *camera-combiner* 'start-tracking (ppointer->process s5-1)) + ) + (set! (-> *camera-combiner* tracking-status) (the-as uint 2)) + ) + (else + (format 0 "unknown blend-to type~%") + ) + ) + ) + ((= v1-125 1) + (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) + (((camera-blend-to-type unknown-0)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 3)) + ) + (((camera-blend-to-type unknown-1)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 3)) + ) + (((camera-blend-to-type unknown-2)) + ) + (else + (format 0 "unknown blend-to type~%") + ) + ) + ) + ((or (= v1-125 2) (= v1-125 3)) + (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) + (((camera-blend-to-type unknown-0)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 0)) + 0 + ) + (((camera-blend-to-type unknown-1)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 0)) + 0 + ) + (((camera-blend-to-type unknown-2)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 2)) + ) + (else + (format 0 "unknown blend-to type~%") + ) + ) + ) + (else + (format 0 "unknown combiner status~%") + ) + ) + (if gp-4 + (deactivate (-> gp-4 0)) + ) + ) + ) + ) + ((= v1-0 'ease-in) + (cond + ((< arg1 1) + (set! (-> self ease-t) 0.0) + (set! (-> self master-options) (logand -9 (-> self master-options))) + ) + ((< arg1 2) + (if (< (the-as float (-> event param 0)) (-> self ease-t)) + (set! (-> self ease-t) (the-as float (-> event param 0))) + ) + (set! (-> self master-options) (logand -9 (-> self master-options))) + ) + (else + (if (< (the-as float (-> event param 0)) (-> self ease-t)) + (set! (-> self ease-t) (the-as float (-> event param 0))) + ) + (set! (-> self ease-to quad) (-> (the-as vector (-> event param 1)) quad)) + (logior! (-> self master-options) 8) + ) + ) + (set! (-> self ease-step) 0.033333335) + (set! v0-0 (the-as none (-> self ease-from))) + (set! (-> (the-as vector v0-0) quad) (-> self tpos-curr-adj quad)) + v0-0 + ) + ((= v1-0 'damp-up) + (set! (-> self upspeed) 0.0) + ) + ((= v1-0 'reset-follow) + (reset-follow) + ) + ((= v1-0 'teleport) + (reset-target-tracking) + (if (-> self slave) + (send-event (ppointer->process (-> self slave)) event-type) + ) + (send-event *camera-combiner* event-type) + ) + ((= v1-0 'toggle-slave-option) + (logxor! (-> self slave-options) (-> event param 0)) + (if (-> self slave) + (logxor! (-> self slave 0 options) (-> event param 0)) + ) + (when (-> self decel) + (set! v0-0 (the-as none (logxor (-> self decel 0 options) (-> event param 0)))) + (set! (-> self decel 0 options) (the-as uint v0-0)) + v0-0 + ) + ) + ((= v1-0 'slave-option?) + (and (-> self slave) (logtest? (-> self slave 0 options) (-> event param 0))) + ) + ((= v1-0 'set-slave-option) + (when (-> self slave) + (set! v0-0 (the-as none (logior (-> self slave 0 options) (-> event param 0)))) + (set! (-> self slave 0 options) (the-as uint v0-0)) + v0-0 + ) + ) + ((= v1-0 'clear-slave-option) + (when (-> self slave) + (set! v0-0 (the-as none (logclear (-> self slave 0 options) (-> event param 0)))) + (set! (-> self slave 0 options) (the-as uint v0-0)) + v0-0 + ) + ) + ((= v1-0 'no-follow) + (when (-> self slave) + (set! (-> self slave 0 tracking no-follow) (the-as basic #t)) + (vector-reset! (-> self slave 0 tracking follow-off)) + ) + (set! (-> *camera-combiner* tracking no-follow) (the-as basic #t)) + (set! v0-0 (the-as none (-> *camera-combiner* tracking follow-off))) + (.svf (&-> (the-as vector v0-0) quad) vf0) + v0-0 + ) + ((= v1-0 'yes-follow) + (if (-> self slave) + (set! (-> self slave 0 tracking no-follow) #f) + ) + (set! (-> *camera-combiner* tracking no-follow) #f) + #f + ) + ((= v1-0 'blend-from-as-fixed) + (let ((t9-42 format) + (a0-101 0) + (a1-35 "ERROR : *camera* blend-from-as-fixed event not supported anymore~%") + ) + (-> event param 0) + (t9-42 a0-101 a1-35) + ) + ) + ((= v1-0 'point-of-interest) + (let ((t9-43 format) + (a0-102 0) + (a1-36 "ERROR : *camera* point-of-interest event not supported anymore~%") + ) + (-> event param 0) + (t9-43 a0-102 a1-36) + ) + ) + ((= v1-0 'part-water-drip) + (set! (-> self water-drip-time) (-> self clock frame-counter)) + (set! (-> self water-drip-mult) (the-as float (-> event param 0))) + (set! (-> self water-drip-speed) (the-as float (-> event param 1))) + ) + (else + (and (-> self slave) (let ((v1-237 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-237 from) (process->ppointer proc)) + (set! (-> v1-237 num-params) arg1) + (set! (-> v1-237 message) event-type) + (set! (-> v1-237 param 0) (-> event param 0)) + (set! (-> v1-237 param 1) (-> event param 1)) + (set! (-> v1-237 param 2) (-> event param 2)) + (set! (-> v1-237 param 3) (-> event param 3)) + (set! (-> v1-237 param 4) (-> event param 4)) + (set! (-> v1-237 param 5) (-> event param 5)) + (send-event-function (ppointer->process (-> self slave)) v1-237) + ) + ) + ) + ) + ) + ) + ) + ) + :enter (behavior () + (let ((v1-1 + (process-spawn camera-slave :init cam-slave-init cam-free-floating #f :from *camera-dead-pool* :to self) + ) + ) + (set! (-> self slave) (the-as (pointer camera-slave) v1-1)) + (if (not v1-1) + (format 0 "ERROR : first slave failed to activate~%") + ) + ) + (let ((v1-8 (process-spawn camera-slave :init cam-slave-init cam-fixed #f :from *camera-dead-pool* :to self))) + (set! (-> self decel) (the-as (pointer camera-slave) v1-8)) + (if (not v1-8) + (format 0 "ERROR : decel failed to activate~%") + ) + ) + (if (and (nonzero? camera-master-debug) *debug-segment*) + (add-connection *debug-engine* self camera-master-debug self #f #f) + ) + (none) + ) + :trans (behavior () + (when (not (paused?)) + (vector-negate! + (-> self local-down) + (vector-normalize-copy! (-> self local-down) (-> *standard-dynamics* gravity) 1.0) + ) + ;; TODO - waiting for particle code + ;; (cam-master-effect) + ) + (none) + ) + :code (behavior () + (until #f + (when *debug-segment* + (let ((gp-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-7 'camera) + (s5-0 *profile-camera-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s4-0 (-> gp-0 data (-> gp-0 count)))) + (let ((s3-0 (-> gp-0 base-time))) + (set! (-> s4-0 name) v1-7) + (set! (-> s4-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-0)))) + ) + (set! (-> s4-0 depth) (the-as uint (-> gp-0 depth))) + (set! (-> s4-0 color) s5-0) + (set! (-> gp-0 segment (-> gp-0 depth)) s4-0) + ) + (+! (-> gp-0 count) 1) + (+! (-> gp-0 depth) 1) + (set! (-> gp-0 max-depth) (max (-> gp-0 max-depth) (-> gp-0 depth))) + ) + ) + 0 + ) + (set! (-> self string-min target y) (-> self settings string-min-height)) + (set! (-> self string-max target y) (-> self settings string-max-height)) + (set! (-> self string-min target z) (-> self settings string-min-length)) + (set! (-> self string-max target z) (-> self settings string-max-length)) + (when (logtest? (-> *camera* settings master-options) (cam-master-options IMMEDIATE_STRING_MIN_MAX)) + (set! (-> self string-min value y) (-> self settings string-min-height)) + (set! (-> self string-max value y) (-> self settings string-max-height)) + (set! (-> self string-min value z) (-> self settings string-min-length)) + (set! (-> self string-max value z) (-> self settings string-max-length)) + ) + (set! (-> self string-push-z) (fmax (-> self string-min value z) (-> *CAMERA-bank* default-string-push-z))) + (master-track-target) + (set! (-> last-try-to-look-at-data horz) 0.0) + (set! (-> last-try-to-look-at-data vert) 0.0) + (when (not (paused?)) + (update! (-> self string-min) (the-as vector #f)) + (update! (-> self string-max) (the-as vector #f)) + ) + (set! (-> self string-min value x) + (fmin (-> self string-min value x) (+ -4.096 (-> self string-max value x))) + ) + (set! (-> self string-min value y) + (fmin (-> self string-min value y) (+ -4.096 (-> self string-max value y))) + ) + (set! (-> self string-min value z) + (fmin (-> self string-min value z) (+ -4.096 (-> self string-max value z))) + ) + (when *debug-segment* + (let ((gp-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-56 (+ (-> gp-1 depth) -1)) + (s5-1 (-> gp-1 segment v1-56)) + (s4-1 (-> gp-1 base-time)) + ) + (when (>= v1-56 0) + (set! (-> s5-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-1)))) + (+! (-> gp-1 depth) -1) + ) + ) + ) + ) + 0 + ) + (suspend) + ) + #f + (none) + ) + ) + +(defbehavior cam-master-init camera-master () + (stack-size-set! (-> self main-thread) 512) + (logclear! (-> self mask) (process-mask menu)) + (set! (-> self master-options) (the-as uint 0)) + (set! (-> self settings) (-> *setting-control* cam-current)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) + (set! (-> self decel) (the-as (pointer camera-slave) #f)) + (set! (-> self slave-options) (the-as uint 560)) + (set! (-> self view-off-param-save) 1.0) + (set! (-> self changer) (the-as uint (process->ppointer self))) + (set! (-> self string-push-z) (-> *CAMERA-bank* default-string-push-z)) + (let ((gp-0 (new-stack-vector0))) + (set! (-> gp-0 y) (-> self settings string-min-height)) + (set! (-> gp-0 z) (-> self settings string-min-length)) + (init (-> self string-min) gp-0 40.96 409.6 0.9) + (set! (-> gp-0 y) (-> self settings string-max-height)) + (set! (-> gp-0 z) (-> self settings string-max-length)) + (init (-> self string-max) gp-0 40.96 409.6 0.9) + ) + (set! (-> self outro-t-step) 0.0) + (reset-to-collide-spec (-> self focus) (collide-spec jak player-list)) + (let ((a1-4 (new-stack-vector0))) + (tracking-spline-method-10 (-> self target-spline) a1-4) + ) + ;; TODO - waiting for particle code + ;; (set! (-> self water-drip) (create-launch-control group-rain-screend-drop self)) + ;; (set! (-> self water-drip-time) (seconds -60)) + (go cam-master-active) + 0 + (none) + ) + +(defmethod camera-master-method-14 camera-master ((obj camera-master) (arg0 vector)) + (if (handle->process (-> obj focus handle)) + (vector-! arg0 (-> obj tpos-curr) (-> obj tpos-old)) + (vector-reset! arg0) + ) + arg0 + ) + +(defmethod camera-master-method-15 camera-master ((obj camera-master) (arg0 vector)) + (if (and (-> obj slave) (-> obj slave 0 next-state) (= (-> obj slave 0 next-state name) 'cam-string)) + (set! (-> arg0 quad) (-> obj slave 0 view-flat quad)) + (vector-reset! arg0) + ) + arg0 + ) diff --git a/goal_src/jak2/engine/camera/cam-start.gc b/goal_src/jak2/engine/camera/cam-start.gc index ca1808dc23..2e823e08dd 100644 --- a/goal_src/jak2/engine/camera/cam-start.gc +++ b/goal_src/jak2/engine/camera/cam-start.gc @@ -39,11 +39,4 @@ (none) ) -;; removed because it doesn't work yet. -(format #t "skipping cam-start~%") -(format 0 "skipping cam-start~%") -; (cam-start #f) - - - - +(cam-start #f) diff --git a/goal_src/jak2/engine/camera/cam-states.gc b/goal_src/jak2/engine/camera/cam-states.gc index 3453569053..cb080a33f5 100644 --- a/goal_src/jak2/engine/camera/cam-states.gc +++ b/goal_src/jak2/engine/camera/cam-states.gc @@ -5,29 +5,16 @@ ;; name in dgo: cam-states ;; dgos: ENGINE, GAME -;; TODO: -;; og:ignore-form:cam-circular-code -;; og:ignore-form:cam-circular -;; og:ignore-form:cam-bike-code -;; og:ignore-form:cam-stick-code -;; og:ignore-form:cam-string-code (define-extern cam-string-code (function vector :behavior camera-slave)) -;; og:ignore-form:cam-string-line-of-sight -;; og:ignore-form:cam-string-joystick -;; og:ignore-form:cam-circular-code -;; og:ignore-form:cam-circular-position -;; og:ignore-form:cam-los-collide -;; og:ignore-form:cam-stick -;; og:ignore-form:cam-bike ;; DECOMP BEGINS (defstate cam-really-fixed (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) (the-as object (if (= v1-0 'teleport) #f - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -51,11 +38,11 @@ ) (defstate cam-fixed (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) (the-as object (if (= v1-0 'teleport) #f - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -89,11 +76,11 @@ ) (defstate cam-fixed-read-entity (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) (the-as object (if (= v1-0 'teleport) #f - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -127,11 +114,11 @@ ) (defstate cam-pov (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) (the-as object (if (= v1-0 'teleport) #f - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -192,11 +179,11 @@ ) (defstate cam-pov180 (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) (the-as object (if (= v1-0 'teleport) #f - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -370,11 +357,11 @@ ) (defstate cam-standoff (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) (the-as object (cond ((= v1-0 'set-standoff-dist) - (vector-normalize! (-> self pivot-pt) (the-as float (-> arg3 param 0))) + (vector-normalize! (-> self pivot-pt) (the-as float (-> event param 0))) (cam-standoff-calc-trans) ) ((= v1-0 'set-standoff-height) @@ -383,12 +370,12 @@ (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down) - (the-as float (-> arg3 param 0)) + (the-as float (-> event param 0)) ) (cam-standoff-calc-trans) ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -413,7 +400,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (cam-slave-go cam-free-floating) ) (none) @@ -493,11 +480,11 @@ ) (defstate cam-eye (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) (the-as object (if (= v1-0 'teleport) #f - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -527,7 +514,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (go cam-free-floating) ) (none) @@ -539,7 +526,7 @@ (let ((s4-0 (vector-reset! (new-stack-vector0))) (s5-0 (new-stack-matrix0)) ) - (when (zero? (logand (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) (let ((f30-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx))) 0.0 @@ -589,7 +576,7 @@ ) (matrix-axis-angle! s5-0 (-> *camera* local-down) (-> s4-0 y)) (matrix*! (the-as matrix (-> self tracking)) (the-as matrix (-> self tracking)) s5-0) - (when (zero? (logand (-> self options) 8)) + (when (not (logtest? (-> self options) 8)) (if (< (vector-dot (the-as vector (&-> self stack 96)) (-> *camera* local-down)) 0.0) (forward-down->inv-matrix (the-as matrix (-> self tracking)) @@ -606,7 +593,7 @@ (matrix-axis-angle! s5-0 (the-as vector (-> self tracking)) (- (-> s4-0 x))) (matrix*! (the-as matrix (-> self tracking)) (the-as matrix (-> self tracking)) s5-0) ) - (when (zero? (logand (-> self options) 8)) + (when (not (logtest? (-> self options) 8)) (let ((f30-1 (vector-dot (-> *camera* local-down) (the-as vector (&-> self stack 112))))) (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) (when (< (sin (-> *CAM_EYE-bank* max-degrees)) (fabs f30-1)) @@ -733,7 +720,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (cam-slave-go cam-free-floating) ) (none) @@ -754,11 +741,11 @@ ) (defstate cam-decel (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) (the-as object (if (= v1-0 'teleport) #f - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -808,11 +795,11 @@ ) (defstate cam-endlessfall (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) (the-as object (if (= v1-0 'teleport) #f - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -862,12 +849,348 @@ ) ) +(defbehavior cam-circular-position-into-max-angle camera-slave ((arg0 vector) (arg1 vector) (arg2 float)) + (let* ((f30-0 (vector-normalize-ret-len! arg0 1.0)) + (f26-0 (vector-normalize-ret-len! arg1 1.0)) + (f0-1 (vector-dot arg0 arg1)) + (f28-0 (acos f0-1)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (let ((f24-0 (analog-input + (the-as int (-> *cpad-list* cpads 0 rightx)) + 128.0 + 32.0 + 110.0 + (* 8192.0 (-> self clock seconds-per-frame)) + ) + ) + (f1-2 (analog-input + (the-as int (-> *cpad-list* cpads 0 righty)) + 128.0 + 32.0 + 110.0 + (* 8192.0 (-> self clock seconds-per-frame)) + ) + ) + (s2-0 (new-stack-matrix0)) + ) + (let ((v1-15 (new 'stack-no-clear 'vector))) + 0.0 + (when (< (-> self max-angle-offset) 1820.4445) + (set! f24-0 0.0) + (set! f1-2 0.0) + ) + (if (< (-> self pivot-rad) f30-0) + (set! f24-0 (- f24-0)) + ) + (vector-cross! v1-15 arg1 arg0) + (let ((f0-10 (vector-dot v1-15 (-> *camera* local-down)))) + (if (< f1-2 0.0) + (set! f1-2 (fmax f1-2 (* -0.15 f28-0))) + ) + (if (< f0-10 0.0) + (set! f1-2 (- f1-2)) + ) + (let* ((f1-3 (+ f24-0 f1-2)) + (f1-5 + (fmin (* 8192.0 (-> self clock seconds-per-frame)) (fmax (* -8192.0 (-> self clock seconds-per-frame)) f1-3)) + ) + ) + (cond + ((and (< 0.0 f1-5) (< 0.0 f0-10) (< (-> self max-angle-curr) f28-0)) + (set! f1-5 0.0) + ) + ((and (< 0.0 f1-5) (< 0.0 f0-10)) + (set! f1-5 (fmin f1-5 (* 0.15 (- (-> self max-angle-curr) f28-0)))) + ) + ((and (< f1-5 0.0) (< f0-10 0.0) (< (-> self max-angle-curr) f28-0)) + (set! f1-5 0.0) + ) + ((and (< f1-5 0.0) (< f0-10 0.0)) + (set! f1-5 (fmax f1-5 (* 0.15 (- f28-0 (-> self max-angle-curr))))) + ) + ) + (matrix-axis-angle! s2-0 (-> *camera* local-down) f1-5) + ) + ) + ) + (vector-matrix*! arg1 arg1 s2-0) + ) + (let ((f0-16 (vector-dot arg0 arg1))) + (set! f28-0 (acos f0-16)) + ) + ) + (cond + ((< (-> self max-angle-curr) f28-0) + (matrix-from-two-vectors-max-angle! + s4-0 + arg1 + arg0 + (* (fmin 1.0 (* arg2 (-> self clock time-adjust-ratio))) (- f28-0 (-> self max-angle-curr))) + ) + (vector-matrix*! arg0 arg1 s4-0) + ) + ((and (logtest? (-> self options) 2) + (or (and (>= f26-0 (+ -8192.0 f30-0)) (>= f30-0 (+ -8192.0 (-> self pivot-rad)))) + (and (>= (+ 8192.0 f30-0) f26-0) (>= (+ 8192.0 (-> self pivot-rad)) f30-0)) + ) + ) + (let ((s2-1 (new 'stack-no-clear 'vector))) + (vector-cross! s2-1 arg1 arg0) + (vector-normalize! s2-1 1.0) + (matrix-axis-angle! + s4-0 + s2-1 + (* (fmin 1.0 (* arg2 (-> self clock time-adjust-ratio))) (- (-> self max-angle-curr) f28-0)) + ) + ) + (vector-matrix*! arg0 arg1 s4-0) + ) + (else + (set! (-> arg0 quad) (-> arg1 quad)) + (if (logtest? (-> self options) 2048) + (set! (-> self max-angle-curr) f28-0) + ) + ) + ) + ) + (vector-normalize! arg0 (-> self pivot-rad)) + ) -;; ERROR: function has no type analysis. Cannot decompile. +(defbehavior cam-circular-position camera-slave ((arg0 symbol)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (if (logtest? (-> self options) 130) + (vector-! gp-0 (-> self circular-follow) (-> self pivot-pt)) + (vector-! gp-0 (-> self pivot-pt) (-> self circular-follow)) + ) + (vector-! s5-0 (-> self trans) (-> self pivot-pt)) + (when (not (logtest? (-> self options) 4)) + (vector-flatten! gp-0 gp-0 (-> *camera* local-down)) + (vector-flatten! s5-0 s5-0 (-> *camera* local-down)) + ) + (cond + ((logtest? (-> self options) 128) + (let ((f30-0 (- (vector-length gp-0) (-> self pivot-rad)))) + (when (< 0.0001 (-> *camera-combiner* tracking point-of-interest-blend value)) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + 0.0 + (vector-! s5-1 (-> *camera-combiner* tracking looking-interesting) (-> self pivot-pt)) + (vector-normalize-copy! s3-0 gp-0 1.0) + (let ((f28-0 (vector-dot s5-1 s3-0))) + (vector-float*! s4-1 s3-0 f28-0) + (let ((f0-11 + (/ (* (vector-vector-distance s5-1 s4-1) (cos (-> *camera-combiner* fov))) (sin (-> *camera-combiner* fov))) + ) + ) + (set! f30-0 (fmin f30-0 (if (>= 16384.0 (-> *camera-combiner* fov)) + (- f28-0 f0-11) + (+ f28-0 f0-11) + ) + ) + ) + ) + ) + ) + ) + (if (>= 0.0 f30-0) + (vector-reset! gp-0) + (vector-normalize! gp-0 f30-0) + ) + ) + ) + ((not arg0) + (set! (-> self max-angle-curr) (-> self max-angle-offset)) + (cam-circular-position-into-max-angle gp-0 s5-0 1.0) + ) + (else + (cam-circular-position-into-max-angle gp-0 s5-0 0.05) + ) + ) + ) + (vector+! (-> self trans) gp-0 (-> self pivot-pt)) + ) + ) -;; ERROR: failed type prop at 56: Called a function, but we do not know its type -;; WARN: Return type mismatch none vs float. +(defbehavior cam-circular-code camera-slave () + (set! (-> self pivot-pt quad) (-> self saved-pt quad)) + (cam-curve-pos (-> self pivot-pt) (the-as vector #f) (the-as curve #f) #f) + (let ((a2-1 (new-stack-vector0))) + (vector-! a2-1 (-> *camera* tpos-curr-adj) (-> self pivot-pt)) + (vector-! (-> self circular-follow) (-> self circular-follow) (-> self pivot-pt)) + (if (logtest? (-> self options) 4) + (v-slrp3! + (-> self circular-follow) + (-> self circular-follow) + a2-1 + (the-as vector #f) + (* 182.04445 (-> self clock time-adjust-ratio)) + ) + (v-slrp3! + (-> self circular-follow) + (-> self circular-follow) + a2-1 + (-> *camera* local-down) + (* 182.04445 (-> self clock time-adjust-ratio)) + ) + ) + ) + (vector+! (-> self circular-follow) (-> self circular-follow) (-> self pivot-pt)) + (cam-circular-position #t) + (if (!= (-> self fov1) 0.0) + (set! (-> self fov) + (lerp-clamp + (-> self fov0) + (-> self fov1) + (parameter-ease-sin-clamp (cam-index-method-10 (-> self fov-index) (-> *camera* tpos-curr-adj))) + ) + ) + ) + ) +(defstate cam-circular (camera-slave) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) + (the-as object (cond + ((= v1-0 'teleport) + #f + ) + ((= v1-0 'outro-done) + (set! (-> self trans quad) (-> *camera-combiner* trans quad)) + (cam-circular-position #f) + ) + (else + (cam-standard-event-handler proc arg1 event-type event) + ) + ) + ) + ) + ) + :enter (behavior () + (cond + ((-> self enter-has-run) + ) + (else + (let ((gp-0 (new-stack-vector0))) + (set! (-> (new 'stack-no-clear 'collide-query) best-other-tri vertex 0 quad) (the-as uint128 0)) + (set! (-> self view-off-param) 1.0) + (set! (-> self circular-follow quad) (-> *camera* tpos-curr-adj quad)) + (set! (-> self max-angle-offset) 0.0) + (cond + ((-> self cam-entity) + (cam-slave-get-vector-with-offset (the-as entity-actor (-> self cam-entity)) (-> self saved-pt) 'pivot) + (cam-slave-get-vector-with-offset (the-as entity-actor (-> self cam-entity)) gp-0 'trans) + (set! (-> self pivot-rad) (vector-length (vector-! gp-0 gp-0 (-> self saved-pt)))) + (logior! (-> self options) (cam-slave-get-flags (-> self cam-entity) 'flags)) + (set! (-> self fov) (cam-slave-get-fov (-> self cam-entity))) + (set! (-> self tracking tilt-adjust target) + (cam-slave-get-float (-> self cam-entity) 'tiltAdjust (-> *CAMERA-bank* default-tilt-adjust)) + ) + (set! (-> self max-angle-offset) (cam-slave-get-float (-> self cam-entity) 'maxAngle 0.0)) + (if (< (-> self max-angle-offset) 0.0) + (set! (-> self max-angle-offset) 0.0) + ) + (set! (-> self fov1) (cam-slave-get-float (-> self cam-entity) 'focalPull 0.0)) + (cond + ((and (!= (-> self fov1) 0.0) + (cam-index-method-9 (-> self fov-index) 'focalpull (-> self cam-entity) (-> self saved-pt) (the-as curve #f)) + ) + (set! (-> self fov0) (-> self fov)) + (set! (-> self fov) (lerp-clamp + (-> self fov0) + (-> self fov1) + (cam-index-method-10 (-> self fov-index) (-> *camera* tpos-curr-adj)) + ) + ) + ) + (else + (set! (-> self fov1) 0.0) + ) + ) + (set! (-> self spline-follow-dist) (cam-slave-get-float (-> self cam-entity) 'spline-follow-dist 0.0)) + (cam-curve-setup (-> self saved-pt)) + (cond + ((< 0.0 (-> self spline-follow-dist)) + (let ((a0-17 (new 'stack-no-clear 'vector)) + (gp-3 (new 'stack-no-clear 'vector)) + ) + (curve-get-pos! a0-17 0.0 (-> self spline-curve)) + (curve-get-pos! gp-3 1.0 (-> self spline-curve)) + ) + (set! (-> self spline-tt) (curve-closest-point + (-> self spline-curve) + (-> self circular-follow) + 0.5 + -4096.0 + 10 + (-> self spline-follow-dist) + ) + ) + (curve-get-pos! (-> self pivot-pt) (-> self spline-tt) (-> self spline-curve)) + ) + (else + (set! (-> self spline-follow-dist) 0.0) + (set! (-> self pivot-pt quad) (-> self saved-pt quad)) + (cam-curve-pos (-> self pivot-pt) (the-as vector #f) (the-as curve #f) #f) + ) + ) + ) + ((logtest? (-> self options) 128) + (vector-! (-> self pivot-pt) (-> *camera* tpos-curr-adj) (-> self trans)) + (vector-flatten! (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down)) + (set! (-> self pivot-rad) (vector-length (-> self pivot-pt))) + (set! (-> self pivot-pt quad) (-> self trans quad)) + (set! (-> self saved-pt quad) (-> self pivot-pt quad)) + ) + (else + (vector-! (-> self pivot-pt) (-> *camera* tpos-curr-adj) (-> self trans)) + (vector-float*! (-> self pivot-pt) (-> self pivot-pt) 0.5) + (vector-flatten! (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down)) + (set! (-> self pivot-rad) (vector-length (-> self pivot-pt))) + (vector+! (-> self pivot-pt) (-> self trans) (-> self pivot-pt)) + (set! (-> self saved-pt quad) (-> self pivot-pt quad)) + ) + ) + ) + (cam-circular-position #f) + (cond + ((logtest? (-> self options) #x4000) + (set! (-> self blend-from-type) (the-as uint 0)) + (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) + (cam-slave-get-rot (the-as entity-actor (-> self cam-entity)) (the-as matrix (-> self tracking))) + ) + (else + (set! (-> self blend-from-type) (the-as uint 2)) + (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) + ) + ) + ) + ) + (none) + ) + :trans (behavior () + (if (not (logtest? (-> *camera* master-options) 1)) + (cam-slave-go cam-free-floating) + ) + (none) + ) + :code (behavior () + (until #f + (if (not (paused?)) + (cam-circular-code) + ) + (suspend) + ) + #f + (none) + ) + ) (defstate cam-lookat (camera-slave) :event (the-as @@ -882,7 +1205,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (cam-slave-go cam-free-floating) ) (none) @@ -977,7 +1300,6 @@ 409.6 ) -;; WARN: Return type mismatch int vs none. (defun-debug cam-draw-collide-cache ((arg0 collide-cache)) (let ((gp-0 (the-as object (-> arg0 tris)))) (countdown (s5-0 (-> arg0 num-tris)) @@ -1026,7 +1348,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun dist-info-init ((arg0 collide-los-dist-info)) (set! (-> arg0 min-par) 1.0) (set! (-> arg0 max-par) 0.0) @@ -1039,7 +1360,6 @@ (>= (-> arg0 max-par) (-> arg0 min-par)) ) -;; WARN: Return type mismatch int vs none. (defun dist-info-append ((arg0 collide-los-dist-info) (arg1 vector)) (cond ((dist-info-valid? arg0) @@ -1140,13 +1460,6 @@ ) -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch (defun los-cw-ccw ((arg0 (inline-array collide-cache-tri)) (arg1 vector) (arg2 vector) @@ -1446,6 +1759,417 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f2, f5] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f3, f6] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f2, f4, f7] +(defbehavior cam-los-collide camera-slave ((arg0 vector) (arg1 vector) (arg2 collide-los-result) (arg3 pat-surface)) + (local-vars + (s1-3 int) + (s2-2 int) + (f2-1 float) + (sv-768 pat-surface) + (sv-784 vector) + (sv-800 vector) + (sv-816 tracking-point) + (sv-832 vector) + ) + (set! sv-768 arg3) + (dist-info-init (-> arg2 cw)) + (dist-info-init (-> arg2 ccw)) + (dist-info-init (-> arg2 straddle)) + (let ((s1-0 (new 'stack-no-clear 'collide-query)) + (s4-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (vector-normalize-copy! s2-0 arg1 1.0) + (vector-flatten! s4-0 arg1 (-> *camera* local-down)) + (let ((s0-0 *collide-cache*) + (f26-0 (vector-length arg1)) + (f30-0 (vector-normalize-ret-len! s4-0 1.0)) + ) + (set! (-> s1-0 start-pos quad) (-> arg0 quad)) + (set! (-> s1-0 move-dist quad) (-> arg1 quad)) + (let ((v1-5 s1-0)) + (set! (-> v1-5 radius) (-> *CAM_STRING-bank* los-coll-rad)) + (set! (-> v1-5 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) + (set! (-> v1-5 ignore-process0) #f) + (set! (-> v1-5 ignore-process1) #f) + (set! (-> v1-5 ignore-pat) sv-768) + (set! (-> v1-5 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere s0-0 s1-0) + (let ((s1-1 (the-as object (-> s0-0 tris))) + (f28-0 (/ 2048.0 f26-0)) + (f26-1 (/ (+ -8192.0 f26-0) f26-0)) + ) + (if (< f26-1 0.0) + (set! f26-1 0.0) + ) + (if (< 1.0 f28-0) + (set! f28-0 1.0) + ) + (countdown (s0-1 (-> s0-0 num-tris)) + (set! sv-800 (new 'stack-no-clear 'vector)) + (set! sv-784 (new 'stack-no-clear 'vector)) + (let ((f0-7 (moving-sphere-triangle-intersect + arg0 + arg1 + (-> *CAM_STRING-bank* los-coll-rad) + (-> (the-as (inline-array collide-cache-tri) s1-1) 0) + sv-800 + sv-784 + ) + ) + ) + (cond + ((or (< f0-7 0.0) (< 1.0 f0-7)) + ) + ((let ((f1-2 0.0)) + ;; (let* ((v1-23 arg1) + ;; (f2-0 (-> v1-23 x)) + ;; (f3-0 (-> v1-23 y)) + ;; (f4-0 (-> v1-23 z)) + ;; (f5-0 (-> sv-784 x)) + ;; (f6-0 (-> sv-784 y)) + ;; (f7-0 (-> sv-784 z)) + ;; ) + ;; (.mula.s f2-0 f5-0) + ;; (.madda.s f3-0 f6-0) + ;; (.madd.s f2-1 f4-0 f7-0) + ;; ) + (set! f2-1 (vector-dot arg1 sv-784)) + (< f1-2 f2-1) + ) + (when (< f28-0 f0-7) + (let* ((t1-1 (new 'stack-no-clear 'vector)) + (t0-1 (new 'stack-no-clear 'vector)) + (f24-0 (moving-sphere-triangle-intersect + arg0 + arg1 + (-> *CAM_STRING-bank* los-coll-rad2) + (-> (the-as (inline-array collide-cache-tri) s1-1) 0) + t0-1 + t1-1 + ) + ) + ) + (los-cw-ccw (the-as (inline-array collide-cache-tri) s1-1) s2-0 s4-0 f30-0 arg2 sv-800 f24-0) + (when *debug-segment* + (cond + ((= f24-0 -859915232) + (let ((t9-10 cam-debug-add-los-tri) + (a0-20 s1-1) + (a2-6 (new 'static 'vector :x (the-as float #x80) :w (the-as float #x80))) + ) + (t9-10 (the-as (inline-array collide-cache-tri) a0-20) sv-800 a2-6) + ) + ) + (else + (cam-debug-add-los-tri + (the-as (inline-array collide-cache-tri) s1-1) + sv-800 + (new 'static 'vector :x (the-as float #x80) :y (the-as float #x80) :w (the-as float #x80)) + ) + ) + ) + ) + ) + ) + ) + ((< f0-7 f26-1) + (let* ((t1-3 (new 'stack-no-clear 'vector)) + (t0-3 (new 'stack-no-clear 'vector)) + (f24-1 (moving-sphere-triangle-intersect + arg0 + arg1 + (-> *CAM_STRING-bank* los-coll-rad2) + (-> (the-as (inline-array collide-cache-tri) s1-1) 0) + t0-3 + t1-3 + ) + ) + ) + (los-cw-ccw (the-as (inline-array collide-cache-tri) s1-1) s2-0 s4-0 f30-0 arg2 sv-800 f24-1) + (when *debug-segment* + (if (= f24-1 -859915232) + (cam-debug-add-los-tri + (the-as (inline-array collide-cache-tri) s1-1) + sv-800 + (new 'static 'vector :y (the-as float #x80) :w (the-as float #x80)) + ) + (cam-debug-add-los-tri + (the-as (inline-array collide-cache-tri) s1-1) + sv-800 + (new 'static 'vector :z (the-as float #x80) :w (the-as float #x80)) + ) + ) + ) + ) + ) + ) + ) + (set! s1-1 (-> (the-as (inline-array collide-cache-tri) s1-1) 1)) + ) + ) + ) + ) + (let ((s4-1 (new 'stack-no-clear 'vector))) + 0.0 + (vector-cross! s4-1 arg1 (-> *camera* local-down)) + (cond + ((!= (-> self los-tgt-spline-pt-incarnation) + (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) + ) + (when *display-cam-los-debug* + (format *stdcon* "emergency point jump~%") + (format 0 "emergency point jump~%") + ) + (set! (-> self los-tgt-spline-pt) (-> *camera* target-spline used-point)) + (set! (-> self los-tgt-spline-pt-incarnation) + (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) + ) + (logior! (-> self options) 4096) + (set! (-> self good-point quad) + (-> *camera* target-spline point (-> *camera* target-spline used-point) position quad) + ) + (set! (-> self los-last-pos quad) (-> self good-point quad)) + (when *debug-segment* + (let ((a1-22 (new 'stack-no-clear 'vector))) + (vector-! a1-22 (-> self good-point) (-> self string-trans)) + (cam-collision-record-save (-> self string-trans) a1-22 -3 'jump self) + ) + ) + (set! (-> self desired-pos quad) (-> self good-point quad)) + (set! (-> self string-trans quad) (-> self good-point quad)) + (vector-! (-> self view-flat) (-> self string-trans) (-> *camera* tpos-curr-adj)) + (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) + (vector-reset! (-> self velocity)) + (let ((f0-11 (vector-length (-> self view-flat)))) + (if (< f0-11 (-> self min-z-override)) + (set! (-> self min-z-override) f0-11) + ) + ) + ) + (else + (let ((f30-1 + (cam-los-spline-collide + (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 (-> *camera* target-spline end-point)))) + arg0 + (the-as pat-surface (camera-master-method-16 *camera* #t)) + ) + ) + ) + (cond + ((< f30-1 0.0) + (if *display-cam-los-debug* + (format *stdcon* "good ~f~%" f30-1) + ) + (set! (-> self los-tgt-spline-pt) (-> *camera* target-spline end-point)) + (set! (-> self los-tgt-spline-pt-incarnation) + (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) + ) + (set! (-> self los-last-pos quad) (-> arg0 quad)) + ) + ((begin + (if *display-cam-los-debug* + (format + *stdcon* + "looking vel ~M u ~f pt ~D" + (vector-length (-> self velocity)) + f30-1 + (-> self los-tgt-spline-pt) + ) + ) + (set! s2-2 (-> self los-tgt-spline-pt)) + (set! s1-3 -134250495) + (while (and (!= s2-2 -134250495) + (begin + (let ((s0-3 cam-los-spline-collide)) + (set! sv-816 (-> (the-as (inline-array tracking-spline) (-> *camera* target-spline)) 0 point s2-2)) + (set! sv-832 arg0) + (let ((a2-21 (camera-master-method-16 *camera* #t))) + (set! f30-1 (s0-3 (the-as vector sv-816) sv-832 (the-as pat-surface a2-21))) + ) + ) + (< f30-1 0.0) + ) + ) + (set! s1-3 s2-2) + (set! s2-2 (-> *camera* target-spline point s2-2 next)) + ) + (and (= s2-2 (-> *camera* target-spline used-point)) + (!= (-> *camera* target-spline point s2-2 next) -134250495) + ) + ) + (when *display-cam-los-debug* + (format 0 "looking at used point~%") + (format *stdcon* " at used point~%") + ) + (set! (-> self los-tgt-spline-pt) (-> *camera* target-spline point s2-2 next)) + (set! (-> self los-tgt-spline-pt-incarnation) + (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) + ) + (logior! (-> self options) 4096) + (set! (-> self good-point quad) (-> *camera* target-spline point s2-2 position quad)) + (set! (-> self los-last-pos quad) (-> self good-point quad)) + (when *debug-segment* + (let ((a1-40 (new 'stack-no-clear 'vector))) + (vector-! a1-40 (-> self good-point) (-> self string-trans)) + (cam-collision-record-save (-> self string-trans) a1-40 -3 'jump self) + ) + ) + (set! (-> self desired-pos quad) (-> self good-point quad)) + (set! (-> self string-trans quad) (-> self good-point quad)) + (vector-! (-> self view-flat) (-> self string-trans) (-> *camera* tpos-curr-adj)) + (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) + (vector-reset! (-> self velocity)) + (let ((f0-14 (vector-length (-> self view-flat)))) + (if (< f0-14 (-> self min-z-override)) + (set! (-> self min-z-override) f0-14) + ) + ) + ) + ((!= s1-3 -134250495) + (if *display-cam-los-debug* + (format *stdcon* " ok~%") + ) + (set! (-> self los-tgt-spline-pt) s1-3) + (set! (-> self los-tgt-spline-pt-incarnation) + (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) + ) + (set! (-> self los-last-pos quad) (-> arg0 quad)) + ) + (else + (if *display-cam-los-debug* + (format *stdcon* "~%failed u ~f cur ~D seen ~D tgt-pt ~D~%" f30-1 s2-2 s1-3 (-> self los-tgt-spline-pt)) + ) + (let ((s3-1 (new 'stack-no-clear 'vector))) + 0.0 + (vector-! + s3-1 + (-> self los-last-pos) + (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 (-> self los-tgt-spline-pt)))) + ) + (let ((f28-1 (vector-length s3-1))) + (if (= f28-1 0.0) + (set! f28-1 0.4096) + ) + (let ((f30-2 (cond + ((and (= (-> self string-vel-dir) 6) + (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) + ) + (fmin 1.0 (+ 0.001 f30-1)) + ) + ((= (-> self string-vel-dir) 6) + (fmin 0.9999 f30-1) + ) + (else + (fmax 0.001 (+ -0.001 f30-1)) + ) + ) + ) + ) + (let ((s2-3 (new 'stack-no-clear 'vector))) + (vector-! + s2-3 + (-> *camera* tpos-curr-adj) + (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 (-> self los-tgt-spline-pt)))) + ) + (vector-flatten! s2-3 s2-3 (-> *camera* local-down)) + (cond + ((and (< (fabs (- (-> self desired-pos y) (-> self trans y))) 8192.0) + (< f28-1 (+ 1024.0 (-> self string-min-val z))) + (< (vector-length s2-3) 8192.0) + ) + (set! f30-2 0.0) + ) + ((< f28-1 (+ 1024.0 (-> self string-min-val z))) + ) + ((< (* f28-1 f30-2) (-> self string-min-val z)) + (set! f30-2 (/ (-> self string-min-val z) f28-1)) + ) + ) + ) + (when (< 0.0 f30-2) + (vector-! s3-1 (-> *camera* tpos-curr) (-> *camera* tpos-old)) + (vector-! + (-> self good-point) + (-> self los-last-pos) + (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 (-> self los-tgt-spline-pt)))) + ) + (vector-float*! (-> self good-point) (-> self good-point) f30-2) + (vector+! + (-> self good-point) + (-> self good-point) + (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 (-> self los-tgt-spline-pt)))) + ) + (set! (-> self los-last-pos quad) (-> self good-point quad)) + (when *display-cam-los-debug* + (format 0 "going because u(~f) > 0 frame ~D~%" f30-2 (-> self clock frame-counter)) + (format *stdcon* " going because u(~f) > 0 frame ~D~%" f30-2 (-> self clock frame-counter)) + ) + (logior! (-> self options) 4096) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (if *display-cam-los-debug* + (format + *stdcon* + "los-last ~M ~M ~M~%" + (-> self los-last-pos x) + (-> self los-last-pos y) + (-> self los-last-pos z) + ) + ) + (cam-los-setup-lateral arg2 s4-1 arg1) + ) + (cond + ((not (logtest? (-> self options) 1024)) + ) + ((= (-> self string-vel-dir) 5) + ) + ((and (= (-> self string-vel-dir) 2) (= (-> self los-state) (slave-los-state cw))) + ) + ((and (= (-> self string-vel-dir) 1) (= (-> self los-state) (slave-los-state ccw))) + ) + ) + (when *display-cam-los-debug* + (format *stdcon* "state ~S" (slave-los-state->string (-> self los-state))) + (cond + ((zero? (-> self string-vel-dir)) + (format *stdcon* " vzero") + ) + ((= (-> self string-vel-dir) 2) + (format *stdcon* " vcw") + ) + ((= (-> self string-vel-dir) 1) + (format *stdcon* " vccw") + ) + ((= (-> self string-vel-dir) 3) + (format *stdcon* " up") + ) + ((= (-> self string-vel-dir) 4) + (format *stdcon* " down") + ) + ((= (-> self string-vel-dir) 6) + (format *stdcon* " long") + ) + ((= (-> self string-vel-dir) 5) + (format *stdcon* " short") + ) + ) + (format *stdcon* "~%") + ) + (when *display-cam-los-info* + (dist-info-print (-> arg2 cw) "cw ") + (dist-info-print (-> arg2 ccw) "ccw ") + (dist-info-print (-> arg2 straddle) "strdl") + ) + (the-as symbol 0) + ) (defbehavior cam-string-follow camera-slave () (let ((f30-0 (vector-length (-> self view-flat)))) @@ -1510,7 +2234,62 @@ ) ) -;; ERROR: function has no type analysis. Cannot decompile. +(defbehavior cam-string-line-of-sight camera-slave () + (let ((gp-0 (new 'stack-no-clear 'collide-los-result)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (new 'stack-no-clear 'collide-query) + (let ((f30-0 (vector-length (-> self view-flat)))) + (vector--float*! s5-0 (-> *camera* tpos-curr) (-> *camera* local-down) (-> *camera* settings target-height)) + (vector-! s5-0 s5-0 (-> self string-trans)) + (let ((f0-1 (vector-length s5-0))) + (if (< 2048.0 f0-1) + (vector-float*! s5-0 s5-0 (/ (+ -2048.0 f0-1) f0-1)) + (vector-reset! s5-0) + ) + ) + (cam-los-collide (-> self string-trans) s5-0 gp-0 (the-as pat-surface (camera-master-method-16 *camera* #t))) + (when (-> gp-0 lateral-valid) + (when (or (= (-> self los-state) (slave-los-state ccw)) (= (-> self los-state) (slave-los-state cw))) + (let ((v1-21 (new 'stack-no-clear 'vector))) + (vector-! v1-21 (-> *camera* tpos-curr) (-> *camera* tpos-old)) + (if (and (< (-> self string-min-val z) f30-0) + (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length v1-21)) + ) + (set! f30-0 (+ -204.8 f30-0)) + ) + ) + ) + (if (< f30-0 (fmin (-> self string-min-val z) (-> self min-z-override))) + (set! f30-0 (fmin (-> self string-min-val z) (-> self min-z-override))) + ) + (if (< f30-0 (-> self min-z-override)) + (set! (-> self min-z-override) f30-0) + ) + (let ((s4-1 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + (s3-1 (new 'stack-no-clear 'matrix)) + ) + 0.0 + (vector-flatten! s4-1 (-> gp-0 lateral) (-> *camera* local-down)) + (vector-normalize! s4-1 1.0) + (vector-normalize-copy! s5-1 (-> self view-flat) 1.0) + (let ((f0-14 (lerp-clamp + 418.7022 + 364.0889 + (/ (- f30-0 (-> self string-min-val z)) (- (-> self string-max-val z) (-> self string-min-val z))) + ) + ) + ) + (matrix-from-two-vectors-max-angle-partial! s3-1 s5-1 s4-1 f0-14 0.5) + ) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s3-1) + ) + (vector-normalize! (-> self view-flat) f30-0) + ) + ) + ) + ) (defun cam-dist-analog-input ((arg0 int) (arg1 float)) (let ((f0-0 (the-as number 0.0))) @@ -1526,12 +2305,357 @@ ) ) -;; ERROR: failed type prop at 785: Could not figure out load: (set! v1 (l.wu (+ v1 124))) -;; WARN: Return type mismatch symbol vs vector. -;; ERROR: Unsupported inline assembly instruction kind - [sllv a0, v1, r0] -;; ERROR: Unsupported inline assembly instruction kind - [sllv a0, v1, r0] +(defbehavior cam-string-joystick camera-slave () + (set! (-> self options) (logand -257 (-> self options))) + (when (-> self string-relative) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (let ((f30-0 0.5)) + (new 'stack-no-clear 'matrix) + (vector-flatten! s5-0 (-> self relative-position) (-> *camera* local-down)) + (let ((f0-4 + (acos (/ (vector-dot s5-0 (-> self view-flat)) (* (vector-length s5-0) (vector-length (-> self view-flat))))) + ) + ) + (if (< 1456.3556 (* f30-0 f0-4)) + (set! f30-0 (/ 1456.3556 f0-4)) + ) + ) + (vector-deg-slerp (-> self view-flat) (-> self view-flat) s5-0 f30-0) + (set! (-> gp-0 y) (- (vector-dot (-> self relative-position) (-> *camera* local-down)))) + (set! (-> gp-0 z) (vector-length s5-0)) + (set! (-> self view-off y) (lerp (-> self view-off y) (-> gp-0 y) f30-0)) + (set! (-> self view-off z) (lerp (-> self view-off z) (-> gp-0 z) f30-0)) + ) + ) + (vector-normalize! (-> self view-flat) (-> self view-off z)) + (set! (-> self string-min-val y) (-> self view-off y)) + (set! (-> self string-min-val z) (-> self view-off z)) + (set! (-> self string-max-val y) (-> self view-off y)) + (set! (-> self string-max-val z) (-> self view-off z)) + (return (the-as float #f)) + ) + (let ((f28-0 (cam-dist-analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 0.05)) + (f0-22 (/ (- (vector-length (-> self view-flat)) (-> self string-min-val z)) + (- (-> self string-max-val z) (-> self string-min-val z)) + ) + ) + (f30-1 (-> self view-off-param)) + ) + (if (logtest? #x10000 (-> self options)) + (set! f28-0 0.0) + ) + (if (-> self have-phony-joystick) + (set! f28-0 (* 0.05 (-> self phony-joystick-y))) + ) + (if (and (-> *camera* being-attacked) + (< (- (-> self clock frame-counter) (-> *camera* attack-start)) (seconds 0.25)) + ) + (set! f28-0 0.05) + ) + (when (logtest? #x40000 (-> self options)) + (if (and (or (< (-> *cpad-list* cpads 0 rightx) (the-as uint 64)) + (< (the-as uint 192) (-> *cpad-list* cpads 0 rightx)) + ) + (let ((v1-56 (abs (the-as int (+ (-> *cpad-list* cpads 0 righty) -128))))) + (< (the-as uint v1-56) (the-as uint 64)) + ) + ) + (set! f28-0 0.0) + ) + ) + (if (!= f28-0 0.0) + (logior! (-> self options) 256) + ) + (let ((f26-0 (fmin 1.0 f0-22))) + (let ((f0-23 f26-0)) + (when (< f26-0 0.0) + (let ((f0-26 + (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (* 0.5 (-> self string-min-val z))) + ) + ) + (set! f0-23 (fmin 0.75 f0-26)) + ) + ) + (let ((f1-15 (-> self string-min-val y)) + (f2-5 (-> self string-max-val y)) + ) + (set! (-> self view-off y) (lerp f1-15 f2-5 f0-23)) + ) + ) + (when (< f26-0 0.0) + (let ((v1-71 (new 'stack-no-clear 'vector))) + (vector-! v1-71 (-> self string-trans) (-> *camera* tpos-curr-adj)) + (let ((f0-32 (- (- (vector-dot v1-71 (-> *camera* local-down))) (-> *camera* settings target-height)))) + (set! (-> self view-off y) + (fmin (-> *camera* settings string-cliff-height) (fmax f0-32 (-> self view-off y))) + ) + ) + ) + ) + (let ((f0-36 (fmax 0.0 f26-0))) + (cond + ((logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) + ) + ((logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG)) + ) + ((and (>= 0.0 f28-0) (>= 0.0 f0-36)) + ) + ((and (>= f28-0 0.0) (>= f0-36 1.0)) + ) + ((and (< 0.0 f28-0) + (or (= (-> self los-state) (slave-los-state ccw)) (= (-> self los-state) (slave-los-state cw))) + ) + ) + ((and (logtest? #x40000 (-> self options)) (< 0.0 f28-0)) + (set! (-> self string-min-val y) + (fmax (-> *camera* settings gun-min-height) (- (-> self string-min-val y) (* 24576.0 f28-0))) + ) + (set! (-> self string-max-val y) + (fmin + (+ 16384.0 (-> self string-min-val y)) + (fmax (+ 8192.0 (-> self string-min-val y)) (- (-> self string-max-val y) (* 24576.0 f28-0))) + ) + ) + ) + ((and (logtest? #x40000 (-> self options)) (< f28-0 0.0)) + (set! (-> self string-max-val y) + (fmin (-> *camera* settings gun-max-height) (- (-> self string-max-val y) (* 24576.0 f28-0))) + ) + (set! (-> self string-min-val y) + (fmin + (+ -8192.0 (-> self string-max-val y)) + (fmax (+ -16384.0 (-> self string-max-val y)) (- (-> self string-min-val y) (* 24576.0 f28-0))) + ) + ) + ) + ((logtest? #x40000 (-> self options)) + (set! (-> self string-max-val y) + (fmax + (+ 8192.0 (-> *camera* settings gun-min-height)) + (fmin (-> *camera* settings gun-max-height) (-> self string-max-val y)) + ) + ) + (set! (-> self string-min-val y) + (fmax + (-> *camera* settings gun-min-height) + (fmin (+ -8192.0 (-> *camera* settings gun-max-height)) (-> self string-min-val y)) + ) + ) + (set! (-> self string-min-val y) (fmax (+ -16384.0 (-> self string-max-val y)) (-> self string-min-val y))) + ) + ((< (* 0.05 (- 1.0 f0-36)) f28-0) + (let ((f0-55 (+ f0-36 (* 0.05 (- 1.0 f0-36))))) + (set! (-> self view-off-param) (fmax (-> self view-off-param) f0-55)) + (vector-normalize! (-> self view-flat) (lerp (-> self string-min-val z) (-> self string-max-val z) f0-55)) + ) + ) + ((< f28-0 (* 0.05 (- f0-36))) + (set! (-> self view-off-param) (+ f0-36 (* 0.05 (- f0-36)))) + ) + ((< 0.0 f28-0) + (let ((f0-57 (+ f0-36 (* f28-0 (-> self clock time-adjust-ratio))))) + (set! (-> self view-off-param) (fmax (-> self view-off-param) f0-57)) + (vector-normalize! (-> self view-flat) (lerp (-> self string-min-val z) (-> self string-max-val z) f0-57)) + ) + ) + ((< f28-0 0.0) + (set! (-> self view-off-param) (+ f0-36 (* f28-0 (-> self clock time-adjust-ratio)))) + ) + ) + ) + ) + (cond + ((logtest? #x40000 (-> self options)) + ) + ((= f28-0 0.0) + (set! (-> self view-off z) (-> self string-max-val z)) + ) + (else + (set! (-> self view-off z) + (lerp (-> self string-min-val z) (-> self string-max-val z) (-> self view-off-param)) + ) + ) + ) + (if (-> *camera* being-attacked) + (set! (-> self view-off-param) f30-1) + ) + ) + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (let ((f30-2 (analog-input + (the-as int (-> *cpad-list* cpads 0 rightx)) + 128.0 + 32.0 + 110.0 + (* 182.04445 (-> self clock seconds-per-frame) (if (logtest? #x40000 (-> self options)) + 120.0 + 120.0 + ) + ) + ) + ) + (s4-0 (new-stack-matrix0)) + (gp-3 (new-stack-vector0)) + (s5-3 (new-stack-vector0)) + ) + (if (logtest? #x10000 (-> self options)) + (set! f30-2 0.0) + ) + (if (-> *setting-control* user-default unknowng-symbol-00) + (set! f30-2 (- f30-2)) + ) + (if (-> self have-phony-joystick) + (set! f30-2 (* 21845.334 (-> self phony-joystick-x) (-> self clock seconds-per-frame))) + ) + (when (logtest? #x20000 (-> self options)) + (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) + (if (cpad-hold? (-> *CAMERA-bank* joypad) r1) + (+! f30-2 (+ (* 10922.667 (-> self clock seconds-per-frame)) + (analog-input + (the-as int (-> *cpad-list* cpads (-> *CAMERA-bank* joypad) abutton 9)) + 0.0 + 32.0 + 230.0 + (* 21845.334 (-> self clock seconds-per-frame)) + ) + ) + ) + ) + ) + (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) + (if (cpad-hold? (-> *CAMERA-bank* joypad) l1) + (set! f30-2 (- f30-2 (+ (* 10922.667 (-> self clock seconds-per-frame)) + (analog-input + (the-as int (-> *cpad-list* cpads (-> *CAMERA-bank* joypad) abutton 8)) + 0.0 + 32.0 + 230.0 + (* 21845.334 (-> self clock seconds-per-frame)) + ) + ) + ) + ) + ) + ) + ) + (cond + ((and (= (-> self los-state) (slave-los-state ccw)) (< 0.0 f30-2)) + (let ((f0-82 + (fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat)))) + ) + ) + (set! f30-2 (* 21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-82)) (-> self clock seconds-per-frame))) + ) + ) + ((and (= (-> self los-state) (slave-los-state cw)) (< f30-2 0.0)) + (let ((f0-88 + (fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat)))) + ) + ) + (set! f30-2 (* -21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-88)) (-> self clock seconds-per-frame))) + ) + ) + ) + (cond + ((!= f30-2 0.0) + (logior! (-> self options) 256) + (matrix-axis-angle! s4-0 (-> *camera* local-down) f30-2) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) + (set! (-> self butt-timer) (the-as uint 0)) + (set! (-> self butt-seek) #f) + (when (logtest? #x800000 (-> self options)) + (kill-persister *setting-control* (the-as engine-pers 'butt-handle) 'butt-handle) + (set! (-> self options) (logand -8388609 (-> self options))) + ) + ) + ((or (logtest? (-> self options) 1) (let ((s3-0 (handle->process (-> *camera* settings butt-handle)))) + (if (type? s3-0 process-drawable) + s3-0 + ) + ) + ) + (vector-normalize-copy! gp-3 (-> self view-flat) 1.0) + (let ((v1-283 (handle->process (-> *camera* settings butt-handle)))) + (cond + (v1-283 + (set! (-> self options) (logior #x800000 (-> self options))) + (let* ((s3-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> (the-as process-drawable v1-283) root quat))) + (a2-18 (matrix-axis-angle! + (new 'stack-no-clear 'matrix) + (-> s3-1 vector 1) + (+ 32768.0 (-> *camera* settings butt-angle)) + ) + ) + ) + (vector-matrix*! s5-3 (-> s3-1 vector 2) a2-18) + ) + (vector-flatten! s5-3 s5-3 (-> *camera* local-down)) + ) + ((< (- (-> self clock frame-counter) (the-as int (-> self butt-timer))) 0) + (vector-flatten! s5-3 (-> self butt-vector) (-> *camera* local-down)) + ) + (else + (vector-flatten! s5-3 (the-as vector (&-> *camera* stack 256)) (-> *camera* local-down)) + ) + ) + ) + (vector-normalize! s5-3 -1.0) + (when (and (logtest? #x800000 (-> self options)) (< (cos 910.2222) (vector-dot gp-3 s5-3))) + (kill-persister *setting-control* (the-as engine-pers 'butt-handle) 'butt-handle) + (set! (-> self options) (logand -8388609 (-> self options))) + ) + (matrix-from-two-vectors-max-angle! s4-0 gp-3 s5-3 546.13336) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) + ) + (else + (set! (-> self options) (logand -8388609 (-> self options))) + ) + ) + (when (logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) + (vector-normalize-copy! gp-3 (-> self view-flat) 1.0) + (vector-flatten! s5-3 (the-as vector (&-> *camera* stack 256)) (-> *camera* local-down)) + (vector-normalize! s5-3 -1.0) + (let ((f0-97 (acos (vector-dot s5-3 gp-3)))) + (when (and (< (-> self max-angle-offset) f0-97) (< f0-97 32585.955)) + (matrix-from-two-vectors-max-angle! + s4-0 + gp-3 + s5-3 + (fmin 546.13336 (* 0.5 (- f0-97 (-> self max-angle-offset)))) + ) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) + ) + ) + ) + ) + ) + (when (not (logtest? (cam-slave-options WIDE_FOV) (-> *camera* settings slave-options))) + (let ((f0-101 (vector-length (-> self view-flat)))) + (let ((f1-89 (-> self view-off z))) + (when (< f1-89 f0-101) + (vector-float*! (-> self view-flat) (-> self view-flat) (/ f1-89 f0-101)) + (set! (-> self min-z-override) f1-89) + (set! f0-101 f1-89) + ) + ) + (if (and (< (-> self joystick-saved-view-off z) f0-101) + (< (-> self view-off y) (-> self joystick-saved-view-off y)) + ) + (set! (-> self view-off y) (fmin + (-> *camera* settings string-cliff-height) + (fmax (-> self string-min-val y) (-> self joystick-saved-view-off y)) + ) + ) + ) + (set! (-> self joystick-saved-view-off y) (-> self view-off y)) + (set! (-> self joystick-saved-view-off z) f0-101) + f0-101 + ) + ) + ) -;; WARN: Return type mismatch int vs none. (defbehavior cam-string-find-hidden camera-slave () (let ((s5-0 (new 'stack-no-clear 'collide-query)) (gp-0 (new 'stack-no-clear 'vector)) @@ -1721,8 +2845,103 @@ ) ) -;; ERROR: failed type prop at 11: Called a function, but we do not know its type -;; WARN: Return type mismatch none vs vector. +;; WARN: Return type mismatch float vs vector. +(defbehavior cam-string-code camera-slave () + (if *debug-segment* + (cam-debug-reset-coll-tri) + ) + (cam-string-follow) + (if (logtest? (-> self options) 512) + (cam-string-line-of-sight) + ) + (if (not (paused?)) + (cam-string-joystick) + ) + (let ((gp-0 (new-stack-vector0))) + (vector--float*! + gp-0 + (-> self view-flat) + (-> *camera* local-down) + (+ (-> *camera* settings target-height) (-> self view-off y)) + ) + (vector+! (-> self desired-pos) (-> *camera* tpos-curr-adj) gp-0) + ) + (set! (-> self desired-pos y) (fmin (-> self desired-pos y) (-> *camera* settings string-camera-ceiling))) + (if (logtest? (-> self options) 64) + (cam-string-find-hidden) + ) + (cond + ((logtest? (-> self options) 4096) + (when *debug-segment* + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-! a1-1 (-> self good-point) (-> self string-trans)) + (cam-collision-record-save (-> self string-trans) a1-1 -2 'jump self) + ) + ) + (set! (-> self options) (logand -4097 (-> self options))) + (set! (-> self desired-pos quad) (-> self good-point quad)) + (cam-string-move) + (vector-! (-> self view-flat) (-> self string-trans) (-> *camera* tpos-curr-adj)) + (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) + (let ((f0-4 (vector-length (-> self view-flat)))) + (if (< f0-4 (-> self min-z-override)) + (set! (-> self min-z-override) f0-4) + ) + ) + ) + (else + (cam-string-move) + ) + ) + (tracking-spline-method-17 (-> self position-spline) (-> self string-trans) 0.04096 4096.0 #t) + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-2 (max 2 (the int (+ 0.5 (-> self clock time-adjust-ratio)))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-2))) + (while (nonzero? gp-2) + (+! gp-2 -1) + (cond + ((-> self butt-seek) + (tracking-spline-method-21 (-> self position-spline) (-> self trans) 163.84 8192.0 0.1) + (send-event *camera-combiner* 'fast-rot) + (if (< (-> self position-spline summed-len) 4096.0) + (set! (-> self butt-seek) #f) + ) + ) + ((logtest? (cam-slave-options RAPID_TRACKING) (-> *camera* settings slave-options)) + (tracking-spline-method-21 (-> self position-spline) (-> self trans) 4096.0 40960.0 0.1) + ) + ((and (logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) + (logtest? (-> self options) 256) + ) + (tracking-spline-method-21 (-> self position-spline) (-> self trans) 102.4 4096.0 0.1) + ) + ((logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) + (tracking-spline-method-21 (-> self position-spline) (-> self trans) 40.96 4096.0 0.1) + ) + ((logtest? (-> self options) 256) + (tracking-spline-method-21 + (-> self position-spline) + (-> self trans) + (-> *camera* settings string-spline-accel-player) + (-> *camera* settings string-spline-max-move-player) + 0.1 + ) + ) + (else + (tracking-spline-method-21 + (-> self position-spline) + (-> self trans) + (-> *camera* settings string-spline-accel) + (-> *camera* settings string-spline-max-move) + 0.1 + ) + ) + ) + ) + ) + (the-as vector (update-rates! (-> self clock) f30-0)) + ) + ) (defbehavior set-string-params camera-slave () (when (not (or (-> self string-val-locked) (logtest? #x40000 (-> self options)))) @@ -1735,9 +2954,9 @@ ) (defstate cam-string (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (local-vars (v0-0 none)) - (let ((v1-0 arg2)) + (let ((v1-0 event-type)) (the-as object (cond @@ -1745,7 +2964,7 @@ (set! (-> self butt-timer) (the-as uint (+ (-> self clock frame-counter) (seconds 0.25)))) (set! (-> self butt-seek) (the-as basic #t)) (set! v0-0 (the-as none (-> self butt-vector))) - (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> event param 0)) quad)) v0-0 ) ((= v1-0 'teleport) @@ -1755,18 +2974,18 @@ ) ) ((= v1-0 'joystick) - (set! (-> self phony-joystick-x) (the-as float (-> arg3 param 0))) - (set! (-> self phony-joystick-y) (the-as float (-> arg3 param 1))) + (set! (-> self phony-joystick-x) (the-as float (-> event param 0))) + (set! (-> self phony-joystick-y) (the-as float (-> event param 1))) (set! v0-0 (the-as none #t)) (set! (-> self have-phony-joystick) (the-as basic v0-0)) v0-0 ) ((= v1-0 'tween-dist) (cond - ((-> arg3 param 0) + ((-> event param 0) (set! (-> self string-val-locked) (the-as basic #t)) - (let ((s5-0 (the-as object (-> arg3 param 0))) - (gp-1 (the-as object (-> arg3 param 1))) + (let ((s5-0 (the-as object (-> event param 0))) + (gp-1 (the-as object (-> event param 1))) ) (if (!= (-> (the-as vector s5-0) y) 4095996000.0) (seek! @@ -1799,10 +3018,7 @@ ) (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) - (let ((f0-31 (fmax (-> self string-max-val z) (-> self string-min-val z)))) - (set! (-> self string-max-val z) f0-31) - f0-31 - ) + (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) ) (else (set! (-> self string-val-locked) #f) @@ -1812,16 +3028,13 @@ ) ((= v1-0 'set-dist) (cond - ((-> arg3 param 0) + ((-> event param 0) (set! (-> self string-val-locked) (the-as basic #t)) - (set! (-> self string-min-val quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> self string-max-val quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (set! (-> self string-min-val quad) (-> (the-as vector (-> event param 0)) quad)) + (set! (-> self string-max-val quad) (-> (the-as vector (-> event param 1)) quad)) (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) - (let ((f0-37 (fmax (-> self string-max-val z) (-> self string-min-val z)))) - (set! (-> self string-max-val z) f0-37) - f0-37 - ) + (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) ) (else (set! (-> self string-val-locked) #f) @@ -1831,11 +3044,11 @@ ) ((= v1-0 'relative-position) (cond - ((-> arg3 param 0) + ((-> event param 0) (set! (-> self string-val-locked) (the-as basic #t)) (set! (-> self string-relative) (the-as basic #t)) (set! v0-0 (the-as none (-> self relative-position))) - (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> event param 0)) quad)) v0-0 ) (else @@ -1846,16 +3059,13 @@ ) ) ((= v1-0 'set-max-angle-offset) - (let ((f0-38 (the-as float (-> arg3 param 0)))) - (set! (-> self max-angle-offset) f0-38) - f0-38 - ) + (set! (-> self max-angle-offset) (the-as float (-> event param 0))) ) ((= v1-0 'blocked-side?) (-> self los-state) ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -2018,7 +3228,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (cam-slave-go cam-free-floating) ) (none) @@ -2038,15 +3248,244 @@ ) ) +(deftype cam-stick-bank (basic) + ((max-z meters :offset-assert 4) + (min-z meters :offset-assert 8) + (max-y meters :offset-assert 12) + (min-y meters :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) (define *CAM_STICK-bank* (new 'static 'cam-stick-bank :max-z (meters 30) :min-z (meters 5) :max-y (meters 15) :min-y (meters 2)) ) -;; ERROR: function has no type analysis. Cannot decompile. +(defbehavior cam-stick-code camera-slave () + (cam-calc-follow! (-> self tracking) (-> self trans) #t) + (let ((gp-0 (new-stack-vector0))) + (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) + (vector-normalize! (-> self view-flat) (-> self view-off z)) + (vector-! gp-0 (-> self view-flat) (vector-float*! gp-0 (-> *camera* local-down) (-> self view-off y))) + (vector+! (-> self desired-pos) (-> self tracking follow-pt) gp-0) + ) + (let ((v1-3 (new-stack-vector0)) + (gp-1 (new-stack-vector0)) + ) + (vector-! v1-3 (-> self desired-pos) (-> self trans)) + (vector-float*! v1-3 v1-3 0.2) + (vector-! gp-1 v1-3 (-> self velocity)) + (if (< 409.6 (vector-length gp-1)) + (vector-normalize! gp-1 409.6) + ) + (vector+! (-> self velocity) (-> self velocity) gp-1) + ) + (let ((gp-2 (new 'stack-no-clear 'collide-query))) + 0.0 + (let ((f30-0 1.0) + (s5-0 (-> gp-2 move-dist)) + (s4-0 (new-stack-vector0)) + (s3-0 4) + (s2-0 0) + ) + (while (and (< 0.01 f30-0) + (and (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) (> s3-0 0)) + ) + (+! s3-0 -1) + (vector-float*! s5-0 (-> self velocity) f30-0) + (let ((f28-0 + (cond + ((logtest? (-> self options) 32) + (set! (-> gp-2 start-pos quad) (-> self trans quad)) + (let ((s1-0 gp-2)) + (set! (-> s1-0 radius) (-> *CAMERA-bank* collide-move-rad)) + (set! (-> s1-0 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) + (set! (-> s1-0 ignore-process0) #f) + (set! (-> s1-0 ignore-process1) #f) + (set! (-> s1-0 ignore-pat) (the-as pat-surface (camera-master-method-16 *camera* #f))) + (set! (-> s1-0 action-mask) (collide-action solid)) + ) + (fill-and-probe-using-line-sphere *collide-cache* gp-2) + ) + (else + -100000000.0 + ) + ) + ) + ) + (cond + ((>= f28-0 0.0) + (vector+float*! (-> self trans) (-> self trans) s5-0 f28-0) + (set! (-> s4-0 quad) (-> gp-2 best-other-tri normal quad)) + (vector-flatten! (-> self velocity) (-> self velocity) s4-0) + (set! f30-0 (- f30-0 (* f30-0 f28-0))) + (set! s2-0 1) + ) + (else + (vector+! (-> self trans) (-> self trans) s5-0) + (set! f30-0 0.0) + ) + ) + ) + ) + (when (nonzero? s2-0) + 0 + (let ((gp-3 (new-stack-vector0))) + 0.0 + (vector-! gp-3 (-> self trans) (-> self tracking follow-pt)) + (vector-flatten! gp-3 gp-3 (-> *camera* local-down)) + (let ((f0-15 (/ (- (vector-length gp-3) (-> *CAM_STICK-bank* min-z)) + (- (-> *CAM_STICK-bank* max-z) (-> *CAM_STICK-bank* min-z)) + ) + ) + ) + (cond + ((< f0-15 0.0) + (set! f0-15 0.0) + ) + ((< 1.0 f0-15) + (set! f0-15 1.0) + ) + ) + (cond + ((< (- f0-15 (-> self view-off-param)) -0.001) + (set! (-> self view-off-param) f0-15) + ) + ((< 0.001 (- f0-15 (-> self view-off-param))) + (vector-normalize-copy! (-> self view-flat) gp-3 (-> self view-off z)) + ) + ) + ) + ) + ) + ) + ) + (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #t) + (none) + ) +(defstate cam-stick (camera-slave) + :event (the-as + (function process int symbol event-message-block object :behavior camera-slave) + cam-standard-event-handler + ) + :enter (behavior () + (when (not (-> self enter-has-run)) + (set! (-> self view-off-param) (-> *camera* view-off-param-save)) + (set! (-> self view-off x) 0.0) + (set! (-> self view-off y) + (lerp (-> *CAM_STICK-bank* min-y) (-> *CAM_STICK-bank* max-y) (-> self view-off-param)) + ) + (set! (-> self view-off z) + (lerp (-> *CAM_STICK-bank* min-z) (-> *CAM_STICK-bank* max-z) (-> self view-off-param)) + ) + (cam-calc-follow! (-> self tracking) (-> self trans) #f) + (vector-flatten! (-> self view-flat) (the-as vector (&-> self stack 112)) (-> *camera* local-down)) + (vector-negate! (-> self view-flat) (-> self view-flat)) + (vector-normalize! (-> self view-flat) (-> self view-off z)) + (vector--float*! (-> self desired-pos) (-> self view-flat) (-> *camera* local-down) (-> self view-off y)) + (vector+! (-> self desired-pos) (-> self desired-pos) (-> self tracking follow-pt)) + (set! (-> self trans quad) (-> self desired-pos quad)) + (vector-reset! (-> self velocity)) + (set! (-> self blend-from-type) (the-as uint 2)) + (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) + (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f) + ) + (none) + ) + :trans (behavior () + (if (not (logtest? (-> *camera* master-options) 1)) + (cam-slave-go cam-free-floating) + ) + (when (not (paused?)) + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (let ((f0-0 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 32.0 110.0 0.05))) + (cond + ((< (* 0.05 (- 1.0 (-> self view-off-param))) f0-0) + (+! (-> self view-off-param) (* 0.05 (- 1.0 (-> self view-off-param)))) + ) + ((< f0-0 (* 0.05 (- (-> self view-off-param)))) + (+! (-> self view-off-param) (* 0.05 (- (-> self view-off-param)))) + ) + (else + (+! (-> self view-off-param) f0-0) + ) + ) + ) + ) + (set! (-> self view-off y) + (lerp (-> *CAM_STICK-bank* min-y) (-> *CAM_STICK-bank* max-y) (-> self view-off-param)) + ) + (set! (-> self view-off z) + (lerp (-> *CAM_STICK-bank* min-z) (-> *CAM_STICK-bank* max-z) (-> self view-off-param)) + ) + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (let ((f0-16 (analog-input + (the-as int (-> *cpad-list* cpads 0 rightx)) + 128.0 + 32.0 + 110.0 + (* 21845.334 (-> self clock seconds-per-frame)) + ) + ) + (gp-0 (new-stack-matrix0)) + (s3-0 (new-stack-vector0)) + (s5-0 (new-stack-vector0)) + (s4-0 (new-stack-vector0)) + ) + (cond + ((!= f0-16 0.0) + (matrix-axis-angle! gp-0 (-> *camera* local-down) f0-16) + (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) + ) + ((logtest? (-> self options) 1) + (set-vector! s5-0 0.0 0.0 1.0 1.0) + (vector-normalize-copy! s5-0 (-> self view-flat) 1.0) + (set! (-> s3-0 quad) (-> (the-as vector (&-> *camera* stack 256)) quad)) + (vector-flatten! s3-0 s3-0 (-> *camera* local-down)) + (vector-negate! s3-0 s3-0) + (set! (-> s4-0 quad) (-> s5-0 quad)) + (vector-normalize-copy! s4-0 s3-0 1.0) + (matrix-from-two-vectors-max-angle-partial! + gp-0 + s5-0 + s4-0 + (* 10922.667 (-> self clock seconds-per-frame)) + 0.05 + ) + (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) + ) + ) + ) + ) + ) + (none) + ) + :code (behavior () + (until #f + (if (not (paused?)) + (cam-stick-code) + ) + (suspend) + ) + #f + (none) + ) + ) +(deftype cam-bike-bank (basic) + ((max-z meters :offset-assert 4) + (min-z meters :offset-assert 8) + (max-y meters :offset-assert 12) + (min-y meters :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) (define *CAM_BIKE-bank* @@ -2065,9 +3504,152 @@ (-> arg0 follow-pt) ) -;; ERROR: function has no type analysis. Cannot decompile. - - - - +(defbehavior cam-bike-code camera-slave () + (let ((s4-0 (new-stack-matrix0))) + (let ((gp-0 (new-stack-vector0)) + (s5-0 (new-stack-vector0)) + ) + (vector-normalize-copy! gp-0 (-> self view-flat) 1.0) + (vector-flatten! s5-0 (the-as vector (&-> *camera* stack 256)) (-> *camera* local-down)) + (vector-normalize! s5-0 -1.0) + (matrix-from-two-vectors-partial-linear! s4-0 gp-0 s5-0 0.2) + ) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) + ) + (let ((gp-1 (new-stack-vector0))) + 0.0 + (vector-! gp-1 (-> *camera* tpos-curr-adj) (-> *camera* tpos-old-adj)) + (let ((f30-0 (vector-length gp-1))) + (set! (-> self view-off z) (lerp-clamp + (-> *CAM_BIKE-bank* max-z) + (-> *CAM_BIKE-bank* min-z) + (parameter-ease-sin-clamp (* 0.00081380206 (+ -409.6 f30-0))) + ) + ) + (set! (-> self view-off y) (lerp-clamp + (-> *CAM_BIKE-bank* max-y) + (-> *CAM_BIKE-bank* min-y) + (parameter-ease-sin-clamp (* 0.00081380206 (+ -409.6 f30-0))) + ) + ) + ) + (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) + (vector-normalize! (-> self view-flat) (-> self view-off z)) + (vector-! gp-1 (-> self view-flat) (vector-float*! gp-1 (-> *camera* local-down) (-> self view-off y))) + (vector+! (-> self desired-pos) (-> *camera* tpos-curr-adj) gp-1) + ) + (let ((v1-19 (new-stack-vector0)) + (gp-2 (new-stack-vector0)) + ) + (vector-! v1-19 (-> self desired-pos) (-> self trans)) + (vector-float*! v1-19 v1-19 0.2) + (vector-! gp-2 v1-19 (-> self velocity)) + (if (< 409.6 (vector-length gp-2)) + (vector-normalize! gp-2 409.6) + ) + (vector+! (-> self velocity) (-> self velocity) gp-2) + ) + (let ((gp-3 (new 'stack-no-clear 'collide-query))) + 0.0 + (let ((f30-1 1.0) + (s5-3 (-> gp-3 move-dist)) + (s4-3 4) + ) + (while (and (< 0.01 f30-1) + (and (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) (> s4-3 0)) + ) + (+! s4-3 -1) + (vector-float*! s5-3 (-> self velocity) f30-1) + (let ((f28-0 + (cond + ((logtest? (-> self options) 32) + (set! (-> gp-3 start-pos quad) (-> self trans quad)) + (let ((s3-2 gp-3)) + (set! (-> s3-2 radius) 4096.0) + (set! (-> s3-2 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) + (set! (-> s3-2 ignore-process0) #f) + (set! (-> s3-2 ignore-process1) #f) + (set! (-> s3-2 ignore-pat) (the-as pat-surface (camera-master-method-16 *camera* #f))) + (set! (-> s3-2 action-mask) (collide-action solid)) + ) + (fill-and-probe-using-line-sphere *collide-cache* gp-3) + ) + (else + -100000000.0 + ) + ) + ) + ) + (cond + ((>= f28-0 0.0) + (vector+float*! (-> self trans) (-> self trans) s5-3 f28-0) + (vector-flatten! (-> self velocity) (-> self velocity) (-> gp-3 best-other-tri normal)) + (set! f30-1 (- f30-1 (* f30-1 f28-0))) + (let ((s3-3 (new-stack-vector0))) + (vector-! s3-3 (-> self trans) (-> *camera* tpos-curr-adj)) + (vector-flatten! s3-3 s3-3 (-> *camera* local-down)) + (vector-normalize-copy! (-> self view-flat) s3-3 (-> self view-off z)) + ) + ) + (else + (vector+! (-> self trans) (-> self trans) s5-3) + (set! f30-1 0.0) + ) + ) + ) + ) + ) + ) + (cam-calc-bike-follow! (-> self tracking) (-> self trans) #t) + (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #t) + (none) + ) +(defstate cam-bike (camera-slave) + :event (the-as + (function process int symbol event-message-block object :behavior camera-slave) + cam-standard-event-handler + ) + :enter (behavior () + (when (not (-> self enter-has-run)) + (set-setting! 'head-offset 'abs #x46800000 0) + (set-setting! 'foot-offset 'abs #x45800000 0) + (set! (-> self view-off x) 0.0) + (set! (-> self view-off y) (-> *CAM_BIKE-bank* max-y)) + (set! (-> self view-off z) (-> *CAM_BIKE-bank* max-z)) + (vector-flatten! (-> self view-flat) (the-as vector (&-> self stack 112)) (-> *camera* local-down)) + (vector-negate! (-> self view-flat) (-> self view-flat)) + (vector-normalize! (-> self view-flat) (-> self view-off z)) + (vector--float*! (-> self desired-pos) (-> self view-flat) (-> *camera* local-down) (-> self view-off y)) + (vector+! (-> self desired-pos) (-> self desired-pos) (-> *camera* tpos-curr-adj)) + (set! (-> self trans quad) (-> self desired-pos quad)) + (vector-reset! (-> self velocity)) + (set! (-> self blend-from-type) (the-as uint 0)) + (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) + (cam-calc-bike-follow! (-> self tracking) (-> self trans) #f) + (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f) + ) + (none) + ) + :exit (behavior () + (remove-setting! 'head-offset) + (remove-setting! 'foot-offset) + (none) + ) + :trans (behavior () + (if (not (logtest? (-> *camera* master-options) 1)) + (cam-slave-go cam-free-floating) + ) + (none) + ) + :code (behavior () + (until #f + (if (not (paused?)) + (cam-bike-code) + ) + (suspend) + ) + #f + (none) + ) + ) diff --git a/goal_src/jak2/engine/camera/cam-update.gc b/goal_src/jak2/engine/camera/cam-update.gc index 0df5e4cb88..c58b53c581 100644 --- a/goal_src/jak2/engine/camera/cam-update.gc +++ b/goal_src/jak2/engine/camera/cam-update.gc @@ -15,10 +15,7 @@ (set! (-> (&-> arg0 0 data arg4) 0) (-> s4-0 x)) (set! (-> (&-> arg0 0 data arg4) 4) (-> s4-0 y)) (set! (-> (&-> arg0 0 data arg4) 8) (-> s4-0 z)) - (let ((f0-5 (-> s4-0 w))) - (set! (-> (&-> arg0 0 data arg4) 12) f0-5) - f0-5 - ) + (set! (-> (&-> arg0 0 data arg4) 12) (-> s4-0 w)) ) ) @@ -26,10 +23,7 @@ (set! (-> arg0 x) arg1) (set! (-> arg0 y) arg2) (set! (-> arg0 z) arg3) - (let ((f0-3 1.0)) - (set! (-> arg0 w) f0-3) - f0-3 - ) + (set! (-> arg0 w) 1.0) ) (defun update-view-planes ((arg0 math-camera) (arg1 (inline-array plane)) (arg2 float) (arg3 matrix)) @@ -647,7 +641,3 @@ ) ) ) - - - - diff --git a/goal_src/jak2/engine/camera/camera-h.gc b/goal_src/jak2/engine/camera/camera-h.gc index cad4804b49..05bce6dbd2 100644 --- a/goal_src/jak2/engine/camera/camera-h.gc +++ b/goal_src/jak2/engine/camera/camera-h.gc @@ -48,6 +48,11 @@ (declare-type camera-master process) (define-extern cam-master-init (function none :behavior camera-master)) +;; NOTE - for cam-master +(define-extern cam-master-effect (function none :behavior camera-master)) +(define-extern camera-master-debug (function camera-master none)) +(define-extern group-rain-screend-drop sparticle-launch-group) + (define-extern parameter-ease-sin-clamp (function float float)) ;; DECOMP BEGINS @@ -122,7 +127,7 @@ (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector 19) (tracking-spline-method-20 (_type_ vector int) none 20) (tracking-spline-method-21 (_type_ vector float float float) vector 21) - (tracking-spline-method-22 (_type_ float) none 22) + (tracking-spline-method-22 (_type_ float) symbol 22) (debug-draw-spline (_type_) none 23) ) ) @@ -448,13 +453,6 @@ (:methods (camera-master-method-14 (_type_ vector) vector 14) (camera-master-method-15 (_type_ vector) vector 15) - (camera-master-method-16 (_type_ symbol) none 16) + (camera-master-method-16 (_type_ symbol) int 16) ) ) - - -0 - - - - diff --git a/goal_src/jak2/engine/camera/camera.gc b/goal_src/jak2/engine/camera/camera.gc index 1e8619856c..d2e60db56d 100644 --- a/goal_src/jak2/engine/camera/camera.gc +++ b/goal_src/jak2/engine/camera/camera.gc @@ -52,6 +52,7 @@ ) ) +;; WARN: Return type mismatch uint128 vs uint. (defun cam-slave-get-flags ((arg0 entity) (arg1 symbol)) (let ((s5-0 (res-lump-value arg0 arg1 uint128 :time -1000000000.0)) (s3-0 (method-of-type res-lump get-property-value)) @@ -854,6 +855,7 @@ ) ) +;; WARN: Return type mismatch int vs symbol. (defmethod tracking-spline-method-22 tracking-spline ((obj tracking-spline) (arg0 float)) (when (< arg0 (-> obj summed-len)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) @@ -865,8 +867,7 @@ (tracking-spline-method-14 obj s5-0) ) ) - 0 - (none) + (the-as symbol 0) ) (defmethod tracking-spline-method-9 tracking-spline ((obj tracking-spline)) @@ -898,7 +899,7 @@ ) (set! (-> obj free-point) -134250495) (dotimes (v1-21 32) - (when (zero? (logand s5-0 1)) + (when (not (logtest? s5-0 1)) (set! (-> obj point v1-21 next) (-> obj free-point)) (set! (-> obj free-point) v1-21) ) @@ -1545,11 +1546,7 @@ (sv-272 matrix) (sv-288 vector) ) - (rlet ((acc :class vf) - (vf0 :class vf) - (vf1 :class vf) - (vf2 :class vf) - (vf3 :class vf) + (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) @@ -1582,21 +1579,11 @@ (vector-normalize! s0-0 f28-0) ) (vector-! (-> arg0 looking-interesting) (-> *camera* settings point-of-interest) (-> arg0 follow-pt)) - (let ((v1-15 (-> arg0 looking-interesting))) - (let ((a0-16 (-> arg0 follow-pt)) - (a1-7 (-> arg0 looking-interesting)) - (f0-4 (-> arg0 point-of-interest-blend value)) - ) - (.lvf vf2 (&-> a1-7 quad)) - (.lvf vf1 (&-> a0-16 quad)) - (let ((a0-17 f0-4)) - (.mov vf3 a0-17) - ) - ) - (.add.x.vf vf4 vf0 vf0 :mask #b1000) - (.mul.x.vf acc vf2 vf3) - (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) - (.svf (&-> v1-15 quad) vf4) + (vector+float*! + (-> arg0 looking-interesting) + (-> arg0 follow-pt) + (-> arg0 looking-interesting) + (-> arg0 point-of-interest-blend value) ) ) (else @@ -1612,9 +1599,19 @@ (set! sv-240 (new 'stack-no-clear 'matrix)) (set! sv-224 (new 'stack-no-clear 'vector)) (vector-normalize-copy! sv-224 s0-0 1.0) - ;; NOTE - manually fixed - #1819 - (let* ((v1-24 (-> *camera* local-down))) - (set! f0-9 (vector-dot v1-24 sv-224))) + ;; (let* ((v1-25 (-> *camera* local-down)) + ;; (f0-8 (-> sv-224 x)) + ;; (f1-1 (-> sv-224 y)) + ;; (f2-0 (-> sv-224 z)) + ;; (f3-0 (-> v1-25 x)) + ;; (f4-0 (-> v1-25 y)) + ;; (f5-0 (-> v1-25 z)) + ;; ) + ;; (.mula.s f0-8 f3-0) + ;; (.madda.s f1-1 f4-0) + ;; (.madd.s f0-9 f2-0 f5-0) + ;; ) + (set! f0-9 (vector-dot (-> *camera* local-down) sv-224)) (let* ((f28-1 f0-9) (f0-11 (acos (fabs f28-1))) ) @@ -1637,10 +1634,10 @@ ) (matrix-rotate-x! sv-240 f30-0) (let ((t9-6 matrix*!) - (a0-29 s1-0) + (a0-28 s1-0) (a2-3 s1-0) ) - (t9-6 a0-29 sv-240 a2-3) + (t9-6 a0-28 sv-240 a2-3) ) ) ) @@ -1664,17 +1661,17 @@ (slave-matrix-blend-2 (-> arg0 inv-mat) arg2 s0-0 s1-0) ) (else - (let* ((v1-59 (-> arg0 inv-mat)) + (let* ((v1-60 (-> arg0 inv-mat)) (a3-2 s1-0) - (a0-35 (-> a3-2 vector 0 quad)) + (a0-34 (-> a3-2 vector 0 quad)) (a1-19 (-> a3-2 vector 1 quad)) (a2-7 (-> a3-2 vector 2 quad)) (a3-3 (-> a3-2 trans quad)) ) - (set! (-> v1-59 vector 0 quad) a0-35) - (set! (-> v1-59 vector 1 quad) a1-19) - (set! (-> v1-59 vector 2 quad) a2-7) - (set! (-> v1-59 trans quad) a3-3) + (set! (-> v1-60 vector 0 quad) a0-34) + (set! (-> v1-60 vector 1 quad) a1-19) + (set! (-> v1-60 vector 2 quad) a2-7) + (set! (-> v1-60 trans quad) a3-3) ) ) ) @@ -1710,16 +1707,6 @@ ) ) -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] @@ -1733,249 +1720,174 @@ (sv-176 matrix) (sv-192 vector) ) - (rlet ((acc :class vf) - (vf0 :class vf) - (vf1 :class vf) - (vf2 :class vf) - (vf3 :class vf) - (vf4 :class vf) + (set! sv-144 arg5) + (let ((s0-0 (new-stack-vector0))) + (set! sv-160 (new 'stack-no-clear 'vector)) + (set! (-> sv-160 quad) (the-as uint128 0)) + 1.0 + 1.0 + (let ((s3-0 (new-stack-vector0))) + 0.0 + 1.0 + (set! sv-176 (new 'stack-no-clear 'matrix)) + (set! (-> sv-176 vector 0 quad) (the-as uint128 0)) + (set! (-> sv-176 vector 1 quad) (the-as uint128 0)) + (set! (-> sv-176 vector 2 quad) (the-as uint128 0)) + (set! (-> sv-176 trans quad) (the-as uint128 0)) + (cond + ((< 1.0 arg3) + (set! arg3 1.0) ) - (init-vf0-vector) - (set! sv-144 arg5) - (let ((s0-0 (new-stack-vector0))) - (set! sv-160 (new 'stack-no-clear 'vector)) - (set! (-> sv-160 quad) (the-as uint128 0)) - 1.0 - 1.0 - (let ((s3-0 (new-stack-vector0))) - 0.0 - 1.0 - (set! sv-176 (new 'stack-no-clear 'matrix)) - (set! (-> sv-176 vector 0 quad) (the-as uint128 0)) - (set! (-> sv-176 vector 1 quad) (the-as uint128 0)) - (set! (-> sv-176 vector 2 quad) (the-as uint128 0)) - (set! (-> sv-176 trans quad) (the-as uint128 0)) - (cond - ((< 1.0 arg3) - (set! arg3 1.0) - ) - ((< arg3 0.0) - (set! arg3 0.0) - ) - ) - (cond - (arg4 - (vector-flatten! s0-0 arg1 arg4) - (vector-flatten! sv-160 arg2 arg4) - (set! f30-0 (vector-normalize-ret-len! s0-0 1.0)) - (set! f28-0 (vector-normalize-ret-len! sv-160 1.0)) - (vector-normalize! (vector-cross! s3-0 sv-160 s0-0) 1.0) - (let ((f26-0 (vector-dot arg4 s3-0))) - (vector-normalize-copy! s3-0 arg4 1.0) - (if (< f26-0 0.0) - (vector-negate! s3-0 s3-0) - ) - ) - ) - (else - (set! (-> s0-0 quad) (-> arg1 quad)) - (set! (-> sv-160 quad) (-> arg2 quad)) - (set! f30-0 (vector-normalize-ret-len! s0-0 1.0)) - (set! f28-0 (vector-normalize-ret-len! sv-160 1.0)) - (vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0) + ((< arg3 0.0) + (set! arg3 0.0) + ) + ) + (cond + (arg4 + (vector-flatten! s0-0 arg1 arg4) + (vector-flatten! sv-160 arg2 arg4) + (set! f30-0 (vector-normalize-ret-len! s0-0 1.0)) + (set! f28-0 (vector-normalize-ret-len! sv-160 1.0)) + (vector-normalize! (vector-cross! s3-0 sv-160 s0-0) 1.0) + (let ((f26-0 (vector-dot arg4 s3-0))) + (vector-normalize-copy! s3-0 arg4 1.0) + (if (< f26-0 0.0) + (vector-negate! s3-0 s3-0) + ) ) ) - (let ((t9-10 acos)) - ;; NOTE - manually fixed - #1819 - (let* ((v1-22 (-> *camera* local-down))) - (set! f0-10 (vector-dot v1-22 sv-160))) - (let* ((f1-3 (t9-10 f0-10)) - (f0-12 (* arg3 f1-3)) + (else + (set! (-> s0-0 quad) (-> arg1 quad)) + (set! (-> sv-160 quad) (-> arg2 quad)) + (set! f30-0 (vector-normalize-ret-len! s0-0 1.0)) + (set! f28-0 (vector-normalize-ret-len! sv-160 1.0)) + (vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0) + ) + ) + (let ((t9-10 acos)) + ;; (let* ((v1-22 s0-0) + ;; (f0-9 (-> v1-22 x)) + ;; (f1-2 (-> v1-22 y)) + ;; (f2-0 (-> v1-22 z)) + ;; (f3-0 (-> sv-160 x)) + ;; (f4-0 (-> sv-160 y)) + ;; (f5-0 (-> sv-160 z)) + ;; ) + ;; (.mula.s f0-9 f3-0) + ;; (.madda.s f1-2 f4-0) + ;; (.madd.s f0-10 f2-0 f5-0) + ;; ) + (set! f0-10 (vector-dot s0-0 sv-160)) + (let* ((f1-3 (t9-10 f0-10)) + (f0-12 (* arg3 f1-3)) + ) + (when (< sv-144 f0-12) + (set! f0-12 sv-144) + (set! arg3 (/ sv-144 f1-3)) + ) + (let* ((f0-13 (cos f0-12)) + (t9-12 matrix-axis-sin-cos!) + (a0-20 sv-176) + (a1-13 s3-0) + (f1-5 1.0) + (f2-3 f0-13) ) - (when (< sv-144 f0-12) - (set! f0-12 sv-144) - (set! arg3 (/ sv-144 f1-3)) - ) - (let* ((f0-13 (cos f0-12)) - (t9-12 matrix-axis-sin-cos!) - (a0-20 sv-176) - (a1-13 s3-0) - (f1-5 1.0) - (f2-3 f0-13) - ) - (t9-12 a0-20 a1-13 (sqrtf (- f1-5 (* f2-3 f2-3))) f0-13) - ) - ) - ) - (vector-matrix*! arg0 s0-0 sv-176) - (let ((s0-1 vector-normalize!)) - (set! sv-192 arg0) - (let ((a1-16 (lerp f30-0 f28-0 arg3))) - (s0-1 sv-192 a1-16) - ) - ) - (when arg4 - (let ((v1-33 arg0)) - (let ((a0-24 arg0) - (a1-17 s3-0) - (f0-15 (vector-dot arg1 s3-0)) - ) - (.lvf vf2 (&-> a1-17 quad)) - (.lvf vf1 (&-> a0-24 quad)) - (let ((a0-25 f0-15)) - (.mov vf3 a0-25) - ) - ) - (.add.x.vf vf4 vf0 vf0 :mask #b1000) - (.mul.x.vf acc vf2 vf3) - (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) - (.svf (&-> v1-33 quad) vf4) - ) - (let ((v1-34 arg0)) - (let ((a0-26 arg0) - (a1-18 s3-0) - (f0-17 (* arg3 (vector-dot (vector-! (new-stack-vector0) arg2 arg1) s3-0))) - ) - (.lvf vf2 (&-> a1-18 quad)) - (.lvf vf1 (&-> a0-26 quad)) - (let ((a0-27 f0-17)) - (.mov vf3 a0-27) - ) - ) - (.add.x.vf vf4 vf0 vf0 :mask #b1000) - (.mul.x.vf acc vf2 vf3) - (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) - (.svf (&-> v1-34 quad) vf4) + (t9-12 a0-20 a1-13 (sqrtf (- f1-5 (* f2-3 f2-3))) f0-13) ) ) ) + (vector-matrix*! arg0 s0-0 sv-176) + (let ((s0-1 vector-normalize!)) + (set! sv-192 arg0) + (let ((a1-16 (lerp f30-0 f28-0 arg3))) + (s0-1 sv-192 a1-16) + ) + ) + (when arg4 + (vector+float*! arg0 arg0 s3-0 (vector-dot arg1 s3-0)) + (vector+float*! arg0 arg0 s3-0 (* arg3 (vector-dot (vector-! (new-stack-vector0) arg2 arg1) s3-0))) + ) ) - arg0 ) + arg0 ) -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] (defun v-slrp3! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) (local-vars (f0-7 float) (f26-0 float) (f28-0 float) (sv-144 float) (sv-160 vector)) - (rlet ((acc :class vf) - (vf0 :class vf) - (vf1 :class vf) - (vf2 :class vf) - (vf3 :class vf) - (vf4 :class vf) - ) - (init-vf0-vector) - (set! sv-144 arg4) - (let ((s1-0 (new-stack-vector0))) - (set! sv-160 (new 'stack-no-clear 'vector)) - (set! (-> sv-160 quad) (the-as uint128 0)) - 0.0 - 0.0 - (let ((s3-0 (new-stack-vector0)) - (f30-0 1.0) - ) - 0.0 - (let ((s0-0 (new-stack-matrix0))) - (cond - (arg3 - (vector-flatten! s1-0 arg1 arg3) - (vector-flatten! sv-160 arg2 arg3) - (set! f28-0 (vector-normalize-ret-len! s1-0 1.0)) - (set! f26-0 (vector-normalize-ret-len! sv-160 1.0)) - (vector-normalize! (vector-cross! s3-0 sv-160 s1-0) 1.0) - (let ((f24-0 (vector-dot arg3 s3-0))) - (vector-normalize-copy! s3-0 arg3 1.0) - (if (< f24-0 0.0) - (vector-negate! s3-0 s3-0) - ) - ) - ) - (else - (set! (-> s1-0 quad) (-> arg1 quad)) - (set! (-> sv-160 quad) (-> arg2 quad)) - (set! f28-0 (vector-normalize-ret-len! s1-0 1.0)) - (set! f26-0 (vector-normalize-ret-len! sv-160 1.0)) - (vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0) - ) - ) - (let ((t9-10 acos)) - ;; NOTE - manually fixed - #1819 - (let* ((v1-10 (-> *camera* local-down))) - (set! f0-7 (vector-dot v1-10 sv-160))) - (let ((f0-8 (t9-10 f0-7))) - (when (< sv-144 f0-8) - (set! f30-0 (/ sv-144 f0-8)) - (set! f0-8 sv-144) - ) - (let* ((f0-9 (cos f0-8)) - (t9-12 matrix-axis-sin-cos!) - (a0-20 s0-0) - (a1-13 s3-0) - (f1-3 1.0) - (f2-1 f0-9) - ) - (t9-12 a0-20 a1-13 (sqrtf (- f1-3 (* f2-1 f2-1))) f0-9) - ) - ) - ) - (vector-matrix*! arg0 s1-0 s0-0) + (set! sv-144 arg4) + (let ((s1-0 (new-stack-vector0))) + (set! sv-160 (new 'stack-no-clear 'vector)) + (set! (-> sv-160 quad) (the-as uint128 0)) + 0.0 + 0.0 + (let ((s3-0 (new-stack-vector0)) + (f30-0 1.0) ) - (vector-normalize! arg0 (lerp f28-0 f26-0 f30-0)) - (when arg3 - (let ((v1-21 arg0)) - (let ((a0-24 arg0) - (a1-17 s3-0) - (f0-11 (vector-dot arg1 s3-0)) + 0.0 + (let ((s0-0 (new-stack-matrix0))) + (cond + (arg3 + (vector-flatten! s1-0 arg1 arg3) + (vector-flatten! sv-160 arg2 arg3) + (set! f28-0 (vector-normalize-ret-len! s1-0 1.0)) + (set! f26-0 (vector-normalize-ret-len! sv-160 1.0)) + (vector-normalize! (vector-cross! s3-0 sv-160 s1-0) 1.0) + (let ((f24-0 (vector-dot arg3 s3-0))) + (vector-normalize-copy! s3-0 arg3 1.0) + (if (< f24-0 0.0) + (vector-negate! s3-0 s3-0) ) - (.lvf vf2 (&-> a1-17 quad)) - (.lvf vf1 (&-> a0-24 quad)) - (let ((a0-25 f0-11)) - (.mov vf3 a0-25) - ) ) - (.add.x.vf vf4 vf0 vf0 :mask #b1000) - (.mul.x.vf acc vf2 vf3) - (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) - (.svf (&-> v1-21 quad) vf4) ) - (let ((v1-22 arg0)) - (let ((a0-26 arg0) - (a1-18 s3-0) - (f0-14 (* f30-0 (vector-dot (vector-! (new-stack-vector0) arg2 arg1) s3-0))) - ) - (.lvf vf2 (&-> a1-18 quad)) - (.lvf vf1 (&-> a0-26 quad)) - (let ((a0-27 f0-14)) - (.mov vf3 a0-27) - ) - ) - (.add.x.vf vf4 vf0 vf0 :mask #b1000) - (.mul.x.vf acc vf2 vf3) - (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) - (.svf (&-> v1-22 quad) vf4) + (else + (set! (-> s1-0 quad) (-> arg1 quad)) + (set! (-> sv-160 quad) (-> arg2 quad)) + (set! f28-0 (vector-normalize-ret-len! s1-0 1.0)) + (set! f26-0 (vector-normalize-ret-len! sv-160 1.0)) + (vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0) ) ) + (let ((t9-10 acos)) + ;; (let* ((v1-10 s1-0) + ;; (f0-6 (-> v1-10 x)) + ;; (f1-0 (-> v1-10 y)) + ;; (f2-0 (-> v1-10 z)) + ;; (f3-0 (-> sv-160 x)) + ;; (f4-0 (-> sv-160 y)) + ;; (f5-0 (-> sv-160 z)) + ;; ) + ;; (.mula.s f0-6 f3-0) + ;; (.madda.s f1-0 f4-0) + ;; (.madd.s f0-7 f2-0 f5-0) + ;; ) + (set! f0-7 (vector-dot s1-0 sv-160)) + (let ((f0-8 (t9-10 f0-7))) + (when (< sv-144 f0-8) + (set! f30-0 (/ sv-144 f0-8)) + (set! f0-8 sv-144) + ) + (let* ((f0-9 (cos f0-8)) + (t9-12 matrix-axis-sin-cos!) + (a0-20 s0-0) + (a1-13 s3-0) + (f1-3 1.0) + (f2-1 f0-9) + ) + (t9-12 a0-20 a1-13 (sqrtf (- f1-3 (* f2-1 f2-1))) f0-9) + ) + ) + ) + (vector-matrix*! arg0 s1-0 s0-0) + ) + (vector-normalize! arg0 (lerp f28-0 f26-0 f30-0)) + (when arg3 + (vector+float*! arg0 arg0 s3-0 (vector-dot arg1 s3-0)) + (vector+float*! arg0 arg0 s3-0 (* f30-0 (vector-dot (vector-! (new-stack-vector0) arg2 arg1) s3-0))) ) ) - arg0 ) + arg0 ) - - - - diff --git a/goal_src/jak2/engine/data/art-h.gc b/goal_src/jak2/engine/data/art-h.gc index 1736cd1079..431baf08f6 100644 --- a/goal_src/jak2/engine/data/art-h.gc +++ b/goal_src/jak2/engine/data/art-h.gc @@ -390,7 +390,7 @@ (get-skeleton-origin (_type_) vector 9) (draw-control-method-10 () none 10) (draw-control-method-11 () none 11) - (draw-control-method-12 (_type_ int int) none 12) + (draw-control-method-12 (_type_ uint int) none 12) (draw-control-method-13 () none 13) (draw-control-method-14 (_type_ cspace-array joint-control) none 14) ) diff --git a/goal_src/jak2/engine/debug/debug-h.gc b/goal_src/jak2/engine/debug/debug-h.gc index 7a1ed713b7..ceeddbde95 100644 --- a/goal_src/jak2/engine/debug/debug-h.gc +++ b/goal_src/jak2/engine/debug/debug-h.gc @@ -14,13 +14,16 @@ (define-extern add-debug-x (function symbol bucket-id vector rgba symbol)) (define-extern add-debug-vector (function symbol bucket-id vector vector meters rgba symbol)) -(define-extern add-debug-line2d (function symbol bucket-id vector vector vector symbol)) +(define-extern add-debug-line2d (function symbol bucket-id vector4w vector4w vector4w symbol)) (define-extern add-debug-text-3d (function symbol bucket-id string vector font-color vector2h symbol)) (define-extern add-debug-text-sphere (function symbol bucket-id vector meters string rgba symbol)) ;; NOTE - for debug (define-extern add-debug-sphere (function symbol bucket-id vector meters rgba symbol)) +;; NOTE - for joint-mod-h +(define-extern add-debug-matrix (function symbol bucket-id matrix meters matrix)) + ;; NOTE - for menu ;; +++debug-menu-msg (defenum debug-menu-msg @@ -65,6 +68,7 @@ :flag-assert #x900000010 ) + (deftype debug-vertex (structure) ((trans vector4w :inline :offset-assert 0) (normal vector3h :inline :offset-assert 16) @@ -87,27 +91,47 @@ :flag-assert #x900004b10 ) -(define *color-black* (new 'static 'rgba :a #x80)) -(define *color-white* (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) -(define *color-gray* (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) -(define *color-red* (new 'static 'rgba :r #xff :a #x80)) -(define *color-green* (new 'static 'rgba :g #xff :a #x80)) -(define *color-blue* (new 'static 'rgba :b #xff :a #x80)) -(define *color-cyan* (new 'static 'rgba :g #xff :b #xff :a #x80)) -(define *color-magenta* (new 'static 'rgba :r #xff :b #xff :a #x80)) -(define *color-yellow* (new 'static 'rgba :r #xff :g #xff :a #x80)) -(define *color-light-red* (new 'static 'rgba :r #xff :g #x80 :b #x80 :a #x80)) -(define *color-light-green* (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80)) -(define *color-light-blue* (new 'static 'rgba :r #x80 :g #x80 :b #xff :a #x80)) -(define *color-light-cyan* (new 'static 'rgba :r #x80 :g #xff :b #xff :a #x80)) -(define *color-light-magenta* (new 'static 'rgba :r #xff :g #x80 :b #xff :a #x80)) -(define *color-light-yellow* (new 'static 'rgba :r #xff :g #xff :b #x80 :a #x80)) -(define *color-dark-red* (new 'static 'rgba :r #x80 :a #x80)) -(define *color-dark-green* (new 'static 'rgba :g #x80 :a #x80)) -(define *color-dark-blue* (new 'static 'rgba :b #x80 :a #x80)) -(define *color-dark-cyan* (new 'static 'rgba :g #x80 :b #x80 :a #x80)) -(define *color-dark-magenta* (new 'static 'rgba :r #x80 :b #x80 :a #x80)) -(define *color-dark-yellow* (new 'static 'rgba :r #x80 :g #x80 :a #x80)) -(define *color-orange* (new 'static 'rgba :r #xff :g #x80 :a #x80)) -(define-extern add-debug-matrix (function symbol bucket-id matrix meters matrix)) +(define *color-black* (new 'static 'rgba :a #x80)) + +(define *color-white* (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + +(define *color-gray* (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + +(define *color-red* (new 'static 'rgba :r #xff :a #x80)) + +(define *color-green* (new 'static 'rgba :g #xff :a #x80)) + +(define *color-blue* (new 'static 'rgba :b #xff :a #x80)) + +(define *color-cyan* (new 'static 'rgba :g #xff :b #xff :a #x80)) + +(define *color-magenta* (new 'static 'rgba :r #xff :b #xff :a #x80)) + +(define *color-yellow* (new 'static 'rgba :r #xff :g #xff :a #x80)) + +(define *color-light-red* (new 'static 'rgba :r #xff :g #x80 :b #x80 :a #x80)) + +(define *color-light-green* (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80)) + +(define *color-light-blue* (new 'static 'rgba :r #x80 :g #x80 :b #xff :a #x80)) + +(define *color-light-cyan* (new 'static 'rgba :r #x80 :g #xff :b #xff :a #x80)) + +(define *color-light-magenta* (new 'static 'rgba :r #xff :g #x80 :b #xff :a #x80)) + +(define *color-light-yellow* (new 'static 'rgba :r #xff :g #xff :b #x80 :a #x80)) + +(define *color-dark-red* (new 'static 'rgba :r #x80 :a #x80)) + +(define *color-dark-green* (new 'static 'rgba :g #x80 :a #x80)) + +(define *color-dark-blue* (new 'static 'rgba :b #x80 :a #x80)) + +(define *color-dark-cyan* (new 'static 'rgba :g #x80 :b #x80 :a #x80)) + +(define *color-dark-magenta* (new 'static 'rgba :r #x80 :b #x80 :a #x80)) + +(define *color-dark-yellow* (new 'static 'rgba :r #x80 :g #x80 :a #x80)) + +(define *color-orange* (new 'static 'rgba :r #xff :g #x80 :a #x80)) diff --git a/goal_src/jak2/engine/debug/debug.gc b/goal_src/jak2/engine/debug/debug.gc index 1ff0cb3b87..2e738de0eb 100644 --- a/goal_src/jak2/engine/debug/debug.gc +++ b/goal_src/jak2/engine/debug/debug.gc @@ -670,8 +670,7 @@ #f ) -(defun-debug add-debug-line2d ((enable symbol) (bucket bucket-id) (start vector) (end vector) (color vector)) - "Draw a line in screen coordinates" +(defun-debug add-debug-line2d ((enable symbol) (bucket bucket-id) (start vector4w) (end vector4w) (color vector4w)) (if (not enable) (return #f) ) @@ -683,11 +682,11 @@ ) (set! (-> p0 quad) (-> start quad)) (set! (-> p1 quad) (-> end quad)) - (set! (-> p0 x) (* (+ (-> p0 x) 2048) 16)) - (set! (-> p0 y) (* -16 (- 2048 (-> p0 y)))) + (set! (-> p0 x) (the-as int (* (+ (-> p0 x) 2048) 16))) + (set! (-> p0 y) (* -16 (the-as int (- 2048 (the-as int (-> p0 y)))))) (set! (-> p0 z) #x7fffff) - (set! (-> p1 x) (* (+ (-> p1 x) 2048) 16)) - (set! (-> p1 y) (* -16 (- 2048 (-> p1 y)))) + (set! (-> p1 x) (the-as int (* (+ (-> p1 x) 2048) 16))) + (set! (-> p1 y) (* -16 (the-as int (- 2048 (the-as int (-> p1 y)))))) (set! (-> p1 z) #x7fffff) (let ((a0-18 (the-as (pointer uint64) (-> buf base)))) (let* ((a1-7 buf) @@ -701,22 +700,20 @@ (let* ((a1-8 buf) (giftag (the-as gs-gif-tag (-> a1-8 base))) ) - (set! (-> giftag tag) - (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type line) :iip #x1 :abe #x1) - :nreg #x4 - ) + (set! (-> giftag tag) (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line) :iip #x1 :abe #x1) + :nreg #x4 + ) ) - (set! (-> giftag regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id xyzf2) - :regs2 (gif-reg-id rgbaq) - :regs3 (gif-reg-id xyzf2) - ) + (set! (-> giftag regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyzf2) + :regs2 (gif-reg-id rgbaq) + :regs3 (gif-reg-id xyzf2) + ) ) (set! (-> a1-8 base) (&+ (the-as pointer giftag) 16)) ) @@ -1943,4 +1940,4 @@ ) 0 (none) - ) \ No newline at end of file + ) diff --git a/goal_src/jak2/engine/game/game-info-h.gc b/goal_src/jak2/engine/game/game-info-h.gc index 0d9bc71d63..66d2e932b2 100644 --- a/goal_src/jak2/engine/game/game-info-h.gc +++ b/goal_src/jak2/engine/game/game-info-h.gc @@ -9,29 +9,6 @@ (declare-type continue-point basic) (declare-type game-save basic) - -(defenum mc-status-code - :type uint32 - ; (busy 0) - (ok 1) - ; (bad-handle 2) - ; (format-failed 3) - ; (internal-error 4) - ; (write-error 5) - ; (read-error 6) - ; (new-game 7) - ; (no-memory 8) - ; (no-card 9) - ; (no-last 10) - ; (no-format 11) - ; (no-file 12) - ; (no-save 13) - ; (no-space 14) - ; (bad-version 15) - ; (no-process 16) - ; (no-auto-save 17) - ) - (defenum continue-flags :type uint32 :bitfield #t @@ -131,6 +108,10 @@ (define-extern bug-report-display (function symbol int)) (define-extern trsq->continue-point (function trsq int)) +;; NOTE - for progress +(declare-type highscore-info structure) +(define-extern *highscore-info-array* (array highscore-info)) + (declare-type entity-perm structure) (define-extern *task-level* (array symbol)) @@ -276,7 +257,7 @@ (debug-features game-feature :offset-assert 136) (secrets game-secrets :offset-assert 144) (unknown-pad1 uint32 :offset-assert 148) - (purchase-secrets uint32 :offset-assert 152) + (purchase-secrets game-secrets :offset-assert 152) (unknown-pad2 uint32 :offset-assert 156) (gun-type int32 :offset-assert 160) (gun-ammo float 4 :offset-assert 164) @@ -295,7 +276,7 @@ (last-continue continue-point :offset-assert 244) (play-list (array game-task-info) :offset-assert 248) (sub-task-list (array game-task-node-info) :offset-assert 252) - (unknown-pad5 (array game-task-node-info) :offset-assert 256) + (mission-list (array game-task-node-info) :offset-assert 256) (task-counter uint32 :offset-assert 260) (unknown-pad6 (array uint16) :offset-assert 264) (level-opened uint8 32 :offset-assert 268) @@ -318,7 +299,7 @@ (letterbox-time time-frame :offset-assert 400) (hint-play-time time-frame :offset-assert 408) (display-text-time time-frame :offset-assert 416) - (display-text-handle uint64 :offset-assert 424) + (display-text-handle handle :offset-assert 424) (death-movie-tick int32 :offset-assert 432) (want-auto-save symbol :offset-assert 436) (auto-save-proc handle :offset-assert 440) diff --git a/goal_src/jak2/engine/game/game-info.gc b/goal_src/jak2/engine/game/game-info.gc index 86842b154c..8c0a91f36c 100644 --- a/goal_src/jak2/engine/game/game-info.gc +++ b/goal_src/jak2/engine/game/game-info.gc @@ -1636,7 +1636,7 @@ 0 ) (if (zero? (-> gp-0 display-text-handle)) - (set! (-> gp-0 display-text-handle) (the-as uint #f)) + (set! (-> gp-0 display-text-handle) (the-as handle #f)) ) (if (zero? (-> gp-0 game-score)) (set! (-> gp-0 game-score) (new 'global 'boxed-array float 152)) diff --git a/goal_src/jak2/engine/game/main.gc b/goal_src/jak2/engine/game/main.gc index 6e0515e9a9..40d4e071b1 100644 --- a/goal_src/jak2/engine/game/main.gc +++ b/goal_src/jak2/engine/game/main.gc @@ -390,7 +390,7 @@ (and (!= *cheat-mode* 'camera) (or (zero? *screen-shot-work*) (= (-> *screen-shot-work* count) -1))) ) (draw-string-xy - "pause or something like that" ;;(lookup-text! *common-text* (game-text-id pause) #f) + (lookup-text! *common-text* (game-text-id pause) #f) buf 256 (if (< (-> *display* base-clock frame-counter) (-> *game-info* letterbox-time)) @@ -539,7 +539,7 @@ ) ;; load text files as needed from the menu update - ; (load-level-text-files -1) + (load-level-text-files -1) ;; post-processing filter drawing ; (if (-> *screen-filter* draw?) @@ -719,7 +719,7 @@ ; ) (let ((gp-1 *display*)) (set! *teleport* #t) - ; (update *setting-control*) + (update *setting-control*) (init-time-of-day-context *time-of-day-context*) (format 0 "about to display-sync~%") (display-sync gp-1) diff --git a/goal_src/jak2/engine/game/task/game-task.gc b/goal_src/jak2/engine/game/task/game-task.gc index 68768b95e6..8dc7520cae 100644 --- a/goal_src/jak2/engine/game/task/game-task.gc +++ b/goal_src/jak2/engine/game/task/game-task.gc @@ -12305,7 +12305,7 @@ ) ) ) - (set! (-> gp-0 unknown-pad5) (new 'global 'boxed-array game-task-node-info 324)) + (set! (-> gp-0 mission-list) (new 'global 'boxed-array game-task-node-info 324)) (dotimes (v1-3 (-> gp-0 sub-task-list length)) (if (-> gp-0 sub-task-list v1-3 info) (set! (-> gp-0 sub-task-list v1-3 info manager) (the-as handle #f)) diff --git a/goal_src/jak2/engine/game/task/task-control-h.gc b/goal_src/jak2/engine/game/task/task-control-h.gc index 4fae977ba9..a5c7b70081 100644 --- a/goal_src/jak2/engine/game/task/task-control-h.gc +++ b/goal_src/jak2/engine/game/task/task-control-h.gc @@ -249,6 +249,9 @@ (define-extern task-node-open? (function game-task-node symbol)) (define-extern play-task (function game-task symbol symbol string)) +;; NOTE - for progress +(define-extern restart-mission (function int)) + ;; DECOMP BEGINS (defun-debug game-task->string ((arg0 game-task)) diff --git a/goal_src/jak2/engine/math/matrix.gc b/goal_src/jak2/engine/math/matrix.gc index f89532440f..700b9705a2 100644 --- a/goal_src/jak2/engine/math/matrix.gc +++ b/goal_src/jak2/engine/math/matrix.gc @@ -971,7 +971,6 @@ (defun matrix-axis-angle! ((arg0 matrix) (arg1 vector) (arg2 float)) "Create an axis-angle rotation matrix." (matrix-axis-sin-cos! arg0 arg1 (sin arg2) (cos arg2)) - (none) ) (defun matrix-lerp! ((arg0 matrix) (arg1 matrix) (arg2 matrix) (arg3 float)) diff --git a/goal_src/jak2/engine/process-drawable/process-focusable.gc b/goal_src/jak2/engine/process-drawable/process-focusable.gc index 3030812c8c..d9a74019c8 100644 --- a/goal_src/jak2/engine/process-drawable/process-focusable.gc +++ b/goal_src/jak2/engine/process-drawable/process-focusable.gc @@ -53,17 +53,19 @@ :flag-assert #x1b005000cc (:methods (get-trans (_type_ int) vector 20) - (get-quat (_type_) quaternion 21) + (get-quat (_type_ int) quaternion 21) (get-transv (_type_) vector 22) (process-focusable-method-23 (_type_) none 23) - (process-focusable-method-24 (_type_) none 24) - (process-focusable-method-25 (_type_) int 25) + (process-focusable-method-24 (_type_) float 24) + (process-focusable-method-25 (_type_) time-frame 25) (process-focusable-method-26 (_type_) none 26) ) ) +;; WARN: Return type mismatch structure vs vector. (defmethod get-trans process-focusable ((obj process-focusable) (arg0 int)) + "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]]" (let ((gp-0 (-> obj root))) (the-as vector (cond ((zero? arg0) @@ -87,7 +89,7 @@ (-> obj root transv) ) -(defmethod get-quat process-focusable ((obj process-focusable)) +(defmethod get-quat process-focusable ((obj process-focusable) (arg0 int)) (-> obj root quat) ) @@ -97,8 +99,7 @@ ) (defmethod process-focusable-method-24 process-focusable ((obj process-focusable)) - 0 - (none) + 0.0 ) (defmethod process-focusable-method-26 process-focusable ((obj process-focusable)) @@ -106,12 +107,7 @@ (none) ) +;; WARN: Return type mismatch int vs time-frame. (defmethod process-focusable-method-25 process-focusable ((obj process-focusable)) - 0 + (the-as time-frame 0) ) - -0 - - - - diff --git a/goal_src/jak2/engine/ps2/memcard-h.gc b/goal_src/jak2/engine/ps2/memcard-h.gc index 230ae702c5..596d175df7 100644 --- a/goal_src/jak2/engine/ps2/memcard-h.gc +++ b/goal_src/jak2/engine/ps2/memcard-h.gc @@ -5,6 +5,31 @@ ;; name in dgo: memcard-h ;; dgos: ENGINE, GAME +;; +++mc-status-code +(defenum mc-status-code + :type uint32 + (busy 0) + (ok 1) + (bad-handle 2) + (format-failed 3) + (internal-error 4) + (write-error 5) + (read-error 6) + (new-game 7) + (no-memory 8) + (no-card 9) + (no-last 10) + (no-format 11) + (no-file 12) + (no-save 13) + (no-space 14) + (bad-version 15) + (no-process 16) + (no-auto-save 17) + ) +;; ---mc-status-code + + ;; DECOMP BEGINS (deftype mc-handle (int32) diff --git a/goal_src/jak2/engine/target/board/board-states.gc b/goal_src/jak2/engine/target/board/board-states.gc index 4cbecf505d..9f9626ca13 100644 --- a/goal_src/jak2/engine/target/board/board-states.gc +++ b/goal_src/jak2/engine/target/board/board-states.gc @@ -286,8 +286,6 @@ (none) ) -;; definition for function target-board-halfpipe-trans -;; WARN: Return type mismatch int vs none. (defbehavior target-board-halfpipe-trans target () (when (and (logtest? (focus-status halfpipe) (-> self focus-status)) *camera*) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -318,8 +316,6 @@ (none) ) -;; definition for function target-board-resolve-points -;; WARN: Return type mismatch int vs none. (defbehavior target-board-resolve-points target ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) (when (= (-> self board main mode) (joint-mod-mode rotate)) (let ((f0-1 (fabs (-> self board troty-cum)))) @@ -398,7 +394,7 @@ (t9-8 (the-as vector a0-4) (the-as float a1-0)) ) ) - (when (zero? (logand (-> self control old-status) (cshape-moving-flags on-surface))) + (when (not (logtest? (-> self control old-status) (cshape-moving-flags on-surface))) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) @@ -491,8 +487,6 @@ (none) ) -;; definition for function target-board-halfpipe-check -;; INFO: Used lq/sq (defbehavior target-board-halfpipe-check target () (local-vars (v0-3 collide-action)) (let ((gp-0 (vector-flatten! @@ -532,7 +526,6 @@ ) ) -;; definition for function target-board-jump-trans (defbehavior target-board-jump-trans target () (when (and (!= (-> self state-time) (-> self clock frame-counter)) (jump-hit-ground-stuck?)) (set! (-> self board jump-land-time) (-> self clock frame-counter)) @@ -544,8 +537,8 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 12288.0) (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (and (zero? (logand (water-flags touch-water) (-> self water flags))) - (zero? (logand (-> self state-flags) (state-flags sf7))) + (and (not (logtest? (water-flags touch-water) (-> self water flags))) + (not (logtest? (-> self state-flags) (state-flags sf7))) (not (and (-> self next-state) (= (-> self next-state name) 'target-board-wall-kick))) ) ) @@ -555,7 +548,6 @@ (none) ) -;; failed to figure out what this is: (defstate target-board-start (target) :event target-board-handler :exit target-board-exit @@ -568,10 +560,9 @@ :post target-post ) -;; failed to figure out what this is: (defstate target-board-stance (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('lip) (when (and (= (-> self control ground-pat mode) (pat-mode halfpipe)) (< (-> self control poly-angle) 0.5) @@ -588,7 +579,7 @@ ) (set! (-> self board halfpipe-lip-time) (-> self clock frame-counter)) (set! (-> self board halfpipe-side-time) (-> self clock frame-counter)) - (set! (-> self board halfpipe-lip-event) (the-as symbol (-> arg3 param 0))) + (set! (-> self board halfpipe-lip-event) (the-as symbol (-> event param 0))) (let ((v0-2 (the-as object (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset)))) ) (set! (-> self control root-prim prim-core action) (the-as collide-action v0-2)) @@ -599,13 +590,13 @@ (('jump) (go target-board-jump - (the-as meters (-> arg3 param 0)) - (the-as meters (-> arg3 param 1)) - (the-as symbol (-> arg3 param 2)) + (the-as meters (-> event param 0)) + (the-as meters (-> event param 1)) + (the-as symbol (-> event param 2)) ) ) (else - (target-board-handler arg0 arg1 arg2 arg3) + (target-board-handler proc arg1 event-type event) ) ) ) @@ -641,7 +632,7 @@ ) :trans (behavior () (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1) - (zero? (logand (-> self state-flags) (state-flags sf9))) + (not (logtest? (-> self state-flags) (state-flags sf9))) (< (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (the-as time-frame (-> *TARGET-bank* ground-timeout)) ) @@ -826,7 +817,6 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-duck-stance (target) :event (-> target-board-stance event) :enter (behavior () @@ -840,8 +830,7 @@ (none) ) :trans (behavior () - (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) - ) + (if (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) l1)) (logtest? (-> self state-flags) (state-flags sf9)) (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (the-as time-frame (-> *TARGET-bank* ground-timeout)) @@ -936,13 +925,12 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-jump (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (and (= arg2 'edge-grab) (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1))) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (if (and (= event-type 'edge-grab) (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1))) (return #f) ) - (target-board-handler arg0 arg1 arg2 arg3) + (target-board-handler proc arg1 event-type event) ) :enter (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) (local-vars @@ -1154,10 +1142,9 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-halfpipe (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('edge-grab) (format #t @@ -1202,14 +1189,14 @@ ) ) (('grenade) - (if (< (the-as float (-> arg3 param 0)) + (if (< (the-as float (-> event param 0)) (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) ) - (go target-board-grenade (process->handle arg0)) + (go target-board-grenade (process->handle proc)) ) ) (else - (target-board-handler arg0 arg1 arg2 arg3) + (target-board-handler proc arg1 event-type event) ) ) ) @@ -1419,7 +1406,6 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-falling (target) :event target-board-handler :enter (behavior () @@ -1503,7 +1489,6 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-jump-kick (target) :event target-board-handler :enter (behavior () @@ -1555,7 +1540,6 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-wall-kick (target) :event target-board-handler :enter (behavior ((arg0 vector) (arg1 float)) @@ -1605,7 +1589,6 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-flip (target) :event (-> target-board-jump event) :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) @@ -1698,8 +1681,7 @@ (let ((f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) (s4-0 0) ) - (while (not (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r1)) - ) + (while (not (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) r1)) (or (= f0-9 0.0) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.5))) ) (nonzero? s4-0) @@ -1788,7 +1770,6 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-hold (target) :event (-> target-board-jump event) :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) @@ -1865,8 +1846,7 @@ (set! (-> v1-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 lefty))))) (set! (-> v1-0 w) 1.0) (let ((f30-0 (analog-input (the int (* 128.0 (-> v1-0 z))) 0.0 96.0 110.0 1.0))) - (while (not (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) - ) + (while (not (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) l1)) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.3)) ) @@ -1993,7 +1973,6 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-trickx (target) :event (-> target-board-jump event) :enter (-> target-board-hold enter) @@ -2032,8 +2011,7 @@ (let ((f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) (s4-0 0) ) - (while (not (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r1)) - ) + (while (not (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) r1)) (or (= f0-9 0.0) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.5))) ) (nonzero? s4-0) @@ -2103,7 +2081,6 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-hit-ground (target) :event target-board-handler :enter (behavior () @@ -2188,7 +2165,6 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-turn-to (target) :event target-board-handler :enter (behavior ((arg0 vector) (arg1 time-frame)) @@ -2257,15 +2233,14 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-ride-edge (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('edge-grab 'push-transv 'push-trans) #f ) (('end-mode) - (when (-> arg3 param 0) + (when (-> event param 0) (let ((v1-6 (/ (- (-> self clock frame-counter) (-> self board ride-start-time)) 300))) (if (> v1-6 0) (add-to-trick-list (-> self board) (board-tricks board-rail) (* 100.0 (the float v1-6))) @@ -2275,7 +2250,7 @@ (go target-board-turn-to (-> self control transv) (seconds 0.2)) ) (else - (target-board-handler arg0 arg1 arg2 arg3) + (target-board-handler proc arg1 event-type event) ) ) ) @@ -2531,15 +2506,14 @@ ) ) -;; failed to figure out what this is: (defstate target-board-grenade (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('target) (handle->process (-> self control unknown-handle02)) ) (else - (target-board-handler arg0 arg1 arg2 arg3) + (target-board-handler proc arg1 event-type event) ) ) ) @@ -2642,21 +2616,20 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-get-on (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('attack 'attack-or-shove 'attack-invinc) (target-attacked - arg2 - (the-as attack-info (-> arg3 param 1)) - arg0 - (the-as process (-> arg3 param 0)) + event-type + (the-as attack-info (-> event param 1)) + proc + (the-as process (-> event param 0)) target-hit ) ) (else - (target-generic-event-handler arg0 arg1 arg2 arg3) + (target-generic-event-handler proc arg1 event-type event) ) ) ) @@ -2800,15 +2773,14 @@ :post target-board-post ) -;; failed to figure out what this is: (defstate target-board-pegasus (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('end-mode) (go target-jump 16384.0 16384.0 (the-as surface #f)) ) (else - (target-generic-event-handler arg0 arg1 arg2 arg3) + (target-generic-event-handler proc arg1 event-type event) ) ) ) @@ -2844,13 +2816,7 @@ (when s4-1 (set! (-> self control unknown-vector38 quad) (-> (get-trans (the-as process-focusable s4-1) 0) quad)) (set! (-> self control unknown-vector38 y) (+ 4096.0 (-> self control unknown-vector38 y))) - (let* ((s3-2 (-> self control unknown-vector40)) - (a0-15 (the-as process-focusable s4-1)) - (t9-4 (method-of-object a0-15 get-quat)) - ) - 0 - (set! (-> s3-2 quad) (-> (t9-4 a0-15) vec quad)) - ) + (set! (-> self control unknown-vector40 quad) (-> (get-quat (the-as process-focusable s4-1) 0) vec quad)) ) (let ((f28-0 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 0.0 30.0)))) (let ((f26-0 f28-0)) @@ -2904,7 +2870,6 @@ ) ) -;; failed to figure out what this is: (defstate target-board-get-off (target) :event (-> target-board-get-on event) :enter (behavior ((arg0 object) (arg1 symbol)) @@ -3103,23 +3068,22 @@ ) ) -;; failed to figure out what this is: (defstate target-board-grab (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + ((and (= event-type 'query) (= (-> event param 0) 'mode)) (-> self state name) ) (else - (case arg2 + (case event-type (('end-mode) (go target-board-stance) ) (('clone-anim) - (go target-board-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + (go target-board-clone-anim (process->handle (the-as process (-> event param 0)))) ) (('change-mode) - (case (-> arg3 param 0) + (case (-> event param 0) (('normal) enter-state 'stance @@ -3128,7 +3092,7 @@ ) ) (else - (target-generic-event-handler arg0 arg1 arg2 arg3) + (target-generic-event-handler proc arg1 event-type event) ) ) ) @@ -3169,11 +3133,11 @@ ) (defstate target-board-clone-anim (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) (set! (-> self control unknown-word04) (the-as uint #f)) ) - ((-> target-board-grab event) arg0 arg1 arg2 arg3) + ((-> target-board-grab event) proc arg1 event-type event) ) :enter (-> target-clone-anim enter) :exit (behavior () @@ -3196,7 +3160,6 @@ :post target-no-ja-move-post ) -;; failed to figure out what this is: (defstate target-board-hit (target) :event target-board-handler :exit (behavior () @@ -3258,7 +3221,7 @@ ) self ((method-of-type attack-info attack-info-method-11)) - (when (zero? (logand (-> gp-0 mask) (attack-info-mask vector))) + (when (not (logtest? (-> gp-0 mask) (attack-info-mask vector))) (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index ddf3487421..741bbce6d4 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -1842,11 +1842,11 @@ (when (!= (-> self beard?) v1-248) (cond (v1-248 - (draw-control-method-12 (-> self draw) 2 0) + (draw-control-method-12 (-> self draw) (the-as uint 2) 0) (set! (-> self beard?) #t) ) (else - (draw-control-method-12 (-> self draw) 0 2) + (draw-control-method-12 (-> self draw) (the-as uint 0) 2) (set! (-> self beard?) #f) ) ) diff --git a/goal_src/jak2/engine/ui/bigmap-h.gc b/goal_src/jak2/engine/ui/bigmap-h.gc index 5d20be9164..29b6dd88b7 100644 --- a/goal_src/jak2/engine/ui/bigmap-h.gc +++ b/goal_src/jak2/engine/ui/bigmap-h.gc @@ -5,8 +5,13 @@ ;; name in dgo: bigmap-h ;; dgos: ENGINE, GAME -;; DECOMP BEGINS +(declare-type bigmap-compressed-layers structure) +(define-extern *bigmap-compressed-layers* bigmap-compressed-layers) +(declare-type bigmap basic) +(define-extern *bigmap* bigmap) + +;; DECOMP BEGINS (deftype bigmap-bit-mask (structure) ((data uint8 6656 :offset-assert 0) @@ -16,6 +21,7 @@ :flag-assert #x900001a00 ) + (deftype bigmap-layer-mask (structure) ((data uint8 26624 :offset-assert 0) ) @@ -24,6 +30,7 @@ :flag-assert #x900006800 ) + (deftype bigmap-image (structure) ((clut-offset uint32 :offset-assert 0) (image-offset uint32 :offset-assert 4) @@ -35,6 +42,7 @@ :flag-assert #x900000011 ) + (deftype bigmap-info (vector) ((scale float :offset 8) (inv-scale float :offset 12) @@ -44,6 +52,7 @@ :flag-assert #x900000010 ) + (deftype bigmap-info-array (structure) ((data bigmap-info 21 :inline :offset-assert 0) ) @@ -52,6 +61,7 @@ :flag-assert #x900000150 ) + (deftype bigmap-compressed-layers (structure) ((data uint32 20 :offset-assert 0) (layer0 uint32 :offset 0) @@ -79,7 +89,6 @@ :size-assert #x50 :flag-assert #x900000050 ) -(define-extern *bigmap-compressed-layers* bigmap-compressed-layers) (deftype bigmap (basic) @@ -130,7 +139,7 @@ (new (symbol type) _type_ 0) (initialize (_type_) none 9) (update (_type_) none 10) - (bigmap-method-11 () none 11) + (bigmap-method-11 (_type_ int int int int) none 11) (bigmap-method-12 () none 12) (bigmap-method-13 () none 13) (bigmap-method-14 (_type_) none 14) @@ -150,6 +159,7 @@ ) ) + (defmethod new bigmap ((allocation symbol) (type-to-make type)) (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (set! (-> gp-0 bigmap-image) @@ -199,57 +209,18 @@ (set! (-> gp-0 sprite-tmpl dma-vif dma) (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))) (set! (-> gp-0 sprite-tmpl dma-vif vif0) (new 'static 'vif-tag)) (set! (-> gp-0 sprite-tmpl dma-vif vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)) - (set! (-> gp-0 sprite-tmpl gif0) - (the uint64 (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1) - :nreg #x5 - ) - ) - ) - (set! (-> gp-0 sprite-tmpl gif1) - (the uint64 (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id uv) - :regs2 (gif-reg-id xyz2) - :regs3 (gif-reg-id uv) - :regs4 (gif-reg-id xyz2) - ) - ) - ) + (set! (-> gp-0 sprite-tmpl gif0) (the-as uint #x50ab400000008001)) + (set! (-> gp-0 sprite-tmpl gif1) (the-as uint #x53531)) (set! (-> gp-0 draw-tmpl dma-vif dma) (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt))) (set! (-> gp-0 draw-tmpl dma-vif vif0) (new 'static 'vif-tag)) (set! (-> gp-0 draw-tmpl dma-vif vif1) (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1)) - (set! (-> gp-0 draw-tmpl gif0) - (the uint64 (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :tme #x1 :abe #x1 :fst #x1) - :nreg #x9 - ) - ) - ) - (set! (-> gp-0 draw-tmpl gif1) (the uint64 (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id uv) - :regs2 (gif-reg-id xyz2) - :regs3 (gif-reg-id uv) - :regs4 (gif-reg-id xyz2) - :regs5 (gif-reg-id uv) - :regs6 (gif-reg-id xyz2) - :regs7 (gif-reg-id uv) - :regs8 (gif-reg-id xyz2) - ) - ) - ) + (set! (-> gp-0 draw-tmpl gif0) (the-as uint #x90aa400000008001)) + (set! (-> gp-0 draw-tmpl gif1) (the-as uint #x535353531)) (set! (-> gp-0 adgif-tmpl dma-vif dma) (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))) (set! (-> gp-0 adgif-tmpl dma-vif vif0) (new 'static 'vif-tag)) (set! (-> gp-0 adgif-tmpl dma-vif vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)) - (set! (-> gp-0 adgif-tmpl gif0) (the uint64 (new 'static 'gif-tag64 :nloop #x5 :eop #x1 :nreg #x1))) - (set! (-> gp-0 adgif-tmpl gif1) (the uint64 (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))) + (set! (-> gp-0 adgif-tmpl gif0) (the-as uint #x1000000000008005)) + (set! (-> gp-0 adgif-tmpl gif1) (the-as uint 14)) (set-vector! (-> gp-0 offset) 0.0 0.0 0.0 0.0) (set-vector! (-> gp-0 scroll) 0.0 0.0 0.0 0.0) (set-vector! (-> gp-0 pos) 0 0 0 0) @@ -292,8 +263,3 @@ ) ) ) - - -(define-extern *bigmap* bigmap) - - diff --git a/goal_src/jak2/engine/ui/hud-h.gc b/goal_src/jak2/engine/ui/hud-h.gc index de098da91d..644d101d66 100644 --- a/goal_src/jak2/engine/ui/hud-h.gc +++ b/goal_src/jak2/engine/ui/hud-h.gc @@ -10,6 +10,15 @@ :bitfield #t ) +;; NOTE - for progress +(define-extern hide-hud (function symbol none)) +(define-extern hud-hidden? (function symbol)) +(declare-type hud-sprite structure) +(define-extern set-hud-piece-position! (function hud-sprite int int none)) +(define-extern show-hud (function object none)) +(declare-type hud process) +(define-extern hud-init-by-other (function object :behavior hud)) + ;; DECOMP BEGINS (deftype hud-string (basic) @@ -24,6 +33,7 @@ :flag-assert #x900000030 ) + (deftype hud-sprite (structure) ((pos vector4w :inline :offset-assert 0) (color vector4w :inline :offset-assert 16) @@ -37,11 +47,12 @@ :size-assert #x34 :flag-assert #xb00000034 (:methods - (hud-sprite-method-9 () none 9) + (hud-sprite-method-9 (_type_ dma-buffer level) none 9) (hud-sprite-method-10 () none 10) ) ) + (deftype hud-box (structure) ((min vector2 :inline :offset-assert 0) (max vector2 :inline :offset-assert 8) @@ -51,16 +62,17 @@ :size-assert #x20 :flag-assert #x1000000020 (:methods - (hud-box-method-9 () none 9) + (hud-box-method-9 (_type_ dma-buffer) none 9) (hud-box-method-10 () none 10) (hud-box-method-11 () none 11) (hud-box-method-12 () none 12) (hud-box-method-13 (_type_ dma-buffer float) int 13) - (hud-box-method-14 () none 14) - (hud-box-method-15 () none 15) + (hud-box-method-14 (_type_) none 14) + (hud-box-method-15 (_type_) none 15) ) ) + (deftype hud-icon (basic) ((icon (pointer manipy) :offset-assert 4) (pos vector4w :inline :offset-assert 16) @@ -72,6 +84,7 @@ :flag-assert #x900000028 ) + (deftype hud-value (basic) ((current int32 :offset-assert 4) (target int32 :offset-assert 8) @@ -84,6 +97,7 @@ :flag-assert #x900000010 ) + (deftype hud (process) ((trigger-time time-frame :offset-assert 128) (last-hide-time time-frame :offset-assert 136) @@ -116,6 +130,7 @@ ) ) + (deftype hud-ashelin (hud) () :heap-base #xb30 @@ -124,6 +139,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-cargo (hud) () :heap-base #xb30 @@ -132,6 +148,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-citizen (hud) () :heap-base #xb30 @@ -140,6 +157,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-cpanel (hud) () :heap-base #xb30 @@ -148,6 +166,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-dig-clasp (hud) () :heap-base #xb30 @@ -156,6 +175,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-gun (hud) () :heap-base #xb30 @@ -164,6 +184,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-health (hud) () :heap-base #xb30 @@ -172,6 +193,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-dark-eco-symbol (hud) () :heap-base #xb30 @@ -180,6 +202,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-helldog (hud) () :heap-base #xb30 @@ -188,6 +211,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-lurker (hud) () :heap-base #xb30 @@ -196,6 +220,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-map (hud) () :heap-base #xb30 @@ -204,6 +229,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-moneybag (hud) () :heap-base #xb30 @@ -212,6 +238,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-pegasus (hud) () :heap-base #xb30 @@ -220,6 +247,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-plasmite (hud) () :heap-base #xb30 @@ -228,6 +256,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-dig-button (hud) () :heap-base #xb30 @@ -236,6 +265,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-predator (hud) () :heap-base #xb30 @@ -244,6 +274,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-heatmeter (hud) () :heap-base #xb30 @@ -252,6 +283,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-progress (hud) () :heap-base #xb30 @@ -260,6 +292,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-rocketsensor (hud) () :heap-base #xb30 @@ -268,6 +301,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-ruffians (hud) () :heap-base #xb30 @@ -276,6 +310,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-score (hud) () :heap-base #xb30 @@ -284,6 +319,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-sig (hud) () :heap-base #xb30 @@ -292,6 +328,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-skill (hud) () :heap-base #xb30 @@ -300,6 +337,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-skullgem (hud) () :heap-base #xb30 @@ -308,6 +346,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-timer (hud) () :heap-base #xb30 @@ -316,6 +355,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-turret (hud) () :heap-base #xb30 @@ -324,6 +364,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-squid (hud) () :heap-base #xb30 @@ -332,6 +373,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-gunturret (hud) () :heap-base #xb30 @@ -340,6 +382,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-gruntegg (hud) () :heap-base #xb30 @@ -348,6 +391,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-crimsonhover (hud) () :heap-base #xb30 @@ -356,6 +400,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-metalkor (hud) () :heap-base #xb30 @@ -364,6 +409,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-big-score (hud) () :heap-base #xb30 @@ -372,6 +418,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-goal (hud) () :heap-base #xb30 @@ -380,6 +427,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-miss (hud) () :heap-base #xb30 @@ -388,6 +436,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-race-timer (hud) () :heap-base #xb30 @@ -396,6 +445,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-race-lap-counter (hud) () :heap-base #xb30 @@ -404,6 +454,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-race-turbo-counter (hud) () :heap-base #xb30 @@ -412,6 +463,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-race-position (hud) () :heap-base #xb30 @@ -420,6 +472,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-race-map (hud) () :heap-base #xb30 @@ -428,6 +481,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-samos-old (hud) () :heap-base #xb30 @@ -436,6 +490,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-samos-young (hud) () :heap-base #xb30 @@ -444,6 +499,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-lurker-button (hud) () :heap-base #xb30 @@ -452,6 +508,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-widow (hud) () :heap-base #xb30 @@ -460,6 +517,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-race-final-stats (hud) () :heap-base #xb30 @@ -468,6 +526,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-mech-air-tank (hud) () :heap-base #xb30 @@ -476,6 +535,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-homing-beacon (hud) () :heap-base #xb30 @@ -484,6 +544,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-dark-eco-pickup (hud) () :heap-base #xb30 @@ -492,6 +553,7 @@ :flag-assert #x1b0b300ba4 ) + (deftype hud-green-eco-pickup (hud) () :heap-base #xb30 @@ -499,8 +561,3 @@ :size-assert #xba4 :flag-assert #x1b0b300ba4 ) - - -(define-extern hud-init-by-other (function object :behavior hud)) - -(define-extern show-hud (function object none)) diff --git a/goal_src/jak2/engine/ui/progress/progress-draw.gc b/goal_src/jak2/engine/ui/progress/progress-draw.gc index 252ac8d2b3..e3ed3308e7 100644 --- a/goal_src/jak2/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak2/engine/ui/progress/progress-draw.gc @@ -7,3 +7,7282 @@ ;; DECOMP BEGINS +(defbehavior progress-selected progress ((arg0 int)) + (let ((gp-0 33)) + (cond + ((< 4 (the-as int (logand (-> self clock integral-frame-counter) 7))) + (set! (-> *progress-state* color-flash-counter) 1) + ) + ((< (the-as int (logand (-> self clock integral-frame-counter) 7)) 4) + (set! (-> *progress-state* color-flash-counter) 0) + 0 + ) + ) + (cond + ((zero? (-> *progress-state* color-flash-counter)) + (set-font-color gp-0 0 64 128 128) + (set-font-color gp-0 1 64 128 128) + ) + (else + (set-font-color gp-0 0 255 255 255) + (set-font-color gp-0 1 255 255 255) + ) + ) + gp-0 + ) + ) + +(defun draw-percent-bar ((arg0 int) (arg1 int) (arg2 float) (arg3 rgba)) + (let* ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s2-0 base)) + ) + (draw-sprite2d-xy s2-0 arg0 arg1 255 14 (new 'static 'rgba :a (-> arg3 a))) + (draw-sprite2d-xy s2-0 arg0 (+ arg1 2) (the int (* 255.0 arg2)) 10 arg3) + (let ((a3-3 (-> s2-0 base))) + (let ((v1-8 (the-as object (-> s2-0 base)))) + (set! (-> (the-as dma-packet v1-8) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-8) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-8) vif1) (new 'static 'vif-tag)) + (set! (-> s2-0 base) (&+ (the-as pointer v1-8) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + gp-0 + (the-as (pointer dma-tag) a3-3) + ) + ) + ) + 0 + (none) + ) + +(defun draw-highlight ((arg0 int) (arg1 int) (arg2 float)) + (let* ((s3-0 (if (= (get-aspect-ratio) 'aspect4x3) + 70 + 79 + ) + ) + (a3-0 (if (= (get-aspect-ratio) 'aspect4x3) + 374 + 355 + ) + ) + (s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-2 (-> s2-0 base)) + ) + (draw-sprite2d-xy + s2-0 + s3-0 + arg0 + a3-0 + arg1 + (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a (the int (* 64.0 arg2))) + ) + (let ((a3-1 (-> s2-0 base))) + (let ((v1-6 (the-as object (-> s2-0 base)))) + (set! (-> (the-as dma-packet v1-6) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-6) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-6) vif1) (new 'static 'vif-tag)) + (set! (-> s2-0 base) (&+ (the-as pointer v1-6) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + gp-2 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + +(defbehavior draw-busy-loading progress ((arg0 font-context)) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg0 origin x) 82.0) + (set! (-> arg0 origin y) 180.0) + (set! (-> arg0 width) 359.0) + (set! (-> arg0 height) 40.0) + ) + (('aspect16x9) + (set! (-> arg0 origin x) 82.0) + (set! (-> arg0 origin y) 180.0) + (set! (-> arg0 width) 355.0) + (set! (-> arg0 height) 40.0) + ) + ) + (let ((v1-12 arg0)) + (set! (-> v1-12 scale) 0.6) + ) + (let ((a0-5 arg0)) + (set! (-> a0-5 flags) (font-flags kerning middle large)) + ) + (if (< (mod (-> self clock frame-counter) 300) 210) + (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-loading-data) #f) arg0 #f 44 320) + ) + ) + +(defun draw-previous-next ((arg0 menu-highscores-option) (arg1 font-context) (arg2 symbol)) + (local-vars (sv-16 string) (sv-32 int)) + (let ((s3-0 370)) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg1 origin x) 73.0) + (set! (-> arg1 origin y) 308.0) + (set! (-> arg1 width) 359.0) + (set! (-> arg1 height) 185.0) + ) + (('aspect16x9) + (set! (-> arg1 origin x) 82.0) + (set! (-> arg1 origin y) 328.0) + (set! (-> arg1 width) 355.0) + (set! (-> arg1 height) 185.0) + (set! s3-0 350) + ) + ) + (let ((a0-1 arg1)) + (set! (-> a0-1 flags) (font-flags kerning large)) + ) + (let ((s2-0 arg1)) + (set! (-> s2-0 color) (the-as font-color (progress-selected 200))) + ) + (let ((v1-15 arg1)) + (set! (-> v1-15 scale) 0.6) + ) + (when (or (> (-> arg0 page-index) 0) arg2) + (let ((s2-1 print-game-text)) + (let ((s1-0 format) + (s0-0 (clear *temp-string*)) + ) + (set! sv-16 "~C~S") + (set! sv-32 163) + (let ((a3-0 (lookup-text! *common-text* (game-text-id progress-next) #f))) + (s1-0 s0-0 sv-16 sv-32 a3-0) + ) + ) + (s2-1 *temp-string* arg1 #f 44 320) + ) + ) + (set! arg2 (or (!= (-> arg0 page-index) (+ (-> arg0 num-pages) -1)) arg2)) + (when arg2 + (let ((a0-12 arg1)) + (set! (-> a0-12 flags) (font-flags kerning right large)) + ) + (+! (-> arg1 origin x) (the float s3-0)) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~S~C" (lookup-text! *common-text* (game-text-id progress-next) #f) 161) + (s5-1 *temp-string* arg1 #f 44 320) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun draw-up-down ((arg0 font-context)) + (let ((s3-0 250) + (s5-0 155) + (s4-0 155) + (f30-0 (-> arg0 origin x)) + (f28-0 (-> arg0 origin y)) + ) + (case (get-aspect-ratio) + (('aspect16x9) + (set! s5-0 170) + ) + ) + (set! (-> arg0 origin x) (the float s3-0)) + (set! (-> arg0 origin y) (the float s5-0)) + (let ((s2-0 print-game-text)) + (format (clear *temp-string*) "~33L~C" 160) + (s2-0 *temp-string* arg0 #f 44 320) + ) + (set! (-> arg0 origin x) (the float s3-0)) + (set! (-> arg0 origin y) (the float (+ s5-0 s4-0))) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 162) + (s5-1 *temp-string* arg0 #f 44 320) + ) + (set! (-> arg0 origin x) f30-0) + (set! (-> arg0 origin y) f28-0) + ) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun draw-missions-up-down ((arg0 font-context)) + (let ((s3-0 250) + (s5-0 116) + (s4-0 191) + (f30-0 (-> arg0 origin x)) + (f28-0 (-> arg0 origin y)) + ) + (set! (-> arg0 origin x) (the float s3-0)) + (set! (-> arg0 origin y) (the float s5-0)) + (let ((s2-0 print-game-text)) + (format (clear *temp-string*) "~33L~C" 160) + (s2-0 *temp-string* arg0 #f 44 320) + ) + (set! (-> arg0 origin x) (the float s3-0)) + (set! (-> arg0 origin y) (the float (+ s5-0 s4-0))) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 162) + (s5-1 *temp-string* arg0 #f 44 320) + ) + (set! (-> arg0 origin x) f30-0) + (set! (-> arg0 origin y) f28-0) + ) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun draw-scene-up-down ((arg0 font-context)) + (let ((s3-0 250) + (s5-0 102) + (s4-0 194) + (f30-0 (-> arg0 origin x)) + (f28-0 (-> arg0 origin y)) + ) + (case (get-aspect-ratio) + (('aspect16x9) + (set! s5-0 92) + (set! s4-0 204) + ) + ) + (set! (-> arg0 origin x) (the float s3-0)) + (set! (-> arg0 origin y) (the float s5-0)) + (let ((s2-0 print-game-text)) + (format (clear *temp-string*) "~33L~C" 160) + (s2-0 *temp-string* arg0 #f 44 320) + ) + (set! (-> arg0 origin x) (the float s3-0)) + (set! (-> arg0 origin y) (the float (+ s5-0 s4-0))) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 162) + (s5-1 *temp-string* arg0 #f 44 320) + ) + (set! (-> arg0 origin x) f30-0) + (set! (-> arg0 origin y) f28-0) + ) + (none) + ) + +(defun begin-scissor ((arg0 hud-box) (arg1 progress)) + (cond + ((or (= (-> arg1 current) 'bigmap) (= (-> arg1 next) 'bigmap)) + (set! (-> arg0 min x) 0.0) + (set! (-> arg0 min y) 0.0) + (set! (-> arg0 max x) 512.0) + (set! (-> arg0 max y) 416.0) + ) + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 79.0) + (set! (-> arg0 min y) 38.0) + (set! (-> arg0 max x) 434.0) + (set! (-> arg0 max y) 362.0) + ) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 70.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 329.0) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-1 (-> s4-0 base)) + ) + (hud-box-method-14 arg0) + (let ((a3-0 (-> s4-0 base))) + (let ((v1-23 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-23) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-23) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-23) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-23) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s5-1 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +(defun end-scissor ((arg0 hud-box) (arg1 float)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-15 arg0) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-7 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-7) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet 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) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +(defun begin-scissor-secret ((arg0 hud-box) (arg1 progress)) + (cond + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 79.0) + (set! (-> arg0 min y) 190.0) + (set! (-> arg0 max x) 434.0) + (set! (-> arg0 max y) 315.0) + ) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 173.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 304.0) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-1 (-> s4-0 base)) + ) + (hud-box-method-14 arg0) + (let ((a3-0 (-> s4-0 base))) + (let ((v1-17 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-17) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-17) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-17) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s5-1 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +(defun end-scissor-secret ((arg0 hud-box) (arg1 float)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-15 arg0) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-7 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-7) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet 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) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +(defun begin-scissor-missions ((arg0 hud-box) (arg1 float)) + (cond + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 79.0) + (set! (-> arg0 min y) 130.0) + (set! (-> arg0 max x) 434.0) + (set! (-> arg0 max y) 305.0) + ) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 130.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 305.0) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-1 (-> s4-0 base)) + ) + (hud-box-method-14 arg0) + (let ((a3-0 (-> s4-0 base))) + (let ((v1-17 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-17) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-17) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-17) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s5-1 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +(defun end-scissor-missions ((arg0 hud-box) (arg1 float)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-15 arg0) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-7 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-7) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet 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) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +(defun begin-scissor-scene ((arg0 hud-box)) + (cond + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 79.0) + (set! (-> arg0 min y) 118.0) + (set! (-> arg0 max x) 434.0) + (set! (-> arg0 max y) 294.0) + ) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 116.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 295.0) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-1 (-> s4-0 base)) + ) + (hud-box-method-14 arg0) + (let ((a3-0 (-> s4-0 base))) + (let ((v1-17 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-17) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-17) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-17) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s5-1 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +(defun end-scissor-scene ((arg0 hud-box) (arg1 float)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-15 arg0) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-7 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-7) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet 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) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +(defun begin-scissor-level ((arg0 hud-box)) + (cond + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 79.0) + (set! (-> arg0 min y) 118.0) + (set! (-> arg0 max x) 434.0) + (set! (-> arg0 max y) 294.0) + ) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 116.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 295.0) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-1 (-> s4-0 base)) + ) + (hud-box-method-14 arg0) + (let ((a3-0 (-> s4-0 base))) + (let ((v1-17 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-17) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-17) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-17) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s5-1 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +(defun end-scissor-level ((arg0 hud-box) (arg1 float)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-15 arg0) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-7 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-7) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet 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) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +(defun print-language-name ((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))))) + (set! (-> arg1 alpha) f30-0) + (print-game-text-scaled (lookup-text! *common-text* (-> *language-name-remap* arg0) #f) f30-0 arg1 320) + ) + (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float s5-0))) + ) + (set! (-> arg1 color) (font-color #7efbfb)) + 0 + (none) + ) + +(defun unlocked-secret-menu? ((arg0 game-secrets)) + (or (logtest? arg0 (game-secrets scene-player-1)) + (logtest? arg0 (game-secrets scene-player-2)) + (logtest? arg0 (game-secrets scene-player-3)) + (logtest? arg0 (game-secrets level-select)) + (logtest? arg0 (game-secrets scrap-book-1)) + (logtest? arg0 (game-secrets scrap-book-2)) + (logtest? arg0 (game-secrets scrap-book-3)) + (logtest? arg0 (game-secrets hero-mode)) + ) + ) + +;; WARN: Return type mismatch int vs game-secrets. +(defun memcard-unlocked-secrets? ((arg0 symbol)) + (let ((v1-0 *progress-save-info*) + (s5-0 0) + ) + (let ((a0-1 4)) + (when (and v1-0 (= (-> v1-0 formatted) 1) (= (-> v1-0 inited) 1)) + (dotimes (a1-5 a0-1) + (set! s5-0 (logior s5-0 (-> v1-0 file a1-5 secrets))) + ) + ) + ) + (if (unlocked-secret-menu? (the-as game-secrets s5-0)) + (set! (-> *progress-state* secrets-unlocked) #t) + (set! (-> *progress-state* secrets-unlocked) #f) + ) + (when *cheat-mode* + (set! (-> *progress-state* secrets-unlocked) #t) + (set! s5-0 (logior s5-0 #x8fe0)) + ) + (the-as game-secrets (cond + (arg0 + (empty) + s5-0 + ) + (else + (the-as int (unlocked-secret-menu? (the-as game-secrets s5-0))) + ) + ) + ) + ) + ) + +(defun num-unlocked-secret? ((arg0 game-secrets)) + "@returns The number of secrets currently unlocked" + (let ((v0-0 0)) + (if (logtest? arg0 (game-secrets scene-player-1)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets scene-player-2)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets scene-player-3)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets level-select)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets scrap-book-1)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets scrap-book-2)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets scrap-book-3)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets hero-mode)) + (+! v0-0 1) + ) + v0-0 + ) + ) + +(defun print-menu-text ((arg0 string) (arg1 float) (arg2 font-context) (arg3 progress)) + (let ((f0-1 (- 1.0 (-> arg3 menu-transition)))) + (let ((v1-1 arg2)) + (set! (-> v1-1 scale) 0.5) + ) + (set! (-> arg2 alpha) f0-1) + ) + (print-game-text arg0 arg2 #f 44 320) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs pointer. +(defun draw-yes-no ((arg0 progress) (arg1 font-context)) + (local-vars (a0-5 string)) + (- 1.0 (-> arg0 menu-transition)) + (cond + ((-> *progress-state* yes-no-choice) + (format + (clear *temp-string*) + "~33L~S~32L ~S" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-5 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~32L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-5 *temp-string*) + ) + ) + (print-game-text a0-5 arg1 #f 44 320) + (the-as pointer 0) + ) + +;; WARN: Return type mismatch int vs pointer. +(defun draw-continue-retry ((arg0 progress) (arg1 font-context)) + (local-vars (a0-5 string)) + (- 1.0 (-> arg0 menu-transition)) + (cond + ((-> *progress-state* yes-no-choice) + (format + (clear *temp-string*) + "~33L~S~32L ~S" + (lookup-text! *common-text* (game-text-id progress-memcard-continue?) #f) + (lookup-text! *common-text* (game-text-id progress-unknown-retry?) #f) + ) + (set! a0-5 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~32L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-memcard-continue?) #f) + (lookup-text! *common-text* (game-text-id progress-unknown-retry?) #f) + ) + (set! a0-5 *temp-string*) + ) + ) + (print-game-text a0-5 arg1 #f 44 320) + (the-as pointer 0) + ) + +(defmethod menu-option-method-10 menu-option ((obj menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-8 string) (sv-16 string)) + (let ((s3-0 (if arg3 + (&-> *progress-state* on-off-choice) + (-> obj value-to-modify) + ) + ) + ) + (set! a0-8 (cond + (arg3 + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #f9f9f9)) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + ((-> s3-0 0) + (format + (clear *temp-string*) + "~33L~S~32L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-8 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~32L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-8 *temp-string*) + ) + ) + a0-8 + ) + (else + (let ((s2-3 format) + (s1-2 (clear *temp-string*)) + (s0-2 "~S: ~S") + ) + (set! sv-16 (lookup-text! *common-text* (-> obj name) #f)) + (let ((a3-4 (if (-> s3-0 0) + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + ) + ) + (s2-3 s1-2 s0-2 sv-16 a3-4) + ) + ) + *temp-string* + ) + ) + ) + ) + (print-menu-text a0-8 (-> obj scale) arg1 arg0) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-8 string)) + (let ((s3-0 (&-> *progress-state* yes-no-choice))) + (set! a0-8 (cond + (arg3 + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #f9f9f9)) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + ((-> s3-0 0) + (format + (clear *temp-string*) + "~33L~S~32L ~S" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-8 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~32L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-8 *temp-string*) + ) + ) + a0-8 + ) + (else + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + *temp-string* + ) + ) + ) + ) + (print-menu-text a0-8 (-> obj scale) arg1 arg0) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-video-mode-option ((obj menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((s3-0 (&-> *progress-state* video-mode-choice)) + (f28-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (f30-0 (-> arg1 origin y)) + ) + (let ((s2-0 (the-as string #f))) + (if (< f28-0 0.0) + (set! f28-0 0.0) + ) + (set! (-> arg1 alpha) f28-0) + (let ((v1-5 arg1)) + (set! (-> v1-5 scale) 0.7) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg1 origin y) (+ 43.0 (-> arg1 origin y))) + ) + (('aspect16x9) + (set! (-> arg1 origin y) (+ 52.0 (-> arg1 origin y))) + ) + ) + (cond + ((and (= (-> *progress-state* graphic-options-item-selected) 3) + (-> *progress-state* graphic-options-item-picked) + ) + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-6 arg1)) + (set! (-> a0-6 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 44 f28-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + (cond + ((= (-> s3-0 0) 'pal) + (format + (clear *temp-string*) + "~33L~S ~35L~S~1L" + (lookup-text! *common-text* (game-text-id progress-refresh-50hz) #f) + (lookup-text! *common-text* (game-text-id progress-refresh-60hz) #f) + ) + (set! s2-0 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S~33L ~S" + (lookup-text! *common-text* (game-text-id progress-refresh-50hz) #f) + (lookup-text! *common-text* (game-text-id progress-refresh-60hz) #f) + ) + (set! s2-0 *temp-string*) + ) + ) + ) + (else + (when (not (and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + ) + (cond + ((= (-> *progress-state* graphic-options-item-selected) 3) + (let ((s2-4 arg1)) + (set! (-> s2-4 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ -9.0 (-> arg1 origin y))) 22 f28-0) + ) + (else + (let ((a0-23 arg1)) + (set! (-> a0-23 color) (font-color #7efbfb)) + ) + ) + ) + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + (cond + ((= (-> s3-0 0) 'pal) + (format + (clear *temp-string*) + "~1L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-refresh-50hz) #f) + (lookup-text! *common-text* (game-text-id progress-refresh-60hz) #f) + ) + (set! s2-0 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~1L~S~1L" + (lookup-text! *common-text* (game-text-id progress-refresh-50hz) #f) + (lookup-text! *common-text* (game-text-id progress-refresh-60hz) #f) + ) + (set! s2-0 *temp-string*) + ) + ) + ) + ) + ) + (if (not (and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + ) + (print-menu-text s2-0 (-> obj scale) arg1 arg0) + ) + ) + (set! (-> arg1 origin y) f30-0) + ) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((s5-0 (memcard-unlocked-secrets? #t)) + (f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + ) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (let ((v1-4 arg1)) + (set! (-> v1-4 scale) 0.6) + ) + (when (nonzero? (-> obj name)) + (cond + ((= arg2 (-> arg0 option-index)) + (progress-selected 0) + (draw-highlight (the int (+ 8.0 (-> arg1 origin y))) 24 f30-0) + ) + (else + 32 + ) + ) + (set! (-> arg1 origin y) (+ 8.0 (-> arg1 origin y))) + (cond + ((= (-> obj name) (game-text-id progress-main-secrets-scrapbook)) + (cond + ((logtest? s5-0 (game-secrets scrap-book-1)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-scrapbook) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-2 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-mega-scrapbook)) + (cond + ((logtest? s5-0 (game-secrets scrap-book-2)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-mega-scrapbook) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-4 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-4 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-scrapbook-3)) + (cond + ((logtest? s5-0 (game-secrets scrap-book-3)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-scrapbook-3) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-6 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-6 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-1)) + (cond + ((logtest? s5-0 (game-secrets scene-player-1)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-sceneplayer-1) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-8 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-8 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-2)) + (cond + ((logtest? s5-0 (game-secrets scene-player-2)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-sceneplayer-2) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-10 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-10 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-3)) + (cond + ((logtest? s5-0 (game-secrets scene-player-3)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-sceneplayer-3) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-12 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-12 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-hero-mode)) + (cond + ((logtest? s5-0 (game-secrets hero-mode)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-hero-mode) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-14 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-14 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-levelselect)) + (cond + ((logtest? s5-0 (game-secrets level-select)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-levelselect) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-16 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-16 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (-> arg1 flags) + (when (and (= (-> arg0 menu-transition) 0.0) (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle)) + (nonzero? (-> obj name)) + (= arg2 (-> arg0 option-index)) + ) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 scale) 0.75) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle large)) + ) + (set! (-> arg1 width) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 235 + 175 + ) + ) + ) + (set! (-> arg1 height) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 80 + 80 + ) + ) + ) + (set! (-> arg1 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 140 + 170 + ) + ) + ) + (set! (-> arg1 origin y) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 180 + 175 + ) + ) + ) + (cond + ((= (-> obj name) (game-text-id progress-root-show-map)) + (when (= (-> *setting-control* user-default language) (language-enum french)) + (let ((v1-18 arg1)) + (set! (-> v1-18 scale) 0.7) + ) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 210 + 200 + ) + ) + ) + (let ((v1-21 arg1)) + (set! (-> v1-21 scale) 0.6) + ) + (let ((v1-23 (-> *bigmap* bigmap-index))) + (cond + ((zero? v1-23) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-locations-pumping-station) #f) + arg1 + #f + 44 + 320 + ) + ) + ((= v1-23 1) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-landing-pad) #f) arg1 #f 44 320) + ) + ((= v1-23 2) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-locations-weapons-factory) #f) + arg1 + #f + 44 + 320 + ) + ) + ((= v1-23 3) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-dig) #f) arg1 #f 44 320) + ) + ((= v1-23 4) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-dig) #f) arg1 #f 44 320) + ) + ((= v1-23 5) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-locations-drill-platform) #f) + arg1 + #f + 44 + 320 + ) + ) + ((= v1-23 6) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-locations-haven-forest) #f) + arg1 + #f + 44 + 320 + ) + ) + ((= v1-23 7) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-fortress) #f) arg1 #f 44 320) + ) + ((= v1-23 8) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-locations-mountain-temple) #f) + arg1 + #f + 44 + 320 + ) + ) + ((= v1-23 9) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-nest) #f) arg1 #f 44 320) + ) + ((= v1-23 11) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-palace-roof) #f) arg1 #f 44 320) + ) + ((= v1-23 12) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-palace) #f) arg1 #f 44 320) + ) + ((= v1-23 13) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-dead-town) #f) arg1 #f 44 320) + ) + ((= v1-23 14) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-sewer) #f) arg1 #f 44 320) + ) + ((= v1-23 15) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-sewer) #f) arg1 #f 44 320) + ) + ((= v1-23 16) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-sewer) #f) arg1 #f 44 320) + ) + ((= v1-23 17) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-strip-mine) #f) arg1 #f 44 320) + ) + ((= v1-23 18) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-mars-tomb) #f) arg1 #f 44 320) + ) + ((= v1-23 19) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-underport) #f) arg1 #f 44 320) + ) + ((= v1-23 20) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-haven-city) #f) arg1 #f 44 320) + ) + ) + ) + ) + (else + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + ) + ) + ) + 0 + (none) + ) + +(defun draw-savegame-box ((arg0 menu-option) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (set! (-> arg0 box 0 min x) arg1) + (set! (-> arg0 box 0 max x) arg2) + (set! (-> arg0 box 0 min y) arg3) + (set! (-> arg0 box 0 max y) arg4) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + ((method-of-type hud-box hud-box-method-9) (the-as hud-box (-> arg0 box)) s5-0) + (let ((a3-1 (-> s5-0 base))) + (let ((v1-7 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-7) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet 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) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + +;; WARN: Return type mismatch uint vs texture-id. +(defun get-level-icon-id-01 ((arg0 int)) + "TODO - Icon id enum perhaps?" + (let ((v0-0 (the-as uint #xc9303600))) + (cond + ((zero? arg0) + (set! v0-0 (the-as uint #xc9304800)) + ) + ((= arg0 1) + (set! v0-0 (the-as uint #xc9304000)) + ) + ((= arg0 2) + (set! v0-0 (the-as uint #xc9307000)) + ) + ((= arg0 3) + (set! v0-0 (the-as uint #xc9305800)) + ) + ((= arg0 4) + (set! v0-0 (the-as uint #xc9306800)) + ) + ((= arg0 5) + (set! v0-0 (the-as uint #xc9307400)) + ) + ((= arg0 6) + (set! v0-0 (the-as uint #xc9303600)) + ) + ((= arg0 7) + (set! v0-0 (the-as uint #xc9306c00)) + ) + ((= arg0 8) + (set! v0-0 (the-as uint #xc9305c00)) + ) + ((= arg0 9) + (set! v0-0 (the-as uint #xc9305400)) + ) + ((= arg0 10) + (set! v0-0 (the-as uint #xc9305000)) + ) + ((= arg0 11) + (set! v0-0 (the-as uint #xc9306400)) + ) + ((= arg0 12) + (set! v0-0 (the-as uint #xc9307800)) + ) + ((= arg0 13) + (set! v0-0 (the-as uint #xc9304c00)) + ) + ((= arg0 14) + (set! v0-0 (the-as uint #xc9303a00)) + ) + ((= arg0 15) + (set! v0-0 (the-as uint #xc9307c00)) + ) + ((= arg0 16) + (set! v0-0 (the-as uint #xc9304400)) + ) + ((= arg0 17) + (set! v0-0 (the-as uint #xc9306000)) + ) + ) + (the-as texture-id v0-0) + ) + ) + +;; WARN: Return type mismatch uint vs texture-id. +(defun get-level-icon-id-02 ((arg0 int)) + "TODO - Icon id enum perhaps?" + (let ((v0-0 (the-as uint #xc9303700))) + (cond + ((zero? arg0) + (set! v0-0 (the-as uint #xc9304900)) + ) + ((= arg0 1) + (set! v0-0 (the-as uint #xc9304100)) + ) + ((= arg0 2) + (set! v0-0 (the-as uint #xc9307100)) + ) + ((= arg0 3) + (set! v0-0 (the-as uint #xc9305900)) + ) + ((= arg0 4) + (set! v0-0 (the-as uint #xc9306900)) + ) + ((= arg0 5) + (set! v0-0 (the-as uint #xc9307500)) + ) + ((= arg0 6) + (set! v0-0 (the-as uint #xc9303700)) + ) + ((= arg0 7) + (set! v0-0 (the-as uint #xc9306d00)) + ) + ((= arg0 8) + (set! v0-0 (the-as uint #xc9305d00)) + ) + ((= arg0 9) + (set! v0-0 (the-as uint #xc9305500)) + ) + ((= arg0 10) + (set! v0-0 (the-as uint #xc9305100)) + ) + ((= arg0 11) + (set! v0-0 (the-as uint #xc9306500)) + ) + ((= arg0 12) + (set! v0-0 (the-as uint #xc9307900)) + ) + ((= arg0 13) + (set! v0-0 (the-as uint #xc9304d00)) + ) + ((= arg0 14) + (set! v0-0 (the-as uint #xc9303b00)) + ) + ((= arg0 15) + (set! v0-0 (the-as uint #xc9307d00)) + ) + ((= arg0 16) + (set! v0-0 (the-as uint #xc9304500)) + ) + ((= arg0 17) + (set! v0-0 (the-as uint #xc9306100)) + ) + ) + (the-as texture-id v0-0) + ) + ) + +;; WARN: Return type mismatch uint vs texture-id. +(defun get-level-icon-id-03 ((arg0 int)) + "TODO - Icon id enum perhaps?" + (let ((v0-0 (the-as uint #xc9303800))) + (cond + ((zero? arg0) + (set! v0-0 (the-as uint #xc9304a00)) + ) + ((= arg0 1) + (set! v0-0 (the-as uint #xc9304200)) + ) + ((= arg0 2) + (set! v0-0 (the-as uint #xc9307200)) + ) + ((= arg0 3) + (set! v0-0 (the-as uint #xc9305a00)) + ) + ((= arg0 4) + (set! v0-0 (the-as uint #xc9306a00)) + ) + ((= arg0 5) + (set! v0-0 (the-as uint #xc9307600)) + ) + ((= arg0 6) + (set! v0-0 (the-as uint #xc9303800)) + ) + ((= arg0 7) + (set! v0-0 (the-as uint #xc9306e00)) + ) + ((= arg0 8) + (set! v0-0 (the-as uint #xc9305e00)) + ) + ((= arg0 9) + (set! v0-0 (the-as uint #xc9305600)) + ) + ((= arg0 10) + (set! v0-0 (the-as uint #xc9305200)) + ) + ((= arg0 11) + (set! v0-0 (the-as uint #xc9306600)) + ) + ((= arg0 12) + (set! v0-0 (the-as uint #xc9307a00)) + ) + ((= arg0 13) + (set! v0-0 (the-as uint #xc9304e00)) + ) + ((= arg0 14) + (set! v0-0 (the-as uint #xc9303c00)) + ) + ((= arg0 15) + (set! v0-0 (the-as uint #xc9307e00)) + ) + ((= arg0 16) + (set! v0-0 (the-as uint #xc9304600)) + ) + ((= arg0 17) + (set! v0-0 (the-as uint #xc9306200)) + ) + ) + (the-as texture-id v0-0) + ) + ) + +;; WARN: Return type mismatch uint vs texture-id. +(defun get-level-icon-id-04 ((arg0 int)) + "TODO - Icon id enum perhaps?" + (let ((v0-0 (the-as uint #xc9303900))) + (cond + ((zero? arg0) + (set! v0-0 (the-as uint #xc9304b00)) + ) + ((= arg0 1) + (set! v0-0 (the-as uint #xc9304300)) + ) + ((= arg0 2) + (set! v0-0 (the-as uint #xc9307300)) + ) + ((= arg0 3) + (set! v0-0 (the-as uint #xc9305b00)) + ) + ((= arg0 4) + (set! v0-0 (the-as uint #xc9306b00)) + ) + ((= arg0 5) + (set! v0-0 (the-as uint #xc9307700)) + ) + ((= arg0 6) + (set! v0-0 (the-as uint #xc9303900)) + ) + ((= arg0 7) + (set! v0-0 (the-as uint #xc9306f00)) + ) + ((= arg0 8) + (set! v0-0 (the-as uint #xc9305f00)) + ) + ((= arg0 9) + (set! v0-0 (the-as uint #xc9305700)) + ) + ((= arg0 10) + (set! v0-0 (the-as uint #xc9305300)) + ) + ((= arg0 11) + (set! v0-0 (the-as uint #xc9306700)) + ) + ((= arg0 12) + (set! v0-0 (the-as uint #xc9307b00)) + ) + ((= arg0 13) + (set! v0-0 (the-as uint #xc9304f00)) + ) + ((= arg0 14) + (set! v0-0 (the-as uint #xc9303d00)) + ) + ((= arg0 15) + (set! v0-0 (the-as uint #xc9307f00)) + ) + ((= arg0 16) + (set! v0-0 (the-as uint #xc9304700)) + ) + ((= arg0 17) + (set! v0-0 (the-as uint #xc9306300)) + ) + ) + (the-as texture-id v0-0) + ) + ) + +(defun draw-decoration ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 int) (arg4 symbol) (arg5 float)) + (local-vars + (sv-16 symbol) + (sv-32 float) + (sv-48 int) + (sv-64 int) + (sv-80 (function string font-context symbol int int float)) + (sv-96 int) + ) + (set! sv-96 arg3) + (set! sv-16 arg4) + (set! sv-32 arg5) + (let ((gp-0 70) + (s5-0 120) + ) + (set! sv-48 87) + (let ((s3-0 375) + (s2-0 210) + ) + (set! sv-64 0) + (cond + ((not sv-16) + (case (get-aspect-ratio) + (('aspect4x3) + (set! gp-0 69) + (set! s5-0 118) + (set! sv-48 80) + (set! s3-0 375) + (set! s2-0 210) + ) + (('aspect16x9) + (set! gp-0 79) + (set! s5-0 118) + (set! sv-48 68) + (set! s3-0 356) + (set! s2-0 244) + ) + ) + ) + (else + (case (get-aspect-ratio) + (('aspect4x3) + (set! gp-0 70) + (set! s5-0 116) + (set! sv-48 78) + (set! s3-0 375) + (set! s2-0 179) + ) + (('aspect16x9) + (set! gp-0 79) + (set! s5-0 108) + (set! sv-48 58) + (set! s3-0 356) + (set! s2-0 185) + (set! sv-64 20) + sv-64 + ) + ) + ) + ) + (let ((v1-20 arg1)) + (set! (-> v1-20 scale) sv-32) + ) + (set! (-> arg1 origin y) (the float sv-48)) + (set! (-> arg1 height) 50.0) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 flags) (font-flags kerning middle large)) + ) + (set! sv-80 print-game-text) + (let* ((a0-3 *common-text*) + (t9-2 (method-of-object a0-3 lookup-text!)) + (a2-1 #f) + (a0-4 (t9-2 a0-3 (the-as game-text-id sv-96) a2-1)) + (a1-2 arg1) + (a2-2 #f) + (a3-1 44) + (t0-1 320) + ) + (sv-80 a0-4 a1-2 a2-2 a3-1 t0-1) + ) + (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 arg2))) + (draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s3-0)) (the float s5-0) (the float s5-0)) + (when sv-16 + (+! (-> arg1 origin y) (the float sv-64)) + (draw-savegame-box + arg0 + (the float gp-0) + (the float (+ gp-0 s3-0)) + (the float (+ s5-0 s2-0)) + (the float (+ s5-0 s2-0)) + ) + ) + (let* ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s1-1 (-> s0-1 base)) + ) + (draw-sprite2d-xy + s0-1 + gp-0 + s5-0 + s3-0 + s2-0 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 arg2))) + ) + (let ((a3-5 (-> s0-1 base))) + (let ((v1-41 (the-as object (-> s0-1 base)))) + (set! (-> (the-as dma-packet v1-41) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-41) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-41) vif1) (new 'static 'vif-tag)) + (set! (-> s0-1 base) (&+ (the-as pointer v1-41) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s1-1 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + +(defun draw-missions-decoration ((arg0 menu-missions-option) (arg1 font-context) (arg2 float) (arg3 game-text-id)) + (local-vars (sv-16 int) (sv-32 (function string font-context symbol int int float)) (sv-48 font-context)) + (set! sv-48 arg1) + (let ((s2-0 arg2) + (s0-0 arg3) + (gp-0 70) + (s5-0 120) + ) + (set! sv-16 87) + (let ((s4-0 375) + (s3-0 210) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (set! gp-0 70) + (set! s5-0 130) + (set! sv-16 85) + (set! s4-0 375) + (set! s3-0 175) + ) + (('aspect16x9) + (set! gp-0 79) + (set! s5-0 130) + (set! sv-16 68) + (set! s4-0 356) + (set! s3-0 175) + ) + ) + (let ((v1-9 sv-48)) + (set! (-> v1-9 scale) 0.95) + ) + (set! (-> sv-48 height) 50.0) + (set! (-> sv-48 origin y) (the float sv-16)) + (let ((a0-2 sv-48)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (set! sv-32 print-game-text) + (let ((a0-4 (lookup-text! *common-text* s0-0 #f)) + (a2-2 #f) + (a3-1 44) + (t0-0 320) + ) + (sv-32 a0-4 sv-48 a2-2 a3-1 t0-0) + ) + (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 s2-0))) + (draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s4-0)) (the float s5-0) (the float s5-0)) + (draw-savegame-box + arg0 + (the float gp-0) + (the float (+ gp-0 s4-0)) + (the float (+ s5-0 s3-0)) + (the float (+ s5-0 s3-0)) + ) + (let* ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s1-1 (-> s0-1 base)) + ) + (draw-sprite2d-xy + s0-1 + gp-0 + s5-0 + s4-0 + s3-0 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 s2-0))) + ) + (let ((a3-5 (-> s0-1 base))) + (let ((v1-28 (the-as object (-> s0-1 base)))) + (set! (-> (the-as dma-packet v1-28) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-28) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-28) vif1) (new 'static 'vif-tag)) + (set! (-> s0-1 base) (&+ (the-as pointer v1-28) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s1-1 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + +(defun draw-sound-options-decoration ((arg0 menu-slider-option) (arg1 font-context) (arg2 float) (arg3 symbol) (arg4 game-text-id)) + (local-vars + (sv-16 font-context) + (sv-32 int) + (sv-48 (function string font-context symbol int int float)) + (sv-64 symbol) + ) + (set! sv-16 arg1) + (let ((s2-0 arg2)) + (set! sv-64 arg3) + (let ((s0-0 arg4) + (gp-0 70) + (s5-0 120) + ) + (set! sv-32 87) + (let ((s4-0 375) + (s3-0 210) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (set! gp-0 70) + (set! s5-0 120) + (set! sv-32 83) + (set! s4-0 375) + (set! s3-0 208) + ) + (('aspect16x9) + (set! gp-0 79) + (set! s5-0 118) + (set! sv-32 68) + (set! s4-0 356) + (set! s3-0 244) + ) + ) + (let ((v1-9 sv-16)) + (set! (-> v1-9 scale) 0.95) + ) + (set! (-> sv-16 origin y) (the float sv-32)) + (set! (-> sv-16 height) 50.0) + (let ((a0-2 sv-16)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (set! (-> sv-16 origin x) 80.0) + (let ((a0-3 sv-16)) + (set! (-> a0-3 flags) (font-flags kerning middle large)) + ) + (set! sv-48 print-game-text) + (let* ((a0-4 *common-text*) + (t9-1 (method-of-object a0-4 lookup-text!)) + (a2-1 #f) + (a0-5 (t9-1 a0-4 (the-as game-text-id sv-64) a2-1)) + (a1-2 sv-16) + (a2-2 #f) + (a3-1 44) + (t0-1 320) + ) + (sv-48 a0-5 a1-2 a2-2 a3-1 t0-1) + ) + (set! (-> sv-16 origin x) (the float (+ gp-0 65))) + (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 s2-0))) + (draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s4-0)) (the float s5-0) (the float s5-0)) + (if s0-0 + (draw-savegame-box + arg0 + (the float gp-0) + (the float (+ gp-0 s4-0)) + (the float (+ s5-0 s3-0)) + (the float (+ s5-0 s3-0)) + ) + ) + (let* ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s1-1 (-> s0-1 base)) + ) + (draw-sprite2d-xy + s0-1 + gp-0 + s5-0 + s4-0 + s3-0 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 s2-0))) + ) + (let ((a3-5 (-> s0-1 base))) + (let ((v1-34 (the-as object (-> s0-1 base)))) + (set! (-> (the-as dma-packet v1-34) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-34) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-34) vif1) (new 'static 'vif-tag)) + (set! (-> s0-1 base) (&+ (the-as pointer v1-34) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s1-1 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + ) + +(defun draw-decoration-secrets ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 game-text-id)) + (local-vars (sv-16 int) (sv-32 (function string font-context symbol int int float)) (sv-48 font-context)) + (set! sv-48 arg1) + (let ((s2-0 arg2) + (s0-0 arg3) + (gp-0 70) + (s5-0 110) + ) + 120 + (set! sv-16 87) + (let ((s4-0 375) + (s3-0 210) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (set! gp-0 69) + (set! s5-0 172) + (set! sv-16 87) + (set! s4-0 375) + (set! s3-0 132) + ) + (('aspect16x9) + (set! gp-0 79) + (set! s5-0 188) + 188 + (set! sv-16 68) + (set! s4-0 356) + (set! s3-0 128) + ) + ) + (let ((v1-11 sv-48)) + (set! (-> v1-11 scale) 0.95) + ) + (set! (-> sv-48 origin y) (the float sv-16)) + (set! (-> sv-48 height) 50.0) + (let ((a0-2 sv-48)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (set! sv-32 print-game-text) + (let ((a0-4 (lookup-text! *common-text* s0-0 #f)) + (a2-2 #f) + (a3-1 44) + (t0-0 320) + ) + (sv-32 a0-4 sv-48 a2-2 a3-1 t0-0) + ) + (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 s2-0))) + (draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s4-0)) (the float s5-0) (the float s5-0)) + (draw-savegame-box + arg0 + (the float gp-0) + (the float (+ gp-0 s4-0)) + (the float (+ s5-0 s3-0)) + (the float (+ s5-0 s3-0)) + ) + (let* ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s1-1 (-> s0-1 base)) + ) + (draw-sprite2d-xy + s0-1 + gp-0 + s5-0 + s4-0 + s3-0 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 s2-0))) + ) + (let ((a3-5 (-> s0-1 base))) + (let ((v1-30 (the-as object (-> s0-1 base)))) + (set! (-> (the-as dma-packet v1-30) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-30) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-30) vif1) (new 'static 'vif-tag)) + (set! (-> s0-1 base) (&+ (the-as pointer v1-30) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s1-1 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + +(defun draw-decoration-load-save ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 int)) + (local-vars + (sv-16 int) + (sv-32 int) + (sv-48 (function string font-context symbol int int float)) + (sv-64 int) + (sv-80 font-context) + ) + (set! sv-80 arg1) + (let ((s4-0 arg2)) + (set! sv-64 arg3) + (let ((s0-0 70) + (gp-0 120) + (s5-0 120) + ) + 120 + (set! sv-16 87) + (set! sv-32 375) + (let ((s3-0 200) + (s2-0 210) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (set! s0-0 69) + (set! gp-0 245) + (set! s5-0 110) + (set! sv-16 80) + (set! sv-32 375) + (set! s3-0 200) + (set! s2-0 218) + ) + (('aspect16x9) + (set! s0-0 79) + (set! gp-0 245) + (set! s5-0 110) + (set! sv-16 80) + (set! sv-32 355) + (set! s3-0 190) + (set! s2-0 248) + ) + ) + (let ((v1-13 sv-80)) + (set! (-> v1-13 scale) 0.65) + ) + (when (or (= (-> *setting-control* user-default language) (language-enum french)) + (= (-> *setting-control* user-default language) (language-enum spanish)) + (= (-> *setting-control* user-default language) (language-enum italian)) + ) + (let ((v1-24 sv-80)) + (set! (-> v1-24 scale) 0.5) + ) + ) + (set! (-> sv-80 origin y) (the float sv-16)) + (set! (-> sv-80 origin x) (the float s0-0)) + (let ((a0-6 sv-80)) + (set! (-> a0-6 flags) (font-flags kerning middle large)) + ) + (let ((a0-7 sv-80)) + (set! (-> a0-7 color) (font-color #7efbfb)) + ) + (set! sv-48 print-game-text) + (let* ((a0-8 *common-text*) + (t9-1 (method-of-object a0-8 lookup-text!)) + (a2-1 #f) + (a0-9 (t9-1 a0-8 (the-as game-text-id sv-64) a2-1)) + (a2-2 #f) + (a3-1 44) + (t0-0 320) + ) + (sv-48 a0-9 sv-80 a2-2 a3-1 t0-0) + ) + (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 s4-0))) + (draw-savegame-box arg0 (the float s0-0) (the float (+ s0-0 sv-32)) (the float s5-0) (the float s5-0)) + (draw-savegame-box + arg0 + (the float (+ s0-0 sv-32)) + (the float (+ s0-0 sv-32)) + (the float s5-0) + (the float s5-0) + ) + (let* ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s1-1 (-> s0-1 base)) + ) + (draw-sprite2d-xy + s0-1 + gp-0 + s5-0 + s3-0 + s2-0 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 s4-0))) + ) + (let ((a3-5 (-> s0-1 base))) + (let ((v1-45 (the-as object (-> s0-1 base)))) + (set! (-> (the-as dma-packet v1-45) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-45) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-45) vif1) (new 'static 'vif-tag)) + (set! (-> s0-1 base) (&+ (the-as pointer v1-45) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s1-1 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + ) + +(defmethod menu-option-method-10 menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (v0-74 pointer) + (sv-16 float) + (sv-20 int) + (sv-24 float) + (sv-28 float) + (sv-32 float) + (sv-36 float) + (sv-40 int) + (sv-48 int) + (sv-56 int) + (sv-64 int) + (sv-72 int) + (sv-80 int) + (sv-88 int) + (sv-96 string) + (sv-112 int) + ) + (set! sv-16 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (set! sv-20 (-> arg0 option-index)) + (set! sv-24 (-> arg1 origin x)) + (set! sv-28 (-> arg1 origin y)) + (set! sv-32 (-> arg1 width)) + (set! sv-36 (-> arg1 height)) + (set! sv-40 (if (= (get-aspect-ratio) 'aspect4x3) + 300 + 305 + ) + ) + (set! sv-48 (if (= (get-aspect-ratio) 'aspect4x3) + 140 + 140 + ) + ) + (set! sv-56 (if (= (get-aspect-ratio) 'aspect4x3) + 64 + 48 + ) + ) + (set! sv-64 69) + (set! sv-72 110) + (set! sv-80 176) + (set! sv-88 54) + (if (< sv-16 0.0) + (set! sv-16 (the-as float 0.0)) + ) + (set! (-> arg1 alpha) sv-16) + (set! v0-74 + (cond + ((not (-> *bigmap* progress-minimap)) + (draw-busy-loading arg1) + v0-74 + ) + (else + (let ((s2-3 arg1)) + (set! (-> s2-3 color) (if (= arg2 sv-20) + (the-as font-color (progress-selected 0)) + (font-color #7efbfb) + ) + ) + ) + (cond + ((= *save-options-title* (-> arg0 current-options)) + (set! (-> arg1 origin y) 80.0) + (set! (-> arg1 height) 52.0) + (+! (-> arg1 origin y) (the float (* 42 (+ arg2 1)))) + (set! (-> arg1 origin x) (+ -100.0 (-> arg1 origin x))) + ) + (else + (case (get-aspect-ratio) + (('aspect16x9) + (set! (-> arg1 origin y) 74.0) + (set! (-> arg1 height) 42.0) + (+! (-> arg1 origin y) (the float (* 60 (+ arg2 1)))) + (set! (-> arg1 origin x) (+ -90.0 (-> arg1 origin x))) + ) + (('aspect4x3) + (set! (-> arg1 origin y) 74.0) + (set! (-> arg1 height) 42.0) + (+! (-> arg1 origin y) (the float (* 54 (+ arg2 1)))) + (set! (-> arg1 origin x) (+ -90.0 (-> arg1 origin x))) + ) + ) + ) + ) + (set-vector! (-> obj box 0 color) 64 128 128 (the int (* 128.0 sv-16))) + (when (= arg2 sv-20) + (cond + ((!= *save-options-title* (-> arg0 current-options)) + (case (get-aspect-ratio) + (('aspect16x9) + (set! sv-64 79) + (set! sv-72 110) + (set! sv-80 166) + (set! sv-88 62) + ) + ) + (draw-savegame-box + obj + (the float sv-64) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 (* sv-88 arg2))) + (the float (+ sv-72 (* sv-88 arg2))) + ) + (when (!= arg2 3) + (draw-savegame-box + obj + (the float sv-64) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + ) + (draw-savegame-box + obj + (the float (+ sv-64 sv-80)) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + (the float (+ (* sv-88 4) 2 sv-72)) + ) + ) + (draw-savegame-box + obj + (the float (+ sv-64 sv-80)) + (the float (+ sv-64 sv-80)) + (the float sv-72) + (the float (+ sv-72 (* sv-88 arg2))) + ) + (let* ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-4 (-> s1-0 base)) + ) + (draw-sprite2d-xy + s1-0 + sv-64 + (+ sv-72 (* sv-88 arg2)) + sv-80 + sv-88 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 sv-16))) + ) + (let ((a3-14 (-> s1-0 base))) + (let ((v1-95 (the-as object (-> s1-0 base)))) + (set! (-> (the-as dma-packet v1-95) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-95) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-95) vif1) (new 'static 'vif-tag)) + (set! (-> s1-0 base) (&+ (the-as pointer v1-95) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s2-4 + (the-as (pointer dma-tag) a3-14) + ) + ) + ) + ) + ((= *save-options-title* (-> arg0 current-options)) + (set! sv-88 42) + (let ((v0-13 (get-aspect-ratio))) + (when (= v0-13 'aspect16x9) + (set! sv-64 79) + (set! sv-72 110) + (set! sv-80 166) + (set! sv-88 42) + (draw-savegame-box + obj + (the float (+ sv-64 sv-80)) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + (the float (+ sv-72 (* 6 sv-88))) + ) + ) + ) + (draw-savegame-box + obj + (the float sv-64) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 (* sv-88 arg2))) + (the float (+ sv-72 (* sv-88 arg2))) + ) + (when (!= arg2 4) + (draw-savegame-box + obj + (the float sv-64) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + ) + (draw-savegame-box + obj + (the float (+ sv-64 sv-80)) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + (the float (+ (* 5 sv-88) 2 sv-72)) + ) + ) + (draw-savegame-box + obj + (the float (+ sv-64 sv-80)) + (the float (+ sv-64 sv-80)) + (the float sv-72) + (the float (+ sv-72 (* sv-88 arg2))) + ) + (let* ((s1-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-5 (-> s1-1 base)) + ) + (draw-sprite2d-xy + s1-1 + sv-64 + (+ sv-72 (* sv-88 arg2)) + sv-80 + sv-88 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 sv-16))) + ) + (let ((a3-32 (-> s1-1 base))) + (let ((v1-164 (the-as object (-> s1-1 base)))) + (set! (-> (the-as dma-packet v1-164) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-164) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-164) vif1) (new 'static 'vif-tag)) + (set! (-> s1-1 base) (&+ (the-as pointer v1-164) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s2-5 + (the-as (pointer dma-tag) a3-32) + ) + ) + ) + ) + ) + ) + (cond + ((and *progress-save-info* + (= (-> *progress-save-info* formatted) 1) + (= (-> *progress-save-info* inited) 1) + (= (-> *progress-save-info* file arg2 present) 1) + ) + (cond + ((= arg2 sv-20) + (let ((v1-185 arg1)) + (set! (-> v1-185 scale) 0.8) + ) + ) + (else + (let ((v1-186 arg1)) + (set! (-> v1-186 scale) 0.6) + ) + ) + ) + (let ((a0-40 arg1)) + (set! (-> a0-40 flags) (font-flags kerning large)) + ) + (+! (-> arg1 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 100 + 105 + ) + ) + ) + (let ((s2-7 print-game-text)) + (let ((s1-2 format) + (s0-0 (clear *temp-string*)) + ) + (set! sv-96 "~S ~D") + (let ((a2-28 (lookup-text! *common-text* (game-text-id progress-unknown-game) #f)) + (a3-33 (+ arg2 1)) + ) + (s1-2 s0-0 sv-96 a2-28 a3-33) + ) + ) + (s2-7 *temp-string* arg1 #f 44 320) + ) + (let ((a0-45 arg1)) + (set! (-> a0-45 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin x) 250.0) + (set! (-> arg1 origin y) 110.0) + (set! (-> arg1 width) 170.0) + (set! (-> arg1 height) 190.0) + (let ((s2-8 (-> *progress-save-info* file arg2 level-index))) + (when (= arg2 sv-20) + (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 sv-16))) + (set-vector! (-> obj sprites 1 color) 128 128 128 (the int (* 128.0 sv-16))) + (set! (-> obj sprites 1 pos z) #xffffff) + (set! (-> obj sprites 1 pos w) 1) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (get-level-icon-id-01 (the-as int s2-8)))) + (set! (-> obj sprites 1 scale-x) 1.0) + (set! (-> obj sprites 1 scale-y) 1.0) + (set-hud-piece-position! (-> obj sprites 1) sv-40 sv-48) + (set-vector! (-> obj sprites 2 color) 128 128 128 (the int (* 128.0 sv-16))) + (set! (-> obj sprites 2 pos z) #xffffff) + (set! (-> obj sprites 2 pos w) 1) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (get-level-icon-id-02 (the-as int s2-8)))) + (set! (-> obj sprites 2 scale-x) 1.0) + (set! (-> obj sprites 2 scale-y) 1.0) + (set-hud-piece-position! (-> obj sprites 2) (+ sv-40 sv-56) sv-48) + (set-vector! (-> obj sprites 3 color) 128 128 128 (the int (* 128.0 sv-16))) + (set! (-> obj sprites 3 pos z) #xffffff) + (set! (-> obj sprites 3 pos w) 1) + (set! (-> obj sprites 3 tex) (lookup-texture-by-id (get-level-icon-id-03 (the-as int s2-8)))) + (set! (-> obj sprites 3 scale-x) 1.0) + (set! (-> obj sprites 3 scale-y) 1.0) + (set-hud-piece-position! (-> obj sprites 3) sv-40 (+ sv-48 64)) + (set-vector! (-> obj sprites 4 color) 128 128 128 (the int (* 128.0 sv-16))) + (set! (-> obj sprites 4 pos z) #xffffff) + (set! (-> obj sprites 4 pos w) 1) + (set! (-> obj sprites 4 tex) (lookup-texture-by-id (get-level-icon-id-04 (the-as int s2-8)))) + (set! (-> obj sprites 4 scale-x) 1.0) + (set! (-> obj sprites 4 scale-y) 1.0) + (set-hud-piece-position! (-> obj sprites 4) (+ sv-40 sv-56) (+ sv-48 64)) + (let* ((s1-7 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-9 (-> s1-7 base)) + ) + (hud-sprite-method-9 (-> obj sprites 1) s1-7 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 2) s1-7 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 3) s1-7 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 4) s1-7 (-> *level* default-level)) + (let ((a3-35 (-> s1-7 base))) + (let ((v1-237 (the-as object (-> s1-7 base)))) + (set! (-> (the-as dma-packet v1-237) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-237) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-237) vif1) (new 'static 'vif-tag)) + (set! (-> s1-7 base) (&+ (the-as pointer v1-237) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s2-9 + (the-as (pointer dma-tag) a3-35) + ) + ) + ) + (let ((v1-245 arg1)) + (set! (-> v1-245 scale) 0.6) + ) + (set! (-> arg1 origin x) 265.0) + (set! (-> arg1 origin y) 263.0) + (set! (-> arg1 width) 170.0) + (set! (-> arg1 height) 52.0) + (set! (-> obj sprites 0 scale-x) 0.7) + (set! (-> obj sprites 0 scale-y) 0.7) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 265 263) + (let* ((s1-8 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-10 (-> s1-8 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + s1-8 + (-> *level* default-level) + ) + (let ((a3-36 (-> s1-8 base))) + (let ((v1-260 (the-as object (-> s1-8 base)))) + (set! (-> (the-as dma-packet v1-260) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-260) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-260) vif1) (new 'static 'vif-tag)) + (set! (-> s1-8 base) (&+ (the-as pointer v1-260) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s2-10 + (the-as (pointer dma-tag) a3-36) + ) + ) + ) + (set! (-> arg1 origin y) (+ 1.0 (-> arg1 origin y))) + (set! (-> arg1 origin x) (+ 28.0 (-> arg1 origin x))) + (let* ((v1-272 (-> *progress-save-info* file arg2 game-time0)) + (v1-273 (logior (shl (the-as int (-> *progress-save-info* file arg2 game-time1)) 32) v1-272)) + (s2-11 (/ (the-as int v1-273) #x107ac0)) + ) + (set! sv-112 (/ (mod (the-as int v1-273) #x107ac0) #x4650)) + (let ((s1-9 print-game-text)) + (format (clear *temp-string*) "~2,'0D:~2,'0D" s2-11 sv-112) + (s1-9 *temp-string* arg1 #f 44 320) + ) + ) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 368 263) + (let* ((s1-10 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-12 (-> s1-10 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + s1-10 + (-> *level* default-level) + ) + (let ((a3-39 (-> s1-10 base))) + (let ((v1-285 (the-as object (-> s1-10 base)))) + (set! (-> (the-as dma-packet v1-285) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-285) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-285) vif1) (new 'static 'vif-tag)) + (set! (-> s1-10 base) (&+ (the-as pointer v1-285) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s2-12 + (the-as (pointer dma-tag) a3-39) + ) + ) + ) + (set! (-> arg1 origin x) (+ 100.0 (-> arg1 origin x))) + (let ((s2-13 print-game-text)) + (format (clear *temp-string*) "~D%" (the int (-> *progress-save-info* file arg2 completion-percentage))) + (s2-13 *temp-string* arg1 #f 44 320) + ) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 368 289) + (let* ((s1-12 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-14 (-> s1-12 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + s1-12 + (-> *level* default-level) + ) + (let ((a3-41 (-> s1-12 base))) + (let ((v1-304 (the-as object (-> s1-12 base)))) + (set! (-> (the-as dma-packet v1-304) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-304) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-304) vif1) (new 'static 'vif-tag)) + (set! (-> s1-12 base) (&+ (the-as pointer v1-304) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s2-14 + (the-as (pointer dma-tag) a3-41) + ) + ) + ) + (set! (-> arg1 origin y) (+ 28.0 (-> arg1 origin y))) + (let ((s2-15 print-game-text)) + (format (clear *temp-string*) "~D" (the int (-> *progress-save-info* file arg2 skill-count))) + (s2-15 *temp-string* arg1 #f 44 320) + ) + (set! (-> obj sprites 0 scale-x) 0.6) + (set! (-> obj sprites 0 scale-y) 0.6) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x82 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 253 290) + (let* ((s1-14 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-16 (-> s1-14 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + s1-14 + (-> *level* default-level) + ) + (let ((a3-43 (-> s1-14 base))) + (let ((v1-325 (the-as object (-> s1-14 base)))) + (set! (-> (the-as dma-packet v1-325) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-325) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-325) vif1) (new 'static 'vif-tag)) + (set! (-> s1-14 base) (&+ (the-as pointer v1-325) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s2-16 + (the-as (pointer dma-tag) a3-43) + ) + ) + ) + (set! (-> arg1 origin x) (+ -100.0 (-> arg1 origin x))) + (let ((s2-17 print-game-text)) + (format (clear *temp-string*) "~D" (the int (-> *progress-save-info* file arg2 gem-count))) + (s2-17 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((and *progress-save-info* + (= (-> *progress-save-info* formatted) 1) + (= (-> *progress-save-info* inited) 1) + (zero? (-> *progress-save-info* file arg2 present)) + ) + (cond + ((= arg2 sv-20) + (let ((v1-348 arg1)) + (set! (-> v1-348 scale) 0.8) + ) + ) + (else + (let ((v1-349 arg1)) + (set! (-> v1-349 scale) 0.6) + ) + ) + ) + (let ((a0-150 arg1)) + (set! (-> a0-150 flags) (font-flags kerning large)) + ) + (+! (-> arg1 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 100 + 105 + ) + ) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-slot-empty) #f) arg1 #f 44 320) + ) + ) + (set! (-> arg1 origin x) sv-24) + (set! (-> arg1 origin y) sv-28) + (set! (-> arg1 width) sv-32) + (set! (-> arg1 height) sv-36) + (if (zero? arg2) + (draw-decoration-load-save obj arg1 sv-16 (if (= (-> arg0 current) 'select-load) + 300 + 299 + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-loading-option ((obj menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (with-pp + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((v1-3 arg1)) + (set! (-> v1-3 scale) 0.55) + ) + (let ((s4-0 arg1)) + (set! (-> s4-0 color) (the-as font-color (progress-selected 0))) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 120.0) + (set! (-> arg1 origin y) 110.0) + (let ((v1-8 arg1)) + (set! (-> v1-8 width) (the float (the-as float #x10e))) + ) + (let ((v1-9 arg1)) + (set! (-> v1-9 height) (the float (the-as float #x23))) + ) + (if (< f30-0 0.0) + 0.0 + ) + ) + (when (or (< (mod (-> pp clock frame-counter) 300) 150) (!= (-> arg0 menu-transition) 0.0)) + (let ((a1-1 416)) + (case (-> arg0 current) + (('saving) + (set! a1-1 415) + ) + (('formatting) + (set! a1-1 417) + ) + (('creating) + (set! a1-1 418) + ) + ) + (print-game-text (lookup-text! *common-text* (the-as game-text-id a1-1) #f) arg1 #f 44 320) + ) + ) + (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) + (let ((v1-25 arg1)) + (set! (-> v1-25 height) (the float (the-as float #xa0))) + ) + (let ((a0-16 arg1)) + (set! (-> a0-16 color) (font-color #7efbfb)) + ) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-dont-remove) #f) 1) + (s5-2 *temp-string* arg1 #f 44 320) + ) + 0 + (none) + ) + ) + +(defmethod menu-option-method-10 menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (when (!= (-> arg0 current) 'none) + (let ((v1-3 arg1)) + (set! (-> v1-3 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 color) (font-color #7efbfb)) + ) + (let ((a0-4 arg1)) + (set! (-> a0-4 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 75.0) + (set! (-> arg1 origin y) 80.0) + (let ((v1-8 arg1)) + (set! (-> v1-8 width) (the float (the-as float #x168))) + ) + (let ((v1-9 arg1)) + (set! (-> v1-9 height) (the float (the-as float #x50))) + ) + (let ((s4-0 410)) + (case (-> arg0 current) + (('insufficient-space) + (set! s4-0 408) + ) + (('no-memory-card) + (set! s4-0 409) + ) + ) + (let ((s3-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (the-as game-text-id s4-0) #f) 1) + (s3-0 *temp-string* arg1 #f 44 320) + ) + ) + (set! (-> arg1 origin y) (+ 80.0 (-> arg1 origin y))) + (let ((v1-17 arg1)) + (set! (-> v1-17 height) (the float (the-as float #x32))) + ) + (let ((s4-1 print-game-text)) + (format + (clear *temp-string*) + (lookup-text! *common-text* (game-text-id progress-memcard-space-requirement) #f) + (if *progress-save-info* + (-> *progress-save-info* mem-required) + 0 + ) + ) + (s4-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 55.0 (-> arg1 origin y))) + (let ((v1-22 arg1)) + (set! (-> v1-22 height) (the float (the-as float #x5a))) + ) + (cond + ((and (!= (-> *progress-state* starting-state) 'insufficient-space) + (!= (-> *progress-state* starting-state) 'no-memory-card) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-memcard-insert-card-with-space-to-save) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) + (let ((s5-2 arg1)) + (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + ) + (else + (let ((s4-2 arg1)) + (set! (-> s4-2 color) (the-as font-color (progress-selected 0))) + ) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + (draw-highlight (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-continue-retry arg0 arg1) + ) + ) + ) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((v1-1 arg1)) + (set! (-> v1-1 scale) 0.5) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 130.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x14a))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x3c))) + ) + (let ((s5-0 409)) + (progress-method-28 arg0 'select-save) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (the-as game-text-id s5-0) #f) 1) + (s4-0 *temp-string* arg1 #f 44 320) + ) + ) + (set! (-> arg1 origin y) (+ 140.0 (-> arg1 origin y))) + (let ((v1-13 arg1)) + (set! (-> v1-13 height) (the float (the-as float #x1e))) + ) + (let ((s5-1 arg1)) + (set! (-> s5-1 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((v1-1 arg1)) + (set! (-> v1-1 scale) 0.5) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 130.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x14a))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x5f))) + ) + (let ((s5-0 print-game-text)) + (format + (clear *temp-string*) + (lookup-text! *common-text* (game-text-id progress-memcard-insert-card-with-jak2) #f) + 1 + ) + (s5-0 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 115.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x3c))) + ) + (let ((s5-1 arg1)) + (set! (-> s5-1 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 17.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-go-back?) #f) arg1 #f 44 320) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((v1-1 arg1)) + (set! (-> v1-1 scale) 0.5) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 100.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x14a))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x2d))) + ) + (let ((s5-0 425)) + (case (-> arg0 current) + (('error-saving) + (set! s5-0 426) + ) + (('error-formatting) + (set! s5-0 427) + ) + (('error-creating) + (set! s5-0 428) + ) + ) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (the-as game-text-id s5-0) #f) 1) + (s4-0 *temp-string* arg1 #f 44 320) + ) + ) + (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) + (let ((v1-16 arg1)) + (set! (-> v1-16 height) (the float (the-as float #x69))) + ) + (let ((s5-1 print-game-text)) + (format + (clear *temp-string*) + (lookup-text! *common-text* (game-text-id progress-memcard-check-and-try-again) #f) + 1 + ) + (s5-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 115.0 (-> arg1 origin y))) + (let ((v1-19 arg1)) + (set! (-> v1-19 height) (the float (the-as float #x2d))) + ) + (let ((s5-2 arg1)) + (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 9.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((v1-1 arg1)) + (set! (-> v1-1 scale) 0.5) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 77.0) + (set! (-> arg1 origin y) 85.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x19))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-memcard-error-while-saving) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 25.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x3c))) + ) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-check) #f) 1) + (s5-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) + (let ((v1-13 arg1)) + (set! (-> v1-13 height) (the float (the-as float #x2d))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-disabled) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) + (let ((v1-16 arg1)) + (set! (-> v1-16 height) (the float (the-as float #x5f))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-autosave-reenabling-info) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 90.0 (-> arg1 origin y))) + (let ((v1-19 arg1)) + (set! (-> v1-19 height) (the float (the-as float #x19))) + ) + (let ((s5-4 arg1)) + (set! (-> s5-4 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (-> arg1 origin y)) 22 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((v1-1 arg1)) + (set! (-> v1-1 scale) 0.5) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 80.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x46))) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-was-removed) #f) 1) + (s5-0 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 65.0 (-> arg1 origin y))) + (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-disabled) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 65.0 (-> arg1 origin y))) + (let ((v1-12 arg1)) + (set! (-> v1-12 height) (the float (the-as float #x5a))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-autosave-reenabling-info) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 85.0 (-> arg1 origin y))) + (let ((v1-15 arg1)) + (set! (-> v1-15 height) (the float (the-as float #x23))) + ) + (let ((s5-3 arg1)) + (set! (-> s5-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 5.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 120.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x23))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-removed-notice) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x55))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-removed-prompt) #f) arg1 #f 44 320) + (when (is-cd-in?) + (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) + (let ((v1-14 arg1)) + (set! (-> v1-14 height) (the float (the-as float #x32))) + ) + (let ((s5-2 arg1)) + (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + ) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 120.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x14a))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x23))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-read-error) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 55.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x55))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-disc-read-error-prompt) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 105.0 (-> arg1 origin y))) + (let ((v1-13 arg1)) + (set! (-> v1-13 height) (the float (the-as float #x32))) + ) + (let ((s5-2 arg1)) + (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (set! (-> *bigmap* auto-save-icon-flag) (the-as basic #t)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x48 :page #x67a))) + (set! (-> obj sprites 0 scale-x) 1.0) + (set! (-> obj sprites 0 scale-y) 1.0) + (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 (- 1.0 (-> arg0 menu-transition))))) + (set! (-> obj sprites 0 pos z) #xffffff) + (set! (-> obj sprites 0 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 240 160) + (let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s4-1 (-> s3-0 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + s3-0 + (-> *level* default-level) + ) + (let ((a3-1 (-> s3-0 base))) + (let ((v1-16 (the-as object (-> s3-0 base)))) + (set! (-> (the-as dma-packet v1-16) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-16) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-16) vif1) (new 'static 'vif-tag)) + (set! (-> s3-0 base) (&+ (the-as pointer v1-16) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s4-1 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + (let ((a0-16 arg1)) + (set! (-> a0-16 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 80.0) + (let ((v1-27 arg1)) + (set! (-> v1-27 width) (the float (the-as float #x14a))) + ) + (let ((v1-28 arg1)) + (set! (-> v1-28 height) (the float (the-as float #x55))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-explanation) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 115.0 (-> arg1 origin y))) + (let ((v1-31 arg1)) + (set! (-> v1-31 height) (the float (the-as float #x5f))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-dont-remove) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 90.0 (-> arg1 origin y))) + (let ((v1-34 arg1)) + (set! (-> v1-34 height) (the float (the-as float #x32))) + ) + (let ((s5-3 arg1)) + (set! (-> s5-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 80.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x55))) + ) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-unformatted) #f) 1) + (s4-0 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x55))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-memcard-formatting-required-notice) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) + (let ((v1-13 arg1)) + (set! (-> v1-13 height) (the float (the-as float #x19))) + ) + (draw-highlight (the int (-> arg1 origin y)) 44 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-format-prompt) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 25.0 (-> arg1 origin y))) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 120.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x55))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-memcard-overwrite-warning) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 105.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x2d))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-memcard-overwrite-confirm) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) + (draw-highlight (the int (+ 8.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 110.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x5a))) + ) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-no-jak2-found) #f) 1) + (s4-0 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x3c))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-memcard-create-jak2-file?) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 70.0 (-> arg1 origin y))) + (draw-highlight (the int (+ 18.0 (-> arg1 origin y))) 22 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 85.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x2d))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-60hz-change-notice) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x5f))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-1) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 85.0 (-> arg1 origin y))) + (let ((v1-13 arg1)) + (set! (-> v1-13 height) (the float (the-as float #x37))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-2) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) + (let ((v1-16 arg1)) + (set! (-> v1-16 height) (the float (the-as float #x1e))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-continue?) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + (draw-highlight (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 130.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x32))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-60hz-change-complete) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 70.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x32))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-mode-revert?) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) + (draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 75.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x32))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-change-notice) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x5a))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-1) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 85.0 (-> arg1 origin y))) + (let ((v1-13 arg1)) + (set! (-> v1-13 height) (the float (the-as float #x4b))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-2) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 70.0 (-> arg1 origin y))) + (let ((v1-16 arg1)) + (set! (-> v1-16 height) (the float (the-as float #x1e))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-continue?) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 25.0 (-> arg1 origin y))) + (draw-highlight (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.55) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 90.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x50))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-change-complete) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 100.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x4b))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-mode-revert?) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 70.0 (-> arg1 origin y))) + (draw-highlight (the int (+ 20.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.55) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 160.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x14a))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x46))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-quit-game-confirm) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) + (draw-highlight (the int (+ 17.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +;; WARN: disable def twice: 147. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod menu-option-method-10 menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (sv-48 int) + (sv-64 int) + (sv-80 game-task-info) + (sv-96 font-context) + (sv-112 (function string font-context symbol int int float)) + (sv-128 hud-box) + ) + (let* ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (s3-0 (-> obj task-index)) + (s2-0 0) + (s1-0 50) + (f28-0 (* (-> arg0 sliding-height) (the float s1-0))) + (s0-0 97) + ) + (set! sv-128 (new 'stack 'hud-box)) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((v1-5 arg1)) + (set! (-> v1-5 scale) 0.45) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle large)) + ) + (let ((a0-4 arg1)) + (set! (-> a0-4 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin y) 100.0) + (let ((v1-9 arg1)) + (set! (-> v1-9 width) (the float (the-as float #x159))) + ) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #xd2))) + ) + (let* ((v1-11 (-> arg0 current)) + (a3-1 (cond + ((= v1-11 'select-pre-start) + 362 + ) + ((= v1-11 'select-kiosk-start) + 363 + ) + (else + 352 + ) + ) + ) + ) + (if (or (= (-> *setting-control* user-default language) (language-enum french)) + (= (-> *setting-control* user-default language) (language-enum spanish)) + ) + (draw-decoration obj arg1 f30-0 a3-1 #t 0.7) + (draw-decoration obj arg1 f30-0 a3-1 #t 0.95) + ) + ) + (begin-scissor-level sv-128) + (set! (-> arg1 origin x) 80.0) + (let ((v1-20 arg1)) + (set! (-> v1-20 scale) 0.5) + ) + (when (or (= (-> *setting-control* user-default language) (language-enum japanese)) + (= (-> *setting-control* user-default language) (language-enum korean)) + ) + (let ((v1-28 arg1)) + (set! (-> v1-28 scale) 0.6) + ) + ) + (let ((a0-18 arg1)) + (set! (-> a0-18 flags) (font-flags kerning large)) + ) + (when (>= (+ s3-0 -1) 0) + (+! s3-0 -1) + (set! s2-0 -1) + (draw-highlight (+ s0-0 47) 50 f30-0) + (set! s0-0 (- s0-0 s1-0)) + ) + (while (< s2-0 8) + (when (>= s3-0 0) + (set! sv-48 -1) + (set! sv-64 0) + (while (and (< sv-64 (-> *game-info* play-list length)) (!= sv-48 s3-0)) + (let* ((v1-39 (-> *game-info* play-list sv-64)) + (a0-22 (-> arg0 current)) + (a0-24 (cond + ((= a0-22 'select-pre-start) + (or (-> v1-39 play-continue) (-> v1-39 pre-play-continue)) + ) + ((= a0-22 'select-kiosk-start) + (-> v1-39 kiosk-play-continue) + ) + (else + (-> v1-39 play-continue) + ) + ) + ) + ) + (when (and a0-24 (lookup-text! *common-text* (-> v1-39 text-name) #t)) + (set! sv-48 (+ sv-48 1)) + sv-48 + ) + ) + (when (!= sv-48 s3-0) + (set! sv-64 (+ sv-64 1)) + sv-64 + ) + ) + (when (!= sv-64 (-> *game-info* play-list length)) + (set! sv-80 (-> *game-info* play-list sv-64)) + (cond + ((zero? s2-0) + (set! (-> obj real-task-index) sv-64) + (set! sv-96 arg1) + (set! (-> sv-96 color) (the-as font-color (progress-selected 0))) + (draw-highlight (+ s0-0 47) 50 f30-0) + ) + (else + (let ((a0-35 arg1)) + (set! (-> a0-35 color) (font-color #7efbfb)) + ) + ) + ) + (cond + ((and (= (-> *setting-control* user-default language) (language-enum german)) (= 454 (-> sv-80 text-name))) + (let ((v1-71 arg1)) + (set! (-> v1-71 scale) 0.45) + ) + ) + ((and (= (-> *setting-control* user-default language) (language-enum german)) (!= 454 (-> sv-80 text-name))) + (let ((v1-78 arg1)) + (set! (-> v1-78 scale) 0.5) + ) + ) + ) + (let ((v1-79 arg1)) + (set! (-> v1-79 height) (the float s1-0)) + ) + (+! s0-0 s1-0) + (set! (-> arg1 origin y) (the float (+ s0-0 (the int f28-0)))) + (set! sv-112 print-game-text) + (let ((a0-46 (lookup-text! *common-text* (-> sv-80 text-name) #f)) + (a1-12 arg1) + (a2-7 #f) + (a3-2 44) + (t0-3 320) + ) + (sv-112 a0-46 a1-12 a2-7 a3-2 t0-3) + ) + ) + ) + (+! s3-0 1) + (+! s2-0 1) + ) + ) + (let ((t9-10 end-scissor-level) + (a1-13 1.0) + ) + (t9-10 sv-128 a1-13) + ) + (draw-scene-up-down arg1) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (sv-48 int) + (sv-64 (function string font-context symbol int int float)) + (sv-80 (function string font-context symbol int int float)) + (sv-96 (function _varargs_ object)) + (sv-112 string) + (sv-128 (function string font-context symbol int int float)) + (sv-144 (function _varargs_ object)) + (sv-160 string) + (sv-176 (function string font-context symbol int int float)) + (sv-192 font-context) + (sv-208 font-context) + (sv-224 (function string font-context symbol int int float)) + ) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (s4-0 (-> obj task-index)) + (s3-0 0) + (s2-0 *hud-select-scene-act1*) + ) + (let ((v1-2 44)) + (* (-> arg0 sliding-height) (the float v1-2)) + ) + (let ((s0-0 120) + (s1-0 (new 'stack-no-clear 'hud-box)) + ) + (let ((f28-0 0.0)) + 0.0 + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (case (-> *progress-state* scene-player-act) + ((1) + (set! s2-0 *hud-select-scene-act1*) + ) + ((2) + (set! s2-0 *hud-select-scene-act2*) + ) + ((3) + (set! s2-0 *hud-select-scene-act3*) + ) + ) + (set! (-> arg1 alpha) f30-0) + (let ((a1-6 arg1)) + (set! (-> a1-6 flags) (font-flags kerning middle large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 100.0) + (let ((v1-14 arg1)) + (set! (-> v1-14 width) (the float (the-as float #x14f))) + ) + (let ((v1-15 arg1)) + (set! (-> v1-15 height) (the float (the-as float #xd2))) + ) + (let ((a1-9 arg1)) + (set! (-> a1-9 color) (font-color #7efbfb)) + ) + (if (or (= (-> *setting-control* user-default language) (language-enum french)) + (= (-> *setting-control* user-default language) (language-enum spanish)) + ) + (draw-decoration obj arg1 f30-0 364 #t 0.7) + (draw-decoration obj arg1 f30-0 364 #t 0.95) + ) + (begin-scissor-scene s1-0) + (let ((v1-23 arg1)) + (set! (-> v1-23 scale) 0.5) + ) + (set! sv-48 0) + (while (< sv-48 s4-0) + (set! sv-64 print-game-text) + (let ((a0-4 (lookup-text! *common-text* (the-as game-text-id (-> s2-0 sv-48 text)) #f)) + (a1-16 arg1) + (a2-4 #t) + (a3-3 44) + (t0-3 320) + ) + (+! f28-0 (sv-64 a0-4 a1-16 a2-4 a3-3 t0-3)) + ) + (set! sv-48 (+ sv-48 1)) + ) + (let ((s0-1 (- s0-0 (the int f28-0))) + (f28-1 (cond + ((< (-> arg0 sliding-height) 0.0) + (set! sv-112 (lookup-text! *common-text* (the-as game-text-id (-> s2-0 s4-0 text)) #f)) + 0.0 + (set! sv-80 print-game-text) + (set! sv-96 format) + (let ((a0-7 (clear *temp-string*)) + (a1-18 "~S") + ) + (sv-96 a0-7 a1-18 sv-112) + ) + (let* ((a0-8 *temp-string*) + (a1-19 arg1) + (a2-7 #t) + (a3-4 44) + (t0-4 320) + (f0-16 (sv-80 a0-8 a1-19 a2-7 a3-4 t0-4)) + ) + (* (-> arg0 sliding-height) f0-16) + ) + ) + (else + (set! sv-160 (lookup-text! *common-text* (the-as game-text-id (-> s2-0 (+ s4-0 -1) text)) #f)) + 0.0 + (set! sv-128 print-game-text) + (set! sv-144 format) + (let ((a0-11 (clear *temp-string*)) + (a1-21 "~S") + ) + (sv-144 a0-11 a1-21 sv-160) + ) + (let* ((a0-12 *temp-string*) + (a1-22 arg1) + (a2-10 #t) + (a3-5 44) + (t0-5 320) + (f0-18 (sv-128 a0-12 a1-22 a2-10 a3-5 t0-5)) + ) + (* (-> arg0 sliding-height) f0-18) + ) + ) + ) + ) + ) + (set! (-> arg1 origin y) (the float (+ s0-1 (the int f28-1)))) + (while (< s3-0 (length s2-0)) + (set! sv-176 print-game-text) + (let* ((a0-14 (lookup-text! *common-text* (the-as game-text-id (-> s2-0 s3-0 text)) #f)) + (a1-24 arg1) + (a2-12 #t) + (a3-6 44) + (t0-6 320) + (f26-0 (sv-176 a0-14 a1-24 a2-12 a3-6 t0-6)) + ) + (set! (-> arg1 flags) (font-flags kerning large)) + (cond + ((and (< s3-0 s4-0) (!= (-> arg0 sliding-height) 0.0)) + (set! sv-192 arg1) + (set! (-> sv-192 color) (the-as font-color (progress-selected 0))) + (draw-highlight (+ (the int f26-0) -2 s0-1) (the int f26-0) f30-0) + ) + ((or (and (= s3-0 s4-0) (= (fabs (-> arg0 sliding-height)) 0.0)) (zero? s3-0)) + (set! sv-208 arg1) + (set! (-> sv-208 color) (the-as font-color (progress-selected 0))) + (draw-highlight (+ s0-1 -2) (the int f26-0) f30-0) + ) + (else + (let ((a0-21 arg1)) + (set! (-> a0-21 color) (font-color #7efbfb)) + ) + ) + ) + ) + (set! sv-224 print-game-text) + (let ((a0-23 (lookup-text! *common-text* (the-as game-text-id (-> s2-0 s3-0 text)) #f)) + (a1-28 arg1) + (a2-16 #f) + (a3-7 44) + (t0-7 320) + ) + (+! s0-1 (the int (sv-224 a0-23 a1-28 a2-16 a3-7 t0-7))) + ) + (set! (-> arg1 origin y) (the float (+ s0-1 (the int f28-1)))) + (+! s3-0 1) + ) + ) + ) + (end-scissor-scene s1-0 1.0) + ) + ) + (draw-scene-up-down arg1) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun sort-task-node-result ((arg0 int)) + (let ((v1-1 (-> *game-info* mission-list)) + (a1-1 (max 0 (+ arg0 -1))) + ) + (let ((a0-3 0)) + (while (> a1-1 0) + (while (< a0-3 a1-1) + (when (and (logtest? (-> v1-1 a0-3 flags) (game-task-node-flag closed)) + (logtest? (-> v1-1 (+ a0-3 1) flags) (game-task-node-flag closed)) + (< (-> v1-1 a0-3 close-time) (-> v1-1 (+ a0-3 1) close-time)) + ) + (let ((a2-19 (-> v1-1 a0-3))) + (set! (-> v1-1 a0-3) (-> v1-1 (+ a0-3 1))) + (set! (-> v1-1 (+ a0-3 1)) a2-19) + ) + ) + (+! a0-3 1) + ) + (+! a1-1 -1) + (set! a0-3 0) + ) + ) + ) + (none) + ) + +(defun find-mission-text-at-index ((arg0 int)) + (local-vars (v1-99 symbol)) + (when (< arg0 (-> *progress-state* current-line-index)) + (set! (-> *progress-state* current-task-index) (length (-> *game-info* sub-task-list))) + (set! (-> *progress-state* current-line-index) -1) + (set! (-> *progress-state* current-task) (the-as uint -1)) + (set! (-> *progress-state* first-closed-line-index) -1) + (set! (-> *progress-state* extra-text-state) -1) + (set! (-> *progress-state* num-open-tasks-found) 0) + (set! (-> *progress-state* num-closed-tasks-found) 0) + 0 + ) + (let ((s5-0 (-> *game-info* sub-task-list))) + 0 + (let ((s4-0 (the-as game-task-node-info #f))) + (while (and (> (-> *progress-state* current-task-index) 0) (!= (-> *progress-state* current-line-index) arg0)) + (cond + ((or (= (-> *progress-state* extra-text-state) -1) (= (-> *progress-state* extra-text-state) 3)) + (+! (-> *progress-state* current-task-index) -1) + (let ((s3-0 (-> s5-0 (-> *progress-state* current-task-index)))) + (when (and (!= (-> s3-0 task) (-> *progress-state* current-task)) (nonzero? (-> s3-0 description))) + (cond + ((and (>= (-> *progress-state* first-closed-line-index) 0) (open? s3-0)) + (set! (-> *progress-state* current-task) (the-as uint (-> s3-0 task))) + ) + ((or (and (>= (-> *progress-state* first-closed-line-index) 0) + (logtest? (-> s3-0 flags) (game-task-node-flag closed)) + ) + (and (< (-> *progress-state* first-closed-line-index) 0) (open? s3-0)) + ) + (set! (-> *progress-state* current-task) (the-as uint (-> s3-0 task))) + (set! s4-0 (-> s5-0 (-> *progress-state* current-task-index))) + (-> s5-0 (-> *progress-state* current-task-index) description) + (if (< (-> *progress-state* first-closed-line-index) 0) + (+! (-> *progress-state* num-open-tasks-found) 1) + (set! (-> *progress-state* num-closed-tasks-found) 1) + ) + (+! (-> *progress-state* current-line-index) 1) + ) + ) + ) + ) + (when (and (zero? (-> *progress-state* current-task-index)) (!= (-> *progress-state* current-line-index) arg0)) + (set! (-> *progress-state* current-task-index) (length (-> *game-info* sub-task-list))) + (cond + ((< (-> *progress-state* first-closed-line-index) 0) + (set! (-> *progress-state* first-closed-line-index) arg0) + (+! (-> *progress-state* extra-text-state) (if (nonzero? (-> *progress-state* num-open-tasks-found)) + 2 + 1 + ) + ) + ) + (else + (+! (-> *progress-state* extra-text-state) (if (nonzero? (-> *progress-state* num-closed-tasks-found)) + 2 + 1 + ) + ) + ) + ) + ) + ) + ((zero? (-> *progress-state* extra-text-state)) + 369 + (+! (-> *progress-state* extra-text-state) 1) + (+! (-> *progress-state* current-line-index) 1) + ) + ((= (-> *progress-state* extra-text-state) 1) + 367 + #t + (let ((v1-98 (the-as symbol (-> *progress-state* num-open-tasks-found)))) + (set! v1-98 v1-98) + (cmove-#f-zero v1-99 v1-98 v1-98) + ) + (+! (-> *progress-state* extra-text-state) 1) + (+! (-> *progress-state* current-line-index) 1) + ) + ((= (-> *progress-state* extra-text-state) 4) + 369 + (+! (-> *progress-state* extra-text-state) 1) + (+! (-> *progress-state* current-line-index) 1) + ) + ((= (-> *progress-state* extra-text-state) 5) + 368 + (+! (-> *progress-state* extra-text-state) 2) + (+! (-> *progress-state* current-line-index) 1) + ) + (else + 0 + (+! (-> *progress-state* extra-text-state) 1) + (+! (-> *progress-state* current-line-index) 1) + ) + ) + ) + (cond + ((= (-> *progress-state* current-line-index) arg0) + (empty) + s4-0 + ) + (else + (the-as game-task-node-info #f) + ) + ) + ) + ) + ) + +(defmethod menu-option-method-10 menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (f0-50 float) + (sv-16 float) + (sv-20 int) + (sv-24 int) + (sv-32 int) + (sv-40 int) + (sv-48 int) + (sv-56 int) + (sv-256 float) + (sv-260 float) + (sv-264 game-task-node-info) + (sv-268 game-task-node-info) + (sv-272 symbol) + (sv-276 hud-box) + (sv-280 float) + (sv-284 float) + ) + (set! sv-16 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (set! sv-20 1) + (set! sv-24 0) + (set! sv-32 0) + (set! sv-40 0) + (set! sv-48 0) + (set! sv-56 95) + (set! sv-256 (* 395.0 (-> arg0 sliding))) + (set! sv-260 (* 44.0 (-> arg0 sliding-height))) + (set! sv-264 (new 'stack 'game-task-node-info)) + (set! sv-268 (new 'stack 'game-task-node-info)) + (set! sv-272 #t) + (set! sv-276 (new 'stack-no-clear 'hud-box)) + (set! sv-280 (-> arg1 origin y)) + (set! sv-284 (-> arg1 scale)) + (set! (-> *progress-state* current-task-index) (length (-> *game-info* sub-task-list))) + (set! (-> *progress-state* current-line-index) -1) + (set! (-> *progress-state* current-task) (the-as uint -1)) + (set! (-> *progress-state* first-closed-line-index) -1) + (set! (-> *progress-state* extra-text-state) -1) + (set! (-> *progress-state* num-open-tasks-found) 0) + (set! (-> *progress-state* num-closed-tasks-found) 0) + (if (< sv-16 0.0) + (set! sv-16 (the-as float 0.0)) + ) + (set! (-> arg1 alpha) sv-16) + (set! (-> *game-info* mission-list 0) sv-264) + (set! (-> sv-264 description) (game-text-id progress-unknown-kjanskd)) + (set! (-> sv-268 description) (game-text-id progress-unknown-oi1un23i13)) + (while (< sv-24 (length (-> *game-info* sub-task-list))) + (let ((v1-26 (find-mission-text-at-index sv-24)) + (a0-15 (-> *game-info* mission-list)) + ) + (when (!= v1-26 #f) + (when (and (logtest? (-> v1-26 flags) (game-task-node-flag closed)) sv-272) + (set! sv-272 (the-as symbol #f)) + (set! (-> a0-15 sv-20) sv-268) + (set! sv-20 (+ sv-20 1)) + ) + (set! (-> a0-15 sv-20) v1-26) + (set! sv-20 (+ sv-20 1)) + ) + ) + (set! sv-24 (+ sv-24 1)) + ) + (set! sv-48 sv-20) + (set! (-> *progress-state* total-num-tasks) sv-20) + (sort-task-node-result sv-48) + (let ((v1-36 arg1)) + (set! (-> v1-36 width) 395.0) + ) + (set! (-> arg1 origin x) 60.0) + (set! (-> arg1 origin y) 80.0) + (let ((a0-21 arg1)) + (set! (-> a0-21 color) (font-color #7efbfb)) + ) + (let ((v1-40 (-> obj page-index))) + (cond + ((zero? v1-40) + (draw-missions-decoration obj arg1 sv-16 (game-text-id progress-root-missions)) + ) + ((= v1-40 1) + (draw-missions-decoration obj arg1 sv-16 (game-text-id progress-root-missions)) + ) + ) + ) + (begin-scissor-missions sv-276 (the-as float arg0)) + (let ((a0-27 arg1)) + (set! (-> a0-27 flags) (font-flags kerning large)) + ) + (set! (-> arg1 origin x) (+ 20.0 (-> arg1 origin x))) + (case (get-aspect-ratio) + (('aspect16x9) + (set! (-> arg1 origin y) 80.0) + ) + (('aspect4x3) + (set! (-> arg1 origin y) (the float sv-56)) + ) + ) + (let ((v1-52 arg1)) + (set! (-> v1-52 scale) sv-284) + ) + (when (zero? (-> obj page-index)) + (set! sv-24 (-> obj task-line-index)) + (set! sv-20 0) + (let ((v1-57 (+ sv-56 44))) + (set! sv-56 v1-57) + (set! (-> arg1 origin y) (the float (+ v1-57 (the int sv-260)))) + ) + (set! (-> arg1 width) 340.0) + (set! (-> arg1 height) 44.0) + (when (!= sv-260 0.0) + (set! (-> *progress-state* missions-total-spacing) 0.0) + (dotimes (s4-1 sv-24) + (let* ((s3-1 (-> *game-info* mission-list s4-1)) + (a1-19 + (if (and (logtest? (-> s3-1 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s3-1 task))) + (-> *game-info* play-list (-> s3-1 task) text-name) + (-> s3-1 description) + ) + ) + (s3-2 (lookup-text! *common-text* a1-19 #f)) + (f30-0 3.0) + (s2-0 print-game-text) + ) + (format (clear *temp-string*) "~S" s3-2) + (set! (-> *progress-state* missions-total-spacing) + (+ f30-0 (s2-0 *temp-string* arg1 #t 44 320) (-> *progress-state* missions-total-spacing)) + ) + ) + ) + ) + (set! sv-56 (- sv-56 (the int (-> *progress-state* missions-total-spacing)))) + (cond + ((< (-> arg0 sliding-height) 0.0) + (let* ((s4-2 (-> *game-info* mission-list sv-24)) + (a1-23 + (if (and (logtest? (-> s4-2 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s4-2 task))) + (-> *game-info* play-list (-> s4-2 task) text-name) + (-> s4-2 description) + ) + ) + (s4-3 (lookup-text! *common-text* a1-23 #f)) + ) + 0.0 + (let ((f30-1 3.0) + (s3-3 print-game-text) + ) + (format (clear *temp-string*) "~S" s4-3) + (let ((f0-36 (+ f30-1 (s3-3 *temp-string* arg1 #t 44 320)))) + (set! sv-260 (* (-> arg0 sliding-height) f0-36)) + ) + ) + ) + ) + (else + (let* ((s4-4 (-> *game-info* mission-list (+ sv-24 -1))) + (a1-27 + (if (and (logtest? (-> s4-4 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s4-4 task))) + (-> *game-info* play-list (-> s4-4 task) text-name) + (-> s4-4 description) + ) + ) + (s4-5 (lookup-text! *common-text* a1-27 #f)) + ) + 0.0 + (let ((f30-2 3.0) + (s3-4 print-game-text) + ) + (format (clear *temp-string*) "~S" s4-5) + (let ((f0-40 (+ f30-2 (s3-4 *temp-string* arg1 #t 44 320)))) + (set! sv-260 (* (-> arg0 sliding-height) f0-40)) + ) + ) + ) + ) + ) + (set! (-> arg1 origin y) (the float (+ sv-56 (the int sv-260)))) + (while (and (< sv-20 sv-48) (< sv-20 (+ sv-24 10))) + (let* ((s4-6 (-> *game-info* mission-list sv-20)) + (s3-5 + (if (and (logtest? (-> s4-6 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s4-6 task))) + (-> *game-info* play-list (-> s4-6 task) text-name) + (-> s4-6 description) + ) + ) + (s5-1 (lookup-text! *common-text* s3-5 #f)) + ) + 0.0 + (set! f0-50 + (cond + ((>= sv-20 (+ sv-24 -1)) + (when (and (!= s3-5 381) (!= s3-5 380)) + (let ((s3-6 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! + *common-text* + (if (logtest? (-> s4-6 flags) (game-task-node-flag closed)) + (game-text-id progress-missions-icon-completed) + (game-text-id progress-missions-icon-todo) + ) + #f + ) + ) + (s3-6 *temp-string* arg1 #f 44 320) + ) + ) + (set! (-> arg1 origin x) (+ 20.0 (-> arg1 origin x))) + (let ((f30-3 3.0) + (s4-7 print-game-text) + ) + (format (clear *temp-string*) "~S" s5-1) + (set! f0-50 (+ f30-3 (s4-7 *temp-string* arg1 #f 44 320))) + ) + (set! (-> arg1 origin x) (+ -20.0 (-> arg1 origin x))) + f0-50 + ) + (else + (let ((f30-4 3.0) + (s4-8 print-game-text) + ) + (format (clear *temp-string*) "~S" s5-1) + (+ f30-4 (s4-8 *temp-string* arg1 #t 44 320)) + ) + ) + ) + ) + ) + (let ((v1-142 (+ sv-56 (the int f0-50)))) + (set! sv-56 v1-142) + (set! (-> arg1 origin y) (the float (+ v1-142 (the int sv-260)))) + ) + (set! sv-20 (+ sv-20 1)) + ) + (if (zero? (-> *progress-state* total-num-tasks)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-missions-none) #f) arg1 #f 44 320) + ) + ) + (end-scissor-missions sv-276 1.0) + (draw-missions-up-down arg1) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs pointer. +(defun draw-secret-list ((arg0 secret-item-option) (arg1 progress) (arg2 font-context) (arg3 int) (arg4 symbol) (arg5 float)) + (let ((s4-0 (and arg4 (= arg3 1)))) + 380.0 + 270.0 + (set! (-> arg2 origin x) 100.0) + (cond + ((= s4-0 #t) + (cond + ((= (-> arg0 can-toggle) 'auto) + ) + ((not (-> arg0 can-toggle)) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg2 origin x) (+ -25.0 (-> arg2 origin x))) + ) + (('aspect16x9) + (set! (-> arg2 origin x) (+ -10.0 (-> arg2 origin x))) + ) + ) + (when (= (-> *setting-control* user-default language) (language-enum german)) + (let ((v1-19 arg2)) + (set! (-> v1-19 scale) 0.43) + ) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-secrets-go-to-title-screen) #f) + arg2 + #f + 44 + 320 + ) + ) + ((and (= (-> arg0 can-toggle) #t) (logtest? (-> *game-info* secrets) (-> arg0 flag))) + (set! (-> arg1 selected-option) #f) + (logclear! (-> *game-info* secrets) (-> arg0 flag)) + ) + ((and (= (-> arg0 can-toggle) #t) (zero? (logand (-> *game-info* secrets) (-> arg0 flag)))) + (logior! (-> *game-info* secrets) (-> arg0 flag)) + (set! (-> arg1 selected-option) #f) + ) + ) + ) + (else + (let ((s3-1 arg2)) + (set! (-> s3-1 color) (if (= arg3 1) + (the-as font-color (progress-selected 0)) + (font-color #7efbfb) + ) + ) + ) + (set! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 75 + 90 + ) + ) + ) + (cond + ((logtest? (-> *game-info* sub-task-list (-> arg0 avail-after) flags) (game-task-node-flag closed)) + (let ((s3-3 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> arg0 name) #f)) + (s3-3 *temp-string* arg2 #f 44 320) + ) + ) + (else + (let ((s3-4 print-game-text)) + (format (clear *temp-string*) "????????") + (s3-4 *temp-string* arg2 #f 44 320) + ) + ) + ) + (set! (-> arg2 origin x) 360.0) + (let ((a0-35 arg2)) + (set! (-> a0-35 color) (font-color #7efbfb)) + ) + ) + ) + (the-as + pointer + (cond + ((and (not s4-0) (zero? (logand (-> *game-info* purchase-secrets) (-> arg0 flag)))) + (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 50 + 45 + ) + ) + ) + (let ((s4-2 print-game-text)) + (format (clear *temp-string*) "~D" (-> arg0 cost)) + (s4-2 *temp-string* arg2 #f 44 320) + ) + ) + ((and (not s4-0) (= (-> arg0 can-toggle) #t) (logtest? (-> *game-info* secrets) (-> arg0 flag))) + (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 50 + 45 + ) + ) + ) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-on) #f)) + (s5-2 *temp-string* arg2 #f 44 320) + ) + ) + ((and (not s4-0) (= (-> arg0 can-toggle) #t) (zero? (logand (-> *game-info* secrets) (-> arg0 flag)))) + (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 50 + 45 + ) + ) + ) + (let ((s5-4 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-off) #f)) + (s5-4 *temp-string* arg2 #f 44 320) + ) + ) + ((and (not s4-0) (!= (-> arg0 can-toggle) #t)) + (let ((s3-8 80) + (s5-5 70) + (f30-3 (-> arg2 origin x)) + ) + (set! s3-8 (cond + ((= (get-aspect-ratio) 'aspect4x3) + (empty) + s3-8 + ) + (else + s5-5 + ) + ) + ) + (set! (-> arg2 origin x) (+ f30-3 (the float s3-8))) + ) + (let ((a0-61 arg2)) + (set! (-> a0-61 flags) (font-flags kerning right large)) + ) + (let ((s5-6 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-secrets-unlocked) #f)) + (s5-6 *temp-string* arg2 #f 44 320) + ) + (let ((v0-15 (the-as object arg2))) + (set! (-> (the-as font-context v0-15) flags) (font-flags kerning large)) + v0-15 + ) + ) + ) + ) + ) + ) + +(defmethod menu-option-method-10 menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (sv-16 float) + (sv-20 symbol) + (sv-24 int) + (sv-32 float) + (sv-36 float) + (sv-40 symbol) + (sv-44 int) + (sv-48 progress) + (sv-96 int) + (sv-104 int) + (sv-108 float) + (sv-112 int) + (sv-116 int) + (sv-120 hud-box) + (sv-128 int) + ) + (set! sv-16 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (set! sv-20 (logtest? (-> *game-info* secrets) (game-secrets hero-mode))) + (set! sv-24 (the int (-> *game-info* skill-total))) + (set! sv-32 395.0) + (set! sv-36 25.0) + (set! sv-40 arg3) + (set! sv-44 arg2) + (set! sv-48 arg0) + (set! sv-96 (if (not sv-20) + 0 + (-> obj num-items) + ) + ) + (set! sv-104 (if (not sv-20) + (-> obj num-items) + (+ (-> obj num-items) (-> obj num-hero-items)) + ) + ) + (set! sv-108 (* (-> sv-48 sliding) sv-36)) + (set! sv-112 (-> obj item-index)) + (set! sv-116 (-> obj prev-item-index)) + (set! sv-120 (new 'stack-no-clear 'hud-box)) + (set! sv-128 205) + (if (< sv-16 0.0) + (set! sv-16 (the-as float 0.0)) + ) + (cond + ((or (not (-> *bigmap* progress-minimap)) (< (-> obj item-index) sv-96) (< sv-104 (-> obj item-index))) + (draw-busy-loading arg1) + ) + (else + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93))) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (set! (-> obj sprites 0 scale-x) 0.64) + (set! (-> obj sprites 0 scale-y) 0.64) + (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 sv-16))) + (set! (-> obj sprites 0 pos z) #xffffff) + (set! (-> obj sprites 0 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 100 128) + (let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s4-0 (-> s3-0 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + s3-0 + (-> *level* default-level) + ) + (let ((a3-1 (-> s3-0 base))) + (let ((v1-42 (the-as object (-> s3-0 base)))) + (set! (-> (the-as dma-packet v1-42) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-42) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-42) vif1) (new 'static 'vif-tag)) + (set! (-> s3-0 base) (&+ (the-as pointer v1-42) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s4-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + (set! (-> arg1 alpha) sv-16) + (let ((a0-21 arg1)) + (set! (-> a0-21 flags) (font-flags kerning middle large)) + ) + (let ((a0-22 arg1)) + (set! (-> a0-22 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin x) 59.0) + (let ((v1-54 arg1)) + (set! (-> v1-54 width) sv-32) + ) + (let ((v1-55 arg1)) + (set! (-> v1-55 height) sv-36) + ) + (let ((v1-56 arg1)) + (set! (-> v1-56 scale) 1.0) + ) + (set! (-> arg1 origin y) 82.0) + (let ((t9-5 draw-decoration-secrets) + (a0-24 obj) + (a1-4 arg1) + (a2-4 sv-16) + (a3-2 339) + ) + (t9-5 a0-24 a1-4 a2-4 (the-as game-text-id a3-2)) + ) + (let ((v1-58 arg1)) + (set! (-> v1-58 scale) 0.45) + ) + (when (or (= (-> *setting-control* user-default language) (language-enum japanese)) + (= (-> *setting-control* user-default language) (language-enum korean)) + ) + (let ((v1-66 arg1)) + (set! (-> v1-66 scale) 0.53) + ) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (let ((v1-68 arg1)) + (set! (-> v1-68 height) (the float (the-as float #xb9))) + ) + (set! (-> arg1 origin y) 133.0) + ) + (('aspect16x9) + (let ((v1-72 arg1)) + (set! (-> v1-72 height) (the float (the-as float #xb9))) + ) + (set! (-> arg1 origin y) 133.0) + ) + ) + (let ((a0-34 arg1)) + (set! (-> a0-34 flags) (font-flags kerning large)) + ) + (set! (-> arg1 origin x) 100.0) + (let ((s4-1 print-game-text)) + (format + (clear *temp-string*) + "x~D ~S" + sv-24 + (lookup-text! *common-text* (game-text-id progress-secrets-orb-label) #f) + ) + (s4-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) 100.0) + (begin-scissor-secret sv-120 sv-48) + (case (get-aspect-ratio) + (('aspect16x9) + (set! sv-128 195) + ) + ) + (cond + (sv-40 + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128))) + (draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) + ) + ((>= (- sv-112 sv-116) 0) + (when (>= (+ sv-112 -3) sv-96) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) -50 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 -3)) sv-48 arg1 0 sv-40 sv-108) + ) + (when (>= (+ sv-112 -2) sv-96) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) -25 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 -2)) sv-48 arg1 0 sv-40 sv-108) + ) + (set! (-> arg1 origin y) (the float (+ sv-128 (the int sv-108)))) + (when (>= (+ sv-112 -1) sv-96) + (draw-highlight (+ sv-128 22) 22 sv-16) + (draw-secret-list (-> obj secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108) + ) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128))) + (draw-highlight (+ sv-128 22) 22 sv-16) + (draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) + (when (< (+ sv-112 1) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 50 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 1)) sv-48 arg1 0 sv-40 sv-108) + ) + (when (< (+ sv-112 2) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 75 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 2)) sv-48 arg1 0 sv-40 sv-108) + ) + (when (< (+ sv-112 3) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 100 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 3)) sv-48 arg1 0 sv-40 sv-108) + ) + ) + (else + (when (>= (+ sv-112 -2) sv-96) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) -25 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 -2)) sv-48 arg1 0 sv-40 sv-108) + ) + (set! (-> arg1 origin y) (the float (+ sv-128 (the int sv-108)))) + (if (>= (+ sv-112 -1) sv-96) + (draw-secret-list (-> obj secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108) + ) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128))) + (draw-highlight (+ sv-128 22) 22 sv-16) + (draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) + (when (< (+ sv-112 1) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 50 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 1)) sv-48 arg1 0 sv-40 sv-108) + ) + (when (< (+ sv-112 2) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 75 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 2)) sv-48 arg1 0 sv-40 sv-108) + ) + (when (< (+ sv-112 3) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 100 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 3)) sv-48 arg1 0 sv-40 sv-108) + ) + (when (< (+ sv-112 4) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 125 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 4)) sv-48 arg1 0 sv-40 sv-108) + ) + ) + ) + (end-scissor-secret sv-120 1.0) + (draw-up-down arg1) + ) + ) + 0 + (none) + ) + +(deftype print-highscore-obj (basic) + ((self texture-page :offset-assert 4) + (index int32 :offset-assert 8) + (previous texture-page :offset-assert 12) + (place int32 :offset-assert 16) + (score float :offset-assert 20) + (game-score basic :offset-assert 24) + (context font-context :offset-assert 28) + (local-scale float :offset-assert 32) + (interp float :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + + +(defun draw-highscore-icon ((arg0 menu-highscores-option) (arg1 uint) (arg2 int) (arg3 int) (arg4 float)) + (set! (-> arg0 sprites 0 tex) (lookup-texture-by-id (the-as texture-id arg1))) + (set! (-> arg0 sprites 0 scale-x) arg4) + (set! (-> arg0 sprites 0 scale-y) arg4) + (set-hud-piece-position! (the-as hud-sprite (-> arg0 sprites)) arg2 arg3) + (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-1 (-> s4-1 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> arg0 sprites)) + s4-1 + (-> *level* default-level) + ) + (let ((a3-1 (-> s4-1 base))) + (let ((v1-8 (the-as object (-> s4-1 base)))) + (set! (-> (the-as dma-packet v1-8) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-8) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-8) vif1) (new 'static 'vif-tag)) + (set! (-> s4-1 base) (&+ (the-as pointer v1-8) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + gp-1 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + +(defun draw-highscore-cup ((arg0 texture-page) (arg1 int) (arg2 int) (arg3 int) (arg4 float) (arg5 float)) + "First int is an enum" + (let ((a0-1 (the-as uint #xc9300300))) + (case arg1 + ((3) + (set! a0-1 (the-as uint #xc9300300)) + ) + ((2) + (set! a0-1 (the-as uint #xc9300a00)) + ) + ((1) + (set! a0-1 (the-as uint #xc9300d00)) + ) + ) + (when (nonzero? arg1) + (set! (-> arg0 pad 11) (the-as uint 4)) + (let ((v1-10 (&-> arg0 pad 7))) + (set! (-> v1-10 0) (the-as uint 128)) + (set! (-> v1-10 1) (the-as uint 128)) + (set! (-> v1-10 2) (the-as uint 128)) + (set! (-> v1-10 3) (the-as uint (the int (* 128.0 arg5)))) + ) + (set! (-> arg0 pad 5) (the-as uint #xffffff)) + (set! (-> arg0 pad 6) (the-as uint 0)) + (set! (-> arg0 data 0) (lookup-texture-by-id (the-as texture-id a0-1))) + (set! (-> arg0 pad 12) (the-as uint arg4)) + (set! (-> arg0 pad 13) (the-as uint arg4)) + (set-hud-piece-position! (the-as hud-sprite (&-> arg0 pad 3)) arg2 arg3) + (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-1 (-> s4-1 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (&-> arg0 pad 3)) + s4-1 + (-> *level* default-level) + ) + (let ((a3-1 (-> s4-1 base))) + (let ((v1-20 (the-as object (-> s4-1 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! (-> s4-1 base) (&+ (the-as pointer v1-20) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s5-1 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + ) + ) + +(defun get-highscore-score ((arg0 int)) + "TODO - takes and returns an enum?" + (let ((v0-0 11)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (set! v0-0 4) + ) + ((= v1-0 1) + (set! v0-0 5) + ) + ((= v1-0 2) + (set! v0-0 6) + ) + ((= v1-0 3) + (set! v0-0 7) + ) + ((= v1-0 4) + (set! v0-0 10) + ) + ((= v1-0 5) + (set! v0-0 13) + ) + ((= v1-0 6) + (set! v0-0 12) + ) + ((= v1-0 7) + (set! v0-0 11) + ) + ((= v1-0 8) + (set! v0-0 14) + ) + ((= v1-0 9) + (set! v0-0 15) + ) + ((= v1-0 10) + (set! v0-0 18) + ) + ((= v1-0 11) + (set! v0-0 17) + ) + ((= v1-0 12) + (set! v0-0 16) + ) + ((= v1-0 13) + (set! v0-0 8) + ) + ((= v1-0 14) + (set! v0-0 9) + ) + ) + ) + v0-0 + ) + ) + +(defun eval-highscore ((arg0 print-highscore-obj)) + (get-rank (-> *highscore-info-array* (get-highscore-score (-> arg0 index))) (-> arg0 score)) + ) + +(defun str-print-time ((arg0 float)) + 0 + 0 + 0 + (let* ((gp-0 (the int (* 0.016666668 arg0))) + (v1-5 (- arg0 (* 60.0 (the float gp-0)))) + (s5-0 (the int v1-5)) + (v1-6 (- v1-5 (the float s5-0))) + (s3-0 (the int (* 1000.0 v1-6))) + ) + (format (clear *temp-string*) "~d:~2,'0,d:~3,'0,d" gp-0 s5-0 s3-0) + ) + *temp-string* + ) + +(defun print-highscore ((arg0 print-highscore-obj)) + (local-vars (sv-16 font-context) (sv-20 float) (sv-24 int) (sv-32 int) (sv-40 print-highscore-obj)) + (set! sv-16 (-> arg0 context)) + (set! sv-20 (-> arg0 interp)) + (set! sv-24 50) + (set! sv-32 (if (= (get-aspect-ratio) 'aspect4x3) + 320 + 300 + ) + ) + (set! sv-40 arg0) + (let ((a0-1 sv-16)) + (set! (-> a0-1 flags) (font-flags kerning large)) + ) + (+! (-> sv-16 origin x) (the float sv-24)) + (let ((v1-8 (-> sv-40 place))) + (cond + ((zero? v1-8) + (let ((gp-1 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-1st) #f)) + (gp-1 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 112) + 174 + 0.25 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 1) + (let ((v1-18 sv-16)) + (set! (-> v1-18 scale) 0.5) + ) + (set! (-> sv-16 origin y) (+ 23.0 (-> sv-16 origin y))) + (let ((gp-3 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-2nd) #f)) + (gp-3 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 111) + 197 + 0.22 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 2) + (let ((v1-31 sv-16)) + (set! (-> v1-31 scale) 0.4) + ) + (set! (-> sv-16 origin y) (+ 20.0 (-> sv-16 origin y))) + (let ((gp-5 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-3rd) #f)) + (gp-5 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 110) + 217 + 0.2 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 3) + (let ((v1-44 sv-16)) + (set! (-> v1-44 scale) 0.3) + ) + (set! (-> sv-16 origin y) (+ 15.0 (-> sv-16 origin y))) + (let ((gp-7 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-4th) #f)) + (gp-7 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 109) + 232 + 0.15 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 4) + (set! (-> sv-16 origin y) (+ 12.0 (-> sv-16 origin y))) + (let ((gp-9 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-5th) #f)) + (gp-9 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 109) + 244 + 0.15 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 5) + (set! (-> sv-16 origin y) (+ 12.0 (-> sv-16 origin y))) + (let ((gp-11 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-6th) #f)) + (gp-11 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 109) + 256 + 0.15 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 6) + (set! (-> sv-16 origin y) (+ 12.0 (-> sv-16 origin y))) + (let ((gp-13 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-7th) #f)) + (gp-13 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 109) + 268 + 0.15 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 7) + (set! (-> sv-16 origin y) (+ 12.0 (-> sv-16 origin y))) + (let ((gp-15 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-8th) #f)) + (gp-15 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 109) + 280 + 0.15 + (-> sv-40 local-scale) + ) + ) + ) + ) + ) + (+! (-> sv-16 origin x) (the float sv-32)) + (let ((a0-67 sv-16)) + (set! (-> a0-67 flags) (font-flags kerning right large)) + ) + (cond + ((-> sv-40 game-score) + (let ((gp-17 print-game-text)) + (format (clear *temp-string*) "~D" (the int (-> sv-40 score))) + (gp-17 *temp-string* sv-16 #f 44 320) + ) + ) + (else + (print-game-text (str-print-time (-> sv-40 score)) sv-16 #f 44 320) + ) + ) + (let ((a0-73 sv-16)) + (set! (-> a0-73 flags) (font-flags kerning large)) + ) + (set! (-> sv-16 origin x) (- (-> sv-16 origin x) (the float (+ sv-24 sv-32)))) + ) + +;; WARN: Return type mismatch int vs game-text-id. +(defun get-highscore-text ((arg0 int)) + "TODO - takes an enum?" + (let ((v0-0 319)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (set! v0-0 323) + ) + ((= v1-0 1) + (set! v0-0 323) + ) + ((= v1-0 2) + (set! v0-0 323) + ) + ((= v1-0 3) + (set! v0-0 323) + ) + ((= v1-0 4) + (set! v0-0 330) + ) + ((= v1-0 5) + (set! v0-0 319) + ) + ((= v1-0 6) + (set! v0-0 319) + ) + ((= v1-0 7) + (set! v0-0 319) + ) + ((= v1-0 8) + (set! v0-0 319) + ) + ((= v1-0 9) + (set! v0-0 319) + ) + ((= v1-0 10) + (set! v0-0 319) + ) + ((= v1-0 11) + (set! v0-0 319) + ) + ((= v1-0 12) + (set! v0-0 319) + ) + ((= v1-0 13) + (set! v0-0 328) + ) + ((= v1-0 14) + (set! v0-0 329) + ) + ) + ) + (the-as game-text-id v0-0) + ) + ) + +;; WARN: Return type mismatch int vs game-text-id. +(defun get-highscore-text-sub ((arg0 int)) + "TODO - takes an enum?" + (let ((v0-0 320)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (set! v0-0 324) + ) + ((= v1-0 1) + (set! v0-0 325) + ) + ((= v1-0 2) + (set! v0-0 326) + ) + ((= v1-0 3) + (set! v0-0 327) + ) + ((= v1-0 4) + (set! v0-0 333) + ) + ((= v1-0 5) + (set! v0-0 322) + ) + ((= v1-0 6) + (set! v0-0 321) + ) + ((= v1-0 7) + (set! v0-0 320) + ) + ((= v1-0 8) + (set! v0-0 337) + ) + ((= v1-0 9) + (set! v0-0 338) + ) + ((= v1-0 10) + (set! v0-0 336) + ) + ((= v1-0 11) + (set! v0-0 335) + ) + ((= v1-0 12) + (set! v0-0 334) + ) + ((= v1-0 13) + (set! v0-0 331) + ) + ((= v1-0 14) + (set! v0-0 332) + ) + ) + ) + (the-as game-text-id v0-0) + ) + ) + +(defun get-highscore-icon ((arg0 int)) + "TODO - Icon id enum perhaps?" + (let ((v0-0 (the-as uint #xc9301000))) + (let ((v1-1 arg0)) + (cond + ((zero? v1-1) + (set! v0-0 (the-as uint #xc9301000)) + ) + ((= v1-1 1) + (set! v0-0 (the-as uint #xc9301200)) + ) + ((= v1-1 2) + (set! v0-0 (the-as uint #xc9301300)) + ) + ((= v1-1 3) + (set! v0-0 (the-as uint #xc9301100)) + ) + ((= v1-1 4) + (set! v0-0 (the-as uint #xc9300e00)) + ) + ((= v1-1 5) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 6) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 7) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 8) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 9) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 10) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 11) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 12) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 13) + (set! v0-0 (the-as uint #xc9301600)) + ) + ((= v1-1 14) + (set! v0-0 (the-as uint #xc9301700)) + ) + ) + ) + v0-0 + ) + ) + +(defun get-highscore-type ((arg0 int)) + "TODO - takes an enum?" + (let ((v0-0 'game)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (set! v0-0 'game) + ) + ((= v1-0 5) + (set! v0-0 'race) + ) + ((= v1-0 6) + (set! v0-0 'race) + ) + ((= v1-0 7) + (set! v0-0 'race) + ) + ((= v1-0 8) + (set! v0-0 'race) + ) + ((= v1-0 9) + (set! v0-0 'race) + ) + ((= v1-0 10) + (set! v0-0 'race) + ) + ((= v1-0 11) + (set! v0-0 'race) + ) + ((= v1-0 12) + (set! v0-0 'race) + ) + ((= v1-0 13) + (set! v0-0 'game) + ) + ) + ) + v0-0 + ) + ) + +(defun highscore-available? ((arg0 int)) + (let ((v0-0 #f)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (set! v0-0 #t) + ) + ((= v1-0 1) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 75 flags) (game-task-node-flag closed))) + ) + ((= v1-0 2) + (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets gungame-blue))) + ) + ((= v1-0 3) + (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets gungame-dark))) + ) + ((= v1-0 4) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 63 flags) (game-task-node-flag closed))) + ) + ((= v1-0 5) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 135 flags) (game-task-node-flag closed))) + ) + ((= v1-0 6) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 181 flags) (game-task-node-flag closed))) + ) + ((= v1-0 7) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 209 flags) (game-task-node-flag closed))) + ) + ((= v1-0 8) + (set! v0-0 (or (logtest? (-> *game-info* sub-task-list 308 flags) (game-task-node-flag closed)) + (open? (-> *game-info* sub-task-list 308)) + ) + ) + ) + ((= v1-0 9) + (set! v0-0 (or (logtest? (-> *game-info* sub-task-list 306 flags) (game-task-node-flag closed)) + (open? (-> *game-info* sub-task-list 306)) + ) + ) + ) + ((= v1-0 10) + (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets reverse-races))) + ) + ((= v1-0 11) + (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets reverse-races))) + ) + ((= v1-0 12) + (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets reverse-races))) + ) + ((= v1-0 13) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 149 flags) (game-task-node-flag closed))) + ) + ((= v1-0 14) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 224 flags) (game-task-node-flag closed))) + ) + ) + ) + v0-0 + ) + ) + +(defun get-num-highscores () + (let ((gp-0 0)) + (dotimes (s5-0 15) + (if (highscore-available? s5-0) + (+! gp-0 1) + ) + ) + gp-0 + ) + ) + +(defun get-next-highscore ((arg0 int)) + (let ((s4-0 15) + (s3-0 1) + (gp-0 -1) + ) + (+ arg0 s3-0) + (while (and (= gp-0 -1) (< s3-0 s4-0)) + (let ((s2-0 (+ arg0 s3-0))) + (+! s3-0 1) + (if (highscore-available? (mod s2-0 s4-0)) + (set! gp-0 (mod s2-0 s4-0)) + ) + ) + ) + (if (= gp-0 -1) + (set! gp-0 arg0) + ) + gp-0 + ) + ) + +(defun get-prev-highscore ((arg0 int)) + (let ((s4-0 15) + (s3-0 1) + (gp-0 -1) + ) + (+ arg0 s3-0) + (while (and (= gp-0 -1) (< s3-0 s4-0)) + (let ((s2-0 (- arg0 s3-0))) + (+! s3-0 1) + (if (< s2-0 0) + (set! s2-0 (+ s4-0 s2-0)) + ) + (let ((t9-0 highscore-available?) + (a0-1 (abs s2-0)) + ) + (if (t9-0 a0-1) + (set! gp-0 (abs s2-0)) + ) + ) + ) + ) + (if (= gp-0 -1) + (set! gp-0 arg0) + ) + gp-0 + ) + ) + +(defun get-highscore-icon-scale ((arg0 int)) + "TODO - takes an enum?" + (let ((f0-0 (if (= (get-aspect-ratio) 'aspect4x3) + 1.0 + 1.0 + ) + ) + ) + (let ((f2-0 0.6) + (f1-0 0.8) + ) + (cond + ((zero? arg0) + (set! f0-0 f2-0) + ) + ((= arg0 1) + (set! f0-0 f2-0) + ) + ((= arg0 2) + (set! f0-0 f2-0) + ) + ((= arg0 3) + (set! f0-0 f2-0) + ) + ((= arg0 4) + (set! f0-0 0.5) + ) + ((= arg0 5) + (set! f0-0 f1-0) + ) + ((= arg0 6) + (set! f0-0 f1-0) + ) + ((= arg0 7) + (set! f0-0 f1-0) + ) + ((= arg0 8) + (set! f0-0 f1-0) + ) + ((= arg0 9) + (set! f0-0 f1-0) + ) + ((= arg0 10) + (set! f0-0 f1-0) + ) + ((= arg0 11) + (set! f0-0 f1-0) + ) + ((= arg0 12) + (set! f0-0 f1-0) + ) + ((= arg0 13) + (set! f0-0 0.7) + ) + ((= arg0 14) + (set! f0-0 0.7) + ) + ) + ) + f0-0 + ) + ) + +(defun get-highscore-icon-xoffset ((arg0 int)) + (if (= (get-aspect-ratio) 'aspect4x3) + 435 + 410 + ) + ) + +(defun get-highscore-icon-yoffset ((arg0 int)) + "TODO - takes an enum?" + (let ((v0-1 (if (= (get-aspect-ratio) 'aspect4x3) + 130 + 120 + ) + ) + ) + (let ((a0-1 130) + (v1-0 120) + ) + (cond + ((zero? arg0) + (set! v0-1 a0-1) + ) + ((= arg0 1) + (set! v0-1 a0-1) + ) + ((= arg0 2) + (set! v0-1 a0-1) + ) + ((= arg0 3) + (set! v0-1 a0-1) + ) + ((= arg0 5) + (set! v0-1 v1-0) + ) + ((= arg0 6) + (set! v0-1 v1-0) + ) + ((= arg0 7) + (set! v0-1 v1-0) + ) + ((= arg0 8) + (set! v0-1 v1-0) + ) + ((= arg0 9) + (set! v0-1 v1-0) + ) + ((= arg0 10) + (set! v0-1 v1-0) + ) + ((= arg0 11) + (set! v0-1 v1-0) + ) + ((= arg0 12) + (set! v0-1 v1-0) + ) + ((= arg0 13) + (set! v0-1 125) + ) + ((= arg0 14) + (set! v0-1 125) + ) + ) + ) + v0-1 + ) + ) + +(defmethod menu-option-method-10 menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (sv-96 float) + (sv-100 float) + (sv-104 float) + (sv-108 float) + (sv-112 hud-box) + (sv-116 print-highscore-obj) + (sv-120 float) + (sv-124 float) + (sv-128 symbol) + (sv-132 int) + (sv-136 progress) + (sv-140 font-context) + (sv-144 menu-highscores-option) + ) + (set! sv-96 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (set! sv-100 0.22) + (set! sv-104 395.0) + (set! sv-108 (-> arg1 origin x)) + (set! sv-112 (new 'stack-no-clear 'hud-box)) + (set! sv-116 (new 'stack 'print-highscore-obj)) + (set! sv-120 (* (-> arg0 sliding) sv-104)) + (set! sv-124 (* (-> arg0 sliding-off) (-> obj slide-dir) sv-104)) + (set! sv-128 arg3) + (set! sv-132 arg2) + (set! sv-136 arg0) + (set! sv-140 arg1) + (set! sv-144 obj) + (if (< sv-96 0.0) + (set! sv-96 (the-as float 0.0)) + ) + (cond + ((not (-> *bigmap* progress-minimap)) + (draw-busy-loading sv-140) + ) + (else + (set! (-> sv-140 alpha) sv-96) + (let ((v1-16 sv-140)) + (set! (-> v1-16 scale) 1.0) + ) + (let ((a0-4 sv-140)) + (set! (-> a0-4 flags) (font-flags kerning middle large)) + ) + (let ((a0-5 sv-140)) + (set! (-> a0-5 color) (font-color #7efbfb)) + ) + (set! (-> sv-140 origin x) 59.0) + (set! (-> sv-140 origin y) 78.0) + (let ((v1-23 sv-140)) + (set! (-> v1-23 width) sv-104) + ) + (let ((v1-24 sv-140)) + (set! (-> v1-24 height) 215.0) + ) + (begin-scissor sv-112 sv-136) + (set! (-> sv-144 sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xc93))) + (set! (-> sv-144 sprites 0 flags) (the-as uint 4)) + (set! (-> sv-144 sprites 0 scale-x) sv-100) + (set! (-> sv-144 sprites 0 scale-y) sv-100) + (set-vector! (-> sv-144 sprites 0 color) 128 128 128 (the int (* 128.0 sv-96))) + (set! (-> sv-144 sprites 0 pos z) #xfffff0) + (set! (-> sv-144 sprites 0 pos w) 0) + (if (= (-> *setting-control* user-default language) (language-enum spanish)) + (draw-decoration sv-144 sv-140 sv-96 310 #t 0.8) + (draw-decoration sv-144 sv-140 sv-96 310 #t 0.95) + ) + (let ((v1-39 sv-140)) + (set! (-> v1-39 scale) 0.6) + ) + (let ((v1-40 sv-140)) + (set! (-> v1-40 height) 185.0) + ) + (set! (-> sv-140 origin y) (+ 46.0 (-> sv-140 origin y))) + (set! (-> sv-140 origin x) 65.0) + (let ((v1-46 sv-140)) + (set! (-> v1-46 width) (the float (the-as float #x16f))) + ) + (let ((a0-23 sv-140)) + (set! (-> a0-23 flags) (font-flags kerning large)) + ) + (let ((a0-24 sv-140)) + (set! (-> a0-24 color) (font-color #f9f9f9)) + ) + (set! (-> sv-140 origin x) (+ 20.0 sv-120 (-> sv-140 origin x))) + (let ((v1-53 sv-140)) + (set! (-> v1-53 scale) 0.75) + ) + (when (= (-> *setting-control* user-default language) (language-enum german)) + (let ((v1-56 sv-140)) + (set! (-> v1-56 scale) 0.69) + ) + ) + (when (= (-> *setting-control* user-default language) (language-enum french)) + (let ((v1-59 sv-140)) + (set! (-> v1-59 scale) 0.72) + ) + ) + (when (= (-> *setting-control* user-default language) (language-enum spanish)) + (let ((v1-62 sv-140)) + (set! (-> v1-62 scale) 0.65) + ) + ) + (let ((gp-1 print-game-text)) + (format + (clear *temp-string*) + "~S" + (lookup-text! *common-text* (get-highscore-text (-> sv-144 page-index)) #f) + ) + (gp-1 *temp-string* sv-140 #f 44 320) + ) + (set! (-> sv-140 origin y) (+ 25.0 (-> sv-140 origin y))) + (let ((v1-68 sv-140)) + (set! (-> v1-68 scale) 0.6) + ) + (when (or (= (-> *setting-control* user-default language) (language-enum french)) + (= (-> *setting-control* user-default language) (language-enum spanish)) + ) + (let ((v1-76 sv-140)) + (set! (-> v1-76 scale) 0.58) + ) + ) + (let ((gp-2 print-game-text)) + (format + (clear *temp-string*) + "~S" + (lookup-text! *common-text* (get-highscore-text-sub (-> sv-144 page-index)) #f) + ) + (gp-2 *temp-string* sv-140 #f 44 320) + ) + (set! (-> sv-140 origin x) (- (-> sv-140 origin x) (+ 20.0 sv-120))) + (set! (-> sv-140 origin y) (+ 25.0 (-> sv-140 origin y))) + (draw-highscore-icon + sv-144 + (get-highscore-icon (-> sv-144 page-index)) + (the int (+ (the float (get-highscore-icon-xoffset (-> sv-144 page-index))) sv-120)) + (get-highscore-icon-yoffset (-> sv-144 page-index)) + (get-highscore-icon-scale (-> sv-144 page-index)) + ) + (set! sv-108 (-> sv-140 origin x)) + (let ((a0-54 sv-140)) + (set! (-> a0-54 color) (font-color #7efbfb)) + ) + (+! (-> sv-140 origin x) sv-120) + (let ((v1-96 sv-140)) + (set! (-> v1-96 scale) 0.6) + ) + (let ((gp-5 (get-game-score-ref *game-info* (get-highscore-score (-> sv-144 page-index))))) + (set! (-> sv-116 index) (-> sv-144 page-index)) + (set! (-> sv-116 previous) #f) + (set! (-> sv-116 self) (the-as texture-page sv-144)) + (case (get-highscore-type (-> sv-144 page-index)) + (('game) + (set! (-> sv-116 game-score) (the-as basic #t)) + ) + (('race) + (set! (-> sv-116 game-score) #f) + ) + ) + (set! (-> sv-116 context) sv-140) + (set! (-> sv-116 local-scale) sv-96) + (set! (-> sv-116 interp) sv-120) + (dotimes (s5-5 8) + (set! (-> sv-116 place) s5-5) + (set! (-> sv-116 score) (-> gp-5 s5-5)) + (print-highscore sv-116) + ) + ) + (set! (-> sv-140 origin x) sv-108) + (let ((v1-120 sv-140)) + (set! (-> v1-120 scale) 0.6) + ) + (set! (-> sv-140 origin x) 59.0) + (set! (-> sv-140 origin y) 78.0) + (let ((v1-125 sv-140)) + (set! (-> v1-125 width) sv-104) + ) + (let ((v1-126 sv-140)) + (set! (-> v1-126 height) 215.0) + ) + (let ((v1-127 sv-140)) + (set! (-> v1-127 scale) 0.5) + ) + (let ((v1-128 sv-140)) + (set! (-> v1-128 height) 185.0) + ) + (set! (-> sv-140 origin y) (+ 46.0 (-> sv-140 origin y))) + (set! (-> sv-140 origin x) 80.0) + (set! (-> sv-144 sprites 0 pos z) #xffffff) + (let ((v1-135 sv-140)) + (set! (-> v1-135 width) sv-104) + ) + (let ((a0-74 sv-140)) + (set! (-> a0-74 flags) (font-flags kerning large)) + ) + (let ((a0-75 sv-140)) + (set! (-> a0-75 color) (font-color #f9f9f9)) + ) + (set! (-> sv-140 origin x) (+ 20.0 sv-124 (-> sv-140 origin x))) + (let ((v1-142 sv-140)) + (set! (-> v1-142 scale) 0.75) + ) + (when (= (-> *setting-control* user-default language) (language-enum german)) + (let ((v1-145 sv-140)) + (set! (-> v1-145 scale) 0.69) + ) + ) + (when (= (-> *setting-control* user-default language) (language-enum french)) + (let ((v1-148 sv-140)) + (set! (-> v1-148 scale) 0.72) + ) + ) + (when (= (-> *setting-control* user-default language) (language-enum spanish)) + (let ((v1-151 sv-140)) + (set! (-> v1-151 scale) 0.65) + ) + ) + (let ((gp-6 print-game-text)) + (format + (clear *temp-string*) + "~S" + (lookup-text! *common-text* (get-highscore-text (-> sv-144 prev-page-index)) #f) + ) + (gp-6 *temp-string* sv-140 #f 44 320) + ) + (set! (-> sv-140 origin y) (+ 25.0 (-> sv-140 origin y))) + (let ((v1-157 sv-140)) + (set! (-> v1-157 scale) 0.6) + ) + (when (or (= (-> *setting-control* user-default language) (language-enum french)) + (= (-> *setting-control* user-default language) (language-enum spanish)) + ) + (let ((v1-165 sv-140)) + (set! (-> v1-165 scale) 0.58) + ) + ) + (let ((gp-7 print-game-text)) + (format + (clear *temp-string*) + "~S" + (lookup-text! *common-text* (get-highscore-text-sub (-> sv-144 prev-page-index)) #f) + ) + (gp-7 *temp-string* sv-140 #f 44 320) + ) + (set! (-> sv-140 origin x) (- (-> sv-140 origin x) (+ 20.0 sv-124))) + (set! (-> sv-140 origin y) (+ 25.0 (-> sv-140 origin y))) + (draw-highscore-icon + sv-144 + (get-highscore-icon (-> sv-144 prev-page-index)) + (the int (+ (the float (get-highscore-icon-xoffset (-> sv-144 page-index))) sv-124)) + (get-highscore-icon-yoffset (-> sv-144 page-index)) + (get-highscore-icon-scale (-> sv-144 page-index)) + ) + (set! sv-108 (-> sv-140 origin x)) + (let ((a0-105 sv-140)) + (set! (-> a0-105 color) (font-color #7efbfb)) + ) + (+! (-> sv-140 origin x) sv-124) + (let ((v1-185 sv-140)) + (set! (-> v1-185 scale) 0.6) + ) + (when (< 1 (get-num-highscores)) + (let ((gp-11 (get-game-score-ref *game-info* (get-highscore-score (-> sv-144 prev-page-index))))) + (set! (-> sv-116 index) (-> sv-144 prev-page-index)) + (set! (-> sv-116 previous) (the-as texture-page #t)) + (set! (-> sv-116 self) (the-as texture-page sv-144)) + (case (get-highscore-type (-> sv-144 prev-page-index)) + (('game) + (set! (-> sv-116 game-score) (the-as basic #t)) + ) + (('race) + (set! (-> sv-116 game-score) #f) + ) + ) + (set! (-> sv-116 context) sv-140) + (set! (-> sv-116 local-scale) sv-96) + (set! (-> sv-116 interp) sv-120) + (dotimes (s5-10 8) + (set! (-> sv-116 place) s5-10) + (set! (-> sv-116 score) (-> gp-11 s5-10)) + (print-highscore sv-116) + ) + ) + (set! (-> sv-140 origin x) sv-108) + (let ((v1-210 sv-140)) + (set! (-> v1-210 scale) 0.6) + ) + ) + (if (< 1 (get-num-highscores)) + (draw-previous-next sv-144 sv-140 #t) + ) + (end-scissor sv-112 1.0) + ) + ) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-on-off-game-vibrations-option ((obj menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-10 string)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((v1-4 arg1)) + (set! (-> v1-4 scale) 0.65) + ) + (set! (-> arg1 origin y) (+ 15.0 (-> arg1 origin y))) + (let ((s3-0 (-> *progress-state* game-options-vibrations))) + (cond + ((and (zero? (-> *progress-state* game-options-item-selected)) (-> *progress-state* game-options-item-picked)) + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 41 f30-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + (s3-0 + (format + (clear *temp-string*) + "~33L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-10 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-10 *temp-string*) + ) + ) + ) + (else + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (cond + ((zero? (-> *progress-state* game-options-item-selected)) + (let ((s2-3 arg1)) + (set! (-> s2-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 22 f30-0) + ) + (else + (let ((a0-17 arg1)) + (set! (-> a0-17 color) (font-color #7efbfb)) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + (s3-0 + (format + (clear *temp-string*) + "~1L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-10 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~1L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-10 *temp-string*) + ) + ) + ) + ) + ) + ) + (print-menu-text a0-10 (-> obj scale) arg1 arg0) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-on-off-game-subtitles-option ((obj menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-11 string)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((v1-4 arg1)) + (set! (-> v1-4 scale) 0.65) + ) + (set! (-> arg1 origin y) (+ 22.0 (-> arg1 origin y))) + (let ((s3-0 (-> *progress-state* game-options-subtitles))) + (cond + ((and (= (-> *progress-state* game-options-item-selected) 1) (-> *progress-state* game-options-item-picked)) + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-3 arg1)) + (set! (-> a0-3 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 41 f30-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + (s3-0 + (format + (clear *temp-string*) + "~33L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + ) + ) + (else + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (cond + ((= (-> *progress-state* game-options-item-selected) 1) + (let ((s2-3 arg1)) + (set! (-> s2-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 22 f30-0) + ) + (else + (let ((a0-20 arg1)) + (set! (-> a0-20 color) (font-color #7efbfb)) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + (s3-0 + (format + (clear *temp-string*) + "~1L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~1L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + ) + ) + ) + ) + ) + (print-menu-text a0-11 (-> obj scale) arg1 arg0) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-subtitle-language-game-option ((obj menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (with-pp + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.65) + ) + (case arg2 + ((2) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + ) + ((3) + (set! (-> arg1 origin y) (+ 32.0 (-> arg1 origin y))) + ) + ) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((a0-5 arg1)) + (set! (-> a0-5 flags) (font-flags kerning middle large)) + ) + (let ((s4-0 (&-> *setting-control* user-default subtitle-language))) + (cond + ((and (= (-> *progress-state* game-options-item-selected) 2) (-> *progress-state* game-options-item-picked)) + (let ((a0-7 arg1)) + (set! (-> a0-7 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (-> arg1 origin y)) 44 f30-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 24.0 (-> arg1 origin y))) + (-> obj language-selection) + (let ((s4-1 (-> s4-0 0))) + 7 + (if (-> obj language-transition) + (seekl! (-> obj language-x-offset) 150 (the int (* 10.0 (-> pp clock time-adjust-ratio)))) + ) + (when (>= (-> obj language-x-offset) 75) + (set! (-> obj language-selection) (the-as uint s4-1)) + (set! (-> obj language-transition) #f) + (set! (-> obj language-x-offset) 0) + 0 + ) + ) + (let ((a0-12 arg1)) + (set! (-> a0-12 color) (font-color #7efbfb)) + ) + (let ((v1-33 arg1)) + (set! (-> v1-33 scale) 0.5) + ) + (let ((a0-14 arg1)) + (set! (-> a0-14 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x))) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 163) + (s5-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) (+ 70.0 (-> arg1 origin x))) + (set! (-> arg1 origin x) (+ 70.0 (-> arg1 origin x))) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) "~33L~C" 161) + (s5-2 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x))) + (let ((s5-3 arg1)) + (set! (-> s5-3 color) (the-as font-color (progress-selected 0))) + ) + (let ((v1-43 (if (and (= (scf-get-territory) 1) (zero? (-> *progress-state* game-options-subtitle-language-index))) + 7 + (-> *progress-state* game-options-subtitle-language-index) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> *language-name-remap* v1-43) #f) arg1 #f 44 320) + ) + ) + (else + (cond + ((= (-> *progress-state* game-options-item-selected) 2) + (let ((s4-4 arg1)) + (set! (-> s4-4 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (-> arg1 origin y)) 24 f30-0) + ) + (else + (let ((a0-31 arg1)) + (set! (-> a0-31 color) (font-color #7efbfb)) + ) + ) + ) + (let ((v1-52 arg1)) + (set! (-> v1-52 scale) 0.65) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (let ((v1-54 arg1)) + (set! (-> v1-54 scale) 0.5) + ) + (let ((a0-36 arg1)) + (set! (-> a0-36 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin y) (+ 24.0 (-> arg1 origin y))) + (let ((a0-37 arg1)) + (set! (-> a0-37 flags) (font-flags kerning middle large)) + ) + (let ((v1-61 (if (and (= (scf-get-territory) 1) (zero? (-> *progress-state* game-options-subtitle-language-index))) + 7 + (-> *progress-state* game-options-subtitle-language-index) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> *language-name-remap* v1-61) #f) arg1 #f 44 320) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod menu-option-method-10 menu-language-game-option ((obj menu-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (with-pp + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.65) + ) + (case arg2 + ((2) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + ) + ((3) + (set! (-> arg1 origin y) (+ 32.0 (-> arg1 origin y))) + ) + ) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((a0-5 arg1)) + (set! (-> a0-5 flags) (font-flags kerning middle large)) + ) + (let ((s4-0 (&-> *setting-control* user-default language))) + (cond + ((and (= (-> *progress-state* game-options-item-selected) 3) (-> *progress-state* game-options-item-picked)) + (let ((a0-7 arg1)) + (set! (-> a0-7 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (-> arg1 origin y)) 44 f30-0) + (let ((s3-0 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (s3-0 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 24.0 (-> arg1 origin y))) + (-> obj language-selection) + (let ((s4-1 (-> s4-0 0))) + 7 + (if (-> obj language-transition) + (seekl! (-> obj language-x-offset) 150 (the int (* 10.0 (-> pp clock time-adjust-ratio)))) + ) + (when (>= (-> obj language-x-offset) 75) + (set! (-> obj language-selection) (the-as uint s4-1)) + (set! (-> obj language-transition) #f) + (set! (-> obj language-x-offset) 0) + 0 + ) + ) + (let ((a0-14 arg1)) + (set! (-> a0-14 color) (font-color #7efbfb)) + ) + (let ((v1-33 arg1)) + (set! (-> v1-33 scale) 0.5) + ) + (let ((a0-16 arg1)) + (set! (-> a0-16 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x))) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 163) + (s5-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) (+ 70.0 (-> arg1 origin x))) + (set! (-> arg1 origin x) (+ 70.0 (-> arg1 origin x))) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) "~33L~C" 161) + (s5-2 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x))) + (let ((s5-3 arg1)) + (set! (-> s5-3 color) (the-as font-color (progress-selected 0))) + ) + (let ((v1-43 (if (and (= (scf-get-territory) 1) (zero? (-> *progress-state* game-options-language-index))) + 7 + (-> *progress-state* game-options-language-index) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> *language-name-remap* v1-43) #f) arg1 #f 44 320) + ) + ) + (else + (cond + ((= (-> *progress-state* game-options-item-selected) 3) + (let ((s3-1 arg1)) + (set! (-> s3-1 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (-> arg1 origin y)) 24 f30-0) + ) + (else + (let ((a0-33 arg1)) + (set! (-> a0-33 color) (font-color #7efbfb)) + ) + ) + ) + (let ((v1-52 arg1)) + (set! (-> v1-52 scale) 0.65) + ) + (let ((s3-2 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (s3-2 *temp-string* arg1 #f 44 320) + ) + (let ((v1-54 arg1)) + (set! (-> v1-54 scale) 0.5) + ) + (let ((a0-40 arg1)) + (set! (-> a0-40 color) (font-color #7efbfb)) + ) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> *language-name-remap* (-> s4-0 0)) #f)) + *temp-string* + (set! (-> arg1 origin y) (+ 24.0 (-> arg1 origin y))) + (let ((a0-44 arg1)) + (set! (-> a0-44 flags) (font-flags kerning middle large)) + ) + (let ((v1-66 (if (and (= (scf-get-territory) 1) (zero? (-> *progress-state* game-options-language-index))) + 7 + (-> *progress-state* game-options-language-index) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> *language-name-remap* v1-66) #f) arg1 #f 44 320) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod menu-option-method-10 menu-sub-menu-game-option ((obj menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + 395.0 + (-> arg1 origin y) + (-> arg1 scale) + (if (< f0-1 0.0) + (set! f0-1 0.0) + ) + (set! (-> arg1 alpha) f0-1) + (let ((a1-1 arg1)) + (set! (-> a1-1 flags) (font-flags kerning middle large)) + ) + (if (= (-> *setting-control* user-default language) (language-enum spanish)) + (draw-decoration obj arg1 f0-1 283 #f 0.85) + (draw-decoration obj arg1 f0-1 283 #f 0.95) + ) + ) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-aspect-ratio-option ((obj menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-12 string)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((a0-1 arg1)) + (set! (-> a0-1 flags) (font-flags kerning middle large)) + ) + (let ((v1-5 arg1)) + (set! (-> v1-5 scale) 0.75) + ) + (set! (-> arg1 height) 35.0) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + (let ((s3-0 (-> *progress-state* graphic-options-aspect-ratio))) + (cond + ((and (= (-> *progress-state* graphic-options-item-selected) 1) + (-> *progress-state* graphic-options-item-picked) + ) + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-4 arg1)) + (set! (-> a0-4 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 42 f30-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 23.0 (-> arg1 origin y))) + (cond + ((= s3-0 'aspect4x3) + (format + (clear *temp-string*) + "~33L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-aspect-4x3) #f) + (lookup-text! *common-text* (game-text-id progress-aspect-16x9) #f) + ) + (set! a0-12 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-aspect-4x3) #f) + (lookup-text! *common-text* (game-text-id progress-aspect-16x9) #f) + ) + (set! a0-12 *temp-string*) + ) + ) + ) + (else + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (when (not (and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + ) + (cond + ((= (-> *progress-state* graphic-options-item-selected) 1) + (let ((s2-3 arg1)) + (set! (-> s2-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 25 f30-0) + ) + (else + (let ((a0-21 arg1)) + (set! (-> a0-21 color) (font-color #7efbfb)) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 23.0 (-> arg1 origin y))) + (cond + ((= s3-0 'aspect4x3) + (format + (clear *temp-string*) + "~1L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-aspect-4x3) #f) + (lookup-text! *common-text* (game-text-id progress-aspect-16x9) #f) + ) + (set! a0-12 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~1L~S~1L" + (lookup-text! *common-text* (game-text-id progress-aspect-4x3) #f) + (lookup-text! *common-text* (game-text-id progress-aspect-16x9) #f) + ) + (set! a0-12 *temp-string*) + ) + ) + ) + ) + ) + (if (not (and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + ) + (print-menu-text a0-12 (-> obj scale) arg1 arg0) + ) + (draw-decoration obj arg1 f30-0 284 #f 0.95) + ) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-on-off-progressive-scan-graphic-option ((obj menu-on-off-progressive-scan-graphic-option) + (arg0 progress) + (arg1 font-context) + (arg2 int) + (arg3 symbol) + ) + (local-vars (a0-11 string)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((v1-4 arg1)) + (set! (-> v1-4 scale) 0.75) + ) + (set! (-> arg1 height) 35.0) + (set! (-> arg1 origin y) (+ 35.0 (-> arg1 origin y))) + (let ((s3-0 (-> *progress-state* graphic-options-progressive-scan))) + (cond + ((and (= (-> *progress-state* graphic-options-item-selected) 2) + (-> *progress-state* graphic-options-item-picked) + ) + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-3 arg1)) + (set! (-> a0-3 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 42 f30-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + (s3-0 + (format + (clear *temp-string*) + "~33L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + ) + ) + (else + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (when (not (and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + ) + (cond + ((= (-> *progress-state* graphic-options-item-selected) 2) + (let ((s2-3 arg1)) + (set! (-> s2-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 24 f30-0) + ) + (else + (let ((a0-20 arg1)) + (set! (-> a0-20 color) (font-color #7efbfb)) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + (s3-0 + (format + (clear *temp-string*) + "~1L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~1L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + ) + ) + ) + ) + ) + (if (not (and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + ) + (print-menu-text a0-11 (-> obj scale) arg1 arg0) + ) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-center-screen-graphic-option ((obj menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (set! (-> arg1 height) 35.0) + (let ((v1-5 arg1)) + (set! (-> v1-5 scale) 0.75) + ) + (cond + ((and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + (let ((v1-10 arg1)) + (set! (-> v1-10 scale) 0.6) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 color) (font-color #f9f9f9)) + ) + (set! (-> arg1 width) 350.0) + (set! (-> arg1 height) 60.0) + (set! (-> arg1 origin x) 80.0) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg1 origin y) (+ 5.0 (-> arg1 origin y))) + ) + (('aspect16x9) + (set! (-> arg1 origin y) (+ 30.0 (-> arg1 origin y))) + ) + ) + (when (= (-> *setting-control* user-default language) (language-enum french)) + (let ((v1-23 arg1)) + (set! (-> v1-23 scale) 0.55) + ) + ) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 160) + (s5-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 21.0 (-> arg1 origin y))) + (let ((s5-2 print-game-text)) + (format + (clear *temp-string*) + "~33L~C~34L~S~33L~C" + 163 + (lookup-text! *common-text* (game-text-id progress-move-dpad) #f) + 161 + ) + (s5-2 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 21.0 (-> arg1 origin y))) + (let ((s5-3 print-game-text)) + (format (clear *temp-string*) "~33L~C" 162) + (s5-3 *temp-string* arg1 #f 44 320) + ) + (+! (-> arg1 origin y) + (the float (if (and (= (-> *progress-state* starting-state) 'title) (= (scf-get-territory) 1)) + 100 + 80 + ) + ) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg1 origin y) (+ -3.0 (-> arg1 origin y))) + ) + (('aspect16x9) + (set! (-> arg1 origin y) (+ 10.0 (-> arg1 origin y))) + ) + ) + (let ((v1-37 arg1)) + (set! (-> v1-37 scale) 0.5) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-unknown-square-to-reset) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (set! (-> arg1 origin y) (+ 5.0 (-> arg1 origin y))) + (cond + ((zero? (-> *progress-state* graphic-options-item-selected)) + (let ((s4-3 arg1)) + (set! (-> s4-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 25 f30-0) + ) + (else + (let ((a0-31 arg1)) + (set! (-> a0-31 color) (font-color #7efbfb)) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + ) + ) + ) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-restart-mission-qr-option ((obj menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-11 string)) + (let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f0-1 0.0) + (set! f0-1 0.0) + ) + (set! (-> arg1 alpha) f0-1) + (let ((v1-4 arg1)) + (set! (-> v1-4 scale) 0.75) + ) + (set! (-> arg1 height) 35.0) + (set! (-> arg1 origin y) (+ 5.0 (-> arg1 origin y))) + (let ((s4-0 (&-> *progress-state* yes-no-choice))) + (set! a0-11 + (cond + ((and (zero? (-> *progress-state* qr-options-item-selected)) (-> *progress-state* qr-options-item-picked)) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 50 f0-1) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 25.0 (-> arg1 origin y))) + (let ((v1-17 arg1)) + (set! (-> v1-17 scale) 0.6) + ) + (cond + ((-> s4-0 0) + (format + (clear *temp-string*) + "~33L~S~32L ~S" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-11 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~32L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-11 *temp-string*) + ) + ) + a0-11 + ) + (else + (if (and (= (-> arg0 option-index) arg2) (zero? (-> *progress-state* qr-options-item-selected))) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 26 f0-1) + ) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + *temp-string* + ) + ) + ) + ) + ) + (print-game-text a0-11 arg1 #f 44 320) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-quit-qr-option ((obj menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-12 string)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((v1-4 arg1)) + (set! (-> v1-4 scale) 0.75) + ) + (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) + (set! (-> arg1 height) 35.0) + (let ((s4-0 (&-> *progress-state* yes-no-choice))) + (set! a0-12 + (cond + ((and (= (-> *progress-state* qr-options-item-selected) 1) (-> *progress-state* qr-options-item-picked)) + (let ((a0-3 arg1)) + (set! (-> a0-3 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 50 f30-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 25.0 (-> arg1 origin y))) + (let ((v1-18 arg1)) + (set! (-> v1-18 scale) 0.6) + ) + (cond + ((-> s4-0 0) + (format + (clear *temp-string*) + "~33L~S~32L ~S" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-12 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~32L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-12 *temp-string*) + ) + ) + a0-12 + ) + (else + (if (and (= (-> arg0 option-index) arg2) (= (-> *progress-state* qr-options-item-selected) 1)) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 26 f30-0) + ) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + *temp-string* + ) + ) + ) + ) + (print-game-text a0-12 arg1 #f 44 320) + (cond + ((= (-> *setting-control* user-default language) (language-enum french)) + (draw-decoration obj arg1 f30-0 371 #f 0.8) + ) + ((= (-> *setting-control* user-default language) (language-enum german)) + (draw-decoration obj arg1 f30-0 371 #f 0.7) + ) + (else + (draw-decoration obj arg1 f30-0 371 #f 0.95) + ) + ) + ) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (v0-42 pointer) + (sv-16 progress) + (sv-32 symbol) + (sv-48 int) + (sv-64 int) + (sv-80 int) + (sv-96 int) + (sv-112 int) + (sv-128 pointer) + (sv-144 (function string font-context symbol int int float)) + (sv-160 uint) + (sv-176 dma-buffer) + (sv-192 pointer) + (sv-208 pointer) + (sv-224 (function string font-context symbol int int float)) + (sv-240 uint) + (sv-256 dma-buffer) + (sv-272 pointer) + ) + (set! sv-16 arg0) + (let ((s5-0 arg1) + (gp-0 arg2) + ) + (set! sv-32 arg3) + (let ((f30-0 (* 2.0 (- 0.5 (-> sv-16 menu-transition))))) + (set! sv-48 128) + (let ((s1-0 sv-48) + (s0-0 9) + (s2-0 157) + (f28-0 2.0) + (s3-0 252) + ) + (set! sv-64 20) + (set! sv-80 0) + (set! sv-96 112) + (set! sv-112 127) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> s5-0 alpha) f30-0) + (set! v0-42 + (cond + ((not (-> *bigmap* progress-minimap)) + (draw-busy-loading s5-0) + v0-42 + ) + (else + (let ((v1-13 s5-0)) + (set! (-> v1-13 scale) 0.6) + ) + (set! (-> s5-0 origin y) (+ 20.0 (-> s5-0 origin y))) + (case (get-aspect-ratio) + (('aspect4x3) + (set! s2-0 157) + (let ((v1-17 gp-0)) + (cond + ((zero? v1-17) + (set! (-> s5-0 origin y) (+ -24.0 (-> s5-0 origin y))) + (+! s2-0 -9) + ) + ((= v1-17 1) + (set! (-> s5-0 origin y) (+ -9.0 (-> s5-0 origin y))) + (+! s2-0 43) + ) + ((= v1-17 2) + (set! (-> s5-0 origin y) (+ 6.0 (-> s5-0 origin y))) + (+! s2-0 96) + ) + ) + ) + ) + (('aspect16x9) + (set! s2-0 172) + (set! f28-0 2.62) + (set! s0-0 5) + (set! s3-0 250) + (let ((v1-28 gp-0)) + (cond + ((zero? v1-28) + (set! (-> s5-0 origin y) (+ -20.0 (-> s5-0 origin y))) + (+! s2-0 -20) + ) + ((= v1-28 1) + (set! (-> s5-0 origin y) (+ 2.0 (-> s5-0 origin y))) + (+! s2-0 40) + ) + ((= v1-28 2) + (set! (-> s5-0 origin y) (+ 30.0 (-> s5-0 origin y))) + (+! s2-0 105) + ) + ) + ) + ) + ) + (let ((a0-11 s5-0)) + (set! (-> a0-11 flags) (font-flags kerning large)) + ) + (set! (-> s5-0 origin x) (the float sv-48)) + (cond + (sv-32 + (set! sv-128 (-> obj value-to-modify)) + (set! (-> s5-0 origin y) (+ -8.0 (-> s5-0 origin y))) + (let ((a0-12 s5-0)) + (set! (-> a0-12 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -2.0 (-> s5-0 origin y))) 52 f30-0) + (set! sv-144 print-game-text) + (let ((a0-15 (lookup-text! *common-text* (-> obj name) #f)) + (a1-3 s5-0) + (a2-3 #f) + (a3-1 44) + (t0-1 320) + ) + (sv-144 a0-15 a1-3 a2-3 a3-1 t0-1) + ) + (set! sv-160 + (logior (logand (logior (logand (logior (logand (logior (logand (the-as uint #x8000ffff) -256) + (shr (shl (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-128)))) 56) 56) + ) + -65281 + ) + (shr (shl (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-128)))) 56) 48) + ) + -16711681 + ) + (shr (shl (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-128)))) 56) 40) + ) + (the-as uint #xffffffff00ffffff) + ) + (shr (shl (the int (* 128.0 f30-0)) 56) 32) + ) + ) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) + (set! (-> obj sprites 0 scale-x) f28-0) + (set! (-> obj sprites 0 scale-y) 0.7) + (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 0 pos z) #x3fffff) + (set! (-> obj sprites 0 pos w) 0) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) + (set! (-> obj sprites 1 scale-x) 0.2) + (set! (-> obj sprites 1 scale-y) 1.33) + (set-vector! (-> obj sprites 1 color) 128 128 128 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 1 pos z) #x3fffff) + (set! (-> obj sprites 1 pos w) 0) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) + (set! (-> obj sprites 2 scale-x) 1.0) + (set! (-> obj sprites 2 scale-y) 1.0) + (set-vector! (-> obj sprites 2 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 2 pos z) #xffffff) + (set! (-> obj sprites 2 pos w) 0) + (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) + (set! (-> obj sprites 3 scale-x) 1.0) + (set! (-> obj sprites 3 scale-y) 1.0) + (set-vector! (-> obj sprites 3 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 3 pos z) #xffffff) + (set! (-> obj sprites 3 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) s1-0 s2-0) + (set-hud-piece-position! + (-> obj sprites 1) + (+ s1-0 (the int (* 230.0 (-> (the-as (pointer float) sv-128))))) + (+ s2-0 -4) + ) + (set-hud-piece-position! (-> obj sprites 2) (- s1-0 sv-64) (+ s2-0 -4)) + (set-hud-piece-position! (-> obj sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) + (set! sv-176 (-> *display* frames (-> *display* on-screen) global-buf)) + (set! sv-192 (-> sv-176 base)) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + sv-176 + (-> *level* default-level) + ) + (draw-sprite2d-xy + sv-176 + (+ s1-0 s0-0 (the int (* 230.0 (-> (the-as (pointer float) sv-128))))) + (+ s2-0 7) + (- 240 (the int (* 230.0 (-> (the-as (pointer float) sv-128))))) + 9 + (the-as rgba sv-160) + ) + (hud-sprite-method-9 (-> obj sprites 1) sv-176 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 2) sv-176 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 3) sv-176 (-> *level* default-level)) + (let ((a3-6 (-> sv-176 base))) + (let ((v1-100 (the-as object (-> sv-176 base)))) + (set! (-> (the-as dma-packet v1-100) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-100) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-100) vif1) (new 'static 'vif-tag)) + (set! (-> sv-176 base) (&+ (the-as pointer v1-100) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + sv-192 + (the-as (pointer dma-tag) a3-6) + ) + ) + (+! (-> s5-0 origin x) (the float s3-0)) + (let ((a0-71 s5-0)) + (set! (-> a0-71 flags) (font-flags kerning right large)) + ) + (let ((s3-1 print-game-text)) + (format (clear *temp-string*) "~D%" (the int (* 100.0 (-> (the-as (pointer float) sv-128))))) + (s3-1 *temp-string* s5-0 #f 44 320) + ) + (let ((a0-75 s5-0)) + (set! (-> a0-75 flags) (font-flags kerning large)) + ) + ) + (else + (set! sv-208 (-> obj value-to-modify)) + (set! (-> s5-0 origin y) (+ -8.0 (-> s5-0 origin y))) + (when (or (= (-> *setting-control* user-default language) (language-enum german)) + (= (-> *setting-control* user-default language) (language-enum french)) + ) + (let ((v1-121 s5-0)) + (set! (-> v1-121 scale) 0.56) + ) + ) + (if (= (-> sv-16 option-index) gp-0) + (draw-highlight (the int (+ -2.0 (-> s5-0 origin y))) 24 f30-0) + ) + (set! sv-224 print-game-text) + (let ((a0-81 (lookup-text! *common-text* (-> obj name) #f)) + (a1-21 s5-0) + (a2-18 #f) + (a3-8 44) + (t0-4 320) + ) + (sv-224 a0-81 a1-21 a2-18 a3-8 t0-4) + ) + (set! sv-240 + (logior (logand (logior (logand (logior (logand (logior (logand (the-as uint #x8000ffff) -256) + (shr (shl (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-208)))) 56) 56) + ) + -65281 + ) + (shr (shl (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-208)))) 56) 48) + ) + -16711681 + ) + (shr (shl (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-208)))) 56) 40) + ) + (the-as uint #xffffffff00ffffff) + ) + (shr (shl (the int (* 128.0 f30-0)) 56) 32) + ) + ) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) + (set! (-> obj sprites 0 scale-x) f28-0) + (set! (-> obj sprites 0 scale-y) 0.7) + (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 0 pos z) #x3fffff) + (set! (-> obj sprites 0 pos w) 0) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) + (set! (-> obj sprites 1 scale-x) 0.2) + (set! (-> obj sprites 1 scale-y) 1.33) + (set-vector! (-> obj sprites 1 color) 128 128 128 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 1 pos z) #x3fffff) + (set! (-> obj sprites 1 pos w) 0) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) + (set! (-> obj sprites 2 scale-x) 1.0) + (set! (-> obj sprites 2 scale-y) 1.0) + (set-vector! (-> obj sprites 2 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 2 pos z) #xffffff) + (set! (-> obj sprites 2 pos w) 0) + (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) + (set! (-> obj sprites 3 scale-x) 1.0) + (set! (-> obj sprites 3 scale-y) 1.0) + (set-vector! (-> obj sprites 3 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 3 pos z) #xffffff) + (set! (-> obj sprites 3 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) s1-0 s2-0) + (set-hud-piece-position! + (-> obj sprites 1) + (+ s1-0 (the int (* 230.0 (-> (the-as (pointer float) sv-208))))) + (+ s2-0 -4) + ) + (set-hud-piece-position! (-> obj sprites 2) (- s1-0 sv-64) (+ s2-0 -4)) + (set-hud-piece-position! (-> obj sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) + (set! sv-256 (-> *display* frames (-> *display* on-screen) global-buf)) + (set! sv-272 (-> sv-256 base)) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + sv-256 + (-> *level* default-level) + ) + (draw-sprite2d-xy + sv-256 + (+ s1-0 s0-0 (the int (* 230.0 (-> (the-as (pointer float) sv-208))))) + (+ s2-0 7) + (- 240 (the int (* 230.0 (-> (the-as (pointer float) sv-208))))) + 9 + (the-as rgba sv-240) + ) + (hud-sprite-method-9 (-> obj sprites 1) sv-256 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 2) sv-256 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 3) sv-256 (-> *level* default-level)) + (let ((a3-13 (-> sv-256 base))) + (let ((v1-183 (the-as object (-> sv-256 base)))) + (set! (-> (the-as dma-packet v1-183) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-183) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-183) vif1) (new 'static 'vif-tag)) + (set! (-> sv-256 base) (&+ (the-as pointer v1-183) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + sv-272 + (the-as (pointer dma-tag) a3-13) + ) + ) + (+! (-> s5-0 origin x) (the float s3-0)) + (let ((a0-137 s5-0)) + (set! (-> a0-137 flags) (font-flags kerning right large)) + ) + (let ((s3-2 print-game-text)) + (format (clear *temp-string*) "~D%" (the int (* 100.0 (-> (the-as (pointer float) sv-208))))) + (s3-2 *temp-string* s5-0 #f 44 320) + ) + (let ((a0-141 s5-0)) + (set! (-> a0-141 flags) (font-flags kerning large)) + ) + ) + ) + (if (zero? gp-0) + (draw-sound-options-decoration obj s5-0 f30-0 (the-as symbol 285) (the-as game-text-id #f)) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod menu-option-method-10 menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (s5-0 int)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.65) + ) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((a0-2 arg1)) + (set! (-> a0-2 flags) (font-flags kerning middle large)) + ) + (cond + ((not (-> *bigmap* progress-minimap)) + (draw-busy-loading arg1) + ) + ((begin + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg1 origin y) (+ 32.0 (-> arg1 origin y))) + ) + (('aspect16x9) + (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) + ) + ) + (set! s5-0 (-> *setting-control* user-default stereo-mode)) + arg3 + ) + (let ((a0-7 arg1)) + (set! (-> a0-7 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 42 f30-0) + (let ((s3-1 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (s3-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 22.0 (-> arg1 origin y))) + (let ((a0-13 arg1)) + (set! (-> a0-13 color) (font-color #7efbfb)) + ) + (let ((v1-22 arg1)) + (set! (-> v1-22 scale) 0.5) + ) + (let ((a0-15 arg1)) + (set! (-> a0-15 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x))) + (let ((s4-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 163) + (s4-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) (+ 70.0 (-> arg1 origin x))) + (set! (-> arg1 origin x) (+ 70.0 (-> arg1 origin x))) + (let ((s4-2 print-game-text)) + (format (clear *temp-string*) "~33L~C" 161) + (s4-2 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x))) + (let ((s4-3 arg1)) + (set! (-> s4-3 color) (the-as font-color (progress-selected 0))) + ) + (let ((a0-23 arg1)) + (set! (-> a0-23 flags) (font-flags kerning middle large)) + ) + (print-game-text (lookup-text! *common-text* (-> *stereo-mode-name-remap* s5-0) #f) arg1 #f 44 320) + ) + (else + (if (= (-> arg0 option-index) arg2) + (draw-highlight (the int (-> arg1 origin y)) 21 f30-0) + ) + (let ((v1-37 arg1)) + (set! (-> v1-37 scale) 0.65) + ) + (let ((s3-4 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (s3-4 *temp-string* arg1 #f 44 320) + ) + (let ((v1-39 arg1)) + (set! (-> v1-39 scale) 0.5) + ) + (let ((a0-33 arg1)) + (set! (-> a0-33 color) (font-color #7efbfb)) + ) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> *stereo-mode-name-remap* s5-0) #f)) + (let ((a0-37 *temp-string*)) + (set! (-> arg1 origin y) (+ 22.0 (-> arg1 origin y))) + (let ((a1-19 arg1)) + (set! (-> a1-19 flags) (font-flags kerning middle large)) + ) + (print-game-text a0-37 arg1 #f 44 320) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 349] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 361] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 417] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 435] +(defmethod menu-option-method-10 menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (sv-16 dma-buffer)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (s2-0 (the int (+ -1.0 (-> arg1 origin y)))) + (s1-0 22) + ) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((v1-5 arg1)) + (set! (-> v1-5 scale) 0.6) + ) + (cond + ((= *title* (-> arg0 current-options)) + (let ((v1-8 arg1)) + (set! (-> v1-8 scale) 0.85) + ) + (set! (-> arg1 height) 40.0) + (set! s1-0 36) + (+! s2-0 -8) + (when (memcard-unlocked-secrets? #f) + (set! (-> arg1 origin y) (+ -35.0 (-> arg1 origin y))) + (set! s1-0 36) + (+! s2-0 -34) + ) + ) + ((= *options* (-> arg0 current-options)) + (set! (-> arg1 origin y) (+ -20.0 (-> arg1 origin y))) + (let ((v1-16 arg1)) + (set! (-> v1-16 scale) 0.85) + ) + (set! (-> arg1 height) 40.0) + (set! s1-0 37) + (+! s2-0 -28) + ) + ) + (when (nonzero? (-> obj name)) + (let ((s0-0 arg1)) + (set! (-> s0-0 color) (if (= arg2 (-> arg0 option-index)) + (the-as font-color (progress-selected 0)) + (font-color #7efbfb) + ) + ) + ) + (cond + ((= arg2 (-> arg0 option-index)) + (let ((s0-1 arg1)) + (set! (-> s0-1 color) (the-as font-color (progress-selected 0))) + ) + ) + (else + (let ((a0-9 arg1)) + (set! (-> a0-9 color) (font-color #7efbfb)) + ) + ) + ) + (if (and (and (= arg2 (-> arg0 option-index)) (!= 298 (-> obj name))) + (not (and (= (-> obj name) (game-text-id progress-root-secrets)) + (= *title* (-> arg0 current-options)) + (not (memcard-unlocked-secrets? #f)) + (= (-> arg0 option-index) 3) + ) + ) + ) + (draw-highlight s2-0 s1-0 f30-0) + ) + (cond + ((= *save-options-title* (-> arg0 current-options)) + (cond + ((= (-> obj name) (game-text-id progress-continue-without-saving)) + (cond + ((= arg2 (-> arg0 option-index)) + (let ((v1-39 arg1)) + (set! (-> v1-39 scale) 0.5) + ) + ) + (else + (let ((v1-40 arg1)) + (set! (-> v1-40 scale) 0.45) + ) + ) + ) + (set! (-> arg1 origin y) (+ -120.0 (-> arg1 origin y))) + (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 10 + 5 + ) + ) + ) + ) + (set! (-> arg1 width) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 180 + 170 + ) + ) + ) + (set! (-> arg1 height) 260.0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (when (= arg2 (-> arg0 option-index)) + (let ((s4-1 69) + (s2-4 110) + (s3-1 176) + (s1-1 42) + ) + (case (get-aspect-ratio) + (('aspect16x9) + (set! s4-1 79) + (set! s2-4 110) + (set! s3-1 166) + (set! s1-1 42) + (set! sv-16 (-> *display* frames (-> *display* on-screen) global-buf)) + (let ((s0-2 (-> sv-16 base))) + (draw-sprite2d-xy + sv-16 + s4-1 + (+ (* s1-1 arg2) 8 s1-1 s2-4) + s3-1 + (+ s1-1 -8) + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 f30-0))) + ) + (let ((a3-3 (-> sv-16 base))) + (let ((v1-62 (the-as object (-> sv-16 base)))) + (set! (-> (the-as dma-packet v1-62) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-62) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-62) vif1) (new 'static 'vif-tag)) + (set! (-> sv-16 base) (&+ (the-as pointer v1-62) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s0-2 + (the-as (pointer dma-tag) a3-3) + ) + ) + ) + ) + ) + (set-vector! (-> obj box 0 color) 64 128 128 (the int (* 128.0 f30-0))) + (draw-savegame-box + obj + (the float s4-1) + (the float (+ s4-1 s3-1)) + (the float (+ s2-4 (* s1-1 arg2))) + (the float (+ s2-4 (* s1-1 arg2))) + ) + (draw-savegame-box + obj + (the float (+ s4-1 s3-1)) + (the float (+ s4-1 s3-1)) + (the float s2-4) + (the float (+ s2-4 (* s1-1 arg2))) + ) + (let* ((s0-3 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-1 (-> s0-3 base)) + ) + (draw-sprite2d-xy + s0-3 + s4-1 + (+ s2-4 (* s1-1 arg2)) + s3-1 + (+ s1-1 8) + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 f30-0))) + ) + (let ((a3-7 (-> s0-3 base))) + (let ((v1-87 (the-as object (-> s0-3 base)))) + (set! (-> (the-as dma-packet v1-87) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-87) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-87) vif1) (new 'static 'vif-tag)) + (set! (-> s0-3 base) (&+ (the-as pointer v1-87) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + gp-1 + (the-as (pointer dma-tag) a3-7) + ) + ) + ) + ) + ) + ) + (else + (set! (-> arg1 origin x) (+ -100.0 (-> arg1 origin x))) + (set! (-> arg1 origin y) (+ -35.0 (-> arg1 origin y))) + ) + ) + ) + ((= *load-save-options* (-> arg0 current-options)) + (set! (-> arg1 origin x) (+ -100.0 (-> arg1 origin x))) + (set! (-> arg1 origin y) (+ -25.0 (-> arg1 origin y))) + (print-menu-text (lookup-text! *common-text* (-> obj name) #f) (-> obj scale) arg1 arg0) + ) + ((and (= *title* (-> arg0 current-options)) (= 339 (-> obj name)) (memcard-unlocked-secrets? #f)) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + ) + ((!= (-> obj name) (game-text-id progress-root-secrets)) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + ) + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak2/engine/ui/progress/progress-h.gc b/goal_src/jak2/engine/ui/progress/progress-h.gc index 954c7fd4ea..c62d9cd212 100644 --- a/goal_src/jak2/engine/ui/progress/progress-h.gc +++ b/goal_src/jak2/engine/ui/progress/progress-h.gc @@ -11,6 +11,16 @@ (declare-type menu-option basic) (declare-type menu-option-list basic) +(declare-type progress process-drawable) +(define-extern *progress-process* (pointer progress)) +(define-extern activate-progress (function process symbol none)) + +(define-extern memcard-unlocked-secrets? (function symbol game-secrets)) +(define-extern progress-selected (function int int :behavior progress)) +(define-extern get-num-highscores (function int)) +(define-extern get-next-highscore (function int int)) +(define-extern get-prev-highscore (function int int)) + ;; DECOMP BEGINS (deftype progress (process-drawable) @@ -61,29 +71,34 @@ ) ) + (deftype menu-option (basic) - ((name uint32 :offset-assert 4) - (scale basic :offset-assert 8) - (box bounding-box 1 :inline :offset-assert 16) + ((name game-text-id :offset-assert 4) + (scale float :offset-assert 8) + (unknown function :offset-assert 12) + (box hud-box 1 :inline :offset-assert 16) + (options menu-option 8 :offset 16) ) :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 (:methods - (respond-progress (_type_ progress object symbol) int 9) - (menu-option-method-10 () none 10) + (respond-progress (_type_ progress object) int :behavior progress 9) + (menu-option-method-10 (_type_ progress font-context int symbol) none 10) (menu-option-method-11 () none 11) ) ) + (deftype menu-on-off-option (menu-option) - ((value-to-modify pointer :offset-assert 48) + ((value-to-modify (pointer symbol) :offset-assert 48) ) :method-count-assert 12 :size-assert #x34 :flag-assert #xc00000034 ) + (deftype menu-yes-no-option (menu-option) ((value-to-modify pointer :offset-assert 48) ) @@ -92,17 +107,19 @@ :flag-assert #xc00000034 ) + (deftype menu-language-option (menu-option) - ((language-selection uint64 :offset-assert 48) - (language-direction basic :offset-assert 56) - (language-transition basic :offset-assert 60) - (language-x-offset int32 :offset-assert 64) + ((language-selection language-enum :offset-assert 48) + (language-direction symbol :offset-assert 56) + (language-transition basic :offset-assert 60) + (language-x-offset int32 :offset-assert 64) ) :method-count-assert 12 :size-assert #x44 :flag-assert #xc00000044 ) + (deftype menu-quit-option (menu-option) () :method-count-assert 12 @@ -110,6 +127,7 @@ :flag-assert #xc00000030 ) + (deftype menu-slider-option (menu-option) ((value-to-modify pointer :offset-assert 48) (sprites hud-sprite 5 :inline :offset-assert 64) @@ -119,6 +137,7 @@ :flag-assert #xc00000180 ) + (deftype menu-sub-menu-option (menu-option) ((next-state basic :offset-assert 48) (pad uint8 44 :offset-assert 52) @@ -128,6 +147,7 @@ :flag-assert #xc00000060 ) + (deftype menu-sub-menu-sound-option (menu-option) ((next-state basic :offset-assert 48) ) @@ -136,6 +156,7 @@ :flag-assert #xc00000034 ) + (deftype menu-stereo-mode-sound-option (menu-option) () :method-count-assert 12 @@ -143,6 +164,7 @@ :flag-assert #xc00000030 ) + (deftype menu-sub-menu-graphic-option (menu-option) ((next-state basic :offset-assert 48) ) @@ -151,6 +173,7 @@ :flag-assert #xc00000034 ) + (deftype menu-unlocked-menu-option (menu-sub-menu-option) () :method-count-assert 12 @@ -158,6 +181,7 @@ :flag-assert #xc00000060 ) + (deftype menu-main-menu-option (menu-option) ((next-state basic :offset-assert 48) ) @@ -166,6 +190,7 @@ :flag-assert #xc00000034 ) + (deftype menu-memcard-slot-option (menu-option) ((sprites hud-sprite 5 :inline :offset-assert 48) (pad uint8 32 :offset-assert 368) @@ -175,6 +200,7 @@ :flag-assert #xc00000190 ) + (deftype menu-loading-option (menu-option) () :method-count-assert 12 @@ -182,6 +208,7 @@ :flag-assert #xc00000030 ) + (deftype menu-insufficient-space-option (menu-option) ((last-move uint64 :offset-assert 48) ) @@ -190,6 +217,7 @@ :flag-assert #xc00000038 ) + (deftype menu-secrets-insufficient-space-option (menu-option) () :method-count-assert 12 @@ -197,6 +225,7 @@ :flag-assert #xc00000030 ) + (deftype menu-insert-card-option (menu-option) () :method-count-assert 12 @@ -204,6 +233,7 @@ :flag-assert #xc00000030 ) + (deftype menu-error-loading-option (menu-option) () :method-count-assert 12 @@ -211,6 +241,7 @@ :flag-assert #xc00000030 ) + (deftype menu-error-auto-saving-option (menu-option) () :method-count-assert 12 @@ -218,6 +249,7 @@ :flag-assert #xc00000030 ) + (deftype menu-card-removed-option (menu-option) () :method-count-assert 12 @@ -225,6 +257,7 @@ :flag-assert #xc00000030 ) + (deftype menu-error-disc-removed-option (menu-option) () :method-count-assert 12 @@ -232,6 +265,7 @@ :flag-assert #xc00000030 ) + (deftype menu-error-reading-option (menu-option) () :method-count-assert 12 @@ -239,6 +273,7 @@ :flag-assert #xc00000030 ) + (deftype menu-icon-info-option (menu-option) ((sprites hud-sprite 2 :inline :offset-assert 48) ) @@ -247,6 +282,7 @@ :flag-assert #xc000000b0 ) + (deftype menu-format-card-option (menu-option) () :method-count-assert 12 @@ -254,6 +290,7 @@ :flag-assert #xc00000030 ) + (deftype menu-already-exists-option (menu-option) () :method-count-assert 12 @@ -261,6 +298,7 @@ :flag-assert #xc00000030 ) + (deftype menu-create-game-option (menu-option) () :method-count-assert 12 @@ -268,6 +306,7 @@ :flag-assert #xc00000030 ) + (deftype menu-video-mode-warning-option (menu-option) () :method-count-assert 12 @@ -275,6 +314,7 @@ :flag-assert #xc00000030 ) + (deftype menu-video-mode-ok-option (menu-option) () :method-count-assert 12 @@ -282,6 +322,7 @@ :flag-assert #xc00000030 ) + (deftype menu-progressive-mode-warning-option (menu-option) () :method-count-assert 12 @@ -289,6 +330,7 @@ :flag-assert #xc00000030 ) + (deftype menu-progressive-mode-ok-option (menu-option) () :method-count-assert 12 @@ -296,6 +338,7 @@ :flag-assert #xc00000030 ) + (deftype menu-select-start-option (menu-option) ((task-index int32 :offset-assert 48) (real-task-index int32 :offset-assert 52) @@ -306,6 +349,7 @@ :flag-assert #xc00000040 ) + (deftype menu-select-scene-option (menu-option) ((task-index int32 :offset-assert 48) (last-move uint64 :offset-assert 56) @@ -315,6 +359,7 @@ :flag-assert #xc00000040 ) + (deftype menu-bigmap-option (menu-option) () :method-count-assert 12 @@ -322,6 +367,7 @@ :flag-assert #xc00000030 ) + (deftype paged-menu-option (menu-option) ((page-index int32 :offset-assert 48) (prev-page-index int32 :offset-assert 52) @@ -333,6 +379,7 @@ :flag-assert #xc00000040 ) + (deftype menu-missions-option (paged-menu-option) ((task-line-index int32 :offset-assert 64) (last-move uint64 :offset-assert 72) @@ -342,6 +389,7 @@ :flag-assert #xc00000050 ) + (deftype menu-highscores-option (paged-menu-option) ((last-move uint64 :offset-assert 64) (sprites hud-sprite 2 :inline :offset-assert 80) @@ -351,6 +399,7 @@ :flag-assert #xc000000d0 ) + (deftype secret-item-option (menu-option) ((cost int32 :offset-assert 48) (can-toggle symbol :offset-assert 52) @@ -362,20 +411,22 @@ :flag-assert #xc0000003e ) + (deftype menu-secret-option (menu-option) - ((item-index int32 :offset-assert 48) - (prev-item-index int32 :offset-assert 52) - (num-items int32 :offset-assert 56) - (num-hero-items int32 :offset-assert 60) - (secret-items basic :offset-assert 64) - (last-move uint64 :offset-assert 72) - (sprites hud-sprite 2 :inline :offset-assert 80) + ((item-index int32 :offset-assert 48) + (prev-item-index int32 :offset-assert 52) + (num-items int32 :offset-assert 56) + (num-hero-items int32 :offset-assert 60) + (secret-items (array secret-item-option) :offset-assert 64) + (last-move uint64 :offset-assert 72) + (sprites hud-sprite 2 :inline :offset-assert 80) ) :method-count-assert 12 :size-assert #xd0 :flag-assert #xc000000d0 ) + (deftype menu-option-list (basic) ((y-center int32 :offset-assert 4) (y-space int32 :offset-assert 8) @@ -387,15 +438,17 @@ :flag-assert #x900000010 ) + (deftype menu-qr-option (menu-option) - ((last-move uint64 :offset-assert 48) - (value-to-modify uint32 :offset 60) + ((last-move uint64 :offset-assert 48) + (value-to-modify function :offset 60) ) :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 ) + (deftype menu-restart-mission-qr-option (menu-qr-option) ((next-state basic :offset-assert 64) ) @@ -404,6 +457,7 @@ :flag-assert #xc00000044 ) + (deftype menu-quit-qr-option (menu-qr-option) ((next-state basic :offset-assert 64) ) @@ -412,6 +466,7 @@ :flag-assert #xc00000044 ) + (deftype menu-sub-menu-qr-option (menu-qr-option) ((next-state basic :offset-assert 64) ) @@ -420,6 +475,7 @@ :flag-assert #xc00000044 ) + (deftype menu-graphic-option (menu-option) ((last-move uint64 :offset-assert 48) (value-to-modify pointer :offset 60) @@ -429,6 +485,7 @@ :flag-assert #xc00000040 ) + (deftype menu-on-off-progressive-scan-graphic-option (menu-graphic-option) () :method-count-assert 12 @@ -436,6 +493,7 @@ :flag-assert #xc00000040 ) + (deftype menu-aspect-ratio-option (menu-graphic-option) () :method-count-assert 12 @@ -443,6 +501,7 @@ :flag-assert #xc00000040 ) + (deftype menu-center-screen-graphic-option (menu-graphic-option) ((next-state basic :offset-assert 64) ) @@ -451,6 +510,7 @@ :flag-assert #xc00000044 ) + (deftype menu-video-mode-option (menu-graphic-option) () :method-count-assert 12 @@ -458,6 +518,7 @@ :flag-assert #xc00000040 ) + (deftype menu-game-option (menu-option) ((last-move uint64 :offset-assert 48) (value-to-modify pointer :offset 60) @@ -467,6 +528,7 @@ :flag-assert #xc00000040 ) + (deftype menu-on-off-game-vibrations-option (menu-game-option) () :method-count-assert 12 @@ -474,6 +536,7 @@ :flag-assert #xc00000040 ) + (deftype menu-on-off-game-subtitles-option (menu-game-option) () :method-count-assert 12 @@ -481,6 +544,7 @@ :flag-assert #xc00000040 ) + (deftype menu-sub-menu-game-option (menu-game-option) ((next-state basic :offset-assert 64) ) @@ -489,6 +553,7 @@ :flag-assert #xc00000044 ) + (deftype menu-language-game-option (menu-game-option) ((language-selection uint64 :offset-assert 64) (language-direction basic :offset-assert 72) @@ -500,6 +565,7 @@ :flag-assert #xc00000054 ) + (deftype menu-subtitle-language-game-option (menu-game-option) ((language-selection uint64 :offset-assert 64) (language-direction basic :offset-assert 72) @@ -510,8 +576,3 @@ :size-assert #x54 :flag-assert #xc00000054 ) - -;; DECOMP ENDS - -(define-extern *progress-process* (pointer progress)) -(define-extern activate-progress (function process symbol none)) diff --git a/goal_src/jak2/engine/ui/progress/progress-static.gc b/goal_src/jak2/engine/ui/progress/progress-static.gc index 4a27559381..1a05dde8c8 100644 --- a/goal_src/jak2/engine/ui/progress/progress-static.gc +++ b/goal_src/jak2/engine/ui/progress/progress-static.gc @@ -7,3 +7,930 @@ ;; DECOMP BEGINS +(let ((a0-0 (new 'static 'skeleton-group + :name "skel-hud-ring" + :extra #f + :info #f + :art-group-name "hud-ring" + :bounds (new 'static 'vector :w 225280.0) + :version #x7 + ) + ) + ) + (set! (-> a0-0 jgeo) 0) + (set! (-> a0-0 janim) 2) + (set! (-> a0-0 mgeo 0) 1) + (set! (-> a0-0 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-0) + ) + +(let ((a0-1 (new 'static 'skeleton-group + :name "skel-hud-ring-part" + :extra #f + :info #f + :art-group-name "hud-ring" + :bounds (new 'static 'vector :w 225280.0) + :version #x7 + ) + ) + ) + (set! (-> a0-1 jgeo) 3) + (set! (-> a0-1 janim) 5) + (set! (-> a0-1 mgeo 0) 4) + (set! (-> a0-1 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-1) + ) + +(define *main-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *main-options-debug* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *main-kiosk-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *main-demo-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *title* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *unlocked-secrets* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *game-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *game-options-japan* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *game-options-demo* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *graphic-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *graphic-title-options-pal* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *sound-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *quit-restart-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *load-save-options* (new 'static 'menu-option-list :y-center #xdc :y-space 30 :scale 0.82)) + +(define *save-options-title* (new 'static 'menu-option-list :y-center #xdc :y-space 30 :scale 0.82)) + +(define *loading-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *insufficient-space-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *secrets-insufficient-space-options* + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) + +(define *insert-card-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *error-loading-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *error-auto-saving-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *card-removed-options* (new 'static 'menu-option-list :y-center #x104 :y-space 30 :scale 0.82)) + +(define *error-disc-removed-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *error-reading-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *icon-info-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *format-card-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *already-exists-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *create-game-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *video-mode-warning-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *video-mode-ok-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *progressive-mode-warning-options* + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) + +(define *progressive-mode-ok-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *quit-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *select-start-options* + "List of [[menu-select-start-option]]" + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) + +(define *select-scene-options* + "List of [[menu-select-scene-option]]" + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) + +(define *bigmap-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *missions-options* + "List of [[menu-missions-option]]" + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) + +(define *highscores-options* + "List of [[menu-highscores-option]]" + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) + +(define *secret-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +(define *language-name-remap* + (the-as (array game-text-id) + (new 'static 'boxed-array :type uint32 #x111 #x112 #x113 #x114 #x115 #x117 #x116 #x30b) + ) + ) + +(define *stereo-mode-name-remap* + (the-as (array game-text-id) (new 'static 'boxed-array :type uint32 #x104 #x105 #x106)) + ) + +(define *hud-ring-graphic-remap* + (new 'static 'boxed-array :type uint64 #x80 #x40 #x10 #x4 #x8 #x400 #x20 #x100 #x200 #x2) + ) + +(define *hud-ring-kiosk-graphic-remap* + (new 'static 'boxed-array :type uint64 #x40 #x80 #x2 #x200 #x200 #x200 #x200 #x200 #x200 #x200) + ) + +(define *hud-ring-demo-graphic-remap* + (new 'static 'boxed-array :type uint64 #x80 #x2 #x200 #x200 #x200 #x200 #x200 #x200 #x200 #x200) + ) + +(deftype hud-scene-info (basic) + ((name string :offset-assert 4) + (continue string :offset-assert 8) + (info object :offset-assert 12) + (info-str string :offset 12) + (info-list pair :offset 12) + (text uint32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + + +(define *hud-select-scene-act1* + (new 'static 'boxed-array :type hud-scene-info + (new 'static 'hud-scene-info + :name "intro" + :continue "village1-start" + :info '("intro-samos-hut" "intro-vortex" "intro-city-square" "intro-prison") + :text #x307 + ) + (new 'static 'hud-scene-info + :name "city-help-kid-intro" + :continue "ctyslumb-fort" + :info "city-help-kid-intro" + :text #x28c + ) + (new 'static 'hud-scene-info + :name "city-help-kid-resolution" + :continue "ctyslumb-fort" + :info "city-help-kid-resolution" + :text #x28d + ) + (new 'static 'hud-scene-info + :name "ruins-tower-intro" + :continue "ctysluma-tower-intro" + :info "ruins-tower-intro" + :text #x281 + ) + (new 'static 'hud-scene-info + :name "ruins-tower-victory" + :continue "ruins-hut" + :info "ruins-tower-victory" + :text #x282 + ) + (new 'static 'hud-scene-info :name "atoll-1-int" :continue "hideout-start" :info "atoll-1-int" :text #x2c8) + (new 'static 'hud-scene-info :name "atoll-1-res" :continue "atoll-movie" :info "atoll-1-res" :text #x2c9) + (new 'static 'hud-scene-info + :name "fortress-2-intro" + :continue "hideout-start" + :info "fortress-2-intro" + :text #x2bc + ) + (new 'static 'hud-scene-info + :name "fortress-blow-up-ammo-res-a" + :continue "fordumpc-start" + :info "fortress-blow-up-ammo-res-a" + :text #x2bd + ) + (new 'static 'hud-scene-info + :name "fortress-blow-up-ammo-res-b" + :continue "fordumpc-explode-movie" + :info "fortress-blow-up-ammo-res-b" + :text #x2be + ) + (new 'static 'hud-scene-info + :name "city-krew-delivery-intro" + :continue "hideout-start" + :info "city-krew-delivery-intro" + :text #x28f + ) + (new 'static 'hud-scene-info + :name "krew-delivery-res" + :continue "hiphog-start" + :info "krew-delivery-res" + :text #x290 + ) + (new 'static 'hud-scene-info :name "atoll-2-intro" :continue "hiphog-start" :info "atoll-2-intro" :text #x2ca) + (new 'static 'hud-scene-info + :name "atoll-sig-intro" + :continue "atoll-movie" + :info "atoll-sig-intro" + :text #x2ce + ) + (new 'static 'hud-scene-info + :name "atoll-sig-tank" + :continue "atoll-movie" + :info "atoll-sig-tank" + :text #x2cf + ) + (new 'static 'hud-scene-info + :name "atoll-sniper-a" + :continue "atoll-movie" + :info "atoll-sniper-a" + :text #x2d0 + ) + (new 'static 'hud-scene-info + :name "atoll-sniper-b" + :continue "atoll-movie" + :info "atoll-sniper-b" + :text #x2d1 + ) + (new 'static 'hud-scene-info + :name "atoll-sniper-c" + :continue "atoll-movie" + :info "atoll-sniper-c" + :text #x2d2 + ) + (new 'static 'hud-scene-info + :name "atoll-sniper-d" + :continue "atoll-movie" + :info "atoll-sniper-d" + :text #x2d3 + ) + (new 'static 'hud-scene-info + :name "atoll-sniper-e" + :continue "atoll-movie" + :info "atoll-sniper-e" + :text #x2d4 + ) + (new 'static 'hud-scene-info + :name "city-oracle-intro" + :continue "oracle-start" + :info "city-oracle-intro" + :text #x29d + ) + (new 'static 'hud-scene-info + :name "city-oracle-level-0" + :continue "oracle-start" + :info "city-oracle-level-0" + :text #x29e + ) + (new 'static 'hud-scene-info + :name "city-oracle-level-1" + :continue "oracle-start" + :info "city-oracle-level-1" + :text #x29f + ) + (new 'static 'hud-scene-info + :name "city-oracle-level-2" + :continue "oracle-start" + :info "city-oracle-level-2" + :text #x2a0 + ) + (new 'static 'hud-scene-info + :name "city-oracle-level-3" + :continue "oracle-start" + :info "city-oracle-level-3" + :text #x2a1 + ) + (new 'static 'hud-scene-info :name "sewer-1-intro" :continue "hiphog-start" :info "sewer-1-intro" :text #x2c1) + (new 'static 'hud-scene-info :name "sewer-1-res" :continue "hiphog-start" :info "sewer-1-res" :text #x2c2) + (new 'static 'hud-scene-info + :name "city-get-yellow-gun" + :continue "gungame-movie" + :info "city-get-yellow-gun" + :text #x2b2 + ) + (new 'static 'hud-scene-info + :name "vin-rescue-intro" + :continue "hideout-start" + :info "vin-rescue-intro" + :text #x286 + ) + (new 'static 'hud-scene-info :name "vin-rescue" :continue "strip-start" :info "vin-rescue" :text #x287) + (new 'static 'hud-scene-info + :name "city-keira-delivery-intro" + :continue "hiphog-start" + :info "city-keira-delivery-intro" + :text #x2a7 + ) + (new 'static 'hud-scene-info + :name "city-krew-collection-intro" + :continue "hiphog-start" + :info "city-krew-collection-intro" + :text #x2a2 + ) + (new 'static 'hud-scene-info + :name "city-krew-collection-res" + :continue "hiphog-start" + :info "city-krew-collection-res" + :text #x2a3 + ) + (new 'static 'hud-scene-info + :name "city-keira-hover-challenge-intro" + :continue "garage-start-skate" + :info "city-keira-hover-challenge-intro" + :text #x294 + ) + (new 'static 'hud-scene-info + :name "city-put-hoverboard" + :continue "skatea-start" + :info "city-put-hoverboard" + :text #x2b4 + ) + (new 'static 'hud-scene-info + :name "city-keira-hover-challenge-res" + :continue "garage-start-skate" + :info "city-keira-hover-challenge-res" + :text #x295 + ) + (new 'static 'hud-scene-info + :name "atoll-3-intro" + :continue "hideout-start" + :info "atoll-3-intro" + :text #x2cb + ) + (new 'static 'hud-scene-info + :name "atoll-save-ashelin-res-a" + :continue "atoll-movie" + :info "atoll-save-ashelin-res-a" + :text #x2cc + ) + (new 'static 'hud-scene-info + :name "atoll-save-ashelin-res-b" + :continue "atoll-movie" + :info "atoll-save-ashelin-res-b" + :text #x2cd + ) + (new 'static 'hud-scene-info + :name "drill-kill-metal-heads-intro" + :continue "vinroom-start" + :info "drill-kill-metal-heads-intro" + :text #x2d5 + ) + (new 'static 'hud-scene-info + :name "mountain-finditems-intro" + :continue "onintent-start" + :info "mountain-finditems-intro" + :text #x2d9 + ) + (new 'static 'hud-scene-info + :name "mountain-gear-res" + :continue "mountain-start" + :info "mountain-gear-res" + :text #x2da + ) + (new 'static 'hud-scene-info + :name "mountain-shard-res" + :continue "mountain-start" + :info "mountain-shard-res" + :text #x2db + ) + (new 'static 'hud-scene-info + :name "mountain-lens-res" + :continue "mountain-start" + :info "mountain-lens-res" + :text #x2dc + ) + (new 'static 'hud-scene-info + :name "city-switch-on-power-intro" + :continue "vinroom-start" + :info "city-switch-on-power-intro" + :text #x293 + ) + (new 'static 'hud-scene-info + :name "palace-outside-window-res" + :continue "palroof-throne" + :info "palace-outside-window-res" + :text #x2dd + ) + (new 'static 'hud-scene-info + :name "palace-outside-window-res-b" + :continue "palroof-boss" + :info "palace-outside-window-res-b" + :text #x2de + ) + (new 'static 'hud-scene-info + :name "palace-boss-res" + :continue "palroof-boss" + :info "palace-boss-res" + :text #x2df + ) + (new 'static 'hud-scene-info + :name "city-shuttle-underground-intro" + :continue "hideout-start" + :info "city-shuttle-underground-intro" + :text #x2a8 + ) + (new 'static 'hud-scene-info + :name "ruins-sacred-intro" + :continue "hideout-start" + :info "ruins-sacred-intro" + :text #x283 + ) + (new 'static 'hud-scene-info + :name "ruins-sacred-victory" + :continue "ruins-hut" + :info "ruins-sacred-victory" + :text #x284 + ) + ) + ) + +(define *hud-select-scene-act2* + (new 'static 'boxed-array :type hud-scene-info + (new 'static 'hud-scene-info + :name "forest-catch-metal-heads-intro" + :continue "hideout-start" + :info "forest-catch-metal-heads-intro" + :text #x2f1 + ) + (new 'static 'hud-scene-info + :name "city-get-hoverboard" + :continue "ctyfarma-airlock-movie" + :info "city-get-hoverboard" + :text #x2b3 + ) + (new 'static 'hud-scene-info + :name "city-escort-kid-intro" + :continue "escort-kid-intro" + :info "city-escort-kid-intro" + :text #x2a4 + ) + (new 'static 'hud-scene-info + :name "dig-knock-down-scaffolding-intro" + :continue "vinroom-start" + :info "dig-knock-down-scaffolding-intro" + :text #x2f6 + ) + (new 'static 'hud-scene-info + :name "dig-digger-explode" + :continue "dig1-start" + :info "dig-digger-explode" + :text #x2fa + ) + (new 'static 'hud-scene-info + :name "city-intercept-tanker-intro" + :continue "ctymarkb-tanker" + :info "city-intercept-tanker-intro" + :text #x291 + ) + (new 'static 'hud-scene-info + :name "city-intercept-tanker-res" + :continue "ctymarkb-tanker" + :info "city-intercept-tanker-res" + :text #x292 + ) + (new 'static 'hud-scene-info + :name "city-meet-brutter-intro" + :continue "hiphog-start" + :info "city-meet-brutter-intro" + :text #x2a5 + ) + (new 'static 'hud-scene-info + :name "city-meet-brutter-res" + :continue "kiosk-start" + :info "city-meet-brutter-res" + :text #x2a6 + ) + (new 'static 'hud-scene-info :name "sewer-2-intro" :continue "hiphog-start" :info "sewer-2-intro" :text #x2c3) + (new 'static 'hud-scene-info + :name "sewer-drain-res" + :continue "sewer-start" + :info "sewer-drain-res" + :text #x2c4 + ) + (new 'static 'hud-scene-info + :name "ecowells-intro" + :continue "vinroom-start" + :info "ecowells-intro" + :text #x28a + ) + (new 'static 'hud-scene-info + :name "ecowells-victory" + :continue "strip-start" + :info "ecowells-victory" + :text #x28b + ) + (new 'static 'hud-scene-info + :name "drill-destroy-ship-intro" + :continue "vinroom-start" + :info "drill-destroy-ship-intro" + :text #x2d6 + ) + (new 'static 'hud-scene-info + :name "forest-hunt-camo-metal-heads-intro" + :continue "hiphog-start" + :info "forest-hunt-camo-metal-heads-intro" + :text #x2f2 + ) + (new 'static 'hud-scene-info + :name "city-class-3-race-intro" + :continue "garage-class3-movie" + :info "city-class-3-race-intro" + :text #x296 + ) + (new 'static 'hud-scene-info + :name "city-class-3-race-res" + :continue "garage-class3-movie" + :info "city-class-3-race-res" + :text #x297 + ) + (new 'static 'hud-scene-info + :name "city-protect-slums-intro" + :continue "ctyslumc-seal-movie" + :info "city-protect-slums-intro" + :text #x2ba + ) + (new 'static 'hud-scene-info + :name "dig-find-totem-intro" + :continue "onintent-start" + :info "dig-find-totem-intro" + :text #x2f8 + ) + (new 'static 'hud-scene-info + :name "city-air-train-in-caspad" + :continue "ctyport-air-train" + :info "city-air-train-in-caspad" + :text #x2b6 + ) + (new 'static 'hud-scene-info + :name "caspad-air-train-out" + :continue "caspad-warp" + :info "caspad-air-train-out" + :text #x2e5 + ) + (new 'static 'hud-scene-info + :name "dig-find-totem-res" + :continue "dig-totem" + :info "dig-find-totem-res" + :text #x2f9 + ) + (new 'static 'hud-scene-info + :name "caspad-air-train-in" + :continue "caspad-warp" + :info "caspad-air-train-in" + :text #x2e4 + ) + (new 'static 'hud-scene-info + :name "city-air-train-out" + :continue "ctyport-air-train" + :info "city-air-train-out" + :text #x2b8 + ) + (new 'static 'hud-scene-info + :name "city-destroy-guard-vehicles-intro" + :continue "hideout-start" + :info "city-destroy-guard-vehicles-intro" + :text #x28e + ) + (new 'static 'hud-scene-info + :name "city-play-onin-game-intro" + :continue "onintent-start" + :info "city-play-onin-game-intro" + :text #x2a9 + ) + (new 'static 'hud-scene-info + :name "city-play-onin-game-res" + :continue "onintent-start" + :info "city-play-onin-game-res" + :text #x2aa + ) + (new 'static 'hud-scene-info + :name "canyon-insert-items-intro" + :continue "mountain-movie" + :info "canyon-insert-items-intro" + :text #x2fc + ) + (new 'static 'hud-scene-info + :name "canyon-insert-items-res" + :continue "mincan-city" + :info "canyon-insert-items-res" + :text #x2fb + ) + (new 'static 'hud-scene-info + :name "tomb-face-tests-intro" + :continue "tombd-start" + :info "tomb-face-tests-intro" + :text #x2e6 + ) + (new 'static 'hud-scene-info + :name "tomb-boulder-start" + :continue "tomb-boulder" + :info "tomb-boulder-start" + :text #x2ef + ) + (new 'static 'hud-scene-info + :name "tomb-spider-scare" + :continue "tomb-boulder-explode" + :info "tomb-spider-scare" + :text #x2f0 + ) + (new 'static 'hud-scene-info + :name "tomb-unlock-start" + :continue "tomb-water-switch" + :info "tomb-unlock-start" + :text #x2e9 + ) + (new 'static 'hud-scene-info + :name "tomb-unlock-water" + :continue "tomb-water-switch" + :info "tomb-unlock-water" + :text #x2ea + ) + (new 'static 'hud-scene-info + :name "tomb-unlock-poles" + :continue "tomb-poles-switch" + :info "tomb-unlock-poles" + :text #x2eb + ) + (new 'static 'hud-scene-info + :name "tomb-boss-open" + :continue "tombboss-start" + :info "tomb-boss-open" + :text #x2ec + ) + (new 'static 'hud-scene-info + :name "tomb-boss-intro" + :continue "tombboss-start" + :info "tomb-boss-intro" + :text #x2ed + ) + (new 'static 'hud-scene-info + :name "tomb-boss-res" + :continue "tombboss-start" + :info "tomb-boss-res" + :text #x2ee + ) + ) + ) + +(define *hud-select-scene-act3* + (new 'static 'boxed-array :type hud-scene-info + (new 'static 'hud-scene-info + :name "fortress-save-friends-intro-a" + :continue "hideout-start" + :info "fortress-save-friends-intro-a" + :text #x2bf + ) + (new 'static 'hud-scene-info + :name "fortress-save-friends-res" + :continue "prison-start" + :info "fortress-save-friends-res" + :text #x2c0 + ) + (new 'static 'hud-scene-info + :name "sewer-blow-up-statue-intro" + :continue "hiphog-start" + :info "sewer-blow-up-statue-intro" + :text #x2c5 + ) + (new 'static 'hud-scene-info + :name "sewer-hosehead" + :continue "sewesc-start" + :info "sewer-hosehead" + :text #x2c7 + ) + (new 'static 'hud-scene-info + :name "sewer-blow-up-statue-res" + :continue "sewesc-start" + :info "sewer-blow-up-statue-res" + :text #x2c6 + ) + (new 'static 'hud-scene-info + :name "city-class-2-race-intro" + :continue "garage-class3-movie" + :info "city-class-2-race-intro" + :text #x298 + ) + (new 'static 'hud-scene-info + :name "city-class-2-race-res" + :continue "garage-class3-movie" + :info "city-class-2-race-res" + :text #x299 + ) + (new 'static 'hud-scene-info + :name "city-stop-bomb-bots-intro" + :continue "hideout-start" + :info "city-stop-bomb-bots-intro" + :text #x2ac + ) + (new 'static 'hud-scene-info + :name "city-get-dark-gun" + :continue "gungame-movie" + :info "city-get-dark-gun" + :text #x2b5 + ) + (new 'static 'hud-scene-info + :name "city-errol-challenge-intro" + :continue "hiphog-start" + :info "city-errol-challenge-intro" + :text #x2ad + ) + (new 'static 'hud-scene-info + :name "city-errol-challenge-res" + :continue "garage-start-class3" + :info "city-errol-challenge-res" + :text #x2bb + ) + (new 'static 'hud-scene-info + :name "ruins-get-to-hut-res" + :continue "ruins-hut" + :info "ruins-get-to-hut-res" + :text #x285 + ) + (new 'static 'hud-scene-info + :name "forest-protect-samos-intro-a" + :continue "onintent-start" + :info "forest-protect-samos-intro-a" + :text #x2f3 + ) + (new 'static 'hud-scene-info + :name "forest-protect-samos-intro-b" + :continue "forest-tree" + :info "forest-protect-samos-intro-b" + :text #x2f4 + ) + (new 'static 'hud-scene-info + :name "forest-protect-samos-res" + :continue "forest-tree" + :info "forest-protect-samos-res" + :text #x2f5 + ) + (new 'static 'hud-scene-info :name "crane-intro" :continue "vinroom-start" :info "crane-intro" :text #x288) + (new 'static 'hud-scene-info :name "crane-victory" :continue "strip-start" :info "crane-victory" :text #x289) + (new 'static 'hud-scene-info + :name "drill-destroy-control-tower-intro" + :continue "vinroom-start" + :info "drill-destroy-control-tower-intro" + :text #x2d7 + ) + (new 'static 'hud-scene-info + :name "drill-top-explode" + :continue "drillmid-checkpoint" + :info "drill-top-explode" + :text #x2d8 + ) + (new 'static 'hud-scene-info + :name "city-save-lurkers-intro" + :continue "kiosk-start" + :info "city-save-lurkers-intro" + :text #x2ab + ) + (new 'static 'hud-scene-info + :name "city-class-1-race-intro-a" + :continue "garage-class3-movie" + :info "city-class-1-race-intro-a" + :text #x29a + ) + (new 'static 'hud-scene-info + :name "city-class-1-race-intro-b" + :continue "stadiumd-start" + :info "city-class-1-race-intro-b" + :text #x29b + ) + (new 'static 'hud-scene-info + :name "city-class-1-race-res" + :continue "stadiumd-start" + :info "city-class-1-race-res" + :text #x29c + ) + (new 'static 'hud-scene-info + :name "palace-sneak-in-res" + :continue "palroof-throne" + :info "palace-sneak-in-res" + :text #x2e0 + ) + (new 'static 'hud-scene-info + :name "castle-krew-boss-fight-intro" + :continue "casboss-start" + :info "castle-krew-boss-fight-intro" + :text #x2e2 + ) + (new 'static 'hud-scene-info + :name "castle-krew-boss-fight-res" + :continue "casboss-start" + :info "castle-krew-boss-fight-res" + :text #x2e3 + ) + (new 'static 'hud-scene-info + :name "city-ashelin-drop-off" + :continue "ctyport-air-train-ashelin" + :info "city-ashelin-drop-off" + :text #x2b9 + ) + (new 'static 'hud-scene-info + :name "city-whack-a-metal-intro" + :continue "hiphog-start" + :info "city-whack-a-metal-intro" + :text #x2ae + ) + (new 'static 'hud-scene-info + :name "city-whack-a-metal-res" + :continue "hiphog-start" + :info "city-whack-a-metal-res" + :text #x2af + ) + (new 'static 'hud-scene-info + :name "city-defend-stadium-intro" + :continue "stadium-blimp" + :info "city-defend-stadium-intro" + :text #x2b0 + ) + (new 'static 'hud-scene-info + :name "city-defend-stadium-res" + :continue "stadium-blimp" + :info "city-defend-stadium-res" + :text #x2b1 + ) + (new 'static 'hud-scene-info + :name "under-find-sig-res" + :continue "under-start" + :info "under-find-sig-res" + :text #x2fd + ) + (new 'static 'hud-scene-info + :name "under-centipede-one" + :continue "under-start" + :info "under-centipede-one" + :text #x2fe + ) + (new 'static 'hud-scene-info + :name "under-centipede-two" + :continue "under-start" + :info "under-centipede-two" + :text #x2ff + ) + (new 'static 'hud-scene-info + :name "under-centipede-three" + :continue "under-start" + :info "under-centipede-three" + :text #x300 + ) + (new 'static 'hud-scene-info + :name "under-get-sig-out-res" + :continue "under-start" + :info "under-get-sig-out-res" + :text #x301 + ) + (new 'static 'hud-scene-info + :name "consite-find-baron-res" + :continue "consite-start" + :info "consite-find-baron-res" + :text #x2e1 + ) + (new 'static 'hud-scene-info + :name "nest-break-barrier-res" + :continue "nest-gun" + :info "nest-break-barrier-res" + :text #x302 + ) + (new 'static 'hud-scene-info + :name "nest-air-train-out" + :continue "nest-warp" + :info "nest-air-train-out" + :text #x303 + ) + (new 'static 'hud-scene-info + :name "nest-air-train-in" + :continue "nest-warp" + :info "nest-air-train-in" + :text #x304 + ) + (new 'static 'hud-scene-info + :name "nest-boss-intro" + :continue "nestb-boss" + :info "nest-kor-boss-fight-intro-b" + :text #x306 + ) + (new 'static 'hud-scene-info + :name "nest-boss-mid" + :continue "nestb-boss" + :info "nest-kor-boss-fight-mid" + :text #x305 + ) + (new 'static 'hud-scene-info + :name "outro" + :continue "nestb-outro" + :info '("outro-nest" "outro-palace" "outro-hiphog" "outro-port") + :text #x308 + ) + ) + ) diff --git a/goal_src/jak2/engine/ui/progress/progress.gc b/goal_src/jak2/engine/ui/progress/progress.gc index 06b4dd2d49..e2282ebe24 100644 --- a/goal_src/jak2/engine/ui/progress/progress.gc +++ b/goal_src/jak2/engine/ui/progress/progress.gc @@ -6,5 +6,3917 @@ ;; dgos: ENGINE, GAME (set! *progress-process* #f) + ;; 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) + (on-off-choice symbol :offset-assert 16) + (which-slot int32 :offset-assert 20) + (starting-state symbol :offset-assert 24) + (last-slot-saved int32 :offset-assert 28) + (slider-backup float :offset-assert 32) + (language-backup language-enum :offset-assert 40) + (center-x-backup int32 :offset-assert 48) + (center-y-backup int32 :offset-assert 52) + (aspect-ratio-backup symbol :offset-assert 56) + (last-slider-sound time-frame :offset-assert 64) + (video-mode-timeout time-frame :offset-assert 72) + (progressive-mode-timeout time-frame :offset-assert 80) + (current-task-index int32 :offset-assert 88) + (current-line-index int32 :offset-assert 92) + (first-closed-line-index int32 :offset-assert 96) + (extra-text-state int32 :offset-assert 100) + (current-task uint8 :offset-assert 104) + (num-open-tasks-found int32 :offset-assert 108) + (num-closed-tasks-found int32 :offset-assert 112) + (color-flash-counter int32 :offset-assert 116) + (num-unlocked-secrets int32 :offset-assert 120) + (game-options-item-selected int32 :offset-assert 124) + (game-options-item-picked basic :offset-assert 128) + (game-options-last-move uint64 :offset-assert 136) + (game-options-vibrations symbol :offset-assert 144) + (game-options-subtitles symbol :offset-assert 148) + (game-options-language-index int32 :offset-assert 152) + (game-options-subtitle-language-index int32 :offset-assert 156) + (graphic-options-item-selected int32 :offset-assert 160) + (graphic-options-item-picked basic :offset-assert 164) + (graphic-options-last-move uint64 :offset-assert 168) + (graphic-options-aspect-ratio symbol :offset-assert 176) + (graphic-options-progressive-scan symbol :offset-assert 180) + (qr-options-item-selected int32 :offset-assert 184) + (qr-options-item-picked basic :offset-assert 188) + (qr-options-last-move uint64 :offset-assert 192) + (qr-options-restart basic :offset-assert 200) + (qr-options-quit basic :offset-assert 204) + (total-num-tasks int32 :offset-assert 208) + (scene-player-act int32 :offset-assert 212) + (stereo-mode-backup int32 :offset-assert 216) + (secrets-unlocked symbol :offset-assert 220) + (missions-total-spacing float :offset-assert 224) + (clear-screen basic :offset-assert 228) + ) + :method-count-assert 9 + :size-assert #xe8 + :flag-assert #x9000000e8 + ) + + +(define *progress-stack* (the-as (pointer uint8) (malloc 'global #x3800))) + +(define *progress-process* (the-as (pointer progress) #f)) + +(define *progress-state* (new 'static 'progress-global-state :which-slot -1 :last-slot-saved -1)) + +(kmemopen global "mc-slot-info") + +(define *progress-save-info* (new 'global 'mc-slot-info)) + +(kmemclose) + +(defun min-max-wrap-around ((arg0 int) (arg1 int) (arg2 int)) + (let ((v1-2 (+ (- 1 arg1) arg2))) + (while (< arg0 arg1) + (+! arg0 v1-2) + ) + (while (< arg2 arg0) + (set! arg0 (- arg0 v1-2)) + ) + ) + arg0 + ) + +(defun progress-intro-start ((arg0 symbol)) + (set! (-> *game-info* mode) 'play) + (if arg0 + (initialize! *game-info* 'game (the-as game-save #f) "intro-start-hero") + (initialize! *game-info* 'game (the-as game-save #f) "intro-start") + ) + (set-master-mode 'game) + 0 + ) + +(defmethod init-defaults progress ((obj progress)) + "Initialize default menu settings." + (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! (-> *progress-state* on-off-choice) #f) + (set! (-> *progress-state* color-flash-counter) 0) + (set! (-> *progress-state* game-options-item-selected) 0) + (set! (-> *progress-state* game-options-item-picked) #f) + (set! (-> *progress-state* game-options-vibrations) (-> *setting-control* user-default vibration)) + (set! (-> *progress-state* game-options-subtitles) (-> *setting-control* user-default subtitle)) + (set! (-> *progress-state* game-options-language-index) + (the-as int (-> *setting-control* user-default language)) + ) + (set! (-> *progress-state* game-options-subtitle-language-index) + (the-as int (-> *setting-control* user-default subtitle-language)) + ) + (set! (-> *progress-state* graphic-options-item-selected) 0) + (set! (-> *progress-state* graphic-options-item-picked) #f) + (set! (-> *progress-state* graphic-options-aspect-ratio) (get-aspect-ratio)) + (set! (-> *progress-state* graphic-options-progressive-scan) + (-> *setting-control* user-default use-progressive-scan) + ) + (set! (-> *progress-state* qr-options-item-selected) 0) + (set! (-> *progress-state* qr-options-item-picked) #f) + (set! (-> *progress-state* total-num-tasks) 0) + (set! (-> *progress-state* secrets-unlocked) #f) + (set! (-> *progress-state* clear-screen) #f) + (set! (-> obj sliding) 0.0) + (set! (-> obj sliding-height) 0.0) + (set! (-> obj sliding-off) 1.0) + (set! (-> obj scanlines-alpha) 0.0) + (set! (-> (the-as menu-on-off-game-vibrations-option (-> (the-as (array menu-option) (-> *game-options* options 0)) 0)) + value-to-modify + ) + (&-> *setting-control* user-default vibration) + ) + (set! (-> (the-as menu-on-off-game-subtitles-option (-> (the-as (array menu-option) (-> *game-options* options 0)) 1)) + value-to-modify + ) + (&-> *setting-control* user-default subtitle) + ) + (set! (-> (the-as menu-language-option (-> (the-as (array menu-option) (-> *game-options* options 0)) 2)) + language-selection + ) + (-> *setting-control* user-current language) + ) + (set! (-> (the-as menu-language-option (-> (the-as (array menu-option) (-> *game-options* options 0)) 2)) + language-direction + ) + #t + ) + (set! (-> (the-as menu-language-option (-> (the-as (array menu-option) (-> *game-options* options 0)) 2)) + language-transition + ) + #f + ) + (set! (-> (the-as menu-language-option (-> (the-as (array menu-option) (-> *game-options* options 0)) 2)) + language-x-offset + ) + 0 + ) + (set! (-> (the-as menu-on-off-option (-> (the-as (array menu-option) (-> *game-options-japan* options 0)) 0)) + value-to-modify + ) + (&-> *setting-control* user-default vibration) + ) + (set! (-> (the-as menu-on-off-option (-> (the-as (array menu-option) (-> *game-options-demo* options 0)) 0)) + value-to-modify + ) + (&-> *setting-control* user-default vibration) + ) + (set! (-> (the-as menu-on-off-option (-> (the-as (array menu-option) (-> *graphic-options* options 0)) 2)) + value-to-modify + ) + (&-> *setting-control* user-default use-progressive-scan) + ) + (set! (-> (the-as menu-on-off-option (-> (the-as (array menu-option) (-> *graphic-title-options-pal* options 0)) 2)) + value-to-modify + ) + (&-> *setting-control* user-default use-progressive-scan) + ) + (set! (-> (the-as menu-slider-option (-> (the-as (array menu-option) (-> *sound-options* options 0)) 0)) + value-to-modify + ) + (&-> *setting-control* user-default sfx-volume) + ) + (set! (-> (the-as menu-slider-option (-> (the-as (array menu-option) (-> *sound-options* options 0)) 1)) + value-to-modify + ) + (&-> *setting-control* user-default music-volume) + ) + (set! (-> (the-as menu-slider-option (-> (the-as (array menu-option) (-> *sound-options* options 0)) 2)) + value-to-modify + ) + (&-> *setting-control* user-default dialog-volume) + ) + (set! (-> (the-as menu-missions-option (-> (the-as (array menu-option) (-> *missions-options* options 0)) 0)) + task-line-index + ) + 0 + ) + (set-setting-by-param *setting-control* 'extra-bank '((force2 menu1)) 0 0) + ) + +(deftype hud-ring-cell (process-drawable) + ((parent-override (pointer progress) :offset 16) + (joint-idx int32 :offset-assert 200) + (init-angle degrees :offset-assert 204) + (graphic-index int32 :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 21 + :size-assert #xd4 + :flag-assert #x15006000d4 + (:methods + (idle () _type_ :state 20) + ) + ) + + +(defbehavior hud-ring-cell-init-by-other hud-ring-cell ((arg0 int) (arg1 float) (arg2 int)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-hud-ring-part" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self joint-idx) arg0) + (set! (-> self init-angle) arg1) + (set! (-> self graphic-index) arg2) + (set! (-> self root trans quad) (-> (the-as progress (-> self parent-override 0)) root trans quad)) + (quaternion-copy! (-> self root quat) (-> (the-as progress (-> self parent-override 0)) root quat)) + (quaternion-normalize! (-> self root quat)) + (set! (-> self root scale quad) (-> (the-as progress (-> self parent-override 0)) root scale quad)) + (let ((gp-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *z-vector* (-> self init-angle)))) + (quaternion-normalize! gp-1) + (quaternion*! (-> self root quat) (-> self root quat) gp-1) + ) + (quaternion-normalize! (-> self root quat)) + (set! (-> self draw color-mult x) 0.8) + (set! (-> self draw color-mult y) 0.8) + (set! (-> self draw color-mult z) 0.8) + (logior! (-> self draw global-effect) (draw-control-global-effect title-light)) + (logior! (-> self draw status) (draw-control-status hud)) + (draw-control-method-12 (-> self draw) (the-as uint 1) 0) + (draw-control-method-12 (-> self draw) (the-as uint 0) 2046) + (cond + ((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk)) + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-kiosk-graphic-remap* + (mod + (+ (-> self graphic-index) (-> (the-as progress (-> self parent-override 0)) graphic-index)) + (-> *hud-ring-kiosk-graphic-remap* length) + ) + ) + 0 + ) + ) + ((and (= *cheat-mode* #f) (demo?)) + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-demo-graphic-remap* + (mod + (+ (-> self graphic-index) (-> (the-as progress (-> self parent-override 0)) graphic-index)) + (-> *hud-ring-kiosk-graphic-remap* length) + ) + ) + 0 + ) + ) + (else + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-graphic-remap* + (mod + (+ (-> self graphic-index) (-> (the-as progress (-> self parent-override 0)) graphic-index)) + (-> *hud-ring-graphic-remap* length) + ) + ) + 0 + ) + ) + ) + (go-virtual idle) + ) + +(defstate idle (hud-ring-cell) + :virtual #t + :code (behavior () + (until #f + (ja :num-func num-func-identity :frame-num 0.0) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (vector<-cspace! + (-> self root trans) + (-> (the-as progress (-> self parent-override 0)) node-list data (-> self joint-idx)) + ) + (when (-> (the-as progress (-> self parent-override 0)) main-menu) + (draw-control-method-12 (-> self draw) (the-as uint 0) 2046) + (cond + ((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk)) + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-kiosk-graphic-remap* + (mod + (+ (-> self graphic-index) (-> (the-as progress (-> self parent-override 0)) graphic-index)) + (-> *hud-ring-kiosk-graphic-remap* length) + ) + ) + 0 + ) + ) + ((and (= *cheat-mode* #f) (demo?)) + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-demo-graphic-remap* + (mod + (+ (-> self graphic-index) (-> (the-as progress (-> self parent-override 0)) graphic-index)) + (-> *hud-ring-kiosk-graphic-remap* length) + ) + ) + 0 + ) + ) + (else + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-graphic-remap* + (mod + (+ (-> self graphic-index) (-> (the-as progress (-> self parent-override 0)) graphic-index)) + (-> *hud-ring-graphic-remap* length) + ) + ) + 0 + ) + ) + ) + ) + (when (= (-> self init-angle) 0.0) + (cond + ((= (-> (the-as progress (-> self parent-override 0)) ring-angle) + (-> (the-as progress (-> self parent-override 0)) ring-want-angle) + ) + (set! (-> self draw color-mult x) 1.2) + (set! (-> self draw color-mult y) 1.2) + (set! (-> self draw color-mult z) 1.2) + ) + (else + (set! (-> self draw color-mult x) 0.8) + (set! (-> self draw color-mult y) 0.8) + (set! (-> self draw color-mult z) 0.8) + ) + ) + ) + (let* ((t9-6 quaternion-vector-angle!) + (a0-8 (new 'stack-no-clear 'quaternion)) + (a1-26 *z-vector*) + (f0-8 (-> self init-angle)) + (f1-2 (-> (the-as progress (-> self parent-override 0)) ring-angle)) + (gp-0 (t9-6 a0-8 a1-26 (+ f0-8 (- f1-2 (* (the float (the int (/ f1-2 6553.6))) 6553.6))))) + ) + (quaternion-normalize! gp-0) + (quaternion-copy! (-> self root quat) (-> (the-as progress (-> self parent-override 0)) root quat)) + (quaternion-normalize! (-> self root quat)) + (quaternion*! (-> self root quat) (-> self root quat) gp-0) + ) + (quaternion-normalize! (-> self root quat)) + (ja-post) + (none) + ) + ) + +(defbehavior progress-init-by-other progress ((arg0 symbol)) + (hide-hud #f) + (disable-level-text-file-loading) + (logclear! (-> self mask) (process-mask menu progress actor-pause)) + (add-setting! 'process-mask 'set 0 (process-mask progress)) + (set! (-> self clock) (-> *display* real-clock)) + (apply-settings *setting-control*) + (set-blackout-frames 0) + (set! *pause-lock* #f) + (set! (-> self root) (new 'process 'trsqv)) + (matrix->quaternion (-> self root quat) (-> *math-camera* inv-camera-rot)) + (let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *y-vector* 32768.0))) + (quaternion*! (-> self root quat) (-> self root quat) a2-2) + ) + (quaternion-normalize! (-> self root quat)) + (quaternion-copy! (-> self init-quat) (-> self root quat)) + (set-vector! (-> self root scale) 0.09 0.09 0.09 1.0) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-hud-ring" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logior! (-> self draw global-effect) (draw-control-global-effect title-light)) + (logior! (-> self skel status) (joint-control-status sync-math)) + (set! (-> self state-pos) 0) + (set! (-> self menu-transition) 1.0) + (set! (-> self anim-frame) 0.0) + (set! (-> self pos-transition) 1.0) + (init-defaults self) + (set-next-state self arg0 0) + (set! (-> *progress-state* starting-state) (-> self next)) + (set! (-> self current) (-> self next)) + (if (= arg0 'main) + (set! (-> self next) 'none) + ) + (set! (-> self ring-angle) 0.0) + (set! (-> self ring-want-angle) 0.0) + (set! (-> self option-index) 0) + (set! (-> self want-option-index) 0) + (set! (-> self graphic-index) 0) + (set! (-> self swing) 0.0) + (set! (-> self main-menu) #f) + (set-menu-options self (-> self current)) + (logior! (-> self draw status) (draw-control-status hud)) + (let ((f30-0 -6571.804)) + (process-spawn hud-ring-cell 15 (* 0.0 f30-0) 0 :to self) + (process-spawn hud-ring-cell 9 f30-0 1 :to self) + (process-spawn hud-ring-cell 8 (* 2.0 f30-0) 2 :to self) + (process-spawn hud-ring-cell 7 (* 3.0 f30-0) 3 :to self) + (process-spawn hud-ring-cell 6 (* 4.0 f30-0) 4 :to self) + (process-spawn hud-ring-cell 16 (* -5.0 f30-0) 5 :to self) + (process-spawn hud-ring-cell 14 (* -4.0 f30-0) 6 :to self) + (process-spawn hud-ring-cell 13 (* -3.0 f30-0) 7 :to self) + (process-spawn hud-ring-cell 12 (* -2.0 f30-0) 8 :to self) + (process-spawn hud-ring-cell 11 (* -1.0 f30-0) 9 :to self) + ) + (bigmap-method-14 *bigmap*) + (go-virtual come-in) + ) + +(defun set-ring-position ((arg0 progress)) + (let ((s3-0 (new-stack-vector0)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 y) (+ -8.0 (-> s3-0 y))) + (case (get-aspect-ratio) + (('aspect4x3) + (position-in-front-of-screen! s4-0 12288.0 s3-0) + (position-in-front-of-screen! s5-0 -4096.0 s3-0) + ) + (else + (position-in-front-of-screen! s4-0 16384.0 s3-0) + (position-in-front-of-screen! s5-0 -18022.4 s3-0) + ) + ) + (vector-! s5-0 s5-0 s4-0) + (set! (-> arg0 root trans x) (+ (-> s4-0 x) (* (-> arg0 pos-transition) (-> s5-0 x)))) + (set! (-> arg0 root trans y) (+ (-> s4-0 y) (* (-> arg0 pos-transition) (-> s5-0 y)))) + (set! (-> arg0 root trans z) (+ (-> s4-0 z) (* (-> arg0 pos-transition) (-> s5-0 z)))) + ) + ) + +(defun activate-progress ((arg0 process) (arg1 symbol)) + (when *target* + (when (progress-allowed?) + (when (nonzero? (-> *progress-state* video-mode-timeout)) + (set! (-> *progress-state* video-mode-timeout) 0) + (set! (-> *progress-state* video-mode-choice) 'pal) + (set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice)) + ) + (when (nonzero? (-> *progress-state* progressive-mode-timeout)) + (set! (-> *progress-state* progressive-mode-timeout) 0) + (set! (-> *setting-control* user-default use-progressive-scan) #f) + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (set-progressive-scan #f) + ) + (cond + (*progress-process* + (deactivate (-> *progress-process* 0)) + (set! (-> *blit-displays-work* menu-mode) (the-as basic #t)) + (set! *progress-process* (process-spawn progress arg1 :to arg0 :stack (&-> *progress-stack* 14336))) + (set-master-mode 'progress) + ) + (else + (set! *progress-process* (process-spawn progress arg1 :to arg0 :stack (&-> *progress-stack* 14336))) + (set-master-mode 'progress) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod deactivate progress ((obj progress)) + (remove-setting-by-arg0 *setting-control* 'extra-bank) + ((method-of-object *bigmap* bigmap-method-15)) + (set! (-> *blit-displays-work* menu-mode) #f) + (set! *progress-process* (the-as (pointer progress) #f)) + (enable-level-text-file-loading) + (persist-with-delay *setting-control* 'allow-progress (seconds 0.1) 'allow-progress #f 0.0 0) + (persist-with-delay *setting-control* 'allow-pause (seconds 0.1) 'allow-pause #f 0.0 0) + ((the-as (function progress none) (find-parent-method progress 10)) obj) + (none) + ) + +(defun deactivate-progress () + (if *progress-process* + (deactivate (-> *progress-process* 0)) + ) + 0 + (none) + ) + +(defun hide-progress-screen () + (if (and *progress-process* *progress-state* (!= (-> *progress-state* starting-state) 'title)) + (set-next-state (-> *progress-process* 0) 'go-away 0) + ) + 0 + (none) + ) + +(defmethod progress-method-26 progress ((obj progress)) + (and *progress-process* + (-> *progress-process* 0 next-state) + (= (-> *progress-process* 0 next-state name) 'gone) + ) + ) + +(defun progress-allowed? () + (not (or (-> *setting-control* user-current talking) + (-> *setting-control* user-current movie) + (movie?) + (handle->process (-> *game-info* pov-camera-handle)) + (handle->process (-> *game-info* other-camera-handle)) + (< (-> *display* base-clock frame-counter) (-> *game-info* letterbox-time)) + (< (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) + (!= (-> *setting-control* user-current bg-a) 0.0) + (!= (-> *setting-control* user-current bg-a-force) 0.0) + (not (-> *setting-control* user-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*) + (= *cheat-mode* 'camera) + (= *master-mode* 'freeze) + *master-exit* + (not *common-text*) + (< (memory-free *nk-dead-pool*) #x8000) + ) + ) + ) + ) + +(defmethod can-go-back? progress ((obj progress)) + (and (= (-> obj menu-transition) 0.0) + (not (-> obj selected-option)) + (!= (-> obj current) 'loading) + (!= (-> obj current) 'saving) + (!= (-> obj current) 'formatting) + (!= (-> obj current) 'creating) + (!= (-> obj current) 'error-disc-removed) + (!= (-> obj current) 'error-reading) + (!= (-> obj current) 'card-removed) + (!= (-> obj current) 'error-auto-saving) + (!= (-> obj current) 'title) + (!= (-> obj current) 'insufficient-space) + (!= (-> obj current) 'secrets-insufficient-space) + (!= (-> obj current) 'no-memory-card) + (!= (-> obj current) 'icon-info) + (!= (-> obj current) 'insert-card) + (!= (-> obj current) 'progressive-mode-ok) + (!= (-> obj current) 'video-mode-ok) + (!= (-> obj current) 'progressive-mode-warning) + (!= (-> obj current) 'video-mode-warning) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun menu-update-purchase-secrets ((arg0 menu-secret-option)) + (let* ((a1-1 (logtest? (-> *game-info* secrets) (game-secrets hero-mode))) + (v1-3 (if (not a1-1) + 0 + (-> arg0 num-items) + ) + ) + (a1-3 (if (not a1-1) + (+ (-> arg0 num-items) -1) + (+ (-> arg0 num-items) -1 (-> arg0 num-hero-items)) + ) + ) + ) + (while (>= a1-3 v1-3) + (let* ((a2-1 v1-3) + (t0-1 (-> arg0 secret-items a2-1 cost)) + (a3-6 (-> arg0 secret-items a2-1 flag)) + (t2-1 (-> arg0 secret-items a2-1 avail-after)) + (t1-5 (the int (-> *game-info* skill-total))) + ) + (when (and (logtest? (-> *game-info* sub-task-list t2-1 flags) (game-task-node-flag closed)) (>= t1-5 t0-1)) + (logior! (-> *game-info* purchase-secrets) a3-6) + (if (= (-> arg0 secret-items a2-1 can-toggle) 'auto) + (logior! (-> *game-info* secrets) a3-6) + ) + ) + ) + (+! v1-3 1) + ) + ) + (none) + ) + +(defmethod progress-method-28 progress ((obj progress) (arg0 symbol)) + (let ((v1-0 *progress-save-info*) + (v0-0 arg0) + ) + (when v1-0 + (when (and v1-0 (= (-> obj menu-transition) 0.0)) + (case arg0 + (('insufficient-space 'no-memory-card 'unformatted-card) + (cond + ((zero? (-> v1-0 handle)) + (set! v0-0 'no-memory-card) + ) + ((zero? (-> v1-0 formatted)) + (cond + ((or (zero? (-> obj state-pos)) (!= (-> *progress-state* starting-state) 'title)) + (set! v0-0 'go-away) + ) + (else + (if (!= arg0 'unformatted-card) + (set! v0-0 'format-card) + ) + ) + ) + ) + ((and (zero? (-> v1-0 inited)) (< (-> v1-0 mem-actual) (-> v1-0 mem-required))) + (set! v0-0 'insufficient-space) + ) + ((or (zero? (-> obj state-pos)) (!= (-> *progress-state* starting-state) 'title)) + (set! v0-0 'go-away) + ) + (else + (set! v0-0 'select-save) + ) + ) + ) + (('insert-card) + (if (= (-> v1-0 inited) 1) + (set! v0-0 'select-load) + ) + ) + ) + (cond + ((zero? (-> v1-0 handle)) + (cond + ((-> *setting-control* user-current auto-save) + (set! v0-0 'card-removed) + ) + (else + (case arg0 + (('select-load) + (set! v0-0 'insert-card) + ) + (('format-card + 'insufficient-space + 'unformatted-card + 'select-save + 'select-save-title + 'select-save-title-hero + 'create-game + 'already-exists + ) + (set! v0-0 'no-memory-card) + ) + ) + ) + ) + ) + ((zero? (-> v1-0 formatted)) + (case arg0 + (('select-load) + (set! v0-0 'insert-card) + ) + (('select-save 'select-save-title 'select-state-title-hero) + (set! v0-0 'format-card) + ) + ) + ) + ((zero? (-> v1-0 inited)) + (case arg0 + (('select-save 'select-save-title 'select-save-title-hero) + (if (>= (-> v1-0 mem-actual) (-> v1-0 mem-required)) + (set! v0-0 'create-game) + (set! v0-0 'insufficient-space) + ) + ) + (('select-load) + (set! v0-0 'insert-card) + ) + ) + ) + ) + ) + ) + v0-0 + ) + ) + +(defmethod progress-method-29 progress ((obj progress)) + (let ((v1-0 (-> obj state-pos))) + (cond + ((< v1-0 5) + (set! (-> obj state-stack v1-0) (-> obj current)) + (set! (-> obj option-index-stack v1-0) (-> obj option-index)) + (set! (-> obj state-pos) (+ v1-0 1)) + ) + (else + (format #t "ERROR: Can't push any more states on the state-stack.~%") + ) + ) + ) + 0 + ) + +(defmethod progress-method-30 progress ((obj progress)) + (let ((v1-0 (-> obj state-pos))) + (cond + ((> v1-0 0) + (let ((a2-0 (+ v1-0 -1))) + (set! (-> obj state-pos) a2-0) + (set-next-state obj (-> obj state-stack a2-0) (-> obj option-index-stack a2-0)) + ) + ) + (else + (set-next-state obj 'go-away 0) + ) + ) + ) + (set! (-> *progress-state* game-options-item-selected) 0) + (set! (-> *progress-state* game-options-item-picked) #f) + (set! (-> *progress-state* graphic-options-item-selected) 0) + (set! (-> *progress-state* graphic-options-item-picked) #f) + (set! (-> *progress-state* qr-options-item-selected) 0) + (set! (-> *progress-state* qr-options-item-picked) #f) + 0 + ) + +(defmethod set-next-state progress ((obj progress) (arg0 symbol) (arg1 int)) + "Set the next menu state specified by arg0 at the index specified by arg1." + (set! (-> *progress-state* clear-screen) #f) + (when (!= arg0 (-> obj current)) + (set! (-> *progress-state* yes-no-choice) #f) + (set! (-> obj selected-option) #f) + (set! (-> obj next-option-index) arg1) + (set! (-> obj next) arg0) + (case (-> obj next) + (('select-load 'select-save 'select-save-title 'select-save-title-hero) + (set! (-> obj next) (progress-method-28 obj (-> obj next))) + ) + ) + (case (-> obj next) + (('creating) + (auto-save-command 'create-file 0 0 obj #f) + ) + (('loading) + (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which-slot)) + (auto-save-command 'restore 0 (-> *progress-state* which-slot) obj #f) + (set! (-> (the-as menu-missions-option (-> (the-as (array menu-option) (-> *missions-options* options 0)) 0)) + task-line-index + ) + 0 + ) + 0 + ) + (('saving) + (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which-slot)) + (auto-save-command 'save 0 (-> *progress-state* which-slot) obj #f) + ) + (('formatting) + (auto-save-command 'format-card 0 0 obj #f) + ) + (('select-save 'select-load) + (set! (-> obj next-option-index) (max 0 (-> *progress-state* last-slot-saved))) + ) + (('card-removed) + (set! (-> *progress-state* last-slot-saved) 0) + 0 + ) + ) + ) + 0 + ) + +(defmethod set-menu-options progress ((obj progress) (arg0 symbol)) + "Set the menu options for the menu state specified by arg0." + (set! (-> obj current-options) #f) + (case arg0 + (('go-away) + (go (method-of-object obj go-away)) + ) + (('main) + (set! (-> obj current-options) (cond + (*cheat-mode* + *main-options* + ) + ((= *kernel-boot-message* 'kiosk) + *main-kiosk-options* + ) + ((demo?) + *main-demo-options* + ) + (else + *main-options* + ) + ) + ) + ) + (('game-options) + (set! (-> obj current-options) + (cond + ((demo?) + (if (= (scf-get-territory) 1) + *game-options* + *game-options-demo* + ) + ) + ((and (= (scf-get-territory) 2) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))) + *game-options* + ) + (else + *game-options* + ) + ) + ) + ) + (('graphic-options) + (set! (-> obj current-options) + (if (or (= (scf-get-territory) 1) (and (= *progress-cheat* 'pal) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) + *graphic-title-options-pal* + *graphic-options* + ) + ) + ) + (('sound-options) + (set! (-> obj current-options) *sound-options*) + ) + (('select-load 'select-save) + (set! (-> obj current-options) *load-save-options*) + ) + (('select-save-title) + (set! (-> obj current-options) *save-options-title*) + ) + (('select-save-title-hero) + (logior! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) + (logior! (-> *game-info* secrets) (game-secrets hero-mode)) + (set! (-> obj current-options) *save-options-title*) + ) + (('loading 'saving 'creating 'formatting) + (set! (-> obj current-options) *loading-options*) + ) + (('unformatted-card 'insufficient-space 'no-memory-card) + (set! (-> obj current-options) *insufficient-space-options*) + ) + (('secrets-insufficient-space 'secrets-no-memory-card) + (set! (-> obj current-options) *secrets-insufficient-space-options*) + ) + (('insert-card) + (set! (-> obj current-options) *insert-card-options*) + ) + (('error-loading 'error-saving 'error-formatting 'error-creating) + (set! (-> obj current-options) *error-loading-options*) + ) + (('error-auto-saving) + (set! (-> obj current-options) *error-auto-saving-options*) + ) + (('card-removed) + (set! (-> obj current-options) *card-removed-options*) + ) + (('error-disc-removed) + (set! (-> obj current-options) *error-disc-removed-options*) + ) + (('error-reading) + (set! (-> obj current-options) *error-reading-options*) + ) + (('icon-info) + (set! (-> obj current-options) *icon-info-options*) + ) + (('format-card) + (set! (-> obj current-options) *format-card-options*) + ) + (('already-exists) + (set! (-> obj current-options) *already-exists-options*) + ) + (('create-game) + (set! (-> obj current-options) *create-game-options*) + ) + (('video-mode-warning) + (set! (-> obj current-options) *video-mode-warning-options*) + ) + (('video-mode-ok) + (set! (-> obj current-options) *video-mode-ok-options*) + ) + (('progressive-mode-warning) + (set! (-> obj current-options) *progressive-mode-warning-options*) + ) + (('progressive-mode-ok) + (set! (-> obj current-options) *progressive-mode-ok-options*) + ) + (('quit) + (set! (-> obj current-options) *quit-options*) + ) + (('title) + (set! (-> obj current-options) *title*) + ) + (('title-options) + (set! (-> obj current-options) *options*) + ) + (('select-start 'select-pre-start 'select-kiosk-start) + (set! (-> obj current-options) *select-start-options*) + (set! (-> (the-as menu-select-start-option (-> (the-as (array menu-option) (-> *select-start-options* options 0)) 0)) + task-index + ) + 0 + ) + 0 + ) + (('select-scene) + (set! (-> obj current-options) *select-scene-options*) + (set! (-> (the-as menu-select-scene-option (-> (the-as (array menu-option) (-> *select-scene-options* options 0)) 0)) + task-index + ) + 0 + ) + 0 + ) + (('select-scene-special) + (set! (-> *progress-state* starting-state) 'title) + (set! (-> obj state-pos) 0) + (let ((v1-67 (-> obj state-pos))) + (set! (-> obj state-stack v1-67) 'title) + (set! (-> obj option-index-stack v1-67) 3) + (let ((v1-68 (+ v1-67 1))) + (set! (-> obj state-stack v1-68) 'unlocked-secrets) + (set! (-> obj option-index-stack v1-68) (-> obj option-index)) + (set! (-> obj state-pos) (+ v1-68 1)) + ) + ) + (dotimes (s5-1 (-> obj state-pos)) + (format + #t + "select-scene-special: ~S ~D~%" + (symbol->string (-> obj state-stack s5-1)) + (-> obj option-index-stack s5-1) + ) + ) + (set! (-> obj current-options) *select-scene-options*) + ) + (('bigmap) + (set! (-> obj current-options) *bigmap-options*) + ) + (('missions) + (set! (-> *progress-state* missions-total-spacing) 0.0) + (set! (-> (the-as menu-missions-option (-> (the-as (array menu-option) (-> *missions-options* options 0)) 0)) + task-line-index + ) + 0 + ) + (set! (-> obj current-options) *missions-options*) + ) + (('highscores) + (set! (-> (the-as menu-highscores-option (-> (the-as (array menu-option) (-> *highscores-options* options 0)) 0)) + page-index + ) + 0 + ) + (set! (-> (the-as menu-highscores-option (-> (the-as (array menu-option) (-> *highscores-options* options 0)) 0)) + prev-page-index + ) + 0 + ) + (set! (-> obj current-options) *highscores-options*) + ) + (('secret) + (set! (-> obj secret-buying) #f) + (set! (-> obj current-options) *secret-options*) + ) + (('quit-restart) + (set! (-> obj current-options) *quit-restart-options*) + ) + (('unlocked-secrets) + (set! (-> obj current-options) *unlocked-secrets*) + ) + ) + (when (= (-> obj current-options) #f) + (format #t "Didn't find new menu settings!!~%") + (progress-method-30 obj) + ) + 0 + ) + +(defmethod progress-method-25 progress ((obj progress)) + (mc-get-slot-info 0 *progress-save-info*) + (when (-> obj current-options) + (let ((s5-0 (-> obj current-options options 0))) + (when (and s5-0 (= (-> obj menu-transition) 0.0)) + (respond-progress + (the-as menu-option (-> s5-0 options (-> obj option-index))) + obj + (and (= (-> obj menu-transition) 0.0) (-> obj selected-option)) + ) + (cond + ((-> obj selected-option) + (cond + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> obj selected-option) #f) + ) + ((cpad-pressed? 0 triangle) + (if (= (-> obj current-options) *main-options*) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (set! (-> obj selected-option) #f) + ) + ) + ) + (else + (cond + ((logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (cond + ((= (-> obj current-options) *main-options*) + (sound-play "ring-select") + ) + ((!= (length s5-0) 1) + (sound-play "roll-over") + ) + ) + (if (and (= *title* (-> obj current-options)) (not (memcard-unlocked-secrets? #f)) (zero? (-> obj option-index))) + (set! (-> obj option-index) 3) + ) + (cond + ((> (-> obj want-option-index) 0) + (set! (-> obj want-option-index) -1) + ) + ((< -2 (-> obj want-option-index)) + (+! (-> obj want-option-index) -1) + ) + ) + ) + ((logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (cond + ((= (-> obj current-options) *main-options*) + (sound-play "ring-select") + ) + ((!= (length s5-0) 1) + (sound-play "roll-over") + ) + ) + (cond + ((< (-> obj want-option-index) 0) + (set! (-> obj want-option-index) 1) + ) + ((< (-> obj want-option-index) 2) + (+! (-> obj want-option-index) 1) + ) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (if (not (-> *progress-state* clear-screen)) + (sound-play "generic-beep") + ) + (set! (-> obj selected-option) #t) + ) + ((cpad-pressed? 0 triangle) + (when (can-go-back? obj) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (if (and (= (-> *progress-state* starting-state) 'main) (!= (-> obj current-options) *main-options*)) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 obj) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defbehavior progress-trans progress () + (cond + ((and (= (-> self next) 'none) + (or (= (-> *progress-state* starting-state) 'main) (= (-> self anim-frame) 1.0)) + ) + (set! (-> self menu-transition) + (seek-ease + (-> self menu-transition) + 0.0 + (* 0.1 (-> self clock time-adjust-ratio)) + 0.4 + (* 0.01 (-> self clock time-adjust-ratio)) + ) + ) + ) + (else + (seek! (-> self menu-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))) + (when (and (= (-> self menu-transition) 1.0) + (or (and (nonzero? (-> self state-pos)) (= (-> self anim-frame) 1.0)) + (or (and (zero? (-> self state-pos)) (= (-> self anim-frame) 0.0)) + (and (!= (-> *progress-state* starting-state) 'main) (!= (-> self next) 'none)) + ) + ) + ) + (set! (-> self current) (-> self next)) + (set! (-> self next) 'none) + (set! (-> self option-index) (-> self next-option-index)) + (set! (-> self want-option-index) 0) + (set-menu-options self (-> self current)) + (set! (-> self scanlines-alpha) 0.0) + ) + ) + ) + (set! (-> self main-menu) + (and (zero? (-> self state-pos)) (and (= (-> self menu-transition) 0.0) + (= (-> self next) 'none) + (or (= (-> self state-stack 0) 'main) (= (-> self current) 'main)) + ) + ) + ) + (when *cheat-mode* + (when (zero? (-> self state-pos)) + (cond + ((and (cpad-hold? 0 l2) (cpad-hold? 0 r1)) + (if (= (-> self current-options) *main-options*) + (set! (-> self current-options) *main-options-debug*) + ) + ) + ((= (-> self current-options) *main-options-debug*) + (set! (-> self current-options) *main-options*) + ) + ) + ) + ) + (if (= (-> self ring-angle) (-> self ring-want-angle)) + (progress-method-25 self) + ) + (let ((f30-0 (* 0.005 (-> self clock time-adjust-ratio)))) + (cond + ((= (-> self menu-transition) 1.0) + (if (and (zero? (-> self state-pos)) (= (-> *progress-state* starting-state) 'main)) + (seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + ) + (let ((f0-27 (if (and (zero? (-> self state-pos)) (!= (-> *progress-state* starting-state) 'title)) + 0.0 + 0.2 + ) + ) + ) + (when (= (-> self next) 'bigmap) + (set! f0-27 0.4) + (set! f30-0 (* 0.008 (-> self clock time-adjust-ratio))) + ) + (seek! (-> self pos-transition) f0-27 f30-0) + ) + ) + ((zero? (-> self state-pos)) + (if (= (-> self current) 'bigmap) + (set! f30-0 (* 0.05 (-> self clock time-adjust-ratio))) + ) + (if (!= (-> *progress-state* starting-state) 'title) + (seek! (-> self pos-transition) 0.0 f30-0) + ) + ) + ) + ) + (if (!= (-> *progress-state* starting-state) 'main) + (set! (-> self pos-transition) 0.2) + ) + (set-ring-position self) + (when (= (-> self ring-angle) (-> self ring-want-angle)) + (cond + ((< (-> self want-option-index) 0) + (cond + ((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk)) + (if (> (-> self option-index) 0) + (+! (-> self option-index) -1) + ) + ) + (else + (set! (-> self option-index) + (min-max-wrap-around (+ (-> self option-index) -1) 0 (+ (length (-> self current-options options 0)) -1)) + ) + ) + ) + (set! (-> self graphic-index) (-> self option-index)) + (+! (-> self want-option-index) 1) + ) + ((> (-> self want-option-index) 0) + (cond + ((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk)) + (if (< (-> self option-index) (+ (length (-> self current-options options 0)) -1)) + (+! (-> self option-index) 1) + ) + ) + (else + (set! (-> self option-index) + (min-max-wrap-around (+ (-> self option-index) 1) 0 (+ (length (-> self current-options options 0)) -1)) + ) + ) + ) + (+! (-> self want-option-index) -1) + ) + ) + ) + (if (= (-> self anim-frame) 0.0) + (set! (-> self swing) (seek-ease + (-> self swing) + 4.0 + (* 0.05 (-> self clock time-adjust-ratio)) + 0.5 + (* 0.005 (-> self clock time-adjust-ratio)) + ) + ) + (set! (-> self swing) (seek-ease + (-> self swing) + 0.0 + (* 0.07 (-> self clock time-adjust-ratio)) + 0.5 + (* 0.007 (-> self clock time-adjust-ratio)) + ) + ) + ) + (when (-> self main-menu) + (set! (-> self ring-want-angle) (ceil (* 182.04445 (* 36.0 (the float (-> self option-index)))))) + (if (and (= (-> self ring-want-angle) 0.0) (< 32768.0 (-> self ring-angle))) + (set! (-> self ring-want-angle) 65536.0) + ) + (let ((f0-54 (- (-> self ring-want-angle) (-> self ring-angle)))) + (when (< 32768.0 (fabs f0-54)) + (if (< 0.0 f0-54) + (set! (-> self ring-angle) (+ 65536.0 (-> self ring-angle))) + (set! (-> self ring-angle) (+ -65536.0 (-> self ring-angle))) + ) + ) + ) + (seek! (-> self ring-angle) (-> self ring-want-angle) (* 455.1111 (-> self clock time-adjust-ratio))) + ) + (let ((gp-4 (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + *x-vector* + (* 182.04445 (* (-> self swing) (sin (the float (* 40 (-> self clock frame-counter)))))) + ) + ) + (s5-4 (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + *y-vector* + (* 182.04445 (* (-> self swing) (sin (the float (* 0 (-> self clock frame-counter)))))) + ) + ) + ) + (quaternion*! (-> self root quat) (-> self init-quat) gp-4) + (quaternion*! (-> self root quat) (-> self root quat) s5-4) + ) + (quaternion-normalize! (-> self root quat)) + (if (= (-> self ring-angle) (-> self ring-want-angle)) + (set! (-> self graphic-index) (-> self option-index)) + ) + 0 + (none) + ) + +(defun begin-scan ((arg0 hud-box) (arg1 progress)) + (cond + ((or (= (-> arg1 current) 'bigmap) (= (-> arg1 next) 'bigmap)) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg0 min x) 0.0) + (set! (-> arg0 min y) 0.0) + (set! (-> arg0 max x) 512.0) + (set! (-> arg0 max y) 416.0) + ) + (('aspect16x9) + (set! (-> arg0 min x) 0.0) + (set! (-> arg0 min y) 0.0) + (set! (-> arg0 max x) 512.0) + (set! (-> arg0 max y) 424.0) + ) + ) + ) + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 19.0) + (set! (-> arg0 min y) 38.0) + (set! (-> arg0 max x) 494.0) + (set! (-> arg0 max y) 362.0) + ) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 70.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 329.0) + ) + ) + 0 + ) + +(defun end-scan ((arg0 hud-box) (arg1 float)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-13 arg0 s5-0 arg1) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-8 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-8) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-8) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-8) vif1) (new 'static 'vif-tag)) + (set! (-> s5-0 base) (the-as pointer (&+ (the-as dma-packet v1-8) 16))) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + ) + +(defbehavior progress-post progress () + (local-vars (sv-144 font-context) (sv-148 int) (sv-152 hud-box) (sv-156 symbol)) + (when (-> self current-options) + (let ((gp-0 (-> self current-options options 0)) + (s4-0 (-> self current-options y-center)) + (s5-0 (-> self current-options y-space)) + ) + (set! sv-144 (new + 'stack + 'font-context + *font-default-matrix* + 0 + 0 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + (set! sv-148 (- s4-0 (/ (* s5-0 (length gp-0)) 2))) + (set! sv-152 (new 'stack-no-clear 'hud-box)) + (set! sv-156 (and (!= (-> self current) 'main) (or (= (-> self next) 'none) (> (-> self state-pos) 0)))) + (if sv-156 + (begin-scan sv-152 self) + ) + (if (or (= (-> self current-options) *title*) (= (-> self current-options) *options*)) + (+! s5-0 20) + ) + (dotimes (s4-1 (length gp-0)) + (let ((v1-24 sv-144)) + (set! (-> v1-24 scale) 0.5) + ) + (set! (-> sv-144 origin x) 79.0) + (set! (-> sv-144 origin y) (the float sv-148)) + (let ((v1-29 sv-144)) + (set! (-> v1-29 width) (the float (the-as float #x163))) + ) + (let ((v1-30 sv-144)) + (set! (-> v1-30 height) (the float (the-as float #x1e))) + ) + (set! (-> sv-144 flags) (if (= (-> *setting-control* user-default language) (language-enum japanese)) + (font-flags middle left large) + (font-flags kerning middle left large) + ) + ) + (let ((s3-0 sv-144)) + (set! (-> s3-0 color) (if (and (= s4-1 (-> self option-index)) (= (-> self menu-transition) 0.0)) + (the-as font-color (progress-selected 0)) + (font-color #7efbfb) + ) + ) + ) + (menu-option-method-10 + (-> gp-0 options s4-1) + self + sv-144 + s4-1 + (and (= (-> self menu-transition) 0.0) (-> self selected-option) (= s4-1 (-> self option-index))) + ) + (if (!= (-> self current-options) *unlocked-secrets*) + (set! sv-148 (+ s5-0 7 sv-148)) + (set! sv-148 (+ sv-148 s5-0)) + ) + ) + ) + (when sv-156 + (set! (-> self scanlines-alpha) (seek-ease + (-> self scanlines-alpha) + (- 1.0 (-> self menu-transition)) + (* 0.05 (-> self clock time-adjust-ratio)) + 0.3 + (* 0.001 (-> self clock time-adjust-ratio)) + ) + ) + (end-scan sv-152 (-> self scanlines-alpha)) + ) + ) + (when (and (< 0.8 (-> self anim-frame)) (or (= (-> self current) 'bigmap) (= (-> self next) 'bigmap))) + (cond + ((>= (-> self pos-transition) 0.38) + (bigmap-method-11 *bigmap* 1792 1840 2304 2256) + ) + (else + (let ((s4-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 21))) + (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 24))) + (gp-1 (new 'stack-no-clear 'vector4w)) + ) + (set! (-> gp-1 quad) (the-as uint128 0)) + (let ((s5-1 (new 'stack-no-clear 'vector4w))) + (set! (-> s5-1 quad) (the-as uint128 0)) + (if (and (transform-point-qword! gp-1 s4-2) (transform-point-qword! s5-1 s3-1)) + (bigmap-method-11 + *bigmap* + (the-as int (/ (the-as int (-> s5-1 x)) 16)) + (the-as int (/ (the-as int (-> s5-1 y)) 16)) + (the-as int (/ (the-as int (-> gp-1 x)) 16)) + (the-as int (/ (the-as int (-> gp-1 y)) 16)) + ) + ) + ) + ) + ) + ) + ) + (ja-post) + 0 + (none) + ) + +(defstate come-in (progress) + :virtual #t + :enter (behavior () + (sound-play "ring-appear") + (set! (-> self pos-transition) 1.0) + (none) + ) + :trans (behavior () + (let ((f30-0 (if (= (-> *progress-state* starting-state) 'main) + 0.0 + 0.2 + ) + ) + ) + (when (hud-hidden?) + (set! (-> *blit-displays-work* menu-mode) (the-as basic #t)) + (set! (-> self pos-transition) (seek-ease + (-> self pos-transition) + f30-0 + (* 0.03 (-> self clock time-adjust-ratio)) + 0.4 + (* 0.003 (-> self clock time-adjust-ratio)) + ) + ) + ) + (set-ring-position self) + (if (= (-> self pos-transition) f30-0) + (go-virtual idle) + ) + ) + (none) + ) + :code (behavior () + (until #f + (suspend) + (ja :num-func num-func-identity :frame-num 0.0) + (suspend) + ) + #f + (none) + ) + :post (the-as (function none :behavior progress) ja-post) + ) + +(defstate idle (progress) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) + (the-as + object + (when (= v1-0 'notify) + (cond + ((= (-> event param 0) 'done) + (let ((t9-0 format) + (a0-3 #t) + (a1-1 "DONE NOTIFY: ~S ~S~%") + (v1-3 (the-as mc-status-code (-> event param 1))) + ) + (t9-0 + a0-3 + a1-1 + (cond + ((= v1-3 (mc-status-code bad-version)) + "bad-version" + ) + ((= v1-3 (mc-status-code no-save)) + "no-save" + ) + ((= v1-3 (mc-status-code no-last)) + "no-last" + ) + ((= v1-3 (mc-status-code no-space)) + "no-space" + ) + ((= v1-3 (mc-status-code internal-error)) + "internal-error" + ) + ((= v1-3 (mc-status-code no-memory)) + "no-memory" + ) + ((= v1-3 (mc-status-code bad-handle)) + "bad-handle" + ) + ((= v1-3 (mc-status-code busy)) + "busy" + ) + ((= v1-3 (mc-status-code write-error)) + "write-error" + ) + ((= v1-3 (mc-status-code read-error)) + "read-error" + ) + ((= v1-3 (mc-status-code no-card)) + "no-card" + ) + ((= v1-3 (mc-status-code no-format)) + "no-format" + ) + ((= v1-3 (mc-status-code ok)) + "ok" + ) + ((= v1-3 (mc-status-code no-process)) + "no-process" + ) + ((= v1-3 (mc-status-code no-auto-save)) + "no-auto-save" + ) + ((= v1-3 (mc-status-code no-file)) + "no-file" + ) + ((= v1-3 (mc-status-code format-failed)) + "format-failed" + ) + ((= v1-3 (mc-status-code new-game)) + "new-game" + ) + (else + "*unknown*" + ) + ) + (symbol->string (-> self current)) + ) + ) + (case (-> self current) + (('saving) + (cond + ((= (-> self state-stack 0) 'title) + (let ((gp-1 (-> *setting-control* user-default auto-save))) + (sound-volume-off) + (let ((v0-0 (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))))) + (set! (-> *setting-control* user-default auto-save) gp-1) + v0-0 + ) + ) + ) + (else + (progress-method-30 self) + ) + ) + ) + (('formatting) + (set-next-state self 'creating 0) + ) + (('creating) + (if (= (-> self state-stack 0) 'title) + (set-next-state self 'select-save-title 0) + (set-next-state self 'select-save 0) + ) + ) + ) + ) + ((= (-> event param 0) 'error) + (let ((t9-7 format) + (a0-18 #t) + (a1-5 "ERROR NOTIFY: ~S ~S ~S~%") + (v1-19 (the-as mc-status-code (-> event param 1))) + ) + (t9-7 + a0-18 + a1-5 + (cond + ((= v1-19 (mc-status-code bad-version)) + "bad-version" + ) + ((= v1-19 (mc-status-code no-save)) + "no-save" + ) + ((= v1-19 (mc-status-code no-last)) + "no-last" + ) + ((= v1-19 (mc-status-code no-space)) + "no-space" + ) + ((= v1-19 (mc-status-code internal-error)) + "internal-error" + ) + ((= v1-19 (mc-status-code no-memory)) + "no-memory" + ) + ((= v1-19 (mc-status-code bad-handle)) + "bad-handle" + ) + ((= v1-19 (mc-status-code busy)) + "busy" + ) + ((= v1-19 (mc-status-code write-error)) + "write-error" + ) + ((= v1-19 (mc-status-code read-error)) + "read-error" + ) + ((= v1-19 (mc-status-code no-card)) + "no-card" + ) + ((= v1-19 (mc-status-code no-format)) + "no-format" + ) + ((= v1-19 (mc-status-code ok)) + "ok" + ) + ((= v1-19 (mc-status-code no-process)) + "no-process" + ) + ((= v1-19 (mc-status-code no-auto-save)) + "no-auto-save" + ) + ((= v1-19 (mc-status-code no-file)) + "no-file" + ) + ((= v1-19 (mc-status-code format-failed)) + "format-failed" + ) + ((= v1-19 (mc-status-code new-game)) + "new-game" + ) + (else + "*unknown*" + ) + ) + (-> self current) + (-> self next) + ) + ) + (case (-> event param 1) + ((14) + (set-next-state self 'insufficient-space 0) + ) + (else + (case (-> self current) + (('formatting 'format-card) + (set-next-state self 'error-formatting 0) + ) + (('creating) + (set-next-state self 'error-creating 0) + ) + (('saving 'select-save 'select-save-title 'select-save-title-hero) + (set-next-state self 'error-saving 0) + ) + (('loading 'select-load) + (set-next-state self 'error-loading 0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self menu-transition) 1.0) + (none) + ) + :trans progress-trans + :code (behavior () + (until #f + (ja :num-func num-func-identity :frame-num (* 12.0 (-> self anim-frame))) + (suspend) + ) + #f + (none) + ) + :post progress-post + ) + +(defstate go-away (progress) + :virtual #t + :enter (behavior () + (remove-setting-by-arg0 *setting-control* 'extra-bank) + (let ((v1-2 *blit-displays-work*)) + (set! (-> v1-2 progress-interp-dest) 0.0) + (set! (-> v1-2 progress-interp-speed) 0.022222223) + ) + (none) + ) + :trans (behavior () + (seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (cond + ((= (-> self anim-frame) 0.0) + (seek! (-> self pos-transition) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (if (= (-> self pos-transition) 1.0) + (go-virtual gone) + ) + ) + (else + (seek! (-> self pos-transition) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + ) + ) + (set-ring-position self) + (none) + ) + :code (behavior () + (let ((gp-0 #f)) + (until #f + (when (and (not gp-0) (= (-> self anim-frame) 0.0)) + (sound-play "ring-disappear") + (set! gp-0 #t) + ) + (ja :num-func num-func-identity :frame-num (* 12.0 (-> self anim-frame))) + (suspend) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior progress) ja-post) + ) + +(defstate gone (progress) + :virtual #t + :code (behavior () + ((method-of-object *bigmap* bigmap-method-15)) + (set! (-> *blit-displays-work* menu-mode) #f) + (while (or (-> *blit-displays-work* screen-copied) (nonzero? (-> *blit-displays-work* count-down))) + (suspend) + ) + (remove-setting! 'process-mask) + (set-master-mode *last-master-mode*) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + ) + +(defmethod respond-progress menu-option ((obj menu-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + 0 + ) + +(defmethod respond-progress menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* on-off-choice)) + (gp-0 #f) + ) + (cond + (arg1 + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (not (-> v1-1 0)) + (set! gp-0 #t) + (when (= (-> obj value-to-modify) (&-> *setting-control* user-default vibration)) + (set! (-> *cpad-list* cpads 0 buzz-pause-val 0) (the-as uint 255)) + (set! (-> *cpad-list* cpads 0 buzz-pause-time) (the-as uint 15)) + ) + (set! (-> v1-1 0) #t) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (cond + ((and (-> v1-1 0) (= (-> obj value-to-modify) (&-> *setting-control* user-default use-progressive-scan))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (progress-method-29 arg0) + (set-next-state arg0 'progressive-mode-warning 0) + ) + (else + (set! (-> obj value-to-modify 0) (-> *progress-state* on-off-choice)) + ) + ) + ) + ) + ) + (else + (if (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> *progress-state* on-off-choice) (-> obj value-to-modify 0)) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +(defmethod respond-progress menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (when arg1 + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (not (-> v1-1 0)) + (set! gp-0 #t) + (set! (-> v1-1 0) #t) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (cond + ((and (-> v1-1 0) (= (-> obj name) (game-text-id progress-root-restart-mission))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (restart-mission) + (set-next-state arg0 'go-away 0) + ) + ((and (-> v1-1 0) (= (-> obj name) (game-text-id progress-quit))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +(defmethod respond-progress menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (-> *bigmap* progress-minimap) + (let ((gp-0 (-> obj value-to-modify)) + (s4-0 #f) + ) + (cond + (arg1 + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-abs 0)) + (seek! (-> (the-as (pointer float) gp-0)) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (if (!= (-> (the-as (pointer float) gp-0)) 0.0) + (set! s4-0 #t) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-abs 0)) + (seek! (-> (the-as (pointer float) gp-0)) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (if (!= (-> (the-as (pointer float) gp-0)) 1.0) + (set! s4-0 #t) + ) + ) + ((cpad-pressed? 0 triangle) + (set! (-> (the-as (pointer float) gp-0)) (-> *progress-state* slider-backup)) + ) + ) + ) + (else + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-abs 0)) + (seek! (-> (the-as (pointer float) gp-0)) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (if (!= (-> (the-as (pointer float) gp-0)) 0.0) + (set! s4-0 #t) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-abs 0)) + (seek! (-> (the-as (pointer float) gp-0)) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (if (!= (-> (the-as (pointer float) gp-0)) 1.0) + (set! s4-0 #t) + ) + ) + ) + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + ) + (when (cpad-pressed? 0 triangle) + (cond + ((!= (-> *progress-state* starting-state) 'title) + ) + (else + (sound-play "generic-beep") + ) + ) + ) + ) + ) + (when s4-0 + (let ((f30-0 1.0)) + (case (-> obj name) + (((game-text-id progress-sound-music-volume) (game-text-id progress-sound-speech-volume)) + (set! f30-0 (-> (the-as (pointer float) gp-0))) + ) + ) + (when (< (seconds 0.03) (- (-> self clock frame-counter) (-> *progress-state* last-slider-sound))) + (set! (-> *progress-state* last-slider-sound) (-> self clock frame-counter)) + (sound-play-by-name + (static-sound-name "menu-slide") + (new-sound-id) + (the int (* 1024.0 f30-0)) + 0 + 0 + (sound-group sfx) + #t + ) + ) + ) + ) + ) + ) + 0 + ) + +(defmethod respond-progress menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (-> *bigmap* progress-minimap) + (let ((a0-1 (-> *setting-control* user-default stereo-mode)) + (v1-4 #f) + ) + (let ((a3-0 2)) + (cond + (arg1 + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-1 -1) 0 a3-0)) + (set! v1-4 #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-1 1) 0 a3-0)) + (set! v1-4 #t) + ) + ((cpad-pressed? 0 triangle) + (set! (-> *setting-control* user-default stereo-mode) (-> *progress-state* stereo-mode-backup)) + ) + ) + ) + (else + (if (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> *progress-state* stereo-mode-backup) (-> *setting-control* user-default stereo-mode)) + ) + ) + ) + ) + (if v1-4 + (sound-play "generic-beep") + ) + ) + ) + 0 + ) + +(defmethod respond-progress menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (cond + ((cpad-pressed? 0 start) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (when (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle)) #t) + (cond + ((= (-> obj name) (game-text-id progress-demo-exit)) + (case *kernel-boot-message* + (('demo-shared) + (set! *master-exit* 'force) + (set-master-mode 'game) + ) + (('demo) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "demo-restart") + ) + ) + ) + ((or (= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-1)) + (= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-2)) + (= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-3)) + ) + (case (-> obj name) + (((game-text-id progress-main-secrets-sceneplayer-2)) + (set! (-> *progress-state* scene-player-act) 2) + ) + (((game-text-id progress-main-secrets-sceneplayer-3)) + (set! (-> *progress-state* scene-player-act) 3) + ) + (else + (set! (-> *progress-state* scene-player-act) 1) + ) + ) + (sound-play "window-expand") + (progress-method-29 arg0) + (set-next-state arg0 (the-as symbol (-> obj next-state)) 0) + ) + ((= (-> obj next-state) 'back) + (progress-method-30 arg0) + ) + ((= (-> obj next-state) 'restart) + (sound-volume-off) + (restart-mission) + (progress-method-30 arg0) + ) + (else + (sound-play "window-expand") + (progress-method-29 arg0) + (set-next-state arg0 (the-as symbol (-> obj next-state)) 0) + ) + ) + ) + ) + ((not (-> arg0 selected-option)) + (let ((a0-53 (-> arg0 current-options options 0))) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (if (!= (length a0-53) 1) + (sound-play "ring-select") + ) + (cond + ((> (-> arg0 want-option-index) 0) + (set! (-> arg0 want-option-index) -1) + ) + ((< -2 (-> arg0 want-option-index)) + (+! (-> arg0 want-option-index) -1) + ) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (if (!= (length a0-53) 1) + (sound-play "ring-select") + ) + (cond + ((< (-> arg0 want-option-index) 0) + (set! (-> arg0 want-option-index) 1) + ) + ((< (-> arg0 want-option-index) 2) + (+! (-> arg0 want-option-index) 1) + ) + ) + ) + ) + ) + ) + ) + 0 + ) + +(defmethod respond-progress menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (and (-> *progress-state* secrets-unlocked) + (not (memcard-unlocked-secrets? #f)) + (or (= (-> arg0 current-options) *title*) + (= (-> arg0 current-options) *unlocked-secrets*) + (= (-> arg0 current-options) *select-scene-options*) + (= (-> arg0 current-options) *select-start-options*) + (= (-> arg0 current-options) *save-options-title*) + ) + ) + (set! (-> *progress-state* secrets-unlocked) #f) + (set! (-> arg0 state-pos) 0) + (set-next-state arg0 'secrets-insufficient-space 0) + ) + (when (= (-> obj name) (game-text-id progress-continue-without-saving)) + (let ((a1-3 (progress-method-28 arg0 (-> arg0 current)))) + (set-next-state arg0 a1-3 0) + ) + ) + (when (and (= (-> obj name) (game-text-id progress-root-secrets)) + (= *title* (-> arg0 current-options)) + (not (memcard-unlocked-secrets? #f)) + (= (-> arg0 option-index) 3) + ) + (set! (-> arg0 option-index) 0) + 0 + ) + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((= (-> obj name) (game-text-id progress-demo-exit)) + (case *kernel-boot-message* + (('demo-shared) + (set! *master-exit* 'force) + (set-master-mode 'game) + ) + (('demo) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "demo-restart") + ) + ) + ) + ((= (-> obj name) (game-text-id progress-continue-without-saving)) + (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + ) + ((= (-> obj next-state) 'back) + (progress-method-30 arg0) + ) + (else + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 (the-as symbol (-> obj next-state)) 0) + ) + ) + ) + 0 + ) + +(defmethod respond-progress menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s4-0 (memcard-unlocked-secrets? #t))) + (logclear! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) + (logclear! (-> *game-info* secrets) (game-secrets hero-mode)) + (when (not (-> *progress-state* secrets-unlocked)) + (set! (-> *progress-state* secrets-unlocked) #f) + (set! (-> arg0 state-pos) 0) + (set-next-state arg0 'secrets-insufficient-space 0) + ) + (cond + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((and (= (-> obj name) (game-text-id progress-main-secrets-scrapbook)) + (logtest? s4-0 (game-secrets scrap-book-1)) + ) + (sound-play "generic-beep") + (cond + ((send-event (handle->process (-> *game-info* controller 0)) 'scrap-book 1) + (set-next-state arg0 'go-away 0) + ) + (else + (set! (-> *game-info* demo-state) (the-as uint 201)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-mega-scrapbook)) + (logtest? s4-0 (game-secrets scrap-book-2)) + ) + (sound-play "generic-beep") + (cond + ((send-event (handle->process (-> *game-info* controller 0)) 'scrap-book 2) + (set-next-state arg0 'go-away 0) + ) + (else + (set! (-> *game-info* demo-state) (the-as uint 202)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-scrapbook-3)) + (logtest? s4-0 (game-secrets scrap-book-3)) + ) + (sound-play "generic-beep") + (cond + ((send-event (handle->process (-> *game-info* controller 0)) 'scrap-book 3) + (set-next-state arg0 'go-away 0) + ) + (else + (set! (-> *game-info* demo-state) (the-as uint 203)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-1)) + (logtest? s4-0 (game-secrets scene-player-1)) + ) + (set! (-> *progress-state* scene-player-act) 1) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-scene 0) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-2)) + (logtest? s4-0 (game-secrets scene-player-2)) + ) + (set! (-> *progress-state* scene-player-act) 2) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-scene 0) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-3)) + (logtest? s4-0 (game-secrets scene-player-3)) + ) + (set! (-> *progress-state* scene-player-act) 3) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-scene 0) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-hero-mode)) + (logtest? s4-0 (game-secrets hero-mode)) + ) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-save-title-hero 0) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-levelselect)) + (logtest? s4-0 (game-secrets level-select)) + ) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-start 0) + ) + ((= (-> obj next-state) 'back) + (progress-method-30 arg0) + ) + ) + ) + ((not (-> arg0 selected-option)) + (let ((a0-131 (-> arg0 current-options options 0))) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (!= (length a0-131) 1) + ) + (cond + ((> (-> arg0 want-option-index) 0) + (set! (-> arg0 want-option-index) -1) + ) + ((< -2 (-> arg0 want-option-index)) + (+! (-> arg0 want-option-index) -1) + ) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (!= (length a0-131) 1) + ) + (cond + ((< (-> arg0 want-option-index) 0) + (set! (-> arg0 want-option-index) 1) + ) + ((< (-> arg0 want-option-index) 2) + (+! (-> arg0 want-option-index) 1) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + ) + +(defmethod respond-progress menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (memcard-unlocked-secrets? #t) + (let ((a1-2 (progress-method-28 arg0 (-> arg0 current)))) + (set-next-state arg0 a1-2 0) + ) + (set! (-> arg0 selected-option) #f) + (when (-> *bigmap* progress-minimap) + (cond + ((cpad-pressed? 0 triangle) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (let ((s5-0 #f)) + *progress-save-info* + (set! (-> *progress-state* which-slot) (-> arg0 option-index)) + (cond + ((= (-> arg0 current) 'select-load) + (when (= (-> *progress-save-info* file (-> arg0 option-index) present) 1) + (set! s5-0 #t) + (set-next-state arg0 'loading 0) + ) + ) + ((= (-> *progress-save-info* file (-> *progress-state* which-slot) present) 1) + (set! s5-0 #t) + (menu-update-purchase-secrets (the-as menu-secret-option (-> *secret-options* options 0 box 0 min x))) + (set-next-state arg0 'already-exists 0) + ) + (else + (set! s5-0 #t) + (menu-update-purchase-secrets (the-as menu-secret-option (-> *secret-options* options 0 box 0 min x))) + (set-next-state arg0 'saving 0) + ) + ) + (if s5-0 + (sound-play "generic-beep") + ) + ) + ) + ) + ) + 0 + ) + +(defmethod respond-progress menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s4-0 (&-> *progress-state* yes-no-choice)) + (a1-2 (progress-method-28 arg0 'select-save)) + (gp-0 #f) + ) + (if (!= a1-2 'select-save) + (set-next-state arg0 a1-2 0) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> s4-0 0))) + (set! (-> s4-0 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> s4-0 0)) + (set! (-> s4-0 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((-> *progress-state* yes-no-choice) + (sound-play "generic-beep") + (set-next-state arg0 'saving 0) + ) + ((begin (sound-play "generic-beep") (= (-> arg0 state-stack 0) 'title)) + (set-next-state arg0 'select-save-title 0) + ) + (else + (set-next-state arg0 'select-save 0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +(defmethod respond-progress menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s4-0 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (let ((a1-2 (progress-method-28 arg0 'select-save))) + (if (!= a1-2 'select-save) + (set-next-state arg0 a1-2 0) + ) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> s4-0 0))) + (set! (-> s4-0 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> s4-0 0)) + (set! (-> s4-0 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((-> *progress-state* yes-no-choice) + (set-next-state arg0 'creating 0) + ) + ((= (-> arg0 state-stack 0) 'title) + (sound-play "generic-beep") + (sound-volume-off) + (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + ) + (else + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +(defmethod respond-progress menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s5-0 (&-> *progress-state* yes-no-choice)) + (s3-0 (progress-method-28 arg0 'select-save)) + ) + (cond + ((or (= (-> *progress-state* starting-state) 'insufficient-space) + (= (-> *progress-state* starting-state) 'no-memory-card) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (and (not (-> s5-0 0)) (not (-> *progress-state* clear-screen))) + (sound-play "generic-beep") + (set! (-> s5-0 0) #t) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (and (-> s5-0 0) (not (-> *progress-state* clear-screen))) + (sound-play "generic-beep") + (set! (-> s5-0 0) #f) + ) + ) + ((and (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) (!= (-> arg0 current) 'none)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> *progress-state* clear-screen) (the-as basic #t)) + (cond + ((-> s5-0 0) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ((and (not (-> s5-0 0)) + (!= (progress-method-28 arg0 'select-save) 'insufficient-space) + (!= (progress-method-28 arg0 'select-save) 'no-memory-card) + ) + (progress-method-30 arg0) + ) + (else + (sound-play "generic-beep") + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> arg0 current) 'none) + (set-next-state arg0 s3-0 0) + ) + ) + ) + ) + ) + (else + (let ((a1-9 'select-save-title-hero)) + 'select-save + (cond + ((and (= (-> *progress-state* starting-state) 'main) + (zero? (logand (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + ) + (set! a1-9 'select-save) + ) + ((and (= (-> *progress-state* starting-state) 'title) + (zero? (logand (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + ) + (set! a1-9 'select-save-title) + ) + ) + (let ((a1-10 (progress-method-28 arg0 a1-9))) + (set-next-state arg0 a1-10 0) + ) + ) + (cond + ((and (cpad-pressed? 0 triangle) + (or (= (-> *progress-state* starting-state) 'title) (= (-> *progress-state* starting-state) 'main)) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((= (-> arg0 state-stack 0) 'title) + (sound-play "generic-beep") + (sound-volume-off) + (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + ) + (else + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + ) + ) + ) + ) + ) + 0 + ) + +(defmethod respond-progress menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (&-> *progress-state* yes-no-choice) + (cond + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (set-next-state arg0 'title 0) + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + ) + ) + 0 + ) + +(defmethod respond-progress menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> *progress-state* video-mode-timeout) 0) + (cond + ((-> *progress-state* yes-no-choice) + (set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice)) + (set! (-> *progress-state* video-mode-timeout) (-> self clock frame-counter)) + (set-next-state arg0 'video-mode-ok 0) + ) + (else + (set! (-> *progress-state* video-mode-choice) 'pal) + (progress-method-30 arg0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +(defmethod respond-progress menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (s5-0 #f) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s5-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s5-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((not (-> *progress-state* yes-no-choice)) + (set! (-> *progress-state* video-mode-choice) 'pal) + (set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice)) + (sound-play "generic-beep") + ) + (else + (sound-play "generic-beep") + ) + ) + (set! (-> *progress-state* video-mode-timeout) 0) + (progress-method-30 arg0) + ) + ) + (if s5-0 + (sound-play "generic-beep") + ) + ) + (when (and (nonzero? (-> *progress-state* video-mode-timeout)) + (< (seconds 10) (- (-> self clock frame-counter) (-> *progress-state* video-mode-timeout))) + ) + (set! (-> *progress-state* video-mode-timeout) 0) + (set! (-> *progress-state* video-mode-choice) 'pal) + (set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice)) + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + (set! (-> *progress-state* graphic-options-progressive-scan) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> *progress-state* progressive-mode-timeout) 0) + (cond + ((-> *progress-state* yes-no-choice) + (sound-play "generic-beep") + (set-progressive-scan #t) + (set! (-> *progress-state* graphic-options-progressive-scan) #t) + (set! (-> *progress-state* progressive-mode-timeout) (-> self clock frame-counter)) + (set-next-state arg0 'progressive-mode-ok 0) + ) + (else + (sound-play "generic-beep") + (set! (-> *progress-state* on-off-choice) #f) + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (set-progressive-scan #f) + (progress-method-30 arg0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +(defmethod respond-progress menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (s5-0 #f) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s5-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s5-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((not (-> *progress-state* yes-no-choice)) + (set! (-> *setting-control* user-default use-progressive-scan) #f) + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (sound-play "generic-beep") + ) + (else + (sound-play "generic-beep") + (set! (-> *progress-state* graphic-options-progressive-scan) #t) + ) + ) + (set! (-> *progress-state* progressive-mode-timeout) 0) + (progress-method-30 arg0) + ) + ) + (if s5-0 + (sound-play "generic-beep") + ) + ) + (when (and (nonzero? (-> *progress-state* progressive-mode-timeout)) + (< (seconds 10) (- (-> self clock frame-counter) (-> *progress-state* progressive-mode-timeout))) + ) + (set! (-> *progress-state* progressive-mode-timeout) 0) + (set! (-> *setting-control* user-default use-progressive-scan) #f) + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (set-progressive-scan #f) + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + *progress-save-info* + (cond + ((= (progress-method-28 arg0 'select-load) 'select-load) + (set-next-state arg0 'select-load 0) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + 0 + ) + +(defmethod respond-progress menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (when (is-cd-in?) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + 0 + ) + +(defmethod respond-progress menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((-> *progress-state* yes-no-choice) + (sound-volume-off) + (set! (-> *game-info* mode) 'play) + (case *kernel-boot-message* + (('demo-shared 'demo) + (initialize! *game-info* 'game (the-as game-save #f) "demo-start") + ) + (else + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + (else + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +(defmethod respond-progress menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s4-0 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (let ((a1-2 (progress-method-28 arg0 (-> arg0 current)))) + (set-next-state arg0 a1-2 0) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> s4-0 0))) + (set! (-> s4-0 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> s4-0 0)) + (set! (-> s4-0 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((-> *progress-state* yes-no-choice) + (sound-play "generic-beep") + (set-next-state arg0 'formatting 0) + ) + ((= (-> arg0 state-stack 0) 'title) + (sound-play "generic-beep") + (sound-volume-off) + (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + ) + (else + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +;; WARN: disable def twice: 110. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod respond-progress menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (set! (-> arg0 sliding-height) (seek-ease + (-> arg0 sliding-height) + 0.0 + (* 0.1 (-> self clock time-adjust-ratio)) + 0.3 + (* 0.001 (-> self clock time-adjust-ratio)) + ) + ) + (let ((s4-0 #f)) + (memcard-unlocked-secrets? #t) + (when (not (-> *progress-state* secrets-unlocked)) + (set! (-> *progress-state* secrets-unlocked) #f) + (set! (-> arg0 state-pos) 0) + (set-next-state arg0 'secrets-insufficient-space 0) + ) + (cond + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (> (-> obj task-index) 0) + (set! s4-0 #t) + (+! (-> obj task-index) -1) + (set! (-> arg0 sliding-height) -1.0) + ) + ) + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (let ((s3-0 -1)) + (dotimes (s2-0 (-> *game-info* play-list length)) + (let* ((v1-41 (-> *game-info* play-list s2-0)) + (a0-20 (-> arg0 current)) + (a0-22 (cond + ((= a0-20 'select-pre-start) + (or (-> v1-41 play-continue) (-> v1-41 pre-play-continue)) + ) + ((= a0-20 'select-kiosk-start) + (-> v1-41 kiosk-play-continue) + ) + (else + (-> v1-41 play-continue) + ) + ) + ) + ) + (if (and a0-22 (lookup-text! *common-text* (-> v1-41 text-name) #t)) + (+! s3-0 1) + ) + ) + ) + (when (< (-> obj task-index) s3-0) + (set! s4-0 #t) + (+! (-> obj task-index) 1) + (set! (-> arg0 sliding-height) 1.0) + ) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (let* ((t9-6 play-task) + (a0-40 (-> obj real-task-index)) + (a1-8 'debug) + (v1-64 (-> arg0 current)) + (a1-9 (t9-6 (the-as game-task a0-40) a1-8 (cond + ((= v1-64 'select-pre-start) + 'pre-play + ) + ((= v1-64 'select-kiosk-start) + 'kiosk + ) + (else + 'play + ) + ) + ) + ) + ) + (start 'play (get-continue-by-name *game-info* a1-9)) + ) + (set-master-mode 'game) + ) + ) + (if s4-0 + (sound-play "secrets-scroll") + ) + ) + 0 + ) + +(defmethod respond-progress menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (set! (-> arg0 sliding-height) (seek-ease + (-> arg0 sliding-height) + 0.0 + (* 0.1 (-> self clock time-adjust-ratio)) + 0.3 + (* 0.01 (-> self clock time-adjust-ratio)) + ) + ) + (let ((gp-0 #f)) + (let ((s4-0 *hud-select-scene-act1*)) + (memcard-unlocked-secrets? #t) + (when (not (-> *progress-state* secrets-unlocked)) + (set! (-> *progress-state* secrets-unlocked) #f) + (set! (-> arg0 state-pos) 0) + (set-next-state arg0 'secrets-insufficient-space 0) + ) + (case (-> *progress-state* scene-player-act) + ((1) + (set! s4-0 *hud-select-scene-act1*) + ) + ((2) + (set! s4-0 *hud-select-scene-act2*) + ) + ((3) + (set! s4-0 *hud-select-scene-act3*) + ) + ) + (cond + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (> (-> obj task-index) 0) + (set! gp-0 #t) + (+! (-> obj task-index) -1) + (set! (-> arg0 sliding-height) -1.0) + ) + ) + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (< (-> obj task-index) (+ (length s4-0) -1)) + (set! gp-0 #t) + (+! (-> obj task-index) 1) + (set! (-> arg0 sliding-height) 1.0) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (let ((s3-2 *display-profile*)) + (play-clean 'debug) + (set! *display-profile* s3-2) + ) + (set! (-> *game-info* mode) 'play) + (let ((s5-1 (-> s4-0 (-> obj task-index)))) + (set! (-> *game-info* demo-state) (the-as uint 100)) + (logior! (-> *game-info* secrets) (game-secrets scene-player-1)) + (process-spawn scene-player :init scene-player-init (-> s5-1 info) #t (-> s5-1 continue)) + ) + (set-master-mode 'game) + ) + ) + ) + (if gp-0 + (sound-play "secrets-scroll") + ) + ) + 0 + ) + +(defmethod respond-progress menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + ((method-of-object *bigmap* bigmap-method-12)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + 0 + ) + +(defmethod respond-progress menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (set! (-> arg0 sliding-height) (seek-ease + (-> arg0 sliding-height) + 0.0 + (* 0.1 (-> self clock time-adjust-ratio)) + 0.3 + (* 0.01 (-> self clock time-adjust-ratio)) + ) + ) + (let ((s5-0 #f)) + (cond + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (> (-> obj task-line-index) 0) + (set! s5-0 #t) + (+! (-> obj task-line-index) -1) + (set! (-> arg0 sliding-height) -1.0) + ) + ) + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (< (-> obj task-line-index) (+ (-> *progress-state* total-num-tasks) -1)) + (+! (-> obj task-line-index) 1) + (set! (-> arg0 sliding-height) 1.0) + (set! s5-0 #t) + ) + ) + ((logtest? (pad-buttons triangle confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle confirm)) + (if (!= (-> *progress-state* starting-state) 'title) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + (if s5-0 + (sound-play "mission-scroll") + ) + ) + 0 + ) + +(defmethod respond-progress menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (set! (-> arg0 sliding) (seek-ease + (-> arg0 sliding) + 0.0 + (* 0.1 (-> self clock time-adjust-ratio)) + 0.3 + (* 0.001 (-> self clock time-adjust-ratio)) + ) + ) + (set! (-> arg0 sliding-off) (seek-ease + (-> arg0 sliding-off) + 1.0 + (* 0.1 (-> self clock time-adjust-ratio)) + -0.3 + (* 0.001 (-> self clock time-adjust-ratio)) + ) + ) + (when (-> *bigmap* progress-minimap) + (let ((s5-0 #f)) + (cond + ((or (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (when (< 1 (get-num-highscores)) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (set! s5-0 #t) + (set! (-> obj prev-page-index) (-> obj page-index)) + (set! (-> obj page-index) (get-next-highscore (-> obj page-index))) + (set! (-> arg0 sliding) 1.0) + (set! (-> arg0 sliding-off) 0.0) + (set! (-> obj slide-dir) -1.0) + ) + ) + ((or (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (when (< 1 (get-num-highscores)) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> obj prev-page-index) (-> obj page-index)) + (set! (-> obj page-index) (get-prev-highscore (-> obj page-index))) + (set! s5-0 #t) + (set! (-> arg0 sliding) -1.0) + (set! (-> arg0 sliding-off) 0.0) + (set! (-> obj slide-dir) 1.0) + ) + ) + ((logtest? (pad-buttons triangle confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle confirm)) + (set! (-> arg0 sliding) 0.0) + (set! (-> arg0 sliding-off) 1.0) + (if (!= (-> *progress-state* starting-state) 'title) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + (if s5-0 + (sound-play "score-slide") + ) + ) + ) + 0 + ) + +(defmethod respond-progress menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let* ((s5-1 (logtest? (-> *game-info* secrets) (game-secrets hero-mode))) + (s3-0 (if (not s5-1) + 0 + (-> obj num-items) + ) + ) + (s2-0 (if (not s5-1) + (+ (-> obj num-items) -1) + (+ (-> obj num-items) -1 (-> obj num-hero-items)) + ) + ) + ) + (set! (-> arg0 sliding) (seek-ease + (-> arg0 sliding) + 0.0 + (* 0.1 (-> self clock time-adjust-ratio)) + 0.3 + (* 0.001 (-> self clock time-adjust-ratio)) + ) + ) + (cond + ((and s5-1 (< (-> obj item-index) s3-0)) + (set! (-> obj item-index) s3-0) + (set! (-> obj prev-item-index) s3-0) + ) + ((and (not s5-1) (< s2-0 (-> obj item-index))) + (set! (-> obj item-index) s3-0) + (set! (-> obj prev-item-index) s3-0) + ) + ) + (menu-update-purchase-secrets obj) + (when (-> *bigmap* progress-minimap) + (let ((s5-2 #f)) + (cond + ((= arg1 #t) + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (set! (-> arg0 selected-option) #f) + ) + ) + (else + (cond + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (< (-> obj item-index) s2-0) + (set! (-> obj prev-item-index) (-> obj item-index)) + (set! s5-2 #t) + (+! (-> obj item-index) 1) + (set! (-> arg0 sliding) 1.0) + (set! (-> arg0 sliding-off) 0.0) + ) + ) + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (< s3-0 (-> obj item-index)) + (set! (-> obj prev-item-index) (-> obj item-index)) + (+! (-> obj item-index) -1) + (set! s5-2 #t) + (set! (-> arg0 sliding) -1.0) + (set! (-> arg0 sliding-off) 0.0) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (let ((v1-74 (-> obj item-index))) + (-> obj secret-items v1-74 cost) + (let ((a0-54 (-> obj secret-items v1-74 flag)) + (a1-9 (= (-> obj secret-items v1-74 can-toggle) #t)) + ) + (-> obj secret-items v1-74 avail-after) + (the int (-> *game-info* skill)) + (cond + ((and (logtest? (-> *game-info* purchase-secrets) a0-54) a1-9) + (set! (-> arg0 selected-option) #t) + (sound-play "generic-beep") + ) + ((= (-> obj secret-items v1-74 can-toggle) 'auto) + ) + ((logtest? (-> *game-info* purchase-secrets) a0-54) + (set! (-> arg0 selected-option) #t) + (sound-play "generic-beep") + ) + ) + ) + ) + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (if (!= (-> *progress-state* starting-state) 'title) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + (if s5-2 + (sound-play "secrets-scroll") + ) + ) + ) + ) + ) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + 0 + ) + +(defmethod respond-progress menu-game-option ((obj menu-game-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (-> *progress-state* game-options-vibrations) + (-> *progress-state* game-options-subtitles) + (let ((gp-0 #f)) + (load-level-text-files (the-as int (-> *setting-control* user-current language))) + (cond + ((= (-> *progress-state* game-options-item-picked) #f) + (cond + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* game-options-last-move))) (seconds 0.5)) + ) + ) + (set! (-> *progress-state* game-options-last-move) (the-as uint (-> self clock frame-counter))) + (cond + ((< (-> *progress-state* game-options-item-selected) 3) + (+! (-> *progress-state* game-options-item-selected) 1) + ) + (else + (set! (-> *progress-state* game-options-item-selected) 0) + 0 + ) + ) + ) + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* game-options-last-move))) (seconds 0.5)) + ) + ) + (set! (-> *progress-state* game-options-last-move) (the-as uint (-> self clock frame-counter))) + (if (> (-> *progress-state* game-options-item-selected) 0) + (+! (-> *progress-state* game-options-item-selected) -1) + (set! (-> *progress-state* game-options-item-selected) 3) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> *progress-state* game-options-last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> *progress-state* game-options-item-picked) (the-as basic #t)) + (sound-play "generic-beep") + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (if (= (-> *progress-state* starting-state) 'main) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + ) + ((-> *progress-state* game-options-item-picked) + (cond + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (set! (-> *progress-state* game-options-item-picked) #f) + (set! (-> *progress-state* game-options-vibrations) (-> *setting-control* user-default vibration)) + (set! (-> *progress-state* game-options-subtitles) (-> *setting-control* user-default subtitle)) + (set! (-> *progress-state* game-options-language-index) + (the-as int (-> *setting-control* user-default language)) + ) + (set! (-> *progress-state* game-options-subtitle-language-index) + (the-as int (-> *setting-control* user-default subtitle-language)) + ) + ) + ((logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons up l-analog-down)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up l-analog-down)) + ) + ((logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons down l-analog-up)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons down l-analog-up)) + ) + ((and (zero? (-> *progress-state* game-options-item-selected)) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (when (not (-> *progress-state* game-options-vibrations)) + (set! (-> *cpad-list* cpads 0 buzz-pause-val 0) (the-as uint 255)) + (set! (-> *cpad-list* cpads 0 buzz-pause-time) (the-as uint 15)) + (set! (-> *progress-state* game-options-vibrations) #t) + ) + ) + ((and (= (-> *progress-state* game-options-item-selected) 1) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (not (-> *progress-state* game-options-subtitles)) + (set! (-> *progress-state* game-options-subtitles) #t) + ) + ) + ((and (= (-> *progress-state* game-options-item-selected) 2) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (zero? (-> *progress-state* game-options-subtitle-language-index)) + (set! (-> *progress-state* game-options-subtitle-language-index) 6) + (+! (-> *progress-state* game-options-subtitle-language-index) -1) + ) + ) + ((and (= (-> *progress-state* game-options-item-selected) 3) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (zero? (-> *progress-state* game-options-language-index)) + (set! (-> *progress-state* game-options-language-index) 6) + (+! (-> *progress-state* game-options-language-index) -1) + ) + ) + ((and (zero? (-> *progress-state* game-options-item-selected)) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (set! (-> *progress-state* game-options-vibrations) #f) + ) + ((and (= (-> *progress-state* game-options-item-selected) 1) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (set! (-> *progress-state* game-options-subtitles) #f) + ) + ((and (= (-> *progress-state* game-options-item-selected) 2) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (cond + ((= (-> *progress-state* game-options-subtitle-language-index) 6) + (set! (-> *progress-state* game-options-subtitle-language-index) 0) + 0 + ) + (else + (+! (-> *progress-state* game-options-subtitle-language-index) 1) + ) + ) + ) + ((and (= (-> *progress-state* game-options-item-selected) 3) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (cond + ((= (-> *progress-state* game-options-language-index) 6) + (set! (-> *progress-state* game-options-language-index) 0) + 0 + ) + (else + (+! (-> *progress-state* game-options-language-index) 1) + ) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (if (zero? (-> *progress-state* game-options-item-selected)) + (set! (-> *setting-control* user-default vibration) (-> *progress-state* game-options-vibrations)) + ) + (if (= (-> *progress-state* game-options-item-selected) 1) + (set! (-> *setting-control* user-default subtitle) (-> *progress-state* game-options-subtitles)) + ) + (if (= (-> *progress-state* game-options-item-selected) 2) + (set! (-> *setting-control* user-default subtitle-language) + (the-as language-enum (-> *progress-state* game-options-subtitle-language-index)) + ) + ) + (when (= (-> *progress-state* game-options-item-selected) 3) + (set! (-> *setting-control* user-default language) + (the-as language-enum (-> *progress-state* game-options-language-index)) + ) + (load-level-text-files (-> *progress-state* game-options-language-index)) + ) + (set! (-> *progress-state* game-options-item-picked) #f) + ) + ) + ) + ) + (when (and gp-0 (-> *progress-state* game-options-item-picked)) + ) + ) + 0 + ) + +(defun update-center-screen () + (with-pp + (let ((v1-0 #f)) + (cond + (#t + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-abs 0)) + (set! (-> *setting-control* user-default display-dx) + (min-max-wrap-around (+ (-> *setting-control* user-default display-dx) -2) -96 96) + ) + (set! v1-0 #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-abs 0)) + (set! (-> *setting-control* user-default display-dx) + (min-max-wrap-around (+ (-> *setting-control* user-default display-dx) 2) -96 96) + ) + (set! v1-0 #t) + ) + ((logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (set! (-> *setting-control* user-default display-dy) + (min-max-wrap-around (+ (-> *setting-control* user-default display-dy) -2) -48 48) + ) + (set! v1-0 #f) + ) + ((logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (set! (-> *setting-control* user-default display-dy) + (min-max-wrap-around (+ (-> *setting-control* user-default display-dy) 2) -48 48) + ) + (set! v1-0 #f) + ) + ((cpad-pressed? 0 triangle) + (set! (-> *setting-control* user-default display-dx) (-> *progress-state* center-x-backup)) + (set! (-> *setting-control* user-default display-dy) (-> *progress-state* center-y-backup)) + ) + ) + ) + (else + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> *progress-state* center-x-backup) (-> *setting-control* user-default display-dx)) + (set! (-> *progress-state* center-y-backup) (-> *setting-control* user-default display-dy)) + ) + ) + ) + (when v1-0 + (when (< (seconds 0.3) (- (-> pp clock frame-counter) (-> *progress-state* last-slider-sound))) + (set! (-> *progress-state* last-slider-sound) (-> pp clock frame-counter)) + (sound-play "roll-over") + ) + ) + ) + 0 + ) + ) + +(defmethod respond-progress menu-graphic-option ((obj menu-graphic-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (-> *progress-state* graphic-options-aspect-ratio) + (-> *progress-state* graphic-options-progressive-scan) + (-> *progress-state* video-mode-choice) + (cond + ((= (-> *progress-state* graphic-options-item-picked) #f) + (cond + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* graphic-options-last-move))) + (seconds 0.5) + ) + ) + ) + (set! (-> *progress-state* graphic-options-last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> arg0 selected-option) #f) + (cond + ((< (-> *progress-state* graphic-options-item-selected) (if (= (scf-get-territory) 1) + 3 + 2 + ) + ) + (+! (-> *progress-state* graphic-options-item-selected) 1) + (set! (-> arg0 option-index) (-> *progress-state* graphic-options-item-selected)) + ) + (else + (set! (-> *progress-state* graphic-options-item-selected) 0) + (set! (-> arg0 option-index) (-> *progress-state* graphic-options-item-selected)) + ) + ) + ) + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* graphic-options-last-move))) + (seconds 0.5) + ) + ) + ) + (set! (-> *progress-state* graphic-options-last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> arg0 selected-option) #f) + (cond + ((> (-> *progress-state* graphic-options-item-selected) 0) + (+! (-> *progress-state* graphic-options-item-selected) -1) + (set! (-> arg0 option-index) (-> *progress-state* graphic-options-item-selected)) + ) + (else + (set! (-> *progress-state* graphic-options-item-selected) (if (= (scf-get-territory) 1) + 3 + 2 + ) + ) + (set! (-> arg0 option-index) (-> *progress-state* graphic-options-item-selected)) + ) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> *progress-state* graphic-options-last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> *progress-state* graphic-options-item-picked) (the-as basic #t)) + (set! (-> arg0 selected-option) #f) + (sound-play "generic-beep") + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (if (= (-> *progress-state* starting-state) 'main) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + ) + ((-> *progress-state* graphic-options-item-picked) + (cond + ((and (cpad-pressed? 0 square) (zero? (-> *progress-state* graphic-options-item-selected))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons square)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons square)) + (set! (-> *setting-control* user-default display-dx) 0) + (set! (-> *setting-control* user-default display-dy) 8) + (sound-play "generic-beep") + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (set! (-> *progress-state* graphic-options-item-picked) #f) + (set! (-> *progress-state* graphic-options-aspect-ratio) (get-aspect-ratio)) + (set! (-> *progress-state* graphic-options-progressive-scan) + (-> *setting-control* user-default use-progressive-scan) + ) + (set! (-> *progress-state* video-mode-choice) (get-video-mode)) + ) + ((and (zero? (-> *progress-state* graphic-options-item-selected)) + (logtest? (pad-buttons up right down left l-analog-down l-analog-right l-analog-up l-analog-left) + (-> *cpad-list* cpads 0 button0-rel 0) + ) + ) + (let ((t9-13 update-center-screen)) + #t + (t9-13) + ) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 1) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (set! (-> *progress-state* graphic-options-aspect-ratio) 'aspect4x3) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 2) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (not (-> *progress-state* graphic-options-progressive-scan)) + (set! (-> *progress-state* graphic-options-progressive-scan) #t) + ) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 3) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (!= (-> *progress-state* video-mode-choice) 'pal) + (set! (-> *progress-state* video-mode-choice) 'pal) + ) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 1) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (set! (-> *progress-state* graphic-options-aspect-ratio) 'aspect16x9) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 2) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (when (-> *progress-state* graphic-options-progressive-scan) + (sound-play "generic-beep") + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (set! (-> *setting-control* user-default use-progressive-scan) #f) + ) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 3) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (!= (-> *progress-state* video-mode-choice) 'ntsc) + (set! (-> *progress-state* video-mode-choice) 'ntsc) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (when (zero? (-> *progress-state* graphic-options-item-selected)) + (let ((t9-28 update-center-screen)) + #t + (t9-28) + ) + ) + (when (= (-> *progress-state* graphic-options-item-selected) 1) + (if (!= (-> *progress-state* graphic-options-aspect-ratio) (-> *setting-control* user-default aspect-ratio)) + (set! (-> *setting-control* user-default aspect-ratio) (-> *progress-state* graphic-options-aspect-ratio)) + ) + ) + (when (and (= (-> *progress-state* graphic-options-item-selected) 2) + (-> *progress-state* graphic-options-progressive-scan) + (not (-> *setting-control* user-default use-progressive-scan)) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (progress-method-29 arg0) + (set-next-state arg0 'progressive-mode-warning 0) + ) + (when (and (= (-> *progress-state* graphic-options-item-selected) 3) + (!= (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice)) + ) + (let ((a0-173 (-> *progress-state* video-mode-choice))) + (case a0-173 + (('pal) + (set! (-> *setting-control* user-default video-mode) a0-173) + ) + (('ntsc) + (progress-method-29 arg0) + (set-next-state arg0 'video-mode-warning 0) + ) + ) + ) + ) + (set! (-> *progress-state* graphic-options-item-picked) #f) + ) + ) + ) + ) + 0 + ) + +(defun update-restart-quit ((arg0 menu-option) (arg1 progress) (arg2 symbol)) + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (when arg2 + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (not (-> v1-1 0)) + (set! gp-0 #t) + (set! (-> v1-1 0) #t) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + (format #t "HL ~A~%" (-> v1-1 0)) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (cond + ((and (-> v1-1 0) (= (-> arg0 name) (game-text-id progress-root-restart-mission))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (restart-mission) + (set-next-state arg1 'go-away 0) + ) + ((and (-> v1-1 0) (= (-> arg0 name) (game-text-id progress-quit))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ) + ) + (when gp-0 + ) + ) + 0 + ) + +(defmethod respond-progress menu-qr-option ((obj menu-qr-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (-> *progress-state* qr-options-restart) + (-> *progress-state* qr-options-quit) + (cond + ((= (-> *progress-state* qr-options-item-picked) #f) + (set! (-> arg0 selected-option) #f) + (set! (-> arg0 option-index) (-> *progress-state* qr-options-item-selected)) + (cond + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* qr-options-last-move))) (seconds 0.5)) + ) + ) + (set! (-> *progress-state* qr-options-last-move) (the-as uint (-> self clock frame-counter))) + (cond + ((< (-> *progress-state* qr-options-item-selected) 1) + (+! (-> *progress-state* qr-options-item-selected) 1) + (set! (-> arg0 selected-option) #f) + (set! (-> arg0 option-index) 0) + 0 + ) + (else + (set! (-> *progress-state* qr-options-item-selected) 0) + (set! (-> arg0 selected-option) #f) + (set! (-> arg0 option-index) 0) + 0 + ) + ) + ) + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* qr-options-last-move))) (seconds 0.5)) + ) + ) + (set! (-> *progress-state* qr-options-last-move) (the-as uint (-> self clock frame-counter))) + (cond + ((> (-> *progress-state* qr-options-item-selected) 0) + (+! (-> *progress-state* qr-options-item-selected) -1) + (set! (-> arg0 selected-option) #f) + (set! (-> arg0 option-index) 1) + ) + (else + (set! (-> *progress-state* qr-options-item-selected) 1) + (set! (-> arg0 selected-option) #f) + (set! (-> arg0 option-index) 1) + ) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> *progress-state* qr-options-last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> *progress-state* qr-options-item-picked) (the-as basic #t)) + (set! (-> arg0 selected-option) #t) + (sound-play "generic-beep") + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (if (!= (-> *progress-state* starting-state) 'title) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + ) + ((-> *progress-state* qr-options-item-picked) + (cond + ((and (cpad-pressed? 0 triangle) (zero? (-> *progress-state* qr-options-item-selected))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (sound-play "generic-beep") + (set! (-> *progress-state* qr-options-item-picked) #f) + (set! (-> arg0 selected-option) #f) + (set! (-> *progress-state* yes-no-choice) #f) + ) + ((and (cpad-pressed? 0 triangle) (= (-> *progress-state* qr-options-item-selected) 1)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (sound-play "generic-beep") + (set! (-> *progress-state* qr-options-item-picked) #f) + (set! (-> arg0 selected-option) #f) + (set! (-> *progress-state* yes-no-choice) #f) + ) + ((and (zero? (-> *progress-state* qr-options-item-selected)) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (update-restart-quit obj arg0 #t) + ) + ((and (zero? (-> *progress-state* qr-options-item-selected)) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (update-restart-quit obj arg0 #t) + ) + ((and (= (-> *progress-state* qr-options-item-selected) 1) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (update-restart-quit obj arg0 #t) + ) + ((and (= (-> *progress-state* qr-options-item-selected) 1) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (update-restart-quit obj arg0 #t) + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (set! (-> *progress-state* qr-options-item-picked) #f) + (set! (-> arg0 selected-option) #f) + (set! (-> *progress-state* yes-no-choice) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (sound-play "generic-beep") + (when (zero? (-> *progress-state* qr-options-item-selected)) + (set! (-> arg0 selected-option) #t) + (set! (-> arg0 option-index) 0) + (update-restart-quit obj arg0 #t) + ) + (when (= (-> *progress-state* qr-options-item-selected) 1) + (set! (-> arg0 selected-option) #t) + (set! (-> arg0 option-index) 1) + (update-restart-quit obj arg0 #t) + ) + (set! (-> *progress-state* qr-options-item-picked) #f) + (set! (-> *progress-state* yes-no-choice) #f) + ) + ) + ) + ) + 0 + ) diff --git a/goal_src/jak2/engine/ui/text-h.gc b/goal_src/jak2/engine/ui/text-h.gc index 279c156f7c..95fff7d8d5 100644 --- a/goal_src/jak2/engine/ui/text-h.gc +++ b/goal_src/jak2/engine/ui/text-h.gc @@ -5,6 +5,16 @@ ;; name in dgo: text-h ;; dgos: ENGINE, GAME +;; NOTE - for progress +(define-extern disable-level-text-file-loading "Disables [[*level-text-file-load-flag*]]" (function none)) +(define-extern enable-level-text-file-loading "Disables [[*level-text-file-load-flag*]]" (function none)) +(define-extern load-game-text-info + "Load text, if needed. txt-name is the group name, curr-text is the _symbol_ for + the game-text-info, and heap is the heap to load to. The heap will be cleared." + (function string symbol kheap int)) +(define-extern print-game-text-scaled "Print text, with a given scaling" (function string float font-context int none)) +(define-extern print-game-text "Print text." (function string font-context symbol int int float)) + ;; DECOMP BEGINS (deftype game-text (structure) diff --git a/goal_src/jak2/engine/ui/text-id-h.gc b/goal_src/jak2/engine/ui/text-id-h.gc index 2d286e057b..5e27c31e34 100644 --- a/goal_src/jak2/engine/ui/text-id-h.gc +++ b/goal_src/jak2/engine/ui/text-id-h.gc @@ -5,16 +5,76 @@ ;; name in dgo: text-id-h ;; dgos: ENGINE, GAME -;; DECOMP BEGINS - +;; +++game-text-id (defenum game-text-id :type uint32 :bitfield #f -;; GAME-TEXT-ID ENUM BEGINS (null 0) - - (pause #x0101) - + (pause 257) + (progress-sound-music-volume 264) + (progress-sound-speech-volume 265) + (progress-on 270) + (progress-off 271) + (progress-move-dpad 272) + (progress-aspect-ratio 280) + (progress-progressive-scan 281) + (progress-video-mode 282) + (progress-root-game-options 283) + (progress-root-graphic-options 284) + (progress-root-sound-options 285) + (progress-aspect-4x3 286) + (progress-aspect-16x9 287) + (progress-refresh-60hz 288) + (progress-refresh-50hz 289) + (progress-demo-exit 291) + (progress-yes 292) + (progress-no 293) + (progress-back 294) + (progress-ok 295) + (progress-next 296) + (progress-previous 297) + (progress-continue-without-saving 298) + (progress-select-file-to-save 299) + (progress-select-file-to-load 300) + (progress-load-game 301) + (progress-save-game 302) + (progress-slot-empty 303) + (progress-title-options 304) + (progress-title-new-game 305) + (progress-title-prompt 306) + (progress-quit 307) + (progress-root-show-map 308) + (progress-root-highscores 310) + (progress-highscores-1st 311) + (progress-highscores-2nd 312) + (progress-highscores-3rd 313) + (progress-highscores-4th 314) + (progress-highscores-5th 315) + (progress-highscores-6th 316) + (progress-highscores-7th 317) + (progress-highscores-8th 318) + (progress-root-secrets 339) + (progress-secrets-unlocked 340) + (progress-main-secrets-hero-mode 345) + (progress-main-secrets-sceneplayer-1 346) + (progress-main-secrets-sceneplayer-2 347) + (progress-main-secrets-sceneplayer-3 348) + (progress-main-secrets-scrapbook 349) + (progress-main-secrets-mega-scrapbook 350) + (progress-main-secrets-scrapbook-3 351) + (progress-main-secrets-levelselect 352) + (progress-secrets-orb-label 360) + (progress-root-missions 361) + (progress-root-restart-mission 366) + (progress-missions-icon-todo 367) + (progress-missions-icon-completed 368) + (progress-missions-none 369) + (progress-unknown-game 370) + (progress-unknown-square-to-reset 377) + (progress-unknown-oi1un23i13 380) + (progress-unknown-kjanskd 381) + (progress-unknown-retry? 382) + (progress-secrets-go-to-title-screen 383) (text-x180 #x0180) (text-x181 #x0181) (text-x182 #x0182) @@ -27,48 +87,45 @@ (text-x189 #x0189) (text-x18a #x018a) (text-x18b #x018b) - (text-x18c #x018c) - (text-x18d #x018d) - (text-x18e #x018e) - (text-x18f #x018f) - (text-x190 #x0190) - (text-x191 #x0191) - (text-x192 #x0192) - (text-x193 #x0193) - (text-x194 #x0194) - (text-x195 #x0195) - (text-x196 #x0196) - (text-x197 #x0197) - (text-x198 #x0198) - (text-x199 #x0199) - (text-x19a #x019a) - (text-x19b #x019b) - (text-x19c #x019c) - (text-x19d #x019d) - (text-x19e #x019e) - (text-x19f #x019f) - (text-x1a0 #x01a0) + (progress-graphics-60hz-change-notice 395) + (progress-graphics-progressivescan-change-notice 396) + (progress-graphics-progressivescan-warning-1 397) + (progress-graphics-progressivescan-warning-2 398) + (progress-graphics-60hz-change-complete 399) + (progress-graphics-progressivescan-change-complete 400) + (progress-graphics-mode-revert? 401) + (progress-disc-removed-notice 402) + (progress-disc-removed-prompt 403) + (progress-disc-read-error 404) + (progress-disc-read-error-prompt 405) + (progress-quit-game-confirm 406) + (progress-memcard-not-found 409) + (progress-memcard-unformatted 410) + (progress-memcard-space-requirement 411) + (progress-memcard-insert-card-with-jak2 412) + (progress-memcard-insert-card-with-space-to-save 413) + (progress-memcard-formatting-required-notice 414) + (progress-memcard-loading-data 416) (text-x1a1 #x01a1) (text-x1a2 #x01a2) - (text-x1a3 #x01a3) - (text-x1a4 #x01a4) - (text-x1a5 #x01a5) - (text-x1a6 #x01a6) - (text-x1a7 #x01a7) - (text-x1a8 #x01a8) - (text-x1a9 #x01a9) - (text-x1aa #x01aa) + (progress-memcard-dont-remove 419) + (progress-memcard-overwrite-warning 420) + (progress-memcard-overwrite-confirm 421) + (progress-memcard-format-prompt 422) + (progress-memcard-continue? 423) + (progress-memcard-go-back? 424) + (progress-memcard-error-while-saving 426) (text-x1ab #x01ab) (text-x1ac #x01ac) - (text-x1ad #x01ad) - (text-x1ae #x01ae) - (text-x1af #x01af) - (text-x1b0 #x01b0) - (text-x1b1 #x01b1) - (text-x1b2 #x01b2) - (text-x1b3 #x01b3) - (text-x1b4 #x01b4) - (text-x1b5 #x01b5) + (progress-memcard-check 429) + (progress-memcard-check-and-try-again 430) + (progress-memcard-was-removed 431) + (progress-autosave-disabled 432) + (progress-autosave-reenabling-info 433) + (progress-memcard-no-jak2-found 434) + (progress-memcard-create-jak2-file? 435) + (progress-autosave-explanation 436) + (progress-autosave-dont-remove 437) (text-x1b6 #x01b6) (text-x1b7 #x01b7) (text-x1b8 #x01b8) @@ -163,22 +220,23 @@ (text-x211 #x0211) (text-x212 #x0212) (text-x213 #x0213) - (text-x214 #x0214) - (text-x215 #x0215) - (text-x216 #x0216) - (text-x217 #x0217) - (text-x218 #x0218) - (text-x219 #x0219) - (text-x21a #x021a) - (text-x21b #x021b) - (text-x21c #x021c) - (text-x21d #x021d) - (text-x21e #x021e) - (text-x21f #x021f) - (text-x220 #x0220) - (text-x221 #x0221) - (text-x222 #x0222) - (text-x223 #x0223) + (progress-locations-haven-city 531) + (progress-locations-fortress 532) + (progress-locations-landing-pad 533) + (progress-locations-palace-roof 534) + (progress-locations-palace 535) + (progress-locations-weapons-factory 536) + (progress-locations-dead-town 537) + (progress-locations-pumping-station 538) + (progress-locations-sewer 539) + (progress-locations-strip-mine 540) + (progress-locations-mountain-temple 541) + (progress-locations-haven-forest 542) + (progress-locations-drill-platform 543) + (progress-locations-mars-tomb 544) + (progress-locations-dig 545) + (progress-locations-underport 546) + (progress-locations-nest 547) (text-x224 #x0224) (text-x225 #x0225) (text-x226 #x0226) @@ -223,5 +281,8 @@ (text-x24d #x024d) (text-x24e #x024e) (text-x24f #x024f) -;; GAME-TEXT-ID ENUM ENDS - ) + (progress-unknown-continue 784) +) +;; ---game-text-id + +;; DECOMP BEGINS diff --git a/goal_src/jak2/engine/ui/text.gc b/goal_src/jak2/engine/ui/text.gc index d686ce26ed..461ef5ffcf 100644 --- a/goal_src/jak2/engine/ui/text.gc +++ b/goal_src/jak2/engine/ui/text.gc @@ -7,3 +7,595 @@ ;; DECOMP BEGINS +(kmemopen global "text") + +(define *expand-buf-number* 0) + +(define *game-text-word* (new 'global 'string 256 (the-as string #f))) + +(define *game-text-line* (new 'global 'string 1024 (the-as string #f))) + +(define *expanded-text-line0* (new 'global 'string 1024 (the-as string #f))) + +(define *expanded-text-line1* (new 'global 'string 1024 (the-as string #f))) + +(define *level-text-file-load-flag* #t) + +(when (zero? (-> *common-text-heap* base)) + (let ((gp-0 *common-text-heap*)) + (set! (-> gp-0 base) (kmalloc global #x10000 (kmalloc-flags) "heap")) + (set! (-> gp-0 current) (-> gp-0 base)) + (set! (-> gp-0 top-base) (&+ (-> gp-0 base) #x10000)) + (set! (-> gp-0 top) (-> gp-0 top-base)) + ) + ) + +(kmemclose) + +(defmethod relocate game-text-info ((obj game-text-info) (arg0 int)) + (let ((v1-1 (-> *level* loading-level))) + (when v1-1 + (set! (-> v1-1 loaded-text-info (-> v1-1 loaded-text-info-count)) obj) + (+! (-> v1-1 loaded-text-info-count) 1) + ) + ) + obj + ) + +(defmethod length game-text-info ((obj game-text-info)) + (-> obj length) + ) + +;; WARN: Return type mismatch uint vs int. +(defmethod asize-of game-text-info ((obj game-text-info)) + (the-as int (+ (-> obj type size) (* (-> obj length) 8))) + ) + + +(defmethod mem-usage game-text-info ((obj game-text-info) (arg0 memory-usage-block) (arg1 int)) + (set! (-> arg0 length) (max 84 (-> arg0 length))) + (set! (-> arg0 data 83 name) "string") + (+! (-> arg0 data 83 count) 1) + (let ((v1-6 (asize-of obj))) + (+! (-> arg0 data 83 used) v1-6) + (+! (-> arg0 data 83 total) (logand -16 (+ v1-6 15))) + ) + (dotimes (s4-0 (-> obj length)) + (set! (-> arg0 length) (max 84 (-> arg0 length))) + (set! (-> arg0 data 83 name) "string") + (+! (-> arg0 data 83 count) 1) + (let ((v1-18 (asize-of (-> obj data s4-0 text)))) + (+! (-> arg0 data 83 used) v1-18) + (+! (-> arg0 data 83 total) (logand -16 (+ v1-18 15))) + ) + ) + obj + ) + +(defun convert-korean-text ((arg0 string)) + "Converts the provided [[string]] of [[game-text]] into korean. Returns a [[string]]" + (local-vars (v1-21 int)) + (let ((gp-0 (-> arg0 data))) + *expanded-text-line0* + (let ((s4-0 0)) + 0 + (let ((s1-0 0) + (s5-0 (length arg0)) + ) + (set! *expand-buf-number* (logxor *expand-buf-number* 1)) + (let ((s3-0 (if (zero? *expand-buf-number*) + *expanded-text-line0* + *expanded-text-line1* + ) + ) + ) + (let ((s2-0 (+ (-> s3-0 allocated-length) -1))) + (clear s3-0) + (while (< s4-0 s5-0) + (cond + ((= (-> gp-0 s4-0) 3) + (+! s4-0 1) + (while (and (< s4-0 s5-0) (!= (-> gp-0 s4-0) 3) (!= (-> gp-0 s4-0) 4)) + (set! (-> s3-0 data s1-0) (-> gp-0 s4-0)) + (+! s4-0 1) + (+! s1-0 1) + ) + ) + (else + (let ((v1-17 (+ s4-0 1))) + (-> gp-0 v1-17) + (set! s4-0 (+ v1-17 1)) + ) + (set! (-> s3-0 data s1-0) (the-as uint 126)) + (let ((v1-19 (+ s1-0 1))) + (set! (-> s3-0 data v1-19) (the-as uint 89)) + (let ((v1-20 (+ v1-19 1))) + (while (and (< s4-0 s5-0) (< v1-20 s2-0) (!= (-> gp-0 s4-0) 3) (!= (-> gp-0 s4-0) 4)) + (cond + ((= (-> gp-0 s4-0) 5) + (set! (-> s3-0 data v1-20) (the-as uint 1)) + (+! s4-0 1) + (set! v1-21 (+ v1-20 1)) + ) + (else + (set! (-> s3-0 data v1-20) (the-as uint 3)) + (set! v1-21 (+ v1-20 1)) + ) + ) + (set! (-> s3-0 data v1-21) (-> gp-0 s4-0)) + (+! s4-0 1) + (let ((v1-22 (+ v1-21 1))) + (set! (-> s3-0 data v1-22) (the-as uint 126)) + (let ((v1-23 (+ v1-22 1))) + (set! (-> s3-0 data v1-23) (the-as uint 90)) + (set! v1-20 (+ v1-23 1)) + ) + ) + ) + (set! (-> s3-0 data v1-20) (the-as uint 126)) + (let ((v1-24 (+ v1-20 1))) + (set! (-> s3-0 data v1-24) (the-as uint 43)) + (let ((v1-25 (+ v1-24 1))) + (set! (-> s3-0 data v1-25) (the-as uint 50)) + (let ((v1-26 (+ v1-25 1))) + (set! (-> s3-0 data v1-26) (the-as uint 54)) + (let ((v1-27 (+ v1-26 1))) + (set! (-> s3-0 data v1-27) (the-as uint 72)) + (set! s1-0 (+ v1-27 1)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> s3-0 data s1-0) (the-as uint 0)) + s3-0 + ) + ) + ) + ) + ) + +(defmethod lookup-text! game-text-info ((obj game-text-info) (arg0 game-text-id) (arg1 symbol)) + (cond + ((= obj #f) + (cond + (arg1 + (the-as string #f) + ) + (else + (format (clear *temp-string*) "NO GAME TEXT") + *temp-string* + ) + ) + ) + (else + (let* ((a1-2 0) + (a3-0 (+ (-> obj length) 1)) + (v1-2 (/ (+ a1-2 a3-0) 2)) + ) + (let ((t0-0 -1)) + (while (and (!= (-> obj data v1-2 id) arg0) (!= v1-2 t0-0)) + (if (< (the-as uint arg0) (the-as uint (-> obj data v1-2 id))) + (set! a3-0 v1-2) + (set! a1-2 v1-2) + ) + (set! t0-0 v1-2) + (set! v1-2 (/ (+ a1-2 a3-0) 2)) + ) + ) + (cond + ((!= (-> obj data v1-2 id) arg0) + (cond + (arg1 + (the-as string #f) + ) + (else + (format (clear *temp-string*) "UNKNOWN ID ~X" arg0) + *temp-string* + ) + ) + ) + ((= (-> obj language-id) 6) + (convert-korean-text (-> obj data v1-2 text)) + ) + (else + (-> obj data v1-2 text) + ) + ) + ) + ) + ) + ) + +(defmethod lookup-text level ((obj level) (arg0 game-text-id) (arg1 symbol)) + (let ((v1-0 *common-text*)) + (dotimes (a3-0 (-> obj loaded-text-info-count)) + (if (= (-> obj loaded-text-info a3-0 language-id) (-> *setting-control* user-current language)) + (set! v1-0 (-> obj loaded-text-info a3-0)) + ) + ) + (lookup-text! v1-0 arg0 arg1) + ) + ) + +(define text-is-loading #f) + +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +(defun load-game-text-info ((arg0 string) (arg1 symbol) (arg2 kheap)) + "Load text, if needed. txt-name is the group name, curr-text is the _symbol_ for + the game-text-info, and heap is the heap to load to. The heap will be cleared." + (local-vars (v0-3 int) (sv-16 game-text-info) (sv-24 int) (sv-32 int) (sv-40 int)) + (set! sv-16 (the-as game-text-info (-> arg1 value))) + (set! sv-24 (the-as int (-> *setting-control* user-current language))) + (set! sv-32 0) + (set! sv-40 (&- (-> arg2 top) (the-as uint (-> arg2 base)))) + (if (and (= (scf-get-territory) 1) (= sv-24 (language-enum english)) (not (demo?))) + (set! sv-24 7) + ) + (when (or (= sv-16 #f) (!= (-> sv-16 language-id) sv-24) (not (string= (-> sv-16 group-name) arg0))) + (let ((v1-16 arg2)) + (set! (-> v1-16 current) (-> v1-16 base)) + ) + (b! #t cfg-17 :delay (nop!)) + (label cfg-16) + (set! v0-3 0) + (b! #t cfg-30 :delay (nop!)) + (label cfg-17) + (let ((s3-0 str-load)) + (format (clear *temp-string*) "~D~S.TXT" sv-24 arg0) + (b! + (not (s3-0 + *temp-string* + -1 + (logand -64 (&+ (-> arg2 current) 63)) + (&- (-> arg2 top) (the-as uint (-> arg2 current))) + ) + ) + cfg-16 + :delay (nop!) + ) + ) + (label cfg-19) + (let ((v1-20 (str-load-status (the-as (pointer int32) (& sv-32))))) + (b! (!= v1-20 'error) cfg-22 :delay (empty-form)) + (format 0 "Error loading text~%") + (set! v0-3 0) + (b! #t cfg-30 :delay (nop!)) + (the-as none 0) + (b! #t cfg-27 :delay (nop!)) + (label cfg-22) + (cond + ((>= sv-32 (+ sv-40 -300)) + (format 0 "Game text heap overrun!~%") + (return 0) + ) + ((= v1-20 'busy) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (goto cfg-19) + ) + ) + ) + (label cfg-27) + (let ((s2-1 (logand -64 (&+ (-> arg2 current) 63)))) + (flush-cache 0) + (let ((s3-1 link)) + (format (clear *temp-string*) "~D~S.TXT" sv-24 arg0) + (set! (-> arg1 value) (s3-1 s2-1 (-> *temp-string* data) sv-32 arg2 0)) + ) + ) + (if (<= (the-as int (-> arg1 value)) 0) + (set! (-> arg1 value) (the-as object #f)) + ) + ) + (set! v0-3 0) + (label cfg-30) + v0-3 + ) + +(defun load-level-text-files ((arg0 int)) + "Load the text files needed for level idx. + This function made more sense back when text files were split up, but in the end they put everything + in a single text group and file." + (if (or *level-text-file-load-flag* (>= arg0 0)) + (load-game-text-info "common" '*common-text* *common-text-heap*) + ) + 0 + (none) + ) + +(defun draw-debug-text-box ((arg0 font-context)) + "Draws some lines" + (when *cheat-mode* + (let ((s5-0 (new 'static 'vector4w)) + (gp-0 (new 'static 'vector4w-4)) + ) + (set-vector! + (-> gp-0 vector 0) + (the int (+ -256.0 (-> arg0 origin x))) + (the int (+ -208.0 (-> arg0 origin y))) + 0 + 1 + ) + (set-vector! + (-> gp-0 vector 1) + (the int (+ -256.0 (-> arg0 width) (-> arg0 origin x))) + (the int (+ -208.0 (-> arg0 origin y))) + 0 + 1 + ) + (set-vector! + (-> gp-0 vector 2) + (the int (+ -256.0 (-> arg0 width) (-> arg0 origin x))) + (the int (+ -208.0 (-> arg0 height) (-> arg0 origin y))) + 0 + 1 + ) + (set-vector! + (-> gp-0 vector 3) + (the int (+ -256.0 (-> arg0 origin x))) + (the int (+ -208.0 (-> arg0 height) (-> arg0 origin y))) + 0 + 1 + ) + (set-vector! s5-0 128 128 128 128) + (add-debug-line2d #t (bucket-id debug-no-zbuf1) (the-as vector4w (-> gp-0 vector)) (-> gp-0 vector 1) s5-0) + (add-debug-line2d #t (bucket-id debug-no-zbuf1) (-> gp-0 vector 1) (-> gp-0 vector 2) s5-0) + (add-debug-line2d #t (bucket-id debug-no-zbuf1) (-> gp-0 vector 2) (-> gp-0 vector 3) s5-0) + (add-debug-line2d #t (bucket-id debug-no-zbuf1) (-> gp-0 vector 3) (the-as vector4w (-> gp-0 vector)) s5-0) + ) + ) + 0 + (none) + ) + +(defun print-game-text-scaled ((arg0 string) (arg1 float) (arg2 font-context) (arg3 int)) + "Print text, with a given scaling" + (let ((f26-0 (-> arg2 width)) + (f30-0 (-> arg2 height)) + (f24-0 (-> arg2 origin x)) + (f22-0 (-> arg2 origin y)) + (f28-0 (-> arg2 scale)) + ) + (let ((f0-1 (* (-> arg2 width) arg1)) + (f1-2 (* (-> arg2 height) arg1)) + ) + (if (logtest? (-> arg2 flags) (font-flags middle)) + (+! (-> arg2 origin x) (* 0.5 (- f26-0 f0-1))) + ) + (if (logtest? (-> arg2 flags) (font-flags left)) + (+! (-> arg2 origin y) (* 0.5 (- f30-0 f1-2))) + ) + (let ((v1-10 arg2)) + (set! (-> v1-10 scale) (* f28-0 arg1)) + ) + (set! (-> arg2 width) f0-1) + (set! (-> arg2 height) f1-2) + ) + (print-game-text arg0 arg2 #f 44 320) + (set! (-> arg2 origin x) f24-0) + (set! (-> arg2 origin y) f22-0) + (set! (-> arg2 width) f26-0) + (set! (-> arg2 height) f30-0) + (set! (-> arg2 scale) f28-0) + ) + 0 + (none) + ) + +(defun print-game-text ((arg0 string) (arg1 font-context) (arg2 symbol) (arg3 int) (arg4 int)) + "Print text." + (local-vars + (sv-16 float) + (sv-20 float) + (sv-24 font-flags) + (sv-28 font-color) + (sv-32 (pointer uint8)) + (sv-36 float) + (sv-40 float) + (sv-44 float) + (sv-48 float) + (sv-52 float) + (sv-56 float) + (sv-64 int) + (sv-72 uint) + (sv-80 int) + (sv-88 int) + (sv-96 int) + (sv-104 uint) + (sv-108 symbol) + (sv-112 int) + (sv-120 int) + ) + (cond + ((< 0.1 (-> arg1 scale)) + (set! sv-16 (-> arg1 origin x)) + (set! sv-20 (-> arg1 origin y)) + (set! sv-24 (-> arg1 flags)) + (set! sv-28 (-> arg1 color)) + (when (logtest? (-> arg1 flags) (font-flags left)) + (logclear! (-> arg1 flags) (font-flags left)) + (+! (-> arg1 origin y) + (the float (the int (* 0.5 (- (-> arg1 height) (print-game-text arg0 arg1 #t 44 320))))) + ) + ) + (set! sv-32 (-> arg0 data)) + (set! sv-36 (-> arg1 origin x)) + (set! sv-40 (-> arg1 origin x)) + (set! sv-44 (+ (-> arg1 origin x) (-> arg1 width))) + (set! sv-48 (+ (-> arg1 origin y) (-> arg1 height))) + (set! sv-52 (-> (get-string-length " " arg1) length)) + (set! sv-56 (* (if (logtest? (-> arg1 flags) (font-flags large)) + (the float arg3) + 28.0 + ) + (-> arg1 scale) + ) + ) + (set! sv-64 0) + (if (logtest? (-> arg1 flags) (font-flags middle)) + (+! (-> arg1 origin x) (* 0.5 (-> arg1 width))) + ) + (set! sv-72 (-> sv-32 0)) + (set! sv-80 0) + (set! sv-88 0) + (set! sv-96 0) + (set! sv-104 (-> sv-32 1)) + (set! sv-108 (the-as symbol #f)) + (set! sv-112 0) + (set! sv-120 0) + (set! (-> *game-text-line* data 0) (the-as uint 0)) + (while (and (not (and (zero? sv-72) (zero? sv-80) (zero? sv-88))) (>= sv-48 (-> arg1 origin y))) + (set! sv-120 0) + (set! sv-32 (&-> sv-32 1)) + (set! sv-104 (-> sv-32 0)) + (set! sv-32 (&-> sv-32 -1)) + (cond + ((and (> sv-72 0) (< sv-72 (the-as uint 4))) + (set! (-> *game-text-word* data sv-80) sv-72) + (set! sv-80 (+ sv-80 1)) + (set! (-> *game-text-word* data sv-80) sv-104) + (set! sv-80 (+ sv-80 1)) + (set! sv-32 (&-> sv-32 1)) + ) + ((= sv-72 32) + (set! (-> *game-text-word* data sv-80) sv-72) + (set! sv-80 (+ sv-80 1)) + (set! sv-108 #t) + ) + ((zero? sv-72) + (if (nonzero? sv-80) + (set! sv-108 #t) + ) + (set! sv-112 (+ sv-112 1)) + ) + ((and (= sv-72 92) (= sv-104 92)) + (set! sv-32 (&-> sv-32 1)) + (if (nonzero? sv-80) + (set! sv-108 #t) + ) + (set! sv-112 (+ sv-112 1)) + ) + ((and (= sv-72 95) (= sv-104 95)) + (set! sv-32 (&-> sv-32 1)) + (set! (-> *game-text-word* data sv-80) (the-as uint 32)) + (set! sv-80 (+ sv-80 1)) + ) + (else + (set! (-> *game-text-word* data sv-80) sv-72) + (set! sv-80 (+ sv-80 1)) + ) + ) + (when sv-108 + (set! (-> *game-text-word* data sv-80) (the-as uint 0)) + (let ((f30-1 sv-36)) + (set! sv-120 (the int (the-as float (-> (get-string-length *game-text-word* arg1) length)))) + (let ((f0-26 (+ f30-1 (the float sv-120)))) + (if (= (-> *game-text-word* data (+ sv-80 -1)) 32) + (set! f0-26 (- f0-26 (the-as float sv-52))) + ) + (cond + ((< sv-44 f0-26) + (set! sv-112 (+ sv-112 1)) + ) + (else + (copy-charp<-charp (&-> *game-text-line* data sv-88) (-> *game-text-word* data)) + (set! sv-88 (+ sv-88 sv-80)) + (set! sv-80 0) + (set! sv-36 (+ sv-36 (the float sv-120))) + (set! sv-108 (the-as symbol #f)) + ) + ) + ) + ) + ) + (while (> sv-112 0) + (let ((f30-2 (+ (-> arg1 origin y) sv-56))) + (when (and (>= sv-96 (the-as int (-> arg1 start-line))) #t) + (when (= (-> *game-text-line* data (+ sv-88 -1)) 32) + (set! (-> *game-text-line* data (+ sv-88 -1)) (the-as uint 0)) + 0 + ) + (if (nonzero? (-> *game-text-line* data 0)) + (set! sv-64 (+ sv-64 1)) + ) + (when (not arg2) + (let* ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s3-1 (-> s2-1 base)) + ) + (draw-string *game-text-line* s2-1 arg1) + (set! (-> arg1 color) (-> *font-work* last-color)) + (let ((a3-2 (-> s2-1 base))) + (let ((v1-121 (the-as object (-> s2-1 base)))) + (set! (-> (the-as dma-packet v1-121) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-121) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-121) vif1) (new 'static 'vif-tag)) + (set! (-> s2-1 base) (&+ (the-as pointer v1-121) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (the-as bucket-id arg4) + s3-1 + (the-as (pointer dma-tag) a3-2) + ) + ) + ) + ) + (set! (-> arg1 origin y) f30-2) + ) + ) + (set! sv-96 (+ sv-96 1)) + (set! (-> *game-text-line* data 0) (the-as uint 0)) + (set! sv-88 0) + (set! sv-112 (+ sv-112 -1)) + (set! sv-36 sv-40) + (when sv-108 + (copy-charp<-charp (&-> *game-text-line* data sv-88) (-> *game-text-word* data)) + (set! sv-88 (+ sv-88 sv-80)) + (set! sv-80 0) + (set! sv-108 (the-as symbol #f)) + (set! sv-36 (+ sv-36 (the float sv-120))) + ) + ) + (when (nonzero? sv-72) + (set! sv-32 (&-> sv-32 1)) + (set! sv-72 (-> sv-32 0)) + ) + ) + (set! (-> arg1 origin x) sv-16) + (set! (-> arg1 origin y) sv-20) + (set! (-> arg1 flags) sv-24) + (set! (-> arg1 color) sv-28) + (if (> sv-64 0) + (* sv-56 (the float sv-64)) + 0.0 + ) + ) + (else + 0.0 + ) + ) + ) + +(defun disable-level-text-file-loading () + "Disables [[*level-text-file-load-flag*]]" + (set! *level-text-file-load-flag* #f) + 0 + (none) + ) + +(defun enable-level-text-file-loading () + "Disables [[*level-text-file-load-flag*]]" + (set! *level-text-file-load-flag* #t) + 0 + (none) + ) diff --git a/goal_src/jak2/engine/util/script.gc b/goal_src/jak2/engine/util/script.gc index 4e243e024a..fbc5f8efbd 100644 --- a/goal_src/jak2/engine/util/script.gc +++ b/goal_src/jak2/engine/util/script.gc @@ -993,7 +993,7 @@ (set! (-> v1-52 name) 'unbox) (set! (-> v1-52 spec) '((return macro (object)) (function macro (symbol)) (value eval (bfloat binteger)))) (set! (-> v1-52 func) (lambda ((arg0 script-context)) (cond - ((zero? (logand (the-as int (-> arg0 param 1)) 7)) + ((not (logtest? (the-as int (-> arg0 param 1)) 7)) (/ (the-as int (-> arg0 param 1)) 8) ) (else @@ -2717,7 +2717,7 @@ "close a task stage." (when (-> arg0 side-effect?) (cond - ((zero? (logand (the-as int (-> arg0 param 1)) 7)) + ((not (logtest? (the-as int (-> arg0 param 1)) 7)) (task-node-close! (the-as game-task-node (command-get-int (-> arg0 param 1) 0))) ) (else @@ -2755,7 +2755,7 @@ "close a task stage." (when (-> arg0 side-effect?) (cond - ((zero? (logand (the-as int (-> arg0 param 1)) 7)) + ((not (logtest? (the-as int (-> arg0 param 1)) 7)) (task-node-open! (the-as game-task-node (command-get-int (-> arg0 param 1) 0))) ) (else @@ -2801,7 +2801,7 @@ (lambda ((arg0 script-context)) "test whether the need resolution stage of a task is closed (actually tests the bit array)" (cond - ((zero? (logand (the-as int (-> arg0 param 1)) 7)) + ((not (logtest? (the-as int (-> arg0 param 1)) 7)) (task-node-closed? (the-as game-task-node (command-get-int (-> arg0 param 1) 0))) ) (else diff --git a/goal_src/jak2/game.gp b/goal_src/jak2/game.gp index 04c7a7a5c1..159fd8a4b5 100644 --- a/goal_src/jak2/game.gp +++ b/goal_src/jak2/game.gp @@ -659,6 +659,22 @@ "blocking-plane-ag" ) +;;;;;;;;;;;;;;;;;;;;; +;; Text +;;;;;;;;;;;;;;;;;;;;; + +(defstep :in "game/assets/jak2/game_text.gp" + :tool 'text + :out '("$OUT/iso/0COMMON.TXT" + "$OUT/iso/1COMMON.TXT" + "$OUT/iso/2COMMON.TXT" + "$OUT/iso/3COMMON.TXT" + "$OUT/iso/4COMMON.TXT" + "$OUT/iso/5COMMON.TXT" + "$OUT/iso/6COMMON.TXT" + "$OUT/iso/7COMMON.TXT") + ) + ;;;;;;;;;;;;;;;;;;;;; ;; COMMON CITY STUFF ;;;;;;;;;;;;;;;;;;;;; @@ -848,7 +864,8 @@ ;; the iso group is a group of files built by the "(mi)" command. (group-list "iso" - `(,@(reverse *all-vis*) + `("$OUT/iso/0COMMON.TXT" + ,@(reverse *all-vis*) ,@(reverse *all-str*) ,@(reverse *all-sbk*) ,@(reverse *all-mus*) @@ -856,6 +873,10 @@ ,@(reverse *all-cgos*)) ) +(group-list "text" + `("$OUT/iso/0COMMON.TXT") + ) + ;; used for the type consistency test. (group-list "all-code" `(,@(reverse *all-gc*)) diff --git a/goalc/compiler/compilation/Static.cpp b/goalc/compiler/compilation/Static.cpp index ddb1a304ac..1b5638a9e2 100644 --- a/goalc/compiler/compilation/Static.cpp +++ b/goalc/compiler/compilation/Static.cpp @@ -140,7 +140,7 @@ void Compiler::compile_static_structure_inline(const goos::Object& form, } } else if (is_structure(field_info.type) || is_pair(field_info.type) || - is_symbol(field_info.type)) { + is_symbol(field_info.type) || field_info.type == TypeSpec("object")) { if (is_pair(field_info.type)) { ASSERT(!field_info.field.is_inline()); } diff --git a/scripts/gsrc/check-gsrc-file.py b/scripts/gsrc/check-gsrc-file.py deleted file mode 100644 index 3b9af31a05..0000000000 --- a/scripts/gsrc/check-gsrc-file.py +++ /dev/null @@ -1,67 +0,0 @@ -import re -from jak1_file_list import file_list -import argparse -import os - -parser = argparse.ArgumentParser() -parser.add_argument("--files") -args = parser.parse_args() - -files = args.files.split(",") - -throw_error = False - -method_split_pattern = re.compile('t9-\d+\s\(method-of-object') -function_split_pattern = re.compile('\(t9-\d+\)') -missing_res_tag_pattern = re.compile('(sv-\d{2,} int)') -decompiler_error_pattern = re.compile(';; ERROR') -missing_arg = re.compile('local-vars.*none\)') - -for file in files: - src_path = "" - for f in file_list: - if f[2] != 3: - continue - if f[0] == file: - src_path = f[4] - break - - if not os.path.exists("./goal_src/{}".format(src_path)): - print("{} couldn't find in /goal_src!".format(file)) - throw_error = True - continue - - file_path = "./goal_src/{}/{}.gc".format(src_path, file) - with open(file_path) as f: - for lineno, line in enumerate(f): - method_split_match = method_split_pattern.search(line) - if method_split_match: - print("method_split - {}:{}".format(file_path, lineno + 1)) - throw_error = True - continue - function_split_match = function_split_pattern.search(line) - if function_split_match: - print("function_split - {}:{}".format(file_path, lineno + 1)) - throw_error = True - continue - missing_res_tag_match = missing_res_tag_pattern.search(line) - if missing_res_tag_match: - print("missing_res_tag - {}:{}".format(file_path, lineno + 1)) - throw_error = True - continue - decompiler_error_match = decompiler_error_pattern.search(line) - if decompiler_error_match: - print("decompiler_error - {}:{}".format(file_path, lineno + 1)) - throw_error = True - continue - missing_arg_match = missing_arg.search(line) - if missing_arg_match: - print("missing_arg - {}:{}".format(file_path, lineno + 1)) - throw_error = True - continue - -if throw_error: - print("found potential problems!") - exit(1) -else: - print("looks good!") diff --git a/scripts/gsrc/lint-gsrc-file.py b/scripts/gsrc/lint-gsrc-file.py new file mode 100644 index 0000000000..3bd6dd3036 --- /dev/null +++ b/scripts/gsrc/lint-gsrc-file.py @@ -0,0 +1,62 @@ +import re +import argparse +import os +from utils import get_gsrc_path_from_filename + +parser = argparse.ArgumentParser("lint-gsrc-file") +parser.add_argument("--game", help="The name of the game", type=str) +parser.add_argument("--file", help="The name of the file", type=str) +args = parser.parse_args() + +throw_error = False + +# TODO - if more code is added here overtime, be smarter about this / group errors +method_split_pattern = re.compile('method-of-type') +function_split_pattern = re.compile('\(t9-\d+(?:\s+[^\s]+\s*)?\)') +missing_res_tag_pattern = re.compile('.pcpyud') +decompiler_error_pattern = re.compile(';; ERROR') +missing_arg = re.compile('local-vars.*[at].*\s+none\)') +casting_stack_var = re.compile('the-as\s+[^\s]*\s+.*\(new \'stack') + +src_path = get_gsrc_path_from_filename(args.game, args.file) + +print("Linting GOAL_SRC File...") + +with open(src_path) as f: + for lineno, line in enumerate(f): + method_split_match = method_split_pattern.search(line) + if method_split_match: + print("method_split - {}:{}".format(src_path, lineno + 1)) + throw_error = True + continue + function_split_match = function_split_pattern.search(line) + if function_split_match: + print("function_split - {}:{}".format(src_path, lineno + 1)) + throw_error = True + continue + missing_res_tag_match = missing_res_tag_pattern.search(line) + if missing_res_tag_match: + print("missing_res_tag - {}:{}".format(src_path, lineno + 1)) + throw_error = True + continue + decompiler_error_match = decompiler_error_pattern.search(line) + if decompiler_error_match: + print("decompiler_error - {}:{}".format(src_path, lineno + 1)) + throw_error = True + continue + missing_arg_match = missing_arg.search(line) + if missing_arg_match: + print("missing_arg - {}:{}".format(src_path, lineno + 1)) + throw_error = True + continue + casting_stack_var_match = casting_stack_var.search(line) + if casting_stack_var_match: + print("casting stack var - {}:{}".format(src_path, lineno + 1)) + throw_error = True + continue + +if throw_error: + print("Found potential problems, exiting with code 1!") + exit(1) +else: + print("Looks good!") diff --git a/scripts/gsrc/update-from-decomp.py b/scripts/gsrc/update-from-decomp.py index 85ca3e7a88..1007fceedb 100644 --- a/scripts/gsrc/update-from-decomp.py +++ b/scripts/gsrc/update-from-decomp.py @@ -93,7 +93,8 @@ lines_to_ignore = [ ";; failed to figure", ";; Used lq/sq", ";; this part is debug only", - ";; WARN: Return type mismatch int vs none" + ";; WARN: Return type mismatch int vs none", + ";; WARN: Stack slot offset" ] if decomp_ignore_errors: diff --git a/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc new file mode 100644 index 0000000000..151a159a48 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc @@ -0,0 +1,1119 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 16 of type camera-master +(defmethod camera-master-method-16 camera-master ((obj camera-master) (arg0 symbol)) + (let ((a2-0 (the-as target (handle->process (-> obj focus handle)))) + (v1-4 0) + ) + (if a2-0 + (set! v1-4 (the-as int (incomplete-bitfield-access (-> a2-0 control pat-ignore-mask)))) + ) + (logior (if arg0 + #x9010002 + #x9000002 + ) + v1-4 + ) + ) + ) + +;; definition for function reset-follow +;; INFO: Used lq/sq +(defbehavior reset-follow camera-master () + (let ((a0-1 (handle->process (-> self focus handle)))) + (when (the-as process-focusable a0-1) + (set! (-> self tpos-old quad) (-> (get-trans (the-as process-focusable a0-1) 4) quad)) + (set! (-> self tpos-curr quad) (-> self tpos-old quad)) + (set! (-> self tpos-old-adj quad) (-> self tpos-old quad)) + (set! (-> self tpos-curr-adj quad) (-> self tpos-old quad)) + (set! (-> self tpos-tgt quad) (-> self tpos-old quad)) + (set! (-> self upspeed) 0.0) + ) + ) + ) + +;; definition for function reset-target-tracking +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs symbol. +(defbehavior reset-target-tracking camera-master () + (let ((gp-0 (handle->process (-> self focus handle)))) + (the-as + symbol + (when gp-0 + (set! (-> self tpos-old quad) (-> (get-trans (the-as process-focusable gp-0) 4) quad)) + (set! (-> self tpos-curr quad) (-> self tpos-old quad)) + (set! (-> self tpos-old-adj quad) (-> self tpos-old quad)) + (set! (-> self tpos-curr-adj quad) (-> self tpos-old quad)) + (set! (-> self tpos-tgt quad) (-> self tpos-old quad)) + (quaternion->matrix (-> self tgt-rot-mat) (get-quat (the-as process-focusable gp-0) 2)) + (quaternion->matrix (-> self tgt-face-mat) (get-quat (the-as process-focusable gp-0) 1)) + (vector-reset! (-> self pitch-off)) + (set! (-> self upspeed) 0.0) + (set! (-> self on-ground) + (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status in-air))) + ) + (set! (-> self on-pole) #f) + (set! (-> self ease-t) 1.0) + (set! (-> self string-max target y) (-> self settings string-max-height)) + (set! (-> self string-max target z) (-> self settings string-max-length)) + (set! (-> self string-push-z) (fmax (-> self string-min value z) (-> *CAMERA-bank* default-string-push-z))) + (cond + ((>= (- (-> self clock frame-counter) (process-focusable-method-25 (the-as process-focusable gp-0))) + (-> *CAMERA-bank* attack-timeout) + ) + (set! (-> self being-attacked) #f) + ) + (else + (set! (-> self attack-start) (-> self clock frame-counter)) + (set! (-> self being-attacked) #t) + (when (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) + (set! (-> self string-max target y) (fmax (-> self string-max target y) (-> last-try-to-look-at-data vert))) + (set! (-> self string-max target z) (fmax (-> self string-max target z) (-> last-try-to-look-at-data horz))) + (set! (-> self string-push-z) (fmax (-> self string-push-z) (-> self string-max target z))) + ) + ) + ) + (cond + ((logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status under-water)) + (set! (-> self under-water) 2) + ) + (else + (set! (-> self under-water) 0) + 0 + ) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (vector--float*! gp-1 (-> self tpos-curr-adj) (-> self local-down) (-> self settings target-height)) + (tracking-spline-method-10 (-> self target-spline) gp-1) + ) + ) + ) + ) + ) + +;; definition for function master-track-target +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs symbol. +(defbehavior master-track-target camera-master () + (let ((gp-0 (handle->process (-> self focus handle)))) + (the-as + symbol + (cond + ((and *target* (not gp-0)) + (try-update-focus (-> self focus) *target*) + (logior! (-> self master-options) 1) + (reset-target-tracking) + ) + ((and (logtest? (-> self master-options) 1) (not gp-0)) + (let ((v0-1 (the-as object (logand -2 (-> self master-options))))) + (set! (-> self master-options) (the-as uint v0-1)) + v0-1 + ) + ) + ((paused?) + #f + ) + (gp-0 + (logior! (-> self master-options) 1) + (cond + ((>= (- (-> self clock frame-counter) (process-focusable-method-25 (the-as target gp-0))) + (-> *CAMERA-bank* attack-timeout) + ) + (set! (-> self being-attacked) #f) + ) + (else + (if (not (-> self being-attacked)) + (set! (-> self attack-start) (-> self clock frame-counter)) + ) + (set! (-> self being-attacked) #t) + (when (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) + (set! (-> self string-max target y) (fmax (-> self string-max target y) (-> last-try-to-look-at-data vert))) + (set! (-> self string-max target z) (fmax (-> self string-max target z) (-> last-try-to-look-at-data horz))) + (set! (-> self string-push-z) (fmax (-> self string-push-z) (-> self string-max target z))) + ) + ) + ) + (cond + ((logtest? (-> (the-as target gp-0) focus-status) (focus-status under-water)) + (set! (-> self under-water) 2) + ) + ((> (-> self under-water) 0) + (+! (-> self under-water) -1) + ) + ) + (set! (-> self tpos-old quad) (-> self tpos-curr quad)) + (set! (-> self tpos-old-adj quad) (-> self tpos-curr-adj quad)) + (quaternion->matrix (-> self tgt-rot-mat) (get-quat (the-as target gp-0) 2)) + (quaternion->matrix (-> self tgt-face-mat) (get-quat (the-as target gp-0) 1)) + (cond + ((< (-> self ease-t) 1.0) + (new 'stack-no-clear 'vector) + (cond + ((logtest? (-> self master-options) 8) + (vector-lerp! + (-> self tpos-curr) + (-> self ease-from) + (-> self ease-to) + (parameter-ease-sin-clamp (-> self ease-t)) + ) + (set! (-> self master-options) (logand -9 (-> self master-options))) + ) + (else + (vector-lerp! + (-> self tpos-curr) + (-> self ease-from) + (get-trans (the-as target gp-0) 4) + (parameter-ease-sin-clamp (-> self ease-t)) + ) + ) + ) + (+! (-> self ease-t) (-> self ease-step)) + ) + (else + (set! (-> self tpos-curr quad) (-> (get-trans (the-as target gp-0) 4) quad)) + ) + ) + (when (logtest? (-> (the-as target gp-0) focus-status) (focus-status edge-grab)) + (if *display-cam-los-debug* + (format *stdcon* "ride edge~%") + ) + (let ((s5-6 (new 'stack-no-clear 'collide-query))) + (vector--float*! + (-> s5-6 start-pos) + (-> self tpos-curr) + (-> self local-down) + (-> self settings target-height) + ) + (vector-float*! (-> s5-6 move-dist) (the-as vector (&-> self stack 256)) 4915.2) + (vector-! (-> s5-6 start-pos) (-> s5-6 start-pos) (-> s5-6 move-dist)) + (let ((s4-4 s5-6)) + (set! (-> s4-4 radius) 4300.8) + (set! (-> s4-4 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) + (set! (-> s4-4 ignore-process0) #f) + (set! (-> s4-4 ignore-process1) #f) + (set! (-> s4-4 ignore-pat) (the-as pat-surface (camera-master-method-16 self #t))) + (set! (-> s4-4 action-mask) (collide-action solid)) + ) + (let ((f0-16 (fill-and-probe-using-line-sphere *collide-cache* s5-6))) + (if (and (< 0.0 f0-16) (< f0-16 1.0)) + (vector+float*! (-> self tpos-curr) (-> self tpos-curr) (-> s5-6 move-dist) (+ -1.0 f0-16)) + ) + ) + ) + ) + (set! (-> self on-ground) (zero? (logand (-> (the-as target gp-0) focus-status) (focus-status in-air)))) + (let ((s5-7 (new-stack-vector0))) + 0.0 + (cond + ((and (logtest? (-> (the-as target gp-0) focus-status) (focus-status in-air)) + (zero? (logand (focus-status halfpipe super) (-> (the-as target gp-0) focus-status))) + ) + (if *display-cam-los-debug* + (format *stdcon* "air tracking~%") + ) + (vector+float*! (-> self tpos-curr-adj) (-> self tpos-curr-adj) (-> self local-down) (-> self upspeed)) + (vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) (-> self upspeed)) + (vector-! s5-7 (-> self tpos-curr) (-> self tpos-tgt)) + (let ((f30-0 (vector-dot s5-7 (-> self local-down)))) + (vector--float*! s5-7 s5-7 (-> self local-down) f30-0) + (if (< 0.0 f30-0) + (set! (-> self upspeed) (* 0.5 (-> self upspeed))) + ) + (vector+! (-> self tpos-tgt) (-> self tpos-tgt) s5-7) + (let ((f0-26 (* 0.05 f30-0))) + (vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) f0-26) + ) + ) + (vector-! s5-7 (-> self tpos-curr-adj) (-> self tpos-tgt)) + (let* ((f0-28 (vector-dot s5-7 (-> self local-down))) + (f0-29 (if (< 0.0 f0-28) + (* f0-28 (-> *CAMERA_MASTER-bank* up-move-to-pitch-ratio-in-air)) + (* f0-28 (-> *CAMERA_MASTER-bank* down-move-to-pitch-ratio-in-air)) + ) + ) + ) + (vector+float*! (-> self tpos-curr-adj) (-> self tpos-tgt) (-> self local-down) f0-29) + ) + (vector-! s5-7 (get-trans (the-as target gp-0) 1) (-> self tpos-curr-adj)) + (let* ((f0-31 (vector-dot s5-7 (-> self local-down))) + (f0-32 (* 0.03 f0-31)) + ) + (if (and (< f0-32 0.0) (< f0-32 (-> self upspeed))) + (set! (-> self upspeed) f0-32) + ) + ) + ) + (else + (if *display-cam-los-debug* + (format *stdcon* "ground tracking~%") + ) + (vector-! s5-7 (-> self tpos-curr) (-> self tpos-old)) + (let ((f0-34 (vector-dot s5-7 (-> self local-down)))) + (cond + ((and (logtest? (-> (the-as target gp-0) focus-status) (focus-status touch-water)) + (zero? (logand (focus-status mech) (-> (the-as target gp-0) focus-status))) + ) + (set! (-> self upspeed) 0.0) + ) + ((< 0.0 f0-34) + (set! (-> self upspeed) 0.0) + ) + (else + (set! (-> self upspeed) f0-34) + ) + ) + ) + (set! (-> self tpos-tgt quad) (-> self tpos-curr quad)) + (vector-! s5-7 (-> self tpos-curr-adj) (-> self tpos-curr)) + (let* ((f0-38 (vector-dot s5-7 (-> self local-down))) + (f0-39 (cond + ((logtest? (cam-slave-options RAPID_TRACKING) (-> self settings slave-options)) + 0.0 + ) + ((< 0.0 f0-38) + (* f0-38 (-> *CAMERA_MASTER-bank* up-move-to-pitch-on-ground)) + ) + (else + (* f0-38 (-> *CAMERA_MASTER-bank* down-move-to-pitch-on-ground)) + ) + ) + ) + ) + (vector+float*! (-> self tpos-curr-adj) (-> self tpos-curr) (-> self local-down) f0-39) + ) + ) + ) + ) + (if (not (logtest? (-> self settings slave-options) (cam-slave-options JUMP_PITCHES))) + (reset-follow) + ) + (when (and (logtest? (-> (the-as target gp-0) focus-status) (focus-status on-water under-water)) + (zero? (logand (focus-status mech) (-> (the-as target gp-0) focus-status))) + ) + (let ((f0-41 (- (process-focusable-method-24 (the-as target gp-0)) (-> self settings target-height)))) + (if (< (-> self tpos-curr-adj y) f0-41) + (set! (-> self tpos-curr-adj y) f0-41) + ) + ) + ) + (vector+! (-> self pitch-off) (-> self pitch-off) (-> self tpos-curr)) + (vector-! (-> self pitch-off) (-> self pitch-off) (-> self tpos-old)) + (vector-float*! (-> self pitch-off) (-> self pitch-off) (-> *CAMERA_MASTER-bank* pitch-off-blend)) + (let ((s5-8 (new 'stack-no-clear 'vector))) + (vector--float*! s5-8 (-> self tpos-curr-adj) (-> self local-down) (-> self settings target-height)) + (let ((s4-7 (new 'stack-no-clear 'vector))) + 0.0 + (vector-! s4-7 (get-trans (the-as target gp-0) 1) s5-8) + (let* ((f0-46 (vector-dot s4-7 (-> self local-down))) + (f0-47 (+ -4096.0 f0-46)) + ) + (if (< f0-47 0.0) + (vector+float*! s5-8 s5-8 (-> self local-down) f0-47) + ) + ) + ) + (tracking-spline-method-17 (-> self target-spline) s5-8 2048.0 0.0 #f) + ) + (tracking-spline-method-22 (-> self target-spline) 40960.0) + ) + ) + ) + ) + ) + +;; definition for function setup-slave-for-hopefull +(defun setup-slave-for-hopefull ((arg0 camera-slave)) + (when (= (-> arg0 blend-to-type) (camera-blend-to-type unknown-2)) + (cam-calc-follow! (-> arg0 tracking) (-> arg0 trans) #f) + (slave-set-rotation! (-> arg0 tracking) (-> arg0 trans) (the-as float (-> arg0 options)) (-> arg0 fov) #f) + ) + (none) + ) + +;; definition for function master-is-hopeful-better? +(defbehavior master-is-hopeful-better? camera-master ((arg0 camera-slave) (arg1 camera-slave)) + (cond + ((not *camera-combiner*) + #f + ) + ((not arg0) + #t + ) + (else + (< (vector-dot (the-as vector (&-> arg0 stack 112)) (-> *camera-combiner* inv-camera-rot vector 2)) + (vector-dot (the-as vector (&-> arg1 stack 112)) (-> *camera-combiner* inv-camera-rot vector 2)) + ) + ) + ) + ) + +;; definition for function master-choose-entity +;; INFO: Used lq/sq +(defbehavior master-choose-entity camera-master ((arg0 cam-setting-data)) + (local-vars + (v1-22 symbol) + (sv-96 res-tag) + (sv-112 process) + (sv-128 (pointer process)) + (sv-144 int) + (sv-160 string) + (sv-176 string) + (sv-192 uint) + ) + (let ((s5-0 (entity-by-name (-> arg0 entity-name)))) + (set! (-> arg0 real-entity-name) #f) + (when s5-0 + (let ((s2-0 (cam-state-from-entity s5-0))) + (cond + (s2-0 + (set! (-> arg0 real-entity-name) (-> arg0 entity-name)) + (set! (-> arg0 cam-mode) (the-as symbol s2-0)) + (if (-> arg0 teleport-on-entity-change) + (send-event *camera* 'teleport) + ) + ) + (else + (format 0 "ERROR : camera entity '~S' didn't produce a state~%" (res-lump-struct s5-0 'name structure)) + ) + ) + (set! sv-96 (new 'static 'res-tag)) + (let ((s4-1 (res-lump-data s5-0 'alternates pointer :tag-ptr (& sv-96)))) + (when s4-1 + (let* ((s1-1 (get-process *camera-dead-pool* camera-slave #x4000)) + (s3-1 (when s1-1 + (let ((t9-7 (method-of-type camera-slave activate))) + (t9-7 + (the-as camera-slave s1-1) + *camera* + (symbol->string (-> camera-slave symbol)) + (the-as pointer #x70004000) + ) + ) + (run-now-in-process s1-1 cam-slave-init s2-0 s5-0) + (the-as (pointer camera-slave) (-> s1-1 ppointer)) + ) + ) + ) + (if s3-1 + (setup-slave-for-hopefull (the-as camera-slave (ppointer->process s3-1))) + (format 0 "ERROR : primary region activate failed~%") + ) + (dotimes (s2-1 (the-as int (-> sv-96 elt-count))) + (let ((s0-0 (entity-by-name (the-as string (-> (the-as (pointer uint32) (&+ s4-1 (* s2-1 4)))))))) + (cond + (s0-0 + (let ((s1-2 (cam-state-from-entity s0-0))) + (cond + (s1-2 + (set! sv-112 (get-process *camera-dead-pool* camera-slave #x4000)) + (set! v1-22 (when sv-112 + (set! sv-128 (the-as (pointer process) v1-22)) + (let ((t9-14 (method-of-type camera-slave activate))) + (t9-14 + (the-as camera-slave sv-112) + *camera* + (symbol->string (-> camera-slave symbol)) + (the-as pointer #x70004000) + ) + ) + (run-now-in-process sv-112 cam-slave-init s1-2 s0-0) + (set! sv-128 (-> sv-112 ppointer)) + v1-22 + ) + ) + (cond + (sv-128 + (setup-slave-for-hopefull (the-as camera-slave (ppointer->process sv-128))) + (cond + ((master-is-hopeful-better? + (the-as camera-slave (ppointer->process s3-1)) + (the-as camera-slave (ppointer->process sv-128)) + ) + (if s3-1 + (deactivate (-> s3-1 0)) + ) + (set! s3-1 (the-as (pointer camera-slave) sv-128)) + (set! (-> arg0 real-entity-name) (the-as string (-> (the-as (pointer uint32) (&+ s4-1 (* s2-1 4)))))) + (set! (-> arg0 cam-mode) (the-as symbol s1-2)) + ) + (else + (deactivate (-> sv-128 0)) + ) + ) + ) + (else + (format 0 "ERROR : alternate region activate failed~%") + ) + ) + ) + (else + (let ((s1-5 format)) + (set! sv-144 0) + (set! sv-160 "ERROR : alternate camera region '~S' didn't produce a state~%") + (let ((a2-14 (res-lump-struct s0-0 'name structure))) + (s1-5 sv-144 sv-160 a2-14) + ) + ) + ) + ) + ) + ) + (else + (let ((s1-7 format) + (s0-1 0) + ) + (set! sv-176 "ERROR : alternate '~S' not found for '~S'~%") + (set! sv-192 (-> (the-as (pointer uint32) (&+ s4-1 (* s2-1 4))))) + (let ((a3-8 (res-lump-struct s5-0 'name structure))) + (s1-7 s0-1 sv-176 sv-192 a3-8) + ) + ) + ) + ) + ) + ) + (if s3-1 + (deactivate (-> s3-1 0)) + ) + ) + ) + ) + ) + ) + ) + (cond + ((-> arg0 real-entity-name) + #f + ) + ((-> arg0 mode-name) + (let ((s5-1 (-> arg0 mode-name value))) + (set! (-> arg0 cam-mode) (the-as symbol (if (type? s5-1 state) + s5-1 + ) + ) + ) + ) + (set! (-> arg0 real-entity-name) #f) + #f + ) + (else + (set! (-> arg0 cam-mode) (the-as symbol cam-free-floating)) + (set! (-> arg0 real-entity-name) #f) + #f + ) + ) + ) + +;; definition for function cam-master-set-entity +;; WARN: Return type mismatch int vs none. +(defun cam-master-set-entity ((arg0 cam-setting-data)) + (if (-> arg0 entity-or-mode-changed) + (master-choose-entity arg0) + ) + (let ((s5-0 (entity-by-name (-> arg0 entity-name)))) + (when s5-0 + (set! (-> arg0 fov) (cam-slave-get-fov s5-0)) + (set! (-> arg0 string-min-height) + (cam-slave-get-float s5-0 'stringMinHeight (-> *CAMERA-bank* default-string-min-y)) + ) + (set! (-> arg0 string-max-height) + (cam-slave-get-float s5-0 'stringMaxHeight (-> *CAMERA-bank* default-string-max-y)) + ) + (set! (-> arg0 string-min-length) + (cam-slave-get-float s5-0 'stringMinLength (-> *CAMERA-bank* default-string-min-z)) + ) + (let ((f0-8 (cam-slave-get-float s5-0 'stringMaxLength (-> *CAMERA-bank* default-string-max-z)))) + (if (< 405504.0 f0-8) + (set! f0-8 (-> *CAMERA-bank* default-string-max-z)) + ) + (set! (-> arg0 string-max-length) f0-8) + ) + (set! (-> arg0 string-default) #f) + (set! (-> arg0 string-cliff-height) (cam-slave-get-float s5-0 'stringCliffHeight 163840.0)) + (let ((a1-5 (new 'stack-no-clear 'vector))) + (when (cam-slave-get-vector-with-offset (the-as entity-actor s5-0) a1-5 'interesting) + ) + ) + (set! (-> arg0 interp-time) (the-as uint (the int (* 300.0 (cam-slave-get-interp-time s5-0))))) + (let ((s4-0 (method-of-type res-lump get-property-value)) + (s3-0 s5-0) + ) + (format (clear *res-key-string*) "~S~S" 'flags '-on) + (let ((s4-1 (s4-0 + s3-0 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (s3-1 (method-of-type res-lump get-property-value)) + ) + (format (clear *res-key-string*) "~S~S" 'flags '-off) + (let ((v1-19 (s3-1 + s5-0 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (logior! (-> arg0 slave-options) s4-1) + (logclear! (-> arg0 slave-options) v1-19) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function cam-master-activate-slave +;; WARN: Return type mismatch int vs none. +(defun cam-master-activate-slave ((arg0 symbol)) + (when (and *camera* (or arg0 (not (-> *camera* slave)) (-> *camera* settings entity-or-mode-changed))) + (when (and arg0 (-> *camera* slave)) + (deactivate (-> *camera* slave 0)) + (set! (-> *camera* slave) (the-as (pointer camera-slave) #f)) + ) + (let* ((s5-0 (-> *camera* settings)) + (gp-0 (entity-by-name (-> s5-0 real-entity-name))) + (s5-1 (the-as object (-> s5-0 cam-mode))) + ) + (if (not (the-as symbol s5-1)) + (set! s5-1 cam-free-floating) + ) + (send-event + *camera* + 'set-slave + (ppointer->process + (process-spawn camera-slave :init cam-slave-init s5-1 gp-0 :from *camera-dead-pool* :to *camera*) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate cam-master-active (camera-master) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (local-vars (v0-0 none) (v1-125 uint)) + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (let ((v1-0 event-type)) + (the-as + object + (cond + ((= v1-0 'dist-from-interp-src) + (cond + ((not *camera-combiner*) + #x48c80000 + ) + ((= (-> *camera-combiner* interp-val) 0.0) + 0 + ) + (else + (-> *camera-combiner* dist-from-src) + ) + ) + ) + ((= v1-0 'dist-from-interp-dest) + (cond + ((not *camera-combiner*) + 0 + ) + ((= (-> *camera-combiner* interp-val) 0.0) + #x48c80000 + ) + (else + (-> *camera-combiner* dist-from-dest) + ) + ) + ) + ((= v1-0 'level-deactivate) + (format 0 "ERROR : *camera* level-deactivate event not supported anymore~%") + ) + ((= v1-0 'clear-entity) + (format 0 "ERROR : *camera* clear-entity event not supported anymore~%") + ) + ((= v1-0 'no-intro) + (format 0 "ERROR : *camera* no-intro event not supported anymore '~S'~%" (-> event param 0)) + ) + ((= v1-0 'force-blend) + (format 0 "ERROR : *camera* force-blend event not supported anymore '~S'~%" (-> event param 0)) + ) + ((= v1-0 'teleport-to-transformq) + (when (> arg1 0) + (let ((gp-1 (the-as object (-> event param 0)))) + (when (-> self slave) + (deactivate (-> self slave 0)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) + ) + (set! (-> *camera-combiner* trans quad) (-> (the-as matrix gp-1) vector 0 quad)) + (quaternion->matrix (-> *camera-combiner* inv-camera-rot) (the-as quaternion (+ (the-as uint gp-1) 16))) + ) + (send-event self 'teleport) + (cam-master-activate-slave #f) + #t + ) + ) + ((= v1-0 'teleport-to-other-start-string) + (let ((gp-2 (new 'stack-no-clear 'vector))) + (when (-> self slave) + (deactivate (-> self slave 0)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) + ) + (set! (-> *camera-combiner* trans quad) (-> *camera-other-trans* quad)) + (vector-! gp-2 (-> self tpos-curr-adj) *camera-other-trans*) + (vector-normalize! gp-2 1.0) + (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-2 (new 'static 'vector :y -1.0)) + ) + (send-event self 'teleport) + (cam-master-activate-slave #f) + ) + ((= v1-0 'teleport-to-vector-start-string) + (when (> arg1 0) + (let ((s5-0 (the-as object (-> event param 0))) + (gp-3 (new 'stack-no-clear 'vector)) + ) + (when (-> self slave) + (deactivate (-> self slave 0)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) + ) + (set! (-> *camera-combiner* trans quad) (-> (the-as vector s5-0) quad)) + (vector-! gp-3 (-> self tpos-curr-adj) (the-as vector s5-0)) + (vector-normalize! gp-3 1.0) + (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-3 (new 'static 'vector :y -1.0)) + ) + (send-event self 'teleport) + (cam-master-activate-slave #f) + ) + ) + ((= v1-0 'change-target) + (let ((a1-15 (-> event param 0))) + (cond + ((not a1-15) + (clear-focused (-> self focus)) + (set! (-> self master-options) (logand -2 (-> self master-options))) + ) + (else + (try-update-focus (-> self focus) (the-as process-focusable a1-15)) + (logior! (-> self master-options) 1) + (reset-target-tracking) + ) + ) + ) + (set! (-> *camera-combiner* tracking no-follow) #f) + #f + ) + ((= v1-0 'intro-done?) + (or (not (-> self slave)) (>= (-> self slave 0 intro-t) 1.0)) + ) + ((= v1-0 'query-state) + (and (-> self slave) (= (-> self slave 0 next-state) (-> event param 0))) + ) + ((= v1-0 'change-to-entity-by-name) + (format + 0 + "ERROR : *camera* change-to-entity-by-name event not supported anymore '~S'~%" + (-> event param 0) + ) + ) + ((= v1-0 'change-state) + (format 0 "ERROR : *camera* change-state event not supported anymore ~A~%" (-> event param 0)) + ) + ((= v1-0 'set-slave) + (let ((s5-1 (process->ppointer (the-as process (-> event param 0)))) + (s4-0 (-> self settings interp-time)) + (gp-4 (-> self slave)) + ) + (when (and s5-1 (!= s5-1 gp-4)) + (set! (-> self slave) (the-as (pointer camera-slave) s5-1)) + (logior! (-> self master-options) 2) + (set! (-> *camera-combiner* tracking tilt-adjust target) (-> self slave 0 tracking tilt-adjust target)) + (cond + ((or (zero? s4-0) (not gp-4)) + (if *math-camera* + (set! (-> *math-camera* reset) 1) + ) + (send-event *camera-combiner* 'set-interpolation 0) + (send-event *camera-combiner* 'stop-tracking) + (if (= (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) (camera-blend-to-type unknown-2)) + (send-event *camera-combiner* 'start-tracking (ppointer->process s5-1)) + ) + ) + ((begin + (when (< 0.0 (-> gp-4 0 intro-t-step)) + (set! (-> self outro-t) (-> gp-4 0 intro-t)) + (set! (-> self outro-t-step) (/ -5.0 (the float s4-0))) + (set! (-> self outro-exit-value) (-> gp-4 0 outro-exit-value)) + (curve-copy! (-> self outro-curve) (-> gp-4 0 intro-curve)) + ) + (if (-> self settings no-intro) + (set! (-> self outro-t) 0.0) + ) + (send-event *camera-combiner* 'set-interpolation s4-0) + (cond + ((zero? (-> gp-4 0 blend-from-type)) + (send-event (ppointer->process (-> self decel)) 'change-state cam-fixed) + (send-event *camera-combiner* 'stop-tracking) + ) + (else + (send-event (ppointer->process (-> self decel)) 'change-state cam-decel) + ) + ) + (set! v1-125 (-> *camera-combiner* tracking-status)) + (zero? v1-125) + ) + (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) + (((camera-blend-to-type unknown-0)) + ) + (((camera-blend-to-type unknown-1)) + ) + (((camera-blend-to-type unknown-2)) + (if (= (-> gp-4 0 blend-from-type) 1) + (send-event *camera-combiner* 'copy-tracking (ppointer->process gp-4)) + (send-event *camera-combiner* 'start-tracking (ppointer->process s5-1)) + ) + (set! (-> *camera-combiner* tracking-status) (the-as uint 2)) + ) + (else + (format 0 "unknown blend-to type~%") + ) + ) + ) + ((= v1-125 1) + (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) + (((camera-blend-to-type unknown-0)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 3)) + ) + (((camera-blend-to-type unknown-1)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 3)) + ) + (((camera-blend-to-type unknown-2)) + ) + (else + (format 0 "unknown blend-to type~%") + ) + ) + ) + ((or (= v1-125 2) (= v1-125 3)) + (case (-> (the-as camera-slave (-> s5-1 0)) blend-to-type) + (((camera-blend-to-type unknown-0)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 0)) + 0 + ) + (((camera-blend-to-type unknown-1)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 0)) + 0 + ) + (((camera-blend-to-type unknown-2)) + (set! (-> *camera-combiner* tracking-status) (the-as uint 2)) + ) + (else + (format 0 "unknown blend-to type~%") + ) + ) + ) + (else + (format 0 "unknown combiner status~%") + ) + ) + (if gp-4 + (deactivate (-> gp-4 0)) + ) + ) + ) + ) + ((= v1-0 'ease-in) + (cond + ((< arg1 1) + (set! (-> self ease-t) 0.0) + (set! (-> self master-options) (logand -9 (-> self master-options))) + ) + ((< arg1 2) + (if (< (the-as float (-> event param 0)) (-> self ease-t)) + (set! (-> self ease-t) (the-as float (-> event param 0))) + ) + (set! (-> self master-options) (logand -9 (-> self master-options))) + ) + (else + (if (< (the-as float (-> event param 0)) (-> self ease-t)) + (set! (-> self ease-t) (the-as float (-> event param 0))) + ) + (set! (-> self ease-to quad) (-> (the-as vector (-> event param 1)) quad)) + (logior! (-> self master-options) 8) + ) + ) + (set! (-> self ease-step) 0.033333335) + (set! v0-0 (the-as none (-> self ease-from))) + (set! (-> (the-as vector v0-0) quad) (-> self tpos-curr-adj quad)) + v0-0 + ) + ((= v1-0 'damp-up) + (set! (-> self upspeed) 0.0) + ) + ((= v1-0 'reset-follow) + (reset-follow) + ) + ((= v1-0 'teleport) + (reset-target-tracking) + (if (-> self slave) + (send-event (ppointer->process (-> self slave)) event-type) + ) + (send-event *camera-combiner* event-type) + ) + ((= v1-0 'toggle-slave-option) + (logxor! (-> self slave-options) (-> event param 0)) + (if (-> self slave) + (logxor! (-> self slave 0 options) (-> event param 0)) + ) + (when (-> self decel) + (set! v0-0 (the-as none (logxor (-> self decel 0 options) (-> event param 0)))) + (set! (-> self decel 0 options) (the-as uint v0-0)) + v0-0 + ) + ) + ((= v1-0 'slave-option?) + (and (-> self slave) (logtest? (-> self slave 0 options) (-> event param 0))) + ) + ((= v1-0 'set-slave-option) + (when (-> self slave) + (set! v0-0 (the-as none (logior (-> self slave 0 options) (-> event param 0)))) + (set! (-> self slave 0 options) (the-as uint v0-0)) + v0-0 + ) + ) + ((= v1-0 'clear-slave-option) + (when (-> self slave) + (set! v0-0 (the-as none (logclear (-> self slave 0 options) (-> event param 0)))) + (set! (-> self slave 0 options) (the-as uint v0-0)) + v0-0 + ) + ) + ((= v1-0 'no-follow) + (when (-> self slave) + (set! (-> self slave 0 tracking no-follow) (the-as basic #t)) + (vector-reset! (-> self slave 0 tracking follow-off)) + ) + (set! (-> *camera-combiner* tracking no-follow) (the-as basic #t)) + (set! v0-0 (the-as none (-> *camera-combiner* tracking follow-off))) + (.svf (&-> (the-as vector v0-0) quad) vf0) + v0-0 + ) + ((= v1-0 'yes-follow) + (if (-> self slave) + (set! (-> self slave 0 tracking no-follow) #f) + ) + (set! (-> *camera-combiner* tracking no-follow) #f) + #f + ) + ((= v1-0 'blend-from-as-fixed) + (let ((t9-42 format) + (a0-101 0) + (a1-35 "ERROR : *camera* blend-from-as-fixed event not supported anymore~%") + ) + (-> event param 0) + (t9-42 a0-101 a1-35) + ) + ) + ((= v1-0 'point-of-interest) + (let ((t9-43 format) + (a0-102 0) + (a1-36 "ERROR : *camera* point-of-interest event not supported anymore~%") + ) + (-> event param 0) + (t9-43 a0-102 a1-36) + ) + ) + ((= v1-0 'part-water-drip) + (set! (-> self water-drip-time) (-> self clock frame-counter)) + (set! (-> self water-drip-mult) (the-as float (-> event param 0))) + (set! (-> self water-drip-speed) (the-as float (-> event param 1))) + ) + (else + (and (-> self slave) (let ((v1-237 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-237 from) (process->ppointer proc)) + (set! (-> v1-237 num-params) arg1) + (set! (-> v1-237 message) event-type) + (set! (-> v1-237 param 0) (-> event param 0)) + (set! (-> v1-237 param 1) (-> event param 1)) + (set! (-> v1-237 param 2) (-> event param 2)) + (set! (-> v1-237 param 3) (-> event param 3)) + (set! (-> v1-237 param 4) (-> event param 4)) + (set! (-> v1-237 param 5) (-> event param 5)) + (send-event-function (ppointer->process (-> self slave)) v1-237) + ) + ) + ) + ) + ) + ) + ) + ) + :enter (behavior () + (let ((v1-1 + (process-spawn camera-slave :init cam-slave-init cam-free-floating #f :from *camera-dead-pool* :to self) + ) + ) + (set! (-> self slave) (the-as (pointer camera-slave) v1-1)) + (if (not v1-1) + (format 0 "ERROR : first slave failed to activate~%") + ) + ) + (let ((v1-8 (process-spawn camera-slave :init cam-slave-init cam-fixed #f :from *camera-dead-pool* :to self))) + (set! (-> self decel) (the-as (pointer camera-slave) v1-8)) + (if (not v1-8) + (format 0 "ERROR : decel failed to activate~%") + ) + ) + (if (and (nonzero? camera-master-debug) *debug-segment*) + (add-connection *debug-engine* self camera-master-debug self #f #f) + ) + (none) + ) + :trans (behavior () + (when (not (paused?)) + (vector-negate! + (-> self local-down) + (vector-normalize-copy! (-> self local-down) (-> *standard-dynamics* gravity) 1.0) + ) + (cam-master-effect) + ) + (none) + ) + :code (behavior () + (until #f + (when *debug-segment* + (let ((gp-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-7 'camera) + (s5-0 *profile-camera-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s4-0 (-> gp-0 data (-> gp-0 count)))) + (let ((s3-0 (-> gp-0 base-time))) + (set! (-> s4-0 name) v1-7) + (set! (-> s4-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-0)))) + ) + (set! (-> s4-0 depth) (the-as uint (-> gp-0 depth))) + (set! (-> s4-0 color) s5-0) + (set! (-> gp-0 segment (-> gp-0 depth)) s4-0) + ) + (+! (-> gp-0 count) 1) + (+! (-> gp-0 depth) 1) + (set! (-> gp-0 max-depth) (max (-> gp-0 max-depth) (-> gp-0 depth))) + ) + ) + 0 + ) + (set! (-> self string-min target y) (-> self settings string-min-height)) + (set! (-> self string-max target y) (-> self settings string-max-height)) + (set! (-> self string-min target z) (-> self settings string-min-length)) + (set! (-> self string-max target z) (-> self settings string-max-length)) + (when (logtest? (-> *camera* settings master-options) (cam-master-options IMMEDIATE_STRING_MIN_MAX)) + (set! (-> self string-min value y) (-> self settings string-min-height)) + (set! (-> self string-max value y) (-> self settings string-max-height)) + (set! (-> self string-min value z) (-> self settings string-min-length)) + (set! (-> self string-max value z) (-> self settings string-max-length)) + ) + (set! (-> self string-push-z) (fmax (-> self string-min value z) (-> *CAMERA-bank* default-string-push-z))) + (master-track-target) + (set! (-> last-try-to-look-at-data horz) 0.0) + (set! (-> last-try-to-look-at-data vert) 0.0) + (when (not (paused?)) + (update! (-> self string-min) (the-as vector #f)) + (update! (-> self string-max) (the-as vector #f)) + ) + (set! (-> self string-min value x) + (fmin (-> self string-min value x) (+ -4.096 (-> self string-max value x))) + ) + (set! (-> self string-min value y) + (fmin (-> self string-min value y) (+ -4.096 (-> self string-max value y))) + ) + (set! (-> self string-min value z) + (fmin (-> self string-min value z) (+ -4.096 (-> self string-max value z))) + ) + (when *debug-segment* + (let ((gp-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-56 (+ (-> gp-1 depth) -1)) + (s5-1 (-> gp-1 segment v1-56)) + (s4-1 (-> gp-1 base-time)) + ) + (when (>= v1-56 0) + (set! (-> s5-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-1)))) + (+! (-> gp-1 depth) -1) + ) + ) + ) + ) + 0 + ) + (suspend) + ) + #f + (none) + ) + ) + +;; definition for function cam-master-init +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior cam-master-init camera-master () + (stack-size-set! (-> self main-thread) 512) + (logclear! (-> self mask) (process-mask menu)) + (set! (-> self master-options) (the-as uint 0)) + (set! (-> self settings) (-> *setting-control* cam-current)) + (set! (-> self slave) (the-as (pointer camera-slave) #f)) + (set! (-> self decel) (the-as (pointer camera-slave) #f)) + (set! (-> self slave-options) (the-as uint 560)) + (set! (-> self view-off-param-save) 1.0) + (set! (-> self changer) (the-as uint (process->ppointer self))) + (set! (-> self string-push-z) (-> *CAMERA-bank* default-string-push-z)) + (let ((gp-0 (new-stack-vector0))) + (set! (-> gp-0 y) (-> self settings string-min-height)) + (set! (-> gp-0 z) (-> self settings string-min-length)) + (init (-> self string-min) gp-0 40.96 409.6 0.9) + (set! (-> gp-0 y) (-> self settings string-max-height)) + (set! (-> gp-0 z) (-> self settings string-max-length)) + (init (-> self string-max) gp-0 40.96 409.6 0.9) + ) + (set! (-> self outro-t-step) 0.0) + (reset-to-collide-spec (-> self focus) (collide-spec jak player-list)) + (let ((a1-4 (new-stack-vector0))) + (tracking-spline-method-10 (-> self target-spline) a1-4) + ) + (set! (-> self water-drip) (create-launch-control group-rain-screend-drop self)) + (set! (-> self water-drip-time) (seconds -60)) + (go cam-master-active) + 0 + (none) + ) + +;; definition for method 14 of type camera-master +(defmethod camera-master-method-14 camera-master ((obj camera-master) (arg0 vector)) + (if (handle->process (-> obj focus handle)) + (vector-! arg0 (-> obj tpos-curr) (-> obj tpos-old)) + (vector-reset! arg0) + ) + arg0 + ) + +;; definition for method 15 of type camera-master +;; INFO: Used lq/sq +(defmethod camera-master-method-15 camera-master ((obj camera-master) (arg0 vector)) + (if (and (-> obj slave) (-> obj slave 0 next-state) (= (-> obj slave 0 next-state name) 'cam-string)) + (set! (-> arg0 quad) (-> obj slave 0 view-flat quad)) + (vector-reset! arg0) + ) + arg0 + ) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc index 94c181ec9e..49266a849a 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc @@ -982,180 +982,225 @@ ) ;; definition for function cam-circular-position -;; ERROR: function has no type analysis. Cannot decompile. +(defbehavior cam-circular-position camera-slave ((arg0 symbol)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (if (logtest? (-> self options) 130) + (vector-! gp-0 (-> self circular-follow) (-> self pivot-pt)) + (vector-! gp-0 (-> self pivot-pt) (-> self circular-follow)) + ) + (vector-! s5-0 (-> self trans) (-> self pivot-pt)) + (when (not (logtest? (-> self options) 4)) + (vector-flatten! gp-0 gp-0 (-> *camera* local-down)) + (vector-flatten! s5-0 s5-0 (-> *camera* local-down)) + ) + (cond + ((logtest? (-> self options) 128) + (let ((f30-0 (- (vector-length gp-0) (-> self pivot-rad)))) + (when (< 0.0001 (-> *camera-combiner* tracking point-of-interest-blend value)) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + 0.0 + (vector-! s5-1 (-> *camera-combiner* tracking looking-interesting) (-> self pivot-pt)) + (vector-normalize-copy! s3-0 gp-0 1.0) + (let ((f28-0 (vector-dot s5-1 s3-0))) + (vector-float*! s4-1 s3-0 f28-0) + (let ((f0-11 + (/ (* (vector-vector-distance s5-1 s4-1) (cos (-> *camera-combiner* fov))) (sin (-> *camera-combiner* fov))) + ) + ) + (set! f30-0 (fmin f30-0 (if (>= 16384.0 (-> *camera-combiner* fov)) + (- f28-0 f0-11) + (+ f28-0 f0-11) + ) + ) + ) + ) + ) + ) + ) + (if (>= 0.0 f30-0) + (vector-reset! gp-0) + (vector-normalize! gp-0 f30-0) + ) + ) + ) + ((not arg0) + (set! (-> self max-angle-curr) (-> self max-angle-offset)) + (cam-circular-position-into-max-angle gp-0 s5-0 1.0) + ) + (else + (cam-circular-position-into-max-angle gp-0 s5-0 0.05) + ) + ) + ) + (vector+! (-> self trans) gp-0 (-> self pivot-pt)) + ) + ) ;; definition for function cam-circular-code ;; INFO: Used lq/sq -;; ERROR: failed type prop at 56: Called a function, but we do not know its type -;; WARN: Return type mismatch none vs float. (defbehavior cam-circular-code camera-slave () - (local-vars - (v0-0 vector) - (v0-1 vector) - (v0-2 none) - (v0-3 none) - (v0-4 none) - (v0-5 none) - (v0-6 none) - (v0-7 none) - (v1-0 vector) - (v1-1 none) - (v1-2 vector) - (v1-3 vector) - (v1-4 uint) - (v1-5 uint) - (v1-6 int) - (v1-7 clock) - (v1-9 none) - (v1-10 none) - (v1-11 none) - (v1-13 vector) - (v1-14 none) - (v1-15 none) - (a0-0 vector) - (a0-1 uint128) - (a0-2 vector) - (a0-3 camera-master) - (a0-4 vector) - (a0-5 vector) - (a0-6 vector) - (a0-7 none) - (a0-8 vector) - (a0-9 symbol) - (a0-10 none) - (a1-0 symbol) - (a1-1 vector) - (a1-2 vector) - (a1-3 vector) - (a1-4 vector) - (a1-5 none) - (a1-6 vector) - (a1-7 vector) - (a1-8 none) - (a2-0 symbol) - (a2-1 none) - (a3-0 symbol) - (a3-1 symbol) - (a3-2 none) - (t0-0 float) - (s3-0 none) - (t9-0 (function vector vector curve symbol vector :behavior camera-slave)) - (t9-1 (function vector vector vector vector float vector)) - (t9-2 none) - (t9-3 function) - (t9-4 none) - (t9-5 none) - (t9-6 none) - (gp-0 none) - (f0-0 float) - (f0-1 float) - (f0-2 none) - (f0-3 none) - (f0-4 none) - (f0-5 none) - (f0-6 none) - (f0-7 none) - (f1-0 float) - (f1-1 none) - (f1-2 none) + (set! (-> self pivot-pt quad) (-> self saved-pt quad)) + (cam-curve-pos (-> self pivot-pt) (the-as vector #f) (the-as curve #f) #f) + (let ((a2-1 (new-stack-vector0))) + (vector-! a2-1 (-> *camera* tpos-curr-adj) (-> self pivot-pt)) + (vector-! (-> self circular-follow) (-> self circular-follow) (-> self pivot-pt)) + (if (logtest? (-> self options) 4) + (v-slrp3! + (-> self circular-follow) + (-> self circular-follow) + a2-1 + (the-as vector #f) + (* 182.04445 (-> self clock time-adjust-ratio)) + ) + (v-slrp3! + (-> self circular-follow) + (-> self circular-follow) + a2-1 + (-> *camera* local-down) + (* 182.04445 (-> self clock time-adjust-ratio)) + ) + ) ) - (when (begin - (cond - ((begin - (set! v1-0 (-> s6-0 pivot-pt)) - (set! a0-0 (-> s6-0 saved-pt)) - (set! a0-1 (-> a0-0 quad)) - (set! (-> v1-0 quad) a0-1) - (set! t9-0 cam-curve-pos) - (set! a0-2 (-> s6-0 pivot-pt)) - (set! a1-0 #f) - (set! a2-0 #f) - (set! a3-0 #f) - (call! a0-2 a1-0 a2-0 a3-0) - (set! a2-1 (the-as none (new 'stack-no-clear 'vector))) - (s.q! a2-1 0) - (set! v1-1 (the-as none a2-1)) - (set! a0-3 *camera*) - (set! a0-4 (-> a0-3 tpos-curr-adj)) - (set! a1-1 (-> s6-0 pivot-pt)) - (set! v1-2 (vector-!2 v1-1 a0-4 a1-1)) - (set! a1-2 (-> s6-0 circular-follow)) - (set! v1-3 (-> s6-0 circular-follow)) - (set! a0-5 (-> s6-0 pivot-pt)) - (set! a1-3 (vector-!2 a1-2 v1-3 a0-5)) - (set! v1-4 (-> s6-0 options)) - (set! v1-5 (logand v1-4 4)) - (nonzero? v1-5) - ) - (set! t9-1 v-slrp3!) - (set! a0-6 (-> s6-0 circular-follow)) - (set! a1-4 (-> s6-0 circular-follow)) - (set! a3-1 #f) - (set! v1-6 #x43360b61) - (set! f0-0 (the-as float (gpr->fpr v1-6))) - (set! v1-7 (-> s6-0 clock)) - (set! f1-0 (-> v1-7 time-adjust-ratio)) - (set! f0-1 (*.s f0-0 f1-0)) - (set! t0-0 (fpr->gpr f0-1)) - (call! a0-6 a1-4 a2-1 a3-1 t0-0) - (set! v1-8 v0-1) - ) - (else - (set! t9-2 (the-as none v-slrp3!)) - (set! a0-7 (the-as none (-> s6-0 circular-follow))) - (set! a1-5 (the-as none (-> s6-0 circular-follow))) - (set! v1-9 (the-as none *camera*)) - (set! a3-2 (the-as none (+ v1-9 284))) - (set! v1-10 (the-as none #x43360b61)) - (set! f0-2 (the-as none (gpr->fpr v1-10))) - (set! v1-11 (the-as none (-> s6-0 clock))) - (set! f1-1 (the-as none (l.f (+ v1-11 84)))) - (set! f0-3 (the-as none (*.s f0-2 f1-1))) - (set! t0-1 (the-as none (fpr->gpr f0-3))) - (call!) - (set! v1-12 (the-as none v0-2)) + (vector+! (-> self circular-follow) (-> self circular-follow) (-> self pivot-pt)) + (cam-circular-position #t) + (if (!= (-> self fov1) 0.0) + (set! (-> self fov) + (lerp-clamp + (-> self fov0) + (-> self fov1) + (parameter-ease-sin-clamp (cam-index-method-10 (-> self fov-index) (-> *camera* tpos-curr-adj))) ) ) - (set! a1-6 (-> s6-0 circular-follow)) - (set! v1-13 (-> s6-0 circular-follow)) - (set! a0-8 (-> s6-0 pivot-pt)) - (set! a1-7 (vector+!2 a1-6 v1-13 a0-8)) - (set! t9-3 cam-circular-position) - (set! a0-9 #t) - (call!) - (set! f0-4 (the-as none (-> s6-0 fov1))) - (set! f1-2 (the-as none 0)) - (!=.s f0-4 f1-2) - ) - (set! gp-0 (the-as none lerp-clamp)) - (set! f0-5 (the-as none (l.f (+ s6-0 144)))) - (set! s5-0 (the-as none (fpr->gpr f0-5))) - (set! f0-6 (the-as none (l.f (+ s6-0 148)))) - (set! s4-0 (the-as none (fpr->gpr f0-6))) - (set! s3-0 (the-as none parameter-ease-sin-clamp)) - (set! a0-10 (the-as none (+ s6-0 156))) - (set! v1-14 (the-as none cam-index)) - (set! t9-4 (the-as none (l.wu (+ v1-14 56)))) - (set! v1-15 (the-as none *camera*)) - (set! a1-8 (the-as none (+ v1-15 524))) - (call!) - (set! a0-11 (the-as none v0-5)) - (set! t9-5 (the-as none s3-0)) - (call!) - (set! a2-2 (the-as none v0-6)) - (set! t9-6 (the-as none gp-0)) - (set! a0-12 (the-as none s5-0)) - (set! a1-9 (the-as none s4-0)) - (set! v0-7 (the-as none (call!))) - (set! f0-7 (the-as none (gpr->fpr v0-7))) - (s.f! (+ s6-0 140) f0-7) - (set! v0-4 (the-as none (fpr->gpr f0-7))) - ) - (ret-value v0-4) + ) ) ;; failed to figure out what this is: (defstate cam-circular (camera-slave) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) + (the-as object (cond + ((= v1-0 'teleport) + #f + ) + ((= v1-0 'outro-done) + (set! (-> self trans quad) (-> *camera-combiner* trans quad)) + (cam-circular-position #f) + ) + (else + (cam-standard-event-handler proc arg1 event-type event) + ) + ) + ) + ) + ) + :enter (behavior () + (cond + ((-> self enter-has-run) + ) + (else + (let ((gp-0 (new-stack-vector0))) + (set! (-> (new 'stack-no-clear 'collide-query) best-other-tri vertex 0 quad) (the-as uint128 0)) + (set! (-> self view-off-param) 1.0) + (set! (-> self circular-follow quad) (-> *camera* tpos-curr-adj quad)) + (set! (-> self max-angle-offset) 0.0) + (cond + ((-> self cam-entity) + (cam-slave-get-vector-with-offset (the-as entity-actor (-> self cam-entity)) (-> self saved-pt) 'pivot) + (cam-slave-get-vector-with-offset (the-as entity-actor (-> self cam-entity)) gp-0 'trans) + (set! (-> self pivot-rad) (vector-length (vector-! gp-0 gp-0 (-> self saved-pt)))) + (logior! (-> self options) (cam-slave-get-flags (-> self cam-entity) 'flags)) + (set! (-> self fov) (cam-slave-get-fov (-> self cam-entity))) + (set! (-> self tracking tilt-adjust target) + (cam-slave-get-float (-> self cam-entity) 'tiltAdjust (-> *CAMERA-bank* default-tilt-adjust)) + ) + (set! (-> self max-angle-offset) (cam-slave-get-float (-> self cam-entity) 'maxAngle 0.0)) + (if (< (-> self max-angle-offset) 0.0) + (set! (-> self max-angle-offset) 0.0) + ) + (set! (-> self fov1) (cam-slave-get-float (-> self cam-entity) 'focalPull 0.0)) + (cond + ((and (!= (-> self fov1) 0.0) + (cam-index-method-9 (-> self fov-index) 'focalpull (-> self cam-entity) (-> self saved-pt) (the-as curve #f)) + ) + (set! (-> self fov0) (-> self fov)) + (set! (-> self fov) (lerp-clamp + (-> self fov0) + (-> self fov1) + (cam-index-method-10 (-> self fov-index) (-> *camera* tpos-curr-adj)) + ) + ) + ) + (else + (set! (-> self fov1) 0.0) + ) + ) + (set! (-> self spline-follow-dist) (cam-slave-get-float (-> self cam-entity) 'spline-follow-dist 0.0)) + (cam-curve-setup (-> self saved-pt)) + (cond + ((< 0.0 (-> self spline-follow-dist)) + (let ((a0-17 (new 'stack-no-clear 'vector)) + (gp-3 (new 'stack-no-clear 'vector)) + ) + (curve-get-pos! a0-17 0.0 (-> self spline-curve)) + (curve-get-pos! gp-3 1.0 (-> self spline-curve)) + ) + (set! (-> self spline-tt) (curve-closest-point + (-> self spline-curve) + (-> self circular-follow) + 0.5 + -4096.0 + 10 + (-> self spline-follow-dist) + ) + ) + (curve-get-pos! (-> self pivot-pt) (-> self spline-tt) (-> self spline-curve)) + ) + (else + (set! (-> self spline-follow-dist) 0.0) + (set! (-> self pivot-pt quad) (-> self saved-pt quad)) + (cam-curve-pos (-> self pivot-pt) (the-as vector #f) (the-as curve #f) #f) + ) + ) + ) + ((logtest? (-> self options) 128) + (vector-! (-> self pivot-pt) (-> *camera* tpos-curr-adj) (-> self trans)) + (vector-flatten! (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down)) + (set! (-> self pivot-rad) (vector-length (-> self pivot-pt))) + (set! (-> self pivot-pt quad) (-> self trans quad)) + (set! (-> self saved-pt quad) (-> self pivot-pt quad)) + ) + (else + (vector-! (-> self pivot-pt) (-> *camera* tpos-curr-adj) (-> self trans)) + (vector-float*! (-> self pivot-pt) (-> self pivot-pt) 0.5) + (vector-flatten! (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down)) + (set! (-> self pivot-rad) (vector-length (-> self pivot-pt))) + (vector+! (-> self pivot-pt) (-> self trans) (-> self pivot-pt)) + (set! (-> self saved-pt quad) (-> self pivot-pt quad)) + ) + ) + ) + (cam-circular-position #f) + (cond + ((logtest? (-> self options) #x4000) + (set! (-> self blend-from-type) (the-as uint 0)) + (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) + (cam-slave-get-rot (the-as entity-actor (-> self cam-entity)) (the-as matrix (-> self tracking))) + ) + (else + (set! (-> self blend-from-type) (the-as uint 2)) + (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) + ) + ) + ) + ) + (none) + ) :trans (behavior () (if (not (logtest? (-> *camera* master-options) 1)) (cam-slave-go cam-free-floating) @@ -1841,7 +1886,7 @@ (sv-768 pat-surface) (sv-784 vector) (sv-800 vector) - (sv-816 int) + (sv-816 tracking-point) (sv-832 vector) ) (set! sv-768 arg3) @@ -2052,16 +2097,17 @@ ) (set! s2-2 (-> self los-tgt-spline-pt)) (set! s1-3 -134250495) - (while (and (!= s2-2 -134250495) (begin - (let ((s0-3 cam-los-spline-collide)) - (set! sv-816 (+ (the-as uint (-> *camera* target-spline)) (* 48 s2-2))) - (set! sv-832 arg0) - (let ((a2-21 (camera-master-method-16 *camera* #t))) - (set! f30-1 (s0-3 (the-as vector sv-816) sv-832 (the-as pat-surface a2-21))) - ) - ) - (< f30-1 0.0) - ) + (while (and (!= s2-2 -134250495) + (begin + (let ((s0-3 cam-los-spline-collide)) + (set! sv-816 (-> (the-as (inline-array tracking-spline) (-> *camera* target-spline)) 0 point s2-2)) + (set! sv-832 arg0) + (let ((a2-21 (camera-master-method-16 *camera* #t))) + (set! f30-1 (s0-3 (the-as vector sv-816) sv-832 (the-as pat-surface a2-21))) + ) + ) + (< f30-1 0.0) + ) ) (set! s1-3 s2-2) (set! s2-2 (-> *camera* target-spline point s2-2 next)) @@ -2309,7 +2355,62 @@ ) ;; definition for function cam-string-line-of-sight -;; ERROR: function has no type analysis. Cannot decompile. +(defbehavior cam-string-line-of-sight camera-slave () + (let ((gp-0 (new 'stack-no-clear 'collide-los-result)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (new 'stack-no-clear 'collide-query) + (let ((f30-0 (vector-length (-> self view-flat)))) + (vector--float*! s5-0 (-> *camera* tpos-curr) (-> *camera* local-down) (-> *camera* settings target-height)) + (vector-! s5-0 s5-0 (-> self string-trans)) + (let ((f0-1 (vector-length s5-0))) + (if (< 2048.0 f0-1) + (vector-float*! s5-0 s5-0 (/ (+ -2048.0 f0-1) f0-1)) + (vector-reset! s5-0) + ) + ) + (cam-los-collide (-> self string-trans) s5-0 gp-0 (the-as pat-surface (camera-master-method-16 *camera* #t))) + (when (-> gp-0 lateral-valid) + (when (or (= (-> self los-state) (slave-los-state ccw)) (= (-> self los-state) (slave-los-state cw))) + (let ((v1-21 (new 'stack-no-clear 'vector))) + (vector-! v1-21 (-> *camera* tpos-curr) (-> *camera* tpos-old)) + (if (and (< (-> self string-min-val z) f30-0) + (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length v1-21)) + ) + (set! f30-0 (+ -204.8 f30-0)) + ) + ) + ) + (if (< f30-0 (fmin (-> self string-min-val z) (-> self min-z-override))) + (set! f30-0 (fmin (-> self string-min-val z) (-> self min-z-override))) + ) + (if (< f30-0 (-> self min-z-override)) + (set! (-> self min-z-override) f30-0) + ) + (let ((s4-1 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + (s3-1 (new 'stack-no-clear 'matrix)) + ) + 0.0 + (vector-flatten! s4-1 (-> gp-0 lateral) (-> *camera* local-down)) + (vector-normalize! s4-1 1.0) + (vector-normalize-copy! s5-1 (-> self view-flat) 1.0) + (let ((f0-14 (lerp-clamp + 418.7022 + 364.0889 + (/ (- f30-0 (-> self string-min-val z)) (- (-> self string-max-val z) (-> self string-min-val z))) + ) + ) + ) + (matrix-from-two-vectors-max-angle-partial! s3-1 s5-1 s4-1 f0-14 0.5) + ) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s3-1) + ) + (vector-normalize! (-> self view-flat) f30-0) + ) + ) + ) + ) ;; definition for function cam-dist-analog-input (defun cam-dist-analog-input ((arg0 int) (arg1 float)) @@ -2328,1860 +2429,355 @@ ;; definition for function cam-string-joystick ;; INFO: Used lq/sq -;; ERROR: failed type prop at 785: Could not figure out load: (set! v1 (l.wu (+ v1 124))) -;; WARN: Return type mismatch symbol vs vector. -;; ERROR: Unsupported inline assembly instruction kind - [sllv a0, v1, r0] -;; ERROR: Unsupported inline assembly instruction kind - [sllv a0, v1, r0] (defbehavior cam-string-joystick camera-slave () - (local-vars - (v0-0 vector) - (v0-1 float) - (v0-2 vector) - (v0-3 float) - (v0-4 float) - (v0-5 vector) - (v0-6 symbol) - (v0-7 float) - (v0-8 float) - (v0-9 none) - (v0-10 none) - (v0-11 none) - (v0-12 none) - (v0-13 none) - (v0-14 float) - (v0-15 float) - (v0-16 float) - (v0-17 none) - (v0-18 vector) - (v0-19 none) - (v0-20 symbol) - (v0-21 vector) - (v0-22 none) - (v0-23 none) - (v0-24 none) - (v0-25 none) - (v0-26 none) - (v0-27 none) - (v0-28 none) - (v0-29 none) - (v0-30 none) - (v0-31 none) - (v0-32 none) - (v0-33 vector) - (v0-34 vector) - (v0-35 vector) - (v0-36 float) - (v0-37 matrix) - (v0-38 vector) - (v1-0 int) - (v1-1 uint) - (v1-2 basic) - (v1-4 int) - (v1-5 matrix) - (v1-6 camera-master) - (v1-7 vector) - (v1-8 float) - (v1-9 none) - (v1-10 float) - (v1-11 vector) - (v1-12 float) - (v1-13 int) - (v1-15 int) - (v1-17 camera-master) - (v1-18 vector) - (v1-19 float) - (v1-20 float) - (v1-23 cpad-list) - (v1-24 cpad-info) - (v1-25 vector) - (v1-26 float) - (v1-27 int) - (v1-28 uint) - (v1-31 basic) - (v1-33 int) - (v1-35 camera-master) - (v1-36 symbol) - (v1-37 symbol) - (v1-38 clock) - (v1-39 time-frame) - (v1-40 time-frame) - (v1-42 int) - (v1-44 int) - (v1-45 uint) - (v1-47 cpad-list) - (v1-48 cpad-info) - (v1-49 uint) - (v1-50 symbol) - (v1-51 int) - (v1-52 symbol) - (v1-53 cpad-list) - (v1-54 cpad-info) - (v1-55 uint) - (v1-56 int) - (v1-60 uint) - (v1-61 uint) - (v1-62 int) - (v1-64 vector) - (v1-65 float) - (v1-66 int) - (v1-67 int) - (v1-71 none) - (v1-72 float) - (v1-73 camera-master) - (v1-74 cam-setting-data) - (v1-75 camera-master) - (v1-76 cam-setting-data) - (v1-78 camera-master) - (v1-79 cam-setting-data) - (v1-80 cam-slave-options) - (v1-81 cam-slave-options) - (v1-84 none) - (v1-85 none) - (v1-86 none) - (v1-87 none) - (v1-90 none) - (v1-91 none) - (v1-94 none) - (v1-95 none) - (v1-96 none) - (v1-99 none) - (v1-100 none) - (v1-101 none) - (v1-102 none) - (v1-103 none) - (v1-106 none) - (v1-107 none) - (v1-108 none) - (v1-110 none) - (v1-111 none) - (v1-112 none) - (v1-113 none) - (v1-114 none) - (v1-115 none) - (v1-117 none) - (v1-118 none) - (v1-119 none) - (v1-121 none) - (v1-122 none) - (v1-123 none) - (v1-124 none) - (v1-125 none) - (v1-126 none) - (v1-128 none) - (v1-129 none) - (v1-131 none) - (v1-132 none) - (v1-133 none) - (v1-134 none) - (v1-135 none) - (v1-136 none) - (v1-137 none) - (v1-138 none) - (v1-139 none) - (v1-140 none) - (v1-141 none) - (v1-143 none) - (v1-144 none) - (v1-146 none) - (v1-147 none) - (v1-149 none) - (v1-151 none) - (v1-154 none) - (v1-157 none) - (v1-159 int) - (v1-160 uint) - (v1-164 camera-master) - (v1-165 symbol) - (v1-168 camera-master) - (v1-169 cam-setting-data) - (v1-170 cam-master-options) - (v1-171 cam-master-options) - (v1-173 cpad-list) - (v1-174 cpad-info) - (v1-175 int) - (v1-176 clock) - (v1-177 int) - (v1-178 uint) - (v1-179 int) - (v1-180 int) - (v1-181 uint) - (v1-184 setting-control) - (v1-185 symbol) - (v1-188 basic) - (v1-190 int) - (v1-191 clock) - (v1-193 int) - (v1-194 uint) - (v1-196 camera-master) - (v1-197 cam-setting-data) - (v1-198 cam-master-options) - (v1-199 cam-master-options) - (v1-201 camera-bank) - (v1-202 uint) - (v1-203 uint) - (v1-204 int) - (v1-205 cpad-info) - (v1-206 pad-buttons) - (v1-207 pad-buttons) - (v1-209 int) - (v1-210 clock) - (v1-211 camera-bank) - (v1-212 uint) - (v1-213 uint) - (v1-214 int) - (v1-215 cpad-info) - (v1-216 int) - (v1-217 clock) - (v1-219 camera-master) - (v1-220 cam-setting-data) - (v1-221 cam-master-options) - (v1-222 cam-master-options) - (v1-224 camera-bank) - (v1-225 uint) - (v1-226 uint) - (v1-227 int) - (v1-228 cpad-info) - (v1-229 pad-buttons) - (v1-230 pad-buttons) - (v1-232 int) - (v1-233 clock) - (v1-234 camera-bank) - (v1-235 uint) - (v1-236 uint) - (v1-237 int) - (v1-238 cpad-info) - (v1-239 int) - (v1-240 clock) - (v1-242 slave-los-state) - (v1-243 slave-los-state) - (v1-244 symbol) - (v1-246 vector) - (v1-247 float) - (v1-248 int) - (v1-249 int) - (v1-250 clock) - (v1-252 none) - (v1-253 none) - (v1-254 none) - (v1-256 none) - (v1-257 none) - (v1-258 none) - (v1-259 none) - (v1-260 none) - (v1-262 uint) - (v1-263 uint) - (v1-264 camera-master) - (v1-265 int) - (v1-266 uint) - (v1-268 type) - (v1-270 int) - (v1-271 uint) - (v1-272 uint) - (v1-273 uint) - (v1-274 process) - (v1-275 camera-master) - (v1-276 cam-setting-data) - (v1-277 handle) - (v1-278 int) - (v1-280 camera-master) - (v1-281 cam-setting-data) - (v1-282 handle) - (v1-283 process) - (v1-284 int) - (v1-285 none) - (v1-286 none) - (v1-287 none) - (v1-288 none) - (v1-289 none) - (v1-291 none) - (v1-292 none) - (v1-293 none) - (v1-294 none) - (v1-296 none) - (v1-297 none) - (v1-299 none) - (v1-300 none) - (v1-301 none) - (v1-302 none) - (v1-303 none) - (v1-305 none) - (v1-307 none) - (v1-308 none) - (v1-310 none) - (v1-311 none) - (v1-312 camera-master) - (v1-313 cam-setting-data) - (v1-314 cam-slave-options) - (v1-315 cam-slave-options) - (v1-317 camera-master) - (v1-318 camera-master) - (v1-319 vector) - (v1-320 symbol) - (v1-321 symbol) - (v1-322 int) - (v1-324 int) - (v1-325 int) - (v1-327 none) - (v1-328 none) - (v1-329 none) - (v1-330 none) - (v1-332 none) - (v1-333 none) - (v1-335 none) - (v1-336 none) - (v1-338 none) - (v1-339 none) - (a0-0 uint) - (a0-1 none) - (a0-2 none) - (a0-3 float) - (a0-4 vector) - (a0-5 vector) - (a0-6 float) - (a0-7 float) - (a0-8 vector) - (a0-9 uint) - (a0-10 uint) - (a0-11 camera-master) - (a0-12 time-frame) - (a0-13 uint) - (a0-14 symbol) - (a0-15 cpad-list) - (a0-16 cpad-info) - (a0-17 uint) - (a0-18 float) - (a0-19 vector) - (a0-20 camera-master) - (a0-21 vector) - (a0-22 none) - (a0-23 none) - (a0-24 none) - (a0-25 none) - (a0-26 none) - (a0-31 uint) - (a0-33 uint) - (a0-34 uint) - (a0-35 uint) - (a0-36 cpad-list) - (a0-37 cpad-list) - (a0-38 uint) - (a0-39 cpad-list) - (a0-40 cpad-list) - (a0-41 uint) - (a0-42 symbol) - (a0-43 none) - (a0-44 matrix) - (a0-45 vector) - (a0-46 uint) - (a0-47 setting-control) - (a0-48 uint) - (a0-49 int) - (a0-50 (pointer process)) - (a0-51 process) - (a0-52 process) - (a0-53 vector) - (a0-54 int) - (a0-55 (pointer process)) - (a0-56 process) - (a0-58 int) - (a0-59 uint) - (a0-60 matrix) - (a0-61 none) - (a0-64 none) - (a0-68 none) - (a0-69 none) - (a0-70 none) - (a0-71 none) - (a0-72 none) - (a0-74 none) - (a0-75 none) - (a0-76 vector) - (a0-77 vector) - (a0-78 vector) - (a0-79 vector) - (a0-80 float) - (a0-81 matrix) - (a0-82 vector) - (a0-83 none) - (a0-84 none) - (a0-85 none) - (a0-86 none) - (a1-0 vector) - (a1-1 vector) - (a1-2 float) - (a1-3 float) - (a1-4 float) - (a1-5 float) - (a1-6 float) - (a1-7 none) - (a1-8 vector) - (a1-14 int) - (a1-15 float) - (a1-16 float) - (a1-17 vector) - (a1-18 vector) - (a1-19 symbol) - (a1-20 int) - (a1-21 type) - (a1-22 vector) - (a1-23 int) - (a1-24 uint) - (a1-25 none) - (a1-26 none) - (a1-27 none) - (a1-29 none) - (a1-30 none) - (a1-31 none) - (a1-32 none) - (a1-34 none) - (a1-35 vector) - (a1-36 (pointer uint8)) - (a1-37 float) - (a1-38 vector) - (a1-39 vector) - (a2-0 vector) - (a2-1 none) - (a2-2 float) - (a2-3 float) - (a2-4 float) - (a2-5 camera-master) - (a2-6 vector) - (a2-10 int) - (a2-11 float) - (a2-12 float) - (a2-13 float) - (a2-14 matrix) - (a2-15 symbol) - (a2-16 float) - (a2-19 none) - (a2-20 none) - (a2-21 none) - (a2-22 none) - (a2-25 float) - (a2-26 vector) - (a2-27 vector) - (a2-28 matrix) - (a3-0 float) - (a3-1 int) - (a3-2 float) - (a3-3 float) - (a3-4 none) - (a3-5 float) - (t0-0 uint) - (t0-1 float) - (t0-2 float) - (t0-3 float) - (s3-0 process) - (s3-1 none) - (s4-0 matrix) - (s5-0 none) - (s5-1 none) - (s5-2 none) - (s5-3 vector) - (t9-0 (function vector vector vector vector)) - (t9-1 (function float float)) - (t9-2 (function vector vector vector float vector)) - (t9-3 (function float float float float)) - (t9-4 (function float float float float)) - (t9-5 (function vector float vector)) - (t9-6 (function int float float)) - (t9-7 (function float float float float)) - (t9-8 none) - (t9-9 none) - (t9-10 none) - (t9-11 none) - (t9-12 none) - (t9-13 (function int float float float float float)) - (t9-14 (function int float float float float float)) - (t9-15 (function int float float float float float)) - (t9-16 (function matrix vector float none)) - (t9-17 (function vector vector matrix vector)) - (t9-18 (function setting-control engine-pers object none)) - (t9-19 (function object type symbol)) - (t9-20 (function vector vector float vector)) - (t9-21 (function matrix quaternion matrix)) - (t9-22 none) - (t9-23 none) - (t9-24 none) - (t9-25 none) - (t9-26 none) - (t9-27 none) - (t9-28 none) - (t9-29 none) - (t9-30 none) - (t9-31 none) - (t9-32 (function vector vector float vector)) - (t9-33 (function vector vector vector vector)) - (t9-34 (function vector float vector)) - (t9-35 (function float float)) - (t9-36 (function matrix vector vector float matrix)) - (t9-37 (function vector vector matrix vector)) - (gp-0 vector) - (gp-1 none) - (gp-2 none) - (gp-3 vector) - (sp-0 none) - (f0-0 int) - (f0-1 float) - (f0-2 float) - (f0-3 float) - (f0-4 float) - (f0-5 float) - (f0-6 float) - (f0-7 float) - (f0-8 float) - (f0-9 float) - (f0-10 float) - (f0-11 float) - (f0-12 float) - (f0-13 float) - (f0-14 float) - (f0-15 float) - (f0-16 float) - (f0-17 float) - (f0-18 float) - (f0-19 float) - (f0-20 float) - (f0-21 float) - (f0-22 float) - (f0-23 float) - (f0-24 float) - (f0-25 float) - (f0-26 float) - (f0-27 float) - (f0-28 float) - (f0-29 float) - (f0-30 float) - (f0-31 float) - (f0-32 float) - (f0-33 float) - (f0-34 float) - (f0-35 float) - (f0-36 float) - (f0-37 none) - (f0-38 none) - (f0-39 none) - (f0-40 none) - (f0-41 none) - (f0-42 none) - (f0-43 none) - (f0-44 none) - (f0-45 none) - (f0-46 none) - (f0-47 none) - (f0-48 none) - (f0-49 none) - (f0-50 none) - (f0-51 none) - (f0-52 none) - (f0-53 none) - (f0-54 none) - (f0-55 none) - (f0-56 none) - (f0-57 none) - (f0-58 none) - (f0-59 none) - (f0-60 none) - (f0-61 none) - (f0-62 none) - (f0-63 none) - (f0-64 none) - (f0-65 float) - (f0-66 float) - (f0-67 float) - (f0-68 float) - (f0-69 float) - (f0-70 float) - (f0-71 float) - (f0-72 float) - (f0-73 float) - (f0-74 float) - (f0-75 float) - (f0-76 float) - (f0-77 float) - (f0-78 float) - (f0-79 float) - (f0-80 float) - (f0-81 float) - (f0-82 float) - (f0-83 float) - (f0-84 float) - (f0-85 float) - (f0-86 none) - (f0-87 none) - (f0-88 none) - (f0-89 none) - (f0-90 none) - (f0-91 none) - (f0-92 float) - (f0-93 none) - (f0-94 none) - (f0-95 none) - (f0-96 float) - (f0-97 float) - (f0-98 float) - (f0-99 float) - (f0-100 float) - (f0-101 none) - (f0-102 none) - (f1-0 float) - (f1-1 float) - (f1-2 float) - (f1-3 float) - (f1-4 float) - (f1-5 float) - (f1-6 float) - (f1-7 float) - (f1-8 float) - (f1-9 float) - (f1-10 float) - (f1-11 float) - (f1-12 float) - (f1-13 float) - (f1-14 float) - (f1-15 float) - (f1-16 meters) - (f1-17 meters) - (f1-18 none) - (f1-19 none) - (f1-20 none) - (f1-21 none) - (f1-22 none) - (f1-23 none) - (f1-24 none) - (f1-25 none) - (f1-26 none) - (f1-27 none) - (f1-28 none) - (f1-29 none) - (f1-30 none) - (f1-31 none) - (f1-32 none) - (f1-33 none) - (f1-34 none) - (f1-35 none) - (f1-36 none) - (f1-37 none) - (f1-38 none) - (f1-39 none) - (f1-40 none) - (f1-41 none) - (f1-42 none) - (f1-43 none) - (f1-44 none) - (f1-45 none) - (f1-46 none) - (f1-47 none) - (f1-48 none) - (f1-49 none) - (f1-50 none) - (f1-51 none) - (f1-52 none) - (f1-53 none) - (f1-54 none) - (f1-55 none) - (f1-56 none) - (f1-57 none) - (f1-58 none) - (f1-59 none) - (f1-60 none) - (f1-61 none) - (f1-62 none) - (f1-63 none) - (f1-64 none) - (f1-65 none) - (f1-66 none) - (f1-67 float) - (f1-68 int) - (f1-69 float) - (f1-70 float) - (f1-71 float) - (f1-72 float) - (f1-73 float) - (f1-74 float) - (f1-75 float) - (f1-76 float) - (f1-77 float) - (f1-78 float) - (f1-79 none) - (f1-80 none) - (f1-81 none) - (f1-82 none) - (f1-83 none) - (f1-84 none) - (f1-85 none) - (f1-86 float) - (f1-87 float) - (f1-88 float) - (f1-89 none) - (f1-90 none) - (f1-91 none) - (f1-92 none) - (f1-93 none) - (f1-94 none) - (f2-0 float) - (f2-1 float) - (f2-2 float) - (f2-3 float) - (f2-4 float) - (f2-5 float) - (f2-6 float) - (f2-7 none) - (f2-8 none) - (f2-9 none) - (f2-10 none) - (f2-11 none) - (f2-12 none) - (f2-13 none) - (f2-14 none) - (f2-15 none) - (f2-16 none) - (f2-17 none) - (f2-18 none) - (f2-19 none) - (f2-20 none) - (f2-21 none) - (f2-22 none) - (f2-23 none) - (f2-24 none) - (f2-25 none) - (f2-26 float) - (f2-27 float) - (f2-28 none) - (f2-29 none) - (f2-30 float) - (f2-31 none) - (f2-32 none) - (f2-33 none) - (f3-0 none) - (f3-1 none) - (f3-2 none) - (f3-3 none) - (f3-4 float) - (f3-5 none) - (f3-6 float) - (f3-7 none) - (f26-0 float) - (f28-0 number) - (f28-1 float) - (f28-2 float) - (f30-0 float) - (f30-1 float) - (f30-2 number) - ) - (if (begin - (set! v1-0 -257) - (set! a0-0 (-> s6-0 options)) - (set! v1-1 (logand v1-0 a0-0)) - (set! (-> s6-0 options) v1-1) - (set! v1-2 (-> s6-0 string-relative)) - v1-2 - ) - (return (begin - (when (begin - (set! s5-0 (the-as none (new 'stack-no-clear 'vector))) - (set! gp-0 (new 'stack-no-clear 'vector)) - (set! f0-0 0) - (set! v1-4 #x3f000000) - (set! f30-0 (the-as float (gpr->fpr v1-4))) - (set! v1-5 (new 'stack-no-clear 'matrix)) - (set! t9-0 vector-flatten!) - (set! a0-1 (the-as none s5-0)) - (set! a1-0 (-> s6-0 relative-position)) - (set! v1-6 *camera*) - (set! a2-0 (-> v1-6 local-down)) - (call! a0-1 a1-0 a2-0) - (set! t9-1 acos) - (set! a0-2 (the-as none s5-0)) - (set! v1-7 (-> s6-0 view-flat)) - (set! f0-1 (vec3dot a0-2 v1-7)) - (set! v1-8 (fpr->gpr f0-1)) - (set! f0-2 (gpr->fpr v1-8)) - (set! v1-9 (the-as none s5-0)) - (set! v1-10 (veclength v1-9)) - (set! f1-0 (gpr->fpr v1-10)) - (set! v1-11 (-> s6-0 view-flat)) - (set! v1-12 (veclength v1-11)) - (set! f2-0 (gpr->fpr v1-12)) - (set! f1-1 (*.s f1-0 f2-0)) - (set! f0-3 (/.s f0-2 f1-1)) - (set! a0-3 (fpr->gpr f0-3)) - (set! v0-1 (call! a0-3)) - (set! f0-4 (gpr->fpr v0-1)) - (set! v1-13 #x44b60b61) - (set! f1-2 (the-as float (gpr->fpr v1-13))) - (set! f2-1 (*.s f30-0 f0-4)) - (<.s f1-2 f2-1) - ) - (set! v1-15 #x44b60b61) - (set! f1-3 (the-as float (gpr->fpr v1-15))) - (set! f30-0 (/.s f1-3 f0-4)) - (set! v1-16 (fpr->gpr f30-0)) - ) - (set! t9-2 vector-deg-slerp) - (set! a0-4 (-> s6-0 view-flat)) - (set! a1-1 (-> s6-0 view-flat)) - (set! a2-1 (the-as none s5-0)) - (set! a3-0 (fpr->gpr f30-0)) - (call! a0-4 a1-1 a2-1 a3-0) - (set! a0-5 (-> s6-0 relative-position)) - (set! v1-17 *camera*) - (set! v1-18 (-> v1-17 local-down)) - (set! f0-5 (vec3dot a0-5 v1-18)) - (set! v1-19 (fpr->gpr f0-5)) - (set! f0-6 (gpr->fpr v1-19)) - (set! f0-7 (neg.s f0-6)) - (set! (-> gp-0 y) f0-7) - (set! v1-20 (veclength s5-0)) - (set! f0-8 (gpr->fpr v1-20)) - (set! (-> gp-0 z) f0-8) - (set! t9-3 lerp) - (set! f0-9 (-> s6-0 view-off y)) - (set! a0-6 (fpr->gpr f0-9)) - (set! f0-10 (-> gp-0 y)) - (set! a1-2 (fpr->gpr f0-10)) - (set! a2-2 (fpr->gpr f30-0)) - (set! v0-3 (call! a0-6 a1-2 a2-2)) - (set! f0-11 (gpr->fpr v0-3)) - (set! (-> s6-0 view-off y) f0-11) - (set! t9-4 lerp) - (set! f0-12 (-> s6-0 view-off z)) - (set! a0-7 (fpr->gpr f0-12)) - (set! f0-13 (-> gp-0 z)) - (set! a1-3 (fpr->gpr f0-13)) - (set! a2-3 (fpr->gpr f30-0)) - (set! v0-4 (call! a0-7 a1-3 a2-3)) - (set! f0-14 (gpr->fpr v0-4)) - (set! (-> s6-0 view-off z) f0-14) - (set! t9-5 vector-normalize!) - (set! a0-8 (-> s6-0 view-flat)) - (set! f0-15 (-> s6-0 view-off z)) - (set! a1-4 (fpr->gpr f0-15)) - (call! a0-8 a1-4) - (set! v1-21 v0-5) - (set! f0-16 (-> s6-0 view-off y)) - (set! (-> s6-0 string-min-val y) f0-16) - (set! f0-17 (-> s6-0 view-off z)) - (set! (-> s6-0 string-min-val z) f0-17) - (set! f0-18 (-> s6-0 view-off y)) - (set! (-> s6-0 string-max-val y) f0-18) - (set! f0-19 (-> s6-0 view-off z)) - (set! (-> s6-0 string-max-val z) f0-19) - (set! v0-6 #f) - ) - ) - ) - (when (begin - (when (begin - (when (begin - (when (begin - (set! t9-6 cam-dist-analog-input) - (set! v1-23 *cpad-list*) - (set! v1-24 (-> v1-23 cpads 0)) - (set! a0-9 (-> v1-24 righty)) - (set! a1-5 (the-as float #x3d4ccccd)) - (set! v0-7 (call! a0-9 a1-5)) - (set! f28-0 (gpr->fpr v0-7)) - (set! v1-25 (-> s6-0 view-flat)) - (set! v1-26 (veclength v1-25)) - (set! f0-20 (gpr->fpr v1-26)) - (set! f1-4 (-> s6-0 string-min-val z)) - (set! f0-21 (-.s f0-20 f1-4)) - (set! f1-5 (-> s6-0 string-max-val z)) - (set! f2-2 (-> s6-0 string-min-val z)) - (set! f1-6 (-.s f1-5 f2-2)) - (set! f0-22 (/.s f0-21 f1-6)) - (set! f30-1 (-> s6-0 view-off-param)) - (set! v1-27 #x10000) - (set! a0-10 (-> s6-0 options)) - (set! v1-28 (logand v1-27 a0-10)) - (nonzero? v1-28) - ) - (set! f28-0 0) - (set! v1-30 (fpr->gpr f28-0)) - ) - (set! v1-31 (-> s6-0 have-phony-joystick)) - v1-31 - ) - (set! v1-33 #x3d4ccccd) - (set! f1-7 (the-as float (gpr->fpr v1-33))) - (set! f2-3 (-> s6-0 phony-joystick-y)) - (set! f28-0 (*.s f1-7 f2-3)) - (set! v1-34 (fpr->gpr f28-0)) - ) - (when (begin - (and (begin (set! v1-35 *camera*) (set! v1-36 (-> v1-35 being-attacked)) v1-36) - (begin - (set! v1-38 (-> s6-0 clock)) - (set! v1-39 (-> v1-38 frame-counter)) - (set! a0-11 *camera*) - (set! a0-12 (-> a0-11 attack-start)) - (set! v1-40 (- v1-39 a0-12)) - (set! v1-37 (<.si v1-40 75)) - ) - ) - v1-37 - ) - (set! v1-42 #x3d4ccccd) - (set! f28-0 (gpr->fpr v1-42)) - (set! v1-43 (fpr->gpr f28-0)) - ) - (set! v1-44 #x40000) - (set! a0-13 (-> s6-0 options)) - (set! v1-45 (logand v1-44 a0-13)) - (nonzero? v1-45) - ) - (when (begin - (and (begin - (or (begin - (set! v1-47 *cpad-list*) - (set! v1-48 (-> v1-47 cpads 0)) - (set! v1-49 (-> v1-48 rightx)) - (set! a0-14 (<.ui v1-49 64)) - a0-14 - ) - (begin - (set! v1-51 192) - (set! a0-15 *cpad-list*) - (set! a0-16 (-> a0-15 cpads 0)) - (set! a0-17 (-> a0-16 rightx)) - (set! v1-50 (<.ui v1-51 a0-17)) - ) - ) - v1-50 - ) - (begin - (set! v1-53 *cpad-list*) - (set! v1-54 (-> v1-53 cpads 0)) - (set! v1-55 (-> v1-54 righty)) - (set! v1-56 (the-as int (+ v1-55 -128))) - (set! v1-56 (abs v1-56)) - (set! v1-52 (<.ui v1-56 64)) - ) - ) - v1-52 - ) - (set! f28-0 0) - (set! v1-58 (fpr->gpr f28-0)) - ) - ) - (cond - ((begin - (when (begin - (when (begin (set! f1-8 (the-as float 0)) (!=.s f28-0 f1-8)) - (set! v1-60 (-> s6-0 options)) - (set! v1-61 (logior v1-60 256)) - (set! (-> s6-0 options) v1-61) - ) - (set! v1-62 #x3f800000) - (set! f1-9 (the-as float (gpr->fpr v1-62))) - (set! f26-0 (min.s f1-9 f0-22)) - (set! f0-23 f26-0) - (set! f1-10 (the-as float 0)) - (<.s f26-0 f1-10) - ) - (set! f0-24 (-> s6-0 string-min-val z)) - (set! v1-64 (-> s6-0 view-flat)) - (set! v1-65 (veclength v1-64)) - (set! f1-11 (gpr->fpr v1-65)) - (set! f0-25 (-.s f0-24 f1-11)) - (set! v1-66 #x3f000000) - (set! f1-12 (the-as float (gpr->fpr v1-66))) - (set! f2-4 (-> s6-0 string-min-val z)) - (set! f1-13 (*.s f1-12 f2-4)) - (set! f0-26 (/.s f0-25 f1-13)) - (set! v1-67 #x3f400000) - (set! f1-14 (the-as float (gpr->fpr v1-67))) - (set! f0-23 (min.s f1-14 f0-26)) - (set! v1-68 (fpr->gpr f0-23)) - ) - (when (begin - (set! f1-15 (-> s6-0 string-min-val y)) - (set! f2-5 (-> s6-0 string-max-val y)) - (set! t9-7 lerp) - (set! a0-18 (fpr->gpr f1-15)) - (set! a1-6 (fpr->gpr f2-5)) - (set! a2-4 (fpr->gpr f0-23)) - (set! v0-8 (call! a0-18 a1-6 a2-4)) - (set! f0-27 (gpr->fpr v0-8)) - (set! (-> s6-0 view-off y) f0-27) - (set! v1-69 (fpr->gpr f0-27)) - (set! f0-28 (the-as float 0)) - (<.s f26-0 f0-28) - ) - (set! v1-71 (the-as none (new 'stack-no-clear 'vector))) - (set! a1-7 (the-as none v1-71)) - (set! a0-19 (-> s6-0 string-trans)) - (set! a2-5 *camera*) - (set! a2-6 (-> a2-5 tpos-curr-adj)) - (set! a1-8 (vector-!2 a1-7 a0-19 a2-6)) - (set! a0-20 *camera*) - (set! a0-21 (-> a0-20 local-down)) - (set! f0-29 (vec3dot v1-71 a0-21)) - (set! v1-72 (fpr->gpr f0-29)) - (set! f0-30 (gpr->fpr v1-72)) - (set! f0-31 (neg.s f0-30)) - (set! v1-73 *camera*) - (set! v1-74 (-> v1-73 settings)) - (set! f1-16 (-> v1-74 target-height)) - (set! f0-32 (-.s f0-31 f1-16)) - (set! v1-75 *camera*) - (set! v1-76 (-> v1-75 settings)) - (set! f1-17 (-> v1-76 string-cliff-height)) - (set! f2-6 (-> s6-0 view-off y)) - (set! f0-33 (max.s f0-32 f2-6)) - (set! f0-34 (min.s f1-17 f0-33)) - (set! (-> s6-0 view-off y) f0-34) - (set! v1-77 (fpr->gpr f0-34)) - ) - (set! f0-35 (the-as float 0)) - (set! f0-36 (max.s f0-35 f26-0)) - (set! v1-78 *camera*) - (set! v1-79 (-> v1-78 settings)) - (set! v1-80 (-> v1-79 slave-options)) - (set! v1-81 (logand v1-80 8192)) - (nonzero? v1-81) - ) - ) - ((begin - (set! v1-84 (the-as none *camera*)) - (set! v1-85 (the-as none (l.wu (+ v1-84 128)))) - (set! v1-86 (the-as none (l.d (+ v1-85 224)))) - (set! v1-87 (the-as none (logand v1-86 32))) - (nonzero? v1-87) - ) - ) - ((begin - (and (begin (set! f1-18 (the-as none 0)) (set! v1-90 (the-as none (>=.s f1-18 f28-0))) v1-90) - (begin (set! f1-19 (the-as none 0)) (set! v1-91 (the-as none (>=.s f1-19 f0-36)))) - ) - v1-91 - ) - ) - ((begin - (and (begin (set! f1-20 (the-as none 0)) (set! v1-94 (the-as none (>=.s f28-0 f1-20))) v1-94) - (begin - (set! v1-96 (the-as none #x3f800000)) - (set! f1-21 (the-as none (gpr->fpr v1-96))) - (set! v1-95 (the-as none (>=.s f0-36 f1-21))) - ) - ) - v1-95 - ) - ) - ((begin - (set! f1-22 (the-as none 0)) - (set! v1-99 (the-as none (<.s f1-22 f28-0))) - (and v1-99 (or (begin - (set! v1-101 (the-as none (l.wu (+ s6-0 2352)))) - (set! v1-102 (the-as none (+ v1-101 -2))) - (set! a0-22 (the-as none (zero? v1-102))) - a0-22 - ) - (begin - (set! v1-103 (the-as none (l.wu (+ s6-0 2352)))) - (set! a0-23 (the-as none (+ v1-103 -1))) - (set! v1-100 (the-as none (zero? a0-23))) - ) - ) - ) - v1-100 - ) - ) - ((begin - (and (begin - (set! v1-106 (the-as none #x40000)) - (set! a0-24 (the-as none (l.wu (+ s6-0 2276)))) - (set! v1-107 (the-as none (logand v1-106 a0-24))) - (nonzero? v1-107) - ) - (begin (set! f1-23 (the-as none 0)) (set! v1-108 (the-as none (<.s f1-23 f28-0)))) - ) - v1-108 - ) - (set! v1-110 (the-as none *camera*)) - (set! v1-111 (the-as none (l.wu (+ v1-110 128)))) - (set! f0-37 (the-as none (l.f (+ v1-111 80)))) - (set! f1-24 (the-as none (l.f (+ s6-0 2640)))) - (set! v1-112 (the-as none #x46c00000)) - (set! f2-7 (the-as none (gpr->fpr v1-112))) - (set! f2-8 (the-as none (*.s f2-7 f28-0))) - (set! f1-25 (the-as none (-.s f1-24 f2-8))) - (set! f0-38 (the-as none (max.s f0-37 f1-25))) - (s.f! (+ s6-0 2640) f0-38) - (set! v1-113 (the-as none #x46800000)) - (set! f0-39 (the-as none (gpr->fpr v1-113))) - (set! f1-26 (the-as none (l.f (+ s6-0 2640)))) - (set! f0-40 (the-as none (+.s f0-39 f1-26))) - (set! v1-114 (the-as none #x46000000)) - (set! f1-27 (the-as none (gpr->fpr v1-114))) - (set! f2-9 (the-as none (l.f (+ s6-0 2640)))) - (set! f1-28 (the-as none (+.s f1-27 f2-9))) - (set! f2-10 (the-as none (l.f (+ s6-0 2656)))) - (set! v1-115 (the-as none #x46c00000)) - (set! f3-0 (the-as none (gpr->fpr v1-115))) - (set! f3-1 (the-as none (*.s f3-0 f28-0))) - (set! f2-11 (the-as none (-.s f2-10 f3-1))) - (set! f1-29 (the-as none (max.s f1-28 f2-11))) - (set! f0-41 (the-as none (min.s f0-40 f1-29))) - (s.f! (+ s6-0 2656) f0-41) - (set! v1-116 (the-as none (fpr->gpr f0-41))) - ) - ((begin - (and (begin - (set! v1-117 (the-as none #x40000)) - (set! a0-25 (the-as none (l.wu (+ s6-0 2276)))) - (set! v1-118 (the-as none (logand v1-117 a0-25))) - (nonzero? v1-118) - ) - (begin (set! f1-30 (the-as none 0)) (set! v1-119 (the-as none (<.s f28-0 f1-30)))) - ) - v1-119 - ) - (set! v1-121 (the-as none *camera*)) - (set! v1-122 (the-as none (l.wu (+ v1-121 128)))) - (set! f0-42 (the-as none (l.f (+ v1-122 76)))) - (set! f1-31 (the-as none (l.f (+ s6-0 2656)))) - (set! v1-123 (the-as none #x46c00000)) - (set! f2-12 (the-as none (gpr->fpr v1-123))) - (set! f2-13 (the-as none (*.s f2-12 f28-0))) - (set! f1-32 (the-as none (-.s f1-31 f2-13))) - (set! f0-43 (the-as none (min.s f0-42 f1-32))) - (s.f! (+ s6-0 2656) f0-43) - (set! v1-124 (the-as none -973078528)) - (set! f0-44 (the-as none (gpr->fpr v1-124))) - (set! f1-33 (the-as none (l.f (+ s6-0 2656)))) - (set! f0-45 (the-as none (+.s f0-44 f1-33))) - (set! v1-125 (the-as none -964689920)) - (set! f1-34 (the-as none (gpr->fpr v1-125))) - (set! f2-14 (the-as none (l.f (+ s6-0 2656)))) - (set! f1-35 (the-as none (+.s f1-34 f2-14))) - (set! f2-15 (the-as none (l.f (+ s6-0 2640)))) - (set! v1-126 (the-as none #x46c00000)) - (set! f3-2 (the-as none (gpr->fpr v1-126))) - (set! f3-3 (the-as none (*.s f3-2 f28-0))) - (set! f2-16 (the-as none (-.s f2-15 f3-3))) - (set! f1-36 (the-as none (max.s f1-35 f2-16))) - (set! f0-46 (the-as none (min.s f0-45 f1-36))) - (s.f! (+ s6-0 2640) f0-46) - (set! v1-127 (the-as none (fpr->gpr f0-46))) - ) - ((begin - (set! v1-128 (the-as none #x40000)) - (set! a0-26 (the-as none (l.wu (+ s6-0 2276)))) - (set! v1-129 (the-as none (logand v1-128 a0-26))) - (nonzero? v1-129) - ) - (set! v1-131 (the-as none #x46000000)) - (set! f0-47 (the-as none (gpr->fpr v1-131))) - (set! v1-132 (the-as none *camera*)) - (set! v1-133 (the-as none (l.wu (+ v1-132 128)))) - (set! f1-37 (the-as none (l.f (+ v1-133 80)))) - (set! f0-48 (the-as none (+.s f0-47 f1-37))) - (set! v1-134 (the-as none *camera*)) - (set! v1-135 (the-as none (l.wu (+ v1-134 128)))) - (set! f1-38 (the-as none (l.f (+ v1-135 76)))) - (set! f2-17 (the-as none (l.f (+ s6-0 2656)))) - (set! f1-39 (the-as none (min.s f1-38 f2-17))) - (set! f0-49 (the-as none (max.s f0-48 f1-39))) - (s.f! (+ s6-0 2656) f0-49) - (set! v1-136 (the-as none *camera*)) - (set! v1-137 (the-as none (l.wu (+ v1-136 128)))) - (set! f0-50 (the-as none (l.f (+ v1-137 80)))) - (set! v1-138 (the-as none -973078528)) - (set! f1-40 (the-as none (gpr->fpr v1-138))) - (set! v1-139 (the-as none *camera*)) - (set! v1-140 (the-as none (l.wu (+ v1-139 128)))) - (set! f2-18 (the-as none (l.f (+ v1-140 76)))) - (set! f1-41 (the-as none (+.s f1-40 f2-18))) - (set! f2-19 (the-as none (l.f (+ s6-0 2640)))) - (set! f1-42 (the-as none (min.s f1-41 f2-19))) - (set! f0-51 (the-as none (max.s f0-50 f1-42))) - (s.f! (+ s6-0 2640) f0-51) - (set! v1-141 (the-as none -964689920)) - (set! f0-52 (the-as none (gpr->fpr v1-141))) - (set! f1-43 (the-as none (l.f (+ s6-0 2656)))) - (set! f0-53 (the-as none (+.s f0-52 f1-43))) - (set! f1-44 (the-as none (l.f (+ s6-0 2640)))) - (set! f0-54 (the-as none (max.s f0-53 f1-44))) - (s.f! (+ s6-0 2640) f0-54) - (set! v1-142 (the-as none (fpr->gpr f0-54))) - ) - ((begin - (set! v1-143 (the-as none #x3d4ccccd)) - (set! f1-45 (the-as none (gpr->fpr v1-143))) - (set! v1-144 (the-as none #x3f800000)) - (set! f2-20 (the-as none (gpr->fpr v1-144))) - (set! f2-21 (the-as none (-.s f2-20 f0-36))) - (set! f1-46 (the-as none (*.s f1-45 f2-21))) - (<.s f1-46 f28-0) - ) - (set! v1-146 (the-as none #x3d4ccccd)) - (set! f1-47 (the-as none (gpr->fpr v1-146))) - (set! v1-147 (the-as none #x3f800000)) - (set! f2-22 (the-as none (gpr->fpr v1-147))) - (set! f2-23 (the-as none (-.s f2-22 f0-36))) - (set! f1-48 (the-as none (*.s f1-47 f2-23))) - (set! f0-55 (the-as none (+.s f0-36 f1-48))) - (set! f1-49 (the-as none (l.f (+ s6-0 468)))) - (set! f1-50 (the-as none (max.s f1-49 f0-55))) - (s.f! (+ s6-0 468) f1-50) - (set! gp-1 (the-as none vector-normalize!)) - (set! s5-1 (the-as none (+ s6-0 524))) - (set! t9-8 (the-as none lerp)) - (set! f1-51 (the-as none (l.f (+ s6-0 2644)))) - (set! a0-27 (the-as none (fpr->gpr f1-51))) - (set! f1-52 (the-as none (l.f (+ s6-0 2660)))) - (set! a1-9 (the-as none (fpr->gpr f1-52))) - (set! a2-7 (the-as none (fpr->gpr f0-55))) - (call!) - (set! a1-10 (the-as none v0-9)) - (set! t9-9 (the-as none gp-1)) - (set! a0-28 (the-as none s5-1)) - (call!) - (set! v1-148 (the-as none v0-10)) - ) - ((begin - (set! v1-149 (the-as none #x3d4ccccd)) - (set! f1-53 (the-as none (gpr->fpr v1-149))) - (set! f2-24 (the-as none (neg.s f0-36))) - (set! f1-54 (the-as none (*.s f1-53 f2-24))) - (<.s f28-0 f1-54) - ) - (set! v1-151 (the-as none #x3d4ccccd)) - (set! f1-55 (the-as none (gpr->fpr v1-151))) - (set! f2-25 (the-as none (neg.s f0-36))) - (set! f1-56 (the-as none (*.s f1-55 f2-25))) - (set! f0-56 (the-as none (+.s f0-36 f1-56))) - (s.f! (+ s6-0 468) f0-56) - (set! v1-152 (the-as none (fpr->gpr f0-56))) - ) - ((begin (set! f1-57 (the-as none 0)) (<.s f1-57 f28-0)) - (set! v1-154 (the-as none (l.wu (+ s6-0 8)))) - (set! f1-58 (the-as none (l.f (+ v1-154 84)))) - (set! f1-59 (the-as none (*.s f28-0 f1-58))) - (set! f0-57 (the-as none (+.s f0-36 f1-59))) - (set! f1-60 (the-as none (l.f (+ s6-0 468)))) - (set! f1-61 (the-as none (max.s f1-60 f0-57))) - (s.f! (+ s6-0 468) f1-61) - (set! gp-2 (the-as none vector-normalize!)) - (set! s5-2 (the-as none (+ s6-0 524))) - (set! t9-10 (the-as none lerp)) - (set! f1-62 (the-as none (l.f (+ s6-0 2644)))) - (set! a0-29 (the-as none (fpr->gpr f1-62))) - (set! f1-63 (the-as none (l.f (+ s6-0 2660)))) - (set! a1-11 (the-as none (fpr->gpr f1-63))) - (set! a2-8 (the-as none (fpr->gpr f0-57))) - (call!) - (set! a1-12 (the-as none v0-11)) - (set! t9-11 (the-as none gp-2)) - (set! a0-30 (the-as none s5-2)) - (call!) - (set! v1-155 (the-as none v0-12)) - ) - ((begin (set! f1-64 (the-as none 0)) (<.s f28-0 f1-64)) - (set! v1-157 (the-as none (l.wu (+ s6-0 8)))) - (set! f1-65 (the-as none (l.f (+ v1-157 84)))) - (set! f1-66 (the-as none (*.s f28-0 f1-65))) - (set! f0-58 (the-as none (+.s f0-36 f1-66))) - (s.f! (+ s6-0 468) f0-58) - (set! v1-158 (the-as none (fpr->gpr f0-58))) - ) - ) - (when (begin - (cond - ((begin - (set! v1-159 #x40000) - (set! a0-31 (-> s6-0 options)) - (set! v1-160 (logand v1-159 a0-31)) - (nonzero? v1-160) - ) - ) - ((begin (set! f0-59 (the-as none 0)) (=.s f28-0 f0-59)) - (set! f0-60 (the-as none (l.f (+ s6-0 2660)))) - (s.f! (+ s6-0 484) f0-60) - (set! v1-162 (the-as none (fpr->gpr f0-60))) - ) - (else - (set! t9-12 (the-as none lerp)) - (set! f0-61 (the-as none (l.f (+ s6-0 2644)))) - (set! a0-32 (the-as none (fpr->gpr f0-61))) - (set! f0-62 (the-as none (l.f (+ s6-0 2660)))) - (set! a1-13 (the-as none (fpr->gpr f0-62))) - (set! f0-63 (the-as none (l.f (+ s6-0 468)))) - (set! a2-9 (the-as none (fpr->gpr f0-63))) - (set! v0-13 (the-as none (call!))) - (set! f0-64 (the-as none (gpr->fpr v0-13))) - (s.f! (+ s6-0 484) f0-64) - (set! v1-163 (the-as none (fpr->gpr f0-64))) - ) - ) - (set! v1-164 *camera*) - (set! v1-165 (-> v1-164 being-attacked)) - v1-165 - ) - (set! (-> s6-0 view-off-param) f30-1) - (set! v1-167 (fpr->gpr f30-1)) - ) - (set! v1-168 *camera*) - (set! v1-169 (-> v1-168 settings)) - (set! v1-170 (-> v1-169 master-options)) - (set! v1-171 (logand v1-170 32)) - (zero? v1-171) + (set! (-> self options) (logand -257 (-> self options))) + (when (-> self string-relative) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) ) - (when (begin - (when (begin - (when (begin - (when (begin - (if (begin - (set! t9-13 analog-input) - (set! v1-173 *cpad-list*) - (set! v1-174 (-> v1-173 cpads 0)) - (set! a0-33 (-> v1-174 rightx)) - (set! a1-14 #x43000000) - (set! a2-10 #x42000000) - (set! a3-1 #x42dc0000) - (set! v1-175 #x43360b61) - (set! f0-65 (the-as float (gpr->fpr v1-175))) - (set! v1-176 (-> s6-0 clock)) - (set! f1-67 (-> v1-176 seconds-per-frame)) - (set! f0-66 (*.s f0-65 f1-67)) - (set! v1-177 #x40000) - (set! t0-0 (-> s6-0 options)) - (set! v1-178 (logand v1-177 t0-0)) - (nonzero? v1-178) - ) - (set! v1-179 #x42f00000) - (set! v1-179 (the-as int #x42f00000)) - ) - (set! f1-68 (gpr->fpr v1-179)) - (set! f0-67 (*.s f0-66 f1-68)) - (set! t0-1 (fpr->gpr f0-67)) - (set! v0-14 (call! a0-33 a1-14 a2-10 a3-1 t0-1)) - (set! f30-2 (gpr->fpr v0-14)) - (set! s4-0 (new 'stack-no-clear 'matrix)) - (set! (-> s4-0 vector 0 quad) (the-as uint128 0)) - (set! (-> s4-0 vector 1 quad) (the-as uint128 0)) - (set! (-> s4-0 vector 2 quad) (the-as uint128 0)) - (set! (-> s4-0 trans quad) (the-as uint128 0)) - (set! gp-3 (new 'stack-no-clear 'vector)) - (set! (-> gp-3 quad) (the-as uint128 0)) - (set! s5-3 (new 'stack-no-clear 'vector)) - (set! (-> s5-3 quad) (the-as uint128 0)) - (set! v1-180 #x10000) - (set! a0-34 (-> s6-0 options)) - (set! v1-181 (logand v1-180 a0-34)) - (nonzero? v1-181) - ) - (set! f30-2 0) - (set! v1-183 (fpr->gpr f30-2)) - ) - (when (begin (set! v1-184 *setting-control*) (set! v1-185 (-> v1-184 user-default unknowng-symbol-00)) v1-185) - (set! f30-2 (neg.s f30-2)) - (set! v1-187 (fpr->gpr f30-2)) - ) - (set! v1-188 (-> s6-0 have-phony-joystick)) - v1-188 - ) - (set! v1-190 #x46aaaaab) - (set! f0-68 (the-as float (gpr->fpr v1-190))) - (set! f1-69 (-> s6-0 phony-joystick-x)) - (set! f0-69 (*.s f0-68 f1-69)) - (set! v1-191 (-> s6-0 clock)) - (set! f1-70 (-> v1-191 seconds-per-frame)) - (set! f30-2 (*.s f0-69 f1-70)) - (set! v1-192 (fpr->gpr f30-2)) - ) - (set! v1-193 #x20000) - (set! a0-35 (-> s6-0 options)) - (set! v1-194 (logand v1-193 a0-35)) - (nonzero? v1-194) - ) - (when (begin - (when (begin - (set! v1-196 *camera*) - (set! v1-197 (-> v1-196 settings)) - (set! v1-198 (-> v1-197 master-options)) - (set! v1-199 (logand v1-198 64)) - (nonzero? v1-199) - ) - (when (begin - (set! v1-201 *CAMERA-bank*) - (set! v1-202 (-> v1-201 joypad)) - (set! v1-203 (sll v1-202 2)) - (set! a0-36 *cpad-list*) - (set! v1-204 (+ v1-203 a0-36)) - (set! v1-205 (dynamic-array-field-access v1-204 cpads PLACEHOLDER)) - (set! v1-206 (-> v1-205 button0-abs 0)) - (set! v1-207 (logand v1-206 2048)) - (nonzero? v1-207) - ) - (set! v1-209 #x462aaaab) - (set! f0-70 (the-as float (gpr->fpr v1-209))) - (set! v1-210 (-> s6-0 clock)) - (set! f1-71 (-> v1-210 seconds-per-frame)) - (set! f28-1 (*.s f0-70 f1-71)) - (set! t9-14 analog-input) - (set! v1-211 *CAMERA-bank*) - (set! v1-212 (-> v1-211 joypad)) - (set! v1-213 (sll v1-212 2)) - (set! a0-37 *cpad-list*) - (set! v1-214 (+ v1-213 a0-37)) - (set! v1-215 (dynamic-array-field-access v1-214 cpads PLACEHOLDER)) - (set! a0-38 (-> v1-215 abutton 9)) - (set! a1-15 (the-as float 0)) - (set! a2-11 (the-as float #x42000000)) - (set! a3-2 (the-as float #x43660000)) - (set! v1-216 #x46aaaaab) - (set! f0-71 (the-as float (gpr->fpr v1-216))) - (set! v1-217 (-> s6-0 clock)) - (set! f1-72 (-> v1-217 seconds-per-frame)) - (set! f0-72 (*.s f0-71 f1-72)) - (set! t0-2 (fpr->gpr f0-72)) - (set! v0-15 (call! a0-38 a1-15 a2-11 a3-2 t0-2)) - (set! f0-73 (gpr->fpr v0-15)) - (set! f0-74 (+.s f28-1 f0-73)) - (set! f30-2 (+.s f30-2 f0-74)) - (set! v1-218 (fpr->gpr f30-2)) - ) - ) - (set! v1-219 *camera*) - (set! v1-220 (-> v1-219 settings)) - (set! v1-221 (-> v1-220 master-options)) - (set! v1-222 (logand v1-221 64)) - (nonzero? v1-222) - ) - (when (begin - (set! v1-224 *CAMERA-bank*) - (set! v1-225 (-> v1-224 joypad)) - (set! v1-226 (sll v1-225 2)) - (set! a0-39 *cpad-list*) - (set! v1-227 (+ v1-226 a0-39)) - (set! v1-228 (dynamic-array-field-access v1-227 cpads PLACEHOLDER)) - (set! v1-229 (-> v1-228 button0-abs 0)) - (set! v1-230 (logand v1-229 1024)) - (nonzero? v1-230) - ) - (set! v1-232 #x462aaaab) - (set! f0-75 (the-as float (gpr->fpr v1-232))) - (set! v1-233 (-> s6-0 clock)) - (set! f1-73 (-> v1-233 seconds-per-frame)) - (set! f28-2 (*.s f0-75 f1-73)) - (set! t9-15 analog-input) - (set! v1-234 *CAMERA-bank*) - (set! v1-235 (-> v1-234 joypad)) - (set! v1-236 (sll v1-235 2)) - (set! a0-40 *cpad-list*) - (set! v1-237 (+ v1-236 a0-40)) - (set! v1-238 (dynamic-array-field-access v1-237 cpads PLACEHOLDER)) - (set! a0-41 (-> v1-238 abutton 8)) - (set! a1-16 (the-as float 0)) - (set! a2-12 (the-as float #x42000000)) - (set! a3-3 (the-as float #x43660000)) - (set! v1-239 #x46aaaaab) - (set! f0-76 (the-as float (gpr->fpr v1-239))) - (set! v1-240 (-> s6-0 clock)) - (set! f1-74 (-> v1-240 seconds-per-frame)) - (set! f0-77 (*.s f0-76 f1-74)) - (set! t0-3 (fpr->gpr f0-77)) - (set! v0-16 (call! a0-41 a1-16 a2-12 a3-3 t0-3)) - (set! f0-78 (gpr->fpr v0-16)) - (set! f0-79 (+.s f28-2 f0-78)) - (set! f30-2 (-.s f30-2 f0-79)) - (set! v1-241 (fpr->gpr f30-2)) - ) + 0.0 + (let ((f30-0 0.5)) + (new 'stack-no-clear 'matrix) + (vector-flatten! s5-0 (-> self relative-position) (-> *camera* local-down)) + (let ((f0-4 + (acos (/ (vector-dot s5-0 (-> self view-flat)) (* (vector-length s5-0) (vector-length (-> self view-flat))))) ) ) - (cond - ((begin - (cond - ((begin - (and (begin (set! v1-242 (-> s6-0 los-state)) (set! v1-243 (+ v1-242 -2)) (set! a0-42 (zero? v1-243)) a0-42) - (begin (set! f0-80 (the-as float 0)) (set! v1-244 (<.s f0-80 f30-2))) - ) - v1-244 + (if (< 1456.3556 (* f30-0 f0-4)) + (set! f30-0 (/ 1456.3556 f0-4)) + ) + ) + (vector-deg-slerp (-> self view-flat) (-> self view-flat) s5-0 f30-0) + (set! (-> gp-0 y) (- (vector-dot (-> self relative-position) (-> *camera* local-down)))) + (set! (-> gp-0 z) (vector-length s5-0)) + (set! (-> self view-off y) (lerp (-> self view-off y) (-> gp-0 y) f30-0)) + (set! (-> self view-off z) (lerp (-> self view-off z) (-> gp-0 z) f30-0)) + ) + ) + (vector-normalize! (-> self view-flat) (-> self view-off z)) + (set! (-> self string-min-val y) (-> self view-off y)) + (set! (-> self string-min-val z) (-> self view-off z)) + (set! (-> self string-max-val y) (-> self view-off y)) + (set! (-> self string-max-val z) (-> self view-off z)) + (return (the-as float #f)) + ) + (let ((f28-0 (cam-dist-analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 0.05)) + (f0-22 (/ (- (vector-length (-> self view-flat)) (-> self string-min-val z)) + (- (-> self string-max-val z) (-> self string-min-val z)) + ) + ) + (f30-1 (-> self view-off-param)) + ) + (if (logtest? #x10000 (-> self options)) + (set! f28-0 0.0) + ) + (if (-> self have-phony-joystick) + (set! f28-0 (* 0.05 (-> self phony-joystick-y))) + ) + (if (and (-> *camera* being-attacked) + (< (- (-> self clock frame-counter) (-> *camera* attack-start)) (seconds 0.25)) + ) + (set! f28-0 0.05) + ) + (when (logtest? #x40000 (-> self options)) + (if (and (or (< (-> *cpad-list* cpads 0 rightx) (the-as uint 64)) + (< (the-as uint 192) (-> *cpad-list* cpads 0 rightx)) + ) + (let ((v1-56 (abs (the-as int (+ (-> *cpad-list* cpads 0 righty) -128))))) + (< (the-as uint v1-56) (the-as uint 64)) + ) + ) + (set! f28-0 0.0) + ) + ) + (if (!= f28-0 0.0) + (logior! (-> self options) 256) + ) + (let ((f26-0 (fmin 1.0 f0-22))) + (let ((f0-23 f26-0)) + (when (< f26-0 0.0) + (let ((f0-26 + (/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (* 0.5 (-> self string-min-val z))) + ) + ) + (set! f0-23 (fmin 0.75 f0-26)) + ) + ) + (let ((f1-15 (-> self string-min-val y)) + (f2-5 (-> self string-max-val y)) + ) + (set! (-> self view-off y) (lerp f1-15 f2-5 f0-23)) + ) + ) + (when (< f26-0 0.0) + (let ((v1-71 (new 'stack-no-clear 'vector))) + (vector-! v1-71 (-> self string-trans) (-> *camera* tpos-curr-adj)) + (let ((f0-32 (- (- (vector-dot v1-71 (-> *camera* local-down))) (-> *camera* settings target-height)))) + (set! (-> self view-off y) + (fmin (-> *camera* settings string-cliff-height) (fmax f0-32 (-> self view-off y))) + ) + ) + ) + ) + (let ((f0-36 (fmax 0.0 f26-0))) + (cond + ((logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) + ) + ((logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG)) + ) + ((and (>= 0.0 f28-0) (>= 0.0 f0-36)) + ) + ((and (>= f28-0 0.0) (>= f0-36 1.0)) + ) + ((and (< 0.0 f28-0) + (or (= (-> self los-state) (slave-los-state ccw)) (= (-> self los-state) (slave-los-state cw))) + ) + ) + ((and (logtest? #x40000 (-> self options)) (< 0.0 f28-0)) + (set! (-> self string-min-val y) + (fmax (-> *camera* settings gun-min-height) (- (-> self string-min-val y) (* 24576.0 f28-0))) + ) + (set! (-> self string-max-val y) + (fmin + (+ 16384.0 (-> self string-min-val y)) + (fmax (+ 8192.0 (-> self string-min-val y)) (- (-> self string-max-val y) (* 24576.0 f28-0))) + ) + ) + ) + ((and (logtest? #x40000 (-> self options)) (< f28-0 0.0)) + (set! (-> self string-max-val y) + (fmin (-> *camera* settings gun-max-height) (- (-> self string-max-val y) (* 24576.0 f28-0))) + ) + (set! (-> self string-min-val y) + (fmin + (+ -8192.0 (-> self string-max-val y)) + (fmax (+ -16384.0 (-> self string-max-val y)) (- (-> self string-min-val y) (* 24576.0 f28-0))) + ) + ) + ) + ((logtest? #x40000 (-> self options)) + (set! (-> self string-max-val y) + (fmax + (+ 8192.0 (-> *camera* settings gun-min-height)) + (fmin (-> *camera* settings gun-max-height) (-> self string-max-val y)) + ) + ) + (set! (-> self string-min-val y) + (fmax + (-> *camera* settings gun-min-height) + (fmin (+ -8192.0 (-> *camera* settings gun-max-height)) (-> self string-min-val y)) + ) + ) + (set! (-> self string-min-val y) (fmax (+ -16384.0 (-> self string-max-val y)) (-> self string-min-val y))) + ) + ((< (* 0.05 (- 1.0 f0-36)) f28-0) + (let ((f0-55 (+ f0-36 (* 0.05 (- 1.0 f0-36))))) + (set! (-> self view-off-param) (fmax (-> self view-off-param) f0-55)) + (vector-normalize! (-> self view-flat) (lerp (-> self string-min-val z) (-> self string-max-val z) f0-55)) + ) + ) + ((< f28-0 (* 0.05 (- f0-36))) + (set! (-> self view-off-param) (+ f0-36 (* 0.05 (- f0-36)))) + ) + ((< 0.0 f28-0) + (let ((f0-57 (+ f0-36 (* f28-0 (-> self clock time-adjust-ratio))))) + (set! (-> self view-off-param) (fmax (-> self view-off-param) f0-57)) + (vector-normalize! (-> self view-flat) (lerp (-> self string-min-val z) (-> self string-max-val z) f0-57)) + ) + ) + ((< f28-0 0.0) + (set! (-> self view-off-param) (+ f0-36 (* f28-0 (-> self clock time-adjust-ratio)))) + ) + ) + ) + ) + (cond + ((logtest? #x40000 (-> self options)) + ) + ((= f28-0 0.0) + (set! (-> self view-off z) (-> self string-max-val z)) + ) + (else + (set! (-> self view-off z) + (lerp (-> self string-min-val z) (-> self string-max-val z) (-> self view-off-param)) + ) + ) + ) + (if (-> *camera* being-attacked) + (set! (-> self view-off-param) f30-1) + ) + ) + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (let ((f30-2 (analog-input + (the-as int (-> *cpad-list* cpads 0 rightx)) + 128.0 + 32.0 + 110.0 + (* 182.04445 (-> self clock seconds-per-frame) (if (logtest? #x40000 (-> self options)) + 120.0 + 120.0 + ) ) - (set! f0-81 (-> s6-0 string-min-val z)) - (set! f1-75 (-> s6-0 string-max-val z)) - (set! v1-246 (-> s6-0 view-flat)) - (set! v1-247 (veclength v1-246)) - (set! f2-26 (gpr->fpr v1-247)) - (set! f1-76 (min.s f1-75 f2-26)) - (set! f0-82 (max.s f0-81 f1-76)) - (set! v1-248 #x46aaaaab) - (set! f1-77 (the-as float (gpr->fpr v1-248))) - (set! v1-249 #x3dcccccd) - (set! f2-27 (the-as float (gpr->fpr v1-249))) - (set! f3-4 (-> s6-0 string-min-val z)) - (set! f0-83 (/.s f3-4 f0-82)) - (set! f0-84 (+.s f2-27 f0-83)) - (set! f0-85 (*.s f1-77 f0-84)) - (set! v1-250 (-> s6-0 clock)) - (set! f1-78 (-> v1-250 seconds-per-frame)) - (set! f30-2 (*.s f0-85 f1-78)) - (set! v1-251 (fpr->gpr f30-2)) - ) - ((begin - (and (begin - (set! v1-252 (the-as none (-> s6-0 los-state))) - (set! v1-253 (the-as none (+ v1-252 -1))) - (set! a0-43 (the-as none (zero? v1-253))) - a0-43 + ) + ) + (s4-0 (new-stack-matrix0)) + (gp-3 (new-stack-vector0)) + (s5-3 (new-stack-vector0)) + ) + (if (logtest? #x10000 (-> self options)) + (set! f30-2 0.0) + ) + (if (-> *setting-control* user-default unknowng-symbol-00) + (set! f30-2 (- f30-2)) + ) + (if (-> self have-phony-joystick) + (set! f30-2 (* 21845.334 (-> self phony-joystick-x) (-> self clock seconds-per-frame))) + ) + (when (logtest? #x20000 (-> self options)) + (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) + (if (cpad-hold? (-> *CAMERA-bank* joypad) r1) + (+! f30-2 (+ (* 10922.667 (-> self clock seconds-per-frame)) + (analog-input + (the-as int (-> *cpad-list* cpads (-> *CAMERA-bank* joypad) abutton 9)) + 0.0 + 32.0 + 230.0 + (* 21845.334 (-> self clock seconds-per-frame)) ) - (begin (set! f0-86 (the-as none 0)) (set! v1-254 (the-as none (<.s f30-2 f0-86)))) ) - v1-254 - ) - (set! f0-87 (the-as none (l.f (+ s6-0 2644)))) - (set! f1-79 (the-as none (l.f (+ s6-0 2660)))) - (set! v1-256 (the-as none (+ s6-0 524))) - (set! v1-257 (the-as none (veclength v1-256))) - (set! f2-28 (the-as none (gpr->fpr v1-257))) - (set! f1-80 (the-as none (min.s f1-79 f2-28))) - (set! f0-88 (the-as none (max.s f0-87 f1-80))) - (set! v1-258 (the-as none -961893717)) - (set! f1-81 (the-as none (gpr->fpr v1-258))) - (set! v1-259 (the-as none #x3dcccccd)) - (set! f2-29 (the-as none (gpr->fpr v1-259))) - (set! f3-5 (the-as none (l.f (+ s6-0 2644)))) - (set! f0-89 (the-as none (/.s f3-5 f0-88))) - (set! f0-90 (the-as none (+.s f2-29 f0-89))) - (set! f0-91 (the-as none (*.s f1-81 f0-90))) - (set! v1-260 (the-as none (l.wu (+ s6-0 8)))) - (set! f1-82 (the-as none (l.f (+ v1-260 76)))) - (set! f30-2 (the-as number (*.s f0-91 f1-82))) - (set! v1-261 (the-as none (fpr->gpr f30-2))) - ) - ) - (set! f0-92 (the-as float 0)) - (!=.s f30-2 f0-92) - ) - (when (begin - (set! v1-262 (-> s6-0 options)) - (set! v1-263 (logior v1-262 256)) - (set! (-> s6-0 options) v1-263) - (set! t9-16 matrix-axis-angle!) - (set! a0-44 s4-0) - (set! v1-264 *camera*) - (set! a1-17 (-> v1-264 local-down)) - (set! a2-13 (fpr->gpr f30-2)) - (call! a0-44 a1-17 a2-13) - (set! t9-17 vector-matrix*!) - (set! a0-45 (-> s6-0 view-flat)) - (set! a1-18 (-> s6-0 view-flat)) - (set! a2-14 s4-0) - (call! a0-45 a1-18 a2-14) - (set! (-> s6-0 butt-timer) (the-as uint 0)) - (set! (-> s6-0 butt-seek) #f) - (set! v1-265 #x800000) - (set! a0-46 (-> s6-0 options)) - (set! v1-266 (logand v1-265 a0-46)) - (nonzero? v1-266) - ) - (set! a0-47 *setting-control*) - (set! v1-268 (-> a0-47 type)) - (set! t9-18 (method-of-type v1-268 kill-persister)) - (set! a1-19 'butt-handle) - (set! a2-15 'butt-handle) - (call! a0-47 a1-19 a2-15) - (set! v1-269 v0-19) - (set! v1-270 -8388609) - (set! a0-48 (-> s6-0 options)) - (set! v1-271 (logand v1-270 a0-48)) - (set! (-> s6-0 options) v1-271) - ) - ) - ((begin - (or (begin (set! v1-272 (-> s6-0 options)) (set! v1-273 (logand v1-272 1)) (nonzero? v1-273)) - (if (begin - (and (begin - (set! v1-275 *camera*) - (set! v1-276 (-> v1-275 settings)) - (set! v1-277 (-> v1-276 butt-handle)) - (set! a0-49 (subu-s7 v1-277)) - (nonzero? a0-49) - ) - (begin - (if (begin - (.sllv a0-50 v1-277 r0) - (set! a0-51 (-> a0-50 0)) - (set! a1-20 (-> a0-51 pid)) - (set! v1-278 (sra v1-277 32)) - (= v1-278 a1-20) + ) + ) + ) + (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) + (if (cpad-hold? (-> *CAMERA-bank* joypad) l1) + (set! f30-2 (- f30-2 (+ (* 10922.667 (-> self clock seconds-per-frame)) + (analog-input + (the-as int (-> *cpad-list* cpads (-> *CAMERA-bank* joypad) abutton 8)) + 0.0 + 32.0 + 230.0 + (* 21845.334 (-> self clock seconds-per-frame)) ) - (set! s3-0 a0-51) ) - (set! v1-279 s3-0) - ) - ) - (set! t9-19 type?) - (set! a0-52 s3-0) - (set! a1-21 process-drawable) - (set! v0-20 (call! a0-52 a1-21)) - v0-20 - ) - (set! v1-274 s3-0) - ) - ) - v1-274 + ) + ) + ) + ) + ) + (cond + ((and (= (-> self los-state) (slave-los-state ccw)) (< 0.0 f30-2)) + (let ((f0-82 + (fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat)))) ) - (when (begin - (and (begin - (and (begin - (set! t9-20 vector-normalize-copy!) - (set! a0-53 gp-3) - (set! a1-22 (-> s6-0 view-flat)) - (set! a2-16 (the-as float #x3f800000)) - (call! a0-53 a1-22 a2-16) - (set! v1-280 *camera*) - (set! v1-281 (-> v1-280 settings)) - (set! v1-282 (-> v1-281 butt-handle)) - (set! a0-54 (subu-s7 v1-282)) - (nonzero? a0-54) - ) - (begin - (if (begin - (.sllv a0-55 v1-282 r0) - (set! a0-56 (-> a0-55 0)) - (set! a1-23 (-> a0-56 pid)) - (set! v1-284 (sra v1-282 32)) - (= v1-284 a1-23) - ) - (set! v1-283 a0-56) - ) - (set! a0-57 v1-283) - ) - ) - (cond - (v1-283 - (set! a0-58 #x800000) - (set! a1-24 (-> s6-0 options)) - (set! a0-59 (logior a0-58 a1-24)) - (set! (-> s6-0 options) a0-59) - (set! t9-21 quaternion->matrix) - (set! a0-60 (new 'stack-no-clear 'matrix)) - (set! v1-285 (the-as none (l.wu (+ v1-283 124)))) - (set! a1-25 (the-as none (+ v1-285 28))) - (set! v0-22 (the-as none (call!))) - (set! s3-1 (the-as none v0-22)) - (set! t9-22 (the-as none matrix-axis-angle!)) - (set! a0-61 (the-as none (+ sp-0 288))) - (set! a1-26 (the-as none (+ s3-1 16))) - (set! v1-286 (the-as none #x47000000)) - (set! f0-93 (the-as none (gpr->fpr v1-286))) - (set! v1-287 (the-as none *camera*)) - (set! v1-288 (the-as none (l.wu (+ v1-287 128)))) - (set! f1-83 (the-as none (l.f (+ v1-288 344)))) - (set! f0-94 (the-as none (+.s f0-93 f1-83))) - (set! a2-17 (the-as none (fpr->gpr f0-94))) - (call!) - (set! a2-18 (the-as none v0-23)) - (set! t9-23 (the-as none vector-matrix*!)) - (set! a0-62 (the-as none s5-3)) - (set! a1-27 (the-as none (+ s3-1 32))) - (call!) - (set! t9-24 (the-as none vector-flatten!)) - (set! a0-63 (the-as none s5-3)) - (set! a1-28 (the-as none s5-3)) - (set! v1-289 (the-as none *camera*)) - (set! a2-19 (the-as none (+ v1-289 284))) - (call!) - (set! v1-290 (the-as none v0-25)) - ) - ((begin - (set! v1-291 (the-as none (-> s6-0 clock))) - (set! v1-292 (the-as none (l.d (+ v1-291 20)))) - (set! a0-64 (the-as none (-> s6-0 butt-timer))) - (set! v1-293 (the-as none (- v1-292 a0-64))) - (<0.si v1-293) - ) - (set! t9-25 (the-as none vector-flatten!)) - (set! a0-65 (the-as none s5-3)) - (set! a1-29 (the-as none (+ s6-0 2300))) - (set! v1-294 (the-as none *camera*)) - (set! a2-20 (the-as none (+ v1-294 284))) - (call!) - (set! v1-295 (the-as none v0-26)) - ) - (else - (set! t9-26 (the-as none vector-flatten!)) - (set! a0-66 (the-as none s5-3)) - (set! v1-296 (the-as none *camera*)) - (set! a1-30 (the-as none (+ v1-296 380))) - (set! v1-297 (the-as none *camera*)) - (set! a2-21 (the-as none (+ v1-297 284))) - (call!) - (set! v1-298 (the-as none v0-27)) - ) - ) - (set! t9-27 (the-as none vector-normalize!)) - (set! a0-67 (the-as none s5-3)) - (set! a1-31 (the-as none -1082130432)) - (call!) - (set! v1-299 (the-as none #x800000)) - (set! a0-68 (the-as none (l.wu (+ s6-0 2276)))) - (set! v1-300 (the-as none (logand v1-299 a0-68))) - (nonzero? v1-300) - ) - (begin - (set! t9-28 (the-as none cos)) - (set! a0-69 (the-as none #x44638e39)) - (set! v0-29 (the-as none (call!))) - (set! f0-95 (the-as none (gpr->fpr v0-29))) - (set! a0-70 (the-as none gp-3)) - (set! v1-302 (the-as none s5-3)) - (set! f1-84 (the-as none (vec3dot a0-70 v1-302))) - (set! v1-303 (the-as none (fpr->gpr f1-84))) - (set! f1-85 (the-as none (gpr->fpr v1-303))) - (set! v1-301 (the-as none (<.s f0-95 f1-85))) - ) - ) - v1-301 - ) - (set! a0-71 (the-as none *setting-control*)) - (set! v1-305 (the-as none (l.wu (+ a0-71 -4)))) - (set! t9-29 (the-as none (l.wu (+ v1-305 68)))) - (set! a1-32 (the-as none 'butt-handle)) - (set! a2-22 (the-as none 'butt-handle)) - (call!) - (set! v1-306 (the-as none v0-30)) - (set! v1-307 (the-as none -8388609)) - (set! a0-72 (the-as none (l.wu (+ s6-0 2276)))) - (set! v1-308 (the-as none (logand v1-307 a0-72))) - (s.w! (+ s6-0 2276) v1-308) - ) - (set! t9-30 (the-as none matrix-from-two-vectors-max-angle!)) - (set! a0-73 (the-as none s4-0)) - (set! a1-33 (the-as none gp-3)) - (set! a2-23 (the-as none s5-3)) - (set! a3-4 (the-as none #x44088889)) - (call!) - (set! t9-31 (the-as none vector-matrix*!)) - (set! a0-74 (the-as none (+ s6-0 524))) - (set! a1-34 (the-as none (+ s6-0 524))) - (set! a2-24 (the-as none s4-0)) - (call!) - (set! v1-309 (the-as none v0-32)) ) - (else - (set! v1-310 (the-as none -8388609)) - (set! a0-75 (the-as none (-> s6-0 options))) - (set! v1-311 (the-as none (logand v1-310 a0-75))) - (set! (-> s6-0 options) (the-as uint v1-311)) - ) + (set! f30-2 (* 21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-82)) (-> self clock seconds-per-frame))) + ) + ) + ((and (= (-> self los-state) (slave-los-state cw)) (< f30-2 0.0)) + (let ((f0-88 + (fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat)))) + ) + ) + (set! f30-2 (* -21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-88)) (-> self clock seconds-per-frame))) + ) + ) + ) + (cond + ((!= f30-2 0.0) + (logior! (-> self options) 256) + (matrix-axis-angle! s4-0 (-> *camera* local-down) f30-2) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) + (set! (-> self butt-timer) (the-as uint 0)) + (set! (-> self butt-seek) #f) + (when (logtest? #x800000 (-> self options)) + (kill-persister *setting-control* (the-as engine-pers 'butt-handle) 'butt-handle) + (set! (-> self options) (logand -8388609 (-> self options))) + ) + ) + ((or (logtest? (-> self options) 1) (let ((s3-0 (handle->process (-> *camera* settings butt-handle)))) + (if (type? s3-0 process-drawable) + s3-0 + ) + ) + ) + (vector-normalize-copy! gp-3 (-> self view-flat) 1.0) + (let ((v1-283 (handle->process (-> *camera* settings butt-handle)))) + (cond + (v1-283 + (set! (-> self options) (logior #x800000 (-> self options))) + (let* ((s3-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> (the-as process-drawable v1-283) root quat))) + (a2-18 (matrix-axis-angle! + (new 'stack-no-clear 'matrix) + (-> s3-1 vector 1) + (+ 32768.0 (-> *camera* settings butt-angle)) + ) + ) + ) + (vector-matrix*! s5-3 (-> s3-1 vector 2) a2-18) + ) + (vector-flatten! s5-3 s5-3 (-> *camera* local-down)) + ) + ((< (- (-> self clock frame-counter) (the-as int (-> self butt-timer))) 0) + (vector-flatten! s5-3 (-> self butt-vector) (-> *camera* local-down)) ) - (set! v1-312 *camera*) - (set! v1-313 (-> v1-312 settings)) - (set! v1-314 (-> v1-313 slave-options)) - (set! v1-315 (logand v1-314 8192)) - (nonzero? v1-315) + (else + (vector-flatten! s5-3 (the-as vector (&-> *camera* stack 256)) (-> *camera* local-down)) + ) + ) + ) + (vector-normalize! s5-3 -1.0) + (when (and (logtest? #x800000 (-> self options)) (< (cos 910.2222) (vector-dot gp-3 s5-3))) + (kill-persister *setting-control* (the-as engine-pers 'butt-handle) 'butt-handle) + (set! (-> self options) (logand -8388609 (-> self options))) + ) + (matrix-from-two-vectors-max-angle! s4-0 gp-3 s5-3 546.13336) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) + ) + (else + (set! (-> self options) (logand -8388609 (-> self options))) + ) + ) + (when (logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) + (vector-normalize-copy! gp-3 (-> self view-flat) 1.0) + (vector-flatten! s5-3 (the-as vector (&-> *camera* stack 256)) (-> *camera* local-down)) + (vector-normalize! s5-3 -1.0) + (let ((f0-97 (acos (vector-dot s5-3 gp-3)))) + (when (and (< (-> self max-angle-offset) f0-97) (< f0-97 32585.955)) + (matrix-from-two-vectors-max-angle! + s4-0 + gp-3 + s5-3 + (fmin 546.13336 (* 0.5 (- f0-97 (-> self max-angle-offset)))) + ) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) ) - (when (begin - (and (begin - (set! t9-32 vector-normalize-copy!) - (set! a0-76 gp-3) - (set! a1-35 (-> s6-0 view-flat)) - (set! a2-25 (the-as float #x3f800000)) - (call! a0-76 a1-35 a2-25) - (set! t9-33 vector-flatten!) - (set! a0-77 s5-3) - (set! v1-317 *camera*) - (set! a1-36 (&-> v1-317 stack 256)) - (set! v1-318 *camera*) - (set! a2-26 (-> v1-318 local-down)) - (call! a0-77 a1-36 a2-26) - (set! t9-34 vector-normalize!) - (set! a0-78 s5-3) - (set! a1-37 (the-as float -1082130432)) - (call! a0-78 a1-37) - (set! t9-35 acos) - (set! a0-79 s5-3) - (set! v1-319 gp-3) - (set! f0-96 (vec3dot a0-79 v1-319)) - (set! a0-80 (fpr->gpr f0-96)) - (set! v0-36 (call! a0-80)) - (set! f0-97 (gpr->fpr v0-36)) - (set! f1-86 (-> s6-0 max-angle-offset)) - (set! v1-320 (<.s f1-86 f0-97)) - v1-320 - ) - (begin (set! v1-322 #x46fe93e9) (set! f1-87 (the-as float (gpr->fpr v1-322))) (set! v1-321 (<.s f0-97 f1-87))) - ) - v1-321 - ) - (set! t9-36 matrix-from-two-vectors-max-angle!) - (set! a0-81 s4-0) - (set! v1-324 #x44088889) - (set! f1-88 (the-as float (gpr->fpr v1-324))) - (set! v1-325 #x3f000000) - (set! f2-30 (the-as float (gpr->fpr v1-325))) - (set! f3-6 (-> s6-0 max-angle-offset)) - (set! f0-98 (-.s f0-97 f3-6)) - (set! f0-99 (*.s f2-30 f0-98)) - (set! f0-100 (min.s f1-88 f0-99)) - (set! a3-5 (fpr->gpr f0-100)) - (set! a1-38 gp-3) - (set! a2-27 s5-3) - (call! a0-81 a1-38 a2-27 a3-5) - (set! t9-37 vector-matrix*!) - (set! a0-82 (-> s6-0 view-flat)) - (set! a1-39 (-> s6-0 view-flat)) - (set! a2-28 s4-0) - (call! a0-82 a1-39 a2-28) - (set! v1-326 v0-38) + ) ) ) ) - (when (begin - (set! v1-327 (the-as none #x80000)) - (set! a0-83 (the-as none *camera*)) - (set! a0-84 (the-as none (l.wu (+ a0-83 128)))) - (set! a0-85 (the-as none (l.d (+ a0-84 112)))) - (set! v1-328 (the-as none (logand v1-327 a0-85))) - (zero? v1-328) + (when (not (logtest? (cam-slave-options WIDE_FOV) (-> *camera* settings slave-options))) + (let ((f0-101 (vector-length (-> self view-flat)))) + (let ((f1-89 (-> self view-off z))) + (when (< f1-89 f0-101) + (vector-float*! (-> self view-flat) (-> self view-flat) (/ f1-89 f0-101)) + (set! (-> self min-z-override) f1-89) + (set! f0-101 f1-89) ) - (when (begin - (when (begin - (set! v1-329 (the-as none (+ s6-0 524))) - (set! v1-330 (the-as none (veclength v1-329))) - (set! f0-101 (the-as none (gpr->fpr v1-330))) - (set! f1-89 (the-as none (l.f (+ s6-0 484)))) - (<.s f1-89 f0-101) - ) - (set! v1-332 (the-as none (+ s6-0 524))) - (set! a0-86 (the-as none (+ s6-0 524))) - (set! f0-102 (the-as none (/.s f1-89 f0-101))) - (set! v1-333 (the-as none (vector-float*!2 v1-332 a0-86 f0-102))) - (s.f! (+ s6-0 508) f1-89) - (set! f0-101 (the-as none f1-89)) - (set! v1-334 (the-as none (fpr->gpr f0-101))) - ) - (set! f1-90 (the-as none (l.f (+ s6-0 500)))) - (set! v1-335 (the-as none (<.s f1-90 f0-101))) - (and v1-335 (begin - (set! f1-91 (the-as none (l.f (+ s6-0 480)))) - (set! f2-31 (the-as none (l.f (+ s6-0 496)))) - (set! v1-336 (the-as none (<.s f1-91 f2-31))) - ) - ) - v1-336 - ) - (set! v1-338 (the-as none *camera*)) - (set! v1-339 (the-as none (l.wu (+ v1-338 128)))) - (set! f1-92 (the-as none (l.f (+ v1-339 68)))) - (set! f2-32 (the-as none (l.f (+ s6-0 2640)))) - (set! f3-7 (the-as none (l.f (+ s6-0 496)))) - (set! f2-33 (the-as none (max.s f2-32 f3-7))) - (set! f1-93 (the-as none (min.s f1-92 f2-33))) - (s.f! (+ s6-0 480) f1-93) - (set! v1-340 (the-as none (fpr->gpr f1-93))) + ) + (if (and (< (-> self joystick-saved-view-off z) f0-101) + (< (-> self view-off y) (-> self joystick-saved-view-off y)) + ) + (set! (-> self view-off y) (fmin + (-> *camera* settings string-cliff-height) + (fmax (-> self string-min-val y) (-> self joystick-saved-view-off y)) + ) + ) + ) + (set! (-> self joystick-saved-view-off y) (-> self view-off y)) + (set! (-> self joystick-saved-view-off z) f0-101) + f0-101 ) - (set! f1-94 (the-as none (l.f (+ s6-0 480)))) - (s.f! (+ s6-0 496) f1-94) - (s.f! (+ s6-0 500) f0-101) - (set! v0-6 (the-as symbol (fpr->gpr f0-101))) ) - (ret-value v0-6) ) ;; definition for function cam-string-find-hidden @@ -4380,496 +2976,102 @@ ;; definition for function cam-string-code ;; INFO: Used lq/sq -;; ERROR: failed type prop at 11: Called a function, but we do not know its type -;; WARN: Return type mismatch none vs vector. +;; WARN: Return type mismatch float vs vector. (defbehavior cam-string-code camera-slave () - (local-vars - (v0-0 none) - (v0-1 object) - (v0-2 none) - (v0-3 none) - (v0-4 none) - (v0-5 none) - (v0-6 none) - (v0-7 none) - (v0-8 none) - (v0-9 none) - (v0-10 none) - (v0-11 none) - (v0-12 none) - (v0-13 none) - (v0-14 none) - (v0-15 none) - (v0-16 none) - (v0-17 none) - (v0-18 none) - (v0-19 none) - (v0-20 none) - (v1-0 symbol) - (v1-3 uint) - (v1-4 uint) - (v1-9 none) - (v1-10 none) - (v1-11 none) - (v1-12 none) - (v1-13 none) - (v1-14 none) - (v1-15 none) - (v1-17 none) - (v1-18 none) - (v1-21 none) - (v1-22 none) - (v1-23 none) - (v1-25 none) - (v1-27 none) - (v1-28 none) - (v1-29 none) - (v1-30 none) - (v1-31 none) - (v1-32 none) - (v1-33 none) - (v1-37 none) - (v1-39 none) - (v1-40 none) - (v1-41 none) - (v1-42 none) - (v1-43 none) - (v1-45 none) - (v1-46 none) - (v1-48 none) - (v1-49 none) - (v1-51 none) - (v1-54 none) - (v1-55 none) - (v1-56 none) - (v1-58 none) - (v1-59 none) - (v1-60 none) - (v1-61 none) - (v1-62 none) - (v1-63 none) - (v1-64 none) - (v1-66 none) - (v1-67 none) - (v1-68 none) - (v1-69 none) - (v1-70 none) - (v1-72 none) - (v1-73 none) - (v1-74 none) - (v1-75 none) - (v1-76 none) - (v1-77 none) - (v1-78 none) - (v1-80 none) - (v1-81 none) - (v1-82 none) - (v1-83 none) - (v1-84 none) - (v1-88 none) - (a0-1 none) - (a0-2 none) - (a0-3 none) - (a0-4 none) - (a0-5 none) - (a0-6 none) - (a0-7 none) - (a0-8 none) - (a0-9 none) - (a0-10 none) - (a0-11 none) - (a0-12 none) - (a0-13 none) - (a0-14 none) - (a0-15 none) - (a0-16 none) - (a0-17 none) - (a0-18 none) - (a0-19 none) - (a0-20 none) - (a0-21 none) - (a0-22 none) - (a0-23 none) - (a0-24 none) - (a0-25 none) - (a0-26 none) - (a1-0 none) - (a1-1 none) - (a1-2 none) - (a1-3 none) - (a1-4 none) - (a1-5 none) - (a1-7 none) - (a1-8 none) - (a1-9 none) - (a1-10 none) - (a1-11 none) - (a1-12 none) - (a1-13 none) - (a2-0 none) - (a2-1 none) - (a2-2 none) - (a2-3 none) - (a2-4 none) - (a2-5 none) - (a2-6 none) - (a2-7 none) - (a2-8 none) - (a2-9 none) - (a3-1 none) - (a3-2 none) - (a3-3 none) - (a3-4 none) - (a3-5 none) - (a3-6 none) - (t0-0 none) - (t0-1 none) - (t0-2 none) - (t0-3 none) - (t0-4 none) - (t0-5 none) - (t0-6 none) - (t0-7 none) - (t9-0 (function none)) - (t9-1 (function object :behavior camera-slave)) - (t9-2 function) - (t9-3 none) - (t9-4 none) - (t9-5 none) - (t9-6 none) - (t9-7 none) - (t9-8 none) - (t9-9 none) - (t9-10 none) - (t9-11 none) - (t9-12 none) - (t9-13 none) - (t9-14 none) - (t9-15 none) - (t9-16 none) - (t9-17 none) - (t9-18 none) - (t9-19 none) - (t9-20 none) - (gp-0 none) - (gp-1 none) - (gp-2 none) - (sp-0 none) - (f0-0 none) - (f0-1 none) - (f0-2 none) - (f0-3 none) - (f0-4 none) - (f0-5 none) - (f0-6 none) - (f0-7 none) - (f0-8 none) - (f0-9 none) - (f0-10 none) - (f0-11 none) - (f0-12 none) - (f0-13 none) - (f0-14 none) - (f0-15 none) - (f1-0 none) - (f1-1 none) - (f1-2 none) - (f1-3 none) - (f1-4 none) - (f30-0 none) + (if *debug-segment* + (cam-debug-reset-coll-tri) + ) + (cam-string-follow) + (if (logtest? (-> self options) 512) + (cam-string-line-of-sight) + ) + (if (not (paused?)) + (cam-string-joystick) + ) + (let ((gp-0 (new-stack-vector0))) + (vector--float*! + gp-0 + (-> self view-flat) + (-> *camera* local-down) + (+ (-> *camera* settings target-height) (-> self view-off y)) + ) + (vector+! (-> self desired-pos) (-> *camera* tpos-curr-adj) gp-0) ) + (set! (-> self desired-pos y) (fmin (-> self desired-pos y) (-> *camera* settings string-camera-ceiling))) + (if (logtest? (-> self options) 64) + (cam-string-find-hidden) + ) (cond - ((begin - (when (begin - (when (begin - (when (begin (set! v1-0 *debug-segment*) v1-0) - (set! t9-0 cam-debug-reset-coll-tri) - (call!) - (set! v1-2 v0-0) - ) - (set! t9-1 cam-string-follow) - (call!) - (set! v1-3 (-> s6-0 options)) - (set! v1-4 (logand v1-3 512)) - (nonzero? v1-4) - ) - (set! t9-2 cam-string-line-of-sight) - (call!) - (set! v1-6 (the-as none v0-2)) - ) - (when (begin (set! t9-3 (the-as none paused?)) (set! v0-3 (the-as none (call!))) (not v0-3)) - (set! t9-4 (the-as none cam-string-joystick)) - (call!) - (set! v1-8 (the-as none v0-4)) - ) - (set! gp-0 (the-as none (+ sp-0 16))) - (s.q! gp-0 0) - (set! t9-5 (the-as none vector--float*!)) - (set! a0-0 (the-as none gp-0)) - (set! a1-0 (the-as none (+ s6-0 524))) - (set! v1-9 (the-as none *camera*)) - (set! a2-0 (the-as none (+ v1-9 284))) - (set! v1-10 (the-as none *camera*)) - (set! v1-11 (the-as none (l.wu (+ v1-10 128)))) - (set! f0-0 (the-as none (l.f (+ v1-11 196)))) - (set! f1-0 (the-as none (l.f (+ s6-0 480)))) - (set! f0-1 (the-as none (+.s f0-0 f1-0))) - (set! a3-0 (the-as none (fpr->gpr f0-1))) - (call!) - (set! v1-12 (the-as none (+ s6-0 2332))) - (set! a0-1 (the-as none *camera*)) - (set! a0-2 (the-as none (+ a0-1 524))) - (set! v1-13 (the-as none (vector+!2 v1-12 a0-2 gp-0))) - (set! f0-2 (the-as none (l.f (+ s6-0 2336)))) - (set! v1-14 (the-as none *camera*)) - (set! v1-15 (the-as none (l.wu (+ v1-14 128)))) - (set! f1-1 (the-as none (l.f (+ v1-15 72)))) - (set! f0-3 (the-as none (min.s f0-2 f1-1))) - (s.f! (+ s6-0 2336) f0-3) - (set! v1-16 (the-as none (fpr->gpr f0-3))) - (set! v1-17 (the-as none (l.wu (+ s6-0 2276)))) - (set! v1-18 (the-as none (logand v1-17 64))) - (nonzero? v1-18) - ) - (set! t9-6 (the-as none cam-string-find-hidden)) - (call!) - (set! v1-20 (the-as none v0-6)) + ((logtest? (-> self options) 4096) + (when *debug-segment* + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-! a1-1 (-> self good-point) (-> self string-trans)) + (cam-collision-record-save (-> self string-trans) a1-1 -2 'jump self) ) - (set! v1-21 (the-as none (l.wu (+ s6-0 2276)))) - (set! v1-22 (the-as none (logand v1-21 4096))) - (nonzero? v1-22) ) - (when (begin - (when (begin (set! v1-23 (the-as none *debug-segment*)) v1-23) - (set! a1-1 (the-as none (+ sp-0 32))) - (set! a2-1 (the-as none a1-1)) - (set! v1-25 (the-as none (+ s6-0 2364))) - (set! a0-3 (the-as none (+ s6-0 556))) - (set! a2-2 (the-as none (vector-!2 a2-1 v1-25 a0-3))) - (set! t9-7 (the-as none cam-collision-record-save)) - (set! a0-4 (the-as none (+ s6-0 556))) - (set! a2-3 (the-as none -2)) - (set! a3-1 (the-as none 'jump)) - (set! t0-0 (the-as none s6-0)) - (call!) - (set! v1-26 (the-as none v0-7)) - ) - (set! v1-27 (the-as none -4097)) - (set! a0-5 (the-as none (l.wu (+ s6-0 2276)))) - (set! v1-28 (the-as none (logand v1-27 a0-5))) - (s.w! (+ s6-0 2276) v1-28) - (set! v1-29 (the-as none (+ s6-0 2332))) - (set! a0-6 (the-as none (+ s6-0 2364))) - (set! a0-7 (the-as none (l.q a0-6))) - (s.q! v1-29 a0-7) - (set! t9-8 (the-as none cam-string-move)) - (call!) - (set! a0-8 (the-as none (+ s6-0 524))) - (set! v1-30 (the-as none (+ s6-0 556))) - (set! a1-2 (the-as none *camera*)) - (set! a1-3 (the-as none (+ a1-2 524))) - (set! a0-9 (the-as none (vector-!2 a0-8 v1-30 a1-3))) - (set! t9-9 (the-as none vector-flatten!)) - (set! a0-10 (the-as none (+ s6-0 524))) - (set! a1-4 (the-as none (+ s6-0 524))) - (set! v1-31 (the-as none *camera*)) - (set! a2-4 (the-as none (+ v1-31 284))) - (call!) - (set! v1-32 (the-as none (+ s6-0 524))) - (set! v1-33 (the-as none (veclength v1-32))) - (set! f0-4 (the-as none (gpr->fpr v1-33))) - (set! f1-2 (the-as none (l.f (+ s6-0 508)))) - (<.s f0-4 f1-2) - ) - (s.f! (+ s6-0 508) f0-4) - (set! v1-35 (the-as none (fpr->gpr f0-4))) + (set! (-> self options) (logand -4097 (-> self options))) + (set! (-> self desired-pos quad) (-> self good-point quad)) + (cam-string-move) + (vector-! (-> self view-flat) (-> self string-trans) (-> *camera* tpos-curr-adj)) + (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) + (let ((f0-4 (vector-length (-> self view-flat)))) + (if (< f0-4 (-> self min-z-override)) + (set! (-> self min-z-override) f0-4) + ) ) ) (else - (set! t9-10 (the-as none cam-string-move)) - (call!) - (set! v1-36 (the-as none v0-10)) + (cam-string-move) ) ) - (set! a0-11 (the-as none (+ s6-0 572))) - (set! v1-37 (the-as none tracking-spline)) - (set! t9-11 (the-as none (l.wu (+ v1-37 84)))) - (set! a1-5 (the-as none (+ s6-0 556))) - (set! a2-5 (the-as none #x3d27c5ac)) - (set! a3-2 (the-as none #x45800000)) - (set! t0-1 (the-as none #t)) - (call!) - (set! v1-38 (the-as none v0-11)) - (set! v1-39 (the-as none (l.wu (+ s6-0 8)))) - (set! f30-0 (the-as none (l.f (+ v1-39 8)))) - (set! gp-1 (the-as none 2)) - (set! v1-40 (the-as none #x3f000000)) - (set! f0-5 (the-as none (gpr->fpr v1-40))) - (set! v1-41 (the-as none (l.wu (+ s6-0 8)))) - (set! f1-3 (the-as none (l.f (+ v1-41 84)))) - (set! f0-6 (the-as none (+.s f0-5 f1-3))) - (set! f0-7 (the-as none (f2i f0-6))) - (set! v1-42 (the-as none (fpr->gpr f0-7))) - (set! gp-2 (the-as none (max.si gp-1 v1-42))) - (set! a0-12 (the-as none (l.wu (+ s6-0 8)))) - (set! v1-43 (the-as none (l.wu (+ a0-12 -4)))) - (set! t9-12 (the-as none (l.wu (+ v1-43 52)))) - (set! f0-8 (the-as none (gpr->fpr gp-2))) - (set! f0-9 (the-as none (i2f f0-8))) - (set! f0-10 (the-as none (/.s f30-0 f0-9))) - (set! a1-6 (the-as none (fpr->gpr f0-10))) - (call!) - (set! v1-44 (the-as none v0-12)) - (while (nonzero? gp-2) - (cond - ((begin (set! gp-2 (the-as none (+ gp-2 -1))) (set! v1-45 (the-as none (l.wu (+ s6-0 2292)))) v1-45) - (if (begin - (if (begin - (set! a0-13 (the-as none (+ s6-0 572))) - (set! v1-46 (the-as none tracking-spline)) - (set! t9-13 (the-as none (l.wu (+ v1-46 100)))) - (set! a1-7 (the-as none (+ s6-0 124))) - (set! a2-6 (the-as none #x4323d70a)) - (set! a3-3 (the-as none #x46000000)) - (set! t0-2 (the-as none #x3dcccccd)) - (call!) - (set! v1-47 (the-as none v0-13)) - (set! a1-8 (the-as none (+ sp-0 48))) - (set! v1-48 (the-as none s6-0)) - v1-48 - ) - (set! a0-14 (the-as none (l.wu (+ v1-48 24)))) - ) - (s.w! (+ a1-8 8) a0-14) - (s.w! (+ a1-8 68) 0) - (set! v1-49 (the-as none 'fast-rot)) - (s.w! (+ a1-8 64) v1-49) - (set! t9-14 (the-as none send-event-function)) - (set! a0-15 (the-as none *camera-combiner*)) - (call!) - (set! v1-50 (the-as none v0-14)) - (set! f0-11 (the-as none (l.f (+ s6-0 2108)))) - (set! v1-51 (the-as none #x45800000)) - (set! f1-4 (the-as none (gpr->fpr v1-51))) - (<.s f0-11 f1-4) - ) - (s.w! (+ s6-0 2292) #f) - ) - ) - (else + (tracking-spline-method-17 (-> self position-spline) (-> self string-trans) 0.04096 4096.0 #t) + (let ((f30-0 (-> self clock clock-ratio))) + (let ((gp-2 (max 2 (the int (+ 0.5 (-> self clock time-adjust-ratio)))))) + (update-rates! (-> self clock) (/ f30-0 (the float gp-2))) + (while (nonzero? gp-2) + (+! gp-2 -1) (cond - ((begin - (set! v1-54 (the-as none #x100000)) - (set! a0-16 (the-as none *camera*)) - (set! a0-17 (the-as none (l.wu (+ a0-16 128)))) - (set! a0-18 (the-as none (l.d (+ a0-17 112)))) - (set! v1-55 (the-as none (logand v1-54 a0-18))) - (nonzero? v1-55) + ((-> self butt-seek) + (tracking-spline-method-21 (-> self position-spline) (-> self trans) 163.84 8192.0 0.1) + (send-event *camera-combiner* 'fast-rot) + (if (< (-> self position-spline summed-len) 4096.0) + (set! (-> self butt-seek) #f) + ) + ) + ((logtest? (cam-slave-options RAPID_TRACKING) (-> *camera* settings slave-options)) + (tracking-spline-method-21 (-> self position-spline) (-> self trans) 4096.0 40960.0 0.1) + ) + ((and (logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) + (logtest? (-> self options) 256) + ) + (tracking-spline-method-21 (-> self position-spline) (-> self trans) 102.4 4096.0 0.1) + ) + ((logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) + (tracking-spline-method-21 (-> self position-spline) (-> self trans) 40.96 4096.0 0.1) + ) + ((logtest? (-> self options) 256) + (tracking-spline-method-21 + (-> self position-spline) + (-> self trans) + (-> *camera* settings string-spline-accel-player) + (-> *camera* settings string-spline-max-move-player) + 0.1 ) - (set! a0-19 (the-as none (+ s6-0 572))) - (set! v1-56 (the-as none tracking-spline)) - (set! t9-15 (the-as none (l.wu (+ v1-56 100)))) - (set! a1-9 (the-as none (+ s6-0 124))) - (set! a2-7 (the-as none #x45800000)) - (set! a3-4 (the-as none #x47200000)) - (set! t0-3 (the-as none #x3dcccccd)) - (call!) - (set! v1-57 (the-as none v0-15)) ) (else - (and (begin - (set! v1-58 (the-as none *camera*)) - (set! v1-59 (the-as none (l.wu (+ v1-58 128)))) - (set! v1-60 (the-as none (l.d (+ v1-59 112)))) - (set! v1-61 (the-as none (logand v1-60 8192))) - (nonzero? v1-61) - ) - (begin - (set! v1-63 (the-as none #t)) - (set! a0-20 (the-as none (l.wu (+ s6-0 2276)))) - (set! a0-21 (the-as none (logand a0-20 256))) - (cmove-#f-zero v1-62 a0-21 v1-63) - ) - ) - (cond - (v1-62 - (set! a0-22 (the-as none (+ s6-0 572))) - (set! v1-64 (the-as none tracking-spline)) - (set! t9-16 (the-as none (l.wu (+ v1-64 100)))) - (set! a1-10 (the-as none (+ s6-0 124))) - (set! a2-8 (the-as none #x42cccccd)) - (set! a3-5 (the-as none #x45800000)) - (set! t0-4 (the-as none #x3dcccccd)) - (call!) - (set! v1-65 (the-as none v0-16)) - ) - ((begin - (set! v1-66 (the-as none *camera*)) - (set! v1-67 (the-as none (l.wu (+ v1-66 128)))) - (set! v1-68 (the-as none (l.d (+ v1-67 112)))) - (set! v1-69 (the-as none (logand v1-68 8192))) - (nonzero? v1-69) - ) - (set! a0-23 (the-as none (+ s6-0 572))) - (set! v1-70 (the-as none tracking-spline)) - (set! t9-17 (the-as none (l.wu (+ v1-70 100)))) - (set! a1-11 (the-as none (+ s6-0 124))) - (set! a2-9 (the-as none #x4223d70a)) - (set! a3-6 (the-as none #x45800000)) - (set! t0-5 (the-as none #x3dcccccd)) - (call!) - (set! v1-71 (the-as none v0-17)) - ) - ((begin - (set! v1-72 (the-as none (l.wu (+ s6-0 2276)))) - (set! v1-73 (the-as none (logand v1-72 256))) - (nonzero? v1-73) - ) - (set! a0-24 (the-as none (+ s6-0 572))) - (set! v1-74 (the-as none tracking-spline)) - (set! t9-18 (the-as none (l.wu (+ v1-74 100)))) - (set! a1-12 (the-as none (+ s6-0 124))) - (set! v1-75 (the-as none *camera*)) - (set! v1-76 (the-as none (l.wu (+ v1-75 128)))) - (set! f0-12 (the-as none (l.f (+ v1-76 140)))) - (set! a2-10 (the-as none (fpr->gpr f0-12))) - (set! v1-77 (the-as none *camera*)) - (set! v1-78 (the-as none (l.wu (+ v1-77 128)))) - (set! f0-13 (the-as none (l.f (+ v1-78 136)))) - (set! a3-7 (the-as none (fpr->gpr f0-13))) - (set! t0-6 (the-as none #x3dcccccd)) - (call!) - (set! v1-79 (the-as none v0-18)) - ) - (else - (set! a0-25 (the-as none (+ s6-0 572))) - (set! v1-80 (the-as none tracking-spline)) - (set! t9-19 (the-as none (l.wu (+ v1-80 100)))) - (set! a1-13 (the-as none (+ s6-0 124))) - (set! v1-81 (the-as none *camera*)) - (set! v1-82 (the-as none (l.wu (+ v1-81 128)))) - (set! f0-14 (the-as none (l.f (+ v1-82 132)))) - (set! a2-11 (the-as none (fpr->gpr f0-14))) - (set! v1-83 (the-as none *camera*)) - (set! v1-84 (the-as none (l.wu (+ v1-83 128)))) - (set! f0-15 (the-as none (l.f (+ v1-84 128)))) - (set! a3-8 (the-as none (fpr->gpr f0-15))) - (set! t0-7 (the-as none #x3dcccccd)) - (call!) - (set! v1-85 (the-as none v0-19)) - ) + (tracking-spline-method-21 + (-> self position-spline) + (-> self trans) + (-> *camera* settings string-spline-accel) + (-> *camera* settings string-spline-max-move) + 0.1 ) ) ) ) ) + (the-as vector (update-rates! (-> self clock) f30-0)) ) - (set! a0-26 (the-as none (l.wu (+ s6-0 8)))) - (set! v1-88 (the-as none (l.wu (+ a0-26 -4)))) - (set! t9-20 (the-as none (l.wu (+ v1-88 52)))) - (set! a1-14 (the-as none (fpr->gpr f30-0))) - (set! v0-20 (the-as none (call!))) - (ret-value v0-20) ) ;; definition for function set-string-params @@ -5213,7 +3415,109 @@ ) ;; definition for function cam-stick-code -;; ERROR: function has no type analysis. Cannot decompile. +;; INFO: Used lq/sq +(defbehavior cam-stick-code camera-slave () + (cam-calc-follow! (-> self tracking) (-> self trans) #t) + (let ((gp-0 (new-stack-vector0))) + (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) + (vector-normalize! (-> self view-flat) (-> self view-off z)) + (vector-! gp-0 (-> self view-flat) (vector-float*! gp-0 (-> *camera* local-down) (-> self view-off y))) + (vector+! (-> self desired-pos) (-> self tracking follow-pt) gp-0) + ) + (let ((v1-3 (new-stack-vector0)) + (gp-1 (new-stack-vector0)) + ) + (vector-! v1-3 (-> self desired-pos) (-> self trans)) + (vector-float*! v1-3 v1-3 0.2) + (vector-! gp-1 v1-3 (-> self velocity)) + (if (< 409.6 (vector-length gp-1)) + (vector-normalize! gp-1 409.6) + ) + (vector+! (-> self velocity) (-> self velocity) gp-1) + ) + (let ((gp-2 (new 'stack-no-clear 'collide-query))) + 0.0 + (let ((f30-0 1.0) + (s5-0 (-> gp-2 move-dist)) + (s4-0 (new-stack-vector0)) + (s3-0 4) + (s2-0 0) + ) + (while (and (< 0.01 f30-0) + (and (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) (> s3-0 0)) + ) + (+! s3-0 -1) + (vector-float*! s5-0 (-> self velocity) f30-0) + (let ((f28-0 + (cond + ((logtest? (-> self options) 32) + (set! (-> gp-2 start-pos quad) (-> self trans quad)) + (let ((s1-0 gp-2)) + (set! (-> s1-0 radius) (-> *CAMERA-bank* collide-move-rad)) + (set! (-> s1-0 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) + (set! (-> s1-0 ignore-process0) #f) + (set! (-> s1-0 ignore-process1) #f) + (set! (-> s1-0 ignore-pat) (the-as pat-surface (camera-master-method-16 *camera* #f))) + (set! (-> s1-0 action-mask) (collide-action solid)) + ) + (fill-and-probe-using-line-sphere *collide-cache* gp-2) + ) + (else + -100000000.0 + ) + ) + ) + ) + (cond + ((>= f28-0 0.0) + (vector+float*! (-> self trans) (-> self trans) s5-0 f28-0) + (set! (-> s4-0 quad) (-> gp-2 best-other-tri normal quad)) + (vector-flatten! (-> self velocity) (-> self velocity) s4-0) + (set! f30-0 (- f30-0 (* f30-0 f28-0))) + (set! s2-0 1) + ) + (else + (vector+! (-> self trans) (-> self trans) s5-0) + (set! f30-0 0.0) + ) + ) + ) + ) + (when (nonzero? s2-0) + 0 + (let ((gp-3 (new-stack-vector0))) + 0.0 + (vector-! gp-3 (-> self trans) (-> self tracking follow-pt)) + (vector-flatten! gp-3 gp-3 (-> *camera* local-down)) + (let ((f0-15 (/ (- (vector-length gp-3) (-> *CAM_STICK-bank* min-z)) + (- (-> *CAM_STICK-bank* max-z) (-> *CAM_STICK-bank* min-z)) + ) + ) + ) + (cond + ((< f0-15 0.0) + (set! f0-15 0.0) + ) + ((< 1.0 f0-15) + (set! f0-15 1.0) + ) + ) + (cond + ((< (- f0-15 (-> self view-off-param)) -0.001) + (set! (-> self view-off-param) f0-15) + ) + ((< 0.001 (- f0-15 (-> self view-off-param))) + (vector-normalize-copy! (-> self view-flat) gp-3 (-> self view-off z)) + ) + ) + ) + ) + ) + ) + ) + (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #t) + (none) + ) ;; failed to figure out what this is: (defstate cam-stick (camera-slave) @@ -5313,6 +3617,16 @@ ) (none) ) + :code (behavior () + (until #f + (if (not (paused?)) + (cam-stick-code) + ) + (suspend) + ) + #f + (none) + ) ) ;; definition of type cam-bike-bank @@ -5361,7 +3675,107 @@ ) ;; definition for function cam-bike-code -;; ERROR: function has no type analysis. Cannot decompile. +;; INFO: Used lq/sq +(defbehavior cam-bike-code camera-slave () + (let ((s4-0 (new-stack-matrix0))) + (let ((gp-0 (new-stack-vector0)) + (s5-0 (new-stack-vector0)) + ) + (vector-normalize-copy! gp-0 (-> self view-flat) 1.0) + (vector-flatten! s5-0 (the-as vector (&-> *camera* stack 256)) (-> *camera* local-down)) + (vector-normalize! s5-0 -1.0) + (matrix-from-two-vectors-partial-linear! s4-0 gp-0 s5-0 0.2) + ) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) + ) + (let ((gp-1 (new-stack-vector0))) + 0.0 + (vector-! gp-1 (-> *camera* tpos-curr-adj) (-> *camera* tpos-old-adj)) + (let ((f30-0 (vector-length gp-1))) + (set! (-> self view-off z) (lerp-clamp + (-> *CAM_BIKE-bank* max-z) + (-> *CAM_BIKE-bank* min-z) + (parameter-ease-sin-clamp (* 0.00081380206 (+ -409.6 f30-0))) + ) + ) + (set! (-> self view-off y) (lerp-clamp + (-> *CAM_BIKE-bank* max-y) + (-> *CAM_BIKE-bank* min-y) + (parameter-ease-sin-clamp (* 0.00081380206 (+ -409.6 f30-0))) + ) + ) + ) + (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) + (vector-normalize! (-> self view-flat) (-> self view-off z)) + (vector-! gp-1 (-> self view-flat) (vector-float*! gp-1 (-> *camera* local-down) (-> self view-off y))) + (vector+! (-> self desired-pos) (-> *camera* tpos-curr-adj) gp-1) + ) + (let ((v1-19 (new-stack-vector0)) + (gp-2 (new-stack-vector0)) + ) + (vector-! v1-19 (-> self desired-pos) (-> self trans)) + (vector-float*! v1-19 v1-19 0.2) + (vector-! gp-2 v1-19 (-> self velocity)) + (if (< 409.6 (vector-length gp-2)) + (vector-normalize! gp-2 409.6) + ) + (vector+! (-> self velocity) (-> self velocity) gp-2) + ) + (let ((gp-3 (new 'stack-no-clear 'collide-query))) + 0.0 + (let ((f30-1 1.0) + (s5-3 (-> gp-3 move-dist)) + (s4-3 4) + ) + (while (and (< 0.01 f30-1) + (and (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) (> s4-3 0)) + ) + (+! s4-3 -1) + (vector-float*! s5-3 (-> self velocity) f30-1) + (let ((f28-0 + (cond + ((logtest? (-> self options) 32) + (set! (-> gp-3 start-pos quad) (-> self trans quad)) + (let ((s3-2 gp-3)) + (set! (-> s3-2 radius) 4096.0) + (set! (-> s3-2 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) + (set! (-> s3-2 ignore-process0) #f) + (set! (-> s3-2 ignore-process1) #f) + (set! (-> s3-2 ignore-pat) (the-as pat-surface (camera-master-method-16 *camera* #f))) + (set! (-> s3-2 action-mask) (collide-action solid)) + ) + (fill-and-probe-using-line-sphere *collide-cache* gp-3) + ) + (else + -100000000.0 + ) + ) + ) + ) + (cond + ((>= f28-0 0.0) + (vector+float*! (-> self trans) (-> self trans) s5-3 f28-0) + (vector-flatten! (-> self velocity) (-> self velocity) (-> gp-3 best-other-tri normal)) + (set! f30-1 (- f30-1 (* f30-1 f28-0))) + (let ((s3-3 (new-stack-vector0))) + (vector-! s3-3 (-> self trans) (-> *camera* tpos-curr-adj)) + (vector-flatten! s3-3 s3-3 (-> *camera* local-down)) + (vector-normalize-copy! (-> self view-flat) s3-3 (-> self view-off z)) + ) + ) + (else + (vector+! (-> self trans) (-> self trans) s5-3) + (set! f30-1 0.0) + ) + ) + ) + ) + ) + ) + (cam-calc-bike-follow! (-> self tracking) (-> self trans) #t) + (slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #t) + (none) + ) ;; failed to figure out what this is: (defstate cam-bike (camera-slave) @@ -5401,4 +3815,14 @@ ) (none) ) + :code (behavior () + (until #f + (if (not (paused?)) + (cam-bike-code) + ) + (suspend) + ) + #f + (none) + ) ) diff --git a/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc index 3918475167..1db1d4b71e 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc @@ -114,7 +114,7 @@ (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector 19) (tracking-spline-method-20 (_type_ vector int) none 20) (tracking-spline-method-21 (_type_ vector float float float) vector 21) - (tracking-spline-method-22 (_type_ float) none 22) + (tracking-spline-method-22 (_type_ float) symbol 22) (debug-draw-spline (_type_) none 23) ) ) @@ -628,7 +628,7 @@ (:methods (camera-master-method-14 (_type_ vector) vector 14) (camera-master-method-15 (_type_ vector) vector 15) - (camera-master-method-16 (_type_ symbol) none 16) + (camera-master-method-16 (_type_ symbol) int 16) ) ) diff --git a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc index 048c0f188a..dcddaf28a1 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc @@ -892,7 +892,7 @@ ) ;; definition for method 22 of type tracking-spline -;; WARN: Return type mismatch int vs none. +;; WARN: Return type mismatch int vs symbol. (defmethod tracking-spline-method-22 tracking-spline ((obj tracking-spline) (arg0 float)) (when (< arg0 (-> obj summed-len)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) @@ -904,8 +904,7 @@ (tracking-spline-method-14 obj s5-0) ) ) - 0 - (none) + (the-as symbol 0) ) ;; definition for method 9 of type tracking-spline diff --git a/test/decompiler/reference/jak2/engine/data/art-h_REF.gc b/test/decompiler/reference/jak2/engine/data/art-h_REF.gc index a507df7d02..73526e75d3 100644 --- a/test/decompiler/reference/jak2/engine/data/art-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/data/art-h_REF.gc @@ -611,7 +611,7 @@ (get-skeleton-origin (_type_) vector 9) (draw-control-method-10 () none 10) (draw-control-method-11 () none 11) - (draw-control-method-12 (_type_ int int) none 12) + (draw-control-method-12 (_type_ uint int) none 12) (draw-control-method-13 () none 13) (draw-control-method-14 (_type_ cspace-array joint-control) none 14) ) diff --git a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc index 12d5ac2844..bd38a5f7b2 100644 --- a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc @@ -708,7 +708,7 @@ ;; definition (debug) for function add-debug-line2d ;; INFO: Used lq/sq -(defun-debug add-debug-line2d ((enable symbol) (bucket bucket-id) (start vector) (end vector) (color vector)) +(defun-debug add-debug-line2d ((enable symbol) (bucket bucket-id) (start vector4w) (end vector4w) (color vector4w)) (if (not enable) (return #f) ) diff --git a/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc b/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc index c6ea668433..a6f458cad8 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc @@ -243,7 +243,7 @@ (debug-features game-feature :offset-assert 136) (secrets game-secrets :offset-assert 144) (unknown-pad1 uint32 :offset-assert 148) - (purchase-secrets uint32 :offset-assert 152) + (purchase-secrets game-secrets :offset-assert 152) (unknown-pad2 uint32 :offset-assert 156) (gun-type int32 :offset-assert 160) (gun-ammo float 4 :offset-assert 164) @@ -262,7 +262,7 @@ (last-continue continue-point :offset-assert 244) (play-list (array game-task-info) :offset-assert 248) (sub-task-list (array game-task-node-info) :offset-assert 252) - (unknown-pad5 (array game-task-node-info) :offset-assert 256) + (mission-list (array game-task-node-info) :offset-assert 256) (task-counter uint32 :offset-assert 260) (unknown-pad6 (array uint16) :offset-assert 264) (level-opened uint8 32 :offset-assert 268) @@ -285,7 +285,7 @@ (letterbox-time time-frame :offset-assert 400) (hint-play-time time-frame :offset-assert 408) (display-text-time time-frame :offset-assert 416) - (display-text-handle uint64 :offset-assert 424) + (display-text-handle handle :offset-assert 424) (death-movie-tick int32 :offset-assert 432) (want-auto-save symbol :offset-assert 436) (auto-save-proc handle :offset-assert 440) diff --git a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc index de255ddb53..2f8f3f6397 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc @@ -1670,7 +1670,7 @@ 0 ) (if (zero? (-> gp-0 display-text-handle)) - (set! (-> gp-0 display-text-handle) (the-as uint #f)) + (set! (-> gp-0 display-text-handle) (the-as handle #f)) ) (if (zero? (-> gp-0 game-score)) (set! (-> gp-0 game-score) (new 'global 'boxed-array float 152)) diff --git a/test/decompiler/reference/jak2/engine/game/task/game-task_REF.gc b/test/decompiler/reference/jak2/engine/game/task/game-task_REF.gc index 5794284370..7b5cc1a72b 100644 --- a/test/decompiler/reference/jak2/engine/game/task/game-task_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/game-task_REF.gc @@ -12301,7 +12301,7 @@ ) ) ) - (set! (-> gp-0 unknown-pad5) (new 'global 'boxed-array game-task-node-info 324)) + (set! (-> gp-0 mission-list) (new 'global 'boxed-array game-task-node-info 324)) (dotimes (v1-3 (-> gp-0 sub-task-list length)) (if (-> gp-0 sub-task-list v1-3 info) (set! (-> gp-0 sub-task-list v1-3 info manager) (the-as handle #f)) diff --git a/test/decompiler/reference/jak2/engine/math/matrix_REF.gc b/test/decompiler/reference/jak2/engine/math/matrix_REF.gc index 8593060225..046a82a643 100644 --- a/test/decompiler/reference/jak2/engine/math/matrix_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/matrix_REF.gc @@ -1001,10 +1001,8 @@ ) ;; definition for function matrix-axis-angle! -;; WARN: Return type mismatch matrix vs none. (defun matrix-axis-angle! ((arg0 matrix) (arg1 vector) (arg2 float)) (matrix-axis-sin-cos! arg0 arg1 (sin arg2) (cos arg2)) - (none) ) ;; definition for function matrix-lerp! diff --git a/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc b/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc index aeab375b01..38d85f98ed 100644 --- a/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc @@ -580,9 +580,9 @@ (goto cfg-4) ) (format #t "[~8x] ~A~%" obj 'vector4w-4) - (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) - (format #t "~1Tquad[4] @ #x~X~%" (-> obj data)) - (format #t "~1Tvector[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tdata[16] @ #x~X~%" (-> obj vector)) + (format #t "~1Tquad[4] @ #x~X~%" (-> obj vector)) + (format #t "~1Tvector[4] @ #x~X~%" (-> obj vector)) (label cfg-4) obj ) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc index aeb074c328..c6bb3fe786 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc @@ -11,11 +11,11 @@ :flag-assert #x1b005000cc (:methods (get-trans (_type_ int) vector 20) - (get-quat (_type_) quaternion 21) + (get-quat (_type_ int) quaternion 21) (get-transv (_type_) vector 22) (process-focusable-method-23 (_type_) none 23) - (process-focusable-method-24 (_type_) none 24) - (process-focusable-method-25 (_type_) int 25) + (process-focusable-method-24 (_type_) float 24) + (process-focusable-method-25 (_type_) time-frame 25) (process-focusable-method-26 (_type_) none 26) ) ) @@ -63,7 +63,7 @@ ) ;; definition for method 21 of type process-focusable -(defmethod get-quat process-focusable ((obj process-focusable)) +(defmethod get-quat process-focusable ((obj process-focusable) (arg0 int)) (-> obj root quat) ) @@ -75,10 +75,8 @@ ) ;; definition for method 24 of type process-focusable -;; WARN: Return type mismatch int vs none. (defmethod process-focusable-method-24 process-focusable ((obj process-focusable)) - 0 - (none) + 0.0 ) ;; definition for method 26 of type process-focusable @@ -89,8 +87,9 @@ ) ;; definition for method 25 of type process-focusable +;; WARN: Return type mismatch int vs time-frame. (defmethod process-focusable-method-25 process-focusable ((obj process-focusable)) - 0 + (the-as time-frame 0) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc index b2651ede1a..269f69d708 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc @@ -2817,13 +2817,7 @@ (when s4-1 (set! (-> self control unknown-vector38 quad) (-> (get-trans (the-as process-focusable s4-1) 0) quad)) (set! (-> self control unknown-vector38 y) (+ 4096.0 (-> self control unknown-vector38 y))) - (let* ((s3-2 (-> self control unknown-vector40)) - (a0-15 (the-as process-focusable s4-1)) - (t9-4 (method-of-object a0-15 get-quat)) - ) - 0 - (set! (-> s3-2 quad) (-> (t9-4 a0-15) vec quad)) - ) + (set! (-> self control unknown-vector40 quad) (-> (get-quat (the-as process-focusable s4-1) 0) vec quad)) ) (let ((f28-0 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 0.0 30.0)))) (let ((f26-0 f28-0)) diff --git a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc index a78d14c9bb..2124326a17 100644 --- a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc @@ -1867,11 +1867,11 @@ (when (!= (-> self beard?) v1-248) (cond (v1-248 - (draw-control-method-12 (-> self draw) 2 0) + (draw-control-method-12 (-> self draw) (the-as uint 2) 0) (set! (-> self beard?) #t) ) (else - (draw-control-method-12 (-> self draw) 0 2) + (draw-control-method-12 (-> self draw) (the-as uint 0) 2) (set! (-> self beard?) #f) ) ) diff --git a/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc index 8e8fabe5c5..85e176f5c5 100644 --- a/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc @@ -231,7 +231,7 @@ (new (symbol type) _type_ 0) (initialize (_type_) none 9) (update (_type_) none 10) - (bigmap-method-11 () none 11) + (bigmap-method-11 (_type_ int int int int) none 11) (bigmap-method-12 () none 12) (bigmap-method-13 () none 13) (bigmap-method-14 (_type_) none 14) diff --git a/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc index 2a6ce56b92..b141f64979 100644 --- a/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc @@ -44,7 +44,7 @@ :size-assert #x34 :flag-assert #xb00000034 (:methods - (hud-sprite-method-9 () none 9) + (hud-sprite-method-9 (_type_ dma-buffer level) none 9) (hud-sprite-method-10 () none 10) ) ) @@ -77,13 +77,13 @@ :size-assert #x20 :flag-assert #x1000000020 (:methods - (hud-box-method-9 () none 9) + (hud-box-method-9 (_type_ dma-buffer) none 9) (hud-box-method-10 () none 10) (hud-box-method-11 () none 11) (hud-box-method-12 () none 12) (hud-box-method-13 (_type_ dma-buffer float) int 13) - (hud-box-method-14 () none 14) - (hud-box-method-15 () none 15) + (hud-box-method-14 (_type_) none 14) + (hud-box-method-15 (_type_) none 15) ) ) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc new file mode 100644 index 0000000000..fd10d3d1b7 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc @@ -0,0 +1,8048 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function progress-selected +(defbehavior progress-selected progress ((arg0 int)) + (let ((gp-0 33)) + (cond + ((< 4 (the-as int (logand (-> self clock integral-frame-counter) 7))) + (set! (-> *progress-state* color-flash-counter) 1) + ) + ((< (the-as int (logand (-> self clock integral-frame-counter) 7)) 4) + (set! (-> *progress-state* color-flash-counter) 0) + 0 + ) + ) + (cond + ((zero? (-> *progress-state* color-flash-counter)) + (set-font-color gp-0 0 64 128 128) + (set-font-color gp-0 1 64 128 128) + ) + (else + (set-font-color gp-0 0 255 255 255) + (set-font-color gp-0 1 255 255 255) + ) + ) + gp-0 + ) + ) + +;; definition for function draw-percent-bar +;; WARN: Return type mismatch int vs none. +(defun draw-percent-bar ((arg0 int) (arg1 int) (arg2 float) (arg3 rgba)) + (let* ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s2-0 base)) + ) + (draw-sprite2d-xy s2-0 arg0 arg1 255 14 (new 'static 'rgba :a (-> arg3 a))) + (draw-sprite2d-xy s2-0 arg0 (+ arg1 2) (the int (* 255.0 arg2)) 10 arg3) + (let ((a3-3 (-> s2-0 base))) + (let ((v1-8 (the-as object (-> s2-0 base)))) + (set! (-> (the-as dma-packet v1-8) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-8) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-8) vif1) (new 'static 'vif-tag)) + (set! (-> s2-0 base) (&+ (the-as pointer v1-8) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + gp-0 + (the-as (pointer dma-tag) a3-3) + ) + ) + ) + 0 + (none) + ) + +;; definition for function draw-highlight +(defun draw-highlight ((arg0 int) (arg1 int) (arg2 float)) + (let* ((s3-0 (if (= (get-aspect-ratio) 'aspect4x3) + 70 + 79 + ) + ) + (a3-0 (if (= (get-aspect-ratio) 'aspect4x3) + 374 + 355 + ) + ) + (s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-2 (-> s2-0 base)) + ) + (draw-sprite2d-xy + s2-0 + s3-0 + arg0 + a3-0 + arg1 + (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a (the int (* 64.0 arg2))) + ) + (let ((a3-1 (-> s2-0 base))) + (let ((v1-6 (the-as object (-> s2-0 base)))) + (set! (-> (the-as dma-packet v1-6) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-6) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-6) vif1) (new 'static 'vif-tag)) + (set! (-> s2-0 base) (&+ (the-as pointer v1-6) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + gp-2 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + +;; definition for function draw-busy-loading +(defbehavior draw-busy-loading progress ((arg0 font-context)) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg0 origin x) 82.0) + (set! (-> arg0 origin y) 180.0) + (set! (-> arg0 width) 359.0) + (set! (-> arg0 height) 40.0) + ) + (('aspect16x9) + (set! (-> arg0 origin x) 82.0) + (set! (-> arg0 origin y) 180.0) + (set! (-> arg0 width) 355.0) + (set! (-> arg0 height) 40.0) + ) + ) + (let ((v1-12 arg0)) + (set! (-> v1-12 scale) 0.6) + ) + (let ((a0-5 arg0)) + (set! (-> a0-5 flags) (font-flags kerning middle large)) + ) + (if (< (mod (-> self clock frame-counter) 300) 210) + (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-loading-data) #f) arg0 #f 44 320) + ) + ) + +;; definition for function draw-previous-next +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun draw-previous-next ((arg0 menu-highscores-option) (arg1 font-context) (arg2 symbol)) + (local-vars (sv-16 string) (sv-32 int)) + (let ((s3-0 370)) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg1 origin x) 73.0) + (set! (-> arg1 origin y) 308.0) + (set! (-> arg1 width) 359.0) + (set! (-> arg1 height) 185.0) + ) + (('aspect16x9) + (set! (-> arg1 origin x) 82.0) + (set! (-> arg1 origin y) 328.0) + (set! (-> arg1 width) 355.0) + (set! (-> arg1 height) 185.0) + (set! s3-0 350) + ) + ) + (let ((a0-1 arg1)) + (set! (-> a0-1 flags) (font-flags kerning large)) + ) + (let ((s2-0 arg1)) + (set! (-> s2-0 color) (the-as font-color (progress-selected 200))) + ) + (let ((v1-15 arg1)) + (set! (-> v1-15 scale) 0.6) + ) + (when (or (> (-> arg0 page-index) 0) arg2) + (let ((s2-1 print-game-text)) + (let ((s1-0 format) + (s0-0 (clear *temp-string*)) + ) + (set! sv-16 "~C~S") + (set! sv-32 163) + (let ((a3-0 (lookup-text! *common-text* (game-text-id progress-next) #f))) + (s1-0 s0-0 sv-16 sv-32 a3-0) + ) + ) + (s2-1 *temp-string* arg1 #f 44 320) + ) + ) + (set! arg2 (or (!= (-> arg0 page-index) (+ (-> arg0 num-pages) -1)) arg2)) + (when arg2 + (let ((a0-12 arg1)) + (set! (-> a0-12 flags) (font-flags kerning right large)) + ) + (+! (-> arg1 origin x) (the float s3-0)) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~S~C" (lookup-text! *common-text* (game-text-id progress-next) #f) 161) + (s5-1 *temp-string* arg1 #f 44 320) + ) + ) + ) + 0 + (none) + ) + +;; definition for function draw-up-down +;; WARN: Return type mismatch float vs none. +(defun draw-up-down ((arg0 font-context)) + (let ((s3-0 250) + (s5-0 155) + (s4-0 155) + (f30-0 (-> arg0 origin x)) + (f28-0 (-> arg0 origin y)) + ) + (case (get-aspect-ratio) + (('aspect16x9) + (set! s5-0 170) + ) + ) + (set! (-> arg0 origin x) (the float s3-0)) + (set! (-> arg0 origin y) (the float s5-0)) + (let ((s2-0 print-game-text)) + (format (clear *temp-string*) "~33L~C" 160) + (s2-0 *temp-string* arg0 #f 44 320) + ) + (set! (-> arg0 origin x) (the float s3-0)) + (set! (-> arg0 origin y) (the float (+ s5-0 s4-0))) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 162) + (s5-1 *temp-string* arg0 #f 44 320) + ) + (set! (-> arg0 origin x) f30-0) + (set! (-> arg0 origin y) f28-0) + ) + (none) + ) + +;; definition for function draw-missions-up-down +;; WARN: Return type mismatch float vs none. +(defun draw-missions-up-down ((arg0 font-context)) + (let ((s3-0 250) + (s5-0 116) + (s4-0 191) + (f30-0 (-> arg0 origin x)) + (f28-0 (-> arg0 origin y)) + ) + (set! (-> arg0 origin x) (the float s3-0)) + (set! (-> arg0 origin y) (the float s5-0)) + (let ((s2-0 print-game-text)) + (format (clear *temp-string*) "~33L~C" 160) + (s2-0 *temp-string* arg0 #f 44 320) + ) + (set! (-> arg0 origin x) (the float s3-0)) + (set! (-> arg0 origin y) (the float (+ s5-0 s4-0))) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 162) + (s5-1 *temp-string* arg0 #f 44 320) + ) + (set! (-> arg0 origin x) f30-0) + (set! (-> arg0 origin y) f28-0) + ) + (none) + ) + +;; definition for function draw-scene-up-down +;; WARN: Return type mismatch float vs none. +(defun draw-scene-up-down ((arg0 font-context)) + (let ((s3-0 250) + (s5-0 102) + (s4-0 194) + (f30-0 (-> arg0 origin x)) + (f28-0 (-> arg0 origin y)) + ) + (case (get-aspect-ratio) + (('aspect16x9) + (set! s5-0 92) + (set! s4-0 204) + ) + ) + (set! (-> arg0 origin x) (the float s3-0)) + (set! (-> arg0 origin y) (the float s5-0)) + (let ((s2-0 print-game-text)) + (format (clear *temp-string*) "~33L~C" 160) + (s2-0 *temp-string* arg0 #f 44 320) + ) + (set! (-> arg0 origin x) (the float s3-0)) + (set! (-> arg0 origin y) (the float (+ s5-0 s4-0))) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 162) + (s5-1 *temp-string* arg0 #f 44 320) + ) + (set! (-> arg0 origin x) f30-0) + (set! (-> arg0 origin y) f28-0) + ) + (none) + ) + +;; definition for function begin-scissor +;; WARN: Return type mismatch int vs none. +(defun begin-scissor ((arg0 hud-box) (arg1 progress)) + (cond + ((or (= (-> arg1 current) 'bigmap) (= (-> arg1 next) 'bigmap)) + (set! (-> arg0 min x) 0.0) + (set! (-> arg0 min y) 0.0) + (set! (-> arg0 max x) 512.0) + (set! (-> arg0 max y) 416.0) + ) + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 79.0) + (set! (-> arg0 min y) 38.0) + (set! (-> arg0 max x) 434.0) + (set! (-> arg0 max y) 362.0) + ) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 70.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 329.0) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-1 (-> s4-0 base)) + ) + (hud-box-method-14 arg0) + (let ((a3-0 (-> s4-0 base))) + (let ((v1-23 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-23) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-23) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-23) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-23) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s5-1 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function end-scissor +;; WARN: Return type mismatch int vs none. +(defun end-scissor ((arg0 hud-box) (arg1 float)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-15 arg0) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-7 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-7) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet 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) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function begin-scissor-secret +;; WARN: Return type mismatch int vs none. +(defun begin-scissor-secret ((arg0 hud-box) (arg1 progress)) + (cond + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 79.0) + (set! (-> arg0 min y) 190.0) + (set! (-> arg0 max x) 434.0) + (set! (-> arg0 max y) 315.0) + ) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 173.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 304.0) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-1 (-> s4-0 base)) + ) + (hud-box-method-14 arg0) + (let ((a3-0 (-> s4-0 base))) + (let ((v1-17 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-17) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-17) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-17) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s5-1 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function end-scissor-secret +;; WARN: Return type mismatch int vs none. +(defun end-scissor-secret ((arg0 hud-box) (arg1 float)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-15 arg0) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-7 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-7) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet 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) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function begin-scissor-missions +;; WARN: Return type mismatch int vs none. +(defun begin-scissor-missions ((arg0 hud-box) (arg1 float)) + (cond + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 79.0) + (set! (-> arg0 min y) 130.0) + (set! (-> arg0 max x) 434.0) + (set! (-> arg0 max y) 305.0) + ) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 130.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 305.0) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-1 (-> s4-0 base)) + ) + (hud-box-method-14 arg0) + (let ((a3-0 (-> s4-0 base))) + (let ((v1-17 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-17) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-17) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-17) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s5-1 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function end-scissor-missions +;; WARN: Return type mismatch int vs none. +(defun end-scissor-missions ((arg0 hud-box) (arg1 float)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-15 arg0) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-7 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-7) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet 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) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function begin-scissor-scene +;; WARN: Return type mismatch int vs none. +(defun begin-scissor-scene ((arg0 hud-box)) + (cond + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 79.0) + (set! (-> arg0 min y) 118.0) + (set! (-> arg0 max x) 434.0) + (set! (-> arg0 max y) 294.0) + ) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 116.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 295.0) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-1 (-> s4-0 base)) + ) + (hud-box-method-14 arg0) + (let ((a3-0 (-> s4-0 base))) + (let ((v1-17 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-17) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-17) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-17) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s5-1 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function end-scissor-scene +;; WARN: Return type mismatch int vs none. +(defun end-scissor-scene ((arg0 hud-box) (arg1 float)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-15 arg0) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-7 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-7) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet 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) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function begin-scissor-level +;; WARN: Return type mismatch int vs none. +(defun begin-scissor-level ((arg0 hud-box)) + (cond + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 79.0) + (set! (-> arg0 min y) 118.0) + (set! (-> arg0 max x) 434.0) + (set! (-> arg0 max y) 294.0) + ) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 116.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 295.0) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-1 (-> s4-0 base)) + ) + (hud-box-method-14 arg0) + (let ((a3-0 (-> s4-0 base))) + (let ((v1-17 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-17) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-17) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-17) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s5-1 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function end-scissor-level +;; WARN: Return type mismatch int vs none. +(defun end-scissor-level ((arg0 hud-box) (arg1 float)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-15 arg0) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-7 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-7) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet 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) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function print-language-name +;; WARN: Return type mismatch int vs none. +(defun print-language-name ((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))))) + (set! (-> arg1 alpha) f30-0) + (print-game-text-scaled (lookup-text! *common-text* (-> *language-name-remap* arg0) #f) f30-0 arg1 320) + ) + (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float s5-0))) + ) + (set! (-> arg1 color) (font-color #7efbfb)) + 0 + (none) + ) + +;; definition for function unlocked-secret-menu? +(defun unlocked-secret-menu? ((arg0 game-secrets)) + (or (logtest? arg0 (game-secrets scene-player-1)) + (logtest? arg0 (game-secrets scene-player-2)) + (logtest? arg0 (game-secrets scene-player-3)) + (logtest? arg0 (game-secrets level-select)) + (logtest? arg0 (game-secrets scrap-book-1)) + (logtest? arg0 (game-secrets scrap-book-2)) + (logtest? arg0 (game-secrets scrap-book-3)) + (logtest? arg0 (game-secrets hero-mode)) + ) + ) + +;; definition for function memcard-unlocked-secrets? +;; WARN: Return type mismatch int vs game-secrets. +(defun memcard-unlocked-secrets? ((arg0 symbol)) + (let ((v1-0 *progress-save-info*) + (s5-0 0) + ) + (let ((a0-1 4)) + (when (and v1-0 (= (-> v1-0 formatted) 1) (= (-> v1-0 inited) 1)) + (dotimes (a1-5 a0-1) + (set! s5-0 (logior s5-0 (-> v1-0 file a1-5 secrets))) + ) + ) + ) + (if (unlocked-secret-menu? (the-as game-secrets s5-0)) + (set! (-> *progress-state* secrets-unlocked) #t) + (set! (-> *progress-state* secrets-unlocked) #f) + ) + (when *cheat-mode* + (set! (-> *progress-state* secrets-unlocked) #t) + (set! s5-0 (logior s5-0 #x8fe0)) + ) + (the-as game-secrets (cond + (arg0 + (empty) + s5-0 + ) + (else + (the-as int (unlocked-secret-menu? (the-as game-secrets s5-0))) + ) + ) + ) + ) + ) + +;; definition for function num-unlocked-secret? +(defun num-unlocked-secret? ((arg0 game-secrets)) + "@returns The number of secrets currently unlocked" + (let ((v0-0 0)) + (if (logtest? arg0 (game-secrets scene-player-1)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets scene-player-2)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets scene-player-3)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets level-select)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets scrap-book-1)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets scrap-book-2)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets scrap-book-3)) + (+! v0-0 1) + ) + (if (logtest? arg0 (game-secrets hero-mode)) + (+! v0-0 1) + ) + v0-0 + ) + ) + +;; definition for function print-menu-text +;; WARN: Return type mismatch int vs none. +(defun print-menu-text ((arg0 string) (arg1 float) (arg2 font-context) (arg3 progress)) + (let ((f0-1 (- 1.0 (-> arg3 menu-transition)))) + (let ((v1-1 arg2)) + (set! (-> v1-1 scale) 0.5) + ) + (set! (-> arg2 alpha) f0-1) + ) + (print-game-text arg0 arg2 #f 44 320) + 0 + (none) + ) + +;; definition for function draw-yes-no +;; WARN: Return type mismatch int vs pointer. +(defun draw-yes-no ((arg0 progress) (arg1 font-context)) + (local-vars (a0-5 string)) + (- 1.0 (-> arg0 menu-transition)) + (cond + ((-> *progress-state* yes-no-choice) + (format + (clear *temp-string*) + "~33L~S~32L ~S" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-5 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~32L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-5 *temp-string*) + ) + ) + (print-game-text a0-5 arg1 #f 44 320) + (the-as pointer 0) + ) + +;; definition for function draw-continue-retry +;; WARN: Return type mismatch int vs pointer. +(defun draw-continue-retry ((arg0 progress) (arg1 font-context)) + (local-vars (a0-5 string)) + (- 1.0 (-> arg0 menu-transition)) + (cond + ((-> *progress-state* yes-no-choice) + (format + (clear *temp-string*) + "~33L~S~32L ~S" + (lookup-text! *common-text* (game-text-id progress-memcard-continue?) #f) + (lookup-text! *common-text* (game-text-id progress-unknown-retry?) #f) + ) + (set! a0-5 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~32L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-memcard-continue?) #f) + (lookup-text! *common-text* (game-text-id progress-unknown-retry?) #f) + ) + (set! a0-5 *temp-string*) + ) + ) + (print-game-text a0-5 arg1 #f 44 320) + (the-as pointer 0) + ) + +;; definition for method 10 of type menu-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-option ((obj menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + 0 + (none) + ) + +;; definition for method 10 of type menu-on-off-option +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-8 string) (sv-16 string)) + (let ((s3-0 (if arg3 + (&-> *progress-state* on-off-choice) + (-> obj value-to-modify) + ) + ) + ) + (set! a0-8 (cond + (arg3 + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #f9f9f9)) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + ((-> s3-0 0) + (format + (clear *temp-string*) + "~33L~S~32L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-8 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~32L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-8 *temp-string*) + ) + ) + a0-8 + ) + (else + (let ((s2-3 format) + (s1-2 (clear *temp-string*)) + (s0-2 "~S: ~S") + ) + (set! sv-16 (lookup-text! *common-text* (-> obj name) #f)) + (let ((a3-4 (if (-> s3-0 0) + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + ) + ) + (s2-3 s1-2 s0-2 sv-16 a3-4) + ) + ) + *temp-string* + ) + ) + ) + ) + (print-menu-text a0-8 (-> obj scale) arg1 arg0) + 0 + (none) + ) + +;; definition for method 10 of type menu-yes-no-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-8 string)) + (let ((s3-0 (&-> *progress-state* yes-no-choice))) + (set! a0-8 (cond + (arg3 + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #f9f9f9)) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + ((-> s3-0 0) + (format + (clear *temp-string*) + "~33L~S~32L ~S" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-8 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~32L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-8 *temp-string*) + ) + ) + a0-8 + ) + (else + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + *temp-string* + ) + ) + ) + ) + (print-menu-text a0-8 (-> obj scale) arg1 arg0) + 0 + (none) + ) + +;; definition for method 10 of type menu-video-mode-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-video-mode-option ((obj menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((s3-0 (&-> *progress-state* video-mode-choice)) + (f28-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (f30-0 (-> arg1 origin y)) + ) + (let ((s2-0 (the-as string #f))) + (if (< f28-0 0.0) + (set! f28-0 0.0) + ) + (set! (-> arg1 alpha) f28-0) + (let ((v1-5 arg1)) + (set! (-> v1-5 scale) 0.7) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg1 origin y) (+ 43.0 (-> arg1 origin y))) + ) + (('aspect16x9) + (set! (-> arg1 origin y) (+ 52.0 (-> arg1 origin y))) + ) + ) + (cond + ((and (= (-> *progress-state* graphic-options-item-selected) 3) + (-> *progress-state* graphic-options-item-picked) + ) + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-6 arg1)) + (set! (-> a0-6 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 44 f28-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + (cond + ((= (-> s3-0 0) 'pal) + (format + (clear *temp-string*) + "~33L~S ~35L~S~1L" + (lookup-text! *common-text* (game-text-id progress-refresh-50hz) #f) + (lookup-text! *common-text* (game-text-id progress-refresh-60hz) #f) + ) + (set! s2-0 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S~33L ~S" + (lookup-text! *common-text* (game-text-id progress-refresh-50hz) #f) + (lookup-text! *common-text* (game-text-id progress-refresh-60hz) #f) + ) + (set! s2-0 *temp-string*) + ) + ) + ) + (else + (when (not (and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + ) + (cond + ((= (-> *progress-state* graphic-options-item-selected) 3) + (let ((s2-4 arg1)) + (set! (-> s2-4 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ -9.0 (-> arg1 origin y))) 22 f28-0) + ) + (else + (let ((a0-23 arg1)) + (set! (-> a0-23 color) (font-color #7efbfb)) + ) + ) + ) + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + (cond + ((= (-> s3-0 0) 'pal) + (format + (clear *temp-string*) + "~1L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-refresh-50hz) #f) + (lookup-text! *common-text* (game-text-id progress-refresh-60hz) #f) + ) + (set! s2-0 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~1L~S~1L" + (lookup-text! *common-text* (game-text-id progress-refresh-50hz) #f) + (lookup-text! *common-text* (game-text-id progress-refresh-60hz) #f) + ) + (set! s2-0 *temp-string*) + ) + ) + ) + ) + ) + (if (not (and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + ) + (print-menu-text s2-0 (-> obj scale) arg1 arg0) + ) + ) + (set! (-> arg1 origin y) f30-0) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-unlocked-menu-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((s5-0 (memcard-unlocked-secrets? #t)) + (f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + ) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (let ((v1-4 arg1)) + (set! (-> v1-4 scale) 0.6) + ) + (when (nonzero? (-> obj name)) + (cond + ((= arg2 (-> arg0 option-index)) + (progress-selected 0) + (draw-highlight (the int (+ 8.0 (-> arg1 origin y))) 24 f30-0) + ) + (else + 32 + ) + ) + (set! (-> arg1 origin y) (+ 8.0 (-> arg1 origin y))) + (cond + ((= (-> obj name) (game-text-id progress-main-secrets-scrapbook)) + (cond + ((logtest? s5-0 (game-secrets scrap-book-1)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-scrapbook) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-2 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-mega-scrapbook)) + (cond + ((logtest? s5-0 (game-secrets scrap-book-2)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-mega-scrapbook) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-4 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-4 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-scrapbook-3)) + (cond + ((logtest? s5-0 (game-secrets scrap-book-3)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-scrapbook-3) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-6 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-6 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-1)) + (cond + ((logtest? s5-0 (game-secrets scene-player-1)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-sceneplayer-1) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-8 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-8 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-2)) + (cond + ((logtest? s5-0 (game-secrets scene-player-2)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-sceneplayer-2) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-10 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-10 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-3)) + (cond + ((logtest? s5-0 (game-secrets scene-player-3)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-sceneplayer-3) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-12 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-12 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-hero-mode)) + (cond + ((logtest? s5-0 (game-secrets hero-mode)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-hero-mode) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-14 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-14 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((= (-> obj name) (game-text-id progress-main-secrets-levelselect)) + (cond + ((logtest? s5-0 (game-secrets level-select)) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-main-secrets-levelselect) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (let ((s5-16 print-game-text)) + (format (clear *temp-string*) "?????????") + (s5-16 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-main-menu-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (-> arg1 flags) + (when (and (= (-> arg0 menu-transition) 0.0) (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle)) + (nonzero? (-> obj name)) + (= arg2 (-> arg0 option-index)) + ) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 scale) 0.75) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle large)) + ) + (set! (-> arg1 width) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 235 + 175 + ) + ) + ) + (set! (-> arg1 height) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 80 + 80 + ) + ) + ) + (set! (-> arg1 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 140 + 170 + ) + ) + ) + (set! (-> arg1 origin y) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 180 + 175 + ) + ) + ) + (cond + ((= (-> obj name) (game-text-id progress-root-show-map)) + (when (= (-> *setting-control* user-default language) (language-enum french)) + (let ((v1-18 arg1)) + (set! (-> v1-18 scale) 0.7) + ) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 210 + 200 + ) + ) + ) + (let ((v1-21 arg1)) + (set! (-> v1-21 scale) 0.6) + ) + (let ((v1-23 (-> *bigmap* bigmap-index))) + (cond + ((zero? v1-23) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-locations-pumping-station) #f) + arg1 + #f + 44 + 320 + ) + ) + ((= v1-23 1) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-landing-pad) #f) arg1 #f 44 320) + ) + ((= v1-23 2) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-locations-weapons-factory) #f) + arg1 + #f + 44 + 320 + ) + ) + ((= v1-23 3) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-dig) #f) arg1 #f 44 320) + ) + ((= v1-23 4) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-dig) #f) arg1 #f 44 320) + ) + ((= v1-23 5) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-locations-drill-platform) #f) + arg1 + #f + 44 + 320 + ) + ) + ((= v1-23 6) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-locations-haven-forest) #f) + arg1 + #f + 44 + 320 + ) + ) + ((= v1-23 7) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-fortress) #f) arg1 #f 44 320) + ) + ((= v1-23 8) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-locations-mountain-temple) #f) + arg1 + #f + 44 + 320 + ) + ) + ((= v1-23 9) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-nest) #f) arg1 #f 44 320) + ) + ((= v1-23 11) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-palace-roof) #f) arg1 #f 44 320) + ) + ((= v1-23 12) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-palace) #f) arg1 #f 44 320) + ) + ((= v1-23 13) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-dead-town) #f) arg1 #f 44 320) + ) + ((= v1-23 14) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-sewer) #f) arg1 #f 44 320) + ) + ((= v1-23 15) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-sewer) #f) arg1 #f 44 320) + ) + ((= v1-23 16) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-sewer) #f) arg1 #f 44 320) + ) + ((= v1-23 17) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-strip-mine) #f) arg1 #f 44 320) + ) + ((= v1-23 18) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-mars-tomb) #f) arg1 #f 44 320) + ) + ((= v1-23 19) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-underport) #f) arg1 #f 44 320) + ) + ((= v1-23 20) + (print-game-text (lookup-text! *common-text* (game-text-id progress-locations-haven-city) #f) arg1 #f 44 320) + ) + ) + ) + ) + (else + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + ) + ) + ) + 0 + (none) + ) + +;; definition for function draw-savegame-box +(defun draw-savegame-box ((arg0 menu-option) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (set! (-> arg0 box 0 min x) arg1) + (set! (-> arg0 box 0 max x) arg2) + (set! (-> arg0 box 0 min y) arg3) + (set! (-> arg0 box 0 max y) arg4) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + ((method-of-type hud-box hud-box-method-9) (the-as hud-box (-> arg0 box)) s5-0) + (let ((a3-1 (-> s5-0 base))) + (let ((v1-7 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-7) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet 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) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + +;; definition for function get-level-icon-id-01 +;; WARN: Return type mismatch uint vs texture-id. +(defun get-level-icon-id-01 ((arg0 int)) + "TODO - Icon id enum perhaps?" + (let ((v0-0 (the-as uint #xc9303600))) + (cond + ((zero? arg0) + (set! v0-0 (the-as uint #xc9304800)) + ) + ((= arg0 1) + (set! v0-0 (the-as uint #xc9304000)) + ) + ((= arg0 2) + (set! v0-0 (the-as uint #xc9307000)) + ) + ((= arg0 3) + (set! v0-0 (the-as uint #xc9305800)) + ) + ((= arg0 4) + (set! v0-0 (the-as uint #xc9306800)) + ) + ((= arg0 5) + (set! v0-0 (the-as uint #xc9307400)) + ) + ((= arg0 6) + (set! v0-0 (the-as uint #xc9303600)) + ) + ((= arg0 7) + (set! v0-0 (the-as uint #xc9306c00)) + ) + ((= arg0 8) + (set! v0-0 (the-as uint #xc9305c00)) + ) + ((= arg0 9) + (set! v0-0 (the-as uint #xc9305400)) + ) + ((= arg0 10) + (set! v0-0 (the-as uint #xc9305000)) + ) + ((= arg0 11) + (set! v0-0 (the-as uint #xc9306400)) + ) + ((= arg0 12) + (set! v0-0 (the-as uint #xc9307800)) + ) + ((= arg0 13) + (set! v0-0 (the-as uint #xc9304c00)) + ) + ((= arg0 14) + (set! v0-0 (the-as uint #xc9303a00)) + ) + ((= arg0 15) + (set! v0-0 (the-as uint #xc9307c00)) + ) + ((= arg0 16) + (set! v0-0 (the-as uint #xc9304400)) + ) + ((= arg0 17) + (set! v0-0 (the-as uint #xc9306000)) + ) + ) + (the-as texture-id v0-0) + ) + ) + +;; definition for function get-level-icon-id-02 +;; WARN: Return type mismatch uint vs texture-id. +(defun get-level-icon-id-02 ((arg0 int)) + "TODO - Icon id enum perhaps?" + (let ((v0-0 (the-as uint #xc9303700))) + (cond + ((zero? arg0) + (set! v0-0 (the-as uint #xc9304900)) + ) + ((= arg0 1) + (set! v0-0 (the-as uint #xc9304100)) + ) + ((= arg0 2) + (set! v0-0 (the-as uint #xc9307100)) + ) + ((= arg0 3) + (set! v0-0 (the-as uint #xc9305900)) + ) + ((= arg0 4) + (set! v0-0 (the-as uint #xc9306900)) + ) + ((= arg0 5) + (set! v0-0 (the-as uint #xc9307500)) + ) + ((= arg0 6) + (set! v0-0 (the-as uint #xc9303700)) + ) + ((= arg0 7) + (set! v0-0 (the-as uint #xc9306d00)) + ) + ((= arg0 8) + (set! v0-0 (the-as uint #xc9305d00)) + ) + ((= arg0 9) + (set! v0-0 (the-as uint #xc9305500)) + ) + ((= arg0 10) + (set! v0-0 (the-as uint #xc9305100)) + ) + ((= arg0 11) + (set! v0-0 (the-as uint #xc9306500)) + ) + ((= arg0 12) + (set! v0-0 (the-as uint #xc9307900)) + ) + ((= arg0 13) + (set! v0-0 (the-as uint #xc9304d00)) + ) + ((= arg0 14) + (set! v0-0 (the-as uint #xc9303b00)) + ) + ((= arg0 15) + (set! v0-0 (the-as uint #xc9307d00)) + ) + ((= arg0 16) + (set! v0-0 (the-as uint #xc9304500)) + ) + ((= arg0 17) + (set! v0-0 (the-as uint #xc9306100)) + ) + ) + (the-as texture-id v0-0) + ) + ) + +;; definition for function get-level-icon-id-03 +;; WARN: Return type mismatch uint vs texture-id. +(defun get-level-icon-id-03 ((arg0 int)) + "TODO - Icon id enum perhaps?" + (let ((v0-0 (the-as uint #xc9303800))) + (cond + ((zero? arg0) + (set! v0-0 (the-as uint #xc9304a00)) + ) + ((= arg0 1) + (set! v0-0 (the-as uint #xc9304200)) + ) + ((= arg0 2) + (set! v0-0 (the-as uint #xc9307200)) + ) + ((= arg0 3) + (set! v0-0 (the-as uint #xc9305a00)) + ) + ((= arg0 4) + (set! v0-0 (the-as uint #xc9306a00)) + ) + ((= arg0 5) + (set! v0-0 (the-as uint #xc9307600)) + ) + ((= arg0 6) + (set! v0-0 (the-as uint #xc9303800)) + ) + ((= arg0 7) + (set! v0-0 (the-as uint #xc9306e00)) + ) + ((= arg0 8) + (set! v0-0 (the-as uint #xc9305e00)) + ) + ((= arg0 9) + (set! v0-0 (the-as uint #xc9305600)) + ) + ((= arg0 10) + (set! v0-0 (the-as uint #xc9305200)) + ) + ((= arg0 11) + (set! v0-0 (the-as uint #xc9306600)) + ) + ((= arg0 12) + (set! v0-0 (the-as uint #xc9307a00)) + ) + ((= arg0 13) + (set! v0-0 (the-as uint #xc9304e00)) + ) + ((= arg0 14) + (set! v0-0 (the-as uint #xc9303c00)) + ) + ((= arg0 15) + (set! v0-0 (the-as uint #xc9307e00)) + ) + ((= arg0 16) + (set! v0-0 (the-as uint #xc9304600)) + ) + ((= arg0 17) + (set! v0-0 (the-as uint #xc9306200)) + ) + ) + (the-as texture-id v0-0) + ) + ) + +;; definition for function get-level-icon-id-04 +;; WARN: Return type mismatch uint vs texture-id. +(defun get-level-icon-id-04 ((arg0 int)) + "TODO - Icon id enum perhaps?" + (let ((v0-0 (the-as uint #xc9303900))) + (cond + ((zero? arg0) + (set! v0-0 (the-as uint #xc9304b00)) + ) + ((= arg0 1) + (set! v0-0 (the-as uint #xc9304300)) + ) + ((= arg0 2) + (set! v0-0 (the-as uint #xc9307300)) + ) + ((= arg0 3) + (set! v0-0 (the-as uint #xc9305b00)) + ) + ((= arg0 4) + (set! v0-0 (the-as uint #xc9306b00)) + ) + ((= arg0 5) + (set! v0-0 (the-as uint #xc9307700)) + ) + ((= arg0 6) + (set! v0-0 (the-as uint #xc9303900)) + ) + ((= arg0 7) + (set! v0-0 (the-as uint #xc9306f00)) + ) + ((= arg0 8) + (set! v0-0 (the-as uint #xc9305f00)) + ) + ((= arg0 9) + (set! v0-0 (the-as uint #xc9305700)) + ) + ((= arg0 10) + (set! v0-0 (the-as uint #xc9305300)) + ) + ((= arg0 11) + (set! v0-0 (the-as uint #xc9306700)) + ) + ((= arg0 12) + (set! v0-0 (the-as uint #xc9307b00)) + ) + ((= arg0 13) + (set! v0-0 (the-as uint #xc9304f00)) + ) + ((= arg0 14) + (set! v0-0 (the-as uint #xc9303d00)) + ) + ((= arg0 15) + (set! v0-0 (the-as uint #xc9307f00)) + ) + ((= arg0 16) + (set! v0-0 (the-as uint #xc9304700)) + ) + ((= arg0 17) + (set! v0-0 (the-as uint #xc9306300)) + ) + ) + (the-as texture-id v0-0) + ) + ) + +;; definition for function draw-decoration +;; INFO: Used lq/sq +(defun draw-decoration ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 int) (arg4 symbol) (arg5 float)) + (local-vars + (sv-16 symbol) + (sv-32 float) + (sv-48 int) + (sv-64 int) + (sv-80 (function string font-context symbol int int float)) + (sv-96 int) + ) + (set! sv-96 arg3) + (set! sv-16 arg4) + (set! sv-32 arg5) + (let ((gp-0 70) + (s5-0 120) + ) + (set! sv-48 87) + (let ((s3-0 375) + (s2-0 210) + ) + (set! sv-64 0) + (cond + ((not sv-16) + (case (get-aspect-ratio) + (('aspect4x3) + (set! gp-0 69) + (set! s5-0 118) + (set! sv-48 80) + (set! s3-0 375) + (set! s2-0 210) + ) + (('aspect16x9) + (set! gp-0 79) + (set! s5-0 118) + (set! sv-48 68) + (set! s3-0 356) + (set! s2-0 244) + ) + ) + ) + (else + (case (get-aspect-ratio) + (('aspect4x3) + (set! gp-0 70) + (set! s5-0 116) + (set! sv-48 78) + (set! s3-0 375) + (set! s2-0 179) + ) + (('aspect16x9) + (set! gp-0 79) + (set! s5-0 108) + (set! sv-48 58) + (set! s3-0 356) + (set! s2-0 185) + (set! sv-64 20) + sv-64 + ) + ) + ) + ) + (let ((v1-20 arg1)) + (set! (-> v1-20 scale) sv-32) + ) + (set! (-> arg1 origin y) (the float sv-48)) + (set! (-> arg1 height) 50.0) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 flags) (font-flags kerning middle large)) + ) + (set! sv-80 print-game-text) + (let* ((a0-3 *common-text*) + (t9-2 (method-of-object a0-3 lookup-text!)) + (a2-1 #f) + (a0-4 (t9-2 a0-3 (the-as game-text-id sv-96) a2-1)) + (a1-2 arg1) + (a2-2 #f) + (a3-1 44) + (t0-1 320) + ) + (sv-80 a0-4 a1-2 a2-2 a3-1 t0-1) + ) + (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 arg2))) + (draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s3-0)) (the float s5-0) (the float s5-0)) + (when sv-16 + (+! (-> arg1 origin y) (the float sv-64)) + (draw-savegame-box + arg0 + (the float gp-0) + (the float (+ gp-0 s3-0)) + (the float (+ s5-0 s2-0)) + (the float (+ s5-0 s2-0)) + ) + ) + (let* ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s1-1 (-> s0-1 base)) + ) + (draw-sprite2d-xy + s0-1 + gp-0 + s5-0 + s3-0 + s2-0 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 arg2))) + ) + (let ((a3-5 (-> s0-1 base))) + (let ((v1-41 (the-as object (-> s0-1 base)))) + (set! (-> (the-as dma-packet v1-41) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-41) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-41) vif1) (new 'static 'vif-tag)) + (set! (-> s0-1 base) (&+ (the-as pointer v1-41) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s1-1 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + +;; definition for function draw-missions-decoration +;; INFO: Used lq/sq +(defun draw-missions-decoration ((arg0 menu-missions-option) (arg1 font-context) (arg2 float) (arg3 game-text-id)) + (local-vars (sv-16 int) (sv-32 (function string font-context symbol int int float)) (sv-48 font-context)) + (set! sv-48 arg1) + (let ((s2-0 arg2) + (s0-0 arg3) + (gp-0 70) + (s5-0 120) + ) + (set! sv-16 87) + (let ((s4-0 375) + (s3-0 210) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (set! gp-0 70) + (set! s5-0 130) + (set! sv-16 85) + (set! s4-0 375) + (set! s3-0 175) + ) + (('aspect16x9) + (set! gp-0 79) + (set! s5-0 130) + (set! sv-16 68) + (set! s4-0 356) + (set! s3-0 175) + ) + ) + (let ((v1-9 sv-48)) + (set! (-> v1-9 scale) 0.95) + ) + (set! (-> sv-48 height) 50.0) + (set! (-> sv-48 origin y) (the float sv-16)) + (let ((a0-2 sv-48)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (set! sv-32 print-game-text) + (let ((a0-4 (lookup-text! *common-text* s0-0 #f)) + (a2-2 #f) + (a3-1 44) + (t0-0 320) + ) + (sv-32 a0-4 sv-48 a2-2 a3-1 t0-0) + ) + (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 s2-0))) + (draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s4-0)) (the float s5-0) (the float s5-0)) + (draw-savegame-box + arg0 + (the float gp-0) + (the float (+ gp-0 s4-0)) + (the float (+ s5-0 s3-0)) + (the float (+ s5-0 s3-0)) + ) + (let* ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s1-1 (-> s0-1 base)) + ) + (draw-sprite2d-xy + s0-1 + gp-0 + s5-0 + s4-0 + s3-0 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 s2-0))) + ) + (let ((a3-5 (-> s0-1 base))) + (let ((v1-28 (the-as object (-> s0-1 base)))) + (set! (-> (the-as dma-packet v1-28) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-28) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-28) vif1) (new 'static 'vif-tag)) + (set! (-> s0-1 base) (&+ (the-as pointer v1-28) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s1-1 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + +;; definition for function draw-sound-options-decoration +;; INFO: Used lq/sq +(defun draw-sound-options-decoration ((arg0 menu-slider-option) (arg1 font-context) (arg2 float) (arg3 symbol) (arg4 game-text-id)) + (local-vars + (sv-16 font-context) + (sv-32 int) + (sv-48 (function string font-context symbol int int float)) + (sv-64 symbol) + ) + (set! sv-16 arg1) + (let ((s2-0 arg2)) + (set! sv-64 arg3) + (let ((s0-0 arg4) + (gp-0 70) + (s5-0 120) + ) + (set! sv-32 87) + (let ((s4-0 375) + (s3-0 210) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (set! gp-0 70) + (set! s5-0 120) + (set! sv-32 83) + (set! s4-0 375) + (set! s3-0 208) + ) + (('aspect16x9) + (set! gp-0 79) + (set! s5-0 118) + (set! sv-32 68) + (set! s4-0 356) + (set! s3-0 244) + ) + ) + (let ((v1-9 sv-16)) + (set! (-> v1-9 scale) 0.95) + ) + (set! (-> sv-16 origin y) (the float sv-32)) + (set! (-> sv-16 height) 50.0) + (let ((a0-2 sv-16)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (set! (-> sv-16 origin x) 80.0) + (let ((a0-3 sv-16)) + (set! (-> a0-3 flags) (font-flags kerning middle large)) + ) + (set! sv-48 print-game-text) + (let* ((a0-4 *common-text*) + (t9-1 (method-of-object a0-4 lookup-text!)) + (a2-1 #f) + (a0-5 (t9-1 a0-4 (the-as game-text-id sv-64) a2-1)) + (a1-2 sv-16) + (a2-2 #f) + (a3-1 44) + (t0-1 320) + ) + (sv-48 a0-5 a1-2 a2-2 a3-1 t0-1) + ) + (set! (-> sv-16 origin x) (the float (+ gp-0 65))) + (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 s2-0))) + (draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s4-0)) (the float s5-0) (the float s5-0)) + (if s0-0 + (draw-savegame-box + arg0 + (the float gp-0) + (the float (+ gp-0 s4-0)) + (the float (+ s5-0 s3-0)) + (the float (+ s5-0 s3-0)) + ) + ) + (let* ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s1-1 (-> s0-1 base)) + ) + (draw-sprite2d-xy + s0-1 + gp-0 + s5-0 + s4-0 + s3-0 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 s2-0))) + ) + (let ((a3-5 (-> s0-1 base))) + (let ((v1-34 (the-as object (-> s0-1 base)))) + (set! (-> (the-as dma-packet v1-34) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-34) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-34) vif1) (new 'static 'vif-tag)) + (set! (-> s0-1 base) (&+ (the-as pointer v1-34) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s1-1 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + ) + +;; definition for function draw-decoration-secrets +;; INFO: Used lq/sq +(defun draw-decoration-secrets ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 game-text-id)) + (local-vars (sv-16 int) (sv-32 (function string font-context symbol int int float)) (sv-48 font-context)) + (set! sv-48 arg1) + (let ((s2-0 arg2) + (s0-0 arg3) + (gp-0 70) + (s5-0 110) + ) + 120 + (set! sv-16 87) + (let ((s4-0 375) + (s3-0 210) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (set! gp-0 69) + (set! s5-0 172) + (set! sv-16 87) + (set! s4-0 375) + (set! s3-0 132) + ) + (('aspect16x9) + (set! gp-0 79) + (set! s5-0 188) + 188 + (set! sv-16 68) + (set! s4-0 356) + (set! s3-0 128) + ) + ) + (let ((v1-11 sv-48)) + (set! (-> v1-11 scale) 0.95) + ) + (set! (-> sv-48 origin y) (the float sv-16)) + (set! (-> sv-48 height) 50.0) + (let ((a0-2 sv-48)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (set! sv-32 print-game-text) + (let ((a0-4 (lookup-text! *common-text* s0-0 #f)) + (a2-2 #f) + (a3-1 44) + (t0-0 320) + ) + (sv-32 a0-4 sv-48 a2-2 a3-1 t0-0) + ) + (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 s2-0))) + (draw-savegame-box arg0 (the float gp-0) (the float (+ gp-0 s4-0)) (the float s5-0) (the float s5-0)) + (draw-savegame-box + arg0 + (the float gp-0) + (the float (+ gp-0 s4-0)) + (the float (+ s5-0 s3-0)) + (the float (+ s5-0 s3-0)) + ) + (let* ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s1-1 (-> s0-1 base)) + ) + (draw-sprite2d-xy + s0-1 + gp-0 + s5-0 + s4-0 + s3-0 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 s2-0))) + ) + (let ((a3-5 (-> s0-1 base))) + (let ((v1-30 (the-as object (-> s0-1 base)))) + (set! (-> (the-as dma-packet v1-30) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-30) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-30) vif1) (new 'static 'vif-tag)) + (set! (-> s0-1 base) (&+ (the-as pointer v1-30) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s1-1 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + +;; definition for function draw-decoration-load-save +;; INFO: Used lq/sq +(defun draw-decoration-load-save ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 int)) + (local-vars + (sv-16 int) + (sv-32 int) + (sv-48 (function string font-context symbol int int float)) + (sv-64 int) + (sv-80 font-context) + ) + (set! sv-80 arg1) + (let ((s4-0 arg2)) + (set! sv-64 arg3) + (let ((s0-0 70) + (gp-0 120) + (s5-0 120) + ) + 120 + (set! sv-16 87) + (set! sv-32 375) + (let ((s3-0 200) + (s2-0 210) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (set! s0-0 69) + (set! gp-0 245) + (set! s5-0 110) + (set! sv-16 80) + (set! sv-32 375) + (set! s3-0 200) + (set! s2-0 218) + ) + (('aspect16x9) + (set! s0-0 79) + (set! gp-0 245) + (set! s5-0 110) + (set! sv-16 80) + (set! sv-32 355) + (set! s3-0 190) + (set! s2-0 248) + ) + ) + (let ((v1-13 sv-80)) + (set! (-> v1-13 scale) 0.65) + ) + (when (or (= (-> *setting-control* user-default language) (language-enum french)) + (= (-> *setting-control* user-default language) (language-enum spanish)) + (= (-> *setting-control* user-default language) (language-enum italian)) + ) + (let ((v1-24 sv-80)) + (set! (-> v1-24 scale) 0.5) + ) + ) + (set! (-> sv-80 origin y) (the float sv-16)) + (set! (-> sv-80 origin x) (the float s0-0)) + (let ((a0-6 sv-80)) + (set! (-> a0-6 flags) (font-flags kerning middle large)) + ) + (let ((a0-7 sv-80)) + (set! (-> a0-7 color) (font-color #7efbfb)) + ) + (set! sv-48 print-game-text) + (let* ((a0-8 *common-text*) + (t9-1 (method-of-object a0-8 lookup-text!)) + (a2-1 #f) + (a0-9 (t9-1 a0-8 (the-as game-text-id sv-64) a2-1)) + (a2-2 #f) + (a3-1 44) + (t0-0 320) + ) + (sv-48 a0-9 sv-80 a2-2 a3-1 t0-0) + ) + (set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 s4-0))) + (draw-savegame-box arg0 (the float s0-0) (the float (+ s0-0 sv-32)) (the float s5-0) (the float s5-0)) + (draw-savegame-box + arg0 + (the float (+ s0-0 sv-32)) + (the float (+ s0-0 sv-32)) + (the float s5-0) + (the float s5-0) + ) + (let* ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s1-1 (-> s0-1 base)) + ) + (draw-sprite2d-xy + s0-1 + gp-0 + s5-0 + s3-0 + s2-0 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 s4-0))) + ) + (let ((a3-5 (-> s0-1 base))) + (let ((v1-45 (the-as object (-> s0-1 base)))) + (set! (-> (the-as dma-packet v1-45) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-45) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-45) vif1) (new 'static 'vif-tag)) + (set! (-> s0-1 base) (&+ (the-as pointer v1-45) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s1-1 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 10 of type menu-memcard-slot-option +;; INFO: Used lq/sq +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 24 signed mismatch +;; WARN: Stack slot offset 28 signed mismatch +;; WARN: Stack slot offset 32 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (v0-74 pointer) + (sv-16 float) + (sv-20 int) + (sv-24 float) + (sv-28 float) + (sv-32 float) + (sv-36 float) + (sv-40 int) + (sv-48 int) + (sv-56 int) + (sv-64 int) + (sv-72 int) + (sv-80 int) + (sv-88 int) + (sv-96 string) + (sv-112 int) + ) + (set! sv-16 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (set! sv-20 (-> arg0 option-index)) + (set! sv-24 (-> arg1 origin x)) + (set! sv-28 (-> arg1 origin y)) + (set! sv-32 (-> arg1 width)) + (set! sv-36 (-> arg1 height)) + (set! sv-40 (if (= (get-aspect-ratio) 'aspect4x3) + 300 + 305 + ) + ) + (set! sv-48 (if (= (get-aspect-ratio) 'aspect4x3) + 140 + 140 + ) + ) + (set! sv-56 (if (= (get-aspect-ratio) 'aspect4x3) + 64 + 48 + ) + ) + (set! sv-64 69) + (set! sv-72 110) + (set! sv-80 176) + (set! sv-88 54) + (if (< sv-16 0.0) + (set! sv-16 (the-as float 0.0)) + ) + (set! (-> arg1 alpha) sv-16) + (set! v0-74 + (cond + ((not (-> *bigmap* progress-minimap)) + (draw-busy-loading arg1) + v0-74 + ) + (else + (let ((s2-3 arg1)) + (set! (-> s2-3 color) (if (= arg2 sv-20) + (the-as font-color (progress-selected 0)) + (font-color #7efbfb) + ) + ) + ) + (cond + ((= *save-options-title* (-> arg0 current-options)) + (set! (-> arg1 origin y) 80.0) + (set! (-> arg1 height) 52.0) + (+! (-> arg1 origin y) (the float (* 42 (+ arg2 1)))) + (set! (-> arg1 origin x) (+ -100.0 (-> arg1 origin x))) + ) + (else + (case (get-aspect-ratio) + (('aspect16x9) + (set! (-> arg1 origin y) 74.0) + (set! (-> arg1 height) 42.0) + (+! (-> arg1 origin y) (the float (* 60 (+ arg2 1)))) + (set! (-> arg1 origin x) (+ -90.0 (-> arg1 origin x))) + ) + (('aspect4x3) + (set! (-> arg1 origin y) 74.0) + (set! (-> arg1 height) 42.0) + (+! (-> arg1 origin y) (the float (* 54 (+ arg2 1)))) + (set! (-> arg1 origin x) (+ -90.0 (-> arg1 origin x))) + ) + ) + ) + ) + (set-vector! (-> obj box 0 color) 64 128 128 (the int (* 128.0 sv-16))) + (when (= arg2 sv-20) + (cond + ((!= *save-options-title* (-> arg0 current-options)) + (case (get-aspect-ratio) + (('aspect16x9) + (set! sv-64 79) + (set! sv-72 110) + (set! sv-80 166) + (set! sv-88 62) + ) + ) + (draw-savegame-box + obj + (the float sv-64) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 (* sv-88 arg2))) + (the float (+ sv-72 (* sv-88 arg2))) + ) + (when (!= arg2 3) + (draw-savegame-box + obj + (the float sv-64) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + ) + (draw-savegame-box + obj + (the float (+ sv-64 sv-80)) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + (the float (+ (* sv-88 4) 2 sv-72)) + ) + ) + (draw-savegame-box + obj + (the float (+ sv-64 sv-80)) + (the float (+ sv-64 sv-80)) + (the float sv-72) + (the float (+ sv-72 (* sv-88 arg2))) + ) + (let* ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-4 (-> s1-0 base)) + ) + (draw-sprite2d-xy + s1-0 + sv-64 + (+ sv-72 (* sv-88 arg2)) + sv-80 + sv-88 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 sv-16))) + ) + (let ((a3-14 (-> s1-0 base))) + (let ((v1-95 (the-as object (-> s1-0 base)))) + (set! (-> (the-as dma-packet v1-95) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-95) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-95) vif1) (new 'static 'vif-tag)) + (set! (-> s1-0 base) (&+ (the-as pointer v1-95) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s2-4 + (the-as (pointer dma-tag) a3-14) + ) + ) + ) + ) + ((= *save-options-title* (-> arg0 current-options)) + (set! sv-88 42) + (let ((v0-13 (get-aspect-ratio))) + (when (= v0-13 'aspect16x9) + (set! sv-64 79) + (set! sv-72 110) + (set! sv-80 166) + (set! sv-88 42) + (draw-savegame-box + obj + (the float (+ sv-64 sv-80)) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + (the float (+ sv-72 (* 6 sv-88))) + ) + ) + ) + (draw-savegame-box + obj + (the float sv-64) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 (* sv-88 arg2))) + (the float (+ sv-72 (* sv-88 arg2))) + ) + (when (!= arg2 4) + (draw-savegame-box + obj + (the float sv-64) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + ) + (draw-savegame-box + obj + (the float (+ sv-64 sv-80)) + (the float (+ sv-64 sv-80)) + (the float (+ sv-72 sv-88 (* sv-88 arg2))) + (the float (+ (* 5 sv-88) 2 sv-72)) + ) + ) + (draw-savegame-box + obj + (the float (+ sv-64 sv-80)) + (the float (+ sv-64 sv-80)) + (the float sv-72) + (the float (+ sv-72 (* sv-88 arg2))) + ) + (let* ((s1-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-5 (-> s1-1 base)) + ) + (draw-sprite2d-xy + s1-1 + sv-64 + (+ sv-72 (* sv-88 arg2)) + sv-80 + sv-88 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 sv-16))) + ) + (let ((a3-32 (-> s1-1 base))) + (let ((v1-164 (the-as object (-> s1-1 base)))) + (set! (-> (the-as dma-packet v1-164) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-164) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-164) vif1) (new 'static 'vif-tag)) + (set! (-> s1-1 base) (&+ (the-as pointer v1-164) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s2-5 + (the-as (pointer dma-tag) a3-32) + ) + ) + ) + ) + ) + ) + (cond + ((and *progress-save-info* + (= (-> *progress-save-info* formatted) 1) + (= (-> *progress-save-info* inited) 1) + (= (-> *progress-save-info* file arg2 present) 1) + ) + (cond + ((= arg2 sv-20) + (let ((v1-185 arg1)) + (set! (-> v1-185 scale) 0.8) + ) + ) + (else + (let ((v1-186 arg1)) + (set! (-> v1-186 scale) 0.6) + ) + ) + ) + (let ((a0-40 arg1)) + (set! (-> a0-40 flags) (font-flags kerning large)) + ) + (+! (-> arg1 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 100 + 105 + ) + ) + ) + (let ((s2-7 print-game-text)) + (let ((s1-2 format) + (s0-0 (clear *temp-string*)) + ) + (set! sv-96 "~S ~D") + (let ((a2-28 (lookup-text! *common-text* (game-text-id progress-unknown-game) #f)) + (a3-33 (+ arg2 1)) + ) + (s1-2 s0-0 sv-96 a2-28 a3-33) + ) + ) + (s2-7 *temp-string* arg1 #f 44 320) + ) + (let ((a0-45 arg1)) + (set! (-> a0-45 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin x) 250.0) + (set! (-> arg1 origin y) 110.0) + (set! (-> arg1 width) 170.0) + (set! (-> arg1 height) 190.0) + (let ((s2-8 (-> *progress-save-info* file arg2 level-index))) + (when (= arg2 sv-20) + (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 sv-16))) + (set-vector! (-> obj sprites 1 color) 128 128 128 (the int (* 128.0 sv-16))) + (set! (-> obj sprites 1 pos z) #xffffff) + (set! (-> obj sprites 1 pos w) 1) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (get-level-icon-id-01 (the-as int s2-8)))) + (set! (-> obj sprites 1 scale-x) 1.0) + (set! (-> obj sprites 1 scale-y) 1.0) + (set-hud-piece-position! (-> obj sprites 1) sv-40 sv-48) + (set-vector! (-> obj sprites 2 color) 128 128 128 (the int (* 128.0 sv-16))) + (set! (-> obj sprites 2 pos z) #xffffff) + (set! (-> obj sprites 2 pos w) 1) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (get-level-icon-id-02 (the-as int s2-8)))) + (set! (-> obj sprites 2 scale-x) 1.0) + (set! (-> obj sprites 2 scale-y) 1.0) + (set-hud-piece-position! (-> obj sprites 2) (+ sv-40 sv-56) sv-48) + (set-vector! (-> obj sprites 3 color) 128 128 128 (the int (* 128.0 sv-16))) + (set! (-> obj sprites 3 pos z) #xffffff) + (set! (-> obj sprites 3 pos w) 1) + (set! (-> obj sprites 3 tex) (lookup-texture-by-id (get-level-icon-id-03 (the-as int s2-8)))) + (set! (-> obj sprites 3 scale-x) 1.0) + (set! (-> obj sprites 3 scale-y) 1.0) + (set-hud-piece-position! (-> obj sprites 3) sv-40 (+ sv-48 64)) + (set-vector! (-> obj sprites 4 color) 128 128 128 (the int (* 128.0 sv-16))) + (set! (-> obj sprites 4 pos z) #xffffff) + (set! (-> obj sprites 4 pos w) 1) + (set! (-> obj sprites 4 tex) (lookup-texture-by-id (get-level-icon-id-04 (the-as int s2-8)))) + (set! (-> obj sprites 4 scale-x) 1.0) + (set! (-> obj sprites 4 scale-y) 1.0) + (set-hud-piece-position! (-> obj sprites 4) (+ sv-40 sv-56) (+ sv-48 64)) + (let* ((s1-7 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-9 (-> s1-7 base)) + ) + (hud-sprite-method-9 (-> obj sprites 1) s1-7 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 2) s1-7 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 3) s1-7 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 4) s1-7 (-> *level* default-level)) + (let ((a3-35 (-> s1-7 base))) + (let ((v1-237 (the-as object (-> s1-7 base)))) + (set! (-> (the-as dma-packet v1-237) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-237) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-237) vif1) (new 'static 'vif-tag)) + (set! (-> s1-7 base) (&+ (the-as pointer v1-237) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s2-9 + (the-as (pointer dma-tag) a3-35) + ) + ) + ) + (let ((v1-245 arg1)) + (set! (-> v1-245 scale) 0.6) + ) + (set! (-> arg1 origin x) 265.0) + (set! (-> arg1 origin y) 263.0) + (set! (-> arg1 width) 170.0) + (set! (-> arg1 height) 52.0) + (set! (-> obj sprites 0 scale-x) 0.7) + (set! (-> obj sprites 0 scale-y) 0.7) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 265 263) + (let* ((s1-8 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-10 (-> s1-8 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + s1-8 + (-> *level* default-level) + ) + (let ((a3-36 (-> s1-8 base))) + (let ((v1-260 (the-as object (-> s1-8 base)))) + (set! (-> (the-as dma-packet v1-260) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-260) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-260) vif1) (new 'static 'vif-tag)) + (set! (-> s1-8 base) (&+ (the-as pointer v1-260) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s2-10 + (the-as (pointer dma-tag) a3-36) + ) + ) + ) + (set! (-> arg1 origin y) (+ 1.0 (-> arg1 origin y))) + (set! (-> arg1 origin x) (+ 28.0 (-> arg1 origin x))) + (let* ((v1-272 (-> *progress-save-info* file arg2 game-time0)) + (v1-273 (logior (shl (the-as int (-> *progress-save-info* file arg2 game-time1)) 32) v1-272)) + (s2-11 (/ (the-as int v1-273) #x107ac0)) + ) + (set! sv-112 (/ (mod (the-as int v1-273) #x107ac0) #x4650)) + (let ((s1-9 print-game-text)) + (format (clear *temp-string*) "~2,'0D:~2,'0D" s2-11 sv-112) + (s1-9 *temp-string* arg1 #f 44 320) + ) + ) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 368 263) + (let* ((s1-10 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-12 (-> s1-10 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + s1-10 + (-> *level* default-level) + ) + (let ((a3-39 (-> s1-10 base))) + (let ((v1-285 (the-as object (-> s1-10 base)))) + (set! (-> (the-as dma-packet v1-285) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-285) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-285) vif1) (new 'static 'vif-tag)) + (set! (-> s1-10 base) (&+ (the-as pointer v1-285) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s2-12 + (the-as (pointer dma-tag) a3-39) + ) + ) + ) + (set! (-> arg1 origin x) (+ 100.0 (-> arg1 origin x))) + (let ((s2-13 print-game-text)) + (format (clear *temp-string*) "~D%" (the int (-> *progress-save-info* file arg2 completion-percentage))) + (s2-13 *temp-string* arg1 #f 44 320) + ) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 368 289) + (let* ((s1-12 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-14 (-> s1-12 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + s1-12 + (-> *level* default-level) + ) + (let ((a3-41 (-> s1-12 base))) + (let ((v1-304 (the-as object (-> s1-12 base)))) + (set! (-> (the-as dma-packet v1-304) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-304) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-304) vif1) (new 'static 'vif-tag)) + (set! (-> s1-12 base) (&+ (the-as pointer v1-304) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s2-14 + (the-as (pointer dma-tag) a3-41) + ) + ) + ) + (set! (-> arg1 origin y) (+ 28.0 (-> arg1 origin y))) + (let ((s2-15 print-game-text)) + (format (clear *temp-string*) "~D" (the int (-> *progress-save-info* file arg2 skill-count))) + (s2-15 *temp-string* arg1 #f 44 320) + ) + (set! (-> obj sprites 0 scale-x) 0.6) + (set! (-> obj sprites 0 scale-y) 0.6) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x82 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 253 290) + (let* ((s1-14 (-> *display* frames (-> *display* on-screen) global-buf)) + (s2-16 (-> s1-14 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + s1-14 + (-> *level* default-level) + ) + (let ((a3-43 (-> s1-14 base))) + (let ((v1-325 (the-as object (-> s1-14 base)))) + (set! (-> (the-as dma-packet v1-325) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-325) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-325) vif1) (new 'static 'vif-tag)) + (set! (-> s1-14 base) (&+ (the-as pointer v1-325) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s2-16 + (the-as (pointer dma-tag) a3-43) + ) + ) + ) + (set! (-> arg1 origin x) (+ -100.0 (-> arg1 origin x))) + (let ((s2-17 print-game-text)) + (format (clear *temp-string*) "~D" (the int (-> *progress-save-info* file arg2 gem-count))) + (s2-17 *temp-string* arg1 #f 44 320) + ) + ) + ) + ) + ((and *progress-save-info* + (= (-> *progress-save-info* formatted) 1) + (= (-> *progress-save-info* inited) 1) + (zero? (-> *progress-save-info* file arg2 present)) + ) + (cond + ((= arg2 sv-20) + (let ((v1-348 arg1)) + (set! (-> v1-348 scale) 0.8) + ) + ) + (else + (let ((v1-349 arg1)) + (set! (-> v1-349 scale) 0.6) + ) + ) + ) + (let ((a0-150 arg1)) + (set! (-> a0-150 flags) (font-flags kerning large)) + ) + (+! (-> arg1 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 100 + 105 + ) + ) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-slot-empty) #f) arg1 #f 44 320) + ) + ) + (set! (-> arg1 origin x) sv-24) + (set! (-> arg1 origin y) sv-28) + (set! (-> arg1 width) sv-32) + (set! (-> arg1 height) sv-36) + (if (zero? arg2) + (draw-decoration-load-save obj arg1 sv-16 (if (= (-> arg0 current) 'select-load) + 300 + 299 + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-loading-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-loading-option ((obj menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (with-pp + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((v1-3 arg1)) + (set! (-> v1-3 scale) 0.55) + ) + (let ((s4-0 arg1)) + (set! (-> s4-0 color) (the-as font-color (progress-selected 0))) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 120.0) + (set! (-> arg1 origin y) 110.0) + (let ((v1-8 arg1)) + (set! (-> v1-8 width) (the float (the-as float #x10e))) + ) + (let ((v1-9 arg1)) + (set! (-> v1-9 height) (the float (the-as float #x23))) + ) + (if (< f30-0 0.0) + 0.0 + ) + ) + (when (or (< (mod (-> pp clock frame-counter) 300) 150) (!= (-> arg0 menu-transition) 0.0)) + (let ((a1-1 416)) + (case (-> arg0 current) + (('saving) + (set! a1-1 415) + ) + (('formatting) + (set! a1-1 417) + ) + (('creating) + (set! a1-1 418) + ) + ) + (print-game-text (lookup-text! *common-text* (the-as game-text-id a1-1) #f) arg1 #f 44 320) + ) + ) + (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) + (let ((v1-25 arg1)) + (set! (-> v1-25 height) (the float (the-as float #xa0))) + ) + (let ((a0-16 arg1)) + (set! (-> a0-16 color) (font-color #7efbfb)) + ) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-dont-remove) #f) 1) + (s5-2 *temp-string* arg1 #f 44 320) + ) + 0 + (none) + ) + ) + +;; definition for method 10 of type menu-insufficient-space-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (when (!= (-> arg0 current) 'none) + (let ((v1-3 arg1)) + (set! (-> v1-3 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 color) (font-color #7efbfb)) + ) + (let ((a0-4 arg1)) + (set! (-> a0-4 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 75.0) + (set! (-> arg1 origin y) 80.0) + (let ((v1-8 arg1)) + (set! (-> v1-8 width) (the float (the-as float #x168))) + ) + (let ((v1-9 arg1)) + (set! (-> v1-9 height) (the float (the-as float #x50))) + ) + (let ((s4-0 410)) + (case (-> arg0 current) + (('insufficient-space) + (set! s4-0 408) + ) + (('no-memory-card) + (set! s4-0 409) + ) + ) + (let ((s3-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (the-as game-text-id s4-0) #f) 1) + (s3-0 *temp-string* arg1 #f 44 320) + ) + ) + (set! (-> arg1 origin y) (+ 80.0 (-> arg1 origin y))) + (let ((v1-17 arg1)) + (set! (-> v1-17 height) (the float (the-as float #x32))) + ) + (let ((s4-1 print-game-text)) + (format + (clear *temp-string*) + (lookup-text! *common-text* (game-text-id progress-memcard-space-requirement) #f) + (if *progress-save-info* + (-> *progress-save-info* mem-required) + 0 + ) + ) + (s4-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 55.0 (-> arg1 origin y))) + (let ((v1-22 arg1)) + (set! (-> v1-22 height) (the float (the-as float #x5a))) + ) + (cond + ((and (!= (-> *progress-state* starting-state) 'insufficient-space) + (!= (-> *progress-state* starting-state) 'no-memory-card) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-memcard-insert-card-with-space-to-save) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) + (let ((s5-2 arg1)) + (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + ) + (else + (let ((s4-2 arg1)) + (set! (-> s4-2 color) (the-as font-color (progress-selected 0))) + ) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + (draw-highlight (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-continue-retry arg0 arg1) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-secrets-insufficient-space-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((v1-1 arg1)) + (set! (-> v1-1 scale) 0.5) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 130.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x14a))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x3c))) + ) + (let ((s5-0 409)) + (progress-method-28 arg0 'select-save) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (the-as game-text-id s5-0) #f) 1) + (s4-0 *temp-string* arg1 #f 44 320) + ) + ) + (set! (-> arg1 origin y) (+ 140.0 (-> arg1 origin y))) + (let ((v1-13 arg1)) + (set! (-> v1-13 height) (the float (the-as float #x1e))) + ) + (let ((s5-1 arg1)) + (set! (-> s5-1 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + 0 + (none) + ) + +;; definition for method 10 of type menu-insert-card-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((v1-1 arg1)) + (set! (-> v1-1 scale) 0.5) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 130.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x14a))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x5f))) + ) + (let ((s5-0 print-game-text)) + (format + (clear *temp-string*) + (lookup-text! *common-text* (game-text-id progress-memcard-insert-card-with-jak2) #f) + 1 + ) + (s5-0 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 115.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x3c))) + ) + (let ((s5-1 arg1)) + (set! (-> s5-1 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 17.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-go-back?) #f) arg1 #f 44 320) + 0 + (none) + ) + +;; definition for method 10 of type menu-error-loading-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((v1-1 arg1)) + (set! (-> v1-1 scale) 0.5) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 100.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x14a))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x2d))) + ) + (let ((s5-0 425)) + (case (-> arg0 current) + (('error-saving) + (set! s5-0 426) + ) + (('error-formatting) + (set! s5-0 427) + ) + (('error-creating) + (set! s5-0 428) + ) + ) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (the-as game-text-id s5-0) #f) 1) + (s4-0 *temp-string* arg1 #f 44 320) + ) + ) + (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) + (let ((v1-16 arg1)) + (set! (-> v1-16 height) (the float (the-as float #x69))) + ) + (let ((s5-1 print-game-text)) + (format + (clear *temp-string*) + (lookup-text! *common-text* (game-text-id progress-memcard-check-and-try-again) #f) + 1 + ) + (s5-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 115.0 (-> arg1 origin y))) + (let ((v1-19 arg1)) + (set! (-> v1-19 height) (the float (the-as float #x2d))) + ) + (let ((s5-2 arg1)) + (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 9.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + 0 + (none) + ) + +;; definition for method 10 of type menu-error-auto-saving-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((v1-1 arg1)) + (set! (-> v1-1 scale) 0.5) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 77.0) + (set! (-> arg1 origin y) 85.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x19))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-memcard-error-while-saving) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 25.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x3c))) + ) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-check) #f) 1) + (s5-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) + (let ((v1-13 arg1)) + (set! (-> v1-13 height) (the float (the-as float #x2d))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-disabled) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) + (let ((v1-16 arg1)) + (set! (-> v1-16 height) (the float (the-as float #x5f))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-autosave-reenabling-info) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 90.0 (-> arg1 origin y))) + (let ((v1-19 arg1)) + (set! (-> v1-19 height) (the float (the-as float #x19))) + ) + (let ((s5-4 arg1)) + (set! (-> s5-4 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (-> arg1 origin y)) 22 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + 0 + (none) + ) + +;; definition for method 10 of type menu-card-removed-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((v1-1 arg1)) + (set! (-> v1-1 scale) 0.5) + ) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #7efbfb)) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 80.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x46))) + ) + (let ((s5-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-was-removed) #f) 1) + (s5-0 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 65.0 (-> arg1 origin y))) + (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-disabled) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 65.0 (-> arg1 origin y))) + (let ((v1-12 arg1)) + (set! (-> v1-12 height) (the float (the-as float #x5a))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-autosave-reenabling-info) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 85.0 (-> arg1 origin y))) + (let ((v1-15 arg1)) + (set! (-> v1-15 height) (the float (the-as float #x23))) + ) + (let ((s5-3 arg1)) + (set! (-> s5-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 5.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + 0 + (none) + ) + +;; definition for method 10 of type menu-error-disc-removed-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 120.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x23))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-removed-notice) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x55))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-removed-prompt) #f) arg1 #f 44 320) + (when (is-cd-in?) + (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) + (let ((v1-14 arg1)) + (set! (-> v1-14 height) (the float (the-as float #x32))) + ) + (let ((s5-2 arg1)) + (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-error-reading-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 120.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x14a))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x23))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-disc-read-error) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 55.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x55))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-disc-read-error-prompt) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 105.0 (-> arg1 origin y))) + (let ((v1-13 arg1)) + (set! (-> v1-13 height) (the float (the-as float #x32))) + ) + (let ((s5-2 arg1)) + (set! (-> s5-2 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + 0 + (none) + ) + +;; definition for method 10 of type menu-icon-info-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (set! (-> *bigmap* auto-save-icon-flag) (the-as basic #t)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x48 :page #x67a))) + (set! (-> obj sprites 0 scale-x) 1.0) + (set! (-> obj sprites 0 scale-y) 1.0) + (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 (- 1.0 (-> arg0 menu-transition))))) + (set! (-> obj sprites 0 pos z) #xffffff) + (set! (-> obj sprites 0 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 240 160) + (let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s4-1 (-> s3-0 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + s3-0 + (-> *level* default-level) + ) + (let ((a3-1 (-> s3-0 base))) + (let ((v1-16 (the-as object (-> s3-0 base)))) + (set! (-> (the-as dma-packet v1-16) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-16) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-16) vif1) (new 'static 'vif-tag)) + (set! (-> s3-0 base) (&+ (the-as pointer v1-16) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s4-1 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + (let ((a0-16 arg1)) + (set! (-> a0-16 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 80.0) + (let ((v1-27 arg1)) + (set! (-> v1-27 width) (the float (the-as float #x14a))) + ) + (let ((v1-28 arg1)) + (set! (-> v1-28 height) (the float (the-as float #x55))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-explanation) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 115.0 (-> arg1 origin y))) + (let ((v1-31 arg1)) + (set! (-> v1-31 height) (the float (the-as float #x5f))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-autosave-dont-remove) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 90.0 (-> arg1 origin y))) + (let ((v1-34 arg1)) + (set! (-> v1-34 height) (the float (the-as float #x32))) + ) + (let ((s5-3 arg1)) + (set! (-> s5-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-unknown-continue) #f) arg1 #f 44 320) + 0 + (none) + ) + +;; definition for method 10 of type menu-format-card-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 80.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x55))) + ) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-unformatted) #f) 1) + (s4-0 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x55))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-memcard-formatting-required-notice) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) + (let ((v1-13 arg1)) + (set! (-> v1-13 height) (the float (the-as float #x19))) + ) + (draw-highlight (the int (-> arg1 origin y)) 44 (-> arg1 alpha)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-format-prompt) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 25.0 (-> arg1 origin y))) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +;; definition for method 10 of type menu-already-exists-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 120.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x55))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-memcard-overwrite-warning) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 105.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x2d))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-memcard-overwrite-confirm) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) + (draw-highlight (the int (+ 8.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +;; definition for method 10 of type menu-create-game-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 110.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x5a))) + ) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id progress-memcard-no-jak2-found) #f) 1) + (s4-0 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 95.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x3c))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-memcard-create-jak2-file?) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 70.0 (-> arg1 origin y))) + (draw-highlight (the int (+ 18.0 (-> arg1 origin y))) 22 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +;; definition for method 10 of type menu-video-mode-warning-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 85.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x2d))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-60hz-change-notice) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x5f))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-1) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 85.0 (-> arg1 origin y))) + (let ((v1-13 arg1)) + (set! (-> v1-13 height) (the float (the-as float #x37))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-2) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) + (let ((v1-16 arg1)) + (set! (-> v1-16 height) (the float (the-as float #x1e))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-continue?) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + (draw-highlight (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +;; definition for method 10 of type menu-video-mode-ok-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 130.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x32))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-60hz-change-complete) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 70.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x32))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-mode-revert?) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) + (draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +;; definition for method 10 of type menu-progressive-mode-warning-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.5) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 75.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x32))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-change-notice) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 50.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x5a))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-1) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 85.0 (-> arg1 origin y))) + (let ((v1-13 arg1)) + (set! (-> v1-13 height) (the float (the-as float #x4b))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-warning-2) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 70.0 (-> arg1 origin y))) + (let ((v1-16 arg1)) + (set! (-> v1-16 height) (the float (the-as float #x1e))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-memcard-continue?) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 25.0 (-> arg1 origin y))) + (draw-highlight (the int (-> arg1 origin y)) 24 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +;; definition for method 10 of type menu-progressive-mode-ok-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.55) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 80.0) + (set! (-> arg1 origin y) 90.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x168))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x50))) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-graphics-progressivescan-change-complete) #f) + arg1 + #f + 44 + 320 + ) + (set! (-> arg1 origin y) (+ 100.0 (-> arg1 origin y))) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #x4b))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-graphics-mode-revert?) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 70.0 (-> arg1 origin y))) + (draw-highlight (the int (+ 20.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +;; definition for method 10 of type menu-quit-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) + (let ((a0-1 arg1)) + (set! (-> a0-1 color) (font-color #7efbfb)) + ) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.55) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle left large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 160.0) + (let ((v1-6 arg1)) + (set! (-> v1-6 width) (the float (the-as float #x14a))) + ) + (let ((v1-7 arg1)) + (set! (-> v1-7 height) (the float (the-as float #x46))) + ) + (print-game-text (lookup-text! *common-text* (game-text-id progress-quit-game-confirm) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) + (draw-highlight (the int (+ 17.0 (-> arg1 origin y))) 24 (-> arg1 alpha)) + (draw-yes-no arg0 arg1) + 0 + (none) + ) + +;; definition for method 10 of type menu-select-start-option +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: disable def twice: 147. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod menu-option-method-10 menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (sv-48 int) + (sv-64 int) + (sv-80 game-task-info) + (sv-96 font-context) + (sv-112 (function string font-context symbol int int float)) + (sv-128 hud-box) + ) + (let* ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (s3-0 (-> obj task-index)) + (s2-0 0) + (s1-0 50) + (f28-0 (* (-> arg0 sliding-height) (the float s1-0))) + (s0-0 97) + ) + (set! sv-128 (new 'stack 'hud-box)) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((v1-5 arg1)) + (set! (-> v1-5 scale) 0.45) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 flags) (font-flags kerning middle large)) + ) + (let ((a0-4 arg1)) + (set! (-> a0-4 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin y) 100.0) + (let ((v1-9 arg1)) + (set! (-> v1-9 width) (the float (the-as float #x159))) + ) + (let ((v1-10 arg1)) + (set! (-> v1-10 height) (the float (the-as float #xd2))) + ) + (let* ((v1-11 (-> arg0 current)) + (a3-1 (cond + ((= v1-11 'select-pre-start) + 362 + ) + ((= v1-11 'select-kiosk-start) + 363 + ) + (else + 352 + ) + ) + ) + ) + (if (or (= (-> *setting-control* user-default language) (language-enum french)) + (= (-> *setting-control* user-default language) (language-enum spanish)) + ) + (draw-decoration obj arg1 f30-0 a3-1 #t 0.7) + (draw-decoration obj arg1 f30-0 a3-1 #t 0.95) + ) + ) + (begin-scissor-level sv-128) + (set! (-> arg1 origin x) 80.0) + (let ((v1-20 arg1)) + (set! (-> v1-20 scale) 0.5) + ) + (when (or (= (-> *setting-control* user-default language) (language-enum japanese)) + (= (-> *setting-control* user-default language) (language-enum korean)) + ) + (let ((v1-28 arg1)) + (set! (-> v1-28 scale) 0.6) + ) + ) + (let ((a0-18 arg1)) + (set! (-> a0-18 flags) (font-flags kerning large)) + ) + (when (>= (+ s3-0 -1) 0) + (+! s3-0 -1) + (set! s2-0 -1) + (draw-highlight (+ s0-0 47) 50 f30-0) + (set! s0-0 (- s0-0 s1-0)) + ) + (while (< s2-0 8) + (when (>= s3-0 0) + (set! sv-48 -1) + (set! sv-64 0) + (while (and (< sv-64 (-> *game-info* play-list length)) (!= sv-48 s3-0)) + (let* ((v1-39 (-> *game-info* play-list sv-64)) + (a0-22 (-> arg0 current)) + (a0-24 (cond + ((= a0-22 'select-pre-start) + (or (-> v1-39 play-continue) (-> v1-39 pre-play-continue)) + ) + ((= a0-22 'select-kiosk-start) + (-> v1-39 kiosk-play-continue) + ) + (else + (-> v1-39 play-continue) + ) + ) + ) + ) + (when (and a0-24 (lookup-text! *common-text* (-> v1-39 text-name) #t)) + (set! sv-48 (+ sv-48 1)) + sv-48 + ) + ) + (when (!= sv-48 s3-0) + (set! sv-64 (+ sv-64 1)) + sv-64 + ) + ) + (when (!= sv-64 (-> *game-info* play-list length)) + (set! sv-80 (-> *game-info* play-list sv-64)) + (cond + ((zero? s2-0) + (set! (-> obj real-task-index) sv-64) + (set! sv-96 arg1) + (set! (-> sv-96 color) (the-as font-color (progress-selected 0))) + (draw-highlight (+ s0-0 47) 50 f30-0) + ) + (else + (let ((a0-35 arg1)) + (set! (-> a0-35 color) (font-color #7efbfb)) + ) + ) + ) + (cond + ((and (= (-> *setting-control* user-default language) (language-enum german)) (= 454 (-> sv-80 text-name))) + (let ((v1-71 arg1)) + (set! (-> v1-71 scale) 0.45) + ) + ) + ((and (= (-> *setting-control* user-default language) (language-enum german)) (!= 454 (-> sv-80 text-name))) + (let ((v1-78 arg1)) + (set! (-> v1-78 scale) 0.5) + ) + ) + ) + (let ((v1-79 arg1)) + (set! (-> v1-79 height) (the float s1-0)) + ) + (+! s0-0 s1-0) + (set! (-> arg1 origin y) (the float (+ s0-0 (the int f28-0)))) + (set! sv-112 print-game-text) + (let ((a0-46 (lookup-text! *common-text* (-> sv-80 text-name) #f)) + (a1-12 arg1) + (a2-7 #f) + (a3-2 44) + (t0-3 320) + ) + (sv-112 a0-46 a1-12 a2-7 a3-2 t0-3) + ) + ) + ) + (+! s3-0 1) + (+! s2-0 1) + ) + ) + (let ((t9-10 end-scissor-level) + (a1-13 1.0) + ) + (t9-10 sv-128 a1-13) + ) + (draw-scene-up-down arg1) + 0 + (none) + ) + +;; definition for method 10 of type menu-select-scene-option +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (sv-48 int) + (sv-64 (function string font-context symbol int int float)) + (sv-80 (function string font-context symbol int int float)) + (sv-96 (function _varargs_ object)) + (sv-112 string) + (sv-128 (function string font-context symbol int int float)) + (sv-144 (function _varargs_ object)) + (sv-160 string) + (sv-176 (function string font-context symbol int int float)) + (sv-192 font-context) + (sv-208 font-context) + (sv-224 (function string font-context symbol int int float)) + ) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (s4-0 (-> obj task-index)) + (s3-0 0) + (s2-0 *hud-select-scene-act1*) + ) + (let ((v1-2 44)) + (* (-> arg0 sliding-height) (the float v1-2)) + ) + (let ((s0-0 120) + (s1-0 (new 'stack-no-clear 'hud-box)) + ) + (let ((f28-0 0.0)) + 0.0 + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (case (-> *progress-state* scene-player-act) + ((1) + (set! s2-0 *hud-select-scene-act1*) + ) + ((2) + (set! s2-0 *hud-select-scene-act2*) + ) + ((3) + (set! s2-0 *hud-select-scene-act3*) + ) + ) + (set! (-> arg1 alpha) f30-0) + (let ((a1-6 arg1)) + (set! (-> a1-6 flags) (font-flags kerning middle large)) + ) + (set! (-> arg1 origin x) 90.0) + (set! (-> arg1 origin y) 100.0) + (let ((v1-14 arg1)) + (set! (-> v1-14 width) (the float (the-as float #x14f))) + ) + (let ((v1-15 arg1)) + (set! (-> v1-15 height) (the float (the-as float #xd2))) + ) + (let ((a1-9 arg1)) + (set! (-> a1-9 color) (font-color #7efbfb)) + ) + (if (or (= (-> *setting-control* user-default language) (language-enum french)) + (= (-> *setting-control* user-default language) (language-enum spanish)) + ) + (draw-decoration obj arg1 f30-0 364 #t 0.7) + (draw-decoration obj arg1 f30-0 364 #t 0.95) + ) + (begin-scissor-scene s1-0) + (let ((v1-23 arg1)) + (set! (-> v1-23 scale) 0.5) + ) + (set! sv-48 0) + (while (< sv-48 s4-0) + (set! sv-64 print-game-text) + (let ((a0-4 (lookup-text! *common-text* (the-as game-text-id (-> s2-0 sv-48 text)) #f)) + (a1-16 arg1) + (a2-4 #t) + (a3-3 44) + (t0-3 320) + ) + (+! f28-0 (sv-64 a0-4 a1-16 a2-4 a3-3 t0-3)) + ) + (set! sv-48 (+ sv-48 1)) + ) + (let ((s0-1 (- s0-0 (the int f28-0))) + (f28-1 (cond + ((< (-> arg0 sliding-height) 0.0) + (set! sv-112 (lookup-text! *common-text* (the-as game-text-id (-> s2-0 s4-0 text)) #f)) + 0.0 + (set! sv-80 print-game-text) + (set! sv-96 format) + (let ((a0-7 (clear *temp-string*)) + (a1-18 "~S") + ) + (sv-96 a0-7 a1-18 sv-112) + ) + (let* ((a0-8 *temp-string*) + (a1-19 arg1) + (a2-7 #t) + (a3-4 44) + (t0-4 320) + (f0-16 (sv-80 a0-8 a1-19 a2-7 a3-4 t0-4)) + ) + (* (-> arg0 sliding-height) f0-16) + ) + ) + (else + (set! sv-160 (lookup-text! *common-text* (the-as game-text-id (-> s2-0 (+ s4-0 -1) text)) #f)) + 0.0 + (set! sv-128 print-game-text) + (set! sv-144 format) + (let ((a0-11 (clear *temp-string*)) + (a1-21 "~S") + ) + (sv-144 a0-11 a1-21 sv-160) + ) + (let* ((a0-12 *temp-string*) + (a1-22 arg1) + (a2-10 #t) + (a3-5 44) + (t0-5 320) + (f0-18 (sv-128 a0-12 a1-22 a2-10 a3-5 t0-5)) + ) + (* (-> arg0 sliding-height) f0-18) + ) + ) + ) + ) + ) + (set! (-> arg1 origin y) (the float (+ s0-1 (the int f28-1)))) + (while (< s3-0 (length s2-0)) + (set! sv-176 print-game-text) + (let* ((a0-14 (lookup-text! *common-text* (the-as game-text-id (-> s2-0 s3-0 text)) #f)) + (a1-24 arg1) + (a2-12 #t) + (a3-6 44) + (t0-6 320) + (f26-0 (sv-176 a0-14 a1-24 a2-12 a3-6 t0-6)) + ) + (set! (-> arg1 flags) (font-flags kerning large)) + (cond + ((and (< s3-0 s4-0) (!= (-> arg0 sliding-height) 0.0)) + (set! sv-192 arg1) + (set! (-> sv-192 color) (the-as font-color (progress-selected 0))) + (draw-highlight (+ (the int f26-0) -2 s0-1) (the int f26-0) f30-0) + ) + ((or (and (= s3-0 s4-0) (= (fabs (-> arg0 sliding-height)) 0.0)) (zero? s3-0)) + (set! sv-208 arg1) + (set! (-> sv-208 color) (the-as font-color (progress-selected 0))) + (draw-highlight (+ s0-1 -2) (the int f26-0) f30-0) + ) + (else + (let ((a0-21 arg1)) + (set! (-> a0-21 color) (font-color #7efbfb)) + ) + ) + ) + ) + (set! sv-224 print-game-text) + (let ((a0-23 (lookup-text! *common-text* (the-as game-text-id (-> s2-0 s3-0 text)) #f)) + (a1-28 arg1) + (a2-16 #f) + (a3-7 44) + (t0-7 320) + ) + (+! s0-1 (the int (sv-224 a0-23 a1-28 a2-16 a3-7 t0-7))) + ) + (set! (-> arg1 origin y) (the float (+ s0-1 (the int f28-1)))) + (+! s3-0 1) + ) + ) + ) + (end-scissor-scene s1-0 1.0) + ) + ) + (draw-scene-up-down arg1) + 0 + (none) + ) + +;; definition for method 10 of type menu-bigmap-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + 0 + (none) + ) + +;; definition for function sort-task-node-result +;; WARN: Return type mismatch symbol vs none. +(defun sort-task-node-result ((arg0 int)) + (let ((v1-1 (-> *game-info* mission-list)) + (a1-1 (max 0 (+ arg0 -1))) + ) + (let ((a0-3 0)) + (while (> a1-1 0) + (while (< a0-3 a1-1) + (when (and (logtest? (-> v1-1 a0-3 flags) (game-task-node-flag closed)) + (logtest? (-> v1-1 (+ a0-3 1) flags) (game-task-node-flag closed)) + (< (-> v1-1 a0-3 close-time) (-> v1-1 (+ a0-3 1) close-time)) + ) + (let ((a2-19 (-> v1-1 a0-3))) + (set! (-> v1-1 a0-3) (-> v1-1 (+ a0-3 1))) + (set! (-> v1-1 (+ a0-3 1)) a2-19) + ) + ) + (+! a0-3 1) + ) + (+! a1-1 -1) + (set! a0-3 0) + ) + ) + ) + (none) + ) + +;; definition for function find-mission-text-at-index +(defun find-mission-text-at-index ((arg0 int)) + (local-vars (v1-99 symbol)) + (when (< arg0 (-> *progress-state* current-line-index)) + (set! (-> *progress-state* current-task-index) (length (-> *game-info* sub-task-list))) + (set! (-> *progress-state* current-line-index) -1) + (set! (-> *progress-state* current-task) (the-as uint -1)) + (set! (-> *progress-state* first-closed-line-index) -1) + (set! (-> *progress-state* extra-text-state) -1) + (set! (-> *progress-state* num-open-tasks-found) 0) + (set! (-> *progress-state* num-closed-tasks-found) 0) + 0 + ) + (let ((s5-0 (-> *game-info* sub-task-list))) + 0 + (let ((s4-0 (the-as game-task-node-info #f))) + (while (and (> (-> *progress-state* current-task-index) 0) (!= (-> *progress-state* current-line-index) arg0)) + (cond + ((or (= (-> *progress-state* extra-text-state) -1) (= (-> *progress-state* extra-text-state) 3)) + (+! (-> *progress-state* current-task-index) -1) + (let ((s3-0 (-> s5-0 (-> *progress-state* current-task-index)))) + (when (and (!= (-> s3-0 task) (-> *progress-state* current-task)) (nonzero? (-> s3-0 description))) + (cond + ((and (>= (-> *progress-state* first-closed-line-index) 0) (open? s3-0)) + (set! (-> *progress-state* current-task) (the-as uint (-> s3-0 task))) + ) + ((or (and (>= (-> *progress-state* first-closed-line-index) 0) + (logtest? (-> s3-0 flags) (game-task-node-flag closed)) + ) + (and (< (-> *progress-state* first-closed-line-index) 0) (open? s3-0)) + ) + (set! (-> *progress-state* current-task) (the-as uint (-> s3-0 task))) + (set! s4-0 (-> s5-0 (-> *progress-state* current-task-index))) + (-> s5-0 (-> *progress-state* current-task-index) description) + (if (< (-> *progress-state* first-closed-line-index) 0) + (+! (-> *progress-state* num-open-tasks-found) 1) + (set! (-> *progress-state* num-closed-tasks-found) 1) + ) + (+! (-> *progress-state* current-line-index) 1) + ) + ) + ) + ) + (when (and (zero? (-> *progress-state* current-task-index)) (!= (-> *progress-state* current-line-index) arg0)) + (set! (-> *progress-state* current-task-index) (length (-> *game-info* sub-task-list))) + (cond + ((< (-> *progress-state* first-closed-line-index) 0) + (set! (-> *progress-state* first-closed-line-index) arg0) + (+! (-> *progress-state* extra-text-state) (if (nonzero? (-> *progress-state* num-open-tasks-found)) + 2 + 1 + ) + ) + ) + (else + (+! (-> *progress-state* extra-text-state) (if (nonzero? (-> *progress-state* num-closed-tasks-found)) + 2 + 1 + ) + ) + ) + ) + ) + ) + ((zero? (-> *progress-state* extra-text-state)) + 369 + (+! (-> *progress-state* extra-text-state) 1) + (+! (-> *progress-state* current-line-index) 1) + ) + ((= (-> *progress-state* extra-text-state) 1) + 367 + #t + (let ((v1-98 (the-as symbol (-> *progress-state* num-open-tasks-found)))) + (set! v1-98 v1-98) + (cmove-#f-zero v1-99 v1-98 v1-98) + ) + (+! (-> *progress-state* extra-text-state) 1) + (+! (-> *progress-state* current-line-index) 1) + ) + ((= (-> *progress-state* extra-text-state) 4) + 369 + (+! (-> *progress-state* extra-text-state) 1) + (+! (-> *progress-state* current-line-index) 1) + ) + ((= (-> *progress-state* extra-text-state) 5) + 368 + (+! (-> *progress-state* extra-text-state) 2) + (+! (-> *progress-state* current-line-index) 1) + ) + (else + 0 + (+! (-> *progress-state* extra-text-state) 1) + (+! (-> *progress-state* current-line-index) 1) + ) + ) + ) + (cond + ((= (-> *progress-state* current-line-index) arg0) + (empty) + s4-0 + ) + (else + (the-as game-task-node-info #f) + ) + ) + ) + ) + ) + +;; definition for method 10 of type menu-missions-option +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 260 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (f0-50 float) + (sv-16 float) + (sv-20 int) + (sv-24 int) + (sv-32 int) + (sv-40 int) + (sv-48 int) + (sv-56 int) + (sv-256 float) + (sv-260 float) + (sv-264 game-task-node-info) + (sv-268 game-task-node-info) + (sv-272 symbol) + (sv-276 hud-box) + (sv-280 float) + (sv-284 float) + ) + (set! sv-16 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (set! sv-20 1) + (set! sv-24 0) + (set! sv-32 0) + (set! sv-40 0) + (set! sv-48 0) + (set! sv-56 95) + (set! sv-256 (* 395.0 (-> arg0 sliding))) + (set! sv-260 (* 44.0 (-> arg0 sliding-height))) + (set! sv-264 (new 'stack 'game-task-node-info)) + (set! sv-268 (new 'stack 'game-task-node-info)) + (set! sv-272 #t) + (set! sv-276 (new 'stack-no-clear 'hud-box)) + (set! sv-280 (-> arg1 origin y)) + (set! sv-284 (-> arg1 scale)) + (set! (-> *progress-state* current-task-index) (length (-> *game-info* sub-task-list))) + (set! (-> *progress-state* current-line-index) -1) + (set! (-> *progress-state* current-task) (the-as uint -1)) + (set! (-> *progress-state* first-closed-line-index) -1) + (set! (-> *progress-state* extra-text-state) -1) + (set! (-> *progress-state* num-open-tasks-found) 0) + (set! (-> *progress-state* num-closed-tasks-found) 0) + (if (< sv-16 0.0) + (set! sv-16 (the-as float 0.0)) + ) + (set! (-> arg1 alpha) sv-16) + (set! (-> *game-info* mission-list 0) sv-264) + (set! (-> sv-264 description) (game-text-id progress-unknown-kjanskd)) + (set! (-> sv-268 description) (game-text-id progress-unknown-oi1un23i13)) + (while (< sv-24 (length (-> *game-info* sub-task-list))) + (let ((v1-26 (find-mission-text-at-index sv-24)) + (a0-15 (-> *game-info* mission-list)) + ) + (when (!= v1-26 #f) + (when (and (logtest? (-> v1-26 flags) (game-task-node-flag closed)) sv-272) + (set! sv-272 (the-as symbol #f)) + (set! (-> a0-15 sv-20) sv-268) + (set! sv-20 (+ sv-20 1)) + ) + (set! (-> a0-15 sv-20) v1-26) + (set! sv-20 (+ sv-20 1)) + ) + ) + (set! sv-24 (+ sv-24 1)) + ) + (set! sv-48 sv-20) + (set! (-> *progress-state* total-num-tasks) sv-20) + (sort-task-node-result sv-48) + (let ((v1-36 arg1)) + (set! (-> v1-36 width) 395.0) + ) + (set! (-> arg1 origin x) 60.0) + (set! (-> arg1 origin y) 80.0) + (let ((a0-21 arg1)) + (set! (-> a0-21 color) (font-color #7efbfb)) + ) + (let ((v1-40 (-> obj page-index))) + (cond + ((zero? v1-40) + (draw-missions-decoration obj arg1 sv-16 (game-text-id progress-root-missions)) + ) + ((= v1-40 1) + (draw-missions-decoration obj arg1 sv-16 (game-text-id progress-root-missions)) + ) + ) + ) + (begin-scissor-missions sv-276 (the-as float arg0)) + (let ((a0-27 arg1)) + (set! (-> a0-27 flags) (font-flags kerning large)) + ) + (set! (-> arg1 origin x) (+ 20.0 (-> arg1 origin x))) + (case (get-aspect-ratio) + (('aspect16x9) + (set! (-> arg1 origin y) 80.0) + ) + (('aspect4x3) + (set! (-> arg1 origin y) (the float sv-56)) + ) + ) + (let ((v1-52 arg1)) + (set! (-> v1-52 scale) sv-284) + ) + (when (zero? (-> obj page-index)) + (set! sv-24 (-> obj task-line-index)) + (set! sv-20 0) + (let ((v1-57 (+ sv-56 44))) + (set! sv-56 v1-57) + (set! (-> arg1 origin y) (the float (+ v1-57 (the int sv-260)))) + ) + (set! (-> arg1 width) 340.0) + (set! (-> arg1 height) 44.0) + (when (!= sv-260 0.0) + (set! (-> *progress-state* missions-total-spacing) 0.0) + (dotimes (s4-1 sv-24) + (let* ((s3-1 (-> *game-info* mission-list s4-1)) + (a1-19 + (if (and (logtest? (-> s3-1 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s3-1 task))) + (-> *game-info* play-list (-> s3-1 task) text-name) + (-> s3-1 description) + ) + ) + (s3-2 (lookup-text! *common-text* a1-19 #f)) + (f30-0 3.0) + (s2-0 print-game-text) + ) + (format (clear *temp-string*) "~S" s3-2) + (set! (-> *progress-state* missions-total-spacing) + (+ f30-0 (s2-0 *temp-string* arg1 #t 44 320) (-> *progress-state* missions-total-spacing)) + ) + ) + ) + ) + (set! sv-56 (- sv-56 (the int (-> *progress-state* missions-total-spacing)))) + (cond + ((< (-> arg0 sliding-height) 0.0) + (let* ((s4-2 (-> *game-info* mission-list sv-24)) + (a1-23 + (if (and (logtest? (-> s4-2 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s4-2 task))) + (-> *game-info* play-list (-> s4-2 task) text-name) + (-> s4-2 description) + ) + ) + (s4-3 (lookup-text! *common-text* a1-23 #f)) + ) + 0.0 + (let ((f30-1 3.0) + (s3-3 print-game-text) + ) + (format (clear *temp-string*) "~S" s4-3) + (let ((f0-36 (+ f30-1 (s3-3 *temp-string* arg1 #t 44 320)))) + (set! sv-260 (* (-> arg0 sliding-height) f0-36)) + ) + ) + ) + ) + (else + (let* ((s4-4 (-> *game-info* mission-list (+ sv-24 -1))) + (a1-27 + (if (and (logtest? (-> s4-4 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s4-4 task))) + (-> *game-info* play-list (-> s4-4 task) text-name) + (-> s4-4 description) + ) + ) + (s4-5 (lookup-text! *common-text* a1-27 #f)) + ) + 0.0 + (let ((f30-2 3.0) + (s3-4 print-game-text) + ) + (format (clear *temp-string*) "~S" s4-5) + (let ((f0-40 (+ f30-2 (s3-4 *temp-string* arg1 #t 44 320)))) + (set! sv-260 (* (-> arg0 sliding-height) f0-40)) + ) + ) + ) + ) + ) + (set! (-> arg1 origin y) (the float (+ sv-56 (the int sv-260)))) + (while (and (< sv-20 sv-48) (< sv-20 (+ sv-24 10))) + (let* ((s4-6 (-> *game-info* mission-list sv-20)) + (s3-5 + (if (and (logtest? (-> s4-6 flags) (game-task-node-flag closed)) (task-complete? *game-info* (-> s4-6 task))) + (-> *game-info* play-list (-> s4-6 task) text-name) + (-> s4-6 description) + ) + ) + (s5-1 (lookup-text! *common-text* s3-5 #f)) + ) + 0.0 + (set! f0-50 + (cond + ((>= sv-20 (+ sv-24 -1)) + (when (and (!= s3-5 381) (!= s3-5 380)) + (let ((s3-6 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! + *common-text* + (if (logtest? (-> s4-6 flags) (game-task-node-flag closed)) + (game-text-id progress-missions-icon-completed) + (game-text-id progress-missions-icon-todo) + ) + #f + ) + ) + (s3-6 *temp-string* arg1 #f 44 320) + ) + ) + (set! (-> arg1 origin x) (+ 20.0 (-> arg1 origin x))) + (let ((f30-3 3.0) + (s4-7 print-game-text) + ) + (format (clear *temp-string*) "~S" s5-1) + (set! f0-50 (+ f30-3 (s4-7 *temp-string* arg1 #f 44 320))) + ) + (set! (-> arg1 origin x) (+ -20.0 (-> arg1 origin x))) + f0-50 + ) + (else + (let ((f30-4 3.0) + (s4-8 print-game-text) + ) + (format (clear *temp-string*) "~S" s5-1) + (+ f30-4 (s4-8 *temp-string* arg1 #t 44 320)) + ) + ) + ) + ) + ) + (let ((v1-142 (+ sv-56 (the int f0-50)))) + (set! sv-56 v1-142) + (set! (-> arg1 origin y) (the float (+ v1-142 (the int sv-260)))) + ) + (set! sv-20 (+ sv-20 1)) + ) + (if (zero? (-> *progress-state* total-num-tasks)) + (print-game-text (lookup-text! *common-text* (game-text-id progress-missions-none) #f) arg1 #f 44 320) + ) + ) + (end-scissor-missions sv-276 1.0) + (draw-missions-up-down arg1) + 0 + (none) + ) + +;; definition for function draw-secret-list +;; WARN: Return type mismatch object vs pointer. +(defun draw-secret-list ((arg0 secret-item-option) (arg1 progress) (arg2 font-context) (arg3 int) (arg4 symbol) (arg5 float)) + (let ((s4-0 (and arg4 (= arg3 1)))) + 380.0 + 270.0 + (set! (-> arg2 origin x) 100.0) + (cond + ((= s4-0 #t) + (cond + ((= (-> arg0 can-toggle) 'auto) + ) + ((not (-> arg0 can-toggle)) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg2 origin x) (+ -25.0 (-> arg2 origin x))) + ) + (('aspect16x9) + (set! (-> arg2 origin x) (+ -10.0 (-> arg2 origin x))) + ) + ) + (when (= (-> *setting-control* user-default language) (language-enum german)) + (let ((v1-19 arg2)) + (set! (-> v1-19 scale) 0.43) + ) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-secrets-go-to-title-screen) #f) + arg2 + #f + 44 + 320 + ) + ) + ((and (= (-> arg0 can-toggle) #t) (logtest? (-> *game-info* secrets) (-> arg0 flag))) + (set! (-> arg1 selected-option) #f) + (logclear! (-> *game-info* secrets) (-> arg0 flag)) + ) + ((and (= (-> arg0 can-toggle) #t) (zero? (logand (-> *game-info* secrets) (-> arg0 flag)))) + (logior! (-> *game-info* secrets) (-> arg0 flag)) + (set! (-> arg1 selected-option) #f) + ) + ) + ) + (else + (let ((s3-1 arg2)) + (set! (-> s3-1 color) (if (= arg3 1) + (the-as font-color (progress-selected 0)) + (font-color #7efbfb) + ) + ) + ) + (set! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 75 + 90 + ) + ) + ) + (cond + ((logtest? (-> *game-info* sub-task-list (-> arg0 avail-after) flags) (game-task-node-flag closed)) + (let ((s3-3 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> arg0 name) #f)) + (s3-3 *temp-string* arg2 #f 44 320) + ) + ) + (else + (let ((s3-4 print-game-text)) + (format (clear *temp-string*) "????????") + (s3-4 *temp-string* arg2 #f 44 320) + ) + ) + ) + (set! (-> arg2 origin x) 360.0) + (let ((a0-35 arg2)) + (set! (-> a0-35 color) (font-color #7efbfb)) + ) + ) + ) + (the-as + pointer + (cond + ((and (not s4-0) (zero? (logand (-> *game-info* purchase-secrets) (-> arg0 flag)))) + (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 50 + 45 + ) + ) + ) + (let ((s4-2 print-game-text)) + (format (clear *temp-string*) "~D" (-> arg0 cost)) + (s4-2 *temp-string* arg2 #f 44 320) + ) + ) + ((and (not s4-0) (= (-> arg0 can-toggle) #t) (logtest? (-> *game-info* secrets) (-> arg0 flag))) + (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 50 + 45 + ) + ) + ) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-on) #f)) + (s5-2 *temp-string* arg2 #f 44 320) + ) + ) + ((and (not s4-0) (= (-> arg0 can-toggle) #t) (zero? (logand (-> *game-info* secrets) (-> arg0 flag)))) + (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 50 + 45 + ) + ) + ) + (let ((s5-4 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-off) #f)) + (s5-4 *temp-string* arg2 #f 44 320) + ) + ) + ((and (not s4-0) (!= (-> arg0 can-toggle) #t)) + (let ((s3-8 80) + (s5-5 70) + (f30-3 (-> arg2 origin x)) + ) + (set! s3-8 (cond + ((= (get-aspect-ratio) 'aspect4x3) + (empty) + s3-8 + ) + (else + s5-5 + ) + ) + ) + (set! (-> arg2 origin x) (+ f30-3 (the float s3-8))) + ) + (let ((a0-61 arg2)) + (set! (-> a0-61 flags) (font-flags kerning right large)) + ) + (let ((s5-6 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-secrets-unlocked) #f)) + (s5-6 *temp-string* arg2 #f 44 320) + ) + (let ((v0-15 (the-as object arg2))) + (set! (-> (the-as font-context v0-15) flags) (font-flags kerning large)) + v0-15 + ) + ) + ) + ) + ) + ) + +;; definition for method 10 of type menu-secret-option +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 116 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 116 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 116 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 36 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 116 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 112 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (sv-16 float) + (sv-20 symbol) + (sv-24 int) + (sv-32 float) + (sv-36 float) + (sv-40 symbol) + (sv-44 int) + (sv-48 progress) + (sv-96 int) + (sv-104 int) + (sv-108 float) + (sv-112 int) + (sv-116 int) + (sv-120 hud-box) + (sv-128 int) + ) + (set! sv-16 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (set! sv-20 (logtest? (-> *game-info* secrets) (game-secrets hero-mode))) + (set! sv-24 (the int (-> *game-info* skill-total))) + (set! sv-32 395.0) + (set! sv-36 25.0) + (set! sv-40 arg3) + (set! sv-44 arg2) + (set! sv-48 arg0) + (set! sv-96 (if (not sv-20) + 0 + (-> obj num-items) + ) + ) + (set! sv-104 (if (not sv-20) + (-> obj num-items) + (+ (-> obj num-items) (-> obj num-hero-items)) + ) + ) + (set! sv-108 (* (-> sv-48 sliding) sv-36)) + (set! sv-112 (-> obj item-index)) + (set! sv-116 (-> obj prev-item-index)) + (set! sv-120 (new 'stack-no-clear 'hud-box)) + (set! sv-128 205) + (if (< sv-16 0.0) + (set! sv-16 (the-as float 0.0)) + ) + (cond + ((or (not (-> *bigmap* progress-minimap)) (< (-> obj item-index) sv-96) (< sv-104 (-> obj item-index))) + (draw-busy-loading arg1) + ) + (else + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93))) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (set! (-> obj sprites 0 scale-x) 0.64) + (set! (-> obj sprites 0 scale-y) 0.64) + (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 sv-16))) + (set! (-> obj sprites 0 pos z) #xffffff) + (set! (-> obj sprites 0 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 100 128) + (let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s4-0 (-> s3-0 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + s3-0 + (-> *level* default-level) + ) + (let ((a3-1 (-> s3-0 base))) + (let ((v1-42 (the-as object (-> s3-0 base)))) + (set! (-> (the-as dma-packet v1-42) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-42) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-42) vif1) (new 'static 'vif-tag)) + (set! (-> s3-0 base) (&+ (the-as pointer v1-42) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s4-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + (set! (-> arg1 alpha) sv-16) + (let ((a0-21 arg1)) + (set! (-> a0-21 flags) (font-flags kerning middle large)) + ) + (let ((a0-22 arg1)) + (set! (-> a0-22 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin x) 59.0) + (let ((v1-54 arg1)) + (set! (-> v1-54 width) sv-32) + ) + (let ((v1-55 arg1)) + (set! (-> v1-55 height) sv-36) + ) + (let ((v1-56 arg1)) + (set! (-> v1-56 scale) 1.0) + ) + (set! (-> arg1 origin y) 82.0) + (let ((t9-5 draw-decoration-secrets) + (a0-24 obj) + (a1-4 arg1) + (a2-4 sv-16) + (a3-2 339) + ) + (t9-5 a0-24 a1-4 a2-4 (the-as game-text-id a3-2)) + ) + (let ((v1-58 arg1)) + (set! (-> v1-58 scale) 0.45) + ) + (when (or (= (-> *setting-control* user-default language) (language-enum japanese)) + (= (-> *setting-control* user-default language) (language-enum korean)) + ) + (let ((v1-66 arg1)) + (set! (-> v1-66 scale) 0.53) + ) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (let ((v1-68 arg1)) + (set! (-> v1-68 height) (the float (the-as float #xb9))) + ) + (set! (-> arg1 origin y) 133.0) + ) + (('aspect16x9) + (let ((v1-72 arg1)) + (set! (-> v1-72 height) (the float (the-as float #xb9))) + ) + (set! (-> arg1 origin y) 133.0) + ) + ) + (let ((a0-34 arg1)) + (set! (-> a0-34 flags) (font-flags kerning large)) + ) + (set! (-> arg1 origin x) 100.0) + (let ((s4-1 print-game-text)) + (format + (clear *temp-string*) + "x~D ~S" + sv-24 + (lookup-text! *common-text* (game-text-id progress-secrets-orb-label) #f) + ) + (s4-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) 100.0) + (begin-scissor-secret sv-120 sv-48) + (case (get-aspect-ratio) + (('aspect16x9) + (set! sv-128 195) + ) + ) + (cond + (sv-40 + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128))) + (draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) + ) + ((>= (- sv-112 sv-116) 0) + (when (>= (+ sv-112 -3) sv-96) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) -50 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 -3)) sv-48 arg1 0 sv-40 sv-108) + ) + (when (>= (+ sv-112 -2) sv-96) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) -25 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 -2)) sv-48 arg1 0 sv-40 sv-108) + ) + (set! (-> arg1 origin y) (the float (+ sv-128 (the int sv-108)))) + (when (>= (+ sv-112 -1) sv-96) + (draw-highlight (+ sv-128 22) 22 sv-16) + (draw-secret-list (-> obj secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108) + ) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128))) + (draw-highlight (+ sv-128 22) 22 sv-16) + (draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) + (when (< (+ sv-112 1) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 50 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 1)) sv-48 arg1 0 sv-40 sv-108) + ) + (when (< (+ sv-112 2) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 75 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 2)) sv-48 arg1 0 sv-40 sv-108) + ) + (when (< (+ sv-112 3) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 100 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 3)) sv-48 arg1 0 sv-40 sv-108) + ) + ) + (else + (when (>= (+ sv-112 -2) sv-96) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) -25 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 -2)) sv-48 arg1 0 sv-40 sv-108) + ) + (set! (-> arg1 origin y) (the float (+ sv-128 (the int sv-108)))) + (if (>= (+ sv-112 -1) sv-96) + (draw-secret-list (-> obj secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108) + ) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128))) + (draw-highlight (+ sv-128 22) 22 sv-16) + (draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) + (when (< (+ sv-112 1) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 50 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 1)) sv-48 arg1 0 sv-40 sv-108) + ) + (when (< (+ sv-112 2) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 75 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 2)) sv-48 arg1 0 sv-40 sv-108) + ) + (when (< (+ sv-112 3) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 100 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 3)) sv-48 arg1 0 sv-40 sv-108) + ) + (when (< (+ sv-112 4) sv-104) + (set! (-> arg1 origin y) (the float (+ (the int sv-108) 125 sv-128))) + (draw-secret-list (-> obj secret-items (+ sv-112 4)) sv-48 arg1 0 sv-40 sv-108) + ) + ) + ) + (end-scissor-secret sv-120 1.0) + (draw-up-down arg1) + ) + ) + 0 + (none) + ) + +;; definition of type print-highscore-obj +(deftype print-highscore-obj (basic) + ((self texture-page :offset-assert 4) + (index int32 :offset-assert 8) + (previous texture-page :offset-assert 12) + (place int32 :offset-assert 16) + (score float :offset-assert 20) + (game-score basic :offset-assert 24) + (context font-context :offset-assert 28) + (local-scale float :offset-assert 32) + (interp float :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +;; definition for method 3 of type print-highscore-obj +(defmethod inspect print-highscore-obj ((obj print-highscore-obj)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tself: ~A~%" (-> obj self)) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tprevious: ~A~%" (-> obj previous)) + (format #t "~1Tplace: ~D~%" (-> obj place)) + (format #t "~1Tscore: ~f~%" (-> obj score)) + (format #t "~1Tgame-score: ~A~%" (-> obj game-score)) + (format #t "~1Tcontext: ~A~%" (-> obj context)) + (format #t "~1Tlocal-scale: ~f~%" (-> obj local-scale)) + (format #t "~1Tinterp: ~f~%" (-> obj interp)) + (label cfg-4) + obj + ) + +;; definition for function draw-highscore-icon +(defun draw-highscore-icon ((arg0 menu-highscores-option) (arg1 uint) (arg2 int) (arg3 int) (arg4 float)) + (set! (-> arg0 sprites 0 tex) (lookup-texture-by-id (the-as texture-id arg1))) + (set! (-> arg0 sprites 0 scale-x) arg4) + (set! (-> arg0 sprites 0 scale-y) arg4) + (set-hud-piece-position! (the-as hud-sprite (-> arg0 sprites)) arg2 arg3) + (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-1 (-> s4-1 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> arg0 sprites)) + s4-1 + (-> *level* default-level) + ) + (let ((a3-1 (-> s4-1 base))) + (let ((v1-8 (the-as object (-> s4-1 base)))) + (set! (-> (the-as dma-packet v1-8) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-8) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-8) vif1) (new 'static 'vif-tag)) + (set! (-> s4-1 base) (&+ (the-as pointer v1-8) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + gp-1 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + +;; definition for function draw-highscore-cup +(defun draw-highscore-cup ((arg0 texture-page) (arg1 int) (arg2 int) (arg3 int) (arg4 float) (arg5 float)) + "First int is an enum" + (let ((a0-1 (the-as uint #xc9300300))) + (case arg1 + ((3) + (set! a0-1 (the-as uint #xc9300300)) + ) + ((2) + (set! a0-1 (the-as uint #xc9300a00)) + ) + ((1) + (set! a0-1 (the-as uint #xc9300d00)) + ) + ) + (when (nonzero? arg1) + (set! (-> arg0 pad 11) (the-as uint 4)) + (let ((v1-10 (&-> arg0 pad 7))) + (set! (-> v1-10 0) (the-as uint 128)) + (set! (-> v1-10 1) (the-as uint 128)) + (set! (-> v1-10 2) (the-as uint 128)) + (set! (-> v1-10 3) (the-as uint (the int (* 128.0 arg5)))) + ) + (set! (-> arg0 pad 5) (the-as uint #xffffff)) + (set! (-> arg0 pad 6) (the-as uint 0)) + (set! (-> arg0 data 0) (lookup-texture-by-id (the-as texture-id a0-1))) + (set! (-> arg0 pad 12) (the-as uint arg4)) + (set! (-> arg0 pad 13) (the-as uint arg4)) + (set-hud-piece-position! (the-as hud-sprite (&-> arg0 pad 3)) arg2 arg3) + (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-1 (-> s4-1 base)) + ) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (&-> arg0 pad 3)) + s4-1 + (-> *level* default-level) + ) + (let ((a3-1 (-> s4-1 base))) + (let ((v1-20 (the-as object (-> s4-1 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! (-> s4-1 base) (&+ (the-as pointer v1-20) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + s5-1 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + ) + ) + +;; definition for function get-highscore-score +(defun get-highscore-score ((arg0 int)) + "TODO - takes and returns an enum?" + (let ((v0-0 11)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (set! v0-0 4) + ) + ((= v1-0 1) + (set! v0-0 5) + ) + ((= v1-0 2) + (set! v0-0 6) + ) + ((= v1-0 3) + (set! v0-0 7) + ) + ((= v1-0 4) + (set! v0-0 10) + ) + ((= v1-0 5) + (set! v0-0 13) + ) + ((= v1-0 6) + (set! v0-0 12) + ) + ((= v1-0 7) + (set! v0-0 11) + ) + ((= v1-0 8) + (set! v0-0 14) + ) + ((= v1-0 9) + (set! v0-0 15) + ) + ((= v1-0 10) + (set! v0-0 18) + ) + ((= v1-0 11) + (set! v0-0 17) + ) + ((= v1-0 12) + (set! v0-0 16) + ) + ((= v1-0 13) + (set! v0-0 8) + ) + ((= v1-0 14) + (set! v0-0 9) + ) + ) + ) + v0-0 + ) + ) + +;; definition for function eval-highscore +(defun eval-highscore ((arg0 print-highscore-obj)) + (get-rank (-> *highscore-info-array* (get-highscore-score (-> arg0 index))) (-> arg0 score)) + ) + +;; definition for function str-print-time +(defun str-print-time ((arg0 float)) + 0 + 0 + 0 + (let* ((gp-0 (the int (* 0.016666668 arg0))) + (v1-5 (- arg0 (* 60.0 (the float gp-0)))) + (s5-0 (the int v1-5)) + (v1-6 (- v1-5 (the float s5-0))) + (s3-0 (the int (* 1000.0 v1-6))) + ) + (format (clear *temp-string*) "~d:~2,'0,d:~3,'0,d" gp-0 s5-0 s3-0) + ) + *temp-string* + ) + +;; definition for function print-highscore +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +;; WARN: Stack slot offset 20 signed mismatch +(defun print-highscore ((arg0 print-highscore-obj)) + (local-vars (sv-16 font-context) (sv-20 float) (sv-24 int) (sv-32 int) (sv-40 print-highscore-obj)) + (set! sv-16 (-> arg0 context)) + (set! sv-20 (-> arg0 interp)) + (set! sv-24 50) + (set! sv-32 (if (= (get-aspect-ratio) 'aspect4x3) + 320 + 300 + ) + ) + (set! sv-40 arg0) + (let ((a0-1 sv-16)) + (set! (-> a0-1 flags) (font-flags kerning large)) + ) + (+! (-> sv-16 origin x) (the float sv-24)) + (let ((v1-8 (-> sv-40 place))) + (cond + ((zero? v1-8) + (let ((gp-1 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-1st) #f)) + (gp-1 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 112) + 174 + 0.25 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 1) + (let ((v1-18 sv-16)) + (set! (-> v1-18 scale) 0.5) + ) + (set! (-> sv-16 origin y) (+ 23.0 (-> sv-16 origin y))) + (let ((gp-3 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-2nd) #f)) + (gp-3 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 111) + 197 + 0.22 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 2) + (let ((v1-31 sv-16)) + (set! (-> v1-31 scale) 0.4) + ) + (set! (-> sv-16 origin y) (+ 20.0 (-> sv-16 origin y))) + (let ((gp-5 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-3rd) #f)) + (gp-5 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 110) + 217 + 0.2 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 3) + (let ((v1-44 sv-16)) + (set! (-> v1-44 scale) 0.3) + ) + (set! (-> sv-16 origin y) (+ 15.0 (-> sv-16 origin y))) + (let ((gp-7 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-4th) #f)) + (gp-7 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 109) + 232 + 0.15 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 4) + (set! (-> sv-16 origin y) (+ 12.0 (-> sv-16 origin y))) + (let ((gp-9 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-5th) #f)) + (gp-9 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 109) + 244 + 0.15 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 5) + (set! (-> sv-16 origin y) (+ 12.0 (-> sv-16 origin y))) + (let ((gp-11 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-6th) #f)) + (gp-11 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 109) + 256 + 0.15 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 6) + (set! (-> sv-16 origin y) (+ 12.0 (-> sv-16 origin y))) + (let ((gp-13 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-7th) #f)) + (gp-13 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 109) + 268 + 0.15 + (-> sv-40 local-scale) + ) + ) + ) + ((= v1-8 7) + (set! (-> sv-16 origin y) (+ 12.0 (-> sv-16 origin y))) + (let ((gp-15 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (game-text-id progress-highscores-8th) #f)) + (gp-15 *temp-string* sv-16 #f 44 320) + ) + (if (not (-> sv-40 previous)) + (draw-highscore-cup + (-> sv-40 self) + (eval-highscore sv-40) + (+ (the int sv-20) 109) + 280 + 0.15 + (-> sv-40 local-scale) + ) + ) + ) + ) + ) + (+! (-> sv-16 origin x) (the float sv-32)) + (let ((a0-67 sv-16)) + (set! (-> a0-67 flags) (font-flags kerning right large)) + ) + (cond + ((-> sv-40 game-score) + (let ((gp-17 print-game-text)) + (format (clear *temp-string*) "~D" (the int (-> sv-40 score))) + (gp-17 *temp-string* sv-16 #f 44 320) + ) + ) + (else + (print-game-text (str-print-time (-> sv-40 score)) sv-16 #f 44 320) + ) + ) + (let ((a0-73 sv-16)) + (set! (-> a0-73 flags) (font-flags kerning large)) + ) + (set! (-> sv-16 origin x) (- (-> sv-16 origin x) (the float (+ sv-24 sv-32)))) + ) + +;; definition for function get-highscore-text +;; WARN: Return type mismatch int vs game-text-id. +(defun get-highscore-text ((arg0 int)) + "TODO - takes an enum?" + (let ((v0-0 319)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (set! v0-0 323) + ) + ((= v1-0 1) + (set! v0-0 323) + ) + ((= v1-0 2) + (set! v0-0 323) + ) + ((= v1-0 3) + (set! v0-0 323) + ) + ((= v1-0 4) + (set! v0-0 330) + ) + ((= v1-0 5) + (set! v0-0 319) + ) + ((= v1-0 6) + (set! v0-0 319) + ) + ((= v1-0 7) + (set! v0-0 319) + ) + ((= v1-0 8) + (set! v0-0 319) + ) + ((= v1-0 9) + (set! v0-0 319) + ) + ((= v1-0 10) + (set! v0-0 319) + ) + ((= v1-0 11) + (set! v0-0 319) + ) + ((= v1-0 12) + (set! v0-0 319) + ) + ((= v1-0 13) + (set! v0-0 328) + ) + ((= v1-0 14) + (set! v0-0 329) + ) + ) + ) + (the-as game-text-id v0-0) + ) + ) + +;; definition for function get-highscore-text-sub +;; WARN: Return type mismatch int vs game-text-id. +(defun get-highscore-text-sub ((arg0 int)) + "TODO - takes an enum?" + (let ((v0-0 320)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (set! v0-0 324) + ) + ((= v1-0 1) + (set! v0-0 325) + ) + ((= v1-0 2) + (set! v0-0 326) + ) + ((= v1-0 3) + (set! v0-0 327) + ) + ((= v1-0 4) + (set! v0-0 333) + ) + ((= v1-0 5) + (set! v0-0 322) + ) + ((= v1-0 6) + (set! v0-0 321) + ) + ((= v1-0 7) + (set! v0-0 320) + ) + ((= v1-0 8) + (set! v0-0 337) + ) + ((= v1-0 9) + (set! v0-0 338) + ) + ((= v1-0 10) + (set! v0-0 336) + ) + ((= v1-0 11) + (set! v0-0 335) + ) + ((= v1-0 12) + (set! v0-0 334) + ) + ((= v1-0 13) + (set! v0-0 331) + ) + ((= v1-0 14) + (set! v0-0 332) + ) + ) + ) + (the-as game-text-id v0-0) + ) + ) + +;; definition for function get-highscore-icon +(defun get-highscore-icon ((arg0 int)) + "TODO - Icon id enum perhaps?" + (let ((v0-0 (the-as uint #xc9301000))) + (let ((v1-1 arg0)) + (cond + ((zero? v1-1) + (set! v0-0 (the-as uint #xc9301000)) + ) + ((= v1-1 1) + (set! v0-0 (the-as uint #xc9301200)) + ) + ((= v1-1 2) + (set! v0-0 (the-as uint #xc9301300)) + ) + ((= v1-1 3) + (set! v0-0 (the-as uint #xc9301100)) + ) + ((= v1-1 4) + (set! v0-0 (the-as uint #xc9300e00)) + ) + ((= v1-1 5) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 6) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 7) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 8) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 9) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 10) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 11) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 12) + (set! v0-0 (the-as uint #xc9300100)) + ) + ((= v1-1 13) + (set! v0-0 (the-as uint #xc9301600)) + ) + ((= v1-1 14) + (set! v0-0 (the-as uint #xc9301700)) + ) + ) + ) + v0-0 + ) + ) + +;; definition for function get-highscore-type +(defun get-highscore-type ((arg0 int)) + "TODO - takes an enum?" + (let ((v0-0 'game)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (set! v0-0 'game) + ) + ((= v1-0 5) + (set! v0-0 'race) + ) + ((= v1-0 6) + (set! v0-0 'race) + ) + ((= v1-0 7) + (set! v0-0 'race) + ) + ((= v1-0 8) + (set! v0-0 'race) + ) + ((= v1-0 9) + (set! v0-0 'race) + ) + ((= v1-0 10) + (set! v0-0 'race) + ) + ((= v1-0 11) + (set! v0-0 'race) + ) + ((= v1-0 12) + (set! v0-0 'race) + ) + ((= v1-0 13) + (set! v0-0 'game) + ) + ) + ) + v0-0 + ) + ) + +;; definition for function highscore-available? +(defun highscore-available? ((arg0 int)) + (let ((v0-0 #f)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (set! v0-0 #t) + ) + ((= v1-0 1) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 75 flags) (game-task-node-flag closed))) + ) + ((= v1-0 2) + (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets gungame-blue))) + ) + ((= v1-0 3) + (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets gungame-dark))) + ) + ((= v1-0 4) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 63 flags) (game-task-node-flag closed))) + ) + ((= v1-0 5) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 135 flags) (game-task-node-flag closed))) + ) + ((= v1-0 6) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 181 flags) (game-task-node-flag closed))) + ) + ((= v1-0 7) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 209 flags) (game-task-node-flag closed))) + ) + ((= v1-0 8) + (set! v0-0 (or (logtest? (-> *game-info* sub-task-list 308 flags) (game-task-node-flag closed)) + (open? (-> *game-info* sub-task-list 308)) + ) + ) + ) + ((= v1-0 9) + (set! v0-0 (or (logtest? (-> *game-info* sub-task-list 306 flags) (game-task-node-flag closed)) + (open? (-> *game-info* sub-task-list 306)) + ) + ) + ) + ((= v1-0 10) + (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets reverse-races))) + ) + ((= v1-0 11) + (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets reverse-races))) + ) + ((= v1-0 12) + (set! v0-0 (logtest? (-> *game-info* secrets) (game-secrets reverse-races))) + ) + ((= v1-0 13) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 149 flags) (game-task-node-flag closed))) + ) + ((= v1-0 14) + (set! v0-0 (logtest? (-> *game-info* sub-task-list 224 flags) (game-task-node-flag closed))) + ) + ) + ) + v0-0 + ) + ) + +;; definition for function get-num-highscores +(defun get-num-highscores () + (let ((gp-0 0)) + (dotimes (s5-0 15) + (if (highscore-available? s5-0) + (+! gp-0 1) + ) + ) + gp-0 + ) + ) + +;; definition for function get-next-highscore +(defun get-next-highscore ((arg0 int)) + (let ((s4-0 15) + (s3-0 1) + (gp-0 -1) + ) + (+ arg0 s3-0) + (while (and (= gp-0 -1) (< s3-0 s4-0)) + (let ((s2-0 (+ arg0 s3-0))) + (+! s3-0 1) + (if (highscore-available? (mod s2-0 s4-0)) + (set! gp-0 (mod s2-0 s4-0)) + ) + ) + ) + (if (= gp-0 -1) + (set! gp-0 arg0) + ) + gp-0 + ) + ) + +;; definition for function get-prev-highscore +(defun get-prev-highscore ((arg0 int)) + (let ((s4-0 15) + (s3-0 1) + (gp-0 -1) + ) + (+ arg0 s3-0) + (while (and (= gp-0 -1) (< s3-0 s4-0)) + (let ((s2-0 (- arg0 s3-0))) + (+! s3-0 1) + (if (< s2-0 0) + (set! s2-0 (+ s4-0 s2-0)) + ) + (let ((t9-0 highscore-available?) + (a0-1 (abs s2-0)) + ) + (if (t9-0 a0-1) + (set! gp-0 (abs s2-0)) + ) + ) + ) + ) + (if (= gp-0 -1) + (set! gp-0 arg0) + ) + gp-0 + ) + ) + +;; definition for function get-highscore-icon-scale +(defun get-highscore-icon-scale ((arg0 int)) + "TODO - takes an enum?" + (let ((f0-0 (if (= (get-aspect-ratio) 'aspect4x3) + 1.0 + 1.0 + ) + ) + ) + (let ((f2-0 0.6) + (f1-0 0.8) + ) + (cond + ((zero? arg0) + (set! f0-0 f2-0) + ) + ((= arg0 1) + (set! f0-0 f2-0) + ) + ((= arg0 2) + (set! f0-0 f2-0) + ) + ((= arg0 3) + (set! f0-0 f2-0) + ) + ((= arg0 4) + (set! f0-0 0.5) + ) + ((= arg0 5) + (set! f0-0 f1-0) + ) + ((= arg0 6) + (set! f0-0 f1-0) + ) + ((= arg0 7) + (set! f0-0 f1-0) + ) + ((= arg0 8) + (set! f0-0 f1-0) + ) + ((= arg0 9) + (set! f0-0 f1-0) + ) + ((= arg0 10) + (set! f0-0 f1-0) + ) + ((= arg0 11) + (set! f0-0 f1-0) + ) + ((= arg0 12) + (set! f0-0 f1-0) + ) + ((= arg0 13) + (set! f0-0 0.7) + ) + ((= arg0 14) + (set! f0-0 0.7) + ) + ) + ) + f0-0 + ) + ) + +;; definition for function get-highscore-icon-xoffset +(defun get-highscore-icon-xoffset ((arg0 int)) + (if (= (get-aspect-ratio) 'aspect4x3) + 435 + 410 + ) + ) + +;; definition for function get-highscore-icon-yoffset +(defun get-highscore-icon-yoffset ((arg0 int)) + "TODO - takes an enum?" + (let ((v0-1 (if (= (get-aspect-ratio) 'aspect4x3) + 130 + 120 + ) + ) + ) + (let ((a0-1 130) + (v1-0 120) + ) + (cond + ((zero? arg0) + (set! v0-1 a0-1) + ) + ((= arg0 1) + (set! v0-1 a0-1) + ) + ((= arg0 2) + (set! v0-1 a0-1) + ) + ((= arg0 3) + (set! v0-1 a0-1) + ) + ((= arg0 5) + (set! v0-1 v1-0) + ) + ((= arg0 6) + (set! v0-1 v1-0) + ) + ((= arg0 7) + (set! v0-1 v1-0) + ) + ((= arg0 8) + (set! v0-1 v1-0) + ) + ((= arg0 9) + (set! v0-1 v1-0) + ) + ((= arg0 10) + (set! v0-1 v1-0) + ) + ((= arg0 11) + (set! v0-1 v1-0) + ) + ((= arg0 12) + (set! v0-1 v1-0) + ) + ((= arg0 13) + (set! v0-1 125) + ) + ((= arg0 14) + (set! v0-1 125) + ) + ) + ) + v0-1 + ) + ) + +;; definition for method 10 of type menu-highscores-option +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 104 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 100 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 124 signed mismatch +;; WARN: Stack slot offset 96 signed mismatch +;; WARN: Stack slot offset 120 signed mismatch +;; WARN: Stack slot offset 108 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (sv-96 float) + (sv-100 float) + (sv-104 float) + (sv-108 float) + (sv-112 hud-box) + (sv-116 print-highscore-obj) + (sv-120 float) + (sv-124 float) + (sv-128 symbol) + (sv-132 int) + (sv-136 progress) + (sv-140 font-context) + (sv-144 menu-highscores-option) + ) + (set! sv-96 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (set! sv-100 0.22) + (set! sv-104 395.0) + (set! sv-108 (-> arg1 origin x)) + (set! sv-112 (new 'stack-no-clear 'hud-box)) + (set! sv-116 (new 'stack 'print-highscore-obj)) + (set! sv-120 (* (-> arg0 sliding) sv-104)) + (set! sv-124 (* (-> arg0 sliding-off) (-> obj slide-dir) sv-104)) + (set! sv-128 arg3) + (set! sv-132 arg2) + (set! sv-136 arg0) + (set! sv-140 arg1) + (set! sv-144 obj) + (if (< sv-96 0.0) + (set! sv-96 (the-as float 0.0)) + ) + (cond + ((not (-> *bigmap* progress-minimap)) + (draw-busy-loading sv-140) + ) + (else + (set! (-> sv-140 alpha) sv-96) + (let ((v1-16 sv-140)) + (set! (-> v1-16 scale) 1.0) + ) + (let ((a0-4 sv-140)) + (set! (-> a0-4 flags) (font-flags kerning middle large)) + ) + (let ((a0-5 sv-140)) + (set! (-> a0-5 color) (font-color #7efbfb)) + ) + (set! (-> sv-140 origin x) 59.0) + (set! (-> sv-140 origin y) 78.0) + (let ((v1-23 sv-140)) + (set! (-> v1-23 width) sv-104) + ) + (let ((v1-24 sv-140)) + (set! (-> v1-24 height) 215.0) + ) + (begin-scissor sv-112 sv-136) + (set! (-> sv-144 sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xc93))) + (set! (-> sv-144 sprites 0 flags) (the-as uint 4)) + (set! (-> sv-144 sprites 0 scale-x) sv-100) + (set! (-> sv-144 sprites 0 scale-y) sv-100) + (set-vector! (-> sv-144 sprites 0 color) 128 128 128 (the int (* 128.0 sv-96))) + (set! (-> sv-144 sprites 0 pos z) #xfffff0) + (set! (-> sv-144 sprites 0 pos w) 0) + (if (= (-> *setting-control* user-default language) (language-enum spanish)) + (draw-decoration sv-144 sv-140 sv-96 310 #t 0.8) + (draw-decoration sv-144 sv-140 sv-96 310 #t 0.95) + ) + (let ((v1-39 sv-140)) + (set! (-> v1-39 scale) 0.6) + ) + (let ((v1-40 sv-140)) + (set! (-> v1-40 height) 185.0) + ) + (set! (-> sv-140 origin y) (+ 46.0 (-> sv-140 origin y))) + (set! (-> sv-140 origin x) 65.0) + (let ((v1-46 sv-140)) + (set! (-> v1-46 width) (the float (the-as float #x16f))) + ) + (let ((a0-23 sv-140)) + (set! (-> a0-23 flags) (font-flags kerning large)) + ) + (let ((a0-24 sv-140)) + (set! (-> a0-24 color) (font-color #f9f9f9)) + ) + (set! (-> sv-140 origin x) (+ 20.0 sv-120 (-> sv-140 origin x))) + (let ((v1-53 sv-140)) + (set! (-> v1-53 scale) 0.75) + ) + (when (= (-> *setting-control* user-default language) (language-enum german)) + (let ((v1-56 sv-140)) + (set! (-> v1-56 scale) 0.69) + ) + ) + (when (= (-> *setting-control* user-default language) (language-enum french)) + (let ((v1-59 sv-140)) + (set! (-> v1-59 scale) 0.72) + ) + ) + (when (= (-> *setting-control* user-default language) (language-enum spanish)) + (let ((v1-62 sv-140)) + (set! (-> v1-62 scale) 0.65) + ) + ) + (let ((gp-1 print-game-text)) + (format + (clear *temp-string*) + "~S" + (lookup-text! *common-text* (get-highscore-text (-> sv-144 page-index)) #f) + ) + (gp-1 *temp-string* sv-140 #f 44 320) + ) + (set! (-> sv-140 origin y) (+ 25.0 (-> sv-140 origin y))) + (let ((v1-68 sv-140)) + (set! (-> v1-68 scale) 0.6) + ) + (when (or (= (-> *setting-control* user-default language) (language-enum french)) + (= (-> *setting-control* user-default language) (language-enum spanish)) + ) + (let ((v1-76 sv-140)) + (set! (-> v1-76 scale) 0.58) + ) + ) + (let ((gp-2 print-game-text)) + (format + (clear *temp-string*) + "~S" + (lookup-text! *common-text* (get-highscore-text-sub (-> sv-144 page-index)) #f) + ) + (gp-2 *temp-string* sv-140 #f 44 320) + ) + (set! (-> sv-140 origin x) (- (-> sv-140 origin x) (+ 20.0 sv-120))) + (set! (-> sv-140 origin y) (+ 25.0 (-> sv-140 origin y))) + (draw-highscore-icon + sv-144 + (get-highscore-icon (-> sv-144 page-index)) + (the int (+ (the float (get-highscore-icon-xoffset (-> sv-144 page-index))) sv-120)) + (get-highscore-icon-yoffset (-> sv-144 page-index)) + (get-highscore-icon-scale (-> sv-144 page-index)) + ) + (set! sv-108 (-> sv-140 origin x)) + (let ((a0-54 sv-140)) + (set! (-> a0-54 color) (font-color #7efbfb)) + ) + (+! (-> sv-140 origin x) sv-120) + (let ((v1-96 sv-140)) + (set! (-> v1-96 scale) 0.6) + ) + (let ((gp-5 (get-game-score-ref *game-info* (get-highscore-score (-> sv-144 page-index))))) + (set! (-> sv-116 index) (-> sv-144 page-index)) + (set! (-> sv-116 previous) #f) + (set! (-> sv-116 self) (the-as texture-page sv-144)) + (case (get-highscore-type (-> sv-144 page-index)) + (('game) + (set! (-> sv-116 game-score) (the-as basic #t)) + ) + (('race) + (set! (-> sv-116 game-score) #f) + ) + ) + (set! (-> sv-116 context) sv-140) + (set! (-> sv-116 local-scale) sv-96) + (set! (-> sv-116 interp) sv-120) + (dotimes (s5-5 8) + (set! (-> sv-116 place) s5-5) + (set! (-> sv-116 score) (-> gp-5 s5-5)) + (print-highscore sv-116) + ) + ) + (set! (-> sv-140 origin x) sv-108) + (let ((v1-120 sv-140)) + (set! (-> v1-120 scale) 0.6) + ) + (set! (-> sv-140 origin x) 59.0) + (set! (-> sv-140 origin y) 78.0) + (let ((v1-125 sv-140)) + (set! (-> v1-125 width) sv-104) + ) + (let ((v1-126 sv-140)) + (set! (-> v1-126 height) 215.0) + ) + (let ((v1-127 sv-140)) + (set! (-> v1-127 scale) 0.5) + ) + (let ((v1-128 sv-140)) + (set! (-> v1-128 height) 185.0) + ) + (set! (-> sv-140 origin y) (+ 46.0 (-> sv-140 origin y))) + (set! (-> sv-140 origin x) 80.0) + (set! (-> sv-144 sprites 0 pos z) #xffffff) + (let ((v1-135 sv-140)) + (set! (-> v1-135 width) sv-104) + ) + (let ((a0-74 sv-140)) + (set! (-> a0-74 flags) (font-flags kerning large)) + ) + (let ((a0-75 sv-140)) + (set! (-> a0-75 color) (font-color #f9f9f9)) + ) + (set! (-> sv-140 origin x) (+ 20.0 sv-124 (-> sv-140 origin x))) + (let ((v1-142 sv-140)) + (set! (-> v1-142 scale) 0.75) + ) + (when (= (-> *setting-control* user-default language) (language-enum german)) + (let ((v1-145 sv-140)) + (set! (-> v1-145 scale) 0.69) + ) + ) + (when (= (-> *setting-control* user-default language) (language-enum french)) + (let ((v1-148 sv-140)) + (set! (-> v1-148 scale) 0.72) + ) + ) + (when (= (-> *setting-control* user-default language) (language-enum spanish)) + (let ((v1-151 sv-140)) + (set! (-> v1-151 scale) 0.65) + ) + ) + (let ((gp-6 print-game-text)) + (format + (clear *temp-string*) + "~S" + (lookup-text! *common-text* (get-highscore-text (-> sv-144 prev-page-index)) #f) + ) + (gp-6 *temp-string* sv-140 #f 44 320) + ) + (set! (-> sv-140 origin y) (+ 25.0 (-> sv-140 origin y))) + (let ((v1-157 sv-140)) + (set! (-> v1-157 scale) 0.6) + ) + (when (or (= (-> *setting-control* user-default language) (language-enum french)) + (= (-> *setting-control* user-default language) (language-enum spanish)) + ) + (let ((v1-165 sv-140)) + (set! (-> v1-165 scale) 0.58) + ) + ) + (let ((gp-7 print-game-text)) + (format + (clear *temp-string*) + "~S" + (lookup-text! *common-text* (get-highscore-text-sub (-> sv-144 prev-page-index)) #f) + ) + (gp-7 *temp-string* sv-140 #f 44 320) + ) + (set! (-> sv-140 origin x) (- (-> sv-140 origin x) (+ 20.0 sv-124))) + (set! (-> sv-140 origin y) (+ 25.0 (-> sv-140 origin y))) + (draw-highscore-icon + sv-144 + (get-highscore-icon (-> sv-144 prev-page-index)) + (the int (+ (the float (get-highscore-icon-xoffset (-> sv-144 page-index))) sv-124)) + (get-highscore-icon-yoffset (-> sv-144 page-index)) + (get-highscore-icon-scale (-> sv-144 page-index)) + ) + (set! sv-108 (-> sv-140 origin x)) + (let ((a0-105 sv-140)) + (set! (-> a0-105 color) (font-color #7efbfb)) + ) + (+! (-> sv-140 origin x) sv-124) + (let ((v1-185 sv-140)) + (set! (-> v1-185 scale) 0.6) + ) + (when (< 1 (get-num-highscores)) + (let ((gp-11 (get-game-score-ref *game-info* (get-highscore-score (-> sv-144 prev-page-index))))) + (set! (-> sv-116 index) (-> sv-144 prev-page-index)) + (set! (-> sv-116 previous) (the-as texture-page #t)) + (set! (-> sv-116 self) (the-as texture-page sv-144)) + (case (get-highscore-type (-> sv-144 prev-page-index)) + (('game) + (set! (-> sv-116 game-score) (the-as basic #t)) + ) + (('race) + (set! (-> sv-116 game-score) #f) + ) + ) + (set! (-> sv-116 context) sv-140) + (set! (-> sv-116 local-scale) sv-96) + (set! (-> sv-116 interp) sv-120) + (dotimes (s5-10 8) + (set! (-> sv-116 place) s5-10) + (set! (-> sv-116 score) (-> gp-11 s5-10)) + (print-highscore sv-116) + ) + ) + (set! (-> sv-140 origin x) sv-108) + (let ((v1-210 sv-140)) + (set! (-> v1-210 scale) 0.6) + ) + ) + (if (< 1 (get-num-highscores)) + (draw-previous-next sv-144 sv-140 #t) + ) + (end-scissor sv-112 1.0) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-on-off-game-vibrations-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-on-off-game-vibrations-option ((obj menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-10 string)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((v1-4 arg1)) + (set! (-> v1-4 scale) 0.65) + ) + (set! (-> arg1 origin y) (+ 15.0 (-> arg1 origin y))) + (let ((s3-0 (-> *progress-state* game-options-vibrations))) + (cond + ((and (zero? (-> *progress-state* game-options-item-selected)) (-> *progress-state* game-options-item-picked)) + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 41 f30-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + (s3-0 + (format + (clear *temp-string*) + "~33L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-10 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-10 *temp-string*) + ) + ) + ) + (else + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (cond + ((zero? (-> *progress-state* game-options-item-selected)) + (let ((s2-3 arg1)) + (set! (-> s2-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 22 f30-0) + ) + (else + (let ((a0-17 arg1)) + (set! (-> a0-17 color) (font-color #7efbfb)) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + (s3-0 + (format + (clear *temp-string*) + "~1L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-10 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~1L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-10 *temp-string*) + ) + ) + ) + ) + ) + ) + (print-menu-text a0-10 (-> obj scale) arg1 arg0) + 0 + (none) + ) + +;; definition for method 10 of type menu-on-off-game-subtitles-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-on-off-game-subtitles-option ((obj menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-11 string)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((v1-4 arg1)) + (set! (-> v1-4 scale) 0.65) + ) + (set! (-> arg1 origin y) (+ 22.0 (-> arg1 origin y))) + (let ((s3-0 (-> *progress-state* game-options-subtitles))) + (cond + ((and (= (-> *progress-state* game-options-item-selected) 1) (-> *progress-state* game-options-item-picked)) + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-3 arg1)) + (set! (-> a0-3 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 41 f30-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + (s3-0 + (format + (clear *temp-string*) + "~33L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + ) + ) + (else + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (cond + ((= (-> *progress-state* game-options-item-selected) 1) + (let ((s2-3 arg1)) + (set! (-> s2-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 22 f30-0) + ) + (else + (let ((a0-20 arg1)) + (set! (-> a0-20 color) (font-color #7efbfb)) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + (s3-0 + (format + (clear *temp-string*) + "~1L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~1L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + ) + ) + ) + ) + ) + (print-menu-text a0-11 (-> obj scale) arg1 arg0) + 0 + (none) + ) + +;; definition for method 10 of type menu-subtitle-language-game-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-subtitle-language-game-option ((obj menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (with-pp + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.65) + ) + (case arg2 + ((2) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + ) + ((3) + (set! (-> arg1 origin y) (+ 32.0 (-> arg1 origin y))) + ) + ) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((a0-5 arg1)) + (set! (-> a0-5 flags) (font-flags kerning middle large)) + ) + (let ((s4-0 (&-> *setting-control* user-default subtitle-language))) + (cond + ((and (= (-> *progress-state* game-options-item-selected) 2) (-> *progress-state* game-options-item-picked)) + (let ((a0-7 arg1)) + (set! (-> a0-7 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (-> arg1 origin y)) 44 f30-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 24.0 (-> arg1 origin y))) + (-> obj language-selection) + (let ((s4-1 (-> s4-0 0))) + 7 + (if (-> obj language-transition) + (seekl! (-> obj language-x-offset) 150 (the int (* 10.0 (-> pp clock time-adjust-ratio)))) + ) + (when (>= (-> obj language-x-offset) 75) + (set! (-> obj language-selection) (the-as uint s4-1)) + (set! (-> obj language-transition) #f) + (set! (-> obj language-x-offset) 0) + 0 + ) + ) + (let ((a0-12 arg1)) + (set! (-> a0-12 color) (font-color #7efbfb)) + ) + (let ((v1-33 arg1)) + (set! (-> v1-33 scale) 0.5) + ) + (let ((a0-14 arg1)) + (set! (-> a0-14 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x))) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 163) + (s5-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) (+ 70.0 (-> arg1 origin x))) + (set! (-> arg1 origin x) (+ 70.0 (-> arg1 origin x))) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) "~33L~C" 161) + (s5-2 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x))) + (let ((s5-3 arg1)) + (set! (-> s5-3 color) (the-as font-color (progress-selected 0))) + ) + (let ((v1-43 (if (and (= (scf-get-territory) 1) (zero? (-> *progress-state* game-options-subtitle-language-index))) + 7 + (-> *progress-state* game-options-subtitle-language-index) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> *language-name-remap* v1-43) #f) arg1 #f 44 320) + ) + ) + (else + (cond + ((= (-> *progress-state* game-options-item-selected) 2) + (let ((s4-4 arg1)) + (set! (-> s4-4 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (-> arg1 origin y)) 24 f30-0) + ) + (else + (let ((a0-31 arg1)) + (set! (-> a0-31 color) (font-color #7efbfb)) + ) + ) + ) + (let ((v1-52 arg1)) + (set! (-> v1-52 scale) 0.65) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (let ((v1-54 arg1)) + (set! (-> v1-54 scale) 0.5) + ) + (let ((a0-36 arg1)) + (set! (-> a0-36 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin y) (+ 24.0 (-> arg1 origin y))) + (let ((a0-37 arg1)) + (set! (-> a0-37 flags) (font-flags kerning middle large)) + ) + (let ((v1-61 (if (and (= (scf-get-territory) 1) (zero? (-> *progress-state* game-options-subtitle-language-index))) + 7 + (-> *progress-state* game-options-subtitle-language-index) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> *language-name-remap* v1-61) #f) arg1 #f 44 320) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 10 of type menu-language-game-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-language-game-option ((obj menu-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (with-pp + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.65) + ) + (case arg2 + ((2) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + ) + ((3) + (set! (-> arg1 origin y) (+ 32.0 (-> arg1 origin y))) + ) + ) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((a0-5 arg1)) + (set! (-> a0-5 flags) (font-flags kerning middle large)) + ) + (let ((s4-0 (&-> *setting-control* user-default language))) + (cond + ((and (= (-> *progress-state* game-options-item-selected) 3) (-> *progress-state* game-options-item-picked)) + (let ((a0-7 arg1)) + (set! (-> a0-7 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (-> arg1 origin y)) 44 f30-0) + (let ((s3-0 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (s3-0 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 24.0 (-> arg1 origin y))) + (-> obj language-selection) + (let ((s4-1 (-> s4-0 0))) + 7 + (if (-> obj language-transition) + (seekl! (-> obj language-x-offset) 150 (the int (* 10.0 (-> pp clock time-adjust-ratio)))) + ) + (when (>= (-> obj language-x-offset) 75) + (set! (-> obj language-selection) (the-as uint s4-1)) + (set! (-> obj language-transition) #f) + (set! (-> obj language-x-offset) 0) + 0 + ) + ) + (let ((a0-14 arg1)) + (set! (-> a0-14 color) (font-color #7efbfb)) + ) + (let ((v1-33 arg1)) + (set! (-> v1-33 scale) 0.5) + ) + (let ((a0-16 arg1)) + (set! (-> a0-16 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x))) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 163) + (s5-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) (+ 70.0 (-> arg1 origin x))) + (set! (-> arg1 origin x) (+ 70.0 (-> arg1 origin x))) + (let ((s5-2 print-game-text)) + (format (clear *temp-string*) "~33L~C" 161) + (s5-2 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x))) + (let ((s5-3 arg1)) + (set! (-> s5-3 color) (the-as font-color (progress-selected 0))) + ) + (let ((v1-43 (if (and (= (scf-get-territory) 1) (zero? (-> *progress-state* game-options-language-index))) + 7 + (-> *progress-state* game-options-language-index) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> *language-name-remap* v1-43) #f) arg1 #f 44 320) + ) + ) + (else + (cond + ((= (-> *progress-state* game-options-item-selected) 3) + (let ((s3-1 arg1)) + (set! (-> s3-1 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (-> arg1 origin y)) 24 f30-0) + ) + (else + (let ((a0-33 arg1)) + (set! (-> a0-33 color) (font-color #7efbfb)) + ) + ) + ) + (let ((v1-52 arg1)) + (set! (-> v1-52 scale) 0.65) + ) + (let ((s3-2 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (s3-2 *temp-string* arg1 #f 44 320) + ) + (let ((v1-54 arg1)) + (set! (-> v1-54 scale) 0.5) + ) + (let ((a0-40 arg1)) + (set! (-> a0-40 color) (font-color #7efbfb)) + ) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> *language-name-remap* (-> s4-0 0)) #f)) + *temp-string* + (set! (-> arg1 origin y) (+ 24.0 (-> arg1 origin y))) + (let ((a0-44 arg1)) + (set! (-> a0-44 flags) (font-flags kerning middle large)) + ) + (let ((v1-66 (if (and (= (scf-get-territory) 1) (zero? (-> *progress-state* game-options-language-index))) + 7 + (-> *progress-state* game-options-language-index) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> *language-name-remap* v1-66) #f) arg1 #f 44 320) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 10 of type menu-sub-menu-game-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-sub-menu-game-option ((obj menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + 395.0 + (-> arg1 origin y) + (-> arg1 scale) + (if (< f0-1 0.0) + (set! f0-1 0.0) + ) + (set! (-> arg1 alpha) f0-1) + (let ((a1-1 arg1)) + (set! (-> a1-1 flags) (font-flags kerning middle large)) + ) + (if (= (-> *setting-control* user-default language) (language-enum spanish)) + (draw-decoration obj arg1 f0-1 283 #f 0.85) + (draw-decoration obj arg1 f0-1 283 #f 0.95) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-aspect-ratio-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-aspect-ratio-option ((obj menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-12 string)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((a0-1 arg1)) + (set! (-> a0-1 flags) (font-flags kerning middle large)) + ) + (let ((v1-5 arg1)) + (set! (-> v1-5 scale) 0.75) + ) + (set! (-> arg1 height) 35.0) + (set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y))) + (let ((s3-0 (-> *progress-state* graphic-options-aspect-ratio))) + (cond + ((and (= (-> *progress-state* graphic-options-item-selected) 1) + (-> *progress-state* graphic-options-item-picked) + ) + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-4 arg1)) + (set! (-> a0-4 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 42 f30-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 23.0 (-> arg1 origin y))) + (cond + ((= s3-0 'aspect4x3) + (format + (clear *temp-string*) + "~33L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-aspect-4x3) #f) + (lookup-text! *common-text* (game-text-id progress-aspect-16x9) #f) + ) + (set! a0-12 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-aspect-4x3) #f) + (lookup-text! *common-text* (game-text-id progress-aspect-16x9) #f) + ) + (set! a0-12 *temp-string*) + ) + ) + ) + (else + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (when (not (and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + ) + (cond + ((= (-> *progress-state* graphic-options-item-selected) 1) + (let ((s2-3 arg1)) + (set! (-> s2-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 25 f30-0) + ) + (else + (let ((a0-21 arg1)) + (set! (-> a0-21 color) (font-color #7efbfb)) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 23.0 (-> arg1 origin y))) + (cond + ((= s3-0 'aspect4x3) + (format + (clear *temp-string*) + "~1L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-aspect-4x3) #f) + (lookup-text! *common-text* (game-text-id progress-aspect-16x9) #f) + ) + (set! a0-12 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~1L~S~1L" + (lookup-text! *common-text* (game-text-id progress-aspect-4x3) #f) + (lookup-text! *common-text* (game-text-id progress-aspect-16x9) #f) + ) + (set! a0-12 *temp-string*) + ) + ) + ) + ) + ) + (if (not (and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + ) + (print-menu-text a0-12 (-> obj scale) arg1 arg0) + ) + (draw-decoration obj arg1 f30-0 284 #f 0.95) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-on-off-progressive-scan-graphic-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-on-off-progressive-scan-graphic-option ((obj menu-on-off-progressive-scan-graphic-option) + (arg0 progress) + (arg1 font-context) + (arg2 int) + (arg3 symbol) + ) + (local-vars (a0-11 string)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((v1-4 arg1)) + (set! (-> v1-4 scale) 0.75) + ) + (set! (-> arg1 height) 35.0) + (set! (-> arg1 origin y) (+ 35.0 (-> arg1 origin y))) + (let ((s3-0 (-> *progress-state* graphic-options-progressive-scan))) + (cond + ((and (= (-> *progress-state* graphic-options-item-selected) 2) + (-> *progress-state* graphic-options-item-picked) + ) + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (let ((a0-3 arg1)) + (set! (-> a0-3 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 42 f30-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + (s3-0 + (format + (clear *temp-string*) + "~33L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + ) + ) + (else + (set! (-> arg1 origin y) (+ -8.0 (-> arg1 origin y))) + (when (not (and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + ) + (cond + ((= (-> *progress-state* graphic-options-item-selected) 2) + (let ((s2-3 arg1)) + (set! (-> s2-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 24 f30-0) + ) + (else + (let ((a0-20 arg1)) + (set! (-> a0-20 color) (font-color #7efbfb)) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 18.0 (-> arg1 origin y))) + (cond + (s3-0 + (format + (clear *temp-string*) + "~1L~S~35L ~S" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~35L~S ~1L~S~1L" + (lookup-text! *common-text* (game-text-id progress-on) #f) + (lookup-text! *common-text* (game-text-id progress-off) #f) + ) + (set! a0-11 *temp-string*) + ) + ) + ) + ) + ) + ) + (if (not (and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + ) + (print-menu-text a0-11 (-> obj scale) arg1 arg0) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-center-screen-graphic-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-center-screen-graphic-option ((obj menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (set! (-> arg1 height) 35.0) + (let ((v1-5 arg1)) + (set! (-> v1-5 scale) 0.75) + ) + (cond + ((and (zero? (-> *progress-state* graphic-options-item-selected)) + (-> *progress-state* graphic-options-item-picked) + ) + (let ((v1-10 arg1)) + (set! (-> v1-10 scale) 0.6) + ) + (let ((a0-3 arg1)) + (set! (-> a0-3 color) (font-color #f9f9f9)) + ) + (set! (-> arg1 width) 350.0) + (set! (-> arg1 height) 60.0) + (set! (-> arg1 origin x) 80.0) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg1 origin y) (+ 5.0 (-> arg1 origin y))) + ) + (('aspect16x9) + (set! (-> arg1 origin y) (+ 30.0 (-> arg1 origin y))) + ) + ) + (when (= (-> *setting-control* user-default language) (language-enum french)) + (let ((v1-23 arg1)) + (set! (-> v1-23 scale) 0.55) + ) + ) + (let ((s5-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 160) + (s5-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 21.0 (-> arg1 origin y))) + (let ((s5-2 print-game-text)) + (format + (clear *temp-string*) + "~33L~C~34L~S~33L~C" + 163 + (lookup-text! *common-text* (game-text-id progress-move-dpad) #f) + 161 + ) + (s5-2 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 21.0 (-> arg1 origin y))) + (let ((s5-3 print-game-text)) + (format (clear *temp-string*) "~33L~C" 162) + (s5-3 *temp-string* arg1 #f 44 320) + ) + (+! (-> arg1 origin y) + (the float (if (and (= (-> *progress-state* starting-state) 'title) (= (scf-get-territory) 1)) + 100 + 80 + ) + ) + ) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg1 origin y) (+ -3.0 (-> arg1 origin y))) + ) + (('aspect16x9) + (set! (-> arg1 origin y) (+ 10.0 (-> arg1 origin y))) + ) + ) + (let ((v1-37 arg1)) + (set! (-> v1-37 scale) 0.5) + ) + (print-game-text + (lookup-text! *common-text* (game-text-id progress-unknown-square-to-reset) #f) + arg1 + #f + 44 + 320 + ) + ) + (else + (set! (-> arg1 origin y) (+ 5.0 (-> arg1 origin y))) + (cond + ((zero? (-> *progress-state* graphic-options-item-selected)) + (let ((s4-3 arg1)) + (set! (-> s4-3 color) (the-as font-color (progress-selected 0))) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 25 f30-0) + ) + (else + (let ((a0-31 arg1)) + (set! (-> a0-31 color) (font-color #7efbfb)) + ) + ) + ) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-restart-mission-qr-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-restart-mission-qr-option ((obj menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-11 string)) + (let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f0-1 0.0) + (set! f0-1 0.0) + ) + (set! (-> arg1 alpha) f0-1) + (let ((v1-4 arg1)) + (set! (-> v1-4 scale) 0.75) + ) + (set! (-> arg1 height) 35.0) + (set! (-> arg1 origin y) (+ 5.0 (-> arg1 origin y))) + (let ((s4-0 (&-> *progress-state* yes-no-choice))) + (set! a0-11 + (cond + ((and (zero? (-> *progress-state* qr-options-item-selected)) (-> *progress-state* qr-options-item-picked)) + (let ((a0-2 arg1)) + (set! (-> a0-2 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 50 f0-1) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 25.0 (-> arg1 origin y))) + (let ((v1-17 arg1)) + (set! (-> v1-17 scale) 0.6) + ) + (cond + ((-> s4-0 0) + (format + (clear *temp-string*) + "~33L~S~32L ~S" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-11 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~32L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-11 *temp-string*) + ) + ) + a0-11 + ) + (else + (if (and (= (-> arg0 option-index) arg2) (zero? (-> *progress-state* qr-options-item-selected))) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 26 f0-1) + ) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + *temp-string* + ) + ) + ) + ) + ) + (print-game-text a0-11 arg1 #f 44 320) + 0 + (none) + ) + +;; definition for method 10 of type menu-quit-qr-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-quit-qr-option ((obj menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (a0-12 string)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((v1-4 arg1)) + (set! (-> v1-4 scale) 0.75) + ) + (set! (-> arg1 origin y) (+ 45.0 (-> arg1 origin y))) + (set! (-> arg1 height) 35.0) + (let ((s4-0 (&-> *progress-state* yes-no-choice))) + (set! a0-12 + (cond + ((and (= (-> *progress-state* qr-options-item-selected) 1) (-> *progress-state* qr-options-item-picked)) + (let ((a0-3 arg1)) + (set! (-> a0-3 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 50 f30-0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (set! (-> arg1 origin y) (+ 25.0 (-> arg1 origin y))) + (let ((v1-18 arg1)) + (set! (-> v1-18 scale) 0.6) + ) + (cond + ((-> s4-0 0) + (format + (clear *temp-string*) + "~33L~S~32L ~S" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-12 *temp-string*) + ) + (else + (format + (clear *temp-string*) + "~32L~S ~33L~S~1L" + (lookup-text! *common-text* (game-text-id progress-yes) #f) + (lookup-text! *common-text* (game-text-id progress-no) #f) + ) + (set! a0-12 *temp-string*) + ) + ) + a0-12 + ) + (else + (if (and (= (-> arg0 option-index) arg2) (= (-> *progress-state* qr-options-item-selected) 1)) + (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 26 f30-0) + ) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + *temp-string* + ) + ) + ) + ) + (print-game-text a0-12 arg1 #f 44 320) + (cond + ((= (-> *setting-control* user-default language) (language-enum french)) + (draw-decoration obj arg1 f30-0 371 #f 0.8) + ) + ((= (-> *setting-control* user-default language) (language-enum german)) + (draw-decoration obj arg1 f30-0 371 #f 0.7) + ) + (else + (draw-decoration obj arg1 f30-0 371 #f 0.95) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-slider-option +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars + (v0-42 pointer) + (sv-16 progress) + (sv-32 symbol) + (sv-48 int) + (sv-64 int) + (sv-80 int) + (sv-96 int) + (sv-112 int) + (sv-128 pointer) + (sv-144 (function string font-context symbol int int float)) + (sv-160 uint) + (sv-176 dma-buffer) + (sv-192 pointer) + (sv-208 pointer) + (sv-224 (function string font-context symbol int int float)) + (sv-240 uint) + (sv-256 dma-buffer) + (sv-272 pointer) + ) + (set! sv-16 arg0) + (let ((s5-0 arg1) + (gp-0 arg2) + ) + (set! sv-32 arg3) + (let ((f30-0 (* 2.0 (- 0.5 (-> sv-16 menu-transition))))) + (set! sv-48 128) + (let ((s1-0 sv-48) + (s0-0 9) + (s2-0 157) + (f28-0 2.0) + (s3-0 252) + ) + (set! sv-64 20) + (set! sv-80 0) + (set! sv-96 112) + (set! sv-112 127) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> s5-0 alpha) f30-0) + (set! v0-42 + (cond + ((not (-> *bigmap* progress-minimap)) + (draw-busy-loading s5-0) + v0-42 + ) + (else + (let ((v1-13 s5-0)) + (set! (-> v1-13 scale) 0.6) + ) + (set! (-> s5-0 origin y) (+ 20.0 (-> s5-0 origin y))) + (case (get-aspect-ratio) + (('aspect4x3) + (set! s2-0 157) + (let ((v1-17 gp-0)) + (cond + ((zero? v1-17) + (set! (-> s5-0 origin y) (+ -24.0 (-> s5-0 origin y))) + (+! s2-0 -9) + ) + ((= v1-17 1) + (set! (-> s5-0 origin y) (+ -9.0 (-> s5-0 origin y))) + (+! s2-0 43) + ) + ((= v1-17 2) + (set! (-> s5-0 origin y) (+ 6.0 (-> s5-0 origin y))) + (+! s2-0 96) + ) + ) + ) + ) + (('aspect16x9) + (set! s2-0 172) + (set! f28-0 2.62) + (set! s0-0 5) + (set! s3-0 250) + (let ((v1-28 gp-0)) + (cond + ((zero? v1-28) + (set! (-> s5-0 origin y) (+ -20.0 (-> s5-0 origin y))) + (+! s2-0 -20) + ) + ((= v1-28 1) + (set! (-> s5-0 origin y) (+ 2.0 (-> s5-0 origin y))) + (+! s2-0 40) + ) + ((= v1-28 2) + (set! (-> s5-0 origin y) (+ 30.0 (-> s5-0 origin y))) + (+! s2-0 105) + ) + ) + ) + ) + ) + (let ((a0-11 s5-0)) + (set! (-> a0-11 flags) (font-flags kerning large)) + ) + (set! (-> s5-0 origin x) (the float sv-48)) + (cond + (sv-32 + (set! sv-128 (-> obj value-to-modify)) + (set! (-> s5-0 origin y) (+ -8.0 (-> s5-0 origin y))) + (let ((a0-12 s5-0)) + (set! (-> a0-12 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -2.0 (-> s5-0 origin y))) 52 f30-0) + (set! sv-144 print-game-text) + (let ((a0-15 (lookup-text! *common-text* (-> obj name) #f)) + (a1-3 s5-0) + (a2-3 #f) + (a3-1 44) + (t0-1 320) + ) + (sv-144 a0-15 a1-3 a2-3 a3-1 t0-1) + ) + (set! sv-160 + (logior (logand (logior (logand (logior (logand (logior (logand (the-as uint #x8000ffff) -256) + (shr (shl (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-128)))) 56) 56) + ) + -65281 + ) + (shr (shl (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-128)))) 56) 48) + ) + -16711681 + ) + (shr (shl (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-128)))) 56) 40) + ) + (the-as uint #xffffffff00ffffff) + ) + (shr (shl (the int (* 128.0 f30-0)) 56) 32) + ) + ) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) + (set! (-> obj sprites 0 scale-x) f28-0) + (set! (-> obj sprites 0 scale-y) 0.7) + (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 0 pos z) #x3fffff) + (set! (-> obj sprites 0 pos w) 0) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) + (set! (-> obj sprites 1 scale-x) 0.2) + (set! (-> obj sprites 1 scale-y) 1.33) + (set-vector! (-> obj sprites 1 color) 128 128 128 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 1 pos z) #x3fffff) + (set! (-> obj sprites 1 pos w) 0) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) + (set! (-> obj sprites 2 scale-x) 1.0) + (set! (-> obj sprites 2 scale-y) 1.0) + (set-vector! (-> obj sprites 2 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 2 pos z) #xffffff) + (set! (-> obj sprites 2 pos w) 0) + (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) + (set! (-> obj sprites 3 scale-x) 1.0) + (set! (-> obj sprites 3 scale-y) 1.0) + (set-vector! (-> obj sprites 3 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 3 pos z) #xffffff) + (set! (-> obj sprites 3 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) s1-0 s2-0) + (set-hud-piece-position! + (-> obj sprites 1) + (+ s1-0 (the int (* 230.0 (-> (the-as (pointer float) sv-128))))) + (+ s2-0 -4) + ) + (set-hud-piece-position! (-> obj sprites 2) (- s1-0 sv-64) (+ s2-0 -4)) + (set-hud-piece-position! (-> obj sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) + (set! sv-176 (-> *display* frames (-> *display* on-screen) global-buf)) + (set! sv-192 (-> sv-176 base)) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + sv-176 + (-> *level* default-level) + ) + (draw-sprite2d-xy + sv-176 + (+ s1-0 s0-0 (the int (* 230.0 (-> (the-as (pointer float) sv-128))))) + (+ s2-0 7) + (- 240 (the int (* 230.0 (-> (the-as (pointer float) sv-128))))) + 9 + (the-as rgba sv-160) + ) + (hud-sprite-method-9 (-> obj sprites 1) sv-176 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 2) sv-176 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 3) sv-176 (-> *level* default-level)) + (let ((a3-6 (-> sv-176 base))) + (let ((v1-100 (the-as object (-> sv-176 base)))) + (set! (-> (the-as dma-packet v1-100) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-100) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-100) vif1) (new 'static 'vif-tag)) + (set! (-> sv-176 base) (&+ (the-as pointer v1-100) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + sv-192 + (the-as (pointer dma-tag) a3-6) + ) + ) + (+! (-> s5-0 origin x) (the float s3-0)) + (let ((a0-71 s5-0)) + (set! (-> a0-71 flags) (font-flags kerning right large)) + ) + (let ((s3-1 print-game-text)) + (format (clear *temp-string*) "~D%" (the int (* 100.0 (-> (the-as (pointer float) sv-128))))) + (s3-1 *temp-string* s5-0 #f 44 320) + ) + (let ((a0-75 s5-0)) + (set! (-> a0-75 flags) (font-flags kerning large)) + ) + ) + (else + (set! sv-208 (-> obj value-to-modify)) + (set! (-> s5-0 origin y) (+ -8.0 (-> s5-0 origin y))) + (when (or (= (-> *setting-control* user-default language) (language-enum german)) + (= (-> *setting-control* user-default language) (language-enum french)) + ) + (let ((v1-121 s5-0)) + (set! (-> v1-121 scale) 0.56) + ) + ) + (if (= (-> sv-16 option-index) gp-0) + (draw-highlight (the int (+ -2.0 (-> s5-0 origin y))) 24 f30-0) + ) + (set! sv-224 print-game-text) + (let ((a0-81 (lookup-text! *common-text* (-> obj name) #f)) + (a1-21 s5-0) + (a2-18 #f) + (a3-8 44) + (t0-4 320) + ) + (sv-224 a0-81 a1-21 a2-18 a3-8 t0-4) + ) + (set! sv-240 + (logior (logand (logior (logand (logior (logand (logior (logand (the-as uint #x8000ffff) -256) + (shr (shl (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-208)))) 56) 56) + ) + -65281 + ) + (shr (shl (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-208)))) 56) 48) + ) + -16711681 + ) + (shr (shl (the int (* 0.0 f30-0 (-> (the-as (pointer float) sv-208)))) 56) 40) + ) + (the-as uint #xffffffff00ffffff) + ) + (shr (shl (the int (* 128.0 f30-0)) 56) 32) + ) + ) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) + (set! (-> obj sprites 0 scale-x) f28-0) + (set! (-> obj sprites 0 scale-y) 0.7) + (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 0 pos z) #x3fffff) + (set! (-> obj sprites 0 pos w) 0) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) + (set! (-> obj sprites 1 scale-x) 0.2) + (set! (-> obj sprites 1 scale-y) 1.33) + (set-vector! (-> obj sprites 1 color) 128 128 128 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 1 pos z) #x3fffff) + (set! (-> obj sprites 1 pos w) 0) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) + (set! (-> obj sprites 2 scale-x) 1.0) + (set! (-> obj sprites 2 scale-y) 1.0) + (set-vector! (-> obj sprites 2 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 2 pos z) #xffffff) + (set! (-> obj sprites 2 pos w) 0) + (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) + (set! (-> obj sprites 3 scale-x) 1.0) + (set! (-> obj sprites 3 scale-y) 1.0) + (set-vector! (-> obj sprites 3 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (set! (-> obj sprites 3 pos z) #xffffff) + (set! (-> obj sprites 3 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) s1-0 s2-0) + (set-hud-piece-position! + (-> obj sprites 1) + (+ s1-0 (the int (* 230.0 (-> (the-as (pointer float) sv-208))))) + (+ s2-0 -4) + ) + (set-hud-piece-position! (-> obj sprites 2) (- s1-0 sv-64) (+ s2-0 -4)) + (set-hud-piece-position! (-> obj sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) + (set! sv-256 (-> *display* frames (-> *display* on-screen) global-buf)) + (set! sv-272 (-> sv-256 base)) + ((method-of-type hud-sprite hud-sprite-method-9) + (the-as hud-sprite (-> obj sprites)) + sv-256 + (-> *level* default-level) + ) + (draw-sprite2d-xy + sv-256 + (+ s1-0 s0-0 (the int (* 230.0 (-> (the-as (pointer float) sv-208))))) + (+ s2-0 7) + (- 240 (the int (* 230.0 (-> (the-as (pointer float) sv-208))))) + 9 + (the-as rgba sv-240) + ) + (hud-sprite-method-9 (-> obj sprites 1) sv-256 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 2) sv-256 (-> *level* default-level)) + (hud-sprite-method-9 (-> obj sprites 3) sv-256 (-> *level* default-level)) + (let ((a3-13 (-> sv-256 base))) + (let ((v1-183 (the-as object (-> sv-256 base)))) + (set! (-> (the-as dma-packet v1-183) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-183) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-183) vif1) (new 'static 'vif-tag)) + (set! (-> sv-256 base) (&+ (the-as pointer v1-183) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + sv-272 + (the-as (pointer dma-tag) a3-13) + ) + ) + (+! (-> s5-0 origin x) (the float s3-0)) + (let ((a0-137 s5-0)) + (set! (-> a0-137 flags) (font-flags kerning right large)) + ) + (let ((s3-2 print-game-text)) + (format (clear *temp-string*) "~D%" (the int (* 100.0 (-> (the-as (pointer float) sv-208))))) + (s3-2 *temp-string* s5-0 #f 44 320) + ) + (let ((a0-141 s5-0)) + (set! (-> a0-141 flags) (font-flags kerning large)) + ) + ) + ) + (if (zero? gp-0) + (draw-sound-options-decoration obj s5-0 f30-0 (the-as symbol 285) (the-as game-text-id #f)) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-stereo-mode-sound-option +;; WARN: Return type mismatch int vs none. +(defmethod menu-option-method-10 menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (s5-0 int)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) + (let ((v1-2 arg1)) + (set! (-> v1-2 scale) 0.65) + ) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((a0-2 arg1)) + (set! (-> a0-2 flags) (font-flags kerning middle large)) + ) + (cond + ((not (-> *bigmap* progress-minimap)) + (draw-busy-loading arg1) + ) + ((begin + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg1 origin y) (+ 32.0 (-> arg1 origin y))) + ) + (('aspect16x9) + (set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y))) + ) + ) + (set! s5-0 (-> *setting-control* user-default stereo-mode)) + arg3 + ) + (let ((a0-7 arg1)) + (set! (-> a0-7 color) (font-color #f9f9f9)) + ) + (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 42 f30-0) + (let ((s3-1 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (s3-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin y) (+ 22.0 (-> arg1 origin y))) + (let ((a0-13 arg1)) + (set! (-> a0-13 color) (font-color #7efbfb)) + ) + (let ((v1-22 arg1)) + (set! (-> v1-22 scale) 0.5) + ) + (let ((a0-15 arg1)) + (set! (-> a0-15 color) (font-color #7efbfb)) + ) + (set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x))) + (let ((s4-1 print-game-text)) + (format (clear *temp-string*) "~33L~C" 163) + (s4-1 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) (+ 70.0 (-> arg1 origin x))) + (set! (-> arg1 origin x) (+ 70.0 (-> arg1 origin x))) + (let ((s4-2 print-game-text)) + (format (clear *temp-string*) "~33L~C" 161) + (s4-2 *temp-string* arg1 #f 44 320) + ) + (set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x))) + (let ((s4-3 arg1)) + (set! (-> s4-3 color) (the-as font-color (progress-selected 0))) + ) + (let ((a0-23 arg1)) + (set! (-> a0-23 flags) (font-flags kerning middle large)) + ) + (print-game-text (lookup-text! *common-text* (-> *stereo-mode-name-remap* s5-0) #f) arg1 #f 44 320) + ) + (else + (if (= (-> arg0 option-index) arg2) + (draw-highlight (the int (-> arg1 origin y)) 21 f30-0) + ) + (let ((v1-37 arg1)) + (set! (-> v1-37 scale) 0.65) + ) + (let ((s3-4 print-game-text)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (s3-4 *temp-string* arg1 #f 44 320) + ) + (let ((v1-39 arg1)) + (set! (-> v1-39 scale) 0.5) + ) + (let ((a0-33 arg1)) + (set! (-> a0-33 color) (font-color #7efbfb)) + ) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> *stereo-mode-name-remap* s5-0) #f)) + (let ((a0-37 *temp-string*)) + (set! (-> arg1 origin y) (+ 22.0 (-> arg1 origin y))) + (let ((a1-19 arg1)) + (set! (-> a1-19 flags) (font-flags kerning middle large)) + ) + (print-game-text a0-37 arg1 #f 44 320) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type menu-sub-menu-option +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 349] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 361] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 417] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 435] +(defmethod menu-option-method-10 menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) + (local-vars (sv-16 dma-buffer)) + (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) + (s2-0 (the int (+ -1.0 (-> arg1 origin y)))) + (s1-0 22) + ) + (if (< f30-0 0.0) + (set! f30-0 0.0) + ) + (set! (-> arg1 alpha) f30-0) + (let ((v1-5 arg1)) + (set! (-> v1-5 scale) 0.6) + ) + (cond + ((= *title* (-> arg0 current-options)) + (let ((v1-8 arg1)) + (set! (-> v1-8 scale) 0.85) + ) + (set! (-> arg1 height) 40.0) + (set! s1-0 36) + (+! s2-0 -8) + (when (memcard-unlocked-secrets? #f) + (set! (-> arg1 origin y) (+ -35.0 (-> arg1 origin y))) + (set! s1-0 36) + (+! s2-0 -34) + ) + ) + ((= *options* (-> arg0 current-options)) + (set! (-> arg1 origin y) (+ -20.0 (-> arg1 origin y))) + (let ((v1-16 arg1)) + (set! (-> v1-16 scale) 0.85) + ) + (set! (-> arg1 height) 40.0) + (set! s1-0 37) + (+! s2-0 -28) + ) + ) + (when (nonzero? (-> obj name)) + (let ((s0-0 arg1)) + (set! (-> s0-0 color) (if (= arg2 (-> arg0 option-index)) + (the-as font-color (progress-selected 0)) + (font-color #7efbfb) + ) + ) + ) + (cond + ((= arg2 (-> arg0 option-index)) + (let ((s0-1 arg1)) + (set! (-> s0-1 color) (the-as font-color (progress-selected 0))) + ) + ) + (else + (let ((a0-9 arg1)) + (set! (-> a0-9 color) (font-color #7efbfb)) + ) + ) + ) + (if (and (and (= arg2 (-> arg0 option-index)) (!= 298 (-> obj name))) + (not (and (= (-> obj name) (game-text-id progress-root-secrets)) + (= *title* (-> arg0 current-options)) + (not (memcard-unlocked-secrets? #f)) + (= (-> arg0 option-index) 3) + ) + ) + ) + (draw-highlight s2-0 s1-0 f30-0) + ) + (cond + ((= *save-options-title* (-> arg0 current-options)) + (cond + ((= (-> obj name) (game-text-id progress-continue-without-saving)) + (cond + ((= arg2 (-> arg0 option-index)) + (let ((v1-39 arg1)) + (set! (-> v1-39 scale) 0.5) + ) + ) + (else + (let ((v1-40 arg1)) + (set! (-> v1-40 scale) 0.45) + ) + ) + ) + (set! (-> arg1 origin y) (+ -120.0 (-> arg1 origin y))) + (set! (-> arg1 origin x) (- (-> arg1 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 10 + 5 + ) + ) + ) + ) + (set! (-> arg1 width) (the float (if (= (get-aspect-ratio) 'aspect4x3) + 180 + 170 + ) + ) + ) + (set! (-> arg1 height) 260.0) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + (when (= arg2 (-> arg0 option-index)) + (let ((s4-1 69) + (s2-4 110) + (s3-1 176) + (s1-1 42) + ) + (case (get-aspect-ratio) + (('aspect16x9) + (set! s4-1 79) + (set! s2-4 110) + (set! s3-1 166) + (set! s1-1 42) + (set! sv-16 (-> *display* frames (-> *display* on-screen) global-buf)) + (let ((s0-2 (-> sv-16 base))) + (draw-sprite2d-xy + sv-16 + s4-1 + (+ (* s1-1 arg2) 8 s1-1 s2-4) + s3-1 + (+ s1-1 -8) + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 f30-0))) + ) + (let ((a3-3 (-> sv-16 base))) + (let ((v1-62 (the-as object (-> sv-16 base)))) + (set! (-> (the-as dma-packet v1-62) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-62) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-62) vif1) (new 'static 'vif-tag)) + (set! (-> sv-16 base) (&+ (the-as pointer v1-62) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + s0-2 + (the-as (pointer dma-tag) a3-3) + ) + ) + ) + ) + ) + (set-vector! (-> obj box 0 color) 64 128 128 (the int (* 128.0 f30-0))) + (draw-savegame-box + obj + (the float s4-1) + (the float (+ s4-1 s3-1)) + (the float (+ s2-4 (* s1-1 arg2))) + (the float (+ s2-4 (* s1-1 arg2))) + ) + (draw-savegame-box + obj + (the float (+ s4-1 s3-1)) + (the float (+ s4-1 s3-1)) + (the float s2-4) + (the float (+ s2-4 (* s1-1 arg2))) + ) + (let* ((s0-3 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-1 (-> s0-3 base)) + ) + (draw-sprite2d-xy + s0-3 + s4-1 + (+ s2-4 (* s1-1 arg2)) + s3-1 + (+ s1-1 8) + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 f30-0))) + ) + (let ((a3-7 (-> s0-3 base))) + (let ((v1-87 (the-as object (-> s0-3 base)))) + (set! (-> (the-as dma-packet v1-87) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-87) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-87) vif1) (new 'static 'vif-tag)) + (set! (-> s0-3 base) (&+ (the-as pointer v1-87) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id particles) + gp-1 + (the-as (pointer dma-tag) a3-7) + ) + ) + ) + ) + ) + ) + (else + (set! (-> arg1 origin x) (+ -100.0 (-> arg1 origin x))) + (set! (-> arg1 origin y) (+ -35.0 (-> arg1 origin y))) + ) + ) + ) + ((= *load-save-options* (-> arg0 current-options)) + (set! (-> arg1 origin x) (+ -100.0 (-> arg1 origin x))) + (set! (-> arg1 origin y) (+ -25.0 (-> arg1 origin y))) + (print-menu-text (lookup-text! *common-text* (-> obj name) #f) (-> obj scale) arg1 arg0) + ) + ((and (= *title* (-> arg0 current-options)) (= 339 (-> obj name)) (memcard-unlocked-secrets? #f)) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + ) + ((!= (-> obj name) (game-text-id progress-root-secrets)) + (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 320) + ) + ) + ) + ) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc index c6be54dbe7..7598d3ef48 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc @@ -90,16 +90,18 @@ ;; definition of type menu-option (deftype menu-option (basic) - ((name uint32 :offset-assert 4) - (scale basic :offset-assert 8) - (box bounding-box 1 :inline :offset-assert 16) + ((name game-text-id :offset-assert 4) + (scale float :offset-assert 8) + (unknown function :offset-assert 12) + (box hud-box 1 :inline :offset-assert 16) + (options menu-option 8 :offset 16) ) :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 (:methods - (respond-progress (_type_ progress object symbol) int 9) - (menu-option-method-10 () none 10) + (respond-progress (_type_ progress object) int :behavior progress 9) + (menu-option-method-10 (_type_ progress font-context int symbol) none 10) (menu-option-method-11 () none 11) ) ) @@ -120,7 +122,7 @@ ;; definition of type menu-on-off-option (deftype menu-on-off-option (menu-option) - ((value-to-modify pointer :offset-assert 48) + ((value-to-modify (pointer symbol) :offset-assert 48) ) :method-count-assert 12 :size-assert #x34 @@ -168,10 +170,10 @@ ;; definition of type menu-language-option (deftype menu-language-option (menu-option) - ((language-selection uint64 :offset-assert 48) - (language-direction basic :offset-assert 56) - (language-transition basic :offset-assert 60) - (language-x-offset int32 :offset-assert 64) + ((language-selection language-enum :offset-assert 48) + (language-direction symbol :offset-assert 56) + (language-transition basic :offset-assert 60) + (language-x-offset int32 :offset-assert 64) ) :method-count-assert 12 :size-assert #x44 @@ -990,13 +992,13 @@ ;; definition of type menu-secret-option (deftype menu-secret-option (menu-option) - ((item-index int32 :offset-assert 48) - (prev-item-index int32 :offset-assert 52) - (num-items int32 :offset-assert 56) - (num-hero-items int32 :offset-assert 60) - (secret-items basic :offset-assert 64) - (last-move uint64 :offset-assert 72) - (sprites hud-sprite 2 :inline :offset-assert 80) + ((item-index int32 :offset-assert 48) + (prev-item-index int32 :offset-assert 52) + (num-items int32 :offset-assert 56) + (num-hero-items int32 :offset-assert 60) + (secret-items (array secret-item-option) :offset-assert 64) + (last-move uint64 :offset-assert 72) + (sprites hud-sprite 2 :inline :offset-assert 80) ) :method-count-assert 12 :size-assert #xd0 @@ -1053,8 +1055,8 @@ ;; definition of type menu-qr-option (deftype menu-qr-option (menu-option) - ((last-move uint64 :offset-assert 48) - (value-to-modify uint32 :offset 60) + ((last-move uint64 :offset-assert 48) + (value-to-modify function :offset 60) ) :method-count-assert 12 :size-assert #x40 diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-static_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-static_REF.gc new file mode 100644 index 0000000000..a05f802e54 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-static_REF.gc @@ -0,0 +1,995 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(let ((a0-0 (new 'static 'skeleton-group + :name "skel-hud-ring" + :extra #f + :info #f + :art-group-name "hud-ring" + :bounds (new 'static 'vector :w 225280.0) + :version #x7 + ) + ) + ) + (set! (-> a0-0 jgeo) 0) + (set! (-> a0-0 janim) 2) + (set! (-> a0-0 mgeo 0) 1) + (set! (-> a0-0 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-0) + ) + +;; failed to figure out what this is: +(let ((a0-1 (new 'static 'skeleton-group + :name "skel-hud-ring-part" + :extra #f + :info #f + :art-group-name "hud-ring" + :bounds (new 'static 'vector :w 225280.0) + :version #x7 + ) + ) + ) + (set! (-> a0-1 jgeo) 3) + (set! (-> a0-1 janim) 5) + (set! (-> a0-1 mgeo 0) 4) + (set! (-> a0-1 lod-dist 0) 4095996000.0) + (add-to-loading-level a0-1) + ) + +;; definition for symbol *main-options*, type menu-option-list +(define *main-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *main-options-debug*, type menu-option-list +(define *main-options-debug* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *main-kiosk-options*, type menu-option-list +(define *main-kiosk-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *main-demo-options*, type menu-option-list +(define *main-demo-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *title*, type menu-option-list +(define *title* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *unlocked-secrets*, type menu-option-list +(define *unlocked-secrets* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *options*, type menu-option-list +(define *options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *game-options*, type menu-option-list +(define *game-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *game-options-japan*, type menu-option-list +(define *game-options-japan* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *game-options-demo*, type menu-option-list +(define *game-options-demo* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *graphic-options*, type menu-option-list +(define *graphic-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *graphic-title-options-pal*, type menu-option-list +(define *graphic-title-options-pal* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *sound-options*, type menu-option-list +(define *sound-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *quit-restart-options*, type menu-option-list +(define *quit-restart-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *load-save-options*, type menu-option-list +(define *load-save-options* (new 'static 'menu-option-list :y-center #xdc :y-space 30 :scale 0.82)) + +;; definition for symbol *save-options-title*, type menu-option-list +(define *save-options-title* (new 'static 'menu-option-list :y-center #xdc :y-space 30 :scale 0.82)) + +;; definition for symbol *loading-options*, type menu-option-list +(define *loading-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *insufficient-space-options*, type menu-option-list +(define *insufficient-space-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *secrets-insufficient-space-options*, type menu-option-list +(define *secrets-insufficient-space-options* + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) + +;; definition for symbol *insert-card-options*, type menu-option-list +(define *insert-card-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *error-loading-options*, type menu-option-list +(define *error-loading-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *error-auto-saving-options*, type menu-option-list +(define *error-auto-saving-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *card-removed-options*, type menu-option-list +(define *card-removed-options* (new 'static 'menu-option-list :y-center #x104 :y-space 30 :scale 0.82)) + +;; definition for symbol *error-disc-removed-options*, type menu-option-list +(define *error-disc-removed-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *error-reading-options*, type menu-option-list +(define *error-reading-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *icon-info-options*, type menu-option-list +(define *icon-info-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *format-card-options*, type menu-option-list +(define *format-card-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *already-exists-options*, type menu-option-list +(define *already-exists-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *create-game-options*, type menu-option-list +(define *create-game-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *video-mode-warning-options*, type menu-option-list +(define *video-mode-warning-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *video-mode-ok-options*, type menu-option-list +(define *video-mode-ok-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *progressive-mode-warning-options*, type menu-option-list +(define *progressive-mode-warning-options* + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) + +;; definition for symbol *progressive-mode-ok-options*, type menu-option-list +(define *progressive-mode-ok-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *quit-options*, type menu-option-list +(define *quit-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *select-start-options*, type menu-option-list +(define *select-start-options* + "List of [[menu-select-start-option]]" + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) + +;; definition for symbol *select-scene-options*, type menu-option-list +(define *select-scene-options* + "List of [[menu-select-scene-option]]" + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) + +;; definition for symbol *bigmap-options*, type menu-option-list +(define *bigmap-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *missions-options*, type menu-option-list +(define *missions-options* + "List of [[menu-missions-option]]" + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) + +;; definition for symbol *highscores-options*, type menu-option-list +(define *highscores-options* + "List of [[menu-highscores-option]]" + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) + +;; definition for symbol *secret-options*, type menu-option-list +(define *secret-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) + +;; definition for symbol *language-name-remap*, type (array game-text-id) +(define *language-name-remap* + (the-as (array game-text-id) + (new 'static 'boxed-array :type uint32 #x111 #x112 #x113 #x114 #x115 #x117 #x116 #x30b) + ) + ) + +;; definition for symbol *stereo-mode-name-remap*, type (array game-text-id) +(define *stereo-mode-name-remap* + (the-as (array game-text-id) (new 'static 'boxed-array :type uint32 #x104 #x105 #x106)) + ) + +;; definition for symbol *hud-ring-graphic-remap*, type (array uint64) +(define *hud-ring-graphic-remap* + (new 'static 'boxed-array :type uint64 #x80 #x40 #x10 #x4 #x8 #x400 #x20 #x100 #x200 #x2) + ) + +;; definition for symbol *hud-ring-kiosk-graphic-remap*, type (array uint64) +(define *hud-ring-kiosk-graphic-remap* + (new 'static 'boxed-array :type uint64 #x40 #x80 #x2 #x200 #x200 #x200 #x200 #x200 #x200 #x200) + ) + +;; definition for symbol *hud-ring-demo-graphic-remap*, type (array uint64) +(define *hud-ring-demo-graphic-remap* + (new 'static 'boxed-array :type uint64 #x80 #x2 #x200 #x200 #x200 #x200 #x200 #x200 #x200 #x200) + ) + +;; definition of type hud-scene-info +(deftype hud-scene-info (basic) + ((name string :offset-assert 4) + (continue string :offset-assert 8) + (info object :offset-assert 12) + (info-str string :offset 12) + (info-list pair :offset 12) + (text uint32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type hud-scene-info +(defmethod inspect hud-scene-info ((obj hud-scene-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tcontinue: ~A~%" (-> obj continue)) + (format #t "~1Tinfo: ~A~%" (-> obj info)) + (format #t "~1Ttext: ~D~%" (-> obj text)) + (label cfg-4) + obj + ) + +;; definition for symbol *hud-select-scene-act1*, type (array hud-scene-info) +(define *hud-select-scene-act1* + (new 'static 'boxed-array :type hud-scene-info + (new 'static 'hud-scene-info + :name "intro" + :continue "village1-start" + :info '("intro-samos-hut" "intro-vortex" "intro-city-square" "intro-prison") + :text #x307 + ) + (new 'static 'hud-scene-info + :name "city-help-kid-intro" + :continue "ctyslumb-fort" + :info "city-help-kid-intro" + :text #x28c + ) + (new 'static 'hud-scene-info + :name "city-help-kid-resolution" + :continue "ctyslumb-fort" + :info "city-help-kid-resolution" + :text #x28d + ) + (new 'static 'hud-scene-info + :name "ruins-tower-intro" + :continue "ctysluma-tower-intro" + :info "ruins-tower-intro" + :text #x281 + ) + (new 'static 'hud-scene-info + :name "ruins-tower-victory" + :continue "ruins-hut" + :info "ruins-tower-victory" + :text #x282 + ) + (new 'static 'hud-scene-info :name "atoll-1-int" :continue "hideout-start" :info "atoll-1-int" :text #x2c8) + (new 'static 'hud-scene-info :name "atoll-1-res" :continue "atoll-movie" :info "atoll-1-res" :text #x2c9) + (new 'static 'hud-scene-info + :name "fortress-2-intro" + :continue "hideout-start" + :info "fortress-2-intro" + :text #x2bc + ) + (new 'static 'hud-scene-info + :name "fortress-blow-up-ammo-res-a" + :continue "fordumpc-start" + :info "fortress-blow-up-ammo-res-a" + :text #x2bd + ) + (new 'static 'hud-scene-info + :name "fortress-blow-up-ammo-res-b" + :continue "fordumpc-explode-movie" + :info "fortress-blow-up-ammo-res-b" + :text #x2be + ) + (new 'static 'hud-scene-info + :name "city-krew-delivery-intro" + :continue "hideout-start" + :info "city-krew-delivery-intro" + :text #x28f + ) + (new 'static 'hud-scene-info + :name "krew-delivery-res" + :continue "hiphog-start" + :info "krew-delivery-res" + :text #x290 + ) + (new 'static 'hud-scene-info :name "atoll-2-intro" :continue "hiphog-start" :info "atoll-2-intro" :text #x2ca) + (new 'static 'hud-scene-info + :name "atoll-sig-intro" + :continue "atoll-movie" + :info "atoll-sig-intro" + :text #x2ce + ) + (new 'static 'hud-scene-info + :name "atoll-sig-tank" + :continue "atoll-movie" + :info "atoll-sig-tank" + :text #x2cf + ) + (new 'static 'hud-scene-info + :name "atoll-sniper-a" + :continue "atoll-movie" + :info "atoll-sniper-a" + :text #x2d0 + ) + (new 'static 'hud-scene-info + :name "atoll-sniper-b" + :continue "atoll-movie" + :info "atoll-sniper-b" + :text #x2d1 + ) + (new 'static 'hud-scene-info + :name "atoll-sniper-c" + :continue "atoll-movie" + :info "atoll-sniper-c" + :text #x2d2 + ) + (new 'static 'hud-scene-info + :name "atoll-sniper-d" + :continue "atoll-movie" + :info "atoll-sniper-d" + :text #x2d3 + ) + (new 'static 'hud-scene-info + :name "atoll-sniper-e" + :continue "atoll-movie" + :info "atoll-sniper-e" + :text #x2d4 + ) + (new 'static 'hud-scene-info + :name "city-oracle-intro" + :continue "oracle-start" + :info "city-oracle-intro" + :text #x29d + ) + (new 'static 'hud-scene-info + :name "city-oracle-level-0" + :continue "oracle-start" + :info "city-oracle-level-0" + :text #x29e + ) + (new 'static 'hud-scene-info + :name "city-oracle-level-1" + :continue "oracle-start" + :info "city-oracle-level-1" + :text #x29f + ) + (new 'static 'hud-scene-info + :name "city-oracle-level-2" + :continue "oracle-start" + :info "city-oracle-level-2" + :text #x2a0 + ) + (new 'static 'hud-scene-info + :name "city-oracle-level-3" + :continue "oracle-start" + :info "city-oracle-level-3" + :text #x2a1 + ) + (new 'static 'hud-scene-info :name "sewer-1-intro" :continue "hiphog-start" :info "sewer-1-intro" :text #x2c1) + (new 'static 'hud-scene-info :name "sewer-1-res" :continue "hiphog-start" :info "sewer-1-res" :text #x2c2) + (new 'static 'hud-scene-info + :name "city-get-yellow-gun" + :continue "gungame-movie" + :info "city-get-yellow-gun" + :text #x2b2 + ) + (new 'static 'hud-scene-info + :name "vin-rescue-intro" + :continue "hideout-start" + :info "vin-rescue-intro" + :text #x286 + ) + (new 'static 'hud-scene-info :name "vin-rescue" :continue "strip-start" :info "vin-rescue" :text #x287) + (new 'static 'hud-scene-info + :name "city-keira-delivery-intro" + :continue "hiphog-start" + :info "city-keira-delivery-intro" + :text #x2a7 + ) + (new 'static 'hud-scene-info + :name "city-krew-collection-intro" + :continue "hiphog-start" + :info "city-krew-collection-intro" + :text #x2a2 + ) + (new 'static 'hud-scene-info + :name "city-krew-collection-res" + :continue "hiphog-start" + :info "city-krew-collection-res" + :text #x2a3 + ) + (new 'static 'hud-scene-info + :name "city-keira-hover-challenge-intro" + :continue "garage-start-skate" + :info "city-keira-hover-challenge-intro" + :text #x294 + ) + (new 'static 'hud-scene-info + :name "city-put-hoverboard" + :continue "skatea-start" + :info "city-put-hoverboard" + :text #x2b4 + ) + (new 'static 'hud-scene-info + :name "city-keira-hover-challenge-res" + :continue "garage-start-skate" + :info "city-keira-hover-challenge-res" + :text #x295 + ) + (new 'static 'hud-scene-info + :name "atoll-3-intro" + :continue "hideout-start" + :info "atoll-3-intro" + :text #x2cb + ) + (new 'static 'hud-scene-info + :name "atoll-save-ashelin-res-a" + :continue "atoll-movie" + :info "atoll-save-ashelin-res-a" + :text #x2cc + ) + (new 'static 'hud-scene-info + :name "atoll-save-ashelin-res-b" + :continue "atoll-movie" + :info "atoll-save-ashelin-res-b" + :text #x2cd + ) + (new 'static 'hud-scene-info + :name "drill-kill-metal-heads-intro" + :continue "vinroom-start" + :info "drill-kill-metal-heads-intro" + :text #x2d5 + ) + (new 'static 'hud-scene-info + :name "mountain-finditems-intro" + :continue "onintent-start" + :info "mountain-finditems-intro" + :text #x2d9 + ) + (new 'static 'hud-scene-info + :name "mountain-gear-res" + :continue "mountain-start" + :info "mountain-gear-res" + :text #x2da + ) + (new 'static 'hud-scene-info + :name "mountain-shard-res" + :continue "mountain-start" + :info "mountain-shard-res" + :text #x2db + ) + (new 'static 'hud-scene-info + :name "mountain-lens-res" + :continue "mountain-start" + :info "mountain-lens-res" + :text #x2dc + ) + (new 'static 'hud-scene-info + :name "city-switch-on-power-intro" + :continue "vinroom-start" + :info "city-switch-on-power-intro" + :text #x293 + ) + (new 'static 'hud-scene-info + :name "palace-outside-window-res" + :continue "palroof-throne" + :info "palace-outside-window-res" + :text #x2dd + ) + (new 'static 'hud-scene-info + :name "palace-outside-window-res-b" + :continue "palroof-boss" + :info "palace-outside-window-res-b" + :text #x2de + ) + (new 'static 'hud-scene-info + :name "palace-boss-res" + :continue "palroof-boss" + :info "palace-boss-res" + :text #x2df + ) + (new 'static 'hud-scene-info + :name "city-shuttle-underground-intro" + :continue "hideout-start" + :info "city-shuttle-underground-intro" + :text #x2a8 + ) + (new 'static 'hud-scene-info + :name "ruins-sacred-intro" + :continue "hideout-start" + :info "ruins-sacred-intro" + :text #x283 + ) + (new 'static 'hud-scene-info + :name "ruins-sacred-victory" + :continue "ruins-hut" + :info "ruins-sacred-victory" + :text #x284 + ) + ) + ) + +;; definition for symbol *hud-select-scene-act2*, type (array hud-scene-info) +(define *hud-select-scene-act2* + (new 'static 'boxed-array :type hud-scene-info + (new 'static 'hud-scene-info + :name "forest-catch-metal-heads-intro" + :continue "hideout-start" + :info "forest-catch-metal-heads-intro" + :text #x2f1 + ) + (new 'static 'hud-scene-info + :name "city-get-hoverboard" + :continue "ctyfarma-airlock-movie" + :info "city-get-hoverboard" + :text #x2b3 + ) + (new 'static 'hud-scene-info + :name "city-escort-kid-intro" + :continue "escort-kid-intro" + :info "city-escort-kid-intro" + :text #x2a4 + ) + (new 'static 'hud-scene-info + :name "dig-knock-down-scaffolding-intro" + :continue "vinroom-start" + :info "dig-knock-down-scaffolding-intro" + :text #x2f6 + ) + (new 'static 'hud-scene-info + :name "dig-digger-explode" + :continue "dig1-start" + :info "dig-digger-explode" + :text #x2fa + ) + (new 'static 'hud-scene-info + :name "city-intercept-tanker-intro" + :continue "ctymarkb-tanker" + :info "city-intercept-tanker-intro" + :text #x291 + ) + (new 'static 'hud-scene-info + :name "city-intercept-tanker-res" + :continue "ctymarkb-tanker" + :info "city-intercept-tanker-res" + :text #x292 + ) + (new 'static 'hud-scene-info + :name "city-meet-brutter-intro" + :continue "hiphog-start" + :info "city-meet-brutter-intro" + :text #x2a5 + ) + (new 'static 'hud-scene-info + :name "city-meet-brutter-res" + :continue "kiosk-start" + :info "city-meet-brutter-res" + :text #x2a6 + ) + (new 'static 'hud-scene-info :name "sewer-2-intro" :continue "hiphog-start" :info "sewer-2-intro" :text #x2c3) + (new 'static 'hud-scene-info + :name "sewer-drain-res" + :continue "sewer-start" + :info "sewer-drain-res" + :text #x2c4 + ) + (new 'static 'hud-scene-info + :name "ecowells-intro" + :continue "vinroom-start" + :info "ecowells-intro" + :text #x28a + ) + (new 'static 'hud-scene-info + :name "ecowells-victory" + :continue "strip-start" + :info "ecowells-victory" + :text #x28b + ) + (new 'static 'hud-scene-info + :name "drill-destroy-ship-intro" + :continue "vinroom-start" + :info "drill-destroy-ship-intro" + :text #x2d6 + ) + (new 'static 'hud-scene-info + :name "forest-hunt-camo-metal-heads-intro" + :continue "hiphog-start" + :info "forest-hunt-camo-metal-heads-intro" + :text #x2f2 + ) + (new 'static 'hud-scene-info + :name "city-class-3-race-intro" + :continue "garage-class3-movie" + :info "city-class-3-race-intro" + :text #x296 + ) + (new 'static 'hud-scene-info + :name "city-class-3-race-res" + :continue "garage-class3-movie" + :info "city-class-3-race-res" + :text #x297 + ) + (new 'static 'hud-scene-info + :name "city-protect-slums-intro" + :continue "ctyslumc-seal-movie" + :info "city-protect-slums-intro" + :text #x2ba + ) + (new 'static 'hud-scene-info + :name "dig-find-totem-intro" + :continue "onintent-start" + :info "dig-find-totem-intro" + :text #x2f8 + ) + (new 'static 'hud-scene-info + :name "city-air-train-in-caspad" + :continue "ctyport-air-train" + :info "city-air-train-in-caspad" + :text #x2b6 + ) + (new 'static 'hud-scene-info + :name "caspad-air-train-out" + :continue "caspad-warp" + :info "caspad-air-train-out" + :text #x2e5 + ) + (new 'static 'hud-scene-info + :name "dig-find-totem-res" + :continue "dig-totem" + :info "dig-find-totem-res" + :text #x2f9 + ) + (new 'static 'hud-scene-info + :name "caspad-air-train-in" + :continue "caspad-warp" + :info "caspad-air-train-in" + :text #x2e4 + ) + (new 'static 'hud-scene-info + :name "city-air-train-out" + :continue "ctyport-air-train" + :info "city-air-train-out" + :text #x2b8 + ) + (new 'static 'hud-scene-info + :name "city-destroy-guard-vehicles-intro" + :continue "hideout-start" + :info "city-destroy-guard-vehicles-intro" + :text #x28e + ) + (new 'static 'hud-scene-info + :name "city-play-onin-game-intro" + :continue "onintent-start" + :info "city-play-onin-game-intro" + :text #x2a9 + ) + (new 'static 'hud-scene-info + :name "city-play-onin-game-res" + :continue "onintent-start" + :info "city-play-onin-game-res" + :text #x2aa + ) + (new 'static 'hud-scene-info + :name "canyon-insert-items-intro" + :continue "mountain-movie" + :info "canyon-insert-items-intro" + :text #x2fc + ) + (new 'static 'hud-scene-info + :name "canyon-insert-items-res" + :continue "mincan-city" + :info "canyon-insert-items-res" + :text #x2fb + ) + (new 'static 'hud-scene-info + :name "tomb-face-tests-intro" + :continue "tombd-start" + :info "tomb-face-tests-intro" + :text #x2e6 + ) + (new 'static 'hud-scene-info + :name "tomb-boulder-start" + :continue "tomb-boulder" + :info "tomb-boulder-start" + :text #x2ef + ) + (new 'static 'hud-scene-info + :name "tomb-spider-scare" + :continue "tomb-boulder-explode" + :info "tomb-spider-scare" + :text #x2f0 + ) + (new 'static 'hud-scene-info + :name "tomb-unlock-start" + :continue "tomb-water-switch" + :info "tomb-unlock-start" + :text #x2e9 + ) + (new 'static 'hud-scene-info + :name "tomb-unlock-water" + :continue "tomb-water-switch" + :info "tomb-unlock-water" + :text #x2ea + ) + (new 'static 'hud-scene-info + :name "tomb-unlock-poles" + :continue "tomb-poles-switch" + :info "tomb-unlock-poles" + :text #x2eb + ) + (new 'static 'hud-scene-info + :name "tomb-boss-open" + :continue "tombboss-start" + :info "tomb-boss-open" + :text #x2ec + ) + (new 'static 'hud-scene-info + :name "tomb-boss-intro" + :continue "tombboss-start" + :info "tomb-boss-intro" + :text #x2ed + ) + (new 'static 'hud-scene-info + :name "tomb-boss-res" + :continue "tombboss-start" + :info "tomb-boss-res" + :text #x2ee + ) + ) + ) + +;; definition for symbol *hud-select-scene-act3*, type (array hud-scene-info) +(define *hud-select-scene-act3* + (new 'static 'boxed-array :type hud-scene-info + (new 'static 'hud-scene-info + :name "fortress-save-friends-intro-a" + :continue "hideout-start" + :info "fortress-save-friends-intro-a" + :text #x2bf + ) + (new 'static 'hud-scene-info + :name "fortress-save-friends-res" + :continue "prison-start" + :info "fortress-save-friends-res" + :text #x2c0 + ) + (new 'static 'hud-scene-info + :name "sewer-blow-up-statue-intro" + :continue "hiphog-start" + :info "sewer-blow-up-statue-intro" + :text #x2c5 + ) + (new 'static 'hud-scene-info + :name "sewer-hosehead" + :continue "sewesc-start" + :info "sewer-hosehead" + :text #x2c7 + ) + (new 'static 'hud-scene-info + :name "sewer-blow-up-statue-res" + :continue "sewesc-start" + :info "sewer-blow-up-statue-res" + :text #x2c6 + ) + (new 'static 'hud-scene-info + :name "city-class-2-race-intro" + :continue "garage-class3-movie" + :info "city-class-2-race-intro" + :text #x298 + ) + (new 'static 'hud-scene-info + :name "city-class-2-race-res" + :continue "garage-class3-movie" + :info "city-class-2-race-res" + :text #x299 + ) + (new 'static 'hud-scene-info + :name "city-stop-bomb-bots-intro" + :continue "hideout-start" + :info "city-stop-bomb-bots-intro" + :text #x2ac + ) + (new 'static 'hud-scene-info + :name "city-get-dark-gun" + :continue "gungame-movie" + :info "city-get-dark-gun" + :text #x2b5 + ) + (new 'static 'hud-scene-info + :name "city-errol-challenge-intro" + :continue "hiphog-start" + :info "city-errol-challenge-intro" + :text #x2ad + ) + (new 'static 'hud-scene-info + :name "city-errol-challenge-res" + :continue "garage-start-class3" + :info "city-errol-challenge-res" + :text #x2bb + ) + (new 'static 'hud-scene-info + :name "ruins-get-to-hut-res" + :continue "ruins-hut" + :info "ruins-get-to-hut-res" + :text #x285 + ) + (new 'static 'hud-scene-info + :name "forest-protect-samos-intro-a" + :continue "onintent-start" + :info "forest-protect-samos-intro-a" + :text #x2f3 + ) + (new 'static 'hud-scene-info + :name "forest-protect-samos-intro-b" + :continue "forest-tree" + :info "forest-protect-samos-intro-b" + :text #x2f4 + ) + (new 'static 'hud-scene-info + :name "forest-protect-samos-res" + :continue "forest-tree" + :info "forest-protect-samos-res" + :text #x2f5 + ) + (new 'static 'hud-scene-info :name "crane-intro" :continue "vinroom-start" :info "crane-intro" :text #x288) + (new 'static 'hud-scene-info :name "crane-victory" :continue "strip-start" :info "crane-victory" :text #x289) + (new 'static 'hud-scene-info + :name "drill-destroy-control-tower-intro" + :continue "vinroom-start" + :info "drill-destroy-control-tower-intro" + :text #x2d7 + ) + (new 'static 'hud-scene-info + :name "drill-top-explode" + :continue "drillmid-checkpoint" + :info "drill-top-explode" + :text #x2d8 + ) + (new 'static 'hud-scene-info + :name "city-save-lurkers-intro" + :continue "kiosk-start" + :info "city-save-lurkers-intro" + :text #x2ab + ) + (new 'static 'hud-scene-info + :name "city-class-1-race-intro-a" + :continue "garage-class3-movie" + :info "city-class-1-race-intro-a" + :text #x29a + ) + (new 'static 'hud-scene-info + :name "city-class-1-race-intro-b" + :continue "stadiumd-start" + :info "city-class-1-race-intro-b" + :text #x29b + ) + (new 'static 'hud-scene-info + :name "city-class-1-race-res" + :continue "stadiumd-start" + :info "city-class-1-race-res" + :text #x29c + ) + (new 'static 'hud-scene-info + :name "palace-sneak-in-res" + :continue "palroof-throne" + :info "palace-sneak-in-res" + :text #x2e0 + ) + (new 'static 'hud-scene-info + :name "castle-krew-boss-fight-intro" + :continue "casboss-start" + :info "castle-krew-boss-fight-intro" + :text #x2e2 + ) + (new 'static 'hud-scene-info + :name "castle-krew-boss-fight-res" + :continue "casboss-start" + :info "castle-krew-boss-fight-res" + :text #x2e3 + ) + (new 'static 'hud-scene-info + :name "city-ashelin-drop-off" + :continue "ctyport-air-train-ashelin" + :info "city-ashelin-drop-off" + :text #x2b9 + ) + (new 'static 'hud-scene-info + :name "city-whack-a-metal-intro" + :continue "hiphog-start" + :info "city-whack-a-metal-intro" + :text #x2ae + ) + (new 'static 'hud-scene-info + :name "city-whack-a-metal-res" + :continue "hiphog-start" + :info "city-whack-a-metal-res" + :text #x2af + ) + (new 'static 'hud-scene-info + :name "city-defend-stadium-intro" + :continue "stadium-blimp" + :info "city-defend-stadium-intro" + :text #x2b0 + ) + (new 'static 'hud-scene-info + :name "city-defend-stadium-res" + :continue "stadium-blimp" + :info "city-defend-stadium-res" + :text #x2b1 + ) + (new 'static 'hud-scene-info + :name "under-find-sig-res" + :continue "under-start" + :info "under-find-sig-res" + :text #x2fd + ) + (new 'static 'hud-scene-info + :name "under-centipede-one" + :continue "under-start" + :info "under-centipede-one" + :text #x2fe + ) + (new 'static 'hud-scene-info + :name "under-centipede-two" + :continue "under-start" + :info "under-centipede-two" + :text #x2ff + ) + (new 'static 'hud-scene-info + :name "under-centipede-three" + :continue "under-start" + :info "under-centipede-three" + :text #x300 + ) + (new 'static 'hud-scene-info + :name "under-get-sig-out-res" + :continue "under-start" + :info "under-get-sig-out-res" + :text #x301 + ) + (new 'static 'hud-scene-info + :name "consite-find-baron-res" + :continue "consite-start" + :info "consite-find-baron-res" + :text #x2e1 + ) + (new 'static 'hud-scene-info + :name "nest-break-barrier-res" + :continue "nest-gun" + :info "nest-break-barrier-res" + :text #x302 + ) + (new 'static 'hud-scene-info + :name "nest-air-train-out" + :continue "nest-warp" + :info "nest-air-train-out" + :text #x303 + ) + (new 'static 'hud-scene-info + :name "nest-air-train-in" + :continue "nest-warp" + :info "nest-air-train-in" + :text #x304 + ) + (new 'static 'hud-scene-info + :name "nest-boss-intro" + :continue "nestb-boss" + :info "nest-kor-boss-fight-intro-b" + :text #x306 + ) + (new 'static 'hud-scene-info + :name "nest-boss-mid" + :continue "nestb-boss" + :info "nest-kor-boss-fight-mid" + :text #x305 + ) + (new 'static 'hud-scene-info + :name "outro" + :continue "nestb-outro" + :info '("outro-nest" "outro-palace" "outro-hiphog" "outro-port") + :text #x308 + ) + ) + ) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc new file mode 100644 index 0000000000..2d86ce9de9 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc @@ -0,0 +1,4084 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type progress-global-state +(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) + (on-off-choice symbol :offset-assert 16) + (which-slot int32 :offset-assert 20) + (starting-state symbol :offset-assert 24) + (last-slot-saved int32 :offset-assert 28) + (slider-backup float :offset-assert 32) + (language-backup language-enum :offset-assert 40) + (center-x-backup int32 :offset-assert 48) + (center-y-backup int32 :offset-assert 52) + (aspect-ratio-backup symbol :offset-assert 56) + (last-slider-sound time-frame :offset-assert 64) + (video-mode-timeout time-frame :offset-assert 72) + (progressive-mode-timeout time-frame :offset-assert 80) + (current-task-index int32 :offset-assert 88) + (current-line-index int32 :offset-assert 92) + (first-closed-line-index int32 :offset-assert 96) + (extra-text-state int32 :offset-assert 100) + (current-task uint8 :offset-assert 104) + (num-open-tasks-found int32 :offset-assert 108) + (num-closed-tasks-found int32 :offset-assert 112) + (color-flash-counter int32 :offset-assert 116) + (num-unlocked-secrets int32 :offset-assert 120) + (game-options-item-selected int32 :offset-assert 124) + (game-options-item-picked basic :offset-assert 128) + (game-options-last-move uint64 :offset-assert 136) + (game-options-vibrations symbol :offset-assert 144) + (game-options-subtitles symbol :offset-assert 148) + (game-options-language-index int32 :offset-assert 152) + (game-options-subtitle-language-index int32 :offset-assert 156) + (graphic-options-item-selected int32 :offset-assert 160) + (graphic-options-item-picked basic :offset-assert 164) + (graphic-options-last-move uint64 :offset-assert 168) + (graphic-options-aspect-ratio symbol :offset-assert 176) + (graphic-options-progressive-scan symbol :offset-assert 180) + (qr-options-item-selected int32 :offset-assert 184) + (qr-options-item-picked basic :offset-assert 188) + (qr-options-last-move uint64 :offset-assert 192) + (qr-options-restart basic :offset-assert 200) + (qr-options-quit basic :offset-assert 204) + (total-num-tasks int32 :offset-assert 208) + (scene-player-act int32 :offset-assert 212) + (stereo-mode-backup int32 :offset-assert 216) + (secrets-unlocked symbol :offset-assert 220) + (missions-total-spacing float :offset-assert 224) + (clear-screen basic :offset-assert 228) + ) + :method-count-assert 9 + :size-assert #xe8 + :flag-assert #x9000000e8 + ) + +;; definition for method 3 of type progress-global-state +(defmethod inspect progress-global-state ((obj progress-global-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Taspect-ratio-choice: ~A~%" (-> obj aspect-ratio-choice)) + (format #t "~1Tvideo-mode-choice: ~A~%" (-> obj video-mode-choice)) + (format #t "~1Tyes-no-choice: ~A~%" (-> obj yes-no-choice)) + (format #t "~1Ton-off-choice: ~A~%" (-> obj on-off-choice)) + (format #t "~1Twhich-slot: ~D~%" (-> obj which-slot)) + (format #t "~1Tstarting-state: ~A~%" (-> obj starting-state)) + (format #t "~1Tlast-slot-saved: ~D~%" (-> obj last-slot-saved)) + (format #t "~1Tslider-backup: ~f~%" (-> obj slider-backup)) + (format #t "~1Tlanguage-backup: ~D~%" (-> obj language-backup)) + (format #t "~1Tcenter-x-backup: ~D~%" (-> obj center-x-backup)) + (format #t "~1Tcenter-y-backup: ~D~%" (-> obj center-y-backup)) + (format #t "~1Taspect-ratio-backup: ~A~%" (-> obj aspect-ratio-backup)) + (format #t "~1Tlast-slider-sound: ~D~%" (-> obj last-slider-sound)) + (format #t "~1Tvideo-mode-timeout: ~D~%" (-> obj video-mode-timeout)) + (format #t "~1Tprogressive-mode-timeout: ~D~%" (-> obj progressive-mode-timeout)) + (format #t "~1Tcurrent-task-index: ~D~%" (-> obj current-task-index)) + (format #t "~1Tcurrent-line-index: ~D~%" (-> obj current-line-index)) + (format #t "~1Tfirst-closed-line-index: ~D~%" (-> obj first-closed-line-index)) + (format #t "~1Textra-text-state: ~D~%" (-> obj extra-text-state)) + (format #t "~1Tcurrent-task: ~D~%" (-> obj current-task)) + (format #t "~1Tnum-open-tasks-found: ~D~%" (-> obj num-open-tasks-found)) + (format #t "~1Tnum-closed-tasks-found: ~D~%" (-> obj num-closed-tasks-found)) + (format #t "~1Tcolor-flash-counter: ~D~%" (-> obj color-flash-counter)) + (format #t "~1Tnum-unlocked-secrets: ~D~%" (-> obj num-unlocked-secrets)) + (format #t "~1Tgame-options-item-selected: ~D~%" (-> obj game-options-item-selected)) + (format #t "~1Tgame-options-item-picked: ~A~%" (-> obj game-options-item-picked)) + (format #t "~1Tgame-options-last-move: ~D~%" (-> obj game-options-last-move)) + (format #t "~1Tgame-options-vibrations: ~A~%" (-> obj game-options-vibrations)) + (format #t "~1Tgame-options-subtitles: ~A~%" (-> obj game-options-subtitles)) + (format #t "~1Tgame-options-language-index: ~D~%" (-> obj game-options-language-index)) + (format #t "~1Tgame-options-subtitle-language-index: ~D~%" (-> obj game-options-subtitle-language-index)) + (format #t "~1Tgraphic-options-item-selected: ~D~%" (-> obj graphic-options-item-selected)) + (format #t "~1Tgraphic-options-item-picked: ~A~%" (-> obj graphic-options-item-picked)) + (format #t "~1Tgraphic-options-last-move: ~D~%" (-> obj graphic-options-last-move)) + (format #t "~1Tgraphic-options-aspect-ratio: ~A~%" (-> obj graphic-options-aspect-ratio)) + (format #t "~1Tgraphic-options-progressive-scan: ~A~%" (-> obj graphic-options-progressive-scan)) + (format #t "~1Tqr-options-item-selected: ~D~%" (-> obj qr-options-item-selected)) + (format #t "~1Tqr-options-item-picked: ~A~%" (-> obj qr-options-item-picked)) + (format #t "~1Tqr-options-last-move: ~D~%" (-> obj qr-options-last-move)) + (format #t "~1Tqr-options-restart: ~A~%" (-> obj qr-options-restart)) + (format #t "~1Tqr-options-quit: ~A~%" (-> obj qr-options-quit)) + (format #t "~1Ttotal-num-tasks: ~D~%" (-> obj total-num-tasks)) + (format #t "~1Tscene-player-act: ~D~%" (-> obj scene-player-act)) + (format #t "~1Tstereo-mode-backup: ~D~%" (-> obj stereo-mode-backup)) + (format #t "~1Tsecrets-unlocked: ~A~%" (-> obj secrets-unlocked)) + (format #t "~1Tmissions-total-spacing: ~f~%" (-> obj missions-total-spacing)) + (format #t "~1Tclear-screen: ~A~%" (-> obj clear-screen)) + (label cfg-4) + obj + ) + +;; definition for symbol *progress-stack*, type (pointer uint8) +(define *progress-stack* (the-as (pointer uint8) (malloc 'global #x3800))) + +;; definition for symbol *progress-process*, type (pointer progress) +(define *progress-process* (the-as (pointer progress) #f)) + +;; definition for symbol *progress-state*, type progress-global-state +(define *progress-state* (new 'static 'progress-global-state :which-slot -1 :last-slot-saved -1)) + +;; failed to figure out what this is: +(kmemopen global "mc-slot-info") + +;; definition for symbol *progress-save-info*, type mc-slot-info +(define *progress-save-info* (new 'global 'mc-slot-info)) + +;; failed to figure out what this is: +(kmemclose) + +;; definition for function min-max-wrap-around +(defun min-max-wrap-around ((arg0 int) (arg1 int) (arg2 int)) + (let ((v1-2 (+ (- 1 arg1) arg2))) + (while (< arg0 arg1) + (+! arg0 v1-2) + ) + (while (< arg2 arg0) + (set! arg0 (- arg0 v1-2)) + ) + ) + arg0 + ) + +;; definition for function progress-intro-start +(defun progress-intro-start ((arg0 symbol)) + (set! (-> *game-info* mode) 'play) + (if arg0 + (initialize! *game-info* 'game (the-as game-save #f) "intro-start-hero") + (initialize! *game-info* 'game (the-as game-save #f) "intro-start") + ) + (set-master-mode 'game) + 0 + ) + +;; definition for method 24 of type progress +(defmethod init-defaults progress ((obj progress)) + "Initialize default menu settings." + (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! (-> *progress-state* on-off-choice) #f) + (set! (-> *progress-state* color-flash-counter) 0) + (set! (-> *progress-state* game-options-item-selected) 0) + (set! (-> *progress-state* game-options-item-picked) #f) + (set! (-> *progress-state* game-options-vibrations) (-> *setting-control* user-default vibration)) + (set! (-> *progress-state* game-options-subtitles) (-> *setting-control* user-default subtitle)) + (set! (-> *progress-state* game-options-language-index) + (the-as int (-> *setting-control* user-default language)) + ) + (set! (-> *progress-state* game-options-subtitle-language-index) + (the-as int (-> *setting-control* user-default subtitle-language)) + ) + (set! (-> *progress-state* graphic-options-item-selected) 0) + (set! (-> *progress-state* graphic-options-item-picked) #f) + (set! (-> *progress-state* graphic-options-aspect-ratio) (get-aspect-ratio)) + (set! (-> *progress-state* graphic-options-progressive-scan) + (-> *setting-control* user-default use-progressive-scan) + ) + (set! (-> *progress-state* qr-options-item-selected) 0) + (set! (-> *progress-state* qr-options-item-picked) #f) + (set! (-> *progress-state* total-num-tasks) 0) + (set! (-> *progress-state* secrets-unlocked) #f) + (set! (-> *progress-state* clear-screen) #f) + (set! (-> obj sliding) 0.0) + (set! (-> obj sliding-height) 0.0) + (set! (-> obj sliding-off) 1.0) + (set! (-> obj scanlines-alpha) 0.0) + (set! (-> (the-as menu-on-off-game-vibrations-option (-> (the-as (array menu-option) (-> *game-options* options 0)) 0)) + value-to-modify + ) + (&-> *setting-control* user-default vibration) + ) + (set! (-> (the-as menu-on-off-game-subtitles-option (-> (the-as (array menu-option) (-> *game-options* options 0)) 1)) + value-to-modify + ) + (&-> *setting-control* user-default subtitle) + ) + (set! (-> (the-as menu-language-option (-> (the-as (array menu-option) (-> *game-options* options 0)) 2)) + language-selection + ) + (-> *setting-control* user-current language) + ) + (set! (-> (the-as menu-language-option (-> (the-as (array menu-option) (-> *game-options* options 0)) 2)) + language-direction + ) + #t + ) + (set! (-> (the-as menu-language-option (-> (the-as (array menu-option) (-> *game-options* options 0)) 2)) + language-transition + ) + #f + ) + (set! (-> (the-as menu-language-option (-> (the-as (array menu-option) (-> *game-options* options 0)) 2)) + language-x-offset + ) + 0 + ) + (set! (-> (the-as menu-on-off-option (-> (the-as (array menu-option) (-> *game-options-japan* options 0)) 0)) + value-to-modify + ) + (&-> *setting-control* user-default vibration) + ) + (set! (-> (the-as menu-on-off-option (-> (the-as (array menu-option) (-> *game-options-demo* options 0)) 0)) + value-to-modify + ) + (&-> *setting-control* user-default vibration) + ) + (set! (-> (the-as menu-on-off-option (-> (the-as (array menu-option) (-> *graphic-options* options 0)) 2)) + value-to-modify + ) + (&-> *setting-control* user-default use-progressive-scan) + ) + (set! (-> (the-as menu-on-off-option (-> (the-as (array menu-option) (-> *graphic-title-options-pal* options 0)) 2)) + value-to-modify + ) + (&-> *setting-control* user-default use-progressive-scan) + ) + (set! (-> (the-as menu-slider-option (-> (the-as (array menu-option) (-> *sound-options* options 0)) 0)) + value-to-modify + ) + (&-> *setting-control* user-default sfx-volume) + ) + (set! (-> (the-as menu-slider-option (-> (the-as (array menu-option) (-> *sound-options* options 0)) 1)) + value-to-modify + ) + (&-> *setting-control* user-default music-volume) + ) + (set! (-> (the-as menu-slider-option (-> (the-as (array menu-option) (-> *sound-options* options 0)) 2)) + value-to-modify + ) + (&-> *setting-control* user-default dialog-volume) + ) + (set! (-> (the-as menu-missions-option (-> (the-as (array menu-option) (-> *missions-options* options 0)) 0)) + task-line-index + ) + 0 + ) + (set-setting-by-param *setting-control* 'extra-bank '((force2 menu1)) 0 0) + ) + +;; definition of type hud-ring-cell +(deftype hud-ring-cell (process-drawable) + ((parent-override (pointer progress) :offset 16) + (joint-idx int32 :offset-assert 200) + (init-angle degrees :offset-assert 204) + (graphic-index int32 :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 21 + :size-assert #xd4 + :flag-assert #x15006000d4 + (:methods + (idle () _type_ :state 20) + ) + ) + +;; definition for method 3 of type hud-ring-cell +(defmethod inspect hud-ring-cell ((obj hud-ring-cell)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tjoint-idx: ~D~%" (-> obj joint-idx)) + (format #t "~2Tinit-angle: ~f~%" (-> obj init-angle)) + (format #t "~2Tgraphic-index: ~D~%" (-> obj graphic-index)) + (label cfg-4) + obj + ) + +;; definition for function hud-ring-cell-init-by-other +;; INFO: Used lq/sq +(defbehavior hud-ring-cell-init-by-other hud-ring-cell ((arg0 int) (arg1 float) (arg2 int)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-hud-ring-part" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self joint-idx) arg0) + (set! (-> self init-angle) arg1) + (set! (-> self graphic-index) arg2) + (set! (-> self root trans quad) (-> (the-as progress (-> self parent-override 0)) root trans quad)) + (quaternion-copy! (-> self root quat) (-> (the-as progress (-> self parent-override 0)) root quat)) + (quaternion-normalize! (-> self root quat)) + (set! (-> self root scale quad) (-> (the-as progress (-> self parent-override 0)) root scale quad)) + (let ((gp-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *z-vector* (-> self init-angle)))) + (quaternion-normalize! gp-1) + (quaternion*! (-> self root quat) (-> self root quat) gp-1) + ) + (quaternion-normalize! (-> self root quat)) + (set! (-> self draw color-mult x) 0.8) + (set! (-> self draw color-mult y) 0.8) + (set! (-> self draw color-mult z) 0.8) + (logior! (-> self draw global-effect) (draw-control-global-effect title-light)) + (logior! (-> self draw status) (draw-control-status hud)) + (draw-control-method-12 (-> self draw) (the-as uint 1) 0) + (draw-control-method-12 (-> self draw) (the-as uint 0) 2046) + (cond + ((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk)) + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-kiosk-graphic-remap* + (mod + (+ (-> self graphic-index) (-> (the-as progress (-> self parent-override 0)) graphic-index)) + (-> *hud-ring-kiosk-graphic-remap* length) + ) + ) + 0 + ) + ) + ((and (= *cheat-mode* #f) (demo?)) + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-demo-graphic-remap* + (mod + (+ (-> self graphic-index) (-> (the-as progress (-> self parent-override 0)) graphic-index)) + (-> *hud-ring-kiosk-graphic-remap* length) + ) + ) + 0 + ) + ) + (else + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-graphic-remap* + (mod + (+ (-> self graphic-index) (-> (the-as progress (-> self parent-override 0)) graphic-index)) + (-> *hud-ring-graphic-remap* length) + ) + ) + 0 + ) + ) + ) + (go-virtual idle) + ) + +;; failed to figure out what this is: +(defstate idle (hud-ring-cell) + :virtual #t + :code (behavior () + (until #f + (ja :num-func num-func-identity :frame-num 0.0) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (vector<-cspace! + (-> self root trans) + (-> (the-as progress (-> self parent-override 0)) node-list data (-> self joint-idx)) + ) + (when (-> (the-as progress (-> self parent-override 0)) main-menu) + (draw-control-method-12 (-> self draw) (the-as uint 0) 2046) + (cond + ((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk)) + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-kiosk-graphic-remap* + (mod + (+ (-> self graphic-index) (-> (the-as progress (-> self parent-override 0)) graphic-index)) + (-> *hud-ring-kiosk-graphic-remap* length) + ) + ) + 0 + ) + ) + ((and (= *cheat-mode* #f) (demo?)) + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-demo-graphic-remap* + (mod + (+ (-> self graphic-index) (-> (the-as progress (-> self parent-override 0)) graphic-index)) + (-> *hud-ring-kiosk-graphic-remap* length) + ) + ) + 0 + ) + ) + (else + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-graphic-remap* + (mod + (+ (-> self graphic-index) (-> (the-as progress (-> self parent-override 0)) graphic-index)) + (-> *hud-ring-graphic-remap* length) + ) + ) + 0 + ) + ) + ) + ) + (when (= (-> self init-angle) 0.0) + (cond + ((= (-> (the-as progress (-> self parent-override 0)) ring-angle) + (-> (the-as progress (-> self parent-override 0)) ring-want-angle) + ) + (set! (-> self draw color-mult x) 1.2) + (set! (-> self draw color-mult y) 1.2) + (set! (-> self draw color-mult z) 1.2) + ) + (else + (set! (-> self draw color-mult x) 0.8) + (set! (-> self draw color-mult y) 0.8) + (set! (-> self draw color-mult z) 0.8) + ) + ) + ) + (let* ((t9-6 quaternion-vector-angle!) + (a0-8 (new 'stack-no-clear 'quaternion)) + (a1-26 *z-vector*) + (f0-8 (-> self init-angle)) + (f1-2 (-> (the-as progress (-> self parent-override 0)) ring-angle)) + (gp-0 (t9-6 a0-8 a1-26 (+ f0-8 (- f1-2 (* (the float (the int (/ f1-2 6553.6))) 6553.6))))) + ) + (quaternion-normalize! gp-0) + (quaternion-copy! (-> self root quat) (-> (the-as progress (-> self parent-override 0)) root quat)) + (quaternion-normalize! (-> self root quat)) + (quaternion*! (-> self root quat) (-> self root quat) gp-0) + ) + (quaternion-normalize! (-> self root quat)) + (ja-post) + (none) + ) + ) + +;; definition for function progress-init-by-other +(defbehavior progress-init-by-other progress ((arg0 symbol)) + (hide-hud #f) + (disable-level-text-file-loading) + (logclear! (-> self mask) (process-mask menu progress actor-pause)) + (add-setting! 'process-mask 'set 0 (process-mask progress)) + (set! (-> self clock) (-> *display* real-clock)) + (apply-settings *setting-control*) + (set-blackout-frames 0) + (set! *pause-lock* #f) + (set! (-> self root) (new 'process 'trsqv)) + (matrix->quaternion (-> self root quat) (-> *math-camera* inv-camera-rot)) + (let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *y-vector* 32768.0))) + (quaternion*! (-> self root quat) (-> self root quat) a2-2) + ) + (quaternion-normalize! (-> self root quat)) + (quaternion-copy! (-> self init-quat) (-> self root quat)) + (set-vector! (-> self root scale) 0.09 0.09 0.09 1.0) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-hud-ring" (the-as (pointer uint32) #f))) + (the-as pair 0) + ) + (logior! (-> self draw global-effect) (draw-control-global-effect title-light)) + (logior! (-> self skel status) (joint-control-status sync-math)) + (set! (-> self state-pos) 0) + (set! (-> self menu-transition) 1.0) + (set! (-> self anim-frame) 0.0) + (set! (-> self pos-transition) 1.0) + (init-defaults self) + (set-next-state self arg0 0) + (set! (-> *progress-state* starting-state) (-> self next)) + (set! (-> self current) (-> self next)) + (if (= arg0 'main) + (set! (-> self next) 'none) + ) + (set! (-> self ring-angle) 0.0) + (set! (-> self ring-want-angle) 0.0) + (set! (-> self option-index) 0) + (set! (-> self want-option-index) 0) + (set! (-> self graphic-index) 0) + (set! (-> self swing) 0.0) + (set! (-> self main-menu) #f) + (set-menu-options self (-> self current)) + (logior! (-> self draw status) (draw-control-status hud)) + (let ((f30-0 -6571.804)) + (process-spawn hud-ring-cell 15 (* 0.0 f30-0) 0 :to self) + (process-spawn hud-ring-cell 9 f30-0 1 :to self) + (process-spawn hud-ring-cell 8 (* 2.0 f30-0) 2 :to self) + (process-spawn hud-ring-cell 7 (* 3.0 f30-0) 3 :to self) + (process-spawn hud-ring-cell 6 (* 4.0 f30-0) 4 :to self) + (process-spawn hud-ring-cell 16 (* -5.0 f30-0) 5 :to self) + (process-spawn hud-ring-cell 14 (* -4.0 f30-0) 6 :to self) + (process-spawn hud-ring-cell 13 (* -3.0 f30-0) 7 :to self) + (process-spawn hud-ring-cell 12 (* -2.0 f30-0) 8 :to self) + (process-spawn hud-ring-cell 11 (* -1.0 f30-0) 9 :to self) + ) + (bigmap-method-14 *bigmap*) + (go-virtual come-in) + ) + +;; definition for function set-ring-position +;; INFO: Used lq/sq +(defun set-ring-position ((arg0 progress)) + (let ((s3-0 (new-stack-vector0)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 y) (+ -8.0 (-> s3-0 y))) + (case (get-aspect-ratio) + (('aspect4x3) + (position-in-front-of-screen! s4-0 12288.0 s3-0) + (position-in-front-of-screen! s5-0 -4096.0 s3-0) + ) + (else + (position-in-front-of-screen! s4-0 16384.0 s3-0) + (position-in-front-of-screen! s5-0 -18022.4 s3-0) + ) + ) + (vector-! s5-0 s5-0 s4-0) + (set! (-> arg0 root trans x) (+ (-> s4-0 x) (* (-> arg0 pos-transition) (-> s5-0 x)))) + (set! (-> arg0 root trans y) (+ (-> s4-0 y) (* (-> arg0 pos-transition) (-> s5-0 y)))) + (set! (-> arg0 root trans z) (+ (-> s4-0 z) (* (-> arg0 pos-transition) (-> s5-0 z)))) + ) + ) + +;; definition for function activate-progress +;; WARN: Return type mismatch int vs none. +(defun activate-progress ((arg0 process) (arg1 symbol)) + (when *target* + (when (progress-allowed?) + (when (nonzero? (-> *progress-state* video-mode-timeout)) + (set! (-> *progress-state* video-mode-timeout) 0) + (set! (-> *progress-state* video-mode-choice) 'pal) + (set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice)) + ) + (when (nonzero? (-> *progress-state* progressive-mode-timeout)) + (set! (-> *progress-state* progressive-mode-timeout) 0) + (set! (-> *setting-control* user-default use-progressive-scan) #f) + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (set-progressive-scan #f) + ) + (cond + (*progress-process* + (deactivate (-> *progress-process* 0)) + (set! (-> *blit-displays-work* menu-mode) (the-as basic #t)) + (set! *progress-process* (process-spawn progress arg1 :to arg0 :stack (&-> *progress-stack* 14336))) + (set-master-mode 'progress) + ) + (else + (set! *progress-process* (process-spawn progress arg1 :to arg0 :stack (&-> *progress-stack* 14336))) + (set-master-mode 'progress) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type progress +(defmethod deactivate progress ((obj progress)) + (remove-setting-by-arg0 *setting-control* 'extra-bank) + ((method-of-object *bigmap* bigmap-method-15)) + (set! (-> *blit-displays-work* menu-mode) #f) + (set! *progress-process* (the-as (pointer progress) #f)) + (enable-level-text-file-loading) + (persist-with-delay *setting-control* 'allow-progress (seconds 0.1) 'allow-progress #f 0.0 0) + (persist-with-delay *setting-control* 'allow-pause (seconds 0.1) 'allow-pause #f 0.0 0) + ((the-as (function progress none) (find-parent-method progress 10)) obj) + (none) + ) + +;; definition for function deactivate-progress +;; WARN: Return type mismatch int vs none. +(defun deactivate-progress () + (if *progress-process* + (deactivate (-> *progress-process* 0)) + ) + 0 + (none) + ) + +;; definition for function hide-progress-screen +;; WARN: Return type mismatch int vs none. +(defun hide-progress-screen () + (if (and *progress-process* *progress-state* (!= (-> *progress-state* starting-state) 'title)) + (set-next-state (-> *progress-process* 0) 'go-away 0) + ) + 0 + (none) + ) + +;; definition for method 26 of type progress +(defmethod progress-method-26 progress ((obj progress)) + (and *progress-process* + (-> *progress-process* 0 next-state) + (= (-> *progress-process* 0 next-state name) 'gone) + ) + ) + +;; definition for function progress-allowed? +(defun progress-allowed? () + (not (or (-> *setting-control* user-current talking) + (-> *setting-control* user-current movie) + (movie?) + (handle->process (-> *game-info* pov-camera-handle)) + (handle->process (-> *game-info* other-camera-handle)) + (< (-> *display* base-clock frame-counter) (-> *game-info* letterbox-time)) + (< (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) + (!= (-> *setting-control* user-current bg-a) 0.0) + (!= (-> *setting-control* user-current bg-a-force) 0.0) + (not (-> *setting-control* user-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*) + (= *cheat-mode* 'camera) + (= *master-mode* 'freeze) + *master-exit* + (not *common-text*) + (< (memory-free *nk-dead-pool*) #x8000) + ) + ) + ) + ) + +;; definition for method 27 of type progress +(defmethod can-go-back? progress ((obj progress)) + (and (= (-> obj menu-transition) 0.0) + (not (-> obj selected-option)) + (!= (-> obj current) 'loading) + (!= (-> obj current) 'saving) + (!= (-> obj current) 'formatting) + (!= (-> obj current) 'creating) + (!= (-> obj current) 'error-disc-removed) + (!= (-> obj current) 'error-reading) + (!= (-> obj current) 'card-removed) + (!= (-> obj current) 'error-auto-saving) + (!= (-> obj current) 'title) + (!= (-> obj current) 'insufficient-space) + (!= (-> obj current) 'secrets-insufficient-space) + (!= (-> obj current) 'no-memory-card) + (!= (-> obj current) 'icon-info) + (!= (-> obj current) 'insert-card) + (!= (-> obj current) 'progressive-mode-ok) + (!= (-> obj current) 'video-mode-ok) + (!= (-> obj current) 'progressive-mode-warning) + (!= (-> obj current) 'video-mode-warning) + ) + ) + +;; definition for function menu-update-purchase-secrets +;; WARN: Return type mismatch symbol vs none. +(defun menu-update-purchase-secrets ((arg0 menu-secret-option)) + (let* ((a1-1 (logtest? (-> *game-info* secrets) (game-secrets hero-mode))) + (v1-3 (if (not a1-1) + 0 + (-> arg0 num-items) + ) + ) + (a1-3 (if (not a1-1) + (+ (-> arg0 num-items) -1) + (+ (-> arg0 num-items) -1 (-> arg0 num-hero-items)) + ) + ) + ) + (while (>= a1-3 v1-3) + (let* ((a2-1 v1-3) + (t0-1 (-> arg0 secret-items a2-1 cost)) + (a3-6 (-> arg0 secret-items a2-1 flag)) + (t2-1 (-> arg0 secret-items a2-1 avail-after)) + (t1-5 (the int (-> *game-info* skill-total))) + ) + (when (and (logtest? (-> *game-info* sub-task-list t2-1 flags) (game-task-node-flag closed)) (>= t1-5 t0-1)) + (logior! (-> *game-info* purchase-secrets) a3-6) + (if (= (-> arg0 secret-items a2-1 can-toggle) 'auto) + (logior! (-> *game-info* secrets) a3-6) + ) + ) + ) + (+! v1-3 1) + ) + ) + (none) + ) + +;; definition for method 28 of type progress +(defmethod progress-method-28 progress ((obj progress) (arg0 symbol)) + (let ((v1-0 *progress-save-info*) + (v0-0 arg0) + ) + (when v1-0 + (when (and v1-0 (= (-> obj menu-transition) 0.0)) + (case arg0 + (('insufficient-space 'no-memory-card 'unformatted-card) + (cond + ((zero? (-> v1-0 handle)) + (set! v0-0 'no-memory-card) + ) + ((zero? (-> v1-0 formatted)) + (cond + ((or (zero? (-> obj state-pos)) (!= (-> *progress-state* starting-state) 'title)) + (set! v0-0 'go-away) + ) + (else + (if (!= arg0 'unformatted-card) + (set! v0-0 'format-card) + ) + ) + ) + ) + ((and (zero? (-> v1-0 inited)) (< (-> v1-0 mem-actual) (-> v1-0 mem-required))) + (set! v0-0 'insufficient-space) + ) + ((or (zero? (-> obj state-pos)) (!= (-> *progress-state* starting-state) 'title)) + (set! v0-0 'go-away) + ) + (else + (set! v0-0 'select-save) + ) + ) + ) + (('insert-card) + (if (= (-> v1-0 inited) 1) + (set! v0-0 'select-load) + ) + ) + ) + (cond + ((zero? (-> v1-0 handle)) + (cond + ((-> *setting-control* user-current auto-save) + (set! v0-0 'card-removed) + ) + (else + (case arg0 + (('select-load) + (set! v0-0 'insert-card) + ) + (('format-card + 'insufficient-space + 'unformatted-card + 'select-save + 'select-save-title + 'select-save-title-hero + 'create-game + 'already-exists + ) + (set! v0-0 'no-memory-card) + ) + ) + ) + ) + ) + ((zero? (-> v1-0 formatted)) + (case arg0 + (('select-load) + (set! v0-0 'insert-card) + ) + (('select-save 'select-save-title 'select-state-title-hero) + (set! v0-0 'format-card) + ) + ) + ) + ((zero? (-> v1-0 inited)) + (case arg0 + (('select-save 'select-save-title 'select-save-title-hero) + (if (>= (-> v1-0 mem-actual) (-> v1-0 mem-required)) + (set! v0-0 'create-game) + (set! v0-0 'insufficient-space) + ) + ) + (('select-load) + (set! v0-0 'insert-card) + ) + ) + ) + ) + ) + ) + v0-0 + ) + ) + +;; definition for method 29 of type progress +(defmethod progress-method-29 progress ((obj progress)) + (let ((v1-0 (-> obj state-pos))) + (cond + ((< v1-0 5) + (set! (-> obj state-stack v1-0) (-> obj current)) + (set! (-> obj option-index-stack v1-0) (-> obj option-index)) + (set! (-> obj state-pos) (+ v1-0 1)) + ) + (else + (format #t "ERROR: Can't push any more states on the state-stack.~%") + ) + ) + ) + 0 + ) + +;; definition for method 30 of type progress +(defmethod progress-method-30 progress ((obj progress)) + (let ((v1-0 (-> obj state-pos))) + (cond + ((> v1-0 0) + (let ((a2-0 (+ v1-0 -1))) + (set! (-> obj state-pos) a2-0) + (set-next-state obj (-> obj state-stack a2-0) (-> obj option-index-stack a2-0)) + ) + ) + (else + (set-next-state obj 'go-away 0) + ) + ) + ) + (set! (-> *progress-state* game-options-item-selected) 0) + (set! (-> *progress-state* game-options-item-picked) #f) + (set! (-> *progress-state* graphic-options-item-selected) 0) + (set! (-> *progress-state* graphic-options-item-picked) #f) + (set! (-> *progress-state* qr-options-item-selected) 0) + (set! (-> *progress-state* qr-options-item-picked) #f) + 0 + ) + +;; definition for method 31 of type progress +(defmethod set-next-state progress ((obj progress) (arg0 symbol) (arg1 int)) + "Set the next menu state specified by arg0 at the index specified by arg1." + (set! (-> *progress-state* clear-screen) #f) + (when (!= arg0 (-> obj current)) + (set! (-> *progress-state* yes-no-choice) #f) + (set! (-> obj selected-option) #f) + (set! (-> obj next-option-index) arg1) + (set! (-> obj next) arg0) + (case (-> obj next) + (('select-load 'select-save 'select-save-title 'select-save-title-hero) + (set! (-> obj next) (progress-method-28 obj (-> obj next))) + ) + ) + (case (-> obj next) + (('creating) + (auto-save-command 'create-file 0 0 obj #f) + ) + (('loading) + (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which-slot)) + (auto-save-command 'restore 0 (-> *progress-state* which-slot) obj #f) + (set! (-> (the-as menu-missions-option (-> (the-as (array menu-option) (-> *missions-options* options 0)) 0)) + task-line-index + ) + 0 + ) + 0 + ) + (('saving) + (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which-slot)) + (auto-save-command 'save 0 (-> *progress-state* which-slot) obj #f) + ) + (('formatting) + (auto-save-command 'format-card 0 0 obj #f) + ) + (('select-save 'select-load) + (set! (-> obj next-option-index) (max 0 (-> *progress-state* last-slot-saved))) + ) + (('card-removed) + (set! (-> *progress-state* last-slot-saved) 0) + 0 + ) + ) + ) + 0 + ) + +;; definition for method 32 of type progress +(defmethod set-menu-options progress ((obj progress) (arg0 symbol)) + "Set the menu options for the menu state specified by arg0." + (set! (-> obj current-options) #f) + (case arg0 + (('go-away) + (go (method-of-object obj go-away)) + ) + (('main) + (set! (-> obj current-options) (cond + (*cheat-mode* + *main-options* + ) + ((= *kernel-boot-message* 'kiosk) + *main-kiosk-options* + ) + ((demo?) + *main-demo-options* + ) + (else + *main-options* + ) + ) + ) + ) + (('game-options) + (set! (-> obj current-options) + (cond + ((demo?) + (if (= (scf-get-territory) 1) + *game-options* + *game-options-demo* + ) + ) + ((and (= (scf-get-territory) 2) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))) + *game-options* + ) + (else + *game-options* + ) + ) + ) + ) + (('graphic-options) + (set! (-> obj current-options) + (if (or (= (scf-get-territory) 1) (and (= *progress-cheat* 'pal) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) + *graphic-title-options-pal* + *graphic-options* + ) + ) + ) + (('sound-options) + (set! (-> obj current-options) *sound-options*) + ) + (('select-load 'select-save) + (set! (-> obj current-options) *load-save-options*) + ) + (('select-save-title) + (set! (-> obj current-options) *save-options-title*) + ) + (('select-save-title-hero) + (logior! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) + (logior! (-> *game-info* secrets) (game-secrets hero-mode)) + (set! (-> obj current-options) *save-options-title*) + ) + (('loading 'saving 'creating 'formatting) + (set! (-> obj current-options) *loading-options*) + ) + (('unformatted-card 'insufficient-space 'no-memory-card) + (set! (-> obj current-options) *insufficient-space-options*) + ) + (('secrets-insufficient-space 'secrets-no-memory-card) + (set! (-> obj current-options) *secrets-insufficient-space-options*) + ) + (('insert-card) + (set! (-> obj current-options) *insert-card-options*) + ) + (('error-loading 'error-saving 'error-formatting 'error-creating) + (set! (-> obj current-options) *error-loading-options*) + ) + (('error-auto-saving) + (set! (-> obj current-options) *error-auto-saving-options*) + ) + (('card-removed) + (set! (-> obj current-options) *card-removed-options*) + ) + (('error-disc-removed) + (set! (-> obj current-options) *error-disc-removed-options*) + ) + (('error-reading) + (set! (-> obj current-options) *error-reading-options*) + ) + (('icon-info) + (set! (-> obj current-options) *icon-info-options*) + ) + (('format-card) + (set! (-> obj current-options) *format-card-options*) + ) + (('already-exists) + (set! (-> obj current-options) *already-exists-options*) + ) + (('create-game) + (set! (-> obj current-options) *create-game-options*) + ) + (('video-mode-warning) + (set! (-> obj current-options) *video-mode-warning-options*) + ) + (('video-mode-ok) + (set! (-> obj current-options) *video-mode-ok-options*) + ) + (('progressive-mode-warning) + (set! (-> obj current-options) *progressive-mode-warning-options*) + ) + (('progressive-mode-ok) + (set! (-> obj current-options) *progressive-mode-ok-options*) + ) + (('quit) + (set! (-> obj current-options) *quit-options*) + ) + (('title) + (set! (-> obj current-options) *title*) + ) + (('title-options) + (set! (-> obj current-options) *options*) + ) + (('select-start 'select-pre-start 'select-kiosk-start) + (set! (-> obj current-options) *select-start-options*) + (set! (-> (the-as menu-select-start-option (-> (the-as (array menu-option) (-> *select-start-options* options 0)) 0)) + task-index + ) + 0 + ) + 0 + ) + (('select-scene) + (set! (-> obj current-options) *select-scene-options*) + (set! (-> (the-as menu-select-scene-option (-> (the-as (array menu-option) (-> *select-scene-options* options 0)) 0)) + task-index + ) + 0 + ) + 0 + ) + (('select-scene-special) + (set! (-> *progress-state* starting-state) 'title) + (set! (-> obj state-pos) 0) + (let ((v1-67 (-> obj state-pos))) + (set! (-> obj state-stack v1-67) 'title) + (set! (-> obj option-index-stack v1-67) 3) + (let ((v1-68 (+ v1-67 1))) + (set! (-> obj state-stack v1-68) 'unlocked-secrets) + (set! (-> obj option-index-stack v1-68) (-> obj option-index)) + (set! (-> obj state-pos) (+ v1-68 1)) + ) + ) + (dotimes (s5-1 (-> obj state-pos)) + (format + #t + "select-scene-special: ~S ~D~%" + (symbol->string (-> obj state-stack s5-1)) + (-> obj option-index-stack s5-1) + ) + ) + (set! (-> obj current-options) *select-scene-options*) + ) + (('bigmap) + (set! (-> obj current-options) *bigmap-options*) + ) + (('missions) + (set! (-> *progress-state* missions-total-spacing) 0.0) + (set! (-> (the-as menu-missions-option (-> (the-as (array menu-option) (-> *missions-options* options 0)) 0)) + task-line-index + ) + 0 + ) + (set! (-> obj current-options) *missions-options*) + ) + (('highscores) + (set! (-> (the-as menu-highscores-option (-> (the-as (array menu-option) (-> *highscores-options* options 0)) 0)) + page-index + ) + 0 + ) + (set! (-> (the-as menu-highscores-option (-> (the-as (array menu-option) (-> *highscores-options* options 0)) 0)) + prev-page-index + ) + 0 + ) + (set! (-> obj current-options) *highscores-options*) + ) + (('secret) + (set! (-> obj secret-buying) #f) + (set! (-> obj current-options) *secret-options*) + ) + (('quit-restart) + (set! (-> obj current-options) *quit-restart-options*) + ) + (('unlocked-secrets) + (set! (-> obj current-options) *unlocked-secrets*) + ) + ) + (when (= (-> obj current-options) #f) + (format #t "Didn't find new menu settings!!~%") + (progress-method-30 obj) + ) + 0 + ) + +;; definition for method 25 of type progress +;; WARN: Return type mismatch int vs none. +(defmethod progress-method-25 progress ((obj progress)) + (mc-get-slot-info 0 *progress-save-info*) + (when (-> obj current-options) + (let ((s5-0 (-> obj current-options options 0))) + (when (and s5-0 (= (-> obj menu-transition) 0.0)) + (respond-progress + (the-as menu-option (-> s5-0 options (-> obj option-index))) + obj + (and (= (-> obj menu-transition) 0.0) (-> obj selected-option)) + ) + (cond + ((-> obj selected-option) + (cond + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> obj selected-option) #f) + ) + ((cpad-pressed? 0 triangle) + (if (= (-> obj current-options) *main-options*) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (set! (-> obj selected-option) #f) + ) + ) + ) + (else + (cond + ((logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (cond + ((= (-> obj current-options) *main-options*) + (sound-play "ring-select") + ) + ((!= (length s5-0) 1) + (sound-play "roll-over") + ) + ) + (if (and (= *title* (-> obj current-options)) (not (memcard-unlocked-secrets? #f)) (zero? (-> obj option-index))) + (set! (-> obj option-index) 3) + ) + (cond + ((> (-> obj want-option-index) 0) + (set! (-> obj want-option-index) -1) + ) + ((< -2 (-> obj want-option-index)) + (+! (-> obj want-option-index) -1) + ) + ) + ) + ((logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (cond + ((= (-> obj current-options) *main-options*) + (sound-play "ring-select") + ) + ((!= (length s5-0) 1) + (sound-play "roll-over") + ) + ) + (cond + ((< (-> obj want-option-index) 0) + (set! (-> obj want-option-index) 1) + ) + ((< (-> obj want-option-index) 2) + (+! (-> obj want-option-index) 1) + ) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (if (not (-> *progress-state* clear-screen)) + (sound-play "generic-beep") + ) + (set! (-> obj selected-option) #t) + ) + ((cpad-pressed? 0 triangle) + (when (can-go-back? obj) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (if (and (= (-> *progress-state* starting-state) 'main) (!= (-> obj current-options) *main-options*)) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 obj) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function progress-trans +;; WARN: Return type mismatch int vs none. +(defbehavior progress-trans progress () + (cond + ((and (= (-> self next) 'none) + (or (= (-> *progress-state* starting-state) 'main) (= (-> self anim-frame) 1.0)) + ) + (set! (-> self menu-transition) + (seek-ease + (-> self menu-transition) + 0.0 + (* 0.1 (-> self clock time-adjust-ratio)) + 0.4 + (* 0.01 (-> self clock time-adjust-ratio)) + ) + ) + ) + (else + (seek! (-> self menu-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio))) + (when (and (= (-> self menu-transition) 1.0) + (or (and (nonzero? (-> self state-pos)) (= (-> self anim-frame) 1.0)) + (or (and (zero? (-> self state-pos)) (= (-> self anim-frame) 0.0)) + (and (!= (-> *progress-state* starting-state) 'main) (!= (-> self next) 'none)) + ) + ) + ) + (set! (-> self current) (-> self next)) + (set! (-> self next) 'none) + (set! (-> self option-index) (-> self next-option-index)) + (set! (-> self want-option-index) 0) + (set-menu-options self (-> self current)) + (set! (-> self scanlines-alpha) 0.0) + ) + ) + ) + (set! (-> self main-menu) + (and (zero? (-> self state-pos)) (and (= (-> self menu-transition) 0.0) + (= (-> self next) 'none) + (or (= (-> self state-stack 0) 'main) (= (-> self current) 'main)) + ) + ) + ) + (when *cheat-mode* + (when (zero? (-> self state-pos)) + (cond + ((and (cpad-hold? 0 l2) (cpad-hold? 0 r1)) + (if (= (-> self current-options) *main-options*) + (set! (-> self current-options) *main-options-debug*) + ) + ) + ((= (-> self current-options) *main-options-debug*) + (set! (-> self current-options) *main-options*) + ) + ) + ) + ) + (if (= (-> self ring-angle) (-> self ring-want-angle)) + (progress-method-25 self) + ) + (let ((f30-0 (* 0.005 (-> self clock time-adjust-ratio)))) + (cond + ((= (-> self menu-transition) 1.0) + (if (and (zero? (-> self state-pos)) (= (-> *progress-state* starting-state) 'main)) + (seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (seek! (-> self anim-frame) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + ) + (let ((f0-27 (if (and (zero? (-> self state-pos)) (!= (-> *progress-state* starting-state) 'title)) + 0.0 + 0.2 + ) + ) + ) + (when (= (-> self next) 'bigmap) + (set! f0-27 0.4) + (set! f30-0 (* 0.008 (-> self clock time-adjust-ratio))) + ) + (seek! (-> self pos-transition) f0-27 f30-0) + ) + ) + ((zero? (-> self state-pos)) + (if (= (-> self current) 'bigmap) + (set! f30-0 (* 0.05 (-> self clock time-adjust-ratio))) + ) + (if (!= (-> *progress-state* starting-state) 'title) + (seek! (-> self pos-transition) 0.0 f30-0) + ) + ) + ) + ) + (if (!= (-> *progress-state* starting-state) 'main) + (set! (-> self pos-transition) 0.2) + ) + (set-ring-position self) + (when (= (-> self ring-angle) (-> self ring-want-angle)) + (cond + ((< (-> self want-option-index) 0) + (cond + ((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk)) + (if (> (-> self option-index) 0) + (+! (-> self option-index) -1) + ) + ) + (else + (set! (-> self option-index) + (min-max-wrap-around (+ (-> self option-index) -1) 0 (+ (length (-> self current-options options 0)) -1)) + ) + ) + ) + (set! (-> self graphic-index) (-> self option-index)) + (+! (-> self want-option-index) 1) + ) + ((> (-> self want-option-index) 0) + (cond + ((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk)) + (if (< (-> self option-index) (+ (length (-> self current-options options 0)) -1)) + (+! (-> self option-index) 1) + ) + ) + (else + (set! (-> self option-index) + (min-max-wrap-around (+ (-> self option-index) 1) 0 (+ (length (-> self current-options options 0)) -1)) + ) + ) + ) + (+! (-> self want-option-index) -1) + ) + ) + ) + (if (= (-> self anim-frame) 0.0) + (set! (-> self swing) (seek-ease + (-> self swing) + 4.0 + (* 0.05 (-> self clock time-adjust-ratio)) + 0.5 + (* 0.005 (-> self clock time-adjust-ratio)) + ) + ) + (set! (-> self swing) (seek-ease + (-> self swing) + 0.0 + (* 0.07 (-> self clock time-adjust-ratio)) + 0.5 + (* 0.007 (-> self clock time-adjust-ratio)) + ) + ) + ) + (when (-> self main-menu) + (set! (-> self ring-want-angle) (ceil (* 182.04445 (* 36.0 (the float (-> self option-index)))))) + (if (and (= (-> self ring-want-angle) 0.0) (< 32768.0 (-> self ring-angle))) + (set! (-> self ring-want-angle) 65536.0) + ) + (let ((f0-54 (- (-> self ring-want-angle) (-> self ring-angle)))) + (when (< 32768.0 (fabs f0-54)) + (if (< 0.0 f0-54) + (set! (-> self ring-angle) (+ 65536.0 (-> self ring-angle))) + (set! (-> self ring-angle) (+ -65536.0 (-> self ring-angle))) + ) + ) + ) + (seek! (-> self ring-angle) (-> self ring-want-angle) (* 455.1111 (-> self clock time-adjust-ratio))) + ) + (let ((gp-4 (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + *x-vector* + (* 182.04445 (* (-> self swing) (sin (the float (* 40 (-> self clock frame-counter)))))) + ) + ) + (s5-4 (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + *y-vector* + (* 182.04445 (* (-> self swing) (sin (the float (* 0 (-> self clock frame-counter)))))) + ) + ) + ) + (quaternion*! (-> self root quat) (-> self init-quat) gp-4) + (quaternion*! (-> self root quat) (-> self root quat) s5-4) + ) + (quaternion-normalize! (-> self root quat)) + (if (= (-> self ring-angle) (-> self ring-want-angle)) + (set! (-> self graphic-index) (-> self option-index)) + ) + 0 + (none) + ) + +;; definition for function begin-scan +(defun begin-scan ((arg0 hud-box) (arg1 progress)) + (cond + ((or (= (-> arg1 current) 'bigmap) (= (-> arg1 next) 'bigmap)) + (case (get-aspect-ratio) + (('aspect4x3) + (set! (-> arg0 min x) 0.0) + (set! (-> arg0 min y) 0.0) + (set! (-> arg0 max x) 512.0) + (set! (-> arg0 max y) 416.0) + ) + (('aspect16x9) + (set! (-> arg0 min x) 0.0) + (set! (-> arg0 min y) 0.0) + (set! (-> arg0 max x) 512.0) + (set! (-> arg0 max y) 424.0) + ) + ) + ) + ((= (get-aspect-ratio) 'aspect16x9) + (set! (-> arg0 min x) 19.0) + (set! (-> arg0 min y) 38.0) + (set! (-> arg0 max x) 494.0) + (set! (-> arg0 max y) 362.0) + ) + (else + (set! (-> arg0 min x) 70.0) + (set! (-> arg0 min y) 70.0) + (set! (-> arg0 max x) 444.0) + (set! (-> arg0 max y) 329.0) + ) + ) + 0 + ) + +;; definition for function end-scan +(defun end-scan ((arg0 hud-box) (arg1 float)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-13 arg0 s5-0 arg1) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-8 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-8) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-8) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-8) vif1) (new 'static 'vif-tag)) + (set! (-> s5-0 base) (the-as pointer (&+ (the-as dma-packet v1-8) 16))) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + ) + +;; definition for function progress-post +;; INFO: Used lq/sq +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Return type mismatch int vs none. +(defbehavior progress-post progress () + (local-vars (sv-144 font-context) (sv-148 int) (sv-152 hud-box) (sv-156 symbol)) + (when (-> self current-options) + (let ((gp-0 (-> self current-options options 0)) + (s4-0 (-> self current-options y-center)) + (s5-0 (-> self current-options y-space)) + ) + (set! sv-144 (new + 'stack + 'font-context + *font-default-matrix* + 0 + 0 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + (set! sv-148 (- s4-0 (/ (* s5-0 (length gp-0)) 2))) + (set! sv-152 (new 'stack-no-clear 'hud-box)) + (set! sv-156 (and (!= (-> self current) 'main) (or (= (-> self next) 'none) (> (-> self state-pos) 0)))) + (if sv-156 + (begin-scan sv-152 self) + ) + (if (or (= (-> self current-options) *title*) (= (-> self current-options) *options*)) + (+! s5-0 20) + ) + (dotimes (s4-1 (length gp-0)) + (let ((v1-24 sv-144)) + (set! (-> v1-24 scale) 0.5) + ) + (set! (-> sv-144 origin x) 79.0) + (set! (-> sv-144 origin y) (the float sv-148)) + (let ((v1-29 sv-144)) + (set! (-> v1-29 width) (the float (the-as float #x163))) + ) + (let ((v1-30 sv-144)) + (set! (-> v1-30 height) (the float (the-as float #x1e))) + ) + (set! (-> sv-144 flags) (if (= (-> *setting-control* user-default language) (language-enum japanese)) + (font-flags middle left large) + (font-flags kerning middle left large) + ) + ) + (let ((s3-0 sv-144)) + (set! (-> s3-0 color) (if (and (= s4-1 (-> self option-index)) (= (-> self menu-transition) 0.0)) + (the-as font-color (progress-selected 0)) + (font-color #7efbfb) + ) + ) + ) + (menu-option-method-10 + (-> gp-0 options s4-1) + self + sv-144 + s4-1 + (and (= (-> self menu-transition) 0.0) (-> self selected-option) (= s4-1 (-> self option-index))) + ) + (if (!= (-> self current-options) *unlocked-secrets*) + (set! sv-148 (+ s5-0 7 sv-148)) + (set! sv-148 (+ sv-148 s5-0)) + ) + ) + ) + (when sv-156 + (set! (-> self scanlines-alpha) (seek-ease + (-> self scanlines-alpha) + (- 1.0 (-> self menu-transition)) + (* 0.05 (-> self clock time-adjust-ratio)) + 0.3 + (* 0.001 (-> self clock time-adjust-ratio)) + ) + ) + (end-scan sv-152 (-> self scanlines-alpha)) + ) + ) + (when (and (< 0.8 (-> self anim-frame)) (or (= (-> self current) 'bigmap) (= (-> self next) 'bigmap))) + (cond + ((>= (-> self pos-transition) 0.38) + (bigmap-method-11 *bigmap* 1792 1840 2304 2256) + ) + (else + (let ((s4-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 21))) + (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 24))) + (gp-1 (new 'stack-no-clear 'vector4w)) + ) + (set! (-> gp-1 quad) (the-as uint128 0)) + (let ((s5-1 (new 'stack-no-clear 'vector4w))) + (set! (-> s5-1 quad) (the-as uint128 0)) + (if (and (transform-point-qword! gp-1 s4-2) (transform-point-qword! s5-1 s3-1)) + (bigmap-method-11 + *bigmap* + (the-as int (/ (the-as int (-> s5-1 x)) 16)) + (the-as int (/ (the-as int (-> s5-1 y)) 16)) + (the-as int (/ (the-as int (-> gp-1 x)) 16)) + (the-as int (/ (the-as int (-> gp-1 y)) 16)) + ) + ) + ) + ) + ) + ) + ) + (ja-post) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate come-in (progress) + :virtual #t + :enter (behavior () + (sound-play "ring-appear") + (set! (-> self pos-transition) 1.0) + (none) + ) + :trans (behavior () + (let ((f30-0 (if (= (-> *progress-state* starting-state) 'main) + 0.0 + 0.2 + ) + ) + ) + (when (hud-hidden?) + (set! (-> *blit-displays-work* menu-mode) (the-as basic #t)) + (set! (-> self pos-transition) (seek-ease + (-> self pos-transition) + f30-0 + (* 0.03 (-> self clock time-adjust-ratio)) + 0.4 + (* 0.003 (-> self clock time-adjust-ratio)) + ) + ) + ) + (set-ring-position self) + (if (= (-> self pos-transition) f30-0) + (go-virtual idle) + ) + ) + (none) + ) + :code (behavior () + (until #f + (suspend) + (ja :num-func num-func-identity :frame-num 0.0) + (suspend) + ) + #f + (none) + ) + :post (the-as (function none :behavior progress) ja-post) + ) + +;; failed to figure out what this is: +(defstate idle (progress) + :virtual #t + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) + (the-as + object + (when (= v1-0 'notify) + (cond + ((= (-> event param 0) 'done) + (let ((t9-0 format) + (a0-3 #t) + (a1-1 "DONE NOTIFY: ~S ~S~%") + (v1-3 (the-as mc-status-code (-> event param 1))) + ) + (t9-0 + a0-3 + a1-1 + (cond + ((= v1-3 (mc-status-code bad-version)) + "bad-version" + ) + ((= v1-3 (mc-status-code no-save)) + "no-save" + ) + ((= v1-3 (mc-status-code no-last)) + "no-last" + ) + ((= v1-3 (mc-status-code no-space)) + "no-space" + ) + ((= v1-3 (mc-status-code internal-error)) + "internal-error" + ) + ((= v1-3 (mc-status-code no-memory)) + "no-memory" + ) + ((= v1-3 (mc-status-code bad-handle)) + "bad-handle" + ) + ((= v1-3 (mc-status-code busy)) + "busy" + ) + ((= v1-3 (mc-status-code write-error)) + "write-error" + ) + ((= v1-3 (mc-status-code read-error)) + "read-error" + ) + ((= v1-3 (mc-status-code no-card)) + "no-card" + ) + ((= v1-3 (mc-status-code no-format)) + "no-format" + ) + ((= v1-3 (mc-status-code ok)) + "ok" + ) + ((= v1-3 (mc-status-code no-process)) + "no-process" + ) + ((= v1-3 (mc-status-code no-auto-save)) + "no-auto-save" + ) + ((= v1-3 (mc-status-code no-file)) + "no-file" + ) + ((= v1-3 (mc-status-code format-failed)) + "format-failed" + ) + ((= v1-3 (mc-status-code new-game)) + "new-game" + ) + (else + "*unknown*" + ) + ) + (symbol->string (-> self current)) + ) + ) + (case (-> self current) + (('saving) + (cond + ((= (-> self state-stack 0) 'title) + (let ((gp-1 (-> *setting-control* user-default auto-save))) + (sound-volume-off) + (let ((v0-0 (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))))) + (set! (-> *setting-control* user-default auto-save) gp-1) + v0-0 + ) + ) + ) + (else + (progress-method-30 self) + ) + ) + ) + (('formatting) + (set-next-state self 'creating 0) + ) + (('creating) + (if (= (-> self state-stack 0) 'title) + (set-next-state self 'select-save-title 0) + (set-next-state self 'select-save 0) + ) + ) + ) + ) + ((= (-> event param 0) 'error) + (let ((t9-7 format) + (a0-18 #t) + (a1-5 "ERROR NOTIFY: ~S ~S ~S~%") + (v1-19 (the-as mc-status-code (-> event param 1))) + ) + (t9-7 + a0-18 + a1-5 + (cond + ((= v1-19 (mc-status-code bad-version)) + "bad-version" + ) + ((= v1-19 (mc-status-code no-save)) + "no-save" + ) + ((= v1-19 (mc-status-code no-last)) + "no-last" + ) + ((= v1-19 (mc-status-code no-space)) + "no-space" + ) + ((= v1-19 (mc-status-code internal-error)) + "internal-error" + ) + ((= v1-19 (mc-status-code no-memory)) + "no-memory" + ) + ((= v1-19 (mc-status-code bad-handle)) + "bad-handle" + ) + ((= v1-19 (mc-status-code busy)) + "busy" + ) + ((= v1-19 (mc-status-code write-error)) + "write-error" + ) + ((= v1-19 (mc-status-code read-error)) + "read-error" + ) + ((= v1-19 (mc-status-code no-card)) + "no-card" + ) + ((= v1-19 (mc-status-code no-format)) + "no-format" + ) + ((= v1-19 (mc-status-code ok)) + "ok" + ) + ((= v1-19 (mc-status-code no-process)) + "no-process" + ) + ((= v1-19 (mc-status-code no-auto-save)) + "no-auto-save" + ) + ((= v1-19 (mc-status-code no-file)) + "no-file" + ) + ((= v1-19 (mc-status-code format-failed)) + "format-failed" + ) + ((= v1-19 (mc-status-code new-game)) + "new-game" + ) + (else + "*unknown*" + ) + ) + (-> self current) + (-> self next) + ) + ) + (case (-> event param 1) + ((14) + (set-next-state self 'insufficient-space 0) + ) + (else + (case (-> self current) + (('formatting 'format-card) + (set-next-state self 'error-formatting 0) + ) + (('creating) + (set-next-state self 'error-creating 0) + ) + (('saving 'select-save 'select-save-title 'select-save-title-hero) + (set-next-state self 'error-saving 0) + ) + (('loading 'select-load) + (set-next-state self 'error-loading 0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :enter (behavior () + (set! (-> self menu-transition) 1.0) + (none) + ) + :trans progress-trans + :code (behavior () + (until #f + (ja :num-func num-func-identity :frame-num (* 12.0 (-> self anim-frame))) + (suspend) + ) + #f + (none) + ) + :post progress-post + ) + +;; failed to figure out what this is: +(defstate go-away (progress) + :virtual #t + :enter (behavior () + (remove-setting-by-arg0 *setting-control* 'extra-bank) + (let ((v1-2 *blit-displays-work*)) + (set! (-> v1-2 progress-interp-dest) 0.0) + (set! (-> v1-2 progress-interp-speed) 0.022222223) + ) + (none) + ) + :trans (behavior () + (seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (cond + ((= (-> self anim-frame) 0.0) + (seek! (-> self pos-transition) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (if (= (-> self pos-transition) 1.0) + (go-virtual gone) + ) + ) + (else + (seek! (-> self pos-transition) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + ) + ) + (set-ring-position self) + (none) + ) + :code (behavior () + (let ((gp-0 #f)) + (until #f + (when (and (not gp-0) (= (-> self anim-frame) 0.0)) + (sound-play "ring-disappear") + (set! gp-0 #t) + ) + (ja :num-func num-func-identity :frame-num (* 12.0 (-> self anim-frame))) + (suspend) + ) + ) + #f + (none) + ) + :post (the-as (function none :behavior progress) ja-post) + ) + +;; failed to figure out what this is: +(defstate gone (progress) + :virtual #t + :code (behavior () + ((method-of-object *bigmap* bigmap-method-15)) + (set! (-> *blit-displays-work* menu-mode) #f) + (while (or (-> *blit-displays-work* screen-copied) (nonzero? (-> *blit-displays-work* count-down))) + (suspend) + ) + (remove-setting! 'process-mask) + (set-master-mode *last-master-mode*) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) + ) + +;; definition for method 9 of type menu-option +(defmethod respond-progress menu-option ((obj menu-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + 0 + ) + +;; definition for method 9 of type menu-on-off-option +(defmethod respond-progress menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* on-off-choice)) + (gp-0 #f) + ) + (cond + (arg1 + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (not (-> v1-1 0)) + (set! gp-0 #t) + (when (= (-> obj value-to-modify) (&-> *setting-control* user-default vibration)) + (set! (-> *cpad-list* cpads 0 buzz-pause-val 0) (the-as uint 255)) + (set! (-> *cpad-list* cpads 0 buzz-pause-time) (the-as uint 15)) + ) + (set! (-> v1-1 0) #t) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (cond + ((and (-> v1-1 0) (= (-> obj value-to-modify) (&-> *setting-control* user-default use-progressive-scan))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (progress-method-29 arg0) + (set-next-state arg0 'progressive-mode-warning 0) + ) + (else + (set! (-> obj value-to-modify 0) (-> *progress-state* on-off-choice)) + ) + ) + ) + ) + ) + (else + (if (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> *progress-state* on-off-choice) (-> obj value-to-modify 0)) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +;; definition for method 9 of type menu-yes-no-option +(defmethod respond-progress menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (when arg1 + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (not (-> v1-1 0)) + (set! gp-0 #t) + (set! (-> v1-1 0) #t) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (cond + ((and (-> v1-1 0) (= (-> obj name) (game-text-id progress-root-restart-mission))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (restart-mission) + (set-next-state arg0 'go-away 0) + ) + ((and (-> v1-1 0) (= (-> obj name) (game-text-id progress-quit))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +;; definition for method 9 of type menu-slider-option +(defmethod respond-progress menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (-> *bigmap* progress-minimap) + (let ((gp-0 (-> obj value-to-modify)) + (s4-0 #f) + ) + (cond + (arg1 + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-abs 0)) + (seek! (-> (the-as (pointer float) gp-0)) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (if (!= (-> (the-as (pointer float) gp-0)) 0.0) + (set! s4-0 #t) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-abs 0)) + (seek! (-> (the-as (pointer float) gp-0)) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (if (!= (-> (the-as (pointer float) gp-0)) 1.0) + (set! s4-0 #t) + ) + ) + ((cpad-pressed? 0 triangle) + (set! (-> (the-as (pointer float) gp-0)) (-> *progress-state* slider-backup)) + ) + ) + ) + (else + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-abs 0)) + (seek! (-> (the-as (pointer float) gp-0)) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (if (!= (-> (the-as (pointer float) gp-0)) 0.0) + (set! s4-0 #t) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-abs 0)) + (seek! (-> (the-as (pointer float) gp-0)) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (if (!= (-> (the-as (pointer float) gp-0)) 1.0) + (set! s4-0 #t) + ) + ) + ) + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + ) + (when (cpad-pressed? 0 triangle) + (cond + ((!= (-> *progress-state* starting-state) 'title) + ) + (else + (sound-play "generic-beep") + ) + ) + ) + ) + ) + (when s4-0 + (let ((f30-0 1.0)) + (case (-> obj name) + (((game-text-id progress-sound-music-volume) (game-text-id progress-sound-speech-volume)) + (set! f30-0 (-> (the-as (pointer float) gp-0))) + ) + ) + (when (< (seconds 0.03) (- (-> self clock frame-counter) (-> *progress-state* last-slider-sound))) + (set! (-> *progress-state* last-slider-sound) (-> self clock frame-counter)) + (sound-play-by-name + (static-sound-name "menu-slide") + (new-sound-id) + (the int (* 1024.0 f30-0)) + 0 + 0 + (sound-group sfx) + #t + ) + ) + ) + ) + ) + ) + 0 + ) + +;; definition for method 9 of type menu-stereo-mode-sound-option +(defmethod respond-progress menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (-> *bigmap* progress-minimap) + (let ((a0-1 (-> *setting-control* user-default stereo-mode)) + (v1-4 #f) + ) + (let ((a3-0 2)) + (cond + (arg1 + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-1 -1) 0 a3-0)) + (set! v1-4 #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-1 1) 0 a3-0)) + (set! v1-4 #t) + ) + ((cpad-pressed? 0 triangle) + (set! (-> *setting-control* user-default stereo-mode) (-> *progress-state* stereo-mode-backup)) + ) + ) + ) + (else + (if (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> *progress-state* stereo-mode-backup) (-> *setting-control* user-default stereo-mode)) + ) + ) + ) + ) + (if v1-4 + (sound-play "generic-beep") + ) + ) + ) + 0 + ) + +;; definition for method 9 of type menu-main-menu-option +(defmethod respond-progress menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (cond + ((cpad-pressed? 0 start) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (when (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle)) #t) + (cond + ((= (-> obj name) (game-text-id progress-demo-exit)) + (case *kernel-boot-message* + (('demo-shared) + (set! *master-exit* 'force) + (set-master-mode 'game) + ) + (('demo) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "demo-restart") + ) + ) + ) + ((or (= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-1)) + (= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-2)) + (= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-3)) + ) + (case (-> obj name) + (((game-text-id progress-main-secrets-sceneplayer-2)) + (set! (-> *progress-state* scene-player-act) 2) + ) + (((game-text-id progress-main-secrets-sceneplayer-3)) + (set! (-> *progress-state* scene-player-act) 3) + ) + (else + (set! (-> *progress-state* scene-player-act) 1) + ) + ) + (sound-play "window-expand") + (progress-method-29 arg0) + (set-next-state arg0 (the-as symbol (-> obj next-state)) 0) + ) + ((= (-> obj next-state) 'back) + (progress-method-30 arg0) + ) + ((= (-> obj next-state) 'restart) + (sound-volume-off) + (restart-mission) + (progress-method-30 arg0) + ) + (else + (sound-play "window-expand") + (progress-method-29 arg0) + (set-next-state arg0 (the-as symbol (-> obj next-state)) 0) + ) + ) + ) + ) + ((not (-> arg0 selected-option)) + (let ((a0-53 (-> arg0 current-options options 0))) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (if (!= (length a0-53) 1) + (sound-play "ring-select") + ) + (cond + ((> (-> arg0 want-option-index) 0) + (set! (-> arg0 want-option-index) -1) + ) + ((< -2 (-> arg0 want-option-index)) + (+! (-> arg0 want-option-index) -1) + ) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (if (!= (length a0-53) 1) + (sound-play "ring-select") + ) + (cond + ((< (-> arg0 want-option-index) 0) + (set! (-> arg0 want-option-index) 1) + ) + ((< (-> arg0 want-option-index) 2) + (+! (-> arg0 want-option-index) 1) + ) + ) + ) + ) + ) + ) + ) + 0 + ) + +;; definition for method 9 of type menu-sub-menu-option +(defmethod respond-progress menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (and (-> *progress-state* secrets-unlocked) + (not (memcard-unlocked-secrets? #f)) + (or (= (-> arg0 current-options) *title*) + (= (-> arg0 current-options) *unlocked-secrets*) + (= (-> arg0 current-options) *select-scene-options*) + (= (-> arg0 current-options) *select-start-options*) + (= (-> arg0 current-options) *save-options-title*) + ) + ) + (set! (-> *progress-state* secrets-unlocked) #f) + (set! (-> arg0 state-pos) 0) + (set-next-state arg0 'secrets-insufficient-space 0) + ) + (when (= (-> obj name) (game-text-id progress-continue-without-saving)) + (let ((a1-3 (progress-method-28 arg0 (-> arg0 current)))) + (set-next-state arg0 a1-3 0) + ) + ) + (when (and (= (-> obj name) (game-text-id progress-root-secrets)) + (= *title* (-> arg0 current-options)) + (not (memcard-unlocked-secrets? #f)) + (= (-> arg0 option-index) 3) + ) + (set! (-> arg0 option-index) 0) + 0 + ) + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((= (-> obj name) (game-text-id progress-demo-exit)) + (case *kernel-boot-message* + (('demo-shared) + (set! *master-exit* 'force) + (set-master-mode 'game) + ) + (('demo) + (set! (-> *game-info* mode) 'play) + (initialize! *game-info* 'game (the-as game-save #f) "demo-restart") + ) + ) + ) + ((= (-> obj name) (game-text-id progress-continue-without-saving)) + (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + ) + ((= (-> obj next-state) 'back) + (progress-method-30 arg0) + ) + (else + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 (the-as symbol (-> obj next-state)) 0) + ) + ) + ) + 0 + ) + +;; definition for method 9 of type menu-unlocked-menu-option +(defmethod respond-progress menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s4-0 (memcard-unlocked-secrets? #t))) + (logclear! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) + (logclear! (-> *game-info* secrets) (game-secrets hero-mode)) + (when (not (-> *progress-state* secrets-unlocked)) + (set! (-> *progress-state* secrets-unlocked) #f) + (set! (-> arg0 state-pos) 0) + (set-next-state arg0 'secrets-insufficient-space 0) + ) + (cond + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((and (= (-> obj name) (game-text-id progress-main-secrets-scrapbook)) + (logtest? s4-0 (game-secrets scrap-book-1)) + ) + (sound-play "generic-beep") + (cond + ((send-event (handle->process (-> *game-info* controller 0)) 'scrap-book 1) + (set-next-state arg0 'go-away 0) + ) + (else + (set! (-> *game-info* demo-state) (the-as uint 201)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-mega-scrapbook)) + (logtest? s4-0 (game-secrets scrap-book-2)) + ) + (sound-play "generic-beep") + (cond + ((send-event (handle->process (-> *game-info* controller 0)) 'scrap-book 2) + (set-next-state arg0 'go-away 0) + ) + (else + (set! (-> *game-info* demo-state) (the-as uint 202)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-scrapbook-3)) + (logtest? s4-0 (game-secrets scrap-book-3)) + ) + (sound-play "generic-beep") + (cond + ((send-event (handle->process (-> *game-info* controller 0)) 'scrap-book 3) + (set-next-state arg0 'go-away 0) + ) + (else + (set! (-> *game-info* demo-state) (the-as uint 203)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-1)) + (logtest? s4-0 (game-secrets scene-player-1)) + ) + (set! (-> *progress-state* scene-player-act) 1) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-scene 0) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-2)) + (logtest? s4-0 (game-secrets scene-player-2)) + ) + (set! (-> *progress-state* scene-player-act) 2) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-scene 0) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-sceneplayer-3)) + (logtest? s4-0 (game-secrets scene-player-3)) + ) + (set! (-> *progress-state* scene-player-act) 3) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-scene 0) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-hero-mode)) + (logtest? s4-0 (game-secrets hero-mode)) + ) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-save-title-hero 0) + ) + ((and (= (-> obj name) (game-text-id progress-main-secrets-levelselect)) + (logtest? s4-0 (game-secrets level-select)) + ) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-start 0) + ) + ((= (-> obj next-state) 'back) + (progress-method-30 arg0) + ) + ) + ) + ((not (-> arg0 selected-option)) + (let ((a0-131 (-> arg0 current-options options 0))) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (!= (length a0-131) 1) + ) + (cond + ((> (-> arg0 want-option-index) 0) + (set! (-> arg0 want-option-index) -1) + ) + ((< -2 (-> arg0 want-option-index)) + (+! (-> arg0 want-option-index) -1) + ) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (!= (length a0-131) 1) + ) + (cond + ((< (-> arg0 want-option-index) 0) + (set! (-> arg0 want-option-index) 1) + ) + ((< (-> arg0 want-option-index) 2) + (+! (-> arg0 want-option-index) 1) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + ) + +;; definition for method 9 of type menu-memcard-slot-option +(defmethod respond-progress menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (memcard-unlocked-secrets? #t) + (let ((a1-2 (progress-method-28 arg0 (-> arg0 current)))) + (set-next-state arg0 a1-2 0) + ) + (set! (-> arg0 selected-option) #f) + (when (-> *bigmap* progress-minimap) + (cond + ((cpad-pressed? 0 triangle) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (let ((s5-0 #f)) + *progress-save-info* + (set! (-> *progress-state* which-slot) (-> arg0 option-index)) + (cond + ((= (-> arg0 current) 'select-load) + (when (= (-> *progress-save-info* file (-> arg0 option-index) present) 1) + (set! s5-0 #t) + (set-next-state arg0 'loading 0) + ) + ) + ((= (-> *progress-save-info* file (-> *progress-state* which-slot) present) 1) + (set! s5-0 #t) + (menu-update-purchase-secrets (the-as menu-secret-option (-> *secret-options* options 0 box 0 min x))) + (set-next-state arg0 'already-exists 0) + ) + (else + (set! s5-0 #t) + (menu-update-purchase-secrets (the-as menu-secret-option (-> *secret-options* options 0 box 0 min x))) + (set-next-state arg0 'saving 0) + ) + ) + (if s5-0 + (sound-play "generic-beep") + ) + ) + ) + ) + ) + 0 + ) + +;; definition for method 9 of type menu-already-exists-option +(defmethod respond-progress menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s4-0 (&-> *progress-state* yes-no-choice)) + (a1-2 (progress-method-28 arg0 'select-save)) + (gp-0 #f) + ) + (if (!= a1-2 'select-save) + (set-next-state arg0 a1-2 0) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> s4-0 0))) + (set! (-> s4-0 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> s4-0 0)) + (set! (-> s4-0 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((-> *progress-state* yes-no-choice) + (sound-play "generic-beep") + (set-next-state arg0 'saving 0) + ) + ((begin (sound-play "generic-beep") (= (-> arg0 state-stack 0) 'title)) + (set-next-state arg0 'select-save-title 0) + ) + (else + (set-next-state arg0 'select-save 0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +;; definition for method 9 of type menu-create-game-option +(defmethod respond-progress menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s4-0 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (let ((a1-2 (progress-method-28 arg0 'select-save))) + (if (!= a1-2 'select-save) + (set-next-state arg0 a1-2 0) + ) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> s4-0 0))) + (set! (-> s4-0 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> s4-0 0)) + (set! (-> s4-0 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((-> *progress-state* yes-no-choice) + (set-next-state arg0 'creating 0) + ) + ((= (-> arg0 state-stack 0) 'title) + (sound-play "generic-beep") + (sound-volume-off) + (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + ) + (else + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +;; definition for method 9 of type menu-insufficient-space-option +(defmethod respond-progress menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s5-0 (&-> *progress-state* yes-no-choice)) + (s3-0 (progress-method-28 arg0 'select-save)) + ) + (cond + ((or (= (-> *progress-state* starting-state) 'insufficient-space) + (= (-> *progress-state* starting-state) 'no-memory-card) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (and (not (-> s5-0 0)) (not (-> *progress-state* clear-screen))) + (sound-play "generic-beep") + (set! (-> s5-0 0) #t) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (and (-> s5-0 0) (not (-> *progress-state* clear-screen))) + (sound-play "generic-beep") + (set! (-> s5-0 0) #f) + ) + ) + ((and (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) (!= (-> arg0 current) 'none)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> *progress-state* clear-screen) (the-as basic #t)) + (cond + ((-> s5-0 0) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ((and (not (-> s5-0 0)) + (!= (progress-method-28 arg0 'select-save) 'insufficient-space) + (!= (progress-method-28 arg0 'select-save) 'no-memory-card) + ) + (progress-method-30 arg0) + ) + (else + (sound-play "generic-beep") + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> arg0 current) 'none) + (set-next-state arg0 s3-0 0) + ) + ) + ) + ) + ) + (else + (let ((a1-9 'select-save-title-hero)) + 'select-save + (cond + ((and (= (-> *progress-state* starting-state) 'main) + (zero? (logand (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + ) + (set! a1-9 'select-save) + ) + ((and (= (-> *progress-state* starting-state) 'title) + (zero? (logand (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + ) + (set! a1-9 'select-save-title) + ) + ) + (let ((a1-10 (progress-method-28 arg0 a1-9))) + (set-next-state arg0 a1-10 0) + ) + ) + (cond + ((and (cpad-pressed? 0 triangle) + (or (= (-> *progress-state* starting-state) 'title) (= (-> *progress-state* starting-state) 'main)) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((= (-> arg0 state-stack 0) 'title) + (sound-play "generic-beep") + (sound-volume-off) + (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + ) + (else + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + ) + ) + ) + ) + ) + 0 + ) + +;; definition for method 9 of type menu-secrets-insufficient-space-option +(defmethod respond-progress menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (&-> *progress-state* yes-no-choice) + (cond + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (set-next-state arg0 'title 0) + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + ) + ) + 0 + ) + +;; definition for method 9 of type menu-video-mode-warning-option +(defmethod respond-progress menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> *progress-state* video-mode-timeout) 0) + (cond + ((-> *progress-state* yes-no-choice) + (set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice)) + (set! (-> *progress-state* video-mode-timeout) (-> self clock frame-counter)) + (set-next-state arg0 'video-mode-ok 0) + ) + (else + (set! (-> *progress-state* video-mode-choice) 'pal) + (progress-method-30 arg0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +;; definition for method 9 of type menu-video-mode-ok-option +(defmethod respond-progress menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (s5-0 #f) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s5-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s5-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((not (-> *progress-state* yes-no-choice)) + (set! (-> *progress-state* video-mode-choice) 'pal) + (set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice)) + (sound-play "generic-beep") + ) + (else + (sound-play "generic-beep") + ) + ) + (set! (-> *progress-state* video-mode-timeout) 0) + (progress-method-30 arg0) + ) + ) + (if s5-0 + (sound-play "generic-beep") + ) + ) + (when (and (nonzero? (-> *progress-state* video-mode-timeout)) + (< (seconds 10) (- (-> self clock frame-counter) (-> *progress-state* video-mode-timeout))) + ) + (set! (-> *progress-state* video-mode-timeout) 0) + (set! (-> *progress-state* video-mode-choice) 'pal) + (set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice)) + (progress-method-30 arg0) + ) + 0 + ) + +;; definition for method 9 of type menu-progressive-mode-warning-option +(defmethod respond-progress menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + (set! (-> *progress-state* graphic-options-progressive-scan) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> *progress-state* progressive-mode-timeout) 0) + (cond + ((-> *progress-state* yes-no-choice) + (sound-play "generic-beep") + (set-progressive-scan #t) + (set! (-> *progress-state* graphic-options-progressive-scan) #t) + (set! (-> *progress-state* progressive-mode-timeout) (-> self clock frame-counter)) + (set-next-state arg0 'progressive-mode-ok 0) + ) + (else + (sound-play "generic-beep") + (set! (-> *progress-state* on-off-choice) #f) + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (set-progressive-scan #f) + (progress-method-30 arg0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +;; definition for method 9 of type menu-progressive-mode-ok-option +(defmethod respond-progress menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (s5-0 #f) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s5-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s5-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((not (-> *progress-state* yes-no-choice)) + (set! (-> *setting-control* user-default use-progressive-scan) #f) + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (sound-play "generic-beep") + ) + (else + (sound-play "generic-beep") + (set! (-> *progress-state* graphic-options-progressive-scan) #t) + ) + ) + (set! (-> *progress-state* progressive-mode-timeout) 0) + (progress-method-30 arg0) + ) + ) + (if s5-0 + (sound-play "generic-beep") + ) + ) + (when (and (nonzero? (-> *progress-state* progressive-mode-timeout)) + (< (seconds 10) (- (-> self clock frame-counter) (-> *progress-state* progressive-mode-timeout))) + ) + (set! (-> *progress-state* progressive-mode-timeout) 0) + (set! (-> *setting-control* user-default use-progressive-scan) #f) + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (set-progressive-scan #f) + (progress-method-30 arg0) + ) + 0 + ) + +;; definition for method 9 of type menu-card-removed-option +(defmethod respond-progress menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +;; definition for method 9 of type menu-insert-card-option +(defmethod respond-progress menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + *progress-save-info* + (cond + ((= (progress-method-28 arg0 'select-load) 'select-load) + (set-next-state arg0 'select-load 0) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + 0 + ) + +;; definition for method 9 of type menu-error-loading-option +(defmethod respond-progress menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +;; definition for method 9 of type menu-error-auto-saving-option +(defmethod respond-progress menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +;; definition for method 9 of type menu-error-disc-removed-option +(defmethod respond-progress menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (when (is-cd-in?) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + 0 + ) + +;; definition for method 9 of type menu-error-reading-option +(defmethod respond-progress menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +;; definition for method 9 of type menu-icon-info-option +(defmethod respond-progress menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +;; definition for method 9 of type menu-quit-option +(defmethod respond-progress menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((-> *progress-state* yes-no-choice) + (sound-volume-off) + (set! (-> *game-info* mode) 'play) + (case *kernel-boot-message* + (('demo-shared 'demo) + (initialize! *game-info* 'game (the-as game-save #f) "demo-start") + ) + (else + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + (else + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +;; definition for method 9 of type menu-format-card-option +(defmethod respond-progress menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s4-0 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (let ((a1-2 (progress-method-28 arg0 (-> arg0 current)))) + (set-next-state arg0 a1-2 0) + ) + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> s4-0 0))) + (set! (-> s4-0 0) #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> s4-0 0)) + (set! (-> s4-0 0) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (cond + ((-> *progress-state* yes-no-choice) + (sound-play "generic-beep") + (set-next-state arg0 'formatting 0) + ) + ((= (-> arg0 state-stack 0) 'title) + (sound-play "generic-beep") + (sound-volume-off) + (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + ) + (else + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +;; definition for method 9 of type menu-select-start-option +;; WARN: disable def twice: 110. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod respond-progress menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (set! (-> arg0 sliding-height) (seek-ease + (-> arg0 sliding-height) + 0.0 + (* 0.1 (-> self clock time-adjust-ratio)) + 0.3 + (* 0.001 (-> self clock time-adjust-ratio)) + ) + ) + (let ((s4-0 #f)) + (memcard-unlocked-secrets? #t) + (when (not (-> *progress-state* secrets-unlocked)) + (set! (-> *progress-state* secrets-unlocked) #f) + (set! (-> arg0 state-pos) 0) + (set-next-state arg0 'secrets-insufficient-space 0) + ) + (cond + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (> (-> obj task-index) 0) + (set! s4-0 #t) + (+! (-> obj task-index) -1) + (set! (-> arg0 sliding-height) -1.0) + ) + ) + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (let ((s3-0 -1)) + (dotimes (s2-0 (-> *game-info* play-list length)) + (let* ((v1-41 (-> *game-info* play-list s2-0)) + (a0-20 (-> arg0 current)) + (a0-22 (cond + ((= a0-20 'select-pre-start) + (or (-> v1-41 play-continue) (-> v1-41 pre-play-continue)) + ) + ((= a0-20 'select-kiosk-start) + (-> v1-41 kiosk-play-continue) + ) + (else + (-> v1-41 play-continue) + ) + ) + ) + ) + (if (and a0-22 (lookup-text! *common-text* (-> v1-41 text-name) #t)) + (+! s3-0 1) + ) + ) + ) + (when (< (-> obj task-index) s3-0) + (set! s4-0 #t) + (+! (-> obj task-index) 1) + (set! (-> arg0 sliding-height) 1.0) + ) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (let* ((t9-6 play-task) + (a0-40 (-> obj real-task-index)) + (a1-8 'debug) + (v1-64 (-> arg0 current)) + (a1-9 (t9-6 (the-as game-task a0-40) a1-8 (cond + ((= v1-64 'select-pre-start) + 'pre-play + ) + ((= v1-64 'select-kiosk-start) + 'kiosk + ) + (else + 'play + ) + ) + ) + ) + ) + (start 'play (get-continue-by-name *game-info* a1-9)) + ) + (set-master-mode 'game) + ) + ) + (if s4-0 + (sound-play "secrets-scroll") + ) + ) + 0 + ) + +;; definition for method 9 of type menu-select-scene-option +(defmethod respond-progress menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (set! (-> arg0 sliding-height) (seek-ease + (-> arg0 sliding-height) + 0.0 + (* 0.1 (-> self clock time-adjust-ratio)) + 0.3 + (* 0.01 (-> self clock time-adjust-ratio)) + ) + ) + (let ((gp-0 #f)) + (let ((s4-0 *hud-select-scene-act1*)) + (memcard-unlocked-secrets? #t) + (when (not (-> *progress-state* secrets-unlocked)) + (set! (-> *progress-state* secrets-unlocked) #f) + (set! (-> arg0 state-pos) 0) + (set-next-state arg0 'secrets-insufficient-space 0) + ) + (case (-> *progress-state* scene-player-act) + ((1) + (set! s4-0 *hud-select-scene-act1*) + ) + ((2) + (set! s4-0 *hud-select-scene-act2*) + ) + ((3) + (set! s4-0 *hud-select-scene-act3*) + ) + ) + (cond + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (> (-> obj task-index) 0) + (set! gp-0 #t) + (+! (-> obj task-index) -1) + (set! (-> arg0 sliding-height) -1.0) + ) + ) + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (< (-> obj task-index) (+ (length s4-0) -1)) + (set! gp-0 #t) + (+! (-> obj task-index) 1) + (set! (-> arg0 sliding-height) 1.0) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (let ((s3-2 *display-profile*)) + (play-clean 'debug) + (set! *display-profile* s3-2) + ) + (set! (-> *game-info* mode) 'play) + (let ((s5-1 (-> s4-0 (-> obj task-index)))) + (set! (-> *game-info* demo-state) (the-as uint 100)) + (logior! (-> *game-info* secrets) (game-secrets scene-player-1)) + (process-spawn scene-player :init scene-player-init (-> s5-1 info) #t (-> s5-1 continue)) + ) + (set-master-mode 'game) + ) + ) + ) + (if gp-0 + (sound-play "secrets-scroll") + ) + ) + 0 + ) + +;; definition for method 9 of type menu-bigmap-option +(defmethod respond-progress menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + ((method-of-object *bigmap* bigmap-method-12)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + 0 + ) + +;; definition for method 9 of type menu-missions-option +(defmethod respond-progress menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (set! (-> arg0 sliding-height) (seek-ease + (-> arg0 sliding-height) + 0.0 + (* 0.1 (-> self clock time-adjust-ratio)) + 0.3 + (* 0.01 (-> self clock time-adjust-ratio)) + ) + ) + (let ((s5-0 #f)) + (cond + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (> (-> obj task-line-index) 0) + (set! s5-0 #t) + (+! (-> obj task-line-index) -1) + (set! (-> arg0 sliding-height) -1.0) + ) + ) + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (< (-> obj task-line-index) (+ (-> *progress-state* total-num-tasks) -1)) + (+! (-> obj task-line-index) 1) + (set! (-> arg0 sliding-height) 1.0) + (set! s5-0 #t) + ) + ) + ((logtest? (pad-buttons triangle confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle confirm)) + (if (!= (-> *progress-state* starting-state) 'title) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + (if s5-0 + (sound-play "mission-scroll") + ) + ) + 0 + ) + +;; definition for method 9 of type menu-highscores-option +(defmethod respond-progress menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (set! (-> arg0 sliding) (seek-ease + (-> arg0 sliding) + 0.0 + (* 0.1 (-> self clock time-adjust-ratio)) + 0.3 + (* 0.001 (-> self clock time-adjust-ratio)) + ) + ) + (set! (-> arg0 sliding-off) (seek-ease + (-> arg0 sliding-off) + 1.0 + (* 0.1 (-> self clock time-adjust-ratio)) + -0.3 + (* 0.001 (-> self clock time-adjust-ratio)) + ) + ) + (when (-> *bigmap* progress-minimap) + (let ((s5-0 #f)) + (cond + ((or (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (when (< 1 (get-num-highscores)) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (set! s5-0 #t) + (set! (-> obj prev-page-index) (-> obj page-index)) + (set! (-> obj page-index) (get-next-highscore (-> obj page-index))) + (set! (-> arg0 sliding) 1.0) + (set! (-> arg0 sliding-off) 0.0) + (set! (-> obj slide-dir) -1.0) + ) + ) + ((or (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (when (< 1 (get-num-highscores)) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> obj prev-page-index) (-> obj page-index)) + (set! (-> obj page-index) (get-prev-highscore (-> obj page-index))) + (set! s5-0 #t) + (set! (-> arg0 sliding) -1.0) + (set! (-> arg0 sliding-off) 0.0) + (set! (-> obj slide-dir) 1.0) + ) + ) + ((logtest? (pad-buttons triangle confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle confirm)) + (set! (-> arg0 sliding) 0.0) + (set! (-> arg0 sliding-off) 1.0) + (if (!= (-> *progress-state* starting-state) 'title) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + (if s5-0 + (sound-play "score-slide") + ) + ) + ) + 0 + ) + +;; definition for method 9 of type menu-secret-option +(defmethod respond-progress menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let* ((s5-1 (logtest? (-> *game-info* secrets) (game-secrets hero-mode))) + (s3-0 (if (not s5-1) + 0 + (-> obj num-items) + ) + ) + (s2-0 (if (not s5-1) + (+ (-> obj num-items) -1) + (+ (-> obj num-items) -1 (-> obj num-hero-items)) + ) + ) + ) + (set! (-> arg0 sliding) (seek-ease + (-> arg0 sliding) + 0.0 + (* 0.1 (-> self clock time-adjust-ratio)) + 0.3 + (* 0.001 (-> self clock time-adjust-ratio)) + ) + ) + (cond + ((and s5-1 (< (-> obj item-index) s3-0)) + (set! (-> obj item-index) s3-0) + (set! (-> obj prev-item-index) s3-0) + ) + ((and (not s5-1) (< s2-0 (-> obj item-index))) + (set! (-> obj item-index) s3-0) + (set! (-> obj prev-item-index) s3-0) + ) + ) + (menu-update-purchase-secrets obj) + (when (-> *bigmap* progress-minimap) + (let ((s5-2 #f)) + (cond + ((= arg1 #t) + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (set! (-> arg0 selected-option) #f) + ) + ) + (else + (cond + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (< (-> obj item-index) s2-0) + (set! (-> obj prev-item-index) (-> obj item-index)) + (set! s5-2 #t) + (+! (-> obj item-index) 1) + (set! (-> arg0 sliding) 1.0) + (set! (-> arg0 sliding-off) 0.0) + ) + ) + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (< s3-0 (-> obj item-index)) + (set! (-> obj prev-item-index) (-> obj item-index)) + (+! (-> obj item-index) -1) + (set! s5-2 #t) + (set! (-> arg0 sliding) -1.0) + (set! (-> arg0 sliding-off) 0.0) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (let ((v1-74 (-> obj item-index))) + (-> obj secret-items v1-74 cost) + (let ((a0-54 (-> obj secret-items v1-74 flag)) + (a1-9 (= (-> obj secret-items v1-74 can-toggle) #t)) + ) + (-> obj secret-items v1-74 avail-after) + (the int (-> *game-info* skill)) + (cond + ((and (logtest? (-> *game-info* purchase-secrets) a0-54) a1-9) + (set! (-> arg0 selected-option) #t) + (sound-play "generic-beep") + ) + ((= (-> obj secret-items v1-74 can-toggle) 'auto) + ) + ((logtest? (-> *game-info* purchase-secrets) a0-54) + (set! (-> arg0 selected-option) #t) + (sound-play "generic-beep") + ) + ) + ) + ) + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (if (!= (-> *progress-state* starting-state) 'title) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + (if s5-2 + (sound-play "secrets-scroll") + ) + ) + ) + ) + ) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + 0 + ) + +;; definition for method 9 of type menu-game-option +(defmethod respond-progress menu-game-option ((obj menu-game-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (-> *progress-state* game-options-vibrations) + (-> *progress-state* game-options-subtitles) + (let ((gp-0 #f)) + (load-level-text-files (the-as int (-> *setting-control* user-current language))) + (cond + ((= (-> *progress-state* game-options-item-picked) #f) + (cond + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* game-options-last-move))) (seconds 0.5)) + ) + ) + (set! (-> *progress-state* game-options-last-move) (the-as uint (-> self clock frame-counter))) + (cond + ((< (-> *progress-state* game-options-item-selected) 3) + (+! (-> *progress-state* game-options-item-selected) 1) + ) + (else + (set! (-> *progress-state* game-options-item-selected) 0) + 0 + ) + ) + ) + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* game-options-last-move))) (seconds 0.5)) + ) + ) + (set! (-> *progress-state* game-options-last-move) (the-as uint (-> self clock frame-counter))) + (if (> (-> *progress-state* game-options-item-selected) 0) + (+! (-> *progress-state* game-options-item-selected) -1) + (set! (-> *progress-state* game-options-item-selected) 3) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> *progress-state* game-options-last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> *progress-state* game-options-item-picked) (the-as basic #t)) + (sound-play "generic-beep") + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (if (= (-> *progress-state* starting-state) 'main) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + ) + ((-> *progress-state* game-options-item-picked) + (cond + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (set! (-> *progress-state* game-options-item-picked) #f) + (set! (-> *progress-state* game-options-vibrations) (-> *setting-control* user-default vibration)) + (set! (-> *progress-state* game-options-subtitles) (-> *setting-control* user-default subtitle)) + (set! (-> *progress-state* game-options-language-index) + (the-as int (-> *setting-control* user-default language)) + ) + (set! (-> *progress-state* game-options-subtitle-language-index) + (the-as int (-> *setting-control* user-default subtitle-language)) + ) + ) + ((logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons up l-analog-down)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up l-analog-down)) + ) + ((logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons down l-analog-up)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons down l-analog-up)) + ) + ((and (zero? (-> *progress-state* game-options-item-selected)) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (when (not (-> *progress-state* game-options-vibrations)) + (set! (-> *cpad-list* cpads 0 buzz-pause-val 0) (the-as uint 255)) + (set! (-> *cpad-list* cpads 0 buzz-pause-time) (the-as uint 15)) + (set! (-> *progress-state* game-options-vibrations) #t) + ) + ) + ((and (= (-> *progress-state* game-options-item-selected) 1) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (not (-> *progress-state* game-options-subtitles)) + (set! (-> *progress-state* game-options-subtitles) #t) + ) + ) + ((and (= (-> *progress-state* game-options-item-selected) 2) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (zero? (-> *progress-state* game-options-subtitle-language-index)) + (set! (-> *progress-state* game-options-subtitle-language-index) 6) + (+! (-> *progress-state* game-options-subtitle-language-index) -1) + ) + ) + ((and (= (-> *progress-state* game-options-item-selected) 3) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (zero? (-> *progress-state* game-options-language-index)) + (set! (-> *progress-state* game-options-language-index) 6) + (+! (-> *progress-state* game-options-language-index) -1) + ) + ) + ((and (zero? (-> *progress-state* game-options-item-selected)) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (set! (-> *progress-state* game-options-vibrations) #f) + ) + ((and (= (-> *progress-state* game-options-item-selected) 1) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (set! (-> *progress-state* game-options-subtitles) #f) + ) + ((and (= (-> *progress-state* game-options-item-selected) 2) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (cond + ((= (-> *progress-state* game-options-subtitle-language-index) 6) + (set! (-> *progress-state* game-options-subtitle-language-index) 0) + 0 + ) + (else + (+! (-> *progress-state* game-options-subtitle-language-index) 1) + ) + ) + ) + ((and (= (-> *progress-state* game-options-item-selected) 3) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (cond + ((= (-> *progress-state* game-options-language-index) 6) + (set! (-> *progress-state* game-options-language-index) 0) + 0 + ) + (else + (+! (-> *progress-state* game-options-language-index) 1) + ) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (if (zero? (-> *progress-state* game-options-item-selected)) + (set! (-> *setting-control* user-default vibration) (-> *progress-state* game-options-vibrations)) + ) + (if (= (-> *progress-state* game-options-item-selected) 1) + (set! (-> *setting-control* user-default subtitle) (-> *progress-state* game-options-subtitles)) + ) + (if (= (-> *progress-state* game-options-item-selected) 2) + (set! (-> *setting-control* user-default subtitle-language) + (the-as language-enum (-> *progress-state* game-options-subtitle-language-index)) + ) + ) + (when (= (-> *progress-state* game-options-item-selected) 3) + (set! (-> *setting-control* user-default language) + (the-as language-enum (-> *progress-state* game-options-language-index)) + ) + (load-level-text-files (-> *progress-state* game-options-language-index)) + ) + (set! (-> *progress-state* game-options-item-picked) #f) + ) + ) + ) + ) + (when (and gp-0 (-> *progress-state* game-options-item-picked)) + ) + ) + 0 + ) + +;; definition for function update-center-screen +(defun update-center-screen () + (with-pp + (let ((v1-0 #f)) + (cond + (#t + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-abs 0)) + (set! (-> *setting-control* user-default display-dx) + (min-max-wrap-around (+ (-> *setting-control* user-default display-dx) -2) -96 96) + ) + (set! v1-0 #t) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-abs 0)) + (set! (-> *setting-control* user-default display-dx) + (min-max-wrap-around (+ (-> *setting-control* user-default display-dx) 2) -96 96) + ) + (set! v1-0 #t) + ) + ((logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (set! (-> *setting-control* user-default display-dy) + (min-max-wrap-around (+ (-> *setting-control* user-default display-dy) -2) -48 48) + ) + (set! v1-0 #f) + ) + ((logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (set! (-> *setting-control* user-default display-dy) + (min-max-wrap-around (+ (-> *setting-control* user-default display-dy) 2) -48 48) + ) + (set! v1-0 #f) + ) + ((cpad-pressed? 0 triangle) + (set! (-> *setting-control* user-default display-dx) (-> *progress-state* center-x-backup)) + (set! (-> *setting-control* user-default display-dy) (-> *progress-state* center-y-backup)) + ) + ) + ) + (else + (when (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> *progress-state* center-x-backup) (-> *setting-control* user-default display-dx)) + (set! (-> *progress-state* center-y-backup) (-> *setting-control* user-default display-dy)) + ) + ) + ) + (when v1-0 + (when (< (seconds 0.3) (- (-> pp clock frame-counter) (-> *progress-state* last-slider-sound))) + (set! (-> *progress-state* last-slider-sound) (-> pp clock frame-counter)) + (sound-play "roll-over") + ) + ) + ) + 0 + ) + ) + +;; definition for method 9 of type menu-graphic-option +(defmethod respond-progress menu-graphic-option ((obj menu-graphic-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (-> *progress-state* graphic-options-aspect-ratio) + (-> *progress-state* graphic-options-progressive-scan) + (-> *progress-state* video-mode-choice) + (cond + ((= (-> *progress-state* graphic-options-item-picked) #f) + (cond + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* graphic-options-last-move))) + (seconds 0.5) + ) + ) + ) + (set! (-> *progress-state* graphic-options-last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> arg0 selected-option) #f) + (cond + ((< (-> *progress-state* graphic-options-item-selected) (if (= (scf-get-territory) 1) + 3 + 2 + ) + ) + (+! (-> *progress-state* graphic-options-item-selected) 1) + (set! (-> arg0 option-index) (-> *progress-state* graphic-options-item-selected)) + ) + (else + (set! (-> *progress-state* graphic-options-item-selected) 0) + (set! (-> arg0 option-index) (-> *progress-state* graphic-options-item-selected)) + ) + ) + ) + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* graphic-options-last-move))) + (seconds 0.5) + ) + ) + ) + (set! (-> *progress-state* graphic-options-last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> arg0 selected-option) #f) + (cond + ((> (-> *progress-state* graphic-options-item-selected) 0) + (+! (-> *progress-state* graphic-options-item-selected) -1) + (set! (-> arg0 option-index) (-> *progress-state* graphic-options-item-selected)) + ) + (else + (set! (-> *progress-state* graphic-options-item-selected) (if (= (scf-get-territory) 1) + 3 + 2 + ) + ) + (set! (-> arg0 option-index) (-> *progress-state* graphic-options-item-selected)) + ) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> *progress-state* graphic-options-last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> *progress-state* graphic-options-item-picked) (the-as basic #t)) + (set! (-> arg0 selected-option) #f) + (sound-play "generic-beep") + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (if (= (-> *progress-state* starting-state) 'main) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + ) + ((-> *progress-state* graphic-options-item-picked) + (cond + ((and (cpad-pressed? 0 square) (zero? (-> *progress-state* graphic-options-item-selected))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons square)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons square)) + (set! (-> *setting-control* user-default display-dx) 0) + (set! (-> *setting-control* user-default display-dy) 8) + (sound-play "generic-beep") + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (set! (-> *progress-state* graphic-options-item-picked) #f) + (set! (-> *progress-state* graphic-options-aspect-ratio) (get-aspect-ratio)) + (set! (-> *progress-state* graphic-options-progressive-scan) + (-> *setting-control* user-default use-progressive-scan) + ) + (set! (-> *progress-state* video-mode-choice) (get-video-mode)) + ) + ((and (zero? (-> *progress-state* graphic-options-item-selected)) + (logtest? (pad-buttons up right down left l-analog-down l-analog-right l-analog-up l-analog-left) + (-> *cpad-list* cpads 0 button0-rel 0) + ) + ) + (let ((t9-13 update-center-screen)) + #t + (t9-13) + ) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 1) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (set! (-> *progress-state* graphic-options-aspect-ratio) 'aspect4x3) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 2) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (not (-> *progress-state* graphic-options-progressive-scan)) + (set! (-> *progress-state* graphic-options-progressive-scan) #t) + ) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 3) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (!= (-> *progress-state* video-mode-choice) 'pal) + (set! (-> *progress-state* video-mode-choice) 'pal) + ) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 1) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (set! (-> *progress-state* graphic-options-aspect-ratio) 'aspect16x9) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 2) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (when (-> *progress-state* graphic-options-progressive-scan) + (sound-play "generic-beep") + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (set! (-> *setting-control* user-default use-progressive-scan) #f) + ) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 3) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (!= (-> *progress-state* video-mode-choice) 'ntsc) + (set! (-> *progress-state* video-mode-choice) 'ntsc) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (sound-play "generic-beep") + (when (zero? (-> *progress-state* graphic-options-item-selected)) + (let ((t9-28 update-center-screen)) + #t + (t9-28) + ) + ) + (when (= (-> *progress-state* graphic-options-item-selected) 1) + (if (!= (-> *progress-state* graphic-options-aspect-ratio) (-> *setting-control* user-default aspect-ratio)) + (set! (-> *setting-control* user-default aspect-ratio) (-> *progress-state* graphic-options-aspect-ratio)) + ) + ) + (when (and (= (-> *progress-state* graphic-options-item-selected) 2) + (-> *progress-state* graphic-options-progressive-scan) + (not (-> *setting-control* user-default use-progressive-scan)) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (progress-method-29 arg0) + (set-next-state arg0 'progressive-mode-warning 0) + ) + (when (and (= (-> *progress-state* graphic-options-item-selected) 3) + (!= (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice)) + ) + (let ((a0-173 (-> *progress-state* video-mode-choice))) + (case a0-173 + (('pal) + (set! (-> *setting-control* user-default video-mode) a0-173) + ) + (('ntsc) + (progress-method-29 arg0) + (set-next-state arg0 'video-mode-warning 0) + ) + ) + ) + ) + (set! (-> *progress-state* graphic-options-item-picked) #f) + ) + ) + ) + ) + 0 + ) + +;; definition for function update-restart-quit +(defun update-restart-quit ((arg0 menu-option) (arg1 progress) (arg2 symbol)) + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (when arg2 + (cond + ((logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (not (-> v1-1 0)) + (set! gp-0 #t) + (set! (-> v1-1 0) #t) + ) + ) + ((logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + (format #t "HL ~A~%" (-> v1-1 0)) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (cond + ((and (-> v1-1 0) (= (-> arg0 name) (game-text-id progress-root-restart-mission))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (restart-mission) + (set-next-state arg1 'go-away 0) + ) + ((and (-> v1-1 0) (= (-> arg0 name) (game-text-id progress-quit))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ) + ) + (when gp-0 + ) + ) + 0 + ) + +;; definition for method 9 of type menu-qr-option +(defmethod respond-progress menu-qr-option ((obj menu-qr-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (-> *progress-state* qr-options-restart) + (-> *progress-state* qr-options-quit) + (cond + ((= (-> *progress-state* qr-options-item-picked) #f) + (set! (-> arg0 selected-option) #f) + (set! (-> arg0 option-index) (-> *progress-state* qr-options-item-selected)) + (cond + ((or (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down l-analog-up) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* qr-options-last-move))) (seconds 0.5)) + ) + ) + (set! (-> *progress-state* qr-options-last-move) (the-as uint (-> self clock frame-counter))) + (cond + ((< (-> *progress-state* qr-options-item-selected) 1) + (+! (-> *progress-state* qr-options-item-selected) 1) + (set! (-> arg0 selected-option) #f) + (set! (-> arg0 option-index) 0) + 0 + ) + (else + (set! (-> *progress-state* qr-options-item-selected) 0) + (set! (-> arg0 selected-option) #f) + (set! (-> arg0 option-index) 0) + 0 + ) + ) + ) + ((or (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up l-analog-down) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* qr-options-last-move))) (seconds 0.5)) + ) + ) + (set! (-> *progress-state* qr-options-last-move) (the-as uint (-> self clock frame-counter))) + (cond + ((> (-> *progress-state* qr-options-item-selected) 0) + (+! (-> *progress-state* qr-options-item-selected) -1) + (set! (-> arg0 selected-option) #f) + (set! (-> arg0 option-index) 1) + ) + (else + (set! (-> *progress-state* qr-options-item-selected) 1) + (set! (-> arg0 selected-option) #f) + (set! (-> arg0 option-index) 1) + ) + ) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) + (set! (-> *progress-state* qr-options-last-move) (the-as uint (-> self clock frame-counter))) + (set! (-> *progress-state* qr-options-item-picked) (the-as basic #t)) + (set! (-> arg0 selected-option) #t) + (sound-play "generic-beep") + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (if (!= (-> *progress-state* starting-state) 'title) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + ) + ((-> *progress-state* qr-options-item-picked) + (cond + ((and (cpad-pressed? 0 triangle) (zero? (-> *progress-state* qr-options-item-selected))) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (sound-play "generic-beep") + (set! (-> *progress-state* qr-options-item-picked) #f) + (set! (-> arg0 selected-option) #f) + (set! (-> *progress-state* yes-no-choice) #f) + ) + ((and (cpad-pressed? 0 triangle) (= (-> *progress-state* qr-options-item-selected) 1)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (sound-play "generic-beep") + (set! (-> *progress-state* qr-options-item-picked) #f) + (set! (-> arg0 selected-option) #f) + (set! (-> *progress-state* yes-no-choice) #f) + ) + ((and (zero? (-> *progress-state* qr-options-item-selected)) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (update-restart-quit obj arg0 #t) + ) + ((and (zero? (-> *progress-state* qr-options-item-selected)) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (update-restart-quit obj arg0 #t) + ) + ((and (= (-> *progress-state* qr-options-item-selected) 1) + (logtest? (pad-buttons left l-analog-left) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (update-restart-quit obj arg0 #t) + ) + ((and (= (-> *progress-state* qr-options-item-selected) 1) + (logtest? (pad-buttons right l-analog-right) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (update-restart-quit obj arg0 #t) + ) + ((cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (set! (-> *progress-state* qr-options-item-picked) #f) + (set! (-> arg0 selected-option) #f) + (set! (-> *progress-state* yes-no-choice) #f) + ) + ((logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) + (sound-play "generic-beep") + (when (zero? (-> *progress-state* qr-options-item-selected)) + (set! (-> arg0 selected-option) #t) + (set! (-> arg0 option-index) 0) + (update-restart-quit obj arg0 #t) + ) + (when (= (-> *progress-state* qr-options-item-selected) 1) + (set! (-> arg0 selected-option) #t) + (set! (-> arg0 option-index) 1) + (update-restart-quit obj arg0 #t) + ) + (set! (-> *progress-state* qr-options-item-picked) #f) + (set! (-> *progress-state* yes-no-choice) #f) + ) + ) + ) + ) + 0 + ) diff --git a/test/decompiler/reference/jak2/engine/ui/text_REF.gc b/test/decompiler/reference/jak2/engine/ui/text_REF.gc index 5dea363672..c80c5d6a38 100644 --- a/test/decompiler/reference/jak2/engine/ui/text_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/text_REF.gc @@ -93,15 +93,15 @@ ) ;; definition for function convert-korean-text -(defun convert-korean-text ((arg0 game-text)) - "Converts the provided [[game-text]] into korean. Returns a [[string]]" +(defun convert-korean-text ((arg0 string)) + "Converts the provided [[string]] of [[game-text]] into korean. Returns a [[string]]" (local-vars (v1-21 int)) - (let ((gp-0 (&-> arg0 text))) + (let ((gp-0 (-> arg0 data))) *expanded-text-line0* (let ((s4-0 0)) 0 (let ((s1-0 0) - (s5-0 ((method-of-type string length) (the-as string arg0))) + (s5-0 (length arg0)) ) (set! *expand-buf-number* (logxor *expand-buf-number* 1)) (let ((s3-0 (if (zero? *expand-buf-number*) @@ -114,33 +114,26 @@ (clear s3-0) (while (< s4-0 s5-0) (cond - ((= (-> (the-as (pointer uint8) (&+ gp-0 s4-0))) 3) + ((= (-> gp-0 s4-0) 3) (+! s4-0 1) - (while (and (< s4-0 s5-0) - (!= (-> (the-as (pointer uint8) (&+ gp-0 s4-0))) 3) - (!= (-> (the-as (pointer uint8) (&+ gp-0 s4-0))) 4) - ) - (set! (-> s3-0 data s1-0) (-> (the-as (pointer uint8) (&+ gp-0 s4-0)))) + (while (and (< s4-0 s5-0) (!= (-> gp-0 s4-0) 3) (!= (-> gp-0 s4-0) 4)) + (set! (-> s3-0 data s1-0) (-> gp-0 s4-0)) (+! s4-0 1) (+! s1-0 1) ) ) (else (let ((v1-17 (+ s4-0 1))) - (-> (the-as (pointer uint8) (&+ gp-0 v1-17))) + (-> gp-0 v1-17) (set! s4-0 (+ v1-17 1)) ) (set! (-> s3-0 data s1-0) (the-as uint 126)) (let ((v1-19 (+ s1-0 1))) (set! (-> s3-0 data v1-19) (the-as uint 89)) (let ((v1-20 (+ v1-19 1))) - (while (and (< s4-0 s5-0) - (< v1-20 s2-0) - (!= (-> (the-as (pointer uint8) (&+ gp-0 s4-0))) 3) - (!= (-> (the-as (pointer uint8) (&+ gp-0 s4-0))) 4) - ) + (while (and (< s4-0 s5-0) (< v1-20 s2-0) (!= (-> gp-0 s4-0) 3) (!= (-> gp-0 s4-0) 4)) (cond - ((= (-> (the-as (pointer uint8) (&+ gp-0 s4-0))) 5) + ((= (-> gp-0 s4-0) 5) (set! (-> s3-0 data v1-20) (the-as uint 1)) (+! s4-0 1) (set! v1-21 (+ v1-20 1)) @@ -150,7 +143,7 @@ (set! v1-21 (+ v1-20 1)) ) ) - (set! (-> s3-0 data v1-21) (-> (the-as (pointer uint8) (&+ gp-0 s4-0)))) + (set! (-> s3-0 data v1-21) (-> gp-0 s4-0)) (+! s4-0 1) (let ((v1-22 (+ v1-21 1))) (set! (-> s3-0 data v1-22) (the-as uint 126)) @@ -230,7 +223,7 @@ ) ) ((= (-> obj language-id) 6) - (convert-korean-text (the-as game-text (-> obj data v1-2 text))) + (convert-korean-text (-> obj data v1-2 text)) ) (else (-> obj data v1-2 text) @@ -257,7 +250,261 @@ (define text-is-loading #f) ;; definition for function load-game-text-info -;; ERROR: function was not converted to expressions. Cannot decompile. +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +;; ERROR: failed type prop at 3: Could not figure out load: (set! v1 (l.wu gp)) +;; WARN: Return type mismatch none vs int. +(defun load-game-text-info ((a0-0 string) (a1-0 symbol) (a2-0 kheap)) + "Load text, if needed. txt-name is the group name, curr-text is the _symbol_ for + the game-text-info, and heap is the heap to load to. The heap will be cleared." + (local-vars + (v0-0 none) + (v0-1 none) + (v0-2 none) + (v0-3 none) + (v0-4 none) + (v0-5 none) + (v0-6 none) + (v0-7 none) + (v0-8 none) + (v0-9 none) + (v0-10 none) + (v0-11 none) + (v0-12 none) + (v0-13 none) + (v1-0 game-text-info) + (v1-1 none) + (v1-2 none) + (v1-3 none) + (v1-4 none) + (v1-5 none) + (v1-6 none) + (v1-7 none) + (v1-9 none) + (v1-10 none) + (v1-11 none) + (v1-12 none) + (v1-13 none) + (v1-14 none) + (v1-16 none) + (v1-17 none) + (v1-18 none) + (v1-20 none) + (v1-21 none) + (v1-24 none) + (v1-25 none) + (v1-26 none) + (a0-1 none) + (a0-2 none) + (a0-3 none) + (a0-4 none) + (a0-5 none) + (a0-6 none) + (a0-7 none) + (a0-8 none) + (a0-10 none) + (a0-11 none) + (a0-12 none) + (a0-13 none) + (a0-14 none) + (a0-15 none) + (a0-17 none) + (a0-18 none) + (a0-19 none) + (a0-20 none) + (a0-21 none) + (a0-22 none) + (a1-2 none) + (a1-3 none) + (a1-4 none) + (a1-5 none) + (a1-6 none) + (a1-7 none) + (a1-8 none) + (a1-9 none) + (a2-1 none) + (a2-2 none) + (a2-3 none) + (a2-4 none) + (a2-5 none) + (a2-6 none) + (a3-1 none) + (a3-2 none) + (t0-0 none) + (s1-0 none) + (s2-0 none) + (s2-1 none) + (s3-0 none) + (s3-1 none) + (t9-0 none) + (t9-1 none) + (t9-2 none) + (t9-3 none) + (t9-4 none) + (t9-5 none) + (t9-6 none) + (t9-7 none) + (t9-8 none) + (t9-9 none) + (t9-10 none) + (t9-11 none) + (t9-12 none) + (sv-16 none) + (sv-24 none) + (sv-32 none) + (sv-40 none) + ) + (when (begin + (when (begin + (and (begin + (set! v1-0 (the-as game-text-info (l.wu a1-0))) + (set! sv-16 v1-0) + (set! v1-1 (the-as none *setting-control*)) + (set! v1-2 (the-as none (l.d (+ v1-1 28)))) + (set! sv-24 v1-2) + (set! sv-32 0) + (set! v1-3 (the-as none (-> a2-0 top))) + (set! a0-1 (the-as none (-> a2-0 base))) + (set! v1-4 (the-as none (- v1-3 a0-1))) + (set! sv-40 v1-4) + (set! t9-0 (the-as none scf-get-territory)) + (set! v0-0 (the-as none (call!))) + (set! v1-5 (the-as none (+ v0-0 -1))) + (set! a0-2 (the-as none (zero? v1-5))) + a0-2 + ) + (begin (set! v1-7 sv-24) (zero? v1-7)) + (begin (set! t9-1 (the-as none demo?)) (set! v0-1 (the-as none (call!))) (set! v1-6 (the-as none (not v0-1)))) + ) + v1-6 + ) + (set! v1-9 (the-as none 7)) + (set! sv-24 v1-9) + ) + (or (begin (set! v1-10 sv-16) (set! a0-3 (the-as none (= v1-10 #f))) a0-3) + (begin + (set! v1-12 sv-16) + (set! v1-13 (the-as none (l.w (+ v1-12 4)))) + (set! a0-4 sv-24) + (set! a0-5 (the-as none (!= v1-13 a0-4))) + a0-5 + ) + (begin + (set! t9-2 (the-as none string=)) + (set! v1-14 sv-16) + (set! a0-6 (the-as none (l.wu (+ v1-14 8)))) + (set! a1-1 (the-as none a0-0)) + (set! v0-2 (the-as none (call!))) + (set! v1-11 (the-as none (not v0-2))) + ) + ) + v1-11 + ) + (cond + ((begin + (set! v1-16 (the-as none a2-0)) + (set! a0-7 (the-as none (l.wu v1-16))) + (s.w! (+ v1-16 8) a0-7) + ((b! #t L50 (nop!)) (nop!)) + (label cfg-16) + (set! v0-3 (the-as none 0)) + ((b! #t L56 (nop!)) (nop!)) + (label cfg-17) + (set! s3-0 (the-as none str-load)) + (set! s2-0 (the-as none format)) + (set! t9-3 (the-as none clear)) + (set! a0-8 (the-as none *temp-string*)) + (call!) + (set! a0-9 (the-as none v0-4)) + (set! a1-2 (the-as none L100)) + (set! a2-1 sv-24) + (set! a3-0 (the-as none a0-0)) + (set! t9-4 (the-as none s2-0)) + (call!) + (set! a0-10 (the-as none *temp-string*)) + (set! a1-3 (the-as none -1)) + (set! v1-17 (the-as none -64)) + (set! a2-2 (the-as none (l.wu (+ a2-0 8)))) + (set! a2-3 (the-as none (+ a2-2 63))) + (set! a2-4 (the-as none (logand v1-17 a2-3))) + (set! v1-18 (the-as none (l.wu (+ a2-0 4)))) + (set! a3-1 (the-as none (l.wu (+ a2-0 8)))) + (set! a3-2 (the-as none (- v1-18 a3-1))) + (set! t9-5 (the-as none s3-0)) + (set! v0-6 (the-as none (call!))) + ((b! (not v0-6) L49 (nop!)) (nop!)) + (label cfg-19) + (set! t9-6 (the-as none str-load-status)) + (set! a0-11 (& sv-32)) + (set! v0-7 (the-as none (call!))) + (set! v1-20 (the-as none v0-7)) + (set! a0-12 (the-as none 'error)) + ((b! (!= v1-20 a0-12) L52 (set! a0-13 #f)) (empty-form)) + (set! t9-7 (the-as none format)) + (set! a0-14 (the-as none 0)) + (set! a1-4 (the-as none L99)) + (call!) + (set! v0-3 (the-as none 0)) + ((b! #t L56 (nop!)) (nop!)) + (set! v1-21 (the-as none 0)) + ((b! #t L54 (nop!)) (nop!)) + (label cfg-22) + (set! a0-15 sv-32) + (set! a1-5 sv-40) + (set! a1-6 (the-as none (+ a1-5 -300))) + (>=.si a0-15 a1-6) + ) + (return (begin + (set! t9-8 (the-as none format)) + (set! a0-17 (the-as none 0)) + (set! a1-7 (the-as none L98)) + (call!) + (set! v0-3 (the-as none 0)) + ) + ) + ) + ((begin (set! a0-18 (the-as none 'busy)) (= v1-20 a0-18)) + (begin (nop!) (nop!) (nop!) (nop!) (nop!) (nop!) (goto cfg-19)) + ) + ) + (if (begin + (label cfg-27) + (set! v1-24 (the-as none -64)) + (set! a0-19 (the-as none (l.wu (+ a2-0 8)))) + (set! a0-20 (the-as none (+ a0-19 63))) + (set! s2-1 (the-as none (logand v1-24 a0-20))) + (set! t9-9 (the-as none flush-cache)) + (set! a0-21 (the-as none 0)) + (call!) + (set! s3-1 (the-as none link)) + (set! s1-0 (the-as none format)) + (set! t9-10 (the-as none clear)) + (set! a0-22 (the-as none *temp-string*)) + (call!) + (set! a0-23 (the-as none v0-11)) + (set! a1-8 (the-as none L100)) + (set! a2-5 sv-24) + (set! t9-11 (the-as none s1-0)) + (set! a3-3 (the-as none a0-0)) + (call!) + (set! v1-25 (the-as none *temp-string*)) + (set! a1-9 (the-as none (+ v1-25 4))) + (set! a2-6 sv-32) + (set! t0-0 (the-as none 0)) + (set! t9-12 (the-as none s3-1)) + (set! a0-24 (the-as none s2-1)) + (set! a3-4 (the-as none a2-0)) + (set! v0-13 (the-as none (call!))) + (s.w! a1-0 v0-13) + (set! v1-26 (the-as none (l.wu a1-0))) + (<=0.si v1-26) + ) + (s.w! a1-0 #f) + ) + ) + (set! v0-3 (the-as none 0)) + (label cfg-30) + (ret-value v0-3) + ) ;; definition for function load-level-text-files ;; WARN: Return type mismatch int vs none. @@ -278,53 +525,41 @@ "Draws some lines" (when *cheat-mode* (let ((s5-0 (new 'static 'vector4w)) - (gp-0 (new 'static 'matrix)) + (gp-0 (new 'static 'vector4w-4)) ) (set-vector! (-> gp-0 vector 0) - (the-as float (the int (+ -256.0 (-> arg0 origin x)))) - (the-as float (the int (+ -208.0 (-> arg0 origin y)))) - 0.0 - (the-as float #x1) + (the int (+ -256.0 (-> arg0 origin x))) + (the int (+ -208.0 (-> arg0 origin y))) + 0 + 1 ) (set-vector! (-> gp-0 vector 1) - (the-as float (the int (+ -256.0 (-> arg0 width) (-> arg0 origin x)))) - (the-as float (the int (+ -208.0 (-> arg0 origin y)))) - 0.0 - (the-as float #x1) + (the int (+ -256.0 (-> arg0 width) (-> arg0 origin x))) + (the int (+ -208.0 (-> arg0 origin y))) + 0 + 1 ) (set-vector! (-> gp-0 vector 2) - (the-as float (the int (+ -256.0 (-> arg0 width) (-> arg0 origin x)))) - (the-as float (the int (+ -208.0 (-> arg0 height) (-> arg0 origin y)))) - 0.0 - (the-as float #x1) + (the int (+ -256.0 (-> arg0 width) (-> arg0 origin x))) + (the int (+ -208.0 (-> arg0 height) (-> arg0 origin y))) + 0 + 1 ) (set-vector! - (-> gp-0 trans) - (the-as float (the int (+ -256.0 (-> arg0 origin x)))) - (the-as float (the int (+ -208.0 (-> arg0 height) (-> arg0 origin y)))) - 0.0 - (the-as float #x1) + (-> gp-0 vector 3) + (the int (+ -256.0 (-> arg0 origin x))) + (the int (+ -208.0 (-> arg0 height) (-> arg0 origin y))) + 0 + 1 ) (set-vector! s5-0 128 128 128 128) - (add-debug-line2d - #t - (bucket-id debug-no-zbuf1) - (the-as vector (-> gp-0 vector)) - (-> gp-0 vector 1) - (the-as vector s5-0) - ) - (add-debug-line2d #t (bucket-id debug-no-zbuf1) (-> gp-0 vector 1) (-> gp-0 vector 2) (the-as vector s5-0)) - (add-debug-line2d #t (bucket-id debug-no-zbuf1) (-> gp-0 vector 2) (-> gp-0 trans) (the-as vector s5-0)) - (add-debug-line2d - #t - (bucket-id debug-no-zbuf1) - (-> gp-0 trans) - (the-as vector (-> gp-0 vector)) - (the-as vector s5-0) - ) + (add-debug-line2d #t (bucket-id debug-no-zbuf1) (the-as vector4w (-> gp-0 vector)) (-> gp-0 vector 1) s5-0) + (add-debug-line2d #t (bucket-id debug-no-zbuf1) (-> gp-0 vector 1) (-> gp-0 vector 2) s5-0) + (add-debug-line2d #t (bucket-id debug-no-zbuf1) (-> gp-0 vector 2) (-> gp-0 vector 3) s5-0) + (add-debug-line2d #t (bucket-id debug-no-zbuf1) (-> gp-0 vector 3) (the-as vector4w (-> gp-0 vector)) s5-0) ) ) 0 @@ -573,11 +808,11 @@ (draw-string *game-text-line* s2-1 arg1) (set! (-> arg1 color) (-> *font-work* last-color)) (let ((a3-2 (-> s2-1 base))) - (let ((v1-121 (-> s2-1 base))) - (set! (-> (the-as (pointer int64) v1-121)) #x20000000) - (s.w! (+ v1-121 8) 0) - (s.w! (+ v1-121 12) 0) - (set! (-> s2-1 base) (&+ v1-121 16)) + (let ((v1-121 (the-as object (-> s2-1 base)))) + (set! (-> (the-as dma-packet v1-121) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-121) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-121) vif1) (new 'static 'vif-tag)) + (set! (-> s2-1 base) (&+ (the-as pointer v1-121) 16)) ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) bucket-group) diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index 90b26401c1..46ee013721 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -27,6 +27,8 @@ "rand-vu-init", "rand-vu", "rand-vu-nostep", + // text - TODO - https://github.com/open-goal/jak-project/issues/1939 + "load-game-text-info", // MATRIX "matrix-axis-sin-cos-vu!", "matrix-axis-sin-cos!", @@ -63,10 +65,6 @@ "(method 17 trsqv)", // history - rgba issues "history-draw", - // text - cfg failure - "load-game-text-info", - // - never fixed this one in jak 1, assumed there was an original bug? - "print-game-text", // joint asm "cspace<-parented-transformq-joint!", "(method 11 art-joint-anim-manager)", @@ -91,22 +89,12 @@ "v-slrp2!", "v-slrp3!", // cam-master - // - focus understanding / decomp crashes - "reset-target-tracking", + // - incomplete bitfield? "(method 16 camera-master)", - "master-track-target", // cam-states - // - mostly decompiler crashes/hangs - "cam-bike-code", - "cam-stick-code", - "cam-string-code", - "cam-string-line-of-sight", - "cam-string-joystick", // whats butt-handle! - "cam-circular-code", - "cam-circular-position", - "cam-los-collide", // vector-dot with stack - // cam-update - "update-visible", // assertion crash when filling out bsp-header + // - vector-dot issue + "cam-los-collide", + // sparticle-launcher // - field loaded as signed and unsigned "sp-relaunch-particle-3d", @@ -173,10 +161,5 @@ ], "skip_compile_states": { - "cam-bike": [ - "code" // hang - ], - "cam-stick": ["code"], - "cam-circular": ["enter", "event"] } }