/ MCUME_teensy / teensy8086 / vga_t_dma.h
vga_t_dma.h
 1  /*
 2    Wrapping class to extend VGA_T4 to TFT_T_DMA
 3  */
 4  
 5  #ifndef _VGA_T_DMAH_
 6  #define _VGA_T_DMAH_
 7  
 8  #ifdef __cplusplus
 9  #include <VGA_t4.h>
10  #endif
11  
12  
13  #define RGBVAL16(r,g,b)   ( (((r>>5)&0x07)<<5) | (((g>>5)&0x07)<<2) | (((b>>6)&0x3)<<0) )
14  #define RGBVAL8(r,g,b)   ( (((r>>5)&0x07)<<5) | (((g>>5)&0x07)<<2) | (((b>>6)&0x3)<<0) )
15  
16  
17  
18  
19  #define TFT_WIDTH      640 
20  #define TFT_REALWIDTH  640
21  
22  #define TFT_HEIGHT     240
23  #define TFT_REALHEIGHT 240
24  
25  
26  
27  #ifdef __cplusplus
28  
29  class TFT_T_DMA: public VGA_T4
30  {
31    public:
32      // Fake touch screen functions     
33      bool isTouching(void) { return false; }
34      void readRaw(uint16_t * oX, uint16_t * oY, uint16_t * oZ) { }
35      void readCal(uint16_t * oX, uint16_t * oY, uint16_t * oZ) { };
36      void callibrateTouch(uint16_t xMin,uint16_t yMin,uint16_t xMax,uint16_t yMax) { }
37  
38      // fake DMA functions
39      void startDMA(void) { };
40      void stopDMA(void) { };
41      
42      // fake no DMA functions
43      void writeScreenNoDma(const vga_pixel *pcolors) { writeScreen(pcolors); }
44      void fillScreenNoDma(vga_pixel color) { clear(color); }
45      void drawTextNoDma(int16_t x, int16_t y, const char * text, vga_pixel fgcolor, vga_pixel bgcolor, bool doublesize) { drawText(x,y,text,fgcolor,bgcolor,doublesize); }
46      void drawRectNoDma(int16_t x, int16_t y, int16_t w, int16_t h, vga_pixel color) { drawRect(x, y, w, h, color); }
47      void drawSpriteNoDma(int16_t x, int16_t y, const int16_t *bitmap) { drawSprite(x, y, bitmap); }
48      void drawSpriteNoDma(int16_t x, int16_t y, const int16_t *bitmap, uint16_t croparx, uint16_t cropary, uint16_t croparw, uint16_t croparh) { drawSprite(x, y, bitmap, croparx, cropary, croparw, croparh); }
49  };
50  
51  
52  #endif
53  #endif