Skip to content

emu.register_periodic blocked on Windows when in MAME debugger #14600

@taylorza

Description

@taylorza

MAME version

0.283 (LLP64)

System information

Windows 11 Pro 10.0.26200
64 GB RAM
BGFX
English

INI configuration details

Emulated system/software

No response

Incorrect behaviour

Callback functions registered in LUA scripts/plugins using emu.register_periodic are not triggered regularly while MAME is stopped in the MAME Debugger. The callback is triggered on windows inputs such as mouse movement. On Linux the callbacks are invoked regularly regardless of the debugger state.

Expected behaviour

Periodic events should be triggered regardless of the MAME debugger state.

Steps to reproduce

On Windows:

  1. Create a simple LUA script to register a periodic function that logs to the console to demonstrate the issue
  2. Launch MAME with the script using the -script and -debug option
  3. Notice that the LUA script is logging to the console fairly rapidly
  4. Break into the debugger
  5. Notice that the logging either slows down or stops depending one where the mouse is. Regardless of the mouse location, moving the mouse will kickstart the messages being logged but stop/slowdown as soon as you stop moving the mouse.
  6. Resume from the debugger and the messages start to flow again

The issue is in debugwin.cpp GetMessage is blocking waiting for a windows message to arrive, this blocks the loop that generates calls emulator_info::periodic_check();

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions