1
0
mirror of synced 2026-01-31 14:03:02 +00:00

Many fixes and improvements to the BIOS Extension ROM. (#33)

* Revert "Uploaded_2_9_2025"

This reverts commit ec79bbdbc9.

* Fixing DEBUG_IO builds.

* Make the IO port base a define.

* Fix CPU test to properly handle 808x vs V20.

* Improve timeout management logic.

* Improve SD Card initialization logic.

* Implement INT18h bootstrapping.

* Implementing a different test for processor type.

* Allow use with another fixed drive (eg: ESDI drive).

* Allow swapping driver ID between the BIOS disk and XTMax.

* Fix address of the ROM segment.

* Fixing missing STI at the top of the handler.

* Major rework of IO to use MOVSW.

* More code reorg and auto-detecting second drive.

* Update XTSD to use MOVSW.

* Add diagnostics program.

* Workaround for MS-DOS strange handling of interrupts.

* Use a lookup table for the memory map.

* Make the BootROM relocatable.

* Some more refactor of the Teensy code.
This commit is contained in:
Matthieu Bucchianeri
2025-02-17 15:11:37 -08:00
committed by GitHub
parent ec79bbdbc9
commit fe8385da08
15 changed files with 1199 additions and 456 deletions

View File

@@ -1,23 +1,6 @@
# https://stackoverflow.com/questions/53808694/how-do-i-format-a-python-list-as-an-initialized-c-array
def to_c_array(values, ctype="float", name="table", formatter=str, colcount=8):
# apply formatting to each element
values = [formatter(v) for v in values]
# split into rows with up to `colcount` elements per row
rows = [values[i:i+colcount] for i in range(0, len(values), colcount)]
# separate elements with commas, separate rows with newlines
body = ',\n '.join([', '.join(r) for r in rows])
# assemble components into the complete string
return '{} {}[] = {{\n {}}};'.format(ctype, name, body)
with open("bootrom", "rb") as f:
b = bytearray(f.read())
# compute the checksum and store a byte to
b[-1] = 256 - sum(b[0:-1]) & 0xff
with open("bootrom", "wb") as f:
f.write(b)
with open("../../Code/XTMax/bootrom.h", "w") as f:
f.write("#define BOOTROM_ADDR 0xCE000\n")
f.write(to_c_array(b, ctype="unsigned char", name="BOOTROM", colcount=16))