PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)

Committer:
spinal
Date:
Sun Nov 18 15:47:54 2018 +0000
Revision:
64:6e6c6c2b664e
Parent:
57:63853054a4d9
added fix for directrectangle()

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Pokitto 0:e8b8f36b4505 1 /**************************************************************************/
Pokitto 0:e8b8f36b4505 2 /*!
Pokitto 0:e8b8f36b4505 3 @file Pokitto_settings.h
Pokitto 0:e8b8f36b4505 4 @author Jonne Valola
Pokitto 0:e8b8f36b4505 5
Pokitto 0:e8b8f36b4505 6 @section LICENSE
Pokitto 0:e8b8f36b4505 7
Pokitto 0:e8b8f36b4505 8 Software License Agreement (BSD License)
Pokitto 0:e8b8f36b4505 9
Pokitto 0:e8b8f36b4505 10 Copyright (c) 2016, Jonne Valola
Pokitto 0:e8b8f36b4505 11 All rights reserved.
Pokitto 0:e8b8f36b4505 12
Pokitto 0:e8b8f36b4505 13 Redistribution and use in source and binary forms, with or without
Pokitto 0:e8b8f36b4505 14 modification, are permitted provided that the following conditions are met:
Pokitto 0:e8b8f36b4505 15 1. Redistributions of source code must retain the above copyright
Pokitto 0:e8b8f36b4505 16 notice, this list of conditions and the following disclaimer.
Pokitto 0:e8b8f36b4505 17 2. Redistributions in binary form must reproduce the above copyright
Pokitto 0:e8b8f36b4505 18 notice, this list of conditions and the following disclaimer in the
Pokitto 0:e8b8f36b4505 19 documentation and/or other materials provided with the distribution.
Pokitto 0:e8b8f36b4505 20 3. Neither the name of the copyright holders nor the
Pokitto 0:e8b8f36b4505 21 names of its contributors may be used to endorse or promote products
Pokitto 0:e8b8f36b4505 22 derived from this software without specific prior written permission.
Pokitto 0:e8b8f36b4505 23
Pokitto 0:e8b8f36b4505 24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
Pokitto 0:e8b8f36b4505 25 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
Pokitto 0:e8b8f36b4505 26 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Pokitto 0:e8b8f36b4505 27 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
Pokitto 0:e8b8f36b4505 28 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
Pokitto 0:e8b8f36b4505 29 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
Pokitto 0:e8b8f36b4505 30 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
Pokitto 0:e8b8f36b4505 31 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Pokitto 0:e8b8f36b4505 32 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
Pokitto 0:e8b8f36b4505 33 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Pokitto 0:e8b8f36b4505 34 */
Pokitto 0:e8b8f36b4505 35 /**************************************************************************/
Pokitto 0:e8b8f36b4505 36
Pokitto 0:e8b8f36b4505 37
Pokitto 0:e8b8f36b4505 38 #ifndef POKITTO_SETTINGS_H
Pokitto 0:e8b8f36b4505 39 #define POKITTO_SETTINGS_H
Pokitto 0:e8b8f36b4505 40
Pokitto 57:63853054a4d9 41 #include "../My_settings.h"
Pokitto 4:ecf2fe370c1c 42
Pokitto 0:e8b8f36b4505 43 #ifdef PROJ_BOARDREV
Pokitto 0:e8b8f36b4505 44 #define POK_BOARDREV PROJ_BOARDREV // which revision of Pokitto board
Pokitto 0:e8b8f36b4505 45 #else
Pokitto 0:e8b8f36b4505 46 #define POK_BOARDREV 2 // default is boardrev 2 (the 4-layer board)
Pokitto 0:e8b8f36b4505 47 #endif
Pokitto 0:e8b8f36b4505 48
Pokitto 0:e8b8f36b4505 49 /** LOGO */
Pokitto 0:e8b8f36b4505 50 #ifdef PROJ_STARTUPLOGO
Pokitto 0:e8b8f36b4505 51 #define POK_DISPLAYLOGO PROJ_STARTUPLOGO// if enabled, show logo at start
Pokitto 0:e8b8f36b4505 52 #else
Pokitto 0:e8b8f36b4505 53 #define POK_DISPLAYLOGO 1
Pokitto 0:e8b8f36b4505 54 #endif
Pokitto 0:e8b8f36b4505 55
Pokitto 0:e8b8f36b4505 56 #define POK_ENABLE_REFRESHWITHWAIT 0 // choose whether waiting in application refreshes display or not
Pokitto 0:e8b8f36b4505 57 #define POK_ENABLE_FPSCOUNTER 0 // turn off to save some cpu
Pokitto 0:e8b8f36b4505 58 #define POK_ENABLE_SD 1 // Define true to include SD library
Pokitto 0:e8b8f36b4505 59 #define POK_LOADER_COUNTDOWN 3 //how many seconds waiting for C press for loader
Pokitto 0:e8b8f36b4505 60
Pokitto 0:e8b8f36b4505 61 #ifndef PROJ_ENABLE_SOUND
Pokitto 0:e8b8f36b4505 62 #define POK_ENABLE_SOUND 1
Pokitto 0:e8b8f36b4505 63 #else
Pokitto 0:e8b8f36b4505 64 #define POK_ENABLE_SOUND PROJ_ENABLE_SOUND
Pokitto 0:e8b8f36b4505 65 #endif
Pokitto 0:e8b8f36b4505 66
Pokitto 35:4f7edccf8ed6 67 #ifndef PROJ_SOUND_BUFFERED
Pokitto 35:4f7edccf8ed6 68 #define POK_SOUND_BUFFERED 0
Pokitto 35:4f7edccf8ed6 69 #else
Pokitto 35:4f7edccf8ed6 70 #define POK_SOUND_BUFFERED PROJ_SOUND_BUFFERED
Pokitto 35:4f7edccf8ed6 71 #endif
Pokitto 35:4f7edccf8ed6 72
Pokitto 0:e8b8f36b4505 73 #ifndef PROJ_GBSOUND
Pokitto 4:ecf2fe370c1c 74 #if POK_ENABLE_SOUND > 0
Pokitto 4:ecf2fe370c1c 75 #define POK_GBSOUND 0
Pokitto 4:ecf2fe370c1c 76 #endif
Pokitto 0:e8b8f36b4505 77 #else
Pokitto 0:e8b8f36b4505 78 #define POK_GBSOUND PROJ_GBSOUND
Pokitto 0:e8b8f36b4505 79 #endif
Pokitto 0:e8b8f36b4505 80
Pokitto 0:e8b8f36b4505 81
Pokitto 0:e8b8f36b4505 82 #ifndef PROJ_STREAMING_MUSIC
Pokitto 35:4f7edccf8ed6 83 #define POK_STREAMING_MUSIC 0 // Define true to stream music from SD
Pokitto 0:e8b8f36b4505 84 #else
Pokitto 0:e8b8f36b4505 85 #define POK_STREAMING_MUSIC PROJ_STREAMING_MUSIC
Pokitto 0:e8b8f36b4505 86 #endif // PROJ_STREAMING_MUSIC
Pokitto 0:e8b8f36b4505 87
Pokitto 0:e8b8f36b4505 88 #ifndef PROJ_ENABLE_SYNTH
Pokitto 0:e8b8f36b4505 89 #define POK_ENABLE_SYNTH 0
Pokitto 0:e8b8f36b4505 90 #else
Pokitto 0:e8b8f36b4505 91 #define POK_ENABLE_SYNTH PROJ_ENABLE_SYNTH
Pokitto 0:e8b8f36b4505 92 #endif // PROJ_ENABLE_SYNTH
Pokitto 0:e8b8f36b4505 93
Pokitto 0:e8b8f36b4505 94
Pokitto 0:e8b8f36b4505 95 /** CONSOLE **/
Pokitto 30:796f9611d2ac 96 #define POK_USE_CONSOLE 0 //if debugging console is available or not
Pokitto 0:e8b8f36b4505 97 #define POK_CONSOLE_VISIBLE_AT_STARTUP 1 // whaddaya think ?
Pokitto 0:e8b8f36b4505 98 #define POK_CONSOLE_INTERVAL 1000 // interval in ms how often console is drawn
Pokitto 0:e8b8f36b4505 99 #if POK_USE_CONSOLE > 0 // this prevents trying to log messages if console is disabled
Pokitto 0:e8b8f36b4505 100 #define POK_CONSOLE_LOG_BUTTONS 0 // if console logs keypresses
Pokitto 0:e8b8f36b4505 101 #define POK_CONSOLE_LOG_COLLISIONS 1 // if console logs collisions
Pokitto 0:e8b8f36b4505 102 #endif // POK_USE_CONSOLE
Pokitto 0:e8b8f36b4505 103 #define CONSOLEBUFSIZE 20
Pokitto 0:e8b8f36b4505 104 #define POK_SHOW_VOLUME 0 // volumebar drawn after console if enabled
Pokitto 0:e8b8f36b4505 105 #define VOLUMEBAR_TIMEOUT 10 // frames before disappearing
Pokitto 0:e8b8f36b4505 106
Pokitto 0:e8b8f36b4505 107 /** PROJECT LIBRARY TYPE **/
Pokitto 0:e8b8f36b4505 108 // Tiled mode can NOT be buffered mode (fast mode, arduboy mode, gamebuino mode etc)
Pokitto 0:e8b8f36b4505 109 #if PROJ_TILEDMODE > 0
Pokitto 0:e8b8f36b4505 110 #define POK_TILEDMODE 1
Pokitto 0:e8b8f36b4505 111 #ifdef PROJ_TILEWIDTH
Pokitto 0:e8b8f36b4505 112 #define POK_TILE_W PROJ_TILEWIDTH
Pokitto 0:e8b8f36b4505 113 #else
Pokitto 0:e8b8f36b4505 114 #define POK_TILE_W 11
Pokitto 0:e8b8f36b4505 115 #endif // PROJ_TILEWIDTH
Pokitto 0:e8b8f36b4505 116 #if POK_TILE_W == 11
Pokitto 0:e8b8f36b4505 117 #define POK_TILES_X 20
Pokitto 0:e8b8f36b4505 118 #define LCDWIDTH 220
Pokitto 0:e8b8f36b4505 119 #elif POK_TILE_W == 12
Pokitto 0:e8b8f36b4505 120 #define POK_TILES_X 18
Pokitto 0:e8b8f36b4505 121 #define LCDWIDTH 216
Pokitto 0:e8b8f36b4505 122 #elif POK_TILE_W == 8
Pokitto 0:e8b8f36b4505 123 #define POK_TILES_X 27
Pokitto 0:e8b8f36b4505 124 #define LCDWIDTH 216
Pokitto 0:e8b8f36b4505 125 #elif POK_TILE_W == 32
Pokitto 0:e8b8f36b4505 126 #define POK_TILES_X 6
Pokitto 0:e8b8f36b4505 127 #define LCDWIDTH 220
Pokitto 0:e8b8f36b4505 128 #elif POK_TILE_W == 10
Pokitto 0:e8b8f36b4505 129 #define POK_TILES_X 22
Pokitto 0:e8b8f36b4505 130 #define LCDWIDTH 220
Pokitto 0:e8b8f36b4505 131 #elif POK_TILE_W == 14
Pokitto 0:e8b8f36b4505 132 #define POK_TILES_X 15
Pokitto 0:e8b8f36b4505 133 #define LCDWIDTH 210
Pokitto 0:e8b8f36b4505 134 #endif
Pokitto 0:e8b8f36b4505 135 #ifdef PROJ_TILEHEIGHT
Pokitto 0:e8b8f36b4505 136 #define POK_TILE_H PROJ_TILEHEIGHT
Pokitto 0:e8b8f36b4505 137 #else
Pokitto 0:e8b8f36b4505 138 #define POK_TILE_H 11
Pokitto 0:e8b8f36b4505 139 #endif // PROJ_TILEHEIGHT
Pokitto 0:e8b8f36b4505 140 #if POK_TILE_H == 11
Pokitto 0:e8b8f36b4505 141 #define POK_TILES_Y 16
Pokitto 0:e8b8f36b4505 142 #define LCDHEIGHT 176
Pokitto 0:e8b8f36b4505 143 #elif POK_TILE_H == 12
Pokitto 0:e8b8f36b4505 144 #define POK_TILES_Y 14
Pokitto 0:e8b8f36b4505 145 #define LCDHEIGHT 168
Pokitto 0:e8b8f36b4505 146 #elif POK_TILE_H == 8
Pokitto 0:e8b8f36b4505 147 #define POK_TILES_Y 22
Pokitto 0:e8b8f36b4505 148 #define LCDHEIGHT 176
Pokitto 0:e8b8f36b4505 149 #elif POK_TILE_H == 32
Pokitto 0:e8b8f36b4505 150 #define POK_TILES_Y 5
Pokitto 0:e8b8f36b4505 151 #define LCDHEIGHT 176
Pokitto 0:e8b8f36b4505 152 #elif POK_TILE_H == 10
Pokitto 0:e8b8f36b4505 153 #define POK_TILES_Y 17
Pokitto 0:e8b8f36b4505 154 #define LCDHEIGHT 170
Pokitto 0:e8b8f36b4505 155 #elif POK_TILE_H == 14
Pokitto 0:e8b8f36b4505 156 #define POK_TILES_Y 12
Pokitto 0:e8b8f36b4505 157 #define LCDHEIGHT 168
Pokitto 0:e8b8f36b4505 158 #endif
Pokitto 0:e8b8f36b4505 159 #else
Pokitto 0:e8b8f36b4505 160 #if PROJ_GAMEBUINO > 0
Pokitto 0:e8b8f36b4505 161 #define POK_GAMEBUINO_SUPPORT PROJ_GAMEBUINO // Define true to support Gamebuino library calls
Pokitto 0:e8b8f36b4505 162 #define PROJ_SCREENMODE MODE_GAMEBUINO_16COLOR
Pokitto 0:e8b8f36b4505 163 #define POK_STRETCH 1
Pokitto 0:e8b8f36b4505 164 #define PICOPALETTE 0
Pokitto 0:e8b8f36b4505 165 #define POK_COLORDEPTH 4
Pokitto 0:e8b8f36b4505 166 #else
Pokitto 0:e8b8f36b4505 167 #if PROJ_ARDUBOY > 0
Pokitto 0:e8b8f36b4505 168 #define POK_ARDUBOY_SUPPORT PROJ_ARDUBOY // Define true to support Arduboy library calls
Pokitto 0:e8b8f36b4505 169 #define PROJ_SCREENMODE MODE_ARDUBOY_16COLOR
Pokitto 0:e8b8f36b4505 170 #define POK_COLORDEPTH 1
Pokitto 0:e8b8f36b4505 171 #define POK_STRETCH 1
Pokitto 0:e8b8f36b4505 172 #define POK_FPS 20
Pokitto 0:e8b8f36b4505 173 #define PICOPALETTE 0
Pokitto 0:e8b8f36b4505 174 #else
Pokitto 0:e8b8f36b4505 175 #if PROJ_RBOY > 0
Pokitto 0:e8b8f36b4505 176 #define PROJ_SCREENMODE MODE_GAMEBUINO_16COLOR
Pokitto 0:e8b8f36b4505 177 #define POK_COLORDEPTH 1
Pokitto 0:e8b8f36b4505 178 #define POK_STRETCH 0
Pokitto 0:e8b8f36b4505 179 #define POK_FPS 40
Pokitto 0:e8b8f36b4505 180 #define PICOPALETTE 0
Pokitto 0:e8b8f36b4505 181 #else
Pokitto 0:e8b8f36b4505 182 #if PROJ_GAMEBOY > 0
Pokitto 0:e8b8f36b4505 183 #define PROJ_SCREENMODE MODE_GAMEBOY
Pokitto 0:e8b8f36b4505 184 #define POK_COLORDEPTH 2
Pokitto 0:e8b8f36b4505 185 #define POK_STRETCH 0
Pokitto 0:e8b8f36b4505 186 #define POK_FPS 6
Pokitto 0:e8b8f36b4505 187 #define PICOPALETTE 0
Pokitto 0:e8b8f36b4505 188 #else
Pokitto 0:e8b8f36b4505 189 #define POK_GAMEBUINO_SUPPORT 0
Pokitto 0:e8b8f36b4505 190 #define POK_GAMEBOY_SUPPORT 0
Pokitto 0:e8b8f36b4505 191 #define POK_ARDUBOY_SUPPORT 0
Pokitto 0:e8b8f36b4505 192 #define PICOPALETTE 0
Pokitto 0:e8b8f36b4505 193 #define POK_COLORDEPTH 4
Pokitto 0:e8b8f36b4505 194 #endif // PROJ_GAMEBOY
Pokitto 0:e8b8f36b4505 195 #endif // PROJ_RBOY
Pokitto 0:e8b8f36b4505 196 #endif // PROJ_ARDUBOY
Pokitto 0:e8b8f36b4505 197 #endif // PROJ_GAMEBUINO
Pokitto 0:e8b8f36b4505 198 #endif // PROJ_TILEDMODE
Pokitto 0:e8b8f36b4505 199
Pokitto 30:796f9611d2ac 200
Pokitto 0:e8b8f36b4505 201 /** SCREEN MODES TABLE -- DO NOT CHANGE THESE **/
Pokitto 0:e8b8f36b4505 202
Pokitto 0:e8b8f36b4505 203 #define POK_LCD_W 220 //<- do not change !!
Pokitto 0:e8b8f36b4505 204 #define POK_LCD_H 176 //<- do not change !!
Pokitto 0:e8b8f36b4505 205
Pokitto 0:e8b8f36b4505 206 #define MODE_NOBUFFER 0 //Size: 0
Pokitto 0:e8b8f36b4505 207 #define BUFSIZE_NOBUFFER 0
Pokitto 0:e8b8f36b4505 208 #define MODE_HI_4COLOR 1 //Size: 9680
Pokitto 0:e8b8f36b4505 209 #define BUFSIZE_HI_4 9680
Pokitto 0:e8b8f36b4505 210 #define MODE_FAST_16COLOR 2 //Size: 4840
Pokitto 0:e8b8f36b4505 211 #define BUFSIZE_FAST_16 4840
Pokitto 0:e8b8f36b4505 212 #define MODE_HI_16COLOR 3
Pokitto 0:e8b8f36b4505 213 #define BUFSIZE_HI_16 19360
Pokitto 0:e8b8f36b4505 214 #define MODE_GAMEBUINO_16COLOR 4 //Size: 2016
Pokitto 0:e8b8f36b4505 215 #define BUFSIZE_GAMEBUINO_16 2016
Pokitto 0:e8b8f36b4505 216 #define MODE_ARDUBOY_16COLOR 5 //Size: 4096
Pokitto 0:e8b8f36b4505 217 #define BUFSIZE_ARDUBOY_16 4096
Pokitto 0:e8b8f36b4505 218 #define MODE_HI_MONOCHROME 6 //Size: 4840
Pokitto 0:e8b8f36b4505 219 #define BUFSIZE_HI_MONO 4840
Pokitto 0:e8b8f36b4505 220 #define MODE_HI_GRAYSCALE 7 //Size: 9680
Pokitto 0:e8b8f36b4505 221 #define BUFSIZE_HI_GS 9680
Pokitto 0:e8b8f36b4505 222 #define MODE_GAMEBOY 8
Pokitto 0:e8b8f36b4505 223 #define BUFSIZE_GAMEBOY 5760
Pokitto 0:e8b8f36b4505 224 #define MODE_UZEBOX 9
Pokitto 0:e8b8f36b4505 225 #define MODE_TVOUT 10
Pokitto 0:e8b8f36b4505 226 #define MODE_LAMENES 11
Pokitto 0:e8b8f36b4505 227 #define BUFSIZE_LAMENES 7680
Pokitto 0:e8b8f36b4505 228 #define MODE_256_COLOR 12
Pokitto 0:e8b8f36b4505 229 #define BUFSIZE_MODE_12 4176 // 72 x 58
Pokitto 30:796f9611d2ac 230 #define MODE13 13
Pokitto 30:796f9611d2ac 231 #define BUFSIZE_MODE13 9680 // 110*88
Pokitto 35:4f7edccf8ed6 232 #define MODE14 14
Pokitto 35:4f7edccf8ed6 233 #define BUFSIZE_MODE14 14520
Pokitto 0:e8b8f36b4505 234 // Tiled modes
Pokitto 0:e8b8f36b4505 235 #define MODE_TILED_1BIT 1001
Pokitto 0:e8b8f36b4505 236 #define MODE_TILED_8BIT 1002
Pokitto 0:e8b8f36b4505 237
Pokitto 0:e8b8f36b4505 238
Pokitto 35:4f7edccf8ed6 239 #define R_MASK 0xF800
Pokitto 35:4f7edccf8ed6 240 #define G_MASK 0x7E0
Pokitto 35:4f7edccf8ed6 241 #define B_MASK 0x1F
Pokitto 0:e8b8f36b4505 242
Pokitto 0:e8b8f36b4505 243 /** SCREENMODE - USE THIS SELECTION FOR YOUR PROJECT **/
Pokitto 0:e8b8f36b4505 244
Pokitto 0:e8b8f36b4505 245 #if POK_TILEDMODE > 0
Pokitto 0:e8b8f36b4505 246 #ifndef PROJ_TILEBITDEPTH
Pokitto 0:e8b8f36b4505 247 #define PROJ_TILEBITDEPTH 8 //default tiling mode is 256 color mode!
Pokitto 0:e8b8f36b4505 248 #endif // PROJ_TILEBITDEPTH
Pokitto 0:e8b8f36b4505 249 #if PROJ_TILEBITDEPTH == 1
Pokitto 0:e8b8f36b4505 250 #define POK_SCREENMODE MODE_TILED_1BIT
Pokitto 0:e8b8f36b4505 251 #define POK_COLORDEPTH 1
Pokitto 0:e8b8f36b4505 252 #else
Pokitto 0:e8b8f36b4505 253 #define POK_SCREENMODE MODE_TILED_8BIT
Pokitto 0:e8b8f36b4505 254 #define POK_COLORDEPTH 8
Pokitto 0:e8b8f36b4505 255 #endif // PROJ_TILEBITDEPTH
Pokitto 0:e8b8f36b4505 256 #else
Pokitto 0:e8b8f36b4505 257 #ifndef PROJ_SCREENMODE
Pokitto 5:ea7377f3d1af 258 #undef POK_COLORDEPTH
Pokitto 0:e8b8f36b4505 259 #ifdef PROJ_HIRES
Pokitto 0:e8b8f36b4505 260 #if PROJ_HIRES > 0
Pokitto 0:e8b8f36b4505 261 #define POK_SCREENMODE MODE_HI_4COLOR
Pokitto 5:ea7377f3d1af 262 #undef POK_COLORDEPTH
Pokitto 0:e8b8f36b4505 263 #define POK_COLORDEPTH 2
Pokitto 0:e8b8f36b4505 264 #elif PROJ_HICOLOR > 0
Pokitto 0:e8b8f36b4505 265 #define POK_SCREENMODE MODE_256_COLOR
Pokitto 5:ea7377f3d1af 266 #undef POK_COLORDEPTH
Pokitto 0:e8b8f36b4505 267 #define POK_COLORDEPTH 8
Pokitto 0:e8b8f36b4505 268 #else
Pokitto 0:e8b8f36b4505 269 #define POK_SCREENMODE MODE_FAST_16COLOR
Pokitto 5:ea7377f3d1af 270 #undef POK_COLORDEPTH
Pokitto 0:e8b8f36b4505 271 #define POK_COLORDEPTH 4
Pokitto 0:e8b8f36b4505 272 #endif // PROJ_HIRES
Pokitto 0:e8b8f36b4505 273 #else
Pokitto 0:e8b8f36b4505 274 #define POK_SCREENMODE MODE_FAST_16COLOR
Pokitto 0:e8b8f36b4505 275 #define POK_COLORDEPTH 4
Pokitto 0:e8b8f36b4505 276 #endif // PROJ_HIRES
Pokitto 0:e8b8f36b4505 277 #else
Pokitto 0:e8b8f36b4505 278 #define POK_SCREENMODE PROJ_SCREENMODE
Pokitto 0:e8b8f36b4505 279 #endif
Pokitto 0:e8b8f36b4505 280 #endif // POK_TILEDMODE
Pokitto 0:e8b8f36b4505 281
Pokitto 35:4f7edccf8ed6 282 #if PROJ_MODE13 > 0
Pokitto 35:4f7edccf8ed6 283 #undef POK_SCREENMODE //get rid of warnings
Pokitto 35:4f7edccf8ed6 284 #undef POK_COLORDEPTH
Pokitto 35:4f7edccf8ed6 285 #undef POK_FPS
Pokitto 35:4f7edccf8ed6 286 #define POK_SCREENMODE MODE13
Pokitto 35:4f7edccf8ed6 287 #define POK_COLORDEPTH 8
Pokitto 35:4f7edccf8ed6 288 #define POK_STRETCH 0
Pokitto 35:4f7edccf8ed6 289 #define POK_FPS 30
Pokitto 35:4f7edccf8ed6 290 #endif
Pokitto 35:4f7edccf8ed6 291
Pokitto 35:4f7edccf8ed6 292 #if PROJ_MODE14 > 0
Pokitto 35:4f7edccf8ed6 293 #undef POK_SCREENMODE //get rid of warnings
Pokitto 35:4f7edccf8ed6 294 #undef POK_COLORDEPTH
Pokitto 35:4f7edccf8ed6 295 #undef POK_FPS
Pokitto 35:4f7edccf8ed6 296 #define POK_SCREENMODE MODE14
Pokitto 35:4f7edccf8ed6 297 #define POK_COLORDEPTH 3
Pokitto 35:4f7edccf8ed6 298 #define POK_STRETCH 0
Pokitto 35:4f7edccf8ed6 299 #define POK_FPS 30
Pokitto 35:4f7edccf8ed6 300 #endif
Pokitto 35:4f7edccf8ed6 301 #if PROJ_MODE15 > 0
Pokitto 35:4f7edccf8ed6 302 #undef POK_SCREENMODE //get rid of warnings
Pokitto 35:4f7edccf8ed6 303 #undef POK_COLORDEPTH
Pokitto 35:4f7edccf8ed6 304 #undef POK_FPS
Pokitto 35:4f7edccf8ed6 305 #define POK_SCREENMODE MODE15
Pokitto 35:4f7edccf8ed6 306 #define POK_COLORDEPTH 4
Pokitto 35:4f7edccf8ed6 307 #define POK_STRETCH 0
Pokitto 35:4f7edccf8ed6 308 #define POK_FPS 30
Pokitto 35:4f7edccf8ed6 309 #endif
Pokitto 0:e8b8f36b4505 310 /* DEFINE SCREENMODE AS THE MAXIMUM SCREEN SIZE NEEDED BY YOUR APP ... SEE SIZES LISTED ABOVE */
Pokitto 0:e8b8f36b4505 311
Pokitto 0:e8b8f36b4505 312 /** AUTOMATIC COLOR DEPTH SETTING - DO NOT CHANGE **/
Pokitto 0:e8b8f36b4505 313 #ifndef POK_COLORDEPTH
Pokitto 0:e8b8f36b4505 314 #define POK_COLORDEPTH 4 // 1...5 is valid
Pokitto 0:e8b8f36b4505 315 #endif // POK_COLORDEPTH
Pokitto 0:e8b8f36b4505 316
Pokitto 0:e8b8f36b4505 317 /** AUTOMATIC SCREEN BUFFER SIZE CALCULATION - DO NOT CHANGE **/
Pokitto 0:e8b8f36b4505 318 #if POK_SCREENMODE == 0
Pokitto 0:e8b8f36b4505 319 #define POK_SCREENBUFFERSIZE 0
Pokitto 0:e8b8f36b4505 320 #define LCDWIDTH POK_LCD_W
Pokitto 0:e8b8f36b4505 321 #define LCDHEIGHT POK_LCD_H
Pokitto 0:e8b8f36b4505 322 #define POK_BITFRAME 0
Pokitto 0:e8b8f36b4505 323 #elif POK_SCREENMODE == MODE_HI_MONOCHROME
Pokitto 0:e8b8f36b4505 324 #define POK_SCREENBUFFERSIZE POK_LCD_W*POK_LCD_H*POK_COLORDEPTH/8
Pokitto 0:e8b8f36b4505 325 #define LCDWIDTH POK_LCD_W
Pokitto 0:e8b8f36b4505 326 #define LCDHEIGHT POK_LCD_H
Pokitto 0:e8b8f36b4505 327 #define POK_BITFRAME 4840
Pokitto 0:e8b8f36b4505 328 #elif POK_SCREENMODE == MODE_HI_16COLOR
Pokitto 0:e8b8f36b4505 329 #define POK_SCREENBUFFERSIZE POK_LCD_W*POK_LCD_H/2
Pokitto 0:e8b8f36b4505 330 #define LCDWIDTH 220
Pokitto 0:e8b8f36b4505 331 #define LCDHEIGHT 176
Pokitto 0:e8b8f36b4505 332 #define POK_BITFRAME 4840
Pokitto 0:e8b8f36b4505 333 #elif POK_SCREENMODE == MODE_HI_4COLOR || POK_SCREENMODE == MODE_HI_GRAYSCALE
Pokitto 0:e8b8f36b4505 334 #define POK_SCREENBUFFERSIZE POK_LCD_W*POK_LCD_H*POK_COLORDEPTH/4
Pokitto 0:e8b8f36b4505 335 #define LCDWIDTH POK_LCD_W
Pokitto 0:e8b8f36b4505 336 #define LCDHEIGHT POK_LCD_H
Pokitto 0:e8b8f36b4505 337 #define POK_BITFRAME 4840
Pokitto 0:e8b8f36b4505 338 #elif POK_SCREENMODE == MODE_FAST_16COLOR
Pokitto 0:e8b8f36b4505 339 #define POK_SCREENBUFFERSIZE (POK_LCD_W/2)*(POK_LCD_H/2)*POK_COLORDEPTH/8
Pokitto 0:e8b8f36b4505 340 #define XCENTER POK_LCD_W/4
Pokitto 0:e8b8f36b4505 341 #define YCENTER POK_LCD_H/4
Pokitto 0:e8b8f36b4505 342 #define LCDWIDTH 110
Pokitto 0:e8b8f36b4505 343 #define LCDHEIGHT 88
Pokitto 0:e8b8f36b4505 344 #define POK_BITFRAME 1210
Pokitto 0:e8b8f36b4505 345 #elif POK_SCREENMODE == MODE_256_COLOR
Pokitto 0:e8b8f36b4505 346 #define POK_SCREENBUFFERSIZE 72*58
Pokitto 0:e8b8f36b4505 347 #define XCENTER 36
Pokitto 0:e8b8f36b4505 348 #define YCENTER 29
Pokitto 0:e8b8f36b4505 349 #define LCDWIDTH 72
Pokitto 0:e8b8f36b4505 350 #define LCDHEIGHT 58
Pokitto 0:e8b8f36b4505 351 #define POK_BITFRAME 72*58
Pokitto 0:e8b8f36b4505 352 #elif POK_SCREENMODE == MODE_GAMEBUINO_16COLOR
Pokitto 0:e8b8f36b4505 353 #define POK_SCREENBUFFERSIZE (84/2)*(48/2)*POK_COLORDEPTH/8
Pokitto 0:e8b8f36b4505 354 #define LCDWIDTH 84
Pokitto 0:e8b8f36b4505 355 #define LCDHEIGHT 48
Pokitto 0:e8b8f36b4505 356 #define POK_BITFRAME 504
Pokitto 0:e8b8f36b4505 357 #elif POK_SCREENMODE == MODE_ARDUBOY_16COLOR
Pokitto 0:e8b8f36b4505 358 #define POK_SCREENBUFFERSIZE (128/2)*(64/2)*POK_COLORDEPTH/8
Pokitto 0:e8b8f36b4505 359 #define LCDWIDTH 128
Pokitto 0:e8b8f36b4505 360 #define LCDHEIGHT 64
Pokitto 0:e8b8f36b4505 361 #define POK_BITFRAME 1024
Pokitto 0:e8b8f36b4505 362 #elif POK_SCREENMODE == MODE_LAMENES
Pokitto 0:e8b8f36b4505 363 #define POK_SCREENBUFFERSIZE (128)*(120)*POK_COLORDEPTH/8
Pokitto 0:e8b8f36b4505 364 #define LCDWIDTH 128
Pokitto 0:e8b8f36b4505 365 #define LCDHEIGHT 120
Pokitto 0:e8b8f36b4505 366 #define POK_BITFRAME 1210
Pokitto 0:e8b8f36b4505 367 #elif POK_SCREENMODE == MODE_GAMEBOY
Pokitto 0:e8b8f36b4505 368 #define POK_SCREENBUFFERSIZE (160)*(144)/4
Pokitto 0:e8b8f36b4505 369 #define LCDWIDTH 160
Pokitto 0:e8b8f36b4505 370 #define LCDHEIGHT 144
Pokitto 0:e8b8f36b4505 371 #define POK_BITFRAME 2880
Pokitto 30:796f9611d2ac 372 #elif POK_SCREENMODE == MODE13
Pokitto 30:796f9611d2ac 373 #define POK_SCREENBUFFERSIZE 110*88
Pokitto 30:796f9611d2ac 374 #define LCDWIDTH 110
Pokitto 30:796f9611d2ac 375 #define LCDHEIGHT 88
Pokitto 30:796f9611d2ac 376 #define POK_BITFRAME 110*88
Pokitto 35:4f7edccf8ed6 377 #elif POK_SCREENMODE == MODE14
Pokitto 35:4f7edccf8ed6 378 #define POK_SCREENBUFFERSIZE 14520
Pokitto 35:4f7edccf8ed6 379 #define LCDWIDTH 220
Pokitto 35:4f7edccf8ed6 380 #define LCDHEIGHT 176
Pokitto 35:4f7edccf8ed6 381 #define POK_BITFRAME 4840
Pokitto 35:4f7edccf8ed6 382 #elif POK_SCREENMODE == MODE15
Pokitto 35:4f7edccf8ed6 383 #define POK_SCREENBUFFERSIZE 0x4BA0
Pokitto 35:4f7edccf8ed6 384 #define LCDWIDTH 220
Pokitto 35:4f7edccf8ed6 385 #define LCDHEIGHT 176
Pokitto 35:4f7edccf8ed6 386
Pokitto 0:e8b8f36b4505 387 #else
Pokitto 0:e8b8f36b4505 388 #define POK_SCREENBUFFERSIZE 0
Pokitto 0:e8b8f36b4505 389 #endif // POK_SCREENMODE
Pokitto 0:e8b8f36b4505 390
Pokitto 0:e8b8f36b4505 391 #ifndef POK_STRETCH
Pokitto 0:e8b8f36b4505 392 #define POK_STRETCH 1 // Stretch Gamebuino display
Pokitto 0:e8b8f36b4505 393 #endif
Pokitto 35:4f7edccf8ed6 394
Pokitto 35:4f7edccf8ed6 395 #ifdef PROJ_FPS
Pokitto 35:4f7edccf8ed6 396 #define POK_FPS PROJ_FPS
Pokitto 35:4f7edccf8ed6 397 #endif
Pokitto 0:e8b8f36b4505 398 #ifndef POK_FPS
Pokitto 0:e8b8f36b4505 399 #define POK_FPS 20
Pokitto 0:e8b8f36b4505 400 #endif
Pokitto 0:e8b8f36b4505 401 #define POK_FRAMEDURATION 1000/POK_FPS
Pokitto 0:e8b8f36b4505 402
Pokitto 0:e8b8f36b4505 403 /** SCROLL TEXT VS. WRAP AROUND WHEN PRINTING **/
Pokitto 0:e8b8f36b4505 404 #define SCROLL_TEXT 1
Pokitto 0:e8b8f36b4505 405
Pokitto 0:e8b8f36b4505 406 /** AUDIO **/
Pokitto 0:e8b8f36b4505 407 #define POK_AUD_PIN P2_19
Pokitto 30:796f9611d2ac 408 #define POK_AUD_PWM_US 15 //31 //Default value 31
Pokitto 35:4f7edccf8ed6 409 #ifndef PROJ_AUD_FREQ
Pokitto 35:4f7edccf8ed6 410 #define POK_AUD_FREQ 22050 //Valid values: 8000, 11025, 16000, 22050 // audio update frequency in Hz
Pokitto 35:4f7edccf8ed6 411 #else
Pokitto 35:4f7edccf8ed6 412 #define POK_AUD_FREQ PROJ_AUD_FREQ
Pokitto 35:4f7edccf8ed6 413 #endif
Pokitto 35:4f7edccf8ed6 414
Pokitto 35:4f7edccf8ed6 415
Pokitto 35:4f7edccf8ed6 416 #define POK_USE_EXT 0 // if extension port is in use or not
Pokitto 35:4f7edccf8ed6 417
Pokitto 0:e8b8f36b4505 418 #define POK_STREAMFREQ_HALVE 0 // if true, stream update freq is half audio freq
Pokitto 0:e8b8f36b4505 419 #define POK_STREAM_LOOP 1 //master switch
Pokitto 0:e8b8f36b4505 420
Pokitto 35:4f7edccf8ed6 421 #ifndef PROJ_USE_DAC
Pokitto 35:4f7edccf8ed6 422 #define POK_USE_DAC 1 // is DAC in use in this project
Pokitto 35:4f7edccf8ed6 423 #else
Pokitto 35:4f7edccf8ed6 424 #define POK_USE_DAC PROJ_USE_DAC
Pokitto 35:4f7edccf8ed6 425 #endif
Pokitto 35:4f7edccf8ed6 426 #ifndef PROJ_USE_PWM
Pokitto 35:4f7edccf8ed6 427 #define POK_USE_PWM 1 // is PWM for audio used in this project
Pokitto 35:4f7edccf8ed6 428 #else
Pokitto 35:4f7edccf8ed6 429 #define POK_USE_PWM PROJ_USE_PWM
Pokitto 35:4f7edccf8ed6 430 #endif
Pokitto 35:4f7edccf8ed6 431
Pokitto 35:4f7edccf8ed6 432 #ifndef PROJ_STREAM_TO_DAC
Pokitto 35:4f7edccf8ed6 433 #define POK_STREAM_TO_DAC 1 // 1 = stream from SD to DAC, synthesizer to PWM, 0 = opposite
Pokitto 35:4f7edccf8ed6 434 #else
Pokitto 35:4f7edccf8ed6 435 #define POK_STREAM_TO_DAC PROJ_STREAM_TO_DAC
Pokitto 35:4f7edccf8ed6 436 #endif
Pokitto 0:e8b8f36b4505 437
Pokitto 0:e8b8f36b4505 438
Pokitto 0:e8b8f36b4505 439 #define POK_BACKLIGHT_PIN P2_2
Pokitto 0:e8b8f36b4505 440 #define POK_BACKLIGHT_INITIALVALUE 0.3f
Pokitto 0:e8b8f36b4505 441
Pokitto 0:e8b8f36b4505 442 #define POK_BATTERY_PIN1 P0_22 // read battery level through these pins
Pokitto 0:e8b8f36b4505 443 #define POK_BATTERY_PIN2 P0_23
Pokitto 0:e8b8f36b4505 444
Pokitto 0:e8b8f36b4505 445 #define POK_BTN_A_PIN P1_9
Pokitto 0:e8b8f36b4505 446 #define POK_BTN_B_PIN P1_4
Pokitto 0:e8b8f36b4505 447 #define POK_BTN_C_PIN P1_10
Pokitto 0:e8b8f36b4505 448 #define POK_BTN_UP_PIN P1_13
Pokitto 0:e8b8f36b4505 449 #define POK_BTN_DOWN_PIN P1_3
Pokitto 0:e8b8f36b4505 450 #define POK_BTN_LEFT_PIN P1_25
Pokitto 0:e8b8f36b4505 451 #define POK_BTN_RIGHT_PIN P1_7
Pokitto 0:e8b8f36b4505 452
Pokitto 0:e8b8f36b4505 453 #define UPBIT 0
Pokitto 0:e8b8f36b4505 454 #define DOWNBIT 1
Pokitto 0:e8b8f36b4505 455 #define LEFTBIT 2
Pokitto 0:e8b8f36b4505 456 #define RIGHTBIT 3
Pokitto 0:e8b8f36b4505 457 #define ABIT 4
Pokitto 0:e8b8f36b4505 458 #define BBIT 5
Pokitto 0:e8b8f36b4505 459 #define CBIT 6
Pokitto 0:e8b8f36b4505 460
Pokitto 17:10609a82d462 461 /** LOADER UPDATE MECHANISM **/
Pokitto 17:10609a82d462 462 #define POK_ENABLE_LOADER_UPDATES 1 //1=check for new loader versions on SD and update if new found
Pokitto 17:10609a82d462 463
Pokitto 23:f88837b8f914 464 #ifndef SPRITE_COUNT
Pokitto 23:f88837b8f914 465 #define SPRITE_COUNT 4 // The default max sprite count
Pokitto 23:f88837b8f914 466 #endif
Pokitto 23:f88837b8f914 467
Pokitto 28:958b71c4b92a 468 /** SYSTEM SETTINGS ADDRESSES IN EEPROM **/
Pokitto 35:4f7edccf8ed6 469 #define EESETTINGS_FILENAME 3980 // 0xF8C 20bytes last filename requested
Pokitto 35:4f7edccf8ed6 470 #define EESETTINGS_VOL 4000 // 0xFA0 Volume
Pokitto 35:4f7edccf8ed6 471 #define EESETTINGS_DEFAULTVOL 4001 // 0xFA1 Default volume
Pokitto 35:4f7edccf8ed6 472 #define EESETTINGS_LOADERWAIT 4002 // 0xFA2 Loader wait in sec
Pokitto 35:4f7edccf8ed6 473 #define EESETTINGS_VOLWAIT 4003 // 0xFA3 Volume screen wait in sec
Pokitto 35:4f7edccf8ed6 474 #define EESETTINGS_TIMEFORMAT 4004 // 0xFA4 Time format (0=24 hrs, 1 = 12 hrs)
Pokitto 35:4f7edccf8ed6 475 #define EESETTINGS_LASTHOURSSET 4005 // 0xFA5 Last time set in hours
Pokitto 35:4f7edccf8ed6 476 #define EESETTINGS_LASTMINUTESSET 4006 // 0xFA6 Last time set in minutes
Pokitto 35:4f7edccf8ed6 477 #define EESETTINGS_DATEFORMAT 4007 // 0xFA7 Date format (0=D/M/Y, 1 = M/D/Y)
Pokitto 35:4f7edccf8ed6 478 #define EESETTINGS_LASTDAYSET 4008 // 0xFA8 Last Day set
Pokitto 35:4f7edccf8ed6 479 #define EESETTINGS_LASTMONTHSET 4009 // 0xFA9 Last Month set
Pokitto 35:4f7edccf8ed6 480 #define EESETTINGS_LASTYEARSET 4010 // 0xFAA Last Year set (counting from 2000)
Pokitto 35:4f7edccf8ed6 481 #define EESETTINGS_RTCALARMMODE 4011 // 0xFAB RTC alarm mode (0=disabled, 1=enabled, 3 = enabled with sound)
Pokitto 35:4f7edccf8ed6 482 #define EESETTINGS_RESERVED 4012 // 0xFAC 4bytes reserved (additional sleep configuration)
Pokitto 35:4f7edccf8ed6 483 #define EESETTINGS_WAKEUPTIME 4016 // 0xFB0 Wake-up time as 32bit value for 1Hz RTC clock
Pokitto 35:4f7edccf8ed6 484
Pokitto 28:958b71c4b92a 485
Pokitto 0:e8b8f36b4505 486 #endif // POKITTO_SETTINGS_H
Pokitto 0:e8b8f36b4505 487
Pokitto 30:796f9611d2ac 488