<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 18 Oct 1994 16:50:51 +0000
From   : lamcw <lamcw@...>
Subject: Re: BBC: I'm stuck on my keyboard handler!

Chris L. Rae wrote:

;I am very stuck on my BBC keyboard handler. I have managed to hook the PC 
;keyboard interrupt (the only satisfactory way I found was to make code 
;that actually modified itself!) but I'm not sure what I should do now. 
;It's messed up my debugging a little because whenever I press CTRL-BREAK 
;in Borland Pascal it crashes because it's in the middle of a keyboard 
;interrupt <shudder>. I have started a table of converted keyboard values 
;but I'm still not exactly sure what to do next.

do you have the IRQ interrupt system working? if not, this must be your
first step. get the system Timer 1 (T1) going. you'll know when it's
working if you can type PRINT TIME and it'll give you a value.

once this works, implement the keyboard interrupt. this is naturally 
asynchronus but i check the keyboard every 6000 opcodes.

okay, that's the easy bit. now implement &FE4F. when a program wants to check
if a key is pressed, it pokes the internal value into &FE4F and then reads it.
if bit 7 set, then it was pressed.

another consideration are the OSBYTE keyboard scan routines (127/8 ?). you have
two choices here to get it working...
 
  a) implement the required hardware responses
  b) fudge the routine (as i have done with no apparent side effects)

this is all a blinding pain in the ass. james bonfield wrote a tech note
on this some weeks ago which i'm sure he'll repost on request.


chris lam.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>