Apple II - wire up the lag counter, may or may not be correct logic, don't know too much about Apple II internals, but eyeballing the code, it looks like a reasonable place to decide if input was polled.

This commit is contained in:
adelikat 2015-04-26 12:40:21 +00:00
parent bd07bfa310
commit dbc3a5cb2c
7 changed files with 20 additions and 3 deletions

View File

@ -122,6 +122,9 @@
<Compile Include="Computers\AppleII\AppleII.IEmulator.cs">
<DependentUpon>AppleII.cs</DependentUpon>
</Compile>
<Compile Include="Computers\AppleII\AppleII.IInputPollable.cs">
<DependentUpon>AppleII.cs</DependentUpon>
</Compile>
<Compile Include="Computers\AppleII\AppleII.IMemoryDomains.cs">
<DependentUpon>AppleII.cs</DependentUpon>
</Compile>

View File

@ -34,7 +34,6 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII
public IController Controller { get; set; }
public int Frame { get; set; }
public string SystemId { get { return "AppleII"; } }
@ -51,6 +50,8 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII
public void ResetCounters()
{
Frame = 0;
LagCount = 0;
IsLagFrame = false;
}
public CoreComm CoreComm { get; private set; }

View File

@ -22,6 +22,8 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII
public void SaveStateBinary(BinaryWriter writer)
{
writer.Write(Frame);
writer.Write(LagCount);
writer.Write(IsLagFrame);
writer.Write(CurrentDisk);
_machine.SaveState(writer);
}
@ -29,6 +31,8 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII
public void LoadStateBinary(BinaryReader reader)
{
Frame = reader.ReadInt32();
LagCount = reader.ReadInt32();
IsLagFrame = reader.ReadBoolean();
CurrentDisk = reader.ReadInt32();
InitDisk();
_machine.LoadState(reader);

View File

@ -172,6 +172,11 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII
_machine.Buttons = GetButtons();
_machine.BizFrameAdvance();
if (IsLagFrame)
{
LagCount++;
}
Frame++;
}

View File

@ -327,7 +327,8 @@ namespace Jellyfish.Virtu
public void BizFrameAdvance()
{
Services.GetService<KeyboardService>().Update();
Lagged = true;
Services.GetService<KeyboardService>().Update();
Services.GetService<GamePortService>().Update();
//frame begins at vsync.. beginning of vblank
while (Video.IsVBlank)
@ -384,5 +385,7 @@ namespace Jellyfish.Virtu
private AutoResetEvent _pauseEvent = new AutoResetEvent(false);
private AutoResetEvent _unpauseEvent = new AutoResetEvent(false);
public bool Lagged { get; set; }
}
}

View File

@ -286,7 +286,8 @@ namespace Jellyfish.Virtu
[SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode")]
private int ReadIoRegionC0C0(int address)
{
switch (address)
Machine.Lagged = false;
switch (address)
{
case 0xC000: case 0xC001: case 0xC002: case 0xC003: case 0xC004: case 0xC005: case 0xC006: case 0xC007: // [7-15]
case 0xC008: case 0xC009: case 0xC00A: case 0xC00B: case 0xC00C: case 0xC00D: case 0xC00E: case 0xC00F:

Binary file not shown.