From 3d6f20b7b9315f9dd7c67a88986cd053c0a97a92 Mon Sep 17 00:00:00 2001
From: Thomas Harte <thomas.harte@gmail.com>
Date: Sat, 9 Jan 2016 21:53:33 -0500
Subject: [PATCH] Output, at last! Though sync is clearly way off.

---
 Machines/Electron/Electron.cpp                       | 9 +++++++--
 OSBindings/Mac/Clock Signal/Views/CSCathodeRayView.m | 4 ++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Machines/Electron/Electron.cpp b/Machines/Electron/Electron.cpp
index 828700589..fab8dca3e 100644
--- a/Machines/Electron/Electron.cpp
+++ b/Machines/Electron/Electron.cpp
@@ -188,10 +188,15 @@ inline void Machine::update_display()
 
 	if(_frameCycles >= end_of_hsync)
 	{
-		// assert sync for the first three lines of the display
+		// assert sync for the first three lines of the display, with a break at the end for horizontal alignment
 		if(_outputPosition < end_of_hsync)
 		{
-			_crt->output_sync(end_of_hsync * crt_cycles_multiplier);
+			for(int c = 0; c < 3; c++)
+			{
+				_crt->output_sync(9 * crt_cycles_multiplier);
+				_crt->output_blank(9 * crt_cycles_multiplier);
+				_crt->output_sync(110 * crt_cycles_multiplier);
+			}
 			_outputPosition = end_of_hsync;
 		}
 
diff --git a/OSBindings/Mac/Clock Signal/Views/CSCathodeRayView.m b/OSBindings/Mac/Clock Signal/Views/CSCathodeRayView.m
index f659b2424..59cad6145 100644
--- a/OSBindings/Mac/Clock Signal/Views/CSCathodeRayView.m	
+++ b/OSBindings/Mac/Clock Signal/Views/CSCathodeRayView.m	
@@ -387,10 +387,10 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
 		"fragColour = 5.0 * texture(shadowMaskTexID, shadowMaskCoordinates) * vec4(yiqToRGB * vec3(y, i, q), 1.0);//sin(lateralVarying));\n";
 
 	NSString *const rgbFragmentShaderGlobals =
-		@"in vec2 srcCoordinatesVarying;\n";
+		@"in vec2 srcCoordinatesVarying;\n"; // texture(shadowMaskTexID, shadowMaskCoordinates) *
 
 	NSString *const rgbFragmentShaderBody =
-		@"fragColour = texture(shadowMaskTexID, shadowMaskCoordinates) * sample(srcCoordinatesVarying);//sin(lateralVarying));\n";
+		@"fragColour = sample(srcCoordinatesVarying);//sin(lateralVarying));\n";
 
 	switch(_signalType)
 	{