Add files via upload

This commit is contained in:
alyosha-tas 2017-10-13 18:01:14 -04:00 committed by GitHub
parent 9d9133720c
commit 09ce28d2bd
3 changed files with 92 additions and 92 deletions

View File

@ -1,45 +1,45 @@
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Sega.MasterSystem namespace BizHawk.Emulation.Cores.Sega.MasterSystem
{ {
public sealed partial class SMS : IEmulator public sealed partial class SMS : IEmulator
{ {
public IEmulatorServiceProvider ServiceProvider { get; } public IEmulatorServiceProvider ServiceProvider { get; }
public ControllerDefinition ControllerDefinition public ControllerDefinition ControllerDefinition
{ {
get get
{ {
if (IsGameGear) if (IsGameGear)
{ {
return GGController; return GGController;
} }
switch(Settings.ControllerType) switch(Settings.ControllerType)
{ {
case "Paddle": case "Paddle":
return SMSPaddleController; return SMSPaddleController;
case "Light Phaser": case "Light Phaser":
// scale the vertical to the display mode // scale the vertical to the display mode
SMSLightPhaserController.FloatRanges[1] = new ControllerDefinition.FloatRange(0, Vdp.FrameHeight / 2, Vdp.FrameHeight - 1); SMSLightPhaserController.FloatRanges[1] = new ControllerDefinition.FloatRange(0, Vdp.FrameHeight / 2, Vdp.FrameHeight - 1);
return SMSLightPhaserController; return SMSLightPhaserController;
default: default:
return SmsController; return SmsController;
} }
} }
} }
public void FrameAdvance(IController controller, bool render, bool rendersound) public void FrameAdvance(IController controller, bool render, bool rendersound)
{ {
_controller = controller; _controller = controller;
_lagged = true; _lagged = true;
_frame++; _frame++;
PSG.BeginFrame(Cpu.TotalExecutedCycles); PSG.BeginFrame(Cpu.TotalExecutedCycles);
if (!IsGameGear) if (!IsGameGear)
{ {
PSG.StereoPanning = Settings.ForceStereoSeparation ? ForceStereoByte : (byte)0xFF; PSG.StereoPanning = Settings.ForceStereoSeparation ? ForceStereoByte : (byte)0xFF;
} }
if (Tracer.Enabled) if (Tracer.Enabled)
@ -49,51 +49,51 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
else else
{ {
Cpu.TraceCallback = null; Cpu.TraceCallback = null;
} }
if (IsGameGear == false) if (IsGameGear == false)
{ {
Cpu.NonMaskableInterrupt = controller.IsPressed("Pause"); Cpu.NonMaskableInterrupt = controller.IsPressed("Pause");
} }
if (IsGame3D && Settings.Fix3D) if (IsGame3D && Settings.Fix3D)
{ {
Vdp.ExecFrame((Frame & 1) == 0); Vdp.ExecFrame((Frame & 1) == 0);
} }
else else
{ {
Vdp.ExecFrame(render); Vdp.ExecFrame(render);
} }
PSG.EndFrame(Cpu.TotalExecutedCycles); PSG.EndFrame(Cpu.TotalExecutedCycles);
if (_lagged) if (_lagged)
{ {
_lagCount++; _lagCount++;
_isLag = true; _isLag = true;
} }
else else
{ {
_isLag = false; _isLag = false;
} }
} }
public int Frame => _frame; public int Frame => _frame;
public string SystemId => "SMS"; public string SystemId => "SMS";
public bool DeterministicEmulation => true; public bool DeterministicEmulation => true;
public void ResetCounters() public void ResetCounters()
{ {
_frame = 0; _frame = 0;
_lagCount = 0; _lagCount = 0;
_isLag = false; _isLag = false;
} }
public CoreComm CoreComm { get; } public CoreComm CoreComm { get; }
public void Dispose() public void Dispose()
{ {
} }
} }
} }

View File

@ -4,7 +4,7 @@ using BizHawk.Common.StringExtensions;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Common.Components; using BizHawk.Emulation.Common.Components;
using BizHawk.Emulation.Cores.Components; using BizHawk.Emulation.Cores.Components;
using BizHawk.Emulation.Common.Components.Z80A; using BizHawk.Emulation.Cores.Components.Z80A;
/***************************************************** /*****************************************************
TODO: TODO:

View File

@ -4,7 +4,7 @@ using System.IO;
using BizHawk.Common; using BizHawk.Common;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Common.Components.Z80A; using BizHawk.Emulation.Cores.Components.Z80A;
namespace BizHawk.Emulation.Cores.Sega.MasterSystem namespace BizHawk.Emulation.Cores.Sega.MasterSystem