Skip to content

Commit

Permalink
Merge branch 'libretro:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanaobrien committed Feb 1, 2024
2 parents c134b7e + d907d65 commit 89e155f
Show file tree
Hide file tree
Showing 58 changed files with 1,482 additions and 866 deletions.
43 changes: 31 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
git config --global --add safe.directory $PWD
ver=$(cut -d'"' -f2 platform/common/version.h)-$(git rev-parse --short HEAD)
./configure --platform=gp2x
./configure --platform=gph
make -j2 PLATFORM_MP3=0
make -C platform/gp2x rel VER=$ver
mv PicoDrive_$ver.zip PicoDrive-gph_$ver.zip
Expand All @@ -62,17 +62,17 @@ jobs:
ver=$(cut -d'"' -f2 platform/common/version.h)-$(git rev-parse --short HEAD)
./configure --platform=pandora
make -j2
mv PicoDrive PicoDrive-pandora
${CROSS_COMPILE}strip PicoDrive-pandora
make -C platform/pandora rel VER=$ver
mv platform/pandora/PicoDrive_*.pnd .
- name: artifacts
uses: actions/upload-artifact@v3
with:
name: Pandora
path: PicoDrive-pandora
path: PicoDrive_*.pnd

build-psp:
runs-on: ubuntu-latest
container: ghcr.io/pspdev/pspdev
container: pspdev/pspdev
steps:
- name: build environment
run: |
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
run: |
git config --global --add safe.directory $PWD
ver=$(cut -d'"' -f2 platform/common/version.h)-$(git rev-parse --short HEAD)
./configure --platform=gcw0
./configure --platform=opendingux-gcw0
make -j2
mv PicoDrive.opk PicoDrive-gcw0-$ver.opk
- name: artifacts
Expand Down Expand Up @@ -161,19 +161,18 @@ jobs:
runs-on: ubuntu-latest
permissions:
packages: read
container: miyoocfw/toolchain
container: ghcr.io/irixxxx/toolchain-miyoo
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: build
run: |
export CROSS_COMPILE=arm-buildroot-linux-musleabi-
git config --global --add safe.directory /home/picodrive
git config --global --add safe.directory $PWD
ver=$(cut -d'"' -f2 platform/common/version.h)-$(git rev-parse --short HEAD)
./configure --platform=miyoo
make -j2
mv PicoDrive.zip PicoDrive-miyoo-$ver.zip
mv PicoDrive-miyoo.zip PicoDrive-miyoo-$ver.zip
- name: artifacts
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -211,7 +210,7 @@ jobs:
run: |
git config --global --add safe.directory $PWD
ver=$(cut -d'"' -f2 platform/common/version.h)-$(git rev-parse --short HEAD)
./configure --platform=opendingux
./configure --platform=odbeta
make -j2
mv PicoDrive.opk PicoDrive-odbeta-gcw0-$ver.opk
- name: artifacts
Expand All @@ -231,11 +230,31 @@ jobs:
run: |
git config --global --add safe.directory $PWD
ver=$(cut -d'"' -f2 platform/common/version.h)-$(git rev-parse --short HEAD)
./configure --platform=opendingux
./configure --platform=odbeta
make -j2
mv PicoDrive.opk PicoDrive-odbeta-lepus-$ver.opk
- name: artifacts
uses: actions/upload-artifact@v3
with:
name: ODbeta lepus
path: PicoDrive-odbeta-*.opk

build-odbeta-rg99:
runs-on: ubuntu-latest
container: ghcr.io/irixxxx/toolchain-odbeta-rs90
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: build
run: |
git config --global --add safe.directory $PWD
ver=$(cut -d'"' -f2 platform/common/version.h)-$(git rev-parse --short HEAD)
./configure --platform=odbeta
make -j2
mv PicoDrive.opk PicoDrive-odbeta-rg99-$ver.opk
- name: artifacts
uses: actions/upload-artifact@v3
with:
name: ODbeta rg99
path: PicoDrive-odbeta-*.opk
36 changes: 14 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ endif
chkCCflag = $(shell n=/dev/null; echo $(1) | tr " " "\n" | while read f; do \
$(CC) $$f -x c -c $$n -o $$n 2>$$n && echo "_$$f" | tr -d _; done)

ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","gp2x" "opendingux" "miyoo" "rpi1"))
ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","gp2x" "opendingux" "rpi1"))
# very small caches, avoid optimization options making the binary much bigger
CFLAGS += -fno-common -finline-limit=42 -fno-unroll-loops -ffast-math
CFLAGS += $(call chkCCflag, -fno-stack-protector)
ifneq ($(call chkCCflag, -fipa-ra),) # gcc >= 5
CFLAGS += $(call chkCCflag, -flto -fipa-pta -fipa-ra)
else
# these improve execution speed on 32bit arm/mips with gcc pre-5 toolchains
CFLAGS += -fno-caller-saves -fno-guess-branch-probability -fno-regmove
CFLAGS += $(call chkCCflag, -fno-caller-saves -fno-guess-branch-probability -fno-regmove)
# very old gcc toolchains may not have these options
CFLAGS += $(call chkCCflag, -fno-tree-loop-if-convert -fipa-pta -fno-ipa-cp)
endif
Expand Down Expand Up @@ -136,11 +136,18 @@ $(TARGET)-dge.zip: .od_data
all: $(TARGET)-dge.zip
CFLAGS += -DSDL_SURFACE_SW # some legacy dinguces had bugs in HWSURFACE
else
ifneq (,$(filter %__MIYOO__, $(CFLAGS)))
$(TARGET)-miyoo.zip: .od_data
rm -f .od_data/default.*.desktop .od_data/PicoDrive.dge
cd .od_data && zip -9 -r ../$@ *
all: $(TARGET)-miyoo.zip
else
$(TARGET).opk: .od_data
rm -f .od_data/PicoDrive.dge
mksquashfs .od_data $@ -all-root -noappend -no-exports -no-xattrs
all: $(TARGET).opk
endif
endif

ifneq (,$(filter %mips32r2, $(CFLAGS)))
CFLAGS += -DMIPS_USE_SYNCI # mips32r2 clear_cache uses SYNCI instead of a syscall
Expand All @@ -152,22 +159,6 @@ use_inputmap ?= 1
# OpenDingux is a generic platform, really.
PLATFORM := generic
endif
ifeq "$(PLATFORM)" "miyoo"
$(TARGET).zip: $(TARGET)
$(RM) -rf .od_data
mkdir .od_data
cp -r platform/opendingux/data/. .od_data
cp platform/game_def.cfg .od_data
cp $< .od_data/PicoDrive
$(STRIP) .od_data/PicoDrive
rm -f .od_data/default.*.desktop .od_data/PicoDrive.dge
cd .od_data && zip -9 -r ../$@ *
all: $(TARGET).zip

OBJS += platform/opendingux/inputmap.o
use_inputmap ?= 1
PLATFORM := generic
endif
ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","rpi1" "rpi2"))
CFLAGS += -DHAVE_GLES -DRASPBERRY
CFLAGS += -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads/ -I/opt/vc/include/interface/vmcs_host/linux/
Expand All @@ -181,7 +172,7 @@ endif
OBJS += platform/linux/emu.o platform/linux/blit.o # FIXME
OBJS += platform/common/plat_sdl.o platform/common/input_sdlkbd.o
OBJS += platform/libpicofe/plat_sdl.o platform/libpicofe/in_sdl.o
OBJS += platform/libpicofe/plat_dummy.o platform/libpicofe/linux/plat.o
OBJS += platform/libpicofe/linux/plat.o
USE_FRONTEND = 1
endif
ifeq "$(PLATFORM)" "generic"
Expand All @@ -198,7 +189,7 @@ else
OBJS += platform/common/plat_sdl.o platform/common/inputmap_kbd.o
endif
OBJS += platform/libpicofe/plat_sdl.o platform/libpicofe/in_sdl.o
OBJS += platform/libpicofe/plat_dummy.o platform/libpicofe/linux/plat.o
OBJS += platform/libpicofe/linux/plat.o
USE_FRONTEND = 1
endif
ifeq "$(PLATFORM)" "pandora"
Expand Down Expand Up @@ -236,7 +227,7 @@ endif
ifeq "$(PLATFORM)" "psp"
CFLAGS += -DUSE_BGR565 -G8 # -DLPRINTF_STDIO -DFW15
LDLIBS += -lpspgu -lpspge -lpsppower -lpspaudio -lpspdisplay -lpspaudiocodec
LDLIBS += -lpsprtc -lpspctrl -lpspsdk -lc -lpspnet_inet -lpspuser -lpspkernel
LDLIBS += -lpspctrl
platform/common/main.o: CFLAGS += -Dmain=pico_main
OBJS += platform/psp/plat.o
OBJS += platform/psp/emu.o
Expand Down Expand Up @@ -359,7 +350,7 @@ endif

ifneq ($(findstring gcc,$(CC)),)
ifneq ($(findstring SunOS,$(shell uname -a)),SunOS)
ifeq ($(findstring Darwin,$(shell uname -a)),Darwin)
ifneq ($(findstring clang,$(shell $(CC) -v 2>&1)),)
LDFLAGS += -Wl,-map,$(TARGET).map
else
LDFLAGS += -Wl,-Map=$(TARGET).map
Expand Down Expand Up @@ -458,3 +449,4 @@ pico/memory.o pico/cd/memory.o pico/32x/memory.o : pico/memory.h
$(shell grep -rl pico_int.h pico) : pico/pico_int.h
# pico/cart.o : pico/carthw_cfg.c
cpu/fame/famec.o: cpu/fame/famec.c cpu/fame/famec_opcodes.h
platform/common/menu_pico.o: platform/libpicofe/menu.c
39 changes: 20 additions & 19 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ check_define()
# "" means "autodetect".

# TODO this is annoyingly messy. should have platform and device
platform_list="generic pandora gp2x wiz caanoo dingux retrofw gcw0 rg350 opendingux miyoo rpi1 rpi2 psp rg99"
platform_list="generic pandora gph dingux retrofw opendingux[-gcw0] odbeta[-gcw0] miyoo rpi1 rpi2 psp"
platform="generic"
sound_driver_list="oss alsa sdl"
sound_drivers=""
Expand Down Expand Up @@ -73,6 +73,7 @@ fail()
set_platform()
{
platform=$1
CFLAGS="$CFLAGS -D__`echo ${platform%-*} | tr '[a-z]' '[A-Z]'`__"
case "$platform" in
rpi1)
MFLAGS="-mcpu=arm1176jzf-s -mfpu=vfp"
Expand All @@ -83,54 +84,54 @@ set_platform()
have_gles="yes"
;;
generic)
MFLAGS=""
;;
dingux)
# dingoo a320, ritmix rzx-50, the like. all have Ingenic MIPS cpu <= JZ4755
sound_drivers="sdl"
# use static linking since the lib situation is ... let's say vague
#LDFLAGS="$LDFLAGS -static"
# uses a pre-gcw0 version of opendingux
CFLAGS="$CFLAGS -D__DINGUX__"
MFLAGS="-march=mips32 -msoft-float"
platform="opendingux"
;;
retrofw)
# devices using retrofw. AFAIK all have Ingenic MIPS JZ4760 with fpu
sound_drivers="sdl"
# uses it's own modified version of opendingux
CFLAGS="$CFLAGS -D__RETROFW__"
MFLAGS="-march=mips32"
platform="opendingux"
;;
opendingux | gcw0 | rg350)
opendingux | opendingux-gcw0)
# more modern devices using opendingux, with Ingenic MIPS JZ4770 or newer
sound_drivers="sdl"
# mostly based on opendingux for gcw0, save device type as C define.
CFLAGS="$CFLAGS -D__`echo $platform | tr '[a-z]' '[A-Z]'`__"
# mostly based on opendingux for gcw0
CFLAGS="$CFLAGS -D__OPENDINGUX__"
[ "${platform#*gcw0}" = "" ] && CFLAGS="$CFLAGS -D__GCW0__"
MFLAGS="-march=mips32r2"
platform="opendingux"
;;
rg99)
# RG99 using opendingux, with Ingenic MIPS JZ4725B
sound_drivers="sdl"
# mostly based on opendingux for gcw0, save device type as C define.
CFLAGS="$CFLAGS -D__`echo $platform | tr '[a-z]' '[A-Z]'`__"
MFLAGS="-march=mips32"
platform="opendingux"
;;
miyoo)
# Miyoo BittBoy, PocketGO 1, PowKiddy V90/Q90 with Allwinner F1C100s
sound_drivers="sdl"
CFLAGS="$CFLAGS -D__MIYOO__"
CFLAGS="$CFLAGS -D__OPENDINGUX__"
MFLAGS="-mcpu=arm926ej-s -marm"
platform="miyoo"
platform="opendingux"
;;
odbeta | odbeta-gcw0)
# various devices with opendingux beta, arch flags from toolchain default
sound_drivers="sdl"
CFLAGS="$CFLAGS -D__OPENDINGUX__"
[ "${platform#*gcw0}" = "" ] && CFLAGS="$CFLAGS -D__GCW0__"
MFLAGS="" # toolchains are arch specific
platform="opendingux"
;;
pandora)
sound_drivers="oss alsa"
have_libavcodec="yes"
MFLAGS="-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp"
;;
gp2x | wiz | caanoo)
gph)
sound_drivers="oss"
# compile for OABI if toolchain provides it (faster code on caanoo)
have_arm_oabi="yes"
Expand All @@ -146,7 +147,6 @@ set_platform()
psp)
# use newlib
SYSLIBS="-lc -lpspuser -lpspkernel"
CFLAGS="$CFLAGS -D__PSP__"
MFLAGS="-march=allegrex"
ARCH=mipsel
;;
Expand Down Expand Up @@ -276,7 +276,7 @@ arm*)
esac

case "$platform" in
rpi1 | rpi2 | generic | opendingux | miyoo)
rpi1 | rpi2 | generic | opendingux)
need_sdl="yes"
;;
esac
Expand Down Expand Up @@ -360,6 +360,7 @@ test -n "$SDL_CONFIG" || SDL_CONFIG="$(ls $SYSROOT/*/*bin*/sdl-config 2>/dev/nul
#test -n "$SDL_CONFIG" || SDL_CONFIG="$(ls $SYSROOT/*bin*/sdl2-config 2>/dev/null | grep /bin/sdl2-config | head -n 1)"
#test -n "$SDL_CONFIG" || SDL_CONFIG="$(ls $SYSROOT/*/*bin*/sdl2-config 2>/dev/null | grep /bin/sdl2-config | head -n 1)"
SDLVERSION=sdl && echo $SDL_CONFIG | grep -q sdl2 && SDLVERSION=sdl2
test -n "$SDL_CONFIG" || SDL_CONFIG=false

MAIN_LDLIBS="$LDLIBS -lm"

Expand Down
Loading

0 comments on commit 89e155f

Please sign in to comment.