1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
diff --git a/Makefile b/Makefile
index a01c4df..3d08eea 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 1ecd359..432d700 100644
--- a/Makefile.libretro
+++ b/Makefile.libretro
@@ -347,6 +347,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_<ISA>_<µARCH>
# Help at https://modmyclassic.com/comp
@@ -459,6 +480,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 f3e3c2b..8497459 100644
--- a/frontend/libretro.c
+++ b/frontend/libretro.c
@@ -2944,7 +2944,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. */
cycle_multiplier = 175;
-#if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
+#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) && !defined(_TRIMUI)
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 a1b85d4..775ac58 100644
--- a/frontend/libretro_core_options.h
+++ b/frontend/libretro_core_options.h
@@ -516,7 +516,7 @@ struct retro_core_option_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",
@@ -541,7 +541,7 @@ struct retro_core_option_definition option_defs_us[] = {
{
"pcsx_rearmed_psxclock",
"PSX CPU Clock",
-#if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
+#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) && !defined(_TRIMUI)
"Overclock or underclock the PSX clock. Default is 50",
#else
"Overclock or underclock the PSX clock. Default is 57",
@@ -620,7 +620,7 @@ struct retro_core_option_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",
diff --git a/frontend/main.c b/frontend/main.c
index d3c7d40..7610146 100644
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -154,7 +154,7 @@ void emu_set_default_config(void)
spu_config.iVolume = 768;
spu_config.iTempo = 0;
spu_config.iUseThread = 1; // no effect if only 1 core is detected
-#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;
spu_config.iTempo = 1;
|