mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 23:37:46 -04:00
build, odbeta and opendingux cleanup
This commit is contained in:
parent
85174a6d8d
commit
58fc34b1d6
14 changed files with 185 additions and 78 deletions
|
@ -28,10 +28,58 @@ static struct area { int w, h; } area;
|
|||
|
||||
static struct in_pdata in_sdl_platform_data = {
|
||||
.defbinds = in_sdl_defbinds,
|
||||
.key_map = in_sdl_key_map,
|
||||
.joy_map = in_sdl_joy_map,
|
||||
};
|
||||
|
||||
struct plat_target plat_target;
|
||||
|
||||
#if defined __MIYOO__
|
||||
const char *plat_device = "miyoo";
|
||||
#elif defined __GCW0__
|
||||
const char *plat_device = "gcw0";
|
||||
#elif defined __RETROFW__
|
||||
const char *plat_device = "retrofw";
|
||||
#elif defined __DINGUX__
|
||||
const char *plat_device = "dingux";
|
||||
#else
|
||||
const char *plat_device = "";
|
||||
#endif
|
||||
|
||||
int plat_parse_arg(int argc, char *argv[], int *x)
|
||||
{
|
||||
#if defined __OPENDINGUX__
|
||||
if (*plat_device == '\0' && strcasecmp(argv[*x], "-device") == 0) {
|
||||
plat_device = argv[++(*x)];
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
void plat_early_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
int plat_target_init(void)
|
||||
{
|
||||
#if defined __ODBETA__
|
||||
if (*plat_device == '\0') {
|
||||
/* ODbeta should always have a device tree, get the model info from there */
|
||||
FILE *f = fopen("/proc/device-tree/compatible", "r");
|
||||
if (f) {
|
||||
char buf[10];
|
||||
int c = fread(buf, 1, sizeof(buf), f);
|
||||
if (strncmp(buf, "gcw,", 4) == 0)
|
||||
plat_device = "gcw0";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void plat_target_finish(void)
|
||||
{
|
||||
}
|
||||
|
||||
/* YUV stuff */
|
||||
static int yuv_ry[32], yuv_gy[32], yuv_by[32];
|
||||
static unsigned char yuv_u[32 * 2], yuv_v[32 * 2];
|
||||
|
@ -323,10 +371,6 @@ void plat_video_loop_prepare(void)
|
|||
plat_video_set_buffer(g_screen_ptr);
|
||||
}
|
||||
|
||||
void plat_early_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void plat_sdl_resize(int w, int h)
|
||||
{
|
||||
// take over new settings
|
||||
|
@ -392,9 +436,12 @@ void plat_init(void)
|
|||
g_screen_ppitch = 320;
|
||||
g_screen_ptr = shadow_fb;
|
||||
|
||||
plat_target_setup_input();
|
||||
in_sdl_platform_data.kmap_size = in_sdl_key_map_sz,
|
||||
in_sdl_platform_data.key_map = in_sdl_key_map,
|
||||
in_sdl_platform_data.jmap_size = in_sdl_joy_map_sz,
|
||||
in_sdl_platform_data.key_names = *in_sdl_key_names,
|
||||
in_sdl_platform_data.joy_map = in_sdl_joy_map,
|
||||
in_sdl_platform_data.key_names = in_sdl_key_names,
|
||||
in_sdl_init(&in_sdl_platform_data, plat_sdl_event_handler);
|
||||
in_probe();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue