parent
04d5856f7d
commit
09b8b9c6f8
20 changed files with 351 additions and 231 deletions
|
|
@ -6,37 +6,48 @@ import desc from './package.json';
|
|||
|
||||
export default class DOLPHINIntegration implements PluginType
|
||||
{
|
||||
emulator = 'DOLPHIN';
|
||||
|
||||
|
||||
load (ctx: PluginContextType)
|
||||
{
|
||||
ctx.hooks.games.emulatorLaunchSupport.tap(desc.name, (ctx) =>
|
||||
ctx.hooks.games.emulatorLaunchSupport.tap({ name: desc.name, emulator: this.emulator }, (ctx) =>
|
||||
{
|
||||
if (ctx.emulator === 'DOLPHIN')
|
||||
return { id: desc.name, supportLevel: "full", capabilities: ["batch", "config", "fullscreen", "resolution", "saves", "states"] };
|
||||
return { id: desc.name, supportLevel: "full", capabilities: ["batch", "config", "fullscreen", "resolution", "saves", "states"] };
|
||||
});
|
||||
|
||||
ctx.hooks.emulators.emulatorPostInstall.tapPromise(desc.name, async (ctx) =>
|
||||
ctx.hooks.emulators.emulatorPostInstall.tapPromise({ name: desc.name, emulator: this.emulator }, async (ctx) =>
|
||||
{
|
||||
await Bun.write(path.join(ctx.path, "portable.txt"), "");
|
||||
});
|
||||
|
||||
ctx.hooks.games.emulatorLaunch.tapPromise(desc.name, async (ctx) =>
|
||||
ctx.hooks.games.emulatorLaunch.tapPromise({ name: desc.name, emulator: this.emulator }, async (ctx) =>
|
||||
{
|
||||
if (ctx.autoValidCommand.emulator === 'DOLPHIN' && ctx.autoValidCommand.metadata.emulatorDir)
|
||||
const args: string[] = [];
|
||||
|
||||
const storageFolder = path.join(config.get('downloadPath'), "storage", 'DOLPHIN');
|
||||
args.push(`--user=${storageFolder}`);
|
||||
|
||||
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`);
|
||||
|
||||
const savesPath = path.join(config.get('downloadPath'), "saves", 'DOLPHIN');
|
||||
|
||||
args.push(`--config=Dolphin.General.WiiSDCardPath=${path.join(savesPath, 'WiiSD.raw')}`);
|
||||
args.push(`--config=Dolphin.General.WiiSDCardSyncFolder=${path.join(savesPath, 'WiiSDSync')}`);
|
||||
args.push(`--config=Dolphin.GBA.SavesPath=${path.join(savesPath, 'GBA')}`);
|
||||
|
||||
if (ctx.autoValidCommand.metadata.romPath)
|
||||
{
|
||||
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;
|
||||
args.push("--batch");
|
||||
args.push(`--exec=${ctx.autoValidCommand.metadata.romPath}`);
|
||||
}
|
||||
|
||||
return args;
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue