stat -> status; improve MDA register decoding; add MDA CRTC, register and mode enums

This commit is contained in:
starfrost013
2025-06-11 17:37:15 +01:00
parent dd6f7746a9
commit 317a5b7ade
16 changed files with 220 additions and 147 deletions

View File

@@ -178,8 +178,8 @@ hercules_in(uint16_t addr, void *priv)
case 0x03ba:
ret = 0x70; /* Hercules ident */
ret |= (dev->lp_ff ? 2 : 0);
ret |= (dev->stat & 0x01);
if (dev->stat & 0x08)
ret |= (dev->status & 0x01);
if (dev->status & 0x08)
ret |= 0x80;
if ((ret & 0x81) == 0x80)
ret |= 0x08;
@@ -300,7 +300,7 @@ hercules_poll(void *priv)
if (!dev->linepos) {
timer_advance_u64(&dev->timer, dev->dispofftime);
dev->stat |= 1;
dev->status |= 1;
dev->linepos = 1;
scanline_old = dev->scanline;
@@ -380,7 +380,7 @@ hercules_poll(void *priv)
dev->scanline = scanline_old;
if (dev->vc == dev->crtc[7] && !dev->scanline)
dev->stat |= 8;
dev->status |= 8;
dev->displine++;
if (dev->displine >= 500)
dev->displine = 0;
@@ -388,13 +388,13 @@ hercules_poll(void *priv)
timer_advance_u64(&dev->timer, dev->dispontime);
if (dev->dispon)
dev->stat &= ~1;
dev->status &= ~1;
dev->linepos = 0;
if (dev->vsynctime) {
dev->vsynctime--;
if (!dev->vsynctime)
dev->stat &= ~8;
dev->status &= ~8;
}
if (dev->scanline == (dev->crtc[11] & 31) || ((dev->crtc[8] & 3) == 3 && dev->scanline == ((dev->crtc[11] & 31) >> 1))) {