mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
mcd, fix pcm output level
This commit is contained in:
parent
97916e3361
commit
cce32a34da
1 changed files with 5 additions and 5 deletions
|
@ -89,10 +89,10 @@ void pcd_pcm_sync(unsigned int to)
|
|||
|
||||
addr = ch->addr;
|
||||
inc = ch->regs[2] + (ch->regs[3]<<8);
|
||||
mul_l = ((int)ch->regs[0] * (ch->regs[1] & 0xf)) >> (5+1);
|
||||
mul_r = ((int)ch->regs[0] * (ch->regs[1] >> 4)) >> (5+1);
|
||||
mul_l = (int)ch->regs[0] * (ch->regs[1] & 0xf);
|
||||
mul_r = (int)ch->regs[0] * (ch->regs[1] >> 4);
|
||||
|
||||
for (s = 0; s < steps; s++, addr = (addr + inc) & 0x7FFFFFF)
|
||||
for (s = 0; s < steps; s++, addr = (addr + inc) & 0x07FFFFFF)
|
||||
{
|
||||
smp = Pico_mcd->pcm_ram[addr >> PCM_STEP_SHIFT];
|
||||
|
||||
|
@ -109,8 +109,8 @@ void pcd_pcm_sync(unsigned int to)
|
|||
if (smp & 0x80)
|
||||
smp = -(smp & 0x7f);
|
||||
|
||||
out[s*2 ] += smp * mul_l; // max 128 * 119 = 15232
|
||||
out[s*2+1] += smp * mul_r;
|
||||
out[s*2 ] += (smp * mul_l) >> 5; // max 127 * 255 * 15 / 32 = 15180
|
||||
out[s*2+1] += (smp * mul_r) >> 5;
|
||||
}
|
||||
ch->addr = addr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue