![](/media/cache/profiles/301b144af4d1614dbcf92f9710be50fb.jpg.50x50_q85.jpg)
Emulation of the 1970's Chip-8 machine. The emulator has 7 games that are unmodified from the original Chip-8 format.
LCD_ST7735/Bitmap1bpp.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 "stdint.h" |
taylorza | 0:bc3f11b1b41f | 2 | |
taylorza | 0:bc3f11b1b41f | 3 | #ifndef __BITMAP1BPP_H__ |
taylorza | 0:bc3f11b1b41f | 4 | #define __BITMAP1BPP_H__ |
taylorza | 0:bc3f11b1b41f | 5 | |
taylorza | 0:bc3f11b1b41f | 6 | class Bitmap1bpp |
taylorza | 0:bc3f11b1b41f | 7 | { |
taylorza | 0:bc3f11b1b41f | 8 | public: |
taylorza | 0:bc3f11b1b41f | 9 | Bitmap1bpp(uint16_t width, uint16_t height); |
taylorza | 0:bc3f11b1b41f | 10 | ~Bitmap1bpp(); |
taylorza | 0:bc3f11b1b41f | 11 | |
taylorza | 0:bc3f11b1b41f | 12 | inline uint16_t getWidth() { return _width; } |
taylorza | 0:bc3f11b1b41f | 13 | inline uint16_t getHeight() { return _height; } |
taylorza | 0:bc3f11b1b41f | 14 | inline uint16_t getStride() { return _stride; } |
taylorza | 0:bc3f11b1b41f | 15 | |
taylorza | 0:bc3f11b1b41f | 16 | inline uint8_t *getBitmapData() { return _pBitmapData; } |
taylorza | 0:bc3f11b1b41f | 17 | |
taylorza | 0:bc3f11b1b41f | 18 | void clear(); |
taylorza | 0:bc3f11b1b41f | 19 | |
taylorza | 0:bc3f11b1b41f | 20 | void setPixel(int16_t x, int16_t y, uint16_t color); |
taylorza | 0:bc3f11b1b41f | 21 | uint16_t getPixel(int16_t x, int16_t y); |
taylorza | 0:bc3f11b1b41f | 22 | |
taylorza | 0:bc3f11b1b41f | 23 | void fastHLine(int16_t x1, int16_t x2, int16_t y, uint16_t color); |
taylorza | 0:bc3f11b1b41f | 24 | void fastVLine(int16_t y1, int16_t y2, int16_t x, uint16_t color); |
taylorza | 0:bc3f11b1b41f | 25 | |
taylorza | 0:bc3f11b1b41f | 26 | private: |
taylorza | 0:bc3f11b1b41f | 27 | uint16_t _width; |
taylorza | 0:bc3f11b1b41f | 28 | uint16_t _height; |
taylorza | 0:bc3f11b1b41f | 29 | uint16_t _stride; |
taylorza | 0:bc3f11b1b41f | 30 | uint8_t *_pBitmapData; |
taylorza | 0:bc3f11b1b41f | 31 | }; |
taylorza | 0:bc3f11b1b41f | 32 | |
taylorza | 0:bc3f11b1b41f | 33 | #endif //__BITMAP1BPP_H__ |