update platform code to suit recent PCSX related changes
authornotaz <notasas@gmail.com>
Sun, 22 May 2011 13:45:53 +0000 (13:45 +0000)
committernotaz <notasas@gmail.com>
Sun, 22 May 2011 13:45:53 +0000 (13:45 +0000)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@930 be3aeb3a-fb24-0410-a615-afba39da0efa

13 files changed:
pico/pico.h
platform/common/config.c
platform/common/menu_pico.c
platform/gp2x/Makefile
platform/gp2x/emu.c
platform/gp2x/menu.c
platform/gp2x/plat.c
platform/linux/Makefile
platform/linux/emu.c
platform/linux/io.c
platform/pandora/Makefile
platform/pandora/menu.c
platform/pandora/plat.c

index ca7577f..ac5eb05 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef PICO_H\r
 #define PICO_H\r
 \r
-//#include <stdio.h>\r
+#include <stdlib.h> // size_t\r
 \r
 // port-specific compile-time settings\r
 #include <port_config.h>\r
index 3794cee..9950b13 100644 (file)
@@ -19,6 +19,7 @@ static char *mystrip(char *str);
 #ifndef _MSC_VER
 
 #include "menu.h"
+#include "menu_pico.h"
 #include "emu.h"
 #include <pico/pico.h>
 
@@ -756,7 +757,6 @@ int config_readsect(const char *fname, const char *section)
        keys_encountered = 0;
        memset(input_dev_map, 0xff, sizeof(input_dev_map));
 
-       in_config_start();
        while (!feof(f))
        {
                ret = config_get_var_val(f, line, sizeof(line), &var, &val);
@@ -765,7 +765,6 @@ int config_readsect(const char *fname, const char *section)
 
                parse(var, val);
        }
-       in_config_end();
 
        fclose(f);
        return 0;
index da820ea..abc5845 100644 (file)
@@ -1,4 +1,7 @@
+#include <string.h>
+
 #include "emu.h"
+#include "menu_pico.h"
 
 #include <version.h>
 #include <revision.h>
@@ -399,8 +402,8 @@ static const char *mgn_opt_sh2cycles(int id, int *offs)
 static const char h_32x_enable[] = "Enable emulation of the 32X addon";
 static const char h_pwm[]        = "Disabling may improve performance, but break sound";
 static const char h_sh2cycles[]  = "Cycles/millisecond (similar to DOSBox)\n"
-       "lower values speed up emulation but break games\n"
-       "at least 11000 recommended for compatibility";
+                                  "lower values speed up emulation but break games\n"
+                                  "at least 11000 recommended for compatibility";
 
 static menu_entry e_menu_32x_options[] =
 {
@@ -828,6 +831,26 @@ static void debug_menu_loop(void)
 
 // ------------ main menu ------------
 
+static const char credits[] =
+       "PicoDrive v" VERSION " (c) notaz, 2006-2011\n\n\n"
+       "Credits:\n"
+       "fDave: Cyclone 68000 core,\n"
+       "      base code of PicoDrive\n"
+       "Reesy & FluBBa: DrZ80 core\n"
+       "MAME devs: YM2612 and SN76496 cores\n"
+       "Inder, ketchupgun: graphics\n"
+#ifdef __GP2X__
+       "rlyeh and others: minimal SDK\n"
+       "Squidge: mmuhack\n"
+       "Dzz: ARM940 sample\n"
+#endif
+       "\n"
+       "special thanks (for docs, ideas):\n"
+       " Charles MacDonald, Haze,\n"
+       " Stephane Dallongeville,\n"
+       " Lordus, Exophase, Rokas,\n"
+       " Nemesis, Tasco Deluxe";
+
 static char *romsel_run(void)
 {
        char *ret, *sel_name;
@@ -875,7 +898,7 @@ static int main_menu_handler(int id, int keys)
                }
                break;
        case MA_MAIN_CREDITS:
-               draw_menu_message(, NULL);
+               draw_menu_message(credits, NULL);
                in_menu_wait(PBTN_MOK|PBTN_MBACK, 70);
                break;
        case MA_MAIN_EXIT:
index 62bbc9b..030bab6 100644 (file)
@@ -55,7 +55,7 @@ OBJS += pico/carthw/svp/compiler.o pico/carthw/svp/stub_arm.o
 OBJS += pico/sound/mix_arm.o\r
 \r
 # common\r
-OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \\r
+OBJS += platform/common/emu.o platform/common/menu_pico.o platform/common/fonts.o platform/common/config.o \\r
        platform/common/arm_utils.o platform/common/arm_linux.o platform/common/readpng.o \\r
        platform/common/mp3_helix.o platform/common/input.o platform/common/main.o platform/common/mp3.o \\r
        platform/linux/sndout_oss.o platform/linux/plat.o platform/linux/in_evdev.o\r
index 7175afc..df9faac 100644 (file)
@@ -913,24 +913,3 @@ void pemu_loop_end(void)
        pemu_forced_frame(0, 1);\r
 }\r
 \r
-const char *plat_get_credits(void)\r
-{\r
-       return "PicoDrive v" VERSION " (c) notaz, 2006-2010\n\n\n"\r
-               "Credits:\n"\r
-               "fDave: Cyclone 68000 core,\n"\r
-               "      base code of PicoDrive\n"\r
-               "Reesy & FluBBa: DrZ80 core\n"\r
-               "MAME devs: YM2612 and SN76496 cores\n"\r
-               "rlyeh and others: minimal SDK\n"\r
-               "Squidge: mmuhack\n"\r
-               "Dzz: ARM940 sample\n"\r
-               "GnoStiC / Puck2099: USB joy code\n"\r
-               "craigix: GP2X hardware\n"\r
-               "ketchupgun: skin design\n"\r
-               "\n"\r
-               "special thanks (for docs, ideas):\n"\r
-               " Charles MacDonald, Haze,\n"\r
-               " Stephane Dallongeville,\n"\r
-               " Lordus, Exophase, Rokas,\n"\r
-               " Nemesis, Tasco Deluxe";\r
-}\r
index b7f7b85..eabd74e 100644 (file)
@@ -54,7 +54,7 @@ static void menu_main_plat_draw(void)
 
 // ------------ gfx options menu ------------
 
-static const char *mgn_aopt_gamma(menu_id id, int *offs)
+static const char *mgn_aopt_gamma(int id, int *offs)
 {
        sprintf(static_buff, "%i.%02i", currentConfig.gamma / 100, currentConfig.gamma % 100);
        return static_buff;
index 23a155e..321a4b6 100644 (file)
@@ -41,6 +41,29 @@ static const char * const caanoo_keys[KEY_MAX + 1] = {
        [BTN_BASE5]     = "Push",
 };
 
+struct in_default_bind in_evdev_defbinds[] =
+{
+       /* MXYZ SACB RLDU */
+       { KEY_UP,       IN_BINDTYPE_PLAYER12, 0 },
+       { KEY_DOWN,     IN_BINDTYPE_PLAYER12, 1 },
+       { KEY_LEFT,     IN_BINDTYPE_PLAYER12, 2 },
+       { KEY_RIGHT,    IN_BINDTYPE_PLAYER12, 3 },
+       { KEY_S,        IN_BINDTYPE_PLAYER12, 4 },      /* B */
+       { KEY_D,        IN_BINDTYPE_PLAYER12, 5 },      /* C */
+       { KEY_A,        IN_BINDTYPE_PLAYER12, 6 },      /* A */
+       { KEY_ENTER,    IN_BINDTYPE_PLAYER12, 7 },
+       { KEY_BACKSLASH, IN_BINDTYPE_EMU, PEVB_MENU },
+       /* Caanoo */
+       { BTN_THUMB,    IN_BINDTYPE_PLAYER12, 4 },      /* B */
+       { BTN_THUMB2,   IN_BINDTYPE_PLAYER12, 5 },      /* C */
+       { BTN_TRIGGER,  IN_BINDTYPE_PLAYER12, 6 },      /* A */
+       { BTN_BASE3,    IN_BINDTYPE_PLAYER12, 7 },
+       { BTN_TOP2,     IN_BINDTYPE_EMU, PEVB_STATE_SAVE },
+       { BTN_PINKIE,   IN_BINDTYPE_EMU, PEVB_STATE_LOAD },
+       { BTN_BASE,     IN_BINDTYPE_EMU, PEVB_MENU },
+       { 0, 0, 0 }
+};
+
 void gp2x_video_changemode(int bpp)
 {
        gp2x_video_changemode_ll(bpp);
index 1fb54d3..34856ac 100644 (file)
@@ -35,7 +35,7 @@ CC ?= $(CROSS)gcc
 OBJS += io.o emu.o blit.o in_evdev.o plat.o sndout_oss.o log_io.o
 
 # common
-OBJS += platform/common/main.o platform/common/emu.o platform/common/menu.o \
+OBJS += platform/common/main.o platform/common/emu.o platform/common/menu_pico.o \
        platform/common/config.o platform/common/fonts.o platform/common/readpng.o \
        platform/common/input.o
 
index aef2197..95666ad 100644 (file)
@@ -298,24 +298,3 @@ void plat_wait_till_us(unsigned int us_to)
        }\r
 }\r
 \r
-const char *plat_get_credits(void)\r
-{\r
-       return "PicoDrive v" VERSION " (c) notaz, 2006-2009\n\n\n"\r
-               "Credits:\n"\r
-               "fDave: Cyclone 68000 core,\n"\r
-               "      base code of PicoDrive\n"\r
-               "Reesy & FluBBa: DrZ80 core\n"\r
-               "MAME devs: YM2612 and SN76496 cores\n"\r
-               "rlyeh and others: minimal SDK\n"\r
-               "Squidge: mmuhack\n"\r
-               "Dzz: ARM940 sample\n"\r
-               "GnoStiC / Puck2099: USB joy code\n"\r
-               "craigix: GP2X hardware\n"\r
-               "ketchupgun: skin design\n"\r
-               "\n"\r
-               "special thanks (for docs, ideas):\n"\r
-               " Charles MacDonald, Haze,\n"\r
-               " Stephane Dallongeville,\n"\r
-               " Lordus, Exophase, Rokas,\n"\r
-               " Nemesis, Tasco Deluxe";\r
-}\r
index 1122e8a..2767e68 100644 (file)
@@ -5,6 +5,7 @@
 #include "../common/emu.h"
 #include "../common/menu.h"
 #include "../common/plat.h"
+#include "../common/input.h"
 #include "sndout_oss.h"
 #include "version.h"
 
@@ -363,3 +364,20 @@ void mp3_update(int *buffer, int length, int stereo)
 {
 }
 
+#include <linux/input.h>
+
+struct in_default_bind in_evdev_defbinds[] =
+{
+       /* MXYZ SACB RLDU */
+       { KEY_UP,       IN_BINDTYPE_PLAYER12, 0 },
+       { KEY_DOWN,     IN_BINDTYPE_PLAYER12, 1 },
+       { KEY_LEFT,     IN_BINDTYPE_PLAYER12, 2 },
+       { KEY_RIGHT,    IN_BINDTYPE_PLAYER12, 3 },
+       { KEY_S,        IN_BINDTYPE_PLAYER12, 4 },      /* B */
+       { KEY_D,        IN_BINDTYPE_PLAYER12, 5 },      /* C */
+       { KEY_A,        IN_BINDTYPE_PLAYER12, 6 },      /* A */
+       { KEY_ENTER,    IN_BINDTYPE_PLAYER12, 7 },
+       { KEY_BACKSLASH, IN_BINDTYPE_EMU, PEVB_MENU },
+       { 0, 0, 0 }
+};
+
index 45f74b2..692ad42 100644 (file)
@@ -46,7 +46,7 @@ OBJCOPY = $(CROSS)objcopy
 OBJS += plat.o asm_utils.o\r
 \r
 # common\r
-OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \\r
+OBJS += platform/common/emu.o platform/common/menu_pico.o platform/common/fonts.o platform/common/config.o \\r
        platform/common/arm_utils.o platform/common/mp3_helix.o platform/common/arm_linux.o \\r
        platform/common/readpng.o platform/common/input.o platform/common/main.o platform/common/mp3.o \\r
        platform/linux/fbdev.o platform/linux/in_evdev.o platform/linux/sndout_oss.o \\r
@@ -93,7 +93,7 @@ readme.txt: ../../tools/textfilter ../base_readme.txt
 PicoDrive.pxml: PicoDrive.pxml.template\r
        ./make_pxml.sh PicoDrive.pxml.template PicoDrive.pxml\r
 \r
-platform/common/menu.o: menu.c\r
+platform/common/menu_pico.o: platform/common/menu.c menu.c\r
 \r
 # ----------- release -----------\r
 \r
index aec6c9f..be822cf 100644 (file)
@@ -7,10 +7,8 @@ static const char h_cscaler[]   = "Displays the scaler layer, you can resize it\
                                  "using d-pad or move it using R+d-pad";
 static const char *men_dummy[] = { NULL };
 char **pnd_filter_list;
-int g_layer_cx = 80, g_layer_cy = 0;
-int g_layer_cw = 640, g_layer_ch = 480;
 
-static int menu_loop_cscaler(menu_id id, int keys)
+static int menu_loop_cscaler(int id, int keys)
 {
        unsigned int inp;
 
@@ -89,7 +87,7 @@ void pnd_menu_init(void)
        struct dirent *ent;
        int i, count = 0;
        char **mfilters;
-       char buff[64];
+       char buff[64], *p;
        DIR *dir;
 
        dir = opendir("/etc/pandora/conf/dss_fir");
@@ -106,7 +104,8 @@ void pnd_menu_init(void)
                                perror("readdir");
                        break;
                }
-               if (strstr(ent->d_name, "_up_h"))
+               p = strstr(ent->d_name, "_up");
+               if (p != NULL && (p[3] == 0 || !strcmp(p + 3, "_h")))
                        count++;
        }
 
