mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-09-05 19:28:58 +00:00
SDL: Allow fullscreen toggle in BasiliskII
This commit is contained in:
parent
eceafc6200
commit
26d5f6b7f2
@ -106,11 +106,9 @@ static bool redraw_thread_active = false; // Flag: Redraw thread installed
|
|||||||
#ifndef USE_CPU_EMUL_SERVICES
|
#ifndef USE_CPU_EMUL_SERVICES
|
||||||
static volatile bool redraw_thread_cancel; // Flag: Cancel Redraw thread
|
static volatile bool redraw_thread_cancel; // Flag: Cancel Redraw thread
|
||||||
static SDL_Thread *redraw_thread = NULL; // Redraw thread
|
static SDL_Thread *redraw_thread = NULL; // Redraw thread
|
||||||
#ifdef SHEEPSHAVER
|
|
||||||
static volatile bool thread_stop_req = false;
|
static volatile bool thread_stop_req = false;
|
||||||
static volatile bool thread_stop_ack = false; // Acknowledge for thread_stop_req
|
static volatile bool thread_stop_ack = false; // Acknowledge for thread_stop_req
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ENABLE_VOSF
|
#ifdef ENABLE_VOSF
|
||||||
static bool use_vosf = false; // Flag: VOSF enabled
|
static bool use_vosf = false; // Flag: VOSF enabled
|
||||||
@ -1216,13 +1214,14 @@ void VideoQuitFullScreen(void)
|
|||||||
quit_full_screen = true;
|
quit_full_screen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SHEEPSHAVER
|
|
||||||
static void do_toggle_fullscreen(void)
|
static void do_toggle_fullscreen(void)
|
||||||
{
|
{
|
||||||
|
#ifndef USE_CPU_EMUL_SERVICES
|
||||||
// pause redraw thread
|
// pause redraw thread
|
||||||
thread_stop_ack = false;
|
thread_stop_ack = false;
|
||||||
thread_stop_req = true;
|
thread_stop_req = true;
|
||||||
while (!thread_stop_ack) ;
|
while (!thread_stop_ack) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
// save the mouse position
|
// save the mouse position
|
||||||
int x, y;
|
int x, y;
|
||||||
@ -1239,7 +1238,9 @@ static void do_toggle_fullscreen(void)
|
|||||||
drv->adapt_to_video_mode();
|
drv->adapt_to_video_mode();
|
||||||
|
|
||||||
// reset the palette
|
// reset the palette
|
||||||
|
#ifdef SHEEPSHAVER
|
||||||
video_set_palette();
|
video_set_palette();
|
||||||
|
#endif
|
||||||
drv->update_palette();
|
drv->update_palette();
|
||||||
|
|
||||||
// restore the screen contents
|
// restore the screen contents
|
||||||
@ -1258,9 +1259,10 @@ static void do_toggle_fullscreen(void)
|
|||||||
|
|
||||||
// resume redraw thread
|
// resume redraw thread
|
||||||
toggle_fullscreen = false;
|
toggle_fullscreen = false;
|
||||||
|
#ifndef USE_CPU_EMUL_SERVICES
|
||||||
thread_stop_req = false;
|
thread_stop_req = false;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mac VBL interrupt
|
* Mac VBL interrupt
|
||||||
@ -1299,6 +1301,9 @@ void VideoInterrupt(void)
|
|||||||
if (emerg_quit)
|
if (emerg_quit)
|
||||||
QuitEmulator();
|
QuitEmulator();
|
||||||
|
|
||||||
|
if (toggle_fullscreen)
|
||||||
|
do_toggle_fullscreen();
|
||||||
|
|
||||||
// Temporarily give up frame buffer lock (this is the point where
|
// Temporarily give up frame buffer lock (this is the point where
|
||||||
// we are suspended when the user presses Ctrl-Tab)
|
// we are suspended when the user presses Ctrl-Tab)
|
||||||
UNLOCK_FRAME_BUFFER;
|
UNLOCK_FRAME_BUFFER;
|
||||||
@ -2209,13 +2214,11 @@ static int redraw_func(void *arg)
|
|||||||
next = GetTicks_usec();
|
next = GetTicks_usec();
|
||||||
ticks++;
|
ticks++;
|
||||||
|
|
||||||
#ifdef SHEEPSHAVER
|
|
||||||
// Pause if requested (during video mode switches)
|
// Pause if requested (during video mode switches)
|
||||||
if (thread_stop_req) {
|
if (thread_stop_req) {
|
||||||
thread_stop_ack = true;
|
thread_stop_ack = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Process pending events and update display
|
// Process pending events and update display
|
||||||
do_video_refresh();
|
do_video_refresh();
|
||||||
|
Loading…
Reference in New Issue
Block a user