mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-19 19:53:56 +00:00
Disable SSE4.x (#561)
This is a quick fix for the issue presented in: #560
This commit is contained in:
@@ -492,8 +492,10 @@ namespace
|
||||
const auto& exe = *win_emu->mod_manager.executable;
|
||||
|
||||
win_emu->emu().hook_instruction(x86_hookable_instructions::cpuid, [&] {
|
||||
const auto rip = win_emu->emu().read_instruction_pointer();
|
||||
const auto leaf = win_emu->emu().reg<uint32_t>(x86_register::eax);
|
||||
auto& emu = win_emu->emu();
|
||||
|
||||
const auto rip = emu.read_instruction_pointer();
|
||||
const auto leaf = emu.reg<uint32_t>(x86_register::eax);
|
||||
const auto mod = get_module_if_interesting(win_emu->mod_manager, options.modules, rip);
|
||||
|
||||
if (mod.has_value() && (!concise_logging || context.cpuid_cache.insert({rip, leaf}).second))
|
||||
@@ -502,6 +504,17 @@ namespace
|
||||
(*mod) ? (*mod)->name.c_str() : "<N/A>");
|
||||
}
|
||||
|
||||
if (leaf == 1)
|
||||
{
|
||||
// NOTE: We hard-code these values to disable SSE4.x
|
||||
emu.reg<uint32_t>(x86_register::eax, 0x000906EA);
|
||||
emu.reg<uint32_t>(x86_register::ebx, 0x00100800);
|
||||
emu.reg<uint32_t>(x86_register::ecx, 0xFFE2F38F);
|
||||
emu.reg<uint32_t>(x86_register::edx, 0xBFEBFBFF);
|
||||
|
||||
return instruction_hook_continuation::skip_instruction;
|
||||
}
|
||||
|
||||
return instruction_hook_continuation::run_instruction;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user