00001 #ifndef __draw_screen_buffer_h
00002 #define __draw_screen_buffer_h
00003
00004 #include "pic_utils.h"
00005 #include "config.h"
00006 #include "draw\draw.h"
00007
00008
00009 uns8 get_draw_buffer(uns16 address);
00010 void set_draw_buffer(uns16 address, uns8 data);
00011
00012
00013
00014 #define DRAW_TOTAL_BUFFER_SIZE (DRAW_PIXELS_WIDE * DRAW_PIXELS_HIGH / DRAW_PIXELS_PER_BYTE)
00015
00016
00017
00018 #if DRAW_TOTAL_BUFFER_SIZE <= 256
00019 extern uns8 draw_buffer0[DRAW_TOTAL_BUFFER_SIZE];
00020 #define DRAW_BUFFERS 1
00021 #pragma message "1 draw buffer"
00022 #else
00023 extern uns8 draw_buffer0[256];
00024
00025 #if DRAW_TOTAL_BUFFER_SIZE <= 512
00026 extern uns8 draw_buffer1[DRAW_TOTAL_BUFFER_SIZE - 256];
00027 #define DRAW_BUFFERS 2
00028 #pragma message "2 draw buffers"
00029 #else
00030 extern uns8 draw_buffer1[256];
00031
00032 #if DRAW_TOTAL_BUFFER_SIZE <= 768
00033 #pragma message "3 draw buffers"
00034 extern uns8 draw_buffer2[DRAW_TOTAL_BUFFER_SIZE - 512];
00035 #define DRAW_BUFFERS 3
00036 #else
00037
00038 extern uns8 draw_buffer2[256];
00039 #if DRAW_TOTAL_BUFFER_SIZE <= 1024
00040 #pragma message "4 draw buffers"
00041 extern uns8 draw_buffer3[DRAW_TOTAL_BUFFER_SIZE - 768];
00042 #define DRAW_BUFFERS 4
00043 #else
00044 #error "Display too big for Draw library. Must be =< 1024 bytes buffer at present"
00045 #endif
00046 #endif
00047 #endif
00048 #endif
00049
00050 #endif