Allow querying whether the classic interface is showing

This commit is contained in:
Aaron Culliney 2017-09-09 16:55:39 -10:00
parent 58d2392eac
commit 25e4fd0eba
2 changed files with 14 additions and 0 deletions

View File

@ -22,6 +22,8 @@ int64_t (*interface_onTouchEvent)(interface_touch_event_t action, int pointer_co
static uint8_t *stagingFB = NULL;
static bool isShowing = false;
static char disk_path[PATH_MAX] = { 0 };
// 2015/04/12 : This was legacy code for rendering the menu interfaces on desktop Linux. Portions here are resurrected
@ -1512,10 +1514,12 @@ static void *interface_thread(void *data)
switch (interface_key->current_key) {
case kF1:
isShowing = true;
c_interface_select_diskette( 0 );
break;
case kF2:
isShowing = true;
c_interface_select_diskette( 1 );
break;
@ -1528,18 +1532,22 @@ static void *interface_thread(void *data)
break;
case kF5:
isShowing = true;
c_interface_keyboard_layout();
break;
case kF7:
isShowing = true;
c_interface_debugging(stagingFB);
break;
case kF8:
isShowing = true;
c_interface_credits();
break;
case kF10:
isShowing = true;
c_interface_parameters();
break;
@ -1550,6 +1558,7 @@ static void *interface_thread(void *data)
cpu_resume();
interface_thread_id = 0;
isShowing = false;
pthread_mutex_unlock(&classic_interface_lock);
return NULL;
}
@ -1568,5 +1577,9 @@ void c_interface_begin(int current_key)
pthread_detach(interface_thread_id);
}
bool interface_isShowing(void) {
return isShowing;
}
#endif

View File

@ -34,6 +34,7 @@ void c_interface_credits();
void c_interface_exit(int ch);
void c_interface_translate_screen(char screen[24][INTERFACE_SCREEN_X+1]);
void c_interface_select_diskette(int);
bool interface_isShowing(void);
void interface_setStagingFramebuffer(uint8_t *stagingFB);
#endif