fix: Made store downloads extract in their own folder

feat: Implemented cemu integration
This commit is contained in:
Simeon Radivoev 2026-04-05 12:46:50 +03:00
parent 09b8b9c6f8
commit 764691fc86
Signed by: simeonradivoev
GPG key ID: 7611A451D2A5D37A
11 changed files with 156 additions and 52 deletions

View file

@ -0,0 +1,35 @@
import { PluginContextType, PluginType } from "@/bun/types/typesc.schema";
import desc from './package.json';
import path from 'node:path';
import { config } from "@/bun/api/app";
export default class DOLPHINIntegration implements PluginType
{
emulator = 'CEMU';
load (ctx: PluginContextType)
{
ctx.hooks.games.emulatorLaunchSupport.tap({ name: desc.name, emulator: this.emulator }, (ctx) =>
{
return { id: desc.name, supportLevel: "full", capabilities: ["batch", "config", "fullscreen", "resolution", "saves", "states"] };
});
ctx.hooks.games.emulatorLaunch.tapPromise({ name: desc.name, emulator: this.emulator }, async (ctx) =>
{
const args: string[] = [];
args.push(`--fullscreen=${config.get('launchInFullscreen') ? "True" : "False"}`);
const savesPath = path.join(config.get('downloadPath'), "saves", 'DOLPHIN');
args.push(`--mlc=${savesPath}`);
if (ctx.autoValidCommand.metadata.romPath)
{
args.push(`--game=${ctx.autoValidCommand.metadata.romPath}`);
}
return args;
});
}
}

View file

@ -0,0 +1,14 @@
{
"name": "com.simeonradivoev.gameflow.cemu",
"displayName": "CEMU Integration",
"version": "0.0.1",
"description": "CEMU Emulator Integration",
"main": "./cemu.ts",
"icon": "https://upload.wikimedia.org/wikipedia/commons/9/9e/Cemu_Emulator_Official_Logo.png",
"keywords": [
"integration",
"emulator",
"wiiu",
"cemu"
]
}

View file

@ -25,7 +25,7 @@ export default class DOLPHINIntegration implements PluginType
{
const args: string[] = [];
const storageFolder = path.join(config.get('downloadPath'), "storage", 'DOLPHIN');
const storageFolder = path.join(config.get('downloadPath'), "storage", this.emulator);
args.push(`--user=${storageFolder}`);
args.push(`--config=Dolphin.Display.Fullscreen=${config.get('launchInFullscreen') ? "True" : "False"}`);
@ -35,7 +35,7 @@ export default class DOLPHINIntegration implements PluginType
args.push(`--config=Dolphin.Interface.SkipNKitWarning=True`);
args.push(`--config=Dolphin.Analytics.PermissionAsked=True`);
const savesPath = path.join(config.get('downloadPath'), "saves", 'DOLPHIN');
const savesPath = path.join(config.get('downloadPath'), "saves", this.emulator);
args.push(`--config=Dolphin.General.WiiSDCardPath=${path.join(savesPath, 'WiiSD.raw')}`);
args.push(`--config=Dolphin.General.WiiSDCardSyncFolder=${path.join(savesPath, 'WiiSDSync')}`);

View file

@ -8,7 +8,7 @@
"keywords": [
"integration",
"emulator",
"wiiu",
"wii",
"gc",
"dolphin"
]

View file

@ -49,9 +49,9 @@ export default class PCSX2Integration implements PluginType
{
const configFileContents = await Bun.file(configFile).text();
const biosFolder = path.join(config.get('downloadPath'), "bios", 'PCSX2');
const storageFolder = path.join(config.get('downloadPath'), "storage", 'PCSX2');
const savesFolder = path.join(config.get('downloadPath'), "saves", 'PCSX2');
const biosFolder = path.join(config.get('downloadPath'), "bios", this.emulator);
const storageFolder = path.join(config.get('downloadPath'), "storage", this.emulator);
const savesFolder = path.join(config.get('downloadPath'), "saves", this.emulator);
const view = {
BIOS_PATH: biosFolder,
@ -70,7 +70,7 @@ export default class PCSX2Integration implements PluginType
if (process.platform === 'win32')
pscx2Path = path.join(ctx.autoValidCommand.metadata.emulatorDir, 'inis');
else
pscx2Path = path.join(ctx.autoValidCommand.metadata.emulatorDir, "PCSX2", 'inis');
pscx2Path = path.join(ctx.autoValidCommand.metadata.emulatorDir, this.emulator, 'inis');
await Bun.write(path.join(pscx2Path, 'PCSX2.ini'), Mustache.render(configFileContents, view));
}