I need some help with the Alpha lock key, I don't really understand what Thierry is saying: "The alpha-lock key is activated by the TMS9901 output P5 (R12 address >002A) and reads together with keyboard row 4." What do I have to do to implement it? In cru.js I'm returning the key state on address 0x15 but that doesn't seem to work.
Confusing, isn't it. I could not get working code from Thierry's description. I suspect it is incorrect. I think I got the solution from our Lee.
Here is a snippet from a stand-alone assembly language key-scan (not TI ROM/GROM dependant in any way) that I wrote back in January:
(assuming you have scanned the keyboard, and detected a letter key (A-Z), and you have checked the shift keys and they are not
engaged, you then need to check the Alpha Lock key to see if you should return an upper or a lower case key, so...
(ascii code in R0)
clr r12 ; cru address
sbz >15 ; turn on alpha lock output
tb7 ; check alpha lock input
sbo >15 ; turn off alpha lock output
jeq no_alpha ; jump if no alpha lock
ai r0,-32 ; alpha lock is engaged, convert to upper case
Note that SBO has no effect on the CPU status register, so it's safe to perform a jump after the SBO.
Hope this is useful.
Edited by Willsy, Thu May 1, 2014 3:07 AM.