DS - add screen gap option
This commit is contained in:
parent
a541b45231
commit
5f889e2568
|
@ -21,11 +21,10 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class ScreenArranger
|
public static class ScreenArranger
|
||||||
{
|
{
|
||||||
// TODO: pad lines
|
// TODO: pass in int[] to reuse buffer
|
||||||
// TOOD: pass in int[] to reuse buffer
|
public static unsafe int[] Stack(VideoScreen screen1, VideoScreen screen2, int screenGap)
|
||||||
public static unsafe int[] Stack(VideoScreen screen1, VideoScreen screen2, int padLines)
|
|
||||||
{
|
{
|
||||||
var ret = new int[screen1.Width * (screen1.Height + screen2.Height)];
|
var ret = new int[screen1.Width * (screen1.Height + screen2.Height + screenGap)];
|
||||||
for (int i = 0; i < screen1.Length; i++)
|
for (int i = 0; i < screen1.Length; i++)
|
||||||
{
|
{
|
||||||
ret[i] = screen1.Buffer[i];
|
ret[i] = screen1.Buffer[i];
|
||||||
|
@ -33,13 +32,15 @@
|
||||||
|
|
||||||
for (int i = 0; i < screen2.Length; i++)
|
for (int i = 0; i < screen2.Length; i++)
|
||||||
{
|
{
|
||||||
ret[screen1.Length + i] = screen2.Buffer[i];
|
ret[screen1.Length + i + (screen1.Width * screenGap)] = screen2.Buffer[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simply populates a buffer with a single screen
|
/// <summary>
|
||||||
|
/// Simply populates a buffer with a single screen
|
||||||
|
/// </summary>
|
||||||
public static unsafe int[] Copy(VideoScreen screen1)
|
public static unsafe int[] Copy(VideoScreen screen1)
|
||||||
{
|
{
|
||||||
var ret = new int[screen1.Length];
|
var ret = new int[screen1.Length];
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
@ -87,15 +89,20 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||||
|
|
||||||
public class MelonSettings
|
public class MelonSettings
|
||||||
{
|
{
|
||||||
|
[DisplayName("Screen Configuration")]
|
||||||
|
[Description("Adjusts the orientation of the 2 displays")]
|
||||||
public VideoScreenOptions ScreenOptions { get; set; } = VideoScreenOptions.Default;
|
public VideoScreenOptions ScreenOptions { get; set; } = VideoScreenOptions.Default;
|
||||||
|
|
||||||
|
[DisplayName("Screen Gap")]
|
||||||
|
public int ScreenGap { get; set; }
|
||||||
|
|
||||||
public Point? TouchScreenStart() =>
|
public Point? TouchScreenStart() =>
|
||||||
ScreenOptions switch
|
ScreenOptions switch
|
||||||
{
|
{
|
||||||
VideoScreenOptions.TopOnly => null,
|
VideoScreenOptions.TopOnly => null,
|
||||||
VideoScreenOptions.SideBySideLR => new Point(NativeWidth, 0),
|
VideoScreenOptions.SideBySideLR => new Point(NativeWidth, 0),
|
||||||
VideoScreenOptions.SideBySideRL => new Point(0, 0),
|
VideoScreenOptions.SideBySideRL => new Point(0, 0),
|
||||||
_ => new Point(0, NativeHeight)
|
_ => new Point(0, NativeHeight + ScreenGap)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,7 +122,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||||
VideoScreenOptions.TopOnly => NativeHeight,
|
VideoScreenOptions.TopOnly => NativeHeight,
|
||||||
VideoScreenOptions.SideBySideLR => NativeHeight,
|
VideoScreenOptions.SideBySideLR => NativeHeight,
|
||||||
VideoScreenOptions.SideBySideRL => NativeHeight,
|
VideoScreenOptions.SideBySideRL => NativeHeight,
|
||||||
_ => NativeHeight * 2
|
_ => (NativeHeight * 2) + ScreenGap
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||||
VideoScreenOptions.TopOnly => ScreenArranger.Copy(TopScreen),
|
VideoScreenOptions.TopOnly => ScreenArranger.Copy(TopScreen),
|
||||||
VideoScreenOptions.SideBySideLR => ScreenArranger.SideBySide(TopScreen, BottomScreen),
|
VideoScreenOptions.SideBySideLR => ScreenArranger.SideBySide(TopScreen, BottomScreen),
|
||||||
VideoScreenOptions.SideBySideRL => ScreenArranger.SideBySide(BottomScreen, TopScreen),
|
VideoScreenOptions.SideBySideRL => ScreenArranger.SideBySide(BottomScreen, TopScreen),
|
||||||
_ => ScreenArranger.Stack(TopScreen, BottomScreen, 0)
|
_ => ScreenArranger.Stack(TopScreen, BottomScreen, _settings.ScreenGap)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue