Skip to content

Commit

Permalink
ROMS and tools
Browse files Browse the repository at this point in the history
  • Loading branch information
rejunity committed Oct 1, 2024
1 parent cb56844 commit 25e74fd
Show file tree
Hide file tree
Showing 22 changed files with 17,565 additions and 0 deletions.
3 changes: 3 additions & 0 deletions roms/asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
./dasm $1.asm -f3 -s$1.sym -o$1.bin -l$1.lst
python convhex.py $1 >rom.mem

3 changes: 3 additions & 0 deletions roms/asm2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dasm $1.asm -f3 -s$1.sym -o$1.bin
python3 convhex.py $1 >rom.mem

Binary file not shown.
Binary file not shown.
Binary file not shown.
31 changes: 31 additions & 0 deletions roms/convhex.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import binascii
import sys

# Ensure there's at least one argument passed to avoid IndexError
if len(sys.argv) < 2:
print("Usage: script.py <filename>")
sys.exit(1)

i = 0
filename = sys.argv[1] + '.bin'
with open(filename, 'rb') as f:
content = f.read()
for x in content:
# Convert the integer to a bytes object of length 1
# before passing it to hexlify
print(binascii.hexlify(bytes([x])).decode('utf-8'))
i += 1
if i == 4096:
break

#import binascii
#import sys
#i = 0
#filename = sys.argv[1] + '.bin'
#with open(filename, 'rb') as f:
# content = f.read()
# for x in content:
# print(binascii.hexlify(x))
# i += 1
# if i == 4096:
# break
Binary file added roms/pong.bin
Binary file not shown.
Loading

0 comments on commit 25e74fd

Please sign in to comment.