+static int linestartts;
+static int tofix=0;
+
+static void ResetRL(void)
+{
+ linestartts=timestamp*48+X6502_GetCycleCount();
+ tofix=1;
+}
+
+static INLINE void Fixit1(void);
+
+static void TryFixit1(void)
+{
+ #define TOFIXNUM (272-0x4)
+ int lastpixel;
+
+ if (scanline < 240 && tofix)
+ {
+ lastpixel = (timestamp*48-linestartts)>>4;
+ if (PAL) lastpixel += lastpixel>>4;
+
+ //printf("lastpixel: %i\n", lastpixel);
+
+ if(lastpixel>=TOFIXNUM)
+ {
+ Fixit1();
+ tofix=0;
+ }
+ }
+}
+
+