(PS3) RetroArch compiles as a static library - and gets linked in

with the rest of the package - README for compilation instructions
updated
This commit is contained in:
Twinaphex 2012-06-20 08:25:23 +02:00
parent eae8ac714f
commit 47b3453c29
17 changed files with 115 additions and 27 deletions

View File

@ -45,8 +45,7 @@ PYTHON2 = python2.exe
GIT = git.exe
endif
PPU_SRCS = console/griffin/griffin.c \
console/rzlib/rzlib.c
PPU_SRCS = ps3/frontend/main.c ps3/frontend/menu.c
ifeq ($(HAVE_RGL), 1)
DEFINES = -DHAVE_RGL
@ -66,7 +65,7 @@ else
endif
PPU_LDLIBS = -ldbgfont $(GL_LIBS) -lretro -lcgc -lgcm_cmd -lgcm_sys_stub -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysutil_game_stub -lsysutil_screenshot_stub -lsysutil_np_stub -lpngdec_stub -ljpgdec_stub -lsysmodule_stub -laudio_stub -lnet_stub -lnetctl_stub -lpthread
PPU_LDLIBS = -ldbgfont $(GL_LIBS) -lretroarch -lretro -lcgc -lgcm_cmd -lgcm_sys_stub -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysutil_game_stub -lsysutil_screenshot_stub -lsysutil_np_stub -lpngdec_stub -ljpgdec_stub -lsysmodule_stub -laudio_stub -lnet_stub -lnetctl_stub -lpthread
DEFINES += -DHAVE_DEFAULT_RETROPAD_INPUT -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OPENGL_TEXREF -DHAVE_HEADSET -DHAVE_VID_CONTEXT -DHAVE_OPENGLES -DHAVE_CG -DHAVE_CG_MENU -DHAVE_FILEBROWSER -DHAVE_FBO -DHAVE_RARCH_MAIN_WRAP -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RGL -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_OSKUTIL -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)

60
Makefile.ps3.retroarch Normal file
View File

@ -0,0 +1,60 @@
RARCH_VERSION = "0.9.6"
#which compiler to build with - GCC or SNC
#set to GCC for debug builds for use with debugger
CELL_BUILD_TOOLS = SNC
CELL_GPU_TYPE = RSX
CELL_PSGL_VERSION = ultra-opt
DEBUG = 0
HAVE_RGL = 1
HAVE_LOGGER = 0
PC_DEVELOPMENT_IP_ADDRESS = "192.168.1.7"
PC_DEVELOPMENT_UDP_PORT = 3490
CELL_MK_DIR ?= $(CELL_SDK)/samples/mk
include $(CELL_MK_DIR)/sdk.makedef.mk
PPU_LIB_TARGET = libretroarch.a
LDDIRS = -L. -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt
INCDIRS = -I. -Ips3 -Icommon
PPU_SRCS = console/griffin/griffin.c console/rzlib/rzlib.c
ifeq ($(HAVE_RGL), 1)
DEFINES = -DHAVE_RGL
GL_LIBS := -lrgl
else
GL_LIBS := -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt -lPSGL -lPSGLcgc
endif
ifeq ($(CELL_BUILD_TOOLS), SNC)
PPU_CXXLD = $(CELL_SDK)/host-win32/sn/bin/ps3ppuld.exe
PPU_CXX = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
PPU_CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
SNC_PPU_AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
else
PPU_CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe
PPU_CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
PPU_CXXLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe
endif
DEFINES += -DHAVE_DEFAULT_RETROPAD_INPUT -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OPENGL_TEXREF -DHAVE_HEADSET -DHAVE_VID_CONTEXT -DHAVE_OPENGLES -DHAVE_CG -DHAVE_CG_MENU -DHAVE_FILEBROWSER -DHAVE_FBO -DHAVE_RARCH_MAIN_WRAP -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RGL -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_OSKUTIL -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
ifeq ($(DEBUG), 1)
PPU_OPTIMIZE_LV := -O0 -g
else
PPU_OPTIMIZE_LV := -O3 -g
endif
PPU_CFLAGS = $(PPU_OPTIMIZE_LV) $(INCDIRS) $(DEFINES)
PPU_CXXFLAGS = $(PPU_OPTIMIZE_LV) $(INCDIRS) $(DEFINES)
ifeq ($(HAVE_LOGGER), 1)
PPU_CFLAGS += -DHAVE_LOGGER
PPU_SRCS += console/logger/logger.c
endif
include $(CELL_MK_DIR)/sdk.target.mk

View File

@ -100,7 +100,11 @@ RetroArch PS3 needs to be compiled in the following order:
<tt>make -f Makefile.ps3.rgl</tt>
3) Finally, compile RetroArch itself
3) Compile RetroArch as a library
<tt>make -f Makefile.ps3.retroarch</tt>
4) Finally, compile RetroArch packed together with the GUI:
<tt>make -f Makefile.ps3</tt>

View File

@ -493,6 +493,11 @@ void rarch_input_set_controls_default (void)
rarch_input_set_default_keybinds(x);
}
const char *rarch_input_get_default_keybind_name(unsigned id)
{
return rarch_default_libretro_keybind_name_lut[id];
}
#endif
void rarch_input_set_default_keybind_names_for_emulator(void)

View File

@ -21,6 +21,7 @@
#include "libretro_mgmt.h"
#endif
#include "../general.h"
#include "console_settings.h"
#define IS_TIMER_NOT_EXPIRED(handle) (handle->frame_count < g_console.timer_expiration_frame_count)
@ -156,10 +157,12 @@ uint64_t rarch_input_find_next_platform_key(uint64_t joykey);
// Sets custom default keybind names (some systems emulated by the emulator
// will need different keybind names for buttons, etc.)
void rarch_input_set_default_keybind_names_for_emulator(void);
void rarch_input_set_default_keybinds(unsigned player);
void rarch_input_set_keybind(unsigned player, unsigned keybind_action, uint64_t default_retro_joypad_id);
void rarch_input_set_controls_default (void);
const char *rarch_input_get_default_keybind_name (unsigned id);
#endif

View File

