Intellivision - actually support lag variable setting, and some misc cleanup

This commit is contained in:
adelikat 2017-04-23 10:53:26 -05:00
parent 8dcf9fb61a
commit 0f36bce22a
6 changed files with 57 additions and 49 deletions

View File

@ -412,6 +412,9 @@
<Compile Include="Consoles\Intellivision\Controllers\IntellivisionControllerDeck.cs" />
<Compile Include="Consoles\Intellivision\ICart.cs" />
<Compile Include="Consoles\Intellivision\Intellicart.cs" />
<Compile Include="Consoles\Intellivision\Intellivision.IInputPollable.cs">
<DependentUpon>Intellivision.cs</DependentUpon>
</Compile>
<Compile Include="Consoles\Intellivision\Intellivision.ISettable.cs">
<DependentUpon>Intellivision.cs</DependentUpon>
</Compile>

View File

@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
_cpu.PendingCycles = 14934 - 3791 + _cpu.GetPendingCycles();
_stic.Sr1 = true;
islag = true;
_islag = true;
bool active_display = _stic.active_display;
@ -108,8 +108,8 @@ namespace BizHawk.Emulation.Cores.Intellivision
}
_stic.in_vb_2 = false;
if (islag)
lagcount++;
if (_islag)
_lagcount++;
if (Controller.IsPressed("Power"))
@ -119,11 +119,6 @@ namespace BizHawk.Emulation.Cores.Intellivision
SoftReset();
}
private int _frame;
public bool islag;
public int lagcount;
private int stic_row;
public int Frame => _frame;
public string SystemId => "INTV";
@ -136,14 +131,13 @@ namespace BizHawk.Emulation.Cores.Intellivision
public void ResetCounters()
{
_frame = 0;
lagcount = 0;
_lagcount = 0;
}
public CoreComm CoreComm { get; }
public void Dispose()
{
}
}
}

View File

@ -0,0 +1,37 @@
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Intellivision
{
public partial class Intellivision : IInputPollable
{
public int LagCount
{
get
{
return _lagcount; }
set
{
_lagcount = value;
}
}
public bool IsLagFrame
{
get
{
return _islag;
}
set
{
_islag = value;
}
}
public IInputCallbackSystem InputCallbacks { get; } = new InputCallbackSystem();
private bool _islag;
private int _lagcount;
}
}

View File

@ -8,10 +8,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
{
public partial class Intellivision : IStatable
{
public bool BinarySaveStatesPreferred
{
get { return true; }
}
public bool BinarySaveStatesPreferred => true;
public void SaveStateText(TextWriter writer)
{
@ -37,8 +34,8 @@ namespace BizHawk.Emulation.Cores.Intellivision
public byte[] SaveStateBinary()
{
MemoryStream ms = new MemoryStream();
BinaryWriter bw = new BinaryWriter(ms);
var ms = new MemoryStream();
var bw = new BinaryWriter(ms);
SaveStateBinary(bw);
bw.Flush();
return ms.ToArray();
@ -57,8 +54,8 @@ namespace BizHawk.Emulation.Cores.Intellivision
ser.Sync("ExecutiveRom", ref ExecutiveRom, false);
ser.Sync("GraphicsRom", ref GraphicsRom, false);
ser.Sync("GraphicsRam", ref GraphicsRam, false);
ser.Sync("islag", ref islag);
ser.Sync("lagcount", ref lagcount);
ser.Sync("islag", ref _islag);
ser.Sync("lagcount", ref _lagcount);
_cpu.SyncState(ser);
_stic.SyncState(ser);

View File

@ -1,6 +1,4 @@
using System;
namespace BizHawk.Emulation.Cores.Intellivision
namespace BizHawk.Emulation.Cores.Intellivision
{
public sealed partial class Intellivision
{
@ -44,13 +42,14 @@ namespace BizHawk.Emulation.Cores.Intellivision
if (addr==0x01FE)
{
if (!peek)
islag = false;
return _psg.Register[14];
_islag = false;
return _psg.Register[14];
}
if (addr == 0x01FF)
{
if (!peek)
islag = false;
_islag = false;
return _psg.Register[15];
}
break;

View File

@ -1,6 +1,4 @@
using System;
using System.IO;
using System.Collections.Generic;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Components.CP1610;
@ -58,8 +56,6 @@ namespace BizHawk.Emulation.Cores.Intellivision
Connect();
//_cpu.LogData();
LoadExecutiveRom(CoreComm.CoreFileProvider.GetFirmware("INTV", "EROM", true, "Executive ROM is required."));
LoadGraphicsRom(CoreComm.CoreFileProvider.GetFirmware("INTV", "GROM", true, "Graphics ROM is required."));
@ -73,27 +69,6 @@ namespace BizHawk.Emulation.Cores.Intellivision
private ITraceable Tracer { get; set; }
public int LagCount
{
get {return lagcount;}
set{}
}
public bool IsLagFrame
{
get {return islag;}
set {}
}
public IInputCallbackSystem InputCallbacks
{
get { return _inputCallbacks; }
}
private readonly InputCallbackSystem _inputCallbacks = new InputCallbackSystem();
private byte[] _rom;
private GameInfo _gameInfo;
@ -102,6 +77,9 @@ namespace BizHawk.Emulation.Cores.Intellivision
private STIC _stic;
private PSG _psg;
private int _frame;
private int stic_row;
public void Connect()
{
_cpu.SetIntRM(_stic.GetSr1());