diff --git a/Makefile.ps3 b/Makefile.ps3 index f4bc527d63..67eeba70d1 100644 --- a/Makefile.ps3 +++ b/Makefile.ps3 @@ -4,9 +4,10 @@ ## ### ## -DEBUG = 1 +DEBUG = 0 CELL_BUILD_TOOLS = GCC DOWNLOAD_SHADERS = 1 +STRIPPING_ENABLE = 0 ## Platform detection from nall/Makefile. Only two applicable hosts for PS3 SDK. ifeq ($(platform),) @@ -44,7 +45,7 @@ INCDIRS = -I. -Icommon MAKE_FSELF_NPDRM = $(CELL_SDK)/$(HOST_DIR)/bin/make_fself_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 @@ -64,7 +65,9 @@ all: pkg $(PPU_TARGET): $(OBJ) $(LD) -o $@ $(OBJ) $(LDFLAGS) $(LDDIRS) $(LIBS) +ifeq ($(STRIPPING_ENABLE),1) $(STRIP) $(PPU_TARGET) +endif %.o: %.c config.h $(CC) $(INCDIRS) $(CFLAGS) -c -o $@ $< diff --git a/console/main_wrap.h b/console/main_wrap.h index 41771c8b56..17bb6c5ef9 100644 --- a/console/main_wrap.h +++ b/console/main_wrap.h @@ -18,6 +18,12 @@ #ifndef MAIN_WRAP_H__ #define MAIN_WRAP_H__ +#ifdef _MSC_VER +unsigned char bool; +#else +#include +#endif + // Builds argc/argv and calls ssnes_main_init(). struct ssnes_main_wrap diff --git a/ps3/main.c b/ps3/main.c index ac41ac7551..7505815c4b 100644 --- a/ps3/main.c +++ b/ps3/main.c @@ -31,6 +31,7 @@ #include "ps3_input.h" #include "ps3_video_psgl.h" +#include "../console/main_wrap.h" #include "../conf/config_file.h" #include "../conf/config_file_macros.h" #include "../general.h" @@ -625,35 +626,17 @@ begin_loop: if(g_emulator_initialized) ssnes_main_deinit(); - char arg1[] = "ssnes"; - char arg2[PATH_MAX]; + struct ssnes_main_wrap args = { + .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); - char arg3[] = "-v"; - char arg4[] = "-c"; - 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; - } + int init_ret = ssnes_main_init_wrap(&args); + g_emulator_initialized = 1; + init_ssnes = 0; } } #ifdef MULTIMAN_SUPPORT