* Add a value to the history buffer. * @param value New value to add. * @return \c 1 if adding fails, \c 0 if successful. */
| 296 | * @return \c 1 if adding fails, \c 0 if successful. |
| 297 | */ |
| 298 | static uint16 Input_History_Add(uint16 value) |
| 299 | { |
| 300 | uint16 index; |
| 301 | |
| 302 | index = (s_historyTail + 2) & 0xFF; |
| 303 | if (index == s_historyHead) return 1; |
| 304 | |
| 305 | s_history[s_historyTail / 2] = value; |
| 306 | s_historyTail = index; |
| 307 | return 0; |
| 308 | } |
| 309 | |
| 310 | /** Read input event from file. */ |
| 311 | static void Input_ReadInputFromFile(void) |