Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
screen.c
Go to the documentation of this file.
1 /* Xep128: Minimalistic Enterprise-128 emulator with focus on "exotic" hardware
2  Copyright (C)2015,2016 LGB (Gábor Lénárt) <lgblgblgb@gmail.com>
3  http://xep128.lgb.hu/
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
18 
19 #include "xep128.h"
20 #define XEP128_NEED_SDL_WMINFO
21 #include "screen.h"
22 #include "dave.h"
23 #include "configuration.h"
24 #include "main.h"
25 #include "input.h"
26 #ifndef NO_SCREENSHOT
27 #ifdef CONFIG_USE_LODEPNG
28 # include "xemu/lodepng.h"
29 #else
30 # include "png.h"
31 #endif
32 #endif
33 #ifndef __EMSCRIPTEN__
34 #include "xemu/../rom/ep128/app_icon.c"
35 #endif
36 #include <SDL.h>
37 
38 
39 #include "xemu/osd_font_16x16.c"
40 
41 
42 int is_fullscreen = 0;
43 SDL_Window *sdl_win = NULL;
44 SDL_SysWMinfo sdl_wminfo;
45 SDL_PixelFormat *sdl_pixel_format;
46 static SDL_Renderer *sdl_ren = NULL;
47 static SDL_Texture *sdl_tex = NULL, *sdl_osdtex = NULL;
50 static int win_xsize, win_ysize, resize_counter = 0, win_size_changed = 0;
51 static int screenshot_index = 0;
52 static Uint32 *osd_pixels = NULL;
53 static int osd_on = 0, osd_fade = 0;
54 static Uint32 osd_fg_colour, osd_bg_colour;
55 
56 
57 
58 static void _osd_set_alpha ( int alpha )
59 {
60  if (alpha > 0xFF)
61  alpha = 0xFF;
62  SDL_SetTextureAlphaMod(sdl_osdtex, alpha);
63 }
64 
65 
66 void osd_disable ( void )
67 {
68  osd_on = 0;
69 }
70 
71 
72 void osd_clear ( void )
73 {
74  memset(osd_pixels, 0, SCREEN_WIDTH * SCREEN_HEIGHT * 4);
75 }
76 
77 
78 void osd_update ( void )
79 {
80  if (osd_pixels)
81  SDL_UpdateTexture(sdl_osdtex, NULL, osd_pixels, SCREEN_WIDTH * sizeof (Uint32));
82 }
83 
84 
85 void osd_set_colour ( int fg_r, int fg_g, int fg_b, int fg_a, int bg_r, int bg_g, int bg_b, int bg_a )
86 {
87  osd_fg_colour = SDL_MapRGBA(sdl_pixel_format, fg_r, fg_g, fg_b, fg_a);
88  osd_bg_colour = SDL_MapRGBA(sdl_pixel_format, bg_r, bg_g, bg_b, bg_a);
89 }
90 
91 
92 void osd_write_char ( int x, int y, char ch )
93 {
94  int row;
95  const Uint16 *s = font_16x16 + ((ch - 32) << 4);
96  Uint32 *d = osd_pixels + y * SCREEN_WIDTH + x;
97  for (row = 0; row < 16; row++) {
98  Uint16 mask = 0x8000;
99  do {
100  *(d++) = *s & mask ? osd_fg_colour : osd_bg_colour;
101  mask >>= 1;
102  } while (mask);
103  s++;
104  d += SCREEN_WIDTH - 16;
105  }
106 }
107 
108 
109 void osd_write_string ( int x, int y, const char *s )
110 {
111  while (*s) {
112  osd_write_char(x, y, *s);
113  s++;
114  x += 16;
115  }
116 }
117 
118 
119 void osd_write_string_centered ( int y, const char *s )
120 {
121  do {
122  char *p = strchr(s, '\n');
123  int n = p ? (p++) - s : strlen(s);
124  int x = (SCREEN_WIDTH >> 1) - (n << 3);
125  while (n) {
126  osd_write_char(x, y, *(s++));
127  x += 16;
128  n--;
129  }
130  y += 24;
131  s = p;
132  } while (s);
133 }
134 
135 
136 void osd_notification ( const char *s )
137 {
138  osd_clear();
140  osd_update();
141  osd_on = 1;
142  osd_fade = OSD_FADE_START;
143 }
144 
145 
146 void osd_replay ( int fade )
147 {
148  osd_on = 1;
149  _osd_set_alpha(0xFF);
150  osd_write_string_centered(70, "*** REPLAY ***");
151  osd_update();
152  osd_fade = fade;
153 }
154 
155 
156 void screen_grab ( SDL_bool state )
157 {
158  if (warn_for_mouse_grab) {
159  //INFO_WINDOW("Clicking in emulator window causes to enter BoxSoft mouse emulation mode.\nThis will try to grab your mouse pointer. To exit, press key ESC.\nYou won't get this notice next time within this session of Xep128");
161  } /*else*/ if (state == SDL_TRUE)
162  OSD("Mouse grab\nPress ESC to leave.");
163  DEBUG("UI: GRAB: %d" NL, state);
164  SDL_SetRelativeMouseMode(state);
165  SDL_SetWindowGrab(sdl_win, state);
166 }
167 
168 
169 #define SCREEN_RATIO ((double)SCREEN_WIDTH / (double)(SCREEN_HEIGHT * 2))
170 
171 
172 void screen_window_resized ( int new_xsize, int new_ysize )
173 {
174  float ratio;
175  if (is_fullscreen)
176  return;
177  if (new_xsize == win_xsize && new_ysize == win_ysize)
178  return;
179  DEBUG("UI: window geometry change from %d x %d to %d x %d" NL, win_xsize, win_ysize, new_xsize, new_ysize);
180  if (new_ysize == 0) new_ysize = 1;
181  ratio = (float)new_xsize / (float)new_ysize;
182  if (new_xsize * new_ysize > win_xsize * win_ysize) { // probably user means making window larger (area of window increased)
183  if (ratio > SCREEN_RATIO)
184  new_ysize = new_xsize / SCREEN_RATIO;
185  else
186  new_xsize = new_ysize * SCREEN_RATIO;
187  } else { // probably user means making window smaller (area of window decreased)
188  if (ratio > SCREEN_RATIO)
189  new_xsize = new_ysize * SCREEN_RATIO;
190  else
191  new_ysize = new_xsize / SCREEN_RATIO;
192  }
193  if (new_xsize < SCREEN_WIDTH || new_ysize < SCREEN_HEIGHT * 2) {
194  win_xsize = SCREEN_WIDTH;
195  win_ysize = SCREEN_HEIGHT * 2;
196  } else {
197  win_xsize = new_xsize;
198  win_ysize = new_ysize;
199  }
200  win_size_changed = 1;
201 }
202 
203 
204 void screen_set_fullscreen ( int state )
205 {
206  if (is_fullscreen == state) return;
207  is_fullscreen = state;
208  if (state) {
209  SDL_GetWindowSize(sdl_win, &win_xsize, &win_ysize); // save window size, it seems there are some problems with leaving fullscreen then
210  if (SDL_SetWindowFullscreen(sdl_win, SDL_WINDOW_FULLSCREEN_DESKTOP)) {
211  ERROR_WINDOW("Cannot enter fullscreen: %s", SDL_GetError());
212  is_fullscreen = 0;
213  } else {
214  DEBUG("UI: entering full screen mode" NL);
215  OSD("Full screen");
216  }
217  SDL_RaiseWindow(sdl_win);
218  } else {
219  SDL_SetWindowFullscreen(sdl_win, 0);
220  SDL_SetWindowSize(sdl_win, win_xsize, win_ysize); // restore window size saved on entering fullscreen, there can be some bugs ...
221  SDL_RaiseWindow(sdl_win); // also I had problems with having the window behind other windows on exit fullscreen. Make sure to raise the window
222  DEBUG("UI: leaving full screen mode" NL);
223  }
224 }
225 
226 
227 void screen_present_frame (Uint32 *ep_pixels)
228 {
229  int need = (osd_on && sdl_osdtex != NULL) || !paused;
230  if (resize_counter == 10) {
231  if (win_size_changed) {
232  SDL_SetWindowSize(sdl_win, win_xsize, win_ysize);
233  DEBUG("UI: correcting window size to %d x %d" NL, win_xsize, win_ysize);
234  win_size_changed = 0;
235  need = 1;
236  }
237  resize_counter = 0;
238  } else
239  resize_counter++;
240  if (!need)
241  return; // Ugly paused hack ... do not consume CPU for SDL screen update when no OSD and emu is paused
242  SDL_UpdateTexture(sdl_tex, NULL, ep_pixels, SCREEN_WIDTH * sizeof (Uint32));
243  SDL_RenderClear(sdl_ren);
244  SDL_RenderCopy(sdl_ren, sdl_tex, NULL, NULL);
245  if (osd_on && sdl_osdtex != NULL)
246  SDL_RenderCopy(sdl_ren, sdl_osdtex, NULL, NULL);
247  else
248  osd_fade = 0;
249  SDL_RenderPresent(sdl_ren);
250  if (osd_fade > OSD_FADE_STOP) { // OSD / fade mode
251  osd_fade -= OSD_FADE_DEC;
252  if (osd_fade > OSD_FADE_STOP) {
253  _osd_set_alpha(osd_fade);
254  } else {
255  osd_on = 0; // faded off, switch OSD texture rendering off
256  DEBUG("OSD: turned off on fading out" NL);
257  }
258  }
259 }
260 
261 
262 // TODO: use libpng in Linux, smaller binary (on windows I wouldn't introduce another DLL dependency though ...)
263 int screen_shot ( Uint32 *ep_pixels, const char *directory, const char *filename )
264 {
265 #ifdef NO_SCREENSHOT
266  return 1;
267 #else
268  char fn[PATH_MAX + 1], *p;
269  Uint8 *pix = malloc(SCREEN_WIDTH * SCREEN_HEIGHT * 2 * 3);
270  int a;
271  if (pix == NULL) {
272  ERROR_WINDOW("Not enough memory for taking a screenshot :(");
273  return 1;
274  }
275  if (directory)
276  strcpy(fn, directory);
277  else
278  *fn = 0;
279  p = strchr(filename, '*');
280  if (p) {
281  a = strlen(fn);
282  memcpy(fn + a, filename, p - filename);
283  sprintf(fn + a + (p - filename), "%d", screenshot_index);
284  strcat(fn, p + 1);
285  screenshot_index++;
286  } else
287  strcat(fn, filename);
288  for (a = 0; a < SCREEN_HEIGHT * SCREEN_WIDTH; a++) {
289  int d = (a / SCREEN_WIDTH) * SCREEN_WIDTH * 6 + (a % SCREEN_WIDTH) * 3;
290  pix[d + 0] = pix[d + 0 + SCREEN_WIDTH * 3] = (ep_pixels[a] >> 16) & 0xFF;
291  pix[d + 1] = pix[d + 1 + SCREEN_WIDTH * 3] = (ep_pixels[a] >> 8) & 0xFF;
292  pix[d + 2] = pix[d + 2 + SCREEN_WIDTH * 3] = ep_pixels[a] & 0xFF;
293  }
294  if (lodepng_encode24_file(fn, (unsigned char*)pix, SCREEN_WIDTH, SCREEN_HEIGHT * 2)) {
295  free(pix);
296  ERROR_WINDOW("LodePNG screenshot taking error");
297  return 1;
298  } else {
299  free(pix);
300  OSD("Screenshot:\n%s", fn + strlen(directory));
301  return 0;
302  }
303 #endif
304 }
305 
306 
307 
308 #ifndef __EMSCRIPTEN__
309 static void set_app_icon ( SDL_Window *win, const void *app_icon )
310 {
311  SDL_Surface *surf = SDL_CreateRGBSurfaceFrom((void*)app_icon,96,96,32,96*4,0x000000ff,0x0000ff00,0x00ff0000,0xff000000);
312  if (surf == NULL)
313  DEBUG("Cannot create surface for window icon: %s" NL, SDL_GetError());
314  else {
315  SDL_SetWindowIcon(win, surf);
316  SDL_FreeSurface(surf);
317  }
318 }
319 #endif
320 
321 
322 static SDL_bool XEP128_SDL_SetHint ( const char *sdl_hint_name, const char *cfg_sub_key, const char *defval )
323 {
324  char res[256];
325  const char *p = config_getopt_str("sdl");
326  if (!strchr(p, '=')) {
327  if (defval)
328  return SDL_SetHint(sdl_hint_name, defval);
329  else
330  return SDL_TRUE; // ignored
331  }
332  while (p && *p) {
333  char *q = strchr(p, ':');
334  if (q) q++;
335  if (!strncasecmp(p, cfg_sub_key, strlen(cfg_sub_key)) && p[strlen(cfg_sub_key)] == '=') {
336  p += strlen(cfg_sub_key) + 1;
337  if (q) {
338  memcpy(res, p, q - p - 1);
339  res[q - p - 1] = '\0';
340  } else
341  strcpy(res, p);
342  DEBUGPRINT("SDL: setting hint \"%s\" [cfg: \"%s\"] to \"%s\"" NL, sdl_hint_name, cfg_sub_key, res);
343  return SDL_SetHint(sdl_hint_name, res);
344  }
345  p = q;
346  }
347  DEBUGPRINT("SDL: cannot found hint \"%s\" [cfg: \"%s\"] in sdl opt" NL, sdl_hint_name, cfg_sub_key);
348  if (defval) {
349  DEBUGPRINT("SDL: ... so setting the Xep128 internal specified default: \"%s\"" NL, defval);
350  return SDL_SetHint(sdl_hint_name, defval);
351  }
352  return SDL_FALSE;
353 }
354 
355 
356 
357 int screen_init ( void )
358 {
359  win_xsize = SCREEN_WIDTH;
360  win_ysize = SCREEN_HEIGHT * 2;
361  XEP128_SDL_SetHint(SDL_HINT_RENDER_DRIVER, "driver", NULL);
362  sdl_pixel_format = SDL_AllocFormat(SCREEN_FORMAT);
363  sdl_win = SDL_CreateWindow(
364  WINDOW_TITLE " v" VERSION,
365  SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
366  win_xsize, win_ysize,
367  SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE
368  );
369  if (!sdl_win) {
370  ERROR_WINDOW("Cannot open SDL window: %s", SDL_GetError());
371  return 1;
372  }
373  SDL_VERSION(&sdl_wminfo.version);
374 #ifndef __EMSCRIPTEN__
375  if (!SDL_GetWindowWMInfo(sdl_win, &sdl_wminfo)) {
376  // ERROR_WINDOW("Cannot issue WMInfo call: %s", SDL_GetError());
377  // return 1;
378  DEBUGPRINT("UI: warning WMInfo call falied: %s", SDL_GetError());
379  }
380 #endif
381  SDL_SetWindowMinimumSize(sdl_win, SCREEN_WIDTH, SCREEN_HEIGHT * 2);
382  //screen_window_resized();
383 #ifndef __EMSCRIPTEN__
384  set_app_icon(sdl_win, _icon_pixels);
385 #endif
386  sdl_ren = SDL_CreateRenderer(sdl_win, -1,
387 #ifdef __EMSCRIPTEN__
388  // It seems, Emscripten uses WebGL context rather than browser-canvas 2D context, however that seems to be slower!!!
389  0 /* SDL_RENDERER_SOFTWARE */
390 #else
391  0
392 #endif
393  );
394  if (sdl_ren == NULL) {
395  ERROR_WINDOW("Cannot create SDL renderer: %s", SDL_GetError());
396  return 1;
397  }
398  SDL_RenderSetLogicalSize(sdl_ren, SCREEN_WIDTH, SCREEN_HEIGHT * 2);
399  XEP128_SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_PING, "wmping", "0"); // disable WM ping, SDL dialog boxes makes WMs things Xep128 is dead :-/
400  XEP128_SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "quality", "1"); // render scale quality 0, 1, 2
401  XEP128_SDL_SetHint(SDL_HINT_RENDER_VSYNC, "vsync", "0"); // disable vsync
402 #ifdef _WIN32
403  XEP128_SDL_SetHint(SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4, "noaltf4", "1"); // 1 = disable ALT-F4 close on Windows
404 #endif
405  XEP128_SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "focuslossmin", "1"); // 1 = do minimize the SDL_Window if it loses key focus when in fullscreen mode
406  XEP128_SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "screensaver", "1"); // 1 = enable screen saver
407  sdl_tex = SDL_CreateTexture(sdl_ren, SCREEN_FORMAT, SDL_TEXTUREACCESS_STREAMING, SCREEN_WIDTH, SCREEN_HEIGHT);
408  if (sdl_tex == NULL) {
409  ERROR_WINDOW("Cannot create SDL texture: %s", SDL_GetError());
410  return 1;
411  }
413  if (osd_pixels != NULL) {
414  sdl_osdtex = SDL_CreateTexture(sdl_ren, SCREEN_FORMAT, SDL_TEXTUREACCESS_STREAMING, SCREEN_WIDTH, SCREEN_HEIGHT);
415  if (sdl_osdtex == NULL) {
416  ERROR_WINDOW("Cannot create texture for OSD rendering, OSD won't work: %s", SDL_GetError());
417  free(osd_pixels);
418  osd_pixels = NULL;
419  } else {
420  osd_set_colour(0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF);
421  if (SDL_SetTextureBlendMode(sdl_osdtex, SDL_BLENDMODE_BLEND))
422  ERROR_WINDOW("Warning, SDL BLEND mode cannot be used for OSD, there can be fade out problems.\n%s", SDL_GetError());
423  }
424  } else
425  ERROR_WINDOW("Not enough memory for OSD pixel buffer. OSD won't work");
426  sdl_winid = SDL_GetWindowID(sdl_win);
427  DEBUG("SDL: everything seems to be OK ..." NL);
428  return 0;
429 }
430 
431 
432 /* During SDL or Native dialogs/widgets, it seems some events detected by SDL event _later_ which is of course not wanted.
433  This function simply "pops" out SDL events and do not use them to prevent them to be detected later by the emulator. */
434 void sdl_burn_events ( void )
435 {
436  SDL_PumpEvents();
437  SDL_FlushEvent(SDL_KEYDOWN);
438  SDL_FlushEvent(SDL_KEYUP);
439  SDL_FlushEvent(SDL_MOUSEMOTION);
440  SDL_FlushEvent(SDL_MOUSEWHEEL);
441  SDL_FlushEvent(SDL_MOUSEBUTTONDOWN);
442  SDL_FlushEvent(SDL_MOUSEBUTTONUP);
443  kbd_matrix_reset(); // also reset the keyboard matrix as it seems some keys can be detected "stucked" ...
444  mouse_reset_button(); // ... and also the mouse buttons :)
445 }
446 
447 
448 int _sdl_emu_secured_message_box_ ( Uint32 sdlflag, const char *msg )
449 {
450  int mg = mouse_grab, r;
451  audio_stop();
452  if (mg == SDL_TRUE) screen_grab(SDL_FALSE);
453 #ifdef __EMSCRIPTEN__
454  if (1 || sdlflag == SDL_MESSAGEBOX_ERROR) {
455  EM_ASM_INT({
456  window.alert(Pointer_stringify($0));
457  }, msg);
458  }
459 #endif
460  r = SDL_ShowSimpleMessageBox(sdlflag, WINDOW_TITLE, msg, sdl_win);
461  if (mg == SDL_TRUE) screen_grab(mg);
462  audio_start();
463  sdl_burn_events();
464  return r;
465 }
466 
467 
468 
469 int _sdl_emu_secured_modal_box_ ( const char *items_in, const char *msg )
470 {
471  char items_buf[512], *items = items_buf;
472  int buttonid, mg = mouse_grab;
473  SDL_MessageBoxButtonData buttons[16];
474  SDL_MessageBoxData messageboxdata = {
475  SDL_MESSAGEBOX_INFORMATION, /* .flags */
476  sdl_win, /* .window */
477  WINDOW_TITLE, /* .title */
478  msg, /* .message */
479  0, /* number of buttons, will be updated! */
480  buttons,
481  NULL // &colorScheme
482  };
483  strcpy(items_buf, items_in);
484  for (;;) {
485  char *p = strchr(items, '|');
486  switch (*items) {
487  case '!':
488 #ifdef __EMSCRIPTEN__
489  DEBUGPRINT("Emscripten: faking chooser box answer %d for \"%s\"" NL, messageboxdata.numbuttons, msg);
490  return messageboxdata.numbuttons;
491 #endif
492  buttons[messageboxdata.numbuttons].flags = SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT;
493  items++;
494  break;
495  case '?':
496  buttons[messageboxdata.numbuttons].flags = SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT;
497  items++;
498  break;
499  default:
500  buttons[messageboxdata.numbuttons].flags = 0;
501  break;
502  }
503  buttons[messageboxdata.numbuttons].text = items;
504  buttons[messageboxdata.numbuttons].buttonid = messageboxdata.numbuttons;
505  messageboxdata.numbuttons++;
506  if (p == NULL) break;
507  *p = 0;
508  items = p + 1;
509  }
510  /* win grab, kbd/mouse emu reset etc before the window! */
511  audio_stop();
512  if (mg == SDL_TRUE) screen_grab(SDL_FALSE);
513  SDL_ShowMessageBox(&messageboxdata, &buttonid);
514  if (mg == SDL_TRUE) screen_grab(mg);
515  audio_start();
516  sdl_burn_events();
517  return buttonid;
518 }
sdl_pixel_format
SDL_PixelFormat * sdl_pixel_format
Definition: screen.c:45
sdl_ren
SDL_Renderer * sdl_ren
Definition: emutools.c:78
OSD_FADE_STOP
#define OSD_FADE_STOP
Definition: screen.h:37
osd_font_16x16.c
lodepng.h
osd_update
void osd_update(void)
Definition: screen.c:78
mouse_grab
int mouse_grab
Definition: input_devices.c:28
sdl_win
SDL_Window * sdl_win
Definition: screen.c:43
OSD_FADE_DEC
#define OSD_FADE_DEC
Definition: screen.h:38
_sdl_emu_secured_message_box_
int _sdl_emu_secured_message_box_(Uint32 sdlflag, const char *msg)
Definition: screen.c:448
screen_present_frame
void screen_present_frame(Uint32 *ep_pixels)
Definition: screen.c:227
SCREEN_WIDTH
#define SCREEN_WIDTH
Definition: vic3.h:29
items
const struct menu_st * items[XEMUGUI_MAX_ITEMS]
Definition: gui_win.c:33
screen.h
font_16x16
const Uint16 font_16x16[]
Definition: osd_font_16x16.c:1
_sdl_emu_secured_modal_box_
int _sdl_emu_secured_modal_box_(const char *items_in, const char *msg)
Definition: screen.c:469
screen_init
int screen_init(void)
Definition: screen.c:357
fn
const char * fn
Definition: roms.c:42
dave.h
Uint32
uint32_t Uint32
Definition: fat32.c:49
paused
int paused
Definition: enterprise128.c:53
Uint8
uint8_t Uint8
Definition: fat32.c:51
screen_grab
void screen_grab(SDL_bool state)
Definition: screen.c:156
kbd_matrix_reset
void kbd_matrix_reset(void)
Definition: dave.c:199
screen_window_resized
void screen_window_resized(int new_xsize, int new_ysize)
Definition: screen.c:172
x
int x
Definition: console.c:27
osd_write_string_centered
void osd_write_string_centered(int y, const char *s)
Definition: screen.c:119
DEBUGPRINT
#define DEBUGPRINT(...)
Definition: emutools_basicdefs.h:171
osd_notification
void osd_notification(const char *s)
Definition: screen.c:136
mouse_reset_button
void mouse_reset_button(void)
Definition: input_devices.c:255
ERROR_WINDOW
#define ERROR_WINDOW(...)
Definition: xep128.h:116
osd_clear
void osd_clear(void)
Definition: screen.c:72
NL
#define NL
Definition: fat32.c:37
compress_sd_image.r
def r
Definition: compress_sd_image.py:76
sdl_wminfo
SDL_SysWMinfo sdl_wminfo
Definition: screen.c:44
audio_start
void audio_start(void)
Definition: dave.c:123
screen_shot
int screen_shot(Uint32 *ep_pixels, const char *directory, const char *filename)
Definition: screen.c:263
osd_disable
void osd_disable(void)
Definition: screen.c:66
xep128.h
audio_stop
void audio_stop(void)
Definition: dave.c:133
sdl_tex
SDL_Texture * sdl_tex
Definition: emutools.c:79
main.h
SCREEN_HEIGHT
#define SCREEN_HEIGHT
Definition: vic3.h:30
SCREEN_FORMAT
#define SCREEN_FORMAT
Definition: commodore_65.h:25
is_fullscreen
int is_fullscreen
Definition: screen.c:42
OSD
#define OSD(...)
Definition: xep128.h:100
configuration.h
y
int y
Definition: console.c:27
mask
int mask
Definition: dma65.c:83
OSD_FADE_START
#define OSD_FADE_START
Definition: screen.h:36
Uint16
uint16_t Uint16
Definition: fat32.c:50
sdl_burn_events
void sdl_burn_events(void)
Definition: screen.c:434
osd_write_char
void osd_write_char(int x, int y, char ch)
Definition: screen.c:92
screen_set_fullscreen
void screen_set_fullscreen(int state)
Definition: screen.c:204
DEBUG
#define DEBUG(...)
Definition: emutools_basicdefs.h:167
SCREEN_RATIO
#define SCREEN_RATIO
Definition: screen.c:169
osd_replay
void osd_replay(int fade)
Definition: screen.c:146
WINDOW_TITLE
#define WINDOW_TITLE
Definition: xep128.h:50
alloc_xep_aligned_mem
void * alloc_xep_aligned_mem(size_t size)
Definition: main.c:74
osd_set_colour
void osd_set_colour(int fg_r, int fg_g, int fg_b, int fg_a, int bg_r, int bg_g, int bg_b, int bg_a)
Definition: screen.c:85
VERSION
#define VERSION
Definition: xep128.h:51
input.h
sdl_winid
Uint32 sdl_winid
Definition: screen.c:49
warn_for_mouse_grab
int warn_for_mouse_grab
Definition: screen.c:48
osd_write_string
void osd_write_string(int x, int y, const char *s)
Definition: screen.c:109