diff --git a/Config.in b/Config.in index f27a70205121ab8b6ca3dd3865819572d1be00ac..9767bd074224f17e002c73d57628fd36efa52d58 100644 --- a/Config.in +++ b/Config.in @@ -160,6 +160,7 @@ menu "Emulators" source "$BR2_EXTERNAL_RECALBOX_PATH/package/openbor/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/pcsx_rearmed/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/pcsx2/Config.in" + source "$BR2_EXTERNAL_RECALBOX_PATH/package/pico8-lexaloffle/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/pifba/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/pisnes/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/rb5000/Config.in" diff --git a/configs/recalbox-odroidgo2_defconfig b/configs/recalbox-odroidgo2_defconfig index 7ec9c824c74296cb9db9670f4ec541a76d941d45..c9d84095785d024b4bd21690ef4cdc3decaf4efc 100644 --- a/configs/recalbox-odroidgo2_defconfig +++ b/configs/recalbox-odroidgo2_defconfig @@ -179,6 +179,7 @@ BR2_PACKAGE_MUPEN64PLUS_UICONSOLE=y BR2_PACKAGE_MUPEN64PLUS_VIDEO_RICE=y BR2_PACKAGE_MUPEN64PLUS_VIDEO_GLIDE64MK2=y BR2_PACKAGE_ORICUTRON=y +BR2_PACKAGE_PICO8_LEXALOFFLE=y BR2_PACKAGE_PPSSPP=y BR2_PACKAGE_SIMCOUPE=y BR2_PACKAGE_AMIBERRY33=y diff --git a/configs/recalbox-rg353x_defconfig b/configs/recalbox-rg353x_defconfig index c7e532f0181763a87741f6e1d9e5fa44d7a8d19a..3e968dc47202cab05d1a63c1c32241bc2ea838c4 100644 --- a/configs/recalbox-rg353x_defconfig +++ b/configs/recalbox-rg353x_defconfig @@ -181,6 +181,7 @@ BR2_PACKAGE_SDLPOP=y BR2_PACKAGE_TI99SIM=y BR2_PACKAGE_XROAR=y BR2_PACKAGE_VICE=y +BR2_PACKAGE_PICO8_LEXALOFFLE=y BR2_PACKAGE_LIBRETRO_A5200=y BR2_PACKAGE_LIBRETRO_APPLEWIN=y BR2_PACKAGE_LIBRETRO_ATARI800=y diff --git a/configs/recalbox-rpi3_defconfig b/configs/recalbox-rpi3_defconfig index d6c241b0c2c1c804daa8cc57749635758e893a91..ae7f4ed68faa37e1f0b9d23bc972d552306d27b4 100644 --- a/configs/recalbox-rpi3_defconfig +++ b/configs/recalbox-rpi3_defconfig @@ -219,6 +219,7 @@ BR2_PACKAGE_JULIUS=y BR2_PACKAGE_AMIBERRY=y BR2_PACKAGE_MUPEN64PLUS_UICONSOLE=y BR2_PACKAGE_ORICUTRON=y +BR2_PACKAGE_PICO8_LEXALOFFLE=y BR2_PACKAGE_PPSSPP=y BR2_PACKAGE_SIMCOUPE=y BR2_PACKAGE_DOSBOX=y diff --git a/configs/recalbox-rpi4_64_defconfig b/configs/recalbox-rpi4_64_defconfig index 3554e9d5a2210f47e034161801ffd35188dc9818..ad464bbc016cbda05754c74301e168625f480990 100644 --- a/configs/recalbox-rpi4_64_defconfig +++ b/configs/recalbox-rpi4_64_defconfig @@ -211,6 +211,7 @@ BR2_PACKAGE_SIMCOUPE=y BR2_PACKAGE_DOSBOX=y BR2_PACKAGE_GSPLUS=y BR2_PACKAGE_HYPSEUS=y +BR2_PACKAGE_PICO8_LEXALOFFLE=y BR2_PACKAGE_OPENBOR=y BR2_PACKAGE_RB5000=y BR2_PACKAGE_LIBRETRO_81=y diff --git a/configs/recalbox-rpi5_64_defconfig b/configs/recalbox-rpi5_64_defconfig index 14bd7cfe0f91aa6431ab9cc0e9cb751bd0e25e93..72508abe161e86ad5e7c0318fbe5fd68465671bb 100644 --- a/configs/recalbox-rpi5_64_defconfig +++ b/configs/recalbox-rpi5_64_defconfig @@ -206,6 +206,7 @@ BR2_PACKAGE_JULIUS=y BR2_PACKAGE_AMIBERRY=y BR2_PACKAGE_OPENLARA=y BR2_PACKAGE_ORICUTRON=y +BR2_PACKAGE_PICO8_LEXALOFFLE=y BR2_PACKAGE_PPSSPP=y BR2_PACKAGE_SIMCOUPE=y BR2_PACKAGE_DOSBOX=y diff --git a/configs/recalbox-rpizero2_defconfig b/configs/recalbox-rpizero2_defconfig index 975ee0a183cd59c9ad2e52a3dddb905411665510..be0889e8843e43dbccbfccbf7566786b22a65c75 100644 --- a/configs/recalbox-rpizero2_defconfig +++ b/configs/recalbox-rpizero2_defconfig @@ -219,6 +219,7 @@ BR2_PACKAGE_JULIUS=y BR2_PACKAGE_AMIBERRY=y BR2_PACKAGE_MUPEN64PLUS_UICONSOLE=y BR2_PACKAGE_ORICUTRON=y +BR2_PACKAGE_PICO8_LEXALOFFLE=y BR2_PACKAGE_PPSSPP=y BR2_PACKAGE_SIMCOUPE=y BR2_PACKAGE_DOSBOX=y diff --git a/configs/recalbox-x86_64_defconfig b/configs/recalbox-x86_64_defconfig index 4581d3aa1375aa2dd74e02eded0180aad41f8e8b..6005560766ca90f57c75eba8d73574d1ffa70d81 100644 --- a/configs/recalbox-x86_64_defconfig +++ b/configs/recalbox-x86_64_defconfig @@ -238,6 +238,7 @@ BR2_PACKAGE_MUPEN64PLUS_VIDEO_GLIDE64MK2=y BR2_PACKAGE_MUPEN64PLUS_VIDEO_RICE=y BR2_PACKAGE_OPENLARA=y BR2_PACKAGE_ORICUTRON=y +BR2_PACKAGE_PICO8_LEXALOFFLE=y BR2_PACKAGE_PCSX2=y BR2_PACKAGE_PPSSPP=y BR2_PACKAGE_SIMCOUPE=y diff --git a/package/pico8-lexaloffle/Config.in b/package/pico8-lexaloffle/Config.in new file mode 100644 index 0000000000000000000000000000000000000000..9c26c18ed83608a6cc8f425e0e030d95d9cff81b --- /dev/null +++ b/package/pico8-lexaloffle/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_PICO8_LEXALOFFLE + bool "pico8-lexaloffle" + help + Support for the official pico-8 core + + https://www.lexaloffle.com/pico-8.php diff --git a/package/pico8-lexaloffle/pico8-lexaloffle.mk b/package/pico8-lexaloffle/pico8-lexaloffle.mk new file mode 100644 index 0000000000000000000000000000000000000000..9f731bd980bb9e040a3f152729d5fa7ea56739c3 --- /dev/null +++ b/package/pico8-lexaloffle/pico8-lexaloffle.mk @@ -0,0 +1,15 @@ +################################################################################ +# +# Pico-8 Lexaloffle (source files not supplied, must be purchased) +# +################################################################################ + +#PICO8_LEXALOFFLE_SITE = https://www.lexaloffle.com/pico-8.php +PICO8_LEXALOFFLE_VERSION = 0.2.6b +PICO8_LEXALOFFLE_SOURCE = +PICO8_LEXALOFFLE_LICENSE = COMMERCIAL + +define PICO8_LEXALOFFLE_INSTALL_TARGET_CMDS +endef + +$(eval $(generic-package)) diff --git a/package/recalbox-romfs2/systems/pico8/init/roms/gamelist.xml b/package/recalbox-romfs2/systems/pico8/init/roms/gamelist.xml new file mode 100644 index 0000000000000000000000000000000000000000..9f01e58c3024c7838e42276ceb3620c835c7b517 --- /dev/null +++ b/package/recalbox-romfs2/systems/pico8/init/roms/gamelist.xml @@ -0,0 +1,16 @@ + + + + splore.p8 + splore + Store + lexaloffle + lexaloffle + 20140101T000000 + media/images/splore.p8.png + SPLORE is a built-in utility for browsing and organising both local and bbs (online) cartridges. + auto + pico8 + pico8 + + diff --git a/package/recalbox-romfs2/systems/pico8/init/roms/media/images/splore.p8.png b/package/recalbox-romfs2/systems/pico8/init/roms/media/images/splore.p8.png new file mode 100644 index 0000000000000000000000000000000000000000..ec1aaa54acf4bb855b2ad2467ab2e9a43b8fa871 Binary files /dev/null and b/package/recalbox-romfs2/systems/pico8/init/roms/media/images/splore.p8.png differ diff --git a/package/recalbox-romfs2/systems/pico8/init/roms/splore.p8 b/package/recalbox-romfs2/systems/pico8/init/roms/splore.p8 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/package/recalbox-romfs2/systems/pico8/system.ini b/package/recalbox-romfs2/systems/pico8/system.ini index 8124aed554cf57e994f7b41e74725a5a3a6fe32e..d16e3c4aeeb3d391e838c76aa4b8be49109935db 100644 --- a/package/recalbox-romfs2/systems/pico8/system.ini +++ b/package/recalbox-romfs2/systems/pico8/system.ini @@ -62,4 +62,16 @@ netplay = 0 softpatching = 0 compatibility = high speed = high -crt.available = 0 \ No newline at end of file +crt.available = 0 + +[core.2] +package = BR2_PACKAGE_PICO8_LEXALOFFLE +priority = 3 +emulator = "pico8" +core = "pico8" +extensions = ".p8 .png" +netplay = 0 +softpatching = 0 +compatibility = high +speed = high +crt.available = 1 \ No newline at end of file diff --git a/package/recalbox-romfs2/systems/pico8/upgrade/roms/.p2k.cfg b/package/recalbox-romfs2/systems/pico8/upgrade/roms/.p2k.cfg new file mode 100644 index 0000000000000000000000000000000000000000..d4cf163be2ad2f77a047d338f60c5853e60050bf --- /dev/null +++ b/package/recalbox-romfs2/systems/pico8/upgrade/roms/.p2k.cfg @@ -0,0 +1,15 @@ +# Recalbox's Pad-to-Keyboard configuration +# General configuration +# Pico8 (Lexaloffle Pico-8) + +#Exit emulator +0:+start = leftctrl q ;; Exit emulator + +#Screenshot +0:+l1 = leftctrl 6 ;; Screenshot + +#Reload/Restart cartridge +0:+b = leftctrl r ;; Restart cartridge + +#Pause Menu +0:select = enter ;; Pause Menu \ No newline at end of file diff --git a/projects/configgen/configgen/emulatorlauncher.py b/projects/configgen/configgen/emulatorlauncher.py index 098b0dfe4dee75fb62f8ed30703ca4d04582c94b..9a5e0379164d1ba1aca4b4695cc26dcf750395d9 100644 --- a/projects/configgen/configgen/emulatorlauncher.py +++ b/projects/configgen/configgen/emulatorlauncher.py @@ -125,6 +125,9 @@ def getGenerator(emulator): elif emulator == "xemu": module = __import__("configgen.generators.xemu.xemuGenerator", fromlist=["XemuGenerator"]) generatorClass = getattr(module, "XemuGenerator") + elif emulator == "pico8": + module = __import__("configgen.generators.pico8.pico8Generator", fromlist=["Pico8Generator"]) + generatorClass = getattr(module, "Pico8Generator") else: print("Missing generator for {}".format(emulator)) raise ValueError @@ -278,6 +281,7 @@ def config_upgrade(version): "moonlight", "mupen64plus", "oricutron", + "pico8", "pcsx2", "pcsx_rearmed", "pisnes", diff --git a/projects/configgen/configgen/generators/pico8/__init__.py b/projects/configgen/configgen/generators/pico8/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/projects/configgen/configgen/generators/pico8/pico8Generator.py b/projects/configgen/configgen/generators/pico8/pico8Generator.py new file mode 100644 index 0000000000000000000000000000000000000000..42371ba72a6157466f6bd5a5bebf1e5662d79221 --- /dev/null +++ b/projects/configgen/configgen/generators/pico8/pico8Generator.py @@ -0,0 +1,35 @@ +from configgen.Command import Command +import configgen.recalboxFiles as recalboxFiles +from configgen.Emulator import Emulator +from configgen.generators.Generator import Generator, ControllerPerPlayer +from configgen.settings.keyValueSettings import keyValueSettings +import os +import shutil + +class Pico8Generator(Generator): + + def generate(self, system: Emulator, playersControllers: ControllerPerPlayer, recalboxOptions: keyValueSettings, args) -> Command: + + # Copy binary file and run the binary with chmod + if not os.path.exists("/overlay/emulator/pico-8/pico8"): + if not os.path.exists("/overlay/emulator"): + os.makedirs("/overlay/emulator") + shutil.move("/recalbox/share/system/configs/pico-8", "/overlay/emulator") + os.chmod("/overlay/emulator/pico-8/pico8", 0o775) + + # Start emulator + commandArray = [recalboxFiles.recalboxBins[system.Emulator], "-run", args.rom] + commandArray.extend(["-windowed", "0"]) # Windowed mode off + + # Screenshot + commandArray.extend(["-desktop", "/recalbox/share/screenshots"]) + + # SPLORE is a built-in utility for browsing and organising both local and bbs (online) cartridges + commandArray.extend(["-root_path", "/recalbox/share/roms/pico8"]) + romPath: str = args.rom.lower() + if "splore.p8" in romPath: commandArray.append("-splore") + + # Add extra arguments + if system.HasArgs: commandArray.extend(system.Args) + + return Command(videomode=system.VideoMode, array=commandArray) \ No newline at end of file diff --git a/projects/configgen/configgen/recalboxFiles.py b/projects/configgen/configgen/recalboxFiles.py index 6eea5d7191c7fc8b4b26e828587fc0f7f1024852..903694e17a1d1039b6fb64ef18e4ba9352e630d6 100644 --- a/projects/configgen/configgen/recalboxFiles.py +++ b/projects/configgen/configgen/recalboxFiles.py @@ -46,6 +46,7 @@ recalboxBins =\ 'oricutron' : '/usr/bin/oricutron/oricutron', 'pcsx_rearmed': '/usr/bin/pcsx_rearmed', 'pcsx2' : '/usr/bin/PCSX2/PCSX2', + 'pico8' : '/overlay/emulator/pico-8/pico8', 'pisnes' : '/usr/bin/pisnes', 'ppsspp' : '/usr/bin/PPSSPPSDL', 'rb5000' : '/usr/bin/rb5000', diff --git a/projects/configgen/setup.py b/projects/configgen/setup.py index 08602218455b75589b65ed5b144b38b3b74d8015..d4fa80793ccda722a432dce56fc823a1f1d387b0 100644 --- a/projects/configgen/setup.py +++ b/projects/configgen/setup.py @@ -50,6 +50,7 @@ setup(name='recalbox-configgen', 'configgen.generators.xemu', 'configgen.generators.xemu.xk', 'configgen.generators.vpinball', + 'configgen.generators.pico8', 'configgen.settings', 'configgen.utils'], scripts=['emulatorlauncher.py']