14 /* the user has started to type in his/her UID. grab the last key and continue
15 * reading. Returns true if a UID was entered successfully.
16 * The UID will be entered as 5 digits. (shorter uids should be pre-padded
19 uid = last_key%10; /* 10 => 0, it was _not_ reset (hopefuly :) */
20 set_msg("UID? ", WRAP_NONE);
21 set_char((last_key%10)+'0', 5);
23 for (uidpos = 2; uidpos <= 5; uidpos++) {
25 if (last_key == KEY_RESET) {
29 uid = (uid*10) + (last_key%10);
30 set_char((last_key%10)+'0', 4+uidpos);
38 /* We ask for a pin, display a PIN: prompt. PINs must be a 4 digit number.
39 * Strictly, they must be 16-bit, but it's easier to use the guarantee that
40 * 4-digits numbers are < 65536
42 * Also display X's on screen as the pin is entered.
44 set_msg("PIN? ", WRAP_NONE);
45 for (pinpos = 1; pinpos <= 5; pinpos++) {
47 if (last_key == KEY_RESET) {
51 pin = (pin*10) + (last_key%10);
52 set_char('X', 4+pinpos);
57 void selection_menu() {
58 set_msg("ENTER SELECTION OR INSERT COINS", WRAP_SCROLL);
63 set_msg("UNIVERSITY", WRAP_NONE);
65 set_msg(" COMPUTER ", WRAP_NONE);
67 set_msg(" CLUB ", WRAP_NONE);
70 /* FIXME: want this message to be changeable from the server */
71 set_msg("UNIVERISTY COMPUTER CLUB *** INSERT COINS OR USER-ID ***",
74 /* this needs to be a relatively tight loop to make sure we catch
75 * keypresses at the main menu
78 if (keypad_pressed()) {
79 if (last_key != KEY_RESET) {
80 if (uid_enter() && pin_enter()) {
81 /* authenticate them */
82 switch (server_authenticate(uid, pin)) {
86 set_msg(" BAD USER ", WRAP_NONE);
90 set_msg(" NO MONEY ", WRAP_NONE);
94 set_msg("YOUR ACCOUNT IS LOCKED", WRAP_SCROLL);
108 /* Initialize Stuff. Particularly some memory locations that can only be
109 * written in the first 64 clock cycles upon reset.
113 /* enable RTI & set rate */
119 chime(); /* turn chime on or of as need be */
121 /* scroll the display if need be too */
122 if (scroll_timer == 0) {
124 scroll_timer = SCROLL_TIME;