diff --git a/Makefile.griffin b/Makefile.griffin index 2844bcdb7d..a9e88902bf 100644 --- a/Makefile.griffin +++ b/Makefile.griffin @@ -46,12 +46,12 @@ ifeq ($(platform), ngc) CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT) LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT) ELF2DOL = $(DEVKITPPC)/bin/elf2dol$(EXE_EXT) - DOL_TARGET := retroarch_ngc.dol - ELF_TARGET := retroarch_ngc.elf + EXT_TARGET := $(TARGET_NAME)_ngc.dol + EXT_INTER_TARGET := $(TARGET_NAME)_ngc.elf INCLUDE += -I. -I$(DEVKITPRO)/libogc/include -Ideps/rzlib LIBDIRS += -L$(DEVKITPRO)/libogc/lib/cube -L. MACHDEP := -DGEKKO -DHW_DOL -mogc -mcpu=750 -meabi -mhard-float - LDFLAGS += $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map + LDFLAGS += $(MACHDEP) -Wl,-Map,$(notdir $(EXT_INTER_TARGET)).map ifeq ($(BIG_STACK), 1) LDFLAGS += -T gx/ld/ogc.ld endif @@ -61,28 +61,43 @@ ifeq ($(HAVE_LOGGER), 1) endif PLATCFLAGS := -DGEKKO - HAVE_THREADS := 1 + HAVE_THREADS := 1 + HAVE_ZLIB := 1 else ifeq ($(platform), wii) CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT) LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT) ELF2DOL = $(DEVKITPPC)/bin/elf2dol$(EXE_EXT) - DOL_TARGET := retroarch_wii.dol - ELF_TARGET := retroarch_wii.elf + EXT_TARGET := $(TARGET_NAME)_wii.dol + EXT_INTER_TARGET := $(TARGET_NAME)_wii.elf INCLUDE += -I. -I$(DEVKITPRO)/libogc/include -Ideps/rzlib LIBDIRS += -L$(DEVKITPRO)/libogc/lib/wii -L. MACHDEP := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float - LDFLAGS += $(MACHDEP) -Wl,-Map,$(notdir $(ELF_TARGET)).map,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,strdup,-wrap,strndup,-wrap,malloc_usable_size + LDFLAGS += $(MACHDEP) -Wl,-Map,$(notdir $(EXT_INTER_TARGET)).map,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,strdup,-wrap,strndup,-wrap,malloc_usable_size ifeq ($(BIG_STACK), 1) LDFLAGS += -T gx/ld/rvl.ld endif LIBS := -lfat $(WHOLE_START) -lretro_wii $(WHOLE_END) -logc -lwiiuse -lbte APP_BOOTER_DIR = wii/app_booter PLATOBJS := $(APP_BOOTER_DIR)/app_booter.binobj - PLATCFLAGS := -DGEKKO -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RARCH_EXEC + PLATCFLAGS := -DGEKKO - HAVE_THREADS := 1 - HAVE_RSOUND := 1 + HAVE_RARCH_EXEC := 1 + HAVE_THREADS := 1 + HAVE_RSOUND := 1 + HAVE_LIBRETRO_MANAGEMENT := 1 + HAVE_ZLIB := 1 +else ifeq ($(platform), psp1) + CC = psp-gcc$(EXE_EXT) + CXX = psp-g++$(EXE_EXT) + LD = psp-ld$(EXE_EXT) + INCLUDE += -I$(PSPSDK)/psp/sdk/include + EXT_TARGET := $(TARGET_NAME)_psp1.elf + EXT_INTER_TARGET := $(TARGET_NAME)_psp1.elf + PLATCFLAGS := -DPSP -D_PSP_FW_VERSION=150 -G0 + + HAVE_LIBRETRO_MANAGEMENT := 1 + HAVE_RPNG := 1 endif CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE) @@ -100,19 +115,37 @@ endif ifeq ($(HAVE_LOGGER), 1) CFLAGS += -DHAVE_LOGGER CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -CFLAGS += -Iconsole/logger +INCLUDE += -Iconsole/logger +endif + +ifeq ($(HAVE_LIBRETRO_MANAGEMENT), 1) +CFLAGS += -DHAVE_LIBRETRO_MANAGEMENT +endif + +ifeq ($(HAVE_RPNG), 1) +CFLAGS += -DWANT_RPNG endif ifeq ($(HAVE_FILE_LOGGER), 1) CFLAGS += -DHAVE_FILE_LOGGER -CFLAGS += -Iconsole/logger +INCLUDE += -Iconsole/logger endif +ifeq ($(HAVE_RARCH_EXEC), 1) +CFLAGS += -DHAVE_RARCH_EXEC +endif -CFLAGS += -std=gnu99 -DSINC_LOWER_QUALITY -DHAVE_RGUI -DHAVE_MENU -DRARCH_CONSOLE -DHAVE_ZLIB -DWANT_MINIZ -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -Wno-char-subscripts -DRARCH_INTERNAL +ifeq ($(HAVE_ZLIB), 1) +CFLAGS += -DHAVE_ZLIB -DWANT_MINIZ +endif + +CFLAGS += -std=gnu99 -DSINC_LOWER_QUALITY -DHAVE_RGUI -DHAVE_MENU -DRARCH_CONSOLE -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -Wno-char-subscripts -DRARCH_INTERNAL ifeq ($(HAVE_THREADS), 1) CFLAGS += -DHAVE_THREADS +ifeq ($(platform), psp1) +LIBS += -lpthread-psp +endif endif ifeq ($(HAVE_RSOUND), 1) @@ -121,16 +154,18 @@ endif ifeq ($(DEBUG), 1) CFLAGS += -O0 -g -DDEBUG +else ifeq ($(platform), psp1) + CFLAGS += -O2 else CFLAGS += -O3 endif -all: $(DOL_TARGET) +all: $(EXT_TARGET) %.dol: %.elf $(ELF2DOL) $< $@ -$(ELF_TARGET): $(OBJ) +$(EXT_INTER_TARGET): $(OBJ) $(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS) %.o: %.c @@ -147,14 +182,16 @@ $(APP_BOOTER_DIR)/app_booter.bin: pkg: all ifeq ($(platform), wii) - cp -r $(DOL_TARGET) wii/pkg/CORE.dol + cp -r $(EXT_TARGET) wii/pkg/CORE.dol else ifeq ($(platform), ngc) - cp -r $(DOL_TARGET) ngc/pkg/CORE.dol + cp -r $(EXT_TARGET) ngc/pkg/CORE.dol +else ifeq ($(platform), psp1) + psp-fixup-imports$(EXT) $(EXT_TARGET) endif clean: - rm -f $(DOL_TARGET) - rm -f $(ELF_TARGET) + rm -f $(EXT_TARGET) + rm -f $(EXT_INTER_TARGET) rm -f $(OBJ) ifeq ($(platform), wii) $(MAKE) -C $(APP_BOOTER_DIR) clean diff --git a/frontend/platform/platform_psp.c b/frontend/platform/platform_psp.c index 3e73285261..d8057bc182 100644 --- a/frontend/platform/platform_psp.c +++ b/frontend/platform/platform_psp.c @@ -116,7 +116,10 @@ static int psp_process_args(int argc, char *argv[], void *args) { strlcpy(g_extern.fullpath, argv[1], sizeof(g_extern.fullpath)); g_extern.lifecycle_state |= (1ULL << MODE_LOAD_GAME); + return 1; } + + return 0; } const frontend_ctx_driver_t frontend_ctx_psp = { diff --git a/gfx/image.c b/gfx/image.c index 99e5b682bb..9f47be6c35 100644 --- a/gfx/image.c +++ b/gfx/image.c @@ -189,6 +189,7 @@ bool texture_image_load_argb_shift(const char *path, struct texture_image *out_i unsigned a_shift, unsigned r_shift, unsigned g_shift, unsigned b_shift) { unsigned i; + (void)i; if (strstr(path, ".tga")) return texture_image_load_tga_shift(path, out_img, a_shift, r_shift, g_shift, b_shift); #ifdef HAVE_ZLIB diff --git a/psp/psp_input.c b/psp/psp_input.c index 2d646e9a30..d404b303ca 100644 --- a/psp/psp_input.c +++ b/psp/psp_input.c @@ -88,6 +88,7 @@ static void psp_input_set_keybinds(void *data, unsigned device, unsigned port, static void psp_input_poll(void *data) { + int32_t ret; uint64_t *lifecycle_state = (uint64_t*)&g_extern.lifecycle_state; SceCtrlData state_tmp; psp_input_t *psp = (psp_input_t*)data; @@ -96,7 +97,8 @@ static void psp_input_poll(void *data) sceCtrlSetSamplingCycle(0); #endif sceCtrlSetSamplingMode(DEFAULT_SAMPLING_MODE); - int ret = CtrlReadBufferPositive(0, &state_tmp, 1); + ret = CtrlReadBufferPositive(0, &state_tmp, 1); + (void)ret; psp->analog_state[0][0][0] = psp->analog_state[0][0][1] = psp->analog_state[0][1][0] = psp->analog_state[0][1][1] = 0; psp->pad_state = 0;