Add MelonDS.cs, support opening (but not really) .nds files.
This commit is contained in:
parent
1520529acf
commit
a867176a94
|
@ -49,6 +49,9 @@ namespace BizHawk.Client.ApiHawk
|
|||
case "GBA":
|
||||
return CoreSystem.GameBoyAdvance;
|
||||
|
||||
case "NDS":
|
||||
return CoreSystem.NintendoDS;
|
||||
|
||||
case "GEN":
|
||||
return CoreSystem.Genesis;
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
GameBoy,
|
||||
DualGameBoy,
|
||||
GameBoyAdvance,
|
||||
NintendoDS,
|
||||
Nintendo64,
|
||||
NES,
|
||||
SNES,
|
||||
|
|
|
@ -98,6 +98,11 @@ namespace BizHawk.Client.Common
|
|||
/// </summary>
|
||||
public static SystemInfo GBC { get; } = new SystemInfo("Gameboy Color", CoreSystem.GameBoy, 1, StandardButtons);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="SystemInfo"/> instance for Nintendo DS
|
||||
/// </summary>
|
||||
public static SystemInfo NDS { get; } = new SystemInfo("NDS", CoreSystem.NintendoDS, 1, StandardButtons | JoypadButton.L | JoypadButton.R | JoypadButton.X | JoypadButton.Y);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="SystemInfo"/> instance for Genesis
|
||||
/// </summary>
|
||||
|
|
|
@ -2140,7 +2140,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (VersionInfo.DeveloperBuild)
|
||||
{
|
||||
return FormatFilter(
|
||||
"Rom Files", "*.nes;*.fds;*.unf;*.sms;*.gg;*.sg;*.pce;*.sgx;*.bin;*.smd;*.rom;*.a26;*.a78;*.lnx;*.m3u;*.cue;*.ccd;*.mds;*.exe;*.gb;*.gbc;*.gba;*.gen;*.md;*.32x;*.col;*.int;*.smc;*.sfc;*.prg;*.d64;*.g64;*.crt;*.tap;*.sgb;*.xml;*.z64;*.v64;*.n64;*.ws;*.wsc;*.dsk;*.do;*.po;*.vb;*.ngp;*.ngc;*.psf;*.minipsf;*.nsf;*.tzx;*.pzx;*.csw;*.wav;*.cdt;%ARCH%",
|
||||
"Rom Files", "*.nes;*.fds;*.unf;*.sms;*.gg;*.sg;*.pce;*.sgx;*.bin;*.smd;*.rom;*.a26;*.a78;*.lnx;*.m3u;*.cue;*.ccd;*.mds;*.exe;*.gb;*.gbc;*.gba;*.nds;*.gen;*.md;*.32x;*.col;*.int;*.smc;*.sfc;*.prg;*.d64;*.g64;*.crt;*.tap;*.sgb;*.xml;*.z64;*.v64;*.n64;*.ws;*.wsc;*.dsk;*.do;*.po;*.vb;*.ngp;*.ngc;*.psf;*.minipsf;*.nsf;*.tzx;*.pzx;*.csw;*.wav;*.cdt;%ARCH%",
|
||||
"Music Files", "*.psf;*.minipsf;*.sid;*.nsf",
|
||||
"Disc Images", "*.cue;*.ccd;*.mds;*.m3u",
|
||||
"NES", "*.nes;*.fds;*.unf;*.nsf;%ARCH%",
|
||||
|
@ -2156,6 +2156,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"Genesis", "*.gen;*.smd;*.bin;*.md;*.32x;*.cue;*.ccd;%ARCH%",
|
||||
"Gameboy", "*.gb;*.gbc;*.sgb;%ARCH%",
|
||||
"Gameboy Advance", "*.gba;%ARCH%",
|
||||
"Nintendo DS", "*.nds;%ARCH%",
|
||||
"Colecovision", "*.col;%ARCH%",
|
||||
"Intellivision", "*.int;*.bin;*.rom;%ARCH%",
|
||||
"PlayStation", "*.cue;*.ccd;*.mds;*.m3u",
|
||||
|
@ -2174,7 +2175,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
return FormatFilter(
|
||||
"Rom Files", "*.nes;*.fds;*.unf;*.sms;*.gg;*.sg;*.gb;*.gbc;*.gba;*.pce;*.sgx;*.bin;*.smd;*.gen;*.md;*.32x;*.smc;*.sfc;*.a26;*.a78;*.lnx;*.col;*.int;*.rom;*.m3u;*.cue;*.ccd;*.mds;*.sgb;*.z64;*.v64;*.n64;*.ws;*.wsc;*.xml;*.dsk;*.do;*.po;*.psf;*.ngp;*.ngc;*.prg;*.d64;*.g64;*.minipsf;*.nsf;*.tzx;*.pzx;*.csw;*.wav;%ARCH%",
|
||||
"Rom Files", "*.nes;*.fds;*.unf;*.sms;*.gg;*.sg;*.gb;*.gbc;*.gba;*.nds;*.pce;*.sgx;*.bin;*.smd;*.gen;*.md;*.32x;*.smc;*.sfc;*.a26;*.a78;*.lnx;*.col;*.int;*.rom;*.m3u;*.cue;*.ccd;*.mds;*.sgb;*.z64;*.v64;*.n64;*.ws;*.wsc;*.xml;*.dsk;*.do;*.po;*.psf;*.ngp;*.ngc;*.prg;*.d64;*.g64;*.minipsf;*.nsf;*.tzx;*.pzx;*.csw;*.wav;%ARCH%",
|
||||
"Disc Images", "*.cue;*.ccd;*.mds;*.m3u",
|
||||
"NES", "*.nes;*.fds;*.unf;*.nsf;%ARCH%",
|
||||
"Super NES", "*.smc;*.sfc;*.xml;%ARCH%",
|
||||
|
@ -2183,6 +2184,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"Nintendo 64", "*.z64;*.v64;*.n64",
|
||||
"Gameboy", "*.gb;*.gbc;*.sgb;%ARCH%",
|
||||
"Gameboy Advance", "*.gba;%ARCH%",
|
||||
"Nintendo DS", "*.nds;%ARCH%",
|
||||
"Master System", "*.sms;*.gg;*.sg;%ARCH%",
|
||||
"PC Engine", "*.pce;*.sgx;*.cue;*.ccd;*.mds;%ARCH%",
|
||||
"Atari 2600", "*.a26;%ARCH%",
|
||||
|
|
|
@ -251,6 +251,9 @@ namespace BizHawk.Emulation.Common
|
|||
case ".GBA":
|
||||
game.System = "GBA";
|
||||
break;
|
||||
case ".NDS":
|
||||
game.System = "NDS";
|
||||
break;
|
||||
|
||||
case ".SMS":
|
||||
game.System = "SMS";
|
||||
|
|
|
@ -940,7 +940,7 @@
|
|||
<Compile Include="Consoles\Nintendo\GBHawk\GBC_PPU.cs">
|
||||
<DependentUpon>PPU.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Consoles\Nintendo\GBHawk\GBC_PPU_GB.cs">
|
||||
<Compile Include="Consoles\Nintendo\GBHawk\GBC_PPU_GB.cs">
|
||||
<DependentUpon>PPU.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Consoles\Nintendo\GBHawk\GB_PPU.cs">
|
||||
|
@ -986,6 +986,7 @@
|
|||
<Compile Include="Consoles\Nintendo\N64\N64VideoProvider.cs" />
|
||||
<Compile Include="Consoles\Nintendo\N64\NativeApi\mupen64plusInputApi.cs" />
|
||||
<Compile Include="Consoles\Nintendo\N64\NativeApi\mupen64plusVideoApi.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NDS\MelonDS.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\APU.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\AVE-NINA.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\AxROM.cs">
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||
{
|
||||
[Core("MelonDS", "Arisotura")]
|
||||
class MelonDS : IEmulator
|
||||
{
|
||||
private BasicServiceProvider _serviceProvider;
|
||||
public IEmulatorServiceProvider ServiceProvider => _serviceProvider;
|
||||
|
||||
public ControllerDefinition ControllerDefinition { get; private set; }
|
||||
|
||||
public int Frame => throw new NotImplementedException();
|
||||
|
||||
public string SystemId => "NDS";
|
||||
|
||||
public bool DeterministicEmulation => true;
|
||||
|
||||
public CoreComm CoreComm { get; private set; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool FrameAdvance(IController controller, bool render, bool rendersound = true)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void ResetCounters()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
// debug path/build for easier testing
|
||||
const string dllPath = "../../MelonDS/build/libmelonDS.dll";
|
||||
//const string dllPath = "libmelonDS.dll";
|
||||
|
||||
[DllImport(dllPath)]
|
||||
public static extern int test();
|
||||
|
||||
[CoreConstructor("NDS")]
|
||||
public MelonDS()
|
||||
{
|
||||
_serviceProvider = new BasicServiceProvider(this);
|
||||
ControllerDefinition = new ControllerDefinition();
|
||||
ControllerDefinition.Name = "NDS";
|
||||
ControllerDefinition.BoolButtons.Add("Left");
|
||||
ControllerDefinition.BoolButtons.Add("Right");
|
||||
ControllerDefinition.BoolButtons.Add("Up");
|
||||
ControllerDefinition.BoolButtons.Add("Down");
|
||||
ControllerDefinition.BoolButtons.Add("A");
|
||||
ControllerDefinition.BoolButtons.Add("B");
|
||||
ControllerDefinition.BoolButtons.Add("X");
|
||||
ControllerDefinition.BoolButtons.Add("Y");
|
||||
ControllerDefinition.BoolButtons.Add("L");
|
||||
ControllerDefinition.BoolButtons.Add("R");
|
||||
ControllerDefinition.BoolButtons.Add("Start");
|
||||
ControllerDefinition.BoolButtons.Add("Select");
|
||||
|
||||
ControllerDefinition.BoolButtons.Add("Lid");
|
||||
|
||||
ControllerDefinition.BoolButtons.Add("Touch");
|
||||
ControllerDefinition.FloatControls.Add("TouchX");
|
||||
ControllerDefinition.FloatRanges.Add(new ControllerDefinition.FloatRange(0, 128, 255));
|
||||
ControllerDefinition.FloatControls.Add("TouchY");
|
||||
ControllerDefinition.FloatRanges.Add(new ControllerDefinition.FloatRange(0, 96, 191));
|
||||
|
||||
CoreComm = new CoreComm(null, null);
|
||||
CoreComm.NominalWidth = 256;
|
||||
CoreComm.NominalHeight = 192;
|
||||
|
||||
Console.WriteLine("Melon returned " + test());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue