From e75a1243556f063851a5adf9cb2e1a00878c4365 Mon Sep 17 00:00:00 2001 From: Michael Georgoulopoulos Date: Sun, 4 Sep 2016 14:05:07 +0300 Subject: [PATCH] Return 0xCAFE from screen.init() to force display the screen first --- src/mike.c | 4 ++++ src/screen.c | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/mike.c b/src/mike.c index 5ab5276..ed995d9 100644 --- a/src/mike.c +++ b/src/mike.c @@ -87,7 +87,11 @@ static int init(void) processNormal(); +#ifdef MIKE_PC + return 0xCAFE; +#else return 0; +#endif } static void destroy(void) diff --git a/src/screen.c b/src/screen.c index 178cf7d..4379778 100644 --- a/src/screen.c +++ b/src/screen.c @@ -34,9 +34,20 @@ int scr_init(void) assert(num_screens <= NUM_SCR); for(i=0; iinit() == -1) { + int r; + r = scr[i]->init(); + if(r == -1) { return -1; } + + /* Make the effect run first if it returns "CAFE" from ins init() */ + if (r == 0xCAFE) { + struct screen *tmp; + tmp = scr[i]; + scr[i] = scr[0]; + scr[0] = tmp; + printf("*** Screen %s displayed out of order ***\n", scr[0]->name); + } } return 0; } -- 1.7.10.4