2013-07-27 15:40:21 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 00:50:59 +00:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
|
|
|
* Copyright (C) 2011-2014 - Daniel De Matteis
|
|
|
|
* Copyright (C) 2012-2014 - Jason Fetters
|
2013-07-27 15:40:21 +00:00
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
2013-07-27 15:45:56 +00:00
|
|
|
* * You should have received a copy of the GNU General Public License along with RetroArch.
|
2013-07-27 15:40:21 +00:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2013-12-22 00:42:10 +00:00
|
|
|
#include "../menu/menu_common.h"
|
2013-09-05 05:20:56 +00:00
|
|
|
#include "../../apple/common/rarch_wrapper.h"
|
2013-11-22 00:10:35 +00:00
|
|
|
#include "../../apple/common/apple_export.h"
|
2013-11-29 18:31:39 +00:00
|
|
|
#include "../../apple/common/setting_data.h"
|
2013-07-28 21:01:16 +00:00
|
|
|
|
|
|
|
#include "../frontend_context.h"
|
2013-07-27 15:40:21 +00:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "../../boolean.h"
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2013-12-22 02:58:19 +00:00
|
|
|
extern bool apple_is_running;
|
2013-07-27 15:40:21 +00:00
|
|
|
|
2013-12-22 00:42:10 +00:00
|
|
|
void apple_event_basic_command(enum basic_event_t action)
|
2013-07-27 15:40:21 +00:00
|
|
|
{
|
2013-11-22 00:10:35 +00:00
|
|
|
switch (action)
|
2013-11-21 23:57:39 +00:00
|
|
|
{
|
|
|
|
case RESET:
|
|
|
|
rarch_game_reset();
|
|
|
|
return;
|
|
|
|
case LOAD_STATE:
|
|
|
|
rarch_load_state();
|
|
|
|
return;
|
|
|
|
case SAVE_STATE:
|
|
|
|
rarch_save_state();
|
|
|
|
return;
|
|
|
|
case QUIT:
|
|
|
|
g_extern.system.shutdown = true;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-28 20:08:30 +00:00
|
|
|
void apple_refresh_config(void)
|
2013-11-22 00:10:35 +00:00
|
|
|
{
|
2013-12-22 00:42:10 +00:00
|
|
|
// Little nudge to prevent stale values when reloading the confg file
|
2013-11-22 00:10:35 +00:00
|
|
|
g_extern.block_config_read = false;
|
|
|
|
memset(g_settings.input.overlay, 0, sizeof(g_settings.input.overlay));
|
|
|
|
memset(g_settings.video.shader_path, 0, sizeof(g_settings.video.shader_path));
|
|
|
|
|
2013-12-22 02:58:19 +00:00
|
|
|
if (apple_is_running)
|
2013-11-21 23:57:39 +00:00
|
|
|
{
|
2013-12-22 00:42:10 +00:00
|
|
|
uninit_drivers();
|
|
|
|
config_load();
|
|
|
|
init_drivers();
|
2013-11-21 23:57:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-22 00:42:10 +00:00
|
|
|
int apple_rarch_load_content(int argc, char* argv[])
|
2013-07-27 15:40:21 +00:00
|
|
|
{
|
2013-12-22 00:42:10 +00:00
|
|
|
rarch_main_clear_state();
|
|
|
|
rarch_init_msg_queue();
|
|
|
|
|
|
|
|
if (rarch_main_init(argc, argv))
|
|
|
|
return 1;
|
|
|
|
|
2014-03-28 15:10:55 +00:00
|
|
|
menu_init();
|
2013-12-26 20:28:51 +00:00
|
|
|
|
|
|
|
if (!g_extern.libretro_dummy)
|
|
|
|
menu_rom_history_push_current();
|
|
|
|
|
2013-12-22 00:42:10 +00:00
|
|
|
g_extern.lifecycle_state |= 1ULL << MODE_GAME;
|
|
|
|
|
2013-11-22 00:36:35 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-07-27 15:40:21 +00:00
|
|
|
const frontend_ctx_driver_t frontend_ctx_apple = {
|
2013-08-14 04:48:58 +00:00
|
|
|
NULL, /* environment_get */
|
2013-07-27 15:40:21 +00:00
|
|
|
NULL, /* init */
|
|
|
|
NULL, /* deinit */
|
|
|
|
NULL, /* exitspawn */
|
|
|
|
NULL, /* process_args */
|
2013-12-22 00:42:10 +00:00
|
|
|
NULL, /* process_events */
|
2013-07-27 15:40:21 +00:00
|
|
|
NULL, /* exec */
|
2013-12-22 00:42:10 +00:00
|
|
|
NULL, /* shutdown */
|
2013-07-27 15:40:21 +00:00
|
|
|
"apple",
|
|
|
|
};
|