(SSNES_CONSOLE) Get rid of main_wrap.h header file - include

this in console_ext.h instead
This commit is contained in:
Twinaphex 2012-04-13 22:06:48 +02:00
parent ab8c3085a6
commit 96c20550b5
6 changed files with 65 additions and 89 deletions

View File

@ -25,7 +25,6 @@
#include "xdk360_video.h"
#include "../console/console_ext.h"
#include "../console/main_wrap.h"
#include "../conf/config_file.h"
#include "../conf/config_file_macros.h"
#include "../file.h"

View File

@ -24,7 +24,6 @@
#include "../libretro.h"
#include "../general.h"
#include "../compat/strl.h"
#include "main_wrap.h"
#include "console_ext.h"
#include "../file.h"
@ -201,48 +200,6 @@ int ssnes_extract_zipfile(const char *zip_path)
#endif
int ssnes_main_init_wrap(const struct ssnes_main_wrap *args)
{
int argc = 0;
char *argv[MAX_ARGS] = {NULL};
argv[argc++] = strdup("ssnes");
if (args->rom_path)
argv[argc++] = strdup(args->rom_path);
if (args->sram_path)
{
argv[argc++] = strdup("-s");
argv[argc++] = strdup(args->sram_path);
}
if (args->state_path)
{
argv[argc++] = strdup("-S");
argv[argc++] = strdup(args->state_path);
}
if (args->config_path)
{
argv[argc++] = strdup("-c");
argv[argc++] = strdup(args->config_path);
}
if (args->verbose)
argv[argc++] = strdup("-v");
int ret = ssnes_main_init(argc, argv);
char **tmp = argv;
while (*tmp)
{
free(*tmp);
tmp++;
}
return ret;
}
/*============================================================
INPUT EXTENSIONS
@ -657,6 +614,49 @@ void ssnes_startup (const char * config_path)
}
}
int ssnes_main_init_wrap(const struct ssnes_main_wrap *args)
{
int argc = 0;
char *argv[MAX_ARGS] = {NULL};
argv[argc++] = strdup("ssnes");
if (args->rom_path)
argv[argc++] = strdup(args->rom_path);
if (args->sram_path)
{
argv[argc++] = strdup("-s");
argv[argc++] = strdup(args->sram_path);
}
if (args->state_path)
{
argv[argc++] = strdup("-S");
argv[argc++] = strdup(args->state_path);
}
if (args->config_path)
{
argv[argc++] = strdup("-c");
argv[argc++] = strdup(args->config_path);
}
if (args->verbose)
argv[argc++] = strdup("-v");
int ret = ssnes_main_init(argc, argv);
char **tmp = argv;
while (*tmp)
{
free(*tmp);
tmp++;
}
return ret;
}
#endif
#ifdef HAVE_SSNES_EXEC

View File

@ -14,8 +14,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ROM_EXT_H__
#define ROM_EXT_H__
#ifndef CONSOLE_EXT_H__
#define CONSOLE_EXT_H__
enum aspect_ratio
{
@ -85,16 +85,27 @@ void ssnes_input_set_keybind(unsigned player, unsigned keybind_action, uint64_t
bool ssnes_manage_libretro_core(const char *full_path, const char *path, const char *exe_ext);
#endif
#endif
/*============================================================
SSNES
============================================================ */
#ifdef HAVE_SSNES_MAIN_WRAP
struct ssnes_main_wrap
{
const char *rom_path;
const char *sram_path;
const char *state_path;
const char *config_path;
bool verbose;
};
int ssnes_main_init_wrap(const struct ssnes_main_wrap *args);
void ssnes_startup (const char * config_path);
#endif
#ifdef HAVE_SSNES_EXEC
void ssnes_exec (void);
#endif
#endif

View File

@ -1,33 +0,0 @@
/* SSNES - A frontend for libretro.
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
* Copyright (C) 2011-2012 - Daniel De Matteis
*
* SSNES 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.
*
* SSNES 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 SSNES.
* If not, see <http://www.gnu.org/licenses/>.
*/
// Builds argc/argv and calls ssnes_main_init().
#ifndef _SSNES_WRAP_H
#define _SSNES_WRAP_H
struct ssnes_main_wrap
{
const char *rom_path;
const char *sram_path;
const char *state_path;
const char *config_path;
bool verbose;
};
int ssnes_main_init_wrap(const struct ssnes_main_wrap *args);
#endif

View File

@ -299,13 +299,13 @@ int main(int argc, char *argv[])
if(state.Gamepad.wButtons & XINPUT_GAMEPAD_Y)
{
//override path, boot first XEX in cores directory
SSNES_LOG("Fallback - Will boot first XEX in SSNES directory.\n");
//override path, boot first executable in cores directory
SSNES_LOG("Fallback - Will boot first executable in SSNES cores directory.\n");
find_and_set_first_file();
}
else
{
//normal XEX loading path
//normal executable loading path
init_settings();
}
@ -339,13 +339,13 @@ int main(int argc, char *argv[])
if(pad_data.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_TRIANGLE)
{
//override path, boot first SELF in cores directory
SSNES_LOG("Fallback - Will boot first SELF in SSNES cores/ directory.\n");
//override path, boot first executable in cores directory
SSNES_LOG("Fallback - Will boot first executable in SSNES cores/ directory.\n");
find_and_set_first_file();
}
else
{
//normal SELF loading path
//normal executable loading path
init_settings();
}
@ -372,7 +372,7 @@ int main(int argc, char *argv[])
if(ret < 0)
{
SSNES_LOG("SELF file is not of NPDRM type, trying another approach to boot it...\n");
SSNES_LOG("Executable file is not of NPDRM type, trying another approach to boot it...\n");
sys_game_process_exitspawn2(libretro_path, NULL, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M);
}

View File

@ -42,7 +42,6 @@
#include "ps3_video_psgl.h"
#include "../console/console_ext.h"
#include "../console/main_wrap.h"
#include "../conf/config_file.h"
#include "../conf/config_file_macros.h"
#include "../general.h"