M-M-M-MONSTER COMMIT! change Game-load api stuff
This commit is contained in:
parent
788cd17317
commit
b27673f26c
|
@ -181,6 +181,7 @@
|
||||||
<Compile Include="Consoles\Gameboy\Mappers.cs" />
|
<Compile Include="Consoles\Gameboy\Mappers.cs" />
|
||||||
<Compile Include="Database\CRC32.cs" />
|
<Compile Include="Database\CRC32.cs" />
|
||||||
<Compile Include="Database\Database.cs" />
|
<Compile Include="Database\Database.cs" />
|
||||||
|
<Compile Include="Database\GameInfo.cs" />
|
||||||
<Compile Include="Disc\CCD_format.cs" />
|
<Compile Include="Disc\CCD_format.cs" />
|
||||||
<Compile Include="Disc\CUE_format.cs" />
|
<Compile Include="Disc\CUE_format.cs" />
|
||||||
<Compile Include="Disc\Disc.API.cs" />
|
<Compile Include="Disc\Disc.API.cs" />
|
||||||
|
@ -205,7 +206,6 @@
|
||||||
<Compile Include="Sound\Utilities\Metaspu.cs" />
|
<Compile Include="Sound\Utilities\Metaspu.cs" />
|
||||||
<Compile Include="Interfaces\IController.cs" />
|
<Compile Include="Interfaces\IController.cs" />
|
||||||
<Compile Include="Interfaces\IEmulator.cs" />
|
<Compile Include="Interfaces\IEmulator.cs" />
|
||||||
<Compile Include="Interfaces\IGame.cs" />
|
|
||||||
<Compile Include="Interfaces\ISoundProvider.cs" />
|
<Compile Include="Interfaces\ISoundProvider.cs" />
|
||||||
<Compile Include="Interfaces\IVideoProvider.cs" />
|
<Compile Include="Interfaces\IVideoProvider.cs" />
|
||||||
<Compile Include="Log.cs" />
|
<Compile Include="Log.cs" />
|
||||||
|
|
|
@ -315,7 +315,7 @@ namespace BizHawk.Emulation.Consoles.Calculator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public TI83()
|
public TI83(GameInfo game, byte[] rom)
|
||||||
{
|
{
|
||||||
CoreOutputComm = new CoreOutputComm();
|
CoreOutputComm = new CoreOutputComm();
|
||||||
cpu.ReadMemory = ReadMemory;
|
cpu.ReadMemory = ReadMemory;
|
||||||
|
@ -324,6 +324,18 @@ namespace BizHawk.Emulation.Consoles.Calculator
|
||||||
cpu.WriteHardware = WriteHardware;
|
cpu.WriteHardware = WriteHardware;
|
||||||
cpu.IRQCallback = IRQCallback;
|
cpu.IRQCallback = IRQCallback;
|
||||||
cpu.NMICallback = NMICallback;
|
cpu.NMICallback = NMICallback;
|
||||||
|
|
||||||
|
this.rom = rom;
|
||||||
|
|
||||||
|
//different calculators (different revisions?) have different initPC. we track this in the game database by rom hash
|
||||||
|
//if( *(unsigned long *)(m_pRom + 0x6ce) == 0x04D3163E ) m_Regs.PC.W = 0x6ce; //KNOWN
|
||||||
|
//else if( *(unsigned long *)(m_pRom + 0x6f6) == 0x04D3163E ) m_Regs.PC.W = 0x6f6; //UNKNOWN
|
||||||
|
|
||||||
|
if (game["initPC"])
|
||||||
|
startPC = ushort.Parse(game.OptionValue("initPC"), NumberStyles.HexNumber);
|
||||||
|
|
||||||
|
HardReset();
|
||||||
|
SetupMemoryDomains();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRQCallback()
|
void IRQCallback()
|
||||||
|
@ -406,23 +418,6 @@ namespace BizHawk.Emulation.Consoles.Calculator
|
||||||
//configuration
|
//configuration
|
||||||
ushort startPC;
|
ushort startPC;
|
||||||
|
|
||||||
public void LoadGame(IGame game)
|
|
||||||
{
|
|
||||||
rom = game.GetRomData();
|
|
||||||
foreach (string opt in game.GetOptions())
|
|
||||||
{
|
|
||||||
//different calculators (different revisions?) have different initPC. we track this in the game database by rom hash
|
|
||||||
//if( *(unsigned long *)(m_pRom + 0x6ce) == 0x04D3163E ) m_Regs.PC.W = 0x6ce; //KNOWN
|
|
||||||
//else if( *(unsigned long *)(m_pRom + 0x6f6) == 0x04D3163E ) m_Regs.PC.W = 0x6f6; //UNKNOWN
|
|
||||||
|
|
||||||
if (opt.StartsWith("initPC"))
|
|
||||||
startPC = ushort.Parse(opt.Split('=')[1], NumberStyles.HexNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
HardReset();
|
|
||||||
SetupMemoryDomains();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void FrameAdvance(bool render)
|
public void FrameAdvance(bool render)
|
||||||
{
|
{
|
||||||
lagged = true;
|
lagged = true;
|
||||||
|
|
|
@ -269,7 +269,7 @@ namespace BizHawk.Emulation.Consoles.Gameboy
|
||||||
{
|
{
|
||||||
CoreOutputComm = new CoreOutputComm();
|
CoreOutputComm = new CoreOutputComm();
|
||||||
}
|
}
|
||||||
|
/* TOO BAD gameboy is broken until someone cares about it
|
||||||
public void LoadGame(IGame game)
|
public void LoadGame(IGame game)
|
||||||
{
|
{
|
||||||
Rom = game.GetRomData();
|
Rom = game.GetRomData();
|
||||||
|
@ -281,7 +281,7 @@ namespace BizHawk.Emulation.Consoles.Gameboy
|
||||||
CartFlags.SGB = Rom[0x0146] == 0x03;
|
CartFlags.SGB = Rom[0x0146] == 0x03;
|
||||||
|
|
||||||
HardReset();
|
HardReset();
|
||||||
}
|
} */
|
||||||
|
|
||||||
public bool BootFromBios = true;
|
public bool BootFromBios = true;
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CartInfo
|
public class CartInfo
|
||||||
{
|
{
|
||||||
public GameInfo game;
|
public NESGameInfo game;
|
||||||
public BizHawk.GameInfo DB_GameInfo;
|
public BizHawk.GameInfo DB_GameInfo;
|
||||||
|
|
||||||
public short chr_size;
|
public short chr_size;
|
||||||
|
@ -241,7 +241,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Logical game information. May exist in form of several carts (different revisions)
|
/// Logical game information. May exist in form of several carts (different revisions)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GameInfo
|
public class NESGameInfo
|
||||||
{
|
{
|
||||||
public string name;
|
public string name;
|
||||||
public List<CartInfo> carts = new List<CartInfo>();
|
public List<CartInfo> carts = new List<CartInfo>();
|
||||||
|
@ -285,12 +285,12 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
var gi = Database.CheckDatabase(hash);
|
var gi = Database.CheckDatabase(hash);
|
||||||
if (gi == null) return null;
|
if (gi == null) return null;
|
||||||
|
|
||||||
GameInfo game = new GameInfo();
|
NESGameInfo game = new NESGameInfo();
|
||||||
CartInfo cart = new CartInfo();
|
CartInfo cart = new CartInfo();
|
||||||
game.carts.Add(cart);
|
game.carts.Add(cart);
|
||||||
|
|
||||||
//try generating a bootgod cart descriptor from the game database
|
//try generating a bootgod cart descriptor from the game database
|
||||||
var dict = gi.ParseOptionsDictionary();
|
var dict = gi.GetOptionsDict();
|
||||||
game.name = gi.Name;
|
game.name = gi.Name;
|
||||||
cart.DB_GameInfo = gi;
|
cart.DB_GameInfo = gi;
|
||||||
cart.game = game;
|
cart.game = game;
|
||||||
|
@ -344,7 +344,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
//in anticipation of any slowness annoying people, and just for shits and giggles, i made a super fast parser
|
//in anticipation of any slowness annoying people, and just for shits and giggles, i made a super fast parser
|
||||||
int state=0;
|
int state=0;
|
||||||
var xmlreader = XmlReader.Create(new MemoryStream(GetDatabaseBytes()));
|
var xmlreader = XmlReader.Create(new MemoryStream(GetDatabaseBytes()));
|
||||||
GameInfo currGame = null;
|
NESGameInfo currGame = null;
|
||||||
CartInfo currCart = null;
|
CartInfo currCart = null;
|
||||||
while (xmlreader.Read())
|
while (xmlreader.Read())
|
||||||
{
|
{
|
||||||
|
@ -353,7 +353,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
case 0:
|
case 0:
|
||||||
if (xmlreader.NodeType == XmlNodeType.Element && xmlreader.Name == "game")
|
if (xmlreader.NodeType == XmlNodeType.Element && xmlreader.Name == "game")
|
||||||
{
|
{
|
||||||
currGame = new GameInfo();
|
currGame = new NESGameInfo();
|
||||||
currGame.name = xmlreader.GetAttribute("name");
|
currGame.name = xmlreader.GetAttribute("name");
|
||||||
state = 1;
|
state = 1;
|
||||||
}
|
}
|
||||||
|
@ -432,7 +432,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
} //end xmlreader loop
|
} //end xmlreader loop
|
||||||
|
|
||||||
//analyze
|
//analyze
|
||||||
foreach (GameInfo game in games)
|
foreach (NESGameInfo game in games)
|
||||||
{
|
{
|
||||||
foreach (CartInfo cart in game.carts)
|
foreach (CartInfo cart in game.carts)
|
||||||
{
|
{
|
||||||
|
@ -442,7 +442,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
List<GameInfo> games = new List<GameInfo>(); //maybe we dont need to track this
|
List<NESGameInfo> games = new List<NESGameInfo>(); //maybe we dont need to track this
|
||||||
Bag<string, CartInfo> sha1_table = new Bag<string, CartInfo>();
|
Bag<string, CartInfo> sha1_table = new Bag<string, CartInfo>();
|
||||||
|
|
||||||
public List<CartInfo> Identify(string sha1)
|
public List<CartInfo> Identify(string sha1)
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
public partial class NES : IEmulator
|
public partial class NES : IEmulator
|
||||||
{
|
{
|
||||||
static readonly bool USE_DATABASE = true;
|
static readonly bool USE_DATABASE = true;
|
||||||
|
public RomStatus RomStatus;
|
||||||
//Game issues:
|
//Game issues:
|
||||||
//Tecmo superbowl - wobbly "NFL" logo at the end of a game (even skipped game) [zeromus cant test this; how do you skip game?]
|
//Tecmo superbowl - wobbly "NFL" logo at the end of a game (even skipped game) [zeromus cant test this; how do you skip game?]
|
||||||
//Bigfoot (U) seems not to work
|
//Bigfoot (U) seems not to work
|
||||||
|
@ -37,14 +37,20 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
//AD&D Hillsfar (U).nes black screen
|
//AD&D Hillsfar (U).nes black screen
|
||||||
//Air Wolf - big graphical glitch. seems to be a real bug, but it should never have been released with this. need to verify for sure that it is a real bug?
|
//Air Wolf - big graphical glitch. seems to be a real bug, but it should never have been released with this. need to verify for sure that it is a real bug?
|
||||||
|
|
||||||
public NES()
|
public NES(GameInfo game, byte[] rom)
|
||||||
{
|
{
|
||||||
CoreOutputComm = new CoreOutputComm();
|
CoreOutputComm = new CoreOutputComm();
|
||||||
BootGodDB.Initialize();
|
BootGodDB.Initialize();
|
||||||
SetPalette(Palettes.FCEUX_Standard);
|
SetPalette(Palettes.FCEUX_Standard);
|
||||||
videoProvider = new MyVideoProvider(this);
|
videoProvider = new MyVideoProvider(this);
|
||||||
|
Init(game, rom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private NES()
|
||||||
|
{
|
||||||
|
BootGodDB.Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
public void WriteLogTimestamp()
|
public void WriteLogTimestamp()
|
||||||
{
|
{
|
||||||
if (ppu != null)
|
if (ppu != null)
|
||||||
|
@ -353,13 +359,13 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
LoadReport.WriteLine(format, arg);
|
LoadReport.WriteLine(format, arg);
|
||||||
}
|
}
|
||||||
void LoadWriteLine(object arg) { LoadWriteLine("{0}", arg); }
|
void LoadWriteLine(object arg) { LoadWriteLine("{0}", arg); }
|
||||||
|
|
||||||
public unsafe void LoadGame(IGame game)
|
public unsafe void Init(GameInfo gameInfo, byte[] rom)
|
||||||
{
|
{
|
||||||
LoadReport = new StringWriter();
|
LoadReport = new StringWriter();
|
||||||
LoadWriteLine("------");
|
LoadWriteLine("------");
|
||||||
LoadWriteLine("BEGIN NES rom analysis:");
|
LoadWriteLine("BEGIN NES rom analysis:");
|
||||||
byte[] file = game.GetFileData();
|
byte[] file = rom;
|
||||||
if (file.Length < 16) throw new Exception("Alleged NES rom too small to be anything useful");
|
if (file.Length < 16) throw new Exception("Alleged NES rom too small to be anything useful");
|
||||||
if (file.Take(4).SequenceEqual(System.Text.Encoding.ASCII.GetBytes("UNIF")))
|
if (file.Take(4).SequenceEqual(System.Text.Encoding.ASCII.GetBytes("UNIF")))
|
||||||
throw new Exception("You've tried to open a UNIF rom. We don't have any UNIF roms to test with. Please consult the developers.");
|
throw new Exception("You've tried to open a UNIF rom. We don't have any UNIF roms to test with. Please consult the developers.");
|
||||||
|
@ -437,7 +443,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadWriteLine("Chose board from iNES heuristics: " + iNES_board);
|
LoadWriteLine("Chose board from iNES heuristics: " + iNES_board);
|
||||||
choice.game.name = game.Name;
|
choice.game.name = gameInfo.Name;
|
||||||
origin = EDetectionOrigin.INES;
|
origin = EDetectionOrigin.INES;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -486,23 +492,23 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
|
|
||||||
if (origin == EDetectionOrigin.BootGodDB)
|
if (origin == EDetectionOrigin.BootGodDB)
|
||||||
{
|
{
|
||||||
CoreOutputComm.RomStatus = RomStatus.GoodDump;
|
RomStatus = RomStatus.GoodDump;
|
||||||
CoreOutputComm.RomStatusAnnotation = "Identified from BootGod's database";
|
CoreOutputComm.RomStatusAnnotation = "Identified from BootGod's database";
|
||||||
}
|
}
|
||||||
if (origin == EDetectionOrigin.INES)
|
if (origin == EDetectionOrigin.INES)
|
||||||
{
|
{
|
||||||
CoreOutputComm.RomStatus = RomStatus.NotInDatabase;
|
RomStatus = RomStatus.NotInDatabase;
|
||||||
CoreOutputComm.RomStatusAnnotation = "Inferred from iNES header; potentially wrong";
|
CoreOutputComm.RomStatusAnnotation = "Inferred from iNES header; potentially wrong";
|
||||||
}
|
}
|
||||||
if (origin == EDetectionOrigin.GameDB)
|
if (origin == EDetectionOrigin.GameDB)
|
||||||
{
|
{
|
||||||
if (choice.bad)
|
if (choice.bad)
|
||||||
{
|
{
|
||||||
CoreOutputComm.RomStatus = RomStatus.BadDump;
|
RomStatus = RomStatus.BadDump;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CoreOutputComm.RomStatus = choice.DB_GameInfo.Status;
|
RomStatus = choice.DB_GameInfo.Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,10 +531,10 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
if (cart.vram_size != 0)
|
if (cart.vram_size != 0)
|
||||||
board.VRAM = new byte[cart.vram_size * 1024];
|
board.VRAM = new byte[cart.vram_size * 1024];
|
||||||
|
|
||||||
|
|
||||||
HardReset();
|
HardReset();
|
||||||
SetupMemoryDomains();
|
SetupMemoryDomains();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncState(Serializer ser)
|
void SyncState(Serializer ser)
|
||||||
|
|
|
@ -152,7 +152,7 @@ static string ClassifyTable = @"
|
||||||
public CartInfo Analyze()
|
public CartInfo Analyze()
|
||||||
{
|
{
|
||||||
var ret = new CartInfo();
|
var ret = new CartInfo();
|
||||||
ret.game = new GameInfo();
|
ret.game = new NESGameInfo();
|
||||||
int mapper = (ROM_type >> 4);
|
int mapper = (ROM_type >> 4);
|
||||||
mapper |= (ROM_type2 & 0xF0);
|
mapper |= (ROM_type2 & 0xF0);
|
||||||
ret.mapper = (byte)mapper;
|
ret.mapper = (byte)mapper;
|
||||||
|
|
|
@ -20,6 +20,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
// ROM
|
// ROM
|
||||||
public byte[] RomData;
|
public byte[] RomData;
|
||||||
public int RomLength;
|
public int RomLength;
|
||||||
|
private Disc disc;
|
||||||
|
|
||||||
// Machine
|
// Machine
|
||||||
public NecSystemType Type;
|
public NecSystemType Type;
|
||||||
|
@ -41,19 +42,31 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
// Memory system
|
// Memory system
|
||||||
public byte[] Ram;
|
public byte[] Ram;
|
||||||
|
|
||||||
// Disc
|
|
||||||
//private Disc disc = Disc.FromCuePath("D:/lib/roms/Turbo CD/Terra Forming/Syd Mead's Terra Forming [U][CD.SCD][TGXCD1040][Syd Mead][1993][PCE][rigg].cue");
|
|
||||||
|
|
||||||
// PC Engine timings:
|
// PC Engine timings:
|
||||||
// 21,477,270 Machine clocks / sec
|
// 21,477,270 Machine clocks / sec
|
||||||
// 7,159,090 Cpu cycles / sec
|
// 7,159,090 Cpu cycles / sec
|
||||||
|
|
||||||
public PCEngine(NecSystemType type)
|
public PCEngine(GameInfo game, byte[] rom)
|
||||||
{
|
{
|
||||||
//scsi.disc = disc;
|
|
||||||
//Console.WriteLine(disc.GetHash());
|
|
||||||
CoreOutputComm = new CoreOutputComm();
|
CoreOutputComm = new CoreOutputComm();
|
||||||
Type = type;
|
switch (game.System)
|
||||||
|
{
|
||||||
|
case "PCE": Type = NecSystemType.TurboGrafx; break;
|
||||||
|
case "SGX": Type = NecSystemType.SuperGrafx; break;
|
||||||
|
}
|
||||||
|
Init(game, rom);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PCEngine(GameInfo game, Disc disc, byte[] rom)
|
||||||
|
{
|
||||||
|
CoreOutputComm = new CoreOutputComm();
|
||||||
|
Type = NecSystemType.TurboCD;
|
||||||
|
this.disc = disc;
|
||||||
|
Init(game, rom);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Init(GameInfo game, byte[] rom)
|
||||||
|
{
|
||||||
Controller = NullController.GetNullController();
|
Controller = NullController.GetNullController();
|
||||||
Cpu = new HuC6280();
|
Cpu = new HuC6280();
|
||||||
VCE = new VCE();
|
VCE = new VCE();
|
||||||
|
@ -77,34 +90,31 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
Cpu.WriteMemory21 = WriteMemorySGX;
|
Cpu.WriteMemory21 = WriteMemorySGX;
|
||||||
Cpu.WriteVDC = VDC1.WriteVDC;
|
Cpu.WriteVDC = VDC1.WriteVDC;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void LoadGame(IGame game)
|
if (rom.Length == 0x60000)
|
||||||
{
|
|
||||||
if (game.GetRomData().Length == 0x60000)
|
|
||||||
{
|
{
|
||||||
// 384k roms require special loading code. Why ;_;
|
// 384k roms require special loading code. Why ;_;
|
||||||
// In memory, 384k roms look like [1st 256k][Then full 384k]
|
// In memory, 384k roms look like [1st 256k][Then full 384k]
|
||||||
RomData = new byte[0xA0000];
|
RomData = new byte[0xA0000];
|
||||||
var origRom = game.GetRomData();
|
var origRom = rom;
|
||||||
for (int i=0; i<0x40000; i++)
|
for (int i=0; i<0x40000; i++)
|
||||||
RomData[i] = origRom[i];
|
RomData[i] = origRom[i];
|
||||||
for (int i = 0; i < 0x60000; i++)
|
for (int i = 0; i < 0x60000; i++)
|
||||||
RomData[i+0x40000] = origRom[i];
|
RomData[i+0x40000] = origRom[i];
|
||||||
RomLength = RomData.Length;
|
RomLength = RomData.Length;
|
||||||
} else if (game.GetRomData().Length > 1024 * 1024) {
|
} else if (rom.Length > 1024 * 1024) {
|
||||||
// If the rom is bigger than 1 megabyte, switch to Street Fighter 2 mapper
|
// If the rom is bigger than 1 megabyte, switch to Street Fighter 2 mapper
|
||||||
Cpu.ReadMemory21 = ReadMemorySF2;
|
Cpu.ReadMemory21 = ReadMemorySF2;
|
||||||
Cpu.WriteMemory21 = WriteMemorySF2;
|
Cpu.WriteMemory21 = WriteMemorySF2;
|
||||||
RomData = game.GetRomData();
|
RomData = rom;
|
||||||
RomLength = RomData.Length;
|
RomLength = RomData.Length;
|
||||||
} else {
|
} else {
|
||||||
// normal rom.
|
// normal rom.
|
||||||
RomData = game.GetRomData();
|
RomData = rom;
|
||||||
RomLength = RomData.Length;
|
RomLength = RomData.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.GetOptions().Contains("BRAM"))
|
if (game["BRAM"])
|
||||||
{
|
{
|
||||||
BramEnabled = true;
|
BramEnabled = true;
|
||||||
BRAM = new byte[2048];
|
BRAM = new byte[2048];
|
||||||
|
@ -115,14 +125,14 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
BRAM[4] = 0x00; BRAM[5] = 0x88; BRAM[6] = 0x10; BRAM[7] = 0x80;
|
BRAM[4] = 0x00; BRAM[5] = 0x88; BRAM[6] = 0x10; BRAM[7] = 0x80;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.GetOptions().Contains("PopulousSRAM"))
|
if (game["PopulousSRAM"])
|
||||||
{
|
{
|
||||||
PopulousRAM = new byte[0x8000];
|
PopulousRAM = new byte[0x8000];
|
||||||
Cpu.ReadMemory21 = ReadMemoryPopulous;
|
Cpu.ReadMemory21 = ReadMemoryPopulous;
|
||||||
Cpu.WriteMemory21 = WriteMemoryPopulous;
|
Cpu.WriteMemory21 = WriteMemoryPopulous;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.GetOptions().Contains("ForceSpriteLimit") || game.GetOptions().Contains("NotInDatabase"))
|
if (game["ForceSpriteLimit"] || game.NotInDatabase)
|
||||||
{
|
{
|
||||||
VDC1.PerformSpriteLimit = true;
|
VDC1.PerformSpriteLimit = true;
|
||||||
if (VDC2 != null)
|
if (VDC2 != null)
|
||||||
|
@ -138,14 +148,14 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
// version of this core. Let's just acknolwedge that the timing is imperfect and fix
|
// version of this core. Let's just acknolwedge that the timing is imperfect and fix
|
||||||
// it in the least intrusive and most honest way we can.
|
// it in the least intrusive and most honest way we can.
|
||||||
|
|
||||||
if (game.GetOptions().ContainsStartsWith("HBlankPeriod"))
|
if (game["HBlankPeriod"])
|
||||||
VDC1.HBlankCycles = int.Parse(game.GetOptions().GetOptionValue("HBlankPeriod"));
|
VDC1.HBlankCycles = int.Parse(game.OptionValue("HBlankPeriod"));
|
||||||
|
|
||||||
// This is also a hack. Proper multi-res/TV emulation will be a native-code core feature.
|
// This is also a hack. Proper multi-res/TV emulation will be a native-code core feature.
|
||||||
|
|
||||||
if (game.GetOptions().ContainsStartsWith("MultiResHack"))
|
if (game["MultiResHack"])
|
||||||
{
|
{
|
||||||
VDC1.MultiResHack = int.Parse(game.GetOptions().GetOptionValue("MultiResHack"));
|
VDC1.MultiResHack = int.Parse(game.OptionValue("MultiResHack"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Cpu.ResetPC();
|
Cpu.ResetPC();
|
||||||
|
|
|
@ -83,6 +83,7 @@ namespace BizHawk.Emulation.Consoles.Sega
|
||||||
Z80Reset = true;
|
Z80Reset = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TOO BAD genesis is broken until I finish turbocd
|
||||||
public void LoadGame(IGame game)
|
public void LoadGame(IGame game)
|
||||||
{
|
{
|
||||||
RomData = new byte[0x400000];
|
RomData = new byte[0x400000];
|
||||||
|
@ -92,7 +93,7 @@ namespace BizHawk.Emulation.Consoles.Sega
|
||||||
|
|
||||||
if (MainCPU != null) MainCPU.Reset();
|
if (MainCPU != null) MainCPU.Reset();
|
||||||
_MainCPU.Reset();
|
_MainCPU.Reset();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
public void StepMine()
|
public void StepMine()
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,7 +25,6 @@ namespace BizHawk.Emulation.Consoles.Sega
|
||||||
public byte[] RomData;
|
public byte[] RomData;
|
||||||
public byte RomBank0, RomBank1, RomBank2;
|
public byte RomBank0, RomBank1, RomBank2;
|
||||||
public byte RomBanks;
|
public byte RomBanks;
|
||||||
public IList<string> Options;
|
|
||||||
|
|
||||||
// SaveRAM
|
// SaveRAM
|
||||||
public byte[] SaveRAM = new byte[BankSize * 2];
|
public byte[] SaveRAM = new byte[BankSize * 2];
|
||||||
|
@ -64,76 +63,63 @@ namespace BizHawk.Emulation.Consoles.Sega
|
||||||
public DisplayType DisplayType { get; set; }
|
public DisplayType DisplayType { get; set; }
|
||||||
public bool DeterministicEmulation { get; set; }
|
public bool DeterministicEmulation { get; set; }
|
||||||
|
|
||||||
public SMS()
|
public SMS(GameInfo game, byte[] rom)
|
||||||
{
|
{
|
||||||
|
IsGameGear = game.System == "GG";
|
||||||
|
RomData = rom;
|
||||||
CoreOutputComm = new CoreOutputComm();
|
CoreOutputComm = new CoreOutputComm();
|
||||||
}
|
|
||||||
|
|
||||||
public void Init()
|
if (RomData.Length % BankSize != 0)
|
||||||
{
|
Array.Resize(ref RomData, ((RomData.Length / BankSize) + 1) * BankSize);
|
||||||
if (Controller == null)
|
RomBanks = (byte)(RomData.Length / BankSize);
|
||||||
Controller = NullController.GetNullController();
|
DisplayType = DisplayType.NTSC;
|
||||||
|
CoreOutputComm.VsyncRate = DisplayType == DisplayType.NTSC ? 60d : 50d;
|
||||||
|
if (game["PAL"]) DisplayType = DisplayType.PAL;
|
||||||
|
if (game["Japan"]) Region = "Japan";
|
||||||
|
if (game.NotInDatabase || game["FM"] && game["UseFM"])
|
||||||
|
HasYM2413 = true;
|
||||||
|
|
||||||
Cpu = new Z80A();
|
if (Controller == null)
|
||||||
Cpu.RegisterSP = 0xDFF0;
|
Controller = NullController.GetNullController();
|
||||||
Cpu.ReadHardware = ReadPort;
|
|
||||||
Cpu.WriteHardware = WritePort;
|
|
||||||
|
|
||||||
Vdp = new VDP(Cpu, IsGameGear ? VdpMode.GameGear : VdpMode.SMS, DisplayType);
|
Cpu = new Z80A();
|
||||||
PSG = new SN76489();
|
Cpu.RegisterSP = 0xDFF0;
|
||||||
YM2413 = new YM2413();
|
Cpu.ReadHardware = ReadPort;
|
||||||
SoundMixer = new SoundMixer(YM2413, PSG);
|
Cpu.WriteHardware = WritePort;
|
||||||
if (HasYM2413 && Options.Contains("WhenFMDisablePSG"))
|
|
||||||
SoundMixer.DisableSource(PSG);
|
|
||||||
ActiveSoundProvider = HasYM2413 ? (ISoundProvider)SoundMixer : PSG;
|
|
||||||
|
|
||||||
SystemRam = new byte[0x2000];
|
Vdp = new VDP(Cpu, IsGameGear ? VdpMode.GameGear : VdpMode.SMS, DisplayType);
|
||||||
if (Options.Contains("CMMapper") == false)
|
PSG = new SN76489();
|
||||||
InitSegaMapper();
|
YM2413 = new YM2413();
|
||||||
else
|
SoundMixer = new SoundMixer(YM2413, PSG);
|
||||||
InitCodeMastersMapper();
|
if (HasYM2413 && game["WhenFMDisablePSG"])
|
||||||
|
SoundMixer.DisableSource(PSG);
|
||||||
|
ActiveSoundProvider = HasYM2413 ? (ISoundProvider)SoundMixer : PSG;
|
||||||
|
|
||||||
if (Options.Contains("ForceStereo"))
|
SystemRam = new byte[0x2000];
|
||||||
{
|
if (game["CMMapper"] == false)
|
||||||
byte stereoByte = 0xAD;
|
InitSegaMapper();
|
||||||
if (Options.ContainsStartsWith("StereoByte"))
|
else
|
||||||
{
|
InitCodeMastersMapper();
|
||||||
stereoByte = byte.Parse(Options.GetOptionValue("StereoByte"));
|
|
||||||
}
|
|
||||||
PSG.StereoPanning = stereoByte;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Options.Contains("AllowOverclock") && Options.Contains("OverclockSafe"))
|
if (game["ForceStereo"])
|
||||||
Vdp.IPeriod = 512;
|
{
|
||||||
|
byte stereoByte = 0xAD;
|
||||||
|
if (game["StereoByte"])
|
||||||
|
{
|
||||||
|
stereoByte = byte.Parse(game.OptionValue("StereoByte"));
|
||||||
|
}
|
||||||
|
PSG.StereoPanning = stereoByte;
|
||||||
|
}
|
||||||
|
|
||||||
if (Options.Contains("BIOS"))
|
if (game["AllowOverclock"] && game["OverclockSafe"])
|
||||||
{
|
Vdp.IPeriod = 512;
|
||||||
Port3E = 0xF7; // Disable cartridge, enable BIOS rom
|
|
||||||
InitBiosMapper();
|
|
||||||
}
|
|
||||||
SetupMemoryDomains();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void LoadGame(IGame game)
|
if (game["BIOS"])
|
||||||
{
|
{
|
||||||
RomData = game.GetRomData();
|
Port3E = 0xF7; // Disable cartridge, enable BIOS rom
|
||||||
if (RomData.Length % BankSize != 0)
|
InitBiosMapper();
|
||||||
Array.Resize(ref RomData, ((RomData.Length / BankSize) + 1) * BankSize);
|
}
|
||||||
RomBanks = (byte)(RomData.Length / BankSize);
|
SetupMemoryDomains();
|
||||||
Options = game.GetOptions();
|
|
||||||
DisplayType = DisplayType.NTSC;
|
|
||||||
CoreOutputComm.VsyncRate = DisplayType == DisplayType.NTSC ? 60d : 50d;
|
|
||||||
foreach (string option in Options)
|
|
||||||
{
|
|
||||||
var args = option.Split('=');
|
|
||||||
if (args[0] == "Japan") Region = "Japan";
|
|
||||||
else if (args[0] == "PAL") DisplayType = DisplayType.PAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Options.Contains("NotInDatabase") || (Options.Contains("FM") && Options.Contains("UseFM")))
|
|
||||||
HasYM2413 = true;
|
|
||||||
|
|
||||||
Init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte ReadPort(ushort port)
|
public byte ReadPort(ushort port)
|
||||||
|
|
|
@ -1,60 +1,22 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace BizHawk
|
namespace BizHawk
|
||||||
{
|
{
|
||||||
public enum RomStatus
|
internal class CompactGameInfo
|
||||||
{
|
|
||||||
GoodDump,
|
|
||||||
BadDump,
|
|
||||||
Homebrew,
|
|
||||||
TranslatedRom,
|
|
||||||
Hack,
|
|
||||||
BIOS,
|
|
||||||
Overdump,
|
|
||||||
NotInDatabase
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum HashType
|
|
||||||
{
|
|
||||||
CRC32, MD5
|
|
||||||
}
|
|
||||||
|
|
||||||
public class GameInfo
|
|
||||||
{
|
{
|
||||||
public string Name;
|
public string Name;
|
||||||
public string System;
|
public string System;
|
||||||
public string MetaData;
|
public string MetaData;
|
||||||
public string hash;
|
public string Hash;
|
||||||
public RomStatus Status;
|
public RomStatus Status;
|
||||||
|
|
||||||
public string[] GetOptions()
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(MetaData))
|
|
||||||
return new string[0];
|
|
||||||
return MetaData.Split(';').Where(opt => string.IsNullOrEmpty(opt) == false).ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Dictionary<string, string> ParseOptionsDictionary()
|
|
||||||
{
|
|
||||||
var ret = new Dictionary<string, string>();
|
|
||||||
foreach (var opt in GetOptions())
|
|
||||||
{
|
|
||||||
var parts = opt.Split('=');
|
|
||||||
var key = parts[0];
|
|
||||||
var value = parts.Length > 1 ? parts[1] : "";
|
|
||||||
ret[key] = value;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Database
|
public static class Database
|
||||||
{
|
{
|
||||||
private static Dictionary<string, GameInfo> db = new Dictionary<string, GameInfo>();
|
private static Dictionary<string, CompactGameInfo> db = new Dictionary<string, CompactGameInfo>();
|
||||||
|
|
||||||
static string RemoveHashType(string hash)
|
static string RemoveHashType(string hash)
|
||||||
{
|
{
|
||||||
|
@ -66,10 +28,12 @@ namespace BizHawk
|
||||||
|
|
||||||
public static GameInfo CheckDatabase(string hash)
|
public static GameInfo CheckDatabase(string hash)
|
||||||
{
|
{
|
||||||
GameInfo ret = null;
|
CompactGameInfo cgi;
|
||||||
hash = RemoveHashType(hash);
|
hash = RemoveHashType(hash);
|
||||||
db.TryGetValue(hash, out ret);
|
db.TryGetValue(hash, out cgi);
|
||||||
return ret;
|
if (cgi == null)
|
||||||
|
return null;
|
||||||
|
return new GameInfo(cgi);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LoadDatabase_Escape(string line)
|
static void LoadDatabase_Escape(string line)
|
||||||
|
@ -103,9 +67,9 @@ namespace BizHawk
|
||||||
if (line.Trim().Length == 0) continue;
|
if (line.Trim().Length == 0) continue;
|
||||||
string[] items = line.Split('\t');
|
string[] items = line.Split('\t');
|
||||||
|
|
||||||
var Game = new GameInfo();
|
var Game = new CompactGameInfo();
|
||||||
//remove a hash type identifier. well don't really need them for indexing (theyre just there for human purposes)
|
//remove a hash type identifier. well don't really need them for indexing (theyre just there for human purposes)
|
||||||
Game.hash = RemoveHashType(items[0].ToUpper());
|
Game.Hash = RemoveHashType(items[0].ToUpper());
|
||||||
switch (items[1].Trim())
|
switch (items[1].Trim())
|
||||||
{
|
{
|
||||||
case "B": Game.Status = RomStatus.BadDump; break;
|
case "B": Game.Status = RomStatus.BadDump; break;
|
||||||
|
@ -121,10 +85,10 @@ namespace BizHawk
|
||||||
Game.System = items[3];
|
Game.System = items[3];
|
||||||
Game.MetaData = items.Length >= 6 ? items[5] : null;
|
Game.MetaData = items.Length >= 6 ? items[5] : null;
|
||||||
|
|
||||||
if (db.ContainsKey(Game.hash))
|
if (db.ContainsKey(Game.Hash))
|
||||||
Console.WriteLine("gamedb: Multiple hash entries {0}, duplicate detected on {1}",Game.hash, Game.Name);
|
Console.WriteLine("gamedb: Multiple hash entries {0}, duplicate detected on {1}",Game.Hash, Game.Name);
|
||||||
|
|
||||||
db[Game.hash] = Game;
|
db[Game.Hash] = Game;
|
||||||
} catch
|
} catch
|
||||||
{
|
{
|
||||||
Console.WriteLine("Error parsing database entry: "+line);
|
Console.WriteLine("Error parsing database entry: "+line);
|
||||||
|
@ -135,24 +99,21 @@ namespace BizHawk
|
||||||
|
|
||||||
public static GameInfo GetGameInfo(byte[] RomData, string fileName)
|
public static GameInfo GetGameInfo(byte[] RomData, string fileName)
|
||||||
{
|
{
|
||||||
GameInfo ret;
|
CompactGameInfo cgi;
|
||||||
string hash = string.Format("{0:X8}", CRC32.Calculate(RomData));
|
string hash = string.Format("{0:X8}", CRC32.Calculate(RomData));
|
||||||
if (db.TryGetValue(hash, out ret))
|
if (db.TryGetValue(hash, out cgi))
|
||||||
return ret;
|
return new GameInfo(cgi);
|
||||||
|
|
||||||
hash = Util.BytesToHexString(System.Security.Cryptography.MD5.Create().ComputeHash(RomData));
|
hash = Util.BytesToHexString(System.Security.Cryptography.MD5.Create().ComputeHash(RomData));
|
||||||
if (db.TryGetValue(hash, out ret))
|
if (db.TryGetValue(hash, out cgi))
|
||||||
return ret;
|
return new GameInfo(cgi);
|
||||||
|
|
||||||
hash = Util.BytesToHexString(System.Security.Cryptography.SHA1.Create().ComputeHash(RomData));
|
hash = Util.BytesToHexString(System.Security.Cryptography.SHA1.Create().ComputeHash(RomData));
|
||||||
if (db.TryGetValue(hash, out ret))
|
if (db.TryGetValue(hash, out cgi))
|
||||||
return ret;
|
return new GameInfo(cgi);
|
||||||
|
|
||||||
// rom is not in database. make some best-guesses
|
// rom is not in database. make some best-guesses
|
||||||
var Game = new GameInfo();
|
var Game = new GameInfo { Hash = hash, Status = RomStatus.NotInDatabase };
|
||||||
Game.hash = hash;
|
|
||||||
Game.MetaData = "NotInDatabase";
|
|
||||||
Game.Status = RomStatus.NotInDatabase;
|
|
||||||
Console.WriteLine("Game was not in DB. CRC: {0:X8} MD5: {1}",
|
Console.WriteLine("Game was not in DB. CRC: {0:X8} MD5: {1}",
|
||||||
CRC32.Calculate(RomData),
|
CRC32.Calculate(RomData),
|
||||||
Util.BytesToHexString(System.Security.Cryptography.MD5.Create().ComputeHash(RomData)));
|
Util.BytesToHexString(System.Security.Cryptography.MD5.Create().ComputeHash(RomData)));
|
||||||
|
|
|
@ -68,7 +68,6 @@ namespace BizHawk
|
||||||
public CoreOutputComm CoreOutputComm { get; private set; }
|
public CoreOutputComm CoreOutputComm { get; private set; }
|
||||||
public IVideoProvider VideoProvider { get { return this; } }
|
public IVideoProvider VideoProvider { get { return this; } }
|
||||||
public ISoundProvider SoundProvider { get { return this; } }
|
public ISoundProvider SoundProvider { get { return this; } }
|
||||||
public void LoadGame(IGame game) { }
|
|
||||||
public unsafe void FrameAdvance(bool render)
|
public unsafe void FrameAdvance(bool render)
|
||||||
{
|
{
|
||||||
//if (render == false) return;
|
//if (render == false) return;
|
||||||
|
|
|
@ -28,7 +28,6 @@ namespace BizHawk
|
||||||
Frame = 0;
|
Frame = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadGame(IGame game) { }
|
|
||||||
public void FrameAdvance(bool render)
|
public void FrameAdvance(bool render)
|
||||||
{
|
{
|
||||||
if (render == false) return;
|
if (render == false) return;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using System.Collections.Generic;
|
namespace BizHawk
|
||||||
|
|
||||||
namespace BizHawk
|
|
||||||
{
|
{
|
||||||
public class CoreInputComm
|
public class CoreInputComm
|
||||||
{
|
{
|
||||||
|
@ -12,9 +10,7 @@ namespace BizHawk
|
||||||
public class CoreOutputComm
|
public class CoreOutputComm
|
||||||
{
|
{
|
||||||
public double VsyncRate = 60;
|
public double VsyncRate = 60;
|
||||||
public RomStatus RomStatus;
|
|
||||||
public string RomStatusAnnotation;
|
public string RomStatusAnnotation;
|
||||||
public string RomStatusDetails;
|
public string RomStatusDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -12,7 +12,6 @@ namespace BizHawk
|
||||||
ControllerDefinition ControllerDefinition { get; }
|
ControllerDefinition ControllerDefinition { get; }
|
||||||
IController Controller { get; set; }
|
IController Controller { get; set; }
|
||||||
|
|
||||||
void LoadGame(IGame game);
|
|
||||||
void FrameAdvance(bool render);
|
void FrameAdvance(bool render);
|
||||||
|
|
||||||
int Frame { get; }
|
int Frame { get; }
|
||||||
|
@ -24,8 +23,6 @@ namespace BizHawk
|
||||||
byte[] SaveRam { get; }
|
byte[] SaveRam { get; }
|
||||||
bool SaveRamModified { get; set; }
|
bool SaveRamModified { get; set; }
|
||||||
|
|
||||||
// TODO: should IEmulator expose a way of enumerating the Options it understands?
|
|
||||||
// (the answer is yes)
|
|
||||||
void ResetFrameCounter();
|
void ResetFrameCounter();
|
||||||
void SaveStateText(TextWriter writer);
|
void SaveStateText(TextWriter writer);
|
||||||
void LoadStateText(TextReader reader);
|
void LoadStateText(TextReader reader);
|
||||||
|
@ -33,7 +30,7 @@ namespace BizHawk
|
||||||
void LoadStateBinary(BinaryReader reader);
|
void LoadStateBinary(BinaryReader reader);
|
||||||
byte[] SaveStateBinary();
|
byte[] SaveStateBinary();
|
||||||
|
|
||||||
//arbitrary extensible core comm mechanism
|
// Arbitrary extensible core comm mechanism
|
||||||
CoreInputComm CoreInputComm { get; set; }
|
CoreInputComm CoreInputComm { get; set; }
|
||||||
CoreOutputComm CoreOutputComm { get; }
|
CoreOutputComm CoreOutputComm { get; }
|
||||||
|
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace BizHawk
|
|
||||||
{
|
|
||||||
public interface IGame
|
|
||||||
{
|
|
||||||
byte[] GetRomData();
|
|
||||||
byte[] GetFileData();
|
|
||||||
IList<string> GetOptions();
|
|
||||||
|
|
||||||
//only use this for cosmetic purposes
|
|
||||||
string Name { get; }
|
|
||||||
|
|
||||||
//use this for path-building purposes
|
|
||||||
string FilesystemSafeName { get; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace BizHawk.Emulation
|
namespace BizHawk
|
||||||
{
|
{
|
||||||
// If you're wondering what the point of this is: It's mostly to have .Clear() be fast.
|
// If you're wondering what the point of this is: It's mostly to have .Clear() be fast.
|
||||||
// only intended to be used with value types. If used on references you may get GC issues.
|
// only intended to be used with value types. If used on references you may get GC issues.
|
||||||
|
@ -84,4 +85,96 @@ namespace BizHawk.Emulation
|
||||||
|
|
||||||
// TODO serialization functions
|
// TODO serialization functions
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// .net has no built-in read only dictionary
|
||||||
|
public class ReadOnlyDictionary<TKey, TValue> : IDictionary<TKey,TValue>
|
||||||
|
{
|
||||||
|
private IDictionary<TKey, TValue> dict;
|
||||||
|
|
||||||
|
public ReadOnlyDictionary(IDictionary<TKey, TValue> dictionary)
|
||||||
|
{
|
||||||
|
dict = dictionary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Add(TKey key, TValue value)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ContainsKey(TKey key)
|
||||||
|
{
|
||||||
|
return dict.ContainsKey(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICollection<TKey> Keys
|
||||||
|
{
|
||||||
|
get { return dict.Keys; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Remove(TKey key)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool TryGetValue(TKey key, out TValue value)
|
||||||
|
{
|
||||||
|
return dict.TryGetValue(key, out value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICollection<TValue> Values
|
||||||
|
{
|
||||||
|
get { return dict.Values; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public TValue this[TKey key]
|
||||||
|
{
|
||||||
|
get { return dict[key]; }
|
||||||
|
set { throw new InvalidOperationException(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Add(KeyValuePair<TKey, TValue> item)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Contains(KeyValuePair<TKey, TValue> item)
|
||||||
|
{
|
||||||
|
return dict.Contains(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
|
||||||
|
{
|
||||||
|
dict.CopyTo(array, arrayIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Count
|
||||||
|
{
|
||||||
|
get { return dict.Count; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsReadOnly
|
||||||
|
{
|
||||||
|
get { return true; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Remove(KeyValuePair<TKey, TValue> item)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
|
||||||
|
{
|
||||||
|
return dict.GetEnumerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
||||||
|
{
|
||||||
|
return ((System.Collections.IEnumerable)dict).GetEnumerator();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -244,7 +244,6 @@
|
||||||
<Compile Include="NEStools\SpriteViewer.cs">
|
<Compile Include="NEStools\SpriteViewer.cs">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="NullGame.cs" />
|
|
||||||
<Compile Include="PlayMovie.cs">
|
<Compile Include="PlayMovie.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace BizHawk.MultiClient
|
||||||
public static Config Config;
|
public static Config Config;
|
||||||
public static IEmulator Emulator;
|
public static IEmulator Emulator;
|
||||||
public static CoreInputComm CoreInputComm;
|
public static CoreInputComm CoreInputComm;
|
||||||
public static RomGame Game;
|
public static GameInfo Game;
|
||||||
public static Controller SMSControls;
|
public static Controller SMSControls;
|
||||||
public static Controller PCEControls;
|
public static Controller PCEControls;
|
||||||
public static Controller GenControls;
|
public static Controller GenControls;
|
||||||
|
|
|
@ -648,7 +648,7 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
private void screenshotAsToolStripMenuItem_Click(object sender, EventArgs e)
|
private void screenshotAsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string path = String.Format(Global.Game.ScreenshotPrefix + ".{0:yyyy-MM-dd HH.mm.ss}.png", DateTime.Now);
|
string path = String.Format(PathManager.ScreenshotPrefix(Global.Game) + ".{0:yyyy-MM-dd HH.mm.ss}.png", DateTime.Now);
|
||||||
|
|
||||||
SaveFileDialog sfd = new SaveFileDialog();
|
SaveFileDialog sfd = new SaveFileDialog();
|
||||||
sfd.InitialDirectory = Path.GetDirectoryName(path);
|
sfd.InitialDirectory = Path.GetDirectoryName(path);
|
||||||
|
@ -873,7 +873,7 @@ namespace BizHawk.MultiClient
|
||||||
else
|
else
|
||||||
contextMenuStrip1.Items[7].Enabled = true;
|
contextMenuStrip1.Items[7].Enabled = true;
|
||||||
|
|
||||||
string path = Global.Game.SaveStatePrefix + "." + "QuickSave" + SaveSlot.ToString() + ".State.bak";
|
string path = PathManager.SaveStatePrefix(Global.Game) + "." + "QuickSave" + SaveSlot + ".State.bak";
|
||||||
var file = new FileInfo(path);
|
var file = new FileInfo(path);
|
||||||
if (file.Exists == true)
|
if (file.Exists == true)
|
||||||
{
|
{
|
||||||
|
@ -1314,7 +1314,7 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
private void undoSavestateToolStripMenuItem_Click(object sender, EventArgs e)
|
private void undoSavestateToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string path = Global.Game.SaveStatePrefix + "." + "QuickSave" + SaveSlot.ToString() + ".State";
|
string path = PathManager.SaveStatePrefix(Global.Game) + "." + "QuickSave" + SaveSlot + ".State";
|
||||||
SwapBackupSavestate(path);
|
SwapBackupSavestate(path);
|
||||||
Global.RenderPanel.AddMessage("Save slot " + SaveSlot.ToString() + " restored.");
|
Global.RenderPanel.AddMessage("Save slot " + SaveSlot.ToString() + " restored.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace BizHawk.MultiClient
|
||||||
public MainForm(string[] args)
|
public MainForm(string[] args)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Global.Game = new NullGame();
|
Global.Game = new GameInfo();
|
||||||
if (Global.Config.ShowLogWindow)
|
if (Global.Config.ShowLogWindow)
|
||||||
{
|
{
|
||||||
LogConsole.ShowConsole();
|
LogConsole.ShowConsole();
|
||||||
|
@ -838,87 +838,88 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
|
|
||||||
IEmulator nextEmulator = null;
|
IEmulator nextEmulator = null;
|
||||||
RomGame game = null;
|
RomGame rom = null;
|
||||||
|
GameInfo game = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (file.Extension.ToLower() == ".iso")
|
try
|
||||||
{
|
{
|
||||||
if (Global.PsxCoreLibrary.IsOpen)
|
|
||||||
{
|
if (file.Extension.ToLower() == ".iso")
|
||||||
PsxCore psx = new PsxCore(Global.PsxCoreLibrary);
|
{
|
||||||
nextEmulator = psx;
|
if (Global.PsxCoreLibrary.IsOpen)
|
||||||
game = new RomGame();
|
{
|
||||||
var disc = Disc.FromIsoPath(path);
|
// sorry zero ;'( I leave de-RomGameifying this to you
|
||||||
Global.DiscHopper.Clear();
|
//PsxCore psx = new PsxCore(Global.PsxCoreLibrary);
|
||||||
Global.DiscHopper.Enqueue(disc);
|
//nextEmulator = psx;
|
||||||
Global.DiscHopper.Insert();
|
//game = new RomGame();
|
||||||
psx.SetDiscHopper(Global.DiscHopper);
|
//var disc = Disc.FromIsoPath(path);
|
||||||
}
|
//Global.DiscHopper.Clear();
|
||||||
|
//Global.DiscHopper.Enqueue(disc);
|
||||||
|
//Global.DiscHopper.Insert();
|
||||||
|
//psx.SetDiscHopper(Global.DiscHopper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rom = new RomGame(file);
|
||||||
|
game = rom.GameInfo;
|
||||||
|
|
||||||
|
switch (game.System)
|
||||||
|
{
|
||||||
|
case "SMS":
|
||||||
|
case "SG":
|
||||||
|
if (Global.Config.SmsEnableFM) game.AddOption("UseFM");
|
||||||
|
if (Global.Config.SmsAllowOverlock) game.AddOption("AllowOverclock");
|
||||||
|
if (Global.Config.SmsForceStereoSeparation) game.AddOption("ForceStereo");
|
||||||
|
nextEmulator = new SMS(game, rom.RomData);
|
||||||
|
break;
|
||||||
|
case "GG":
|
||||||
|
if (Global.Config.SmsAllowOverlock) game.AddOption("AllowOverclock");
|
||||||
|
nextEmulator = new SMS(game, rom.RomData);
|
||||||
|
break;
|
||||||
|
case "PCE":
|
||||||
|
case "SGX":
|
||||||
|
nextEmulator = new PCEngine(game, rom.RomData);
|
||||||
|
break;
|
||||||
|
case "GEN":
|
||||||
|
nextEmulator = new Genesis(true); //TODO
|
||||||
|
break;
|
||||||
|
case "TI83":
|
||||||
|
nextEmulator = new TI83(game, rom.RomData);
|
||||||
|
if (Global.Config.TI83autoloadKeyPad)
|
||||||
|
LoadTI83KeyPad();
|
||||||
|
break;
|
||||||
|
case "NES":
|
||||||
|
{
|
||||||
|
NES nes = new NES(game, rom.FileData);
|
||||||
|
Global.Game.Status = nes.RomStatus;
|
||||||
|
nextEmulator = nes;
|
||||||
|
if (Global.Config.NESAutoLoadPalette && Global.Config.NESPaletteFile.Length > 0 &&
|
||||||
|
HawkFile.ExistsAt(Global.Config.NESPaletteFile))
|
||||||
|
{
|
||||||
|
nes.SetPalette(
|
||||||
|
NES.Palettes.Load_FCEUX_Palette(HawkFile.ReadAllBytes(Global.Config.NESPaletteFile)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "GB":
|
||||||
|
nextEmulator = new Gameboy();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nextEmulator == null)
|
||||||
|
throw new Exception();
|
||||||
|
nextEmulator.CoreInputComm = Global.CoreInputComm;
|
||||||
}
|
}
|
||||||
else
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
game = new RomGame(file);
|
MessageBox.Show("Exception during loadgame:\n\n" + ex.ToString());
|
||||||
|
return false;
|
||||||
switch (game.System)
|
|
||||||
{
|
|
||||||
case "SG":
|
|
||||||
case "SMS":
|
|
||||||
nextEmulator = new SMS();
|
|
||||||
if (Global.Config.SmsEnableFM) game.AddOptions("UseFM");
|
|
||||||
if (Global.Config.SmsAllowOverlock) game.AddOptions("AllowOverclock");
|
|
||||||
if (Global.Config.SmsForceStereoSeparation) game.AddOptions("ForceStereo");
|
|
||||||
break;
|
|
||||||
case "GG":
|
|
||||||
nextEmulator = new SMS { IsGameGear = true };
|
|
||||||
if (Global.Config.SmsAllowOverlock) game.AddOptions("AllowOverclock");
|
|
||||||
break;
|
|
||||||
case "PCE":
|
|
||||||
nextEmulator = new PCEngine(NecSystemType.TurboGrafx);
|
|
||||||
break;
|
|
||||||
case "SGX":
|
|
||||||
nextEmulator = new PCEngine(NecSystemType.SuperGrafx);
|
|
||||||
break;
|
|
||||||
case "GEN":
|
|
||||||
nextEmulator = new Genesis(true);//TODO
|
|
||||||
break;
|
|
||||||
case "TI83":
|
|
||||||
nextEmulator = new TI83();
|
|
||||||
if (Global.Config.TI83autoloadKeyPad)
|
|
||||||
LoadTI83KeyPad();
|
|
||||||
break;
|
|
||||||
case "NES":
|
|
||||||
{
|
|
||||||
NES nes = new NES();
|
|
||||||
nextEmulator = nes;
|
|
||||||
if (Global.Config.NESAutoLoadPalette && Global.Config.NESPaletteFile.Length > 0 && HawkFile.ExistsAt(Global.Config.NESPaletteFile))
|
|
||||||
{
|
|
||||||
nes.SetPalette(NES.Palettes.Load_FCEUX_Palette(HawkFile.ReadAllBytes(Global.Config.NESPaletteFile)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "GB":
|
|
||||||
nextEmulator = new Gameboy();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nextEmulator == null) throw new Exception();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
nextEmulator.CoreInputComm = Global.CoreInputComm;
|
|
||||||
|
|
||||||
//this is a bit hacky, but many cores do not take responsibility for setting this, so we need to set it for them.
|
|
||||||
nextEmulator.CoreOutputComm.RomStatus = game.Status;
|
|
||||||
|
|
||||||
nextEmulator.LoadGame(game);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show("Exception during loadgame:\n\n" + ex.ToString());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextEmulator == null) throw new Exception();
|
if (nextEmulator == null) throw new Exception();
|
||||||
|
|
||||||
|
|
||||||
|
@ -936,7 +937,7 @@ namespace BizHawk.MultiClient
|
||||||
Text = DisplayNameForSystem(game.System) + " - " + game.Name;
|
Text = DisplayNameForSystem(game.System) + " - " + game.Name;
|
||||||
ResetRewindBuffer();
|
ResetRewindBuffer();
|
||||||
Global.Config.RecentRoms.Add(file.CanonicalFullPath);
|
Global.Config.RecentRoms.Add(file.CanonicalFullPath);
|
||||||
if (File.Exists(game.SaveRamPath))
|
if (File.Exists(PathManager.SaveRamPath(game)))
|
||||||
LoadSaveRam();
|
LoadSaveRam();
|
||||||
|
|
||||||
//setup the throttle based on platform's specifications
|
//setup the throttle based on platform's specifications
|
||||||
|
@ -975,7 +976,7 @@ namespace BizHawk.MultiClient
|
||||||
if (Global.Emulator == null) return;
|
if (Global.Emulator == null) return;
|
||||||
if (Global.Game == null) return;
|
if (Global.Game == null) return;
|
||||||
|
|
||||||
var status = Global.Emulator.CoreOutputComm.RomStatus;
|
var status = Global.Game.Status;
|
||||||
string annotation = "";
|
string annotation = "";
|
||||||
if (status == RomStatus.BadDump)
|
if (status == RomStatus.BadDump)
|
||||||
{
|
{
|
||||||
|
@ -1022,7 +1023,7 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var reader = new BinaryReader(new FileStream(Global.Game.SaveRamPath, FileMode.Open, FileAccess.Read)))
|
using (var reader = new BinaryReader(new FileStream(PathManager.SaveRamPath(Global.Game), FileMode.Open, FileAccess.Read)))
|
||||||
reader.Read(Global.Emulator.SaveRam, 0, Global.Emulator.SaveRam.Length);
|
reader.Read(Global.Emulator.SaveRam, 0, Global.Emulator.SaveRam.Length);
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
@ -1030,25 +1031,27 @@ namespace BizHawk.MultiClient
|
||||||
private void CloseGame()
|
private void CloseGame()
|
||||||
{
|
{
|
||||||
if (Global.Emulator.SaveRamModified)
|
if (Global.Emulator.SaveRamModified)
|
||||||
{
|
SaveRam();
|
||||||
string path = Global.Game.SaveRamPath;
|
|
||||||
|
|
||||||
var f = new FileInfo(path);
|
|
||||||
if (f.Directory.Exists == false)
|
|
||||||
f.Directory.Create();
|
|
||||||
|
|
||||||
var writer = new BinaryWriter(new FileStream(path, FileMode.Create, FileAccess.Write));
|
|
||||||
int len = Util.SaveRamBytesUsed(Global.Emulator.SaveRam);
|
|
||||||
//int len = Global.Emulator.SaveRam.Length;
|
|
||||||
writer.Write(Global.Emulator.SaveRam, 0, len);
|
|
||||||
writer.Close();
|
|
||||||
}
|
|
||||||
Global.Emulator.Dispose();
|
Global.Emulator.Dispose();
|
||||||
Global.Emulator = new NullEmulator();
|
Global.Emulator = new NullEmulator();
|
||||||
Global.ActiveController = Global.NullControls;
|
Global.ActiveController = Global.NullControls;
|
||||||
UserMovie.StopMovie();
|
UserMovie.StopMovie();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void SaveRam()
|
||||||
|
{
|
||||||
|
string path = PathManager.SaveRamPath(Global.Game);
|
||||||
|
|
||||||
|
var f = new FileInfo(path);
|
||||||
|
if (f.Directory.Exists == false)
|
||||||
|
f.Directory.Create();
|
||||||
|
|
||||||
|
var writer = new BinaryWriter(new FileStream(path, FileMode.Create, FileAccess.Write));
|
||||||
|
int len = Util.SaveRamBytesUsed(Global.Emulator.SaveRam);
|
||||||
|
writer.Write(Global.Emulator.SaveRam, 0, len);
|
||||||
|
writer.Close();
|
||||||
|
}
|
||||||
|
|
||||||
void OnSelectSlot(int num)
|
void OnSelectSlot(int num)
|
||||||
{
|
{
|
||||||
SaveSlot = num;
|
SaveSlot = num;
|
||||||
|
@ -1559,12 +1562,12 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
private void TakeScreenshot()
|
private void TakeScreenshot()
|
||||||
{
|
{
|
||||||
MakeScreenshot(String.Format(Global.Game.ScreenshotPrefix + ".{0:yyyy-MM-dd HH.mm.ss}.png", DateTime.Now));
|
MakeScreenshot(String.Format(PathManager.ScreenshotPrefix(Global.Game) + ".{0:yyyy-MM-dd HH.mm.ss}.png", DateTime.Now));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveState(string name)
|
private void SaveState(string name)
|
||||||
{
|
{
|
||||||
string path = Global.Game.SaveStatePrefix + "." + name + ".State";
|
string path = PathManager.SaveStatePrefix(Global.Game) + "." + name + ".State";
|
||||||
|
|
||||||
var file = new FileInfo(path);
|
var file = new FileInfo(path);
|
||||||
if (file.Directory.Exists == false)
|
if (file.Directory.Exists == false)
|
||||||
|
@ -1596,7 +1599,7 @@ namespace BizHawk.MultiClient
|
||||||
private void SaveStateAs()
|
private void SaveStateAs()
|
||||||
{
|
{
|
||||||
var sfd = new SaveFileDialog();
|
var sfd = new SaveFileDialog();
|
||||||
string path = Global.Game.SaveStatePrefix;
|
string path = PathManager.SaveStatePrefix(Global.Game);
|
||||||
sfd.InitialDirectory = path;
|
sfd.InitialDirectory = path;
|
||||||
sfd.FileName = "QuickSave0.State";
|
sfd.FileName = "QuickSave0.State";
|
||||||
var file = new FileInfo(path);
|
var file = new FileInfo(path);
|
||||||
|
@ -1629,7 +1632,7 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
private void LoadState(string name)
|
private void LoadState(string name)
|
||||||
{
|
{
|
||||||
string path = Global.Game.SaveStatePrefix + "." + name + ".State";
|
string path = PathManager.SaveStatePrefix(Global.Game) + "." + name + ".State";
|
||||||
if (File.Exists(path) == false)
|
if (File.Exists(path) == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1639,7 +1642,7 @@ namespace BizHawk.MultiClient
|
||||||
private void LoadStateAs()
|
private void LoadStateAs()
|
||||||
{
|
{
|
||||||
var ofd = new OpenFileDialog();
|
var ofd = new OpenFileDialog();
|
||||||
ofd.InitialDirectory = Global.Game.SaveStatePrefix;
|
ofd.InitialDirectory = PathManager.SaveStatePrefix(Global.Game);
|
||||||
ofd.Filter = "Save States (*.State)|*.State|All Files|*.*";
|
ofd.Filter = "Save States (*.State)|*.State|All Files|*.*";
|
||||||
ofd.RestoreDirectory = true;
|
ofd.RestoreDirectory = true;
|
||||||
|
|
||||||
|
@ -1943,7 +1946,7 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
CloseGame();
|
CloseGame();
|
||||||
Global.Emulator = new NullEmulator();
|
Global.Emulator = new NullEmulator();
|
||||||
Global.Game = new NullGame();
|
Global.Game = new GameInfo();
|
||||||
MemoryPulse.Clear();
|
MemoryPulse.Clear();
|
||||||
RamSearch1.Restart();
|
RamSearch1.Restart();
|
||||||
RamWatch1.Restart();
|
RamWatch1.Restart();
|
||||||
|
@ -2128,7 +2131,7 @@ namespace BizHawk.MultiClient
|
||||||
var sfd = new SaveFileDialog();
|
var sfd = new SaveFileDialog();
|
||||||
if (!(Global.Emulator is NullEmulator))
|
if (!(Global.Emulator is NullEmulator))
|
||||||
{
|
{
|
||||||
sfd.FileName = Global.Game.FilesystemSafeName;
|
sfd.FileName = PathManager.FilesystemSafeName(Global.Game);
|
||||||
sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.AVIPath, "");
|
sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.AVIPath, "");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,75 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace BizHawk.MultiClient
|
|
||||||
{
|
|
||||||
public class NullGame : RomGame
|
|
||||||
{
|
|
||||||
private List<string> options;
|
|
||||||
private const int BankSize = 4096;
|
|
||||||
new public RomStatus Status { get; private set; }
|
|
||||||
new public string Name { get { return "Null Game"; } set { } }
|
|
||||||
new public string FilesystemSafeName { get { return "Null Game"; } }
|
|
||||||
|
|
||||||
public NullGame()
|
|
||||||
{
|
|
||||||
FileData = new byte[1];
|
|
||||||
FileData[0] = new byte();
|
|
||||||
RomData = new byte[1];
|
|
||||||
RomData[0] = new byte();
|
|
||||||
System = "Null";
|
|
||||||
Status = RomStatus.GoodDump;
|
|
||||||
options = new List<String>();
|
|
||||||
options.Add("null");
|
|
||||||
}
|
|
||||||
|
|
||||||
private byte[] DeInterleaveSMD(byte[] source)
|
|
||||||
{
|
|
||||||
return FileData;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CheckForPatchOptions()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
new public string SaveRamPath
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.BasePath, ""), "Null Game.SaveRAM");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
new public string SaveStatePrefix
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string Bind = "";
|
|
||||||
if (Global.Config.BindSavestatesToMovies && Global.MainForm.UserMovie.Mode != MOVIEMODE.INACTIVE)
|
|
||||||
Bind += " - " + Path.GetFileNameWithoutExtension(Global.MainForm.UserMovie.Filename);
|
|
||||||
|
|
||||||
return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.BasePath, ""), "Null Game" + Bind);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
new public string MoviePrefix
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return PathManager.MakeAbsolutePath(Global.Config.BasePath, "") + "Null Game";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
new public string ScreenshotPrefix
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return PathManager.MakeAbsolutePath(Global.Config.BasePath, "") + "/" + "Null Game";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -193,7 +193,7 @@ namespace BizHawk.MultiClient
|
||||||
//Pull out matching names
|
//Pull out matching names
|
||||||
for (int x = 0; x < MovieList.Count; x++)
|
for (int x = 0; x < MovieList.Count; x++)
|
||||||
{
|
{
|
||||||
if (Global.Game.FilesystemSafeName == MovieList[x].GetGameName())
|
if (PathManager.FilesystemSafeName(Global.Game) == MovieList[x].GetGameName())
|
||||||
Indexes.Add(x);
|
Indexes.Add(x);
|
||||||
}
|
}
|
||||||
if (Indexes.Count == 0) return;
|
if (Indexes.Count == 0) return;
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace BizHawk.MultiClient
|
||||||
MovieToRecord.Header.SetHeaderLine(MovieHeader.GUID, MovieHeader.MakeGUID());
|
MovieToRecord.Header.SetHeaderLine(MovieHeader.GUID, MovieHeader.MakeGUID());
|
||||||
MovieToRecord.Header.SetHeaderLine(MovieHeader.PLATFORM, Global.Emulator.SystemId);
|
MovieToRecord.Header.SetHeaderLine(MovieHeader.PLATFORM, Global.Emulator.SystemId);
|
||||||
if (Global.Game != null)
|
if (Global.Game != null)
|
||||||
MovieToRecord.Header.SetHeaderLine(MovieHeader.GAMENAME, Global.Game.FilesystemSafeName);
|
MovieToRecord.Header.SetHeaderLine(MovieHeader.GAMENAME, PathManager.FilesystemSafeName(Global.Game));
|
||||||
else
|
else
|
||||||
MovieToRecord.Header.SetHeaderLine(MovieHeader.GAMENAME, "NULL");
|
MovieToRecord.Header.SetHeaderLine(MovieHeader.GAMENAME, "NULL");
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ namespace BizHawk.MultiClient
|
||||||
SaveFileDialog sfd = new SaveFileDialog();
|
SaveFileDialog sfd = new SaveFileDialog();
|
||||||
sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, "");
|
sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, "");
|
||||||
sfd.DefaultExt = ".tas";
|
sfd.DefaultExt = ".tas";
|
||||||
sfd.FileName = Global.Game.FilesystemSafeName;
|
sfd.FileName = PathManager.FilesystemSafeName(Global.Game);
|
||||||
sfd.Filter = "Movie files (*.tas)|*.tas";
|
sfd.Filter = "Movie files (*.tas)|*.tas";
|
||||||
|
|
||||||
Global.Sound.StopSound();
|
Global.Sound.StopSound();
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace BizHawk.MultiClient
|
namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
public class RomGame : IGame
|
public class RomGame
|
||||||
{
|
{
|
||||||
public byte[] RomData;
|
public byte[] RomData;
|
||||||
public byte[] FileData;
|
public byte[] FileData;
|
||||||
public string System;
|
public GameInfo GameInfo;
|
||||||
public RomStatus Status { get; private set; }
|
|
||||||
|
|
||||||
private string name;
|
|
||||||
private string filesystemSafeName;
|
|
||||||
private List<string> options;
|
|
||||||
private const int BankSize = 4096;
|
private const int BankSize = 4096;
|
||||||
|
|
||||||
public RomGame() { }
|
public RomGame() { }
|
||||||
|
@ -40,18 +34,10 @@ namespace BizHawk.MultiClient
|
||||||
if (file.Extension == ".SMD")
|
if (file.Extension == ".SMD")
|
||||||
RomData = DeInterleaveSMD(RomData);
|
RomData = DeInterleaveSMD(RomData);
|
||||||
|
|
||||||
var info = Database.GetGameInfo(RomData, file.Name);
|
GameInfo = Database.GetGameInfo(RomData, file.Name);
|
||||||
name = info.Name;
|
|
||||||
System = info.System;
|
|
||||||
Status = info.Status;
|
|
||||||
options = new List<string>(info.GetOptions());
|
|
||||||
CheckForPatchOptions();
|
CheckForPatchOptions();
|
||||||
|
|
||||||
//build a safe filesystem name for use in auxilary files (savestates, saveram, etc)
|
|
||||||
filesystemSafeName = file.CanonicalName.Replace("|", "+");
|
|
||||||
filesystemSafeName = Path.Combine(Path.GetDirectoryName(filesystemSafeName), Path.GetFileNameWithoutExtension(filesystemSafeName));
|
|
||||||
|
|
||||||
|
|
||||||
if (patch != null)
|
if (patch != null)
|
||||||
{
|
{
|
||||||
using (var patchFile = new HawkFile(patch))
|
using (var patchFile = new HawkFile(patch))
|
||||||
|
@ -63,12 +49,7 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddOptions(params string[] options)
|
private static byte[] DeInterleaveSMD(byte[] source)
|
||||||
{
|
|
||||||
this.options.AddRange(options);
|
|
||||||
}
|
|
||||||
|
|
||||||
private byte[] DeInterleaveSMD(byte[] source)
|
|
||||||
{
|
{
|
||||||
// SMD files are interleaved in pages of 16k, with the first 8k containing all
|
// SMD files are interleaved in pages of 16k, with the first 8k containing all
|
||||||
// odd bytes and the second 8k containing all even bytes.
|
// odd bytes and the second 8k containing all even bytes.
|
||||||
|
@ -93,113 +74,19 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (var opt in options)
|
if (GameInfo["PatchBytes"])
|
||||||
{
|
{
|
||||||
if (opt.StartsWith("PatchBytes"))
|
string args = GameInfo.OptionValue("PatchBytes");
|
||||||
|
foreach (var val in args.Split(','))
|
||||||
{
|
{
|
||||||
var split1 = opt.Split('=');
|
var split = val.Split(':');
|
||||||
foreach (var val in split1[1].Split(','))
|
int offset = int.Parse(split[0], NumberStyles.HexNumber);
|
||||||
{
|
byte value = byte.Parse(split[1], NumberStyles.HexNumber);
|
||||||
var split3 = val.Split(':');
|
RomData[offset] = value;
|
||||||
int offset = int.Parse(split3[0], NumberStyles.HexNumber);
|
|
||||||
byte value = byte.Parse(split3[1], NumberStyles.HexNumber);
|
|
||||||
RomData[offset] = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception) { } // No need for errors in patching to propagate.
|
catch (Exception) { } // No need for errors in patching to propagate.
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] GetRomData() { return RomData; }
|
|
||||||
public byte[] GetFileData() { return FileData; }
|
|
||||||
public IList<string> GetOptions() { return options; }
|
|
||||||
public string Name { get { return name; } set { name = value; } }
|
|
||||||
public string FilesystemSafeName { get { return filesystemSafeName; } }
|
|
||||||
|
|
||||||
public string SaveRamPath
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
switch (System)
|
|
||||||
{
|
|
||||||
case "SMS": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathSMSSaveRAM, "SMS"), filesystemSafeName + ".SaveRAM");
|
|
||||||
case "GG": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathGGSaveRAM, "GG"), filesystemSafeName + ".SaveRAM");
|
|
||||||
case "SG": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathSGSaveRAM, "SG"), filesystemSafeName + ".SaveRAM");
|
|
||||||
case "SGX": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathPCESaveRAM, "PCE"), filesystemSafeName + ".SaveRAM");
|
|
||||||
case "PCE": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathPCESaveRAM, "PCE"), filesystemSafeName + ".SaveRAM");
|
|
||||||
case "GB": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathGBSaveRAM, "GB"), filesystemSafeName + ".SaveRAM");
|
|
||||||
case "GEN": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathGenesisSaveRAM, "GEN"), filesystemSafeName + ".SaveRAM");
|
|
||||||
case "NES": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathNESSaveRAM, "NES"), filesystemSafeName + ".SaveRAM");
|
|
||||||
case "TI83": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathTI83SaveRAM, "TI83"), filesystemSafeName + ".SaveRAM");
|
|
||||||
default: return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string SaveStatePrefix
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string Bind = "";
|
|
||||||
if (Global.Config.BindSavestatesToMovies && Global.MainForm.UserMovie.Mode != MOVIEMODE.INACTIVE)
|
|
||||||
Bind += " - " + Path.GetFileNameWithoutExtension(Global.MainForm.UserMovie.Filename);
|
|
||||||
switch (System)
|
|
||||||
{
|
|
||||||
case "SMS": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathSMSSavestates, "SMS"), filesystemSafeName + Bind);
|
|
||||||
case "GG": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathGGSavestates, "GG"), filesystemSafeName + Bind);
|
|
||||||
case "SG": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathSGSavestates, "SG"), filesystemSafeName + Bind);
|
|
||||||
case "PCE": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathPCESavestates, "PCE"), filesystemSafeName + Bind);
|
|
||||||
case "SGX": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathPCESavestates, "PCE"), filesystemSafeName + Bind);
|
|
||||||
case "GB": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathGBSavestates, "GB"), filesystemSafeName + Bind);
|
|
||||||
case "GEN": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathGenesisSavestates, "GEN"), filesystemSafeName + Bind);
|
|
||||||
case "NES": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathNESSavestates, "NES"), filesystemSafeName + Bind);
|
|
||||||
case "TI83": return Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathTI83Savestates, "TI83"), filesystemSafeName + Bind);
|
|
||||||
default: return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string MoviePrefix
|
|
||||||
{
|
|
||||||
//Obsolete because there is one singular Movie path
|
|
||||||
get
|
|
||||||
{
|
|
||||||
switch (System)
|
|
||||||
{
|
|
||||||
case "SMS": return "SMS/Movie/" + filesystemSafeName;
|
|
||||||
case "GG": return "Game Gear/Movie/" + filesystemSafeName;
|
|
||||||
case "SG": return "SG-1000/Movie/" + filesystemSafeName;
|
|
||||||
case "PCE": return "TurboGrafx/Movie/" + filesystemSafeName;
|
|
||||||
case "SGX": return "TurboGrafx/Movie/" + filesystemSafeName;
|
|
||||||
case "GB": return "Gameboy/Movie/" + filesystemSafeName;
|
|
||||||
case "GEN": return "Genesis/Movie/" + filesystemSafeName;
|
|
||||||
case "NES": return "NES/Movie/" + filesystemSafeName;
|
|
||||||
case "TI83": return "TI83/Movie/" + filesystemSafeName;
|
|
||||||
default: return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ScreenshotPrefix
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
switch (System)
|
|
||||||
{
|
|
||||||
case "SMS": return PathManager.MakeAbsolutePath(Global.Config.PathSMSScreenshots, "SMS") + "/" + filesystemSafeName;
|
|
||||||
case "GG": return PathManager.MakeAbsolutePath(Global.Config.PathGGScreenshots, "GG") + "/" + filesystemSafeName;
|
|
||||||
case "SG": return PathManager.MakeAbsolutePath(Global.Config.PathSGScreenshots, "SG") + "/" + filesystemSafeName;
|
|
||||||
case "PCE": return PathManager.MakeAbsolutePath(Global.Config.PathPCEScreenshots, "PCE") + "/" + filesystemSafeName;
|
|
||||||
case "SGX": return PathManager.MakeAbsolutePath(Global.Config.PathPCEScreenshots, "PCE") + "/" + filesystemSafeName;
|
|
||||||
case "GB": return PathManager.MakeAbsolutePath(Global.Config.PathGBScreenshots, "GB") + "/" + filesystemSafeName;
|
|
||||||
case "GEN": return PathManager.MakeAbsolutePath(Global.Config.PathGenesisScreenshots, "GEN") + "/" + filesystemSafeName;
|
|
||||||
case "NES": return PathManager.MakeAbsolutePath(Global.Config.PathNESScreenshots, "NES") + "/" + filesystemSafeName;
|
|
||||||
case "TI83": return PathManager.MakeAbsolutePath(Global.Config.PathTI83Screenshots, "TI83") + "/" + filesystemSafeName;
|
|
||||||
default: return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
for (int x = 0; x < 10; x++)
|
for (int x = 0; x < 10; x++)
|
||||||
{
|
{
|
||||||
path = Global.Game.SaveStatePrefix + "." + "QuickSave" + x + ".State";
|
path = PathManager.SaveStatePrefix(Global.Game) + "." + "QuickSave" + x + ".State";
|
||||||
var file = new FileInfo(path);
|
var file = new FileInfo(path);
|
||||||
if (file.Directory.Exists == false)
|
if (file.Directory.Exists == false)
|
||||||
file.Directory.Create();
|
file.Directory.Create();
|
||||||
|
|
|
@ -259,5 +259,65 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string FilesystemSafeName(GameInfo game)
|
||||||
|
{
|
||||||
|
string filesystemSafeName = game.Name.Replace("|", "+");
|
||||||
|
return Path.Combine(Path.GetDirectoryName(filesystemSafeName), Path.GetFileNameWithoutExtension(filesystemSafeName));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string SaveRamPath(GameInfo game)
|
||||||
|
{
|
||||||
|
string name = FilesystemSafeName(game);
|
||||||
|
switch (game.System)
|
||||||
|
{
|
||||||
|
case "SMS": return Path.Combine(MakeAbsolutePath(Global.Config.PathSMSSaveRAM, "SMS"), name + ".SaveRAM");
|
||||||
|
case "GG": return Path.Combine(MakeAbsolutePath(Global.Config.PathGGSaveRAM, "GG"), name + ".SaveRAM");
|
||||||
|
case "SG": return Path.Combine(MakeAbsolutePath(Global.Config.PathSGSaveRAM, "SG"), name + ".SaveRAM");
|
||||||
|
case "SGX": return Path.Combine(MakeAbsolutePath(Global.Config.PathPCESaveRAM, "PCE"), name + ".SaveRAM");
|
||||||
|
case "PCE": return Path.Combine(MakeAbsolutePath(Global.Config.PathPCESaveRAM, "PCE"), name + ".SaveRAM");
|
||||||
|
case "GB": return Path.Combine(MakeAbsolutePath(Global.Config.PathGBSaveRAM, "GB"), name + ".SaveRAM");
|
||||||
|
case "GEN": return Path.Combine(MakeAbsolutePath(Global.Config.PathGenesisSaveRAM, "GEN"), name + ".SaveRAM");
|
||||||
|
case "NES": return Path.Combine(MakeAbsolutePath(Global.Config.PathNESSaveRAM, "NES"), name + ".SaveRAM");
|
||||||
|
case "TI83": return Path.Combine(MakeAbsolutePath(Global.Config.PathTI83SaveRAM, "TI83"), name + ".SaveRAM");
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string SaveStatePrefix(GameInfo game)
|
||||||
|
{
|
||||||
|
string name = FilesystemSafeName(game);
|
||||||
|
switch (game.System)
|
||||||
|
{
|
||||||
|
case "SMS": return Path.Combine(MakeAbsolutePath(Global.Config.PathSMSSavestates, "SMS"), name);
|
||||||
|
case "GG": return Path.Combine(MakeAbsolutePath(Global.Config.PathGGSavestates, "GG"), name);
|
||||||
|
case "SG": return Path.Combine(MakeAbsolutePath(Global.Config.PathSGSavestates, "SG"), name);
|
||||||
|
case "SGX": return Path.Combine(MakeAbsolutePath(Global.Config.PathPCESavestates, "PCE"), name);
|
||||||
|
case "PCE": return Path.Combine(MakeAbsolutePath(Global.Config.PathPCESavestates, "PCE"), name);
|
||||||
|
case "GB": return Path.Combine(MakeAbsolutePath(Global.Config.PathGBSavestates, "GB"), name);
|
||||||
|
case "GEN": return Path.Combine(MakeAbsolutePath(Global.Config.PathGenesisSavestates, "GEN"), name);
|
||||||
|
case "NES": return Path.Combine(MakeAbsolutePath(Global.Config.PathNESSavestates, "NES"), name);
|
||||||
|
case "TI83": return Path.Combine(MakeAbsolutePath(Global.Config.PathTI83Savestates, "TI83"), name);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ScreenshotPrefix(GameInfo game)
|
||||||
|
{
|
||||||
|
string name = FilesystemSafeName(game);
|
||||||
|
switch (game.System)
|
||||||
|
{
|
||||||
|
case "SMS": return Path.Combine(MakeAbsolutePath(Global.Config.PathSMSScreenshots, "SMS"), name);
|
||||||
|
case "GG": return Path.Combine(MakeAbsolutePath(Global.Config.PathGGScreenshots, "GG"), name);
|
||||||
|
case "SG": return Path.Combine(MakeAbsolutePath(Global.Config.PathSGScreenshots, "SG"), name);
|
||||||
|
case "SGX": return Path.Combine(MakeAbsolutePath(Global.Config.PathPCEScreenshots, "PCE"), name);
|
||||||
|
case "PCE": return Path.Combine(MakeAbsolutePath(Global.Config.PathPCEScreenshots, "PCE"), name);
|
||||||
|
case "GB": return Path.Combine(MakeAbsolutePath(Global.Config.PathGBScreenshots, "GB"), name);
|
||||||
|
case "GEN": return Path.Combine(MakeAbsolutePath(Global.Config.PathGenesisScreenshots, "GEN"), name);
|
||||||
|
case "NES": return Path.Combine(MakeAbsolutePath(Global.Config.PathNESScreenshots, "NES"), name);
|
||||||
|
case "TI83": return Path.Combine(MakeAbsolutePath(Global.Config.PathTI83Screenshots, "TI83"), name);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
private string MakeDefaultFilename()
|
private string MakeDefaultFilename()
|
||||||
{
|
{
|
||||||
return Path.Combine(GetCheatsPath(), Global.Game.FilesystemSafeName + ".cht");
|
return Path.Combine(GetCheatsPath(), PathManager.FilesystemSafeName(Global.Game) + ".cht");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ClearFields()
|
private void ClearFields()
|
||||||
|
@ -397,7 +397,7 @@ namespace BizHawk.MultiClient
|
||||||
if (currentCheatFile.Length > 0)
|
if (currentCheatFile.Length > 0)
|
||||||
sfd.FileName = Path.GetFileNameWithoutExtension(currentCheatFile);
|
sfd.FileName = Path.GetFileNameWithoutExtension(currentCheatFile);
|
||||||
else if (!(Global.Emulator is NullEmulator))
|
else if (!(Global.Emulator is NullEmulator))
|
||||||
sfd.FileName = Global.Game.FilesystemSafeName;
|
sfd.FileName = PathManager.FilesystemSafeName(Global.Game);
|
||||||
sfd.InitialDirectory = GetCheatsPath();
|
sfd.InitialDirectory = GetCheatsPath();
|
||||||
sfd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*";
|
sfd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*";
|
||||||
sfd.RestoreDirectory = true;
|
sfd.RestoreDirectory = true;
|
||||||
|
|
|
@ -1287,7 +1287,7 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
else if (!(Global.Emulator is NullEmulator))
|
else if (!(Global.Emulator is NullEmulator))
|
||||||
{
|
{
|
||||||
sfd.FileName = Global.Game.FilesystemSafeName;
|
sfd.FileName = PathManager.FilesystemSafeName(Global.Game);
|
||||||
sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath, "");
|
sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath, "");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -659,7 +659,7 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
else if (!(Global.Emulator is NullEmulator))
|
else if (!(Global.Emulator is NullEmulator))
|
||||||
{
|
{
|
||||||
sfd.FileName = Global.Game.FilesystemSafeName;
|
sfd.FileName = PathManager.FilesystemSafeName(Global.Game);
|
||||||
sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath, "");
|
sfd.InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.WatchPath, "");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue