Add controller types to sync settings
This commit is contained in:
parent
7e2d4a75b4
commit
d153c00c77
|
@ -1,5 +1,5 @@
|
||||||
using BizHawk.Emulation.Cores.Sony.PSX;
|
using BizHawk.Emulation.Cores.Sony.PSX;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
|
@ -127,6 +127,15 @@ namespace BizHawk.Client.Common
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Octoshock.SyncSettings syncsettings = new Octoshock.SyncSettings();
|
||||||
|
syncsettings.Controllers = new[] { info.player1Type, info.player2Type };
|
||||||
|
|
||||||
|
var jsonSettings = new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
TypeNameHandling = TypeNameHandling.Auto
|
||||||
|
};
|
||||||
|
movie.SyncSettingsJson = JsonConvert.SerializeObject(new { o = (object)syncsettings }, jsonSettings);
|
||||||
|
|
||||||
info.frameCount = br.ReadUInt32();
|
info.frameCount = br.ReadUInt32();
|
||||||
UInt32 rerecordCount = br.ReadUInt32();
|
UInt32 rerecordCount = br.ReadUInt32();
|
||||||
movie.HeaderEntries[HeaderKeys.RERECORDS] = rerecordCount.ToString();
|
movie.HeaderEntries[HeaderKeys.RERECORDS] = rerecordCount.ToString();
|
||||||
|
@ -164,6 +173,7 @@ namespace BizHawk.Client.Common
|
||||||
"L2", "R2", "L1", "R1", "Triangle", "Circle", "Cross", "Square"};
|
"L2", "R2", "L1", "R1", "Triangle", "Circle", "Cross", "Square"};
|
||||||
|
|
||||||
bool isCdTrayOpen = false;
|
bool isCdTrayOpen = false;
|
||||||
|
int cdNumber = 1;
|
||||||
|
|
||||||
for (int frame = 0; frame < info.frameCount; ++frame)
|
for (int frame = 0; frame < info.frameCount; ++frame)
|
||||||
{
|
{
|
||||||
|
@ -227,6 +237,7 @@ namespace BizHawk.Client.Common
|
||||||
if (isCdTrayOpen)
|
if (isCdTrayOpen)
|
||||||
{
|
{
|
||||||
controllers["Close"] = true;
|
controllers["Close"] = true;
|
||||||
|
cdNumber++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -240,6 +251,9 @@ namespace BizHawk.Client.Common
|
||||||
controllers["Open"] = false;
|
controllers["Open"] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Tuple<string, float> discSelect = new Tuple<string, float>("Disc Select", cdNumber);
|
||||||
|
controllers.AcceptNewFloats(new[] { discSelect });
|
||||||
|
|
||||||
if ((controlState & 0xFC) != 0)
|
if ((controlState & 0xFC) != 0)
|
||||||
{
|
{
|
||||||
Result.Warnings.Add("Ignored toggle hack flag on frame " + frame.ToString());
|
Result.Warnings.Add("Ignored toggle hack flag on frame " + frame.ToString());
|
||||||
|
|
Loading…
Reference in New Issue