The MDA now also honors font base, fixes #3261.

This commit is contained in:
OBattler
2023-08-22 17:12:16 +02:00
parent 7563c7625e
commit 13e5ab3157
3 changed files with 4 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ typedef struct mda_t {
int firstline;
int lastline;
int fontbase;
int linepos;
int displine;
int vc;

View File

@@ -1690,6 +1690,7 @@ vid_init_200(amstrad_t *ams)
mda_setcol(0xC0, 0, 1, 0);
cga->fontbase = (device_get_config_int("codepage") & 3) * 256;
mda->fontbase = cga->fontbase;
timer_add(&vid->timer, vid_poll_200, vid, 1);
mem_mapping_add(&vid->mda.mapping, 0xb0000, 0x08000,

View File

@@ -165,9 +165,9 @@ mda_poll(void *priv)
buffer32->line[mda->displine][(x * 9) + c] = mdacols[attr][blink][1];
} else {
for (c = 0; c < 8; c++)
buffer32->line[mda->displine][(x * 9) + c] = mdacols[attr][blink][(fontdatm[chr][mda->sc] & (1 << (c ^ 7))) ? 1 : 0];
buffer32->line[mda->displine][(x * 9) + c] = mdacols[attr][blink][(fontdatm[chr + mda->fontbase][mda->sc] & (1 << (c ^ 7))) ? 1 : 0];
if ((chr & ~0x1f) == 0xc0)
buffer32->line[mda->displine][(x * 9) + 8] = mdacols[attr][blink][fontdatm[chr][mda->sc] & 1];
buffer32->line[mda->displine][(x * 9) + 8] = mdacols[attr][blink][fontdatm[chr + mda->fontbase][mda->sc] & 1];
else
buffer32->line[mda->displine][(x * 9) + 8] = mdacols[attr][blink][0];
}