From e82fd502c153a2a693b5129fe002765c66ee5982 Mon Sep 17 00:00:00 2001 From: TomW Date: Fri, 18 Dec 2015 21:06:01 +0000 Subject: [PATCH] Implemented another SN76496/NCR8496 difference - latter can not update noise register on write with top bit clear. --- src/sound_sn76489.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sound_sn76489.c b/src/sound_sn76489.c index ee7542e..c854667 100644 --- a/src/sound_sn76489.c +++ b/src/sound_sn76489.c @@ -144,7 +144,7 @@ void sn76489_write(uint16_t addr, uint8_t data, void *p) } else { - if ((sn76489->firstdat & 0x70) == 0x60) + if ((sn76489->firstdat & 0x70) == 0x60 && (sn76489->type == SN76496)) { if ((data & 4) != (sn76489->noise & 4) || sn76489->type == SN76496) sn76489->shift = 0x4000; @@ -154,7 +154,7 @@ void sn76489_write(uint16_t addr, uint8_t data, void *p) if (!sn76489->latch[0]) sn76489->latch[0] = 1024 << 6; } - else + else if ((sn76489->firstdat & 0x70) != 0x60) { sn76489->freqhi[sn76489->lasttone] = data & 0x7F; freq = sn76489->freqlo[sn76489->lasttone] | (sn76489->freqhi[sn76489->lasttone] << 4);