src/mess/machine/isa_gus.c
| r14420 | r14421 | |
| 228 | 228 | for(y=samples-1; y>=0; y--) |
| 229 | 229 | { |
| 230 | 230 | UINT32 current = m_voice[x].current_addr >> 9; |
| 231 | // TODO: implement proper panning |
| 232 | (*left) += ((m_voice[x].sample) * (vol/65536.0)); |
| 233 | (*right) += ((m_voice[x].sample) * (vol/65536.0)); |
| 234 | left++; |
| 235 | right++; |
| 231 | 236 | if((!(m_voice[x].voice_ctrl & 0x40)) && (m_voice[x].current_addr >= m_voice[x].end_addr) && !m_voice[x].rollover && !(m_voice[x].voice_ctrl & 0x01)) |
| 232 | 237 | { |
| 233 | 238 | if(m_voice[x].vol_ramp_ctrl & 0x04) |
| r14420 | r14421 | |
| 240 | 245 | { |
| 241 | 246 | if(!(m_voice[x].voice_ctrl & 0x08)) |
| 242 | 247 | m_voice[x].voice_ctrl |= 0x01; |
| 248 | else |
| 243 | 249 | { |
| 244 | 250 | if(m_voice[x].voice_ctrl & 0x10) |
| 245 | 251 | m_voice[x].voice_ctrl |= 0x40; // change direction |
| r14420 | r14421 | |
| 263 | 269 | // end voice, unless looping |
| 264 | 270 | if(!(m_voice[x].voice_ctrl & 0x08)) |
| 265 | 271 | m_voice[x].voice_ctrl |= 0x01; |
| 272 | else |
| 266 | 273 | { |
| 267 | 274 | if(m_voice[x].voice_ctrl & 0x10) |
| 268 | 275 | m_voice[x].voice_ctrl &= ~0x40; // change direction |
| r14420 | r14421 | |
| 281 | 288 | { // 8-bit PCM |
| 282 | 289 | m_voice[x].sample = (INT16)(m_wave_ram[current & 0xfffff] << 8); |
| 283 | 290 | } |
| 284 | | // TODO: implement proper panning |
| 285 | | (*left) += ((m_voice[x].sample) * (vol/65536.0)); |
| 286 | | (*right) += ((m_voice[x].sample) * (vol/65536.0)); |
| 287 | | left++; |
| 288 | | right++; |
| 289 | 291 | if(m_voice[x].voice_ctrl & 0x40) // voice direction |
| 290 | 292 | m_voice[x].current_addr -= (m_voice[x].freq_ctrl >> 1); |
| 291 | 293 | else |
| r14420 | r14421 | |
| 688 | 690 | m_dma_dram_ctrl = data & 0xbf; |
| 689 | 691 | m_dma_16bit = data & 0x40; |
| 690 | 692 | if(data & 0x01) |
| 691 | | m_dmatimer->adjust(attotime::zero,0,attotime::from_nsec(500)); // a guess for now |
| 693 | m_dmatimer->adjust(attotime::zero,0,attotime::from_nsec(11489)); // based on 680Kb/sec mentioned in UltraMID docs |
| 692 | 694 | else |
| 693 | 695 | m_dmatimer->adjust(attotime::zero,0,attotime::never); // stop transfer |
| 694 | 696 | } |