Emulation of the 1970's Chip-8 machine. The emulator has 7 games that are unmodified from the original Chip-8 format.
GameInput.h@0:bc3f11b1b41f, 2015-02-08 (annotated)
- Committer:
- taylorza
- Date:
- Sun Feb 08 01:58:57 2015 +0000
- Revision:
- 0:bc3f11b1b41f
Chip-8 Emulator
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
taylorza | 0:bc3f11b1b41f | 1 | #include "mbed.h" |
taylorza | 0:bc3f11b1b41f | 2 | |
taylorza | 0:bc3f11b1b41f | 3 | #ifndef __GAMEINPUT_H__ |
taylorza | 0:bc3f11b1b41f | 4 | #define __GAMEINPUT_H__ |
taylorza | 0:bc3f11b1b41f | 5 | |
taylorza | 0:bc3f11b1b41f | 6 | class GameInput |
taylorza | 0:bc3f11b1b41f | 7 | { |
taylorza | 0:bc3f11b1b41f | 8 | private: |
taylorza | 0:bc3f11b1b41f | 9 | static DigitalIn _up; |
taylorza | 0:bc3f11b1b41f | 10 | static DigitalIn _down; |
taylorza | 0:bc3f11b1b41f | 11 | static DigitalIn _left; |
taylorza | 0:bc3f11b1b41f | 12 | static DigitalIn _right; |
taylorza | 0:bc3f11b1b41f | 13 | static DigitalIn _square; |
taylorza | 0:bc3f11b1b41f | 14 | static DigitalIn _circle; |
taylorza | 0:bc3f11b1b41f | 15 | |
taylorza | 0:bc3f11b1b41f | 16 | public: |
taylorza | 0:bc3f11b1b41f | 17 | static inline bool isUpPressed() { return !_up; } |
taylorza | 0:bc3f11b1b41f | 18 | static inline bool isDownPressed() { return !_down; } |
taylorza | 0:bc3f11b1b41f | 19 | static inline bool isLeftPressed() { return !_left; } |
taylorza | 0:bc3f11b1b41f | 20 | static inline bool isRightPressed() { return !_right; } |
taylorza | 0:bc3f11b1b41f | 21 | static inline bool isSquarePressed() { return !_square; } |
taylorza | 0:bc3f11b1b41f | 22 | static inline bool isCirclePressed() { return !_circle; } |
taylorza | 0:bc3f11b1b41f | 23 | }; |
taylorza | 0:bc3f11b1b41f | 24 | |
taylorza | 0:bc3f11b1b41f | 25 | #endif //__GAMEINPUT_H__ |