Removed palettised blitting code.

This commit is contained in:
SarahW 2017-05-28 17:45:42 +01:00
commit 3c514a445f
18 changed files with 572 additions and 1079 deletions

View file

@ -223,26 +223,26 @@ void tandy_poll(void *p)
// printf("Firstline %i\n",firstline);
}
tandy->lastline = tandy->displine;
cols[0] = (tandy->array[2] & 0xf) + 16;
cols[0] = tandy->array[2] & 0xf;
for (c = 0; c < 8; c++)
{
if (tandy->array[3] & 4)
{
buffer->line[tandy->displine][c] = cols[0];
if (tandy->mode & 1) buffer->line[tandy->displine][c + (tandy->crtc[1] << 3) + 8] = cols[0];
else buffer->line[tandy->displine][c + (tandy->crtc[1] << 4) + 8] = cols[0];
((uint32_t *)buffer32->line[tandy->displine])[c] = cols[0];
if (tandy->mode & 1) ((uint32_t *)buffer32->line[tandy->displine])[c + (tandy->crtc[1] << 3) + 8] = cols[0];
else ((uint32_t *)buffer32->line[tandy->displine])[c + (tandy->crtc[1] << 4) + 8] = cols[0];
}
else if ((tandy->mode & 0x12) == 0x12)
{
buffer->line[tandy->displine][c] = 0;
if (tandy->mode & 1) buffer->line[tandy->displine][c + (tandy->crtc[1] << 3) + 8] = 0;
else buffer->line[tandy->displine][c + (tandy->crtc[1] << 4) + 8] = 0;
((uint32_t *)buffer32->line[tandy->displine])[c] = 0;
if (tandy->mode & 1) ((uint32_t *)buffer32->line[tandy->displine])[c + (tandy->crtc[1] << 3) + 8] = 0;
else ((uint32_t *)buffer32->line[tandy->displine])[c + (tandy->crtc[1] << 4) + 8] = 0;
}
else
{
buffer->line[tandy->displine][c] = (tandy->col & 15) + 16;
if (tandy->mode & 1) buffer->line[tandy->displine][c + (tandy->crtc[1] << 3) + 8] = (tandy->col & 15) + 16;
else buffer->line[tandy->displine][c + (tandy->crtc[1] << 4) + 8] = (tandy->col & 15) + 16;
((uint32_t *)buffer32->line[tandy->displine])[c] = tandy->col & 15;
if (tandy->mode & 1) ((uint32_t *)buffer32->line[tandy->displine])[c + (tandy->crtc[1] << 3) + 8] = tandy->col & 15;
else ((uint32_t *)buffer32->line[tandy->displine])[c + (tandy->crtc[1] << 4) + 8] = tandy->col & 15;
}
}
// printf("X %i %i\n",c+(crtc[1]<<4)+8,c+(crtc[1]<<3)+8);
@ -254,14 +254,14 @@ void tandy_poll(void *p)
dat = (tandy->vram[((tandy->ma << 1) & 0x1fff) + ((tandy->sc & 3) * 0x2000)] << 8) |
tandy->vram[((tandy->ma << 1) & 0x1fff) + ((tandy->sc & 3) * 0x2000) + 1];
tandy->ma++;
buffer->line[tandy->displine][(x << 3) + 8] =
buffer->line[tandy->displine][(x << 3) + 9] = tandy->array[((dat >> 12) & tandy->array[1]) + 16] + 16;
buffer->line[tandy->displine][(x << 3) + 10] =
buffer->line[tandy->displine][(x << 3) + 11] = tandy->array[((dat >> 8) & tandy->array[1]) + 16] + 16;
buffer->line[tandy->displine][(x << 3) + 12] =
buffer->line[tandy->displine][(x << 3) + 13] = tandy->array[((dat >> 4) & tandy->array[1]) + 16] + 16;
buffer->line[tandy->displine][(x << 3) + 14] =
buffer->line[tandy->displine][(x << 3) + 15] = tandy->array[(dat & tandy->array[1]) + 16] + 16;
((uint32_t *)buffer32->line[tandy->displine])[(x << 3) + 8] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 3) + 9] = tandy->array[((dat >> 12) & tandy->array[1]) + 16];
((uint32_t *)buffer32->line[tandy->displine])[(x << 3) + 10] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 3) + 11] = tandy->array[((dat >> 8) & tandy->array[1]) + 16];
((uint32_t *)buffer32->line[tandy->displine])[(x << 3) + 12] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 3) + 13] = tandy->array[((dat >> 4) & tandy->array[1]) + 16];
((uint32_t *)buffer32->line[tandy->displine])[(x << 3) + 14] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 3) + 15] = tandy->array[(dat & tandy->array[1]) + 16];
}
}
else if (tandy->array[3] & 0x10) /*160x200x16*/
@ -271,22 +271,22 @@ void tandy_poll(void *p)
dat = (tandy->vram[((tandy->ma << 1) & 0x1fff) + ((tandy->sc & 3) * 0x2000)] << 8) |
tandy->vram[((tandy->ma << 1) & 0x1fff) + ((tandy->sc & 3) * 0x2000) + 1];
tandy->ma++;
buffer->line[tandy->displine][(x << 4) + 8] =
buffer->line[tandy->displine][(x << 4) + 9] =
buffer->line[tandy->displine][(x << 4) + 10] =
buffer->line[tandy->displine][(x << 4) + 11] = tandy->array[((dat >> 12) & tandy->array[1]) + 16] + 16;
buffer->line[tandy->displine][(x << 4) + 12] =
buffer->line[tandy->displine][(x << 4) + 13] =
buffer->line[tandy->displine][(x << 4) + 14] =
buffer->line[tandy->displine][(x << 4) + 15] = tandy->array[((dat >> 8) & tandy->array[1]) + 16] + 16;
buffer->line[tandy->displine][(x << 4) + 16] =
buffer->line[tandy->displine][(x << 4) + 17] =
buffer->line[tandy->displine][(x << 4) + 18] =
buffer->line[tandy->displine][(x << 4) + 19] = tandy->array[((dat >> 4) & tandy->array[1]) + 16] + 16;
buffer->line[tandy->displine][(x << 4) + 20] =
buffer->line[tandy->displine][(x << 4) + 21] =
buffer->line[tandy->displine][(x << 4) + 22] =
buffer->line[tandy->displine][(x << 4) + 23] = tandy->array[(dat & tandy->array[1]) + 16] + 16;
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 8] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 9] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 10] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 11] = tandy->array[((dat >> 12) & tandy->array[1]) + 16];
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 12] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 13] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 14] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 15] = tandy->array[((dat >> 8) & tandy->array[1]) + 16];
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 16] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 17] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 18] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 19] = tandy->array[((dat >> 4) & tandy->array[1]) + 16];
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 20] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 21] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 22] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + 23] = tandy->array[(dat & tandy->array[1]) + 16];
}
}
else if (tandy->array[3] & 0x08) /*640x200x4 - this implementation is a complete guess!*/
@ -300,7 +300,7 @@ void tandy_poll(void *p)
{
chr = (dat >> 7) & 1;
chr |= ((dat >> 14) & 2);
buffer->line[tandy->displine][(x << 3) + 8 + c] = tandy->array[(chr & tandy->array[1]) + 16] + 16;
((uint32_t *)buffer32->line[tandy->displine])[(x << 3) + 8 + c] = tandy->array[(chr & tandy->array[1]) + 16];
dat <<= 1;
}
}
@ -314,31 +314,31 @@ void tandy_poll(void *p)
drawcursor = ((tandy->ma == ca) && tandy->con && tandy->cursoron);
if (tandy->mode & 0x20)
{
cols[1] = tandy->array[ ((attr & 15) & tandy->array[1]) + 16] + 16;
cols[0] = tandy->array[(((attr >> 4) & 7) & tandy->array[1]) + 16] + 16;
cols[1] = tandy->array[ ((attr & 15) & tandy->array[1]) + 16];
cols[0] = tandy->array[(((attr >> 4) & 7) & tandy->array[1]) + 16];
if ((tandy->blink & 16) && (attr & 0x80) && !drawcursor)
cols[1] = cols[0];
}
else
{
cols[1] = tandy->array[((attr & 15) & tandy->array[1]) + 16] + 16;
cols[0] = tandy->array[((attr >> 4) & tandy->array[1]) + 16] + 16;
cols[1] = tandy->array[((attr & 15) & tandy->array[1]) + 16];
cols[0] = tandy->array[((attr >> 4) & tandy->array[1]) + 16];
}
if (tandy->sc & 8)
{
for (c = 0; c < 8; c++)
buffer->line[tandy->displine][(x << 3) + c + 8] = cols[0];
((uint32_t *)buffer32->line[tandy->displine])[(x << 3) + c + 8] = cols[0];
}
else
{
for (c = 0; c < 8; c++)
buffer->line[tandy->displine][(x << 3) + c + 8] = cols[(fontdat[chr][tandy->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
((uint32_t *)buffer32->line[tandy->displine])[(x << 3) + c + 8] = cols[(fontdat[chr][tandy->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
}
// if (!((ma^(crtc[15]|(crtc[14]<<8)))&0x3FFF)) printf("Cursor match! %04X\n",ma);
if (drawcursor)
{
for (c = 0; c < 8; c++)
buffer->line[tandy->displine][(x << 3) + c + 8] ^= 15;
((uint32_t *)buffer32->line[tandy->displine])[(x << 3) + c + 8] ^= 0xffffff;
}
tandy->ma++;
}
@ -352,40 +352,40 @@ void tandy_poll(void *p)
drawcursor = ((tandy->ma == ca) && tandy->con && tandy->cursoron);
if (tandy->mode & 0x20)
{
cols[1] = tandy->array[ ((attr & 15) & tandy->array[1]) + 16] + 16;
cols[0] = tandy->array[(((attr >> 4) & 7) & tandy->array[1]) + 16] + 16;
cols[1] = tandy->array[ ((attr & 15) & tandy->array[1]) + 16];
cols[0] = tandy->array[(((attr >> 4) & 7) & tandy->array[1]) + 16];
if ((tandy->blink & 16) && (attr & 0x80) && !drawcursor)
cols[1] = cols[0];
}
else
{
cols[1] = tandy->array[((attr & 15) & tandy->array[1]) + 16] + 16;
cols[0] = tandy->array[((attr >> 4) & tandy->array[1]) + 16] + 16;
cols[1] = tandy->array[((attr & 15) & tandy->array[1]) + 16];
cols[0] = tandy->array[((attr >> 4) & tandy->array[1]) + 16];
}
tandy->ma++;
if (tandy->sc & 8)
{
for (c = 0; c < 8; c++)
buffer->line[tandy->displine][(x << 4) + (c << 1) + 8] =
buffer->line[tandy->displine][(x << 4) + (c << 1) + 1 + 8] = cols[0];
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + (c << 1) + 8] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[0];
}
else
{
for (c = 0; c < 8; c++)
buffer->line[tandy->displine][(x << 4) + (c << 1) + 8] =
buffer->line[tandy->displine][(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr][tandy->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + (c << 1) + 8] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr][tandy->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
}
if (drawcursor)
{
for (c = 0; c < 16; c++)
buffer->line[tandy->displine][(x << 4) + c + 8] ^= 15;
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + c + 8] ^= 0xffffff;
}
}
}
else if (!(tandy->mode& 16))
else if (!(tandy->mode & 16))
{
cols[0] = (tandy->col & 15) | 16;
col = (tandy->col & 16) ? 24 : 16;
cols[0] = tandy->col & 15;
col = (tandy->col & 16) ? 8 : 0;
if (tandy->mode & 4)
{
cols[1] = col | 3;
@ -411,8 +411,8 @@ void tandy_poll(void *p)
tandy->ma++;
for (c = 0; c < 8; c++)
{
buffer->line[tandy->displine][(x << 4) + (c << 1) + 8] =
buffer->line[tandy->displine][(x << 4) + (c << 1) + 1 + 8] = cols[dat >> 14];
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + (c << 1) + 8] =
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[dat >> 14];
dat <<= 2;
}
}
@ -420,7 +420,7 @@ void tandy_poll(void *p)
else
{
cols[0] = 0;
cols[1] = tandy->array[(tandy->col & tandy->array[1]) + 16] + 16;
cols[1] = tandy->array[(tandy->col & tandy->array[1]) + 16];
for (x = 0; x < tandy->crtc[1]; x++)
{
dat = (tandy->vram[((tandy->ma << 1) & 0x1fff) + ((tandy->sc & 1) * 0x2000)] << 8) |
@ -428,7 +428,7 @@ void tandy_poll(void *p)
tandy->ma++;
for (c = 0; c < 16; c++)
{
buffer->line[tandy->displine][(x << 4) + c + 8] = cols[dat >> 15];
((uint32_t *)buffer32->line[tandy->displine])[(x << 4) + c + 8] = cols[dat >> 15];
dat <<= 1;
}
}
@ -438,14 +438,14 @@ void tandy_poll(void *p)
{
if (tandy->array[3] & 4)
{
if (tandy->mode & 1) hline(buffer, 0, tandy->displine, (tandy->crtc[1] << 3) + 16, (tandy->array[2] & 0xf) + 16);
else hline(buffer, 0, tandy->displine, (tandy->crtc[1] << 4) + 16, (tandy->array[2] & 0xf) + 16);
if (tandy->mode & 1) hline(buffer32, 0, tandy->displine, (tandy->crtc[1] << 3) + 16, tandy->array[2] & 0xf);
else hline(buffer32, 0, tandy->displine, (tandy->crtc[1] << 4) + 16, tandy->array[2] & 0xf);
}
else
{
cols[0] = ((tandy->mode & 0x12) == 0x12) ? 0 : (tandy->col & 0xf) + 16;
if (tandy->mode & 1) hline(buffer, 0, tandy->displine, (tandy->crtc[1] << 3) + 16, cols[0]);
else hline(buffer, 0, tandy->displine, (tandy->crtc[1] << 4) + 16, cols[0]);
cols[0] = ((tandy->mode & 0x12) == 0x12) ? 0 : (tandy->col & 0xf);
if (tandy->mode & 1) hline(buffer32, 0, tandy->displine, (tandy->crtc[1] << 3) + 16, cols[0]);
else hline(buffer32, 0, tandy->displine, (tandy->crtc[1] << 4) + 16, cols[0]);
}
}
if (tandy->mode & 1) x = (tandy->crtc[1] << 3) + 16;
@ -454,10 +454,15 @@ void tandy_poll(void *p)
if (tandy->composite)
{
for (c = 0; c < x; c++)
buffer32->line[tandy->displine][c] = buffer->line[tandy->displine][c] & 0xf;
buffer32->line[tandy->displine][c] = ((uint32_t *)buffer32->line[tandy->displine])[c] & 0xf;
Composite_Process(tandy->mode, 0, x >> 2, buffer32->line[tandy->displine]);
}
else
{
for (c = 0; c < x; c++)
((uint32_t *)buffer32->line[tandy->displine])[c] = cgapal[((uint32_t *)buffer32->line[tandy->displine])[c] & 0xf];
}
tandy->sc = oldsc;
if (tandy->vc == tandy->crtc[7] && !tandy->sc)
@ -553,10 +558,7 @@ void tandy_poll(void *p)
// printf("Blit %i %i\n",firstline,lastline);
//printf("Xsize is %i\n",xsize);
if (tandy->composite)
video_blit_memtoscreen(0, tandy->firstline-4, 0, (tandy->lastline - tandy->firstline) + 8, xsize, (tandy->lastline - tandy->firstline) + 8);
else
video_blit_memtoscreen_8(0, tandy->firstline-4, xsize, (tandy->lastline - tandy->firstline) + 8);
video_blit_memtoscreen(0, tandy->firstline-4, 0, (tandy->lastline - tandy->firstline) + 8, xsize, (tandy->lastline - tandy->firstline) + 8);
frames++;
video_res_x = xsize - 16;