[pypy-svn] r58742 - pypy/dist/pypy/lang/gameboy/debug

cami at codespeak.net cami at codespeak.net
Tue Oct 7 14:52:08 CEST 2008


Author: cami
Date: Tue Oct  7 14:52:07 2008
New Revision: 58742

Modified:
   pypy/dist/pypy/lang/gameboy/debug/debug_rpc_xml_memory.py
   pypy/dist/pypy/lang/gameboy/debug/gameboy_debug_entry_point.py
   pypy/dist/pypy/lang/gameboy/debug/gameboy_debug_implementation.py
Log:
removed all gui and lib sdl dependency from the debug test


Modified: pypy/dist/pypy/lang/gameboy/debug/debug_rpc_xml_memory.py
==============================================================================
--- pypy/dist/pypy/lang/gameboy/debug/debug_rpc_xml_memory.py	(original)
+++ pypy/dist/pypy/lang/gameboy/debug/debug_rpc_xml_memory.py	Tue Oct  7 14:52:07 2008
@@ -287,7 +287,8 @@
     def compare_memory(self, name, expected, new):
         self.print_check(name+" length", len(expected), len(new))
         if len(expected) != len(new): return
-        for address in range(len(expected)):
+        # only check every 3rd in order to speed things up
+        for address in range(len(expected), 3):
            self.print_check(name+" value at "+hex(address), \
                             expected[address], new[address])
     

Modified: pypy/dist/pypy/lang/gameboy/debug/gameboy_debug_entry_point.py
==============================================================================
--- pypy/dist/pypy/lang/gameboy/debug/gameboy_debug_entry_point.py	(original)
+++ pypy/dist/pypy/lang/gameboy/debug/gameboy_debug_entry_point.py	Tue Oct  7 14:52:07 2008
@@ -17,7 +17,7 @@
 ROM_PATH    = str(py.magic.autopath().dirpath().dirpath())+"/rom"
 filename    = "/Users/cami/Ausbildung/08_UNIBE_FS/bachelor/docs/roms/DieMaus.gb"
 filename    = ROM_PATH + "/rom9/rom9.gb"
-SOCKET_PORT = 55686
+SOCKET_PORT = 55687
 skipExecs   = 22545
 skipExecs   = 0
 
@@ -38,13 +38,15 @@
     gameBoy = GameBoyDebugImplementation(SOCKET_PORT, skipExecs, DebugRpcXmlMemory)
     try:
         gameBoy.load_cartridge_file(str(filename))
-    except:
+    except Exception, error:
         gameBoy.load_cartridge_file(str(filename), verify=False)
         print "Cartridge is Corrupted!"
     try:
+    	pdb.set_trace()
         gameBoy.mainLoop()
-    except:
+    except Exception, error:
         print "stopped"
+        print error
 
 # ------------------------------------------------------------------------------ 
     

Modified: pypy/dist/pypy/lang/gameboy/debug/gameboy_debug_implementation.py
==============================================================================
--- pypy/dist/pypy/lang/gameboy/debug/gameboy_debug_implementation.py	(original)
+++ pypy/dist/pypy/lang/gameboy/debug/gameboy_debug_implementation.py	Tue Oct  7 14:52:07 2008
@@ -13,11 +13,13 @@
 class GameBoyDebugImplementation(GameBoyImplementation):
     
     def __init__(self, debuggerPort, skipExecs=0, memory_class=DebugSocketMemory):
-        GameBoy.__init__(self)
+        GameBoyImplementation.__init__(self)
         self.cpu = DebugCPU(self.interrupt, self)
         self.init_sdl()
         self.memory = memory_class(self, debuggerPort, skipExecs)
         
+    def init_sdl(self):
+        pass;
     
     def create_drivers(self):
         # make sure only the debug drivers are implemented
@@ -25,9 +27,12 @@
         self.joypad_driver = JoypadDriverDebugImplementation()
         self.video_driver  = VideoDriverDebugImplementation()
         self.sound_driver  = SoundDriverImplementation()
-   
+        
+    def emulate_cycle(self):
+       	self.emulate(constants.GAMEBOY_CLOCK >> 2)
    
     def handle_execution_error(self, error):
+    	GameBoyImplementation.handle_execution_error(self, error)
     	print error
         print "closing socket connections"
         pdb.set_trace()



More information about the Pypy-commit mailing list