Proof of concept for a SystemInfo object to have a singular place to have system specific info as opposed to SystemID switches stattered throughout the codebase
This commit is contained in:
parent
866f98c6ce
commit
5ce23c815d
|
@ -167,6 +167,7 @@
|
|||
<Compile Include="SaveSlotManager.cs" />
|
||||
<Compile Include="SavestateManager.cs" />
|
||||
<Compile Include="SevenZipSharpArchiveHandler.cs" />
|
||||
<Compile Include="SystemInfo.cs" />
|
||||
<Compile Include="tools\Cheat.cs" />
|
||||
<Compile Include="tools\CheatList.cs" />
|
||||
<Compile Include="tools\RamSearchEngine.cs" />
|
||||
|
|
|
@ -7,7 +7,6 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
public static IEmulator Emulator;
|
||||
public static CoreComm CoreComm;
|
||||
|
||||
public static Config Config;
|
||||
public static GameInfo Game;
|
||||
public static CheatCollection CheatList;
|
||||
|
@ -89,5 +88,20 @@ namespace BizHawk.Client.Common
|
|||
// Input state which has been estine for game controller inputs are coalesce here
|
||||
// This relies on a client specific implementation!
|
||||
public static SimpleController ControllerInputCoalescer;
|
||||
|
||||
public static SystemInfo SystemInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
switch(Global.Emulator.SystemId)
|
||||
{
|
||||
default:
|
||||
case "NULL":
|
||||
return SystemInfo.Null;
|
||||
case "NES":
|
||||
return SystemInfo.Nes;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public class SystemInfo
|
||||
{
|
||||
public SystemInfo() { }
|
||||
|
||||
public string DisplayName { get; set; }
|
||||
public int ByteSize { get; set; } // For Ram tools, whether it is a 8/16/32 bit system
|
||||
public MemoryDomain.Endian Endian { get; set; } //Big endian/little endian, etc
|
||||
|
||||
public static SystemInfo Null
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SystemInfo
|
||||
{
|
||||
DisplayName = "",
|
||||
ByteSize = 1,
|
||||
Endian = MemoryDomain.Endian.Little
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static SystemInfo Nes
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SystemInfo
|
||||
{
|
||||
DisplayName = "Nintendo",
|
||||
ByteSize = 1,
|
||||
Endian = MemoryDomain.Endian.Big
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1386,8 +1386,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private static string DisplayNameForSystem(string system)
|
||||
{
|
||||
var str = string.Empty;
|
||||
switch (system)
|
||||
var str = Global.SystemInfo.DisplayName;
|
||||
/*
|
||||
switch (Global.SystemInfo.DisplayName)
|
||||
{
|
||||
case "INTV": str = "Intellivision"; break;
|
||||
case "SG": str = "SG-1000"; break;
|
||||
|
@ -1412,7 +1413,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
case "DGB": str = "Game Boy Link"; break;
|
||||
case "WSWAN": str = "WonderSwan"; break;
|
||||
}
|
||||
|
||||
*/
|
||||
if (VersionInfo.INTERIM)
|
||||
{
|
||||
str += " (interim)";
|
||||
|
|
Loading…
Reference in New Issue