From baacd5e1b6563ec76b95bb80e49931da4953083e Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Tue, 18 Sep 2018 00:00:20 +0200 Subject: [PATCH] Make compile libretro for PS2 --- Makefile.libretro | 23 +++++++++++++++++++++++ cpu/drc/cmn.h | 2 ++ pico/memory.h | 2 ++ platform/ps2/stdint.h | 16 ++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 platform/ps2/stdint.h diff --git a/Makefile.libretro b/Makefile.libretro index 9d1f5bd7..735cdfa0 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -254,6 +254,29 @@ else ifeq ($(platform), psp1) use_drz80 = 0 use_cz80 = 1 +# PS2 +else ifeq ($(platform), ps2) + TARGET := $(TARGET_NAME)_libretro_$(platform).a + CC = ee-gcc$(EXE_EXT) + AR = ee-ar$(EXE_EXT) + CFLAGS += -G0 -DPS2 -DUTYPES_DEFINED -fsingle-precision-constant + CFLAGS += -I$(PS2SDK)/ports/include -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include -Iplatform/ps2 + STATIC_LINKING = 1 + NO_MMAP = 1 + DONT_COMPILE_IN_ZLIB = 1 + + asm_memory = 0 + asm_render = 1 + 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 + # CTR (3DS) else ifeq ($(platform), ctr) TARGET := $(TARGET_NAME)_libretro_$(platform).a diff --git a/cpu/drc/cmn.h b/cpu/drc/cmn.h index 39463566..f5c595f2 100644 --- a/cpu/drc/cmn.h +++ b/cpu/drc/cmn.h @@ -1,9 +1,11 @@ +#ifndef UTYPES_DEFINED typedef unsigned char u8; typedef signed char s8; typedef unsigned short u16; typedef signed short s16; typedef unsigned int u32; typedef signed int s32; +#endif #define DRC_TCACHE_SIZE (2*1024*1024) diff --git a/pico/memory.h b/pico/memory.h index eb440dd4..c878a40f 100644 --- a/pico/memory.h +++ b/pico/memory.h @@ -2,9 +2,11 @@ #include "pico_port.h" +#ifndef UTYPES_DEFINED typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; +#endif typedef uintptr_t uptr; // unsigned pointer-sized int #define M68K_MEM_SHIFT 16 diff --git a/platform/ps2/stdint.h b/platform/ps2/stdint.h new file mode 100644 index 00000000..5638fa39 --- /dev/null +++ b/platform/ps2/stdint.h @@ -0,0 +1,16 @@ +#ifndef STDINT_H +#define STDINT_H + +typedef unsigned long uintptr_t; +typedef signed long intptr_t; + +typedef signed char int8_t; +typedef signed short int16_t; +typedef signed int int32_t; +typedef signed long int64_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +typedef unsigned long uint64_t; + +#endif //STDINT_H