SID2: fix chan osc overflow

This commit is contained in:
tildearrow 2024-09-21 18:23:43 -05:00
parent f3aa06e0a1
commit be883ed387
4 changed files with 7 additions and 1 deletions

View file

@ -17,6 +17,7 @@ if you find issues (e.g. bugs or annoyances), report them. links below.
- issues: https://github.com/tildearrow/furnace/issues
- discussion: https://github.com/tildearrow/furnace/discussions
- online manual: https://tildearrow.org/furnace/doc/v0.6.7/
- Furnace on Discord: https://discord.gg/QhA26dXD23
# notes

View file

@ -27,6 +27,7 @@ if you find issues (e.g. bugs or annoyances), report them. links below.
- issues: https://github.com/tildearrow/furnace/issues
- discussion: https://github.com/tildearrow/furnace/discussions
- online manual: https://tildearrow.org/furnace/doc/v0.6.7/
- Furnace on Discord: https://discord.gg/QhA26dXD23
# notes

View file

@ -17,6 +17,7 @@ if you find issues (e.g. bugs or annoyances), report them. links below.
- issues: https://github.com/tildearrow/furnace/issues
- discussion: https://github.com/tildearrow/furnace/discussions
- online manual: https://tildearrow.org/furnace/doc/v0.6.7/
- Furnace on Discord: https://discord.gg/QhA26dXD23
# notes

View file

@ -93,7 +93,10 @@ void DivPlatformSID2::acquire(short** buf, size_t len)
for(int j = 0; j < 3; j++)
{
oscBuf[j]->data[oscBuf[j]->needle++] = sid2->chan_out[j] / 4;
int co=sid2->chan_out[j]>>2;
if (co<-32768) co=-32768;
if (co>32767) co=32767;
oscBuf[j]->data[oscBuf[j]->needle++]=co;
}
}
}