Quantcast
Channel: Emulators - World of Spectrum
Viewing all articles
Browse latest Browse all 477

How are LAST-K and FLAGS set on a Real Spectrum?

$
0
0
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

Viewing all articles
Browse latest Browse all 477

Trending Articles