diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Screen.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Screen.cs
index 69bdc62382..65df1938cc 100644
--- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Screen.cs
+++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Screen.cs
@@ -151,7 +151,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// The number of border pixels to the right of the display
///
protected int BorderRightPixels = 48;
-
+
///
/// The total width of the screen in pixels
///
@@ -765,8 +765,25 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
///
/// Initialises the screen configuration calculations
///
- 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)
diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Screen.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Screen.cs
index 541a370341..00b952614b 100644
--- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Screen.cs
+++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Screen.cs
@@ -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;
- }
}
}
diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.cs
index b40df6e8a9..9a8dfbc55b 100644
--- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.cs
+++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.cs
@@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
///
///
///
- 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();
diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2/ZX128Plus2.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2/ZX128Plus2.cs
index faaba1791f..b88bcb3e58 100644
--- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2/ZX128Plus2.cs
+++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2/ZX128Plus2.cs
@@ -20,8 +20,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
///
///
///
- 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)
{
}
diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.cs
index cd5e8f81b2..31f71db4c0 100644
--- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.cs
+++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.cs
@@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
///
///
///
- 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();
diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs
index d810cf7255..5fc4d6badd 100644
--- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs
+++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs
@@ -16,8 +16,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
///
///
///
- 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)
{
}
diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.cs
index 4979071d58..81e1b07258 100644
--- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.cs
+++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.cs
@@ -16,14 +16,14 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
///
///
///
- 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();
diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.ISettable.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.ISettable.cs
index f68aa408e4..3d12898e0e 100644
--- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.ISettable.cs
+++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.ISettable.cs
@@ -104,8 +104,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
public enum BorderType
{
Full,
- Medium,
- Small
+ Widescreen,
}
///
diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs
index 036247f341..5fff81c5be 100644
--- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs
+++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs
@@ -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;
}
}