RetroArch/frontend/platform/platform_apple.c

94 lines
2.7 KiB
C
Raw Normal View History

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.
* * 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/>.
*/
#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"
#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>
extern bool apple_is_running;
2013-07-27 15:40:21 +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)
{
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;
}
}
void apple_refresh_config(void)
2013-11-22 00:10:35 +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));
if (apple_is_running)
{
uninit_drivers();
config_load();
init_drivers();
}
}
int apple_rarch_load_content(int argc, char* argv[])
2013-07-27 15:40:21 +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();
if (!g_extern.libretro_dummy)
menu_rom_history_push_current();
g_extern.lifecycle_state |= 1ULL << MODE_GAME;
return 0;
}
2013-07-27 15:40:21 +00:00
const frontend_ctx_driver_t frontend_ctx_apple = {
NULL, /* environment_get */
2013-07-27 15:40:21 +00:00
NULL, /* init */
NULL, /* deinit */
NULL, /* exitspawn */
NULL, /* process_args */
NULL, /* process_events */
2013-07-27 15:40:21 +00:00
NULL, /* exec */
NULL, /* shutdown */
2013-07-27 15:40:21 +00:00
"apple",
};