From 869ecc27889d166ae9fda0540a13d76f1c1537b5 Mon Sep 17 00:00:00 2001 From: luigi__ Date: Sat, 20 Jun 2009 13:55:56 +0000 Subject: [PATCH] Fixed PSG sound which would sometimes not play (regression). By the way, SPU.cpp should be cleaned up. Some parts are messy and it takes hours to get compiled. --- desmume/src/SPU.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/desmume/src/SPU.cpp b/desmume/src/SPU.cpp index 640db3c27..fd3a42556 100644 --- a/desmume/src/SPU.cpp +++ b/desmume/src/SPU.cpp @@ -510,10 +510,13 @@ void SPU_struct::KeyOn(int channel) default: break; } - if(thischan.double_totlength_shifted == 0) + if(thischan.format != 3) { - printf("INFO: Stopping channel %d due to zero length\n",channel); - thischan.status = CHANSTAT_STOPPED; + if(thischan.double_totlength_shifted == 0) + { + printf("INFO: Stopping channel %d due to zero length\n",channel); + thischan.status = CHANSTAT_STOPPED; + } } thischan.double_totlength_shifted = (double)(thischan.totlength << format_shift[thischan.format]);