Unbreak Desktop Linux build

This commit is contained in:
Aaron Culliney 2018-11-17 13:35:35 -08:00
parent 55418504f4
commit 05633d4b0e
4 changed files with 14 additions and 23 deletions

View File

@ -76,6 +76,7 @@ apple2ix_SOURCES = \
src/test/sha1.c \
src/timing.c \
src/video/video.c \
src/video/ntsc.c \
src/vm.c \
src/zlib-helpers.c

View File

@ -1093,8 +1093,8 @@ void fb_sha1() {
uint8_t md[SHA_DIGEST_LENGTH];
char buf[(SHA_DIGEST_LENGTH*2)+1];
uint8_t *fb = display_getCurrentFramebuffer();
SHA1(fb, SCANWIDTH*SCANHEIGHT, md);
PIXEL_TYPE *fb = display_getCurrentFramebuffer();
SHA1((const unsigned char *)fb, SCANWIDTH*SCANHEIGHT*PIXEL_STRIDE, md);
int i=0;
for (int j=0; j<SHA_DIGEST_LENGTH; j++, i+=2) {

View File

@ -44,7 +44,7 @@ typedef PIXEL_TYPE (*fb_scanline_fn)(PIXEL_TYPE color0, PIXEL_TYPE color2);
static uint8_t half_scanlines = false;
static fb_plotter_fn pixelPlotter[NUM_COLOROPTS] = { NULL };
static fb_scanline_fn getHalfColor[NUM_COLOROPTS][2] = { NULL };
static fb_scanline_fn getHalfColor[NUM_COLOROPTS][2] = { { NULL } };
static unsigned int ntsc_color_phase = 0;
unsigned int ntsc_signal_bits = 0;

View File

@ -337,32 +337,22 @@ static int keysym_to_scancode(void) {
static void post_image() {
// now check/clear if we should redraw
unsigned long wasDirty = video_clearDirty(FB_DIRTY_FLAG);
unsigned long wasDirty = (video_clearDirty(FB_DIRTY_FLAG) & FB_DIRTY_FLAG);
if (wasDirty) {
uint8_t *fb = display_getCurrentFramebuffer();
PIXEL_TYPE *fb = display_getCurrentFramebuffer();
uint8_t index;
unsigned int count = SCANWIDTH * SCANHEIGHT;
for (unsigned int i=0, j=0; i<count; i++, j+=4)
{
index = *(fb + i);
*( (uint32_t*)(image->data + j) ) = (uint32_t)(
((uint32_t)(colormap[index].red) << red_shift) |
((uint32_t)(colormap[index].green) << green_shift) |
((uint32_t)(colormap[index].blue) << blue_shift) |
((uint32_t)0xff /* alpha */ << alpha_shift)
);
if (scale > 1)
if (scale <= 1) {
memcpy(/*dst:*/image->data, /*src:*/fb, SCANWIDTH*SCANHEIGHT*bitmap_pad);
} else {
unsigned int count = SCANWIDTH * SCANHEIGHT;
for (unsigned int i=0, j=0; i<count; i++, j+=4)
{
PIXEL_TYPE pixel = *(fb + i);
*( (uint32_t*)(image->data + j) ) = pixel;
j+=4;
// duplicate pixel
*( (uint32_t*)(image->data + j) ) = (uint32_t)(
((uint32_t)(colormap[index].red) << red_shift) |
((uint32_t)(colormap[index].green) << green_shift) |
((uint32_t)(colormap[index].blue) << blue_shift) |
((uint32_t)0xff /* alpha */ << alpha_shift)
);
*( (uint32_t*)(image->data + j) ) = pixel;
if (((i+1) % SCANWIDTH) == 0)
{