diff --git a/Makefile b/Makefile index ff8d1bb..8eef4a7 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ TARGET ?= pcsx CFLAGS += -Wall -Iinclude -ffast-math ifeq ($(DEBUG), 1) CFLAGS += -O0 -ggdb +else ifneq (,$(OPTIMIZE)) +CFLAGS += $(OPTIMIZE) else ifeq ($(platform), $(filter $(platform), vita ctr)) CFLAGS += -O3 -DNDEBUG diff --git a/Makefile.libretro b/Makefile.libretro index 069290c..692d998 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -394,6 +394,27 @@ else ifeq ($(platform), rpi4_64) fpic := -fPIC CFLAGS += -march=armv8-a+crc+simd -mtune=cortex-a72 -ftree-vectorize +else ifeq ($(platform), trimui) + TARGET := $(TARGET_NAME)_libretro.so + CC = $(CROSS_COMPILE)gcc + CXX = $(CROSS_COMPILE)g++ + + CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s + CFLAGS += -DGPULIB_USE_MMAP -DGPU_UNAI_USE_INT_DIV_MULTINV -D_TRIMUI + CFLAGS += -ffast-math -fdata-sections -ffunction-sections -fsingle-precision-constant -flto -fno-PIC + LDFLAGS += -flto + ifeq (,$(DEBUG)) + LDFLAGS += -s + endif + CPU_ARCH := arm + OPTIMIZE := -Ofast -DNDEBUG + + DRC_CACHE_BASE = 0 + BUILTIN_GPU = unai + DYNAREC = ari64 + ARCH = arm + HAVE_NEON = 0 + # Classic Platforms #################### # Platform affix = classic__<µARCH> # Help at https://modmyclassic.com/comp @@ -519,6 +540,13 @@ CFLAGS += $(fpic) MAIN_LDFLAGS += -shared MAIN_LDLIBS += $(LIBPTHREAD) $(LIBM) $(LIBDL) $(LIBZ) +ifeq ($(PROFILE), GENERATE) + CFLAGS += -fprofile-generate=./profile/pcsx_rearmed + LDFLAGS += -lgcov +else ifeq ($(PROFILE), APPLY) + CFLAGS += -fprofile-use -fprofile-dir=../profile/pcsx_rearmed -fbranch-probabilities +endif + # enable large file support if available ifeq ($(shell $(CC) -E -dD $(CFLAGS) include/arm_features.h | grep __SIZEOF_LONG__ | awk '{print $$3}'),4) CFLAGS += -D_FILE_OFFSET_BITS=64 diff --git a/frontend/libretro.c b/frontend/libretro.c index 938b8e5..dcc16ef 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -3057,7 +3057,7 @@ void retro_init(void) * we have to do this because cache misses and some IO penalties * are not emulated. Warning: changing this may break compatibility. */ Config.cycle_multiplier = CYCLE_MULT_DEFAULT; -#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) +#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) && !defined(_TRIMUI) Config.cycle_multiplier = 200; #endif pl_rearmed_cbs.gpu_peops.iUseDither = 1; diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h index 4165237..c34008a 100644 --- a/frontend/libretro_core_options.h +++ b/frontend/libretro_core_options.h @@ -203,7 +203,7 @@ struct retro_core_option_v2_definition option_defs_us[] = { "PSX CPU Clock Speed", NULL, "Overclock or under-clock the PSX CPU. Try adjusting this if the game is too slow, too fast or hangs." -#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) +#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) && !defined(_TRIMUI) " Default is 50." #else " Default is 57." @@ -285,7 +285,7 @@ struct retro_core_option_v2_definition option_defs_us[] = { { "100", NULL }, { NULL, NULL }, }, -#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) +#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) && !defined(_TRIMUI) "50", #else "57", @@ -303,7 +303,7 @@ struct retro_core_option_v2_definition option_defs_us[] = { { "enabled", NULL }, { NULL, NULL }, }, -#if defined HAVE_LIBNX || defined _3DS +#if defined HAVE_LIBNX || defined _3DS || defined _TRIMUI "disabled", #else "enabled", diff --git a/frontend/main.c b/frontend/main.c index cf015a4..beaee12 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -165,7 +165,7 @@ void emu_set_default_config(void) spu_config.iTempo = 0; // may cause issues, no effect if only 1 core is detected spu_config.iUseThread = 0; -#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) /* XXX GPH hack */ +#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) && !defined(_TRIMUI) /* XXX GPH hack */ spu_config.iUseReverb = 0; spu_config.iUseInterpolation = 0; #ifndef HAVE_LIBRETRO