feat: Implemented dolphin integration

This commit is contained in:
Simeon Radivoev 2026-04-02 14:20:30 +03:00
parent edbc390d14
commit a69147a4f7
Signed by: simeonradivoev
GPG key ID: 7611A451D2A5D37A
24 changed files with 220 additions and 59 deletions

View file

@ -0,0 +1,37 @@
import { config, db } from "@/bun/api/app";
import { PluginContextType, PluginType } from "@/bun/types/typesc.schema";
import path from 'node:path';
import desc from './package.json';
export default class DOLPHINIntegration implements PluginType
{
load (ctx: PluginContextType)
{
ctx.hooks.games.emulatorLaunchSupport.tap(desc.name, (ctx) =>
{
if (ctx.emulator === 'DOLPHIN')
return { id: desc.name, possible: !!ctx.source };
});
ctx.hooks.games.emulatorLaunch.tapPromise(desc.name, async (ctx) =>
{
if (ctx.autoValidCommand.emulator === 'DOLPHIN' && ctx.autoValidCommand.metadata.emulatorDir)
{
const args = ["--batch"];
const storageFolder = path.join(config.get('downloadPath'), "saves", 'DOLPHIN');
args.push(...[`--user=${storageFolder}`, `--exec=${ctx.autoValidCommand.metadata.romPath}`]);
args.push(`--config=Dolphin.Display.Fullscreen=${config.get('launchInFullscreen') ? "True" : "False"}`);
args.push(`--config=Dolphin.General.ISOPath0=${path.join(config.get('downloadPath'), 'roms', 'gc')}`);
args.push(`--config=Dolphin.General.ISOPath1=${path.join(config.get('downloadPath'), 'roms', 'wii')}`);
args.push(`--config=Dolphin.Interface.ConfirmStop=False`);
args.push(`--config=Dolphin.Interface.SkipNKitWarning=True`);
args.push(`--config=Dolphin.Analytics.PermissionAsked=True`);
return args;
}
});
}
}

View file

@ -0,0 +1,15 @@
{
"name": "com.simeonradivoev.gameflow.dolphin",
"displayName": "DOLPHIN Integration",
"version": "0.0.1",
"description": "DOLPHIN Emulator Integration",
"main": "./dolphin.ts",
"icon": "https://upload.wikimedia.org/wikipedia/commons/5/53/Dolphin_Emulator_Logo_Refresh.svg",
"keywords": [
"integration",
"emulator",
"wiiu",
"gc",
"dolphin"
]
}

View file

@ -11,6 +11,14 @@ export default class PCSX2Integration implements PluginType
{
load (ctx: PluginContextType)
{
ctx.hooks.games.emulatorLaunchSupport.tap(desc.name, (ctx) =>
{
if (ctx.emulator === 'PCSX2')
{
return { id: desc.name, possible: ctx.source?.type === 'store' };
}
});
ctx.hooks.games.emulatorLaunch.tapPromise(desc.name, async (ctx) =>
{
if (ctx.autoValidCommand.emulator === 'PCSX2' && ctx.autoValidCommand.emulatorSource === 'store' && ctx.autoValidCommand.metadata.emulatorDir)

View file

@ -14,6 +14,15 @@ export default class PCSX2Integration implements PluginType
{
load (ctx: PluginContextType)
{
ctx.hooks.games.emulatorLaunchSupport.tap(desc.name, (ctx) =>
{
if (ctx.emulator === 'PPSSPP')
{
return { id: desc.name, possible: ctx.source?.type === 'store' };
}
});
ctx.hooks.games.emulatorLaunch.tapPromise(desc.name, async (ctx) =>
{
if (ctx.autoValidCommand.emulator === 'PPSSPP' && ctx.autoValidCommand.emulatorSource === 'store' && ctx.autoValidCommand.metadata.emulatorDir)