From bee555aeac5dae1cd0567606eb6d42cd1ca0ddc4 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 4 Mar 2014 06:13:46 +0100 Subject: [PATCH] (PSP/PS3) Resolve namespace conflict with memcpy16 for PS3 - Fix remaining PSP build problems --- Makefile | 2 ++ Makefile.libretro | 67 +++++++++++++++++++++++++++++++++++++++------ pico/misc.c | 2 +- pico/misc_arm.s | 4 +-- pico/pico_int.h | 2 +- pico/videoport.c | 2 +- platform/libretro.c | 4 --- 7 files changed, 66 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 9201afb0..633f0bc9 100644 --- a/Makefile +++ b/Makefile @@ -152,10 +152,12 @@ else OBJS += platform/common/mp3_dummy.o endif +ifneq "$(DONT_COMPILE_IN_ZLIB)" "1" # zlib OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \ zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o # unzip +endif OBJS += unzip/unzip.o unzip/unzip_stream.o diff --git a/Makefile.libretro b/Makefile.libretro index a2a4dafc..004aaa9d 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -60,30 +60,77 @@ else ifeq ($(platform), ps3) CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ + STATIC_LINKING = 1 + NO_MMAP = 1 + DONT_COMPILE_IN_ZLIB = 1 + + asm_memory = 0 + asm_render = 0 + asm_ym2612 = 0 + asm_misc = 0 + asm_cdpico = 0 + asm_cdmemory = 0 + asm_mix = 0 + use_cyclone = 0 + use_fame = 1 + use_drz80 = 0 + use_cz80 = 1 else ifeq ($(platform), sncps3) TARGET := $(TARGET_NAME)_libretro_ps3.a CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ + STATIC_LINKING = 1 + NO_MMAP = 1 + DONT_COMPILE_IN_ZLIB = 1 + + asm_memory = 0 + asm_render = 0 + asm_ym2612 = 0 + asm_misc = 0 + asm_cdpico = 0 + asm_cdmemory = 0 + asm_mix = 0 + use_cyclone = 0 + use_fame = 1 + use_drz80 = 0 + use_cz80 = 1 else ifeq ($(platform), psl1ght) TARGET := $(TARGET_NAME)_libretro_psl1ght.a CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT) AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT) CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ + STATIC_LINKING = 1 + NO_MMAP = 1 + DONT_COMPILE_IN_ZLIB = 1 + + asm_memory = 0 + asm_render = 0 + asm_ym2612 = 0 + asm_misc = 0 + asm_cdpico = 0 + asm_cdmemory = 0 + asm_mix = 0 + use_cyclone = 0 + use_fame = 1 + use_drz80 = 0 + use_cz80 = 1 else ifeq ($(platform), psp1) TARGET := $(TARGET_NAME)_libretro_psp1.a CC = psp-gcc$(EXE_EXT) AR = psp-ar$(EXE_EXT) - CFLAGS += -DPSP -G0 + CFLAGS += -G0 STATIC_LINKING = 1 + NO_MMAP = 1 + DONT_COMPILE_IN_ZLIB = 1 -asm_memory = 0 -asm_render = 0 -asm_ym2612 = 0 -asm_misc = 0 -asm_cdpico = 0 -asm_cdmemory = 0 -asm_mix = 0 + asm_memory = 0 + asm_render = 0 + asm_ym2612 = 0 + asm_misc = 0 + asm_cdpico = 0 + asm_cdmemory = 0 + asm_mix = 0 use_cyclone = 0 use_fame = 1 use_drz80 = 0 @@ -146,6 +193,10 @@ else CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__ endif +ifeq ($(NO_MMAP),1) +CFLAGS += -DNO_MMAP +endif + ifeq ($(ARM_ASM),1) asm_memory = 1 asm_render = 1 diff --git a/pico/misc.c b/pico/misc.c index f9e85cda..ba24f95f 100644 --- a/pico/misc.c +++ b/pico/misc.c @@ -99,7 +99,7 @@ typedef struct int b7; } intblock; -PICO_INTERNAL_ASM void memcpy16(unsigned short *dest, unsigned short *src, int count) +PICO_INTERNAL_ASM void pmemcpy16(unsigned short *dest, unsigned short *src, int count) { if ((((long)dest | (long)src) & 3) == 0) { diff --git a/pico/misc_arm.s b/pico/misc_arm.s index 15662a7b..260094ec 100644 --- a/pico/misc_arm.s +++ b/pico/misc_arm.s @@ -6,9 +6,9 @@ * See COPYING file in the top-level directory. */ -.global memcpy16 @ unsigned short *dest, unsigned short *src, int count +.global pmemcpy16 @ unsigned short *dest, unsigned short *src, int count -memcpy16: +pmemcpy16: eor r3, r0, r1 tst r3, #2 bne mcp16_cant_align diff --git a/pico/pico_int.h b/pico/pico_int.h index 7447db94..09fb6458 100644 --- a/pico/pico_int.h +++ b/pico/pico_int.h @@ -768,7 +768,7 @@ PICO_INTERNAL_ASM unsigned int PicoVideoRead8(unsigned int a); extern int (*PicoDmaHook)(unsigned int source, int len, unsigned short **srcp, unsigned short **limitp); // misc.c -PICO_INTERNAL_ASM void memcpy16(unsigned short *dest, unsigned short *src, int count); +PICO_INTERNAL_ASM void pmemcpy16(unsigned short *dest, unsigned short *src, int count); PICO_INTERNAL_ASM void memcpy16bswap(unsigned short *dest, void *src, int count); PICO_INTERNAL_ASM void memcpy32(int *dest, int *src, int count); // 32bit word count PICO_INTERNAL_ASM void memset32(int *dest, int c, int count); diff --git a/pico/videoport.c b/pico/videoport.c index 6c876aea..7f37e41d 100644 --- a/pico/videoport.c +++ b/pico/videoport.c @@ -156,7 +156,7 @@ static void DmaSlow(int len) if (inc == 2 && !(a&1) && a+len*2 < 0x10000) { // most used DMA mode - memcpy16(r + (a>>1), pd, len); + pmemcpy16(r + (a>>1), pd, len); a += len*2; } else diff --git a/platform/libretro.c b/platform/libretro.c index 72b7a1be..8cda278a 100644 --- a/platform/libretro.c +++ b/platform/libretro.c @@ -6,10 +6,6 @@ * See COPYING file in the top-level directory. */ -#ifdef PSP -#define NO_MMAP -#endif - #define _GNU_SOURCE 1 // mremap #include #include -- 2.39.5