Date : Mon, 26 Sep 1994 13:03:31 +0000
From : lamcw <lamcw@...>
Subject: Re: Pinching PC interrupts
Chris Rae wrote:
;I'm trying to implement my PC keyboard handling, and I'm having immense
;difficulty hitching onto interrupts. I'm using int21 functions 35h and
;25h I think, and they seem to be working okay but my piggy-back jump isn't.
are you trying to use PC interrupts to generate your beeb interrupts? someone
else tried this (james bonfield i think) and i don't think it worked.
and even if it did show signs of working, controlling the timing of the
interrupt would be a real bugger because the PC int will be in realtime and
your beeb emulator obviously isn't.
the way i've done it is to update your VIA timers after each opcode, and
if there's a time out, pass control to the IRQ handler at (&FFFE/F). a bit
slow to check after every opcode so i'm now checking after every 15 or so.
it's a good idea NOT to fix the number of iterations but instead to introduce
a certain randomness into the system. this will circumvene nasty code like
loop:
CLI
SEI
CMP &240
BNE loop
which exists in the OS rom and can cause the machine to hang indefinitely.
chris lam.