2 * (C) GraÅžvydas "notaz" Ignotas, 2011,2012
4 * This work is licensed under the terms of any of these licenses
6 * - GNU GPL, version 2 or later.
7 * - GNU LGPL, version 2.1 or later.
8 * See the COPYING file in the top-level directory.
13 #include "common/input.h"
14 #include "common/in_sdl.h"
15 #include "common/menu.h"
20 struct in_default_bind in_evdev_defbinds[] = {
24 static SDL_Surface *screen;
26 static int change_video_mode(int w, int h)
28 screen = SDL_SetVideoMode(w, h, 16, 0);
30 fprintf(stderr, "SDL_SetVideoMode failed: %s\n", SDL_GetError());
41 ret = SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE);
43 fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError());
49 ret = change_video_mode(g_menuscreen_w, g_menuscreen_h);
51 ret = change_video_mode(0, 0);
55 if (screen->w < 320 || screen->h < 240) {
56 fprintf(stderr, "resolution %dx%d is too small, sorry.\n",
57 screen->w, screen->h);
60 g_menuscreen_w = screen->w;
61 g_menuscreen_h = screen->h;
63 SDL_WM_SetCaption("PCSX-ReARMed " REV, NULL);
74 void plat_finish(void)
79 void plat_gvideo_open(void)
83 void *plat_gvideo_set_mode(int *w, int *h, int *bpp)
85 change_video_mode(*w, *h);
86 return screen->pixels;
89 void *plat_gvideo_flip(void)
92 return screen->pixels;
95 void plat_gvideo_close(void)
99 void plat_video_menu_enter(int is_rom_loaded)
101 change_video_mode(g_menuscreen_w, g_menuscreen_h);
104 void plat_video_menu_begin(void)
106 SDL_LockSurface(screen);
107 g_menuscreen_ptr = screen->pixels;
110 void plat_video_menu_end(void)
112 SDL_UnlockSurface(screen);
114 g_menuscreen_ptr = NULL;
117 void plat_video_menu_leave(void)
122 void *plat_prepare_screenshot(int *w, int *h, int *bpp)
127 int plat_cpu_clock_get(void)
132 int plat_cpu_clock_apply(int cpu_clock)
137 int plat_get_bat_capacity(void)
142 void plat_step_volume(int is_up)
146 void plat_trigger_vibrate(int is_strong)
150 void plat_minimize(void)
154 // vim:shiftwidth=2:expandtab