Date : Thu, 08 Feb 1996 01:22:54 +0000 (GMT)
From : Tom Seddon <T.W.Seddon@...>
Subject: That System VIA
Perhaps unsurprisingly, I'm having a few problems with the implementation of
the System VIA. It's all written and put in now: I've wrestled with
DJGPP's interrupt functions, made a key translation table, sorted out
some silly bugs in the 'write IER' routine, and it compiles fine.
Unfortunately, IT DOES NOT WORK!!! Help!!
I handle IRQs by having a variable called 'IntRequests'. Every time a
device (ie the system VIA) wants an interrupt, it sets its registers
appropriately, and increments this variable. This is used by the 6502
emulator: every X cycles, or after every instruction, the processor checks
this variable, and if it's greater than 0 (and the I flag is clear) it
services one interrupt, decrements the variable, and continues.
Is this correct?! It seems to be the way both XBeeb and BeebEm do it.
Should I let the interrupts from the VIA pile up? I've added an
'interrupts outstanding' indicator to the disassembly output, and when
BASIC starts (after a long period of OS initialisation with I set) there
are 20 interrupts outstanding. Is this normal? It implies that BASIC is
taking 20 seconds to start up (20 t1 countdowns) which is odd... or am I
missing something? (It wouldn't surprise me)
And once I get this sorted out--there's still the keyboard to go! (I've
written the code, but it doesn't work--maybe it's related to the problems
above).
I hate the VIA.
--Tom
. ** Tom Seddon ** .
/ \ E-mail: T.W.Seddon@... / \
/(o)\ /(o)\
/=====\ Call out GANDHU and be happy /=====\
/ \ / \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^