pass in rom annotation details to Octoshock so it can set coreComm, ideally the core should figure all this out but this works okay

This commit is contained in:
adelikat 2020-03-14 21:36:51 -05:00
parent 3cacb88e48
commit 42dc7edd23
2 changed files with 12 additions and 14 deletions

View File

@ -460,8 +460,7 @@ namespace BizHawk.Client.Common
sw.WriteLine("-------------------------");
}
nextEmulator = new Octoshock(nextComm, discs, discNames, null, GetCoreSettings<Octoshock>(), GetCoreSyncSettings<Octoshock>());
nextEmulator.CoreComm.RomStatusDetails = sw.ToString();
nextEmulator = new Octoshock(nextComm, discs, discNames, null, GetCoreSettings<Octoshock>(), GetCoreSyncSettings<Octoshock>(), sw.ToString());
game = new GameInfo
{
Name = Path.GetFileNameWithoutExtension(file.Name),
@ -565,10 +564,10 @@ namespace BizHawk.Client.Common
(Saturnus.Settings)GetCoreSettings<Saturnus>(), (Saturnus.SyncSettings)GetCoreSyncSettings<Saturnus>());
break;
case "PSX":
nextEmulator = new Octoshock(nextComm, new List<Disc>(new[] { disc }), new List<string>(new[] { Path.GetFileNameWithoutExtension(path) }), null, GetCoreSettings<Octoshock>(), GetCoreSyncSettings<Octoshock>());
string romDetails;
if (game.IsRomStatusBad() || game.Status == RomStatus.NotInDatabase)
{
nextEmulator.CoreComm.RomStatusDetails = "Disc could not be identified as known-good. Look for a better rip.";
romDetails = "Disc could not be identified as known-good. Look for a better rip.";
}
else
{
@ -578,9 +577,10 @@ namespace BizHawk.Client.Common
sw.WriteLine("According to redump.org, the ideal hash for entire disc is: CRC32:{0:X8}", game.GetStringValue("dh"));
sw.WriteLine("The file you loaded hasn't been hashed entirely (it would take too long)");
sw.WriteLine("Compare it with the full hash calculated by the PSX menu's Hash Discs tool");
nextEmulator.CoreComm.RomStatusDetails = sw.ToString();
romDetails = sw.ToString();
}
nextEmulator = new Octoshock(nextComm, new List<Disc>(new[] { disc }), new List<string>(new[] { Path.GetFileNameWithoutExtension(path) }), null, GetCoreSettings<Octoshock>(), GetCoreSyncSettings<Octoshock>(), romDetails);
break;
case "PCFX":
nextEmulator = new Tst(nextComm, new[] { disc },
@ -791,8 +791,7 @@ namespace BizHawk.Client.Common
}
// todo: copy pasta from PSX .cue section
nextEmulator = new Octoshock(nextComm, discs, discNames, null, GetCoreSettings<Octoshock>(), GetCoreSyncSettings<Octoshock>());
nextEmulator.CoreComm.RomStatusDetails = sw.ToString();
nextEmulator = new Octoshock(nextComm, discs, discNames, null, GetCoreSettings<Octoshock>(), GetCoreSyncSettings<Octoshock>(), sw.ToString());
game = new GameInfo
{
Name = Path.GetFileNameWithoutExtension(file.Name),
@ -883,7 +882,6 @@ namespace BizHawk.Client.Common
PSF psf = new PSF();
psf.Load(path, cbDeflater);
nextEmulator = new Octoshock(nextComm, psf, GetCoreSettings<Octoshock>(), GetCoreSyncSettings<Octoshock>());
nextEmulator.CoreComm.RomStatusDetails = "It's a PSF, what do you want. Oh, tags maybe?";
// total garbage, this
rom = new RomGame(file);
@ -1114,8 +1112,7 @@ namespace BizHawk.Client.Common
: CoreInventory.Instance["GBA", "VBA-Next"];
break;
case "PSX":
nextEmulator = new Octoshock(nextComm, null, null, rom.FileData, GetCoreSettings<Octoshock>(), GetCoreSyncSettings<Octoshock>());
nextEmulator.CoreComm.RomStatusDetails = "PSX etc.";
nextEmulator = new Octoshock(nextComm, null, null, rom.FileData, GetCoreSettings<Octoshock>(), GetCoreSyncSettings<Octoshock>(), "PSX etc.");
break;
case "Arcade":
nextEmulator = new MAME(nextComm, file.Directory, file.CanonicalName, GetCoreSyncSettings<MAME>(), out var gameName);

View File

@ -37,20 +37,21 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
{
public Octoshock(CoreComm comm, PSF psf, object settings, object syncSettings)
{
Load(comm, null, null, null, settings, syncSettings, psf);
Load(comm, null, null, null, settings, syncSettings, psf, romDetails);
OctoshockDll.shock_PowerOn(psx);
}
//note: its annoying that we have to have a disc before constructing this.
//might want to change that later. HOWEVER - we need to definitely have a region, at least
public Octoshock(CoreComm comm, List<Disc> discs, List<string> discNames, byte[] exe, object settings, object syncSettings)
public Octoshock(CoreComm comm, List<Disc> discs, List<string> discNames, byte[] exe, object settings, object syncSettings, string romDetails)
{
Load(comm, discs, discNames, exe, settings, syncSettings, null);
Load(comm, discs, discNames, exe, settings, syncSettings, null, romDetails);
OctoshockDll.shock_PowerOn(psx);
}
void Load(CoreComm comm, List<Disc> discs, List<string> discNames, byte[] exe, object settings, object syncSettings, PSF psf)
void Load(CoreComm comm, List<Disc> discs, List<string> discNames, byte[] exe, object settings, object syncSettings, PSF psf, string romDetails)
{
CoreComm.RomStatusDetails = romDetails;
ConnectTracer();
CoreComm = comm;
DriveLightEnabled = true;