mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-16 17:45:10 +00:00
fix popping ADPCM samples in Neo Geo
finally!
This commit is contained in:
parent
00b42767de
commit
d92e91c5d8
1 changed files with 4 additions and 2 deletions
|
@ -1305,7 +1305,7 @@ void DivEngine::renderSamples() {
|
||||||
int index=0;
|
int index=0;
|
||||||
int prevsample=0;
|
int prevsample=0;
|
||||||
int previndex=0;
|
int previndex=0;
|
||||||
for (unsigned int j=0; j<s->rendLength; j++) {
|
for (unsigned int j=0; j<s->adpcmRendLength*2; j++) {
|
||||||
unsigned char encoded=0;
|
unsigned char encoded=0;
|
||||||
int tempstep=0;
|
int tempstep=0;
|
||||||
|
|
||||||
|
@ -1313,7 +1313,7 @@ void DivEngine::renderSamples() {
|
||||||
index=previndex;
|
index=previndex;
|
||||||
step=adSteps[index];
|
step=adSteps[index];
|
||||||
|
|
||||||
short sample=(s->depth==16)?(s->rendData[j]>>4):(s->rendData[j]<<4);
|
short sample=(j<s->rendLength)?((s->depth==16)?(s->rendData[j]>>4):(s->rendData[j]<<4)):0;
|
||||||
diff=sample-predsample;
|
diff=sample-predsample;
|
||||||
if (diff>=0) {
|
if (diff>=0) {
|
||||||
encoded=0;
|
encoded=0;
|
||||||
|
@ -1350,6 +1350,8 @@ void DivEngine::renderSamples() {
|
||||||
prevsample=predsample;
|
prevsample=predsample;
|
||||||
previndex=index;
|
previndex=index;
|
||||||
|
|
||||||
|
printf("%d: O %d E %d\n",j,sample,predsample);
|
||||||
|
|
||||||
if (j&1) {
|
if (j&1) {
|
||||||
s->adpcmRendData[j>>1]|=encoded;
|
s->adpcmRendData[j>>1]|=encoded;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue