diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs index 2bafa69885..1c78ff1c2b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs @@ -288,6 +288,11 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public bool ShowBall { get; set; } public bool ShowPlayfield { get; set; } + public int TopLine { get; set; } + public int BottomLine { get; set; } + + public int BackgroundColor { get; set; } + public A2600Settings Clone() { return (A2600Settings)MemberwiseClone(); @@ -303,7 +308,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 ShowMissle1 = true, ShowMissle2 = true, ShowBall = true, - ShowPlayfield = true + ShowPlayfield = true, + + TopLine = 24, + BottomLine = 248, + + BackgroundColor = 0 }; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs index 535efb7e31..ebcc2d956d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs @@ -119,7 +119,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public int VirtualHeight { - get { return _bottomLine - _topLine; } + get { return _core.Settings.BottomLine - _core.Settings.TopLine; } } public int BufferWidth @@ -129,12 +129,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public int BufferHeight { - get { return _bottomLine - _topLine; } + get { return _core.Settings.BottomLine - _core.Settings.TopLine; } } public int BackgroundColor { - get { return 0; } + get { return _core.Settings.BackgroundColor; } } public int[] GetVideoBuffer() @@ -477,23 +477,22 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private const int ScreenWidth = 160; private const int MaxScreenHeight = 262; - private const int _topLine = 35; - private const int _bottomLine = 227; - - // TODO: Remove the magic numbers from this function to allow for a variable height screen public void OutputFrame() { - for (int row = _topLine; row < _bottomLine; row++) + var topLine = _core.Settings.TopLine; + var bottomLine = _core.Settings.BottomLine; + + for (int row = topLine; row < bottomLine; row++) { for (int col = 0; col < ScreenWidth; col++) { if (_scanlinesBuffer.Count > row) { - FrameBuffer[((row - _topLine) * ScreenWidth) + col] = (int)(_scanlinesBuffer[row][col] | 0xFF000000); + FrameBuffer[((row - topLine) * ScreenWidth) + col] = (int)(_scanlinesBuffer[row][col] | 0xFF000000); } else { - FrameBuffer[((row - _topLine) * ScreenWidth) + col] = unchecked((int)0xFF000000); + FrameBuffer[((row - topLine) * ScreenWidth) + col] = unchecked((int)0xFF000000); } } }