Page 1 of 1

What's going on in 128K interrupts?

Posted: Tue Nov 21, 2017 11:30 am
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?

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

Posted: Tue Nov 21, 2017 12:28 pm
by Guesser
Looking at the disassembly, it scans the keypad on alternate frames.

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

Posted: Tue Nov 21, 2017 12:30 pm
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?

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

Posted: Tue Nov 21, 2017 9:58 pm
by 1024MAK
Yes!