diff --git a/recompiler/tests/test_overlay_shim_compile.py b/recompiler/tests/test_overlay_shim_compile.py index 1ef5debe..e6ee95be 100644 --- a/recompiler/tests/test_overlay_shim_compile.py +++ b/recompiler/tests/test_overlay_shim_compile.py @@ -36,6 +36,7 @@ void func_80010000(CPUState *cpu) { psx_advance_cycles(1u); cpu->gpr[2] = psx_cyc_load_word(cpu, cpu->gpr[4], 2u, 0u); cpu->gpr[3] = psx_cyc_load_half(cpu, cpu->gpr[5], 3u, 0u); + cpu->gpr[6] = psx_ws_cull_slti_lower(cpu->gpr[7], 0xff00u); psx_cyc_bb_defer_flush(); psx_cyc_bb_defer_end(); if (psx_slice_block(cpu, 0x80010000u, 1u, 0)) return; @@ -55,6 +56,7 @@ void func_80010000(CPUState *cpu) { "-DPSX_NO_DEBUG_TOOLS", "-DPSX_ENABLE_BLOCK_CYCLES=1", "-DPSX_OVERLAY_FLAVOR=0", + "-Werror=implicit-function-declaration", ] if os.name != "nt": command.append("-fPIC") diff --git a/runtime/include/overlay_dispatch_preamble.c.inc b/runtime/include/overlay_dispatch_preamble.c.inc index c2acb8e7..ac0e9fc5 100644 --- a/runtime/include/overlay_dispatch_preamble.c.inc +++ b/runtime/include/overlay_dispatch_preamble.c.inc @@ -202,6 +202,10 @@ int psx_ws_cull_sltiu(uint32_t sx, uint32_t imm) { int psx_ws_cull_slti(uint32_t sx, uint32_t imm) { return ((int32_t)sx < (int32_t)imm + psx_ws_x_margin()) ? 1 : 0; } +int psx_ws_cull_slti_lower(uint32_t sx, uint32_t imm) { + int32_t bound = (int32_t)(int16_t)(uint16_t)imm; + return ((int32_t)sx < bound - psx_ws_x_margin()) ? 1 : 0; +} int psx_ws_cull_bltz(uint32_t v) { return ((int32_t)v < -psx_ws_x_margin()) ? 1 : 0; }