Skip to content

Commit fa0ac62

Browse files
authored
Merge pull request #126 from dallmeyer/main
vanilla merge 11/4
2 parents a6b98cd + 9f410d7 commit fa0ac62

File tree

24 files changed

+92
-28
lines changed

24 files changed

+92
-28
lines changed

.github/workflows/linux-build-clang.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ jobs:
5353
fetch-depth: 0
5454
fetch-tags: true
5555

56+
# full checkout with tags if we ARE uploading artifacts
57+
- name: Checkout Repository with Tags
58+
if: ${{ inputs.uploadArtifacts }}
59+
uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0
62+
fetch-tags: true
63+
5664
- name: Install Package Dependencies
5765
run: |
5866
sudo apt update

.github/workflows/macos-build.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ jobs:
5353
fetch-depth: 0
5454
fetch-tags: true
5555

56+
# full checkout with tags if we ARE uploading artifacts
57+
- name: Checkout Repository with Tags
58+
if: ${{ inputs.uploadArtifacts }}
59+
uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0
62+
fetch-tags: true
63+
5664
- name: Install Package Dependencies
5765
run: brew install cmake nasm ninja
5866

.github/workflows/windows-build-clang.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ jobs:
5454
fetch-depth: 0
5555
fetch-tags: true
5656

57+
# full checkout with tags if we ARE uploading artifacts
58+
- name: Checkout Repository with Tags
59+
if: ${{ inputs.uploadArtifacts }}
60+
uses: actions/checkout@v4
61+
with:
62+
fetch-depth: 0
63+
fetch-tags: true
64+
5765
- name: Install NASM
5866
# TODO - Simplify this with just the first command once choco 2.0 rolls out everywhere
5967
run: |

common/formatter/rules/rule_config.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,39 @@ static FormFormattingConfig new_deftype_rule(
168168
return cfg;
169169
}
170170

171+
static FormFormattingConfig new_defproc_rule(
172+
int start_index,
173+
int num_columns_to_compute_widths,
174+
const std::vector<int>& inlining_preventation_indices) {
175+
FormFormattingConfig cfg;
176+
cfg.has_constant_pairs = true;
177+
cfg.config_set = true;
178+
cfg.hang_forms = false;
179+
cfg.inline_until_index = [start_index](std::vector<std::string> curr_lines) {
180+
// if (curr_lines.size() >= 4 && curr_lines.at(3) == "()") {
181+
// return 4;
182+
// }
183+
return start_index;
184+
};
185+
for (const auto& index : inlining_preventation_indices) {
186+
auto temp_config = std::make_shared<FormFormattingConfig>();
187+
temp_config->config_set = true;
188+
temp_config->prevent_inlining = true;
189+
temp_config->hang_forms = false;
190+
temp_config->indentation_width = 1;
191+
auto temp_list_config = std::make_shared<FormFormattingConfig>();
192+
temp_list_config->force_inline = false;
193+
temp_list_config->hang_forms = false;
194+
temp_config->default_index_config = temp_list_config;
195+
if (index == 3) {
196+
temp_config->determine_column_widths_for_list_elements = true;
197+
temp_config->num_columns_to_compute_widths = num_columns_to_compute_widths;
198+
}
199+
cfg.index_configs.emplace(index, temp_config);
200+
}
201+
return cfg;
202+
}
203+
171204
static FormFormattingConfig new_binding_rule(int form_head_width) {
172205
FormFormattingConfig cfg;
173206
cfg.config_set = true;
@@ -253,6 +286,9 @@ const std::unordered_map<std::string, FormFormattingConfig> opengoal_form_config
253286
{"defmethod", new_defmethod_rule(3)},
254287
{"lambda", new_lambda_rule(2)},
255288
{"deftype", new_deftype_rule(3, 1, {3, 4, 5, 6})},
289+
{"defproc", new_defproc_rule(3, 1, {3, 4, 5, 6})},
290+
{"suspend-for", new_flow_rule(2)},
291+
{"spawn-proc", new_flow_rule(2)},
256292
{"defun", new_flow_rule(3)},
257293
{"defun-recursive", new_flow_rule(4)},
258294
{"defun-debug-recursive", new_flow_rule(4)},
@@ -281,12 +317,14 @@ const std::unordered_map<std::string, FormFormattingConfig> opengoal_form_config
281317
{"protect", new_binding_rule(4)},
282318
{"let*", new_binding_rule(5)},
283319
{"rlet", new_binding_rule(5)},
320+
{"mlet", new_binding_rule(5)},
284321
{"when", new_flow_rule(2)},
285322
{"unless", new_flow_rule(2)},
286323
{"with-profiler", new_flow_rule(2)},
287324
{"with-pc", new_flow_rule(0)},
288325
{"#unless", new_flow_rule(2)},
289326
{"#when", new_flow_rule(2)},
327+
{"#when-game", new_flow_rule(2)},
290328
{"countdown", new_flow_rule(2)},
291329
{"until", new_flow_rule(2)},
292330
{"loop", new_flow_rule(0)},

common/util/gltf_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ void setup_alpha_from_material(const tinygltf::Material& material, DrawMode* mod
577577

578578
void setup_draw_mode_from_sampler(const tinygltf::Sampler& sampler, DrawMode* mode) {
579579
if (sampler.magFilter == TINYGLTF_TEXTURE_FILTER_NEAREST) {
580-
ASSERT(sampler.minFilter == TINYGLTF_TEXTURE_FILTER_NEAREST);
580+
ASSERT(sampler.minFilter == TINYGLTF_TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST);
581581
mode->set_filt_enable(false);
582582
} else {
583583
ASSERT(sampler.minFilter != TINYGLTF_TEXTURE_FILTER_NEAREST);

decompiler/config/jak3/ntsc_v1/inputs.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
"DGO/PRECA.DGO",
187187
"DGO/PRECB.DGO",
188188
"DGO/PRECC.DGO",
189-
// "DGO/PRECD.DGO",
189+
"DGO/PRECD.DGO",
190190
// title/intro
191191
"DGO/WIN.DGO", // wasintro
192192
"DGO/TITLE.DGO",

decompiler/level_extractor/BspHeader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,8 @@ void PrototypeBucketTie::read_from_file(TypedRef ref,
10171017
for (int i = 0; i < 4; i++) {
10181018
u32 start = index_start[i];
10191019
u32 end = start + frag_count[i];
1020-
ASSERT(num_color_qwcs <= end);
1020+
// precd tie has a bug where geo 3's
1021+
// ASSERT(num_color_qwcs <= end);
10211022
num_color_qwcs = std::max(end, num_color_qwcs);
10221023
}
10231024

decompiler/level_extractor/extract_tie.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,6 +2753,10 @@ void extract_tie(const level_tools::DrawableTreeInstanceTie* tree,
27532753
bool dump_level,
27542754
GameVersion version) {
27552755
for (int geo = 0; geo < GEOM_MAX; ++geo) {
2756+
// as far as I can tell, this one has bad colors
2757+
if (debug_name == "PRECD.DGO-2-tie" && geo == 3) {
2758+
continue;
2759+
}
27562760
tfrag3::TieTree this_tree;
27572761

27582762
// sanity check the vis tree (not a perfect check, but this is used in game and should be right)

game/kernel/common/kmachine.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,15 @@ void pc_register_screen_shot_settings(u32 ptr) {
11071107
register_screen_shot_settings(Ptr<ScreenShotSettings>(ptr).c());
11081108
}
11091109

1110+
void pc_encode_utf8_string(u32 src_str_ptr, u32 str_dest_ptr) {
1111+
auto str = std::string(Ptr<String>(src_str_ptr).c()->data());
1112+
std::string version = version_to_game_name(g_game_version);
1113+
const std::string font_bank_name = version == "jak1" ? "jak1-v2" : version;
1114+
std::string converted =
1115+
get_font_bank(get_text_version_from_name(font_bank_name))->convert_utf8_to_game(str);
1116+
strcpy(Ptr<String>(str_dest_ptr).c()->data(), converted.c_str());
1117+
}
1118+
11101119
/// Initializes all functions that are common across all game versions
11111120
/// These functions have the same implementation and do not use any game specific functions (other
11121121
/// than the one to create a function in the first place)
@@ -1225,6 +1234,9 @@ void init_common_pc_port_functions(
12251234
// RNG
12261235
make_func_symbol_func("pc-rand", (void*)pc_rand);
12271236

1237+
// text
1238+
make_func_symbol_func("pc-encode-utf8-string", (void*)pc_encode_utf8_string);
1239+
12281240
// debugging tools
12291241
make_func_symbol_func("pc-filter-debug-string?", (void*)pc_filter_debug_string);
12301242
make_func_symbol_func("pc-screen-shot", (void*)pc_screen_shot);

game/kernel/jak2/kmachine.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,6 @@ void InitMachine_PCPort() {
541541
make_function_symbol_from_c("__pc-get-tex-remap", (void*)lookup_jak2_texture_dest_offset);
542542
make_function_symbol_from_c("pc-init-autosplitter-struct",
543543
(void*)kmachine_extras::init_autosplit_struct);
544-
make_function_symbol_from_c("pc-encode-utf8-string", (void*)kmachine_extras::encode_utf8_string);
545544

546545
// discord rich presence
547546
make_function_symbol_from_c("pc-discord-rpc-update", (void*)kmachine_extras::update_discord_rpc);

0 commit comments

Comments
 (0)