From 59aeb77744753d7ef6ed17b24b49e5c05cf11a04 Mon Sep 17 00:00:00 2001 From: TwinAphex51224 Date: Wed, 11 Jan 2012 22:27:07 +0100 Subject: [PATCH] (PS3) Some more work on menu --- Makefile.ps3 | 4 ++-- ps3/{ => cellframework2/input}/pad_input.c | 0 ps3/{ => cellframework2/input}/pad_input.h | 0 ps3/main.c | 8 +++++++ ps3/menu.c | 7 ++++-- ps3/ps3_input.c | 18 +++++++++++---- ps3/ps3_input.h | 27 ++++++++++++++++++++++ ps3/ps3_video_psgl.c | 8 ++----- ps3/ps3_video_psgl.h | 27 ++++++++++++++++++++++ ps3/settings-logic.h | 23 ------------------ 10 files changed, 84 insertions(+), 38 deletions(-) rename ps3/{ => cellframework2/input}/pad_input.c (100%) rename ps3/{ => cellframework2/input}/pad_input.h (100%) create mode 100644 ps3/ps3_input.h create mode 100644 ps3/ps3_video_psgl.h diff --git a/Makefile.ps3 b/Makefile.ps3 index 84659ef1a8..ec70236964 100644 --- a/Makefile.ps3 +++ b/Makefile.ps3 @@ -43,7 +43,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/ps3_input.o ps3/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 +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 @@ -52,7 +52,7 @@ DEFINES = -DHAVE_OPENGL=1 -DHAVE_CG=1 -DHAVE_FBO=1 -D__CELLOS_LV2__ -DHAVE_CONFI ifeq ($(DEBUG), 1) PPU_OPTIMIZE_LV := -O0 -g else - PPU_OPTIMIZE_LV := -O3 + PPU_OPTIMIZE_LV := -O3 -g endif ## Use this for new SDK! diff --git a/ps3/pad_input.c b/ps3/cellframework2/input/pad_input.c similarity index 100% rename from ps3/pad_input.c rename to ps3/cellframework2/input/pad_input.c diff --git a/ps3/pad_input.h b/ps3/cellframework2/input/pad_input.h similarity index 100% rename from ps3/pad_input.h rename to ps3/cellframework2/input/pad_input.h diff --git a/ps3/main.c b/ps3/main.c index 6860d07316..bf101e051b 100644 --- a/ps3/main.c +++ b/ps3/main.c @@ -29,6 +29,7 @@ #include "../conf/config_file.h" #include "../general.h" +#include "menu.h" #define MAX_PATH_LENGTH 1024 @@ -223,6 +224,11 @@ int main(int argc, char *argv[]) get_path_settings(return_to_MM); + ps3_input_init(); + + menu_init(); + //menu_loop(); + /* FIXME - As long as we don't use a menu */ snprintf(g_extern.system.fullpath, sizeof(g_extern.system.fullpath), "/dev_hdd0/game/SNES90000/USRDIR/main.sfc"); @@ -237,4 +243,6 @@ int main(int argc, char *argv[]) snprintf(arg5, sizeof(arg5), SYS_CONFIG_FILE); char *argv_[] = { arg1, arg2, arg3, arg4, arg5, NULL }; return ssnes_main(sizeof(argv_) / sizeof(argv_[0]) - 1, argv_); + + ps3_input_deinit(); } diff --git a/ps3/menu.c b/ps3/menu.c index 0a810d9b27..0631c45ac5 100644 --- a/ps3/menu.c +++ b/ps3/menu.c @@ -19,9 +19,11 @@ #include #include -//#include "cellframework2/input/pad_input.h" +#include "cellframework2/input/pad_input.h" #include "cellframework2/fileio/file_browser.h" +#include "ps3_video_psgl.h" + #include "shared.h" #include "../general.h" @@ -988,7 +990,8 @@ void menu_loop(void) do { glClear(GL_COLOR_BUFFER_BIT); - ps3graphics_draw_menu(); + //ps3graphics_draw_menu(); + g_frame_count++; switch(menuStack[menuStackindex].enum_id) { diff --git a/ps3/ps3_input.c b/ps3/ps3_input.c index ce117e2c2b..395259130d 100644 --- a/ps3/ps3_input.c +++ b/ps3/ps3_input.c @@ -16,9 +16,8 @@ * If not, see . */ - #include "../driver.h" -#include "pad_input.h" +#include "ps3_input.h" #include #include "../libsnes.hpp" @@ -102,10 +101,19 @@ static void ps3_free_input(void *data) cell_pad_input_deinit(); } -static void* ps3_input_init(void) +static void* ps3_input_initialize(void) +{ + return (void*)-1; +} + +void ps3_input_init(void) { cell_pad_input_init(); - return (void*)-1; +} + +void ps3_input_deinit(void) +{ + cell_pad_input_deinit(); } static bool ps3_key_pressed(void *data, int key) @@ -131,7 +139,7 @@ static bool ps3_key_pressed(void *data, int key) } const input_driver_t input_ps3 = { - .init = ps3_input_init, + .init = ps3_input_initialize, .poll = ps3_input_poll, .input_state = ps3_input_state, .key_pressed = ps3_key_pressed, diff --git a/ps3/ps3_input.h b/ps3/ps3_input.h new file mode 100644 index 0000000000..a4c5b8152e --- /dev/null +++ b/ps3/ps3_input.h @@ -0,0 +1,27 @@ +/* SSNES - A Super Ninteno Entertainment System (SNES) Emulator frontend for libsnes. + * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * Copyright (C) 2011-2012 - Daniel De Matteis + * + * Some code herein may be based on code found in BSNES. + * + * 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 . + */ + +#ifndef _PS3_INPUT_H_ +#define _PS3_INPUT_H_ + +#include "cellframework2/input/pad_input.h" + +void ps3_input_init(void); +void ps3_input_deinit(void); + +#endif diff --git a/ps3/ps3_video_psgl.c b/ps3/ps3_video_psgl.c index eb0b391cea..c8d771eb5d 100644 --- a/ps3/ps3_video_psgl.c +++ b/ps3/ps3_video_psgl.c @@ -19,20 +19,16 @@ #include "../driver.h" +#include "ps3_video_psgl.h" + #include #include "../libsnes.hpp" #include #include #include #include "../general.h" -#include #include -#include -#include -#include -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/ps3/ps3_video_psgl.h b/ps3/ps3_video_psgl.h new file mode 100644 index 0000000000..85240fd068 --- /dev/null +++ b/ps3/ps3_video_psgl.h @@ -0,0 +1,27 @@ +/* SSNES - A Super Nintendo Entertainment System (SNES) Emulator frontend for libsnes. + * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * Copyright (C) 2011-2012 - Daniel De Matteis + * + * Some code herein may be based on code found in BSNES. + * + * 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 . + */ + +#ifndef _PS3_VIDEO_PSGL_H +#define _PS3_VIDEO_PSGL_H + +#include +#include +#include +#include + +#endif diff --git a/ps3/settings-logic.h b/ps3/settings-logic.h index 2fc10ec18d..421298b55c 100644 --- a/ps3/settings-logic.h +++ b/ps3/settings-logic.h @@ -241,32 +241,9 @@ static void producesettingentry(uint64_t switchvalue) case SETTING_ENABLE_SCREENSHOTS: if(CTRL_LEFT(state) || CTRL_LSTICK_LEFT(state) || CTRL_RIGHT(state) || CTRL_LSTICK_RIGHT(state)) { -#if(CELL_SDK_VERSION > 0x340000) - Settings.ScreenshotsEnabled = !Settings.ScreenshotsEnabled; - if(Settings.ScreenshotsEnabled) - { - 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) - Settings.ScreenshotsEnabled = false; -#endif } break; case SETTING_SAVE_SHADER_PRESET: