What's going on in 128K interrupts?

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
User avatar
Joefish
Rick Dangerous
Posts: 2042
Joined: Tue Nov 14, 2017 10:26 am

What's going on in 128K interrupts?

Post by Joefish »

Does anyone know what goes on in the 128K (and +2 but not 48K or +2/+3) interrupt routine?

I wrote another multicolour engine at the weekend and was meddling with the timing. It was supposed to replace the interrupt routine with just a single RET instruction, then I use EI and HALT whenever I want to synch up. What I hadn't realised is I'd forgotten to set IM 2 so my HALT was actually waiting for the ordinary system interrupt to occur.

Now on a 48K machine this is fairly stable. Like using PAUSE 1 and then doing border colour changes, the timing stays pretty steady, at least until you touch a key. Branches in the keypress routine then make the interrupt routine vary in timing. Similarly, emulating a +2A the interrupt timing was different, but stable. But on a 128K it was all over the place. The interrupt varies rapidly by up to a whole scanline, even when there's no input, keypresses, etc.

So does anyone know what the 128K doing different in its interrupt routine that gives it that much variety in its timing?
User avatar
Guesser
Manic Miner
Posts: 639
Joined: Wed Nov 15, 2017 2:35 pm
Contact:

Re: What's going on in 128K interrupts?

Post by Guesser »

Looking at the disassembly, it scans the keypad on alternate frames.
User avatar
Joefish
Rick Dangerous
Posts: 2042
Joined: Tue Nov 14, 2017 10:26 am

Re: What's going on in 128K interrupts?

Post by Joefish »

Ah, that would explain it. Seems a bit of an odd choice though. You mean that plug-in numerical keypad, not the keyboard?
User avatar
1024MAK
Bugaboo
Posts: 3104
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: What's going on in 128K interrupts?

Post by 1024MAK »

Yes!
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
Post Reply