sega CD games now get as far as loading the bios
This commit is contained in:
parent
61f31967b3
commit
85be43dfb8
|
@ -3057,10 +3057,15 @@ namespace BizHawk.Client.EmuHawk
|
||||||
case DiscType.SonyPSX:
|
case DiscType.SonyPSX:
|
||||||
game.System = "PSX";
|
game.System = "PSX";
|
||||||
break;
|
break;
|
||||||
|
case DiscType.MegaCD:
|
||||||
|
game.System = "GEN";
|
||||||
|
break;
|
||||||
case DiscType.TurboCD:
|
case DiscType.TurboCD:
|
||||||
case DiscType.UnknownCDFS:
|
case DiscType.UnknownCDFS:
|
||||||
case DiscType.UnknownFormat:
|
case DiscType.UnknownFormat:
|
||||||
default: // PCECD was bizhawk's first CD core, so this prevents regressions
|
default:// PCECD was bizhawk's first CD core,
|
||||||
|
// and during that time, all CDs were blindly sent to it
|
||||||
|
// so this prevents regressions
|
||||||
game.System = "PCECD";
|
game.System = "PCECD";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3068,6 +3073,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
switch (game.System)
|
switch (game.System)
|
||||||
{
|
{
|
||||||
|
case "GEN":
|
||||||
|
{
|
||||||
|
var genesis = new BizHawk.Emulation.Cores.Consoles.Sega.gpgx.GPGX(
|
||||||
|
nextComm, null, disc, "GEN", true, Emulation.Cores.Consoles.Sega.gpgx.GPGX.ControlType.Normal);
|
||||||
|
nextEmulator = genesis;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "SAT":
|
case "SAT":
|
||||||
{
|
{
|
||||||
var saturn = new Yabause(nextComm, disc, Global.Config.SaturnUseGL);
|
var saturn = new Yabause(nextComm, disc, Global.Config.SaturnUseGL);
|
||||||
|
@ -3385,7 +3397,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Text = DisplayNameForSystem(game.System) + " - " + game.Name;
|
Text = DisplayNameForSystem(game.System) + " - " + game.Name;
|
||||||
ResetRewindBuffer();
|
ResetRewindBuffer();
|
||||||
|
|
||||||
if (Global.Emulator.CoreComm.RomStatusDetails == null)
|
if (Global.Emulator.CoreComm.RomStatusDetails == null && rom != null)
|
||||||
{
|
{
|
||||||
Global.Emulator.CoreComm.RomStatusDetails =
|
Global.Emulator.CoreComm.RomStatusDetails =
|
||||||
string.Format("{0}\r\nSHA1:{1}\r\nMD5:{2}\r\n",
|
string.Format("{0}\r\nSHA1:{1}\r\nMD5:{2}\r\n",
|
||||||
|
|
|
@ -41,6 +41,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{ "TI83", "TI-83" },
|
{ "TI83", "TI-83" },
|
||||||
{ "INTV", "Intellivision" },
|
{ "INTV", "Intellivision" },
|
||||||
{ "C64", "C64" },
|
{ "C64", "C64" },
|
||||||
|
{ "GEN", "Genesis" },
|
||||||
};
|
};
|
||||||
|
|
||||||
public string TargetSystem = null;
|
public string TargetSystem = null;
|
||||||
|
@ -126,7 +127,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
//build the groups in the listview as we go:
|
//build the groups in the listview as we go:
|
||||||
if (!groups.ContainsKey(fr.systemId))
|
if (!groups.ContainsKey(fr.systemId))
|
||||||
{
|
{
|
||||||
lvFirmwares.Groups.Add(fr.systemId, SystemGroupNames[fr.systemId]);
|
string name;
|
||||||
|
if (!SystemGroupNames.TryGetValue(fr.systemId, out name))
|
||||||
|
name = "FIX ME (FirmwaresConfig.cs)";
|
||||||
|
lvFirmwares.Groups.Add(fr.systemId, name);
|
||||||
var lvg = lvFirmwares.Groups[lvFirmwares.Groups.Count - 1];
|
var lvg = lvFirmwares.Groups[lvFirmwares.Groups.Count - 1];
|
||||||
groups[fr.systemId] = lvg;
|
groups[fr.systemId] = lvg;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,9 @@ namespace BizHawk.Emulation.Common
|
||||||
var us_scd1_9210 = File("f4f315adcef9b8feb0364c21ab7f0eaf5457f3ed", "us_scd1_9210.bin", "Sega CD US (9210)");
|
var us_scd1_9210 = File("f4f315adcef9b8feb0364c21ab7f0eaf5457f3ed", "us_scd1_9210.bin", "Sega CD US (9210)");
|
||||||
var us_scd2_9303 = File("bd3ee0c8ab732468748bf98953603ce772612704", "us_scd2_9303.bin", "Sega CD US (9303)");
|
var us_scd2_9303 = File("bd3ee0c8ab732468748bf98953603ce772612704", "us_scd2_9303.bin", "Sega CD US (9303)");
|
||||||
|
|
||||||
|
Firmware("GEN", "CD_BIOS_EU", "Mega CD Bios (Europe)");
|
||||||
|
Firmware("GEN", "CD_BIOS_JP", "Mega CD Bios (Japan)");
|
||||||
|
Firmware("GEN", "CD_BIOS_US", "Sega CD Bios (USA)");
|
||||||
Option("GEN", "CD_BIOS_EU", eu_mcd1_9210);
|
Option("GEN", "CD_BIOS_EU", eu_mcd1_9210);
|
||||||
Option("GEN", "CD_BIOS_EU", eu_mcd2_9303);
|
Option("GEN", "CD_BIOS_EU", eu_mcd2_9303);
|
||||||
Option("GEN", "CD_BIOS_EU", eu_mcd2_9306);
|
Option("GEN", "CD_BIOS_EU", eu_mcd2_9306);
|
||||||
|
@ -133,14 +136,16 @@ namespace BizHawk.Emulation.Common
|
||||||
//defines a firmware file
|
//defines a firmware file
|
||||||
static FirmwareFile File(string hash, string recommendedName, string descr)
|
static FirmwareFile File(string hash, string recommendedName, string descr)
|
||||||
{
|
{
|
||||||
|
string hashfix = hash.ToUpperInvariant();
|
||||||
|
|
||||||
var ff = new FirmwareFile
|
var ff = new FirmwareFile
|
||||||
{
|
{
|
||||||
hash = hash,
|
hash = hashfix,
|
||||||
recommendedName = recommendedName,
|
recommendedName = recommendedName,
|
||||||
descr = descr
|
descr = descr
|
||||||
};
|
};
|
||||||
FirmwareFiles.Add(ff);
|
FirmwareFiles.Add(ff);
|
||||||
FirmwareFilesByHash[hash] = ff;
|
FirmwareFilesByHash[hashfix] = ff;
|
||||||
return ff;
|
return ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,9 +194,17 @@ namespace BizHawk.Emulation.Common
|
||||||
(from fr in FirmwareRecords
|
(from fr in FirmwareRecords
|
||||||
where fr.firmwareId == firmwareId
|
where fr.firmwareId == firmwareId
|
||||||
&& fr.systemId == sysId
|
&& fr.systemId == sysId
|
||||||
select fr).First();
|
select fr);
|
||||||
|
|
||||||
return found;
|
try
|
||||||
|
{
|
||||||
|
return found.First();
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException)
|
||||||
|
{
|
||||||
|
// list is empty;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} //static class FirmwareDatabase
|
} //static class FirmwareDatabase
|
||||||
|
|
|
@ -56,6 +56,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
||||||
LoadCallback = new LibGPGX.load_archive_cb(load_archive);
|
LoadCallback = new LibGPGX.load_archive_cb(load_archive);
|
||||||
|
|
||||||
this.romfile = romfile;
|
this.romfile = romfile;
|
||||||
|
this.CD = CD;
|
||||||
|
|
||||||
LibGPGX.INPUT_SYSTEM system_a = LibGPGX.INPUT_SYSTEM.SYSTEM_NONE;
|
LibGPGX.INPUT_SYSTEM system_a = LibGPGX.INPUT_SYSTEM.SYSTEM_NONE;
|
||||||
LibGPGX.INPUT_SYSTEM system_b = LibGPGX.INPUT_SYSTEM.SYSTEM_NONE;
|
LibGPGX.INPUT_SYSTEM system_b = LibGPGX.INPUT_SYSTEM.SYSTEM_NONE;
|
||||||
|
|
|
@ -34,7 +34,12 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Its not clear whether we can ever have enough info to ID a turboCD disc (we're using hashes)
|
/// Its not clear whether we can ever have enough info to ID a turboCD disc (we're using hashes)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TurboCD
|
TurboCD,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// MegaDrive addon
|
||||||
|
/// </summary>
|
||||||
|
MegaCD
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed public partial class Disc
|
sealed public partial class Disc
|
||||||
|
@ -48,6 +53,9 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
//sega doesnt put anything identifying in the cdfs volume info. but its consistent about putting its own header here in sector 0
|
//sega doesnt put anything identifying in the cdfs volume info. but its consistent about putting its own header here in sector 0
|
||||||
if (DetectSegaSaturn()) return DiscType.SegaSaturn;
|
if (DetectSegaSaturn()) return DiscType.SegaSaturn;
|
||||||
|
|
||||||
|
// not fully tested yet
|
||||||
|
if (DetectMegaCD()) return DiscType.MegaCD;
|
||||||
|
|
||||||
//we dont know how to detect TurboCD.
|
//we dont know how to detect TurboCD.
|
||||||
//an emulator frontend will likely just guess TurboCD if the disc is UnknownFormat
|
//an emulator frontend will likely just guess TurboCD if the disc is UnknownFormat
|
||||||
|
|
||||||
|
@ -72,12 +80,25 @@ namespace BizHawk.Emulation.DiscSystem
|
||||||
/// This is reasonable approach to ID saturn.
|
/// This is reasonable approach to ID saturn.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool DetectSegaSaturn()
|
bool DetectSegaSaturn()
|
||||||
|
{
|
||||||
|
return StringAt("SEGA SEGASATURN", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// probably wrong
|
||||||
|
/// </summary>
|
||||||
|
bool DetectMegaCD()
|
||||||
|
{
|
||||||
|
return StringAt("SEGADISCSYSTEM", 0) || StringAt("SEGADISCSYSTEM", 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool StringAt(string s, int n)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[2048];
|
byte[] data = new byte[2048];
|
||||||
ReadLBA_2048(0, data, 0);
|
ReadLBA_2048(0, data, 0);
|
||||||
byte[] cmp = System.Text.Encoding.ASCII.GetBytes("SEGA SEGASATURN");
|
byte[] cmp = System.Text.Encoding.ASCII.GetBytes(s);
|
||||||
byte[] cmp2 = new byte[15];
|
byte[] cmp2 = new byte[cmp.Length];
|
||||||
Buffer.BlockCopy(data, 0, cmp2, 0, 15);
|
Buffer.BlockCopy(data, n, cmp2, 0, cmp.Length);
|
||||||
return System.Linq.Enumerable.SequenceEqual(cmp, cmp2);
|
return System.Linq.Enumerable.SequenceEqual(cmp, cmp2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,7 +238,6 @@ void cdd_read_data(uint8 *dst)
|
||||||
|
|
||||||
void cdd_read_audio(unsigned int samples)
|
void cdd_read_audio(unsigned int samples)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
// previous audio outputs //
|
// previous audio outputs //
|
||||||
int16 l = cdd.audio[0];
|
int16 l = cdd.audio[0];
|
||||||
int16 r = cdd.audio[1];
|
int16 r = cdd.audio[1];
|
||||||
|
@ -247,7 +246,7 @@ void cdd_read_audio(unsigned int samples)
|
||||||
samples = blip_clocks_needed(blip[0], samples);
|
samples = blip_clocks_needed(blip[0], samples);
|
||||||
|
|
||||||
// audio track playing ? //
|
// audio track playing ? //
|
||||||
if (!scd.regs[0x36>>1].byte.h && cdd.toc.tracks[cdd.index].fd)
|
if (0) // (!scd.regs[0x36>>1].byte.h && cdd.toc.tracks[cdd.index].fd)
|
||||||
{
|
{
|
||||||
int i, mul, delta;
|
int i, mul, delta;
|
||||||
|
|
||||||
|
@ -264,7 +263,7 @@ void cdd_read_audio(unsigned int samples)
|
||||||
#else
|
#else
|
||||||
uint8 *ptr = cdc.ram;
|
uint8 *ptr = cdc.ram;
|
||||||
#endif
|
#endif
|
||||||
fread(cdc.ram, 1, samples * 4, cdd.toc.tracks[cdd.index].fd);
|
//fread(cdc.ram, 1, samples * 4, cdd.toc.tracks[cdd.index].fd);
|
||||||
|
|
||||||
// process 16-bit (little-endian) stereo samples //
|
// process 16-bit (little-endian) stereo samples //
|
||||||
for (i=0; i<samples; i++)
|
for (i=0; i<samples; i++)
|
||||||
|
@ -335,7 +334,6 @@ void cdd_read_audio(unsigned int samples)
|
||||||
// end of Blip Buffer timeframe //
|
// end of Blip Buffer timeframe //
|
||||||
blip_end_frame(blip[0], samples);
|
blip_end_frame(blip[0], samples);
|
||||||
blip_end_frame(blip[1], samples);
|
blip_end_frame(blip[1], samples);
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue