You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the project to create an emulator and I found that the IO system does not work as a real Z80 so a lot of machines will not work as expected.
When an IO request is issued the Z80 places in the upper part of the address bus the contents of A or B (depending on which IO instruction is used) which is not happening in the Z80dotNet. A lot of machines use this upper byte to determine which function of the port has been requested and without it all these calls fail (for example, in the Spectrum the ULA listens to port 254 requests and uses the upper part of the address to determine which keyboard lines should be scanned).
I would propose to change the IO system to work like this:
Create a new sepparated interface for IO instead of reusing the IMemory interface as these will become very different.
The IO interface would expose the ports as a double index property, it will use "Port" and "UpperAddress" as their indexes.
It will also expose a function to retrieve the WAIT states of the IO request, as these can be controlled by external devices each port/address combination can have different WAIT states
It will not contain size, the implementation of the IO must answer to any request even if not used, any unused port should return the machine's default bus value (some machines use pull-ups, others pull-downs so better allow the implementation to choose the value to return).
It could be possible to just leave most of the code as-is and only change the IO instructions to send the address to the IMemory interface as an ushort combining the port number and the upper addres register in a single value, but this has the inconvenience that when you imlpement the interface you must split the port and the address manually to determine what to do which is a lot less efficient.
Cheers.
The text was updated successfully, but these errors were encountered:
Hi.
I'm using the project to create an emulator and I found that the IO system does not work as a real Z80 so a lot of machines will not work as expected.
When an IO request is issued the Z80 places in the upper part of the address bus the contents of A or B (depending on which IO instruction is used) which is not happening in the Z80dotNet. A lot of machines use this upper byte to determine which function of the port has been requested and without it all these calls fail (for example, in the Spectrum the ULA listens to port 254 requests and uses the upper part of the address to determine which keyboard lines should be scanned).
I would propose to change the IO system to work like this:
It could be possible to just leave most of the code as-is and only change the IO instructions to send the address to the IMemory interface as an ushort combining the port number and the upper addres register in a single value, but this has the inconvenience that when you imlpement the interface you must split the port and the address manually to determine what to do which is a lot less efficient.
Cheers.
The text was updated successfully, but these errors were encountered: