Mother 3 fix, refined to not break Metroid Fusion or hopefully anything else

This commit is contained in:
kode54 2013-10-22 01:17:06 +00:00
parent 12172db5ac
commit 2404d08f1f
1 changed files with 6 additions and 2 deletions

View File

@ -183,11 +183,15 @@ void Gba_Pcm_Fifo::timer_overflowed( int which_timer )
{ {
if ( which_timer == timer && enabled ) if ( which_timer == timer && enabled )
{ {
if ( count <= 16 ) /* Mother 3 fix, refined to not break Metroid Fusion */
if ( count == 16 || count == 0 )
{ {
// Need to fill FIFO // Need to fill FIFO
int saved_count = count;
CPUCheckDMA( 3, which ? 4 : 2 ); CPUCheckDMA( 3, which ? 4 : 2 );
if ( count == 0 ) // Fixes Mother 3 if ( saved_count == 0 && count == 16 )
CPUCheckDMA( 3, which ? 4 : 2 );
if ( count == 0 )
{ {
// Not filled by DMA, so fill with 16 bytes of silence // Not filled by DMA, so fill with 16 bytes of silence
int reg = which ? FIFOB_L : FIFOA_L; int reg = which ? FIFOB_L : FIFOA_L;