@ -21,6 +21,7 @@
#include <stdint.h>
#include <stdlib.h>
#include "../../general.h"
typedef struct
{

View File

@ -202,9 +202,7 @@ REWIND
/*============================================================
MAIN
============================================================ */
#if defined(__CELLOS_LV2__)
#include "../../ps3/main.c"
#elif defined(_XBOX)
#if defined(_XBOX)
#include "../../360/main.c"
#elif defined(GEKKO)
#include "../../wii/main.c"
@ -232,9 +230,7 @@ NETPLAY
/*============================================================
MENU
============================================================ */
#if defined(__CELLOS_LV2__)
#include "../../ps3/menu.c"
#elif defined(_XBOX)
#if defined(_XBOX)
#include "../../360/menu.cpp"
#elif defined(GEKKO)
#include "../rgui/rgui.c"

View File

@ -26,7 +26,7 @@
#include "../gl_common.h"
#include "../image.h"
#include "../../ps3/shared.h"
#include "../../ps3/frontend/shared.h"
#include "ps3_ctx.h"

View File

@ -17,4 +17,12 @@
#ifndef _PS3_CTX_H
#define _PS3_CTX_H
void gfx_ctx_get_available_resolutions (void);
int gfx_ctx_check_resolution(unsigned resolution_id);
const char *ps3_get_resolution_label(uint32_t resolution);
void gfx_ctx_set_projection(gl_t *gl, const struct gl_ortho *ortho, bool allow_rotate);
void gfx_ctx_set_aspect_ratio(void *data, unsigned aspectratio_index);
void gfx_ctx_set_overscan(void);
void gfx_ctx_set_fbo(bool enable);
#endif

View File

@ -17,4 +17,9 @@
#ifndef _XDK360_CTX_H
#define _XDK360_CTX_H
void gfx_ctx_set_projection(xdk360_video_t *d3d9, const struct gl_ortho *ortho, bool allow_rotate);
void gfx_ctx_set_aspect_ratio(void *data, unsigned aspectratio_index);
void gfx_ctx_set_overscan(void);
int gfx_ctx_check_resolution(unsigned resolution_id);
#endif

View File

@ -39,13 +39,15 @@
#include <np.h>
#include <np/drm.h>
#include "ps3_input.h"
#include "../ps3_input.h"
#include "../console/console_ext.h"
#include "../conf/config_file.h"
#include "../conf/config_file_macros.h"
#include "../general.h"
#include "../file.h"
#include "../../gfx/gl_common.h"
#include "../../console/console_ext.h"
#include "../../conf/config_file.h"
#include "../../conf/config_file_macros.h"
#include "../../general.h"
#include "../../file.h"
#include "shared.h"
@ -115,7 +117,7 @@ static void set_default_settings(void)
g_console.fbo_enabled = true;
g_console.mode_switch = MODE_MENU;
g_console.screen_orientation = ORIENTATION_NORMAL;
g_console.current_resolution_id = CELL_VIDEO_OUT_RESOLUTION_UNDEFINED;
g_console.current_resolution_id = 0;
strlcpy(g_console.default_rom_startup_dir, "/", sizeof(g_console.default_rom_startup_dir));
strlcpy(g_console.default_savestate_dir, usrDirPath, sizeof(g_console.default_savestate_dir));
strlcpy(g_console.default_sram_dir, usrDirPath, sizeof(g_console.default_sram_dir));

View File

@ -23,16 +23,20 @@
#include <sysutil/sysutil_bgmplayback.h>
#endif
#include "ps3_input.h"
#include "../console/fileio/file_browser.h"
#include "../ps3_input.h"
#include "../../console/fileio/file_browser.h"
#include "../console/console_ext.h"
#include "../../console/console_ext.h"
#include "../gfx/gl_common.h"
#include "../../gfx/gl_common.h"
#include "../../gfx/gl_font.h"
#include "../../gfx/gfx_context.h"
#include "../../gfx/context/ps3_ctx.h"
#include "../../gfx/shader_cg.h"
#include "shared.h"
#include "../file.h"
#include "../general.h"
#include "../../file.h"
#include "../../general.h"
#include "menu.h"
#include "menu-entries.h"
@ -702,7 +706,8 @@ static void set_setting_label(menu * menu_obj, uint64_t currentsetting)
else
menu_obj->items[currentsetting].text_color = ORANGE;
const char * value = rarch_input_find_platform_key_label(g_settings.input.binds[currently_selected_controller_menu][currentsetting-(FIRST_CONTROL_BIND)].joykey);
snprintf(menu_obj->items[currentsetting].text, sizeof(menu_obj->items[currentsetting].text), rarch_default_libretro_keybind_name_lut[currentsetting-(FIRST_CONTROL_BIND)]);
unsigned id = currentsetting - FIRST_CONTROL_BIND;
snprintf(menu_obj->items[currentsetting].text, sizeof(menu_obj->items[currentsetting].text), rarch_input_get_default_keybind_name(id));
snprintf(menu_obj->items[currentsetting].comment, sizeof(menu_obj->items[currentsetting].comment), "INFO - [%s] on the PS3 controller is mapped to action:\n[%s].", menu_obj->items[currentsetting].text, value);
snprintf(menu_obj->items[currentsetting].setting_text, sizeof(menu_obj->items[currentsetting].setting_text), value);
}

View File

@ -16,7 +16,7 @@
#include "../driver.h"
#include "../general.h"
#include "shared.h"
#include "frontend/shared.h"
#include <stdlib.h>
#include <cell/audio.h>
#include <sys/timer.h>

View File

@ -33,7 +33,7 @@
#include "../console/console_ext.h"
#include "../libretro.h"
#include "../general.h"
#include "shared.h"
#include "frontend/shared.h"
/*============================================================
PS3 MOUSE