some bug fixes (#2125)

This commit is contained in:
water111
2023-01-14 11:04:15 -05:00
committed by GitHub
parent a75f4c187b
commit d65a1c365a
9 changed files with 48 additions and 13 deletions
+3
View File
@@ -2279,5 +2279,8 @@
},
"(method 181 gator)": {
"vars": { "s4-0": ["s4-0", "art-joint-anim"] }
},
"(code target-running-attack)": {
"vars": {"t1-6": ["t1-6", "sound-name"]}
}
}
+16
View File
@@ -465,6 +465,22 @@ void render_game_frame(int game_width,
options.gpu_sync = g_gfx_data->debug_gui.should_gl_finish();
options.borderless_windows_hacks = windows_borderless_hack;
// hack for jak 2 resize
if (g_game_version == GameVersion::Jak2) {
float ratio = 0.75 * (float)window_fb_width / (float)window_fb_height;
if (ratio > 1) {
window_fb_width /= ratio;
} else {
window_fb_height *= ratio;
}
options.game_res_w = window_fb_width;
options.game_res_h = window_fb_height;
options.window_framebuffer_width = window_fb_width;
options.window_framebuffer_height = window_fb_height;
options.draw_region_width = window_fb_width;
options.draw_region_height = window_fb_height;
}
want_hotkey_screenshot =
want_hotkey_screenshot && g_gfx_data->debug_gui.screenshot_hotkey_enabled;
if (want_hotkey_screenshot) {
+1 -1
View File
@@ -999,7 +999,7 @@ struct ExecutionContext {
void vsqrt(int src, BC bc) { Q = std::sqrt(std::abs(vf_src(src).f[(int)bc])); }
void sqrts(int src, int dst) { fprs[dst] = std::sqrt(std::abs(fprs[src])); }
void sqrts(int dst, int src) { fprs[dst] = std::sqrt(std::abs(fprs[src])); }
void vmulq(DEST mask, int dst, int src) {
auto s0 = vf_src(src);
+2 -2
View File
@@ -2733,8 +2733,8 @@
)
)
(let ((t1-6 (if (using-gun? self)
(make-u128 (the-as uint #x7469682d772d68) (the-as uint #x636e75702d6e7567))
(make-u128 #x746968 (the-as uint #x2d772d68636e7570))
(static-sound-name "gun-punch-w-hit")
(static-sound-name "punch-w-hit")
)
)
)
+1 -1
View File
@@ -1320,7 +1320,7 @@
)
)
(defmacro with-profiler (name &rest body)
(defmacro with-pc-profiler (name &rest body)
"Execute the body in a named profiler block.
Do not `return` or `go` from inside this block,
otherwise the end will be skipped."
+9 -3
View File
@@ -1589,7 +1589,9 @@
;; (format 0 "Trans | Proc '~A' | C1: ~X C2: ~X C3: ~X~%" arg0 (-> *canary-1*) (-> *canary-2*) (-> *canary-3*))
(when (-> arg0 trans-hook)
(let ((s4-0 (new 'process 'cpu-thread arg0 'trans 256 (-> arg0 main-thread stack-top))))
(reset-and-call s4-0 (-> arg0 trans-hook))
(with-pc-profiler "trans"
(reset-and-call s4-0 (-> arg0 trans-hook))
)
(delete s4-0)
)
(when (= (-> arg0 status) 'dead) ;; handle deactivates in trans
@@ -1603,7 +1605,9 @@
;; (format 0 "Code | Proc '~A' | C1: ~X C2: ~X C3: ~X~%" arg0 (-> *canary-1*) (-> *canary-2*) (-> *canary-3*))
(if (logtest? (-> arg0 mask) (process-mask sleep-code))
(set! (-> arg0 status) 'suspended)
((-> arg0 main-thread resume-hook) (-> arg0 main-thread))
(with-pc-profiler "code"
((-> arg0 main-thread resume-hook) (-> arg0 main-thread))
)
)
;; (format 0 "Finished Code | Proc '~A' | C1: ~X C2: ~X C3: ~X~%" arg0 (-> *canary-1*) (-> *canary-2*) (-> *canary-3*))
@@ -1620,7 +1624,9 @@
;; (format 0 "Post | Proc '~A' | C1: ~X C2: ~X C3: ~X~%" arg0 (-> *canary-1*) (-> *canary-2*) (-> *canary-3*))
(when (-> arg0 post-hook)
(let ((s4-1 (new 'process 'cpu-thread arg0 'post 256 *kernel-dram-stack*)))
(reset-and-call s4-1 (-> arg0 post-hook))
(with-pc-profiler "post"
(reset-and-call s4-1 (-> arg0 post-hook))
)
(delete s4-1)
)
(when (= (-> arg0 status) 'dead) ;; handle death in post
+5 -1
View File
@@ -240,7 +240,11 @@ void IR_LoadSymbolPointer::do_codegen(emitter::ObjectGenerator* gen,
auto dest_reg = get_reg(m_dest, allocs, irec);
if (m_name == "#f") {
static_assert(false_symbol_offset() == 0, "false symbol location");
gen->add_instr(IGen::mov_gpr64_gpr64(dest_reg, gRegInfo.get_st_reg()), irec);
if (dest_reg.is_xmm()) {
gen->add_instr(IGen::movq_xmm64_gpr64(dest_reg, gRegInfo.get_st_reg()), irec);
} else {
gen->add_instr(IGen::mov_gpr64_gpr64(dest_reg, gRegInfo.get_st_reg()), irec);
}
} else if (m_name == "#t") {
gen->add_instr(IGen::lea_reg_plus_off8(dest_reg, gRegInfo.get_st_reg(),
true_symbol_offset(gen->version())),
+8 -2
View File
@@ -213,7 +213,7 @@ Val* Compiler::compile_cond(const goos::Object& form, const goos::Object& rest,
// optimization - if we get junk, don't bother moving it, just leave junk in return.
if (!is_none(case_result)) {
// todo, what does GOAL do here? does it matter?
env->emit(o, std::make_unique<IR_RegSet>(result, case_result->to_gpr(o, env)));
env->emit(o, std::make_unique<IR_RegSet>(result, case_result->to_reg(o, env)));
}
} else {
@@ -238,7 +238,7 @@ Val* Compiler::compile_cond(const goos::Object& form, const goos::Object& rest,
case_result_types.push_back(case_result->type());
if (!is_none(case_result)) {
// todo, what does GOAL do here?
env->emit(o, std::make_unique<IR_RegSet>(result, case_result->to_gpr(o, env)));
env->emit(o, std::make_unique<IR_RegSet>(result, case_result->to_reg(o, env)));
}
// GO TO END
@@ -262,6 +262,12 @@ Val* Compiler::compile_cond(const goos::Object& form, const goos::Object& rest,
result->set_type(coerce_to_reg_type(m_ts.lowest_common_ancestor(case_result_types)));
}
// maybe use 128-bit register
if (result->type().base_type() != "none" &&
m_ts.lookup_type_allow_partial_def(result->type())->get_load_size() == 16) {
result->change_class(RegClass::INT_128);
}
// PATCH END
end_label->idx = fenv->code().size();
+3 -3
View File
@@ -2759,8 +2759,8 @@
)
)
(let ((t1-6 (if (using-gun? self)
(make-u128 (the-as uint #x7469682d772d68) (the-as uint #x636e75702d6e7567))
(make-u128 #x746968 (the-as uint #x2d772d68636e7570))
(the-as sound-name (static-sound-name "gun-punch-w-hit"))
(the-as sound-name (static-sound-name "punch-w-hit"))
)
)
)
@@ -2770,7 +2770,7 @@
-1.0
(-> self control impact-ctrl joint)
(the-as basic #f)
(the-as sound-name t1-6)
t1-6
)
)
(activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock))