1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-26 10:29:31 +00:00

More tweaks to provide a stable image, at least for the time being.

This commit is contained in:
Thomas Harte 2015-07-27 20:18:25 -04:00
parent 01109d441b
commit 1f229ee6f7
3 changed files with 13 additions and 4 deletions

View File

@ -43,13 +43,22 @@ void Machine::get_output_pixel(uint8_t *pixel, int offset)
{164, 186, 250}, {166, 201, 250}, {164, 224, 251}, {165, 251, 213},
{185, 251, 187}, {201, 250, 168}, {225, 235, 160}, {252, 223, 145}
};
const uint8_t alphaValues[8] =
{
// 0, 64, 108, 144, 176, 200, 220, 255
// };
//
// {
69, 134, 108, 161, 186, 210, 235, 255
};
// TODO: almost everything!
uint8_t outputColour = playFieldPixel ? _playfieldColour : _backgroundColour;
uint8_t playfieldColour = ((_playfieldControl&6) == 2) ? ((x < 20) ? _player0Colour : _player1Colour) : _playfieldColour;
uint8_t outputColour = playFieldPixel ? playfieldColour : _backgroundColour;
pixel[0] = palette[outputColour >> 4][0];
pixel[1] = palette[outputColour >> 4][1];
pixel[2] = palette[outputColour >> 4][2];
pixel[3] = (outputColour & 14) << 4;
pixel[3] = alphaValues[(outputColour >> 1)&7];
}
void Machine::output_pixels(int count)

View File

@ -49,7 +49,7 @@
CVDisplayLinkStart(displayLink);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glBlendFunc(GL_SRC_ALPHA, GL_ZERO);
}
static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *now, const CVTimeStamp *outputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext)

View File

@ -54,7 +54,7 @@ CRT::CRT(int cycles_per_line, int height_of_display, int number_of_buffers, ...)
// width should be 1.0 / _height_of_display, rotated to match the direction
float angle = atan2f(scanSpeedYfl, scanSpeedXfl);
float halfLineWidth = (float)_height_of_display * 2.0f;
float halfLineWidth = (float)_height_of_display * 1.9f;
_widths[0][0] = (sinf(angle) / halfLineWidth) * UINT32_MAX;
_widths[0][1] = (cosf(angle) / halfLineWidth) * UINT32_MAX;