[pypy-svn] r60231 - pypy/trunk/pypy/lang/gameboy/debug

cami at codespeak.net cami at codespeak.net
Sun Nov 30 00:20:19 CET 2008


Author: cami
Date: Sun Nov 30 00:20:19 2008
New Revision: 60231

Modified:
   pypy/trunk/pypy/lang/gameboy/debug/gameboy_debug_entry_point.py
Log:
renamed variable
added skip_count dialog

Modified: pypy/trunk/pypy/lang/gameboy/debug/gameboy_debug_entry_point.py
==============================================================================
--- pypy/trunk/pypy/lang/gameboy/debug/gameboy_debug_entry_point.py	(original)
+++ pypy/trunk/pypy/lang/gameboy/debug/gameboy_debug_entry_point.py	Sun Nov 30 00:20:19 2008
@@ -14,10 +14,10 @@
 ROM_PATH    = str(py.magic.autopath().dirpath().dirpath())+"/rom"
 filename    = ROM_PATH + "/rom9/rom9.gb"
 SOCKET_PORT = 55682
-skipExecs   = 999999
-#skipExecs   = 22545
-#skipExecs   = 2700
-# skipExecs   = 0
+skip_count   = 6150
+#skip_count   = 22545
+#skip_count   = 2700
+# skip_count   = 0
 
 # ------------------------------------------------------------------------------
 
@@ -28,12 +28,21 @@
         filename = ROM_PATH+"/rom"+pos+"/rom"+pos+".gb"
     print "loading rom: ", str(filename)
     
+def ask_for_skip_count():
+    print ">> enter initial skip amount:"
+    read = sys.stdin.readline()
+    try:
+        if int(read) > 0:
+            skip_count = int(read)
+    except Exception:
+        skip_count = 0
+        
 # ------------------------------------------------------------------------------
    
 
 def start_python_version():
-    global filename, skipExecs
-    gameBoy = GameBoyDebugImplementation(SOCKET_PORT, skipExecs, DebugRpcXmlConnection)
+    global filename, skip_count
+    gameBoy = GameBoyDebugImplementation(SOCKET_PORT, skip_count, DebugRpcXmlConnection)
     try:
         gameBoy.load_cartridge_file(str(filename))
     except Exception, error:
@@ -65,7 +74,7 @@
               " gameboy.platform.debug.MainDebug " + \
               filename + " " + \
               str(SOCKET_PORT) + " " + \
-              str(skipExecs)
+              str(skip_count)
     print command
     # command = "java" + \
     #           " -classpath "+ (':'.join(JAVA_CLASSPATH)) +\
@@ -77,6 +86,7 @@
     
 # START ========================================================================
 parse_file_name()
+ask_for_skip_count()
 threading.Timer(1, start_java_version    ).start()
 threading.Timer(0, start_python_version()).start()
 



More information about the Pypy-commit mailing list