`sixtypical` and `dcc6502-adapter` run under Python 3 by default.
Chris Pressey
2 years ago
0 | |
#!/usr/bin/env python
|
|
0 |
#!/usr/bin/env python3
|
1 | 1 |
|
2 | 2 |
from os.path import realpath, dirname, join
|
3 | 3 |
import sys
|
0 | |
#!/usr/bin/env python2
|
|
0 |
#!/usr/bin/env python3
|
1 | 1 |
|
2 | 2 |
# script that allows the binary output of sixtypical --output-format=c64-basic-prg --compile to be
|
3 | 3 |
# disassembled by https://github.com/tcarmelveilleux/dcc6502
|
|
7 | 7 |
from subprocess import check_output
|
8 | 8 |
from tempfile import NamedTemporaryFile
|
9 | 9 |
|
10 | |
bytes = sys.stdin.read()
|
|
10 |
bytes = sys.stdin.buffer.read()
|
11 | 11 |
|
12 | 12 |
bytes = bytes[14:]
|
13 | 13 |
|
|
16 | 16 |
f.write(bytes)
|
17 | 17 |
f.close()
|
18 | 18 |
|
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(';')]
|
20 | 22 |
lines = [re.sub(r'\s*\;.*$', '', line) for line in lines]
|
21 | 23 |
sys.stdout.write('\n'.join(lines))
|