diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bab5377..77ec648 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,7 +73,7 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Build and Package - run: task build extract package-next package-muos package-knulli package-spruce + run: task build extract package-next package-muos package-knulli package-spruce package-crossmix - name: Create NextUI distribution run: | @@ -97,6 +97,12 @@ jobs: zip -r Grout.spruce.zip Grout mv Grout.spruce.zip ../Grout.spruce.zip + - name: Create crossmix distribution + run: | + cd build/CrossMix + zip -r Grout.crossmix.zip Grout + mv Grout.crossmix.zip ../Grout.crossmix.zip + - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: @@ -112,6 +118,7 @@ jobs: build/Grout.pak.zip build/Grout.muxapp build/Grout.spruce.zip + build/Grout.crossmix.zip build/Grout-Knulli.zip build/grout draft: false diff --git a/cfw/cfw.go b/cfw/cfw.go index b08d665..dcb22e1 100644 --- a/cfw/cfw.go +++ b/cfw/cfw.go @@ -12,10 +12,11 @@ import ( type CFW string const ( - NextUI CFW = "NEXTUI" - MuOS CFW = "MUOS" - Knulli CFW = "KNULLI" - Spruce CFW = "SPRUCE" + NextUI CFW = "NEXTUI" + MuOS CFW = "MUOS" + Knulli CFW = "KNULLI" + Spruce CFW = "SPRUCE" + CrossMix CFW = "CROSSMIX" ) var ( @@ -29,6 +30,9 @@ var ( SprucePlatforms = mustLoadJSONMap[string, []string]("spruce/platforms.json") SpruceSaveDirectories = mustLoadJSONMap[string, []string]("spruce/save_directories.json") + CrossMixPlatforms = mustLoadJSONMap[string, []string]("crossmix/platforms.json") + CrossMixSaveDirectories = mustLoadJSONMap[string, []string]("crossmix/save_directories.json") + KnulliPlatforms = mustLoadJSONMap[string, []string]("knulli/platforms.json") ) @@ -41,11 +45,11 @@ func GetCFW() CFW { cfw := CFW(cfwEnv) switch cfw { - case MuOS, NextUI, Knulli, Spruce: + case MuOS, NextUI, Knulli, Spruce, CrossMix: return cfw default: log.SetOutput(os.Stderr) - log.Fatalf("Unsupported CFW: '%s'. Valid options: NextUI, muOS, Knulli, Spruce", cfwEnv) + log.Fatalf("Unsupported CFW: '%s'. Valid options: NextUI, muOS, Knulli, Spruce, CrossMix", cfwEnv) return "" } } @@ -66,6 +70,8 @@ func GetRomDirectory() string { return filepath.Join(getBasePath(Knulli), "roms") case Spruce: return filepath.Join(getBasePath(Spruce), "Roms") + case CrossMix: + return filepath.Join(getBasePath(CrossMix), "Roms") } return "" @@ -83,6 +89,8 @@ func GetBIOSDirectory() string { return filepath.Join(getBasePath(Knulli), "bios") case Spruce: return filepath.Join(getBasePath(Spruce), "BIOS") + case CrossMix: + return filepath.Join(getBasePath(CrossMix), "BIOS") } return "" @@ -117,6 +125,8 @@ func GetPlatformMap(c CFW) map[string][]string { return KnulliPlatforms case Spruce: return SprucePlatforms + case CrossMix: + return CrossMixPlatforms default: return nil } @@ -132,6 +142,8 @@ func EmulatorFolderMap(c CFW) map[string][]string { return KnulliPlatforms case Spruce: return SpruceSaveDirectories + case CrossMix: + return CrossMixSaveDirectories default: return nil } @@ -192,6 +204,9 @@ func getBasePath(cfw CFW) string { case Spruce: return "/mnt/SDCARD" + + case CrossMix: + return "/mnt/SDCARD" default: return "" } @@ -212,6 +227,8 @@ func BaseSavePath() string { return filepath.Join(getBasePath(cfw), "saves") case Spruce: return filepath.Join(getBasePath(cfw), "Saves", "saves") + case CrossMix: + return filepath.Join(getBasePath(cfw), "RetroArch", ".retroarch", "saves") } return "" @@ -230,13 +247,16 @@ func GetPlatformRomDirectory(relativePath, platformSlug string) string { // GetArtDirectory returns the artwork directory for a platform. func GetArtDirectory(romDir string, platformSlug, platformName string) string { - switch GetCFW() { + cfw := GetCFW() + switch cfw { case NextUI: return filepath.Join(romDir, ".media") case Knulli: return filepath.Join(romDir, "images") case Spruce: return filepath.Join(romDir, "Imgs") + case CrossMix: + return filepath.Join(getBasePath(cfw), "Imgs", platformSlug) case MuOS: systemName, exists := MuOSArtDirectory[platformSlug] if !exists { diff --git a/cfw/crossmix/platforms.json b/cfw/crossmix/platforms.json new file mode 100644 index 0000000..6674bee --- /dev/null +++ b/cfw/crossmix/platforms.json @@ -0,0 +1,252 @@ +{ + "3do": [ + "PANASONIC" + ], + "3ds": [], + "acpc": [ + "CPC" + ], + "amiga": [ + "AMIGA" + ], + "arcade": [ + "MAME", + "MAME2003PLUS", + "MAME2010", + "DAPHNE" + ], + "arduboy": [ + "ARDUBOY" + ], + "atari-st": [ + "ATARIST" + ], + "atari2600": [ + "ATARI2600" + ], + "atari5200": [ + "ATARI5200" + ], + "atari7800": [ + "ATARI7800" + ], + "c128": [ + "AMIGA", + "AMIGACD" + ], + "c64": [ + "C64" + ], + "cave-story": [ + "CAVESTORY" + ], + "cbm-ii": [ + "VIC20" + ], + "chailove": [ + "CHAILOVE" + ], + "chip-8": [], + "colecovision": [ + "COLECO", + "COLSGM" + ], + "cpet": [ + "CPET" + ], + "dc": [ + "DC" + ], + "doom": [ + "DOOM" + ], + "dos": [ + "DOS" + ], + "fairchild-channel-f": [ + "FAIRCHILD" + ], + "famicom": [ + "FC" + ], + "fds": [ + "FDS" + ], + "g-and-w": [ + "GW" + ], + "galaksija": [], + "gamegear": [ + "GG" + ], + "gb": [ + "GB" + ], + "gba": [ + "GBA" + ], + "gbc": [ + "GBC" + ], + "genesis": [ + "MD" + ], + "intellivision": [ + "INTELLIVISION" + ], + "j2me": [], + "jaguar": [], + "karaoke": [], + "lowres": [ + "LOWRESNX" + ], + "lua": [ + "LUTRO" + ], + "lynx": [ + "LYNX" + ], + "media-player": [], + "mega-duck-slash-cougar-boy": [ + "MEGADUCK" + ], + "msx": [ + "MSX" + ], + "n64": [ + "N64" + ], + "naomi": [ + "NAOMI" + ], + "nds": [ + "NDS" + ], + "neo-geo-cd": [ + "NEOCD" + ], + "neo-geo-pocket": [ + "NEOGEO" + ], + "neo-geo-pocket-color": [ + "NEOGEO" + ], + "neogeoaes": [ + "NEOGEO" + ], + "neogeomvs": [ + "NEOGEO" + ], + "nes": [ + "FC" + ], + "odyssey": [ + "ODYSSEY" + ], + "onscripter": [], + "openbor": [ + "OPENBOR" + ], + "pc-8000": [ + "PC88" + ], + "pc-9800-series": [], + "pc-fx": [], + "philips-cd-i": [], + "pico": [], + "pico-8": [ + "PICO" + ], + "pokemon-mini": [ + "POKEMINI" + ], + "ports": [], + "ps2": [], + "psp": [ + "PSP" + ], + "psx": [ + "PS" + ], + "quake": [ + "TYRQUAKE" + ], + "rpg-maker": [], + "saturn": [ + "SATURN" + ], + "scummvm": [ + "SCUMMVM" + ], + "sega32": [ + "SEGA32X" + ], + "segacd": [ + "SEGACD" + ], + "sfam": [ + "SFC" + ], + "sg1000": [ + "SG1000" + ], + "sharp-x68000": [ + "X68000" + ], + "sms": [ + "MS" + ], + "snes": [ + "SFC" + ], + "supergrafx": [ + "SFX" + ], + "supervision": [ + "SUPERVISION" + ], + "tg16": [ + "PCE" + ], + "ti-83": [ + "TI83" + ], + "tic-80": [ + "TIC" + ], + "turbografx-cd": [ + "PCECD" + ], + "uzebox": [ + "UZEBOX" + ], + "vectrex": [ + "VECTREX" + ], + "vemulator": [ + "VMU" + ], + "vic-20": [ + "VIC20" + ], + "vircon-32": [], + "virtualboy": [ + "VB" + ], + "wasm-4": [], + "wolfenstein-3d": [], + "wonderswan": [ + "WS" + ], + "wonderswan-color": [ + "WS", + "WSC" + ], + "x1": [ + "X1" + ], + "zx81": [], + "zxs": [ + "ZXS" + ] +} diff --git a/cfw/crossmix/save_directories.json b/cfw/crossmix/save_directories.json new file mode 100644 index 0000000..94caa05 --- /dev/null +++ b/cfw/crossmix/save_directories.json @@ -0,0 +1,257 @@ +{ + "3do": [ + "PANASONIC/Opera" + ], + "3ds": [], + "acpc": [ + "CPC" + ], + "amiga": [ + "AMIGA" + ], + "arcade": [ + "MAME", + "MAME2003PLUS", + "MAME2010", + "DAPHNE" + ], + "arduboy": [ + "ARDUBOY" + ], + "atari-st": [ + "ATARIST" + ], + "atari2600": [ + "ATARI2600" + ], + "atari5200": [ + "ATARI5200" + ], + "atari7800": [ + "ATARI7800" + ], + "c128": [ + "AMIGA", + "AMIGACD" + ], + "c64": [ + "C64" + ], + "cave-story": [ + "CAVESTORY" + ], + "cbm-ii": [ + "VIC20" + ], + "chailove": [ + "CHAILOVE" + ], + "chip-8": [], + "colecovision": [ + "COLECO", + "COLSGM" + ], + "cpet": [ + "CPET" + ], + "dc": [ + "DC" + ], + "doom": [ + "DOOM" + ], + "dos": [ + "DOS" + ], + "fairchild-channel-f": [ + "FAIRCHILD" + ], + "famicom": [ + "FC" + ], + "fds": [ + "FDS" + ], + "g-and-w": [ + "GW" + ], + "galaksija": [], + "gamegear": [ + "GG" + ], + "gb": [ + "GB" + ], + "gba": [ + "GBA/gpSP", + "GBA/mGBA", + "GBA/VAB-M", + "GBA/VBA-Next", + "GBA/Meteor", + "GBA/mGBA - Standalone" + ], + "gbc": [ + "GBC" + ], + "genesis": [ + "MD" + ], + "intellivision": [ + "INTELLIVISION" + ], + "j2me": [], + "jaguar": [], + "karaoke": [], + "lowres": [ + "LOWRESNX" + ], + "lua": [ + "LUTRO" + ], + "lynx": [ + "LYNX" + ], + "media-player": [], + "mega-duck-slash-cougar-boy": [ + "MEGADUCK" + ], + "msx": [ + "MSX" + ], + "n64": [ + "N64" + ], + "naomi": [ + "NAOMI" + ], + "nds": [ + "NDS" + ], + "neo-geo-cd": [ + "NEOCD" + ], + "neo-geo-pocket": [ + "NEOGEO" + ], + "neo-geo-pocket-color": [ + "NEOGEO" + ], + "neogeoaes": [ + "NEOGEO" + ], + "neogeomvs": [ + "NEOGEO" + ], + "nes": [ + "FC" + ], + "odyssey": [ + "ODYSSEY" + ], + "onscripter": [], + "openbor": [ + "OPENBOR" + ], + "pc-8000": [ + "PC88" + ], + "pc-9800-series": [], + "pc-fx": [], + "philips-cd-i": [], + "pico": [], + "pico-8": [ + "PICO" + ], + "pokemon-mini": [ + "POKEMINI" + ], + "ports": [], + "ps2": [], + "psp": [ + "PSP" + ], + "psx": [ + "PS" + ], + "quake": [ + "TYRQUAKE" + ], + "rpg-maker": [], + "saturn": [ + "SATURN" + ], + "scummvm": [ + "SCUMMVM" + ], + "sega32": [ + "SEGA32X" + ], + "segacd": [ + "SEGACD" + ], + "sfam": [ + "SFC" + ], + "sg1000": [ + "SG1000" + ], + "sharp-x68000": [ + "X68000" + ], + "sms": [ + "MS" + ], + "snes": [ + "SFC" + ], + "supergrafx": [ + "SFX" + ], + "supervision": [ + "SUPERVISION" + ], + "tg16": [ + "PCE" + ], + "ti-83": [ + "TI83" + ], + "tic-80": [ + "TIC" + ], + "turbografx-cd": [ + "PCECD" + ], + "uzebox": [ + "UZEBOX" + ], + "vectrex": [ + "VECTREX" + ], + "vemulator": [ + "VMU" + ], + "vic-20": [ + "VIC20" + ], + "vircon-32": [], + "virtualboy": [ + "VB" + ], + "wasm-4": [], + "wolfenstein-3d": [], + "wonderswan": [ + "WS" + ], + "wonderswan-color": [ + "WS", + "WSC" + ], + "x1": [ + "X1" + ], + "zx81": [], + "zxs": [ + "ZXS" + ] +} diff --git a/cfw/json_loader.go b/cfw/json_loader.go index d4322fe..714ab9c 100644 --- a/cfw/json_loader.go +++ b/cfw/json_loader.go @@ -6,7 +6,7 @@ import ( "grout/internal/jsonutil" ) -//go:embed nextui muos knulli spruce +//go:embed nextui muos knulli spruce crossmix var embeddedFiles embed.FS func mustLoadJSONMap[K comparable, V any](path string) map[K]V { diff --git a/scripts/CrossMix/config.json b/scripts/CrossMix/config.json new file mode 100644 index 0000000..db852c8 --- /dev/null +++ b/scripts/CrossMix/config.json @@ -0,0 +1,8 @@ +{ + "label": "Grout", + "icon": "/mnt/SDCARD/Apps/Grout/grout.png", + "iconsel": "/mnt/SDCARD/Apps/Grout/grout.png", + "launch": "launch.sh", + "description": "A RomM client for NextUI, muOS, spruce, crossmix and knulli", + "devices": ["MIYOO_A30", "TRIMUI_BRICK", "TRIMUI_SMART_PRO_S", "TRIMUI_SMART_PRO","MIYOO_FLIP"] +} \ No newline at end of file diff --git a/scripts/CrossMix/grout.png b/scripts/CrossMix/grout.png new file mode 100644 index 0000000..435b454 Binary files /dev/null and b/scripts/CrossMix/grout.png differ diff --git a/scripts/CrossMix/launch.sh b/scripts/CrossMix/launch.sh new file mode 100644 index 0000000..d8ad846 --- /dev/null +++ b/scripts/CrossMix/launch.sh @@ -0,0 +1,8 @@ +#!/bin/sh +CUR_DIR="$(dirname "$0")" +cd "$CUR_DIR"/grout || exit 1 + +export CFW=CROSSMIX +export LD_LIBRARY_PATH=lib:"$LD_LIBRARY_PATH" + +./grout diff --git a/scripts/Spruce/config.json b/scripts/Spruce/config.json index 69727eb..18f7742 100644 --- a/scripts/Spruce/config.json +++ b/scripts/Spruce/config.json @@ -2,6 +2,6 @@ "label": "Grout", "icon": "/mnt/SDCARD/App/Grout/grout.png", "launch": "launch.sh", - "description": "A RomM client for NextUI, muOS, spruce and knulli", + "description": "A RomM client for NextUI, muOS, spruce, crossmix and knulli", "devices": ["MIYOO_A30", "TRIMUI_BRICK", "TRIMUI_SMART_PRO_S", "TRIMUI_SMART_PRO","MIYOO_FLIP"] } \ No newline at end of file diff --git a/taskfile.yml b/taskfile.yml index 4c99949..58059d2 100644 --- a/taskfile.yml +++ b/taskfile.yml @@ -25,6 +25,7 @@ tasks: - task: package-muos - task: package-knulli - task: package-spruce + - task: package-crossmix all-local: desc: Build (with local gabagool via go work) and package for all platforms @@ -36,6 +37,7 @@ tasks: - task: muxapp - task: package-knulli - task: package-spruce + - task: package-crossmix extract: desc: Extract binary and libraries from Docker image @@ -85,6 +87,16 @@ tasks: - cp -R build/lib/* build/Spruce/Grout/grout/lib/ silent: true + package-crossmix: + desc: Package for Spruce + cmds: + - rm -rf build/CrossMix || true + - mkdir -p build/CrossMix/Grout/grout/lib + - cp scripts/CrossMix/* README.md LICENSE build/CrossMix/Grout + - cp build/grout build/CrossMix/Grout/grout + - cp -R build/lib/* build/CrossMix/Grout/grout/lib/ + silent: true + muxapp: desc: Create .muxapp archive for muOS cmds: