It's nice that the ZX-81/TS1000 ROM is provided here: https://github.com/pauloscustodio/ZX-81-ROMS
However, does the zx81.rom file really contain a the contents of the D2364C ROM? ...probably so, but let's verify it.
So what's the fastest/simplest way that I can do this with the stuff that I have on hand in my home lab. Here's a solution:
The Arduino Uno only has 13 digital I/O, two of which are needed for the serial com back to the computer. So I'll use the Z80 as a counter to address the ROM and then pick off the 8-bit data from the ROM. Two other control lines are needed: one for the clock and one for reset. The Z80 can be put into "counter mode" by pulling its data lines low. This is a NOP instruction, which does nothing but cause the address pointer to increment and read the data at the next address, which is, guess what? , another NOP. Meanwhile the Ardunio sniffs the ROM's data bus and displays the value to serial out. Capture that data in a file, process and compare to the .rom file from the github source. As expected, they match: bit-for-bit.
Code: Select all
nt romdata;
int val;
int addr = 0;
int do_reset = 1;
void setup() {
// start serial connection
Serial.begin(9600);
pinMode(2, INPUT_PULLUP); // rom data[0]
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP); // rom data[7]
pinMode(12, OUTPUT); // reset
pinMode(LED_BUILTIN, OUTPUT); // clock
}
oid loop() {
// reset the first time through
if(do_reset == 1) {
do_reset = 0;
digitalWrite(LED_BUILTIN, LOW);
delay(100);
digitalWrite(12, LOW);
for(int i = 0; i < 5; i++) {
delay(100);
digitalWrite(LED_BUILTIN, HIGH);
delay(100);
digitalWrite(LED_BUILTIN, LOW);
}
delay(100);
digitalWrite(12, HIGH);
delay(100);
}
if (addr < 8192) {
for(int i = 0; i < 4; i++) {
digitalWrite(LED_BUILTIN, LOW); // clock
delayMicroseconds(100); // wait for a second
digitalWrite(LED_BUILTIN, HIGH);
delayMicroseconds(100);
}
romdata = 0;
for(int i = 0; i < 8; i++) {
val = digitalRead(i+2);
val = val << i;
romdata = romdata | val;
}
Serial.print("addr: ");
Serial.print(addr);
Serial.print(" data: ");
Serial.println(romdata);
addr = addr + 1;
delayMicroseconds(100);
} else {
addr = 0;
do_reset=1;
while(1);
}
}
OK, there's more than one way to skin a cat, I could have either built an adapter, or created a new device entry for my Minipro TL866 that I recently acquired, but I had not yet got this working reliably on the CentOS system I'm running as a VM on my Mac Mini.