2017-05-30 17:09:46 +00:00
|
|
|
|
using BizHawk.Common;
|
2013-11-04 01:39:19 +00:00
|
|
|
|
using BizHawk.Emulation.Common;
|
2012-11-27 05:11:40 +00:00
|
|
|
|
|
2014-10-03 21:04:37 +00:00
|
|
|
|
namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
2012-11-27 05:11:40 +00:00
|
|
|
|
{
|
2016-02-22 23:50:11 +00:00
|
|
|
|
public sealed partial class Vic : IVideoProvider
|
2012-11-27 05:11:40 +00:00
|
|
|
|
{
|
2017-05-13 18:04:02 +00:00
|
|
|
|
private static readonly int BgColor = Colors.ARGB(0, 0, 0);
|
|
|
|
|
private int[] _buf;
|
|
|
|
|
private int _bufHeight;
|
|
|
|
|
private int _bufLength;
|
2016-02-22 23:50:11 +00:00
|
|
|
|
private int _bufOffset;
|
2017-05-13 18:04:02 +00:00
|
|
|
|
private int _bufWidth;
|
|
|
|
|
|
|
|
|
|
private const int PixBufferSize = 24;
|
|
|
|
|
private const int PixBorderBufferSize = 12;
|
|
|
|
|
|
2017-04-24 13:35:05 +00:00
|
|
|
|
private int[] _pixBuffer;
|
2016-02-22 23:50:11 +00:00
|
|
|
|
private int _pixBufferIndex;
|
2017-04-24 13:35:05 +00:00
|
|
|
|
private int[] _pixBorderBuffer;
|
|
|
|
|
private int _pixBufferBorderIndex;
|
2012-11-27 05:11:40 +00:00
|
|
|
|
|
2017-04-24 13:35:05 +00:00
|
|
|
|
// palette
|
|
|
|
|
private static readonly int[] Palette =
|
2013-11-12 19:22:09 +00:00
|
|
|
|
{
|
2017-05-30 17:09:46 +00:00
|
|
|
|
Colors.ARGB(0x00, 0x00, 0x00),
|
|
|
|
|
Colors.ARGB(0xFF, 0xFF, 0xFF),
|
2017-11-12 22:20:23 +00:00
|
|
|
|
Colors.ARGB(0x96, 0x28, 0x2E),
|
|
|
|
|
Colors.ARGB(0x5B, 0xD6, 0xCE),
|
|
|
|
|
Colors.ARGB(0x9F, 0x2D, 0xAD),
|
|
|
|
|
Colors.ARGB(0x41, 0xB9, 0x36),
|
|
|
|
|
Colors.ARGB(0x27, 0x24, 0xC4),
|
|
|
|
|
Colors.ARGB(0xEF, 0xF3, 0x47),
|
|
|
|
|
Colors.ARGB(0x9F, 0x48, 0x15),
|
|
|
|
|
Colors.ARGB(0x5E, 0x35, 0x00),
|
|
|
|
|
Colors.ARGB(0xDA, 0x5F, 0x66),
|
|
|
|
|
Colors.ARGB(0x47, 0x47, 0x47),
|
|
|
|
|
Colors.ARGB(0x78, 0x78, 0x78),
|
|
|
|
|
Colors.ARGB(0x91, 0xFF, 0x84),
|
|
|
|
|
Colors.ARGB(0x68, 0x64, 0xFF),
|
|
|
|
|
Colors.ARGB(0xAE, 0xAE, 0xAE)
|
2013-11-12 19:22:09 +00:00
|
|
|
|
};
|
2012-11-27 05:11:40 +00:00
|
|
|
|
|
2017-05-30 17:09:46 +00:00
|
|
|
|
public int BackgroundColor => BgColor;
|
2012-11-27 05:11:40 +00:00
|
|
|
|
|
2017-05-30 17:09:46 +00:00
|
|
|
|
public int BufferHeight => _bufHeight;
|
2012-11-27 05:11:40 +00:00
|
|
|
|
|
2017-05-30 17:09:46 +00:00
|
|
|
|
public int BufferWidth => _bufWidth;
|
2012-11-27 05:11:40 +00:00
|
|
|
|
|
|
|
|
|
public int[] GetVideoBuffer()
|
|
|
|
|
{
|
2016-02-22 23:50:11 +00:00
|
|
|
|
return _buf;
|
2012-11-27 05:11:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-04-24 13:35:05 +00:00
|
|
|
|
public int VirtualWidth { get; private set; }
|
2014-04-30 23:48:37 +00:00
|
|
|
|
|
2017-04-24 13:35:05 +00:00
|
|
|
|
public int VirtualHeight { get; private set; }
|
2017-05-05 16:21:37 +00:00
|
|
|
|
|
2017-05-09 14:58:23 +00:00
|
|
|
|
public int VsyncNumerator => CyclesPerSecond;
|
2017-05-05 16:21:37 +00:00
|
|
|
|
|
2017-05-09 14:58:23 +00:00
|
|
|
|
public int VsyncDenominator => CyclesPerFrame;
|
2012-11-27 05:11:40 +00:00
|
|
|
|
}
|
|
|
|
|
}
|