\r
#define PICO_PEN_ADJUST_X 4\r
#define PICO_PEN_ADJUST_Y 2\r
-static int pico_pen_x = 320/2, pico_pen_y = 240/2, pico_inp_mode = 0;\r
+static int pico_pen_x = 320/2, pico_pen_y = 240/2;\r
\r
static void emu_msg_cb(const char *msg);\r
static void emu_msg_tray_open(void);\r
void emu_prepareDefaultConfig(void)\r
{\r
memset(&defaultConfig, 0, sizeof(defaultConfig));\r
- defaultConfig.EmuOpt = 0x1d | 0x00700; // | <- ram_tmng, confirm_save, cd_leds\r
+ defaultConfig.EmuOpt = 0x9d | 0x00700; // | <- ram_tmng, confirm_save, cd_leds\r
defaultConfig.s_PicoOpt = 0x0f | POPT_EXT_FM|POPT_EN_MCD_PCM|POPT_EN_MCD_CDDA|POPT_EN_SVP_DRC|POPT_ACC_SPRITES;\r
defaultConfig.s_PsndRate = 44100;\r
defaultConfig.s_PicoRegion = 0; // auto\r
\r
static void RunEventsPico(unsigned int events, unsigned int gp2x_keys)\r
{\r
- if (events & (1 << 3)) {\r
- pico_inp_mode++;\r
- if (pico_inp_mode > 2) pico_inp_mode = 0;\r
- switch (pico_inp_mode) {\r
- case 2: strcpy(noticeMsg, "Input: Pen on Pad "); break;\r
- case 1: strcpy(noticeMsg, "Input: Pen on Storyware"); break;\r
- case 0: strcpy(noticeMsg, "Input: Joytick ");\r
- PicoPicohw.pen_pos[0] = PicoPicohw.pen_pos[1] = 0x8000;\r
- break;\r
- }\r
- gettimeofday(¬iceMsgTime, 0);\r
- }\r
- if (events & (1 << 4)) {\r
- PicoPicohw.page--;\r
- if (PicoPicohw.page < 0) PicoPicohw.page = 0;\r
- sprintf(noticeMsg, "Page %i ", PicoPicohw.page);\r
- gettimeofday(¬iceMsgTime, 0);\r
- }\r
- if (events & (1 << 5)) {\r
- PicoPicohw.page++;\r
- if (PicoPicohw.page > 6) PicoPicohw.page = 6;\r
- sprintf(noticeMsg, "Page %i ", PicoPicohw.page);\r
- gettimeofday(¬iceMsgTime, 0);\r
- }\r
- if (pico_inp_mode != 0) {\r
+ int ret, px, py;\r
+ static int pdown_frames = 0;\r
+\r
+ emu_RunEventsPico(events);\r
+\r
+ if (pico_inp_mode != 0)\r
+ {\r
PicoPad[0] &= ~0x0f; // release UDLR\r
- if (gp2x_keys & GP2X_UP) { pico_pen_y--; if (pico_pen_y < 0) pico_pen_y = 0; }\r
- if (gp2x_keys & GP2X_DOWN) { pico_pen_y++; if (pico_pen_y > 239-PICO_PEN_ADJUST_Y) pico_pen_y = 239-PICO_PEN_ADJUST_Y; }\r
+ if (gp2x_keys & GP2X_UP) { pico_pen_y--; if (pico_pen_y < 8) pico_pen_y = 8; }\r
+ if (gp2x_keys & GP2X_DOWN) { pico_pen_y++; if (pico_pen_y > 224-PICO_PEN_ADJUST_Y) pico_pen_y = 224-PICO_PEN_ADJUST_Y; }\r
if (gp2x_keys & GP2X_LEFT) { pico_pen_x--; if (pico_pen_x < 0) pico_pen_x = 0; }\r
if (gp2x_keys & GP2X_RIGHT) {\r
int lim = (Pico.video.reg[12]&1) ? 319 : 255;\r
PicoPicohw.pen_pos[0] += 0x3c;\r
PicoPicohw.pen_pos[1] = pico_inp_mode == 1 ? (0x2f8 + pico_pen_y) : (0x1fc + pico_pen_y);\r
}\r
+\r
+ // for F200\r
+ ret = gp2x_touchpad_read(&px, &py);\r
+ if (ret >= 0) {\r
+ if (ret > 5000) {\r
+ if (pdown_frames++ > 5)\r
+ PicoPad[0] |= 0x20;\r
+\r
+ pico_pen_x = px;\r
+ pico_pen_y = py;\r
+ if (!(Pico.video.reg[12]&1)) {\r
+ pico_pen_x -= 32;\r
+ if (pico_pen_x < 0) pico_pen_x = 0;\r
+ if (pico_pen_x > 248) pico_pen_x = 248;\r
+ }\r
+ if (pico_pen_y > 224) pico_pen_y = 224;\r
+ }\r
+ else\r
+ pdown_frames= 0;\r
+\r
+ //if (ret == 0)\r
+ // PicoPicohw.pen_pos[0] = PicoPicohw.pen_pos[1] = 0x8000;\r
+ }\r
}\r
\r
static void update_volume(int has_changed, int is_up)\r
}\r
}\r
\r
-static void change_fast_forward(int set_on)\r
-{\r
- static void *set_PsndOut = NULL;\r
- static int set_Frameskip, set_EmuOpt, is_on = 0;\r
-\r
- if (set_on && !is_on) {\r
- set_PsndOut = PsndOut;\r
- set_Frameskip = currentConfig.Frameskip;\r
- set_EmuOpt = currentConfig.EmuOpt;\r
- PsndOut = NULL;\r
- currentConfig.Frameskip = 8;\r
- currentConfig.EmuOpt &= ~4;\r
- is_on = 1;\r
- }\r
- else if (!set_on && is_on) {\r
- PsndOut = set_PsndOut;\r
- currentConfig.Frameskip = set_Frameskip;\r
- currentConfig.EmuOpt = set_EmuOpt;\r
- PsndRerate(1);\r
- update_volume(0, 0);\r
- reset_timing = 1;\r
- is_on = 0;\r
- }\r
-}\r
-\r
static void RunEvents(unsigned int which)\r
{\r
if (which & 0x1800) // save or load (but not both)\r
if (events & 0x6000)\r
update_volume(1, events & 0x2000);\r
\r
- if ((events ^ prevEvents) & 0x40)\r
- change_fast_forward(events & 0x40);\r
+ if ((events ^ prevEvents) & 0x40) {\r
+ emu_changeFastForward(events & 0x40);\r
+ update_volume(0, 0);\r
+ reset_timing = 1;\r
+ }\r
\r
events &= ~prevEvents;\r
\r
if (PicoAHW == PAHW_PICO)\r
RunEventsPico(events, keys);\r
-\r
if (events) RunEvents(events);\r
if (movie_data) emu_updateMovie();\r
\r
frames_done++; frames_shown++;\r
}\r
\r
- change_fast_forward(0);\r
+ emu_changeFastForward(0);\r
\r
if (PicoAHW & PAHW_MCD) PicoCDBufferFree();\r
\r