Add VirtualWidth to IVideoProvider and the (numerous) implementations. This is just phase 1, client needs to be updated to utilize this information, and some cores (especially PCE) should be updated in a more involved way to provide better TV emulation.

This commit is contained in:
beirich 2012-06-25 02:50:34 +00:00
parent 4d91471bab
commit b599c69c18
15 changed files with 29 additions and 53 deletions

View File

@ -420,7 +420,8 @@ namespace BizHawk.Emulation.Consoles.Atari
public int[] frameBuffer = new int[320 * 262];
public int[] GetVideoBuffer() { return frameBuffer; }
public int BufferWidth { get { return 320; } }
public int VirtualWidth { get { return 320; } }
public int BufferWidth { get { return 320; } }
public int BufferHeight { get { return 262; } }
public int BackgroundColor { get { return 0; } }

View File

@ -384,6 +384,7 @@ namespace BizHawk.Emulation.Consoles.Calculator
}
return pixels;
}
public int VirtualWidth { get { return 96; } }
public int BufferWidth { get { return 96; } }
public int BufferHeight { get { return 64; } }
public int BackgroundColor { get { return 0; } }

View File

@ -87,7 +87,8 @@ namespace BizHawk.Emulation.Consoles.Coleco
}
public int[] GetVideoBuffer() { return frameBuffer; }
public int BufferWidth { get { return 256; } }
public int VirtualWidth { get { return 256; } }
public int BufferWidth { get { return 256; } }
public int BufferHeight { get { return 192; } }
public int BackgroundColor { get { return 0; } }
public void GetSamples(short[] samples)

View File

@ -499,7 +499,8 @@ namespace BizHawk.Emulation.Consoles.Coleco
return mode == VdpMode.SMS ? FrameBuffer : GameGearFrameBuffer;
}
public int BufferWidth
public int VirtualWidth { get { return BufferWidth; } }
public int BufferWidth
{
get { return mode == VdpMode.SMS ? 256 : 160; }
}

View File

@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Consoles.GB
inBIOS = !skipBIOS;
HardReset();
}
public int VirtualWidth { get { return 160; } }
public int BufferWidth { get { return 160; } }
public int BufferHeight { get { return 144; } }
public int BackgroundColor { get { return 0; } }

View File

@ -754,7 +754,8 @@ namespace BizHawk.Emulation.Consoles.Gameboy
return buf;
}
public int BufferWidth { get { return 160; } }
public int VirtualWidth { get { return 160; } }
public int BufferWidth { get { return 160; } }
public int BufferHeight { get { return 144; } }
public int BackgroundColor { get { return 0; } }

View File

@ -150,6 +150,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
}
return pixels;
}
public int VirtualWidth { get { return BufferWidth; } }
public int BufferWidth { get { return right - left + 1; } }
public int BufferHeight { get { return bottom - top + 1; } }
public int BackgroundColor { get { return 0; } }

View File

@ -343,24 +343,11 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
int FrameHeight = 240;
int[] FrameBuffer = new int[256 * 240];
public int[] GetVideoBuffer()
{
return FrameBuffer;
}
public int[] GetVideoBuffer() { return FrameBuffer; }
public int BufferWidth
{
get { return FramePitch; }
}
public int BufferHeight
{
get { return FrameHeight; }
}
public int BackgroundColor
{
get { return vce.Palette[256]; }
}
public int VirtualWidth { get { return FramePitch; } }
public int BufferWidth { get { return FramePitch; } }
public int BufferHeight { get { return FrameHeight; } }
public int BackgroundColor { get { return vce.Palette[256]; } }
}
}

View File

@ -498,24 +498,11 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
}
}
public int[] GetVideoBuffer()
{
return FrameBuffer;
}
public int[] GetVideoBuffer() { return FrameBuffer; }
public int BufferWidth
{
get { return FrameWidth; }
}
public int BufferHeight
{
get { return FrameHeight; }
}
public int BackgroundColor
{
get { return VCE.Palette[0]; }
}
public int VirtualWidth { get { return FrameWidth; } }
public int BufferWidth { get { return FrameWidth; } }
public int BufferHeight { get { return FrameHeight; } }
public int BackgroundColor { get { return VCE.Palette[0]; } }
}
}

View File

@ -314,6 +314,8 @@ namespace BizHawk.Emulation.Consoles.Sega
return FrameBuffer;
}
public int VirtualWidth { get { return 320; } }
public int BufferWidth
{
get { return FrameWidth; }

View File

@ -494,6 +494,7 @@ namespace BizHawk.Emulation.Consoles.Sega
return mode == VdpMode.SMS ? FrameBuffer : GameGearFrameBuffer;
}
public int VirtualWidth { get { return BufferWidth; } }
public int BufferWidth
{
get { return mode == VdpMode.SMS ? 256 : 160; }

View File

@ -50,7 +50,8 @@ namespace BizHawk
public void LoadStateBinary(BinaryReader reader) { }
public byte[] SaveStateBinary() { return new byte[1]; }
public int[] GetVideoBuffer() { return frameBuffer; }
public int BufferWidth { get { return 256; } }
public int VirtualWidth { get { return 256; } }
public int BufferWidth { get { return 256; } }
public int BufferHeight { get { return 192; } }
public int BackgroundColor { get { return 0; } }
public void GetSamples(short[] samples) { }

View File

@ -4,6 +4,8 @@
{
int[] GetVideoBuffer();
int VirtualWidth { get; } // Used for controlling aspect ratio. Just return BufferWidth if you dont know what to do with this.
int BufferWidth { get; }
int BufferHeight { get; }
int BackgroundColor { get; }

View File

@ -91,6 +91,7 @@ namespace BizHawk.MultiClient
{
int[] vb;
int bw, bh, bc;
public int VirtualWidth { get { return bw; } }
public int BufferWidth { get {return bw;} }
public int BufferHeight { get { return bh; } }
public int BackgroundColor { get { return bc; } }

View File

@ -556,17 +556,6 @@ namespace BizHawk.MultiClient
}
}
public class VideoProviderData : IVideoProvider
{
public int[] VideoBuffer;
public int BufferWidth { get; set; }
public int BufferHeight { get; set; }
public int BackgroundColor { get; set; }
public int[] GetVideoBuffer() { return VideoBuffer; }
}
public class DisplayManager : IDisposable
{
public DisplayManager()