1 /* gameplaySP - raspberry backend
3 * Copyright (C) 2013 DPR <pribyl.email@gmail.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
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 GNU
13 * General Public License for more details.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #include "../common.h"
21 #include <sys/types.h>
23 #include "gles_video.h"
27 u32 gamepad_config_map[PLAT_BUTTON_COUNT] =
30 BUTTON_ID_LEFT, // Left
31 BUTTON_ID_DOWN, // Down
32 BUTTON_ID_RIGHT, // Right
33 BUTTON_ID_START, // Start
34 BUTTON_ID_SELECT, // Select
35 BUTTON_ID_L, // Ltrigger
36 BUTTON_ID_R, // Rtrigger
41 BUTTON_ID_SAVESTATE, // 1
42 BUTTON_ID_LOADSTATE, // 2
43 BUTTON_ID_FASTFORWARD, // 3
45 BUTTON_ID_MENU // Space
49 #define MAX_VIDEO_MEM (480*270*2)
50 static int video_started=0;
51 static uint16_t * video_buff;
54 void gpsp_plat_init(void)
57 //const char *layer_fb_name;
58 SDL_Surface* myVideoSurface;
62 ret = SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_NOPARACHUTE);
64 fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError());
68 myVideoSurface = SDL_SetVideoMode( 0, 0, 16, SDL_SWSURFACE);
69 // Print out some information about the video surface
70 if (myVideoSurface == NULL) {
71 fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError());
75 fb_set_mode(240, 160, 0, 0, 0, 0);
79 void gpsp_plat_quit(void)
90 void *fb_flip_screen(void)
92 video_draw(video_buff);
96 void fb_wait_vsync(void)
100 void fb_set_mode(int w, int h, int buffers, int scale,int filter, int filter2)
106 video_buff=malloc(w*h*sizeof(uint16_t));
107 memset(video_buff,0,w*h*sizeof(uint16_t));
108 video_init(w,h,filter);
111 // vim:shiftwidth=2:expandtab