SyncSettings option for widescreen mode (remove top and bottom borders)
This commit is contained in:
parent
fc8b89c837
commit
0cd8af5974
|
@ -151,7 +151,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
/// The number of border pixels to the right of the display
|
||||
/// </summary>
|
||||
protected int BorderRightPixels = 48;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The total width of the screen in pixels
|
||||
/// </summary>
|
||||
|
@ -765,8 +765,25 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
/// <summary>
|
||||
/// Initialises the screen configuration calculations
|
||||
/// </summary>
|
||||
public virtual void InitScreenConfig()
|
||||
public virtual void InitScreenConfig(ZXSpectrum.BorderType border_type)
|
||||
{
|
||||
switch (border_type)
|
||||
{
|
||||
case ZXSpectrum.BorderType.Full:
|
||||
BorderTopLines = 48;
|
||||
BorderBottomLines = 48;
|
||||
NonVisibleBorderTopLines = 8;
|
||||
NonVisibleBorderBottomLines = 8;
|
||||
break;
|
||||
|
||||
case ZXSpectrum.BorderType.Widescreen:
|
||||
BorderTopLines = 0;
|
||||
BorderBottomLines = 0;
|
||||
NonVisibleBorderTopLines = 8 + 48;
|
||||
NonVisibleBorderBottomLines = 8 + 48;
|
||||
break;
|
||||
}
|
||||
|
||||
ScreenLines = BorderTopLines + DisplayLines + BorderBottomLines;
|
||||
FirstDisplayLine = VerticalSyncLines + NonVisibleBorderTopLines + BorderTopLines;
|
||||
LastDisplayLine = FirstDisplayLine + DisplayLines - 1;
|
||||
|
@ -907,11 +924,11 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
{
|
||||
get { return UlaFrameCycleCount; }
|
||||
}
|
||||
/*
|
||||
/*
|
||||
public int VsyncNumerator => NullVideo.DefaultVsyncNum;
|
||||
public int VsyncDenominator => NullVideo.DefaultVsyncDen;
|
||||
*/
|
||||
public int[] GetVideoBuffer()
|
||||
public int[] GetVideoBuffer()
|
||||
{
|
||||
/*
|
||||
switch(Spectrum.SyncSettings.BorderType)
|
||||
|
|
|
@ -8,17 +8,5 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
{
|
||||
public partial class ZX128 : SpectrumBase
|
||||
{
|
||||
public override void InitScreenConfig()
|
||||
{
|
||||
|
||||
ScreenLines = BorderTopLines + DisplayLines + BorderBottomLines;
|
||||
FirstDisplayLine = VerticalSyncLines + NonVisibleBorderTopLines + BorderTopLines;
|
||||
LastDisplayLine = FirstDisplayLine + DisplayLines - 1;
|
||||
ScreenWidth = BorderLeftPixels + DisplayWidth + BorderRightPixels;
|
||||
FirstPixelCycleInLine = HorizontalBlankingTime + BorderLeftTime;
|
||||
ScreenLineTime = FirstPixelCycleInLine + DisplayLineTime + BorderRightTime + NonVisibleBorderRightTime;
|
||||
UlaFrameCycleCount = (FirstDisplayLine + DisplayLines + BorderBottomLines + NonVisibleBorderTopLines) * ScreenLineTime;
|
||||
FirstScreenPixelCycle = (VerticalSyncLines + NonVisibleBorderTopLines) * ScreenLineTime + HorizontalBlankingTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
/// </summary>
|
||||
/// <param name="spectrum"></param>
|
||||
/// <param name="cpu"></param>
|
||||
public ZX128(ZXSpectrum spectrum, Z80A cpu, byte[] file)
|
||||
public ZX128(ZXSpectrum spectrum, Z80A cpu, ZXSpectrum.BorderType borderType, byte[] file)
|
||||
{
|
||||
Spectrum = spectrum;
|
||||
CPU = cpu;
|
||||
|
@ -30,9 +30,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
ReInitMemory();
|
||||
|
||||
//DisplayLineTime = 132;
|
||||
VsyncNumerator = 3546900;
|
||||
//VsyncNumerator = 3546900 * 2;
|
||||
|
||||
InitScreenConfig();
|
||||
InitScreenConfig(borderType);
|
||||
InitScreen();
|
||||
|
||||
ResetULACycle();
|
||||
|
|
|
@ -20,8 +20,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
/// </summary>
|
||||
/// <param name="spectrum"></param>
|
||||
/// <param name="cpu"></param>
|
||||
public ZX128Plus2(ZXSpectrum spectrum, Z80A cpu, byte[] file)
|
||||
: base(spectrum, cpu, file)
|
||||
public ZX128Plus2(ZXSpectrum spectrum, Z80A cpu, ZXSpectrum.BorderType borderType, byte[] file)
|
||||
: base(spectrum, cpu, borderType, file)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
/// </summary>
|
||||
/// <param name="spectrum"></param>
|
||||
/// <param name="cpu"></param>
|
||||
public ZX128Plus3(ZXSpectrum spectrum, Z80A cpu, byte[] file)
|
||||
public ZX128Plus3(ZXSpectrum spectrum, Z80A cpu, ZXSpectrum.BorderType borderType, byte[] file)
|
||||
{
|
||||
Spectrum = spectrum;
|
||||
CPU = cpu;
|
||||
|
@ -30,9 +30,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
ReInitMemory();
|
||||
|
||||
//DisplayLineTime = 132;
|
||||
VsyncNumerator = 3546900;
|
||||
//VsyncNumerator = 3546900;
|
||||
|
||||
InitScreenConfig();
|
||||
InitScreenConfig(borderType);
|
||||
InitScreen();
|
||||
|
||||
ResetULACycle();
|
||||
|
|
|
@ -16,8 +16,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
/// </summary>
|
||||
/// <param name="spectrum"></param>
|
||||
/// <param name="cpu"></param>
|
||||
public ZX16(ZXSpectrum spectrum, Z80A cpu, byte[] file)
|
||||
: base(spectrum, cpu, file)
|
||||
public ZX16(ZXSpectrum spectrum, Z80A cpu, ZXSpectrum.BorderType borderType, byte[] file)
|
||||
: base(spectrum, cpu, borderType, file)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -16,14 +16,14 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
/// </summary>
|
||||
/// <param name="spectrum"></param>
|
||||
/// <param name="cpu"></param>
|
||||
public ZX48(ZXSpectrum spectrum, Z80A cpu, byte[] file)
|
||||
public ZX48(ZXSpectrum spectrum, Z80A cpu, ZXSpectrum.BorderType borderType, byte[] file)
|
||||
{
|
||||
Spectrum = spectrum;
|
||||
CPU = cpu;
|
||||
|
||||
ReInitMemory();
|
||||
|
||||
InitScreenConfig();
|
||||
InitScreenConfig(borderType);
|
||||
InitScreen();
|
||||
|
||||
ResetULACycle();
|
||||
|
|
|
@ -104,8 +104,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
public enum BorderType
|
||||
{
|
||||
Full,
|
||||
Medium,
|
||||
Small
|
||||
Widescreen,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -137,34 +137,35 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
switch (machineType)
|
||||
{
|
||||
case MachineType.ZXSpectrum16:
|
||||
_machine = new ZX16(this, _cpu, file);
|
||||
_machine = new ZX16(this, _cpu, borderType, file);
|
||||
var _systemRom16 = GetFirmware(0x4000, "48ROM");
|
||||
var romData16 = RomData.InitROM(machineType, _systemRom16);
|
||||
_machine.InitROM(romData16);
|
||||
break;
|
||||
case MachineType.ZXSpectrum48:
|
||||
_machine = new ZX48(this, _cpu, file);
|
||||
_machine = new ZX48(this, _cpu, borderType, file);
|
||||
var _systemRom = GetFirmware(0x4000, "48ROM");
|
||||
var romData = RomData.InitROM(machineType, _systemRom);
|
||||
_machine.InitROM(romData);
|
||||
break;
|
||||
case MachineType.ZXSpectrum128:
|
||||
_machine = new ZX128(this, _cpu, file);
|
||||
_machine = new ZX128(this, _cpu, borderType, file);
|
||||
var _systemRom128 = GetFirmware(0x8000, "128ROM");
|
||||
var romData128 = RomData.InitROM(machineType, _systemRom128);
|
||||
_machine.InitROM(romData128);
|
||||
break;
|
||||
case MachineType.ZXSpectrum128Plus2:
|
||||
_machine = new ZX128Plus2(this, _cpu, file);
|
||||
_machine = new ZX128Plus2(this, _cpu, borderType, file);
|
||||
var _systemRomP2 = GetFirmware(0x8000, "PLUS2ROM");
|
||||
var romDataP2 = RomData.InitROM(machineType, _systemRomP2);
|
||||
_machine.InitROM(romDataP2);
|
||||
break;
|
||||
case MachineType.ZXSpectrum128Plus3:
|
||||
_machine = new ZX128Plus3(this, _cpu, file);
|
||||
_machine = new ZX128Plus3(this, _cpu, borderType, file);
|
||||
var _systemRomP3 = GetFirmware(0x10000, "PLUS3ROM");
|
||||
var romDataP3 = RomData.InitROM(machineType, _systemRomP3);
|
||||
_machine.InitROM(romDataP3);
|
||||
System.Windows.Forms.MessageBox.Show("+3 is not working at all yet :/");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue