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

Committer:
Pokitto
Date:
Tue Jan 30 10:41:12 2018 +0000
Revision:
30:796f9611d2ac
Parent:
28:958b71c4b92a
Child:
35:4f7edccf8ed6
Sound enhancements done

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 4:ecf2fe370c1c 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 0:e8b8f36b4505 67 #ifndef PROJ_GBSOUND
Pokitto 4:ecf2fe370c1c 68 #if POK_ENABLE_SOUND > 0
Pokitto 4:ecf2fe370c1c 69 #define POK_GBSOUND 0
Pokitto 4:ecf2fe370c1c 70 #endif
Pokitto 0:e8b8f36b4505 71 #else
Pokitto 0:e8b8f36b4505 72 #define POK_GBSOUND PROJ_GBSOUND
Pokitto 0:e8b8f36b4505 73 #endif
Pokitto 0:e8b8f36b4505 74
Pokitto 0:e8b8f36b4505 75
Pokitto 0:e8b8f36b4505 76 #ifndef PROJ_STREAMING_MUSIC
Pokitto 4:ecf2fe370c1c 77 #if POK_ENABLE_SOUND > 0
Pokitto 4:ecf2fe370c1c 78 #define POK_STREAMING_MUSIC 1 // Define true to stream music from SD
Pokitto 4:ecf2fe370c1c 79 #endif
Pokitto 0:e8b8f36b4505 80 #else
Pokitto 0:e8b8f36b4505 81 #define POK_STREAMING_MUSIC PROJ_STREAMING_MUSIC
Pokitto 0:e8b8f36b4505 82 #endif // PROJ_STREAMING_MUSIC
Pokitto 0:e8b8f36b4505 83
Pokitto 0:e8b8f36b4505 84 #ifndef PROJ_ENABLE_SYNTH
Pokitto 0:e8b8f36b4505 85 #define POK_ENABLE_SYNTH 0
Pokitto 0:e8b8f36b4505 86 #else
Pokitto 0:e8b8f36b4505 87 #define POK_ENABLE_SYNTH PROJ_ENABLE_SYNTH
Pokitto 0:e8b8f36b4505 88 #endif // PROJ_ENABLE_SYNTH
Pokitto 0:e8b8f36b4505 89
Pokitto 0:e8b8f36b4505 90
Pokitto 0:e8b8f36b4505 91 /** CONSOLE **/
Pokitto 30:796f9611d2ac 92 #define POK_USE_CONSOLE 0 //if debugging console is available or not
Pokitto 0:e8b8f36b4505 93 #define POK_CONSOLE_VISIBLE_AT_STARTUP 1 // whaddaya think ?
Pokitto 0:e8b8f36b4505 94 #define POK_CONSOLE_INTERVAL 1000 // interval in ms how often console is drawn
Pokitto 0:e8b8f36b4505 95 #if POK_USE_CONSOLE > 0 // this prevents trying to log messages if console is disabled
Pokitto 0:e8b8f36b4505 96 #define POK_CONSOLE_LOG_BUTTONS 0 // if console logs keypresses
Pokitto 0:e8b8f36b4505 97 #define POK_CONSOLE_LOG_COLLISIONS 1 // if console logs collisions
Pokitto 0:e8b8f36b4505 98 #endif // POK_USE_CONSOLE
Pokitto 0:e8b8f36b4505 99 #define CONSOLEBUFSIZE 20
Pokitto 0:e8b8f36b4505 100 #define POK_SHOW_VOLUME 0 // volumebar drawn after console if enabled
Pokitto 0:e8b8f36b4505 101 #define VOLUMEBAR_TIMEOUT 10 // frames before disappearing
Pokitto 0:e8b8f36b4505 102
Pokitto 0:e8b8f36b4505 103 /** PROJECT LIBRARY TYPE **/
Pokitto 0:e8b8f36b4505 104 // Tiled mode can NOT be buffered mode (fast mode, arduboy mode, gamebuino mode etc)
Pokitto 0:e8b8f36b4505 105 #if PROJ_TILEDMODE > 0
Pokitto 0:e8b8f36b4505 106 #define POK_TILEDMODE 1
Pokitto 0:e8b8f36b4505 107 #ifdef PROJ_TILEWIDTH
Pokitto 0:e8b8f36b4505 108 #define POK_TILE_W PROJ_TILEWIDTH
Pokitto 0:e8b8f36b4505 109 #else
Pokitto 0:e8b8f36b4505 110 #define POK_TILE_W 11
Pokitto 0:e8b8f36b4505 111 #endif // PROJ_TILEWIDTH
Pokitto 0:e8b8f36b4505 112 #if POK_TILE_W == 11
Pokitto 0:e8b8f36b4505 113 #define POK_TILES_X 20
Pokitto 0:e8b8f36b4505 114 #define LCDWIDTH 220
Pokitto 0:e8b8f36b4505 115 #elif POK_TILE_W == 12
Pokitto 0:e8b8f36b4505 116 #define POK_TILES_X 18
Pokitto 0:e8b8f36b4505 117 #define LCDWIDTH 216
Pokitto 0:e8b8f36b4505 118 #elif POK_TILE_W == 8
Pokitto 0:e8b8f36b4505 119 #define POK_TILES_X 27
Pokitto 0:e8b8f36b4505 120 #define LCDWIDTH 216
Pokitto 0:e8b8f36b4505 121 #elif POK_TILE_W == 32
Pokitto 0:e8b8f36b4505 122 #define POK_TILES_X 6
Pokitto 0:e8b8f36b4505 123 #define LCDWIDTH 220
Pokitto 0:e8b8f36b4505 124 #elif POK_TILE_W == 10
Pokitto 0:e8b8f36b4505 125 #define POK_TILES_X 22
Pokitto 0:e8b8f36b4505 126 #define LCDWIDTH 220
Pokitto 0:e8b8f36b4505 127 #elif POK_TILE_W == 14
Pokitto 0:e8b8f36b4505 128 #define POK_TILES_X 15
Pokitto 0:e8b8f36b4505 129 #define LCDWIDTH 210
Pokitto 0:e8b8f36b4505 130 #endif
Pokitto 0:e8b8f36b4505 131 #ifdef PROJ_TILEHEIGHT
Pokitto 0:e8b8f36b4505 132 #define POK_TILE_H PROJ_TILEHEIGHT
Pokitto 0:e8b8f36b4505 133 #else
Pokitto 0:e8b8f36b4505 134 #define POK_TILE_H 11
Pokitto 0:e8b8f36b4505 135 #endif // PROJ_TILEHEIGHT
Pokitto 0:e8b8f36b4505 136 #if POK_TILE_H == 11
Pokitto 0:e8b8f36b4505 137 #define POK_TILES_Y 16
Pokitto 0:e8b8f36b4505 138 #define LCDHEIGHT 176
Pokitto 0:e8b8f36b4505 139 #elif POK_TILE_H == 12
Pokitto 0:e8b8f36b4505 140 #define POK_TILES_Y 14
Pokitto 0:e8b8f36b4505 141 #define LCDHEIGHT 168
Pokitto 0:e8b8f36b4505 142 #elif POK_TILE_H == 8
Pokitto 0:e8b8f36b4505 143 #define POK_TILES_Y 22
Pokitto 0:e8b8f36b4505 144 #define LCDHEIGHT 176
Pokitto 0:e8b8f36b4505 145 #elif POK_TILE_H == 32
Pokitto 0:e8b8f36b4505 146 #define POK_TILES_Y 5
Pokitto 0:e8b8f36b4505 147 #define LCDHEIGHT 176
Pokitto 0:e8b8f36b4505 148 #elif POK_TILE_H == 10
Pokitto 0:e8b8f36b4505 149 #define POK_TILES_Y 17
Pokitto 0:e8b8f36b4505 150 #define LCDHEIGHT 170
Pokitto 0:e8b8f36b4505 151 #elif POK_TILE_H == 14
Pokitto 0:e8b8f36b4505 152 #define POK_TILES_Y 12
Pokitto 0:e8b8f36b4505 153 #define LCDHEIGHT 168
Pokitto 0:e8b8f36b4505 154 #endif
Pokitto 0:e8b8f36b4505 155 #else
Pokitto 0:e8b8f36b4505 156 #if PROJ_GAMEBUINO > 0
Pokitto 0:e8b8f36b4505 157 #define POK_GAMEBUINO_SUPPORT PROJ_GAMEBUINO // Define true to support Gamebuino library calls
Pokitto 0:e8b8f36b4505 158 #define PROJ_SCREENMODE MODE_GAMEBUINO_16COLOR
Pokitto 0:e8b8f36b4505 159 #define POK_STRETCH 1
Pokitto 0:e8b8f36b4505 160 #define PICOPALETTE 0
Pokitto 0:e8b8f36b4505 161 #define POK_COLORDEPTH 4
Pokitto 0:e8b8f36b4505 162 #else
Pokitto 0:e8b8f36b4505 163 #if PROJ_ARDUBOY > 0
Pokitto 0:e8b8f36b4505 164 #define POK_ARDUBOY_SUPPORT PROJ_ARDUBOY // Define true to support Arduboy library calls
Pokitto 0:e8b8f36b4505 165 #define PROJ_SCREENMODE MODE_ARDUBOY_16COLOR
Pokitto 0:e8b8f36b4505 166 #define POK_COLORDEPTH 1
Pokitto 0:e8b8f36b4505 167 #define POK_STRETCH 1
Pokitto 0:e8b8f36b4505 168 #define POK_FPS 20
Pokitto 0:e8b8f36b4505 169 #define PICOPALETTE 0
Pokitto 0:e8b8f36b4505 170 #else
Pokitto 0:e8b8f36b4505 171 #if PROJ_RBOY > 0
Pokitto 0:e8b8f36b4505 172 #define PROJ_SCREENMODE MODE_GAMEBUINO_16COLOR
Pokitto 0:e8b8f36b4505 173 #define POK_COLORDEPTH 1
Pokitto 0:e8b8f36b4505 174 #define POK_STRETCH 0
Pokitto 0:e8b8f36b4505 175 #define POK_FPS 40
Pokitto 0:e8b8f36b4505 176 #define PICOPALETTE 0
Pokitto 0:e8b8f36b4505 177 #else
Pokitto 0:e8b8f36b4505 178 #if PROJ_GAMEBOY > 0
Pokitto 0:e8b8f36b4505 179 #define PROJ_SCREENMODE MODE_GAMEBOY
Pokitto 0:e8b8f36b4505 180 #define POK_COLORDEPTH 2
Pokitto 0:e8b8f36b4505 181 #define POK_STRETCH 0
Pokitto 0:e8b8f36b4505 182 #define POK_FPS 6
Pokitto 0:e8b8f36b4505 183 #define PICOPALETTE 0
Pokitto 0:e8b8f36b4505 184 #else
Pokitto 0:e8b8f36b4505 185 #define POK_GAMEBUINO_SUPPORT 0
Pokitto 0:e8b8f36b4505 186 #define POK_GAMEBOY_SUPPORT 0
Pokitto 0:e8b8f36b4505 187 #define POK_ARDUBOY_SUPPORT 0
Pokitto 0:e8b8f36b4505 188 #define PICOPALETTE 0
Pokitto 0:e8b8f36b4505 189 #define POK_COLORDEPTH 4
Pokitto 0:e8b8f36b4505 190 #endif // PROJ_GAMEBOY
Pokitto 0:e8b8f36b4505 191 #endif // PROJ_RBOY
Pokitto 0:e8b8f36b4505 192 #endif // PROJ_ARDUBOY
Pokitto 0:e8b8f36b4505 193 #endif // PROJ_GAMEBUINO
Pokitto 0:e8b8f36b4505 194 #endif // PROJ_TILEDMODE
Pokitto 0:e8b8f36b4505 195
Pokitto 30:796f9611d2ac 196 #if PROJ_MODE13 > 0
Pokitto 30:796f9611d2ac 197 #define PROJ_SCREENMODE MODE13
Pokitto 30:796f9611d2ac 198 #define POK_COLORDEPTH 8
Pokitto 30:796f9611d2ac 199 #define POK_STRETCH 0
Pokitto 30:796f9611d2ac 200 #define POK_FPS 30
Pokitto 30:796f9611d2ac 201 #define POK_COLORDEPTH 8
Pokitto 30:796f9611d2ac 202 #endif
Pokitto 30:796f9611d2ac 203
Pokitto 30:796f9611d2ac 204
Pokitto 0:e8b8f36b4505 205 /** SCREEN MODES TABLE -- DO NOT CHANGE THESE **/
Pokitto 0:e8b8f36b4505 206
Pokitto 0:e8b8f36b4505 207 #define POK_LCD_W 220 //<- do not change !!
Pokitto 0:e8b8f36b4505 208 #define POK_LCD_H 176 //<- do not change !!
Pokitto 0:e8b8f36b4505 209
Pokitto 0:e8b8f36b4505 210 #define MODE_NOBUFFER 0 //Size: 0
Pokitto 0:e8b8f36b4505 211 #define BUFSIZE_NOBUFFER 0
Pokitto 0:e8b8f36b4505 212 #define MODE_HI_4COLOR 1 //Size: 9680
Pokitto 0:e8b8f36b4505 213 #define BUFSIZE_HI_4 9680
Pokitto 0:e8b8f36b4505 214 #define MODE_FAST_16COLOR 2 //Size: 4840
Pokitto 0:e8b8f36b4505 215 #define BUFSIZE_FAST_16 4840
Pokitto 0:e8b8f36b4505 216 #define MODE_HI_16COLOR 3
Pokitto 0:e8b8f36b4505 217 #define BUFSIZE_HI_16 19360
Pokitto 0:e8b8f36b4505 218 #define MODE_GAMEBUINO_16COLOR 4 //Size: 2016
Pokitto 0:e8b8f36b4505 219 #define BUFSIZE_GAMEBUINO_16 2016
Pokitto 0:e8b8f36b4505 220 #define MODE_ARDUBOY_16COLOR 5 //Size: 4096
Pokitto 0:e8b8f36b4505 221 #define BUFSIZE_ARDUBOY_16 4096
Pokitto 0:e8b8f36b4505 222 #define MODE_HI_MONOCHROME 6 //Size: 4840
Pokitto 0:e8b8f36b4505 223 #define BUFSIZE_HI_MONO 4840
Pokitto 0:e8b8f36b4505 224 #define MODE_HI_GRAYSCALE 7 //Size: 9680
Pokitto 0:e8b8f36b4505 225 #define BUFSIZE_HI_GS 9680
Pokitto 0:e8b8f36b4505 226 #define MODE_GAMEBOY 8
Pokitto 0:e8b8f36b4505 227 #define BUFSIZE_GAMEBOY 5760
Pokitto 0:e8b8f36b4505 228 #define MODE_UZEBOX 9
Pokitto 0:e8b8f36b4505 229 #define MODE_TVOUT 10
Pokitto 0:e8b8f36b4505 230 #define MODE_LAMENES 11
Pokitto 0:e8b8f36b4505 231 #define BUFSIZE_LAMENES 7680
Pokitto 0:e8b8f36b4505 232 #define MODE_256_COLOR 12
Pokitto 0:e8b8f36b4505 233 #define BUFSIZE_MODE_12 4176 // 72 x 58
Pokitto 30:796f9611d2ac 234 #define MODE13 13
Pokitto 30:796f9611d2ac 235 #define BUFSIZE_MODE13 9680 // 110*88
Pokitto 0:e8b8f36b4505 236 // Tiled modes
Pokitto 0:e8b8f36b4505 237 #define MODE_TILED_1BIT 1001
Pokitto 0:e8b8f36b4505 238 #define MODE_TILED_8BIT 1002
Pokitto 0:e8b8f36b4505 239
Pokitto 0:e8b8f36b4505 240
Pokitto 0:e8b8f36b4505 241
Pokitto 0:e8b8f36b4505 242 /** SCREENMODE - USE THIS SELECTION FOR YOUR PROJECT **/
Pokitto 0:e8b8f36b4505 243
Pokitto 0:e8b8f36b4505 244 #if POK_TILEDMODE > 0
Pokitto 0:e8b8f36b4505 245 #ifndef PROJ_TILEBITDEPTH
Pokitto 0:e8b8f36b4505 246 #define PROJ_TILEBITDEPTH 8 //default tiling mode is 256 color mode!
Pokitto 0:e8b8f36b4505 247 #endif // PROJ_TILEBITDEPTH
Pokitto 0:e8b8f36b4505 248 #if PROJ_TILEBITDEPTH == 1
Pokitto 0:e8b8f36b4505 249 #define POK_SCREENMODE MODE_TILED_1BIT
Pokitto 0:e8b8f36b4505 250 #define POK_COLORDEPTH 1
Pokitto 0:e8b8f36b4505 251 #else
Pokitto 0:e8b8f36b4505 252 #define POK_SCREENMODE MODE_TILED_8BIT
Pokitto 0:e8b8f36b4505 253 #define POK_COLORDEPTH 8
Pokitto 0:e8b8f36b4505 254 #endif // PROJ_TILEBITDEPTH
Pokitto 0:e8b8f36b4505 255 #else
Pokitto 0:e8b8f36b4505 256 #ifndef PROJ_SCREENMODE
Pokitto 5:ea7377f3d1af 257 #undef POK_COLORDEPTH
Pokitto 0:e8b8f36b4505 258 #ifdef PROJ_HIRES
Pokitto 0:e8b8f36b4505 259 #if PROJ_HIRES > 0
Pokitto 0:e8b8f36b4505 260 #define POK_SCREENMODE MODE_HI_4COLOR
Pokitto 5:ea7377f3d1af 261 #undef POK_COLORDEPTH
Pokitto 0:e8b8f36b4505 262 #define POK_COLORDEPTH 2
Pokitto 0:e8b8f36b4505 263 #elif PROJ_HICOLOR > 0
Pokitto 0:e8b8f36b4505 264 #define POK_SCREENMODE MODE_256_COLOR
Pokitto 5:ea7377f3d1af 265 #undef POK_COLORDEPTH
Pokitto 0:e8b8f36b4505 266 #define POK_COLORDEPTH 8
Pokitto 0:e8b8f36b4505 267 #else
Pokitto 0:e8b8f36b4505 268 #define POK_SCREENMODE MODE_FAST_16COLOR
Pokitto 5:ea7377f3d1af 269 #undef POK_COLORDEPTH
Pokitto 0:e8b8f36b4505 270 #define POK_COLORDEPTH 4
Pokitto 0:e8b8f36b4505 271 #endif // PROJ_HIRES
Pokitto 0:e8b8f36b4505 272 #else
Pokitto 0:e8b8f36b4505 273 #define POK_SCREENMODE MODE_FAST_16COLOR
Pokitto 0:e8b8f36b4505 274 #define POK_COLORDEPTH 4
Pokitto 0:e8b8f36b4505 275 #endif // PROJ_HIRES
Pokitto 0:e8b8f36b4505 276 #else
Pokitto 0:e8b8f36b4505 277 #define POK_SCREENMODE PROJ_SCREENMODE
Pokitto 0:e8b8f36b4505 278 #endif
Pokitto 0:e8b8f36b4505 279 #endif // POK_TILEDMODE
Pokitto 0:e8b8f36b4505 280
Pokitto 0:e8b8f36b4505 281 /* DEFINE SCREENMODE AS THE MAXIMUM SCREEN SIZE NEEDED BY YOUR APP ... SEE SIZES LISTED ABOVE */
Pokitto 0:e8b8f36b4505 282
Pokitto 0:e8b8f36b4505 283 /** AUTOMATIC COLOR DEPTH SETTING - DO NOT CHANGE **/
Pokitto 0:e8b8f36b4505 284 #ifndef POK_COLORDEPTH
Pokitto 0:e8b8f36b4505 285 #define POK_COLORDEPTH 4 // 1...5 is valid
Pokitto 0:e8b8f36b4505 286 #endif // POK_COLORDEPTH
Pokitto 0:e8b8f36b4505 287
Pokitto 0:e8b8f36b4505 288 /** AUTOMATIC SCREEN BUFFER SIZE CALCULATION - DO NOT CHANGE **/
Pokitto 0:e8b8f36b4505 289 #if POK_SCREENMODE == 0
Pokitto 0:e8b8f36b4505 290 #define POK_SCREENBUFFERSIZE 0
Pokitto 0:e8b8f36b4505 291 #define LCDWIDTH POK_LCD_W
Pokitto 0:e8b8f36b4505 292 #define LCDHEIGHT POK_LCD_H
Pokitto 0:e8b8f36b4505 293 #define POK_BITFRAME 0
Pokitto 0:e8b8f36b4505 294 #elif POK_SCREENMODE == MODE_HI_MONOCHROME
Pokitto 0:e8b8f36b4505 295 #define POK_SCREENBUFFERSIZE POK_LCD_W*POK_LCD_H*POK_COLORDEPTH/8
Pokitto 0:e8b8f36b4505 296 #define LCDWIDTH POK_LCD_W
Pokitto 0:e8b8f36b4505 297 #define LCDHEIGHT POK_LCD_H
Pokitto 0:e8b8f36b4505 298 #define POK_BITFRAME 4840
Pokitto 0:e8b8f36b4505 299 #elif POK_SCREENMODE == MODE_HI_16COLOR
Pokitto 0:e8b8f36b4505 300 #define POK_SCREENBUFFERSIZE POK_LCD_W*POK_LCD_H/2
Pokitto 0:e8b8f36b4505 301 #define LCDWIDTH 220
Pokitto 0:e8b8f36b4505 302 #define LCDHEIGHT 176
Pokitto 0:e8b8f36b4505 303 #define POK_BITFRAME 4840
Pokitto 0:e8b8f36b4505 304 #elif POK_SCREENMODE == MODE_HI_4COLOR || POK_SCREENMODE == MODE_HI_GRAYSCALE
Pokitto 0:e8b8f36b4505 305 #define POK_SCREENBUFFERSIZE POK_LCD_W*POK_LCD_H*POK_COLORDEPTH/4
Pokitto 0:e8b8f36b4505 306 #define LCDWIDTH POK_LCD_W
Pokitto 0:e8b8f36b4505 307 #define LCDHEIGHT POK_LCD_H
Pokitto 0:e8b8f36b4505 308 #define POK_BITFRAME 4840
Pokitto 0:e8b8f36b4505 309 #elif POK_SCREENMODE == MODE_FAST_16COLOR
Pokitto 0:e8b8f36b4505 310 #define POK_SCREENBUFFERSIZE (POK_LCD_W/2)*(POK_LCD_H/2)*POK_COLORDEPTH/8
Pokitto 0:e8b8f36b4505 311 #define XCENTER POK_LCD_W/4
Pokitto 0:e8b8f36b4505 312 #define YCENTER POK_LCD_H/4
Pokitto 0:e8b8f36b4505 313 #define LCDWIDTH 110
Pokitto 0:e8b8f36b4505 314 #define LCDHEIGHT 88
Pokitto 0:e8b8f36b4505 315 #define POK_BITFRAME 1210
Pokitto 0:e8b8f36b4505 316 #elif POK_SCREENMODE == MODE_256_COLOR
Pokitto 0:e8b8f36b4505 317 #define POK_SCREENBUFFERSIZE 72*58
Pokitto 0:e8b8f36b4505 318 #define XCENTER 36
Pokitto 0:e8b8f36b4505 319 #define YCENTER 29
Pokitto 0:e8b8f36b4505 320 #define LCDWIDTH 72
Pokitto 0:e8b8f36b4505 321 #define LCDHEIGHT 58
Pokitto 0:e8b8f36b4505 322 #define POK_BITFRAME 72*58
Pokitto 0:e8b8f36b4505 323 #elif POK_SCREENMODE == MODE_GAMEBUINO_16COLOR
Pokitto 0:e8b8f36b4505 324 #define POK_SCREENBUFFERSIZE (84/2)*(48/2)*POK_COLORDEPTH/8
Pokitto 0:e8b8f36b4505 325 #define LCDWIDTH 84
Pokitto 0:e8b8f36b4505 326 #define LCDHEIGHT 48
Pokitto 0:e8b8f36b4505 327 #define POK_BITFRAME 504
Pokitto 0:e8b8f36b4505 328 #elif POK_SCREENMODE == MODE_ARDUBOY_16COLOR
Pokitto 0:e8b8f36b4505 329 #define POK_SCREENBUFFERSIZE (128/2)*(64/2)*POK_COLORDEPTH/8
Pokitto 0:e8b8f36b4505 330 #define LCDWIDTH 128
Pokitto 0:e8b8f36b4505 331 #define LCDHEIGHT 64
Pokitto 0:e8b8f36b4505 332 #define POK_BITFRAME 1024
Pokitto 0:e8b8f36b4505 333 #elif POK_SCREENMODE == MODE_LAMENES
Pokitto 0:e8b8f36b4505 334 #define POK_SCREENBUFFERSIZE (128)*(120)*POK_COLORDEPTH/8
Pokitto 0:e8b8f36b4505 335 #define LCDWIDTH 128
Pokitto 0:e8b8f36b4505 336 #define LCDHEIGHT 120
Pokitto 0:e8b8f36b4505 337 #define POK_BITFRAME 1210
Pokitto 0:e8b8f36b4505 338 #elif POK_SCREENMODE == MODE_GAMEBOY
Pokitto 0:e8b8f36b4505 339 #define POK_SCREENBUFFERSIZE (160)*(144)/4
Pokitto 0:e8b8f36b4505 340 #define LCDWIDTH 160
Pokitto 0:e8b8f36b4505 341 #define LCDHEIGHT 144
Pokitto 0:e8b8f36b4505 342 #define POK_BITFRAME 2880
Pokitto 30:796f9611d2ac 343 #elif POK_SCREENMODE == MODE13
Pokitto 30:796f9611d2ac 344 #define POK_SCREENBUFFERSIZE 110*88
Pokitto 30:796f9611d2ac 345 #define LCDWIDTH 110
Pokitto 30:796f9611d2ac 346 #define LCDHEIGHT 88
Pokitto 30:796f9611d2ac 347 #define POK_BITFRAME 110*88
Pokitto 0:e8b8f36b4505 348 #else
Pokitto 0:e8b8f36b4505 349 #define POK_SCREENBUFFERSIZE 0
Pokitto 0:e8b8f36b4505 350 #endif // POK_SCREENMODE
Pokitto 0:e8b8f36b4505 351
Pokitto 0:e8b8f36b4505 352 #ifndef POK_STRETCH
Pokitto 0:e8b8f36b4505 353 #define POK_STRETCH 1 // Stretch Gamebuino display
Pokitto 0:e8b8f36b4505 354 #endif
Pokitto 0:e8b8f36b4505 355 #ifndef POK_FPS
Pokitto 0:e8b8f36b4505 356 #define POK_FPS 20
Pokitto 0:e8b8f36b4505 357 #endif
Pokitto 0:e8b8f36b4505 358 #define POK_FRAMEDURATION 1000/POK_FPS
Pokitto 0:e8b8f36b4505 359
Pokitto 0:e8b8f36b4505 360 /** SCROLL TEXT VS. WRAP AROUND WHEN PRINTING **/
Pokitto 0:e8b8f36b4505 361 #define SCROLL_TEXT 1
Pokitto 0:e8b8f36b4505 362
Pokitto 0:e8b8f36b4505 363 /** AUDIO **/
Pokitto 0:e8b8f36b4505 364 #define POK_AUD_PIN P2_19
Pokitto 30:796f9611d2ac 365 #define POK_AUD_PWM_US 15 //31 //Default value 31
Pokitto 30:796f9611d2ac 366 #define POK_AUD_FREQ 22050 //Valid values: 8000, 11025, 16000, 22050 // audio update frequency in Hz
Pokitto 30:796f9611d2ac 367 //#define POK_CINC_MULTIPLIER 0 // multiplies synth cycle table
Pokitto 0:e8b8f36b4505 368 #define POK_STREAMFREQ_HALVE 0 // if true, stream update freq is half audio freq
Pokitto 0:e8b8f36b4505 369 #define POK_STREAM_LOOP 1 //master switch
Pokitto 0:e8b8f36b4505 370
Pokitto 0:e8b8f36b4505 371 #define POK_USE_DAC 1 // is DAC in use in this project
Pokitto 0:e8b8f36b4505 372 #define POK_USE_EXT 0 // if extension port is in use or not
Pokitto 0:e8b8f36b4505 373 #define POK_STREAM_TO_DAC 1 // 1 = stream from SD to DAC, synthesizer to PWM, 0 = opposite
Pokitto 0:e8b8f36b4505 374
Pokitto 0:e8b8f36b4505 375
Pokitto 0:e8b8f36b4505 376 #define POK_BACKLIGHT_PIN P2_2
Pokitto 0:e8b8f36b4505 377 #define POK_BACKLIGHT_INITIALVALUE 0.3f
Pokitto 0:e8b8f36b4505 378
Pokitto 0:e8b8f36b4505 379 #define POK_BATTERY_PIN1 P0_22 // read battery level through these pins
Pokitto 0:e8b8f36b4505 380 #define POK_BATTERY_PIN2 P0_23
Pokitto 0:e8b8f36b4505 381
Pokitto 0:e8b8f36b4505 382 #define POK_BTN_A_PIN P1_9
Pokitto 0:e8b8f36b4505 383 #define POK_BTN_B_PIN P1_4
Pokitto 0:e8b8f36b4505 384 #define POK_BTN_C_PIN P1_10
Pokitto 0:e8b8f36b4505 385 #define POK_BTN_UP_PIN P1_13
Pokitto 0:e8b8f36b4505 386 #define POK_BTN_DOWN_PIN P1_3
Pokitto 0:e8b8f36b4505 387 #define POK_BTN_LEFT_PIN P1_25
Pokitto 0:e8b8f36b4505 388 #define POK_BTN_RIGHT_PIN P1_7
Pokitto 0:e8b8f36b4505 389
Pokitto 0:e8b8f36b4505 390 #define UPBIT 0
Pokitto 0:e8b8f36b4505 391 #define DOWNBIT 1
Pokitto 0:e8b8f36b4505 392 #define LEFTBIT 2
Pokitto 0:e8b8f36b4505 393 #define RIGHTBIT 3
Pokitto 0:e8b8f36b4505 394 #define ABIT 4
Pokitto 0:e8b8f36b4505 395 #define BBIT 5
Pokitto 0:e8b8f36b4505 396 #define CBIT 6
Pokitto 0:e8b8f36b4505 397
Pokitto 17:10609a82d462 398 /** LOADER UPDATE MECHANISM **/
Pokitto 17:10609a82d462 399 #define POK_ENABLE_LOADER_UPDATES 1 //1=check for new loader versions on SD and update if new found
Pokitto 17:10609a82d462 400
Pokitto 23:f88837b8f914 401 #ifndef SPRITE_COUNT
Pokitto 23:f88837b8f914 402 #define SPRITE_COUNT 4 // The default max sprite count
Pokitto 23:f88837b8f914 403 #endif
Pokitto 23:f88837b8f914 404
Pokitto 28:958b71c4b92a 405 /** SYSTEM SETTINGS ADDRESSES IN EEPROM **/
Pokitto 28:958b71c4b92a 406 #define EESETTINGS_VOL 4000
Pokitto 28:958b71c4b92a 407
Pokitto 0:e8b8f36b4505 408 #endif // POKITTO_SETTINGS_H
Pokitto 0:e8b8f36b4505 409
Pokitto 30:796f9611d2ac 410