Example #1
0
void retro_reset(void)
{
   deinit_context_switch();

   update_backup();
   reset_gba();

   init_context_switch();
}
Example #2
0
 void menu_restart()
 {
   if(!first_load)
   {
     reset_gba();
     reg[CHANGED_PC_STATUS] = 1;
     return_value = 1;
     repeat = 0;
   }
 }
Example #3
0
 void menu_load()
 {
   u8 *file_ext[] = { ".gba", ".bin", ".zip", NULL };
   u8 load_filename[512];
   save_game_config_file();
   if(load_file(file_ext, load_filename) != -1)
   {
      if(load_gamepak(load_filename) == -1)
      {
        quit();
      }
      reset_gba();
      return_value = 1;
      repeat = 0;
      reg[CHANGED_PC_STATUS] = 1;
   }
   else
   {
     choose_menu(current_menu);
   }
 }
Example #4
0
File: gui.c Project: pcercuei/ReGBA
static void ActionReset(struct Menu** ActiveMenu, uint32_t* ActiveMenuEntryIndex)
{
	reset_gba();
	reg[CHANGED_PC_STATUS] = 1;
	*ActiveMenu = NULL;
}
Example #5
0
bool retro_load_game(const struct retro_game_info *info)
{
   char filename_bios[MAX_PATH];
   const char *dir = NULL;

   struct retro_input_descriptor desc[] = {
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT,  "D-Pad Left" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP,    "D-Pad Up" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN,  "D-Pad Down" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT, "D-Pad Right" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B,     "B" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A,     "A" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L,     "L" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R,     "R" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT, "Select" },
      { 0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START, "Start" },

      { 0 },
   };

   if (!info)
      return false;

   environ_cb(RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS, desc);

   enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
   if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
   {
      if (log_cb)
         log_cb(RETRO_LOG_INFO, "[TempGBA]: 0RGB1555 is not supported.\n");
      return false;
   }

   extract_directory(main_path,info->path,sizeof(main_path));

   if (environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir) && dir)
      strncpy(filename_bios, dir, sizeof(filename_bios));
   else
      strncpy(filename_bios, main_path, sizeof(filename_bios));

   strncat(filename_bios, "/gba_bios.bin",sizeof(filename_bios));


   if (environ_cb(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &dir) && dir)
      strncpy(dir_save, dir, sizeof(dir_save));
   else
      strncpy(dir_save, main_path, sizeof(dir_save));

   strncat(dir_save, "/",sizeof(dir_save));

   strncat(main_path, "/",sizeof(main_path));

   if (load_bios(filename_bios) < 0)
   {
     error_msg("Could not load BIOS image file.\n");
     return false;
   }

   gamepak_filename[0] = 0;

   if (load_gamepak(info->path) < 0)
   {
     error_msg("Could not load the game file.\n");
     return false;
   }

   reset_gba();

   init_context_switch();

   return true;
}