In finishing off the last bits of of my Casio Prizm tank game, Prizm Obliterate 1.0 tonight, I tried out the following routine, and got some useful info:


Code:
GetKeyWait_OS(int*column, int*row, int type_of_waiting, int timeout_period, int menu, unsigned short*keycode );


Arguments:
- column and row are pointers to ints
- type_of_waiting: 0 to wait for a keypress and ignore the timeout argument, 1 to return immediately regardless of keypresses, and 2 to wait for either a timer expiration or key, whichever comes first
- timeout: seconds!
- menu: 0 to make the [MENU] key invoke the menu, 1 to make it return a code
- keycode: more or less irrelevant unless you injected a keycode for GetKey()

Keycodes:
In the form key: col, row

F1: 7,10
F2: 6,10
F3: 5,10
F4: 4,10
F5: 3,10
F6: 2,10

SHIFT: 7,9
OPTN: 6,9
VARS: 5,9
MENU: (?) 4,9

UP: 2,9
LEFT: 3,9
RIGHT: 2,8
DOWN: 3, 8

ALPHA: 7, 8
X^2: 6, 8
^: 5,8
EXIT: 4,8

X,Theta,T through tan: row 7, columns 765432
a b/c: row 6, columns 765432

7, 8, 9, DEL: row 5, columns 7654
4, 5, 6, times, div: row 4, columns 76543
1, 2, 3, plus, minus: row 3, columns 76543
0, ., EXP, (-), EXE: row 2, columns 76543

AC/ON: row 1, column 1
From what I am reading in simon's sdk, you can convert those row column numbers to what PRGM_Getkey returns by decrementing the values by 1 and then doing 0xrowcolumn, in sudo code this would be (((row-1)<<4) | column-1) if I'm am reading this correctly.

On a related note it seems PRGM_Getkey just rearranges the output from PRGM_GetKey_OS() which in turn just calls one of the other internal getkey routines. This is the full code to the PRGM_Getkey() we use.

Code:
int PRGM_GetKey(){
unsigned char buffer[12];
   PRGM_GetKey_OS( buffer );
return ( buffer[1] & 0x0F ) * 10 + ( ( buffer[2] & 0xF0 ) >> 4 );
}
I'm sure the only reason we have our own implementation is that the older calc's had a syscall for it and we currently do not, know if the Prizm does and what it's syscall equate is if it does have one.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement