src/mess/machine/isa_gus.c
| r14410 | r14411 | |
| 267 | 267 | } |
| 268 | 268 | if(m_voice[x].voice_ctrl & 0x20) |
| 269 | 269 | { // 16-bit PCM |
| 270 | | m_voice[x].sample = (INT8)((m_wave_ram[(current & 0xffffe)+1]) | ((m_wave_ram[current & 0xffffe])<<8)>>8); |
| 270 | m_voice[x].sample = (INT16)((m_wave_ram[current & 0xffffe]) | ((m_wave_ram[(current & 0xffffe)+1])<<8)); |
| 271 | 271 | } |
| 272 | 272 | else |
| 273 | 273 | { // 8-bit PCM |
| 274 | | m_voice[x].sample = (INT8)m_wave_ram[current & 0xfffff]; |
| 274 | m_voice[x].sample = (INT16)(m_wave_ram[current & 0xfffff] << 8); |
| 275 | 275 | } |
| 276 | 276 | // TODO: implement proper panning |
| 277 | | (*left) += ((m_voice[x].sample) * (vol/256)); |
| 278 | | (*right) += ((m_voice[x].sample) * (vol/256)); |
| 277 | (*left) += ((m_voice[x].sample) * (vol/65536.0)); |
| 278 | (*right) += ((m_voice[x].sample) * (vol/65536.0)); |
| 279 | 279 | left++; |
| 280 | 280 | right++; |
| 281 | 281 | if(m_voice[x].voice_ctrl & 0x40) // voice direction |
| r14410 | r14411 | |
| 283 | 283 | else |
| 284 | 284 | m_voice[x].current_addr += (m_voice[x].freq_ctrl >> 1); |
| 285 | 285 | #ifdef LOG_SOUND |
| 286 | | INT32 smp = (m_voice[x].sample) * (vol / 256); |
| 286 | INT32 smp = (m_voice[x].sample) * (vol / 65536.0); |
| 287 | 287 | fwrite(&smp,4,1,f); |
| 288 | 288 | #endif |
| 289 | 289 | } |