Rev 4268 | Rev 4515 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4268 | Rev 4488 | ||
---|---|---|---|
Line 53... | Line 53... | ||
53 | /* #include <fcntl.h> */ |
53 | /* #include <fcntl.h> */ |
54 | /* #include <pwd.h> */ |
54 | /* #include <pwd.h> */ |
55 | #include <stdio.h> |
55 | #include <stdio.h> |
56 | /* #include <stdlib.h> */ |
56 | /* #include <stdlib.h> */ |
57 | #include <string.h> |
57 | #include <string.h> |
58 | #include <kbd/kbd.h> |
58 | #include <io/console.h> |
59 | #include <kbd/keycode.h> |
59 | #include <io/keycode.h> |
- | 60 | #include <vfs/vfs.h> |
|
60 | #include <stdlib.h> |
61 | #include <stdlib.h> |
61 | /* #include <time.h> */ |
62 | /* #include <time.h> */ |
62 | /* #include <term.h> */ |
63 | /* #include <term.h> */ |
63 | /* #include <unistd.h> */ |
64 | /* #include <unistd.h> */ |
64 | /* #include <sys/param.h> */ |
65 | /* #include <sys/param.h> */ |
Line 125... | Line 126... | ||
125 | 126 | ||
126 | void insertscore(int score, int level) |
127 | void insertscore(int score, int level) |
127 | { |
128 | { |
128 | int i,j; |
129 | int i,j; |
129 | size_t off; |
130 | size_t off; |
130 | kbd_event_t ev; |
131 | console_event_t ev; |
131 | 132 | ||
132 | clear_screen(); |
133 | clear_screen(); |
133 | moveto(10 , 10); |
134 | moveto(10 , 10); |
134 | puts("Insert your name: "); |
135 | puts("Insert your name: "); |
135 | str_cpy(scores[NUMSPOTS - 1].hs_name, STR_BOUNDS(MAXLOGNAME) + 1, |
136 | str_cpy(scores[NUMSPOTS - 1].hs_name, STR_BOUNDS(MAXLOGNAME) + 1, |
Line 139... | Line 140... | ||
139 | moveto(10 , 28); |
140 | moveto(10 , 28); |
140 | printf("%s%.*s",scores[NUMSPOTS - 1].hs_name,MAXLOGNAME-i,"........................................"); |
141 | printf("%s%.*s",scores[NUMSPOTS - 1].hs_name,MAXLOGNAME-i,"........................................"); |
141 | 142 | ||
142 | while (1) { |
143 | while (1) { |
143 | fflush(stdout); |
144 | fflush(stdout); |
144 | if (kbd_get_event(&ev) != EOK) |
145 | if (!console_get_event(fphone(stdin), &ev)) |
145 | exit(1); |
146 | exit(1); |
146 | 147 | ||
147 | if (ev.type == KE_RELEASE) |
148 | if (ev.type == KEY_RELEASE) |
148 | continue; |
149 | continue; |
149 | 150 | ||
150 | if (ev.key == KC_ENTER || ev.key == KC_NENTER) |
151 | if (ev.key == KC_ENTER || ev.key == KC_NENTER) |
151 | break; |
152 | break; |
152 | 153 |