[pypy-svn] r59205 - in pypy/dist/pypy/lang/gameboy: . debug

cami at codespeak.net cami at codespeak.net
Sat Oct 18 12:38:47 CEST 2008


Author: cami
Date: Sat Oct 18 12:38:47 2008
New Revision: 59205

Modified:
   pypy/dist/pypy/lang/gameboy/debug/debug.py
   pypy/dist/pypy/lang/gameboy/timer.py
Log:
cleanup up debug file


Modified: pypy/dist/pypy/lang/gameboy/debug/debug.py
==============================================================================
--- pypy/dist/pypy/lang/gameboy/debug/debug.py	(original)
+++ pypy/dist/pypy/lang/gameboy/debug/debug.py	Sat Oct 18 12:38:47 2008
@@ -89,6 +89,7 @@
 CHECKED_OP_CODES       = [0x00]
 CHECKED_FETCH_OP_CODES = []
 BAR_WIDTH = 79
+PRINT_OPCODE=True
 
 def log(opCode, is_fetch_execute=False):
     global COUNT, op_codes, fetch_execute_op_codes
@@ -132,17 +133,19 @@
 def print_results():
     global COUNT, op_codes, fetch_execute_op_codes
     
-    codes = zip(map(lambda x: "%4s" % hex(x), range(len(op_codes))), op_codes)
-    
-    fetch_exec_keys = map(lambda x: "%4s %4s" % (hex(x[0]), hex(x[1])), 
-                            zip([0x83]*len(fetch_execute_op_codes),
-                                range(len(fetch_execute_op_codes))))
+    print_function = (lambda x: "%4s" % hex(x))
+    codes = zip(map( print_function, range(len(op_codes))), op_codes)
     
+    print_function = (lambda x:  "%4s %4s" % (hex(x[0]), hex(x[1])))
+    opcode_range = range(len(fetch_execute_op_codes))
+    arguments = zip([0x83]  * len(fetch_execute_op_codes), opcode_range)
+    fetch_exec_keys = map( print_function, opcode_range, arguments )
+	# Append the fetchexecuted opcodes to the list
     codes.extend(zip(fetch_exec_keys, fetch_execute_op_codes))
     
     codes = sorted(codes, key=operator.itemgetter(1))
     for code in codes:
         if code[1] != 0:
-            print "%8s : %s" % (code[0], code[1])
+            print "%8s \t %s" % (code[0], code[1])
 
     
\ No newline at end of file

Modified: pypy/dist/pypy/lang/gameboy/timer.py
==============================================================================
--- pypy/dist/pypy/lang/gameboy/timer.py	(original)
+++ pypy/dist/pypy/lang/gameboy/timer.py	Sat Oct 18 12:38:47 2008
@@ -156,5 +156,5 @@
         pass
     
     def get_time(self):
-        return int(time.time()*1000)
+        return (time.time()*1000)
         



More information about the Pypy-commit mailing list