make better

This commit is contained in:
Nicholas Orlowsky 2024-04-07 23:39:15 -05:00
parent fdd6553f11
commit f2c0935b60
Signed by: nickorlow
GPG key ID: 838827D8C4611687
128 changed files with 39530 additions and 530 deletions

21
gen_rom.py Normal file
View file

@ -0,0 +1,21 @@
import sys
def binary_to_strings(input_file, output_file):
with open(input_file, 'rb') as f_in:
with open(output_file, 'w') as f_out:
byte = f_in.read(1)
while byte:
byte_str = format(ord(byte), '08b') + '\n' # Convert byte to binary string
f_out.write(byte_str)
byte = f_in.read(1)
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: python script.py input_file output_file")
sys.exit(1)
input_file = sys.argv[1]
output_file = sys.argv[2]
binary_to_strings(input_file, output_file)
print("Bytes written to", output_file)