add rootless as video mode instead of own setting

This commit is contained in:
Jesús A. Álvarez 2019-11-05 23:02:14 +01:00
parent cd70c9925e
commit f6616d1d4d
3 changed files with 21 additions and 6 deletions

View File

@ -32,9 +32,6 @@
prefs_desc platform_prefs_items[] = {
{"idlewait", TYPE_BOOLEAN, false, "sleep when idle"},
{"sdlrender", TYPE_STRING, false, "SDL_Renderer driver (\"auto\", \"software\" (may be faster), etc.)"},
#ifdef VIDEO_ROOTLESS
{"rootless", TYPE_BOOLEAN, false, "Rootles mode (System 7)"},
#endif
{NULL, TYPE_END, false} // End of list
};

View File

@ -61,7 +61,7 @@ static uint32 low_mem_map = 0;
int16 InstallRootlessProc() {
// Rootless mode support
M68kRegisters r;
if (PrefsFindBool("rootless")) {
if (strncmp(PrefsFindString("screen"), "rootless", 8) == 0) {
printf("Installing rootless support\n");
r.d[0] = sizeof(rootless_proc);
Execute68kTrap(0xa71e, &r); // NewPtrSysClear()

View File

@ -88,7 +88,8 @@ extern int display_type; // See enum above
#else
enum {
DISPLAY_WINDOW, // windowed display
DISPLAY_SCREEN // fullscreen display
DISPLAY_SCREEN, // fullscreen display
DISPLAY_ROOTLESS // fullscreen with transparent desktop
};
static int display_type = DISPLAY_WINDOW; // See enum above
#endif
@ -743,6 +744,11 @@ static SDL_Surface * init_sdl_video(int width, int height, int bpp, Uint32 flags
window_flags |= SDL_WINDOW_RESIZABLE;
*/
if (!sdl_window) {
#ifdef VIDEO_ROOTLESS
if (display_type == DISPLAY_ROOTLESS) {
window_flags |= SDL_WINDOW_BORDERLESS;
}
#endif
sdl_window = SDL_CreateWindow(
"Basilisk II",
SDL_WINDOWPOS_UNDEFINED,
@ -1380,6 +1386,13 @@ bool VideoInit(bool classic)
display_type = DISPLAY_WINDOW;
else if (sscanf(mode_str, "dga/%d/%d", &default_width, &default_height) == 2)
display_type = DISPLAY_SCREEN;
#ifdef VIDEO_ROOTLESS
else if (strncmp(mode_str, "rootless", 8) == 0) {
display_type = DISPLAY_ROOTLESS;
default_width = sdl_display_width();
default_height = sdl_display_height();
}
#endif
}
if (default_width <= 0)
default_width = sdl_display_width();
@ -1469,7 +1482,12 @@ bool VideoInit(bool classic)
for (int d = VIDEO_DEPTH_1BIT; d <= default_depth; d++)
add_mode(display_type, w, h, video_modes[i].resolution_id, TrivialBytesPerRow(w, (video_depth)d), d);
}
}
#ifdef VIDEO_ROOTLESS
} else if (display_type == DISPLAY_ROOTLESS) {
for (int d = VIDEO_DEPTH_1BIT; d <= default_depth; d++)
add_mode(display_type, default_width, default_height, 0x80, TrivialBytesPerRow(default_width, (video_depth)d), d);
#endif
}
if (VideoModes.empty()) {
ErrorAlert(STR_NO_XVISUAL_ERR);