[pypy-svn] r62568 - pypy/trunk/pypy/lang/gameboy

tverwaes at codespeak.net tverwaes at codespeak.net
Thu Mar 5 10:35:32 CET 2009


Author: tverwaes
Date: Thu Mar  5 10:35:32 2009
New Revision: 62568

Modified:
   pypy/trunk/pypy/lang/gameboy/sound.py
Log:
fixing syntax


Modified: pypy/trunk/pypy/lang/gameboy/sound.py
==============================================================================
--- pypy/trunk/pypy/lang/gameboy/sound.py	(original)
+++ pypy/trunk/pypy/lang/gameboy/sound.py	Thu Mar  5 10:35:32 2009
@@ -48,7 +48,7 @@
         pass
         
     def update_frequency_and_playback():
-        
+        pass
         
     def get_length(self):
         return self.length
@@ -193,10 +193,10 @@
             self.index += self.frequency
            # if (self.index & (0x1F << 22)) >= wave_pattern:
                 # output_terminal & 0x20 for the second SquareWaveChannel
-                if (output_terminal & 0x10) != 0:
-                    buffer[index + 0] -= self.volume
-                if (output_terminal & 0x01) != 0:
-                    buffer[index + 1] -= self.volume
+            if (output_terminal & 0x10) != 0:
+                buffer[index + 0] -= self.volume
+            if (output_terminal & 0x01) != 0:
+                buffer[index + 1] -= self.volume
             #else:
             #    if (output_terminal & 0x10) != 0:
             #        buffer[index + 0] += self.volume
@@ -283,7 +283,7 @@
     def update_audio(self):
         if (self.playback & 0x40) != 0 and self.length > 0:
             self.length-=1
-            self.enabled =  self.length <= 0:
+            self.enabled = self.length <= 0
              #self.output_enable &= ~0x04
 
     def mix_audio(self, buffer, length, output_terminal):
@@ -429,7 +429,7 @@
     def update_enabled(self):
         if (self.playback & 0x40) != 0 and self.length > 0:
             self.length-=1
-            self.enabled =  self.length <= 0:
+            self.enabled = self.length <= 0
             #self.output_enable &= ~0x08
                 
     def update_envelope_and_volume(self):
@@ -665,14 +665,14 @@
     def update_audio(self):
         if (self.output_enable & 0x80) == 0:
             return
-        for channel in self.channels
+        for channel in self.channels:
             if channel.enabled:
                 channel.update_audio()
 
     def mix_audio(self, buffer, length):
         if (self.output_enable & 0x80) == 0:
             return
-        for channel in self.channels
+        for channel in self.channels:
             if channel.enabled:
                 channel.mix_audio(buffer, length, self.output_terminal)
 



More information about the Pypy-commit mailing list