|
|
| version 1.4, 2003/12/08 00:55:30 | version 1.7, 2004/03/30 08:48:46 |
|---|---|
| Line 46 static void IOOUTCALL pcm86_oa468(UINT p | Line 46 static void IOOUTCALL pcm86_oa468(UINT p |
| pcm86.wrtpos = 0; | pcm86.wrtpos = 0; |
| pcm86.realbuf = 0; | pcm86.realbuf = 0; |
| pcm86.virbuf = 0; | pcm86.virbuf = 0; |
| pcm86.write = 0; | |
| pcm86.reqirq = 0; | |
| pcm86.lastclock = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK; | pcm86.lastclock = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK; |
| pcm86.lastclock <<= 6; | pcm86.lastclock <<= 6; |
| } | } |
| if ((xchgbit & 0x10) && (!(val & 0x10))) { | |
| pcm86.write = 0; | |
| pcm86.reqirq = 0; | |
| } | |
| // サンプリングレート変更 | // サンプリングレート変更 |
| if (xchgbit & 7) { | if (xchgbit & 7) { |
| pcm86.rescue = pcm86rescue[val & 7] << pcm86.stepbit; | pcm86.rescue = pcm86rescue[val & 7] << pcm86.stepbit; |
| Line 61 static void IOOUTCALL pcm86_oa468(UINT p | Line 63 static void IOOUTCALL pcm86_oa468(UINT p |
| pcm86.lastclock = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK; | pcm86.lastclock = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK; |
| pcm86.lastclock <<= 6; | pcm86.lastclock <<= 6; |
| } | } |
| pcm86.write = 1; | |
| pcm86_setnextintr(); | pcm86_setnextintr(); |
| (void)port; | (void)port; |
| } | } |
| Line 120 static REG8 IOINPCALL pcm86_ia460(UINT p | Line 121 static REG8 IOINPCALL pcm86_ia460(UINT p |
| static REG8 IOINPCALL pcm86_ia466(UINT port) { | static REG8 IOINPCALL pcm86_ia466(UINT port) { |
| UINT32 nowclk; | |
| UINT32 past; | UINT32 past; |
| UINT32 cnt; | |
| UINT32 stepclock; | |
| REG8 ret; | REG8 ret; |
| sound_sync(); | past = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK; |
| nowclk = CPU_CLOCK + CPU_BASECLOCK - CPU_REMCLOCK; | past <<= 6; |
| nowclk <<= 6; | past -= pcm86.lastclock; |
| past = nowclk - pcm86.lastclock; | stepclock = pcm86.stepclock; |
| if (past >= pcm86.stepclock) { | if (past >= stepclock) { |
| RECALC_NOWCLKWAIT; | cnt = past / stepclock; |
| past = nowclk - pcm86.lastclock; | pcm86.lastclock += (cnt * stepclock); |
| past -= cnt * stepclock; | |
| if (pcm86.fifo & 0x80) { | |
| sound_sync(); | |
| RECALC_NOWCLKWAIT(cnt); | |
| } | |
| } | } |
| ret = ((past << 1) >= pcm86.stepclock)?1:0; | ret = ((past << 1) >= stepclock)?1:0; |
| if (pcm86.virbuf >= PCM86_LOGICALBUF) { // バッファフル | if (pcm86.virbuf >= PCM86_LOGICALBUF) { // バッファフル |
| ret |= 0x80; | ret |= 0x80; |
| } | } |
| Line 148 static REG8 IOINPCALL pcm86_ia468(UINT p | Line 155 static REG8 IOINPCALL pcm86_ia468(UINT p |
| REG8 ret; | REG8 ret; |
| ret = pcm86.fifo & (~0x10); | ret = pcm86.fifo & (~0x10); |
| #if 1 | |
| if (pcm86gen_intrq()) { | |
| ret |= 0x10; | |
| } | |
| #elif 1 // むしろこう? | |
| if (pcm86.fifo & 0x20) { | |
| sound_sync(); | |
| if (pcm86.virbuf <= pcm86.fifosize) { | |
| if (pcm86.write) { | |
| pcm86.write = 0; | |
| } | |
| else { | |
| ret |= 0x10; | |
| } | |
| } | |
| } | |
| #else | |
| if ((pcm86.write) && (pcm86.fifo & 0x20)) { | if ((pcm86.write) && (pcm86.fifo & 0x20)) { |
| // pcm86.write = 0; | // pcm86.write = 0; |
| sound_sync(); | sound_sync(); |
| Line 156 static REG8 IOINPCALL pcm86_ia468(UINT p | Line 180 static REG8 IOINPCALL pcm86_ia468(UINT p |
| ret |= 0x10; | ret |= 0x10; |
| } | } |
| } | } |
| #endif | |
| (void)port; | (void)port; |
| return(ret); | return(ret); |
| } | } |