FAMEC idle loops, PSP port sync, minor adjustments

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@525 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2008-07-05 23:10:24 +00:00
parent b06778874d
commit c060a9ab9c
23 changed files with 408 additions and 155 deletions

View file

@ -55,7 +55,7 @@ int reset_timing = 0;
#define PICO_PEN_ADJUST_X 4
#define PICO_PEN_ADJUST_Y 2
static int pico_pen_x = 320/2, pico_pen_y = 240/2, pico_inp_mode = 0;
static int pico_pen_x = 320/2, pico_pen_y = 240/2;
static void emu_msg_cb(const char *msg);
static void emu_msg_tray_open(void);
@ -436,31 +436,10 @@ static void emu_msg_tray_open(void)
static void RunEventsPico(unsigned int events, unsigned int gp2x_keys)
{
if (events & (1 << 3)) {
pico_inp_mode++;
if (pico_inp_mode > 2) pico_inp_mode = 0;
switch (pico_inp_mode) {
case 2: strcpy(noticeMsg, "Input: Pen on Pad "); break;
case 1: strcpy(noticeMsg, "Input: Pen on Storyware"); break;
case 0: strcpy(noticeMsg, "Input: Joytick ");
PicoPicohw.pen_pos[0] = PicoPicohw.pen_pos[1] = 0x8000;
break;
}
gettimeofday(&noticeMsgTime, 0);
}
if (events & (1 << 4)) {
PicoPicohw.page--;
if (PicoPicohw.page < 0) PicoPicohw.page = 0;
sprintf(noticeMsg, "Page %i ", PicoPicohw.page);
gettimeofday(&noticeMsgTime, 0);
}
if (events & (1 << 5)) {
PicoPicohw.page++;
if (PicoPicohw.page > 6) PicoPicohw.page = 6;
sprintf(noticeMsg, "Page %i ", PicoPicohw.page);
gettimeofday(&noticeMsgTime, 0);
}
if (pico_inp_mode != 0) {
emu_RunEventsPico(events);
if (pico_inp_mode != 0)
{
PicoPad[0] &= ~0x0f; // release UDLR
if (gp2x_keys & GP2X_UP) { pico_pen_y--; if (pico_pen_y < 0) pico_pen_y = 0; }
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; }
@ -512,31 +491,6 @@ static void update_volume(int has_changed, int is_up)
}
}
static void change_fast_forward(int set_on)
{
static void *set_PsndOut = NULL;
static int set_Frameskip, set_EmuOpt, is_on = 0;
if (set_on && !is_on) {
set_PsndOut = PsndOut;
set_Frameskip = currentConfig.Frameskip;
set_EmuOpt = currentConfig.EmuOpt;
PsndOut = NULL;
currentConfig.Frameskip = 8;
currentConfig.EmuOpt &= ~4;
is_on = 1;
}
else if (!set_on && is_on) {
PsndOut = set_PsndOut;
currentConfig.Frameskip = set_Frameskip;
currentConfig.EmuOpt = set_EmuOpt;
PsndRerate(1);
update_volume(0, 0);
reset_timing = 1;
is_on = 0;
}
}
static void RunEvents(unsigned int which)
{
if (which & 0x1800) // save or load (but not both)
@ -668,14 +622,16 @@ static void updateKeys(void)
if (events & 0x6000)
update_volume(1, events & 0x2000);
if ((events ^ prevEvents) & 0x40)
change_fast_forward(events & 0x40);
if ((events ^ prevEvents) & 0x40) {
emu_changeFastForward(events & 0x40);
update_volume(0, 0);
reset_timing = 1;
}
events &= ~prevEvents;
if (PicoAHW == PAHW_PICO)
RunEventsPico(events, keys);
if (events) RunEvents(events);
if (movie_data) emu_updateMovie();
@ -1044,7 +1000,7 @@ void emu_Loop(void)
frames_done++; frames_shown++;
}
change_fast_forward(0);
emu_changeFastForward(0);
if (PicoAHW & PAHW_MCD) PicoCDBufferFree();

View file

@ -432,8 +432,8 @@ rescan:
// ------------ debug menu ------------
char *debugString(void);
void PicoDrawShowSpriteStats(unsigned short *screen);
void PicoDrawShowPalette(unsigned short *screen);
void PicoDrawShowSpriteStats(unsigned short *screen, int stride);
void PicoDrawShowPalette(unsigned short *screen, int stride);
static void draw_main_debug(void)
{
@ -477,8 +477,10 @@ static void debug_menu_loop(void)
{
case 0: draw_main_debug(); break;
case 1: draw_frame_debug(); break;
case 2: PicoDrawShowSpriteStats(gp2x_screen); break;
case 3: PicoDrawShowPalette(gp2x_screen); break;
case 2: gp2x_pd_clone_buffer2();
PicoDrawShowSpriteStats(gp2x_screen, 320); break;
case 3: memset(gp2x_screen, 0, 320*240*2);
PicoDrawShowPalette(gp2x_screen, 320); break;
}
menu_flip();
@ -1186,7 +1188,7 @@ menu_entry opt_entries[] =
{
{ NULL, MB_NONE, MA_OPT_RENDERER, NULL, 0, 0, 0, 1, 1 },
{ NULL, MB_RANGE, MA_OPT_SCALING, &currentConfig.scaling, 0, 0, 3, 1, 1 },
{ "Accurate sprites (slower)", MB_ONOFF, MA_OPT_ACC_SPRITES, &PicoOpt, 0x080, 0, 0, 0, 1 },
{ "Accurate sprites", MB_ONOFF, MA_OPT_ACC_SPRITES, &PicoOpt, 0x080, 0, 0, 0, 1 },
{ "Show FPS", MB_ONOFF, MA_OPT_SHOW_FPS, &currentConfig.EmuOpt, 0x002, 0, 0, 1, 1 },
{ NULL, MB_RANGE, MA_OPT_FRAMESKIP, &currentConfig.Frameskip, 0, -1, 16, 1, 1 },
{ "Enable sound", MB_ONOFF, MA_OPT_ENABLE_SOUND, &currentConfig.EmuOpt, 0x004, 0, 0, 1, 1 },