[pypy-svn] r54868 - pypy/branch/gameboy-emulator/pypy/lang/gameboy

cami at codespeak.net cami at codespeak.net
Sat May 17 19:06:46 CEST 2008


Author: cami
Date: Sat May 17 19:06:46 2008
New Revision: 54868

Modified:
   pypy/branch/gameboy-emulator/pypy/lang/gameboy/cartridge.py
   pypy/branch/gameboy-emulator/pypy/lang/gameboy/timer.py
Log:
fixed some bugs


Modified: pypy/branch/gameboy-emulator/pypy/lang/gameboy/cartridge.py
==============================================================================
--- pypy/branch/gameboy-emulator/pypy/lang/gameboy/cartridge.py	(original)
+++ pypy/branch/gameboy-emulator/pypy/lang/gameboy/cartridge.py	Sat May 17 19:06:46 2008
@@ -385,7 +385,7 @@
             return 0xFF
         else:
             return MBC.read(self, address)
-
+        
     def write(self, address, data):
         if address <= 0x1FFF:  # 0000-1FFF
             self.write_ram_enable(address, data)
@@ -662,8 +662,10 @@
             elif self.ram_flag == 0x0A or self.ram_flag == 0x00:
                 if self.ramSize > 0:
                     return self.ram[self.ram_bank + (address & 0x1FFF)] & 0xFF
+                else:
+                    raise Exception("Invalid Ram Size %i" % self.ramSize)
         else:
-            MBC.read(self, address)
+            return MBC.read(self, address)
     
     def write(self, address, data):
         if address <= 0x1FFF: # 0000-1FFF

Modified: pypy/branch/gameboy-emulator/pypy/lang/gameboy/timer.py
==============================================================================
--- pypy/branch/gameboy-emulator/pypy/lang/gameboy/timer.py	(original)
+++ pypy/branch/gameboy-emulator/pypy/lang/gameboy/timer.py	Sat May 17 19:06:46 2008
@@ -102,7 +102,7 @@
         if (self.tima < 0) and (self.tima + count >= 0):
             self.tima = self.tma - count
             self.interrupt.raise_interrupt(constants.TIMER)
-            print self.interrupt.timer.is_pending(), self.interrupt.is_pending(constants.TIMER)
+            #print self.interrupt.timer.is_pending(), self.interrupt.is_pending(constants.TIMER)
         
 # CLOCK DRIVER -----------------------------------------------------------------
 



More information about the Pypy-commit mailing list