2013-12-19 17:10:14 +00:00
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#if HOST_OS==OS_LINUX
|
|
|
|
#include "hw/sh4/dyna/blockmanager.h"
|
2019-06-30 19:06:46 +00:00
|
|
|
#include "log/LogManager.h"
|
2020-04-20 16:52:02 +00:00
|
|
|
#include "emulator.h"
|
2020-03-28 16:58:01 +00:00
|
|
|
|
|
|
|
#include <cstdarg>
|
|
|
|
#include <csignal>
|
2013-12-19 17:10:14 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
|
2016-03-02 05:48:34 +00:00
|
|
|
#if defined(SUPPORT_DISPMANX)
|
2019-09-07 12:37:39 +00:00
|
|
|
#include "dispmanx.h"
|
2016-03-02 05:48:34 +00:00
|
|
|
#endif
|
|
|
|
|
2015-08-11 23:57:29 +00:00
|
|
|
#if defined(SUPPORT_X11)
|
2019-09-07 12:37:39 +00:00
|
|
|
#include "x11.h"
|
2013-12-19 17:10:14 +00:00
|
|
|
#endif
|
|
|
|
|
2015-08-29 18:23:16 +00:00
|
|
|
#if defined(USE_SDL)
|
|
|
|
#include "sdl/sdl.h"
|
|
|
|
#endif
|
|
|
|
|
2020-05-08 16:41:36 +00:00
|
|
|
#include <sys/stat.h>
|
2013-12-19 17:10:14 +00:00
|
|
|
|
2015-08-15 01:23:11 +00:00
|
|
|
#if defined(USE_EVDEV)
|
2019-09-07 12:37:39 +00:00
|
|
|
#include "evdev.h"
|
2015-08-15 01:23:11 +00:00
|
|
|
#endif
|
|
|
|
|
2015-08-12 01:03:01 +00:00
|
|
|
#if defined(USE_JOYSTICK)
|
2020-03-28 16:58:01 +00:00
|
|
|
#include "cfg/cfg.h"
|
2019-09-07 12:37:39 +00:00
|
|
|
#include "joystick.h"
|
2015-08-12 01:03:01 +00:00
|
|
|
#endif
|
|
|
|
|
2015-08-12 01:40:09 +00:00
|
|
|
#if defined(USE_JOYSTICK)
|
2015-08-17 21:46:28 +00:00
|
|
|
/* legacy joystick input */
|
|
|
|
static int joystick_fd = -1; // Joystick file descriptor
|
2015-08-12 01:40:09 +00:00
|
|
|
#endif
|
|
|
|
|
2018-08-20 11:36:34 +00:00
|
|
|
void os_SetupInput()
|
2015-08-12 01:40:09 +00:00
|
|
|
{
|
2018-09-24 16:56:24 +00:00
|
|
|
#if defined(USE_EVDEV)
|
|
|
|
input_evdev_init();
|
|
|
|
#endif
|
2015-08-17 21:46:28 +00:00
|
|
|
|
2018-09-24 16:56:24 +00:00
|
|
|
#if defined(USE_JOYSTICK)
|
|
|
|
int joystick_device_id = cfgLoadInt("input", "joystick_device_id", JOYSTICK_DEFAULT_DEVICE_ID);
|
|
|
|
if (joystick_device_id < 0) {
|
2019-06-30 19:06:46 +00:00
|
|
|
INFO_LOG(INPUT, "Legacy Joystick input disabled by config.");
|
2018-09-24 16:56:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int joystick_device_length = snprintf(NULL, 0, JOYSTICK_DEVICE_STRING, joystick_device_id);
|
|
|
|
char* joystick_device = (char*)malloc(joystick_device_length + 1);
|
|
|
|
sprintf(joystick_device, JOYSTICK_DEVICE_STRING, joystick_device_id);
|
|
|
|
joystick_fd = input_joystick_init(joystick_device);
|
|
|
|
free(joystick_device);
|
|
|
|
}
|
|
|
|
#endif
|
2015-08-17 21:46:28 +00:00
|
|
|
|
2018-09-24 16:56:24 +00:00
|
|
|
#if defined(SUPPORT_X11)
|
|
|
|
input_x11_init();
|
|
|
|
#endif
|
2015-08-29 18:23:16 +00:00
|
|
|
|
2018-09-24 16:56:24 +00:00
|
|
|
#if defined(USE_SDL)
|
|
|
|
input_sdl_init();
|
|
|
|
#endif
|
2013-12-19 17:10:14 +00:00
|
|
|
}
|
|
|
|
|
2020-12-02 13:40:50 +00:00
|
|
|
void UpdateInputState()
|
2013-12-19 17:10:14 +00:00
|
|
|
{
|
2015-08-17 21:46:28 +00:00
|
|
|
#if defined(USE_JOYSTICK)
|
2020-12-02 13:40:50 +00:00
|
|
|
input_joystick_handle(joystick_fd, 0);
|
2015-08-17 21:46:28 +00:00
|
|
|
#endif
|
2015-08-12 01:40:09 +00:00
|
|
|
|
2015-08-17 21:46:28 +00:00
|
|
|
#if defined(USE_EVDEV)
|
2020-12-02 13:40:50 +00:00
|
|
|
input_evdev_handle();
|
2015-08-17 21:46:28 +00:00
|
|
|
#endif
|
2015-08-29 18:23:16 +00:00
|
|
|
|
|
|
|
#if defined(USE_SDL)
|
2020-12-02 13:40:50 +00:00
|
|
|
input_sdl_handle();
|
2015-08-29 18:23:16 +00:00
|
|
|
#endif
|
2013-12-19 17:10:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void os_DoEvents()
|
|
|
|
{
|
2015-08-17 21:46:28 +00:00
|
|
|
#if defined(SUPPORT_X11)
|
|
|
|
input_x11_handle();
|
2018-04-27 14:54:15 +00:00
|
|
|
event_x11_handle();
|
2015-08-17 21:46:28 +00:00
|
|
|
#endif
|
2013-12-19 17:10:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void os_SetWindowText(const char * text)
|
|
|
|
{
|
2015-08-17 21:46:28 +00:00
|
|
|
#if defined(SUPPORT_X11)
|
|
|
|
x11_window_set_text(text);
|
|
|
|
#endif
|
2015-08-29 18:23:16 +00:00
|
|
|
#if defined(USE_SDL)
|
|
|
|
sdl_window_set_text(text);
|
|
|
|
#endif
|
2013-12-19 17:10:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void os_CreateWindow()
|
|
|
|
{
|
2016-03-02 05:48:34 +00:00
|
|
|
#if defined(SUPPORT_DISPMANX)
|
|
|
|
dispmanx_window_create();
|
|
|
|
#endif
|
2015-08-17 21:46:28 +00:00
|
|
|
#if defined(SUPPORT_X11)
|
|
|
|
x11_window_create();
|
|
|
|
#endif
|
2015-08-29 18:23:16 +00:00
|
|
|
#if defined(USE_SDL)
|
|
|
|
sdl_window_create();
|
|
|
|
#endif
|
2013-12-19 17:10:14 +00:00
|
|
|
}
|
|
|
|
|
2015-08-11 23:57:29 +00:00
|
|
|
void common_linux_setup();
|
2019-02-25 16:52:53 +00:00
|
|
|
void* rend_thread(void* p);
|
2013-12-19 17:10:14 +00:00
|
|
|
|
2020-11-26 15:45:57 +00:00
|
|
|
// Find the user config directory.
|
|
|
|
// The following folders are checked in this order:
|
|
|
|
// $HOME/.reicast
|
|
|
|
// $HOME/.config/flycast
|
|
|
|
// $HOME/.config/reicast
|
|
|
|
// If no folder exists, $HOME/.config/flycast is created and used.
|
2020-03-29 17:29:14 +00:00
|
|
|
std::string find_user_config_dir()
|
2015-08-22 16:47:17 +00:00
|
|
|
{
|
2020-05-08 16:41:36 +00:00
|
|
|
struct stat info;
|
2020-11-26 15:45:57 +00:00
|
|
|
std::string xdg_home;
|
|
|
|
if (getenv("HOME") != NULL)
|
2020-05-08 16:41:36 +00:00
|
|
|
{
|
|
|
|
// Support for the legacy config dir at "$HOME/.reicast"
|
2020-11-26 15:45:57 +00:00
|
|
|
std::string legacy_home = (std::string)getenv("HOME") + "/.reicast/";
|
|
|
|
if (stat(legacy_home.c_str(), &info) == 0 && (info.st_mode & S_IFDIR))
|
2020-05-08 16:41:36 +00:00
|
|
|
// "$HOME/.reicast" already exists, let's use it!
|
|
|
|
return legacy_home;
|
2015-08-22 19:49:12 +00:00
|
|
|
|
2020-05-08 16:41:36 +00:00
|
|
|
/* If $XDG_CONFIG_HOME is not set, we're supposed to use "$HOME/.config" instead.
|
|
|
|
* Consult the XDG Base Directory Specification for details:
|
|
|
|
* http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables
|
|
|
|
*/
|
2020-11-26 15:45:57 +00:00
|
|
|
xdg_home = (std::string)getenv("HOME") + "/.config";
|
2020-05-08 16:41:36 +00:00
|
|
|
}
|
2020-11-26 15:45:57 +00:00
|
|
|
if (getenv("XDG_CONFIG_HOME") != NULL)
|
2020-05-08 16:41:36 +00:00
|
|
|
// If XDG_CONFIG_HOME is set explicitly, we'll use that instead of $HOME/.config
|
2020-11-26 15:45:57 +00:00
|
|
|
xdg_home = (std::string)getenv("XDG_CONFIG_HOME");
|
2020-05-08 16:41:36 +00:00
|
|
|
|
2020-11-26 15:45:57 +00:00
|
|
|
if (!xdg_home.empty())
|
2020-05-08 16:41:36 +00:00
|
|
|
{
|
2020-11-26 15:45:57 +00:00
|
|
|
std::string fullpath = xdg_home + "/flycast/";
|
|
|
|
if (stat(fullpath.c_str(), &info) == 0 && (info.st_mode & S_IFDIR))
|
|
|
|
// Found .config/flycast
|
|
|
|
return fullpath;
|
|
|
|
fullpath = xdg_home + "/reicast/";
|
|
|
|
if (stat(fullpath.c_str(), &info) == 0 && (info.st_mode & S_IFDIR))
|
|
|
|
// Found .config/reicast
|
|
|
|
return fullpath;
|
|
|
|
|
|
|
|
// Create .config/flycast
|
|
|
|
fullpath = xdg_home + "/flycast/";
|
|
|
|
mkdir(fullpath.c_str(), 0755);
|
|
|
|
|
|
|
|
return fullpath;
|
2020-05-08 16:41:36 +00:00
|
|
|
}
|
2015-08-22 19:49:12 +00:00
|
|
|
|
|
|
|
// Unable to detect config dir, use the current folder
|
|
|
|
return ".";
|
|
|
|
}
|
|
|
|
|
2020-11-26 15:45:57 +00:00
|
|
|
// Find the user data directory.
|
|
|
|
// The following folders are checked in this order:
|
|
|
|
// $HOME/.reicast/data
|
|
|
|
// $HOME/.local/share/flycast
|
|
|
|
// $HOME/.local/share/reicast
|
|
|
|
// If no folder exists, $HOME/.local/share/flycast is created and used.
|
2020-03-29 17:29:14 +00:00
|
|
|
std::string find_user_data_dir()
|
2015-08-22 19:49:12 +00:00
|
|
|
{
|
2020-05-08 16:41:36 +00:00
|
|
|
struct stat info;
|
2020-11-26 15:45:57 +00:00
|
|
|
std::string xdg_home;
|
|
|
|
if (getenv("HOME") != NULL)
|
2020-05-08 16:41:36 +00:00
|
|
|
{
|
2020-11-26 15:45:57 +00:00
|
|
|
// Support for the legacy config dir at "$HOME/.reicast/data"
|
|
|
|
std::string legacy_data = (std::string)getenv("HOME") + "/.reicast/data/";
|
|
|
|
if (stat(legacy_data.c_str(), &info) == 0 && (info.st_mode & S_IFDIR))
|
|
|
|
// "$HOME/.reicast/data" already exists, let's use it!
|
2020-05-08 16:41:36 +00:00
|
|
|
return legacy_data;
|
2018-08-13 11:00:24 +00:00
|
|
|
|
2020-05-08 16:41:36 +00:00
|
|
|
/* If $XDG_DATA_HOME is not set, we're supposed to use "$HOME/.local/share" instead.
|
|
|
|
* Consult the XDG Base Directory Specification for details:
|
|
|
|
* http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables
|
|
|
|
*/
|
2020-11-26 15:45:57 +00:00
|
|
|
xdg_home = (std::string)getenv("HOME") + "/.local/share";
|
2020-05-08 16:41:36 +00:00
|
|
|
}
|
2020-11-26 15:45:57 +00:00
|
|
|
if (getenv("XDG_DATA_HOME") != NULL)
|
|
|
|
// If XDG_DATA_HOME is set explicitly, we'll use that instead of $HOME/.local/share
|
|
|
|
xdg_home = (std::string)getenv("XDG_DATA_HOME");
|
2020-05-08 16:41:36 +00:00
|
|
|
|
2020-11-26 15:45:57 +00:00
|
|
|
if (!xdg_home.empty())
|
2020-05-08 16:41:36 +00:00
|
|
|
{
|
2020-11-26 15:45:57 +00:00
|
|
|
std::string fullpath = xdg_home + "/flycast/";
|
|
|
|
if (stat(fullpath.c_str(), &info) == 0 && (info.st_mode & S_IFDIR))
|
|
|
|
// Found .local/share/flycast
|
|
|
|
return fullpath;
|
|
|
|
fullpath = xdg_home + "/reicast/";
|
|
|
|
if (stat(fullpath.c_str(), &info) == 0 && (info.st_mode & S_IFDIR))
|
|
|
|
// Found .local/share/reicast
|
|
|
|
return fullpath;
|
|
|
|
|
|
|
|
// Create .local/share/flycast
|
|
|
|
fullpath = xdg_home + "/flycast/";
|
|
|
|
mkdir(fullpath.c_str(), 0755);
|
|
|
|
|
|
|
|
return fullpath;
|
2020-05-08 16:41:36 +00:00
|
|
|
}
|
2015-08-22 19:49:12 +00:00
|
|
|
|
2020-11-26 15:45:57 +00:00
|
|
|
// Unable to detect data dir, use the current folder
|
2015-08-22 16:47:17 +00:00
|
|
|
return ".";
|
|
|
|
}
|
|
|
|
|
2020-11-26 15:45:57 +00:00
|
|
|
// Find a file in the user and system config directories.
|
|
|
|
// The following folders are checked in this order:
|
|
|
|
// $HOME/.reicast
|
|
|
|
// $HOME/.config/flycast
|
|
|
|
// $HOME/.config/reicast
|
|
|
|
// if XDG_CONFIG_DIRS is defined:
|
|
|
|
// <$XDG_CONFIG_DIRS>/flycast
|
|
|
|
// <$XDG_CONFIG_DIRS>/reicast
|
|
|
|
// else
|
|
|
|
// /etc/flycast/
|
|
|
|
// /etc/xdg/flycast/
|
|
|
|
// .
|
2020-03-29 17:29:14 +00:00
|
|
|
std::vector<std::string> find_system_config_dirs()
|
2015-08-22 19:49:12 +00:00
|
|
|
{
|
2020-03-29 17:29:14 +00:00
|
|
|
std::vector<std::string> dirs;
|
2020-11-26 15:45:57 +00:00
|
|
|
|
|
|
|
std::string xdg_home;
|
|
|
|
if (getenv("HOME") != NULL)
|
|
|
|
{
|
|
|
|
// Support for the legacy config dir at "$HOME/.reicast"
|
|
|
|
dirs.push_back((std::string)getenv("HOME") + "/.reicast/");
|
|
|
|
xdg_home = (std::string)getenv("HOME") + "/.config";
|
|
|
|
}
|
|
|
|
if (getenv("XDG_CONFIG_HOME") != NULL)
|
|
|
|
// If XDG_CONFIG_HOME is set explicitly, we'll use that instead of $HOME/.config
|
|
|
|
xdg_home = (std::string)getenv("XDG_CONFIG_HOME");
|
|
|
|
if (!xdg_home.empty())
|
|
|
|
{
|
|
|
|
// XDG config locations
|
|
|
|
dirs.push_back(xdg_home + "/flycast/");
|
|
|
|
dirs.push_back(xdg_home + "/reicast/");
|
|
|
|
}
|
|
|
|
|
2016-01-30 09:21:17 +00:00
|
|
|
if (getenv("XDG_CONFIG_DIRS") != NULL)
|
2015-08-22 19:49:12 +00:00
|
|
|
{
|
2020-03-29 17:29:14 +00:00
|
|
|
std::string s = (std::string)getenv("XDG_CONFIG_DIRS");
|
2015-08-22 19:49:12 +00:00
|
|
|
|
2020-03-29 17:29:14 +00:00
|
|
|
std::string::size_type pos = 0;
|
|
|
|
std::string::size_type n = s.find(':', pos);
|
2015-08-22 19:49:12 +00:00
|
|
|
while(n != std::string::npos)
|
|
|
|
{
|
2020-11-26 15:45:57 +00:00
|
|
|
dirs.push_back(s.substr(pos, n-pos) + "/flycast/");
|
|
|
|
dirs.push_back(s.substr(pos, n-pos) + "/reicast/");
|
2015-08-22 19:49:12 +00:00
|
|
|
pos = n + 1;
|
2019-09-07 12:37:39 +00:00
|
|
|
n = s.find(':', pos);
|
2015-08-22 19:49:12 +00:00
|
|
|
}
|
|
|
|
// Separator not found
|
2020-11-26 15:45:57 +00:00
|
|
|
dirs.push_back(s.substr(pos) + "/flycast/");
|
|
|
|
dirs.push_back(s.substr(pos) + "/reicast/");
|
2015-08-22 19:49:12 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-11-26 15:45:57 +00:00
|
|
|
dirs.push_back("/etc/flycast/"); // This isn't part of the XDG spec, but much more common than /etc/xdg/
|
|
|
|
dirs.push_back("/etc/xdg/flycast/");
|
2015-08-22 19:49:12 +00:00
|
|
|
}
|
2020-11-26 15:45:57 +00:00
|
|
|
dirs.push_back("./");
|
|
|
|
|
2015-08-22 19:49:12 +00:00
|
|
|
return dirs;
|
|
|
|
}
|
|
|
|
|
2020-11-26 15:45:57 +00:00
|
|
|
// Find a file in the user data directories.
|
|
|
|
// The following folders are checked in this order:
|
|
|
|
// $HOME/.reicast/data
|
|
|
|
// $HOME/.local/share/flycast
|
|
|
|
// $HOME/.local/share/reicast
|
|
|
|
// if XDG_DATA_DIRS is defined:
|
|
|
|
// <$XDG_DATA_DIRS>/flycast
|
|
|
|
// <$XDG_DATA_DIRS>/reicast
|
|
|
|
// else
|
|
|
|
// /usr/local/share/flycast
|
|
|
|
// /usr/share/flycast
|
|
|
|
// /usr/local/share/reicast
|
|
|
|
// /usr/share/reicast
|
|
|
|
// ./data
|
2020-03-29 17:29:14 +00:00
|
|
|
std::vector<std::string> find_system_data_dirs()
|
2015-08-22 19:49:12 +00:00
|
|
|
{
|
2020-03-29 17:29:14 +00:00
|
|
|
std::vector<std::string> dirs;
|
2020-11-26 15:45:57 +00:00
|
|
|
|
|
|
|
std::string xdg_home;
|
|
|
|
if (getenv("HOME") != NULL)
|
|
|
|
{
|
|
|
|
// Support for the legacy data dir at "$HOME/.reicast/data"
|
|
|
|
dirs.push_back((std::string)getenv("HOME") + "/.reicast/data/");
|
|
|
|
xdg_home = (std::string)getenv("HOME") + "/.local/share";
|
|
|
|
}
|
|
|
|
if (getenv("XDG_DATA_HOME") != NULL)
|
|
|
|
// If XDG_DATA_HOME is set explicitly, we'll use that instead of $HOME/.local/share
|
|
|
|
xdg_home = (std::string)getenv("XDG_DATA_HOME");
|
|
|
|
if (!xdg_home.empty())
|
|
|
|
{
|
|
|
|
// XDG data locations
|
|
|
|
dirs.push_back(xdg_home + "/flycast/");
|
|
|
|
dirs.push_back(xdg_home + "/reicast/");
|
|
|
|
dirs.push_back(xdg_home + "/reicast/data/");
|
|
|
|
}
|
|
|
|
|
2015-08-22 19:49:12 +00:00
|
|
|
if (getenv("XDG_DATA_DIRS") != NULL)
|
|
|
|
{
|
2020-03-29 17:29:14 +00:00
|
|
|
std::string s = (std::string)getenv("XDG_DATA_DIRS");
|
2015-08-22 19:49:12 +00:00
|
|
|
|
2020-03-29 17:29:14 +00:00
|
|
|
std::string::size_type pos = 0;
|
|
|
|
std::string::size_type n = s.find(':', pos);
|
2015-08-22 19:49:12 +00:00
|
|
|
while(n != std::string::npos)
|
|
|
|
{
|
2020-11-26 15:45:57 +00:00
|
|
|
dirs.push_back(s.substr(pos, n-pos) + "/flycast/");
|
|
|
|
dirs.push_back(s.substr(pos, n-pos) + "/reicast/");
|
2015-08-22 19:49:12 +00:00
|
|
|
pos = n + 1;
|
2019-09-07 12:37:39 +00:00
|
|
|
n = s.find(':', pos);
|
2015-08-22 19:49:12 +00:00
|
|
|
}
|
|
|
|
// Separator not found
|
2020-11-26 15:45:57 +00:00
|
|
|
dirs.push_back(s.substr(pos) + "/flycast/");
|
|
|
|
dirs.push_back(s.substr(pos) + "/reicast/");
|
2015-08-22 19:49:12 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-11-26 15:45:57 +00:00
|
|
|
dirs.push_back("/usr/local/share/flycast/");
|
|
|
|
dirs.push_back("/usr/share/flycast/");
|
|
|
|
dirs.push_back("/usr/local/share/reicast/");
|
|
|
|
dirs.push_back("/usr/share/reicast/");
|
2015-08-22 19:49:12 +00:00
|
|
|
}
|
2020-11-26 15:45:57 +00:00
|
|
|
dirs.push_back("./");
|
|
|
|
dirs.push_back("data/");
|
|
|
|
|
2015-08-22 19:49:12 +00:00
|
|
|
return dirs;
|
|
|
|
}
|
|
|
|
|
2020-01-31 22:51:12 +00:00
|
|
|
int main(int argc, char* argv[])
|
2013-12-19 17:10:14 +00:00
|
|
|
{
|
2019-06-30 19:06:46 +00:00
|
|
|
LogManager::Init();
|
2015-08-17 21:46:28 +00:00
|
|
|
|
2020-11-26 15:45:57 +00:00
|
|
|
// Set directories
|
2015-08-22 19:49:12 +00:00
|
|
|
set_user_config_dir(find_user_config_dir());
|
|
|
|
set_user_data_dir(find_user_data_dir());
|
2020-11-26 15:45:57 +00:00
|
|
|
for (const auto& dir : find_system_config_dirs())
|
|
|
|
add_system_config_dir(dir);
|
|
|
|
for (const auto& dir : find_system_data_dirs())
|
|
|
|
add_system_data_dir(dir);
|
|
|
|
INFO_LOG(BOOT, "Config dir is: %s", get_writable_config_path("").c_str());
|
|
|
|
INFO_LOG(BOOT, "Data dir is: %s", get_writable_data_path("").c_str());
|
2015-08-17 21:46:28 +00:00
|
|
|
|
2020-12-07 21:16:51 +00:00
|
|
|
#if defined(USE_SDL)
|
|
|
|
// init video now: on rpi3 it installs a sigsegv handler(?)
|
|
|
|
if (SDL_Init(SDL_INIT_VIDEO) != 0)
|
|
|
|
{
|
|
|
|
die("SDL: Initialization failed!");
|
|
|
|
}
|
|
|
|
#endif
|
2015-08-29 18:23:16 +00:00
|
|
|
|
2015-08-17 21:46:28 +00:00
|
|
|
common_linux_setup();
|
|
|
|
|
|
|
|
settings.profile.run_counts=0;
|
|
|
|
|
2019-02-25 16:52:53 +00:00
|
|
|
if (reicast_init(argc, argv))
|
2018-10-17 11:18:24 +00:00
|
|
|
die("Reicast initialization failed\n");
|
2015-08-17 21:46:28 +00:00
|
|
|
|
2019-08-30 18:01:14 +00:00
|
|
|
rend_thread(NULL);
|
2015-08-17 21:46:28 +00:00
|
|
|
|
2018-04-27 10:37:56 +00:00
|
|
|
dc_term();
|
|
|
|
|
2020-12-07 21:16:51 +00:00
|
|
|
#if defined(USE_EVDEV)
|
|
|
|
input_evdev_close();
|
|
|
|
#endif
|
2018-07-23 17:47:24 +00:00
|
|
|
|
|
|
|
#if defined(SUPPORT_X11)
|
|
|
|
x11_window_destroy();
|
|
|
|
#endif
|
2018-04-27 10:37:56 +00:00
|
|
|
|
2019-10-05 09:50:14 +00:00
|
|
|
#if defined(USE_SDL)
|
|
|
|
sdl_window_destroy();
|
|
|
|
#endif
|
|
|
|
|
2015-08-17 21:46:28 +00:00
|
|
|
return 0;
|
2015-08-11 23:57:29 +00:00
|
|
|
}
|
2015-04-14 14:58:41 +00:00
|
|
|
#endif
|
2014-03-20 15:13:53 +00:00
|
|
|
|
2014-12-30 11:20:51 +00:00
|
|
|
void os_DebugBreak()
|
|
|
|
{
|
2019-08-30 18:01:14 +00:00
|
|
|
raise(SIGTRAP);
|
2014-12-30 11:20:51 +00:00
|
|
|
}
|
2015-08-18 18:57:18 +00:00
|
|
|
|
|
|
|
|
2015-08-19 05:04:36 +00:00
|
|
|
|