summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2016-12-27 00:54:39 -0500
committer Vas Crabb <vas@vastheman.com>2016-12-27 17:50:16 +1100
commit9ed5e076fc04075404ccbf2fe902fe9405c01b85 (patch)
tree4889a669213fdd679b1e8dd88ddc3477fb34ffa5
parentbbeda6ad9910dbcf0a24e7afa099180e7d46ebe3 (diff)
archimds: finally correct audio frequency setting [R. Belmont]
Please promote this to master for 0.181!
-rw-r--r--src/mame/machine/archimds.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/mame/machine/archimds.cpp b/src/mame/machine/archimds.cpp
index 1706245b127..6afd88bf76f 100644
--- a/src/mame/machine/archimds.cpp
+++ b/src/mame/machine/archimds.cpp
@@ -1037,7 +1037,19 @@ WRITE32_MEMBER(archimedes_state::archimedes_vidc_w)
vidc_dynamic_res_change();
}
- else if(reg == 0xe0)
+ else if (reg == 0xc0)
+ {
+ m_vidc_regs[reg] = val&0xffff;
+
+ if (m_audio_dma_on)
+ {
+ double sndhz = 1000000.0f/(((m_vidc_regs[0xc0]&0xff)+2));
+ sndhz /= 8.0f;
+ m_snd_timer->adjust(attotime::zero, 0, attotime::from_hz(sndhz));
+ //printf("VIDC: sound freq to %d, sndhz = %f\n", (val & 0xff)-2, sndhz);
+ }
+ }
+ else if (reg == 0xe0)
{
m_vidc_bpp_mode = ((val & 0x0c) >> 2);
m_vidc_interlace = ((val & 0x40) >> 6);
@@ -1120,15 +1132,10 @@ WRITE32_MEMBER(archimedes_state::archimedes_memc_w)
{
//printf("MEMC: Starting audio DMA at %d uSec, buffer from %x to %x\n", ((m_vidc_regs[0xc0]&0xff)-2)*8, m_vidc_sndstart, m_vidc_sndend);
- #if 0 // more correct to manuals, but breaks ertictac/poizone
- m_snd_timer->adjust(attotime::zero, 0, attotime::from_usec(((m_vidc_regs[0xc0]&0xff)-2)*8));
-
- #else // original formula, definitely wrong in at least some cases
- double sndhz;
- /* FIXME: is the frequency correct? */
- sndhz = (250000.0 / 2) / (double)((m_vidc_regs[0xc0]&0xff)+2);
+ double sndhz = 1000000.0f/(((m_vidc_regs[0xc0]&0xff)+2));
+ sndhz /= 8.0f;
m_snd_timer->adjust(attotime::zero, 0, attotime::from_hz(sndhz));
- #endif
+ //printf("MEMC: audio DMA start, sound freq %d, sndhz = %f\n", (m_vidc_regs[0xc0] & 0xff)-2, sndhz);
m_vidc_sndcur = m_vidc_sndstart;
m_vidc_sndendcur = m_vidc_sndend;