On Thu, 4 Aug 2005 11:51:17 +0100 Stuart Brady <[EMAIL PROTECTED]> wrote: > On Thu, Aug 04, 2005 at 09:59:48AM +0200, Frode Tenneboe wrote: > > I don't know whether DI could interfere with serial drivers.
Ah. You are probably right. :) > I tried setting BREAKDI... didn't seem to help, unfortunately. Hmmm...do you have an old ROM? how about poke svar 321,1 then? Haven't tested with the serial driver though... > > Just a few questions: > > 1) Why did you use JSTKSTORE and JSTRS? Couldn't you just > > RST#10 the character? Or..in other words, I don't think I > > understand the "test" routine. > > For each scan line, it determines whether that scan line has changed. > If it has, then it prints the scan line number, followed by its new > value. The print routine prints out the (unsigned) integer held by A in > decimal. It stores the integer (JSTKSTORE), converts it to a string > (JSTRS), and then prints that string (#0013). I''m still not sure I understand the whole exercise. You are only interested in printing the key input, right? > > 2) Since you are alredy using ROM routines, why not use the > > JREADKEY/JWAITKEY instead. This gives the key in A and > > you are ready to send it to the stream. > > I don't think there would be a way to determine when a key is released, > or to allow keys to be pressed together. Not sure what bearing this has one your function. As I understand it you want to use the SAM teletype-ish; one key at a time, serial. It would probably help if I actually ran the code. :) Buf if your routine works - don't change it! Here's the assembly from the keyscan routine in ROM: D5B8 ;KEYSCAN. D5B8 ;ACTION: LOOK FOR CHANGED BITS IN KEYBOARD STATE SINCE LAST SCAN, SO THAT D5B8 ;SEVERAL KEYS CAN BE PRESSED DOWN AND A NEW KEY WILL STILL BE NOTICED. IGNORE D5B8 ;KEY RELEASES. IF THERE HAVE BEEN NO NEW PRESSES, RETURN THE SAME KEYSCAN D5B8 ;CODES AS LAST TIME, UNLESS ALL KEYS ARE RELEASED - THEN RETURN NULL CODE. D5B8 D5B8 ;ENTRY: NO CONDITIONS D5B8 ;EXIT: IF NZ, NO KEY PRESSED AND DE=FFFF D5B8 ; IF Z, E=KEY VALUE D5B8 ; IF D=0, NO SHIFT, ELSE D=1 (CAPS SH.) 2 (SYM. SH.) OR 3 (CONTROL) D5B8 D5B8 ;ENTER AT KEYSCAN+3 WITH HL=DIFFERENT 18-BYTE KBUFF IF DESIRED D5B8 D5B8 ;USED BY INKEY$ - 2 SCANS IN CASE OF INTERRUPT -Frode -- ^ Frode Tennebø | email: [EMAIL PROTECTED] ^ | Ericsson AS | Isebakkeveien 49 | | N-1788 Halden | Phone: +47 45 24 99 39 | | with Standard.Disclaimer; use Standard.Disclaimer; |

