From d28e4e9f70a8b146c07f03e6be493a553da28851 Mon Sep 17 00:00:00 2001 From: Asnivor Date: Tue, 21 Aug 2018 20:30:04 +0100 Subject: [PATCH] C64Hawk: Fix border issues - #1272 (#1276) --- .../Computers/Commodore64/C64.ISettable.cs | 9 +++++-- .../Computers/Commodore64/MOS/Vic.cs | 24 +++++++++++++++---- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.ISettable.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.ISettable.cs index a87e50610a..d30cbfeb86 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.ISettable.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.ISettable.cs @@ -34,7 +34,12 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 public class C64Settings { [DisplayName("Border type")] - [Description("Select how to show the border area")] + [Description("Select how to show the border area\n" + + "NORMAL:\t Horizontal and Vertical border both set to 32 pixels (although horizontal will appear narrower due to pixel density)\n" + + "SMALL PROPORTIONAL:\t Horizontal and Vertical border both set to 16 pixels (although horizontal will appear narrower due to pixel density)\n" + + "SMALL FIXED:\t Horizontal border is set to 16 pixels and vertical is made slightly smaller so as to appear horizontal and vertical are the same after pixel density has been applied\n" + + "NONE:\t Only the pixel buffer is rendered" + )] [DefaultValue(BorderType.SmallProportional)] public BorderType BorderType { get; set; } @@ -104,7 +109,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 public enum BorderType { - SmallProportional, SmallFixed, Normal, Full + None, SmallProportional, SmallFixed, Normal } public enum SidType diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.cs index 0d136ba9d8..95dba3c0bc 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Vic.cs @@ -97,6 +97,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS switch (borderType) { + /* case C64.BorderType.Full: newHblankStart = -1; newHblankEnd = -1; @@ -105,6 +106,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS newVblankEnd = -1; _vblank = false; break; + */ case C64.BorderType.Normal: newHblankStart = hblankStart; newHblankEnd = hblankEnd; @@ -129,13 +131,27 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS newVblankStart = 0xFA + hBorderSize; newVblankEnd = 0x32 - hBorderSize; break; + case C64.BorderType.None: + newHblankStart = 0x158 + PixBufferSize; + newHblankEnd = 0x018 + PixBufferSize; + newVblankStart = 0xFA; + newVblankEnd = 0x32; + _vblank = true; + _hblank = true; + break; } // wrap values - newHblankStart = WrapValue(0, maxWidth, newHblankStart); - newHblankEnd = WrapValue(0, maxWidth, newHblankEnd); - newVblankStart = WrapValue(0, lines, newVblankStart); - newVblankEnd = WrapValue(0, lines, newVblankEnd); + if (_hblank) + { + newHblankStart = WrapValue(0, maxWidth, newHblankStart); + newHblankEnd = WrapValue(0, maxWidth, newHblankEnd); + } + if (_vblank) + { + newVblankStart = WrapValue(0, lines, newVblankStart); + newVblankEnd = WrapValue(0, lines, newVblankEnd); + } // calculate output dimensions _hblankStartCheckXRaster = newHblankStart & 0xFFC;