Skip to content

Commit ead14d0

Browse files
authored
Merge pull request #46 from Poligraf/retrofw
add retrofw target
2 parents 0f3f04b + c2d6182 commit ead14d0

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

.gitlab-ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ include:
9191
# tvOS (AppleTV)
9292
- project: 'libretro-infrastructure/ci-templates'
9393
file: '/tvos-arm64.yml'
94+
95+
# OpenDingux
96+
- project: 'libretro-infrastructure/ci-templates'
97+
file: '/dingux-mips32.yml'
9498

9599
#################################### MISC ##################################
96100
# Emscripten
@@ -242,6 +246,12 @@ libretro-build-libnx-aarch64:
242246
extends:
243247
- .libretro-libnx-static-retroarch-master
244248
- .core-defs
249+
250+
# RetroFW
251+
libretro-build-retrofw-mips32:
252+
extends:
253+
- .libretro-retrofw-mips32-make-default
254+
- .core-defs
245255

246256
#################################### MISC ##################################
247257
# Emscripten

Makefile.libretro

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,27 @@ else ifeq ($(platform), gcw0)
376376
CFLAGS += $(PTHREAD_FLAGS) -DHAVE_MKDIR
377377
CFLAGS += -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float
378378

379+
# RETROFW (needs retrofw 2.3 dev version or above) - crashes on 2.2 or under likely
380+
else ifeq ($(platform), retrofw)
381+
TARGET := $(TARGET_NAME)_libretro.so
382+
HAS_GPU=0
383+
CC = /opt/retrofw-toolchain/usr/bin/mipsel-linux-gcc
384+
CXX = /opt/retrofw-toolchain/usr/bin/mipsel-linux-g++
385+
AR = /opt/retrofw-toolchain/usr/bin/mipsel-linux-ar
386+
fpic := -fPIC
387+
SHARED := -shared -Wl,-no-undefined -Wl,--version-script=$(CORE_DIR)/link.T
388+
LDFLAGS += $(PTHREAD_FLAGS) -flto -mplt
389+
CFLAGS += $(PTHREAD_FLAGS) -DHAVE_MKDIR
390+
CFLAGS += -Ofast
391+
CFLAGS += -DRETROFW
392+
CFLAGS += -march=mips32 -mtune=mips32 -mhard-float
393+
CFLAGS += -falign-functions=1 -falign-jumps=1 -falign-loops=1
394+
CFLAGS += -fomit-frame-pointer -ffast-math -fmerge-all-constants -flto
395+
CFLAGS += -funsafe-math-optimizations -fsingle-precision-constant -fexpensive-optimizations
396+
CFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops
397+
CFLAGS += -fmerge-all-constants -fno-math-errno -fno-stack-protector -fno-ident
398+
CFLAGS += -DRETROFW
399+
379400
# Windows MSVC 2003 Xbox 1
380401
else ifeq ($(platform), xbox1_msvc2003)
381402
TARGET := $(TARGET_NAME)_libretro_xdk1.lib
@@ -761,4 +782,3 @@ clean:
761782

762783
.PHONY: clean
763784
endif
764-

libretro.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static float SCALEY = 1.;
5656
static struct retro_hw_render_callback hw_render;
5757
#endif
5858

59-
#ifdef _3DS
59+
#if defined(_3DS) || defined(RETROFW)
6060
#define BUFSZ 135300
6161
#else
6262
#define BUFSZ 2164800
@@ -177,7 +177,7 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
177177
info->timing.sample_rate = 44100;
178178
info->geometry.base_width = WIDTH;
179179
info->geometry.base_height = HEIGHT;
180-
#ifdef _3DS
180+
#if defined(_3DS) || defined(RETROFW)
181181
info->geometry.max_width = 330;
182182
info->geometry.max_height = 410;
183183
#else

0 commit comments

Comments
 (0)