Hi,
I'm writing a Spectrum emulator and I've got Horace and the Spiders working (with the wrong colours and no sound) but when I boot into ROM none of the keyboard presses are recognised.
I've realised it's because Horace and the Spiders uses IN to read the keyboard (which I've implemented) but the ROM uses bit 5 of FLAGS and LAST-K to work out what's been pressed.
As far as I can tell, FLAGS and LAST-K aren't set by the ROM so I assume that they're set in a real Spectrum by the ULA but I couldn't find any information that confirmed that so I doubted my assumption.
Can anyone tell me how they are set?
Regarding implementation in my emulator, I assumed that, when a key is pressed BIT 5 is set to 1 and the value of the key is stored in LAST-K so, if you press multiple keys between reads of LAST-K, only the last one is recognised and the rest are lost...is this correct?
Thanks
Gareth
I'm writing a Spectrum emulator and I've got Horace and the Spiders working (with the wrong colours and no sound) but when I boot into ROM none of the keyboard presses are recognised.
I've realised it's because Horace and the Spiders uses IN to read the keyboard (which I've implemented) but the ROM uses bit 5 of FLAGS and LAST-K to work out what's been pressed.
As far as I can tell, FLAGS and LAST-K aren't set by the ROM so I assume that they're set in a real Spectrum by the ULA but I couldn't find any information that confirmed that so I doubted my assumption.
Can anyone tell me how they are set?
Regarding implementation in my emulator, I assumed that, when a key is pressed BIT 5 is set to 1 and the value of the key is stored in LAST-K so, if you press multiple keys between reads of LAST-K, only the last one is recognised and the rest are lost...is this correct?
Thanks
Gareth