Could you please share some details about this bug?I'd be interested in fixing the bug in the floppy controller emulation and giving it a try.
VCF SoCal | Feb 15 - 16 2025, | Hotel Fera, Orange CA |
VCF East | Apr 04 - 06 2025, | Infoage Museum, Wall NJ |
VCF Southwest | Jun 20 - 22 2025, | University of Texas at Dallas |
VCF Southeast | Jun 20 - 22 2025, | Atlanta, GA |
VCF West | Aug 2025, | CHM, Mountain View, CA |
VCF Midwest | Sep 13 - 14 2025, | Schaumburg, IL |
Could you please share some details about this bug?I'd be interested in fixing the bug in the floppy controller emulation and giving it a try.
Could you please share some details about this bug?
Thanks for checking!I checked and your copy has the fix that Tim Mann added to xtrs.
"Only" the native GUI removed as it is dysfunctional on current versions of macOS. BartH ported my modified version of SDLTRS to the "Xcode" IDE.I hadn't checked your source before as you took out the macOS support. If BartH's update was based on your source then it would be in there.
However when I go to run the compiled binary from the command line (i.e. using "./sdltrs") it just returns the error: "sdltrs fatal error: failed to initialize SDL: The video driver did not add any displays". Any ideas what I'm doing wrong?
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO | SDL_INIT_TIMER) != 0)
if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
Wow, didn't expect it to work ... But all the better: will change it like this ...This works now
That was expectable ... Please change line # 1350 in "trs_sdl_interface.c" to:The "-fullscreen" option seems to have problems at the moment on the Mac.
SDL_SetWindowFullscreen(window, fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
Wow, didn't expect it to work ... But all the better: will change it like this ...
That was expectable ... Please change line # 1350 in "trs_sdl_interface.c" to:
Thanks, that behaves better now on a Mac because it sets up a new screen. I.e. it allows switching to other screens and apps without needing to quit sdltrs.
Thanks, would be a shame if SDLTRS just "bit-rot" like this ... so I'll give it a try ...It's great having a cross-platform open source emulator that's being maintained.
Don't worry, better on the "wrong track" than no report at all ... I leave it in ...... and that now works fine too. So it wasn't anything to do with that ... Sorry about that.
Please checkout the SDL2 branch: https://gitlab.com/jengun/sdltrs/-/tree/sdl2Actually, an unfortunate side-effect of using SDL_WINDOW_FULLSCREEN_DESKTOP (rather than SDL_WINDOW_FULLSCREEN) is that in full screen mode the emulation now appears smaller (same size as the windowed version). However "-scale" can be used to make it bigger.
SDL_WINDOW_HIDDEN|SDL_WINDOW_RESIZABLE);
Please checkout the SDL2 branch: https://gitlab.com/jengun/sdltrs/-/tree/sdl2
lets you resize the window with the mouse ... at the moment these settings are not saved and some options reset the change ... that's why it still needs some work ...
I should always check for failed functions ...SDL_GetWindowSurface() call was returning NULL and therefore "screen" was set to NULL which caused the segfault
In my understanding, SDL should give priority to hardware acceleration and fallback to software rendering, but "SDL_GetWindowSurface" seems to be the problem: it should not be used with the rendering API. Because of my laziness, all TRS-80 characters are still "software surfaces" (not "textures") that are displayed on the "screen surface", which is then transferred to the renderer as texture ("SDL_UpdateTexture"). Seems to work (mostly), but mixes the old API for "software surfaces" with new one for "textures" ... therefore a revision is needed ...SDL_CreateRenderer() by replacing the flag 0 (which apparently defaults to SDL_RENDERER_ACCELERATED) with SDL_RENDERER_SOFTWARE, this fixed the problem. I don't currently know enough about SDL renderers to know whether this is a good solution or not.
That is the reason why the "SDL_WINDOW_RESIZABLE" is not set by default ...I like where this is heading, although the pixels can look odd at some sizes.
Please try this patch:although the pixels can look odd at some sizes.
diff --git a/src/trs_sdl_interface.c b/src/trs_sdl_interface.c
index f911323..79ea7ae 100644
--- a/src/trs_sdl_interface.c
+++ b/src/trs_sdl_interface.c
@@ -1331,6 +1331,7 @@ void trs_screen_init(void)
trs_sdl_cleanup();
fatal("failed to create renderer: %s", SDL_GetError());
}
+ SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
}
if (texture)
Please checkout the latest commit 5d9582e on the SDL2 branch: hopefully this will activate the hardware rendering on macOS ...I'm still using SDL_RENDERER_SOFTWARE, so I don't know if that affects it or not.
Maybe adding SDL_WINDOW_ALLOW_HIGHDPI to the SDL_CreateWindow flags will help ... can you send a screenshot?however when I release the mouse button that's when the pixels end up looking odd.
You're welcome, testing and reporting is highly appreciated!I tested sdl2 branch commit 5d9582e and that works unmodified on macOS. Thanks!
Added these changes also to latest SDL2 branch. No need for "SDL_WINDOW_FULLSCREEN_DESKTOP"?I added the "SDL_WINDOW_RESIZABLE" and "SDL_HINT_RENDER_SCALE_QUALITY" patches to that commit.
Doesn't "Alt-Enter" toggle full screen mode on macOS?As a bonus, the macOS green circle window button allows it to go into full screen mode (without specifying the sdl2trs "-fullscreen" option)
This also happens on some Linux systems with the software renderer. SDL_WINDOW_FULLSCREEN changes the graphic resolution, SDL_WINDOW_FULLSCREEN_DESKTOP just "expands" the window to fill the entire screen. The master branch sticks to the software renderer to ensure backwards compatibility with SDL 1.2 for ancient platforms ...(b) branch master 062bedc7 with SDL_WINDOW_FULLSCREEN_DESKTOP
It correctly goes into a proper macOS fullscreen mode which allows switching to other apps/screens. However it doesn't scale to fit the screen, i.e. it returns to scale x1, so you only see the display in the top-left of the screen.
Please checkout commit 12d0881 on the SDL2 branch: this should keep the aspect ratio of the TRS-80 screen when resizing, but so called "letterboxing" will occur ...Actually, keeping the correct aspect ratio would also be nice when resizing the window in window mode too.
Please checkout commit 12d0881 on the SDL2 branch: this should keep the aspect ratio of the TRS-80 screen when resizing, but so called "letterboxing" will occur ...