I have converted the game to use SDL3. Claude did the tedious part (you can see it in the commits). I double checked, tested and profiled everything. I played the game a couple of times to ensure it works fine. Some digi audio over-allocations and stray SDL_Pause causing random pops issues have been fixed as well. You can see the branch here. It is an extension of the MT-32 support branch.
https://github.com/dstarosta/SDLPoP/tree/SDL3
I had a lot of problems with SDL_Image v3. IMG_Load_IO and related methods performed really slow. The extra 200ms per chtab would sometimes skip the cutscenes because there is a timer that checks for a key press with a similar time value. It was an internal issue with streams, probing formats etc. I even had Claude to find the cause since I was not able too. Here is what he found.
"The most interesting finding: SDL2_image already had an IMG_stb.c with stb_image as an optional PNG/JPEG backend.
SDL_IOStream (SDL3 uses libpng) vs SDL_RWops (SDL2 currently uses stb_image). IOStream is a heavier abstraction — each of those 9 format-probe read+seek cycles goes through it. The other likely factor is libpng itself - it allocates and initializes png_structp/png_infop and sets up a zlib inflate state per image. With SDL2's simpler RWops struct those calls were cheaper. Multiply that by hundreds of sprites at startup and the overhead accumulates."
The additional benefit is you now only need 1 SDL3 DLL (no SDL_Image). In older Linux distros you only have to build one library from scratch.
So I switched to "stb_image" and "stb_image_write" for screenshots. The PNGs now load faster than they used to with SDL2. The only tricky thing was the intro text background grid that can be blue or red. The unset color was matching the transparency key. It works fine now with some additional logic for PNGs with multiple index color entries that match - the common code always picks the first matching index.
The other thing I had to change is to turn on vsync around the flash background changes (not for the whole frame, legacy timers would still work). SDL3 was causing flash background tearing without it even if you use SDL_compat.
I have converted the game to use SDL3. Claude did the tedious part (you can see it in the commits). I double checked, tested and profiled everything. I played the game a couple of times to ensure it works fine. Some digi audio over-allocations and stray SDL_Pause causing random pops issues have been fixed as well. You can see the branch here. It is an extension of the MT-32 support branch.
https://github.com/dstarosta/SDLPoP/tree/SDL3
I had a lot of problems with SDL_Image v3. IMG_Load_IO and related methods performed really slow. The extra 200ms per chtab would sometimes skip the cutscenes because there is a timer that checks for a key press with a similar time value. It was an internal issue with streams, probing formats etc. I even had Claude to find the cause since I was not able too. Here is what he found.
"The most interesting finding: SDL2_image already had an IMG_stb.c with stb_image as an optional PNG/JPEG backend.
SDL_IOStream (SDL3 uses libpng) vs SDL_RWops (SDL2 currently uses stb_image). IOStream is a heavier abstraction — each of those 9 format-probe read+seek cycles goes through it. The other likely factor is libpng itself - it allocates and initializes png_structp/png_infop and sets up a zlib inflate state per image. With SDL2's simpler RWops struct those calls were cheaper. Multiply that by hundreds of sprites at startup and the overhead accumulates."
The additional benefit is you now only need 1 SDL3 DLL (no SDL_Image). In older Linux distros you only have to build one library from scratch.
So I switched to "stb_image" and "stb_image_write" for screenshots. The PNGs now load faster than they used to with SDL2. The only tricky thing was the intro text background grid that can be blue or red. The unset color was matching the transparency key. It works fine now with some additional logic for PNGs with multiple index color entries that match - the common code always picks the first matching index.
The other thing I had to change is to turn on vsync around the flash background changes (not for the whole frame, legacy timers would still work). SDL3 was causing flash background tearing without it even if you use SDL_compat.