[pypy-svn] r56992 - pypy/dist/pypy/translator/goal

cami at codespeak.net cami at codespeak.net
Tue Aug 5 10:29:20 CEST 2008


Author: cami
Date: Tue Aug  5 10:29:19 2008
New Revision: 56992

Added:
   pypy/dist/pypy/translator/goal/targetgbprofiling.py
Modified:
   pypy/dist/pypy/translator/goal/targetgbimplementation.py
Log:
added profiling target wich uses a slightly different cpu (ProfilingCPU)


Modified: pypy/dist/pypy/translator/goal/targetgbimplementation.py
==============================================================================
--- pypy/dist/pypy/translator/goal/targetgbimplementation.py	(original)
+++ pypy/dist/pypy/translator/goal/targetgbimplementation.py	Tue Aug  5 10:29:19 2008
@@ -1,7 +1,7 @@
 import os
 import py
 import pdb
-from pypy.lang.gameboy.gameboyImplementation import GameBoyImplementation
+from pypy.lang.gameboy.gameboy_implementation import GameBoyImplementation
 
 
 ROM_PATH = str(py.magic.autopath().dirpath().dirpath().dirpath())+"/lang/gameboy/rom"
@@ -20,7 +20,10 @@
     except:
         print "Corrupt Cartridge"
         gameBoy.load_cartridge_file(str(filename), verify=False)
-    gameBoy.mainLoop()
+    try:
+        gameBoy.mainLoop()
+    except:
+        pass
     #pdb.runcall(gameBoy.mainLoop)
     return 0
     
@@ -32,9 +35,3 @@
 
 def test_target():
     entry_point(["b", ROM_PATH+"/rom9/rom9.gb"])
-    
-
-
-#from AppKit import NSApplication
-#NSApplication.sharedApplication()
-#entry_point()

Added: pypy/dist/pypy/translator/goal/targetgbprofiling.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/translator/goal/targetgbprofiling.py	Tue Aug  5 10:29:19 2008
@@ -0,0 +1,37 @@
+import os
+import py
+import pdb
+from pypy.lang.gameboy.profiling.gameboy_profiling_implementation import GameBoyProfilingImplementation
+
+
+ROM_PATH = str(py.magic.autopath().dirpath().dirpath().dirpath())+"/lang/gameboy/rom"
+
+
+def entry_point(argv=None):
+    if argv is not None and len(argv) > 1:
+        filename = argv[1]
+    else:
+        pos = str(9)
+        filename = ROM_PATH+"/rom"+pos+"/rom"+pos+".gb"
+    print "loading rom: ", str(filename)
+    gameBoy = GameBoyProfilingImplementation()
+    try:
+        gameBoy.load_cartridge_file(str(filename))
+    except:
+        print "Corrupt Cartridge"
+        gameBoy.load_cartridge_file(str(filename), verify=False)
+    try:
+        gameBoy.mainLoop()
+    except:
+        pass
+    #pdb.runcall(gameBoy.mainLoop)
+    return 0
+    
+
+# _____ Define and setup target ___
+
+def target(*args):
+    return entry_point, None
+
+def test_target():
+    entry_point(["b", ROM_PATH+"/rom9/rom9.gb"])



More information about the Pypy-commit mailing list