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

Dependents:   YATTT sd_map_test cPong SnowDemo ... more

PokittoLib

Library for programming Pokitto hardware

How to Use

  1. Import this library to online compiler (see button "import" on the right hand side
  2. DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
  3. Change My_settings.h according to your project
  4. Start coding!
Committer:
Pokitto
Date:
Mon Sep 18 11:47:51 2017 +0000
Revision:
0:e8b8f36b4505
Child:
4:ecf2fe370c1c
Initial;

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