diff --git a/Makefile.ps3 b/Makefile.ps3 index 3fecfb7fa4..fe9203b913 100644 --- a/Makefile.ps3 +++ b/Makefile.ps3 @@ -45,7 +45,7 @@ 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 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 gfx/gfx_common.o ps3/ps3_video_psgl.o gfx/shader_cg.o gfx/snes_state.o ups.o bps.o strl.o screenshot.o audio/hermite.o dynamic.o ps3/main.o audio/utils.o conf/config_file.o gfx/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 -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 -lsysmodule_stub -laudio_stub -lnet_stub -lpthread DEFINES = -DSSNES_CONSOLE -DHAVE_OPENGL=1 -DHAVE_CG=1 -DHAVE_FBO=1 -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DPACKAGE_VERSION=\"0.9.3\" -Dmain=ssnes_main diff --git a/general.h b/general.h index 0cd2efa7aa..9c876a203d 100644 --- a/general.h +++ b/general.h @@ -173,6 +173,7 @@ struct settings struct console_settings { bool block_config_read; + bool screenshots_enable; }; #endif diff --git a/ps3/main.c b/ps3/main.c index 9b590e2bd1..c7f68077b3 100644 --- a/ps3/main.c +++ b/ps3/main.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -67,7 +68,6 @@ bool g_rom_loaded; bool return_to_MM; /* launch multiMAN on exit if ROM is passed*/ -uint32_t g_screenshots_enabled; uint32_t g_emulator_initialized = 0; char special_action_msg[256]; /* message which should be overlaid on top of the screen*/ @@ -133,7 +133,7 @@ static void init_settings(void) init_setting_bool("video_render_to_texture", g_settings.video.render_to_texture, 1); init_setting_bool("video_vsync", g_settings.video.vsync, 1); init_setting_uint("state_slot", g_extern.state_slot, 0); - init_setting_uint("screenshots_enabled", g_screenshots_enabled, 0); + init_setting_uint("screenshots_enabled", g_console.screenshots_enable, 0); init_setting_char("cheat_database_path", g_settings.cheat_database, usrDirPath); } @@ -217,6 +217,7 @@ int main(int argc, char *argv[]) memset(&g_extern, 0, sizeof(g_extern)); memset(&g_settings, 0, sizeof(g_settings)); + memset(&g_console, 0, sizeof(g_console)); SSNES_LOG("Registering Callback\n"); cellSysutilRegisterCallback(0, callback_sysutil_exit, NULL); @@ -236,6 +237,19 @@ int main(int argc, char *argv[]) get_path_settings(return_to_MM); init_settings(); +#if(CELL_SDK_VERSION > 0x340000) + if (g_console.screenshots_enable) + { + cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT); + CellScreenShotSetParam screenshot_param = {0, 0, 0, 0}; + + screenshot_param.photo_title = "SSNES PS3"; + screenshot_param.game_title = "SSNES PS3"; + cellScreenShotSetParameter (&screenshot_param); + cellScreenShotEnable(); + } +#endif + ps3_video_init(); ps3_input_init(); diff --git a/ps3/menu.c b/ps3/menu.c index a96e119c2d..c1471cb650 100644 --- a/ps3/menu.c +++ b/ps3/menu.c @@ -593,6 +593,16 @@ static void set_setting_label(menu * menu_obj, int currentsetting) case SETTING_TRIPLE_BUFFERING: break; case SETTING_ENABLE_SCREENSHOTS: + if(g_console.screenshots_enable) + { + snprintf(menu_obj->items[currentsetting].setting_text, sizeof(menu_obj->items[currentsetting].setting_text), "ON"); + menu_obj->items[currentsetting].text_color = GREEN; + } + else + { + snprintf(menu_obj->items[currentsetting].setting_text, sizeof(menu_obj->items[currentsetting].setting_text), "OFF"); + menu_obj->items[currentsetting].text_color = ORANGE; + } break; case SETTING_SAVE_SHADER_PRESET: break; @@ -866,6 +876,35 @@ static void producesettingentry(menu * menu_obj, uint64_t switchvalue) case SETTING_TRIPLE_BUFFERING: break; case SETTING_ENABLE_SCREENSHOTS: + if(CTRL_LEFT(state) || CTRL_LSTICK_LEFT(state) || CTRL_RIGHT(state) || CTRL_LSTICK_RIGHT(state)) + { +#if(CELL_SDK_VERSION > 0x340000) + g_console.screenshots_enable = !g_console.screenshots_enable; + if(g_console.screenshots_enable) + { + cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT); + CellScreenShotSetParam screenshot_param = {0, 0, 0, 0}; + + screenshot_param.photo_title = EMULATOR_NAME; + screenshot_param.game_title = EMULATOR_NAME; + cellScreenShotSetParameter (&screenshot_param); + cellScreenShotEnable(); + } + else + { + cellScreenShotDisable(); + cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT); + } + + set_text_message("", 7); +#endif + } + if(CTRL_START(state)) + { +#if(CELL_SDK_VERSION > 0x340000) + g_console.screenshots_enable = false; +#endif + } break; case SETTING_SAVE_SHADER_PRESET: break;