Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
feat: re-Add Pico-8 core
Browse files Browse the repository at this point in the history
  • Loading branch information
robshape committed Sep 27, 2023
1 parent 3d9d6ac commit b8959cc
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cores/makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# this logic was broken out from picoarch's all-in-one makefile

CORES = fceumm gambatte gpsp pcsx_rearmed picodrive snes9x2005_plus
CORES+= beetle-pce-fast beetle-vb mednafen_supafaust mgba pokemini mame2003-plus # extras
CORES+= beetle-pce-fast beetle-vb fake-08 mednafen_supafaust mgba pokemini mame2003-plus # extras

###############################

Expand All @@ -19,6 +19,11 @@ beetle-pce-fast_CORE = mednafen_pce_fast_libretro.so
beetle-vb_REPO = https://github.com/libretro/beetle-vb-libretro
beetle-vb_CORE = mednafen_vb_libretro.so

fake-08_REPO = https://github.com/jtothebell/fake-08
fake-08_CORE = fake08_libretro.so
fake-08_BUILD_PATH = fake-08/platform/libretro
fake-08_HASH = 6279216964e351409201e987653e3d708fd4ad78 # last known working save states

fceumm_REPO = https://github.com/libretro/libretro-fceumm

gambatte_REPO = https://github.com/libretro/gambatte-libretro
Expand Down
34 changes: 34 additions & 0 deletions cores/patches/fake-08.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git forkSrcPrefix/platform/libretro/Makefile forkDstPrefix/platform/libretro/Makefile
index 420f9b7..78d9b0e 100644
--- forkSrcPrefix/platform/libretro/Makefile
+++ forkDstPrefix/platform/libretro/Makefile
@@ -123,7 +123,16 @@ else ifeq ($(platform), miyoomini)
CXXFLAGS += -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7ve
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T
-
+else ifeq ($(platform), rg35xx)
+ TARGET := $(TARGET_NAME)_libretro.so
+ CC = $(CROSS_COMPILE)gcc
+ CXX = $(CROSS_COMPILE)g++
+ AR = $(CROSS_COMPILE)ar
+ STRIP = $(CROSS_COMPILE)strip
+ CXXFLAGS += -marm -mtune=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=hard -march=armv7-a
+ CXXFLAGS += -fomit-frame-pointer -ffast-math -fno-common -ftree-vectorize -funswitch-loops
+ fpic := -fPIC
+ SHARED := -shared -Wl,--version-script=link.T
else ifeq ($(platform), gcw0)
TARGET := $(TARGET_NAME)_libretro_gcw0.so
CC = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc
diff --git forkSrcPrefix/platform/libretro/libretro.cpp forkDstPrefix/platform/libretro/libretro.cpp
index 2b289ee..da77509 100644
--- forkSrcPrefix/platform/libretro/libretro.cpp
+++ forkDstPrefix/platform/libretro/libretro.cpp
@@ -475,6 +475,7 @@ EXPORT bool retro_load_game(struct retro_game_info const *info)
printf("using file path for rom %s\n", info->path);
_vm->QueueCartChange(info->path);
}
+ _vm->UpdateAndDraw();

return true;
}
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ bundle:

# extras
cp ./cores/output/mame2003_plus_libretro.so ./build/EXTRAS/Emus/rg35xx/MAME.pak
cp ./cores/output/fake08_libretro.so ./build/EXTRAS/Emus/rg35xx/P8.pak
cp ./cores/output/mgba_libretro.so ./build/EXTRAS/Emus/rg35xx/MGBA.pak
cp ./cores/output/mgba_libretro.so ./build/EXTRAS/Emus/rg35xx/SGB.pak
cp ./cores/output/mednafen_pce_fast_libretro.so ./build/EXTRAS/Emus/rg35xx/PCE.pak
Expand Down
7 changes: 7 additions & 0 deletions skeleton/EXTRAS/Emus/rg35xx/P8.pak/default.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bind Up = UP
bind Down = DOWN
bind Left = LEFT
bind Right = RIGHT
bind A Button = A
bind B Button = B
bind Start = START
14 changes: 14 additions & 0 deletions skeleton/EXTRAS/Emus/rg35xx/P8.pak/launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

EMU_EXE=fake08
CORES_PATH=$(dirname "$0")

###############################

EMU_TAG=$(basename "$(dirname "$0")" .pak)
ROM="$1"
mkdir -p "$BIOS_PATH/$EMU_TAG"
mkdir -p "$SAVES_PATH/$EMU_TAG"
HOME="$USERDATA_PATH"
cd "$HOME"
minarch.elf "$CORES_PATH/${EMU_EXE}_libretro.so" "$ROM" &> "$LOGS_PATH/$EMU_TAG.txt"
Empty file.
Empty file added skeleton/EXTRAS/Saves/P8/.keep
Empty file.

0 comments on commit b8959cc

Please sign in to comment.