We are well into the second half of Retrochallenge now and it fair to say that I’m not where I wanted to be. However I am learning a great deal about Z80s and CF cards are their respective wily ways.
Things continue to be confusing.
A quick re-cap of my previous posts…
It started off with the status of the CF card never showing that the read transfer was ready. However, using the ROM monitor on the Interak rather than the program showed that it was. There were various trials and hair being pulled out but what it boils down to is this.
If I use…
ld BC, (0x0067) in a, (C)
I get one value but if I use…
ld a, 0x00 in a, (0x67)
I get a different answer.
Note 0x67 is the CF card status port.
According to the Z80 manual from Zilog, in a, (C), puts B on to the top of the address bus, C on to the bottom and reads from the addressed I/O port. So that’s 0x0067.
Now, in a, 0x67, puts A on to the top of the bus (previously loaded with 0) and 0x67 on to the bottom and reads the addressed I/O port.
These two are functionally the same but give different results.
One suggestion that has been made though the VCfed forums is that it’s a timing issue as the in a, (C) version takes a little longer.
I have a few things to try. I have a couple of other CF cards on order and they should arrive soon. I’ll try them to see if there is some issue with the timing of this card. I’ll also look to see if I can get a wait state in to the IN operation.
More news when I have it.