[pypy-svn] r60210 - in pypy/trunk/pypy/lang/gameboy: . debug

tverwaes at codespeak.net tverwaes at codespeak.net
Fri Nov 28 18:30:28 CET 2008


Author: tverwaes
Date: Fri Nov 28 18:30:28 2008
New Revision: 60210

Modified:
   pypy/trunk/pypy/lang/gameboy/debug/debug_comparator.py
   pypy/trunk/pypy/lang/gameboy/debug/debug_util.py
   pypy/trunk/pypy/lang/gameboy/debug/gameboy_debug_entry_point.py
   pypy/trunk/pypy/lang/gameboy/debug/gameboy_debug_parts.py
   pypy/trunk/pypy/lang/gameboy/video_mode.py
Log:
continuing to fix the debugger


Modified: pypy/trunk/pypy/lang/gameboy/debug/debug_comparator.py
==============================================================================
--- pypy/trunk/pypy/lang/gameboy/debug/debug_comparator.py	(original)
+++ pypy/trunk/pypy/lang/gameboy/debug/debug_comparator.py	Fri Nov 28 18:30:28 2008
@@ -42,14 +42,14 @@
             self.print_compare(name+" value at "+hex(address), \
                     expected[address], new[address])
     
-    def print_compare(self, msg, expected, got, output=False):
-        if expected != got:
+    def print_compare(self, msg, python, java, output=False):
+        if java != python:
             self.compare_failed = True
-            print "python: !!", msg, "expected:", expected, "got:", got, "!!"
+            print "python: !!", msg, "java:", java, "python:", python, "!!"
             
     
-    def print_mismatch(self, part, expected, got):
-        print "python:", str(part), "expected:", str(expected), "got:", str(got)
+    def print_mismatch(self, part, python, java):
+        print "python:", str(part), "java:", str(java), "python:", str(python)
         
         
     def compare_set(self, set, data, label=""):
@@ -133,9 +133,9 @@
     def compare(self, data):
         cmp = [
             ("ROM size",
-                    self.cartridge_manager.get_rom_size(), "ramSize"),
+                    self.cartridge_manager.get_rom_size(), "romSize"),
             ("RAM size", 
-                    self.cartridge_manager.get_ram_size(), "romSize"),
+                    self.cartridge_manager.get_ram_size(), "ramSize"),
             ("Memory Bank Type", 
                     self.cartridge_manager.get_memory_bank_type(), "type"),
             ("checksum", 
@@ -200,8 +200,8 @@
         self.print_registers(mapping, display_results)
             
     def print_registers(self, mapping, display_results):
+	    line = ""
 	    for i in range(len(display_results)):
-	        line = ""
 	        line += mapping[i][0].rjust(2) + ": "
 	        line += str(display_results[i][0]).rjust(3) + " | "
 	    print line
@@ -265,6 +265,7 @@
      
     @printframe("comparing video")   
     def compare(self, data):
+        print "Java video-mode:", data["stat"] & 3, "python:", self.video.status.get_mode()
         self.compare_video_memory(data)
         self.compare_registers(data)
         self.compare_other(data)
@@ -272,7 +273,7 @@
     @printframe("comparing memory")  
     def compare_video_memory(self, data):
         cmp = [
-            (" vram",   self.video.vram,    "vram"),
+            ("vram",    self.video.vram,    "vram"),
             ("oam",     self.video.oam,     "oam"),
             ("line",    self.video.line,    "line"),
             ("objects", self.video.objects, "objects"),
@@ -311,15 +312,15 @@
                     self.video.last_read_address, "last_read_address"),
             ("Last Write Address", 
                     self.video.last_write_address, "last_write_address"),
-            ("Last eritten Data", 
+            ("Last written Data", 
                     self.video.last_write_data, "last_write_data"),
-            ("Check wether emulated HBlank", 
+            ("Check whether emulated HBlank", 
                     self.video.emulated_hblank, "emulated_hblank"),
-            ("Check wether emulated OAM", 
+            ("Check whether emulated OAM", 
                     self.video.emulated_oam, "emulated_oam"),
-            ("Check wether emulated Transfer", 
+            ("Check whether emulated Transfer", 
                     self.video.emulated_transfer, "emulated_transfer"),
-            ("Check wether emulated VBLank", 
+            ("Check whether emulated VBLank", 
                     self.video.emulated_vblank, "emulated_vblank"),
         ]
         self.compare_set(cmp, data, label="video")

Modified: pypy/trunk/pypy/lang/gameboy/debug/debug_util.py
==============================================================================
--- pypy/trunk/pypy/lang/gameboy/debug/debug_util.py	(original)
+++ pypy/trunk/pypy/lang/gameboy/debug/debug_util.py	Fri Nov 28 18:30:28 2008
@@ -7,7 +7,7 @@
 #
 # ----------------------------------------------------------------------------
 
-DEBUG = True
+DEBUG = False
 DEBUG_PRINT_LOGS = True
 op_codes               = [0] * (0xFF+1)
 fetch_execute_op_codes = [0] * (0xFF+1)

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	Fri Nov 28 18:30:28 2008
@@ -23,7 +23,7 @@
 SOCKET_PORT = 55680
 skipExecs   = 22545
 skipExecs   = 2700
-skipExecs   = 0
+# skipExecs   = 0
 
 # ------------------------------------------------------------------------------
 
@@ -77,7 +77,7 @@
     #           " -classpath "+ (':'.join(JAVA_CLASSPATH)) +\
     #           " gameboy.platform.j2se.Main " + \
     #           filename + " "
-    # os.system(command)
+    os.system(command)
 
     
     

Modified: pypy/trunk/pypy/lang/gameboy/debug/gameboy_debug_parts.py
==============================================================================
--- pypy/trunk/pypy/lang/gameboy/debug/gameboy_debug_parts.py	(original)
+++ pypy/trunk/pypy/lang/gameboy/debug/gameboy_debug_parts.py	Fri Nov 28 18:30:28 2008
@@ -94,6 +94,5 @@
         Mode3.__init__(self, debug_video)    
        
     def emulate_transfer(self):
-        self.video.emulate_transfer = True
+        self.video.emulated_transfer = True
         Mode3.emulate_transfer(self)
-                    

Modified: pypy/trunk/pypy/lang/gameboy/video_mode.py
==============================================================================
--- pypy/trunk/pypy/lang/gameboy/video_mode.py	(original)
+++ pypy/trunk/pypy/lang/gameboy/video_mode.py	Fri Nov 28 18:30:28 2008
@@ -217,8 +217,8 @@
         if self.video.transfer:
             if self.video.display:
                 self.video.draw_line()
-                #print "mode 3 ", self.video.status.get_mode() 
             self.set_end()
+                #print "mode 3 ", self.video.status.get_mode() 
         else:
             self.video.status.set_mode(0)
-        
\ No newline at end of file
+        



More information about the Pypy-commit mailing list