What's going on in 128K interrupts?

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

What's going on in 128K interrupts?

Post by Joefish » Tue Nov 21, 2017 11:30 am

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?
0 x

User avatar
Guesser
Berk
Posts: 17
Joined: Wed Nov 15, 2017 2:35 pm

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

Post by Guesser » Tue Nov 21, 2017 12:28 pm

Looking at the disassembly, it scans the keypad on alternate frames.
1 x
My rubbish website including the redrawn Amstrad schematics and the new home of the Sinclair FAQ wiki.

Joefish
Berk
Posts: 49
Joined: Tue Nov 14, 2017 10:26 am

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

Post by Joefish » Tue Nov 21, 2017 12:30 pm

Ah, that would explain it. Seems a bit of an odd choice though. You mean that plug-in numerical keypad, not the keyboard?
0 x

User avatar
1024MAK
Dizzy
Posts: 50
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 » Tue Nov 21, 2017 9:58 pm

Yes!
0 x

Post Reply