2019-04-16 15:10:56 +00:00
|
|
|
|
using System;
|
2019-04-26 16:51:45 +00:00
|
|
|
|
using BizHawk.Common;
|
2019-04-16 15:10:56 +00:00
|
|
|
|
using BizHawk.Common.BufferExtensions;
|
|
|
|
|
using BizHawk.Emulation.Common;
|
|
|
|
|
|
|
|
|
|
namespace BizHawk.Emulation.Cores.Consoles.ChannelF
|
|
|
|
|
{
|
2019-04-17 21:28:12 +00:00
|
|
|
|
public partial class ChannelF : IVideoProvider, IRegionable
|
2019-04-16 15:10:56 +00:00
|
|
|
|
{
|
2019-05-07 13:43:36 +00:00
|
|
|
|
public int _frameHz = 60;
|
2019-04-26 16:51:45 +00:00
|
|
|
|
|
2019-05-08 08:48:01 +00:00
|
|
|
|
public int[] CroppedBuffer = new int[102 * 58];
|
2019-04-26 16:51:45 +00:00
|
|
|
|
|
2019-05-07 13:43:36 +00:00
|
|
|
|
#region IVideoProvider
|
2019-04-16 15:10:56 +00:00
|
|
|
|
|
2019-05-07 13:43:36 +00:00
|
|
|
|
public int VirtualWidth => BufferWidth * 2;
|
2019-05-08 08:48:01 +00:00
|
|
|
|
public int VirtualHeight => (int)((double)BufferHeight * 1.3) * 2;
|
|
|
|
|
public int BufferWidth => 102; //128
|
|
|
|
|
public int BufferHeight => 58; //64
|
2019-05-07 13:43:36 +00:00
|
|
|
|
public int BackgroundColor => Colors.ARGB(0x00, 0x00, 0x00);
|
|
|
|
|
public int VsyncNumerator => _frameHz;
|
|
|
|
|
public int VsyncDenominator => 1;
|
2019-04-16 15:10:56 +00:00
|
|
|
|
|
|
|
|
|
public int[] GetVideoBuffer()
|
|
|
|
|
{
|
2019-05-07 13:43:36 +00:00
|
|
|
|
BuildFrame();
|
2019-04-25 22:52:35 +00:00
|
|
|
|
|
2019-05-08 08:48:01 +00:00
|
|
|
|
var lBorderWidth = 4;
|
|
|
|
|
var rBorderWidth = 128 - 102 - lBorderWidth;
|
|
|
|
|
var tBorderHeight = 4;
|
|
|
|
|
var bBorderHeight = 64 - 58 - tBorderHeight;
|
|
|
|
|
var startP = 128 * tBorderHeight;
|
|
|
|
|
var endP = 128 * bBorderHeight;
|
|
|
|
|
|
|
|
|
|
int index = 0;
|
|
|
|
|
|
|
|
|
|
for (int i = startP; i < frameBuffer.Length - endP; i += 128)
|
2019-04-25 22:52:35 +00:00
|
|
|
|
{
|
2019-05-08 08:48:01 +00:00
|
|
|
|
for (int p = lBorderWidth; p < 128 - rBorderWidth; p++)
|
2019-05-07 13:43:36 +00:00
|
|
|
|
{
|
2019-05-08 08:48:01 +00:00
|
|
|
|
if (index == CroppedBuffer.Length)
|
2019-05-07 13:43:36 +00:00
|
|
|
|
break;
|
2019-05-08 08:48:01 +00:00
|
|
|
|
|
|
|
|
|
CroppedBuffer[index++] = FPalette[frameBuffer[i + p]];
|
2019-05-07 13:43:36 +00:00
|
|
|
|
}
|
2019-04-25 22:52:35 +00:00
|
|
|
|
}
|
2019-05-07 13:43:36 +00:00
|
|
|
|
|
|
|
|
|
return CroppedBuffer;
|
2019-05-08 08:48:01 +00:00
|
|
|
|
|
|
|
|
|
//return frameBuffer;
|
|
|
|
|
|
|
|
|
|
|
2019-04-25 22:52:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-05-07 13:43:36 +00:00
|
|
|
|
#endregion
|
2019-04-25 22:52:35 +00:00
|
|
|
|
|
2019-04-17 21:28:12 +00:00
|
|
|
|
#region IRegionable
|
|
|
|
|
|
|
|
|
|
public DisplayType Region => DisplayType.NTSC;
|
|
|
|
|
|
|
|
|
|
#endregion
|
2019-04-16 15:10:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|