workaround a problem with the harmattan gcc
[drnoksnes] / apu.cpp
diff --git a/apu.cpp b/apu.cpp
index f86acaa..90b1802 100644 (file)
--- a/apu.cpp
+++ b/apu.cpp
@@ -45,9 +45,6 @@
 #include "soundux.h"
 #include "cpuexec.h"
 
-/* For note-triggered SPC dump support */
-//#include "snapshot.h"
-
 //extern int NoiseFreq [32];
 #ifdef DEBUGGER
 void S9xTraceSoundDSP (const char *s, int i1 = 0, int i2 = 0, int i3 = 0,
@@ -419,8 +416,6 @@ EXTERN_C uint8 APUROM [64];
 
 void S9xResetAPU ()
 {
-//    Settings.APUEnabled = Settings.NextAPUEnabled;
-
     memset (IAPU.RAM, Settings.APURAMInitialValue, 0x10000);
     //memset (IAPU.ShadowRAM, Settings.APURAMInitialValue, 0x10000);
     
@@ -479,18 +474,6 @@ void S9xSetAPUDSP (uint8 byte)
        static uint8 KeyOn;
        static uint8 KeyOnPrev;
     int i;
-    
-/*    char str[64];
-    if (byte!=0)
-    {
-               sprintf(str,"fr : %d\nwrite dsp %d\ncpu cycle=%d pc=%04X",framecpto,byte,CPU.Cycles,CPU.PC-CPU.PCBase);
-               S9xMessage(0,0,str);
-               gp32_pause();
-       }*/
-
-       //extern uint8 spc_dump_dsp[0x100];
-
-       //spc_dump_dsp[reg] = byte;
 
     switch (reg)
     {
@@ -541,10 +524,9 @@ void S9xSetAPUDSP (uint8 byte)
            uint8 mask = 1;
            for (int c = 0; c < 8; c++, mask <<= 1)
            {
-               int type;
-               if (byte & mask)
+               uint8 bit = byte & mask;
+               if (bit)
                {
-                   type = SOUND_NOISE;
 #ifdef DEBUGGER
                    if (Settings.TraceSoundDSP)
                    {
@@ -554,10 +536,10 @@ void S9xSetAPUDSP (uint8 byte)
                            S9xTraceSoundDSP ("%d(on),", c);
                    }
 #endif
+                       S9xSetSoundType(c, SOUND_NOISE);
                }
                else
                {
-                   type = SOUND_SAMPLE;
 #ifdef DEBUGGER
                    if (Settings.TraceSoundDSP)
                    {
@@ -565,8 +547,8 @@ void S9xSetAPUDSP (uint8 byte)
                            S9xTraceSoundDSP ("%d(off),", c);
                    }
 #endif
+                       S9xSetSoundType(c, SOUND_SAMPLE);
                }
-               S9xSetSoundType (c, type);
            }
 #ifdef DEBUGGER
            if (Settings.TraceSoundDSP)
@@ -713,7 +695,7 @@ void S9xSetAPUDSP (uint8 byte)
                S9xTraceSoundDSP ("\n");
 #endif
        }
-       //spc_is_dumping_temp = byte;
+
        return;
        
     case APU_VOL_LEFT + 0x00: