Merge pull request #512 from 86Box/bugfix/video_20191228

Bugfix/video 20191228
This commit is contained in:
OBattler
2019-12-28 05:51:53 +01:00
committed by GitHub
3 changed files with 27 additions and 37 deletions

View File

@@ -8,7 +8,7 @@
*
* Emulation of Tandy models 1000, 1000HX and 1000SL2.
*
* Version: @(#)m_tandy.c 1.0.10 2019/10/20
* Version: @(#)m_tandy.c 1.0.11 2019/12/28
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -74,11 +74,7 @@ typedef struct {
int crtcreg;
int array_index;
#if 0
uint8_t array[32];
#else
uint8_t array[256];
#endif
int memctrl;
uint8_t mode, col;
uint8_t stat;
@@ -95,13 +91,13 @@ typedef struct {
int con, coff,
cursoron,
blink;
int vsynctime;
int vsynctime;
int vadj;
uint16_t ma, maback;
uint64_t dispontime,
dispofftime;
pc_timer_t timer;
pc_timer_t timer;
int firstline,
lastline;
@@ -857,8 +853,8 @@ vid_poll(void *priv)
}
}
} else if (! (vid->mode & 16)) {
cols[0] = (vid->col & 15) | 16;
col = (vid->col & 16) ? 24 : 16;
cols[0] = (vid->col & 15);
col = (vid->col & 16) ? 8 : 0;
if (vid->mode & 4) {
cols[1] = col | 3;
cols[2] = col | 4;
@@ -872,6 +868,10 @@ vid_poll(void *priv)
cols[2] = col | 4;
cols[3] = col | 6;
}
cols[0] = vid->array[(cols[0] & vid->array[1]) + 16] + 16;
cols[1] = vid->array[(cols[1] & vid->array[1]) + 16] + 16;
cols[2] = vid->array[(cols[2] & vid->array[1]) + 16] + 16;
cols[3] = vid->array[(cols[3] & vid->array[1]) + 16] + 16;
for (x = 0; x < vid->crtc[1]; x++) {
dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000)] << 8) |
vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000) + 1];

View File

@@ -2798,14 +2798,14 @@ void mach64_hwcursor_draw(svga_t *svga, int displine)
if (!(dat & 2)) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add] = (dat & 1) ? col1 : col0;
else if ((dat & 3) == 3) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add] ^= 0xFFFFFF;
dat >>= 2;
if (!(dat & 2)) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add] = (dat & 1) ? col1 : col0;
else if ((dat & 3) == 3) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add] ^= 0xFFFFFF;
if (!(dat & 2)) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add + 1] = (dat & 1) ? col1 : col0;
else if ((dat & 3) == 3) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add + 1] ^= 0xFFFFFF;
dat >>= 2;
if (!(dat & 2)) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add] = (dat & 1) ? col1 : col0;
else if ((dat & 3) == 3) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add] ^= 0xFFFFFF;
if (!(dat & 2)) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add + 2] = (dat & 1) ? col1 : col0;
else if ((dat & 3) == 3) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add + 2] ^= 0xFFFFFF;
dat >>= 2;
if (!(dat & 2)) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add] = (dat & 1) ? col1 : col0;
else if ((dat & 3) == 3) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add] ^= 0xFFFFFF;
if (!(dat & 2)) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add + 3] = (dat & 1) ? col1 : col0;
else if ((dat & 3) == 3) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add + 3] ^= 0xFFFFFF;
dat >>= 2;
offset += 4;
}

View File

@@ -11,7 +11,7 @@
* This is intended to be used by another SVGA driver,
* and not as a card in it's own right.
*
* Version: @(#)vid_svga.c 1.0.39 2019/12/03
* Version: @(#)vid_svga.c 1.0.40 2019/12/28
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -1119,31 +1119,21 @@ svga_read_common(uint32_t addr, uint8_t linear, void *p)
addr &= svga->decode_mask;
/* standard VGA latched access */
if (linear) {
if (addr >= svga->vram_max)
return 0xff;
addr &= svga->vram_mask;
if (latch_addr >= svga->vram_max) {
for (i = 0; i < count; i++)
svga->latch.b[i] = 0xff;
} else {
latch_addr &= svga->vram_mask;
for (i = 0; i < count; i++)
svga->latch.b[i] = svga->vram[addr | i];
} else {
if (latch_addr >= svga->vram_max) {
for (i = 0; i < count; i++)
svga->latch.b[i] = 0xff;
} else {
latch_addr &= svga->vram_mask;
for (i = 0; i < count; i++)
svga->latch.b[i] = svga->vram[latch_addr | i];
}
if (addr >= svga->vram_max)
return 0xff;
addr &= svga->vram_mask;
svga->latch.b[i] = svga->vram[latch_addr | i];
}
if (addr >= svga->vram_max)
return 0xff;
addr &= svga->vram_mask;
if (svga->readmode) {
temp = 0xff;