Author
| Two programming questions...
|
DemonSeed msx professional Posts: 915 | Posted: May 20 2005, 22:29   |
(1) The ASCII code for [ENTER] is 13, the code for backspace is 8, etc... What's the code for [GRPH]?
(2) What is the DEFUSR-code for 'cleaning' the keyboard-buffer?
|
|
Edwin msx professional Posts: 598 | Posted: May 20 2005, 23:03   |
GRPH is a modifier key, it has no code of its own.
&H156 if I'm not mistaken.
|
|
DemonSeed msx professional Posts: 915 | Posted: May 20 2005, 23:35   |
Thank you for the defusr code!
I searched the code for GRPH for a long time, now I understand why I couldn't find it.
Do you know how to they solve that in games, control wise?
Not by reading the key-input in ascii codes?
|
|
hap msx addict Posts: 465 | Posted: May 20 2005, 23:43   |
They probably read the keyboard directly, using z80 ports 0xa9 and 0xaa, which are 'connected' to the PPI.
|
|
flyguille msx master Posts: 1183 | Posted: May 21 2005, 00:07   |
if you uses the MSX-BIOS, you can know with PEEK the key status... the buffer sucks for gaming.
PD: if your gameplay routine is in assembler, make sure to not dissabled interrupts.
GRPH code
A=PEEK(&HFBE5+6) and 4
"6" is the row number.... 4 is &B000000100 so you can read only the BIT 2 status.
A= 0 key pressed now
A<>0 key NOT pressed now
bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
row 0 7 & 6 ^ 5 % 4 $ 3 # 2 @ 1 ! 0 )
row 1 ; : ] } [ { \ ¦ = + - _ 9 ( 8 *
row 2 B A DEAD / ? . > , < ` ~ ' "
row 3 J I H G F E D C
row 4 R Q P O N M L K
row 5 Z Y X W V U T S
row 6 F3 F2 F1 CODE CAPS GRAPH CTRL SHIFT
row 7 RET SELECT BS STOP TAB ESC F5 F4
row 8 → ↓ ↑ ← DEL INS HOME SPACE
row 9 NUM4 NUM3 NUM2 NUM1 NUM0 NUM/ NUM+ NUM*
row 10 NUM. NUM, NUM- NUM9 NUM8 NUM7 NUM6 NUM5
PD: http://map.tni.nl rocks 
and was quicky that looking for in between 2000 files that i have without caring in a only one folder A DISSASTER!. |
|
DemonSeed msx professional Posts: 915 | Posted: May 21 2005, 01:41   |
Well, thanks. Rather interesting material!
|
|
ro msx guru Posts: 2320 | Posted: May 21 2005, 13:41   |
That's right. you've gotta read the keyboard matrix which in not the same on every machine! (there are a few exeptions like US, German, French and Jap keyboards)
Graph key is like Shift and Control key; a status key which have no ascii value.
|
|
flyguille msx master Posts: 1183 | Posted: May 21 2005, 18:23   |
well, iirc, ros6,7,8 are standarized, the differences is in the others rows.
|
|
|
|
|