Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 5552

8-bit acorn emulators • Re: B-Em

$
0
0
No idea whether anyone cares about the SDL3 port, but Allegro is a disaster on my M4, so I have no choice but to replace it.
I have been too busy to contribute to it, but I am interested in hearing about it.
SDL3's Linux Vulkan performance turned out to be terrible, as in "25% of Beeb speed" terrible. Interrupting it with a debugger revealed that it was performing a surface-to-surface copy every frame in software on the CPU. SDL3's OpenGL-derived renderers are able to deal with streaming textures in Allegro's ARGB format, but it appears the Vulkan renderer won't work with these; SDL was silently having to convert from ARGB to RGBA every frame before it could update the display's streaming texture.
Even under Allegro, the officially correct thing to do is to let Allegro choose the pixel format and use functions to access the bitmaps. That may be workable when using functions that draw larger objects but, when working at individual pixel level, which is hard not to do when emulating the BBC B's video subsystem, the performance was terrible. The solution was use macros and assume the pixel format.
The "gpu" and "metal" back-ends work, but macOS is blocking in SDL_RenderPresent() to the screen's refresh rate. It seems to do this even with vsync disabled. I don't know what's going on. The "opengl" driver does not do this.
I assume this is why, in the Allegro documentation, it mentions that you can ask for a buffer flip to wait, or not wait, for vsync but there is no guarantee that request will be honoured.

At normal speed, with a recurring event timer and an event queue, it should work even so because, if the buffer flip does wait for vsync, and the timer expires in the meantime, the event will be queued so the main event loop will see the new event as soon as it has finished processing the previous one. That won't work correctly if the timer is done by setting a one-shot timer after processing the previous timer event.

It will get more complicated when trying to go faster than 100% as that implies skipping some display flips. This was something the auto-frameskip was supposed to take care of.

Statistics: Posted by Coeus — Thu Feb 05, 2026 2:53 pm



Viewing all articles
Browse latest Browse all 5552

Trending Articles