@@ -119,14 +118,13 @@ void pnd_menu_init(void)
 
        rewinddir(dir);
        for (i = 0; (ent = readdir(dir)); ) {
-               char *pos;
                size_t len;
 
-               pos = strstr(ent->d_name, "_up_h");
-               if (pos == NULL)
+               p = strstr(ent->d_name, "_up");
+               if (p == NULL || (p[3] != 0 && strcmp(p + 3, "_h")))
                        continue;
 
-               len = pos - ent->d_name;
+               len = p - ent->d_name;
                if (len > sizeof(buff) - 1)
                        continue;
 
index f1ae107..91468a1 100644 (file)
@@ -29,6 +29,8 @@
 #include <linux/input.h>\r
 \r
 static struct vout_fbdev *main_fb, *layer_fb;\r
+// g_layer_* - in use, g_layer_c* - configured custom\r
+int g_layer_cx, g_layer_cy, g_layer_cw, g_layer_ch;\r
 static int g_layer_x, g_layer_y;\r
 static int g_layer_w = 320, g_layer_h = 240;\r
 static int g_osd_fps_x, g_osd_y, doing_bg_frame;\r
@@ -58,6 +60,30 @@ static const char * const pandora_gpio_keys[KEY_MAX + 1] = {
        [KEY_MENU]      = "Pandora",\r
 };\r
 \r
+struct in_default_bind in_evdev_defbinds[] =\r
+{\r
+       /* MXYZ SACB RLDU */\r
+       { KEY_UP,       IN_BINDTYPE_PLAYER12, 0 },\r
+       { KEY_DOWN,     IN_BINDTYPE_PLAYER12, 1 },\r
+       { KEY_LEFT,     IN_BINDTYPE_PLAYER12, 2 },\r
+       { KEY_RIGHT,    IN_BINDTYPE_PLAYER12, 3 },\r
+       { KEY_S,        IN_BINDTYPE_PLAYER12, 4 },      /* B */\r
+       { KEY_D,        IN_BINDTYPE_PLAYER12, 5 },      /* C */\r
+       { KEY_A,        IN_BINDTYPE_PLAYER12, 6 },      /* A */\r
+       { KEY_ENTER,    IN_BINDTYPE_PLAYER12, 7 },\r
+       { KEY_BACKSLASH, IN_BINDTYPE_EMU, PEVB_MENU },\r
+       { KEY_SPACE,    IN_BINDTYPE_EMU, PEVB_MENU },\r
+       /* Pandora */\r
+       { KEY_PAGEDOWN, IN_BINDTYPE_PLAYER12, 4 },\r
+       { KEY_END,      IN_BINDTYPE_PLAYER12, 5 },\r
+       { KEY_HOME,     IN_BINDTYPE_PLAYER12, 6 },\r
+       { KEY_LEFTALT,  IN_BINDTYPE_PLAYER12, 7 },\r
+       { KEY_RIGHTSHIFT,IN_BINDTYPE_EMU, PEVB_STATE_SAVE },\r
+       { KEY_RIGHTCTRL, IN_BINDTYPE_EMU, PEVB_STATE_LOAD },\r
+       { KEY_LEFTCTRL,  IN_BINDTYPE_EMU, PEVB_MENU },\r
+       { 0, 0, 0 }\r
+};\r
+\r
 static int get_cpu_clock(void)\r
 {\r
        FILE *f;\r
@@ -441,8 +467,8 @@ void emu_video_mode_change(int start_line, int line_count, int is_32cols)
        g_osd_y = fb_top + fb_h - 8;\r
 \r
        pnd_setup_layer(1, g_layer_x, g_layer_y, g_layer_w, g_layer_h);\r
-       vout_fbdev_resize(layer_fb, fb_w, fb_h, fb_left, fb_right, fb_top, fb_bottom, 0);\r
        vout_fbdev_clear(layer_fb);\r
+       vout_fbdev_resize(layer_fb, fb_w, fb_h, 16, fb_left, fb_right, fb_top, fb_bottom, 3);\r
        plat_video_flip();\r
 }\r
 \r
@@ -516,24 +542,6 @@ void plat_wait_till_us(unsigned int us_to)
 */\r
 }\r
 \r
-const char *plat_get_credits(void)\r
-{\r
-       return "PicoDrive v" VERSION " (c) notaz, 2006-2010\n\n\n"\r
-               "Credits:\n"\r
-               "fDave: Cyclone 68000 core,\n"\r
-               "      base code of PicoDrive\n"\r
-               "Reesy & FluBBa: DrZ80 core\n"\r
-               "MAME devs: YM2612 and SN76496 cores\n"\r
-               "Pandora team: Pandora\n"\r
-               "Inder, ketchupgun: graphics\n"\r
-               "\n"\r
-               "special thanks (for docs, ideas):\n"\r
-               " Charles MacDonald, Haze,\n"\r
-               " Stephane Dallongeville,\n"\r
-               " Lordus, Exophase, Rokas,\n"\r
-               " Nemesis, Tasco Deluxe";\r
-}\r
-\r
 #include "../linux/oshide.h"\r
 \r
 void plat_early_init(void)\r
@@ -571,7 +579,7 @@ void plat_init(void)
        oshide_init();\r
 \r
        w = h = 0;\r
-       main_fb = vout_fbdev_init(main_fb_name, &w, &h, 0);\r
+       main_fb = vout_fbdev_init(main_fb_name, &w, &h, 16, 2);\r
        if (main_fb == NULL) {\r
                fprintf(stderr, "couldn't init fb: %s\n", main_fb_name);\r
                exit(1);\r
@@ -582,7 +590,7 @@ void plat_init(void)
        g_menuscreen_ptr = vout_fbdev_flip(main_fb);\r
 \r
        w = 320; h = 240;\r
-       layer_fb = vout_fbdev_init(layer_fb_name, &w, &h, 0);\r
+       layer_fb = vout_fbdev_init(layer_fb_name, &w, &h, 16, 3);\r
        if (layer_fb == NULL) {\r
                fprintf(stderr, "couldn't init fb: %s\n", layer_fb_name);\r
                goto fail0;\r