Example #1
0
static void
psp_settings_menu_save()
{
    int error;

    psp_settings_menu_validate();
    error = atari_save_settings();

    if (! error) /* save OK */
    {
        psp_display_screen_settings_menu();
        psp_sdl_back2_print(170, 110, "File saved !",
                            PSP_MENU_NOTE_COLOR);
        psp_sdl_flip();
        sleep(1);
    }
    else
    {
        psp_display_screen_settings_menu();
        psp_sdl_back2_print(170, 110, "Can't save file !",
                            PSP_MENU_WARNING_COLOR);
        psp_sdl_flip();
        sleep(1);
    }
}
Example #2
0
static void
psp_settings_menu_load(int format)
{
  int ret;

  ret = psp_fmgr_menu(format);
  if (ret ==  1) /* load OK */
  {
    psp_display_screen_settings_menu();
    psp_sdl_back2_print(170, 110, "File loaded !", 
                       PSP_MENU_NOTE_COLOR);
    psp_sdl_flip();
    sleep(1);
    psp_settings_menu_init();
  }
  else 
  if (ret == -1) /* Load Error */
  {
    psp_display_screen_settings_menu();
    psp_sdl_back2_print(170, 110, "Can't load file !", 
                       PSP_MENU_WARNING_COLOR);
    psp_sdl_flip();
    sleep(1);
  }
}
Example #3
0
void
psp_settings_menu_reset(void)
{
    psp_display_screen_settings_menu();
    psp_sdl_back2_print(170,110, "Reset Settings !",
                        PSP_MENU_WARNING_COLOR);
    psp_sdl_flip();
    atari_default_settings();
    psp_settings_menu_init();
    sleep(1);
}
Example #4
0
int
psp_settings_menu_exit(void)
{
    gp2xCtrlData c;

    psp_display_screen_settings_menu();
    psp_sdl_back2_print(170, 110, "press B to confirm !", PSP_MENU_WARNING_COLOR);
    psp_sdl_flip();

    psp_kbd_wait_no_button();

    do
    {
        gp2xCtrlReadBufferPositive(&c, 1);
        c.Buttons &= PSP_ALL_BUTTON_MASK;

        if (c.Buttons & GP2X_CTRL_CROSS) psp_sdl_exit(0);

    } while (c.Buttons == 0);

    psp_kbd_wait_no_button();

    return 0;
}
Example #5
0
int
psp_settings_menu(void)
{
    gp2xCtrlData c;
    long        new_pad;
    long        old_pad;
    int         last_time;
    int         end_menu;

    psp_kbd_wait_no_button();

    old_pad   = 0;
    last_time = 0;
    end_menu  = 0;

    psp_settings_menu_init();

    while (! end_menu)
    {
        psp_display_screen_settings_menu();
        psp_sdl_flip();

        while (1)
        {
            gp2xCtrlReadBufferPositive(&c, 1);
            c.Buttons &= PSP_ALL_BUTTON_MASK;

            if (c.Buttons) break;
        }

        new_pad = c.Buttons;

        if ((old_pad != new_pad) || ((c.TimeStamp - last_time) > PSP_MENU_MIN_TIME)) {
            last_time = c.TimeStamp;
            old_pad = new_pad;

        } else continue;

        if ((c.Buttons & GP2X_CTRL_RTRIGGER) == GP2X_CTRL_RTRIGGER) {
            psp_settings_menu_reset();
            end_menu = 1;
        } else if ((new_pad == GP2X_CTRL_LEFT ) ||
                   (new_pad == GP2X_CTRL_RIGHT) ||
                   (new_pad == GP2X_CTRL_CROSS) ||
                   (new_pad == GP2X_CTRL_CIRCLE))
        {
            int step = 0;

            if (new_pad & GP2X_CTRL_RIGHT) {
                step = 1;
            } else if (new_pad & GP2X_CTRL_LEFT) {
                step = -1;
            }

            switch (cur_menu_id )
            {
            case MENU_SET_SOUND      :
                atari_snd_enable = ! atari_snd_enable;
                break;
            case MENU_SET_SPEED_LIMIT :
                psp_settings_menu_limiter( step );
                break;
            case MENU_SET_SKIP_FPS   :
                psp_settings_menu_skip_fps( step );
                break;
            case MENU_SET_FLICKER_MODE :
                psp_settings_menu_flicker( step );
                break;
            case MENU_SET_VIEW_FPS   :
                atari_view_fps = ! atari_view_fps;
                break;
            case MENU_SET_RENDER     :
                psp_settings_menu_render( step );
                break;
#if !defined(GCW0_MODE)
            case MENU_SET_CLOCK      :
                psp_settings_menu_clock( step );
                break;
#endif
            case MENU_SET_LOAD       :
                psp_settings_menu_load(FMGR_FORMAT_SET);
                old_pad = new_pad = 0;
                break;
            case MENU_SET_SAVE       :
                psp_settings_menu_save();
                old_pad = new_pad = 0;
                break;
            case MENU_SET_RESET      :
                psp_settings_menu_reset();
                break;

            case MENU_SET_BACK       :
                end_menu = 1;
                break;
            }

        } else if(new_pad & GP2X_CTRL_UP) {

            if (cur_menu_id > 0) cur_menu_id--;
            else                 cur_menu_id = MAX_MENU_SET_ITEM-1;

        } else if(new_pad & GP2X_CTRL_DOWN) {

            if (cur_menu_id < (MAX_MENU_SET_ITEM-1)) cur_menu_id++;
            else                                     cur_menu_id = 0;

        } else if(new_pad & GP2X_CTRL_SQUARE) {
            /* Cancel */
            end_menu = -1;
        } else if(new_pad & GP2X_CTRL_SELECT) {
            /* Back to ATARI */
            end_menu = 1;
        }
    }

    if (end_menu > 0) {
        psp_settings_menu_validate();
    }

    psp_kbd_wait_no_button();

    psp_sdl_clear_screen( PSP_MENU_BLACK_COLOR );
    psp_sdl_flip();
    psp_sdl_clear_screen( PSP_MENU_BLACK_COLOR );
    psp_sdl_flip();

    return 1;
}