+FALCOR4 Posted September 22, 2019 Share Posted September 22, 2019 Enjoying a relaxing day, browsing through some of my archives and saw the old 99/4A keyboard scanning routine that I coded a long time ago. Nothing special but, it really helped me to understand what that goofy keyboard was doing sometimes. For example, the "phantom key" that Thierry talks about really gave me fits when coding the mg explorer. You can easily see it with this tool, just press FCTN SHIFT D for the right arrow and you'll see that a fourth "phantom" key appears. That was a key sequence in the explorer memory editor for dragging the window around. That fourth key had to be trapped in the software and ignored. Hook up the joysticks and play with the dreaded alpha lock/up stick to see what happens. Anyway, enjoy. The code may have appeared in one of the Smart Programmer issues but I didn't look to see. Again, nothing special, very simple, just came in handy sometimes. Loads with the E/A (uncompressed tagged object file) and named, "keybrd." QUIT is disabled so you have to cycle power to get out of it. KSCAN.dsk 6 Quote Link to comment Share on other sites More sharing options...
+FALCOR4 Posted December 20, 2020 Author Share Posted December 20, 2020 Sometimes you may want to scan a key or two directly from the keyboard in your software rather than going through the TI KSCAN routine. This routine, that loads into cartridge ROM, is a quick and easy way to identify the key column and row that you can use for directly addressing the TMS9901. Also see Thierry's page on the TI keyboard implementation for a good rundown on how it works. Just another tool in the tool set. And, yes, the columns are listed vertically and the rows are listed horizontally ? KBCART.bin KEYBITs.pdf 8 Quote Link to comment Share on other sites More sharing options...
Omega-TI Posted January 1, 2021 Share Posted January 1, 2021 On 12/20/2020 at 12:21 PM, FALCOR4 said: Sometimes you may want to scan a key or two directly from the keyboard in your software rather than going through the TI KSCAN routine. This routine, that loads into cartridge ROM, is a quick and easy way to identify the key column and row that you can use for directly addressing the TMS9901. Also see Thierry's page on the TI keyboard implementation for a good rundown on how it works. Just another tool in the tool set. And, yes, the columns are listed vertically and the rows are listed horizontally ? KBCART.bin 1.49 kB · 11 downloads NICE! ? I've just became aware of this little gem. I tried it out on my beige system and discovered that it's pretty slick! I'll link to this in the FR99/FG99 repository. Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted January 1, 2021 Share Posted January 1, 2021 Thanks for providing this. Like it a lot. Just noticed that when pressing the right FCTN key while alpha lock is up, it shows alpha lock going down. Is that actually the case? On a sidenote, In my Stevie editor I'm using a variant of the keyscan routine published by Simon Koppelmann taken from the book "TMS9900 assembler auf dem TI-99-4A". Not using the TI99-4A ROM keyscan routine. Before I'll release Stevie, I have to revisit and have to learn more on how to properly debounce keys. Because that is what is required for getting a fluent typing experience. Is there a good way to do a reliable keyboard debounce, without using a very precise CPU loop? I tought about the 9901 timer function here for a moment. Seems like a waste spending CPU cycles while reading the keyboard. Also makes it difficult if you are on a machine that has a higher clock rate. Quote Link to comment Share on other sites More sharing options...
Omega-TI Posted January 1, 2021 Share Posted January 1, 2021 FCTN-CTRL-SHIFT then S&D -- Might make a great way to enter cheat mode in future games. Quote Link to comment Share on other sites More sharing options...
+mizapf Posted January 1, 2021 Share Posted January 1, 2021 BTW, here is a chart that I once drew for my TI-as-USB-keyboard project that could be helpful. There is one downside of directly accessing the keyboard (not going through KSCAN): It won't work on the Geneve. This is one of those showstoppers for the otherwise almost perfect compatibility. 4 Quote Link to comment Share on other sites More sharing options...
+FALCOR4 Posted January 1, 2021 Author Share Posted January 1, 2021 23 hours ago, retroclouds said: Thanks for providing this. Like it a lot. Just noticed that when pressing the right FCTN key while alpha lock is up, it shows alpha lock going down. Is that actually the case? On a sidenote, In my Stevie editor I'm using a variant of the keyscan routine published by Simon Koppelmann taken from the book "TMS9900 assembler auf dem TI-99-4A". Not using the TI99-4A ROM keyscan routine. Before I'll release Stevie, I have to revisit and have to learn more on how to properly debounce keys. Because that is what is required for getting a fluent typing experience. Is there a good way to do a reliable keyboard debounce, without using a very precise CPU loop? I tought about the 9901 timer function here for a moment. Seems like a waste spending CPU cycles while reading the keyboard. Also makes it difficult if you are on a machine that has a higher clock rate. That really happens with the FCTN key. Also the 1,2,3,4,5 keys since they are all on the same line as the alpha key. Just one of those goofy design choices that TI made. Try this; press the FCTN, Shift and D keys together. You'll notice a fourth "phantom key" pop up. 4 Quote Link to comment Share on other sites More sharing options...
+FALCOR4 Posted January 1, 2021 Author Share Posted January 1, 2021 18 minutes ago, mizapf said: BTW, here is a chart that I once drew for my TI-as-USB-keyboard project that could be helpful. There is one downside of directly accessing the keyboard (not going through KSCAN): It won't work on the Geneve. This is one of those showstoppers for the otherwise almost perfect compatibility. Nice! This will be very handy! Thanks Quote Link to comment Share on other sites More sharing options...
+FALCOR4 Posted January 2, 2021 Author Share Posted January 2, 2021 Here's an E/A5 V9T9 format version of KEYBITs that runs in expansion memory. KB 3 Quote Link to comment Share on other sites More sharing options...
RXB Posted January 2, 2021 Share Posted January 2, 2021 RXB has this command CALL IO: 100 CALL CLEAR :: CALL HPUT(1,1,"THIS PROGRAM CHECKS FOR UNUSUAL KEYS BEING PRESSED, EVEN IF MORE THEN FOUR KEY ARE BEING PRESSED AT ONCE") 110 CALL IO(2,16,3,A,B):: IF A=18 AND B=255 THEN 110 ELSE CALL HPUT(24,3,RPT$(" ",30),24,24,STR$(A)&" "&STR$(B)) 120 IF A=146 THEN CALL HPUT(24,3,"FUNCTION KEY")ELSE IF B=191 THEN CALL HPUT(24,3,"CONTROL KEY")ELSE IF B=223 THEN CALL HPUT(24,3,"SHIFT KEY") 130 IF B=251 THEN CALL HPUT(24,3,"ENTER KEY")ELSE IF B=253 THEN CALL HPUT(24,3,"SPACE BAR")ELSE IF B=254 THEN CALL HPUT(24,3,"PLUS/EQUAL KEY") 140 GOTO 110 This command unlike your other programs you see uses the IO CRU chip that talks to keyboard directly. Thus the program returns the values of both sides of keyboard of a key, this is much better then other examples as it does a better job. And it does it from XB with no assembly having direct access to the IO CRU chip. Same command was used for the Weather Station control program. 5 Quote Link to comment Share on other sites More sharing options...
+FALCOR4 Posted January 2, 2021 Author Share Posted January 2, 2021 6 minutes ago, RXB said: RXB has this command CALL IO: 100 CALL CLEAR :: CALL HPUT(1,1,"THIS PROGRAM CHECKS FOR UNUSUAL KEYS BEING PRESSED, EVEN IF MORE THEN FOUR KEY ARE BEING PRESSED AT ONCE") 110 CALL IO(2,16,3,A,B):: IF A=18 AND B=255 THEN 110 ELSE CALL HPUT(24,3,RPT$(" ",30),24,24,STR$(A)&" "&STR$(B)) 120 IF A=146 THEN CALL HPUT(24,3,"FUNCTION KEY")ELSE IF B=191 THEN CALL HPUT(24,3,"CONTROL KEY")ELSE IF B=223 THEN CALL HPUT(24,3,"SHIFT KEY") 130 IF B=251 THEN CALL HPUT(24,3,"ENTER KEY")ELSE IF B=253 THEN CALL HPUT(24,3,"SPACE BAR")ELSE IF B=254 THEN CALL HPUT(24,3,"PLUS/EQUAL KEY") 140 GOTO 110 This command unlike your other programs you see uses the IO CRU chip that talks to keyboard directly. Thus the program returns the values of both sides of keyboard of a key, this is much better then other examples as it does a better job. And it does it from XB with no assembly having direct access to the IO CRU chip. Same command was used for the Weather Station control program. That's pretty nifty, Rich! How did you implement it? Are you using the GPL Call IO command as part of the code sequence? Just curious. 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted January 2, 2021 Share Posted January 2, 2021 2 hours ago, FALCOR4 said: That's pretty nifty, Rich! How did you implement it? Are you using the GPL Call IO command as part of the code sequence? Just curious. Yea it uses the GPL subroutine built into GPL itself from GPL Programming Manual: Spoiler 4 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.