Files
Main_MiSTer/support/atari8bit/asm/process_xex_loader.py
Wojciech Mostowski deb43cd870 Migrate Atari800/5200 FW to Main (#1101)
* WIP Adding Atari800 side of things

* WIP Migrated some functionality from .sv to here

* WIP XEX file loading works, clean-ups

* WIP UART/SIO interface beginning

* WIP Adding Atari800 drive emulator

* WIP First version of the drive emulator working with ATR and XEX files

* WIP ATX files are working

* WIP HDD is now mounted separately

* WIP PBI/HDD is working too

* Cleaning up and adding supporting Atari ASM files

* Updated versioning information in the Atari800 FW

* WIP Adding support for the Atari 5200 core

* Atari 5200 support complete

* Atari800: fixed SIO timing bugs

* Atari800: sorting out SIO timing issues still

* Atari800: eliminate OSD lock up possibilities

* Atari800: Improved XEX loader
2026-02-24 12:51:17 +08:00

41 lines
638 B
Python

#!/usr/bin/python3
f = open("xex_loader.o65", "rb")
loader = f.read()
f.close()
s = "const static uint8_t xex_loader[] =\n{\n\t"
i = 0
for b in loader:
s += f"0x{b:02X},"
i += 1
if i == len(loader):
s = s[:-1]
if i % 16 == 0:
s += "\n\t"
if i % 16 != 0:
s += "\n"
else:
s = s[:-1]
s += "};\n\n"
f = open("xex_loader.lab", "rt")
l = f.read().split("\n")
f.close()
for ll in l:
if ll[:11] == "read_status":
read_status = ll[17:19]
elif ll[:5] == "init1":
init1 = ll[11:13]
s += f"#define XEX_READ_STATUS 0x{read_status}\n"
s += f"#define XEX_INIT1 0x{init1}\n\n"
f = open("xex_loader.h", "wt")
f.write(s)
f.close()