Esempio n. 1
0
void
psp_display_screen_menu(void)
{
  char buffer[64];
  int menu_id = 0;
  int slot_id = 0;
  int color   = 0;
  int x       = 0;
  int y       = 0;
  int y_step  = 0;

  psp_sdl_blit_background();

  x      = 10;
  y      =  5;
  y_step = 10;

  for (menu_id = 0; menu_id < MAX_MENU_ITEM; menu_id++) {
    color = PSP_MENU_TEXT_COLOR;
    if (cur_menu_id == menu_id) color = PSP_MENU_SEL_COLOR;
    else
    if (menu_id == MENU_EXIT) color = PSP_MENU_WARNING_COLOR;
    else
    if (menu_id == MENU_HELP) color = PSP_MENU_GREEN_COLOR;

    if (menu_id == MENU_EDITOR) {
      if (ATARI.comment_present) {
        psp_sdl_back2_print(x, y, "View comment", color);
      } else {
        psp_sdl_back2_print(x, y, "New comment", color);
      }

    } else {
      psp_sdl_back2_print(x, y, menu_list[menu_id].title, color);
    }

    if (menu_id == MENU_SCREENSHOT) {
      sprintf(buffer,"%d", ATARI.psp_screenshot_id);
      string_fill_with_space(buffer, 4);
      psp_sdl_back2_print(120, y, buffer, color);
#if defined(GCW0_MODE)
      y += y_step;
#endif;
    } else
#if !defined(GCW0_MODE)
    if (menu_id == MENU_VOLUME) {
      sprintf(buffer,"%d", gp2xGetSoundVolume());
      string_fill_with_space(buffer, 4);
      psp_sdl_back2_print(120, y, buffer, color);
      y += y_step;
    } else
#endif
    if (menu_id == MENU_DEL_SLOT) {
      y += y_step;
    } else
    if (menu_id == MENU_SETTINGS) {
      y += y_step;
    } else
    if (menu_id == MENU_BACK) {
      y += y_step;
    } else
    if (menu_id == MENU_LOAD_ROM) {
      y += y_step;
    } else
    if (menu_id == MENU_CHEATS) {
    } else
    if (menu_id == MENU_HELP) {
      y += y_step;
    }

    y += y_step;
  }
  y_step = 10;
  y      = 20;

  for (slot_id = 0; slot_id < ATARI_MAX_SAVE_STATE; slot_id++) {
    if (slot_id == cur_slot) color = PSP_MENU_SEL2_COLOR;
    else                     color = PSP_MENU_TEXT_COLOR;

    if (ATARI.atari_save_state[slot_id].used) {
# if defined(LINUX_MODE) || defined(WIZ_MODE)
      struct tm *my_date = localtime(& ATARI.atari_save_state[slot_id].date);
      sprintf(buffer, "- %02d/%02d %02d:%02d:%02d",
         my_date->tm_mday, my_date->tm_mon,
         my_date->tm_hour, my_date->tm_min, my_date->tm_sec );
# else
      sprintf(buffer, "- used");
# endif
    } else {
      sprintf(buffer, "- empty");
    }
    string_fill_with_space(buffer, 32);
    psp_sdl_back2_print(100, y, buffer, color);

    y += y_step;
  }

  if (ATARI.atari_save_state[cur_slot].thumb) {
    psp_sdl_blit_thumb(170,125, ATARI.atari_save_state[cur_slot].surface);
  } else {
    psp_sdl_blit_thumb(170,125, thumb_surface);
  }

  psp_menu_display_save_name();
}
Esempio n. 2
0
void 
psp_display_screen_menu(void)
{
  char buffer[64];
  int menu_id = 0;
  int slot_id = 0;
  int color   = 0;
  int x       = 0;
  int y       = 0;
  int y_step  = 0;

  psp_sdl_blit_background();
  
  x      = 10;
  y      =  5;
  y_step = 10;
  
  for (menu_id = 0; menu_id < MAX_MENU_ITEM; menu_id++) {
    color = PSP_MENU_TEXT_COLOR;
    if (cur_menu_id == menu_id) color = PSP_MENU_SEL_COLOR;
    else 
    if (menu_id == MENU_EXIT) color = PSP_MENU_WARNING_COLOR;
    else
    if (menu_id == MENU_HELP) color = PSP_MENU_GREEN_COLOR;

    if (menu_id == MENU_COMMAND) {
      strcpy(buffer, menu_list[menu_id].title);
      strcat(buffer, command_name[cur_command]);
      string_fill_with_space(buffer, 25);
      psp_sdl_back2_print(x, y, buffer, color);
    }
    else
    if (menu_id == MENU_EDITOR) {
      if (CPC.comment_present) {
        psp_sdl_back2_print(x, y, "View comment", color);
      } else {
        psp_sdl_back2_print(x, y, "New comment", color);
      }

    } else {
      psp_sdl_back2_print(x, y, menu_list[menu_id].title, color);
    }

    if (menu_id == MENU_SCREENSHOT) {
      sprintf(buffer,"%d", CPC.psp_screenshot_id);
      string_fill_with_space(buffer, 4);
      psp_sdl_back2_print(120, y, buffer, color);
      y += y_step;
    } else
    if (menu_id == MENU_DEL_SLOT) {
      //y += y_step;
    } else
    if (menu_id == MENU_LOAD_DSKB) {
      y += y_step;
    } else
    if (menu_id == MENU_COMMAND) {
      //y += y_step;
    } else
    if (menu_id == MENU_SETTINGS) {
      //y += y_step;
    } else
    if (menu_id == MENU_BACK) {
      y += y_step;
    } else
    if (menu_id == MENU_HELP) {
      y += y_step;
    }
    y += y_step;
  }
  y_step = 10;
  y      = 25;

  for (slot_id = 0; slot_id < CPC_MAX_SAVE_STATE; slot_id++) {
    if (slot_id == cur_slot) color = PSP_MENU_SEL2_COLOR;
    else                     color = PSP_MENU_TEXT_COLOR;

    if (CPC.cpc_save_state[slot_id].used) {
# if defined(LINUX_MODE) || defined(WIZ_MODE)
      struct tm *my_date = localtime(& CPC.cpc_save_state[slot_id].date);
      sprintf(buffer, "- %02d/%02d %02d:%02d:%02d",
         my_date->tm_mday, my_date->tm_mon, 
         my_date->tm_hour, my_date->tm_min, my_date->tm_sec );
# else
      sprintf(buffer, "- used");
# endif
    } else {
      sprintf(buffer, "- empty");
    }
    string_fill_with_space(buffer, 32);
    psp_sdl_back2_print(105, y, buffer, color);

    y += y_step;
  }

  if (CPC.cpc_save_state[cur_slot].thumb) {
    psp_sdl_blit_thumb(180, 135, CPC.cpc_save_state[cur_slot].surface);
  } else {
    psp_sdl_blit_thumb(180, 135, thumb_surface);
  }

  psp_menu_display_save_name();
}