(PS3) Implement ssnes_main wrap
This commit is contained in:
parent
e0aa65efc3
commit
e538fe4364
|
@ -4,9 +4,10 @@
|
||||||
##
|
##
|
||||||
###
|
###
|
||||||
##
|
##
|
||||||
DEBUG = 1
|
DEBUG = 0
|
||||||
CELL_BUILD_TOOLS = GCC
|
CELL_BUILD_TOOLS = GCC
|
||||||
DOWNLOAD_SHADERS = 1
|
DOWNLOAD_SHADERS = 1
|
||||||
|
STRIPPING_ENABLE = 0
|
||||||
|
|
||||||
## Platform detection from nall/Makefile. Only two applicable hosts for PS3 SDK.
|
## Platform detection from nall/Makefile. Only two applicable hosts for PS3 SDK.
|
||||||
ifeq ($(platform),)
|
ifeq ($(platform),)
|
||||||
|
@ -44,7 +45,7 @@ INCDIRS = -I. -Icommon
|
||||||
MAKE_FSELF_NPDRM = $(CELL_SDK)/$(HOST_DIR)/bin/make_fself_npdrm
|
MAKE_FSELF_NPDRM = $(CELL_SDK)/$(HOST_DIR)/bin/make_fself_npdrm
|
||||||
MAKE_PACKAGE_NPDRM = $(CELL_SDK)/$(HOST_DIR)/bin/make_package_npdrm
|
MAKE_PACKAGE_NPDRM = $(CELL_SDK)/$(HOST_DIR)/bin/make_package_npdrm
|
||||||
|
|
||||||
OBJ = fifo_buffer.o ps3/cellframework2/fileio/file_browser.o ps3/ps3_audio.o ps3/menu.o console/rom_ext.o ps3/ps3_input.o ps3/cellframework2/input/pad_input.o getopt.o ssnes.o driver.o file.o settings.o message.o rewind.o movie.o netplay.o netplay_compat.o gfx/gfx_common.o ps3/ps3_video_psgl.o gfx/shader_cg.o gfx/snes_state.o ups.o bps.o strl.o audio/hermite.o dynamic.o ps3/main.o audio/utils.o conf/config_file.o ps3/image.o
|
OBJ = fifo_buffer.o ps3/cellframework2/fileio/file_browser.o ps3/ps3_audio.o ps3/menu.o console/main_wrap.o console/rom_ext.o ps3/ps3_input.o ps3/cellframework2/input/pad_input.o getopt.o ssnes.o driver.o file.o settings.o message.o rewind.o movie.o netplay.o netplay_compat.o gfx/gfx_common.o ps3/ps3_video_psgl.o gfx/shader_cg.o gfx/snes_state.o ups.o bps.o strl.o audio/hermite.o dynamic.o ps3/main.o audio/utils.o conf/config_file.o ps3/image.o
|
||||||
|
|
||||||
LIBS = -ldbgfont -lPSGL -lPSGLcgc -lcgc -lgcm_cmd -lgcm_sys_stub -lsnes -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysutil_game_stub -lsysutil_screenshot_stub -lpngdec_stub -ljpgdec_stub -lsysmodule_stub -laudio_stub -lnet_stub -lpthread
|
LIBS = -ldbgfont -lPSGL -lPSGLcgc -lcgc -lgcm_cmd -lgcm_sys_stub -lsnes -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysutil_game_stub -lsysutil_screenshot_stub -lpngdec_stub -ljpgdec_stub -lsysmodule_stub -laudio_stub -lnet_stub -lpthread
|
||||||
|
|
||||||
|
@ -64,7 +65,9 @@ all: pkg
|
||||||
|
|
||||||
$(PPU_TARGET): $(OBJ)
|
$(PPU_TARGET): $(OBJ)
|
||||||
$(LD) -o $@ $(OBJ) $(LDFLAGS) $(LDDIRS) $(LIBS)
|
$(LD) -o $@ $(OBJ) $(LDFLAGS) $(LDDIRS) $(LIBS)
|
||||||
|
ifeq ($(STRIPPING_ENABLE),1)
|
||||||
$(STRIP) $(PPU_TARGET)
|
$(STRIP) $(PPU_TARGET)
|
||||||
|
endif
|
||||||
|
|
||||||
%.o: %.c config.h
|
%.o: %.c config.h
|
||||||
$(CC) $(INCDIRS) $(CFLAGS) -c -o $@ $<
|
$(CC) $(INCDIRS) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
|
@ -18,6 +18,12 @@
|
||||||
#ifndef MAIN_WRAP_H__
|
#ifndef MAIN_WRAP_H__
|
||||||
#define MAIN_WRAP_H__
|
#define MAIN_WRAP_H__
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
unsigned char bool;
|
||||||
|
#else
|
||||||
|
#include <stdbool.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// Builds argc/argv and calls ssnes_main_init().
|
// Builds argc/argv and calls ssnes_main_init().
|
||||||
|
|
||||||
struct ssnes_main_wrap
|
struct ssnes_main_wrap
|
||||||
|
|
39
ps3/main.c
39
ps3/main.c
|
@ -31,6 +31,7 @@
|
||||||
#include "ps3_input.h"
|
#include "ps3_input.h"
|
||||||
#include "ps3_video_psgl.h"
|
#include "ps3_video_psgl.h"
|
||||||
|
|
||||||
|
#include "../console/main_wrap.h"
|
||||||
#include "../conf/config_file.h"
|
#include "../conf/config_file.h"
|
||||||
#include "../conf/config_file_macros.h"
|
#include "../conf/config_file_macros.h"
|
||||||
#include "../general.h"
|
#include "../general.h"
|
||||||
|
@ -625,35 +626,17 @@ begin_loop:
|
||||||
if(g_emulator_initialized)
|
if(g_emulator_initialized)
|
||||||
ssnes_main_deinit();
|
ssnes_main_deinit();
|
||||||
|
|
||||||
char arg1[] = "ssnes";
|
struct ssnes_main_wrap args = {
|
||||||
char arg2[PATH_MAX];
|
.verbose = g_extern.verbose,
|
||||||
|
.config_path = SYS_CONFIG_FILE,
|
||||||
|
.sram_path = g_console.default_sram_dir_enable ? g_console.default_sram_dir : NULL,
|
||||||
|
.state_path = g_console.default_savestate_dir_enable ? g_console.default_savestate_dir : NULL,
|
||||||
|
.rom_path = g_console.rom_path
|
||||||
|
};
|
||||||
|
|
||||||
snprintf(arg2, sizeof(arg2), g_console.rom_path);
|
int init_ret = ssnes_main_init_wrap(&args);
|
||||||
char arg3[] = "-v";
|
g_emulator_initialized = 1;
|
||||||
char arg4[] = "-c";
|
init_ssnes = 0;
|
||||||
char arg5[MAX_PATH_LENGTH];
|
|
||||||
|
|
||||||
snprintf(arg5, sizeof(arg5), SYS_CONFIG_FILE);
|
|
||||||
|
|
||||||
if(g_console.default_sram_dir_enable)
|
|
||||||
{
|
|
||||||
char arg6[] = "-s";
|
|
||||||
char arg7[MAX_PATH_LENGTH];
|
|
||||||
snprintf(arg7, sizeof(arg7), g_console.default_sram_dir);
|
|
||||||
char *argv_[] = { arg1, arg2, arg3, arg4, arg5, arg6, arg7, NULL };
|
|
||||||
int argc = sizeof(argv_) / sizeof(argv_[0]) - 1;
|
|
||||||
int init_ret = ssnes_main_init(argc, argv_);
|
|
||||||
g_emulator_initialized = 1;
|
|
||||||
init_ssnes = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
char *argv_[] = { arg1, arg2, arg3, arg4, arg5, NULL };
|
|
||||||
int argc = sizeof(argv_) / sizeof(argv_[0]) - 1;
|
|
||||||
int init_ret = ssnes_main_init(argc, argv_);
|
|
||||||
g_emulator_initialized = 1;
|
|
||||||
init_ssnes = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef MULTIMAN_SUPPORT
|
#ifdef MULTIMAN_SUPPORT
|
||||||
|
|
Loading…
Reference in New Issue