git @ Cat's Eye Technologies SixtyPical / b38b94e
`sixtypical` and `dcc6502-adapter` run under Python 3 by default. Chris Pressey 2 years ago
2 changed file(s) with 6 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
0 #!/usr/bin/env python
0 #!/usr/bin/env python3
11
22 from os.path import realpath, dirname, join
33 import sys
0 #!/usr/bin/env python2
0 #!/usr/bin/env python3
11
22 # script that allows the binary output of sixtypical --output-format=c64-basic-prg --compile to be
33 # disassembled by https://github.com/tcarmelveilleux/dcc6502
77 from subprocess import check_output
88 from tempfile import NamedTemporaryFile
99
10 bytes = sys.stdin.read()
10 bytes = sys.stdin.buffer.read()
1111
1212 bytes = bytes[14:]
1313
1616 f.write(bytes)
1717 f.close()
1818
19 lines = [line for line in check_output("dcc6502 -o 2061 {}".format(filename), shell=True).split('\n') if line and not line.startswith(';')]
19 output = check_output("dcc6502 -o 2061 {}".format(filename), shell=True)
20 output_lines = output.decode('utf-8').split('\n')
21 lines = [line for line in output_lines if line and not line.startswith(';')]
2022 lines = [re.sub(r'\s*\;.*$', '', line) for line in lines]
2123 sys.stdout.write('\n'.join(lines))