mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-18 11:13:57 +00:00
Optimize thread scheduling and pausing
This commit is contained in:
@@ -101,11 +101,6 @@ namespace
|
||||
{
|
||||
c.win_emu->log.print(color::dark_gray, "Performing thread switch: %X -> %X\n", current_thread.id,
|
||||
new_thread.id);
|
||||
|
||||
#ifdef OS_EMSCRIPTEN
|
||||
debugger::event_context ec{.win_emu = *c.win_emu};
|
||||
debugger::handle_events(ec);
|
||||
#endif
|
||||
}
|
||||
|
||||
void handle_module_load(const analysis_context& c, const mapped_module& mod)
|
||||
@@ -122,6 +117,14 @@ namespace
|
||||
{
|
||||
auto& win_emu = *c.win_emu;
|
||||
|
||||
#ifdef OS_EMSCRIPTEN
|
||||
if ((win_emu.get_executed_instructions() % 0x20000 == 0)
|
||||
{
|
||||
debugger::event_context ec{.win_emu = win_emu};
|
||||
debugger::handle_events(ec);
|
||||
}
|
||||
#endif
|
||||
|
||||
const auto is_main_exe = win_emu.mod_manager.executable->is_within(address);
|
||||
const auto is_previous_main_exe = win_emu.mod_manager.executable->is_within(c.win_emu->process.previous_ip);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user