diff --git a/DotN64.Desktop/DotN64.Desktop.csproj b/DotN64.Desktop/DotN64.Desktop.csproj
index 0d08e4f..866d956 100644
--- a/DotN64.Desktop/DotN64.Desktop.csproj
+++ b/DotN64.Desktop/DotN64.Desktop.csproj
@@ -28,6 +28,7 @@
+ true
true
@@ -36,6 +37,7 @@
4
true
false
+ true
diff --git a/DotN64.Desktop/SDL/Window.cs b/DotN64.Desktop/SDL/Window.cs
index 1e7ae1c..9c07163 100644
--- a/DotN64.Desktop/SDL/Window.cs
+++ b/DotN64.Desktop/SDL/Window.cs
@@ -119,7 +119,7 @@ namespace DotN64.Desktop.SDL
}
}
- public void Draw(VideoFrame frame, RealityCoprocessor.VideoInterface vi, RDRAM ram)
+ public unsafe void Draw(VideoFrame frame, RealityCoprocessor.VideoInterface vi, RDRAM ram)
{
PollEvents();
@@ -163,7 +163,19 @@ namespace DotN64.Desktop.SDL
var line = (ushort)((vi.CurrentVerticalLine - vi.VerticalVideo.ActiveVideoStart) / (float)(vi.VerticalVideo.ActiveVideoEnd - vi.VerticalVideo.ActiveVideoStart) * frame.Height);
var offset = pitch * line;
- Marshal.Copy(ram.Memory, (int)vi.DRAMAddress + offset, pixels + offset, pitch);
+ if (frame.Size != ControlRegister.PixelSize.RGBA5553)
+ Marshal.Copy(ram.Memory, (int)vi.DRAMAddress + offset, pixels + offset, pitch);
+ else
+ {
+ fixed (byte* rdram = &ram.Memory[(int)vi.DRAMAddress])
+ {
+ for (int end = offset + pitch; offset < end; offset += 4)
+ {
+ ((ushort*)(pixels + offset))[0] = ((ushort*)(rdram + offset))[1];
+ ((ushort*)(pixels + offset))[1] = ((ushort*)(rdram + offset))[0];
+ }
+ }
+ }
}
SDL_UnlockTexture(texture);