diff --git a/.gitignore b/.gitignore index 33d34ea..14f666b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ __pycache__/ # Debug output -*.png -*.html +out/ diff --git a/README.md b/README.md index c1c1292..839d288 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ nv2a-trace can dump intermediate rendering steps like this: ![Screenshot of Burnout 3](https://i.imgur.com/a2GuIFz.png) -Currently, most output will be send to PNG files in the current folder. +Currently, most output will be send to PNG files in the "out" folder. Additionally a "debug.html" will be created which shows the captured commands. This output format is a temporary solution. Eventually there'll be one of the following: diff --git a/Trace.py b/Trace.py index d7e9c47..22a9578 100644 --- a/Trace.py +++ b/Trace.py @@ -1,3 +1,4 @@ +import os import struct import Texture @@ -8,7 +9,7 @@ flipStallCount = 0 -debugLog = "debug.html" +debugLog = os.path.join("out", "debug.html") def addHTML(xx): f = open(debugLog,"a") f.write("") @@ -99,7 +100,7 @@ def recordPGRAPHMethod(xbox, method, data): path = "command%d--tex_%d.png" % (commandCount, i) img = Texture.dumpTextureUnit(xbox, i) if img != None: - img.save(path) + img.save(os.path.join("out", path)) extraHTML += ['%s' % (path, path)] else: # Dump finished surface @@ -153,7 +154,7 @@ def recordPGRAPHMethod(xbox, method, data): if True: img = img.convert('RGB') - img.save(path) + img.save(os.path.join("out", path)) # Check for texture address changes for i in range(4): diff --git a/nv2a-trace.py b/nv2a-trace.py index 19dd947..de982e8 100755 --- a/nv2a-trace.py +++ b/nv2a-trace.py @@ -2,6 +2,13 @@ from xboxpy import * +# Create output folder +import os +try: + os.mkdir("out") +except: + pass + import time import signal import sys