1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-26 11:29:09 +00:00

Made another run at 2600 colours.

This commit is contained in:
Thomas Harte 2016-05-14 16:52:24 -04:00
parent 30f335fa35
commit cca53598d3

View File

@ -39,7 +39,7 @@ void Machine::setup_output(float aspect_ratio)
"uint y = c & 14u;"
"uint iPhase = (c >> 4);"
"float phaseOffset = 6.283185308 * float(iPhase + 13u) / 14.0;"
"float phaseOffset = 6.283185308 * float(iPhase - 1u) / 13.0;"
"return (float(y) / 14.0) * (1.0 - amplitude) + step(1, iPhase) * amplitude * cos(phase + phaseOffset);"
"}");
_crt->set_output_device(Outputs::CRT::Television);
@ -55,8 +55,10 @@ void Machine::switch_region()
"uint y = c & 14u;"
"uint iPhase = (c >> 4);"
"float phaseOffset = (0.5 + 2.0 * (float(iPhase&1u) - 0.5) * (float((iPhase >> 1) + (iPhase&1u)) / 14.0));"
"return (float(y) / 14.0) * (1.0 - amplitude) + step(4, (iPhase + 2u) & 15u) * amplitude * cos(phase + 6.283185308 * phaseOffset);"
"uint direction = iPhase & 1u;"
"float phaseOffset = float(7u - direction) + (float(direction) - 0.5) * 2.0 * float(iPhase >> 1);"
"phaseOffset *= 6.283185308 / 12.0;"
"return (float(y) / 14.0) * (1.0 - amplitude) + step(4, (iPhase + 2u) & 15u) * amplitude * cos(phase + phaseOffset);"
"}");
_crt->set_new_timing(228, 312, Outputs::CRT::ColourSpace::YUV, 228, 1);
}
@ -171,6 +173,9 @@ void Machine::get_output_pixel(uint8_t *pixel, int offset)
}
// store colour
// static int lc;
// if(_vSyncEnabled) lc = 0; else lc += (offset == 159) ? 1 : 0;
// *pixel = (uint8_t)(((offset / 10) << 4) | (((lc >> 4)&7) << 1));
*pixel = outputColour;
}