|
|
| version 1.1, 2003/10/16 17:58:08 | version 1.3, 2003/10/21 11:22:05 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "memory.h" | |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "sound.h" | #include "sound.h" |
| #include "fmboard.h" | #include "fmboard.h" |
| CS4231CFG cs4231cfg; | |
| static const UINT16 cs4231samprate[] = { | static const UINT16 cs4231samprate[] = { |
| 8000, 5510, 16000, 11025, | 8000, 5510, 16000, 11025, |
| 27420, 18900, 32000, 22050, | 27420, 18900, 32000, 22050, |
| Line 18 static const BYTE dmairq[] = {0xff, 0x03 | Line 20 static const BYTE dmairq[] = {0xff, 0x03 |
| void cs4231_initialize(UINT rate) { | void cs4231_initialize(UINT rate) { |
| (void)rate; | cs4231cfg.rate = rate; |
| } | } |
| void cs4231_setvol(UINT vol) { | void cs4231_setvol(UINT vol) { |
| Line 42 void cs4231_dma(NEVENTITEM item) { | Line 44 void cs4231_dma(NEVENTITEM item) { |
| pic_setirq(0x0c); | pic_setirq(0x0c); |
| } | } |
| } | } |
| cnt = pc.realclock * 16 / opna_rate; | if (cs4231cfg.rate) { |
| nevent_set(NEVENT_CS4231, cnt, cs4231_dma, NEVENT_RELATIVE); | cnt = pc.realclock * 16 / cs4231cfg.rate; |
| nevent_set(NEVENT_CS4231, cnt, cs4231_dma, NEVENT_RELATIVE); | |
| } | |
| } | } |
| (void)item; | (void)item; |
| } | } |
| Line 54 BYTE DMACCALL cs4231dmafunc(BYTE func) { | Line 58 BYTE DMACCALL cs4231dmafunc(BYTE func) { |
| switch(func) { | switch(func) { |
| case DMAEXT_START: | case DMAEXT_START: |
| cnt = pc.realclock * 16 / opna_rate; | if (cs4231cfg.rate) { |
| nevent_set(NEVENT_CS4231, cnt, cs4231_dma, NEVENT_ABSOLUTE); | cnt = pc.realclock * 16 / cs4231cfg.rate; |
| nevent_set(NEVENT_CS4231, cnt, cs4231_dma, NEVENT_ABSOLUTE); | |
| } | |
| break; | break; |
| case DMAEXT_BREAK: | case DMAEXT_BREAK: |