Implemented another SN76496/NCR8496 difference - latter can not update noise register on write with top bit clear.

This commit is contained in:
TomW 2015-12-18 21:06:01 +00:00
commit e82fd502c1

View file

@ -144,7 +144,7 @@ void sn76489_write(uint16_t addr, uint8_t data, void *p)
} }
else else
{ {
if ((sn76489->firstdat & 0x70) == 0x60) if ((sn76489->firstdat & 0x70) == 0x60 && (sn76489->type == SN76496))
{ {
if ((data & 4) != (sn76489->noise & 4) || sn76489->type == SN76496) if ((data & 4) != (sn76489->noise & 4) || sn76489->type == SN76496)
sn76489->shift = 0x4000; sn76489->shift = 0x4000;
@ -154,7 +154,7 @@ void sn76489_write(uint16_t addr, uint8_t data, void *p)
if (!sn76489->latch[0]) if (!sn76489->latch[0])
sn76489->latch[0] = 1024 << 6; sn76489->latch[0] = 1024 << 6;
} }
else else if ((sn76489->firstdat & 0x70) != 0x60)
{ {
sn76489->freqhi[sn76489->lasttone] = data & 0x7F; sn76489->freqhi[sn76489->lasttone] = data & 0x7F;
freq = sn76489->freqlo[sn76489->lasttone] | (sn76489->freqhi[sn76489->lasttone] << 4); freq = sn76489->freqlo[sn76489->lasttone] | (sn76489->freqhi[sn76489->lasttone] << 4);