<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Wed, 31 Aug 1994 12:34:08 +0000
From   : lamcw <lamcw@...>
Subject: Re: Keyboard & T1 interaction

Bonfield James wrote:

;Now I've got another question about the keyboard. Do only keypresses generate
;interrupts? It seems that the T1 interrupt checks the keyboard map again. I
;haven't scanned this carefully yet, but it seems probable that it's searching
;for key releases and updating &EC/&ED accordingly. My current implementation
;generates interrupts upon both press and release. However it's not working
;either. Although I think this problem is more due to the interaction between
;T1 and the KEYV. Somehow T1 isn't using the fact that KEYV has spotted a key
;press.

i didn't think an interrupt was generated upon release of a key but it is an
interesting point. at the mo, i'm only doing an int when a key is pressed.

the keyboard int does just mark the key and T1 checks rollover and auto
repeat.

there are two crucial routines for the keyboard. first is OSBYTE 121 & 122(?)
(i think which scan the keyboard). there's some really horrible horrible
code to check which column (of the keyboard matrix) is high and then which
row is high. the intersecting point is the key pressed (look at the diagram
in back of AUG). somehow you must emulate all this.

second, is when you want to see if a certain key has been pressed. this will
look like

  LDX#int_code_of_key_to_check
  STX &FE4F
  LDX &FE4F
  BMI yes_the_key_is_being_pressed

i.e. the VIA will set bit7 of &FE4F.


although i have the keyboard working at the hardware level, i still haven't
allowed for having 2 keys pressed at once. i also 'fudged' OSBYTE 121/2 to
work instead of 'properly' emulating the VIA. this will all need to be
corrected. some games may well have their own code to scan the keyboard.


;I simply can't believe how long it's taking me to get this keyboard IO
;working.

yes, frankly it's tougher than the CRTC and ULA. it's so poorly documented.


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