-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Acknowledge the interrupt request #101
base: master
Are you sure you want to change the base?
Conversation
Hmm interesting, I thought that the ZX doesn't have special logic to place an interrupt vector on the data bus when an IM2 interrupt happens, but instead it takes whatever random value is currently on the data bus. But maybe what makes more sense is that if an IORQ happens, that any IO port 'address' that isn't handled by the system puts an 0xFF on the databus? For instance instead of the special check ...we basically need to answer the question: what happens when an IO request happens that has neither the RD or WR pin active... |
PS, the 'fallthrough' fix would look like this: if ((pins & (Z80_A0|Z80_RD)) == Z80_RD) {
// read from ULA
...
} else if (if ((pins & (Z80_A0|Z80_WR)) == Z80_WR) {
// write to ULA
...
} else if (((pins & (Z80_WR|Z80_A15|Z80_A1)) == Z80_WR) && (sys->type == ZX_TYPE_128)) {
// Spectrum 128 memory control..
...
} else if (((pins & (Z80_A15|Z80_A1)) == Z80_A15) && (sys->type == ZX_TYPE_128)) {
// AY-3-8912 access
...
} else if ((pins & (Z80_RD|Z80_A7|Z80_A6|Z80_A5)) == Z80_RD) {
// Kempston Joystick (........000.....)
...
} else {
// fallthrough: unhandled IO address or interrupt request
Z80_SET_DATA(pins, 0xFF);
} |
Right, not checking I've updated the PR to set the data bus to |
Hm I may have the AY-3-8912 wiring wrong, checking... |
Scratch that, I think it's ok. |
I've implemented a simpler version, where the data bus is set to I'm not sure what happened, but I brought the latest |
Hmm yeah, the actual PR diff looks scary and has a lot of unrelated changes. I will probably integrate your tick function changes manually. PS: I've converted the PR to Draft so I don't accidentially click on the merge button :) |
Yeah it'll be safer. It's really just these lines just before checking if ((pins & Z80_WR) == 0) {
// if no one puts data on the bus, it's floating
Z80_SET_DATA(pins, 0xFF);
} |
When the Z80 has /M1 and /IORQ low, an 8-bit interrupt vector must be placed in the data bus.
This PR fixes Parap Shock crashing in the menu, and likely other games that also use IM2.
Thanks to r-lyeh for pointing out the fix.