Replies: 4 comments 5 replies
-
|
Changing the event model is going to require some fairly major changes, particularly to the video manager, as it’s currently where the event loop effectively happens. MAME needs input updates and UI events to only appear when it expects them to, and when that is exactly depends on the The video manager will need to be changed so instead of sleeping, it returns with an indication of how soon it needs you to call it back. This is all stuff that would need to be changed to allow support for features like rollback netplay, anyway. The current architecture is a mess. I don’t think trying to make a wrapper to support the current Windows OSD as-is is a good idea. The current way it handles events looks like something out of an ’80s Mac application. There’s a bunch of weirdness caused by the debugger and OSD both polling for events when you’ve broken into the debugger (this prevents implementing debugger keyboard shortcuts in a sane way, for example). It eventually needs to be dragged into the 21st century. The trouble is, changing any of this stuff is a minefield, and always turns into a far bigger job than you expected. |
Beta Was this translation helpful? Give feedback.
-
|
Further to this, if we’re going to SDL3 as the primary SDL target, what does that do for Linux distro support? What’s the oldest Ubuntu, Fedora, etc. with SDL3 included (and a usable version, not a horribly buggy version like early SDL2)? It also means I’ll have to rebuild my environment for testing Windows release candidates and building releases to a much newer MinGW for SDL3 support. That means things potentially breaking, although we’re a lot better with catching breaking changes in compilers and runtimes than we used to be. And if I’m updating the build environment anyway, is it time for a radical change? Do we switch to clang for x86-64 releases, like we’re using for AArch64? Do we switch from the ageing MSVCRT to ucrt, dropping support for everything before Windows 10? I mean, Windows 10 is already out of support anyway. |
Beta Was this translation helpful? Give feedback.
-
|
The current SDL3 release is 3.2.28. For major Linux distros:
On Windows with MSYS2 ClangARM64 I was able to just drop the SDL3 and SDL3_ttf packages into an existing working setup and it was fine. I don't think any compiler updates are strictly necessary, although if we want to bump everything I'm not opposed. As far as MSVCRT vs. ucrt I would gate that on how close Moogly is to being able to check in -video d3d11. If we're going to require Windows 10, I'd like to demote -video d3d9 so MAME by default will run on a clean Win10 or 11 install without the now-ancient DX9 runtime. |
Beta Was this translation helpful? Give feedback.
-
|
What about making SDL3 optional (OSD=sdl3) until the distro landscape improves? On macOS it could be the default since it's equally easy to compile both ways there and that would get us CI coverage until Ubuntu catches up (new LTS in April will definitely support it). Maybe we also drop Windows support for SDL builds. You and I are likely the only people who've built Windows with OSD=sdl in recent memory. The benefits of that configuration that once existed are long gone with the improved Windows native OSD modules since then. If it wouldn't be such a mess with GENie I'd advocate for Windows going full native with the official Python for Windows distribution and MSVC Community Edition as the compiler. That would be drastically easier to set up and maintain. But I think that's basically hard gated on CMake. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've recently started working on updating MAME from SDL2 to SDL3. The first pass will be a direct port, but SDL3 optionally supports a "split main loop" concept that fits how macOS/iOS, Emscripten, and Wayland all prefer to operate and that will be a second pass.
When this is enabled, SDL takes over
main()/WinMain()and calls 4 callbacks defined by us over the lifetime of the program.SDL_AppInit()is called first withargcandargv. This is expected to set everything up and return. If it returns failure, the program ends.SDL_AppIterate()(another callback we define) is called repeatedly for the lifetime of the program (basically per-frame). It returns a "keep running or quit" flag.SDL_AppEvent()(a third callback) is called when SDL events occur; you do not need to callSDL_PollEvent()or whatever.SDL_AppQuit()is called when SDL is shutting down.SDL_AppInit()returns a pointer which is then passed to the other 3 callbacks (for instance athisso you can trampoline up into C++).I'm opening this to hash out how best to modify MAME for this. My initial thoughts are:
emulator_info::start_frontend()will need to create thefrontendobject in a way that doesn't de-scope it, and thefrontendobject will be the magic pointer returned fromSDL_AppInit().mame_machine_manager::execute()andrunning_machine::run()will need to be split into separate startup and per-frame calls.emulator_info::that takes thefrontendobject pointer and does the right thing forSDL_AppIterate().Beta Was this translation helpful? Give feedback.
All reactions