2016-03-26 22:07:44 +00:00
|
|
|
|
using System.Collections.Generic;
|
2014-05-30 22:00:16 +00:00
|
|
|
|
|
|
|
|
|
namespace BizHawk.Client.Common
|
|
|
|
|
{
|
2016-03-26 22:07:44 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// This class holds logic for System information.
|
2017-04-14 19:59:01 +00:00
|
|
|
|
/// That means specifications about a system that BizHawk emulates
|
2016-03-26 22:07:44 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
public sealed class SystemInfo
|
2014-05-30 22:00:16 +00:00
|
|
|
|
{
|
2016-03-26 22:07:44 +00:00
|
|
|
|
private const JoypadButton UpDownLeftRight = JoypadButton.Up | JoypadButton.Down | JoypadButton.Left | JoypadButton.Right;
|
|
|
|
|
private const JoypadButton StandardButtons = JoypadButton.A | JoypadButton.B | JoypadButton.Start | JoypadButton.Select | UpDownLeftRight;
|
2014-05-30 22:00:16 +00:00
|
|
|
|
|
2019-12-21 19:00:33 +00:00
|
|
|
|
private static readonly List<SystemInfo> AllSystemInfos = new List<SystemInfo>();
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-05-17 16:16:55 +00:00
|
|
|
|
/// Initializes a new instance of the <see cref="SystemInfo"/> class
|
2016-03-26 22:07:44 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="displayName">A <see cref="string"/> that specify how the system name is displayed</param>
|
|
|
|
|
/// <param name="system">A <see cref="CoreSystem"/> that specify what core is used</param>
|
|
|
|
|
/// <param name="maxControllers">Maximum controller allowed by this system</param>
|
|
|
|
|
/// <param name="availableButtons">Which buttons are available (i.e. are actually on the controller) for this system</param>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
private SystemInfo(string displayName, CoreSystem system, int maxControllers, JoypadButton availableButtons = 0)
|
2016-03-26 22:07:44 +00:00
|
|
|
|
{
|
2017-04-18 00:56:21 +00:00
|
|
|
|
DisplayName = displayName;
|
|
|
|
|
System = system;
|
|
|
|
|
MaxControllers = maxControllers;
|
|
|
|
|
AvailableButtons = availableButtons;
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
2019-12-21 19:00:33 +00:00
|
|
|
|
AllSystemInfos.Add(this);
|
2017-04-14 19:59:01 +00:00
|
|
|
|
}
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
2017-04-14 19:59:01 +00:00
|
|
|
|
#region Methods
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
#region Get SystemInfo
|
2017-04-14 19:59:01 +00:00
|
|
|
|
|
2017-04-18 03:43:08 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Apple II
|
2017-05-17 16:16:55 +00:00
|
|
|
|
/// </summary>
|
2017-04-18 03:43:08 +00:00
|
|
|
|
public static SystemInfo Libretro { get; } = new SystemInfo("Libretro", CoreSystem.Libretro, 1);
|
|
|
|
|
|
2016-03-26 22:07:44 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Apple II
|
2017-05-17 16:16:55 +00:00
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo AppleII { get; } = new SystemInfo("Apple II", CoreSystem.AppleII, 1);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Atari 2600
|
2017-05-17 16:16:55 +00:00
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo Atari2600 { get; } = new SystemInfo("Atari 2600", CoreSystem.Atari2600, 1);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Atari 7800
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo Atari7800 { get; } = new SystemInfo("Atari 7800", CoreSystem.Atari7800, 1);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Commodore 64
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo C64 { get; } = new SystemInfo("Commodore 64", CoreSystem.Commodore64, 1);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Coleco Vision
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo Coleco { get; } = new SystemInfo("ColecoVision", CoreSystem.ColecoVision, 1);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
2019-09-08 20:35:39 +00:00
|
|
|
|
/// <summary>
|
2019-10-04 17:52:29 +00:00
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Triple Gameboy
|
2019-09-08 20:35:39 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
public static SystemInfo GB3x { get; } = new SystemInfo("Game Boy Link 3x", CoreSystem.GB3x, 3, StandardButtons);
|
|
|
|
|
|
2019-10-04 17:52:29 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Quad Gameboy
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static SystemInfo GB4x { get; } = new SystemInfo("Game Boy Link 4x", CoreSystem.GB4x, 4, StandardButtons);
|
|
|
|
|
|
2016-03-26 22:07:44 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Dual Gameboy
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo DualGB { get; } = new SystemInfo("Game Boy Link", CoreSystem.DualGameBoy, 2, StandardButtons);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Gameboy
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo GB { get; } = new SystemInfo("GB", CoreSystem.GameBoy, 1, StandardButtons);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Gameboy Advance
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo GBA { get; } = new SystemInfo("Gameboy Advance", CoreSystem.GameBoyAdvance, 1, StandardButtons | JoypadButton.L | JoypadButton.R);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Gameboy Color
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo GBC { get; } = new SystemInfo("Gameboy Color", CoreSystem.GameBoy, 1, StandardButtons);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
DS Hawk (#1884)
* Add MelonDS.cs, support opening (but not really) .nds files.
* init MelonDS
* MelonDS: Load selected ROM.
* MelonDS: FrameAdvance and frame counter.
* MelonDS: IVideoProvider
* MelonDS: Add DLL files.
* MelonDS: IInputPollable
* MelonDS: IStatable (and add forgotten file MelonDS_InputPollable.cs)
* update libmelonDS.dll
* MelonDS: ISoundProvider
* Add NDS to Global.SystemInfo, and convert screen coords when running NDS.
* set up default NDS controller
* MelonDS: ISaveRam
* MelonDS: remove romlist.bin
* MelonDS: ISettable
* Create firmware folder if it doesn't exist on Windows; otherwise, an exception is thrown.
* Add database entries for NDS bios/firmware files.
* MelonDS: Use the bios/firmware files selected in BizHawk's "Firmwares" dialog.
* MelonDS: Re-work sync settings a bit.
* NDS's firmware file contains user settings; these are over-written by sync settings, so we shouldn't allow them to impact the hash
* MelonDS: Add (currently unused) bootToFirmware sync setting, and NDSSettings dialog.
* Update NDS firmware hash; it seems I had somehow corrupted mine.
* MelonDS: Use boot to firmware sync setting.
* MelonDS: Allow user to set some firmware user settings via the NDS settings dialog.
* MelonDS: Add singleInstance attribute to core.
* MelonDS: IMemoryDomains
* update libmelonDS.dll
* MelonDS: Set up default sync settings if none are provided.
* MelonDS: Allow user to reset settings to default.
* MelonDS: bios+firmware files are recommended
* libmelonDS.dll
* MelonDS: Don't use real time.
* MelonDS: Update to reflect new way of handling RTC in MelonDS.
* MelonDS: Notify if savestate load failed.
* update MelonDS.dll
* MelonDS: Allow user to set startup date/time in settings dialog.
* MelonDS: Create melon directory if it doesn't already exist.
* Don't include Designer's "fixes" in PR (partially reverts 56b474c00)
* Don't show a broken console window; alert user of need to restart instead.
This fixes an error related to MelonDS trying to use the broken stdout stream.
* update default NDS controls to match other updated controls
* Implement a system bus, using ARM9 read/writes.
* MelonDS: Allow BizHawk to change the contents of the frame buffer.
* update libmelonDS.dll
* fix stuff that was merged incorrectly, or was broken by merge
* update libmelonDS.dll
(includes memory leak fix)
* update libmelonDS.dll
(fixes memory leak and an occasional savestate crash)
* fix stuff that broke with the merge
* cleanups, remove stuff that is no longer needed by service interaces
* simplify DS MemoryDomains
* DS - fix order of controller buttons to be consistent with other consoles. This probably breaks any existing movies made on this core, but those would have been experiments, right?
* NDSSettings - make min value for day and month 0, whiel those aren't "valid" values they are the default values in the core for whatever reason, better to not crash on load and not show a value that isn't actually the setting. This can easily be reverted if the core changes to default to 1
Co-authored-by: YoshiRulz <OSSYoshiRulz@gmail.com>
Co-authored-by: adelikat <adelikat@tasvideos.org>
2020-03-21 15:53:30 +00:00
|
|
|
|
/// <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);
|
|
|
|
|
|
2016-03-26 22:07:44 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Genesis
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo Genesis { get; } = new SystemInfo("Genesis", CoreSystem.Genesis, 2, UpDownLeftRight | JoypadButton.A | JoypadButton.B | JoypadButton.C | JoypadButton.X | JoypadButton.Y | JoypadButton.Z);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Game Gear
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo GG { get; } = new SystemInfo("Game Gear", CoreSystem.MasterSystem, 1, UpDownLeftRight | JoypadButton.B1 | JoypadButton.B2);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Intellivision
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo Intellivision { get; } = new SystemInfo("Intellivision", CoreSystem.Intellivision, 2);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Lynx
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo Lynx { get; } = new SystemInfo("Lynx", CoreSystem.Lynx, 1);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for NES
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo Nes { get; } = new SystemInfo("NES", CoreSystem.NES, 2, StandardButtons);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Nintendo 64
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo N64 { get; } = new SystemInfo("Nintendo 64", CoreSystem.Nintendo64, 4, StandardButtons ^ JoypadButton.Select | JoypadButton.Z | JoypadButton.CUp | JoypadButton.CDown | JoypadButton.CLeft | JoypadButton.CRight | JoypadButton.AnalogStick | JoypadButton.L | JoypadButton.R);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Null (i.e. nothing is emulated) emulator
|
|
|
|
|
/// </summary>
|
2017-05-10 11:45:23 +00:00
|
|
|
|
public static SystemInfo Null { get; } = new SystemInfo("", CoreSystem.Null, 0);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for PCEngine (TurboGrafx-16)
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo PCE { get; } = new SystemInfo("TurboGrafx-16", CoreSystem.PCEngine, 1);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for PCEngine (TurboGrafx-16) + CD
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo PCECD { get; } = new SystemInfo("TurboGrafx - 16(CD)", CoreSystem.PCEngine, 1);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for PlayStation
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo PSX { get; } = new SystemInfo("PlayStation", CoreSystem.Playstation, 2);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Sega Saturn
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo Saturn { get; } = new SystemInfo("Saturn", CoreSystem.Saturn, 2, UpDownLeftRight | JoypadButton.A | JoypadButton.B | JoypadButton.C | JoypadButton.X | JoypadButton.Y | JoypadButton.Z);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for SG-1000 (Sega Game 1000)
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo SG { get; } = new SystemInfo("SG-1000", CoreSystem.MasterSystem, 1);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for PCEngine (Supergraph FX)
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo SGX { get; } = new SystemInfo("SuperGrafx", CoreSystem.PCEngine, 1);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Sega Master System
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo SMS { get; } = new SystemInfo("Sega Master System", CoreSystem.MasterSystem, 2, UpDownLeftRight | JoypadButton.B1 | JoypadButton.B2);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for SNES
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo SNES { get; } = new SystemInfo("SNES", CoreSystem.SNES, 8, StandardButtons | JoypadButton.X | JoypadButton.Y | JoypadButton.L | JoypadButton.R);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for TI-83
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo TI83 { get; } = new SystemInfo("TI - 83", CoreSystem.TI83, 1);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2019-12-21 19:00:33 +00:00
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for WonderSwan
|
2016-03-26 22:07:44 +00:00
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public static SystemInfo WonderSwan { get; } = new SystemInfo("WonderSwan", CoreSystem.WonderSwan, 1);
|
2017-04-14 19:59:01 +00:00
|
|
|
|
|
2017-06-01 00:09:31 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Virtual Boy
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static SystemInfo VirtualBoy { get; } = new SystemInfo("Virtual Boy", CoreSystem.VirtualBoy, 1);
|
|
|
|
|
|
2019-04-08 23:57:21 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Vectrex
|
|
|
|
|
/// </summary>
|
2019-12-21 19:00:33 +00:00
|
|
|
|
public static SystemInfo Vectrex { get; } = new SystemInfo("Vectrex", CoreSystem.Vectrex, 2);
|
2019-04-08 23:57:21 +00:00
|
|
|
|
|
2017-05-30 22:42:09 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for TI-83
|
|
|
|
|
/// </summary>
|
2017-06-01 00:09:31 +00:00
|
|
|
|
public static SystemInfo NeoGeoPocket { get; } = new SystemInfo("Neo-Geo Pocket", CoreSystem.NeoGeoPocket, 1);
|
2017-05-30 22:42:09 +00:00
|
|
|
|
|
2019-11-04 01:55:38 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for ZXSpectrum
|
|
|
|
|
/// </summary>
|
2019-12-21 19:00:33 +00:00
|
|
|
|
public static SystemInfo ZxSpectrum { get; } = new SystemInfo("ZX Spectrum", CoreSystem.ZXSpectrum, 2);
|
2019-11-04 01:55:38 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for AmstradCPC
|
|
|
|
|
/// </summary>
|
2019-12-21 19:00:33 +00:00
|
|
|
|
public static SystemInfo AmstradCpc { get; } = new SystemInfo("Amstrad CPC", CoreSystem.AmstradCPC, 2);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
2019-02-09 18:41:23 +00:00
|
|
|
|
/// <summary>
|
2019-04-16 15:10:56 +00:00
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for GGL
|
2019-02-09 18:41:23 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
public static SystemInfo GGL { get; } = new SystemInfo("Game Gear Linked", CoreSystem.GGL, 2);
|
2018-07-03 13:53:09 +00:00
|
|
|
|
|
2019-04-16 15:10:56 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for ChannelF
|
|
|
|
|
/// </summary>
|
2019-11-18 22:33:55 +00:00
|
|
|
|
///
|
2019-04-16 15:10:56 +00:00
|
|
|
|
public static SystemInfo ChannelF { get; } = new SystemInfo("Channel F", CoreSystem.ChannelF, 2);
|
2019-11-18 22:33:55 +00:00
|
|
|
|
/// <summary>
|
2019-11-19 03:17:29 +00:00
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for Odyssey2
|
2019-11-18 22:33:55 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
///
|
|
|
|
|
public static SystemInfo O2 { get; } = new SystemInfo("Odyssey2", CoreSystem.Odyssey2, 2);
|
2019-10-29 15:37:27 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for MAME
|
|
|
|
|
/// </summary>
|
2019-12-21 19:00:33 +00:00
|
|
|
|
public static SystemInfo Mame { get; } = new SystemInfo("MAME", CoreSystem.MAME, 4);
|
2020-01-10 20:51:56 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the <see cref="SystemInfo"/> instance for MSX
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static SystemInfo MSX { get; } = new SystemInfo("MSX", CoreSystem.MSX, 2);
|
2019-10-29 15:37:27 +00:00
|
|
|
|
|
2020-04-24 21:12:40 +00:00
|
|
|
|
public static SystemInfo Sgb { get; } = new SystemInfo("SGB", CoreSystem.SuperGameBoy, 4);
|
|
|
|
|
|
2019-02-09 18:41:23 +00:00
|
|
|
|
#endregion Get SystemInfo
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get a <see cref="SystemInfo"/> by its <see cref="CoreSystem"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="system"><see cref="CoreSystem"/> you're looking for</param>
|
|
|
|
|
/// <returns><see cref="SystemInfo"/></returns>
|
|
|
|
|
public static SystemInfo FindByCoreSystem(CoreSystem system)
|
2016-03-26 22:07:44 +00:00
|
|
|
|
{
|
2019-12-21 19:00:33 +00:00
|
|
|
|
return AllSystemInfos.Find(s => s.System == system);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Determine if this <see cref="SystemInfo"/> is equal to specified <see cref="object"/>
|
|
|
|
|
/// </summary>
|
2017-05-17 16:16:55 +00:00
|
|
|
|
/// <param name="obj"><see cref="object"/> to compare to</param>
|
2016-03-26 22:07:44 +00:00
|
|
|
|
/// <returns>True if object is equal to this instance; otherwise, false</returns>
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
2019-12-21 19:00:33 +00:00
|
|
|
|
if (obj is SystemInfo info)
|
2016-03-26 22:07:44 +00:00
|
|
|
|
{
|
2019-12-21 19:00:33 +00:00
|
|
|
|
return this == info;
|
2016-03-26 22:07:44 +00:00
|
|
|
|
}
|
2017-04-14 19:59:01 +00:00
|
|
|
|
|
|
|
|
|
return base.Equals(obj);
|
2016-03-26 22:07:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-13 15:38:30 +00:00
|
|
|
|
public override int GetHashCode() => DisplayName.GetHashCode(); // should be unique considering the property's purpose
|
|
|
|
|
|
2016-03-26 22:07:44 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns a <see cref="string"/> representation of current <see cref="SystemInfo"/>
|
|
|
|
|
/// In fact, return the same as DisplayName property
|
|
|
|
|
/// </summary>
|
2020-04-12 22:41:55 +00:00
|
|
|
|
public override string ToString() => DisplayName;
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Determine if two <see cref="SystemInfo"/> are equals.
|
|
|
|
|
/// As it is all static instance, it just compare their reference
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="system1">First <see cref="SystemInfo"/></param>
|
|
|
|
|
/// <param name="system2">Second <see cref="SystemInfo"/></param>
|
|
|
|
|
/// <returns>True if both system are equals; otherwise, false</returns>
|
|
|
|
|
public static bool operator ==(SystemInfo system1, SystemInfo system2)
|
|
|
|
|
{
|
|
|
|
|
return ReferenceEquals(system1, system2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Determine if two <see cref="SystemInfo"/> are different.
|
|
|
|
|
/// As it is all static instance, it just compare their reference
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="system1">First <see cref="SystemInfo"/></param>
|
|
|
|
|
/// <param name="system2">Second <see cref="SystemInfo"/></param>
|
2017-05-19 18:17:07 +00:00
|
|
|
|
/// <returns>True if both system are different; otherwise, false</returns>
|
2016-03-26 22:07:44 +00:00
|
|
|
|
public static bool operator !=(SystemInfo system1, SystemInfo system2)
|
|
|
|
|
{
|
|
|
|
|
return !(system1 == system2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Properties
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets <see cref="JoypadButton"/> available for this system
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public JoypadButton AvailableButtons { get; }
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
2017-04-15 20:37:30 +00:00
|
|
|
|
/// <summary>
|
2017-05-17 16:16:55 +00:00
|
|
|
|
/// Gets the system name as <see cref="string"/>
|
2016-03-26 22:07:44 +00:00
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public string DisplayName { get; }
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
2017-04-15 20:37:30 +00:00
|
|
|
|
/// <summary>
|
2016-03-26 22:07:44 +00:00
|
|
|
|
/// Gets the maximum amount of controller allowed for this system
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public int MaxControllers { get; }
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
2017-04-15 20:37:30 +00:00
|
|
|
|
/// <summary>
|
2016-03-26 22:07:44 +00:00
|
|
|
|
/// Gets core used for this system as <see cref="CoreSystem"/> enum
|
|
|
|
|
/// </summary>
|
2017-04-18 00:56:21 +00:00
|
|
|
|
public CoreSystem System { get; }
|
2016-03-26 22:07:44 +00:00
|
|
|
|
|
2017-04-15 20:37:30 +00:00
|
|
|
|
#endregion
|
2014-05-30 22:00:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|